@progress/kendo-react-scheduler
Version:
React Scheduler brings the functionality of Outlook's Calendar to a single UI component. KendoReact Scheduler package
9 lines (8 loc) • 1.78 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("react"),l=require("@progress/kendo-react-common"),O=require("../context/SchedulerViewContext.js");function _(t){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(i,n,s.get?s:{enumerable:!0,get:()=>t[n]})}}return i.default=t,Object.freeze(i)}const u=_(I),g=(t,i)=>{const{_ref:n,itemRef:s,_maxSiblingsPerSlot:c,_siblings:d,_order:o}=t,r=u.useRef(null),m=u.useRef(null),[,f]=O.useSchedulerViewItemsContext();return u.useImperativeHandle(r,()=>({element:m.current,props:t,get _maxSiblingsPerSlot(){return c==null?void 0:c.current},set _maxSiblingsPerSlot(e){var S;e!=null&&c!==void 0&&c.current!==void 0&&(c.current=e,(S=d==null?void 0:d.current)==null||S.forEach(a=>{var p;!a||a._maxSiblingsPerSlot===e||e<((p=a._maxSiblingsPerSlot)!=null?p:0)||(a._maxSiblingsPerSlot=e)}))},get _order(){return o==null?void 0:o.current},set _order(e){e!==void 0&&o!==void 0&&o.current!==void 0&&(o.current=e)}})),u.useImperativeHandle(i,()=>r.current),u.useImperativeHandle(n,()=>r.current),u.useImperativeHandle(s,()=>r.current),l.useIsomorphicLayoutEffect(()=>(f({type:l.COLLECTION_ACTION.add,item:r}),()=>{f({type:l.COLLECTION_ACTION.remove,item:r})})),{item:r,element:m}};exports.useSchedulerItem=g;