@progress/kendo-react-treelist
Version:
React TreeList enables the display of self-referencing tabular data. KendoReact TreeList package
56 lines (55 loc) • 1.62 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 { useTableKeyboardNavigation as c } from "@progress/kendo-react-data-tools";
import { TREELIST_COL_INDEX_ATTRIBUTE as m } from "../../constants/index.mjs";
import { classNames as s, getNestedValue as u } from "@progress/kendo-react-common";
const f = (e) => {
const i = t.useCallback(
(l) => {
e.onChange && e.onChange({
dataItem: e.dataItem,
level: e.level,
field: e.field,
syntheticEvent: l,
value: l.target.value
});
},
[e.onChange, e.dataItem, e.level, e.field]
), d = c(e.id), n = s(
{
"k-selected": e.isSelected
},
e.className
), a = /* @__PURE__ */ t.createElement(
"td",
{
style: e.style,
className: n,
"aria-colindex": e.ariaColumnIndex,
"aria-selected": e.isSelected,
role: "gridcell",
...d,
[m]: e.colIndex
},
/* @__PURE__ */ t.createElement(
"input",
{
style: { width: "100%" },
className: "k-input",
value: u(e.field, e.dataItem) || "",
onChange: i
}
)
);
return e.render ? e.render.call(void 0, a, e) : a;
};
f.displayName = "KendoReactTreeListTextEditor";
export {
f as TreeListTextEditor
};