@progress/kendo-react-scheduler 16.1.0-develop.1 → 16.1.0-develop.10

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.
Files changed (61) hide show
  1. package/Scheduler.js +1 -1
  2. package/Scheduler.mjs +239 -228
  3. package/components/BaseView.d.ts +1 -0
  4. package/components/BaseView.js +1 -1
  5. package/components/BaseView.mjs +7 -7
  6. package/components/CurrentTimeMarket.js +1 -1
  7. package/components/CurrentTimeMarket.mjs +26 -26
  8. package/components/DateHeaderCell.js +1 -1
  9. package/components/DateHeaderCell.mjs +5 -5
  10. package/components/MoreEventsPopover.js +1 -1
  11. package/components/MoreEventsPopover.mjs +45 -29
  12. package/constants/index.d.ts +2 -0
  13. package/constants/index.js +1 -1
  14. package/constants/index.mjs +15 -13
  15. package/dist/cdn/js/kendo-react-scheduler.js +1 -1
  16. package/editors/SchedulerRecurrenceDialog.js +1 -1
  17. package/editors/SchedulerRecurrenceDialog.mjs +191 -188
  18. package/hooks/index.d.ts +2 -2
  19. package/hooks/usePropOrState.d.ts +2 -1
  20. package/hooks/usePropOrState.js +8 -0
  21. package/hooks/usePropOrState.mjs +16 -0
  22. package/hooks/useSlotExpand.js +1 -1
  23. package/hooks/useSlotExpand.mjs +22 -22
  24. package/hooks/useWorkHours.d.ts +1 -1
  25. package/hooks/useWorkHours.js +8 -0
  26. package/hooks/useWorkHours.mjs +18 -0
  27. package/items/SchedulerProportionalViewItem.js +1 -1
  28. package/items/SchedulerProportionalViewItem.mjs +94 -97
  29. package/items/SchedulerViewItem.d.ts +2 -0
  30. package/items/SchedulerViewItem.js +1 -1
  31. package/items/SchedulerViewItem.mjs +152 -150
  32. package/models/Group.d.ts +2 -0
  33. package/models/SchedulerView.d.ts +4 -0
  34. package/package-metadata.js +1 -1
  35. package/package-metadata.mjs +2 -2
  36. package/package.json +12 -12
  37. package/services/itemsService.js +1 -1
  38. package/services/itemsService.mjs +34 -34
  39. package/services/occurrenceService.js +1 -1
  40. package/services/occurrenceService.mjs +40 -34
  41. package/slots/SchedulerSlot.d.ts +2 -0
  42. package/slots/SchedulerSlot.js +1 -1
  43. package/slots/SchedulerSlot.mjs +1 -0
  44. package/tasks/SchedulerTask.js +1 -1
  45. package/tasks/SchedulerTask.mjs +12 -12
  46. package/utils/index.js +1 -1
  47. package/utils/index.mjs +14 -14
  48. package/views/agenda/AgendaView.js +1 -1
  49. package/views/agenda/AgendaView.mjs +48 -24
  50. package/views/common/VerticalResourceIterator.d.ts +1 -0
  51. package/views/common/VerticalResourceIterator.js +1 -1
  52. package/views/common/VerticalResourceIterator.mjs +29 -29
  53. package/views/day/MultiDayView.js +1 -1
  54. package/views/day/MultiDayView.mjs +108 -104
  55. package/views/month/MonthView.js +1 -1
  56. package/views/month/MonthView.mjs +67 -67
  57. package/views/time/MultiDayTimelineView.js +1 -1
  58. package/views/time/MultiDayTimelineView.mjs +101 -96
  59. package/components/footer/bussiness-hours/BussinessHours.d.ts +0 -20
  60. package/components/footer/bussiness-hours/BussinessHours.js +0 -8
  61. package/components/footer/bussiness-hours/BussinessHours.mjs +0 -29
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),c=require("@progress/kendo-react-common");function a(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const u=a(n),s=(e,o)=>{const[t,r]=u.useState(o);return e!==void 0?[e,c.noop]:[t,r]};exports.usePropOrState=s;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import * as s from "react";
9
+ import { noop as a } from "@progress/kendo-react-common";
10
+ const n = (t, e) => {
11
+ const [o, r] = s.useState(e);
12
+ return t !== void 0 ? [t, a] : [o, r];
13
+ };
14
+ export {
15
+ n as usePropOrState
16
+ };
@@ -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 k=require("react"),g=require("../views/common/utils.js"),q=require("../constants/index.js"),B=require("@progress/kendo-react-common"),C=require("../context/SchedulerContext.js");function M(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const l=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(n,s,l.get?l:{enumerable:!0,get:()=>e[s]})}}return n.default=e,Object.freeze(n)}const a=M(k),P=(e,n)=>{const s=a.useRef(void 0),l=a.useRef(0),y=C.useSchedulerElementContext(),H=()=>{if(!e.current)return;const o=e.current.element;o&&(l.current=o.clientHeight)},p=a.useCallback(()=>{if(!n||!e.current)return;const o=e.current.element,v=e.current.props;if(!o)return;const d=g.getPadding(o),t=new Map;let m=!1;const c=v.items.filter(r=>r._ref.current);c.forEach(r=>{var x,O,R,S,E;if(!r._ref.current)return;const{height:f}=g.getRect(r._ref.current.element),u=(R=(O=(x=r._ref.current)==null?void 0:x._order)!=null?O:r.order)!=null?R:-1;(S=r._ref.current.element)!=null&&S.style.top&&(m=!0),((E=t.get(u))!=null?E:0)<f&&t.set(u,f)});let i,_;if(!m||t.size===0){o.style.minHeight="";return}else{const r=Math.max(...Array.from(t.keys()));_=r+1;const f=Math.max(...Array.from(t.values()));i=0;for(let u=0;u<=r;u++)i+=t.has(u)?t.get(u):f}const j=typeof n=="object"&&n.offsetTop?n.offsetTop:0;let b=typeof n=="object"&&n.offsetBottom?n.offsetBottom:0;if(b>0){const r=o.querySelector(".k-more-events");if(r){const f=parseFloat(window.getComputedStyle(r).bottom)||0;b=r.offsetHeight+f}}const w=_*q.BORDER_WIDTH*2+i-d+j+b;c.length?w>l.current-d&&g.setRect(o,{height:w},!0):o&&(o.style.minHeight="")},[n,e]),h=a.useCallback(()=>{s.current!==void 0&&window.cancelAnimationFrame(s.current),s.current=window.requestAnimationFrame(()=>{p()})},[p]);B.useIsomorphicLayoutEffect(H,[]),a.useEffect(p,[e,e.current&&e.current.props,n]),a.useEffect(()=>{if(!e.current)return;const d=e.current.props.items.filter(t=>t._ref.current).map(t=>{if(!t._ref.current||!t._ref.current.element||!y.current)return;const m=window.ResizeObserver,c=m&&new m(h);c&&c.observe(t._ref.current.element);const i=new MutationObserver(h);return i.observe(t._ref.current.element,{attributes:!0,attributeFilter:["style"]}),()=>{c&&c.disconnect(),i.disconnect()}});return()=>{d.forEach(t=>t&&t())}},[h,y,e])};exports.useSlotExpand=P;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react"),g=require("../views/common/utils.js"),q=require("../constants/index.js"),B=require("@progress/kendo-react-common"),C=require("../context/SchedulerContext.js");function M(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const l=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(n,s,l.get?l:{enumerable:!0,get:()=>e[s]})}}return n.default=e,Object.freeze(n)}const a=M(k),P=(e,n)=>{const s=a.useRef(void 0),l=a.useRef(0),y=C.useSchedulerElementContext(),H=()=>{if(!e.current)return;const o=e.current.element;o&&(l.current=o.clientHeight)},d=a.useCallback(()=>{if(!n||!e.current)return;const o=e.current.element,v=e.current.props;if(!o)return;const p=g.getPadding(o),t=new Map;let m=!1;const c=v.items.filter(r=>r._ref.current);c.forEach(r=>{var x,O,R,S,E;if(!r._ref.current)return;const{height:f}=g.getRect(r._ref.current.element),u=(R=(O=(x=r._ref.current)==null?void 0:x._order)!=null?O:r.order)!=null?R:-1;(S=r._ref.current.element)!=null&&S.style.top&&(m=!0),((E=t.get(u))!=null?E:0)<f&&t.set(u,f)});let i,_;if(!m||t.size===0){o.style.minHeight="";return}else{const r=Math.max(...Array.from(t.keys()));_=r+1;const f=Math.max(...Array.from(t.values()));i=0;for(let u=0;u<=r;u++)i+=t.has(u)?t.get(u):f}const j=typeof n=="object"&&n.offsetTop?n.offsetTop:0;let b=typeof n=="object"&&n.offsetBottom?n.offsetBottom:0;if(b>0){const r=o.querySelector(".k-more-events");if(r){const f=parseFloat(window.getComputedStyle(r).bottom)||0;b=r.offsetHeight+f}}const w=_*q.BORDER_WIDTH*2+i-p+j+b;c.length?w>l.current-p&&g.setRect(o,{height:w},!0):o&&(o.style.minHeight="")},[n,e]),h=a.useCallback(()=>{s.current!==void 0&&window.cancelAnimationFrame(s.current),s.current=window.requestAnimationFrame(()=>{d()})},[d]);B.useIsomorphicLayoutEffect(H,[]),a.useEffect(d,[e,e.current&&e.current.props,n]),a.useEffect(()=>{if(!e.current)return;const p=e.current.props.items.filter(t=>t._ref.current).map(t=>{if(!t._ref.current||!t._ref.current.element||!y.current)return;const m=window.ResizeObserver,c=m&&new m(h);c&&c.observe(t._ref.current.element);const i=new MutationObserver(h);return i.observe(t._ref.current.element,{attributes:!0,attributeFilter:["style"]}),()=>{c&&c.disconnect(),i.disconnect()}});return()=>{p.forEach(t=>t&&t())}},[h,y,e,e.current&&e.current.props])};exports.useSlotExpand=P;
@@ -10,60 +10,60 @@ import { getPadding as k, getRect as C, setRect as z } from "../views/common/uti
10
10
  import { BORDER_WIDTH as A } from "../constants/index.mjs";
