@progress/kendo-react-scheduler 14.1.2-develop.1 → 14.2.0-develop.1

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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("react"),p=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(void 0),f=i.useRef(0),m=S.useSchedulerElementContext(),w=()=>{if(!e.current)return;const n=e.current.element;n&&(f.current=n.clientHeight)},d=i.useCallback(()=>{if(!t||!e.current)return;const n=e.current.element,g=e.current.props;if(!n)return;const a=p.getPadding(n),r=new Map,o=g.items.filter(u=>u._ref.current);o.forEach(u=>{var v,R,y;if(!u._ref.current)return;const{height:l}=p.getRect(u._ref.current.element),_=(R=(v=u._ref.current)==null?void 0:v._order)!=null?R:-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&&p.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(()=>{d()})},[d]);O.useIsomorphicLayoutEffect(w,[]),i.useEffect(d,[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;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react"),p=require("../views/common/utils.js"),O=require("../constants/index.js"),S=require("@progress/kendo-react-common"),j=require("../context/SchedulerContext.js");function q(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=q(E),H=(e,t)=>{const c=i.useRef(void 0),f=i.useRef(0),m=j.useSchedulerElementContext(),x=()=>{if(!e.current)return;const n=e.current.element;n&&(f.current=n.clientHeight)},d=i.useCallback(()=>{if(!t||!e.current)return;const n=e.current.element,g=e.current.props;if(!n)return;const a=p.getPadding(n),r=new Map,u=g.items.filter(o=>o._ref.current);u.forEach(o=>{var v,R,y,w;if(!o._ref.current)return;const{height:l}=p.getRect(o._ref.current.element),_=(y=(R=o.order)!=null?R:(v=o._ref.current)==null?void 0:v._order)!=null?y:-1;((w=r.get(_))!=null?w:0)<l&&r.set(_,l)});const s=Array.from(r.values()).reduce((o,l)=>o+l,0),b=u.length*O.BORDER_WIDTH*2+s-(a||0)+(typeof t=="object"&&t.offsetTop?t.offsetTop:0)+(typeof t=="object"&&t.offsetBottom?t.offsetBottom:0);u.length?b>f.current-a&&p.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(()=>{d()})},[d]);S.useIsomorphicLayoutEffect(x,[]),i.useEffect(d,[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 u=window.ResizeObserver,s=u&&new u(h);return s&&s.observe(r._ref.current.element),()=>{s&&s.disconnect()}});return()=>{a.forEach(r=>r&&r())}},[h,m,e])};exports.useSlotExpand=H;
@@ -6,12 +6,12 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import * as u from "react";
9
- import { getPadding as E, getRect as x, setRect as H } from "../views/common/utils.mjs";
10
- import { BORDER_WIDTH as y } from "../constants/index.mjs";
11
- import { useIsomorphicLayoutEffect as k } from "@progress/kendo-react-common";
12
- import { useSchedulerElementContext as z } from "../context/SchedulerContext.mjs";
13
- const O = (e, t) => {
14
- const m = u.useRef(void 0), p = u.useRef(0), l = z(), w = () => {
9
+ import { getPadding as x, getRect as H, setRect as y } from "../views/common/utils.mjs";
10
+ import { BORDER_WIDTH as k } from "../constants/index.mjs";
11
+ import { useIsomorphicLayoutEffect as z } from "@progress/kendo-react-common";
12
+ import { useSchedulerElementContext as A } from "../context/SchedulerContext.mjs";
13
+ const T = (e, t) => {
14
+ const m = u.useRef(void 0), p = u.useRef(0), l = A(), E = () => {
15
15
  if (!e.current)
16
16
  return;
17
17
  const n = e.current.element;
@@ -22,22 +22,22 @@ const O = (e, t) => {
22
22
  const n = e.current.element, h = e.current.props;
23
23
  if (!n)
24
24
  return;
25
- const i = E(n), r = /* @__PURE__ */ new Map(), o = h.items.filter((c) => c._ref.current);
25
+ const i = x(n), r = /* @__PURE__ */ new Map(), o = h.items.filter((c) => c._ref.current);
26
26
  o.forEach((c) => {
27
- var v, R, b;
27
+ var v, R, b, w;
28
28
  if (!c._ref.current)
29
29
  return;
30
- const { height: f } = x(c._ref.current.element), _ = (R = (v = c._ref.current) == null ? void 0 : v._order) != null ? R : -1;
31
- ((b = r.get(_)) != null ? b : 0) < f && r.set(_, f);
30
+ const { height: f } = H(c._ref.current.element), _ = (b = (R = c.order) != null ? R : (v = c._ref.current) == null ? void 0 : v._order) != null ? b : -1;
31
+ ((w = r.get(_)) != null ? w : 0) < f && r.set(_, f);
32
32
  });
33
- 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);
34
- o.length ? g > p.current - i && H(n, { height: g }, !0) : n && (n.style.minHeight = "");
33
+ const s = Array.from(r.values()).reduce((c, f) => c + f, 0), g = o.length * k * 2 + s - (i || 0) + (typeof t == "object" && t.offsetTop ? t.offsetTop : 0) + (typeof t == "object" && t.offsetBottom ? t.offsetBottom : 0);
34
+ o.length ? g > p.current - i && y(n, { height: g }, !0) : n && (n.style.minHeight = "");
35
35
  }, [t, e]), d = u.useCallback(() => {
36
36
  m.current !== void 0 && window.cancelAnimationFrame(m.current), m.current = window.requestAnimationFrame(() => {
37
37
  a();
38
38
  });
39
39
  }, [a]);
40
- k(w, []), u.useEffect(a, [e, e.current && e.current.props, t]), u.useEffect(() => {
40
+ z(E, []), u.useEffect(a, [e, e.current && e.current.props, t]), u.useEffect(() => {
41
41
  if (!e.current)
42
42
  return;
43
43
  const i = e.current.props.items.filter((r) => r._ref.current).map((r) => {
@@ -54,5 +54,5 @@ const O = (e, t) => {
54
54
  }, [d, l, e]);
55
55
  };
56
56
  export {
57
- O as useSlotExpand
57
+ T as useSlotExpand
58
58
  };
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const me=require("react"),l=require("@progress/kendo-react-common"),_=require("@progress/kendo-react-intl"),F=require("@progress/kendo-svg-icons"),K=require("../messages/index.js"),ke=require("../utils/index.js"),be=require("../hooks/useSchedulerItem.js"),fe=require("../hooks/useEditable.js");function ve(e){const o=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(o,r,c.get?c:{enumerable:!0,get:()=>e[r]})}}return o.default=e,Object.freeze(o)}const t=ve(me),$=t.forwardRef((e,o)=>{const{onFocus:r,onBlur:c,onMouseDown:k,onClick:b,onMouseUp:f,onMouseOut:v,onMouseOver:z,onMouseEnter:h,onMouseLeave:C,onDoubleClick:D,onRemoveClick:R,onKeyUp:E,onKeyDown:M,onKeyPress:y,onPress:I,onDrag:S,onRelease:N,onResizePress:P,onResizeEndDrag:x,onResizeRelease:H,onResizeStartDrag:q}=e,{item:a,element:O}=be.useSchedulerItem(e,o),w=l.useDir(O),L=t.useRef(null),U=t.useRef(null),j=t.useRef(null),A=t.useRef(null),s=fe.useEditable(e.editable),u=_.useInternationalization(),T=_.useLocalization().toLanguageString(K.deleteTitle,K.messages[K.deleteTitle]),d=e.group.resources.find(n=>!!(n.colorField&&n[n.colorField]!==""&&n[n.colorField]!==void 0)),i=d&&d.colorField&&d[d.colorField],G=e.tabIndex!==void 0?e.tabIndex===null?void 0:e.tabIndex:e.selected?0:-1,J=t.useMemo(()=>l.classNames({"k-event":!e.resizeHint,"k-selected":e.selected&&s.select,"k-event-drag-hint":e.dragHint,"k-scheduler-marquee":e.resizeHint,"k-marquee":e.resizeHint,"k-first":e.resizeHint&&!e.tail,"k-last":e.resizeHint&&!e.head},e.className),[e.resizeHint,e.selected,e.dragHint,e.tail,e.head,e.className,s.select]),Q=t.useMemo(()=>`${ke.formatEventTime(u,e.zonedStart,e.zonedEnd,e.isAllDay)}, ${e.title}`,[u,e.isAllDay,e.title,e.zonedEnd,e.zonedStart]),V=t.useMemo(()=>({cursor:"pointer",userSelect:"none",borderColor:e.resizeHint?void 0:i,backgroundColor:e.resizeHint?void 0:i,touchAction:"none",...e.style}),[i,e.style,e.resizeHint]),X=t.useCallback(n=>{r&&r.call(void 0,{syntheticEvent:n,target:a.current})},[r,a]),Y=t.useCallback(n=>{c&&c.call(void 0,{syntheticEvent:n,target:a.current})},[c,a]),Z=t.useCallback(n=>{k&&k.call(void 0,{syntheticEvent:n,target:a.current})},[k,a]),p=t.useCallback(n=>{b&&b.call(void 0,{syntheticEvent:n,target:a.current})},[b,a]),ee=t.useCallback(n=>{f&&f.call(void 0,{syntheticEvent:n,target:a.current})},[f,a]),te=t.useCallback(n=>{z&&z.call(void 0,{syntheticEvent:n,target:a.current})},[z,a]),ne=t.useCallback(n=>{v&&v.call(void 0,{syntheticEvent:n,target:a.current})},[v,a]),ae=t.useCallback(n=>{h&&h.call(void 0,{syntheticEvent:n,target:a.current})},[h,a]),le=t.useCallback(n=>{C&&C.call(void 0,{syntheticEvent:n,target:a.current})},[C,a]),re=t.useCallback(n=>{D&&D.call(void 0,{syntheticEvent:n,target:a.current})},[D,a]),ce=t.useCallback(n=>{R&&R.call(void 0,{syntheticEvent:n,target:a.current})},[R,a]),oe=t.useCallback(n=>{M&&M.call(void 0,{syntheticEvent:n,target:a.current})},[M,a]),se=t.useCallback(n=>{y&&y.call(void 0,{syntheticEvent:n,target:a.current})},[y,a]),ie=t.useCallback(n=>{E&&E.call(void 0,{syntheticEvent:n,target:a.current})},[E,a]),ue=t.useCallback(n=>{I&&I.call(void 0,{dragEvent:n,target:a.current})},[I,a]),de=t.useCallback(n=>{S&&S.call(void 0,{dragEvent:n,target:a.current})},[S,a]),ge=t.useCallback(n=>{N&&N.call(void 0,{dragEvent:n,target:a.current})},[N,a]),g=t.useCallback(n=>{P&&P.call(void 0,{dragEvent:n,target:a.current})},[P,a]),B=t.useCallback(n=>{q&&q.call(void 0,{dragEvent:n,target:a.current})},[q,a]),W=t.useCallback(n=>{x&&x.call(void 0,{dragEvent:n,target:a.current})},[x,a]),m=t.useCallback(n=>{H&&H.call(void 0,{dragEvent:n,target:a.current})},[H,a]);return l.useDraggable(O,{onPress:ue,onDrag:de,onRelease:ge}),l.useDraggable(L,{onPress:g,onDrag:W,onRelease:m}),l.useDraggable(U,{onPress:g,onDrag:B,onRelease:m}),l.useDraggable(j,{onPress:g,onDrag:B,onRelease:m}),l.useDraggable(A,{onPress:g,onDrag:W,onRelease:m}),t.createElement("div",{ref:O,id:e.id,style:V,tabIndex:G,className:J,role:"button","aria-label":Q,onFocus:X,onBlur:Y,onMouseUp:ee,onMouseDown:Z,onClick:p,onMouseOver:te,onMouseOut:ne,onMouseEnter:ae,onMouseLeave:le,onDoubleClick:re,onKeyDown:oe,onKeyPress:se,onKeyUp:ie,"data-group-index":e.group.index,"data-range-index":e.range.index},e.children,!e.resizeHint&&t.createElement("span",{className:"k-event-actions"},s.remove&&t.createElement("a",{tabIndex:-1,"aria-hidden":"true",className:"k-link k-event-delete",title:T,"aria-label":T,onClick:ce},t.createElement(l.IconWrap,{name:"x",icon:F.xIcon})),e.head&&t.createElement(l.IconWrap,{name:w==="rtl"?"caret-alt-left":"caret-alt-right",icon:w==="rtl"?F.caretAltLeftIcon:F.caretAltRightIcon})),s.resize&&e.vertical&&t.createElement(t.Fragment,null,t.createElement("span",{className:"k-resize-handle k-resize-n",ref:j}),t.createElement("span",{className:"k-resize-handle k-resize-s",ref:A})),s.resize&&!e.vertical&&t.createElement(t.Fragment,null,t.createElement("span",{className:"k-resize-handle k-resize-w",ref:U}),t.createElement("span",{className:"k-resize-handle k-resize-e",ref:L})),e.resizeHint&&t.createElement(t.Fragment,null,t.createElement("div",{className:"k-marquee-color",style:{borderColor:i,backgroundColor:i}}),t.createElement("div",{className:"k-marquee-text"},!e.tail&&t.createElement("div",{className:"k-label-top"},u.formatDate(e.zonedStart,e.format)),!e.head&&t.createElement("div",{className:"k-label-bottom"},u.formatDate(e.zonedEnd,e.format)))))});$.displayName="KendoReactSchedulerItem";exports.SchedulerItem=$;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const be=require("react"),l=require("@progress/kendo-react-common"),G=require("@progress/kendo-react-intl"),K=require("@progress/kendo-svg-icons"),o=require("../messages/index.js"),fe=require("../utils/index.js"),ve=require("../hooks/useSchedulerItem.js"),he=require("../hooks/useEditable.js");function ze(e){const s=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(s,r,c.get?c:{enumerable:!0,get:()=>e[r]})}}return s.default=e,Object.freeze(s)}const t=ze(be),J=t.forwardRef((e,s)=>{const{onFocus:r,onBlur:c,onMouseDown:b,onClick:f,onMouseUp:v,onMouseOut:h,onMouseOver:z,onMouseEnter:C,onMouseLeave:D,onDoubleClick:R,onRemoveClick:E,onKeyUp:M,onKeyDown:y,onKeyPress:S,onPress:I,onDrag:N,onRelease:P,onResizePress:x,onResizeEndDrag:H,onResizeRelease:q,onResizeStartDrag:O}=e,{item:a,element:F}=ve.useSchedulerItem(e,s),w=l.useDir(F),L=t.useRef(null),U=t.useRef(null),j=t.useRef(null),A=t.useRef(null),i=he.useEditable(e.editable),d=G.useInternationalization(),T=G.useLocalization(),B=T.toLanguageString(o.deleteTitle,o.messages[o.deleteTitle]),W=T.toLanguageString(o.allDay,o.messages[o.allDay]),g=e.group.resources.find(n=>!!(n.colorField&&n[n.colorField]!==""&&n[n.colorField]!==void 0)),u=g&&g.colorField&&g[g.colorField],Q=e.tabIndex!==void 0?e.tabIndex===null?void 0:e.tabIndex:e.selected?0:-1,V=t.useMemo(()=>l.classNames({"k-event":!e.resizeHint,"k-selected":e.selected&&i.select,"k-event-drag-hint":e.dragHint,"k-scheduler-marquee":e.resizeHint,"k-marquee":e.resizeHint,"k-first":e.resizeHint&&!e.tail,"k-last":e.resizeHint&&!e.head},e.className),[e.resizeHint,e.selected,e.dragHint,e.tail,e.head,e.className,i.select]),X=t.useMemo(()=>`${e.title}, ${fe.formatEventTime(d,e.zonedStart,e.zonedEnd,e.isAllDay,W)}`,[d,e.isAllDay,e.title,e.zonedEnd,e.zonedStart,W]),Y=t.useMemo(()=>({cursor:"pointer",userSelect:"none",borderColor:e.resizeHint?void 0:u,backgroundColor:e.resizeHint?void 0:u,touchAction:"none",...e.style}),[u,e.style,e.resizeHint]),Z=t.useCallback(n=>{r&&r.call(void 0,{syntheticEvent:n,target:a.current})},[r,a]),p=t.useCallback(n=>{c&&c.call(void 0,{syntheticEvent:n,target:a.current})},[c,a]),ee=t.useCallback(n=>{b&&b.call(void 0,{syntheticEvent:n,target:a.current})},[b,a]),te=t.useCallback(n=>{f&&f.call(void 0,{syntheticEvent:n,target:a.current})},[f,a]),ne=t.useCallback(n=>{v&&v.call(void 0,{syntheticEvent:n,target:a.current})},[v,a]),ae=t.useCallback(n=>{z&&z.call(void 0,{syntheticEvent:n,target:a.current})},[z,a]),le=t.useCallback(n=>{h&&h.call(void 0,{syntheticEvent:n,target:a.current})},[h,a]),re=t.useCallback(n=>{C&&C.call(void 0,{syntheticEvent:n,target:a.current})},[C,a]),ce=t.useCallback(n=>{D&&D.call(void 0,{syntheticEvent:n,target:a.current})},[D,a]),oe=t.useCallback(n=>{R&&R.call(void 0,{syntheticEvent:n,target:a.current})},[R,a]),se=t.useCallback(n=>{E&&E.call(void 0,{syntheticEvent:n,target:a.current})},[E,a]),ie=t.useCallback(n=>{y&&y.call(void 0,{syntheticEvent:n,target:a.current})},[y,a]),ue=t.useCallback(n=>{S&&S.call(void 0,{syntheticEvent:n,target:a.current})},[S,a]),de=t.useCallback(n=>{M&&M.call(void 0,{syntheticEvent:n,target:a.current})},[M,a]),ge=t.useCallback(n=>{I&&I.call(void 0,{dragEvent:n,target:a.current})},[I,a]),me=t.useCallback(n=>{N&&N.call(void 0,{dragEvent:n,target:a.current})},[N,a]),ke=t.useCallback(n=>{P&&P.call(void 0,{dragEvent:n,target:a.current})},[P,a]),m=t.useCallback(n=>{x&&x.call(void 0,{dragEvent:n,target:a.current})},[x,a]),_=t.useCallback(n=>{O&&O.call(void 0,{dragEvent:n,target:a.current})},[O,a]),$=t.useCallback(n=>{H&&H.call(void 0,{dragEvent:n,target:a.current})},[H,a]),k=t.useCallback(n=>{q&&q.call(void 0,{dragEvent:n,target:a.current})},[q,a]);return l.useDraggable(F,{onPress:ge,onDrag:me,onRelease:ke}),l.useDraggable(L,{onPress:m,onDrag:$,onRelease:k}),l.useDraggable(U,{onPress:m,onDrag:_,onRelease:k}),l.useDraggable(j,{onPress:m,onDrag:_,onRelease:k}),l.useDraggable(A,{onPress:m,onDrag:$,onRelease:k}),t.createElement("div",{ref:F,id:e.id,style:Y,tabIndex:Q,className:V,role:"button","aria-label":X,onFocus:Z,onBlur:p,onMouseUp:ne,onMouseDown:ee,onClick:te,onMouseOver:ae,onMouseOut:le,onMouseEnter:re,onMouseLeave:ce,onDoubleClick:oe,onKeyDown:ie,onKeyPress:ue,onKeyUp:de,"data-group-index":e.group.index,"data-range-index":e.range.index},e.children,!e.resizeHint&&t.createElement("span",{className:"k-event-actions"},i.remove&&t.createElement("a",{tabIndex:-1,"aria-hidden":"true",className:"k-link k-event-delete",title:B,"aria-label":B,onClick:se},t.createElement(l.IconWrap,{name:"x",icon:K.xIcon})),e.head&&t.createElement(l.IconWrap,{name:w==="rtl"?"caret-alt-left":"caret-alt-right",icon:w==="rtl"?K.caretAltLeftIcon:K.caretAltRightIcon})),i.resize&&e.vertical&&t.createElement(t.Fragment,null,t.createElement("span",{className:"k-resize-handle k-resize-n",ref:j}),t.createElement("span",{className:"k-resize-handle k-resize-s",ref:A})),i.resize&&!e.vertical&&t.createElement(t.Fragment,null,t.createElement("span",{className:"k-resize-handle k-resize-w",ref:U}),t.createElement("span",{className:"k-resize-handle k-resize-e",ref:L})),e.resizeHint&&t.createElement(t.Fragment,null,t.createElement("div",{className:"k-marquee-color",style:{borderColor:u,backgroundColor:u}}),t.createElement("div",{className:"k-marquee-text"},!e.tail&&t.createElement("div",{className:"k-label-top"},d.formatDate(e.zonedStart,e.format)),!e.head&&t.createElement("div",{className:"k-label-bottom"},d.formatDate(e.zonedEnd,e.format)))))});J.displayName="KendoReactSchedulerItem";exports.SchedulerItem=J;
@@ -6,32 +6,32 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import * as t from "react";
9
- import { useDir as de, classNames as me, useDraggable as o, IconWrap as T } from "@progress/kendo-react-common";
10
- import { useInternationalization as ke, useLocalization as ge } from "@progress/kendo-react-intl";
11
- import { xIcon as fe, caretAltLeftIcon as ve, caretAltRightIcon as be } from "@progress/kendo-svg-icons";
12
- import { deleteTitle as W, messages as ze } from "../messages/index.mjs";
13
- import { formatEventTime as he } from "../utils/index.mjs";
14
- import { useSchedulerItem as Ce } from "../hooks/useSchedulerItem.mjs";
15
- import { useEditable as Ee } from "../hooks/useEditable.mjs";
16
- const Re = t.forwardRef(
17
- (e, $) => {
9
+ import { useDir as fe, classNames as ve, useDraggable as o, IconWrap as $ } from "@progress/kendo-react-common";
10
+ import { useInternationalization as be, useLocalization as ze } from "@progress/kendo-react-intl";
11
+ import { xIcon as he, caretAltLeftIcon as Ce, caretAltRightIcon as De } from "@progress/kendo-svg-icons";
12
+ import { deleteTitle as j, messages as G, allDay as J } from "../messages/index.mjs";
13
+ import { formatEventTime as Ee } from "../utils/index.mjs";
14
+ import { useSchedulerItem as Re } from "../hooks/useSchedulerItem.mjs";
15
+ import { useEditable as Me } from "../hooks/useEditable.mjs";
16
+ const ye = t.forwardRef(
17
+ (e, Q) => {
18
18
  const {
19
19
  // Focus
20
20
  onFocus: d,
21
21
  onBlur: m,
22
22
  // Mouse
23
- onMouseDown: k,
24
- onClick: g,
23
+ onMouseDown: g,
24
+ onClick: k,
25
25
  onMouseUp: f,
26
26
  onMouseOut: v,
27
27
  onMouseOver: b,
28
28
  onMouseEnter: z,
29
29
  onMouseLeave: h,
30
30
  onDoubleClick: C,
31
- onRemoveClick: E,
31
+ onRemoveClick: D,
32
32
  // Keyboard
33
- onKeyUp: R,
34
- onKeyDown: D,
33
+ onKeyUp: E,
34
+ onKeyDown: R,
35
35
  onKeyPress: M,
36
36
  // Drag
37
37
  onPress: y,
@@ -41,11 +41,11 @@ const Re = t.forwardRef(
41
41
  onResizePress: H,
42
42
  onResizeEndDrag: I,
43
43
  onResizeRelease: P,
44
- onResizeStartDrag: F
45
- } = e, { item: n, element: S } = Ce(e, $), K = de(S), w = t.useRef(null), L = t.useRef(null), O = t.useRef(null), U = t.useRef(null), l = Ee(e.editable), c = ke(), A = ge().toLanguageString(W, ze[W]), s = e.group.resources.find(
44
+ onResizeStartDrag: S
45
+ } = e, { item: n, element: F } = Re(e, Q), K = fe(F), w = t.useRef(null), L = t.useRef(null), O = t.useRef(null), U = t.useRef(null), l = Me(e.editable), c = be(), A = ze(), q = A.toLanguageString(j, G[j]), B = A.toLanguageString(J, G[J]), s = e.group.resources.find(
46
46
  (a) => !!(a.colorField && a[a.colorField] !== "" && a[a.colorField] !== void 0)
47
- ), r = s && s.colorField && s[s.colorField], j = e.tabIndex !== void 0 ? e.tabIndex === null ? void 0 : e.tabIndex : e.selected ? 0 : -1, G = t.useMemo(
48
- () => me(
47
+ ), r = s && s.colorField && s[s.colorField], V = e.tabIndex !== void 0 ? e.tabIndex === null ? void 0 : e.tabIndex : e.selected ? 0 : -1, X = t.useMemo(
48
+ () => ve(
49
49
  {
50
50
  "k-event": !e.resizeHint,
51
51
  "k-selected": e.selected && l.select,
@@ -58,10 +58,16 @@ const Re = t.forwardRef(
58
58
  e.className
59
59
  ),
60
60
  [e.resizeHint, e.selected, e.dragHint, e.tail, e.head, e.className, l.select]
61
- ), J = t.useMemo(
62
- () => `${he(c, e.zonedStart, e.zonedEnd, e.isAllDay)}, ${e.title}`,
63
- [c, e.isAllDay, e.title, e.zonedEnd, e.zonedStart]
64
- ), Q = t.useMemo(
61
+ ), Y = t.useMemo(
62
+ () => `${e.title}, ${Ee(
63
+ c,
64
+ e.zonedStart,
65
+ e.zonedEnd,
66
+ e.isAllDay,
67
+ B
68
+ )}`,
69
+ [c, e.isAllDay, e.title, e.zonedEnd, e.zonedStart, B]
70
+ ), Z = t.useMemo(
65
71
  () => ({
66
72
  cursor: "pointer",
67
73
  userSelect: "none",
@@ -71,7 +77,7 @@ const Re = t.forwardRef(
71
77
  ...e.style
72
78
  }),
73
79
  [r, e.style, e.resizeHint]
74
- ), V = t.useCallback(
80
+ ), _ = t.useCallback(
75
81
  (a) => {
76
82
  d && d.call(void 0, {
77
83
  syntheticEvent: a,
@@ -79,7 +85,7 @@ const Re = t.forwardRef(
79
85
  });
80
86
  },
81
87
  [d, n]
82
- ), X = t.useCallback(
88
+ ), p = t.useCallback(
83
89
  (a) => {
84
90
  m && m.call(void 0, {
85
91
  syntheticEvent: a,
@@ -87,23 +93,23 @@ const Re = t.forwardRef(
87
93
  });
88
94
  },
89
95
  [m, n]
90
- ), Y = t.useCallback(
96
+ ), ee = t.useCallback(
91
97
  (a) => {
92
- k && k.call(void 0, {
98
+ g && g.call(void 0, {
93
99
  syntheticEvent: a,
94
100
  target: n.current
95
101
  });
96
102
  },
97
- [k, n]
98
- ), Z = t.useCallback(
103
+ [g, n]
104
+ ), te = t.useCallback(
99
105
  (a) => {
100
- g && g.call(void 0, {
106
+ k && k.call(void 0, {
101
107
  syntheticEvent: a,
102
108
  target: n.current
103
109
  });
104
110
  },
105
- [g, n]
106
- ), _ = t.useCallback(
111
+ [k, n]
112
+ ), ae = t.useCallback(
107
113
  (a) => {
108
114
  f && f.call(void 0, {
109
115
  syntheticEvent: a,
@@ -111,7 +117,7 @@ const Re = t.forwardRef(
111
117
  });
112
118
  },
113
119
  [f, n]
114
- ), p = t.useCallback(
120
+ ), ne = t.useCallback(
115
121
  (a) => {
116
122
  b && b.call(void 0, {
117
123
  syntheticEvent: a,
@@ -119,7 +125,7 @@ const Re = t.forwardRef(
119
125
  });
120
126
  },
121
127
  [b, n]
122
- ), ee = t.useCallback(
128
+ ), le = t.useCallback(
123
129
  (a) => {
124
130
  v && v.call(void 0, {
125
131
  syntheticEvent: a,
@@ -127,7 +133,7 @@ const Re = t.forwardRef(
127
133
  });
128
134
  },
129
135
  [v, n]
130
- ), te = t.useCallback(
136
+ ), re = t.useCallback(
131
137
  (a) => {
132
138
  z && z.call(void 0, {
133
139
  syntheticEvent: a,
@@ -135,7 +141,7 @@ const Re = t.forwardRef(
135
141
  });
136
142
  },
137
143
  [z, n]
138
- ), ae = t.useCallback(
144
+ ), oe = t.useCallback(
139
145
  (a) => {
140
146
  h && h.call(void 0, {
141
147
  syntheticEvent: a,
@@ -143,7 +149,7 @@ const Re = t.forwardRef(
143
149
  });
144
150
  },
145
151
  [h, n]
146
- ), ne = t.useCallback(
152
+ ), ce = t.useCallback(
147
153
  (a) => {
148
154
  C && C.call(void 0, {
149
155
  syntheticEvent: a,
@@ -151,23 +157,23 @@ const Re = t.forwardRef(
151
157
  });
152
158
  },
153
159
  [C, n]
154
- ), le = t.useCallback(
160
+ ), se = t.useCallback(
155
161
  (a) => {
156
- E && E.call(void 0, {
162
+ D && D.call(void 0, {
157
163
  syntheticEvent: a,
158
164
  target: n.current
159
165
  });
160
166
  },
161
- [E, n]
162
- ), re = t.useCallback(
167
+ [D, n]
168
+ ), ie = t.useCallback(
163
169
  (a) => {
164
- D && D.call(void 0, {
170
+ R && R.call(void 0, {
165
171
  syntheticEvent: a,
166
172
  target: n.current
167
173
  });
168
174
  },
169
- [D, n]
170
- ), oe = t.useCallback(
175
+ [R, n]
176
+ ), ue = t.useCallback(
171
177
  (a) => {
172
178
  M && M.call(void 0, {
173
179
  syntheticEvent: a,
@@ -175,15 +181,15 @@ const Re = t.forwardRef(
175
181
  });
176
182
  },
177
183
  [M, n]
178
- ), ce = t.useCallback(
184
+ ), de = t.useCallback(
179
185
  (a) => {
180
- R && R.call(void 0, {
186
+ E && E.call(void 0, {
181
187
  syntheticEvent: a,
182
188
  target: n.current
183
189
  });
184
190
  },
185
- [R, n]
186
- ), se = t.useCallback(
191
+ [E, n]
192
+ ), me = t.useCallback(
187
193
  (a) => {
188
194
  y && y.call(void 0, {
189
195
  dragEvent: a,
@@ -191,7 +197,7 @@ const Re = t.forwardRef(
191
197
  });
192
198
  },
193
199
  [y, n]
194
- ), ie = t.useCallback(
200
+ ), ge = t.useCallback(
195
201
  (a) => {
196
202
  N && N.call(void 0, {
197
203
  dragEvent: a,
@@ -199,7 +205,7 @@ const Re = t.forwardRef(
199
205
  });
200
206
  },
201
207
  [N, n]
202
- ), ue = t.useCallback(
208
+ ), ke = t.useCallback(
203
209
  (a) => {
204
210
  x && x.call(void 0, {
205
211
  dragEvent: a,
@@ -215,15 +221,15 @@ const Re = t.forwardRef(
215
221
  });
216
222
  },
217
223
  [H, n]
218
- ), q = t.useCallback(
224
+ ), T = t.useCallback(
219
225
  (a) => {
220
- F && F.call(void 0, {
226
+ S && S.call(void 0, {
221
227
  dragEvent: a,
222
228
  target: n.current
223
229
  });
224
230
  },
225
- [F, n]
226
- ), B = t.useCallback(
231
+ [S, n]
232
+ ), W = t.useCallback(
227
233
  (a) => {
228
234
  I && I.call(void 0, {
229
235
  dragEvent: a,
@@ -240,49 +246,49 @@ const Re = t.forwardRef(
240
246
  },
241
247
  [P, n]
242
248
  );
243
- return o(S, {
244
- onPress: se,
245
- onDrag: ie,
246
- onRelease: ue
249
+ return o(F, {
250
+ onPress: me,
251
+ onDrag: ge,
252
+ onRelease: ke
247
253
  }), o(w, {
248
254
  onPress: i,
249
- onDrag: B,
255
+ onDrag: W,
250
256
  onRelease: u
251
257
  }), o(L, {
252
258
  onPress: i,
253
- onDrag: q,
259
+ onDrag: T,
254
260
  onRelease: u
255
261
  }), o(O, {
256
262
  onPress: i,
257
- onDrag: q,
263
+ onDrag: T,
258
264
  onRelease: u
259
265
  }), o(U, {
260
266
  onPress: i,
261
- onDrag: B,
267
+ onDrag: W,
262
268
  onRelease: u
263
269
  }), /* @__PURE__ */ t.createElement(
264
270
  "div",
265
271
  {
266
- ref: S,
272
+ ref: F,
267
273
  id: e.id,
268
- style: Q,
269
- tabIndex: j,
270
- className: G,
274
+ style: Z,
275
+ tabIndex: V,
276
+ className: X,
271
277
  role: "button",
272
- "aria-label": J,
273
- onFocus: V,
274
- onBlur: X,
275
- onMouseUp: _,
276
- onMouseDown: Y,
277
- onClick: Z,
278
- onMouseOver: p,
279
- onMouseOut: ee,
280
- onMouseEnter: te,
281
- onMouseLeave: ae,
282
- onDoubleClick: ne,
283
- onKeyDown: re,
284
- onKeyPress: oe,
285
- onKeyUp: ce,
278
+ "aria-label": Y,
279
+ onFocus: _,
280
+ onBlur: p,
281
+ onMouseUp: ae,
282
+ onMouseDown: ee,
283
+ onClick: te,
284
+ onMouseOver: ne,
285
+ onMouseOut: le,
286
+ onMouseEnter: re,
287
+ onMouseLeave: oe,
288
+ onDoubleClick: ce,
289
+ onKeyDown: ie,
290
+ onKeyPress: ue,
291
+ onKeyUp: de,
286
292
  "data-group-index": e.group.index,
287
293
  "data-range-index": e.range.index
288
294
  },
@@ -293,16 +299,16 @@ const Re = t.forwardRef(
293
299
  tabIndex: -1,
294
300
  "aria-hidden": "true",
295
301
  className: "k-link k-event-delete",
296
- title: A,
297
- "aria-label": A,
298
- onClick: le
302
+ title: q,
303
+ "aria-label": q,
304
+ onClick: se
299
305
  },
300
- /* @__PURE__ */ t.createElement(T, { name: "x", icon: fe })
306
+ /* @__PURE__ */ t.createElement($, { name: "x", icon: he })
301
307
  ), e.head && /* @__PURE__ */ t.createElement(
302
- T,
308
+ $,
303
309
  {
304
310
  name: K === "rtl" ? "caret-alt-left" : "caret-alt-right",
305
- icon: K === "rtl" ? ve : be
311
+ icon: K === "rtl" ? Ce : De
306
312
  }
307
313
  )),
308
314
  l.resize && e.vertical && /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("span", { className: "k-resize-handle k-resize-n", ref: O }), /* @__PURE__ */ t.createElement("span", { className: "k-resize-handle k-resize-s", ref: U })),
@@ -311,7 +317,7 @@ const Re = t.forwardRef(
311
317
  );
312
318
  }
313
319
  );
314
- Re.displayName = "KendoReactSchedulerItem";
320
+ ye.displayName = "KendoReactSchedulerItem";
315
321
  export {
316
- Re as SchedulerItem
322
+ ye as SchedulerItem
317
323
  };
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const me=require("react"),he=require("./SchedulerItem.js"),m=require("../utils/index.js"),D=require("../views/common/utils.js"),I=require("../constants/index.js"),fe=require("@progress/kendo-react-intl"),J=require("./SchedulerItemContent.js"),P=require("@progress/kendo-react-common"),H=require("@progress/kendo-svg-icons"),Q=require("../context/SchedulerViewContext.js"),ge=require("../context/SchedulerContext.js"),Se=require("../hooks/useRowSync.js");function Re(e){const w=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const S in e)if(S!=="default"){const x=Object.getOwnPropertyDescriptor(e,S);Object.defineProperty(w,S,x.get?x:{enumerable:!0,get:()=>e[S]})}}return w.default=e,Object.freeze(w)}const r=Re(me),Ie=1,U=25,X=r.forwardRef((e,w)=>{const{item:S,_ref:x,itemRef:Z,...ee}=e,M=r.useRef(void 0),o=r.useRef(null),C=r.useRef(null),k=r.useRef(null);r.useImperativeHandle(C,()=>({props:e,element:o.current&&o.current.element})),r.useImperativeHandle(w,()=>C.current),r.useImperativeHandle(x,()=>o.current),r.useImperativeHandle(Z,()=>o.current);const te=S||Y.item,b=fe.useInternationalization(),[re]=Q.useSchedulerViewItemsContext(),[ne]=Q.useSchedulerViewSlotsContext(),_=ge.useSchedulerElementContext(),[ce,V]=r.useState(!0),[ie,oe]=r.useState(!1),W=r.useRef(0),f=r.useRef(null),g=r.useRef([]),p=P.useDir(_),B=r.useMemo(()=>e.isAllDay?b.toString(e.zonedStart,"t"):b.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd),[b,e.isAllDay,e.zonedEnd,e.zonedStart]),N=r.useMemo(()=>`(${B}): ${e.title}`,[B,e.title]),se=(c,n)=>{let i=0;return n.forEach(l=>{l._order!==void 0&&l._order!==null&&i<l._order&&(i=l._order)}),i+1},le=(c,n,i)=>{const[l,h]=n,a=new Date(Math.min(h.props.end.getTime()-i,Math.max(e.start.getTime(),l.props.start.getTime()))),R=new Date(Math.max(a.getTime()+i,Math.min(e.end.getTime(),h.props.end.getTime())));return c.filter(u=>{const E=Math.max(Math.min(h.props.end.getTime()-i,u.props.start.getTime()),l.props.start.getTime()),T=Math.min(Math.max(E+i,u.props.end.getTime()),h.props.end.getTime());return u.props.id!==e.id&&u.props.group.index===e.group.index&&u.props.range.index===e.range.index&&(e.ignoreIsAllDay||u.props.isAllDay===e.isAllDay)&&m.intersects(new Date(E),new Date(T),a,R)&&m.intersects(l.props.start,h.props.end,u.props.start,u.props.end)})},ae=(c,n)=>c.group.index===n.group.index&&c.range.index===n.range.index&&(e.ignoreIsAllDay||c.isAllDay===n.isAllDay),z=()=>{var G,L,K;const c=ne.filter(t=>t.current&&ae(t.current.props,e)).sort((t,v)=>t.current.props.start.getTime()-v.current.props.start.getTime()),n=c.filter(t=>m.intersects(t.current.props.start,t.current.props.end,e.start,e.end)),i=o.current&&o.current.element;if(!i||!n.length)return;const l=m.first(c),h=m.last(c),a=m.first(n),R=m.last(n);if(!a.current||!o.current||!R.current||!l.current||!h.current)return;if(!m.intersects(a.current.props.start,R.current.props.end,e.start,e.end)){V(!1);return}const O=[],u=[],E=[],T=D.getRect(a.current.element),A=(e.vertical?T.height:T.width)/(a.current.props.end.getTime()-a.current.props.start.getTime()),F=(e.vertical?U:8)/A,y=(Math.min(e.start.getTime(),R.current.props.end.getTime()-F)-a.current.props.start.getTime())*A,$=Math.floor(Math.min(e.end.getTime(),R.current.props.end.getTime())-Math.max(e.start.getTime(),a.current.props.start.getTime()))*A;(re||[]).forEach(t=>{t.current&&(t.current.props.dragHint?u.push(t.current):t.current.props.resizeHint?E.push(t.current):O.push(t.current))}),g.current=le(O,[l.current,h.current],F),f.current=e.resizeHint||e.dragHint?0:m.calculateProportionalOrder(o.current,g.current);let d=1;e.resizeHint||e.dragHint||(d=se(o.current,g.current),g.current.forEach(t=>{t._maxSiblingsPerSlot&&d<t._maxSiblingsPerSlot&&(d=t._maxSiblingsPerSlot)}),g.current.forEach(t=>{t._maxSiblingsPerSlot!==void 0&&t._maxSiblingsPerSlot!==null&&t._maxSiblingsPerSlot<d&&(t._maxSiblingsPerSlot=d)}));let q=0;const s=T;g.current.forEach(t=>{let v=0;t._order!==void 0&&t._order!==null&&t._order<f.current&&(v=D.getRect(t.element).top+D.getRect(t.element).height-s.top-I.BORDER_WIDTH*f.current+Ie),v>q&&(q=v)});const de=20;s.width=e.vertical?s.width/d-I.BORDER_WIDTH-de/d:$-I.BORDER_WIDTH,s.height=e.vertical?$-I.BORDER_WIDTH:(e.resizeHint||e.dragHint)&&d<=1?s.height:e.style&&e.style.height?e.style.height:U,s.left=e.vertical?s.left+((G=f.current)!=null?G:0)+I.BORDER_WIDTH*((L=f.current)!=null?L:0)*s.width:s.left+(y<0?0:y),s.top=e.vertical?s.top+(y<0?0:y):s.top+q+I.BORDER_WIDTH*((K=f.current)!=null?K:0),W.current=d,D.setRect(i,s),oe(!0),V(!0)},j=r.useCallback(c=>{const n=c&&c[0],i=k.current;M.current!==void 0&&window.cancelAnimationFrame(M.current),i&&n&&(i.width!==n.contentRect.width||i.height!==n.contentRect.height)&&(M.current=window.requestAnimationFrame(()=>{z()})),k.current={width:n.contentRect.width,height:n.contentRect.height}},[z]);r.useEffect(z);const ue=o.current&&o.current.element?o.current.element.closest(".k-scheduler-layout"):null;return Se.useRowSync({element:ue,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),r.useEffect(()=>{if(!_.current)return;const c=window.ResizeObserver,n=c&&new c(j);return n&&n.observe(_.current),()=>{n&&n.disconnect()}},[j,_]),r.createElement(te,{...ee,_ref:o,_order:f,_maxSiblingsPerSlot:W,_siblings:g,itemRef:o,style:{visibility:ie?void 0:"hidden",display:ce?void 0:"none",...e.style}},!e.resizeHint&&r.createElement("span",{className:"k-event-actions"},e.tail&&r.createElement(P.IconWrap,{name:p==="rtl"?"caret-alt-right":"caret-alt-left",icon:p==="rtl"?H.caretAltRightIcon:H.caretAltLeftIcon}),e.isRecurring&&!e.isException&&r.createElement(P.IconWrap,{name:"reload",icon:H.arrowRotateCwIcon}),!e.isRecurring&&e.isException&&r.createElement(P.IconWrap,{name:"non-recurrence",icon:H.nonRecurrenceIcon})),!e.resizeHint&&r.createElement("div",{title:N},!e.isAllDay&&r.createElement(J.SchedulerItemContent,{className:"k-event-time"},N),r.createElement(J.SchedulerItemContent,null,e.title)))}),Y={item:he.SchedulerItem};X.displayName="KendoReactSchedulerProportionalViewItem";exports.SchedulerProportionalViewItem=X;exports.schedulerProportionalViewItemDefaultProps=Y;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const fe=require("react"),he=require("./SchedulerItem.js"),m=require("../utils/index.js"),E=require("../views/common/utils.js"),I=require("../constants/index.js"),ge=require("@progress/kendo-react-intl"),Q=require("./SchedulerItemContent.js"),P=require("@progress/kendo-react-common"),H=require("@progress/kendo-svg-icons"),U=require("../context/SchedulerViewContext.js"),Se=require("../context/SchedulerContext.js"),Re=require("../hooks/useRowSync.js");function Ie(e){const w=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const S in e)if(S!=="default"){const x=Object.getOwnPropertyDescriptor(e,S);Object.defineProperty(w,S,x.get?x:{enumerable:!0,get:()=>e[S]})}}return w.default=e,Object.freeze(w)}const n=Ie(fe),we=1,X=25,Y=n.forwardRef((e,w)=>{const{item:S,_ref:x,itemRef:ee,...te}=e,M=n.useRef(void 0),o=n.useRef(null),q=n.useRef(null),C=n.useRef(null);n.useImperativeHandle(q,()=>({props:e,element:o.current&&o.current.element})),n.useImperativeHandle(w,()=>q.current),n.useImperativeHandle(x,()=>o.current),n.useImperativeHandle(ee,()=>o.current);const re=S||Z.item,p=ge.useInternationalization(),[ne]=U.useSchedulerViewItemsContext(),[ie]=U.useSchedulerViewSlotsContext(),D=Se.useSchedulerElementContext(),[ce,k]=n.useState(!0),[oe,se]=n.useState(!1),V=n.useRef(0),h=n.useRef(null),g=n.useRef([]),W=P.useDir(D),B=n.useMemo(()=>{var i,r;return e.isAllDay?(i=e.title)!=null?i:"":`(${p.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd)}): ${(r=e.title)!=null?r:""}`},[p,e.isAllDay,e.title,e.zonedEnd,e.zonedStart]),le=(i,r)=>{let c=0;return r.forEach(l=>{l._order!==void 0&&l._order!==null&&c<l._order&&(c=l._order)}),c+1},ae=(i,r,c)=>{const[l,f]=r,a=new Date(Math.min(f.props.end.getTime()-c,Math.max(e.start.getTime(),l.props.start.getTime()))),R=new Date(Math.max(a.getTime()+c,Math.min(e.end.getTime(),f.props.end.getTime())));return i.filter(u=>{const _=Math.max(Math.min(f.props.end.getTime()-c,u.props.start.getTime()),l.props.start.getTime()),v=Math.min(Math.max(_+c,u.props.end.getTime()),f.props.end.getTime());return u.props.id!==e.id&&u.props.group.index===e.group.index&&u.props.range.index===e.range.index&&(e.ignoreIsAllDay||u.props.isAllDay===e.isAllDay)&&m.intersects(new Date(_),new Date(v),a,R)&&m.intersects(l.props.start,f.props.end,u.props.start,u.props.end)})},ue=(i,r)=>i.group.index===r.group.index&&i.range.index===r.range.index&&(i.range.isAllDay===void 0||r.range.isAllDay===void 0||i.range.isAllDay===r.range.isAllDay)&&(e.ignoreIsAllDay||i.isAllDay===r.isAllDay),A=()=>{var $,G,L,K,J;const i=ie.filter(t=>t.current&&ue(t.current.props,e)).sort((t,T)=>t.current.props.start.getTime()-T.current.props.start.getTime()),r=i.filter(t=>m.intersects(t.current.props.start,t.current.props.end,e.start,e.end)),c=o.current&&o.current.element;if(!c||!r.length)return;const l=m.first(i),f=m.last(i),a=m.first(r),R=m.last(r);if(!a.current||!o.current||!R.current||!l.current||!f.current)return;if(!m.intersects(a.current.props.start,R.current.props.end,e.start,e.end)){k(!1);return}const b=[],u=[],_=[],v=E.getRect(a.current.element),O=(e.vertical?v.height:v.width)/(a.current.props.end.getTime()-a.current.props.start.getTime()),j=(e.vertical?X:8)/O,y=(Math.min(e.start.getTime(),R.current.props.end.getTime()-j)-a.current.props.start.getTime())*O,F=Math.floor(Math.min(e.end.getTime(),R.current.props.end.getTime())-Math.max(e.start.getTime(),a.current.props.start.getTime()))*O;(ne||[]).forEach(t=>{t.current&&(t.current.props.dragHint?u.push(t.current):t.current.props.resizeHint?_.push(t.current):b.push(t.current))}),g.current=ae(b,[l.current,f.current],j),h.current=e.resizeHint||e.dragHint?0:m.calculateProportionalOrder(o.current,g.current);let d=1;e.resizeHint||e.dragHint||(d=le(o.current,g.current),g.current.forEach(t=>{t._maxSiblingsPerSlot&&d<t._maxSiblingsPerSlot&&(d=t._maxSiblingsPerSlot)}),g.current.forEach(t=>{t._maxSiblingsPerSlot!==void 0&&t._maxSiblingsPerSlot!==null&&t._maxSiblingsPerSlot<d&&(t._maxSiblingsPerSlot=d)}));let z=0;const s=v;g.current.forEach(t=>{let T=0;t._order!==void 0&&t._order!==null&&t._order<h.current&&(T=E.getRect(t.element).top+E.getRect(t.element).height-s.top-I.BORDER_WIDTH*h.current+we),T>z&&(z=T)});const me=20;s.width=e.vertical?s.width/d-I.BORDER_WIDTH-me/d:F-I.BORDER_WIDTH,e.vertical?s.height=F-I.BORDER_WIDTH:(e.resizeHint||e.dragHint)&&d<=1||(s.height=(G=($=e.style)==null?void 0:$.height)!=null?G:X),s.left=e.vertical?s.left+((L=h.current)!=null?L:0)+I.BORDER_WIDTH*((K=h.current)!=null?K:0)*s.width:s.left+(y<0?0:y),s.top=e.vertical?s.top+(y<0?0:y):s.top+z+I.BORDER_WIDTH*((J=h.current)!=null?J:0),V.current=d,E.setRect(c,s),se(!0),k(!0)},N=n.useCallback(i=>{const r=i&&i[0],c=C.current;M.current!==void 0&&window.cancelAnimationFrame(M.current),c&&r&&(c.width!==r.contentRect.width||c.height!==r.contentRect.height)&&(M.current=window.requestAnimationFrame(()=>{A()})),C.current={width:r.contentRect.width,height:r.contentRect.height}},[A]);n.useEffect(A);const de=o.current&&o.current.element?o.current.element.closest(".k-scheduler-layout"):null;return Re.useRowSync({element:de,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),n.useEffect(()=>{if(!D.current)return;const i=window.ResizeObserver,r=i&&new i(N);return r&&r.observe(D.current),()=>{r&&r.disconnect()}},[N,D]),n.createElement(re,{...te,_ref:o,_order:h,_maxSiblingsPerSlot:V,_siblings:g,itemRef:o,style:{visibility:oe?void 0:"hidden",display:ce?void 0:"none",...e.style}},!e.resizeHint&&n.createElement("span",{className:"k-event-actions"},e.tail&&n.createElement(P.IconWrap,{name:W==="rtl"?"caret-alt-right":"caret-alt-left",icon:W==="rtl"?H.caretAltRightIcon:H.caretAltLeftIcon}),e.isRecurring&&!e.isException&&n.createElement(P.IconWrap,{name:"reload",icon:H.arrowRotateCwIcon}),!e.isRecurring&&e.isException&&n.createElement(P.IconWrap,{name:"non-recurrence",icon:H.nonRecurrenceIcon})),!e.resizeHint&&n.createElement("div",{title:B},!e.isAllDay&&n.createElement(Q.SchedulerItemContent,{className:"k-event-time"},B),n.createElement(Q.SchedulerItemContent,null,e.title)))}),Z={item:he.SchedulerItem};Y.displayName="KendoReactSchedulerProportionalViewItem";exports.SchedulerProportionalViewItem=Y;exports.schedulerProportionalViewItemDefaultProps=Z;