@progress/kendo-angular-dateinputs 21.4.1 → 22.0.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 (141) hide show
  1. package/calendar/localization/calendar-messages.d.ts +1 -1
  2. package/calendar/localization/multiview-calendar-messages.d.ts +1 -1
  3. package/dateinput/localization/messages.d.ts +1 -1
  4. package/datepicker/localization/messages.d.ts +1 -1
  5. package/daterange/date-range-input.d.ts +1 -1
  6. package/daterange/localization/messages.d.ts +1 -1
  7. package/datetimepicker/localization/messages.d.ts +1 -1
  8. package/fesm2022/progress-kendo-angular-dateinputs.mjs +262 -262
  9. package/package.json +15 -23
  10. package/timepicker/localization/messages.d.ts +1 -1
  11. package/esm2022/calendar/calendar.component.mjs +0 -1711
  12. package/esm2022/calendar/calendar.module.mjs +0 -91
  13. package/esm2022/calendar/calendars.module.mjs +0 -87
  14. package/esm2022/calendar/footer.component.mjs +0 -77
  15. package/esm2022/calendar/for.directive.mjs +0 -116
  16. package/esm2022/calendar/header.component.mjs +0 -367
  17. package/esm2022/calendar/horizontal-view-list.component.mjs +0 -580
  18. package/esm2022/calendar/localization/calendar-custom-messages.component.mjs +0 -51
  19. package/esm2022/calendar/localization/calendar-localized-messages.directive.mjs +0 -39
  20. package/esm2022/calendar/localization/calendar-messages.mjs +0 -45
  21. package/esm2022/calendar/localization/multiview-calendar-custom-messages.component.mjs +0 -51
  22. package/esm2022/calendar/localization/multiview-calendar-localized-messages.directive.mjs +0 -39
  23. package/esm2022/calendar/localization/multiview-calendar-messages.mjs +0 -45
  24. package/esm2022/calendar/models/cell-context.interface.mjs +0 -5
  25. package/esm2022/calendar/models/navigation-action.enum.mjs +0 -20
  26. package/esm2022/calendar/models/orientation.mjs +0 -5
  27. package/esm2022/calendar/models/row-length-options.interface.mjs +0 -5
  28. package/esm2022/calendar/models/scrollable.interface.mjs +0 -5
  29. package/esm2022/calendar/models/selection-range-end.type.mjs +0 -5
  30. package/esm2022/calendar/models/selection-range.interface.mjs +0 -10
  31. package/esm2022/calendar/models/selection.mjs +0 -50
  32. package/esm2022/calendar/models/type.mjs +0 -5
  33. package/esm2022/calendar/models/view-service.interface.mjs +0 -5
  34. package/esm2022/calendar/models/view.enum.mjs +0 -16
  35. package/esm2022/calendar/models/view.type.mjs +0 -5
  36. package/esm2022/calendar/multiview-calendar.component.mjs +0 -1564
  37. package/esm2022/calendar/multiview-calendar.module.mjs +0 -89
  38. package/esm2022/calendar/navigation.component.mjs +0 -230
  39. package/esm2022/calendar/services/bus-view.service.mjs +0 -83
  40. package/esm2022/calendar/services/century-view.service.mjs +0 -219
  41. package/esm2022/calendar/services/decade-view.service.mjs +0 -217
  42. package/esm2022/calendar/services/disabled-dates.service.mjs +0 -66
  43. package/esm2022/calendar/services/dom.service.mjs +0 -203
  44. package/esm2022/calendar/services/month-view.service.mjs +0 -223
  45. package/esm2022/calendar/services/navigation.service.mjs +0 -60
  46. package/esm2022/calendar/services/scroll-sync.service.mjs +0 -89
  47. package/esm2022/calendar/services/selection.service.mjs +0 -62
  48. package/esm2022/calendar/services/weeknames.service.mjs +0 -33
  49. package/esm2022/calendar/services/year-view.service.mjs +0 -204
  50. package/esm2022/calendar/templates/cell-template.directive.mjs +0 -45
  51. package/esm2022/calendar/templates/century-cell-template.directive.mjs +0 -43
  52. package/esm2022/calendar/templates/decade-cell-template.directive.mjs +0 -43
  53. package/esm2022/calendar/templates/footer-template.directive.mjs +0 -44
  54. package/esm2022/calendar/templates/header-template.directive.mjs +0 -47
  55. package/esm2022/calendar/templates/header-title-template.directive.mjs +0 -43
  56. package/esm2022/calendar/templates/month-cell-template.directive.mjs +0 -43
  57. package/esm2022/calendar/templates/navigation-item-template.directive.mjs +0 -43
  58. package/esm2022/calendar/templates/weeknumber-cell-template.directive.mjs +0 -43
  59. package/esm2022/calendar/templates/year-cell-template.directive.mjs +0 -43
  60. package/esm2022/calendar/view-list.component.mjs +0 -497
  61. package/esm2022/calendar/view.component.mjs +0 -432
  62. package/esm2022/common/dom-queries.mjs +0 -24
  63. package/esm2022/common/models/fillmode.mjs +0 -5
  64. package/esm2022/common/models/rounded.mjs +0 -5
  65. package/esm2022/common/models/size.mjs +0 -5
  66. package/esm2022/common/models/week-days-format.mjs +0 -5
  67. package/esm2022/common/picker.service.mjs +0 -17
  68. package/esm2022/common/utils.mjs +0 -70
  69. package/esm2022/dateinput/arrow.enum.mjs +0 -13
  70. package/esm2022/dateinput/dateinput.component.mjs +0 -1196
  71. package/esm2022/dateinput/dateinput.module.mjs +0 -45
  72. package/esm2022/dateinput/localization/dateinput-custom-messages.component.mjs +0 -60
  73. package/esm2022/dateinput/localization/dateinput-localized-messages.directive.mjs +0 -39
  74. package/esm2022/dateinput/localization/messages.mjs +0 -39
  75. package/esm2022/dateinput/models/format-placeholder.model.mjs +0 -5
  76. package/esm2022/dateinput/models/format-settings.model.mjs +0 -5
  77. package/esm2022/dateinput/models/incremental-steps.model.mjs +0 -5
  78. package/esm2022/dateinputs.module.mjs +0 -136
  79. package/esm2022/datepicker/datepicker.component.mjs +0 -1758
  80. package/esm2022/datepicker/datepicker.module.mjs +0 -83
  81. package/esm2022/datepicker/localization/datepicker-custom-messages.component.mjs +0 -53
  82. package/esm2022/datepicker/localization/datepicker-localized-messages.directive.mjs +0 -39
  83. package/esm2022/datepicker/localization/messages.mjs +0 -63
  84. package/esm2022/daterange/auto-correct-on.type.mjs +0 -5
  85. package/esm2022/daterange/date-range-end-input.directive.mjs +0 -105
  86. package/esm2022/daterange/date-range-input.mjs +0 -138
  87. package/esm2022/daterange/date-range-popup-template.directive.mjs +0 -36
  88. package/esm2022/daterange/date-range-popup.component.mjs +0 -1051
  89. package/esm2022/daterange/date-range-selection.directive.mjs +0 -223
  90. package/esm2022/daterange/date-range-start-input.directive.mjs +0 -109
  91. package/esm2022/daterange/date-range.component.mjs +0 -116
  92. package/esm2022/daterange/date-range.module.mjs +0 -103
  93. package/esm2022/daterange/date-range.service.mjs +0 -225
  94. package/esm2022/daterange/localization/daterange-popup-custom-messages.component.mjs +0 -43
  95. package/esm2022/daterange/localization/daterange-popup-localized-messages.directive.mjs +0 -39
  96. package/esm2022/daterange/localization/messages.mjs +0 -51
  97. package/esm2022/datetimepicker/datetimepicker.component.mjs +0 -2505
  98. package/esm2022/datetimepicker/datetimepicker.module.mjs +0 -106
  99. package/esm2022/datetimepicker/localization/datetimepicker-custom-messages.component.mjs +0 -52
  100. package/esm2022/datetimepicker/localization/localized-messages.directive.mjs +0 -39
  101. package/esm2022/datetimepicker/localization/messages.mjs +0 -153
  102. package/esm2022/datetimepicker/models/active-tab.type.mjs +0 -5
  103. package/esm2022/defaults.mjs +0 -24
  104. package/esm2022/directives.mjs +0 -146
  105. package/esm2022/index.mjs +0 -78
  106. package/esm2022/package-metadata.mjs +0 -16
  107. package/esm2022/popup-settings.model.mjs +0 -5
  108. package/esm2022/preventable-event.mjs +0 -27
  109. package/esm2022/progress-kendo-angular-dateinputs.mjs +0 -8
  110. package/esm2022/timepicker/localization/messages.mjs +0 -105
  111. package/esm2022/timepicker/localization/timepicker-custom-messages.component.mjs +0 -54
  112. package/esm2022/timepicker/localization/timepicker-localized-messages.directive.mjs +0 -39
  113. package/esm2022/timepicker/localization/timeselector-custom-messages.component.mjs +0 -45
  114. package/esm2022/timepicker/localization/timeselector-localized-messages.directive.mjs +0 -39
  115. package/esm2022/timepicker/models/incremental-steps.model.mjs +0 -5
  116. package/esm2022/timepicker/models/list-item.interface.mjs +0 -5
  117. package/esm2022/timepicker/models/list-service-settings.mjs +0 -5
  118. package/esm2022/timepicker/models/list-service.interface.mjs +0 -5
  119. package/esm2022/timepicker/models/time-part.default.mjs +0 -14
  120. package/esm2022/timepicker/services/dayperiod.service.mjs +0 -131
  121. package/esm2022/timepicker/services/dom.service.mjs +0 -126
  122. package/esm2022/timepicker/services/hours.service.mjs +0 -130
  123. package/esm2022/timepicker/services/milliseconds.service.mjs +0 -131
  124. package/esm2022/timepicker/services/minutes.service.mjs +0 -128
  125. package/esm2022/timepicker/services/seconds.service.mjs +0 -128
  126. package/esm2022/timepicker/timelist.component.mjs +0 -388
  127. package/esm2022/timepicker/timepicker.component.mjs +0 -1598
  128. package/esm2022/timepicker/timepicker.module.mjs +0 -71
  129. package/esm2022/timepicker/timeselector.component.mjs +0 -728
  130. package/esm2022/timepicker/util.mjs +0 -70
  131. package/esm2022/util.mjs +0 -406
  132. package/esm2022/validators/disabled-date.validator.mjs +0 -18
  133. package/esm2022/validators/disabled-dates-range.validator.mjs +0 -26
  134. package/esm2022/validators/incomplete-date.validator.mjs +0 -18
  135. package/esm2022/validators/max.validator.mjs +0 -21
  136. package/esm2022/validators/min.validator.mjs +0 -21
  137. package/esm2022/validators/time-range.validator.mjs +0 -23
  138. package/esm2022/virtualization/models/scrollable.interface.mjs +0 -5
  139. package/esm2022/virtualization/services/row-height.service.mjs +0 -73
  140. package/esm2022/virtualization/services/scroller.service.mjs +0 -109
  141. package/esm2022/virtualization/virtualization.component.mjs +0 -324
