@progress/kendo-react-scheduler 17.1.0-develop.5 → 17.1.0-develop.7
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/Scheduler.js +1 -1
- package/Scheduler.mjs +323 -307
- package/constants/index.js +1 -1
- package/constants/index.mjs +16 -15
- package/dist/cdn/js/kendo-react-scheduler.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +12 -12
- package/recurrence/common.d.ts +23 -0
- package/recurrence/common.js +1 -1
- package/recurrence/common.mjs +131 -73
- package/services/occurrenceService.js +1 -1
- package/services/occurrenceService.mjs +60 -47
package/Scheduler.mjs
CHANGED
|
@@ -7,438 +7,454 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as a from "react";
|
|
9
9
|
import u from "prop-types";
|
|
10
|
-
import { getModelFields as
|
|
11
|
-
import { validatePackage as st, getLicenseMessage as
|
|
12
|
-
import { SchedulerContext as
|
|
13
|
-
import { useControlledState as
|
|
14
|
-
import { useInternationalization as
|
|
15
|
-
import { SchedulerHeader as
|
|
16
|
-
import { SchedulerNavigation as
|
|
17
|
-
import { SchedulerViewSelector as
|
|
18
|
-
import { addMonths as
|
|
19
|
-
import { SchedulerFooter as
|
|
20
|
-
import { Button as
|
|
21
|
-
import { useToolbarResponsive as
|
|
22
|
-
import { today as
|
|
23
|
-
import { NavigationDatePicker as
|
|
24
|
-
import { ViewSelectorList as
|
|
25
|
-
import { SchedulerForm as
|
|
26
|
-
import { DayView as
|
|
27
|
-
import { packageMetadata as
|
|
28
|
-
import { plusIcon as Tt, chevronRightIcon as
|
|
29
|
-
import { DATA_ACTION as
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
10
|
+
import { getModelFields as ot, toSchedulerGroups as ct, getField as r, findMaster as O, setField as d } from "./utils/index.mjs";
|
|
11
|
+
import { validatePackage as st, getLicenseMessage as lt, useWebMcpRegister as it, useRtl as ut, clone as v, classNames as dt, WatermarkOverlay as mt } from "@progress/kendo-react-common";
|
|
12
|
+
import { SchedulerContext as ft } from "./context/SchedulerContext.mjs";
|
|
13
|
+
import { useControlledState as X } from "./hooks/useControlledState.mjs";
|
|
14
|
+
import { useInternationalization as gt, useLocalization as pt } from "@progress/kendo-react-intl";
|
|
15
|
+
import { SchedulerHeader as wt } from "./components/header/SchedulerHeader.mjs";
|
|
16
|
+
import { SchedulerNavigation as ht } from "./components/header/navigation/SchedulerNavigation.mjs";
|
|
17
|
+
import { SchedulerViewSelector as Dt } from "./components/header/view-selector/SchedulerViewSelector.mjs";
|
|
18
|
+
import { addMonths as he, addDays as De, ZonedDate as bt } from "@progress/kendo-date-math";
|
|
19
|
+
import { SchedulerFooter as Et } from "./components/footer/SchedulerFooter.mjs";
|
|
20
|
+
import { Button as B, ButtonGroup as vt, ToolbarSpacer as It } from "@progress/kendo-react-buttons";
|
|
21
|
+
import { useToolbarResponsive as kt } from "./hooks/useToolbarResponsive.mjs";
|
|
22
|
+
import { today as be, messages as H, previousTitle as Ee, nextTitle as ve, editorNewEvent as Ie, toolbarLabel as ke, showFullDay as Se, showWorkDay as xe } from "./messages/index.mjs";
|
|
23
|
+
import { NavigationDatePicker as St } from "./components/header/navigation/NavigationDatePicker.mjs";
|
|
24
|
+
import { ViewSelectorList as xt } from "./components/header/view-selector/ViewSelectorList.mjs";
|
|
25
|
+
import { SchedulerForm as Rt } from "./components/SchedulerForm.mjs";
|
|
26
|
+
import { DayView as $, dayViewDefaultProps as Ct } from "./views/day/DayView.mjs";
|
|
27
|
+
import { packageMetadata as Re } from "./package-metadata.mjs";
|
|
28
|
+
import { plusIcon as Tt, chevronRightIcon as Ce, chevronLeftIcon as Te, clockIcon as yt } from "@progress/kendo-svg-icons";
|
|
29
|
+
import { DATA_ACTION as Y } from "./constants/index.mjs";
|
|
30
|
+
import { isSameRecurrence as Mt, alignRecurrenceRuleToStart as Ft, remapRecurrenceExceptions as Nt } from "./recurrence/common.mjs";
|
|
31
|
+
import { AgendaView as Ot, agendaViewDefaultProps as Vt } from "./views/agenda/AgendaView.mjs";
|
|
32
|
+
import { MonthView as At, monthViewDefaultProps as Lt } from "./views/month/MonthView.mjs";
|
|
33
|
+
import { WeekView as Wt, weekViewDefaultProps as Pt } from "./views/week/WeekView.mjs";
|
|
34
|
+
import { WorkWeekView as Ht, workWeekDefaultProps as zt } from "./views/week/WorkWeekView.mjs";
|
|
35
|
+
import { TimelineView as _t, timeLineViewDefaultProps as Ut } from "./views/time/TimelineView.mjs";
|
|
36
|
+
const Bt = "{0:D}", qt = "{0:d}", Gt = "application", ye = (n, M, F) => n.filter((q) => {
|
|
37
|
+
const k = r(q, M.recurrenceId);
|
|
38
|
+
return k != null && k === F && !r(q, M.recurrenceRule);
|
|
39
|
+
}), Me = (n, M) => {
|
|
40
|
+
const F = v(n);
|
|
41
|
+
return d(F, M.recurrenceId, null), d(F, M.recurrenceRule, null), d(F, M.originalStart, null), F;
|
|
42
|
+
}, V = /* @__PURE__ */ new Map();
|
|
43
|
+
V.set(Ot, Vt);
|
|
44
|
+
V.set($, Ct);
|
|
45
|
+
V.set(At, Lt);
|
|
46
|
+
V.set(Wt, Pt);
|
|
47
|
+
V.set(Ht, zt);
|
|
48
|
+
V.set(_t, Ut);
|
|
49
|
+
const Fe = a.forwardRef((n, M) => {
|
|
50
|
+
var fe, ge, pe, we;
|
|
51
|
+
const F = !st(Re, { component: "Scheduler" }), q = lt(Re), { timezone: k, onDataChange: Z } = n, x = a.useRef(null), T = a.useRef(null);
|
|
52
|
+
a.useImperativeHandle(T, () => ({ props: n, element: x.current })), a.useImperativeHandle(M, () => T.current), it("scheduler", T, n, n.webMcp);
|
|
53
|
+
const z = ut(x), J = gt(), L = pt(), { fields: e } = a.useMemo(() => ot(n.modelFields), [n.modelFields]), [y, R] = X(
|
|
54
|
+
n.defaultDate || C.defaultDate,
|
|
55
|
+
n.date,
|
|
56
|
+
n.onDateChange
|
|
57
|
+
), _ = a.Children.toArray(n.children || []).map(
|
|
57
58
|
(t) => {
|
|
58
|
-
var
|
|
59
|
-
return a.isValidElement(t) ? a.cloneElement(t, { ...
|
|
59
|
+
var i;
|
|
60
|
+
return a.isValidElement(t) ? a.cloneElement(t, { ...V.get(t.type), ...(i = t.props) != null ? i : {} }) : t;
|
|
60
61
|
}
|
|
61
|
-
),
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
),
|
|
66
|
-
(
|
|
67
|
-
|
|
68
|
-
),
|
|
69
|
-
intl:
|
|
70
|
-
date:
|
|
71
|
-
timezone:
|
|
72
|
-
numberOfDays:
|
|
73
|
-
workWeekStart:
|
|
74
|
-
workWeekEnd:
|
|
75
|
-
}) :
|
|
62
|
+
), Ne = a.cloneElement(/* @__PURE__ */ a.createElement($, null), V.get($)), [W, ee] = X(
|
|
63
|
+
n.defaultView || _[0] && _[0].props.name || "day",
|
|
64
|
+
n.view,
|
|
65
|
+
n.onViewChange
|
|
66
|
+
), f = _.find((t) => t.props.name === W) || _[0] || Ne, te = f.props, [U, re] = X(
|
|
67
|
+
(fe = te.defaultShowWorkHours) != null ? fe : !0,
|
|
68
|
+
te.showWorkHours
|
|
69
|
+
), D = ((ge = n.data) != null ? ge : C.data) || C.data, Oe = ct(n.group, n.resources), Ve = n.group && n.group.orientation ? n.group.orientation : "horizontal", Ae = f.props.selectedDateFormat || Bt, Le = f.props.selectedShortDateFormat || qt, G = f.props.slotDuration, We = f.props.dateRange !== void 0 ? typeof f.props.dateRange == "function" ? f.props.dateRange.call(void 0, {
|
|
70
|
+
intl: J,
|
|
71
|
+
date: y,
|
|
72
|
+
timezone: k,
|
|
73
|
+
numberOfDays: f.props.numberOfDays,
|
|
74
|
+
workWeekStart: f.props.workWeekStart || J.firstDay(),
|
|
75
|
+
workWeekEnd: f.props.workWeekEnd || (J.firstDay() + f.props.numberOfDays) % 6
|
|
76
|
+
}) : f.props.dateRange : { start: C.defaultDate, end: C.defaultDate }, N = a.useCallback(
|
|
76
77
|
({
|
|
77
78
|
created: t = [],
|
|
78
|
-
updated:
|
|
79
|
+
updated: i = [],
|
|
79
80
|
deleted: g = []
|
|
80
81
|
}) => {
|
|
81
|
-
if (
|
|
82
|
-
const
|
|
82
|
+
if (Z) {
|
|
83
|
+
const h = {
|
|
83
84
|
created: t,
|
|
84
|
-
updated:
|
|
85
|
+
updated: i,
|
|
85
86
|
deleted: g
|
|
86
87
|
};
|
|
87
|
-
|
|
88
|
+
Z.call(void 0, h);
|
|
88
89
|
}
|
|
89
90
|
},
|
|
90
|
-
[
|
|
91
|
-
),
|
|
91
|
+
[Z]
|
|
92
|
+
), ne = a.useCallback(
|
|
92
93
|
(t) => {
|
|
93
|
-
const
|
|
94
|
-
|
|
94
|
+
const i = [t.dataItem];
|
|
95
|
+
N({ created: i });
|
|
95
96
|
},
|
|
96
|
-
[
|
|
97
|
-
),
|
|
97
|
+
[N]
|
|
98
|
+
), ae = a.useCallback(
|
|
98
99
|
(t) => {
|
|
99
|
-
const
|
|
100
|
+
const i = [], g = [], h = [], p = (o, s, l) => {
|
|
101
|
+
const c = r(o, e.recurrenceRule);
|
|
102
|
+
c && d(
|
|
103
|
+
o,
|
|
104
|
+
e.recurrenceRule,
|
|
105
|
+
Ft(c, s, l, k)
|
|
106
|
+
);
|
|
107
|
+
}, b = (o, s, l, c) => {
|
|
108
|
+
const m = r(o, e.recurrenceRule);
|
|
109
|
+
return m && m !== c ? Nt(
|
|
110
|
+
s,
|
|
111
|
+
m,
|
|
112
|
+
new Date(r(o, e.start)),
|
|
113
|
+
new Date(r(o, e.end)),
|
|
114
|
+
l,
|
|
115
|
+
k
|
|
116
|
+
) : s.map((w) => new Date(new Date(w).getTime() + l));
|
|
117
|
+
};
|
|
100
118
|
if (t.series)
|
|
101
119
|
if (Array.isArray(t.dataItem)) {
|
|
102
120
|
const o = t.dataItem[0];
|
|
103
|
-
if (
|
|
104
|
-
const l =
|
|
105
|
-
d(l, e.start, new Date(
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
g.push(l);
|
|
121
|
+
if (r(o, e.recurrenceId) !== null && r(o, e.recurrenceId) !== void 0) {
|
|
122
|
+
const l = v(O(o, e, D)), c = new Date(r(o, e.originalStart)).getTime(), m = new Date(r(o, e.start)).getTime(), w = new Date(r(o, e.end)).getTime(), E = m - c, S = w - m, I = new Date(r(l, e.start)).getTime();
|
|
123
|
+
d(l, e.start, new Date(I + E)), d(l, e.end, new Date(I + E + S));
|
|
124
|
+
const P = r(l, e.recurrenceRule);
|
|
125
|
+
p(l, new Date(c), new Date(m));
|
|
126
|
+
const K = r(l, e.recurrenceExceptions) || [];
|
|
127
|
+
K.length > 0 && E !== 0 && d(
|
|
128
|
+
l,
|
|
129
|
+
e.recurrenceExceptions,
|
|
130
|
+
b(l, K, E, P)
|
|
131
|
+
), g.push(l);
|
|
114
132
|
} else
|
|
115
133
|
t.dataItem.forEach((l) => {
|
|
116
|
-
const
|
|
117
|
-
d(
|
|
118
|
-
const
|
|
119
|
-
if (
|
|
120
|
-
const
|
|
121
|
-
(
|
|
134
|
+
const c = v(O(l, e, D)), m = v(l);
|
|
135
|
+
d(m, e.originalStart, r(c, e.originalStart)), d(m, e.recurrenceId, r(c, e.recurrenceId));
|
|
136
|
+
const w = r(c, e.recurrenceExceptions) || [], E = new Date(r(c, e.start)).getTime(), I = new Date(r(m, e.start)).getTime() - E;
|
|
137
|
+
if (w.length > 0 && I !== 0) {
|
|
138
|
+
const P = w.map(
|
|
139
|
+
(K) => new Date(new Date(K).getTime() + I)
|
|
122
140
|
);
|
|
123
|
-
d(
|
|
141
|
+
d(m, e.recurrenceExceptions, P);
|
|
124
142
|
} else
|
|
125
|
-
d(
|
|
126
|
-
g.push(
|
|
143
|
+
d(m, e.recurrenceExceptions, w);
|
|
144
|
+
g.push(m);
|
|
127
145
|
});
|
|
128
|
-
} else if (
|
|
129
|
-
const s =
|
|
130
|
-
d(s, e.start, new Date(S +
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
g.push(s);
|
|
146
|
+
} else if (r(t.dataItem, e.recurrenceId) !== null && r(t.dataItem, e.recurrenceId) !== void 0) {
|
|
147
|
+
const s = v(O(t.dataItem, e, D)), l = new Date(r(t.dataItem, e.originalStart)).getTime(), c = new Date(r(t.dataItem, e.start)).getTime(), m = new Date(r(t.dataItem, e.end)).getTime(), w = c - l, E = m - c, S = new Date(r(s, e.start)).getTime();
|
|
148
|
+
d(s, e.start, new Date(S + w)), d(s, e.end, new Date(S + w + E));
|
|
149
|
+
const I = r(s, e.recurrenceRule);
|
|
150
|
+
p(s, new Date(l), new Date(c));
|
|
151
|
+
const P = r(s, e.recurrenceExceptions) || [];
|
|
152
|
+
P.length > 0 && w !== 0 && d(
|
|
153
|
+
s,
|
|
154
|
+
e.recurrenceExceptions,
|
|
155
|
+
b(s, P, w, I)
|
|
156
|
+
), g.push(s);
|
|
139
157
|
} else {
|
|
140
|
-
const s =
|
|
141
|
-
if (
|
|
142
|
-
const
|
|
143
|
-
d(s, e.originalStart,
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
)
|
|
149
|
-
|
|
150
|
-
} else
|
|
151
|
-
d(s, e.recurrenceExceptions, f);
|
|
158
|
+
const s = v(t.dataItem), l = r(s, e.recurrenceRule);
|
|
159
|
+
if (l) {
|
|
160
|
+
const c = v(O(t.dataItem, e, D));
|
|
161
|
+
d(s, e.originalStart, r(c, e.originalStart)), d(s, e.recurrenceId, r(c, e.recurrenceId));
|
|
162
|
+
const m = r(c, e.recurrenceExceptions) || [], w = new Date(r(c, e.start)).getTime(), E = new Date(r(s, e.start)).getTime(), S = E - w, I = l;
|
|
163
|
+
Mt(l, r(c, e.recurrenceRule), k) && p(s, new Date(w), new Date(E)), m.length > 0 && S !== 0 ? d(
|
|
164
|
+
s,
|
|
165
|
+
e.recurrenceExceptions,
|
|
166
|
+
b(s, m, S, I)
|
|
167
|
+
) : d(s, e.recurrenceExceptions, m);
|
|
152
168
|
} else if (d(s, e.recurrenceExceptions, null), !t.resetExceptions) {
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
g.push(
|
|
169
|
+
const c = r(s, e.id);
|
|
170
|
+
ye(D, e, c).forEach((m) => {
|
|
171
|
+
g.push(Me(m, e));
|
|
156
172
|
});
|
|
157
173
|
}
|
|
158
174
|
g.push(s);
|
|
159
175
|
}
|
|
160
176
|
else if (Array.isArray(t.dataItem))
|
|
161
177
|
t.dataItem.forEach((o) => {
|
|
162
|
-
const s =
|
|
163
|
-
if (
|
|
164
|
-
const
|
|
165
|
-
d(
|
|
178
|
+
const s = r(o, e.recurrenceRule) !== null && r(o, e.recurrenceRule) !== void 0;
|
|
179
|
+
if (r(o, e.recurrenceId) !== null && r(o, e.recurrenceId) !== void 0 && s) {
|
|
180
|
+
const c = v(O(o, e, D)), m = r(o, e.originalStart), w = r(c, e.recurrenceExceptions) || [];
|
|
181
|
+
d(c, e.recurrenceExceptions, [...w, m]), d(o, e.recurrenceRule, null), g.push(c), i.push(o);
|
|
166
182
|
} else
|
|
167
183
|
g.push(o);
|
|
168
184
|
});
|
|
169
185
|
else {
|
|
170
|
-
const o =
|
|
171
|
-
if (
|
|
172
|
-
const l =
|
|
173
|
-
d(l, e.recurrenceExceptions, [...
|
|
186
|
+
const o = r(t.dataItem, e.recurrenceRule) !== null && r(t.dataItem, e.recurrenceRule) !== void 0;
|
|
187
|
+
if (r(t.dataItem, e.recurrenceId) !== null && r(t.dataItem, e.recurrenceId) !== void 0 && o) {
|
|
188
|
+
const l = v(O(t.dataItem, e, D)), c = r(t.dataItem, e.originalStart), m = r(l, e.recurrenceExceptions) || [];
|
|
189
|
+
d(l, e.recurrenceExceptions, [...m, c]), d(t.dataItem, e.recurrenceRule, null), g.push(l), i.push(t.dataItem);
|
|
174
190
|
} else
|
|
175
191
|
g.push(t.dataItem);
|
|
176
192
|
}
|
|
177
193
|
if (t.series && t.resetExceptions) {
|
|
178
|
-
const o = Array.isArray(t.dataItem) ? t.dataItem[0] : t.dataItem, s = o &&
|
|
179
|
-
l != null && (
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
}), g.forEach((
|
|
183
|
-
|
|
194
|
+
const o = Array.isArray(t.dataItem) ? t.dataItem[0] : t.dataItem, s = o && r(o, e.recurrenceId), l = s != null ? s : o && r(o, e.id);
|
|
195
|
+
l != null && (D.forEach((c) => {
|
|
196
|
+
const m = r(c, e.recurrenceId), w = r(c, e.recurrenceRule);
|
|
197
|
+
m === l && !w && h.push(v(c));
|
|
198
|
+
}), g.forEach((c) => {
|
|
199
|
+
r(c, e.id) === l && d(c, e.recurrenceExceptions, null);
|
|
184
200
|
}));
|
|
185
201
|
}
|
|
186
|
-
|
|
202
|
+
N({ updated: g, created: i, deleted: h });
|
|
187
203
|
},
|
|
188
|
-
[
|
|
189
|
-
),
|
|
204
|
+
[N, e, D, k]
|
|
205
|
+
), oe = a.useCallback(
|
|
190
206
|
(t) => {
|
|
191
|
-
const
|
|
207
|
+
const i = [], g = [];
|
|
192
208
|
if (t.series) {
|
|
193
|
-
const
|
|
194
|
-
d(
|
|
195
|
-
const
|
|
196
|
-
t.resetExceptions ?
|
|
197
|
-
} else if (!(
|
|
209
|
+
const h = v(O(t.dataItem, e, D)), p = v(t.dataItem);
|
|
210
|
+
d(p, e.originalStart, r(h, e.originalStart)), d(p, e.recurrenceId, r(h, e.recurrenceId)), d(p, e.recurrenceRule, r(h, e.recurrenceRule)), d(p, e.recurrenceExceptions, r(h, e.recurrenceExceptions)), g.push(p);
|
|
211
|
+
const b = r(h, e.id), o = ye(D, e, b);
|
|
212
|
+
t.resetExceptions ? o.forEach((s) => g.push(v(s))) : o.forEach((s) => i.push(Me(s, e)));
|
|
213
|
+
} else if (!(r(t.dataItem, e.recurrenceRule) !== null && r(t.dataItem, e.recurrenceRule) !== void 0))
|
|
198
214
|
g.push(t.dataItem);
|
|
199
215
|
else {
|
|
200
|
-
const
|
|
201
|
-
d(
|
|
216
|
+
const p = v(O(t.dataItem, e, D)), b = r(t.dataItem, e.originalStart), o = r(p, e.recurrenceExceptions) || [];
|
|
217
|
+
d(p, e.recurrenceExceptions, [...o, b]), d(t.dataItem, e.recurrenceRule, null), i.push(p);
|
|
202
218
|
}
|
|
203
|
-
|
|
219
|
+
N({ updated: i, deleted: g });
|
|
204
220
|
},
|
|
205
|
-
[
|
|
206
|
-
),
|
|
221
|
+
[N, e, D]
|
|
222
|
+
), ce = a.useCallback(
|
|
207
223
|
(t) => {
|
|
208
224
|
switch (t.type) {
|
|
209
|
-
case
|
|
210
|
-
|
|
225
|
+
case Y.create:
|
|
226
|
+
ne(t);
|
|
211
227
|
break;
|
|
212
|
-
case
|
|
213
|
-
|
|
228
|
+
case Y.update:
|
|
229
|
+
ae(t);
|
|
214
230
|
break;
|
|
215
|
-
case
|
|
216
|
-
|
|
231
|
+
case Y.remove:
|
|
232
|
+
oe(t);
|
|
217
233
|
break;
|
|
218
234
|
}
|
|
219
235
|
},
|
|
220
|
-
[
|
|
221
|
-
),
|
|
222
|
-
(t,
|
|
223
|
-
|
|
224
|
-
...
|
|
225
|
-
target:
|
|
236
|
+
[ne, oe, ae]
|
|
237
|
+
), Pe = a.useCallback(
|
|
238
|
+
(t, i) => {
|
|
239
|
+
ee(t, {
|
|
240
|
+
...i,
|
|
241
|
+
target: T.current
|
|
226
242
|
});
|
|
227
243
|
},
|
|
228
|
-
[
|
|
229
|
-
),
|
|
230
|
-
(t,
|
|
231
|
-
|
|
232
|
-
...
|
|
233
|
-
target:
|
|
244
|
+
[ee, T]
|
|
245
|
+
), He = a.useCallback(
|
|
246
|
+
(t, i) => {
|
|
247
|
+
R(t, {
|
|
248
|
+
...i,
|
|
249
|
+
target: T.current
|
|
234
250
|
});
|
|
235
251
|
},
|
|
236
|
-
[
|
|
237
|
-
),
|
|
252
|
+
[R, T]
|
|
253
|
+
), ze = a.useCallback(
|
|
238
254
|
(t) => {
|
|
239
|
-
t.value &&
|
|
255
|
+
t.value && R(t.value, {
|
|
240
256
|
...t,
|
|
241
|
-
target:
|
|
257
|
+
target: T.current,
|
|
242
258
|
nativeEvent: t.nativeEvent
|
|
243
259
|
});
|
|
244
260
|
},
|
|
245
|
-
[
|
|
246
|
-
),
|
|
261
|
+
[R, T]
|
|
262
|
+
), _e = a.useCallback(
|
|
247
263
|
(t) => {
|
|
248
|
-
var
|
|
264
|
+
var p, b;
|
|
249
265
|
t.preventDefault();
|
|
250
|
-
const
|
|
251
|
-
|
|
266
|
+
const i = (b = (p = f.props.step) != null ? p : f.props.numberOfDays) != null ? b : 1, h = i > 27 ? he(y, Math.round(i / 27)) : De(y, i);
|
|
267
|
+
R(h, t);
|
|
252
268
|
},
|
|
253
|
-
[
|
|
254
|
-
),
|
|
269
|
+
[y, R, f.props.numberOfDays, f.props.step]
|
|
270
|
+
), Ue = a.useCallback(
|
|
255
271
|
(t) => {
|
|
256
|
-
var
|
|
272
|
+
var p, b;
|
|
257
273
|
t.preventDefault();
|
|
258
|
-
const
|
|
259
|
-
|
|
274
|
+
const i = (b = (p = f.props.step) != null ? p : f.props.numberOfDays) != null ? b : 1, h = i > 27 ? he(y, -Math.round(i / 27)) : De(y, -i);
|
|
275
|
+
R(h, t);
|
|
260
276
|
},
|
|
261
|
-
[
|
|
262
|
-
),
|
|
277
|
+
[y, R, f.props.numberOfDays, f.props.step]
|
|
278
|
+
), Be = a.useCallback(
|
|
263
279
|
(t) => {
|
|
264
280
|
t.preventDefault();
|
|
265
|
-
const
|
|
266
|
-
|
|
281
|
+
const i = bt.fromLocalDate(/* @__PURE__ */ new Date(), k);
|
|
282
|
+
R(new Date(i.getTime()), t);
|
|
267
283
|
},
|
|
268
|
-
[
|
|
269
|
-
),
|
|
270
|
-
|
|
271
|
-
}, [
|
|
272
|
-
|
|
273
|
-
}, [
|
|
274
|
-
|
|
275
|
-
}, [
|
|
284
|
+
[R, k]
|
|
285
|
+
), qe = a.useCallback(() => {
|
|
286
|
+
re(!U);
|
|
287
|
+
}, [re, U]), Ge = a.useCallback(() => {
|
|
288
|
+
x.current && (x.current.style.boxShadow = "0 0.5px 0.5px 0.5px rgba(0, 0, 0, .12)");
|
|
289
|
+
}, [x]), je = a.useCallback(() => {
|
|
290
|
+
x.current && (x.current.style.boxShadow = "");
|
|
291
|
+
}, [x]), Ke = a.useMemo(
|
|
276
292
|
() => {
|
|
277
293
|
var t;
|
|
278
|
-
return { ...
|
|
294
|
+
return { ...n.style, height: (t = n.height) != null ? t : C.height };
|
|
279
295
|
},
|
|
280
|
-
[
|
|
281
|
-
),
|
|
282
|
-
() =>
|
|
283
|
-
{ "k-rtl":
|
|
296
|
+
[n.height, n.style]
|
|
297
|
+
), Ze = a.useMemo(
|
|
298
|
+
() => dt(
|
|
299
|
+
{ "k-rtl": n.rtl !== void 0 ? n.rtl : z === "rtl" },
|
|
284
300
|
"k-scheduler",
|
|
285
|
-
|
|
301
|
+
n.className
|
|
286
302
|
),
|
|
287
|
-
[
|
|
288
|
-
),
|
|
303
|
+
[n.className, n.rtl, z]
|
|
304
|
+
), Je = L.toLanguageString(be, H[be]), se = L.toLanguageString(Ee, H[Ee]), le = L.toLanguageString(ve, H[ve]), ie = L.toLanguageString(Ie, H[Ie]), ue = L.toLanguageString(ke, H[ke]), de = a.useRef(null), A = kt(de), Qe = f.props.header || n.header || C.header, Xe = f.props.footer || n.footer || C.footer, Ye = f.props.form || n.form || Rt, [Q, $e] = a.useState(null), [me, j] = a.useState(null), et = a.useCallback(
|
|
289
305
|
(t) => {
|
|
290
306
|
t.preventDefault();
|
|
291
|
-
const
|
|
292
|
-
let
|
|
293
|
-
|
|
294
|
-
const
|
|
295
|
-
const
|
|
296
|
-
return !
|
|
307
|
+
const i = /* @__PURE__ */ new Date(), g = G || 30, h = g * 60 * 1e3, p = i.getMinutes(), b = Math.ceil(p / g) * g;
|
|
308
|
+
let o = new Date(i);
|
|
309
|
+
o.setHours(i.getHours() + Math.floor(b / 60), b % 60, 0, 0);
|
|
310
|
+
const s = (m, w) => D.some((E) => {
|
|
311
|
+
const S = r(E, e.start), I = r(E, e.end);
|
|
312
|
+
return !S || !I ? !1 : S.getTime() < w.getTime() && I.getTime() > m.getTime();
|
|
297
313
|
});
|
|
298
|
-
let
|
|
299
|
-
for (let
|
|
300
|
-
|
|
301
|
-
const
|
|
302
|
-
d(
|
|
314
|
+
let l = new Date(o.getTime() + h);
|
|
315
|
+
for (let m = 0; m < 48 && s(o, l); m++)
|
|
316
|
+
o = new Date(o.getTime() + h), l = new Date(o.getTime() + h);
|
|
317
|
+
const c = {};
|
|
318
|
+
d(c, e.start, o), d(c, e.end, l), d(c, e.isAllDay, !1), d(c, e.title, ""), d(c, e.description, ""), j(c);
|
|
303
319
|
},
|
|
304
|
-
[
|
|
305
|
-
),
|
|
320
|
+
[D, e, G]
|
|
321
|
+
), tt = a.useCallback(
|
|
306
322
|
(t) => {
|
|
307
|
-
t.value &&
|
|
323
|
+
t.value && N({ created: [t.value] }), j(null);
|
|
308
324
|
},
|
|
309
|
-
[
|
|
310
|
-
),
|
|
311
|
-
|
|
312
|
-
}, []),
|
|
313
|
-
|
|
314
|
-
}, []),
|
|
325
|
+
[N]
|
|
326
|
+
), rt = a.useCallback((t) => {
|
|
327
|
+
j(null);
|
|
328
|
+
}, []), nt = a.useCallback((t) => {
|
|
329
|
+
j(null);
|
|
330
|
+
}, []), at = typeof n.editable == "object" ? n.editable.add : !!n.editable;
|
|
315
331
|
return /* @__PURE__ */ a.createElement(
|
|
316
|
-
|
|
332
|
+
ft,
|
|
317
333
|
{
|
|
318
|
-
element:
|
|
319
|
-
props:
|
|
320
|
-
views:
|
|
334
|
+
element: x,
|
|
335
|
+
props: n,
|
|
336
|
+
views: _,
|
|
321
337
|
fields: e,
|
|
322
|
-
groups:
|
|
323
|
-
dateRange:
|
|
324
|
-
orientation:
|
|
325
|
-
dateFormat: { dateFormat:
|
|
326
|
-
date: [
|
|
327
|
-
activeView: [W,
|
|
328
|
-
selection: [
|
|
329
|
-
data: [
|
|
338
|
+
groups: Oe,
|
|
339
|
+
dateRange: We,
|
|
340
|
+
orientation: Ve,
|
|
341
|
+
dateFormat: { dateFormat: Ae, shortDateFormat: Le },
|
|
342
|
+
date: [y, He],
|
|
343
|
+
activeView: [W, Pe],
|
|
344
|
+
selection: [Q, $e],
|
|
345
|
+
data: [D, ce]
|
|
330
346
|
},
|
|
331
347
|
/* @__PURE__ */ a.createElement(
|
|
332
348
|
"div",
|
|
333
349
|
{
|
|
334
|
-
ref:
|
|
335
|
-
id:
|
|
336
|
-
style:
|
|
337
|
-
className:
|
|
338
|
-
tabIndex: (
|
|
339
|
-
dir:
|
|
340
|
-
role:
|
|
341
|
-
"aria-label":
|
|
342
|
-
"aria-labelledby":
|
|
343
|
-
"aria-activedescendant":
|
|
344
|
-
onFocus:
|
|
345
|
-
onBlur:
|
|
350
|
+
ref: x,
|
|
351
|
+
id: n.id,
|
|
352
|
+
style: Ke,
|
|
353
|
+
className: Ze,
|
|
354
|
+
tabIndex: (pe = n.tabIndex) != null ? pe : C.tabIndex,
|
|
355
|
+
dir: z,
|
|
356
|
+
role: n.role || Gt,
|
|
357
|
+
"aria-label": n.ariaLabel,
|
|
358
|
+
"aria-labelledby": n.ariaLabelledby,
|
|
359
|
+
"aria-activedescendant": Q && Q.props.id || void 0,
|
|
360
|
+
onFocus: Ge,
|
|
361
|
+
onBlur: je
|
|
346
362
|
},
|
|
347
363
|
/* @__PURE__ */ a.createElement(
|
|
348
|
-
|
|
364
|
+
Qe,
|
|
349
365
|
{
|
|
350
366
|
ref: (t) => {
|
|
351
|
-
var
|
|
352
|
-
|
|
367
|
+
var i;
|
|
368
|
+
de.current = (i = t == null ? void 0 : t.element) != null ? i : null;
|
|
353
369
|
},
|
|
354
|
-
ariaLabel:
|
|
370
|
+
ariaLabel: ue,
|
|
355
371
|
style: { flexWrap: A < 3 ? "nowrap" : "wrap" }
|
|
356
372
|
},
|
|
357
|
-
|
|
358
|
-
|
|
373
|
+
at && /* @__PURE__ */ a.createElement(
|
|
374
|
+
B,
|
|
359
375
|
{
|
|
360
376
|
className: "k-toolbar-button",
|
|
361
377
|
themeColor: "primary",
|
|
362
378
|
svgIcon: Tt,
|
|
363
|
-
"aria-label":
|
|
379
|
+
"aria-label": ie,
|
|
364
380
|
tabIndex: -1,
|
|
365
|
-
onClick:
|
|
381
|
+
onClick: et
|
|
366
382
|
},
|
|
367
|
-
A < 2 &&
|
|
383
|
+
A < 2 && ie
|
|
368
384
|
),
|
|
369
|
-
A < 2 && /* @__PURE__ */ a.createElement(
|
|
370
|
-
A < 3 && /* @__PURE__ */ a.createElement(
|
|
371
|
-
|
|
385
|
+
A < 2 && /* @__PURE__ */ a.createElement(B, { className: "k-toolbar-button", fillMode: "flat", tabIndex: -1, onClick: Be }, Je),
|
|
386
|
+
A < 3 && /* @__PURE__ */ a.createElement(vt, { className: "k-button-group-flat k-toolbar-button-group" }, /* @__PURE__ */ a.createElement(
|
|
387
|
+
B,
|
|
372
388
|
{
|
|
373
389
|
fillMode: "flat",
|
|
374
390
|
tabIndex: -1,
|
|
375
|
-
svgIcon:
|
|
376
|
-
"aria-label":
|
|
377
|
-
title:
|
|
378
|
-
onClick:
|
|
391
|
+
svgIcon: z === "rtl" ? Ce : Te,
|
|
392
|
+
"aria-label": se,
|
|
393
|
+
title: se,
|
|
394
|
+
onClick: Ue
|
|
379
395
|
}
|
|
380
396
|
), /* @__PURE__ */ a.createElement(
|
|
381
|
-
|
|
397
|
+
B,
|
|
382
398
|
{
|
|
383
399
|
fillMode: "flat",
|
|
384
400
|
tabIndex: -1,
|
|
385
|
-
svgIcon:
|
|
386
|
-
"aria-label":
|
|
387
|
-
title:
|
|
388
|
-
onClick:
|
|
401
|
+
svgIcon: z === "rtl" ? Te : Ce,
|
|
402
|
+
"aria-label": le,
|
|
403
|
+
title: le,
|
|
404
|
+
onClick: _e
|
|
389
405
|
}
|
|
390
406
|
)),
|
|
391
|
-
/* @__PURE__ */ a.createElement(
|
|
407
|
+
/* @__PURE__ */ a.createElement(St, { value: y, onChange: ze, level: A }),
|
|
392
408
|
/* @__PURE__ */ a.createElement(It, null),
|
|
393
409
|
A === 1 && /* @__PURE__ */ a.createElement("span", { className: "k-separator" }),
|
|
394
|
-
/* @__PURE__ */ a.createElement(
|
|
410
|
+
/* @__PURE__ */ a.createElement(xt, { level: A })
|
|
395
411
|
),
|
|
396
|
-
|
|
397
|
-
|
|
412
|
+
f && /* @__PURE__ */ a.createElement(
|
|
413
|
+
f.type,
|
|
398
414
|
{
|
|
399
|
-
editable: (
|
|
400
|
-
key:
|
|
401
|
-
item:
|
|
402
|
-
viewItem:
|
|
403
|
-
editItem:
|
|
404
|
-
task:
|
|
405
|
-
viewTask:
|
|
406
|
-
editTask:
|
|
407
|
-
slot:
|
|
408
|
-
viewSlot:
|
|
409
|
-
editSlot:
|
|
410
|
-
form:
|
|
411
|
-
onDataAction:
|
|
412
|
-
showWorkHours:
|
|
413
|
-
...
|
|
415
|
+
editable: (we = n.editable) != null ? we : C.editable,
|
|
416
|
+
key: f.props.name,
|
|
417
|
+
item: n.item,
|
|
418
|
+
viewItem: n.viewItem,
|
|
419
|
+
editItem: n.editItem,
|
|
420
|
+
task: n.task,
|
|
421
|
+
viewTask: n.viewTask,
|
|
422
|
+
editTask: n.viewTask,
|
|
423
|
+
slot: n.slot,
|
|
424
|
+
viewSlot: n.viewSlot,
|
|
425
|
+
editSlot: n.editSlot,
|
|
426
|
+
form: n.form,
|
|
427
|
+
onDataAction: ce,
|
|
428
|
+
showWorkHours: U,
|
|
429
|
+
...f.props
|
|
414
430
|
}
|
|
415
431
|
),
|
|
416
|
-
(
|
|
417
|
-
|
|
432
|
+
(f.props.footer || n.footer || W !== "agenda" && W !== "month") && /* @__PURE__ */ a.createElement(Xe, { ariaLabel: ue }, W !== "agenda" && W !== "month" && G && G < 1440 && /* @__PURE__ */ a.createElement(
|
|
433
|
+
B,
|
|
418
434
|
{
|
|
419
435
|
className: "k-toolbar-button k-scheduler-fullday",
|
|
420
436
|
tabIndex: -1,
|
|
421
|
-
onClick:
|
|
437
|
+
onClick: qe,
|
|
422
438
|
svgIcon: yt
|
|
423
439
|
},
|
|
424
440
|
L.toLanguageString(
|
|
425
|
-
|
|
426
|
-
|
|
441
|
+
U ? Se : xe,
|
|
442
|
+
H[U ? Se : xe]
|
|
427
443
|
)
|
|
428
444
|
)),
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
445
|
+
F && /* @__PURE__ */ a.createElement(mt, { message: q }),
|
|
446
|
+
me && /* @__PURE__ */ a.createElement(
|
|
447
|
+
Ye,
|
|
432
448
|
{
|
|
433
|
-
dataItem:
|
|
434
|
-
onSubmit:
|
|
435
|
-
onCancel:
|
|
436
|
-
onClose:
|
|
449
|
+
dataItem: me,
|
|
450
|
+
onSubmit: tt,
|
|
451
|
+
onCancel: rt,
|
|
452
|
+
onClose: nt
|
|
437
453
|
}
|
|
438
454
|
)
|
|
439
455
|
)
|
|
440
456
|
);
|
|
441
|
-
}),
|
|
457
|
+
}), C = {
|
|
442
458
|
data: [],
|
|
443
459
|
height: 600,
|
|
444
460
|
tabIndex: -1,
|
|
@@ -446,12 +462,12 @@ const Re = a.forwardRef((r, y) => {
|
|
|
446
462
|
quickCreate: !0,
|
|
447
463
|
eventOverview: !0,
|
|
448
464
|
defaultDate: /* @__PURE__ */ new Date(),
|
|
449
|
-
header:
|
|
450
|
-
footer:
|
|
451
|
-
navigation:
|
|
452
|
-
viewSelector:
|
|
465
|
+
header: wt,
|
|
466
|
+
footer: Et,
|
|
467
|
+
navigation: ht,
|
|
468
|
+
viewSelector: Dt
|
|
453
469
|
};
|
|
454
|
-
|
|
470
|
+
Fe.propTypes = {
|
|
455
471
|
data: u.array,
|
|
456
472
|
editable: u.oneOfType([
|
|
457
473
|
u.bool,
|
|
@@ -489,8 +505,8 @@ Re.propTypes = {
|
|
|
489
505
|
recurrenceException: u.string
|
|
490
506
|
})
|
|
491
507
|
};
|
|
492
|
-
|
|
508
|
+
Fe.displayName = "KendoReactScheduler";
|
|
493
509
|
export {
|
|
494
|
-
|
|
495
|
-
|
|
510
|
+
Fe as Scheduler,
|
|
511
|
+
C as schedulerDefaultProps
|
|
496
512
|
};
|