@progress/kendo-react-dateinputs 9.4.0-develop.1 → 9.4.0-develop.10
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/calendar/components/Calendar.js +1 -1
- package/calendar/components/Calendar.mjs +0 -1
- package/calendar/components/CalendarCell.js +1 -1
- package/calendar/components/CalendarCell.mjs +12 -13
- package/calendar/components/CalendarHeaderTitle.js +1 -1
- package/calendar/components/CalendarHeaderTitle.mjs +3 -4
- package/calendar/components/CalendarNavigationItem.js +1 -1
- package/calendar/components/CalendarNavigationItem.mjs +2 -3
- package/calendar/components/CalendarWeekCell.js +1 -1
- package/calendar/components/CalendarWeekCell.mjs +8 -9
- package/calendar/components/Header.js +1 -1
- package/calendar/components/Header.mjs +0 -1
- package/calendar/components/HorizontalViewList.js +1 -1
- package/calendar/components/HorizontalViewList.mjs +0 -1
- package/calendar/components/MultiViewCalendar.js +1 -1
- package/calendar/components/MultiViewCalendar.mjs +0 -1
- package/calendar/components/Navigation.js +1 -1
- package/calendar/components/Navigation.mjs +0 -1
- package/calendar/components/TodayCommand.js +1 -1
- package/calendar/components/TodayCommand.mjs +0 -1
- package/calendar/components/View.js +1 -1
- package/calendar/components/View.mjs +0 -1
- package/calendar/components/ViewList.js +1 -1
- package/calendar/components/ViewList.mjs +0 -1
- package/calendar/models/CalendarViewEnum.js +1 -1
- package/calendar/models/CalendarViewEnum.mjs +0 -1
- package/calendar/models/NavigationAction.js +1 -1
- package/calendar/models/NavigationAction.mjs +0 -1
- package/calendar/models/SelectionRange.js +1 -1
- package/calendar/models/SelectionRange.mjs +0 -1
- package/calendar/services/BusViewService.js +1 -1
- package/calendar/services/BusViewService.mjs +0 -1
- package/calendar/services/CenturyViewService.js +1 -1
- package/calendar/services/CenturyViewService.mjs +0 -1
- package/calendar/services/DOMService.js +1 -1
- package/calendar/services/DOMService.mjs +0 -1
- package/calendar/services/DecadeViewService.js +1 -1
- package/calendar/services/DecadeViewService.mjs +0 -1
- package/calendar/services/MonthViewService.js +1 -1
- package/calendar/services/MonthViewService.mjs +0 -1
- package/calendar/services/NavigationService.js +1 -1
- package/calendar/services/NavigationService.mjs +18 -19
- package/calendar/services/ScrollSyncService.js +1 -1
- package/calendar/services/ScrollSyncService.mjs +0 -1
- package/calendar/services/WeekNamesService.js +1 -1
- package/calendar/services/WeekNamesService.mjs +5 -6
- package/calendar/services/YearViewService.js +1 -1
- package/calendar/services/YearViewService.mjs +0 -1
- package/common/AdaptiveMode.js +1 -1
- package/common/AdaptiveMode.mjs +7 -8
- package/common/ClearButton.js +1 -1
- package/common/ClearButton.mjs +7 -8
- package/common/PickerWrap.js +1 -1
- package/common/PickerWrap.mjs +3 -4
- package/dateinput/DateInput.js +1 -1
- package/dateinput/DateInput.mjs +69 -68
- package/dateinput/dateInputIntl.js +1 -1
- package/dateinput/dateInputIntl.mjs +3 -4
- package/dateinput/utils.js +1 -1
- package/dateinput/utils.mjs +4 -5
- package/datepicker/DatePicker.js +1 -1
- package/datepicker/DatePicker.mjs +131 -132
- package/datepicker/ToggleButton.js +1 -1
- package/datepicker/ToggleButton.mjs +3 -4
- package/daterangepicker/DateRangePicker.js +1 -1
- package/daterangepicker/DateRangePicker.mjs +0 -1
- package/datetimepicker/DateTimePicker.js +1 -1
- package/datetimepicker/DateTimePicker.mjs +0 -1
- package/datetimepicker/DateTimeSelector.js +1 -1
- package/datetimepicker/DateTimeSelector.mjs +0 -1
- package/dist/cdn/js/kendo-react-dateinputs.js +8 -1
- package/hooks/usePickerFloatingLabel.js +1 -1
- package/hooks/usePickerFloatingLabel.mjs +5 -6
- package/index.js +2 -1
- package/messages/index.js +1 -1
- package/messages/index.mjs +5 -6
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -3
- package/package.json +8 -8
- package/timepicker/TimeList.js +1 -1
- package/timepicker/TimeList.mjs +16 -17
- package/timepicker/TimePart.js +1 -1
- package/timepicker/TimePart.mjs +0 -1
- package/timepicker/TimePicker.js +1 -1
- package/timepicker/TimePicker.mjs +0 -1
- package/timepicker/TimeSelector.js +1 -1
- package/timepicker/TimeSelector.mjs +0 -1
- package/timepicker/models/TimePart.js +1 -1
- package/timepicker/models/TimePart.mjs +2 -3
- package/timepicker/services/DOMService.js +1 -1
- package/timepicker/services/DOMService.mjs +0 -1
- package/timepicker/services/DayPeriodService.js +1 -1
- package/timepicker/services/DayPeriodService.mjs +3 -4
- package/timepicker/services/HoursService.js +1 -1
- package/timepicker/services/HoursService.mjs +3 -4
- package/timepicker/services/MinutesService.js +1 -1
- package/timepicker/services/MinutesService.mjs +5 -6
- package/timepicker/services/SecondsService.js +1 -1
- package/timepicker/services/SecondsService.mjs +0 -1
- package/timepicker/utils.js +1 -1
- package/timepicker/utils.mjs +0 -1
- package/utils.js +1 -1
- package/utils.mjs +18 -19
- package/virtualization/Virtualization.js +1 -1
- package/virtualization/Virtualization.mjs +0 -1
- package/virtualization/services/ScrollerService.js +1 -1
- package/virtualization/services/ScrollerService.mjs +0 -1
package/dateinput/DateInput.mjs
CHANGED
|
@@ -5,28 +5,27 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import * as a from "react";
|
|
10
9
|
import e from "prop-types";
|
|
11
10
|
import { cloneDate as x, isEqual as Ve } from "@progress/kendo-date-math";
|
|
12
11
|
import { Button as Y } from "@progress/kendo-react-buttons";
|
|
13
|
-
import { caretAltUpIcon as
|
|
14
|
-
import { useInternationalization as
|
|
15
|
-
import { validatePackage as
|
|
12
|
+
import { caretAltUpIcon as Ne, caretAltDownIcon as _e } from "@progress/kendo-svg-icons";
|
|
13
|
+
import { useInternationalization as Fe, useLocalization as He } from "@progress/kendo-react-intl";
|
|
14
|
+
import { validatePackage as Be, useId as qe, useUnstyled as ze, usePropsContext as J, classNames as y, uDateInput as b, createPropsContext as Ue, getActiveElement as X } from "@progress/kendo-react-common";
|
|
16
15
|
import { FloatingLabel as We } from "@progress/kendo-react-labels";
|
|
17
16
|
import { DateInput as je } from "@progress/kendo-dateinputs-common";
|
|
18
17
|
import { DEFAULT_FORMAT as Ke, DEFAULT_FORMAT_PLACEHOLDER as Ye, isInRange as Je } from "./utils.mjs";
|
|
19
18
|
import { packageMetadata as Xe } from "../package-metadata.mjs";
|
|
20
|
-
import { nullable as
|
|
21
|
-
import { increaseValue as C, messages as
|
|
19
|
+
import { nullable as u, MAX_DATE as Ge, MIN_DATE as Ze, MIN_TIME as $e, MAX_TIME as Qe } from "../utils.mjs";
|
|
20
|
+
import { increaseValue as C, messages as w, decreaseValue as M } from "../messages/index.mjs";
|
|
22
21
|
import { isInTimeRange as et } from "../timepicker/utils.mjs";
|
|
23
22
|
import tt from "../common/ClearButton.mjs";
|
|
24
23
|
import { DateInputIntl as nt } from "./dateInputIntl.mjs";
|
|
25
24
|
const at = "Please enter a valid value!", Z = a.forwardRef((t, $) => {
|
|
26
25
|
var j;
|
|
27
|
-
|
|
28
|
-
const Q =
|
|
29
|
-
format:
|
|
26
|
+
Be(Xe);
|
|
27
|
+
const Q = qe(t.id), ee = Fe(), h = He(), te = ze(), p = J(G, t).unstyled || te, {
|
|
28
|
+
format: T = r.format,
|
|
30
29
|
size: ne = r.size,
|
|
31
30
|
rounded: ae = r.rounded,
|
|
32
31
|
fillMode: re = r.fillMode,
|
|
@@ -50,7 +49,7 @@ const at = "Please enter a valid value!", Z = a.forwardRef((t, $) => {
|
|
|
50
49
|
} = J(G, t), d = () => D.current !== void 0 ? D.current : l.current && l.current.value, A = () => {
|
|
51
50
|
const n = l.current && l.current.currentText || "", i = d();
|
|
52
51
|
return f != null && !Pe.focused && !i ? f : n;
|
|
53
|
-
}, V = () => t.required !== void 0 ? t.required : !1,
|
|
52
|
+
}, V = () => t.required !== void 0 ? t.required : !1, R = () => {
|
|
54
53
|
const n = d() || t.value, i = oe, K = ue, ke = Je(n, i, K) && et(n, se, ce), pe = L !== void 0, Le = (!V() || n != null) && ke, Ae = t.valid !== void 0 ? t.valid : Le;
|
|
55
54
|
return {
|
|
56
55
|
customError: pe,
|
|
@@ -61,16 +60,16 @@ const at = "Please enter a valid value!", Z = a.forwardRef((t, $) => {
|
|
|
61
60
|
};
|
|
62
61
|
}, Ee = () => {
|
|
63
62
|
o.current && o.current.focus();
|
|
64
|
-
},
|
|
63
|
+
}, N = () => new nt(ee), I = () => {
|
|
65
64
|
const n = d();
|
|
66
65
|
return {
|
|
67
|
-
format:
|
|
66
|
+
format: T,
|
|
68
67
|
steps: t.steps,
|
|
69
68
|
formatPlaceholder: ie,
|
|
70
69
|
placeholder: f,
|
|
71
70
|
selectPreviousSegmentOnBackspace: !0,
|
|
72
71
|
value: t.value || n,
|
|
73
|
-
intlService:
|
|
72
|
+
intlService: N(),
|
|
74
73
|
autoFill: t.autoFill !== void 0 ? t.autoFill : !1,
|
|
75
74
|
enableMouseWheel: me,
|
|
76
75
|
autoCorrectParts: fe,
|
|
@@ -80,17 +79,17 @@ const at = "Please enter a valid value!", Z = a.forwardRef((t, $) => {
|
|
|
80
79
|
allowCaretMode: ve
|
|
81
80
|
};
|
|
82
81
|
}, Ie = (n) => {
|
|
83
|
-
|
|
82
|
+
s.current && s.current.classList.add("k-focus"), q({ focused: !0 });
|
|
84
83
|
}, Oe = (n) => {
|
|
85
|
-
|
|
84
|
+
s.current && s.current.classList.remove("k-focus"), q({ focused: !1 });
|
|
86
85
|
}, De = (n, i) => typeof n != typeof i ? !0 : typeof n == "string" && typeof i == "string" ? n !== i : typeof n == "object" && typeof i == "object" ? JSON.stringify(n) !== JSON.stringify(i) : !1, xe = (n) => typeof n == "string" ? n : {
|
|
87
86
|
inputFormat: n,
|
|
88
87
|
displayFormat: n
|
|
89
|
-
}, N = (n) => {
|
|
90
|
-
D.current = d(), Se(), m.current = n, D.current = void 0;
|
|
91
88
|
}, _ = (n) => {
|
|
92
|
-
|
|
89
|
+
D.current = d(), Se(), m.current = n, D.current = void 0;
|
|
93
90
|
}, F = (n) => {
|
|
91
|
+
t.onChange && t.onChange(n);
|
|
92
|
+
}, H = (n) => {
|
|
94
93
|
X(document) === o.current && n.preventDefault();
|
|
95
94
|
}, Ce = () => new je(o.current, {
|
|
96
95
|
...I(),
|
|
@@ -98,20 +97,20 @@ const at = "Please enter a valid value!", Z = a.forwardRef((t, $) => {
|
|
|
98
97
|
events: {
|
|
99
98
|
focus: Ie,
|
|
100
99
|
blur: Oe,
|
|
101
|
-
valueChange:
|
|
102
|
-
click:
|
|
100
|
+
valueChange: _,
|
|
101
|
+
click: F
|
|
103
102
|
}
|
|
104
|
-
}),
|
|
103
|
+
}), B = () => {
|
|
105
104
|
o.current && o.current.setCustomValidity && o.current.setCustomValidity(
|
|
106
|
-
|
|
105
|
+
R().valid ? "" : L || r.validationMessage
|
|
107
106
|
);
|
|
108
|
-
}, Re = (n) => {
|
|
109
|
-
!o.current || !l.current || N(n);
|
|
110
107
|
}, we = (n) => {
|
|
108
|
+
!o.current || !l.current || _(n);
|
|
109
|
+
}, Me = (n) => {
|
|
111
110
|
n.preventDefault();
|
|
112
111
|
const i = X(document);
|
|
113
112
|
o.current && i !== o.current && o.current.focus({ preventScroll: !0 });
|
|
114
|
-
},
|
|
113
|
+
}, c = (n) => {
|
|
115
114
|
const i = d();
|
|
116
115
|
m.current && t.onChange && !Ve(m.current.oldValue, i) && t.onChange.call(void 0, {
|
|
117
116
|
syntheticEvent: n,
|
|
@@ -119,13 +118,13 @@ const at = "Please enter a valid value!", Z = a.forwardRef((t, $) => {
|
|
|
119
118
|
value: m.current.value,
|
|
120
119
|
target: O.current
|
|
121
120
|
}), m.current = null;
|
|
122
|
-
}, Me = (n) => {
|
|
123
|
-
var i;
|
|
124
|
-
(i = l.current) == null || i.modifyDateSegmentValue(1), s(n);
|
|
125
121
|
}, Te = (n) => {
|
|
126
122
|
var i;
|
|
127
|
-
(i = l.current) == null || i.modifyDateSegmentValue(
|
|
128
|
-
},
|
|
123
|
+
(i = l.current) == null || i.modifyDateSegmentValue(1), c(n);
|
|
124
|
+
}, Re = (n) => {
|
|
125
|
+
var i;
|
|
126
|
+
(i = l.current) == null || i.modifyDateSegmentValue(-1), c(n);
|
|
127
|
+
}, O = a.useRef(null), o = a.useRef(null), s = a.useRef(null);
|
|
129
128
|
a.useImperativeHandle(
|
|
130
129
|
O,
|
|
131
130
|
() => ({
|
|
@@ -146,33 +145,33 @@ const at = "Please enter a valid value!", Z = a.forwardRef((t, $) => {
|
|
|
146
145
|
return d();
|
|
147
146
|
},
|
|
148
147
|
get validity() {
|
|
149
|
-
return
|
|
148
|
+
return R();
|
|
150
149
|
},
|
|
151
150
|
// hidden methods
|
|
152
151
|
focus: Ee,
|
|
153
|
-
updateOnPaste:
|
|
152
|
+
updateOnPaste: we
|
|
154
153
|
})
|
|
155
154
|
), a.useImperativeHandle($, () => O.current);
|
|
156
|
-
const l = a.useRef(null), P = a.useRef(null), S = a.useRef(!1), D = a.useRef(null), m = a.useRef(null), g = a.useRef(t), [Pe,
|
|
155
|
+
const l = a.useRef(null), P = a.useRef(null), S = a.useRef(!1), D = a.useRef(null), m = a.useRef(null), g = a.useRef(t), [Pe, q] = a.useState({ focused: !1 }), [, Se] = a.useReducer((n) => n + 1, 0);
|
|
157
156
|
a.useLayoutEffect(() => {
|
|
158
157
|
S.current || (l.current = Ce(), P.current = l.current.dateObject, S.current = !0);
|
|
159
|
-
}, []), a.useEffect(() => (
|
|
160
|
-
|
|
158
|
+
}, []), a.useEffect(() => (B(), S.current || s.current && s.current.addEventListener("wheel", H, { passive: !1 }), () => {
|
|
159
|
+
s.current && s.current.removeEventListener("wheel", H);
|
|
161
160
|
}), []), a.useEffect(() => {
|
|
162
|
-
|
|
163
|
-
format:
|
|
161
|
+
B(), l.current && ((De(g.current.format, T) || g.current.readonly !== t.readonly || g.current.steps !== t.steps || N().locale !== l.current.options.intlService.locale) && l.current.setOptions(I(), !0), g.current.value !== t.value && (P.current.getValue() !== null || t.value !== null) && P.current.setValue(t.value), t.ariaExpanded !== void 0 && t.ariaExpanded && (l.current.options.placeholder = null), t.ariaExpanded !== void 0 && !t.ariaExpanded && (l.current.options.placeholder = f), l.current.refreshElementValue(), g.current = {
|
|
162
|
+
format: T,
|
|
164
163
|
readonly: t.readonly,
|
|
165
164
|
ariaExpanded: t.ariaExpanded,
|
|
166
165
|
steps: t.steps,
|
|
167
166
|
value: t.value
|
|
168
167
|
});
|
|
169
168
|
});
|
|
170
|
-
const z = t.id || Q + "-accessibility-id", v = p && p.uDateInput, U = A(), k = !de ||
|
|
169
|
+
const z = t.id || Q + "-accessibility-id", v = p && p.uDateInput, U = A(), k = !de || R().valid;
|
|
171
170
|
a.useImperativeHandle(t._ref, () => O.current);
|
|
172
171
|
const W = /* @__PURE__ */ a.createElement(
|
|
173
172
|
"span",
|
|
174
173
|
{
|
|
175
|
-
ref: (n) =>
|
|
174
|
+
ref: (n) => s.current = n,
|
|
176
175
|
style: t.label ? void 0 : { width: t.width },
|
|
177
176
|
dir: t.dir,
|
|
178
177
|
className: y(
|
|
@@ -214,18 +213,18 @@ const at = "Please enter a valid value!", Z = a.forwardRef((t, $) => {
|
|
|
214
213
|
"aria-controls": t.ariaControls,
|
|
215
214
|
"aria-required": t.required,
|
|
216
215
|
"aria-invalid": !k,
|
|
217
|
-
onKeyDown:
|
|
218
|
-
onChange:
|
|
219
|
-
onWheel:
|
|
220
|
-
onInput:
|
|
221
|
-
onClick:
|
|
216
|
+
onKeyDown: c,
|
|
217
|
+
onChange: c,
|
|
218
|
+
onWheel: c,
|
|
219
|
+
onInput: c,
|
|
220
|
+
onClick: c,
|
|
222
221
|
name: t.name,
|
|
223
222
|
...t.inputAttributes
|
|
224
223
|
}
|
|
225
224
|
),
|
|
226
225
|
t.children,
|
|
227
|
-
t.clearButton && t.value && /* @__PURE__ */ a.createElement(tt, { onClick:
|
|
228
|
-
le && /* @__PURE__ */ a.createElement("span", { className: y(b.inputSpinner({ c: v })), onMouseDown:
|
|
226
|
+
t.clearButton && t.value && /* @__PURE__ */ a.createElement(tt, { onClick: F, key: "clearbutton" }),
|
|
227
|
+
le && /* @__PURE__ */ a.createElement("span", { className: y(b.inputSpinner({ c: v })), onMouseDown: Me }, /* @__PURE__ */ a.createElement(
|
|
229
228
|
Y,
|
|
230
229
|
{
|
|
231
230
|
tabIndex: -1,
|
|
@@ -233,10 +232,10 @@ const at = "Please enter a valid value!", Z = a.forwardRef((t, $) => {
|
|
|
233
232
|
rounded: null,
|
|
234
233
|
className: y(b.spinnerIncrease({ c: v })),
|
|
235
234
|
icon: "caret-alt-up",
|
|
236
|
-
svgIcon:
|
|
237
|
-
"aria-label": h.toLanguageString(C,
|
|
238
|
-
title: h.toLanguageString(C,
|
|
239
|
-
onClick:
|
|
235
|
+
svgIcon: Ne,
|
|
236
|
+
"aria-label": h.toLanguageString(C, w[C]),
|
|
237
|
+
title: h.toLanguageString(C, w[C]),
|
|
238
|
+
onClick: Te
|
|
240
239
|
}
|
|
241
240
|
), /* @__PURE__ */ a.createElement(
|
|
242
241
|
Y,
|
|
@@ -246,10 +245,10 @@ const at = "Please enter a valid value!", Z = a.forwardRef((t, $) => {
|
|
|
246
245
|
rounded: null,
|
|
247
246
|
className: y(b.spinnerDecrease({ c: v })),
|
|
248
247
|
icon: "caret-alt-down",
|
|
249
|
-
svgIcon:
|
|
250
|
-
"aria-label": h.toLanguageString(
|
|
251
|
-
title: h.toLanguageString(
|
|
252
|
-
onClick:
|
|
248
|
+
svgIcon: _e,
|
|
249
|
+
"aria-label": h.toLanguageString(M, w[M]),
|
|
250
|
+
title: h.toLanguageString(M, w[M]),
|
|
251
|
+
onClick: Re
|
|
253
252
|
}
|
|
254
253
|
))
|
|
255
254
|
);
|
|
@@ -269,7 +268,7 @@ const at = "Please enter a valid value!", Z = a.forwardRef((t, $) => {
|
|
|
269
268
|
Z.propTypes = {
|
|
270
269
|
value: e.instanceOf(Date),
|
|
271
270
|
format: e.oneOfType([
|
|
272
|
-
|
|
271
|
+
u(e.string),
|
|
273
272
|
e.shape({
|
|
274
273
|
skeleton: e.string,
|
|
275
274
|
pattern: e.string,
|
|
@@ -289,26 +288,28 @@ Z.propTypes = {
|
|
|
289
288
|
})
|
|
290
289
|
]),
|
|
291
290
|
formatPlaceholder: e.oneOfType([
|
|
292
|
-
|
|
291
|
+
u(
|
|
292
|
+
e.oneOf(["wide", "narrow", "short", "formatPattern"])
|
|
293
|
+
),
|
|
293
294
|
e.shape({
|
|
294
|
-
year: e.string
|
|
295
|
-
month: e.string
|
|
296
|
-
day: e.string
|
|
297
|
-
hour: e.string
|
|
298
|
-
minute: e.string
|
|
299
|
-
second: e.string
|
|
295
|
+
year: u(e.string),
|
|
296
|
+
month: u(e.string),
|
|
297
|
+
day: u(e.string),
|
|
298
|
+
hour: u(e.string),
|
|
299
|
+
minute: u(e.string),
|
|
300
|
+
second: u(e.string)
|
|
300
301
|
})
|
|
301
302
|
]),
|
|
302
303
|
width: e.oneOfType([e.string, e.number]),
|
|
303
304
|
tabIndex: e.number,
|
|
304
305
|
title: e.string,
|
|
305
306
|
steps: e.shape({
|
|
306
|
-
year:
|
|
307
|
-
month:
|
|
308
|
-
day:
|
|
309
|
-
hour:
|
|
310
|
-
minute:
|
|
311
|
-
second:
|
|
307
|
+
year: u(e.number),
|
|
308
|
+
month: u(e.number),
|
|
309
|
+
day: u(e.number),
|
|
310
|
+
hour: u(e.number),
|
|
311
|
+
minute: u(e.number),
|
|
312
|
+
second: u(e.number)
|
|
312
313
|
}),
|
|
313
314
|
min: e.instanceOf(Date),
|
|
314
315
|
max: e.instanceOf(Date),
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@progress/kendo-intl");class s{constructor(t){this.service=t,this.cldr={},this.locale=t.locale,this.format=t.format,this.toString=t.toString,this.formatDate=t.formatDate,this.parseDate=t.parseDate,this.parseNumber=t.parseNumber,this.formatNumber=t.formatNumber,this.splitDateFormat=t.splitDateFormat,this.numberSymbols=t.numberSymbols,this.firstDay=t.firstDay,this.dateFieldName=t.dateFieldName,this.dateFormatNames=(e,o)=>this.service.dateFormatNames(o),this.weekendRange=e=>{};const a=l.localeInfo(this.locale);this.cldr[a.name]=a}}exports.DateInputIntl=s;
|
|
@@ -5,13 +5,12 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
import { localeInfo as l } from "@progress/kendo-intl";
|
|
8
|
+
import { localeInfo as s } from "@progress/kendo-intl";
|
|
10
9
|
class r {
|
|
11
10
|
constructor(t) {
|
|
12
|
-
this.service = t, this.cldr = {}, this.locale = t.locale, this.format = t.format, this.toString = t.toString, this.formatDate = t.formatDate, this.parseDate = t.parseDate, this.parseNumber = t.parseNumber, this.formatNumber = t.formatNumber, this.splitDateFormat = t.splitDateFormat, this.numberSymbols = t.numberSymbols, this.firstDay = t.firstDay, this.dateFieldName = t.dateFieldName, this.dateFormatNames = (o,
|
|
11
|
+
this.service = t, this.cldr = {}, this.locale = t.locale, this.format = t.format, this.toString = t.toString, this.formatDate = t.formatDate, this.parseDate = t.parseDate, this.parseNumber = t.parseNumber, this.formatNumber = t.formatNumber, this.splitDateFormat = t.splitDateFormat, this.numberSymbols = t.numberSymbols, this.firstDay = t.firstDay, this.dateFieldName = t.dateFieldName, this.dateFormatNames = (o, m) => this.service.dateFormatNames(m), this.weekendRange = (o) => {
|
|
13
12
|
};
|
|
14
|
-
const a =
|
|
13
|
+
const a = s(this.locale);
|
|
15
14
|
this.cldr[a.name] = a;
|
|
16
15
|
}
|
|
17
16
|
}
|
package/dateinput/utils.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E="d",F="wide",L=(A,T,e)=>A===null||!(T&&T>A||e&&e<A);exports.DEFAULT_FORMAT=E;exports.DEFAULT_FORMAT_PLACEHOLDER=F;exports.isInRange=L;
|
package/dateinput/utils.mjs
CHANGED
|
@@ -5,10 +5,9 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"
|
|
9
|
-
const o = "d", E = "wide", F = (s, A, n) => s === null || !(A && A > s || n && n < s);
|
|
8
|
+
const E = "d", F = "wide", L = (A, o, s) => A === null || !(o && o > A || s && s < A);
|
|
10
9
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
E as DEFAULT_FORMAT,
|
|
11
|
+
F as DEFAULT_FORMAT_PLACEHOLDER,
|
|
12
|
+
L as isInRange
|
|
14
13
|
};
|
package/datepicker/DatePicker.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ze=require("react"),e=require("prop-types"),Ge=require("@progress/kendo-react-popup"),z=require("@progress/kendo-date-math"),u=require("@progress/kendo-react-common"),Je=require("@progress/kendo-svg-icons"),Qe=require("../package-metadata.js"),et=require("../dateinput/DateInput.js"),tt=require("../calendar/components/Calendar.js"),o=require("../utils.js"),K=require("../messages/index.js"),nt=require("@progress/kendo-react-intl"),at=require("./ToggleButton.js"),ot=require("../common/PickerWrap.js"),rt=require("../hooks/usePickerFloatingLabel.js"),lt=require("@progress/kendo-react-layout"),ut=require("../common/AdaptiveMode.js");function it(n){const h=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const f in n)if(f!=="default"){const R=Object.getOwnPropertyDescriptor(n,f);Object.defineProperty(h,f,R.get?R:{enumerable:!0,get:()=>n[f]})}}return h.default=n,Object.freeze(h)}const a=it(Ze),L=a.forwardRef((n,h)=>{u.validatePackage(Qe.packageMetadata);const f=u.useId(n.id),R=nt.useLocalization(),v=u.useAdaptiveModeContext(),{defaultShow:ie=l.defaultShow,defaultValue:ce=l.defaultValue,dateInput:se=l.dateInput,calendar:de=l.calendar,toggleButton:fe=l.toggleButton,popup:me=l.popup,pickerWrap:ct=l.pickerWrap,disabled:w=l.disabled,format:ge=l.format,max:E=l.max,min:T=l.min,popupSettings:y=l.popupSettings,tabIndex:pe=l.tabIndex,weekNumber:be=l.weekNumber,validityStyles:W=l.validityStyles,size:q=l.size,rounded:x=l.rounded,fillMode:_=l.fillMode,autoFocus:he=l.autoFocus,show:j,autoSwitchParts:ve,autoSwitchKeys:we,twoDigitYearMax:ye,ariaLabel:ke,adaptive:st,adaptiveTitle:De,inputAttributes:Ce,validationMessage:H,_adaptiveMode:dt=v,valid:U,focusedDate:Pe,...Y}=u.usePropsContext(ue,n),B=()=>{if(u.canUseDOM)return D.current&&D.current.ownerDocument||window.document},s=()=>!!(b.windowWidth&&v&&b.windowWidth<=(v==null?void 0:v.medium)&&n.adaptive),m=()=>{const t=P.current!==void 0&&P.current!==null?P.current:n.value!==void 0?n.value:b.value;return t!==null?z.cloneDate(t):null},i=()=>I.current!==void 0?I.current:j!==void 0?j:b.show,Oe=()=>se||l.dateInput,Me=()=>fe||l.toggleButton,Re=()=>de||l.calendar,Ie=()=>me||l.popup,$=()=>n.required!==void 0?n.required:!1,A=()=>{const t=m()||n.value||null,r=T,c=E,S=o.isInDateRange(t,r,c),N=H!==void 0,F=(!$()||t!=null)&&S,V=U!==void 0?U:F;return{customError:N,rangeOverflow:t&&c.getTime()<t.getTime()||!1,rangeUnderflow:t&&t.getTime()<r.getTime()||!1,valid:V,valueMissing:t===null}},Se=t=>{for(const r of t)M({windowWidth:r.target.clientWidth})},Ee=()=>{d.current&&d.current.focus()},X=t=>{C.current=t},g=t=>{i()!==t&&(M({show:t}),t&&n.onOpen&&n.onOpen.call(void 0,{target:k.current}),!t&&n.onClose&&n.onClose.call(void 0,{target:k.current}))},Te=t=>{const r=m();return r&&t?o.setTime(t,r):t},qe=t=>{y!=null&&y.onMouseDownOutside&&y.onMouseDownOutside.call(void 0,t)},Z=(t,r)=>{M({value:z.cloneDate(t||void 0)}),P.current=t,I.current=!1,s()||(p.current=!0),n.onChange&&n.onChange.call(void 0,{syntheticEvent:r.syntheticEvent,nativeEvent:r.nativeEvent,value:m(),show:i(),target:k.current}),P.current=void 0,I.current=void 0,g(!1)},xe=t=>{const r=Te(t.value);Z(r,t)},G=()=>{const{popupClass:t,...r}=y,c=i(),S=m(),N=S&&z.getDate(S),F=u.classNames(t),V={popupClass:"k-datepicker-popup",show:c,anchor:D.current,className:F,id:te,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...r,onMouseDownOutside:qe},re={disabled:w,value:N,min:T,max:E,weekNumber:be,focusedDate:Pe,className:s()?"k-calendar-lg":"",navigation:!s(),onChange:xe},le=Re(),Xe=Ie();return s()?a.createElement(le,{_ref:X,...re}):a.createElement(Xe,{...V},a.createElement(le,{_ref:X,...re}))},J=()=>{M({focused:!1}),g(!1)},_e=()=>{const{windowWidth:t=0}=b,r={expand:i(),onClose:J,adaptiveTitle:De,windowWidth:t},c=G();return a.createElement(ut.AdaptiveMode,{...r},a.createElement(lt.ActionSheetContent,{overflowHidden:!0},c))},Be=t=>{Z(t.value,t)},Ae=()=>{M({focused:!0})},Ne=()=>{g(!i())},Q=()=>{w||(p.current=!0,g(!i()))},Fe=t=>{t.preventDefault()},Ve=t=>{const{altKey:r,keyCode:c}=t;if(c===u.Keys.esc&&i()){p.current=!0,g(!1);return}r&&(c===u.Keys.up||c===u.Keys.down)&&(t.preventDefault(),t.stopPropagation(),p.current=c===u.Keys.up,g(c===u.Keys.down))},k=a.useRef(null),D=a.useRef(null),d=a.useRef(null),C=a.useRef(null);a.useImperativeHandle(k,()=>({props:n,get element(){return D.current},get calendar(){return C.current},get dateInput(){return d.current},get name(){return n.name},get show(){return i()},get validity(){return A()},get value(){return m()},get mobileMode(){return s()},togglePopup:Ne,focus:Ee})),a.useImperativeHandle(h,()=>k.current);const P=a.useRef(null),I=a.useRef(void 0),ze=a.useRef(null),p=a.useRef(!1),ee=a.useRef(!1),O=a.useRef(null),[b,Ke]=a.useState({value:ce,show:ie,focused:!1}),[,Le]=a.useReducer(t=>t,!0),M=t=>{Ke(r=>({...r,...t}))};a.useEffect(()=>{C.current&&C.current.element&&i()&&!ee.current&&C.current.element.focus({preventScroll:!0}),d.current&&d.current.element&&!i()&&p.current&&d.current.element.focus({preventScroll:!0}),ee.current=i(),p.current=!1}),a.useEffect(()=>{var t;return O.current=u.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(r=>Se(r)),i()&&Le(),(t=B())!=null&&t.body&&O.current&&O.current.observe(B().body),()=>{var r;clearTimeout(ze.current),(r=B())!=null&&r.body&&O.current&&O.current.disconnect()}},[]);const te=f+"-popup-id",We=G(),je=Oe(),He=m(),Ue=Me(),Ye=_e(),ne=!W||A().valid,ae=R.toLanguageString(K.toggleCalendar,K.messages[K.toggleCalendar]),$e={disabled:w,format:ge,formatPlaceholder:n.formatPlaceholder,id:n.id,ariaLabelledBy:n.ariaLabelledBy,ariaDescribedBy:n.ariaDescribedBy,ariaLabel:ke,max:E,min:T,name:n.name,onChange:Be,required:n.required,_ref:d,tabIndex:i()?-1:pe,title:n.title,valid:A().valid,validationMessage:H,validityStyles:W,value:He,label:void 0,placeholder:b.focused?null:n.placeholder,ariaExpanded:i(),size:null,fillMode:null,rounded:null,autoFill:n.autoFill,twoDigitYearMax:ye,enableMouseWheel:n.enableMouseWheel,autoCorrectParts:n.autoCorrectParts,autoSwitchParts:ve,autoSwitchKeys:we,allowCaretMode:n.allowCaretMode,inputAttributes:Ce},oe=a.createElement(u.AsyncFocusBlur,{onFocus:Ae,onBlur:s()?void 0:J,onSyncBlur:n.onBlur,onSyncFocus:n.onFocus},t=>a.createElement(a.Fragment,null,a.createElement("span",{...n.label?{}:Y,ref:D,className:u.classNames("k-input","k-datepicker",{[`k-input-${u.kendoThemeMaps.sizeMap[q]||q}`]:q,[`k-rounded-${u.kendoThemeMaps.roundedMap[x]||x}`]:x,[`k-input-${_}`]:_,"k-invalid":!ne,"k-required":$(),"k-disabled":w},n.className),onKeyDown:Ve,style:{width:n.width},onFocus:t.onFocus,onBlur:t.onBlur,onClick:s()?Q:void 0},a.createElement(je,{_ref:d,ariaRole:"combobox",ariaExpanded:i(),ariaControls:te,autoFocus:he,...$e}),a.createElement(Ue,{type:"button",icon:"calendar",svgIcon:Je.calendarIcon,title:ae,className:"k-input-button",rounded:null,onClick:s()?void 0:Q,"aria-label":ae,fillMode:_,onMouseDown:Fe}),!s()&&We),s()&&Ye));return n.label?a.createElement(rt.PickerFloatingLabel,{dateInput:d,label:n.label,editorId:f,editorValid:ne,editorDisabled:w,children:oe,style:{width:n.width},...Y}):oe});L.propTypes={className:e.string,defaultShow:e.bool,defaultValue:e.instanceOf(Date),disabled:e.bool,focusedDate:e.instanceOf(Date),format:e.oneOfType([e.string,e.shape({skeleton:o.nullable(e.string),pattern:o.nullable(e.string),date:o.nullable(e.oneOf(["short","medium","long","full"])),time:o.nullable(e.oneOf(["short","medium","long","full"])),datetime:o.nullable(e.oneOf(["short","medium","long","full"])),era:o.nullable(e.oneOf(["narrow","short","long"])),year:o.nullable(e.oneOf(["numeric","2-digit"])),month:o.nullable(e.oneOf(["numeric","2-digit","narrow","short","long"])),day:o.nullable(e.oneOf(["numeric","2-digit"])),weekday:o.nullable(e.oneOf(["narrow","short","long"])),hour:o.nullable(e.oneOf(["numeric","2-digit"])),hour12:o.nullable(e.bool),minute:o.nullable(e.oneOf(["numeric","2-digit"])),second:o.nullable(e.oneOf(["numeric","2-digit"])),timeZoneName:o.nullable(e.oneOf(["short","long"]))})]),formatPlaceholder:e.oneOfType([o.nullable(e.oneOf(["wide","narrow","short","formatPattern"])),e.shape({year:o.nullable(e.string),month:o.nullable(e.string),day:o.nullable(e.string),hour:o.nullable(e.string),minute:o.nullable(e.string),second:o.nullable(e.string)})]),id:e.string,ariaLabelledBy:e.string,ariaDescribedBy:e.string,ariaLabel:e.string,min:e.instanceOf(Date),max:e.instanceOf(Date),name:e.string,popupSettings:e.shape({animate:o.nullable(e.bool),appendTo:o.nullable(e.any),popupClass:o.nullable(e.string)}),show:e.bool,tabIndex:e.number,title:e.string,value:e.instanceOf(Date),weekNumber:e.bool,width:e.oneOfType([e.number,e.string]),validationMessage:e.string,required:e.bool,valid:e.bool,size:e.oneOf([null,"small","medium","large"]),rounded:e.oneOf([null,"small","medium","large","full"]),fillMode:e.oneOf([null,"solid","flat","outline"]),adaptive:e.bool,adaptiveTitle:e.string,autoFocus:e.bool,inputAttributes:e.object};const l={defaultShow:!1,defaultValue:null,dateInput:et.DateInput,calendar:tt.Calendar,toggleButton:at.ToggleButton,popup:Ge.Popup,pickerWrap:ot.PickerWrap,disabled:!1,format:"d",max:o.MAX_DATE,min:o.MIN_DATE,popupSettings:{},tabIndex:0,weekNumber:!1,validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1},ue=u.createPropsContext();L.displayName="KendoReactDatePicker";exports.DatePicker=L;exports.DatePickerPropsContext=ue;exports.datePickerDefaultProps=l;
|