@progress/kendo-react-grid
Version:
React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package
49 lines (48 loc) • 1.96 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 m from "react";
import { classNames as y } from "@progress/kendo-react-common";
import { GridGroupCellToggle as x } from "./GridGroupCellToggle.mjs";
import { getClientCellProps as S } from "../../utils/index.mjs";
const T = (t) => {
const { columnIndex: e, level: l, columnsCount: n, rowType: g, dataItem: r, field: u, expanded: f, ariaColumnIndex: k, locked: s, style: d } = t, a = u || "";
let o = null, c = null, i = null;
const C = S(t);
let p = !1;
return e === void 0 || l === void 0 || e < l || n === void 0 || g !== "groupHeader" || r[a] === void 0 ? o = {
style: d,
key: "g" + e,
className: y("k-table-td", "k-group-cell", { "k-grid-content-sticky": s }),
role: "gridcell"
} : e === l && (p = !0, o = {
className: "k-table-td",
style: d,
colSpan: n - e,
key: "g-colspan",
role: "gridcell",
"aria-selected": !1,
"aria-expanded": f,
"aria-colindex": k
}, i = /* @__PURE__ */ m.createElement("p", { className: "k-reset" }, /* @__PURE__ */ m.createElement(x, { ...C }), r[a] instanceof Date ? r[a].toString() : r[a]), s && (o = {
...o,
colSpan: 0,
style: { ...d, position: "sticky", zIndex: 2 }
}, c = {
className: "k-table-td",
role: "gridcell",
colSpan: n - e,
style: { borderLeftWidth: 0, borderRightWidth: 0 }
})), { tdProps: o, td2Props: c, content: i, renderToggleCell: p };
}, I = (t) => {
var e, l;
return (l = (e = t.cells) == null ? void 0 : e.group) == null ? void 0 : l[t.rowType || "data"];
};
export {
I as getCustomCell,
T as getGroupCellTdProps
};