@ngx-formly/material 10.0.1 → 11.1.0-rc.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 +107 -177
- package/fesm2022/ngx-formly-material-checkbox.mjs +234 -127
- package/fesm2022/ngx-formly-material-checkbox.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-datepicker.mjs +264 -118
- package/fesm2022/ngx-formly-material-datepicker.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-form-field.mjs +440 -226
- package/fesm2022/ngx-formly-material-form-field.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-input.mjs +199 -89
- package/fesm2022/ngx-formly-material-input.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-multicheckbox.mjs +203 -106
- package/fesm2022/ngx-formly-material-multicheckbox.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-native-select.mjs +204 -73
- package/fesm2022/ngx-formly-material-native-select.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-radio.mjs +247 -104
- package/fesm2022/ngx-formly-material-radio.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-select.mjs +318 -133
- package/fesm2022/ngx-formly-material-select.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-slider.mjs +195 -85
- package/fesm2022/ngx-formly-material-slider.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-textarea.mjs +203 -86
- package/fesm2022/ngx-formly-material-textarea.mjs.map +1 -1
- package/fesm2022/ngx-formly-material-toggle.mjs +208 -86
- package/fesm2022/ngx-formly-material-toggle.mjs.map +1 -1
- package/fesm2022/ngx-formly-material.mjs +84 -62
- package/fesm2022/ngx-formly-material.mjs.map +1 -1
- package/package.json +3 -3
- package/types/ngx-formly-material-checkbox.d.ts +41 -46
- package/types/ngx-formly-material-datepicker.d.ts +62 -67
- package/types/ngx-formly-material-form-field.d.ts +71 -77
- package/types/ngx-formly-material-input.d.ts +22 -28
- package/types/ngx-formly-material-multicheckbox.d.ts +33 -38
- package/types/ngx-formly-material-native-select.d.ts +23 -29
- package/types/ngx-formly-material-radio.d.ts +34 -39
- package/types/ngx-formly-material-select.d.ts +45 -48
- package/types/ngx-formly-material-slider.d.ts +32 -37
- package/types/ngx-formly-material-textarea.d.ts +28 -33
- package/types/ngx-formly-material-toggle.d.ts +30 -35
- package/types/ngx-formly-material.d.ts +16 -19
|
@@ -1,55 +1,84 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import * as i4 from
|
|
4
|
-
import {
|
|
5
|
-
import * as i3 from
|
|
6
|
-
import { MatFormField,
|
|
7
|
-
import * as i1 from
|
|
8
|
-
import * as i2 from
|
|
9
|
-
import { CommonModule } from
|
|
10
|
-
import { ReactiveFormsModule } from
|
|
11
|
-
import { Subject } from
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Component, Directive, NO_ERRORS_SCHEMA, NgModule, Type, ViewChild, ViewChildren, ViewEncapsulation } from "@angular/core";
|
|
3
|
+
import * as i4 from "@ngx-formly/core";
|
|
4
|
+
import { FieldType as FieldType$1, FieldWrapper, FormlyModule, ɵdefineHiddenProp, ɵobserve } from "@ngx-formly/core";
|
|
5
|
+
import * as i3 from "@angular/material/form-field";
|
|
6
|
+
import { MatFormField, MatFormFieldControl, MatFormFieldModule } from "@angular/material/form-field";
|
|
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
|
+
import { Subject } from "rxjs";
|
|
12
|
+
var FormlyWrapperFormField = class FormlyWrapperFormField extends FieldWrapper {
|
|
13
|
+
constructor(renderer, elementRef, focusMonitor) {
|
|
14
|
+
super();
|
|
15
|
+
this.renderer = renderer;
|
|
16
|
+
this.elementRef = elementRef;
|
|
17
|
+
this.focusMonitor = focusMonitor;
|
|
18
|
+
}
|
|
19
|
+
ngOnInit() {
|
|
20
|
+
ɵdefineHiddenProp(this.field, "_formField", this.formField);
|
|
21
|
+
this.focusMonitor.monitor(this.elementRef, true).subscribe((origin) => {
|
|
22
|
+
if (!origin && this.field.focus) this.field.focus = false;
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
ngAfterViewInit() {
|
|
26
|
+
if (this.formField.appearance !== "outline" && this.props.hideFieldUnderline === true) {
|
|
27
|
+
const underlineElement = this.formField._elementRef.nativeElement.querySelector(".mat-form-field-underline");
|
|
28
|
+
underlineElement && this.renderer.removeChild(underlineElement.parentNode, underlineElement);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
ngOnDestroy() {
|
|
32
|
+
delete this.field._formField;
|
|
33
|
+
this.focusMonitor.stopMonitoring(this.elementRef);
|
|
34
|
+
}
|
|
35
|
+
static {
|
|
36
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
37
|
+
minVersion: "12.0.0",
|
|
38
|
+
version: "22.2.2",
|
|
39
|
+
ngImport: i0,
|
|
40
|
+
type: FormlyWrapperFormField,
|
|
41
|
+
deps: [
|
|
42
|
+
{ token: i0.Renderer2 },
|
|
43
|
+
{ token: i0.ElementRef },
|
|
44
|
+
{ token: i1.FocusMonitor }
|
|
45
|
+
],
|
|
46
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
static {
|
|
50
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
51
|
+
minVersion: "17.0.0",
|
|
52
|
+
version: "22.2.2",
|
|
53
|
+
type: FormlyWrapperFormField,
|
|
54
|
+
isStandalone: false,
|
|
55
|
+
selector: "formly-wrapper-mat-form-field",
|
|
56
|
+
viewQueries: [{
|
|
57
|
+
propertyName: "formField",
|
|
58
|
+
first: true,
|
|
59
|
+
predicate: MatFormField,
|
|
60
|
+
descendants: true,
|
|
61
|
+
static: true
|
|
62
|
+
}],
|
|
63
|
+
usesInheritance: true,
|
|
64
|
+
ngImport: i0,
|
|
65
|
+
template: `
|
|
41
66
|
<!-- fix https://github.com/angular/material2/pull/7083 by setting width to 100% -->
|
|
42
67
|
<mat-form-field
|
|
43
68
|
[hideRequiredMarker]="true"
|
|
44
69
|
[floatLabel]="props.floatLabel"
|
|
45
70
|
[appearance]="props.appearance"
|
|
46
|
-
[subscriptSizing]="props.subscriptSizing"
|
|
71
|
+
[subscriptSizing]="props.subscriptSizing ?? (field.validation?.showAllErrors ? 'dynamic' : undefined)"
|
|
47
72
|
[color]="props.color ?? 'primary'"
|
|
48
73
|
>
|
|
49
74
|
<ng-container #fieldComponent></ng-container>
|
|
50
75
|
@if (props.label && props.hideLabel !== true) {
|
|
51
76
|
<mat-label>
|
|
52
|
-
|
|
77
|
+
@if (props.allowHtml) {
|
|
78
|
+
<span [innerHTML]="props.label"></span>
|
|
79
|
+
} @else {
|
|
80
|
+
{{ props.label }}
|
|
81
|
+
}
|
|
53
82
|
@if (props.required && props.hideRequiredMarker !== true) {
|
|
54
83
|
<span aria-hidden="true" class="mat-form-field-required-marker mat-mdc-form-field-required-marker">*</span>
|
|
55
84
|
}
|
|
@@ -94,7 +123,10 @@ class FormlyWrapperFormField extends FieldWrapper {
|
|
|
94
123
|
|
|
95
124
|
@if (props.description || props.hintStart; as hint) {
|
|
96
125
|
<mat-hint>
|
|
97
|
-
<ng-container
|
|
126
|
+
<ng-container
|
|
127
|
+
[ngTemplateOutlet]="stringOrTemplate"
|
|
128
|
+
[ngTemplateOutletContext]="{ content: hint, allowHtml: props.allowHtml && !!props.description }"
|
|
129
|
+
>
|
|
98
130
|
</ng-container>
|
|
99
131
|
</mat-hint>
|
|
100
132
|
}
|
|
@@ -107,30 +139,110 @@ class FormlyWrapperFormField extends FieldWrapper {
|
|
|
107
139
|
}
|
|
108
140
|
</mat-form-field>
|
|
109
141
|
|
|
110
|
-
<ng-template #stringOrTemplate let-content="content">
|
|
142
|
+
<ng-template #stringOrTemplate let-content="content" let-allowHtml="allowHtml">
|
|
111
143
|
@if (!content.createEmbeddedView) {
|
|
112
|
-
|
|
144
|
+
@if (allowHtml) {
|
|
145
|
+
<span [innerHTML]="content"></span>
|
|
146
|
+
} @else {
|
|
147
|
+
<ng-container>{{ content }}</ng-container>
|
|
148
|
+
}
|
|
113
149
|
} @else {
|
|
114
150
|
<ng-container [ngTemplateOutlet]="content" [ngTemplateOutletContext]="{ field: field }"></ng-container>
|
|
115
151
|
}
|
|
116
152
|
</ng-template>
|
|
117
|
-
`,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
153
|
+
`,
|
|
154
|
+
isInline: true,
|
|
155
|
+
styles: ["formly-wrapper-mat-form-field .mat-mdc-form-field,formly-wrapper-mat-form-field .mat-form-field{width:100%}\n"],
|
|
156
|
+
dependencies: [
|
|
157
|
+
{
|
|
158
|
+
kind: "directive",
|
|
159
|
+
type: i2.NgTemplateOutlet,
|
|
160
|
+
selector: "[ngTemplateOutlet]",
|
|
161
|
+
inputs: [
|
|
162
|
+
"ngTemplateOutletContext",
|
|
163
|
+
"ngTemplateOutlet",
|
|
164
|
+
"ngTemplateOutletInjector"
|
|
165
|
+
]
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
kind: "component",
|
|
169
|
+
type: i3.MatFormField,
|
|
170
|
+
selector: "mat-form-field",
|
|
171
|
+
inputs: [
|
|
172
|
+
"hideRequiredMarker",
|
|
173
|
+
"color",
|
|
174
|
+
"floatLabel",
|
|
175
|
+
"appearance",
|
|
176
|
+
"subscriptSizing",
|
|
177
|
+
"hintLabel"
|
|
178
|
+
],
|
|
179
|
+
exportAs: ["matFormField"]
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
kind: "directive",
|
|
183
|
+
type: i3.MatLabel,
|
|
184
|
+
selector: "mat-label"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
kind: "directive",
|
|
188
|
+
type: i3.MatHint,
|
|
189
|
+
selector: "mat-hint",
|
|
190
|
+
inputs: ["align", "id"]
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
kind: "directive",
|
|
194
|
+
type: i3.MatError,
|
|
195
|
+
selector: "mat-error, [matError]",
|
|
196
|
+
inputs: ["id"]
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
kind: "directive",
|
|
200
|
+
type: i3.MatPrefix,
|
|
201
|
+
selector: "[matPrefix], [matIconPrefix], [matTextPrefix]",
|
|
202
|
+
inputs: ["matTextPrefix"]
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
kind: "directive",
|
|
206
|
+
type: i3.MatSuffix,
|
|
207
|
+
selector: "[matSuffix], [matIconSuffix], [matTextSuffix]",
|
|
208
|
+
inputs: ["matTextSuffix"]
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
kind: "component",
|
|
212
|
+
type: i4.LegacyFormlyValidationMessage,
|
|
213
|
+
selector: "formly-validation-message"
|
|
214
|
+
}
|
|
215
|
+
],
|
|
216
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
221
|
+
minVersion: "12.0.0",
|
|
222
|
+
version: "22.2.2",
|
|
223
|
+
ngImport: i0,
|
|
224
|
+
type: FormlyWrapperFormField,
|
|
225
|
+
decorators: [{
|
|
226
|
+
type: Component,
|
|
227
|
+
args: [{
|
|
228
|
+
selector: "formly-wrapper-mat-form-field",
|
|
229
|
+
template: `
|
|
122
230
|
<!-- fix https://github.com/angular/material2/pull/7083 by setting width to 100% -->
|
|
123
231
|
<mat-form-field
|
|
124
232
|
[hideRequiredMarker]="true"
|
|
125
233
|
[floatLabel]="props.floatLabel"
|
|
126
234
|
[appearance]="props.appearance"
|
|
127
|
-
[subscriptSizing]="props.subscriptSizing"
|
|
235
|
+
[subscriptSizing]="props.subscriptSizing ?? (field.validation?.showAllErrors ? 'dynamic' : undefined)"
|
|
128
236
|
[color]="props.color ?? 'primary'"
|
|
129
237
|
>
|
|
130
238
|
<ng-container #fieldComponent></ng-container>
|
|
131
239
|
@if (props.label && props.hideLabel !== true) {
|
|
132
240
|
<mat-label>
|
|
133
|
-
|
|
241
|
+
@if (props.allowHtml) {
|
|
242
|
+
<span [innerHTML]="props.label"></span>
|
|
243
|
+
} @else {
|
|
244
|
+
{{ props.label }}
|
|
245
|
+
}
|
|
134
246
|
@if (props.required && props.hideRequiredMarker !== true) {
|
|
135
247
|
<span aria-hidden="true" class="mat-form-field-required-marker mat-mdc-form-field-required-marker">*</span>
|
|
136
248
|
}
|
|
@@ -175,7 +287,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
175
287
|
|
|
176
288
|
@if (props.description || props.hintStart; as hint) {
|
|
177
289
|
<mat-hint>
|
|
178
|
-
<ng-container
|
|
290
|
+
<ng-container
|
|
291
|
+
[ngTemplateOutlet]="stringOrTemplate"
|
|
292
|
+
[ngTemplateOutletContext]="{ content: hint, allowHtml: props.allowHtml && !!props.description }"
|
|
293
|
+
>
|
|
179
294
|
</ng-container>
|
|
180
295
|
</mat-hint>
|
|
181
296
|
}
|
|
@@ -188,184 +303,283 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
188
303
|
}
|
|
189
304
|
</mat-form-field>
|
|
190
305
|
|
|
191
|
-
<ng-template #stringOrTemplate let-content="content">
|
|
306
|
+
<ng-template #stringOrTemplate let-content="content" let-allowHtml="allowHtml">
|
|
192
307
|
@if (!content.createEmbeddedView) {
|
|
193
|
-
|
|
308
|
+
@if (allowHtml) {
|
|
309
|
+
<span [innerHTML]="content"></span>
|
|
310
|
+
} @else {
|
|
311
|
+
<ng-container>{{ content }}</ng-container>
|
|
312
|
+
}
|
|
194
313
|
} @else {
|
|
195
314
|
<ng-container [ngTemplateOutlet]="content" [ngTemplateOutletContext]="{ field: field }"></ng-container>
|
|
196
315
|
}
|
|
197
316
|
</ng-template>
|
|
198
|
-
`,
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
317
|
+
`,
|
|
318
|
+
encapsulation: ViewEncapsulation.None,
|
|
319
|
+
standalone: false,
|
|
320
|
+
styles: ["formly-wrapper-mat-form-field .mat-mdc-form-field,formly-wrapper-mat-form-field .mat-form-field{width:100%}\n"]
|
|
321
|
+
}]
|
|
322
|
+
}],
|
|
323
|
+
ctorParameters: () => [
|
|
324
|
+
{ type: i0.Renderer2 },
|
|
325
|
+
{ type: i0.ElementRef },
|
|
326
|
+
{ type: i1.FocusMonitor }
|
|
327
|
+
],
|
|
328
|
+
propDecorators: { formField: [{
|
|
329
|
+
type: ViewChild,
|
|
330
|
+
args: [MatFormField, { static: true }]
|
|
331
|
+
}] }
|
|
332
|
+
});
|
|
204
333
|
function withFormlyFormField() {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
component: FormlyWrapperFormField,
|
|
210
|
-
},
|
|
211
|
-
],
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
class FormlyMatFormFieldModule {
|
|
216
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyMatFormFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
217
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.25", ngImport: i0, type: FormlyMatFormFieldModule, declarations: [FormlyWrapperFormField], imports: [CommonModule, ReactiveFormsModule, MatFormFieldModule, i4.FormlyModule] }); }
|
|
218
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyMatFormFieldModule, imports: [CommonModule, ReactiveFormsModule, MatFormFieldModule, FormlyModule.forChild(withFormlyFormField())] }); }
|
|
334
|
+
return { wrappers: [{
|
|
335
|
+
name: "form-field",
|
|
336
|
+
component: FormlyWrapperFormField
|
|
337
|
+
}] };
|
|
219
338
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
339
|
+
var FormlyMatFormFieldModule = class FormlyMatFormFieldModule {
|
|
340
|
+
static {
|
|
341
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
342
|
+
minVersion: "12.0.0",
|
|
343
|
+
version: "22.2.2",
|
|
344
|
+
ngImport: i0,
|
|
345
|
+
type: FormlyMatFormFieldModule,
|
|
346
|
+
deps: [],
|
|
347
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
static {
|
|
351
|
+
this.ɵmod = i0.ɵɵngDeclareNgModule({
|
|
352
|
+
minVersion: "14.0.0",
|
|
353
|
+
version: "22.2.2",
|
|
354
|
+
ngImport: i0,
|
|
355
|
+
type: FormlyMatFormFieldModule,
|
|
356
|
+
declarations: [FormlyWrapperFormField],
|
|
357
|
+
imports: [
|
|
358
|
+
CommonModule,
|
|
359
|
+
ReactiveFormsModule,
|
|
360
|
+
MatFormFieldModule,
|
|
361
|
+
i4.FormlyModule
|
|
362
|
+
]
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
static {
|
|
366
|
+
this.ɵinj = i0.ɵɵngDeclareInjector({
|
|
367
|
+
minVersion: "12.0.0",
|
|
368
|
+
version: "22.2.2",
|
|
369
|
+
ngImport: i0,
|
|
370
|
+
type: FormlyMatFormFieldModule,
|
|
371
|
+
imports: [
|
|
372
|
+
CommonModule,
|
|
373
|
+
ReactiveFormsModule,
|
|
374
|
+
MatFormFieldModule,
|
|
375
|
+
FormlyModule.forChild(withFormlyFormField())
|
|
376
|
+
]
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
381
|
+
minVersion: "12.0.0",
|
|
382
|
+
version: "22.2.2",
|
|
383
|
+
ngImport: i0,
|
|
384
|
+
type: FormlyMatFormFieldModule,
|
|
385
|
+
decorators: [{
|
|
386
|
+
type: NgModule,
|
|
387
|
+
args: [{
|
|
388
|
+
declarations: [FormlyWrapperFormField],
|
|
389
|
+
imports: [
|
|
390
|
+
CommonModule,
|
|
391
|
+
ReactiveFormsModule,
|
|
392
|
+
MatFormFieldModule,
|
|
393
|
+
FormlyModule.forChild(withFormlyFormField())
|
|
394
|
+
],
|
|
395
|
+
schemas: [NO_ERRORS_SCHEMA]
|
|
396
|
+
}]
|
|
397
|
+
}]
|
|
398
|
+
});
|
|
399
|
+
var FieldType = class FieldType extends FieldType$1 {
|
|
400
|
+
constructor() {
|
|
401
|
+
super(...arguments);
|
|
402
|
+
this.errorStateMatcher = { isErrorState: () => this.field && this.showError };
|
|
403
|
+
this.stateChanges = new Subject();
|
|
404
|
+
this._errorState = false;
|
|
405
|
+
this._focused = false;
|
|
406
|
+
}
|
|
407
|
+
set matPrefix(prefix) {
|
|
408
|
+
if (prefix) this.props.prefix = prefix;
|
|
409
|
+
}
|
|
410
|
+
set matTextPrefix(textPrefix) {
|
|
411
|
+
if (textPrefix) this.props.textPrefix = textPrefix;
|
|
412
|
+
}
|
|
413
|
+
set matSuffix(suffix) {
|
|
414
|
+
if (suffix) this.props.suffix = suffix;
|
|
415
|
+
}
|
|
416
|
+
set matTextSuffix(textSuffix) {
|
|
417
|
+
if (textSuffix) this.props.textSuffix = textSuffix;
|
|
418
|
+
}
|
|
419
|
+
set _controls(controls) {
|
|
420
|
+
this.attachControl(controls.length === 1 ? controls.first : this);
|
|
421
|
+
}
|
|
422
|
+
ngOnDestroy() {
|
|
423
|
+
delete this.formField?._control;
|
|
424
|
+
this.stateChanges.complete();
|
|
425
|
+
}
|
|
426
|
+
setDescribedByIds(_ids) {}
|
|
427
|
+
onContainerClick(_event) {
|
|
428
|
+
this.field.focus = true;
|
|
429
|
+
this.stateChanges.next();
|
|
430
|
+
}
|
|
431
|
+
get errorState() {
|
|
432
|
+
const showError = this.options.showError(this);
|
|
433
|
+
if (showError !== this._errorState) {
|
|
434
|
+
this._errorState = showError;
|
|
435
|
+
this.stateChanges.next();
|
|
436
|
+
}
|
|
437
|
+
return showError;
|
|
438
|
+
}
|
|
439
|
+
get controlType() {
|
|
440
|
+
if (this.props.type) return this.props.type;
|
|
441
|
+
const type = this.field.type;
|
|
442
|
+
return type instanceof Type ? type.prototype.constructor.name : type;
|
|
443
|
+
}
|
|
444
|
+
get focused() {
|
|
445
|
+
const focused = !!this.field.focus && !this.disabled;
|
|
446
|
+
if (focused !== this._focused) {
|
|
447
|
+
this._focused = focused;
|
|
448
|
+
this.stateChanges.next();
|
|
449
|
+
}
|
|
450
|
+
return focused;
|
|
451
|
+
}
|
|
452
|
+
get disabled() {
|
|
453
|
+
return !!this.props.disabled;
|
|
454
|
+
}
|
|
455
|
+
get required() {
|
|
456
|
+
return !!this.props.required;
|
|
457
|
+
}
|
|
458
|
+
get placeholder() {
|
|
459
|
+
return this.props.placeholder || "";
|
|
460
|
+
}
|
|
461
|
+
get shouldPlaceholderFloat() {
|
|
462
|
+
return this.shouldLabelFloat;
|
|
463
|
+
}
|
|
464
|
+
get value() {
|
|
465
|
+
return this.formControl?.value;
|
|
466
|
+
}
|
|
467
|
+
set value(value) {
|
|
468
|
+
this.formControl?.patchValue(value);
|
|
469
|
+
}
|
|
470
|
+
get ngControl() {
|
|
471
|
+
return this.formControl;
|
|
472
|
+
}
|
|
473
|
+
get empty() {
|
|
474
|
+
return this.value == null || this.value === "";
|
|
475
|
+
}
|
|
476
|
+
get shouldLabelFloat() {
|
|
477
|
+
return this.focused || !this.empty;
|
|
478
|
+
}
|
|
479
|
+
get formField() {
|
|
480
|
+
return this.field?.["_formField"];
|
|
481
|
+
}
|
|
482
|
+
attachControl(control) {
|
|
483
|
+
if (this.formField && control !== this.formField._control) {
|
|
484
|
+
this.formField._control = control;
|
|
485
|
+
const ngControl = control?.ngControl;
|
|
486
|
+
if (ngControl?.valueAccessor?.hasOwnProperty("_formField")) ngControl.valueAccessor["_formField"] = this.formField;
|
|
487
|
+
if (ngControl?.valueAccessor?.hasOwnProperty("_parentFormField")) ngControl.valueAccessor["_parentFormField"] = this.formField;
|
|
488
|
+
[
|
|
489
|
+
"prefix",
|
|
490
|
+
"suffix",
|
|
491
|
+
"textPrefix",
|
|
492
|
+
"textSuffix"
|
|
493
|
+
].forEach((type) => ɵobserve(this.field, ["props", type], ({ currentValue }) => currentValue && Promise.resolve().then(() => {
|
|
494
|
+
this.options.detectChanges(this.field);
|
|
495
|
+
})));
|
|
496
|
+
const setDescribedByIds = control.setDescribedByIds.bind(control);
|
|
497
|
+
control.setDescribedByIds = (ids) => {
|
|
498
|
+
setTimeout(() => setDescribedByIds(ids));
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
static {
|
|
503
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
504
|
+
minVersion: "12.0.0",
|
|
505
|
+
version: "22.2.2",
|
|
506
|
+
ngImport: i0,
|
|
507
|
+
type: FieldType,
|
|
508
|
+
deps: null,
|
|
509
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
static {
|
|
513
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
514
|
+
minVersion: "14.0.0",
|
|
515
|
+
version: "22.2.2",
|
|
516
|
+
type: FieldType,
|
|
517
|
+
isStandalone: true,
|
|
518
|
+
viewQueries: [
|
|
519
|
+
{
|
|
520
|
+
propertyName: "matPrefix",
|
|
521
|
+
first: true,
|
|
522
|
+
predicate: ["matPrefix"],
|
|
523
|
+
descendants: true
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
propertyName: "matTextPrefix",
|
|
527
|
+
first: true,
|
|
528
|
+
predicate: ["matTextPrefix"],
|
|
529
|
+
descendants: true
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
propertyName: "matSuffix",
|
|
533
|
+
first: true,
|
|
534
|
+
predicate: ["matSuffix"],
|
|
535
|
+
descendants: true
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
propertyName: "matTextSuffix",
|
|
539
|
+
first: true,
|
|
540
|
+
predicate: ["matTextSuffix"],
|
|
541
|
+
descendants: true
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
propertyName: "_controls",
|
|
545
|
+
predicate: MatFormFieldControl,
|
|
546
|
+
descendants: true
|
|
547
|
+
}
|
|
548
|
+
],
|
|
549
|
+
usesInheritance: true,
|
|
550
|
+
ngImport: i0
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
};
|
|
554
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
555
|
+
minVersion: "12.0.0",
|
|
556
|
+
version: "22.2.2",
|
|
557
|
+
ngImport: i0,
|
|
558
|
+
type: FieldType,
|
|
559
|
+
decorators: [{ type: Directive }],
|
|
560
|
+
propDecorators: {
|
|
561
|
+
matPrefix: [{
|
|
562
|
+
type: ViewChild,
|
|
563
|
+
args: ["matPrefix"]
|
|
564
|
+
}],
|
|
565
|
+
matTextPrefix: [{
|
|
566
|
+
type: ViewChild,
|
|
567
|
+
args: ["matTextPrefix"]
|
|
568
|
+
}],
|
|
569
|
+
matSuffix: [{
|
|
570
|
+
type: ViewChild,
|
|
571
|
+
args: ["matSuffix"]
|
|
572
|
+
}],
|
|
573
|
+
matTextSuffix: [{
|
|
574
|
+
type: ViewChild,
|
|
575
|
+
args: ["matTextSuffix"]
|
|
576
|
+
}],
|
|
577
|
+
_controls: [{
|
|
578
|
+
type: ViewChildren,
|
|
579
|
+
args: [MatFormFieldControl]
|
|
580
|
+
}]
|
|
581
|
+
}
|
|
582
|
+
});
|
|
370
583
|
export { FieldType, FormlyMatFormFieldModule, withFormlyFormField };
|
|
371
|
-
|
|
584
|
+
|
|
585
|
+
//# sourceMappingURL=ngx-formly-material-form-field.mjs.map
|