@angular/material 21.0.0-next.9 → 21.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 (202) hide show
  1. package/core/tokens/_classes.scss +1 -1
  2. package/core/tokens/m2/_md-sys-color.scss +17 -17
  3. package/fesm2022/_animation-chunk.mjs +10 -16
  4. package/fesm2022/_animation-chunk.mjs.map +1 -1
  5. package/fesm2022/_date-formats-chunk.mjs +68 -164
  6. package/fesm2022/_date-formats-chunk.mjs.map +1 -1
  7. package/fesm2022/_date-range-input-harness-chunk.mjs +284 -463
  8. package/fesm2022/_date-range-input-harness-chunk.mjs.map +1 -1
  9. package/fesm2022/_error-options-chunk.mjs +56 -19
  10. package/fesm2022/_error-options-chunk.mjs.map +1 -1
  11. package/fesm2022/_error-state-chunk.mjs +24 -31
  12. package/fesm2022/_error-state-chunk.mjs.map +1 -1
  13. package/fesm2022/_form-field-chunk.mjs +1224 -1017
  14. package/fesm2022/_form-field-chunk.mjs.map +1 -1
  15. package/fesm2022/_icon-button-chunk.mjs +243 -187
  16. package/fesm2022/_icon-button-chunk.mjs.map +1 -1
  17. package/fesm2022/_icon-registry-chunk.mjs +350 -575
  18. package/fesm2022/_icon-registry-chunk.mjs.map +1 -1
  19. package/fesm2022/_input-harness-chunk.mjs +56 -107
  20. package/fesm2022/_input-harness-chunk.mjs.map +1 -1
  21. package/fesm2022/_input-value-accessor-chunk.mjs +0 -6
  22. package/fesm2022/_input-value-accessor-chunk.mjs.map +1 -1
  23. package/fesm2022/_internal-form-field-chunk.mjs +59 -19
  24. package/fesm2022/_internal-form-field-chunk.mjs.map +1 -1
  25. package/fesm2022/_line-chunk.mjs +83 -43
  26. package/fesm2022/_line-chunk.mjs.map +1 -1
  27. package/fesm2022/_option-chunk.mjs +348 -311
  28. package/fesm2022/_option-chunk.mjs.map +1 -1
  29. package/fesm2022/_option-harness-chunk.mjs +23 -39
  30. package/fesm2022/_option-harness-chunk.mjs.map +1 -1
  31. package/fesm2022/_option-module-chunk.mjs +36 -10
  32. package/fesm2022/_option-module-chunk.mjs.map +1 -1
  33. package/fesm2022/_pseudo-checkbox-chunk.mjs +79 -44
  34. package/fesm2022/_pseudo-checkbox-chunk.mjs.map +1 -1
  35. package/fesm2022/_pseudo-checkbox-module-chunk.mjs +36 -10
  36. package/fesm2022/_pseudo-checkbox-module-chunk.mjs.map +1 -1
  37. package/fesm2022/_public-api-chunk.mjs +71 -134
  38. package/fesm2022/_public-api-chunk.mjs.map +1 -1
  39. package/fesm2022/_ripple-chunk.mjs +504 -600
  40. package/fesm2022/_ripple-chunk.mjs.map +1 -1
  41. package/fesm2022/_ripple-loader-chunk.mjs +120 -138
  42. package/fesm2022/_ripple-loader-chunk.mjs.map +1 -1
  43. package/fesm2022/_ripple-module-chunk.mjs +36 -10
  44. package/fesm2022/_ripple-module-chunk.mjs.map +1 -1
  45. package/fesm2022/_structural-styles-chunk.mjs +37 -10
  46. package/fesm2022/_structural-styles-chunk.mjs.map +1 -1
  47. package/fesm2022/_tooltip-chunk.mjs +810 -888
  48. package/fesm2022/_tooltip-chunk.mjs.map +1 -1
  49. package/fesm2022/autocomplete-testing.mjs +62 -86
  50. package/fesm2022/autocomplete-testing.mjs.map +1 -1
  51. package/fesm2022/autocomplete.mjs +965 -1126
  52. package/fesm2022/autocomplete.mjs.map +1 -1
  53. package/fesm2022/badge-testing.mjs +38 -54
  54. package/fesm2022/badge-testing.mjs.map +1 -1
  55. package/fesm2022/badge.mjs +321 -272
  56. package/fesm2022/badge.mjs.map +1 -1
  57. package/fesm2022/bottom-sheet-testing.mjs +10 -24
  58. package/fesm2022/bottom-sheet-testing.mjs.map +1 -1
  59. package/fesm2022/bottom-sheet.mjs +349 -344
  60. package/fesm2022/bottom-sheet.mjs.map +1 -1
  61. package/fesm2022/button-testing.mjs +60 -94
  62. package/fesm2022/button-testing.mjs.map +1 -1
  63. package/fesm2022/button-toggle-testing.mjs +76 -125
  64. package/fesm2022/button-toggle-testing.mjs.map +1 -1
  65. package/fesm2022/button-toggle.mjs +752 -662
  66. package/fesm2022/button-toggle.mjs.map +1 -1
  67. package/fesm2022/button.mjs +263 -158
  68. package/fesm2022/button.mjs.map +1 -1
  69. package/fesm2022/card-testing.mjs +19 -33
  70. package/fesm2022/card-testing.mjs.map +1 -1
  71. package/fesm2022/card.mjs +576 -272
  72. package/fesm2022/card.mjs.map +1 -1
  73. package/fesm2022/checkbox-testing.mjs +71 -123
  74. package/fesm2022/checkbox-testing.mjs.map +1 -1
  75. package/fesm2022/checkbox.mjs +515 -477
  76. package/fesm2022/checkbox.mjs.map +1 -1
  77. package/fesm2022/chips-testing.mjs +201 -344
  78. package/fesm2022/chips-testing.mjs.map +1 -1
  79. package/fesm2022/chips.mjs +2552 -2289
  80. package/fesm2022/chips.mjs.map +1 -1
  81. package/fesm2022/core-testing.mjs +14 -28
  82. package/fesm2022/core-testing.mjs.map +1 -1
  83. package/fesm2022/core.mjs +357 -328
  84. package/fesm2022/core.mjs.map +1 -1
  85. package/fesm2022/datepicker-testing.mjs +15 -25
  86. package/fesm2022/datepicker-testing.mjs.map +1 -1
  87. package/fesm2022/datepicker.mjs +4826 -4563
  88. package/fesm2022/datepicker.mjs.map +1 -1
  89. package/fesm2022/dialog-testing.mjs +93 -129
  90. package/fesm2022/dialog-testing.mjs.map +1 -1
  91. package/fesm2022/dialog.mjs +810 -829
  92. package/fesm2022/dialog.mjs.map +1 -1
  93. package/fesm2022/divider-testing.mjs +10 -11
  94. package/fesm2022/divider-testing.mjs.map +1 -1
  95. package/fesm2022/divider.mjs +119 -43
  96. package/fesm2022/divider.mjs.map +1 -1
  97. package/fesm2022/expansion-testing.mjs +74 -130
  98. package/fesm2022/expansion-testing.mjs.map +1 -1
  99. package/fesm2022/expansion.mjs +703 -515
  100. package/fesm2022/expansion.mjs.map +1 -1
  101. package/fesm2022/form-field-testing-control.mjs +16 -33
  102. package/fesm2022/form-field-testing-control.mjs.map +1 -1
  103. package/fesm2022/form-field-testing.mjs +118 -179
  104. package/fesm2022/form-field-testing.mjs.map +1 -1
  105. package/fesm2022/form-field.mjs +36 -10
  106. package/fesm2022/form-field.mjs.map +1 -1
  107. package/fesm2022/grid-list-testing.mjs +65 -113
  108. package/fesm2022/grid-list-testing.mjs.map +1 -1
  109. package/fesm2022/grid-list.mjs +559 -494
  110. package/fesm2022/grid-list.mjs.map +1 -1
  111. package/fesm2022/icon-testing.mjs +148 -127
  112. package/fesm2022/icon-testing.mjs.map +1 -1
  113. package/fesm2022/icon.mjs +325 -351
  114. package/fesm2022/icon.mjs.map +1 -1
  115. package/fesm2022/input-testing.mjs +59 -99
  116. package/fesm2022/input-testing.mjs.map +1 -1
  117. package/fesm2022/input.mjs +457 -520
  118. package/fesm2022/input.mjs.map +1 -1
  119. package/fesm2022/list-testing.mjs +251 -434
  120. package/fesm2022/list-testing.mjs.map +1 -1
  121. package/fesm2022/list.mjs +1522 -1204
  122. package/fesm2022/list.mjs.map +1 -1
  123. package/fesm2022/material.mjs +0 -5
  124. package/fesm2022/material.mjs.map +1 -1
  125. package/fesm2022/menu-testing.mjs +159 -228
  126. package/fesm2022/menu-testing.mjs.map +1 -1
  127. package/fesm2022/menu.mjs +1338 -1343
  128. package/fesm2022/menu.mjs.map +1 -1
  129. package/fesm2022/paginator-testing.mjs +55 -79
  130. package/fesm2022/paginator-testing.mjs.map +1 -1
  131. package/fesm2022/paginator.mjs +381 -309
  132. package/fesm2022/paginator.mjs.map +1 -1
  133. package/fesm2022/progress-bar-testing.mjs +12 -21
  134. package/fesm2022/progress-bar-testing.mjs.map +1 -1
  135. package/fesm2022/progress-bar.mjs +224 -169
  136. package/fesm2022/progress-bar.mjs.map +1 -1
  137. package/fesm2022/progress-spinner-testing.mjs +13 -23
  138. package/fesm2022/progress-spinner-testing.mjs.map +1 -1
  139. package/fesm2022/progress-spinner.mjs +235 -160
  140. package/fesm2022/progress-spinner.mjs.map +1 -1
  141. package/fesm2022/radio-testing.mjs +133 -208
  142. package/fesm2022/radio-testing.mjs.map +1 -1
  143. package/fesm2022/radio.mjs +712 -679
  144. package/fesm2022/radio.mjs.map +1 -1
  145. package/fesm2022/select-testing.mjs +83 -117
  146. package/fesm2022/select-testing.mjs.map +1 -1
  147. package/fesm2022/select.mjs +1116 -1246
  148. package/fesm2022/select.mjs.map +1 -1
  149. package/fesm2022/sidenav-testing.mjs +54 -120
  150. package/fesm2022/sidenav-testing.mjs.map +1 -1
  151. package/fesm2022/sidenav.mjs +1078 -995
  152. package/fesm2022/sidenav.mjs.map +1 -1
  153. package/fesm2022/slide-toggle-testing.mjs +57 -92
  154. package/fesm2022/slide-toggle-testing.mjs.map +1 -1
  155. package/fesm2022/slide-toggle.mjs +369 -279
  156. package/fesm2022/slide-toggle.mjs.map +1 -1
  157. package/fesm2022/slider-testing.mjs +90 -138
  158. package/fesm2022/slider-testing.mjs.map +1 -1
  159. package/fesm2022/slider.mjs +1651 -1716
  160. package/fesm2022/slider.mjs.map +1 -1
  161. package/fesm2022/snack-bar-testing.mjs +40 -87
  162. package/fesm2022/snack-bar-testing.mjs.map +1 -1
  163. package/fesm2022/snack-bar.mjs +763 -714
  164. package/fesm2022/snack-bar.mjs.map +1 -1
  165. package/fesm2022/sort-testing.mjs +45 -66
  166. package/fesm2022/sort-testing.mjs.map +1 -1
  167. package/fesm2022/sort.mjs +419 -344
  168. package/fesm2022/sort.mjs.map +1 -1
  169. package/fesm2022/stepper-testing.mjs +78 -154
  170. package/fesm2022/stepper-testing.mjs.map +1 -1
  171. package/fesm2022/stepper.mjs +790 -498
  172. package/fesm2022/stepper.mjs.map +1 -1
  173. package/fesm2022/table-testing.mjs +120 -213
  174. package/fesm2022/table-testing.mjs.map +1 -1
  175. package/fesm2022/table.mjs +1026 -684
  176. package/fesm2022/table.mjs.map +1 -1
  177. package/fesm2022/tabs-testing.mjs +125 -197
  178. package/fesm2022/tabs-testing.mjs.map +1 -1
  179. package/fesm2022/tabs.mjs +2351 -2028
  180. package/fesm2022/tabs.mjs.map +1 -1
  181. package/fesm2022/timepicker-testing.mjs +113 -172
  182. package/fesm2022/timepicker-testing.mjs.map +1 -1
  183. package/fesm2022/timepicker.mjs +1019 -826
  184. package/fesm2022/timepicker.mjs.map +1 -1
  185. package/fesm2022/toolbar-testing.mjs +16 -27
  186. package/fesm2022/toolbar-testing.mjs.map +1 -1
  187. package/fesm2022/toolbar.mjs +163 -78
  188. package/fesm2022/toolbar.mjs.map +1 -1
  189. package/fesm2022/tooltip-testing.mjs +41 -52
  190. package/fesm2022/tooltip-testing.mjs.map +1 -1
  191. package/fesm2022/tooltip.mjs +36 -10
  192. package/fesm2022/tooltip.mjs.map +1 -1
  193. package/fesm2022/tree-testing.mjs +86 -162
  194. package/fesm2022/tree-testing.mjs.map +1 -1
  195. package/fesm2022/tree.mjs +638 -466
  196. package/fesm2022/tree.mjs.map +1 -1
  197. package/package.json +2 -2
  198. package/schematics/ng-add/index.js +1 -1
  199. package/types/expansion.d.ts +4 -2
  200. package/types/menu-testing.d.ts +2 -0
  201. package/types/select.d.ts +1 -1
  202. package/types/timepicker.d.ts +1 -0
