UNPKG

@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.02 kB
/** * @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 G=require("react"),u=require("../utils/index.js"),T=require("../constants/index.js"),g=require("./client/GridCellContainer.js"),S=require("@progress/kendo-react-common");function b(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,l.get?l:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const a=b(G),w=e=>{var m,f,C;let n=null,t=null,l=null;const r=e.unstyled,y=r&&r.uGrid?r.uGrid:S.uGrid;if(((m=e._rowSpan)==null?void 0:m.count)===null)return null;if(e.rowType==="groupFooter")t={className:e.className},n=a.createElement("td",{...t},l);else if(e.rowType!=="groupHeader"){if(e.field!==void 0){const i=u.getNestedValue(e.field,e.dataItem);i!=null&&(l=e.intl&&e.format?e.intl.format(e.format,i):i.toString())}const c=S.classNames(y.td({selected:e.isSelected,sorted:e.isSorted,alt:e.isAlt}),e.className);t={rowSpan:(C=(f=e._rowSpan)==null?void 0:f.count)!=null?C:void 0,colSpan:e.colSpan,style:e.style,className:c,role:"gridcell","aria-colindex":e.ariaColumnIndex,"aria-selected":e.isSelected,[T.GRID_COL_INDEX_ATTRIBUTE]:e.columnIndex},n=a.createElement("td",{...t},l)}const o=u.getClientCellProps(e),s=e.rowType||"data",d=e.cells;if(d&&d[s]){const c=d[s],i=u.isClientReference(c);return a.createElement(g.GridCellContainer,{cellProps:o,tdProps:t,isCustom:!0,isClient:i},a.createElement(c,{...o,tdProps:t},l))}return a.createElement(g.GridCellContainer,{cellProps:o,content:l,tdProps:t},n)};exports.GridCell=w;