@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) • 2.64 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
*-------------------------------------------------------------------------------------------
*/
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),h=require("./utils.js"),k=require("../../constants/index.js"),E=require("../../context/SchedulerResourceIteratorContext.js");function f(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const c=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,c.get?c:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const o=f(w),R=t=>{const{nested:e,children:r,rowContentProps:c}=t,s=t.rowContent||C,n=t.childRowContent||s,l=h.toGroupResources(t.group,t.resources),a=0;return o.createElement("div",{className:"k-scheduler-group k-group-horizontal"},e?g({resources:l,children:r,nested:e,groupIndex:a,rowContent:s,rowContentProps:c,childRowContent:n}):p({resources:l,children:r,rowContent:s,nested:!!e,groupIndex:a,rowContentProps:c,childRowContent:n}))},g=t=>{const{resources:e,rowContent:r,nested:c,children:s,groupIndex:n,rowContentProps:l,childRowContent:a}=t;if(n===e.length)return p({resources:e,rowContent:r,children:s,nested:c,groupIndex:n,rowContentProps:l,childRowContent:a});const d=h.expandResources(e,n),u=r;return o.createElement(o.Fragment,null,c?o.createElement("div",{className:"k-scheduler-row"},o.createElement(u,{resources:e,groupIndex:n,...l},d.map((i,m)=>o.createElement("div",{key:m,className:"k-scheduler-cell k-heading-cell"},i.text)))):o.createElement(u,{resources:e,groupIndex:n,...l},d.map((i,m)=>o.createElement("div",{key:m,className:"k-scheduler-cell k-heading-cell"},i.text))),g({resources:e,children:s,nested:c,rowContent:r,childRowContent:a,groupIndex:n+1}))},p=t=>{const{resources:e,childRowContent:r,children:c,rowContentProps:s}=t,n=h.expandResources(e,e.length-1),l=r,a=e.length>0;return o.createElement("div",{className:"k-scheduler-row"},o.createElement(l,{resources:e,...s},(n.length?n:k.EMPTY_RESOURCE).map((d,u)=>o.createElement("div",{key:u,className:"k-scheduler-cell k-group-cell"},o.createElement(E.SchedulerResourceIteratorContext.Provider,{value:{resource:d,groupIndex:a?u:0}},c)))))};R.displayName="KendoReactSchedulerHorizontalResourceIterator";const C=t=>t.children;exports.DefaultRowContent=C;exports.HorizontalResourceIterator=R;