@@ -20,539 +20,476 @@ import './_animation-chunk.mjs';
20
20
  import '@angular/cdk/layout';
21
21
  import '@angular/cdk/observers';
22
22
 
23
- /** @docs-private */
24
23
  function getMatInputUnsupportedTypeError(type) {
25
- return Error(`Input type "${type}" isn't supported by matInput.`);
24
+ return Error(`Input type "${type}" isn't supported by matInput.`);
26
25
  }
27
26
 
28
- // Invalid input type. Using one of these will throw an MatInputUnsupportedTypeError.
29
- const MAT_INPUT_INVALID_TYPES = [
30
- 'button',
31
- 'checkbox',
32
- 'file',
33
- 'hidden',
34
- 'image',
35
- 'radio',
36
- 'range',
37
- 'reset',
38
- 'submit',
39
- ];
40
- /** Injection token that can be used to provide the default options for the input. */
27
+ const MAT_INPUT_INVALID_TYPES = ['button', 'checkbox', 'file', 'hidden', 'image', 'radio', 'range', 'reset', 'submit'];
41
28
  const MAT_INPUT_CONFIG = new InjectionToken('MAT_INPUT_CONFIG');
42
29
  class MatInput {
43
- _elementRef = inject(ElementRef);
44
- _platform = inject(Platform);
45
- ngControl = inject(NgControl, { optional: true, self: true });
46
- _autofillMonitor = inject(AutofillMonitor);
47
- _ngZone = inject(NgZone);
48
- _formField = inject(MAT_FORM_FIELD, { optional: true });
49
- _renderer = inject(Renderer2);
50
- _uid = inject(_IdGenerator).getId('mat-input-');
51
- _previousNativeValue;
52
- _inputValueAccessor;
53
- _signalBasedValueAccessor;
54
- _previousPlaceholder;
55
- _errorStateTracker;
56
- _config = inject(MAT_INPUT_CONFIG, { optional: true });
57
- _cleanupIosKeyup;
58
- _cleanupWebkitWheel;
59
- /** Whether the component is being rendered on the server. */
60
- _isServer;
61
- /** Whether the component is a native html select. */
62
- _isNativeSelect;
63
- /** Whether the component is a textarea. */
64
- _isTextarea;
65
- /** Whether the input is inside of a form field. */
66
- _isInFormField;
67
- /**
68
- * Implemented as part of MatFormFieldControl.
69
- * @docs-private
70
- */
71
- focused = false;
72
- /**
73
- * Implemented as part of MatFormFieldControl.
74
- * @docs-private
75
- */
76
- stateChanges = new Subject();
77
- /**
78
- * Implemented as part of MatFormFieldControl.
79
- * @docs-private
80
- */
81
- controlType = 'mat-input';
82
- /**
83
- * Implemented as part of MatFormFieldControl.
84
- * @docs-private
85
- */
86
- autofilled = false;
87
- /**
88
- * Implemented as part of MatFormFieldControl.
89
- * @docs-private
90
- */
91
- get disabled() {
92
- return this._disabled;
93
- }
94
- set disabled(value) {
95
- this._disabled = coerceBooleanProperty(value);
96
- // Browsers may not fire the blur event if the input is disabled too quickly.
97
- // Reset from here to ensure that the element doesn't become stuck.
98
- if (this.focused) {
99
- this.focused = false;
100
- this.stateChanges.next();
101
- }
102
- }
103
- _disabled = false;
104
- /**
105
- * Implemented as part of MatFormFieldControl.
106
- * @docs-private
107
- */
108
- get id() {
109
- return this._id;
110
- }
111
- set id(value) {
112
- this._id = value || this._uid;
113
- }
114
- _id;
115
- /**
116
- * Implemented as part of MatFormFieldControl.
117
- * @docs-private
118
- */
119
- placeholder;
120
- /**
121
- * Name of the input.
122
- * @docs-private
123
- */
124
- name;
125
- /**
126
- * Implemented as part of MatFormFieldControl.
127
- * @docs-private
128
- */
129
- get required() {
130
- return this._required ?? this.ngControl?.control?.hasValidator(Validators.required) ?? false;
131
- }
132
- set required(value) {
133
- this._required = coerceBooleanProperty(value);
134
- }
135
- _required;
136
- /** Input type of the element. */
137
- get type() {
138
- return this._type;
139
- }
140
- set type(value) {
141
- this._type = value || 'text';
142
- this._validateType();
143
- // When using Angular inputs, developers are no longer able to set the properties on the native
144
- // input element. To ensure that bindings for `type` work, we need to sync the setter
145
- // with the native property. Textarea elements don't support the type property or attribute.
146
- if (!this._isTextarea && getSupportedInputTypes().has(this._type)) {
147
- this._elementRef.nativeElement.type = this._type;
148
- }
149
- }
150
- _type = 'text';
151
- /** An object used to control when error messages are shown. */
152
- get errorStateMatcher() {
153
- return this._errorStateTracker.matcher;
154
- }
155
- set errorStateMatcher(value) {
156
- this._errorStateTracker.matcher = value;
157
- }
158
- /**
159
- * Implemented as part of MatFormFieldControl.
160
- * @docs-private
161
- */
162
- userAriaDescribedBy;
163
- /**
164
- * Implemented as part of MatFormFieldControl.
165
- * @docs-private
166
- */
167
- get value() {
168
- return this._signalBasedValueAccessor
169
- ? this._signalBasedValueAccessor.value()
170
- : this._inputValueAccessor.value;
171
- }
172
- set value(value) {
173
- if (value !== this.value) {
174
- if (this._signalBasedValueAccessor) {
175
- this._signalBasedValueAccessor.value.set(value);
176
- }
177
- else {
178
- this._inputValueAccessor.value = value;
179
- }
180
- this.stateChanges.next();
181
- }
182
- }
183
- /** Whether the element is readonly. */
184
- get readonly() {
185
- return this._readonly;
186
- }
187
- set readonly(value) {
188
- this._readonly = coerceBooleanProperty(value);
189
- }
190
- _readonly = false;
191
- /** Whether the input should remain interactive when it is disabled. */
192
- disabledInteractive;
193
- /** Whether the input is in an error state. */
194
- get errorState() {
195
- return this._errorStateTracker.errorState;
196
- }
197
- set errorState(value) {
198
- this._errorStateTracker.errorState = value;
199
- }
200
- _neverEmptyInputTypes = [
201
- 'date',
202
- 'datetime',
203
- 'datetime-local',
204
- 'month',
205
- 'time',
206
- 'week',
207
- ].filter(t => getSupportedInputTypes().has(t));
208
- constructor() {
209
- const parentForm = inject(NgForm, { optional: true });
210
- const parentFormGroup = inject(FormGroupDirective, { optional: true });
211
- const defaultErrorStateMatcher = inject(ErrorStateMatcher);
212
- const accessor = inject(MAT_INPUT_VALUE_ACCESSOR, { optional: true, self: true });
213
- const element = this._elementRef.nativeElement;
214
- const nodeName = element.nodeName.toLowerCase();
215
- if (accessor) {
216
- if (isSignal(accessor.value)) {
217
- this._signalBasedValueAccessor = accessor;
218
- }
219
- else {
220
- this._inputValueAccessor = accessor;
221
- }
222
- }
223
- else {
224
- // If no input value accessor was explicitly specified, use the element as the input value
225
- // accessor.
226
- this._inputValueAccessor = element;
227
- }
228
- this._previousNativeValue = this.value;
229
- // Force setter to be called in case id was not specified.
230
- this.id = this.id;
231
- // On some versions of iOS the caret gets stuck in the wrong place when holding down the delete
232
- // key. In order to get around this we need to "jiggle" the caret loose. Since this bug only
233
- // exists on iOS, we only bother to install the listener on iOS.
234
- if (this._platform.IOS) {
235
- this._ngZone.runOutsideAngular(() => {
236
- this._cleanupIosKeyup = this._renderer.listen(element, 'keyup', this._iOSKeyupListener);
237
- });
238
- }
239
- this._errorStateTracker = new _ErrorStateTracker(defaultErrorStateMatcher, this.ngControl, parentFormGroup, parentForm, this.stateChanges);
240
- this._isServer = !this._platform.isBrowser;
241
- this._isNativeSelect = nodeName === 'select';
242
- this._isTextarea = nodeName === 'textarea';
243
- this._isInFormField = !!this._formField;
244
- this.disabledInteractive = this._config?.disabledInteractive || false;
245
- if (this._isNativeSelect) {
246
- this.controlType = element.multiple
247
- ? 'mat-native-select-multiple'
248
- : 'mat-native-select';
249
- }
250
- if (this._signalBasedValueAccessor) {
251
- effect(() => {
252
- // Read the value so the effect can register the dependency.
253
- this._signalBasedValueAccessor.value();
254
- this.stateChanges.next();
255
- });
256
- }
257
- }
258
- ngAfterViewInit() {
259
- if (this._platform.isBrowser) {
260
- this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(event => {
261
- this.autofilled = event.isAutofilled;
262
- this.stateChanges.next();
263
- });
264
- }
265
- }
266
- ngOnChanges() {
30
+ _elementRef = inject(ElementRef);
31
+ _platform = inject(Platform);
32
+ ngControl = inject(NgControl, {
33
+ optional: true,
34
+ self: true
35
+ });
36
+ _autofillMonitor = inject(AutofillMonitor);
37
+ _ngZone = inject(NgZone);
38
+ _formField = inject(MAT_FORM_FIELD, {
39
+ optional: true
40
+ });
41
+ _renderer = inject(Renderer2);
42
+ _uid = inject(_IdGenerator).getId('mat-input-');
43
+ _previousNativeValue;
44
+ _inputValueAccessor;
45
+ _signalBasedValueAccessor;
46
+ _previousPlaceholder;
47
+ _errorStateTracker;
48
+ _config = inject(MAT_INPUT_CONFIG, {
49
+ optional: true
50
+ });
51
+ _cleanupIosKeyup;
52
+ _cleanupWebkitWheel;
53
+ _isServer;
54
+ _isNativeSelect;
55
+ _isTextarea;
56
+ _isInFormField;
57
+ focused = false;
58
+ stateChanges = new Subject();
59
+ controlType = 'mat-input';
60
+ autofilled = false;
61
+ get disabled() {
62
+ return this._disabled;
63
+ }
64
+ set disabled(value) {
65
+ this._disabled = coerceBooleanProperty(value);
66
+ if (this.focused) {
67
+ this.focused = false;
68
+ this.stateChanges.next();
69
+ }
70
+ }
71
+ _disabled = false;
72
+ get id() {
73
+ return this._id;
74
+ }
75
+ set id(value) {
76
+ this._id = value || this._uid;
77
+ }
78
+ _id;
79
+ placeholder;
80
+ name;
81
+ get required() {
82
+ return this._required ?? this.ngControl?.control?.hasValidator(Validators.required) ?? false;
83
+ }
84
+ set required(value) {
85
+ this._required = coerceBooleanProperty(value);
86
+ }
87
+ _required;
88
+ get type() {
89
+ return this._type;
90
+ }
91
+ set type(value) {
92
+ this._type = value || 'text';
93
+ this._validateType();
94
+ if (!this._isTextarea && getSupportedInputTypes().has(this._type)) {
95
+ this._elementRef.nativeElement.type = this._type;
96
+ }
97
+ }
98
+ _type = 'text';
99
+ get errorStateMatcher() {
100
+ return this._errorStateTracker.matcher;
101
+ }
102
+ set errorStateMatcher(value) {
103
+ this._errorStateTracker.matcher = value;
104
+ }
105
+ userAriaDescribedBy;
106
+ get value() {
107
+ return this._signalBasedValueAccessor ? this._signalBasedValueAccessor.value() : this._inputValueAccessor.value;
108
+ }
109
+ set value(value) {
110
+ if (value !== this.value) {
111
+ if (this._signalBasedValueAccessor) {
112
+ this._signalBasedValueAccessor.value.set(value);
113
+ } else {
114
+ this._inputValueAccessor.value = value;
115
+ }
116
+ this.stateChanges.next();
117
+ }
118
+ }
119
+ get readonly() {
120
+ return this._readonly;
121
+ }
122
+ set readonly(value) {
123
+ this._readonly = coerceBooleanProperty(value);
124
+ }
125
+ _readonly = false;
126
+ disabledInteractive;
127
+ get errorState() {
128
+ return this._errorStateTracker.errorState;
129
+ }
130
+ set errorState(value) {
131
+ this._errorStateTracker.errorState = value;
132
+ }
133
+ _neverEmptyInputTypes = ['date', 'datetime', 'datetime-local', 'month', 'time', 'week'].filter(t => getSupportedInputTypes().has(t));
134
+ constructor() {
135
+ const parentForm = inject(NgForm, {
136
+ optional: true
137
+ });
138
+ const parentFormGroup = inject(FormGroupDirective, {
139
+ optional: true
140
+ });
141
+ const defaultErrorStateMatcher = inject(ErrorStateMatcher);
142
+ const accessor = inject(MAT_INPUT_VALUE_ACCESSOR, {
143
+ optional: true,
144
+ self: true
145
+ });
146
+ const element = this._elementRef.nativeElement;
147
+ const nodeName = element.nodeName.toLowerCase();
148
+ if (accessor) {
149
+ if (isSignal(accessor.value)) {
150
+ this._signalBasedValueAccessor = accessor;
151
+ } else {
152
+ this._inputValueAccessor = accessor;
153
+ }
154
+ } else {
155
+ this._inputValueAccessor = element;
156
+ }
157
+ this._previousNativeValue = this.value;
158
+ this.id = this.id;
159
+ if (this._platform.IOS) {
160
+ this._ngZone.runOutsideAngular(() => {
161
+ this._cleanupIosKeyup = this._renderer.listen(element, 'keyup', this._iOSKeyupListener);
162
+ });
163
+ }
164
+ this._errorStateTracker = new _ErrorStateTracker(defaultErrorStateMatcher, this.ngControl, parentFormGroup, parentForm, this.stateChanges);
165
+ this._isServer = !this._platform.isBrowser;
166
+ this._isNativeSelect = nodeName === 'select';
167
+ this._isTextarea = nodeName === 'textarea';
168
+ this._isInFormField = !!this._formField;
169
+ this.disabledInteractive = this._config?.disabledInteractive || false;
170
+ if (this._isNativeSelect) {
171
+ this.controlType = element.multiple ? 'mat-native-select-multiple' : 'mat-native-select';
172
+ }
173
+ if (this._signalBasedValueAccessor) {
174
+ effect(() => {
175
+ this._signalBasedValueAccessor.value();
267
176
  this.stateChanges.next();
177
+ });
268
178
  }
269
- ngOnDestroy() {
270
- this.stateChanges.complete();
271
- if (this._platform.isBrowser) {
272
- this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement);
273
- }
274
- this._cleanupIosKeyup?.();
275
- this._cleanupWebkitWheel?.();
276
- }
277
- ngDoCheck() {
278
- if (this.ngControl) {
279
- // We need to re-evaluate this on every change detection cycle, because there are some
280
- // error triggers that we can't subscribe to (e.g. parent form submissions). This means
281
- // that whatever logic is in here has to be super lean or we risk destroying the performance.
282
- this.updateErrorState();
283
- // Since the input isn't a `ControlValueAccessor`, we don't have a good way of knowing when
284
- // the disabled state has changed. We can't use the `ngControl.statusChanges`, because it
285
- // won't fire if the input is disabled with `emitEvents = false`, despite the input becoming
286
- // disabled.
287
- if (this.ngControl.disabled !== null && this.ngControl.disabled !== this.disabled) {
288
- this.disabled = this.ngControl.disabled;
289
- this.stateChanges.next();
290
- }
291
- }
292
- // We need to dirty-check the native element's value, because there are some cases where
293
- // we won't be notified when it changes (e.g. the consumer isn't using forms or they're
294
- // updating the value using `emitEvent: false`).
295
- this._dirtyCheckNativeValue();
296
- // We need to dirty-check and set the placeholder attribute ourselves, because whether it's
297
- // present or not depends on a query which is prone to "changed after checked" errors.
298
- this._dirtyCheckPlaceholder();
299
- }
300
- /** Focuses the input. */
301
- focus(options) {
302
- this._elementRef.nativeElement.focus(options);
303
- }
304
- /** Refreshes the error state of the input. */
305
- updateErrorState() {
306
- this._errorStateTracker.updateErrorState();
307
- }
308
- /** Callback for the cases where the focused state of the input changes. */
309
- _focusChanged(isFocused) {
310
- if (isFocused === this.focused) {
311
- return;
312
- }
313
- if (!this._isNativeSelect && isFocused && this.disabled && this.disabledInteractive) {
314
- const element = this._elementRef.nativeElement;
315
- // Focusing an input that has text will cause all the text to be selected. Clear it since
316
- // the user won't be able to change it. This is based on the internal implementation.
317
- if (element.type === 'number') {
318
- // setSelectionRange doesn't work on number inputs so it needs to be set briefly to text.
319
- element.type = 'text';
320
- element.setSelectionRange(0, 0);
321
- element.type = 'number';
322
- }
323
- else {
324
- element.setSelectionRange(0, 0);
325
- }
326
- }
327
- this.focused = isFocused;
179
+ }
180
+ ngAfterViewInit() {
181
+ if (this._platform.isBrowser) {
182
+ this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(event => {
183
+ this.autofilled = event.isAutofilled;
328
184
  this.stateChanges.next();
329
- }
330
- _onInput() {
331
- // This is a noop function and is used to let Angular know whenever the value changes.
332
- // Angular will run a new change detection each time the `input` event has been dispatched.
333
- // It's necessary that Angular recognizes the value change, because when floatingLabel
334
- // is set to false and Angular forms aren't used, the placeholder won't recognize the
335
- // value changes and will not disappear.
336
- // Listening to the input event wouldn't be necessary when the input is using the
337
- // FormsModule or ReactiveFormsModule, because Angular forms also listens to input events.
338
- }
339
- /** Does some manual dirty checking on the native input `value` property. */
340
- _dirtyCheckNativeValue() {
341
- const newValue = this._elementRef.nativeElement.value;
342
- if (this._previousNativeValue !== newValue) {
343
- this._previousNativeValue = newValue;
344
- this.stateChanges.next();
345
- }
346
- }
347
- /** Does some manual dirty checking on the native input `placeholder` attribute. */
348
- _dirtyCheckPlaceholder() {
349
- const placeholder = this._getPlaceholder();
350
- if (placeholder !== this._previousPlaceholder) {
351
- const element = this._elementRef.nativeElement;
352
- this._previousPlaceholder = placeholder;
353
- placeholder
354
- ? element.setAttribute('placeholder', placeholder)
355
- : element.removeAttribute('placeholder');
356
- }
357
- }
358
- /** Gets the current placeholder of the form field. */
359
- _getPlaceholder() {
360
- return this.placeholder || null;
361
- }
362
- /** Make sure the input is a supported type. */
363
- _validateType() {
364
- if (MAT_INPUT_INVALID_TYPES.indexOf(this._type) > -1 &&
365
- (typeof ngDevMode === 'undefined' || ngDevMode)) {
366
- throw getMatInputUnsupportedTypeError(this._type);
367
- }
368
- }
369
- /** Checks whether the input type is one of the types that are never empty. */
370
- _isNeverEmpty() {
371
- return this._neverEmptyInputTypes.indexOf(this._type) > -1;
372
- }
373
- /** Checks whether the input is invalid based on the native validation. */
374
- _isBadInput() {
375
- // The `validity` property won't be present on platform-server.
376
- let validity = this._elementRef.nativeElement.validity;
377
- return validity && validity.badInput;
378
- }
379
- /**
380
- * Implemented as part of MatFormFieldControl.
381
- * @docs-private
382
- */
383
- get empty() {
384
- return (!this._isNeverEmpty() &&
385
- !this._elementRef.nativeElement.value &&
386
- !this._isBadInput() &&
387
- !this.autofilled);
388
- }
389
- /**
390
- * Implemented as part of MatFormFieldControl.
391
- * @docs-private
392
- */
393
- get shouldLabelFloat() {
394
- if (this._isNativeSelect) {
395
- // For a single-selection `<select>`, the label should float when the selected option has
396
- // a non-empty display value. For a `<select multiple>`, the label *always* floats to avoid
397
- // overlapping the label with the options.
398
- const selectElement = this._elementRef.nativeElement;
399
- const firstOption = selectElement.options[0];
400
- // On most browsers the `selectedIndex` will always be 0, however on IE and Edge it'll be
401
- // -1 if the `value` is set to something, that isn't in the list of options, at a later point.
402
- return (this.focused ||
403
- selectElement.multiple ||
404
- !this.empty ||
405
- !!(selectElement.selectedIndex > -1 && firstOption && firstOption.label));
406
- }
407
- else {
408
- return (this.focused && !this.disabled) || !this.empty;
409
- }
410
- }
411
- /**
412
- * Implemented as part of MatFormFieldControl.
413
- * @docs-private
414
- */
415
- get describedByIds() {
416
- const element = this._elementRef.nativeElement;
417
- const existingDescribedBy = element.getAttribute('aria-describedby');
418
- return existingDescribedBy?.split(' ') || [];
419
- }
420
- /**
421
- * Implemented as part of MatFormFieldControl.
422
- * @docs-private
423
- */
424
- setDescribedByIds(ids) {
425
- const element = this._elementRef.nativeElement;
426
- if (ids.length) {
427
- element.setAttribute('aria-describedby', ids.join(' '));
428
- }
429
- else {
430
- element.removeAttribute('aria-describedby');
431
- }
432
- }
433
- /**
434
- * Implemented as part of MatFormFieldControl.
435
- * @docs-private
436
- */
437
- onContainerClick() {
438
- // Do not re-focus the input element if the element is already focused. Otherwise it can happen
439
- // that someone clicks on a time input and the cursor resets to the "hours" field while the
440
- // "minutes" field was actually clicked. See: https://github.com/angular/components/issues/12849
441
- if (!this.focused) {
442
- this.focus();
443
- }
444
- }
445
- /** Whether the form control is a native select that is displayed inline. */
446
- _isInlineSelect() {
447
- const element = this._elementRef.nativeElement;
448
- return this._isNativeSelect && (element.multiple || element.size > 1);
449
- }
450
- _iOSKeyupListener = (event) => {
451
- const el = event.target;
452
- // Note: We specifically check for 0, rather than `!el.selectionStart`, because the two
453
- // indicate different things. If the value is 0, it means that the caret is at the start
454
- // of the input, whereas a value of `null` means that the input doesn't support
455
- // manipulating the selection range. Inputs that don't support setting the selection range
456
- // will throw an error so we want to avoid calling `setSelectionRange` on them. See:
457
- // https://html.spec.whatwg.org/multipage/input.html#do-not-apply
458
- if (!el.value && el.selectionStart === 0 && el.selectionEnd === 0) {
459
- // Note: Just setting `0, 0` doesn't fix the issue. Setting
460
- // `1, 1` fixes it for the first time that you type text and
461
- // then hold delete. Toggling to `1, 1` and then back to
462
- // `0, 0` seems to completely fix it.
463
- el.setSelectionRange(1, 1);
464
- el.setSelectionRange(0, 0);
465
- }
466
- };
467
- /** Gets the value to set on the `readonly` attribute. */
468
- _getReadonlyAttribute() {
469
- if (this._isNativeSelect) {
470
- return null;
471
- }
472
- if (this.readonly || (this.disabled && this.disabledInteractive)) {
473
- return 'true';
474
- }
475
- return null;
476
- }
477
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatInput, deps: [], target: i0.ɵɵFactoryTarget.Directive });
478
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "20.2.0-next.2", type: MatInput, isStandalone: true, selector: "input[matInput], textarea[matInput], select[matNativeControl],\n input[matNativeControl], textarea[matNativeControl]", inputs: { disabled: "disabled", id: "id", placeholder: "placeholder", name: "name", required: "required", type: "type", errorStateMatcher: "errorStateMatcher", userAriaDescribedBy: ["aria-describedby", "userAriaDescribedBy"], value: "value", readonly: "readonly", disabledInteractive: ["disabledInteractive", "disabledInteractive", booleanAttribute] }, host: { listeners: { "focus": "_focusChanged(true)", "blur": "_focusChanged(false)", "input": "_onInput()" }, properties: { "class.mat-input-server": "_isServer", "class.mat-mdc-form-field-textarea-control": "_isInFormField && _isTextarea", "class.mat-mdc-form-field-input-control": "_isInFormField", "class.mat-mdc-input-disabled-interactive": "disabledInteractive", "class.mdc-text-field__input": "_isInFormField", "class.mat-mdc-native-select-inline": "_isInlineSelect()", "id": "id", "disabled": "disabled && !disabledInteractive", "required": "required", "attr.name": "name || null", "attr.readonly": "_getReadonlyAttribute()", "attr.aria-disabled": "disabled && disabledInteractive ? \"true\" : null", "attr.aria-invalid": "(empty && required) ? null : errorState", "attr.aria-required": "required", "attr.id": "id" }, classAttribute: "mat-mdc-input-element" }, providers: [{ provide: MatFormFieldControl, useExisting: MatInput }], exportAs: ["matInput"], usesOnChanges: true, ngImport: i0 });
185
+ });
186
+ }
187
+ }
188
+ ngOnChanges() {
189
+ this.stateChanges.next();
190
+ }
191
+ ngOnDestroy() {
192
+ this.stateChanges.complete();
193
+ if (this._platform.isBrowser) {
194
+ this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement);
195
+ }
196
+ this._cleanupIosKeyup?.();
197
+ this._cleanupWebkitWheel?.();
198
+ }
199
+ ngDoCheck() {
200
+ if (this.ngControl) {
201
+ this.updateErrorState();
202
+ if (this.ngControl.disabled !== null && this.ngControl.disabled !== this.disabled) {
203
+ this.disabled = this.ngControl.disabled;
204
+ this.stateChanges.next();
205
+ }
206
+ }
207
+ this._dirtyCheckNativeValue();
208
+ this._dirtyCheckPlaceholder();
209
+ }
210
+ focus(options) {
211
+ this._elementRef.nativeElement.focus(options);
212
+ }
213
+ updateErrorState() {
214
+ this._errorStateTracker.updateErrorState();
215
+ }
216
+ _focusChanged(isFocused) {
217
+ if (isFocused === this.focused) {
218
+ return;
219
+ }
220
+ if (!this._isNativeSelect && isFocused && this.disabled && this.disabledInteractive) {
221
+ const element = this._elementRef.nativeElement;
222
+ if (element.type === 'number') {
223
+ element.type = 'text';
224
+ element.setSelectionRange(0, 0);
225
+ element.type = 'number';
226
+ } else {
227
+ element.setSelectionRange(0, 0);
228
+ }
229
+ }
230
+ this.focused = isFocused;
231
+ this.stateChanges.next();
232
+ }
233
+ _onInput() {}
234
+ _dirtyCheckNativeValue() {
235
+ const newValue = this._elementRef.nativeElement.value;
236
+ if (this._previousNativeValue !== newValue) {
237
+ this._previousNativeValue = newValue;
238
+ this.stateChanges.next();
239
+ }
240
+ }
241
+ _dirtyCheckPlaceholder() {
242
+ const placeholder = this._getPlaceholder();
243
+ if (placeholder !== this._previousPlaceholder) {
244
+ const element = this._elementRef.nativeElement;
245
+ this._previousPlaceholder = placeholder;
246
+ placeholder ? element.setAttribute('placeholder', placeholder) : element.removeAttribute('placeholder');
247
+ }
248
+ }
249
+ _getPlaceholder() {
250
+ return this.placeholder || null;
251
+ }
252
+ _validateType() {
253
+ if (MAT_INPUT_INVALID_TYPES.indexOf(this._type) > -1 && (typeof ngDevMode === 'undefined' || ngDevMode)) {
254
+ throw getMatInputUnsupportedTypeError(this._type);
255
+ }
256
+ }
257
+ _isNeverEmpty() {
258
+ return this._neverEmptyInputTypes.indexOf(this._type) > -1;
259
+ }
260
+ _isBadInput() {
261
+ let validity = this._elementRef.nativeElement.validity;
262
+ return validity && validity.badInput;
263
+ }
264
+ get empty() {
265
+ return !this._isNeverEmpty() && !this._elementRef.nativeElement.value && !this._isBadInput() && !this.autofilled;
266
+ }
267
+ get shouldLabelFloat() {
268
+ if (this._isNativeSelect) {
269
+ const selectElement = this._elementRef.nativeElement;
270
+ const firstOption = selectElement.options[0];
271
+ return this.focused || selectElement.multiple || !this.empty || !!(selectElement.selectedIndex > -1 && firstOption && firstOption.label);
272
+ } else {
273
+ return this.focused && !this.disabled || !this.empty;
274
+ }
275
+ }
276
+ get describedByIds() {
277
+ const element = this._elementRef.nativeElement;
278
+ const existingDescribedBy = element.getAttribute('aria-describedby');
279
+ return existingDescribedBy?.split(' ') || [];
280
+ }
281
+ setDescribedByIds(ids) {
282
+ const element = this._elementRef.nativeElement;
283
+ if (ids.length) {
284
+ element.setAttribute('aria-describedby', ids.join(' '));
285
+ } else {
286
+ element.removeAttribute('aria-describedby');
287
+ }
288
+ }
289
+ onContainerClick() {
290
+ if (!this.focused) {
291
+ this.focus();
292
+ }
293
+ }
294
+ _isInlineSelect() {
295
+ const element = this._elementRef.nativeElement;
296
+ return this._isNativeSelect && (element.multiple || element.size > 1);
297
+ }
298
+ _iOSKeyupListener = event => {
299
+ const el = event.target;
300
+ if (!el.value && el.selectionStart === 0 && el.selectionEnd === 0) {
301
+ el.setSelectionRange(1, 1);
302
+ el.setSelectionRange(0, 0);
303
+ }
304
+ };
305
+ _getReadonlyAttribute() {
306
+ if (this._isNativeSelect) {
307
+ return null;
308
+ }
309
+ if (this.readonly || this.disabled && this.disabledInteractive) {
310
+ return 'true';
311
+ }
312
+ return null;
313
+ }
314
+ static ɵfac = i0.ɵɵngDeclareFactory({
315
+ minVersion: "12.0.0",
316
+ version: "20.2.0-next.2",
317
+ ngImport: i0,
318
+ type: MatInput,
319
+ deps: [],
320
+ target: i0.ɵɵFactoryTarget.Directive
321
+ });
322
+ static ɵdir = i0.ɵɵngDeclareDirective({
323
+ minVersion: "16.1.0",
324
+ version: "20.2.0-next.2",
325
+ type: MatInput,
326
+ isStandalone: true,
327
+ selector: "input[matInput], textarea[matInput], select[matNativeControl],\n input[matNativeControl], textarea[matNativeControl]",
328
+ inputs: {
329
+ disabled: "disabled",
330
+ id: "id",
331
+ placeholder: "placeholder",
332
+ name: "name",
333
+ required: "required",
334
+ type: "type",
335
+ errorStateMatcher: "errorStateMatcher",
336
+ userAriaDescribedBy: ["aria-describedby", "userAriaDescribedBy"],
337
+ value: "value",
338
+ readonly: "readonly",
339
+ disabledInteractive: ["disabledInteractive", "disabledInteractive", booleanAttribute]
340
+ },
341
+ host: {
342
+ listeners: {
343
+ "focus": "_focusChanged(true)",
344
+ "blur": "_focusChanged(false)",
345
+ "input": "_onInput()"
346
+ },
347
+ properties: {
348
+ "class.mat-input-server": "_isServer",
349
+ "class.mat-mdc-form-field-textarea-control": "_isInFormField && _isTextarea",
350
+ "class.mat-mdc-form-field-input-control": "_isInFormField",
351
+ "class.mat-mdc-input-disabled-interactive": "disabledInteractive",
352
+ "class.mdc-text-field__input": "_isInFormField",
353
+ "class.mat-mdc-native-select-inline": "_isInlineSelect()",
354
+ "id": "id",
355
+ "disabled": "disabled && !disabledInteractive",
356
+ "required": "required",
357
+ "attr.name": "name || null",
358
+ "attr.readonly": "_getReadonlyAttribute()",
359
+ "attr.aria-disabled": "disabled && disabledInteractive ? \"true\" : null",
360
+ "attr.aria-invalid": "(empty && required) ? null : errorState",
361
+ "attr.aria-required": "required",
362
+ "attr.id": "id"
363
+ },
364
+ classAttribute: "mat-mdc-input-element"
365
+ },
366
+ providers: [{
367
+ provide: MatFormFieldControl,
368
+ useExisting: MatInput
369
+ }],
370
+ exportAs: ["matInput"],
371
+ usesOnChanges: true,
372
+ ngImport: i0
373
+ });
479
374
  }
