@progress/kendo-react-grid
Version:
React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package
42 lines (41 loc) • 1.2 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 o from "react";
import { GridContext as s } from "../utils/GridContext.mjs";
const a = (n) => {
const e = o.useContext(s);
return {
onContextMenu: e.onContextMenu,
onChange: e.itemChange,
selectionChange: (t) => {
e.selectionChange({
event: t,
dataItem: n.dataItem,
dataIndex: n.rowDataIndex,
columnIndex: n.columnIndex
});
}
};
}, c = (n, e) => {
const t = o.useContext(s);
return o.useCallback(
(u) => {
t != null && t.onContextMenu && t.onContextMenu.call(void 0, u, n, e);
},
[t, n, e]
);
}, i = (n) => {
const t = o.useContext(s).getCellPositionStyle(n.columnPosition) || {};
return { ...n.style, ...t };
};
export {
c as useContextMenuHandler,
a as useLegacyCellProps,
i as usePositionStyle
};