@progress/kendo-react-scheduler 9.2.0-develop.6 → 9.2.0-develop.8

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,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 m=require("react"),s=require("@progress/kendo-react-common"),d=require("../context/SchedulerViewContext.js");function f(e){const u=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const c=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(u,r,c.get?c:{enumerable:!0,get:()=>e[r]})}}return u.default=e,Object.freeze(u)}const n=f(m),p=(e,u)=>{const{_ref:r,itemRef:c,_maxSiblingsPerSlot:o}=e,t=n.useRef(null),a=n.useRef(null),[,l]=d.useSchedulerViewItemsContext();return n.useImperativeHandle(t,()=>({element:a.current,props:e,get _maxSiblingsPerSlot(){var i;return(i=o==null?void 0:o.current)!=null?i:0}})),n.useImperativeHandle(u,()=>t.current),n.useImperativeHandle(r,()=>t.current),n.useImperativeHandle(c,()=>t.current),s.useIsomorphicLayoutEffect(()=>(l({type:s.COLLECTION_ACTION.add,item:t}),()=>{l({type:s.COLLECTION_ACTION.remove,item:t})})),{item:t,element:a}};exports.useSchedulerItem=p;
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 t from "react";
10
- import { useIsomorphicLayoutEffect as l, COLLECTION_ACTION as c } from "@progress/kendo-react-common";
11
- import { useSchedulerViewItemsContext as p } from "../context/SchedulerViewContext.mjs";
12
- const f = (n, o) => {
13
- const { _ref: a, itemRef: i, _maxSiblingsPerSlot: r } = n, e = t.useRef(null), u = t.useRef(null), [, m] = p();
14
- return t.useImperativeHandle(e, () => ({
15
- element: u.current,
16
- props: n,
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
- var s;
19
- return (s = r == null ? void 0 : r.current) != null ? s : 0;
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
- })), t.useImperativeHandle(o, () => e.current), t.useImperativeHandle(a, () => e.current), t.useImperativeHandle(i, () => e.current), l(() => (m({
22
- type: c.add,
23
- item: e
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
- m({
26
- type: c.remove,
27
- item: e
37
+ s({
38
+ type: l.remove,
39
+ item: r
28
40
  });
29
41
  })), {
30
- item: e,
31
- element: u
42
+ item: r,
43
+ element: i
32
44
  };
33
45
  };
34
46
  export {
35
- f as useSchedulerItem
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.useEffect(()=>(o({type:l.COLLECTION_ACTION.add,item:e}),()=>{o({type:l.COLLECTION_ACTION.remove,item:e})})),{slot:e,element:c}};exports.useSchedulerSlot=d;
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 u } from "@progress/kendo-react-common";
10
+ import { COLLECTION_ACTION as o } from "@progress/kendo-react-common";
11
11
  import { useSchedulerViewSlotsContext as c } from "../context/SchedulerViewContext.mjs";
12
- const a = (r, o) => {
13
- const { _ref: l } = r, e = t.useRef(null), n = t.useRef(null), [, s] = c();
14
- return t.useImperativeHandle(e, () => ({ element: n.current, props: r })), t.useImperativeHandle(o, () => e.current), t.useImperativeHandle(l, () => e.current), t.useEffect(() => (s({
15
- type: u.add,
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
- s({
19
- type: u.remove,
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
- a as useSchedulerSlot
28
+ i as useSchedulerSlot
29
29
  };
@@ -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 R=require("react"),p=require("../views/common/utils.js"),_=require("../constants/index.js"),x=require("@progress/kendo-react-common"),y=require("../context/SchedulerContext.js");function E(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const c in e)if(c!=="default"){const i=Object.getOwnPropertyDescriptor(e,c);Object.defineProperty(t,c,i.get?i:{enumerable:!0,get:()=>e[c]})}}return t.default=e,Object.freeze(t)}const o=E(R),O=(e,t)=>{const c=o.useRef(),i=o.useRef(0),d=y.useSchedulerElementContext(),g=()=>{if(!e.current)return;const n=e.current.element;n&&(i.current=n.clientHeight)},l=o.useCallback(()=>{if(!t||!e.current)return;const n=e.current.element,h=e.current.props;if(!n)return;const f=p.getPadding(n);let r=0;const s=h.items.filter(a=>a._ref.current);s.forEach(a=>{if(!a._ref.current)return;const{height:b}=p.getRect(a._ref.current.element);r+=b});const u=s.length*_.BORDER_WIDTH*2+r-(f||0)+(typeof t=="object"&&t.offsetTop?t.offsetTop:0)+(typeof t=="object"&&t.offsetBottom?t.offsetBottom:0);s.length?u>i.current-f&&p.setRect(n,{height:u},!0):n&&(n.style.minHeight="")},[t,e]),m=o.useCallback(()=>{c.current!==void 0&&window.cancelAnimationFrame(c.current),c.current=window.requestAnimationFrame(()=>{l()})},[l]);x.useIsomorphicLayoutEffect(g,[]),o.useEffect(l,[e,e.current&&e.current.props,t]),o.useEffect(()=>{if(!e.current)return;const f=e.current.props.items.filter(r=>r._ref.current).map(r=>{if(!r._ref.current||!r._ref.current.element||!d.current)return;const s=window.ResizeObserver,u=s&&new s(m);return u&&u.observe(r._ref.current.element),()=>{u&&u.disconnect()}});return()=>{f.forEach(r=>r&&r())}},[m,d,e])};exports.useSlotExpand=O;
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;
@@ -6,55 +6,54 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import * as s from "react";
10
- import { getPadding as R, getRect as b, setRect as E } from "../views/common/utils.mjs";
11
- import { BORDER_WIDTH as _ } from "../constants/index.mjs";
12
- import { useIsomorphicLayoutEffect as w } from "@progress/kendo-react-common";
13
- import { useSchedulerElementContext as x } from "../context/SchedulerContext.mjs";
14
- const z = (e, t) => {
15
- const f = s.useRef(), p = s.useRef(0), a = x(), d = () => {
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
- }, m = s.useCallback(() => {
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 u = R(n);
27
- let r = 0;
28
- const i = h.items.filter((o) => o._ref.current);
29
- i.forEach((o) => {
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: g } = b(o._ref.current.element);
33
- r += g;
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 = i.length * _ * 2 + r - (u || 0) + (typeof t == "object" && t.offsetTop ? t.offsetTop : 0) + (typeof t == "object" && t.offsetBottom ? t.offsetBottom : 0);
36
- i.length ? c > p.current - u && E(n, { height: c }, !0) : n && (n.style.minHeight = "");
37
- }, [t, e]), l = s.useCallback(() => {
38
- f.current !== void 0 && window.cancelAnimationFrame(f.current), f.current = window.requestAnimationFrame(() => {
39
- m();
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
- }, [m]);
42
- w(d, []), s.useEffect(m, [e, e.current && e.current.props, t]), s.useEffect(() => {
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 u = e.current.props.items.filter((r) => r._ref.current).map((r) => {
46
- if (!r._ref.current || !r._ref.current.element || !a.current)
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 i = window.ResizeObserver, c = i && new i(l);
49
- return c && c.observe(r._ref.current.element), () => {
50
- c && c.disconnect();
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
- u.forEach((r) => r && r());
53
+ i.forEach((r) => r && r());
55
54
  };
56
- }, [l, a, e]);
55
+ }, [d, l, e]);
57
56
  };
58
57
  export {
59
- z as useSlotExpand
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.RefObject<number>;
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.RefObject<number>;
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"),oe=require("./SchedulerItem.js"),f=require("../utils/index.js"),g=require("../views/common/utils.js"),h=require("../constants/index.js"),ae=require("@progress/kendo-react-intl"),K=require("./SchedulerItemContent.js"),y=require("@progress/kendo-react-common"),D=require("@progress/kendo-svg-icons"),J=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 d in e)if(d!=="default"){const w=Object.getOwnPropertyDescriptor(e,d);Object.defineProperty(S,d,w.get?w:{enumerable:!0,get:()=>e[d]})}}return S.default=e,Object.freeze(S)}const r=me(se),fe=1,Q=r.forwardRef((e,S)=>{const{item:d,_ref:w,itemRef:X,...Y}=e,H=r.useRef(),c=r.useRef(null),q=r.useRef(null),C=r.useRef(null);r.useImperativeHandle(q,()=>({props:e,element:c.current&&c.current.element})),r.useImperativeHandle(S,()=>q.current),r.useImperativeHandle(w,()=>c.current),r.useImperativeHandle(X,()=>c.current);const Z=d||U.item,x=ae.useInternationalization(),[p]=J.useSchedulerViewItemsContext(),[k]=J.useSchedulerViewSlotsContext(),b=ue.useSchedulerElementContext(),[ee,T]=r.useState(!0),[te,ne]=r.useState(!1),M=r.useRef(0),V=y.useDir(b),W=r.useMemo(()=>e.isAllDay?x.toString(e.zonedStart,"t"):x.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd),[x,e.isAllDay,e.zonedEnd,e.zonedStart]),B=r.useMemo(()=>`(${W}): ${e.title}`,[W,e.title]),j=(n,t)=>{let i=1;return n.forEach(o=>{const u=t.filter(R=>E(o.current.props,R.props));u.length>i&&(i=u.length)}),i},re=(n,t)=>n.map(o=>t.filter(u=>E(o.current.props,u.props))),E=(n,t)=>f.intersects(n.start,n.end,t.start,t.end)&&n.group.index===t.group.index&&n.range.index===t.range.index&&(e.ignoreIsAllDay||n.isAllDay===t.isAllDay),P=()=>{const n=(k||[]).filter(o=>o.current&&E(o.current.props,e));if(n.length===0){T(!1);return}const t=f.first(n);if(!t.current||!c.current)return;const i=g.getRect(t.current.element);g.setRect(c.current.element,i)},z=()=>{const n=(k||[]).filter(s=>s.current&&E(s.current.props,e)),t=c.current&&c.current.element;if(!t||!n.length)return;const i=f.first(n),o=f.last(n);if(!i.current||!c.current||!o.current)return;const u=[],R=[],O=[],F=g.getRect(i.current.element),$=(e.vertical?F.height:F.width)/(i.current.props.end.getTime()-i.current.props.start.getTime()),v=(e.start.getTime()-i.current.props.start.getTime())*$,L=(Math.min(e.end.getTime(),o.current.props.end.getTime())-Math.max(e.start.getTime(),i.current.props.start.getTime()))*$;(p||[]).forEach(s=>{s.current&&(s.current.props.dragHint?R.push(s.current):s.current.props.resizeHint?O.push(s.current):u.push(s.current))});const I=e.dragHint||e.resizeHint?f.calculateOrder(c.current,e.dragHint?R:O,n,e.ignoreIsAllDay):e.order||0;let m=e.dragHint||e.resizeHint?j(n,e.dragHint?R:O):j(n,u);const ce=re(n,u);let _=0;const l=g.getRect(t);if(ce.forEach(s=>{let A=0;s.forEach(a=>{f.intersects(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);const G=g.getRect(a.element);a.props.order!==null&&a.props.order<I&&(A=G.top+G.height-l.top-h.BORDER_WIDTH*I+fe)}),A>_&&(_=A)}),n.length===0){T(!1);return}const le=20;l.width=e.vertical?l.width/m-h.BORDER_WIDTH-le/m:L+h.BORDER_WIDTH,l.height=e.vertical?L-h.BORDER_WIDTH:(e.resizeHint||e.dragHint)&&m<=1?l.height:e.style&&e.style.height?e.style.height:25,l.left=e.vertical?l.left+I*l.width+h.BORDER_WIDTH*I:l.left+(v<0?0:v),l.top=e.vertical?l.top+(v<0?0:v):l.top+_+h.BORDER_WIDTH*I,M.current=m,g.setRect(t,l),ne(!0),T(!0)},N=r.useCallback(n=>{const t=n&&n[0],i=C.current;H.current!==void 0&&window.cancelAnimationFrame(H.current),i&&t&&(i.width!==t.contentRect.width||i.height!==t.contentRect.height)&&(H.current=window.requestAnimationFrame(()=>{P(),z()})),C.current={width:t.contentRect.width,height:t.contentRect.height}},[P,z]);r.useEffect(P),r.useEffect(z);const ie=c.current&&c.current.element?c.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}),r.useEffect(()=>{if(!b.current)return;const n=window.ResizeObserver,t=n&&new n(N);return t&&t.observe(b.current),()=>{t&&t.disconnect()}},[N,b]),r.createElement(Z,{...Y,_ref:c,_maxSiblingsPerSlot:M,itemRef:c,style:{visibility:te?void 0:"hidden",display:ee?void 0:"none",...e.style}},!e.resizeHint&&r.createElement("span",{className:"k-event-actions"},e.tail&&r.createElement(y.IconWrap,{name:V==="rtl"?"caret-alt-right":"caret-alt-left",icon:V==="rtl"?D.caretAltRightIcon:D.caretAltLeftIcon}),e.isRecurring&&!e.isException&&r.createElement(y.IconWrap,{name:"reload",icon:D.arrowRotateCwIcon}),!e.isRecurring&&e.isException&&r.createElement(y.IconWrap,{name:"non-recurrence",icon:D.nonRecurrenceIcon})),!e.resizeHint&&r.createElement("div",{title:B},!e.isAllDay&&r.createElement(K.SchedulerItemContent,{className:"k-event-time"},B),r.createElement(K.SchedulerItemContent,null,e.title)))}),U={item:oe.SchedulerItem};Q.displayName="KendoReactSchedulerProportionalViewItem";exports.SchedulerProportionalViewItem=Q;exports.schedulerProportionalViewItemDefaultProps=U;
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 r from "react";
10
- import { SchedulerItem as ce } from "./SchedulerItem.mjs";
11
- import { first as $, last as le, calculateOrder as se, intersects as q } from "../utils/index.mjs";
12
- import { getRect as R, setRect as B } from "../views/common/utils.mjs";
13
- import { BORDER_WIDTH as d } from "../constants/index.mjs";
14
- import { useInternationalization as oe } from "@progress/kendo-react-intl";
15
- import { SchedulerItemContent as G } from "./SchedulerItemContent.mjs";
16
- import { useDir as ae, IconWrap as A } from "@progress/kendo-react-common";
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 Ie } from "../hooks/useRowSync.mjs";
21
- const Re = 1, we = r.forwardRef(
22
- (e, K) => {
23
- const { item: j, _ref: J, itemRef: Q, ...U } = e, w = r.useRef(), c = r.useRef(null), P = r.useRef(null), T = r.useRef(null);
24
- r.useImperativeHandle(P, () => ({ props: e, element: c.current && c.current.element })), r.useImperativeHandle(K, () => P.current), r.useImperativeHandle(J, () => c.current), r.useImperativeHandle(Q, () => c.current);
25
- const X = j || ve.item, v = oe(), [Y] = he(), [D] = ge(), g = Se(), [Z, E] = r.useState(!0), [p, ee] = r.useState(!1), _ = r.useRef(0), C = ae(g), M = r.useMemo(
26
- () => e.isAllDay ? v.toString(e.zonedStart, "t") : v.format("{0:t} - {1:t}", e.zonedStart, e.zonedEnd),
27
- [v, e.isAllDay, e.zonedEnd, e.zonedStart]
28
- ), O = r.useMemo(() => `(${M}): ${e.title}`, [M, e.title]), k = (n, t) => {
29
- let i = 1;
30
- return n.forEach((o) => {
31
- const u = t.filter((f) => S(o.current.props, f.props));
32
- u.length > i && (i = u.length);
33
- }), i;
34
- }, te = (n, t) => n.map((o) => t.filter((u) => S(o.current.props, u.props))), S = (n, t) => q(n.start, n.end, t.start, t.end) && n.group.index === t.group.index && n.range.index === t.range.index && (e.ignoreIsAllDay || n.isAllDay === t.isAllDay), y = () => {
35
- const n = (D || []).filter((o) => o.current && S(o.current.props, e));
36
- if (n.length === 0) {
37
- E(!1);
38
- return;
39
- }
40
- const t = $(n);
41
- if (!t.current || !c.current)
42
- return;
43
- const i = R(t.current.element);
44
- B(c.current.element, i);
45
- }, b = () => {
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 = $(n), o = le(n);
50
- if (!i.current || !c.current || !o.current)
47
+ const i = ie(c), s = ce(c);
48
+ if (!i.current || !o.current || !s.current)
51
49
  return;
52
- const u = [], f = [], H = [], F = R(i.current.element), N = (e.vertical ? F.height : F.width) / (i.current.props.end.getTime() - i.current.props.start.getTime()), I = (e.start.getTime() - i.current.props.start.getTime()) * N, L = (Math.min(e.end.getTime(), o.current.props.end.getTime()) - Math.max(e.start.getTime(), i.current.props.start.getTime())) * N;
53
- (Y || []).forEach((s) => {
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 ie = 20;
78
- l.width = e.vertical ? l.width / m - d - ie / m : L + d, l.height = e.vertical ? L - d : (e.resizeHint || e.dragHint) && m <= 1 ? l.height : e.style && e.style.height ? e.style.height : 25, l.left = e.vertical ? l.left + h * l.width + d * h : l.left + (I < 0 ? 0 : I), l.top = e.vertical ? l.top + (I < 0 ? 0 : I) : l.top + x + d * h, _.current = m, B(t, l), ee(!0), E(!0);
79
- }, V = r.useCallback(
80
- (n) => {
81
- const t = n && n[0], i = T.current;
82
- w.current !== void 0 && window.cancelAnimationFrame(w.current), i && t && (i.width !== t.contentRect.width || i.height !== t.contentRect.height) && (w.current = window.requestAnimationFrame(() => {
83
- y(), b();
84
- })), T.current = { width: t.contentRect.width, height: t.contentRect.height };
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, b]
79
+ [y]
87
80
  );
88
- r.useEffect(y), r.useEffect(b);
89
- const ne = c.current && c.current.element ? c.current.element.closest(".k-scheduler-layout") : null;
90
- return Ie({
91
- element: ne,
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
- }), r.useEffect(() => {
98
- if (!g.current)
90
+ }), t.useEffect(() => {
91
+ if (!x.current)
99
92
  return;
100
- const n = window.ResizeObserver, t = n && new n(V);
101
- return t && t.observe(g.current), () => {
102
- t && t.disconnect();
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, g]), /* @__PURE__ */ r.createElement(
105
- X,
97
+ }, [V, x]), /* @__PURE__ */ t.createElement(
98
+ K,
106
99
  {
107
- ...U,
108
- _ref: c,
109
- _maxSiblingsPerSlot: _,
110
- itemRef: c,
100
+ ...G,
101
+ _ref: o,
102
+ _order: m,
103
+ _maxSiblingsPerSlot: b,
104
+ _siblings: d,
105
+ itemRef: o,
111
106
  style: {
112
- visibility: p ? void 0 : "hidden",
113
- display: Z ? void 0 : "none",
107
+ visibility: U ? void 0 : "hidden",
108
+ display: Q ? void 0 : "none",
114
109
  ...e.style
115
110
  }
116
111
  },
117
- !e.resizeHint && /* @__PURE__ */ r.createElement("span", { className: "k-event-actions" }, e.tail && /* @__PURE__ */ r.createElement(
118
- A,
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__ */ r.createElement(A, { name: "reload", icon: de }), !e.isRecurring && e.isException && /* @__PURE__ */ r.createElement(A, { name: "non-recurrence", icon: fe })),
124
- !e.resizeHint && /* @__PURE__ */ r.createElement("div", { title: O }, !e.isAllDay && /* @__PURE__ */ r.createElement(G, { className: "k-event-time" }, O), /* @__PURE__ */ r.createElement(G, null, e.title))
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: ce
123
+ item: ne
129
124
  };
130
- we.displayName = "KendoReactSchedulerProportionalViewItem";
125
+ Re.displayName = "KendoReactSchedulerProportionalViewItem";
131
126
  export {
132
- we as SchedulerProportionalViewItem,
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 m in e)if(m!=="default"){const R=Object.getOwnPropertyDescriptor(e,m);Object.defineProperty(g,m,R.get?R:{enumerable:!0,get:()=>e[m]})}}return g.default=e,Object.freeze(g)}const n=oe(ne),ae=1,F=n.forwardRef((e,g)=>{const{item:m,_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=m||$.item,D=ie.useInternationalization(),[Q]=j.useSchedulerViewItemsContext(),[P]=j.useSchedulerViewSlotsContext(),I=se.useSchedulerElementContext(),[U,H]=n.useState(!0),[X,Y]=n.useState(!1),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 u=t.filter(d=>w(o.current.props,d.props));u.length>l&&(l=u.length)}),l},Z=(r,t)=>r.map(o=>t.filter(u=>w(o.current.props,u.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=[],u=[];(Q||[]).forEach(s=>{s.current&&(s.current.props.dragHint?o.push(s.current):s.current.props.resizeHint?u.push(s.current):l.push(s.current))});const d=e.dragHint||e.resizeHint?b.calculateOrder(c.current,e.dragHint?o:u,t,e.ignoreIsAllDay):e.order||0;let f=e.dragHint||e.resizeHint?W(t,e.dragHint?o:u):W(t,l);const ee=Z(t,l);let O=0;const i=S.getRect(r);if(ee.forEach(s=>{let _=0;s.forEach(a=>{b.intersects(a.props.start,a.props.end,e.start,e.end)&&!(e.dragHint||e.resizeHint)&&a._maxSiblingsPerSlot&&a._maxSiblingsPerSlot>f&&a.element!==r&&(f=a._maxSiblingsPerSlot);const M=S.getRect(a.element);a.props.order!==null&&a.props.order<d&&(_=M.top+M.height-i.top-h.BORDER_WIDTH*d+ae)}),_>O&&(O=_)}),t.length===0){H(!1);return}const te=K.add?20:0;i.width=e.vertical?i.width/f-h.BORDER_WIDTH-te/f:i.width*t.length-h.BORDER_WIDTH,i.height=e.vertical?i.height*t.length-h.BORDER_WIDTH:(e.resizeHint||e.dragHint)&&f<=1?i.height:e.style&&e.style.height?e.style.height:25,i.left=e.vertical?i.left+d*i.width+h.BORDER_WIDTH*d:i.left,i.top=e.vertical?i.top:i.top+O+h.BORDER_WIDTH*d,T.current=f,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,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=$;
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=$;