@progress/kendo-react-scheduler 15.1.0-develop.5 → 15.1.0-develop.6
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 +44 -44
- package/items/SchedulerViewItem.js +1 -1
- package/items/SchedulerViewItem.mjs +121 -109
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +11 -11
package/hooks/useSlotExpand.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react"),R=require("../views/common/utils.js"),j=require("../constants/index.js"),H=require("@progress/kendo-react-common"),k=require("../context/SchedulerContext.js");function q(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const p=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,p.get?p:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const m=q(S),C=(e,t)=>{const s=m.useRef(void 0),p=m.useRef(0),b=k.useSchedulerElementContext(),E=()=>{if(!e.current)return;const u=e.current.element;u&&(p.current=u.clientHeight)},d=m.useCallback(()=>{if(!t||!e.current)return;const u=e.current.element,g=e.current.props;if(!u)return;const o=new Map;let r=!1;const f=g.items.filter(n=>n._ref.current);f.forEach(n=>{var y,_,x,w,O;if(!n._ref.current)return;const{height:l}=R.getRect(n._ref.current.element),i=(x=(_=(y=n._ref.current)==null?void 0:y._order)!=null?_:n.order)!=null?x:-1;(w=n._ref.current.element)!=null&&w.style.top&&(r=!0),((O=o.get(i))!=null?O:0)<l&&o.set(i,l)});let c,a;if(!r||o.size===0)c=Array.from(o.values()).reduce((n,l)=>n+l,0),a=f.length;else{const n=Math.max(...Array.from(o.keys()));a=n+1;const l=Math.max(...Array.from(o.values()));c=0;for(let i=0;i<=n;i++)c+=o.has(i)?o.get(i):l}const v=a*j.BORDER_WIDTH*2+c-(typeof t=="object"&&t.offsetTop?t.offsetTop:0)+(typeof t=="object"&&t.offsetBottom?t.offsetBottom:0);f.length?v>p.current&&R.setRect(u,{height:v},!0):u&&(u.style.minHeight="")},[t,e]),h=m.useCallback(()=>{s.current!==void 0&&window.cancelAnimationFrame(s.current),s.current=window.requestAnimationFrame(()=>{d()})},[d]);H.useIsomorphicLayoutEffect(E,[]),m.useEffect(d,[e,e.current&&e.current.props,t]),m.useEffect(()=>{if(!e.current)return;const o=e.current.props.items.filter(r=>r._ref.current).map(r=>{if(!r._ref.current||!r._ref.current.element||!b.current)return;const f=window.ResizeObserver,c=f&&new f(h);c&&c.observe(r._ref.current.element);const a=new MutationObserver(h);return a.observe(r._ref.current.element,{attributes:!0,attributeFilter:["style"]}),()=>{c&&c.disconnect(),a.disconnect()}});return()=>{o.forEach(r=>r&&r())}},[h,b,e])};exports.useSlotExpand=C;
|
package/hooks/useSlotExpand.mjs
CHANGED
|
@@ -5,69 +5,69 @@
|
|
|
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 {
|
|
10
|
-
import { BORDER_WIDTH as
|
|
11
|
-
import { useIsomorphicLayoutEffect as
|
|
12
|
-
import { useSchedulerElementContext as
|
|
13
|
-
const
|
|
14
|
-
const l =
|
|
15
|
-
if (!
|
|
8
|
+
import * as m from "react";
|
|
9
|
+
import { getRect as H, setRect as O } from "../views/common/utils.mjs";
|
|
10
|
+
import { BORDER_WIDTH as A } from "../constants/index.mjs";
|
|
11
|
+
import { useIsomorphicLayoutEffect as k } from "@progress/kendo-react-common";
|
|
12
|
+
import { useSchedulerElementContext as z } from "../context/SchedulerContext.mjs";
|
|
13
|
+
const I = (e, o) => {
|
|
14
|
+
const l = m.useRef(void 0), d = m.useRef(0), b = z(), E = () => {
|
|
15
|
+
if (!e.current)
|
|
16
16
|
return;
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
}, p =
|
|
20
|
-
if (!
|
|
17
|
+
const c = e.current.element;
|
|
18
|
+
c && (d.current = c.clientHeight);
|
|
19
|
+
}, p = m.useCallback(() => {
|
|
20
|
+
if (!o || !e.current)
|
|
21
21
|
return;
|
|
22
|
-
const
|
|
23
|
-
if (!
|
|
22
|
+
const c = e.current.element, v = e.current.props;
|
|
23
|
+
if (!c)
|
|
24
24
|
return;
|
|
25
|
-
const
|
|
26
|
-
let
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
var w, x, y, R,
|
|
25
|
+
const n = /* @__PURE__ */ new Map();
|
|
26
|
+
let r = !1;
|
|
27
|
+
const i = v.items.filter((t) => t._ref.current);
|
|
28
|
+
i.forEach((t) => {
|
|
29
|
+
var w, x, y, R, g;
|
|
30
30
|
if (!t._ref.current)
|
|
31
31
|
return;
|
|
32
|
-
const { height:
|
|
33
|
-
(R = t._ref.current.element) != null && R.style.top && (
|
|
32
|
+
const { height: a } = H(t._ref.current.element), u = (y = (x = (w = t._ref.current) == null ? void 0 : w._order) != null ? x : t.order) != null ? y : -1;
|
|
33
|
+
(R = t._ref.current.element) != null && R.style.top && (r = !0), ((g = n.get(u)) != null ? g : 0) < a && n.set(u, a);
|
|
34
34
|
});
|
|
35
|
-
let
|
|
36
|
-
if (!
|
|
37
|
-
|
|
35
|
+
let s, f;
|
|
36
|
+
if (!r || n.size === 0)
|
|
37
|
+
s = Array.from(n.values()).reduce((t, a) => t + a, 0), f = i.length;
|
|
38
38
|
else {
|
|
39
|
-
const t = Math.max(...Array.from(
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
|
|
39
|
+
const t = Math.max(...Array.from(n.keys()));
|
|
40
|
+
f = t + 1;
|
|
41
|
+
const a = Math.max(...Array.from(n.values()));
|
|
42
|
+
s = 0;
|
|
43
43
|
for (let u = 0; u <= t; u++)
|
|
44
|
-
|
|
44
|
+
s += n.has(u) ? n.get(u) : a;
|
|
45
45
|
}
|
|
46
|
-
const _ =
|
|
47
|
-
|
|
48
|
-
}, [
|
|
46
|
+
const _ = f * A * 2 + s - (typeof o == "object" && o.offsetTop ? o.offsetTop : 0) + (typeof o == "object" && o.offsetBottom ? o.offsetBottom : 0);
|
|
47
|
+
i.length ? _ > d.current && O(c, { height: _ }, !0) : c && (c.style.minHeight = "");
|
|
48
|
+
}, [o, e]), h = m.useCallback(() => {
|
|
49
49
|
l.current !== void 0 && window.cancelAnimationFrame(l.current), l.current = window.requestAnimationFrame(() => {
|
|
50
50
|
p();
|
|
51
51
|
});
|
|
52
52
|
}, [p]);
|
|
53
|
-
|
|
54
|
-
if (!
|
|
53
|
+
k(E, []), m.useEffect(p, [e, e.current && e.current.props, o]), m.useEffect(() => {
|
|
54
|
+
if (!e.current)
|
|
55
55
|
return;
|
|
56
|
-
const
|
|
57
|
-
if (!
|
|
56
|
+
const n = e.current.props.items.filter((r) => r._ref.current).map((r) => {
|
|
57
|
+
if (!r._ref.current || !r._ref.current.element || !b.current)
|
|
58
58
|
return;
|
|
59
|
-
const
|
|
60
|
-
s && s.observe(
|
|
61
|
-
const
|
|
62
|
-
return
|
|
63
|
-
s && s.disconnect(),
|
|
59
|
+
const i = window.ResizeObserver, s = i && new i(h);
|
|
60
|
+
s && s.observe(r._ref.current.element);
|
|
61
|
+
const f = new MutationObserver(h);
|
|
62
|
+
return f.observe(r._ref.current.element, { attributes: !0, attributeFilter: ["style"] }), () => {
|
|
63
|
+
s && s.disconnect(), f.disconnect();
|
|
64
64
|
};
|
|
65
65
|
});
|
|
66
66
|
return () => {
|
|
67
|
-
|
|
67
|
+
n.forEach((r) => r && r());
|
|
68
68
|
};
|
|
69
|
-
}, [
|
|
69
|
+
}, [h, b, e]);
|
|
70
70
|
};
|
|
71
71
|
export {
|
|
72
|
-
|
|
72
|
+
I as useSlotExpand
|
|
73
73
|
};
|
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const he=require("react"),ge=require("./SchedulerItem.js"),A=require("../utils/index.js"),V=require("../views/common/utils.js"),x=require("../constants/index.js"),Ie=require("@progress/kendo-react-intl"),Q=require("./SchedulerItemContent.js"),q=require("@progress/kendo-react-common"),M=require("@progress/kendo-svg-icons"),Re=require("../hooks/useEditable.js"),X=require("../context/SchedulerViewContext.js"),we=require("../context/SchedulerContext.js"),ve=require("../hooks/useRowSync.js");function Se(e){const O=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const D in e)if(D!=="default"){const _=Object.getOwnPropertyDescriptor(e,D);Object.defineProperty(O,D,_.get?_:{enumerable:!0,get:()=>e[D]})}}return O.default=e,Object.freeze(O)}const i=Se(he),B=1,Z=25,p=i.forwardRef((e,O)=>{const{item:D,_ref:_,itemRef:te,...ne}=e,C=i.useRef(void 0),m=i.useRef(null),N=i.useRef(null),j=i.useRef(null),re=Re.useEditable(e.editable);i.useImperativeHandle(N,()=>({props:e,element:m.current&&m.current.element})),i.useImperativeHandle(O,()=>N.current),i.useImperativeHandle(_,()=>m.current),i.useImperativeHandle(te,()=>m.current);const ie=D||ee.item,L=Ie.useInternationalization(),[se]=X.useSchedulerViewItemsContext(),[le]=X.useSchedulerViewSlotsContext(),T=we.useSchedulerElementContext(),[oe,k]=i.useState(!0),[ce,ae]=i.useState(!1),f=i.useRef(e.order),Y=i.useRef(0),$=q.useDir(T),G=i.useMemo(()=>{var t,n;return e.isAllDay?(t=e.title)!=null?t:"":`(${L.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd)}): ${(n=e.title)!=null?n:""}`},[L,e.isAllDay,e.title,e.zonedEnd,e.zonedStart]),K=(t,n)=>{let d=1;return t.forEach(s=>{const o=n.filter(h=>F(s.current.props,h.props));o.length>d&&(d=o.length)}),d},ue=(t,n)=>t.map(s=>n.filter(o=>F(s.current.props,o.props))),de=(t,n)=>{var P;const d=n.filter(r=>r.props.order!==null&&r.props.order!==void 0).map(r=>{let c=r.props.start,a=r.props.end;if(r.props.isAllDay){c=new Date(c.getFullYear(),c.getMonth(),c.getDate());const I=new Date(a.getFullYear(),a.getMonth(),a.getDate());a=I.getTime()<=c.getTime()?new Date(c.getFullYear(),c.getMonth(),c.getDate()+1):I}return{order:r.props.order,start:c,end:a}}),s=Array.from(new Set(d.map(r=>r.order))).sort((r,c)=>r-c),o=new Map;for(const r of d)o.has(r.order)||o.set(r.order,[]),o.get(r.order).push({start:r.start,end:r.end});const h=[],S=new Map;for(const r of s){const c=o.get(r);let a=-1,I=0;S.forEach((R,E)=>{if(E>=r)return;const w=o.get(E);if(!w)return;c.some(z=>w.some(l=>A.intersects(l.start,l.end,z.start,z.end)))&&R+1>I&&(I=R+1)});for(let R=I;R<h.length;R++)if(c.every(w=>h[R].every(b=>!A.intersects(b.start,b.end,w.start,w.end)))){a=R;break}a===-1&&(a=h.length,h.push([])),h[a].push(...c),S.set(r,a)}return(P=S.get(t))!=null?P:t},F=(t,n)=>A.intersects(t.start,t.end,n.start,n.end)&&t.group.index===n.group.index&&t.range.index===n.range.index&&(t.range.isAllDay===void 0||n.range.isAllDay===void 0||t.range.isAllDay===n.range.isAllDay)&&(e.ignoreIsAllDay||t.isAllDay===n.isAllDay),W=()=>{var E,w,b,z;const t=(le||[]).filter(l=>l.current&&F(l.current.props,e)),n=m.current&&m.current.element,d=A.first(t);if(t.length===0){k(!1);return}if(!d.current||!n)return;const s=V.getRect(d.current.element),o=[],h=[],S=[];(se||[]).forEach(l=>{l.current&&(l.current.props.dragHint?h.push(l.current):l.current.props.resizeHint?S.push(l.current):o.push(l.current))});const P=e.dragHint||e.resizeHint?A.calculateOrder(m.current,e.dragHint?h:S,t,e.ignoreIsAllDay):(E=e.order)!=null?E:0;if(!e.vertical&&!(e.dragHint||e.resizeHint)&&e.order!==null&&e.order!==void 0){const v=(e.ignoreIsAllDay?o:o.filter(u=>u.props.isAllDay)).filter(u=>u.props.group.index===e.group.index);f.current=de(e.order,v)}else f.current=P;let r=e.dragHint||e.resizeHint?K(t,e.dragHint?h:S):K(t,o);const c=ue(t,o);let a=0;const I=!e.vertical&&f.current!==null;if(c.forEach(l=>{let v=0;l.forEach(u=>{if(A.intersects(u.props.start,u.props.end,e.start,e.end)&&!(e.dragHint||e.resizeHint)&&u._maxSiblingsPerSlot&&u._maxSiblingsPerSlot>r&&u.element!==n&&(r=u._maxSiblingsPerSlot),!I){const H=V.getRect(u.element);u.props.order!==null&&u.props.order!==void 0&&u.props.order<f.current&&(v=H.top+H.height-s.top-x.BORDER_WIDTH*f.current+B)}}),v>a&&(a=v)}),I){const l=(w=e.style)==null?void 0:w.height,v=typeof l=="number"?l:parseFloat(l);if(!isNaN(v))a=f.current*(v+B);else{const u=(e.ignoreIsAllDay?o:o.filter(g=>g.props.isAllDay)).filter(g=>g.props.group.index===e.group.index&&g.element!==n),H=new Map;u.forEach(g=>{var J;const y=g._order;if(y==null||y>=f.current)return;const fe=g.element&&g.element.offsetHeight||Z;H.set(y,Math.max((J=H.get(y))!=null?J:0,fe))}),a=Array.from(H.values()).reduce((g,y)=>g+y+B,0)}}if(t.length===0){k(!1);return}const R=re.add?20:0;s.width=e.vertical?s.width/r-x.BORDER_WIDTH-R/r:s.width*t.length-x.BORDER_WIDTH,e.vertical?s.height=s.height*t.length-x.BORDER_WIDTH:(e.resizeHint||e.dragHint)&&r<=1||(s.height=(z=(b=e.style)==null?void 0:b.height)!=null?z:Z),s.left=e.vertical?s.left+f.current*s.width+x.BORDER_WIDTH*f.current:s.left,s.top=e.vertical?s.top:s.top+a+x.BORDER_WIDTH*f.current,Y.current=r,V.setRect(n,s),ae(!0),k(!0)},U=i.useCallback(t=>{const n=t&&t[0],d=j.current;C.current!==void 0&&window.cancelAnimationFrame(C.current),d&&n&&(d.width!==n.contentRect.width||d.height!==n.contentRect.height)&&(C.current=window.requestAnimationFrame(()=>{W()})),j.current={width:n.contentRect.width,height:n.contentRect.height}},[W]);i.useEffect(W);const me=m.current&&m.current.element?m.current.element.closest(".k-scheduler-layout"):null;return ve.useRowSync({element:me,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),i.useEffect(()=>{if(!T.current)return;const t=window.ResizeObserver,n=t&&new t(U);return n&&n.observe(T.current),()=>{n&&n.disconnect()}},[U,T]),i.createElement(ie,{...ne,_ref:m,_maxSiblingsPerSlot:Y,_order:f,itemRef:m,style:{visibility:ce?void 0:"hidden",display:oe?void 0:"none",...e.style}},!e.resizeHint&&i.createElement("span",{className:"k-event-actions"},e.tail&&i.createElement(q.IconWrap,{name:$==="rtl"?"chevron-right":"chevron-left",icon:$==="rtl"?M.chevronRightIcon:M.chevronLeftIcon}),e.isRecurring&&!e.isException&&i.createElement(q.IconWrap,{name:"arrow-rotate-cw",icon:M.arrowRotateCwIcon}),!e.isRecurring&&e.isException&&i.createElement(q.IconWrap,{name:"arrows-no-repeat",icon:M.arrowsNoRepeatIcon})),!e.resizeHint&&i.createElement("div",{title:G},!e.isAllDay&&i.createElement(Q.SchedulerItemContent,{className:"k-event-time"},G),i.createElement(Q.SchedulerItemContent,null,e.title)))}),ee={item:ge.SchedulerItem};p.displayName="KendoReactSchedulerViewItem";exports.SchedulerViewItem=p;exports.schedulerViewItemDefaultProps=ee;
|
|
@@ -6,177 +6,189 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as i from "react";
|
|
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 { useEditable as
|
|
18
|
-
import { useSchedulerViewItemsContext as
|
|
19
|
-
import { useSchedulerElementContext as
|
|
20
|
-
import { useRowSync as
|
|
21
|
-
const
|
|
22
|
-
(e,
|
|
23
|
-
const { item:
|
|
24
|
-
i.useImperativeHandle(
|
|
25
|
-
const
|
|
9
|
+
import { SchedulerItem as de } from "./SchedulerItem.mjs";
|
|
10
|
+
import { first as ue, calculateOrder as me, intersects as P } from "../utils/index.mjs";
|
|
11
|
+
import { getRect as $, setRect as fe } from "../views/common/utils.mjs";
|
|
12
|
+
import { BORDER_WIDTH as A } from "../constants/index.mjs";
|
|
13
|
+
import { useInternationalization as he } from "@progress/kendo-react-intl";
|
|
14
|
+
import { SchedulerItemContent as K } from "./SchedulerItemContent.mjs";
|
|
15
|
+
import { useDir as ge, IconWrap as O } from "@progress/kendo-react-common";
|
|
16
|
+
import { chevronRightIcon as ve, chevronLeftIcon as we, arrowRotateCwIcon as ye, arrowsNoRepeatIcon as Ie } from "@progress/kendo-svg-icons";
|
|
17
|
+
import { useEditable as Re } from "../hooks/useEditable.mjs";
|
|
18
|
+
import { useSchedulerViewItemsContext as Se, useSchedulerViewSlotsContext as De } from "../context/SchedulerViewContext.mjs";
|
|
19
|
+
import { useSchedulerElementContext as Ee } from "../context/SchedulerContext.mjs";
|
|
20
|
+
import { useRowSync as He } from "../hooks/useRowSync.mjs";
|
|
21
|
+
const k = 1, U = 25, Ae = i.forwardRef(
|
|
22
|
+
(e, j) => {
|
|
23
|
+
const { item: J, _ref: Q, itemRef: X, ...Z } = e, M = i.useRef(void 0), m = i.useRef(null), C = i.useRef(null), N = i.useRef(null), p = Re(e.editable);
|
|
24
|
+
i.useImperativeHandle(C, () => ({ props: e, element: m.current && m.current.element })), i.useImperativeHandle(j, () => C.current), i.useImperativeHandle(Q, () => m.current), i.useImperativeHandle(X, () => m.current);
|
|
25
|
+
const ee = J || be.item, V = he(), [te] = Se(), [re] = De(), x = Ee(), [ne, _] = i.useState(!0), [ie, le] = i.useState(!1), f = i.useRef(e.order), W = i.useRef(0), B = ge(x), L = i.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 : "" : `(${V.format("{0:t} - {1:t}", e.zonedStart, e.zonedEnd)}): ${(r = e.title) != null ? r : ""}`;
|
|
29
29
|
},
|
|
30
|
-
[
|
|
31
|
-
),
|
|
30
|
+
[V, e.isAllDay, e.title, e.zonedEnd, e.zonedStart]
|
|
31
|
+
), Y = (t, r) => {
|
|
32
32
|
let u = 1;
|
|
33
33
|
return t.forEach((l) => {
|
|
34
|
-
const
|
|
35
|
-
|
|
34
|
+
const s = r.filter((h) => F(l.current.props, h.props));
|
|
35
|
+
s.length > u && (u = s.length);
|
|
36
36
|
}), u;
|
|
37
|
-
},
|
|
38
|
-
var
|
|
37
|
+
}, oe = (t, r) => t.map((l) => r.filter((s) => F(l.current.props, s.props))), se = (t, r) => {
|
|
38
|
+
var z;
|
|
39
39
|
const u = r.filter((n) => n.props.order !== null && n.props.order !== void 0).map((n) => {
|
|
40
|
-
let
|
|
40
|
+
let a = n.props.start, c = n.props.end;
|
|
41
41
|
if (n.props.isAllDay) {
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
42
|
+
a = new Date(a.getFullYear(), a.getMonth(), a.getDate());
|
|
43
|
+
const v = new Date(c.getFullYear(), c.getMonth(), c.getDate());
|
|
44
|
+
c = v.getTime() <= a.getTime() ? new Date(a.getFullYear(), a.getMonth(), a.getDate() + 1) : v;
|
|
45
45
|
}
|
|
46
|
-
return { order: n.props.order, start:
|
|
47
|
-
}), l = Array.from(new Set(u.map((n) => n.order))).sort((n,
|
|
46
|
+
return { order: n.props.order, start: a, end: c };
|
|
47
|
+
}), l = Array.from(new Set(u.map((n) => n.order))).sort((n, a) => n - a), s = /* @__PURE__ */ new Map();
|
|
48
48
|
for (const n of u)
|
|
49
|
-
|
|
50
|
-
const
|
|
49
|
+
s.has(n.order) || s.set(n.order, []), s.get(n.order).push({ start: n.start, end: n.end });
|
|
50
|
+
const h = [], R = /* @__PURE__ */ new Map();
|
|
51
51
|
for (const n of l) {
|
|
52
|
-
const
|
|
53
|
-
let
|
|
54
|
-
|
|
55
|
-
if (
|
|
52
|
+
const a = s.get(n);
|
|
53
|
+
let c = -1, v = 0;
|
|
54
|
+
R.forEach((w, D) => {
|
|
55
|
+
if (D >= n)
|
|
56
56
|
return;
|
|
57
|
-
const
|
|
58
|
-
if (!
|
|
57
|
+
const y = s.get(D);
|
|
58
|
+
if (!y)
|
|
59
59
|
return;
|
|
60
|
-
|
|
61
|
-
(
|
|
62
|
-
(o) =>
|
|
60
|
+
a.some(
|
|
61
|
+
(b) => y.some(
|
|
62
|
+
(o) => P(o.start, o.end, b.start, b.end)
|
|
63
63
|
)
|
|
64
|
-
) &&
|
|
64
|
+
) && w + 1 > v && (v = w + 1);
|
|
65
65
|
});
|
|
66
|
-
for (let
|
|
67
|
-
if (
|
|
68
|
-
(
|
|
69
|
-
(y) => !A(y.start, y.end, w.start, w.end, !0)
|
|
70
|
-
)
|
|
66
|
+
for (let w = v; w < h.length; w++)
|
|
67
|
+
if (a.every(
|
|
68
|
+
(y) => h[w].every((E) => !P(E.start, E.end, y.start, y.end))
|
|
71
69
|
)) {
|
|
72
|
-
|
|
70
|
+
c = w;
|
|
73
71
|
break;
|
|
74
72
|
}
|
|
75
|
-
|
|
73
|
+
c === -1 && (c = h.length, h.push([])), h[c].push(...a), R.set(n, c);
|
|
76
74
|
}
|
|
77
|
-
return (
|
|
78
|
-
},
|
|
75
|
+
return (z = R.get(t)) != null ? z : t;
|
|
76
|
+
}, F = (t, r) => P(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,
|
|
79
77
|
// so we need to also check range.isAllDay to distinguish between them.
|
|
80
|
-
(t.range.isAllDay === void 0 || r.range.isAllDay === void 0 || t.range.isAllDay === r.range.isAllDay) && (e.ignoreIsAllDay || t.isAllDay === r.isAllDay),
|
|
81
|
-
var
|
|
82
|
-
const t = (
|
|
78
|
+
(t.range.isAllDay === void 0 || r.range.isAllDay === void 0 || t.range.isAllDay === r.range.isAllDay) && (e.ignoreIsAllDay || t.isAllDay === r.isAllDay), T = () => {
|
|
79
|
+
var D, y, E, b;
|
|
80
|
+
const t = (re || []).filter((o) => o.current && F(o.current.props, e)), r = m.current && m.current.element, u = ue(t);
|
|
83
81
|
if (t.length === 0) {
|
|
84
|
-
|
|
82
|
+
_(!1);
|
|
85
83
|
return;
|
|
86
84
|
}
|
|
87
85
|
if (!u.current || !r)
|
|
88
86
|
return;
|
|
89
|
-
const l =
|
|
90
|
-
(
|
|
91
|
-
o.current && (o.current.props.dragHint ?
|
|
87
|
+
const l = $(u.current.element), s = [], h = [], R = [];
|
|
88
|
+
(te || []).forEach((o) => {
|
|
89
|
+
o.current && (o.current.props.dragHint ? h.push(o.current) : o.current.props.resizeHint ? R.push(o.current) : s.push(o.current));
|
|
92
90
|
});
|
|
93
|
-
const
|
|
91
|
+
const z = e.dragHint || e.resizeHint ? me(
|
|
94
92
|
m.current,
|
|
95
|
-
e.dragHint ?
|
|
93
|
+
e.dragHint ? h : R,
|
|
96
94
|
t,
|
|
97
95
|
e.ignoreIsAllDay
|
|
98
|
-
) : (
|
|
96
|
+
) : (D = e.order) != null ? D : 0;
|
|
99
97
|
if (!e.vertical && !(e.dragHint || e.resizeHint) && e.order !== null && e.order !== void 0) {
|
|
100
|
-
const I = (e.ignoreIsAllDay ?
|
|
101
|
-
|
|
98
|
+
const I = (e.ignoreIsAllDay ? s : s.filter((d) => d.props.isAllDay)).filter((d) => d.props.group.index === e.group.index);
|
|
99
|
+
f.current = se(e.order, I);
|
|
102
100
|
} else
|
|
103
|
-
|
|
104
|
-
let n = e.dragHint || e.resizeHint ?
|
|
105
|
-
const
|
|
106
|
-
let
|
|
107
|
-
const
|
|
108
|
-
if (
|
|
101
|
+
f.current = z;
|
|
102
|
+
let n = e.dragHint || e.resizeHint ? Y(t, e.dragHint ? h : R) : Y(t, s);
|
|
103
|
+
const a = oe(t, s);
|
|
104
|
+
let c = 0;
|
|
105
|
+
const v = !e.vertical && f.current !== null;
|
|
106
|
+
if (a.forEach((o) => {
|
|
109
107
|
let I = 0;
|
|
110
108
|
o.forEach((d) => {
|
|
111
|
-
if (
|
|
112
|
-
const
|
|
113
|
-
d.props.order !== null && d.props.order !== void 0 && d.props.order <
|
|
109
|
+
if (P(d.props.start, d.props.end, e.start, e.end) && !(e.dragHint || e.resizeHint) && d._maxSiblingsPerSlot && d._maxSiblingsPerSlot > n && d.element !== r && (n = d._maxSiblingsPerSlot), !v) {
|
|
110
|
+
const H = $(d.element);
|
|
111
|
+
d.props.order !== null && d.props.order !== void 0 && d.props.order < f.current && (I = H.top + H.height - l.top - A * f.current + k);
|
|
114
112
|
}
|
|
115
|
-
}), I >
|
|
116
|
-
}),
|
|
117
|
-
const o = (
|
|
118
|
-
|
|
113
|
+
}), I > c && (c = I);
|
|
114
|
+
}), v) {
|
|
115
|
+
const o = (y = e.style) == null ? void 0 : y.height, I = typeof o == "number" ? o : parseFloat(o);
|
|
116
|
+
if (!isNaN(I))
|
|
117
|
+
c = f.current * (I + k);
|
|
118
|
+
else {
|
|
119
|
+
const d = (e.ignoreIsAllDay ? s : s.filter((g) => g.props.isAllDay)).filter(
|
|
120
|
+
(g) => g.props.group.index === e.group.index && g.element !== r
|
|
121
|
+
), H = /* @__PURE__ */ new Map();
|
|
122
|
+
d.forEach((g) => {
|
|
123
|
+
var G;
|
|
124
|
+
const S = g._order;
|
|
125
|
+
if (S == null || S >= f.current)
|
|
126
|
+
return;
|
|
127
|
+
const ce = g.element && g.element.offsetHeight || U;
|
|
128
|
+
H.set(S, Math.max((G = H.get(S)) != null ? G : 0, ce));
|
|
129
|
+
}), c = Array.from(H.values()).reduce((g, S) => g + S + k, 0);
|
|
130
|
+
}
|
|
119
131
|
}
|
|
120
132
|
if (t.length === 0) {
|
|
121
|
-
|
|
133
|
+
_(!1);
|
|
122
134
|
return;
|
|
123
135
|
}
|
|
124
|
-
const
|
|
125
|
-
l.width = e.vertical ? l.width / n -
|
|
126
|
-
},
|
|
136
|
+
const w = p.add ? 20 : 0;
|
|
137
|
+
l.width = e.vertical ? l.width / n - A - w / n : l.width * t.length - A, e.vertical ? l.height = l.height * t.length - A : (e.resizeHint || e.dragHint) && n <= 1 || (l.height = (b = (E = e.style) == null ? void 0 : E.height) != null ? b : U), l.left = e.vertical ? l.left + f.current * l.width + A * f.current : l.left, l.top = e.vertical ? l.top : l.top + c + A * f.current, W.current = n, fe(r, l), le(!0), _(!0);
|
|
138
|
+
}, q = i.useCallback(
|
|
127
139
|
(t) => {
|
|
128
|
-
const r = t && t[0], u =
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
})),
|
|
140
|
+
const r = t && t[0], u = N.current;
|
|
141
|
+
M.current !== void 0 && window.cancelAnimationFrame(M.current), u && r && (u.width !== r.contentRect.width || u.height !== r.contentRect.height) && (M.current = window.requestAnimationFrame(() => {
|
|
142
|
+
T();
|
|
143
|
+
})), N.current = { width: r.contentRect.width, height: r.contentRect.height };
|
|
132
144
|
},
|
|
133
|
-
[
|
|
145
|
+
[T]
|
|
134
146
|
);
|
|
135
|
-
i.useEffect(
|
|
136
|
-
const
|
|
137
|
-
return
|
|
138
|
-
element:
|
|
147
|
+
i.useEffect(T);
|
|
148
|
+
const ae = m.current && m.current.element ? m.current.element.closest(".k-scheduler-layout") : null;
|
|
149
|
+
return He({
|
|
150
|
+
element: ae,
|
|
139
151
|
selector: ".k-resource-row",
|
|
140
152
|
horizontalAttribute: "data-depth-index",
|
|
141
153
|
verticalAttribute: "data-resource-index",
|
|
142
154
|
applyTo: ".k-resource-cell",
|
|
143
155
|
syncHeight: e.isLast
|
|
144
156
|
}), i.useEffect(() => {
|
|
145
|
-
if (!
|
|
157
|
+
if (!x.current)
|
|
146
158
|
return;
|
|
147
|
-
const t = window.ResizeObserver, r = t && new t(
|
|
148
|
-
return r && r.observe(
|
|
159
|
+
const t = window.ResizeObserver, r = t && new t(q);
|
|
160
|
+
return r && r.observe(x.current), () => {
|
|
149
161
|
r && r.disconnect();
|
|
150
162
|
};
|
|
151
|
-
}, [
|
|
152
|
-
|
|
163
|
+
}, [q, x]), /* @__PURE__ */ i.createElement(
|
|
164
|
+
ee,
|
|
153
165
|
{
|
|
154
|
-
...
|
|
166
|
+
...Z,
|
|
155
167
|
_ref: m,
|
|
156
|
-
_maxSiblingsPerSlot:
|
|
157
|
-
_order:
|
|
168
|
+
_maxSiblingsPerSlot: W,
|
|
169
|
+
_order: f,
|
|
158
170
|
itemRef: m,
|
|
159
171
|
style: {
|
|
160
|
-
visibility:
|
|
161
|
-
display:
|
|
172
|
+
visibility: ie ? void 0 : "hidden",
|
|
173
|
+
display: ne ? void 0 : "none",
|
|
162
174
|
...e.style
|
|
163
175
|
}
|
|
164
176
|
},
|
|
165
177
|
!e.resizeHint && /* @__PURE__ */ i.createElement("span", { className: "k-event-actions" }, e.tail && /* @__PURE__ */ i.createElement(
|
|
166
|
-
|
|
178
|
+
O,
|
|
167
179
|
{
|
|
168
|
-
name:
|
|
169
|
-
icon:
|
|
180
|
+
name: B === "rtl" ? "chevron-right" : "chevron-left",
|
|
181
|
+
icon: B === "rtl" ? ve : we
|
|
170
182
|
}
|
|
171
|
-
), e.isRecurring && !e.isException && /* @__PURE__ */ i.createElement(
|
|
172
|
-
!e.resizeHint && /* @__PURE__ */ i.createElement("div", { title:
|
|
183
|
+
), e.isRecurring && !e.isException && /* @__PURE__ */ i.createElement(O, { name: "arrow-rotate-cw", icon: ye }), !e.isRecurring && e.isException && /* @__PURE__ */ i.createElement(O, { name: "arrows-no-repeat", icon: Ie })),
|
|
184
|
+
!e.resizeHint && /* @__PURE__ */ i.createElement("div", { title: L }, !e.isAllDay && /* @__PURE__ */ i.createElement(K, { className: "k-event-time" }, L), /* @__PURE__ */ i.createElement(K, null, e.title))
|
|
173
185
|
);
|
|
174
186
|
}
|
|
175
|
-
),
|
|
176
|
-
item:
|
|
187
|
+
), be = {
|
|
188
|
+
item: de
|
|
177
189
|
};
|
|
178
|
-
|
|
190
|
+
Ae.displayName = "KendoReactSchedulerViewItem";
|
|
179
191
|
export {
|
|
180
|
-
|
|
181
|
-
|
|
192
|
+
Ae as SchedulerViewItem,
|
|
193
|
+
be as schedulerViewItemDefaultProps
|
|
182
194
|
};
|
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: 1782992413,version:"15.1.0-develop.6",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.1.0-develop.
|
|
9
|
+
publishDate: 1782992413,
|
|
10
|
+
version: '15.1.0-develop.6',
|
|
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.1.0-develop.
|
|
3
|
+
"version": "15.1.0-develop.6",
|
|
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.1.0-develop.
|
|
33
|
-
"@progress/kendo-react-common": "15.1.0-develop.
|
|
34
|
-
"@progress/kendo-react-dateinputs": "15.1.0-develop.
|
|
35
|
-
"@progress/kendo-react-dialogs": "15.1.0-develop.
|
|
36
|
-
"@progress/kendo-react-dropdowns": "15.1.0-develop.
|
|
37
|
-
"@progress/kendo-react-form": "15.1.0-develop.
|
|
38
|
-
"@progress/kendo-react-inputs": "15.1.0-develop.
|
|
39
|
-
"@progress/kendo-react-intl": "15.1.0-develop.
|
|
40
|
-
"@progress/kendo-react-popup": "15.1.0-develop.
|
|
32
|
+
"@progress/kendo-react-buttons": "15.1.0-develop.6",
|
|
33
|
+
"@progress/kendo-react-common": "15.1.0-develop.6",
|
|
34
|
+
"@progress/kendo-react-dateinputs": "15.1.0-develop.6",
|
|
35
|
+
"@progress/kendo-react-dialogs": "15.1.0-develop.6",
|
|
36
|
+
"@progress/kendo-react-dropdowns": "15.1.0-develop.6",
|
|
37
|
+
"@progress/kendo-react-form": "15.1.0-develop.6",
|
|
38
|
+
"@progress/kendo-react-inputs": "15.1.0-develop.6",
|
|
39
|
+
"@progress/kendo-react-intl": "15.1.0-develop.6",
|
|
40
|
+
"@progress/kendo-react-popup": "15.1.0-develop.6",
|
|
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": 1782992413,
|
|
71
71
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui"
|
|
72
72
|
}
|
|
73
73
|
},
|