@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,1196 +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, Input, Output, ViewChild, EventEmitter, ElementRef, HostBinding, isDevMode, Renderer2, forwardRef, NgZone, Optional, Injector } from '@angular/core';
6
- import { minValidator } from '../validators/min.validator';
7
- import { maxValidator } from '../validators/max.validator';
8
- import { incompleteDateValidator } from '../validators/incomplete-date.validator';
9
- import { NG_VALUE_ACCESSOR, NG_VALIDATORS, NgControl } from '@angular/forms';
10
- import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
11
- import { IntlService, localeData } from '@progress/kendo-angular-intl';
12
- import { validatePackage } from '@progress/kendo-licensing';
13
- import { packageMetadata } from '../package-metadata';
14
- import { cloneDate, isEqual } from '@progress/kendo-date-math';
15
- import { hasObservers, isControlRequired, KendoInput, setHTMLAttributes, removeHTMLAttributes, isObjectPresent, parseAttributes, anyChanged, EventsOutsideAngularDirective } from '@progress/kendo-angular-common';
16
- import { Arrow } from './arrow.enum';
17
- import { noop, isValidRange, getSizeClass, getRoundedClass, getFillModeClass, DEFAULT_FILL_MODE, DEFAULT_ROUNDED, DEFAULT_SIZE } from '../util';
18
- import { PickerService } from '../common/picker.service';
19
- import { closest } from '../common/dom-queries';
20
- import { requiresZoneOnBlur, isPresent, attributeNames } from '../common/utils';
21
- import { Subscription } from 'rxjs';
22
- import { caretAltDownIcon, caretAltUpIcon, xIcon } from '@progress/kendo-svg-icons';
23
- import { DateInput } from '@progress/kendo-dateinputs-common';
24
- import { IconWrapperComponent } from '@progress/kendo-angular-icons';
25
- import { DateInputLocalizedMessagesDirective } from './localization/dateinput-localized-messages.directive';
26
- import { MAX_DATE, MIN_DATE } from '../defaults';
27
- import * as i0 from "@angular/core";
28
- import * as i1 from "@progress/kendo-angular-intl";
29
- import * as i2 from "@progress/kendo-angular-l10n";
30
- import * as i3 from "../common/picker.service";
31
- let nextId = 0;
32
- const MIN_DOC_LINK = 'https://www.telerik.com/kendo-angular-ui/components/dateinputs/api/DateInputComponent/#toc-min';
33
- const MAX_DOC_LINK = 'https://www.telerik.com/kendo-angular-ui/components/dateinputs/api/DateInputComponent/#toc-max';
34
- const VALUE_DOC_LINK = 'https://www.telerik.com/kendo-angular-ui/components/dateinputs/dateinput/#toc-using-with-json';
35
- const TWO_DIGIT_YEAR_MAX = 68;
36
- const DEFAULT_FORMAT = 'd';
37
- const DEFAULT_FORMAT_PLACEHOLDER = 'wide';
38
- const DATE_PART_REGEXP = /year|month|<day>/;
39
- const TIME_PART_REGEXP = /hour|minute|second|millisecond/;
40
- /**
41
- * @hidden
42
- * Need to overrite `dateFormatNames` parameters order and provide `cldr` object
43
- * required by the kendo-dateinputs-common package
44
- */
45
- export class DateInputIntl {
46
- service;
47
- format;
48
- toString;
49
- formatDate;
50
- parseDate;
51
- parseNumber;
52
- formatNumber;
53
- splitDateFormat;
54
- numberSymbols;
55
- firstDay;
56
- weekendRange;
57
- dateFieldName;
58
- dateFormatNames;
59
- cldr = {};
60
- localeId;
61
- constructor(service) {
62
- this.service = service;
63
- this.localeId = service['localeId'];
64
- this.format = service.format;
65
- this.toString = service.toString;
66
- this.formatDate = service.formatDate;
67
- this.parseDate = service.parseDate;
68
- this.parseNumber = service.parseNumber;
69
- this.formatNumber = service.formatNumber;
70
- this.splitDateFormat = service.splitDateFormat;
71
- this.numberSymbols = service.numberSymbols;
72
- this.firstDay = service.firstDay;
73
- this.weekendRange = service.weekendRange;
74
- this.dateFieldName = service.dateFieldName;
75
- this.dateFormatNames = (localeId, options) => this.service.dateFormatNames(options, localeId || this.localeId);
76
- const _localeData = localeData(this.localeId);
77
- // Setting the `cldr` object from here could be avoided if the logic in the common package is revisited to
78
- // directly relies on the `localeId` being set as part of the options => TBD and validated for all suites
79
- this.cldr[_localeData.name] = _localeData;
80
- }
81
- }
82
- /**
83
- * Represents the [Kendo UI DateInput component for Angular](slug:overview_dateinput).
84
- *
85
- * ```html
86
- * <kendo-dateinput/>
87
- * ```
88
- *
89
- * @remarks
90
- * Supported children components are: {@link DateInputCustomMessagesComponent}.
91
- */
92
- export class DateInputComponent {
93
- cdr;
94
- intl;
95
- renderer;
96
- wrapper;
97
- ngZone;
98
- injector;
99
- localization;
100
- pickerService;
101
- /**
102
- * @hidden
103
- */
104
- caretAltUpIcon = caretAltUpIcon;
105
- /**
106
- * @hidden
107
- */
108
- xIcon = xIcon;
109
- /**
110
- * @hidden
111
- */
112
- caretAltDownIcon = caretAltDownIcon;
113
- /**
114
- * @hidden
115
- */
116
- set focusableId(_focusableId) {
117
- if (_focusableId) {
118
- this._focusableId = _focusableId;
119
- }
120
- }
121
- get focusableId() {
122
- return this._focusableId;
123
- }
124
- /**
125
- * @hidden
126
- */
127
- set pickerType(_pickerType) {
128
- if (_pickerType) {
129
- this.focusableId = `${_pickerType}-${nextId}`;
130
- }
131
- }
132
- /**
133
- * Specifies whether to render a clear button after the input text or DateInput value has been changed.
134
- * Clicking this button resets the value of the component to `null` and triggers the `valueChange` event.
135
- * @default false
136
- */
137
- clearButton = false;
138
- /**
139
- * Specifies whether the component is disabled
140
- * ([see example]({% slug disabled_dateinput %})).
141
- * To learn how to disable the component in reactive forms, refer to the article on [Forms Support](slug:formssupport_dateinput#toc-managing-the-dateinput-disabled-state-in-reactive-forms).
142
- *
143
- * @default false
144
- */
145
- disabled = false;
146
- /**
147
- * Specifies the read-only state of the DateInput
148
- * ([see example]({% slug readonly_dateinput %})).
149
- *
150
- * @default false
151
- */
152
- readonly = false;
153
- /**
154
- * Specifies the title of the input element of the DateInput.
155
- *
156
- * @default ""
157
- */
158
- title = "";
159
- /**
160
- * Specifies the `tabIndex` property of the DateInput.
161
- *
162
- * @default 0
163
- */
164
- tabindex = 0;
165
- /**
166
- * @hidden
167
- */
168
- role = 'textbox';
169
- /**
170
- * @hidden
171
- */
172
- ariaReadOnly = false;
173
- /**
174
- * @hidden
175
- */
176
- set tabIndex(tabIndex) {
177
- this.tabindex = tabIndex;
178
- }
179
- get tabIndex() {
180
- return this.tabindex;
181
- }
182
- /**
183
- * @hidden
184
- */
185
- isRequired = false;
186
- /**
187
- * Specifies the date format that is used to display the input value
188
- * ([see example]({% slug formats_dateinput %})).
189
- *
190
- * You can provide a string if a single format is going to be used regardless whether the input is focused or blurred.
191
- * Alternatively, you can provide a FormatSettings object to display different formats when the component is focused or blurred by specifying inputFormat and displayFormat values.
192
- */
193
- format = DEFAULT_FORMAT;
194
- /**
195
- * Defines the descriptions of the format sections in the input field.
196
- * For more information, refer to the article on
197
- * [placeholders]({% slug placeholders_dateinput %}).
198
- */
199
- set formatPlaceholder(format) {
200
- this._formatPlaceholder = format || DEFAULT_FORMAT_PLACEHOLDER;
201
- }
202
- get formatPlaceholder() {
203
- return this._formatPlaceholder;
204
- }
205
- /**
206
- * Specifies the hint the DateInput displays when its value is `null`.
207
- * For more information, refer to the article on
208
- * [placeholders]({% slug placeholders_dateinput %}).
209
- */
210
- placeholder;
211
- /**
212
- * Configures the incremental steps of the DateInput.
213
- * For more information, refer to the article on
214
- * [incremental steps]({% slug incrementalsteps_dateinput %}).
215
- */
216
- steps = {};
217
- /**
218
- * Specifies the biggest date that is valid
219
- * ([see example]({% slug dateranges_dateinput %})).
220
- *
221
- * @default 2099-12-31
222
- */
223
- max = cloneDate(MAX_DATE);
224
- /**
225
- * Specifies the smallest date that is valid
226
- * ([see example]({% slug dateranges_dateinput %})).
227
- *
228
- * @default 1900-1-1
229
- */
230
- min = cloneDate(MIN_DATE);
231
- /**
232
- * Specifies whether to enforce the built-in min and max validators when validating a form.
233
- * Set to `true` to enable validation for the `min` and `max` values.
234
- *
235
- * @default true
236
- */
237
- rangeValidation = true;
238
- /**
239
- * Specifies if the component automatically corrects invalid date segments.
240
- * When set to `true`, the component fixes invalid segments as you type.
241
- *
242
- * @default true
243
- */
244
- autoCorrectParts = true;
245
- /**
246
- * Specifies if the component automatically moves to the next segment after you complete the current one.
247
- * When set to `true`, focus moves to the next segment as soon as you finish typing the current segment.
248
- *
249
- * @default true
250
- */
251
- autoSwitchParts = true;
252
- /**
253
- * Specifies custom keys that move focus to the next date format segment.
254
- * Provide an array of strings to define which keys trigger the focus change.
255
- */
256
- autoSwitchKeys = [];
257
- /**
258
- * Specifies if the component displays a blinking caret inside the DateInput when possible.
259
- * Set to `true` to show a blinking caret for better visual feedback.
260
- *
261
- * @default false
262
- */
263
- allowCaretMode = false;
264
- /**
265
- * Specifies whether to autofill the rest of the date to the current date when the component loses focus.
266
- *
267
- * @default false
268
- */
269
- autoFill = false;
270
- /**
271
- * Specifies whether the built-in validation for incomplete dates is to be enforced when a form is being validated.
272
- *
273
- * @default false
274
- */
275
- incompleteDateValidation = false;
276
- /**
277
- * The maximum year to assume to be from the current century when typing two-digit year value
278
- * ([see example]({% slug formats_dateinput %}#toc-two-digit-year-format)).
279
- *
280
- * The default value is 68, indicating that typing any value less than 69
281
- * will be assumed to be 20xx, while 69 and larger will be assumed to be 19xx.
282
- * @default 68
283
- */
284
- twoDigitYearMax = TWO_DIGIT_YEAR_MAX;
285
- /**
286
- * Indicates whether the mouse scroll can be used to increase/decrease the time segments values.
287
- *
288
- * @default true
289
- */
290
- enableMouseWheel = true;
291
- /**
292
- * Specifies the value of the DateInput component.
293
- *
294
- * The `value` has to be a valid [JavaScript `Date`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date) instance or `null`.
295
- */
296
- set value(value) {
297
- this.verifyValue(value);
298
- this.showClearButton = value || (!value && this.isDateIncomplete) ? true : false;
299
- this._value = cloneDate(value);
300
- this.valueUpdate.emit(cloneDate(value));
301
- }
302
- get value() {
303
- return this._value;
304
- }
305
- /**
306
- * Specifies whether the **Up** and **Down** spin buttons will be rendered.
307
- * For more information, refer to the article on
308
- * [spinner buttons]({% slug spinbuttons_dateinput %}).
309
- *
310
- * @default false
311
- */
312
- spinners = false;
313
- /**
314
- * @hidden
315
- */
316
- isPopupOpen;
317
- /**
318
- * @hidden
319
- */
320
- hasPopup;
321
- /**
322
- * Specifies the size of the component.
323
- *
324
- * @default medium
325
- *
326
- */
327
- set size(size) {
328
- this.renderer.removeClass(this.wrapper.nativeElement, getSizeClass('input', this.size));
329
- const newSize = size || DEFAULT_SIZE;
330
- if (newSize !== 'none') {
331
- this.renderer.addClass(this.wrapper.nativeElement, getSizeClass('input', newSize));
332
- }
333
- this._size = newSize;
334
- }
335
- get size() {
336
- return this._size;
337
- }
338
- /**
339
- * Specifies the border radius of the component.
340
- * @default 'medium'
341
- */
342
- set rounded(rounded) {
343
- this.renderer.removeClass(this.wrapper.nativeElement, getRoundedClass(this.rounded));
344
- const newRounded = rounded || DEFAULT_ROUNDED;
345
- if (newRounded !== 'none') {
346
- this.renderer.addClass(this.wrapper.nativeElement, getRoundedClass(newRounded));
347
- }
348
- this._rounded = newRounded;
349
- }
350
- get rounded() {
351
- return this._rounded;
352
- }
353
- /**
354
- * Specifies the fillMode of the component.
355
- * @default 'solid'
356
- */
357
- set fillMode(fillMode) {
358
- this.renderer.removeClass(this.wrapper.nativeElement, getFillModeClass('input', this.fillMode));
359
- const newFillMode = fillMode || DEFAULT_FILL_MODE;
360
- if (newFillMode !== 'none') {
361
- this.renderer.addClass(this.wrapper.nativeElement, getFillModeClass('input', newFillMode));
362
- if (this.spinners && this.spinup && this.spindown) {
363
- this.setSpinnerFill(this.spinup.nativeElement, newFillMode, this.fillMode);
364
- this.setSpinnerFill(this.spindown.nativeElement, newFillMode, this.fillMode);
365
- }
366
- }
367
- this._fillMode = newFillMode;
368
- }
369
- get fillMode() {
370
- return this._fillMode;
371
- }
372
- /**
373
- * Specifies the HTML attributes of the inner focusable input element. Attributes which are essential for certain component functionalities cannot be changed.
374
- */
375
- set inputAttributes(attributes) {
376
- if (isObjectPresent(this.parsedAttributes)) {
377
- removeHTMLAttributes(this.parsedAttributes, this.renderer, this.dateInput.nativeElement);
378
- }
379
- this._inputAttributes = attributes;
380
- this.parsedAttributes = this.inputAttributes ?
381
- parseAttributes(this.inputAttributes, this.defaultAttributes) :
382
- this.inputAttributes;
383
- this.setInputAttributes();
384
- }
385
- get inputAttributes() {
386
- return this._inputAttributes;
387
- }
388
- /**
389
- * Fires each time the user selects a new value
390
- * ([see example](slug:events_dateinput)).
391
- */
392
- valueChange = new EventEmitter();
393
- /**
394
- * @hidden
395
- * Fires each time the user selects a new value
396
- * ([see example](slug:events_dateinput)).
397
- */
398
- valueUpdate = new EventEmitter();
399
- /**
400
- * Fires each time the user focuses the input element
401
- * ([see example](slug:events_dateinput)).
402
- */
403
- onFocus = new EventEmitter();
404
- /**
405
- * Fires each time the input element gets blurred
406
- * ([see example](slug:events_dateinput)).
407
- */
408
- onBlur = new EventEmitter();
409
- /**
410
- * @hidden
411
- */
412
- dateInput;
413
- get wrapperClass() {
414
- return true;
415
- }
416
- get disabledClass() {
417
- return this.disabled;
418
- }
419
- get inputElement() {
420
- return this.dateInput ? this.dateInput.nativeElement : null;
421
- }
422
- get inputValue() {
423
- return (this.inputElement || {}).value || '';
424
- }
425
- get isActive() {
426
- return this._active;
427
- }
428
- set isActive(value) {
429
- this._active = value;
430
- if (!this.wrapper) {
431
- return;
432
- }
433
- if (!isPresent(this.pickerService)) {
434
- const element = this.wrapper.nativeElement;
435
- if (value) {
436
- this.renderer.addClass(element, 'k-focus');
437
- }
438
- else {
439
- this.renderer.removeClass(element, 'k-focus');
440
- }
441
- }
442
- }
443
- /**
444
- * @hidden
445
- */
446
- get formControl() {
447
- const ngControl = this.injector.get(NgControl, null);
448
- return ngControl?.control || null;
449
- }
450
- get options() {
451
- return {
452
- format: this.format,
453
- steps: this.steps,
454
- readonly: this.readonly,
455
- formatPlaceholder: this.formatPlaceholder,
456
- placeholder: this.placeholder,
457
- autoCorrectParts: this.autoCorrectParts,
458
- autoSwitchParts: this.autoSwitchParts,
459
- selectPreviousSegmentOnBackspace: true, // matches current behavior -> Backspace moves to previous segment
460
- autoSwitchKeys: this.autoSwitchKeys,
461
- twoDigitYearMax: this.twoDigitYearMax,
462
- enableMouseWheel: this.enableMouseWheel,
463
- selectNearestSegmentOnFocus: true,
464
- allowCaretMode: this.allowCaretMode,
465
- autoFill: this.autoFill,
466
- value: this.value,
467
- intlService: new DateInputIntl(this.intl)
468
- };
469
- }
470
- arrow = Arrow;
471
- arrowDirection = Arrow.None;
472
- formatSections = { date: false, time: false };
473
- hasMousedown = false;
474
- focusedPriorToMousedown = false;
475
- showClearButton = false;
476
- /**
477
- * @hidden
478
- */
479
- isDateIncomplete = false;
480
- currentFormat = "";
481
- spinup;
482
- spindown;
483
- minValidator = noop;
484
- maxValidator = noop;
485
- incompleteValidator = noop;
486
- _value = null;
487
- _active = false;
488
- _focusableId = `dateinput-${nextId++}`;
489
- _formatPlaceholder = DEFAULT_FORMAT_PLACEHOLDER;
490
- kendoDate = null;
491
- kendoDateObject = null;
492
- domEvents = [];
493
- ngControl;
494
- onControlChange = noop;
495
- onControlTouched = noop;
496
- onValidatorChange = noop;
497
- _size = DEFAULT_SIZE;
498
- _rounded = DEFAULT_ROUNDED;
499
- _fillMode = DEFAULT_FILL_MODE;
500
- control;
501
- subs = new Subscription();
502
- _inputAttributes;
503
- parsedAttributes = {};
504
- get defaultAttributes() {
505
- return {
506
- 'aria-readonly': this.ariaReadOnly,
507
- id: this.focusableId,
508
- title: this.title,
509
- tabindex: this.tabindex,
510
- disabled: this.disabled ? '' : null,
511
- readonly: this.readonly ? '' : null,
512
- placeholder: this.placeholder,
513
- 'aria-expanded': this.isPopupOpen,
514
- 'aria-haspopup': this.hasPopup,
515
- required: this.isControlRequired ? '' : null
516
- };
517
- }
518
- get mutableAttributes() {
519
- return {
520
- autocomplete: 'off',
521
- autocorrect: 'off',
522
- autocapitalize: 'off',
523
- spellcheck: 'false',
524
- role: this.role
525
- };
526
- }
527
- constructor(cdr, intl, renderer, wrapper, ngZone, injector, localization, pickerService) {
528
- this.cdr = cdr;
529
- this.intl = intl;
530
- this.renderer = renderer;
531
- this.wrapper = wrapper;
532
- this.ngZone = ngZone;
533
- this.injector = injector;
534
- this.localization = localization;
535
- this.pickerService = pickerService;
536
- validatePackage(packageMetadata);
537
- if (this.pickerService) {
538
- this.pickerService.input = this;
539
- }
540
- else {
541
- this.ariaReadOnly = null;
542
- }
543
- }
544
- /**
545
- * @hidden
546
- * Used by the TextBoxContainer to determine if the component is empty
547
- */
548
- isEmpty() {
549
- const currentValue = this.dateInput.nativeElement.value;
550
- return !currentValue || !String(currentValue).trim();
551
- }
552
- /**
553
- * @hidden
554
- */
555
- handleDragAndDrop(args) {
556
- args.preventDefault();
557
- }
558
- /**
559
- * @hidden
560
- */
561
- containsElement(element) {
562
- return Boolean(closest(element, node => node === this.wrapper.nativeElement));
563
- }
564
- /**
565
- * @hidden
566
- */
567
- ngOnInit() {
568
- if (this.kendoDate) {
569
- this.kendoDate.destroy();
570
- }
571
- this.kendoDate = this.initKendoDate();
572
- this.kendoDateObject = this.kendoDate.dateObject;
573
- this.updateFormatSections();
574
- this.subs.add(this.intl.changes.subscribe(this.intlChange.bind(this)));
575
- this.ngControl = this.injector.get(NgControl, null);
576
- if (this.wrapper) {
577
- this.renderer.removeAttribute(this.wrapper.nativeElement, 'tabindex');
578
- }
579
- this.minValidator = this.rangeValidation ? minValidator(this.min) : noop;
580
- this.maxValidator = this.rangeValidation ? maxValidator(this.max) : noop;
581
- }
582
- /**
583
- * @hidden
584
- */
585
- ngOnChanges(changes) {
586
- this.verifyRange();
587
- if (anyChanged(['min', 'max', 'rangeValidation', 'incompleteDateValidation'], changes, false)) {
588
- this.minValidator = this.rangeValidation ? minValidator(this.min) : noop;
589
- this.maxValidator = this.rangeValidation ? maxValidator(this.max) : noop;
590
- this.incompleteValidator = this.incompleteDateValidation ? incompleteDateValidator() : noop;
591
- this.onValidatorChange();
592
- }
593
- if (changes['clearButton']) {
594
- this.showClearButton = this.clearButton && (isPresent(this.value) || this.isDateIncomplete);
595
- }
596
- const isEqualToKendoDate = this.kendoDate && isEqual(this.value, this.kendoDate.value);
597
- if (!isEqualToKendoDate) {
598
- if (!this.kendoDate) {
599
- return;
600
- }
601
- this.kendoDate.writeValue(this.value);
602
- }
603
- if (changes['format'] || changes['placeholder']) {
604
- if (!this.kendoDate) {
605
- return;
606
- }
607
- this.kendoDate?.setOptions(this.options, true);
608
- this.updateFormatSections();
609
- }
610
- if (anyChanged(['enableMouseWheel', 'autoFill', 'autoSwitchParts', 'autoSwitchKeys', 'twoDigitYearMax', 'allowCaretMode', 'autoCorrectParts', 'readonly', 'steps', 'formatPlaceholder'], changes)) {
611
- if (!this.kendoDate) {
612
- return;
613
- }
614
- this.kendoDate?.setOptions(this.options, true);
615
- }
616
- }
617
- updateFormatSections() {
618
- this.formatSections = this.intl.splitDateFormat(this.kendoDate.inputFormat)
619
- .reduce(({ date, time }, p) => {
620
- return {
621
- date: date || DATE_PART_REGEXP.test(p.type),
622
- time: time || TIME_PART_REGEXP.test(p.type)
623
- };
624
- }, { date: false, time: false });
625
- }
626
- updateIncompleteValidationStatus() {
627
- const previousValue = this.isDateIncomplete;
628
- this.isDateIncomplete = this.kendoDateObject.hasValue() && this.value === null;
629
- if (previousValue === this.isDateIncomplete || !this.incompleteDateValidation) {
630
- return;
631
- }
632
- if (isPresent(this.ngControl) && !isPresent(this.pickerService)) {
633
- this.cdr.markForCheck();
634
- this.ngZone.run(() => this.onValidatorChange());
635
- }
636
- else if (isPresent(this.pickerService)) {
637
- this.pickerService.dateCompletenessChange.emit();
638
- }
639
- }
640
- ngAfterViewInit() {
641
- this.setComponentClasses();
642
- const formControl = this.injector.get(NgControl, null)?.control;
643
- this.control = formControl;
644
- this.subs.add(this.formControl?.statusChanges.subscribe(() => this.setAriaInvalid()));
645
- this.setAriaInvalid();
646
- this.subs.add(this.renderer.listen(this.dateInput?.nativeElement, 'keydown', this.handleKeyDown));
647
- }
648
- ngOnDestroy() {
649
- this.subs.unsubscribe();
650
- if (this.pickerService) {
651
- this.pickerService.input = null;
652
- }
653
- this.domEvents.forEach(unbindCallback => unbindCallback());
654
- }
655
- /**
656
- * @hidden
657
- */
658
- setAriaInvalid() {
659
- if (!this.control) {
660
- return;
661
- }
662
- if (this.control.invalid) {
663
- this.renderer.setAttribute(this.inputElement, attributeNames.ariaInvalid, 'true');
664
- }
665
- else {
666
- this.renderer.setAttribute(this.inputElement, attributeNames.ariaInvalid, 'false');
667
- }
668
- }
669
- /**
670
- * @hidden
671
- */
672
- get isControlRequired() {
673
- return isControlRequired(this.formControl) || this.isRequired;
674
- }
675
- /**
676
- * @hidden
677
- */
678
- validate(control) {
679
- return this.minValidator(control) || this.maxValidator(control) || this.incompleteValidator(control, this.isDateIncomplete);
680
- }
681
- /**
682
- * @hidden
683
- */
684
- registerOnValidatorChange(fn) {
685
- this.onValidatorChange = fn;
686
- }
687
- /**
688
- * @hidden
689
- */
690
- setDisabledState(isDisabled) {
691
- this.disabled = isDisabled;
692
- this.cdr.markForCheck();
693
- }
694
- //ngModel binding
695
- /**
696
- * @hidden
697
- */
698
- writeValue(value) {
699
- this.verifyValue(value);
700
- this.value = cloneDate(value);
701
- this.kendoDate?.setOptions(this.options, true);
702
- this.kendoDateObject?.setValue(this.value);
703
- this.kendoDate?.refreshElementValue();
704
- }
705
- resetInput() {
706
- this.isDateIncomplete = false;
707
- this.writeValue(null);
708
- // Notify datepicker that a change has happened and emit `valueChange`
709
- this.notify();
710
- this.showClearButton = false;
711
- }
712
- /**
713
- * @hidden
714
- */
715
- triggerChange() {
716
- const value = this.kendoDate.value;
717
- const oneValuePresent = isPresent(value) !== isPresent(this.value);
718
- if (+value !== +this.value || oneValuePresent) {
719
- this.value = cloneDate(value);
720
- this.notify();
721
- }
722
- }
723
- /**
724
- * @hidden
725
- */
726
- notify() {
727
- this.ngZone.run(() => {
728
- this.showClearButton = this.value ? true : false;
729
- this.onControlChange(cloneDate(this.value));
730
- this.valueChange.emit(cloneDate(this.value));
731
- });
732
- }
733
- /**
734
- * @hidden
735
- */
736
- registerOnChange(fn) {
737
- this.onControlChange = fn;
738
- }
739
- /**
740
- * @hidden
741
- */
742
- registerOnTouched(fn) {
743
- this.onControlTouched = fn;
744
- }
745
- /**
746
- * Focuses the DateInput component.
747
- *
748
- */
749
- focus() {
750
- this.kendoDate?.focus();
751
- }
752
- /**
753
- * Blurs the DateInput component.
754
- */
755
- blur() {
756
- const input = this.inputElement;
757
- if (input) {
758
- input.blur();
759
- }
760
- }
761
- /**
762
- * @hidden
763
- */
764
- handleButtonClick(offset) {
765
- this.showClearButton = true;
766
- this.arrowDirection = Arrow.None;
767
- if (!this.isActive) {
768
- this.kendoDate.focus();
769
- }
770
- this.kendoDate.modifyDateSegmentValue(offset);
771
- }
772
- initKendoDate() {
773
- const kendoDate = new DateInput(this.dateInput.nativeElement, {
774
- ...this.options,
775
- events: {
776
- valueChange: this.onWidgetValueChange.bind(this),
777
- inputEnd: this.onWidgetInputEnd.bind(this),
778
- focusEnd: this.onWidgetFocus.bind(this),
779
- blurEnd: this.onWidgetBlur.bind(this),
780
- keydown: this.onWidgetKeyDown.bind(this),
781
- }
782
- });
783
- return kendoDate;
784
- }
785
- onWidgetValueChange() {
786
- this.triggerChange();
787
- }
788
- onWidgetKeyDown() {
789
- this.kendoDateObject = this.kendoDate.dateObject;
790
- }
791
- onWidgetInputEnd() {
792
- this.updateIncompleteValidationStatus();
793
- if (this.clearButton) {
794
- this.showClearButton = this.value || this.isDateIncomplete ? true : false;
795
- this.cdr.markForCheck();
796
- }
797
- }
798
- onWidgetFocus(args) {
799
- this.isActive = true;
800
- if (hasObservers(this.onFocus)) {
801
- this.ngZone.run(() => {
802
- this.emitFocus(args.event);
803
- });
804
- }
805
- else {
806
- this.emitFocus(args.event);
807
- }
808
- }
809
- onWidgetBlur(args) {
810
- this.isActive = false;
811
- if (hasObservers(this.onBlur) || requiresZoneOnBlur(this.ngControl)) {
812
- this.ngZone.run(() => {
813
- this.onControlTouched();
814
- this.emitBlur(args.event);
815
- this.cdr.markForCheck();
816
- });
817
- }
818
- else {
819
- this.emitBlur(args.event);
820
- }
821
- }
822
- handleKeyDown(event) {
823
- // an event without keyCode is triggered when using Edge's autofill -> ignore it in the common package
824
- if (!isPresent(event.keyCode)) {
825
- event.stopImmediatePropagation();
826
- }
827
- }
828
- verifyRange() {
829
- if (!isDevMode()) {
830
- return;
831
- }
832
- if (!isValidRange(this.min, this.max)) {
833
- throw new Error(`The max value should be bigger than the min. See ${MIN_DOC_LINK} and ${MAX_DOC_LINK}.`);
834
- }
835
- }
836
- verifyValue(value) {
837
- if (!isDevMode()) {
838
- return;
839
- }
840
- if (value && !(value instanceof Date)) {
841
- throw new Error(`The 'value' should be a valid JavaScript Date instance or null. Check ${VALUE_DOC_LINK} for possible resolution.`);
842
- }
843
- }
844
- intlChange() {
845
- this.kendoDate.setOptions(this.options, true);
846
- this.updateFormatSections();
847
- }
848
- emitFocus(args) {
849
- this.onFocus.emit();
850
- if (this.pickerService) {
851
- this.pickerService.onFocus.emit(args);
852
- }
853
- }
854
- emitBlur(args) {
855
- this.onBlur.emit();
856
- if (this.pickerService) {
857
- this.pickerService.onBlur.emit(args);
858
- }
859
- }
860
- setSpinnerFill(spinner, fill, oldFill) {
861
- if (oldFill !== 'none') {
862
- this.renderer.removeClass(spinner, `k-button-${oldFill}`);
863
- this.renderer.removeClass(spinner, `k-button-${oldFill}-base`);
864
- }
865
- this.renderer.addClass(spinner, `k-button-${fill}`);
866
- this.renderer.addClass(spinner, `k-button-${fill}-base`);
867
- }
868
- setComponentClasses() {
869
- if (this.size !== 'none') {
870
- this.renderer.addClass(this.wrapper.nativeElement, getSizeClass('input', this.size));
871
- }
872
- if (this.rounded !== 'none') {
873
- this.renderer.addClass(this.wrapper.nativeElement, getRoundedClass(this.rounded));
874
- }
875
- if (this.fillMode !== 'none') {
876
- this.renderer.addClass(this.wrapper.nativeElement, getFillModeClass('input', this.fillMode));
877
- }
878
- if (this.spinners && this.fillMode !== 'none') {
879
- this.setSpinnerFill(this.spinup.nativeElement, this.fillMode);
880
- this.setSpinnerFill(this.spindown.nativeElement, this.fillMode);
881
- }
882
- }
883
- setInputAttributes() {
884
- const attributesToRender = { ...this.mutableAttributes, ...this.parsedAttributes };
885
- setHTMLAttributes(attributesToRender, this.renderer, this.dateInput.nativeElement, this.ngZone);
886
- }
887
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DateInputComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.IntlService }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.Injector }, { token: i2.LocalizationService }, { token: i3.PickerService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
888
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: DateInputComponent, isStandalone: true, selector: "kendo-dateinput", inputs: { focusableId: "focusableId", pickerType: "pickerType", clearButton: "clearButton", disabled: "disabled", readonly: "readonly", title: "title", tabindex: "tabindex", role: "role", ariaReadOnly: "ariaReadOnly", tabIndex: "tabIndex", isRequired: "isRequired", format: "format", formatPlaceholder: "formatPlaceholder", placeholder: "placeholder", steps: "steps", max: "max", min: "min", rangeValidation: "rangeValidation", autoCorrectParts: "autoCorrectParts", autoSwitchParts: "autoSwitchParts", autoSwitchKeys: "autoSwitchKeys", allowCaretMode: "allowCaretMode", autoFill: "autoFill", incompleteDateValidation: "incompleteDateValidation", twoDigitYearMax: "twoDigitYearMax", enableMouseWheel: "enableMouseWheel", value: "value", spinners: "spinners", isPopupOpen: "isPopupOpen", hasPopup: "hasPopup", size: "size", rounded: "rounded", fillMode: "fillMode", inputAttributes: "inputAttributes" }, outputs: { valueChange: "valueChange", valueUpdate: "valueUpdate", onFocus: "focus", onBlur: "blur" }, host: { properties: { "class.k-readonly": "this.readonly", "class.k-input": "this.wrapperClass", "class.k-dateinput": "this.wrapperClass", "class.k-disabled": "this.disabledClass" } }, providers: [
889
- { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DateInputComponent), multi: true },
890
- { provide: NG_VALIDATORS, useExisting: forwardRef(() => DateInputComponent), multi: true },
891
- { provide: L10N_PREFIX, useValue: 'kendo.dateinput' },
892
- { provide: KendoInput, useExisting: forwardRef(() => DateInputComponent) },
893
- LocalizationService
894
- ], viewQueries: [{ propertyName: "dateInput", first: true, predicate: ["dateInput"], descendants: true, static: true }, { propertyName: "spinup", first: true, predicate: ["spinup"], descendants: true }, { propertyName: "spindown", first: true, predicate: ["spindown"], descendants: true }], exportAs: ["kendo-dateinput"], usesOnChanges: true, ngImport: i0, template: `
895
- <ng-container kendoDateInputLocalizedMessages
896
- i18n-increment="kendo.dateinput.increment|The label for the **Increment** button in the DateInput"
897
- increment="Increase value"
898
-
899
- i18n-decrement="kendo.dateinput.decrement|The label for the **Decrement** button in the DateInput"
900
- decrement="Decrease value"
901
-
902
- i18n-clearTitle="kendo.dateinput.clearTitle|The title of the clear button"
903
- clearTitle="clear"
904
- >
905
- </ng-container>
906
- <input #dateInput
907
- class="k-input-inner"
908
- [attr.required]="isControlRequired ? '' : null"
909
- autocomplete="off"
910
- autocorrect="off"
911
- autocapitalize="off"
912
- spellcheck="false"
913
- [attr.role]="role"
914
- [attr.aria-readonly]="ariaReadOnly"
915
- [id]="focusableId"
916
- [title]="title"
917
- [tabindex]="tabindex"
918
- [disabled]="disabled"
919
- [readonly]="readonly"
920
- [attr.placeholder]="placeholder"
921
- [attr.aria-expanded]="isPopupOpen"
922
- [attr.aria-haspopup]="hasPopup"
923
- [kendoEventsOutsideAngular]="{
924
- dragstart: handleDragAndDrop,
925
- drop: handleDragAndDrop
926
- }"
927
- [scope]="this"
928
- />
929
- @if (clearButton && showClearButton) {
930
- <span
931
- class="k-clear-value"
932
- [attr.title]="localization.get('clearTitle')"
933
- role="button"
934
- tabindex="-1"
935
- (click)="resetInput()"
936
- (mousedown)="$event.preventDefault()"
937
- >
938
- <kendo-icon-wrapper
939
- name="x"
940
- [svgIcon]="xIcon"
941
- >
942
- </kendo-icon-wrapper>
943
- </span>
944
- }
945
- @if (spinners) {
946
- <span class="k-input-spinner k-spin-button" (mousedown)="$event.preventDefault()">
947
- <button
948
- #spinup
949
- tabindex="-1"
950
- class="k-spinner-increase k-button k-icon-button"
951
- [class.k-active]="arrowDirection === arrow.Up"
952
- (mousedown)="arrowDirection = arrow.Up"
953
- (mouseleave)="arrowDirection = arrow.None"
954
- (click)="handleButtonClick(1)"
955
- [title]="localization.get('increment')"
956
- [attr.aria-label]="localization.get('increment')"
957
- >
958
- <kendo-icon-wrapper
959
- name="caret-alt-up"
960
- [svgIcon]="caretAltUpIcon"
961
- innerCssClass="k-button-icon"
962
- >
963
- </kendo-icon-wrapper>
964
- </button>
965
- <button
966
- #spindown
967
- tabindex="-1"
968
- class="k-spinner-decrease k-button k-icon-button"
969
- (click)="handleButtonClick(-1)"
970
- [class.k-active]="arrowDirection === arrow.Down"
971
- (mousedown)="arrowDirection = arrow.Down"
972
- (mouseleave)="arrowDirection = arrow.None"
973
- [title]="localization.get('decrement')"
974
- [attr.aria-label]="localization.get('decrement')"
975
- >
976
- <kendo-icon-wrapper
977
- name="caret-alt-down"
978
- [svgIcon]="caretAltDownIcon"
979
- innerCssClass="k-button-icon"
980
- >
981
- </kendo-icon-wrapper>
982
- </button>
983
- </span>
984
- }
985
- `, isInline: true, dependencies: [{ kind: "directive", type: DateInputLocalizedMessagesDirective, selector: "[kendoDateInputLocalizedMessages]" }, { 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
986
- }
987
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DateInputComponent, decorators: [{
988
- type: Component,
989
- args: [{
990
- changeDetection: ChangeDetectionStrategy.OnPush,
991
- exportAs: 'kendo-dateinput',
992
- providers: [
993
- { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DateInputComponent), multi: true },
994
- { provide: NG_VALIDATORS, useExisting: forwardRef(() => DateInputComponent), multi: true },
995
- { provide: L10N_PREFIX, useValue: 'kendo.dateinput' },
996
- { provide: KendoInput, useExisting: forwardRef(() => DateInputComponent) },
997
- LocalizationService
998
- ],
999
- selector: 'kendo-dateinput',
1000
- template: `
1001
- <ng-container kendoDateInputLocalizedMessages
1002
- i18n-increment="kendo.dateinput.increment|The label for the **Increment** button in the DateInput"
1003
- increment="Increase value"
1004
-
1005
- i18n-decrement="kendo.dateinput.decrement|The label for the **Decrement** button in the DateInput"
1006
- decrement="Decrease value"
1007
-
1008
- i18n-clearTitle="kendo.dateinput.clearTitle|The title of the clear button"
1009
- clearTitle="clear"
1010
- >
1011
- </ng-container>
1012
- <input #dateInput
1013
- class="k-input-inner"
1014
- [attr.required]="isControlRequired ? '' : null"
1015
- autocomplete="off"
1016
- autocorrect="off"
1017
- autocapitalize="off"
1018
- spellcheck="false"
1019
- [attr.role]="role"
1020
- [attr.aria-readonly]="ariaReadOnly"
1021
- [id]="focusableId"
1022
- [title]="title"
1023
- [tabindex]="tabindex"
1024
- [disabled]="disabled"
1025
- [readonly]="readonly"
1026
- [attr.placeholder]="placeholder"
1027
- [attr.aria-expanded]="isPopupOpen"
1028
- [attr.aria-haspopup]="hasPopup"
1029
- [kendoEventsOutsideAngular]="{
1030
- dragstart: handleDragAndDrop,
1031
- drop: handleDragAndDrop
1032
- }"
1033
- [scope]="this"
1034
- />
1035
- @if (clearButton && showClearButton) {
1036
- <span
1037
- class="k-clear-value"
1038
- [attr.title]="localization.get('clearTitle')"
1039
- role="button"
1040
- tabindex="-1"
1041
- (click)="resetInput()"
1042
- (mousedown)="$event.preventDefault()"
1043
- >
1044
- <kendo-icon-wrapper
1045
- name="x"
1046
- [svgIcon]="xIcon"
1047
- >
1048
- </kendo-icon-wrapper>
1049
- </span>
1050
- }
1051
- @if (spinners) {
1052
- <span class="k-input-spinner k-spin-button" (mousedown)="$event.preventDefault()">
1053
- <button
1054
- #spinup
1055
- tabindex="-1"
1056
- class="k-spinner-increase k-button k-icon-button"
1057
- [class.k-active]="arrowDirection === arrow.Up"
1058
- (mousedown)="arrowDirection = arrow.Up"
1059
- (mouseleave)="arrowDirection = arrow.None"
1060
- (click)="handleButtonClick(1)"
1061
- [title]="localization.get('increment')"
1062
- [attr.aria-label]="localization.get('increment')"
1063
- >
1064
- <kendo-icon-wrapper
1065
- name="caret-alt-up"
1066
- [svgIcon]="caretAltUpIcon"
1067
- innerCssClass="k-button-icon"
1068
- >
1069
- </kendo-icon-wrapper>
1070
- </button>
1071
- <button
1072
- #spindown
1073
- tabindex="-1"
1074
- class="k-spinner-decrease k-button k-icon-button"
1075
- (click)="handleButtonClick(-1)"
1076
- [class.k-active]="arrowDirection === arrow.Down"
1077
- (mousedown)="arrowDirection = arrow.Down"
1078
- (mouseleave)="arrowDirection = arrow.None"
1079
- [title]="localization.get('decrement')"
1080
- [attr.aria-label]="localization.get('decrement')"
1081
- >
1082
- <kendo-icon-wrapper
1083
- name="caret-alt-down"
1084
- [svgIcon]="caretAltDownIcon"
1085
- innerCssClass="k-button-icon"
1086
- >
1087
- </kendo-icon-wrapper>
1088
- </button>
1089
- </span>
1090
- }
1091
- `,
1092
- standalone: true,
1093
- imports: [DateInputLocalizedMessagesDirective, EventsOutsideAngularDirective, IconWrapperComponent]
1094
- }]
1095
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1.IntlService }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: i0.Injector }, { type: i2.LocalizationService }, { type: i3.PickerService, decorators: [{
1096
- type: Optional
1097
- }] }], propDecorators: { focusableId: [{
1098
- type: Input
1099
- }], pickerType: [{
1100
- type: Input
1101
- }], clearButton: [{
1102
- type: Input
1103
- }], disabled: [{
1104
- type: Input
1105
- }], readonly: [{
1106
- type: Input
1107
- }, {
1108
- type: HostBinding,
1109
- args: ['class.k-readonly']
1110
- }], title: [{
1111
- type: Input
1112
- }], tabindex: [{
1113
- type: Input
1114
- }], role: [{
1115
- type: Input
1116
- }], ariaReadOnly: [{
1117
- type: Input
1118
- }], tabIndex: [{
1119
- type: Input
1120
- }], isRequired: [{
1121
- type: Input
1122
- }], format: [{
1123
- type: Input
1124
- }], formatPlaceholder: [{
1125
- type: Input
1126
- }], placeholder: [{
1127
- type: Input
1128
- }], steps: [{
1129
- type: Input
1130
- }], max: [{
1131
- type: Input
1132
- }], min: [{
1133
- type: Input
1134
- }], rangeValidation: [{
1135
- type: Input
1136
- }], autoCorrectParts: [{
1137
- type: Input
1138
- }], autoSwitchParts: [{
1139
- type: Input
1140
- }], autoSwitchKeys: [{
1141
- type: Input
1142
- }], allowCaretMode: [{
1143
- type: Input
1144
- }], autoFill: [{
1145
- type: Input
1146
- }], incompleteDateValidation: [{
1147
- type: Input
1148
- }], twoDigitYearMax: [{
1149
- type: Input
1150
- }], enableMouseWheel: [{
1151
- type: Input
1152
- }], value: [{
1153
- type: Input
1154
- }], spinners: [{
1155
- type: Input
1156
- }], isPopupOpen: [{
1157
- type: Input
1158
- }], hasPopup: [{
1159
- type: Input
1160
- }], size: [{
1161
- type: Input
1162
- }], rounded: [{
1163
- type: Input
1164
- }], fillMode: [{
1165
- type: Input
1166
- }], inputAttributes: [{
1167
- type: Input
1168
- }], valueChange: [{
1169
- type: Output
1170
- }], valueUpdate: [{
1171
- type: Output
1172
- }], onFocus: [{
1173
- type: Output,
1174
- args: ['focus']
1175
- }], onBlur: [{
1176
- type: Output,
1177
- args: ['blur']
1178
- }], dateInput: [{
1179
- type: ViewChild,
1180
- args: ['dateInput', { static: true }]
1181
- }], wrapperClass: [{
1182
- type: HostBinding,
1183
- args: ['class.k-input']
1184
- }, {
1185
- type: HostBinding,
1186
- args: ['class.k-dateinput']
1187
- }], disabledClass: [{
1188
- type: HostBinding,
1189
- args: ['class.k-disabled']
1190
- }], spinup: [{
1191
- type: ViewChild,
1192
- args: ['spinup', { static: false }]
1193
- }], spindown: [{
1194
- type: ViewChild,
1195
- args: ['spindown', { static: false }]
1196
- }] } });