@3kles/kles-material-dynamicforms 15.0.0 → 16.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{esm2020 → esm2022}/lib/directive/dynamic-component.directive.mjs +4 -4
- package/esm2022/lib/directive/dynamic-field.directive.mjs +83 -0
- package/{esm2020 → esm2022}/lib/dynamic-form.component.mjs +6 -6
- package/{esm2020 → esm2022}/lib/fields/array.component.mjs +6 -6
- package/{esm2020 → esm2022}/lib/fields/badge.component.mjs +6 -6
- package/{esm2020 → esm2022}/lib/fields/button-form.component.mjs +6 -6
- package/{esm2020 → esm2022}/lib/fields/button-submit.component.mjs +6 -6
- package/{esm2020 → esm2022}/lib/fields/button-toogle-group.component.mjs +6 -6
- package/{esm2020 → esm2022}/lib/fields/buttonchecker-form.component.mjs +12 -8
- package/{esm2020 → esm2022}/lib/fields/buttonfile-form.component.mjs +9 -6
- package/{esm2020 → esm2022}/lib/fields/checkbox.component.mjs +6 -6
- package/{esm2020 → esm2022}/lib/fields/chip.component.mjs +6 -6
- package/esm2022/lib/fields/clear.component.mjs +30 -0
- package/{esm2020 → esm2022}/lib/fields/color.component.mjs +8 -8
- package/esm2022/lib/fields/date-time.component.mjs +61 -0
- package/{esm2020 → esm2022}/lib/fields/date.component.mjs +8 -8
- package/{esm2020 → esm2022}/lib/fields/field.abstract.mjs +4 -4
- package/{esm2020 → esm2022}/lib/fields/group.component.mjs +6 -6
- package/{esm2020 → esm2022}/lib/fields/icon.component.mjs +6 -6
- package/{esm2020 → esm2022}/lib/fields/input.clearable.component.mjs +6 -6
- package/{esm2020 → esm2022}/lib/fields/input.component.mjs +8 -8
- package/{esm2020 → esm2022}/lib/fields/label.component.mjs +6 -6
- package/{esm2020 → esm2022}/lib/fields/line-break.component.mjs +4 -4
- package/{esm2020 → esm2022}/lib/fields/link.component.mjs +6 -6
- package/esm2022/lib/fields/list-field.component.mjs +122 -0
- package/{esm2020 → esm2022}/lib/fields/radio.component.mjs +6 -6
- package/{esm2020 → esm2022}/lib/fields/range.component.mjs +6 -6
- package/{esm2020 → esm2022}/lib/fields/select.component.mjs +8 -8
- package/esm2022/lib/fields/select.lazy-search.component.mjs +278 -0
- package/esm2022/lib/fields/select.search.component.mjs +396 -0
- package/{esm2020 → esm2022}/lib/fields/selection-list.component.mjs +6 -6
- package/{esm2020 → esm2022}/lib/fields/slide-toggle.component.mjs +6 -6
- package/{esm2020 → esm2022}/lib/fields/text.component.mjs +6 -6
- package/{esm2020 → esm2022}/lib/fields/textarea.component.mjs +8 -8
- package/esm2022/lib/forms/button-control.component.mjs +121 -0
- package/{esm2020 → esm2022}/lib/forms/buttonchecker-control.component.mjs +12 -12
- package/esm2022/lib/forms/buttonfile-control.component.mjs +124 -0
- package/esm2022/lib/interfaces/field.config.interface.mjs +2 -0
- package/esm2022/lib/kles-material-dynamicforms.module.mjs +219 -0
- package/{esm2020 → esm2022}/lib/matcher/form-error.matcher.mjs +4 -4
- package/esm2022/lib/modules/material.module.mjs +279 -0
- package/{esm2020 → esm2022}/lib/pipe/array.pipe.mjs +4 -4
- package/{esm2020 → esm2022}/lib/pipe/transform.pipe.mjs +4 -4
- package/esm2022/public-api.mjs +72 -0
- package/{fesm2020 → fesm2022}/3kles-kles-material-dynamicforms.mjs +623 -537
- package/fesm2022/3kles-kles-material-dynamicforms.mjs.map +1 -0
- package/lib/directive/dynamic-component.directive.d.ts +1 -1
- package/lib/directive/dynamic-field.directive.d.ts +1 -1
- package/lib/dynamic-form.component.d.ts +1 -1
- package/lib/fields/date-time.component.d.ts +9 -0
- package/lib/forms/button-control.component.d.ts +1 -1
- package/lib/forms/buttonfile-control.component.d.ts +1 -1
- package/lib/interfaces/field.config.interface.d.ts +5 -1
- package/lib/kles-material-dynamicforms.module.d.ts +14 -12
- package/lib/modules/material.module.d.ts +3 -2
- package/package.json +19 -25
- package/public-api.d.ts +1 -0
- package/esm2020/lib/directive/dynamic-field.directive.mjs +0 -78
- package/esm2020/lib/fields/clear.component.mjs +0 -31
- package/esm2020/lib/fields/list-field.component.mjs +0 -114
- package/esm2020/lib/fields/select.lazy-search.component.mjs +0 -278
- package/esm2020/lib/fields/select.search.component.mjs +0 -396
- package/esm2020/lib/forms/button-control.component.mjs +0 -119
- package/esm2020/lib/forms/buttonfile-control.component.mjs +0 -122
- package/esm2020/lib/interfaces/field.config.interface.mjs +0 -2
- package/esm2020/lib/kles-material-dynamicforms.module.mjs +0 -208
- package/esm2020/lib/modules/material.module.mjs +0 -272
- package/esm2020/public-api.mjs +0 -71
- package/fesm2015/3kles-kles-material-dynamicforms.mjs +0 -3598
- package/fesm2015/3kles-kles-material-dynamicforms.mjs.map +0 -1
- package/fesm2020/3kles-kles-material-dynamicforms.mjs.map +0 -1
- /package/{esm2020 → esm2022}/3kles-kles-material-dynamicforms.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/controls/array.control.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/controls/control.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/controls/default.control.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/controls/group.control.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/controls/range.control.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/decorators/component.decorator.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/enums/type.enum.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/factories/field.factory.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/interfaces/clear-control.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/interfaces/component.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/interfaces/directive.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/interfaces/field.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/interfaces/validator.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/validators/autocomplete.validator.mjs +0 -0
|
@@ -12,5 +12,5 @@ export declare class KlesComponentDirective implements OnInit, OnChanges {
|
|
|
12
12
|
ngOnChanges(changes: SimpleChanges): void;
|
|
13
13
|
buildComponent(): void;
|
|
14
14
|
static ɵfac: i0.ɵɵFactoryDeclaration<KlesComponentDirective, never>;
|
|
15
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<KlesComponentDirective, "[klesComponent]", never, { "component": "component"; "value": "value"; "field": "field"; }, {}, never, never, false, never>;
|
|
15
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<KlesComponentDirective, "[klesComponent]", never, { "component": { "alias": "component"; "required": false; }; "value": { "alias": "value"; "required": false; }; "field": { "alias": "field"; "required": false; }; }, {}, never, never, false, never>;
|
|
16
16
|
}
|
|
@@ -17,5 +17,5 @@ export declare class KlesDynamicFieldDirective implements OnInit, OnChanges, OnD
|
|
|
17
17
|
buildComponent(): void;
|
|
18
18
|
private createSubComponent;
|
|
19
19
|
static ɵfac: i0.ɵɵFactoryDeclaration<KlesDynamicFieldDirective, never>;
|
|
20
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<KlesDynamicFieldDirective, "[klesDynamicField]", never, { "field": "field"; "group": "group"; "siblingFields": "siblingFields"; }, {}, never, never, false, never>;
|
|
20
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<KlesDynamicFieldDirective, "[klesDynamicField]", never, { "field": { "alias": "field"; "required": false; }; "group": { "alias": "group"; "required": false; }; "siblingFields": { "alias": "siblingFields"; "required": false; }; }, {}, never, never, false, never>;
|
|
21
21
|
}
|
|
@@ -26,5 +26,5 @@ export declare class KlesDynamicFormComponent implements OnInit, OnChanges {
|
|
|
26
26
|
private createForm;
|
|
27
27
|
private validateAllFormFields;
|
|
28
28
|
static ɵfac: i0.ɵɵFactoryDeclaration<KlesDynamicFormComponent, never>;
|
|
29
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<KlesDynamicFormComponent, "app-kles-dynamic-form", ["klesDynamicForm"], { "fields": "fields"; "validators": "validators"; "asyncValidators": "asyncValidators"; "direction": "direction"; }, { "submit": "submit"; "_onLoaded": "_onLoaded"; }, never, never, false, never>;
|
|
29
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<KlesDynamicFormComponent, "app-kles-dynamic-form", ["klesDynamicForm"], { "fields": { "alias": "fields"; "required": false; }; "validators": { "alias": "validators"; "required": false; }; "asyncValidators": { "alias": "asyncValidators"; "required": false; }; "direction": { "alias": "direction"; "required": false; }; }, { "submit": "submit"; "_onLoaded": "_onLoaded"; }, never, never, false, never>;
|
|
30
30
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OnDestroy, OnInit } from "@angular/core";
|
|
2
|
+
import { KlesFieldAbstract } from './field.abstract';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class KlesFormDateTimeComponent extends KlesFieldAbstract implements OnInit, OnDestroy {
|
|
5
|
+
ngOnInit(): void;
|
|
6
|
+
ngOnDestroy(): void;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<KlesFormDateTimeComponent, never>;
|
|
8
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<KlesFormDateTimeComponent, "kles-form-datetimepicker", never, {}, {}, never, ["*"], false, never>;
|
|
9
|
+
}
|
|
@@ -35,5 +35,5 @@ export declare class KlesButtonComponent implements OnInit, ControlValueAccessor
|
|
|
35
35
|
registerOnTouched(fn: any): void;
|
|
36
36
|
setDisabledState?(isDisabled: boolean): void;
|
|
37
37
|
static ɵfac: i0.ɵɵFactoryDeclaration<KlesButtonComponent, never>;
|
|
38
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<KlesButtonComponent, "kles-button", never, { "name": "name"; "label": "label"; "color": "color"; "icon": "icon"; "iconSvg": "iconSvg"; "disabled": "disabled"; "type": "type"; "classButton": "classButton"; "value": "value"; "tooltip": "tooltip"; }, {}, never, never, false, never>;
|
|
38
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<KlesButtonComponent, "kles-button", never, { "name": { "alias": "name"; "required": false; }; "label": { "alias": "label"; "required": false; }; "color": { "alias": "color"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "iconSvg": { "alias": "iconSvg"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "type": { "alias": "type"; "required": false; }; "classButton": { "alias": "classButton"; "required": false; }; "value": { "alias": "value"; "required": false; }; "tooltip": { "alias": "tooltip"; "required": false; }; }, {}, never, never, false, never>;
|
|
39
39
|
}
|
|
@@ -16,5 +16,5 @@ export declare class KlesButtonFileComponent extends KlesButtonComponent impleme
|
|
|
16
16
|
onFileSelect(input: HTMLInputElement): Promise<void>;
|
|
17
17
|
readUploadedFile(inputFile: any): Promise<any>;
|
|
18
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<KlesButtonFileComponent, never>;
|
|
19
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<KlesButtonFileComponent, "kles-button-file", never, { "accept": "accept"; }, {}, never, never, false, never>;
|
|
19
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<KlesButtonFileComponent, "kles-button-file", never, { "accept": { "alias": "accept"; "required": false; }; }, {}, never, never, false, never>;
|
|
20
20
|
}
|
|
@@ -5,7 +5,7 @@ import { Observable, Subject } from 'rxjs';
|
|
|
5
5
|
import { EnumType } from '../enums/type.enum';
|
|
6
6
|
import { IKlesField } from './field.interface';
|
|
7
7
|
import { IKlesDirective } from './directive.interface';
|
|
8
|
-
import { MatDateFormats } from '@angular/material/core';
|
|
8
|
+
import { DateAdapter, MatDateFormats } from '@angular/material/core';
|
|
9
9
|
export interface IKlesFieldConfig {
|
|
10
10
|
type?: EnumType;
|
|
11
11
|
name: string;
|
|
@@ -61,6 +61,10 @@ export interface IKlesFieldConfig {
|
|
|
61
61
|
buttonType?: 'submit' | 'button' | 'reset';
|
|
62
62
|
accept?: string;
|
|
63
63
|
dateOptions?: {
|
|
64
|
+
adapter?: {
|
|
65
|
+
class: Type<DateAdapter<any>>;
|
|
66
|
+
deps?: any[];
|
|
67
|
+
};
|
|
64
68
|
language: string;
|
|
65
69
|
dateFormat: MatDateFormats;
|
|
66
70
|
};
|
|
@@ -43,20 +43,22 @@ import * as i30 from "./fields/array.component";
|
|
|
43
43
|
import * as i31 from "./fields/range.component";
|
|
44
44
|
import * as i32 from "./fields/clear.component";
|
|
45
45
|
import * as i33 from "./fields/select.lazy-search.component";
|
|
46
|
-
import * as i34 from "./
|
|
47
|
-
import * as i35 from "./directive/dynamic-
|
|
48
|
-
import * as i36 from "./
|
|
49
|
-
import * as i37 from "./pipe/
|
|
50
|
-
import * as i38 from "
|
|
51
|
-
import * as i39 from "@angular/
|
|
52
|
-
import * as i40 from "@
|
|
53
|
-
import * as i41 from "@
|
|
54
|
-
import * as i42 from "
|
|
55
|
-
import * as i43 from "
|
|
56
|
-
import * as i44 from "ngx-
|
|
46
|
+
import * as i34 from "./fields/date-time.component";
|
|
47
|
+
import * as i35 from "./directive/dynamic-field.directive";
|
|
48
|
+
import * as i36 from "./directive/dynamic-component.directive";
|
|
49
|
+
import * as i37 from "./pipe/transform.pipe";
|
|
50
|
+
import * as i38 from "./pipe/array.pipe";
|
|
51
|
+
import * as i39 from "@angular/common";
|
|
52
|
+
import * as i40 from "@angular/forms";
|
|
53
|
+
import * as i41 from "@ngx-translate/core";
|
|
54
|
+
import * as i42 from "@angular/flex-layout";
|
|
55
|
+
import * as i43 from "./modules/material.module";
|
|
56
|
+
import * as i44 from "ngx-color-picker";
|
|
57
|
+
import * as i45 from "ngx-mat-select-search";
|
|
58
|
+
import * as i46 from "@3kles/kles-material-datepicker";
|
|
57
59
|
export declare class KlesMaterialDynamicformsModule {
|
|
58
60
|
static declarations: ((typeof KlesDynamicFormComponent | typeof KlesFormClearComponent | typeof KlesFormLabelComponent | typeof KlesFormSelectComponent | typeof KlesFormListFieldComponent | typeof KlesButtonComponent | typeof KlesFormSelectSearchComponent)[] | (typeof KlesComponentDirective | typeof KlesDynamicFieldDirective)[] | (typeof KlesTransformPipe | typeof ArrayFormatPipe)[])[];
|
|
59
61
|
static ɵfac: i0.ɵɵFactoryDeclaration<KlesMaterialDynamicformsModule, never>;
|
|
60
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<KlesMaterialDynamicformsModule, [typeof i1.KlesDynamicFormComponent, typeof i2.KlesFormLabelComponent, typeof i3.KlesFormInputComponent, typeof i4.KlesFormInputClearableComponent, typeof i5.KlesFormSubmitButtonComponent, typeof i6.KlesFormBadgeComponent, typeof i7.KlesButtonComponent, typeof i8.KlesFormButtonComponent, typeof i9.KlesButtonCheckerComponent, typeof i10.KlesFormButtonCheckerComponent, typeof i11.KlesButtonFileComponent, typeof i12.KlesFormButtonFileComponent, typeof i13.KlesFormSelectComponent, typeof i14.KlesFormDateComponent, typeof i15.KlesFormRadioComponent, typeof i16.KlesFormCheckboxComponent, typeof i17.KlesFormListFieldComponent, typeof i18.KlesFormColorComponent, typeof i19.KlesFormTextareaComponent, typeof i20.KlesFormTextComponent, typeof i21.KlesFormChipComponent, typeof i22.KlesFormGroupComponent, typeof i23.KlesFormIconComponent, typeof i24.KlesFormSelectSearchComponent, typeof i25.KlesFormLineBreakComponent, typeof i26.KlesFormLinkComponent, typeof i27.KlesFormSlideToggleComponent, typeof i28.KlesFormSelectionListComponent, typeof i29.KlesFormButtonToogleGroupComponent, typeof i30.KlesFormArrayComponent, typeof i31.KlesFormRangeComponent, typeof i32.KlesFormClearComponent, typeof i33.KlesFormSelectLazySearchComponent, typeof i34.
|
|
62
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<KlesMaterialDynamicformsModule, [typeof i1.KlesDynamicFormComponent, typeof i2.KlesFormLabelComponent, typeof i3.KlesFormInputComponent, typeof i4.KlesFormInputClearableComponent, typeof i5.KlesFormSubmitButtonComponent, typeof i6.KlesFormBadgeComponent, typeof i7.KlesButtonComponent, typeof i8.KlesFormButtonComponent, typeof i9.KlesButtonCheckerComponent, typeof i10.KlesFormButtonCheckerComponent, typeof i11.KlesButtonFileComponent, typeof i12.KlesFormButtonFileComponent, typeof i13.KlesFormSelectComponent, typeof i14.KlesFormDateComponent, typeof i15.KlesFormRadioComponent, typeof i16.KlesFormCheckboxComponent, typeof i17.KlesFormListFieldComponent, typeof i18.KlesFormColorComponent, typeof i19.KlesFormTextareaComponent, typeof i20.KlesFormTextComponent, typeof i21.KlesFormChipComponent, typeof i22.KlesFormGroupComponent, typeof i23.KlesFormIconComponent, typeof i24.KlesFormSelectSearchComponent, typeof i25.KlesFormLineBreakComponent, typeof i26.KlesFormLinkComponent, typeof i27.KlesFormSlideToggleComponent, typeof i28.KlesFormSelectionListComponent, typeof i29.KlesFormButtonToogleGroupComponent, typeof i30.KlesFormArrayComponent, typeof i31.KlesFormRangeComponent, typeof i32.KlesFormClearComponent, typeof i33.KlesFormSelectLazySearchComponent, typeof i34.KlesFormDateTimeComponent, typeof i35.KlesDynamicFieldDirective, typeof i36.KlesComponentDirective, typeof i37.KlesTransformPipe, typeof i38.ArrayFormatPipe], [typeof i39.CommonModule, typeof i40.ReactiveFormsModule, typeof i41.TranslateModule, typeof i42.FlexLayoutModule, typeof i40.FormsModule, typeof i43.MaterialModule, typeof i44.ColorPickerModule, typeof i45.NgxMatSelectSearchModule, typeof i46.KlesMaterialDatepickerModule], [typeof i1.KlesDynamicFormComponent, typeof i2.KlesFormLabelComponent, typeof i3.KlesFormInputComponent, typeof i4.KlesFormInputClearableComponent, typeof i5.KlesFormSubmitButtonComponent, typeof i6.KlesFormBadgeComponent, typeof i7.KlesButtonComponent, typeof i8.KlesFormButtonComponent, typeof i9.KlesButtonCheckerComponent, typeof i10.KlesFormButtonCheckerComponent, typeof i11.KlesButtonFileComponent, typeof i12.KlesFormButtonFileComponent, typeof i13.KlesFormSelectComponent, typeof i14.KlesFormDateComponent, typeof i15.KlesFormRadioComponent, typeof i16.KlesFormCheckboxComponent, typeof i17.KlesFormListFieldComponent, typeof i18.KlesFormColorComponent, typeof i19.KlesFormTextareaComponent, typeof i20.KlesFormTextComponent, typeof i21.KlesFormChipComponent, typeof i22.KlesFormGroupComponent, typeof i23.KlesFormIconComponent, typeof i24.KlesFormSelectSearchComponent, typeof i25.KlesFormLineBreakComponent, typeof i26.KlesFormLinkComponent, typeof i27.KlesFormSlideToggleComponent, typeof i28.KlesFormSelectionListComponent, typeof i29.KlesFormButtonToogleGroupComponent, typeof i30.KlesFormArrayComponent, typeof i31.KlesFormRangeComponent, typeof i32.KlesFormClearComponent, typeof i33.KlesFormSelectLazySearchComponent, typeof i34.KlesFormDateTimeComponent, typeof i37.KlesTransformPipe, typeof i38.ArrayFormatPipe, typeof i35.KlesDynamicFieldDirective, typeof i36.KlesComponentDirective, typeof i44.ColorPickerModule, typeof i46.KlesMaterialDatepickerModule]>;
|
|
61
63
|
static ɵinj: i0.ɵɵInjectorDeclaration<KlesMaterialDynamicformsModule>;
|
|
62
64
|
}
|
|
@@ -34,9 +34,10 @@ import * as i32 from "@angular/material/tree";
|
|
|
34
34
|
import * as i33 from "@angular/material/slide-toggle";
|
|
35
35
|
import * as i34 from "ngx-color-picker";
|
|
36
36
|
import * as i35 from "@angular/material/button-toggle";
|
|
37
|
-
import * as i36 from "@angular/cdk/
|
|
37
|
+
import * as i36 from "@angular/cdk/portal";
|
|
38
|
+
import * as i37 from "@angular/cdk/scrolling";
|
|
38
39
|
export declare class MaterialModule {
|
|
39
40
|
static ɵfac: i0.ɵɵFactoryDeclaration<MaterialModule, never>;
|
|
40
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<MaterialModule, never, [typeof i1.CommonModule, typeof i2.MatSliderModule, typeof i3.MatButtonModule, typeof i4.MatToolbarModule, typeof i5.MatIconModule, typeof i6.MatSidenavModule, typeof i7.MatBadgeModule, typeof i8.MatListModule, typeof i9.MatGridListModule, typeof i10.MatFormFieldModule, typeof i11.MatInputModule, typeof i12.MatSelectModule, typeof i13.MatRadioModule, typeof i14.MatDatepickerModule, typeof i15.MatChipsModule, typeof i16.MatTooltipModule, typeof i17.MatTableModule, typeof i18.MatPaginatorModule, typeof i19.MatCardModule, typeof i20.MatMenuModule, typeof i21.MatTabsModule, typeof i22.CdkTableModule, typeof i23.MatProgressSpinnerModule, typeof i24.MatCheckboxModule, typeof i25.MatDialogModule, typeof i26.MatAutocompleteModule, typeof i27.MatProgressBarModule, typeof i28.MatSortModule, typeof i29.MatExpansionModule, typeof i30.MatNativeDateModule, typeof i31.MatSnackBarModule, typeof i32.MatTreeModule, typeof i2.MatSliderModule, typeof i33.MatSlideToggleModule, typeof i34.ColorPickerModule, typeof i35.MatButtonToggleModule], [typeof i3.MatButtonModule, typeof i4.MatToolbarModule, typeof i5.MatIconModule, typeof i6.MatSidenavModule, typeof i7.MatBadgeModule, typeof i8.MatListModule, typeof i9.MatGridListModule, typeof i11.MatInputModule, typeof i10.MatFormFieldModule, typeof i12.MatSelectModule, typeof i13.MatRadioModule, typeof i14.MatDatepickerModule, typeof i15.MatChipsModule, typeof i16.MatTooltipModule, typeof i17.MatTableModule, typeof i18.MatPaginatorModule, typeof i19.MatCardModule, typeof i20.MatMenuModule, typeof i21.MatTabsModule, typeof i22.CdkTableModule, typeof i23.MatProgressSpinnerModule, typeof i24.MatCheckboxModule, typeof i25.MatDialogModule, typeof i26.MatAutocompleteModule, typeof i27.MatProgressBarModule, typeof i28.MatSortModule, typeof i29.MatExpansionModule, typeof i30.MatNativeDateModule, typeof i31.MatSnackBarModule, typeof i32.MatTreeModule, typeof i2.MatSliderModule, typeof i33.MatSlideToggleModule, typeof i34.ColorPickerModule, typeof
|
|
41
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<MaterialModule, never, [typeof i1.CommonModule, typeof i2.MatSliderModule, typeof i3.MatButtonModule, typeof i4.MatToolbarModule, typeof i5.MatIconModule, typeof i6.MatSidenavModule, typeof i7.MatBadgeModule, typeof i8.MatListModule, typeof i9.MatGridListModule, typeof i10.MatFormFieldModule, typeof i11.MatInputModule, typeof i12.MatSelectModule, typeof i13.MatRadioModule, typeof i14.MatDatepickerModule, typeof i15.MatChipsModule, typeof i16.MatTooltipModule, typeof i17.MatTableModule, typeof i18.MatPaginatorModule, typeof i19.MatCardModule, typeof i20.MatMenuModule, typeof i21.MatTabsModule, typeof i22.CdkTableModule, typeof i23.MatProgressSpinnerModule, typeof i24.MatCheckboxModule, typeof i25.MatDialogModule, typeof i26.MatAutocompleteModule, typeof i27.MatProgressBarModule, typeof i28.MatSortModule, typeof i29.MatExpansionModule, typeof i30.MatNativeDateModule, typeof i31.MatSnackBarModule, typeof i32.MatTreeModule, typeof i2.MatSliderModule, typeof i33.MatSlideToggleModule, typeof i34.ColorPickerModule, typeof i35.MatButtonToggleModule, typeof i36.PortalModule], [typeof i3.MatButtonModule, typeof i4.MatToolbarModule, typeof i5.MatIconModule, typeof i6.MatSidenavModule, typeof i7.MatBadgeModule, typeof i8.MatListModule, typeof i9.MatGridListModule, typeof i11.MatInputModule, typeof i10.MatFormFieldModule, typeof i12.MatSelectModule, typeof i13.MatRadioModule, typeof i14.MatDatepickerModule, typeof i15.MatChipsModule, typeof i16.MatTooltipModule, typeof i17.MatTableModule, typeof i18.MatPaginatorModule, typeof i19.MatCardModule, typeof i20.MatMenuModule, typeof i21.MatTabsModule, typeof i22.CdkTableModule, typeof i23.MatProgressSpinnerModule, typeof i24.MatCheckboxModule, typeof i25.MatDialogModule, typeof i26.MatAutocompleteModule, typeof i27.MatProgressBarModule, typeof i28.MatSortModule, typeof i29.MatExpansionModule, typeof i30.MatNativeDateModule, typeof i31.MatSnackBarModule, typeof i32.MatTreeModule, typeof i2.MatSliderModule, typeof i33.MatSlideToggleModule, typeof i34.ColorPickerModule, typeof i37.ScrollingModule, typeof i37.CdkScrollable, typeof i35.MatButtonToggleModule, typeof i36.PortalModule]>;
|
|
41
42
|
static ɵinj: i0.ɵɵInjectorDeclaration<MaterialModule>;
|
|
42
43
|
}
|
package/package.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@3kles/kles-material-dynamicforms",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.0.3",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@
|
|
6
|
-
"@angular/
|
|
7
|
-
"@angular/
|
|
8
|
-
"@angular/
|
|
9
|
-
"@angular/
|
|
10
|
-
"@angular/
|
|
11
|
-
"@angular/forms": "^
|
|
12
|
-
"@angular/material": "^
|
|
13
|
-
"@angular/platform-browser": "^
|
|
14
|
-
"@angular/platform-browser-dynamic": "^
|
|
15
|
-
"@angular/router": "^
|
|
16
|
-
"@ngx-translate/core": "^
|
|
17
|
-
"@ngx-translate/http-loader": "^
|
|
5
|
+
"@3kles/kles-material-datepicker": "^14.0.3",
|
|
6
|
+
"@angular/animations": "^16.0.0",
|
|
7
|
+
"@angular/cdk": "^16.0.0",
|
|
8
|
+
"@angular/common": "^16.0.0",
|
|
9
|
+
"@angular/compiler": "^16.0.0",
|
|
10
|
+
"@angular/core": "^16.0.0",
|
|
11
|
+
"@angular/forms": "^16.0.0",
|
|
12
|
+
"@angular/material": "^16.0.0",
|
|
13
|
+
"@angular/platform-browser": "^16.0.0",
|
|
14
|
+
"@angular/platform-browser-dynamic": "^16.0.0",
|
|
15
|
+
"@angular/router": "^16.0.0",
|
|
16
|
+
"@ngx-translate/core": "^15.0.0",
|
|
17
|
+
"@ngx-translate/http-loader": "^8.0.0",
|
|
18
18
|
"angular-material": "^1.1.21",
|
|
19
19
|
"hammerjs": "^2.0.8",
|
|
20
20
|
"jquery": "^3.5.1",
|
|
21
21
|
"lodash": "^4.17.19",
|
|
22
|
-
"ngx-color-picker": "^
|
|
22
|
+
"ngx-color-picker": "^14.0.0",
|
|
23
23
|
"ngx-mat-select-search": "^7.0.2",
|
|
24
24
|
"rxjs": "~6.5.4",
|
|
25
25
|
"zone.js": "~0.10.3"
|
|
@@ -27,11 +27,7 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"tslib": "^2.0.0"
|
|
29
29
|
},
|
|
30
|
-
"module": "
|
|
31
|
-
"es2020": "fesm2020/3kles-kles-material-dynamicforms.mjs",
|
|
32
|
-
"esm2020": "esm2020/3kles-kles-material-dynamicforms.mjs",
|
|
33
|
-
"fesm2020": "fesm2020/3kles-kles-material-dynamicforms.mjs",
|
|
34
|
-
"fesm2015": "fesm2015/3kles-kles-material-dynamicforms.mjs",
|
|
30
|
+
"module": "fesm2022/3kles-kles-material-dynamicforms.mjs",
|
|
35
31
|
"typings": "index.d.ts",
|
|
36
32
|
"exports": {
|
|
37
33
|
"./package.json": {
|
|
@@ -39,11 +35,9 @@
|
|
|
39
35
|
},
|
|
40
36
|
".": {
|
|
41
37
|
"types": "./index.d.ts",
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"node": "./fesm2015/3kles-kles-material-dynamicforms.mjs",
|
|
46
|
-
"default": "./fesm2020/3kles-kles-material-dynamicforms.mjs"
|
|
38
|
+
"esm2022": "./esm2022/3kles-kles-material-dynamicforms.mjs",
|
|
39
|
+
"esm": "./esm2022/3kles-kles-material-dynamicforms.mjs",
|
|
40
|
+
"default": "./fesm2022/3kles-kles-material-dynamicforms.mjs"
|
|
47
41
|
}
|
|
48
42
|
},
|
|
49
43
|
"sideEffects": false
|
package/public-api.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ export * from './lib/fields/array.component';
|
|
|
36
36
|
export * from './lib/fields/range.component';
|
|
37
37
|
export * from './lib/fields/clear.component';
|
|
38
38
|
export * from './lib/fields/select.lazy-search.component';
|
|
39
|
+
export * from './lib/fields/date-time.component';
|
|
39
40
|
/**ENUMS */
|
|
40
41
|
export * from './lib/enums/type.enum';
|
|
41
42
|
/**INTERFACES */
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { Directive, Input, Injector } from '@angular/core';
|
|
2
|
-
import { MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core';
|
|
3
|
-
import { componentMapper } from '../decorators/component.decorator';
|
|
4
|
-
import { KlesFormClearComponent } from '../fields/clear.component';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
export class KlesDynamicFieldDirective {
|
|
7
|
-
constructor(container, injector) {
|
|
8
|
-
this.container = container;
|
|
9
|
-
this.injector = injector;
|
|
10
|
-
this.subComponents = [];
|
|
11
|
-
}
|
|
12
|
-
ngOnDestroy() {
|
|
13
|
-
if (this.componentRef) {
|
|
14
|
-
this.componentRef.destroy();
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
ngOnInit() {
|
|
18
|
-
this.buildComponent();
|
|
19
|
-
}
|
|
20
|
-
ngOnChanges(changes) {
|
|
21
|
-
if (changes.group) {
|
|
22
|
-
this.group = changes.group.currentValue;
|
|
23
|
-
}
|
|
24
|
-
if (changes.field) {
|
|
25
|
-
this.field = changes.field.currentValue;
|
|
26
|
-
this.buildComponent();
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
buildComponent() {
|
|
30
|
-
if (this.componentRef) {
|
|
31
|
-
this.subComponents.forEach(c => c.destroy());
|
|
32
|
-
this.subComponents = [];
|
|
33
|
-
this.componentRef.destroy();
|
|
34
|
-
}
|
|
35
|
-
const options = {
|
|
36
|
-
providers: this.field.dateOptions ? [
|
|
37
|
-
{ provide: MAT_DATE_LOCALE, useValue: this.field.dateOptions.language },
|
|
38
|
-
{ provide: MAT_DATE_FORMATS, useValue: this.field.dateOptions.dateFormat },
|
|
39
|
-
] : [],
|
|
40
|
-
parent: this.injector
|
|
41
|
-
};
|
|
42
|
-
const injector = Injector.create(options);
|
|
43
|
-
if (this.field.clearable) {
|
|
44
|
-
const composant = this.createSubComponent(this.field.clearableComponent || KlesFormClearComponent);
|
|
45
|
-
this.subComponents.push(composant);
|
|
46
|
-
}
|
|
47
|
-
if (this.field.subComponents) {
|
|
48
|
-
this.subComponents.push(...this.field.subComponents.map((subComponent) => this.createSubComponent(subComponent)));
|
|
49
|
-
}
|
|
50
|
-
this.componentRef = this.container.createComponent(this.field.component
|
|
51
|
-
|| componentMapper.find(element => element.type === this.field.type)?.component, { injector, projectableNodes: [this.subComponents.map(sub => sub.location.nativeElement)] });
|
|
52
|
-
this.componentRef.instance.field = this.field;
|
|
53
|
-
this.componentRef.instance.group = this.group;
|
|
54
|
-
this.componentRef.instance.siblingFields = this.siblingFields;
|
|
55
|
-
}
|
|
56
|
-
createSubComponent(componentType) {
|
|
57
|
-
const component = this.container.createComponent(componentType);
|
|
58
|
-
component.instance.field = this.field;
|
|
59
|
-
component.instance.group = this.group;
|
|
60
|
-
component.instance.siblingFields = this.siblingFields;
|
|
61
|
-
return component;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
KlesDynamicFieldDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: KlesDynamicFieldDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
|
|
65
|
-
KlesDynamicFieldDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: KlesDynamicFieldDirective, selector: "[klesDynamicField]", inputs: { field: "field", group: "group", siblingFields: "siblingFields" }, usesOnChanges: true, ngImport: i0 });
|
|
66
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: KlesDynamicFieldDirective, decorators: [{
|
|
67
|
-
type: Directive,
|
|
68
|
-
args: [{
|
|
69
|
-
selector: '[klesDynamicField]'
|
|
70
|
-
}]
|
|
71
|
-
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.Injector }]; }, propDecorators: { field: [{
|
|
72
|
-
type: Input
|
|
73
|
-
}], group: [{
|
|
74
|
-
type: Input
|
|
75
|
-
}], siblingFields: [{
|
|
76
|
-
type: Input
|
|
77
|
-
}] } });
|
|
78
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHluYW1pYy1maWVsZC5kaXJlY3RpdmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9rbGVzLW1hdGVyaWF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GlmIChjaGFuZ2VzLmdyb3VwKSB7XG4gICAgICAgICAgICB0aGlzLmdyb3VwID0gY2hhbmdlcy5ncm91cC5jdXJyZW50VmFsdWU7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGNoYW5nZXMuZmllbGQpIHtcbiAgICAgICAgICAgIHRoaXMuZmllbGQgPSBjaGFuZ2VzLmZpZWxkLmN1cnJlbnRWYWx1ZTtcbiAgICAgICAgICAgIHRoaXMuYnVpbGRDb21wb25lbnQoKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGJ1aWxkQ29tcG9uZW50KCkge1xuICAgICAgICBpZiAodGhpcy5jb21wb25lbnRSZWYpIHtcbiAgICAgICAgICAgIHRoaXMuc3ViQ29tcG9uZW50cy5mb3JFYWNoKGMgPT4gYy5kZXN0cm95KCkpO1xuICAgICAgICAgICAgdGhpcy5zdWJDb21wb25lbnRzID0gW107XG4gICAgICAgICAgICB0aGlzLmNvbXBvbmVudFJlZi5kZXN0cm95KCk7XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBvcHRpb25zOiB7XG4gICAgICAgICAgICBwcm92aWRlcnM6IFN0YXRpY1Byb3ZpZGVyW107XG4gICAgICAgICAgICBwYXJlbnQ/OiBJbmplY3RvcjtcbiAgICAgICAgICAgIG5hbWU/OiBzdHJpbmc7XG4gICAgICAgIH0gPSB7XG4gICAgICAgICAgICBwcm92aWRlcnM6IHRoaXMuZmllbGQuZGF0ZU9wdGlvbnMgPyBbXG4gICAgICAgICAgICAgICAgeyBwcm92aWRlOiBNQVRfREFURV9MT0NBTEUsIHVzZVZhbHVlOiB0aGlzLmZpZWxkLmRhdGVPcHRpb25zLmxhbmd1YWdlIH0sXG4gICAgICAgICAgICAgICAgeyBwcm92aWRlOiBNQVRfREFURV9GT1JNQVRTLCB1c2VWYWx1ZTogdGhpcy5maWVsZC5kYXRlT3B0aW9ucy5kYXRlRm9ybWF0IH0sXG4gICAgICAgICAgICBdIDogW10sXG4gICAgICAgICAgICBw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AgICAgdGhpcy5jb21wb25lbnRSZWYuaW5zdGFuY2UuZ3JvdXAgPSB0aGlzLmdyb3VwO1xuICAgICAgICB0aGlzLmNvbXBvbmVudFJlZi5pbnN0YW5jZS5zaWJsaW5nRmllbGRzID0gdGhpcy5zaWJsaW5nRmllbGRzO1xuICAgIH1cblxuICAgIHByaXZhdGUgY3JlYXRlU3ViQ29tcG9uZW50KGNvbXBvbmVudFR5cGU6IFR5cGU8YW55Pik6IENvbXBvbmVudFJlZjxhbnk+IHtcbiAgICAgICAgY29uc3QgY29tcG9uZW50ID0gdGhpcy5jb250YWluZXIuY3JlYXRlQ29tcG9uZW50KGNvbXBvbmVudFR5cGUpO1xuICAgICAgICBjb21wb25lbnQuaW5zdGFuY2UuZmllbGQgPSB0aGlzLmZpZWxkO1xuICAgICAgICBjb21wb25lbnQuaW5zdGFuY2UuZ3JvdXAgPSB0aGlzLmdyb3VwO1xuICAgICAgICBjb21wb25lbnQuaW5zdGFuY2Uuc2libGluZ0ZpZWxkcyA9IHRoaXMuc2libGluZ0ZpZWxkcztcbiAgICAgICAgcmV0dXJuIGNvbXBvbmVudDtcbiAgICB9XG59XG4iXX0=
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Component } from "@angular/core";
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
import * as i1 from "@angular/common";
|
|
4
|
-
import * as i2 from "@angular/material/button";
|
|
5
|
-
import * as i3 from "@angular/material/icon";
|
|
6
|
-
export class KlesFormClearComponent {
|
|
7
|
-
clear(event) {
|
|
8
|
-
event.stopPropagation();
|
|
9
|
-
this.group.controls[this.field.name].reset();
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
KlesFormClearComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: KlesFormClearComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13
|
-
KlesFormClearComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: KlesFormClearComponent, selector: "kles-form-clear", ngImport: i0, template: `
|
|
14
|
-
<button *ngIf="group.get(field.name).value && !group.get(field.name).disabled" mat-icon-button aria-label="Clear" type="button"
|
|
15
|
-
(click)="clear($event)">
|
|
16
|
-
<mat-icon>close</mat-icon>
|
|
17
|
-
</button>
|
|
18
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
19
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: KlesFormClearComponent, decorators: [{
|
|
20
|
-
type: Component,
|
|
21
|
-
args: [{
|
|
22
|
-
selector: 'kles-form-clear',
|
|
23
|
-
template: `
|
|
24
|
-
<button *ngIf="group.get(field.name).value && !group.get(field.name).disabled" mat-icon-button aria-label="Clear" type="button"
|
|
25
|
-
(click)="clear($event)">
|
|
26
|
-
<mat-icon>close</mat-icon>
|
|
27
|
-
</button>
|
|
28
|
-
`,
|
|
29
|
-
}]
|
|
30
|
-
}] });
|
|
31
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xlYXIuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMva2xlcy1tYXRlcmlhbC1keW5hbWljZm9ybXMvc3JjL2xpYi9maWVsZHMvY2xlYXIuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxlQUF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gICAgICAgIChjbGljayk9XCJjbGVhcigkZXZlbnQpXCI+XG4gICAgICAgIDxtYXQtaWNvbj5jbG9zZTwvbWF0LWljb24+XG4gICAgPC9idXR0b24+XG4gICAgYCxcblxufSlcbmV4cG9ydCBjbGFzcyBLbGVzRm9ybUNsZWFyQ29tcG9uZW50IGltcGxlbWVudHMgSUtsZXNDbGVhckNvbnRyb2wge1xuICAgIGZpZWxkOiBJS2xlc0ZpZWxkQ29uZmlnO1xuICAgIGdyb3VwOiBVbnR5cGVkRm9ybUdyb3VwO1xuICAgIHNpYmxpbmdGaWVsZHM6IElLbGVzRmllbGRDb25maWdbXTtcblxuICAgIGNsZWFyKGV2ZW50KTogdm9pZCB7XG4gICAgICAgIGV2ZW50LnN0b3BQcm9wYWdhdGlvbigpO1xuICAgICAgICB0aGlzLmdyb3VwLmNvbnRyb2xzW3RoaXMuZmllbGQubmFtZV0ucmVzZXQoKTtcbiAgICB9XG59Il19
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { Component } from '@angular/core';
|
|
2
|
-
import { KlesFieldAbstract } from './field.abstract';
|
|
3
|
-
import { Validators } from '@angular/forms';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
import * as i1 from "@angular/forms";
|
|
6
|
-
import * as i2 from "@angular/common";
|
|
7
|
-
import * as i3 from "@angular/flex-layout/flex";
|
|
8
|
-
import * as i4 from "@angular/material/button";
|
|
9
|
-
import * as i5 from "@angular/material/icon";
|
|
10
|
-
import * as i6 from "@angular/material/form-field";
|
|
11
|
-
import * as i7 from "@ngx-translate/core";
|
|
12
|
-
export class KlesFormListFieldComponent extends KlesFieldAbstract {
|
|
13
|
-
constructor(fb, viewRef) {
|
|
14
|
-
super(viewRef);
|
|
15
|
-
this.fb = fb;
|
|
16
|
-
this.viewRef = viewRef;
|
|
17
|
-
}
|
|
18
|
-
ngOnInit() {
|
|
19
|
-
this.formArray = this.group.controls[this.field.name];
|
|
20
|
-
super.ngOnInit();
|
|
21
|
-
}
|
|
22
|
-
createFormGroup() {
|
|
23
|
-
const group = this.fb.group({});
|
|
24
|
-
this.field.collections.forEach(item => {
|
|
25
|
-
const control = this.fb.control(null, this.bindValidations(item.validations || []), this.bindAsyncValidations(item.asyncValidations || []));
|
|
26
|
-
group.addControl(item.name, control);
|
|
27
|
-
});
|
|
28
|
-
return group;
|
|
29
|
-
}
|
|
30
|
-
deleteField(index) {
|
|
31
|
-
this.formArray.removeAt(index);
|
|
32
|
-
}
|
|
33
|
-
addField() {
|
|
34
|
-
this.formArray.push(this.createFormGroup());
|
|
35
|
-
}
|
|
36
|
-
bindValidations(validations) {
|
|
37
|
-
if (validations.length > 0) {
|
|
38
|
-
const validList = [];
|
|
39
|
-
validations.forEach(valid => {
|
|
40
|
-
validList.push(valid.validator);
|
|
41
|
-
});
|
|
42
|
-
return Validators.compose(validList);
|
|
43
|
-
}
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
bindAsyncValidations(validations) {
|
|
47
|
-
if (validations.length > 0) {
|
|
48
|
-
const validList = [];
|
|
49
|
-
validations.forEach(valid => {
|
|
50
|
-
validList.push(valid.validator);
|
|
51
|
-
});
|
|
52
|
-
return Validators.composeAsync(validList);
|
|
53
|
-
}
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
ngOnDestroy() {
|
|
57
|
-
super.ngOnDestroy();
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
KlesFormListFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: KlesFormListFieldComponent, deps: [{ token: i1.UntypedFormBuilder }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
61
|
-
KlesFormListFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: KlesFormListFieldComponent, selector: "kles-form-listfield", usesInheritance: true, ngImport: i0, template: `
|
|
62
|
-
<div [formGroup]="group" class="form-element">
|
|
63
|
-
{{field.label | translate}}
|
|
64
|
-
<button mat-icon-button color="primary" (click)="addField()">
|
|
65
|
-
<mat-icon>add</mat-icon>
|
|
66
|
-
</button>
|
|
67
|
-
|
|
68
|
-
<div class="dynamic-form" [formGroupName]="field.name">
|
|
69
|
-
<div *ngFor="let subGroup of formArray.controls let index = index;" fxLayout="row" fxLayoutGap="5px">
|
|
70
|
-
<ng-container *ngFor="let subfield of field.collections;"
|
|
71
|
-
dynamicField [field]="subfield" [group]="subGroup">
|
|
72
|
-
</ng-container>
|
|
73
|
-
<button mat-icon-button (click)="deleteField(index)" color="primary">
|
|
74
|
-
<mat-icon>delete_outlined</mat-icon>
|
|
75
|
-
</button>
|
|
76
|
-
</div>
|
|
77
|
-
<ng-container *ngFor="let validation of field.validations;" ngProjectAs="mat-error">
|
|
78
|
-
<mat-error *ngIf="group.get(field.name).hasError(validation.name)">{{validation.message | translate}}</mat-error>
|
|
79
|
-
</ng-container>
|
|
80
|
-
<ng-container *ngFor="let validation of field.asyncValidations;" ngProjectAs="mat-error">
|
|
81
|
-
<mat-error *ngIf="group.get(field.name).hasError(validation.name)">{{validation.message | translate}}</mat-error>
|
|
82
|
-
</ng-container>
|
|
83
|
-
</div>
|
|
84
|
-
</div>
|
|
85
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i3.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i6.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "pipe", type: i7.TranslatePipe, name: "translate" }] });
|
|
86
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: KlesFormListFieldComponent, decorators: [{
|
|
87
|
-
type: Component,
|
|
88
|
-
args: [{ selector: 'kles-form-listfield', template: `
|
|
89
|
-
<div [formGroup]="group" class="form-element">
|
|
90
|
-
{{field.label | translate}}
|
|
91
|
-
<button mat-icon-button color="primary" (click)="addField()">
|
|
92
|
-
<mat-icon>add</mat-icon>
|
|
93
|
-
</button>
|
|
94
|
-
|
|
95
|
-
<div class="dynamic-form" [formGroupName]="field.name">
|
|
96
|
-
<div *ngFor="let subGroup of formArray.controls let index = index;" fxLayout="row" fxLayoutGap="5px">
|
|
97
|
-
<ng-container *ngFor="let subfield of field.collections;"
|
|
98
|
-
dynamicField [field]="subfield" [group]="subGroup">
|
|
99
|
-
</ng-container>
|
|
100
|
-
<button mat-icon-button (click)="deleteField(index)" color="primary">
|
|
101
|
-
<mat-icon>delete_outlined</mat-icon>
|
|
102
|
-
</button>
|
|
103
|
-
</div>
|
|
104
|
-
<ng-container *ngFor="let validation of field.validations;" ngProjectAs="mat-error">
|
|
105
|
-
<mat-error *ngIf="group.get(field.name).hasError(validation.name)">{{validation.message | translate}}</mat-error>
|
|
106
|
-
</ng-container>
|
|
107
|
-
<ng-container *ngFor="let validation of field.asyncValidations;" ngProjectAs="mat-error">
|
|
108
|
-
<mat-error *ngIf="group.get(field.name).hasError(validation.name)">{{validation.message | translate}}</mat-error>
|
|
109
|
-
</ng-container>
|
|
110
|
-
</div>
|
|
111
|
-
</div>
|
|
112
|
-
` }]
|
|
113
|
-
}], ctorParameters: function () { return [{ type: i1.UntypedFormBuilder }, { type: i0.ViewContainerRef }]; } });
|
|
114
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGlzdC1maWVsZC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9rbGVzLW1hdGVyaWFsLWR5bmFtaW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