@progress/kendo-react-scheduler 16.0.1-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.
- package/Scheduler.js +1 -1
- package/Scheduler.mjs +239 -228
- package/components/BaseView.d.ts +1 -0
- package/components/BaseView.js +1 -1
- package/components/BaseView.mjs +7 -7
- package/components/CurrentTimeMarket.js +1 -1
- package/components/CurrentTimeMarket.mjs +26 -26
- package/components/DateHeaderCell.js +1 -1
- package/components/DateHeaderCell.mjs +5 -5
- package/components/MoreEventsPopover.js +1 -1
- package/components/MoreEventsPopover.mjs +45 -29
- package/constants/index.d.ts +2 -0
- package/constants/index.js +1 -1
- package/constants/index.mjs +15 -13
- package/dist/cdn/js/kendo-react-scheduler.js +1 -1
- package/editors/SchedulerRecurrenceDialog.js +1 -1
- package/editors/SchedulerRecurrenceDialog.mjs +191 -188
- package/hooks/index.d.ts +2 -2
- package/hooks/usePropOrState.d.ts +2 -1
- package/hooks/usePropOrState.js +8 -0
- package/hooks/usePropOrState.mjs +16 -0
- package/hooks/useSlotExpand.js +1 -1
- package/hooks/useSlotExpand.mjs +22 -22
- package/hooks/useWorkHours.d.ts +1 -1
- package/hooks/useWorkHours.js +8 -0
- package/hooks/useWorkHours.mjs +18 -0
- package/items/SchedulerProportionalViewItem.js +1 -1
- package/items/SchedulerProportionalViewItem.mjs +94 -97
- package/items/SchedulerViewItem.d.ts +2 -0
- package/items/SchedulerViewItem.js +1 -1
- package/items/SchedulerViewItem.mjs +152 -150
- package/models/Group.d.ts +2 -0
- package/models/SchedulerView.d.ts +4 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +12 -12
- package/services/itemsService.js +1 -1
- package/services/itemsService.mjs +34 -34
- package/services/occurrenceService.js +1 -1
- package/services/occurrenceService.mjs +40 -34
- package/slots/SchedulerSlot.d.ts +2 -0
- package/slots/SchedulerSlot.js +1 -1
- package/slots/SchedulerSlot.mjs +1 -0
- package/tasks/SchedulerTask.js +1 -1
- package/tasks/SchedulerTask.mjs +12 -12
- package/utils/index.js +1 -1
- package/utils/index.mjs +14 -14
- package/views/agenda/AgendaView.js +1 -1
- package/views/agenda/AgendaView.mjs +48 -24
- package/views/common/VerticalResourceIterator.d.ts +1 -0
- package/views/common/VerticalResourceIterator.js +1 -1
- package/views/common/VerticalResourceIterator.mjs +29 -29
- package/views/day/MultiDayView.js +1 -1
- package/views/day/MultiDayView.mjs +108 -104
- package/views/month/MonthView.js +1 -1
- package/views/month/MonthView.mjs +67 -67
- package/views/time/MultiDayTimelineView.js +1 -1
- package/views/time/MultiDayTimelineView.mjs +101 -96
- package/components/footer/bussiness-hours/BussinessHours.d.ts +0 -20
- package/components/footer/bussiness-hours/BussinessHours.js +0 -8
- 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
|
+
};
|
package/hooks/useSlotExpand.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use 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)},
|
|
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;
|
package/hooks/useSlotExpand.mjs
CHANGED
|
@@ -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 = (
|
|
13
|
+
const j = (t, o) => {
|
|
14
14
|
const l = f.useRef(void 0), b = f.useRef(0), g = M(), B = () => {
|
|
15
|
-
if (!
|
|
15
|
+
if (!t.current)
|
|
16
16
|
return;
|
|
17
|
-
const n =
|
|
17
|
+
const n = t.current.element;
|
|
18
18
|
n && (b.current = n.clientHeight);
|
|
19
19
|
}, p = f.useCallback(() => {
|
|
20
|
-
if (!o || !
|
|
20
|
+
if (!o || !t.current)
|
|
21
21
|
return;
|
|
22
|
-
const n =
|
|
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((
|
|
28
|
-
s.forEach((
|
|
27
|
+
const s = v.items.filter((r) => r._ref.current);
|
|
28
|
+
s.forEach((r) => {
|
|
29
29
|
var _, x, R, H, E;
|
|
30
|
-
if (!
|
|
30
|
+
if (!r._ref.current)
|
|
31
31
|
return;
|
|
32
|
-
const { height: u } = C(
|
|
33
|
-
(H =
|
|
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
|
|
41
|
-
w =
|
|
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 <=
|
|
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
|
|
51
|
-
if (
|
|
52
|
-
const u = parseFloat(window.getComputedStyle(
|
|
53
|
-
h =
|
|
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,
|
|
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, [
|
|
64
|
-
if (!
|
|
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 =
|
|
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,
|
|
79
|
+
}, [d, g, t, t.current && t.current.props]);
|
|
80
80
|
};
|
|
81
81
|
export {
|
|
82
82
|
j as useSlotExpand
|
package/hooks/useWorkHours.d.ts
CHANGED
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
/** @hidden */
|
|
9
|
-
export declare const useWorkHours: (showWorkHours?: boolean, defaultShowWorkHours?: boolean) =>
|
|
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"),
|
|
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
|
|
10
|
-
import { intersects as
|
|
11
|
-
import { getRect as
|
|
12
|
-
import { BORDER_WIDTH as
|
|
13
|
-
import { useInternationalization as
|
|
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
|
|
16
|
-
import { chevronRightIcon as j, chevronLeftIcon as J, chevronUpIcon as
|
|
17
|
-
import { useSchedulerViewItemsContext as
|
|
18
|
-
import { useSchedulerElementContext as
|
|
19
|
-
import { useRowSync as
|
|
20
|
-
const
|
|
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,
|
|
23
|
-
t.useImperativeHandle(
|
|
24
|
-
const
|
|
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
|
|
27
|
-
return e.isAllDay ? (
|
|
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
|
-
[
|
|
29
|
+
[R, e.isAllDay, e.title, e.zonedEnd, e.zonedStart]
|
|
30
30
|
);
|
|
31
|
-
let
|
|
32
|
-
e.isRecurring && !e.isException ?
|
|
33
|
-
const
|
|
34
|
-
() =>
|
|
35
|
-
[
|
|
36
|
-
), de = (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
45
|
-
Math.max(e.start.getTime(),
|
|
45
|
+
o.props.end.getTime() - i,
|
|
46
|
+
Math.max(e.start.getTime(), m.props.start.getTime())
|
|
46
47
|
)
|
|
47
|
-
),
|
|
48
|
-
Math.max(
|
|
48
|
+
), g = new Date(
|
|
49
|
+
Math.max(l.getTime() + i, Math.min(e.end.getTime(), o.props.end.getTime()))
|
|
49
50
|
);
|
|
50
|
-
return
|
|
51
|
-
const
|
|
52
|
-
Math.min(
|
|
53
|
-
|
|
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(
|
|
56
|
-
|
|
56
|
+
Math.max(x + i, u.props.end.getTime()),
|
|
57
|
+
o.props.end.getTime()
|
|
57
58
|
);
|
|
58
|
-
return
|
|
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
|
-
},
|
|
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
|
-
(
|
|
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
|
|
65
|
-
(
|
|
66
|
-
),
|
|
67
|
-
if (!
|
|
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
|
|
70
|
-
if (!
|
|
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 (!
|
|
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 = [],
|
|
77
|
-
Math.min(e.end.getTime(),
|
|
78
|
-
) *
|
|
79
|
-
(
|
|
80
|
-
|
|
81
|
-
}),
|
|
82
|
-
let
|
|
83
|
-
e.resizeHint || e.dragHint || (
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
-
|
|
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
|
-
(
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
})), b.current = { width:
|
|
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
|
-
[
|
|
100
|
+
[_]
|
|
104
101
|
);
|
|
105
|
-
t.useEffect(
|
|
102
|
+
t.useEffect(_);
|
|
106
103
|
const ge = a.current && a.current.element ? a.current.element.closest(".k-scheduler-layout") : null;
|
|
107
|
-
return
|
|
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 (!
|
|
112
|
+
if (!T.current)
|
|
116
113
|
return;
|
|
117
|
-
const
|
|
118
|
-
return
|
|
119
|
-
|
|
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,
|
|
122
|
-
|
|
118
|
+
}, [V, T]), /* @__PURE__ */ t.createElement(
|
|
119
|
+
ce,
|
|
123
120
|
{
|
|
124
121
|
...ne,
|
|
125
122
|
_ref: a,
|
|
126
|
-
_order:
|
|
123
|
+
_order: d,
|
|
127
124
|
_maxSiblingsPerSlot: O,
|
|
128
|
-
_siblings:
|
|
125
|
+
_siblings: w,
|
|
129
126
|
itemRef: a,
|
|
130
127
|
style: {
|
|
131
|
-
visibility:
|
|
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
|
-
|
|
134
|
+
f,
|
|
138
135
|
{
|
|
139
|
-
name:
|
|
140
|
-
icon:
|
|
136
|
+
name: y === "rtl" ? "chevron-right" : "chevron-left",
|
|
137
|
+
icon: y === "rtl" ? j : J
|
|
141
138
|
}
|
|
142
|
-
)), /* @__PURE__ */ t.createElement("div", { title:
|
|
143
|
-
|
|
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:
|
|
146
|
-
icon:
|
|
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
|
-
|
|
146
|
+
f,
|
|
150
147
|
{
|
|
151
|
-
name:
|
|
152
|
-
icon:
|
|
148
|
+
name: y === "rtl" ? "chevron-left" : "chevron-right",
|
|
149
|
+
icon: y === "rtl" ? J : j
|
|
153
150
|
}
|
|
154
151
|
)))
|
|
155
152
|
);
|
|
156
153
|
}
|
|
157
|
-
),
|
|
158
|
-
item:
|
|
154
|
+
), He = {
|
|
155
|
+
item: we
|
|
159
156
|
};
|
|
160
157
|
Ae.displayName = "KendoReactSchedulerProportionalViewItem";
|
|
161
158
|
export {
|
|
162
159
|
Ae as SchedulerProportionalViewItem,
|
|
163
|
-
|
|
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
|
|
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;
|