@progress/kendo-react-scheduler 9.2.0-develop.5 → 9.2.0-develop.7
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/useSchedulerItem.js +1 -1
- package/hooks/useSchedulerItem.mjs +31 -19
- package/hooks/useSchedulerSlot.js +1 -1
- package/hooks/useSchedulerSlot.mjs +8 -8
- package/hooks/useSlotExpand.js +1 -1
- package/hooks/useSlotExpand.mjs +29 -30
- package/index.d.mts +10 -2
- package/index.d.ts +10 -2
- package/items/SchedulerProportionalViewItem.js +1 -1
- package/items/SchedulerProportionalViewItem.mjs +89 -94
- package/items/SchedulerViewItem.js +1 -1
- package/items/SchedulerViewItem.mjs +28 -28
- package/package-metadata.mjs +1 -1
- package/package.json +10 -10
- package/utils/index.js +1 -1
- package/utils/index.mjs +98 -92
|
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("react"),d=require("@progress/kendo-react-common"),O=require("../context/SchedulerViewContext.js");function _(t){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(i,n,s.get?s:{enumerable:!0,get:()=>t[n]})}}return i.default=t,Object.freeze(i)}const u=_(I),g=(t,i)=>{const{_ref:n,itemRef:s,_maxSiblingsPerSlot:c,_siblings:a,_order:o}=t,r=u.useRef(null),m=u.useRef(null),[,f]=O.useSchedulerViewItemsContext();return u.useImperativeHandle(r,()=>({element:m.current,props:t,get _maxSiblingsPerSlot(){return c==null?void 0:c.current},set _maxSiblingsPerSlot(e){var S;e!=null&&c!==void 0&&c.current!==void 0&&(c.current=e,(S=a==null?void 0:a.current)==null||S.forEach(l=>{var p;!l||l._maxSiblingsPerSlot===e||e<((p=l._maxSiblingsPerSlot)!=null?p:0)||(l._maxSiblingsPerSlot=e)}))},get _order(){return o==null?void 0:o.current},set _order(e){e!==void 0&&o!==void 0&&o.current!==void 0&&(o.current=e)}})),u.useImperativeHandle(i,()=>r.current),u.useImperativeHandle(n,()=>r.current),u.useImperativeHandle(s,()=>r.current),d.useIsomorphicLayoutEffect(()=>(f({type:d.COLLECTION_ACTION.add,item:r}),()=>{f({type:d.COLLECTION_ACTION.remove,item:r})})),{item:r,element:m}};exports.useSchedulerItem=g;
|
|
@@ -6,31 +6,43 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import { useIsomorphicLayoutEffect as
|
|
11
|
-
import { useSchedulerViewItemsContext as
|
|
12
|
-
const
|
|
13
|
-
const { _ref:
|
|
14
|
-
return
|
|
15
|
-
element:
|
|
16
|
-
props:
|
|
9
|
+
import * as o from "react";
|
|
10
|
+
import { useIsomorphicLayoutEffect as S, COLLECTION_ACTION as l } from "@progress/kendo-react-common";
|
|
11
|
+
import { useSchedulerViewItemsContext as x } from "../context/SchedulerViewContext.mjs";
|
|
12
|
+
const v = (m, a) => {
|
|
13
|
+
const { _ref: p, itemRef: I, _maxSiblingsPerSlot: t, _siblings: c, _order: n } = m, r = o.useRef(null), i = o.useRef(null), [, s] = x();
|
|
14
|
+
return o.useImperativeHandle(r, () => ({
|
|
15
|
+
element: i.current,
|
|
16
|
+
props: m,
|
|
17
17
|
get _maxSiblingsPerSlot() {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
return t == null ? void 0 : t.current;
|
|
19
|
+
},
|
|
20
|
+
set _maxSiblingsPerSlot(e) {
|
|
21
|
+
var d;
|
|
22
|
+
e != null && t !== void 0 && t.current !== void 0 && (t.current = e, (d = c == null ? void 0 : c.current) == null || d.forEach((u) => {
|
|
23
|
+
var f;
|
|
24
|
+
!u || u._maxSiblingsPerSlot === e || e < ((f = u._maxSiblingsPerSlot) != null ? f : 0) || (u._maxSiblingsPerSlot = e);
|
|
25
|
+
}));
|
|
26
|
+
},
|
|
27
|
+
get _order() {
|
|
28
|
+
return n == null ? void 0 : n.current;
|
|
29
|
+
},
|
|
30
|
+
set _order(e) {
|
|
31
|
+
e !== void 0 && n !== void 0 && n.current !== void 0 && (n.current = e);
|
|
20
32
|
}
|
|
21
|
-
})),
|
|
22
|
-
type:
|
|
23
|
-
item:
|
|
33
|
+
})), o.useImperativeHandle(a, () => r.current), o.useImperativeHandle(p, () => r.current), o.useImperativeHandle(I, () => r.current), S(() => (s({
|
|
34
|
+
type: l.add,
|
|
35
|
+
item: r
|
|
24
36
|
}), () => {
|
|
25
|
-
|
|
26
|
-
type:
|
|
27
|
-
item:
|
|
37
|
+
s({
|
|
38
|
+
type: l.remove,
|
|
39
|
+
item: r
|
|
28
40
|
});
|
|
29
41
|
})), {
|
|
30
|
-
item:
|
|
31
|
-
element:
|
|
42
|
+
item: r,
|
|
43
|
+
element: i
|
|
32
44
|
};
|
|
33
45
|
};
|
|
34
46
|
export {
|
|
35
|
-
|
|
47
|
+
v as useSchedulerItem
|
|
36
48
|
};
|
|
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),l=require("@progress/kendo-react-common"),a=require("../context/SchedulerViewContext.js");function i(t){const u=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const e=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(u,n,e.get?e:{enumerable:!0,get:()=>t[n]})}}return u.default=t,Object.freeze(u)}const r=i(s),d=(t,u)=>{const{_ref:n}=t,e=r.useRef(null),c=r.useRef(null),[,o]=a.useSchedulerViewSlotsContext();return r.useImperativeHandle(e,()=>({element:c.current,props:t})),r.useImperativeHandle(u,()=>e.current),r.useImperativeHandle(n,()=>e.current),r.
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),l=require("@progress/kendo-react-common"),a=require("../context/SchedulerViewContext.js");function i(t){const u=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const e=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(u,n,e.get?e:{enumerable:!0,get:()=>t[n]})}}return u.default=t,Object.freeze(u)}const r=i(s),d=(t,u)=>{const{_ref:n}=t,e=r.useRef(null),c=r.useRef(null),[,o]=a.useSchedulerViewSlotsContext();return r.useImperativeHandle(e,()=>({element:c.current,props:t})),r.useImperativeHandle(u,()=>e.current),r.useImperativeHandle(n,()=>e.current),r.useLayoutEffect(()=>(o({type:l.COLLECTION_ACTION.add,item:e}),()=>{o({type:l.COLLECTION_ACTION.remove,item:e})})),{slot:e,element:c}};exports.useSchedulerSlot=d;
|
|
@@ -7,16 +7,16 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as t from "react";
|
|
10
|
-
import { COLLECTION_ACTION as
|
|
10
|
+
import { COLLECTION_ACTION as o } from "@progress/kendo-react-common";
|
|
11
11
|
import { useSchedulerViewSlotsContext as c } from "../context/SchedulerViewContext.mjs";
|
|
12
|
-
const
|
|
13
|
-
const { _ref: l } = r, e = t.useRef(null), n = t.useRef(null), [,
|
|
14
|
-
return t.useImperativeHandle(e, () => ({ element: n.current, props: r })), t.useImperativeHandle(
|
|
15
|
-
type:
|
|
12
|
+
const i = (r, s) => {
|
|
13
|
+
const { _ref: l } = r, e = t.useRef(null), n = t.useRef(null), [, u] = c();
|
|
14
|
+
return t.useImperativeHandle(e, () => ({ element: n.current, props: r })), t.useImperativeHandle(s, () => e.current), t.useImperativeHandle(l, () => e.current), t.useLayoutEffect(() => (u({
|
|
15
|
+
type: o.add,
|
|
16
16
|
item: e
|
|
17
17
|
}), () => {
|
|
18
|
-
|
|
19
|
-
type:
|
|
18
|
+
u({
|
|
19
|
+
type: o.remove,
|
|
20
20
|
item: e
|
|
21
21
|
});
|
|
22
22
|
})), {
|
|
@@ -25,5 +25,5 @@ const a = (r, o) => {
|
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
27
|
export {
|
|
28
|
-
|
|
28
|
+
i as useSchedulerSlot
|
|
29
29
|
};
|
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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("react"),d=require("../views/common/utils.js"),E=require("../constants/index.js"),O=require("@progress/kendo-react-common"),S=require("../context/SchedulerContext.js");function j(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const c in e)if(c!=="default"){const f=Object.getOwnPropertyDescriptor(e,c);Object.defineProperty(t,c,f.get?f:{enumerable:!0,get:()=>e[c]})}}return t.default=e,Object.freeze(t)}const i=j(x),q=(e,t)=>{const c=i.useRef(),f=i.useRef(0),m=S.useSchedulerElementContext(),w=()=>{if(!e.current)return;const n=e.current.element;n&&(f.current=n.clientHeight)},p=i.useCallback(()=>{if(!t||!e.current)return;const n=e.current.element,g=e.current.props;if(!n)return;const a=d.getPadding(n),r=new Map,o=g.items.filter(u=>u._ref.current);o.forEach(u=>{var R,v,y;if(!u._ref.current)return;const{height:l}=d.getRect(u._ref.current.element),_=(v=(R=u._ref.current)==null?void 0:R._order)!=null?v:-1;((y=r.get(_))!=null?y:0)<l&&r.set(_,l)});const s=Array.from(r.values()).reduce((u,l)=>u+l,0),b=o.length*E.BORDER_WIDTH*2+s-(a||0)+(typeof t=="object"&&t.offsetTop?t.offsetTop:0)+(typeof t=="object"&&t.offsetBottom?t.offsetBottom:0);o.length?b>f.current-a&&d.setRect(n,{height:b},!0):n&&(n.style.minHeight="")},[t,e]),h=i.useCallback(()=>{c.current!==void 0&&window.cancelAnimationFrame(c.current),c.current=window.requestAnimationFrame(()=>{p()})},[p]);O.useIsomorphicLayoutEffect(w,[]),i.useEffect(p,[e,e.current&&e.current.props,t]),i.useEffect(()=>{if(!e.current)return;const a=e.current.props.items.filter(r=>r._ref.current).map(r=>{if(!r._ref.current||!r._ref.current.element||!m.current)return;const o=window.ResizeObserver,s=o&&new o(h);return s&&s.observe(r._ref.current.element),()=>{s&&s.disconnect()}});return()=>{a.forEach(r=>r&&r())}},[h,m,e])};exports.useSlotExpand=q;
|
package/hooks/useSlotExpand.mjs
CHANGED
|
@@ -6,55 +6,54 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import { getPadding as
|
|
11
|
-
import { BORDER_WIDTH as
|
|
12
|
-
import { useIsomorphicLayoutEffect as
|
|
13
|
-
import { useSchedulerElementContext as
|
|
14
|
-
const
|
|
15
|
-
const
|
|
9
|
+
import * as u from "react";
|
|
10
|
+
import { getPadding as E, getRect as x, setRect as H } from "../views/common/utils.mjs";
|
|
11
|
+
import { BORDER_WIDTH as y } from "../constants/index.mjs";
|
|
12
|
+
import { useIsomorphicLayoutEffect as k } from "@progress/kendo-react-common";
|
|
13
|
+
import { useSchedulerElementContext as z } from "../context/SchedulerContext.mjs";
|
|
14
|
+
const O = (e, t) => {
|
|
15
|
+
const m = u.useRef(), p = u.useRef(0), l = z(), w = () => {
|
|
16
16
|
if (!e.current)
|
|
17
17
|
return;
|
|
18
18
|
const n = e.current.element;
|
|
19
19
|
n && (p.current = n.clientHeight);
|
|
20
|
-
},
|
|
20
|
+
}, a = u.useCallback(() => {
|
|
21
21
|
if (!t || !e.current)
|
|
22
22
|
return;
|
|
23
23
|
const n = e.current.element, h = e.current.props;
|
|
24
24
|
if (!n)
|
|
25
25
|
return;
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (!o._ref.current)
|
|
26
|
+
const i = E(n), r = /* @__PURE__ */ new Map(), o = h.items.filter((c) => c._ref.current);
|
|
27
|
+
o.forEach((c) => {
|
|
28
|
+
var R, b, v;
|
|
29
|
+
if (!c._ref.current)
|
|
31
30
|
return;
|
|
32
|
-
const { height:
|
|
33
|
-
r
|
|
31
|
+
const { height: f } = x(c._ref.current.element), _ = (b = (R = c._ref.current) == null ? void 0 : R._order) != null ? b : -1;
|
|
32
|
+
((v = r.get(_)) != null ? v : 0) < f && r.set(_, f);
|
|
34
33
|
});
|
|
35
|
-
const c =
|
|
36
|
-
|
|
37
|
-
}, [t, e]),
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
const s = Array.from(r.values()).reduce((c, f) => c + f, 0), g = o.length * y * 2 + s - (i || 0) + (typeof t == "object" && t.offsetTop ? t.offsetTop : 0) + (typeof t == "object" && t.offsetBottom ? t.offsetBottom : 0);
|
|
35
|
+
o.length ? g > p.current - i && H(n, { height: g }, !0) : n && (n.style.minHeight = "");
|
|
36
|
+
}, [t, e]), d = u.useCallback(() => {
|
|
37
|
+
m.current !== void 0 && window.cancelAnimationFrame(m.current), m.current = window.requestAnimationFrame(() => {
|
|
38
|
+
a();
|
|
40
39
|
});
|
|
41
|
-
}, [
|
|
42
|
-
w
|
|
40
|
+
}, [a]);
|
|
41
|
+
k(w, []), u.useEffect(a, [e, e.current && e.current.props, t]), u.useEffect(() => {
|
|
43
42
|
if (!e.current)
|
|
44
43
|
return;
|
|
45
|
-
const
|
|
46
|
-
if (!r._ref.current || !r._ref.current.element || !
|
|
44
|
+
const i = e.current.props.items.filter((r) => r._ref.current).map((r) => {
|
|
45
|
+
if (!r._ref.current || !r._ref.current.element || !l.current)
|
|
47
46
|
return;
|
|
48
|
-
const
|
|
49
|
-
return
|
|
50
|
-
|
|
47
|
+
const o = window.ResizeObserver, s = o && new o(d);
|
|
48
|
+
return s && s.observe(r._ref.current.element), () => {
|
|
49
|
+
s && s.disconnect();
|
|
51
50
|
};
|
|
52
51
|
});
|
|
53
52
|
return () => {
|
|
54
|
-
|
|
53
|
+
i.forEach((r) => r && r());
|
|
55
54
|
};
|
|
56
|
-
}, [
|
|
55
|
+
}, [d, l, e]);
|
|
57
56
|
};
|
|
58
57
|
export {
|
|
59
|
-
|
|
58
|
+
O as useSlotExpand
|
|
60
59
|
};
|
package/index.d.mts
CHANGED
|
@@ -2542,7 +2542,11 @@ export declare interface SchedulerItemHandle {
|
|
|
2542
2542
|
element: HTMLDivElement | null;
|
|
2543
2543
|
props: SchedulerItemProps;
|
|
2544
2544
|
/** @hidden */
|
|
2545
|
-
_maxSiblingsPerSlot?: number;
|
|
2545
|
+
_maxSiblingsPerSlot?: number | null;
|
|
2546
|
+
/** @hidden */
|
|
2547
|
+
_siblings?: SchedulerItemHandle[] | null;
|
|
2548
|
+
/** @hidden */
|
|
2549
|
+
_order?: number | null;
|
|
2546
2550
|
}
|
|
2547
2551
|
|
|
2548
2552
|
/**
|
|
@@ -2743,7 +2747,11 @@ export declare interface SchedulerItemProps extends Item {
|
|
|
2743
2747
|
*/
|
|
2744
2748
|
onResizeRelease?: (event: SchedulerItemDragEvent) => void;
|
|
2745
2749
|
/** @hidden */
|
|
2746
|
-
_maxSiblingsPerSlot?: React_2.
|
|
2750
|
+
_maxSiblingsPerSlot?: React_2.MutableRefObject<number | null>;
|
|
2751
|
+
/** @hidden */
|
|
2752
|
+
_siblings?: React_2.MutableRefObject<SchedulerItemHandle[] | null>;
|
|
2753
|
+
/** @hidden */
|
|
2754
|
+
_order?: React_2.MutableRefObject<number | null>;
|
|
2747
2755
|
}
|
|
2748
2756
|
|
|
2749
2757
|
/**
|
package/index.d.ts
CHANGED
|
@@ -2542,7 +2542,11 @@ export declare interface SchedulerItemHandle {
|
|
|
2542
2542
|
element: HTMLDivElement | null;
|
|
2543
2543
|
props: SchedulerItemProps;
|
|
2544
2544
|
/** @hidden */
|
|
2545
|
-
_maxSiblingsPerSlot?: number;
|
|
2545
|
+
_maxSiblingsPerSlot?: number | null;
|
|
2546
|
+
/** @hidden */
|
|
2547
|
+
_siblings?: SchedulerItemHandle[] | null;
|
|
2548
|
+
/** @hidden */
|
|
2549
|
+
_order?: number | null;
|
|
2546
2550
|
}
|
|
2547
2551
|
|
|
2548
2552
|
/**
|
|
@@ -2743,7 +2747,11 @@ export declare interface SchedulerItemProps extends Item {
|
|
|
2743
2747
|
*/
|
|
2744
2748
|
onResizeRelease?: (event: SchedulerItemDragEvent) => void;
|
|
2745
2749
|
/** @hidden */
|
|
2746
|
-
_maxSiblingsPerSlot?: React_2.
|
|
2750
|
+
_maxSiblingsPerSlot?: React_2.MutableRefObject<number | null>;
|
|
2751
|
+
/** @hidden */
|
|
2752
|
+
_siblings?: React_2.MutableRefObject<SchedulerItemHandle[] | null>;
|
|
2753
|
+
/** @hidden */
|
|
2754
|
+
_order?: React_2.MutableRefObject<number | null>;
|
|
2747
2755
|
}
|
|
2748
2756
|
|
|
2749
2757
|
/**
|
|
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const se=require("react"),
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const se=require("react"),le=require("./SchedulerItem.js"),f=require("../utils/index.js"),E=require("../views/common/utils.js"),g=require("../constants/index.js"),ae=require("@progress/kendo-react-intl"),L=require("./SchedulerItemContent.js"),P=require("@progress/kendo-react-common"),H=require("@progress/kendo-svg-icons"),p=require("../context/SchedulerViewContext.js"),ue=require("../context/SchedulerContext.js"),de=require("../hooks/useRowSync.js");function me(e){const S=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const h in e)if(h!=="default"){const T=Object.getOwnPropertyDescriptor(e,h);Object.defineProperty(S,h,T.get?T:{enumerable:!0,get:()=>e[h]})}}return S.default=e,Object.freeze(S)}const t=me(se),he=1,G=t.forwardRef((e,S)=>{const{item:h,_ref:T,itemRef:J,...Q}=e,b=t.useRef(),o=t.useRef(null),M=t.useRef(null),q=t.useRef(null);t.useImperativeHandle(M,()=>({props:e,element:o.current&&o.current.element})),t.useImperativeHandle(S,()=>M.current),t.useImperativeHandle(T,()=>o.current),t.useImperativeHandle(J,()=>o.current);const U=h||K.item,z=ae.useInternationalization(),[X]=p.useSchedulerViewItemsContext(),[Y]=p.useSchedulerViewSlotsContext(),v=ue.useSchedulerElementContext(),[Z,C]=t.useState(!0),[ee,te]=t.useState(!1),k=t.useRef(0),d=t.useRef(null),m=t.useRef([]),W=P.useDir(v),V=t.useMemo(()=>e.isAllDay?z.toString(e.zonedStart,"t"):z.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd),[z,e.isAllDay,e.zonedEnd,e.zonedStart]),B=t.useMemo(()=>`(${V}): ${e.title}`,[V,e.title]),re=(i,n)=>{let c=0;return n.forEach(s=>{s._order!==void 0&&s._order!==null&&c<s._order&&(c=s._order)}),c+1},ne=(i,n,c)=>{const[s,R]=n,D=new Date(Math.max(e.start.getTime(),s.props.start.getTime())),_=new Date(Math.min(e.end.getTime(),R.props.end.getTime())),I=new Date(Math.max(D.getTime()+c,_.getTime()));return i.filter(l=>{const w=Math.max(l.props.start.getTime(),s.props.start.getTime()),u=Math.min(Math.max(w+c,l.props.end.getTime()),_.getTime());return l.props.id!==e.id&&l.props.group.index===e.group.index&&l.props.range.index===e.range.index&&(e.ignoreIsAllDay||l.props.isAllDay===e.isAllDay)&&f.intersects(new Date(w),new Date(u),D,I)&&f.intersects(s.props.start,R.props.end,l.props.start,l.props.end)})},ce=(i,n)=>i.group.index===n.group.index&&i.range.index===n.range.index&&(e.ignoreIsAllDay||i.isAllDay===n.isAllDay),O=()=>{var N,F,$;const i=(Y||[]).filter(r=>r.current&&ce(r.current.props,e)).sort((r,x)=>r.current.props.start.getTime()-x.current.props.start.getTime()),n=o.current&&o.current.element;if(!n||!i.length)return;const c=f.first(i),s=f.last(i);if(!c.current||!o.current||!s.current)return;if(!f.intersects(c.current.props.start,s.current.props.end,e.start,e.end)){C(!1);return}const R=[],D=[],_=[],I=E.getRect(c.current.element),y=(e.vertical?I.height:I.width)/(c.current.props.end.getTime()-c.current.props.start.getTime()),l=(e.start.getTime()-c.current.props.start.getTime())*y,w=(Math.min(e.end.getTime(),s.current.props.end.getTime())-Math.max(e.start.getTime(),c.current.props.start.getTime()))*y;(X||[]).forEach(r=>{r.current&&(r.current.props.dragHint?D.push(r.current):r.current.props.resizeHint?_.push(r.current):R.push(r.current))}),m.current=ne(R,[c.current,s.current],25/y),d.current=e.resizeHint||e.dragHint?0:f.calculateProportionalOrder(o.current,m.current);let u=1;e.resizeHint||e.dragHint||(u=re(o.current,m.current),m.current.forEach(r=>{r._maxSiblingsPerSlot&&u<r._maxSiblingsPerSlot&&(u=r._maxSiblingsPerSlot)}),m.current.forEach(r=>{r._maxSiblingsPerSlot!==void 0&&r._maxSiblingsPerSlot!==null&&r._maxSiblingsPerSlot<u&&(r._maxSiblingsPerSlot=u)}));let A=0;const a=I;m.current.forEach(r=>{let x=0;r._order!==void 0&&r._order!==null&&r._order<d.current&&(x=E.getRect(r.element).top+E.getRect(r.element).height-a.top-g.BORDER_WIDTH*d.current+he),x>A&&(A=x)});const oe=20;a.width=e.vertical?a.width/u-g.BORDER_WIDTH-oe/u:w+g.BORDER_WIDTH,a.height=e.vertical?w-g.BORDER_WIDTH:(e.resizeHint||e.dragHint)&&u<=1?a.height:e.style&&e.style.height?e.style.height:25,a.left=e.vertical?a.left+((N=d.current)!=null?N:0)+g.BORDER_WIDTH*((F=d.current)!=null?F:0)*a.width:a.left+(l<0?0:l),a.top=e.vertical?a.top+(l<0?0:l):a.top+A+g.BORDER_WIDTH*(($=d.current)!=null?$:0),k.current=u,E.setRect(n,a),te(!0),C(!0)},j=t.useCallback(i=>{const n=i&&i[0],c=q.current;b.current!==void 0&&window.cancelAnimationFrame(b.current),c&&n&&(c.width!==n.contentRect.width||c.height!==n.contentRect.height)&&(b.current=window.requestAnimationFrame(()=>{O()})),q.current={width:n.contentRect.width,height:n.contentRect.height}},[O]);t.useEffect(O);const ie=o.current&&o.current.element?o.current.element.closest(".k-scheduler-layout"):null;return de.useRowSync({element:ie,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),t.useEffect(()=>{if(!v.current)return;const i=window.ResizeObserver,n=i&&new i(j);return n&&n.observe(v.current),()=>{n&&n.disconnect()}},[j,v]),t.createElement(U,{...Q,_ref:o,_order:d,_maxSiblingsPerSlot:k,_siblings:m,itemRef:o,style:{visibility:ee?void 0:"hidden",display:Z?void 0:"none",...e.style}},!e.resizeHint&&t.createElement("span",{className:"k-event-actions"},e.tail&&t.createElement(P.IconWrap,{name:W==="rtl"?"caret-alt-right":"caret-alt-left",icon:W==="rtl"?H.caretAltRightIcon:H.caretAltLeftIcon}),e.isRecurring&&!e.isException&&t.createElement(P.IconWrap,{name:"reload",icon:H.arrowRotateCwIcon}),!e.isRecurring&&e.isException&&t.createElement(P.IconWrap,{name:"non-recurrence",icon:H.nonRecurrenceIcon})),!e.resizeHint&&t.createElement("div",{title:B},!e.isAllDay&&t.createElement(L.SchedulerItemContent,{className:"k-event-time"},B),t.createElement(L.SchedulerItemContent,null,e.title)))}),K={item:le.SchedulerItem};G.displayName="KendoReactSchedulerProportionalViewItem";exports.SchedulerProportionalViewItem=G;exports.schedulerProportionalViewItemDefaultProps=K;
|
|
@@ -6,129 +6,124 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import { SchedulerItem as
|
|
11
|
-
import { first as
|
|
12
|
-
import { getRect as
|
|
13
|
-
import { BORDER_WIDTH as
|
|
14
|
-
import { useInternationalization as
|
|
15
|
-
import { SchedulerItemContent as
|
|
16
|
-
import { useDir as ae, IconWrap as
|
|
9
|
+
import * as t from "react";
|
|
10
|
+
import { SchedulerItem as ne } from "./SchedulerItem.mjs";
|
|
11
|
+
import { first as ie, last as ce, intersects as D, calculateProportionalOrder as oe } from "../utils/index.mjs";
|
|
12
|
+
import { getRect as P, setRect as se } from "../views/common/utils.mjs";
|
|
13
|
+
import { BORDER_WIDTH as f } from "../constants/index.mjs";
|
|
14
|
+
import { useInternationalization as le } from "@progress/kendo-react-intl";
|
|
15
|
+
import { SchedulerItemContent as p } from "./SchedulerItemContent.mjs";
|
|
16
|
+
import { useDir as ae, IconWrap as z } from "@progress/kendo-react-common";
|
|
17
17
|
import { caretAltRightIcon as ue, caretAltLeftIcon as me, arrowRotateCwIcon as de, nonRecurrenceIcon as fe } from "@progress/kendo-svg-icons";
|
|
18
18
|
import { useSchedulerViewItemsContext as he, useSchedulerViewSlotsContext as ge } from "../context/SchedulerViewContext.mjs";
|
|
19
19
|
import { useSchedulerElementContext as Se } from "../context/SchedulerContext.mjs";
|
|
20
|
-
import { useRowSync as
|
|
21
|
-
const
|
|
22
|
-
(e,
|
|
23
|
-
const { item:
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
() => e.isAllDay ?
|
|
27
|
-
[
|
|
28
|
-
),
|
|
29
|
-
let i =
|
|
30
|
-
return n.forEach((
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const n = (D || []).filter((s) => s.current && S(s.current.props, e)), t = c.current && c.current.element;
|
|
47
|
-
if (!t || !n.length)
|
|
20
|
+
import { useRowSync as we } from "../hooks/useRowSync.mjs";
|
|
21
|
+
const xe = 1, Re = t.forwardRef(
|
|
22
|
+
(e, L) => {
|
|
23
|
+
const { item: $, _ref: q, itemRef: B, ...G } = e, T = t.useRef(), o = t.useRef(null), A = t.useRef(null), H = t.useRef(null);
|
|
24
|
+
t.useImperativeHandle(A, () => ({ props: e, element: o.current && o.current.element })), t.useImperativeHandle(L, () => A.current), t.useImperativeHandle(q, () => o.current), t.useImperativeHandle(B, () => o.current);
|
|
25
|
+
const K = $ || ve.item, E = le(), [j] = he(), [J] = ge(), x = Se(), [Q, M] = t.useState(!0), [U, X] = t.useState(!1), b = t.useRef(0), m = t.useRef(null), d = t.useRef([]), C = ae(x), O = t.useMemo(
|
|
26
|
+
() => e.isAllDay ? E.toString(e.zonedStart, "t") : E.format("{0:t} - {1:t}", e.zonedStart, e.zonedEnd),
|
|
27
|
+
[E, e.isAllDay, e.zonedEnd, e.zonedStart]
|
|
28
|
+
), k = t.useMemo(() => `(${O}): ${e.title}`, [O, e.title]), Y = (c, n) => {
|
|
29
|
+
let i = 0;
|
|
30
|
+
return n.forEach((s) => {
|
|
31
|
+
s._order !== void 0 && s._order !== null && i < s._order && (i = s._order);
|
|
32
|
+
}), i + 1;
|
|
33
|
+
}, Z = (c, n, i) => {
|
|
34
|
+
const [s, h] = n, R = new Date(Math.max(e.start.getTime(), s.props.start.getTime())), v = new Date(Math.min(e.end.getTime(), h.props.end.getTime())), g = new Date(Math.max(R.getTime() + i, v.getTime()));
|
|
35
|
+
return c.filter((l) => {
|
|
36
|
+
const S = Math.max(l.props.start.getTime(), s.props.start.getTime()), u = Math.min(
|
|
37
|
+
Math.max(S + i, l.props.end.getTime()),
|
|
38
|
+
v.getTime()
|
|
39
|
+
);
|
|
40
|
+
return l.props.id !== e.id && l.props.group.index === e.group.index && l.props.range.index === e.range.index && (e.ignoreIsAllDay || l.props.isAllDay === e.isAllDay) && D(new Date(S), new Date(u), R, g) && D(s.props.start, h.props.end, l.props.start, l.props.end);
|
|
41
|
+
});
|
|
42
|
+
}, ee = (c, n) => c.group.index === n.group.index && c.range.index === n.range.index && (e.ignoreIsAllDay || c.isAllDay === n.isAllDay), y = () => {
|
|
43
|
+
var F, N, W;
|
|
44
|
+
const c = (J || []).filter((r) => r.current && ee(r.current.props, e)).sort((r, w) => r.current.props.start.getTime() - w.current.props.start.getTime()), n = o.current && o.current.element;
|
|
45
|
+
if (!n || !c.length)
|
|
48
46
|
return;
|
|
49
|
-
const i =
|
|
50
|
-
if (!i.current || !
|
|
47
|
+
const i = ie(c), s = ce(c);
|
|
48
|
+
if (!i.current || !o.current || !s.current)
|
|
51
49
|
return;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
s.current && (s.current.props.dragHint ? f.push(s.current) : s.current.props.resizeHint ? H.push(s.current) : u.push(s.current));
|
|
55
|
-
});
|
|
56
|
-
const h = e.dragHint || e.resizeHint ? se(
|
|
57
|
-
c.current,
|
|
58
|
-
e.dragHint ? f : H,
|
|
59
|
-
n,
|
|
60
|
-
e.ignoreIsAllDay
|
|
61
|
-
) : e.order || 0;
|
|
62
|
-
let m = e.dragHint || e.resizeHint ? k(n, e.dragHint ? f : H) : k(n, u);
|
|
63
|
-
const re = te(n, u);
|
|
64
|
-
let x = 0;
|
|
65
|
-
const l = R(t);
|
|
66
|
-
if (re.forEach((s) => {
|
|
67
|
-
let z = 0;
|
|
68
|
-
s.forEach((a) => {
|
|
69
|
-
q(a.props.start, a.props.end, e.start, e.end) && !(e.dragHint || e.resizeHint) && a._maxSiblingsPerSlot && a._maxSiblingsPerSlot > m && a.element !== t && (m = a._maxSiblingsPerSlot);
|
|
70
|
-
const W = R(a.element);
|
|
71
|
-
a.props.order !== null && a.props.order < h && (z = W.top + W.height - l.top - d * h + Re);
|
|
72
|
-
}), z > x && (x = z);
|
|
73
|
-
}), n.length === 0) {
|
|
74
|
-
E(!1);
|
|
50
|
+
if (!D(i.current.props.start, s.current.props.end, e.start, e.end)) {
|
|
51
|
+
M(!1);
|
|
75
52
|
return;
|
|
76
53
|
}
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
54
|
+
const h = [], R = [], v = [], g = P(i.current.element), I = (e.vertical ? g.height : g.width) / (i.current.props.end.getTime() - i.current.props.start.getTime()), l = (e.start.getTime() - i.current.props.start.getTime()) * I, S = (Math.min(e.end.getTime(), s.current.props.end.getTime()) - Math.max(e.start.getTime(), i.current.props.start.getTime())) * I;
|
|
55
|
+
(j || []).forEach((r) => {
|
|
56
|
+
r.current && (r.current.props.dragHint ? R.push(r.current) : r.current.props.resizeHint ? v.push(r.current) : h.push(r.current));
|
|
57
|
+
}), d.current = Z(h, [i.current, s.current], 25 / I), m.current = e.resizeHint || e.dragHint ? 0 : oe(o.current, d.current);
|
|
58
|
+
let u = 1;
|
|
59
|
+
e.resizeHint || e.dragHint || (u = Y(o.current, d.current), d.current.forEach((r) => {
|
|
60
|
+
r._maxSiblingsPerSlot && u < r._maxSiblingsPerSlot && (u = r._maxSiblingsPerSlot);
|
|
61
|
+
}), d.current.forEach((r) => {
|
|
62
|
+
r._maxSiblingsPerSlot !== void 0 && r._maxSiblingsPerSlot !== null && r._maxSiblingsPerSlot < u && (r._maxSiblingsPerSlot = u);
|
|
63
|
+
}));
|
|
64
|
+
let _ = 0;
|
|
65
|
+
const a = g;
|
|
66
|
+
d.current.forEach((r) => {
|
|
67
|
+
let w = 0;
|
|
68
|
+
r._order !== void 0 && r._order !== null && r._order < m.current && (w = P(r.element).top + P(r.element).height - a.top - f * m.current + xe), w > _ && (_ = w);
|
|
69
|
+
});
|
|
70
|
+
const re = 20;
|
|
71
|
+
a.width = e.vertical ? a.width / u - f - re / u : S + f, a.height = e.vertical ? S - f : (e.resizeHint || e.dragHint) && u <= 1 ? a.height : e.style && e.style.height ? e.style.height : 25, a.left = e.vertical ? a.left + ((F = m.current) != null ? F : 0) + f * ((N = m.current) != null ? N : 0) * a.width : a.left + (l < 0 ? 0 : l), a.top = e.vertical ? a.top + (l < 0 ? 0 : l) : a.top + _ + f * ((W = m.current) != null ? W : 0), b.current = u, se(n, a), X(!0), M(!0);
|
|
72
|
+
}, V = t.useCallback(
|
|
73
|
+
(c) => {
|
|
74
|
+
const n = c && c[0], i = H.current;
|
|
75
|
+
T.current !== void 0 && window.cancelAnimationFrame(T.current), i && n && (i.width !== n.contentRect.width || i.height !== n.contentRect.height) && (T.current = window.requestAnimationFrame(() => {
|
|
76
|
+
y();
|
|
77
|
+
})), H.current = { width: n.contentRect.width, height: n.contentRect.height };
|
|
85
78
|
},
|
|
86
|
-
[y
|
|
79
|
+
[y]
|
|
87
80
|
);
|
|
88
|
-
|
|
89
|
-
const
|
|
90
|
-
return
|
|
91
|
-
element:
|
|
81
|
+
t.useEffect(y);
|
|
82
|
+
const te = o.current && o.current.element ? o.current.element.closest(".k-scheduler-layout") : null;
|
|
83
|
+
return we({
|
|
84
|
+
element: te,
|
|
92
85
|
selector: ".k-resource-row",
|
|
93
86
|
horizontalAttribute: "data-depth-index",
|
|
94
87
|
verticalAttribute: "data-resource-index",
|
|
95
88
|
applyTo: ".k-resource-cell",
|
|
96
89
|
syncHeight: e.isLast
|
|
97
|
-
}),
|
|
98
|
-
if (!
|
|
90
|
+
}), t.useEffect(() => {
|
|
91
|
+
if (!x.current)
|
|
99
92
|
return;
|
|
100
|
-
const
|
|
101
|
-
return
|
|
102
|
-
|
|
93
|
+
const c = window.ResizeObserver, n = c && new c(V);
|
|
94
|
+
return n && n.observe(x.current), () => {
|
|
95
|
+
n && n.disconnect();
|
|
103
96
|
};
|
|
104
|
-
}, [V,
|
|
105
|
-
|
|
97
|
+
}, [V, x]), /* @__PURE__ */ t.createElement(
|
|
98
|
+
K,
|
|
106
99
|
{
|
|
107
|
-
...
|
|
108
|
-
_ref:
|
|
109
|
-
|
|
110
|
-
|
|
100
|
+
...G,
|
|
101
|
+
_ref: o,
|
|
102
|
+
_order: m,
|
|
103
|
+
_maxSiblingsPerSlot: b,
|
|
104
|
+
_siblings: d,
|
|
105
|
+
itemRef: o,
|
|
111
106
|
style: {
|
|
112
|
-
visibility:
|
|
113
|
-
display:
|
|
107
|
+
visibility: U ? void 0 : "hidden",
|
|
108
|
+
display: Q ? void 0 : "none",
|
|
114
109
|
...e.style
|
|
115
110
|
}
|
|
116
111
|
},
|
|
117
|
-
!e.resizeHint && /* @__PURE__ */
|
|
118
|
-
|
|
112
|
+
!e.resizeHint && /* @__PURE__ */ t.createElement("span", { className: "k-event-actions" }, e.tail && /* @__PURE__ */ t.createElement(
|
|
113
|
+
z,
|
|
119
114
|
{
|
|
120
115
|
name: C === "rtl" ? "caret-alt-right" : "caret-alt-left",
|
|
121
116
|
icon: C === "rtl" ? ue : me
|
|
122
117
|
}
|
|
123
|
-
), e.isRecurring && !e.isException && /* @__PURE__ */
|
|
124
|
-
!e.resizeHint && /* @__PURE__ */
|
|
118
|
+
), e.isRecurring && !e.isException && /* @__PURE__ */ t.createElement(z, { name: "reload", icon: de }), !e.isRecurring && e.isException && /* @__PURE__ */ t.createElement(z, { name: "non-recurrence", icon: fe })),
|
|
119
|
+
!e.resizeHint && /* @__PURE__ */ t.createElement("div", { title: k }, !e.isAllDay && /* @__PURE__ */ t.createElement(p, { className: "k-event-time" }, k), /* @__PURE__ */ t.createElement(p, null, e.title))
|
|
125
120
|
);
|
|
126
121
|
}
|
|
127
122
|
), ve = {
|
|
128
|
-
item:
|
|
123
|
+
item: ne
|
|
129
124
|
};
|
|
130
|
-
|
|
125
|
+
Re.displayName = "KendoReactSchedulerProportionalViewItem";
|
|
131
126
|
export {
|
|
132
|
-
|
|
127
|
+
Re as SchedulerProportionalViewItem,
|
|
133
128
|
ve as schedulerProportionalViewItemDefaultProps
|
|
134
129
|
};
|
|
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ne=require("react"),re=require("./SchedulerItem.js"),b=require("../utils/index.js"),S=require("../views/common/utils.js"),h=require("../constants/index.js"),ie=require("@progress/kendo-react-intl"),N=require("./SchedulerItemContent.js"),E=require("@progress/kendo-react-common"),y=require("@progress/kendo-svg-icons"),ce=require("../hooks/useRowSync.js"),le=require("../hooks/useEditable.js"),j=require("../context/SchedulerViewContext.js"),se=require("../context/SchedulerContext.js");function oe(e){const g=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ne=require("react"),re=require("./SchedulerItem.js"),b=require("../utils/index.js"),S=require("../views/common/utils.js"),h=require("../constants/index.js"),ie=require("@progress/kendo-react-intl"),N=require("./SchedulerItemContent.js"),E=require("@progress/kendo-react-common"),y=require("@progress/kendo-svg-icons"),ce=require("../hooks/useRowSync.js"),le=require("../hooks/useEditable.js"),j=require("../context/SchedulerViewContext.js"),se=require("../context/SchedulerContext.js");function oe(e){const g=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const f in e)if(f!=="default"){const R=Object.getOwnPropertyDescriptor(e,f);Object.defineProperty(g,f,R.get?R:{enumerable:!0,get:()=>e[f]})}}return g.default=e,Object.freeze(g)}const n=oe(ne),ue=1,F=n.forwardRef((e,g)=>{const{item:f,_ref:R,itemRef:L,...G}=e,v=n.useRef(),c=n.useRef(null),A=n.useRef(null),q=n.useRef(null),K=le.useEditable(e.editable);n.useImperativeHandle(A,()=>({props:e,element:c.current&&c.current.element})),n.useImperativeHandle(g,()=>A.current),n.useImperativeHandle(R,()=>c.current),n.useImperativeHandle(L,()=>c.current);const J=f||$.item,D=ie.useInternationalization(),[Q]=j.useSchedulerViewItemsContext(),[P]=j.useSchedulerViewSlotsContext(),I=se.useSchedulerElementContext(),[U,H]=n.useState(!0),[X,Y]=n.useState(!1),m=n.useRef(null),T=n.useRef(0),C=E.useDir(I),k=n.useMemo(()=>e.isAllDay?D.toString(e.zonedStart,"t"):D.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd),[D,e.isAllDay,e.zonedEnd,e.zonedStart]),V=n.useMemo(()=>`(${k}): ${e.title}`,[k,e.title]),W=(r,t)=>{let l=1;return r.forEach(o=>{const a=t.filter(d=>w(o.current.props,d.props));a.length>l&&(l=a.length)}),l},Z=(r,t)=>r.map(o=>t.filter(a=>w(o.current.props,a.props))),w=(r,t)=>b.intersects(r.start,r.end,t.start,t.end)&&r.group.index===t.group.index&&r.range.index===t.range.index&&(e.ignoreIsAllDay||r.isAllDay===t.isAllDay),x=()=>{const r=(P||[]).filter(o=>o.current&&w(o.current.props,e));if(r.length===0){H(!1);return}const t=b.first(r);if(!t.current||!c.current)return;const l=S.getRect(t.current.element);S.setRect(c.current.element,l)},z=()=>{const r=c.current&&c.current.element;if(!r)return;const t=(P||[]).filter(s=>s.current&&w(s.current.props,e)),l=[],o=[],a=[];(Q||[]).forEach(s=>{s.current&&(s.current.props.dragHint?o.push(s.current):s.current.props.resizeHint?a.push(s.current):l.push(s.current))}),m.current=e.dragHint||e.resizeHint?b.calculateOrder(c.current,e.dragHint?o:a,t,e.ignoreIsAllDay):e.order||0;let d=e.dragHint||e.resizeHint?W(t,e.dragHint?o:a):W(t,l);const ee=Z(t,l);let O=0;const i=S.getRect(r);if(ee.forEach(s=>{let _=0;s.forEach(u=>{b.intersects(u.props.start,u.props.end,e.start,e.end)&&!(e.dragHint||e.resizeHint)&&u._maxSiblingsPerSlot&&u._maxSiblingsPerSlot>d&&u.element!==r&&(d=u._maxSiblingsPerSlot);const M=S.getRect(u.element);u.props.order!==null&&u.props.order<m.current&&(_=M.top+M.height-i.top-h.BORDER_WIDTH*m.current+ue)}),_>O&&(O=_)}),t.length===0){H(!1);return}const te=K.add?20:0;i.width=e.vertical?i.width/d-h.BORDER_WIDTH-te/d:i.width*t.length-h.BORDER_WIDTH,i.height=e.vertical?i.height*t.length-h.BORDER_WIDTH:(e.resizeHint||e.dragHint)&&d<=1?i.height:e.style&&e.style.height?e.style.height:25,i.left=e.vertical?i.left+m.current*i.width+h.BORDER_WIDTH*m.current:i.left,i.top=e.vertical?i.top:i.top+O+h.BORDER_WIDTH*m.current,T.current=d,S.setRect(r,i),Y(!0),H(!0)},B=n.useCallback(r=>{const t=r&&r[0],l=q.current;v.current!==void 0&&window.cancelAnimationFrame(v.current),l&&t&&(l.width!==t.contentRect.width||l.height!==t.contentRect.height)&&(v.current=window.requestAnimationFrame(()=>{x(),z()})),q.current={width:t.contentRect.width,height:t.contentRect.height}},[x,z]);n.useEffect(x),n.useEffect(z);const p=c.current&&c.current.element?c.current.element.closest(".k-scheduler-layout"):null;return ce.useRowSync({element:p,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),n.useEffect(()=>{if(!I.current)return;const r=window.ResizeObserver,t=r&&new r(B);return t&&t.observe(I.current),()=>{t&&t.disconnect()}},[B,I]),n.createElement(J,{...G,_ref:c,_maxSiblingsPerSlot:T,_order:m,itemRef:c,style:{visibility:X?void 0:"hidden",display:U?void 0:"none",...e.style}},!e.resizeHint&&n.createElement("span",{className:"k-event-actions"},e.tail&&n.createElement(E.IconWrap,{name:C==="rtl"?"caret-alt-right":"caret-alt-left",icon:C==="rtl"?y.caretAltRightIcon:y.caretAltLeftIcon}),e.isRecurring&&!e.isException&&n.createElement(E.IconWrap,{name:"arrow-rotate-cw",icon:y.arrowRotateCwIcon}),!e.isRecurring&&e.isException&&n.createElement(E.IconWrap,{name:"arrows-no-repeat",icon:y.arrowsNoRepeatIcon})),!e.resizeHint&&n.createElement("div",{title:V},!e.isAllDay&&n.createElement(N.SchedulerItemContent,{className:"k-event-time"},V),n.createElement(N.SchedulerItemContent,null,e.title)))}),$={item:re.SchedulerItem};F.displayName="KendoReactSchedulerViewItem";exports.SchedulerViewItem=F;exports.schedulerViewItemDefaultProps=$;
|