@progress/kendo-react-scheduler 9.0.0-develop.13 → 9.0.0-develop.15

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 l=require("react"),o=require("@progress/kendo-react-common"),i=require("../context/SchedulerViewContext.js");function m(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=m(l),d=(e,u)=>{const{_ref:r,itemRef:c}=e,t=n.useRef(null),s=n.useRef(null),[,a]=i.useSchedulerViewItemsContext();return n.useImperativeHandle(t,()=>({element:s.current,props:e})),n.useImperativeHandle(u,()=>t.current),n.useImperativeHandle(r,()=>t.current),n.useImperativeHandle(c,()=>t.current),o.useIsomorphicLayoutEffect(()=>(a({type:o.COLLECTION_ACTION.add,item:t}),()=>{a({type:o.COLLECTION_ACTION.remove,item:t})})),{item:t,element:s}};exports.useSchedulerItem=d;
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;
@@ -7,23 +7,30 @@
7
7
  */
8
8
  "use client";
9
9
  import * as t from "react";
10
- import { useIsomorphicLayoutEffect as a, COLLECTION_ACTION as m } from "@progress/kendo-react-common";
11
- import { useSchedulerViewItemsContext as i } from "../context/SchedulerViewContext.mjs";
12
- const I = (r, s) => {
13
- const { _ref: c, itemRef: o } = r, e = t.useRef(null), n = t.useRef(null), [, u] = i();
14
- return t.useImperativeHandle(e, () => ({ element: n.current, props: r })), t.useImperativeHandle(s, () => e.current), t.useImperativeHandle(c, () => e.current), t.useImperativeHandle(o, () => e.current), a(() => (u({
15
- type: m.add,
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,
17
+ get _maxSiblingsPerSlot() {
18
+ var s;
19
+ return (s = r == null ? void 0 : r.current) != null ? s : 0;
20
+ }
21
+ })), t.useImperativeHandle(o, () => e.current), t.useImperativeHandle(a, () => e.current), t.useImperativeHandle(i, () => e.current), l(() => (m({
22
+ type: c.add,
16
23
  item: e
17
24
  }), () => {
18
- u({
19
- type: m.remove,
25
+ m({
26
+ type: c.remove,
20
27
  item: e
21
28
  });
22
29
  })), {
23
30
  item: e,
24
- element: n
31
+ element: u
25
32
  };
26
33
  };
27
34
  export {
28
- I as useSchedulerItem
35
+ f as useSchedulerItem
29
36
  };
package/index.d.mts CHANGED
@@ -2540,6 +2540,8 @@ declare type SchedulerItemFormItemAction = {
2540
2540
  export declare interface SchedulerItemHandle {
2541
2541
  element: HTMLDivElement | null;
2542
2542
  props: SchedulerItemProps;
2543
+ /** @hidden */
2544
+ _maxSiblingsPerSlot?: number;
2543
2545
  }
2544
2546
 
2545
2547
  /**
@@ -2740,7 +2742,7 @@ export declare interface SchedulerItemProps extends Item {
2740
2742
  */
2741
2743
  onResizeRelease?: (event: SchedulerItemDragEvent) => void;
2742
2744
  /** @hidden */
2743
- _maxSiblingsPerSlot?: number;
2745
+ _maxSiblingsPerSlot?: React_2.RefObject<number>;
2744
2746
  }
2745
2747
 
2746
2748
  /**
package/index.d.ts CHANGED
@@ -2540,6 +2540,8 @@ declare type SchedulerItemFormItemAction = {
2540
2540
  export declare interface SchedulerItemHandle {
2541
2541
  element: HTMLDivElement | null;
2542
2542
  props: SchedulerItemProps;
2543
+ /** @hidden */
2544
+ _maxSiblingsPerSlot?: number;
2543
2545
  }
2544
2546
 
2545
2547
  /**
@@ -2740,7 +2742,7 @@ export declare interface SchedulerItemProps extends Item {
2740
2742
  */
2741
2743
  onResizeRelease?: (event: SchedulerItemDragEvent) => void;
2742
2744
  /** @hidden */
2743
- _maxSiblingsPerSlot?: number;
2745
+ _maxSiblingsPerSlot?: React_2.RefObject<number>;
2744
2746
  }
2745
2747
 
2746
2748
  /**
@@ -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 oe=require("react"),ae=require("./SchedulerItem.js"),f=require("../utils/index.js"),g=require("../views/common/utils.js"),h=require("../constants/index.js"),ue=require("@progress/kendo-react-intl"),G=require("./SchedulerItemContent.js"),y=require("@progress/kendo-react-common"),D=require("@progress/kendo-svg-icons"),K=require("../context/SchedulerViewContext.js"),de=require("../context/SchedulerContext.js"),me=require("../hooks/useRowSync.js");function fe(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=fe(oe),ge=1,J=r.forwardRef((e,S)=>{const{item:d,_ref:w,itemRef:U,...X}=e,H=r.useRef(),c=r.useRef(null),q=r.useRef(null),k=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(U,()=>c.current);const Y=d||Q.item,x=ue.useInternationalization(),[Z]=K.useSchedulerViewItemsContext(),[C]=K.useSchedulerViewSlotsContext(),b=de.useSchedulerElementContext(),[p,P]=r.useState(!0),[ee,te]=r.useState(!1),[ne,re]=r.useState(0),M=y.useDir(b),V=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]),W=r.useMemo(()=>`(${V}): ${e.title}`,[V,e.title]),B=(n,t)=>{let i=1;return n.forEach(o=>{const u=t.filter(R=>v(o.current.props,R.props));u.length>i&&(i=u.length)}),i},ie=(n,t)=>n.map(o=>t.filter(u=>v(o.current.props,u.props))),v=(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),T=()=>{const n=(C||[]).filter(o=>o.current&&v(o.current.props,e));if(n.length===0){P(!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=(C||[]).filter(s=>s.current&&v(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=[],j=g.getRect(i.current.element),F=(e.vertical?j.height:j.width)/(i.current.props.end.getTime()-i.current.props.start.getTime()),E=(e.start.getTime()-i.current.props.start.getTime())*F,$=(Math.min(e.end.getTime(),o.current.props.end.getTime())-Math.max(e.start.getTime(),i.current.props.start.getTime()))*F;(Z||[]).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?B(n,e.dragHint?R:O):B(n,u);const le=ie(n,u);let _=0;const l=g.getRect(t);if(le.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.props._maxSiblingsPerSlot&&a.props._maxSiblingsPerSlot>m&&a.element!==t&&(m=a.props._maxSiblingsPerSlot);const L=g.getRect(a.element);a.props.order!==null&&a.props.order<I&&(A=L.top+L.height-l.top-h.BORDER_WIDTH*I+ge)}),A>_&&(_=A)}),n.length===0){P(!1);return}const se=20;l.width=e.vertical?l.width/m-h.BORDER_WIDTH-se/m:$+h.BORDER_WIDTH,l.height=e.vertical?$-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+(E<0?0:E),l.top=e.vertical?l.top+(E<0?0:E):l.top+_+h.BORDER_WIDTH*I,re(m),g.setRect(t,l),te(!0),P(!0)},N=r.useCallback(n=>{const t=n&&n[0],i=k.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(()=>{T(),z()})),k.current={width:t.contentRect.width,height:t.contentRect.height}},[T,z]);r.useEffect(T),r.useEffect(z);const ce=c.current&&c.current.element?c.current.element.closest(".k-scheduler-layout"):null;return me.useRowSync({element:ce,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(Y,{...X,_ref:c,_maxSiblingsPerSlot:ne,itemRef:c,style:{visibility:ee?void 0:"hidden",display:p?void 0:"none",...e.style}},!e.resizeHint&&r.createElement("span",{className:"k-event-actions"},e.tail&&r.createElement(y.IconWrap,{name:M==="rtl"?"caret-alt-right":"caret-alt-left",icon:M==="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:W},!e.isAllDay&&r.createElement(G.SchedulerItemContent,{className:"k-event-template k-event-time "},W),r.createElement(G.SchedulerItemContent,{className:"k-event-template"},e.title)))}),Q={item:ae.SchedulerItem};J.displayName="KendoReactSchedulerProportionalViewItem";exports.SchedulerProportionalViewItem=J;exports.schedulerProportionalViewItemDefaultProps=Q;
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),k=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(),[C]=J.useSchedulerViewSlotsContext(),v=ue.useSchedulerElementContext(),[ee,T]=r.useState(!0),[te,ne]=r.useState(!1),M=r.useRef(0),V=y.useDir(v),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]),N=(n,t)=>{let i=1;return n.forEach(o=>{const u=t.filter(R=>b(o.current.props,R.props));u.length>i&&(i=u.length)}),i},re=(n,t)=>n.map(o=>t.filter(u=>b(o.current.props,u.props))),b=(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=(C||[]).filter(o=>o.current&&b(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=(C||[]).filter(s=>s.current&&b(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()),E=(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?N(n,e.dragHint?R:O):N(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+(E<0?0:E),l.top=e.vertical?l.top+(E<0?0:E):l.top+_+h.BORDER_WIDTH*I,M.current=m,g.setRect(t,l),ne(!0),T(!0)},j=r.useCallback(n=>{const t=n&&n[0],i=k.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()})),k.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(!v.current)return;const n=window.ResizeObserver,t=n&&new n(j);return t&&t.observe(v.current),()=>{t&&t.disconnect()}},[j,v]),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-template k-event-time "},B),r.createElement(K.SchedulerItemContent,{className:"k-event-template"},e.title)))}),U={item:oe.SchedulerItem};Q.displayName="KendoReactSchedulerProportionalViewItem";exports.SchedulerProportionalViewItem=Q;exports.schedulerProportionalViewItemDefaultProps=U;
@@ -7,88 +7,88 @@
7
7
  */
8
8
  "use client";
9
9
  import * as r from "react";
10
- import { SchedulerItem as le } from "./SchedulerItem.mjs";
11
- import { first as W, last as se, calculateOrder as oe, intersects as $ } from "../utils/index.mjs";
12
- import { getRect as w, setRect as q } from "../views/common/utils.mjs";
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
13
  import { BORDER_WIDTH as d } from "../constants/index.mjs";
14
- import { useInternationalization as ae } from "@progress/kendo-react-intl";
15
- import { SchedulerItemContent as B } from "./SchedulerItemContent.mjs";
16
- import { useDir as me, IconWrap as A } from "@progress/kendo-react-common";
17
- import { caretAltRightIcon as ue, caretAltLeftIcon as de, arrowRotateCwIcon as fe, nonRecurrenceIcon as he } from "@progress/kendo-svg-icons";
18
- import { useSchedulerViewItemsContext as ge, useSchedulerViewSlotsContext as Se } from "../context/SchedulerViewContext.mjs";
19
- import { useSchedulerElementContext as Ie } from "../context/SchedulerContext.mjs";
20
- import { useRowSync as we } from "../hooks/useRowSync.mjs";
21
- const Re = 1, ve = r.forwardRef(
22
- (e, G) => {
23
- const { item: K, _ref: j, itemRef: J, ...Q } = e, R = 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(G, () => P.current), r.useImperativeHandle(j, () => c.current), r.useImperativeHandle(J, () => c.current);
25
- const U = K || Ee.item, v = ae(), [X] = ge(), [D] = Se(), g = Ie(), [Y, E] = r.useState(!0), [Z, p] = r.useState(!1), [ee, te] = r.useState(0), k = me(g), M = r.useMemo(
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";
17
+ import { caretAltRightIcon as ue, caretAltLeftIcon as me, arrowRotateCwIcon as de, nonRecurrenceIcon as fe } from "@progress/kendo-svg-icons";
18
+ import { useSchedulerViewItemsContext as he, useSchedulerViewSlotsContext as ge } from "../context/SchedulerViewContext.mjs";
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), k = r.useRef(0), _ = ae(g), C = r.useMemo(
26
26
  () => e.isAllDay ? v.toString(e.zonedStart, "t") : v.format("{0:t} - {1:t}", e.zonedStart, e.zonedEnd),
27
27
  [v, e.isAllDay, e.zonedEnd, e.zonedStart]
28
- ), _ = r.useMemo(() => `(${M}): ${e.title}`, [M, e.title]), C = (n, t) => {
28
+ ), M = r.useMemo(() => `(${C}): ${e.title}`, [C, e.title]), O = (n, t) => {
29
29
  let i = 1;
30
30
  return n.forEach((o) => {
31
- const m = t.filter((f) => S(o.current.props, f.props));
32
- m.length > i && (i = m.length);
31
+ const u = t.filter((f) => S(o.current.props, f.props));
32
+ u.length > i && (i = u.length);
33
33
  }), i;
34
- }, ne = (n, t) => n.map((o) => t.filter((m) => S(o.current.props, m.props))), S = (n, t) => $(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), b = () => {
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
35
  const n = (D || []).filter((o) => o.current && S(o.current.props, e));
36
36
  if (n.length === 0) {
37
37
  E(!1);
38
38
  return;
39
39
  }
40
- const t = W(n);
40
+ const t = $(n);
41
41
  if (!t.current || !c.current)
42
42
  return;
43
- const i = w(t.current.element);
44
- q(c.current.element, i);
45
- }, y = () => {
43
+ const i = R(t.current.element);
44
+ B(c.current.element, i);
45
+ }, b = () => {
46
46
  const n = (D || []).filter((s) => s.current && S(s.current.props, e)), t = c.current && c.current.element;
47
47
  if (!t || !n.length)
48
48
  return;
49
- const i = W(n), o = se(n);
49
+ const i = $(n), o = le(n);
50
50
  if (!i.current || !c.current || !o.current)
51
51
  return;
52
- const m = [], f = [], x = [], V = w(i.current.element), N = (e.vertical ? V.height : V.width) / (i.current.props.end.getTime() - i.current.props.start.getTime()), I = (e.start.getTime() - i.current.props.start.getTime()) * N, F = (Math.min(e.end.getTime(), o.current.props.end.getTime()) - Math.max(e.start.getTime(), i.current.props.start.getTime())) * N;
53
- (X || []).forEach((s) => {
54
- s.current && (s.current.props.dragHint ? f.push(s.current) : s.current.props.resizeHint ? x.push(s.current) : m.push(s.current));
52
+ const u = [], f = [], H = [], N = R(i.current.element), F = (e.vertical ? N.height : N.width) / (i.current.props.end.getTime() - i.current.props.start.getTime()), I = (e.start.getTime() - i.current.props.start.getTime()) * F, L = (Math.min(e.end.getTime(), o.current.props.end.getTime()) - Math.max(e.start.getTime(), i.current.props.start.getTime())) * F;
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
55
  });
56
- const h = e.dragHint || e.resizeHint ? oe(
56
+ const h = e.dragHint || e.resizeHint ? se(
57
57
  c.current,
58
- e.dragHint ? f : x,
58
+ e.dragHint ? f : H,
59
59
  n,
60
60
  e.ignoreIsAllDay
61
61
  ) : e.order || 0;
62
- let u = e.dragHint || e.resizeHint ? C(n, e.dragHint ? f : x) : C(n, m);
63
- const ie = ne(n, m);
64
- let H = 0;
65
- const l = w(t);
66
- if (ie.forEach((s) => {
62
+ let m = e.dragHint || e.resizeHint ? O(n, e.dragHint ? f : H) : O(n, u);
63
+ const re = te(n, u);
64
+ let x = 0;
65
+ const l = R(t);
66
+ if (re.forEach((s) => {
67
67
  let z = 0;
68
68
  s.forEach((a) => {
69
- $(a.props.start, a.props.end, e.start, e.end) && !(e.dragHint || e.resizeHint) && a.props._maxSiblingsPerSlot && a.props._maxSiblingsPerSlot > u && a.element !== t && (u = a.props._maxSiblingsPerSlot);
70
- const L = w(a.element);
71
- a.props.order !== null && a.props.order < h && (z = L.top + L.height - l.top - d * h + Re);
72
- }), z > H && (H = z);
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
73
  }), n.length === 0) {
74
74
  E(!1);
75
75
  return;
76
76
  }
77
- const ce = 20;
78
- l.width = e.vertical ? l.width / u - d - ce / u : F + d, l.height = e.vertical ? F - d : (e.resizeHint || e.dragHint) && u <= 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 + H + d * h, te(u), q(t, l), p(!0), E(!0);
79
- }, O = r.useCallback(
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, k.current = m, B(t, l), ee(!0), E(!0);
79
+ }, V = r.useCallback(
80
80
  (n) => {
81
81
  const t = n && n[0], i = T.current;
82
- R.current !== void 0 && window.cancelAnimationFrame(R.current), i && t && (i.width !== t.contentRect.width || i.height !== t.contentRect.height) && (R.current = window.requestAnimationFrame(() => {
83
- b(), y();
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
84
  })), T.current = { width: t.contentRect.width, height: t.contentRect.height };
85
85
  },
86
- [b, y]
86
+ [y, b]
87
87
  );
88
- r.useEffect(b), r.useEffect(y);
89
- const re = c.current && c.current.element ? c.current.element.closest(".k-scheduler-layout") : null;
90
- return we({
91
- element: re,
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,
92
92
  selector: ".k-resource-row",
93
93
  horizontalAttribute: "data-depth-index",
94
94
  verticalAttribute: "data-resource-index",
@@ -97,38 +97,38 @@ const Re = 1, ve = r.forwardRef(
97
97
  }), r.useEffect(() => {
98
98
  if (!g.current)
99
99
  return;
100
- const n = window.ResizeObserver, t = n && new n(O);
100
+ const n = window.ResizeObserver, t = n && new n(V);
101
101
  return t && t.observe(g.current), () => {
102
102
  t && t.disconnect();
103
103
  };
104
- }, [O, g]), /* @__PURE__ */ r.createElement(
105
- U,
104
+ }, [V, g]), /* @__PURE__ */ r.createElement(
105
+ X,
106
106
  {
107
- ...Q,
107
+ ...U,
108
108
  _ref: c,
109
- _maxSiblingsPerSlot: ee,
109
+ _maxSiblingsPerSlot: k,
110
110
  itemRef: c,
111
111
  style: {
112
- visibility: Z ? void 0 : "hidden",
113
- display: Y ? void 0 : "none",
112
+ visibility: p ? void 0 : "hidden",
113
+ display: Z ? void 0 : "none",
114
114
  ...e.style
115
115
  }
116
116
  },
117
117
  !e.resizeHint && /* @__PURE__ */ r.createElement("span", { className: "k-event-actions" }, e.tail && /* @__PURE__ */ r.createElement(
118
118
  A,
119
119
  {
120
- name: k === "rtl" ? "caret-alt-right" : "caret-alt-left",
121
- icon: k === "rtl" ? ue : de
120
+ name: _ === "rtl" ? "caret-alt-right" : "caret-alt-left",
121
+ icon: _ === "rtl" ? ue : me
122
122
  }
123
- ), e.isRecurring && !e.isException && /* @__PURE__ */ r.createElement(A, { name: "reload", icon: fe }), !e.isRecurring && e.isException && /* @__PURE__ */ r.createElement(A, { name: "non-recurrence", icon: he })),
124
- !e.resizeHint && /* @__PURE__ */ r.createElement("div", { title: _ }, !e.isAllDay && /* @__PURE__ */ r.createElement(B, { className: "k-event-template k-event-time " }, _), /* @__PURE__ */ r.createElement(B, { className: "k-event-template" }, e.title))
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: M }, !e.isAllDay && /* @__PURE__ */ r.createElement(G, { className: "k-event-template k-event-time " }, M), /* @__PURE__ */ r.createElement(G, { className: "k-event-template" }, e.title))
125
125
  );
126
126
  }
127
- ), Ee = {
128
- item: le
127
+ ), ve = {
128
+ item: ce
129
129
  };
130
- ve.displayName = "KendoReactSchedulerProportionalViewItem";
130
+ we.displayName = "KendoReactSchedulerProportionalViewItem";
131
131
  export {
132
- ve as SchedulerProportionalViewItem,
133
- Ee as schedulerProportionalViewItemDefaultProps
132
+ we as SchedulerProportionalViewItem,
133
+ ve as schedulerProportionalViewItemDefaultProps
134
134
  };
@@ -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 re=require("react"),ie=require("./SchedulerItem.js"),b=require("../utils/index.js"),S=require("../views/common/utils.js"),h=require("../constants/index.js"),ce=require("@progress/kendo-react-intl"),N=require("./SchedulerItemContent.js"),E=require("@progress/kendo-react-common"),v=require("@progress/kendo-svg-icons"),le=require("../hooks/useRowSync.js"),se=require("../hooks/useEditable.js"),B=require("../context/SchedulerViewContext.js"),oe=require("../context/SchedulerContext.js");function ae(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=ae(re),ue=1,j=n.forwardRef((e,g)=>{const{item:m,_ref:R,itemRef:$,...L}=e,y=n.useRef(),c=n.useRef(null),A=n.useRef(null),P=n.useRef(null),G=se.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($,()=>c.current);const K=m||F.item,D=ce.useInternationalization(),[J]=B.useSchedulerViewItemsContext(),[q]=B.useSchedulerViewSlotsContext(),I=oe.useSchedulerElementContext(),[Q,H]=n.useState(!0),[U,X]=n.useState(!1),[Y,Z]=n.useState(0),T=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]),C=n.useMemo(()=>`(${k}): ${e.title}`,[k,e.title]),V=(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},p=(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=(q||[]).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=(q||[]).filter(s=>s.current&&w(s.current.props,e)),l=[],o=[],u=[];(J||[]).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?V(t,e.dragHint?o:u):V(t,l);const te=p(t,l);let O=0;const i=S.getRect(r);if(te.forEach(s=>{let _=0;s.forEach(a=>{b.intersects(a.props.start,a.props.end,e.start,e.end)&&!(e.dragHint||e.resizeHint)&&a.props._maxSiblingsPerSlot&&a.props._maxSiblingsPerSlot>f&&a.element!==r&&(f=a.props._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+ue)}),_>O&&(O=_)}),t.length===0){H(!1);return}const ne=G.add?20:0;i.width=e.vertical?i.width/f-h.BORDER_WIDTH-ne/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,Z(f),S.setRect(r,i),X(!0),H(!0)},W=n.useCallback(r=>{const t=r&&r[0],l=P.current;y.current!==void 0&&window.cancelAnimationFrame(y.current),l&&t&&(l.width!==t.contentRect.width||l.height!==t.contentRect.height)&&(y.current=window.requestAnimationFrame(()=>{x(),z()})),P.current={width:t.contentRect.width,height:t.contentRect.height}},[x,z]);n.useEffect(x),n.useEffect(z);const ee=c.current&&c.current.element?c.current.element.closest(".k-scheduler-layout"):null;return le.useRowSync({element:ee,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(W);return t&&t.observe(I.current),()=>{t&&t.disconnect()}},[W,I]),n.createElement(K,{...L,_ref:c,_maxSiblingsPerSlot:Y,itemRef:c,style:{visibility:U?void 0:"hidden",display:Q?void 0:"none",...e.style}},!e.resizeHint&&n.createElement("span",{className:"k-event-actions"},e.tail&&n.createElement(E.IconWrap,{name:T==="rtl"?"caret-alt-right":"caret-alt-left",icon:T==="rtl"?v.caretAltRightIcon:v.caretAltLeftIcon}),e.isRecurring&&!e.isException&&n.createElement(E.IconWrap,{name:"arrow-rotate-cw",icon:v.arrowRotateCwIcon}),!e.isRecurring&&e.isException&&n.createElement(E.IconWrap,{name:"arrows-no-repeat",icon:v.arrowsNoRepeatIcon})),!e.resizeHint&&n.createElement("div",{title:C},!e.isAllDay&&n.createElement(N.SchedulerItemContent,{className:"k-event-template k-event-time "},C),n.createElement(N.SchedulerItemContent,{className:"k-event-template"},e.title)))}),F={item:ie.SchedulerItem};j.displayName="KendoReactSchedulerViewItem";exports.SchedulerViewItem=j;exports.schedulerViewItemDefaultProps=F;
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"),M=require("./SchedulerItemContent.js"),E=require("@progress/kendo-react-common"),v=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,y=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),k=E.useDir(I),C=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(()=>`(${C}): ${e.title}`,[C,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 B=S.getRect(a.element);a.props.order!==null&&a.props.order<d&&(_=B.top+B.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)},N=n.useCallback(r=>{const t=r&&r[0],l=q.current;y.current!==void 0&&window.cancelAnimationFrame(y.current),l&&t&&(l.width!==t.contentRect.width||l.height!==t.contentRect.height)&&(y.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(N);return t&&t.observe(I.current),()=>{t&&t.disconnect()}},[N,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:k==="rtl"?"caret-alt-right":"caret-alt-left",icon:k==="rtl"?v.caretAltRightIcon:v.caretAltLeftIcon}),e.isRecurring&&!e.isException&&n.createElement(E.IconWrap,{name:"arrow-rotate-cw",icon:v.arrowRotateCwIcon}),!e.isRecurring&&e.isException&&n.createElement(E.IconWrap,{name:"arrows-no-repeat",icon:v.arrowsNoRepeatIcon})),!e.resizeHint&&n.createElement("div",{title:V},!e.isAllDay&&n.createElement(M.SchedulerItemContent,{className:"k-event-template k-event-time "},V),n.createElement(M.SchedulerItemContent,{className:"k-event-template"},e.title)))}),$={item:re.SchedulerItem};F.displayName="KendoReactSchedulerViewItem";exports.SchedulerViewItem=F;exports.schedulerViewItemDefaultProps=$;
@@ -7,86 +7,86 @@
7
7
  */
8
8
  "use client";
9
9
  import * as n from "react";
10
- import { SchedulerItem as ee } from "./SchedulerItem.mjs";
11
- import { first as te, calculateOrder as ne, intersects as N } from "../utils/index.mjs";
12
- import { getRect as y, setRect as T } from "../views/common/utils.mjs";
10
+ import { SchedulerItem as p } from "./SchedulerItem.mjs";
11
+ import { first as ee, calculateOrder as te, intersects as T } from "../utils/index.mjs";
12
+ import { getRect as y, setRect as V } from "../views/common/utils.mjs";
13
13
  import { BORDER_WIDTH as f } from "../constants/index.mjs";
14
- import { useInternationalization as re } from "@progress/kendo-react-intl";
15
- import { SchedulerItemContent as V } from "./SchedulerItemContent.mjs";
16
- import { useDir as ie, IconWrap as H } from "@progress/kendo-react-common";
17
- import { caretAltRightIcon as le, caretAltLeftIcon as ce, arrowRotateCwIcon as se, arrowsNoRepeatIcon as oe } from "@progress/kendo-svg-icons";
18
- import { useRowSync as ae } from "../hooks/useRowSync.mjs";
19
- import { useEditable as me } from "../hooks/useEditable.mjs";
20
- import { useSchedulerViewItemsContext as ue, useSchedulerViewSlotsContext as de } from "../context/SchedulerViewContext.mjs";
21
- import { useSchedulerElementContext as fe } from "../context/SchedulerContext.mjs";
22
- const he = 1, ge = n.forwardRef(
14
+ import { useInternationalization as ne } from "@progress/kendo-react-intl";
15
+ import { SchedulerItemContent as F } from "./SchedulerItemContent.mjs";
16
+ import { useDir as re, IconWrap as H } from "@progress/kendo-react-common";
17
+ import { caretAltRightIcon as ie, caretAltLeftIcon as le, arrowRotateCwIcon as ce, arrowsNoRepeatIcon as se } from "@progress/kendo-svg-icons";
18
+ import { useRowSync as oe } from "../hooks/useRowSync.mjs";
19
+ import { useEditable as ae } from "../hooks/useEditable.mjs";
20
+ import { useSchedulerViewItemsContext as me, useSchedulerViewSlotsContext as ue } from "../context/SchedulerViewContext.mjs";
21
+ import { useSchedulerElementContext as de } from "../context/SchedulerContext.mjs";
22
+ const fe = 1, he = n.forwardRef(
23
23
  (e, M) => {
24
- const { item: F, _ref: L, itemRef: W, ...$ } = e, S = n.useRef(), l = n.useRef(null), x = n.useRef(null), z = n.useRef(null), q = me(e.editable);
25
- n.useImperativeHandle(x, () => ({ props: e, element: l.current && l.current.element })), n.useImperativeHandle(M, () => x.current), n.useImperativeHandle(L, () => l.current), n.useImperativeHandle(W, () => l.current);
26
- const B = F || Se.item, w = re(), [G] = ue(), [A] = de(), h = fe(), [K, I] = n.useState(!0), [j, J] = n.useState(!1), [Q, U] = n.useState(0), D = ie(h), P = n.useMemo(
24
+ const { item: L, _ref: W, itemRef: $, ...q } = e, S = n.useRef(), l = n.useRef(null), z = n.useRef(null), x = n.useRef(null), B = ae(e.editable);
25
+ n.useImperativeHandle(z, () => ({ props: e, element: l.current && l.current.element })), n.useImperativeHandle(M, () => z.current), n.useImperativeHandle(W, () => l.current), n.useImperativeHandle($, () => l.current);
26
+ const G = L || ge.item, w = ne(), [K] = me(), [A] = ue(), h = de(), [j, I] = n.useState(!0), [J, Q] = n.useState(!1), D = n.useRef(0), P = re(h), k = n.useMemo(
27
27
  () => e.isAllDay ? w.toString(e.zonedStart, "t") : w.format("{0:t} - {1:t}", e.zonedStart, e.zonedEnd),
28
28
  [w, e.isAllDay, e.zonedEnd, e.zonedStart]
29
- ), k = n.useMemo(() => `(${P}): ${e.title}`, [P, e.title]), _ = (r, t) => {
29
+ ), _ = n.useMemo(() => `(${k}): ${e.title}`, [k, e.title]), C = (r, t) => {
30
30
  let c = 1;
31
31
  return r.forEach((o) => {
32
32
  const m = t.filter((u) => g(o.current.props, u.props));
33
33
  m.length > c && (c = m.length);
34
34
  }), c;
35
- }, X = (r, t) => r.map((o) => t.filter((m) => g(o.current.props, m.props))), g = (r, t) => N(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), R = () => {
35
+ }, U = (r, t) => r.map((o) => t.filter((m) => g(o.current.props, m.props))), g = (r, t) => T(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), R = () => {
36
36
  const r = (A || []).filter((o) => o.current && g(o.current.props, e));
37
37
  if (r.length === 0) {
38
38
  I(!1);
39
39
  return;
40
40
  }
41
- const t = te(r);
41
+ const t = ee(r);
42
42
  if (!t.current || !l.current)
43
43
  return;
44
44
  const c = y(t.current.element);
45
- T(l.current.element, c);
45
+ V(l.current.element, c);
46
46
  }, v = () => {
47
47
  const r = l.current && l.current.element;
48
48
  if (!r)
49
49
  return;
50
50
  const t = (A || []).filter((s) => s.current && g(s.current.props, e)), c = [], o = [], m = [];
51
- (G || []).forEach((s) => {
51
+ (K || []).forEach((s) => {
52
52
  s.current && (s.current.props.dragHint ? o.push(s.current) : s.current.props.resizeHint ? m.push(s.current) : c.push(s.current));
53
53
  });
54
- const u = e.dragHint || e.resizeHint ? ne(
54
+ const u = e.dragHint || e.resizeHint ? te(
55
55
  l.current,
56
56
  e.dragHint ? o : m,
57
57
  t,
58
58
  e.ignoreIsAllDay
59
59
  ) : e.order || 0;
60
- let d = e.dragHint || e.resizeHint ? _(t, e.dragHint ? o : m) : _(t, c);
61
- const Z = X(t, c);
62
- let b = 0;
60
+ let d = e.dragHint || e.resizeHint ? C(t, e.dragHint ? o : m) : C(t, c);
61
+ const Y = U(t, c);
62
+ let E = 0;
63
63
  const i = y(r);
64
- if (Z.forEach((s) => {
65
- let E = 0;
64
+ if (Y.forEach((s) => {
65
+ let b = 0;
66
66
  s.forEach((a) => {
67
- N(a.props.start, a.props.end, e.start, e.end) && !(e.dragHint || e.resizeHint) && a.props._maxSiblingsPerSlot && a.props._maxSiblingsPerSlot > d && a.element !== r && (d = a.props._maxSiblingsPerSlot);
68
- const O = y(a.element);
69
- a.props.order !== null && a.props.order < u && (E = O.top + O.height - i.top - f * u + he);
70
- }), E > b && (b = E);
67
+ T(a.props.start, a.props.end, e.start, e.end) && !(e.dragHint || e.resizeHint) && a._maxSiblingsPerSlot && a._maxSiblingsPerSlot > d && a.element !== r && (d = a._maxSiblingsPerSlot);
68
+ const N = y(a.element);
69
+ a.props.order !== null && a.props.order < u && (b = N.top + N.height - i.top - f * u + fe);
70
+ }), b > E && (E = b);
71
71
  }), t.length === 0) {
72
72
  I(!1);
73
73
  return;
74
74
  }
75
- const p = q.add ? 20 : 0;
76
- i.width = e.vertical ? i.width / d - f - p / d : i.width * t.length - f, i.height = e.vertical ? i.height * t.length - f : (e.resizeHint || e.dragHint) && d <= 1 ? i.height : e.style && e.style.height ? e.style.height : 25, i.left = e.vertical ? i.left + u * i.width + f * u : i.left, i.top = e.vertical ? i.top : i.top + b + f * u, U(d), T(r, i), J(!0), I(!0);
77
- }, C = n.useCallback(
75
+ const Z = B.add ? 20 : 0;
76
+ i.width = e.vertical ? i.width / d - f - Z / d : i.width * t.length - f, i.height = e.vertical ? i.height * t.length - f : (e.resizeHint || e.dragHint) && d <= 1 ? i.height : e.style && e.style.height ? e.style.height : 25, i.left = e.vertical ? i.left + u * i.width + f * u : i.left, i.top = e.vertical ? i.top : i.top + E + f * u, D.current = d, V(r, i), Q(!0), I(!0);
77
+ }, O = n.useCallback(
78
78
  (r) => {
79
- const t = r && r[0], c = z.current;
79
+ const t = r && r[0], c = x.current;
80
80
  S.current !== void 0 && window.cancelAnimationFrame(S.current), c && t && (c.width !== t.contentRect.width || c.height !== t.contentRect.height) && (S.current = window.requestAnimationFrame(() => {
81
81
  R(), v();
82
- })), z.current = { width: t.contentRect.width, height: t.contentRect.height };
82
+ })), x.current = { width: t.contentRect.width, height: t.contentRect.height };
83
83
  },
84
84
  [R, v]
85
85
  );
86
86
  n.useEffect(R), n.useEffect(v);
87
- const Y = l.current && l.current.element ? l.current.element.closest(".k-scheduler-layout") : null;
88
- return ae({
89
- element: Y,
87
+ const X = l.current && l.current.element ? l.current.element.closest(".k-scheduler-layout") : null;
88
+ return oe({
89
+ element: X,
90
90
  selector: ".k-resource-row",
91
91
  horizontalAttribute: "data-depth-index",
92
92
  verticalAttribute: "data-resource-index",
@@ -95,38 +95,38 @@ const he = 1, ge = n.forwardRef(
95
95
  }), n.useEffect(() => {
96
96
  if (!h.current)
97
97
  return;
98
- const r = window.ResizeObserver, t = r && new r(C);
98
+ const r = window.ResizeObserver, t = r && new r(O);
99
99
  return t && t.observe(h.current), () => {
100
100
  t && t.disconnect();
101
101
  };
102
- }, [C, h]), /* @__PURE__ */ n.createElement(
103
- B,
102
+ }, [O, h]), /* @__PURE__ */ n.createElement(
103
+ G,
104
104
  {
105
- ...$,
105
+ ...q,
106
106
  _ref: l,
107
- _maxSiblingsPerSlot: Q,
107
+ _maxSiblingsPerSlot: D,
108
108
  itemRef: l,
109
109
  style: {
110
- visibility: j ? void 0 : "hidden",
111
- display: K ? void 0 : "none",
110
+ visibility: J ? void 0 : "hidden",
111
+ display: j ? void 0 : "none",
112
112
  ...e.style
113
113
  }
114
114
  },
115
115
  !e.resizeHint && /* @__PURE__ */ n.createElement("span", { className: "k-event-actions" }, e.tail && /* @__PURE__ */ n.createElement(
116
116
  H,
117
117
  {
118
- name: D === "rtl" ? "caret-alt-right" : "caret-alt-left",
119
- icon: D === "rtl" ? le : ce
118
+ name: P === "rtl" ? "caret-alt-right" : "caret-alt-left",
119
+ icon: P === "rtl" ? ie : le
120
120
  }
121
- ), e.isRecurring && !e.isException && /* @__PURE__ */ n.createElement(H, { name: "arrow-rotate-cw", icon: se }), !e.isRecurring && e.isException && /* @__PURE__ */ n.createElement(H, { name: "arrows-no-repeat", icon: oe })),
122
- !e.resizeHint && /* @__PURE__ */ n.createElement("div", { title: k }, !e.isAllDay && /* @__PURE__ */ n.createElement(V, { className: "k-event-template k-event-time " }, k), /* @__PURE__ */ n.createElement(V, { className: "k-event-template" }, e.title))
121
+ ), e.isRecurring && !e.isException && /* @__PURE__ */ n.createElement(H, { name: "arrow-rotate-cw", icon: ce }), !e.isRecurring && e.isException && /* @__PURE__ */ n.createElement(H, { name: "arrows-no-repeat", icon: se })),
122
+ !e.resizeHint && /* @__PURE__ */ n.createElement("div", { title: _ }, !e.isAllDay && /* @__PURE__ */ n.createElement(F, { className: "k-event-template k-event-time " }, _), /* @__PURE__ */ n.createElement(F, { className: "k-event-template" }, e.title))
123
123
  );
124
124
  }
125
- ), Se = {
126
- item: ee
125
+ ), ge = {
126
+ item: p
127
127
  };
128
- ge.displayName = "KendoReactSchedulerViewItem";
128
+ he.displayName = "KendoReactSchedulerViewItem";
129
129
  export {
130
- ge as SchedulerViewItem,
131
- Se as schedulerViewItemDefaultProps
130
+ he as SchedulerViewItem,
131
+ ge as schedulerViewItemDefaultProps
132
132
  };
@@ -10,7 +10,7 @@ const e = {
10
10
  name: "@progress/kendo-react-scheduler",
11
11
  productName: "KendoReact",
12
12
  productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
13
- publishDate: 1730789279,
13
+ publishDate: 1730805835,
14
14
  version: "",
15
15
  licensingDocsUrl: "https://www.telerik.com/kendo-react-ui"
16
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-scheduler",
3
- "version": "9.0.0-develop.13",
3
+ "version": "9.0.0-develop.15",
4
4
  "description": "React Scheduler brings the functionality of Outlook's Calendar to a single UI component. KendoReact Scheduler package",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -26,15 +26,15 @@
26
26
  "@progress/kendo-date-math": "^1.4.1",
27
27
  "@progress/kendo-drawing": "^1.21.1",
28
28
  "@progress/kendo-licensing": "^1.3.4",
29
- "@progress/kendo-react-buttons": "9.0.0-develop.13",
30
- "@progress/kendo-react-common": "9.0.0-develop.13",
31
- "@progress/kendo-react-dateinputs": "9.0.0-develop.13",
32
- "@progress/kendo-react-dialogs": "9.0.0-develop.13",
33
- "@progress/kendo-react-dropdowns": "9.0.0-develop.13",
34
- "@progress/kendo-react-form": "9.0.0-develop.13",
35
- "@progress/kendo-react-inputs": "9.0.0-develop.13",
36
- "@progress/kendo-react-intl": "9.0.0-develop.13",
37
- "@progress/kendo-react-popup": "9.0.0-develop.13",
29
+ "@progress/kendo-react-buttons": "9.0.0-develop.15",
30
+ "@progress/kendo-react-common": "9.0.0-develop.15",
31
+ "@progress/kendo-react-dateinputs": "9.0.0-develop.15",
32
+ "@progress/kendo-react-dialogs": "9.0.0-develop.15",
33
+ "@progress/kendo-react-dropdowns": "9.0.0-develop.15",
34
+ "@progress/kendo-react-form": "9.0.0-develop.15",
35
+ "@progress/kendo-react-inputs": "9.0.0-develop.15",
36
+ "@progress/kendo-react-intl": "9.0.0-develop.15",
37
+ "@progress/kendo-react-popup": "9.0.0-develop.15",
38
38
  "@progress/kendo-svg-icons": "^3.0.0",
39
39
  "react": "^16.8.2 || ^17.0.0 || ^18.0.0",
40
40
  "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"