@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,1758 +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, ChangeDetectionStrategy, ChangeDetectorRef, ElementRef, TemplateRef, EventEmitter, HostBinding, Renderer2, Input, Output, ContentChild, ViewChild, ViewContainerRef, NgZone, forwardRef, isDevMode, Injector, } from '@angular/core';
6
- import { NG_VALUE_ACCESSOR, NG_VALIDATORS, NgControl } from '@angular/forms';
7
- import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
8
- import { PopupService } from '@progress/kendo-angular-popup';
9
- import { cloneDate } from '@progress/kendo-date-math';
10
- import { hasObservers, isControlRequired, KendoInput, Keys, MultiTabStop, ResizeSensorComponent, EventsOutsideAngularDirective, normalizeKeys, parseCSSClassNames } from '@progress/kendo-angular-common';
11
- import { validatePackage } from '@progress/kendo-licensing';
12
- import { packageMetadata } from '../package-metadata';
13
- import { MIN_DATE, MAX_DATE } from '../defaults';
14
- import { minValidator } from '../validators/min.validator';
15
- import { maxValidator } from '../validators/max.validator';
16
- import { PreventableEvent } from '../preventable-event';
17
- import { CalendarViewEnum } from '../calendar/models/view.enum';
18
- import { CellTemplateDirective } from '../calendar/templates/cell-template.directive';
19
- import { MonthCellTemplateDirective } from '../calendar/templates/month-cell-template.directive';
20
- import { YearCellTemplateDirective } from '../calendar/templates/year-cell-template.directive';
21
- import { DecadeCellTemplateDirective } from '../calendar/templates/decade-cell-template.directive';
22
- import { CenturyCellTemplateDirective } from '../calendar/templates/century-cell-template.directive';
23
- import { WeekNumberCellTemplateDirective } from '../calendar/templates/weeknumber-cell-template.directive';
24
- import { HeaderTitleTemplateDirective } from '../calendar/templates/header-title-template.directive';
25
- import { NavigationItemTemplateDirective } from '../calendar/templates/navigation-item-template.directive';
26
- import { PickerService } from '../common/picker.service';
27
- import { DisabledDatesService } from '../calendar/services/disabled-dates.service';
28
- import { noop, isValidRange, setTime, isWindowAvailable, isTabExitingCalendar, getSizeClass, getRoundedClass, getFillModeClass, DEFAULT_FILL_MODE, DEFAULT_ROUNDED, DEFAULT_SIZE } from '../util';
29
- import { requiresZoneOnBlur, currentFocusTarget, attributeNames } from '../common/utils';
30
- import { fromEvent } from 'rxjs';
31
- import { incompleteDateValidator } from '../validators/incomplete-date.validator';
32
- import { disabledDatesValidator } from '../validators/disabled-date.validator';
33
- import { DateInputComponent } from '../dateinput/dateinput.component';
34
- import { calendarIcon, checkIcon } from '@progress/kendo-svg-icons';
35
- import { ActionSheetComponent, ActionSheetTemplateDirective } from '@progress/kendo-angular-navigation';
36
- import { HeaderTemplateDirective } from '../calendar/templates/header-template.directive';
37
- import { FooterTemplateDirective } from '../calendar/templates/footer-template.directive';
38
- import { CalendarCustomMessagesComponent } from '../calendar/localization/calendar-custom-messages.component';
39
- import { CalendarComponent } from '../calendar/calendar.component';
40
- import { ButtonComponent } from '@progress/kendo-angular-buttons';
41
- import { NgTemplateOutlet } from '@angular/common';
42
- import { IconWrapperComponent } from '@progress/kendo-angular-icons';
43
- import { DateInputCustomMessagesComponent } from '../dateinput/localization/dateinput-custom-messages.component';
44
- import { DatePickerLocalizedMessagesDirective } from './localization/datepicker-localized-messages.directive';
45
- import { touchEnabled } from '@progress/kendo-common';
46
- import { AdaptiveService } from '@progress/kendo-angular-utils';
47
- import * as i0 from "@angular/core";
48
- import * as i1 from "@progress/kendo-angular-l10n";
49
- import * as i2 from "@progress/kendo-angular-popup";
50
- import * as i3 from "../common/picker.service";
51
- import * as i4 from "../calendar/services/disabled-dates.service";
52
- import * as i5 from "@progress/kendo-angular-utils";
53
- const MIN_DOC_LINK = 'https://www.telerik.com/kendo-angular-ui/components/dateinputs/api/DatePickerComponent/#toc-min';
54
- const MAX_DOC_LINK = 'https://www.telerik.com/kendo-angular-ui/components/dateinputs/api/DatePickerComponent/#toc-max';
55
- const VALUE_DOC_LINK = 'https://www.telerik.com/kendo-angular-ui/components/dateinputs/datepicker/#toc-using-with-json';
56
- const DEFAULT_FORMAT = 'd';
57
- const TWO_DIGIT_YEAR_MAX = 68;
58
- /**
59
- * Represents the Kendo UI DatePicker component for Angular.
60
- * Provides a user-friendly way to select dates with a calendar popup ([see example](slug:overview_datepicker)).
61
- *
62
- * @example
63
- * ```ts
64
- * @Component({
65
- * selector: 'my-app',
66
- * template: `
67
- * <kendo-datepicker
68
- * [value]="selectedDate"
69
- * </kendo-datepicker>
70
- * `
71
- * })
72
- * export class AppComponent {
73
- * selectedDate = new Date();
74
- * }
75
- * ```
76
- *
77
- * @remarks
78
- * Supported children components are: {@link DatePickerCustomMessagesComponent}.
79
- */
80
- export class DatePickerComponent extends MultiTabStop {
81
- zone;
82
- localization;
83
- cdr;
84
- popupService;
85
- wrapper;
86
- renderer;
87
- injector;
88
- pickerService;
89
- disabledDatesService;
90
- adaptiveService;
91
- /**
92
- * @hidden
93
- */
94
- calendarIcon = calendarIcon;
95
- container;
96
- popupTemplate;
97
- toggleButton;
98
- actionSheet;
99
- /**
100
- * @hidden
101
- */
102
- focusableId;
103
- /**
104
- * @hidden
105
- */
106
- cellTemplate;
107
- /**
108
- * @hidden
109
- */
110
- set cellTemplateRef(template) {
111
- this.cellTemplate = template;
112
- }
113
- /**
114
- * Renders a clear button when set to `true` after the input text or DatePicker value changes.
115
- * Click this button to reset the component value to `null` and trigger the `valueChange` event.
116
- * @default false
117
- */
118
- clearButton = false;
119
- /**
120
- * Specifies the HTML attributes of the inner focusable input element.
121
- * You cannot change attributes that are essential for certain component functionalities.
122
- */
123
- inputAttributes;
124
- /**
125
- * @hidden
126
- */
127
- monthCellTemplate;
128
- /**
129
- * @hidden
130
- */
131
- set monthCellTemplateRef(template) {
132
- this.monthCellTemplate = template;
133
- }
134
- /**
135
- * @hidden
136
- */
137
- yearCellTemplate;
138
- /**
139
- * @hidden
140
- */
141
- set yearCellTemplateRef(template) {
142
- this.yearCellTemplate = template;
143
- }
144
- /**
145
- * @hidden
146
- */
147
- decadeCellTemplate;
148
- /**
149
- * @hidden
150
- */
151
- set decadeCellTemplateRef(template) {
152
- this.decadeCellTemplate = template;
153
- }
154
- /**
155
- * @hidden
156
- */
157
- centuryCellTemplate;
158
- /**
159
- * @hidden
160
- */
161
- set centuryCellTemplateRef(template) {
162
- this.centuryCellTemplate = template;
163
- }
164
- /**
165
- * @hidden
166
- */
167
- weekNumberTemplate;
168
- /**
169
- * @hidden
170
- */
171
- set weekNumberTemplateRef(template) {
172
- this.weekNumberTemplate = template;
173
- }
174
- /**
175
- * @hidden
176
- */
177
- headerTitleTemplate;
178
- /**
179
- * @hidden
180
- */
181
- set headerTitleTemplateRef(template) {
182
- this.headerTitleTemplate = template;
183
- }
184
- /**
185
- * @hidden
186
- */
187
- headerTemplate;
188
- /**
189
- * @hidden
190
- */
191
- set headerTemplateRef(template) {
192
- this.headerTemplate = template;
193
- }
194
- /**
195
- * @hidden
196
- */
197
- footerTemplate;
198
- /**
199
- * @hidden
200
- */
201
- set footerTemplateRef(template) {
202
- this.footerTemplate = template;
203
- }
204
- /**
205
- * Controls the visibility of the Calendar footer.
206
- * @default false
207
- */
208
- footer = false;
209
- /**
210
- * @hidden
211
- */
212
- navigationItemTemplate;
213
- /**
214
- * @hidden
215
- */
216
- set navigationItemTemplateRef(template) {
217
- this.navigationItemTemplate = template;
218
- }
219
- /**
220
- * Specifies the format of the displayed Calendar week days' names.
221
- * @default 'short'
222
- */
223
- weekDaysFormat = "short";
224
- /**
225
- * Shows the days that fall outside the current month in the Calendar ([see example]({% slug viewoptions_calendar %}#toc-displaying-other-month-days)).
226
- * The default value is `false` for infinite Calendar type and `true` for classic Calendar type.
227
- */
228
- showOtherMonthDays;
229
- /**
230
- * Specifies the active view that the Calendar initially renders ([see example]({% slug viewoptions_calendar %}#toc-active-view)).
231
- *
232
- * You have to set `activeView` within the `topView`-`bottomView` range.
233
- * @default 'month'
234
- */
235
- activeView = CalendarViewEnum[CalendarViewEnum.month];
236
- /**
237
- * Specifies the bottommost Calendar view to which you can navigate ([see example](slug:datepicker_calendar_options#toc-view-selection-depth)).
238
- * @default 'month'
239
- */
240
- bottomView = CalendarViewEnum[CalendarViewEnum.month];
241
- /**
242
- * Specifies the topmost Calendar view to which you can navigate ([see example](slug:datepicker_calendar_options#toc-view-selection-depth)).
243
- * @default 'century'
244
- */
245
- topView = CalendarViewEnum[CalendarViewEnum.century];
246
- /**
247
- * Specifies the Calendar type.
248
- * @default 'infinite'
249
- */
250
- calendarType = 'infinite';
251
- /**
252
- * Determines whether to enable animation when navigating to previous/next Calendar view.
253
- * Applies to the [`classic`]({% slug api_dateinputs_datepickercomponent %}#toc-calendartype) Calendar only.
254
- *
255
- * This 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.
256
- *
257
- * @default false
258
- */
259
- animateCalendarNavigation = false;
260
- /**
261
- * Specifies or gets the `disabled` property of the DatePicker and determines whether the component is active ([see example]({% slug disabled_datepicker %})).
262
- * To learn how to disable the component in reactive forms, refer to the article on [Forms Support](slug:formssupport_datepicker#toc-managing-the-datepicker-disabled-state-in-reactive-forms).
263
- */
264
- disabled = false;
265
- /**
266
- * Specifies the read-only state of the DatePicker ([see example]({% slug readonly_datepicker %}#toc-read-only-datepicker)).
267
- *
268
- * @default false
269
- */
270
- readonly = false;
271
- /**
272
- * Sets the read-only state of the DatePicker input field
273
- * ([see example]({% slug readonly_datepicker %}#toc-read-only-input)).
274
- *
275
- * If you set the [`readonly`]({% slug api_dateinputs_datepickercomponent %}#toc-readonly) property value to `true`,
276
- * the input will be rendered in a read-only state regardless of the `readOnlyInput` value.
277
- */
278
- readOnlyInput = false;
279
- /**
280
- * Configures the popup options of the DatePicker.
281
- *
282
- * The available options are animate which controls the popup animation and by default, the open and close animations are enabled.
283
- * The appendTo option controls the popup container and by default, the popup will be appended to the root component.
284
- * The popupClass option specifies a list of CSS classes that are used to style the popup.
285
- */
286
- set popupSettings(settings) {
287
- this._popupSettings = { animate: true, ...settings };
288
- }
289
- get popupSettings() {
290
- return this._popupSettings;
291
- }
292
- /**
293
- * Sets or gets the `navigation` property of the Calendar
294
- * and determines whether the navigation side-bar is displayed.
295
- * ([see example]({% slug sidebar_datepicker %})).
296
- */
297
- set navigation(state) {
298
- this._navigation = state;
299
- }
300
- get navigation() {
301
- if (this.isAdaptive) {
302
- return;
303
- }
304
- return this._navigation;
305
- }
306
- _navigation = true;
307
- /**
308
- * Specifies the smallest valid date
309
- * ([see example]({% slug dateranges_datepicker %})).
310
- * @default 1900-1-1
311
- */
312
- min = cloneDate(MIN_DATE);
313
- /**
314
- * Specifies the biggest valid date
315
- * ([see example]({% slug dateranges_datepicker %})).
316
- * @default 2099-12-31
317
- */
318
- max = cloneDate(MAX_DATE);
319
- /**
320
- * Determines whether the built-in validation for incomplete dates is to be enforced when a form is being validated.
321
- * @default false
322
- */
323
- incompleteDateValidation = false;
324
- /**
325
- * Determines whether to autocorrect invalid segments automatically.
326
- *
327
- * @default true
328
- */
329
- autoCorrectParts = true;
330
- /**
331
- * Determines whether to automatically move to the next segment after the user completes the current one.
332
- *
333
- * @default true
334
- */
335
- autoSwitchParts = true;
336
- /**
337
- * A string array representing custom keys, which will move the focus to the next date format segment.
338
- */
339
- autoSwitchKeys = [];
340
- /**
341
- * Indicates whether the mouse scroll can be used to increase/decrease the time segments values.
342
- *
343
- * @default true
344
- */
345
- enableMouseWheel = true;
346
- /**
347
- * Determines if the users should see a blinking caret inside the Date Input when possible.
348
- *
349
- * @default false
350
- */
351
- allowCaretMode = false;
352
- /**
353
- * When enabled, the DatePicker will autofill the rest of the date to the current date when the component loses focus.
354
- *
355
- * @default false
356
- */
357
- autoFill = false;
358
- /**
359
- * Specifies the focused date of the Calendar component
360
- * ([see example](slug:datepicker_calendar_options#toc-focused-dates)).
361
- * @default null
362
- */
363
- focusedDate = null;
364
- /**
365
- * Specifies the value of the DatePicker component.
366
- *
367
- * The `value` has to be a valid [JavaScript `Date`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date) instance or `null`.
368
- */
369
- set value(value) {
370
- this.verifyValue(value);
371
- this._value = cloneDate(value);
372
- }
373
- get value() {
374
- return this._value;
375
- }
376
- /**
377
- * Specifies the date format that is used to display the input value
378
- * ([see example]({% slug formats_datepicker %})).
379
- *
380
- * Format value options include string to provide a single format that is used regardless whether the input is focused or blurred.
381
- * FormatSettings can be used to display different formats when the component is focused or blurred by providing a settings object with specified inputFormat and displayFormat values.
382
- */
383
- format = DEFAULT_FORMAT;
384
- /**
385
- * The maximum year to assume to be from the current century when typing two-digit year value
386
- * ([see example]({% slug formats_datepicker %}#toc-two-digit-year-format)).
387
- *
388
- * The default value is 68, indicating that typing any value less than 69
389
- * will be assumed to be 20xx, while 69 and larger will be assumed to be 19xx.
390
- * @default 68
391
- */
392
- twoDigitYearMax = TWO_DIGIT_YEAR_MAX;
393
- /**
394
- * Defines the descriptions of the format sections in the input field.
395
- * ([more information and examples]({% slug placeholders_datepicker %})).
396
- *
397
- */
398
- formatPlaceholder;
399
- /**
400
- * Specifies the hint the DatePicker displays when its value is `null`.
401
- * ([more information and exaples]({% slug placeholders_datepicker %})).
402
- */
403
- placeholder;
404
- /**
405
- * Sets the `tabindex` of the DatePicker.
406
- * This property is used to set the order in which the DatePicker will receive focus when navigating through the page using the Tab key.
407
- * @default 0
408
- */
409
- tabindex = 0;
410
- /**
411
- * @hidden
412
- */
413
- set tabIndex(tabIndex) {
414
- this.tabindex = tabIndex;
415
- }
416
- get tabIndex() {
417
- return this.tabindex;
418
- }
419
- /**
420
- * Sets the dates of the DatePicker that will be disabled
421
- * ([see example]({% slug disabled_dates_datepicker %})).
422
- */
423
- set disabledDates(value) {
424
- this._disabledDates = value;
425
- this.disabledDatesService.initialize(value);
426
- }
427
- get disabledDates() {
428
- return this._disabledDates;
429
- }
430
- /**
431
- * Sets the title of the input element of the DatePicker and the title text rendered
432
- * in the header of the popup(action sheet). Applicable only when [`AdaptiveMode` is set to `auto`](slug:api_dateinputs_adaptivemode).
433
- * @default ""
434
- */
435
- adaptiveTitle = "";
436
- /**
437
- * Sets the subtitle text rendered in the header of the popup(action sheet).
438
- * Applicable only when [`AdaptiveMode` is set to `auto`](slug:api_dateinputs_adaptivemode).
439
- * @default ""
440
- */
441
- adaptiveSubtitle = "";
442
- /**
443
- * Determines whether the built-in min or max validators are enforced when validating a form.
444
- *
445
- * @default true
446
- */
447
- rangeValidation = true;
448
- /**
449
- * Determines whether the built-in validator for disabled
450
- * date ranges is enforced when validating a form
451
- * ([see example]( slug:disabled_dates_datepicker#toc-using-a-function)).
452
- * @default true
453
- */
454
- disabledDatesValidation = true;
455
- /**
456
- * Determines whether to display a week number column in the `month` view of the Calendar
457
- * ([see example](slug:datepicker_calendar_options#toc-week-number-column)).
458
- * @default false
459
- */
460
- weekNumber = false;
461
- /**
462
- * Sets the size of the component.
463
- * @default 'medium'
464
- */
465
- set size(size) {
466
- this.renderer.removeClass(this.wrapper.nativeElement, getSizeClass('input', this.size));
467
- this.renderer.removeClass(this.toggleButton.nativeElement, getSizeClass('button', this.size));
468
- const newSize = size || DEFAULT_SIZE;
469
- if (newSize !== 'none') {
470
- this.renderer.addClass(this.wrapper.nativeElement, getSizeClass('input', newSize));
471
- this.renderer.addClass(this.toggleButton.nativeElement, getSizeClass('button', newSize));
472
- }
473
- this._size = newSize;
474
- }
475
- get size() {
476
- return this._size;
477
- }
478
- /**
479
- * Specifies the border radius of the component.
480
- * @default 'medium'
481
- */
482
- set rounded(rounded) {
483
- this.renderer.removeClass(this.wrapper.nativeElement, getRoundedClass(this.rounded));
484
- const newRounded = rounded || DEFAULT_ROUNDED;
485
- if (newRounded !== 'none') {
486
- this.renderer.addClass(this.wrapper.nativeElement, getRoundedClass(newRounded));
487
- }
488
- this._rounded = newRounded;
489
- }
490
- get rounded() {
491
- return this._rounded;
492
- }
493
- /**
494
- * Specifies the fillMode of the component.
495
- * @default 'solid'
496
- */
497
- set fillMode(fillMode) {
498
- this.renderer.removeClass(this.wrapper.nativeElement, getFillModeClass('input', this.fillMode));
499
- this.renderer.removeClass(this.toggleButton.nativeElement, getFillModeClass('button', this.fillMode));
500
- this.renderer.removeClass(this.toggleButton.nativeElement, `k-button-${this.fillMode}-base`);
501
- const newFillMode = fillMode ? fillMode : DEFAULT_FILL_MODE;
502
- if (newFillMode !== 'none') {
503
- this.renderer.addClass(this.toggleButton.nativeElement, getFillModeClass('button', newFillMode));
504
- this.renderer.addClass(this.toggleButton.nativeElement, `k-button-${newFillMode}-base`);
505
- this.renderer.addClass(this.wrapper.nativeElement, getFillModeClass('input', newFillMode));
506
- }
507
- this._fillMode = newFillMode;
508
- }
509
- get fillMode() {
510
- return this._fillMode;
511
- }
512
- /**
513
- * Specifies whether to enable adaptive rendering. When enabled, the DatePicker automatically switches between a calendar popup on larger screens and an ActionSheet on mobile devices.
514
- *
515
- * @default 'none'
516
- */
517
- adaptiveMode = 'none';
518
- /**
519
- * Fires each time the user selects a new value
520
- * ([see example](slug:events_datepicker)).
521
- */
522
- valueChange = new EventEmitter();
523
- /**
524
- * Fires each time the user focuses the input element
525
- * ([see example](slug:events_datepicker)).
526
- */
527
- onFocus = new EventEmitter();
528
- /**
529
- * Fires each time the input element gets blurred
530
- * ([see example](slug:events_datepicker)).
531
- */
532
- onBlur = new EventEmitter();
533
- /**
534
- * Fires each time the popup is about to open
535
- * ([see example](slug:events_datepicker)).
536
- * This event is preventable. If you cancel the event, the popup will remain closed.
537
- */
538
- open = new EventEmitter();
539
- /**
540
- * Fires each time the popup is about to close
541
- * ([see example](slug:events_datepicker)).
542
- * This event is preventable. If you cancel the event, the popup will remain open.
543
- */
544
- close = new EventEmitter();
545
- /**
546
- * @hidden
547
- */
548
- escape = new EventEmitter();
549
- /**
550
- * @hidden
551
- */
552
- wrapperClasses = true;
553
- /**
554
- * @hidden
555
- */
556
- get disabledClass() {
557
- return this.disabled;
558
- }
559
- get popupUID() {
560
- return this.calendar?.popupId;
561
- }
562
- popupRef;
563
- get isActive() {
564
- return this._active;
565
- }
566
- set isActive(value) {
567
- this._active = value;
568
- if (!this.wrapper) {
569
- return;
570
- }
571
- const element = this.wrapper.nativeElement;
572
- if (value) {
573
- this.renderer.addClass(element, 'k-focus');
574
- }
575
- else {
576
- this.renderer.removeClass(element, 'k-focus');
577
- }
578
- }
579
- get show() {
580
- return this._show;
581
- }
582
- set show(show) {
583
- if (show && (this.disabled || this.readonly)) {
584
- return;
585
- }
586
- const skipZone = !show && (!this._show || (!hasObservers(this.close) && !hasObservers(this.open)));
587
- if (!skipZone) {
588
- this.zone.run(() => {
589
- const event = new PreventableEvent();
590
- if (!this._show && show) {
591
- this.open.emit(event);
592
- }
593
- else if (this._show && !show) {
594
- this.close.emit(event);
595
- }
596
- if (event.isDefaultPrevented()) {
597
- return;
598
- }
599
- this.toggleCalendar(show);
600
- });
601
- }
602
- else {
603
- this.toggleCalendar(show);
604
- }
605
- }
606
- /**
607
- * @hidden
608
- */
609
- checkIcon = checkIcon;
610
- /**
611
- * @hidden
612
- */
613
- windowSize;
614
- /**
615
- * @hidden
616
- */
617
- get isControlRequired() {
618
- return isControlRequired(this.control);
619
- }
620
- _popupSettings = { animate: true };
621
- _show = false;
622
- _value = null;
623
- _active = false;
624
- _disabledDates;
625
- onControlChange = noop;
626
- onControlTouched = noop;
627
- onValidatorChange = noop;
628
- minValidateFn = noop;
629
- maxValidateFn = noop;
630
- disabledDatesValidateFn = noop;
631
- incompleteValidator = noop;
632
- resolvedPromise = Promise.resolve(null);
633
- subscription;
634
- pickerSubscriptions;
635
- localizationChangeSubscription;
636
- windowBlurSubscription;
637
- ariaActiveDescendantSubscription;
638
- control;
639
- domEvents = [];
640
- _size = DEFAULT_SIZE;
641
- _rounded = DEFAULT_ROUNDED;
642
- _fillMode = DEFAULT_FILL_MODE;
643
- constructor(zone, localization, cdr, popupService, wrapper, renderer, injector, pickerService, disabledDatesService, adaptiveService) {
644
- super();
645
- this.zone = zone;
646
- this.localization = localization;
647
- this.cdr = cdr;
648
- this.popupService = popupService;
649
- this.wrapper = wrapper;
650
- this.renderer = renderer;
651
- this.injector = injector;
652
- this.pickerService = pickerService;
653
- this.disabledDatesService = disabledDatesService;
654
- this.adaptiveService = adaptiveService;
655
- validatePackage(packageMetadata);
656
- this.pickerSubscriptions = this.pickerService.onFocus.subscribe(this.handleFocus.bind(this));
657
- this.pickerSubscriptions.add(this.pickerService.onBlur.subscribe(this.handleBlur.bind(this)));
658
- this.pickerSubscriptions.add(this.pickerService.sameDateSelected.subscribe(this.handleSameSelection.bind(this)));
659
- this.pickerSubscriptions.add(this.pickerService.dateCompletenessChange.subscribe(this.handleDateCompletenessChange.bind(this)));
660
- }
661
- /**
662
- * @hidden
663
- * Used by the TextBoxContainer to determine if the component is empty.
664
- */
665
- isEmpty() {
666
- return !this.value && this.dateInput.isEmpty();
667
- }
668
- /**
669
- * @hidden
670
- */
671
- ngOnInit() {
672
- this.localizationChangeSubscription = this.localization
673
- .changes
674
- .subscribe(() => this.cdr.markForCheck());
675
- this.control = this.injector.get(NgControl, null);
676
- if (this.wrapper) {
677
- this.renderer.removeAttribute(this.wrapper.nativeElement, 'tabindex');
678
- this.zone.runOutsideAngular(() => {
679
- this.bindEvents();
680
- });
681
- }
682
- this.focusableId = this.dateInput?.focusableId;
683
- this.minValidateFn = this.rangeValidation ? minValidator(this.min) : noop;
684
- this.maxValidateFn = this.rangeValidation ? maxValidator(this.max) : noop;
685
- }
686
- ngAfterViewInit() {
687
- this.setComponentClasses();
688
- this.windowSize = this.adaptiveService.size;
689
- }
690
- /**
691
- * @hidden
692
- */
693
- ngOnChanges(changes) {
694
- this.verifySettings();
695
- if (changes.min || changes.max || changes.rangeValidation || changes.disabledDatesValidation || changes.disabledDates || changes.incompleteDateValidation) {
696
- this.minValidateFn = this.rangeValidation ? minValidator(this.min) : noop;
697
- this.maxValidateFn = this.rangeValidation ? maxValidator(this.max) : noop;
698
- this.disabledDatesValidateFn = this.disabledDatesValidation ? disabledDatesValidator(this.disabledDatesService.isDateDisabled) : noop;
699
- this.incompleteValidator = this.incompleteDateValidation ? incompleteDateValidator() : noop;
700
- this.onValidatorChange();
701
- }
702
- if (!this.focusableId || changes.focusableId) {
703
- this.focusableId = this.dateInput?.focusableId;
704
- }
705
- }
706
- /**
707
- * @hidden
708
- */
709
- ngOnDestroy() {
710
- if (this.isAdaptive && this.isOpen) {
711
- this.toggleActionSheet(false);
712
- }
713
- this.isActive = false;
714
- this.show = false;
715
- if (this.localizationChangeSubscription) {
716
- this.localizationChangeSubscription.unsubscribe();
717
- }
718
- if (this.windowBlurSubscription) {
719
- this.windowBlurSubscription.unsubscribe();
720
- }
721
- this.domEvents.forEach(unbindCallback => unbindCallback());
722
- this.pickerSubscriptions.unsubscribe();
723
- }
724
- /**
725
- * Indicates whether the component is currently open. That is when the popup or actionSheet is open.
726
- */
727
- get isOpen() {
728
- return this.show;
729
- }
730
- /**
731
- * @hidden
732
- */
733
- writeValue(value) {
734
- this.verifyValue(value);
735
- this.value = cloneDate(value);
736
- this.cdr.markForCheck();
737
- if (!value && this.dateInput) {
738
- this.dateInput.placeholder = this.placeholder;
739
- this.dateInput.writeValue(value);
740
- }
741
- }
742
- /**
743
- * @hidden
744
- */
745
- registerOnChange(fn) {
746
- this.onControlChange = fn;
747
- }
748
- /**
749
- * @hidden
750
- */
751
- registerOnTouched(fn) {
752
- this.onControlTouched = fn;
753
- }
754
- /**
755
- * @hidden
756
- */
757
- setDisabledState(isDisabled) {
758
- this.disabled = isDisabled;
759
- this.cdr.markForCheck();
760
- }
761
- /**
762
- * @hidden
763
- */
764
- validate(control) {
765
- return this.minValidateFn(control) || this.maxValidateFn(control) || this.disabledDatesValidateFn(control) || this.incompleteValidator(control, this.dateInput && this.dateInput.isDateIncomplete);
766
- }
767
- /**
768
- * @hidden
769
- */
770
- registerOnValidatorChange(fn) {
771
- this.onValidatorChange = fn;
772
- }
773
- /**
774
- * @hidden
775
- */
776
- handleActionSheetCollapse() {
777
- // If not handled, the actionsheet expanded state does not get updated when overlay is clicked
778
- this.cdr.markForCheck();
779
- }
780
- /**
781
- * @hidden
782
- */
783
- handleActionSheetClick(e) {
784
- e.preventDefault();
785
- }
786
- /**
787
- * Focuses the DatePicker component.
788
- */
789
- focus() {
790
- this.dateInput.focus();
791
- }
792
- /**
793
- * Blurs the DatePicker component.
794
- */
795
- blur() {
796
- (this.calendar || this.dateInput)['blur']();
797
- }
798
- /**
799
- * Toggles the visibility of the popup or actionSheet.
800
- * If you use the `toggle` method to show or hide the popup or actionSheet,
801
- * the `open` and `close` events do not fire.
802
- *
803
- * @param show The state of the popup.
804
- */
805
- toggle(show) {
806
- if (this.disabled || this.readonly) {
807
- return;
808
- }
809
- this.resolvedPromise.then(() => {
810
- this.toggleCalendar((show === undefined) ? !this.show : show);
811
- });
812
- }
813
- /**
814
- * @hidden
815
- */
816
- handleIconClick(event) {
817
- if (this.disabled || this.readonly) {
818
- return;
819
- }
820
- event.preventDefault();
821
- this.focusInput();
822
- //XXX: explicitly call the handleFocus handler here
823
- //due to async IE focus event
824
- this.handleFocus();
825
- this.show = !this.show;
826
- this.cdr.markForCheck();
827
- }
828
- /**
829
- * @hidden
830
- */
831
- handleDateInputClick() {
832
- this.windowSize = this.adaptiveService.size;
833
- if (this.isAdaptive) {
834
- this.show = true;
835
- }
836
- else if (this.isOpen) {
837
- this.show = false;
838
- }
839
- }
840
- /**
841
- * @hidden
842
- */
843
- handleMousedown(args) {
844
- args.preventDefault();
845
- }
846
- /**
847
- * @hidden
848
- */
849
- handleChange(value, isInputValueChange) {
850
- this.value = value;
851
- if (this.show) {
852
- if (!isInputValueChange) {
853
- this.focusInput();
854
- }
855
- this.show = false;
856
- }
857
- this.onControlChange(cloneDate(value));
858
- this.valueChange.emit(cloneDate(value));
859
- }
860
- /**
861
- * @hidden
862
- */
863
- handleInputChange(value) {
864
- this.handleChange(this.dateInput.formatSections['time'] ? value : this.mergeTime(value), true);
865
- }
866
- /**
867
- * @hidden
868
- */
869
- get popupClasses() {
870
- const popupClasses = ['k-datepicker-popup', 'k-calendar-container'];
871
- if (!this.popupSettings.popupClass) {
872
- return popupClasses;
873
- }
874
- const customClasses = parseCSSClassNames(this.popupSettings.popupClass);
875
- if (customClasses?.length) {
876
- popupClasses.push(...customClasses);
877
- }
878
- return popupClasses;
879
- }
880
- /**
881
- * @hidden
882
- */
883
- get appendTo() {
884
- const { appendTo } = this.popupSettings;
885
- if (!appendTo || appendTo === 'root') {
886
- return undefined;
887
- }
888
- return appendTo === 'component' ? this.container : appendTo;
889
- }
890
- get dateInput() {
891
- return this.pickerService.input;
892
- }
893
- get calendar() {
894
- return this.pickerService.calendar;
895
- }
896
- /**
897
- * @hidden
898
- */
899
- get isAdaptiveModeEnabled() {
900
- return this.adaptiveMode === 'auto';
901
- }
902
- /**
903
- * @hidden
904
- */
905
- get isAdaptive() {
906
- return this.isAdaptiveModeEnabled && this.windowSize !== 'large';
907
- }
908
- /**
909
- * @hidden
910
- */
911
- onResize() {
912
- const currentWindowSize = this.adaptiveService.size;
913
- if (!this.isOpen || this.windowSize === currentWindowSize) {
914
- return;
915
- }
916
- if (this.actionSheet.expanded) {
917
- this.toggleActionSheet(false);
918
- }
919
- else {
920
- this.togglePopup(false);
921
- }
922
- this.windowSize = currentWindowSize;
923
- }
924
- /**
925
- * @hidden
926
- */
927
- mergeTime(value) {
928
- return this.value && value ? setTime(value, this.value) : value;
929
- }
930
- /**
931
- * @hidden
932
- */
933
- handleKeydown(e) {
934
- const { altKey, shiftKey, target } = e;
935
- const code = normalizeKeys(e);
936
- if (code === Keys.Escape) {
937
- this.dateInput.focus();
938
- this.show = false;
939
- hasObservers(this.escape) && this.escape.emit();
940
- }
941
- if (altKey) {
942
- if (code === Keys.ArrowDown && !this.show) {
943
- this.show = true;
944
- }
945
- if (code === Keys.ArrowUp) {
946
- this.dateInput.focus();
947
- this.show = false;
948
- }
949
- }
950
- if (code === Keys.Tab && this.show && this.calendar.isActive && isTabExitingCalendar(this.calendarType, target, shiftKey)) {
951
- this.dateInput.focus();
952
- this.show = false;
953
- }
954
- }
955
- toggleCalendar(show) {
956
- const previousWindowSize = this.windowSize;
957
- this.windowSize = this.adaptiveService.size;
958
- if (previousWindowSize !== this.windowSize && !show) {
959
- if (previousWindowSize !== 'large') {
960
- this.toggleActionSheet(show);
961
- }
962
- else {
963
- this.togglePopup(show);
964
- }
965
- }
966
- else {
967
- if (this.isAdaptive) {
968
- this.toggleActionSheet(show);
969
- }
970
- else {
971
- this.togglePopup(show);
972
- }
973
- }
974
- this.toggleFocus();
975
- }
976
- togglePopup(show) {
977
- if (show === this._show) {
978
- return;
979
- }
980
- this._show = show;
981
- if (show) {
982
- const direction = this.localization.rtl ? 'right' : 'left';
983
- const appendToComponent = typeof this.popupSettings.appendTo === 'string' && this.popupSettings.appendTo === 'component';
984
- this.popupRef = this.popupService.open({
985
- anchor: this.wrapper,
986
- anchorAlign: { vertical: 'bottom', horizontal: direction },
987
- animate: this.popupSettings.animate,
988
- appendTo: this.appendTo,
989
- content: this.popupTemplate,
990
- popupAlign: { vertical: 'top', horizontal: direction },
991
- popupClass: this.popupClasses,
992
- positionMode: appendToComponent ? 'fixed' : 'absolute'
993
- });
994
- this.setAriaActiveDescendant();
995
- this.popupRef.popupElement.setAttribute('id', this.popupUID);
996
- this.renderer.setAttribute(this.dateInput?.inputElement, attributeNames.ariaControls, this.popupUID);
997
- this.subscription = this.popupRef.popupAnchorViewportLeave.subscribe(() => this.show = false);
998
- }
999
- else {
1000
- this.popupRef.close();
1001
- this.popupRef = null;
1002
- this.subscription.unsubscribe();
1003
- this.ariaActiveDescendantSubscription.unsubscribe();
1004
- if (this.dateInput) {
1005
- this.renderer.removeAttribute(this.dateInput.inputElement, attributeNames.ariaControls);
1006
- this.renderer.removeAttribute(this.dateInput.inputElement, attributeNames.ariaActiveDescendant);
1007
- }
1008
- this.cdr.detectChanges();
1009
- }
1010
- }
1011
- toggleActionSheet(show) {
1012
- if (show === this._show) {
1013
- return;
1014
- }
1015
- if (show && !this.isOpen) {
1016
- this.actionSheet.toggle();
1017
- this.setAriaActiveDescendant();
1018
- this.actionSheet.element.nativeElement.setAttribute('id', this.popupUID);
1019
- this.renderer.setAttribute(this.dateInput?.inputElement, attributeNames.ariaControls, this.popupUID);
1020
- }
1021
- else if (!show && this.isOpen) {
1022
- this.actionSheet.toggle();
1023
- this.ariaActiveDescendantSubscription.unsubscribe();
1024
- if (this.dateInput) {
1025
- this.renderer.removeAttribute(this.dateInput.inputElement, attributeNames.ariaActiveDescendant);
1026
- this.renderer.removeAttribute(this.dateInput.inputElement, attributeNames.ariaControls);
1027
- this.dateInput.focus();
1028
- }
1029
- }
1030
- this._show = show;
1031
- }
1032
- setAriaActiveDescendant() {
1033
- const focusedCellChangeEvent = this.calendar.type === 'infinite' ?
1034
- this.calendar.monthView.focusedCellChange :
1035
- this.calendar.multiViewCalendar.viewList.focusedCellChange;
1036
- this.ariaActiveDescendantSubscription = focusedCellChangeEvent.subscribe((id) => this.renderer.setAttribute(this.dateInput?.inputElement, attributeNames.ariaActiveDescendant, id));
1037
- }
1038
- focusInput() {
1039
- if (touchEnabled) {
1040
- return;
1041
- }
1042
- this.dateInput.focus();
1043
- }
1044
- toggleFocus() {
1045
- if (!this.isActive) {
1046
- return;
1047
- }
1048
- if (this.show) {
1049
- if (!this.calendar) {
1050
- this.cdr.detectChanges();
1051
- }
1052
- if (this.calendar) {
1053
- this.calendar.focus();
1054
- }
1055
- }
1056
- else if (!touchEnabled) {
1057
- this.dateInput.focus();
1058
- }
1059
- else if (!this.dateInput.isActive) {
1060
- this.handleBlur();
1061
- }
1062
- }
1063
- verifySettings() {
1064
- if (!isDevMode()) {
1065
- return;
1066
- }
1067
- if (!isValidRange(this.min, this.max)) {
1068
- throw new Error(`The max value should be bigger than the min. See ${MIN_DOC_LINK} and ${MAX_DOC_LINK}.`);
1069
- }
1070
- }
1071
- verifyValue(value) {
1072
- if (!isDevMode()) {
1073
- return;
1074
- }
1075
- if (value && !(value instanceof Date)) {
1076
- throw new Error(`The 'value' should be a valid JavaScript Date instance or null. Check ${VALUE_DOC_LINK} for possible resolution.`);
1077
- }
1078
- }
1079
- bindEvents() {
1080
- const element = this.wrapper.nativeElement;
1081
- this.domEvents.push(this.renderer.listen(element, 'keydown', this.handleKeydown.bind(this)));
1082
- if (isWindowAvailable()) {
1083
- this.windowBlurSubscription = fromEvent(window, 'blur').subscribe(this.handleWindowBlur.bind(this));
1084
- }
1085
- }
1086
- handleFocus() {
1087
- if (this.isActive) {
1088
- return;
1089
- }
1090
- this.isActive = true;
1091
- if (hasObservers(this.onFocus)) {
1092
- this.zone.run(() => {
1093
- this.onFocus.emit();
1094
- });
1095
- }
1096
- }
1097
- handleWindowBlur() {
1098
- if (!this.isOpen || this.actionSheet.expanded) {
1099
- return;
1100
- }
1101
- this.show = false;
1102
- }
1103
- handleBlur(args) {
1104
- const currentTarget = args && currentFocusTarget(args);
1105
- const target = args && args.target;
1106
- const isInsideActionSheet = this.actionSheet && (this.actionSheet.element.nativeElement.contains(target) || this.actionSheet.element.nativeElement.contains(currentTarget));
1107
- if (currentTarget && (this.dateInput.containsElement(currentTarget) ||
1108
- (this.calendar && this.calendar.containsElement(currentTarget)) || isInsideActionSheet)) {
1109
- return;
1110
- }
1111
- if (hasObservers(this.onBlur) || (this.show && hasObservers(this.close)) || requiresZoneOnBlur(this.control)) {
1112
- this.zone.run(() => {
1113
- this.blurComponent();
1114
- this.cdr.markForCheck();
1115
- });
1116
- }
1117
- else {
1118
- this.blurComponent();
1119
- }
1120
- }
1121
- blurComponent() {
1122
- this.isActive = false;
1123
- this.show = false;
1124
- this.cdr.detectChanges();
1125
- this.onControlTouched();
1126
- this.onBlur.emit();
1127
- }
1128
- handleSameSelection() {
1129
- if (this.show) {
1130
- this.focusInput();
1131
- this.show = false;
1132
- }
1133
- }
1134
- handleDateCompletenessChange() {
1135
- this.cdr.markForCheck();
1136
- this.zone.run(() => this.onValidatorChange());
1137
- }
1138
- setComponentClasses() {
1139
- if (this.size) {
1140
- this.renderer.addClass(this.wrapper.nativeElement, getSizeClass('input', this.size));
1141
- this.renderer.addClass(this.toggleButton.nativeElement, getSizeClass('button', this.size));
1142
- }
1143
- if (this.rounded) {
1144
- this.renderer.addClass(this.wrapper.nativeElement, getRoundedClass(this.rounded));
1145
- }
1146
- if (this.fillMode) {
1147
- this.renderer.addClass(this.wrapper.nativeElement, getFillModeClass('input', this.fillMode));
1148
- this.renderer.addClass(this.toggleButton.nativeElement, getFillModeClass('button', this.fillMode));
1149
- this.renderer.addClass(this.toggleButton.nativeElement, `k-button-${this.fillMode}-base`);
1150
- }
1151
- }
1152
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DatePickerComponent, deps: [{ token: i0.NgZone }, { token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: i2.PopupService }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.Injector }, { token: i3.PickerService }, { token: i4.DisabledDatesService }, { token: i5.AdaptiveService }], target: i0.ɵɵFactoryTarget.Component });
1153
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: DatePickerComponent, isStandalone: true, selector: "kendo-datepicker", inputs: { focusableId: "focusableId", cellTemplateRef: ["cellTemplate", "cellTemplateRef"], clearButton: "clearButton", inputAttributes: "inputAttributes", monthCellTemplateRef: ["monthCellTemplate", "monthCellTemplateRef"], yearCellTemplateRef: ["yearCellTemplate", "yearCellTemplateRef"], decadeCellTemplateRef: ["decadeCellTemplate", "decadeCellTemplateRef"], centuryCellTemplateRef: ["centuryCellTemplate", "centuryCellTemplateRef"], weekNumberTemplateRef: ["weekNumberTemplate", "weekNumberTemplateRef"], headerTitleTemplateRef: ["headerTitleTemplate", "headerTitleTemplateRef"], headerTemplateRef: ["headerTemplate", "headerTemplateRef"], footerTemplateRef: ["footerTemplate", "footerTemplateRef"], footer: "footer", navigationItemTemplateRef: ["navigationItemTemplate", "navigationItemTemplateRef"], weekDaysFormat: "weekDaysFormat", showOtherMonthDays: "showOtherMonthDays", activeView: "activeView", bottomView: "bottomView", topView: "topView", calendarType: "calendarType", animateCalendarNavigation: "animateCalendarNavigation", disabled: "disabled", readonly: "readonly", readOnlyInput: "readOnlyInput", popupSettings: "popupSettings", navigation: "navigation", min: "min", max: "max", incompleteDateValidation: "incompleteDateValidation", autoCorrectParts: "autoCorrectParts", autoSwitchParts: "autoSwitchParts", autoSwitchKeys: "autoSwitchKeys", enableMouseWheel: "enableMouseWheel", allowCaretMode: "allowCaretMode", autoFill: "autoFill", focusedDate: "focusedDate", value: "value", format: "format", twoDigitYearMax: "twoDigitYearMax", formatPlaceholder: "formatPlaceholder", placeholder: "placeholder", tabindex: "tabindex", tabIndex: "tabIndex", disabledDates: "disabledDates", adaptiveTitle: "adaptiveTitle", adaptiveSubtitle: "adaptiveSubtitle", rangeValidation: "rangeValidation", disabledDatesValidation: "disabledDatesValidation", weekNumber: "weekNumber", size: "size", rounded: "rounded", fillMode: "fillMode", adaptiveMode: "adaptiveMode" }, outputs: { valueChange: "valueChange", onFocus: "focus", onBlur: "blur", open: "open", close: "close", escape: "escape" }, host: { properties: { "class.k-readonly": "this.readonly", "class.k-datepicker": "this.wrapperClasses", "class.k-input": "this.wrapperClasses", "class.k-disabled": "this.disabledClass" } }, providers: [
1154
- { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DatePickerComponent), multi: true },
1155
- { provide: NG_VALIDATORS, useExisting: forwardRef(() => DatePickerComponent), multi: true },
1156
- { provide: KendoInput, useExisting: forwardRef(() => DatePickerComponent) },
1157
- { provide: MultiTabStop, useExisting: forwardRef(() => DatePickerComponent) },
1158
- LocalizationService,
1159
- PickerService,
1160
- DisabledDatesService,
1161
- {
1162
- provide: L10N_PREFIX,
1163
- useValue: 'kendo.datepicker'
1164
- }
1165
- ], 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 }, { propertyName: "navigationItemTemplate", first: true, predicate: NavigationItemTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, static: true }, { propertyName: "toggleButton", first: true, predicate: ["toggleButton"], descendants: true, static: true }, { propertyName: "actionSheet", first: true, predicate: ["actionSheet"], descendants: true }], exportAs: ["kendo-datepicker"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `
1166
- <ng-container kendoDatePickerLocalizedMessages
1167
- i18n-today="kendo.datepicker.today|The label for the today button in the calendar header"
1168
- today="Today"
1169
-
1170
- i18n-toggle="kendo.datepicker.toggle|The title of the toggle button in the datepicker component"
1171
- toggle="Toggle calendar"
1172
-
1173
- i18n-prevButtonTitle="kendo.datepicker.prevButtonTitle|The title of the previous button in the Classic calendar"
1174
- prevButtonTitle="Navigate to previous view"
1175
-
1176
- i18n-nextButtonTitle="kendo.datepicker.nextButtonTitle|The title of the next button in the Classic calendar"
1177
- nextButtonTitle="Navigate to next view"
1178
-
1179
- i18n-parentViewButtonTitle="kendo.datepicker.parentViewButtonTitle|The title of the parent view button in the calendar header"
1180
- parentViewButtonTitle="Navigate to parent view"
1181
-
1182
- i18n-clearTitle="kendo.datepicker.clearTitle|The title of the clear button"
1183
- clearTitle="clear"
1184
-
1185
- i18n-adaptiveCloseButtonTitle="kendo.datepicker.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"
1186
- adaptiveCloseButtonTitle="Close"
1187
- >
1188
- </ng-container>
1189
- <kendo-dateinput
1190
- #input
1191
- [role]="'combobox'"
1192
- pickerType="datepicker"
1193
- hasPopup="grid"
1194
- [isPopupOpen]="show"
1195
- [clearButton]="clearButton"
1196
- [disabled]="disabled"
1197
- [readonly]="readonly || readOnlyInput"
1198
- [ariaReadOnly]="readonly"
1199
- [tabindex]="tabindex"
1200
- [isRequired]="isControlRequired"
1201
- [title]="adaptiveTitle"
1202
- [focusableId]="focusableId"
1203
- [format]="format"
1204
- [twoDigitYearMax]="twoDigitYearMax"
1205
- [formatPlaceholder]="formatPlaceholder"
1206
- [placeholder]="placeholder"
1207
- [min]="min"
1208
- [max]="max"
1209
- [incompleteDateValidation]="incompleteDateValidation"
1210
- [autoCorrectParts]="autoCorrectParts"
1211
- [autoSwitchParts]="autoSwitchParts"
1212
- [autoSwitchKeys]="autoSwitchKeys"
1213
- [enableMouseWheel]="enableMouseWheel"
1214
- [allowCaretMode]="allowCaretMode"
1215
- [autoFill]="autoFill"
1216
- fillMode="none"
1217
- rounded="none"
1218
- size="none"
1219
- [inputAttributes]="inputAttributes"
1220
- [value]="value"
1221
- (valueChange)="handleInputChange($event)"
1222
- (click)="handleDateInputClick()"
1223
- >
1224
- <kendo-dateinput-messages
1225
- [clearTitle]="localization.get('clearTitle')"
1226
- >
1227
- </kendo-dateinput-messages>
1228
- </kendo-dateinput>
1229
- <button
1230
- #toggleButton
1231
- type="button"
1232
- class="k-input-button k-button k-icon-button"
1233
- [tabindex]="-1"
1234
- [attr.title]="localization.get('toggle')"
1235
- [attr.aria-label]="localization.get('toggle')"
1236
- [attr.disabled]="disabled ? '' : null"
1237
- [kendoEventsOutsideAngular]="{
1238
- click: handleIconClick,
1239
- mousedown: handleMousedown
1240
- }"
1241
- [scope]="this"
1242
- >
1243
- <kendo-icon-wrapper
1244
- name="calendar"
1245
- [svgIcon]="calendarIcon"
1246
- innerCssClass="k-button-icon"
1247
- >
1248
- </kendo-icon-wrapper>
1249
- </button>
1250
-
1251
- <ng-container #container></ng-container>
1252
-
1253
- <ng-template #popupTemplate>
1254
- <ng-container *ngTemplateOutlet="calendarTemplate"></ng-container>
1255
- </ng-template>
1256
-
1257
- @if (isAdaptiveModeEnabled) {
1258
- <kendo-resize-sensor (resize)="onResize()"></kendo-resize-sensor>
1259
- }
1260
- <kendo-actionsheet
1261
- #actionSheet
1262
- (overlayClick)="show=false"
1263
- [kendoEventsOutsideAngular]="{
1264
- click: handleActionSheetClick
1265
- }"
1266
- [scope]="this"
1267
- (collapse)="handleActionSheetCollapse()"
1268
- [titleId]="calendar?.headerId"
1269
- [cssClass]="{
1270
- 'k-adaptive-actionsheet': true,
1271
- 'k-actionsheet-fullscreen': windowSize === 'small',
1272
- 'k-actionsheet-bottom': windowSize === 'medium'
1273
- }"
1274
- [cssStyle]="{
1275
- height: windowSize === 'small' ? '100vh' : '60vh'
1276
- }"
1277
- >
1278
- <ng-template kendoActionSheetTemplate>
1279
- <div class="k-actionsheet-titlebar">
1280
- <div class="k-actionsheet-titlebar-group">
1281
- <div class="k-actionsheet-title">
1282
- @if (adaptiveTitle) {
1283
- <div class="k-text-center">{{ adaptiveTitle }}</div>
1284
- }
1285
- @if (adaptiveSubtitle) {
1286
- <div class="k-actionsheet-subtitle k-text-center">{{ adaptiveSubtitle }}</div>
1287
- }
1288
- </div>
1289
- <div class="k-actionsheet-actions">
1290
- <button
1291
- kendoButton
1292
- type="button"
1293
- icon="check"
1294
- themeColor="primary"
1295
- [attr.title]="localization.get('adaptiveCloseButtonTitle')"
1296
- [svgIcon]="checkIcon"
1297
- fillMode="flat"
1298
- [tabIndex]="-1"
1299
- size="large"
1300
- innerCssClass="k-button-icon"
1301
- (click)="show = false">
1302
- </button>
1303
- </div>
1304
- </div>
1305
- </div>
1306
- <div class="k-actionsheet-content">
1307
- <ng-container *ngTemplateOutlet="calendarTemplate"></ng-container>
1308
- </div>
1309
- </ng-template>
1310
- </kendo-actionsheet>
1311
-
1312
- <ng-template #calendarTemplate>
1313
- <kendo-calendar
1314
- #calendar
1315
- [type]="calendarType"
1316
- [size]="isAdaptive ? 'large' : size"
1317
- [min]="min"
1318
- [max]="max"
1319
- [weekDaysFormat]="weekDaysFormat"
1320
- [navigation]="navigation"
1321
- [animateNavigation]="animateCalendarNavigation"
1322
- [activeView]="activeView"
1323
- [bottomView]="bottomView"
1324
- [showOtherMonthDays]="showOtherMonthDays"
1325
- [topView]="topView"
1326
- [weekNumber]="weekNumber"
1327
- [cellTemplate]="cellTemplate"
1328
- [monthCellTemplate]="monthCellTemplate"
1329
- [yearCellTemplate]="yearCellTemplate"
1330
- [decadeCellTemplate]="decadeCellTemplate"
1331
- [centuryCellTemplate]="centuryCellTemplate"
1332
- [weekNumberTemplate]="weekNumberTemplate"
1333
- [headerTitleTemplate]="headerTitleTemplate"
1334
- [headerTemplate]="headerTemplate"
1335
- [footerTemplate]="footerTemplate"
1336
- [footer]="footer"
1337
- [navigationItemTemplate]="navigationItemTemplate"
1338
- [focusedDate]="focusedDate"
1339
- [value]="value"
1340
- (closePopup)="show = false;"
1341
- (valueChange)="handleChange(mergeTime($event))"
1342
- [kendoEventsOutsideAngular]="{
1343
- keydown: handleKeydown
1344
- }"
1345
- [scope]="this"
1346
- [disabledDates]="disabledDates"
1347
- >
1348
- <kendo-calendar-messages
1349
- [today]="localization.get('today')"
1350
- [prevButtonTitle]="localization.get('prevButtonTitle')"
1351
- [nextButtonTitle]="localization.get('nextButtonTitle')"
1352
- [parentViewButtonTitle]="localization.get('parentViewButtonTitle')"
1353
- >
1354
- </kendo-calendar-messages>
1355
- </kendo-calendar>
1356
- </ng-template>
1357
- `, isInline: true, dependencies: [{ kind: "directive", type: DatePickerLocalizedMessagesDirective, selector: "[kendoDatePickerLocalizedMessages]" }, { 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: "component", type: DateInputCustomMessagesComponent, selector: "kendo-dateinput-messages" }, { kind: "directive", type: EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { 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: "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" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1358
- }
1359
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DatePickerComponent, decorators: [{
1360
- type: Component,
1361
- args: [{
1362
- changeDetection: ChangeDetectionStrategy.OnPush,
1363
- exportAs: 'kendo-datepicker',
1364
- providers: [
1365
- { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DatePickerComponent), multi: true },
1366
- { provide: NG_VALIDATORS, useExisting: forwardRef(() => DatePickerComponent), multi: true },
1367
- { provide: KendoInput, useExisting: forwardRef(() => DatePickerComponent) },
1368
- { provide: MultiTabStop, useExisting: forwardRef(() => DatePickerComponent) },
1369
- LocalizationService,
1370
- PickerService,
1371
- DisabledDatesService,
1372
- {
1373
- provide: L10N_PREFIX,
1374
- useValue: 'kendo.datepicker'
1375
- }
1376
- ],
1377
- selector: 'kendo-datepicker',
1378
- template: `
1379
- <ng-container kendoDatePickerLocalizedMessages
1380
- i18n-today="kendo.datepicker.today|The label for the today button in the calendar header"
1381
- today="Today"
1382
-
1383
- i18n-toggle="kendo.datepicker.toggle|The title of the toggle button in the datepicker component"
1384
- toggle="Toggle calendar"
1385
-
1386
- i18n-prevButtonTitle="kendo.datepicker.prevButtonTitle|The title of the previous button in the Classic calendar"
1387
- prevButtonTitle="Navigate to previous view"
1388
-
1389
- i18n-nextButtonTitle="kendo.datepicker.nextButtonTitle|The title of the next button in the Classic calendar"
1390
- nextButtonTitle="Navigate to next view"
1391
-
1392
- i18n-parentViewButtonTitle="kendo.datepicker.parentViewButtonTitle|The title of the parent view button in the calendar header"
1393
- parentViewButtonTitle="Navigate to parent view"
1394
-
1395
- i18n-clearTitle="kendo.datepicker.clearTitle|The title of the clear button"
1396
- clearTitle="clear"
1397
-
1398
- i18n-adaptiveCloseButtonTitle="kendo.datepicker.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"
1399
- adaptiveCloseButtonTitle="Close"
1400
- >
1401
- </ng-container>
1402
- <kendo-dateinput
1403
- #input
1404
- [role]="'combobox'"
1405
- pickerType="datepicker"
1406
- hasPopup="grid"
1407
- [isPopupOpen]="show"
1408
- [clearButton]="clearButton"
1409
- [disabled]="disabled"
1410
- [readonly]="readonly || readOnlyInput"
1411
- [ariaReadOnly]="readonly"
1412
- [tabindex]="tabindex"
1413
- [isRequired]="isControlRequired"
1414
- [title]="adaptiveTitle"
1415
- [focusableId]="focusableId"
1416
- [format]="format"
1417
- [twoDigitYearMax]="twoDigitYearMax"
1418
- [formatPlaceholder]="formatPlaceholder"
1419
- [placeholder]="placeholder"
1420
- [min]="min"
1421
- [max]="max"
1422
- [incompleteDateValidation]="incompleteDateValidation"
1423
- [autoCorrectParts]="autoCorrectParts"
1424
- [autoSwitchParts]="autoSwitchParts"
1425
- [autoSwitchKeys]="autoSwitchKeys"
1426
- [enableMouseWheel]="enableMouseWheel"
1427
- [allowCaretMode]="allowCaretMode"
1428
- [autoFill]="autoFill"
1429
- fillMode="none"
1430
- rounded="none"
1431
- size="none"
1432
- [inputAttributes]="inputAttributes"
1433
- [value]="value"
1434
- (valueChange)="handleInputChange($event)"
1435
- (click)="handleDateInputClick()"
1436
- >
1437
- <kendo-dateinput-messages
1438
- [clearTitle]="localization.get('clearTitle')"
1439
- >
1440
- </kendo-dateinput-messages>
1441
- </kendo-dateinput>
1442
- <button
1443
- #toggleButton
1444
- type="button"
1445
- class="k-input-button k-button k-icon-button"
1446
- [tabindex]="-1"
1447
- [attr.title]="localization.get('toggle')"
1448
- [attr.aria-label]="localization.get('toggle')"
1449
- [attr.disabled]="disabled ? '' : null"
1450
- [kendoEventsOutsideAngular]="{
1451
- click: handleIconClick,
1452
- mousedown: handleMousedown
1453
- }"
1454
- [scope]="this"
1455
- >
1456
- <kendo-icon-wrapper
1457
- name="calendar"
1458
- [svgIcon]="calendarIcon"
1459
- innerCssClass="k-button-icon"
1460
- >
1461
- </kendo-icon-wrapper>
1462
- </button>
1463
-
1464
- <ng-container #container></ng-container>
1465
-
1466
- <ng-template #popupTemplate>
1467
- <ng-container *ngTemplateOutlet="calendarTemplate"></ng-container>
1468
- </ng-template>
1469
-
1470
- @if (isAdaptiveModeEnabled) {
1471
- <kendo-resize-sensor (resize)="onResize()"></kendo-resize-sensor>
1472
- }
1473
- <kendo-actionsheet
1474
- #actionSheet
1475
- (overlayClick)="show=false"
1476
- [kendoEventsOutsideAngular]="{
1477
- click: handleActionSheetClick
1478
- }"
1479
- [scope]="this"
1480
- (collapse)="handleActionSheetCollapse()"
1481
- [titleId]="calendar?.headerId"
1482
- [cssClass]="{
1483
- 'k-adaptive-actionsheet': true,
1484
- 'k-actionsheet-fullscreen': windowSize === 'small',
1485
- 'k-actionsheet-bottom': windowSize === 'medium'
1486
- }"
1487
- [cssStyle]="{
1488
- height: windowSize === 'small' ? '100vh' : '60vh'
1489
- }"
1490
- >
1491
- <ng-template kendoActionSheetTemplate>
1492
- <div class="k-actionsheet-titlebar">
1493
- <div class="k-actionsheet-titlebar-group">
1494
- <div class="k-actionsheet-title">
1495
- @if (adaptiveTitle) {
1496
- <div class="k-text-center">{{ adaptiveTitle }}</div>
1497
- }
1498
- @if (adaptiveSubtitle) {
1499
- <div class="k-actionsheet-subtitle k-text-center">{{ adaptiveSubtitle }}</div>
1500
- }
1501
- </div>
1502
- <div class="k-actionsheet-actions">
1503
- <button
1504
- kendoButton
1505
- type="button"
1506
- icon="check"
1507
- themeColor="primary"
1508
- [attr.title]="localization.get('adaptiveCloseButtonTitle')"
1509
- [svgIcon]="checkIcon"
1510
- fillMode="flat"
1511
- [tabIndex]="-1"
1512
- size="large"
1513
- innerCssClass="k-button-icon"
1514
- (click)="show = false">
1515
- </button>
1516
- </div>
1517
- </div>
1518
- </div>
1519
- <div class="k-actionsheet-content">
1520
- <ng-container *ngTemplateOutlet="calendarTemplate"></ng-container>
1521
- </div>
1522
- </ng-template>
1523
- </kendo-actionsheet>
1524
-
1525
- <ng-template #calendarTemplate>
1526
- <kendo-calendar
1527
- #calendar
1528
- [type]="calendarType"
1529
- [size]="isAdaptive ? 'large' : size"
1530
- [min]="min"
1531
- [max]="max"
1532
- [weekDaysFormat]="weekDaysFormat"
1533
- [navigation]="navigation"
1534
- [animateNavigation]="animateCalendarNavigation"
1535
- [activeView]="activeView"
1536
- [bottomView]="bottomView"
1537
- [showOtherMonthDays]="showOtherMonthDays"
1538
- [topView]="topView"
1539
- [weekNumber]="weekNumber"
1540
- [cellTemplate]="cellTemplate"
1541
- [monthCellTemplate]="monthCellTemplate"
1542
- [yearCellTemplate]="yearCellTemplate"
1543
- [decadeCellTemplate]="decadeCellTemplate"
1544
- [centuryCellTemplate]="centuryCellTemplate"
1545
- [weekNumberTemplate]="weekNumberTemplate"
1546
- [headerTitleTemplate]="headerTitleTemplate"
1547
- [headerTemplate]="headerTemplate"
1548
- [footerTemplate]="footerTemplate"
1549
- [footer]="footer"
1550
- [navigationItemTemplate]="navigationItemTemplate"
1551
- [focusedDate]="focusedDate"
1552
- [value]="value"
1553
- (closePopup)="show = false;"
1554
- (valueChange)="handleChange(mergeTime($event))"
1555
- [kendoEventsOutsideAngular]="{
1556
- keydown: handleKeydown
1557
- }"
1558
- [scope]="this"
1559
- [disabledDates]="disabledDates"
1560
- >
1561
- <kendo-calendar-messages
1562
- [today]="localization.get('today')"
1563
- [prevButtonTitle]="localization.get('prevButtonTitle')"
1564
- [nextButtonTitle]="localization.get('nextButtonTitle')"
1565
- [parentViewButtonTitle]="localization.get('parentViewButtonTitle')"
1566
- >
1567
- </kendo-calendar-messages>
1568
- </kendo-calendar>
1569
- </ng-template>
1570
- `,
1571
- standalone: true,
1572
- imports: [DatePickerLocalizedMessagesDirective, DateInputComponent, DateInputCustomMessagesComponent, EventsOutsideAngularDirective, IconWrapperComponent, NgTemplateOutlet, ResizeSensorComponent, ActionSheetComponent, ActionSheetTemplateDirective, ButtonComponent, CalendarComponent, CalendarCustomMessagesComponent]
1573
- }]
1574
- }], ctorParameters: () => [{ type: i0.NgZone }, { type: i1.LocalizationService }, { type: i0.ChangeDetectorRef }, { type: i2.PopupService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.Injector }, { type: i3.PickerService }, { type: i4.DisabledDatesService }, { type: i5.AdaptiveService }], propDecorators: { container: [{
1575
- type: ViewChild,
1576
- args: ['container', { read: ViewContainerRef, static: true }]
1577
- }], popupTemplate: [{
1578
- type: ViewChild,
1579
- args: ['popupTemplate', { static: true }]
1580
- }], toggleButton: [{
1581
- type: ViewChild,
1582
- args: ['toggleButton', { static: true }]
1583
- }], actionSheet: [{
1584
- type: ViewChild,
1585
- args: ['actionSheet']
1586
- }], focusableId: [{
1587
- type: Input
1588
- }], cellTemplate: [{
1589
- type: ContentChild,
1590
- args: [CellTemplateDirective, { static: false }]
1591
- }], cellTemplateRef: [{
1592
- type: Input,
1593
- args: ['cellTemplate']
1594
- }], clearButton: [{
1595
- type: Input
1596
- }], inputAttributes: [{
1597
- type: Input
1598
- }], monthCellTemplate: [{
1599
- type: ContentChild,
1600
- args: [MonthCellTemplateDirective, { static: false }]
1601
- }], monthCellTemplateRef: [{
1602
- type: Input,
1603
- args: ['monthCellTemplate']
1604
- }], yearCellTemplate: [{
1605
- type: ContentChild,
1606
- args: [YearCellTemplateDirective, { static: false }]
1607
- }], yearCellTemplateRef: [{
1608
- type: Input,
1609
- args: ['yearCellTemplate']
1610
- }], decadeCellTemplate: [{
1611
- type: ContentChild,
1612
- args: [DecadeCellTemplateDirective, { static: false }]
1613
- }], decadeCellTemplateRef: [{
1614
- type: Input,
1615
- args: ['decadeCellTemplate']
1616
- }], centuryCellTemplate: [{
1617
- type: ContentChild,
1618
- args: [CenturyCellTemplateDirective, { static: false }]
1619
- }], centuryCellTemplateRef: [{
1620
- type: Input,
1621
- args: ['centuryCellTemplate']
1622
- }], weekNumberTemplate: [{
1623
- type: ContentChild,
1624
- args: [WeekNumberCellTemplateDirective, { static: false }]
1625
- }], weekNumberTemplateRef: [{
1626
- type: Input,
1627
- args: ['weekNumberTemplate']
1628
- }], headerTitleTemplate: [{
1629
- type: ContentChild,
1630
- args: [HeaderTitleTemplateDirective, { static: false }]
1631
- }], headerTitleTemplateRef: [{
1632
- type: Input,
1633
- args: ['headerTitleTemplate']
1634
- }], headerTemplate: [{
1635
- type: ContentChild,
1636
- args: [HeaderTemplateDirective]
1637
- }], headerTemplateRef: [{
1638
- type: Input,
1639
- args: ['headerTemplate']
1640
- }], footerTemplate: [{
1641
- type: ContentChild,
1642
- args: [FooterTemplateDirective]
1643
- }], footerTemplateRef: [{
1644
- type: Input,
1645
- args: ['footerTemplate']
1646
- }], footer: [{
1647
- type: Input
1648
- }], navigationItemTemplate: [{
1649
- type: ContentChild,
1650
- args: [NavigationItemTemplateDirective, { static: false }]
1651
- }], navigationItemTemplateRef: [{
1652
- type: Input,
1653
- args: ['navigationItemTemplate']
1654
- }], weekDaysFormat: [{
1655
- type: Input
1656
- }], showOtherMonthDays: [{
1657
- type: Input
1658
- }], activeView: [{
1659
- type: Input
1660
- }], bottomView: [{
1661
- type: Input
1662
- }], topView: [{
1663
- type: Input
1664
- }], calendarType: [{
1665
- type: Input
1666
- }], animateCalendarNavigation: [{
1667
- type: Input
1668
- }], disabled: [{
1669
- type: Input
1670
- }], readonly: [{
1671
- type: Input
1672
- }, {
1673
- type: HostBinding,
1674
- args: ['class.k-readonly']
1675
- }], readOnlyInput: [{
1676
- type: Input
1677
- }], popupSettings: [{
1678
- type: Input
1679
- }], navigation: [{
1680
- type: Input
1681
- }], min: [{
1682
- type: Input
1683
- }], max: [{
1684
- type: Input
1685
- }], incompleteDateValidation: [{
1686
- type: Input
1687
- }], autoCorrectParts: [{
1688
- type: Input
1689
- }], autoSwitchParts: [{
1690
- type: Input
1691
- }], autoSwitchKeys: [{
1692
- type: Input
1693
- }], enableMouseWheel: [{
1694
- type: Input
1695
- }], allowCaretMode: [{
1696
- type: Input
1697
- }], autoFill: [{
1698
- type: Input
1699
- }], focusedDate: [{
1700
- type: Input
1701
- }], value: [{
1702
- type: Input
1703
- }], format: [{
1704
- type: Input
1705
- }], twoDigitYearMax: [{
1706
- type: Input
1707
- }], formatPlaceholder: [{
1708
- type: Input
1709
- }], placeholder: [{
1710
- type: Input
1711
- }], tabindex: [{
1712
- type: Input
1713
- }], tabIndex: [{
1714
- type: Input
1715
- }], disabledDates: [{
1716
- type: Input
1717
- }], adaptiveTitle: [{
1718
- type: Input
1719
- }], adaptiveSubtitle: [{
1720
- type: Input
1721
- }], rangeValidation: [{
1722
- type: Input
1723
- }], disabledDatesValidation: [{
1724
- type: Input
1725
- }], weekNumber: [{
1726
- type: Input
1727
- }], size: [{
1728
- type: Input
1729
- }], rounded: [{
1730
- type: Input
1731
- }], fillMode: [{
1732
- type: Input
1733
- }], adaptiveMode: [{
1734
- type: Input
1735
- }], valueChange: [{
1736
- type: Output
1737
- }], onFocus: [{
1738
- type: Output,
1739
- args: ['focus']
1740
- }], onBlur: [{
1741
- type: Output,
1742
- args: ['blur']
1743
- }], open: [{
1744
- type: Output
1745
- }], close: [{
1746
- type: Output
1747
- }], escape: [{
1748
- type: Output
1749
- }], wrapperClasses: [{
1750
- type: HostBinding,
1751
- args: ['class.k-datepicker']
1752
- }, {
1753
- type: HostBinding,
1754
- args: ['class.k-input']
1755
- }], disabledClass: [{
1756
- type: HostBinding,
1757
- args: ['class.k-disabled']
1758
- }] } });