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