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

73 lines (72 loc) 2.06 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import * as n from "react"; import { useCustomComponent as m, useMouse as u, classNames as v, IconWrap as s } from "@progress/kendo-react-common"; import { chevronUpIcon as f, chevronDownIcon as I } from "@progress/kendo-svg-icons"; const h = n.forwardRef( (e, o) => { const t = n.useRef(null), a = n.useRef(null); n.useImperativeHandle(t, () => ({ element: a.current, props: e })), n.useImperativeHandle( o, () => t.current ); const [c, d] = m(e.icon || x.icon), l = u( e, t ), i = (r) => { e.onIconClick && e.onIconClick.call(void 0, { syntheticEvent: r.syntheticEvent, target: t.current }); }; return /* @__PURE__ */ n.createElement( "th", { ref: a, ...l, 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: v( "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 && /* @__PURE__ */ n.createElement( c, { ...d, onClick: i, name: `chevron-${e.expanded ? "up" : "down"}`, "aria-hidden": !0, icon: e.expanded ? f : I } ), e.children ); } ), x = { icon: s }; h.displayName = "KendoReactPivotGridHeaderCell"; export { h as PivotGridHeaderCell };