@progress/kendo-react-dateinputs 9.0.0-develop.2 → 9.0.0-develop.20

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 (40) hide show
  1. package/README.md +47 -46
  2. package/calendar/components/Calendar.mjs +57 -60
  3. package/calendar/components/CalendarNavigationItem.mjs +10 -12
  4. package/calendar/components/CalendarWeekCell.mjs +9 -1
  5. package/calendar/components/HorizontalViewList.mjs +8 -11
  6. package/calendar/components/MultiViewCalendar.mjs +13 -8
  7. package/calendar/components/Navigation.mjs +11 -11
  8. package/calendar/components/View.mjs +8 -25
  9. package/common/PickerWrap.mjs +2 -15
  10. package/dateinput/DateInput.js +1 -1
  11. package/dateinput/DateInput.mjs +264 -321
  12. package/dateinput/dateInputIntl.js +8 -0
  13. package/dateinput/dateInputIntl.mjs +20 -0
  14. package/dateinput/utils.js +1 -1
  15. package/dateinput/utils.mjs +4 -27
  16. package/datepicker/DatePicker.js +1 -1
  17. package/datepicker/DatePicker.mjs +104 -82
  18. package/daterangepicker/DateRangePicker.mjs +14 -3
  19. package/datetimepicker/DateTimePicker.js +1 -1
  20. package/datetimepicker/DateTimePicker.mjs +102 -81
  21. package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
  22. package/hooks/usePickerFloatingLabel.js +1 -1
  23. package/hooks/usePickerFloatingLabel.mjs +6 -11
  24. package/index.d.mts +177 -36
  25. package/index.d.ts +177 -36
  26. package/package-metadata.mjs +1 -1
  27. package/package.json +8 -7
  28. package/timepicker/TimeList.mjs +27 -12
  29. package/timepicker/TimePart.mjs +55 -75
  30. package/timepicker/TimePicker.js +1 -1
  31. package/timepicker/TimePicker.mjs +85 -69
  32. package/timepicker/services/DOMService.mjs +7 -4
  33. package/timepicker/services/DayPeriodService.mjs +1 -4
  34. package/timepicker/utils.mjs +3 -15
  35. package/virtualization/Virtualization.js +1 -1
  36. package/virtualization/Virtualization.mjs +3 -13
  37. package/dateinput/models/kendo-date.js +0 -8
  38. package/dateinput/models/kendo-date.mjs +0 -233
  39. package/dateinput/models/mask.js +0 -8
  40. package/dateinput/models/mask.mjs +0 -16
@@ -6,254 +6,63 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import * as h from "react";
9
+ import * as l from "react";
10
10
  import e from "prop-types";
