UNPKG

@progress/kendo-react-pivotgrid

Version:

React PivotGrid (also called Pivot Table) can be data-bound to an OLAP service and customized extensively. KendoReact PivotGrid package

9 lines (8 loc) 1.79 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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),o=require("@progress/kendo-react-common"),l=require("@progress/kendo-svg-icons");function v(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const c=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(a,n,c.get?c:{enumerable:!0,get:()=>e[n]})}}return a.default=e,Object.freeze(a)}const t=v(f),r=t.forwardRef((e,a)=>{const n=t.useRef(null),c=t.useRef(null);t.useImperativeHandle(n,()=>({element:c.current,props:e})),t.useImperativeHandle(a,()=>n.current);const[d,i]=o.useCustomComponent(e.icon||g.icon),u=o.useMouse(e,n),s=m=>{e.onIconClick&&e.onIconClick.call(void 0,{syntheticEvent:m.syntheticEvent,target:n.current})};return t.createElement("th",{ref:c,...u,colSpan:e.colSpan,rowSpan:e.rowSpan,id:e.id,style:e.style,tabIndex:e.tabIndex,role:e.role,...e.expandable?{"aria-expanded":e.expanded}:{},className:o.classNames("k-pivotgrid-cell",{"k-pivotgrid-header-total":e.total,"k-pivotgrid-header-root":e.root,"k-pivotgrid-expanded":e.expanded,"k-first":e.first},e.className)},e.expandable&&t.createElement(d,{...i,onClick:s,name:`chevron-${e.expanded?"up":"down"}`,"aria-hidden":!0,icon:e.expanded?l.chevronUpIcon:l.chevronDownIcon}),e.children)}),g={icon:o.IconWrap};r.displayName="KendoReactPivotGridHeaderCell";exports.PivotGridHeaderCell=r;