@progress/kendo-react-treelist
Version:
React TreeList enables the display of self-referencing tabular data. KendoReact TreeList package
43 lines (42 loc) • 1.47 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 t from "react";
import { classNames as x } from "@progress/kendo-react-common";
import { TREELIST_ROW_INDEX_ATTRIBUTE as k } from "../constants/index.mjs";
const u = t.forwardRef((e, o) => {
const { isSelected: r, rowHeight: a, isAltRow: i, expanded: l, ariaRowIndex: d, level: c, ariaSetSize: s, ariaPosInSet: m } = e, w = x("k-table-row", "k-master-row", {
"k-selected": r,
"k-table-alt-row": i
}), R = t.useMemo(
() => a !== void 0 ? { height: a + "px" } : void 0,
[a]
), n = /* @__PURE__ */ t.createElement(
"tr",
{
onClick: e.onClick,
onDoubleClick: e.onDoubleClick,
onContextMenu: e.onContextMenu,
className: w,
style: R,
ref: o,
"aria-expanded": l,
role: "row",
"aria-rowindex": d,
"aria-level": c.length,
"aria-posinset": m,
"aria-setsize": s,
[k]: e.rowIndex
},
e.children
);
return /* @__PURE__ */ t.createElement(t.Fragment, null, e.render ? e.render.call(void 0, n, e) : n);
});
u.displayName = "KendoReactTreeListRow";
export {
u as TreeListRow
};