@angular/material 21.0.0-next.8 → 21.0.0-next.9

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { OnDestroy, Signal, ModelSignal, InputSignal, InputSignalWithTransform, ElementRef, InjectionToken, TemplateRef, OutputEmitterRef } from '@angular/core';
2
+ import { InjectionToken, Signal, ElementRef, OnDestroy, TemplateRef, InputSignalWithTransform, InputSignal, OutputEmitterRef, ModelSignal } from '@angular/core';
3
3
  import { MatOption } from './_option-chunk.js';
4
4
  import { MatOptionParentComponent } from './_option-parent-chunk.js';
5
5
  import { ScrollStrategy } from '@angular/cdk/overlay';
@@ -8,131 +8,6 @@ import * as i1 from '@angular/cdk/scrolling';
8
8
  import '@angular/cdk/a11y';
9
9
  import 'rxjs';
10
10
 
11
- /**
12
- * Input that can be used to enter time and connect to a `mat-timepicker`.
13
- */
14
- declare class MatTimepickerInput<D> implements ControlValueAccessor, Validator, OnDestroy {
15
- private _elementRef;
16
- private _dateAdapter;
17
- private _dateFormats;
18
- private _formField;
19
- private _onChange;
20
- private _onTouched;
21
- private _validatorOnChange;
22
- private _cleanupClick;
23
- private _accessorDisabled;
24
- private _localeSubscription;
25
- private _timepickerSubscription;
26
- private _validator;
27
- private _lastValueValid;
28
- private _lastValidDate;
29
- /** Value of the `aria-activedescendant` attribute. */
30
- protected readonly _ariaActiveDescendant: Signal<string | null>;
31
- /** Value of the `aria-expanded` attribute. */
32
- protected readonly _ariaExpanded: Signal<string>;
33
- /** Value of the `aria-controls` attribute. */
34
- protected readonly _ariaControls: Signal<string | null>;
35
- /** Current value of the input. */
36
- readonly value: ModelSignal<D | null>;
37
- /** Timepicker that the input is associated with. */
38
- readonly timepicker: InputSignal<MatTimepicker<D>>;
39
- /**
40
- * Minimum time that can be selected or typed in. Can be either
41
- * a date object (only time will be used) or a valid time string.
42
- */
43
- readonly min: InputSignalWithTransform<D | null, unknown>;
44
- /**
45
- * Maximum time that can be selected or typed in. Can be either
46
- * a date object (only time will be used) or a valid time string.
47
- */
48
- readonly max: InputSignalWithTransform<D | null, unknown>;
49
- /**
50
- * Whether to open the timepicker overlay when clicking on the input. Enabled by default.
51
- * Note that when disabling this option, you'll have to provide your own logic for opening
52
- * the overlay.
53
- */
54
- readonly openOnClick: InputSignalWithTransform<boolean, unknown>;
55
- /** Whether the input is disabled. */
56
- readonly disabled: Signal<boolean>;
57
- /**
58
- * Whether the input should be disabled through the template.
59
- * @docs-private
60
- */
61
- readonly disabledInput: InputSignalWithTransform<boolean, unknown>;
62
- constructor();
63
- /**
64
- * Implemented as a part of `ControlValueAccessor`.
65
- * @docs-private
66
- */
67
- writeValue(value: any): void;
68
- /**
69
- * Implemented as a part of `ControlValueAccessor`.
70
- * @docs-private
71
- */
72
- registerOnChange(fn: (value: any) => void): void;
73
- /**
74
- * Implemented as a part of `ControlValueAccessor`.
75
- * @docs-private
76
- */
77
- registerOnTouched(fn: () => void): void;
78
- /**
79
- * Implemented as a part of `ControlValueAccessor`.
80
- * @docs-private
81
- */
82
- setDisabledState(isDisabled: boolean): void;
83
- /**
84
- * Implemented as a part of `Validator`.
85
- * @docs-private
86
- */
87
- validate(control: AbstractControl): ValidationErrors | null;
88
- /**
89
- * Implemented as a part of `Validator`.
90
- * @docs-private
91
- */
92
- registerOnValidatorChange(fn: () => void): void;
93
- /** Gets the element to which the timepicker popup should be attached. */
94
- getOverlayOrigin(): ElementRef<HTMLElement>;
95
- /** Focuses the input. */
96
- focus(): void;
97
- ngOnDestroy(): void;
98
- /** Gets the ID of the input's label. */
99
- _getLabelId(): string | null;
100
- /** Handles clicks on the input or the containing form field. */
101
- private _handleClick;
102
- /** Handles the `input` event. */
103
- protected _handleInput(event: Event): void;
104
- /** Handles the `blur` event. */
105
- protected _handleBlur(): void;
106
- /** Handles the `keydown` event. */
107
- protected _handleKeydown(event: KeyboardEvent): void;
108
- /** Called by the timepicker to sync up the user-selected value. */
109
- _timepickerValueAssigned(value: D | null): void;
110
- /** Sets up the code that watches for changes in the value and adjusts the input. */
111
- private _respondToValueChanges;
112
- /** Sets up the logic that registers the input with the timepicker. */
113
- private _registerTimepicker;
114
- /** Sets up the logic that adjusts the input if the min/max changes. */
115
- private _respondToMinMaxChanges;
116
- /**
117
- * Assigns a value set by the user to the input's model.
118
- * @param selection Time selected by the user that should be assigned.
119
- * @param propagateToAccessor Whether the value should be propagated to the ControlValueAccessor.
120
- */
121
- private _assignUserSelection;
122
- /** Formats the current value and assigns it to the input. */
123
- private _formatValue;
124
- /** Checks whether a value is valid. */
125
- private _isValid;
126
- /** Transforms an arbitrary value into a value that can be assigned to a date-based input. */
127
- private _transformDateInput;
128
- /** Whether the input is currently focused. */
129
- private _hasFocus;
130
- /** Gets a function that can be used to validate the input. */
131
- private _getValidator;
132
- static ɵfac: i0.ɵɵFactoryDeclaration<MatTimepickerInput<any>, never>;
133
- static ɵdir: i0.ɵɵDirectiveDeclaration<MatTimepickerInput<any>, "input[matTimepicker]", ["matTimepickerInput"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "timepicker": { "alias": "matTimepicker"; "required": true; "isSignal": true; }; "min": { "alias": "matTimepickerMin"; "required": false; "isSignal": true; }; "max": { "alias": "matTimepickerMax"; "required": false; "isSignal": true; }; "openOnClick": { "alias": "matTimepickerOpenOnClick"; "required": false; "isSignal": true; }; "disabledInput": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
134
- }
135
-
136
11
  /**
137
12
  * Object that can be used to configure the default options for the timepicker component.
138
13
  */
@@ -163,6 +38,25 @@ interface MatTimepickerSelected<D> {
163
38
  }
164
39
  /** Injection token used to configure the behavior of the timepicker dropdown while scrolling. */
165
40
  declare const MAT_TIMEPICKER_SCROLL_STRATEGY: InjectionToken<() => ScrollStrategy>;
41
+ /** Represents an input that is connected to a `mat-timepicker`. */
42
+ interface MatTimepickerConnectedInput<D> {
43
+ /** Current value of the input. */
44
+ value: Signal<D | null>;
45
+ /** Minimum allowed time. */
46
+ min: Signal<D | null>;
47
+ /** Maximum allowed time. */
48
+ max: Signal<D | null>;
49
+ /** Whether the input is disabled. */
50
+ disabled: Signal<boolean>;
51
+ /** Focuses the input. */
52
+ focus(): void;
53
+ /** Gets the element to which to connect the timepicker overlay. */
54
+ getOverlayOrigin(): ElementRef<HTMLElement>;
55
+ /** Gets the ID of the input's label. */
56
+ getLabelId(): string | null;
57
+ /** Callback invoked when the timepicker assigns a value. */
58
+ timepickerValueAssigned(value: D | null): void;
59
+ }
166
60
  /**
167
61
  * Renders out a listbox that can be used to select a time of day.
168
62
  * Intended to be used together with `MatTimepickerInput`.
@@ -225,7 +119,7 @@ declare class MatTimepicker<D> implements OnDestroy, MatOptionParentComponent {
225
119
  /** Closes the timepicker. */
226
120
  close(): void;
227
121
  /** Registers an input with the timepicker. */
228
- registerInput(input: MatTimepickerInput<D>): void;
122
+ registerInput(input: MatTimepickerConnectedInput<D>): void;
229
123
  ngOnDestroy(): void;
230
124
  /** Selects a specific time value. */
231
125
  protected _selectValue(option: MatOption<D>): void;
@@ -256,6 +150,131 @@ declare class MatTimepicker<D> implements OnDestroy, MatOptionParentComponent {
256
150
  static ɵcmp: i0.ɵɵComponentDeclaration<MatTimepicker<any>, "mat-timepicker", ["matTimepicker"], { "interval": { "alias": "interval"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "disableRipple": { "alias": "disableRipple"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; }, { "selected": "selected"; "opened": "opened"; "closed": "closed"; }, never, never, true, never>;
257
151
  }
258
152
 
153
+ /**
154
+ * Input that can be used to enter time and connect to a `mat-timepicker`.
155
+ */
156
+ declare class MatTimepickerInput<D> implements MatTimepickerConnectedInput<D>, ControlValueAccessor, Validator, OnDestroy {
157
+ private _elementRef;
158
+ private _dateAdapter;
159
+ private _dateFormats;
160
+ private _formField;
161
+ private _onChange;
162
+ private _onTouched;
163
+ private _validatorOnChange;
164
+ private _cleanupClick;
165
+ private _accessorDisabled;
166
+ private _localeSubscription;
167
+ private _timepickerSubscription;
168
+ private _validator;
169
+ private _lastValueValid;
170
+ private _lastValidDate;
171
+ /** Value of the `aria-activedescendant` attribute. */
172
+ protected readonly _ariaActiveDescendant: Signal<string | null>;
173
+ /** Value of the `aria-expanded` attribute. */
174
+ protected readonly _ariaExpanded: Signal<string>;
175
+ /** Value of the `aria-controls` attribute. */
176
+ protected readonly _ariaControls: Signal<string | null>;
177
+ /** Current value of the input. */
178
+ readonly value: ModelSignal<D | null>;
179
+ /** Timepicker that the input is associated with. */
180
+ readonly timepicker: InputSignal<MatTimepicker<D>>;
181
+ /**
182
+ * Minimum time that can be selected or typed in. Can be either
183
+ * a date object (only time will be used) or a valid time string.
184
+ */
185
+ readonly min: InputSignalWithTransform<D | null, unknown>;
186
+ /**
187
+ * Maximum time that can be selected or typed in. Can be either
188
+ * a date object (only time will be used) or a valid time string.
189
+ */
190
+ readonly max: InputSignalWithTransform<D | null, unknown>;
191
+ /**
192
+ * Whether to open the timepicker overlay when clicking on the input. Enabled by default.
193
+ * Note that when disabling this option, you'll have to provide your own logic for opening
194
+ * the overlay.
195
+ */
196
+ readonly openOnClick: InputSignalWithTransform<boolean, unknown>;
197
+ /** Whether the input is disabled. */
198
+ readonly disabled: Signal<boolean>;
199
+ /**
200
+ * Whether the input should be disabled through the template.
201
+ * @docs-private
202
+ */
203
+ readonly disabledInput: InputSignalWithTransform<boolean, unknown>;
204
+ constructor();
205
+ /**
206
+ * Implemented as a part of `ControlValueAccessor`.
207
+ * @docs-private
208
+ */
209
+ writeValue(value: any): void;
210
+ /**
211
+ * Implemented as a part of `ControlValueAccessor`.
212
+ * @docs-private
213
+ */
214
+ registerOnChange(fn: (value: any) => void): void;
215
+ /**
216
+ * Implemented as a part of `ControlValueAccessor`.
217
+ * @docs-private
218
+ */
219
+ registerOnTouched(fn: () => void): void;
220
+ /**
221
+ * Implemented as a part of `ControlValueAccessor`.
222
+ * @docs-private
223
+ */
224
+ setDisabledState(isDisabled: boolean): void;
225
+ /**
226
+ * Implemented as a part of `Validator`.
227
+ * @docs-private
228
+ */
229
+ validate(control: AbstractControl): ValidationErrors | null;
230
+ /**
231
+ * Implemented as a part of `Validator`.
232
+ * @docs-private
233
+ */
234
+ registerOnValidatorChange(fn: () => void): void;
235
+ /** Gets the element to which the timepicker popup should be attached. */
236
+ getOverlayOrigin(): ElementRef<HTMLElement>;
237
+ /** Focuses the input. */
238
+ focus(): void;
239
+ ngOnDestroy(): void;
240
+ /** Gets the ID of the input's label. */
241
+ getLabelId(): string | null;
242
+ /** Handles clicks on the input or the containing form field. */
243
+ private _handleClick;
244
+ /** Handles the `input` event. */
245
+ protected _handleInput(event: Event): void;
246
+ /** Handles the `blur` event. */
247
+ protected _handleBlur(): void;
248
+ /** Handles the `keydown` event. */
249
+ protected _handleKeydown(event: KeyboardEvent): void;
250
+ /** Called by the timepicker to sync up the user-selected value. */
251
+ timepickerValueAssigned(value: D | null): void;
252
+ /** Sets up the code that watches for changes in the value and adjusts the input. */
253
+ private _respondToValueChanges;
254
+ /** Sets up the logic that registers the input with the timepicker. */
255
+ private _registerTimepicker;
256
+ /** Sets up the logic that adjusts the input if the min/max changes. */
257
+ private _respondToMinMaxChanges;
258
+ /**
259
+ * Assigns a value set by the user to the input's model.
260
+ * @param selection Time selected by the user that should be assigned.
261
+ * @param propagateToAccessor Whether the value should be propagated to the ControlValueAccessor.
262
+ */
263
+ private _assignUserSelection;
264
+ /** Formats the current value and assigns it to the input. */
265
+ private _formatValue;
266
+ /** Checks whether a value is valid. */
267
+ private _isValid;
268
+ /** Transforms an arbitrary value into a value that can be assigned to a date-based input. */
269
+ private _transformDateInput;
270
+ /** Whether the input is currently focused. */
271
+ private _hasFocus;
272
+ /** Gets a function that can be used to validate the input. */
273
+ private _getValidator;
274
+ static ɵfac: i0.ɵɵFactoryDeclaration<MatTimepickerInput<any>, never>;
275
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MatTimepickerInput<any>, "input[matTimepicker]", ["matTimepickerInput"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "timepicker": { "alias": "matTimepicker"; "required": true; "isSignal": true; }; "min": { "alias": "matTimepickerMin"; "required": false; "isSignal": true; }; "max": { "alias": "matTimepickerMax"; "required": false; "isSignal": true; }; "openOnClick": { "alias": "matTimepickerOpenOnClick"; "required": false; "isSignal": true; }; "disabledInput": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
276
+ }
277
+
259
278
  /** Button that can be used to open a `mat-timepicker`. */
260
279
  declare class MatTimepickerToggle<D> {
261
280
  private _defaultConfig;
@@ -293,4 +312,4 @@ declare class MatTimepickerModule {
293
312
  }
294
313
 
295
314
  export { MAT_TIMEPICKER_CONFIG, MAT_TIMEPICKER_SCROLL_STRATEGY, MatTimepicker, MatTimepickerInput, MatTimepickerModule, MatTimepickerToggle };
296
- export type { MatTimepickerConfig, MatTimepickerOption, MatTimepickerSelected };
315
+ export type { MatTimepickerConfig, MatTimepickerConnectedInput, MatTimepickerOption, MatTimepickerSelected };