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) 1.73 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 f=require("react"),u=require("../utils/index.js"),C=require("@progress/kendo-react-common"),g=require("../constants/index.js"),G=require("./client/GridEditCellEditor.js"),m=require("./client/GridEditCellContainer.js");function y(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const c=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(t,l,c.get?c:{enumerable:!0,get:()=>e[l]})}}return t.default=e,Object.freeze(t)}const r=y(f),S=e=>{const t=e.unstyled,l=t&&t.uGrid?t.uGrid:C.uGrid,c=C.classNames(l.editTd({selected:e.isSelected}),e.className),d={colSpan:e.colSpan,style:e.style,className:c,"aria-colindex":e.ariaColumnIndex,"aria-selected":e.isSelected,[g.GRID_COL_INDEX_ATTRIBUTE]:e.columnIndex,role:"gridcell"},s=u.getClientCellProps(e),o=r.createElement(G.GridEditCellEditor,{cellProps:s}),a=e.editor||"text",i=e.cells;if(i){let n;if(i.edit&&i.edit[a]?n=i.edit[a]:i.data&&(n=i.data),n){const E=u.isClientReference(n);return r.createElement(m.GridEditCellContainer,{cellProps:s,tdProps:d,isCustom:!0,isClient:E},r.createElement(n,{...s,tdProps:d},o))}}return r.createElement(m.GridEditCellContainer,{cellProps:s,content:o,tdProps:d},r.createElement("td",{...d},o))};exports.GridEditCell=S;