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