@progress/kendo-react-scheduler 15.1.0-develop.8 → 15.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const he=require("react"),ge=require("./SchedulerItem.js"),A=require("../utils/index.js"),V=require("../views/common/utils.js"),x=require("../constants/index.js"),Ie=require("@progress/kendo-react-intl"),Q=require("./SchedulerItemContent.js"),q=require("@progress/kendo-react-common"),M=require("@progress/kendo-svg-icons"),Re=require("../hooks/useEditable.js"),X=require("../context/SchedulerViewContext.js"),we=require("../context/SchedulerContext.js"),ve=require("../hooks/useRowSync.js");function Se(e){const O=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const D in e)if(D!=="default"){const _=Object.getOwnPropertyDescriptor(e,D);Object.defineProperty(O,D,_.get?_:{enumerable:!0,get:()=>e[D]})}}return O.default=e,Object.freeze(O)}const i=Se(he),B=1,Z=25,p=i.forwardRef((e,O)=>{const{item:D,_ref:_,itemRef:te,...ne}=e,C=i.useRef(void 0),m=i.useRef(null),N=i.useRef(null),j=i.useRef(null),re=Re.useEditable(e.editable);i.useImperativeHandle(N,()=>({props:e,element:m.current&&m.current.element})),i.useImperativeHandle(O,()=>N.current),i.useImperativeHandle(_,()=>m.current),i.useImperativeHandle(te,()=>m.current);const ie=D||ee.item,L=Ie.useInternationalization(),[se]=X.useSchedulerViewItemsContext(),[le]=X.useSchedulerViewSlotsContext(),T=we.useSchedulerElementContext(),[oe,k]=i.useState(!0),[ce,ae]=i.useState(!1),f=i.useRef(e.order),Y=i.useRef(0),$=q.useDir(T),G=i.useMemo(()=>{var t,n;return e.isAllDay?(t=e.title)!=null?t:"":`(${L.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd)}): ${(n=e.title)!=null?n:""}`},[L,e.isAllDay,e.title,e.zonedEnd,e.zonedStart]),K=(t,n)=>{let d=1;return t.forEach(s=>{const o=n.filter(h=>F(s.current.props,h.props));o.length>d&&(d=o.length)}),d},ue=(t,n)=>t.map(s=>n.filter(o=>F(s.current.props,o.props))),de=(t,n)=>{var P;const d=n.filter(r=>r.props.order!==null&&r.props.order!==void 0).map(r=>{let c=r.props.start,a=r.props.end;if(r.props.isAllDay){c=new Date(c.getFullYear(),c.getMonth(),c.getDate());const I=new Date(a.getFullYear(),a.getMonth(),a.getDate());a=I.getTime()<=c.getTime()?new Date(c.getFullYear(),c.getMonth(),c.getDate()+1):I}return{order:r.props.order,start:c,end:a}}),s=Array.from(new Set(d.map(r=>r.order))).sort((r,c)=>r-c),o=new Map;for(const r of d)o.has(r.order)||o.set(r.order,[]),o.get(r.order).push({start:r.start,end:r.end});const h=[],S=new Map;for(const r of s){const c=o.get(r);let a=-1,I=0;S.forEach((R,E)=>{if(E>=r)return;const w=o.get(E);if(!w)return;c.some(z=>w.some(l=>A.intersects(l.start,l.end,z.start,z.end)))&&R+1>I&&(I=R+1)});for(let R=I;R<h.length;R++)if(c.every(w=>h[R].every(b=>!A.intersects(b.start,b.end,w.start,w.end)))){a=R;break}a===-1&&(a=h.length,h.push([])),h[a].push(...c),S.set(r,a)}return(P=S.get(t))!=null?P:t},F=(t,n)=>A.intersects(t.start,t.end,n.start,n.end)&&t.group.index===n.group.index&&t.range.index===n.range.index&&(t.range.isAllDay===void 0||n.range.isAllDay===void 0||t.range.isAllDay===n.range.isAllDay)&&(e.ignoreIsAllDay||t.isAllDay===n.isAllDay),W=()=>{var E,w,b,z;const t=(le||[]).filter(l=>l.current&&F(l.current.props,e)),n=m.current&&m.current.element,d=A.first(t);if(t.length===0){k(!1);return}if(!d.current||!n)return;const s=V.getRect(d.current.element),o=[],h=[],S=[];(se||[]).forEach(l=>{l.current&&(l.current.props.dragHint?h.push(l.current):l.current.props.resizeHint?S.push(l.current):o.push(l.current))});const P=e.dragHint||e.resizeHint?A.calculateOrder(m.current,e.dragHint?h:S,t,e.ignoreIsAllDay):(E=e.order)!=null?E:0;if(!e.vertical&&!(e.dragHint||e.resizeHint)&&e.order!==null&&e.order!==void 0){const v=(e.ignoreIsAllDay?o:o.filter(u=>u.props.isAllDay)).filter(u=>u.props.group.index===e.group.index);f.current=de(e.order,v)}else f.current=P;let r=e.dragHint||e.resizeHint?K(t,e.dragHint?h:S):K(t,o);const c=ue(t,o);let a=0;const I=!e.vertical&&f.current!==null;if(c.forEach(l=>{let v=0;l.forEach(u=>{if(A.intersects(u.props.start,u.props.end,e.start,e.end)&&!(e.dragHint||e.resizeHint)&&u._maxSiblingsPerSlot&&u._maxSiblingsPerSlot>r&&u.element!==n&&(r=u._maxSiblingsPerSlot),!I){const H=V.getRect(u.element);u.props.order!==null&&u.props.order!==void 0&&u.props.order<f.current&&(v=H.top+H.height-s.top-x.BORDER_WIDTH*f.current+B)}}),v>a&&(a=v)}),I){const l=(w=e.style)==null?void 0:w.height,v=typeof l=="number"?l:parseFloat(l);if(!isNaN(v))a=f.current*(v+B);else{const u=(e.ignoreIsAllDay?o:o.filter(g=>g.props.isAllDay)).filter(g=>g.props.group.index===e.group.index&&g.element!==n),H=new Map;u.forEach(g=>{var J;const y=g._order;if(y==null||y>=f.current)return;const fe=g.element&&g.element.offsetHeight||Z;H.set(y,Math.max((J=H.get(y))!=null?J:0,fe))}),a=Array.from(H.values()).reduce((g,y)=>g+y+B,0)}}if(t.length===0){k(!1);return}const R=re.add?20:0;s.width=e.vertical?s.width/r-x.BORDER_WIDTH-R/r:s.width*t.length-x.BORDER_WIDTH,e.vertical?s.height=s.height*t.length-x.BORDER_WIDTH:(e.resizeHint||e.dragHint)&&r<=1||(s.height=(z=(b=e.style)==null?void 0:b.height)!=null?z:Z),s.left=e.vertical?s.left+f.current*s.width+x.BORDER_WIDTH*f.current:s.left,s.top=e.vertical?s.top:s.top+a+x.BORDER_WIDTH*f.current,Y.current=r,V.setRect(n,s),ae(!0),k(!0)},U=i.useCallback(t=>{const n=t&&t[0],d=j.current;C.current!==void 0&&window.cancelAnimationFrame(C.current),d&&n&&(d.width!==n.contentRect.width||d.height!==n.contentRect.height)&&(C.current=window.requestAnimationFrame(()=>{W()})),j.current={width:n.contentRect.width,height:n.contentRect.height}},[W]);i.useEffect(W);const me=m.current&&m.current.element?m.current.element.closest(".k-scheduler-layout"):null;return ve.useRowSync({element:me,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),i.useEffect(()=>{if(!T.current)return;const t=window.ResizeObserver,n=t&&new t(U);return n&&n.observe(T.current),()=>{n&&n.disconnect()}},[U,T]),i.createElement(ie,{...ne,_ref:m,_maxSiblingsPerSlot:Y,_order:f,itemRef:m,style:{visibility:ce?void 0:"hidden",display:oe?void 0:"none",...e.style}},!e.resizeHint&&i.createElement("span",{className:"k-event-actions"},e.tail&&i.createElement(q.IconWrap,{name:$==="rtl"?"chevron-right":"chevron-left",icon:$==="rtl"?M.chevronRightIcon:M.chevronLeftIcon}),e.isRecurring&&!e.isException&&i.createElement(q.IconWrap,{name:"arrow-rotate-cw",icon:M.arrowRotateCwIcon}),!e.isRecurring&&e.isException&&i.createElement(q.IconWrap,{name:"arrows-no-repeat",icon:M.arrowsNoRepeatIcon})),!e.resizeHint&&i.createElement("div",{title:G},!e.isAllDay&&i.createElement(Q.SchedulerItemContent,{className:"k-event-time"},G),i.createElement(Q.SchedulerItemContent,null,e.title)))}),ee={item:ge.SchedulerItem};p.displayName="KendoReactSchedulerViewItem";exports.SchedulerViewItem=p;exports.schedulerViewItemDefaultProps=ee;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ie=require("react"),Re=require("./SchedulerItem.js"),x=require("../utils/index.js"),B=require("../views/common/utils.js"),z=require("../constants/index.js"),we=require("@progress/kendo-react-intl"),p=require("./SchedulerItemContent.js"),M=require("@progress/kendo-react-common"),C=require("@progress/kendo-svg-icons"),ve=require("../hooks/useEditable.js"),ee=require("../context/SchedulerViewContext.js"),Se=require("../context/SchedulerContext.js"),ye=require("../hooks/useRowSync.js");function De(e){const O=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const H in e)if(H!=="default"){const P=Object.getOwnPropertyDescriptor(e,H);Object.defineProperty(O,H,P.get?P:{enumerable:!0,get:()=>e[H]})}}return O.default=e,Object.freeze(O)}const r=De(Ie),F=1,j=25,te=r.forwardRef((e,O)=>{const{item:H,_ref:P,itemRef:re,...ie}=e,N=r.useRef(void 0),m=r.useRef(null),L=r.useRef(null),Y=r.useRef(null),se=ve.useEditable(e.editable);r.useImperativeHandle(L,()=>({props:e,element:m.current&&m.current.element})),r.useImperativeHandle(O,()=>L.current),r.useImperativeHandle(P,()=>m.current),r.useImperativeHandle(re,()=>m.current);const le=H||ne.item,$=we.useInternationalization(),[oe]=ee.useSchedulerViewItemsContext(),[ce]=ee.useSchedulerViewSlotsContext(),q=Se.useSchedulerElementContext(),[ae,k]=r.useState(!0),[ue,de]=r.useState(!1),f=r.useRef(e.order),G=r.useRef(0),K=M.useDir(q),U=r.useMemo(()=>{var t,n;return e.isAllDay?(t=e.title)!=null?t:"":`(${$.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd)}): ${(n=e.title)!=null?n:""}`},[$,e.isAllDay,e.title,e.zonedEnd,e.zonedStart]),J=(t,n)=>{let a=1;return t.forEach(s=>{const u=n.filter(h=>V(s.current.props,h.props));u.length>a&&(a=u.length)}),a},me=(t,n)=>t.map(s=>n.filter(u=>V(s.current.props,u.props))),fe=(t,n,a)=>{var v;const s=n.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){l=new Date(l.getFullYear(),l.getMonth(),l.getDate());const S=new Date(d.getFullYear(),d.getMonth(),d.getDate());d=S.getTime()<=l.getTime()?new Date(l.getFullYear(),l.getMonth(),l.getDate()+1):S}return{order:i.props.order,start:l,end:d}}),u=Array.from(new Set(s.map(i=>i.order))).sort((i,l)=>i-l),h=new Map;for(const i of s)h.has(i.order)||h.set(i.order,[]),h.get(i.order).push({start:i.start,end:i.end});const w=[],_=new Map;for(const i of u){const l=h.get(i);let d=-1,S=0;_.forEach((R,E)=>{if(E>=i)return;const y=h.get(E);if(!y)return;l.some(T=>y.some(o=>x.intersects(o.start,o.end,T.start,T.end,a)))&&R+1>S&&(S=R+1)});for(let R=S;R<w.length;R++)if(l.every(y=>w[R].every(A=>!x.intersects(A.start,A.end,y.start,y.end,a)))){d=R;break}d===-1&&(d=w.length,w.push([])),w[d].push(...l),_.set(i,d)}return(v=_.get(t))!=null?v:t},V=(t,n)=>x.intersects(t.start,t.end,n.start,n.end)&&t.group.index===n.group.index&&t.range.index===n.range.index&&(t.range.isAllDay===void 0||n.range.isAllDay===void 0||t.range.isAllDay===n.range.isAllDay)&&(e.ignoreIsAllDay||t.isAllDay===n.isAllDay),W=()=>{var R,E,y,A,T;const t=(ce||[]).filter(o=>o.current&&V(o.current.props,e)),n=m.current&&m.current.element,a=x.first(t);if(t.length===0){k(!1);return}if(!a.current||!n)return;const s=B.getRect(a.current.element),u=[],h=[],w=[];(oe||[]).forEach(o=>{o.current&&(o.current.props.dragHint?h.push(o.current):o.current.props.resizeHint?w.push(o.current):u.push(o.current))});const _=e.dragHint||e.resizeHint?x.calculateOrder(m.current,e.dragHint?h:w,t,e.ignoreIsAllDay):(R=e.order)!=null?R:0;if(!e.vertical&&!(e.dragHint||e.resizeHint)&&e.order!==null&&e.order!==void 0){const D=(e.ignoreIsAllDay?u:u.filter(I=>I.props.isAllDay)).filter(I=>I.props.group.index===e.group.index),c=(E=e.style)==null?void 0:E.height,b=typeof c=="number"?c:parseFloat(c),g=c!=null&&Number.isNaN(b);f.current=fe(e.order,D,!g)}else f.current=_;let v=e.dragHint||e.resizeHint?J(t,e.dragHint?h:w):J(t,u);const i=me(t,u);let l=0;const d=!e.vertical&&f.current!==null;if(i.forEach(o=>{let D=0;o.forEach(c=>{if(x.intersects(c.props.start,c.props.end,e.start,e.end)&&!(e.dragHint||e.resizeHint)&&c._maxSiblingsPerSlot&&c._maxSiblingsPerSlot>v&&c.element!==n&&(v=c._maxSiblingsPerSlot),!d){const b=B.getRect(c.element);c.props.order!==null&&c.props.order!==void 0&&c.props.order<f.current&&(D=b.top+b.height-s.top-z.BORDER_WIDTH*f.current+F)}}),D>l&&(l=D)}),d){const o=(y=e.style)==null?void 0:y.height,D=typeof o=="number"?o:parseFloat(o);if(o==null)l=f.current*(j+F);else if(!Number.isNaN(D))l=f.current*(D+F);else{const c=(e.ignoreIsAllDay?u:u.filter(g=>g.props.isAllDay)).filter(g=>g.props.group.index===e.group.index&&g.element!==n),b=new Map;c.forEach(g=>{var X,Z;const I=g._order;if(I==null||I>=f.current)return;const ge=((X=g.element)==null?void 0:X.offsetHeight)||j;b.set(I,Math.max((Z=b.get(I))!=null?Z:0,ge))}),l=Array.from(b.values()).reduce((g,I)=>g+I+F,0)}}if(t.length===0){k(!1);return}const S=se.add?20:0;s.width=e.vertical?s.width/v-z.BORDER_WIDTH-S/v:s.width*t.length-z.BORDER_WIDTH,e.vertical?s.height=s.height*t.length-z.BORDER_WIDTH:(e.resizeHint||e.dragHint)&&v<=1||(s.height=(T=(A=e.style)==null?void 0:A.height)!=null?T:j),s.left=e.vertical?s.left+f.current*s.width+z.BORDER_WIDTH*f.current:s.left,s.top=e.vertical?s.top:s.top+l+z.BORDER_WIDTH*f.current,G.current=v,B.setRect(n,s),de(!0),k(!0)},Q=r.useCallback(t=>{const n=t&&t[0],a=Y.current;N.current!==void 0&&window.cancelAnimationFrame(N.current),a&&n&&(a.width!==n.contentRect.width||a.height!==n.contentRect.height)&&(N.current=window.requestAnimationFrame(()=>{W()})),Y.current={width:n.contentRect.width,height:n.contentRect.height}},[W]);r.useEffect(W);const he=m.current&&m.current.element?m.current.element.closest(".k-scheduler-layout"):null;return ye.useRowSync({element:he,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),r.useEffect(()=>{if(!q.current)return;const t=window.ResizeObserver,n=t&&new t(Q);return n&&n.observe(q.current),()=>{n&&n.disconnect()}},[Q,q]),r.createElement(le,{...ie,_ref:m,_maxSiblingsPerSlot:G,_order:f,itemRef:m,style:{visibility:ue?void 0:"hidden",display:ae?void 0:"none",...e.style}},!e.resizeHint&&r.createElement("span",{className:"k-event-actions"},e.tail&&r.createElement(M.IconWrap,{name:K==="rtl"?"chevron-right":"chevron-left",icon:K==="rtl"?C.chevronRightIcon:C.chevronLeftIcon}),e.isRecurring&&!e.isException&&r.createElement(M.IconWrap,{name:"arrow-rotate-cw",icon:C.arrowRotateCwIcon}),!e.isRecurring&&e.isException&&r.createElement(M.IconWrap,{name:"arrows-no-repeat",icon:C.arrowsNoRepeatIcon})),!e.resizeHint&&r.createElement("div",{title:U},!e.isAllDay&&r.createElement(p.SchedulerItemContent,{className:"k-event-time"},U),r.createElement(p.SchedulerItemContent,null,e.title)))}),ne={item:Re.SchedulerItem};te.displayName="KendoReactSchedulerViewItem";exports.SchedulerViewItem=te;exports.schedulerViewItemDefaultProps=ne;
@@ -5,190 +5,200 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import * as i from "react";
9
- import { SchedulerItem as de } from "./SchedulerItem.mjs";
10
- import { first as ue, calculateOrder as me, intersects as P } from "../utils/index.mjs";
11
- import { getRect as $, setRect as fe } from "../views/common/utils.mjs";
8
+ import * as n from "react";
9
+ import { SchedulerItem as me } from "./SchedulerItem.mjs";
10
+ import { first as fe, calculateOrder as he, intersects as F } from "../utils/index.mjs";
11
+ import { getRect as j, setRect as ge } from "../views/common/utils.mjs";
12
12
  import { BORDER_WIDTH as A } from "../constants/index.mjs";
