npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dynamic-form-unizkm-hg

v1.9.19

Published

Dynamic Form UniZKM Library, creates form with fields and skeleton during loading fields

Readme

DynamicFormUniZKM HG

Dynamic Form UniZKM Library, creates form with fields and skeleton during loading fields

Creates Form Group with Form Controls and Validators

Installation

$ npm i dynamic-form-unizkm-hg

Usage

Import NgxDynamicFormModule into AppModule:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
 
import { AppComponent } from './app.component';
 
// Import your DynamicFormModule
import { DynamicFormModule } from 'dynamic-form-unizkm-hg';
 
@NgModule({
  declarations: [
    AppComponent,
    ...
  ],
  imports: [
    ...,
    // Import your DynamicFormModule
    DynamicFormModule,
    ...
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Use in Component.html:

<app-form [fields]="labels" 
          [values]="employee"
          [fieldDataPool]="dependencies"
          
          [order]="order" 
          [method]="method" 
          [appearance]="'outline'"
          
          (getValidity)="formValid = $event"
          
          class="expand-full-width" *ngIf="labels"></app-form>
      
          
<button appGetForm (form)="postFormData($event)" [disabled]="!valid">
  Insert
</button>
<button appResetForm>
  Reset
</button>

<button appGetForm (form)="putFormData($event)" [disabled]="!valid">
  Update
</button>

Use in Component.ts:

import {Component, Input, OnInit} from '@angular/core';
import {FieldOrderModel} from 'dynamic-form-unizkm-hg/dynamic-form/models/field-order.model';

@Component({
  selector: 'app-employee',
  templateUrl: './employee.component.html',
  styleUrls: ['./employee.component.css']
})
export class EmployeeComponent implements OnInit {
  ...
  
  labels: any;
  employee: any:
  dependencies: any:
  
  // dynamic form requirement variables
  order: FieldOrderModel = {
    id: {
      disable: true
    },
    firstName: {
      class: 'col-6'
    },
    lastName: {
      class: 'col-6'
    },
    birthdate: {
      class: 'col-12',
      disableTimePicker: true
    },
    email: {
      class: 'col-12'
    },
    managerId: {
      class: 'col-6',
      selectValue: 'managerFirstName managerLastName',
      methods: {
        keyup: this.getEmployees.bind(this),
        focus: this.getEmployees.bind(this)
      }
    },
    directorId: {
      class: 'col-6',
      selectValue: 'directorFirstName directorLastName',
      methods: {
        keyup: this.getEmployees.bind(this),
        focus: this.getEmployees.bind(this)
      }
    },
    officeNameId: {
      class: 'col-12',
      selectValue: 'officeName',
      multi: true
    }
  };
  method: string;
  valid: boolean;
  formData: any;

  constructor(...) { }

  ngOnInit() {
    ...
  }
  
  private _getEmployeeMeta() {
    this. ... .subscribe( (response: any) => {
      this.labels = response.body.data.fieldMap;
      this.method = 'POST';
    })
  }

  private _getEmployee(employeeId) {
    this. ...(employeeId).subscribe( (response: any) => {
      this.employee = response.body.data;
      this.method = 'PUT';
    })
  }

  getEmployees(firstName?) {
    this. ... .subscribe((response: any) => {
      this.dependencies = response.body.data.list;
    });
  }
                    
  // dynamic functions
  postFormData(form: any) {
    formData = form;
    
    setTimeout(() => {
    
      // your service
      ...
      
    });
  }

  putFormData(form: any) {
    formData = form;
    
    setTimeout(() => {
    
      // your service
      ...
      
    });
  }
}

Inputs

1: Fields input, [fields] receives as input KG OPTIONS Service:

"lastName":{
  "fieldName": "lastName",
  "fieldLabel": "Cognome",
  "inputType": "TEXT_INPUT",
  "canGet": true,
  "canPost": true,
  "canPut": true,
  "constraintList":{},
  "childFieldMeta":{}
},
"graduateCourseName":{
  "fieldName": "graduateCourseName",
  "fieldLabel": "Corso di Laurea ",
  "inputType": "TEXT_INPUT",
  "canGet": true,
  "canPost": true,
  "canPut": true,
  "constraintList":{},
  "childFieldMeta":{}
},
"registrationDate":{
  "fieldName": "registrationDate",
  "fieldLabel": "Data di amissione",
  "inputType": "DATE_INPUT",
  "canGet": true,
  "canPost": true,
  "canPut": true,
  "constraintList":{},
  "childFieldMeta":{}
}

And accepts inputType or {order['...'].multi: true, ...}:

"TEXT_INPUT"                                                        text input field
"DECIMAL_INPUT"                                                   number input field
"DATA_INPUT"                                                   timestamp input field
"TEXT_INPUT_AREA"                                    timestamp multiple inputs field
"COMBO_BOX"                                                       autocomplete field
"COMBO_BOX" + order['...'].multi: true;       multiple autocomplete with chips field

And accepts constraintList, Java Bean Validation:

"Min", "Max", "Pattern", "Email", "Size", "NotNull"

2: Values Input, [values] receives as input any data object that it keys match field keys above

3: FieldDataPool Input, [fieldDataPool] receives as input any data object list that contains "id" and "someLabel"

4: Method Input, [method] receives as input only "PUT" or "POST" methods

5: Order Input, [order] receives as input data object as this format:

id: {
  disabled: true;
},
firstName: {
  class: 'col-6'
},
lastName: {
  class: 'col-6'
},
birthdate: {
  class: 'col-12',
  disableTimePicker: true
},
email: {
  class: 'col-12'
},
managerId: {
  class: 'col-6',
  selectValue: 'managerFirstName managerLastName',
  methods: {
    keyup: this.passYourFunctionReference.bind(this),
    focus: this.passYourFunctionReference.bind(this)
  }
},
directorId: {
  class: 'col-6',
  selectValue: 'directorFirstName directorLastName',
  methods: {
    keyup: this.passYourFunctionReference.bind(this),
    focus: this.passYourFunctionReference.bind(this)
  }
},
officeNameId: {
  class: 'col-12',
  selectValue: 'officeName',
  multi: true
} 

Order can contain:

// You can import FieldOrderModel class to your project to have access to all Order autosuggestions 
export declare class FieldOrderModel {
    [key: string]: OrderConfigs;
}


export declare class OrderConfigs {
    class?: BootstrapClass;
    value?: string | any;
    selectValue?: string | any;
    multi?: boolean;
    display?: boolean;
    disableDatePicker?: boolean;
    disableTimePicker?: boolean;
    disableDateInputArea?: boolean;
    disableRemoveDateInputArea?: boolean;
    disabled?: boolean;
    canReset?: boolean;
    required?: boolean;
    methods?: Methods;
}
export declare class Methods {
    [command: string]: Function;
}
export declare type BootstrapClass = 'col-12' | 'col-6' | 'col-3';

Outputs

1: GetValidity Output, (getValidity) returns a boolean to enable or disable form action buttons

Click Listeners

1: AppGetForm, put on your "Create" or "Update" buttons 'appGetForm' and (form)="yourFunction($event)". On click you will receive back the form as an object.

2: AppResetForm, put on your "Reset" or "Cancel" buttons 'appResetForm'. On click form will be reset.