UNPKG

@progress/kendo-react-grid

Version:

React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package

60 lines (59 loc) 1.7 kB
/** * @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 s from "react"; import { GridContext as c } from "../../utils/GridContext.mjs"; import { GridHeaderRowContext as u } from "./GridHeaderRowContainer.mjs"; import { cloneReactElement as a } from "../../utils/index.mjs"; const f = (e) => { const n = s.useContext(c), l = s.useContext(u), i = n.isClient || e.isClient, C = { style: { ...n.getCellPositionStyle(e.column) } }, r = { onKeyDown: (t) => { l.cellKeyDown(t, e.column); }, onContextMenu: (t) => { n.onContextMenu(t, void 0, e.column.field); } }; let o = { onClick: (t) => { l.cellClick(t, e.column); } }; return i && (o = { ...o, selectionChange: n.onHeaderSelectionChange, columnMenuWrapperProps: { ...e.columnMenuWrapperProps, onSortChange: n.sortChange, onFilterChange: n.filterChange, onGroupChange: n.groupChange, onColumnsStateChange: n.onColumnsStateChange, show: l.showColumnMenuField === e.column.field ? !0 : void 0, onCloseMenu: l.handleCloseMenu, columnsState: n.columnsState } }), e.isCustom && (i ? o = { ...o, thProps: { ...e.thProps, ...r, ...C } } : o = { ...o, ...r, ...C }), a(e.children, { ...o }); }; export { f as GridHeaderCellContainer };