13
- import { useInternationalization as he } from "@progress/kendo-react-intl";
14
- import { SchedulerItemContent as K } from "./SchedulerItemContent.mjs";
15
- import { useDir as ge, IconWrap as O } from "@progress/kendo-react-common";
16
- import { chevronRightIcon as ve, chevronLeftIcon as we, arrowRotateCwIcon as ye, arrowsNoRepeatIcon as Ie } from "@progress/kendo-svg-icons";
17
- import { useEditable as Re } from "../hooks/useEditable.mjs";
18
- import { useSchedulerViewItemsContext as Se, useSchedulerViewSlotsContext as De } from "../context/SchedulerViewContext.mjs";
13
+ import { useInternationalization as ve } from "@progress/kendo-react-intl";
14
+ import { SchedulerItemContent as J } from "./SchedulerItemContent.mjs";
15
+ import { useDir as we, IconWrap as V } from "@progress/kendo-react-common";
16
+ import { chevronRightIcon as ye, chevronLeftIcon as Ie, arrowRotateCwIcon as Re, arrowsNoRepeatIcon as Se } from "@progress/kendo-svg-icons";
17
+ import { useEditable as He } from "../hooks/useEditable.mjs";
18
+ import { useSchedulerViewItemsContext as be, useSchedulerViewSlotsContext as De } from "../context/SchedulerViewContext.mjs";
19
19
  import { useSchedulerElementContext as Ee } from "../context/SchedulerContext.mjs";
