17.10.0 • Published 9 months ago

@3kles/kles-material-dynamicforms v17.10.0

Weekly downloads
-
License
-
Repository
-
Last release
9 months ago

@3kles/kles-material-dynamicforms

kles-material-dynamicforms is a component library to build Material Angular Form.

Changelog

Check out the changelog to check all the latest changes.

Models

Directives

  • KlesComponentDirective -> Directive to inject component with value
  • KlesDynamicFieldDirective -> Directive to inject component with IFieldConfig in FormGroup

Interfaces

IKlesFieldConfig

Interface field model

  • type?: string -> Mapper type if(type && !component)=>type
  • name: string -> Name Field (key for FormControlName)
  • component?: Type\ -> Component field
  • id?: string -> Attribut html id
  • label?: string -> Label field
  • placeholder?: string -> Placeholder field
  • tooltip?: string -> Tooltip field
  • inputType?: string -> Input type
  • min?: number | Date -> Min value for number input or date field
  • max?: number | Date -> Max value for number input or date field
  • maxLength?: number -> Max length for input value
  • step?: number -> Define a step for number input
  • options?: any[] | Subject\<any[]> | Observable\<any[]> | ((value?: string) => Observable\<any[]>) -> List options for list component
  • ngClass?: any -> ngclass for field
  • ngStyle?: any -> ngStyle for field
  • property?: string -> Property for field
  • collections?: any -> Collections for subfield
  • value?: any -> Value field
  • asyncValue?: Observable\ -> Async value field
  • multiple?: boolean -> Multiple selection field
  • disabled?: boolean -> Disabled field
  • autocomplete?: boolean -> Autocomplete input field
  • autocompleteComponent?: Type<\any> -> Autocomplete component to display in list option
  • displayWith?: ((value: any) => string) | null -> Autocomplete display format
  • panelWidth?: string | number -> Width for panel list option
  • indeterminate?: boolean -> Indeterminate checkable component
  • color?: string -> Material color
  • icon?: string -> Material icon
  • iconSvg?: string -> Svg icon
  • textareaAutoSize?: { minRows?: number; maxRows?: number } -> Define a min and max number of rows for text area
  • validations?: IKlesValidator\[] -> Array of validators for a field
  • asyncValidations?: IKlesValidator\[] -> Array of async validators for a field
  • pipeTransform?: { pipe: PipeTransform, options?: any[] }[] -> Array of pipe to apply to value field
  • direction?: 'row' | 'column' -> Direction for the display of the fields
  • valueChanges?: ((field: IKlesFieldConfig, group: UntypedFormGroup, siblingField?: IKlesFieldConfig[], valueChanged?: any) => void) -> Emit each time the value is changing
  • triggerComponent?: Type\ -> Trigger component to customize trigger label in select
  • virtualScroll?: boolean -> To activate virtual scroll
  • itemSize?: number -> Item size for virtual scroll
  • pending?: boolean -> If the value is pending
  • searchKeys?: string[] -> List of keys for multiple searches
  • updateOn?: 'change' | 'blur' | 'submit' -> Set the update on diferent moment
  • debounceTime?: number -> Time in milliseconds before emit value after changed
  • directive?: (new (ref: ViewContainerRef, field: IKlesField) => IKlesDirective) -> Set a new directive to the field
  • visible?: boolean -> Set if the field is visible
  • lazy?: boolean -> Set if the field is lazy
  • buttonType?: 'submit' | 'button' | 'reset' -> Define the type of a button
  • accept?: string ->
  • dateOptions?: { adapter?: { class: Type<DateAdapter\>, deps?: any[] }, language: string, dateFormat: MatDateFormats } -> Define options for date field
  • hint?: string -> Display as a mat-hint for the field
  • clearable?: boolean -> Display a cross to clear the field
  • clearableComponent?: Type\ -> Define a new clearable component
  • subComponents?: Type\[] -> Define sub components of a field
  • autofocus?: boolean -> Set the autofocus on the field
  • attribute?: EnumButtonAttribute -> To display material button design
  • subscriptSizing?: SubscriptSizing ->
  • nonNullable?: boolean -> Set if the field can be null

