@ngx-formly/material 6.0.0-next.7 → 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 +40 -7
  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 +20 -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 +92 -58
  11. package/esm2020/datepicker/public_api.mjs +1 -1
  12. package/esm2020/form-field/field.type.mjs +27 -34
  13. package/esm2020/form-field/form-field.module.mjs +5 -5
  14. package/esm2020/form-field/form-field.wrapper.mjs +32 -32
  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 +22 -22
  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 +20 -20
  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 +35 -59
  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 +18 -18
  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 +30 -31
  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 +26 -26
  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 +15 -15
  41. package/fesm2015/ngx-formly-material-checkbox.mjs +23 -23
  42. package/fesm2015/ngx-formly-material-checkbox.mjs.map +1 -1
  43. package/fesm2015/ngx-formly-material-datepicker.mjs +97 -62
  44. package/fesm2015/ngx-formly-material-datepicker.mjs.map +1 -1
  45. package/fesm2015/ngx-formly-material-form-field.mjs +61 -68
  46. package/fesm2015/ngx-formly-material-form-field.mjs.map +1 -1
  47. package/fesm2015/ngx-formly-material-input.mjs +29 -29
  48. package/fesm2015/ngx-formly-material-input.mjs.map +1 -1
  49. package/fesm2015/ngx-formly-material-multicheckbox.mjs +22 -22
  50. package/fesm2015/ngx-formly-material-multicheckbox.mjs.map +1 -1
  51. package/fesm2015/ngx-formly-material-native-select.mjs +38 -62
  52. package/fesm2015/ngx-formly-material-native-select.mjs.map +1 -1
  53. package/fesm2015/ngx-formly-material-radio.mjs +21 -21
  54. package/fesm2015/ngx-formly-material-radio.mjs.map +1 -1
  55. package/fesm2015/ngx-formly-material-select.mjs +33 -34
  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 +29 -29
  60. package/fesm2015/ngx-formly-material-textarea.mjs.map +1 -1
  61. package/fesm2015/ngx-formly-material-toggle.mjs +18 -18
  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 +23 -23
  66. package/fesm2020/ngx-formly-material-checkbox.mjs.map +1 -1
  67. package/fesm2020/ngx-formly-material-datepicker.mjs +95 -62
  68. package/fesm2020/ngx-formly-material-datepicker.mjs.map +1 -1
  69. package/fesm2020/ngx-formly-material-form-field.mjs +60 -67
  70. package/fesm2020/ngx-formly-material-form-field.mjs.map +1 -1
  71. package/fesm2020/ngx-formly-material-input.mjs +29 -29
  72. package/fesm2020/ngx-formly-material-input.mjs.map +1 -1
  73. package/fesm2020/ngx-formly-material-multicheckbox.mjs +22 -22
  74. package/fesm2020/ngx-formly-material-multicheckbox.mjs.map +1 -1
  75. package/fesm2020/ngx-formly-material-native-select.mjs +38 -62
  76. package/fesm2020/ngx-formly-material-native-select.mjs.map +1 -1
  77. package/fesm2020/ngx-formly-material-radio.mjs +21 -21
  78. package/fesm2020/ngx-formly-material-radio.mjs.map +1 -1
  79. package/fesm2020/ngx-formly-material-select.mjs +33 -34
  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 +29 -29
  84. package/fesm2020/ngx-formly-material-textarea.mjs.map +1 -1
  85. package/fesm2020/ngx-formly-material-toggle.mjs +18 -18
  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 +9 -12
  90. package/form-field/form-field.wrapper.d.ts +4 -8
  91. package/form-field/public_api.d.ts +1 -1
  92. package/input/input.type.d.ts +10 -4
  93. package/input/public_api.d.ts +1 -1
  94. package/multicheckbox/multicheckbox.type.d.ts +12 -6
  95. package/multicheckbox/public_api.d.ts +1 -1
  96. package/native-select/native-select.type.d.ts +11 -8
  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 -6
  101. package/select/public_api.d.ts +1 -1
  102. package/select/select.type.d.ts +18 -6
  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 -5
  107. package/toggle/public_api.d.ts +1 -1
  108. package/toggle/toggle.type.d.ts +12 -4
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, ChangeDetectionStrategy, ViewEncapsulation, ViewChild, NgModule, Type, Directive, ViewChildren } from '@angular/core';
2
+ import { Component, ViewEncapsulation, ViewChild, NgModule, Type, Directive, ViewChildren } from '@angular/core';
3
3
  import * as i4 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import * as i3 from '@ngx-formly/core';
@@ -27,7 +27,7 @@ class FormlyWrapperFormField extends FieldWrapper {
27
27
  }
