@progress/kendo-react-grid
Version:
React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package
48 lines (47 loc) • 1.63 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 { getNestedValue as m } from "../../utils/index.mjs";
import { GRID_COL_INDEX_ATTRIBUTE as u } from "../../constants/index.mjs";
import { uGrid as s, classNames as r } from "@progress/kendo-react-common";
const y = (e) => {
var d, n;
let t = null, i = null;
const a = e.unstyled, c = a && a.uGrid ? a.uGrid : s;
if (e.rowType === "groupFooter")
t = {
className: e.className
};
else if (e.rowType !== "groupHeader") {
if (e.field !== void 0) {
const l = m(e.field, e.dataItem);
l != null && (i = e.intl && e.format ? e.intl.format(e.format, l) : l.toString());
}
const o = r(
c.td({ selected: e.isSelected, highlighted: e.isHighlighted, sorted: e.isSorted, alt: e.isAlt }),
e.className
);
t = {
rowSpan: (n = (d = e._rowSpan) == null ? void 0 : d.count) != null ? n : void 0,
colSpan: e.colSpan,
style: e.style,
className: o,
role: "gridcell",
"aria-colindex": e.ariaColumnIndex,
"aria-selected": e.isSelected,
[u]: e.columnIndex
};
}
return { tdProps: t, content: i };
}, N = (e) => {
var t;
return (t = e.cells) == null ? void 0 : t[e.rowType || "data"];
};
export {
y as getCellTdProps,
N as getCustomCell
};