@progress/kendo-react-scheduler 16.1.0-develop.3 → 16.1.0-develop.5
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 +141 -138
- package/components/CurrentTimeMarket.js +1 -1
- package/components/CurrentTimeMarket.mjs +26 -26
- package/components/MoreEventsPopover.js +1 -1
- package/components/MoreEventsPopover.mjs +45 -29
- package/dist/cdn/js/kendo-react-scheduler.js +1 -1
- 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/useWorkHours.d.ts +1 -1
- package/hooks/useWorkHours.js +8 -0
- package/hooks/useWorkHours.mjs +18 -0
- 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 +27 -24
- package/utils/index.js +1 -1
- package/utils/index.mjs +2 -2
- package/views/day/MultiDayView.js +1 -1
- package/views/day/MultiDayView.mjs +97 -93
- package/views/time/MultiDayTimelineView.js +1 -1
- package/views/time/MultiDayTimelineView.mjs +93 -88
|
@@ -6,49 +6,54 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
|
-
import { BaseView as
|
|
10
|
-
import { Day as
|
|
11
|
-
import { HorizontalResourceIterator as
|
|
12
|
-
import { TimelineViewRowContent as
|
|
13
|
-
import { TimelineViewAllEventsRowContent as
|
|
14
|
-
import { VerticalResourceIterator as
|
|
15
|
-
import { toUTCDateTime as
|
|
16
|
-
import { classNames as
|
|
9
|
+
import { BaseView as oe } from "../../components/BaseView.mjs";
|
|
10
|
+
import { Day as L, ZonedDate as z, getDate as ne, addDays as ae, MS_PER_DAY as ie, MS_PER_MINUTE as se } from "@progress/kendo-date-math";
|
|
11
|
+
import { HorizontalResourceIterator as Z } from "../common/HorizontalResourceIterator.mjs";
|
|
12
|
+
import { TimelineViewRowContent as me } from "./TimelineViewRowContent.mjs";
|
|
13
|
+
import { TimelineViewAllEventsRowContent as le } from "./TimelineViewAllEventsRowContent.mjs";
|
|
14
|
+
import { VerticalResourceIterator as X } from "../common/VerticalResourceIterator.mjs";
|
|
15
|
+
import { toUTCDateTime as A, isInTimeRange as S, mapItemsToSlots as ce, mapSlotsToItems as ue, isInDaysRange as de, intersects as Y, last as j, first as q, orderSort as De } from "../../utils/index.mjs";
|
|
16
|
+
import { classNames as fe } from "@progress/kendo-react-common";
|
|
17
17
|
import { toRanges as Te } from "../../services/rangeService.mjs";
|
|
18
|
-
import { toSlots as
|
|
19
|
-
import { toOccurrences as
|
|
20
|
-
import { toItems as
|
|
21
|
-
import { SchedulerEditSlot as
|
|
22
|
-
import { BORDER_WIDTH as
|
|
23
|
-
import { useInternationalization as
|
|
24
|
-
import { SchedulerEditItem as
|
|
25
|
-
import { useSchedulerPropsContext as
|
|
26
|
-
import { SchedulerResourceIteratorContext as
|
|
27
|
-
import { CurrentTimeMarker as
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
),
|
|
36
|
-
e.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
18
|
+
import { toSlots as ke } from "../../services/slotsService.mjs";
|
|
19
|
+
import { toOccurrences as we } from "../../services/occurrenceService.mjs";
|
|
20
|
+
import { toItems as ge } from "../../services/itemsService.mjs";
|
|
21
|
+
import { SchedulerEditSlot as he } from "../../slots/SchedulerEditSlot.mjs";
|
|
22
|
+
import { BORDER_WIDTH as Se } from "../../constants/index.mjs";
|
|
23
|
+
import { useInternationalization as Ee } from "@progress/kendo-react-intl";
|
|
24
|
+
import { SchedulerEditItem as ye } from "../../items/SchedulerEditItem.mjs";
|
|
25
|
+
import { useSchedulerPropsContext as Re, useSchedulerDataContext as We, useSchedulerOrientationContext as Ce, useSchedulerGroupsContext as ze, useSchedulerDateRangeContext as Me, useSchedulerFieldsContext as ve } from "../../context/SchedulerContext.mjs";
|
|
26
|
+
import { SchedulerResourceIteratorContext as b } from "../../context/SchedulerResourceIteratorContext.mjs";
|
|
27
|
+
import { CurrentTimeMarker as J } from "../../components/CurrentTimeMarket.mjs";
|
|
28
|
+
import { useWorkHours as xe } from "../../hooks/useWorkHours.mjs";
|
|
29
|
+
import { DateHeaderCell as Ie } from "../../components/DateHeaderCell.mjs";
|
|
30
|
+
import { TimeHeaderCell as He } from "../../components/TimeHeaderCell.mjs";
|
|
31
|
+
import { useCellSync as be } from "../../hooks/useCellSync.mjs";
|
|
32
|
+
import { useRowSync as Ae } from "../../hooks/useRowSync.mjs";
|
|
33
|
+
const Ne = "t", _e = 0, st = (e) => {
|
|
34
|
+
var G;
|
|
35
|
+
const { group: D, timezone: n, resources: f } = Re(), T = t.useRef(null), M = t.useRef(null), E = e.editItem || ye, y = e.editSlot || he, k = t.useRef(null), [R] = We(), w = Ce(), h = ze(), s = Me(), N = ve(), W = Ee(), [C] = xe(
|
|
36
|
+
e.showWorkHours,
|
|
37
|
+
(G = e.defaultShowWorkHours) != null ? G : i.defaultShowWorkHours
|
|
38
|
+
), _ = e.slotDivisions || i.slotDivisions, v = e.slotDuration || i.slotDuration, K = e.workWeekStart || i.workWeekStart, Q = e.workWeekEnd || i.workWeekEnd, x = W.parseDate(
|
|
39
|
+
e.workDayStart || e.isWorkDayStart || i.isWorkDayStart
|
|
40
|
+
), I = W.parseDate(
|
|
41
|
+
e.workDayEnd || e.isWorkDayEnd || i.isWorkDayEnd
|
|
42
|
+
), $ = W.parseDate(e.startTime || i.startTime), F = W.parseDate(e.endTime || i.endTime), l = t.useMemo(
|
|
43
|
+
() => C ? x : $,
|
|
44
|
+
[C, x, $]
|
|
45
|
+
), c = t.useMemo(() => C ? I : F, [C, I, F]), o = t.useMemo(
|
|
46
|
+
() => Te(s, { step: ie, timezone: n }),
|
|
47
|
+
[s.start.getTime(), s.end.getTime(), n]
|
|
48
|
+
), m = t.useMemo(
|
|
49
|
+
() => ke(s, { step: v / _ * se }, { groups: h, ranges: o }).filter(
|
|
45
50
|
(r) => S(r.zonedStart, l, c) || l.getTime() === c.getTime()
|
|
46
51
|
),
|
|
47
52
|
[
|
|
48
53
|
h,
|
|
49
54
|
o,
|
|
50
|
-
|
|
51
|
-
|
|
55
|
+
s.start.getTime(),
|
|
56
|
+
s.end.getTime(),
|
|
52
57
|
n,
|
|
53
58
|
v,
|
|
54
59
|
_,
|
|
@@ -56,10 +61,10 @@ const Ae = "t", He = 0, nt = (e) => {
|
|
|
56
61
|
c.getTime()
|
|
57
62
|
]
|
|
58
63
|
), U = t.useMemo(
|
|
59
|
-
() =>
|
|
60
|
-
[R,
|
|
64
|
+
() => we(R, { dateRange: s, fields: N, timezone: n }),
|
|
65
|
+
[R, s.start.getTime(), s.end.getTime(), N, n]
|
|
61
66
|
), u = t.useMemo(
|
|
62
|
-
() =>
|
|
67
|
+
() => ge(U, { timezone: n }, { groups: h, ranges: o }).filter(
|
|
63
68
|
(r) => l.getTime() === c.getTime() || S(r.zonedStart, l, c) || S(r.zonedEnd, l, c) || S(
|
|
64
69
|
new Date(r.zonedEnd.getTime() - (r.zonedEnd.getTime() - r.zonedStart.getTime()) / 2),
|
|
65
70
|
l,
|
|
@@ -68,37 +73,37 @@ const Ae = "t", He = 0, nt = (e) => {
|
|
|
68
73
|
),
|
|
69
74
|
[U, n, h, o, l.getTime(), c.getTime()]
|
|
70
75
|
);
|
|
71
|
-
t.useMemo(() =>
|
|
72
|
-
const V = (
|
|
73
|
-
|
|
76
|
+
t.useMemo(() => ce(u, m, !0), [u, m]), t.useMemo(() => ue(u, m, !0), [u, m]);
|
|
77
|
+
const V = (w === "horizontal" ? m.length : m.length / h.length) * ((e.columnWidth || i.columnWidth) + Se), O = /* @__PURE__ */ t.createElement(b.Consumer, null, () => /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("div", { className: "k-scheduler-row" }, o.map((r, g) => /* @__PURE__ */ t.createElement(
|
|
78
|
+
Ie,
|
|
74
79
|
{
|
|
75
80
|
as: e.dateHeaderCell,
|
|
76
|
-
key:
|
|
81
|
+
key: g,
|
|
77
82
|
date: r.zonedStart,
|
|
78
83
|
start: r.start,
|
|
79
84
|
end: r.end,
|
|
80
85
|
format: "m"
|
|
81
86
|
}
|
|
82
|
-
))), /* @__PURE__ */ t.createElement("div", { className: "k-scheduler-row", ref:
|
|
87
|
+
))), /* @__PURE__ */ t.createElement("div", { className: "k-scheduler-row", ref: T }, o.map((r, g) => m.filter((a) => a.group.index === _e && a.range.index === g).map(
|
|
83
88
|
(a) => a.zonedStart.getMinutes() % v === 0 ? /* @__PURE__ */ t.createElement(
|
|
84
|
-
|
|
89
|
+
He,
|
|
85
90
|
{
|
|
86
91
|
key: a.index,
|
|
87
92
|
as: e.timeHeaderCell,
|
|
88
|
-
format:
|
|
93
|
+
format: Ne,
|
|
89
94
|
date: a.zonedStart,
|
|
90
95
|
start: a.zonedStart,
|
|
91
96
|
end: a.zonedEnd
|
|
92
97
|
}
|
|
93
98
|
) : null
|
|
94
|
-
))))), P = /* @__PURE__ */ t.createElement(
|
|
95
|
-
const
|
|
96
|
-
|
|
99
|
+
))))), P = /* @__PURE__ */ t.createElement(b.Consumer, null, ({ groupIndex: r }) => /* @__PURE__ */ t.createElement("div", { className: "k-scheduler-row" }, o.map((g, a) => m.filter((d) => d.group.index === r && d.range.index === a).map((d, B, H) => {
|
|
100
|
+
const te = z.fromUTCDate(
|
|
101
|
+
A(d.zonedStart),
|
|
97
102
|
n
|
|
98
|
-
),
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
103
|
+
), re = de(
|
|
104
|
+
te.getDay(),
|
|
105
|
+
K,
|
|
106
|
+
Q
|
|
102
107
|
);
|
|
103
108
|
return /* @__PURE__ */ t.createElement(
|
|
104
109
|
y,
|
|
@@ -110,59 +115,59 @@ const Ae = "t", He = 0, nt = (e) => {
|
|
|
110
115
|
form: e.form,
|
|
111
116
|
onDataAction: e.onDataAction,
|
|
112
117
|
isWorkHour: S(d.zonedStart, x, I),
|
|
113
|
-
isWorkDay:
|
|
114
|
-
col:
|
|
115
|
-
row:
|
|
118
|
+
isWorkDay: re,
|
|
119
|
+
col: w === "horizontal" ? a * H.length + B + H.length * o.length * (r || 0) : a * H.length + B,
|
|
120
|
+
row: w === "horizontal" ? 0 : r || 0,
|
|
116
121
|
expandable: !0,
|
|
117
122
|
editable: e.editable
|
|
118
123
|
}
|
|
119
124
|
);
|
|
120
|
-
})))),
|
|
121
|
-
|
|
122
|
-
element:
|
|
125
|
+
})))), p = t.useMemo(() => fe("k-scheduler-timelineview", e.className), [e.className]);
|
|
126
|
+
be({
|
|
127
|
+
element: k,
|
|
123
128
|
selector: ".k-resource-cell",
|
|
124
129
|
attribute: "data-depth-index",
|
|
125
130
|
explicitDepth: !0
|
|
126
131
|
});
|
|
127
|
-
const
|
|
128
|
-
return
|
|
129
|
-
element:
|
|
132
|
+
const ee = k.current ? k.current.closest(".k-scheduler-layout") : null;
|
|
133
|
+
return Ae({
|
|
134
|
+
element: ee,
|
|
130
135
|
selector: ".k-resource-row",
|
|
131
136
|
horizontalAttribute: "data-depth-index",
|
|
132
137
|
verticalAttribute: "data-resource-index",
|
|
133
138
|
applyTo: ".k-resource-cell",
|
|
134
139
|
syncHeight: u && !u.length
|
|
135
140
|
}), /* @__PURE__ */ t.createElement(
|
|
136
|
-
|
|
141
|
+
oe,
|
|
137
142
|
{
|
|
138
|
-
ref:
|
|
143
|
+
ref: k,
|
|
139
144
|
id: e.id,
|
|
140
145
|
style: { ...e.style },
|
|
141
|
-
className:
|
|
146
|
+
className: p,
|
|
142
147
|
props: e,
|
|
143
|
-
slots:
|
|
148
|
+
slots: m,
|
|
144
149
|
ranges: o
|
|
145
150
|
},
|
|
146
|
-
/* @__PURE__ */ t.createElement("div", { className: "k-scheduler-head", style: { width: V } },
|
|
147
|
-
|
|
151
|
+
/* @__PURE__ */ t.createElement("div", { className: "k-scheduler-head", style: { width: V } }, w === "horizontal" ? /* @__PURE__ */ t.createElement(
|
|
152
|
+
Z,
|
|
148
153
|
{
|
|
149
154
|
nested: !0,
|
|
150
155
|
group: D,
|
|
151
|
-
resources:
|
|
152
|
-
rowContent:
|
|
156
|
+
resources: f,
|
|
157
|
+
rowContent: me
|
|
153
158
|
},
|
|
154
159
|
O
|
|
155
|
-
) : /* @__PURE__ */ t.createElement(
|
|
156
|
-
/* @__PURE__ */ t.createElement("div", { className: "k-scheduler-body", style: { width: V }, ref: M },
|
|
157
|
-
|
|
160
|
+
) : /* @__PURE__ */ t.createElement(X, { wrapGroup: !0, group: D, resources: f }, O)),
|
|
161
|
+
/* @__PURE__ */ t.createElement("div", { className: "k-scheduler-body", style: { width: V }, ref: M }, w === "horizontal" ? /* @__PURE__ */ t.createElement(
|
|
162
|
+
Z,
|
|
158
163
|
{
|
|
159
164
|
group: D,
|
|
160
|
-
resources:
|
|
161
|
-
rowContent:
|
|
165
|
+
resources: f,
|
|
166
|
+
rowContent: le
|
|
162
167
|
},
|
|
163
168
|
P,
|
|
164
|
-
/* @__PURE__ */ t.createElement(
|
|
165
|
-
) : /* @__PURE__ */ t.createElement(
|
|
169
|
+
/* @__PURE__ */ t.createElement(b.Consumer, null, ({ groupIndex: r }) => e.currentTimeMarker && Y(q(o).start, j(o).end, /* @__PURE__ */ new Date(), /* @__PURE__ */ new Date(), !0) && /* @__PURE__ */ t.createElement(J, { groupIndex: r, attachArrow: T, vertical: !0 }))
|
|
170
|
+
) : /* @__PURE__ */ t.createElement(X, { nested: !0, wrapGroup: !0, group: D, resources: f }, P), w === "vertical" && e.currentTimeMarker && Y(q(o).start, j(o).end, /* @__PURE__ */ new Date(), /* @__PURE__ */ new Date(), !0) && /* @__PURE__ */ t.createElement(J, { attachArrow: T, vertical: !0 }), u.sort(De).map((r, g) => /* @__PURE__ */ t.createElement(
|
|
166
171
|
E,
|
|
167
172
|
{
|
|
168
173
|
key: r.isRecurring ? `${r.uid}:${r.group.index}:${r.range.index}:${r.originalStart}` : `${r.uid}:${r.group.index}:${r.range.index}`,
|
|
@@ -175,23 +180,23 @@ const Ae = "t", He = 0, nt = (e) => {
|
|
|
175
180
|
editable: e.editable,
|
|
176
181
|
ignoreIsAllDay: !0,
|
|
177
182
|
vertical: !1,
|
|
178
|
-
isLast:
|
|
183
|
+
isLast: g === u.length - 1
|
|
179
184
|
}
|
|
180
185
|
)))
|
|
181
186
|
);
|
|
182
|
-
},
|
|
183
|
-
const
|
|
187
|
+
}, $e = ({ date: e, numberOfDays: D = 1, timezone: n }) => {
|
|
188
|
+
const f = z.fromLocalDate(e, n), T = ne(f), M = ae(T, D), E = z.fromUTCDate(A(T), n), y = z.fromUTCDate(A(M), n), k = new Date(E.getTime()), R = new Date(y.getTime());
|
|
184
189
|
return {
|
|
185
|
-
start:
|
|
190
|
+
start: k,
|
|
186
191
|
end: R,
|
|
187
192
|
zonedStart: E,
|
|
188
193
|
zonedEnd: y
|
|
189
194
|
};
|
|
190
|
-
},
|
|
195
|
+
}, i = {
|
|
191
196
|
name: "multi-day-timeline",
|
|
192
197
|
title: "Multi Day Timeline",
|
|
193
198
|
currentTimeMarker: !0,
|
|
194
|
-
dateRange:
|
|
199
|
+
dateRange: $e,
|
|
195
200
|
selectedDateFormat: "{0:M}",
|
|
196
201
|
selectedShortDateFormat: "{0:m}",
|
|
197
202
|
numberOfDays: 1,
|
|
@@ -199,8 +204,8 @@ const Ae = "t", He = 0, nt = (e) => {
|
|
|
199
204
|
endTime: "00:00",
|
|
200
205
|
isWorkDayStart: "8:00",
|
|
201
206
|
isWorkDayEnd: "17:00",
|
|
202
|
-
workWeekStart:
|
|
203
|
-
workWeekEnd:
|
|
207
|
+
workWeekStart: L.Monday,
|
|
208
|
+
workWeekEnd: L.Friday,
|
|
204
209
|
slotDivisions: 2,
|
|
205
210
|
slotDuration: 60,
|
|
206
211
|
// showCurrentTime: true // TODO: Phase 2
|
|
@@ -208,6 +213,6 @@ const Ae = "t", He = 0, nt = (e) => {
|
|
|
208
213
|
columnWidth: 100
|
|
209
214
|
};
|
|
210
215
|
export {
|
|
211
|
-
|
|
212
|
-
|
|
216
|
+
st as MultiDayTimelineView,
|
|
217
|
+
i as multiDayTimelineViewDefaultProps
|
|
213
218
|
};
|