@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.
Files changed (38) hide show
  1. package/README.md +107 -177
  2. package/fesm2022/ngx-formly-material-checkbox.mjs +234 -127
  3. package/fesm2022/ngx-formly-material-checkbox.mjs.map +1 -1
  4. package/fesm2022/ngx-formly-material-datepicker.mjs +264 -118
  5. package/fesm2022/ngx-formly-material-datepicker.mjs.map +1 -1
  6. package/fesm2022/ngx-formly-material-form-field.mjs +440 -226
  7. package/fesm2022/ngx-formly-material-form-field.mjs.map +1 -1
  8. package/fesm2022/ngx-formly-material-input.mjs +199 -89
  9. package/fesm2022/ngx-formly-material-input.mjs.map +1 -1
  10. package/fesm2022/ngx-formly-material-multicheckbox.mjs +203 -106
  11. package/fesm2022/ngx-formly-material-multicheckbox.mjs.map +1 -1
  12. package/fesm2022/ngx-formly-material-native-select.mjs +204 -73
  13. package/fesm2022/ngx-formly-material-native-select.mjs.map +1 -1
  14. package/fesm2022/ngx-formly-material-radio.mjs +247 -104
  15. package/fesm2022/ngx-formly-material-radio.mjs.map +1 -1
  16. package/fesm2022/ngx-formly-material-select.mjs +318 -133
  17. package/fesm2022/ngx-formly-material-select.mjs.map +1 -1
  18. package/fesm2022/ngx-formly-material-slider.mjs +195 -85
  19. package/fesm2022/ngx-formly-material-slider.mjs.map +1 -1
  20. package/fesm2022/ngx-formly-material-textarea.mjs +203 -86
  21. package/fesm2022/ngx-formly-material-textarea.mjs.map +1 -1
  22. package/fesm2022/ngx-formly-material-toggle.mjs +208 -86
  23. package/fesm2022/ngx-formly-material-toggle.mjs.map +1 -1
  24. package/fesm2022/ngx-formly-material.mjs +84 -62
  25. package/fesm2022/ngx-formly-material.mjs.map +1 -1
  26. package/package.json +3 -3
  27. package/types/ngx-formly-material-checkbox.d.ts +41 -46
  28. package/types/ngx-formly-material-datepicker.d.ts +62 -67
  29. package/types/ngx-formly-material-form-field.d.ts +71 -77
  30. package/types/ngx-formly-material-input.d.ts +22 -28
  31. package/types/ngx-formly-material-multicheckbox.d.ts +33 -38
  32. package/types/ngx-formly-material-native-select.d.ts +23 -29
  33. package/types/ngx-formly-material-radio.d.ts +34 -39
  34. package/types/ngx-formly-material-select.d.ts +45 -48
  35. package/types/ngx-formly-material-slider.d.ts +32 -37
  36. package/types/ngx-formly-material-textarea.d.ts +28 -33
  37. package/types/ngx-formly-material-toggle.d.ts +30 -35
  38. package/types/ngx-formly-material.d.ts +16 -19
