@progress/kendo-react-dateinputs 14.4.1-develop.9 → 14.5.0-develop.1
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.d.ts +35 -110
- package/calendar/components/Calendar.js +5 -5
- package/calendar/components/Calendar.mjs +288 -313
- package/calendar/components/CalendarCell.d.ts +1 -10
- package/calendar/components/CalendarCell.js +1 -1
- package/calendar/components/CalendarCell.mjs +68 -78
- package/calendar/components/Header.d.ts +11 -24
- package/calendar/components/Header.js +1 -1
- package/calendar/components/Header.mjs +41 -55
- package/calendar/components/HorizontalViewList.d.ts +29 -27
- package/calendar/components/HorizontalViewList.js +1 -1
- package/calendar/components/HorizontalViewList.mjs +112 -102
- package/calendar/components/MultiViewCalendar.d.ts +39 -141
- package/calendar/components/MultiViewCalendar.js +1 -1
- package/calendar/components/MultiViewCalendar.mjs +331 -373
- package/calendar/components/Navigation.d.ts +19 -39
- package/calendar/components/Navigation.js +1 -1
- package/calendar/components/Navigation.mjs +95 -107
- package/calendar/components/TodayCommand.d.ts +8 -25
- package/calendar/components/TodayCommand.js +1 -1
- package/calendar/components/TodayCommand.mjs +44 -61
- package/calendar/components/View.d.ts +12 -43
- package/calendar/components/View.js +1 -1
- package/calendar/components/View.mjs +111 -137
- package/calendar/components/ViewList.d.ts +27 -67
- package/calendar/components/ViewList.js +1 -1
- package/calendar/components/ViewList.mjs +207 -225
- package/calendar/models/CalendarSettings.d.ts +2 -2
- package/calendar/models/MultiViewCalendarSettings.d.ts +4 -4
- package/calendar/models/ViewService.d.ts +1 -1
- package/calendar/models/index.d.ts +7 -7
- package/calendar/services/BusViewService.d.ts +1 -1
- package/calendar/services/DecadeViewService.d.ts +2 -2
- package/calendar/services/MonthViewService.d.ts +2 -2
- package/calendar/services/NavigationService.d.ts +1 -1
- package/calendar/services/ScrollSyncService.d.ts +4 -4
- package/calendar/services/WeekNamesService.d.ts +1 -1
- package/calendar/services/YearViewService.d.ts +2 -2
- package/dateinput/DateInput.d.ts +1 -1
- package/dateinput/models/DateInputSettings.d.ts +2 -2
- package/dateinput/models/dateinput-options.d.ts +2 -2
- package/dateinput/models/index.d.ts +7 -7
- package/dateinput/models/kendo-date.d.ts +1 -1
- package/datepicker/models/DatePickerSettings.d.ts +2 -2
- package/datepicker/models/index.d.ts +1 -1
- package/daterangepicker/models/DateRangePickerCalendarSettings.d.ts +1 -1
- package/daterangepicker/models/DateRangePickerDateInputSettings.d.ts +1 -1
- package/daterangepicker/models/DateRangePickerSettings.d.ts +3 -3
- package/daterangepicker/models/index.d.ts +4 -4
- package/datetimepicker/DateTimePicker.d.ts +1 -1
- package/datetimepicker/models/DateTimePickerSettings.d.ts +1 -1
- package/datetimepicker/models/index.d.ts +1 -1
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/index.d.mts +1 -1
- package/index.d.ts +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +8 -8
- package/timepicker/TimePart.d.ts +1 -1
- package/timepicker/TimePicker.d.ts +1 -1
- package/timepicker/TimeSelector.d.ts +1 -1
- package/timepicker/models/ListService.d.ts +2 -2
- package/timepicker/models/TimePickerSettings.d.ts +3 -3
- package/timepicker/models/index.d.ts +5 -5
- package/timepicker/services/DayPeriodService.d.ts +3 -3
- package/timepicker/services/HoursService.d.ts +3 -3
- package/timepicker/services/MinutesService.d.ts +3 -3
- package/timepicker/services/SecondsService.d.ts +3 -3
- package/virtualization/Virtualization.d.ts +25 -63
- package/virtualization/Virtualization.js +1 -1
- package/virtualization/Virtualization.mjs +163 -168
|
@@ -5,460 +5,418 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { Button as
|
|
14
|
-
import { chevronRightIcon as
|
|
15
|
-
import { Action as
|
|
16
|
-
import { CalendarViewEnum as
|
|
17
|
-
import { EMPTY_SELECTIONRANGE as
|
|
18
|
-
import { Header as
|
|
19
|
-
import {
|
|
20
|
-
import { prevView as
|
|
21
|
-
import { BusViewService as
|
|
22
|
-
import { NavigationService as
|
|
23
|
-
import { HorizontalViewList as
|
|
24
|
-
import { TodayCommand as
|
|
25
|
-
import { packageMetadata as
|
|
26
|
-
const S = (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
8
|
+
import * as a from "react";
|
|
9
|
+
import n from "prop-types";
|
|
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 Pe, addDays as se } from "@progress/kendo-date-math";
|
|
12
|
+
import { useInternationalization as _t, useLocalization as Ht } from "@progress/kendo-react-intl";
|
|
13
|
+
import { Button as Be } from "@progress/kendo-react-buttons";
|
|
14
|
+
import { chevronRightIcon as Le, chevronLeftIcon as Ke } from "@progress/kendo-svg-icons";
|
|
15
|
+
import { Action as U } from "../models/NavigationAction.mjs";
|
|
16
|
+
import { CalendarViewEnum as X } from "../models/CalendarViewEnum.mjs";
|
|
17
|
+
import { EMPTY_SELECTIONRANGE as $t } from "../models/SelectionRange.mjs";
|
|
18
|
+
import { Header as zt } from "./Header.mjs";
|
|
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 We, messages as Ye, nextView as _e } from "../../messages/index.mjs";
|
|
21
|
+
import { BusViewService as Ut } from "../services/BusViewService.mjs";
|
|
22
|
+
import { NavigationService as Xt } from "../services/NavigationService.mjs";
|
|
23
|
+
import { HorizontalViewList as qt } from "./HorizontalViewList.mjs";
|
|
24
|
+
import { TodayCommand as Jt } from "./TodayCommand.mjs";
|
|
25
|
+
import { packageMetadata as He } 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, $e = (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
|
+
disabled: !1,
|
|
28
|
+
min: jt,
|
|
29
|
+
max: Gt,
|
|
30
|
+
defaultActiveView: "month",
|
|
31
|
+
defaultValue: null,
|
|
32
|
+
topView: "century",
|
|
33
|
+
weekDaysFormat: "short",
|
|
34
|
+
tabIndex: 0,
|
|
35
|
+
bottomView: "month",
|
|
36
|
+
views: 2,
|
|
37
|
+
allowReverse: !1,
|
|
38
|
+
showOtherMonthDays: !1
|
|
39
|
+
}, Zt = Kt(), Z = a.forwardRef(
|
|
40
|
+
(c, d) => {
|
|
41
|
+
var Ne;
|
|
42
|
+
const p = a.useMemo(
|
|
43
|
+
() => !Ft(He, { component: "MultiViewCalendar" }),
|
|
44
|
+
[]
|
|
45
|
+
), k = a.useMemo(() => Tt(He), []), P = Nt(Zt, c), de = Pt(P.id), {
|
|
46
|
+
disabled: B = u.disabled,
|
|
47
|
+
min: ze = u.min,
|
|
48
|
+
max: je = u.max,
|
|
49
|
+
defaultActiveView: fe = u.defaultActiveView,
|
|
50
|
+
defaultValue: Ge = u.defaultValue,
|
|
51
|
+
topView: Ue = u.topView,
|
|
52
|
+
bottomView: Xe = u.bottomView,
|
|
53
|
+
weekDaysFormat: qe = u.weekDaysFormat,
|
|
54
|
+
tabIndex: Je = u.tabIndex,
|
|
55
|
+
views: M = u.views,
|
|
56
|
+
allowReverse: me = u.allowReverse,
|
|
57
|
+
showOtherMonthDays: Qe = u.showOtherMonthDays,
|
|
58
|
+
_ref: ve,
|
|
59
|
+
className: Ze,
|
|
60
|
+
weekNumber: et,
|
|
61
|
+
mobileMode: ge,
|
|
62
|
+
focusedDate: tt,
|
|
63
|
+
value: L,
|
|
64
|
+
onChange: K,
|
|
65
|
+
onFocus: we,
|
|
66
|
+
onBlur: De,
|
|
67
|
+
cell: nt,
|
|
68
|
+
weekCell: at,
|
|
69
|
+
headerTitle: pe,
|
|
70
|
+
mode: F,
|
|
71
|
+
activeRangeEnd: W,
|
|
72
|
+
ariaLabelledBy: rt,
|
|
73
|
+
ariaDescribedBy: ct,
|
|
74
|
+
dir: he
|
|
75
|
+
} = P, i = O(ze), l = O(je), Y = X[Xe], _ = X[Ue], H = he === "rtl", ot = de + "-cell-uid", st = de + "-wrapper-id", it = (e) => ({ start: e, end: null }), lt = (e, t) => ({
|
|
31
76
|
start: e.start,
|
|
32
|
-
end: e.end === null && e.start !== null &&
|
|
33
|
-
}),
|
|
34
|
-
const { end: r, start: o } = t,
|
|
35
|
-
return !
|
|
36
|
-
},
|
|
37
|
-
if (!
|
|
77
|
+
end: e.end === null && e.start !== null && $.current ? t : e.end
|
|
78
|
+
}), ut = (e, t) => {
|
|
79
|
+
const { end: r, start: o } = t, g = 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 } : g !== "end" ? { start: e, end: r } : { start: o || D, end: e };
|
|
81
|
+
}, Ve = (e) => {
|
|
82
|
+
if (!b.current)
|
|
38
83
|
return !1;
|
|
39
|
-
const t =
|
|
40
|
-
return
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
const r =
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
return this.activeRange !== "end" ? r !== null && e > r : o !== null && e < o;
|
|
48
|
-
}, this.handleCellEnter = (e) => {
|
|
49
|
-
this.props.mode === "range" && (this.calculateFocusFromValue = !1, this.setState({
|
|
84
|
+
const t = m(C), r = b.current.move(t, e);
|
|
85
|
+
return i <= r && r <= l || b.current.isInSameView(r, i) || b.current.isInSameView(r, l);
|
|
86
|
+
}, ye = (e, t) => !!t && Wt(t) <= e && e <= Yt(t), ee = (e, t) => {
|
|
87
|
+
R.current = !1;
|
|
88
|
+
const r = te(e, t);
|
|
89
|
+
V({ navigateDate: r, focusedDate: r });
|
|
90
|
+
}, te = (e, t) => dt(b.current.move(t, e)), dt = (e) => q(e, i, l), ft = (e) => {
|
|
91
|
+
F === "range" && (R.current = !1, V({
|
|
50
92
|
focusedDate: e
|
|
51
93
|
}));
|
|
52
|
-
},
|
|
94
|
+
}, mt = (e) => {
|
|
53
95
|
e.preventDefault();
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const { onBlur: t } = this.props;
|
|
67
|
-
t && t.call(void 0, e);
|
|
68
|
-
}, this.handleTodayClick = (e) => {
|
|
69
|
-
this.todayIsInRange && this.handleDateChange(e);
|
|
70
|
-
}, this.handlePrevButtonClick = () => {
|
|
71
|
-
const e = x.PrevView;
|
|
72
|
-
if (this.state.activeView > 0 && this.focusedDate.getFullYear() > this.dates[0].getFullYear())
|
|
73
|
-
this.navigate(e, this.move(e, this.focusedDate));
|
|
96
|
+
}, vt = (e) => {
|
|
97
|
+
A.current && A.current.focus({ preventScroll: !0 });
|
|
98
|
+
}, gt = (e) => {
|
|
99
|
+
$.current = !0, E.current && (E.current.focusActiveDate(), we && we(e));
|
|
100
|
+
}, wt = (e) => {
|
|
101
|
+
$.current = !1, E.current && (E.current.blurActiveDate(), De && De(e));
|
|
102
|
+
}, Dt = (e) => {
|
|
103
|
+
Ie && ne(e);
|
|
104
|
+
}, Re = () => {
|
|
105
|
+
const e = U.PrevView, t = m(C);
|
|
106
|
+
if (w.activeView > 0 && t.getFullYear() > h.current[0].getFullYear())
|
|
107
|
+
ee(e, te(e, t));
|
|
74
108
|
else {
|
|
75
|
-
const
|
|
76
|
-
|
|
109
|
+
const r = ye(t, h.current[1]) ? te(e, t) : t;
|
|
110
|
+
ee(e, r);
|
|
77
111
|
}
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
},
|
|
81
|
-
const { keyCode: r, ctrlKey: o, metaKey:
|
|
112
|
+
}, be = () => {
|
|
113
|
+
ee(U.NextView, m(C));
|
|
114
|
+
}, pt = (e) => {
|
|
115
|
+
const { keyCode: r, ctrlKey: o, metaKey: g } = e;
|
|
82
116
|
if (r === 84) {
|
|
83
|
-
const
|
|
84
|
-
|
|
117
|
+
const s = J();
|
|
118
|
+
R.current = !1, V({ focusedDate: s, navigateDate: s });
|
|
85
119
|
}
|
|
86
|
-
if ((o ||
|
|
87
|
-
const
|
|
120
|
+
if ((o || g) && (r === oe.left && Re(), r === oe.right && be()), r === oe.enter) {
|
|
121
|
+
const s = {
|
|
88
122
|
syntheticEvent: e,
|
|
89
123
|
nativeEvent: e.nativeEvent,
|
|
90
|
-
value:
|
|
91
|
-
target:
|
|
124
|
+
value: m(C),
|
|
125
|
+
target: T.current
|
|
92
126
|
};
|
|
93
|
-
|
|
127
|
+
ne(s);
|
|
94
128
|
} else {
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
129
|
+
const s = q(
|
|
130
|
+
Ce.current.move(
|
|
131
|
+
C,
|
|
132
|
+
Ce.current.action(e),
|
|
133
|
+
w.activeView,
|
|
134
|
+
b.current,
|
|
101
135
|
e
|
|
102
136
|
),
|
|
103
|
-
|
|
104
|
-
|
|
137
|
+
i,
|
|
138
|
+
l
|
|
105
139
|
);
|
|
106
|
-
if (
|
|
140
|
+
if (Pe(C, s))
|
|
107
141
|
return;
|
|
108
|
-
|
|
142
|
+
h.current && b.current && !b.current.isInArray(s, h.current) && V({ navigateDate: s }), R.current = !1, V({ focusedDate: s });
|
|
109
143
|
}
|
|
110
144
|
e.preventDefault();
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
},
|
|
114
|
-
if (
|
|
145
|
+
}, ht = ({ view: e }) => {
|
|
146
|
+
R.current = !1, ke((t) => ({ ...t, activeView: e, navigateDate: t.focusedDate }));
|
|
147
|
+
}, Vt = (e, t, r) => {
|
|
148
|
+
if (F === "single")
|
|
115
149
|
return;
|
|
116
|
-
const o = 0,
|
|
117
|
-
let
|
|
118
|
-
if (
|
|
119
|
-
|
|
120
|
-
for (let
|
|
121
|
-
|
|
122
|
-
|
|
150
|
+
const o = 0, g = 6, s = t === o ? e : se(e, -t), y = t === g ? e : se(e, g - t);
|
|
151
|
+
let D = null;
|
|
152
|
+
if (F === "multiple") {
|
|
153
|
+
D = [];
|
|
154
|
+
for (let v = o; v <= g; v++)
|
|
155
|
+
D.push(se(s, v));
|
|
156
|
+
V({ value: D, focusedDate: e });
|
|
123
157
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
if (C) {
|
|
127
|
-
const y = {
|
|
158
|
+
if (F === "range" && (D = { start: s, end: y }, V({ value: D, focusedDate: e })), K) {
|
|
159
|
+
const v = {
|
|
128
160
|
syntheticEvent: r,
|
|
129
161
|
nativeEvent: r.nativeEvent,
|
|
130
|
-
value:
|
|
131
|
-
target:
|
|
162
|
+
value: D,
|
|
163
|
+
target: T.current
|
|
132
164
|
};
|
|
133
|
-
|
|
165
|
+
K(v);
|
|
134
166
|
}
|
|
135
|
-
},
|
|
136
|
-
const t = m(e.value), r =
|
|
137
|
-
if (
|
|
167
|
+
}, ne = (e) => {
|
|
168
|
+
const t = m(e.value), r = x.current.canMoveDown(w.activeView);
|
|
169
|
+
if (B)
|
|
138
170
|
return;
|
|
139
171
|
if (r)
|
|
140
172
|
if (e.isTodayClick)
|
|
141
|
-
|
|
173
|
+
x.current.moveToBottom(w.activeView);
|
|
142
174
|
else {
|
|
143
|
-
|
|
175
|
+
x.current.moveDown(w.activeView, e.syntheticEvent), V({ focusedDate: t, navigateDate: t });
|
|
144
176
|
return;
|
|
145
177
|
}
|
|
146
|
-
|
|
178
|
+
R.current = !0;
|
|
147
179
|
let o;
|
|
148
|
-
|
|
180
|
+
const g = le(f, i, l), s = S(f, i, l), y = Q(f), D = W !== void 0 ? W : z.current;
|
|
181
|
+
switch (F) {
|
|
149
182
|
case "single":
|
|
150
183
|
o = m(e.value);
|
|
151
184
|
break;
|
|
152
185
|
case "multiple":
|
|
153
|
-
if (Array.isArray(
|
|
154
|
-
const
|
|
155
|
-
let
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}),
|
|
159
|
-
} else
|
|
160
|
-
this.selectedDate ? o = [m(this.selectedDate), m(e.value)] : o = [m(e.value)];
|
|
186
|
+
if (Array.isArray(g)) {
|
|
187
|
+
const v = g.slice();
|
|
188
|
+
let ce = -1;
|
|
189
|
+
v.forEach((It, St) => {
|
|
190
|
+
Pe(It, e.value) && (ce = St);
|
|
191
|
+
}), ce !== -1 ? v.splice(ce, 1) : v.push(m(e.value)), o = v.slice();
|
|
192
|
+
} else s ? o = [m(s), m(e.value)] : o = [m(e.value)];
|
|
161
193
|
break;
|
|
162
194
|
case "range": {
|
|
163
|
-
o =
|
|
195
|
+
o = y.start !== null && y.end !== null && D === "start" ? it(e.value) : ut(e.value, y), z.current = D !== "end" ? "end" : "start";
|
|
164
196
|
break;
|
|
165
197
|
}
|
|
166
198
|
default:
|
|
167
199
|
o = m(e.value);
|
|
168
200
|
break;
|
|
169
201
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
if (h) {
|
|
173
|
-
const n = {
|
|
202
|
+
if (N.current = o, e.isTodayClick && V({ navigateDate: t }), V({ value: o, focusedDate: t }), N.current = o, K) {
|
|
203
|
+
const v = {
|
|
174
204
|
syntheticEvent: e.syntheticEvent,
|
|
175
205
|
nativeEvent: e.nativeEvent,
|
|
176
206
|
value: o,
|
|
177
|
-
target:
|
|
207
|
+
target: T.current
|
|
178
208
|
};
|
|
179
|
-
|
|
209
|
+
K(v);
|
|
180
210
|
}
|
|
181
|
-
|
|
182
|
-
},
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Gets the value of the MultiViewCalendar.
|
|
209
|
-
*/
|
|
210
|
-
get value() {
|
|
211
|
-
return this.valueDuringOnChange !== void 0 ? this.valueDuringOnChange : this.props.value !== void 0 ? this.props.value : this.state.value;
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Gets the current focused date of the MultiViewCalendar.
|
|
215
|
-
*/
|
|
216
|
-
get focusedDate() {
|
|
217
|
-
return m(this._focusedDate);
|
|
218
|
-
}
|
|
219
|
-
get min() {
|
|
220
|
-
return g(
|
|
221
|
-
this.props.min !== void 0 ? this.props.min : u.defaultProps.min
|
|
222
|
-
);
|
|
223
|
-
}
|
|
224
|
-
get max() {
|
|
225
|
-
return g(
|
|
226
|
-
this.props.max !== void 0 ? this.props.max : u.defaultProps.max
|
|
227
|
-
);
|
|
228
|
-
}
|
|
229
|
-
get bottomView() {
|
|
230
|
-
return A[this.props.bottomView !== void 0 ? this.props.bottomView : u.defaultProps.bottomView];
|
|
231
|
-
}
|
|
232
|
-
get topView() {
|
|
233
|
-
return A[this.props.topView !== void 0 ? this.props.topView : u.defaultProps.topView];
|
|
234
|
-
}
|
|
235
|
-
get activeRange() {
|
|
236
|
-
return this.props.activeRangeEnd !== void 0 ? this.props.activeRangeEnd : this.activeRangeEnd;
|
|
237
|
-
}
|
|
238
|
-
get todayIsInRange() {
|
|
239
|
-
return T(F(), g(this.min), g(this.max));
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* @hidden
|
|
243
|
-
*/
|
|
244
|
-
componentDidMount() {
|
|
245
|
-
this.calculateFocusFromValue = !0;
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* @hidden
|
|
249
|
-
*/
|
|
250
|
-
componentDidUpdate() {
|
|
251
|
-
this.calendarViewList && (this.isActive ? this.calendarViewList.focusActiveDate : this.calendarViewList.blurActiveDate)();
|
|
252
|
-
const i = S(this.min, this.max, this.value);
|
|
253
|
-
this.calculateFocusFromValue = !!(this.selectedDate && i && this.selectedDate.getTime() && i.getTime()), this.lastView = this.state.activeView, this.lastViewsCount = this.props.views || E.defaultProps.views;
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
* @hidden
|
|
257
|
-
*/
|
|
258
|
-
render() {
|
|
259
|
-
this.props._ref && this.props._ref(this), this.intl = G(this), this.localization = X(this), this.bus.configure(this.bottomView, this.topView);
|
|
260
|
-
const i = _(this.state.activeView, this.bottomView, this.topView);
|
|
261
|
-
this.service = this.bus.service(i, this.intl), this.selectedDate = S(this.min, this.max, this.value), this.selectedMultiple = U(this.min, this.max, this.value), this.selectedRange = $(this.value);
|
|
262
|
-
const a = H(this.selectedDate, this.selectedMultiple, this.selectedRange);
|
|
263
|
-
this._focusedDate = k(
|
|
264
|
-
this.calculateFocusFromValue && a !== null ? a : this.state.focusedDate,
|
|
265
|
-
this.min,
|
|
266
|
-
this.max
|
|
211
|
+
N.current = void 0;
|
|
212
|
+
}, T = a.useRef(null);
|
|
213
|
+
a.useImperativeHandle(
|
|
214
|
+
T,
|
|
215
|
+
() => ({
|
|
216
|
+
get element() {
|
|
217
|
+
return A.current;
|
|
218
|
+
},
|
|
219
|
+
get focusedDate() {
|
|
220
|
+
return m(C);
|
|
221
|
+
},
|
|
222
|
+
get value() {
|
|
223
|
+
return f;
|
|
224
|
+
},
|
|
225
|
+
get props() {
|
|
226
|
+
return P;
|
|
227
|
+
},
|
|
228
|
+
focus: () => {
|
|
229
|
+
var e;
|
|
230
|
+
return (e = A.current) == null ? void 0 : e.focus();
|
|
231
|
+
}
|
|
232
|
+
})
|
|
233
|
+
), a.useImperativeHandle(
|
|
234
|
+
d,
|
|
235
|
+
() => T.current
|
|
267
236
|
);
|
|
268
|
-
const
|
|
237
|
+
const A = a.useRef(null), E = a.useRef(null), x = a.useRef(new Ut(ht)), Ce = a.useRef(new Xt(x.current)), N = a.useRef(void 0), $ = a.useRef(!1), R = a.useRef(!1), z = a.useRef("start"), ae = a.useRef(
|
|
238
|
+
ie(X[fe], Y, _)
|
|
239
|
+
), re = a.useRef(M), h = a.useRef([]), b = a.useRef(null), [w, ke] = a.useState(() => {
|
|
240
|
+
const e = L !== void 0 ? L : Ge, t = S(e, i, l), r = le(e, i, l), o = Q(e), g = $e(t, r, o), s = ie(X[fe], Y, _), y = q(tt || g || J(), i, l);
|
|
241
|
+
return z.current = Qt(o, t), ae.current = s, re.current = M, {
|
|
242
|
+
value: e,
|
|
243
|
+
activeView: s,
|
|
244
|
+
focusedDate: y,
|
|
245
|
+
navigateDate: y
|
|
246
|
+
};
|
|
247
|
+
}), V = (e) => {
|
|
248
|
+
ke((t) => ({ ...t, ...e }));
|
|
249
|
+
};
|
|
250
|
+
a.useEffect(() => {
|
|
251
|
+
R.current = !0;
|
|
252
|
+
}, []), a.useEffect(() => {
|
|
253
|
+
E.current && ($.current ? E.current.focusActiveDate : E.current.blurActiveDate)();
|
|
254
|
+
const e = S(f, i, l), t = S(f, i, l);
|
|
255
|
+
R.current = !!(t && e && t.getTime() && e.getTime()), ae.current = w.activeView, re.current = M;
|
|
256
|
+
}), a.useEffect(() => {
|
|
257
|
+
ve && ve({ element: A.current });
|
|
258
|
+
});
|
|
259
|
+
const yt = _t(), Ee = Ht();
|
|
260
|
+
x.current.configure(Y, _);
|
|
261
|
+
const j = ie(w.activeView, Y, _), G = x.current.service(j, yt);
|
|
262
|
+
b.current = G;
|
|
263
|
+
let f;
|
|
264
|
+
N.current !== void 0 ? f = N.current : L !== void 0 ? f = L : f = w.value;
|
|
265
|
+
const xe = S(f, i, l), Me = le(f, i, l), Oe = Q(f), Ae = $e(xe, Me, Oe), C = q(
|
|
266
|
+
R.current && Ae !== null ? Ae : w.focusedDate,
|
|
267
|
+
i,
|
|
268
|
+
l
|
|
269
|
+
), Ie = ue(J(), O(i), O(l)), Rt = Bt(
|
|
269
270
|
"k-calendar k-calendar-range",
|
|
270
271
|
{
|
|
271
|
-
"k-disabled":
|
|
272
|
+
"k-disabled": B
|
|
272
273
|
},
|
|
273
|
-
|
|
274
|
-
),
|
|
275
|
-
(!
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
));
|
|
279
|
-
const n = m(this.dates && this.dates[0] ? this.dates[0] : F());
|
|
280
|
-
return /* @__PURE__ */ d.createElement(
|
|
274
|
+
Ze
|
|
275
|
+
), bt = lt(Oe, C), Ct = Ee.toLanguageString(We, Ye[We]), kt = Ee.toLanguageString(_e, Ye[_e]), Se = !Ve(U.PrevView), Fe = !Ve(U.NextView), Et = { "aria-disabled": Se }, xt = { "aria-disabled": Fe }, Mt = ae.current !== j, Ot = h.current.length > 0 && ye(w.navigateDate, h.current[0]), At = re.current !== M;
|
|
276
|
+
(!Ot || Mt || At) && (h.current = G.datesList(w.navigateDate, M));
|
|
277
|
+
const Te = m((Ne = h.current) != null && Ne[0] ? h.current[0] : J());
|
|
278
|
+
return /* @__PURE__ */ a.createElement(
|
|
281
279
|
"div",
|
|
282
280
|
{
|
|
283
|
-
ref:
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
"aria-disabled": this.props.disabled,
|
|
297
|
-
dir: this.props.dir
|
|
281
|
+
ref: A,
|
|
282
|
+
className: Rt,
|
|
283
|
+
id: P.id || st,
|
|
284
|
+
"aria-labelledby": rt,
|
|
285
|
+
"aria-describedby": ct,
|
|
286
|
+
tabIndex: B ? void 0 : Je,
|
|
287
|
+
onFocus: gt,
|
|
288
|
+
onBlur: wt,
|
|
289
|
+
onMouseDown: mt,
|
|
290
|
+
onClick: vt,
|
|
291
|
+
onKeyDown: pt,
|
|
292
|
+
"aria-disabled": B,
|
|
293
|
+
dir: he
|
|
298
294
|
},
|
|
299
|
-
/* @__PURE__ */
|
|
300
|
-
|
|
295
|
+
/* @__PURE__ */ a.createElement(
|
|
296
|
+
zt,
|
|
301
297
|
{
|
|
302
|
-
key: `.kendo.calendar.header.${
|
|
303
|
-
activeView:
|
|
304
|
-
currentDate:
|
|
305
|
-
min:
|
|
306
|
-
max:
|
|
307
|
-
rangeLength:
|
|
308
|
-
bus:
|
|
309
|
-
service:
|
|
310
|
-
headerTitle:
|
|
311
|
-
verticalView:
|
|
312
|
-
commands: /* @__PURE__ */
|
|
313
|
-
|
|
298
|
+
key: `.kendo.calendar.header.${Te.getTime()}`,
|
|
299
|
+
activeView: j,
|
|
300
|
+
currentDate: Te,
|
|
301
|
+
min: i,
|
|
302
|
+
max: l,
|
|
303
|
+
rangeLength: M,
|
|
304
|
+
bus: x.current,
|
|
305
|
+
service: G,
|
|
306
|
+
headerTitle: pe,
|
|
307
|
+
verticalView: ge,
|
|
308
|
+
commands: /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(
|
|
309
|
+
Be,
|
|
314
310
|
{
|
|
315
311
|
type: "button",
|
|
316
312
|
className: "k-calendar-nav-prev",
|
|
317
|
-
icon:
|
|
318
|
-
svgIcon:
|
|
313
|
+
icon: H ? "chevron-right" : "chevron-left",
|
|
314
|
+
svgIcon: H ? Le : Ke,
|
|
319
315
|
fillMode: "flat",
|
|
320
|
-
title:
|
|
321
|
-
disabled:
|
|
322
|
-
onClick:
|
|
323
|
-
...
|
|
324
|
-
}
|
|
325
|
-
), /* @__PURE__ */ d.createElement(
|
|
326
|
-
ue,
|
|
327
|
-
{
|
|
328
|
-
min: this.min,
|
|
329
|
-
max: this.max,
|
|
330
|
-
onClick: this.handleTodayClick,
|
|
331
|
-
disabled: !this.todayIsInRange
|
|
316
|
+
title: Ct,
|
|
317
|
+
disabled: Se,
|
|
318
|
+
onClick: Re,
|
|
319
|
+
...Et
|
|
332
320
|
}
|
|
333
|
-
), /* @__PURE__ */
|
|
334
|
-
|
|
321
|
+
), /* @__PURE__ */ a.createElement(Jt, { min: i, max: l, onClick: Dt, disabled: !Ie }), /* @__PURE__ */ a.createElement(
|
|
322
|
+
Be,
|
|
335
323
|
{
|
|
336
324
|
type: "button",
|
|
337
325
|
className: "k-calendar-nav-next",
|
|
338
|
-
icon:
|
|
339
|
-
svgIcon:
|
|
326
|
+
icon: H ? "chevron-left" : "chevron-right",
|
|
327
|
+
svgIcon: H ? Ke : Le,
|
|
340
328
|
fillMode: "flat",
|
|
341
|
-
title:
|
|
342
|
-
disabled:
|
|
343
|
-
onClick:
|
|
344
|
-
...
|
|
329
|
+
title: kt,
|
|
330
|
+
disabled: Fe,
|
|
331
|
+
onClick: be,
|
|
332
|
+
...xt
|
|
345
333
|
}
|
|
346
334
|
))
|
|
347
335
|
}
|
|
348
336
|
),
|
|
349
|
-
/* @__PURE__ */
|
|
350
|
-
|
|
337
|
+
/* @__PURE__ */ a.createElement(
|
|
338
|
+
qt,
|
|
351
339
|
{
|
|
352
|
-
ref:
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
showOtherMonthDays: this.props.showOtherMonthDays,
|
|
376
|
-
allowReverse: this.props.allowReverse
|
|
340
|
+
ref: E,
|
|
341
|
+
dates: h.current,
|
|
342
|
+
activeView: j,
|
|
343
|
+
focusedDate: m(C),
|
|
344
|
+
weekDaysFormat: qe,
|
|
345
|
+
min: i,
|
|
346
|
+
max: l,
|
|
347
|
+
bus: x.current,
|
|
348
|
+
service: G,
|
|
349
|
+
selectionRange: bt,
|
|
350
|
+
value: Me || xe,
|
|
351
|
+
cellUID: ot,
|
|
352
|
+
views: M,
|
|
353
|
+
onChange: ne,
|
|
354
|
+
onWeekSelect: Vt,
|
|
355
|
+
showWeekNumbers: et,
|
|
356
|
+
onCellEnter: ft,
|
|
357
|
+
cell: nt,
|
|
358
|
+
weekCell: at,
|
|
359
|
+
headerTitle: pe,
|
|
360
|
+
verticalView: ge,
|
|
361
|
+
showOtherMonthDays: Qe,
|
|
362
|
+
allowReverse: me
|
|
377
363
|
}
|
|
378
364
|
),
|
|
379
|
-
|
|
365
|
+
p && /* @__PURE__ */ a.createElement(Lt, { message: k })
|
|
380
366
|
);
|
|
381
367
|
}
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
defaultActiveView: s.oneOf(["month", "year", "decade", "century"]),
|
|
396
|
-
defaultValue: s.oneOfType([
|
|
397
|
-
D(s.instanceOf(Date)),
|
|
398
|
-
s.arrayOf(s.instanceOf(Date)),
|
|
399
|
-
s.shape({
|
|
400
|
-
start: D(s.instanceOf(Date)),
|
|
401
|
-
end: D(s.instanceOf(Date))
|
|
368
|
+
);
|
|
369
|
+
Z.propTypes = {
|
|
370
|
+
activeRangeEnd: n.oneOf(["start", "end"]),
|
|
371
|
+
allowReverse: n.bool,
|
|
372
|
+
bottomView: n.oneOf(["month", "year", "decade", "century"]),
|
|
373
|
+
className: n.string,
|
|
374
|
+
defaultActiveView: n.oneOf(["month", "year", "decade", "century"]),
|
|
375
|
+
defaultValue: n.oneOfType([
|
|
376
|
+
I(n.instanceOf(Date)),
|
|
377
|
+
n.arrayOf(n.instanceOf(Date)),
|
|
378
|
+
n.shape({
|
|
379
|
+
start: I(n.instanceOf(Date)),
|
|
380
|
+
end: I(n.instanceOf(Date))
|
|
402
381
|
})
|
|
403
382
|
]),
|
|
404
|
-
disabled:
|
|
405
|
-
focusedDate:
|
|
406
|
-
id:
|
|
407
|
-
weekDaysFormat:
|
|
408
|
-
ariaLabelledBy:
|
|
409
|
-
ariaDescribedBy:
|
|
410
|
-
max:
|
|
411
|
-
min:
|
|
412
|
-
mode:
|
|
413
|
-
onBlur:
|
|
414
|
-
onChange:
|
|
415
|
-
onFocus:
|
|
416
|
-
tabIndex:
|
|
417
|
-
topView:
|
|
418
|
-
value:
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
start:
|
|
423
|
-
end:
|
|
383
|
+
disabled: n.bool,
|
|
384
|
+
focusedDate: n.instanceOf(Date),
|
|
385
|
+
id: n.string,
|
|
386
|
+
weekDaysFormat: n.oneOf(["narrow", "short", "abbreviated"]),
|
|
387
|
+
ariaLabelledBy: n.string,
|
|
388
|
+
ariaDescribedBy: n.string,
|
|
389
|
+
max: n.instanceOf(Date),
|
|
390
|
+
min: n.instanceOf(Date),
|
|
391
|
+
mode: n.oneOf(["single", "multiple", "range"]),
|
|
392
|
+
onBlur: n.func,
|
|
393
|
+
onChange: n.func,
|
|
394
|
+
onFocus: n.func,
|
|
395
|
+
tabIndex: n.number,
|
|
396
|
+
topView: n.oneOf(["month", "year", "decade", "century"]),
|
|
397
|
+
value: n.oneOfType([
|
|
398
|
+
I(n.instanceOf(Date)),
|
|
399
|
+
n.arrayOf(n.instanceOf(Date)),
|
|
400
|
+
n.shape({
|
|
401
|
+
start: I(n.instanceOf(Date).isRequired),
|
|
402
|
+
end: I(n.instanceOf(Date).isRequired)
|
|
424
403
|
})
|
|
425
404
|
]),
|
|
426
|
-
views: (
|
|
427
|
-
const
|
|
428
|
-
return
|
|
429
|
-
`Invalid prop '${
|
|
405
|
+
views: (c, d, p) => {
|
|
406
|
+
const k = c[d];
|
|
407
|
+
return k !== void 0 && k < 1 ? new Error(
|
|
408
|
+
`Invalid prop '${d}' supplied to'${p}'. The '${d}' property cannot be less than 1'`
|
|
430
409
|
) : null;
|
|
431
410
|
},
|
|
432
|
-
weekNumber:
|
|
433
|
-
showOtherMonthDays:
|
|
434
|
-
dir:
|
|
435
|
-
}, u.defaultProps = {
|
|
436
|
-
disabled: !1,
|
|
437
|
-
min: he,
|
|
438
|
-
max: le,
|
|
439
|
-
navigation: !0,
|
|
440
|
-
defaultActiveView: "month",
|
|
441
|
-
defaultValue: null,
|
|
442
|
-
topView: "century",
|
|
443
|
-
weekDaysFormat: "short",
|
|
444
|
-
tabIndex: 0,
|
|
445
|
-
bottomView: "month",
|
|
446
|
-
views: 2,
|
|
447
|
-
allowReverse: !1,
|
|
448
|
-
showOtherMonthDays: !1
|
|
411
|
+
weekNumber: n.bool,
|
|
412
|
+
showOtherMonthDays: n.bool,
|
|
413
|
+
dir: n.string
|
|
449
414
|
};
|
|
450
|
-
|
|
451
|
-
const
|
|
452
|
-
Z(
|
|
453
|
-
me,
|
|
454
|
-
v
|
|
455
|
-
)
|
|
456
|
-
);
|
|
457
|
-
ve.displayName = "KendoReactMultiViewCalendar";
|
|
458
|
-
q(v);
|
|
459
|
-
J(v);
|
|
415
|
+
Z.displayName = "KendoReactMultiViewCalendar";
|
|
416
|
+
const pn = Z, hn = Z;
|
|
460
417
|
export {
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
418
|
+
hn as MultiViewCalendar,
|
|
419
|
+
Zt as MultiViewCalendarPropsContext,
|
|
420
|
+
pn as MultiViewCalendarWithoutContext,
|
|
421
|
+
u as multiViewCalendarDefaultProps
|
|
464
422
|
};
|