@tailng-ui/primitives 0.54.0 → 0.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/package.json +2 -2
  2. package/src/lib/form/date-range-picker/__tests__/tng-date-range-picker.test-helpers.d.ts +25 -0
  3. package/src/lib/form/date-range-picker/__tests__/tng-date-range-picker.test-helpers.d.ts.map +1 -0
  4. package/src/lib/form/date-range-picker/__tests__/tng-date-range-picker.test-helpers.js +109 -0
  5. package/src/lib/form/date-range-picker/__tests__/tng-date-range-picker.test-helpers.js.map +1 -0
  6. package/src/lib/form/date-range-picker/date-range-picker.adapters.d.ts +5 -0
  7. package/src/lib/form/date-range-picker/date-range-picker.adapters.d.ts.map +1 -0
  8. package/src/lib/form/date-range-picker/date-range-picker.adapters.js +9 -0
  9. package/src/lib/form/date-range-picker/date-range-picker.adapters.js.map +1 -0
  10. package/src/lib/form/date-range-picker/date-range-picker.state.d.ts +10 -0
  11. package/src/lib/form/date-range-picker/date-range-picker.state.d.ts.map +1 -0
  12. package/src/lib/form/date-range-picker/date-range-picker.state.js +35 -0
  13. package/src/lib/form/date-range-picker/date-range-picker.state.js.map +1 -0
  14. package/src/lib/form/date-range-picker/date-range-picker.types.d.ts +280 -0
  15. package/src/lib/form/date-range-picker/date-range-picker.types.d.ts.map +1 -0
  16. package/src/lib/form/date-range-picker/date-range-picker.types.js +1 -0
  17. package/src/lib/form/date-range-picker/date-range-picker.types.js.map +1 -0
  18. package/src/lib/form/date-range-picker/date-range-picker.utils.d.ts +54 -0
  19. package/src/lib/form/date-range-picker/date-range-picker.utils.d.ts.map +1 -0
  20. package/src/lib/form/date-range-picker/date-range-picker.utils.js +37 -0
  21. package/src/lib/form/date-range-picker/date-range-picker.utils.js.map +1 -0
  22. package/src/lib/form/date-range-picker/index.d.ts +7 -0
  23. package/src/lib/form/date-range-picker/index.d.ts.map +1 -0
  24. package/src/lib/form/date-range-picker/index.js +7 -0
  25. package/src/lib/form/date-range-picker/index.js.map +1 -0
  26. package/src/lib/form/date-range-picker/tng-date-range-picker.d.ts +5 -0
  27. package/src/lib/form/date-range-picker/tng-date-range-picker.d.ts.map +1 -0
  28. package/src/lib/form/date-range-picker/tng-date-range-picker.js +1970 -0
  29. package/src/lib/form/date-range-picker/tng-date-range-picker.js.map +1 -0
  30. package/src/lib/form/date-range-picker/tng-date-range-picker.overlay.d.ts +87 -0
  31. package/src/lib/form/date-range-picker/tng-date-range-picker.overlay.d.ts.map +1 -0
  32. package/src/lib/form/date-range-picker/tng-date-range-picker.overlay.js +447 -0
  33. package/src/lib/form/date-range-picker/tng-date-range-picker.overlay.js.map +1 -0
  34. package/src/lib/form/date-range-picker/tng-date-range-picker.parts.d.ts +3155 -0
  35. package/src/lib/form/date-range-picker/tng-date-range-picker.parts.d.ts.map +1 -0
  36. package/src/lib/form/date-range-picker/tng-date-range-picker.parts.js +940 -0
  37. package/src/lib/form/date-range-picker/tng-date-range-picker.parts.js.map +1 -0
  38. package/src/lib/form/datepicker/datepicker.adapters.d.ts.map +1 -1
  39. package/src/lib/form/datepicker/datepicker.adapters.js +4 -189
  40. package/src/lib/form/datepicker/datepicker.adapters.js.map +1 -1
  41. package/src/lib/form/datepicker/datepicker.state.d.ts.map +1 -1
  42. package/src/lib/form/datepicker/datepicker.state.js +7 -86
  43. package/src/lib/form/datepicker/datepicker.state.js.map +1 -1
  44. package/src/lib/form/datepicker/datepicker.utils.d.ts +6 -28
  45. package/src/lib/form/datepicker/datepicker.utils.d.ts.map +1 -1
  46. package/src/lib/form/datepicker/datepicker.utils.js +14 -228
  47. package/src/lib/form/datepicker/datepicker.utils.js.map +1 -1
  48. package/src/lib/form/index.d.ts +2 -0
  49. package/src/lib/form/index.d.ts.map +1 -1
  50. package/src/lib/form/index.js +2 -0
  51. package/src/lib/form/index.js.map +1 -1
  52. package/src/lib/form/number-range/index.d.ts +3 -0
  53. package/src/lib/form/number-range/index.d.ts.map +1 -0
  54. package/src/lib/form/number-range/index.js +3 -0
  55. package/src/lib/form/number-range/index.js.map +1 -0
  56. package/src/lib/form/number-range/tng-number-range.d.ts +26 -0
  57. package/src/lib/form/number-range/tng-number-range.d.ts.map +1 -0
  58. package/src/lib/form/number-range/tng-number-range.js +49 -0
  59. package/src/lib/form/number-range/tng-number-range.js.map +1 -0
  60. package/src/lib/form/number-range/tng-number-range.types.d.ts +12 -0
  61. package/src/lib/form/number-range/tng-number-range.types.d.ts.map +1 -0
  62. package/src/lib/form/number-range/tng-number-range.types.js +1 -0
  63. package/src/lib/form/number-range/tng-number-range.types.js.map +1 -0
