@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.
@@ -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 i from "react";
9
- import { SchedulerItem as oe } from "./SchedulerItem.mjs";
10
- import { first as se, calculateOrder as ce, intersects as z } from "../utils/index.mjs";
11
- import { getRect as q, setRect as ae } from "../views/common/utils.mjs";
12
- import { BORDER_WIDTH as S } from "../constants/index.mjs";
13
- import { useInternationalization as de } from "@progress/kendo-react-intl";
14
- import { SchedulerItemContent as B } from "./SchedulerItemContent.mjs";
15
- import { useDir as ue, IconWrap as x } from "@progress/kendo-react-common";
16
- import { chevronRightIcon as me, chevronLeftIcon as fe, arrowRotateCwIcon as he, arrowsNoRepeatIcon as ge } from "@progress/kendo-svg-icons";
17
- import { useRowSync as we } from "../hooks/useRowSync.mjs";
18
- import { useEditable as ve } from "../hooks/useEditable.mjs";
19
- import { useSchedulerViewItemsContext as Se, useSchedulerViewSlotsContext as Ie } from "../context/SchedulerViewContext.mjs";
20
- import { useSchedulerElementContext as ye } from "../context/SchedulerContext.mjs";
21
- const G = 1, W = 25, Re = i.forwardRef(
22
- (e, $) => {
23
- const { item: K, _ref: U, itemRef: j, ...J } = e, b = i.useRef(void 0), u = i.useRef(null), O = i.useRef(null), T = i.useRef(null), Q = ve(e.editable);
24
- i.useImperativeHandle(O, () => ({ props: e, element: u.current && u.current.element })), i.useImperativeHandle($, () => O.current), i.useImperativeHandle(U, () => u.current), i.useImperativeHandle(j, () => u.current);
25
- const X = K || Ee.item, _ = de(), [Z] = Se(), [p] = Ie(), R = ye(), [ee, D] = i.useState(!0), [te, re] = i.useState(!1), f = i.useRef(e.order), F = i.useRef(0), M = ue(R), P = i.useMemo(
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 : "" : `(${_.format("{0:t} - {1:t}", e.zonedStart, e.zonedEnd)}): ${(r = e.title) != null ? r : ""}`;
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
- [_, e.isAllDay, e.title, e.zonedEnd, e.zonedStart]
31
- ), k = (t, r) => {
32
- let d = 1;
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 a = r.filter((m) => H(l.current.props, m.props));
35
- a.length > d && (d = a.length);
36
- }), d;
37
- }, ne = (t, r) => t.map((l) => r.filter((a) => H(l.current.props, a.props))), ie = (t, r) => {
38
- var E;
39
- const d = r.filter((n) => n.props.order !== null && n.props.order !== void 0).map((n) => {
40
- let o = n.props.start, s = n.props.end;
41
- if (n.props.isAllDay) {
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 h = new Date(s.getFullYear(), s.getMonth(), s.getDate());
44
- s = h.getTime() <= o.getTime() ? new Date(o.getFullYear(), o.getMonth(), o.getDate() + 1) : h;
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: n.props.order, start: o, end: s };
47
- }), l = Array.from(new Set(d.map((n) => n.order))).sort((n, o) => n - o), a = /* @__PURE__ */ new Map();
48
- for (const n of d)
49
- a.has(n.order) || a.set(n.order, []), a.get(n.order).push({ start: n.start, end: n.end });
50
- const m = [], v = /* @__PURE__ */ new Map();
51
- for (const n of l) {
52
- const o = a.get(n);
53
- let s = -1;
54
- for (let h = 0; h < m.length; h++)
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
- (I) => m[h].every(
57
- (y) => !z(y.start, y.end, I.start, I.end, !0)
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
- s = h;
78
+ u = w;
61
79
  break;
62
80
  }
63
- s === -1 && (s = m.length, m.push([])), m[s].push(...o), v.set(n, s);
81
+ u === -1 && (u = y.length, y.push([])), y[u].push(...o), x.set(i, u);
64
82
  }
65
- return (E = v.get(t)) != null ? E : t;
66
- }, H = (t, r) => z(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,
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), A = () => {
69
- var I, y, N, L;
70
- const t = (p || []).filter((c) => c.current && H(c.current.props, e)), r = u.current && u.current.element, d = se(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
- D(!1);
90
+ N(!1);
73
91
  return;
74
92
  }
75
- if (!d.current || !r)
93
+ if (!c.current || !r)
76
94
  return;
77
- const l = q(d.current.element), a = [], m = [], v = [];
78
- (Z || []).forEach((c) => {
79
- c.current && (c.current.props.dragHint ? m.push(c.current) : c.current.props.resizeHint ? v.push(c.current) : a.push(c.current));
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 E = e.dragHint || e.resizeHint ? ce(
82
- u.current,
83
- e.dragHint ? m : v,
99
+ const x = e.dragHint || e.resizeHint ? he(
100
+ m.current,
101
+ e.dragHint ? h : y,
84
102
  t,
85
103
  e.ignoreIsAllDay
86
- ) : (I = e.order) != null ? I : 0;
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 c = e.ignoreIsAllDay ? a : a.filter((w) => w.props.isAllDay);
89
- f.current = ie(e.order, c);
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 = E;
92
- let n = e.dragHint || e.resizeHint ? k(t, e.dragHint ? m : v) : k(t, a);
93
- const o = ne(t, a);
94
- let s = 0;
95
- const h = !e.vertical && f.current !== null;
96
- if (o.forEach((c) => {
97
- let w = 0;
98
- c.forEach((g) => {
99
- if (z(g.props.start, g.props.end, e.start, e.end) && !(e.dragHint || e.resizeHint) && g._maxSiblingsPerSlot && g._maxSiblingsPerSlot > n && g.element !== r && (n = g._maxSiblingsPerSlot), !h) {
100
- const Y = q(g.element);
101
- g.props.order !== null && g.props.order !== void 0 && g.props.order < f.current && (w = Y.top + Y.height - l.top - S * f.current + G);
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
- }), w > s && (s = w);
104
- }), h) {
105
- const c = (y = e.style) == null ? void 0 : y.height, w = typeof c == "number" ? c : W;
106
- s = f.current * (w + G);
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
- D(!1);
143
+ N(!1);
110
144
  return;
111
145
  }
112
- const V = Q.add ? 20 : 0;
113
- l.width = e.vertical ? l.width / n - S - V / n : l.width * t.length - S, e.vertical ? l.height = l.height * t.length - S : (e.resizeHint || e.dragHint) && n <= 1 || (l.height = (L = (N = e.style) == null ? void 0 : N.height) != null ? L : W), l.left = e.vertical ? l.left + f.current * l.width + S * f.current : l.left, l.top = e.vertical ? l.top : l.top + s + S * f.current, F.current = n, ae(r, l), re(!0), D(!0);
114
- }, C = i.useCallback(
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], d = T.current;
117
- b.current !== void 0 && window.cancelAnimationFrame(b.current), d && r && (d.width !== r.contentRect.width || d.height !== r.contentRect.height) && (b.current = window.requestAnimationFrame(() => {
118
- A();
119
- })), T.current = { width: r.contentRect.width, height: r.contentRect.height };
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
- [A]
155
+ [O]
122
156
  );
123
- i.useEffect(A);
124
- const le = u.current && u.current.element ? u.current.element.closest(".k-scheduler-layout") : null;
125
- return we({
126
- element: le,
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
- }), i.useEffect(() => {
133
- if (!R.current)
166
+ }), n.useEffect(() => {
167
+ if (!P.current)
134
168
  return;
135
- const t = window.ResizeObserver, r = t && new t(C);
136
- return r && r.observe(R.current), () => {
169
+ const t = window.ResizeObserver, r = t && new t($);
170
+ return r && r.observe(P.current), () => {
137
171
  r && r.disconnect();
138
172
  };
139
- }, [C, R]), /* @__PURE__ */ i.createElement(
140
- X,
173
+ }, [$, P]), /* @__PURE__ */ n.createElement(
174
+ re,
141
175
  {
142
- ...J,
143
- _ref: u,
144
- _maxSiblingsPerSlot: F,
176
+ ...ee,
177
+ _ref: m,
178
+ _maxSiblingsPerSlot: Y,
145
179
  _order: f,
146
- itemRef: u,
180
+ itemRef: m,
147
181
  style: {
148
- visibility: te ? void 0 : "hidden",
149
- display: ee ? void 0 : "none",
182
+ visibility: oe ? void 0 : "hidden",
183
+ display: le ? void 0 : "none",
150
184
  ...e.style
151
185
  }
152
186
  },
153
- !e.resizeHint && /* @__PURE__ */ i.createElement("span", { className: "k-event-actions" }, e.tail && /* @__PURE__ */ i.createElement(
154
- x,
187
+ !e.resizeHint && /* @__PURE__ */ n.createElement("span", { className: "k-event-actions" }, e.tail && /* @__PURE__ */ n.createElement(
188
+ V,
155
189
  {
156
- name: M === "rtl" ? "chevron-right" : "chevron-left",
157
- icon: M === "rtl" ? me : fe
190
+ name: q === "rtl" ? "chevron-right" : "chevron-left",
191
+ icon: q === "rtl" ? ye : Ie
158
192
  }
159
- ), e.isRecurring && !e.isException && /* @__PURE__ */ i.createElement(x, { name: "arrow-rotate-cw", icon: he }), !e.isRecurring && e.isException && /* @__PURE__ */ i.createElement(x, { name: "arrows-no-repeat", icon: ge })),
160
- !e.resizeHint && /* @__PURE__ */ i.createElement("div", { title: P }, !e.isAllDay && /* @__PURE__ */ i.createElement(B, { className: "k-event-time" }, P), /* @__PURE__ */ i.createElement(B, null, e.title))
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
- ), Ee = {
164
- item: oe
197
+ ), ze = {
198
+ item: me
165
199
  };
166
- Re.displayName = "KendoReactSchedulerViewItem";
200
+ xe.displayName = "KendoReactSchedulerViewItem";
167
201
  export {
168
- Re as SchedulerViewItem,
169
- Ee as schedulerViewItemDefaultProps
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&&n&&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;
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 && s && t.onDataAction.call(void 0, {
83
+ o(null), t.onDataAction && e && t.onDataAction.call(void 0, {
84
84
  type: M.update,
85
85
  series: !1,
86
86
  dataItem: e
@@ -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: 1780558755,version:"15.0.1-develop.9",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui"});exports.packageMetadata=e;
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;
@@ -6,7 +6,7 @@ export const packageMetadata = Object.freeze({
6
6
  productName: 'KendoReact',
7
7
  productCode: 'KENDOUIREACT',
8
8
  productCodes: ['KENDOUIREACT'],
9
- publishDate: 1780558755,
10
- version: '15.0.1-develop.9',
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.1-develop.9",
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.1-develop.9",
33
- "@progress/kendo-react-common": "15.0.1-develop.9",
34
- "@progress/kendo-react-dateinputs": "15.0.1-develop.9",
35
- "@progress/kendo-react-dialogs": "15.0.1-develop.9",
36
- "@progress/kendo-react-dropdowns": "15.0.1-develop.9",
37
- "@progress/kendo-react-form": "15.0.1-develop.9",
38
- "@progress/kendo-react-inputs": "15.0.1-develop.9",
39
- "@progress/kendo-react-intl": "15.0.1-develop.9",
40
- "@progress/kendo-react-popup": "15.0.1-develop.9",
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": 1780558755,
70
+ "publishDate": 1783504411,
71
71
  "licensingDocsUrl": "https://www.telerik.com/kendo-react-ui"
72
72
  }
73
73
  },