20
- import { useRowSync as He } from "../hooks/useRowSync.mjs";
21
- const k = 1, U = 25, Ae = i.forwardRef(
22
- (e, j) => {
23
- const { item: J, _ref: Q, itemRef: X, ...Z } = e, M = i.useRef(void 0), m = i.useRef(null), C = i.useRef(null), N = i.useRef(null), p = Re(e.editable);
24
- i.useImperativeHandle(C, () => ({ props: e, element: m.current && m.current.element })), i.useImperativeHandle(j, () => C.current), i.useImperativeHandle(Q, () => m.current), i.useImperativeHandle(X, () => m.current);
25
- const ee = J || be.item, V = he(), [te] = Se(), [re] = De(), x = Ee(), [ne, _] = i.useState(!0), [ie, le] = i.useState(!1), f = i.useRef(e.order), W = i.useRef(0), B = ge(x), L = i.useMemo(
20
+ import { useRowSync as Ae } from "../hooks/useRowSync.mjs";
21
+ const M = 1, k = 25, xe = n.forwardRef(
22
+ (e, Q) => {
23
+ const { item: X, _ref: Z, itemRef: p, ...ee } = e, _ = n.useRef(void 0), m = n.useRef(null), C = n.useRef(null), W = n.useRef(null), te = He(e.editable);
24
+ n.useImperativeHandle(C, () => ({ props: e, element: m.current && m.current.element })), n.useImperativeHandle(Q, () => C.current), n.useImperativeHandle(Z, () => m.current), n.useImperativeHandle(p, () => m.current);
25
+ const re = X || ze.item, L = ve(), [ne] = be(), [ie] = De(), P = Ee(), [le, N] = n.useState(!0), [oe, se] = n.useState(!1), f = n.useRef(e.order), Y = n.useRef(0), q = we(P), B = n.useMemo(
26
26
  () => {
27
27
  var t, r;
28
- return e.isAllDay ? (t = e.title) != null ? t : "" : `(${V.format("{0:t} - {1:t}", e.zonedStart, e.zonedEnd)}): ${(r = e.title) != null ? r : ""}`;
28
+ return e.isAllDay ? (t = e.title) != null ? t : "" : `(${L.format("{0:t} - {1:t}", e.zonedStart, e.zonedEnd)}): ${(r = e.title) != null ? r : ""}`;
29
29
  },
30
- [V, e.isAllDay, e.title, e.zonedEnd, e.zonedStart]
31
- ), Y = (t, r) => {
32
- let u = 1;
30
+ [L, e.isAllDay, e.title, e.zonedEnd, e.zonedStart]
31
+ ), G = (t, r) => {
32
+ let c = 1;
33
33
  return t.forEach((l) => {
34
- const s = r.filter((h) => F(l.current.props, h.props));
35
- s.length > u && (u = s.length);
36
- }), u;
37
- }, oe = (t, r) => t.map((l) => r.filter((s) => F(l.current.props, s.props))), se = (t, r) => {
38
- var z;
39
- const u = r.filter((n) => n.props.order !== null && n.props.order !== void 0).map((n) => {
40
- let a = n.props.start, c = n.props.end;
41
- if (n.props.isAllDay) {
42
- a = new Date(a.getFullYear(), a.getMonth(), a.getDate());
43
- const v = new Date(c.getFullYear(), c.getMonth(), c.getDate());
44
- c = v.getTime() <= a.getTime() ? new Date(a.getFullYear(), a.getMonth(), a.getDate() + 1) : v;
34
+ const d = r.filter((h) => T(l.current.props, h.props));
35
+ d.length > c && (c = d.length);
36
+ }), c;
37
+ }, ae = (t, r) => t.map((l) => r.filter((d) => T(l.current.props, d.props))), ce = (t, r, c) => {
38
+ var I;
39
+ const l = r.filter((i) => i.props.order !== null && i.props.order !== void 0).map((i) => {
40
+ let o = i.props.start, u = i.props.end;
41
+ if (i.props.isAllDay) {
42
+ o = new Date(o.getFullYear(), o.getMonth(), o.getDate());
43
+ const R = new Date(u.getFullYear(), u.getMonth(), u.getDate());
44
+ u = R.getTime() <= o.getTime() ? new Date(o.getFullYear(), o.getMonth(), o.getDate() + 1) : R;
45
45
  }
46
- return { order: n.props.order, start: a, end: c };
47
- }), l = Array.from(new Set(u.map((n) => n.order))).sort((n, a) => n - a), s = /* @__PURE__ */ new Map();
48
- for (const n of u)
49
- s.has(n.order) || s.set(n.order, []), s.get(n.order).push({ start: n.start, end: n.end });
50
- const h = [], R = /* @__PURE__ */ new Map();
51
- for (const n of l) {
52
- const a = s.get(n);
53
- let c = -1, v = 0;
54
- R.forEach((w, D) => {
55
- if (D >= n)
46
+ return { order: i.props.order, start: o, end: u };
47
+ }), d = Array.from(new Set(l.map((i) => i.order))).sort((i, o) => i - o), h = /* @__PURE__ */ new Map();
48
+ for (const i of l)
49
+ h.has(i.order) || h.set(i.order, []), h.get(i.order).push({ start: i.start, end: i.end });
50
+ const y = [], x = /* @__PURE__ */ new Map();
51
+ for (const i of d) {
52
+ const o = h.get(i);
53
+ let u = -1, R = 0;
54
+ x.forEach((w, D) => {
55
+ if (D >= i)
56
56
  return;
57
- const y = s.get(D);
58
- if (!y)
57
+ const S = h.get(D);
58
+ if (!S)
59
59
  return;
60
- a.some(
61
- (b) => y.some(
62
- (o) => P(o.start, o.end, b.start, b.end)
60
+ o.some(
61
+ (z) => S.some(
62
+ (s) => F(s.start, s.end, z.start, z.end, c)
63
63
  )
64
- ) && w + 1 > v && (v = w + 1);
64
+ ) && w + 1 > R && (R = w + 1);
65
65
  });
66
- for (let w = v; w < h.length; w++)
67
- if (a.every(
68
- (y) => h[w].every((E) => !P(E.start, E.end, y.start, y.end))
66
+ for (let w = R; w < y.length; w++)
67
+ if (o.every(
68
+ (S) => y[w].every(
69
+ (E) => !F(
70
+ E.start,
71
+ E.end,
72
+ S.start,
73
+ S.end,
74
+ c
75
+ )
76
+ )
69
77
  )) {
70
- c = w;
78
+ u = w;
71
79
  break;
72
80
  }
73
- c === -1 && (c = h.length, h.push([])), h[c].push(...a), R.set(n, c);
81
+ u === -1 && (u = y.length, y.push([])), y[u].push(...o), x.set(i, u);
74
82
  }
75
- return (z = R.get(t)) != null ? z : t;
76
- }, F = (t, r) => P(t.start, t.end, r.start, r.end) && t.group.index === r.group.index && t.range.index === r.range.index && // When slotDuration equals a full day, both daySlots and timeSlots have isAllDay=true,
83
+ return (I = x.get(t)) != null ? I : t;
84
+ }, T = (t, r) => F(t.start, t.end, r.start, r.end) && t.group.index === r.group.index && t.range.index === r.range.index && // When slotDuration equals a full day, both daySlots and timeSlots have isAllDay=true,
77
85
  // so we need to also check range.isAllDay to distinguish between them.
78
- (t.range.isAllDay === void 0 || r.range.isAllDay === void 0 || t.range.isAllDay === r.range.isAllDay) && (e.ignoreIsAllDay || t.isAllDay === r.isAllDay), T = () => {
79
- var D, y, E, b;
80
- const t = (re || []).filter((o) => o.current && F(o.current.props, e)), r = m.current && m.current.element, u = ue(t);
86
+ (t.range.isAllDay === void 0 || r.range.isAllDay === void 0 || t.range.isAllDay === r.range.isAllDay) && (e.ignoreIsAllDay || t.isAllDay === r.isAllDay), O = () => {
87
+ var w, D, S, E, z;
88
+ const t = (ie || []).filter((s) => s.current && T(s.current.props, e)), r = m.current && m.current.element, c = fe(t);
81
89
  if (t.length === 0) {
82
- _(!1);
90
+ N(!1);
83
91
  return;
84
92
  }
85
- if (!u.current || !r)
93
+ if (!c.current || !r)
86
94
  return;
87
- const l = $(u.current.element), s = [], h = [], R = [];
88
- (te || []).forEach((o) => {
89
- o.current && (o.current.props.dragHint ? h.push(o.current) : o.current.props.resizeHint ? R.push(o.current) : s.push(o.current));
95
+ const l = j(c.current.element), d = [], h = [], y = [];
96
+ (ne || []).forEach((s) => {
97
+ s.current && (s.current.props.dragHint ? h.push(s.current) : s.current.props.resizeHint ? y.push(s.current) : d.push(s.current));
90
98
  });
91
- const z = e.dragHint || e.resizeHint ? me(
99
+ const x = e.dragHint || e.resizeHint ? he(
92
100
  m.current,
93
- e.dragHint ? h : R,
101
+ e.dragHint ? h : y,
94
102
  t,
95
103
  e.ignoreIsAllDay
96
- ) : (D = e.order) != null ? D : 0;
104
+ ) : (w = e.order) != null ? w : 0;
97
105
  if (!e.vertical && !(e.dragHint || e.resizeHint) && e.order !== null && e.order !== void 0) {
98
- const I = (e.ignoreIsAllDay ? s : s.filter((d) => d.props.isAllDay)).filter((d) => d.props.group.index === e.group.index);
99
- f.current = se(e.order, I);
106
+ const H = (e.ignoreIsAllDay ? d : d.filter((v) => v.props.isAllDay)).filter((v) => v.props.group.index === e.group.index), a = (D = e.style) == null ? void 0 : D.height, b = typeof a == "number" ? a : parseFloat(a), g = a != null && Number.isNaN(b);
107
+ f.current = ce(e.order, H, !g);
100
108
  } else
101
- f.current = z;
102
- let n = e.dragHint || e.resizeHint ? Y(t, e.dragHint ? h : R) : Y(t, s);
103
- const a = oe(t, s);
104
- let c = 0;
105
- const v = !e.vertical && f.current !== null;
106
- if (a.forEach((o) => {
107
- let I = 0;
108
- o.forEach((d) => {
109
- if (P(d.props.start, d.props.end, e.start, e.end) && !(e.dragHint || e.resizeHint) && d._maxSiblingsPerSlot && d._maxSiblingsPerSlot > n && d.element !== r && (n = d._maxSiblingsPerSlot), !v) {
110
- const H = $(d.element);
111
- d.props.order !== null && d.props.order !== void 0 && d.props.order < f.current && (I = H.top + H.height - l.top - A * f.current + k);
109
+ f.current = x;
110
+ let I = e.dragHint || e.resizeHint ? G(t, e.dragHint ? h : y) : G(t, d);
111
+ const i = ae(t, d);
112
+ let o = 0;
113
+ const u = !e.vertical && f.current !== null;
114
+ if (i.forEach((s) => {
115
+ let H = 0;
116
+ s.forEach((a) => {
117
+ if (F(a.props.start, a.props.end, e.start, e.end) && !(e.dragHint || e.resizeHint) && a._maxSiblingsPerSlot && a._maxSiblingsPerSlot > I && a.element !== r && (I = a._maxSiblingsPerSlot), !u) {
118
+ const b = j(a.element);
119
+ a.props.order !== null && a.props.order !== void 0 && a.props.order < f.current && (H = b.top + b.height - l.top - A * f.current + M);
112
120
  }
113
- }), I > c && (c = I);
114
- }), v) {
115
- const o = (y = e.style) == null ? void 0 : y.height, I = typeof o == "number" ? o : parseFloat(o);
116
- if (!isNaN(I))
117
- c = f.current * (I + k);
121
+ }), H > o && (o = H);
122
+ }), u) {
123
+ const s = (S = e.style) == null ? void 0 : S.height, H = typeof s == "number" ? s : parseFloat(s);
124
+ if (s == null)
125
+ o = f.current * (k + M);
126
+ else if (!Number.isNaN(H))
127
+ o = f.current * (H + M);
118
128
  else {
119
- const d = (e.ignoreIsAllDay ? s : s.filter((g) => g.props.isAllDay)).filter(
129
+ const a = (e.ignoreIsAllDay ? d : d.filter((g) => g.props.isAllDay)).filter(
120
130
  (g) => g.props.group.index === e.group.index && g.element !== r
121
- ), H = /* @__PURE__ */ new Map();
122
- d.forEach((g) => {
123
- var G;
124
- const S = g._order;
125
- if (S == null || S >= f.current)
131
+ ), b = /* @__PURE__ */ new Map();
132
+ a.forEach((g) => {
133
+ var K, U;
134
+ const v = g._order;
135
+ if (v == null || v >= f.current)
126
136
  return;
127
- const ce = g.element && g.element.offsetHeight || U;
128
- H.set(S, Math.max((G = H.get(S)) != null ? G : 0, ce));
129
- }), c = Array.from(H.values()).reduce((g, S) => g + S + k, 0);
137
+ const ue = ((K = g.element) == null ? void 0 : K.offsetHeight) || k;
138
+ b.set(v, Math.max((U = b.get(v)) != null ? U : 0, ue));
139
+ }), o = Array.from(b.values()).reduce((g, v) => g + v + M, 0);
130
140
  }
131
141
  }
132
142
  if (t.length === 0) {
133
- _(!1);
143
+ N(!1);
134
144
  return;
135
145
  }
136
- const w = p.add ? 20 : 0;
137
- l.width = e.vertical ? l.width / n - A - w / n : l.width * t.length - A, e.vertical ? l.height = l.height * t.length - A : (e.resizeHint || e.dragHint) && n <= 1 || (l.height = (b = (E = e.style) == null ? void 0 : E.height) != null ? b : U), l.left = e.vertical ? l.left + f.current * l.width + A * f.current : l.left, l.top = e.vertical ? l.top : l.top + c + A * f.current, W.current = n, fe(r, l), le(!0), _(!0);
138
- }, q = i.useCallback(
146
+ const R = te.add ? 20 : 0;
147
+ l.width = e.vertical ? l.width / I - A - R / I : l.width * t.length - A, e.vertical ? l.height = l.height * t.length - A : (e.resizeHint || e.dragHint) && I <= 1 || (l.height = (z = (E = e.style) == null ? void 0 : E.height) != null ? z : k), l.left = e.vertical ? l.left + f.current * l.width + A * f.current : l.left, l.top = e.vertical ? l.top : l.top + o + A * f.current, Y.current = I, ge(r, l), se(!0), N(!0);
148
+ }, $ = n.useCallback(
139
149
  (t) => {
140
- const r = t && t[0], u = N.current;
141
- M.current !== void 0 && window.cancelAnimationFrame(M.current), u && r && (u.width !== r.contentRect.width || u.height !== r.contentRect.height) && (M.current = window.requestAnimationFrame(() => {
142
- T();
143
- })), N.current = { width: r.contentRect.width, height: r.contentRect.height };
150
+ const r = t && t[0], c = W.current;
151
+ _.current !== void 0 && window.cancelAnimationFrame(_.current), c && r && (c.width !== r.contentRect.width || c.height !== r.contentRect.height) && (_.current = window.requestAnimationFrame(() => {
152
+ O();
153
+ })), W.current = { width: r.contentRect.width, height: r.contentRect.height };
144
154
  },
145
- [T]
155
+ [O]
146
156
  );
147
- i.useEffect(T);
148
- const ae = m.current && m.current.element ? m.current.element.closest(".k-scheduler-layout") : null;
149
- return He({
150
- element: ae,
157
+ n.useEffect(O);
158
+ const de = m.current && m.current.element ? m.current.element.closest(".k-scheduler-layout") : null;
159
+ return Ae({
160
+ element: de,
151
161
  selector: ".k-resource-row",
152
162
  horizontalAttribute: "data-depth-index",
153
163
  verticalAttribute: "data-resource-index",
154
164
  applyTo: ".k-resource-cell",
155
165
  syncHeight: e.isLast
156
- }), i.useEffect(() => {
157
- if (!x.current)
166
+ }), n.useEffect(() => {
167
+ if (!P.current)
158
168
  return;
159
- const t = window.ResizeObserver, r = t && new t(q);
160
- return r && r.observe(x.current), () => {
169
+ const t = window.ResizeObserver, r = t && new t($);
170
+ return r && r.observe(P.current), () => {
161
171
  r && r.disconnect();
162
172
  };
163
- }, [q, x]), /* @__PURE__ */ i.createElement(
164
- ee,
173
+ }, [$, P]), /* @__PURE__ */ n.createElement(
174
+ re,
165
175
  {
166
- ...Z,
176
+ ...ee,
167
177
  _ref: m,
168
- _maxSiblingsPerSlot: W,
178
+ _maxSiblingsPerSlot: Y,
169
179
  _order: f,
170
180
  itemRef: m,
171
181
  style: {
172
- visibility: ie ? void 0 : "hidden",
173
- display: ne ? void 0 : "none",
182
+ visibility: oe ? void 0 : "hidden",
183
+ display: le ? void 0 : "none",
174
184
  ...e.style
175
185
  }
176
186
  },
177
- !e.resizeHint && /* @__PURE__ */ i.createElement("span", { className: "k-event-actions" }, e.tail && /* @__PURE__ */ i.createElement(
178
- O,
187
+ !e.resizeHint && /* @__PURE__ */ n.createElement("span", { className: "k-event-actions" }, e.tail && /* @__PURE__ */ n.createElement(
188
+ V,
179
189
  {
180
- name: B === "rtl" ? "chevron-right" : "chevron-left",
181
- icon: B === "rtl" ? ve : we
190
+ name: q === "rtl" ? "chevron-right" : "chevron-left",
191
+ icon: q === "rtl" ? ye : Ie
182
192
  }
183
- ), e.isRecurring && !e.isException && /* @__PURE__ */ i.createElement(O, { name: "arrow-rotate-cw", icon: ye }), !e.isRecurring && e.isException && /* @__PURE__ */ i.createElement(O, { name: "arrows-no-repeat", icon: Ie })),
184
- !e.resizeHint && /* @__PURE__ */ i.createElement("div", { title: L }, !e.isAllDay && /* @__PURE__ */ i.createElement(K, { className: "k-event-time" }, L), /* @__PURE__ */ i.createElement(K, null, e.title))
193
+ ), e.isRecurring && !e.isException && /* @__PURE__ */ n.createElement(V, { name: "arrow-rotate-cw", icon: Re }), !e.isRecurring && e.isException && /* @__PURE__ */ n.createElement(V, { name: "arrows-no-repeat", icon: Se })),
194
+ !e.resizeHint && /* @__PURE__ */ n.createElement("div", { title: B }, !e.isAllDay && /* @__PURE__ */ n.createElement(J, { className: "k-event-time" }, B), /* @__PURE__ */ n.createElement(J, null, e.title))
185
195
  );
186
196
  }
187
- ), be = {
188
- item: de
197
+ ), ze = {
198
+ item: me
189
199
  };
190
- Ae.displayName = "KendoReactSchedulerViewItem";
200
+ xe.displayName = "KendoReactSchedulerViewItem";
191
201
  export {
192
- Ae as SchedulerViewItem,
193
- be as schedulerViewItemDefaultProps
202
+ xe as SchedulerViewItem,
203
+ ze as schedulerViewItemDefaultProps
194
204
  };
@@ -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 e=Object.freeze({name:"@progress/kendo-react-scheduler",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1783326714,version:"15.1.0-develop.8",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui"});exports.packageMetadata=e;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-scheduler",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1783511183,version:"15.1.0",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui"});exports.packageMetadata=e;
@@ -6,7 +6,7 @@ export const packageMetadata = Object.freeze({
6
6
  productName: 'KendoReact',
7
7
  productCode: 'KENDOUIREACT',
8
8
  productCodes: ['KENDOUIREACT'],
9
- publishDate: 1783326714,
10
- version: '15.1.0-develop.8',
9
+ publishDate: 1783511183,
10
+ version: '15.1.0',
11
11
  licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui'
12
12
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-scheduler",
3
- "version": "15.1.0-develop.8",
3
+ "version": "15.1.0",
4
4
  "description": "React Scheduler brings the functionality of Outlook's Calendar to a single UI component. KendoReact Scheduler package",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -29,15 +29,15 @@
29
29
  "@progress/kendo-date-math": "^1.4.1",
30
30
  "@progress/kendo-drawing": "^1.21.2",
31
31
  "@progress/kendo-licensing": "^1.7.2",
32
- "@progress/kendo-react-buttons": "15.1.0-develop.8",
33
- "@progress/kendo-react-common": "15.1.0-develop.8",
34
- "@progress/kendo-react-dateinputs": "15.1.0-develop.8",
35
- "@progress/kendo-react-dialogs": "15.1.0-develop.8",
36
- "@progress/kendo-react-dropdowns": "15.1.0-develop.8",
37
- "@progress/kendo-react-form": "15.1.0-develop.8",
38
- "@progress/kendo-react-inputs": "15.1.0-develop.8",
39
- "@progress/kendo-react-intl": "15.1.0-develop.8",
40
- "@progress/kendo-react-popup": "15.1.0-develop.8",
32
+ "@progress/kendo-react-buttons": "15.1.0",
33
+ "@progress/kendo-react-common": "15.1.0",
34
+ "@progress/kendo-react-dateinputs": "15.1.0",
35
+ "@progress/kendo-react-dialogs": "15.1.0",
36
+ "@progress/kendo-react-dropdowns": "15.1.0",
37
+ "@progress/kendo-react-form": "15.1.0",
38
+ "@progress/kendo-react-inputs": "15.1.0",
39
+ "@progress/kendo-react-intl": "15.1.0",
40
+ "@progress/kendo-react-popup": "15.1.0",
41
41
  "@progress/kendo-svg-icons": "^4.9.0 || ^5.0.0",
42
42
  "react": "^18.0.0 || ^19.0.0",
43
43
  "react-dom": "^18.0.0 || ^19.0.0"
@@ -67,7 +67,7 @@
67
67
  "package": {
68
68
  "productName": "KendoReact",
69
69
  "productCode": "KENDOUIREACT",
70
- "publishDate": 1783326714,
70
+ "publishDate": 1783511183,
71
71
  "licensingDocsUrl": "https://www.telerik.com/kendo-react-ui"
72
72
  }
73
73
  },