@progress/kendo-react-grid
Version:
React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package
9 lines (8 loc) • 2.36 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("@progress/kendo-react-common"),E=require("react"),N=require("./client/GridGroupCellToggle.js"),p=require("./client/GridGroupCellContainer.js"),k=require("../utils/index.js");function O(e){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(l,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return l.default=e,Object.freeze(l)}const o=O(E),R=e=>{const{columnIndex:l,level:r,columnsCount:n,rowType:G,dataItem:a,field:b,expanded:S,render:j,ariaColumnIndex:v}=e,c=b||"";let t=null,i=null,d=null,m=!1,s=!1,C=!1;const u=k.getClientCellProps(e);l===void 0||r===void 0||l<r||n===void 0||G!=="groupHeader"||a[c]===void 0?(s=!0,t={style:e.style,key:"g"+l,className:w.classNames("k-table-td","k-group-cell",{"k-grid-content-sticky":e.locked}),role:"gridcell"}):l===r&&(s=!0,t={className:"k-table-td",style:e.style,colSpan:n-l,key:"g-colspan",role:"gridcell","aria-selected":!1,"aria-expanded":S,"aria-colindex":v},d=o.createElement("p",{className:"k-reset"},o.createElement(N.GridGroupCellToggle,{...u}),a[c]instanceof Date&&a[c].toString?a[c].toString():a[c]),m=!0,e.locked&&(C=!0,t={...t,colSpan:0,style:{...e.style,position:"sticky",zIndex:2}},i={className:"k-table-td",role:"gridcell",colSpan:n-l,style:{borderLeftWidth:0,borderRightWidth:0}}));const f=e.rowType||"data",g=e.cells;if(g&&g.group&&g.group[f]){const y=g.group[f],T=k.isClientReference(y);return o.createElement(p.GridGroupCellContainer,{cellProps:u,tdProps:t,td2Props:i,isCustom:!0,isClient:T,addKeyDownHandler:!0},o.createElement(y,{...u,tdProps:t,td2Props:i},d))}const x=s?o.createElement("td",{...t,key:t==null?void 0:t.key},d):null;return o.createElement(p.GridGroupCellContainer,{cellProps:u,addKeyDownHandler:m,tdProps:t,td2Props:i,renderFirstCell:s,renderSecondCell:C,content:d},x)};exports.GridGroupCell=R;