@progress/kendo-react-grid
Version:
React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package
9 lines (8 loc) • 1.69 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 g=require("react"),d=require("../utils/index.js"),u=require("./client/GridHierarchyCellContainer.js"),C=require("./client/GridHierarchyCellToggle.js");function f(e){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const t=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(l,r,t.get?t:{enumerable:!0,get:()=>e[r]})}}return l.default=e,Object.freeze(l)}const n=f(g),h=e=>{let l=null,r=null,t=null;const c=d.getClientCellProps(e),s=e.expanded;e.rowType==="groupFooter"?r={className:"k-table-td k-hierarchy-cell",role:"gridcell"}:e.rowType!=="groupHeader"&&(r={className:"k-table-td k-hierarchy-cell",role:"gridcell","aria-expanded":!!s,"aria-colindex":e.ariaColumnIndex},t=n.createElement(C.GridHierarchyCellToggle,{...c}));const i=e.rowType||"data",a=e.cells;if(a&&a.hierarchy&&a.hierarchy[i]){const o=a.hierarchy[i],y=d.isClientReference(o);return n.createElement(u.GridHierarchyCellContainer,{cellProps:c,tdProps:r,isCustom:!0,isClient:y},n.createElement(o,{...c,tdProps:r},t))}return e.rowType!=="groupHeader"&&(l=n.createElement("td",{...r},t)),n.createElement(u.GridHierarchyCellContainer,{cellProps:c,content:t,tdProps:r},l)};exports.GridHierarchyCell=h;