@@ -1,73 +1,93 @@
1
- import * as i0 from '@angular/core';
2
- import { ViewChild, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
3
- import * as i3 from '@angular/material/select';
4
- import { MatSelect, MatSelectModule } from '@angular/material/select';
5
- import * as i5 from '@ngx-formly/core';
6
- import { ɵobserve as _observe, FormlyModule } from '@ngx-formly/core';
7
- import { FieldType, FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';
8
- import * as i1 from '@angular/common';
9
- import { CommonModule } from '@angular/common';
10
- import * as i2 from '@angular/forms';
11
- import { ReactiveFormsModule } from '@angular/forms';
12
- import * as i4 from '@angular/material/core';
13
- import { MatPseudoCheckboxModule } from '@angular/material/core';
14
- import * as i6 from '@ngx-formly/core/select';
15
- import { FormlySelectModule } from '@ngx-formly/core/select';
16
-
17
- class FormlyFieldSelect extends FieldType {
18
- constructor() {
19
- super(...arguments);
20
- this.defaultOptions = {
21
- props: {
22
- compareWith(o1, o2) {
23
- return o1 === o2;
24
- },
25
- },
26
- };
27
- }
28
- set select(select) {
29
- _observe(select, ['_parentFormField', '_textField'], ({ currentValue }) => {
30
- if (currentValue) {
31
- select._preferredOverlayOrigin = select._parentFormField.getConnectedOverlayOrigin();
32
- }
33
- });
34
- }
35
- getSelectAllState(options) {
36
- if (this.empty || this.value.length === 0) {
37
- return null;
38
- }
39
- return this.value.length !== this.getSelectAllValue(options).length ? 'indeterminate' : 'checked';
40
- }
41
- toggleSelectAll(options) {
42
- const selectAllValue = this.getSelectAllValue(options);
43
- this.formControl.markAsDirty();
44
- this.formControl.setValue(!this.value || this.value.length !== selectAllValue.length ? selectAllValue : []);
45
- }
46
- change($event) {
47
- this.props.change?.(this.field, $event);
48
- }
49
- _getAriaLabelledby() {
50
- if (this.props.attributes?.['aria-labelledby']) {
51
- return this.props.attributes['aria-labelledby'];
52
- }
53
- return this.formField?._labelId;
54
- }
55
- _getAriaLabel() {
56
- return this.props.attributes?.['aria-label'];
57
- }
58
- getSelectAllValue(options) {
59
- if (!this.selectAllValue || options !== this.selectAllValue.options) {
60
- const flatOptions = [];
61
- options.forEach((o) => (o.group ? flatOptions.push(...o.group) : flatOptions.push(o)));
62
- this.selectAllValue = {
63
- options,
64
- value: flatOptions.filter((o) => !o.disabled).map((o) => o.value),
65
- };
66
- }
67
- return this.selectAllValue.value;
68
- }
69
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyFieldSelect, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
70
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: FormlyFieldSelect, isStandalone: false, selector: "formly-field-mat-select", viewQueries: [{ propertyName: "select", first: true, predicate: MatSelect, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, NgModule, ViewChild } from "@angular/core";
3
+ import * as i3 from "@angular/material/select";
4
+ import { MatSelect, MatSelectModule } from "@angular/material/select";
5
+ import * as i5 from "@ngx-formly/core";
6
+ import { FormlyModule, ɵobserve } from "@ngx-formly/core";
7
+ import { FieldType, FormlyMatFormFieldModule } from "@ngx-formly/material/form-field";
8
+ import * as i1 from "@angular/common";
9
+ import { CommonModule } from "@angular/common";
10
+ import * as i2 from "@angular/forms";
11
+ import { ReactiveFormsModule } from "@angular/forms";
12
+ import * as i4 from "@angular/material/core";
13
+ import { MatPseudoCheckboxModule } from "@angular/material/core";
14
+ import * as i6 from "@ngx-formly/core/select";
15
+ import { FormlySelectModule } from "@ngx-formly/core/select";
16
+ var FormlyFieldSelect = class FormlyFieldSelect extends FieldType {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.defaultOptions = { props: { compareWith(o1, o2) {
20
+ return o1 === o2;
21
+ } } };
22
+ }
23
+ set select(select) {
24
+ ɵobserve(select, ["_parentFormField", "_textField"], ({ currentValue }) => {
25
+ if (currentValue) select._preferredOverlayOrigin = select._parentFormField.getConnectedOverlayOrigin();
26
+ });
27
+ }
28
+ get triggerLabel() {
29
+ const { triggerLabel, multiple } = this.props;
30
+ if (this.empty || multiple && this.value.length === 0) return "";
31
+ if (typeof triggerLabel === "function") return triggerLabel(this.value);
32
+ return multiple ? this.value.map((value) => value?.[triggerLabel]).join(", ") : this.value?.[triggerLabel];
33
+ }
34
+ getSelectAllState(options) {
35
+ if (this.empty || this.value.length === 0) return null;
36
+ return this.value.length !== this.getSelectAllValue(options).length ? "indeterminate" : "checked";
37
+ }
38
+ toggleSelectAll(options) {
39
+ const selectAllValue = this.getSelectAllValue(options);
40
+ this.formControl.markAsDirty();
41
+ this.formControl.setValue(!this.value || this.value.length !== selectAllValue.length ? selectAllValue : []);
42
+ }
43
+ change($event) {
44
+ this.props.change?.(this.field, $event);
45
+ }
46
+ _getAriaLabelledby() {
47
+ if (this.props.attributes?.["aria-labelledby"]) return this.props.attributes["aria-labelledby"];
48
+ return this.formField?._labelId;
49
+ }
50
+ _getAriaLabel() {
51
+ return this.props.attributes?.["aria-label"];
52
+ }
53
+ getSelectAllValue(options) {
54
+ if (!this.selectAllValue || options !== this.selectAllValue.options) {
55
+ const flatOptions = [];
56
+ options.forEach((o) => o.group ? flatOptions.push(...o.group) : flatOptions.push(o));
57
+ this.selectAllValue = {
58
+ options,
59
+ value: flatOptions.filter((o) => !o.disabled).map((o) => o.value)
60
+ };
61
+ }
62
+ return this.selectAllValue.value;
63
+ }
64
+ static {
65
+ this.ɵfac = i0.ɵɵngDeclareFactory({
66
+ minVersion: "12.0.0",
67
+ version: "22.2.2",
68
+ ngImport: i0,
69
+ type: FormlyFieldSelect,
70
+ deps: null,
71
+ target: i0.ɵɵFactoryTarget.Component
72
+ });
73
+ }
74
+ static {
75
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
76
+ minVersion: "17.0.0",
77
+ version: "22.2.2",
78
+ type: FormlyFieldSelect,
79
+ isStandalone: false,
80
+ selector: "formly-field-mat-select",
81
+ viewQueries: [{
82
+ propertyName: "select",
83
+ first: true,
84
+ predicate: MatSelect,
85
+ descendants: true,
86
+ static: true
87
+ }],
88
+ usesInheritance: true,
89
+ ngImport: i0,
90
+ template: `
71
91
  <ng-template #selectAll let-selectOptions="selectOptions">
72
92
  <mat-option (click)="toggleSelectAll(selectOptions)">
73
93
  <mat-pseudo-checkbox class="mat-option-pseudo-checkbox" [state]="getSelectAllState(selectOptions)">
@@ -94,6 +114,9 @@ class FormlyFieldSelect extends FieldType {
94
114
  [panelClass]="props.panelClass"
95
115
  [panelWidth]="props.panelWidth"
96
116
  >
117
+ @if (props.triggerLabel != null) {
118
+ <mat-select-trigger>{{ triggerLabel }}</mat-select-trigger>
119
+ }
97
120
  @if (props.options | formlySelectOptions: field | async; as selectOptions) {
98
121
  @if (props.multiple && props.selectAllOption) {
99
122
  <ng-container [ngTemplateOutlet]="selectAll" [ngTemplateOutletContext]="{ selectOptions: selectOptions }">
@@ -114,13 +137,141 @@ class FormlyFieldSelect extends FieldType {
114
137
  }
115
138
  }
116
139
  </mat-select>
117
- `, isInline: true, dependencies: [{ 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", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i3.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i3.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 }); }
118
- }
119
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyFieldSelect, decorators: [{
120
- type: Component,
121
- args: [{
122
- selector: 'formly-field-mat-select',
123
- template: `
140
+ `,
141
+ isInline: true,
142
+ dependencies: [
143
+ {
144
+ kind: "directive",
145
+ type: i1.NgTemplateOutlet,
146
+ selector: "[ngTemplateOutlet]",
147
+ inputs: [
148
+ "ngTemplateOutletContext",
149
+ "ngTemplateOutlet",
150
+ "ngTemplateOutletInjector"
151
+ ]
152
+ },
153
+ {
154
+ kind: "directive",
155
+ type: i2.NgControlStatus,
156
+ selector: "[formControlName],[ngModel],[formControl]"
157
+ },
158
+ {
159
+ kind: "directive",
160
+ type: i2.RequiredValidator,
161
+ selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]",
162
+ inputs: ["required"]
163
+ },
164
+ {
165
+ kind: "directive",
166
+ type: i2.FormControlDirective,
167
+ selector: "[formControl]",
168
+ inputs: [
169
+ "formControl",
170
+ "disabled",
171
+ "ngModel"
172
+ ],
173
+ outputs: ["ngModelChange"],
174
+ exportAs: ["ngForm"]
175
+ },
176
+ {
177
+ kind: "component",
178
+ type: i3.MatSelect,
179
+ selector: "mat-select",
180
+ inputs: [
181
+ "aria-describedby",
182
+ "panelClass",
183
+ "disabled",
184
+ "disableRipple",
185
+ "tabIndex",
186
+ "hideSingleSelectionIndicator",
187
+ "placeholder",
188
+ "required",
189
+ "multiple",
190
+ "disableOptionCentering",
191
+ "compareWith",
192
+ "value",
193
+ "aria-label",
194
+ "aria-labelledby",
195
+ "errorStateMatcher",
196
+ "typeaheadDebounceInterval",
197
+ "sortComparator",
198
+ "id",
199
+ "panelWidth",
200
+ "canSelectNullableOptions"
201
+ ],
202
+ outputs: [
203
+ "openedChange",
204
+ "opened",
205
+ "closed",
206
+ "selectionChange",
207
+ "valueChange"
208
+ ],
209
+ exportAs: ["matSelect"]
210
+ },
211
+ {
212
+ kind: "directive",
213
+ type: i3.MatSelectTrigger,
214
+ selector: "mat-select-trigger"
215
+ },
216
+ {
217
+ kind: "component",
218
+ type: i3.MatOption,
219
+ selector: "mat-option",
220
+ inputs: [
221
+ "value",
222
+ "id",
223
+ "disabled"
224
+ ],
225
+ outputs: ["onSelectionChange"],
226
+ exportAs: ["matOption"]
227
+ },
228
+ {
229
+ kind: "component",
230
+ type: i3.MatOptgroup,
231
+ selector: "mat-optgroup",
232
+ inputs: ["label", "disabled"],
233
+ exportAs: ["matOptgroup"]
234
+ },
235
+ {
236
+ kind: "component",
237
+ type: i4.MatPseudoCheckbox,
238
+ selector: "mat-pseudo-checkbox",
239
+ inputs: [
240
+ "state",
241
+ "disabled",
242
+ "appearance"
243
+ ]
244
+ },
245
+ {
246
+ kind: "directive",
247
+ type: i5.LegacyFormlyAttributes,
248
+ selector: "[formlyAttributes]"
249
+ },
250
+ {
251
+ kind: "pipe",
252
+ type: i1.AsyncPipe,
253
+ name: "async"
254
+ },
255
+ {
256
+ kind: "pipe",
257
+ type: i6.LegacyFormlySelectOptionsPipe,
258
+ name: "formlySelectOptions"
259
+ }
260
+ ],
261
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
262
+ });
263
+ }
264
+ };
265
+ i0.ɵɵngDeclareClassMetadata({
266
+ minVersion: "12.0.0",
267
+ version: "22.2.2",
268
+ ngImport: i0,
269
+ type: FormlyFieldSelect,
270
+ decorators: [{
271
+ type: Component,
272
+ args: [{
273
+ selector: "formly-field-mat-select",
274
+ template: `
124
275
  <ng-template #selectAll let-selectOptions="selectOptions">
125
276
  <mat-option (click)="toggleSelectAll(selectOptions)">
126
277
  <mat-pseudo-checkbox class="mat-option-pseudo-checkbox" [state]="getSelectAllState(selectOptions)">
@@ -147,6 +298,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
147
298
  [panelClass]="props.panelClass"
148
299
  [panelWidth]="props.panelWidth"
149
300
  >
301
+ @if (props.triggerLabel != null) {
302
+ <mat-select-trigger>{{ triggerLabel }}</mat-select-trigger>
303
+ }
150
304
  @if (props.options | formlySelectOptions: field | async; as selectOptions) {
151
305
  @if (props.multiple && props.selectAllOption) {
152
306
  <ng-container [ngTemplateOutlet]="selectAll" [ngTemplateOutletContext]="{ selectOptions: selectOptions }">
@@ -168,62 +322,93 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
168
322
  }
169
323
  </mat-select>
170
324
  `,
171
- changeDetection: ChangeDetectionStrategy.OnPush,
172
- standalone: false,
173
- }]
174
- }], propDecorators: { select: [{
175
- type: ViewChild,
176
- args: [MatSelect, { static: true }]
177
- }] } });
178
-
325
+ changeDetection: ChangeDetectionStrategy.OnPush,
326
+ standalone: false
327
+ }]
328
+ }],
329
+ propDecorators: { select: [{
330
+ type: ViewChild,
331
+ args: [MatSelect, { static: true }]
332
+ }] }
333
+ });
179
334
  function withFormlyFieldSelect() {
180
- return {
181
- types: [
182
- {
183
- name: 'select',
184
- component: FormlyFieldSelect,
185
- wrappers: ['form-field'],
186
- },
187
- { name: 'enum', extends: 'select' },
188
- ],
189
- };
190
- }
191
-
192
- class FormlyMatSelectModule {
193
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyMatSelectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
194
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.25", ngImport: i0, type: FormlyMatSelectModule, declarations: [FormlyFieldSelect], imports: [CommonModule,
195
- ReactiveFormsModule,
196
- MatSelectModule,
197
- MatPseudoCheckboxModule,
198
- FormlyMatFormFieldModule,
199
- FormlySelectModule, i5.FormlyModule] }); }
200
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyMatSelectModule, imports: [CommonModule,
201
- ReactiveFormsModule,
202
- MatSelectModule,
203
- MatPseudoCheckboxModule,
204
- FormlyMatFormFieldModule,
205
- FormlySelectModule,
206
- FormlyModule.forChild(withFormlyFieldSelect())] }); }
335
+ return { types: [{
336
+ name: "select",
337
+ component: FormlyFieldSelect,
338
+ wrappers: ["form-field"]
339
+ }, {
340
+ name: "enum",
341
+ extends: "select"
342
+ }] };
207
343
  }
