@progress/kendo-react-dateinputs 15.2.0-develop.1 → 15.2.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/calendar/components/Calendar.js +1 -1
- package/calendar/components/Calendar.mjs +1 -1
- package/calendar/components/CalendarHeaderTitle.js +1 -1
- package/calendar/components/CalendarHeaderTitle.mjs +17 -5
- package/calendar/components/HorizontalViewList.js +1 -1
- package/calendar/components/HorizontalViewList.mjs +29 -29
- package/calendar/components/MultiViewCalendar.js +1 -1
- package/calendar/components/MultiViewCalendar.mjs +131 -128
- package/calendar/components/TodayCommand.js +1 -1
- package/calendar/components/TodayCommand.mjs +21 -32
- package/calendar/components/View.js +1 -1
- package/calendar/components/View.mjs +66 -66
- package/calendar/components/ViewList.js +1 -1
- package/calendar/components/ViewList.mjs +135 -125
- package/calendar/models/WeekDaysFormat.d.ts +1 -1
- package/common/AdaptiveMode.js +1 -1
- package/common/AdaptiveMode.mjs +30 -31
- package/dateinput/DateInput.js +1 -1
- package/dateinput/DateInput.mjs +35 -36
- package/datepicker/DatePicker.js +1 -1
- package/datepicker/DatePicker.mjs +21 -20
- package/datetimepicker/DateTimePicker.js +1 -1
- package/datetimepicker/DateTimePicker.mjs +15 -14
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/messages/index.d.ts +5 -0
- package/messages/index.js +1 -1
- package/messages/index.mjs +46 -44
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +9 -9
- package/timepicker/TimeList.js +2 -2
- package/timepicker/TimeList.mjs +51 -47
- package/timepicker/TimePart.js +1 -1
- package/timepicker/TimePart.mjs +57 -68
- package/timepicker/TimePicker.d.ts +7 -0
- package/timepicker/TimePicker.js +1 -1
- package/timepicker/TimePicker.mjs +20 -17
- package/timepicker/TimeSelector.js +1 -1
- package/timepicker/TimeSelector.mjs +56 -57
|
@@ -8,22 +8,22 @@
|
|
|
8
8
|
import * as a from "react";
|
|
9
9
|
import n from "prop-types";
|
|
10
10
|
import { validatePackage as Ft, getLicenseMessage as Tt, usePropsContext as Nt, useId as Pt, classNames as Bt, WatermarkOverlay as Lt, createPropsContext as Kt, Keys as oe } from "@progress/kendo-react-common";
|
|
11
|
-
import { getDate as O, cloneDate as m, firstDayOfMonth as Wt, lastDayOfMonth as Yt, isEqualDate as
|
|
11
|
+
import { getDate as O, cloneDate as m, firstDayOfMonth as Wt, lastDayOfMonth as Yt, isEqualDate as Ke, addDays as se } from "@progress/kendo-date-math";
|
|
12
12
|
import { useInternationalization as _t, useLocalization as Ht } from "@progress/kendo-react-intl";
|
|
13
|
-
import { Button as
|
|
14
|
-
import { chevronRightIcon as
|
|
13
|
+
import { Button as We } from "@progress/kendo-react-buttons";
|
|
14
|
+
import { chevronRightIcon as Ye, chevronLeftIcon as _e } from "@progress/kendo-svg-icons";
|
|
15
15
|
import { Action as U } from "../models/NavigationAction.mjs";
|
|
16
16
|
import { CalendarViewEnum as X } from "../models/CalendarViewEnum.mjs";
|
|
17
17
|
import { EMPTY_SELECTIONRANGE as $t } from "../models/SelectionRange.mjs";
|
|
18
18
|
import { Header as zt } from "./Header.mjs";
|
|
19
19
|
import { MIN_DATE as jt, MAX_DATE as Gt, viewInRange as ie, dateInRange as q, getToday as J, isInRange as ue, nullable as I } from "../../utils.mjs";
|
|
20
|
-
import { prevView as
|
|
20
|
+
import { prevView as He, messages as $e, nextView as ze } from "../../messages/index.mjs";
|
|
21
21
|
import { BusViewService as Ut } from "../services/BusViewService.mjs";
|
|
22
22
|
import { NavigationService as Xt } from "../services/NavigationService.mjs";
|
|
23
23
|
import { HorizontalViewList as qt } from "./HorizontalViewList.mjs";
|
|
24
24
|
import { TodayCommand as Jt } from "./TodayCommand.mjs";
|
|
25
|
-
import { packageMetadata as
|
|
26
|
-
const S = (c, d = u.min, p = u.max) => c instanceof Date && !Array.isArray(c) && ue(O(c), d, p) ? O(c) : null, le = (c, d = u.min, p = u.max) => Array.isArray(c) ? c.filter((k) => ue(k, d, p)).map((k) => O(k)) : null, Q = (c) => typeof c == "object" && !(c instanceof Date) && c !== null && !Array.isArray(c) ? c : $t,
|
|
25
|
+
import { packageMetadata as je } from "../../package-metadata.mjs";
|
|
26
|
+
const S = (c, d = u.min, p = u.max) => c instanceof Date && !Array.isArray(c) && ue(O(c), d, p) ? O(c) : null, le = (c, d = u.min, p = u.max) => Array.isArray(c) ? c.filter((k) => ue(k, d, p)).map((k) => O(k)) : null, Q = (c) => typeof c == "object" && !(c instanceof Date) && c !== null && !Array.isArray(c) ? c : $t, Ge = (c, d, p) => c || d && d[0] || p && p.start, Qt = (c, d) => c.start === null && d === null ? "start" : c.end === null ? "end" : "start", u = {
|
|
27
27
|
disabled: !1,
|
|
28
28
|
min: jt,
|
|
29
29
|
max: Gt,
|
|
@@ -38,86 +38,86 @@ const S = (c, d = u.min, p = u.max) => c instanceof Date && !Array.isArray(c) &&
|
|
|
38
38
|
showOtherMonthDays: !1
|
|
39
39
|
}, Zt = Kt(), Z = a.forwardRef(
|
|
40
40
|
(c, d) => {
|
|
41
|
-
var
|
|
41
|
+
var Le;
|
|
42
42
|
const p = a.useMemo(
|
|
43
|
-
() => !Ft(
|
|
43
|
+
() => !Ft(je, { component: "MultiViewCalendar" }),
|
|
44
44
|
[]
|
|
45
|
-
), k = a.useMemo(() => Tt(
|
|
45
|
+
), k = a.useMemo(() => Tt(je), []), P = Nt(Zt, c), de = Pt(P.id), {
|
|
46
46
|
disabled: B = u.disabled,
|
|
47
|
-
min:
|
|
48
|
-
max:
|
|
47
|
+
min: Ue = u.min,
|
|
48
|
+
max: Xe = u.max,
|
|
49
49
|
defaultActiveView: fe = u.defaultActiveView,
|
|
50
|
-
defaultValue:
|
|
51
|
-
topView:
|
|
52
|
-
bottomView:
|
|
53
|
-
weekDaysFormat:
|
|
54
|
-
tabIndex:
|
|
50
|
+
defaultValue: qe = u.defaultValue,
|
|
51
|
+
topView: Je = u.topView,
|
|
52
|
+
bottomView: Qe = u.bottomView,
|
|
53
|
+
weekDaysFormat: Ze = u.weekDaysFormat,
|
|
54
|
+
tabIndex: et = u.tabIndex,
|
|
55
55
|
views: M = u.views,
|
|
56
56
|
allowReverse: me = u.allowReverse,
|
|
57
|
-
showOtherMonthDays:
|
|
57
|
+
showOtherMonthDays: tt = u.showOtherMonthDays,
|
|
58
58
|
_ref: ve,
|
|
59
|
-
className:
|
|
60
|
-
weekNumber:
|
|
59
|
+
className: nt,
|
|
60
|
+
weekNumber: we,
|
|
61
61
|
mobileMode: ge,
|
|
62
|
-
focusedDate:
|
|
62
|
+
focusedDate: at,
|
|
63
63
|
value: L,
|
|
64
64
|
onChange: K,
|
|
65
|
-
onFocus:
|
|
66
|
-
onBlur:
|
|
67
|
-
cell:
|
|
68
|
-
weekCell:
|
|
69
|
-
headerTitle:
|
|
65
|
+
onFocus: De,
|
|
66
|
+
onBlur: pe,
|
|
67
|
+
cell: rt,
|
|
68
|
+
weekCell: ct,
|
|
69
|
+
headerTitle: he,
|
|
70
70
|
mode: F,
|
|
71
71
|
activeRangeEnd: W,
|
|
72
|
-
ariaLabelledBy:
|
|
73
|
-
ariaDescribedBy:
|
|
74
|
-
dir:
|
|
75
|
-
} = P, i = O(
|
|
72
|
+
ariaLabelledBy: ot,
|
|
73
|
+
ariaDescribedBy: st,
|
|
74
|
+
dir: Ve
|
|
75
|
+
} = P, i = O(Ue), l = O(Xe), Y = X[Qe], _ = X[Je], H = Ve === "rtl", it = de + "-cell-uid", lt = de + "-wrapper-id", ut = (e) => ({ start: e, end: null }), dt = (e, t) => ({
|
|
76
76
|
start: e.start,
|
|
77
77
|
end: e.end === null && e.start !== null && $.current ? t : e.end
|
|
78
|
-
}),
|
|
79
|
-
const { end: r, start: o } = t,
|
|
80
|
-
return !me && s ? { start: e, end: y.start } :
|
|
81
|
-
},
|
|
82
|
-
if (!
|
|
78
|
+
}), ft = (e, t) => {
|
|
79
|
+
const { end: r, start: o } = t, w = W !== void 0 ? W : z.current, s = t.start !== null && e.getTime() <= t.start.getTime(), y = Q(f), D = S(f, i, l);
|
|
80
|
+
return !me && s ? { start: e, end: y.start } : w !== "end" ? { start: e, end: r } : { start: o || D, end: e };
|
|
81
|
+
}, ye = (e) => {
|
|
82
|
+
if (!R.current)
|
|
83
83
|
return !1;
|
|
84
|
-
const t = m(C), r =
|
|
85
|
-
return i <= r && r <= l ||
|
|
86
|
-
},
|
|
87
|
-
|
|
84
|
+
const t = m(C), r = R.current.move(t, e);
|
|
85
|
+
return i <= r && r <= l || R.current.isInSameView(r, i) || R.current.isInSameView(r, l);
|
|
86
|
+
}, be = (e, t) => !!t && Wt(t) <= e && e <= Yt(t), ee = (e, t) => {
|
|
87
|
+
b.current = !1;
|
|
88
88
|
const r = te(e, t);
|
|
89
89
|
V({ navigateDate: r, focusedDate: r });
|
|
90
|
-
}, te = (e, t) =>
|
|
91
|
-
F === "range" && (
|
|
90
|
+
}, te = (e, t) => mt(R.current.move(t, e)), mt = (e) => q(e, i, l), vt = (e) => {
|
|
91
|
+
F === "range" && (b.current = !1, V({
|
|
92
92
|
focusedDate: e
|
|
93
93
|
}));
|
|
94
|
-
},
|
|
94
|
+
}, wt = (e) => {
|
|
95
95
|
e.preventDefault();
|
|
96
|
-
}, vt = (e) => {
|
|
97
|
-
A.current && A.current.focus({ preventScroll: !0 });
|
|
98
96
|
}, gt = (e) => {
|
|
99
|
-
|
|
100
|
-
}, wt = (e) => {
|
|
101
|
-
$.current = !1, E.current && (E.current.blurActiveDate(), De && De(e));
|
|
97
|
+
A.current && A.current.focus({ preventScroll: !0 });
|
|
102
98
|
}, Dt = (e) => {
|
|
103
|
-
|
|
99
|
+
$.current = !0, E.current && (E.current.focusActiveDate(), De && De(e));
|
|
100
|
+
}, pt = (e) => {
|
|
101
|
+
$.current = !1, E.current && (E.current.blurActiveDate(), pe && pe(e));
|
|
102
|
+
}, ht = (e) => {
|
|
103
|
+
Se && ne(e);
|
|
104
104
|
}, Re = () => {
|
|
105
105
|
const e = U.PrevView, t = m(C);
|
|
106
|
-
if (
|
|
106
|
+
if (g.activeView > 0 && t.getFullYear() > h.current[0].getFullYear())
|
|
107
107
|
ee(e, te(e, t));
|
|
108
108
|
else {
|
|
109
|
-
const r =
|
|
109
|
+
const r = be(t, h.current[1]) ? te(e, t) : t;
|
|
110
110
|
ee(e, r);
|
|
111
111
|
}
|
|
112
|
-
},
|
|
112
|
+
}, Ce = () => {
|
|
113
113
|
ee(U.NextView, m(C));
|
|
114
|
-
},
|
|
115
|
-
const { keyCode: r, ctrlKey: o, metaKey:
|
|
114
|
+
}, Vt = (e) => {
|
|
115
|
+
const { keyCode: r, ctrlKey: o, metaKey: w } = e;
|
|
116
116
|
if (r === 84) {
|
|
117
117
|
const s = J();
|
|
118
|
-
|
|
118
|
+
b.current = !1, V({ focusedDate: s, navigateDate: s });
|
|
119
119
|
}
|
|
120
|
-
if ((o ||
|
|
120
|
+
if ((o || w) && (r === oe.left && Re(), r === oe.right && Ce()), r === oe.enter) {
|
|
121
121
|
const s = {
|
|
122
122
|
syntheticEvent: e,
|
|
123
123
|
nativeEvent: e.nativeEvent,
|
|
@@ -127,31 +127,31 @@ const S = (c, d = u.min, p = u.max) => c instanceof Date && !Array.isArray(c) &&
|
|
|
127
127
|
ne(s);
|
|
128
128
|
} else {
|
|
129
129
|
const s = q(
|
|
130
|
-
|
|
130
|
+
ke.current.move(
|
|
131
131
|
C,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
132
|
+
ke.current.action(e),
|
|
133
|
+
g.activeView,
|
|
134
|
+
R.current,
|
|
135
135
|
e
|
|
136
136
|
),
|
|
137
137
|
i,
|
|
138
138
|
l
|
|
139
139
|
);
|
|
140
|
-
if (
|
|
140
|
+
if (Ke(C, s))
|
|
141
141
|
return;
|
|
142
|
-
h.current &&
|
|
142
|
+
h.current && R.current && !R.current.isInArray(s, h.current) && V({ navigateDate: s }), b.current = !1, V({ focusedDate: s });
|
|
143
143
|
}
|
|
144
144
|
e.preventDefault();
|
|
145
|
-
},
|
|
146
|
-
|
|
147
|
-
},
|
|
145
|
+
}, yt = ({ view: e }) => {
|
|
146
|
+
b.current = !1, Ee((t) => ({ ...t, activeView: e, navigateDate: t.focusedDate }));
|
|
147
|
+
}, bt = (e, t, r) => {
|
|
148
148
|
if (F === "single")
|
|
149
149
|
return;
|
|
150
|
-
const o = 0,
|
|
150
|
+
const o = 0, w = 6, s = t === o ? e : se(e, -t), y = t === w ? e : se(e, w - t);
|
|
151
151
|
let D = null;
|
|
152
152
|
if (F === "multiple") {
|
|
153
153
|
D = [];
|
|
154
|
-
for (let v = o; v <=
|
|
154
|
+
for (let v = o; v <= w; v++)
|
|
155
155
|
D.push(se(s, v));
|
|
156
156
|
V({ value: D, focusedDate: e });
|
|
157
157
|
}
|
|
@@ -165,34 +165,34 @@ const S = (c, d = u.min, p = u.max) => c instanceof Date && !Array.isArray(c) &&
|
|
|
165
165
|
K(v);
|
|
166
166
|
}
|
|
167
167
|
}, ne = (e) => {
|
|
168
|
-
const t = m(e.value), r = x.current.canMoveDown(
|
|
168
|
+
const t = m(e.value), r = x.current.canMoveDown(g.activeView);
|
|
169
169
|
if (B)
|
|
170
170
|
return;
|
|
171
171
|
if (r)
|
|
172
172
|
if (e.isTodayClick)
|
|
173
|
-
x.current.moveToBottom(
|
|
173
|
+
x.current.moveToBottom(g.activeView);
|
|
174
174
|
else {
|
|
175
|
-
x.current.moveDown(
|
|
175
|
+
x.current.moveDown(g.activeView, e.syntheticEvent), V({ focusedDate: t, navigateDate: t });
|
|
176
176
|
return;
|
|
177
177
|
}
|
|
178
|
-
|
|
178
|
+
b.current = !0;
|
|
179
179
|
let o;
|
|
180
|
-
const
|
|
180
|
+
const w = le(f, i, l), s = S(f, i, l), y = Q(f), D = W !== void 0 ? W : z.current;
|
|
181
181
|
switch (F) {
|
|
182
182
|
case "single":
|
|
183
183
|
o = m(e.value);
|
|
184
184
|
break;
|
|
185
185
|
case "multiple":
|
|
186
|
-
if (Array.isArray(
|
|
187
|
-
const v =
|
|
186
|
+
if (Array.isArray(w)) {
|
|
187
|
+
const v = w.slice();
|
|
188
188
|
let ce = -1;
|
|
189
189
|
v.forEach((It, St) => {
|
|
190
|
-
|
|
190
|
+
Ke(It, e.value) && (ce = St);
|
|
191
191
|
}), ce !== -1 ? v.splice(ce, 1) : v.push(m(e.value)), o = v.slice();
|
|
192
192
|
} else s ? o = [m(s), m(e.value)] : o = [m(e.value)];
|
|
193
193
|
break;
|
|
194
194
|
case "range": {
|
|
195
|
-
o = y.start !== null && y.end !== null && D === "start" ?
|
|
195
|
+
o = y.start !== null && y.end !== null && D === "start" ? ut(e.value) : ft(e.value, y), z.current = D !== "end" ? "end" : "start";
|
|
196
196
|
break;
|
|
197
197
|
}
|
|
198
198
|
default:
|
|
@@ -234,10 +234,10 @@ const S = (c, d = u.min, p = u.max) => c instanceof Date && !Array.isArray(c) &&
|
|
|
234
234
|
d,
|
|
235
235
|
() => T.current
|
|
236
236
|
);
|
|
237
|
-
const A = a.useRef(null), E = a.useRef(null), x = a.useRef(new Ut(
|
|
237
|
+
const A = a.useRef(null), E = a.useRef(null), x = a.useRef(new Ut(yt)), ke = a.useRef(new Xt(x.current)), N = a.useRef(void 0), $ = a.useRef(!1), b = a.useRef(!1), z = a.useRef("start"), ae = a.useRef(
|
|
238
238
|
ie(X[fe], Y, _)
|
|
239
|
-
), re = a.useRef(M), h = a.useRef([]),
|
|
240
|
-
const e = L !== void 0 ? L :
|
|
239
|
+
), re = a.useRef(M), h = a.useRef([]), R = a.useRef(null), [g, Ee] = a.useState(() => {
|
|
240
|
+
const e = L !== void 0 ? L : qe, t = S(e, i, l), r = le(e, i, l), o = Q(e), w = Ge(t, r, o), s = ie(X[fe], Y, _), y = q(at || w || J(), i, l);
|
|
241
241
|
return z.current = Qt(o, t), ae.current = s, re.current = M, {
|
|
242
242
|
value: e,
|
|
243
243
|
activeView: s,
|
|
@@ -245,90 +245,93 @@ const S = (c, d = u.min, p = u.max) => c instanceof Date && !Array.isArray(c) &&
|
|
|
245
245
|
navigateDate: y
|
|
246
246
|
};
|
|
247
247
|
}), V = (e) => {
|
|
248
|
-
|
|
248
|
+
Ee((t) => ({ ...t, ...e }));
|
|
249
249
|
};
|
|
250
250
|
a.useEffect(() => {
|
|
251
|
-
|
|
251
|
+
b.current = !0;
|
|
252
252
|
}, []), a.useEffect(() => {
|
|
253
253
|
E.current && ($.current ? E.current.focusActiveDate : E.current.blurActiveDate)();
|
|
254
254
|
const e = S(f, i, l), t = S(f, i, l);
|
|
255
|
-
|
|
255
|
+
b.current = !!(t && e && t.getTime() && e.getTime()), ae.current = g.activeView, re.current = M;
|
|
256
256
|
}), a.useEffect(() => {
|
|
257
257
|
ve && ve({ element: A.current });
|
|
258
258
|
});
|
|
259
|
-
const
|
|
259
|
+
const Rt = _t(), xe = Ht();
|
|
260
260
|
x.current.configure(Y, _);
|
|
261
|
-
const j = ie(
|
|
262
|
-
|
|
261
|
+
const j = ie(g.activeView, Y, _), G = x.current.service(j, Rt);
|
|
262
|
+
R.current = G;
|
|
263
263
|
let f;
|
|
264
|
-
N.current !== void 0 ? f = N.current : L !== void 0 ? f = L : f =
|
|
265
|
-
const
|
|
266
|
-
|
|
264
|
+
N.current !== void 0 ? f = N.current : L !== void 0 ? f = L : f = g.value;
|
|
265
|
+
const Me = S(f, i, l), Oe = le(f, i, l), Ae = Q(f), Ie = Ge(Me, Oe, Ae), C = q(
|
|
266
|
+
b.current && Ie !== null ? Ie : g.focusedDate,
|
|
267
267
|
i,
|
|
268
268
|
l
|
|
269
|
-
),
|
|
269
|
+
), Se = ue(J(), O(i), O(l)), Ct = Bt(
|
|
270
270
|
"k-calendar k-calendar-range",
|
|
271
271
|
{
|
|
272
|
-
"k-disabled": B
|
|
272
|
+
"k-disabled": B,
|
|
273
|
+
"k-week-number": we
|
|
273
274
|
},
|
|
274
|
-
|
|
275
|
-
),
|
|
276
|
-
(!Ot || Mt || At) && (h.current = G.datesList(
|
|
277
|
-
const
|
|
275
|
+
nt
|
|
276
|
+
), kt = dt(Ae, C), Fe = xe.toLanguageString(He, $e[He]), Te = xe.toLanguageString(ze, $e[ze]), Ne = !ye(U.PrevView), Pe = !ye(U.NextView), Et = { "aria-disabled": Ne || void 0 }, xt = { "aria-disabled": Pe || void 0 }, Mt = ae.current !== j, Ot = h.current.length > 0 && be(g.navigateDate, h.current[0]), At = re.current !== M;
|
|
277
|
+
(!Ot || Mt || At) && (h.current = G.datesList(g.navigateDate, M));
|
|
278
|
+
const Be = m((Le = h.current) != null && Le[0] ? h.current[0] : J());
|
|
278
279
|
return /* @__PURE__ */ a.createElement(
|
|
279
280
|
"div",
|
|
280
281
|
{
|
|
281
282
|
ref: A,
|
|
282
|
-
className:
|
|
283
|
-
id: P.id ||
|
|
284
|
-
"aria-labelledby":
|
|
285
|
-
"aria-describedby":
|
|
286
|
-
tabIndex: B ? void 0 :
|
|
287
|
-
onFocus:
|
|
288
|
-
onBlur:
|
|
289
|
-
onMouseDown:
|
|
290
|
-
onClick:
|
|
291
|
-
onKeyDown:
|
|
292
|
-
"aria-disabled": B,
|
|
293
|
-
dir:
|
|
283
|
+
className: Ct,
|
|
284
|
+
id: P.id || lt,
|
|
285
|
+
"aria-labelledby": ot,
|
|
286
|
+
"aria-describedby": st,
|
|
287
|
+
tabIndex: B ? void 0 : et,
|
|
288
|
+
onFocus: Dt,
|
|
289
|
+
onBlur: pt,
|
|
290
|
+
onMouseDown: wt,
|
|
291
|
+
onClick: gt,
|
|
292
|
+
onKeyDown: Vt,
|
|
293
|
+
"aria-disabled": B || void 0,
|
|
294
|
+
dir: Ve
|
|
294
295
|
},
|
|
295
296
|
/* @__PURE__ */ a.createElement(
|
|
296
297
|
zt,
|
|
297
298
|
{
|
|
298
|
-
key: `.kendo.calendar.header.${
|
|
299
|
+
key: `.kendo.calendar.header.${Be.getTime()}`,
|
|
299
300
|
activeView: j,
|
|
300
|
-
currentDate:
|
|
301
|
+
currentDate: Be,
|
|
301
302
|
min: i,
|
|
302
303
|
max: l,
|
|
303
304
|
rangeLength: M,
|
|
304
305
|
bus: x.current,
|
|
305
306
|
service: G,
|
|
306
|
-
headerTitle:
|
|
307
|
+
headerTitle: he,
|
|
307
308
|
verticalView: ge,
|
|
308
309
|
commands: /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(
|
|
309
|
-
|
|
310
|
+
We,
|
|
310
311
|
{
|
|
311
312
|
type: "button",
|
|
312
313
|
className: "k-calendar-nav-prev",
|
|
313
314
|
icon: H ? "chevron-right" : "chevron-left",
|
|
314
|
-
svgIcon: H ?
|
|
315
|
+
svgIcon: H ? Ye : _e,
|
|
315
316
|
fillMode: "flat",
|
|
316
|
-
title:
|
|
317
|
-
|
|
317
|
+
title: Fe,
|
|
318
|
+
"aria-label": Fe,
|
|
319
|
+
disabled: Ne,
|
|
318
320
|
onClick: Re,
|
|
319
321
|
...Et
|
|
320
322
|
}
|
|
321
|
-
), /* @__PURE__ */ a.createElement(Jt, { min: i, max: l, onClick:
|
|
322
|
-
|
|
323
|
+
), /* @__PURE__ */ a.createElement(Jt, { min: i, max: l, onClick: ht, disabled: !Se }), /* @__PURE__ */ a.createElement(
|
|
324
|
+
We,
|
|
323
325
|
{
|
|
324
326
|
type: "button",
|
|
325
327
|
className: "k-calendar-nav-next",
|
|
326
328
|
icon: H ? "chevron-left" : "chevron-right",
|
|
327
|
-
svgIcon: H ?
|
|
329
|
+
svgIcon: H ? _e : Ye,
|
|
328
330
|
fillMode: "flat",
|
|
329
|
-
title:
|
|
330
|
-
|
|
331
|
-
|
|
331
|
+
title: Te,
|
|
332
|
+
"aria-label": Te,
|
|
333
|
+
disabled: Pe,
|
|
334
|
+
onClick: Ce,
|
|
332
335
|
...xt
|
|
333
336
|
}
|
|
334
337
|
))
|
|
@@ -341,24 +344,24 @@ const S = (c, d = u.min, p = u.max) => c instanceof Date && !Array.isArray(c) &&
|
|
|
341
344
|
dates: h.current,
|
|
342
345
|
activeView: j,
|
|
343
346
|
focusedDate: m(C),
|
|
344
|
-
weekDaysFormat:
|
|
347
|
+
weekDaysFormat: Ze,
|
|
345
348
|
min: i,
|
|
346
349
|
max: l,
|
|
347
350
|
bus: x.current,
|
|
348
351
|
service: G,
|
|
349
|
-
selectionRange:
|
|
350
|
-
value:
|
|
351
|
-
cellUID:
|
|
352
|
+
selectionRange: kt,
|
|
353
|
+
value: Oe || Me,
|
|
354
|
+
cellUID: it,
|
|
352
355
|
views: M,
|
|
353
356
|
onChange: ne,
|
|
354
|
-
onWeekSelect:
|
|
355
|
-
showWeekNumbers:
|
|
356
|
-
onCellEnter:
|
|
357
|
-
cell:
|
|
358
|
-
weekCell:
|
|
359
|
-
headerTitle:
|
|
357
|
+
onWeekSelect: bt,
|
|
358
|
+
showWeekNumbers: we,
|
|
359
|
+
onCellEnter: vt,
|
|
360
|
+
cell: rt,
|
|
361
|
+
weekCell: ct,
|
|
362
|
+
headerTitle: he,
|
|
360
363
|
verticalView: ge,
|
|
361
|
-
showOtherMonthDays:
|
|
364
|
+
showOtherMonthDays: tt,
|
|
362
365
|
allowReverse: me
|
|
363
366
|
}
|
|
364
367
|
),
|
|
@@ -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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react"),D=require("@progress/kendo-react-intl"),i=require("@progress/kendo-react-common"),I=require("@progress/kendo-react-buttons"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react"),D=require("@progress/kendo-react-intl"),i=require("@progress/kendo-react-common"),I=require("@progress/kendo-react-buttons"),l=require("@progress/kendo-date-math"),s=require("../../messages/index.js"),n=require("../../utils.js");function R(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const T=R(p),c={min:n.MIN_DATE,max:n.MAX_DATE},q=e=>{const{min:a=c.min,max:t=c.max,onClick:o,disabled:u,tabIndex:m,unstyled:r}=e,g=d=>{if(n.isInRange(n.getToday(),l.getDate(a),l.getDate(t))&&o){const k={syntheticEvent:d,nativeEvent:d.nativeEvent,value:n.dateInRange(n.getToday(),a,t),target:null,isTodayClick:!0};o(k)}},y=D.useLocalization(),f=r&&r.uCalendar,C=y.toLanguageString(s.today,s.messages[s.today]),b=i.classNames(i.uCalendar.today({c:f,disabled:u}));return T.createElement(I.Button,{className:b,onClick:g,tabIndex:m,fillMode:"flat"},C)};exports.TodayCommand=q;exports.todayCommandDefaultProps=c;
|
|
@@ -6,49 +6,38 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as I from "react";
|
|
9
|
-
import { useLocalization as
|
|
10
|
-
import { classNames as
|
|
11
|
-
import { Button as
|
|
9
|
+
import { useLocalization as v } from "@progress/kendo-react-intl";
|
|
10
|
+
import { classNames as x, uCalendar as R } from "@progress/kendo-react-common";
|
|
11
|
+
import { Button as T } from "@progress/kendo-react-buttons";
|
|
12
12
|
import { getDate as s } from "@progress/kendo-date-math";
|
|
13
|
-
import { today as m, messages as
|
|
14
|
-
import { MIN_DATE as D, MAX_DATE as E, isInRange as M, getToday as
|
|
15
|
-
const
|
|
13
|
+
import { today as m, messages as k } from "../../messages/index.mjs";
|
|
14
|
+
import { MIN_DATE as D, MAX_DATE as E, isInRange as M, getToday as i, dateInRange as N } from "../../utils.mjs";
|
|
15
|
+
const r = {
|
|
16
16
|
min: D,
|
|
17
17
|
max: E
|
|
18
|
-
},
|
|
18
|
+
}, S = (l) => {
|
|
19
19
|
const {
|
|
20
|
-
min: a =
|
|
21
|
-
max:
|
|
22
|
-
onClick:
|
|
20
|
+
min: a = r.min,
|
|
21
|
+
max: t = r.max,
|
|
22
|
+
onClick: o,
|
|
23
23
|
disabled: c,
|
|
24
24
|
tabIndex: d,
|
|
25
|
-
unstyled:
|
|
26
|
-
} = l, f = (
|
|
27
|
-
if (M(
|
|
25
|
+
unstyled: n
|
|
26
|
+
} = l, f = (e) => {
|
|
27
|
+
if (M(i(), s(a), s(t)) && o) {
|
|
28
28
|
const p = {
|
|
29
|
-
syntheticEvent:
|
|
30
|
-
nativeEvent:
|
|
31
|
-
value: N(
|
|
29
|
+
syntheticEvent: e,
|
|
30
|
+
nativeEvent: e.nativeEvent,
|
|
31
|
+
value: N(i(), a, t),
|
|
32
32
|
target: null,
|
|
33
33
|
isTodayClick: !0
|
|
34
34
|
};
|
|
35
|
-
|
|
35
|
+
o(p);
|
|
36
36
|
}
|
|
37
|
-
}, g =
|
|
38
|
-
return /* @__PURE__ */ I.createElement(
|
|
39
|
-
R,
|
|
40
|
-
{
|
|
41
|
-
className: y,
|
|
42
|
-
onClick: f,
|
|
43
|
-
tabIndex: d,
|
|
44
|
-
fillMode: "flat",
|
|
45
|
-
themeColor: "base",
|
|
46
|
-
role: "link"
|
|
47
|
-
},
|
|
48
|
-
C
|
|
49
|
-
);
|
|
37
|
+
}, g = v(), u = n && n.uCalendar, y = g.toLanguageString(m, k[m]), C = x(R.today({ c: u, disabled: c }));
|
|
38
|
+
return /* @__PURE__ */ I.createElement(T, { className: C, onClick: f, tabIndex: d, fillMode: "flat" }, y);
|
|
50
39
|
};
|
|
51
40
|
export {
|
|
52
|
-
|
|
53
|
-
|
|
41
|
+
S as TodayCommand,
|
|
42
|
+
r as todayCommandDefaultProps
|
|
54
43
|
};
|
|
@@ -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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const se=require("react"),f=require("@progress/kendo-date-math"),ce=require("@progress/kendo-react-intl"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const se=require("react"),f=require("@progress/kendo-date-math"),ce=require("@progress/kendo-react-intl"),oe=require("./CalendarCell.js"),ie=require("./CalendarWeekCell.js"),R=require("../models/CalendarViewEnum.js"),y=require("../../utils.js"),ue=require("../services/WeekNamesService.js"),a=require("@progress/kendo-react-common");function me(c){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const s in c)if(s!=="default"){const k=Object.getOwnPropertyDescriptor(c,s);Object.defineProperty(i,s,k.get?k:{enumerable:!0,get:()=>c[s]})}}return i.default=c,Object.freeze(i)}const l=me(se),I=(c,i)=>{const s=i;return l.createElement("td",{key:c,role:"gridcell",className:a.classNames(a.uCalendar.td({c:s,isEmpty:!0}))}," ")},w={direction:"vertical",selectedDate:y.getToday(),showWeekNumbers:!1},de=c=>{const{activeRangeEnd:i,activeView:s,bus:k,cellUID:T,direction:P=w.direction,focusedDate:j,weekCell:g,max:z,weekDaysFormat:L,min:_,cell:h,onCellEnter:v,onCellLeave:E,onChange:p,onWeekSelect:b,selectedDate:$=w.selectedDate,selectionRange:x,service:D,showWeekNumbers:A=w.showWeekNumbers,showOtherMonthDays:B,viewDate:W,allowReverse:F,unstyled:C}=c,N=P==="horizontal",V=s===R.CalendarViewEnum.month,d=!!(A&&s===R.CalendarViewEnum.month),H=(e,t)=>{if(p&&t){const r={value:f.cloneDate(e),target:null,nativeEvent:t==null?void 0:t.nativeEvent,syntheticEvent:t};p(r)}},K=(e,t,r)=>{const o=t.findIndex(n=>(n==null?void 0:n.value)===e);b&&r&&b(e,o,r)},U=e=>{v&&v(f.cloneDate(e))},Y=e=>{E&&E(f.cloneDate(e))},q=ce.useInternationalization(),M=new ue.WeekNamesService(q),u=C&&C.uCalendar,G=e=>d?f.weekInYear(e,q.firstDay()):null,J=e=>{if(!d)return null;let t=0,r=e[t];for(;!r&&t<e.length;)r=e[++t];return r},S=e=>{const t=J(e);return t?t.value:null},Q=(e,t)=>{if(!S(e))return I(`week-cell-${t}`);const o=S(e),n=G(o),m=`kendo-react-calendar-week-cell-${n}`,O={value:n,firstDate:o,weekDays:e,unstyled:C,onClick:K};return g?l.createElement(g,{...O,key:m},n):l.createElement(ie.CalendarWeekCell,{...O,key:m},n)},X=e=>e.map((t,r)=>{if(!t)return I(r);const o={"aria-selected":t.isSelected?!0:void 0,role:"gridcell"},n=`kendo-react-calendar-cell-${t.value.getTime()}`,m={...o,...t,isDisabled:!t.isInRange,view:s,showOtherMonthDays:B,allowReverse:F,activeRangeEnd:i,unstyled:C,onClick:H,onMouseEnter:U,onMouseLeave:Y};return h?l.createElement(h,{...m,key:n},t.formattedValue):l.createElement(oe.CalendarCell,{...m,key:n},t.formattedValue)}),Z=M.getWeekNames(d,L),ee=V&&N?M.getWeekNames(d,"wide"):[],te=D.rowLength(d),ae=D.title(W),ne=y.getToday(),le=y.setTime(W,ne),re=D.data({cellUID:T,min:_,max:z,focusedDate:j,isActiveView:!k.canMoveDown(s),selectedDate:$,selectionRange:x,viewDate:le});return l.createElement(l.Fragment,null,V&&N&&l.createElement("thead",{className:a.classNames(a.uCalendar.thead({c:u})),role:"rowgroup"},l.createElement("tr",{role:"row",className:a.classNames(a.uCalendar.tr({c:u}))},Z.map((e,t)=>l.createElement("th",{key:e,className:a.classNames(a.uCalendar.th({c:u})),role:"columnheader","aria-label":ee[t]},e)))),l.createElement("tbody",{className:a.classNames(a.uCalendar.tbody({c:u})),role:"rowgroup"},!N&&l.createElement("tr",{className:a.classNames(a.uCalendar.tr({c:u})),"aria-hidden":!0,role:"row"},l.createElement("th",{scope:"col",colSpan:te,className:a.classNames(a.uCalendar.caption({c:u}))},ae)),re.map((e,t)=>{var o,n;const r=(n=(o=e.find(m=>m!=null))==null?void 0:o.value.getTime())!=null?n:t;return l.createElement("tr",{role:"row",className:a.classNames(a.uCalendar.tr({c:u})),key:r},d&&Q(e,t),X(e))})))};exports.View=de;exports.viewDefaultProps=w;
|