@progress/kendo-react-scheduler 15.0.1-develop.9 → 15.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/dist/cdn/js/kendo-react-scheduler.js +1 -1
- package/hooks/useSlotExpand.js +1 -1
- package/hooks/useSlotExpand.mjs +49 -34
- package/items/SchedulerEditItem.js +1 -1
- package/items/SchedulerEditItem.mjs +7 -7
- package/items/SchedulerViewItem.js +1 -1
- package/items/SchedulerViewItem.mjs +146 -112
- package/items/hooks/use-drag-item.js +1 -1
- package/items/hooks/use-drag-item.mjs +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +11 -11
|
@@ -5,166 +5,200 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
9
|
-
import { SchedulerItem as
|
|
10
|
-
import { first as
|
|
11
|
-
import { getRect as
|
|
12
|
-
import { BORDER_WIDTH as
|
|
13
|
-
import { useInternationalization as
|
|
14
|
-
import { SchedulerItemContent as
|
|
15
|
-
import { useDir as
|
|
16
|
-
import { chevronRightIcon as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
const
|
|
22
|
-
(e,
|
|
23
|
-
const { item:
|
|
24
|
-
|
|
25
|
-
const
|
|
8
|
+
import * as n from "react";
|
|
9
|
+
import { SchedulerItem as me } from "./SchedulerItem.mjs";
|
|
10
|
+
import { first as fe, calculateOrder as he, intersects as F } from "../utils/index.mjs";
|
|
11
|
+
import { getRect as j, setRect as ge } from "../views/common/utils.mjs";
|
|
12
|
+
import { BORDER_WIDTH as A } from "../constants/index.mjs";
|
|
13
|
+
import { useInternationalization as ve } from "@progress/kendo-react-intl";
|
|
14
|
+
import { SchedulerItemContent as J } from "./SchedulerItemContent.mjs";
|
|
15
|
+
import { useDir as we, IconWrap as V } from "@progress/kendo-react-common";
|
|
16
|
+
import { chevronRightIcon as ye, chevronLeftIcon as Ie, arrowRotateCwIcon as Re, arrowsNoRepeatIcon as Se } from "@progress/kendo-svg-icons";
|
|
17
|
+
import { useEditable as He } from "../hooks/useEditable.mjs";
|
|
18
|
+
import { useSchedulerViewItemsContext as be, useSchedulerViewSlotsContext as De } from "../context/SchedulerViewContext.mjs";
|
|
19
|
+
import { useSchedulerElementContext as Ee } from "../context/SchedulerContext.mjs";
|
|
20
|
+
import { useRowSync as Ae } from "../hooks/useRowSync.mjs";
|
|
21
|
+
const M = 1, k = 25, xe = n.forwardRef(
|
|
22
|
+
(e, Q) => {
|
|
23
|
+
const { item: X, _ref: Z, itemRef: p, ...ee } = e, _ = n.useRef(void 0), m = n.useRef(null), C = n.useRef(null), W = n.useRef(null), te = He(e.editable);
|
|
24
|
+
n.useImperativeHandle(C, () => ({ props: e, element: m.current && m.current.element })), n.useImperativeHandle(Q, () => C.current), n.useImperativeHandle(Z, () => m.current), n.useImperativeHandle(p, () => m.current);
|
|
25
|
+
const re = X || ze.item, L = ve(), [ne] = be(), [ie] = De(), P = Ee(), [le, N] = n.useState(!0), [oe, se] = n.useState(!1), f = n.useRef(e.order), Y = n.useRef(0), q = we(P), B = n.useMemo(
|
|
26
26
|
() => {
|
|
27
27
|
var t, r;
|
|
28
|
-
return e.isAllDay ? (t = e.title) != null ? t : "" : `(${
|
|
28
|
+
return e.isAllDay ? (t = e.title) != null ? t : "" : `(${L.format("{0:t} - {1:t}", e.zonedStart, e.zonedEnd)}): ${(r = e.title) != null ? r : ""}`;
|
|
29
29
|
},
|
|
30
|
-
[
|
|
31
|
-
),
|
|
32
|
-
let
|
|
30
|
+
[L, e.isAllDay, e.title, e.zonedEnd, e.zonedStart]
|
|
31
|
+
), G = (t, r) => {
|
|
32
|
+
let c = 1;
|
|
33
33
|
return t.forEach((l) => {
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
}),
|
|
37
|
-
},
|
|
38
|
-
var
|
|
39
|
-
const
|
|
40
|
-
let o =
|
|
41
|
-
if (
|
|
34
|
+
const d = r.filter((h) => T(l.current.props, h.props));
|
|
35
|
+
d.length > c && (c = d.length);
|
|
36
|
+
}), c;
|
|
37
|
+
}, ae = (t, r) => t.map((l) => r.filter((d) => T(l.current.props, d.props))), ce = (t, r, c) => {
|
|
38
|
+
var I;
|
|
39
|
+
const l = r.filter((i) => i.props.order !== null && i.props.order !== void 0).map((i) => {
|
|
40
|
+
let o = i.props.start, u = i.props.end;
|
|
41
|
+
if (i.props.isAllDay) {
|
|
42
42
|
o = new Date(o.getFullYear(), o.getMonth(), o.getDate());
|
|
43
|
-
const
|
|
44
|
-
|
|
43
|
+
const R = new Date(u.getFullYear(), u.getMonth(), u.getDate());
|
|
44
|
+
u = R.getTime() <= o.getTime() ? new Date(o.getFullYear(), o.getMonth(), o.getDate() + 1) : R;
|
|
45
45
|
}
|
|
46
|
-
return { order:
|
|
47
|
-
}),
|
|
48
|
-
for (const
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
for (const
|
|
52
|
-
const o =
|
|
53
|
-
let
|
|
54
|
-
|
|
46
|
+
return { order: i.props.order, start: o, end: u };
|
|
47
|
+
}), d = Array.from(new Set(l.map((i) => i.order))).sort((i, o) => i - o), h = /* @__PURE__ */ new Map();
|
|
48
|
+
for (const i of l)
|
|
49
|
+
h.has(i.order) || h.set(i.order, []), h.get(i.order).push({ start: i.start, end: i.end });
|
|
50
|
+
const y = [], x = /* @__PURE__ */ new Map();
|
|
51
|
+
for (const i of d) {
|
|
52
|
+
const o = h.get(i);
|
|
53
|
+
let u = -1, R = 0;
|
|
54
|
+
x.forEach((w, D) => {
|
|
55
|
+
if (D >= i)
|
|
56
|
+
return;
|
|
57
|
+
const S = h.get(D);
|
|
58
|
+
if (!S)
|
|
59
|
+
return;
|
|
60
|
+
o.some(
|
|
61
|
+
(z) => S.some(
|
|
62
|
+
(s) => F(s.start, s.end, z.start, z.end, c)
|
|
63
|
+
)
|
|
64
|
+
) && w + 1 > R && (R = w + 1);
|
|
65
|
+
});
|
|
66
|
+
for (let w = R; w < y.length; w++)
|
|
55
67
|
if (o.every(
|
|
56
|
-
(
|
|
57
|
-
(
|
|
68
|
+
(S) => y[w].every(
|
|
69
|
+
(E) => !F(
|
|
70
|
+
E.start,
|
|
71
|
+
E.end,
|
|
72
|
+
S.start,
|
|
73
|
+
S.end,
|
|
74
|
+
c
|
|
75
|
+
)
|
|
58
76
|
)
|
|
59
77
|
)) {
|
|
60
|
-
|
|
78
|
+
u = w;
|
|
61
79
|
break;
|
|
62
80
|
}
|
|
63
|
-
|
|
81
|
+
u === -1 && (u = y.length, y.push([])), y[u].push(...o), x.set(i, u);
|
|
64
82
|
}
|
|
65
|
-
return (
|
|
66
|
-
},
|
|
83
|
+
return (I = x.get(t)) != null ? I : t;
|
|
84
|
+
}, T = (t, r) => F(t.start, t.end, r.start, r.end) && t.group.index === r.group.index && t.range.index === r.range.index && // When slotDuration equals a full day, both daySlots and timeSlots have isAllDay=true,
|
|
67
85
|
// so we need to also check range.isAllDay to distinguish between them.
|
|
68
|
-
(t.range.isAllDay === void 0 || r.range.isAllDay === void 0 || t.range.isAllDay === r.range.isAllDay) && (e.ignoreIsAllDay || t.isAllDay === r.isAllDay),
|
|
69
|
-
var
|
|
70
|
-
const t = (
|
|
86
|
+
(t.range.isAllDay === void 0 || r.range.isAllDay === void 0 || t.range.isAllDay === r.range.isAllDay) && (e.ignoreIsAllDay || t.isAllDay === r.isAllDay), O = () => {
|
|
87
|
+
var w, D, S, E, z;
|
|
88
|
+
const t = (ie || []).filter((s) => s.current && T(s.current.props, e)), r = m.current && m.current.element, c = fe(t);
|
|
71
89
|
if (t.length === 0) {
|
|
72
|
-
|
|
90
|
+
N(!1);
|
|
73
91
|
return;
|
|
74
92
|
}
|
|
75
|
-
if (!
|
|
93
|
+
if (!c.current || !r)
|
|
76
94
|
return;
|
|
77
|
-
const l =
|
|
78
|
-
(
|
|
79
|
-
|
|
95
|
+
const l = j(c.current.element), d = [], h = [], y = [];
|
|
96
|
+
(ne || []).forEach((s) => {
|
|
97
|
+
s.current && (s.current.props.dragHint ? h.push(s.current) : s.current.props.resizeHint ? y.push(s.current) : d.push(s.current));
|
|
80
98
|
});
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
e.dragHint ?
|
|
99
|
+
const x = e.dragHint || e.resizeHint ? he(
|
|
100
|
+
m.current,
|
|
101
|
+
e.dragHint ? h : y,
|
|
84
102
|
t,
|
|
85
103
|
e.ignoreIsAllDay
|
|
86
|
-
) : (
|
|
104
|
+
) : (w = e.order) != null ? w : 0;
|
|
87
105
|
if (!e.vertical && !(e.dragHint || e.resizeHint) && e.order !== null && e.order !== void 0) {
|
|
88
|
-
const
|
|
89
|
-
f.current =
|
|
106
|
+
const H = (e.ignoreIsAllDay ? d : d.filter((v) => v.props.isAllDay)).filter((v) => v.props.group.index === e.group.index), a = (D = e.style) == null ? void 0 : D.height, b = typeof a == "number" ? a : parseFloat(a), g = a != null && Number.isNaN(b);
|
|
107
|
+
f.current = ce(e.order, H, !g);
|
|
90
108
|
} else
|
|
91
|
-
f.current =
|
|
92
|
-
let
|
|
93
|
-
const
|
|
94
|
-
let
|
|
95
|
-
const
|
|
96
|
-
if (
|
|
97
|
-
let
|
|
98
|
-
|
|
99
|
-
if (
|
|
100
|
-
const
|
|
101
|
-
|
|
109
|
+
f.current = x;
|
|
110
|
+
let I = e.dragHint || e.resizeHint ? G(t, e.dragHint ? h : y) : G(t, d);
|
|
111
|
+
const i = ae(t, d);
|
|
112
|
+
let o = 0;
|
|
113
|
+
const u = !e.vertical && f.current !== null;
|
|
114
|
+
if (i.forEach((s) => {
|
|
115
|
+
let H = 0;
|
|
116
|
+
s.forEach((a) => {
|
|
117
|
+
if (F(a.props.start, a.props.end, e.start, e.end) && !(e.dragHint || e.resizeHint) && a._maxSiblingsPerSlot && a._maxSiblingsPerSlot > I && a.element !== r && (I = a._maxSiblingsPerSlot), !u) {
|
|
118
|
+
const b = j(a.element);
|
|
119
|
+
a.props.order !== null && a.props.order !== void 0 && a.props.order < f.current && (H = b.top + b.height - l.top - A * f.current + M);
|
|
102
120
|
}
|
|
103
|
-
}),
|
|
104
|
-
}),
|
|
105
|
-
const
|
|
106
|
-
|
|
121
|
+
}), H > o && (o = H);
|
|
122
|
+
}), u) {
|
|
123
|
+
const s = (S = e.style) == null ? void 0 : S.height, H = typeof s == "number" ? s : parseFloat(s);
|
|
124
|
+
if (s == null)
|
|
125
|
+
o = f.current * (k + M);
|
|
126
|
+
else if (!Number.isNaN(H))
|
|
127
|
+
o = f.current * (H + M);
|
|
128
|
+
else {
|
|
129
|
+
const a = (e.ignoreIsAllDay ? d : d.filter((g) => g.props.isAllDay)).filter(
|
|
130
|
+
(g) => g.props.group.index === e.group.index && g.element !== r
|
|
131
|
+
), b = /* @__PURE__ */ new Map();
|
|
132
|
+
a.forEach((g) => {
|
|
133
|
+
var K, U;
|
|
134
|
+
const v = g._order;
|
|
135
|
+
if (v == null || v >= f.current)
|
|
136
|
+
return;
|
|
137
|
+
const ue = ((K = g.element) == null ? void 0 : K.offsetHeight) || k;
|
|
138
|
+
b.set(v, Math.max((U = b.get(v)) != null ? U : 0, ue));
|
|
139
|
+
}), o = Array.from(b.values()).reduce((g, v) => g + v + M, 0);
|
|
140
|
+
}
|
|
107
141
|
}
|
|
108
142
|
if (t.length === 0) {
|
|
109
|
-
|
|
143
|
+
N(!1);
|
|
110
144
|
return;
|
|
111
145
|
}
|
|
112
|
-
const
|
|
113
|
-
l.width = e.vertical ? l.width /
|
|
114
|
-
},
|
|
146
|
+
const R = te.add ? 20 : 0;
|
|
147
|
+
l.width = e.vertical ? l.width / I - A - R / I : l.width * t.length - A, e.vertical ? l.height = l.height * t.length - A : (e.resizeHint || e.dragHint) && I <= 1 || (l.height = (z = (E = e.style) == null ? void 0 : E.height) != null ? z : k), l.left = e.vertical ? l.left + f.current * l.width + A * f.current : l.left, l.top = e.vertical ? l.top : l.top + o + A * f.current, Y.current = I, ge(r, l), se(!0), N(!0);
|
|
148
|
+
}, $ = n.useCallback(
|
|
115
149
|
(t) => {
|
|
116
|
-
const r = t && t[0],
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
})),
|
|
150
|
+
const r = t && t[0], c = W.current;
|
|
151
|
+
_.current !== void 0 && window.cancelAnimationFrame(_.current), c && r && (c.width !== r.contentRect.width || c.height !== r.contentRect.height) && (_.current = window.requestAnimationFrame(() => {
|
|
152
|
+
O();
|
|
153
|
+
})), W.current = { width: r.contentRect.width, height: r.contentRect.height };
|
|
120
154
|
},
|
|
121
|
-
[
|
|
155
|
+
[O]
|
|
122
156
|
);
|
|
123
|
-
|
|
124
|
-
const
|
|
125
|
-
return
|
|
126
|
-
element:
|
|
157
|
+
n.useEffect(O);
|
|
158
|
+
const de = m.current && m.current.element ? m.current.element.closest(".k-scheduler-layout") : null;
|
|
159
|
+
return Ae({
|
|
160
|
+
element: de,
|
|
127
161
|
selector: ".k-resource-row",
|
|
128
162
|
horizontalAttribute: "data-depth-index",
|
|
129
163
|
verticalAttribute: "data-resource-index",
|
|
130
164
|
applyTo: ".k-resource-cell",
|
|
131
165
|
syncHeight: e.isLast
|
|
132
|
-
}),
|
|
133
|
-
if (!
|
|
166
|
+
}), n.useEffect(() => {
|
|
167
|
+
if (!P.current)
|
|
134
168
|
return;
|
|
135
|
-
const t = window.ResizeObserver, r = t && new t(
|
|
136
|
-
return r && r.observe(
|
|
169
|
+
const t = window.ResizeObserver, r = t && new t($);
|
|
170
|
+
return r && r.observe(P.current), () => {
|
|
137
171
|
r && r.disconnect();
|
|
138
172
|
};
|
|
139
|
-
}, [
|
|
140
|
-
|
|
173
|
+
}, [$, P]), /* @__PURE__ */ n.createElement(
|
|
174
|
+
re,
|
|
141
175
|
{
|
|
142
|
-
...
|
|
143
|
-
_ref:
|
|
144
|
-
_maxSiblingsPerSlot:
|
|
176
|
+
...ee,
|
|
177
|
+
_ref: m,
|
|
178
|
+
_maxSiblingsPerSlot: Y,
|
|
145
179
|
_order: f,
|
|
146
|
-
itemRef:
|
|
180
|
+
itemRef: m,
|
|
147
181
|
style: {
|
|
148
|
-
visibility:
|
|
149
|
-
display:
|
|
182
|
+
visibility: oe ? void 0 : "hidden",
|
|
183
|
+
display: le ? void 0 : "none",
|
|
150
184
|
...e.style
|
|
151
185
|
}
|
|
152
186
|
},
|
|
153
|
-
!e.resizeHint && /* @__PURE__ */
|
|
154
|
-
|
|
187
|
+
!e.resizeHint && /* @__PURE__ */ n.createElement("span", { className: "k-event-actions" }, e.tail && /* @__PURE__ */ n.createElement(
|
|
188
|
+
V,
|
|
155
189
|
{
|
|
156
|
-
name:
|
|
157
|
-
icon:
|
|
190
|
+
name: q === "rtl" ? "chevron-right" : "chevron-left",
|
|
191
|
+
icon: q === "rtl" ? ye : Ie
|
|
158
192
|
}
|
|
159
|
-
), e.isRecurring && !e.isException && /* @__PURE__ */
|
|
160
|
-
!e.resizeHint && /* @__PURE__ */
|
|
193
|
+
), e.isRecurring && !e.isException && /* @__PURE__ */ n.createElement(V, { name: "arrow-rotate-cw", icon: Re }), !e.isRecurring && e.isException && /* @__PURE__ */ n.createElement(V, { name: "arrows-no-repeat", icon: Se })),
|
|
194
|
+
!e.resizeHint && /* @__PURE__ */ n.createElement("div", { title: B }, !e.isAllDay && /* @__PURE__ */ n.createElement(J, { className: "k-event-time" }, B), /* @__PURE__ */ n.createElement(J, null, e.title))
|
|
161
195
|
);
|
|
162
196
|
}
|
|
163
|
-
),
|
|
164
|
-
item:
|
|
197
|
+
), ze = {
|
|
198
|
+
item: me
|
|
165
199
|
};
|
|
166
|
-
|
|
200
|
+
xe.displayName = "KendoReactSchedulerViewItem";
|
|
167
201
|
export {
|
|
168
|
-
|
|
169
|
-
|
|
202
|
+
xe as SchedulerViewItem,
|
|
203
|
+
ze as schedulerViewItemDefaultProps
|
|
170
204
|
};
|
|
@@ -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 u=require("@progress/kendo-react-common"),w=require("react"),h=require("../../hooks/useControlledState.js"),a=require("../../utils/index.js"),_=require("../../constants/index.js"),x=require("../../context/SchedulerViewContext.js"),C=require("../../context/SchedulerContext.js");function O(e){const A=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const d in e)if(d!=="default"){const i=Object.getOwnPropertyDescriptor(e,d);Object.defineProperty(A,d,i.get?i:{enumerable:!0,get:()=>e[d]})}}return A.default=e,Object.freeze(A)}const T=O(w);var F=(e=>(e.set="DRAG_ITEM_SET",e.start="DRAG_ITEM_START",e.drag="DRAG_ITEM_DRAG",e.complete="DRAG_ITEM_COMPLETE",e.completeOccurrence="DRAG_ITEM_COMPLETE_OCCURRENCE",e.completeSeries="DRAG_ITEM_COMPLETE_SERIES",e.reset="DRAG_ITEM_RESET",e.dragSelected="DRAG_ITEM_DRAG_SELECTED",e))(F||{});const k=(e,A)=>{const d=T.useRef(0),i=T.useRef(0),R=T.useRef(0),b=T.useRef(null),[n,c]=h.useControlledState(...A),[G]=x.useSchedulerViewSelectedItemsContext(),s=C.useSchedulerFieldsContext(),g=C.useSchedulerGroupsContext();return[n,c,l=>{switch(l.type){case"DRAG_ITEM_SET":{c(l.payload);break}case"DRAG_ITEM_RESET":{c(null);break}case"DRAG_ITEM_DRAG_SELECTED":{if(Math.abs(i.current-l.payload.x)<10&&Math.abs(R.current-l.payload.y)<10)return;const t=a.slotDive(l.payload.x,l.payload.y,7);if(!t||t===b.current)return;const r=u.clone(e.dataItem),o=t.getAttribute("data-slot-start"),y=t.getAttribute("data-slot-allday")==="true";if(!e.ignoreIsAllDay&&y!==e.isAllDay)return;const m=new Date(a.getField(r,s.start)),D=Number(o)-m.getTime(),M=G.map(E=>{if(!E.current)return null;const I=u.clone(E.current.props.dataItem),f=new Date(E.current.props.start.getTime()+D),S=new Date(E.current.props.end.getTime()+D);return a.setField(I,s.start,f),a.setField(I,s.end,S),I}).filter(Boolean);b.current=t,c([...M]);break}case"DRAG_ITEM_START":{const t=l.payload.x,r=l.payload.y;i.current=t,R.current=r;const o=a.slotDive(t,r,7);if(!o)return;const y=u.clone(e.dataItem),m=o.getAttribute("data-slot-start"),D=a.getField(y,s.start);if(m===null)return;d.current=Number(m)-new Date(D).getTime();break}case"DRAG_ITEM_DRAG":{if(Math.abs(i.current-l.payload.x)<10&&Math.abs(R.current-l.payload.y)<10)return;const t=a.slotDive(l.payload.x,l.payload.y,7);if(!t||t===b.current)return;const r=u.clone(e.dataItem),o=t.getAttribute("data-slot-start"),y=t.getAttribute("data-slot-group"),m=t.getAttribute("data-slot-allday")==="true";if(!e.ignoreIsAllDay&&m!==e.isAllDay)return;const D=new Date(a.getField(r,s.start)),E=new Date(a.getField(r,s.end)).getTime()-D.getTime(),I=new Date(Number(o)-Number(d.current)),f=new Date(Number(o)-Number(d.current)+E),S=g.find(p=>p.index===Number(y));a.setField(r,s.start,I),a.setField(r,s.end,f),S&&g.length>1&&S.resources.forEach(p=>{p.multiple||a.setField(r,p.field,p[p.valueField])}),b.current=t,r&&c(r);break}case"DRAG_ITEM_COMPLETE":{c(null),e.onDataAction&&n&&e.onDataAction.call(void 0,{type:_.DATA_ACTION.update,series:!1,dataItem:n});break}case"DRAG_ITEM_COMPLETE_OCCURRENCE":{const t=Array.isArray(n)?n.slice():u.clone(n);c(null),e.onDataAction&&
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@progress/kendo-react-common"),w=require("react"),h=require("../../hooks/useControlledState.js"),a=require("../../utils/index.js"),_=require("../../constants/index.js"),x=require("../../context/SchedulerViewContext.js"),C=require("../../context/SchedulerContext.js");function O(e){const A=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const d in e)if(d!=="default"){const i=Object.getOwnPropertyDescriptor(e,d);Object.defineProperty(A,d,i.get?i:{enumerable:!0,get:()=>e[d]})}}return A.default=e,Object.freeze(A)}const T=O(w);var F=(e=>(e.set="DRAG_ITEM_SET",e.start="DRAG_ITEM_START",e.drag="DRAG_ITEM_DRAG",e.complete="DRAG_ITEM_COMPLETE",e.completeOccurrence="DRAG_ITEM_COMPLETE_OCCURRENCE",e.completeSeries="DRAG_ITEM_COMPLETE_SERIES",e.reset="DRAG_ITEM_RESET",e.dragSelected="DRAG_ITEM_DRAG_SELECTED",e))(F||{});const k=(e,A)=>{const d=T.useRef(0),i=T.useRef(0),R=T.useRef(0),b=T.useRef(null),[n,c]=h.useControlledState(...A),[G]=x.useSchedulerViewSelectedItemsContext(),s=C.useSchedulerFieldsContext(),g=C.useSchedulerGroupsContext();return[n,c,l=>{switch(l.type){case"DRAG_ITEM_SET":{c(l.payload);break}case"DRAG_ITEM_RESET":{c(null);break}case"DRAG_ITEM_DRAG_SELECTED":{if(Math.abs(i.current-l.payload.x)<10&&Math.abs(R.current-l.payload.y)<10)return;const t=a.slotDive(l.payload.x,l.payload.y,7);if(!t||t===b.current)return;const r=u.clone(e.dataItem),o=t.getAttribute("data-slot-start"),y=t.getAttribute("data-slot-allday")==="true";if(!e.ignoreIsAllDay&&y!==e.isAllDay)return;const m=new Date(a.getField(r,s.start)),D=Number(o)-m.getTime(),M=G.map(E=>{if(!E.current)return null;const I=u.clone(E.current.props.dataItem),f=new Date(E.current.props.start.getTime()+D),S=new Date(E.current.props.end.getTime()+D);return a.setField(I,s.start,f),a.setField(I,s.end,S),I}).filter(Boolean);b.current=t,c([...M]);break}case"DRAG_ITEM_START":{const t=l.payload.x,r=l.payload.y;i.current=t,R.current=r;const o=a.slotDive(t,r,7);if(!o)return;const y=u.clone(e.dataItem),m=o.getAttribute("data-slot-start"),D=a.getField(y,s.start);if(m===null)return;d.current=Number(m)-new Date(D).getTime();break}case"DRAG_ITEM_DRAG":{if(Math.abs(i.current-l.payload.x)<10&&Math.abs(R.current-l.payload.y)<10)return;const t=a.slotDive(l.payload.x,l.payload.y,7);if(!t||t===b.current)return;const r=u.clone(e.dataItem),o=t.getAttribute("data-slot-start"),y=t.getAttribute("data-slot-group"),m=t.getAttribute("data-slot-allday")==="true";if(!e.ignoreIsAllDay&&m!==e.isAllDay)return;const D=new Date(a.getField(r,s.start)),E=new Date(a.getField(r,s.end)).getTime()-D.getTime(),I=new Date(Number(o)-Number(d.current)),f=new Date(Number(o)-Number(d.current)+E),S=g.find(p=>p.index===Number(y));a.setField(r,s.start,I),a.setField(r,s.end,f),S&&g.length>1&&S.resources.forEach(p=>{p.multiple||a.setField(r,p.field,p[p.valueField])}),b.current=t,r&&c(r);break}case"DRAG_ITEM_COMPLETE":{c(null),e.onDataAction&&n&&e.onDataAction.call(void 0,{type:_.DATA_ACTION.update,series:!1,dataItem:n});break}case"DRAG_ITEM_COMPLETE_OCCURRENCE":{const t=Array.isArray(n)?n.slice():u.clone(n);c(null),e.onDataAction&&t&&e.onDataAction.call(void 0,{type:_.DATA_ACTION.update,series:!1,dataItem:t});break}case"DRAG_ITEM_COMPLETE_SERIES":{let t;if(Array.isArray(n))t=n.map(r=>{const o=u.clone(r);return a.setField(o,s.start,a.getField(r,s.start)),a.setField(o,s.end,a.getField(r,s.end)),o});else{const r=u.clone(n);a.setField(r,s.start,a.getField(n,s.start)),a.setField(r,s.end,a.getField(n,s.end)),t=r}c(null),e.onDataAction&&t&&e.onDataAction.call(void 0,{type:_.DATA_ACTION.update,series:!0,dataItem:t});break}default:c(n);break}}]};exports.DRAG_ITEM_ACTION=F;exports.useDragItem=k;
|
|
@@ -80,7 +80,7 @@ const B = (t, w) => {
|
|
|
80
80
|
}
|
|
81
81
|
case "DRAG_ITEM_COMPLETE_OCCURRENCE": {
|
|
82
82
|
const e = Array.isArray(s) ? s.slice() : c(s);
|
|
83
|
-
o(null), t.onDataAction &&
|
|
83
|
+
o(null), t.onDataAction && e && t.onDataAction.call(void 0, {
|
|
84
84
|
type: M.update,
|
|
85
85
|
series: !1,
|
|
86
86
|
dataItem: e
|
package/package-metadata.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 e=Object.freeze({name:"@progress/kendo-react-scheduler",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-scheduler",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1783504411,version:"15.1.0-develop.10",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui"});exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -6,7 +6,7 @@ export const packageMetadata = Object.freeze({
|
|
|
6
6
|
productName: 'KendoReact',
|
|
7
7
|
productCode: 'KENDOUIREACT',
|
|
8
8
|
productCodes: ['KENDOUIREACT'],
|
|
9
|
-
publishDate:
|
|
10
|
-
version: '15.0
|
|
9
|
+
publishDate: 1783504411,
|
|
10
|
+
version: '15.1.0-develop.10',
|
|
11
11
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui'
|
|
12
12
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-scheduler",
|
|
3
|
-
"version": "15.0
|
|
3
|
+
"version": "15.1.0-develop.10",
|
|
4
4
|
"description": "React Scheduler brings the functionality of Outlook's Calendar to a single UI component. KendoReact Scheduler package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -29,15 +29,15 @@
|
|
|
29
29
|
"@progress/kendo-date-math": "^1.4.1",
|
|
30
30
|
"@progress/kendo-drawing": "^1.21.2",
|
|
31
31
|
"@progress/kendo-licensing": "^1.7.2",
|
|
32
|
-
"@progress/kendo-react-buttons": "15.0
|
|
33
|
-
"@progress/kendo-react-common": "15.0
|
|
34
|
-
"@progress/kendo-react-dateinputs": "15.0
|
|
35
|
-
"@progress/kendo-react-dialogs": "15.0
|
|
36
|
-
"@progress/kendo-react-dropdowns": "15.0
|
|
37
|
-
"@progress/kendo-react-form": "15.0
|
|
38
|
-
"@progress/kendo-react-inputs": "15.0
|
|
39
|
-
"@progress/kendo-react-intl": "15.0
|
|
40
|
-
"@progress/kendo-react-popup": "15.0
|
|
32
|
+
"@progress/kendo-react-buttons": "15.1.0-develop.10",
|
|
33
|
+
"@progress/kendo-react-common": "15.1.0-develop.10",
|
|
34
|
+
"@progress/kendo-react-dateinputs": "15.1.0-develop.10",
|
|
35
|
+
"@progress/kendo-react-dialogs": "15.1.0-develop.10",
|
|
36
|
+
"@progress/kendo-react-dropdowns": "15.1.0-develop.10",
|
|
37
|
+
"@progress/kendo-react-form": "15.1.0-develop.10",
|
|
38
|
+
"@progress/kendo-react-inputs": "15.1.0-develop.10",
|
|
39
|
+
"@progress/kendo-react-intl": "15.1.0-develop.10",
|
|
40
|
+
"@progress/kendo-react-popup": "15.1.0-develop.10",
|
|
41
41
|
"@progress/kendo-svg-icons": "^4.9.0 || ^5.0.0",
|
|
42
42
|
"react": "^18.0.0 || ^19.0.0",
|
|
43
43
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"package": {
|
|
68
68
|
"productName": "KendoReact",
|
|
69
69
|
"productCode": "KENDOUIREACT",
|
|
70
|
-
"publishDate":
|
|
70
|
+
"publishDate": 1783504411,
|
|
71
71
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui"
|
|
72
72
|
}
|
|
73
73
|
},
|