@progress/kendo-react-grid
Version:
React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package
36 lines (35 loc) • 1.25 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2026 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
"use client";
import * as o from "react";
import { GridContext as c } from "../../utils/GridContext.mjs";
import { useTableKeyboardNavigation as u } from "@progress/kendo-react-data-tools";
import { Keys as a } from "@progress/kendo-react-common";
import { useContextMenuHandler as r, usePositionStyle as s } from "../hooks.mjs";
const y = (e) => {
const t = o.useContext(c), d = u(e.id), i = r(e.dataItem, e.field), m = s(e), l = o.useCallback(
(n) => {
(n.keyCode === a.enter || n.keyCode === a.space) && (t == null || t.selectionChange({
event: n,
dataItem: e.dataItem,
dataIndex: e.rowDataIndex,
columnIndex: e.columnIndex
}));
},
[t, e.dataItem, e.rowDataIndex, e.columnIndex]
);
return {
...d,
onContextMenu: i,
onKeyDown: l,
style: m
};
};
export {
y as useSelectionCellClientTdProps
};