@progress/kendo-react-grid
Version:
React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package
36 lines (35 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
*-------------------------------------------------------------------------------------------
*/
import * as i from "react";
import { getClientCellProps as u, isClientReference as f } from "../utils/index.mjs";
import { uGrid as E, classNames as G } from "@progress/kendo-react-common";
import { GRID_COL_INDEX_ATTRIBUTE as x } from "../constants/index.mjs";
import { GridEditCellEditor as I } from "./client/GridEditCellEditor.mjs";
import { GridEditCellContainer as o } from "./client/GridEditCellContainer.mjs";
const T = (e) => {
const c = e.unstyled, a = c && c.uGrid ? c.uGrid : E, m = G(a.editTd({ selected: e.isSelected }), e.className), n = {
colSpan: e.colSpan,
style: e.style,
className: m,
"aria-colindex": e.ariaColumnIndex,
"aria-selected": e.isSelected,
[x]: e.columnIndex,
role: "gridcell"
}, s = u(e), d = /* @__PURE__ */ i.createElement(I, { cellProps: s }), r = e.editor || "text", t = e.cells;
if (t) {
let l;
if (t.edit && t.edit[r] ? l = t.edit[r] : t.data && (l = t.data), l) {
const C = f(l);
return /* @__PURE__ */ i.createElement(o, { cellProps: s, tdProps: n, isCustom: !0, isClient: C }, /* @__PURE__ */ i.createElement(l, { ...s, tdProps: n }, d));
}
}
return /* @__PURE__ */ i.createElement(o, { cellProps: s, content: d, tdProps: n }, /* @__PURE__ */ i.createElement("td", { ...n }, d));
};
export {
T as GridEditCell
};