@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
49 lines (48 loc) • 1.76 kB
JavaScript
/**
* @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 e from "react";
import { ChipList as f } from "@progress/kendo-react-buttons";
import { useCustomComponent as v, canUseRef as x } from "@progress/kendo-react-common";
import { PivotGridConfiguratorEditorAxesContext as h } from "./EditorContext.mjs";
import { PivotGridAxisEditor as C } from "./AxisEditor.mjs";
const L = e.forwardRef(
(i, l) => {
const { value: m = a.value, field: c } = i, r = e.useRef(null), n = e.useRef(null), o = e.useRef(null), [s, u] = v(
i.chipList || a.chipList
);
e.useImperativeHandle(
n,
() => r.current && r.current.element
), e.useImperativeHandle(o, () => ({ props: i, element: n.current })), e.useImperativeHandle(
l,
() => o.current
);
const d = m.filter((t) => t.name.length === 1 && t.name.every((p) => p.indexOf("&") === -1)).map((t) => ({ ...t, text: String(t.name) }));
return /* @__PURE__ */ e.createElement(h.Provider, { value: { axes: c } }, /* @__PURE__ */ e.createElement(
s,
{
ref: x(s) ? r : void 0,
textField: "text",
valueField: "name",
data: d,
chip: C,
style: { position: "relative" },
className: i.className,
selection: "none",
...u
}
));
}
), a = {
value: [],
chipList: f
};
L.displayName = "KendoReactPivotGridAxesEditor";
export {
L as PivotGridAxesEditor
};