@angular/material 21.0.0-next.8 → 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.
- package/core/tokens/_classes.scss +1 -1
- package/core/tokens/m2/_md-sys-color.scss +17 -17
- package/fesm2022/_animation-chunk.mjs +10 -16
- package/fesm2022/_animation-chunk.mjs.map +1 -1
- package/fesm2022/_date-formats-chunk.mjs +68 -164
- package/fesm2022/_date-formats-chunk.mjs.map +1 -1
- package/fesm2022/_date-range-input-harness-chunk.mjs +284 -463
- package/fesm2022/_date-range-input-harness-chunk.mjs.map +1 -1
- package/fesm2022/_error-options-chunk.mjs +56 -19
- package/fesm2022/_error-options-chunk.mjs.map +1 -1
- package/fesm2022/_error-state-chunk.mjs +24 -31
- package/fesm2022/_error-state-chunk.mjs.map +1 -1
- package/fesm2022/_form-field-chunk.mjs +1224 -1017
- package/fesm2022/_form-field-chunk.mjs.map +1 -1
- package/fesm2022/_icon-button-chunk.mjs +243 -187
- package/fesm2022/_icon-button-chunk.mjs.map +1 -1
- package/fesm2022/_icon-registry-chunk.mjs +350 -575
- package/fesm2022/_icon-registry-chunk.mjs.map +1 -1
- package/fesm2022/_input-harness-chunk.mjs +56 -107
- package/fesm2022/_input-harness-chunk.mjs.map +1 -1
- package/fesm2022/_input-value-accessor-chunk.mjs +0 -6
- package/fesm2022/_input-value-accessor-chunk.mjs.map +1 -1
- package/fesm2022/_internal-form-field-chunk.mjs +59 -19
- package/fesm2022/_internal-form-field-chunk.mjs.map +1 -1
- package/fesm2022/_line-chunk.mjs +83 -43
- package/fesm2022/_line-chunk.mjs.map +1 -1
- package/fesm2022/_option-chunk.mjs +348 -311
- package/fesm2022/_option-chunk.mjs.map +1 -1
- package/fesm2022/_option-harness-chunk.mjs +23 -39
- package/fesm2022/_option-harness-chunk.mjs.map +1 -1
- package/fesm2022/_option-module-chunk.mjs +36 -10
- package/fesm2022/_option-module-chunk.mjs.map +1 -1
- package/fesm2022/_pseudo-checkbox-chunk.mjs +79 -44
- package/fesm2022/_pseudo-checkbox-chunk.mjs.map +1 -1
- package/fesm2022/_pseudo-checkbox-module-chunk.mjs +36 -10
- package/fesm2022/_pseudo-checkbox-module-chunk.mjs.map +1 -1
- package/fesm2022/_public-api-chunk.mjs +71 -134
- package/fesm2022/_public-api-chunk.mjs.map +1 -1
- package/fesm2022/_ripple-chunk.mjs +504 -600
- package/fesm2022/_ripple-chunk.mjs.map +1 -1
- package/fesm2022/_ripple-loader-chunk.mjs +120 -138
- package/fesm2022/_ripple-loader-chunk.mjs.map +1 -1
- package/fesm2022/_ripple-module-chunk.mjs +36 -10
- package/fesm2022/_ripple-module-chunk.mjs.map +1 -1
- package/fesm2022/_structural-styles-chunk.mjs +37 -10
- package/fesm2022/_structural-styles-chunk.mjs.map +1 -1
- package/fesm2022/_tooltip-chunk.mjs +810 -888
- package/fesm2022/_tooltip-chunk.mjs.map +1 -1
- package/fesm2022/autocomplete-testing.mjs +62 -86
- package/fesm2022/autocomplete-testing.mjs.map +1 -1
- package/fesm2022/autocomplete.mjs +965 -1126
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge-testing.mjs +38 -54
- package/fesm2022/badge-testing.mjs.map +1 -1
- package/fesm2022/badge.mjs +321 -272
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/bottom-sheet-testing.mjs +10 -24
- package/fesm2022/bottom-sheet-testing.mjs.map +1 -1
- package/fesm2022/bottom-sheet.mjs +349 -344
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button-testing.mjs +60 -94
- package/fesm2022/button-testing.mjs.map +1 -1
- package/fesm2022/button-toggle-testing.mjs +76 -125
- package/fesm2022/button-toggle-testing.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs +752 -662
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +263 -158
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/card-testing.mjs +19 -33
- package/fesm2022/card-testing.mjs.map +1 -1
- package/fesm2022/card.mjs +576 -272
- package/fesm2022/card.mjs.map +1 -1
- package/fesm2022/checkbox-testing.mjs +71 -123
- package/fesm2022/checkbox-testing.mjs.map +1 -1
- package/fesm2022/checkbox.mjs +515 -477
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips-testing.mjs +201 -350
- package/fesm2022/chips-testing.mjs.map +1 -1
- package/fesm2022/chips.mjs +2552 -2289
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/core-testing.mjs +14 -28
- package/fesm2022/core-testing.mjs.map +1 -1
- package/fesm2022/core.mjs +357 -328
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker-testing.mjs +15 -25
- package/fesm2022/datepicker-testing.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +4826 -4563
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog-testing.mjs +93 -129
- package/fesm2022/dialog-testing.mjs.map +1 -1
- package/fesm2022/dialog.mjs +810 -829
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/divider-testing.mjs +10 -11
- package/fesm2022/divider-testing.mjs.map +1 -1
- package/fesm2022/divider.mjs +119 -43
- package/fesm2022/divider.mjs.map +1 -1
- package/fesm2022/expansion-testing.mjs +74 -130
- package/fesm2022/expansion-testing.mjs.map +1 -1
- package/fesm2022/expansion.mjs +703 -515
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/form-field-testing-control.mjs +16 -33
- package/fesm2022/form-field-testing-control.mjs.map +1 -1
- package/fesm2022/form-field-testing.mjs +118 -179
- package/fesm2022/form-field-testing.mjs.map +1 -1
- package/fesm2022/form-field.mjs +36 -10
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/grid-list-testing.mjs +65 -113
- package/fesm2022/grid-list-testing.mjs.map +1 -1
- package/fesm2022/grid-list.mjs +559 -494
- package/fesm2022/grid-list.mjs.map +1 -1
- package/fesm2022/icon-testing.mjs +148 -127
- package/fesm2022/icon-testing.mjs.map +1 -1
- package/fesm2022/icon.mjs +325 -351
- package/fesm2022/icon.mjs.map +1 -1
- package/fesm2022/input-testing.mjs +59 -99
- package/fesm2022/input-testing.mjs.map +1 -1
- package/fesm2022/input.mjs +457 -520
- package/fesm2022/input.mjs.map +1 -1
- package/fesm2022/list-testing.mjs +251 -434
- package/fesm2022/list-testing.mjs.map +1 -1
- package/fesm2022/list.mjs +1522 -1204
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/material.mjs +0 -5
- package/fesm2022/material.mjs.map +1 -1
- package/fesm2022/menu-testing.mjs +159 -228
- package/fesm2022/menu-testing.mjs.map +1 -1
- package/fesm2022/menu.mjs +1338 -1343
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/paginator-testing.mjs +55 -79
- package/fesm2022/paginator-testing.mjs.map +1 -1
- package/fesm2022/paginator.mjs +381 -309
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/progress-bar-testing.mjs +12 -21
- package/fesm2022/progress-bar-testing.mjs.map +1 -1
- package/fesm2022/progress-bar.mjs +224 -169
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/progress-spinner-testing.mjs +13 -23
- package/fesm2022/progress-spinner-testing.mjs.map +1 -1
- package/fesm2022/progress-spinner.mjs +235 -160
- package/fesm2022/progress-spinner.mjs.map +1 -1
- package/fesm2022/radio-testing.mjs +133 -208
- package/fesm2022/radio-testing.mjs.map +1 -1
- package/fesm2022/radio.mjs +712 -679
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/select-testing.mjs +83 -117
- package/fesm2022/select-testing.mjs.map +1 -1
- package/fesm2022/select.mjs +1116 -1246
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav-testing.mjs +54 -120
- package/fesm2022/sidenav-testing.mjs.map +1 -1
- package/fesm2022/sidenav.mjs +1078 -995
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle-testing.mjs +57 -92
- package/fesm2022/slide-toggle-testing.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +369 -279
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/slider-testing.mjs +90 -138
- package/fesm2022/slider-testing.mjs.map +1 -1
- package/fesm2022/slider.mjs +1651 -1716
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/snack-bar-testing.mjs +40 -87
- package/fesm2022/snack-bar-testing.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +763 -714
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/sort-testing.mjs +45 -66
- package/fesm2022/sort-testing.mjs.map +1 -1
- package/fesm2022/sort.mjs +419 -344
- package/fesm2022/sort.mjs.map +1 -1
- package/fesm2022/stepper-testing.mjs +78 -154
- package/fesm2022/stepper-testing.mjs.map +1 -1
- package/fesm2022/stepper.mjs +790 -498
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table-testing.mjs +125 -186
- package/fesm2022/table-testing.mjs.map +1 -1
- package/fesm2022/table.mjs +1026 -684
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/tabs-testing.mjs +125 -197
- package/fesm2022/tabs-testing.mjs.map +1 -1
- package/fesm2022/tabs.mjs +2351 -2028
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/timepicker-testing.mjs +113 -172
- package/fesm2022/timepicker-testing.mjs.map +1 -1
- package/fesm2022/timepicker.mjs +1019 -826
- package/fesm2022/timepicker.mjs.map +1 -1
- package/fesm2022/toolbar-testing.mjs +16 -27
- package/fesm2022/toolbar-testing.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +163 -78
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tooltip-testing.mjs +41 -52
- package/fesm2022/tooltip-testing.mjs.map +1 -1
- package/fesm2022/tooltip.mjs +36 -10
- package/fesm2022/tooltip.mjs.map +1 -1
- package/fesm2022/tree-testing.mjs +86 -162
- package/fesm2022/tree-testing.mjs.map +1 -1
- package/fesm2022/tree.mjs +638 -466
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +2 -2
- package/schematics/ng-add/index.js +1 -1
- package/types/expansion.d.ts +4 -2
- package/types/menu-testing.d.ts +2 -0
- package/types/select.d.ts +1 -1
- package/types/sort.d.ts +1 -1
- package/types/table-testing.d.ts +27 -1
- package/types/timepicker.d.ts +148 -128
package/fesm2022/timepicker.mjs
CHANGED
|
@@ -26,887 +26,1080 @@ import 'rxjs/operators';
|
|
|
26
26
|
import '@angular/cdk/observers/private';
|
|
27
27
|
import './_ripple-loader-chunk.mjs';
|
|
28
28
|
|
|
29
|
-
/** Pattern that interval strings have to match. */
|
|
30
29
|
const INTERVAL_PATTERN = /^(\d*\.?\d+)\s*(h|hour|hours|m|min|minute|minutes|s|second|seconds)?$/i;
|
|
31
|
-
/**
|
|
32
|
-
* Injection token that can be used to configure the default options for the timepicker component.
|
|
33
|
-
*/
|
|
34
30
|
const MAT_TIMEPICKER_CONFIG = new InjectionToken('MAT_TIMEPICKER_CONFIG');
|
|
35
|
-
/** Parses an interval value into seconds. */
|
|
36
31
|
function parseInterval(value) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
let result;
|
|
33
|
+
if (value === null) {
|
|
34
|
+
return null;
|
|
35
|
+
} else if (typeof value === 'number') {
|
|
36
|
+
result = value;
|
|
37
|
+
} else {
|
|
38
|
+
if (value.trim().length === 0) {
|
|
39
|
+
return null;
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
const parsed = value.match(INTERVAL_PATTERN);
|
|
42
|
+
const amount = parsed ? parseFloat(parsed[1]) : null;
|
|
43
|
+
const unit = parsed?.[2]?.toLowerCase() || null;
|
|
44
|
+
if (!parsed || amount === null || isNaN(amount)) {
|
|
45
|
+
return null;
|
|
43
46
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const unit = parsed?.[2]?.toLowerCase() || null;
|
|
51
|
-
if (!parsed || amount === null || isNaN(amount)) {
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
|
-
if (unit === 'h' || unit === 'hour' || unit === 'hours') {
|
|
55
|
-
result = amount * 3600;
|
|
56
|
-
}
|
|
57
|
-
else if (unit === 'm' || unit === 'min' || unit === 'minute' || unit === 'minutes') {
|
|
58
|
-
result = amount * 60;
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
result = amount;
|
|
62
|
-
}
|
|
47
|
+
if (unit === 'h' || unit === 'hour' || unit === 'hours') {
|
|
48
|
+
result = amount * 3600;
|
|
49
|
+
} else if (unit === 'm' || unit === 'min' || unit === 'minute' || unit === 'minutes') {
|
|
50
|
+
result = amount * 60;
|
|
51
|
+
} else {
|
|
52
|
+
result = amount;
|
|
63
53
|
}
|
|
64
|
-
|
|
54
|
+
}
|
|
55
|
+
return result;
|
|
65
56
|
}
|
|
66
|
-
/**
|
|
67
|
-
* Generates the options to show in a timepicker.
|
|
68
|
-
* @param adapter Date adapter to be used to generate the options.
|
|
69
|
-
* @param formats Formatting config to use when displaying the options.
|
|
70
|
-
* @param min Time from which to start generating the options.
|
|
71
|
-
* @param max Time at which to stop generating the options.
|
|
72
|
-
* @param interval Amount of seconds between each option.
|
|
73
|
-
*/
|
|
74
57
|
function generateOptions(adapter, formats, min, max, interval) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
58
|
+
const options = [];
|
|
59
|
+
let current = adapter.compareTime(min, max) < 1 ? min : max;
|
|
60
|
+
while (adapter.sameDate(current, min) && adapter.compareTime(current, max) < 1 && adapter.isValid(current)) {
|
|
61
|
+
options.push({
|
|
62
|
+
value: current,
|
|
63
|
+
label: adapter.format(current, formats.display.timeOptionLabel)
|
|
64
|
+
});
|
|
65
|
+
current = adapter.addSeconds(current, interval);
|
|
66
|
+
}
|
|
67
|
+
return options;
|
|
84
68
|
}
|
|
85
|
-
/** Checks whether a date adapter is set up correctly for use with the timepicker. */
|
|
86
69
|
function validateAdapter(adapter, formats) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
formats.display.timeOptionLabel === undefined ||
|
|
100
|
-
formats.parse.timeInput === undefined) {
|
|
101
|
-
throw new Error('MatTimepicker: Incomplete `MAT_DATE_FORMATS` has been provided. ' +
|
|
102
|
-
'`MAT_DATE_FORMATS` must provide `display.timeInput`, `display.timeOptionLabel` ' +
|
|
103
|
-
'and `parse.timeInput` formats in order to be compatible with MatTimepicker.');
|
|
104
|
-
}
|
|
70
|
+
function missingAdapterError(provider) {
|
|
71
|
+
return Error(`MatTimepicker: No provider found for ${provider}. You must add one of the following ` + `to your app config: provideNativeDateAdapter, provideDateFnsAdapter, ` + `provideLuxonDateAdapter, provideMomentDateAdapter, or provide a custom implementation.`);
|
|
72
|
+
}
|
|
73
|
+
if (!adapter) {
|
|
74
|
+
throw missingAdapterError('DateAdapter');
|
|
75
|
+
}
|
|
76
|
+
if (!formats) {
|
|
77
|
+
throw missingAdapterError('MAT_DATE_FORMATS');
|
|
78
|
+
}
|
|
79
|
+
if (formats.display.timeInput === undefined || formats.display.timeOptionLabel === undefined || formats.parse.timeInput === undefined) {
|
|
80
|
+
throw new Error('MatTimepicker: Incomplete `MAT_DATE_FORMATS` has been provided. ' + '`MAT_DATE_FORMATS` must provide `display.timeInput`, `display.timeOptionLabel` ' + 'and `parse.timeInput` formats in order to be compatible with MatTimepicker.');
|
|
81
|
+
}
|
|
105
82
|
}
|
|
106
83
|
|
|
107
|
-
/** Injection token used to configure the behavior of the timepicker dropdown while scrolling. */
|
|
108
84
|
const MAT_TIMEPICKER_SCROLL_STRATEGY = new InjectionToken('MAT_TIMEPICKER_SCROLL_STRATEGY', {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
85
|
+
providedIn: 'root',
|
|
86
|
+
factory: () => {
|
|
87
|
+
const injector = inject(Injector);
|
|
88
|
+
return () => createRepositionScrollStrategy(injector);
|
|
89
|
+
}
|
|
114
90
|
});
|
|
115
|
-
/**
|
|
116
|
-
* Renders out a listbox that can be used to select a time of day.
|
|
117
|
-
* Intended to be used together with `MatTimepickerInput`.
|
|
118
|
-
*/
|
|
119
91
|
class MatTimepicker {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
this.
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
open() {
|
|
203
|
-
const input = this._input();
|
|
204
|
-
if (!input) {
|
|
205
|
-
return;
|
|
206
|
-
}
|
|
207
|
-
// Focus should already be on the input, but this call is in case the timepicker is opened
|
|
208
|
-
// programmatically. We need to call this even if the timepicker is already open, because
|
|
209
|
-
// the user might be clicking the toggle.
|
|
210
|
-
input.focus();
|
|
211
|
-
if (this._isOpen()) {
|
|
212
|
-
return;
|
|
213
|
-
}
|
|
214
|
-
this._isOpen.set(true);
|
|
215
|
-
this._generateOptions();
|
|
216
|
-
const overlayRef = this._getOverlayRef();
|
|
217
|
-
overlayRef.updateSize({ width: input.getOverlayOrigin().nativeElement.offsetWidth });
|
|
218
|
-
this._portal ??= new TemplatePortal(this._panelTemplate(), this._viewContainerRef);
|
|
219
|
-
// We need to check this in case `isOpen` was flipped, but change detection hasn't
|
|
220
|
-
// had a chance to run yet. See https://github.com/angular/components/issues/30637
|
|
221
|
-
if (!overlayRef.hasAttached()) {
|
|
222
|
-
overlayRef.attach(this._portal);
|
|
92
|
+
_dir = inject(Directionality, {
|
|
93
|
+
optional: true
|
|
94
|
+
});
|
|
95
|
+
_viewContainerRef = inject(ViewContainerRef);
|
|
96
|
+
_injector = inject(Injector);
|
|
97
|
+
_defaultConfig = inject(MAT_TIMEPICKER_CONFIG, {
|
|
98
|
+
optional: true
|
|
99
|
+
});
|
|
100
|
+
_dateAdapter = inject(DateAdapter, {
|
|
101
|
+
optional: true
|
|
102
|
+
});
|
|
103
|
+
_dateFormats = inject(MAT_DATE_FORMATS, {
|
|
104
|
+
optional: true
|
|
105
|
+
});
|
|
106
|
+
_scrollStrategyFactory = inject(MAT_TIMEPICKER_SCROLL_STRATEGY);
|
|
107
|
+
_animationsDisabled = _animationsDisabled();
|
|
108
|
+
_isOpen = signal(false, ...(ngDevMode ? [{
|
|
109
|
+
debugName: "_isOpen"
|
|
110
|
+
}] : []));
|
|
111
|
+
_activeDescendant = signal(null, ...(ngDevMode ? [{
|
|
112
|
+
debugName: "_activeDescendant"
|
|
113
|
+
}] : []));
|
|
114
|
+
_input = signal(null, ...(ngDevMode ? [{
|
|
115
|
+
debugName: "_input"
|
|
116
|
+
}] : []));
|
|
117
|
+
_overlayRef = null;
|
|
118
|
+
_portal = null;
|
|
119
|
+
_optionsCacheKey = null;
|
|
120
|
+
_localeChanges;
|
|
121
|
+
_onOpenRender = null;
|
|
122
|
+
_panelTemplate = viewChild.required('panelTemplate');
|
|
123
|
+
_timeOptions = [];
|
|
124
|
+
_options = viewChildren(MatOption, ...(ngDevMode ? [{
|
|
125
|
+
debugName: "_options"
|
|
126
|
+
}] : []));
|
|
127
|
+
_keyManager = new ActiveDescendantKeyManager(this._options, this._injector).withHomeAndEnd(true).withPageUpDown(true).withVerticalOrientation(true);
|
|
128
|
+
interval = input(parseInterval(this._defaultConfig?.interval || null), ...(ngDevMode ? [{
|
|
129
|
+
debugName: "interval",
|
|
130
|
+
transform: parseInterval
|
|
131
|
+
}] : [{
|
|
132
|
+
transform: parseInterval
|
|
133
|
+
}]));
|
|
134
|
+
options = input(null, ...(ngDevMode ? [{
|
|
135
|
+
debugName: "options"
|
|
136
|
+
}] : []));
|
|
137
|
+
isOpen = this._isOpen.asReadonly();
|
|
138
|
+
selected = output();
|
|
139
|
+
opened = output();
|
|
140
|
+
closed = output();
|
|
141
|
+
activeDescendant = this._activeDescendant.asReadonly();
|
|
142
|
+
panelId = inject(_IdGenerator).getId('mat-timepicker-panel-');
|
|
143
|
+
disableRipple = input(this._defaultConfig?.disableRipple ?? false, ...(ngDevMode ? [{
|
|
144
|
+
debugName: "disableRipple",
|
|
145
|
+
transform: booleanAttribute
|
|
146
|
+
}] : [{
|
|
147
|
+
transform: booleanAttribute
|
|
148
|
+
}]));
|
|
149
|
+
ariaLabel = input(null, ...(ngDevMode ? [{
|
|
150
|
+
debugName: "ariaLabel",
|
|
151
|
+
alias: 'aria-label'
|
|
152
|
+
}] : [{
|
|
153
|
+
alias: 'aria-label'
|
|
154
|
+
}]));
|
|
155
|
+
ariaLabelledby = input(null, ...(ngDevMode ? [{
|
|
156
|
+
debugName: "ariaLabelledby",
|
|
157
|
+
alias: 'aria-labelledby'
|
|
158
|
+
}] : [{
|
|
159
|
+
alias: 'aria-labelledby'
|
|
160
|
+
}]));
|
|
161
|
+
disabled = computed(() => !!this._input()?.disabled(), ...(ngDevMode ? [{
|
|
162
|
+
debugName: "disabled"
|
|
163
|
+
}] : []));
|
|
164
|
+
constructor() {
|
|
165
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
166
|
+
validateAdapter(this._dateAdapter, this._dateFormats);
|
|
167
|
+
effect(() => {
|
|
168
|
+
const options = this.options();
|
|
169
|
+
const interval = this.interval();
|
|
170
|
+
if (options !== null && interval !== null) {
|
|
171
|
+
throw new Error('Cannot specify both the `options` and `interval` inputs at the same time');
|
|
172
|
+
} else if (options?.length === 0) {
|
|
173
|
+
throw new Error('Value of `options` input cannot be an empty array');
|
|
223
174
|
}
|
|
224
|
-
|
|
225
|
-
this._onOpenRender = afterNextRender(() => {
|
|
226
|
-
const options = this._options();
|
|
227
|
-
this._syncSelectedState(input.value(), options, options[0]);
|
|
228
|
-
this._onOpenRender = null;
|
|
229
|
-
}, { injector: this._injector });
|
|
230
|
-
this.opened.emit();
|
|
175
|
+
});
|
|
231
176
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
177
|
+
const element = inject(ElementRef);
|
|
178
|
+
element.nativeElement.setAttribute('mat-timepicker-panel-id', this.panelId);
|
|
179
|
+
this._handleLocaleChanges();
|
|
180
|
+
this._handleInputStateChanges();
|
|
181
|
+
this._keyManager.change.subscribe(() => this._activeDescendant.set(this._keyManager.activeItem?.id || null));
|
|
182
|
+
}
|
|
183
|
+
open() {
|
|
184
|
+
const input = this._input();
|
|
185
|
+
if (!input) {
|
|
186
|
+
return;
|
|
241
187
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
if (currentInput && input !== currentInput && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
246
|
-
throw new Error('MatTimepicker can only be registered with one input at a time');
|
|
247
|
-
}
|
|
248
|
-
this._input.set(input);
|
|
188
|
+
input.focus();
|
|
189
|
+
if (this._isOpen()) {
|
|
190
|
+
return;
|
|
249
191
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
192
|
+
this._isOpen.set(true);
|
|
193
|
+
this._generateOptions();
|
|
194
|
+
const overlayRef = this._getOverlayRef();
|
|
195
|
+
overlayRef.updateSize({
|
|
196
|
+
width: input.getOverlayOrigin().nativeElement.offsetWidth
|
|
197
|
+
});
|
|
198
|
+
this._portal ??= new TemplatePortal(this._panelTemplate(), this._viewContainerRef);
|
|
199
|
+
if (!overlayRef.hasAttached()) {
|
|
200
|
+
overlayRef.attach(this._portal);
|
|
255
201
|
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
202
|
+
this._onOpenRender?.destroy();
|
|
203
|
+
this._onOpenRender = afterNextRender(() => {
|
|
204
|
+
const options = this._options();
|
|
205
|
+
this._syncSelectedState(input.value(), options, options[0]);
|
|
206
|
+
this._onOpenRender = null;
|
|
207
|
+
}, {
|
|
208
|
+
injector: this._injector
|
|
209
|
+
});
|
|
210
|
+
this.opened.emit();
|
|
211
|
+
}
|
|
212
|
+
close() {
|
|
213
|
+
if (this._isOpen()) {
|
|
214
|
+
this._isOpen.set(false);
|
|
215
|
+
this.closed.emit();
|
|
216
|
+
if (this._animationsDisabled) {
|
|
217
|
+
this._overlayRef?.detach();
|
|
218
|
+
}
|
|
270
219
|
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
return this.ariaLabelledby() || this._input()?._getLabelId() || null;
|
|
220
|
+
}
|
|
221
|
+
registerInput(input) {
|
|
222
|
+
const currentInput = this._input();
|
|
223
|
+
if (currentInput && input !== currentInput && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
224
|
+
throw new Error('MatTimepicker can only be registered with one input at a time');
|
|
277
225
|
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
226
|
+
this._input.set(input);
|
|
227
|
+
}
|
|
228
|
+
ngOnDestroy() {
|
|
229
|
+
this._keyManager.destroy();
|
|
230
|
+
this._localeChanges.unsubscribe();
|
|
231
|
+
this._onOpenRender?.destroy();
|
|
232
|
+
this._overlayRef?.dispose();
|
|
233
|
+
}
|
|
234
|
+
_getOverlayHost() {
|
|
235
|
+
return this._overlayRef?.hostElement;
|
|
236
|
+
}
|
|
237
|
+
_selectValue(option) {
|
|
238
|
+
this.close();
|
|
239
|
+
this._keyManager.setActiveItem(option);
|
|
240
|
+
this._options().forEach(current => {
|
|
241
|
+
if (current !== option) {
|
|
242
|
+
current.deselect(false);
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
this._input()?.timepickerValueAssigned(option.value);
|
|
246
|
+
this.selected.emit({
|
|
247
|
+
value: option.value,
|
|
248
|
+
source: this
|
|
249
|
+
});
|
|
250
|
+
this._input()?.focus();
|
|
251
|
+
}
|
|
252
|
+
_getAriaLabelledby() {
|
|
253
|
+
if (this.ariaLabel()) {
|
|
254
|
+
return null;
|
|
283
255
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
const positionStrategy = createFlexibleConnectedPositionStrategy(this._injector, this._input().getOverlayOrigin())
|
|
290
|
-
.withFlexibleDimensions(false)
|
|
291
|
-
.withPush(false)
|
|
292
|
-
.withTransformOriginOn('.mat-timepicker-panel')
|
|
293
|
-
.withPositions([
|
|
294
|
-
{
|
|
295
|
-
originX: 'start',
|
|
296
|
-
originY: 'bottom',
|
|
297
|
-
overlayX: 'start',
|
|
298
|
-
overlayY: 'top',
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
originX: 'start',
|
|
302
|
-
originY: 'top',
|
|
303
|
-
overlayX: 'start',
|
|
304
|
-
overlayY: 'bottom',
|
|
305
|
-
panelClass: 'mat-timepicker-above',
|
|
306
|
-
},
|
|
307
|
-
]);
|
|
308
|
-
this._overlayRef = createOverlayRef(this._injector, {
|
|
309
|
-
positionStrategy,
|
|
310
|
-
scrollStrategy: this._scrollStrategyFactory(),
|
|
311
|
-
direction: this._dir || 'ltr',
|
|
312
|
-
hasBackdrop: false,
|
|
313
|
-
disableAnimations: this._animationsDisabled,
|
|
314
|
-
});
|
|
315
|
-
this._overlayRef.detachments().subscribe(() => this.close());
|
|
316
|
-
this._overlayRef.keydownEvents().subscribe(event => this._handleKeydown(event));
|
|
317
|
-
this._overlayRef.outsidePointerEvents().subscribe(event => {
|
|
318
|
-
const target = _getEventTarget(event);
|
|
319
|
-
const origin = this._input()?.getOverlayOrigin().nativeElement;
|
|
320
|
-
if (target && origin && target !== origin && !origin.contains(target)) {
|
|
321
|
-
this.close();
|
|
322
|
-
}
|
|
323
|
-
});
|
|
324
|
-
return this._overlayRef;
|
|
256
|
+
return this.ariaLabelledby() || this._input()?.getLabelId() || null;
|
|
257
|
+
}
|
|
258
|
+
_handleAnimationEnd(event) {
|
|
259
|
+
if (event.animationName === '_mat-timepicker-exit') {
|
|
260
|
+
this._overlayRef?.detach();
|
|
325
261
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
const options = this.options();
|
|
331
|
-
if (options !== null) {
|
|
332
|
-
this._timeOptions = options;
|
|
333
|
-
}
|
|
334
|
-
else {
|
|
335
|
-
const input = this._input();
|
|
336
|
-
const adapter = this._dateAdapter;
|
|
337
|
-
const timeFormat = this._dateFormats.display.timeInput;
|
|
338
|
-
const min = input?.min() || adapter.setTime(adapter.today(), 0, 0, 0);
|
|
339
|
-
const max = input?.max() || adapter.setTime(adapter.today(), 23, 59, 0);
|
|
340
|
-
const cacheKey = interval + '/' + adapter.format(min, timeFormat) + '/' + adapter.format(max, timeFormat);
|
|
341
|
-
// Don't re-generate the options if the inputs haven't changed.
|
|
342
|
-
if (cacheKey !== this._optionsCacheKey) {
|
|
343
|
-
this._optionsCacheKey = cacheKey;
|
|
344
|
-
this._timeOptions = generateOptions(adapter, this._dateFormats, min, max, interval);
|
|
345
|
-
}
|
|
346
|
-
}
|
|
262
|
+
}
|
|
263
|
+
_getOverlayRef() {
|
|
264
|
+
if (this._overlayRef) {
|
|
265
|
+
return this._overlayRef;
|
|
347
266
|
}
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
267
|
+
const positionStrategy = createFlexibleConnectedPositionStrategy(this._injector, this._input().getOverlayOrigin()).withFlexibleDimensions(false).withPush(false).withTransformOriginOn('.mat-timepicker-panel').withPositions([{
|
|
268
|
+
originX: 'start',
|
|
269
|
+
originY: 'bottom',
|
|
270
|
+
overlayX: 'start',
|
|
271
|
+
overlayY: 'top'
|
|
272
|
+
}, {
|
|
273
|
+
originX: 'start',
|
|
274
|
+
originY: 'top',
|
|
275
|
+
overlayX: 'start',
|
|
276
|
+
overlayY: 'bottom',
|
|
277
|
+
panelClass: 'mat-timepicker-above'
|
|
278
|
+
}]);
|
|
279
|
+
this._overlayRef = createOverlayRef(this._injector, {
|
|
280
|
+
positionStrategy,
|
|
281
|
+
scrollStrategy: this._scrollStrategyFactory(),
|
|
282
|
+
direction: this._dir || 'ltr',
|
|
283
|
+
hasBackdrop: false,
|
|
284
|
+
disableAnimations: this._animationsDisabled
|
|
285
|
+
});
|
|
286
|
+
this._overlayRef.detachments().subscribe(() => this.close());
|
|
287
|
+
this._overlayRef.keydownEvents().subscribe(event => this._handleKeydown(event));
|
|
288
|
+
this._overlayRef.outsidePointerEvents().subscribe(event => {
|
|
289
|
+
const target = _getEventTarget(event);
|
|
290
|
+
const origin = this._input()?.getOverlayOrigin().nativeElement;
|
|
291
|
+
if (target && origin && target !== origin && !origin.contains(target)) {
|
|
292
|
+
this.close();
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
return this._overlayRef;
|
|
296
|
+
}
|
|
297
|
+
_generateOptions() {
|
|
298
|
+
const interval = this.interval() ?? 30 * 60;
|
|
299
|
+
const options = this.options();
|
|
300
|
+
if (options !== null) {
|
|
301
|
+
this._timeOptions = options;
|
|
302
|
+
} else {
|
|
303
|
+
const input = this._input();
|
|
304
|
+
const adapter = this._dateAdapter;
|
|
305
|
+
const timeFormat = this._dateFormats.display.timeInput;
|
|
306
|
+
const min = input?.min() || adapter.setTime(adapter.today(), 0, 0, 0);
|
|
307
|
+
const max = input?.max() || adapter.setTime(adapter.today(), 23, 59, 0);
|
|
308
|
+
const cacheKey = interval + '/' + adapter.format(min, timeFormat) + '/' + adapter.format(max, timeFormat);
|
|
309
|
+
if (cacheKey !== this._optionsCacheKey) {
|
|
310
|
+
this._optionsCacheKey = cacheKey;
|
|
311
|
+
this._timeOptions = generateOptions(adapter, this._dateFormats, min, max, interval);
|
|
312
|
+
}
|
|
378
313
|
}
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
if (this._keyManager.activeItem) {
|
|
392
|
-
this._selectValue(this._keyManager.activeItem);
|
|
393
|
-
}
|
|
394
|
-
else {
|
|
395
|
-
this.close();
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
else {
|
|
399
|
-
const previousActive = this._keyManager.activeItem;
|
|
400
|
-
this._keyManager.onKeydown(event);
|
|
401
|
-
const currentActive = this._keyManager.activeItem;
|
|
402
|
-
if (currentActive && currentActive !== previousActive) {
|
|
403
|
-
scrollOptionIntoView(currentActive, 'nearest');
|
|
404
|
-
}
|
|
405
|
-
}
|
|
314
|
+
}
|
|
315
|
+
_syncSelectedState(value, options, fallback) {
|
|
316
|
+
let hasSelected = false;
|
|
317
|
+
for (const option of options) {
|
|
318
|
+
if (value && this._dateAdapter.sameTime(option.value, value)) {
|
|
319
|
+
option.select(false);
|
|
320
|
+
scrollOptionIntoView(option, 'center');
|
|
321
|
+
untracked(() => this._keyManager.setActiveItem(option));
|
|
322
|
+
hasSelected = true;
|
|
323
|
+
} else {
|
|
324
|
+
option.deselect(false);
|
|
325
|
+
}
|
|
406
326
|
}
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
}
|
|
415
|
-
});
|
|
327
|
+
if (!hasSelected) {
|
|
328
|
+
if (fallback) {
|
|
329
|
+
untracked(() => this._keyManager.setActiveItem(fallback));
|
|
330
|
+
scrollOptionIntoView(fallback, 'center');
|
|
331
|
+
} else {
|
|
332
|
+
untracked(() => this._keyManager.setActiveItem(-1));
|
|
333
|
+
}
|
|
416
334
|
}
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
335
|
+
}
|
|
336
|
+
_handleKeydown(event) {
|
|
337
|
+
const keyCode = event.keyCode;
|
|
338
|
+
if (keyCode === TAB) {
|
|
339
|
+
this.close();
|
|
340
|
+
} else if (keyCode === ESCAPE && !hasModifierKey(event)) {
|
|
341
|
+
event.preventDefault();
|
|
342
|
+
this.close();
|
|
343
|
+
} else if (keyCode === ENTER) {
|
|
344
|
+
event.preventDefault();
|
|
345
|
+
if (this._keyManager.activeItem) {
|
|
346
|
+
this._selectValue(this._keyManager.activeItem);
|
|
347
|
+
} else {
|
|
348
|
+
this.close();
|
|
349
|
+
}
|
|
350
|
+
} else {
|
|
351
|
+
const previousActive = this._keyManager.activeItem;
|
|
352
|
+
this._keyManager.onKeydown(event);
|
|
353
|
+
const currentActive = this._keyManager.activeItem;
|
|
354
|
+
if (currentActive && currentActive !== previousActive) {
|
|
355
|
+
scrollOptionIntoView(currentActive, 'nearest');
|
|
356
|
+
}
|
|
428
357
|
}
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
358
|
+
}
|
|
359
|
+
_handleLocaleChanges() {
|
|
360
|
+
this._localeChanges = this._dateAdapter.localeChanges.subscribe(() => {
|
|
361
|
+
this._optionsCacheKey = null;
|
|
362
|
+
if (this.isOpen()) {
|
|
363
|
+
this._generateOptions();
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
_handleInputStateChanges() {
|
|
368
|
+
effect(() => {
|
|
369
|
+
const input = this._input();
|
|
370
|
+
const options = this._options();
|
|
371
|
+
if (this._isOpen() && input) {
|
|
372
|
+
this._syncSelectedState(input.value(), options, null);
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
377
|
+
minVersion: "12.0.0",
|
|
378
|
+
version: "20.2.0-next.2",
|
|
379
|
+
ngImport: i0,
|
|
380
|
+
type: MatTimepicker,
|
|
381
|
+
deps: [],
|
|
382
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
383
|
+
});
|
|
384
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
385
|
+
minVersion: "17.0.0",
|
|
386
|
+
version: "20.2.0-next.2",
|
|
387
|
+
type: MatTimepicker,
|
|
388
|
+
isStandalone: true,
|
|
389
|
+
selector: "mat-timepicker",
|
|
390
|
+
inputs: {
|
|
391
|
+
interval: {
|
|
392
|
+
classPropertyName: "interval",
|
|
393
|
+
publicName: "interval",
|
|
394
|
+
isSignal: true,
|
|
395
|
+
isRequired: false,
|
|
396
|
+
transformFunction: null
|
|
397
|
+
},
|
|
398
|
+
options: {
|
|
399
|
+
classPropertyName: "options",
|
|
400
|
+
publicName: "options",
|
|
401
|
+
isSignal: true,
|
|
402
|
+
isRequired: false,
|
|
403
|
+
transformFunction: null
|
|
404
|
+
},
|
|
405
|
+
disableRipple: {
|
|
406
|
+
classPropertyName: "disableRipple",
|
|
407
|
+
publicName: "disableRipple",
|
|
408
|
+
isSignal: true,
|
|
409
|
+
isRequired: false,
|
|
410
|
+
transformFunction: null
|
|
411
|
+
},
|
|
412
|
+
ariaLabel: {
|
|
413
|
+
classPropertyName: "ariaLabel",
|
|
414
|
+
publicName: "aria-label",
|
|
415
|
+
isSignal: true,
|
|
416
|
+
isRequired: false,
|
|
417
|
+
transformFunction: null
|
|
418
|
+
},
|
|
419
|
+
ariaLabelledby: {
|
|
420
|
+
classPropertyName: "ariaLabelledby",
|
|
421
|
+
publicName: "aria-labelledby",
|
|
422
|
+
isSignal: true,
|
|
423
|
+
isRequired: false,
|
|
424
|
+
transformFunction: null
|
|
425
|
+
}
|
|
426
|
+
},
|
|
427
|
+
outputs: {
|
|
428
|
+
selected: "selected",
|
|
429
|
+
opened: "opened",
|
|
430
|
+
closed: "closed"
|
|
431
|
+
},
|
|
432
|
+
providers: [{
|
|
433
|
+
provide: MAT_OPTION_PARENT_COMPONENT,
|
|
434
|
+
useExisting: MatTimepicker
|
|
435
|
+
}],
|
|
436
|
+
viewQueries: [{
|
|
437
|
+
propertyName: "_panelTemplate",
|
|
438
|
+
first: true,
|
|
439
|
+
predicate: ["panelTemplate"],
|
|
440
|
+
descendants: true,
|
|
441
|
+
isSignal: true
|
|
442
|
+
}, {
|
|
443
|
+
propertyName: "_options",
|
|
444
|
+
predicate: MatOption,
|
|
445
|
+
descendants: true,
|
|
446
|
+
isSignal: true
|
|
447
|
+
}],
|
|
448
|
+
exportAs: ["matTimepicker"],
|
|
449
|
+
ngImport: i0,
|
|
450
|
+
template: "<ng-template #panelTemplate>\n <div\n role=\"listbox\"\n class=\"mat-timepicker-panel\"\n [class.mat-timepicker-panel-animations-enabled]=\"!_animationsDisabled\"\n [class.mat-timepicker-panel-exit]=\"!isOpen()\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"_getAriaLabelledby()\"\n [id]=\"panelId\"\n (animationend)=\"_handleAnimationEnd($event)\">\n @for (option of _timeOptions; track option.value) {\n <mat-option\n [value]=\"option.value\"\n (onSelectionChange)=\"_selectValue($event.source)\">{{option.label}}</mat-option>\n }\n </div>\n</ng-template>\n",
|
|
451
|
+
styles: ["@keyframes _mat-timepicker-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}@keyframes _mat-timepicker-exit{from{opacity:1}to{opacity:0}}mat-timepicker{display:none}.mat-timepicker-panel{width:100%;max-height:256px;transform-origin:center top;overflow:auto;padding:8px 0;box-sizing:border-box;position:relative;border-bottom-left-radius:var(--mat-timepicker-container-shape, var(--mat-sys-corner-extra-small));border-bottom-right-radius:var(--mat-timepicker-container-shape, var(--mat-sys-corner-extra-small));box-shadow:var(--mat-timepicker-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));background-color:var(--mat-timepicker-container-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){.mat-timepicker-panel{outline:solid 1px}}.mat-timepicker-above .mat-timepicker-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mat-timepicker-container-shape, var(--mat-sys-corner-extra-small));border-top-right-radius:var(--mat-timepicker-container-shape, var(--mat-sys-corner-extra-small))}.mat-timepicker-panel-animations-enabled{animation:_mat-timepicker-enter 120ms cubic-bezier(0, 0, 0.2, 1)}.mat-timepicker-panel-animations-enabled.mat-timepicker-panel-exit{animation:_mat-timepicker-exit 100ms linear}.mat-timepicker-input[readonly]{cursor:pointer}@media(forced-colors: active){.mat-timepicker-toggle-default-icon{color:CanvasText}}\n"],
|
|
452
|
+
dependencies: [{
|
|
453
|
+
kind: "component",
|
|
454
|
+
type: MatOption,
|
|
455
|
+
selector: "mat-option",
|
|
456
|
+
inputs: ["value", "id", "disabled"],
|
|
457
|
+
outputs: ["onSelectionChange"],
|
|
458
|
+
exportAs: ["matOption"]
|
|
459
|
+
}],
|
|
460
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
461
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
462
|
+
});
|
|
436
463
|
}
|
|
437
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
464
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
465
|
+
minVersion: "12.0.0",
|
|
466
|
+
version: "20.2.0-next.2",
|
|
467
|
+
ngImport: i0,
|
|
468
|
+
type: MatTimepicker,
|
|
469
|
+
decorators: [{
|
|
470
|
+
type: Component,
|
|
471
|
+
args: [{
|
|
472
|
+
selector: 'mat-timepicker',
|
|
473
|
+
exportAs: 'matTimepicker',
|
|
474
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
475
|
+
encapsulation: ViewEncapsulation.None,
|
|
476
|
+
imports: [MatOption],
|
|
477
|
+
providers: [{
|
|
478
|
+
provide: MAT_OPTION_PARENT_COMPONENT,
|
|
479
|
+
useExisting: MatTimepicker
|
|
480
|
+
}],
|
|
481
|
+
template: "<ng-template #panelTemplate>\n <div\n role=\"listbox\"\n class=\"mat-timepicker-panel\"\n [class.mat-timepicker-panel-animations-enabled]=\"!_animationsDisabled\"\n [class.mat-timepicker-panel-exit]=\"!isOpen()\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"_getAriaLabelledby()\"\n [id]=\"panelId\"\n (animationend)=\"_handleAnimationEnd($event)\">\n @for (option of _timeOptions; track option.value) {\n <mat-option\n [value]=\"option.value\"\n (onSelectionChange)=\"_selectValue($event.source)\">{{option.label}}</mat-option>\n }\n </div>\n</ng-template>\n",
|
|
482
|
+
styles: ["@keyframes _mat-timepicker-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}@keyframes _mat-timepicker-exit{from{opacity:1}to{opacity:0}}mat-timepicker{display:none}.mat-timepicker-panel{width:100%;max-height:256px;transform-origin:center top;overflow:auto;padding:8px 0;box-sizing:border-box;position:relative;border-bottom-left-radius:var(--mat-timepicker-container-shape, var(--mat-sys-corner-extra-small));border-bottom-right-radius:var(--mat-timepicker-container-shape, var(--mat-sys-corner-extra-small));box-shadow:var(--mat-timepicker-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));background-color:var(--mat-timepicker-container-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){.mat-timepicker-panel{outline:solid 1px}}.mat-timepicker-above .mat-timepicker-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mat-timepicker-container-shape, var(--mat-sys-corner-extra-small));border-top-right-radius:var(--mat-timepicker-container-shape, var(--mat-sys-corner-extra-small))}.mat-timepicker-panel-animations-enabled{animation:_mat-timepicker-enter 120ms cubic-bezier(0, 0, 0.2, 1)}.mat-timepicker-panel-animations-enabled.mat-timepicker-panel-exit{animation:_mat-timepicker-exit 100ms linear}.mat-timepicker-input[readonly]{cursor:pointer}@media(forced-colors: active){.mat-timepicker-toggle-default-icon{color:CanvasText}}\n"]
|
|
483
|
+
}]
|
|
484
|
+
}],
|
|
485
|
+
ctorParameters: () => []
|
|
486
|
+
});
|
|
451
487
|
function scrollOptionIntoView(option, position) {
|
|
452
|
-
|
|
488
|
+
option._getHostElement().scrollIntoView({
|
|
489
|
+
block: position,
|
|
490
|
+
inline: position
|
|
491
|
+
});
|
|
453
492
|
}
|
|
454
493
|
|
|
455
|
-
/**
|
|
456
|
-
* Input that can be used to enter time and connect to a `mat-timepicker`.
|
|
457
|
-
*/
|
|
458
494
|
class MatTimepickerInput {
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
});
|
|
546
|
-
// Bind the click listener manually to the overlay origin, because we want the entire
|
|
547
|
-
// form field to be clickable, if the timepicker is used in `mat-form-field`.
|
|
548
|
-
this._cleanupClick = renderer.listen(this.getOverlayOrigin().nativeElement, 'click', this._handleClick);
|
|
549
|
-
}
|
|
550
|
-
/**
|
|
551
|
-
* Implemented as a part of `ControlValueAccessor`.
|
|
552
|
-
* @docs-private
|
|
553
|
-
*/
|
|
554
|
-
writeValue(value) {
|
|
555
|
-
// Note that we need to deserialize here, rather than depend on the value change effect,
|
|
556
|
-
// because `getValidDateOrNull` will clobber the value if it's parseable, but not created by
|
|
557
|
-
// the current adapter (see #30140).
|
|
558
|
-
const deserialized = this._dateAdapter.deserialize(value);
|
|
559
|
-
this.value.set(this._dateAdapter.getValidDateOrNull(deserialized));
|
|
560
|
-
}
|
|
561
|
-
/**
|
|
562
|
-
* Implemented as a part of `ControlValueAccessor`.
|
|
563
|
-
* @docs-private
|
|
564
|
-
*/
|
|
565
|
-
registerOnChange(fn) {
|
|
566
|
-
this._onChange = fn;
|
|
567
|
-
}
|
|
568
|
-
/**
|
|
569
|
-
* Implemented as a part of `ControlValueAccessor`.
|
|
570
|
-
* @docs-private
|
|
571
|
-
*/
|
|
572
|
-
registerOnTouched(fn) {
|
|
573
|
-
this._onTouched = fn;
|
|
574
|
-
}
|
|
575
|
-
/**
|
|
576
|
-
* Implemented as a part of `ControlValueAccessor`.
|
|
577
|
-
* @docs-private
|
|
578
|
-
*/
|
|
579
|
-
setDisabledState(isDisabled) {
|
|
580
|
-
this._accessorDisabled.set(isDisabled);
|
|
581
|
-
}
|
|
582
|
-
/**
|
|
583
|
-
* Implemented as a part of `Validator`.
|
|
584
|
-
* @docs-private
|
|
585
|
-
*/
|
|
586
|
-
validate(control) {
|
|
587
|
-
return this._validator(control);
|
|
588
|
-
}
|
|
589
|
-
/**
|
|
590
|
-
* Implemented as a part of `Validator`.
|
|
591
|
-
* @docs-private
|
|
592
|
-
*/
|
|
593
|
-
registerOnValidatorChange(fn) {
|
|
594
|
-
this._validatorOnChange = fn;
|
|
495
|
+
_elementRef = inject(ElementRef);
|
|
496
|
+
_dateAdapter = inject(DateAdapter, {
|
|
497
|
+
optional: true
|
|
498
|
+
});
|
|
499
|
+
_dateFormats = inject(MAT_DATE_FORMATS, {
|
|
500
|
+
optional: true
|
|
501
|
+
});
|
|
502
|
+
_formField = inject(MAT_FORM_FIELD, {
|
|
503
|
+
optional: true
|
|
504
|
+
});
|
|
505
|
+
_onChange;
|
|
506
|
+
_onTouched;
|
|
507
|
+
_validatorOnChange;
|
|
508
|
+
_cleanupClick;
|
|
509
|
+
_accessorDisabled = signal(false, ...(ngDevMode ? [{
|
|
510
|
+
debugName: "_accessorDisabled"
|
|
511
|
+
}] : []));
|
|
512
|
+
_localeSubscription;
|
|
513
|
+
_timepickerSubscription;
|
|
514
|
+
_validator;
|
|
515
|
+
_lastValueValid = true;
|
|
516
|
+
_lastValidDate = null;
|
|
517
|
+
_ariaActiveDescendant = computed(() => {
|
|
518
|
+
const timepicker = this.timepicker();
|
|
519
|
+
const isOpen = timepicker.isOpen();
|
|
520
|
+
const activeDescendant = timepicker.activeDescendant();
|
|
521
|
+
return isOpen && activeDescendant ? activeDescendant : null;
|
|
522
|
+
}, ...(ngDevMode ? [{
|
|
523
|
+
debugName: "_ariaActiveDescendant"
|
|
524
|
+
}] : []));
|
|
525
|
+
_ariaExpanded = computed(() => this.timepicker().isOpen() + '', ...(ngDevMode ? [{
|
|
526
|
+
debugName: "_ariaExpanded"
|
|
527
|
+
}] : []));
|
|
528
|
+
_ariaControls = computed(() => {
|
|
529
|
+
const timepicker = this.timepicker();
|
|
530
|
+
return timepicker.isOpen() ? timepicker.panelId : null;
|
|
531
|
+
}, ...(ngDevMode ? [{
|
|
532
|
+
debugName: "_ariaControls"
|
|
533
|
+
}] : []));
|
|
534
|
+
value = model(null, ...(ngDevMode ? [{
|
|
535
|
+
debugName: "value"
|
|
536
|
+
}] : []));
|
|
537
|
+
timepicker = input.required(...(ngDevMode ? [{
|
|
538
|
+
debugName: "timepicker",
|
|
539
|
+
alias: 'matTimepicker'
|
|
540
|
+
}] : [{
|
|
541
|
+
alias: 'matTimepicker'
|
|
542
|
+
}]));
|
|
543
|
+
min = input(null, ...(ngDevMode ? [{
|
|
544
|
+
debugName: "min",
|
|
545
|
+
alias: 'matTimepickerMin',
|
|
546
|
+
transform: value => this._transformDateInput(value)
|
|
547
|
+
}] : [{
|
|
548
|
+
alias: 'matTimepickerMin',
|
|
549
|
+
transform: value => this._transformDateInput(value)
|
|
550
|
+
}]));
|
|
551
|
+
max = input(null, ...(ngDevMode ? [{
|
|
552
|
+
debugName: "max",
|
|
553
|
+
alias: 'matTimepickerMax',
|
|
554
|
+
transform: value => this._transformDateInput(value)
|
|
555
|
+
}] : [{
|
|
556
|
+
alias: 'matTimepickerMax',
|
|
557
|
+
transform: value => this._transformDateInput(value)
|
|
558
|
+
}]));
|
|
559
|
+
openOnClick = input(true, ...(ngDevMode ? [{
|
|
560
|
+
debugName: "openOnClick",
|
|
561
|
+
alias: 'matTimepickerOpenOnClick',
|
|
562
|
+
transform: booleanAttribute
|
|
563
|
+
}] : [{
|
|
564
|
+
alias: 'matTimepickerOpenOnClick',
|
|
565
|
+
transform: booleanAttribute
|
|
566
|
+
}]));
|
|
567
|
+
disabled = computed(() => this.disabledInput() || this._accessorDisabled(), ...(ngDevMode ? [{
|
|
568
|
+
debugName: "disabled"
|
|
569
|
+
}] : []));
|
|
570
|
+
disabledInput = input(false, ...(ngDevMode ? [{
|
|
571
|
+
debugName: "disabledInput",
|
|
572
|
+
transform: booleanAttribute,
|
|
573
|
+
alias: 'disabled'
|
|
574
|
+
}] : [{
|
|
575
|
+
transform: booleanAttribute,
|
|
576
|
+
alias: 'disabled'
|
|
577
|
+
}]));
|
|
578
|
+
constructor() {
|
|
579
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
580
|
+
validateAdapter(this._dateAdapter, this._dateFormats);
|
|
595
581
|
}
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
582
|
+
const renderer = inject(Renderer2);
|
|
583
|
+
this._validator = this._getValidator();
|
|
584
|
+
this._respondToValueChanges();
|
|
585
|
+
this._respondToMinMaxChanges();
|
|
586
|
+
this._registerTimepicker();
|
|
587
|
+
this._localeSubscription = this._dateAdapter.localeChanges.subscribe(() => {
|
|
588
|
+
if (!this._hasFocus()) {
|
|
589
|
+
this._formatValue(this.value());
|
|
590
|
+
}
|
|
591
|
+
});
|
|
592
|
+
this._cleanupClick = renderer.listen(this.getOverlayOrigin().nativeElement, 'click', this._handleClick);
|
|
593
|
+
}
|
|
594
|
+
writeValue(value) {
|
|
595
|
+
const deserialized = this._dateAdapter.deserialize(value);
|
|
596
|
+
this.value.set(this._dateAdapter.getValidDateOrNull(deserialized));
|
|
597
|
+
}
|
|
598
|
+
registerOnChange(fn) {
|
|
599
|
+
this._onChange = fn;
|
|
600
|
+
}
|
|
601
|
+
registerOnTouched(fn) {
|
|
602
|
+
this._onTouched = fn;
|
|
603
|
+
}
|
|
604
|
+
setDisabledState(isDisabled) {
|
|
605
|
+
this._accessorDisabled.set(isDisabled);
|
|
606
|
+
}
|
|
607
|
+
validate(control) {
|
|
608
|
+
return this._validator(control);
|
|
609
|
+
}
|
|
610
|
+
registerOnValidatorChange(fn) {
|
|
611
|
+
this._validatorOnChange = fn;
|
|
612
|
+
}
|
|
613
|
+
getOverlayOrigin() {
|
|
614
|
+
return this._formField?.getConnectedOverlayOrigin() || this._elementRef;
|
|
615
|
+
}
|
|
616
|
+
focus() {
|
|
617
|
+
this._elementRef.nativeElement.focus();
|
|
618
|
+
}
|
|
619
|
+
ngOnDestroy() {
|
|
620
|
+
this._cleanupClick();
|
|
621
|
+
this._timepickerSubscription?.unsubscribe();
|
|
622
|
+
this._localeSubscription.unsubscribe();
|
|
623
|
+
}
|
|
624
|
+
getLabelId() {
|
|
625
|
+
return this._formField?.getLabelId() || null;
|
|
626
|
+
}
|
|
627
|
+
_handleClick = event => {
|
|
628
|
+
if (this.disabled() || !this.openOnClick()) {
|
|
629
|
+
return;
|
|
599
630
|
}
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
631
|
+
const target = _getEventTarget(event);
|
|
632
|
+
const overlayHost = this.timepicker()._getOverlayHost();
|
|
633
|
+
if (!target || !overlayHost || !overlayHost.contains(target)) {
|
|
634
|
+
this.timepicker().open();
|
|
603
635
|
}
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
636
|
+
};
|
|
637
|
+
_handleInput(event) {
|
|
638
|
+
const value = event.target.value;
|
|
639
|
+
const currentValue = this.value();
|
|
640
|
+
const date = this._dateAdapter.parseTime(value, this._dateFormats.parse.timeInput);
|
|
641
|
+
const hasChanged = !this._dateAdapter.sameTime(date, currentValue);
|
|
642
|
+
if (!date || hasChanged || !!(value && !currentValue)) {
|
|
643
|
+
this._assignUserSelection(date, true);
|
|
644
|
+
} else {
|
|
645
|
+
this._validatorOnChange?.();
|
|
608
646
|
}
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
647
|
+
}
|
|
648
|
+
_handleBlur() {
|
|
649
|
+
const value = this.value();
|
|
650
|
+
if (value && this._isValid(value)) {
|
|
651
|
+
this._formatValue(value);
|
|
612
652
|
}
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
if (!this.disabled() && this.openOnClick()) {
|
|
616
|
-
this.timepicker().open();
|
|
617
|
-
}
|
|
618
|
-
};
|
|
619
|
-
/** Handles the `input` event. */
|
|
620
|
-
_handleInput(event) {
|
|
621
|
-
const value = event.target.value;
|
|
622
|
-
const currentValue = this.value();
|
|
623
|
-
const date = this._dateAdapter.parseTime(value, this._dateFormats.parse.timeInput);
|
|
624
|
-
const hasChanged = !this._dateAdapter.sameTime(date, currentValue);
|
|
625
|
-
if (!date || hasChanged || !!(value && !currentValue)) {
|
|
626
|
-
// We need to fire the CVA change event for all nulls, otherwise the validators won't run.
|
|
627
|
-
this._assignUserSelection(date, true);
|
|
628
|
-
}
|
|
629
|
-
else {
|
|
630
|
-
// Call the validator even if the value hasn't changed since
|
|
631
|
-
// some fields change depending on what the user has entered.
|
|
632
|
-
this._validatorOnChange?.();
|
|
633
|
-
}
|
|
653
|
+
if (!this.timepicker().isOpen()) {
|
|
654
|
+
this._onTouched?.();
|
|
634
655
|
}
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
if (value && this._isValid(value)) {
|
|
640
|
-
this._formatValue(value);
|
|
641
|
-
}
|
|
642
|
-
if (!this.timepicker().isOpen()) {
|
|
643
|
-
this._onTouched?.();
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
/** Handles the `keydown` event. */
|
|
647
|
-
_handleKeydown(event) {
|
|
648
|
-
// All keyboard events while open are handled through the timepicker.
|
|
649
|
-
if (this.timepicker().isOpen() || this.disabled()) {
|
|
650
|
-
return;
|
|
651
|
-
}
|
|
652
|
-
if (event.keyCode === ESCAPE && !hasModifierKey(event) && this.value() !== null) {
|
|
653
|
-
event.preventDefault();
|
|
654
|
-
this.value.set(null);
|
|
655
|
-
this._formatValue(null);
|
|
656
|
-
}
|
|
657
|
-
else if (event.keyCode === DOWN_ARROW || event.keyCode === UP_ARROW) {
|
|
658
|
-
event.preventDefault();
|
|
659
|
-
this.timepicker().open();
|
|
660
|
-
}
|
|
656
|
+
}
|
|
657
|
+
_handleKeydown(event) {
|
|
658
|
+
if (this.timepicker().isOpen() || this.disabled()) {
|
|
659
|
+
return;
|
|
661
660
|
}
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
661
|
+
if (event.keyCode === ESCAPE && !hasModifierKey(event) && this.value() !== null) {
|
|
662
|
+
event.preventDefault();
|
|
663
|
+
this.value.set(null);
|
|
664
|
+
this._formatValue(null);
|
|
665
|
+
} else if (event.keyCode === DOWN_ARROW || event.keyCode === UP_ARROW) {
|
|
666
|
+
event.preventDefault();
|
|
667
|
+
this.timepicker().open();
|
|
668
668
|
}
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
this._lastValueValid = this._isValid(value);
|
|
675
|
-
// Reformat the value if it changes while the user isn't interacting.
|
|
676
|
-
if (!this._hasFocus()) {
|
|
677
|
-
this._formatValue(value);
|
|
678
|
-
}
|
|
679
|
-
if (value && this._lastValueValid) {
|
|
680
|
-
this._lastValidDate = value;
|
|
681
|
-
}
|
|
682
|
-
// Trigger the validator if the state changed.
|
|
683
|
-
if (wasValid !== this._lastValueValid) {
|
|
684
|
-
this._validatorOnChange?.();
|
|
685
|
-
}
|
|
686
|
-
});
|
|
669
|
+
}
|
|
670
|
+
timepickerValueAssigned(value) {
|
|
671
|
+
if (!this._dateAdapter.sameTime(value, this.value())) {
|
|
672
|
+
this._assignUserSelection(value, true);
|
|
673
|
+
this._formatValue(value);
|
|
687
674
|
}
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
675
|
+
}
|
|
676
|
+
_respondToValueChanges() {
|
|
677
|
+
effect(() => {
|
|
678
|
+
const value = this._dateAdapter.deserialize(this.value());
|
|
679
|
+
const wasValid = this._lastValueValid;
|
|
680
|
+
this._lastValueValid = this._isValid(value);
|
|
681
|
+
if (!this._hasFocus()) {
|
|
682
|
+
this._formatValue(value);
|
|
683
|
+
}
|
|
684
|
+
if (value && this._lastValueValid) {
|
|
685
|
+
this._lastValidDate = value;
|
|
686
|
+
}
|
|
687
|
+
if (wasValid !== this._lastValueValid) {
|
|
688
|
+
this._validatorOnChange?.();
|
|
689
|
+
}
|
|
690
|
+
});
|
|
691
|
+
}
|
|
692
|
+
_registerTimepicker() {
|
|
693
|
+
effect(() => {
|
|
694
|
+
const timepicker = this.timepicker();
|
|
695
|
+
timepicker.registerInput(this);
|
|
696
|
+
timepicker.closed.subscribe(() => this._onTouched?.());
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
_respondToMinMaxChanges() {
|
|
700
|
+
effect(() => {
|
|
701
|
+
this.min();
|
|
702
|
+
this.max();
|
|
703
|
+
this._validatorOnChange?.();
|
|
704
|
+
});
|
|
705
|
+
}
|
|
706
|
+
_assignUserSelection(selection, propagateToAccessor) {
|
|
707
|
+
let toAssign;
|
|
708
|
+
if (selection == null || !this._isValid(selection)) {
|
|
709
|
+
toAssign = selection;
|
|
710
|
+
} else {
|
|
711
|
+
const adapter = this._dateAdapter;
|
|
712
|
+
const target = adapter.getValidDateOrNull(this._lastValidDate || this.value());
|
|
713
|
+
const hours = adapter.getHours(selection);
|
|
714
|
+
const minutes = adapter.getMinutes(selection);
|
|
715
|
+
const seconds = adapter.getSeconds(selection);
|
|
716
|
+
toAssign = target ? adapter.setTime(target, hours, minutes, seconds) : selection;
|
|
695
717
|
}
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
effect(() => {
|
|
699
|
-
// Read the min/max so the effect knows when to fire.
|
|
700
|
-
this.min();
|
|
701
|
-
this.max();
|
|
702
|
-
this._validatorOnChange?.();
|
|
703
|
-
});
|
|
718
|
+
if (propagateToAccessor) {
|
|
719
|
+
this._onChange?.(toAssign);
|
|
704
720
|
}
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
721
|
+
this.value.set(toAssign);
|
|
722
|
+
}
|
|
723
|
+
_formatValue(value) {
|
|
724
|
+
value = this._dateAdapter.getValidDateOrNull(value);
|
|
725
|
+
this._elementRef.nativeElement.value = value == null ? '' : this._dateAdapter.format(value, this._dateFormats.display.timeInput);
|
|
726
|
+
}
|
|
727
|
+
_isValid(value) {
|
|
728
|
+
return !value || this._dateAdapter.isValid(value);
|
|
729
|
+
}
|
|
730
|
+
_transformDateInput(value) {
|
|
731
|
+
const date = typeof value === 'string' ? this._dateAdapter.parseTime(value, this._dateFormats.parse.timeInput) : this._dateAdapter.deserialize(value);
|
|
732
|
+
return date && this._dateAdapter.isValid(date) ? date : null;
|
|
733
|
+
}
|
|
734
|
+
_hasFocus() {
|
|
735
|
+
return _getFocusedElementPierceShadowDom() === this._elementRef.nativeElement;
|
|
736
|
+
}
|
|
737
|
+
_getValidator() {
|
|
738
|
+
return Validators.compose([() => this._lastValueValid ? null : {
|
|
739
|
+
'matTimepickerParse': {
|
|
740
|
+
'text': this._elementRef.nativeElement.value
|
|
741
|
+
}
|
|
742
|
+
}, control => {
|
|
743
|
+
const controlValue = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(control.value));
|
|
744
|
+
const min = this.min();
|
|
745
|
+
return !min || !controlValue || this._dateAdapter.compareTime(min, controlValue) <= 0 ? null : {
|
|
746
|
+
'matTimepickerMin': {
|
|
747
|
+
'min': min,
|
|
748
|
+
'actual': controlValue
|
|
727
749
|
}
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
750
|
+
};
|
|
751
|
+
}, control => {
|
|
752
|
+
const controlValue = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(control.value));
|
|
753
|
+
const max = this.max();
|
|
754
|
+
return !max || !controlValue || this._dateAdapter.compareTime(max, controlValue) >= 0 ? null : {
|
|
755
|
+
'matTimepickerMax': {
|
|
756
|
+
'max': max,
|
|
757
|
+
'actual': controlValue
|
|
731
758
|
}
|
|
732
|
-
|
|
733
|
-
}
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
759
|
+
};
|
|
760
|
+
}]);
|
|
761
|
+
}
|
|
762
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
763
|
+
minVersion: "12.0.0",
|
|
764
|
+
version: "20.2.0-next.2",
|
|
765
|
+
ngImport: i0,
|
|
766
|
+
type: MatTimepickerInput,
|
|
767
|
+
deps: [],
|
|
768
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
769
|
+
});
|
|
770
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
771
|
+
minVersion: "17.1.0",
|
|
772
|
+
version: "20.2.0-next.2",
|
|
773
|
+
type: MatTimepickerInput,
|
|
774
|
+
isStandalone: true,
|
|
775
|
+
selector: "input[matTimepicker]",
|
|
776
|
+
inputs: {
|
|
777
|
+
value: {
|
|
778
|
+
classPropertyName: "value",
|
|
779
|
+
publicName: "value",
|
|
780
|
+
isSignal: true,
|
|
781
|
+
isRequired: false,
|
|
782
|
+
transformFunction: null
|
|
783
|
+
},
|
|
784
|
+
timepicker: {
|
|
785
|
+
classPropertyName: "timepicker",
|
|
786
|
+
publicName: "matTimepicker",
|
|
787
|
+
isSignal: true,
|
|
788
|
+
isRequired: true,
|
|
789
|
+
transformFunction: null
|
|
790
|
+
},
|
|
791
|
+
min: {
|
|
792
|
+
classPropertyName: "min",
|
|
793
|
+
publicName: "matTimepickerMin",
|
|
794
|
+
isSignal: true,
|
|
795
|
+
isRequired: false,
|
|
796
|
+
transformFunction: null
|
|
797
|
+
},
|
|
798
|
+
max: {
|
|
799
|
+
classPropertyName: "max",
|
|
800
|
+
publicName: "matTimepickerMax",
|
|
801
|
+
isSignal: true,
|
|
802
|
+
isRequired: false,
|
|
803
|
+
transformFunction: null
|
|
804
|
+
},
|
|
805
|
+
openOnClick: {
|
|
806
|
+
classPropertyName: "openOnClick",
|
|
807
|
+
publicName: "matTimepickerOpenOnClick",
|
|
808
|
+
isSignal: true,
|
|
809
|
+
isRequired: false,
|
|
810
|
+
transformFunction: null
|
|
811
|
+
},
|
|
812
|
+
disabledInput: {
|
|
813
|
+
classPropertyName: "disabledInput",
|
|
814
|
+
publicName: "disabled",
|
|
815
|
+
isSignal: true,
|
|
816
|
+
isRequired: false,
|
|
817
|
+
transformFunction: null
|
|
818
|
+
}
|
|
819
|
+
},
|
|
820
|
+
outputs: {
|
|
821
|
+
value: "valueChange"
|
|
822
|
+
},
|
|
823
|
+
host: {
|
|
824
|
+
attributes: {
|
|
825
|
+
"role": "combobox",
|
|
826
|
+
"type": "text",
|
|
827
|
+
"aria-haspopup": "listbox"
|
|
828
|
+
},
|
|
829
|
+
listeners: {
|
|
830
|
+
"blur": "_handleBlur()",
|
|
831
|
+
"input": "_handleInput($event)",
|
|
832
|
+
"keydown": "_handleKeydown($event)"
|
|
833
|
+
},
|
|
834
|
+
properties: {
|
|
835
|
+
"attr.aria-activedescendant": "_ariaActiveDescendant()",
|
|
836
|
+
"attr.aria-expanded": "_ariaExpanded()",
|
|
837
|
+
"attr.aria-controls": "_ariaControls()",
|
|
838
|
+
"attr.mat-timepicker-id": "timepicker()?.panelId",
|
|
839
|
+
"disabled": "disabled()"
|
|
840
|
+
},
|
|
841
|
+
classAttribute: "mat-timepicker-input"
|
|
842
|
+
},
|
|
843
|
+
providers: [{
|
|
844
|
+
provide: NG_VALUE_ACCESSOR,
|
|
845
|
+
useExisting: MatTimepickerInput,
|
|
846
|
+
multi: true
|
|
847
|
+
}, {
|
|
848
|
+
provide: NG_VALIDATORS,
|
|
849
|
+
useExisting: MatTimepickerInput,
|
|
850
|
+
multi: true
|
|
851
|
+
}, {
|
|
852
|
+
provide: MAT_INPUT_VALUE_ACCESSOR,
|
|
853
|
+
useExisting: MatTimepickerInput
|
|
854
|
+
}],
|
|
855
|
+
exportAs: ["matTimepickerInput"],
|
|
856
|
+
ngImport: i0
|
|
857
|
+
});
|
|
794
858
|
}
|
|
795
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
859
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
860
|
+
minVersion: "12.0.0",
|
|
861
|
+
version: "20.2.0-next.2",
|
|
862
|
+
ngImport: i0,
|
|
863
|
+
type: MatTimepickerInput,
|
|
864
|
+
decorators: [{
|
|
865
|
+
type: Directive,
|
|
866
|
+
args: [{
|
|
867
|
+
selector: 'input[matTimepicker]',
|
|
868
|
+
exportAs: 'matTimepickerInput',
|
|
869
|
+
host: {
|
|
870
|
+
'class': 'mat-timepicker-input',
|
|
871
|
+
'role': 'combobox',
|
|
872
|
+
'type': 'text',
|
|
873
|
+
'aria-haspopup': 'listbox',
|
|
874
|
+
'[attr.aria-activedescendant]': '_ariaActiveDescendant()',
|
|
875
|
+
'[attr.aria-expanded]': '_ariaExpanded()',
|
|
876
|
+
'[attr.aria-controls]': '_ariaControls()',
|
|
877
|
+
'[attr.mat-timepicker-id]': 'timepicker()?.panelId',
|
|
878
|
+
'[disabled]': 'disabled()',
|
|
879
|
+
'(blur)': '_handleBlur()',
|
|
880
|
+
'(input)': '_handleInput($event)',
|
|
881
|
+
'(keydown)': '_handleKeydown($event)'
|
|
882
|
+
},
|
|
883
|
+
providers: [{
|
|
884
|
+
provide: NG_VALUE_ACCESSOR,
|
|
885
|
+
useExisting: MatTimepickerInput,
|
|
886
|
+
multi: true
|
|
887
|
+
}, {
|
|
888
|
+
provide: NG_VALIDATORS,
|
|
889
|
+
useExisting: MatTimepickerInput,
|
|
890
|
+
multi: true
|
|
891
|
+
}, {
|
|
892
|
+
provide: MAT_INPUT_VALUE_ACCESSOR,
|
|
893
|
+
useExisting: MatTimepickerInput
|
|
894
|
+
}]
|
|
895
|
+
}]
|
|
896
|
+
}],
|
|
897
|
+
ctorParameters: () => []
|
|
898
|
+
});
|
|
832
899
|
|
|
833
|
-
/** Button that can be used to open a `mat-timepicker`. */
|
|
834
900
|
class MatTimepickerToggle {
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
timepicker =
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
901
|
+
_defaultConfig = inject(MAT_TIMEPICKER_CONFIG, {
|
|
902
|
+
optional: true
|
|
903
|
+
});
|
|
904
|
+
_defaultTabIndex = (() => {
|
|
905
|
+
const value = inject(new HostAttributeToken('tabindex'), {
|
|
906
|
+
optional: true
|
|
907
|
+
});
|
|
908
|
+
const parsed = Number(value);
|
|
909
|
+
return isNaN(parsed) ? null : parsed;
|
|
910
|
+
})();
|
|
911
|
+
_isDisabled = computed(() => {
|
|
912
|
+
const timepicker = this.timepicker();
|
|
913
|
+
return this.disabled() || timepicker.disabled();
|
|
914
|
+
}, ...(ngDevMode ? [{
|
|
915
|
+
debugName: "_isDisabled"
|
|
916
|
+
}] : []));
|
|
917
|
+
timepicker = input.required(...(ngDevMode ? [{
|
|
918
|
+
debugName: "timepicker",
|
|
919
|
+
alias: 'for'
|
|
920
|
+
}] : [{
|
|
921
|
+
alias: 'for'
|
|
922
|
+
}]));
|
|
923
|
+
ariaLabel = input(undefined, ...(ngDevMode ? [{
|
|
924
|
+
debugName: "ariaLabel",
|
|
925
|
+
alias: 'aria-label'
|
|
926
|
+
}] : [{
|
|
927
|
+
alias: 'aria-label'
|
|
928
|
+
}]));
|
|
929
|
+
ariaLabelledby = input(undefined, ...(ngDevMode ? [{
|
|
930
|
+
debugName: "ariaLabelledby",
|
|
931
|
+
alias: 'aria-labelledby'
|
|
932
|
+
}] : [{
|
|
933
|
+
alias: 'aria-labelledby'
|
|
934
|
+
}]));
|
|
935
|
+
_defaultAriaLabel = 'Open timepicker options';
|
|
936
|
+
disabled = input(false, ...(ngDevMode ? [{
|
|
937
|
+
debugName: "disabled",
|
|
938
|
+
transform: booleanAttribute,
|
|
939
|
+
alias: 'disabled'
|
|
940
|
+
}] : [{
|
|
941
|
+
transform: booleanAttribute,
|
|
942
|
+
alias: 'disabled'
|
|
943
|
+
}]));
|
|
944
|
+
tabIndex = input(this._defaultTabIndex, ...(ngDevMode ? [{
|
|
945
|
+
debugName: "tabIndex"
|
|
946
|
+
}] : []));
|
|
947
|
+
disableRipple = input(this._defaultConfig?.disableRipple ?? false, ...(ngDevMode ? [{
|
|
948
|
+
debugName: "disableRipple",
|
|
949
|
+
transform: booleanAttribute
|
|
950
|
+
}] : [{
|
|
951
|
+
transform: booleanAttribute
|
|
952
|
+
}]));
|
|
953
|
+
_open(event) {
|
|
954
|
+
if (this.timepicker() && !this._isDisabled()) {
|
|
955
|
+
this.timepicker().open();
|
|
956
|
+
event.stopPropagation();
|
|
882
957
|
}
|
|
883
|
-
|
|
884
|
-
|
|
958
|
+
}
|
|
959
|
+
getAriaLabel() {
|
|
960
|
+
return this.ariaLabelledby() ? null : this.ariaLabel() || this._defaultAriaLabel;
|
|
961
|
+
}
|
|
962
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
963
|
+
minVersion: "12.0.0",
|
|
964
|
+
version: "20.2.0-next.2",
|
|
965
|
+
ngImport: i0,
|
|
966
|
+
type: MatTimepickerToggle,
|
|
967
|
+
deps: [],
|
|
968
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
969
|
+
});
|
|
970
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
971
|
+
minVersion: "17.1.0",
|
|
972
|
+
version: "20.2.0-next.2",
|
|
973
|
+
type: MatTimepickerToggle,
|
|
974
|
+
isStandalone: true,
|
|
975
|
+
selector: "mat-timepicker-toggle",
|
|
976
|
+
inputs: {
|
|
977
|
+
timepicker: {
|
|
978
|
+
classPropertyName: "timepicker",
|
|
979
|
+
publicName: "for",
|
|
980
|
+
isSignal: true,
|
|
981
|
+
isRequired: true,
|
|
982
|
+
transformFunction: null
|
|
983
|
+
},
|
|
984
|
+
ariaLabel: {
|
|
985
|
+
classPropertyName: "ariaLabel",
|
|
986
|
+
publicName: "aria-label",
|
|
987
|
+
isSignal: true,
|
|
988
|
+
isRequired: false,
|
|
989
|
+
transformFunction: null
|
|
990
|
+
},
|
|
991
|
+
ariaLabelledby: {
|
|
992
|
+
classPropertyName: "ariaLabelledby",
|
|
993
|
+
publicName: "aria-labelledby",
|
|
994
|
+
isSignal: true,
|
|
995
|
+
isRequired: false,
|
|
996
|
+
transformFunction: null
|
|
997
|
+
},
|
|
998
|
+
disabled: {
|
|
999
|
+
classPropertyName: "disabled",
|
|
1000
|
+
publicName: "disabled",
|
|
1001
|
+
isSignal: true,
|
|
1002
|
+
isRequired: false,
|
|
1003
|
+
transformFunction: null
|
|
1004
|
+
},
|
|
1005
|
+
tabIndex: {
|
|
1006
|
+
classPropertyName: "tabIndex",
|
|
1007
|
+
publicName: "tabIndex",
|
|
1008
|
+
isSignal: true,
|
|
1009
|
+
isRequired: false,
|
|
1010
|
+
transformFunction: null
|
|
1011
|
+
},
|
|
1012
|
+
disableRipple: {
|
|
1013
|
+
classPropertyName: "disableRipple",
|
|
1014
|
+
publicName: "disableRipple",
|
|
1015
|
+
isSignal: true,
|
|
1016
|
+
isRequired: false,
|
|
1017
|
+
transformFunction: null
|
|
1018
|
+
}
|
|
1019
|
+
},
|
|
1020
|
+
host: {
|
|
1021
|
+
listeners: {
|
|
1022
|
+
"click": "_open($event)"
|
|
1023
|
+
},
|
|
1024
|
+
properties: {
|
|
1025
|
+
"attr.tabindex": "null"
|
|
1026
|
+
},
|
|
1027
|
+
classAttribute: "mat-timepicker-toggle"
|
|
1028
|
+
},
|
|
1029
|
+
exportAs: ["matTimepickerToggle"],
|
|
1030
|
+
ngImport: i0,
|
|
1031
|
+
template: "<button\n matIconButton\n type=\"button\"\n aria-haspopup=\"listbox\"\n [attr.aria-label]=\"getAriaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-expanded]=\"timepicker().isOpen()\"\n [tabIndex]=\"_isDisabled() ? -1 : tabIndex()\"\n [disabled]=\"_isDisabled()\"\n [disableRipple]=\"disableRipple()\">\n\n <ng-content select=\"[matTimepickerToggleIcon]\">\n <svg\n class=\"mat-timepicker-toggle-default-icon\"\n height=\"24px\"\n width=\"24px\"\n viewBox=\"0 -960 960 960\"\n fill=\"currentColor\"\n focusable=\"false\"\n aria-hidden=\"true\">\n <path d=\"m612-292 56-56-148-148v-184h-80v216l172 172ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 320q133 0 226.5-93.5T800-480q0-133-93.5-226.5T480-800q-133 0-226.5 93.5T160-480q0 133 93.5 226.5T480-160Z\"/>\n </svg>\n </ng-content>\n</button>\n",
|
|
1032
|
+
dependencies: [{
|
|
1033
|
+
kind: "component",
|
|
1034
|
+
type: MatIconButton,
|
|
1035
|
+
selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]",
|
|
1036
|
+
exportAs: ["matButton", "matAnchor"]
|
|
1037
|
+
}],
|
|
1038
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1039
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
1040
|
+
});
|
|
885
1041
|
}
|
|
886
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
1042
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1043
|
+
minVersion: "12.0.0",
|
|
1044
|
+
version: "20.2.0-next.2",
|
|
1045
|
+
ngImport: i0,
|
|
1046
|
+
type: MatTimepickerToggle,
|
|
1047
|
+
decorators: [{
|
|
1048
|
+
type: Component,
|
|
1049
|
+
args: [{
|
|
1050
|
+
selector: 'mat-timepicker-toggle',
|
|
1051
|
+
host: {
|
|
1052
|
+
'class': 'mat-timepicker-toggle',
|
|
1053
|
+
'[attr.tabindex]': 'null',
|
|
1054
|
+
'(click)': '_open($event)'
|
|
1055
|
+
},
|
|
1056
|
+
exportAs: 'matTimepickerToggle',
|
|
1057
|
+
encapsulation: ViewEncapsulation.None,
|
|
1058
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1059
|
+
imports: [MatIconButton],
|
|
1060
|
+
template: "<button\n matIconButton\n type=\"button\"\n aria-haspopup=\"listbox\"\n [attr.aria-label]=\"getAriaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-expanded]=\"timepicker().isOpen()\"\n [tabIndex]=\"_isDisabled() ? -1 : tabIndex()\"\n [disabled]=\"_isDisabled()\"\n [disableRipple]=\"disableRipple()\">\n\n <ng-content select=\"[matTimepickerToggleIcon]\">\n <svg\n class=\"mat-timepicker-toggle-default-icon\"\n height=\"24px\"\n width=\"24px\"\n viewBox=\"0 -960 960 960\"\n fill=\"currentColor\"\n focusable=\"false\"\n aria-hidden=\"true\">\n <path d=\"m612-292 56-56-148-148v-184h-80v216l172 172ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 320q133 0 226.5-93.5T800-480q0-133-93.5-226.5T480-800q-133 0-226.5 93.5T160-480q0 133 93.5 226.5T480-160Z\"/>\n </svg>\n </ng-content>\n</button>\n"
|
|
1061
|
+
}]
|
|
1062
|
+
}]
|
|
1063
|
+
});
|
|
897
1064
|
|
|
898
1065
|
class MatTimepickerModule {
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
1066
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1067
|
+
minVersion: "12.0.0",
|
|
1068
|
+
version: "20.2.0-next.2",
|
|
1069
|
+
ngImport: i0,
|
|
1070
|
+
type: MatTimepickerModule,
|
|
1071
|
+
deps: [],
|
|
1072
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
1073
|
+
});
|
|
1074
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({
|
|
1075
|
+
minVersion: "14.0.0",
|
|
1076
|
+
version: "20.2.0-next.2",
|
|
1077
|
+
ngImport: i0,
|
|
1078
|
+
type: MatTimepickerModule,
|
|
1079
|
+
imports: [MatTimepicker, MatTimepickerInput, MatTimepickerToggle],
|
|
1080
|
+
exports: [CdkScrollableModule, MatTimepicker, MatTimepickerInput, MatTimepickerToggle]
|
|
1081
|
+
});
|
|
1082
|
+
static ɵinj = i0.ɵɵngDeclareInjector({
|
|
1083
|
+
minVersion: "12.0.0",
|
|
1084
|
+
version: "20.2.0-next.2",
|
|
1085
|
+
ngImport: i0,
|
|
1086
|
+
type: MatTimepickerModule,
|
|
1087
|
+
imports: [MatTimepicker, MatTimepickerToggle, CdkScrollableModule]
|
|
1088
|
+
});
|
|
902
1089
|
}
|
|
903
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
1090
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1091
|
+
minVersion: "12.0.0",
|
|
1092
|
+
version: "20.2.0-next.2",
|
|
1093
|
+
ngImport: i0,
|
|
1094
|
+
type: MatTimepickerModule,
|
|
1095
|
+
decorators: [{
|
|
1096
|
+
type: NgModule,
|
|
1097
|
+
args: [{
|
|
1098
|
+
imports: [MatTimepicker, MatTimepickerInput, MatTimepickerToggle],
|
|
1099
|
+
exports: [CdkScrollableModule, MatTimepicker, MatTimepickerInput, MatTimepickerToggle]
|
|
1100
|
+
}]
|
|
1101
|
+
}]
|
|
1102
|
+
});
|
|
910
1103
|
|
|
911
1104
|
export { MAT_TIMEPICKER_CONFIG, MAT_TIMEPICKER_SCROLL_STRATEGY, MatTimepicker, MatTimepickerInput, MatTimepickerModule, MatTimepickerToggle };
|
|
912
1105
|
//# sourceMappingURL=timepicker.mjs.map
|