@ngx-formly/material 6.0.0-next.9 → 6.0.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 (108) hide show
  1. package/README.md +4 -3
  2. package/checkbox/checkbox.type.d.ts +13 -6
  3. package/checkbox/public_api.d.ts +1 -1
  4. package/datepicker/datepicker.type.d.ts +37 -8
  5. package/datepicker/public_api.d.ts +1 -1
  6. package/esm2020/checkbox/checkbox.module.mjs +5 -5
  7. package/esm2020/checkbox/checkbox.type.mjs +19 -20
  8. package/esm2020/checkbox/public_api.mjs +1 -1
  9. package/esm2020/datepicker/datepicker.module.mjs +5 -5
  10. package/esm2020/datepicker/datepicker.type.mjs +68 -50
  11. package/esm2020/datepicker/public_api.mjs +1 -1
  12. package/esm2020/form-field/field.type.mjs +19 -21
  13. package/esm2020/form-field/form-field.module.mjs +5 -5
  14. package/esm2020/form-field/form-field.wrapper.mjs +29 -29
  15. package/esm2020/form-field/public_api.mjs +1 -1
  16. package/esm2020/input/input.module.mjs +9 -9
  17. package/esm2020/input/input.type.mjs +17 -17
  18. package/esm2020/input/public_api.mjs +1 -1
  19. package/esm2020/lib/ui-material.module.mjs +5 -5
  20. package/esm2020/multicheckbox/multicheckbox.module.mjs +5 -5
  21. package/esm2020/multicheckbox/multicheckbox.type.mjs +18 -17
  22. package/esm2020/multicheckbox/public_api.mjs +1 -1
  23. package/esm2020/native-select/native-select.module.mjs +5 -5
  24. package/esm2020/native-select/native-select.type.mjs +33 -49
  25. package/esm2020/native-select/public_api.mjs +1 -1
  26. package/esm2020/radio/public_api.mjs +1 -1
  27. package/esm2020/radio/radio.module.mjs +5 -5
  28. package/esm2020/radio/radio.type.mjs +15 -15
  29. package/esm2020/select/public_api.mjs +1 -1
  30. package/esm2020/select/select.module.mjs +5 -5
  31. package/esm2020/select/select.type.mjs +28 -28
  32. package/esm2020/slider/public_api.mjs +1 -1
  33. package/esm2020/slider/slider.module.mjs +5 -5
  34. package/esm2020/slider/slider.type.mjs +31 -31
  35. package/esm2020/textarea/public_api.mjs +1 -1
  36. package/esm2020/textarea/textarea.module.mjs +5 -5
  37. package/esm2020/textarea/textarea.type.mjs +23 -23
  38. package/esm2020/toggle/public_api.mjs +1 -1
  39. package/esm2020/toggle/toggle.module.mjs +5 -5
  40. package/esm2020/toggle/toggle.type.mjs +13 -13
  41. package/fesm2015/ngx-formly-material-checkbox.mjs +22 -23
  42. package/fesm2015/ngx-formly-material-checkbox.mjs.map +1 -1
  43. package/fesm2015/ngx-formly-material-datepicker.mjs +70 -52
  44. package/fesm2015/ngx-formly-material-datepicker.mjs.map +1 -1
  45. package/fesm2015/ngx-formly-material-form-field.mjs +51 -53
  46. package/fesm2015/ngx-formly-material-form-field.mjs.map +1 -1
  47. package/fesm2015/ngx-formly-material-input.mjs +24 -24
  48. package/fesm2015/ngx-formly-material-input.mjs.map +1 -1
  49. package/fesm2015/ngx-formly-material-multicheckbox.mjs +20 -19
  50. package/fesm2015/ngx-formly-material-multicheckbox.mjs.map +1 -1
  51. package/fesm2015/ngx-formly-material-native-select.mjs +36 -52
  52. package/fesm2015/ngx-formly-material-native-select.mjs.map +1 -1
  53. package/fesm2015/ngx-formly-material-radio.mjs +18 -18
  54. package/fesm2015/ngx-formly-material-radio.mjs.map +1 -1
  55. package/fesm2015/ngx-formly-material-select.mjs +31 -31
  56. package/fesm2015/ngx-formly-material-select.mjs.map +1 -1
  57. package/fesm2015/ngx-formly-material-slider.mjs +34 -34
  58. package/fesm2015/ngx-formly-material-slider.mjs.map +1 -1
  59. package/fesm2015/ngx-formly-material-textarea.mjs +26 -26
  60. package/fesm2015/ngx-formly-material-textarea.mjs.map +1 -1
  61. package/fesm2015/ngx-formly-material-toggle.mjs +16 -16
  62. package/fesm2015/ngx-formly-material-toggle.mjs.map +1 -1
  63. package/fesm2015/ngx-formly-material.mjs +4 -4
  64. package/fesm2015/ngx-formly-material.mjs.map +1 -1
  65. package/fesm2020/ngx-formly-material-checkbox.mjs +22 -23
  66. package/fesm2020/ngx-formly-material-checkbox.mjs.map +1 -1
  67. package/fesm2020/ngx-formly-material-datepicker.mjs +70 -52
  68. package/fesm2020/ngx-formly-material-datepicker.mjs.map +1 -1
  69. package/fesm2020/ngx-formly-material-form-field.mjs +50 -52
  70. package/fesm2020/ngx-formly-material-form-field.mjs.map +1 -1
  71. package/fesm2020/ngx-formly-material-input.mjs +24 -24
  72. package/fesm2020/ngx-formly-material-input.mjs.map +1 -1
  73. package/fesm2020/ngx-formly-material-multicheckbox.mjs +20 -19
  74. package/fesm2020/ngx-formly-material-multicheckbox.mjs.map +1 -1
  75. package/fesm2020/ngx-formly-material-native-select.mjs +36 -52
  76. package/fesm2020/ngx-formly-material-native-select.mjs.map +1 -1
  77. package/fesm2020/ngx-formly-material-radio.mjs +18 -18
  78. package/fesm2020/ngx-formly-material-radio.mjs.map +1 -1
  79. package/fesm2020/ngx-formly-material-select.mjs +31 -31
  80. package/fesm2020/ngx-formly-material-select.mjs.map +1 -1
  81. package/fesm2020/ngx-formly-material-slider.mjs +34 -34
  82. package/fesm2020/ngx-formly-material-slider.mjs.map +1 -1
  83. package/fesm2020/ngx-formly-material-textarea.mjs +26 -26
  84. package/fesm2020/ngx-formly-material-textarea.mjs.map +1 -1
  85. package/fesm2020/ngx-formly-material-toggle.mjs +16 -16
  86. package/fesm2020/ngx-formly-material-toggle.mjs.map +1 -1
  87. package/fesm2020/ngx-formly-material.mjs +4 -4
  88. package/fesm2020/ngx-formly-material.mjs.map +1 -1
  89. package/form-field/field.type.d.ts +6 -6
  90. package/form-field/form-field.wrapper.d.ts +4 -7
  91. package/form-field/public_api.d.ts +1 -1
  92. package/input/input.type.d.ts +10 -3
  93. package/input/public_api.d.ts +1 -1
  94. package/multicheckbox/multicheckbox.type.d.ts +12 -5
  95. package/multicheckbox/public_api.d.ts +1 -1
  96. package/native-select/native-select.type.d.ts +11 -3
  97. package/native-select/public_api.d.ts +1 -1
  98. package/package.json +2 -2
  99. package/radio/public_api.d.ts +1 -1
  100. package/radio/radio.type.d.ts +12 -5
  101. package/select/public_api.d.ts +1 -1
  102. package/select/select.type.d.ts +17 -4
  103. package/slider/public_api.d.ts +1 -1
  104. package/slider/slider.type.d.ts +20 -5
  105. package/textarea/public_api.d.ts +1 -1
  106. package/textarea/textarea.type.d.ts +14 -4
  107. package/toggle/public_api.d.ts +1 -1
  108. package/toggle/toggle.type.d.ts +12 -4