@@ -1,728 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { Component, ChangeDetectorRef, ChangeDetectionStrategy, ElementRef, EventEmitter, HostBinding, Input, Output, NgZone, ViewChild, ViewChildren, QueryList, Optional, Renderer2 } from '@angular/core';
6
- import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
7
- import { IntlService } from '@progress/kendo-angular-intl';
8
- import { cloneDate, getDate } from '@progress/kendo-date-math';
9
- import { Keys, EventsOutsideAngularDirective, normalizeKeys } from '@progress/kendo-angular-common';
10
- import { MIDNIGHT_DATE, MIN_TIME, MAX_TIME } from '../defaults';
11
- import { TimeListComponent } from './timelist.component';
12
- import { TimePickerDOMService } from './services/dom.service';
13
- import { getNow, hasChange, isInTimeRange, timeInRange } from '../util';
14
- import { generateGetters, generateSnappers, snapTime, valueMerger } from './util';
15
- import { PickerService } from '../common/picker.service';
16
- import { closest } from '../common/dom-queries';
17
- import { currentFocusTarget, isPresent } from '../common/utils';
18
- import { TimeSelectorLocalizedMessagesDirective } from './localization/timeselector-localized-messages.directive';
19
- import * as i0 from "@angular/core";
20
- import * as i1 from "@progress/kendo-angular-l10n";
21
- import * as i2 from "@progress/kendo-angular-intl";
22
- import * as i3 from "./services/dom.service";
23
- import * as i4 from "../common/picker.service";
24
- const listReducer = (state, list, idx, all) => {
25
- if (state.length || !list.isActive) {
26
- return state;
27
- }
28
- return [{
29
- next: all[idx + 1] || list,
30
- prev: all[idx - 1] || list
31
- }];
32
- };
33
- var Direction;
34
- (function (Direction) {
35
- Direction[Direction["Left"] = 0] = "Left";
36
- Direction[Direction["Right"] = 1] = "Right";
37
- })(Direction || (Direction = {}));
38
- /**
39
- * @hidden
40
- *
41
- * Represents the Kendo UI TimeSelector component for Angular.
42
- */
43
- export class TimeSelectorComponent {
44
- localization;
45
- cdr;
46
- element;
47
- intl;
48
- dom;
49
- zone;
50
- renderer;
51
- pickerService;
52
- accept;
53
- cancel;
54
- now;
55
- timeLists;
56
- timeListWrappers;
57
- /**
58
- * @hidden
59
- */
60
- get disabledClass() {
61
- return this.disabled;
62
- }
63
- /**
64
- * Specifies the time format that displays the time list columns.
65
- *
66
- * @default 't'
67
- */
68
- format = 't';
69
- /**
70
- * Sets the smallest valid time value.
71
- */
72
- min = cloneDate(MIN_TIME);
73
- /**
74
- * Sets the largest valid time value.
75
- */
76
- max = cloneDate(MAX_TIME);
77
- /**
78
- * Controls the display of the **Cancel** button in the popup.
79
- *
80
- * @default true
81
- */
82
- cancelButton = true;
83
- /**
84
- * Controls the display of the **Set** button in the popup.
85
- *
86
- * @default true
87
- */
88
- setButton = true;
89
- /**
90
- * Controls the display of the **Now** button in the popup.
91
- *
92
- * When the current time is out of range or the incremental step is greater than `1`, the **Now** button is hidden.
93
- *
94
- * @default true
95
- */
96
- nowButton = true;
97
- /**
98
- * Sets the `disabled` property of the `TimeSelector` and controls whether the component is active.
99
- *
100
- * @default false
101
- */
102
- disabled = false;
103
- /**
104
- * Sets the adaptive mode for the component.
105
- * Use this property to enable proper height calculation in the DOM service.
106
- */
107
- isAdaptiveEnabled;
108
- /**
109
- * Specifies whether the component is used as part of a DateTimePicker.
110
- */
111
- isDateTimePicker;
112
- /**
113
- * Configures the incremental steps of the TimeSelector.
114
- *
115
- * When the incremental step is greater than `1`, the **Now** button is hidden.
116
- */
117
- set steps(steps) {
118
- this._steps = steps || {};
119
- }
120
- get steps() {
121
- return this._steps;
122
- }
123
- /**
124
- * Specifies the value of the TimeSelector component.
125
- */
126
- value = null;
127
- /**
128
- * Fires each time the user selects a new value.
129
- */
130
- valueChange = new EventEmitter();
131
- /**
132
- * Fires each time the user cancels the selected value.
133
- */
134
- valueReject = new EventEmitter();
135
- tabOutLastPart = new EventEmitter();
136
- tabOutFirstPart = new EventEmitter();
137
- tabOutNow = new EventEmitter();
138
- dateFormatParts;
139
- isActive = false;
140
- showNowButton = true;
141
- set current(value) {
142
- this._current = timeInRange(this.snapTime(cloneDate(value || MIDNIGHT_DATE), this.min), this.min, this.max);
143
- if (!NgZone.isInAngularZone()) {
144
- this.cdr.detectChanges();
145
- }
146
- }
147
- get current() {
148
- return this._current;
149
- }
150
- get activeListIndex() {
151
- return this._activeListIndex;
152
- }
153
- set activeListIndex(value) {
154
- this._activeListIndex = value;
155
- if (!this.timeListWrappers || !this.timeListWrappers.length) {
156
- return;
157
- }
158
- this.timeListWrappers.forEach(listWrapper => {
159
- this.renderer.removeClass(listWrapper.nativeElement, 'k-focus');
160
- });
161
- if (value >= 0) {
162
- const listIndex = this.listIndex(value);
163
- const focusedWrapper = this.timeListWrappers.toArray()[listIndex];
164
- if (focusedWrapper) {
165
- this.renderer.addClass(focusedWrapper.nativeElement, 'k-focus');
166
- }
167
- }
168
- }
169
- mergeValue;
170
- snapTime;
171
- _activeListIndex = -1;
172
- _current;
173
- _steps = {};
174
- subscriptions;
175
- domEvents = [];
176
- constructor(localization, cdr, element, intl, dom, zone, renderer, pickerService) {
177
- this.localization = localization;
178
- this.cdr = cdr;
179
- this.element = element;
180
- this.intl = intl;
181
- this.dom = dom;
182
- this.zone = zone;
183
- this.renderer = renderer;
184
- this.pickerService = pickerService;
185
- if (this.pickerService) {
186
- this.pickerService.timeSelector = this;
187
- }
188
- }
189
- /**
190
- * @hidden
191
- */
192
- ngOnInit() {
193
- this.subscriptions = this.intl.changes.subscribe(this.intlChange.bind(this));
194
- if (this.localization) {
195
- this.subscriptions.add(this.localization
196
- .changes
197
- .subscribe(() => this.cdr.markForCheck()));
198
- }
199
- this.renderer.addClass(this.element.nativeElement, 'k-timeselector');
200
- this.dom.isAdaptiveEnabled = this.isAdaptiveEnabled;
201
- this.dom.isDateTimePicker = this.isDateTimePicker;
202
- this.dom.calculateHeights(this.element.nativeElement);
203
- this.init();
204
- this.bindEvents();
205
- }
206
- /**
207
- * @hidden
208
- */
209
- ngOnChanges() {
210
- this.init();
211
- }
212
- ngOnDestroy() {
213
- if (this.subscriptions) {
214
- this.subscriptions.unsubscribe();
215
- }
216
- if (this.pickerService) {
217
- this.pickerService.timeSelector = null;
218
- }
219
- this.domEvents.forEach(unbindCallback => unbindCallback());
220
- }
221
- /**
222
- * Focuses the TimeSelector component.
223
- */
224
- focus() {
225
- const list = this.timeLists.first;
226
- if (!list) {
227
- return;
228
- }
229
- list.focus();
230
- }
231
- /**
232
- * Blurs the TimeSelector component.
233
- */
234
- blur() {
235
- const list = this.timeLists.first;
236
- if (!list) {
237
- return;
238
- }
239
- list.blur();
240
- }
241
- /**
242
- * @hidden
243
- */
244
- handleAccept() {
245
- this.handleChange(this.mergeValue(cloneDate(this.value || getDate(getNow())), this.current));
246
- }
247
- /**
248
- * @hidden
249
- */
250
- handleNow() {
251
- this.current = getNow();
252
- this.handleChange(this.current);
253
- this.cdr.markForCheck();
254
- }
255
- /**
256
- * @hidden
257
- */
258
- handleReject() {
259
- this.current = this.value;
260
- this.valueReject.emit();
261
- }
262
- /**
263
- * @hidden
264
- */
265
- handleFocus(args) {
266
- if (this.isActive) {
267
- return;
268
- }
269
- this.isActive = true;
270
- this.emitFocus(args);
271
- }
272
- /**
273
- * @hidden
274
- */
275
- handleListFocus(args) {
276
- const index = parseInt(args.target.getAttribute('data-timelist-index'), 10);
277
- this.activeListIndex = index;
278
- this.handleFocus(args);
279
- }
280
- /**
281
- * @hidden
282
- */
283
- handleBlur(args) {
284
- const currentTarget = currentFocusTarget(args);
285
- if (currentTarget && this.containsElement(currentTarget)) {
286
- return;
287
- }
288
- this.activeListIndex = -1;
289
- this.isActive = false;
290
- this.emitBlur(args);
291
- }
292
- /**
293
- * @hidden
294
- */
295
- containsElement(element) {
296
- return Boolean(closest(element, node => node === this.element.nativeElement));
297
- }
298
- /**
299
- * @hidden
300
- */
301
- handleTabOut(event) {
302
- const { code, shiftKey } = event;
303
- if (event.target === this.now?.nativeElement && code === Keys.Tab && shiftKey) {
304
- event.preventDefault();
305
- if (this.isDateTimePicker) {
306
- this.tabOutNow.emit();
307
- }
308
- else {
309
- this.cancel ? this.cancel.nativeElement.focus() : this.accept?.nativeElement.focus();
310
- }
311
- return;
312
- }
313
- if (code === Keys.Tab && !shiftKey && event.target !== this.now?.nativeElement) {
314
- event.preventDefault();
315
- if (document.activeElement === this.accept.nativeElement) {
316
- if (this.cancel) {
317
- this.cancel.nativeElement.focus();
318
- }
319
- else {
320
- this.now ? this.now.nativeElement.focus() : this.timeLists.first.focus();
321
- }
322
- }
323
- else {
324
- this.now ? this.now.nativeElement.focus() : this.timeLists.first.focus();
325
- }
326
- }
327
- }
328
- partStep(part) {
329
- return this.steps[part.type] || 1;
330
- }
331
- init(changes) {
332
- if (!changes || hasChange(changes, 'format')) {
333
- this.dateFormatParts = this.intl.splitDateFormat(this.format);
334
- this.mergeValue = valueMerger(generateGetters(this.dateFormatParts));
335
- }
336
- if (!changes || hasChange(changes, 'steps')) {
337
- this.snapTime = snapTime(generateSnappers(this.steps));
338
- }
339
- if (!changes || hasChange(changes, 'value')) {
340
- this.current = this.value;
341
- }
342
- this.showNowButton = !this.hasSteps() && this.nowButton && isInTimeRange(getNow(), this.min, this.max);
343
- }
344
- focusList(dir) {
345
- if (!this.timeLists.length) {
346
- return;
347
- }
348
- this.timeLists.reduce(listReducer, [])
349
- .map(state => dir === Direction.Right ? state.next : state.prev)
350
- .map(list => list && list.focus());
351
- }
352
- handleChange(value) {
353
- this.value = value;
354
- this.valueChange.emit(cloneDate(value));
355
- }
356
- hasActiveButton() {
357
- if (!this.accept) {
358
- return false;
359
- }
360
- return [this.accept, this.cancel, this.now].reduce((isActive, el) => isActive || this.dom.isActive(el), false);
361
- }
362
- hasSteps() {
363
- const keys = Object.keys(this.steps);
364
- return keys.length !== keys.reduce((acc, k) => acc + this.steps[k], 0);
365
- }
366
- intlChange() {
367
- this.dateFormatParts = this.intl.splitDateFormat(this.format);
368
- this.mergeValue = valueMerger(generateGetters(this.dateFormatParts));
369
- this.cdr.markForCheck();
370
- }
371
- bindEvents() {
372
- if (this.element) {
373
- this.zone.runOutsideAngular(() => {
374
- this.domEvents.push(this.renderer.listen(this.element.nativeElement, 'keydown', this.handleKeydown.bind(this)));
375
- });
376
- }
377
- }
378
- handleKeydown(args) {
379
- const { altKey } = args;
380
- const code = normalizeKeys(args);
381
- // reserve the alt + arrow key commands for the picker
382
- const arrowKeyPressed = [Keys.ArrowLeft, Keys.ArrowRight].indexOf(code) !== -1;
383
- if (isPresent(this.pickerService) && arrowKeyPressed && altKey) {
384
- return;
385
- }
386
- if (code === Keys.Enter && !this.hasActiveButton()) {
387
- this.handleAccept();
388
- }
389
- else if (code === Keys.ArrowLeft || code === Keys.ArrowRight) {
390
- this.focusList(code === Keys.ArrowLeft ? Direction.Left : Direction.Right);
391
- }
392
- }
393
- emitBlur(args) {
394
- if (this.pickerService) {
395
- this.pickerService.onBlur.emit(args);
396
- }
397
- }
398
- emitFocus(args) {
399
- if (this.pickerService) {
400
- this.pickerService.onFocus.emit(args);
401
- }
402
- }
403
- listIndex(partIndex) {
404
- let listIdx = 0;
405
- let partIdx = 0;
406
- while (partIdx < partIndex) {
407
- if (this.dateFormatParts[partIdx].type !== 'literal') {
408
- listIdx++;
409
- }
410
- partIdx++;
411
- }
412
- return listIdx;
413
- }
414
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TimeSelectorComponent, deps: [{ token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i2.IntlService }, { token: i3.TimePickerDOMService }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i4.PickerService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
415
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: TimeSelectorComponent, isStandalone: true, selector: "kendo-timeselector", inputs: { format: "format", min: "min", max: "max", cancelButton: "cancelButton", setButton: "setButton", nowButton: "nowButton", disabled: "disabled", isAdaptiveEnabled: "isAdaptiveEnabled", isDateTimePicker: "isDateTimePicker", steps: "steps", value: "value" }, outputs: { valueChange: "valueChange", valueReject: "valueReject", tabOutLastPart: "tabOutLastPart", tabOutFirstPart: "tabOutFirstPart", tabOutNow: "tabOutNow" }, host: { properties: { "class.k-disabled": "this.disabledClass" } }, providers: [
416
- LocalizationService,
417
- {
418
- provide: L10N_PREFIX,
419
- useValue: 'kendo.timeselector'
420
- }
421
- ], viewQueries: [{ propertyName: "accept", first: true, predicate: ["accept"], descendants: true }, { propertyName: "cancel", first: true, predicate: ["cancel"], descendants: true }, { propertyName: "now", first: true, predicate: ["now"], descendants: true }, { propertyName: "timeLists", predicate: TimeListComponent, descendants: true }, { propertyName: "timeListWrappers", predicate: ["listWrapper"], descendants: true }], exportAs: ["kendo-timeselector"], usesOnChanges: true, ngImport: i0, template: `
422
- <ng-container kendoTimeSelectorLocalizedMessages
423
- i18n-accept="kendo.timeselector.accept|The Accept button text in the timeselector component"
424
- accept="Set"
425
-
426
- i18n-acceptLabel="kendo.timeselector.acceptLabel|The label for the Accept button in the timeselector component"
427
- acceptLabel="Set time"
428
-
429
- i18n-cancel="kendo.timeselector.cancel|The Cancel button text in the timeselector component"
430
- cancel="Cancel"
431
-
432
- i18n-cancelLabel="kendo.timeselector.cancelLabel|The label for the Cancel button in the timeselector component"
433
- cancelLabel="Cancel changes"
434
-
435
- i18n-now="kendo.timeselector.now|The Now button text in the timeselector component"
436
- now="Now"
437
-
438
- i18n-nowLabel="kendo.timeselector.nowLabel|The label for the Now button in the timeselector component"
439
- nowLabel="Select now"
440
- >
441
- </ng-container>
442
- <div class="k-time-header">
443
- <span class="k-title k-timeselector-title">
444
- {{ intl.formatDate(current, format) }}
445
- </span>
446
- @if (showNowButton) {
447
- <button
448
- #now
449
- type="button"
450
- class="k-button k-button-md k-rounded-md k-button-flat k-button-flat-primary k-time-now"
451
- [attr.title]="localization.get('nowLabel')"
452
- [attr.aria-label]="localization.get('nowLabel')"
453
- [kendoEventsOutsideAngular]="{
454
- click: handleNow,
455
- focus: handleFocus,
456
- blur: handleBlur,
457
- keydown: handleTabOut
458
- }"
459
- [scope]="this"
460
- [disabled]="disabled"
461
- >{{localization.get('now')}}</button>
462
- }
463
- </div>
464
- <div class="k-time-list-container">
465
- <span class="k-time-highlight"></span>
466
- @for (part of dateFormatParts; track $index; let idx = $index) {
467
- @if (part.type !== 'literal') {
468
- <div
469
- #listWrapper
470
- class="k-time-list-wrapper"
471
- role="presentation" tabindex="-1"
472
- >
473
- <span class="k-title k-timeselector-title">{{intl.dateFieldName(part)}}</span>
474
- <kendo-timelist
475
- [isLast]="idx === dateFormatParts.length - 1"
476
- [isFirst]="idx === 0"
477
- [min]="min"
478
- [max]="max"
479
- [part]="part"
480
- [step]="partStep(part)"
481
- [disabled]="disabled"
482
- [(value)]="current"
483
- (tabOutLastPart)="tabOutLastPart.emit()"
484
- (tabOutFirstPart)="tabOutFirstPart.emit()"
485
- [kendoEventsOutsideAngular]="{
486
- focus: handleListFocus,
487
- blur: handleBlur
488
- }"
489
- [scope]="this"
490
- [attr.data-timelist-index]="idx"
491
- ></kendo-timelist>
492
- </div>
493
- }
494
- @if (part.type === 'literal') {
495
- <div class="k-time-separator">
496
- {{part.pattern}}
497
- </div>
498
- }
499
- }
500
- </div>
501
- @if (setButton || cancelButton) {
502
- <div class="k-time-footer k-actions k-actions-stretched k-actions-horizontal">
503
- @if (setButton) {
504
- <button
505
- #accept
506
- type="button"
507
- class="k-button k-time-accept k-button-md k-rounded-md k-button-solid k-button-solid-primary"
508
- [attr.title]="localization.get('acceptLabel')"
509
- [attr.aria-label]="localization.get('acceptLabel')"
510
- [kendoEventsOutsideAngular]="{
511
- click: handleAccept,
512
- focus: handleFocus,
513
- blur: handleBlur,
514
- keydown: handleTabOut
515
- }"
516
- [scope]="this"
517
- [disabled]="disabled"
518
- >{{localization.get('accept')}}</button>
519
- }
520
- @if (cancelButton) {
521
- <button
522
- #cancel
523
- class="k-button k-time-cancel k-button-md k-rounded-md k-button-solid k-button-solid-base"
524
- type="button"
525
- [attr.title]="localization.get('cancelLabel')"
526
- [attr.aria-label]="localization.get('cancelLabel')"
527
- [kendoEventsOutsideAngular]="{
528
- click: handleReject,
529
- focus: handleFocus,
530
- blur: handleBlur,
531
- keydown: handleTabOut
532
- }"
533
- [scope]="this"
534
- [disabled]="disabled"
535
- >{{localization.get('cancel')}}</button>
536
- }
537
- </div>
538
- }
539
- `, isInline: true, dependencies: [{ kind: "directive", type: TimeSelectorLocalizedMessagesDirective, selector: "[kendoTimeSelectorLocalizedMessages]" }, { kind: "directive", type: EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { kind: "component", type: TimeListComponent, selector: "kendo-timelist", inputs: ["min", "max", "part", "step", "disabled", "value", "isLast", "isFirst"], outputs: ["valueChange", "tabOutLastPart", "tabOutFirstPart"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
540
- }
541
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TimeSelectorComponent, decorators: [{
542
- type: Component,
543
- args: [{
544
- changeDetection: ChangeDetectionStrategy.OnPush,
545
- exportAs: 'kendo-timeselector',
546
- providers: [
547
- LocalizationService,
548
- {
549
- provide: L10N_PREFIX,
550
- useValue: 'kendo.timeselector'
551
- }
552
- ],
553
- selector: 'kendo-timeselector',
554
- template: `
555
- <ng-container kendoTimeSelectorLocalizedMessages
556
- i18n-accept="kendo.timeselector.accept|The Accept button text in the timeselector component"
557
- accept="Set"
558
-
559
- i18n-acceptLabel="kendo.timeselector.acceptLabel|The label for the Accept button in the timeselector component"
560
- acceptLabel="Set time"
561
-
562
- i18n-cancel="kendo.timeselector.cancel|The Cancel button text in the timeselector component"
563
- cancel="Cancel"
564
-
565
- i18n-cancelLabel="kendo.timeselector.cancelLabel|The label for the Cancel button in the timeselector component"
566
- cancelLabel="Cancel changes"
567
-
568
- i18n-now="kendo.timeselector.now|The Now button text in the timeselector component"
569
- now="Now"
570
-
571
- i18n-nowLabel="kendo.timeselector.nowLabel|The label for the Now button in the timeselector component"
572
- nowLabel="Select now"
573
- >
574
- </ng-container>
575
- <div class="k-time-header">
576
- <span class="k-title k-timeselector-title">
577
- {{ intl.formatDate(current, format) }}
578
- </span>
579
- @if (showNowButton) {
580
- <button
581
- #now
582
- type="button"
583
- class="k-button k-button-md k-rounded-md k-button-flat k-button-flat-primary k-time-now"
584
- [attr.title]="localization.get('nowLabel')"
585
- [attr.aria-label]="localization.get('nowLabel')"
586
- [kendoEventsOutsideAngular]="{
587
- click: handleNow,
588
- focus: handleFocus,
589
- blur: handleBlur,
590
- keydown: handleTabOut
591
- }"
592
- [scope]="this"
593
- [disabled]="disabled"
594
- >{{localization.get('now')}}</button>
595
- }
596
- </div>
597
- <div class="k-time-list-container">
598
- <span class="k-time-highlight"></span>
599
- @for (part of dateFormatParts; track $index; let idx = $index) {
600
- @if (part.type !== 'literal') {
601
- <div
602
- #listWrapper
603
- class="k-time-list-wrapper"
604
- role="presentation" tabindex="-1"
605
- >
606
- <span class="k-title k-timeselector-title">{{intl.dateFieldName(part)}}</span>
607
- <kendo-timelist
608
- [isLast]="idx === dateFormatParts.length - 1"
609
- [isFirst]="idx === 0"
610
- [min]="min"
611
- [max]="max"
612
- [part]="part"
613
- [step]="partStep(part)"
614
- [disabled]="disabled"
615
- [(value)]="current"
616
- (tabOutLastPart)="tabOutLastPart.emit()"
617
- (tabOutFirstPart)="tabOutFirstPart.emit()"
618
- [kendoEventsOutsideAngular]="{
619
- focus: handleListFocus,
620
- blur: handleBlur
621
- }"
622
- [scope]="this"
623
- [attr.data-timelist-index]="idx"
624
- ></kendo-timelist>
625
- </div>
626
- }
627
- @if (part.type === 'literal') {
628
- <div class="k-time-separator">
629
- {{part.pattern}}
630
- </div>
631
- }
632
- }
633
- </div>
634
- @if (setButton || cancelButton) {
635
- <div class="k-time-footer k-actions k-actions-stretched k-actions-horizontal">
636
- @if (setButton) {
637
- <button
638
- #accept
639
- type="button"
640
- class="k-button k-time-accept k-button-md k-rounded-md k-button-solid k-button-solid-primary"
641
- [attr.title]="localization.get('acceptLabel')"
642
- [attr.aria-label]="localization.get('acceptLabel')"
643
- [kendoEventsOutsideAngular]="{
644
- click: handleAccept,
645
- focus: handleFocus,
646
- blur: handleBlur,
647
- keydown: handleTabOut
648
- }"
649
- [scope]="this"
650
- [disabled]="disabled"
651
- >{{localization.get('accept')}}</button>
652
- }
653
- @if (cancelButton) {
654
- <button
655
- #cancel
656
- class="k-button k-time-cancel k-button-md k-rounded-md k-button-solid k-button-solid-base"
657
- type="button"
658
- [attr.title]="localization.get('cancelLabel')"
659
- [attr.aria-label]="localization.get('cancelLabel')"
660
- [kendoEventsOutsideAngular]="{
661
- click: handleReject,
662
- focus: handleFocus,
663
- blur: handleBlur,
664
- keydown: handleTabOut
665
- }"
666
- [scope]="this"
667
- [disabled]="disabled"
668
- >{{localization.get('cancel')}}</button>
669
- }
670
- </div>
671
- }
672
- `,
673
- standalone: true,
674
- imports: [TimeSelectorLocalizedMessagesDirective, EventsOutsideAngularDirective, TimeListComponent]
675
- }]
676
- }], ctorParameters: () => [{ type: i1.LocalizationService }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i2.IntlService }, { type: i3.TimePickerDOMService }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: i4.PickerService, decorators: [{
677
- type: Optional
678
- }] }], propDecorators: { accept: [{
679
- type: ViewChild,
680
- args: ['accept', { static: false }]
681
- }], cancel: [{
682
- type: ViewChild,
683
- args: ['cancel', { static: false }]
684
- }], now: [{
685
- type: ViewChild,
686
- args: ['now', { static: false }]
687
- }], timeLists: [{
688
- type: ViewChildren,
689
- args: [TimeListComponent]
690
- }], timeListWrappers: [{
691
- type: ViewChildren,
692
- args: ['listWrapper']
693
- }], disabledClass: [{
694
- type: HostBinding,
695
- args: ['class.k-disabled']
696
- }], format: [{
697
- type: Input
698
- }], min: [{
699
- type: Input
700
- }], max: [{
701
- type: Input
702
- }], cancelButton: [{
703
- type: Input
704
- }], setButton: [{
705
- type: Input
706
- }], nowButton: [{
707
- type: Input
708
- }], disabled: [{
709
- type: Input
710
- }], isAdaptiveEnabled: [{
711
- type: Input
712
- }], isDateTimePicker: [{
713
- type: Input
714
- }], steps: [{
715
- type: Input
716
- }], value: [{
717
- type: Input
718
- }], valueChange: [{
719
- type: Output
720
- }], valueReject: [{
721
- type: Output
722
- }], tabOutLastPart: [{
723
- type: Output
724
- }], tabOutFirstPart: [{
725
- type: Output
726
- }], tabOutNow: [{
727
- type: Output
728
- }] } });