UNPKG

@progress/kendo-react-grid

Version:

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

10 lines (9 loc) 1.82 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"; "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react"),f=require("@progress/kendo-react-data-tools"),g=require("../../GridClientWrapper.js"),c=require("../../utils/index.js");function P(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const l=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,l.get?l:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const i=P(m),x=e=>{var d;const{cellProps:t}=e,n=i.useContext(g.GridContext),l=f.useTableKeyboardNavigation(t.id),s={onContextMenu:i.useCallback(o=>{n!=null&&n.onContextMenu&&n.onContextMenu.call(void 0,o,t.dataItem,t.field)},[n,t.dataItem,t.field])},u=n.getCellPositionStyle(t.columnPosition),C={style:{...(d=e.tdProps)==null?void 0:d.style,...u}},r={...l,...s,...C},a={onContextMenu:n.onContextMenu,onChange:n.itemChange,selectionChange:o=>{n.selectionChange({event:o,dataItem:t.dataItem,dataIndex:t.rowDataIndex,columnIndex:t.columnIndex})}};if(e.isCustom)return n.isClient||e.isClient?c.cloneReactElement(e.children,{tdProps:{...e.tdProps,...r},...a}):c.cloneReactElement(e.children,{...r});if(t.render){const o=t.rowType!=="groupHeader"?i.createElement("td",{...e.tdProps,...r},e.content):null;return t.render.call(void 0,o,{...t,...a})}return e.children&&c.cloneReactElement(e.children,{...r})};exports.GridSelectionCellContainer=x;