@progress/kendo-react-dateinputs 9.3.0-develop.1 → 9.3.0-develop.3

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.
@@ -6,376 +6,273 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import * as o from "react";
9
+ import * as r from "react";
10
10
  import e from "prop-types";
11
- import { cloneDate as f, isEqual as L } from "@progress/kendo-date-math";
12
- import { Button as x } from "@progress/kendo-react-buttons";
13
- import { caretAltUpIcon as _, caretAltDownIcon as V } from "@progress/kendo-svg-icons";
14
- import { provideLocalizationService as A, provideIntlService as P, registerForIntl as F, registerForLocalization as N } from "@progress/kendo-react-intl";
15
- import { getActiveElement as M, validatePackage as q, classNames as u, uDateInput as m, createPropsContext as B, withIdHOC as R, withPropsContext as j, withUnstyledHOC as U } from "@progress/kendo-react-common";
16
- import { FloatingLabel as z } 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 W, isInRange as J } 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 v, decreaseValue as b } from "../messages/index.mjs";
22
- import { isInTimeRange as Q } from "../timepicker/utils.mjs";
23
- import ee from "../common/ClearButton.mjs";
24
- import { DateInputIntl as te } from "./dateInputIntl.mjs";
25
- const ie = "Please enter a valid value!", n = class n extends o.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 = () => {
28
- this._element && this._element.focus();
29
- }, this.setValidity = () => {
30
- this.element && this.element.setCustomValidity && this.element.setCustomValidity(
31
- this.validity.valid ? "" : this.props.validationMessage || n.defaultProps.validationMessage
32
- );
33
- }, this.updateOnPaste = (i) => {
34
- !this.element || !this.kendoDate || this.triggerChange(i);
35
- }, this.spinnersMouseDown = (i) => {
36
- i.preventDefault();
37
- const s = M(document);
38
- this.element && s !== this.element && this.element.focus({ preventScroll: !0 });
39
- }, this.handleClick = (i) => {
40
- this.props.onChange && this.props.onChange(i);
41
- }, this.nativeWheel = (i) => {
42
- M(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) => {
50
- this.wrapper && this.wrapper.classList.add("k-focus"), this.setState({ focused: !0 });
51
- }, this.elementOnBlur = (i) => {
52
- this.wrapper && this.wrapper.classList.remove("k-focus"), this.setState({ focused: !1 });
53
- }, q(X), this.state = {
54
- focused: !1
55
- };
56
- }
57
- get _inputId() {
58
- return this.props.id + "-accessibility-id";
59
- }
60
- isFormatChanged(t, i) {
61
- return typeof t != typeof i ? !0 : typeof t == "string" && typeof i == "string" ? t !== i : typeof t == "object" && typeof i == "object" ? JSON.stringify(t) !== JSON.stringify(i) : !1;
62
- }
63
- mapFormatToCommonFormat(t) {
64
- return typeof t == "string" ? t : {
65
- inputFormat: t,
66
- displayFormat: t
67
- };
68
- }
69
- /* Public Getters */
70
- /**
71
- * Gets the value of the DateInput.
72
- */
73
- get value() {
74
- return this.valueDuringOnChange !== void 0 ? this.valueDuringOnChange : this.kendoDate && this.kendoDate.value;
75
- }
76
- /**
77
- * Gets the `name` property of the DateInput.
78
- */
79
- get name() {
80
- return this.props.name;
81
- }
82
- get min() {
83
- return this.props.min !== void 0 ? this.props.min : n.defaultProps.min;
84
- }
85
- get max() {
86
- return this.props.max !== void 0 ? this.props.max : n.defaultProps.max;
87
- }
88
- get isInSegmentSelection() {
89
- const { year: t, month: i, day: s, hours: a, minutes: r, seconds: l } = this.kendoDateObject;
90
- return (!t || !i || !s || !a || !r || !l) && (t || i || s || a || r || l);
91
- }
92
- /**
93
- * @hidden
94
- */
95
- get text() {
96
- const { placeholder: t } = this.props, i = this.kendoDate && this.kendoDate.currentText || "";
97
- return t != null && !this.state.focused && !this.value ? t : i;
98
- }
99
- /**
100
- * Represents the validity state into which the DateInput is set.
101
- */
102
- get validity() {
103
- const t = J(this.value, this.min, this.max) && Q(this.value, this.props.minTime, this.props.maxTime), i = this.props.validationMessage !== void 0, s = (!this.required || this.value !== null) && t, a = this.props.valid !== void 0 ? this.props.valid : s;
11
+ import { cloneDate as T, isEqual as qe } from "@progress/kendo-date-math";
12
+ import { Button as G } from "@progress/kendo-react-buttons";
13
+ import { caretAltUpIcon as Ne, caretAltDownIcon as _e } from "@progress/kendo-svg-icons";
14
+ import { useInternationalization as Fe, useLocalization as Be } from "@progress/kendo-react-intl";
15
+ import { validatePackage as He, useId as ze, useUnstyled as Ue, usePropsContext as Z, classNames as b, uDateInput as h, createPropsContext as We, getActiveElement as $ } from "@progress/kendo-react-common";
16
+ import { FloatingLabel as je } from "@progress/kendo-react-labels";
17
+ import { DateInput as Ke } from "@progress/kendo-dateinputs-common";
18
+ import { DEFAULT_FORMAT as Ye, DEFAULT_FORMAT_PLACEHOLDER as Je, isInRange as Xe } from "./utils.mjs";
19
+ import { packageMetadata as Ge } from "../package-metadata.mjs";
20
+ import { nullable as c, MAX_DATE as Ze, MIN_DATE as $e, MIN_TIME as Qe, MAX_TIME as et } from "../utils.mjs";
21
+ import { increaseValue as P, messages as S, decreaseValue as k } from "../messages/index.mjs";
22
+ import { isInTimeRange as tt } from "../timepicker/utils.mjs";
23
+ import nt from "../common/ClearButton.mjs";
24
+ import { DateInputIntl as at } from "./dateInputIntl.mjs";
25
+ const rt = "Please enter a valid value!", ee = r.forwardRef((t, te) => {
26
+ var X;
27
+ He(Ge);
28
+ const ne = ze(t.id), ae = Fe(), E = Be(), re = Ue(), q = Z(Q, t).unstyled || re, {
29
+ format: L = i.format,
30
+ size: ie = i.size,
31
+ rounded: oe = i.rounded,
32
+ fillMode: le = i.fillMode,
33
+ formatPlaceholder: ue = i.formatPlaceholder,
34
+ spinners: se = i.spinners,
35
+ disabled: I = i.disabled,
36
+ min: ce = i.min,
37
+ max: de = i.max,
38
+ minTime: me = i.minTime,
39
+ maxTime: fe = i.maxTime,
40
+ validityStyles: ge = i.validityStyles,
41
+ validationMessage: N = i.validationMessage,
42
+ placeholder: f = i.placeholder,
43
+ enableMouseWheel: ve = i.enableMouseWheel,
44
+ autoCorrectParts: ye = i.autoCorrectParts,
45
+ autoSwitchParts: be = i.autoSwitchParts,
46
+ allowCaretMode: he = i.allowCaretMode,
47
+ twoDigitYearMax: Ee = i.twoDigitYearMax,
48
+ ariaHasPopup: Ie = i.ariaHasPopup,
49
+ autoFocus: Oe = i.autoFocus
50
+ } = Z(Q, t), d = () => C.current !== void 0 ? C.current : o.current && o.current.value, De = () => {
51
+ const { year: n, month: a, day: y, hours: R, minutes: w, seconds: M } = x.current;
52
+ return (!n || !a || !y || !R || !w || !M) && (n || a || y || R || w || M);
53
+ }, _ = () => {
54
+ const n = o.current && o.current.currentText || "", a = d();
55
+ return f != null && !pe.focused && !a ? f : n;
56
+ }, F = () => t.required !== void 0 ? t.required : !1, p = () => {
57
+ const n = d() || t.value, a = ce, y = de, R = Xe(n, a, y) && tt(n, me, fe), w = N !== void 0, M = (!F() || n != null) && R, Ve = t.valid !== void 0 ? t.valid : M;
104
58
  return {
105
- customError: i,
106
- rangeOverflow: this.value && this.max.getTime() < this.value.getTime() || !1,
107
- rangeUnderflow: this.value && this.value.getTime() < this.min.getTime() || !1,
108
- valid: a,
109
- valueMissing: this.value === null
59
+ customError: w,
60
+ rangeOverflow: n && y.getTime() < n.getTime() || !1,
61
+ rangeUnderflow: n && n.getTime() < a.getTime() || !1,
62
+ valid: Ve,
63
+ valueMissing: n === null
110
64
  };
111
- }
112
- /**
113
- * Gets the element of the DateInput.
114
- *
115
- * @return - An `HTMLInputElement`.
116
- *
117
- * @example
118
- * ```jsx
119
- * class App extends React.Component {
120
- * constructor(props) {
121
- * super(props);
122
- * }
123
- * element = null;
124
- * render() {
125
- * return (
126
- * <div>
127
- * <DateInput
128
- * ref={(dateInput) =>
129
- * this.element = dateInput ? dateInput.element : null}
130
- * />
131
- * <button onClick={() => console.log(this.element)}>console.log the element</button>
132
- * </div>
133
- * );
134
- * }
135
- * }
136
- *
137
- * ReactDOM.render(
138
- * <App />,
139
- * document.getElementsByTagName('my-app')[0]
140
- * );
141
- * ```
142
- */
143
- get element() {
144
- return this._element;
145
- }
146
- /**
147
- * @hidden
148
- */
149
- get validityStyles() {
150
- return this.props.validityStyles !== void 0 ? this.props.validityStyles : n.defaultProps.validityStyles;
151
- }
152
- /**
153
- * @hidden
154
- */
155
- get required() {
156
- return this.props.required !== void 0 ? this.props.required : !1;
157
- }
158
- /**
159
- * @hidden
160
- */
161
- get wrapper() {
162
- return this._wrapper;
163
- }
164
- /**
165
- * @hidden
166
- */
167
- get options() {
168
- const {
169
- format: t,
170
- steps: i,
171
- placeholder: s,
172
- value: a,
173
- autoFill: r,
174
- enableMouseWheel: l,
175
- autoCorrectParts: h,
176
- autoSwitchParts: p,
177
- autoSwitchKeys: y,
178
- twoDigitYearMax: D,
179
- allowCaretMode: d,
180
- formatPlaceholder: C
181
- } = this.props;
65
+ }, xe = () => {
66
+ l.current && l.current.focus();
67
+ }, B = () => new at(ae), O = () => {
68
+ const n = d();
182
69
  return {
183
- format: t,
184
- steps: i,
185
- formatPlaceholder: C,
186
- placeholder: s,
70
+ format: L,
71
+ steps: t.steps,
72
+ formatPlaceholder: ue,
73
+ placeholder: f,
187
74
  selectPreviousSegmentOnBackspace: !0,
188
- value: a || this.value,
189
- intlService: this.intlCommon,
190
- autoFill: r !== void 0 ? r : !1,
191
- enableMouseWheel: l,
192
- autoCorrectParts: h,
193
- autoSwitchParts: p,
194
- autoSwitchKeys: y || [],
195
- twoDigitYearMax: D,
196
- allowCaretMode: d
75
+ value: t.value || n,
76
+ intlService: B(),
77
+ autoFill: t.autoFill !== void 0 ? t.autoFill : !1,
78
+ enableMouseWheel: ve,
79
+ autoCorrectParts: ye,
80
+ autoSwitchParts: be,
81
+ autoSwitchKeys: t.autoSwitchKeys || [],
82
+ twoDigitYearMax: Ee,
83
+ allowCaretMode: he
197
84
  };
198
- }
199
- /**
200
- * @hidden
201
- */
202
- componentDidMount() {
203
- 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);
204
- }
205
- /**
206
- * @hidden
207
- */
208
- componentDidUpdate(t) {
209
- this.setValidity(), this.kendoDate && ((this.isFormatChanged(t.format, this.props.format) || t.readonly !== this.props.readonly || t.steps !== this.props.steps || this.intlCommon.locale !== this.kendoDate.options.intlService.locale) && 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());
210
- }
211
- /**
212
- * @hidden
213
- */
214
- componentWillUnmount() {
215
- this.wrapper && this.wrapper.removeEventListener("wheel", this.nativeWheel);
216
- }
217
- /**
218
- * @hidden
219
- */
220
- render() {
221
- var S;
222
- const {
223
- size: t = n.defaultProps.size,
224
- fillMode: i = n.defaultProps.fillMode,
225
- rounded: s = n.defaultProps.rounded,
226
- autoFocus: a = n.defaultProps.autoFocus,
227
- inputAttributes: r,
228
- unstyled: l
229
- } = this.props, h = l && l.uDateInput;
230
- this.props._ref && (this.props._ref.current = this);
231
- const p = A(this), y = { ...n.defaultProps, ...this.props }, { name: D, label: d, id: C, disabled: T } = y, E = this.text, k = C || this._inputId, O = !this.validityStyles || this.validity.valid, I = /* @__PURE__ */ o.createElement(
232
- "span",
233
- {
234
- ref: (w) => {
235
- this._wrapper = w;
236
- },
237
- style: d ? void 0 : { width: this.props.width },
238
- dir: this.props.dir,
239
- className: u(
240
- m.wrapper({
241
- c: h,
242
- size: t,
243
- fillMode: i,
244
- rounded: s,
245
- disabled: T,
246
- required: this.required,
247
- invalid: !O
248
- }),
249
- this.props.className
250
- )
85
+ }, Ce = (n) => {
86
+ u.current && u.current.classList.add("k-focus"), j({ focused: !0 });
87
+ }, Re = (n) => {
88
+ u.current && u.current.classList.remove("k-focus"), j({ focused: !1 });
89
+ }, we = (n, a) => typeof n != typeof a ? !0 : typeof n == "string" && typeof a == "string" ? n !== a : typeof n == "object" && typeof a == "object" ? JSON.stringify(n) !== JSON.stringify(a) : !1, Me = (n) => typeof n == "string" ? n : {
90
+ inputFormat: n,
91
+ displayFormat: n
92
+ }, H = (n) => {
93
+ C.current = d(), Ae(), m.current = n, C.current = void 0;
94
+ }, z = (n) => {
95
+ t.onChange && t.onChange(n);
96
+ }, U = (n) => {
97
+ $(document) === l.current && n.preventDefault();
98
+ }, Te = () => new Ke(l.current, {
99
+ ...O(),
100
+ format: Me(O().format),
101
+ events: {
102
+ focus: Ce,
103
+ blur: Re,
104
+ valueChange: H,
105
+ click: z
106
+ }
107
+ }), W = () => {
108
+ l.current && l.current.setCustomValidity && l.current.setCustomValidity(
109
+ p().valid ? "" : N || i.validationMessage
110
+ );
111
+ }, Pe = (n) => {
112
+ !l.current || !o.current || H(n);
113
+ }, Se = (n) => {
114
+ n.preventDefault();
115
+ const a = $(document);
116
+ l.current && a !== l.current && l.current.focus({ preventScroll: !0 });
117
+ }, s = (n) => {
118
+ const a = d();
119
+ m.current && t.onChange && !qe(m.current.oldValue, a) && t.onChange.call(void 0, {
120
+ syntheticEvent: n,
121
+ nativeEvent: m.current.event,
122
+ value: m.current.value,
123
+ target: D.current
124
+ }), m.current = null;
125
+ }, ke = (n) => {
126
+ var a;
127
+ (a = o.current) == null || a.modifyDateSegmentValue(1), s(n);
128
+ }, Le = (n) => {
129
+ var a;
130
+ (a = o.current) == null || a.modifyDateSegmentValue(-1), s(n);
131
+ }, D = r.useRef(null), l = r.useRef(null), u = r.useRef(null);
132
+ r.useImperativeHandle(
133
+ D,
134
+ () => ({
135
+ props: t,
136
+ get options() {
137
+ return O();
138
+ },
139
+ get text() {
140
+ return _();
251
141
  },
252
- /* @__PURE__ */ o.createElement(
253
- "input",
254
- {
255
- role: this.props.ariaRole || "textbox",
256
- readOnly: this.props.readonly,
257
- tabIndex: this.props.tabIndex || 0,
258
- disabled: this.props.disabled,
259
- title: this.props.title !== void 0 ? this.props.title : E,
260
- value: E,
261
- type: "text",
262
- spellCheck: !1,
263
- autoComplete: "off",
264
- autoCorrect: "off",
265
- autoFocus: a,
266
- className: u(m.inputInner({ c: h })),
267
- id: k,
268
- "aria-label": this.props.ariaLabel,
269
- "aria-labelledby": this.props.ariaLabelledBy,
270
- "aria-describedby": this.props.ariaDescribedBy,
271
- "aria-haspopup": this.props.ariaHasPopup,
272
- "aria-disabled": this.props.disabled,
273
- "aria-expanded": this.props.ariaExpanded,
274
- "aria-controls": this.props.ariaControls,
275
- "aria-required": this.props.required,
276
- "aria-invalid": !O,
277
- onKeyDown: this.onChange.bind(this),
278
- onChange: this.onChange.bind(this),
279
- onWheel: this.onChange.bind(this),
280
- onInput: this.onChange.bind(this),
281
- onClick: this.onChange.bind(this),
282
- name: D,
283
- ref: (w) => this._element = w,
284
- ...r
285
- }
286
- ),
287
- this.props.children,
288
- this.props.clearButton && this.props.value && /* @__PURE__ */ o.createElement(ee, { onClick: this.handleClick, key: "clearbutton" }),
289
- this.props.spinners && /* @__PURE__ */ o.createElement(
290
- "span",
291
- {
292
- className: u(m.inputSpinner({ c: h })),
293
- onMouseDown: this.spinnersMouseDown
294
- },
295
- /* @__PURE__ */ o.createElement(
296
- x,
297
- {
298
- tabIndex: -1,
299
- type: "button",
300
- rounded: null,
301
- className: u(m.spinnerIncrease({ c: h })),
302
- icon: "caret-alt-up",
303
- svgIcon: _,
304
- "aria-label": p.toLanguageString(g, v[g]),
305
- title: p.toLanguageString(g, v[g]),
306
- onClick: this.increasePart
307
- }
308
- ),
309
- /* @__PURE__ */ o.createElement(
310
- x,
311
- {
312
- tabIndex: -1,
313
- type: "button",
314
- rounded: null,
315
- className: u(m.spinnerDecrease({ c: h })),
316
- icon: "caret-alt-down",
317
- svgIcon: V,
318
- "aria-label": p.toLanguageString(b, v[b]),
319
- title: p.toLanguageString(b, v[b]),
320
- onClick: this.decreasePart
321
- }
322
- )
142
+ get element() {
143
+ return l.current;
144
+ },
145
+ get name() {
146
+ return t.name;
147
+ },
148
+ get value() {
149
+ return d();
150
+ },
151
+ get validity() {
152
+ return p();
153
+ },
154
+ // hidden methods
155
+ focus: xe,
156
+ updateOnPaste: Pe
157
+ })
158
+ ), r.useImperativeHandle(te, () => D.current);
159
+ const o = r.useRef(null), x = r.useRef(null), A = r.useRef(!1), C = r.useRef(null), m = r.useRef(null), g = r.useRef(t), [pe, j] = r.useState({ focused: !1 }), [, Ae] = r.useReducer((n) => n + 1, 0);
160
+ r.useLayoutEffect(() => {
161
+ A.current || (o.current = Te(), x.current = o.current.dateObject, A.current = !0);
162
+ }, []), r.useEffect(() => (W(), A.current || u.current && u.current.addEventListener("wheel", U, { passive: !1 }), () => {
163
+ u.current && u.current.removeEventListener("wheel", U);
164
+ }), []), r.useEffect(() => {
165
+ W(), o.current && ((we(g.current.format, L) || g.current.readonly !== t.readonly || g.current.steps !== t.steps || B().locale !== o.current.options.intlService.locale) && o.current.setOptions(O(), !0), g.current.value !== t.value && (x.current.getValue() !== null || De() && t.value !== null) && x.current.setValue(t.value), t.ariaExpanded !== void 0 && t.ariaExpanded && (o.current.options.placeholder = null), t.ariaExpanded !== void 0 && !t.ariaExpanded && (o.current.options.placeholder = f), o.current.refreshElementValue(), g.current = {
166
+ format: L,
167
+ readonly: t.readonly,
168
+ ariaExpanded: t.ariaExpanded,
169
+ steps: t.steps,
170
+ value: t.value
171
+ });
172
+ });
173
+ const K = t.id || ne + "-accessibility-id", v = q && q.uDateInput, Y = _(), V = !ge || p().valid;
174
+ t._ref && (t._ref.current = D.current);
175
+ const J = /* @__PURE__ */ r.createElement(
176
+ "span",
177
+ {
178
+ ref: (n) => u.current = n,
179
+ style: t.label ? void 0 : { width: t.width },
180
+ dir: t.dir,
181
+ className: b(
182
+ h.wrapper({
183
+ c: v,
184
+ size: ie,
185
+ fillMode: le,
186
+ rounded: oe,
187
+ disabled: I,
188
+ required: F(),
189
+ invalid: !V
190
+ }),
191
+ t.className
323
192
  )
324
- );
325
- return d ? /* @__PURE__ */ o.createElement(
326
- z,
193
+ },
194
+ /* @__PURE__ */ r.createElement(
195
+ "input",
327
196
  {
328
- label: d,
329
- editorId: k,
330
- editorValue: (S = this._element) == null ? void 0 : S.value,
331
- editorValid: O,
332
- editorDisabled: this.props.disabled,
333
- children: I,
334
- style: { width: this.props.width }
197
+ ref: (n) => l.current = n,
198
+ role: t.ariaRole || "textbox",
199
+ readOnly: t.readonly,
200
+ tabIndex: t.tabIndex || 0,
201
+ disabled: I,
202
+ title: t.title !== void 0 ? t.title : Y,
203
+ type: "text",
204
+ spellCheck: !1,
205
+ autoComplete: "off",
206
+ autoCorrect: "off",
207
+ autoFocus: Oe,
208
+ className: b(h.inputInner({ c: v })),
209
+ id: K,
210
+ value: Y,
211
+ "aria-label": t.ariaLabel,
212
+ "aria-labelledby": t.ariaLabelledBy,
213
+ "aria-describedby": t.ariaDescribedBy,
214
+ "aria-haspopup": Ie,
215
+ "aria-disabled": I,
216
+ "aria-expanded": t.ariaExpanded,
217
+ "aria-controls": t.ariaControls,
218
+ "aria-required": t.required,
219
+ "aria-invalid": !V,
220
+ onKeyDown: s,
221
+ onChange: s,
222
+ onWheel: s,
223
+ onInput: s,
224
+ onClick: s,
225
+ name: t.name,
226
+ ...t.inputAttributes
335
227
  }
336
- ) : I;
337
- }
338
- /**
339
- * @hidden
340
- */
341
- intl() {
342
- return P(this);
343
- }
344
- /**
345
- * @hidden
346
- */
347
- get intlCommon() {
348
- return new te(P(this));
349
- }
350
- /* end handlers */
351
- triggerChange(t) {
352
- this.valueDuringOnChange = this.value, this.forceUpdate(), this._nativeEvent = t, this.valueDuringOnChange = void 0;
353
- }
354
- onChange(t) {
355
- this._nativeEvent && this.props.onChange && !L(this._nativeEvent.oldValue, this.value) && this.props.onChange.call(void 0, {
356
- syntheticEvent: t,
357
- nativeEvent: this._nativeEvent.event,
358
- value: this._nativeEvent.value,
359
- target: this
360
- }), this._nativeEvent = null;
361
- }
362
- initKendoDate() {
363
- return new H(this._element, {
364
- ...this.options,
365
- format: this.mapFormatToCommonFormat(this.options.format),
366
- events: {
367
- focus: this.elementOnFocus.bind(this),
368
- blur: this.elementOnBlur.bind(this),
369
- valueChange: this.triggerChange.bind(this),
370
- click: this.handleClick.bind(this)
228
+ ),
229
+ t.children,
230
+ t.clearButton && t.value && /* @__PURE__ */ r.createElement(nt, { onClick: z, key: "clearbutton" }),
231
+ se && /* @__PURE__ */ r.createElement("span", { className: b(h.inputSpinner({ c: v })), onMouseDown: Se }, /* @__PURE__ */ r.createElement(
232
+ G,
233
+ {
234
+ tabIndex: -1,
235
+ type: "button",
236
+ rounded: null,
237
+ className: b(h.spinnerIncrease({ c: v })),
238
+ icon: "caret-alt-up",
239
+ svgIcon: Ne,
240
+ "aria-label": E.toLanguageString(P, S[P]),
241
+ title: E.toLanguageString(P, S[P]),
242
+ onClick: ke
371
243
  }
372
- });
373
- }
374
- };
375
- n.displayName = "DateInput", n.propTypes = {
244
+ ), /* @__PURE__ */ r.createElement(
245
+ G,
246
+ {
247
+ tabIndex: -1,
248
+ type: "button",
249
+ rounded: null,
250
+ className: b(h.spinnerDecrease({ c: v })),
251
+ icon: "caret-alt-down",
252
+ svgIcon: _e,
253
+ "aria-label": E.toLanguageString(k, S[k]),
254
+ title: E.toLanguageString(k, S[k]),
255
+ onClick: Le
256
+ }
257
+ ))
258
+ );
259
+ return t.label ? /* @__PURE__ */ r.createElement(
260
+ je,
261
+ {
262
+ label: t.label,
263
+ editorId: K,
264
+ editorValue: (X = l.current) == null ? void 0 : X.value,
265
+ editorValid: V,
266
+ editorDisabled: I,
267
+ children: J,
268
+ style: { width: t.width }
269
+ }
270
+ ) : J;
271
+ });
272
+ ee.propTypes = {
376
273
  value: e.instanceOf(Date),
377
274
  format: e.oneOfType([
378
- e.string,
275
+ c(e.string),
379
276
  e.shape({
380
277
  skeleton: e.string,
381
278
  pattern: e.string,
@@ -395,31 +292,26 @@ n.displayName = "DateInput", n.propTypes = {
395
292
  })
396
293
  ]),
397
294
  formatPlaceholder: e.oneOfType([
398
- e.oneOf([
399
- "wide",
400
- "narrow",
401
- "short",
402
- "formatPattern"
403
- ]),
295
+ e.oneOf(["wide", "narrow", "short", "formatPattern"]).isRequired,
404
296
  e.shape({
405
- year: e.string,
406
- month: e.string,
407
- day: e.string,
408
- hour: e.string,
409
- minute: e.string,
410
- second: e.string
297
+ year: e.string.isRequired,
298
+ month: e.string.isRequired,
299
+ day: e.string.isRequired,
300
+ hour: e.string.isRequired,
301
+ minute: e.string.isRequired,
302
+ second: e.string.isRequired
411
303
  })
412
304
  ]),
413
305
  width: e.oneOfType([e.string, e.number]),
414
306
  tabIndex: e.number,
415
307
  title: e.string,
416
308
  steps: e.shape({
417
- year: e.number,
418
- month: e.number,
419
- day: e.number,
420
- hour: e.number,
421
- minute: e.number,
422
- second: e.number
309
+ year: c(e.number),
310
+ month: c(e.number),
311
+ day: c(e.number),
312
+ hour: c(e.number),
313
+ minute: c(e.number),
314
+ second: c(e.number)
423
315
  }),
424
316
  min: e.instanceOf(Date),
425
317
  max: e.instanceOf(Date),
@@ -433,54 +325,47 @@ n.displayName = "DateInput", n.propTypes = {
433
325
  ariaDescribedBy: e.string,
434
326
  ariaLabel: e.string,
435
327
  ariaRole: e.string,
436
- ariaHasPopup: e.oneOfType([e.bool, e.string]),
328
+ ariaHasPopup: e.oneOfType([
329
+ e.bool,
330
+ e.oneOf(["grid", "dialog"])
331
+ ]),
437
332
  ariaExpanded: e.oneOfType([e.bool]),
438
333
  onChange: e.func,
439
334
  validationMessage: e.string,
440
335
  required: e.bool,
441
- validate: e.bool,
442
336
  valid: e.bool,
443
337
  size: e.oneOf([null, "small", "medium", "large"]),
444
338
  rounded: e.oneOf([null, "small", "medium", "large", "full"]),
445
339
  fillMode: e.oneOf([null, "solid", "flat", "outline"]),
446
340
  autoFocus: e.bool,
447
341
  inputAttributes: e.object
448
- }, n.defaultProps = {
449
- format: K,
342
+ };
343
+ const i = {
344
+ format: Ye,
450
345
  size: "medium",
451
346
  rounded: "medium",
452
347
  fillMode: "solid",
453
- formatPlaceholder: W,
348
+ formatPlaceholder: Je,
454
349
  spinners: !1,
455
350
  disabled: !1,
456
- max: f(Y),
457
- min: f(G),
458
- minTime: f(Z),
459
- maxTime: f($),
351
+ max: T(Ze),
352
+ min: T($e),
353
+ minTime: T(Qe),
354
+ maxTime: T(et),
460
355
  validityStyles: !0,
461
- validationMessage: ie,
356
+ validationMessage: rt,
462
357
  placeholder: null,
463
358
  enableMouseWheel: !0,
464
359
  autoCorrectParts: !0,
465
360
  autoSwitchParts: !0,
466
361
  allowCaretMode: !1,
467
362
  twoDigitYearMax: 68,
468
- // the rest of the properties are undefined by default
469
363
  ariaHasPopup: "grid",
470
364
  autoFocus: !1
471
- };
472
- let c = n;
473
- const se = B(), ne = R(
474
- j(
475
- se,
476
- U(c)
477
- )
478
- );
479
- ne.displayName = "KendoReactDateInput";
480
- F(c);
481
- N(c);
365
+ }, Q = We();
366
+ ee.displayName = "KendoReactDateInput";
482
367
  export {
483
- ne as DateInput,
484
- se as DateInputPropsContext,
485
- c as DateInputWithoutContext
368
+ ee as DateInput,
369
+ Q as DateInputPropsContext,
370
+ i as dateInputDefaultProps
486
371
  };