Fields

  • KlesFormArrayComponent component that creates a form array of other components
  • KlesFormBadgeComponent component to display a badge
  • KlesFormFabComponent component to display a fab button
  • KlesFormButtonComponent component to display a button
  • KlesFormIconButtonComponent component to display an icon button
  • KlesFormMiniFabComponent component to display a mini fab button
  • KlesFormButtonToogleGroupComponent component to display a button group toggle
  • KlesFormButtonCheckerComponent component to check error in form
  • KlesFormButtonFileComponent button that take a file
  • KlesFormCheckboxComponent component to display a checkbox
  • KlesFormChipComponent component to display a chip
  • KlesFormClearComponent component to clear a form
  • KlesFormColorComponent component to select a color
  • KlesFormDateTimeComponent component to select a date with a time
  • KlesFormDateComponent component to select a date
  • KlesFieldAbstract abstract class to build field component
  • KlesFormGroupComponent component that creates a form group of other components
  • KlesFormIconComponent component to display a material icon
  • KlesFormInputClearableComponent component with an input that is clearable
  • KlesFormInputComponent component with an input
  • KlesFormLineBreakComponent component to go to the next line
  • KlesFormLinkComponent component that display a link
  • KlesFormListFieldComponent component to display a list
  • KlesFormRadioComponent component that display a material radio
  • KlesFormRangeComponent component to select a date range
  • KlesFormSelectComponent component to select a value in options
  • KlesFormSelectLazySearchComponent component to select in lazy options that can be filtered
  • KlesFormSelectSearchComponent component to select a value in options that can be filtered
  • KlesFormSelectionListComponent component to create a list with elements that can be selected
  • KlesFormSelectionListSearchComponent component to create a list with elements that can be selected and filtered
  • KlesFormSlideToggleComponent component to display a group toggle
  • KlesFormTextComponent component to display text
  • KlesFormTextareaComponent component to display a text area

Install

npm

npm install @3kles/kles-material-dynamicforms --save

How to use

In the module

import { KlesMaterialDynamicFormsModule } from '@3kles/kles-material-dynamicforms';
...
@NgModule({
 imports: [
    KlesMaterialDynamicFormsModule,
    ...
 ]
 ...
})

Check the documentation to use component and directive.

Tests

npm install
npm test

License

MIT

17.10.0

9 months ago

17.9.4

9 months ago

17.9.3

9 months ago

17.9.2

10 months ago

17.9.1

10 months ago

17.7.4

1 year ago

17.7.6

1 year ago

17.7.5

1 year ago

17.7.8

1 year ago

17.7.7

1 year ago

17.7.9

1 year ago

17.8.3

12 months ago

17.8.2

12 months ago

17.8.5

12 months ago

17.8.4

12 months ago

17.8.1

12 months ago

17.8.0

12 months ago

17.8.7

12 months ago

17.8.6

12 months ago

17.8.8

12 months ago

17.9.0

11 months ago

17.7.3

1 year ago

17.7.2

1 year ago

17.7.1

1 year ago

17.7.0

1 year ago

17.6.1

1 year ago

17.6.0

1 year ago

17.5.0

1 year ago

17.4.3

1 year ago

17.4.2

1 year ago

17.4.1

1 year ago

17.4.0

1 year ago

17.3.7

1 year ago

17.3.6

2 years ago

17.3.5

2 years ago

17.3.4

2 years ago

17.3.3

2 years ago

17.3.0

2 years ago

17.3.2

2 years ago

17.3.1

2 years ago

17.2.4

2 years ago

17.2.3

2 years ago

17.2.2

2 years ago

17.1.0

2 years ago

17.2.1

2 years ago

17.2.0

2 years ago

17.0.0

2 years ago

14.11.0

2 years ago

14.9.8

2 years ago

14.10.1

2 years ago

14.10.0

2 years ago

16.1.1

2 years ago

16.1.5

2 years ago

16.1.4

2 years ago

16.1.3

2 years ago

16.1.2

2 years ago

16.0.2

2 years ago

16.0.3

2 years ago

15.0.0

2 years ago

14.9.7

2 years ago

14.9.6

2 years ago

14.9.5

2 years ago

14.9.4

2 years ago

14.9.3

2 years ago

14.9.2

2 years ago

14.9.1

2 years ago

14.3.0

2 years ago

14.1.3

2 years ago

14.5.0

2 years ago

14.9.0

2 years ago

14.8.1

2 years ago

14.8.2

2 years ago

14.2.0

2 years ago

14.2.1

2 years ago

14.4.0

2 years ago

14.2.2

2 years ago

14.4.1

2 years ago

14.6.0

2 years ago

14.8.0

2 years ago

1.2.0

2 years ago

1.2.1

2 years ago

14.1.0

2 years ago

14.0.13

2 years ago

14.1.1

2 years ago

14.0.12

2 years ago

14.1.2

2 years ago

14.0.11

3 years ago

14.0.10

3 years ago

14.0.15

2 years ago

14.0.14

2 years ago

14.0.9

3 years ago

14.0.3

3 years ago

14.0.4

3 years ago

14.0.6

3 years ago

14.0.7

3 years ago

14.0.8

3 years ago

1.1.23

3 years ago

1.1.22

3 years ago

1.1.21

3 years ago

14.0.2

3 years ago

14.0.1

3 years ago

1.1.19

3 years ago

1.1.18

3 years ago

1.1.17

3 years ago

1.1.20

3 years ago

1.1.16

3 years ago

1.1.15

3 years ago

1.1.14

3 years ago

1.1.12

3 years ago

1.1.11

3 years ago

1.1.10

3 years ago

1.1.13

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago