@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.
- package/dateinput/DateInput.js +1 -1
- package/dateinput/DateInput.mjs +285 -400
- package/daterangepicker/DateRangePicker.js +1 -1
- package/daterangepicker/DateRangePicker.mjs +49 -49
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/hooks/usePickerFloatingLabel.js +1 -1
- package/hooks/usePickerFloatingLabel.mjs +1 -1
- package/index.d.mts +150 -319
- package/index.d.ts +150 -319
- package/index.js +1 -1
- package/index.mjs +10 -10
- package/package-metadata.mjs +1 -1
- package/package.json +7 -7
package/dateinput/DateInput.mjs
CHANGED
|
@@ -6,376 +6,273 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
9
|
+
import * as r from "react";
|
|
10
10
|
import e from "prop-types";
|
|
11
|
-
import { cloneDate as
|
|
12
|
-
import { Button as
|
|
13
|
-
import { caretAltUpIcon as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { FloatingLabel as
|
|
17
|
-
import { DateInput as
|
|
18
|
-
import { DEFAULT_FORMAT as
|
|
19
|
-
import { packageMetadata as
|
|
20
|
-
import { MAX_DATE as
|
|
21
|
-
import { increaseValue as
|
|
22
|
-
import { isInTimeRange as
|
|
23
|
-
import
|
|
24
|
-
import { DateInputIntl as
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
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:
|
|
106
|
-
rangeOverflow:
|
|
107
|
-
rangeUnderflow:
|
|
108
|
-
valid:
|
|
109
|
-
valueMissing:
|
|
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
|
-
|
|
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:
|
|
184
|
-
steps:
|
|
185
|
-
formatPlaceholder:
|
|
186
|
-
placeholder:
|
|
70
|
+
format: L,
|
|
71
|
+
steps: t.steps,
|
|
72
|
+
formatPlaceholder: ue,
|
|
73
|
+
placeholder: f,
|
|
187
74
|
selectPreviousSegmentOnBackspace: !0,
|
|
188
|
-
value:
|
|
189
|
-
intlService:
|
|
190
|
-
autoFill:
|
|
191
|
-
enableMouseWheel:
|
|
192
|
-
autoCorrectParts:
|
|
193
|
-
autoSwitchParts:
|
|
194
|
-
autoSwitchKeys:
|
|
195
|
-
twoDigitYearMax:
|
|
196
|
-
allowCaretMode:
|
|
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
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
const
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
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
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
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
|
-
|
|
326
|
-
|
|
193
|
+
},
|
|
194
|
+
/* @__PURE__ */ r.createElement(
|
|
195
|
+
"input",
|
|
327
196
|
{
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
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
|
-
)
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
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
|
-
|
|
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([
|
|
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
|
-
}
|
|
449
|
-
|
|
342
|
+
};
|
|
343
|
+
const i = {
|
|
344
|
+
format: Ye,
|
|
450
345
|
size: "medium",
|
|
451
346
|
rounded: "medium",
|
|
452
347
|
fillMode: "solid",
|
|
453
|
-
formatPlaceholder:
|
|
348
|
+
formatPlaceholder: Je,
|
|
454
349
|
spinners: !1,
|
|
455
350
|
disabled: !1,
|
|
456
|
-
max:
|
|
457
|
-
min:
|
|
458
|
-
minTime:
|
|
459
|
-
maxTime:
|
|
351
|
+
max: T(Ze),
|
|
352
|
+
min: T($e),
|
|
353
|
+
minTime: T(Qe),
|
|
354
|
+
maxTime: T(et),
|
|
460
355
|
validityStyles: !0,
|
|
461
|
-
validationMessage:
|
|
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
|
-
|
|
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
|
-
|
|
484
|
-
|
|
485
|
-
|
|
368
|
+
ee as DateInput,
|
|
369
|
+
Q as DateInputPropsContext,
|
|
370
|
+
i as dateInputDefaultProps
|
|
486
371
|
};
|