208
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyMatSelectModule, decorators: [{
209
- type: NgModule,
210
- args: [{
211
- declarations: [FormlyFieldSelect],
212
- imports: [
213
- CommonModule,
214
- ReactiveFormsModule,
215
- MatSelectModule,
216
- MatPseudoCheckboxModule,
217
- FormlyMatFormFieldModule,
218
- FormlySelectModule,
219
- FormlyModule.forChild(withFormlyFieldSelect()),
220
- ],
221
- }]
222
- }] });
223
-
224
- /**
225
- * Generated bundle index. Do not edit.
226
- */
227
-
344
+ var FormlyMatSelectModule = class FormlyMatSelectModule {
345
+ static {
346
+ this.ɵfac = i0.ɵɵngDeclareFactory({
347
+ minVersion: "12.0.0",
348
+ version: "22.2.2",
349
+ ngImport: i0,
350
+ type: FormlyMatSelectModule,
351
+ deps: [],
352
+ target: i0.ɵɵFactoryTarget.NgModule
353
+ });
354
+ }
355
+ static {
356
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
357
+ minVersion: "14.0.0",
358
+ version: "22.2.2",
359
+ ngImport: i0,
360
+ type: FormlyMatSelectModule,
361
+ declarations: [FormlyFieldSelect],
362
+ imports: [
363
+ CommonModule,
364
+ ReactiveFormsModule,
365
+ MatSelectModule,
366
+ MatPseudoCheckboxModule,
367
+ FormlyMatFormFieldModule,
368
+ FormlySelectModule,
369
+ i5.FormlyModule
370
+ ]
371
+ });
372
+ }
373
+ static {
374
+ this.ɵinj = i0.ɵɵngDeclareInjector({
375
+ minVersion: "12.0.0",
376
+ version: "22.2.2",
377
+ ngImport: i0,
378
+ type: FormlyMatSelectModule,
379
+ imports: [
380
+ CommonModule,
381
+ ReactiveFormsModule,
382
+ MatSelectModule,
383
+ MatPseudoCheckboxModule,
384
+ FormlyMatFormFieldModule,
385
+ FormlySelectModule,
386
+ FormlyModule.forChild(withFormlyFieldSelect())
387
+ ]
388
+ });
389
+ }
390
+ };
391
+ i0.ɵɵngDeclareClassMetadata({
392
+ minVersion: "12.0.0",
393
+ version: "22.2.2",
394
+ ngImport: i0,
395
+ type: FormlyMatSelectModule,
396
+ decorators: [{
397
+ type: NgModule,
398
+ args: [{
399
+ declarations: [FormlyFieldSelect],
400
+ imports: [
401
+ CommonModule,
402
+ ReactiveFormsModule,
403
+ MatSelectModule,
404
+ MatPseudoCheckboxModule,
405
+ FormlyMatFormFieldModule,
406
+ FormlySelectModule,
407
+ FormlyModule.forChild(withFormlyFieldSelect())
408
+ ]
409
+ }]
410
+ }]
411
+ });
228
412
  export { FormlyFieldSelect, FormlyMatSelectModule, withFormlyFieldSelect };
