@tectra-ng/ui 0.4.3 → 0.4.4
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/fesm2022/tectra-ng-ui-accordion.mjs +21 -21
- package/fesm2022/tectra-ng-ui-amount.mjs +3 -3
- package/fesm2022/tectra-ng-ui-analog-clock.mjs +6 -6
- package/fesm2022/tectra-ng-ui-autocomplete.mjs +3 -3
- package/fesm2022/tectra-ng-ui-avatar.mjs +9 -9
- package/fesm2022/tectra-ng-ui-badge.mjs +3 -3
- package/fesm2022/tectra-ng-ui-breadcrumb.mjs +9 -9
- package/fesm2022/tectra-ng-ui-button-group.mjs +3 -3
- package/fesm2022/tectra-ng-ui-button.mjs +9 -9
- package/fesm2022/tectra-ng-ui-card.mjs +3 -3
- package/fesm2022/tectra-ng-ui-carousel.mjs +15 -15
- package/fesm2022/tectra-ng-ui-cascade-select.mjs +3 -3
- package/fesm2022/tectra-ng-ui-checkbox.mjs +9 -9
- package/fesm2022/tectra-ng-ui-chip.mjs +3 -3
- package/fesm2022/tectra-ng-ui-chips-input.mjs +6 -6
- package/fesm2022/tectra-ng-ui-color-picker.mjs +3 -3
- package/fesm2022/tectra-ng-ui-color-swatches.mjs +3 -3
- package/fesm2022/tectra-ng-ui-confirm.mjs +9 -9
- package/fesm2022/tectra-ng-ui-countdown.mjs +9 -9
- package/fesm2022/tectra-ng-ui-country-select.mjs +3 -3
- package/fesm2022/tectra-ng-ui-country.mjs +3 -3
- package/fesm2022/tectra-ng-ui-data-view.mjs +30 -30
- package/fesm2022/tectra-ng-ui-datepicker.mjs +45 -34
- package/fesm2022/tectra-ng-ui-datepicker.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-dialog.mjs +24 -24
- package/fesm2022/tectra-ng-ui-divider.mjs +3 -3
- package/fesm2022/tectra-ng-ui-drawer.mjs +9 -9
- package/fesm2022/tectra-ng-ui-email-suggestion.mjs +3 -3
- package/fesm2022/tectra-ng-ui-export.mjs +27 -27
- package/fesm2022/tectra-ng-ui-field.mjs +3 -3
- package/fesm2022/tectra-ng-ui-fieldset.mjs +3 -3
- package/fesm2022/tectra-ng-ui-file-upload.mjs +12 -12
- package/fesm2022/tectra-ng-ui-galleria.mjs +21 -21
- package/fesm2022/tectra-ng-ui-highlight-text.mjs +3 -3
- package/fesm2022/tectra-ng-ui-icon-field.mjs +12 -12
- package/fesm2022/tectra-ng-ui-image.mjs +9 -9
- package/fesm2022/tectra-ng-ui-input-group.mjs +6 -6
- package/fesm2022/tectra-ng-ui-input-mask.mjs +3 -3
- package/fesm2022/tectra-ng-ui-input-number.mjs +3 -3
- package/fesm2022/tectra-ng-ui-input-otp.mjs +3 -3
- package/fesm2022/tectra-ng-ui-input.mjs +8 -8
- package/fesm2022/tectra-ng-ui-input.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-key-filter.mjs +3 -3
- package/fesm2022/tectra-ng-ui-knob.mjs +6 -6
- package/fesm2022/tectra-ng-ui-label.mjs +9 -9
- package/fesm2022/tectra-ng-ui-link.mjs +6 -6
- package/fesm2022/tectra-ng-ui-list-input.mjs +3 -3
- package/fesm2022/tectra-ng-ui-listbox.mjs +3 -3
- package/fesm2022/tectra-ng-ui-mention-textarea.mjs +3 -3
- package/fesm2022/tectra-ng-ui-menu.mjs +15 -15
- package/fesm2022/tectra-ng-ui-menubar.mjs +6 -6
- package/fesm2022/tectra-ng-ui-message.mjs +18 -18
- package/fesm2022/tectra-ng-ui-month-calendar.mjs +6 -6
- package/fesm2022/tectra-ng-ui-multiselect.mjs +3 -3
- package/fesm2022/tectra-ng-ui-overlay-badge.mjs +3 -3
- package/fesm2022/tectra-ng-ui-paginator.mjs +9 -9
- package/fesm2022/tectra-ng-ui-panel-menu.mjs +6 -6
- package/fesm2022/tectra-ng-ui-panel.mjs +3 -3
- package/fesm2022/tectra-ng-ui-password-generator.mjs +6 -6
- package/fesm2022/tectra-ng-ui-password.mjs +12 -12
- package/fesm2022/tectra-ng-ui-pill.mjs +3 -3
- package/fesm2022/tectra-ng-ui-popover.mjs +15 -15
- package/fesm2022/tectra-ng-ui-progress-bar.mjs +6 -6
- package/fesm2022/tectra-ng-ui-progress-spinner.mjs +3 -3
- package/fesm2022/tectra-ng-ui-radio-button.mjs +6 -6
- package/fesm2022/tectra-ng-ui-rating.mjs +9 -9
- package/fesm2022/tectra-ng-ui-scroll-panel.mjs +3 -3
- package/fesm2022/tectra-ng-ui-select-button.mjs +6 -6
- package/fesm2022/tectra-ng-ui-select.mjs +36 -36
- package/fesm2022/tectra-ng-ui-skeleton.mjs +6 -6
- package/fesm2022/tectra-ng-ui-slider.mjs +3 -3
- package/fesm2022/tectra-ng-ui-sparkline.mjs +3 -3
- package/fesm2022/tectra-ng-ui-speed-dial.mjs +3 -3
- package/fesm2022/tectra-ng-ui-split-button.mjs +3 -3
- package/fesm2022/tectra-ng-ui-splitter.mjs +6 -6
- package/fesm2022/tectra-ng-ui-stat-tiles.mjs +6 -6
- package/fesm2022/tectra-ng-ui-status-icon.mjs +3 -3
- package/fesm2022/tectra-ng-ui-stepper.mjs +41 -35
- package/fesm2022/tectra-ng-ui-stepper.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-table.mjs +54 -54
- package/fesm2022/tectra-ng-ui-tabs.mjs +18 -18
- package/fesm2022/tectra-ng-ui-tag.mjs +6 -6
- package/fesm2022/tectra-ng-ui-textarea.mjs +9 -9
- package/fesm2022/tectra-ng-ui-timeline.mjs +15 -15
- package/fesm2022/tectra-ng-ui-toast.mjs +9 -9
- package/fesm2022/tectra-ng-ui-toggle-button.mjs +3 -3
- package/fesm2022/tectra-ng-ui-toggle-switch.mjs +6 -6
- package/fesm2022/tectra-ng-ui-toolbar.mjs +12 -12
- package/fesm2022/tectra-ng-ui-tooltip.mjs +9 -9
- package/fesm2022/tectra-ng-ui-tree-select.mjs +3 -3
- package/fesm2022/tectra-ng-ui-tree-table.mjs +3 -3
- package/fesm2022/tectra-ng-ui-tree.mjs +30 -30
- package/fesm2022/tectra-ng-ui-truncate-text.mjs +3 -3
- package/fesm2022/tectra-ng-ui-virtual-scroller.mjs +15 -15
- package/fesm2022/tectra-ng-ui.mjs +1 -1
- package/input/README.md +1 -1
- package/package.json +4 -4
- package/types/tectra-ng-ui-datepicker.d.ts +2 -0
- package/types/tectra-ng-ui-datepicker.d.ts.map +1 -1
- package/types/tectra-ng-ui-input.d.ts +1 -1
- package/types/tectra-ng-ui-stepper.d.ts +1 -0
- package/types/tectra-ng-ui-stepper.d.ts.map +1 -1
- package/types/tectra-ng-ui.d.ts +1 -1
|
@@ -23,7 +23,7 @@ var TxDatePickerDate = class TxDatePickerDate {
|
|
|
23
23
|
}
|
|
24
24
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
25
25
|
minVersion: "12.0.0",
|
|
26
|
-
version: "22.2.
|
|
26
|
+
version: "22.2.6",
|
|
27
27
|
ngImport: i0,
|
|
28
28
|
type: TxDatePickerDate,
|
|
29
29
|
deps: [],
|
|
@@ -31,7 +31,7 @@ var TxDatePickerDate = class TxDatePickerDate {
|
|
|
31
31
|
});
|
|
32
32
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
33
33
|
minVersion: "14.0.0",
|
|
34
|
-
version: "22.2.
|
|
34
|
+
version: "22.2.6",
|
|
35
35
|
type: TxDatePickerDate,
|
|
36
36
|
isStandalone: true,
|
|
37
37
|
selector: "ng-template[txDatePickerDate]",
|
|
@@ -40,7 +40,7 @@ var TxDatePickerDate = class TxDatePickerDate {
|
|
|
40
40
|
};
|
|
41
41
|
i0.ɵɵngDeclareClassMetadata({
|
|
42
42
|
minVersion: "12.0.0",
|
|
43
|
-
version: "22.2.
|
|
43
|
+
version: "22.2.6",
|
|
44
44
|
ngImport: i0,
|
|
45
45
|
type: TxDatePickerDate,
|
|
46
46
|
decorators: [{
|
|
@@ -52,7 +52,7 @@ var TxDatePickerHeader = class TxDatePickerHeader {
|
|
|
52
52
|
templateRef = inject(TemplateRef);
|
|
53
53
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
54
54
|
minVersion: "12.0.0",
|
|
55
|
-
version: "22.2.
|
|
55
|
+
version: "22.2.6",
|
|
56
56
|
ngImport: i0,
|
|
57
57
|
type: TxDatePickerHeader,
|
|
58
58
|
deps: [],
|
|
@@ -60,7 +60,7 @@ var TxDatePickerHeader = class TxDatePickerHeader {
|
|
|
60
60
|
});
|
|
61
61
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
62
62
|
minVersion: "14.0.0",
|
|
63
|
-
version: "22.2.
|
|
63
|
+
version: "22.2.6",
|
|
64
64
|
type: TxDatePickerHeader,
|
|
65
65
|
isStandalone: true,
|
|
66
66
|
selector: "ng-template[txDatePickerHeader]",
|
|
@@ -69,7 +69,7 @@ var TxDatePickerHeader = class TxDatePickerHeader {
|
|
|
69
69
|
};
|
|
70
70
|
i0.ɵɵngDeclareClassMetadata({
|
|
71
71
|
minVersion: "12.0.0",
|
|
72
|
-
version: "22.2.
|
|
72
|
+
version: "22.2.6",
|
|
73
73
|
ngImport: i0,
|
|
74
74
|
type: TxDatePickerHeader,
|
|
75
75
|
decorators: [{
|
|
@@ -81,7 +81,7 @@ var TxDatePickerFooter = class TxDatePickerFooter {
|
|
|
81
81
|
templateRef = inject(TemplateRef);
|
|
82
82
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
83
83
|
minVersion: "12.0.0",
|
|
84
|
-
version: "22.2.
|
|
84
|
+
version: "22.2.6",
|
|
85
85
|
ngImport: i0,
|
|
86
86
|
type: TxDatePickerFooter,
|
|
87
87
|
deps: [],
|
|
@@ -89,7 +89,7 @@ var TxDatePickerFooter = class TxDatePickerFooter {
|
|
|
89
89
|
});
|
|
90
90
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
91
91
|
minVersion: "14.0.0",
|
|
92
|
-
version: "22.2.
|
|
92
|
+
version: "22.2.6",
|
|
93
93
|
type: TxDatePickerFooter,
|
|
94
94
|
isStandalone: true,
|
|
95
95
|
selector: "ng-template[txDatePickerFooter]",
|
|
@@ -98,7 +98,7 @@ var TxDatePickerFooter = class TxDatePickerFooter {
|
|
|
98
98
|
};
|
|
99
99
|
i0.ɵɵngDeclareClassMetadata({
|
|
100
100
|
minVersion: "12.0.0",
|
|
101
|
-
version: "22.2.
|
|
101
|
+
version: "22.2.6",
|
|
102
102
|
ngImport: i0,
|
|
103
103
|
type: TxDatePickerFooter,
|
|
104
104
|
decorators: [{
|
|
@@ -113,7 +113,7 @@ var TxDatePickerDecade = class TxDatePickerDecade {
|
|
|
113
113
|
}
|
|
114
114
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
115
115
|
minVersion: "12.0.0",
|
|
116
|
-
version: "22.2.
|
|
116
|
+
version: "22.2.6",
|
|
117
117
|
ngImport: i0,
|
|
118
118
|
type: TxDatePickerDecade,
|
|
119
119
|
deps: [],
|
|
@@ -121,7 +121,7 @@ var TxDatePickerDecade = class TxDatePickerDecade {
|
|
|
121
121
|
});
|
|
122
122
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
123
123
|
minVersion: "14.0.0",
|
|
124
|
-
version: "22.2.
|
|
124
|
+
version: "22.2.6",
|
|
125
125
|
type: TxDatePickerDecade,
|
|
126
126
|
isStandalone: true,
|
|
127
127
|
selector: "ng-template[txDatePickerDecade]",
|
|
@@ -130,7 +130,7 @@ var TxDatePickerDecade = class TxDatePickerDecade {
|
|
|
130
130
|
};
|
|
131
131
|
i0.ɵɵngDeclareClassMetadata({
|
|
132
132
|
minVersion: "12.0.0",
|
|
133
|
-
version: "22.2.
|
|
133
|
+
version: "22.2.6",
|
|
134
134
|
ngImport: i0,
|
|
135
135
|
type: TxDatePickerDecade,
|
|
136
136
|
decorators: [{
|
|
@@ -145,7 +145,7 @@ var TxDatePickerButtonBar = class TxDatePickerButtonBar {
|
|
|
145
145
|
}
|
|
146
146
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
147
147
|
minVersion: "12.0.0",
|
|
148
|
-
version: "22.2.
|
|
148
|
+
version: "22.2.6",
|
|
149
149
|
ngImport: i0,
|
|
150
150
|
type: TxDatePickerButtonBar,
|
|
151
151
|
deps: [],
|
|
@@ -153,7 +153,7 @@ var TxDatePickerButtonBar = class TxDatePickerButtonBar {
|
|
|
153
153
|
});
|
|
154
154
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
155
155
|
minVersion: "14.0.0",
|
|
156
|
-
version: "22.2.
|
|
156
|
+
version: "22.2.6",
|
|
157
157
|
type: TxDatePickerButtonBar,
|
|
158
158
|
isStandalone: true,
|
|
159
159
|
selector: "ng-template[txDatePickerButtonBar]",
|
|
@@ -162,7 +162,7 @@ var TxDatePickerButtonBar = class TxDatePickerButtonBar {
|
|
|
162
162
|
};
|
|
163
163
|
i0.ɵɵngDeclareClassMetadata({
|
|
164
164
|
minVersion: "12.0.0",
|
|
165
|
-
version: "22.2.
|
|
165
|
+
version: "22.2.6",
|
|
166
166
|
ngImport: i0,
|
|
167
167
|
type: TxDatePickerButtonBar,
|
|
168
168
|
decorators: [{
|
|
@@ -174,7 +174,7 @@ var TxDatePickerTriggerIcon = class TxDatePickerTriggerIcon {
|
|
|
174
174
|
templateRef = inject(TemplateRef);
|
|
175
175
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
176
176
|
minVersion: "12.0.0",
|
|
177
|
-
version: "22.2.
|
|
177
|
+
version: "22.2.6",
|
|
178
178
|
ngImport: i0,
|
|
179
179
|
type: TxDatePickerTriggerIcon,
|
|
180
180
|
deps: [],
|
|
@@ -182,7 +182,7 @@ var TxDatePickerTriggerIcon = class TxDatePickerTriggerIcon {
|
|
|
182
182
|
});
|
|
183
183
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
184
184
|
minVersion: "14.0.0",
|
|
185
|
-
version: "22.2.
|
|
185
|
+
version: "22.2.6",
|
|
186
186
|
type: TxDatePickerTriggerIcon,
|
|
187
187
|
isStandalone: true,
|
|
188
188
|
selector: "ng-template[txDatePickerTriggerIcon]",
|
|
@@ -191,7 +191,7 @@ var TxDatePickerTriggerIcon = class TxDatePickerTriggerIcon {
|
|
|
191
191
|
};
|
|
192
192
|
i0.ɵɵngDeclareClassMetadata({
|
|
193
193
|
minVersion: "12.0.0",
|
|
194
|
-
version: "22.2.
|
|
194
|
+
version: "22.2.6",
|
|
195
195
|
ngImport: i0,
|
|
196
196
|
type: TxDatePickerTriggerIcon,
|
|
197
197
|
decorators: [{
|
|
@@ -206,7 +206,7 @@ var TxDatePickerInputIcon = class TxDatePickerInputIcon {
|
|
|
206
206
|
}
|
|
207
207
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
208
208
|
minVersion: "12.0.0",
|
|
209
|
-
version: "22.2.
|
|
209
|
+
version: "22.2.6",
|
|
210
210
|
ngImport: i0,
|
|
211
211
|
type: TxDatePickerInputIcon,
|
|
212
212
|
deps: [],
|
|
@@ -214,7 +214,7 @@ var TxDatePickerInputIcon = class TxDatePickerInputIcon {
|
|
|
214
214
|
});
|
|
215
215
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
216
216
|
minVersion: "14.0.0",
|
|
217
|
-
version: "22.2.
|
|
217
|
+
version: "22.2.6",
|
|
218
218
|
type: TxDatePickerInputIcon,
|
|
219
219
|
isStandalone: true,
|
|
220
220
|
selector: "ng-template[txDatePickerInputIcon]",
|
|
@@ -223,7 +223,7 @@ var TxDatePickerInputIcon = class TxDatePickerInputIcon {
|
|
|
223
223
|
};
|
|
224
224
|
i0.ɵɵngDeclareClassMetadata({
|
|
225
225
|
minVersion: "12.0.0",
|
|
226
|
-
version: "22.2.
|
|
226
|
+
version: "22.2.6",
|
|
227
227
|
ngImport: i0,
|
|
228
228
|
type: TxDatePickerInputIcon,
|
|
229
229
|
decorators: [{
|
|
@@ -833,14 +833,27 @@ var TxDatePicker = class TxDatePicker extends TxFormControlBase {
|
|
|
833
833
|
super.writeValue(value);
|
|
834
834
|
this.draft.set(null);
|
|
835
835
|
this.pendingTime.set(null);
|
|
836
|
-
const
|
|
837
|
-
if (
|
|
836
|
+
const target = this.focusTarget() ?? this.defaultDate();
|
|
837
|
+
if (target) this.showMonthOf(target);
|
|
838
838
|
}
|
|
839
839
|
showMonthOf(date) {
|
|
840
|
-
this.
|
|
841
|
-
this.
|
|
840
|
+
const first = this.firstShownMonth(date);
|
|
841
|
+
this.viewMonth.set(first.getMonth());
|
|
842
|
+
this.viewYear.set(first.getFullYear());
|
|
842
843
|
this.focusedDate.set(startOfDay(date));
|
|
843
844
|
}
|
|
845
|
+
focusTarget() {
|
|
846
|
+
const set = this.dates().filter((date) => !!date);
|
|
847
|
+
return this.selectionMode() === "range" ? set.at(-1) : set[0];
|
|
848
|
+
}
|
|
849
|
+
firstShownMonth(date) {
|
|
850
|
+
const start = this.dates().find((value) => !!value);
|
|
851
|
+
const month = new Date(date.getFullYear(), date.getMonth(), 1);
|
|
852
|
+
if (this.selectionMode() !== "range" || !start) return month;
|
|
853
|
+
const back = new Date(date.getFullYear(), date.getMonth() - this.monthCount() + 1, 1);
|
|
854
|
+
const startMonth = new Date(start.getFullYear(), start.getMonth(), 1);
|
|
855
|
+
return startMonth > back ? startMonth : back;
|
|
856
|
+
}
|
|
844
857
|
open(focusPanel = false) {
|
|
845
858
|
if (this.inline() || this.isOpen() || !this.isEditable()) return;
|
|
846
859
|
this.focusPanelOnOpen = focusPanel;
|
|
@@ -1298,11 +1311,9 @@ var TxDatePicker = class TxDatePicker extends TxFormControlBase {
|
|
|
1298
1311
|
this.focusActive();
|
|
1299
1312
|
}
|
|
1300
1313
|
resetFocus() {
|
|
1301
|
-
const base = this.
|
|
1314
|
+
const base = this.focusTarget() ?? this.defaultDate() ?? /* @__PURE__ */ new Date();
|
|
1302
1315
|
this.currentView.set(this.view());
|
|
1303
|
-
this.
|
|
1304
|
-
this.viewYear.set(base.getFullYear());
|
|
1305
|
-
this.focusedDate.set(startOfDay(base));
|
|
1316
|
+
this.showMonthOf(base);
|
|
1306
1317
|
this.focusedMonth.set(base.getMonth());
|
|
1307
1318
|
this.focusedYear.set(base.getFullYear());
|
|
1308
1319
|
}
|
|
@@ -1418,7 +1429,7 @@ var TxDatePicker = class TxDatePicker extends TxFormControlBase {
|
|
|
1418
1429
|
}
|
|
1419
1430
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1420
1431
|
minVersion: "12.0.0",
|
|
1421
|
-
version: "22.2.
|
|
1432
|
+
version: "22.2.6",
|
|
1422
1433
|
ngImport: i0,
|
|
1423
1434
|
type: TxDatePicker,
|
|
1424
1435
|
deps: null,
|
|
@@ -1426,7 +1437,7 @@ var TxDatePicker = class TxDatePicker extends TxFormControlBase {
|
|
|
1426
1437
|
});
|
|
1427
1438
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1428
1439
|
minVersion: "17.0.0",
|
|
1429
|
-
version: "22.2.
|
|
1440
|
+
version: "22.2.6",
|
|
1430
1441
|
type: TxDatePicker,
|
|
1431
1442
|
isStandalone: true,
|
|
1432
1443
|
selector: "tx-datepicker",
|
|
@@ -1949,7 +1960,7 @@ var TxDatePicker = class TxDatePicker extends TxFormControlBase {
|
|
|
1949
1960
|
],
|
|
1950
1961
|
usesInheritance: true,
|
|
1951
1962
|
ngImport: i0,
|
|
1952
|
-
template: "@if (inline()) {\n <ng-container [ngTemplateOutlet]=\"panelTemplate\" />\n} @else {\n <div #field #origin=\"cdkOverlayOrigin\" cdkOverlayOrigin class=\"tx-datepicker__field\">\n <input\n #input\n txInput\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n aria-autocomplete=\"none\"\n aria-haspopup=\"dialog\"\n class=\"tx-datepicker__input\"\n [class]=\"passThrough().input?.class\"\n [style]=\"passThrough().input?.style\"\n [id]=\"resolvedInputId()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [fluid]=\"true\"\n [invalid]=\"isInvalid()\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly() || readonlyInput()\"\n [required]=\"required()\"\n [value]=\"inputText()\"\n [attr.inputmode]=\"readonlyInput() || touchUI() ? 'none' : null\"\n [attr.placeholder]=\"placeholder() ?? null\"\n [attr.name]=\"name() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"isOpen() ? panelId : null\"\n (focus)=\"onInputFocus($event)\"\n (blur)=\"onInputBlur($event)\"\n (click)=\"onInputClick()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onInputKeydown($event)\"\n />\n @if (canClear()) {\n <button\n type=\"button\"\n class=\"tx-datepicker__clear\"\n [class]=\"passThrough().clear?.class\"\n [style]=\"passThrough().clear?.style\"\n [attr.aria-label]=\"translations().clear\"\n (click)=\"onClearIcon()\"\n >\n <tx-icon name=\"times\" />\n </button>\n }\n @if (showIcon() && iconDisplay() === 'input') {\n <span\n class=\"tx-datepicker__input-icon\"\n aria-hidden=\"true\"\n [class]=\"passThrough().inputIcon?.class\"\n [style]=\"passThrough().inputIcon?.style\"\n (click)=\"toggle(false)\"\n >\n @if (inputIconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: toggle.bind(this, false) }\" />\n } @else {\n <tx-icon [name]=\"icon()\" />\n }\n </span>\n }\n @if (showIcon() && iconDisplay() === 'button') {\n <button\n type=\"button\"\n class=\"tx-datepicker__dropdown\"\n aria-haspopup=\"dialog\"\n tabindex=\"-1\"\n [class]=\"passThrough().dropdown?.class\"\n [style]=\"passThrough().dropdown?.style\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"iconAriaLabel() ?? translations().chooseDate\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"isOpen() ? panelId : null\"\n (click)=\"toggle(true)\"\n >\n @if (triggerIconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n } @else {\n <tx-icon [name]=\"icon()\" />\n }\n </button>\n }\n </div>\n\n <ng-template\n cdkConnectedOverlay\n txOverlayAnchor\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayOpen]=\"isPanelMounted() && !touchUI()\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayScrollStrategy]=\"scrollStrategy\"\n [cdkConnectedOverlayMinWidth]=\"panelMinWidth()\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n (attach)=\"onAttach()\"\n (positionChange)=\"onPositionChange($event)\"\n (overlayOutsideClick)=\"onOutsideClick($event)\"\n (detach)=\"close(false)\"\n >\n <ng-container [ngTemplateOutlet]=\"panelTemplate\" />\n </ng-template>\n}\n\n<ng-template #panelTemplate>\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- the panel only listens to keys and focus that bubble from its controls -->\n <div\n #panel\n class=\"tx-datepicker__panel\"\n [cdkTrapFocus]=\"!inline()\"\n [attr.id]=\"panelId\"\n [attr.role]=\"inline() ? 'group' : 'dialog'\"\n [attr.aria-modal]=\"inline() ? null : 'true'\"\n [attr.aria-label]=\"ariaLabel() ?? translations().chooseDate\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [attr.data-view]=\"currentView()\"\n [class.tx-datepicker__panel--inline]=\"inline()\"\n [class.tx-datepicker__panel--touch]=\"touchUI() && !inline()\"\n [class.tx-datepicker__panel--time-only]=\"timeOnly()\"\n [class.tx-datepicker__panel--disabled]=\"isDisabled()\"\n [class]=\"passThrough().panel?.class\"\n [style]=\"panelStyle()\"\n [style.min-width.px]=\"inline() ? null : panelMinWidth()\"\n (keydown)=\"onPanelKeydown($event)\"\n (focusout)=\"onPanelFocusOut($event)\"\n >\n @if (headerTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n }\n @if (!timeOnly()) {\n <div class=\"tx-datepicker__calendars\">\n @for (month of currentView() === 'date' ? months() : [months()[0]]; track month.year * 12 + month.month; let first = $first; let last = $last) {\n <div class=\"tx-datepicker__calendar\" [class]=\"passThrough().calendar?.class\" [style]=\"passThrough().calendar?.style\">\n <div class=\"tx-datepicker__header\" [class]=\"passThrough().header?.class\" [style]=\"passThrough().header?.style\">\n <button\n txButton\n type=\"button\"\n icon=\"chevron-left\"\n severity=\"secondary\"\n variant=\"text\"\n class=\"tx-datepicker__previous\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [class.tx-datepicker__nav--hidden]=\"!first\"\n [class]=\"passThrough().previous?.class\"\n [style]=\"passThrough().previous?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-hidden]=\"first ? null : 'true'\"\n [attr.tabindex]=\"first ? null : -1\"\n [attr.aria-label]=\"currentView() === 'year' ? translations().previousDecade : currentView() === 'month' ? translations().previousYear : translations().previousMonth\"\n (click)=\"previous()\"\n ></button>\n <div class=\"tx-datepicker__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\">\n @switch (currentView()) {\n @case ('date') {\n <button\n type=\"button\"\n class=\"tx-datepicker__select-month\"\n [class]=\"passThrough().selectMonth?.class\"\n [style]=\"passThrough().selectMonth?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-label]=\"translations().chooseMonth + ', ' + names().monthNames[month.month]\"\n (click)=\"showMonthView()\"\n >\n {{ names().monthNames[month.month] }}\n </button>\n <button\n type=\"button\"\n class=\"tx-datepicker__select-year\"\n [class]=\"passThrough().selectYear?.class\"\n [style]=\"passThrough().selectYear?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-label]=\"translations().chooseYear + ', ' + month.year\"\n (click)=\"showYearView()\"\n >\n {{ month.year }}\n </button>\n }\n @case ('month') {\n <button\n type=\"button\"\n class=\"tx-datepicker__select-year\"\n [class]=\"passThrough().selectYear?.class\"\n [style]=\"passThrough().selectYear?.style\"\n [disabled]=\"isDisabled() || view() === 'year'\"\n [attr.aria-label]=\"translations().chooseYear + ', ' + viewYear()\"\n (click)=\"showYearView()\"\n >\n {{ viewYear() }}\n </button>\n }\n @case ('year') {\n <span class=\"tx-datepicker__decade\">\n @if (decadeTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: decade() }\" />\n } @else {\n {{ decade()[0] }} – {{ decade()[9] }}\n }\n </span>\n }\n }\n </div>\n <button\n txButton\n type=\"button\"\n icon=\"chevron-right\"\n severity=\"secondary\"\n variant=\"text\"\n class=\"tx-datepicker__next\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [class.tx-datepicker__nav--hidden]=\"!last\"\n [class]=\"passThrough().next?.class\"\n [style]=\"passThrough().next?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-hidden]=\"last ? null : 'true'\"\n [attr.tabindex]=\"last ? null : -1\"\n [attr.aria-label]=\"currentView() === 'year' ? translations().nextDecade : currentView() === 'month' ? translations().nextYear : translations().nextMonth\"\n (click)=\"next()\"\n ></button>\n </div>\n\n @switch (currentView()) {\n @case ('date') {\n <table\n role=\"grid\"\n class=\"tx-datepicker__day-view\"\n (mouseleave)=\"onGridLeave()\"\n [attr.aria-label]=\"names().monthNames[month.month] + ' ' + month.year\"\n [class]=\"passThrough().table?.class\"\n [style]=\"passThrough().table?.style\"\n >\n <thead>\n <tr>\n @if (showWeek()) {\n <th scope=\"col\" class=\"tx-datepicker__weekday tx-datepicker__weekheader\" [class]=\"passThrough().weekday?.class\" [style]=\"passThrough().weekday?.style\">\n {{ translations().weekHeader }}\n </th>\n }\n @for (weekday of weekdays(); track weekday.long) {\n <th scope=\"col\" class=\"tx-datepicker__weekday\" [attr.abbr]=\"weekday.long\" [class]=\"passThrough().weekday?.class\" [style]=\"passThrough().weekday?.style\">\n {{ weekday.short }}\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (week of month.weeks; track week.number + '-' + $index) {\n <tr>\n @if (showWeek()) {\n <th scope=\"row\" class=\"tx-datepicker__week-number\" [class]=\"passThrough().weekNumber?.class\" [style]=\"passThrough().weekNumber?.style\">\n {{ week.number }}\n </th>\n }\n @for (day of week.days; track dayKey(day.date)) {\n @if (day.otherMonth && !showOtherMonths()) {\n <td role=\"gridcell\" class=\"tx-datepicker__day-cell tx-datepicker__day-cell--empty\"></td>\n } @else {\n <td\n role=\"gridcell\"\n class=\"tx-datepicker__day-cell\"\n [class.tx-datepicker__day-cell--today]=\"day.today\"\n [class.tx-datepicker__day-cell--other]=\"day.otherMonth\"\n [attr.data-date]=\"dayKey(day.date)\"\n [attr.data-active]=\"isFocusedDay(day) || null\"\n [attr.tabindex]=\"isFocusedDay(day) ? 0 : -1\"\n [attr.aria-label]=\"dayLabel(day.date)\"\n [attr.aria-selected]=\"isSelected(day.date) || isInRange(day.date)\"\n [attr.aria-disabled]=\"!day.selectable || (day.otherMonth && !selectOtherMonths()) || null\"\n [attr.aria-current]=\"day.today ? 'date' : null\"\n (click)=\"onDayClick(day)\"\n (mouseenter)=\"onDayEnter(day)\"\n (keydown)=\"onDayKeydown($event, day)\"\n >\n <span\n class=\"tx-datepicker__day\"\n [class.tx-datepicker__day--selected]=\"isSelected(day.date)\"\n [class.tx-datepicker__day--range]=\"isInRange(day.date)\"\n [class.tx-datepicker__day--preview]=\"isPreview(day.date)\"\n [class.tx-datepicker__day--disabled]=\"!day.selectable\"\n [class]=\"passThrough().day?.class\"\n [style]=\"passThrough().day?.style\"\n >\n @if (dateTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: day, selected: isSelected(day.date), inRange: isInRange(day.date) }\"\n />\n } @else {\n {{ day.day }}\n }\n </span>\n </td>\n }\n }\n </tr>\n }\n </tbody>\n </table>\n }\n @case ('month') {\n <div\n role=\"grid\"\n class=\"tx-datepicker__month-view\"\n [attr.aria-label]=\"translations().chooseMonth\"\n [class]=\"passThrough().monthView?.class\"\n [style]=\"passThrough().monthView?.style\"\n >\n @for (row of [0, 1, 2, 3]; track row) {\n <div role=\"row\" class=\"tx-datepicker__row\">\n @for (column of [0, 1, 2]; track column) {\n @let monthIndex = row * 3 + column;\n <span\n role=\"gridcell\"\n class=\"tx-datepicker__month\"\n [class.tx-datepicker__month--selected]=\"isMonthSelected(monthIndex)\"\n [class.tx-datepicker__month--disabled]=\"!monthSelectable(monthIndex)\"\n [class]=\"passThrough().month?.class\"\n [style]=\"passThrough().month?.style\"\n [attr.data-active]=\"focusedMonth() === monthIndex || null\"\n [attr.tabindex]=\"focusedMonth() === monthIndex ? 0 : -1\"\n [attr.aria-label]=\"names().monthNames[monthIndex] + ' ' + viewYear()\"\n [attr.aria-selected]=\"isMonthSelected(monthIndex)\"\n [attr.aria-disabled]=\"!monthSelectable(monthIndex) || null\"\n (click)=\"pickMonth(monthIndex)\"\n (keydown)=\"onMonthKeydown($event, monthIndex)\"\n >{{ names().monthNamesShort[monthIndex] }}</span\n >\n }\n </div>\n }\n </div>\n }\n @case ('year') {\n <div\n role=\"grid\"\n class=\"tx-datepicker__year-view\"\n [attr.aria-label]=\"translations().chooseYear\"\n [class]=\"passThrough().yearView?.class\"\n [style]=\"passThrough().yearView?.style\"\n >\n @for (row of [0, 1, 2, 3, 4]; track row) {\n <div role=\"row\" class=\"tx-datepicker__row\">\n @for (column of [0, 1]; track column) {\n @let year = decade()[row * 2 + column];\n <span\n role=\"gridcell\"\n class=\"tx-datepicker__year\"\n [class.tx-datepicker__year--selected]=\"isYearSelected(year)\"\n [class.tx-datepicker__year--disabled]=\"!yearSelectable(year)\"\n [class]=\"passThrough().year?.class\"\n [style]=\"passThrough().year?.style\"\n [attr.data-active]=\"focusedYear() === year || null\"\n [attr.tabindex]=\"focusedYear() === year ? 0 : -1\"\n [attr.aria-selected]=\"isYearSelected(year)\"\n [attr.aria-disabled]=\"!yearSelectable(year) || null\"\n (click)=\"pickYear(year)\"\n (keydown)=\"onYearKeydown($event, year)\"\n >{{ year }}</span\n >\n }\n </div>\n }\n </div>\n }\n }\n </div>\n }\n </div>\n }\n\n @if (hasTime() && currentView() === 'date') {\n <div class=\"tx-datepicker__time\" [class]=\"passThrough().timePicker?.class\" [style]=\"passThrough().timePicker?.style\">\n <ng-container [ngTemplateOutlet]=\"spinner\" [ngTemplateOutletContext]=\"{ unit: 'hour', value: hours() }\" />\n <span class=\"tx-datepicker__time-separator\" aria-hidden=\"true\">{{ timeSeparator() }}</span>\n <ng-container [ngTemplateOutlet]=\"spinner\" [ngTemplateOutletContext]=\"{ unit: 'minute', value: minutes() }\" />\n @if (showSeconds()) {\n <span class=\"tx-datepicker__time-separator\" aria-hidden=\"true\">{{ timeSeparator() }}</span>\n <ng-container [ngTemplateOutlet]=\"spinner\" [ngTemplateOutletContext]=\"{ unit: 'second', value: seconds() }\" />\n }\n @if (hourFormat() === '12') {\n <div class=\"tx-datepicker__time-unit\">\n <button\n txButton\n type=\"button\"\n icon=\"chevron-up\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"translations().toggleAmPm\"\n (click)=\"toggleMeridiem()\"\n ></button>\n <span class=\"tx-datepicker__time-value\">{{ isPm() ? translations().pm : translations().am }}</span>\n <button\n txButton\n type=\"button\"\n icon=\"chevron-down\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"translations().toggleAmPm\"\n (click)=\"toggleMeridiem()\"\n ></button>\n </div>\n }\n </div>\n }\n\n @if (showButtonBar()) {\n <div class=\"tx-datepicker__buttonbar\" [class]=\"passThrough().buttonbar?.class\" [style]=\"passThrough().buttonbar?.style\">\n @if (buttonBarTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ today: selectToday.bind(this), clear: onClearButton.bind(this) }\" />\n } @else {\n <button\n txButton\n type=\"button\"\n size=\"small\"\n severity=\"secondary\"\n variant=\"text\"\n [unstyled]=\"isUnstyled()\"\n [label]=\"translations().today\"\n [disabled]=\"!isEditable()\"\n (click)=\"selectToday()\"\n ></button>\n <button\n txButton\n type=\"button\"\n size=\"small\"\n severity=\"secondary\"\n variant=\"text\"\n [unstyled]=\"isUnstyled()\"\n [label]=\"translations().clear\"\n [disabled]=\"!isEditable()\"\n (click)=\"onClearButton()\"\n ></button>\n }\n </div>\n }\n @if (footerTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n }\n </div>\n</ng-template>\n\n<ng-template #spinner let-unit=\"unit\" let-value=\"value\">\n <div class=\"tx-datepicker__time-unit\" role=\"group\" [attr.aria-label]=\"unit === 'hour' ? translations().hour : unit === 'minute' ? translations().minute : translations().second\">\n <button\n txButton\n type=\"button\"\n icon=\"chevron-up\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"unit === 'hour' ? translations().nextHour : unit === 'minute' ? translations().nextMinute : translations().nextSecond\"\n (pointerdown)=\"startRepeat($event, unit, 1)\"\n (pointerup)=\"stopRepeat()\"\n (pointerleave)=\"stopRepeat()\"\n (pointercancel)=\"stopRepeat()\"\n (keydown)=\"onTimeKeydown($event, unit, 1)\"\n ></button>\n <span class=\"tx-datepicker__time-value\" aria-live=\"polite\">{{ formatPart(value) }}</span>\n <button\n txButton\n type=\"button\"\n icon=\"chevron-down\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"unit === 'hour' ? translations().previousHour : unit === 'minute' ? translations().previousMinute : translations().previousSecond\"\n (pointerdown)=\"startRepeat($event, unit, -1)\"\n (pointerup)=\"stopRepeat()\"\n (pointerleave)=\"stopRepeat()\"\n (pointercancel)=\"stopRepeat()\"\n (keydown)=\"onTimeKeydown($event, unit, -1)\"\n ></button>\n </div>\n</ng-template>\n",
|
|
1963
|
+
template: "@if (inline()) {\n <ng-container [ngTemplateOutlet]=\"panelTemplate\" />\n} @else {\n <div #field #origin=\"cdkOverlayOrigin\" cdkOverlayOrigin class=\"tx-datepicker__field\">\n <input\n #input\n txInput\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n aria-autocomplete=\"none\"\n aria-haspopup=\"dialog\"\n class=\"tx-datepicker__input\"\n [class]=\"passThrough().input?.class\"\n [style]=\"passThrough().input?.style\"\n [id]=\"resolvedInputId()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [fluid]=\"true\"\n [invalid]=\"isInvalid()\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly() || readonlyInput()\"\n [attr.data-picker]=\"readonlyInput() && !readonly() ? '' : null\"\n [required]=\"required()\"\n [value]=\"inputText()\"\n [attr.inputmode]=\"readonlyInput() || touchUI() ? 'none' : null\"\n [attr.placeholder]=\"placeholder() ?? null\"\n [attr.name]=\"name() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"isOpen() ? panelId : null\"\n (focus)=\"onInputFocus($event)\"\n (blur)=\"onInputBlur($event)\"\n (click)=\"onInputClick()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onInputKeydown($event)\"\n />\n @if (canClear()) {\n <button\n type=\"button\"\n class=\"tx-datepicker__clear\"\n [class]=\"passThrough().clear?.class\"\n [style]=\"passThrough().clear?.style\"\n [attr.aria-label]=\"translations().clear\"\n (click)=\"onClearIcon()\"\n >\n <tx-icon name=\"times\" />\n </button>\n }\n @if (showIcon() && iconDisplay() === 'input') {\n <span\n class=\"tx-datepicker__input-icon\"\n aria-hidden=\"true\"\n [class]=\"passThrough().inputIcon?.class\"\n [style]=\"passThrough().inputIcon?.style\"\n (click)=\"toggle(false)\"\n >\n @if (inputIconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: toggle.bind(this, false) }\" />\n } @else {\n <tx-icon [name]=\"icon()\" />\n }\n </span>\n }\n @if (showIcon() && iconDisplay() === 'button') {\n <button\n type=\"button\"\n class=\"tx-datepicker__dropdown\"\n aria-haspopup=\"dialog\"\n tabindex=\"-1\"\n [class]=\"passThrough().dropdown?.class\"\n [style]=\"passThrough().dropdown?.style\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"iconAriaLabel() ?? translations().chooseDate\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"isOpen() ? panelId : null\"\n (click)=\"toggle(true)\"\n >\n @if (triggerIconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n } @else {\n <tx-icon [name]=\"icon()\" />\n }\n </button>\n }\n </div>\n\n <ng-template\n cdkConnectedOverlay\n txOverlayAnchor\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayOpen]=\"isPanelMounted() && !touchUI()\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayScrollStrategy]=\"scrollStrategy\"\n [cdkConnectedOverlayMinWidth]=\"panelMinWidth()\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n (attach)=\"onAttach()\"\n (positionChange)=\"onPositionChange($event)\"\n (overlayOutsideClick)=\"onOutsideClick($event)\"\n (detach)=\"close(false)\"\n >\n <ng-container [ngTemplateOutlet]=\"panelTemplate\" />\n </ng-template>\n}\n\n<ng-template #panelTemplate>\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- the panel only listens to keys and focus that bubble from its controls -->\n <div\n #panel\n class=\"tx-datepicker__panel\"\n [cdkTrapFocus]=\"!inline()\"\n [attr.id]=\"panelId\"\n [attr.role]=\"inline() ? 'group' : 'dialog'\"\n [attr.aria-modal]=\"inline() ? null : 'true'\"\n [attr.aria-label]=\"ariaLabel() ?? translations().chooseDate\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [attr.data-view]=\"currentView()\"\n [class.tx-datepicker__panel--inline]=\"inline()\"\n [class.tx-datepicker__panel--touch]=\"touchUI() && !inline()\"\n [class.tx-datepicker__panel--time-only]=\"timeOnly()\"\n [class.tx-datepicker__panel--disabled]=\"isDisabled()\"\n [class]=\"passThrough().panel?.class\"\n [style]=\"panelStyle()\"\n [style.min-width.px]=\"inline() ? null : panelMinWidth()\"\n (keydown)=\"onPanelKeydown($event)\"\n (focusout)=\"onPanelFocusOut($event)\"\n >\n @if (headerTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n }\n @if (!timeOnly()) {\n <div class=\"tx-datepicker__calendars\">\n @for (month of currentView() === 'date' ? months() : [months()[0]]; track month.year * 12 + month.month; let first = $first; let last = $last) {\n <div class=\"tx-datepicker__calendar\" [class]=\"passThrough().calendar?.class\" [style]=\"passThrough().calendar?.style\">\n <div class=\"tx-datepicker__header\" [class]=\"passThrough().header?.class\" [style]=\"passThrough().header?.style\">\n <button\n txButton\n type=\"button\"\n icon=\"chevron-left\"\n severity=\"secondary\"\n variant=\"text\"\n class=\"tx-datepicker__previous\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [class.tx-datepicker__nav--hidden]=\"!first\"\n [class]=\"passThrough().previous?.class\"\n [style]=\"passThrough().previous?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-hidden]=\"first ? null : 'true'\"\n [attr.tabindex]=\"first ? null : -1\"\n [attr.aria-label]=\"currentView() === 'year' ? translations().previousDecade : currentView() === 'month' ? translations().previousYear : translations().previousMonth\"\n (click)=\"previous()\"\n ></button>\n <div class=\"tx-datepicker__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\">\n @switch (currentView()) {\n @case ('date') {\n <button\n type=\"button\"\n class=\"tx-datepicker__select-month\"\n [class]=\"passThrough().selectMonth?.class\"\n [style]=\"passThrough().selectMonth?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-label]=\"translations().chooseMonth + ', ' + names().monthNames[month.month]\"\n (click)=\"showMonthView()\"\n >\n {{ names().monthNames[month.month] }}\n </button>\n <button\n type=\"button\"\n class=\"tx-datepicker__select-year\"\n [class]=\"passThrough().selectYear?.class\"\n [style]=\"passThrough().selectYear?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-label]=\"translations().chooseYear + ', ' + month.year\"\n (click)=\"showYearView()\"\n >\n {{ month.year }}\n </button>\n }\n @case ('month') {\n <button\n type=\"button\"\n class=\"tx-datepicker__select-year\"\n [class]=\"passThrough().selectYear?.class\"\n [style]=\"passThrough().selectYear?.style\"\n [disabled]=\"isDisabled() || view() === 'year'\"\n [attr.aria-label]=\"translations().chooseYear + ', ' + viewYear()\"\n (click)=\"showYearView()\"\n >\n {{ viewYear() }}\n </button>\n }\n @case ('year') {\n <span class=\"tx-datepicker__decade\">\n @if (decadeTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: decade() }\" />\n } @else {\n {{ decade()[0] }} – {{ decade()[9] }}\n }\n </span>\n }\n }\n </div>\n <button\n txButton\n type=\"button\"\n icon=\"chevron-right\"\n severity=\"secondary\"\n variant=\"text\"\n class=\"tx-datepicker__next\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [class.tx-datepicker__nav--hidden]=\"!last\"\n [class]=\"passThrough().next?.class\"\n [style]=\"passThrough().next?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-hidden]=\"last ? null : 'true'\"\n [attr.tabindex]=\"last ? null : -1\"\n [attr.aria-label]=\"currentView() === 'year' ? translations().nextDecade : currentView() === 'month' ? translations().nextYear : translations().nextMonth\"\n (click)=\"next()\"\n ></button>\n </div>\n\n @switch (currentView()) {\n @case ('date') {\n <table\n role=\"grid\"\n class=\"tx-datepicker__day-view\"\n (mouseleave)=\"onGridLeave()\"\n [attr.aria-label]=\"names().monthNames[month.month] + ' ' + month.year\"\n [class]=\"passThrough().table?.class\"\n [style]=\"passThrough().table?.style\"\n >\n <thead>\n <tr>\n @if (showWeek()) {\n <th scope=\"col\" class=\"tx-datepicker__weekday tx-datepicker__weekheader\" [class]=\"passThrough().weekday?.class\" [style]=\"passThrough().weekday?.style\">\n {{ translations().weekHeader }}\n </th>\n }\n @for (weekday of weekdays(); track weekday.long) {\n <th scope=\"col\" class=\"tx-datepicker__weekday\" [attr.abbr]=\"weekday.long\" [class]=\"passThrough().weekday?.class\" [style]=\"passThrough().weekday?.style\">\n {{ weekday.short }}\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (week of month.weeks; track week.number + '-' + $index) {\n <tr>\n @if (showWeek()) {\n <th scope=\"row\" class=\"tx-datepicker__week-number\" [class]=\"passThrough().weekNumber?.class\" [style]=\"passThrough().weekNumber?.style\">\n {{ week.number }}\n </th>\n }\n @for (day of week.days; track dayKey(day.date)) {\n @if (day.otherMonth && !showOtherMonths()) {\n <td role=\"gridcell\" class=\"tx-datepicker__day-cell tx-datepicker__day-cell--empty\"></td>\n } @else {\n <td\n role=\"gridcell\"\n class=\"tx-datepicker__day-cell\"\n [class.tx-datepicker__day-cell--today]=\"day.today\"\n [class.tx-datepicker__day-cell--other]=\"day.otherMonth\"\n [attr.data-date]=\"dayKey(day.date)\"\n [attr.data-active]=\"isFocusedDay(day) || null\"\n [attr.tabindex]=\"isFocusedDay(day) ? 0 : -1\"\n [attr.aria-label]=\"dayLabel(day.date)\"\n [attr.aria-selected]=\"isSelected(day.date) || isInRange(day.date)\"\n [attr.aria-disabled]=\"!day.selectable || (day.otherMonth && !selectOtherMonths()) || null\"\n [attr.aria-current]=\"day.today ? 'date' : null\"\n (click)=\"onDayClick(day)\"\n (mouseenter)=\"onDayEnter(day)\"\n (keydown)=\"onDayKeydown($event, day)\"\n >\n <span\n class=\"tx-datepicker__day\"\n [class.tx-datepicker__day--selected]=\"isSelected(day.date)\"\n [class.tx-datepicker__day--range]=\"isInRange(day.date)\"\n [class.tx-datepicker__day--preview]=\"isPreview(day.date)\"\n [class.tx-datepicker__day--disabled]=\"!day.selectable\"\n [class]=\"passThrough().day?.class\"\n [style]=\"passThrough().day?.style\"\n >\n @if (dateTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: day, selected: isSelected(day.date), inRange: isInRange(day.date) }\"\n />\n } @else {\n {{ day.day }}\n }\n </span>\n </td>\n }\n }\n </tr>\n }\n </tbody>\n </table>\n }\n @case ('month') {\n <div\n role=\"grid\"\n class=\"tx-datepicker__month-view\"\n [attr.aria-label]=\"translations().chooseMonth\"\n [class]=\"passThrough().monthView?.class\"\n [style]=\"passThrough().monthView?.style\"\n >\n @for (row of [0, 1, 2, 3]; track row) {\n <div role=\"row\" class=\"tx-datepicker__row\">\n @for (column of [0, 1, 2]; track column) {\n @let monthIndex = row * 3 + column;\n <span\n role=\"gridcell\"\n class=\"tx-datepicker__month\"\n [class.tx-datepicker__month--selected]=\"isMonthSelected(monthIndex)\"\n [class.tx-datepicker__month--disabled]=\"!monthSelectable(monthIndex)\"\n [class]=\"passThrough().month?.class\"\n [style]=\"passThrough().month?.style\"\n [attr.data-active]=\"focusedMonth() === monthIndex || null\"\n [attr.tabindex]=\"focusedMonth() === monthIndex ? 0 : -1\"\n [attr.aria-label]=\"names().monthNames[monthIndex] + ' ' + viewYear()\"\n [attr.aria-selected]=\"isMonthSelected(monthIndex)\"\n [attr.aria-disabled]=\"!monthSelectable(monthIndex) || null\"\n (click)=\"pickMonth(monthIndex)\"\n (keydown)=\"onMonthKeydown($event, monthIndex)\"\n >{{ names().monthNamesShort[monthIndex] }}</span\n >\n }\n </div>\n }\n </div>\n }\n @case ('year') {\n <div\n role=\"grid\"\n class=\"tx-datepicker__year-view\"\n [attr.aria-label]=\"translations().chooseYear\"\n [class]=\"passThrough().yearView?.class\"\n [style]=\"passThrough().yearView?.style\"\n >\n @for (row of [0, 1, 2, 3, 4]; track row) {\n <div role=\"row\" class=\"tx-datepicker__row\">\n @for (column of [0, 1]; track column) {\n @let year = decade()[row * 2 + column];\n <span\n role=\"gridcell\"\n class=\"tx-datepicker__year\"\n [class.tx-datepicker__year--selected]=\"isYearSelected(year)\"\n [class.tx-datepicker__year--disabled]=\"!yearSelectable(year)\"\n [class]=\"passThrough().year?.class\"\n [style]=\"passThrough().year?.style\"\n [attr.data-active]=\"focusedYear() === year || null\"\n [attr.tabindex]=\"focusedYear() === year ? 0 : -1\"\n [attr.aria-selected]=\"isYearSelected(year)\"\n [attr.aria-disabled]=\"!yearSelectable(year) || null\"\n (click)=\"pickYear(year)\"\n (keydown)=\"onYearKeydown($event, year)\"\n >{{ year }}</span\n >\n }\n </div>\n }\n </div>\n }\n }\n </div>\n }\n </div>\n }\n\n @if (hasTime() && currentView() === 'date') {\n <div class=\"tx-datepicker__time\" [class]=\"passThrough().timePicker?.class\" [style]=\"passThrough().timePicker?.style\">\n <ng-container [ngTemplateOutlet]=\"spinner\" [ngTemplateOutletContext]=\"{ unit: 'hour', value: hours() }\" />\n <span class=\"tx-datepicker__time-separator\" aria-hidden=\"true\">{{ timeSeparator() }}</span>\n <ng-container [ngTemplateOutlet]=\"spinner\" [ngTemplateOutletContext]=\"{ unit: 'minute', value: minutes() }\" />\n @if (showSeconds()) {\n <span class=\"tx-datepicker__time-separator\" aria-hidden=\"true\">{{ timeSeparator() }}</span>\n <ng-container [ngTemplateOutlet]=\"spinner\" [ngTemplateOutletContext]=\"{ unit: 'second', value: seconds() }\" />\n }\n @if (hourFormat() === '12') {\n <div class=\"tx-datepicker__time-unit\">\n <button\n txButton\n type=\"button\"\n icon=\"chevron-up\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"translations().toggleAmPm\"\n (click)=\"toggleMeridiem()\"\n ></button>\n <span class=\"tx-datepicker__time-value\">{{ isPm() ? translations().pm : translations().am }}</span>\n <button\n txButton\n type=\"button\"\n icon=\"chevron-down\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"translations().toggleAmPm\"\n (click)=\"toggleMeridiem()\"\n ></button>\n </div>\n }\n </div>\n }\n\n @if (showButtonBar()) {\n <div class=\"tx-datepicker__buttonbar\" [class]=\"passThrough().buttonbar?.class\" [style]=\"passThrough().buttonbar?.style\">\n @if (buttonBarTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ today: selectToday.bind(this), clear: onClearButton.bind(this) }\" />\n } @else {\n <button\n txButton\n type=\"button\"\n size=\"small\"\n severity=\"secondary\"\n variant=\"text\"\n [unstyled]=\"isUnstyled()\"\n [label]=\"translations().today\"\n [disabled]=\"!isEditable()\"\n (click)=\"selectToday()\"\n ></button>\n <button\n txButton\n type=\"button\"\n size=\"small\"\n severity=\"secondary\"\n variant=\"text\"\n [unstyled]=\"isUnstyled()\"\n [label]=\"translations().clear\"\n [disabled]=\"!isEditable()\"\n (click)=\"onClearButton()\"\n ></button>\n }\n </div>\n }\n @if (footerTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n }\n </div>\n</ng-template>\n\n<ng-template #spinner let-unit=\"unit\" let-value=\"value\">\n <div class=\"tx-datepicker__time-unit\" role=\"group\" [attr.aria-label]=\"unit === 'hour' ? translations().hour : unit === 'minute' ? translations().minute : translations().second\">\n <button\n txButton\n type=\"button\"\n icon=\"chevron-up\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"unit === 'hour' ? translations().nextHour : unit === 'minute' ? translations().nextMinute : translations().nextSecond\"\n (pointerdown)=\"startRepeat($event, unit, 1)\"\n (pointerup)=\"stopRepeat()\"\n (pointerleave)=\"stopRepeat()\"\n (pointercancel)=\"stopRepeat()\"\n (keydown)=\"onTimeKeydown($event, unit, 1)\"\n ></button>\n <span class=\"tx-datepicker__time-value\" aria-live=\"polite\">{{ formatPart(value) }}</span>\n <button\n txButton\n type=\"button\"\n icon=\"chevron-down\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"unit === 'hour' ? translations().previousHour : unit === 'minute' ? translations().previousMinute : translations().previousSecond\"\n (pointerdown)=\"startRepeat($event, unit, -1)\"\n (pointerup)=\"stopRepeat()\"\n (pointerleave)=\"stopRepeat()\"\n (pointercancel)=\"stopRepeat()\"\n (keydown)=\"onTimeKeydown($event, unit, -1)\"\n ></button>\n </div>\n</ng-template>\n",
|
|
1953
1964
|
styles: [":host{display:inline-flex;max-width:100%;vertical-align:top}:host(.tx-datepicker--fluid){display:flex;width:100%}:host(.tx-datepicker--inline){display:inline-block}.tx-datepicker__field{position:relative;display:flex;flex:1 1 auto;align-items:stretch;min-width:0}.tx-datepicker__input{flex:1 1 auto;width:1%;min-width:0}.tx-datepicker__clear,.tx-datepicker__input-icon{position:absolute;top:50%;transform:translateY(-50%)}.tx-datepicker__dropdown{display:inline-flex;flex:none;align-items:center;justify-content:center;cursor:pointer}.tx-datepicker__nav--hidden{visibility:hidden}:host([data-styled]){--_icon-room: 0px;--_clear-room: 0px}:host([data-styled]) .tx-datepicker__input{--tx-field-inset-end: calc(var(--_icon-room) + var(--_clear-room))}:host([data-styled]) .tx-datepicker__clear{display:grid;place-items:center;width:24px;height:24px;padding:0;border:none;border-radius:var(--tx-radius-sm);background:transparent;color:var(--tx-form-field-icon-color);font-size:var(--tx-form-field-font-size);cursor:pointer;pointer-events:auto;transition:background-color var(--tx-form-field-transition-duration),color var(--tx-form-field-transition-duration)}:host([data-styled]) .tx-datepicker__clear:hover{background:var(--tx-surface-hover);color:var(--tx-form-field-color)}:host([data-styled]) .tx-datepicker__clear:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:1px}:host([data-styled]) .tx-datepicker__clear{right:calc(var(--_icon-room) + var(--_button-room, 0px) + 8px)}:host([data-styled]) .tx-datepicker__input-icon{right:var(--tx-form-field-padding-x);display:inline-flex;color:var(--tx-date-picker-input-icon-color);font-size:var(--tx-form-field-font-size);line-height:1;cursor:pointer}:host([data-styled]) .tx-datepicker__dropdown{box-sizing:border-box;width:var(--tx-date-picker-dropdown-width);padding:0;border:1px solid var(--tx-date-picker-dropdown-border-color);border-inline-start:0 none;border-start-end-radius:var(--tx-date-picker-dropdown-border-radius);border-end-end-radius:var(--tx-date-picker-dropdown-border-radius);outline-color:transparent;background:var(--tx-date-picker-dropdown-background);color:var(--tx-date-picker-dropdown-color);font-size:var(--tx-form-field-font-size);transition:background-color var(--tx-date-picker-transition-duration),color var(--tx-date-picker-transition-duration),border-color var(--tx-date-picker-transition-duration),outline-color var(--tx-date-picker-transition-duration)}:host([data-styled]) .tx-datepicker__dropdown:not(:disabled):hover{border-color:var(--tx-date-picker-dropdown-hover-border-color);background:var(--tx-date-picker-dropdown-hover-background);color:var(--tx-date-picker-dropdown-hover-color)}:host([data-styled]) .tx-datepicker__dropdown:not(:disabled):active{border-color:var(--tx-date-picker-dropdown-active-border-color);background:var(--tx-date-picker-dropdown-active-background);color:var(--tx-date-picker-dropdown-active-color)}:host([data-styled]) .tx-datepicker__dropdown:focus-visible{outline:var(--tx-date-picker-dropdown-focus-ring-width) var(--tx-date-picker-dropdown-focus-ring-style) var(--tx-date-picker-dropdown-focus-ring-color);outline-offset:var(--tx-date-picker-dropdown-focus-ring-offset);box-shadow:var(--tx-date-picker-dropdown-focus-ring-shadow)}:host([data-styled]) .tx-datepicker__dropdown:disabled{cursor:not-allowed;opacity:.6}:host([data-styled].tx-datepicker--invalid) .tx-datepicker__dropdown,:host([data-styled].tx-datepicker--invalid) .tx-datepicker__dropdown:not(:disabled):hover,:host([data-styled].tx-datepicker--invalid) .tx-datepicker__dropdown:not(:disabled):active{border-color:var(--tx-date-picker-dropdown-invalid-border-color)}:host([data-styled]:has(.tx-datepicker__input-icon)){--_icon-room: calc(var(--tx-form-field-padding-x) + 1em)}:host([data-styled]:has(.tx-datepicker__clear)){--_clear-room: 28px}:host([data-styled].tx-datepicker--button){--_button-room: var(--tx-date-picker-dropdown-width)}:host([data-styled].tx-datepicker--button[data-size=small]){--_button-room: var(--tx-date-picker-dropdown-sm-width)}:host([data-styled].tx-datepicker--button[data-size=large]){--_button-room: var(--tx-date-picker-dropdown-lg-width)}:host([data-styled].tx-datepicker--button) .tx-datepicker__input{border-start-end-radius:0;border-end-end-radius:0}:host([data-styled][data-size=small]) .tx-datepicker__dropdown{width:var(--tx-date-picker-dropdown-sm-width);font-size:var(--tx-form-field-sm-font-size)}:host([data-styled][data-size=large]) .tx-datepicker__dropdown{width:var(--tx-date-picker-dropdown-lg-width);font-size:var(--tx-form-field-lg-font-size)}.tx-datepicker__panel{box-sizing:border-box}.tx-datepicker__calendars{display:flex}.tx-datepicker__header,.tx-datepicker__title,.tx-datepicker__time,.tx-datepicker__buttonbar{display:flex;align-items:center}.tx-datepicker__header,.tx-datepicker__buttonbar{justify-content:space-between}.tx-datepicker__time{justify-content:center}.tx-datepicker__time-unit{display:flex;flex-direction:column;align-items:center}.tx-datepicker__day-view{width:100%;border-collapse:collapse}.tx-datepicker__day-cell{cursor:pointer}.tx-datepicker__day-cell[aria-disabled=true]{cursor:default}.tx-datepicker__day{display:flex;align-items:center;justify-content:center;margin:0 auto}.tx-datepicker__row{display:flex}.tx-datepicker__month,.tx-datepicker__year{display:inline-flex;align-items:center;justify-content:center;cursor:pointer}.tx-datepicker__month{width:33.3%}.tx-datepicker__year{width:50%}.tx-datepicker__month--disabled,.tx-datepicker__year--disabled{cursor:default}.tx-datepicker__panel[data-styled]{padding:var(--tx-date-picker-panel-padding);border:1px solid var(--tx-date-picker-panel-border-color);border-radius:var(--tx-date-picker-panel-border-radius);background:var(--tx-date-picker-panel-background);box-shadow:var(--tx-date-picker-panel-shadow);color:var(--tx-date-picker-panel-color);font-family:var(--tx-font-family)}.tx-datepicker__panel[data-styled].tx-datepicker__panel--inline{display:inline-block;overflow-x:auto;box-shadow:none}.tx-datepicker__panel[data-styled].tx-datepicker__panel--touch{width:var(--tx-date-picker-touch-width);max-height:92vh;overflow:auto}.tx-datepicker__panel[data-styled].tx-datepicker__panel--disabled{opacity:.6}.tx-datepicker__panel[data-styled] .tx-datepicker__calendar{flex:1 1 auto;padding-inline:var(--tx-date-picker-group-gap);border-inline-start:1px solid var(--tx-date-picker-group-border-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__calendar:first-child{padding-inline-start:0;border-inline-start:0 none}.tx-datepicker__panel[data-styled] .tx-datepicker__calendar:last-child{padding-inline-end:0}.tx-datepicker__panel[data-styled] .tx-datepicker__header{padding:var(--tx-date-picker-header-padding);border-bottom:1px solid var(--tx-date-picker-header-border-color);background:var(--tx-date-picker-header-background);color:var(--tx-date-picker-header-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__title{gap:var(--tx-date-picker-title-gap);font-size:var(--tx-date-picker-title-font-size);font-weight:var(--tx-date-picker-title-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month,.tx-datepicker__panel[data-styled] .tx-datepicker__select-year{margin:0;border:none;outline-color:transparent;background:transparent;font-family:inherit;cursor:pointer;transition:background-color var(--tx-date-picker-transition-duration),color var(--tx-date-picker-transition-duration),outline-color var(--tx-date-picker-transition-duration)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month:focus-visible,.tx-datepicker__panel[data-styled] .tx-datepicker__select-year:focus-visible{outline:var(--tx-date-picker-date-focus-ring-width) var(--tx-date-picker-date-focus-ring-style) var(--tx-date-picker-date-focus-ring-color);outline-offset:var(--tx-date-picker-date-focus-ring-offset)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month:disabled,.tx-datepicker__panel[data-styled] .tx-datepicker__select-year:disabled{cursor:default}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month{padding:var(--tx-date-picker-select-month-padding);border-radius:var(--tx-date-picker-select-month-border-radius);color:var(--tx-date-picker-select-month-color);font-size:var(--tx-date-picker-select-month-font-size);font-weight:var(--tx-date-picker-select-month-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month:enabled:hover{background:var(--tx-date-picker-select-month-hover-background);color:var(--tx-date-picker-select-month-hover-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-year{padding:var(--tx-date-picker-select-year-padding);border-radius:var(--tx-date-picker-select-year-border-radius);color:var(--tx-date-picker-select-year-color);font-size:var(--tx-date-picker-select-year-font-size);font-weight:var(--tx-date-picker-select-year-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-year:enabled:hover{background:var(--tx-date-picker-select-year-hover-background);color:var(--tx-date-picker-select-year-hover-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__decade{padding:var(--tx-date-picker-select-year-padding)}.tx-datepicker__panel[data-styled] .tx-datepicker__day-view{margin:var(--tx-date-picker-day-view-margin);font-size:var(--tx-date-picker-date-font-size)}.tx-datepicker__panel[data-styled] .tx-datepicker__weekday{padding:var(--tx-date-picker-week-day-padding);color:var(--tx-date-picker-week-day-color);font-size:var(--tx-date-picker-week-day-font-size);font-weight:var(--tx-date-picker-week-day-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__week-number{padding:var(--tx-date-picker-date-padding);color:var(--tx-date-picker-week-number-color);font-size:var(--tx-date-picker-week-number-font-size);font-weight:var(--tx-date-picker-date-font-weight);text-align:center}.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell{padding:var(--tx-date-picker-date-padding);outline:none}.tx-datepicker__panel[data-styled] .tx-datepicker__day{box-sizing:border-box;width:var(--tx-date-picker-date-width);height:var(--tx-date-picker-date-height);border:1px solid transparent;border-radius:var(--tx-date-picker-date-border-radius);color:var(--tx-date-picker-date-color);font-size:var(--tx-date-picker-date-font-size);font-weight:var(--tx-date-picker-date-font-weight);transition:background-color var(--tx-date-picker-transition-duration),color var(--tx-date-picker-transition-duration),box-shadow var(--tx-date-picker-transition-duration)}.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell--today .tx-datepicker__day{background:var(--tx-date-picker-today-background);color:var(--tx-date-picker-today-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell:not([aria-disabled=true]):hover .tx-datepicker__day:not(.tx-datepicker__day--selected,.tx-datepicker__day--preview){background:var(--tx-date-picker-date-hover-background);color:var(--tx-date-picker-date-hover-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell:focus-visible .tx-datepicker__day{outline:var(--tx-date-picker-date-focus-ring-width) var(--tx-date-picker-date-focus-ring-style) var(--tx-date-picker-date-focus-ring-color);outline-offset:var(--tx-date-picker-date-focus-ring-offset);box-shadow:var(--tx-date-picker-date-focus-ring-shadow)}.tx-datepicker__panel[data-styled] .tx-datepicker__day--range,.tx-datepicker__panel[data-styled] .tx-datepicker__day--preview,.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell--today .tx-datepicker__day--range,.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell--today .tx-datepicker__day--preview{background:var(--tx-date-picker-date-range-selected-background);color:var(--tx-date-picker-date-range-selected-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__day--selected,.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell--today .tx-datepicker__day--selected{background:var(--tx-date-picker-date-selected-background);color:var(--tx-date-picker-date-selected-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__day--disabled{opacity:var(--tx-date-picker-date-disabled-opacity)}.tx-datepicker__panel[data-styled] .tx-datepicker__month-view{margin:var(--tx-date-picker-month-view-margin)}.tx-datepicker__panel[data-styled] .tx-datepicker__year-view{margin:var(--tx-date-picker-year-view-margin)}.tx-datepicker__panel[data-styled] .tx-datepicker__month,.tx-datepicker__panel[data-styled] .tx-datepicker__year{box-sizing:border-box;outline-color:transparent;color:var(--tx-date-picker-date-color);font-size:var(--tx-date-picker-date-font-size);font-weight:var(--tx-date-picker-date-font-weight);transition:background-color var(--tx-date-picker-transition-duration),color var(--tx-date-picker-transition-duration),outline-color var(--tx-date-picker-transition-duration)}.tx-datepicker__panel[data-styled] .tx-datepicker__month:not(.tx-datepicker__month--disabled,.tx-datepicker__year--disabled,.tx-datepicker__month--selected,.tx-datepicker__year--selected):hover,.tx-datepicker__panel[data-styled] .tx-datepicker__year:not(.tx-datepicker__month--disabled,.tx-datepicker__year--disabled,.tx-datepicker__month--selected,.tx-datepicker__year--selected):hover{background:var(--tx-date-picker-date-hover-background);color:var(--tx-date-picker-date-hover-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__month:focus-visible,.tx-datepicker__panel[data-styled] .tx-datepicker__year:focus-visible{outline:var(--tx-date-picker-date-focus-ring-width) var(--tx-date-picker-date-focus-ring-style) var(--tx-date-picker-date-focus-ring-color);outline-offset:var(--tx-date-picker-date-focus-ring-offset)}.tx-datepicker__panel[data-styled] .tx-datepicker__month{padding:var(--tx-date-picker-month-padding);border-radius:var(--tx-date-picker-month-border-radius)}.tx-datepicker__panel[data-styled] .tx-datepicker__year{padding:var(--tx-date-picker-year-padding);border-radius:var(--tx-date-picker-year-border-radius)}.tx-datepicker__panel[data-styled] .tx-datepicker__month--selected,.tx-datepicker__panel[data-styled] .tx-datepicker__year--selected{background:var(--tx-date-picker-date-selected-background);color:var(--tx-date-picker-date-selected-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__month--disabled,.tx-datepicker__panel[data-styled] .tx-datepicker__year--disabled{opacity:var(--tx-date-picker-date-disabled-opacity)}.tx-datepicker__panel[data-styled] .tx-datepicker__time{gap:var(--tx-date-picker-time-picker-gap);padding:0;color:var(--tx-date-picker-time-picker-color);font-size:var(--tx-date-picker-time-picker-font-size);font-weight:var(--tx-date-picker-time-picker-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__calendars+.tx-datepicker__time{margin-top:var(--tx-date-picker-time-picker-gap);padding:var(--tx-date-picker-time-picker-padding);border-top:1px solid var(--tx-date-picker-time-picker-border-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__time-unit{gap:var(--tx-date-picker-time-picker-button-gap)}.tx-datepicker__panel[data-styled] .tx-datepicker__time-value{font-variant-numeric:tabular-nums}.tx-datepicker__panel[data-styled] .tx-datepicker__buttonbar{padding:var(--tx-date-picker-buttonbar-padding);border-top:1px solid var(--tx-date-picker-buttonbar-border-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__calendars+.tx-datepicker__buttonbar,.tx-datepicker__panel[data-styled] .tx-datepicker__time+.tx-datepicker__buttonbar{margin-top:var(--tx-date-picker-time-picker-gap)}.tx-datepicker__panel[data-styled] .tx-datepicker__month-view,.tx-datepicker__panel[data-styled] .tx-datepicker__year-view,.tx-datepicker__panel[data-styled] .tx-datepicker__day-view{animation:tx-datepicker-view var(--tx-date-picker-transition-duration) ease-out}@keyframes tx-datepicker-view{0%{opacity:0}}@media(prefers-reduced-motion:reduce){.tx-datepicker__panel[data-styled] .tx-datepicker__month-view,.tx-datepicker__panel[data-styled] .tx-datepicker__year-view,.tx-datepicker__panel[data-styled] .tx-datepicker__day-view{animation:none}}\n"],
|
|
1954
1965
|
dependencies: [
|
|
1955
1966
|
{
|
|
@@ -2080,7 +2091,7 @@ var TxDatePicker = class TxDatePicker extends TxFormControlBase {
|
|
|
2080
2091
|
};
|
|
2081
2092
|
i0.ɵɵngDeclareClassMetadata({
|
|
2082
2093
|
minVersion: "12.0.0",
|
|
2083
|
-
version: "22.2.
|
|
2094
|
+
version: "22.2.6",
|
|
2084
2095
|
ngImport: i0,
|
|
2085
2096
|
type: TxDatePicker,
|
|
2086
2097
|
decorators: [{
|
|
@@ -2119,7 +2130,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2119
2130
|
"[class.tx-datepicker--button]": "showIcon() && iconDisplay() === \"button\" && !inline()"
|
|
2120
2131
|
},
|
|
2121
2132
|
viewProviders: [provideTxIconDefaults(DATEPICKER_ICON_DEFAULTS)],
|
|
2122
|
-
template: "@if (inline()) {\n <ng-container [ngTemplateOutlet]=\"panelTemplate\" />\n} @else {\n <div #field #origin=\"cdkOverlayOrigin\" cdkOverlayOrigin class=\"tx-datepicker__field\">\n <input\n #input\n txInput\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n aria-autocomplete=\"none\"\n aria-haspopup=\"dialog\"\n class=\"tx-datepicker__input\"\n [class]=\"passThrough().input?.class\"\n [style]=\"passThrough().input?.style\"\n [id]=\"resolvedInputId()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [fluid]=\"true\"\n [invalid]=\"isInvalid()\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly() || readonlyInput()\"\n [required]=\"required()\"\n [value]=\"inputText()\"\n [attr.inputmode]=\"readonlyInput() || touchUI() ? 'none' : null\"\n [attr.placeholder]=\"placeholder() ?? null\"\n [attr.name]=\"name() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"isOpen() ? panelId : null\"\n (focus)=\"onInputFocus($event)\"\n (blur)=\"onInputBlur($event)\"\n (click)=\"onInputClick()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onInputKeydown($event)\"\n />\n @if (canClear()) {\n <button\n type=\"button\"\n class=\"tx-datepicker__clear\"\n [class]=\"passThrough().clear?.class\"\n [style]=\"passThrough().clear?.style\"\n [attr.aria-label]=\"translations().clear\"\n (click)=\"onClearIcon()\"\n >\n <tx-icon name=\"times\" />\n </button>\n }\n @if (showIcon() && iconDisplay() === 'input') {\n <span\n class=\"tx-datepicker__input-icon\"\n aria-hidden=\"true\"\n [class]=\"passThrough().inputIcon?.class\"\n [style]=\"passThrough().inputIcon?.style\"\n (click)=\"toggle(false)\"\n >\n @if (inputIconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: toggle.bind(this, false) }\" />\n } @else {\n <tx-icon [name]=\"icon()\" />\n }\n </span>\n }\n @if (showIcon() && iconDisplay() === 'button') {\n <button\n type=\"button\"\n class=\"tx-datepicker__dropdown\"\n aria-haspopup=\"dialog\"\n tabindex=\"-1\"\n [class]=\"passThrough().dropdown?.class\"\n [style]=\"passThrough().dropdown?.style\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"iconAriaLabel() ?? translations().chooseDate\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"isOpen() ? panelId : null\"\n (click)=\"toggle(true)\"\n >\n @if (triggerIconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n } @else {\n <tx-icon [name]=\"icon()\" />\n }\n </button>\n }\n </div>\n\n <ng-template\n cdkConnectedOverlay\n txOverlayAnchor\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayOpen]=\"isPanelMounted() && !touchUI()\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayScrollStrategy]=\"scrollStrategy\"\n [cdkConnectedOverlayMinWidth]=\"panelMinWidth()\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n (attach)=\"onAttach()\"\n (positionChange)=\"onPositionChange($event)\"\n (overlayOutsideClick)=\"onOutsideClick($event)\"\n (detach)=\"close(false)\"\n >\n <ng-container [ngTemplateOutlet]=\"panelTemplate\" />\n </ng-template>\n}\n\n<ng-template #panelTemplate>\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- the panel only listens to keys and focus that bubble from its controls -->\n <div\n #panel\n class=\"tx-datepicker__panel\"\n [cdkTrapFocus]=\"!inline()\"\n [attr.id]=\"panelId\"\n [attr.role]=\"inline() ? 'group' : 'dialog'\"\n [attr.aria-modal]=\"inline() ? null : 'true'\"\n [attr.aria-label]=\"ariaLabel() ?? translations().chooseDate\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [attr.data-view]=\"currentView()\"\n [class.tx-datepicker__panel--inline]=\"inline()\"\n [class.tx-datepicker__panel--touch]=\"touchUI() && !inline()\"\n [class.tx-datepicker__panel--time-only]=\"timeOnly()\"\n [class.tx-datepicker__panel--disabled]=\"isDisabled()\"\n [class]=\"passThrough().panel?.class\"\n [style]=\"panelStyle()\"\n [style.min-width.px]=\"inline() ? null : panelMinWidth()\"\n (keydown)=\"onPanelKeydown($event)\"\n (focusout)=\"onPanelFocusOut($event)\"\n >\n @if (headerTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n }\n @if (!timeOnly()) {\n <div class=\"tx-datepicker__calendars\">\n @for (month of currentView() === 'date' ? months() : [months()[0]]; track month.year * 12 + month.month; let first = $first; let last = $last) {\n <div class=\"tx-datepicker__calendar\" [class]=\"passThrough().calendar?.class\" [style]=\"passThrough().calendar?.style\">\n <div class=\"tx-datepicker__header\" [class]=\"passThrough().header?.class\" [style]=\"passThrough().header?.style\">\n <button\n txButton\n type=\"button\"\n icon=\"chevron-left\"\n severity=\"secondary\"\n variant=\"text\"\n class=\"tx-datepicker__previous\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [class.tx-datepicker__nav--hidden]=\"!first\"\n [class]=\"passThrough().previous?.class\"\n [style]=\"passThrough().previous?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-hidden]=\"first ? null : 'true'\"\n [attr.tabindex]=\"first ? null : -1\"\n [attr.aria-label]=\"currentView() === 'year' ? translations().previousDecade : currentView() === 'month' ? translations().previousYear : translations().previousMonth\"\n (click)=\"previous()\"\n ></button>\n <div class=\"tx-datepicker__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\">\n @switch (currentView()) {\n @case ('date') {\n <button\n type=\"button\"\n class=\"tx-datepicker__select-month\"\n [class]=\"passThrough().selectMonth?.class\"\n [style]=\"passThrough().selectMonth?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-label]=\"translations().chooseMonth + ', ' + names().monthNames[month.month]\"\n (click)=\"showMonthView()\"\n >\n {{ names().monthNames[month.month] }}\n </button>\n <button\n type=\"button\"\n class=\"tx-datepicker__select-year\"\n [class]=\"passThrough().selectYear?.class\"\n [style]=\"passThrough().selectYear?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-label]=\"translations().chooseYear + ', ' + month.year\"\n (click)=\"showYearView()\"\n >\n {{ month.year }}\n </button>\n }\n @case ('month') {\n <button\n type=\"button\"\n class=\"tx-datepicker__select-year\"\n [class]=\"passThrough().selectYear?.class\"\n [style]=\"passThrough().selectYear?.style\"\n [disabled]=\"isDisabled() || view() === 'year'\"\n [attr.aria-label]=\"translations().chooseYear + ', ' + viewYear()\"\n (click)=\"showYearView()\"\n >\n {{ viewYear() }}\n </button>\n }\n @case ('year') {\n <span class=\"tx-datepicker__decade\">\n @if (decadeTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: decade() }\" />\n } @else {\n {{ decade()[0] }} – {{ decade()[9] }}\n }\n </span>\n }\n }\n </div>\n <button\n txButton\n type=\"button\"\n icon=\"chevron-right\"\n severity=\"secondary\"\n variant=\"text\"\n class=\"tx-datepicker__next\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [class.tx-datepicker__nav--hidden]=\"!last\"\n [class]=\"passThrough().next?.class\"\n [style]=\"passThrough().next?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-hidden]=\"last ? null : 'true'\"\n [attr.tabindex]=\"last ? null : -1\"\n [attr.aria-label]=\"currentView() === 'year' ? translations().nextDecade : currentView() === 'month' ? translations().nextYear : translations().nextMonth\"\n (click)=\"next()\"\n ></button>\n </div>\n\n @switch (currentView()) {\n @case ('date') {\n <table\n role=\"grid\"\n class=\"tx-datepicker__day-view\"\n (mouseleave)=\"onGridLeave()\"\n [attr.aria-label]=\"names().monthNames[month.month] + ' ' + month.year\"\n [class]=\"passThrough().table?.class\"\n [style]=\"passThrough().table?.style\"\n >\n <thead>\n <tr>\n @if (showWeek()) {\n <th scope=\"col\" class=\"tx-datepicker__weekday tx-datepicker__weekheader\" [class]=\"passThrough().weekday?.class\" [style]=\"passThrough().weekday?.style\">\n {{ translations().weekHeader }}\n </th>\n }\n @for (weekday of weekdays(); track weekday.long) {\n <th scope=\"col\" class=\"tx-datepicker__weekday\" [attr.abbr]=\"weekday.long\" [class]=\"passThrough().weekday?.class\" [style]=\"passThrough().weekday?.style\">\n {{ weekday.short }}\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (week of month.weeks; track week.number + '-' + $index) {\n <tr>\n @if (showWeek()) {\n <th scope=\"row\" class=\"tx-datepicker__week-number\" [class]=\"passThrough().weekNumber?.class\" [style]=\"passThrough().weekNumber?.style\">\n {{ week.number }}\n </th>\n }\n @for (day of week.days; track dayKey(day.date)) {\n @if (day.otherMonth && !showOtherMonths()) {\n <td role=\"gridcell\" class=\"tx-datepicker__day-cell tx-datepicker__day-cell--empty\"></td>\n } @else {\n <td\n role=\"gridcell\"\n class=\"tx-datepicker__day-cell\"\n [class.tx-datepicker__day-cell--today]=\"day.today\"\n [class.tx-datepicker__day-cell--other]=\"day.otherMonth\"\n [attr.data-date]=\"dayKey(day.date)\"\n [attr.data-active]=\"isFocusedDay(day) || null\"\n [attr.tabindex]=\"isFocusedDay(day) ? 0 : -1\"\n [attr.aria-label]=\"dayLabel(day.date)\"\n [attr.aria-selected]=\"isSelected(day.date) || isInRange(day.date)\"\n [attr.aria-disabled]=\"!day.selectable || (day.otherMonth && !selectOtherMonths()) || null\"\n [attr.aria-current]=\"day.today ? 'date' : null\"\n (click)=\"onDayClick(day)\"\n (mouseenter)=\"onDayEnter(day)\"\n (keydown)=\"onDayKeydown($event, day)\"\n >\n <span\n class=\"tx-datepicker__day\"\n [class.tx-datepicker__day--selected]=\"isSelected(day.date)\"\n [class.tx-datepicker__day--range]=\"isInRange(day.date)\"\n [class.tx-datepicker__day--preview]=\"isPreview(day.date)\"\n [class.tx-datepicker__day--disabled]=\"!day.selectable\"\n [class]=\"passThrough().day?.class\"\n [style]=\"passThrough().day?.style\"\n >\n @if (dateTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: day, selected: isSelected(day.date), inRange: isInRange(day.date) }\"\n />\n } @else {\n {{ day.day }}\n }\n </span>\n </td>\n }\n }\n </tr>\n }\n </tbody>\n </table>\n }\n @case ('month') {\n <div\n role=\"grid\"\n class=\"tx-datepicker__month-view\"\n [attr.aria-label]=\"translations().chooseMonth\"\n [class]=\"passThrough().monthView?.class\"\n [style]=\"passThrough().monthView?.style\"\n >\n @for (row of [0, 1, 2, 3]; track row) {\n <div role=\"row\" class=\"tx-datepicker__row\">\n @for (column of [0, 1, 2]; track column) {\n @let monthIndex = row * 3 + column;\n <span\n role=\"gridcell\"\n class=\"tx-datepicker__month\"\n [class.tx-datepicker__month--selected]=\"isMonthSelected(monthIndex)\"\n [class.tx-datepicker__month--disabled]=\"!monthSelectable(monthIndex)\"\n [class]=\"passThrough().month?.class\"\n [style]=\"passThrough().month?.style\"\n [attr.data-active]=\"focusedMonth() === monthIndex || null\"\n [attr.tabindex]=\"focusedMonth() === monthIndex ? 0 : -1\"\n [attr.aria-label]=\"names().monthNames[monthIndex] + ' ' + viewYear()\"\n [attr.aria-selected]=\"isMonthSelected(monthIndex)\"\n [attr.aria-disabled]=\"!monthSelectable(monthIndex) || null\"\n (click)=\"pickMonth(monthIndex)\"\n (keydown)=\"onMonthKeydown($event, monthIndex)\"\n >{{ names().monthNamesShort[monthIndex] }}</span\n >\n }\n </div>\n }\n </div>\n }\n @case ('year') {\n <div\n role=\"grid\"\n class=\"tx-datepicker__year-view\"\n [attr.aria-label]=\"translations().chooseYear\"\n [class]=\"passThrough().yearView?.class\"\n [style]=\"passThrough().yearView?.style\"\n >\n @for (row of [0, 1, 2, 3, 4]; track row) {\n <div role=\"row\" class=\"tx-datepicker__row\">\n @for (column of [0, 1]; track column) {\n @let year = decade()[row * 2 + column];\n <span\n role=\"gridcell\"\n class=\"tx-datepicker__year\"\n [class.tx-datepicker__year--selected]=\"isYearSelected(year)\"\n [class.tx-datepicker__year--disabled]=\"!yearSelectable(year)\"\n [class]=\"passThrough().year?.class\"\n [style]=\"passThrough().year?.style\"\n [attr.data-active]=\"focusedYear() === year || null\"\n [attr.tabindex]=\"focusedYear() === year ? 0 : -1\"\n [attr.aria-selected]=\"isYearSelected(year)\"\n [attr.aria-disabled]=\"!yearSelectable(year) || null\"\n (click)=\"pickYear(year)\"\n (keydown)=\"onYearKeydown($event, year)\"\n >{{ year }}</span\n >\n }\n </div>\n }\n </div>\n }\n }\n </div>\n }\n </div>\n }\n\n @if (hasTime() && currentView() === 'date') {\n <div class=\"tx-datepicker__time\" [class]=\"passThrough().timePicker?.class\" [style]=\"passThrough().timePicker?.style\">\n <ng-container [ngTemplateOutlet]=\"spinner\" [ngTemplateOutletContext]=\"{ unit: 'hour', value: hours() }\" />\n <span class=\"tx-datepicker__time-separator\" aria-hidden=\"true\">{{ timeSeparator() }}</span>\n <ng-container [ngTemplateOutlet]=\"spinner\" [ngTemplateOutletContext]=\"{ unit: 'minute', value: minutes() }\" />\n @if (showSeconds()) {\n <span class=\"tx-datepicker__time-separator\" aria-hidden=\"true\">{{ timeSeparator() }}</span>\n <ng-container [ngTemplateOutlet]=\"spinner\" [ngTemplateOutletContext]=\"{ unit: 'second', value: seconds() }\" />\n }\n @if (hourFormat() === '12') {\n <div class=\"tx-datepicker__time-unit\">\n <button\n txButton\n type=\"button\"\n icon=\"chevron-up\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"translations().toggleAmPm\"\n (click)=\"toggleMeridiem()\"\n ></button>\n <span class=\"tx-datepicker__time-value\">{{ isPm() ? translations().pm : translations().am }}</span>\n <button\n txButton\n type=\"button\"\n icon=\"chevron-down\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"translations().toggleAmPm\"\n (click)=\"toggleMeridiem()\"\n ></button>\n </div>\n }\n </div>\n }\n\n @if (showButtonBar()) {\n <div class=\"tx-datepicker__buttonbar\" [class]=\"passThrough().buttonbar?.class\" [style]=\"passThrough().buttonbar?.style\">\n @if (buttonBarTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ today: selectToday.bind(this), clear: onClearButton.bind(this) }\" />\n } @else {\n <button\n txButton\n type=\"button\"\n size=\"small\"\n severity=\"secondary\"\n variant=\"text\"\n [unstyled]=\"isUnstyled()\"\n [label]=\"translations().today\"\n [disabled]=\"!isEditable()\"\n (click)=\"selectToday()\"\n ></button>\n <button\n txButton\n type=\"button\"\n size=\"small\"\n severity=\"secondary\"\n variant=\"text\"\n [unstyled]=\"isUnstyled()\"\n [label]=\"translations().clear\"\n [disabled]=\"!isEditable()\"\n (click)=\"onClearButton()\"\n ></button>\n }\n </div>\n }\n @if (footerTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n }\n </div>\n</ng-template>\n\n<ng-template #spinner let-unit=\"unit\" let-value=\"value\">\n <div class=\"tx-datepicker__time-unit\" role=\"group\" [attr.aria-label]=\"unit === 'hour' ? translations().hour : unit === 'minute' ? translations().minute : translations().second\">\n <button\n txButton\n type=\"button\"\n icon=\"chevron-up\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"unit === 'hour' ? translations().nextHour : unit === 'minute' ? translations().nextMinute : translations().nextSecond\"\n (pointerdown)=\"startRepeat($event, unit, 1)\"\n (pointerup)=\"stopRepeat()\"\n (pointerleave)=\"stopRepeat()\"\n (pointercancel)=\"stopRepeat()\"\n (keydown)=\"onTimeKeydown($event, unit, 1)\"\n ></button>\n <span class=\"tx-datepicker__time-value\" aria-live=\"polite\">{{ formatPart(value) }}</span>\n <button\n txButton\n type=\"button\"\n icon=\"chevron-down\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"unit === 'hour' ? translations().previousHour : unit === 'minute' ? translations().previousMinute : translations().previousSecond\"\n (pointerdown)=\"startRepeat($event, unit, -1)\"\n (pointerup)=\"stopRepeat()\"\n (pointerleave)=\"stopRepeat()\"\n (pointercancel)=\"stopRepeat()\"\n (keydown)=\"onTimeKeydown($event, unit, -1)\"\n ></button>\n </div>\n</ng-template>\n",
|
|
2133
|
+
template: "@if (inline()) {\n <ng-container [ngTemplateOutlet]=\"panelTemplate\" />\n} @else {\n <div #field #origin=\"cdkOverlayOrigin\" cdkOverlayOrigin class=\"tx-datepicker__field\">\n <input\n #input\n txInput\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n aria-autocomplete=\"none\"\n aria-haspopup=\"dialog\"\n class=\"tx-datepicker__input\"\n [class]=\"passThrough().input?.class\"\n [style]=\"passThrough().input?.style\"\n [id]=\"resolvedInputId()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [fluid]=\"true\"\n [invalid]=\"isInvalid()\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly() || readonlyInput()\"\n [attr.data-picker]=\"readonlyInput() && !readonly() ? '' : null\"\n [required]=\"required()\"\n [value]=\"inputText()\"\n [attr.inputmode]=\"readonlyInput() || touchUI() ? 'none' : null\"\n [attr.placeholder]=\"placeholder() ?? null\"\n [attr.name]=\"name() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"isOpen() ? panelId : null\"\n (focus)=\"onInputFocus($event)\"\n (blur)=\"onInputBlur($event)\"\n (click)=\"onInputClick()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onInputKeydown($event)\"\n />\n @if (canClear()) {\n <button\n type=\"button\"\n class=\"tx-datepicker__clear\"\n [class]=\"passThrough().clear?.class\"\n [style]=\"passThrough().clear?.style\"\n [attr.aria-label]=\"translations().clear\"\n (click)=\"onClearIcon()\"\n >\n <tx-icon name=\"times\" />\n </button>\n }\n @if (showIcon() && iconDisplay() === 'input') {\n <span\n class=\"tx-datepicker__input-icon\"\n aria-hidden=\"true\"\n [class]=\"passThrough().inputIcon?.class\"\n [style]=\"passThrough().inputIcon?.style\"\n (click)=\"toggle(false)\"\n >\n @if (inputIconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: toggle.bind(this, false) }\" />\n } @else {\n <tx-icon [name]=\"icon()\" />\n }\n </span>\n }\n @if (showIcon() && iconDisplay() === 'button') {\n <button\n type=\"button\"\n class=\"tx-datepicker__dropdown\"\n aria-haspopup=\"dialog\"\n tabindex=\"-1\"\n [class]=\"passThrough().dropdown?.class\"\n [style]=\"passThrough().dropdown?.style\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"iconAriaLabel() ?? translations().chooseDate\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"isOpen() ? panelId : null\"\n (click)=\"toggle(true)\"\n >\n @if (triggerIconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n } @else {\n <tx-icon [name]=\"icon()\" />\n }\n </button>\n }\n </div>\n\n <ng-template\n cdkConnectedOverlay\n txOverlayAnchor\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayOpen]=\"isPanelMounted() && !touchUI()\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayScrollStrategy]=\"scrollStrategy\"\n [cdkConnectedOverlayMinWidth]=\"panelMinWidth()\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n (attach)=\"onAttach()\"\n (positionChange)=\"onPositionChange($event)\"\n (overlayOutsideClick)=\"onOutsideClick($event)\"\n (detach)=\"close(false)\"\n >\n <ng-container [ngTemplateOutlet]=\"panelTemplate\" />\n </ng-template>\n}\n\n<ng-template #panelTemplate>\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- the panel only listens to keys and focus that bubble from its controls -->\n <div\n #panel\n class=\"tx-datepicker__panel\"\n [cdkTrapFocus]=\"!inline()\"\n [attr.id]=\"panelId\"\n [attr.role]=\"inline() ? 'group' : 'dialog'\"\n [attr.aria-modal]=\"inline() ? null : 'true'\"\n [attr.aria-label]=\"ariaLabel() ?? translations().chooseDate\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [attr.data-view]=\"currentView()\"\n [class.tx-datepicker__panel--inline]=\"inline()\"\n [class.tx-datepicker__panel--touch]=\"touchUI() && !inline()\"\n [class.tx-datepicker__panel--time-only]=\"timeOnly()\"\n [class.tx-datepicker__panel--disabled]=\"isDisabled()\"\n [class]=\"passThrough().panel?.class\"\n [style]=\"panelStyle()\"\n [style.min-width.px]=\"inline() ? null : panelMinWidth()\"\n (keydown)=\"onPanelKeydown($event)\"\n (focusout)=\"onPanelFocusOut($event)\"\n >\n @if (headerTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n }\n @if (!timeOnly()) {\n <div class=\"tx-datepicker__calendars\">\n @for (month of currentView() === 'date' ? months() : [months()[0]]; track month.year * 12 + month.month; let first = $first; let last = $last) {\n <div class=\"tx-datepicker__calendar\" [class]=\"passThrough().calendar?.class\" [style]=\"passThrough().calendar?.style\">\n <div class=\"tx-datepicker__header\" [class]=\"passThrough().header?.class\" [style]=\"passThrough().header?.style\">\n <button\n txButton\n type=\"button\"\n icon=\"chevron-left\"\n severity=\"secondary\"\n variant=\"text\"\n class=\"tx-datepicker__previous\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [class.tx-datepicker__nav--hidden]=\"!first\"\n [class]=\"passThrough().previous?.class\"\n [style]=\"passThrough().previous?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-hidden]=\"first ? null : 'true'\"\n [attr.tabindex]=\"first ? null : -1\"\n [attr.aria-label]=\"currentView() === 'year' ? translations().previousDecade : currentView() === 'month' ? translations().previousYear : translations().previousMonth\"\n (click)=\"previous()\"\n ></button>\n <div class=\"tx-datepicker__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\">\n @switch (currentView()) {\n @case ('date') {\n <button\n type=\"button\"\n class=\"tx-datepicker__select-month\"\n [class]=\"passThrough().selectMonth?.class\"\n [style]=\"passThrough().selectMonth?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-label]=\"translations().chooseMonth + ', ' + names().monthNames[month.month]\"\n (click)=\"showMonthView()\"\n >\n {{ names().monthNames[month.month] }}\n </button>\n <button\n type=\"button\"\n class=\"tx-datepicker__select-year\"\n [class]=\"passThrough().selectYear?.class\"\n [style]=\"passThrough().selectYear?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-label]=\"translations().chooseYear + ', ' + month.year\"\n (click)=\"showYearView()\"\n >\n {{ month.year }}\n </button>\n }\n @case ('month') {\n <button\n type=\"button\"\n class=\"tx-datepicker__select-year\"\n [class]=\"passThrough().selectYear?.class\"\n [style]=\"passThrough().selectYear?.style\"\n [disabled]=\"isDisabled() || view() === 'year'\"\n [attr.aria-label]=\"translations().chooseYear + ', ' + viewYear()\"\n (click)=\"showYearView()\"\n >\n {{ viewYear() }}\n </button>\n }\n @case ('year') {\n <span class=\"tx-datepicker__decade\">\n @if (decadeTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: decade() }\" />\n } @else {\n {{ decade()[0] }} – {{ decade()[9] }}\n }\n </span>\n }\n }\n </div>\n <button\n txButton\n type=\"button\"\n icon=\"chevron-right\"\n severity=\"secondary\"\n variant=\"text\"\n class=\"tx-datepicker__next\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [class.tx-datepicker__nav--hidden]=\"!last\"\n [class]=\"passThrough().next?.class\"\n [style]=\"passThrough().next?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-hidden]=\"last ? null : 'true'\"\n [attr.tabindex]=\"last ? null : -1\"\n [attr.aria-label]=\"currentView() === 'year' ? translations().nextDecade : currentView() === 'month' ? translations().nextYear : translations().nextMonth\"\n (click)=\"next()\"\n ></button>\n </div>\n\n @switch (currentView()) {\n @case ('date') {\n <table\n role=\"grid\"\n class=\"tx-datepicker__day-view\"\n (mouseleave)=\"onGridLeave()\"\n [attr.aria-label]=\"names().monthNames[month.month] + ' ' + month.year\"\n [class]=\"passThrough().table?.class\"\n [style]=\"passThrough().table?.style\"\n >\n <thead>\n <tr>\n @if (showWeek()) {\n <th scope=\"col\" class=\"tx-datepicker__weekday tx-datepicker__weekheader\" [class]=\"passThrough().weekday?.class\" [style]=\"passThrough().weekday?.style\">\n {{ translations().weekHeader }}\n </th>\n }\n @for (weekday of weekdays(); track weekday.long) {\n <th scope=\"col\" class=\"tx-datepicker__weekday\" [attr.abbr]=\"weekday.long\" [class]=\"passThrough().weekday?.class\" [style]=\"passThrough().weekday?.style\">\n {{ weekday.short }}\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (week of month.weeks; track week.number + '-' + $index) {\n <tr>\n @if (showWeek()) {\n <th scope=\"row\" class=\"tx-datepicker__week-number\" [class]=\"passThrough().weekNumber?.class\" [style]=\"passThrough().weekNumber?.style\">\n {{ week.number }}\n </th>\n }\n @for (day of week.days; track dayKey(day.date)) {\n @if (day.otherMonth && !showOtherMonths()) {\n <td role=\"gridcell\" class=\"tx-datepicker__day-cell tx-datepicker__day-cell--empty\"></td>\n } @else {\n <td\n role=\"gridcell\"\n class=\"tx-datepicker__day-cell\"\n [class.tx-datepicker__day-cell--today]=\"day.today\"\n [class.tx-datepicker__day-cell--other]=\"day.otherMonth\"\n [attr.data-date]=\"dayKey(day.date)\"\n [attr.data-active]=\"isFocusedDay(day) || null\"\n [attr.tabindex]=\"isFocusedDay(day) ? 0 : -1\"\n [attr.aria-label]=\"dayLabel(day.date)\"\n [attr.aria-selected]=\"isSelected(day.date) || isInRange(day.date)\"\n [attr.aria-disabled]=\"!day.selectable || (day.otherMonth && !selectOtherMonths()) || null\"\n [attr.aria-current]=\"day.today ? 'date' : null\"\n (click)=\"onDayClick(day)\"\n (mouseenter)=\"onDayEnter(day)\"\n (keydown)=\"onDayKeydown($event, day)\"\n >\n <span\n class=\"tx-datepicker__day\"\n [class.tx-datepicker__day--selected]=\"isSelected(day.date)\"\n [class.tx-datepicker__day--range]=\"isInRange(day.date)\"\n [class.tx-datepicker__day--preview]=\"isPreview(day.date)\"\n [class.tx-datepicker__day--disabled]=\"!day.selectable\"\n [class]=\"passThrough().day?.class\"\n [style]=\"passThrough().day?.style\"\n >\n @if (dateTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: day, selected: isSelected(day.date), inRange: isInRange(day.date) }\"\n />\n } @else {\n {{ day.day }}\n }\n </span>\n </td>\n }\n }\n </tr>\n }\n </tbody>\n </table>\n }\n @case ('month') {\n <div\n role=\"grid\"\n class=\"tx-datepicker__month-view\"\n [attr.aria-label]=\"translations().chooseMonth\"\n [class]=\"passThrough().monthView?.class\"\n [style]=\"passThrough().monthView?.style\"\n >\n @for (row of [0, 1, 2, 3]; track row) {\n <div role=\"row\" class=\"tx-datepicker__row\">\n @for (column of [0, 1, 2]; track column) {\n @let monthIndex = row * 3 + column;\n <span\n role=\"gridcell\"\n class=\"tx-datepicker__month\"\n [class.tx-datepicker__month--selected]=\"isMonthSelected(monthIndex)\"\n [class.tx-datepicker__month--disabled]=\"!monthSelectable(monthIndex)\"\n [class]=\"passThrough().month?.class\"\n [style]=\"passThrough().month?.style\"\n [attr.data-active]=\"focusedMonth() === monthIndex || null\"\n [attr.tabindex]=\"focusedMonth() === monthIndex ? 0 : -1\"\n [attr.aria-label]=\"names().monthNames[monthIndex] + ' ' + viewYear()\"\n [attr.aria-selected]=\"isMonthSelected(monthIndex)\"\n [attr.aria-disabled]=\"!monthSelectable(monthIndex) || null\"\n (click)=\"pickMonth(monthIndex)\"\n (keydown)=\"onMonthKeydown($event, monthIndex)\"\n >{{ names().monthNamesShort[monthIndex] }}</span\n >\n }\n </div>\n }\n </div>\n }\n @case ('year') {\n <div\n role=\"grid\"\n class=\"tx-datepicker__year-view\"\n [attr.aria-label]=\"translations().chooseYear\"\n [class]=\"passThrough().yearView?.class\"\n [style]=\"passThrough().yearView?.style\"\n >\n @for (row of [0, 1, 2, 3, 4]; track row) {\n <div role=\"row\" class=\"tx-datepicker__row\">\n @for (column of [0, 1]; track column) {\n @let year = decade()[row * 2 + column];\n <span\n role=\"gridcell\"\n class=\"tx-datepicker__year\"\n [class.tx-datepicker__year--selected]=\"isYearSelected(year)\"\n [class.tx-datepicker__year--disabled]=\"!yearSelectable(year)\"\n [class]=\"passThrough().year?.class\"\n [style]=\"passThrough().year?.style\"\n [attr.data-active]=\"focusedYear() === year || null\"\n [attr.tabindex]=\"focusedYear() === year ? 0 : -1\"\n [attr.aria-selected]=\"isYearSelected(year)\"\n [attr.aria-disabled]=\"!yearSelectable(year) || null\"\n (click)=\"pickYear(year)\"\n (keydown)=\"onYearKeydown($event, year)\"\n >{{ year }}</span\n >\n }\n </div>\n }\n </div>\n }\n }\n </div>\n }\n </div>\n }\n\n @if (hasTime() && currentView() === 'date') {\n <div class=\"tx-datepicker__time\" [class]=\"passThrough().timePicker?.class\" [style]=\"passThrough().timePicker?.style\">\n <ng-container [ngTemplateOutlet]=\"spinner\" [ngTemplateOutletContext]=\"{ unit: 'hour', value: hours() }\" />\n <span class=\"tx-datepicker__time-separator\" aria-hidden=\"true\">{{ timeSeparator() }}</span>\n <ng-container [ngTemplateOutlet]=\"spinner\" [ngTemplateOutletContext]=\"{ unit: 'minute', value: minutes() }\" />\n @if (showSeconds()) {\n <span class=\"tx-datepicker__time-separator\" aria-hidden=\"true\">{{ timeSeparator() }}</span>\n <ng-container [ngTemplateOutlet]=\"spinner\" [ngTemplateOutletContext]=\"{ unit: 'second', value: seconds() }\" />\n }\n @if (hourFormat() === '12') {\n <div class=\"tx-datepicker__time-unit\">\n <button\n txButton\n type=\"button\"\n icon=\"chevron-up\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"translations().toggleAmPm\"\n (click)=\"toggleMeridiem()\"\n ></button>\n <span class=\"tx-datepicker__time-value\">{{ isPm() ? translations().pm : translations().am }}</span>\n <button\n txButton\n type=\"button\"\n icon=\"chevron-down\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"translations().toggleAmPm\"\n (click)=\"toggleMeridiem()\"\n ></button>\n </div>\n }\n </div>\n }\n\n @if (showButtonBar()) {\n <div class=\"tx-datepicker__buttonbar\" [class]=\"passThrough().buttonbar?.class\" [style]=\"passThrough().buttonbar?.style\">\n @if (buttonBarTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ today: selectToday.bind(this), clear: onClearButton.bind(this) }\" />\n } @else {\n <button\n txButton\n type=\"button\"\n size=\"small\"\n severity=\"secondary\"\n variant=\"text\"\n [unstyled]=\"isUnstyled()\"\n [label]=\"translations().today\"\n [disabled]=\"!isEditable()\"\n (click)=\"selectToday()\"\n ></button>\n <button\n txButton\n type=\"button\"\n size=\"small\"\n severity=\"secondary\"\n variant=\"text\"\n [unstyled]=\"isUnstyled()\"\n [label]=\"translations().clear\"\n [disabled]=\"!isEditable()\"\n (click)=\"onClearButton()\"\n ></button>\n }\n </div>\n }\n @if (footerTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n }\n </div>\n</ng-template>\n\n<ng-template #spinner let-unit=\"unit\" let-value=\"value\">\n <div class=\"tx-datepicker__time-unit\" role=\"group\" [attr.aria-label]=\"unit === 'hour' ? translations().hour : unit === 'minute' ? translations().minute : translations().second\">\n <button\n txButton\n type=\"button\"\n icon=\"chevron-up\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"unit === 'hour' ? translations().nextHour : unit === 'minute' ? translations().nextMinute : translations().nextSecond\"\n (pointerdown)=\"startRepeat($event, unit, 1)\"\n (pointerup)=\"stopRepeat()\"\n (pointerleave)=\"stopRepeat()\"\n (pointercancel)=\"stopRepeat()\"\n (keydown)=\"onTimeKeydown($event, unit, 1)\"\n ></button>\n <span class=\"tx-datepicker__time-value\" aria-live=\"polite\">{{ formatPart(value) }}</span>\n <button\n txButton\n type=\"button\"\n icon=\"chevron-down\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"unit === 'hour' ? translations().previousHour : unit === 'minute' ? translations().previousMinute : translations().previousSecond\"\n (pointerdown)=\"startRepeat($event, unit, -1)\"\n (pointerup)=\"stopRepeat()\"\n (pointerleave)=\"stopRepeat()\"\n (pointercancel)=\"stopRepeat()\"\n (keydown)=\"onTimeKeydown($event, unit, -1)\"\n ></button>\n </div>\n</ng-template>\n",
|
|
2123
2134
|
styles: [":host{display:inline-flex;max-width:100%;vertical-align:top}:host(.tx-datepicker--fluid){display:flex;width:100%}:host(.tx-datepicker--inline){display:inline-block}.tx-datepicker__field{position:relative;display:flex;flex:1 1 auto;align-items:stretch;min-width:0}.tx-datepicker__input{flex:1 1 auto;width:1%;min-width:0}.tx-datepicker__clear,.tx-datepicker__input-icon{position:absolute;top:50%;transform:translateY(-50%)}.tx-datepicker__dropdown{display:inline-flex;flex:none;align-items:center;justify-content:center;cursor:pointer}.tx-datepicker__nav--hidden{visibility:hidden}:host([data-styled]){--_icon-room: 0px;--_clear-room: 0px}:host([data-styled]) .tx-datepicker__input{--tx-field-inset-end: calc(var(--_icon-room) + var(--_clear-room))}:host([data-styled]) .tx-datepicker__clear{display:grid;place-items:center;width:24px;height:24px;padding:0;border:none;border-radius:var(--tx-radius-sm);background:transparent;color:var(--tx-form-field-icon-color);font-size:var(--tx-form-field-font-size);cursor:pointer;pointer-events:auto;transition:background-color var(--tx-form-field-transition-duration),color var(--tx-form-field-transition-duration)}:host([data-styled]) .tx-datepicker__clear:hover{background:var(--tx-surface-hover);color:var(--tx-form-field-color)}:host([data-styled]) .tx-datepicker__clear:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:1px}:host([data-styled]) .tx-datepicker__clear{right:calc(var(--_icon-room) + var(--_button-room, 0px) + 8px)}:host([data-styled]) .tx-datepicker__input-icon{right:var(--tx-form-field-padding-x);display:inline-flex;color:var(--tx-date-picker-input-icon-color);font-size:var(--tx-form-field-font-size);line-height:1;cursor:pointer}:host([data-styled]) .tx-datepicker__dropdown{box-sizing:border-box;width:var(--tx-date-picker-dropdown-width);padding:0;border:1px solid var(--tx-date-picker-dropdown-border-color);border-inline-start:0 none;border-start-end-radius:var(--tx-date-picker-dropdown-border-radius);border-end-end-radius:var(--tx-date-picker-dropdown-border-radius);outline-color:transparent;background:var(--tx-date-picker-dropdown-background);color:var(--tx-date-picker-dropdown-color);font-size:var(--tx-form-field-font-size);transition:background-color var(--tx-date-picker-transition-duration),color var(--tx-date-picker-transition-duration),border-color var(--tx-date-picker-transition-duration),outline-color var(--tx-date-picker-transition-duration)}:host([data-styled]) .tx-datepicker__dropdown:not(:disabled):hover{border-color:var(--tx-date-picker-dropdown-hover-border-color);background:var(--tx-date-picker-dropdown-hover-background);color:var(--tx-date-picker-dropdown-hover-color)}:host([data-styled]) .tx-datepicker__dropdown:not(:disabled):active{border-color:var(--tx-date-picker-dropdown-active-border-color);background:var(--tx-date-picker-dropdown-active-background);color:var(--tx-date-picker-dropdown-active-color)}:host([data-styled]) .tx-datepicker__dropdown:focus-visible{outline:var(--tx-date-picker-dropdown-focus-ring-width) var(--tx-date-picker-dropdown-focus-ring-style) var(--tx-date-picker-dropdown-focus-ring-color);outline-offset:var(--tx-date-picker-dropdown-focus-ring-offset);box-shadow:var(--tx-date-picker-dropdown-focus-ring-shadow)}:host([data-styled]) .tx-datepicker__dropdown:disabled{cursor:not-allowed;opacity:.6}:host([data-styled].tx-datepicker--invalid) .tx-datepicker__dropdown,:host([data-styled].tx-datepicker--invalid) .tx-datepicker__dropdown:not(:disabled):hover,:host([data-styled].tx-datepicker--invalid) .tx-datepicker__dropdown:not(:disabled):active{border-color:var(--tx-date-picker-dropdown-invalid-border-color)}:host([data-styled]:has(.tx-datepicker__input-icon)){--_icon-room: calc(var(--tx-form-field-padding-x) + 1em)}:host([data-styled]:has(.tx-datepicker__clear)){--_clear-room: 28px}:host([data-styled].tx-datepicker--button){--_button-room: var(--tx-date-picker-dropdown-width)}:host([data-styled].tx-datepicker--button[data-size=small]){--_button-room: var(--tx-date-picker-dropdown-sm-width)}:host([data-styled].tx-datepicker--button[data-size=large]){--_button-room: var(--tx-date-picker-dropdown-lg-width)}:host([data-styled].tx-datepicker--button) .tx-datepicker__input{border-start-end-radius:0;border-end-end-radius:0}:host([data-styled][data-size=small]) .tx-datepicker__dropdown{width:var(--tx-date-picker-dropdown-sm-width);font-size:var(--tx-form-field-sm-font-size)}:host([data-styled][data-size=large]) .tx-datepicker__dropdown{width:var(--tx-date-picker-dropdown-lg-width);font-size:var(--tx-form-field-lg-font-size)}.tx-datepicker__panel{box-sizing:border-box}.tx-datepicker__calendars{display:flex}.tx-datepicker__header,.tx-datepicker__title,.tx-datepicker__time,.tx-datepicker__buttonbar{display:flex;align-items:center}.tx-datepicker__header,.tx-datepicker__buttonbar{justify-content:space-between}.tx-datepicker__time{justify-content:center}.tx-datepicker__time-unit{display:flex;flex-direction:column;align-items:center}.tx-datepicker__day-view{width:100%;border-collapse:collapse}.tx-datepicker__day-cell{cursor:pointer}.tx-datepicker__day-cell[aria-disabled=true]{cursor:default}.tx-datepicker__day{display:flex;align-items:center;justify-content:center;margin:0 auto}.tx-datepicker__row{display:flex}.tx-datepicker__month,.tx-datepicker__year{display:inline-flex;align-items:center;justify-content:center;cursor:pointer}.tx-datepicker__month{width:33.3%}.tx-datepicker__year{width:50%}.tx-datepicker__month--disabled,.tx-datepicker__year--disabled{cursor:default}.tx-datepicker__panel[data-styled]{padding:var(--tx-date-picker-panel-padding);border:1px solid var(--tx-date-picker-panel-border-color);border-radius:var(--tx-date-picker-panel-border-radius);background:var(--tx-date-picker-panel-background);box-shadow:var(--tx-date-picker-panel-shadow);color:var(--tx-date-picker-panel-color);font-family:var(--tx-font-family)}.tx-datepicker__panel[data-styled].tx-datepicker__panel--inline{display:inline-block;overflow-x:auto;box-shadow:none}.tx-datepicker__panel[data-styled].tx-datepicker__panel--touch{width:var(--tx-date-picker-touch-width);max-height:92vh;overflow:auto}.tx-datepicker__panel[data-styled].tx-datepicker__panel--disabled{opacity:.6}.tx-datepicker__panel[data-styled] .tx-datepicker__calendar{flex:1 1 auto;padding-inline:var(--tx-date-picker-group-gap);border-inline-start:1px solid var(--tx-date-picker-group-border-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__calendar:first-child{padding-inline-start:0;border-inline-start:0 none}.tx-datepicker__panel[data-styled] .tx-datepicker__calendar:last-child{padding-inline-end:0}.tx-datepicker__panel[data-styled] .tx-datepicker__header{padding:var(--tx-date-picker-header-padding);border-bottom:1px solid var(--tx-date-picker-header-border-color);background:var(--tx-date-picker-header-background);color:var(--tx-date-picker-header-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__title{gap:var(--tx-date-picker-title-gap);font-size:var(--tx-date-picker-title-font-size);font-weight:var(--tx-date-picker-title-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month,.tx-datepicker__panel[data-styled] .tx-datepicker__select-year{margin:0;border:none;outline-color:transparent;background:transparent;font-family:inherit;cursor:pointer;transition:background-color var(--tx-date-picker-transition-duration),color var(--tx-date-picker-transition-duration),outline-color var(--tx-date-picker-transition-duration)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month:focus-visible,.tx-datepicker__panel[data-styled] .tx-datepicker__select-year:focus-visible{outline:var(--tx-date-picker-date-focus-ring-width) var(--tx-date-picker-date-focus-ring-style) var(--tx-date-picker-date-focus-ring-color);outline-offset:var(--tx-date-picker-date-focus-ring-offset)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month:disabled,.tx-datepicker__panel[data-styled] .tx-datepicker__select-year:disabled{cursor:default}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month{padding:var(--tx-date-picker-select-month-padding);border-radius:var(--tx-date-picker-select-month-border-radius);color:var(--tx-date-picker-select-month-color);font-size:var(--tx-date-picker-select-month-font-size);font-weight:var(--tx-date-picker-select-month-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month:enabled:hover{background:var(--tx-date-picker-select-month-hover-background);color:var(--tx-date-picker-select-month-hover-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-year{padding:var(--tx-date-picker-select-year-padding);border-radius:var(--tx-date-picker-select-year-border-radius);color:var(--tx-date-picker-select-year-color);font-size:var(--tx-date-picker-select-year-font-size);font-weight:var(--tx-date-picker-select-year-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-year:enabled:hover{background:var(--tx-date-picker-select-year-hover-background);color:var(--tx-date-picker-select-year-hover-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__decade{padding:var(--tx-date-picker-select-year-padding)}.tx-datepicker__panel[data-styled] .tx-datepicker__day-view{margin:var(--tx-date-picker-day-view-margin);font-size:var(--tx-date-picker-date-font-size)}.tx-datepicker__panel[data-styled] .tx-datepicker__weekday{padding:var(--tx-date-picker-week-day-padding);color:var(--tx-date-picker-week-day-color);font-size:var(--tx-date-picker-week-day-font-size);font-weight:var(--tx-date-picker-week-day-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__week-number{padding:var(--tx-date-picker-date-padding);color:var(--tx-date-picker-week-number-color);font-size:var(--tx-date-picker-week-number-font-size);font-weight:var(--tx-date-picker-date-font-weight);text-align:center}.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell{padding:var(--tx-date-picker-date-padding);outline:none}.tx-datepicker__panel[data-styled] .tx-datepicker__day{box-sizing:border-box;width:var(--tx-date-picker-date-width);height:var(--tx-date-picker-date-height);border:1px solid transparent;border-radius:var(--tx-date-picker-date-border-radius);color:var(--tx-date-picker-date-color);font-size:var(--tx-date-picker-date-font-size);font-weight:var(--tx-date-picker-date-font-weight);transition:background-color var(--tx-date-picker-transition-duration),color var(--tx-date-picker-transition-duration),box-shadow var(--tx-date-picker-transition-duration)}.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell--today .tx-datepicker__day{background:var(--tx-date-picker-today-background);color:var(--tx-date-picker-today-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell:not([aria-disabled=true]):hover .tx-datepicker__day:not(.tx-datepicker__day--selected,.tx-datepicker__day--preview){background:var(--tx-date-picker-date-hover-background);color:var(--tx-date-picker-date-hover-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell:focus-visible .tx-datepicker__day{outline:var(--tx-date-picker-date-focus-ring-width) var(--tx-date-picker-date-focus-ring-style) var(--tx-date-picker-date-focus-ring-color);outline-offset:var(--tx-date-picker-date-focus-ring-offset);box-shadow:var(--tx-date-picker-date-focus-ring-shadow)}.tx-datepicker__panel[data-styled] .tx-datepicker__day--range,.tx-datepicker__panel[data-styled] .tx-datepicker__day--preview,.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell--today .tx-datepicker__day--range,.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell--today .tx-datepicker__day--preview{background:var(--tx-date-picker-date-range-selected-background);color:var(--tx-date-picker-date-range-selected-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__day--selected,.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell--today .tx-datepicker__day--selected{background:var(--tx-date-picker-date-selected-background);color:var(--tx-date-picker-date-selected-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__day--disabled{opacity:var(--tx-date-picker-date-disabled-opacity)}.tx-datepicker__panel[data-styled] .tx-datepicker__month-view{margin:var(--tx-date-picker-month-view-margin)}.tx-datepicker__panel[data-styled] .tx-datepicker__year-view{margin:var(--tx-date-picker-year-view-margin)}.tx-datepicker__panel[data-styled] .tx-datepicker__month,.tx-datepicker__panel[data-styled] .tx-datepicker__year{box-sizing:border-box;outline-color:transparent;color:var(--tx-date-picker-date-color);font-size:var(--tx-date-picker-date-font-size);font-weight:var(--tx-date-picker-date-font-weight);transition:background-color var(--tx-date-picker-transition-duration),color var(--tx-date-picker-transition-duration),outline-color var(--tx-date-picker-transition-duration)}.tx-datepicker__panel[data-styled] .tx-datepicker__month:not(.tx-datepicker__month--disabled,.tx-datepicker__year--disabled,.tx-datepicker__month--selected,.tx-datepicker__year--selected):hover,.tx-datepicker__panel[data-styled] .tx-datepicker__year:not(.tx-datepicker__month--disabled,.tx-datepicker__year--disabled,.tx-datepicker__month--selected,.tx-datepicker__year--selected):hover{background:var(--tx-date-picker-date-hover-background);color:var(--tx-date-picker-date-hover-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__month:focus-visible,.tx-datepicker__panel[data-styled] .tx-datepicker__year:focus-visible{outline:var(--tx-date-picker-date-focus-ring-width) var(--tx-date-picker-date-focus-ring-style) var(--tx-date-picker-date-focus-ring-color);outline-offset:var(--tx-date-picker-date-focus-ring-offset)}.tx-datepicker__panel[data-styled] .tx-datepicker__month{padding:var(--tx-date-picker-month-padding);border-radius:var(--tx-date-picker-month-border-radius)}.tx-datepicker__panel[data-styled] .tx-datepicker__year{padding:var(--tx-date-picker-year-padding);border-radius:var(--tx-date-picker-year-border-radius)}.tx-datepicker__panel[data-styled] .tx-datepicker__month--selected,.tx-datepicker__panel[data-styled] .tx-datepicker__year--selected{background:var(--tx-date-picker-date-selected-background);color:var(--tx-date-picker-date-selected-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__month--disabled,.tx-datepicker__panel[data-styled] .tx-datepicker__year--disabled{opacity:var(--tx-date-picker-date-disabled-opacity)}.tx-datepicker__panel[data-styled] .tx-datepicker__time{gap:var(--tx-date-picker-time-picker-gap);padding:0;color:var(--tx-date-picker-time-picker-color);font-size:var(--tx-date-picker-time-picker-font-size);font-weight:var(--tx-date-picker-time-picker-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__calendars+.tx-datepicker__time{margin-top:var(--tx-date-picker-time-picker-gap);padding:var(--tx-date-picker-time-picker-padding);border-top:1px solid var(--tx-date-picker-time-picker-border-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__time-unit{gap:var(--tx-date-picker-time-picker-button-gap)}.tx-datepicker__panel[data-styled] .tx-datepicker__time-value{font-variant-numeric:tabular-nums}.tx-datepicker__panel[data-styled] .tx-datepicker__buttonbar{padding:var(--tx-date-picker-buttonbar-padding);border-top:1px solid var(--tx-date-picker-buttonbar-border-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__calendars+.tx-datepicker__buttonbar,.tx-datepicker__panel[data-styled] .tx-datepicker__time+.tx-datepicker__buttonbar{margin-top:var(--tx-date-picker-time-picker-gap)}.tx-datepicker__panel[data-styled] .tx-datepicker__month-view,.tx-datepicker__panel[data-styled] .tx-datepicker__year-view,.tx-datepicker__panel[data-styled] .tx-datepicker__day-view{animation:tx-datepicker-view var(--tx-date-picker-transition-duration) ease-out}@keyframes tx-datepicker-view{0%{opacity:0}}@media(prefers-reduced-motion:reduce){.tx-datepicker__panel[data-styled] .tx-datepicker__month-view,.tx-datepicker__panel[data-styled] .tx-datepicker__year-view,.tx-datepicker__panel[data-styled] .tx-datepicker__day-view{animation:none}}\n"]
|
|
2124
2135
|
}]
|
|
2125
2136
|
}],
|