@@ -9,7 +9,7 @@ export class FormlyFieldToggle extends FieldType {
9
9
  constructor() {
10
10
  super(...arguments);
11
11
  this.defaultOptions = {
12
- templateOptions: {
12
+ props: {
13
13
  hideFieldUnderline: true,
14
14
  floatLabel: 'always',
15
15
  hideLabel: true,
@@ -21,21 +21,21 @@ export class FormlyFieldToggle extends FieldType {
21
21
  super.onContainerClick(event);
22
22
  }
23
23
  }
24
- FormlyFieldToggle.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyFieldToggle, deps: null, target: i0.ɵɵFactoryTarget.Component });
25
- FormlyFieldToggle.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.6", type: FormlyFieldToggle, selector: "formly-field-mat-toggle", viewQueries: [{ propertyName: "slideToggle", first: true, predicate: MatSlideToggle, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
24
+ FormlyFieldToggle.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyFieldToggle, deps: null, target: i0.ɵɵFactoryTarget.Component });
25
+ FormlyFieldToggle.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FormlyFieldToggle, selector: "formly-field-mat-toggle", viewQueries: [{ propertyName: "slideToggle", first: true, predicate: MatSlideToggle, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
26
26
  <mat-slide-toggle
27
27
  [id]="id"
28
28
  [formControl]="formControl"
29
29
  [formlyAttributes]="field"
30
- [color]="to.color"
31
- [tabIndex]="to.tabindex"
30
+ [color]="props.color"
31
+ [tabIndex]="props.tabindex"
32
32
  [required]="required"
33
- [labelPosition]="to.labelPosition"
33
+ [labelPosition]="props.labelPosition"
34
34
  >
35
- {{ to.label }}
35
+ {{ props.label }}
36
36
  </mat-slide-toggle>
37
37
  `, isInline: true, components: [{ type: i1.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["disabled", "disableRipple", "color", "tabIndex", "name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "checked"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }], directives: [{ type: i1.MatSlideToggleRequiredValidator, selector: "mat-slide-toggle[required][formControlName], mat-slide-toggle[required][formControl], mat-slide-toggle[required][ngModel]" }, { type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
38
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyFieldToggle, decorators: [{
38
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyFieldToggle, decorators: [{
39
39
  type: Component,
40
40
  args: [{
41
41
  selector: 'formly-field-mat-toggle',
@@ -44,12 +44,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImpor
44
44
  [id]="id"
45
45
  [formControl]="formControl"
46
46
  [formlyAttributes]="field"
47
- [color]="to.color"
48
- [tabIndex]="to.tabindex"
47
+ [color]="props.color"
48
+ [tabIndex]="props.tabindex"
49
49
  [required]="required"
50
- [labelPosition]="to.labelPosition"
50
+ [labelPosition]="props.labelPosition"
51
51
  >
52
- {{ to.label }}
52
+ {{ props.label }}
53
53
  </mat-slide-toggle>
54
54
  `,
55
55
  changeDetection: ChangeDetectionStrategy.OnPush,
@@ -58,4 +58,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImpor
58
58
  type: ViewChild,
59
59
  args: [MatSlideToggle, { static: true }]
60
60
  }] } });
