@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,2505 +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, HostBinding, ViewChild, ElementRef, Input, isDevMode, TemplateRef, ChangeDetectorRef, Output, EventEmitter, NgZone, ViewContainerRef, forwardRef, ContentChild, ChangeDetectionStrategy, Renderer2, Injector, } from '@angular/core';
6
- import { NG_VALUE_ACCESSOR, NG_VALIDATORS, NgControl } from '@angular/forms';
7
- import { Subscription, fromEvent } from 'rxjs';
8
- import { tap } from 'rxjs/operators';
9
- import { cloneDate, isEqual, getDate } from '@progress/kendo-date-math';
10
- import { PopupService } from '@progress/kendo-angular-popup';
11
- import { IntlService } from '@progress/kendo-angular-intl';
12
- import { hasObservers, isControlRequired, KendoInput, Keys, MultiTabStop, ResizeSensorComponent, EventsOutsideAngularDirective, normalizeKeys, parseCSSClassNames } from '@progress/kendo-angular-common';
13
- import { AdaptiveService } from '@progress/kendo-angular-utils';
14
- import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
15
- import { validatePackage } from '@progress/kendo-licensing';
16
- import { packageMetadata } from '../package-metadata';
17
- import { PickerService } from '../common/picker.service';
18
- import { DisabledDatesService } from '../calendar/services/disabled-dates.service';
19
- import { attributeNames, isPresent } from '../common/utils';
20
- import { mergeDateAndTime, noop, lastMillisecondOfDate, isInRange, isValidRange, isWindowAvailable, getFillModeClass, getRoundedClass, getSizeClass, DEFAULT_FILL_MODE, DEFAULT_ROUNDED, DEFAULT_SIZE } from '../util';
21
- import { CalendarComponent } from '../calendar/calendar.component';
22
- import { TimeSelectorComponent } from '../timepicker/timeselector.component';
23
- import { DateInputComponent } from '../dateinput/dateinput.component';
24
- import { PreventableEvent } from '../preventable-event';
25
- import { minValidator } from '../validators/min.validator';
26
- import { maxValidator } from '../validators/max.validator';
27
- import { disabledDatesValidator } from '../validators/disabled-date.validator';
28
- import { TIME_PART } from '../timepicker/models/time-part.default';
29
- import { MIN_DATE, MAX_DATE, MIN_TIME, MAX_TIME } from '../defaults';
30
- import { CellTemplateDirective } from '../calendar/templates/cell-template.directive';
31
- import { MonthCellTemplateDirective } from '../calendar/templates/month-cell-template.directive';
32
- import { YearCellTemplateDirective } from '../calendar/templates/year-cell-template.directive';
33
- import { DecadeCellTemplateDirective } from '../calendar/templates/decade-cell-template.directive';
34
- import { CenturyCellTemplateDirective } from '../calendar/templates/century-cell-template.directive';
35
- import { WeekNumberCellTemplateDirective } from '../calendar/templates/weeknumber-cell-template.directive';
36
- import { HeaderTitleTemplateDirective } from '../calendar/templates/header-title-template.directive';
37
- import { incompleteDateValidator } from '../validators/incomplete-date.validator';
38
- import { calendarIcon, clockIcon, checkIcon } from '@progress/kendo-svg-icons';
39
- import { ActionSheetComponent, ActionSheetTemplateDirective } from '@progress/kendo-angular-navigation';
40
- import { HeaderTemplateDirective } from '../calendar/templates/header-template.directive';
41
- import { FooterTemplateDirective } from '../calendar/templates/footer-template.directive';
42
- import { TimeSelectorCustomMessagesComponent } from '../timepicker/localization/timeselector-custom-messages.component';
43
- import { CalendarCustomMessagesComponent } from '../calendar/localization/calendar-custom-messages.component';
44
- import { ButtonComponent } from '@progress/kendo-angular-buttons';
45
- import { IconWrapperComponent } from '@progress/kendo-angular-icons';
46
- import { NgTemplateOutlet, NgClass } from '@angular/common';
47
- import { DateInputCustomMessagesComponent } from '../dateinput/localization/dateinput-custom-messages.component';
48
- import { LocalizedMessagesDirective } from './localization/localized-messages.directive';
49
- import { touchEnabled } from '@progress/kendo-common';
50
- import * as i0 from "@angular/core";
51
- import * as i1 from "@progress/kendo-angular-popup";
52
- import * as i2 from "@progress/kendo-angular-intl";
53
- import * as i3 from "../common/picker.service";
54
- import * as i4 from "@progress/kendo-angular-l10n";
55
- import * as i5 from "../calendar/services/disabled-dates.service";
56
- import * as i6 from "@progress/kendo-angular-utils";
57
- const timeFormatRegExp = new RegExp(`${TIME_PART.hour}|${TIME_PART.minute}|${TIME_PART.second}|${TIME_PART.dayperiod}|literal`);
58
- const VALUE_DOC_LINK = 'https://www.telerik.com/kendo-angular-ui/components/dateinputs/datetimepicker/integration-with-json/';
59
- const MIN_MAX_DOC_LINK = 'https://www.telerik.com/kendo-angular-ui/components/dateinputs/datetimepicker/date-time-limits/';
60
- const DEFAULT_ACTIVE_TAB = 'date';
61
- const DEFAULT_DATEINPUT_FORMAT = 'g';
62
- const DEFAULT_TIMESELECTOR_FORMAT = 't';
63
- const TWO_DIGIT_YEAR_MAX = 68;
64
- const ACCEPT_BUTTON_SELECTOR = '.k-button.k-time-accept';
65
- const CANCEL_BUTTON_SELECOTR = '.k-button.k-time-cancel';
66
- const DATE_TAB_BUTTON_SELECTOR = '.k-button.k-group-start';
67
- const TIME_TAB_BUTTON_SELECTOR = '.k-button.k-group-end';
68
- const TODAY_BUTTON_SELECTOR = '.k-button.k-calendar-nav-today';
69
- /**
70
- * Represents the Kendo UI DateTimePicker component for Angular.
71
- * Allows users to select both date and time values from an interactive calendar and time selector.
72
- *
73
- * @example
74
- * ```typescript
75
- * @Component({
76
- * selector: 'my-app',
77
- * template: `
78
- * <kendo-datetimepicker
79
- * [(value)]="dateTimeValue"
80
- * [format]="'g'"
81
- * [min]="minDate"
82
- * [max]="maxDate">
83
- * </kendo-datetimepicker>
84
- * `
85
- * })
86
- * export class AppComponent {
87
- * public dateTimeValue: Date = new Date();
88
- * public minDate: Date = new Date(2000, 0, 1);
89
- * public maxDate: Date = new Date(2030, 11, 31);
90
- * }
91
- * ```
92
- *
93
- * @remarks
94
- * Supported children components are: {@link DateTimePickerCustomMessagesComponent}.
95
- */
96
- export class DateTimePickerComponent extends MultiTabStop {
97
- popupService;
98
- intl;
99
- cdr;
100
- pickerService;
101
- ngZone;
102
- wrapper;
103
- localization;
104
- disabledDatesService;
105
- renderer;
106
- injector;
107
- adaptiveService;
108
- /**
109
- * @hidden
110
- */
111
- calendarIcon = calendarIcon;
112
- /**
113
- * @hidden
114
- */
115
- clockIcon = clockIcon;
116
- /**
117
- * @hidden
118
- */
119
- hostClasses = true;
120
- /**
121
- * @hidden
122
- */
123
- get disabledClass() {
124
- return this.disabled;
125
- }
126
- /**
127
- * @hidden
128
- */
129
- toggleButton;
130
- /**
131
- * @hidden
132
- */
133
- get dateInput() {
134
- return this.pickerService.input;
135
- }
136
- /**
137
- * @hidden
138
- */
139
- get calendar() {
140
- return this.pickerService.calendar;
141
- }
142
- /**
143
- * @hidden
144
- */
145
- get timeSelector() {
146
- return this.pickerService.timeSelector;
147
- }
148
- /**
149
- * @hidden
150
- */
151
- focusableId;
152
- /**
153
- * Sets the format of the displayed Calendar week days' names.
154
- * @default 'short'
155
- */
156
- weekDaysFormat = "short";
157
- /**
158
- * Displays the days that fall out of the current month in the Calendar ([see example]({% slug datetimepicker_calendar_options %}#toc-displaying-other-month-days)).
159
- * You can set this to show or hide days from other months.
160
- *
161
- * For infinite Calendar the default value is `false`, while for classic Calendar it is `true`.
162
- */
163
- showOtherMonthDays;
164
- /**
165
- * Sets the value of the DateTimePicker component.
166
- * You can set a specific date and time for the picker to display and use.
167
- *
168
- * The `value` has to be a valid [JavaScript `Date`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date) instance or `null`.
169
- */
170
- set value(value) {
171
- this.verifyValue(value);
172
- this._value = cloneDate(value);
173
- this.setCalendarValue(value);
174
- this.cdr.markForCheck();
175
- }
176
- get value() {
177
- return this._value;
178
- }
179
- /**
180
- * Specifies the date format for displaying the input value
181
- * ([see example]({% slug formats_datetimepicker %})).
182
- *
183
- * When using a string format, the same format is applied regardless of whether the input is focused or blurred.
184
- * When using a FormatSettings object, you can specify different inputFormat and displayFormat values for focused and blurred states.
185
- *
186
- * If a FormatSettings object is provided, the displayFormat value will be used for the popup TimePicker.
187
- */
188
- set format(format) {
189
- this._format = format;
190
- const displayFormat = this.getDisplayFormat(format);
191
- this.timeSelectorFormat = this.getTimeSelectorFormat(displayFormat);
192
- }
193
- get format() {
194
- return this._format;
195
- }
196
- /**
197
- * The maximum year to assume to be from the current century when typing two-digit year value
198
- * ([see example]({% slug formats_datetimepicker %}#toc-two-digit-year-format)).
199
- *
200
- * The default value is 68, indicating that typing any value less than 69
201
- * will be assumed to be 20xx, while 69 and larger will be assumed to be 19xx.
202
- * @default 68
203
- */
204
- twoDigitYearMax = TWO_DIGIT_YEAR_MAX;
205
- /**
206
- * Specifies the [`tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the DateTimePicker.
207
- */
208
- set tabindex(value) {
209
- const tabindex = Number(value);
210
- const defaultValue = 0;
211
- this._tabindex = !isNaN(tabindex) ? tabindex : defaultValue;
212
- }
213
- get tabindex() {
214
- return this.disabled ? -1 : this._tabindex;
215
- }
216
- /**
217
- * Sets the dates of the DateTimePicker that will be disabled
218
- * ([see example]({% slug disabled_dates_datetimepicker %})).
219
- */
220
- set disabledDates(value) {
221
- this._disabledDates = value;
222
- this.disabledDatesService.initialize(value);
223
- }
224
- get disabledDates() {
225
- return this._disabledDates;
226
- }
227
- /**
228
- * Configures the popup settings of the DateTimePicker
229
- * ([see example]({% slug datetimepicker_popup_options %}#toc-customizing-the-popup)).
230
- *
231
- * The available options are animate which controls the popup animation and by default, the open and close animations are enabled.
232
- * The `appendTo` option controls the popup container and by default, the popup will be appended to the root component.
233
- * The `popupClass` option specifies a list of CSS classes that are used to style the popup.
234
- */
235
- set popupSettings(settings) {
236
- this._popupSettings = Object.assign({}, { animate: true }, settings);
237
- }
238
- get popupSettings() {
239
- return this._popupSettings;
240
- }
241
- /**
242
- * Specifies the title of the input element of the DateTimePicker and the title text rendered
243
- * in the header of the popup (action sheet). Applicable only when [`AdaptiveMode` is set to `auto`](slug:api_dateinputs_adaptivemode).
244
- * @default ''
245
- */
246
- adaptiveTitle = '';
247
- /**
248
- * Specifies the subtitle text rendered in the header of the popup (action sheet).
249
- * Applicable only when [`AdaptiveMode` is set to `auto`](slug:api_dateinputs_adaptivemode).
250
- * @default ''
251
- */
252
- adaptiveSubtitle = '';
253
- /**
254
- * Specifies the `disabled` property of the DateTimePicker and determines whether the component is active
255
- * ([see example]({% slug disabled_datetimepicker %})).
256
- * To learn how to disable the component in reactive forms, refer to the article on [Forms Support](slug:formssupport_datetimepicker#toc-managing-the-datetimepicker-disabled-state-in-reactive-forms).
257
- * @default false
258
- */
259
- disabled = false;
260
- /**
261
- * Specifies the read-only state of the DateTimePicker
262
- * ([see example]({% slug readonly_datetimepicker %}#toc-read-only-datetimepicker)).
263
- * @default false
264
- *
265
- * @default false
266
- */
267
- readonly = false;
268
- /**
269
- * Determines whether the input field of the DateTimePicker is read-only
270
- * ([see example]({% slug readonly_datetimepicker %}#toc-read-only-input)).
271
- *
272
- * If you set the [`readonly`]({% slug api_dateinputs_datetimepickercomponent %}#toc-readonly) property value to `true`,
273
- * the input will be rendered in a read-only state regardless of the `readOnlyInput` value.
274
- *
275
- * @default false
276
- */
277
- readOnlyInput = false;
278
- /**
279
- * Determines whether to display the **Cancel** button in the popup
280
- * ([see example]({% slug datetimepicker_popup_options %}#toc-toggling-the-cancel-button)).
281
- * @default true
282
- */
283
- cancelButton = true;
284
- /**
285
- * Defines the descriptions of the format sections in the input field
286
- * ([see example]({% slug placeholders_datetimepicker %}#toc-format-sections-description)).
287
- */
288
- formatPlaceholder;
289
- /**
290
- * Specifies the hint which is displayed by the DateTimePicker when its value is `null`
291
- * ([see example]({% slug placeholders_datetimepicker %}#toc-text-hints)).
292
- */
293
- placeholder;
294
- /**
295
- * Configures the incremental steps of the DateInput and the popup component of the TimePicker
296
- * ([see example]({% slug incrementalsteps_datetimepicker %})).
297
- */
298
- steps = {};
299
- /**
300
- * Specifies the focused date of the popup Calendar
301
- * ([see example]({% slug datetimepicker_calendar_options %}#toc-focused-dates)).
302
- */
303
- focusedDate;
304
- /**
305
- * Specifies the Calendar type.
306
- *
307
- * @default 'infinite'
308
- */
309
- calendarType = 'infinite';
310
- /**
311
- * Determines whether to enable animation when navigating to previous/next Calendar view.
312
- * Applies to the [`classic`]({% slug api_dateinputs_datetimepickercomponent %}#toc-calendartype) Calendar only.
313
- *
314
- * The feature uses the [Web Animations API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API). In order to run the animation in browsers that do not support it, you need the `web-animations-js` polyfill.
315
- *
316
- * @default false
317
- */
318
- animateCalendarNavigation = false;
319
- /**
320
- * Determines whether to display a week number column in the `month` view of the popup Calendar
321
- * ([see example]({% slug datetimepicker_calendar_options %}#toc-week-number-column)).
322
- * @default false
323
- */
324
- weekNumber = false;
325
- /**
326
- * Specifies the smallest valid date.
327
- * The Calendar will not display dates before this value.
328
- * If the `min` value of the Calendar is selected, the TimePicker will not display
329
- * time entries before the specified time portion of this value
330
- * ([see example]({% slug dateranges_datetimepicker %})).
331
- */
332
- set min(value) {
333
- this._min = cloneDate(value);
334
- this.calendarMin = getDate(value || MIN_DATE);
335
- }
336
- get min() {
337
- return this._min;
338
- }
339
- /**
340
- * Specifies the biggest valid date.
341
- * The Calendar will not display dates after this value.
342
- * If the `max` value of the Calendar is selected, the TimePicker will not display
343
- * time entries after the specified time portion of this value
344
- * ([see example]({% slug dateranges_datetimepicker %})).
345
- */
346
- set max(value) {
347
- this._max = cloneDate(value);
348
- this.calendarMax = lastMillisecondOfDate(value || MAX_DATE);
349
- }
350
- get max() {
351
- return this._max;
352
- }
353
- /**
354
- * Determines whether the built-in `min` or `max` validators are enforced when validating a form
355
- * ([see example](slug:dateranges_datetimepicker)).
356
- *
357
- * @default true
358
- */
359
- rangeValidation = true;
360
- /**
361
- * Determines whether the built-in validator for disabled date ranges is enforced when validating a form
362
- * ([see example](slug:disabled_dates_datetimepicker)).
363
- * @default true
364
- */
365
- disabledDatesValidation = true;
366
- /**
367
- * Determines whether the built-in validation for incomplete dates is enforced when validating a form.
368
- * @default false
369
- */
370
- incompleteDateValidation = false;
371
- /**
372
- * Determines whether to auto correct invalid segments automatically.
373
- *
374
- * @default true
375
- */
376
- autoCorrectParts = true;
377
- /**
378
- * Determines whether to automatically move to the next segment after the user completes the current one.
379
- *
380
- * @default true
381
- */
382
- autoSwitchParts = true;
383
- /**
384
- * Specifies custom keys that move the focus to the next date format segment.
385
- */
386
- autoSwitchKeys = [];
387
- /**
388
- * Determines whether you can use the mouse scroll to increase or decrease the time segment values.
389
- *
390
- * @default true
391
- */
392
- enableMouseWheel = true;
393
- /**
394
- * Determines whether you can see a blinking caret inside the DateInput when possible.
395
- *
396
- * @default false
397
- */
398
- allowCaretMode = false;
399
- /**
400
- * Renders a clear button when set to `true` after the input text or DateTimePicker value has been changed.
401
- * Clicking this button resets the value of the component to `null` and triggers the `valueChange` event.
402
- * @default false
403
- */
404
- clearButton = false;
405
- /**
406
- * Auto fills the rest of the date to the current date when the component loses focus.
407
- *
408
- * @default false
409
- */
410
- autoFill = false;
411
- /**
412
- * Enables or disables the adaptive mode. The adaptive rendering is disabled by default.
413
- * @default 'none'
414
- */
415
- adaptiveMode = 'none';
416
- /**
417
- * Specifies the HTML attributes of the inner focusable input element. You cannot change attributes that are essential for certain component functionalities.
418
- */
419
- inputAttributes;
420
- /**
421
- * Fires each time the user selects a new value
422
- * ([see example](slug:events_datetimepicker)).
423
- */
424
- valueChange = new EventEmitter();
425
- /**
426
- * Fires each time the popup is about to open
427
- * ([see example](slug:events_datetimepicker)).
428
- * This event is preventable. If you cancel the event by setting `event.preventDefault()`, the popup will remain closed.
429
- */
430
- open = new EventEmitter();
431
- /**
432
- * Fires each time the popup is about to close
433
- * ([see example](slug:events_datetimepicker)).
434
- * This event is preventable. If you cancel the event by setting `event.preventDefault()`, the popup will remain open.
435
- */
436
- close = new EventEmitter();
437
- /**
438
- * Fires each time the user focuses the component
439
- * ([see example](slug:events_datetimepicker)).
440
- */
441
- onFocus = new EventEmitter();
442
- /**
443
- * Fires each time the user blurs the component
444
- * ([see example](slug:events_datetimepicker)).
445
- */
446
- onBlur = new EventEmitter();
447
- /**
448
- * @hidden
449
- */
450
- escape = new EventEmitter();
451
- /**
452
- * Indicates whether the component is currently open. This is when the popup or action sheet is open.
453
- */
454
- get isOpen() {
455
- return this.actionSheet?.expanded || isPresent(this.popupRef);
456
- }
457
- /**
458
- * Indicates whether the component or its popup content is focused.
459
- */
460
- get isActive() {
461
- return this._isActive;
462
- }
463
- set isActive(value) {
464
- if (value) {
465
- this.renderer.addClass(this.wrapper.nativeElement, 'k-focus');
466
- }
467
- else {
468
- this.renderer.removeClass(this.wrapper.nativeElement, 'k-focus');
469
- }
470
- this._isActive = value;
471
- }
472
- /**
473
- * Specifies the active tab when opening the popup
474
- * ([see example]({% slug datetimepicker_popup_options %}#toc-setting-the-default-tab)).
475
- */
476
- set defaultTab(tab) {
477
- this._defaultTab = tab || DEFAULT_ACTIVE_TAB;
478
- this.activeTab = this.defaultTab;
479
- }
480
- get defaultTab() {
481
- return this._defaultTab;
482
- }
483
- /**
484
- * Specifies the size of the component.
485
- *
486
- */
487
- set size(size) {
488
- this.renderer.removeClass(this.wrapper.nativeElement, getSizeClass('input', this.size));
489
- this.renderer.removeClass(this.toggleButton.nativeElement, getSizeClass('button', this.size));
490
- const newSize = size || DEFAULT_SIZE;
491
- if (newSize !== 'none') {
492
- this.renderer.addClass(this.wrapper.nativeElement, getSizeClass('input', newSize));
493
- this.renderer.addClass(this.toggleButton.nativeElement, getSizeClass('button', newSize));
494
- }
495
- this._size = newSize;
496
- }
497
- get size() {
498
- return this._size;
499
- }
500
- /**
501
- * Specifies the border radius of the component.
502
- *
503
- */
504
- set rounded(rounded) {
505
- this.renderer.removeClass(this.wrapper.nativeElement, getRoundedClass(this.rounded));
506
- const newRounded = rounded || DEFAULT_ROUNDED;
507
- if (newRounded !== 'none') {
508
- this.renderer.addClass(this.wrapper.nativeElement, getRoundedClass(newRounded));
509
- }
510
- this._rounded = newRounded;
511
- }
512
- get rounded() {
513
- return this._rounded;
514
- }
515
- /**
516
- * Specifies the fill mode of the component.
517
- *
518
- */
519
- set fillMode(fillMode) {
520
- this.renderer.removeClass(this.wrapper.nativeElement, getFillModeClass('input', this.fillMode));
521
- this.renderer.removeClass(this.toggleButton.nativeElement, getFillModeClass('button', this.fillMode));
522
- this.renderer.removeClass(this.toggleButton.nativeElement, `k-button-${this.fillMode}-base`);
523
- const newFillMode = fillMode || DEFAULT_FILL_MODE;
524
- if (newFillMode !== 'none') {
525
- this.renderer.addClass(this.wrapper.nativeElement, getFillModeClass('input', newFillMode));
526
- this.renderer.addClass(this.toggleButton.nativeElement, getFillModeClass('button', newFillMode));
527
- this.renderer.addClass(this.toggleButton.nativeElement, `k-button-${newFillMode}-base`);
528
- }
529
- this._fillMode = newFillMode;
530
- }
531
- get fillMode() {
532
- return this._fillMode;
533
- }
534
- /**
535
- * @hidden
536
- */
537
- get tabSwitchTransition() {
538
- /*
539
- When the popup is opening, disables the set transition in the themes. When `defaultTab` is set to `time`,
540
- the popup opens with an active **Time** tab and the animation of the initial transition is undesired.
541
- Setting the inline transition style to `none` overrides the set animation in the themes.
542
- Setting the inline transition style to `null` does not apply any inline styles or override the themes CSS.
543
- */
544
- return this.isOpen ? null : 'none';
545
- }
546
- /**
547
- * @hidden
548
- *
549
- * Indicates whether the Calendar will be disabled.
550
- * The inactive tab component gets disabled and becomes inaccessible on tab click.
551
- */
552
- get disableCalendar() {
553
- return this.activeTab !== 'date' && !this.calendar.isActive;
554
- }
555
- /**
556
- * @hidden
557
- *
558
- * Indicates whether the TimeSelector will be disabled.
559
- * The inactive tab component gets disabled and becomes inaccessible on tab click.
560
- */
561
- get disableTimeSelector() {
562
- return this.activeTab !== 'time' && !this.timeSelector.isActive;
563
- }
564
- /**
565
- * @hidden
566
- */
567
- get isAdaptiveModeEnabled() {
568
- return this.adaptiveMode === 'auto';
569
- }
570
- /**
571
- * @hidden
572
- */
573
- get isAdaptive() {
574
- return this.isAdaptiveModeEnabled && this.windowSize !== 'large';
575
- }
576
- /**
577
- * @hidden
578
- */
579
- onResize() {
580
- const currentWindowSize = this.adaptiveService.size;
581
- if (!this.isOpen || this.windowSize === currentWindowSize) {
582
- return;
583
- }
584
- if (this.actionSheet.expanded) {
585
- this.toggleActionSheet(false);
586
- }
587
- else {
588
- this._togglePopup(false);
589
- }
590
- this.windowSize = currentWindowSize;
591
- }
592
- /**
593
- * @hidden
594
- *
595
- * Controls whether the Calendar or the TimeSelector will be displayed.
596
- */
597
- activeTab = DEFAULT_ACTIVE_TAB;
598
- /**
599
- * @hidden
600
- *
601
- * Specifies the stripped time-related format that is used in the TimeSelector.
602
- * Updates each time the `format` property value changes.
603
- */
604
- timeSelectorFormat = DEFAULT_TIMESELECTOR_FORMAT;
605
- /**
606
- * @hidden
607
- */
608
- timeSelectorMin = cloneDate(MIN_TIME);
609
- /**
610
- * @hidden
611
- */
612
- timeSelectorMax = cloneDate(MAX_TIME);
613
- /**
614
- * @hidden
615
- */
616
- calendarValue = null;
617
- /**
618
- * @hidden
619
- */
620
- calendarMin = cloneDate(MIN_DATE);
621
- /**
622
- * @hidden
623
- */
624
- calendarMax = lastMillisecondOfDate(MAX_DATE);
625
- /**
626
- * @hidden
627
- */
628
- checkIcon = checkIcon;
629
- /**
630
- * @hidden
631
- */
632
- windowSize;
633
- /**
634
- * @hidden
635
- */
636
- cellTemplate;
637
- /**
638
- * @hidden
639
- */
640
- monthCellTemplate;
641
- /**
642
- * @hidden
643
- */
644
- yearCellTemplate;
645
- /**
646
- * @hidden
647
- */
648
- decadeCellTemplate;
649
- /**
650
- * @hidden
651
- */
652
- centuryCellTemplate;
653
- /**
654
- * @hidden
655
- */
656
- weekNumberTemplate;
657
- /**
658
- * @hidden
659
- */
660
- headerTitleTemplate;
661
- /**
662
- * @hidden
663
- */
664
- headerTemplate;
665
- /**
666
- * @hidden
667
- */
668
- set headerTemplateRef(template) {
669
- this.headerTemplate = template;
670
- }
671
- /**
672
- * @hidden
673
- */
674
- footerTemplate;
675
- /**
676
- * @hidden
677
- */
678
- set footerTemplateRef(template) {
679
- this.footerTemplate = template;
680
- }
681
- /**
682
- * Toggles the visibility of the Calendar footer.
683
- * @default false
684
- */
685
- footer = false;
686
- get activeTabComponent() {
687
- if (!this.isOpen) {
688
- return;
689
- }
690
- if (!(isPresent(this.calendar) || isPresent(this.timeSelector))) {
691
- this.cdr.detectChanges();
692
- }
693
- return this.activeTab === 'date' ? this.calendar : this.timeSelector;
694
- }
695
- get appendTo() {
696
- const { appendTo } = this.popupSettings;
697
- if (!isPresent(appendTo) || appendTo === 'root') {
698
- return undefined;
699
- }
700
- return appendTo === 'component' ? this.container : appendTo;
701
- }
702
- container;
703
- popupTemplate;
704
- actionSheet;
705
- get popupUID() {
706
- return this.calendar?.popupId;
707
- }
708
- get acceptButton() {
709
- if (this.isAdaptive) {
710
- return this.actionSheet.element.nativeElement.querySelector(ACCEPT_BUTTON_SELECTOR);
711
- }
712
- else {
713
- return this.popupRef?.popup.instance.container.nativeElement.querySelector(ACCEPT_BUTTON_SELECTOR);
714
- }
715
- }
716
- get cancelButtonElement() {
717
- if (this.isAdaptive) {
718
- return this.actionSheet.element.nativeElement.querySelector(CANCEL_BUTTON_SELECOTR);
719
- }
720
- else {
721
- return this.popupRef?.popup.instance.container.nativeElement.querySelector(CANCEL_BUTTON_SELECOTR);
722
- }
723
- }
724
- get dateTabButton() {
725
- if (this.isAdaptive) {
726
- return this.actionSheet.element.nativeElement.querySelector(DATE_TAB_BUTTON_SELECTOR);
727
- }
728
- else {
729
- return this.popupRef?.popup.instance.container.nativeElement.querySelector(DATE_TAB_BUTTON_SELECTOR);
730
- }
731
- }
732
- get timeTabButton() {
733
- if (this.isAdaptive) {
734
- return this.actionSheet.element.nativeElement.querySelector(TIME_TAB_BUTTON_SELECTOR);
735
- }
736
- else {
737
- return this.popupRef?.popup.instance.container.nativeElement.querySelector(TIME_TAB_BUTTON_SELECTOR);
738
- }
739
- }
740
- get todayButton() {
741
- if (this.isAdaptive) {
742
- return this.actionSheet.element.nativeElement.querySelector(TODAY_BUTTON_SELECTOR);
743
- }
744
- else {
745
- return this.popupRef?.popup.instance.container.nativeElement.querySelector(TODAY_BUTTON_SELECTOR);
746
- }
747
- }
748
- get popupClasses() {
749
- const classes = ['k-datetime-container', 'k-datetimepicker-popup'];
750
- if (!this.popupSettings.popupClass) {
751
- return classes;
752
- }
753
- const parsedPopupClasses = parseCSSClassNames(this.popupSettings.popupClass);
754
- if (parsedPopupClasses?.length) {
755
- classes.push(...parsedPopupClasses);
756
- }
757
- return classes;
758
- }
759
- /**
760
- * @hidden
761
- */
762
- get formControl() {
763
- const ngControl = this.injector.get(NgControl, null);
764
- return ngControl?.control || null;
765
- }
766
- /**
767
- * @hidden
768
- */
769
- get isControlRequired() {
770
- return isControlRequired(this.formControl);
771
- }
772
- popupRef;
773
- _popupSettings = { animate: true };
774
- _value = null;
775
- _format = DEFAULT_DATEINPUT_FORMAT;
776
- _tabindex = 0;
777
- _defaultTab = DEFAULT_ACTIVE_TAB;
778
- _min = mergeDateAndTime(MIN_DATE, MIN_TIME);
779
- _max = mergeDateAndTime(MAX_DATE, MAX_TIME);
780
- _disabledDates;
781
- _isActive = false;
782
- onControlTouched = noop;
783
- onControlChange = noop;
784
- onValidatorChange = noop;
785
- minValidateFn = noop;
786
- maxValidateFn = noop;
787
- disabledDatesValidateFn = noop;
788
- incompleteValidator = noop;
789
- subscriptions = new Subscription();
790
- ariaActiveDescendantSubscription;
791
- _size = DEFAULT_SIZE;
792
- _rounded = DEFAULT_ROUNDED;
793
- _fillMode = DEFAULT_FILL_MODE;
794
- constructor(popupService, intl, cdr, pickerService, ngZone, wrapper, localization, disabledDatesService, renderer, injector, adaptiveService) {
795
- super();
796
- this.popupService = popupService;
797
- this.intl = intl;
798
- this.cdr = cdr;
799
- this.pickerService = pickerService;
800
- this.ngZone = ngZone;
801
- this.wrapper = wrapper;
802
- this.localization = localization;
803
- this.disabledDatesService = disabledDatesService;
804
- this.renderer = renderer;
805
- this.injector = injector;
806
- this.adaptiveService = adaptiveService;
807
- validatePackage(packageMetadata);
808
- }
809
- ngOnInit() {
810
- this.subscriptions.add(this.pickerService.onFocus
811
- // detect popup changes to disable the inactive view mark-up when the popup is open
812
- .pipe(tap(this.detectPopupChanges.bind(this)))
813
- .subscribe(this.handleFocus.bind(this)));
814
- this.subscriptions.add(this.pickerService.onBlur.subscribe(this.handleBlur.bind(this)));
815
- this.subscriptions.add(this.pickerService.sameDateSelected.subscribe(this.handleCalendarValueChange.bind(this)));
816
- this.subscriptions.add(this.localization.changes.subscribe(() => this.cdr.markForCheck()));
817
- this.subscriptions.add(this.pickerService.dateCompletenessChange.subscribe(this.handleDateCompletenessChange.bind(this)));
818
- if (isWindowAvailable()) {
819
- this.subscriptions.add(this.ngZone.runOutsideAngular(() => fromEvent(window, 'blur').subscribe(() => {
820
- if (!this.isAdaptive) {
821
- this.handleCancel();
822
- }
823
- })));
824
- }
825
- this.focusableId = this.dateInput?.focusableId;
826
- this.minValidateFn = this.rangeValidation ? minValidator(this.min) : noop;
827
- this.maxValidateFn = this.rangeValidation ? maxValidator(this.max) : noop;
828
- }
829
- ngAfterViewInit() {
830
- this.setComponentClasses();
831
- this.windowSize = this.adaptiveService.size;
832
- }
833
- ngOnChanges(changes) {
834
- if (isPresent(changes['min']) || isPresent(changes['max'])) {
835
- this.verifyMinMaxRange();
836
- }
837
- if (changes['min'] || changes['max'] || changes['rangeValidation'] || changes['disabledDatesValidation'] || changes['disabledDates'] || changes['incompleteDateValidation']) {
838
- this.minValidateFn = this.rangeValidation ? minValidator(this.min) : noop;
839
- this.maxValidateFn = this.rangeValidation ? maxValidator(this.max) : noop;
840
- this.disabledDatesValidateFn = this.disabledDatesValidation ? disabledDatesValidator(this.disabledDatesService.isDateDisabled) : noop;
841
- this.incompleteValidator = this.incompleteDateValidation ? incompleteDateValidator() : noop;
842
- this.onValidatorChange();
843
- }
844
- if (!this.focusableId || changes['focusableId']) {
845
- this.focusableId = this.dateInput?.focusableId;
846
- }
847
- }
848
- ngOnDestroy() {
849
- if (this.isOpen && !this.isAdaptive) {
850
- this.closePopup();
851
- }
852
- this.subscriptions.unsubscribe();
853
- }
854
- /**
855
- * Focuses the DateTimePicker input if the popup is closed.
856
- * Moves the focus to the popup content if the popup is open.
857
- */
858
- focus() {
859
- if (this.disabled) {
860
- return;
861
- }
862
- if (this.isOpen) {
863
- this.activeTabComponent.focus();
864
- }
865
- else {
866
- this.dateInput.focus();
867
- }
868
- }
869
- /**
870
- * Blurs the DateTimePicker component.
871
- */
872
- blur() {
873
- if (this.isOpen && this.activeTabComponent.isActive) {
874
- this.activeTabComponent.blur();
875
- }
876
- else {
877
- this.dateInput.blur();
878
- }
879
- }
880
- /**
881
- * Toggles the visibility of the popup or action sheet.
882
- * If you use the `toggle` method to show or hide the popup or action sheet,
883
- * the `open` and `close` events do not fire.
884
- *
885
- * @param show - The state of the popup.
886
- */
887
- toggle(show) {
888
- if (this.disabled || this.readonly || show === this.isOpen) {
889
- return;
890
- }
891
- const previousWindowSize = this.windowSize;
892
- this.windowSize = this.adaptiveService.size;
893
- if (previousWindowSize !== this.windowSize && !show) {
894
- if (previousWindowSize !== 'large') {
895
- this.toggleActionSheet(show);
896
- }
897
- else {
898
- this._togglePopup(show);
899
- }
900
- }
901
- else {
902
- if (this.isAdaptive) {
903
- this.toggleActionSheet(show);
904
- }
905
- else {
906
- this._togglePopup(show);
907
- }
908
- }
909
- }
910
- /**
911
- * @hidden
912
- */
913
- writeValue(value) {
914
- this.verifyValue(value);
915
- this.value = cloneDate(value);
916
- this.cdr.markForCheck();
917
- if (!value && this.dateInput) {
918
- this.dateInput.placeholder = this.placeholder;
919
- this.dateInput.writeValue(value);
920
- }
921
- }
922
- /**
923
- * @hidden
924
- */
925
- registerOnChange(fn) {
926
- this.onControlChange = fn;
927
- }
928
- /**
929
- * @hidden
930
- */
931
- registerOnTouched(fn) {
932
- this.onControlTouched = fn;
933
- }
934
- /**
935
- * @hidden
936
- */
937
- setDisabledState(disabled) {
938
- this.disabled = disabled;
939
- this.cdr.markForCheck();
940
- }
941
- /**
942
- * @hidden
943
- */
944
- validate(control) {
945
- return this.minValidateFn(control) || this.maxValidateFn(control) || this.disabledDatesValidateFn(control) || this.incompleteValidator(control, this.dateInput && this.dateInput.isDateIncomplete);
946
- }
947
- /**
948
- * @hidden
949
- */
950
- registerOnValidatorChange(fn) {
951
- this.onValidatorChange = fn;
952
- }
953
- /**
954
- * @hidden
955
- *
956
- * Used by the TextBoxContainer to determine if the floating label will render in the input.
957
- */
958
- isEmpty() {
959
- return !isPresent(this.value) && this.dateInput.isEmpty();
960
- }
961
- /**
962
- * @hidden
963
- */
964
- handleIconClick(event) {
965
- if (this.disabled || this.readonly) {
966
- return;
967
- }
968
- // prevents the event default to evade focusing the DateInput input when placed inside a label (FF/IE/Edge)
969
- event.preventDefault();
970
- const runInZone = !this.isOpen || hasObservers(this.close);
971
- this.run(runInZone, () => {
972
- const shouldOpen = !this.isOpen;
973
- // handle focus first to maintain correct event order `focus` => `open`
974
- this.handleFocus();
975
- if (!shouldOpen) {
976
- this.dateInput.focus();
977
- }
978
- this.toggleDateTime(shouldOpen);
979
- this.switchFocus();
980
- });
981
- }
982
- /**
983
- * @hidden
984
- */
985
- handleFocus() {
986
- if (this.isActive) {
987
- return;
988
- }
989
- this.isActive = true;
990
- if (hasObservers(this.onFocus)) {
991
- this.ngZone.run(() => this.onFocus.emit());
992
- }
993
- }
994
- /**
995
- * @hidden
996
- */
997
- handleBlur(event) {
998
- if (!this.isActive || this.focusTargetInComponent(event)) {
999
- return;
1000
- }
1001
- this.isActive = false;
1002
- const isNgControlUntouched = this.wrapper.nativeElement.classList.contains('ng-untouched');
1003
- const runInZone = isNgControlUntouched || hasObservers(this.onBlur) || (this.isOpen && hasObservers(this.close));
1004
- this.run(runInZone, () => {
1005
- this.onBlur.emit();
1006
- this.onControlTouched();
1007
- this.toggleDateTime(false);
1008
- this.cdr.markForCheck();
1009
- });
1010
- }
1011
- /**
1012
- * @hidden
1013
- */
1014
- changeActiveTab(tab) {
1015
- if (!this.isOpen || this.activeTab === tab) {
1016
- return;
1017
- }
1018
- // persists the Tcurrent value of the TimeSelector when switching between tabs
1019
- if (!isEqual(this.timeSelector.value, this.timeSelector.current)) {
1020
- this.timeSelector.handleAccept();
1021
- }
1022
- this.activeTab = tab;
1023
- this.cdr.detectChanges();
1024
- this.detectPopupChanges();
1025
- }
1026
- /**
1027
- * @hidden
1028
- */
1029
- handleTabChangeTransitionEnd(dateTimeSelector, event) {
1030
- // handle only the .k-datetime-selector element transition, ignore any child element transitions
1031
- if (event.target !== dateTimeSelector) {
1032
- return;
1033
- }
1034
- if (this.activeTab === 'time') {
1035
- this.renderer.removeAttribute(this.dateInput?.inputElement, attributeNames.ariaActiveDescendant);
1036
- }
1037
- this.activeTabComponent.focus();
1038
- }
1039
- /**
1040
- * @hidden
1041
- */
1042
- onTabOutLastPart() {
1043
- if (this.calendarValue) {
1044
- this.acceptButton.focus();
1045
- }
1046
- else if (!this.calendarValue && this.cancelButton) {
1047
- this.cancelButtonElement.focus();
1048
- }
1049
- else {
1050
- this.dateTabButton.focus();
1051
- }
1052
- }
1053
- /**
1054
- * @hidden
1055
- */
1056
- onTabOutFirstPart() {
1057
- if (this.activeTab === 'time') {
1058
- this.renderer.removeClass(this.timeSelector.timeListWrappers.first.nativeElement, 'k-focus');
1059
- this.timeSelector.showNowButton ? this.timeSelector.now.nativeElement.focus() : this.timeTabButton.focus();
1060
- }
1061
- }
1062
- /**
1063
- * @hidden
1064
- */
1065
- onTabOutNow() {
1066
- this.timeTabButton.focus();
1067
- }
1068
- /**
1069
- * @hidden
1070
- */
1071
- handleAccept() {
1072
- if (!this.isOpen) {
1073
- return;
1074
- }
1075
- const candidate = mergeDateAndTime(this.calendar.value, this.timeSelector.current);
1076
- const valueChangePresent = !isEqual(this.value, candidate);
1077
- const runInZone = valueChangePresent || hasObservers(this.close);
1078
- this.run(runInZone, () => {
1079
- this.handleValueChange(candidate);
1080
- this.dateInput.focus();
1081
- this.toggleDateTime(false);
1082
- });
1083
- }
1084
- /**
1085
- * @hidden
1086
- */
1087
- handleCancel() {
1088
- if (!this.isOpen) {
1089
- return;
1090
- }
1091
- const runInZone = hasObservers(this.close);
1092
- this.dateInput.focus();
1093
- this.run(runInZone, () => this.toggleDateTime(false));
1094
- hasObservers(this.escape) && this.escape.emit();
1095
- }
1096
- /**
1097
- * @hidden
1098
- */
1099
- handleInputValueChange(value) {
1100
- this.handleValueChange(value);
1101
- if (this.isOpen) {
1102
- this.toggleDateTime(false);
1103
- }
1104
- }
1105
- /**
1106
- * @hidden
1107
- */
1108
- handleDateInputClick() {
1109
- this.windowSize = this.adaptiveService.size;
1110
- if (this.isAdaptive) {
1111
- this.toggleDateTime(true);
1112
- }
1113
- else if (this.isOpen) {
1114
- this.toggleDateTime(false);
1115
- }
1116
- }
1117
- /**
1118
- * @hidden
1119
- */
1120
- handleCalendarValueChange() {
1121
- this.setTimeSelectorMinMax(this.calendar.value);
1122
- this.changeActiveTab('time');
1123
- }
1124
- /**
1125
- * @hidden
1126
- */
1127
- handleKeyDown(event) {
1128
- if (this.disabled || this.readonly) {
1129
- return;
1130
- }
1131
- const { altKey } = event;
1132
- const code = normalizeKeys(event);
1133
- switch (code) {
1134
- case altKey && Keys.ArrowUp:
1135
- case Keys.Escape:
1136
- this.handleCancel();
1137
- break;
1138
- case !this.isOpen && altKey && Keys.ArrowDown:
1139
- this.ngZone.run(() => this.toggleDateTime(true));
1140
- break;
1141
- case altKey && Keys.ArrowRight:
1142
- this.changeActiveTab('time');
1143
- break;
1144
- case altKey && Keys.ArrowLeft:
1145
- this.changeActiveTab('date');
1146
- break;
1147
- case this.isOpen && this.timeSelector.isActive && isPresent(this.calendarValue) && Keys.Enter:
1148
- this.handleAccept();
1149
- break;
1150
- default: return;
1151
- }
1152
- }
1153
- /**
1154
- * @hidden
1155
- */
1156
- handleTab(event) {
1157
- event.preventDefault();
1158
- const { shiftKey } = event;
1159
- switch (event.target) {
1160
- case this.acceptButton:
1161
- if (!shiftKey) {
1162
- this.cancelButton ? this.cancelButtonElement.focus() : this.dateTabButton.focus();
1163
- }
1164
- else {
1165
- if (this.activeTab === 'date') {
1166
- this.calendar.monthView.list.nativeElement.focus();
1167
- }
1168
- else {
1169
- this.timeSelector.timeLists.last.focus();
1170
- }
1171
- }
1172
- break;
1173
- case this.cancelButtonElement:
1174
- if (this.calendarValue) {
1175
- shiftKey ? this.acceptButton.focus() : this.dateTabButton.focus();
1176
- }
1177
- else {
1178
- if (shiftKey) {
1179
- if (this.activeTab === 'date') {
1180
- this.calendar.monthView.list.nativeElement.focus();
1181
- }
1182
- else {
1183
- this.timeSelector.timeLists.last.focus();
1184
- }
1185
- }
1186
- else {
1187
- this.dateTabButton.focus();
1188
- }
1189
- }
1190
- break;
1191
- case this.dateTabButton:
1192
- if (this.cancelButton) {
1193
- this.cancelButtonElement.focus();
1194
- }
1195
- if (!this.cancelButton && this.calendarValue) {
1196
- this.acceptButton.focus();
1197
- }
1198
- if (!this.cancelButton && !this.calendarValue) {
1199
- if (this.activeTab === 'date') {
1200
- this.calendar.monthView.list.nativeElement.focus();
1201
- }
1202
- else {
1203
- this.timeSelector.timeLists.last.focus();
1204
- }
1205
- }
1206
- break;
1207
- case this.timeTabButton:
1208
- if (this.activeTab === 'time') {
1209
- this.timeSelector.showNowButton ?
1210
- this.timeSelector.now.nativeElement.focus() :
1211
- this.timeSelector.timeLists.first.focus();
1212
- }
1213
- else {
1214
- this.todayButton.focus();
1215
- }
1216
- break;
1217
- default:
1218
- break;
1219
- }
1220
- }
1221
- /**
1222
- * @hidden
1223
- */
1224
- handleActionSheetCollapse() {
1225
- // If not handled, the actionsheet expanded state does not get updated when overlay is clicked
1226
- this.cdr.markForCheck();
1227
- // Reset tabs after actionsheet is collapsed, otherwise the tab change can be seen during the animation
1228
- this.resetActiveTab();
1229
- }
1230
- /**
1231
- * @hidden
1232
- *
1233
- * Prevents the diversion of the focus from the currently active element in the component.
1234
- */
1235
- preventMouseDown(event) {
1236
- event.preventDefault();
1237
- }
1238
- /**
1239
- * @hidden
1240
- */
1241
- toggleActionSheet(show) {
1242
- if (isPresent(show) && show && !this.isOpen) {
1243
- this.actionSheet.toggle();
1244
- this.renderer.setAttribute(this.actionSheet.element.nativeElement, 'id', this.popupUID);
1245
- this.renderer.setAttribute(this.dateInput?.inputElement, attributeNames.ariaControls, this.popupUID);
1246
- this.setAriaActiveDescendant();
1247
- }
1248
- else if (isPresent(show) && !show && this.isOpen) {
1249
- this.handleBlur();
1250
- this.actionSheet.toggle();
1251
- this.ariaActiveDescendantSubscription.unsubscribe();
1252
- if (this.dateInput) {
1253
- this.renderer.removeAttribute(this.dateInput.inputElement, attributeNames.ariaActiveDescendant);
1254
- this.renderer.removeAttribute(this.dateInput.inputElement, attributeNames.ariaControls);
1255
- this.dateInput.focus();
1256
- }
1257
- }
1258
- }
1259
- _togglePopup(show) {
1260
- const shouldOpen = isPresent(show) ? show : !this.isOpen;
1261
- if (shouldOpen) {
1262
- this.openPopup();
1263
- return;
1264
- }
1265
- this.closePopup();
1266
- this.resetActiveTab();
1267
- }
1268
- /**
1269
- * Changes the tab and the calendar or clock icon to the designated default.
1270
- */
1271
- resetActiveTab() {
1272
- if (this.activeTab !== this.defaultTab) {
1273
- this.activeTab = this.defaultTab;
1274
- this.cdr.detectChanges();
1275
- }
1276
- }
1277
- verifyValue(value) {
1278
- if (!isDevMode()) {
1279
- return;
1280
- }
1281
- if (isPresent(value) && !(value instanceof Date)) {
1282
- throw new Error(`The 'value' should be a valid JavaScript Date instance or null. Check ${VALUE_DOC_LINK} for possible resolution.`);
1283
- }
1284
- }
1285
- verifyMinMaxRange() {
1286
- if (!isDevMode()) {
1287
- return;
1288
- }
1289
- if (!isValidRange(this.min, this.max)) {
1290
- throw new Error(`The max value should be bigger than the min. See ${MIN_MAX_DOC_LINK}.`);
1291
- }
1292
- }
1293
- /**
1294
- * Extracts the time slots and literals that are not preceded by date parts
1295
- * and combines the resulting parts into a string.
1296
- * If the provided `format` value does not contain any time parts,
1297
- * returns the designated format of the default popup component of the `TimePicker`.
1298
- */
1299
- getTimeSelectorFormat(format) {
1300
- const timeSelectorFormat = this.intl
1301
- .splitDateFormat(format)
1302
- .filter(this.timeFormatPartFilter)
1303
- .reduce((format, part) => format += part.pattern, '');
1304
- return timeSelectorFormat || DEFAULT_TIMESELECTOR_FORMAT;
1305
- }
1306
- /**
1307
- * Extracts the `displayFormat` from the provided `string | FormatSettings` value.
1308
- * Falls back to the default input value if a falsy value parameter is passed.
1309
- */
1310
- getDisplayFormat(format) {
1311
- if (!format) {
1312
- return DEFAULT_DATEINPUT_FORMAT;
1313
- }
1314
- if (typeof format === 'string') {
1315
- return format;
1316
- }
1317
- else {
1318
- return format.displayFormat;
1319
- }
1320
- }
1321
- /**
1322
- * The filter expression that filters out all format parts
1323
- * except for `hour`, `minute`, `second`, `dayperiod`, and specific literals.
1324
- * Literals remain only if they are not preceded by date parts.
1325
- */
1326
- timeFormatPartFilter(part, index, parts) {
1327
- const previousPart = index >= 1 && parts[index - 1];
1328
- if (previousPart && part.type === 'literal') {
1329
- return timeFormatRegExp.test(previousPart.type);
1330
- }
1331
- return timeFormatRegExp.test(part.type);
1332
- }
1333
- /**
1334
- * @hidden
1335
- */
1336
- toggleDateTime(open) {
1337
- if (open === this.isOpen) {
1338
- return;
1339
- }
1340
- const event = new PreventableEvent();
1341
- if (open) {
1342
- this.open.emit(event);
1343
- }
1344
- else {
1345
- this.close.emit(event);
1346
- }
1347
- if (event.isDefaultPrevented()) {
1348
- return;
1349
- }
1350
- this.toggle(open);
1351
- this.switchFocus();
1352
- }
1353
- switchFocus() {
1354
- if (!this.isActive) {
1355
- return;
1356
- }
1357
- if (this.isOpen) {
1358
- this.activeTabComponent.focus();
1359
- }
1360
- else if (!touchEnabled) {
1361
- this.dateInput.focus();
1362
- }
1363
- else if (!this.dateInput.isActive) {
1364
- this.handleBlur();
1365
- }
1366
- }
1367
- openPopup() {
1368
- this.setCalendarValue(this.value);
1369
- this.setTimeSelectorMinMax(this.value);
1370
- const direction = this.localization.rtl ? 'right' : 'left';
1371
- const appendToComponent = typeof this.popupSettings.appendTo === 'string' && this.popupSettings.appendTo === 'component';
1372
- this.popupRef = this.popupService.open({
1373
- anchor: this.wrapper,
1374
- content: this.popupTemplate,
1375
- positionMode: appendToComponent ? 'fixed' : 'absolute',
1376
- animate: this.popupSettings.animate,
1377
- appendTo: this.appendTo,
1378
- popupClass: this.popupClasses,
1379
- anchorAlign: { vertical: 'bottom', horizontal: direction },
1380
- popupAlign: { vertical: 'top', horizontal: direction }
1381
- });
1382
- this.popupRef.popupElement.setAttribute('id', this.popupUID);
1383
- this.renderer.setAttribute(this.dateInput?.inputElement, attributeNames.ariaControls, this.popupUID);
1384
- this.setAriaActiveDescendant();
1385
- this.popupRef.popupAnchorViewportLeave.subscribe(() => this.handleCancel());
1386
- if (this.calendar.type === 'infinite') {
1387
- this.subscriptions.add(fromEvent(this.calendar.monthView.list.nativeElement, 'keydown').subscribe((event) => {
1388
- const { code, shiftKey } = event;
1389
- if (code === Keys.Tab && !shiftKey) {
1390
- event.preventDefault();
1391
- if (!this.calendarValue && !this.cancelButton) {
1392
- this.dateTabButton.focus();
1393
- }
1394
- else if (this.calendarValue) {
1395
- this.acceptButton.focus();
1396
- }
1397
- else if (this.cancelButton) {
1398
- this.cancelButtonElement.focus();
1399
- }
1400
- }
1401
- }));
1402
- }
1403
- }
1404
- setAriaActiveDescendant() {
1405
- const focusedCellChangeEvent = this.calendar.type === 'infinite' ?
1406
- this.calendar.monthView.focusedCellChange :
1407
- this.calendar.multiViewCalendar.viewList.focusedCellChange;
1408
- this.ariaActiveDescendantSubscription = focusedCellChangeEvent.subscribe((id) => this.renderer.setAttribute(this.dateInput?.inputElement, attributeNames.ariaActiveDescendant, id));
1409
- }
1410
- closePopup() {
1411
- if (!this.isOpen) {
1412
- return;
1413
- }
1414
- this.ariaActiveDescendantSubscription.unsubscribe();
1415
- if (this.dateInput) {
1416
- this.renderer.removeAttribute(this.dateInput?.inputElement, attributeNames.ariaControls);
1417
- this.renderer.removeAttribute(this.dateInput?.inputElement, attributeNames.ariaActiveDescendant);
1418
- }
1419
- this.popupRef.close();
1420
- this.popupRef = null;
1421
- }
1422
- handleValueChange(value) {
1423
- if (isEqual(this.value, value)) {
1424
- if (this.incompleteDateValidation) {
1425
- this.onControlChange(cloneDate(value));
1426
- }
1427
- return;
1428
- }
1429
- this.value = cloneDate(value);
1430
- this.onControlChange(cloneDate(value));
1431
- this.valueChange.emit(cloneDate(value));
1432
- }
1433
- /**
1434
- * Indicates whether the focus target is part of this component.
1435
- * Checks whether the focus target is inside the component or in the popup.
1436
- */
1437
- focusTargetInComponent(event) {
1438
- if (!isPresent(event)) {
1439
- return false;
1440
- }
1441
- const relatedTarget = event.relatedTarget || document.activeElement;
1442
- const focusInPopup = isPresent(this.popupRef) && this.popupRef.popupElement.contains(relatedTarget);
1443
- const focusInWrapper = this.wrapper.nativeElement.contains(relatedTarget);
1444
- const isInsideActionSheet = this.actionSheet && (this.actionSheet.element.nativeElement.contains(event.target) || this.actionSheet.element.nativeElement.contains(relatedTarget));
1445
- return focusInPopup || focusInWrapper || isInsideActionSheet;
1446
- }
1447
- setTimeSelectorMinMax(selectedDate) {
1448
- const minDateSelected = isPresent(selectedDate) && isPresent(this.min) && isEqual(getDate(selectedDate), getDate(this.min));
1449
- this.timeSelectorMin = cloneDate(minDateSelected ? this.min : MIN_TIME);
1450
- const maxDateSelected = isPresent(selectedDate) && isPresent(this.max) && isEqual(getDate(selectedDate), getDate(this.max));
1451
- this.timeSelectorMax = cloneDate(maxDateSelected ? this.max : MAX_TIME);
1452
- }
1453
- setCalendarValue(value) {
1454
- const isInCalendarRange = isPresent(value) && isInRange(value, this.calendarMin, this.calendarMax);
1455
- this.calendarValue = isInCalendarRange ? getDate(value) : null;
1456
- }
1457
- /**
1458
- * Runs a popup change detection if the popup is available.
1459
- */
1460
- detectPopupChanges() {
1461
- if (!this.isOpen || this.isAdaptive) {
1462
- return;
1463
- }
1464
- this.popupRef.popup.changeDetectorRef.detectChanges();
1465
- }
1466
- /**
1467
- * Runs the provided function either in the Angular zone or in the current zone.
1468
- * The execution zone depends on the predicate `runInZone` value that is passed.
1469
- */
1470
- run(runInZone, fn) {
1471
- if (runInZone) {
1472
- this.ngZone.run(() => fn());
1473
- }
1474
- else {
1475
- fn();
1476
- }
1477
- }
1478
- handleDateCompletenessChange() {
1479
- this.cdr.markForCheck();
1480
- this.ngZone.run(() => this.onValidatorChange());
1481
- }
1482
- setComponentClasses() {
1483
- if (this.size) {
1484
- this.renderer.addClass(this.wrapper.nativeElement, getSizeClass('input', this.size));
1485
- this.renderer.addClass(this.toggleButton.nativeElement, getSizeClass('button', this.size));
1486
- }
1487
- if (this.rounded) {
1488
- this.renderer.addClass(this.wrapper.nativeElement, getRoundedClass(this.rounded));
1489
- }
1490
- if (this.fillMode) {
1491
- this.renderer.addClass(this.wrapper.nativeElement, getFillModeClass('input', this.fillMode));
1492
- this.renderer.addClass(this.toggleButton.nativeElement, getFillModeClass('button', this.fillMode));
1493
- this.renderer.addClass(this.toggleButton.nativeElement, `k-button-${this.fillMode}-base`);
1494
- }
1495
- }
1496
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DateTimePickerComponent, deps: [{ token: i1.PopupService }, { token: i2.IntlService }, { token: i0.ChangeDetectorRef }, { token: i3.PickerService }, { token: i0.NgZone }, { token: i0.ElementRef }, { token: i4.LocalizationService }, { token: i5.DisabledDatesService }, { token: i0.Renderer2 }, { token: i0.Injector }, { token: i6.AdaptiveService }], target: i0.ɵɵFactoryTarget.Component });
1497
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: DateTimePickerComponent, isStandalone: true, selector: "kendo-datetimepicker", inputs: { focusableId: "focusableId", weekDaysFormat: "weekDaysFormat", showOtherMonthDays: "showOtherMonthDays", value: "value", format: "format", twoDigitYearMax: "twoDigitYearMax", tabindex: "tabindex", disabledDates: "disabledDates", popupSettings: "popupSettings", adaptiveTitle: "adaptiveTitle", adaptiveSubtitle: "adaptiveSubtitle", disabled: "disabled", readonly: "readonly", readOnlyInput: "readOnlyInput", cancelButton: "cancelButton", formatPlaceholder: "formatPlaceholder", placeholder: "placeholder", steps: "steps", focusedDate: "focusedDate", calendarType: "calendarType", animateCalendarNavigation: "animateCalendarNavigation", weekNumber: "weekNumber", min: "min", max: "max", rangeValidation: "rangeValidation", disabledDatesValidation: "disabledDatesValidation", incompleteDateValidation: "incompleteDateValidation", autoCorrectParts: "autoCorrectParts", autoSwitchParts: "autoSwitchParts", autoSwitchKeys: "autoSwitchKeys", enableMouseWheel: "enableMouseWheel", allowCaretMode: "allowCaretMode", clearButton: "clearButton", autoFill: "autoFill", adaptiveMode: "adaptiveMode", inputAttributes: "inputAttributes", defaultTab: "defaultTab", size: "size", rounded: "rounded", fillMode: "fillMode", headerTemplateRef: ["headerTemplate", "headerTemplateRef"], footerTemplateRef: ["footerTemplate", "footerTemplateRef"], footer: "footer" }, outputs: { valueChange: "valueChange", open: "open", close: "close", onFocus: "focus", onBlur: "blur", escape: "escape" }, host: { properties: { "class.k-datetimepicker": "this.hostClasses", "class.k-input": "this.hostClasses", "class.k-disabled": "this.disabledClass", "class.k-readonly": "this.readonly" } }, providers: [
1498
- PickerService,
1499
- LocalizationService,
1500
- DisabledDatesService,
1501
- { provide: L10N_PREFIX, useValue: 'kendo.datetimepicker' },
1502
- { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DateTimePickerComponent), multi: true },
1503
- { provide: NG_VALIDATORS, useExisting: forwardRef(() => DateTimePickerComponent), multi: true },
1504
- { provide: KendoInput, useExisting: forwardRef(() => DateTimePickerComponent) },
1505
- { provide: MultiTabStop, useExisting: forwardRef(() => DateTimePickerComponent) }
1506
- ], queries: [{ propertyName: "cellTemplate", first: true, predicate: CellTemplateDirective, descendants: true }, { propertyName: "monthCellTemplate", first: true, predicate: MonthCellTemplateDirective, descendants: true }, { propertyName: "yearCellTemplate", first: true, predicate: YearCellTemplateDirective, descendants: true }, { propertyName: "decadeCellTemplate", first: true, predicate: DecadeCellTemplateDirective, descendants: true }, { propertyName: "centuryCellTemplate", first: true, predicate: CenturyCellTemplateDirective, descendants: true }, { propertyName: "weekNumberTemplate", first: true, predicate: WeekNumberCellTemplateDirective, descendants: true }, { propertyName: "headerTitleTemplate", first: true, predicate: HeaderTitleTemplateDirective, descendants: true }, { propertyName: "headerTemplate", first: true, predicate: HeaderTemplateDirective, descendants: true }, { propertyName: "footerTemplate", first: true, predicate: FooterTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "toggleButton", first: true, predicate: ["toggleButton"], descendants: true, static: true }, { propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, read: TemplateRef, static: true }, { propertyName: "actionSheet", first: true, predicate: ["actionSheet"], descendants: true }], exportAs: ["kendo-datetimepicker"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `
1507
- <ng-container
1508
- kendoDateTimePickerLocalizedMessages
1509
-
1510
- i18n-dateTab="kendo.datetimepicker.dateTab|The Date tab text in the datetimepicker popup header"
1511
- dateTab="Date"
1512
-
1513
- i18n-dateTabLabel="kendo.datetimepicker.dateTabLabel|The label for the Date tab in the datetimepicker popup header"
1514
- dateTabLabel="Date tab"
1515
-
1516
- i18n-timeTab="kendo.datetimepicker.timeTab|The Time tab text in the datetimepicker popup header"
1517
- timeTab="Time"
1518
-
1519
- i18n-timeTabLabel="kendo.datetimepicker.timeTabLabel|The label for the Time tab in the datetimepicker popup header"
1520
- timeTabLabel="Time tab"
1521
-
1522
- i18n-toggle="kendo.datetimepicker.toggle|The title of the toggle button in the datetimepicker component"
1523
- toggle="Toggle popup"
1524
-
1525
- i18n-accept="kendo.datetimepicker.accept|The Accept button text in the datetimepicker component"
1526
- accept="Set"
1527
-
1528
- i18n-acceptLabel="kendo.datetimepicker.acceptLabel|The label for the Accept button in the datetimepicker component"
1529
- acceptLabel="Set"
1530
-
1531
- i18n-cancel="kendo.datetimepicker.cancel|The Cancel button text in the datetimepicker component"
1532
- cancel="Cancel"
1533
-
1534
- i18n-cancelLabel="kendo.datetimepicker.cancelLabel|The label for the Cancel button in the datetimepicker component"
1535
- cancelLabel="Cancel"
1536
-
1537
- i18n-now="kendo.datetimepicker.now|The Now button text in the timepicker component"
1538
- now="NOW"
1539
-
1540
- i18n-nowLabel="kendo.datetimepicker.nowLabel|The label for the Now button in the timepicker component"
1541
- nowLabel="Select now"
1542
-
1543
- i18n-today="kendo.datetimepicker.today|The label for the today button in the calendar header"
1544
- today="Today"
1545
-
1546
- i18n-prevButtonTitle="kendo.datetimepicker.prevButtonTitle|The title of the previous button in the Classic calendar"
1547
- prevButtonTitle="Navigate to previous view"
1548
-
1549
- i18n-nextButtonTitle="kendo.datetimepicker.nextButtonTitle|The title of the next button in the Classic calendar"
1550
- nextButtonTitle="Navigate to next view"
1551
-
1552
- i18n-parentViewButtonTitle="kendo.datetimepicker.parentViewButtonTitle|The title of the parent view button in the calendar header"
1553
- parentViewButtonTitle="Navigate to parent view"
1554
-
1555
- i18n-hour="kendo.datetimepicker.hour|The label for the hour part in the timepicker component"
1556
- hour="Hour"
1557
-
1558
- i18n-minute="kendo.datetimepicker.minute|The label for the minute part in the timepicker component"
1559
- minute="Minute"
1560
-
1561
- i18n-second="kendo.datetimepicker.second|The label for the second part in the timepicker component"
1562
- second="Second"
1563
-
1564
- i18n-millisecond="kendo.datetimepicker.millisecond|The label for the millisecond part in the timepicker component"
1565
- millisecond="Millisecond"
1566
-
1567
- i18n-dayperiod="kendo.datetimepicker.dayperiod|The label for the dayperiod part in the timepicker component"
1568
- dayperiod="Dayperiod"
1569
-
1570
- i18n-clearTitle="kendo.datetimepicker.clearTitle|The title of the clear button"
1571
- clearTitle="clear"
1572
-
1573
- i18n-adaptiveCloseButtonTitle="kendo.datetimepicker.adaptiveCloseButtonTitle|The title of the Close button of the ActionSheet that is rendered instead of the Popup when using small screen devices in adaptive mode"
1574
- adaptiveCloseButtonTitle="Close"
1575
- >
1576
- </ng-container>
1577
-
1578
- <kendo-dateinput
1579
- [value]="value"
1580
- [format]="format"
1581
- [clearButton]="clearButton"
1582
- [twoDigitYearMax]="twoDigitYearMax"
1583
- [min]="min"
1584
- [max]="max"
1585
- [incompleteDateValidation]="incompleteDateValidation"
1586
- [autoCorrectParts]="autoCorrectParts"
1587
- [autoSwitchParts]="autoSwitchParts"
1588
- [autoSwitchKeys]="autoSwitchKeys"
1589
- [enableMouseWheel]="enableMouseWheel"
1590
- [allowCaretMode]="allowCaretMode"
1591
- [autoFill]="autoFill"
1592
- [formatPlaceholder]="formatPlaceholder"
1593
- [placeholder]="placeholder"
1594
- [disabled]="disabled"
1595
- [focusableId]="focusableId"
1596
- [readonly]="readonly || readOnlyInput"
1597
- [role]="'combobox'"
1598
- [ariaReadOnly]="readonly"
1599
- [steps]="steps"
1600
- [tabindex]="tabindex"
1601
- [isRequired]="isControlRequired"
1602
- [title]="adaptiveTitle"
1603
- pickerType="datetimepicker"
1604
- hasPopup="dialog"
1605
- [inputAttributes]="inputAttributes"
1606
- [isPopupOpen]="isOpen"
1607
- (valueChange)="handleInputValueChange($event)"
1608
- [kendoEventsOutsideAngular]="{
1609
- keydown: handleKeyDown
1610
- }"
1611
- [scope]="this"
1612
- fillMode="none"
1613
- rounded="none"
1614
- size="none"
1615
- (click)="handleDateInputClick()"
1616
- >
1617
- <kendo-dateinput-messages
1618
- [clearTitle]="localization.get('clearTitle')"
1619
- >
1620
- </kendo-dateinput-messages>
1621
- </kendo-dateinput>
1622
- <button
1623
- #toggleButton
1624
- type="button"
1625
- class="k-input-button k-button k-icon-button"
1626
- [tabindex]="-1"
1627
- [attr.title]="localization.get('toggle')"
1628
- [attr.aria-label]="localization.get('toggle')"
1629
- [attr.disabled]="disabled ? '' : null"
1630
- [kendoEventsOutsideAngular]="{
1631
- mousedown: preventMouseDown,
1632
- click: handleIconClick
1633
- }"
1634
- [scope]="this"
1635
- >
1636
- @if (activeTab === 'date') {
1637
- <kendo-icon-wrapper
1638
- name="calendar"
1639
- [svgIcon]="calendarIcon"
1640
- innerCssClass="k-button-icon"
1641
- >
1642
- </kendo-icon-wrapper>
1643
- }
1644
- @if (activeTab === 'time') {
1645
- <kendo-icon-wrapper
1646
- name="clock"
1647
- [svgIcon]="clockIcon"
1648
- innerCssClass="k-button-icon"
1649
- >
1650
- </kendo-icon-wrapper>
1651
- }
1652
- </button>
1653
-
1654
- <ng-container #container></ng-container>
1655
-
1656
- <ng-template #popupTemplate>
1657
- <ng-container *ngTemplateOutlet="dateTimeTemplate"></ng-container>
1658
- </ng-template>
1659
-
1660
- @if (isAdaptiveModeEnabled) {
1661
- <kendo-resize-sensor (resize)="onResize()"></kendo-resize-sensor>
1662
- }
1663
-
1664
- <kendo-actionsheet
1665
- #actionSheet
1666
- (overlayClick)="toggleActionSheet(false)"
1667
- (collapse)="handleActionSheetCollapse()"
1668
- [titleId]="calendar?.headerId"
1669
- [cssClass]="{
1670
- 'k-adaptive-actionsheet': true,
1671
- 'k-actionsheet-fullscreen': windowSize === 'small',
1672
- 'k-actionsheet-bottom': windowSize === 'medium'
1673
- }"
1674
- [cssStyle]="{
1675
- height: windowSize === 'small' ? '100vh' : '60vh'
1676
- }"
1677
- >
1678
- <ng-template kendoActionSheetTemplate>
1679
- <div class="k-actionsheet-titlebar">
1680
- <div class="k-actionsheet-titlebar-group">
1681
- <div class="k-actionsheet-title">
1682
- @if (adaptiveTitle) {
1683
- <div class="k-text-center">{{ adaptiveTitle }}</div>
1684
- }
1685
- @if (adaptiveSubtitle) {
1686
- <div class="k-actionsheet-subtitle k-text-center">{{ adaptiveSubtitle }}</div>
1687
- }
1688
- </div>
1689
- <div class="k-actionsheet-actions">
1690
- <button
1691
- kendoButton
1692
- type="button"
1693
- icon="check"
1694
- [attr.title]="localization.get('adaptiveCloseButtonTitle')"
1695
- [svgIcon]="checkIcon"
1696
- fillMode="flat"
1697
- themeColor="primary"
1698
- [tabIndex]="-1"
1699
- size="large"
1700
- innerCssClass="k-button-icon"
1701
- (click)="toggleActionSheet(false)">
1702
- </button>
1703
- </div>
1704
- </div>
1705
- </div>
1706
- <div class="k-actionsheet-content">
1707
- <ng-container *ngTemplateOutlet="dateTimeTemplate"></ng-container>
1708
- </div>
1709
- <div class="k-actions k-actions-stretched k-actions-horizontal k-actionsheet-footer">
1710
- @if (cancelButton) {
1711
- <button kendoButton
1712
- class="k-time-cancel"
1713
- type="button"
1714
- (click)="handleCancel()"
1715
- size="large"
1716
- [attr.title]="localization.get('cancelLabel')"
1717
- [attr.aria-label]="localization.get('cancelLabel')"
1718
- >
1719
- {{localization.get('cancel')}}
1720
- </button>
1721
- }
1722
-
1723
- <button kendoButton
1724
- type="button"
1725
- class="k-time-accept"
1726
- (click)="handleAccept()"
1727
- [disabled]="!calendarValue"
1728
- size="large"
1729
- themeColor="primary"
1730
- [attr.title]="localization.get('acceptLabel')"
1731
- [attr.aria-label]="localization.get('acceptLabel')"
1732
- >
1733
- {{localization.get('accept')}}
1734
- </button>
1735
- </div>
1736
- </ng-template>
1737
- </kendo-actionsheet>
1738
-
1739
- <ng-template #dateTimeTemplate>
1740
- <div
1741
- class="k-datetime-wrap k-{{activeTab}}-tab"
1742
- [ngClass]="{
1743
- 'k-datetime-wrap-md': !isAdaptive,
1744
- 'k-datetime-wrap-lg': isAdaptive
1745
- }"
1746
- [kendoEventsOutsideAngular]="{
1747
- mousedown: preventMouseDown,
1748
- keydown: handleKeyDown
1749
- }"
1750
- [scope]="this"
1751
- >
1752
- <div class="k-datetime-buttongroup"
1753
- [kendoEventsOutsideAngular]="{
1754
- focusin: handleFocus,
1755
- focusout: handleBlur
1756
- }"
1757
- [scope]="this"
1758
- >
1759
- <div class="k-button-group k-button-group-solid k-button-group-stretched" role="group">
1760
- <button kendoButton
1761
- type="button"
1762
- class="k-group-start"
1763
- [size]="isAdaptive ? 'large' : size"
1764
- [class.k-selected]="activeTab === 'date'"
1765
- [attr.aria-pressed]="activeTab === 'date' ? 'true' : 'false'"
1766
- [attr.title]="localization.get('dateTabLabel')"
1767
- [attr.aria-label]="localization.get('dateTabLabel')"
1768
- [kendoEventsOutsideAngular]="{
1769
- click: changeActiveTab.bind(this, 'date'),
1770
- 'keydown.shift.tab': handleTab
1771
- }"
1772
- [scope]="this"
1773
- >
1774
- {{localization.get('dateTab')}}
1775
- </button>
1776
- <button kendoButton
1777
- type="button"
1778
- class="k-group-end"
1779
- [size]="isAdaptive ? 'large' : size"
1780
- [class.k-selected]="activeTab === 'time'"
1781
- [attr.aria-pressed]="activeTab === 'time' ? 'true' : 'false'"
1782
- [attr.title]="localization.get('timeTabLabel')"
1783
- [attr.aria-label]="localization.get('timeTabLabel')"
1784
- [kendoEventsOutsideAngular]="{
1785
- click: changeActiveTab.bind(this, 'time'),
1786
- 'keydown.tab': handleTab
1787
- }"
1788
- [scope]="this"
1789
- >
1790
- {{localization.get('timeTab')}}
1791
- </button>
1792
- </div>
1793
- </div>
1794
- <div
1795
- #dateTimeSelector
1796
- class="k-datetime-selector"
1797
- [style.transition]="tabSwitchTransition"
1798
- [kendoEventsOutsideAngular]="{
1799
- transitionend: handleTabChangeTransitionEnd.bind(this, dateTimeSelector)
1800
- }"
1801
- >
1802
- <div class="k-datetime-calendar-wrap">
1803
- <kendo-calendar
1804
- #calendar
1805
- [focusedDate]="focusedDate"
1806
- [size]="isAdaptive ? 'large' : size"
1807
- [(value)]="calendarValue"
1808
- [type]="calendarType"
1809
- [min]="calendarMin"
1810
- [max]="calendarMax"
1811
- [weekDaysFormat]="weekDaysFormat"
1812
- [weekNumber]="weekNumber"
1813
- [navigation]="false"
1814
- [animateNavigation]="animateCalendarNavigation"
1815
- [showOtherMonthDays]="showOtherMonthDays"
1816
- [cellTemplate]="cellTemplate"
1817
- [monthCellTemplate]="monthCellTemplate"
1818
- [yearCellTemplate]="yearCellTemplate"
1819
- [decadeCellTemplate]="decadeCellTemplate"
1820
- [centuryCellTemplate]="centuryCellTemplate"
1821
- [weekNumberTemplate]="weekNumberTemplate"
1822
- [headerTitleTemplate]="headerTitleTemplate"
1823
- [headerTemplate]="headerTemplate"
1824
- [footerTemplate]="footerTemplate"
1825
- [footer]="footer"
1826
- [disabled]="disableCalendar"
1827
- [disabledDates]="disabledDates"
1828
- (valueChange)="handleCalendarValueChange()"
1829
- >
1830
- <kendo-calendar-messages
1831
- [today]="localization.get('today')"
1832
- [prevButtonTitle]="localization.get('prevButtonTitle')"
1833
- [nextButtonTitle]="localization.get('nextButtonTitle')"
1834
- [parentViewButtonTitle]="localization.get('parentViewButtonTitle')"
1835
- >
1836
- </kendo-calendar-messages>
1837
- </kendo-calendar>
1838
- </div>
1839
- <div class="k-datetime-time-wrap">
1840
- <kendo-timeselector
1841
- [ngClass]="{'k-timeselector-lg': isAdaptive}"
1842
- [value]="value"
1843
- [format]="timeSelectorFormat"
1844
- [min]="timeSelectorMin"
1845
- [max]="timeSelectorMax"
1846
- [setButton]="false"
1847
- [cancelButton]="false"
1848
- [steps]="steps"
1849
- [disabled]="disableTimeSelector"
1850
- [isAdaptiveEnabled]="isAdaptiveModeEnabled"
1851
- [isDateTimePicker]="true"
1852
- (tabOutLastPart)="onTabOutLastPart()"
1853
- (tabOutFirstPart)="onTabOutFirstPart()"
1854
- (tabOutNow)="onTabOutNow()"
1855
- >
1856
- <kendo-timeselector-messages
1857
- [acceptLabel]="localization.get('acceptLabel')"
1858
- [accept]="localization.get('accept')"
1859
- [cancelLabel]="localization.get('cancelLabel')"
1860
- [cancel]="localization.get('cancel')"
1861
- [nowLabel]="localization.get('nowLabel')"
1862
- [now]="localization.get('now')"
1863
- [hour]="localization.get('hour')"
1864
- [minute]="localization.get('minute')"
1865
- [second]="localization.get('second')"
1866
- [millisecond]="localization.get('millisecond')"
1867
- [dayperiod]="localization.get('dayperiod')"
1868
- >
1869
- </kendo-timeselector-messages>
1870
- </kendo-timeselector>
1871
- </div>
1872
- </div>
1873
- @if (!isAdaptive) {
1874
- <div
1875
- class="k-datetime-footer k-actions k-actions-stretched k-actions-horizontal"
1876
- [kendoEventsOutsideAngular]="{
1877
- focusin: handleFocus,
1878
- focusout: handleBlur
1879
- }"
1880
- [scope]="this"
1881
- >
1882
- <button kendoButton
1883
- type="button"
1884
- class="k-time-accept"
1885
- themeColor="primary"
1886
- [attr.title]="localization.get('acceptLabel')"
1887
- [attr.aria-label]="localization.get('acceptLabel')"
1888
- [disabled]="!calendarValue"
1889
- [kendoEventsOutsideAngular]="{
1890
- click: handleAccept,
1891
- 'keydown.tab': handleTab,
1892
- 'keydown.shift.tab': handleTab
1893
- }"
1894
- [scope]="this"
1895
- >
1896
- {{localization.get('accept')}}
1897
- </button>
1898
- @if (cancelButton) {
1899
- <button kendoButton
1900
- type="button"
1901
- class="k-time-cancel"
1902
- [attr.title]="localization.get('cancelLabel')"
1903
- [attr.aria-label]="localization.get('cancelLabel')"
1904
- [kendoEventsOutsideAngular]="{
1905
- click: handleCancel,
1906
- 'keydown.tab': handleTab,
1907
- 'keydown.shift.tab': handleTab
1908
- }"
1909
- [scope]="this"
1910
- >
1911
- {{localization.get('cancel')}}
1912
- </button>
1913
- }
1914
- </div>
1915
- }
1916
- </div>
1917
- </ng-template>
1918
- `, isInline: true, dependencies: [{ kind: "directive", type: LocalizedMessagesDirective, selector: "[kendoDateTimePickerLocalizedMessages]" }, { kind: "component", type: DateInputComponent, selector: "kendo-dateinput", inputs: ["focusableId", "pickerType", "clearButton", "disabled", "readonly", "title", "tabindex", "role", "ariaReadOnly", "tabIndex", "isRequired", "format", "formatPlaceholder", "placeholder", "steps", "max", "min", "rangeValidation", "autoCorrectParts", "autoSwitchParts", "autoSwitchKeys", "allowCaretMode", "autoFill", "incompleteDateValidation", "twoDigitYearMax", "enableMouseWheel", "value", "spinners", "isPopupOpen", "hasPopup", "size", "rounded", "fillMode", "inputAttributes"], outputs: ["valueChange", "valueUpdate", "focus", "blur"], exportAs: ["kendo-dateinput"] }, { kind: "directive", type: EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { kind: "component", type: DateInputCustomMessagesComponent, selector: "kendo-dateinput-messages" }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: ["rateLimit"], outputs: ["resize"] }, { kind: "component", type: ActionSheetComponent, selector: "kendo-actionsheet", inputs: ["actions", "actionsLayout", "overlayClickClose", "title", "subtitle", "items", "cssClass", "cssStyle", "animation", "expanded", "titleId", "initialFocus"], outputs: ["expandedChange", "action", "expand", "collapse", "itemClick", "overlayClick"], exportAs: ["kendoActionSheet"] }, { kind: "directive", type: ActionSheetTemplateDirective, selector: "[kendoActionSheetTemplate]" }, { kind: "component", type: ButtonComponent, selector: "button[kendoButton]", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: CalendarComponent, selector: "kendo-calendar", inputs: ["showOtherMonthDays", "id", "focusedDate", "min", "max", "rangeValidation", "weekDaysFormat", "footer", "selection", "allowReverse", "value", "disabled", "tabindex", "tabIndex", "disabledDates", "navigation", "activeView", "bottomView", "topView", "type", "animateNavigation", "weekNumber", "cellTemplate", "monthCellTemplate", "yearCellTemplate", "decadeCellTemplate", "centuryCellTemplate", "weekNumberTemplate", "headerTitleTemplate", "headerTemplate", "footerTemplate", "navigationItemTemplate", "size", "activeRangeEnd"], outputs: ["closePopup", "activeViewChange", "navigate", "activeViewDateChange", "blur", "focus", "valueChange"], exportAs: ["kendo-calendar"] }, { kind: "component", type: CalendarCustomMessagesComponent, selector: "kendo-calendar-messages" }, { kind: "component", type: TimeSelectorComponent, selector: "kendo-timeselector", inputs: ["format", "min", "max", "cancelButton", "setButton", "nowButton", "disabled", "isAdaptiveEnabled", "isDateTimePicker", "steps", "value"], outputs: ["valueChange", "valueReject", "tabOutLastPart", "tabOutFirstPart", "tabOutNow"], exportAs: ["kendo-timeselector"] }, { kind: "component", type: TimeSelectorCustomMessagesComponent, selector: "kendo-timeselector-messages" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1919
- }
1920
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DateTimePickerComponent, decorators: [{
1921
- type: Component,
1922
- args: [{
1923
- selector: 'kendo-datetimepicker',
1924
- exportAs: 'kendo-datetimepicker',
1925
- changeDetection: ChangeDetectionStrategy.OnPush,
1926
- providers: [
1927
- PickerService,
1928
- LocalizationService,
1929
- DisabledDatesService,
1930
- { provide: L10N_PREFIX, useValue: 'kendo.datetimepicker' },
1931
- { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DateTimePickerComponent), multi: true },
1932
- { provide: NG_VALIDATORS, useExisting: forwardRef(() => DateTimePickerComponent), multi: true },
1933
- { provide: KendoInput, useExisting: forwardRef(() => DateTimePickerComponent) },
1934
- { provide: MultiTabStop, useExisting: forwardRef(() => DateTimePickerComponent) }
1935
- ],
1936
- template: `
1937
- <ng-container
1938
- kendoDateTimePickerLocalizedMessages
1939
-
1940
- i18n-dateTab="kendo.datetimepicker.dateTab|The Date tab text in the datetimepicker popup header"
1941
- dateTab="Date"
1942
-
1943
- i18n-dateTabLabel="kendo.datetimepicker.dateTabLabel|The label for the Date tab in the datetimepicker popup header"
1944
- dateTabLabel="Date tab"
1945
-
1946
- i18n-timeTab="kendo.datetimepicker.timeTab|The Time tab text in the datetimepicker popup header"
1947
- timeTab="Time"
1948
-
1949
- i18n-timeTabLabel="kendo.datetimepicker.timeTabLabel|The label for the Time tab in the datetimepicker popup header"
1950
- timeTabLabel="Time tab"
1951
-
1952
- i18n-toggle="kendo.datetimepicker.toggle|The title of the toggle button in the datetimepicker component"
1953
- toggle="Toggle popup"
1954
-
1955
- i18n-accept="kendo.datetimepicker.accept|The Accept button text in the datetimepicker component"
1956
- accept="Set"
1957
-
1958
- i18n-acceptLabel="kendo.datetimepicker.acceptLabel|The label for the Accept button in the datetimepicker component"
1959
- acceptLabel="Set"
1960
-
1961
- i18n-cancel="kendo.datetimepicker.cancel|The Cancel button text in the datetimepicker component"
1962
- cancel="Cancel"
1963
-
1964
- i18n-cancelLabel="kendo.datetimepicker.cancelLabel|The label for the Cancel button in the datetimepicker component"
1965
- cancelLabel="Cancel"
1966
-
1967
- i18n-now="kendo.datetimepicker.now|The Now button text in the timepicker component"
1968
- now="NOW"
1969
-
1970
- i18n-nowLabel="kendo.datetimepicker.nowLabel|The label for the Now button in the timepicker component"
1971
- nowLabel="Select now"
1972
-
1973
- i18n-today="kendo.datetimepicker.today|The label for the today button in the calendar header"
1974
- today="Today"
1975
-
1976
- i18n-prevButtonTitle="kendo.datetimepicker.prevButtonTitle|The title of the previous button in the Classic calendar"
1977
- prevButtonTitle="Navigate to previous view"
1978
-
1979
- i18n-nextButtonTitle="kendo.datetimepicker.nextButtonTitle|The title of the next button in the Classic calendar"
1980
- nextButtonTitle="Navigate to next view"
1981
-
1982
- i18n-parentViewButtonTitle="kendo.datetimepicker.parentViewButtonTitle|The title of the parent view button in the calendar header"
1983
- parentViewButtonTitle="Navigate to parent view"
1984
-
1985
- i18n-hour="kendo.datetimepicker.hour|The label for the hour part in the timepicker component"
1986
- hour="Hour"
1987
-
1988
- i18n-minute="kendo.datetimepicker.minute|The label for the minute part in the timepicker component"
1989
- minute="Minute"
1990
-
1991
- i18n-second="kendo.datetimepicker.second|The label for the second part in the timepicker component"
1992
- second="Second"
1993
-
1994
- i18n-millisecond="kendo.datetimepicker.millisecond|The label for the millisecond part in the timepicker component"
1995
- millisecond="Millisecond"
1996
-
1997
- i18n-dayperiod="kendo.datetimepicker.dayperiod|The label for the dayperiod part in the timepicker component"
1998
- dayperiod="Dayperiod"
1999
-
2000
- i18n-clearTitle="kendo.datetimepicker.clearTitle|The title of the clear button"
2001
- clearTitle="clear"
2002
-
2003
- i18n-adaptiveCloseButtonTitle="kendo.datetimepicker.adaptiveCloseButtonTitle|The title of the Close button of the ActionSheet that is rendered instead of the Popup when using small screen devices in adaptive mode"
2004
- adaptiveCloseButtonTitle="Close"
2005
- >
2006
- </ng-container>
2007
-
2008
- <kendo-dateinput
2009
- [value]="value"
2010
- [format]="format"
2011
- [clearButton]="clearButton"
2012
- [twoDigitYearMax]="twoDigitYearMax"
2013
- [min]="min"
2014
- [max]="max"
2015
- [incompleteDateValidation]="incompleteDateValidation"
2016
- [autoCorrectParts]="autoCorrectParts"
2017
- [autoSwitchParts]="autoSwitchParts"
2018
- [autoSwitchKeys]="autoSwitchKeys"
2019
- [enableMouseWheel]="enableMouseWheel"
2020
- [allowCaretMode]="allowCaretMode"
2021
- [autoFill]="autoFill"
2022
- [formatPlaceholder]="formatPlaceholder"
2023
- [placeholder]="placeholder"
2024
- [disabled]="disabled"
2025
- [focusableId]="focusableId"
2026
- [readonly]="readonly || readOnlyInput"
2027
- [role]="'combobox'"
2028
- [ariaReadOnly]="readonly"
2029
- [steps]="steps"
2030
- [tabindex]="tabindex"
2031
- [isRequired]="isControlRequired"
2032
- [title]="adaptiveTitle"
2033
- pickerType="datetimepicker"
2034
- hasPopup="dialog"
2035
- [inputAttributes]="inputAttributes"
2036
- [isPopupOpen]="isOpen"
2037
- (valueChange)="handleInputValueChange($event)"
2038
- [kendoEventsOutsideAngular]="{
2039
- keydown: handleKeyDown
2040
- }"
2041
- [scope]="this"
2042
- fillMode="none"
2043
- rounded="none"
2044
- size="none"
2045
- (click)="handleDateInputClick()"
2046
- >
2047
- <kendo-dateinput-messages
2048
- [clearTitle]="localization.get('clearTitle')"
2049
- >
2050
- </kendo-dateinput-messages>
2051
- </kendo-dateinput>
2052
- <button
2053
- #toggleButton
2054
- type="button"
2055
- class="k-input-button k-button k-icon-button"
2056
- [tabindex]="-1"
2057
- [attr.title]="localization.get('toggle')"
2058
- [attr.aria-label]="localization.get('toggle')"
2059
- [attr.disabled]="disabled ? '' : null"
2060
- [kendoEventsOutsideAngular]="{
2061
- mousedown: preventMouseDown,
2062
- click: handleIconClick
2063
- }"
2064
- [scope]="this"
2065
- >
2066
- @if (activeTab === 'date') {
2067
- <kendo-icon-wrapper
2068
- name="calendar"
2069
- [svgIcon]="calendarIcon"
2070
- innerCssClass="k-button-icon"
2071
- >
2072
- </kendo-icon-wrapper>
2073
- }
2074
- @if (activeTab === 'time') {
2075
- <kendo-icon-wrapper
2076
- name="clock"
2077
- [svgIcon]="clockIcon"
2078
- innerCssClass="k-button-icon"
2079
- >
2080
- </kendo-icon-wrapper>
2081
- }
2082
- </button>
2083
-
2084
- <ng-container #container></ng-container>
2085
-
2086
- <ng-template #popupTemplate>
2087
- <ng-container *ngTemplateOutlet="dateTimeTemplate"></ng-container>
2088
- </ng-template>
2089
-
2090
- @if (isAdaptiveModeEnabled) {
2091
- <kendo-resize-sensor (resize)="onResize()"></kendo-resize-sensor>
2092
- }
2093
-
2094
- <kendo-actionsheet
2095
- #actionSheet
2096
- (overlayClick)="toggleActionSheet(false)"
2097
- (collapse)="handleActionSheetCollapse()"
2098
- [titleId]="calendar?.headerId"
2099
- [cssClass]="{
2100
- 'k-adaptive-actionsheet': true,
2101
- 'k-actionsheet-fullscreen': windowSize === 'small',
2102
- 'k-actionsheet-bottom': windowSize === 'medium'
2103
- }"
2104
- [cssStyle]="{
2105
- height: windowSize === 'small' ? '100vh' : '60vh'
2106
- }"
2107
- >
2108
- <ng-template kendoActionSheetTemplate>
2109
- <div class="k-actionsheet-titlebar">
2110
- <div class="k-actionsheet-titlebar-group">
2111
- <div class="k-actionsheet-title">
2112
- @if (adaptiveTitle) {
2113
- <div class="k-text-center">{{ adaptiveTitle }}</div>
2114
- }
2115
- @if (adaptiveSubtitle) {
2116
- <div class="k-actionsheet-subtitle k-text-center">{{ adaptiveSubtitle }}</div>
2117
- }
2118
- </div>
2119
- <div class="k-actionsheet-actions">
2120
- <button
2121
- kendoButton
2122
- type="button"
2123
- icon="check"
2124
- [attr.title]="localization.get('adaptiveCloseButtonTitle')"
2125
- [svgIcon]="checkIcon"
2126
- fillMode="flat"
2127
- themeColor="primary"
2128
- [tabIndex]="-1"
2129
- size="large"
2130
- innerCssClass="k-button-icon"
2131
- (click)="toggleActionSheet(false)">
2132
- </button>
2133
- </div>
2134
- </div>
2135
- </div>
2136
- <div class="k-actionsheet-content">
2137
- <ng-container *ngTemplateOutlet="dateTimeTemplate"></ng-container>
2138
- </div>
2139
- <div class="k-actions k-actions-stretched k-actions-horizontal k-actionsheet-footer">
2140
- @if (cancelButton) {
2141
- <button kendoButton
2142
- class="k-time-cancel"
2143
- type="button"
2144
- (click)="handleCancel()"
2145
- size="large"
2146
- [attr.title]="localization.get('cancelLabel')"
2147
- [attr.aria-label]="localization.get('cancelLabel')"
2148
- >
2149
- {{localization.get('cancel')}}
2150
- </button>
2151
- }
2152
-
2153
- <button kendoButton
2154
- type="button"
2155
- class="k-time-accept"
2156
- (click)="handleAccept()"
2157
- [disabled]="!calendarValue"
2158
- size="large"
2159
- themeColor="primary"
2160
- [attr.title]="localization.get('acceptLabel')"
2161
- [attr.aria-label]="localization.get('acceptLabel')"
2162
- >
2163
- {{localization.get('accept')}}
2164
- </button>
2165
- </div>
2166
- </ng-template>
2167
- </kendo-actionsheet>
2168
-
2169
- <ng-template #dateTimeTemplate>
2170
- <div
2171
- class="k-datetime-wrap k-{{activeTab}}-tab"
2172
- [ngClass]="{
2173
- 'k-datetime-wrap-md': !isAdaptive,
2174
- 'k-datetime-wrap-lg': isAdaptive
2175
- }"
2176
- [kendoEventsOutsideAngular]="{
2177
- mousedown: preventMouseDown,
2178
- keydown: handleKeyDown
2179
- }"
2180
- [scope]="this"
2181
- >
2182
- <div class="k-datetime-buttongroup"
2183
- [kendoEventsOutsideAngular]="{
2184
- focusin: handleFocus,
2185
- focusout: handleBlur
2186
- }"
2187
- [scope]="this"
2188
- >
2189
- <div class="k-button-group k-button-group-solid k-button-group-stretched" role="group">
2190
- <button kendoButton
2191
- type="button"
2192
- class="k-group-start"
2193
- [size]="isAdaptive ? 'large' : size"
2194
- [class.k-selected]="activeTab === 'date'"
2195
- [attr.aria-pressed]="activeTab === 'date' ? 'true' : 'false'"
2196
- [attr.title]="localization.get('dateTabLabel')"
2197
- [attr.aria-label]="localization.get('dateTabLabel')"
2198
- [kendoEventsOutsideAngular]="{
2199
- click: changeActiveTab.bind(this, 'date'),
2200
- 'keydown.shift.tab': handleTab
2201
- }"
2202
- [scope]="this"
2203
- >
2204
- {{localization.get('dateTab')}}
2205
- </button>
2206
- <button kendoButton
2207
- type="button"
2208
- class="k-group-end"
2209
- [size]="isAdaptive ? 'large' : size"
2210
- [class.k-selected]="activeTab === 'time'"
2211
- [attr.aria-pressed]="activeTab === 'time' ? 'true' : 'false'"
2212
- [attr.title]="localization.get('timeTabLabel')"
2213
- [attr.aria-label]="localization.get('timeTabLabel')"
2214
- [kendoEventsOutsideAngular]="{
2215
- click: changeActiveTab.bind(this, 'time'),
2216
- 'keydown.tab': handleTab
2217
- }"
2218
- [scope]="this"
2219
- >
2220
- {{localization.get('timeTab')}}
2221
- </button>
2222
- </div>
2223
- </div>
2224
- <div
2225
- #dateTimeSelector
2226
- class="k-datetime-selector"
2227
- [style.transition]="tabSwitchTransition"
2228
- [kendoEventsOutsideAngular]="{
2229
- transitionend: handleTabChangeTransitionEnd.bind(this, dateTimeSelector)
2230
- }"
2231
- >
2232
- <div class="k-datetime-calendar-wrap">
2233
- <kendo-calendar
2234
- #calendar
2235
- [focusedDate]="focusedDate"
2236
- [size]="isAdaptive ? 'large' : size"
2237
- [(value)]="calendarValue"
2238
- [type]="calendarType"
2239
- [min]="calendarMin"
2240
- [max]="calendarMax"
2241
- [weekDaysFormat]="weekDaysFormat"
2242
- [weekNumber]="weekNumber"
2243
- [navigation]="false"
2244
- [animateNavigation]="animateCalendarNavigation"
2245
- [showOtherMonthDays]="showOtherMonthDays"
2246
- [cellTemplate]="cellTemplate"
2247
- [monthCellTemplate]="monthCellTemplate"
2248
- [yearCellTemplate]="yearCellTemplate"
2249
- [decadeCellTemplate]="decadeCellTemplate"
2250
- [centuryCellTemplate]="centuryCellTemplate"
2251
- [weekNumberTemplate]="weekNumberTemplate"
2252
- [headerTitleTemplate]="headerTitleTemplate"
2253
- [headerTemplate]="headerTemplate"
2254
- [footerTemplate]="footerTemplate"
2255
- [footer]="footer"
2256
- [disabled]="disableCalendar"
2257
- [disabledDates]="disabledDates"
2258
- (valueChange)="handleCalendarValueChange()"
2259
- >
2260
- <kendo-calendar-messages
2261
- [today]="localization.get('today')"
2262
- [prevButtonTitle]="localization.get('prevButtonTitle')"
2263
- [nextButtonTitle]="localization.get('nextButtonTitle')"
2264
- [parentViewButtonTitle]="localization.get('parentViewButtonTitle')"
2265
- >
2266
- </kendo-calendar-messages>
2267
- </kendo-calendar>
2268
- </div>
2269
- <div class="k-datetime-time-wrap">
2270
- <kendo-timeselector
2271
- [ngClass]="{'k-timeselector-lg': isAdaptive}"
2272
- [value]="value"
2273
- [format]="timeSelectorFormat"
2274
- [min]="timeSelectorMin"
2275
- [max]="timeSelectorMax"
2276
- [setButton]="false"
2277
- [cancelButton]="false"
2278
- [steps]="steps"
2279
- [disabled]="disableTimeSelector"
2280
- [isAdaptiveEnabled]="isAdaptiveModeEnabled"
2281
- [isDateTimePicker]="true"
2282
- (tabOutLastPart)="onTabOutLastPart()"
2283
- (tabOutFirstPart)="onTabOutFirstPart()"
2284
- (tabOutNow)="onTabOutNow()"
2285
- >
2286
- <kendo-timeselector-messages
2287
- [acceptLabel]="localization.get('acceptLabel')"
2288
- [accept]="localization.get('accept')"
2289
- [cancelLabel]="localization.get('cancelLabel')"
2290
- [cancel]="localization.get('cancel')"
2291
- [nowLabel]="localization.get('nowLabel')"
2292
- [now]="localization.get('now')"
2293
- [hour]="localization.get('hour')"
2294
- [minute]="localization.get('minute')"
2295
- [second]="localization.get('second')"
2296
- [millisecond]="localization.get('millisecond')"
2297
- [dayperiod]="localization.get('dayperiod')"
2298
- >
2299
- </kendo-timeselector-messages>
2300
- </kendo-timeselector>
2301
- </div>
2302
- </div>
2303
- @if (!isAdaptive) {
2304
- <div
2305
- class="k-datetime-footer k-actions k-actions-stretched k-actions-horizontal"
2306
- [kendoEventsOutsideAngular]="{
2307
- focusin: handleFocus,
2308
- focusout: handleBlur
2309
- }"
2310
- [scope]="this"
2311
- >
2312
- <button kendoButton
2313
- type="button"
2314
- class="k-time-accept"
2315
- themeColor="primary"
2316
- [attr.title]="localization.get('acceptLabel')"
2317
- [attr.aria-label]="localization.get('acceptLabel')"
2318
- [disabled]="!calendarValue"
2319
- [kendoEventsOutsideAngular]="{
2320
- click: handleAccept,
2321
- 'keydown.tab': handleTab,
2322
- 'keydown.shift.tab': handleTab
2323
- }"
2324
- [scope]="this"
2325
- >
2326
- {{localization.get('accept')}}
2327
- </button>
2328
- @if (cancelButton) {
2329
- <button kendoButton
2330
- type="button"
2331
- class="k-time-cancel"
2332
- [attr.title]="localization.get('cancelLabel')"
2333
- [attr.aria-label]="localization.get('cancelLabel')"
2334
- [kendoEventsOutsideAngular]="{
2335
- click: handleCancel,
2336
- 'keydown.tab': handleTab,
2337
- 'keydown.shift.tab': handleTab
2338
- }"
2339
- [scope]="this"
2340
- >
2341
- {{localization.get('cancel')}}
2342
- </button>
2343
- }
2344
- </div>
2345
- }
2346
- </div>
2347
- </ng-template>
2348
- `,
2349
- standalone: true,
2350
- imports: [LocalizedMessagesDirective, DateInputComponent, EventsOutsideAngularDirective, DateInputCustomMessagesComponent, IconWrapperComponent, NgTemplateOutlet, ResizeSensorComponent, ActionSheetComponent, ActionSheetTemplateDirective, ButtonComponent, NgClass, CalendarComponent, CalendarCustomMessagesComponent, TimeSelectorComponent, TimeSelectorCustomMessagesComponent]
2351
- }]
2352
- }], ctorParameters: () => [{ type: i1.PopupService }, { type: i2.IntlService }, { type: i0.ChangeDetectorRef }, { type: i3.PickerService }, { type: i0.NgZone }, { type: i0.ElementRef }, { type: i4.LocalizationService }, { type: i5.DisabledDatesService }, { type: i0.Renderer2 }, { type: i0.Injector }, { type: i6.AdaptiveService }], propDecorators: { hostClasses: [{
2353
- type: HostBinding,
2354
- args: ['class.k-datetimepicker']
2355
- }, {
2356
- type: HostBinding,
2357
- args: ['class.k-input']
2358
- }], disabledClass: [{
2359
- type: HostBinding,
2360
- args: ['class.k-disabled']
2361
- }], toggleButton: [{
2362
- type: ViewChild,
2363
- args: ['toggleButton', { static: true }]
2364
- }], focusableId: [{
2365
- type: Input
2366
- }], weekDaysFormat: [{
2367
- type: Input
2368
- }], showOtherMonthDays: [{
2369
- type: Input
2370
- }], value: [{
2371
- type: Input
2372
- }], format: [{
2373
- type: Input
2374
- }], twoDigitYearMax: [{
2375
- type: Input
2376
- }], tabindex: [{
2377
- type: Input
2378
- }], disabledDates: [{
2379
- type: Input
2380
- }], popupSettings: [{
2381
- type: Input
2382
- }], adaptiveTitle: [{
2383
- type: Input
2384
- }], adaptiveSubtitle: [{
2385
- type: Input
2386
- }], disabled: [{
2387
- type: Input
2388
- }], readonly: [{
2389
- type: Input
2390
- }, {
2391
- type: HostBinding,
2392
- args: ['class.k-readonly']
2393
- }], readOnlyInput: [{
2394
- type: Input
2395
- }], cancelButton: [{
2396
- type: Input
2397
- }], formatPlaceholder: [{
2398
- type: Input
2399
- }], placeholder: [{
2400
- type: Input
2401
- }], steps: [{
2402
- type: Input
2403
- }], focusedDate: [{
2404
- type: Input
2405
- }], calendarType: [{
2406
- type: Input
2407
- }], animateCalendarNavigation: [{
2408
- type: Input
2409
- }], weekNumber: [{
2410
- type: Input
2411
- }], min: [{
2412
- type: Input
2413
- }], max: [{
2414
- type: Input
2415
- }], rangeValidation: [{
2416
- type: Input
2417
- }], disabledDatesValidation: [{
2418
- type: Input
2419
- }], incompleteDateValidation: [{
2420
- type: Input
2421
- }], autoCorrectParts: [{
2422
- type: Input
2423
- }], autoSwitchParts: [{
2424
- type: Input
2425
- }], autoSwitchKeys: [{
2426
- type: Input
2427
- }], enableMouseWheel: [{
2428
- type: Input
2429
- }], allowCaretMode: [{
2430
- type: Input
2431
- }], clearButton: [{
2432
- type: Input
2433
- }], autoFill: [{
2434
- type: Input
2435
- }], adaptiveMode: [{
2436
- type: Input
2437
- }], inputAttributes: [{
2438
- type: Input
2439
- }], valueChange: [{
2440
- type: Output
2441
- }], open: [{
2442
- type: Output
2443
- }], close: [{
2444
- type: Output
2445
- }], onFocus: [{
2446
- type: Output,
2447
- args: ['focus']
2448
- }], onBlur: [{
2449
- type: Output,
2450
- args: ['blur']
2451
- }], escape: [{
2452
- type: Output
2453
- }], defaultTab: [{
2454
- type: Input
2455
- }], size: [{
2456
- type: Input
2457
- }], rounded: [{
2458
- type: Input
2459
- }], fillMode: [{
2460
- type: Input
2461
- }], cellTemplate: [{
2462
- type: ContentChild,
2463
- args: [CellTemplateDirective, { static: false }]
2464
- }], monthCellTemplate: [{
2465
- type: ContentChild,
2466
- args: [MonthCellTemplateDirective, { static: false }]
2467
- }], yearCellTemplate: [{
2468
- type: ContentChild,
2469
- args: [YearCellTemplateDirective, { static: false }]
2470
- }], decadeCellTemplate: [{
2471
- type: ContentChild,
2472
- args: [DecadeCellTemplateDirective, { static: false }]
2473
- }], centuryCellTemplate: [{
2474
- type: ContentChild,
2475
- args: [CenturyCellTemplateDirective, { static: false }]
2476
- }], weekNumberTemplate: [{
2477
- type: ContentChild,
2478
- args: [WeekNumberCellTemplateDirective, { static: false }]
2479
- }], headerTitleTemplate: [{
2480
- type: ContentChild,
2481
- args: [HeaderTitleTemplateDirective, { static: false }]
2482
- }], headerTemplate: [{
2483
- type: ContentChild,
2484
- args: [HeaderTemplateDirective]
2485
- }], headerTemplateRef: [{
2486
- type: Input,
2487
- args: ['headerTemplate']
2488
- }], footerTemplate: [{
2489
- type: ContentChild,
2490
- args: [FooterTemplateDirective]
2491
- }], footerTemplateRef: [{
2492
- type: Input,
2493
- args: ['footerTemplate']
2494
- }], footer: [{
2495
- type: Input
2496
- }], container: [{
2497
- type: ViewChild,
2498
- args: ['container', { read: ViewContainerRef, static: true }]
2499
- }], popupTemplate: [{
2500
- type: ViewChild,
2501
- args: ['popupTemplate', { read: TemplateRef, static: true }]
2502
- }], actionSheet: [{
2503
- type: ViewChild,
2504
- args: ['actionSheet']
2505
- }] } });