@ngx-formly/material 7.0.0-alpha.1 → 7.0.0-next.0
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/README.md +2 -2
- package/esm2022/checkbox/checkbox.type.mjs +1 -1
- package/esm2022/datepicker/datepicker.type.mjs +1 -1
- package/esm2022/form-field/form-field.wrapper.mjs +1 -1
- package/esm2022/input/input.type.mjs +1 -1
- package/esm2022/multicheckbox/multicheckbox.type.mjs +1 -1
- package/esm2022/native-select/native-select.type.mjs +1 -1
- package/esm2022/radio/radio.type.mjs +1 -1
- package/esm2022/select/select.type.mjs +1 -1
- package/esm2022/slider/slider.type.mjs +1 -1
- package/esm2022/textarea/textarea.type.mjs +1 -1
- package/esm2022/toggle/toggle.type.mjs +1 -1
- package/fesm2022/ngx-formly-material-checkbox.mjs +1 -1
- package/fesm2022/ngx-formly-material-checkbox.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-datepicker.mjs +1 -1
- package/fesm2022/ngx-formly-material-datepicker.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-form-field.mjs +1 -1
- package/fesm2022/ngx-formly-material-form-field.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-input.mjs +1 -1
- package/fesm2022/ngx-formly-material-input.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-multicheckbox.mjs +1 -1
- package/fesm2022/ngx-formly-material-multicheckbox.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-native-select.mjs +1 -1
- package/fesm2022/ngx-formly-material-native-select.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-radio.mjs +1 -1
- package/fesm2022/ngx-formly-material-radio.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-select.mjs +1 -1
- package/fesm2022/ngx-formly-material-select.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-slider.mjs +1 -1
- package/fesm2022/ngx-formly-material-slider.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-textarea.mjs +1 -1
- package/fesm2022/ngx-formly-material-textarea.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-toggle.mjs +1 -1
- package/fesm2022/ngx-formly-material-toggle.mjs.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ Formly is a dynamic (JSON powered) form library for Angular that brings unmatche
|
|
|
26
26
|
- Formly Schema (core)
|
|
27
27
|
- JSON Schema
|
|
28
28
|
- 😍 A bunch of themes, out of the box!
|
|
29
|
-
- 💪 Built on top of [Angular Reactive Forms](https://angular.
|
|
29
|
+
- 💪 Built on top of [Angular Reactive Forms](https://angular.dev/guide/forms/reactive-forms)
|
|
30
30
|
- 📹 [@eggheadio course](https://egghead.io/playlists/configuration-based-reactive-angular-forms-with-ngx-formly-465f) - 20 lessons & 78 minutes
|
|
31
31
|
|
|
32
32
|
## Docs
|
|
@@ -57,7 +57,7 @@ Formly is a dynamic (JSON powered) form library for Angular that brings unmatche
|
|
|
57
57
|
|
|
58
58
|
| Angular version | Formly version |
|
|
59
59
|
| --------------- | ---------------------- |
|
|
60
|
-
| Angular >=
|
|
60
|
+
| Angular >= 18 | `@ngx-formly/core@7.x` |
|
|
61
61
|
| Angular >= 13 | `@ngx-formly/core@6.x` |
|
|
62
62
|
| Angular >= 7 | `@ngx-formly/core@5.x` |
|
|
63
63
|
| Angular >= 6 | `@ngx-formly/core@4.x` |
|
|
@@ -78,7 +78,7 @@ export class FormlyFieldCheckbox extends FieldType {
|
|
|
78
78
|
>*</span
|
|
79
79
|
>
|
|
80
80
|
</mat-checkbox>
|
|
81
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i4.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i5
|
|
81
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i4.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i5.LegacyFormlyAttributes, selector: "[formlyAttributes]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
82
82
|
}
|
|
83
83
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldCheckbox, decorators: [{
|
|
84
84
|
type: Component,
|
|
@@ -94,7 +94,7 @@ export class FormlyFieldDatepicker extends FieldType {
|
|
|
94
94
|
(closed)="props.datepickerOptions.opened = false"
|
|
95
95
|
>
|
|
96
96
|
</mat-datepicker>
|
|
97
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i4.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i4.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i4.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "directive", type: i1
|
|
97
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i4.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i4.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i4.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "directive", type: i1.LegacyFormlyAttributes, selector: "[formlyAttributes]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
98
98
|
}
|
|
99
99
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldDatepicker, decorators: [{
|
|
100
100
|
type: Component,
|
|
@@ -90,7 +90,7 @@ export class FormlyWrapperFormField extends FieldWrapper {
|
|
|
90
90
|
<ng-container [ngTemplateOutlet]="content" [ngTemplateOutletContext]="{ field: field }"></ng-container>
|
|
91
91
|
</ng-template>
|
|
92
92
|
</ng-template>
|
|
93
|
-
`, isInline: true, styles: ["formly-wrapper-mat-form-field .mat-mdc-form-field,formly-wrapper-mat-form-field .mat-form-field{width:100%}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i4
|
|
93
|
+
`, isInline: true, styles: ["formly-wrapper-mat-form-field .mat-mdc-form-field,formly-wrapper-mat-form-field .mat-form-field{width:100%}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i4.LegacyFormlyValidationMessage, selector: "formly-validation-message" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
94
94
|
}
|
|
95
95
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyWrapperFormField, decorators: [{
|
|
96
96
|
type: Component,
|
|
@@ -40,7 +40,7 @@ export class FormlyFieldInput extends FieldType {
|
|
|
40
40
|
[placeholder]="props.placeholder"
|
|
41
41
|
/>
|
|
42
42
|
</ng-template>
|
|
43
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i4
|
|
43
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i4.LegacyFormlyAttributes, selector: "[formlyAttributes]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
44
44
|
}
|
|
45
45
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldInput, decorators: [{
|
|
46
46
|
type: Component,
|
|
@@ -51,7 +51,7 @@ export class FormlyFieldMultiCheckbox extends FieldType {
|
|
|
51
51
|
{{ option.label }}
|
|
52
52
|
</mat-checkbox>
|
|
53
53
|
</ng-container>
|
|
54
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i2.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i3
|
|
54
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i2.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i3.LegacyFormlyAttributes, selector: "[formlyAttributes]" }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.LegacyFormlySelectOptionsPipe, name: "formlySelectOptions" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
55
55
|
}
|
|
56
56
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldMultiCheckbox, decorators: [{
|
|
57
57
|
type: Component,
|
|
@@ -35,7 +35,7 @@ export class FormlyFieldNativeSelect extends FieldType {
|
|
|
35
35
|
</ng-container>
|
|
36
36
|
</ng-container>
|
|
37
37
|
</select>
|
|
38
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i4
|
|
38
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i4.LegacyFormlyAttributes, selector: "[formlyAttributes]" }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i5.LegacyFormlySelectOptionsPipe, name: "formlySelectOptions" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
39
39
|
}
|
|
40
40
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldNativeSelect, decorators: [{
|
|
41
41
|
type: Component,
|
|
@@ -55,7 +55,7 @@ export class FormlyFieldRadio extends FieldType {
|
|
|
55
55
|
{{ option.label }}
|
|
56
56
|
</mat-radio-button>
|
|
57
57
|
</mat-radio-group>
|
|
58
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: i3.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "directive", type: i4
|
|
58
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: i3.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "directive", type: i4.LegacyFormlyAttributes, selector: "[formlyAttributes]" }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i5.LegacyFormlySelectOptionsPipe, name: "formlySelectOptions" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
59
59
|
}
|
|
60
60
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldRadio, decorators: [{
|
|
61
61
|
type: Component,
|
|
@@ -105,7 +105,7 @@ export class FormlyFieldSelect extends FieldType {
|
|
|
105
105
|
</ng-container>
|
|
106
106
|
</ng-container>
|
|
107
107
|
</mat-select>
|
|
108
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i3.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i4.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i4.MatOptgroup, selector: "mat-optgroup", inputs: ["label", "disabled"], exportAs: ["matOptgroup"] }, { kind: "component", type: i4.MatPseudoCheckbox, selector: "mat-pseudo-checkbox", inputs: ["state", "disabled", "appearance"] }, { kind: "directive", type: i5
|
|
108
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i3.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i4.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i4.MatOptgroup, selector: "mat-optgroup", inputs: ["label", "disabled"], exportAs: ["matOptgroup"] }, { kind: "component", type: i4.MatPseudoCheckbox, selector: "mat-pseudo-checkbox", inputs: ["state", "disabled", "appearance"] }, { kind: "directive", type: i5.LegacyFormlyAttributes, selector: "[formlyAttributes]" }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.LegacyFormlySelectOptionsPipe, name: "formlySelectOptions" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
109
109
|
}
|
|
110
110
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldSelect, decorators: [{
|
|
111
111
|
type: Component,
|
|
@@ -35,7 +35,7 @@ export class FormlyFieldSlider extends FieldType {
|
|
|
35
35
|
>
|
|
36
36
|
<input matSliderThumb [formControl]="formControl" [formlyAttributes]="field" />
|
|
37
37
|
</mat-slider>
|
|
38
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i2.MatSlider, selector: "mat-slider", inputs: ["disabled", "discrete", "showTickMarks", "min", "color", "disableRipple", "max", "step", "displayWith"], exportAs: ["matSlider"] }, { kind: "directive", type: i2.MatSliderThumb, selector: "input[matSliderThumb]", inputs: ["value"], outputs: ["valueChange", "dragStart", "dragEnd"], exportAs: ["matSliderThumb"] }, { kind: "directive", type: i3
|
|
38
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i2.MatSlider, selector: "mat-slider", inputs: ["disabled", "discrete", "showTickMarks", "min", "color", "disableRipple", "max", "step", "displayWith"], exportAs: ["matSlider"] }, { kind: "directive", type: i2.MatSliderThumb, selector: "input[matSliderThumb]", inputs: ["value"], outputs: ["valueChange", "dragStart", "dragEnd"], exportAs: ["matSliderThumb"] }, { kind: "directive", type: i3.LegacyFormlyAttributes, selector: "[formlyAttributes]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
39
39
|
}
|
|
40
40
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldSlider, decorators: [{
|
|
41
41
|
type: Component,
|
|
@@ -40,7 +40,7 @@ export class FormlyFieldTextArea extends FieldType {
|
|
|
40
40
|
[cdkAutosizeMaxRows]="props.autosizeMaxRows"
|
|
41
41
|
[class.cdk-textarea-autosize]="props.autosize"
|
|
42
42
|
></textarea>
|
|
43
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i3.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "directive", type: i4
|
|
43
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i3.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "directive", type: i4.LegacyFormlyAttributes, selector: "[formlyAttributes]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
44
44
|
}
|
|
45
45
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldTextArea, decorators: [{
|
|
46
46
|
type: Component,
|
|
@@ -34,7 +34,7 @@ export class FormlyFieldToggle extends FieldType {
|
|
|
34
34
|
>
|
|
35
35
|
{{ props.label }}
|
|
36
36
|
</mat-slide-toggle>
|
|
37
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i2.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "directive", type: i3
|
|
37
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i2.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "directive", type: i3.LegacyFormlyAttributes, selector: "[formlyAttributes]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
38
38
|
}
|
|
39
39
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldToggle, decorators: [{
|
|
40
40
|
type: Component,
|
|
@@ -82,7 +82,7 @@ class FormlyFieldCheckbox extends FieldType {
|
|
|
82
82
|
>*</span
|
|
83
83
|
>
|
|
84
84
|
</mat-checkbox>
|
|
85
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i4.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i5
|
|
85
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i4.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i5.LegacyFormlyAttributes, selector: "[formlyAttributes]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
86
86
|
}
|
|
87
87
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldCheckbox, decorators: [{
|
|
88
88
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-formly-material-checkbox.mjs","sources":["../../../../src/ui/material/checkbox/src/checkbox.type.ts","../../../../src/ui/material/checkbox/src/checkbox.config.ts","../../../../src/ui/material/checkbox/src/checkbox.module.ts","../../../../src/ui/material/checkbox/src/ngx-formly-material-checkbox.ts"],"sourcesContent":["import {\n Component,\n ViewChild,\n ChangeDetectionStrategy,\n Renderer2,\n AfterViewChecked,\n OnDestroy,\n AfterViewInit,\n Type,\n} from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\nimport { MatCheckbox } from '@angular/material/checkbox';\nimport { FocusMonitor } from '@angular/cdk/a11y';\n\ninterface CheckboxProps extends FormlyFieldProps {\n indeterminate?: boolean;\n labelPosition?: 'before' | 'after';\n}\n\nexport interface FormlyCheckboxFieldConfig extends FormlyFieldConfig<CheckboxProps> {\n type: 'checkbox' | Type<FormlyFieldCheckbox>;\n}\n\n@Component({\n selector: 'formly-field-mat-checkbox',\n template: `\n <mat-checkbox\n [formControl]=\"formControl\"\n [id]=\"id\"\n [name]=\"field.name\"\n [formlyAttributes]=\"field\"\n [tabIndex]=\"props.tabindex\"\n [indeterminate]=\"props.indeterminate && formControl.value == null\"\n [color]=\"props.color\"\n [labelPosition]=\"props.labelPosition\"\n >\n {{ props.label }}\n <span\n *ngIf=\"props.required && props.hideRequiredMarker !== true\"\n aria-hidden=\"true\"\n class=\"mat-form-field-required-marker mat-mdc-form-field-required-marker\"\n >*</span\n >\n </mat-checkbox>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldCheckbox\n extends FieldType<FieldTypeConfig<CheckboxProps>>\n implements AfterViewInit, AfterViewChecked, OnDestroy\n{\n @ViewChild(MatCheckbox, { static: true }) checkbox!: MatCheckbox;\n override defaultOptions = {\n props: {\n hideFieldUnderline: true,\n indeterminate: true,\n floatLabel: 'always' as const,\n hideLabel: true,\n color: 'accent' as const, // workaround for https://github.com/angular/components/issues/18465\n },\n };\n\n private _required!: boolean;\n constructor(\n private renderer: Renderer2,\n private focusMonitor: FocusMonitor,\n ) {\n super();\n }\n\n override onContainerClick(event: MouseEvent): void {\n this.checkbox.focus();\n super.onContainerClick(event);\n }\n\n ngAfterViewInit() {\n if (this.checkbox) {\n this.focusMonitor.monitor(this.checkbox._inputElement, true).subscribe((focusOrigin) => {\n this.field.focus = !!focusOrigin;\n this.stateChanges.next();\n if (focusOrigin) {\n this.props.focus && this.props.focus(this.field);\n } else {\n this.props.blur && this.props.blur(this.field);\n }\n });\n }\n }\n\n ngAfterViewChecked() {\n if (this.required !== this._required && this.checkbox && this.checkbox._inputElement) {\n this._required = this.required;\n const inputElement = this.checkbox._inputElement.nativeElement;\n if (this.required) {\n this.renderer.setAttribute(inputElement, 'required', 'required');\n } else {\n this.renderer.removeAttribute(inputElement, 'required');\n }\n }\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n if (this.checkbox) {\n this.focusMonitor.stopMonitoring(this.checkbox._inputElement);\n }\n }\n}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyFieldCheckbox } from './checkbox.type';\n\nexport function withFormlyFieldCheckbox(): ConfigOption {\n return {\n types: [\n {\n name: 'checkbox',\n component: FormlyFieldCheckbox,\n wrappers: ['form-field'],\n },\n {\n name: 'boolean',\n extends: 'checkbox',\n },\n ],\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\n\nimport { FormlyFieldCheckbox } from './checkbox.type';\nimport { withFormlyFieldCheckbox } from './checkbox.config';\n\n@NgModule({\n declarations: [FormlyFieldCheckbox],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n\n MatCheckboxModule,\n\n FormlyMatFormFieldModule,\n FormlyModule.forChild(withFormlyFieldCheckbox()),\n ],\n})\nexport class FormlyMatCheckboxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;AAgDM,MAAO,mBACX,SAAQ,SAAyC,CAAA;IAejD,WACU,CAAA,QAAmB,EACnB,YAA0B,EAAA;AAElC,QAAA,KAAK,EAAE;QAHC,IAAQ,CAAA,QAAA,GAAR,QAAQ;QACR,IAAY,CAAA,YAAA,GAAZ,YAAY;AAbb,QAAA,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,KAAK,EAAE;AACL,gBAAA,kBAAkB,EAAE,IAAI;AACxB,gBAAA,aAAa,EAAE,IAAI;AACnB,gBAAA,UAAU,EAAE,QAAiB;AAC7B,gBAAA,SAAS,EAAE,IAAI;gBACf,KAAK,EAAE,QAAiB;AACzB,aAAA;SACF;;AAUQ,IAAA,gBAAgB,CAAC,KAAiB,EAAA;AACzC,QAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE;AACrB,QAAA,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC;;IAG/B,eAAe,GAAA;AACb,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;AACjB,YAAA,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,KAAI;gBACrF,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,WAAW;AAChC,gBAAA,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE;gBACxB,IAAI,WAAW,EAAE;AACf,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.type.ts","../../../../src/ui/material/checkbox/src/checkbox.config.ts","../../../../src/ui/material/checkbox/src/checkbox.module.ts","../../../../src/ui/material/checkbox/src/ngx-formly-material-checkbox.ts"],"sourcesContent":["import {\n Component,\n ViewChild,\n ChangeDetectionStrategy,\n Renderer2,\n AfterViewChecked,\n OnDestroy,\n AfterViewInit,\n Type,\n} from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\nimport { MatCheckbox } from '@angular/material/checkbox';\nimport { FocusMonitor } from '@angular/cdk/a11y';\n\ninterface CheckboxProps extends FormlyFieldProps {\n indeterminate?: boolean;\n labelPosition?: 'before' | 'after';\n}\n\nexport interface FormlyCheckboxFieldConfig extends FormlyFieldConfig<CheckboxProps> {\n type: 'checkbox' | Type<FormlyFieldCheckbox>;\n}\n\n@Component({\n selector: 'formly-field-mat-checkbox',\n template: `\n <mat-checkbox\n [formControl]=\"formControl\"\n [id]=\"id\"\n [name]=\"field.name\"\n [formlyAttributes]=\"field\"\n [tabIndex]=\"props.tabindex\"\n [indeterminate]=\"props.indeterminate && formControl.value == null\"\n [color]=\"props.color\"\n [labelPosition]=\"props.labelPosition\"\n >\n {{ props.label }}\n <span\n *ngIf=\"props.required && props.hideRequiredMarker !== true\"\n aria-hidden=\"true\"\n class=\"mat-form-field-required-marker mat-mdc-form-field-required-marker\"\n >*</span\n >\n </mat-checkbox>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldCheckbox\n extends FieldType<FieldTypeConfig<CheckboxProps>>\n implements AfterViewInit, AfterViewChecked, OnDestroy\n{\n @ViewChild(MatCheckbox, { static: true }) checkbox!: MatCheckbox;\n override defaultOptions = {\n props: {\n hideFieldUnderline: true,\n indeterminate: true,\n floatLabel: 'always' as const,\n hideLabel: true,\n color: 'accent' as const, // workaround for https://github.com/angular/components/issues/18465\n },\n };\n\n private _required!: boolean;\n constructor(\n private renderer: Renderer2,\n private focusMonitor: FocusMonitor,\n ) {\n super();\n }\n\n override onContainerClick(event: MouseEvent): void {\n this.checkbox.focus();\n super.onContainerClick(event);\n }\n\n ngAfterViewInit() {\n if (this.checkbox) {\n this.focusMonitor.monitor(this.checkbox._inputElement, true).subscribe((focusOrigin) => {\n this.field.focus = !!focusOrigin;\n this.stateChanges.next();\n if (focusOrigin) {\n this.props.focus && this.props.focus(this.field);\n } else {\n this.props.blur && this.props.blur(this.field);\n }\n });\n }\n }\n\n ngAfterViewChecked() {\n if (this.required !== this._required && this.checkbox && this.checkbox._inputElement) {\n this._required = this.required;\n const inputElement = this.checkbox._inputElement.nativeElement;\n if (this.required) {\n this.renderer.setAttribute(inputElement, 'required', 'required');\n } else {\n this.renderer.removeAttribute(inputElement, 'required');\n }\n }\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n if (this.checkbox) {\n this.focusMonitor.stopMonitoring(this.checkbox._inputElement);\n }\n }\n}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyFieldCheckbox } from './checkbox.type';\n\nexport function withFormlyFieldCheckbox(): ConfigOption {\n return {\n types: [\n {\n name: 'checkbox',\n component: FormlyFieldCheckbox,\n wrappers: ['form-field'],\n },\n {\n name: 'boolean',\n extends: 'checkbox',\n },\n ],\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\n\nimport { FormlyFieldCheckbox } from './checkbox.type';\nimport { withFormlyFieldCheckbox } from './checkbox.config';\n\n@NgModule({\n declarations: [FormlyFieldCheckbox],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n\n MatCheckboxModule,\n\n FormlyMatFormFieldModule,\n FormlyModule.forChild(withFormlyFieldCheckbox()),\n ],\n})\nexport class FormlyMatCheckboxModule {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B;wBAEjB,wBAAwB;AACxB,wBAAA,YAAY,CAAC,QAAQ,CAAC,uBAAuB,EAAE,CAAC;AACjD,qBAAA;AACF,iBAAA;;;ACtBD;;AAEG;;;;"}
|
|
@@ -99,7 +99,7 @@ class FormlyFieldDatepicker extends FieldType {
|
|
|
99
99
|
(closed)="props.datepickerOptions.opened = false"
|
|
100
100
|
>
|
|
101
101
|
</mat-datepicker>
|
|
102
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i4.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i4.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i4.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "directive", type: i1
|
|
102
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i4.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i4.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i4.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "directive", type: i1.LegacyFormlyAttributes, selector: "[formlyAttributes]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
103
103
|
}
|
|
104
104
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldDatepicker, decorators: [{
|
|
105
105
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-formly-material-datepicker.mjs","sources":["../../../../src/ui/material/datepicker/src/datepicker.type.ts","../../../../src/ui/material/datepicker/src/datepicker.config.ts","../../../../src/ui/material/datepicker/src/datepicker.module.ts","../../../../src/ui/material/datepicker/src/ngx-formly-material-datepicker.ts"],"sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n ViewChild,\n AfterViewInit,\n OnDestroy,\n TemplateRef,\n ChangeDetectorRef,\n Type,\n} from '@angular/core';\nimport { FieldTypeConfig, FormlyConfig, FormlyFieldConfig, ɵobserve as observe } from '@ngx-formly/core';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\nimport { ComponentType } from '@angular/cdk/portal';\nimport { MatCalendarCellClassFunction, MatDatepicker } from '@angular/material/datepicker';\n\ninterface DatepickerProps extends FormlyFieldProps {\n datepickerOptions?: Partial<{\n touchUi: boolean;\n opened: boolean;\n disabled: boolean;\n startView: 'month' | 'year' | 'multi-year';\n datepickerTogglePosition: 'suffix' | 'prefix';\n calendarHeaderComponent: ComponentType<any>;\n filter: (date: any | null) => boolean;\n min: any;\n max: any;\n dateInput: (field: FieldTypeConfig<DatepickerProps>, event: any) => void;\n dateChange: (field: FieldTypeConfig<DatepickerProps>, event: any) => void;\n\n monthSelected: (field: FieldTypeConfig<DatepickerProps>, event: any, picker: MatDatepicker<any>) => void;\n yearSelected: (field: FieldTypeConfig<DatepickerProps>, event: any, picker: MatDatepicker<any>) => void;\n\n dateClass: MatCalendarCellClassFunction<any>;\n panelClass: string | string[];\n startAt: any | null;\n }>;\n}\n\nexport interface FormlyDatepickerFieldConfig extends FormlyFieldConfig<DatepickerProps> {\n type: 'datepicker' | Type<FormlyFieldDatepicker>;\n}\n\n@Component({\n selector: 'formly-field-mat-datepicker',\n template: `\n <input\n matInput\n [id]=\"id\"\n [name]=\"field.name\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [formControl]=\"formControl\"\n [matDatepicker]=\"picker\"\n [matDatepickerFilter]=\"props.datepickerOptions.filter\"\n [max]=\"props.datepickerOptions.max\"\n [min]=\"props.datepickerOptions.min\"\n [formlyAttributes]=\"field\"\n [placeholder]=\"props.placeholder\"\n [tabindex]=\"props.tabindex\"\n [readonly]=\"props.readonly\"\n [required]=\"required\"\n (dateInput)=\"props.datepickerOptions.dateInput(field, $event)\"\n (dateChange)=\"props.datepickerOptions.dateChange(field, $event)\"\n />\n <ng-template #datepickerToggle>\n <mat-datepicker-toggle\n (click)=\"detectChanges()\"\n [disabled]=\"props.disabled\"\n [for]=\"picker\"\n ></mat-datepicker-toggle>\n </ng-template>\n <mat-datepicker\n #picker\n [color]=\"props.color\"\n [dateClass]=\"props.datepickerOptions.dateClass\"\n [disabled]=\"props.datepickerOptions.disabled\"\n [opened]=\"props.datepickerOptions.opened\"\n [panelClass]=\"props.datepickerOptions.panelClass\"\n [startAt]=\"props.datepickerOptions.startAt\"\n [startView]=\"props.datepickerOptions.startView\"\n [touchUi]=\"props.datepickerOptions.touchUi\"\n [calendarHeaderComponent]=\"props.datepickerOptions.calendarHeaderComponent\"\n (monthSelected)=\"props.datepickerOptions.monthSelected(field, $event, picker)\"\n (yearSelected)=\"props.datepickerOptions.yearSelected(field, $event, picker)\"\n (opened)=\"props.datepickerOptions.opened = true\"\n (closed)=\"props.datepickerOptions.opened = false\"\n >\n </mat-datepicker>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldDatepicker\n extends FieldType<FieldTypeConfig<DatepickerProps>>\n implements AfterViewInit, OnDestroy\n{\n @ViewChild('datepickerToggle', { static: true }) datepickerToggle!: TemplateRef<any>;\n\n override defaultOptions = {\n props: {\n datepickerOptions: {\n startView: 'month' as const,\n datepickerTogglePosition: 'suffix' as const,\n disabled: false,\n opened: false,\n dateInput: () => {},\n dateChange: () => {},\n monthSelected: () => {},\n yearSelected: () => {},\n },\n },\n };\n private fieldErrorsObserver!: ReturnType<typeof observe>;\n\n constructor(\n private config: FormlyConfig,\n private cdRef: ChangeDetectorRef,\n ) {\n super();\n }\n\n detectChanges() {\n this.options.detectChanges?.(this.field);\n }\n\n ngAfterViewInit() {\n this.props[this.props.datepickerOptions.datepickerTogglePosition] = this.datepickerToggle;\n observe<boolean>(this.field, ['props', 'datepickerOptions', 'opened'], () => {\n this.cdRef.detectChanges();\n });\n\n // temporary fix for https://github.com/angular/components/issues/16761\n if (this.config.getValidatorMessage('matDatepickerParse')) {\n this.fieldErrorsObserver = observe<any>(this.field, ['formControl', 'errors'], ({ currentValue }) => {\n if (currentValue && currentValue.required && currentValue.matDatepickerParse) {\n const errors = Object.keys(currentValue)\n .sort((prop) => (prop === 'matDatepickerParse' ? -1 : 0))\n .reduce((errors, prop) => ({ ...errors, [prop]: currentValue[prop] }), {});\n\n this.fieldErrorsObserver?.setValue(errors);\n }\n });\n }\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n this.fieldErrorsObserver?.unsubscribe();\n }\n}\n","import { FormlyFieldDatepicker } from './datepicker.type';\nimport { ConfigOption } from '@ngx-formly/core';\n\nexport function withFormlyFieldDatepicker(): ConfigOption {\n return {\n types: [\n {\n name: 'datepicker',\n component: FormlyFieldDatepicker,\n wrappers: ['form-field'],\n },\n ],\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatDatepickerModule } from '@angular/material/datepicker';\n\nimport { FormlyFieldDatepicker } from './datepicker.type';\nimport { withFormlyFieldDatepicker } from './datepicker.config';\n\n@NgModule({\n declarations: [FormlyFieldDatepicker],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatInputModule,\n MatDatepickerModule,\n\n FormlyMatFormFieldModule,\n FormlyModule.forChild(withFormlyFieldDatepicker()),\n ],\n})\nexport class FormlyMatDatepickerModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["observe"],"mappings":";;;;;;;;;;;;;AA0FM,MAAO,qBACX,SAAQ,SAA2C,CAAA;IAqBnD,WACU,CAAA,MAAoB,EACpB,KAAwB,EAAA;AAEhC,QAAA,KAAK,EAAE;QAHC,IAAM,CAAA,MAAA,GAA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mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yBAAyB,YATlC,YAAY;YACZ,mBAAmB;YACnB,cAAc;YACd,mBAAmB;YAEnB,wBAAwB;AACxB,YAAA,YAAY,CAAC,QAAQ,CAAC,yBAAyB,EAAE,CAAC,CAAA,EAAA,CAAA,CAAA;;4FAGzC,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAZrC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,qBAAqB,CAAC;AACrC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,cAAc;wBACd,mBAAmB;wBAEnB,wBAAwB;AACxB,wBAAA,YAAY,CAAC,QAAQ,CAAC,yBAAyB,EAAE,CAAC;AACnD,qBAAA;AACF,iBAAA;;;ACvBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-formly-material-datepicker.mjs","sources":["../../../../src/ui/material/datepicker/src/datepicker.type.ts","../../../../src/ui/material/datepicker/src/datepicker.config.ts","../../../../src/ui/material/datepicker/src/datepicker.module.ts","../../../../src/ui/material/datepicker/src/ngx-formly-material-datepicker.ts"],"sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n ViewChild,\n AfterViewInit,\n OnDestroy,\n TemplateRef,\n ChangeDetectorRef,\n Type,\n} from '@angular/core';\nimport { FieldTypeConfig, FormlyConfig, FormlyFieldConfig, ɵobserve as observe } from '@ngx-formly/core';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\nimport { ComponentType } from '@angular/cdk/portal';\nimport { MatCalendarCellClassFunction, MatDatepicker } from '@angular/material/datepicker';\n\ninterface DatepickerProps extends FormlyFieldProps {\n datepickerOptions?: Partial<{\n touchUi: boolean;\n opened: boolean;\n disabled: boolean;\n startView: 'month' | 'year' | 'multi-year';\n datepickerTogglePosition: 'suffix' | 'prefix';\n calendarHeaderComponent: ComponentType<any>;\n filter: (date: any | null) => boolean;\n min: any;\n max: any;\n dateInput: (field: FieldTypeConfig<DatepickerProps>, event: any) => void;\n dateChange: (field: FieldTypeConfig<DatepickerProps>, event: any) => void;\n\n monthSelected: (field: FieldTypeConfig<DatepickerProps>, event: any, picker: MatDatepicker<any>) => void;\n yearSelected: (field: FieldTypeConfig<DatepickerProps>, event: any, picker: MatDatepicker<any>) => void;\n\n dateClass: MatCalendarCellClassFunction<any>;\n panelClass: string | string[];\n startAt: any | null;\n }>;\n}\n\nexport interface FormlyDatepickerFieldConfig extends FormlyFieldConfig<DatepickerProps> {\n type: 'datepicker' | Type<FormlyFieldDatepicker>;\n}\n\n@Component({\n selector: 'formly-field-mat-datepicker',\n template: `\n <input\n matInput\n [id]=\"id\"\n [name]=\"field.name\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [formControl]=\"formControl\"\n [matDatepicker]=\"picker\"\n [matDatepickerFilter]=\"props.datepickerOptions.filter\"\n [max]=\"props.datepickerOptions.max\"\n [min]=\"props.datepickerOptions.min\"\n [formlyAttributes]=\"field\"\n [placeholder]=\"props.placeholder\"\n [tabindex]=\"props.tabindex\"\n [readonly]=\"props.readonly\"\n [required]=\"required\"\n (dateInput)=\"props.datepickerOptions.dateInput(field, $event)\"\n (dateChange)=\"props.datepickerOptions.dateChange(field, $event)\"\n />\n <ng-template #datepickerToggle>\n <mat-datepicker-toggle\n (click)=\"detectChanges()\"\n [disabled]=\"props.disabled\"\n [for]=\"picker\"\n ></mat-datepicker-toggle>\n </ng-template>\n <mat-datepicker\n #picker\n [color]=\"props.color\"\n [dateClass]=\"props.datepickerOptions.dateClass\"\n [disabled]=\"props.datepickerOptions.disabled\"\n [opened]=\"props.datepickerOptions.opened\"\n [panelClass]=\"props.datepickerOptions.panelClass\"\n [startAt]=\"props.datepickerOptions.startAt\"\n [startView]=\"props.datepickerOptions.startView\"\n [touchUi]=\"props.datepickerOptions.touchUi\"\n [calendarHeaderComponent]=\"props.datepickerOptions.calendarHeaderComponent\"\n (monthSelected)=\"props.datepickerOptions.monthSelected(field, $event, picker)\"\n (yearSelected)=\"props.datepickerOptions.yearSelected(field, $event, picker)\"\n (opened)=\"props.datepickerOptions.opened = true\"\n (closed)=\"props.datepickerOptions.opened = false\"\n >\n </mat-datepicker>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldDatepicker\n extends FieldType<FieldTypeConfig<DatepickerProps>>\n implements AfterViewInit, OnDestroy\n{\n @ViewChild('datepickerToggle', { static: true }) datepickerToggle!: TemplateRef<any>;\n\n override defaultOptions = {\n props: {\n datepickerOptions: {\n startView: 'month' as const,\n datepickerTogglePosition: 'suffix' as const,\n disabled: false,\n opened: false,\n dateInput: () => {},\n dateChange: () => {},\n monthSelected: () => {},\n yearSelected: () => {},\n },\n },\n };\n private fieldErrorsObserver!: ReturnType<typeof observe>;\n\n constructor(\n private config: FormlyConfig,\n private cdRef: ChangeDetectorRef,\n ) {\n super();\n }\n\n detectChanges() {\n this.options.detectChanges?.(this.field);\n }\n\n ngAfterViewInit() {\n this.props[this.props.datepickerOptions.datepickerTogglePosition] = this.datepickerToggle;\n observe<boolean>(this.field, ['props', 'datepickerOptions', 'opened'], () => {\n this.cdRef.detectChanges();\n });\n\n // temporary fix for https://github.com/angular/components/issues/16761\n if (this.config.getValidatorMessage('matDatepickerParse')) {\n this.fieldErrorsObserver = observe<any>(this.field, ['formControl', 'errors'], ({ currentValue }) => {\n if (currentValue && currentValue.required && currentValue.matDatepickerParse) {\n const errors = Object.keys(currentValue)\n .sort((prop) => (prop === 'matDatepickerParse' ? -1 : 0))\n .reduce((errors, prop) => ({ ...errors, [prop]: currentValue[prop] }), {});\n\n this.fieldErrorsObserver?.setValue(errors);\n }\n });\n }\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n this.fieldErrorsObserver?.unsubscribe();\n }\n}\n","import { FormlyFieldDatepicker } from './datepicker.type';\nimport { ConfigOption } from '@ngx-formly/core';\n\nexport function withFormlyFieldDatepicker(): ConfigOption {\n return {\n types: [\n {\n name: 'datepicker',\n component: FormlyFieldDatepicker,\n wrappers: ['form-field'],\n },\n ],\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatDatepickerModule } from '@angular/material/datepicker';\n\nimport { FormlyFieldDatepicker } from './datepicker.type';\nimport { withFormlyFieldDatepicker } from './datepicker.config';\n\n@NgModule({\n declarations: [FormlyFieldDatepicker],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatInputModule,\n MatDatepickerModule,\n\n FormlyMatFormFieldModule,\n FormlyModule.forChild(withFormlyFieldDatepicker()),\n ],\n})\nexport class FormlyMatDatepickerModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["observe"],"mappings":";;;;;;;;;;;;;AA0FM,MAAO,qBACX,SAAQ,SAA2C,CAAA;IAqBnD,WACU,CAAA,MAAoB,EACpB,KAAwB,EAAA;AAEhC,QAAA,KAAK,EAAE;QAHC,IAAM,CAAA,MAAA,GAAN,MAAM;QACN,IAAK,CAAA,KAAA,GAAL,KAAK;AAlBN,QAAA,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,KAAK,EAAE;AACL,gBAAA,iBAAiB,EAAE;AACjB,oBAAA,SAAS,EAAE,OAAgB;AAC3B,oBAAA,wBAAwB,EAAE,QAAiB;AAC3C,oBAAA,QAAQ,EAAE,KAAK;AACf,oBAAA,MAAM,EAAE,KAAK;AACb,oBAAA,SAAS,EAAE,MAAK,GAAG;AACnB,oBAAA,UAAU,EAAE,MAAK,GAAG;AACpB,oBAAA,aAAa,EAAE,MAAK,GAAG;AACvB,oBAAA,YAAY,EAAE,MAAK,GAAG;AACvB,iBAAA;A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,wBAAwB;AACxB,wBAAA,YAAY,CAAC,QAAQ,CAAC,yBAAyB,EAAE,CAAC;AACnD,qBAAA;AACF,iBAAA;;;ACvBD;;AAEG;;;;"}
|
|
@@ -94,7 +94,7 @@ class FormlyWrapperFormField extends FieldWrapper {
|
|
|
94
94
|
<ng-container [ngTemplateOutlet]="content" [ngTemplateOutletContext]="{ field: field }"></ng-container>
|
|
95
95
|
</ng-template>
|
|
96
96
|
</ng-template>
|
|
97
|
-
`, isInline: true, styles: ["formly-wrapper-mat-form-field .mat-mdc-form-field,formly-wrapper-mat-form-field .mat-form-field{width:100%}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i4
|
|
97
|
+
`, isInline: true, styles: ["formly-wrapper-mat-form-field .mat-mdc-form-field,formly-wrapper-mat-form-field .mat-form-field{width:100%}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i4.LegacyFormlyValidationMessage, selector: "formly-validation-message" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
98
98
|
}
|
|
99
99
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyWrapperFormField, decorators: [{
|
|
100
100
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-formly-material-form-field.mjs","sources":["../../../../src/ui/material/form-field/src/form-field.wrapper.ts","../../../../src/ui/material/form-field/src/form-field.config.ts","../../../../src/ui/material/form-field/src/form-field.module.ts","../../../../src/ui/material/form-field/src/field.type.ts","../../../../src/ui/material/form-field/src/ngx-formly-material-form-field.ts"],"sourcesContent":["import {\n Component,\n ViewChild,\n OnInit,\n OnDestroy,\n Renderer2,\n AfterViewInit,\n ElementRef,\n ViewEncapsulation,\n TemplateRef,\n} from '@angular/core';\nimport {\n ɵdefineHiddenProp as defineHiddenProp,\n FormlyFieldConfig,\n FormlyFieldProps as CoreFormlyFieldProps,\n FieldWrapper,\n} from '@ngx-formly/core';\nimport { MatFormField } from '@angular/material/form-field';\nimport { FocusMonitor } from '@angular/cdk/a11y';\nimport { FloatLabelType, MatFormFieldAppearance } from '@angular/material/form-field';\nimport { ThemePalette } from '@angular/material/core';\n\ninterface MatFormlyFieldConfig extends FormlyFieldConfig<FormlyFieldProps> {\n _formField?: FormlyWrapperFormField;\n}\n\nexport interface FormlyFieldProps extends CoreFormlyFieldProps {\n prefix?: TemplateRef<any>;\n suffix?: TemplateRef<any>;\n textPrefix?: TemplateRef<any>;\n textSuffix?: TemplateRef<any>;\n hideLabel?: boolean;\n hideRequiredMarker?: boolean;\n hideFieldUnderline?: boolean;\n floatLabel?: FloatLabelType;\n appearance?: MatFormFieldAppearance;\n subscriptSizing?: 'fixed' | 'dynamic';\n color?: ThemePalette;\n hintStart?: TemplateRef<any> | string;\n hintEnd?: TemplateRef<any> | string;\n}\n\n@Component({\n selector: 'formly-wrapper-mat-form-field',\n template: `\n <!-- fix https://github.com/angular/material2/pull/7083 by setting width to 100% -->\n <mat-form-field\n [hideRequiredMarker]=\"true\"\n [floatLabel]=\"props.floatLabel\"\n [appearance]=\"props.appearance\"\n [subscriptSizing]=\"props.subscriptSizing\"\n [color]=\"props.color ?? 'primary'\"\n >\n <ng-container #fieldComponent></ng-container>\n <mat-label *ngIf=\"props.label && props.hideLabel !== true\">\n {{ props.label }}\n <span\n *ngIf=\"props.required && props.hideRequiredMarker !== true\"\n aria-hidden=\"true\"\n class=\"mat-form-field-required-marker mat-mdc-form-field-required-marker\"\n >*</span\n >\n </mat-label>\n\n <ng-container matTextPrefix *ngIf=\"props.textPrefix\">\n <ng-container [ngTemplateOutlet]=\"props.textPrefix\" [ngTemplateOutletContext]=\"{ field: field }\"></ng-container>\n </ng-container>\n\n <ng-container matPrefix *ngIf=\"props.prefix\">\n <ng-container [ngTemplateOutlet]=\"props.prefix\" [ngTemplateOutletContext]=\"{ field: field }\"></ng-container>\n </ng-container>\n\n <ng-container matTextSuffix *ngIf=\"props.textSuffix\">\n <ng-container [ngTemplateOutlet]=\"props.textSuffix\" [ngTemplateOutletContext]=\"{ field: field }\"></ng-container>\n </ng-container>\n\n <ng-container matSuffix *ngIf=\"props.suffix\">\n <ng-container [ngTemplateOutlet]=\"props.suffix\" [ngTemplateOutletContext]=\"{ field: field }\"></ng-container>\n </ng-container>\n\n <mat-error>\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </mat-error>\n\n <mat-hint *ngIf=\"props.description || props.hintStart as hint\">\n <ng-container [ngTemplateOutlet]=\"stringOrTemplate\" [ngTemplateOutletContext]=\"{ content: hint }\">\n </ng-container>\n </mat-hint>\n\n <mat-hint *ngIf=\"props.hintEnd as hintEnd\" align=\"end\">\n <ng-container [ngTemplateOutlet]=\"stringOrTemplate\" [ngTemplateOutletContext]=\"{ content: hintEnd }\">\n </ng-container>\n </mat-hint>\n </mat-form-field>\n\n <ng-template #stringOrTemplate let-content=\"content\">\n <ng-container *ngIf=\"!content.createEmbeddedView; else template\">{{ content }}</ng-container>\n <ng-template #template>\n <ng-container [ngTemplateOutlet]=\"content\" [ngTemplateOutletContext]=\"{ field: field }\"></ng-container>\n </ng-template>\n </ng-template>\n `,\n styleUrls: ['./form-field.wrapper.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class FormlyWrapperFormField\n extends FieldWrapper<MatFormlyFieldConfig>\n implements OnInit, OnDestroy, AfterViewInit\n{\n @ViewChild(MatFormField, { static: true }) formField!: MatFormField;\n\n constructor(\n private renderer: Renderer2,\n private elementRef: ElementRef,\n private focusMonitor: FocusMonitor,\n ) {\n super();\n }\n\n ngOnInit() {\n defineHiddenProp(this.field, '_formField', this.formField);\n this.focusMonitor.monitor(this.elementRef, true).subscribe((origin) => {\n if (!origin && this.field.focus) {\n this.field.focus = false;\n }\n });\n }\n\n ngAfterViewInit() {\n // temporary fix for https://github.com/angular/material2/issues/7891\n if (this.formField.appearance !== 'outline' && this.props.hideFieldUnderline === true) {\n const underlineElement = this.formField._elementRef.nativeElement.querySelector('.mat-form-field-underline');\n underlineElement && this.renderer.removeChild(underlineElement.parentNode, underlineElement);\n }\n }\n\n ngOnDestroy() {\n delete this.field._formField;\n this.focusMonitor.stopMonitoring(this.elementRef);\n }\n}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyWrapperFormField } from './form-field.wrapper';\n\nexport function withFormlyFormField(): ConfigOption {\n return {\n wrappers: [\n {\n name: 'form-field',\n component: FormlyWrapperFormField,\n },\n ],\n };\n}\n","import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { FormlyWrapperFormField } from './form-field.wrapper';\nimport { withFormlyFormField } from './form-field.config';\n\n@NgModule({\n declarations: [FormlyWrapperFormField],\n imports: [CommonModule, ReactiveFormsModule, MatFormFieldModule, FormlyModule.forChild(withFormlyFormField())],\n schemas: [NO_ERRORS_SCHEMA],\n})\nexport class FormlyMatFormFieldModule {}\n","import { OnDestroy, TemplateRef, ViewChild, Type, Directive, ViewChildren, QueryList } from '@angular/core';\nimport { FieldType as CoreFieldType, FormlyFieldConfig, ɵobserve as observe } from '@ngx-formly/core';\nimport { Subject } from 'rxjs';\nimport { MatFormField, MatFormFieldControl } from '@angular/material/form-field';\nimport { ErrorStateMatcher } from '@angular/material/core';\nimport { FormlyFieldProps } from './form-field.wrapper';\n\n@Directive()\nexport abstract class FieldType<F extends FormlyFieldConfig<FormlyFieldProps>>\n extends CoreFieldType<F>\n implements OnDestroy, MatFormFieldControl<any>\n{\n @ViewChild('matPrefix') set matPrefix(prefix: TemplateRef<any>) {\n if (prefix) {\n this.props.prefix = prefix;\n }\n }\n @ViewChild('matTextPrefix') set matTextPrefix(textPrefix: TemplateRef<any>) {\n if (textPrefix) {\n this.props.textPrefix = textPrefix;\n }\n }\n @ViewChild('matSuffix') set matSuffix(suffix: TemplateRef<any>) {\n if (suffix) {\n this.props.suffix = suffix;\n }\n }\n @ViewChild('matTextSuffix') set matTextSuffix(textSuffix: TemplateRef<any>) {\n if (textSuffix) {\n this.props.textSuffix = textSuffix;\n }\n }\n\n @ViewChildren(MatFormFieldControl) set _controls(controls: QueryList<MatFormFieldControl<any>>) {\n this.attachControl(controls.length === 1 ? controls.first : this);\n }\n\n errorStateMatcher: ErrorStateMatcher = { isErrorState: () => this.field && this.showError };\n stateChanges = new Subject<void>();\n _errorState = false;\n _focused = false;\n\n ngOnDestroy() {\n delete (this.formField as any)?._control;\n this.stateChanges.complete();\n }\n\n setDescribedByIds(_ids: string[]): void {}\n onContainerClick(_event: MouseEvent): void {\n this.field.focus = true;\n this.stateChanges.next();\n }\n\n get errorState() {\n const showError = this.options!.showError!(this);\n if (showError !== this._errorState) {\n this._errorState = showError;\n this.stateChanges.next();\n }\n\n return showError;\n }\n\n get controlType() {\n if (this.props.type) {\n return this.props.type;\n }\n\n const type = this.field.type!;\n return type instanceof Type ? type.prototype.constructor.name : type;\n }\n get focused() {\n const focused = !!this.field.focus && !this.disabled;\n if (focused !== this._focused) {\n this._focused = focused;\n this.stateChanges.next();\n }\n return focused;\n }\n get disabled() {\n return !!this.props.disabled;\n }\n get required() {\n return !!this.props.required;\n }\n get placeholder() {\n return this.props.placeholder || '';\n }\n get shouldPlaceholderFloat() {\n return this.shouldLabelFloat;\n }\n get value() {\n return this.formControl?.value;\n }\n set value(value) {\n this.formControl?.patchValue(value);\n }\n get ngControl() {\n return this.formControl as any;\n }\n get empty() {\n return this.value == null || this.value === '';\n }\n get shouldLabelFloat() {\n return this.focused || !this.empty;\n }\n get formField(): MatFormField {\n return (this.field as any)?.['_formField'];\n }\n\n private attachControl(control: MatFormFieldControl<any>) {\n if (this.formField && control !== this.formField._control) {\n this.formField._control = control;\n\n // temporary fix for https://github.com/angular/material2/issues/6728\n const ngControl = control?.ngControl as any;\n if (ngControl?.valueAccessor?.hasOwnProperty('_formField')) {\n ngControl.valueAccessor['_formField'] = this.formField;\n }\n if (ngControl?.valueAccessor?.hasOwnProperty('_parentFormField')) {\n ngControl.valueAccessor['_parentFormField'] = this.formField;\n }\n\n ['prefix', 'suffix', 'textPrefix', 'textSuffix'].forEach((type) =>\n observe<TemplateRef<any>>(\n this.field,\n ['props', type],\n ({ currentValue }) =>\n currentValue &&\n Promise.resolve().then(() => {\n this.options.detectChanges!(this.field);\n }),\n ),\n );\n\n // https://github.com/angular/components/issues/16209\n const setDescribedByIds = control.setDescribedByIds.bind(control);\n control.setDescribedByIds = (ids: string[]) => {\n setTimeout(() => setDescribedByIds(ids));\n };\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["defineHiddenProp","i1","CoreFieldType","observe"],"mappings":";;;;;;;;;;;;AAyGM,MAAO,sBACX,SAAQ,YAAkC,CAAA;AAK1C,IAAA,WAAA,CACU,QAAmB,EACnB,UAAsB,EACtB,YAA0B,EAAA;AAElC,QAAA,KAAK,EAAE;QAJC,IAAQ,CAAA,QAAA,GAAR,QAAQ;QACR,IAAU,CAAA,UAAA,GAAV,UAAU;QACV,IAAY,CAAA,YAAA,GAAZ,YAAY;;IAKtB,QAAQ,GAAA;QACNA,iBAAgB,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC;AAC1D,QAAA,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,KAAI;YACpE,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;AAC/B,gBAAA,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK;;AAE5B,SAAC,CAAC;;IAGJ,eAAe,GAAA;;AAEb,QAAA,IAAI,IAAI,CAAC,SAAS,CAAC,UAAU,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,kBAAkB,KAAK,IAAI,EAAE;AACrF,YAAA,MAAM,gBAAgB,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,aAAa,CAAC,aAAa,CAAC,2BAA2B,CAAC;AAC5G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S;uBAAC,eAAe;gBAMa,SAAS,EAAA,CAAA;sBAA/C,YAAY;uBAAC,mBAAmB;;;ACjCnC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-formly-material-form-field.mjs","sources":["../../../../src/ui/material/form-field/src/form-field.wrapper.ts","../../../../src/ui/material/form-field/src/form-field.config.ts","../../../../src/ui/material/form-field/src/form-field.module.ts","../../../../src/ui/material/form-field/src/field.type.ts","../../../../src/ui/material/form-field/src/ngx-formly-material-form-field.ts"],"sourcesContent":["import {\n Component,\n ViewChild,\n OnInit,\n OnDestroy,\n Renderer2,\n AfterViewInit,\n ElementRef,\n ViewEncapsulation,\n TemplateRef,\n} from '@angular/core';\nimport {\n ɵdefineHiddenProp as defineHiddenProp,\n FormlyFieldConfig,\n FormlyFieldProps as CoreFormlyFieldProps,\n FieldWrapper,\n} from '@ngx-formly/core';\nimport { MatFormField } from '@angular/material/form-field';\nimport { FocusMonitor } from '@angular/cdk/a11y';\nimport { FloatLabelType, MatFormFieldAppearance } from '@angular/material/form-field';\nimport { ThemePalette } from '@angular/material/core';\n\ninterface MatFormlyFieldConfig extends FormlyFieldConfig<FormlyFieldProps> {\n _formField?: FormlyWrapperFormField;\n}\n\nexport interface FormlyFieldProps extends CoreFormlyFieldProps {\n prefix?: TemplateRef<any>;\n suffix?: TemplateRef<any>;\n textPrefix?: TemplateRef<any>;\n textSuffix?: TemplateRef<any>;\n hideLabel?: boolean;\n hideRequiredMarker?: boolean;\n hideFieldUnderline?: boolean;\n floatLabel?: FloatLabelType;\n appearance?: MatFormFieldAppearance;\n subscriptSizing?: 'fixed' | 'dynamic';\n color?: ThemePalette;\n hintStart?: TemplateRef<any> | string;\n hintEnd?: TemplateRef<any> | string;\n}\n\n@Component({\n selector: 'formly-wrapper-mat-form-field',\n template: `\n <!-- fix https://github.com/angular/material2/pull/7083 by setting width to 100% -->\n <mat-form-field\n [hideRequiredMarker]=\"true\"\n [floatLabel]=\"props.floatLabel\"\n [appearance]=\"props.appearance\"\n [subscriptSizing]=\"props.subscriptSizing\"\n [color]=\"props.color ?? 'primary'\"\n >\n <ng-container #fieldComponent></ng-container>\n <mat-label *ngIf=\"props.label && props.hideLabel !== true\">\n {{ props.label }}\n <span\n *ngIf=\"props.required && props.hideRequiredMarker !== true\"\n aria-hidden=\"true\"\n class=\"mat-form-field-required-marker mat-mdc-form-field-required-marker\"\n >*</span\n >\n </mat-label>\n\n <ng-container matTextPrefix *ngIf=\"props.textPrefix\">\n <ng-container [ngTemplateOutlet]=\"props.textPrefix\" [ngTemplateOutletContext]=\"{ field: field }\"></ng-container>\n </ng-container>\n\n <ng-container matPrefix *ngIf=\"props.prefix\">\n <ng-container [ngTemplateOutlet]=\"props.prefix\" [ngTemplateOutletContext]=\"{ field: field }\"></ng-container>\n </ng-container>\n\n <ng-container matTextSuffix *ngIf=\"props.textSuffix\">\n <ng-container [ngTemplateOutlet]=\"props.textSuffix\" [ngTemplateOutletContext]=\"{ field: field }\"></ng-container>\n </ng-container>\n\n <ng-container matSuffix *ngIf=\"props.suffix\">\n <ng-container [ngTemplateOutlet]=\"props.suffix\" [ngTemplateOutletContext]=\"{ field: field }\"></ng-container>\n </ng-container>\n\n <mat-error>\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </mat-error>\n\n <mat-hint *ngIf=\"props.description || props.hintStart as hint\">\n <ng-container [ngTemplateOutlet]=\"stringOrTemplate\" [ngTemplateOutletContext]=\"{ content: hint }\">\n </ng-container>\n </mat-hint>\n\n <mat-hint *ngIf=\"props.hintEnd as hintEnd\" align=\"end\">\n <ng-container [ngTemplateOutlet]=\"stringOrTemplate\" [ngTemplateOutletContext]=\"{ content: hintEnd }\">\n </ng-container>\n </mat-hint>\n </mat-form-field>\n\n <ng-template #stringOrTemplate let-content=\"content\">\n <ng-container *ngIf=\"!content.createEmbeddedView; else template\">{{ content }}</ng-container>\n <ng-template #template>\n <ng-container [ngTemplateOutlet]=\"content\" [ngTemplateOutletContext]=\"{ field: field }\"></ng-container>\n </ng-template>\n </ng-template>\n `,\n styleUrls: ['./form-field.wrapper.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class FormlyWrapperFormField\n extends FieldWrapper<MatFormlyFieldConfig>\n implements OnInit, OnDestroy, AfterViewInit\n{\n @ViewChild(MatFormField, { static: true }) formField!: MatFormField;\n\n constructor(\n private renderer: Renderer2,\n private elementRef: ElementRef,\n private focusMonitor: FocusMonitor,\n ) {\n super();\n }\n\n ngOnInit() {\n defineHiddenProp(this.field, '_formField', this.formField);\n this.focusMonitor.monitor(this.elementRef, true).subscribe((origin) => {\n if (!origin && this.field.focus) {\n this.field.focus = false;\n }\n });\n }\n\n ngAfterViewInit() {\n // temporary fix for https://github.com/angular/material2/issues/7891\n if (this.formField.appearance !== 'outline' && this.props.hideFieldUnderline === true) {\n const underlineElement = this.formField._elementRef.nativeElement.querySelector('.mat-form-field-underline');\n underlineElement && this.renderer.removeChild(underlineElement.parentNode, underlineElement);\n }\n }\n\n ngOnDestroy() {\n delete this.field._formField;\n this.focusMonitor.stopMonitoring(this.elementRef);\n }\n}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyWrapperFormField } from './form-field.wrapper';\n\nexport function withFormlyFormField(): ConfigOption {\n return {\n wrappers: [\n {\n name: 'form-field',\n component: FormlyWrapperFormField,\n },\n ],\n };\n}\n","import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { FormlyWrapperFormField } from './form-field.wrapper';\nimport { withFormlyFormField } from './form-field.config';\n\n@NgModule({\n declarations: [FormlyWrapperFormField],\n imports: [CommonModule, ReactiveFormsModule, MatFormFieldModule, FormlyModule.forChild(withFormlyFormField())],\n schemas: [NO_ERRORS_SCHEMA],\n})\nexport class FormlyMatFormFieldModule {}\n","import { OnDestroy, TemplateRef, ViewChild, Type, Directive, ViewChildren, QueryList } from '@angular/core';\nimport { FieldType as CoreFieldType, FormlyFieldConfig, ɵobserve as observe } from '@ngx-formly/core';\nimport { Subject } from 'rxjs';\nimport { MatFormField, MatFormFieldControl } from '@angular/material/form-field';\nimport { ErrorStateMatcher } from '@angular/material/core';\nimport { FormlyFieldProps } from './form-field.wrapper';\n\n@Directive()\nexport abstract class FieldType<F extends FormlyFieldConfig<FormlyFieldProps>>\n extends CoreFieldType<F>\n implements OnDestroy, MatFormFieldControl<any>\n{\n @ViewChild('matPrefix') set matPrefix(prefix: TemplateRef<any>) {\n if (prefix) {\n this.props.prefix = prefix;\n }\n }\n @ViewChild('matTextPrefix') set matTextPrefix(textPrefix: TemplateRef<any>) {\n if (textPrefix) {\n this.props.textPrefix = textPrefix;\n }\n }\n @ViewChild('matSuffix') set matSuffix(suffix: TemplateRef<any>) {\n if (suffix) {\n this.props.suffix = suffix;\n }\n }\n @ViewChild('matTextSuffix') set matTextSuffix(textSuffix: TemplateRef<any>) {\n if (textSuffix) {\n this.props.textSuffix = textSuffix;\n }\n }\n\n @ViewChildren(MatFormFieldControl) set _controls(controls: QueryList<MatFormFieldControl<any>>) {\n this.attachControl(controls.length === 1 ? controls.first : this);\n }\n\n errorStateMatcher: ErrorStateMatcher = { isErrorState: () => this.field && this.showError };\n stateChanges = new Subject<void>();\n _errorState = false;\n _focused = false;\n\n ngOnDestroy() {\n delete (this.formField as any)?._control;\n this.stateChanges.complete();\n }\n\n setDescribedByIds(_ids: string[]): void {}\n onContainerClick(_event: MouseEvent): void {\n this.field.focus = true;\n this.stateChanges.next();\n }\n\n get errorState() {\n const showError = this.options!.showError!(this);\n if (showError !== this._errorState) {\n this._errorState = showError;\n this.stateChanges.next();\n }\n\n return showError;\n }\n\n get controlType() {\n if (this.props.type) {\n return this.props.type;\n }\n\n const type = this.field.type!;\n return type instanceof Type ? type.prototype.constructor.name : type;\n }\n get focused() {\n const focused = !!this.field.focus && !this.disabled;\n if (focused !== this._focused) {\n this._focused = focused;\n this.stateChanges.next();\n }\n return focused;\n }\n get disabled() {\n return !!this.props.disabled;\n }\n get required() {\n return !!this.props.required;\n }\n get placeholder() {\n return this.props.placeholder || '';\n }\n get shouldPlaceholderFloat() {\n return this.shouldLabelFloat;\n }\n get value() {\n return this.formControl?.value;\n }\n set value(value) {\n this.formControl?.patchValue(value);\n }\n get ngControl() {\n return this.formControl as any;\n }\n get empty() {\n return this.value == null || this.value === '';\n }\n get shouldLabelFloat() {\n return this.focused || !this.empty;\n }\n get formField(): MatFormField {\n return (this.field as any)?.['_formField'];\n }\n\n private attachControl(control: MatFormFieldControl<any>) {\n if (this.formField && control !== this.formField._control) {\n this.formField._control = control;\n\n // temporary fix for https://github.com/angular/material2/issues/6728\n const ngControl = control?.ngControl as any;\n if (ngControl?.valueAccessor?.hasOwnProperty('_formField')) {\n ngControl.valueAccessor['_formField'] = this.formField;\n }\n if (ngControl?.valueAccessor?.hasOwnProperty('_parentFormField')) {\n ngControl.valueAccessor['_parentFormField'] = this.formField;\n }\n\n ['prefix', 'suffix', 'textPrefix', 'textSuffix'].forEach((type) =>\n observe<TemplateRef<any>>(\n this.field,\n ['props', type],\n ({ currentValue }) =>\n currentValue &&\n Promise.resolve().then(() => {\n this.options.detectChanges!(this.field);\n }),\n ),\n );\n\n // https://github.com/angular/components/issues/16209\n const setDescribedByIds = control.setDescribedByIds.bind(control);\n control.setDescribedByIds = (ids: string[]) => {\n setTimeout(() => setDescribedByIds(ids));\n };\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["defineHiddenProp","i1","CoreFieldType","observe"],"mappings":";;;;;;;;;;;;AAyGM,MAAO,sBACX,SAAQ,YAAkC,CAAA;AAK1C,IAAA,WAAA,CACU,QAAmB,EACnB,UAAsB,EACtB,YAA0B,EAAA;AAElC,QAAA,KAAK,EAAE;QAJC,IAAQ,CAAA,QAAA,GAAR,QAAQ;QACR,IAAU,CAAA,UAAA,GAAV,UAAU;QACV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aAAC;;;+GAnIe,SAAS,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAT,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,SAAS,4aAyBf,mBAAmB,EAAA,WAAA,EAAA,IAAA,EAAA,CAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAzBb,SAAS,EAAA,UAAA,EAAA,CAAA;kBAD9B;8BAK6B,SAAS,EAAA,CAAA;sBAApC,SAAS;uBAAC,WAAW;gBAKU,aAAa,EAAA,CAAA;sBAA5C,SAAS;uBAAC,eAAe;gBAKE,SAAS,EAAA,CAAA;sBAApC,SAAS;uBAAC,WAAW;gBAKU,aAAa,EAAA,CAAA;sBAA5C,SAAS;uBAAC,eAAe;gBAMa,SAAS,EAAA,CAAA;sBAA/C,YAAY;uBAAC,mBAAmB;;;ACjCnC;;AAEG;;;;"}
|
|
@@ -45,7 +45,7 @@ class FormlyFieldInput extends FieldType {
|
|
|
45
45
|
[placeholder]="props.placeholder"
|
|
46
46
|
/>
|
|
47
47
|
</ng-template>
|
|
48
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i4
|
|
48
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i4.LegacyFormlyAttributes, selector: "[formlyAttributes]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
49
49
|
}
|
|
50
50
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldInput, decorators: [{
|
|
51
51
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-formly-material-input.mjs","sources":["../../../../src/ui/material/input/src/input.type.ts","../../../../src/ui/material/input/src/input.config.ts","../../../../src/ui/material/input/src/input.module.ts","../../../../src/ui/material/input/src/ngx-formly-material-input.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, Type } from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\n\ninterface InputProps extends FormlyFieldProps {}\n\nexport interface FormlyInputFieldConfig extends FormlyFieldConfig<InputProps> {\n type: 'input' | Type<FormlyFieldInput>;\n}\n\n@Component({\n selector: 'formly-field-mat-input',\n template: `\n <input\n *ngIf=\"type !== 'number'; else numberTmp\"\n matInput\n [id]=\"id\"\n [name]=\"field.name\"\n [type]=\"type || 'text'\"\n [readonly]=\"props.readonly\"\n [required]=\"required\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [tabIndex]=\"props.tabindex\"\n [placeholder]=\"props.placeholder\"\n />\n <ng-template #numberTmp>\n <input\n matInput\n [id]=\"id\"\n [name]=\"field.name\"\n type=\"number\"\n [readonly]=\"props.readonly\"\n [required]=\"required\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [tabIndex]=\"props.tabindex\"\n [placeholder]=\"props.placeholder\"\n />\n </ng-template>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldInput extends FieldType<FieldTypeConfig<InputProps>> {\n get type() {\n return this.props.type || 'text';\n }\n}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyFieldInput } from './input.type';\n\nexport function withFormlyFieldInput(): ConfigOption {\n return {\n types: [\n {\n name: 'input',\n component: FormlyFieldInput,\n wrappers: ['form-field'],\n },\n { name: 'string', extends: 'input' },\n {\n name: 'number',\n extends: 'input',\n defaultOptions: {\n props: {\n type: 'number',\n },\n },\n },\n {\n name: 'integer',\n extends: 'input',\n defaultOptions: {\n props: {\n type: 'number',\n },\n },\n },\n ],\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\n\nimport { FormlyFieldInput } from './input.type';\nimport { withFormlyFieldInput } from './input.config';\n\n@NgModule({\n declarations: [FormlyFieldInput],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatInputModule,\n\n FormlyMatFormFieldModule,\n FormlyModule.forChild(withFormlyFieldInput()),\n ],\n})\nexport class FormlyMatInputModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;AA6CM,MAAO,gBAAiB,SAAQ,SAAsC,CAAA;AAC1E,IAAA,IAAI,IAAI,GAAA;AACN,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,MAAM;;+GAFvB,gBAAgB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAhB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,gBAAgB,EAjCjB,QAAA,EAAA,wBAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EA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ts","../../../../src/ui/material/input/src/input.config.ts","../../../../src/ui/material/input/src/input.module.ts","../../../../src/ui/material/input/src/ngx-formly-material-input.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, Type } from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\n\ninterface InputProps extends FormlyFieldProps {}\n\nexport interface FormlyInputFieldConfig extends FormlyFieldConfig<InputProps> {\n type: 'input' | Type<FormlyFieldInput>;\n}\n\n@Component({\n selector: 'formly-field-mat-input',\n template: `\n <input\n *ngIf=\"type !== 'number'; else numberTmp\"\n matInput\n [id]=\"id\"\n [name]=\"field.name\"\n [type]=\"type || 'text'\"\n [readonly]=\"props.readonly\"\n [required]=\"required\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [tabIndex]=\"props.tabindex\"\n [placeholder]=\"props.placeholder\"\n />\n <ng-template #numberTmp>\n <input\n matInput\n [id]=\"id\"\n [name]=\"field.name\"\n type=\"number\"\n [readonly]=\"props.readonly\"\n [required]=\"required\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [tabIndex]=\"props.tabindex\"\n [placeholder]=\"props.placeholder\"\n />\n </ng-template>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldInput extends FieldType<FieldTypeConfig<InputProps>> {\n get type() {\n return this.props.type || 'text';\n }\n}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyFieldInput } from './input.type';\n\nexport function withFormlyFieldInput(): ConfigOption {\n return {\n types: [\n {\n name: 'input',\n component: FormlyFieldInput,\n wrappers: ['form-field'],\n },\n { name: 'string', extends: 'input' },\n {\n name: 'number',\n extends: 'input',\n defaultOptions: {\n props: {\n type: 'number',\n },\n },\n },\n {\n name: 'integer',\n extends: 'input',\n defaultOptions: {\n props: {\n type: 'number',\n },\n },\n },\n ],\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\n\nimport { FormlyFieldInput } from './input.type';\nimport { withFormlyFieldInput } from './input.config';\n\n@NgModule({\n declarations: [FormlyFieldInput],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatInputModule,\n\n FormlyMatFormFieldModule,\n FormlyModule.forChild(withFormlyFieldInput()),\n ],\n})\nexport class FormlyMatInputModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;AA6CM,MAAO,gBAAiB,SAAQ,SAAsC,CAAA;AAC1E,IAAA,IAAI,IAAI,GAAA;AACN,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,MAAM;;+GAFvB,gBAAgB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAhB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,gBAAgB,EAjCjB,QAAA,EAAA,wBAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,IAAA,EAAA,QAAA,EAAA,QAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,UAAA,CAAA,EAAA,EAAA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AA,oBAAoB,YAR7B,YAAY;YACZ,mBAAmB;YACnB,cAAc;YAEd,wBAAwB;AACxB,YAAA,YAAY,CAAC,QAAQ,CAAC,oBAAoB,EAAE,CAAC,CAAA,EAAA,CAAA,CAAA;;4FAGpC,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAXhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,gBAAgB,CAAC;AAChC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,cAAc;wBAEd,wBAAwB;AACxB,wBAAA,YAAY,CAAC,QAAQ,CAAC,oBAAoB,EAAE,CAAC;AAC9C,qBAAA;AACF,iBAAA;;;ACrBD;;AAEG;;;;"}
|
|
@@ -56,7 +56,7 @@ class FormlyFieldMultiCheckbox extends FieldType {
|
|
|
56
56
|
{{ option.label }}
|
|
57
57
|
</mat-checkbox>
|
|
58
58
|
</ng-container>
|
|
59
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i2.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i3
|
|
59
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i2.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i3.LegacyFormlyAttributes, selector: "[formlyAttributes]" }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.LegacyFormlySelectOptionsPipe, name: "formlySelectOptions" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
60
60
|
}
|
|
61
61
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldMultiCheckbox, decorators: [{
|
|
62
62
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-formly-material-multicheckbox.mjs","sources":["../../../../src/ui/material/multicheckbox/src/multicheckbox.type.ts","../../../../src/ui/material/multicheckbox/src/multicheckbox.config.ts","../../../../src/ui/material/multicheckbox/src/multicheckbox.module.ts","../../../../src/ui/material/multicheckbox/src/ngx-formly-material-multicheckbox.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, ViewChildren, QueryList, Type } from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { MatCheckbox } from '@angular/material/checkbox';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\n\ninterface MultiCheckboxProps extends FormlyFieldProps {\n labelPosition?: 'before' | 'after';\n}\n\nexport interface FormlyMultiCheckboxFieldConfig extends FormlyFieldConfig<MultiCheckboxProps> {\n type: 'multicheckbox' | Type<FormlyFieldMultiCheckbox>;\n}\n\n@Component({\n selector: 'formly-field-mat-multicheckbox',\n template: `\n <ng-container *ngFor=\"let option of props.options | formlySelectOptions: field | async; let i = index\">\n <mat-checkbox\n [id]=\"id + '_' + i\"\n [formlyAttributes]=\"field\"\n [tabIndex]=\"props.tabindex\"\n [color]=\"props.color\"\n [labelPosition]=\"props.labelPosition\"\n [checked]=\"isChecked(option)\"\n [disabled]=\"formControl.disabled || option.disabled\"\n (change)=\"onChange(option.value, $event.checked)\"\n >\n {{ option.label }}\n </mat-checkbox>\n </ng-container>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[id]': 'id',\n },\n})\nexport class FormlyFieldMultiCheckbox extends FieldType<FieldTypeConfig<MultiCheckboxProps>> {\n @ViewChildren(MatCheckbox) checkboxes!: QueryList<MatCheckbox>;\n\n override defaultOptions = {\n props: {\n hideFieldUnderline: true,\n floatLabel: 'always' as const,\n color: 'accent' as const, // workaround for https://github.com/angular/components/issues/18465\n },\n };\n\n onChange(value: any, checked: boolean) {\n this.formControl.markAsDirty();\n if (this.props.type === 'array') {\n this.formControl.patchValue(\n checked\n ? [...(this.formControl.value || []), value]\n : [...(this.formControl.value || [])].filter((o) => o !== value),\n );\n } else {\n this.formControl.patchValue({ ...this.formControl.value, [value]: checked });\n }\n this.formControl.markAsTouched();\n }\n\n // TODO: find a solution to prevent scroll on focus\n override onContainerClick() {}\n\n isChecked(option: any) {\n const value = this.formControl.value;\n\n return value && (this.props.type === 'array' ? value.indexOf(option.value) !== -1 : value[option.value]);\n }\n}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyFieldMultiCheckbox } from './multicheckbox.type';\n\nexport function withFormlyFieldMultiCheckbox(): ConfigOption {\n return {\n types: [\n {\n name: 'multicheckbox',\n component: FormlyFieldMultiCheckbox,\n wrappers: ['form-field'],\n },\n ],\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { FormlySelectModule } from '@ngx-formly/core/select';\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\n\nimport { FormlyFieldMultiCheckbox } from './multicheckbox.type';\nimport { withFormlyFieldMultiCheckbox } from './multicheckbox.config';\n\n@NgModule({\n declarations: [FormlyFieldMultiCheckbox],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n\n MatCheckboxModule,\n\n FormlyMatFormFieldModule,\n FormlySelectModule,\n FormlyModule.forChild(withFormlyFieldMultiCheckbox()),\n ],\n})\nexport class FormlyMatMultiCheckboxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;AAoCM,MAAO,wBAAyB,SAAQ,SAA8C,CAAA;AAvB5F,IAAA,WAAA,GAAA;;AA0BW,QAAA,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,KAAK,EAAE;AACL,gBAAA,kBAAkB,EAAE,IAAI;AACxB,gBAAA,UAAU,EAAE,QAAiB;gBAC7B,KAAK,EAAE,QAAiB;AACzB,aAAA;SACF;AAwBF;IAtBC,QAAQ,CAAC,KAAU,EAAE,OAAgB,EAAA;AACnC,QAAA,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE;QAC9B,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE;AAC/B,YAAA,IAAI,CAAC,WAAW,CAAC,UAAU,CACzB;AACE,kBAAE,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,KAAK;kBACzC,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,CACnE;;aACI;YACL,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC,KAAK,GAAG,OAAO,EAAE,CAAC;;AAE9E,QAAA,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE;;;AAIzB,IAAA,gBAAgB;AAEzB,IAAA,SAAS,CAAC,MAAW,EAAA;AACnB,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK;AAEpC,QAAA,OAAO,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KA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ox.type.ts","../../../../src/ui/material/multicheckbox/src/multicheckbox.config.ts","../../../../src/ui/material/multicheckbox/src/multicheckbox.module.ts","../../../../src/ui/material/multicheckbox/src/ngx-formly-material-multicheckbox.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, ViewChildren, QueryList, Type } from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { MatCheckbox } from '@angular/material/checkbox';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\n\ninterface MultiCheckboxProps extends FormlyFieldProps {\n labelPosition?: 'before' | 'after';\n}\n\nexport interface FormlyMultiCheckboxFieldConfig extends FormlyFieldConfig<MultiCheckboxProps> {\n type: 'multicheckbox' | Type<FormlyFieldMultiCheckbox>;\n}\n\n@Component({\n selector: 'formly-field-mat-multicheckbox',\n template: `\n <ng-container *ngFor=\"let option of props.options | formlySelectOptions: field | async; let i = index\">\n <mat-checkbox\n [id]=\"id + '_' + i\"\n [formlyAttributes]=\"field\"\n [tabIndex]=\"props.tabindex\"\n [color]=\"props.color\"\n [labelPosition]=\"props.labelPosition\"\n [checked]=\"isChecked(option)\"\n [disabled]=\"formControl.disabled || option.disabled\"\n (change)=\"onChange(option.value, $event.checked)\"\n >\n {{ option.label }}\n </mat-checkbox>\n </ng-container>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[id]': 'id',\n },\n})\nexport class FormlyFieldMultiCheckbox extends FieldType<FieldTypeConfig<MultiCheckboxProps>> {\n @ViewChildren(MatCheckbox) checkboxes!: QueryList<MatCheckbox>;\n\n override defaultOptions = {\n props: {\n hideFieldUnderline: true,\n floatLabel: 'always' as const,\n color: 'accent' as const, // workaround for https://github.com/angular/components/issues/18465\n },\n };\n\n onChange(value: any, checked: boolean) {\n this.formControl.markAsDirty();\n if (this.props.type === 'array') {\n this.formControl.patchValue(\n checked\n ? [...(this.formControl.value || []), value]\n : [...(this.formControl.value || [])].filter((o) => o !== value),\n );\n } else {\n this.formControl.patchValue({ ...this.formControl.value, [value]: checked });\n }\n this.formControl.markAsTouched();\n }\n\n // TODO: find a solution to prevent scroll on focus\n override onContainerClick() {}\n\n isChecked(option: any) {\n const value = this.formControl.value;\n\n return value && (this.props.type === 'array' ? value.indexOf(option.value) !== -1 : value[option.value]);\n }\n}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyFieldMultiCheckbox } from './multicheckbox.type';\n\nexport function withFormlyFieldMultiCheckbox(): ConfigOption {\n return {\n types: [\n {\n name: 'multicheckbox',\n component: FormlyFieldMultiCheckbox,\n wrappers: ['form-field'],\n },\n ],\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { FormlySelectModule } from '@ngx-formly/core/select';\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\n\nimport { FormlyFieldMultiCheckbox } from './multicheckbox.type';\nimport { withFormlyFieldMultiCheckbox } from './multicheckbox.config';\n\n@NgModule({\n declarations: [FormlyFieldMultiCheckbox],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n\n MatCheckboxModule,\n\n FormlyMatFormFieldModule,\n FormlySelectModule,\n FormlyModule.forChild(withFormlyFieldMultiCheckbox()),\n ],\n})\nexport class FormlyMatMultiCheckboxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;AAoCM,MAAO,wBAAyB,SAAQ,SAA8C,CAAA;AAvB5F,IAAA,WAAA,GAAA;;AA0BW,QAAA,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,KAAK,EAAE;AACL,gBAAA,kBAAkB,EAAE,IAAI;AACxB,gBAAA,UAAU,EAAE,QAAiB;gBAC7B,KAAK,EAAE,QAAiB;AACzB,aAAA;SACF;AAwBF;IAtBC,QAAQ,CAAC,KAAU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AEjB,wBAAwB;wBACxB,kBAAkB;AAClB,wBAAA,YAAY,CAAC,QAAQ,CAAC,4BAA4B,EAAE,CAAC;AACtD,qBAAA;AACF,iBAAA;;;ACvBD;;AAEG;;;;"}
|
|
@@ -41,7 +41,7 @@ class FormlyFieldNativeSelect extends FieldType {
|
|
|
41
41
|
</ng-container>
|
|
42
42
|
</ng-container>
|
|
43
43
|
</select>
|
|
44
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i4
|
|
44
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i4.LegacyFormlyAttributes, selector: "[formlyAttributes]" }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i5.LegacyFormlySelectOptionsPipe, name: "formlySelectOptions" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
45
45
|
}
|
|
46
46
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldNativeSelect, decorators: [{
|
|
47
47
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-formly-material-native-select.mjs","sources":["../../../../src/ui/material/native-select/src/native-select.type.ts","../../../../src/ui/material/native-select/src/native-select.config.ts","../../../../src/ui/material/native-select/src/native-select.module.ts","../../../../src/ui/material/native-select/src/ngx-formly-material-native-select.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, Type } from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { FormlyFieldSelectProps } from '@ngx-formly/core/select';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\n\ninterface NativeSelectProps extends FormlyFieldProps, FormlyFieldSelectProps {}\n\nexport interface FormlyNativeSelectFieldConfig extends FormlyFieldConfig<NativeSelectProps> {\n type: 'native-select' | Type<FormlyFieldNativeSelect>;\n}\n\n@Component({\n selector: 'formly-field-mat-native-select',\n template: `\n <select\n matNativeControl\n [id]=\"id\"\n [name]=\"field.name\"\n [readonly]=\"props.readonly\"\n [required]=\"required\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n >\n <option *ngIf=\"props.placeholder\" [ngValue]=\"undefined\">{{ props.placeholder }}</option>\n <ng-container *ngIf=\"props.options | formlySelectOptions: field | async as opts\">\n <ng-container *ngFor=\"let opt of opts\">\n <option *ngIf=\"!opt.group; else optgroup\" [ngValue]=\"opt.value\" [disabled]=\"opt.disabled\">\n {{ opt.label }}\n </option>\n <ng-template #optgroup>\n <optgroup [label]=\"opt.label\">\n <option *ngFor=\"let child of opt.group\" [ngValue]=\"child.value\" [disabled]=\"child.disabled\">\n {{ child.label }}\n </option>\n </optgroup>\n </ng-template>\n </ng-container>\n </ng-container>\n </select>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldNativeSelect extends FieldType<FieldTypeConfig<NativeSelectProps>> {}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyFieldNativeSelect } from './native-select.type';\n\nexport function withFormlyFieldNativeSelect(): ConfigOption {\n return {\n types: [\n {\n name: 'native-select',\n component: FormlyFieldNativeSelect,\n wrappers: ['form-field'],\n },\n ],\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { FormlySelectModule } from '@ngx-formly/core/select';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\n\nimport { FormlyFieldNativeSelect } from './native-select.type';\nimport { withFormlyFieldNativeSelect } from './native-select.config';\n\n@NgModule({\n declarations: [FormlyFieldNativeSelect],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatInputModule,\n\n FormlyMatFormFieldModule,\n FormlySelectModule,\n FormlyModule.forChild(withFormlyFieldNativeSelect()),\n ],\n})\nexport class FormlyMatNativeSelectModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;AA2CM,MAAO,uBAAwB,SAAQ,SAA6C,CAAA;+GAA7E,uBAAuB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAvB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,uBAAuB,EA9BxB,QAAA,EAAA,gCAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,cAAA,EAAA,eAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,IAAA,EAAA,QAAA,EAAA,QAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,UAAA,CAAA,EAAA,EAA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|
+
{"version":3,"file":"ngx-formly-material-native-select.mjs","sources":["../../../../src/ui/material/native-select/src/native-select.type.ts","../../../../src/ui/material/native-select/src/native-select.config.ts","../../../../src/ui/material/native-select/src/native-select.module.ts","../../../../src/ui/material/native-select/src/ngx-formly-material-native-select.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, Type } from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { FormlyFieldSelectProps } from '@ngx-formly/core/select';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\n\ninterface NativeSelectProps extends FormlyFieldProps, FormlyFieldSelectProps {}\n\nexport interface FormlyNativeSelectFieldConfig extends FormlyFieldConfig<NativeSelectProps> {\n type: 'native-select' | Type<FormlyFieldNativeSelect>;\n}\n\n@Component({\n selector: 'formly-field-mat-native-select',\n template: `\n <select\n matNativeControl\n [id]=\"id\"\n [name]=\"field.name\"\n [readonly]=\"props.readonly\"\n [required]=\"required\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n >\n <option *ngIf=\"props.placeholder\" [ngValue]=\"undefined\">{{ props.placeholder }}</option>\n <ng-container *ngIf=\"props.options | formlySelectOptions: field | async as opts\">\n <ng-container *ngFor=\"let opt of opts\">\n <option *ngIf=\"!opt.group; else optgroup\" [ngValue]=\"opt.value\" [disabled]=\"opt.disabled\">\n {{ opt.label }}\n </option>\n <ng-template #optgroup>\n <optgroup [label]=\"opt.label\">\n <option *ngFor=\"let child of opt.group\" [ngValue]=\"child.value\" [disabled]=\"child.disabled\">\n {{ child.label }}\n </option>\n </optgroup>\n </ng-template>\n </ng-container>\n </ng-container>\n </select>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldNativeSelect extends FieldType<FieldTypeConfig<NativeSelectProps>> {}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyFieldNativeSelect } from './native-select.type';\n\nexport function withFormlyFieldNativeSelect(): ConfigOption {\n return {\n types: [\n {\n name: 'native-select',\n component: FormlyFieldNativeSelect,\n wrappers: ['form-field'],\n },\n ],\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { FormlySelectModule } from '@ngx-formly/core/select';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\n\nimport { FormlyFieldNativeSelect } from './native-select.type';\nimport { withFormlyFieldNativeSelect } from './native-select.config';\n\n@NgModule({\n declarations: [FormlyFieldNativeSelect],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatInputModule,\n\n FormlyMatFormFieldModule,\n FormlySelectModule,\n FormlyModule.forChild(withFormlyFieldNativeSelect()),\n ],\n})\nexport class FormlyMatNativeSelectModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;AA2CM,MAAO,uBAAwB,SAAQ,SAA6C,CAAA;+GAA7E,uBAAuB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAvB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,uBAAuB,EA9BxB,QAAA,EAAA,gCAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA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B,EAAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,CAAA;AAIT,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2BAA2B,YATpC,YAAY;YACZ,mBAAmB;YACnB,cAAc;YAEd,wBAAwB;YACxB,kBAAkB;AAClB,YAAA,YAAY,CAAC,QAAQ,CAAC,2BAA2B,EAAE,CAAC,CAAA,EAAA,CAAA,CAAA;;4FAG3C,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAZvC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,uBAAuB,CAAC;AACvC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,cAAc;wBAEd,wBAAwB;wBACxB,kBAAkB;AAClB,wBAAA,YAAY,CAAC,QAAQ,CAAC,2BAA2B,EAAE,CAAC;AACrD,qBAAA;AACF,iBAAA;;;ACvBD;;AAEG;;;;"}
|
|
@@ -59,7 +59,7 @@ class FormlyFieldRadio extends FieldType {
|
|
|
59
59
|
{{ option.label }}
|
|
60
60
|
</mat-radio-button>
|
|
61
61
|
</mat-radio-group>
|
|
62
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: i3.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "directive", type: i4
|
|
62
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: i3.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "directive", type: i4.LegacyFormlyAttributes, selector: "[formlyAttributes]" }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i5.LegacyFormlySelectOptionsPipe, name: "formlySelectOptions" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
63
63
|
}
|
|
64
64
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldRadio, decorators: [{
|
|
65
65
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-formly-material-radio.mjs","sources":["../../../../src/ui/material/radio/src/radio.type.ts","../../../../src/ui/material/radio/src/radio.config.ts","../../../../src/ui/material/radio/src/radio.module.ts","../../../../src/ui/material/radio/src/ngx-formly-material-radio.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, ViewChild, AfterViewInit, OnDestroy, Type } from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig, ɵobserve as observe } from '@ngx-formly/core';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\nimport { MatRadioGroup } from '@angular/material/radio';\n\ninterface RadioProps extends FormlyFieldProps {\n labelPosition?: 'before' | 'after';\n}\n\nexport interface FormlyRadioFieldConfig extends FormlyFieldConfig<RadioProps> {\n type: 'radio' | Type<FormlyFieldRadio>;\n}\n\n@Component({\n selector: 'formly-field-mat-radio',\n template: `\n <mat-radio-group\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [required]=\"required\"\n [tabindex]=\"props.tabindex\"\n >\n <mat-radio-button\n *ngFor=\"let option of props.options | formlySelectOptions: field | async; let i = index\"\n [id]=\"id + '_' + i\"\n [color]=\"props.color\"\n [labelPosition]=\"props.labelPosition\"\n [disabled]=\"option.disabled\"\n [value]=\"option.value\"\n >\n {{ option.label }}\n </mat-radio-button>\n </mat-radio-group>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldRadio extends FieldType<FieldTypeConfig<RadioProps>> implements AfterViewInit, OnDestroy {\n @ViewChild(MatRadioGroup, { static: true }) radioGroup!: MatRadioGroup;\n override defaultOptions = {\n props: {\n hideFieldUnderline: true,\n floatLabel: 'always' as const,\n tabindex: -1,\n },\n };\n\n private focusObserver!: ReturnType<typeof observe>;\n ngAfterViewInit() {\n this.focusObserver = observe(this.field, ['focus'], ({ currentValue }) => {\n if (this.props.tabindex === -1 && currentValue && this.radioGroup._radios.length > 0) {\n // https://github.com/ngx-formly/ngx-formly/issues/2498\n setTimeout(() => {\n const radio = this.radioGroup.selected ? this.radioGroup.selected : this.radioGroup._radios.first;\n radio.focus();\n });\n }\n });\n }\n\n // TODO: find a solution to prevent scroll on focus\n override onContainerClick() {}\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n this.focusObserver && this.focusObserver.unsubscribe();\n }\n}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyFieldRadio } from './radio.type';\n\nexport function withFormlyFieldRadio(): ConfigOption {\n return {\n types: [\n {\n name: 'radio',\n component: FormlyFieldRadio,\n wrappers: ['form-field'],\n },\n ],\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { FormlySelectModule } from '@ngx-formly/core/select';\n\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatRadioModule } from '@angular/material/radio';\n\nimport { FormlyFieldRadio } from './radio.type';\nimport { withFormlyFieldRadio } from './radio.config';\n\n@NgModule({\n declarations: [FormlyFieldRadio],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatRadioModule,\n\n FormlyMatFormFieldModule,\n FormlySelectModule,\n FormlyModule.forChild(withFormlyFieldRadio()),\n ],\n})\nexport class FormlyMatRadioModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["observe","i1"],"mappings":";;;;;;;;;;;;;;AAoCM,MAAO,gBAAiB,SAAQ,SAAsC,CAAA;AAvB5E,IAAA,WAAA,GAAA;;AAyBW,QAAA,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,KAAK,EAAE;AACL,gBAAA,kBAAkB,EAAE,IAAI;AACxB,gBAAA,UAAU,EAAE,QAAiB;gBAC7B,QAAQ,EAAE,CAAC,CAAC;AACb,aAAA;SACF;AAsBF;IAnBC,eAAe,GAAA;AACb,QAAA,IAAI,CAAC,aA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../src/ui/material/radio/src/radio.type.ts","../../../../src/ui/material/radio/src/radio.config.ts","../../../../src/ui/material/radio/src/radio.module.ts","../../../../src/ui/material/radio/src/ngx-formly-material-radio.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, ViewChild, AfterViewInit, OnDestroy, Type } from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig, ɵobserve as observe } from '@ngx-formly/core';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\nimport { MatRadioGroup } from '@angular/material/radio';\n\ninterface RadioProps extends FormlyFieldProps {\n labelPosition?: 'before' | 'after';\n}\n\nexport interface FormlyRadioFieldConfig extends FormlyFieldConfig<RadioProps> {\n type: 'radio' | Type<FormlyFieldRadio>;\n}\n\n@Component({\n selector: 'formly-field-mat-radio',\n template: `\n <mat-radio-group\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [required]=\"required\"\n [tabindex]=\"props.tabindex\"\n >\n <mat-radio-button\n *ngFor=\"let option of props.options | formlySelectOptions: field | async; let i = index\"\n [id]=\"id + '_' + i\"\n [color]=\"props.color\"\n [labelPosition]=\"props.labelPosition\"\n [disabled]=\"option.disabled\"\n [value]=\"option.value\"\n >\n {{ option.label }}\n </mat-radio-button>\n </mat-radio-group>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldRadio extends FieldType<FieldTypeConfig<RadioProps>> implements AfterViewInit, OnDestroy {\n @ViewChild(MatRadioGroup, { static: true }) radioGroup!: MatRadioGroup;\n override defaultOptions = {\n props: {\n hideFieldUnderline: true,\n floatLabel: 'always' as const,\n tabindex: -1,\n },\n };\n\n private focusObserver!: ReturnType<typeof observe>;\n ngAfterViewInit() {\n this.focusObserver = observe(this.field, ['focus'], ({ currentValue }) => {\n if (this.props.tabindex === -1 && currentValue && this.radioGroup._radios.length > 0) {\n // https://github.com/ngx-formly/ngx-formly/issues/2498\n setTimeout(() => {\n const radio = this.radioGroup.selected ? this.radioGroup.selected : this.radioGroup._radios.first;\n radio.focus();\n });\n }\n });\n }\n\n // TODO: find a solution to prevent scroll on focus\n override onContainerClick() {}\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n this.focusObserver && this.focusObserver.unsubscribe();\n }\n}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyFieldRadio } from './radio.type';\n\nexport function withFormlyFieldRadio(): ConfigOption {\n return {\n types: [\n {\n name: 'radio',\n component: FormlyFieldRadio,\n wrappers: ['form-field'],\n },\n ],\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { FormlySelectModule } from '@ngx-formly/core/select';\n\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatRadioModule } from '@angular/material/radio';\n\nimport { FormlyFieldRadio } from './radio.type';\nimport { withFormlyFieldRadio } from './radio.config';\n\n@NgModule({\n declarations: [FormlyFieldRadio],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatRadioModule,\n\n FormlyMatFormFieldModule,\n FormlySelectModule,\n FormlyModule.forChild(withFormlyFieldRadio()),\n ],\n})\nexport class FormlyMatRadioModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["observe","i1"],"mappings":";;;;;;;;;;;;;;AAoCM,MAAO,gBAAiB,SAAQ,SAAsC,CAAA;AAvB5E,IAAA,WAAA,GAAA;;AAyBW,QAAA,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,KAAK,EAAE;AACL,gBAAA,kBAAkB,EAAE,IAAI;AACxB,gBAAA,UAAU,EAAE,QAAiB;gBAC7B,QAAQ,EAAE,CAAC,CAAC;AACb,aAAA;SACF;AAsBF;IAnBC,eAAe,GAAA;AACb,QAAA,IAAI,CAAC,aAAa,GAAGA,QAAO,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,YAAY,EA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ACnB,cAAc;YAEd,wBAAwB;YACxB,kBAAkB;AAClB,YAAA,YAAY,CAAC,QAAQ,CAAC,oBAAoB,EAAE,CAAC,CAAA,EAAA,CAAA,CAAA;;4FAGpC,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAZhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,gBAAgB,CAAC;AAChC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,cAAc;wBAEd,wBAAwB;wBACxB,kBAAkB;AAClB,wBAAA,YAAY,CAAC,QAAQ,CAAC,oBAAoB,EAAE,CAAC;AAC9C,qBAAA;AACF,iBAAA;;;ACvBD;;AAEG;;;;"}
|
|
@@ -110,7 +110,7 @@ class FormlyFieldSelect extends FieldType {
|
|
|
110
110
|
</ng-container>
|
|
111
111
|
</ng-container>
|
|
112
112
|
</mat-select>
|
|
113
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i3.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i4.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i4.MatOptgroup, selector: "mat-optgroup", inputs: ["label", "disabled"], exportAs: ["matOptgroup"] }, { kind: "component", type: i4.MatPseudoCheckbox, selector: "mat-pseudo-checkbox", inputs: ["state", "disabled", "appearance"] }, { kind: "directive", type: i5
|
|
113
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i3.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i4.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i4.MatOptgroup, selector: "mat-optgroup", inputs: ["label", "disabled"], exportAs: ["matOptgroup"] }, { kind: "component", type: i4.MatPseudoCheckbox, selector: "mat-pseudo-checkbox", inputs: ["state", "disabled", "appearance"] }, { kind: "directive", type: i5.LegacyFormlyAttributes, selector: "[formlyAttributes]" }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.LegacyFormlySelectOptionsPipe, name: "formlySelectOptions" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
114
114
|
}
|
|
115
115
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldSelect, decorators: [{
|
|
116
116
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-formly-material-select.mjs","sources":["../../../../src/ui/material/select/src/select.type.ts","../../../../src/ui/material/select/src/select.config.ts","../../../../src/ui/material/select/src/select.module.ts","../../../../src/ui/material/select/src/ngx-formly-material-select.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, Type, ViewChild } from '@angular/core';\nimport { MatSelect, MatSelectChange } from '@angular/material/select';\nimport { FieldTypeConfig, FormlyFieldConfig, ɵobserve as observe } from '@ngx-formly/core';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\nimport { FormlyFieldSelectProps } from '@ngx-formly/core/select';\n\ninterface SelectProps extends FormlyFieldProps, FormlyFieldSelectProps {\n multiple?: boolean;\n selectAllOption?: string;\n disableOptionCentering?: boolean;\n typeaheadDebounceInterval?: number;\n compareWith?: (o1: any, o2: any) => boolean;\n panelClass?: string;\n}\n\nexport interface FormlySelectFieldConfig extends FormlyFieldConfig<SelectProps> {\n type: 'select' | Type<FormlyFieldSelect>;\n}\n\n@Component({\n selector: 'formly-field-mat-select',\n template: `\n <ng-template #selectAll let-selectOptions=\"selectOptions\">\n <mat-option (click)=\"toggleSelectAll(selectOptions)\">\n <mat-pseudo-checkbox class=\"mat-option-pseudo-checkbox\" [state]=\"getSelectAllState(selectOptions)\">\n </mat-pseudo-checkbox>\n {{ props.selectAllOption }}\n </mat-option>\n </ng-template>\n\n <mat-select\n [id]=\"id\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [placeholder]=\"props.placeholder\"\n [tabIndex]=\"props.tabindex\"\n [required]=\"required\"\n [compareWith]=\"props.compareWith\"\n [multiple]=\"props.multiple\"\n (selectionChange)=\"change($event)\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [aria-label]=\"_getAriaLabel()\"\n [aria-labelledby]=\"_getAriaLabelledby()\"\n [disableOptionCentering]=\"props.disableOptionCentering\"\n [typeaheadDebounceInterval]=\"props.typeaheadDebounceInterval\"\n [panelClass]=\"props.panelClass\"\n >\n <ng-container *ngIf=\"props.options | formlySelectOptions: field | async as selectOptions\">\n <ng-container\n *ngIf=\"props.multiple && props.selectAllOption\"\n [ngTemplateOutlet]=\"selectAll\"\n [ngTemplateOutletContext]=\"{ selectOptions: selectOptions }\"\n >\n </ng-container>\n <ng-container *ngFor=\"let item of selectOptions\">\n <mat-optgroup *ngIf=\"item.group\" [label]=\"item.label\">\n <mat-option *ngFor=\"let child of item.group\" [value]=\"child.value\" [disabled]=\"child.disabled\">\n {{ child.label }}\n </mat-option>\n </mat-optgroup>\n <mat-option *ngIf=\"!item.group\" [value]=\"item.value\" [disabled]=\"item.disabled\">{{ item.label }}</mat-option>\n </ng-container>\n </ng-container>\n </mat-select>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldSelect extends FieldType<FieldTypeConfig<SelectProps>> {\n @ViewChild(MatSelect, { static: true }) set select(select: any) {\n observe(select, ['_parentFormField', '_textField'], ({ currentValue }) => {\n if (currentValue) {\n select._preferredOverlayOrigin = select._parentFormField.getConnectedOverlayOrigin();\n }\n });\n }\n override defaultOptions = {\n props: {\n compareWith(o1: any, o2: any) {\n return o1 === o2;\n },\n },\n };\n\n private selectAllValue!: { options: any; value: any[] };\n\n getSelectAllState(options: any[]) {\n if (this.empty || this.value.length === 0) {\n return null;\n }\n\n return this.value.length !== this.getSelectAllValue(options).length ? 'indeterminate' : 'checked';\n }\n\n toggleSelectAll(options: any[]) {\n const selectAllValue = this.getSelectAllValue(options);\n this.formControl.markAsDirty();\n this.formControl.setValue(!this.value || this.value.length !== selectAllValue.length ? selectAllValue : []);\n }\n\n change($event: MatSelectChange) {\n this.props.change?.(this.field, $event);\n }\n\n _getAriaLabelledby() {\n if (this.props.attributes?.['aria-labelledby']) {\n return this.props.attributes['aria-labelledby'] as string;\n }\n\n return this.formField?._labelId;\n }\n\n _getAriaLabel() {\n return this.props.attributes?.['aria-label'] as string;\n }\n\n private getSelectAllValue(options: any[]) {\n if (!this.selectAllValue || options !== this.selectAllValue.options) {\n const flatOptions: any[] = [];\n options.forEach((o) => (o.group ? flatOptions.push(...o.group) : flatOptions.push(o)));\n\n this.selectAllValue = {\n options,\n value: flatOptions.filter((o) => !o.disabled).map((o) => o.value),\n };\n }\n\n return this.selectAllValue.value;\n }\n}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyFieldSelect } from './select.type';\n\nexport function withFormlyFieldSelect(): ConfigOption {\n return {\n types: [\n {\n name: 'select',\n component: FormlyFieldSelect,\n wrappers: ['form-field'],\n },\n { name: 'enum', extends: 'select' },\n ],\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { FormlySelectModule } from '@ngx-formly/core/select';\n\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatSelectModule } from '@angular/material/select';\n\nimport { FormlyFieldSelect } from './select.type';\nimport { MatPseudoCheckboxModule } from '@angular/material/core';\nimport { withFormlyFieldSelect } from './select.config';\n\n@NgModule({\n declarations: [FormlyFieldSelect],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatSelectModule,\n MatPseudoCheckboxModule,\n\n FormlyMatFormFieldModule,\n FormlySelectModule,\n FormlyModule.forChild(withFormlyFieldSelect()),\n ],\n})\nexport class FormlyMatSelectModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["observe","i1"],"mappings":";;;;;;;;;;;;;;;;AAmEM,MAAO,iBAAkB,SAAQ,SAAuC,CAAA;AAhD9E,IAAA,WAAA,GAAA;;AAwDW,QAAA,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,KAAK,EAAE;gBACL,WAAW,CAAC,EAAO,EAAE,EAAO,EAAA;oBAC1B,OAAO,EAAE,KAAK,EAAE;iBACjB;AACF,aAAA;SACF;AA+CF;IA5DC,IAA4C,MAAM,CAAC,MAAW,EAAA;AAC5D,QAAAA,QAAO,CAAC,MAAM,EAAE,CAAC,kBAAkB,EAAE,YAAY,CAAC,EAAE,CAAC,EAAE,YAAY,EAAE,KAAI;YACvE,IAAI,YAAY,EAAE;gBAChB,MAAM,CAAC,uBAAuB,GAAG,MAAM,CAAC,gBAAgB,CAAC,yBAAyB,EAAE;;AAExF,SAAC,CAAC;;AAYJ,IAAA,iBAAiB,CAAC,OAAc,EAAA;AAC9B,QAAA,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;AACzC,YAAA,OAAO,IAAI;;QAGb,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,eAAe,GAAG,SAAS;;AAGnG,IAAA,eAAe,CAAC,OAAc,EAAA;QAC5B,MAAM,cAAc,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC;AACtD,QAAA,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE;AAC9B,QAAA,IAAI,CAAC,WAAW,CAA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eAAe;YACf,uBAAuB;YAEvB,wBAAwB;YACxB,kBAAkB,EAAAC,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,CAAA;AAIT,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,YAV9B,YAAY;YACZ,mBAAmB;YACnB,eAAe;YACf,uBAAuB;YAEvB,wBAAwB;YACxB,kBAAkB;AAClB,YAAA,YAAY,CAAC,QAAQ,CAAC,qBAAqB,EAAE,CAAC,CAAA,EAAA,CAAA,CAAA;;4FAGrC,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAbjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,iBAAiB,CAAC;AACjC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,eAAe;wBACf,uBAAuB;wBAEvB,wBAAwB;wBACxB,kBAAkB;AAClB,wBAAA,YAAY,CAAC,QAAQ,CAAC,qBAAqB,EAAE,CAAC;AAC/C,qBAAA;AACF,iBAAA;;;ACzBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-formly-material-select.mjs","sources":["../../../../src/ui/material/select/src/select.type.ts","../../../../src/ui/material/select/src/select.config.ts","../../../../src/ui/material/select/src/select.module.ts","../../../../src/ui/material/select/src/ngx-formly-material-select.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, Type, ViewChild } from '@angular/core';\nimport { MatSelect, MatSelectChange } from '@angular/material/select';\nimport { FieldTypeConfig, FormlyFieldConfig, ɵobserve as observe } from '@ngx-formly/core';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\nimport { FormlyFieldSelectProps } from '@ngx-formly/core/select';\n\ninterface SelectProps extends FormlyFieldProps, FormlyFieldSelectProps {\n multiple?: boolean;\n selectAllOption?: string;\n disableOptionCentering?: boolean;\n typeaheadDebounceInterval?: number;\n compareWith?: (o1: any, o2: any) => boolean;\n panelClass?: string;\n}\n\nexport interface FormlySelectFieldConfig extends FormlyFieldConfig<SelectProps> {\n type: 'select' | Type<FormlyFieldSelect>;\n}\n\n@Component({\n selector: 'formly-field-mat-select',\n template: `\n <ng-template #selectAll let-selectOptions=\"selectOptions\">\n <mat-option (click)=\"toggleSelectAll(selectOptions)\">\n <mat-pseudo-checkbox class=\"mat-option-pseudo-checkbox\" [state]=\"getSelectAllState(selectOptions)\">\n </mat-pseudo-checkbox>\n {{ props.selectAllOption }}\n </mat-option>\n </ng-template>\n\n <mat-select\n [id]=\"id\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [placeholder]=\"props.placeholder\"\n [tabIndex]=\"props.tabindex\"\n [required]=\"required\"\n [compareWith]=\"props.compareWith\"\n [multiple]=\"props.multiple\"\n (selectionChange)=\"change($event)\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [aria-label]=\"_getAriaLabel()\"\n [aria-labelledby]=\"_getAriaLabelledby()\"\n [disableOptionCentering]=\"props.disableOptionCentering\"\n [typeaheadDebounceInterval]=\"props.typeaheadDebounceInterval\"\n [panelClass]=\"props.panelClass\"\n >\n <ng-container *ngIf=\"props.options | formlySelectOptions: field | async as selectOptions\">\n <ng-container\n *ngIf=\"props.multiple && props.selectAllOption\"\n [ngTemplateOutlet]=\"selectAll\"\n [ngTemplateOutletContext]=\"{ selectOptions: selectOptions }\"\n >\n </ng-container>\n <ng-container *ngFor=\"let item of selectOptions\">\n <mat-optgroup *ngIf=\"item.group\" [label]=\"item.label\">\n <mat-option *ngFor=\"let child of item.group\" [value]=\"child.value\" [disabled]=\"child.disabled\">\n {{ child.label }}\n </mat-option>\n </mat-optgroup>\n <mat-option *ngIf=\"!item.group\" [value]=\"item.value\" [disabled]=\"item.disabled\">{{ item.label }}</mat-option>\n </ng-container>\n </ng-container>\n </mat-select>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldSelect extends FieldType<FieldTypeConfig<SelectProps>> {\n @ViewChild(MatSelect, { static: true }) set select(select: any) {\n observe(select, ['_parentFormField', '_textField'], ({ currentValue }) => {\n if (currentValue) {\n select._preferredOverlayOrigin = select._parentFormField.getConnectedOverlayOrigin();\n }\n });\n }\n override defaultOptions = {\n props: {\n compareWith(o1: any, o2: any) {\n return o1 === o2;\n },\n },\n };\n\n private selectAllValue!: { options: any; value: any[] };\n\n getSelectAllState(options: any[]) {\n if (this.empty || this.value.length === 0) {\n return null;\n }\n\n return this.value.length !== this.getSelectAllValue(options).length ? 'indeterminate' : 'checked';\n }\n\n toggleSelectAll(options: any[]) {\n const selectAllValue = this.getSelectAllValue(options);\n this.formControl.markAsDirty();\n this.formControl.setValue(!this.value || this.value.length !== selectAllValue.length ? selectAllValue : []);\n }\n\n change($event: MatSelectChange) {\n this.props.change?.(this.field, $event);\n }\n\n _getAriaLabelledby() {\n if (this.props.attributes?.['aria-labelledby']) {\n return this.props.attributes['aria-labelledby'] as string;\n }\n\n return this.formField?._labelId;\n }\n\n _getAriaLabel() {\n return this.props.attributes?.['aria-label'] as string;\n }\n\n private getSelectAllValue(options: any[]) {\n if (!this.selectAllValue || options !== this.selectAllValue.options) {\n const flatOptions: any[] = [];\n options.forEach((o) => (o.group ? flatOptions.push(...o.group) : flatOptions.push(o)));\n\n this.selectAllValue = {\n options,\n value: flatOptions.filter((o) => !o.disabled).map((o) => o.value),\n };\n }\n\n return this.selectAllValue.value;\n }\n}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyFieldSelect } from './select.type';\n\nexport function withFormlyFieldSelect(): ConfigOption {\n return {\n types: [\n {\n name: 'select',\n component: FormlyFieldSelect,\n wrappers: ['form-field'],\n },\n { name: 'enum', extends: 'select' },\n ],\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { FormlySelectModule } from '@ngx-formly/core/select';\n\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatSelectModule } from '@angular/material/select';\n\nimport { FormlyFieldSelect } from './select.type';\nimport { MatPseudoCheckboxModule } from '@angular/material/core';\nimport { withFormlyFieldSelect } from './select.config';\n\n@NgModule({\n declarations: [FormlyFieldSelect],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatSelectModule,\n MatPseudoCheckboxModule,\n\n FormlyMatFormFieldModule,\n FormlySelectModule,\n FormlyModule.forChild(withFormlyFieldSelect()),\n ],\n})\nexport class FormlyMatSelectModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["observe","i1"],"mappings":";;;;;;;;;;;;;;;;AAmEM,MAAO,iBAAkB,SAAQ,SAAuC,CAAA;AAhD9E,IAAA,WAAA,GAAA;;AAwDW,QAAA,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,KAAK,EAAE;gBACL,WAAW,CAAC,EAAO,EAAE,EAAO,EAAA;oBAC1B,OAAO,EAAE,KAAK,EAAE;iBACjB;AACF,aAAA;SACF;AA+CF;IA5DC,IAA4C,MAAM,CAAC,MAAW,EAAA;AAC5D,QAAAA,QAAO,CAAC,MAAM,EAAE,CAAC,kBAAkB,EAAE,YAAY,CAAC,EAAE,CAAC,EAAE,YAAY,EAAE,KAAI;YACvE,IAAI,YAAY,EAAE;gBAChB,MAAM,CAAC,uBAAuB,GAAG,MAAM,CAAC,gBAAgB,CAAC,yBAAyB,EAAE;;AAExF,SAAC,CAAC;;AAYJ,IAAA,iBAAiB,CAAC,OAAc,EAAA;AAC9B,QAAA,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;AACzC,YAAA,OAAO,IAAI;;QAGb,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC,iBAAiB,CAAC,OAA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,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;gHAArB,qBAAqB,EAAA,YAAA,EAAA,CAZjB,iBAAiB,CAAA,EAAA,OAAA,EAAA,CAE9B,YAAY;YACZ,mBAAmB;YACnB,eAAe;YACf,uBAAuB;YAEvB,wBAAwB;YACxB,kBAAkB,EAAAC,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,CAAA;AAIT,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,YAV9B,YAAY;YACZ,mBAAmB;YACnB,eAAe;YACf,uBAAuB;YAEvB,wBAAwB;YACxB,kBAAkB;AAClB,YAAA,YAAY,CAAC,QAAQ,CAAC,qBAAqB,EAAE,CAAC,CAAA,EAAA,CAAA,CAAA;;4FAGrC,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAbjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,iBAAiB,CAAC;AACjC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,eAAe;wBACf,uBAAuB;wBAEvB,wBAAwB;wBACxB,kBAAkB;AAClB,wBAAA,YAAY,CAAC,QAAQ,CAAC,qBAAqB,EAAE,CAAC;AAC/C,qBAAA;AACF,iBAAA;;;ACzBD;;AAEG;;;;"}
|
|
@@ -41,7 +41,7 @@ class FormlyFieldSlider extends FieldType {
|
|
|
41
41
|
>
|
|
42
42
|
<input matSliderThumb [formControl]="formControl" [formlyAttributes]="field" />
|
|
43
43
|
</mat-slider>
|
|
44
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i2.MatSlider, selector: "mat-slider", inputs: ["disabled", "discrete", "showTickMarks", "min", "color", "disableRipple", "max", "step", "displayWith"], exportAs: ["matSlider"] }, { kind: "directive", type: i2.MatSliderThumb, selector: "input[matSliderThumb]", inputs: ["value"], outputs: ["valueChange", "dragStart", "dragEnd"], exportAs: ["matSliderThumb"] }, { kind: "directive", type: i3
|
|
44
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i2.MatSlider, selector: "mat-slider", inputs: ["disabled", "discrete", "showTickMarks", "min", "color", "disableRipple", "max", "step", "displayWith"], exportAs: ["matSlider"] }, { kind: "directive", type: i2.MatSliderThumb, selector: "input[matSliderThumb]", inputs: ["value"], outputs: ["valueChange", "dragStart", "dragEnd"], exportAs: ["matSliderThumb"] }, { kind: "directive", type: i3.LegacyFormlyAttributes, selector: "[formlyAttributes]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
45
45
|
}
|
|
46
46
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldSlider, decorators: [{
|
|
47
47
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-formly-material-slider.mjs","sources":["../../../../src/ui/material/slider/src/slider.type.ts","../../../../src/ui/material/slider/src/slider.config.ts","../../../../src/ui/material/slider/src/slider.module.ts","../../../../src/ui/material/slider/src/ngx-formly-material-slider.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, Type } from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\n\ninterface SliderProps extends FormlyFieldProps {\n displayWith?: (value: number) => string;\n discrete?: boolean;\n showTickMarks?: boolean;\n\n input?: (field: FormlyFieldConfig<SliderProps>, $event: Event) => void;\n change?: (field: FormlyFieldConfig<SliderProps>, $event: Event) => void;\n}\n\nexport interface FormlySliderFieldConfig extends FormlyFieldConfig<SliderProps> {\n type: 'slider' | Type<FormlyFieldSlider>;\n}\n\n@Component({\n selector: 'formly-field-mat-slider',\n template: `\n <mat-slider\n [id]=\"id\"\n [style.width]=\"'100%'\"\n [formlyAttributes]=\"field\"\n [tabIndex]=\"props.tabindex\"\n [color]=\"props.color\"\n [displayWith]=\"props.displayWith\"\n [max]=\"props.max\"\n [min]=\"props.min\"\n [step]=\"props.step\"\n [discrete]=\"props.discrete\"\n [showTickMarks]=\"props.showTickMarks\"\n [step]=\"props.step\"\n (input)=\"props.input && props.input(field, $event)\"\n (change)=\"props.change && props.change(field, $event)\"\n >\n <input matSliderThumb [formControl]=\"formControl\" [formlyAttributes]=\"field\" />\n </mat-slider>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldSlider extends FieldType<FieldTypeConfig<SliderProps>> {\n override defaultOptions = {\n props: {\n hideFieldUnderline: true,\n floatLabel: 'always' as const,\n displayWith: (value: number) => `${value}`,\n },\n };\n}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyFieldSlider } from './slider.type';\n\nexport function withFormlyFieldSlider(): ConfigOption {\n return {\n types: [\n {\n name: 'slider',\n component: FormlyFieldSlider,\n wrappers: ['form-field'],\n },\n ],\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatSliderModule } from '@angular/material/slider';\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatCommonModule, MatRippleModule } from '@angular/material/core';\nimport { FormlyFieldSlider } from './slider.type';\nimport { withFormlyFieldSlider } from './slider.config';\n\n@NgModule({\n declarations: [FormlyFieldSlider],\n imports: [\n CommonModule,\n MatCommonModule,\n MatRippleModule,\n ReactiveFormsModule,\n MatSliderModule,\n FormlyMatFormFieldModule,\n FormlyModule.forChild(withFormlyFieldSlider()),\n ],\n})\nexport class FormlyMatSliderModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;AAyCM,MAAO,iBAAkB,SAAQ,SAAuC,CAAA;AAxB9E,IAAA,WAAA,GAAA;;AAyBW,QAAA,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,KAAK,EAAE;AACL,gBAAA,kBAAkB,EAAE,IAAI;AACxB,gBAAA,UAAU,EAAE,QAAiB;gBAC7B,WAAW,EAAE,CAAC,KAAa,KAAK,CAAA,EAAG,KAAK,CAAE,CAAA;AAC3C,aAAA;SACF;AACF;+GARY,iBAAiB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAjB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,iBAAiB,EAtBlB,QAAA,EAAA,yBAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;AAmBT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,oBAAA,EAAA,QAAA,EAAA,8MAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,2CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,oBAAA,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,aAAA,EAAA,UAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,UAAA,EAAA,eAAA,EAAA,KAAA,EAAA,OAAA,EAAA,eAAA,EAAA,KAAA,EAAA,MAAA,EAAA,aAAA,CAAA,EAAA,QAAA,EAAA,CAAA,WAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,cAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,MAAA,EAAA,CAAA,OAAA,CAAA,EAAA,OAAA,EAAA,CAAA,aAAA,EAAA,WAAA,EAAA,SAAA,CAAA,EAAA,QAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"ngx-formly-material-slider.mjs","sources":["../../../../src/ui/material/slider/src/slider.type.ts","../../../../src/ui/material/slider/src/slider.config.ts","../../../../src/ui/material/slider/src/slider.module.ts","../../../../src/ui/material/slider/src/ngx-formly-material-slider.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, Type } from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\n\ninterface SliderProps extends FormlyFieldProps {\n displayWith?: (value: number) => string;\n discrete?: boolean;\n showTickMarks?: boolean;\n\n input?: (field: FormlyFieldConfig<SliderProps>, $event: Event) => void;\n change?: (field: FormlyFieldConfig<SliderProps>, $event: Event) => void;\n}\n\nexport interface FormlySliderFieldConfig extends FormlyFieldConfig<SliderProps> {\n type: 'slider' | Type<FormlyFieldSlider>;\n}\n\n@Component({\n selector: 'formly-field-mat-slider',\n template: `\n <mat-slider\n [id]=\"id\"\n [style.width]=\"'100%'\"\n [formlyAttributes]=\"field\"\n [tabIndex]=\"props.tabindex\"\n [color]=\"props.color\"\n [displayWith]=\"props.displayWith\"\n [max]=\"props.max\"\n [min]=\"props.min\"\n [step]=\"props.step\"\n [discrete]=\"props.discrete\"\n [showTickMarks]=\"props.showTickMarks\"\n [step]=\"props.step\"\n (input)=\"props.input && props.input(field, $event)\"\n (change)=\"props.change && props.change(field, $event)\"\n >\n <input matSliderThumb [formControl]=\"formControl\" [formlyAttributes]=\"field\" />\n </mat-slider>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldSlider extends FieldType<FieldTypeConfig<SliderProps>> {\n override defaultOptions = {\n props: {\n hideFieldUnderline: true,\n floatLabel: 'always' as const,\n displayWith: (value: number) => `${value}`,\n },\n };\n}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyFieldSlider } from './slider.type';\n\nexport function withFormlyFieldSlider(): ConfigOption {\n return {\n types: [\n {\n name: 'slider',\n component: FormlyFieldSlider,\n wrappers: ['form-field'],\n },\n ],\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatSliderModule } from '@angular/material/slider';\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatCommonModule, MatRippleModule } from '@angular/material/core';\nimport { FormlyFieldSlider } from './slider.type';\nimport { withFormlyFieldSlider } from './slider.config';\n\n@NgModule({\n declarations: [FormlyFieldSlider],\n imports: [\n CommonModule,\n MatCommonModule,\n MatRippleModule,\n ReactiveFormsModule,\n MatSliderModule,\n FormlyMatFormFieldModule,\n FormlyModule.forChild(withFormlyFieldSlider()),\n ],\n})\nexport class FormlyMatSliderModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;AAyCM,MAAO,iBAAkB,SAAQ,SAAuC,CAAA;AAxB9E,IAAA,WAAA,GAAA;;AAyBW,QAAA,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,KAAK,EAAE;AACL,gBAAA,kBAAkB,EAAE,IAAI;AACxB,gBAAA,UAAU,EAAE,QAAiB;gBAC7B,WAAW,EAAE,CAAC,KAAa,KAAK,CAAA,EAAG,KAAK,CAAE,CAAA;AAC3C,aAAA;SACF;AACF;+GARY,iBAAiB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAjB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,iBAAiB,EAtBlB,QAAA,EAAA,yBAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;AAmBT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,oBAAA,EAAA,QAAA,EAAA,8MAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,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ows]="props.autosizeMaxRows"
|
|
45
45
|
[class.cdk-textarea-autosize]="props.autosize"
|
|
46
46
|
></textarea>
|
|
47
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i3.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "directive", type: i4
|
|
47
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i3.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "directive", type: i4.LegacyFormlyAttributes, selector: "[formlyAttributes]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
48
48
|
}
|
|
49
49
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldTextArea, decorators: [{
|
|
50
50
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-formly-material-textarea.mjs","sources":["../../../../src/ui/material/textarea/src/textarea.type.ts","../../../../src/ui/material/textarea/src/textarea.config.ts","../../../../src/ui/material/textarea/src/textarea.module.ts","../../../../src/ui/material/textarea/src/ngx-formly-material-textarea.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, Type } from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\nimport { MAT_INPUT_VALUE_ACCESSOR } from '@angular/material/input';\n\ninterface TextAreaProps extends FormlyFieldProps {\n autosize?: boolean;\n autosizeMinRows?: number;\n autosizeMaxRows?: number;\n}\n\nexport interface FormlyTextAreaFieldConfig extends FormlyFieldConfig<TextAreaProps> {\n type: 'textarea' | Type<FormlyFieldTextArea>;\n}\n\n@Component({\n selector: 'formly-field-mat-textarea',\n template: `\n <textarea\n matInput\n [id]=\"id\"\n [name]=\"field.name\"\n [readonly]=\"props.readonly\"\n [required]=\"required\"\n [formControl]=\"formControl\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [cols]=\"props.cols\"\n [rows]=\"props.rows\"\n [formlyAttributes]=\"field\"\n [placeholder]=\"props.placeholder\"\n [tabindex]=\"props.tabindex\"\n [cdkTextareaAutosize]=\"props.autosize\"\n [cdkAutosizeMinRows]=\"props.autosizeMinRows\"\n [cdkAutosizeMaxRows]=\"props.autosizeMaxRows\"\n [class.cdk-textarea-autosize]=\"props.autosize\"\n ></textarea>\n `,\n providers: [\n // fix for https://github.com/ngx-formly/ngx-formly/issues/1688\n // rely on formControl value instead of elementRef which return empty value in Firefox.\n { provide: MAT_INPUT_VALUE_ACCESSOR, useExisting: FormlyFieldTextArea },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldTextArea extends FieldType<FieldTypeConfig<TextAreaProps>> {\n override defaultOptions = {\n props: {\n cols: 1,\n rows: 1,\n },\n };\n}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyFieldTextArea } from './textarea.type';\n\nexport function withFormlyFieldTextArea(): ConfigOption {\n return {\n types: [\n {\n name: 'textarea',\n component: FormlyFieldTextArea,\n wrappers: ['form-field'],\n },\n ],\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\n\nimport { FormlyFieldTextArea } from './textarea.type';\nimport { withFormlyFieldTextArea } from './textarea.config';\n\n@NgModule({\n declarations: [FormlyFieldTextArea],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatInputModule,\n\n FormlyMatFormFieldModule,\n FormlyModule.forChild(withFormlyFieldTextArea()),\n ],\n})\nexport class FormlyMatTextAreaModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;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EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,QAAA,EAAA,QAAA,EAAA,yHAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,IAAA,EAAA,aAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,mBAAA,EAAA,kBAAA,EAAA,OAAA,EAAA,UAAA,CAAA,EAAA,QAAA,EAAA,CAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,mBAAA,EAAA,QAAA,EAAA,+BAAA,EAAA,MAAA,EAAA,CAAA,oBAAA,EAAA,oBAAA,EAAA,qBAAA,EAAA,aAAA,CAAA,EAAA,QAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"ngx-formly-material-textarea.mjs","sources":["../../../../src/ui/material/textarea/src/textarea.type.ts","../../../../src/ui/material/textarea/src/textarea.config.ts","../../../../src/ui/material/textarea/src/textarea.module.ts","../../../../src/ui/material/textarea/src/ngx-formly-material-textarea.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, Type } from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\nimport { MAT_INPUT_VALUE_ACCESSOR } from '@angular/material/input';\n\ninterface TextAreaProps extends FormlyFieldProps {\n autosize?: boolean;\n autosizeMinRows?: number;\n autosizeMaxRows?: number;\n}\n\nexport interface FormlyTextAreaFieldConfig extends FormlyFieldConfig<TextAreaProps> {\n type: 'textarea' | Type<FormlyFieldTextArea>;\n}\n\n@Component({\n selector: 'formly-field-mat-textarea',\n template: `\n <textarea\n matInput\n [id]=\"id\"\n [name]=\"field.name\"\n [readonly]=\"props.readonly\"\n [required]=\"required\"\n [formControl]=\"formControl\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [cols]=\"props.cols\"\n [rows]=\"props.rows\"\n [formlyAttributes]=\"field\"\n [placeholder]=\"props.placeholder\"\n [tabindex]=\"props.tabindex\"\n [cdkTextareaAutosize]=\"props.autosize\"\n [cdkAutosizeMinRows]=\"props.autosizeMinRows\"\n [cdkAutosizeMaxRows]=\"props.autosizeMaxRows\"\n [class.cdk-textarea-autosize]=\"props.autosize\"\n ></textarea>\n `,\n providers: [\n // fix for https://github.com/ngx-formly/ngx-formly/issues/1688\n // rely on formControl value instead of elementRef which return empty value in Firefox.\n { provide: MAT_INPUT_VALUE_ACCESSOR, useExisting: FormlyFieldTextArea },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldTextArea extends FieldType<FieldTypeConfig<TextAreaProps>> {\n override defaultOptions = {\n props: {\n cols: 1,\n rows: 1,\n },\n };\n}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyFieldTextArea } from './textarea.type';\n\nexport function withFormlyFieldTextArea(): ConfigOption {\n return {\n types: [\n {\n name: 'textarea',\n component: FormlyFieldTextArea,\n wrappers: ['form-field'],\n },\n ],\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\n\nimport { FormlyFieldTextArea } from './textarea.type';\nimport { withFormlyFieldTextArea } from './textarea.config';\n\n@NgModule({\n declarations: [FormlyFieldTextArea],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatInputModule,\n\n FormlyMatFormFieldModule,\n FormlyModule.forChild(withFormlyFieldTextArea()),\n ],\n})\nexport class FormlyMatTextAreaModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public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AAE,mBAAmB;gBAC9B,QAAQ,EAAE,CAAC,YAAY,CAAC;AACzB,aAAA;AACF,SAAA;KACF;AACH;;MCSa,uBAAuB,CAAA;+GAAvB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;gHAAvB,uBAAuB,EAAA,YAAA,EAAA,CAVnB,mBAAmB,CAAA,EAAA,OAAA,EAAA,CAEhC,YAAY;YACZ,mBAAmB;YACnB,cAAc;YAEd,wBAAwB,EAAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,CAAA;AAIf,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,YARhC,YAAY;YACZ,mBAAmB;YACnB,cAAc;YAEd,wBAAwB;AACxB,YAAA,YAAY,CAAC,QAAQ,CAAC,uBAAuB,EAAE,CAAC,CAAA,EAAA,CAAA,CAAA;;4FAGvC,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAXnC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,mBAAmB,CAAC;AACnC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,cAAc;wBAEd,wBAAwB;AACxB,wBAAA,YAAY,CAAC,QAAQ,CAAC,uBAAuB,EAAE,CAAC;AACjD,qBAAA;AACF,iBAAA;;;ACrBD;;AAEG;;;;"}
|
|
@@ -38,7 +38,7 @@ class FormlyFieldToggle extends FieldType {
|
|
|
38
38
|
>
|
|
39
39
|
{{ props.label }}
|
|
40
40
|
</mat-slide-toggle>
|
|
41
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i2.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "directive", type: i3
|
|
41
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i2.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "directive", type: i3.LegacyFormlyAttributes, selector: "[formlyAttributes]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
42
42
|
}
|
|
43
43
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldToggle, decorators: [{
|
|
44
44
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-formly-material-toggle.mjs","sources":["../../../../src/ui/material/toggle/src/toggle.type.ts","../../../../src/ui/material/toggle/src/toggle.config.ts","../../../../src/ui/material/toggle/src/toggle.module.ts","../../../../src/ui/material/toggle/src/ngx-formly-material-toggle.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, ViewChild, Type } from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\nimport { MatSlideToggle } from '@angular/material/slide-toggle';\n\ninterface ToggleProps extends FormlyFieldProps {\n labelPosition?: 'before' | 'after';\n}\n\nexport interface FormlyToggleFieldConfig extends FormlyFieldConfig<ToggleProps> {\n type: 'toggle' | Type<FormlyFieldToggle>;\n}\n\n@Component({\n selector: 'formly-field-mat-toggle',\n template: `\n <mat-slide-toggle\n [id]=\"id\"\n [name]=\"field.name\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [color]=\"props.color\"\n [tabIndex]=\"props.tabindex\"\n [required]=\"required\"\n [labelPosition]=\"props.labelPosition\"\n >\n {{ props.label }}\n </mat-slide-toggle>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldToggle extends FieldType<FieldTypeConfig<ToggleProps>> {\n @ViewChild(MatSlideToggle, { static: true }) slideToggle!: MatSlideToggle;\n override defaultOptions = {\n props: {\n hideFieldUnderline: true,\n floatLabel: 'always' as const,\n hideLabel: true,\n },\n };\n\n override onContainerClick(event: MouseEvent): void {\n this.slideToggle.focus();\n super.onContainerClick(event);\n }\n}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyFieldToggle } from './toggle.type';\n\nexport function withFormlyFieldToggle(): ConfigOption {\n return {\n types: [\n {\n name: 'toggle',\n component: FormlyFieldToggle,\n wrappers: ['form-field'],\n },\n ],\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\n\nimport { FormlyFieldToggle } from './toggle.type';\nimport { withFormlyFieldToggle } from './toggle.config';\n\n@NgModule({\n declarations: [FormlyFieldToggle],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatSlideToggleModule,\n FormlyMatFormFieldModule,\n FormlyModule.forChild(withFormlyFieldToggle()),\n ],\n})\nexport class FormlyMatToggleModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;AA+BM,MAAO,iBAAkB,SAAQ,SAAuC,CAAA;AAlB9E,IAAA,WAAA,GAAA;;AAoBW,QAAA,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,KAAK,EAAE;AACL,gBAAA,kBAAkB,EAAE,IAAI;AACxB,gBAAA,UAAU,EAAE,QAAiB;AAC7B,gBAAA,SAAS,EAAE,IAAI;AAChB,aAAA;SACF;AAMF;AAJU,IAAA,gBAAgB,CAAC,KAAiB,EAAA;AACzC,QAAA,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE;AACxB,QAAA,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC;;+GAZpB,iBAAiB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAjB,iBAAiB,EAAA,QAAA,EAAA,yBAAA,EAAA,WAAA,EAAA,CAAA,EAAA,YAAA,EAAA,aAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EACjB,cAAc,EAjBf,WAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,CAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA;;;;;;;;;;;;;AAaT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,2CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,iBAAA,EAAA,QAAA,EAAA,wIAAA,EAAA,MAAA,EAAA,CAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,oBAAA,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,aAAA,EAAA,UAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,cAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,eAAA,EAAA,YAAA,EAAA,iBAAA,EAAA,kBAAA,EAAA,UAAA,EAAA,OAAA,EAAA,UAAA,EAAA,eAAA,EAAA,UAAA,EAAA,SAAA,EAAA,UAAA,EAAA,qBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,QAAA,EAAA,cAAA,CAAA,EAAA,QAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"ngx-formly-material-toggle.mjs","sources":["../../../../src/ui/material/toggle/src/toggle.type.ts","../../../../src/ui/material/toggle/src/toggle.config.ts","../../../../src/ui/material/toggle/src/toggle.module.ts","../../../../src/ui/material/toggle/src/ngx-formly-material-toggle.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, ViewChild, Type } from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\nimport { MatSlideToggle } from '@angular/material/slide-toggle';\n\ninterface ToggleProps extends FormlyFieldProps {\n labelPosition?: 'before' | 'after';\n}\n\nexport interface FormlyToggleFieldConfig extends FormlyFieldConfig<ToggleProps> {\n type: 'toggle' | Type<FormlyFieldToggle>;\n}\n\n@Component({\n selector: 'formly-field-mat-toggle',\n template: `\n <mat-slide-toggle\n [id]=\"id\"\n [name]=\"field.name\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [color]=\"props.color\"\n [tabIndex]=\"props.tabindex\"\n [required]=\"required\"\n [labelPosition]=\"props.labelPosition\"\n >\n {{ props.label }}\n </mat-slide-toggle>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldToggle extends FieldType<FieldTypeConfig<ToggleProps>> {\n @ViewChild(MatSlideToggle, { static: true }) slideToggle!: MatSlideToggle;\n override defaultOptions = {\n props: {\n hideFieldUnderline: true,\n floatLabel: 'always' as const,\n hideLabel: true,\n },\n };\n\n override onContainerClick(event: MouseEvent): void {\n this.slideToggle.focus();\n super.onContainerClick(event);\n }\n}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyFieldToggle } from './toggle.type';\n\nexport function withFormlyFieldToggle(): ConfigOption {\n return {\n types: [\n {\n name: 'toggle',\n component: FormlyFieldToggle,\n wrappers: ['form-field'],\n },\n ],\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\n\nimport { FormlyFieldToggle } from './toggle.type';\nimport { withFormlyFieldToggle } from './toggle.config';\n\n@NgModule({\n declarations: [FormlyFieldToggle],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatSlideToggleModule,\n FormlyMatFormFieldModule,\n FormlyModule.forChild(withFormlyFieldToggle()),\n ],\n})\nexport class FormlyMatToggleModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;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,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;gHAArB,qBAAqB,EAAA,YAAA,EAAA,CATjB,iBAAiB,CAAA,EAAA,OAAA,EAAA,CAE9B,YAAY;YACZ,mBAAmB;YACnB,oBAAoB;YACpB,wBAAwB,EAAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,CAAA;AAIf,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,YAP9B,YAAY;YACZ,mBAAmB;YACnB,oBAAoB;YACpB,wBAAwB;AACxB,YAAA,YAAY,CAAC,QAAQ,CAAC,qBAAqB,EAAE,CAAC,CAAA,EAAA,CAAA,CAAA;;4FAGrC,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAVjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,iBAAiB,CAAC;AACjC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,oBAAoB;wBACpB,wBAAwB;AACxB,wBAAA,YAAY,CAAC,QAAQ,CAAC,qBAAqB,EAAE,CAAC;AAC/C,qBAAA;AACF,iBAAA;;;ACnBD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngx-formly/material",
|
|
3
|
-
"version": "7.0.0-
|
|
3
|
+
"version": "7.0.0-next.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"tslib": "^2.0.0"
|
|
7
7
|
},
|
|
8
8
|
"peerDependencies": {
|
|
9
|
-
"@ngx-formly/core": "7.0.0-
|
|
9
|
+
"@ngx-formly/core": "7.0.0-next.0",
|
|
10
10
|
"@angular/material": ">=16.0.0"
|
|
11
11
|
},
|
|
12
12
|
"module": "fesm2022/ngx-formly-material.mjs",
|