229
- //# sourceMappingURL=ngx-formly-material-select.mjs.map
413
+
414
+ //# sourceMappingURL=ngx-formly-material-select.mjs.map
@@ -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 panelWidth?: string | number | null;\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 [panelWidth]=\"props.panelWidth\"\n >\n @if (props.options | formlySelectOptions: field | async; as selectOptions) {\n @if (props.multiple && props.selectAllOption) {\n <ng-container [ngTemplateOutlet]=\"selectAll\" [ngTemplateOutletContext]=\"{ selectOptions: selectOptions }\">\n </ng-container>\n }\n @for (item of selectOptions; track $index) {\n @if (item.group) {\n <mat-optgroup [label]=\"item.label\">\n @for (child of item.group; track $index) {\n <mat-option [value]=\"child.value\" [disabled]=\"child.disabled\">\n {{ child.label }}\n </mat-option>\n }\n </mat-optgroup>\n } @else {\n <mat-option [value]=\"item.value\" [disabled]=\"item.disabled\">{{ item.label }}</mat-option>\n }\n }\n }\n </mat-select>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false,\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":";;;;;;;;;;;;;;;;AAyEM,MA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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","names":[],"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"],"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 triggerLabel?: string | ((formValue: any) => string);\n disableOptionCentering?: boolean;\n typeaheadDebounceInterval?: number;\n compareWith?: (o1: any, o2: any) => boolean;\n panelClass?: string;\n panelWidth?: string | number | null;\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 [panelWidth]=\"props.panelWidth\"\n >\n @if (props.triggerLabel != null) {\n <mat-select-trigger>{{ triggerLabel }}</mat-select-trigger>\n }\n @if (props.options | formlySelectOptions: field | async; as selectOptions) {\n @if (props.multiple && props.selectAllOption) {\n <ng-container [ngTemplateOutlet]=\"selectAll\" [ngTemplateOutletContext]=\"{ selectOptions: selectOptions }\">\n </ng-container>\n }\n @for (item of selectOptions; track $index) {\n @if (item.group) {\n <mat-optgroup [label]=\"item.label\">\n @for (child of item.group; track $index) {\n <mat-option [value]=\"child.value\" [disabled]=\"child.disabled\">\n {{ child.label }}\n </mat-option>\n }\n </mat-optgroup>\n } @else {\n <mat-option [value]=\"item.value\" [disabled]=\"item.disabled\">{{ item.label }}</mat-option>\n }\n }\n }\n </mat-select>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false,\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 get triggerLabel() {\n const { triggerLabel, multiple } = this.props;\n if (this.empty || (multiple && this.value.length === 0)) {\n return '';\n }\n\n if (typeof triggerLabel === 'function') {\n return triggerLabel(this.value);\n }\n\n return multiple ? this.value.map((value: any) => value?.[triggerLabel]).join(', ') : this.value?.[triggerLabel];\n }\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"],"mappings":";;;;;;;;;;;;;;;AA6EA,IAAa,oBAAb,MAAa,0BAA0B,UAAuC;CAxD9E,cAAA;;EAgEW,KAAA,iBAAiB,EACxB,OAAO,EACL,YAAY,IAAS,IAAO;GAC1B,OAAO,OAAO;EAChB,EACD,EACF;CA4DF;CAzEC,IAA4C,OAAO,QAAW;EAC5D,SAAQ,QAAQ,CAAC,oBAAoB,YAAY,IAAI,EAAE,mBAAkB;GACvE,IAAI,cACF,OAAO,0BAA0B,OAAO,iBAAiB,0BAAyB;EAEtF,CAAC;CACH;CAWA,IAAI,eAAY;EACd,MAAM,EAAE,cAAc,aAAa,KAAK;EACxC,IAAI,KAAK,SAAU,YAAY,KAAK,MAAM,WAAW,GACnD,OAAO;EAGT,IAAI,OAAO,iBAAiB,YAC1B,OAAO,aAAa,KAAK,KAAK;EAGhC,OAAO,WAAW,KAAK,MAAM,KAAK,UAAe,QAAQ,aAAa,CAAC,CAAC,KAAK,IAAI,IAAI,KAAK,QAAQ;CACpG;CAEA,kBAAkB,SAAc;EAC9B,IAAI,KAAK,SAAS,KAAK,MAAM,WAAW,GACtC,OAAO;EAGT,OAAO,KAAK,MAAM,WAAW,KAAK,kBAAkB,OAAO,CAAC,CAAC,SAAS,kBAAkB;CAC1F;CAEA,gBAAgB,SAAc;EAC5B,MAAM,iBAAiB,KAAK,kBAAkB,OAAO;EACrD,KAAK,YAAY,YAAW;EAC5B,KAAK,YAAY,SAAS,CAAC,KAAK,SAAS,KAAK,MAAM,WAAW,eAAe,SAAS,iBAAiB,CAAA,CAAE;CAC5G;CAEA,OAAO,QAAuB;EAC5B,KAAK,MAAM,SAAS,KAAK,OAAO,MAAM;CACxC;CAEA,qBAAkB;EAChB,IAAI,KAAK,MAAM,aAAa,oBAC1B,OAAO,KAA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