UNPKG

@progress/kendo-react-grid

Version:

React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package

62 lines (61 loc) 1.84 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 client"; import * as l from "react"; import { useTableKeyboardNavigation as m } from "@progress/kendo-react-data-tools"; import { GridContext as x } from "../../GridClientWrapper.mjs"; import { cloneReactElement as a } from "../../utils/index.mjs"; const I = (t) => { var d; const { cellProps: e } = t, n = l.useContext(x), c = m(e.id), s = { onContextMenu: l.useCallback( (o) => { n != null && n.onContextMenu && n.onContextMenu.call(void 0, o, e.dataItem, e.field); }, [n, e.dataItem, e.field] ) }, u = n.getCellPositionStyle(e.columnPosition), C = { style: { ...(d = t.tdProps) == null ? void 0 : d.style, ...u } }, i = { ...c, ...s, ...C }, r = { onContextMenu: n.onContextMenu, onChange: n.itemChange, selectionChange: (o) => { n.selectionChange({ event: o, dataItem: e.dataItem, dataIndex: e.rowDataIndex, columnIndex: e.columnIndex }); } }; if (t.isCustom) return n.isClient || t.isClient ? a(t.children, { // pass down to tdProps for client templates tdProps: { ...t.tdProps, ...i }, ...r }) : a(t.children, { ...i }); if (e.render) { const o = /* @__PURE__ */ l.createElement("td", { ...t.tdProps, ...i }, t.content); return e.render.call(void 0, o, { ...e, ...r }); } return t.children && a(t.children, { ...i }); }; export { I as GridEditCellContainer };