@progress/kendo-react-grid
Version:
React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package
53 lines (52 loc) • 2.15 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 a from "react";
import { getNestedValue as g, getClientCellProps as y, isClientReference as w } from "../utils/index.mjs";
import { GRID_COL_INDEX_ATTRIBUTE as E } from "../constants/index.mjs";
import { GridCellContainer as C } from "./client/GridCellContainer.mjs";
import { uGrid as N, classNames as T } from "@progress/kendo-react-common";
const x = (e) => {
var u, s, f;
let c = null, t = null, n = null;
const d = e.unstyled, S = d && d.uGrid ? d.uGrid : N;
if (((u = e._rowSpan) == null ? void 0 : u.count) === null)
return null;
if (e.rowType === "groupFooter")
t = {
className: e.className
}, c = /* @__PURE__ */ a.createElement("td", { ...t }, n);
else if (e.rowType !== "groupHeader") {
if (e.field !== void 0) {
const l = g(e.field, e.dataItem);
l != null && (n = e.intl && e.format ? e.intl.format(e.format, l) : l.toString());
}
const i = T(
S.td({ selected: e.isSelected, sorted: e.isSorted, alt: e.isAlt }),
e.className
);
t = {
rowSpan: (f = (s = e._rowSpan) == null ? void 0 : s.count) != null ? f : void 0,
colSpan: e.colSpan,
style: e.style,
className: i,
role: "gridcell",
"aria-colindex": e.ariaColumnIndex,
"aria-selected": e.isSelected,
[E]: e.columnIndex
}, c = /* @__PURE__ */ a.createElement("td", { ...t }, n);
}
const o = y(e), m = e.rowType || "data", r = e.cells;
if (r && r[m]) {
const i = r[m], l = w(i);
return /* @__PURE__ */ a.createElement(C, { cellProps: o, tdProps: t, isCustom: !0, isClient: l }, /* @__PURE__ */ a.createElement(i, { ...o, tdProps: t }, n));
}
return /* @__PURE__ */ a.createElement(C, { cellProps: o, content: n, tdProps: t }, c);
};
export {
x as GridCell
};