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) 2 kB
/** * @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"; "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react"),K=require("@progress/kendo-react-common"),w=require("@progress/kendo-react-data-tools");function O(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const d=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(t,l,d.get?d:{enumerable:!0,get:()=>e[l]})}}return t.default=e,Object.freeze(t)}const c=O(E),j=e=>{const{header:t,children:l,isInEdit:d,editMode:m,className:f,columnIndex:k,id:y,style:g,onClick:C,onKeyDown:b,cellRef:a}=e,o=c.useRef(null),[s,r]=c.useState(!1),h=K.classNames("k-grid-stack-cell",f,{"k-focus":s,"k-grid-stack-edit-cell":d}),N=s?0:-1,R=n=>{const i=o.current;i&&w.handleStackedKeyboardNavigation({event:n,cellElement:i,onKeyDown:b,isInEdit:d,editMode:m})},S=()=>{r(!0)},I=n=>{var i;(i=o.current)!=null&&i.contains(n.relatedTarget)||r(!1)},D=c.useCallback(n=>{o.current=n,typeof a=="function"?a(n):a&&"current"in a&&(a.current=n)},[a]);return c.createElement("div",{ref:D,className:h,"data-grid-col-index":k,id:y,style:g,tabIndex:N,onClick:C,onKeyDown:R,onFocus:S,onBlur:I},t&&c.createElement("div",{className:"k-grid-stack-header"},t),c.createElement("div",{className:"k-grid-stack-content"},l))},u=c.memo(j,(e,t)=>e.header===t.header&&e.children===t.children&&e.isInEdit===t.isInEdit&&e.editMode===t.editMode&&e.className===t.className&&e.columnIndex===t.columnIndex&&e.id===t.id&&e.style===t.style&&e.onClick===t.onClick&&e.onKeyDown===t.onKeyDown);u.displayName="KendoReactGridStackedCell";exports.GridStackedCell=u;