11
11
  import { useIsomorphicLayoutEffect as F } from "@progress/kendo-react-common";
12
12
  import { useSchedulerElementContext as M } from "../context/SchedulerContext.mjs";
13
- const j = (r, o) => {
13
+ const j = (t, o) => {
14
14
  const l = f.useRef(void 0), b = f.useRef(0), g = M(), B = () => {
15
- if (!r.current)
15
+ if (!t.current)
16
16
  return;
17
- const n = r.current.element;
17
+ const n = t.current.element;
18
18
  n && (b.current = n.clientHeight);
19
19
  }, p = f.useCallback(() => {
20
- if (!o || !r.current)
20
+ if (!o || !t.current)
21
21
  return;
22
- const n = r.current.element, v = r.current.props;
22
+ const n = t.current.element, v = t.current.props;
23
23
  if (!n)
24
24
  return;
25
25
  const a = k(n), e = /* @__PURE__ */ new Map();
26
26
  let m = !1;
27
- const s = v.items.filter((t) => t._ref.current);
28
- s.forEach((t) => {
27
+ const s = v.items.filter((r) => r._ref.current);
28
+ s.forEach((r) => {
29
29
  var _, x, R, H, E;
30
- if (!t._ref.current)
30
+ if (!r._ref.current)
31
31
  return;
32
- const { height: u } = C(t._ref.current.element), c = (R = (x = (_ = t._ref.current) == null ? void 0 : _._order) != null ? x : t.order) != null ? R : -1;
33
- (H = t._ref.current.element) != null && H.style.top && (m = !0), ((E = e.get(c)) != null ? E : 0) < u && e.set(c, u);
32
+ const { height: u } = C(r._ref.current.element), c = (R = (x = (_ = r._ref.current) == null ? void 0 : _._order) != null ? x : r.order) != null ? R : -1;
33
+ (H = r._ref.current.element) != null && H.style.top && (m = !0), ((E = e.get(c)) != null ? E : 0) < u && e.set(c, u);
34
34
  });
35
35
  let i, w;
36
36
  if (!m || e.size === 0) {
37
37
  n.style.minHeight = "";
38
38
  return;
39
39
  } else {
40
- const t = Math.max(...Array.from(e.keys()));
41
- w = t + 1;
40
+ const r = Math.max(...Array.from(e.keys()));
41
+ w = r + 1;
42
42
  const u = Math.max(...Array.from(e.values()));
43
43
  i = 0;
44
- for (let c = 0; c <= t; c++)
44
+ for (let c = 0; c <= r; c++)
45
45
  i += e.has(c) ? e.get(c) : u;
46
46
  }
47
47
  const O = typeof o == "object" && o.offsetTop ? o.offsetTop : 0;
48
48
  let h = typeof o == "object" && o.offsetBottom ? o.offsetBottom : 0;
49
49
  if (h > 0) {
50
- const t = n.querySelector(".k-more-events");
51
- if (t) {
52
- const u = parseFloat(window.getComputedStyle(t).bottom) || 0;
53
- h = t.offsetHeight + u;
50
+ const r = n.querySelector(".k-more-events");
51
+ if (r) {
52
+ const u = parseFloat(window.getComputedStyle(r).bottom) || 0;
53
+ h = r.offsetHeight + u;
54
54
  }
55
55
  }
56
56
  const y = w * A * 2 + i - a + O + h;
57
57
  s.length ? y > b.current - a && z(n, { height: y }, !0) : n && (n.style.minHeight = "");
58
- }, [o, r]), d = f.useCallback(() => {
58
+ }, [o, t]), d = f.useCallback(() => {
59
59
  l.current !== void 0 && window.cancelAnimationFrame(l.current), l.current = window.requestAnimationFrame(() => {
60
60
  p();
61
61
  });
62
62
  }, [p]);
63
- F(B, []), f.useEffect(p, [r, r.current && r.current.props, o]), f.useEffect(() => {
64
- if (!r.current)
63
+ F(B, []), f.useEffect(p, [t, t.current && t.current.props, o]), f.useEffect(() => {
64
+ if (!t.current)
65
65
  return;
66
- const a = r.current.props.items.filter((e) => e._ref.current).map((e) => {
66
+ const a = t.current.props.items.filter((e) => e._ref.current).map((e) => {
67
67
  if (!e._ref.current || !e._ref.current.element || !g.current)
68
68
  return;
69
69
  const m = window.ResizeObserver, s = m && new m(d);
@@ -76,7 +76,7 @@ const j = (r, o) => {
76
76
  return () => {
77
77
  a.forEach((e) => e && e());
78
78
  };
79
- }, [d, g, r]);
79
+ }, [d, g, t, t.current && t.current.props]);
80
80
  };
81
81
  export {
82
82
  j as useSlotExpand
@@ -6,4 +6,4 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  /** @hidden */
9
- export declare const useWorkHours: (showWorkHours?: boolean, defaultShowWorkHours?: boolean) => any[];
9
+ export declare const useWorkHours: (showWorkHours?: boolean, defaultShowWorkHours?: boolean) => [boolean, () => void];
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),u=require("./usePropOrState.js");function c(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,o.get?o:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const a=c(s),l=(t,r)=>{const[e,o]=u.usePropOrState(t,r),n=a.useCallback(()=>{o(!e)},[e,o]);return[e,n]};exports.useWorkHours=l;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import * as a from "react";
9
+ import { usePropOrState as n } from "./usePropOrState.mjs";
10
+ const c = (s, t) => {
11
+ const [o, r] = n(s, t), e = a.useCallback(() => {
12
+ r(!o);
13
+ }, [o, r]);
14
+ return [o, e];
15
+ };
16
+ export {
17
+ c as useWorkHours
18
+ };
@@ -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 ge=require("react"),ve=require("./SchedulerItem.js"),h=require("../utils/index.js"),b=require("../views/common/utils.js"),E=require("../constants/index.js"),Se=require("@progress/kendo-react-intl"),J=require("./SchedulerItemContent.js"),g=require("@progress/kendo-react-common"),m=require("@progress/kendo-svg-icons"),Q=require("../context/SchedulerViewContext.js"),Ie=require("../context/SchedulerContext.js"),we=require("../hooks/useRowSync.js");function Re(e){const T=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const w in e)if(w!=="default"){const _=Object.getOwnPropertyDescriptor(e,w);Object.defineProperty(T,w,_.get?_:{enumerable:!0,get:()=>e[w]})}}return T.default=e,Object.freeze(T)}const t=Re(ge),Ee=1,X=12,Y=t.forwardRef((e,T)=>{const{item:w,_ref:_,itemRef:ee,...te}=e,A=t.useRef(void 0),o=t.useRef(null),C=t.useRef(null),W=t.useRef(null);t.useImperativeHandle(C,()=>({props:e,element:o.current&&o.current.element})),t.useImperativeHandle(T,()=>C.current),t.useImperativeHandle(_,()=>o.current),t.useImperativeHandle(ee,()=>o.current);const re=w||Z.item,y=Se.useInternationalization(),[ne]=Q.useSchedulerViewItemsContext(),[ce]=Q.useSchedulerViewSlotsContext(),P=Ie.useSchedulerElementContext(),[ie,V]=t.useState(!0),[oe,ae]=t.useState(!1),p=t.useRef(0),v=t.useRef(null),S=t.useRef([]),M=g.useDir(P),se=t.useMemo(()=>{var c,n;return e.isAllDay?(c=e.title)!=null?c:"":`(${y.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd)}): ${(n=e.title)!=null?n:""}`},[y,e.isAllDay,e.title,e.zonedEnd,e.zonedStart]);let I;e.isRecurring&&!e.isException?I="recurring":!e.isRecurring&&e.isException&&(I="non-recurring");const le=t.useMemo(()=>y.format("{0:t} – {1:t}",e.zonedStart,e.zonedEnd),[y,e.zonedStart,e.zonedEnd]),ue=(c,n)=>{let i=0;return n.forEach(s=>{s._order!==void 0&&s._order!==null&&i<s._order&&(i=s._order)}),i+1},me=(c,n,i)=>{const[s,f]=n,l=new Date(Math.min(f.props.end.getTime()-i,Math.max(e.start.getTime(),s.props.start.getTime()))),R=new Date(Math.max(l.getTime()+i,Math.min(e.end.getTime(),f.props.end.getTime())));return c.filter(u=>{const H=Math.max(Math.min(f.props.end.getTime()-i,u.props.start.getTime()),s.props.start.getTime()),x=Math.min(Math.max(H+i,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)&&h.intersects(new Date(H),new Date(x),l,R)&&h.intersects(s.props.start,f.props.end,u.props.start,u.props.end)})},de=(c,n)=>c.group.index===n.group.index&&c.range.index===n.range.index&&(c.range.isAllDay===void 0||n.range.isAllDay===void 0||c.range.isAllDay===n.range.isAllDay)&&(e.ignoreIsAllDay||c.isAllDay===n.isAllDay),O=()=>{var L,$,G,K,U;const c=ce.filter(r=>r.current&&de(r.current.props,e)).sort((r,D)=>r.current.props.start.getTime()-D.current.props.start.getTime()),n=c.filter(r=>h.intersects(r.current.props.start,r.current.props.end,e.start,e.end)),i=o.current&&o.current.element;if(!i||!n.length)return;const s=h.first(c),f=h.last(c),l=h.first(n),R=h.last(n);if(!l.current||!o.current||!R.current||!s.current||!f.current)return;if(!h.intersects(l.current.props.start,R.current.props.end,e.start,e.end)){V(!1);return}const k=[],u=[],H=[],x=b.getRect(l.current.element),N=(e.vertical?x.height:x.width)/(l.current.props.end.getTime()-l.current.props.start.getTime()),j=(e.vertical?X:8)/N,z=(Math.min(e.start.getTime(),R.current.props.end.getTime()-j)-l.current.props.start.getTime())*N,F=Math.floor(Math.min(e.end.getTime(),R.current.props.end.getTime())-Math.max(e.start.getTime(),l.current.props.start.getTime()))*N;(ne||[]).forEach(r=>{r.current&&(r.current.props.dragHint?u.push(r.current):r.current.props.resizeHint?H.push(r.current):k.push(r.current))}),S.current=me(k,[s.current,f.current],j),v.current=e.resizeHint||e.dragHint?0:h.calculateProportionalOrder(o.current,S.current);let d=1;e.resizeHint||e.dragHint||(d=ue(o.current,S.current),S.current.forEach(r=>{r._maxSiblingsPerSlot&&d<r._maxSiblingsPerSlot&&(d=r._maxSiblingsPerSlot)}),S.current.forEach(r=>{r._maxSiblingsPerSlot!==void 0&&r._maxSiblingsPerSlot!==null&&r._maxSiblingsPerSlot<d&&(r._maxSiblingsPerSlot=d)}));let q=0;const a=x;S.current.forEach(r=>{let D=0;r._order!==void 0&&r._order!==null&&r._order<v.current&&(D=b.getRect(r.element).top+b.getRect(r.element).height-a.top-E.BORDER_WIDTH*v.current+Ee),D>q&&(q=D)});const fe=20;a.width=e.vertical?a.width/d-E.BORDER_WIDTH-fe/d:F-E.BORDER_WIDTH,e.vertical?a.height=F-E.BORDER_WIDTH:(e.resizeHint||e.dragHint)&&d<=1||(a.height=($=(L=e.style)==null?void 0:L.height)!=null?$:X),a.left=e.vertical?a.left+((G=v.current)!=null?G:0)+E.BORDER_WIDTH*((K=v.current)!=null?K:0)*a.width:a.left+(z<0?0:z),a.top=e.vertical?a.top+(z<0?0:z):a.top+q+E.BORDER_WIDTH*((U=v.current)!=null?U:0),p.current=d,b.setRect(i,a),ae(!0),V(!0)},B=t.useCallback(c=>{const n=c&&c[0],i=W.current;A.current!==void 0&&window.cancelAnimationFrame(A.current),i&&n&&(i.width!==n.contentRect.width||i.height!==n.contentRect.height)&&(A.current=window.requestAnimationFrame(()=>{O()})),W.current={width:n.contentRect.width,height:n.contentRect.height}},[O]);t.useEffect(O);const he=o.current&&o.current.element?o.current.element.closest(".k-scheduler-layout"):null;return we.useRowSync({element:he,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),t.useEffect(()=>{if(!P.current)return;const c=window.ResizeObserver,n=c&&new c(B);return n&&n.observe(P.current),()=>{n&&n.disconnect()}},[B,P]),t.createElement(re,{...te,_ref:o,_order:v,_maxSiblingsPerSlot:p,_siblings:S,itemRef:o,style:{visibility:oe?void 0:"hidden",display:ie?void 0:"none",...e.style}},!e.resizeHint&&t.createElement(t.Fragment,null,e.tail&&!e.vertical&&t.createElement("span",{className:"k-event-continuation"},t.createElement(g.IconWrap,{name:M==="rtl"?"chevron-right":"chevron-left",icon:M==="rtl"?m.chevronRightIcon:m.chevronLeftIcon})),t.createElement("div",{title:se},e.tail&&e.vertical&&t.createElement("span",{className:"k-event-continuation"},t.createElement(g.IconWrap,{name:"chevron-up",icon:m.chevronUpIcon})),t.createElement(J.SchedulerItemContent,{className:"k-event-title"},e.title),!e.isAllDay&&t.createElement(J.SchedulerItemContent,{className:"k-event-time"},I==="recurring"&&t.createElement("span",{className:"k-event-recurrence-icon"},t.createElement(g.IconWrap,{name:"arrow-rotate-cw",icon:m.arrowRotateCwIcon})),I==="non-recurring"&&t.createElement("span",{className:"k-event-recurrence-icon"},t.createElement(g.IconWrap,{name:"arrows-no-repeat",icon:m.arrowsNoRepeatIcon})),le),e.head&&e.vertical&&t.createElement("span",{className:"k-event-continuation"},t.createElement(g.IconWrap,{name:"chevron-down",icon:m.chevronDownIcon}))),I&&t.createElement("span",{className:"k-event-recurrence-icon"},t.createElement(g.IconWrap,{name:I==="recurring"?"arrow-rotate-cw":"arrows-no-repeat",icon:I==="recurring"?m.arrowRotateCwIcon:m.arrowsNoRepeatIcon})),e.head&&!e.vertical&&t.createElement("span",{className:"k-event-continuation"},t.createElement(g.IconWrap,{name:M==="rtl"?"chevron-left":"chevron-right",icon:M==="rtl"?m.chevronLeftIcon:m.chevronRightIcon}))))}),Z={item:ve.SchedulerItem};Y.displayName="KendoReactSchedulerProportionalViewItem";exports.SchedulerProportionalViewItem=Y;exports.schedulerProportionalViewItemDefaultProps=Z;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ge=require("react"),ve=require("./SchedulerItem.js"),h=require("../utils/index.js"),O=require("../views/common/utils.js"),R=require("../constants/index.js"),Ie=require("@progress/kendo-react-intl"),J=require("./SchedulerItemContent.js"),f=require("@progress/kendo-react-common"),m=require("@progress/kendo-svg-icons"),Q=require("../context/SchedulerViewContext.js"),we=require("../context/SchedulerContext.js"),Re=require("../hooks/useRowSync.js");function Se(e){const S=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const I in e)if(I!=="default"){const x=Object.getOwnPropertyDescriptor(e,I);Object.defineProperty(S,I,x.get?x:{enumerable:!0,get:()=>e[I]})}}return S.default=e,Object.freeze(S)}const t=Se(ge),Ee=1,X=12,Y=t.forwardRef((e,S)=>{const{item:I,_ref:x,itemRef:ee,...te}=e,k=t.useRef(void 0),o=t.useRef(null),C=t.useRef(null),W=t.useRef(null);t.useImperativeHandle(C,()=>({props:e,element:o.current&&o.current.element})),t.useImperativeHandle(S,()=>C.current),t.useImperativeHandle(x,()=>o.current),t.useImperativeHandle(ee,()=>o.current);const ne=I||Z.item,_=Ie.useInternationalization(),[re]=Q.useSchedulerViewItemsContext(),[ce]=Q.useSchedulerViewSlotsContext(),M=we.useSchedulerElementContext(),[ie,V]=t.useState(!0),[oe,ae]=t.useState(!1),p=t.useRef(0),g=t.useRef(null),E=t.useRef([]),H=f.useDir(M),se=t.useMemo(()=>{var r,n;return e.isAllDay?(r=e.title)!=null?r:"":`(${_.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd)}): ${(n=e.title)!=null?n:""}`},[_,e.isAllDay,e.title,e.zonedEnd,e.zonedStart]);let v;e.isRecurring&&!e.isException?v="recurring":!e.isRecurring&&e.isException&&(v="non-recurring");const le=t.useMemo(()=>_.format("{0:t} – {1:t}",e.zonedStart,e.zonedEnd),[_,e.zonedStart,e.zonedEnd]),ue=(r,n)=>{var d;let i=(d=r._order)!=null?d:0;return n.forEach(a=>{a._order!==void 0&&a._order!==null&&i<a._order&&(i=a._order)}),i+1},me=(r,n,i)=>{const[d,a]=n,l=new Date(Math.min(a.props.end.getTime()-i,Math.max(e.start.getTime(),d.props.start.getTime()))),w=new Date(Math.max(l.getTime()+i,Math.min(e.end.getTime(),a.props.end.getTime())));return r.filter(u=>{const z=Math.max(Math.min(a.props.end.getTime()-i,u.props.start.getTime()),d.props.start.getTime()),T=Math.min(Math.max(z+i,u.props.end.getTime()),a.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)&&h.intersects(new Date(z),new Date(T),l,w)&&h.intersects(d.props.start,a.props.end,u.props.start,u.props.end)})},de=(r,n)=>r.group.index===n.group.index&&r.range.index===n.range.index&&(r.range.isAllDay===void 0||n.range.isAllDay===void 0||r.range.isAllDay===n.range.isAllDay)&&(e.ignoreIsAllDay||r.isAllDay===n.isAllDay),P=()=>{var L,$,G,K,U;const r=ce.filter(c=>c.current&&de(c.current.props,e)).sort((c,y)=>c.current.props.start.getTime()-y.current.props.start.getTime()),n=r.filter(c=>h.intersects(c.current.props.start,c.current.props.end,e.start,e.end)),i=o.current&&o.current.element;if(!i||!n.length)return;const d=h.first(r),a=h.last(r),l=h.first(n),w=h.last(n);if(!l.current||!o.current||!w.current||!d.current||!a.current)return;if(!h.intersects(l.current.props.start,w.current.props.end,e.start,e.end)){V(!1);return}const b=[],u=[],z=[],T=O.getRect(l.current.element),N=(e.vertical?T.height:T.width)/(l.current.props.end.getTime()-l.current.props.start.getTime()),j=(e.vertical?X:8)/N,A=(Math.min(e.start.getTime(),w.current.props.end.getTime()-j)-l.current.props.start.getTime())*N,F=Math.floor(Math.min(e.end.getTime(),w.current.props.end.getTime())-Math.max(e.start.getTime(),l.current.props.start.getTime()))*N;(re||[]).forEach(c=>{c.current&&(c.current.props.dragHint?u.push(c.current):c.current.props.resizeHint?z.push(c.current):b.push(c.current))}),E.current=me(b,[d.current,a.current],j),g.current=e.resizeHint||e.dragHint?0:h.calculateProportionalOrder(o.current,E.current);let D=1;e.resizeHint||e.dragHint||(D=ue(o.current,E.current));let q=0;const s=T;E.current.forEach(c=>{let y=0;c._order!==void 0&&c._order!==null&&c._order<g.current&&(y=O.getRect(c.element).top+O.getRect(c.element).height-s.top-R.BORDER_WIDTH*g.current+Ee),y>q&&(q=y)});const fe=20;s.width=e.vertical?s.width/D-R.BORDER_WIDTH-fe/D:F-R.BORDER_WIDTH,e.vertical?s.height=F-R.BORDER_WIDTH:(e.resizeHint||e.dragHint)&&D<=1||(s.height=($=(L=e.style)==null?void 0:L.height)!=null?$:X),s.left=e.vertical?s.left+((G=g.current)!=null?G:0)+R.BORDER_WIDTH*((K=g.current)!=null?K:0)*s.width:s.left+(A<0?0:A),s.top=e.vertical?s.top+(A<0?0:A):s.top+q+R.BORDER_WIDTH*((U=g.current)!=null?U:0),p.current=D,O.setRect(i,s),ae(!0),V(!0)},B=t.useCallback(r=>{const n=r&&r[0],i=W.current;k.current!==void 0&&window.cancelAnimationFrame(k.current),i&&n&&(i.width!==n.contentRect.width||i.height!==n.contentRect.height)&&(k.current=window.requestAnimationFrame(()=>{P()})),W.current={width:n.contentRect.width,height:n.contentRect.height}},[P]);t.useEffect(P);const he=o.current&&o.current.element?o.current.element.closest(".k-scheduler-layout"):null;return Re.useRowSync({element:he,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),t.useEffect(()=>{if(!M.current)return;const r=window.ResizeObserver,n=r&&new r(B);return n&&n.observe(M.current),()=>{n&&n.disconnect()}},[B,M]),t.createElement(ne,{...te,_ref:o,_order:g,_maxSiblingsPerSlot:p,_siblings:E,itemRef:o,style:{visibility:oe?void 0:"hidden",display:ie?void 0:"none",...e.style}},!e.resizeHint&&t.createElement(t.Fragment,null,e.tail&&!e.vertical&&t.createElement("span",{className:"k-event-continuation"},t.createElement(f.IconWrap,{name:H==="rtl"?"chevron-right":"chevron-left",icon:H==="rtl"?m.chevronRightIcon:m.chevronLeftIcon})),t.createElement("div",{title:se},e.tail&&e.vertical&&t.createElement("span",{className:"k-event-continuation"},t.createElement(f.IconWrap,{name:"chevron-up",icon:m.chevronUpIcon})),t.createElement(J.SchedulerItemContent,{className:"k-event-title"},e.title),!e.isAllDay&&t.createElement(J.SchedulerItemContent,{className:"k-event-time"},v==="recurring"&&t.createElement("span",{className:"k-event-recurrence-icon"},t.createElement(f.IconWrap,{name:"arrow-rotate-cw",icon:m.arrowRotateCwIcon})),v==="non-recurring"&&t.createElement("span",{className:"k-event-recurrence-icon"},t.createElement(f.IconWrap,{name:"arrows-no-repeat",icon:m.arrowsNoRepeatIcon})),le),e.head&&e.vertical&&t.createElement("span",{className:"k-event-continuation"},t.createElement(f.IconWrap,{name:"chevron-down",icon:m.chevronDownIcon}))),v&&t.createElement("span",{className:"k-event-recurrence-icon"},t.createElement(f.IconWrap,{name:v==="recurring"?"arrow-rotate-cw":"arrows-no-repeat",icon:v==="recurring"?m.arrowRotateCwIcon:m.arrowsNoRepeatIcon})),e.head&&!e.vertical&&t.createElement("span",{className:"k-event-continuation"},t.createElement(f.IconWrap,{name:H==="rtl"?"chevron-left":"chevron-right",icon:H==="rtl"?m.chevronLeftIcon:m.chevronRightIcon}))))}),Z={item:ve.SchedulerItem};Y.displayName="KendoReactSchedulerProportionalViewItem";exports.SchedulerProportionalViewItem=Y;exports.schedulerProportionalViewItemDefaultProps=Z;
@@ -6,105 +6,102 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import * as t from "react";
9
- import { SchedulerItem as Se } from "./SchedulerItem.mjs";
10
- import { intersects as D, first as B, last as K, calculateProportionalOrder as we } from "../utils/index.mjs";
11
- import { getRect as k, setRect as Ee } from "../views/common/utils.mjs";
12
- import { BORDER_WIDTH as w } from "../constants/index.mjs";
13
- import { useInternationalization as xe } from "@progress/kendo-react-intl";
9
+ import { SchedulerItem as we } from "./SchedulerItem.mjs";
10
+ import { intersects as M, first as B, last as K, calculateProportionalOrder as Ee } from "../utils/index.mjs";
11
+ import { getRect as N, setRect as Se } from "../views/common/utils.mjs";
12
+ import { BORDER_WIDTH as v } from "../constants/index.mjs";
13
+ import { useInternationalization as Ie } from "@progress/kendo-react-intl";
14
14
  import { SchedulerItemContent as U } from "./SchedulerItemContent.mjs";
15
- import { useDir as Ie, IconWrap as v } from "@progress/kendo-react-common";
16
- import { chevronRightIcon as j, chevronLeftIcon as J, chevronUpIcon as Re, arrowRotateCwIcon as Q, arrowsNoRepeatIcon as X, chevronDownIcon as Te } from "@progress/kendo-svg-icons";
17
- import { useSchedulerViewItemsContext as ye, useSchedulerViewSlotsContext as _e } from "../context/SchedulerViewContext.mjs";
18
- import { useSchedulerElementContext as De } from "../context/SchedulerContext.mjs";
19
- import { useRowSync as Me } from "../hooks/useRowSync.mjs";
20
- const ze = 1, Y = 12, Ae = t.forwardRef(
15
+ import { useDir as Re, IconWrap as f } from "@progress/kendo-react-common";
16
+ import { chevronRightIcon as j, chevronLeftIcon as J, chevronUpIcon as Te, arrowRotateCwIcon as Q, arrowsNoRepeatIcon as X, chevronDownIcon as ye } from "@progress/kendo-svg-icons";
17
+ import { useSchedulerViewItemsContext as xe, useSchedulerViewSlotsContext as De } from "../context/SchedulerViewContext.mjs";
18
+ import { useSchedulerElementContext as Me } from "../context/SchedulerContext.mjs";
19
+ import { useRowSync as ze } from "../hooks/useRowSync.mjs";
20
+ const _e = 1, Y = 12, Ae = t.forwardRef(
21
21
  (e, Z) => {
22
- const { item: ee, _ref: te, itemRef: re, ...ne } = e, M = t.useRef(void 0), a = t.useRef(null), N = t.useRef(null), b = t.useRef(null);
23
- t.useImperativeHandle(N, () => ({ props: e, element: a.current && a.current.element })), t.useImperativeHandle(Z, () => N.current), t.useImperativeHandle(te, () => a.current), t.useImperativeHandle(re, () => a.current);
24
- const ie = ee || Pe.item, I = xe(), [ce] = ye(), [ae] = _e(), R = De(), [oe, C] = t.useState(!0), [le, se] = t.useState(!1), O = t.useRef(0), f = t.useRef(null), h = t.useRef([]), T = Ie(R), me = t.useMemo(
22
+ const { item: ee, _ref: te, itemRef: re, ...ne } = e, z = t.useRef(void 0), a = t.useRef(null), P = t.useRef(null), b = t.useRef(null);
23
+ t.useImperativeHandle(P, () => ({ props: e, element: a.current && a.current.element })), t.useImperativeHandle(Z, () => P.current), t.useImperativeHandle(te, () => a.current), t.useImperativeHandle(re, () => a.current);
24
+ const ce = ee || He.item, R = Ie(), [ie] = xe(), [ae] = De(), T = Me(), [oe, C] = t.useState(!0), [se, le] = t.useState(!1), O = t.useRef(0), d = t.useRef(null), w = t.useRef([]), y = Re(T), ue = t.useMemo(
25
25
  () => {
26
- var i, n;
27
- return e.isAllDay ? (i = e.title) != null ? i : "" : `(${I.format("{0:t} - {1:t}", e.zonedStart, e.zonedEnd)}): ${(n = e.title) != null ? n : ""}`;
26
+ var n, r;
27
+ return e.isAllDay ? (n = e.title) != null ? n : "" : `(${R.format("{0:t} - {1:t}", e.zonedStart, e.zonedEnd)}): ${(r = e.title) != null ? r : ""}`;
28
28
  },
29
- [I, e.isAllDay, e.title, e.zonedEnd, e.zonedStart]
29
+ [R, e.isAllDay, e.title, e.zonedEnd, e.zonedStart]
30
30
  );
31
- let g;
32
- e.isRecurring && !e.isException ? g = "recurring" : !e.isRecurring && e.isException && (g = "non-recurring");
33
- const ue = t.useMemo(
34
- () => I.format("{0:t} – {1:t}", e.zonedStart, e.zonedEnd),
35
- [I, e.zonedStart, e.zonedEnd]
36
- ), de = (i, n) => {
37
- let c = 0;
38
- return n.forEach((l) => {
39
- l._order !== void 0 && l._order !== null && c < l._order && (c = l._order);
40
- }), c + 1;
41
- }, fe = (i, n, c) => {
42
- const [l, d] = n, s = new Date(
31
+ let h;
32
+ e.isRecurring && !e.isException ? h = "recurring" : !e.isRecurring && e.isException && (h = "non-recurring");
33
+ const me = t.useMemo(
34
+ () => R.format("{0:t} – {1:t}", e.zonedStart, e.zonedEnd),
35
+ [R, e.zonedStart, e.zonedEnd]
36
+ ), de = (n, r) => {
37
+ var m;
38
+ let i = (m = n._order) != null ? m : 0;
39
+ return r.forEach((o) => {
40
+ o._order !== void 0 && o._order !== null && i < o._order && (i = o._order);
41
+ }), i + 1;
42
+ }, he = (n, r, i) => {
43
+ const [m, o] = r, l = new Date(
43
44
  Math.min(
44
- d.props.end.getTime() - c,
45
- Math.max(e.start.getTime(), l.props.start.getTime())
45
+ o.props.end.getTime() - i,
46
+ Math.max(e.start.getTime(), m.props.start.getTime())
46
47
  )
47
- ), S = new Date(
48
- Math.max(s.getTime() + c, Math.min(e.end.getTime(), d.props.end.getTime()))
48
+ ), g = new Date(
49
+ Math.max(l.getTime() + i, Math.min(e.end.getTime(), o.props.end.getTime()))
49
50
  );
50
- return i.filter((m) => {
51
- const y = Math.max(
52
- Math.min(d.props.end.getTime() - c, m.props.start.getTime()),
53
- l.props.start.getTime()
51
+ return n.filter((u) => {
52
+ const x = Math.max(
53
+ Math.min(o.props.end.getTime() - i, u.props.start.getTime()),
54
+ m.props.start.getTime()
54
55
  ), E = Math.min(
55
- Math.max(y + c, m.props.end.getTime()),
56
- d.props.end.getTime()
56
+ Math.max(x + i, u.props.end.getTime()),
57
+ o.props.end.getTime()
57
58
  );
58
- return m.props.id !== e.id && m.props.group.index === e.group.index && m.props.range.index === e.range.index && (e.ignoreIsAllDay || m.props.isAllDay === e.isAllDay) && D(new Date(y), new Date(E), s, S) && D(l.props.start, d.props.end, m.props.start, m.props.end);
59
+ 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(new Date(x), new Date(E), l, g) && M(m.props.start, o.props.end, u.props.start, u.props.end);
59
60
  });
60
- }, he = (i, n) => i.group.index === n.group.index && i.range.index === n.range.index && // When slotDuration equals a full day, both daySlots and timeSlots have isAllDay=true,
61
+ }, fe = (n, r) => n.group.index === r.group.index && n.range.index === r.range.index && // When slotDuration equals a full day, both daySlots and timeSlots have isAllDay=true,
61
62
  // so we need to also check range.isAllDay to distinguish between them.
62
- (i.range.isAllDay === void 0 || n.range.isAllDay === void 0 || i.range.isAllDay === n.range.isAllDay) && (e.ignoreIsAllDay || i.isAllDay === n.isAllDay), z = () => {
63
+ (n.range.isAllDay === void 0 || r.range.isAllDay === void 0 || n.range.isAllDay === r.range.isAllDay) && (e.ignoreIsAllDay || n.isAllDay === r.isAllDay), _ = () => {
63
64
  var G, L, W, $, q;
64
- const i = ae.filter((r) => r.current && he(r.current.props, e)).sort((r, x) => r.current.props.start.getTime() - x.current.props.start.getTime()), n = i.filter(
65
- (r) => D(r.current.props.start, r.current.props.end, e.start, e.end)
66
- ), c = a.current && a.current.element;
67
- if (!c || !n.length)
65
+ const n = ae.filter((c) => c.current && fe(c.current.props, e)).sort((c, I) => c.current.props.start.getTime() - I.current.props.start.getTime()), r = n.filter(
66
+ (c) => M(c.current.props.start, c.current.props.end, e.start, e.end)
67
+ ), i = a.current && a.current.element;
68
+ if (!i || !r.length)
68
69
  return;
69
- const l = B(i), d = K(i), s = B(n), S = K(n);
70
- if (!s.current || !a.current || !S.current || !l.current || !d.current)
70
+ const m = B(n), o = K(n), l = B(r), g = K(r);
71
+ if (!l.current || !a.current || !g.current || !m.current || !o.current)
71
72
  return;
72
- if (!D(s.current.props.start, S.current.props.end, e.start, e.end)) {
73
+ if (!M(l.current.props.start, g.current.props.end, e.start, e.end)) {
73
74
  C(!1);
74
75
  return;
75
76
  }
76
- const A = [], m = [], y = [], E = k(s.current.element), P = (e.vertical ? E.height : E.width) / (s.current.props.end.getTime() - s.current.props.start.getTime()), F = (e.vertical ? Y : 8) / P, _ = (Math.min(e.start.getTime(), S.current.props.end.getTime() - F) - s.current.props.start.getTime()) * P, p = Math.floor(
77
- Math.min(e.end.getTime(), S.current.props.end.getTime()) - Math.max(e.start.getTime(), s.current.props.start.getTime())
78
- ) * P;
79
- (ce || []).forEach((r) => {
80
- r.current && (r.current.props.dragHint ? m.push(r.current) : r.current.props.resizeHint ? y.push(r.current) : A.push(r.current));
81
- }), h.current = fe(A, [l.current, d.current], F), f.current = e.resizeHint || e.dragHint ? 0 : we(a.current, h.current);
82
- let u = 1;
83
- e.resizeHint || e.dragHint || (u = de(a.current, h.current), h.current.forEach((r) => {
84
- r._maxSiblingsPerSlot && u < r._maxSiblingsPerSlot && (u = r._maxSiblingsPerSlot);
85
- }), h.current.forEach((r) => {
86
- r._maxSiblingsPerSlot !== void 0 && r._maxSiblingsPerSlot !== null && r._maxSiblingsPerSlot < u && (r._maxSiblingsPerSlot = u);
87
- }));
88
- let H = 0;
89
- const o = E;
90
- h.current.forEach((r) => {
91
- let x = 0;
92
- r._order !== void 0 && r._order !== null && r._order < f.current && (x = k(r.element).top + k(r.element).height - o.top - w * f.current + ze), x > H && (H = x);
77
+ const A = [], u = [], x = [], E = N(l.current.element), H = (e.vertical ? E.height : E.width) / (l.current.props.end.getTime() - l.current.props.start.getTime()), F = (e.vertical ? Y : 8) / H, D = (Math.min(e.start.getTime(), g.current.props.end.getTime() - F) - l.current.props.start.getTime()) * H, p = Math.floor(
78
+ Math.min(e.end.getTime(), g.current.props.end.getTime()) - Math.max(e.start.getTime(), l.current.props.start.getTime())
79
+ ) * H;
80
+ (ie || []).forEach((c) => {
81
+ c.current && (c.current.props.dragHint ? u.push(c.current) : c.current.props.resizeHint ? x.push(c.current) : A.push(c.current));
82
+ }), w.current = he(A, [m.current, o.current], F), d.current = e.resizeHint || e.dragHint ? 0 : Ee(a.current, w.current);
83
+ let S = 1;
84
+ e.resizeHint || e.dragHint || (S = de(a.current, w.current));
85
+ let k = 0;
86
+ const s = E;
87
+ w.current.forEach((c) => {
88
+ let I = 0;
89
+ c._order !== void 0 && c._order !== null && c._order < d.current && (I = N(c.element).top + N(c.element).height - s.top - v * d.current + _e), I > k && (k = I);
93
90
  });
94
91
  const ve = 20;
95
- o.width = e.vertical ? o.width / u - w - ve / u : p - w, e.vertical ? o.height = p - w : (e.resizeHint || e.dragHint) && u <= 1 || (o.height = (L = (G = e.style) == null ? void 0 : G.height) != null ? L : Y), o.left = e.vertical ? o.left + ((W = f.current) != null ? W : 0) + w * (($ = f.current) != null ? $ : 0) * o.width : o.left + (_ < 0 ? 0 : _), o.top = e.vertical ? o.top + (_ < 0 ? 0 : _) : o.top + H + w * ((q = f.current) != null ? q : 0), O.current = u, Ee(c, o), se(!0), C(!0);
92
+ s.width = e.vertical ? s.width / S - v - ve / S : p - v, e.vertical ? s.height = p - v : (e.resizeHint || e.dragHint) && S <= 1 || (s.height = (L = (G = e.style) == null ? void 0 : G.height) != null ? L : Y), s.left = e.vertical ? s.left + ((W = d.current) != null ? W : 0) + v * (($ = d.current) != null ? $ : 0) * s.width : s.left + (D < 0 ? 0 : D), s.top = e.vertical ? s.top + (D < 0 ? 0 : D) : s.top + k + v * ((q = d.current) != null ? q : 0), O.current = S, Se(i, s), le(!0), C(!0);
96
93
  }, V = t.useCallback(
97
- (i) => {
98
- const n = i && i[0], c = b.current;
99
- M.current !== void 0 && window.cancelAnimationFrame(M.current), c && n && (c.width !== n.contentRect.width || c.height !== n.contentRect.height) && (M.current = window.requestAnimationFrame(() => {
100
- z();
101
- })), b.current = { width: n.contentRect.width, height: n.contentRect.height };
94
+ (n) => {
95
+ const r = n && n[0], i = b.current;
96
+ z.current !== void 0 && window.cancelAnimationFrame(z.current), i && r && (i.width !== r.contentRect.width || i.height !== r.contentRect.height) && (z.current = window.requestAnimationFrame(() => {
97
+ _();
98
+ })), b.current = { width: r.contentRect.width, height: r.contentRect.height };
102
99
  },
103
- [z]
100
+ [_]
104
101
  );
105
- t.useEffect(z);
102
+ t.useEffect(_);
106
103
  const ge = a.current && a.current.element ? a.current.element.closest(".k-scheduler-layout") : null;
107
- return Me({
104
+ return ze({
108
105
  element: ge,
109
106
  selector: ".k-resource-row",
110
107
  horizontalAttribute: "data-depth-index",
@@ -112,53 +109,53 @@ const ze = 1, Y = 12, Ae = t.forwardRef(
112
109
  applyTo: ".k-resource-cell",
113
110
  syncHeight: e.isLast
114
111
  }), t.useEffect(() => {
115
- if (!R.current)
112
+ if (!T.current)
116
113
  return;
117
- const i = window.ResizeObserver, n = i && new i(V);
118
- return n && n.observe(R.current), () => {
119
- n && n.disconnect();
114
+ const n = window.ResizeObserver, r = n && new n(V);
115
+ return r && r.observe(T.current), () => {
116
+ r && r.disconnect();
120
117
  };
121
- }, [V, R]), /* @__PURE__ */ t.createElement(
122
- ie,
118
+ }, [V, T]), /* @__PURE__ */ t.createElement(
119
+ ce,
123
120
  {
124
121
  ...ne,
125
122
  _ref: a,
126
- _order: f,
123
+ _order: d,
127
124
  _maxSiblingsPerSlot: O,
128
- _siblings: h,
125
+ _siblings: w,
129
126
  itemRef: a,
130
127
  style: {
131
- visibility: le ? void 0 : "hidden",
128
+ visibility: se ? void 0 : "hidden",
132
129
  display: oe ? void 0 : "none",
133
130
  ...e.style
134
131
  }
135
132
  },
136
133
  !e.resizeHint && /* @__PURE__ */ t.createElement(t.Fragment, null, e.tail && !e.vertical && /* @__PURE__ */ t.createElement("span", { className: "k-event-continuation" }, /* @__PURE__ */ t.createElement(
137
- v,
134
+ f,
138
135
  {
139
- name: T === "rtl" ? "chevron-right" : "chevron-left",
140
- icon: T === "rtl" ? j : J
136
+ name: y === "rtl" ? "chevron-right" : "chevron-left",
137
+ icon: y === "rtl" ? j : J
141
138
  }
142
- )), /* @__PURE__ */ t.createElement("div", { title: me }, e.tail && e.vertical && /* @__PURE__ */ t.createElement("span", { className: "k-event-continuation" }, /* @__PURE__ */ t.createElement(v, { name: "chevron-up", icon: Re })), /* @__PURE__ */ t.createElement(U, { className: "k-event-title" }, e.title), !e.isAllDay && /* @__PURE__ */ t.createElement(U, { className: "k-event-time" }, g === "recurring" && /* @__PURE__ */ t.createElement("span", { className: "k-event-recurrence-icon" }, /* @__PURE__ */ t.createElement(v, { name: "arrow-rotate-cw", icon: Q })), g === "non-recurring" && /* @__PURE__ */ t.createElement("span", { className: "k-event-recurrence-icon" }, /* @__PURE__ */ t.createElement(v, { name: "arrows-no-repeat", icon: X })), ue), e.head && e.vertical && /* @__PURE__ */ t.createElement("span", { className: "k-event-continuation" }, /* @__PURE__ */ t.createElement(v, { name: "chevron-down", icon: Te }))), g && /* @__PURE__ */ t.createElement("span", { className: "k-event-recurrence-icon" }, /* @__PURE__ */ t.createElement(
143
- v,
139
+ )), /* @__PURE__ */ t.createElement("div", { title: ue }, e.tail && e.vertical && /* @__PURE__ */ t.createElement("span", { className: "k-event-continuation" }, /* @__PURE__ */ t.createElement(f, { name: "chevron-up", icon: Te })), /* @__PURE__ */ t.createElement(U, { className: "k-event-title" }, e.title), !e.isAllDay && /* @__PURE__ */ t.createElement(U, { className: "k-event-time" }, h === "recurring" && /* @__PURE__ */ t.createElement("span", { className: "k-event-recurrence-icon" }, /* @__PURE__ */ t.createElement(f, { name: "arrow-rotate-cw", icon: Q })), h === "non-recurring" && /* @__PURE__ */ t.createElement("span", { className: "k-event-recurrence-icon" }, /* @__PURE__ */ t.createElement(f, { name: "arrows-no-repeat", icon: X })), me), e.head && e.vertical && /* @__PURE__ */ t.createElement("span", { className: "k-event-continuation" }, /* @__PURE__ */ t.createElement(f, { name: "chevron-down", icon: ye }))), h && /* @__PURE__ */ t.createElement("span", { className: "k-event-recurrence-icon" }, /* @__PURE__ */ t.createElement(
140
+ f,
144
141
  {
145
- name: g === "recurring" ? "arrow-rotate-cw" : "arrows-no-repeat",
146
- icon: g === "recurring" ? Q : X
142
+ name: h === "recurring" ? "arrow-rotate-cw" : "arrows-no-repeat",
143
+ icon: h === "recurring" ? Q : X
147
144
  }
148
145
  )), e.head && !e.vertical && /* @__PURE__ */ t.createElement("span", { className: "k-event-continuation" }, /* @__PURE__ */ t.createElement(
149
- v,
146
+ f,
150
147
  {
151
- name: T === "rtl" ? "chevron-left" : "chevron-right",
152
- icon: T === "rtl" ? J : j
148
+ name: y === "rtl" ? "chevron-left" : "chevron-right",
149
+ icon: y === "rtl" ? J : j
153
150
  }
154
151
  )))
155
152
  );
156
153
  }
157
- ), Pe = {
158
- item: Se
154
+ ), He = {
155
+ item: we
159
156
  };
160
157
  Ae.displayName = "KendoReactSchedulerProportionalViewItem";
161
158
  export {
162
159
  Ae as SchedulerProportionalViewItem,
163
- Pe as schedulerProportionalViewItemDefaultProps
160
+ He as schedulerProportionalViewItemDefaultProps
164
161
  };
@@ -13,6 +13,8 @@ import * as React from 'react';
13
13
  export interface SchedulerViewItemProps extends SchedulerItemProps {
14
14
  /** @hidden */
15
15
  ignoreIsAllDay?: boolean;
16
+ /** @hidden */
17
+ slotHeaderOffset?: number;
16
18
  /**
17
19
  * Overrides the default component responsible for visualizing a single item.
18
20
  *
@@ -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 Re=require("react"),Se=require("./SchedulerItem.js"),O=require("../utils/index.js"),U=require("../views/common/utils.js"),q=require("../constants/index.js"),ye=require("@progress/kendo-react-intl"),te=require("./SchedulerItemContent.js"),H=require("@progress/kendo-react-common"),R=require("@progress/kendo-svg-icons"),Ee=require("../hooks/useEditable.js"),ne=require("../context/SchedulerViewContext.js"),De=require("../context/SchedulerContext.js"),be=require("../hooks/useRowSync.js");function He(e){const F=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const N in e)if(N!=="default"){const P=Object.getOwnPropertyDescriptor(e,N);Object.defineProperty(F,N,P.get?P:{enumerable:!0,get:()=>e[N]})}}return F.default=e,Object.freeze(F)}const t=He(Re),j=1,K=25,re=t.forwardRef((e,F)=>{const{item:N,_ref:P,itemRef:ce,...oe}=e,L=t.useRef(void 0),E=t.useRef(void 0),f=t.useRef(null),J=t.useRef(null),Q=t.useRef(null),le=Ee.useEditable(e.editable);t.useImperativeHandle(J,()=>({props:e,element:f.current&&f.current.element})),t.useImperativeHandle(F,()=>J.current),t.useImperativeHandle(P,()=>f.current),t.useImperativeHandle(ce,()=>f.current);const ae=N||ie.item,M=ye.useInternationalization(),[se]=ne.useSchedulerViewItemsContext(),[ue]=ne.useSchedulerViewSlotsContext(),W=De.useSchedulerElementContext(),[de,Y]=t.useState(!0),[me,fe]=t.useState(!1),h=t.useRef(e.order),X=t.useRef(0),C=H.useDir(W),he=t.useMemo(()=>{var n,r;return e.isAllDay?(n=e.title)!=null?n:"":`(${M.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd)}): ${(r=e.title)!=null?r:""}`},[M,e.isAllDay,e.title,e.zonedEnd,e.zonedStart]);let A;e.isRecurring&&!e.isException?A="recurring":!e.isRecurring&&e.isException&&(A="non-recurring");const ge=t.useMemo(()=>M.format("{0:t} – {1:t}",e.zonedStart,e.zonedEnd),[M,e.zonedStart,e.zonedEnd]),Z=(n,r)=>{let s=1;return n.forEach(c=>{const u=r.filter(x=>$(c.current.props,x.props));u.length>s&&(s=u.length)}),s},ve=(n,r)=>n.map(c=>r.filter(u=>$(c.current.props,u.props))),we=(n,r,s,c=!1)=>{var B;const u=r.filter(i=>i.props.order!==null&&i.props.order!==void 0).map(i=>{let l=i.props.start,d=i.props.end;if(i.props.isAllDay||c){l=new Date(l.getFullYear(),l.getMonth(),l.getDate());const y=new Date(d.getFullYear(),d.getMonth(),d.getDate());d=y.getTime()<=l.getTime()?new Date(l.getFullYear(),l.getMonth(),l.getDate()+1):y}return{order:i.props.order,start:l,end:d}}),x=Array.from(new Set(u.map(i=>i.order))).sort((i,l)=>i-l),S=new Map;for(const i of u)S.has(i.order)||S.set(i.order,[]),S.get(i.order).push({start:i.start,end:i.end});const z=[],v=new Map;for(const i of x){const l=S.get(i);let d=-1,y=0;v.forEach((w,T)=>{if(T>=i)return;const D=S.get(T);if(!D)return;l.some(o=>D.some(g=>O.intersects(g.start,g.end,o.start,o.end,s)))&&w+1>y&&(y=w+1)});for(let w=y;w<z.length;w++)if(l.every(D=>z[w].every(_=>!O.intersects(_.start,_.end,D.start,D.end,s)))){d=w;break}d===-1&&(d=z.length,z.push([])),z[d].push(...l),v.set(i,d)}return(B=v.get(n))!=null?B:n},$=(n,r)=>O.intersects(n.start,n.end,r.start,r.end)&&n.group.index===r.group.index&&n.range.index===r.range.index&&(n.range.isAllDay===void 0||r.range.isAllDay===void 0||n.range.isAllDay===r.range.isAllDay)&&(e.ignoreIsAllDay||n.isAllDay===r.isAllDay),V=()=>{var y,w,T,D,_;const n=(ue||[]).filter(o=>o.current&&$(o.current.props,e)),r=f.current&&f.current.element,s=O.first(n);if(n.length===0){Y(!1);return}if(!s.current||!r)return;const c=U.getRect(s.current.element),u=[],x=[],S=[];(se||[]).forEach(o=>{o.current&&(o.current.props.dragHint?x.push(o.current):o.current.props.resizeHint?S.push(o.current):u.push(o.current))});const z=e.dragHint||e.resizeHint?O.calculateOrder(f.current,e.dragHint?x:S,n,e.ignoreIsAllDay):(y=e.order)!=null?y:0;if(!e.vertical&&!(e.dragHint||e.resizeHint)&&e.order!==null&&e.order!==void 0){const g=(e.ignoreIsAllDay?u:u.filter(k=>k.props.isAllDay)).filter(k=>k.props.group.index===e.group.index),a=(w=e.style)==null?void 0:w.height,b=typeof a=="number"?a:parseFloat(a),m=a!=null&&Number.isNaN(b),I=!!e.ignoreIsAllDay,G=I?!0:!m;h.current=we(e.order,g,G,I)}else h.current=z;let v=e.dragHint||e.resizeHint?Z(n,e.dragHint?x:S):Z(n,u);const B=ve(n,u);let i=0;const l=!e.vertical&&h.current!==null;if(B.forEach(o=>{let g=0;o.forEach(a=>{if(O.intersects(a.props.start,a.props.end,e.start,e.end)&&!(e.dragHint||e.resizeHint)&&a._maxSiblingsPerSlot&&a._maxSiblingsPerSlot>v&&a.element!==r&&(v=a._maxSiblingsPerSlot),!l){const b=U.getRect(a.element);a.props.order!==null&&a.props.order!==void 0&&a.props.order<h.current&&(g=b.top+b.height-c.top-q.BORDER_WIDTH*h.current+j)}}),g>i&&(i=g)}),l){const o=(T=e.style)==null?void 0:T.height,g=typeof o=="number"?o:parseFloat(o);if(o==null)i=h.current*(K+j);else if(!Number.isNaN(g))i=h.current*(g+j);else{const a=(e.ignoreIsAllDay?u:u.filter(m=>m.props.isAllDay)).filter(m=>m.props.group.index===e.group.index&&m.element!==r&&(!e.ignoreIsAllDay||!s.current||O.intersects(m.props.start,m.props.end,s.current.props.start,s.current.props.end))),b=new Map;a.forEach(m=>{var k,ee;const I=m._order;if(I==null||I>=h.current)return;const G=((k=m.element)==null?void 0:k.offsetHeight)||K;b.set(I,Math.max((ee=b.get(I))!=null?ee:0,G))}),i=Array.from(b.values()).reduce((m,I)=>m+I+j,0)}}if(n.length===0){Y(!1);return}const d=le.add?20:0;c.width=e.vertical?c.width/v-q.BORDER_WIDTH-d/v:c.width*n.length-q.BORDER_WIDTH,e.vertical?c.height=c.height*n.length-q.BORDER_WIDTH:(e.resizeHint||e.dragHint)&&v<=1||(c.height=(_=(D=e.style)==null?void 0:D.height)!=null?_:K),c.left=e.vertical?c.left+h.current*c.width+q.BORDER_WIDTH*h.current:c.left,c.top=e.vertical?c.top:c.top+i+q.BORDER_WIDTH*h.current,X.current=v,U.setRect(r,c),fe(!0),Y(!0)},p=t.useCallback(n=>{const r=n&&n[0],s=Q.current;L.current!==void 0&&window.cancelAnimationFrame(L.current),s&&r&&(s.width!==r.contentRect.width||s.height!==r.contentRect.height)&&(L.current=window.requestAnimationFrame(()=>{V()})),Q.current={width:r.contentRect.width,height:r.contentRect.height}},[V]);t.useEffect(()=>(V(),E.current!==void 0&&window.cancelAnimationFrame(E.current),E.current=window.requestAnimationFrame(()=>{E.current=window.requestAnimationFrame(()=>{E.current=void 0,V()})}),()=>{E.current!==void 0&&(window.cancelAnimationFrame(E.current),E.current=void 0)}));const Ie=f.current&&f.current.element?f.current.element.closest(".k-scheduler-layout"):null;return be.useRowSync({element:Ie,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),t.useEffect(()=>{if(!W.current)return;const n=window.ResizeObserver,r=n&&new n(p);return r&&r.observe(W.current),()=>{r&&r.disconnect()}},[p,W]),t.createElement(ae,{...oe,_ref:f,_maxSiblingsPerSlot:X,_order:h,itemRef:f,style:{visibility:me?void 0:"hidden",display:de?void 0:"none",...e.style}},!e.resizeHint&&t.createElement(t.Fragment,null,e.tail&&!e.vertical&&t.createElement("span",{className:"k-event-continuation"},t.createElement(H.IconWrap,{name:C==="rtl"?"chevron-right":"chevron-left",icon:C==="rtl"?R.chevronRightIcon:R.chevronLeftIcon})),t.createElement("div",{title:he},e.tail&&e.vertical&&t.createElement("span",{className:"k-event-continuation"},t.createElement(H.IconWrap,{name:"chevron-up",icon:R.chevronUpIcon})),t.createElement(te.SchedulerItemContent,{className:"k-event-title"},e.title),!e.isAllDay&&t.createElement(te.SchedulerItemContent,{className:"k-event-time"},A==="recurring"&&t.createElement("span",{className:"k-event-recurrence-icon"},t.createElement(H.IconWrap,{name:"arrow-rotate-cw",icon:R.arrowRotateCwIcon})),A==="non-recurring"&&t.createElement("span",{className:"k-event-recurrence-icon"},t.createElement(H.IconWrap,{name:"arrows-no-repeat",icon:R.arrowsNoRepeatIcon})),ge),e.head&&e.vertical&&t.createElement("span",{className:"k-event-continuation"},t.createElement(H.IconWrap,{name:"chevron-down",icon:R.chevronDownIcon}))),A&&t.createElement("span",{className:"k-event-recurrence-icon"},t.createElement(H.IconWrap,{name:A==="recurring"?"arrow-rotate-cw":"arrows-no-repeat",icon:A==="recurring"?R.arrowRotateCwIcon:R.arrowsNoRepeatIcon})),e.head&&!e.vertical&&t.createElement("span",{className:"k-event-continuation"},t.createElement(H.IconWrap,{name:C==="rtl"?"chevron-left":"chevron-right",icon:C==="rtl"?R.chevronLeftIcon:R.chevronRightIcon}))))}),ie={item:Se.SchedulerItem};re.displayName="KendoReactSchedulerViewItem";exports.SchedulerViewItem=re;exports.schedulerViewItemDefaultProps=ie;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ye=require("react"),Ee=require("./SchedulerItem.js"),q=require("../utils/index.js"),K=require("../views/common/utils.js"),F=require("../constants/index.js"),De=require("@progress/kendo-react-intl"),ne=require("./SchedulerItemContent.js"),H=require("@progress/kendo-react-common"),w=require("@progress/kendo-svg-icons"),Se=require("../hooks/useEditable.js"),re=require("../context/SchedulerViewContext.js"),be=require("../context/SchedulerContext.js"),He=require("../hooks/useRowSync.js");function Ae(e){const _=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const x in e)if(x!=="default"){const W=Object.getOwnPropertyDescriptor(e,x);Object.defineProperty(_,x,W.get?W:{enumerable:!0,get:()=>e[x]})}}return _.default=e,Object.freeze(_)}const t=Ae(ye),L=1,J=25,ie=t.forwardRef((e,_)=>{const{item:x,_ref:W,itemRef:oe,...ae}=e,Y=t.useRef(void 0),R=t.useRef(void 0),m=t.useRef(null),Q=t.useRef(null),X=t.useRef(null),le=Se.useEditable(e.editable);t.useImperativeHandle(Q,()=>({props:e,element:m.current&&m.current.element})),t.useImperativeHandle(_,()=>Q.current),t.useImperativeHandle(W,()=>m.current),t.useImperativeHandle(oe,()=>m.current);const se=x||ce.item,P=De.useInternationalization(),[ue]=re.useSchedulerViewItemsContext(),[de]=re.useSchedulerViewSlotsContext(),C=be.useSchedulerElementContext(),[me,$]=t.useState(!0),[fe,he]=t.useState(!1),f=t.useRef(e.order),Z=t.useRef(0),V=H.useDir(C),ge=t.useMemo(()=>{var n,r;return e.isAllDay?(n=e.title)!=null?n:"":`(${P.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd)}): ${(r=e.title)!=null?r:""}`},[P,e.isAllDay,e.title,e.zonedEnd,e.zonedStart]);let A;e.isRecurring&&!e.isException?A="recurring":!e.isRecurring&&e.isException&&(A="non-recurring");const ve=t.useMemo(()=>P.format("{0:t} – {1:t}",e.zonedStart,e.zonedEnd),[P,e.zonedStart,e.zonedEnd]),p=(n,r)=>{let l=1;return n.forEach(c=>{const s=r.filter(z=>G(c.current.props,z.props));s.length>l&&(l=s.length)}),l},we=(n,r)=>n.map(c=>r.filter(s=>G(c.current.props,s.props))),Ie=(n,r,l,c=!1)=>{var j;const s=r.filter(i=>i.props.order!==null&&i.props.order!==void 0).map(i=>{let a=i.props.start,u=i.props.end;if(i.props.isAllDay||c){a=new Date(a.getFullYear(),a.getMonth(),a.getDate());const E=new Date(u.getFullYear(),u.getMonth(),u.getDate());u=E.getTime()<=a.getTime()?new Date(a.getFullYear(),a.getMonth(),a.getDate()+1):E}return{order:i.props.order,start:a,end:u}}),z=Array.from(new Set(s.map(i=>i.order))).sort((i,a)=>i-a),I=new Map;for(const i of s)I.has(i.order)||I.set(i.order,[]),I.get(i.order).push({start:i.start,end:i.end});const O=[],y=new Map;for(const i of z){const a=I.get(i);let u=-1,E=0;y.forEach((g,N)=>{if(N>=i)return;const D=I.get(N);if(!D)return;a.some(M=>D.some(o=>q.intersects(o.start,o.end,M.start,M.end,l)))&&g+1>E&&(E=g+1)});for(let g=E;g<O.length;g++)if(a.every(D=>O[g].every(T=>!q.intersects(T.start,T.end,D.start,D.end,l)))){u=g;break}u===-1&&(u=O.length,O.push([])),O[u].push(...a),y.set(i,u)}return(j=y.get(n))!=null?j:n},G=(n,r)=>q.intersects(n.start,n.end,r.start,r.end)&&n.group.index===r.group.index&&n.range.index===r.range.index&&(n.range.isAllDay===void 0||r.range.isAllDay===void 0||n.range.isAllDay===r.range.isAllDay)&&(e.ignoreIsAllDay||n.isAllDay===r.isAllDay),B=()=>{var g,N,D,T,M;const n=(de||[]).filter(o=>o.current&&G(o.current.props,e)),r=m.current&&m.current.element,l=q.first(n);if(n.length===0){$(!1);return}if(!l.current||!r)return;const c=K.getRect(l.current.element),s=[],z=[],I=[];(ue||[]).forEach(o=>{o.current&&(o.current.props.dragHint?z.push(o.current):o.current.props.resizeHint?I.push(o.current):s.push(o.current))});const O=e.dragHint||e.resizeHint?q.calculateOrder(m.current,e.dragHint?z:I,n,e.ignoreIsAllDay):(g=e.order)!=null?g:0;if(!e.vertical&&!(e.dragHint||e.resizeHint)&&e.order!==null&&e.order!==void 0){const S=(e.ignoreIsAllDay?s:s.filter(k=>k.props.isAllDay)).filter(k=>k.props.group.index===e.group.index),h=(N=e.style)==null?void 0:N.height,b=typeof h=="number"?h:parseFloat(h),d=h!=null&&Number.isNaN(b),v=!!e.ignoreIsAllDay,U=v?!0:!d;f.current=Ie(e.order,S,U,v)}else f.current=O;let y=e.dragHint||e.resizeHint?p(n,e.dragHint?z:I):p(n,s);const j=we(n,s);let i=0;const a=!e.vertical&&f.current!==null;if(j.forEach(o=>{let S=0;o.forEach(h=>{if(!a){const b=K.getRect(h.element);h.props.order!==null&&h.props.order!==void 0&&h.props.order<f.current&&(S=b.top+b.height-c.top-F.BORDER_WIDTH*f.current+L)}}),S>i&&(i=S)}),a){const o=(D=e.style)==null?void 0:D.height,S=typeof o=="number"?o:parseFloat(o);if(o==null)i=f.current*(J+L);else if(!Number.isNaN(S))i=f.current*(S+L);else{const h=(e.ignoreIsAllDay?s:s.filter(d=>d.props.isAllDay)).filter(d=>d.props.group.index===e.group.index&&d.element!==r&&(!e.ignoreIsAllDay||!l.current||q.intersects(d.props.start,d.props.end,l.current.props.start,l.current.props.end))),b=new Map;h.forEach(d=>{var k,te;const v=d._order;if(v==null||v>=f.current)return;const U=((k=d.element)==null?void 0:k.offsetHeight)||J;b.set(v,Math.max((te=b.get(v))!=null?te:0,U))}),i=Array.from(b.values()).reduce((d,v)=>d+v+L,0)}}if(n.length===0){$(!1);return}const u=le.add?20:0;c.width=e.vertical?c.width/y-F.BORDER_WIDTH-u/y:c.width*n.length-F.BORDER_WIDTH,e.vertical?c.height=c.height*n.length-F.BORDER_WIDTH:(e.resizeHint||e.dragHint)&&y<=1||(c.height=(M=(T=e.style)==null?void 0:T.height)!=null?M:J),c.left=e.vertical?c.left+f.current*c.width+F.BORDER_WIDTH*f.current:c.left;const E=!e.vertical&&e.slotHeaderOffset||0;c.top=e.vertical?c.top:c.top+i+F.BORDER_WIDTH*f.current+E,Z.current=y,K.setRect(r,c),he(!0),$(!0)},ee=t.useCallback(n=>{const r=n&&n[0],l=X.current;Y.current!==void 0&&window.cancelAnimationFrame(Y.current),l&&r&&(l.width!==r.contentRect.width||l.height!==r.contentRect.height)&&(Y.current=window.requestAnimationFrame(()=>{B()})),X.current={width:r.contentRect.width,height:r.contentRect.height}},[B]);t.useEffect(()=>(B(),R.current!==void 0&&window.cancelAnimationFrame(R.current),R.current=window.requestAnimationFrame(()=>{R.current=window.requestAnimationFrame(()=>{R.current=void 0,B()})}),()=>{R.current!==void 0&&(window.cancelAnimationFrame(R.current),R.current=void 0)}));const Re=m.current&&m.current.element?m.current.element.closest(".k-scheduler-layout"):null;return He.useRowSync({element:Re,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),t.useEffect(()=>{if(!C.current)return;const n=window.ResizeObserver,r=n&&new n(ee);return r&&r.observe(C.current),()=>{r&&r.disconnect()}},[ee,C]),t.createElement(se,{...ae,_ref:m,_maxSiblingsPerSlot:Z,_order:f,itemRef:m,style:{visibility:fe?void 0:"hidden",display:me?void 0:"none",...e.style}},!e.resizeHint&&t.createElement(t.Fragment,null,e.tail&&!e.vertical&&t.createElement("span",{className:"k-event-continuation"},t.createElement(H.IconWrap,{name:V==="rtl"?"chevron-right":"chevron-left",icon:V==="rtl"?w.chevronRightIcon:w.chevronLeftIcon})),t.createElement("div",{title:ge},e.tail&&e.vertical&&t.createElement("span",{className:"k-event-continuation"},t.createElement(H.IconWrap,{name:"chevron-up",icon:w.chevronUpIcon})),t.createElement(ne.SchedulerItemContent,{className:"k-event-title"},e.title),!e.isAllDay&&t.createElement(ne.SchedulerItemContent,{className:"k-event-time"},A==="recurring"&&t.createElement("span",{className:"k-event-recurrence-icon"},t.createElement(H.IconWrap,{name:"arrow-rotate-cw",icon:w.arrowRotateCwIcon})),A==="non-recurring"&&t.createElement("span",{className:"k-event-recurrence-icon"},t.createElement(H.IconWrap,{name:"arrows-no-repeat",icon:w.arrowsNoRepeatIcon})),ve),e.head&&e.vertical&&t.createElement("span",{className:"k-event-continuation"},t.createElement(H.IconWrap,{name:"chevron-down",icon:w.chevronDownIcon}))),A&&t.createElement("span",{className:"k-event-recurrence-icon"},t.createElement(H.IconWrap,{name:A==="recurring"?"arrow-rotate-cw":"arrows-no-repeat",icon:A==="recurring"?w.arrowRotateCwIcon:w.arrowsNoRepeatIcon})),e.head&&!e.vertical&&t.createElement("span",{className:"k-event-continuation"},t.createElement(H.IconWrap,{name:V==="rtl"?"chevron-left":"chevron-right",icon:V==="rtl"?w.chevronLeftIcon:w.chevronRightIcon}))))}),ce={item:Ee.SchedulerItem};ie.displayName="KendoReactSchedulerViewItem";exports.SchedulerViewItem=ie;exports.schedulerViewItemDefaultProps=ce;