@ngx-formly/material 6.3.12 → 7.0.0-alpha.1
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 +1 -0
- package/checkbox/checkbox.config.d.ts +2 -0
- package/checkbox/checkbox.type.d.ts +1 -1
- package/checkbox/public_api.d.ts +1 -0
- package/datepicker/datepicker.config.d.ts +2 -0
- package/datepicker/datepicker.type.d.ts +1 -1
- package/datepicker/public_api.d.ts +1 -0
- package/esm2022/checkbox/checkbox.config.mjs +17 -0
- package/esm2022/checkbox/checkbox.module.mjs +36 -0
- package/esm2022/checkbox/checkbox.type.mjs +113 -0
- package/esm2022/checkbox/public_api.mjs +4 -0
- package/esm2022/datepicker/datepicker.config.mjs +13 -0
- package/esm2022/datepicker/datepicker.module.mjs +40 -0
- package/esm2022/datepicker/datepicker.type.mjs +153 -0
- package/esm2022/datepicker/public_api.mjs +4 -0
- package/esm2022/form-field/field.type.mjs +142 -0
- package/esm2022/form-field/form-field.config.mjs +12 -0
- package/esm2022/form-field/form-field.module.mjs +23 -0
- package/esm2022/form-field/form-field.wrapper.mjs +159 -0
- package/esm2022/form-field/public_api.mjs +4 -0
- package/esm2022/input/input.config.mjs +32 -0
- package/esm2022/input/input.module.mjs +36 -0
- package/{esm2020 → esm2022}/input/input.type.mjs +8 -8
- package/esm2022/input/public_api.mjs +4 -0
- package/esm2022/lib/material.config.mjs +19 -0
- package/esm2022/lib/ui-material.mjs +4 -0
- package/esm2022/lib/ui-material.module.mjs +41 -0
- package/esm2022/multicheckbox/multicheckbox.config.mjs +13 -0
- package/esm2022/multicheckbox/multicheckbox.module.mjs +40 -0
- package/esm2022/multicheckbox/multicheckbox.type.mjs +85 -0
- package/esm2022/multicheckbox/public_api.mjs +4 -0
- package/esm2022/native-select/native-select.config.mjs +13 -0
- package/esm2022/native-select/native-select.module.mjs +40 -0
- package/{esm2020 → esm2022}/native-select/native-select.type.mjs +11 -11
- package/esm2022/native-select/public_api.mjs +4 -0
- package/esm2022/radio/public_api.mjs +4 -0
- package/esm2022/radio/radio.config.mjs +13 -0
- package/esm2022/radio/radio.module.mjs +40 -0
- package/esm2022/radio/radio.type.mjs +89 -0
- package/esm2022/select/public_api.mjs +4 -0
- package/esm2022/select/select.config.mjs +14 -0
- package/esm2022/select/select.module.mjs +44 -0
- package/esm2022/select/select.type.mjs +164 -0
- package/esm2022/slider/public_api.mjs +4 -0
- package/esm2022/slider/slider.config.mjs +13 -0
- package/esm2022/slider/slider.module.mjs +43 -0
- package/esm2022/slider/slider.type.mjs +67 -0
- package/esm2022/textarea/public_api.mjs +4 -0
- package/esm2022/textarea/textarea.config.mjs +13 -0
- package/esm2022/textarea/textarea.module.mjs +36 -0
- package/{esm2020 → esm2022}/textarea/textarea.type.mjs +12 -12
- package/esm2022/toggle/public_api.mjs +4 -0
- package/esm2022/toggle/toggle.config.mjs +13 -0
- package/esm2022/toggle/toggle.module.mjs +36 -0
- package/{esm2020 → esm2022}/toggle/toggle.type.mjs +8 -8
- package/{fesm2015 → fesm2022}/ngx-formly-material-checkbox.mjs +41 -51
- package/fesm2022/ngx-formly-material-checkbox.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/ngx-formly-material-datepicker.mjs +38 -44
- package/fesm2022/ngx-formly-material-datepicker.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/ngx-formly-material-form-field.mjs +35 -50
- package/fesm2022/ngx-formly-material-form-field.mjs.map +1 -0
- package/fesm2022/ngx-formly-material-input.mjs +151 -0
- package/fesm2022/ngx-formly-material-input.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/ngx-formly-material-multicheckbox.mjs +37 -43
- package/fesm2022/ngx-formly-material-multicheckbox.mjs.map +1 -0
- package/fesm2022/ngx-formly-material-native-select.mjs +128 -0
- package/fesm2022/ngx-formly-material-native-select.mjs.map +1 -0
- package/fesm2022/ngx-formly-material-radio.mjs +140 -0
- package/fesm2022/ngx-formly-material-radio.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/ngx-formly-material-select.mjs +44 -51
- package/fesm2022/ngx-formly-material-select.mjs.map +1 -0
- package/fesm2022/ngx-formly-material-slider.mjs +123 -0
- package/fesm2022/ngx-formly-material-slider.mjs.map +1 -0
- package/fesm2022/ngx-formly-material-textarea.mjs +125 -0
- package/fesm2022/ngx-formly-material-textarea.mjs.map +1 -0
- package/fesm2022/ngx-formly-material-toggle.mjs +111 -0
- package/fesm2022/ngx-formly-material-toggle.mjs.map +1 -0
- package/fesm2022/ngx-formly-material.mjs +65 -0
- package/fesm2022/ngx-formly-material.mjs.map +1 -0
- package/form-field/field.type.d.ts +1 -1
- package/form-field/form-field.config.d.ts +2 -0
- package/form-field/form-field.wrapper.d.ts +1 -1
- package/form-field/public_api.d.ts +1 -0
- package/input/input.config.d.ts +2 -0
- package/input/input.type.d.ts +1 -1
- package/input/public_api.d.ts +1 -0
- package/lib/material.config.d.ts +1 -0
- package/lib/ui-material.d.ts +1 -0
- package/multicheckbox/multicheckbox.config.d.ts +2 -0
- package/multicheckbox/multicheckbox.type.d.ts +1 -1
- package/multicheckbox/public_api.d.ts +1 -0
- package/native-select/native-select.config.d.ts +2 -0
- package/native-select/native-select.type.d.ts +1 -1
- package/native-select/public_api.d.ts +1 -0
- package/package.json +53 -81
- package/radio/public_api.d.ts +1 -0
- package/radio/radio.config.d.ts +2 -0
- package/radio/radio.type.d.ts +1 -1
- package/select/public_api.d.ts +1 -0
- package/select/select.config.d.ts +2 -0
- package/select/select.type.d.ts +1 -1
- package/slider/public_api.d.ts +3 -4
- package/slider/slider.config.d.ts +2 -0
- package/slider/slider.module.d.ts +7 -9
- package/slider/slider.type.d.ts +5 -15
- package/textarea/public_api.d.ts +1 -0
- package/textarea/textarea.config.d.ts +2 -0
- package/textarea/textarea.type.d.ts +1 -1
- package/toggle/public_api.d.ts +1 -0
- package/toggle/toggle.config.d.ts +2 -0
- package/toggle/toggle.type.d.ts +1 -1
- package/checkbox/package.json +0 -10
- package/datepicker/package.json +0 -10
- package/esm2020/checkbox/checkbox.module.mjs +0 -61
- package/esm2020/checkbox/checkbox.type.mjs +0 -113
- package/esm2020/checkbox/public_api.mjs +0 -3
- package/esm2020/datepicker/datepicker.module.mjs +0 -57
- package/esm2020/datepicker/datepicker.type.mjs +0 -153
- package/esm2020/datepicker/public_api.mjs +0 -3
- package/esm2020/form-field/field.type.mjs +0 -142
- package/esm2020/form-field/form-field.module.mjs +0 -48
- package/esm2020/form-field/form-field.wrapper.mjs +0 -159
- package/esm2020/form-field/public_api.mjs +0 -3
- package/esm2020/input/input.module.mjs +0 -91
- package/esm2020/input/public_api.mjs +0 -3
- package/esm2020/lib/ui-material.mjs +0 -3
- package/esm2020/lib/ui-material.module.mjs +0 -43
- package/esm2020/multicheckbox/multicheckbox.module.mjs +0 -57
- package/esm2020/multicheckbox/multicheckbox.type.mjs +0 -85
- package/esm2020/multicheckbox/public_api.mjs +0 -3
- package/esm2020/native-select/native-select.module.mjs +0 -57
- package/esm2020/native-select/public_api.mjs +0 -3
- package/esm2020/radio/public_api.mjs +0 -3
- package/esm2020/radio/radio.module.mjs +0 -57
- package/esm2020/radio/radio.type.mjs +0 -89
- package/esm2020/select/public_api.mjs +0 -3
- package/esm2020/select/select.module.mjs +0 -63
- package/esm2020/select/select.type.mjs +0 -164
- package/esm2020/slider/public_api.mjs +0 -7
- package/esm2020/slider/slider-input.mjs +0 -466
- package/esm2020/slider/slider-interface.mjs +0 -15
- package/esm2020/slider/slider-mdc.type.mjs +0 -97
- package/esm2020/slider/slider.module.mjs +0 -65
- package/esm2020/slider/slider.type.mjs +0 -80
- package/esm2020/textarea/public_api.mjs +0 -3
- package/esm2020/textarea/textarea.module.mjs +0 -53
- package/esm2020/toggle/public_api.mjs +0 -3
- package/esm2020/toggle/toggle.module.mjs +0 -53
- package/fesm2015/ngx-formly-material-checkbox.mjs.map +0 -1
- package/fesm2015/ngx-formly-material-datepicker.mjs +0 -214
- package/fesm2015/ngx-formly-material-datepicker.mjs.map +0 -1
- package/fesm2015/ngx-formly-material-form-field.mjs +0 -351
- package/fesm2015/ngx-formly-material-form-field.mjs.map +0 -1
- package/fesm2015/ngx-formly-material-input.mjs +0 -176
- package/fesm2015/ngx-formly-material-input.mjs.map +0 -1
- package/fesm2015/ngx-formly-material-multicheckbox.mjs +0 -143
- package/fesm2015/ngx-formly-material-multicheckbox.mjs.map +0 -1
- package/fesm2015/ngx-formly-material-native-select.mjs +0 -134
- package/fesm2015/ngx-formly-material-native-select.mjs.map +0 -1
- package/fesm2015/ngx-formly-material-radio.mjs +0 -146
- package/fesm2015/ngx-formly-material-radio.mjs.map +0 -1
- package/fesm2015/ngx-formly-material-select.mjs +0 -230
- package/fesm2015/ngx-formly-material-select.mjs.map +0 -1
- package/fesm2015/ngx-formly-material-slider.mjs +0 -712
- package/fesm2015/ngx-formly-material-slider.mjs.map +0 -1
- package/fesm2015/ngx-formly-material-textarea.mjs +0 -131
- package/fesm2015/ngx-formly-material-textarea.mjs.map +0 -1
- package/fesm2015/ngx-formly-material-toggle.mjs +0 -117
- package/fesm2015/ngx-formly-material-toggle.mjs.map +0 -1
- package/fesm2015/ngx-formly-material.mjs +0 -55
- package/fesm2015/ngx-formly-material.mjs.map +0 -1
- package/fesm2020/ngx-formly-material-checkbox.mjs +0 -175
- package/fesm2020/ngx-formly-material-checkbox.mjs.map +0 -1
- package/fesm2020/ngx-formly-material-datepicker.mjs.map +0 -1
- package/fesm2020/ngx-formly-material-form-field.mjs.map +0 -1
- package/fesm2020/ngx-formly-material-input.mjs +0 -176
- package/fesm2020/ngx-formly-material-input.mjs.map +0 -1
- package/fesm2020/ngx-formly-material-multicheckbox.mjs.map +0 -1
- package/fesm2020/ngx-formly-material-native-select.mjs +0 -134
- package/fesm2020/ngx-formly-material-native-select.mjs.map +0 -1
- package/fesm2020/ngx-formly-material-radio.mjs +0 -146
- package/fesm2020/ngx-formly-material-radio.mjs.map +0 -1
- package/fesm2020/ngx-formly-material-select.mjs.map +0 -1
- package/fesm2020/ngx-formly-material-slider.mjs +0 -708
- package/fesm2020/ngx-formly-material-slider.mjs.map +0 -1
- package/fesm2020/ngx-formly-material-textarea.mjs +0 -131
- package/fesm2020/ngx-formly-material-textarea.mjs.map +0 -1
- package/fesm2020/ngx-formly-material-toggle.mjs +0 -117
- package/fesm2020/ngx-formly-material-toggle.mjs.map +0 -1
- package/fesm2020/ngx-formly-material.mjs +0 -55
- package/fesm2020/ngx-formly-material.mjs.map +0 -1
- package/form-field/package.json +0 -10
- package/input/package.json +0 -10
- package/multicheckbox/package.json +0 -10
- package/native-select/package.json +0 -10
- package/radio/package.json +0 -10
- package/select/package.json +0 -10
- package/slider/package.json +0 -10
- package/slider/slider-input.d.ts +0 -180
- package/slider/slider-interface.d.ts +0 -138
- package/slider/slider-mdc.type.d.ts +0 -13
- package/textarea/package.json +0 -10
- package/toggle/package.json +0 -10
- /package/checkbox/{ngx-formly-material-checkbox.d.ts → index.d.ts} +0 -0
- /package/datepicker/{ngx-formly-material-datepicker.d.ts → index.d.ts} +0 -0
- /package/{esm2020 → esm2022}/checkbox/ngx-formly-material-checkbox.mjs +0 -0
- /package/{esm2020 → esm2022}/datepicker/ngx-formly-material-datepicker.mjs +0 -0
- /package/{esm2020 → esm2022}/form-field/ngx-formly-material-form-field.mjs +0 -0
- /package/{esm2020 → esm2022}/input/ngx-formly-material-input.mjs +0 -0
- /package/{esm2020 → esm2022}/multicheckbox/ngx-formly-material-multicheckbox.mjs +0 -0
- /package/{esm2020 → esm2022}/native-select/ngx-formly-material-native-select.mjs +0 -0
- /package/{esm2020 → esm2022}/ngx-formly-material.mjs +0 -0
- /package/{esm2020 → esm2022}/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/radio/ngx-formly-material-radio.mjs +0 -0
- /package/{esm2020 → esm2022}/select/ngx-formly-material-select.mjs +0 -0
- /package/{esm2020 → esm2022}/slider/ngx-formly-material-slider.mjs +0 -0
- /package/{esm2020 → esm2022}/textarea/ngx-formly-material-textarea.mjs +0 -0
- /package/{esm2020 → esm2022}/toggle/ngx-formly-material-toggle.mjs +0 -0
- /package/form-field/{ngx-formly-material-form-field.d.ts → index.d.ts} +0 -0
- /package/{ngx-formly-material.d.ts → index.d.ts} +0 -0
- /package/input/{ngx-formly-material-input.d.ts → index.d.ts} +0 -0
- /package/multicheckbox/{ngx-formly-material-multicheckbox.d.ts → index.d.ts} +0 -0
- /package/native-select/{ngx-formly-material-native-select.d.ts → index.d.ts} +0 -0
- /package/radio/{ngx-formly-material-radio.d.ts → index.d.ts} +0 -0
- /package/select/{ngx-formly-material-select.d.ts → index.d.ts} +0 -0
- /package/slider/{ngx-formly-material-slider.d.ts → index.d.ts} +0 -0
- /package/textarea/{ngx-formly-material-textarea.d.ts → index.d.ts} +0 -0
- /package/toggle/{ngx-formly-material-toggle.d.ts → index.d.ts} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import * as i5 from '@angular/common';
|
|
4
|
-
import { CommonModule } from '@angular/common';
|
|
5
|
-
import * as i4 from '@ngx-formly/core';
|
|
6
|
-
import { FormlyModule } from '@ngx-formly/core';
|
|
7
|
-
import * as i3 from '@angular/forms';
|
|
8
|
-
import { ReactiveFormsModule } from '@angular/forms';
|
|
2
|
+
import { ViewChild, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
9
3
|
import { FieldType, FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';
|
|
10
|
-
import * as
|
|
4
|
+
import * as i4 from '@angular/material/checkbox';
|
|
11
5
|
import { MatCheckbox, MatCheckboxModule } from '@angular/material/checkbox';
|
|
12
6
|
import * as i1 from '@angular/cdk/a11y';
|
|
7
|
+
import * as i2 from '@angular/common';
|
|
8
|
+
import { CommonModule } from '@angular/common';
|
|
9
|
+
import * as i3 from '@angular/forms';
|
|
10
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
11
|
+
import * as i5 from '@ngx-formly/core';
|
|
12
|
+
import { FormlyModule } from '@ngx-formly/core';
|
|
13
13
|
|
|
14
14
|
class FormlyFieldCheckbox extends FieldType {
|
|
15
15
|
constructor(renderer, focusMonitor) {
|
|
@@ -62,9 +62,8 @@ class FormlyFieldCheckbox extends FieldType {
|
|
|
62
62
|
this.focusMonitor.stopMonitoring(this.checkbox._inputElement);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
FormlyFieldCheckbox.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: FormlyFieldCheckbox, selector: "formly-field-mat-checkbox", viewQueries: [{ propertyName: "checkbox", first: true, predicate: MatCheckbox, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
|
|
65
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldCheckbox, deps: [{ token: i0.Renderer2 }, { token: i1.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
66
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: FormlyFieldCheckbox, selector: "formly-field-mat-checkbox", viewQueries: [{ propertyName: "checkbox", first: true, predicate: MatCheckbox, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
|
|
68
67
|
<mat-checkbox
|
|
69
68
|
[formControl]="formControl"
|
|
70
69
|
[id]="id"
|
|
@@ -83,8 +82,9 @@ FormlyFieldCheckbox.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ve
|
|
|
83
82
|
>*</span
|
|
84
83
|
>
|
|
85
84
|
</mat-checkbox>
|
|
86
|
-
`, isInline: true,
|
|
87
|
-
|
|
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.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
86
|
+
}
|
|
87
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldCheckbox, decorators: [{
|
|
88
88
|
type: Component,
|
|
89
89
|
args: [{
|
|
90
90
|
selector: 'formly-field-mat-checkbox',
|
|
@@ -110,38 +110,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
110
110
|
`,
|
|
111
111
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
112
112
|
}]
|
|
113
|
-
}], ctorParameters:
|
|
113
|
+
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i1.FocusMonitor }], propDecorators: { checkbox: [{
|
|
114
114
|
type: ViewChild,
|
|
115
115
|
args: [MatCheckbox, { static: true }]
|
|
116
116
|
}] } });
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
function withFormlyFieldCheckbox() {
|
|
119
|
+
return {
|
|
120
|
+
types: [
|
|
121
|
+
{
|
|
122
|
+
name: 'checkbox',
|
|
123
|
+
component: FormlyFieldCheckbox,
|
|
124
|
+
wrappers: ['form-field'],
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: 'boolean',
|
|
128
|
+
extends: 'checkbox',
|
|
129
|
+
},
|
|
130
|
+
],
|
|
131
|
+
};
|
|
119
132
|
}
|
|
120
|
-
|
|
121
|
-
FormlyMatCheckboxModule
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
133
|
+
|
|
134
|
+
class FormlyMatCheckboxModule {
|
|
135
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyMatCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
136
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: FormlyMatCheckboxModule, declarations: [FormlyFieldCheckbox], imports: [CommonModule,
|
|
137
|
+
ReactiveFormsModule,
|
|
138
|
+
MatCheckboxModule,
|
|
139
|
+
FormlyMatFormFieldModule, i5.FormlyModule] }); }
|
|
140
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyMatCheckboxModule, imports: [CommonModule,
|
|
127
141
|
ReactiveFormsModule,
|
|
128
142
|
MatCheckboxModule,
|
|
129
143
|
FormlyMatFormFieldModule,
|
|
130
|
-
FormlyModule.forChild(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
name: 'checkbox',
|
|
134
|
-
component: FormlyFieldCheckbox,
|
|
135
|
-
wrappers: ['form-field'],
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
name: 'boolean',
|
|
139
|
-
extends: 'checkbox',
|
|
140
|
-
},
|
|
141
|
-
],
|
|
142
|
-
}),
|
|
143
|
-
]] });
|
|
144
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyMatCheckboxModule, decorators: [{
|
|
144
|
+
FormlyModule.forChild(withFormlyFieldCheckbox())] }); }
|
|
145
|
+
}
|
|
146
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyMatCheckboxModule, decorators: [{
|
|
145
147
|
type: NgModule,
|
|
146
148
|
args: [{
|
|
147
149
|
declarations: [FormlyFieldCheckbox],
|
|
@@ -150,19 +152,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
150
152
|
ReactiveFormsModule,
|
|
151
153
|
MatCheckboxModule,
|
|
152
154
|
FormlyMatFormFieldModule,
|
|
153
|
-
FormlyModule.forChild(
|
|
154
|
-
types: [
|
|
155
|
-
{
|
|
156
|
-
name: 'checkbox',
|
|
157
|
-
component: FormlyFieldCheckbox,
|
|
158
|
-
wrappers: ['form-field'],
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
name: 'boolean',
|
|
162
|
-
extends: 'checkbox',
|
|
163
|
-
},
|
|
164
|
-
],
|
|
165
|
-
}),
|
|
155
|
+
FormlyModule.forChild(withFormlyFieldCheckbox()),
|
|
166
156
|
],
|
|
167
157
|
}]
|
|
168
158
|
}] });
|
|
@@ -171,5 +161,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
171
161
|
* Generated bundle index. Do not edit.
|
|
172
162
|
*/
|
|
173
163
|
|
|
174
|
-
export { FormlyFieldCheckbox, FormlyMatCheckboxModule };
|
|
164
|
+
export { FormlyFieldCheckbox, FormlyMatCheckboxModule, withFormlyFieldCheckbox };
|
|
175
165
|
//# sourceMappingURL=ngx-formly-material-checkbox.mjs.map
|
|
@@ -0,0 +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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0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { ViewChild, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
4
3
|
import * as i1 from '@ngx-formly/core';
|
|
5
|
-
import { ɵobserve, FormlyModule } from '@ngx-formly/core';
|
|
6
|
-
import * as i4 from '@angular/forms';
|
|
7
|
-
import { ReactiveFormsModule } from '@angular/forms';
|
|
4
|
+
import { ɵobserve as _observe, FormlyModule } from '@ngx-formly/core';
|
|
8
5
|
import { FieldType, FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';
|
|
6
|
+
import * as i2 from '@angular/forms';
|
|
7
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
9
8
|
import * as i3 from '@angular/material/input';
|
|
10
9
|
import { MatInputModule } from '@angular/material/input';
|
|
11
|
-
import * as
|
|
10
|
+
import * as i4 from '@angular/material/datepicker';
|
|
12
11
|
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
12
|
+
import { CommonModule } from '@angular/common';
|
|
13
13
|
|
|
14
14
|
class FormlyFieldDatepicker extends FieldType {
|
|
15
15
|
constructor(config, cdRef) {
|
|
@@ -36,12 +36,12 @@ class FormlyFieldDatepicker extends FieldType {
|
|
|
36
36
|
}
|
|
37
37
|
ngAfterViewInit() {
|
|
38
38
|
this.props[this.props.datepickerOptions.datepickerTogglePosition] = this.datepickerToggle;
|
|
39
|
-
|
|
39
|
+
_observe(this.field, ['props', 'datepickerOptions', 'opened'], () => {
|
|
40
40
|
this.cdRef.detectChanges();
|
|
41
41
|
});
|
|
42
42
|
// temporary fix for https://github.com/angular/components/issues/16761
|
|
43
43
|
if (this.config.getValidatorMessage('matDatepickerParse')) {
|
|
44
|
-
this.fieldErrorsObserver =
|
|
44
|
+
this.fieldErrorsObserver = _observe(this.field, ['formControl', 'errors'], ({ currentValue }) => {
|
|
45
45
|
if (currentValue && currentValue.required && currentValue.matDatepickerParse) {
|
|
46
46
|
const errors = Object.keys(currentValue)
|
|
47
47
|
.sort((prop) => (prop === 'matDatepickerParse' ? -1 : 0))
|
|
@@ -55,9 +55,8 @@ class FormlyFieldDatepicker extends FieldType {
|
|
|
55
55
|
super.ngOnDestroy();
|
|
56
56
|
this.fieldErrorsObserver?.unsubscribe();
|
|
57
57
|
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
FormlyFieldDatepicker.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: FormlyFieldDatepicker, selector: "formly-field-mat-datepicker", viewQueries: [{ propertyName: "datepickerToggle", first: true, predicate: ["datepickerToggle"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
|
|
58
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldDatepicker, deps: [{ token: i1.FormlyConfig }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
59
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: FormlyFieldDatepicker, selector: "formly-field-mat-datepicker", viewQueries: [{ propertyName: "datepickerToggle", first: true, predicate: ["datepickerToggle"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
|
|
61
60
|
<input
|
|
62
61
|
matInput
|
|
63
62
|
[id]="id"
|
|
@@ -100,8 +99,9 @@ FormlyFieldDatepicker.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
100
99
|
(closed)="props.datepickerOptions.opened = false"
|
|
101
100
|
>
|
|
102
101
|
</mat-datepicker>
|
|
103
|
-
`, isInline: true,
|
|
104
|
-
|
|
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.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
103
|
+
}
|
|
104
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyFieldDatepicker, decorators: [{
|
|
105
105
|
type: Component,
|
|
106
106
|
args: [{
|
|
107
107
|
selector: 'formly-field-mat-datepicker',
|
|
@@ -151,36 +151,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
151
151
|
`,
|
|
152
152
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
153
153
|
}]
|
|
154
|
-
}], ctorParameters:
|
|
154
|
+
}], ctorParameters: () => [{ type: i1.FormlyConfig }, { type: i0.ChangeDetectorRef }], propDecorators: { datepickerToggle: [{
|
|
155
155
|
type: ViewChild,
|
|
156
156
|
args: ['datepickerToggle', { static: true }]
|
|
157
157
|
}] } });
|
|
158
158
|
|
|
159
|
-
|
|
159
|
+
function withFormlyFieldDatepicker() {
|
|
160
|
+
return {
|
|
161
|
+
types: [
|
|
162
|
+
{
|
|
163
|
+
name: 'datepicker',
|
|
164
|
+
component: FormlyFieldDatepicker,
|
|
165
|
+
wrappers: ['form-field'],
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
};
|
|
160
169
|
}
|
|
161
|
-
|
|
162
|
-
FormlyMatDatepickerModule
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
170
|
+
|
|
171
|
+
class FormlyMatDatepickerModule {
|
|
172
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyMatDatepickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
173
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: FormlyMatDatepickerModule, declarations: [FormlyFieldDatepicker], imports: [CommonModule,
|
|
174
|
+
ReactiveFormsModule,
|
|
175
|
+
MatInputModule,
|
|
176
|
+
MatDatepickerModule,
|
|
177
|
+
FormlyMatFormFieldModule, i1.FormlyModule] }); }
|
|
178
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyMatDatepickerModule, imports: [CommonModule,
|
|
169
179
|
ReactiveFormsModule,
|
|
170
180
|
MatInputModule,
|
|
171
181
|
MatDatepickerModule,
|
|
172
182
|
FormlyMatFormFieldModule,
|
|
173
|
-
FormlyModule.forChild(
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
name: 'datepicker',
|
|
177
|
-
component: FormlyFieldDatepicker,
|
|
178
|
-
wrappers: ['form-field'],
|
|
179
|
-
},
|
|
180
|
-
],
|
|
181
|
-
}),
|
|
182
|
-
]] });
|
|
183
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyMatDatepickerModule, decorators: [{
|
|
183
|
+
FormlyModule.forChild(withFormlyFieldDatepicker())] }); }
|
|
184
|
+
}
|
|
185
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyMatDatepickerModule, decorators: [{
|
|
184
186
|
type: NgModule,
|
|
185
187
|
args: [{
|
|
186
188
|
declarations: [FormlyFieldDatepicker],
|
|
@@ -190,15 +192,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
190
192
|
MatInputModule,
|
|
191
193
|
MatDatepickerModule,
|
|
192
194
|
FormlyMatFormFieldModule,
|
|
193
|
-
FormlyModule.forChild(
|
|
194
|
-
types: [
|
|
195
|
-
{
|
|
196
|
-
name: 'datepicker',
|
|
197
|
-
component: FormlyFieldDatepicker,
|
|
198
|
-
wrappers: ['form-field'],
|
|
199
|
-
},
|
|
200
|
-
],
|
|
201
|
-
}),
|
|
195
|
+
FormlyModule.forChild(withFormlyFieldDatepicker()),
|
|
202
196
|
],
|
|
203
197
|
}]
|
|
204
198
|
}] });
|
|
@@ -207,5 +201,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
207
201
|
* Generated bundle index. Do not edit.
|
|
208
202
|
*/
|
|
209
203
|
|
|
210
|
-
export { FormlyFieldDatepicker, FormlyMatDatepickerModule };
|
|
204
|
+
export { FormlyFieldDatepicker, FormlyMatDatepickerModule, withFormlyFieldDatepicker };
|
|
211
205
|
//# sourceMappingURL=ngx-formly-material-datepicker.mjs.map
|
|
@@ -0,0 +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"],"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;YACZ,mBAAmB;YACnB,cAAc;YACd,mBAAmB;YAEnB,wBAAwB,EAAA,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,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,13 +1,13 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import * as i4 from '@
|
|
4
|
-
import {
|
|
5
|
-
import * as i3 from '@
|
|
6
|
-
import { FieldWrapper, ɵdefineHiddenProp, FormlyModule, FieldType as FieldType$1, ɵobserve } from '@ngx-formly/core';
|
|
7
|
-
import { ReactiveFormsModule } from '@angular/forms';
|
|
8
|
-
import * as i2 from '@angular/material/form-field';
|
|
2
|
+
import { ViewChild, ViewEncapsulation, Component, NO_ERRORS_SCHEMA, NgModule, Type, ViewChildren, Directive } from '@angular/core';
|
|
3
|
+
import * as i4 from '@ngx-formly/core';
|
|
4
|
+
import { FieldWrapper, ɵdefineHiddenProp as _defineHiddenProp, FormlyModule, FieldType as FieldType$1, ɵobserve as _observe } from '@ngx-formly/core';
|
|
5
|
+
import * as i3 from '@angular/material/form-field';
|
|
9
6
|
import { MatFormField, MatFormFieldModule, MatFormFieldControl } from '@angular/material/form-field';
|
|
10
7
|
import * as i1 from '@angular/cdk/a11y';
|
|
8
|
+
import * as i2 from '@angular/common';
|
|
9
|
+
import { CommonModule } from '@angular/common';
|
|
10
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
11
11
|
import { Subject } from 'rxjs';
|
|
12
12
|
|
|
13
13
|
class FormlyWrapperFormField extends FieldWrapper {
|
|
@@ -18,7 +18,7 @@ class FormlyWrapperFormField extends FieldWrapper {
|
|
|
18
18
|
this.focusMonitor = focusMonitor;
|
|
19
19
|
}
|
|
20
20
|
ngOnInit() {
|
|
21
|
-
|
|
21
|
+
_defineHiddenProp(this.field, '_formField', this.formField);
|
|
22
22
|
this.focusMonitor.monitor(this.elementRef, true).subscribe((origin) => {
|
|
23
23
|
if (!origin && this.field.focus) {
|
|
24
24
|
this.field.focus = false;
|
|
@@ -36,9 +36,8 @@ class FormlyWrapperFormField extends FieldWrapper {
|
|
|
36
36
|
delete this.field._formField;
|
|
37
37
|
this.focusMonitor.stopMonitoring(this.elementRef);
|
|
38
38
|
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
FormlyWrapperFormField.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: FormlyWrapperFormField, selector: "formly-wrapper-mat-form-field", viewQueries: [{ propertyName: "formField", first: true, predicate: MatFormField, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
|
|
39
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyWrapperFormField, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i1.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
40
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: FormlyWrapperFormField, selector: "formly-wrapper-mat-form-field", viewQueries: [{ propertyName: "formField", first: true, predicate: MatFormField, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
|
|
42
41
|
<!-- fix https://github.com/angular/material2/pull/7083 by setting width to 100% -->
|
|
43
42
|
<mat-form-field
|
|
44
43
|
[hideRequiredMarker]="true"
|
|
@@ -95,8 +94,9 @@ FormlyWrapperFormField.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
95
94
|
<ng-container [ngTemplateOutlet]="content" [ngTemplateOutletContext]="{ field: field }"></ng-container>
|
|
96
95
|
</ng-template>
|
|
97
96
|
</ng-template>
|
|
98
|
-
`, isInline: true, styles: ["formly-wrapper-mat-form-field .mat-mdc-form-field,formly-wrapper-mat-form-field .mat-form-field{width:100%}\n"],
|
|
99
|
-
|
|
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.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
98
|
+
}
|
|
99
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyWrapperFormField, decorators: [{
|
|
100
100
|
type: Component,
|
|
101
101
|
args: [{ selector: 'formly-wrapper-mat-form-field', template: `
|
|
102
102
|
<!-- fix https://github.com/angular/material2/pull/7083 by setting width to 100% -->
|
|
@@ -156,47 +156,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
156
156
|
</ng-template>
|
|
157
157
|
</ng-template>
|
|
158
158
|
`, encapsulation: ViewEncapsulation.None, styles: ["formly-wrapper-mat-form-field .mat-mdc-form-field,formly-wrapper-mat-form-field .mat-form-field{width:100%}\n"] }]
|
|
159
|
-
}], ctorParameters:
|
|
159
|
+
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i1.FocusMonitor }], propDecorators: { formField: [{
|
|
160
160
|
type: ViewChild,
|
|
161
161
|
args: [MatFormField, { static: true }]
|
|
162
162
|
}] } });
|
|
163
163
|
|
|
164
|
+
function withFormlyFormField() {
|
|
165
|
+
return {
|
|
166
|
+
wrappers: [
|
|
167
|
+
{
|
|
168
|
+
name: 'form-field',
|
|
169
|
+
component: FormlyWrapperFormField,
|
|
170
|
+
},
|
|
171
|
+
],
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
|
|
164
175
|
class FormlyMatFormFieldModule {
|
|
176
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyMatFormFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
177
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: FormlyMatFormFieldModule, declarations: [FormlyWrapperFormField], imports: [CommonModule, ReactiveFormsModule, MatFormFieldModule, i4.FormlyModule] }); }
|
|
178
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyMatFormFieldModule, imports: [CommonModule, ReactiveFormsModule, MatFormFieldModule, FormlyModule.forChild(withFormlyFormField())] }); }
|
|
165
179
|
}
|
|
166
|
-
|
|
167
|
-
FormlyMatFormFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyMatFormFieldModule, declarations: [FormlyWrapperFormField], imports: [CommonModule,
|
|
168
|
-
ReactiveFormsModule,
|
|
169
|
-
MatFormFieldModule, i3.FormlyModule] });
|
|
170
|
-
FormlyMatFormFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyMatFormFieldModule, imports: [[
|
|
171
|
-
CommonModule,
|
|
172
|
-
ReactiveFormsModule,
|
|
173
|
-
MatFormFieldModule,
|
|
174
|
-
FormlyModule.forChild({
|
|
175
|
-
wrappers: [
|
|
176
|
-
{
|
|
177
|
-
name: 'form-field',
|
|
178
|
-
component: FormlyWrapperFormField,
|
|
179
|
-
},
|
|
180
|
-
],
|
|
181
|
-
}),
|
|
182
|
-
]] });
|
|
183
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormlyMatFormFieldModule, decorators: [{
|
|
180
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormlyMatFormFieldModule, decorators: [{
|
|
184
181
|
type: NgModule,
|
|
185
182
|
args: [{
|
|
186
183
|
declarations: [FormlyWrapperFormField],
|
|
187
|
-
imports: [
|
|
188
|
-
CommonModule,
|
|
189
|
-
ReactiveFormsModule,
|
|
190
|
-
MatFormFieldModule,
|
|
191
|
-
FormlyModule.forChild({
|
|
192
|
-
wrappers: [
|
|
193
|
-
{
|
|
194
|
-
name: 'form-field',
|
|
195
|
-
component: FormlyWrapperFormField,
|
|
196
|
-
},
|
|
197
|
-
],
|
|
198
|
-
}),
|
|
199
|
-
],
|
|
184
|
+
imports: [CommonModule, ReactiveFormsModule, MatFormFieldModule, FormlyModule.forChild(withFormlyFormField())],
|
|
200
185
|
schemas: [NO_ERRORS_SCHEMA],
|
|
201
186
|
}]
|
|
202
187
|
}] });
|
|
@@ -305,7 +290,7 @@ class FieldType extends FieldType$1 {
|
|
|
305
290
|
if (ngControl?.valueAccessor?.hasOwnProperty('_parentFormField')) {
|
|
306
291
|
ngControl.valueAccessor['_parentFormField'] = this.formField;
|
|
307
292
|
}
|
|
308
|
-
['prefix', 'suffix', 'textPrefix', 'textSuffix'].forEach((type) =>
|
|
293
|
+
['prefix', 'suffix', 'textPrefix', 'textSuffix'].forEach((type) => _observe(this.field, ['props', type], ({ currentValue }) => currentValue &&
|
|
309
294
|
Promise.resolve().then(() => {
|
|
310
295
|
this.options.detectChanges(this.field);
|
|
311
296
|
})));
|
|
@@ -316,10 +301,10 @@ class FieldType extends FieldType$1 {
|
|
|
316
301
|
};
|
|
317
302
|
}
|
|
318
303
|
}
|
|
304
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FieldType, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
305
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: FieldType, viewQueries: [{ propertyName: "matPrefix", first: true, predicate: ["matPrefix"], descendants: true }, { propertyName: "matTextPrefix", first: true, predicate: ["matTextPrefix"], descendants: true }, { propertyName: "matSuffix", first: true, predicate: ["matSuffix"], descendants: true }, { propertyName: "matTextSuffix", first: true, predicate: ["matTextSuffix"], descendants: true }, { propertyName: "_controls", predicate: MatFormFieldControl, descendants: true }], usesInheritance: true, ngImport: i0 }); }
|
|
319
306
|
}
|
|
320
|
-
|
|
321
|
-
FieldType.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: FieldType, viewQueries: [{ propertyName: "matPrefix", first: true, predicate: ["matPrefix"], descendants: true }, { propertyName: "matTextPrefix", first: true, predicate: ["matTextPrefix"], descendants: true }, { propertyName: "matSuffix", first: true, predicate: ["matSuffix"], descendants: true }, { propertyName: "matTextSuffix", first: true, predicate: ["matTextSuffix"], descendants: true }, { propertyName: "_controls", predicate: MatFormFieldControl, descendants: true }], usesInheritance: true, ngImport: i0 });
|
|
322
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FieldType, decorators: [{
|
|
307
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FieldType, decorators: [{
|
|
323
308
|
type: Directive
|
|
324
309
|
}], propDecorators: { matPrefix: [{
|
|
325
310
|
type: ViewChild,
|
|
@@ -342,5 +327,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
342
327
|
* Generated bundle index. Do not edit.
|
|
343
328
|
*/
|
|
344
329
|
|
|
345
|
-
export { FieldType, FormlyMatFormFieldModule };
|
|
330
|
+
export { FieldType, FormlyMatFormFieldModule, withFormlyFormField };
|
|
346
331
|
//# sourceMappingURL=ngx-formly-material-form-field.mjs.map
|
|
@@ -0,0 +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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