@progress/kendo-react-scheduler 16.1.0-develop.7 → 16.1.0-develop.9
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 +199 -191
- package/components/BaseView.d.ts +1 -0
- package/components/BaseView.js +1 -1
- package/components/BaseView.mjs +7 -7
- package/components/DateHeaderCell.js +1 -1
- package/components/DateHeaderCell.mjs +5 -5
- 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/useSlotExpand.js +1 -1
- package/hooks/useSlotExpand.mjs +22 -22
- package/items/SchedulerViewItem.d.ts +2 -0
- package/items/SchedulerViewItem.js +1 -1
- package/items/SchedulerViewItem.mjs +118 -116
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +12 -12
- 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/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 +77 -77
- 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 +44 -44
- 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,69 +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 tt, toSchedulerGroups as rt, getField as
|
|
11
|
-
import { validatePackage as
|
|
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
12
|
import { SchedulerContext as it } from "./context/SchedulerContext.mjs";
|
|
13
|
-
import { useControlledState as
|
|
13
|
+
import { useControlledState as K } from "./hooks/useControlledState.mjs";
|
|
14
14
|
import { useInternationalization as ut, useLocalization as dt } from "@progress/kendo-react-intl";
|
|
15
15
|
import { SchedulerHeader as mt } from "./components/header/SchedulerHeader.mjs";
|
|
16
16
|
import { SchedulerNavigation as ft } from "./components/header/navigation/SchedulerNavigation.mjs";
|
|
17
17
|
import { SchedulerViewSelector as gt } from "./components/header/view-selector/SchedulerViewSelector.mjs";
|
|
18
|
-
import { addMonths as
|
|
18
|
+
import { addMonths as me, addDays as fe, ZonedDate as wt } from "@progress/kendo-date-math";
|
|
19
19
|
import { SchedulerFooter as pt } from "./components/footer/SchedulerFooter.mjs";
|
|
20
|
-
import { Button as
|
|
20
|
+
import { Button as P, ButtonGroup as ht, ToolbarSpacer as Dt } from "@progress/kendo-react-buttons";
|
|
21
21
|
import { useToolbarResponsive as bt } from "./hooks/useToolbarResponsive.mjs";
|
|
22
|
-
import { today as
|
|
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
23
|
import { NavigationDatePicker as Et } from "./components/header/navigation/NavigationDatePicker.mjs";
|
|
24
24
|
import { ViewSelectorList as kt } from "./components/header/view-selector/ViewSelectorList.mjs";
|
|
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(
|
|
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,
|
|
62
61
|
Q.showWorkHours
|
|
63
|
-
), h = ((
|
|
64
|
-
intl:
|
|
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,
|
|
65
64
|
date: C,
|
|
66
|
-
timezone:
|
|
67
|
-
numberOfDays:
|
|
68
|
-
workWeekStart:
|
|
69
|
-
workWeekEnd:
|
|
70
|
-
}) :
|
|
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(
|
|
71
70
|
({
|
|
72
71
|
created: t = [],
|
|
73
72
|
updated: c = [],
|
|
@@ -83,34 +82,34 @@ const Ie = r.forwardRef((n, Se) => {
|
|
|
83
82
|
}
|
|
84
83
|
},
|
|
85
84
|
[B]
|
|
86
|
-
), Y =
|
|
85
|
+
), Y = a.useCallback(
|
|
87
86
|
(t) => {
|
|
88
87
|
const c = [t.dataItem];
|
|
89
88
|
T({ created: c });
|
|
90
89
|
},
|
|
91
90
|
[T]
|
|
92
|
-
), $ =
|
|
91
|
+
), $ = a.useCallback(
|
|
93
92
|
(t) => {
|
|
94
93
|
const c = [], f = [];
|
|
95
94
|
if (t.series)
|
|
96
95
|
if (Array.isArray(t.dataItem)) {
|
|
97
96
|
const s = t.dataItem[0];
|
|
98
|
-
if (
|
|
99
|
-
const
|
|
100
|
-
u(
|
|
101
|
-
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) || [];
|
|
102
101
|
if (E.length > 0 && p !== 0) {
|
|
103
102
|
const y = E.map(
|
|
104
|
-
(
|
|
103
|
+
(_) => new Date(new Date(_).getTime() + p)
|
|
105
104
|
);
|
|
106
|
-
u(
|
|
105
|
+
u(m, e.recurrenceExceptions, y);
|
|
107
106
|
}
|
|
108
|
-
f.push(
|
|
107
|
+
f.push(m);
|
|
109
108
|
} else
|
|
110
|
-
t.dataItem.forEach((
|
|
111
|
-
const i = k(R(
|
|
112
|
-
u(g, e.originalStart,
|
|
113
|
-
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;
|
|
114
113
|
if (w.length > 0 && b !== 0) {
|
|
115
114
|
const E = w.map(
|
|
116
115
|
(y) => new Date(new Date(y).getTime() + b)
|
|
@@ -120,10 +119,10 @@ const Ie = r.forwardRef((n, Se) => {
|
|
|
120
119
|
u(g, e.recurrenceExceptions, w);
|
|
121
120
|
f.push(g);
|
|
122
121
|
});
|
|
123
|
-
} else if (
|
|
124
|
-
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();
|
|
125
124
|
u(o, e.start, new Date(D + w)), u(o, e.end, new Date(D + w + p));
|
|
126
|
-
const b =
|
|
125
|
+
const b = n(o, e.recurrenceExceptions) || [];
|
|
127
126
|
if (b.length > 0 && w !== 0) {
|
|
128
127
|
const E = b.map(
|
|
129
128
|
(y) => new Date(new Date(y).getTime() + w)
|
|
@@ -133,10 +132,10 @@ const Ie = r.forwardRef((n, Se) => {
|
|
|
133
132
|
f.push(o);
|
|
134
133
|
} else {
|
|
135
134
|
const o = k(t.dataItem);
|
|
136
|
-
if (
|
|
135
|
+
if (n(o, e.recurrenceRule)) {
|
|
137
136
|
const i = k(R(t.dataItem, e, h));
|
|
138
|
-
u(o, e.originalStart,
|
|
139
|
-
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;
|
|
140
139
|
if (g.length > 0 && D !== 0) {
|
|
141
140
|
const b = g.map(
|
|
142
141
|
(E) => new Date(new Date(E).getTime() + D)
|
|
@@ -150,55 +149,55 @@ const Ie = r.forwardRef((n, Se) => {
|
|
|
150
149
|
}
|
|
151
150
|
else if (Array.isArray(t.dataItem))
|
|
152
151
|
t.dataItem.forEach((s) => {
|
|
153
|
-
const o =
|
|
154
|
-
if (
|
|
155
|
-
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) || [];
|
|
156
155
|
u(i, e.recurrenceExceptions, [...w, g]), u(s, e.recurrenceRule, null), f.push(i), c.push(s);
|
|
157
156
|
} else
|
|
158
157
|
f.push(s);
|
|
159
158
|
});
|
|
160
159
|
else {
|
|
161
|
-
const s =
|
|
162
|
-
if (
|
|
163
|
-
const
|
|
164
|
-
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);
|
|
165
164
|
} else
|
|
166
165
|
f.push(t.dataItem);
|
|
167
166
|
}
|
|
168
167
|
T({ updated: f, created: c });
|
|
169
168
|
},
|
|
170
169
|
[T, e, h]
|
|
171
|
-
), ee =
|
|
170
|
+
), ee = a.useCallback(
|
|
172
171
|
(t) => {
|
|
173
172
|
const c = [], f = [];
|
|
174
173
|
if (t.series) {
|
|
175
174
|
const s = k(R(t.dataItem, e, h)), o = k(t.dataItem);
|
|
176
|
-
u(o, e.originalStart,
|
|
177
|
-
} 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))
|
|
178
177
|
f.push(t.dataItem);
|
|
179
178
|
else {
|
|
180
|
-
const o = k(R(t.dataItem, e, h)),
|
|
181
|
-
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);
|
|
182
181
|
}
|
|
183
182
|
T({ updated: c, deleted: f });
|
|
184
183
|
},
|
|
185
184
|
[T, e, h]
|
|
186
|
-
), te =
|
|
185
|
+
), te = a.useCallback(
|
|
187
186
|
(t) => {
|
|
188
187
|
switch (t.type) {
|
|
189
|
-
case
|
|
188
|
+
case Z.create:
|
|
190
189
|
Y(t);
|
|
191
190
|
break;
|
|
192
|
-
case
|
|
191
|
+
case Z.update:
|
|
193
192
|
$(t);
|
|
194
193
|
break;
|
|
195
|
-
case
|
|
194
|
+
case Z.remove:
|
|
196
195
|
ee(t);
|
|
197
196
|
break;
|
|
198
197
|
}
|
|
199
198
|
},
|
|
200
199
|
[Y, ee, $]
|
|
201
|
-
),
|
|
200
|
+
), Ve = a.useCallback(
|
|
202
201
|
(t, c) => {
|
|
203
202
|
J(t, {
|
|
204
203
|
...c,
|
|
@@ -206,7 +205,7 @@ const Ie = r.forwardRef((n, Se) => {
|
|
|
206
205
|
});
|
|
207
206
|
},
|
|
208
207
|
[J, x]
|
|
209
|
-
),
|
|
208
|
+
), Ae = a.useCallback(
|
|
210
209
|
(t, c) => {
|
|
211
210
|
I(t, {
|
|
212
211
|
...c,
|
|
@@ -214,7 +213,7 @@ const Ie = r.forwardRef((n, Se) => {
|
|
|
214
213
|
});
|
|
215
214
|
},
|
|
216
215
|
[I, x]
|
|
217
|
-
),
|
|
216
|
+
), Le = a.useCallback(
|
|
218
217
|
(t) => {
|
|
219
218
|
t.value && I(t.value, {
|
|
220
219
|
...t,
|
|
@@ -223,185 +222,194 @@ const Ie = r.forwardRef((n, Se) => {
|
|
|
223
222
|
});
|
|
224
223
|
},
|
|
225
224
|
[I, x]
|
|
226
|
-
),
|
|
225
|
+
), We = a.useCallback(
|
|
227
226
|
(t) => {
|
|
228
|
-
var o,
|
|
227
|
+
var o, m;
|
|
229
228
|
t.preventDefault();
|
|
230
|
-
const c = (
|
|
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);
|
|
231
230
|
I(s, t);
|
|
232
231
|
},
|
|
233
|
-
[C, I,
|
|
234
|
-
),
|
|
232
|
+
[C, I, d.props.numberOfDays, d.props.step]
|
|
233
|
+
), Pe = a.useCallback(
|
|
235
234
|
(t) => {
|
|
236
|
-
var o,
|
|
235
|
+
var o, m;
|
|
237
236
|
t.preventDefault();
|
|
238
|
-
const c = (
|
|
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);
|
|
239
238
|
I(s, t);
|
|
240
239
|
},
|
|
241
|
-
[C, I,
|
|
242
|
-
), He =
|
|
240
|
+
[C, I, d.props.numberOfDays, d.props.step]
|
|
241
|
+
), He = a.useCallback(
|
|
243
242
|
(t) => {
|
|
244
243
|
t.preventDefault();
|
|
245
|
-
const c = wt.fromLocalDate(/* @__PURE__ */ new Date(),
|
|
244
|
+
const c = wt.fromLocalDate(/* @__PURE__ */ new Date(), U);
|
|
246
245
|
I(new Date(c.getTime()), t);
|
|
247
246
|
},
|
|
248
|
-
[I,
|
|
249
|
-
),
|
|
250
|
-
X(!
|
|
251
|
-
}, [X,
|
|
247
|
+
[I, U]
|
|
248
|
+
), ze = a.useCallback(() => {
|
|
249
|
+
X(!W);
|
|
250
|
+
}, [X, W]), _e = a.useCallback(() => {
|
|
252
251
|
v.current && (v.current.style.boxShadow = "0 0.5px 0.5px 0.5px rgba(0, 0, 0, .12)");
|
|
253
|
-
}, [v]),
|
|
252
|
+
}, [v]), Ue = a.useCallback(() => {
|
|
254
253
|
v.current && (v.current.style.boxShadow = "");
|
|
255
|
-
}, [v]), Be =
|
|
254
|
+
}, [v]), Be = a.useMemo(
|
|
256
255
|
() => {
|
|
257
256
|
var t;
|
|
258
|
-
return { ...
|
|
257
|
+
return { ...r.style, height: (t = r.height) != null ? t : S.height };
|
|
259
258
|
},
|
|
260
|
-
[
|
|
261
|
-
),
|
|
259
|
+
[r.height, r.style]
|
|
260
|
+
), Ge = a.useMemo(
|
|
262
261
|
() => ct(
|
|
263
|
-
{ "k-rtl":
|
|
262
|
+
{ "k-rtl": r.rtl !== void 0 ? r.rtl : A === "rtl" },
|
|
264
263
|
"k-scheduler",
|
|
265
|
-
|
|
264
|
+
r.className
|
|
266
265
|
),
|
|
267
|
-
[
|
|
268
|
-
),
|
|
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(
|
|
269
268
|
(t) => {
|
|
270
269
|
t.preventDefault();
|
|
271
|
-
const c = /* @__PURE__ */ new Date(), f = H || 30, s = f * 60 * 1e3, o = c.getMinutes(),
|
|
270
|
+
const c = /* @__PURE__ */ new Date(), f = H || 30, s = f * 60 * 1e3, o = c.getMinutes(), m = Math.ceil(o / f) * f;
|
|
272
271
|
let i = new Date(c);
|
|
273
|
-
i.setHours(c.getHours() + Math.floor(
|
|
272
|
+
i.setHours(c.getHours() + Math.floor(m / 60), m % 60, 0, 0);
|
|
274
273
|
const g = (D, b) => h.some((E) => {
|
|
275
|
-
const y =
|
|
276
|
-
return !y || !
|
|
274
|
+
const y = n(E, e.start), _ = n(E, e.end);
|
|
275
|
+
return !y || !_ ? !1 : y.getTime() < b.getTime() && _.getTime() > D.getTime();
|
|
277
276
|
});
|
|
278
277
|
let w = new Date(i.getTime() + s);
|
|
279
278
|
for (let D = 0; D < 48 && g(i, w); D++)
|
|
280
279
|
i = new Date(i.getTime() + s), w = new Date(i.getTime() + s);
|
|
281
280
|
const p = {};
|
|
282
|
-
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);
|
|
283
282
|
},
|
|
284
283
|
[h, e, H]
|
|
285
|
-
), Xe =
|
|
284
|
+
), Xe = a.useCallback(
|
|
286
285
|
(t) => {
|
|
287
|
-
t.value && T({ created: [t.value] }),
|
|
286
|
+
t.value && T({ created: [t.value] }), z(null);
|
|
288
287
|
},
|
|
289
288
|
[T]
|
|
290
|
-
), Ye =
|
|
291
|
-
|
|
292
|
-
}, []), $e =
|
|
293
|
-
|
|
294
|
-
}, []), et = typeof
|
|
295
|
-
return /* @__PURE__ */
|
|
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(
|
|
296
295
|
it,
|
|
297
296
|
{
|
|
298
297
|
element: v,
|
|
299
|
-
props:
|
|
300
|
-
views:
|
|
298
|
+
props: r,
|
|
299
|
+
views: L,
|
|
301
300
|
fields: e,
|
|
302
|
-
groups:
|
|
303
|
-
dateRange:
|
|
304
|
-
orientation:
|
|
305
|
-
dateFormat: { dateFormat:
|
|
306
|
-
date: [C,
|
|
307
|
-
activeView: [
|
|
308
|
-
selection: [
|
|
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],
|
|
309
308
|
data: [h, te]
|
|
310
309
|
},
|
|
311
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ a.createElement(
|
|
312
311
|
"div",
|
|
313
312
|
{
|
|
314
313
|
ref: v,
|
|
315
|
-
id:
|
|
314
|
+
id: r.id,
|
|
316
315
|
style: Be,
|
|
317
|
-
className:
|
|
318
|
-
tabIndex: (
|
|
319
|
-
dir:
|
|
320
|
-
role:
|
|
321
|
-
"aria-label":
|
|
322
|
-
"aria-labelledby":
|
|
323
|
-
"aria-activedescendant":
|
|
324
|
-
onFocus:
|
|
325
|
-
onBlur:
|
|
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
|
|
326
325
|
},
|
|
327
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ a.createElement(
|
|
328
327
|
Ke,
|
|
329
328
|
{
|
|
330
329
|
ref: (t) => {
|
|
331
330
|
var c;
|
|
332
|
-
|
|
331
|
+
se.current = (c = t == null ? void 0 : t.element) != null ? c : null;
|
|
333
332
|
},
|
|
334
|
-
ariaLabel:
|
|
333
|
+
ariaLabel: oe,
|
|
335
334
|
style: { flexWrap: F < 3 ? "nowrap" : "wrap" }
|
|
336
335
|
},
|
|
337
|
-
et && /* @__PURE__ */
|
|
338
|
-
|
|
336
|
+
et && /* @__PURE__ */ a.createElement(
|
|
337
|
+
P,
|
|
339
338
|
{
|
|
340
339
|
className: "k-toolbar-button",
|
|
341
340
|
themeColor: "primary",
|
|
342
|
-
svgIcon:
|
|
343
|
-
"aria-label":
|
|
341
|
+
svgIcon: St,
|
|
342
|
+
"aria-label": ne,
|
|
344
343
|
tabIndex: -1,
|
|
345
344
|
onClick: Qe
|
|
346
345
|
},
|
|
347
|
-
F < 2 &&
|
|
346
|
+
F < 2 && ne
|
|
348
347
|
),
|
|
349
|
-
F < 2 && /* @__PURE__ */
|
|
350
|
-
F < 3 && /* @__PURE__ */
|
|
351
|
-
|
|
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,
|
|
352
351
|
{
|
|
353
352
|
fillMode: "flat",
|
|
354
353
|
tabIndex: -1,
|
|
355
|
-
svgIcon:
|
|
354
|
+
svgIcon: A === "rtl" ? ve : Ie,
|
|
356
355
|
"aria-label": re,
|
|
357
356
|
title: re,
|
|
358
|
-
onClick:
|
|
357
|
+
onClick: Pe
|
|
359
358
|
}
|
|
360
|
-
), /* @__PURE__ */
|
|
361
|
-
|
|
359
|
+
), /* @__PURE__ */ a.createElement(
|
|
360
|
+
P,
|
|
362
361
|
{
|
|
363
362
|
fillMode: "flat",
|
|
364
363
|
tabIndex: -1,
|
|
365
|
-
svgIcon:
|
|
366
|
-
"aria-label":
|
|
367
|
-
title:
|
|
368
|
-
onClick:
|
|
364
|
+
svgIcon: A === "rtl" ? Ie : ve,
|
|
365
|
+
"aria-label": ae,
|
|
366
|
+
title: ae,
|
|
367
|
+
onClick: We
|
|
369
368
|
}
|
|
370
369
|
)),
|
|
371
|
-
/* @__PURE__ */
|
|
372
|
-
/* @__PURE__ */
|
|
373
|
-
F === 1 && /* @__PURE__ */
|
|
374
|
-
/* @__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 })
|
|
375
374
|
),
|
|
376
|
-
|
|
377
|
-
|
|
375
|
+
d && /* @__PURE__ */ a.createElement(
|
|
376
|
+
d.type,
|
|
378
377
|
{
|
|
379
|
-
editable: (
|
|
380
|
-
key:
|
|
381
|
-
item:
|
|
382
|
-
viewItem:
|
|
383
|
-
editItem:
|
|
384
|
-
task:
|
|
385
|
-
viewTask:
|
|
386
|
-
editTask:
|
|
387
|
-
slot:
|
|
388
|
-
viewSlot:
|
|
389
|
-
editSlot:
|
|
390
|
-
form:
|
|
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,
|
|
391
390
|
onDataAction: te,
|
|
392
|
-
showWorkHours:
|
|
393
|
-
...
|
|
391
|
+
showWorkHours: W,
|
|
392
|
+
...d.props
|
|
394
393
|
}
|
|
395
394
|
),
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
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(
|
|
402
410
|
qe,
|
|
403
411
|
{
|
|
404
|
-
dataItem:
|
|
412
|
+
dataItem: ce,
|
|
405
413
|
onSubmit: Xe,
|
|
406
414
|
onCancel: Ye,
|
|
407
415
|
onClose: $e
|
|
@@ -420,7 +428,7 @@ const Ie = r.forwardRef((n, Se) => {
|
|
|
420
428
|
navigation: ft,
|
|
421
429
|
viewSelector: gt
|
|
422
430
|
};
|
|
423
|
-
|
|
431
|
+
Se.propTypes = {
|
|
424
432
|
data: l.array,
|
|
425
433
|
editable: l.oneOfType([
|
|
426
434
|
l.bool,
|
|
@@ -456,8 +464,8 @@ Ie.propTypes = {
|
|
|
456
464
|
recurrenceException: l.string
|
|
457
465
|
})
|
|
458
466
|
};
|
|
459
|
-
|
|
467
|
+
Se.displayName = "KendoReactScheduler";
|
|
460
468
|
export {
|
|
461
|
-
|
|
469
|
+
Se as Scheduler,
|
|
462
470
|
S as schedulerDefaultProps
|
|
463
471
|
};
|
package/components/BaseView.d.ts
CHANGED
package/components/BaseView.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react"),a=require("@progress/kendo-react-common"),w=require("../context/SchedulerViewContext.js"),d=require("../hooks/use-items-selection.js"),S=require("../hooks/use-slots-selection.js"),m=require("../hooks/useCellSync.js"),x=require("../hooks/use-slots-focus.js"),E=require("../hooks/use-items-focus.js");function _(e){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(l,t,c.get?c:{enumerable:!0,get:()=>e[t]})}}return l.default=e,Object.freeze(l)}const s=_(T),f=s.forwardRef((e,l)=>{const t=s.useRef(null);s.useImperativeHandle(l,()=>t.current);const[c,h]=a.useCollection([]),[i,p]=a.useCollection([]),[I,y]=E.useItemsFocus(c),[C,b]=x.useSlotsFocus(i),[g,o]=d.useItemsSelection(c),[O,n]=S.useSlotsSelection(),k=s.useCallback((u,r)=>{n({type:S.SLOTS_SELECT_ACTION.reset}),o(u,r)},[o,n]),q=s.useCallback((u,r)=>{o({type:d.ITEMS_SELECT_ACTION.reset},r),n(u)},[o,n]),N=s.useMemo(()=>a.classNames("k-scheduler-layout k-scheduler-layout-flex",e.className),[e.className]);return m.useCellSync({element:t,selector:".k-group-cell",attribute:"data-depth-index",explicitDepth:!0}),m.useCellSync({element:t,selector:".k-side-cell",attribute:"data-depth-index",explicitDepth:!1}),s.createElement(w.SchedulerViewContext,{props:e.props,ranges:e.ranges,items:[c,h],slots:[i,p],selectedItems:[g,k],selectedSlots:[O,q],focusedItems:[I,y],focusedSlots:[C,b]},s.createElement("div",{ref:t,style:e.style,className:N,role:"
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react"),a=require("@progress/kendo-react-common"),w=require("../context/SchedulerViewContext.js"),d=require("../hooks/use-items-selection.js"),S=require("../hooks/use-slots-selection.js"),m=require("../hooks/useCellSync.js"),x=require("../hooks/use-slots-focus.js"),E=require("../hooks/use-items-focus.js");function _(e){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(l,t,c.get?c:{enumerable:!0,get:()=>e[t]})}}return l.default=e,Object.freeze(l)}const s=_(T),f=s.forwardRef((e,l)=>{const t=s.useRef(null);s.useImperativeHandle(l,()=>t.current);const[c,h]=a.useCollection([]),[i,p]=a.useCollection([]),[I,y]=E.useItemsFocus(c),[C,b]=x.useSlotsFocus(i),[g,o]=d.useItemsSelection(c),[O,n]=S.useSlotsSelection(),k=s.useCallback((u,r)=>{n({type:S.SLOTS_SELECT_ACTION.reset}),o(u,r)},[o,n]),q=s.useCallback((u,r)=>{o({type:d.ITEMS_SELECT_ACTION.reset},r),n(u)},[o,n]),N=s.useMemo(()=>a.classNames("k-scheduler-layout k-scheduler-layout-flex",e.className),[e.className]);return m.useCellSync({element:t,selector:".k-group-cell",attribute:"data-depth-index",explicitDepth:!0}),m.useCellSync({element:t,selector:".k-side-cell",attribute:"data-depth-index",explicitDepth:!1}),s.createElement(w.SchedulerViewContext,{props:e.props,ranges:e.ranges,items:[c,h],slots:[i,p],selectedItems:[g,k],selectedSlots:[O,q],focusedItems:[I,y],focusedSlots:[C,b]},s.createElement("div",{ref:t,style:e.style,className:N,role:e.role||"none"},e.children))});f.displayName="KendoReactSchedulerBaseView";exports.BaseView=f;
|