11
- import { cloneDate as f, isEqual as _ } from "@progress/kendo-date-math";
12
- import { Button as P } from "@progress/kendo-react-buttons";
13
- import { caretAltUpIcon as L, caretAltDownIcon as A } from "@progress/kendo-svg-icons";
14
- import { provideIntlService as O, provideLocalizationService as N, registerForIntl as q, registerForLocalization as R } from "@progress/kendo-react-intl";
15
- import { KendoDate as z } from "./models/kendo-date.mjs";
16
- import { getActiveElement as g, validatePackage as K, AsyncFocusBlur as U, classNames as p, uDateInput as c, noop as H, createPropsContext as j, withIdHOC as X, withPropsContext as Y, withUnstyledHOC as G } from "@progress/kendo-react-common";
17
- import { FloatingLabel as W } from "@progress/kendo-react-labels";
18
- import { packageMetadata as Z } from "../package-metadata.mjs";
19
- import { approximateStringMatching as J, defaultFormat as Q, defaultFormatPlaceholder as $, isInRange as ee } from "./utils.mjs";
20
- import { MAX_DATE as te, MIN_DATE as ie, MIN_TIME as se, MAX_TIME as re } from "../utils.mjs";
21
- import { increaseValue as v, messages as y, decreaseValue as b } from "../messages/index.mjs";
22
- import { isInTimeRange as ae } from "../timepicker/utils.mjs";
23
- import ne from "../common/ClearButton.mjs";
24
- const oe = "Please enter a valid value!", o = class o extends h.Component {
25
- constructor(i) {
26
- super(i), this.kendoDate = null, this.currentFormat = "", this.paste = !1, this._element = null, this._wrapper = null, this._lastSelectedSymbol = "", this.focus = () => {
11
+ import { cloneDate as c, isEqual as L } from "@progress/kendo-date-math";
12
+ import { Button as I } from "@progress/kendo-react-buttons";
13
+ import { caretAltUpIcon as _, caretAltDownIcon as V } from "@progress/kendo-svg-icons";
14
+ import { provideIntlService as x, provideLocalizationService as A, registerForIntl as F, registerForLocalization as N } from "@progress/kendo-react-intl";
15
+ import { getActiveElement as P, validatePackage as q, classNames as p, uDateInput as u, createPropsContext as B, withIdHOC as R, withPropsContext as U, withUnstyledHOC as z } from "@progress/kendo-react-common";
16
+ import { FloatingLabel as j } from "@progress/kendo-react-labels";
17
+ import { DateInput as H } from "@progress/kendo-dateinputs-common";
18
+ import { DEFAULT_FORMAT as K, DEFAULT_FORMAT_PLACEHOLDER as S, isInRange as W } from "./utils.mjs";
19
+ import { packageMetadata as X } from "../package-metadata.mjs";
20
+ import { MAX_DATE as Y, MIN_DATE as G, MIN_TIME as Z, MAX_TIME as $ } from "../utils.mjs";
21
+ import { increaseValue as g, messages as f, decreaseValue as v } from "../messages/index.mjs";
22
+ import { isInTimeRange as J } from "../timepicker/utils.mjs";
23
+ import Q from "../common/ClearButton.mjs";
24
+ import { DateInputIntl as ee } from "./dateInputIntl.mjs";
25
+ const te = "Please enter a valid value!", a = class a extends l.Component {
26
+ constructor(t) {
27
+ super(t), this.kendoDate = null, this.kendoDateObject = null, this.mounted = !1, this._element = null, this._wrapper = null, this._nativeEvent = null, this.focus = () => {
27
28
  this._element && this._element.focus();
28
29
  }, this.setValidity = () => {
29
30
  this.element && this.element.setCustomValidity && this.element.setCustomValidity(
30
- this.validity.valid ? "" : this.props.validationMessage || o.defaultProps.validationMessage
31
+ this.validity.valid ? "" : this.props.validationMessage || a.defaultProps.validationMessage
31
32
  );
32
- }, this.updateOnPaste = (t) => {
33
- if (!this.element || !this.kendoDate)
34
- return;
35
- const s = O(this).parseDate(this.element.value, this.props.format) || this.value, r = this.value;
36
- this.kendoDate.setValue(s), this.triggerChange(t, r);
37
- }, this.spinnersMouseDown = (t) => {
38
- t.preventDefault();
39
- const s = g(document);
33
+ }, this.updateOnPaste = (i) => {
34
+ !this.element || !this.kendoDate || this.triggerChange(i);
35
+ }, this.spinnersMouseDown = (i) => {
36
+ i.preventDefault();
37
+ const s = P(document);
40
38
  this.element && s !== this.element && this.element.focus({ preventScroll: !0 });
41
- }, this.handlePaste = () => {
42
- this.paste = !0;
43
- }, this.handleClick = (t) => {
44
- this.props.onChange && this.props.onChange(t);
45
- }, this.elementChange = (t) => {
46
- if (!this.element || !this.kendoDate)
47
- return;
48
- if (this.paste) {
49
- this.updateOnPaste(t), this.paste = !1;
50
- return;
51
- }
52
- const { text: s, format: r } = this.kendoDate.getTextAndFormat();
53
- this.currentFormat = r;
54
- const n = this.value, a = J(
55
- s,
56
- this.currentFormat,
57
- this.element.value,
58
- this.selection.start
59
- ), l = a.length === 1 && a[0][1] === "_";
60
- if (!l)
61
- for (let d = 0; d < a.length; d++)
62
- this.kendoDate.parsePart(a[d][0], a[d][1]);
63
- a.length && a[0][0] !== "_" && this.setSelection(this.selectionBySymbol(a[0][0])), l && this.switchDateSegment(1), this.triggerChange(t, n);
64
- }, this.elementClick = (t) => {
65
- this.setSelection(this.selectionByIndex(this.selection.start));
66
- }, this.nativeWheel = (t) => {
67
- g(document) === this.element && t.preventDefault();
68
- }, this.wheel = (t) => {
69
- g(document) === this.element && (t.nativeEvent.deltaY < 0 && this.increasePart(t), t.nativeEvent.deltaY > 0 && this.decreasePart(t));
70
- }, this.increasePart = (t) => {
71
- this.modifyDateSegmentValue(1, t);
72
- }, this.decreasePart = (t) => {
73
- this.modifyDateSegmentValue(-1, t);
74
- }, this.elementKeyDown = (t) => {
75
- if (!t.altKey) {
76
- switch (t.keyCode) {
77
- case 37:
78
- this.switchDateSegment(-1);
79
- break;
80
- case 38:
81
- this.modifyDateSegmentValue(1, t);
82
- break;
83
- case 39:
84
- this.switchDateSegment(1);
85
- break;
86
- case 40:
87
- this.modifyDateSegmentValue(-1, t);
88
- break;
89
- default:
90
- return;
91
- }
92
- t.preventDefault();
93
- }
94
- }, this.elementOnFocus = (t) => {
39
+ }, this.handleClick = (i) => {
40
+ this.props.onChange && this.props.onChange(i);
41
+ }, this.nativeWheel = (i) => {
42
+ P(document) === this.element && i.preventDefault();
43
+ }, this.increasePart = (i) => {
44
+ var s;
45
+ (s = this.kendoDate) == null || s.modifyDateSegmentValue(1), this.onChange(i);
46
+ }, this.decreasePart = (i) => {
47
+ var s;
48
+ (s = this.kendoDate) == null || s.modifyDateSegmentValue(-1), this.onChange(i);
49
+ }, this.elementOnFocus = (i) => {
95
50
  this.wrapper && this.wrapper.classList.add("k-focus"), this.setState({ focused: !0 });
96
- }, this.elementOnBlur = (t) => {
51
+ }, this.elementOnBlur = (i) => {
97
52
  this.wrapper && this.wrapper.classList.remove("k-focus"), this.setState({ focused: !1 });
98
- }, K(Z), this.state = {
53
+ }, q(X), this.state = {
99
54
  focused: !1
100
55
  };
101
56
  }
102
57
  get _inputId() {
103
58
  return this.props.id + "-accessibility-id";
104
59
  }
105
- /**
106
- * @hidden
107
- */
108
- componentDidMount() {
109
- this.setValidity(), this.wrapper && this.wrapper.addEventListener("wheel", this.nativeWheel, { passive: !1 });
110
- }
111
- /**
112
- * @hidden
113
- */
114
- componentDidUpdate(i, t) {
115
- this._lastSelectedSymbol && t.focused === this.state.focused ? this.setSelection(this.selectionBySymbol(this._lastSelectedSymbol)) : this.props.placeholder !== void 0 && this.selection.start === this.selection.end && this.setSelection({ start: 0, end: this.currentFormat.length }), this.setValidity();
116
- }
117
- /**
118
- * @hidden
119
- */
120
- componentWillUnmount() {
121
- this.wrapper && this.wrapper.removeEventListener("wheel", this.nativeWheel);
122
- }
123
- /**
124
- * @hidden
125
- */
126
- render() {
127
- const {
128
- size: i = o.defaultProps.size,
129
- fillMode: t = o.defaultProps.fillMode,
130
- rounded: s = o.defaultProps.rounded,
131
- autoFocus: r = o.defaultProps.autoFocus,
132
- unstyled: n
133
- } = this.props, a = n && n.uDateInput;
134
- this.props._ref && (this.props._ref.current = this);
135
- const l = N(this), d = { ...o.defaultProps, ...this.props }, { name: E, label: D, id: x, disabled: I } = d, u = this.text, T = u === this.props.placeholder ? "" : u, V = u === this.props.placeholder ? u : void 0, k = x || this._inputId, S = !this.validityStyles || this.validity.valid, F = /* @__PURE__ */ h.createElement(U, { onFocus: this.elementOnFocus, onBlur: this.elementOnBlur }, ({ onFocus: M, onBlur: B }) => /* @__PURE__ */ h.createElement(
136
- "span",
137
- {
138
- ref: (w) => {
139
- this._wrapper = w;
140
- },
141
- style: D ? void 0 : { width: this.props.width },
142
- dir: this.props.dir,
143
- className: p(
144
- c.wrapper({
145
- c: a,
146
- size: i,
147
- fillMode: t,
148
- rounded: s,
149
- disabled: I,
150
- required: this.required,
151
- invalid: !S
152
- }),
153
- this.props.className
154
- ),
155
- onFocus: M,
156
- onBlur: B
157
- },
158
- /* @__PURE__ */ h.createElement(
159
- "input",
160
- {
161
- role: this.props.ariaRole || "textbox",
162
- readOnly: this.props.readonly,
163
- tabIndex: this.props.tabIndex,
164
- disabled: this.props.disabled,
165
- title: this.props.title !== void 0 ? this.props.title : u,
166
- type: "text",
167
- spellCheck: !1,
168
- autoComplete: "off",
169
- autoCorrect: "off",
170
- autoFocus: r,
171
- className: p(c.inputInner({ c: a })),
172
- id: k,
173
- "aria-label": this.props.ariaLabel,
174
- "aria-labelledby": this.props.ariaLabelledBy,
175
- "aria-describedby": this.props.ariaDescribedBy,
176
- "aria-haspopup": this.props.ariaHasPopup,
177
- "aria-disabled": this.props.disabled,
178
- "aria-expanded": this.props.ariaExpanded,
179
- "aria-controls": this.props.ariaControls,
180
- "aria-required": this.props.required,
181
- "aria-invalid": !S,
182
- onWheel: this.wheel,
183
- onClick: this.elementClick,
184
- onInput: this.elementChange,
185
- onPaste: this.handlePaste,
186
- onKeyDown: this.elementKeyDown,
187
- onChange: H,
188
- value: T,
189
- placeholder: V,
190
- name: E,
191
- ref: (w) => this._element = w
192
- }
193
- ),
194
- this.props.children,
195
- this.props.clearButton && this.props.value && /* @__PURE__ */ h.createElement(ne, { onClick: this.handleClick, key: "clearbutton" }),
196
- this.props.spinners && /* @__PURE__ */ h.createElement(
197
- "span",
198
- {
199
- className: p(c.inputSpinner({ c: a })),
200
- onMouseDown: this.spinnersMouseDown
201
- },
202
- /* @__PURE__ */ h.createElement(
203
- P,
204
- {
205
- tabIndex: -1,
206
- type: "button",
207
- rounded: null,
208
- className: p(c.spinnerIncrease({ c: a })),
209
- icon: "caret-alt-up",
210
- svgIcon: L,
211
- "aria-label": l.toLanguageString(
212
- v,
213
- y[v]
214
- ),
215
- title: l.toLanguageString(v, y[v]),
216
- onClick: this.increasePart
217
- }
218
- ),
219
- /* @__PURE__ */ h.createElement(
220
- P,
221
- {
222
- tabIndex: -1,
223
- type: "button",
224
- rounded: null,
225
- className: p(c.spinnerDecrease({ c: a })),
226
- icon: "caret-alt-down",
227
- svgIcon: A,
228
- "aria-label": l.toLanguageString(
229
- b,
230
- y[b]
231
- ),
232
- title: l.toLanguageString(b, y[b]),
233
- onClick: this.decreasePart
234
- }
235
- )
236
- )
237
- ));
238
- return D ? /* @__PURE__ */ h.createElement(
239
- W,
240
- {
241
- label: D,
242
- editorId: k,
243
- editorValue: u,
244
- editorValid: S,
245
- editorDisabled: this.props.disabled,
246
- children: F,
247
- style: { width: this.props.width }
248
- }
249
- ) : F;
250
- }
251
60
  /* Public Getters */
252
61
  /**
253
62
  * Gets the value of the DateInput.
254
63
  */
255
64
  get value() {
256
- return this.valueDuringOnChange !== void 0 ? this.valueDuringOnChange : this.kendoDate && this.kendoDate.getDateObject();
65
+ return this.valueDuringOnChange !== void 0 ? this.valueDuringOnChange : this.kendoDate && this.kendoDate.value;
257
66
  }
258
67
  /**
259
68
  * Gets the `name` property of the DateInput.
@@ -262,32 +71,29 @@ const oe = "Please enter a valid value!", o = class o extends h.Component {
262
71
  return this.props.name;
263
72
  }
264
73
  get min() {
265
- return this.props.min !== void 0 ? this.props.min : o.defaultProps.min;
74
+ return this.props.min !== void 0 ? this.props.min : a.defaultProps.min;
266
75
  }
267
76
  get max() {
268
- return this.props.max !== void 0 ? this.props.max : o.defaultProps.max;
77
+ return this.props.max !== void 0 ? this.props.max : a.defaultProps.max;
78
+ }
79
+ get isInSegmentSelection() {
80
+ const { year: t, month: i, day: s, hours: r, minutes: o, seconds: n } = this.kendoDateObject;
81
+ return (!t || !i || !s || !r || !o || !n) && (t || i || s || r || o || n);
269
82
  }
270
83
  /**
271
84
  * @hidden
272
85
  */
273
86
  get text() {
274
- const i = { ...C.defaultProps, ...this.props }, {
275
- formatPlaceholder: t = o.defaultProps.formatPlaceholder,
276
- format: s = o.defaultProps.format,
277
- value: r,
278
- defaultValue: n
279
- } = i;
280
- this.kendoDate === null ? (this.kendoDate = new z(this.intl.bind(this), t, s), this.kendoDate.setValue(r || n || null)) : (this.kendoDate.format = s, this.kendoDate.formatPlaceholder = t), r !== void 0 && this.value !== r && this.kendoDate.setValue(r);
281
- const { text: a, format: l } = this.kendoDate.getTextAndFormat();
282
- return this.currentFormat = l, i.placeholder !== null && i.placeholder !== void 0 && !this.state.focused && !this.kendoDate.hasValue() ? i.placeholder : a;
87
+ const { placeholder: t } = this.props, i = this.kendoDate && this.kendoDate.currentText || "";
88
+ return t != null && !this.state.focused && !this.value ? t : i;
283
89
  }
284
90
  /**
285
91
  * Represents the validity state into which the DateInput is set.
286
92
  */
287
93
  get validity() {
288
- const i = ee(this.value, this.min, this.max) && ae(this.value, this.props.minTime, this.props.maxTime), t = this.props.validationMessage !== void 0, s = (!this.required || this.value !== null) && i, r = this.props.valid !== void 0 ? this.props.valid : s;
94
+ const t = W(this.value, this.min, this.max) && J(this.value, this.props.minTime, this.props.maxTime), i = this.props.validationMessage !== void 0, s = (!this.required || this.value !== null) && t, r = this.props.valid !== void 0 ? this.props.valid : s;
289
95
  return {
290
- customError: t,
96
+ customError: i,
291
97
  rangeOverflow: this.value && this.max.getTime() < this.value.getTime() || !1,
292
98
  rangeUnderflow: this.value && this.value.getTime() < this.min.getTime() || !1,
293
99
  valid: r,
@@ -332,7 +138,7 @@ const oe = "Please enter a valid value!", o = class o extends h.Component {
332
138
  * @hidden
333
139
  */
334
140
  get validityStyles() {
335
- return this.props.validityStyles !== void 0 ? this.props.validityStyles : o.defaultProps.validityStyles;
141
+ return this.props.validityStyles !== void 0 ? this.props.validityStyles : a.defaultProps.validityStyles;
336
142
  }
337
143
  /**
338
144
  * @hidden
@@ -349,74 +155,207 @@ const oe = "Please enter a valid value!", o = class o extends h.Component {
349
155
  /**
350
156
  * @hidden
351
157
  */
352
- intl() {
353
- return O(this);
354
- }
355
- /* end handlers */
356
- get selection() {
357
- let i = { start: 0, end: 0 };
358
- return this.element !== null && this.element.selectionStart !== void 0 && (i = { start: this.element.selectionStart, end: this.element.selectionEnd }), i;
158
+ get options() {
159
+ const {
160
+ format: t,
161
+ steps: i,
162
+ placeholder: s,
163
+ value: r,
164
+ autoFill: o,
165
+ enableMouseWheel: n,
166
+ autoCorrectParts: h,
167
+ autoSwitchParts: b,
168
+ autoSwitchKeys: y,
169
+ twoDigitYearMax: d,
170
+ allowCaretMode: D
171
+ } = this.props;
172
+ return {
173
+ format: t,
174
+ steps: i,
175
+ formatPlaceholder: S,
176
+ placeholder: s,
177
+ selectPreviousSegmentOnBackspace: !0,
178
+ value: r || this.value,
179
+ intlService: new ee(x(this)),
180
+ autoFill: o !== void 0 ? o : !1,
181
+ enableMouseWheel: n,
182
+ autoCorrectParts: h,
183
+ autoSwitchParts: b,
184
+ autoSwitchKeys: y || [],
185
+ twoDigitYearMax: d,
186
+ allowCaretMode: D
187
+ };
359
188
  }
360
- setSelection(i) {
361
- this._lastSelectedSymbol = this.currentFormat[i.start], window.requestAnimationFrame(() => {
362
- const t = g(document);
363
- this.element && t === this.element && !this.props.disableSelection && this.element.setSelectionRange(i.start, i.end);
364
- });
189
+ /**
190
+ * @hidden
191
+ */
192
+ componentDidMount() {
193
+ this.setValidity(), this.mounted || (this.wrapper && this.wrapper.addEventListener("wheel", this.nativeWheel, { passive: !1 }), this.kendoDate = this.initKendoDate(), this.kendoDateObject = this.kendoDate.dateObject, this.mounted = !0);
365
194
  }
366
- triggerChange(i, t) {
367
- this.valueDuringOnChange = this.value, this.forceUpdate(), this.props.onChange && !_(t, this.value) && this.props.onChange.call(void 0, {
368
- syntheticEvent: i,
369
- nativeEvent: i.nativeEvent,
370
- value: this.value,
371
- target: this
372
- // inRange: this.props.min && this.props.max ? isInRange(value, this.props.min, this.props.max) : true
373
- }), this.valueDuringOnChange = void 0;
195
+ /**
196
+ * @hidden
197
+ */
198
+ componentDidUpdate(t) {
199
+ this.setValidity(), this.kendoDate && ((t.format !== this.props.format || t.readonly !== this.props.readonly || t.steps !== this.props.steps) && this.kendoDate.setOptions(this.options, !0), t.value !== this.props.value && (this.kendoDateObject.getValue() !== null || this.isInSegmentSelection && this.props.value !== null) && this.kendoDateObject.setValue(this.props.value), this.props.ariaExpanded !== void 0 && this.props.ariaExpanded && (this.kendoDate.options.placeholder = null), this.props.ariaExpanded !== void 0 && !this.props.ariaExpanded && (this.kendoDate.options.placeholder = this.props.placeholder), this.kendoDate.refreshElementValue());
374
200
  }
375
- selectionBySymbol(i) {
376
- let t = -1, s = 0;
377
- for (let r = 0; r < this.currentFormat.length; r++)
378
- this.currentFormat[r] === i && (s = r + 1, t === -1 && (t = r));
379
- return t < 0 && (t = 0), { start: t, end: s };
201
+ /**
202
+ * @hidden
203
+ */
204
+ componentWillUnmount() {
205
+ this.wrapper && this.wrapper.removeEventListener("wheel", this.nativeWheel);
380
206
  }
381
- selectionByIndex(i) {
382
- let t = { start: i, end: i };
383
- for (let s = i, r = i - 1; s < this.currentFormat.length || r >= 0; s++, r--) {
384
- if (s < this.currentFormat.length && this.currentFormat[s] !== "_") {
385
- t = this.selectionBySymbol(this.currentFormat[s]);
386
- break;
387
- }
388
- if (r >= 0 && this.currentFormat[r] !== "_") {
389
- t = this.selectionBySymbol(this.currentFormat[r]);
390
- break;
207
+ /**
208
+ * @hidden
209
+ */
210
+ render() {
211
+ var k;
212
+ const {
213
+ size: t = a.defaultProps.size,
214
+ fillMode: i = a.defaultProps.fillMode,
215
+ rounded: s = a.defaultProps.rounded,
216
+ autoFocus: r = a.defaultProps.autoFocus,
217
+ unstyled: o
218
+ } = this.props, n = o && o.uDateInput;
219
+ this.props._ref && (this.props._ref.current = this);
220
+ const h = A(this), b = { ...a.defaultProps, ...this.props }, { name: y, label: d, id: D, disabled: M } = b, T = this.text, C = D || this._inputId, O = !this.validityStyles || this.validity.valid, E = /* @__PURE__ */ l.createElement(
221
+ "span",
222
+ {
223
+ ref: (w) => {
224
+ this._wrapper = w;
225
+ },
226
+ style: d ? void 0 : { width: this.props.width },
227
+ dir: this.props.dir,
228
+ className: p(
229
+ u.wrapper({
230
+ c: n,
231
+ size: t,
232
+ fillMode: i,
233
+ rounded: s,
234
+ disabled: M,
235
+ required: this.required,
236
+ invalid: !O
237
+ }),
238
+ this.props.className
239
+ )
240
+ },
241
+ /* @__PURE__ */ l.createElement(
242
+ "input",
243
+ {
244
+ role: this.props.ariaRole || "textbox",
245
+ readOnly: this.props.readonly,
246
+ tabIndex: this.props.tabIndex || 0,
247
+ disabled: this.props.disabled,
248
+ title: this.props.title !== void 0 ? this.props.title : T,
249
+ type: "text",
250
+ spellCheck: !1,
251
+ autoComplete: "off",
252
+ autoCorrect: "off",
253
+ autoFocus: r,
254
+ className: p(u.inputInner({ c: n })),
255
+ id: C,
256
+ "aria-label": this.props.ariaLabel,
257
+ "aria-labelledby": this.props.ariaLabelledBy,
258
+ "aria-describedby": this.props.ariaDescribedBy,
259
+ "aria-haspopup": this.props.ariaHasPopup,
260
+ "aria-disabled": this.props.disabled,
261
+ "aria-expanded": this.props.ariaExpanded,
262
+ "aria-controls": this.props.ariaControls,
263
+ "aria-required": this.props.required,
264
+ "aria-invalid": !O,
265
+ onKeyDown: this.onChange.bind(this),
266
+ onChange: this.onChange.bind(this),
267
+ onWheel: this.onChange.bind(this),
268
+ onInput: this.onChange.bind(this),
269
+ onClick: this.onChange.bind(this),
270
+ name: y,
271
+ ref: (w) => this._element = w
272
+ }
273
+ ),
274
+ this.props.children,
275
+ this.props.clearButton && this.props.value && /* @__PURE__ */ l.createElement(Q, { onClick: this.handleClick, key: "clearbutton" }),
276
+ this.props.spinners && /* @__PURE__ */ l.createElement(
277
+ "span",
278
+ {
279
+ className: p(u.inputSpinner({ c: n })),
280
+ onMouseDown: this.spinnersMouseDown
281
+ },
282
+ /* @__PURE__ */ l.createElement(
283
+ I,
284
+ {
285
+ tabIndex: -1,
286
+ type: "button",
287
+ rounded: null,
288
+ className: p(u.spinnerIncrease({ c: n })),
289
+ icon: "caret-alt-up",
290
+ svgIcon: _,
291
+ "aria-label": h.toLanguageString(g, f[g]),
292
+ title: h.toLanguageString(g, f[g]),
293
+ onClick: this.increasePart
294
+ }
295
+ ),
296
+ /* @__PURE__ */ l.createElement(
297
+ I,
298
+ {
299
+ tabIndex: -1,
300
+ type: "button",
301
+ rounded: null,
302
+ className: p(u.spinnerDecrease({ c: n })),
303
+ icon: "caret-alt-down",
304
+ svgIcon: V,
305
+ "aria-label": h.toLanguageString(v, f[v]),
306
+ title: h.toLanguageString(v, f[v]),
307
+ onClick: this.decreasePart
308
+ }
309
+ )
310
+ )
311
+ );
312
+ return d ? /* @__PURE__ */ l.createElement(
313
+ j,
314
+ {
315
+ label: d,
316
+ editorId: C,
317
+ editorValue: (k = this._element) == null ? void 0 : k.value,
318
+ editorValid: O,
319
+ editorDisabled: this.props.disabled,
320
+ children: E,
321
+ style: { width: this.props.width }
391
322
  }
392
- }
393
- return t;
323
+ ) : E;
394
324
  }
395
- switchDateSegment(i) {
396
- const { start: t, end: s } = this.selection;
397
- if (t < s && this.currentFormat[t] !== this.currentFormat[s - 1]) {
398
- this.setSelection(this.selectionByIndex(i > 0 ? t : s - 1));
399
- return;
400
- }
401
- const r = this.currentFormat[t];
402
- let n = t + i;
403
- for (; n > 0 && n < this.currentFormat.length && !(this.currentFormat[n] !== r && this.currentFormat[n] !== "_"); )
404
- n += i;
405
- if (this.currentFormat[n] === "_")
406
- return;
407
- let a = n;
408
- for (; a >= 0 && a < this.currentFormat.length && this.currentFormat[a] === this.currentFormat[n]; )
409
- a += i;
410
- n > a && (a + 1 !== t || n + 1 !== s) ? this.setSelection({ start: a + 1, end: n + 1 }) : n < a && (n !== t || a !== s) && this.setSelection({ start: n, end: a });
325
+ /**
326
+ * @hidden
327
+ */
328
+ intl() {
329
+ return x(this);
330
+ }
331
+ get intlCommon() {
332
+ return this.intlProvider();
411
333
  }
412
- modifyDateSegmentValue(i, t) {
413
- if (!this.kendoDate)
414
- return;
415
- const s = this.value, r = this.currentFormat[this.selection.start], n = this.kendoDate.symbolMap(r), a = ((this.props.steps || {})[n] || 1) * i;
416
- this.kendoDate.modifyPart(r, a), this.triggerChange(t, s);
334
+ /* end handlers */
335
+ triggerChange(t) {
336
+ this.valueDuringOnChange = this.value, this.forceUpdate(), this._nativeEvent = t, this.valueDuringOnChange = void 0;
337
+ }
338
+ onChange(t) {
339
+ this._nativeEvent && this.props.onChange && !L(this._nativeEvent.oldValue, this.value) && this.props.onChange.call(void 0, {
340
+ syntheticEvent: t,
341
+ nativeEvent: this._nativeEvent.event,
342
+ value: this._nativeEvent.value,
343
+ target: this
344
+ }), this._nativeEvent = null;
345
+ }
346
+ initKendoDate() {
347
+ return new H(this._element, {
348
+ ...this.options,
349
+ events: {
350
+ focus: this.elementOnFocus.bind(this),
351
+ blur: this.elementOnBlur.bind(this),
352
+ valueChange: this.triggerChange.bind(this),
353
+ click: this.handleClick.bind(this)
354
+ }
355
+ });
417
356
  }
418
357
  };
419
- o.displayName = "DateInput", o.propTypes = {
358
+ a.displayName = "DateInput", a.propTypes = {
420
359
  value: e.instanceOf(Date),
421
360
  format: e.oneOfType([
422
361
  e.string,
@@ -488,38 +427,42 @@ o.displayName = "DateInput", o.propTypes = {
488
427
  rounded: e.oneOf([null, "small", "medium", "large", "full"]),
489
428
  fillMode: e.oneOf([null, "solid", "flat", "outline"]),
490
429
  autoFocus: e.bool
491
- }, o.defaultProps = {
492
- format: Q,
430
+ }, a.defaultProps = {
431
+ format: K,
493
432
  size: "medium",
494
433
  rounded: "medium",
495
434
  fillMode: "solid",
496
- formatPlaceholder: $,
497
- // defaultValue: null as Date | null,
435
+ formatPlaceholder: S,
498
436
  spinners: !1,
499
437
  disabled: !1,
500
- max: f(te),
501
- min: f(ie),
502
- minTime: f(se),
503
- maxTime: f(re),
438
+ max: c(Y),
439
+ min: c(G),
440
+ minTime: c(Z),
441
+ maxTime: c($),
504
442
  validityStyles: !0,
505
- validationMessage: oe,
443
+ validationMessage: te,
506
444
  placeholder: null,
445
+ enableMouseWheel: !0,
446
+ autoCorrectParts: !0,
447
+ autoSwitchParts: !0,
448
+ allowCaretMode: !1,
449
+ twoDigitYearMax: 68,
507
450
  // the rest of the properties are undefined by default
508
451
  ariaHasPopup: "grid",
509
452
  autoFocus: !1
510
453
  };
511
- let m = o;
512
- const le = j(), C = X(
513
- Y(
514
- le,
515
- G(m)
454
+ let m = a;
455
+ const ie = B(), se = R(
456
+ U(
457
+ ie,
458
+ z(m)
516
459
  )
517
460
  );
518
- C.displayName = "KendoReactDateInput";
519
- q(m);
520
- R(m);
461
+ se.displayName = "KendoReactDateInput";
462
+ F(m);
463
+ N(m);
521
464
  export {
522
- C as DateInput,
523
- le as DateInputPropsContext,
465
+ se as DateInput,
466
+ ie as DateInputPropsContext,
524
467
  m as DateInputWithoutContext
525
468
  };