17.7.1 • Published 3 days ago

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

Weekly downloads
-
License
-
Repository
-
Last release
3 days 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.7.1

3 days ago

17.7.0

19 days ago

17.6.1

19 days ago

17.6.0

19 days ago

17.5.0

28 days ago

17.4.3

1 month ago

17.4.2

1 month ago

17.4.1

2 months ago

17.4.0

4 months ago

17.3.7

4 months ago

17.3.6

4 months ago

17.3.5

4 months ago

17.3.4

4 months ago

17.3.3

5 months ago

17.3.0

5 months ago

17.3.2

5 months ago

17.3.1

5 months ago

17.2.4

5 months ago

17.2.3

5 months ago

17.2.2

5 months ago

17.1.0

5 months ago

17.2.1

5 months ago

17.2.0

5 months ago

17.0.0

6 months ago

14.11.0

7 months ago

14.9.8

9 months ago

14.10.1

8 months ago

14.10.0

9 months ago

16.1.1

8 months ago

16.1.5

7 months ago

16.1.4

8 months ago

16.1.3

8 months ago

16.1.2

8 months ago

16.0.2

8 months ago

16.0.3

8 months ago

15.0.0

11 months ago

14.9.7

1 year ago

14.9.6

1 year ago

14.9.5

1 year ago

14.9.4

1 year ago

14.9.3

1 year ago

14.9.2

1 year ago

14.9.1

1 year ago

14.3.0

1 year ago

14.1.3

1 year ago

14.5.0

1 year ago

14.9.0

1 year ago

14.8.1

1 year ago

14.8.2

1 year ago

14.2.0

1 year ago

14.2.1

1 year ago

14.4.0

1 year ago

14.2.2

1 year ago

14.4.1

1 year ago

14.6.0

1 year ago

14.8.0

1 year ago

1.2.0

1 year ago

1.2.1

1 year ago

14.1.0

1 year ago

14.0.13

1 year ago

14.1.1

1 year ago

14.0.12

1 year ago

14.1.2

1 year ago

14.0.11

1 year ago

14.0.10

1 year ago

14.0.15

1 year ago

14.0.14

1 year ago

14.0.9

1 year ago

14.0.3

2 years ago

14.0.4

2 years ago

14.0.6

2 years ago

14.0.7

2 years ago

14.0.8

2 years ago

1.1.23

1 year ago

1.1.22

1 year ago

1.1.21

2 years ago

14.0.2

2 years ago

14.0.1

2 years ago

1.1.19

2 years ago

1.1.18

2 years ago

1.1.17

2 years ago

1.1.20

2 years ago

1.1.16

2 years ago

1.1.15

2 years ago

1.1.14

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.13

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.2

3 years ago