28
28
  ngAfterViewInit() {
29
29
  // temporary fix for https://github.com/angular/material2/issues/7891
30
- if (this.formField.appearance !== 'outline' && this.to.hideFieldUnderline === true) {
30
+ if (this.formField.appearance !== 'outline' && this.props.hideFieldUnderline === true) {
31
31
  const underlineElement = this.formField._elementRef.nativeElement.querySelector('.mat-form-field-underline');
32
32
  underlineElement && this.renderer.removeChild(underlineElement.parentNode, underlineElement);
33
33
  }
@@ -37,44 +37,44 @@ class FormlyWrapperFormField extends FieldWrapper {
37
37
  this.focusMonitor.stopMonitoring(this.elementRef);
38
38
  }
39
39
  }
40
- FormlyWrapperFormField.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyWrapperFormField, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i1.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component });
41
- FormlyWrapperFormField.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: FormlyWrapperFormField, selector: "formly-wrapper-mat-form-field", viewQueries: [{ propertyName: "formField", first: true, predicate: MatFormField, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
40
+ FormlyWrapperFormField.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyWrapperFormField, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i1.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component });
41
+ FormlyWrapperFormField.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FormlyWrapperFormField, selector: "formly-wrapper-mat-form-field", viewQueries: [{ propertyName: "formField", first: true, predicate: MatFormField, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
42
42
  <!-- fix https://github.com/angular/material2/pull/7083 by setting width to 100% -->
43
43
  <mat-form-field
44
44
  [hideRequiredMarker]="true"
45
- [floatLabel]="to.floatLabel"
46
- [appearance]="to.appearance"
47
- [color]="to.color"
45
+ [floatLabel]="props.floatLabel"
46
+ [appearance]="props.appearance"
47
+ [color]="props.color"
48
48
  >
49
49
  <ng-container #fieldComponent></ng-container>
50
- <mat-label *ngIf="to.label && to.hideLabel !== true">
51
- {{ to.label }}
50
+ <mat-label *ngIf="props.label && props.hideLabel !== true">
51
+ {{ props.label }}
52
52
  <span
53
- *ngIf="to.required && to.hideRequiredMarker !== true"
53
+ *ngIf="props.required && props.hideRequiredMarker !== true"
54
54
  aria-hidden="true"
55
55
  class="mat-form-field-required-marker"
56
56
  >*</span
57
57
  >
58
58
  </mat-label>
59
59
 
60
- <ng-container matPrefix *ngIf="to._matPrefix">
61
- <ng-container [ngTemplateOutlet]="to._matPrefix" [ngTemplateOutletContext]="{ field: field }"></ng-container>
60
+ <ng-container matPrefix *ngIf="props.prefix">
61
+ <ng-container [ngTemplateOutlet]="props.prefix" [ngTemplateOutletContext]="{ field: field }"></ng-container>
62
62
  </ng-container>
63
63
 
64
- <ng-container matSuffix *ngIf="to._matSuffix">
65
- <ng-container [ngTemplateOutlet]="to._matSuffix" [ngTemplateOutletContext]="{ field: field }"></ng-container>
64
+ <ng-container matSuffix *ngIf="props.suffix">
65
+ <ng-container [ngTemplateOutlet]="props.suffix" [ngTemplateOutletContext]="{ field: field }"></ng-container>
66
66
  </ng-container>
67
67
 
68
68
  <mat-error>
69
69
  <formly-validation-message [field]="field"></formly-validation-message>
70
70
  </mat-error>
71
71
 
72
- <mat-hint *ngIf="to.description || to.hintStart as hint">
72
+ <mat-hint *ngIf="props.description || props.hintStart as hint">
73
73
  <ng-container [ngTemplateOutlet]="stringOrTemplate" [ngTemplateOutletContext]="{ content: hint }">
74
74
  </ng-container>
75
75
  </mat-hint>
76
76
 
77
- <mat-hint *ngIf="to.hintEnd as hintEnd" align="end">
77
+ <mat-hint *ngIf="props.hintEnd as hintEnd" align="end">
78
78
  <ng-container [ngTemplateOutlet]="stringOrTemplate" [ngTemplateOutletContext]="{ content: hintEnd }">
79
79
  </ng-container>
80
80
  </mat-hint>
@@ -86,46 +86,46 @@ FormlyWrapperFormField.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
86
86
  <ng-container [ngTemplateOutlet]="content" [ngTemplateOutletContext]="{ field: field }"></ng-container>
87
87
  </ng-template>
88
88
  </ng-template>
89
- `, isInline: true, styles: ["formly-wrapper-mat-form-field .mat-form-field{width:100%}\n"], components: [{ type: i2.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i3.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.MatLabel, selector: "mat-label" }, { type: i2.MatPrefix, selector: "[matPrefix]" }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2.MatSuffix, selector: "[matSuffix]" }, { type: i2.MatError, selector: "mat-error", inputs: ["id"] }, { type: i2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
90
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyWrapperFormField, decorators: [{
89
+ `, isInline: true, styles: ["formly-wrapper-mat-form-field .mat-form-field{width:100%}\n"], components: [{ type: i2.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i3.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.MatLabel, selector: "mat-label" }, { type: i2.MatPrefix, selector: "[matPrefix]" }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2.MatSuffix, selector: "[matSuffix]" }, { type: i2.MatError, selector: "mat-error", inputs: ["id"] }, { type: i2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }], encapsulation: i0.ViewEncapsulation.None });
90
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyWrapperFormField, decorators: [{
91
91
  type: Component,
92
92
  args: [{ selector: 'formly-wrapper-mat-form-field', template: `
93
93
  <!-- fix https://github.com/angular/material2/pull/7083 by setting width to 100% -->
94
94
  <mat-form-field
95
95
  [hideRequiredMarker]="true"
96
- [floatLabel]="to.floatLabel"
97
- [appearance]="to.appearance"
98
- [color]="to.color"
96
+ [floatLabel]="props.floatLabel"
97
+ [appearance]="props.appearance"
98
+ [color]="props.color"
99
99
  >
100
100
  <ng-container #fieldComponent></ng-container>
101
- <mat-label *ngIf="to.label && to.hideLabel !== true">
102
- {{ to.label }}
101
+ <mat-label *ngIf="props.label && props.hideLabel !== true">
102
+ {{ props.label }}
103
103
  <span
104
- *ngIf="to.required && to.hideRequiredMarker !== true"
104
+ *ngIf="props.required && props.hideRequiredMarker !== true"
105
105
  aria-hidden="true"
106
106
  class="mat-form-field-required-marker"
107
107
  >*</span
108
108
  >
109
109
  </mat-label>
110
110
 
111
- <ng-container matPrefix *ngIf="to._matPrefix">
112
- <ng-container [ngTemplateOutlet]="to._matPrefix" [ngTemplateOutletContext]="{ field: field }"></ng-container>
111
+ <ng-container matPrefix *ngIf="props.prefix">
112
+ <ng-container [ngTemplateOutlet]="props.prefix" [ngTemplateOutletContext]="{ field: field }"></ng-container>
113
113
  </ng-container>
114
114
 
115
- <ng-container matSuffix *ngIf="to._matSuffix">
116
- <ng-container [ngTemplateOutlet]="to._matSuffix" [ngTemplateOutletContext]="{ field: field }"></ng-container>
115
+ <ng-container matSuffix *ngIf="props.suffix">
116
+ <ng-container [ngTemplateOutlet]="props.suffix" [ngTemplateOutletContext]="{ field: field }"></ng-container>
117
117
  </ng-container>
118
118
 
119
119
  <mat-error>
120
120
  <formly-validation-message [field]="field"></formly-validation-message>
121
121
  </mat-error>
122
122
 
123
- <mat-hint *ngIf="to.description || to.hintStart as hint">
123
+ <mat-hint *ngIf="props.description || props.hintStart as hint">
124
124
  <ng-container [ngTemplateOutlet]="stringOrTemplate" [ngTemplateOutletContext]="{ content: hint }">
125
125
  </ng-container>
126
126
  </mat-hint>
127
127
 
128
- <mat-hint *ngIf="to.hintEnd as hintEnd" align="end">
128
+ <mat-hint *ngIf="props.hintEnd as hintEnd" align="end">
129
129
  <ng-container [ngTemplateOutlet]="stringOrTemplate" [ngTemplateOutletContext]="{ content: hintEnd }">
130
130
  </ng-container>
131
131
  </mat-hint>
@@ -137,7 +137,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImpor
137
137
  <ng-container [ngTemplateOutlet]="content" [ngTemplateOutletContext]="{ field: field }"></ng-container>
138
138
  </ng-template>
139
139
  </ng-template>
140
- `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, styles: ["formly-wrapper-mat-form-field .mat-form-field{width:100%}\n"] }]
140
+ `, encapsulation: ViewEncapsulation.None, styles: ["formly-wrapper-mat-form-field .mat-form-field{width:100%}\n"] }]
141
141
  }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i1.FocusMonitor }]; }, propDecorators: { formField: [{
142
142
  type: ViewChild,
143
143
  args: [MatFormField, { static: true }]
@@ -145,11 +145,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImpor
145
145
 
146
146
  class FormlyMatFormFieldModule {
147
147
  }
148
- FormlyMatFormFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyMatFormFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
149
- FormlyMatFormFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyMatFormFieldModule, declarations: [FormlyWrapperFormField], imports: [CommonModule,
148
+ FormlyMatFormFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatFormFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
149
+ FormlyMatFormFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatFormFieldModule, declarations: [FormlyWrapperFormField], imports: [CommonModule,
150
150
  ReactiveFormsModule,
151
151
  MatFormFieldModule, i3.FormlyModule] });
152
- FormlyMatFormFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyMatFormFieldModule, imports: [[
152
+ FormlyMatFormFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatFormFieldModule, imports: [[
153
153
  CommonModule,
154
154
  ReactiveFormsModule,
155
155
  MatFormFieldModule,
@@ -162,7 +162,7 @@ FormlyMatFormFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0"
162
162
  ],
163
163
  }),
164
164
  ]] });
165
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyMatFormFieldModule, decorators: [{
165
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatFormFieldModule, decorators: [{
166
166
  type: NgModule,
167
167
  args: [{
168
168
  declarations: [FormlyWrapperFormField],
@@ -189,31 +189,26 @@ class FieldType extends FieldType$1 {
189
189
  this.stateChanges = new Subject();
190
190
  this._errorState = false;
191
191
  }
192
- set _controls(controls) {
193
- if (controls.length === 1 && !this.formFieldControl) {
194
- this.formFieldControl = controls.first;
192
+ set matPrefix(prefix) {
193
+ if (prefix) {
194
+ this.props.prefix = prefix;
195
195
  }
196
196
  }
197
- ngOnInit() {
198
- ɵobserve(this, ['formFieldControl'], ({ currentValue }) => {
199
- this.attachControl(currentValue || this);
200
- });
201
- }
202
- ngAfterViewInit() {
203
- if (this.matPrefix) {
204
- this.to.prefix = this.matPrefix;
205
- }
206
- if (this.matSuffix) {
207
- this.to.prefix = this.matSuffix;
197
+ set matSuffix(suffix) {
198
+ if (suffix) {
199
+ this.props.suffix = suffix;
208
200
  }
209
201
  }
202
+ set _controls(controls) {
203
+ this.attachControl(controls.length === 1 ? controls.first : this);
204
+ }
210
205
  ngOnDestroy() {
211
206
  var _a;
212
207
  (_a = this.formField) === null || _a === void 0 ? true : delete _a._control;
213
208
  this.stateChanges.complete();
214
209
  }
215
- setDescribedByIds(ids) { }
216
- onContainerClick(event) {
210
+ setDescribedByIds(_ids) { }
211
+ onContainerClick(_event) {
217
212
  this.field.focus = true;
218
213
  this.stateChanges.next();
219
214
  }
@@ -226,25 +221,23 @@ class FieldType extends FieldType$1 {
226
221
  return showError;
227
222
  }
228
223
  get controlType() {
229
- if (this.to.type) {
230
- return this.to.type;
224
+ if (this.props.type) {
225
+ return this.props.type;
231
226
  }
232
- if (this.field.type instanceof Type) {
233
- return this.field.type.constructor.name;
234
- }
235
- return this.field.type;
227
+ const type = this.field.type;
228
+ return type instanceof Type ? type.prototype.constructor.name : type;
236
229
  }
237
230
  get focused() {
238
231
  return !!this.field.focus && !this.disabled;
239
232
  }
240
233
  get disabled() {
241
- return !!this.to.disabled;
234
+ return !!this.props.disabled;
242
235
  }
243
236
  get required() {
244
- return !!this.to.required;
237
+ return !!this.props.required;
245
238
  }
246
239
  get placeholder() {
247
- return this.to.placeholder || '';
240
+ return this.props.placeholder || '';
248
241
  }
249
242
  get shouldPlaceholderFloat() {
250
243
  return this.shouldLabelFloat;
@@ -271,16 +264,16 @@ class FieldType extends FieldType$1 {
271
264
  return (_a = this.field) === null || _a === void 0 ? void 0 : _a['_formField'];
272
265
  }
273
266
  attachControl(control) {
274
- var _a, _b;
267
+ var _a;
275
268
  if (this.formField && control !== this.formField._control) {
276
269
  this.formField._control = control;
277
270
  // temporary fix for https://github.com/angular/material2/issues/6728
278
- if ((_b = (_a = control === null || control === void 0 ? void 0 : control.ngControl) === null || _a === void 0 ? void 0 : _a.valueAccessor) === null || _b === void 0 ? void 0 : _b.hasOwnProperty('_formField')) {
279
- control.ngControl.valueAccessor['_formField'] = this.formField;
271
+ const ngControl = control === null || control === void 0 ? void 0 : control.ngControl;
272
+ if ((_a = ngControl === null || ngControl === void 0 ? void 0 : ngControl.valueAccessor) === null || _a === void 0 ? void 0 : _a.hasOwnProperty('_formField')) {
273
+ ngControl.valueAccessor['_formField'] = this.formField;
280
274
  }
281
- ['Prefix', 'Suffix'].forEach((type) => ɵobserve(this.field, ['templateOptions', type.toLowerCase()], ({ currentValue }) => currentValue &&
275
+ ['prefix', 'suffix'].forEach((type) => ɵobserve(this.field, ['props', type], ({ currentValue }) => currentValue &&
282
276
  Promise.resolve().then(() => {
283
- this.field.templateOptions[`_mat${type}`] = currentValue;
284
277
  this.options.detectChanges(this.field);
285
278
  })));
286
279
  // https://github.com/angular/components/issues/16209
@@ -291,9 +284,9 @@ class FieldType extends FieldType$1 {
291
284
  }
292
285
  }
293
286
  }
294
- FieldType.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FieldType, deps: null, target: i0.ɵɵFactoryTarget.Directive });
295
- FieldType.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.2", type: FieldType, viewQueries: [{ propertyName: "matPrefix", first: true, predicate: ["matPrefix"], descendants: true }, { propertyName: "matSuffix", first: true, predicate: ["matSuffix"], descendants: true }, { propertyName: "_controls", predicate: MatFormFieldControl, descendants: true }], usesInheritance: true, ngImport: i0 });
296
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FieldType, decorators: [{
287
+ FieldType.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FieldType, deps: null, target: i0.ɵɵFactoryTarget.Directive });
288
+ FieldType.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: FieldType, viewQueries: [{ propertyName: "matPrefix", first: true, predicate: ["matPrefix"], descendants: true }, { propertyName: "matSuffix", first: true, predicate: ["matSuffix"], descendants: true }, { propertyName: "_controls", predicate: MatFormFieldControl, descendants: true }], usesInheritance: true, ngImport: i0 });
289
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FieldType, decorators: [{
297
290
  type: Directive
298
291
  }], propDecorators: { matPrefix: [{
299
292
  type: ViewChild,
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-formly-material-form-field.mjs","sources":["../../../../src/ui/material/form-field/src/form-field.wrapper.ts","../../../../src/ui/material/form-field/src/form-field.module.ts","../../../../src/ui/material/form-field/src/field.type.ts","../../../../src/ui/material/form-field/src/ngx-formly-material-form-field.ts"],"sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n ViewChild,\n OnInit,\n OnDestroy,\n Renderer2,\n AfterViewInit,\n ElementRef,\n ViewEncapsulation,\n TemplateRef,\n} from '@angular/core';\nimport {\n ɵdefineHiddenProp as defineHiddenProp,\n FormlyFieldConfig as CoreFieldConfig,\n FormlyTemplateOptions,\n FieldWrapper,\n} from '@ngx-formly/core';\nimport { MatFormField } from '@angular/material/form-field';\nimport { FocusMonitor } from '@angular/cdk/a11y';\nimport { FloatLabelType, MatFormFieldAppearance } from '@angular/material/form-field/form-field';\nimport { ThemePalette } from '@angular/material/core';\n\ninterface MatFormlyFieldConfig extends FormlyFieldConfig {\n _formField?: FormlyWrapperFormField;\n}\n\nexport interface FormlyFieldConfig extends CoreFieldConfig {\n templateOptions?: MatFormlyTemplateOptions;\n}\n\ninterface MatFormlyTemplateOptions extends FormlyTemplateOptions {\n prefix?: TemplateRef<any>;\n suffix?: TemplateRef<any>;\n hideLabel?: boolean;\n hideRequiredMarker?: boolean;\n hideFieldUnderline?: boolean;\n floatLabel?: FloatLabelType;\n appearance?: MatFormFieldAppearance;\n color?: ThemePalette;\n hintStart?: TemplateRef<any> | string;\n hintEnd?: TemplateRef<any> | string;\n}\n\n@Component({\n selector: 'formly-wrapper-mat-form-field',\n template: `\n <!-- fix https://github.com/angular/material2/pull/7083 by setting width to 100% -->\n <mat-form-field\n [hideRequiredMarker]=\"true\"\n [floatLabel]=\"to.floatLabel\"\n [appearance]=\"to.appearance\"\n [color]=\"to.color\"\n >\n <ng-container #fieldComponent></ng-container>\n <mat-label *ngIf=\"to.label && to.hideLabel !== true\">\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-label>\n\n <ng-container matPrefix *ngIf=\"to._matPrefix\">\n <ng-container [ngTemplateOutlet]=\"to._matPrefix\" [ngTemplateOutletContext]=\"{ field: field }\"></ng-container>\n </ng-container>\n\n <ng-container matSuffix *ngIf=\"to._matSuffix\">\n <ng-container [ngTemplateOutlet]=\"to._matSuffix\" [ngTemplateOutletContext]=\"{ field: field }\"></ng-container>\n </ng-container>\n\n <mat-error>\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </mat-error>\n\n <mat-hint *ngIf=\"to.description || to.hintStart as hint\">\n <ng-container [ngTemplateOutlet]=\"stringOrTemplate\" [ngTemplateOutletContext]=\"{ content: hint }\">\n </ng-container>\n </mat-hint>\n\n <mat-hint *ngIf=\"to.hintEnd as hintEnd\" align=\"end\">\n <ng-container [ngTemplateOutlet]=\"stringOrTemplate\" [ngTemplateOutletContext]=\"{ content: hintEnd }\">\n </ng-container>\n </mat-hint>\n </mat-form-field>\n\n <ng-template #stringOrTemplate let-content=\"content\">\n <ng-container *ngIf=\"!content.createEmbeddedView; else template\">{{ content }}</ng-container>\n <ng-template #template>\n <ng-container [ngTemplateOutlet]=\"content\" [ngTemplateOutletContext]=\"{ field: field }\"></ng-container>\n </ng-template>\n </ng-template>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n styleUrls: ['./form-field.wrapper.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class FormlyWrapperFormField\n extends FieldWrapper<MatFormlyFieldConfig>\n implements OnInit, OnDestroy, AfterViewInit\n{\n @ViewChild(MatFormField, { static: true }) formField!: MatFormField;\n field!: MatFormlyFieldConfig;\n\n constructor(private renderer: Renderer2, private elementRef: ElementRef, private focusMonitor: FocusMonitor) {\n super();\n }\n\n ngOnInit() {\n defineHiddenProp(this.field, '_formField', this.formField);\n this.focusMonitor.monitor(this.elementRef, true).subscribe((origin) => {\n if (!origin && this.field.focus) {\n this.field.focus = false;\n }\n });\n }\n\n ngAfterViewInit() {\n // temporary fix for https://github.com/angular/material2/issues/7891\n if (this.formField.appearance !== 'outline' && this.to.hideFieldUnderline === true) {\n const underlineElement = this.formField._elementRef.nativeElement.querySelector('.mat-form-field-underline');\n underlineElement && this.renderer.removeChild(underlineElement.parentNode, underlineElement);\n }\n }\n\n ngOnDestroy() {\n delete this.field._formField;\n this.focusMonitor.stopMonitoring(this.elementRef);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { FormlyWrapperFormField } from './form-field.wrapper';\n\n@NgModule({\n declarations: [FormlyWrapperFormField],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatFormFieldModule,\n FormlyModule.forChild({\n wrappers: [\n {\n name: 'form-field',\n component: FormlyWrapperFormField,\n },\n ],\n }),\n ],\n})\nexport class FormlyMatFormFieldModule {}\n","import {\n OnInit,\n OnDestroy,\n AfterViewInit,\n TemplateRef,\n ViewChild,\n Type,\n Directive,\n ViewChildren,\n QueryList,\n} from '@angular/core';\nimport { FieldType as CoreFieldType, ɵobserve as observe } from '@ngx-formly/core';\nimport { Subject } from 'rxjs';\nimport { MatFormField, MatFormFieldControl } from '@angular/material/form-field';\nimport { ErrorStateMatcher } from '@angular/material/core';\nimport { FormlyFieldConfig } from './form-field.wrapper';\n\n@Directive()\nexport abstract class FieldType<F extends FormlyFieldConfig = FormlyFieldConfig>\n extends CoreFieldType<F>\n implements OnInit, AfterViewInit, OnDestroy, MatFormFieldControl<any>\n{\n @ViewChild('matPrefix') matPrefix!: TemplateRef<any>;\n @ViewChild('matSuffix') matSuffix!: TemplateRef<any>;\n\n formFieldControl!: MatFormFieldControl<any>;\n @ViewChildren(MatFormFieldControl) set _controls(controls: QueryList<MatFormFieldControl<any>>) {\n if (controls.length === 1 && !this.formFieldControl) {\n this.formFieldControl = controls.first;\n }\n }\n\n errorStateMatcher: ErrorStateMatcher = { isErrorState: () => this.field && this.showError };\n stateChanges = new Subject<void>();\n _errorState = false;\n\n ngOnInit() {\n observe(this, ['formFieldControl'], ({ currentValue }) => {\n this.attachControl(currentValue || this);\n });\n }\n\n ngAfterViewInit() {\n if (this.matPrefix) {\n this.to.prefix = this.matPrefix;\n }\n if (this.matSuffix) {\n this.to.prefix = this.matSuffix;\n }\n }\n\n ngOnDestroy() {\n delete (this.formField as any)?._control;\n this.stateChanges.complete();\n }\n\n setDescribedByIds(ids: string[]): void {}\n onContainerClick(event: MouseEvent): void {\n this.field.focus = true;\n this.stateChanges.next();\n }\n\n get errorState() {\n const showError = this.options!.showError!(this);\n if (showError !== this._errorState) {\n this._errorState = showError;\n this.stateChanges.next();\n }\n\n return showError;\n }\n\n get controlType() {\n if (this.to.type) {\n return this.to.type;\n }\n\n if (<any>this.field.type instanceof Type) {\n return this.field.type!.constructor.name;\n }\n\n return this.field.type!;\n }\n get focused() {\n return !!this.field.focus && !this.disabled;\n }\n get disabled() {\n return !!this.to.disabled;\n }\n get required() {\n return !!this.to.required;\n }\n get placeholder() {\n return this.to.placeholder || '';\n }\n get shouldPlaceholderFloat() {\n return this.shouldLabelFloat;\n }\n get value() {\n return this.formControl?.value;\n }\n set value(value) {\n this.formControl?.patchValue(value);\n }\n get ngControl() {\n return this.formControl as any;\n }\n get empty() {\n return this.value == null || this.value === '';\n }\n get shouldLabelFloat() {\n return this.focused || !this.empty;\n }\n get formField(): MatFormField {\n return (this.field as any)?.['_formField'];\n }\n\n private attachControl(control: MatFormFieldControl<any>) {\n if (this.formField && control !== this.formField._control) {\n this.formField._control = control;\n\n // temporary fix for https://github.com/angular/material2/issues/6728\n if (control?.ngControl?.valueAccessor?.hasOwnProperty('_formField')) {\n (control.ngControl.valueAccessor as any)['_formField'] = this.formField;\n }\n\n ['Prefix', 'Suffix'].forEach((type) =>\n observe<TemplateRef<any>>(\n this.field,\n ['templateOptions', type.toLowerCase()],\n ({ currentValue }) =>\n currentValue &&\n Promise.resolve().then(() => {\n this.field.templateOptions![`_mat${type}`] = currentValue;\n this.options.detectChanges!(this.field);\n }),\n ),\n );\n\n // https://github.com/angular/components/issues/16209\n const setDescribedByIds = control.setDescribedByIds.bind(control);\n control.setDescribedByIds = (ids: string[]) => {\n setTimeout(() => setDescribedByIds(ids));\n };\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["defineHiddenProp","CoreFieldType","observe"],"mappings":";;;;;;;;;;;;MAmGa,+BACH,YAAkC;IAM1C,YAAoB,QAAmB,EAAU,UAAsB,EAAU,YAA0B;QACzG,KAAK,EAAE,CAAC;QADU,aAAQ,GAAR,QAAQ,CAAW;QAAU,eAAU,GAAV,UAAU,CAAY;QAAU,iBAAY,GAAZ,YAAY,CAAc;KAE1G;IAED,QAAQ;QACNA,iBAAgB,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAC3D,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM;YAChE,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;gBAC/B,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;aAC1B;SACF,CAAC,CAAC;KACJ;IAED,eAAe;;QAEb,IAAI,IAAI,CAAC,SAAS,CAAC,UAAU,KAAK,SAAS,IAAI,IAAI,CAAC,EAAE,CAAC,kBAAkB,KAAK,IAAI,EAAE;YAClF,MAAM,gBAAgB,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,aAAa,CAAC,aAAa,CAAC,2BAA2B,CAAC,CAAC;YAC7G,gBAAgB,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,gBAAgB,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;SAC9F;KACF;IAED,WAAW;QACT,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,C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AC1BnC;;;;;;"}
1
+ {"version":3,"file":"ngx-formly-material-form-field.mjs","sources":["../../../../src/ui/material/form-field/src/form-field.wrapper.ts","../../../../src/ui/material/form-field/src/form-field.module.ts","../../../../src/ui/material/form-field/src/field.type.ts","../../../../src/ui/material/form-field/src/ngx-formly-material-form-field.ts"],"sourcesContent":["import {\n Component,\n ViewChild,\n OnInit,\n OnDestroy,\n Renderer2,\n AfterViewInit,\n ElementRef,\n ViewEncapsulation,\n TemplateRef,\n} from '@angular/core';\nimport {\n ɵdefineHiddenProp as defineHiddenProp,\n FormlyFieldConfig,\n FormlyFieldProps as CoreFormlyFieldProps,\n FieldWrapper,\n} from '@ngx-formly/core';\nimport { MatFormField } from '@angular/material/form-field';\nimport { FocusMonitor } from '@angular/cdk/a11y';\nimport { FloatLabelType, MatFormFieldAppearance } from '@angular/material/form-field';\nimport { ThemePalette } from '@angular/material/core';\n\ninterface MatFormlyFieldConfig extends FormlyFieldConfig<FormlyFieldProps> {\n _formField?: FormlyWrapperFormField;\n}\n\nexport interface FormlyFieldProps extends CoreFormlyFieldProps {\n prefix?: TemplateRef<any>;\n suffix?: TemplateRef<any>;\n hideLabel?: boolean;\n hideRequiredMarker?: boolean;\n hideFieldUnderline?: boolean;\n floatLabel?: FloatLabelType;\n appearance?: MatFormFieldAppearance;\n color?: ThemePalette;\n hintStart?: TemplateRef<any> | string;\n hintEnd?: TemplateRef<any> | string;\n}\n\n@Component({\n selector: 'formly-wrapper-mat-form-field',\n template: `\n <!-- fix https://github.com/angular/material2/pull/7083 by setting width to 100% -->\n <mat-form-field\n [hideRequiredMarker]=\"true\"\n [floatLabel]=\"props.floatLabel\"\n [appearance]=\"props.appearance\"\n [color]=\"props.color\"\n >\n <ng-container #fieldComponent></ng-container>\n <mat-label *ngIf=\"props.label && props.hideLabel !== true\">\n {{ props.label }}\n <span\n *ngIf=\"props.required && props.hideRequiredMarker !== true\"\n aria-hidden=\"true\"\n class=\"mat-form-field-required-marker\"\n >*</span\n >\n </mat-label>\n\n <ng-container matPrefix *ngIf=\"props.prefix\">\n <ng-container [ngTemplateOutlet]=\"props.prefix\" [ngTemplateOutletContext]=\"{ field: field }\"></ng-container>\n </ng-container>\n\n <ng-container matSuffix *ngIf=\"props.suffix\">\n <ng-container [ngTemplateOutlet]=\"props.suffix\" [ngTemplateOutletContext]=\"{ field: field }\"></ng-container>\n </ng-container>\n\n <mat-error>\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </mat-error>\n\n <mat-hint *ngIf=\"props.description || props.hintStart as hint\">\n <ng-container [ngTemplateOutlet]=\"stringOrTemplate\" [ngTemplateOutletContext]=\"{ content: hint }\">\n </ng-container>\n </mat-hint>\n\n <mat-hint *ngIf=\"props.hintEnd as hintEnd\" align=\"end\">\n <ng-container [ngTemplateOutlet]=\"stringOrTemplate\" [ngTemplateOutletContext]=\"{ content: hintEnd }\">\n </ng-container>\n </mat-hint>\n </mat-form-field>\n\n <ng-template #stringOrTemplate let-content=\"content\">\n <ng-container *ngIf=\"!content.createEmbeddedView; else template\">{{ content }}</ng-container>\n <ng-template #template>\n <ng-container [ngTemplateOutlet]=\"content\" [ngTemplateOutletContext]=\"{ field: field }\"></ng-container>\n </ng-template>\n </ng-template>\n `,\n styleUrls: ['./form-field.wrapper.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class FormlyWrapperFormField\n extends FieldWrapper<MatFormlyFieldConfig>\n implements OnInit, OnDestroy, AfterViewInit\n{\n @ViewChild(MatFormField, { static: true }) formField!: MatFormField;\n\n constructor(private renderer: Renderer2, private elementRef: ElementRef, private focusMonitor: FocusMonitor) {\n super();\n }\n\n ngOnInit() {\n defineHiddenProp(this.field, '_formField', this.formField);\n this.focusMonitor.monitor(this.elementRef, true).subscribe((origin) => {\n if (!origin && this.field.focus) {\n this.field.focus = false;\n }\n });\n }\n\n ngAfterViewInit() {\n // temporary fix for https://github.com/angular/material2/issues/7891\n if (this.formField.appearance !== 'outline' && this.props.hideFieldUnderline === true) {\n const underlineElement = this.formField._elementRef.nativeElement.querySelector('.mat-form-field-underline');\n underlineElement && this.renderer.removeChild(underlineElement.parentNode, underlineElement);\n }\n }\n\n ngOnDestroy() {\n delete this.field._formField;\n this.focusMonitor.stopMonitoring(this.elementRef);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { FormlyWrapperFormField } from './form-field.wrapper';\n\n@NgModule({\n declarations: [FormlyWrapperFormField],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatFormFieldModule,\n FormlyModule.forChild({\n wrappers: [\n {\n name: 'form-field',\n component: FormlyWrapperFormField,\n },\n ],\n }),\n ],\n})\nexport class FormlyMatFormFieldModule {}\n","import { OnDestroy, TemplateRef, ViewChild, Type, Directive, ViewChildren, QueryList } from '@angular/core';\nimport { FieldType as CoreFieldType, FormlyFieldConfig, ɵobserve as observe } from '@ngx-formly/core';\nimport { Subject } from 'rxjs';\nimport { MatFormField, MatFormFieldControl } from '@angular/material/form-field';\nimport { ErrorStateMatcher } from '@angular/material/core';\nimport { FormlyFieldProps } from './form-field.wrapper';\n\n@Directive()\nexport abstract class FieldType<F extends FormlyFieldConfig<FormlyFieldProps>>\n extends CoreFieldType<F>\n implements OnDestroy, MatFormFieldControl<any>\n{\n @ViewChild('matPrefix') set matPrefix(prefix: TemplateRef<any>) {\n if (prefix) {\n this.props.prefix = prefix;\n }\n }\n @ViewChild('matSuffix') set matSuffix(suffix: TemplateRef<any>) {\n if (suffix) {\n this.props.suffix = suffix;\n }\n }\n\n @ViewChildren(MatFormFieldControl) set _controls(controls: QueryList<MatFormFieldControl<any>>) {\n this.attachControl(controls.length === 1 ? controls.first : this);\n }\n\n errorStateMatcher: ErrorStateMatcher = { isErrorState: () => this.field && this.showError };\n stateChanges = new Subject<void>();\n _errorState = false;\n\n ngOnDestroy() {\n delete (this.formField as any)?._control;\n this.stateChanges.complete();\n }\n\n setDescribedByIds(_ids: string[]): void {}\n onContainerClick(_event: MouseEvent): void {\n this.field.focus = true;\n this.stateChanges.next();\n }\n\n get errorState() {\n const showError = this.options!.showError!(this);\n if (showError !== this._errorState) {\n this._errorState = showError;\n this.stateChanges.next();\n }\n\n return showError;\n }\n\n get controlType() {\n if (this.props.type) {\n return this.props.type;\n }\n\n const type = this.field.type!;\n return type instanceof Type ? type.prototype.constructor.name : type;\n }\n get focused() {\n return !!this.field.focus && !this.disabled;\n }\n get disabled() {\n return !!this.props.disabled;\n }\n get required() {\n return !!this.props.required;\n }\n get placeholder() {\n return this.props.placeholder || '';\n }\n get shouldPlaceholderFloat() {\n return this.shouldLabelFloat;\n }\n get value() {\n return this.formControl?.value;\n }\n set value(value) {\n this.formControl?.patchValue(value);\n }\n get ngControl() {\n return this.formControl as any;\n }\n get empty() {\n return this.value == null || this.value === '';\n }\n get shouldLabelFloat() {\n return this.focused || !this.empty;\n }\n get formField(): MatFormField {\n return (this.field as any)?.['_formField'];\n }\n\n private attachControl(control: MatFormFieldControl<any>) {\n if (this.formField && control !== this.formField._control) {\n this.formField._control = control;\n\n // temporary fix for https://github.com/angular/material2/issues/6728\n const ngControl = control?.ngControl as any;\n if (ngControl?.valueAccessor?.hasOwnProperty('_formField')) {\n ngControl.valueAccessor['_formField'] = this.formField;\n }\n\n ['prefix', 'suffix'].forEach((type) =>\n observe<TemplateRef<any>>(\n this.field,\n ['props', type],\n ({ currentValue }) =>\n currentValue &&\n Promise.resolve().then(() => {\n this.options.detectChanges!(this.field);\n }),\n ),\n );\n\n // https://github.com/angular/components/issues/16209\n const setDescribedByIds = control.setDescribedByIds.bind(control);\n control.setDescribedByIds = (ids: string[]) => {\n setTimeout(() => setDescribedByIds(ids));\n };\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["defineHiddenProp","i1","CoreFieldType","observe"],"mappings":";;;;;;;;;;;;AA6F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CAAC,CACL,CACF,CAAC;;YAGF,MAAM,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAClE,YAAA,OAAO,CAAC,iBAAiB,GAAG,CAAC,GAAa,KAAI;gBAC5C,UAAU,CAAC,MAAM,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC;AAC3C,aAAC,CAAC;AACH,SAAA;KACF;;uGAlHmB,SAAS,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAT,SAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,SAAS,0OAef,mBAAmB,EAAA,WAAA,EAAA,IAAA,EAAA,CAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;4FAfb,SAAS,EAAA,UAAA,EAAA,CAAA;kBAD9B,SAAS;8BAKoB,SAAS,EAAA,CAAA;sBAApC,SAAS;uBAAC,WAAW,CAAA;gBAKM,SAAS,EAAA,CAAA;sBAApC,SAAS;uBAAC,WAAW,CAAA;gBAMiB,SAAS,EAAA,CAAA;sBAA/C,YAAY;uBAAC,mBAAmB,CAAA;;;ACvBnC;;AAEG;;;;"}
@@ -12,40 +12,40 @@ import { MatInputModule } from '@angular/material/input';
12
12
 
13
13
  class FormlyFieldInput extends FieldType {
14
14
  get type() {
15
- return this.to.type || 'text';
15
+ return this.props.type || 'text';
16
16
  }
17
17
  }
18
- FormlyFieldInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyFieldInput, deps: null, target: i0.ɵɵFactoryTarget.Component });
19
- FormlyFieldInput.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: FormlyFieldInput, selector: "formly-field-mat-input", usesInheritance: true, ngImport: i0, template: `
18
+ FormlyFieldInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyFieldInput, deps: null, target: i0.ɵɵFactoryTarget.Component });
19
+ FormlyFieldInput.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FormlyFieldInput, selector: "formly-field-mat-input", usesInheritance: true, ngImport: i0, template: `
20
20
  <input
21
21
  *ngIf="type !== 'number'; else numberTmp"
22
22
  matInput
23
23
  [id]="id"
24
24
  [type]="type || 'text'"
25
- [readonly]="to.readonly"
26
- [required]="to.required"
25
+ [readonly]="props.readonly"
26
+ [required]="required"
27
27
  [errorStateMatcher]="errorStateMatcher"
28
28
  [formControl]="formControl"
29
29
  [formlyAttributes]="field"
30
- [tabIndex]="to.tabindex"
31
- [placeholder]="to.placeholder"
30
+ [tabIndex]="props.tabindex"
31
+ [placeholder]="props.placeholder"
32
32
  />
33
33
  <ng-template #numberTmp>
34
34
  <input
35
35
  matInput
36
36
  [id]="id"
37
37
  type="number"
38
- [readonly]="to.readonly"
39
- [required]="to.required"
38
+ [readonly]="props.readonly"
39
+ [required]="required"
40
40
  [errorStateMatcher]="errorStateMatcher"
41
41
  [formControl]="formControl"
42
42
  [formlyAttributes]="field"
43
- [tabIndex]="to.tabindex"
44
- [placeholder]="to.placeholder"
43
+ [tabIndex]="props.tabindex"
44
+ [placeholder]="props.placeholder"
45
45
  />
46
46
  </ng-template>
47
- `, isInline: true, directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i3.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: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { 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: i3.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
48
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyFieldInput, decorators: [{
47
+ `, isInline: true, directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i3.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: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { 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: i3.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
48
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyFieldInput, decorators: [{
49
49
  type: Component,
50
50
  args: [{
51
51
  selector: 'formly-field-mat-input',
@@ -55,26 +55,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImpor
55
55
  matInput
56
56
  [id]="id"
57
57
  [type]="type || 'text'"
58
- [readonly]="to.readonly"
59
- [required]="to.required"
58
+ [readonly]="props.readonly"
59
+ [required]="required"
60
60
  [errorStateMatcher]="errorStateMatcher"
61
61
  [formControl]="formControl"
62
62
  [formlyAttributes]="field"
63
- [tabIndex]="to.tabindex"
64
- [placeholder]="to.placeholder"
63
+ [tabIndex]="props.tabindex"
64
+ [placeholder]="props.placeholder"
65
65
  />
66
66
  <ng-template #numberTmp>
67
67
  <input
68
68
  matInput
69
69
  [id]="id"
70
70
  type="number"
71
- [readonly]="to.readonly"
72
- [required]="to.required"
71
+ [readonly]="props.readonly"
72
+ [required]="required"
73
73
  [errorStateMatcher]="errorStateMatcher"
74
74
  [formControl]="formControl"
75
75
  [formlyAttributes]="field"
76
- [tabIndex]="to.tabindex"
77
- [placeholder]="to.placeholder"
76
+ [tabIndex]="props.tabindex"
77
+ [placeholder]="props.placeholder"
78
78
  />
79
79
  </ng-template>
80
80
  `,
@@ -84,12 +84,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImpor
84
84
 
85
85
  class FormlyMatInputModule {
86
86
  }
87
- FormlyMatInputModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyMatInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
88
- FormlyMatInputModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyMatInputModule, declarations: [FormlyFieldInput], imports: [CommonModule,
87
+ FormlyMatInputModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
88
+ FormlyMatInputModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatInputModule, declarations: [FormlyFieldInput], imports: [CommonModule,
89
89
  ReactiveFormsModule,
90
90
  MatInputModule,
91
91
  FormlyMatFormFieldModule, i4.FormlyModule] });
92
- FormlyMatInputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyMatInputModule, imports: [[
92
+ FormlyMatInputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatInputModule, imports: [[
93
93
  CommonModule,
94
94
  ReactiveFormsModule,
95
95
  MatInputModule,
@@ -106,7 +106,7 @@ FormlyMatInputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", ve
106
106
  name: 'number',
107
107
  extends: 'input',
108
108
  defaultOptions: {
109
- templateOptions: {
109
+ props: {
110
110
  type: 'number',
111
111
  },
112
112
  },
@@ -115,7 +115,7 @@ FormlyMatInputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", ve
115
115
  name: 'integer',
116
116
  extends: 'input',
117
117
  defaultOptions: {
118
- templateOptions: {
118
+ props: {
119
119
  type: 'number',
120
120
  },
121
121
  },
@@ -123,7 +123,7 @@ FormlyMatInputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", ve
123
123
  ],
124
124
  }),
125
125
  ]] });
126
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FormlyMatInputModule, decorators: [{
126
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyMatInputModule, decorators: [{
127
127
  type: NgModule,
128
128
  args: [{
129
129
  declarations: [FormlyFieldInput],
@@ -144,7 +144,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImpor
144
144
  name: 'number',
145
145
  extends: 'input',
146
146
  defaultOptions: {
147
- templateOptions: {
147
+ props: {
148
148
  type: 'number',
149
149
  },
150
150
  },
@@ -153,7 +153,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImpor
153
153
  name: 'integer',
154
154
  extends: 'input',
155
155
  defaultOptions: {
156
- templateOptions: {
156
+ props: {
157
157
  type: 'number',
158
158
  },
159
159
  },
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-formly-material-input.mjs","sources":["../../../../src/ui/material/input/src/input.type.ts","../../../../src/ui/material/input/src/input.module.ts","../../../../src/ui/material/input/src/ngx-formly-material-input.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, OnInit } from '@angular/core';\nimport { FieldTypeConfig } from '@ngx-formly/core';\nimport { FieldType } from '@ngx-formly/material/form-field';\n\n@Component({\n selector: 'formly-field-mat-input',\n template: `\n <input\n *ngIf=\"type !== 'number'; else numberTmp\"\n matInput\n [id]=\"id\"\n [type]=\"type || 'text'\"\n [readonly]=\"to.readonly\"\n [required]=\"to.required\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [tabIndex]=\"to.tabindex\"\n [placeholder]=\"to.placeholder\"\n />\n <ng-template #numberTmp>\n <input\n matInput\n [id]=\"id\"\n type=\"number\"\n [readonly]=\"to.readonly\"\n [required]=\"to.required\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [tabIndex]=\"to.tabindex\"\n [placeholder]=\"to.placeholder\"\n />\n </ng-template>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldInput extends FieldType<FieldTypeConfig> implements OnInit {\n get type() {\n return this.to.type || 'text';\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\n\nimport { FormlyFieldInput } from './input.type';\n\n@NgModule({\n declarations: [FormlyFieldInput],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatInputModule,\n\n FormlyMatFormFieldModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'input',\n component: FormlyFieldInput,\n wrappers: ['form-field'],\n },\n { name: 'string', extends: 'input' },\n {\n name: 'number',\n extends: 'input',\n defaultOptions: {\n templateOptions: {\n type: 'number',\n },\n },\n },\n {\n name: 'integer',\n extends: 'input',\n defaultOptions: {\n templateOptions: {\n type: 'number',\n },\n },\n },\n ],\n }),\n ],\n})\nexport class FormlyMatInputModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;MAqCa,yBAAyB,SAA0B;IAC9D,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,EAAE,CAAC,IAAI,IAAI,MAAM,CAAC;KAC/B;;6GAHU,gBAAgB;iGAAhB,gBAAgB,qFA/BjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BT;2FAGU,gBAAgB;kBAjC5B,SAAS;mBAAC;oBACT,QAAQ,EAAE,wBAAwB;oBAClC,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BT;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;;;MCYY,oBAAoB;;iHAApB,oBAAoB;kHAApB,oBAAoB,iBArChB,gBAAgB,aAE7B,YAAY;QACZ,mBAAmB;QACnB,cAAc;QAEd,wB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;6BACF;yBACF,CAAC;qBACH;iBACF;;;AC/CD;;;;;;"}
1
+ {"version":3,"file":"ngx-formly-material-input.mjs","sources":["../../../../src/ui/material/input/src/input.type.ts","../../../../src/ui/material/input/src/input.module.ts","../../../../src/ui/material/input/src/ngx-formly-material-input.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, Type } from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/material/form-field';\n\ninterface InputProps extends FormlyFieldProps {}\n\nexport interface FormlyInputFieldConfig extends FormlyFieldConfig<InputProps> {\n type: 'input' | Type<FormlyFieldInput>;\n}\n\n@Component({\n selector: 'formly-field-mat-input',\n template: `\n <input\n *ngIf=\"type !== 'number'; else numberTmp\"\n matInput\n [id]=\"id\"\n [type]=\"type || 'text'\"\n [readonly]=\"props.readonly\"\n [required]=\"required\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [tabIndex]=\"props.tabindex\"\n [placeholder]=\"props.placeholder\"\n />\n <ng-template #numberTmp>\n <input\n matInput\n [id]=\"id\"\n type=\"number\"\n [readonly]=\"props.readonly\"\n [required]=\"required\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [tabIndex]=\"props.tabindex\"\n [placeholder]=\"props.placeholder\"\n />\n </ng-template>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldInput extends FieldType<FieldTypeConfig<InputProps>> {\n get type() {\n return this.props.type || 'text';\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\n\nimport { FormlyFieldInput } from './input.type';\n\n@NgModule({\n declarations: [FormlyFieldInput],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatInputModule,\n\n FormlyMatFormFieldModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'input',\n component: FormlyFieldInput,\n wrappers: ['form-field'],\n },\n { name: 'string', extends: 'input' },\n {\n name: 'number',\n extends: 'input',\n defaultOptions: {\n props: {\n type: 'number',\n },\n },\n },\n {\n name: 'integer',\n extends: 'input',\n defaultOptions: {\n props: {\n type: 'number',\n },\n },\n },\n ],\n }),\n ],\n})\nexport class FormlyMatInputModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;AA2CM,MAAO,gBAAiB,SAAQ,SAAsC,CAAA;AAC1E,IAAA,IAAI,IAAI,GAAA;AACN,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,MAAM,CAAC;KAClC;;8GAHU,gBAAgB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAhB,gBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,gBAAgB,EA/BjB,QAAA,EAAA,wBAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BT,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,IAAA,EAAA,QAAA,EAAA,QAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,CAAA,QAAA,EAAA,QAAA,EAAA,yHAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,IAAA,EAAA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