61
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9nZ2xlLnR5cGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvdWkvbWF0ZXJpYWwvdG9nZ2xlL3NyYy90b2dnbGUudHlwZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLHVCQUF1QixFQUFFLFNBQVMsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUU5RSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDNUQsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLGdDQUFnQyxDQUFDOzs7OztBQW1CaEUsTUFBTSxPQUFPLGlCQUFrQixTQUFRLFNBQTBCO0lBakJqRTs7UUFtQlcsbUJBQWMsR0FBRztZQUN4QixlQUFlLEVBQUU7Z0JBQ2Ysa0JBQWtCLEVBQUUsSUFBSTtnQkFDeEIsVUFBVSxFQUFFLFFBQWlCO2dCQUM3QixTQUFTLEVBQUUsSUFBSTthQUNoQjtTQUNGLENBQUM7S0FNSDtJQUpVLGdCQUFnQixDQUFDLEtBQWlCO1FBQ3pDLElBQUksQ0FBQyxXQUFXLENBQUMsS0FBSyxFQUFFLENBQUM7UUFDekIsS0FBSyxDQUFDLGdCQUFnQixDQUFDLEtBQUssQ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cInByb3BzLmxhYmVsUG9zaXRpb25cIlxuICAgID5cbiAgICAgIHt7IHByb3BzLmxhYmVsIH19XG4gICAgPC9tYXQtc2xpZGUtdG9nZ2xlPlxuICBgLFxuICBjaGFuZ2VEZXRlY3Rpb246IENoYW5nZURldGVjdGlvblN0cmF0ZWd5Lk9uUHVzaCxcbn0pXG5leHBvcnQgY2xhc3MgRm9ybWx5RmllbGRUb2dnbGUgZXh0ZW5kcyBGaWVsZFR5cGU8RmllbGRUeXBlQ29uZmlnPFRvZ2dsZVByb3BzPj4ge1xuICBAVmlld0NoaWxkKE1hdFNsaWRlVG9nZ2xlLCB7IHN0YXRpYzogdHJ1ZSB9KSBzbGlkZVRvZ2dsZSE6IE1hdFNsaWRlVG9nZ2xlO1xuICBvdmVycmlkZSBkZWZhdWx0T3B0aW9ucyA9IHtcbiAgICBwcm9wczoge1xuICAgICAgaGlkZUZpZWxkVW5kZXJsaW5lOiB0cnVlLFxuICAgICAgZmxvYXRMYWJlbDogJ2Fsd2F5cycgYXMgY29uc3QsXG4gICAgICBoaWRlTGFiZWw6IHRydWUsXG4gICAgfSxcbiAgfTtcblxuICBvdmVycmlkZSBvbkNvbnRhaW5lckNsaWNrKGV2ZW50OiBNb3VzZUV2ZW50KTogdm9pZCB7XG4gICAgdGhpcy5zbGlkZVRvZ2dsZS5mb2N1cygpO1xuICAgIHN1cGVyLm9uQ29udGFpbmVyQ2xpY2soZXZlbnQpO1xuICB9XG59XG4iXX0=
@@ -17,12 +17,11 @@ class FormlyFieldCheckbox extends FieldType {
17
17
  this.renderer = renderer;
18
18
  this.focusMonitor = focusMonitor;
19
19
  this.defaultOptions = {
20
- templateOptions: {
20
+ props: {
21
21
  hideFieldUnderline: true,
22
22
  indeterminate: true,
23
23
  floatLabel: 'always',
24
24
  hideLabel: true,
25
- align: 'start',
26
25
  color: 'accent', // workaround for https://github.com/angular/components/issues/18465
27
26
  },
28
27
  };
@@ -35,10 +34,10 @@ class FormlyFieldCheckbox extends FieldType {
35
34
  if (this.checkbox) {
36
35
  this.focusMonitor.monitor(this.checkbox._inputElement, true).subscribe((focusOrigin) => {
37
36
  if (focusOrigin) {
38
- this.to.focus && this.to.focus(this.field);
37
+ this.props.focus && this.props.focus(this.field);
39
38
  }
40
39
  else {
41
- this.to.blur && this.to.blur(this.field);
40
+ this.props.blur && this.props.blur(this.field);
42
41
  }
43
42
  });
44
43
  }
@@ -62,27 +61,27 @@ class FormlyFieldCheckbox extends FieldType {
62
61
  }
63
62
  }
64
63
  }
65
- FormlyFieldCheckbox.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyFieldCheckbox, deps: [{ token: i0.Renderer2 }, { token: i1.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component });
66
- FormlyFieldCheckbox.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.6", type: FormlyFieldCheckbox, selector: "formly-field-mat-checkbox", viewQueries: [{ propertyName: "checkbox", first: true, predicate: MatCheckbox, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
64
+ FormlyFieldCheckbox.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyFieldCheckbox, deps: [{ token: i0.Renderer2 }, { token: i1.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component });
65
+ FormlyFieldCheckbox.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FormlyFieldCheckbox, selector: "formly-field-mat-checkbox", viewQueries: [{ propertyName: "checkbox", first: true, predicate: MatCheckbox, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
67
66
  <mat-checkbox
68
67
  [formControl]="formControl"
69
68
  [id]="id"
70
69
  [formlyAttributes]="field"
71
- [tabIndex]="to.tabindex"
72
- [indeterminate]="to.indeterminate && formControl.value == null"
73
- [color]="to.color"
74
- [labelPosition]="to.align || to.labelPosition"
70
+ [tabIndex]="props.tabindex"
71
+ [indeterminate]="props.indeterminate && formControl.value == null"
72
+ [color]="props.color"
73
+ [labelPosition]="props.labelPosition"
75
74
  >
76
- {{ to.label }}
75
+ {{ props.label }}
77
76
  <span
78
- *ngIf="to.required && to.hideRequiredMarker !== true"
77
+ *ngIf="props.required && props.hideRequiredMarker !== true"
79
78
  aria-hidden="true"
80
79
  class="mat-form-field-required-marker"
81
80
  >*</span
82
81
  >
83
82
  </mat-checkbox>
84
83
  `, isInline: true, components: [{ type: i2.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }], directives: [{ type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i4.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
85
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyFieldCheckbox, decorators: [{
84
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyFieldCheckbox, decorators: [{
86
85
  type: Component,
87
86
  args: [{
88
87
  selector: 'formly-field-mat-checkbox',
@@ -91,14 +90,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImpor
91
90
  [formControl]="formControl"
92
91
  [id]="id"
93
92
  [formlyAttributes]="field"
94
- [tabIndex]="to.tabindex"
95
- [indeterminate]="to.indeterminate && formControl.value == null"
96
- [color]="to.color"
97
- [labelPosition]="to.align || to.labelPosition"
93
+ [tabIndex]="props.tabindex"
94
+ [indeterminate]="props.indeterminate && formControl.value == null"
95
+ [color]="props.color"
96
+ [labelPosition]="props.labelPosition"
98
97
  >
99
- {{ to.label }}
98
+ {{ props.label }}
100
99
  <span
101
- *ngIf="to.required && to.hideRequiredMarker !== true"
100
+ *ngIf="props.required && props.hideRequiredMarker !== true"
102
101
  aria-hidden="true"
103
102
  class="mat-form-field-required-marker"
104
103
  >*</span
@@ -114,12 +113,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImpor
114
113
 
115
114
  class FormlyMatCheckboxModule {
116
115
  }
117
- FormlyMatCheckboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyMatCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
118
- FormlyMatCheckboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyMatCheckboxModule, declarations: [FormlyFieldCheckbox], imports: [CommonModule,
116
+ FormlyMatCheckboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
117
+ FormlyMatCheckboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatCheckboxModule, declarations: [FormlyFieldCheckbox], imports: [CommonModule,
119
118
  ReactiveFormsModule,
120
119
  MatCheckboxModule,
121
120
  FormlyMatFormFieldModule, i4.FormlyModule] });
122
- FormlyMatCheckboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyMatCheckboxModule, imports: [[
121
+ FormlyMatCheckboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatCheckboxModule, imports: [[
123
122
  CommonModule,
124
123
  ReactiveFormsModule,
125
124
  MatCheckboxModule,
@@ -138,7 +137,7 @@ FormlyMatCheckboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0",
138
137
  ],
139
138
  }),
140
139
  ]] });
141
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyMatCheckboxModule, decorators: [{
140
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatCheckboxModule, decorators: [{
142
141
  type: NgModule,
143
142
  args: [{
144
143
  declarations: [FormlyFieldCheckbox],
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-formly-material-checkbox.mjs","sources":["../../../../src/ui/material/checkbox/src/checkbox.type.ts","../../../../src/ui/material/checkbox/src/checkbox.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} from '@angular/core';\nimport { FieldTypeConfig } from '@ngx-formly/core';\nimport { FieldType } from '@ngx-formly/material/form-field';\nimport { MatCheckbox } from '@angular/material/checkbox';\nimport { FocusMonitor } from '@angular/cdk/a11y';\n\n@Component({\n selector: 'formly-field-mat-checkbox',\n template: `\n <mat-checkbox\n [formControl]=\"formControl\"\n [id]=\"id\"\n [formlyAttributes]=\"field\"\n [tabIndex]=\"to.tabindex\"\n [indeterminate]=\"to.indeterminate && formControl.value == null\"\n [color]=\"to.color\"\n [labelPosition]=\"to.align || to.labelPosition\"\n >\n {{ to.label }}\n <span\n *ngIf=\"to.required && to.hideRequiredMarker !== true\"\n aria-hidden=\"true\"\n class=\"mat-form-field-required-marker\"\n >*</span\n >\n </mat-checkbox>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldCheckbox\n extends FieldType<FieldTypeConfig>\n implements AfterViewInit, AfterViewChecked, OnDestroy\n{\n @ViewChild(MatCheckbox, { static: true }) checkbox!: MatCheckbox;\n override defaultOptions = {\n templateOptions: {\n hideFieldUnderline: true,\n indeterminate: true,\n floatLabel: 'always' as const,\n hideLabel: true,\n align: 'start', // start or end\n color: 'accent' as const, // workaround for https://github.com/angular/components/issues/18465\n },\n };\n\n private _required!: boolean;\n constructor(private renderer: Renderer2, private focusMonitor: FocusMonitor) {\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 if (focusOrigin) {\n this.to.focus && this.to.focus(this.field);\n } else {\n this.to.blur && this.to.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 { 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';\n\n@NgModule({\n declarations: [FormlyFieldCheckbox],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n\n MatCheckboxModule,\n\n FormlyMatFormFieldModule,\n FormlyModule.forChild({\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})\nexport class FormlyMatCheckboxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;AAqCM,MAAO,mBACX,SAAQ,SAA0B,CAAA;IAgBlC,WAAoB,CAAA,QAAmB,EAAU,YAA0B,EAAA;AACzE,QAAA,KAAK,EAAE,CAAC;AADU,QAAA,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAW;AAAU,QAAA,IAAY,CAAA,YAAA,GAAZ,YAAY,CAAc;QAZlE,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,eAAe,EAAE;AACf,gBAAA,kBAAkB,EAAE,IAAI;AACxB,gBAAA,aAAa,EAAE,IAAI;AACnB,gBAAA,UAAU,EAAE,QAAiB;AAC7B,gBAAA,SAAS,EAAE,IAAI;AACf,gBAAA,KAAK,EAAE,OAAO;gBACd,KAAK,EAAE,QAAiB;AACzB,aAAA;SACF,CAAC;KAKD;AAEQ,IAAA,gBAAgB,CAAC,KAAiB,EAAA;AACzC,QAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;AACtB,QAAA,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;KAC/B;IAED,eAAe,GAAA;QACb,IAAI,IAAI,CAAC,QAAQ,EAAE;AACjB,YAAA,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,KAAI;AACrF,gBAAA,IAAI,WAAW,EAAE;AACf,oBAAA,IAAI,CAAC,EAAE,CAAC,KAAK,IAAI,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC5C,iBAAA;AAAM,qBAAA;AACL,oBAAA,IAAI,CAAC,EAAE,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,CAAC,IA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AAA;oBACR,YAAY,EAAE,CAAC,mBAAmB,CAAC;AACnC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBAEnB,iBAAiB;wBAEjB,wBAAwB;wBACxB,YAAY,CAAC,QAAQ,CAAC;AACpB,4BAAA,KAAK,EAAE;AACL,gCAAA;AACE,oCAAA,IAAI,EAAE,UAAU;AAChB,oCAAA,SAAS,EAAE,mBAAmB;oCAC9B,QAAQ,EAAE,CAAC,YAAY,CAAC;AACzB,iCAAA;AACD,gCAAA;AACE,oCAAA,IAAI,EAAE,SAAS;AACf,oCAAA,OAAO,EAAE,UAAU;AACpB,iCAAA;AACF,6BAAA;yBACF,CAAC;AACH,qBAAA;iBACF,CAAA;;;ACjCD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-formly-material-checkbox.mjs","sources":["../../../../src/ui/material/checkbox/src/checkbox.type.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 [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\"\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(private renderer: Renderer2, private focusMonitor: FocusMonitor) {\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 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 { 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';\n\n@NgModule({\n declarations: [FormlyFieldCheckbox],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n\n MatCheckboxModule,\n\n FormlyMatFormFieldModule,\n FormlyModule.forChild({\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})\nexport class FormlyMatCheckboxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;AA+CM,MAAO,mBACX,SAAQ,SAAyC,CAAA;IAejD,WAAoB,CAAA,QAAmB,EAAU,YAA0B,EAAA;AACzE,QAAA,KAAK,EAAE,CAAC;AADU,QAAA,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAW;AAAU,QAAA,IAAY,CAAA,YAAA,GAAZ,YAAY,CAAc;QAXlE,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,KAAK,EAAE;AACL,gBAAA,kBAAkB,EAAE,IAAI;AACxB,gBAAA,aAAa,EAAE,IAAI;AACnB,gBAAA,UAAU,EAAE,QAAiB;AAC7B,gBAAA,SAAS,EAAE,IAAI;gBACf,KAAK,EAAE,QAAiB;AACzB,aAAA;SACF,CAAC;KAKD;AAEQ,IAAA,gBAAgB,CAAC,KAAiB,EAAA;AACzC,QAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;AACtB,QAAA,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;KAC/B;IAED,eAAe,GAAA;QACb,IAAI,IAAI,CAAC,QAAQ,EAAE;AACjB,YAAA,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,KAAI;AACrF,gBAAA,IAAI,WAAW,EAAE;AACf,oBAAA,IAAI,CAAC,KAAK,CAAC,KAAK,I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wBAAA,OAAO,EAAE,UAAU;AACpB,qBAAA;AACF,iBAAA;aACF,CAAC;SACH,CAAA,EAAA,CAAA,CAAA;4FAEU,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAxBnC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,mBAAmB,CAAC;AACnC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBAEnB,iBAAiB;wBAEjB,wBAAwB;wBACxB,YAAY,CAAC,QAAQ,CAAC;AACpB,4BAAA,KAAK,EAAE;AACL,gCAAA;AACE,oCAAA,IAAI,EAAE,UAAU;AAChB,oCAAA,SAAS,EAAE,mBAAmB;oCAC9B,QAAQ,EAAE,CAAC,YAAY,CAAC;AACzB,iCAAA;AACD,gCAAA;AACE,oCAAA,IAAI,EAAE,SAAS;AACf,oCAAA,OAAO,EAAE,UAAU;AACpB,iCAAA;AACF,6BAAA;yBACF,CAAC;AACH,qBAAA;iBACF,CAAA;;;ACjCD;;AAEG;;;;"}
@@ -12,14 +12,17 @@ import * as i2 from '@angular/material/datepicker';
12
12
  import { MatDatepickerModule } from '@angular/material/datepicker';
13
13
 
14
14
  class FormlyFieldDatepicker extends FieldType {
15
- constructor(config) {
15
+ constructor(config, cdRef) {
16
16
  super();
17
17
  this.config = config;
18
+ this.cdRef = cdRef;
18
19
  this.defaultOptions = {
19
- templateOptions: {
20
+ props: {
20
21
  datepickerOptions: {
21
22
  startView: 'month',
22
23
  datepickerTogglePosition: 'suffix',
24
+ disabled: false,
25
+ opened: false,
23
26
  dateInput: () => { },
24
27
  dateChange: () => { },
25
28
  monthSelected: () => { },
@@ -33,12 +36,15 @@ class FormlyFieldDatepicker extends FieldType {
33
36
  (_b = (_a = this.options).detectChanges) === null || _b === void 0 ? void 0 : _b.call(_a, this.field);
34
37
  }
35
38
  ngAfterViewInit() {
36
- this.to[this.to.datepickerOptions.datepickerTogglePosition] = this.datepickerToggle;
39
+ this.props[this.props.datepickerOptions.datepickerTogglePosition] = this.datepickerToggle;
40
+ ɵobserve(this.field, ['props', 'datepickerOptions', 'opened'], () => {
41
+ this.cdRef.detectChanges();
42
+ });
37
43
  // temporary fix for https://github.com/angular/components/issues/16761
38
44
  if (this.config.getValidatorMessage('matDatepickerParse')) {
39
45
  this.fieldErrorsObserver = ɵobserve(this.field, ['formControl', 'errors'], ({ currentValue }) => {
40
46
  var _a;
41
- if (currentValue.required && currentValue.matDatepickerParse) {
47
+ if (currentValue && currentValue.required && currentValue.matDatepickerParse) {
42
48
  const errors = Object.keys(currentValue)
43
49
  .sort((prop) => (prop === 'matDatepickerParse' ? -1 : 0))
44
50
  .reduce((errors, prop) => (Object.assign(Object.assign({}, errors), { [prop]: currentValue[prop] })), {});
@@ -53,45 +59,51 @@ class FormlyFieldDatepicker extends FieldType {
53
59
  (_a = this.fieldErrorsObserver) === null || _a === void 0 ? void 0 : _a.unsubscribe();
54
60
  }
55
61
  }
56
- FormlyFieldDatepicker.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyFieldDatepicker, deps: [{ token: i1.FormlyConfig }], target: i0.ɵɵFactoryTarget.Component });
57
- FormlyFieldDatepicker.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.6", type: FormlyFieldDatepicker, selector: "formly-field-mat-datepicker", viewQueries: [{ propertyName: "datepickerToggle", first: true, predicate: ["datepickerToggle"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
62
+ FormlyFieldDatepicker.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyFieldDatepicker, deps: [{ token: i1.FormlyConfig }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
63
+ FormlyFieldDatepicker.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FormlyFieldDatepicker, selector: "formly-field-mat-datepicker", viewQueries: [{ propertyName: "datepickerToggle", first: true, predicate: ["datepickerToggle"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
58
64
  <input
59
65
  matInput
60
66
  [id]="id"
61
67
  [errorStateMatcher]="errorStateMatcher"
62
68
  [formControl]="formControl"
63
69
  [matDatepicker]="picker"
64
- [matDatepickerFilter]="to.datepickerOptions.filter"
65
- [max]="to.datepickerOptions.max"
66
- [min]="to.datepickerOptions.min"
70
+ [matDatepickerFilter]="props.datepickerOptions.filter"
71
+ [max]="props.datepickerOptions.max"
72
+ [min]="props.datepickerOptions.min"
67
73
  [formlyAttributes]="field"
68
- [placeholder]="to.placeholder"
69
- [tabindex]="to.tabindex"
70
- [readonly]="to.readonly"
74
+ [placeholder]="props.placeholder"
75
+ [tabindex]="props.tabindex"
76
+ [readonly]="props.readonly"
71
77
  [required]="required"
72
- (dateInput)="to.datepickerOptions.dateInput(field, $event)"
73
- (dateChange)="to.datepickerOptions.dateChange(field, $event)"
78
+ (dateInput)="props.datepickerOptions.dateInput(field, $event)"
79
+ (dateChange)="props.datepickerOptions.dateChange(field, $event)"
74
80
  />
75
81
  <ng-template #datepickerToggle>
76
- <mat-datepicker-toggle (click)="detectChanges()" [disabled]="to.disabled" [for]="picker"></mat-datepicker-toggle>
82
+ <mat-datepicker-toggle
83
+ (click)="detectChanges()"
84
+ [disabled]="props.disabled"
85
+ [for]="picker"
86
+ ></mat-datepicker-toggle>
77
87
  </ng-template>
78
88
  <mat-datepicker
79
89
  #picker
80
- [color]="to.color"
81
- [dateClass]="to.datepickerOptions.dateClass"
82
- [disabled]="to.datepickerOptions.disabled"
83
- [opened]="to.datepickerOptions.opened"
84
- [panelClass]="to.datepickerOptions.panelClass"
85
- [startAt]="to.datepickerOptions.startAt"
86
- [startView]="to.datepickerOptions.startView"
87
- [touchUi]="to.datepickerOptions.touchUi"
88
- [calendarHeaderComponent]="to.datepickerOptions.calendarHeaderComponent"
89
- (monthSelected)="to.datepickerOptions.monthSelected(field, $event, picker)"
90
- (yearSelected)="to.datepickerOptions.yearSelected(field, $event, picker)"
90
+ [color]="props.color"
91
+ [dateClass]="props.datepickerOptions.dateClass"
92
+ [disabled]="props.datepickerOptions.disabled"
93
+ [opened]="props.datepickerOptions.opened"
94
+ [panelClass]="props.datepickerOptions.panelClass"
95
+ [startAt]="props.datepickerOptions.startAt"
96
+ [startView]="props.datepickerOptions.startView"
97
+ [touchUi]="props.datepickerOptions.touchUi"
98
+ [calendarHeaderComponent]="props.datepickerOptions.calendarHeaderComponent"
99
+ (monthSelected)="props.datepickerOptions.monthSelected(field, $event, picker)"
100
+ (yearSelected)="props.datepickerOptions.yearSelected(field, $event, picker)"
101
+ (opened)="props.datepickerOptions.opened = true"
102
+ (closed)="props.datepickerOptions.opened = false"
91
103
  >
92
104
  </mat-datepicker>
93
105
  `, isInline: true, components: [{ type: i2.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { type: i2.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }], directives: [{ 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"] }, { type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i2.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i1.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
94
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyFieldDatepicker, decorators: [{
106
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyFieldDatepicker, decorators: [{
95
107
  type: Component,
96
108
  args: [{
97
109
  selector: 'formly-field-mat-datepicker',
@@ -102,52 +114,58 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImpor
102
114
  [errorStateMatcher]="errorStateMatcher"
103
115
  [formControl]="formControl"
104
116
  [matDatepicker]="picker"
105
- [matDatepickerFilter]="to.datepickerOptions.filter"
106
- [max]="to.datepickerOptions.max"
107
- [min]="to.datepickerOptions.min"
117
+ [matDatepickerFilter]="props.datepickerOptions.filter"
118
+ [max]="props.datepickerOptions.max"
119
+ [min]="props.datepickerOptions.min"
108
120
  [formlyAttributes]="field"
109
- [placeholder]="to.placeholder"
110
- [tabindex]="to.tabindex"
111
- [readonly]="to.readonly"
121
+ [placeholder]="props.placeholder"
122
+ [tabindex]="props.tabindex"
123
+ [readonly]="props.readonly"
112
124
  [required]="required"
113
- (dateInput)="to.datepickerOptions.dateInput(field, $event)"
114
- (dateChange)="to.datepickerOptions.dateChange(field, $event)"
125
+ (dateInput)="props.datepickerOptions.dateInput(field, $event)"
126
+ (dateChange)="props.datepickerOptions.dateChange(field, $event)"
115
127
  />
116
128
  <ng-template #datepickerToggle>
117
- <mat-datepicker-toggle (click)="detectChanges()" [disabled]="to.disabled" [for]="picker"></mat-datepicker-toggle>
129
+ <mat-datepicker-toggle
130
+ (click)="detectChanges()"
131
+ [disabled]="props.disabled"
132
+ [for]="picker"
133
+ ></mat-datepicker-toggle>
118
134
  </ng-template>
119
135
  <mat-datepicker
120
136
  #picker
121
- [color]="to.color"
122
- [dateClass]="to.datepickerOptions.dateClass"
123
- [disabled]="to.datepickerOptions.disabled"
124
- [opened]="to.datepickerOptions.opened"
125
- [panelClass]="to.datepickerOptions.panelClass"
126
- [startAt]="to.datepickerOptions.startAt"
127
- [startView]="to.datepickerOptions.startView"
128
- [touchUi]="to.datepickerOptions.touchUi"
129
- [calendarHeaderComponent]="to.datepickerOptions.calendarHeaderComponent"
130
- (monthSelected)="to.datepickerOptions.monthSelected(field, $event, picker)"
131
- (yearSelected)="to.datepickerOptions.yearSelected(field, $event, picker)"
137
+ [color]="props.color"
138
+ [dateClass]="props.datepickerOptions.dateClass"
139
+ [disabled]="props.datepickerOptions.disabled"
140
+ [opened]="props.datepickerOptions.opened"
141
+ [panelClass]="props.datepickerOptions.panelClass"
142
+ [startAt]="props.datepickerOptions.startAt"
143
+ [startView]="props.datepickerOptions.startView"
144
+ [touchUi]="props.datepickerOptions.touchUi"
145
+ [calendarHeaderComponent]="props.datepickerOptions.calendarHeaderComponent"
146
+ (monthSelected)="props.datepickerOptions.monthSelected(field, $event, picker)"
147
+ (yearSelected)="props.datepickerOptions.yearSelected(field, $event, picker)"
148
+ (opened)="props.datepickerOptions.opened = true"
149
+ (closed)="props.datepickerOptions.opened = false"
132
150
  >
133
151
  </mat-datepicker>
134
152
  `,
135
153
  changeDetection: ChangeDetectionStrategy.OnPush,
136
154
  }]
137
- }], ctorParameters: function () { return [{ type: i1.FormlyConfig }]; }, propDecorators: { datepickerToggle: [{
155
+ }], ctorParameters: function () { return [{ type: i1.FormlyConfig }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { datepickerToggle: [{
138
156
  type: ViewChild,
139
157
  args: ['datepickerToggle', { static: true }]
140
158
  }] } });
141
159
 
142
160
  class FormlyMatDatepickerModule {
143
161
  }
144
- FormlyMatDatepickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyMatDatepickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
145
- FormlyMatDatepickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyMatDatepickerModule, declarations: [FormlyFieldDatepicker], imports: [CommonModule,
162
+ FormlyMatDatepickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatDatepickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
163
+ FormlyMatDatepickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatDatepickerModule, declarations: [FormlyFieldDatepicker], imports: [CommonModule,
146
164
  ReactiveFormsModule,
147
165
  MatInputModule,
148
166
  MatDatepickerModule,
149
167
  FormlyMatFormFieldModule, i1.FormlyModule] });
150
- FormlyMatDatepickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyMatDatepickerModule, imports: [[
168
+ FormlyMatDatepickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatDatepickerModule, imports: [[
151
169
  CommonModule,
152
170
  ReactiveFormsModule,
153
171
  MatInputModule,
@@ -163,7 +181,7 @@ FormlyMatDatepickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0
163
181
  ],
164
182
  }),
165
183
  ]] });
166
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyMatDatepickerModule, decorators: [{
184
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatDatepickerModule, decorators: [{
167
185
  type: NgModule,
168
186
  args: [{
169
187
  declarations: [FormlyFieldDatepicker],
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-formly-material-datepicker.mjs","sources":["../../../../src/ui/material/datepicker/src/datepicker.type.ts","../../../../src/ui/material/datepicker/src/datepicker.module.ts","../../../../src/ui/material/datepicker/src/ngx-formly-material-datepicker.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, ViewChild, AfterViewInit, OnDestroy, TemplateRef } from '@angular/core';\nimport { FieldTypeConfig, FormlyConfig, ɵobserve as observe } from '@ngx-formly/core';\nimport { FieldType } from '@ngx-formly/material/form-field';\n\n@Component({\n selector: 'formly-field-mat-datepicker',\n template: `\n <input\n matInput\n [id]=\"id\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [formControl]=\"formControl\"\n [matDatepicker]=\"picker\"\n [matDatepickerFilter]=\"to.datepickerOptions.filter\"\n [max]=\"to.datepickerOptions.max\"\n [min]=\"to.datepickerOptions.min\"\n [formlyAttributes]=\"field\"\n [placeholder]=\"to.placeholder\"\n [tabindex]=\"to.tabindex\"\n [readonly]=\"to.readonly\"\n [required]=\"required\"\n (dateInput)=\"to.datepickerOptions.dateInput(field, $event)\"\n (dateChange)=\"to.datepickerOptions.dateChange(field, $event)\"\n />\n <ng-template #datepickerToggle>\n <mat-datepicker-toggle (click)=\"detectChanges()\" [disabled]=\"to.disabled\" [for]=\"picker\"></mat-datepicker-toggle>\n </ng-template>\n <mat-datepicker\n #picker\n [color]=\"to.color\"\n [dateClass]=\"to.datepickerOptions.dateClass\"\n [disabled]=\"to.datepickerOptions.disabled\"\n [opened]=\"to.datepickerOptions.opened\"\n [panelClass]=\"to.datepickerOptions.panelClass\"\n [startAt]=\"to.datepickerOptions.startAt\"\n [startView]=\"to.datepickerOptions.startView\"\n [touchUi]=\"to.datepickerOptions.touchUi\"\n [calendarHeaderComponent]=\"to.datepickerOptions.calendarHeaderComponent\"\n (monthSelected)=\"to.datepickerOptions.monthSelected(field, $event, picker)\"\n (yearSelected)=\"to.datepickerOptions.yearSelected(field, $event, picker)\"\n >\n </mat-datepicker>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldDatepicker extends FieldType<FieldTypeConfig> implements AfterViewInit, OnDestroy {\n @ViewChild('datepickerToggle', { static: true }) datepickerToggle!: TemplateRef<any>;\n\n override defaultOptions = {\n templateOptions: {\n datepickerOptions: {\n startView: 'month',\n datepickerTogglePosition: 'suffix',\n dateInput: () => {},\n dateChange: () => {},\n monthSelected: () => {},\n yearSelected: () => {},\n },\n },\n };\n private fieldErrorsObserver!: ReturnType<typeof observe>;\n\n constructor(private config: FormlyConfig) {\n super();\n }\n\n detectChanges() {\n this.options.detectChanges?.(this.field);\n }\n\n ngAfterViewInit() {\n this.to[this.to.datepickerOptions.datepickerTogglePosition] = this.datepickerToggle;\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.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 { 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';\n\n@NgModule({\n declarations: [FormlyFieldDatepicker],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatInputModule,\n MatDatepickerModule,\n\n FormlyMatFormFieldModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'datepicker',\n component: FormlyFieldDatepicker,\n wrappers: ['form-field'],\n },\n ],\n }),\n ],\n})\nexport class FormlyMatDatepickerModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["observe"],"mappings":";;;;;;;;;;;;;AA6CM,MAAO,qBAAsB,SAAQ,SAA0B,CAAA;AAiBnE,IAAA,WAAA,CAAoB,MAAoB,EAAA;AACtC,QAAA,KAAK,EAAE,CAAC;AADU,QAAA,IAAM,CAAA,MAAA,GAAN,MAAM,CAAc;QAd/B,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,eAAe,EAAE;AACf,gBAAA,iBAAiB,EAAE;AACjB,oBAAA,SAAS,EAAE,OAAO;AAClB,oBAAA,wBAAwB,EAAE,QAAQ;AAClC,oBAAA,SAAS,EAAE,MAAK,GAAG;AACnB,oBAAA,UAAU,EAAE,MAAK,GAAG;AACpB,oBAAA,aAAa,EAAE,MAAK,GAAG;AACvB,oBAAA,YAAY,EAAE,MAAK,GAAG;AACvB,iBAAA;AACF,aAAA;SACF,CAAC;KAKD;IAED,aAAa,GAAA;;QACX,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,IAAI,CAAC,OAAO,EAAC,aAAa,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,EAAA,EAAG,IAAI,CAAC,KAAK,CAAC,CAAC;KAC1C;IAED,eAAe,GAAA;AACb,QAAA,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,iBAAiB,CAAC,wBAAwB,CAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC;;QAGpF,IAAI,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,EAAE;YACzD,IAAI,CAAC,mBAAmB,GAAGA,QAAO,CAAM,IAAI,CAAC,KAAK,EAAE,CAAC,aAAa,EAAE,QAAQ,CAAC,EAAE,CAAC,EAAE,YAAY,EAAE,K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A,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yBAAyB,EAlB3B,OAAA,EAAA,CAAA;YACP,YAAY;YACZ,mBAAmB;YACnB,cAAc;YACd,mBAAmB;YAEnB,wBAAwB;YACxB,YAAY,CAAC,QAAQ,CAAC;AACpB,gBAAA,KAAK,EAAE;AACL,oBAAA;AACE,wBAAA,IAAI,EAAE,YAAY;AAClB,wBAAA,SAAS,EAAE,qBAAqB;wBAChC,QAAQ,EAAE,CAAC,YAAY,CAAC;AACzB,qBAAA;AACF,iBAAA;aACF,CAAC;SACH,CAAA,EAAA,CAAA,CAAA;2FAEU,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBApBrC,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;wBACxB,YAAY,CAAC,QAAQ,CAAC;AACpB,4BAAA,KAAK,EAAE;AACL,gCAAA;AACE,oCAAA,IAAI,EAAE,YAAY;AAClB,oCAAA,SAAS,EAAE,qBAAqB;oCAChC,QAAQ,EAAE,CAAC,YAAY,CAAC;AACzB,iCAAA;AACF,6BAAA;yBACF,CAAC;AACH,qBAAA;iBACF,CAAA;;;AC9BD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-formly-material-datepicker.mjs","sources":["../../../../src/ui/material/datepicker/src/datepicker.type.ts","../../../../src/ui/material/datepicker/src/datepicker.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 [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(private config: FormlyConfig, private cdRef: ChangeDetectorRef) {\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 { 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';\n\n@NgModule({\n declarations: [FormlyFieldDatepicker],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatInputModule,\n MatDatepickerModule,\n\n FormlyMatFormFieldModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'datepicker',\n component: FormlyFieldDatepicker,\n wrappers: ['form-field'],\n },\n ],\n }),\n ],\n})\nexport class FormlyMatDatepickerModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["observe"],"mappings":";;;;;;;;;;;;;AAyFM,MAAO,qBACX,SAAQ,SAA2C,CAAA;IAqBnD,WAAoB,CAAA,MAAoB,EAAU,KAAwB,EAAA;AACxE,QAAA,KAAK,EAAE,CAAC;AADU,QAAA,IAAM,CAAA,MAAA,GAAN,MAAM,CAAc;AAAU,QAAA,IAAK,CAAA,KAAA,GAAL,KAAK,CAAmB;QAhBjE,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,KAAK,EAAE;AACL,gBAAA,iBAAiB,EAAE;AACjB,oBAAA,SAAS,EAAE,OAAgB;AAC3B,oBAAA,wBAAwB,EAAE,QAAiB;AAC3C,oBAAA,QAAQ,EAAE,KAAK;AACf,oBAAA,MAAM,EAAE,KAAK;AACb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