@@ -0,0 +1,940 @@
1
+ import { DestroyRef, Directive, ElementRef, HostBinding, HostListener, Injector, computed, effect, inject, input, signal, } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export function resolveTngDateRangePickerPeriodLabel(controller, outputs) {
4
+ if (outputs.view === 'year') {
5
+ const startYear = outputs.yearOptions[0]?.year;
6
+ const endYear = outputs.yearOptions[outputs.yearOptions.length - 1]?.year;
7
+ if (startYear !== undefined && endYear !== undefined) {
8
+ return `${startYear} - ${endYear}`;
9
+ }
10
+ }
11
+ if (outputs.view === 'month') {
12
+ return controller.formatDate(outputs.visibleMonth, 'year-label');
13
+ }
14
+ return outputs.labelMonthYear;
15
+ }
16
+ export function bindTngDateRangePicker(controller) {
17
+ const destroyRef = inject(DestroyRef);
18
+ const version = signal(0, ...(ngDevMode ? [{ debugName: "version" }] : []));
19
+ const unsubscribe = controller.subscribe(() => {
20
+ version.update((value) => value + 1);
21
+ });
22
+ destroyRef.onDestroy(() => unsubscribe());
23
+ const outputs = computed(() => {
24
+ version();
25
+ return controller.getOutputs();
26
+ }, ...(ngDevMode ? [{ debugName: "outputs" }] : []));
27
+ const periodLabel = computed(() => resolveTngDateRangePickerPeriodLabel(controller, outputs()), ...(ngDevMode ? [{ debugName: "periodLabel" }] : []));
28
+ return Object.freeze({ outputs, periodLabel });
29
+ }
30
+ function resolveCurrentFocusTargetId(outputs) {
31
+ if (outputs.view === 'day') {
32
+ const gridAttributes = outputs.getGridAttributes();
33
+ if (gridAttributes['aria-activedescendant'] !== undefined) {
34
+ return gridAttributes.id ?? null;
35
+ }
36
+ return outputs.cells.find((cell) => cell.active)?.id ?? null;
37
+ }
38
+ if (outputs.view === 'month') {
39
+ return outputs.monthOptions.find((option) => option.active)?.id ?? null;
40
+ }
41
+ if (outputs.view === 'year') {
42
+ return outputs.yearOptions.find((option) => option.active)?.id ?? null;
43
+ }
44
+ return null;
45
+ }
46
+ function shouldSyncOverlayFocusAfterPickerKey(key) {
47
+ return (key === 'ArrowUp' ||
48
+ key === 'ArrowDown' ||
49
+ key === 'ArrowLeft' ||
50
+ key === 'ArrowRight' ||
51
+ key === 'Home' ||
52
+ key === 'End' ||
53
+ key === 'PageUp' ||
54
+ key === 'PageDown' ||
55
+ key === 'Enter' ||
56
+ key === ' ' ||
57
+ key === 'Escape');
58
+ }
59
+ function isPickerActivationKey(key) {
60
+ return key === 'Enter' || key === ' ';
61
+ }
62
+ function queueDateRangePickerOverlayFocusSync(controller, ownerDocument) {
63
+ const targetDocument = ownerDocument ?? document;
64
+ queueMicrotask(() => {
65
+ const focusTarget = () => {
66
+ const outputs = controller.getOutputs();
67
+ if (!outputs.open) {
68
+ return;
69
+ }
70
+ const targetId = resolveCurrentFocusTargetId(outputs);
71
+ if (targetId === null) {
72
+ return;
73
+ }
74
+ const target = targetDocument.getElementById(targetId);
75
+ if (!(target instanceof HTMLElement)) {
76
+ return;
77
+ }
78
+ target.focus();
79
+ };
80
+ if (typeof requestAnimationFrame === 'function') {
81
+ requestAnimationFrame(() => focusTarget());
82
+ return;
83
+ }
84
+ setTimeout(() => focusTarget(), 0);
85
+ });
86
+ }
87
+ function resolveAttribute(attributes, key) {
88
+ return attributes[key] ?? null;
89
+ }
90
+ class TngDateRangePickerControllerPart {
91
+ injector = inject(Injector);
92
+ ownerDocument = inject((ElementRef)).nativeElement.ownerDocument ?? null;
93
+ renderVersion = signal(0, ...(ngDevMode ? [{ debugName: "renderVersion" }] : []));
94
+ ngOnInit() {
95
+ effect((onCleanup) => {
96
+ const controller = this.controller();
97
+ const unsubscribe = controller.subscribe(() => {
98
+ this.renderVersion.update((value) => value + 1);
99
+ });
100
+ onCleanup(() => unsubscribe());
101
+ }, { injector: this.injector });
102
+ }
103
+ syncOverlayFocus() {
104
+ queueDateRangePickerOverlayFocusSync(this.controller(), this.ownerDocument);
105
+ }
106
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngDateRangePickerControllerPart, deps: [], target: i0.ɵɵFactoryTarget.Directive });
107
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: TngDateRangePickerControllerPart, isStandalone: true, ngImport: i0 });
108
+ }
109
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngDateRangePickerControllerPart, decorators: [{
110
+ type: Directive
111
+ }] });
112
+ export class TngDateRangePickerHost extends TngDateRangePickerControllerPart {
113
+ controller = input.required({ ...(ngDevMode ? { debugName: "controller" } : {}), alias: 'tngDateRangePickerHost' });
114
+ attributes = computed(() => {
115
+ this.renderVersion();
116
+ return this.controller().getOutputs().getHostAttributes();
117
+ }, ...(ngDevMode ? [{ debugName: "attributes" }] : []));
118
+ get ariaDescribedby() {
119
+ return resolveAttribute(this.attributes(), 'aria-describedby');
120
+ }
121
+ get ariaLabel() {
122
+ return resolveAttribute(this.attributes(), 'aria-label');
123
+ }
124
+ get ariaLabelledby() {
125
+ return resolveAttribute(this.attributes(), 'aria-labelledby');
126
+ }
127
+ get dataDisabled() {
128
+ return resolveAttribute(this.attributes(), 'data-disabled');
129
+ }
130
+ get dataOpen() {
131
+ return resolveAttribute(this.attributes(), 'data-open');
132
+ }
133
+ get dataSlot() {
134
+ return resolveAttribute(this.attributes(), 'data-slot');
135
+ }
136
+ get dataView() {
137
+ return resolveAttribute(this.attributes(), 'data-view');
138
+ }
139
+ get dir() {
140
+ return resolveAttribute(this.attributes(), 'dir');
141
+ }
142
+ get role() {
143
+ return resolveAttribute(this.attributes(), 'role');
144
+ }
145
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngDateRangePickerHost, deps: null, target: i0.ɵɵFactoryTarget.Directive });
146
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.1", type: TngDateRangePickerHost, isStandalone: true, selector: "[tngDateRangePickerHost]", inputs: { controller: { classPropertyName: "controller", publicName: "tngDateRangePickerHost", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "attr.aria-describedby": "this.ariaDescribedby", "attr.aria-label": "this.ariaLabel", "attr.aria-labelledby": "this.ariaLabelledby", "attr.data-disabled": "this.dataDisabled", "attr.data-open": "this.dataOpen", "attr.data-slot": "this.dataSlot", "attr.data-view": "this.dataView", "attr.dir": "this.dir", "attr.role": "this.role" } }, exportAs: ["tngDateRangePickerHost"], usesInheritance: true, ngImport: i0 });
147
+ }
148
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngDateRangePickerHost, decorators: [{
149
+ type: Directive,
150
+ args: [{
151
+ selector: '[tngDateRangePickerHost]',
152
+ exportAs: 'tngDateRangePickerHost',
153
+ standalone: true,
154
+ }]
155
+ }], propDecorators: { controller: [{ type: i0.Input, args: [{ isSignal: true, alias: "tngDateRangePickerHost", required: true }] }], ariaDescribedby: [{
156
+ type: HostBinding,
157
+ args: ['attr.aria-describedby']
158
+ }], ariaLabel: [{
159
+ type: HostBinding,
160
+ args: ['attr.aria-label']
161
+ }], ariaLabelledby: [{
162
+ type: HostBinding,
163
+ args: ['attr.aria-labelledby']
164
+ }], dataDisabled: [{
165
+ type: HostBinding,
166
+ args: ['attr.data-disabled']
167
+ }], dataOpen: [{
168
+ type: HostBinding,
169
+ args: ['attr.data-open']
170
+ }], dataSlot: [{
171
+ type: HostBinding,
172
+ args: ['attr.data-slot']
173
+ }], dataView: [{
174
+ type: HostBinding,
175
+ args: ['attr.data-view']
176
+ }], dir: [{
177
+ type: HostBinding,
178
+ args: ['attr.dir']
179
+ }], role: [{
180
+ type: HostBinding,
181
+ args: ['attr.role']
182
+ }] } });
183
+ export class TngDateRangePickerInput extends TngDateRangePickerControllerPart {
184
+ inputElement = inject(ElementRef);
185
+ controller = input.required({ ...(ngDevMode ? { debugName: "controller" } : {}), alias: 'tngDateRangePickerInput' });
186
+ dataSlot = 'date-range-picker-input';
187
+ get valueProp() {
188
+ this.renderVersion();
189
+ return this.controller().getOutputs().inputText;
190
+ }
191
+ get ariaInvalid() {
192
+ this.renderVersion();
193
+ return this.controller().getOutputs().validationError !== null ? 'true' : null;
194
+ }
195
+ onBlur() {
196
+ this.controller().commitInputText();
197
+ }
198
+ onInput() {
199
+ this.controller().setInputText(this.inputElement.nativeElement.value);
200
+ }
201
+ onClick() {
202
+ if (this.controller().getOutputs().open) {
203
+ return;
204
+ }
205
+ this.controller().open();
206
+ this.syncOverlayFocus();
207
+ }
208
+ onKeydown(event) {
209
+ if (event.key === 'Enter') {
210
+ event.preventDefault();
211
+ if (!this.controller().getOutputs().open) {
212
+ this.controller().open();
213
+ this.syncOverlayFocus();
214
+ return;
215
+ }
216
+ this.controller().commitInputText();
217
+ return;
218
+ }
219
+ if (event.key === 'ArrowDown' && !this.controller().getOutputs().open) {
220
+ event.preventDefault();
221
+ this.controller().open();
222
+ this.syncOverlayFocus();
223
+ }
224
+ }
225
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngDateRangePickerInput, deps: null, target: i0.ɵɵFactoryTarget.Directive });
226
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.1", type: TngDateRangePickerInput, isStandalone: true, selector: "input[tngDateRangePickerInput]", inputs: { controller: { classPropertyName: "controller", publicName: "tngDateRangePickerInput", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "blur": "onBlur()", "input": "onInput()", "click": "onClick()", "keydown": "onKeydown($event)" }, properties: { "attr.data-slot": "this.dataSlot", "value": "this.valueProp", "attr.aria-invalid": "this.ariaInvalid" } }, exportAs: ["tngDateRangePickerInput"], usesInheritance: true, ngImport: i0 });
227
+ }
228
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngDateRangePickerInput, decorators: [{
229
+ type: Directive,
230
+ args: [{
231
+ selector: 'input[tngDateRangePickerInput]',
232
+ exportAs: 'tngDateRangePickerInput',
233
+ standalone: true,
234
+ }]
235
+ }], propDecorators: { controller: [{ type: i0.Input, args: [{ isSignal: true, alias: "tngDateRangePickerInput", required: true }] }], dataSlot: [{
236
+ type: HostBinding,
237
+ args: ['attr.data-slot']
238
+ }], valueProp: [{
239
+ type: HostBinding,
240
+ args: ['value']
241
+ }], ariaInvalid: [{
242
+ type: HostBinding,
243
+ args: ['attr.aria-invalid']
244
+ }], onBlur: [{
245
+ type: HostListener,
246
+ args: ['blur']
247
+ }], onInput: [{
248
+ type: HostListener,
249
+ args: ['input']
250
+ }], onClick: [{
251
+ type: HostListener,
252
+ args: ['click']
253
+ }], onKeydown: [{
254
+ type: HostListener,
255
+ args: ['keydown', ['$event']]
256
+ }] } });
257
+ export class TngDateRangePickerTrigger extends TngDateRangePickerControllerPart {
258
+ elementRef = inject(ElementRef);
259
+ controller = input.required({ ...(ngDevMode ? { debugName: "controller" } : {}), alias: 'tngDateRangePickerTrigger' });
260
+ ngOnInit() {
261
+ super.ngOnInit();
262
+ effect((onCleanup) => {
263
+ const controller = this.controller();
264
+ const element = this.elementRef.nativeElement;
265
+ controller.registerTrigger(element);
266
+ onCleanup(() => controller.registerTrigger(null));
267
+ }, { injector: this.injector });
268
+ }
269
+ dataSlot = 'date-range-picker-trigger';
270
+ get ariaHaspopup() {
271
+ this.renderVersion();
272
+ return this.controller().getOutputs().getTriggerAttributes()['aria-haspopup'] ?? null;
273
+ }
274
+ get ariaExpanded() {
275
+ this.renderVersion();
276
+ return this.controller().getOutputs().getTriggerAttributes()['aria-expanded'] ?? null;
277
+ }
278
+ get ariaControls() {
279
+ this.renderVersion();
280
+ return this.controller().getOutputs().getTriggerAttributes()['aria-controls'] ?? null;
281
+ }
282
+ get ariaDisabled() {
283
+ this.renderVersion();
284
+ return this.controller().getOutputs().getTriggerAttributes()['aria-disabled'] ?? null;
285
+ }
286
+ get dataDisabled() {
287
+ this.renderVersion();
288
+ return this.controller().getOutputs().getTriggerAttributes()['data-disabled'] ?? null;
289
+ }
290
+ get disabled() {
291
+ this.renderVersion();
292
+ return this.controller().getOutputs().getTriggerAttributes()['disabled'] === 'true';
293
+ }
294
+ get dataOpen() {
295
+ this.renderVersion();
296
+ return this.controller().getOutputs().getTriggerAttributes()['data-open'] ?? null;
297
+ }
298
+ onClick() {
299
+ const wasOpen = this.controller().getOutputs().open;
300
+ this.controller().toggleOpen();
301
+ if (!wasOpen && this.controller().getOutputs().open) {
302
+ this.syncOverlayFocus();
303
+ }
304
+ }
305
+ onKeydown(event) {
306
+ const wasOpen = this.controller().getOutputs().open;
307
+ this.controller().handleTriggerKeyDown(event);
308
+ if (!wasOpen && this.controller().getOutputs().open) {
309
+ this.syncOverlayFocus();
310
+ }
311
+ }
312
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngDateRangePickerTrigger, deps: null, target: i0.ɵɵFactoryTarget.Directive });
313
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.1", type: TngDateRangePickerTrigger, isStandalone: true, selector: "button[tngDateRangePickerTrigger]", inputs: { controller: { classPropertyName: "controller", publicName: "tngDateRangePickerTrigger", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "onClick()", "keydown": "onKeydown($event)" }, properties: { "attr.data-slot": "this.dataSlot", "attr.aria-haspopup": "this.ariaHaspopup", "attr.aria-expanded": "this.ariaExpanded", "attr.aria-controls": "this.ariaControls", "attr.aria-disabled": "this.ariaDisabled", "attr.data-disabled": "this.dataDisabled", "disabled": "this.disabled", "attr.data-open": "this.dataOpen" } }, exportAs: ["tngDateRangePickerTrigger"], usesInheritance: true, ngImport: i0 });
314
+ }
315
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngDateRangePickerTrigger, decorators: [{
316
+ type: Directive,
317
+ args: [{
318
+ selector: 'button[tngDateRangePickerTrigger]',
319
+ exportAs: 'tngDateRangePickerTrigger',
320
+ standalone: true,
321
+ }]
322
+ }], propDecorators: { controller: [{ type: i0.Input, args: [{ isSignal: true, alias: "tngDateRangePickerTrigger", required: true }] }], dataSlot: [{
323
+ type: HostBinding,
324
+ args: ['attr.data-slot']
325
+ }], ariaHaspopup: [{
326
+ type: HostBinding,
327
+ args: ['attr.aria-haspopup']
328
+ }], ariaExpanded: [{
329
+ type: HostBinding,
330
+ args: ['attr.aria-expanded']
331
+ }], ariaControls: [{
332
+ type: HostBinding,
333
+ args: ['attr.aria-controls']
334
+ }], ariaDisabled: [{
335
+ type: HostBinding,
336
+ args: ['attr.aria-disabled']
337
+ }], dataDisabled: [{
338
+ type: HostBinding,
339
+ args: ['attr.data-disabled']
340
+ }], disabled: [{
341
+ type: HostBinding,
342
+ args: ['disabled']
343
+ }], dataOpen: [{
344
+ type: HostBinding,
345
+ args: ['attr.data-open']
346
+ }], onClick: [{
347
+ type: HostListener,
348
+ args: ['click']
349
+ }], onKeydown: [{
350
+ type: HostListener,
351
+ args: ['keydown', ['$event']]
352
+ }] } });
353
+ export class TngDateRangePickerPrevButton extends TngDateRangePickerControllerPart {
354
+ controller = input.required({ ...(ngDevMode ? { debugName: "controller" } : {}), alias: 'tngDateRangePickerPrevButton' });
355
+ dataSlot = 'date-range-picker-nav-button';
356
+ onClick() {
357
+ if (this.controller().getOutputs().view === 'day') {
358
+ this.controller().prevMonth();
359
+ }
360
+ else {
361
+ this.controller().prevYear();
362
+ }
363
+ this.syncOverlayFocus();
364
+ }
365
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngDateRangePickerPrevButton, deps: null, target: i0.ɵɵFactoryTarget.Directive });
366
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.1", type: TngDateRangePickerPrevButton, isStandalone: true, selector: "button[tngDateRangePickerPrevButton]", inputs: { controller: { classPropertyName: "controller", publicName: "tngDateRangePickerPrevButton", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "onClick()" }, properties: { "attr.data-slot": "this.dataSlot" } }, exportAs: ["tngDateRangePickerPrevButton"], usesInheritance: true, ngImport: i0 });
367
+ }
368
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngDateRangePickerPrevButton, decorators: [{
369
+ type: Directive,
370
+ args: [{
371
+ selector: 'button[tngDateRangePickerPrevButton]',
372
+ exportAs: 'tngDateRangePickerPrevButton',
373
+ standalone: true,
374
+ }]
375
+ }], propDecorators: { controller: [{ type: i0.Input, args: [{ isSignal: true, alias: "tngDateRangePickerPrevButton", required: true }] }], dataSlot: [{
376
+ type: HostBinding,
377
+ args: ['attr.data-slot']
378
+ }], onClick: [{
379
+ type: HostListener,
380
+ args: ['click']
381
+ }] } });
382
+ export class TngDateRangePickerNextButton extends TngDateRangePickerControllerPart {
383
+ controller = input.required({ ...(ngDevMode ? { debugName: "controller" } : {}), alias: 'tngDateRangePickerNextButton' });
384
+ dataSlot = 'date-range-picker-nav-button';
385
+ onClick() {
386
+ if (this.controller().getOutputs().view === 'day') {
387
+ this.controller().nextMonth();
388
+ }
389
+ else {
390
+ this.controller().nextYear();
391
+ }
392
+ this.syncOverlayFocus();
393
+ }
394
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngDateRangePickerNextButton, deps: null, target: i0.ɵɵFactoryTarget.Directive });
395
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.1", type: TngDateRangePickerNextButton, isStandalone: true, selector: "button[tngDateRangePickerNextButton]", inputs: { controller: { classPropertyName: "controller", publicName: "tngDateRangePickerNextButton", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "onClick()" }, properties: { "attr.data-slot": "this.dataSlot" } }, exportAs: ["tngDateRangePickerNextButton"], usesInheritance: true, ngImport: i0 });
396
+ }
397
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngDateRangePickerNextButton, decorators: [{
398
+ type: Directive,
399
+ args: [{
400
+ selector: 'button[tngDateRangePickerNextButton]',
401
+ exportAs: 'tngDateRangePickerNextButton',
402
+ standalone: true,
403
+ }]
404
+ }], propDecorators: { controller: [{ type: i0.Input, args: [{ isSignal: true, alias: "tngDateRangePickerNextButton", required: true }] }], dataSlot: [{
405
+ type: HostBinding,
406
+ args: ['attr.data-slot']
407
+ }], onClick: [{
408
+ type: HostListener,
409
+ args: ['click']
410
+ }] } });
411
+ export class TngDateRangePickerPeriodButton extends TngDateRangePickerControllerPart {
412
+ controller = input.required({ ...(ngDevMode ? { debugName: "controller" } : {}), alias: 'tngDateRangePickerPeriodButton' });
413
+ dataSlot = 'date-range-picker-period-button';
414
+ get dataInteractive() {
415
+ this.renderVersion();
416
+ return this.controller().getOutputs().view !== 'year' ? 'true' : null;
417
+ }
418
+ onClick() {
419
+ if (this.controller().getOutputs().view === 'year') {
420
+ return;
421
+ }
422
+ this.controller().showYearsPanel();
423
+ this.syncOverlayFocus();
424
+ }
425
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngDateRangePickerPeriodButton, deps: null, target: i0.ɵɵFactoryTarget.Directive });
426
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.1", type: TngDateRangePickerPeriodButton, isStandalone: true, selector: "button[tngDateRangePickerPeriodButton]", inputs: { controller: { classPropertyName: "controller", publicName: "tngDateRangePickerPeriodButton", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "onClick()" }, properties: { "attr.data-slot": "this.dataSlot", "attr.data-interactive": "this.dataInteractive" } }, exportAs: ["tngDateRangePickerPeriodButton"], usesInheritance: true, ngImport: i0 });
427
+ }
428
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngDateRangePickerPeriodButton, decorators: [{
429
+ type: Directive,
430
+ args: [{
431
+ selector: 'button[tngDateRangePickerPeriodButton]',
432
+ exportAs: 'tngDateRangePickerPeriodButton',
433
+ standalone: true,
434
+ }]
435
+ }], propDecorators: { controller: [{ type: i0.Input, args: [{ isSignal: true, alias: "tngDateRangePickerPeriodButton", required: true }] }], dataSlot: [{
436
+ type: HostBinding,
437
+ args: ['attr.data-slot']
438
+ }], dataInteractive: [{
439
+ type: HostBinding,
440
+ args: ['attr.data-interactive']
441
+ }], onClick: [{
442
+ type: HostListener,
443
+ args: ['click']
444
+ }] } });
445
+ export class TngDateRangePickerDayGrid extends TngDateRangePickerControllerPart {
446
+ controller = input.required({ ...(ngDevMode ? { debugName: "controller" } : {}), alias: 'tngDateRangePickerDayGrid' });
447
+ get dataSlot() {
448
+ this.renderVersion();
449
+ return (this.controller().getOutputs().getGridAttributes()['data-slot'] ?? 'date-range-picker-grid');
450
+ }
451
+ get id() {
452
+ this.renderVersion();
453
+ return this.controller().getOutputs().getGridAttributes().id ?? null;
454
+ }
455
+ get role() {
456
+ this.renderVersion();
457
+ return this.controller().getOutputs().getGridAttributes()['role'] ?? null;
458
+ }
459
+ get ariaActiveDescendant() {
460
+ this.renderVersion();
461
+ return this.controller().getOutputs().getGridAttributes()['aria-activedescendant'] ?? null;
462
+ }
463
+ get ariaLabelledby() {
464
+ this.renderVersion();
465
+ return this.controller().getOutputs().getGridAttributes()['aria-labelledby'] ?? null;
466
+ }
467
+ onKeydown(event) {
468
+ this.controller().handleGridKeyDown(event);
469
+ if (shouldSyncOverlayFocusAfterPickerKey(event.key)) {
470
+ this.syncOverlayFocus();
471
+ }
472
+ }
473
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngDateRangePickerDayGrid, deps: null, target: i0.ɵɵFactoryTarget.Directive });
474
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.1", type: TngDateRangePickerDayGrid, isStandalone: true, selector: "[tngDateRangePickerDayGrid]", inputs: { controller: { classPropertyName: "controller", publicName: "tngDateRangePickerDayGrid", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "keydown": "onKeydown($event)" }, properties: { "attr.data-slot": "this.dataSlot", "attr.id": "this.id", "attr.role": "this.role", "attr.aria-activedescendant": "this.ariaActiveDescendant", "attr.aria-labelledby": "this.ariaLabelledby" } }, exportAs: ["tngDateRangePickerDayGrid"], usesInheritance: true, ngImport: i0 });
475
+ }
476
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngDateRangePickerDayGrid, decorators: [{
477
+ type: Directive,
478
+ args: [{
479
+ selector: '[tngDateRangePickerDayGrid]',
480
+ exportAs: 'tngDateRangePickerDayGrid',
481
+ standalone: true,
482
+ }]
483
+ }], propDecorators: { controller: [{ type: i0.Input, args: [{ isSignal: true, alias: "tngDateRangePickerDayGrid", required: true }] }], dataSlot: [{
484
+ type: HostBinding,
485
+ args: ['attr.data-slot']
486
+ }], id: [{
487
+ type: HostBinding,
488
+ args: ['attr.id']
489
+ }], role: [{
490
+ type: HostBinding,
491
+ args: ['attr.role']
492
+ }], ariaActiveDescendant: [{
493
+ type: HostBinding,
494
+ args: ['attr.aria-activedescendant']
495
+ }], ariaLabelledby: [{
496
+ type: HostBinding,
497
+ args: ['attr.aria-labelledby']
498
+ }], onKeydown: [{
499
+ type: HostListener,
500
+ args: ['keydown', ['$event']]
501
+ }] } });
502
+ export class TngDateRangePickerDayCell extends TngDateRangePickerControllerPart {
503
+ dayGrid = inject(TngDateRangePickerDayGrid);
504
+ controller = computed(() => this.dayGrid.controller(), ...(ngDevMode ? [{ debugName: "controller" }] : []));
505
+ cell = input.required({ ...(ngDevMode ? { debugName: "cell" } : {}), alias: 'tngDateRangePickerDayCell' });
506
+ attributes = computed(() => {
507
+ this.renderVersion();
508
+ return this.controller().getOutputs().getCellAttributes(this.cell());
509
+ }, ...(ngDevMode ? [{ debugName: "attributes" }] : []));
510
+ get id() {
511
+ return this.attributes().id ?? null;
512
+ }
513
+ get role() {
514
+ return resolveAttribute(this.attributes(), 'role');
515
+ }
516
+ get tabindex() {
517
+ return resolveAttribute(this.attributes(), 'tabindex');
518
+ }
519
+ get disabled() {
520
+ return this.cell().disabled;
521
+ }
522
+ get ariaCurrent() {
523
+ return resolveAttribute(this.attributes(), 'aria-current');
524
+ }
525
+ get ariaDisabled() {
526
+ return resolveAttribute(this.attributes(), 'aria-disabled');
527
+ }
528
+ get ariaLabel() {
529
+ return resolveAttribute(this.attributes(), 'aria-label');
530
+ }
531
+ get ariaSelected() {
532
+ return resolveAttribute(this.attributes(), 'aria-selected');
533
+ }
534
+ get dataActive() {
535
+ return resolveAttribute(this.attributes(), 'data-active');
536
+ }
537
+ get dataDisabled() {
538
+ return resolveAttribute(this.attributes(), 'data-disabled');
539
+ }
540
+ get dataFocused() {
541
+ return resolveAttribute(this.attributes(), 'data-focused');
542
+ }
543
+ get dataFocusVisible() {
544
+ return resolveAttribute(this.attributes(), 'data-focus-visible');
545
+ }
546
+ get dataHidden() {
547
+ return resolveAttribute(this.attributes(), 'data-hidden');
548
+ }
549
+ get dataInMonth() {
550
+ return resolveAttribute(this.attributes(), 'data-in-month');
551
+ }
552
+ get dataInRange() {
553
+ return resolveAttribute(this.attributes(), 'data-in-range');
554
+ }
555
+ get dataOutsideMonth() {
556
+ return resolveAttribute(this.attributes(), 'data-outside-month');
557
+ }
558
+ get dataPreviewEnd() {
559
+ return resolveAttribute(this.attributes(), 'data-preview-end');
560
+ }
561
+ get dataPreviewRange() {
562
+ return resolveAttribute(this.attributes(), 'data-preview-range');
563
+ }
564
+ get dataRangeEnd() {
565
+ return resolveAttribute(this.attributes(), 'data-range-end');
566
+ }
567
+ get dataRangeStart() {
568
+ return resolveAttribute(this.attributes(), 'data-range-start');
569
+ }
570
+ get dataSelected() {
571
+ return resolveAttribute(this.attributes(), 'data-selected');
572
+ }
573
+ get dataSlot() {
574
+ return resolveAttribute(this.attributes(), 'data-slot');
575
+ }
576
+ get dataToday() {
577
+ return resolveAttribute(this.attributes(), 'data-today');
578
+ }
579
+ onClick(event) {
580
+ const cell = this.cell();
581
+ if (cell.disabled || cell.hidden) {
582
+ return;
583
+ }
584
+ this.controller().handleCellClick(cell.date, { shiftKey: event.shiftKey });
585
+ this.syncOverlayFocus();
586
+ }
587
+ onPointerEnter() {
588
+ const cell = this.cell();
589
+ if (cell.disabled || cell.hidden) {
590
+ return;
591
+ }
592
+ this.controller().handleCellPointerEnter(cell.date);
593
+ }
594
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngDateRangePickerDayCell, deps: null, target: i0.ɵɵFactoryTarget.Directive });
595
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.1", type: TngDateRangePickerDayCell, isStandalone: true, selector: "button[tngDateRangePickerDayCell]", inputs: { cell: { classPropertyName: "cell", publicName: "tngDateRangePickerDayCell", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "onClick($event)", "pointerenter": "onPointerEnter()" }, properties: { "attr.id": "this.id", "attr.role": "this.role", "attr.tabindex": "this.tabindex", "disabled": "this.disabled", "attr.aria-current": "this.ariaCurrent", "attr.aria-disabled": "this.ariaDisabled", "attr.aria-label": "this.ariaLabel", "attr.aria-selected": "this.ariaSelected", "attr.data-active": "this.dataActive", "attr.data-disabled": "this.dataDisabled", "attr.data-focused": "this.dataFocused", "attr.data-focus-visible": "this.dataFocusVisible", "attr.data-hidden": "this.dataHidden", "attr.data-in-month": "this.dataInMonth", "attr.data-in-range": "this.dataInRange", "attr.data-outside-month": "this.dataOutsideMonth", "attr.data-preview-end": "this.dataPreviewEnd", "attr.data-preview-range": "this.dataPreviewRange", "attr.data-range-end": "this.dataRangeEnd", "attr.data-range-start": "this.dataRangeStart", "attr.data-selected": "this.dataSelected", "attr.data-slot": "this.dataSlot", "attr.data-today": "this.dataToday" } }, exportAs: ["tngDateRangePickerDayCell"], usesInheritance: true, ngImport: i0 });
596
+ }
597
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngDateRangePickerDayCell, decorators: [{
598
+ type: Directive,
599
+ args: [{
600
+ selector: 'button[tngDateRangePickerDayCell]',
601
+ exportAs: 'tngDateRangePickerDayCell',
602
+ standalone: true,
603
+ }]
604
+ }], propDecorators: { cell: [{ type: i0.Input, args: [{ isSignal: true, alias: "tngDateRangePickerDayCell", required: true }] }], id: [{
605
+ type: HostBinding,
606
+ args: ['attr.id']
607
+ }], role: [{
608
+ type: HostBinding,
609
+ args: ['attr.role']
610
+ }], tabindex: [{
611
+ type: HostBinding,
612
+ args: ['attr.tabindex']
613
+ }], disabled: [{
614
+ type: HostBinding,
615
+ args: ['disabled']
616
+ }], ariaCurrent: [{
617
+ type: HostBinding,
618
+ args: ['attr.aria-current']
619
+ }], ariaDisabled: [{
620
+ type: HostBinding,
621
+ args: ['attr.aria-disabled']
622
+ }], ariaLabel: [{
623
+ type: HostBinding,
624
+ args: ['attr.aria-label']
625
+ }], ariaSelected: [{
626
+ type: HostBinding,
627
+ args: ['attr.aria-selected']
628
+ }], dataActive: [{
629
+ type: HostBinding,
630
+ args: ['attr.data-active']
631
+ }], dataDisabled: [{
632
+ type: HostBinding,
633
+ args: ['attr.data-disabled']
634
+ }], dataFocused: [{
635
+ type: HostBinding,
636
+ args: ['attr.data-focused']
637
+ }], dataFocusVisible: [{
638
+ type: HostBinding,
639
+ args: ['attr.data-focus-visible']
640
+ }], dataHidden: [{
641
+ type: HostBinding,
642
+ args: ['attr.data-hidden']
643
+ }], dataInMonth: [{
644
+ type: HostBinding,
645
+ args: ['attr.data-in-month']
646
+ }], dataInRange: [{
647
+ type: HostBinding,
648
+ args: ['attr.data-in-range']
649
+ }], dataOutsideMonth: [{
650
+ type: HostBinding,
651
+ args: ['attr.data-outside-month']
652
+ }], dataPreviewEnd: [{
653
+ type: HostBinding,
654
+ args: ['attr.data-preview-end']
655
+ }], dataPreviewRange: [{
656
+ type: HostBinding,
657
+ args: ['attr.data-preview-range']
658
+ }], dataRangeEnd: [{
659
+ type: HostBinding,
660
+ args: ['attr.data-range-end']
661
+ }], dataRangeStart: [{
662
+ type: HostBinding,
663
+ args: ['attr.data-range-start']
664
+ }], dataSelected: [{
665
+ type: HostBinding,
666
+ args: ['attr.data-selected']
667
+ }], dataSlot: [{
668
+ type: HostBinding,
669
+ args: ['attr.data-slot']
670
+ }], dataToday: [{
671
+ type: HostBinding,
672
+ args: ['attr.data-today']
673
+ }], onClick: [{
674
+ type: HostListener,
675
+ args: ['click', ['$event']]
676
+ }], onPointerEnter: [{
677
+ type: HostListener,
678
+ args: ['pointerenter']
679
+ }] } });
680
+ export class TngDateRangePickerMonthGrid extends TngDateRangePickerControllerPart {
681
+ controller = input.required({ ...(ngDevMode ? { debugName: "controller" } : {}), alias: 'tngDateRangePickerMonthGrid' });
682
+ dataSlot = 'date-range-picker-grid';
683
+ role = 'grid';
684
+ onKeydown(event) {
685
+ this.controller().handleMonthGridKeyDown(event);
686
+ if (isPickerActivationKey(event.key)) {
687
+ this.controller().showDaysPanel();
688
+ }
689
+ if (shouldSyncOverlayFocusAfterPickerKey(event.key)) {
690
+ this.syncOverlayFocus();
691
+ }
692
+ }
693
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngDateRangePickerMonthGrid, deps: null, target: i0.ɵɵFactoryTarget.Directive });
694
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.1", type: TngDateRangePickerMonthGrid, isStandalone: true, selector: "[tngDateRangePickerMonthGrid]", inputs: { controller: { classPropertyName: "controller", publicName: "tngDateRangePickerMonthGrid", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "keydown": "onKeydown($event)" }, properties: { "attr.data-slot": "this.dataSlot", "attr.role": "this.role" } }, exportAs: ["tngDateRangePickerMonthGrid"], usesInheritance: true, ngImport: i0 });
695
+ }
696
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngDateRangePickerMonthGrid, decorators: [{
697
+ type: Directive,
698
+ args: [{
699
+ selector: '[tngDateRangePickerMonthGrid]',
700
+ exportAs: 'tngDateRangePickerMonthGrid',
701
+ standalone: true,
702
+ }]
703
+ }], propDecorators: { controller: [{ type: i0.Input, args: [{ isSignal: true, alias: "tngDateRangePickerMonthGrid", required: true }] }], dataSlot: [{
704
+ type: HostBinding,
705
+ args: ['attr.data-slot']
706
+ }], role: [{
707
+ type: HostBinding,
708
+ args: ['attr.role']
709
+ }], onKeydown: [{
710
+ type: HostListener,
711
+ args: ['keydown', ['$event']]
712
+ }] } });
713
+ export class TngDateRangePickerMonthOption extends TngDateRangePickerControllerPart {
714
+ monthGrid = inject(TngDateRangePickerMonthGrid);
715
+ controller = computed(() => this.monthGrid.controller(), ...(ngDevMode ? [{ debugName: "controller" }] : []));
716
+ option = input.required({ ...(ngDevMode ? { debugName: "option" } : {}), alias: 'tngDateRangePickerMonthOption' });
717
+ attributes = computed(() => {
718
+ this.renderVersion();
719
+ return this.controller().getOutputs().getMonthAttributes(this.option());
720
+ }, ...(ngDevMode ? [{ debugName: "attributes" }] : []));
721
+ get id() {
722
+ return this.attributes().id ?? null;
723
+ }
724
+ get role() {
725
+ return resolveAttribute(this.attributes(), 'role');
726
+ }
727
+ get tabindex() {
728
+ return resolveAttribute(this.attributes(), 'tabindex');
729
+ }
730
+ get disabled() {
731
+ return this.option().disabled;
732
+ }
733
+ get ariaDisabled() {
734
+ return resolveAttribute(this.attributes(), 'aria-disabled');
735
+ }
736
+ get ariaSelected() {
737
+ return resolveAttribute(this.attributes(), 'aria-selected');
738
+ }
739
+ get dataActive() {
740
+ return resolveAttribute(this.attributes(), 'data-active');
741
+ }
742
+ get dataDisabled() {
743
+ return resolveAttribute(this.attributes(), 'data-disabled');
744
+ }
745
+ get dataFocusVisible() {
746
+ return resolveAttribute(this.attributes(), 'data-focus-visible');
747
+ }
748
+ get dataSelected() {
749
+ return resolveAttribute(this.attributes(), 'data-selected');
750
+ }
751
+ get dataSlot() {
752
+ return resolveAttribute(this.attributes(), 'data-slot');
753
+ }
754
+ onClick() {
755
+ const option = this.option();
756
+ if (option.disabled) {
757
+ return;
758
+ }
759
+ this.controller().selectMonth(option.index);
760
+ this.controller().showDaysPanel();
761
+ this.syncOverlayFocus();
762
+ }
763
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngDateRangePickerMonthOption, deps: null, target: i0.ɵɵFactoryTarget.Directive });
764
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.1", type: TngDateRangePickerMonthOption, isStandalone: true, selector: "button[tngDateRangePickerMonthOption]", inputs: { option: { classPropertyName: "option", publicName: "tngDateRangePickerMonthOption", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "onClick()" }, properties: { "attr.id": "this.id", "attr.role": "this.role", "attr.tabindex": "this.tabindex", "disabled": "this.disabled", "attr.aria-disabled": "this.ariaDisabled", "attr.aria-selected": "this.ariaSelected", "attr.data-active": "this.dataActive", "attr.data-disabled": "this.dataDisabled", "attr.data-focus-visible": "this.dataFocusVisible", "attr.data-selected": "this.dataSelected", "attr.data-slot": "this.dataSlot" } }, exportAs: ["tngDateRangePickerMonthOption"], usesInheritance: true, ngImport: i0 });
765
+ }
766
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngDateRangePickerMonthOption, decorators: [{
767
+ type: Directive,
768
+ args: [{
769
+ selector: 'button[tngDateRangePickerMonthOption]',
770
+ exportAs: 'tngDateRangePickerMonthOption',
771
+ standalone: true,
772
+ }]
773
+ }], propDecorators: { option: [{ type: i0.Input, args: [{ isSignal: true, alias: "tngDateRangePickerMonthOption", required: true }] }], id: [{
774
+ type: HostBinding,
775
+ args: ['attr.id']
776
+ }], role: [{
777
+ type: HostBinding,
778
+ args: ['attr.role']
779
+ }], tabindex: [{
780
+ type: HostBinding,
781
+ args: ['attr.tabindex']
782
+ }], disabled: [{
783
+ type: HostBinding,
784
+ args: ['disabled']
785
+ }], ariaDisabled: [{
786
+ type: HostBinding,
787
+ args: ['attr.aria-disabled']
788
+ }], ariaSelected: [{
789
+ type: HostBinding,
790
+ args: ['attr.aria-selected']
791
+ }], dataActive: [{
792
+ type: HostBinding,
793
+ args: ['attr.data-active']
794
+ }], dataDisabled: [{
795
+ type: HostBinding,
796
+ args: ['attr.data-disabled']
797
+ }], dataFocusVisible: [{
798
+ type: HostBinding,
799
+ args: ['attr.data-focus-visible']
800
+ }], dataSelected: [{
801
+ type: HostBinding,
802
+ args: ['attr.data-selected']
803
+ }], dataSlot: [{
804
+ type: HostBinding,
805
+ args: ['attr.data-slot']
806
+ }], onClick: [{
807
+ type: HostListener,
808
+ args: ['click']
809
+ }] } });
810
+ export class TngDateRangePickerYearGrid extends TngDateRangePickerControllerPart {
811
+ controller = input.required({ ...(ngDevMode ? { debugName: "controller" } : {}), alias: 'tngDateRangePickerYearGrid' });
812
+ dataSlot = 'date-range-picker-grid';
813
+ role = 'grid';
814
+ onKeydown(event) {
815
+ this.controller().handleYearGridKeyDown(event);
816
+ if (isPickerActivationKey(event.key)) {
817
+ this.controller().showMonthsPanel();
818
+ }
819
+ if (shouldSyncOverlayFocusAfterPickerKey(event.key)) {
820
+ this.syncOverlayFocus();
821
+ }
822
+ }
823
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngDateRangePickerYearGrid, deps: null, target: i0.ɵɵFactoryTarget.Directive });
824
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.1", type: TngDateRangePickerYearGrid, isStandalone: true, selector: "[tngDateRangePickerYearGrid]", inputs: { controller: { classPropertyName: "controller", publicName: "tngDateRangePickerYearGrid", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "keydown": "onKeydown($event)" }, properties: { "attr.data-slot": "this.dataSlot", "attr.role": "this.role" } }, exportAs: ["tngDateRangePickerYearGrid"], usesInheritance: true, ngImport: i0 });
825
+ }
826
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngDateRangePickerYearGrid, decorators: [{
827
+ type: Directive,
828
+ args: [{
829
+ selector: '[tngDateRangePickerYearGrid]',
830
+ exportAs: 'tngDateRangePickerYearGrid',
831
+ standalone: true,
832
+ }]
833
+ }], propDecorators: { controller: [{ type: i0.Input, args: [{ isSignal: true, alias: "tngDateRangePickerYearGrid", required: true }] }], dataSlot: [{
834
+ type: HostBinding,
835
+ args: ['attr.data-slot']
836
+ }], role: [{
837
+ type: HostBinding,
838
+ args: ['attr.role']
839
+ }], onKeydown: [{
840
+ type: HostListener,
841
+ args: ['keydown', ['$event']]
842
+ }] } });
843
+ export class TngDateRangePickerYearOption extends TngDateRangePickerControllerPart {
844
+ yearGrid = inject(TngDateRangePickerYearGrid);
845
+ controller = computed(() => this.yearGrid.controller(), ...(ngDevMode ? [{ debugName: "controller" }] : []));
846
+ option = input.required({ ...(ngDevMode ? { debugName: "option" } : {}), alias: 'tngDateRangePickerYearOption' });
847
+ attributes = computed(() => {
848
+ this.renderVersion();
849
+ return this.controller().getOutputs().getYearAttributes(this.option());
850
+ }, ...(ngDevMode ? [{ debugName: "attributes" }] : []));
851
+ get id() {
852
+ return this.attributes().id ?? null;
853
+ }
854
+ get role() {
855
+ return resolveAttribute(this.attributes(), 'role');
856
+ }
857
+ get tabindex() {
858
+ return resolveAttribute(this.attributes(), 'tabindex');
859
+ }
860
+ get disabled() {
861
+ return this.option().disabled;
862
+ }
863
+ get ariaDisabled() {
864
+ return resolveAttribute(this.attributes(), 'aria-disabled');
865
+ }
866
+ get ariaSelected() {
867
+ return resolveAttribute(this.attributes(), 'aria-selected');
868
+ }
869
+ get dataActive() {
870
+ return resolveAttribute(this.attributes(), 'data-active');
871
+ }
872
+ get dataDisabled() {
873
+ return resolveAttribute(this.attributes(), 'data-disabled');
874
+ }
875
+ get dataFocusVisible() {
876
+ return resolveAttribute(this.attributes(), 'data-focus-visible');
877
+ }
878
+ get dataSelected() {
879
+ return resolveAttribute(this.attributes(), 'data-selected');
880
+ }
881
+ get dataSlot() {
882
+ return resolveAttribute(this.attributes(), 'data-slot');
883
+ }
884
+ onClick() {
885
+ const option = this.option();
886
+ if (option.disabled) {
887
+ return;
888
+ }
889
+ this.controller().selectYear(option.year);
890
+ this.controller().showMonthsPanel();
891
+ this.syncOverlayFocus();
892
+ }
893
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngDateRangePickerYearOption, deps: null, target: i0.ɵɵFactoryTarget.Directive });
894
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.1", type: TngDateRangePickerYearOption, isStandalone: true, selector: "button[tngDateRangePickerYearOption]", inputs: { option: { classPropertyName: "option", publicName: "tngDateRangePickerYearOption", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "onClick()" }, properties: { "attr.id": "this.id", "attr.role": "this.role", "attr.tabindex": "this.tabindex", "disabled": "this.disabled", "attr.aria-disabled": "this.ariaDisabled", "attr.aria-selected": "this.ariaSelected", "attr.data-active": "this.dataActive", "attr.data-disabled": "this.dataDisabled", "attr.data-focus-visible": "this.dataFocusVisible", "attr.data-selected": "this.dataSelected", "attr.data-slot": "this.dataSlot" } }, exportAs: ["tngDateRangePickerYearOption"], usesInheritance: true, ngImport: i0 });
895
+ }
896
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngDateRangePickerYearOption, decorators: [{
897
+ type: Directive,
898
+ args: [{
899
+ selector: 'button[tngDateRangePickerYearOption]',
900
+ exportAs: 'tngDateRangePickerYearOption',
901
+ standalone: true,
902
+ }]
903
+ }], propDecorators: { option: [{ type: i0.Input, args: [{ isSignal: true, alias: "tngDateRangePickerYearOption", required: true }] }], id: [{
904
+ type: HostBinding,
905
+ args: ['attr.id']
906
+ }], role: [{
907
+ type: HostBinding,
908
+ args: ['attr.role']
909
+ }], tabindex: [{
910
+ type: HostBinding,
911
+ args: ['attr.tabindex']
912
+ }], disabled: [{
913
+ type: HostBinding,
914
+ args: ['disabled']
915
+ }], ariaDisabled: [{
916
+ type: HostBinding,
917
+ args: ['attr.aria-disabled']
918
+ }], ariaSelected: [{
919
+ type: HostBinding,
920
+ args: ['attr.aria-selected']
921
+ }], dataActive: [{
922
+ type: HostBinding,
923
+ args: ['attr.data-active']
924
+ }], dataDisabled: [{
925
+ type: HostBinding,
926
+ args: ['attr.data-disabled']
927
+ }], dataFocusVisible: [{
928
+ type: HostBinding,
929
+ args: ['attr.data-focus-visible']
930
+ }], dataSelected: [{
931
+ type: HostBinding,
932
+ args: ['attr.data-selected']
933
+ }], dataSlot: [{
934
+ type: HostBinding,
935
+ args: ['attr.data-slot']
936
+ }], onClick: [{
937
+ type: HostListener,
938
+ args: ['click']
939
+ }] } });
940
+ //# sourceMappingURL=tng-date-range-picker.parts.js.map