@progress/kendo-react-grid
Version:
React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package
54 lines (53 loc) • 1.7 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2026 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import { getNestedValue as r } from "../../utils/index.mjs";
import { GRID_COL_INDEX_ATTRIBUTE as u } from "../../constants/index.mjs";
import { uGrid as s, classNames as o } from "@progress/kendo-react-common";
const y = (e) => {
var n, c;
let t = null, a = null;
const i = e.unstyled, d = i && i.uGrid ? i.uGrid : s;
if (e.rowType === "groupFooter")
t = {
className: o(d.td({}), e.className),
role: "gridcell"
};
else if (e.rowType !== "groupHeader") {
if (e.field !== void 0) {
const l = r(e.field, e.dataItem);
l != null && (a = e.intl && e.format ? e.intl.format(e.format, l) : l.toString());
}
const m = o(
d.td({
selected: e.isSelected,
highlighted: e.isHighlighted,
sorted: e.isSorted,
alt: e.isAlt
}),
e.className
);
t = {
rowSpan: (c = (n = e._rowSpan) == null ? void 0 : n.count) != null ? c : void 0,
colSpan: e.colSpan,
style: e.style,
className: m,
role: "gridcell",
"aria-colindex": e.ariaColumnIndex,
"aria-selected": e.isSelected,
[u]: e.columnIndex
};
}
return { tdProps: t, content: a };
}, N = (e) => {
var t;
return (t = e.cells) == null ? void 0 : t[e.rowType || "data"];
};
export {
y as getCellTdProps,
N as getCustomCell
};