@progress/kendo-react-grid
Version:
React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package
33 lines (32 loc) • 1.19 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
*-------------------------------------------------------------------------------------------
*/
"use client";
import * as a from "react";
import { useTableKeyboardNavigation as d, DETAIL_EXPAND_ACTION as s } from "@progress/kendo-react-data-tools";
import { Keys as l, getter as m } from "@progress/kendo-react-common";
import { GridContext as u } from "../../utils/GridContext.mjs";
const D = (t) => {
const e = a.useContext(u), r = d(t.id), n = a.useCallback(
(o) => {
o.isDefaultPrevented() || o.keyCode === l.enter && (e != null && e.dispatchDetailExpand) && (o.preventDefault(), e.dispatchDetailExpand({
type: s.TOGGLE,
id: m(e.dataItemKey)(t.dataItem)
}));
},
[t.dataItem, e]
), i = t.rowType !== "groupHeader" && t.rowType !== "groupFooter" ? {
onKeyDown: n
} : {};
return {
...r,
...i
};
};
export {
D as useHierarchyCellClientTdProps
};