480
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatInput, decorators: [{
481
- type: Directive,
482
- args: [{
483
- selector: `input[matInput], textarea[matInput], select[matNativeControl],
375
+ i0.ɵɵngDeclareClassMetadata({
376
+ minVersion: "12.0.0",
377
+ version: "20.2.0-next.2",
378
+ ngImport: i0,
379
+ type: MatInput,
380
+ decorators: [{
381
+ type: Directive,
382
+ args: [{
383
+ selector: `input[matInput], textarea[matInput], select[matNativeControl],
484
384
  input[matNativeControl], textarea[matNativeControl]`,
485
- exportAs: 'matInput',
486
- host: {
487
- 'class': 'mat-mdc-input-element',
488
- // The BaseMatInput parent class adds `mat-input-element`, `mat-form-field-control` and
489
- // `mat-form-field-autofill-control` to the CSS class list, but this should not be added for
490
- // this MDC equivalent input.
491
- '[class.mat-input-server]': '_isServer',
492
- '[class.mat-mdc-form-field-textarea-control]': '_isInFormField && _isTextarea',
493
- '[class.mat-mdc-form-field-input-control]': '_isInFormField',
494
- '[class.mat-mdc-input-disabled-interactive]': 'disabledInteractive',
495
- '[class.mdc-text-field__input]': '_isInFormField',
496
- '[class.mat-mdc-native-select-inline]': '_isInlineSelect()',
497
- // Native input properties that are overwritten by Angular inputs need to be synced with
498
- // the native input element. Otherwise property bindings for those don't work.
499
- '[id]': 'id',
500
- '[disabled]': 'disabled && !disabledInteractive',
501
- '[required]': 'required',
502
- '[attr.name]': 'name || null',
503
- '[attr.readonly]': '_getReadonlyAttribute()',
504
- '[attr.aria-disabled]': 'disabled && disabledInteractive ? "true" : null',
505
- // Only mark the input as invalid for assistive technology if it has a value since the
506
- // state usually overlaps with `aria-required` when the input is empty and can be redundant.
507
- '[attr.aria-invalid]': '(empty && required) ? null : errorState',
508
- '[attr.aria-required]': 'required',
509
- // Native input properties that are overwritten by Angular inputs need to be synced with
510
- // the native input element. Otherwise property bindings for those don't work.
511
- '[attr.id]': 'id',
512
- '(focus)': '_focusChanged(true)',
513
- '(blur)': '_focusChanged(false)',
514
- '(input)': '_onInput()',
515
- },
516
- providers: [{ provide: MatFormFieldControl, useExisting: MatInput }],
517
- }]
518
- }], ctorParameters: () => [], propDecorators: { disabled: [{
519
- type: Input
520
- }], id: [{
521
- type: Input
522
- }], placeholder: [{
523
- type: Input
524
- }], name: [{
525
- type: Input
526
- }], required: [{
527
- type: Input
528
- }], type: [{
529
- type: Input
530
- }], errorStateMatcher: [{
531
- type: Input
532
- }], userAriaDescribedBy: [{
533
- type: Input,
534
- args: ['aria-describedby']
535
- }], value: [{
536
- type: Input
537
- }], readonly: [{
538
- type: Input
539
- }], disabledInteractive: [{
540
- type: Input,
541
- args: [{ transform: booleanAttribute }]
542
- }] } });
385
+ exportAs: 'matInput',
386
+ host: {
387
+ 'class': 'mat-mdc-input-element',
388
+ '[class.mat-input-server]': '_isServer',
389
+ '[class.mat-mdc-form-field-textarea-control]': '_isInFormField && _isTextarea',
390
+ '[class.mat-mdc-form-field-input-control]': '_isInFormField',
391
+ '[class.mat-mdc-input-disabled-interactive]': 'disabledInteractive',
392
+ '[class.mdc-text-field__input]': '_isInFormField',
393
+ '[class.mat-mdc-native-select-inline]': '_isInlineSelect()',
394
+ '[id]': 'id',
395
+ '[disabled]': 'disabled && !disabledInteractive',
396
+ '[required]': 'required',
397
+ '[attr.name]': 'name || null',
398
+ '[attr.readonly]': '_getReadonlyAttribute()',
399
+ '[attr.aria-disabled]': 'disabled && disabledInteractive ? "true" : null',
400
+ '[attr.aria-invalid]': '(empty && required) ? null : errorState',
401
+ '[attr.aria-required]': 'required',
402
+ '[attr.id]': 'id',
403
+ '(focus)': '_focusChanged(true)',
404
+ '(blur)': '_focusChanged(false)',
405
+ '(input)': '_onInput()'
406
+ },
407
+ providers: [{
408
+ provide: MatFormFieldControl,
409
+ useExisting: MatInput
410
+ }]
411
+ }]
412
+ }],
413
+ ctorParameters: () => [],
414
+ propDecorators: {
415
+ disabled: [{
416
+ type: Input
417
+ }],
418
+ id: [{
419
+ type: Input
420
+ }],
421
+ placeholder: [{
422
+ type: Input
423
+ }],
424
+ name: [{
425
+ type: Input
426
+ }],
427
+ required: [{
428
+ type: Input
429
+ }],
430
+ type: [{
431
+ type: Input
432
+ }],
433
+ errorStateMatcher: [{
434
+ type: Input
435
+ }],
436
+ userAriaDescribedBy: [{
437
+ type: Input,
438
+ args: ['aria-describedby']
439
+ }],
440
+ value: [{
441
+ type: Input
442
+ }],
443
+ readonly: [{
444
+ type: Input
445
+ }],
446
+ disabledInteractive: [{
447
+ type: Input,
448
+ args: [{
449
+ transform: booleanAttribute
450
+ }]
451
+ }]
452
+ }
453
+ });
543
454
 
544
455
  class MatInputModule {
545
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
546
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatInputModule, imports: [MatFormFieldModule, MatInput], exports: [MatInput, MatFormFieldModule, TextFieldModule, BidiModule] });
547
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatInputModule, imports: [MatFormFieldModule, MatFormFieldModule, TextFieldModule, BidiModule] });
456
+ static ɵfac = i0.ɵɵngDeclareFactory({
457
+ minVersion: "12.0.0",
458
+ version: "20.2.0-next.2",
459
+ ngImport: i0,
460
+ type: MatInputModule,
461
+ deps: [],
462
+ target: i0.ɵɵFactoryTarget.NgModule
463
+ });
464
+ static ɵmod = i0.ɵɵngDeclareNgModule({
465
+ minVersion: "14.0.0",
466
+ version: "20.2.0-next.2",
467
+ ngImport: i0,
468
+ type: MatInputModule,
469
+ imports: [MatFormFieldModule, MatInput],
470
+ exports: [MatInput, MatFormFieldModule, TextFieldModule, BidiModule]
471
+ });
472
+ static ɵinj = i0.ɵɵngDeclareInjector({
473
+ minVersion: "12.0.0",
474
+ version: "20.2.0-next.2",
475
+ ngImport: i0,
476
+ type: MatInputModule,
477
+ imports: [MatFormFieldModule, MatFormFieldModule, TextFieldModule, BidiModule]
478
+ });
548
479
  }
549
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatInputModule, decorators: [{
550
- type: NgModule,
551
- args: [{
552
- imports: [MatFormFieldModule, MatInput],
553
- exports: [MatInput, MatFormFieldModule, TextFieldModule, BidiModule],
554
- }]
555
- }] });
480
+ i0.ɵɵngDeclareClassMetadata({
481
+ minVersion: "12.0.0",
482
+ version: "20.2.0-next.2",
483
+ ngImport: i0,
484
+ type: MatInputModule,
485
+ decorators: [{
486
+ type: NgModule,
487
+ args: [{
488
+ imports: [MatFormFieldModule, MatInput],
489
+ exports: [MatInput, MatFormFieldModule, TextFieldModule, BidiModule]
490
+ }]
491
+ }]
492
+ });
556
493
 
557
494
  export { MAT_INPUT_CONFIG, MAT_INPUT_VALUE_ACCESSOR, MatInput, MatInputModule, getMatInputUnsupportedTypeError };
558
495
  //# sourceMappingURL=input.mjs.map