@progress/kendo-react-pivotgrid 7.2.4-develop.3 → 7.3.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PivotGrid.js +8 -0
- package/PivotGrid.mjs +252 -0
- package/components/AxesEditor.js +8 -0
- package/components/AxesEditor.mjs +43 -0
- package/components/AxisEditor.js +8 -0
- package/components/AxisEditor.mjs +108 -0
- package/components/AxisFilterFieldsEditor.js +8 -0
- package/components/AxisFilterFieldsEditor.mjs +159 -0
- package/components/Cell.js +8 -0
- package/components/Cell.mjs +45 -0
- package/components/Column.js +8 -0
- package/components/Column.mjs +40 -0
- package/components/Configurator.js +8 -0
- package/components/Configurator.mjs +134 -0
- package/components/ConfiguratorButton.js +8 -0
- package/components/ConfiguratorButton.mjs +42 -0
- package/components/ConfiguratorEditor.js +8 -0
- package/components/ConfiguratorEditor.mjs +240 -0
- package/components/Container.js +8 -0
- package/components/Container.mjs +40 -0
- package/components/EditorContext.js +8 -0
- package/components/EditorContext.mjs +13 -0
- package/components/FieldsEditor.js +8 -0
- package/components/FieldsEditor.mjs +78 -0
- package/components/HeaderCell.js +8 -0
- package/components/HeaderCell.mjs +69 -0
- package/components/Row.js +8 -0
- package/components/Row.mjs +42 -0
- package/dist/cdn/js/kendo-react-pivotgrid.js +8 -5
- package/hooks/useExpansion.js +8 -0
- package/hooks/useExpansion.mjs +46 -0
- package/hooks/useHeaders.js +8 -0
- package/hooks/useHeaders.mjs +18 -0
- package/hooks/useHorizontalScrollSync.js +8 -0
- package/hooks/useHorizontalScrollSync.mjs +25 -0
- package/hooks/usePivotConfiguratorEditor.js +8 -0
- package/hooks/usePivotConfiguratorEditor.mjs +67 -0
- package/hooks/usePivotLocalDataService.js +8 -0
- package/hooks/usePivotLocalDataService.mjs +94 -0
- package/hooks/usePivotOLAPService.js +8 -0
- package/hooks/usePivotOLAPService.mjs +230 -0
- package/hooks/useVerticalScrollSync.js +8 -0
- package/hooks/useVerticalScrollSync.mjs +25 -0
- package/index.d.mts +1342 -5
- package/index.d.ts +1342 -22
- package/index.js +8 -5
- package/index.mjs +46 -1583
- package/messages/index.js +8 -0
- package/messages/index.mjs +39 -0
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +19 -0
- package/package.json +9 -9
- package/shared/PivotGridConfiguratorEditorEventsContext.js +8 -0
- package/shared/PivotGridConfiguratorEditorEventsContext.mjs +13 -0
- package/shared/PivotGridConfiguratorEditorStateContext.js +8 -0
- package/shared/PivotGridConfiguratorEditorStateContext.mjs +28 -0
- package/utils/index.js +8 -0
- package/utils/index.mjs +59 -0
- package/PivotGrid.d.ts +0 -181
- package/components/AxesEditor.d.ts +0 -44
- package/components/AxisEditor.d.ts +0 -56
- package/components/AxisFilterFieldsEditor.d.ts +0 -118
- package/components/Cell.d.ts +0 -69
- package/components/Column.d.ts +0 -46
- package/components/Configurator.d.ts +0 -129
- package/components/ConfiguratorButton.d.ts +0 -44
- package/components/ConfiguratorEditor.d.ts +0 -130
- package/components/Container.d.ts +0 -50
- package/components/EditorContext.d.ts +0 -11
- package/components/FieldsEditor.d.ts +0 -78
- package/components/HeaderCell.d.ts +0 -100
- package/components/Row.d.ts +0 -54
- package/hooks/index.d.ts +0 -6
- package/hooks/useExpansion.d.ts +0 -23
- package/hooks/useHeaders.d.ts +0 -16
- package/hooks/useHorizontalScrollSync.d.ts +0 -9
- package/hooks/usePivotConfiguratorEditor.d.ts +0 -87
- package/hooks/usePivotLocalDataService.d.ts +0 -83
- package/hooks/usePivotOLAPService.d.ts +0 -45
- package/hooks/useVerticalScrollSync.d.ts +0 -9
- package/messages/index.d.ts +0 -74
- package/models/index.d.ts +0 -48
- package/package-metadata.d.ts +0 -9
- package/shared/PivotGridConfiguratorEditorEventsContext.d.ts +0 -17
- package/shared/PivotGridConfiguratorEditorStateContext.d.ts +0 -10
- package/shared/index.d.ts +0 -6
- package/utils/index.d.ts +0 -51
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as t from "react";
|
|
10
|
+
import { TreeViewItemPropsContext as V, TreeView as D } from "@progress/kendo-react-treeview";
|
|
11
|
+
import { useCustomComponent as h, canUseRef as R } from "@progress/kendo-react-common";
|
|
12
|
+
import { extractDefaultFields as d, flatMap as T, recursiveMap as f } from "../utils/index.mjs";
|
|
13
|
+
import { PivotGridConfiguratorEditorStateContext as b } from "../shared/PivotGridConfiguratorEditorStateContext.mjs";
|
|
14
|
+
const I = t.forwardRef((r, p) => {
|
|
15
|
+
const {
|
|
16
|
+
data: x,
|
|
17
|
+
rowAxes: C,
|
|
18
|
+
columnAxes: v,
|
|
19
|
+
measureAxes: g,
|
|
20
|
+
onExpand: m,
|
|
21
|
+
onCheck: s
|
|
22
|
+
} = { ...i, ...r }, c = t.useRef(null), n = t.useRef(null), [l, E] = h(r.treeView || i.treeView), [y, N] = h(r.noData || i.noData);
|
|
23
|
+
t.useImperativeHandle(n, () => ({ props: r, element: c.current && c.current.element })), t.useImperativeHandle(p, () => n.current);
|
|
24
|
+
const [w] = t.useContext(b), k = d(v), H = d(C), P = d(g), q = T(x).filter((e) => [
|
|
25
|
+
...k,
|
|
26
|
+
...H,
|
|
27
|
+
...P
|
|
28
|
+
].some((a) => a === e.uniqueName || a === e.defaultHierarchy)), u = {
|
|
29
|
+
caption: (e) => e.dataItem.caption,
|
|
30
|
+
id: (e) => e.dataItem.uniqueName,
|
|
31
|
+
value: (e) => e.dataItem.defaultHierarchy || e.dataItem.uniqueName,
|
|
32
|
+
expanded: (e) => w.expanded.some((a) => a.uniqueName === e.dataItem.uniqueName),
|
|
33
|
+
hasChildren: (e) => !("hierarchyUniqueName" in e.dataItem) && !("aggregator" in e.dataItem),
|
|
34
|
+
selectable: (e) => !(!e.hasChildren && !e.dataItem.aggregator && !e.dataItem.measure || e.dataItem.type === 2 || e.dataItem.uniqueName === "[KPIs]"),
|
|
35
|
+
children: (e) => f(e.dataItem.children, u, e),
|
|
36
|
+
checked: (e) => q.some((a) => e.dataItem.defaultHierarchy ? a.defaultHierarchy === e.dataItem.defaultHierarchy : a.uniqueName === e.dataItem.uniqueName) || e.children.length && e.children.every((a) => a.checked)
|
|
37
|
+
}, F = (e) => {
|
|
38
|
+
m && m({
|
|
39
|
+
value: e.item.dataItem,
|
|
40
|
+
target: n.current,
|
|
41
|
+
syntheticEvent: e.syntheticEvent
|
|
42
|
+
});
|
|
43
|
+
}, A = (e) => {
|
|
44
|
+
s && s({
|
|
45
|
+
value: e.item.dataItem,
|
|
46
|
+
target: n.current,
|
|
47
|
+
syntheticEvent: e.syntheticEvent
|
|
48
|
+
});
|
|
49
|
+
}, o = f(r.data, u);
|
|
50
|
+
return /* @__PURE__ */ t.createElement(V.Provider, { value: (e) => ({ ...e, checkboxes: e.item.selectable }) }, o && o.length ? /* @__PURE__ */ t.createElement(
|
|
51
|
+
l,
|
|
52
|
+
{
|
|
53
|
+
ref: R(l) ? c : void 0,
|
|
54
|
+
data: o,
|
|
55
|
+
checkboxes: !0,
|
|
56
|
+
onExpandChange: F,
|
|
57
|
+
onCheckChange: A,
|
|
58
|
+
textField: "caption",
|
|
59
|
+
expandIcons: !0,
|
|
60
|
+
hasChildrenField: "hasChildren",
|
|
61
|
+
checkIndeterminateField: "checkIndeterminate",
|
|
62
|
+
childrenField: "children",
|
|
63
|
+
...E
|
|
64
|
+
}
|
|
65
|
+
) : /* @__PURE__ */ t.createElement(y, { ...N }));
|
|
66
|
+
}), i = {
|
|
67
|
+
data: [],
|
|
68
|
+
rowAxes: [],
|
|
69
|
+
columnAxes: [],
|
|
70
|
+
measureAxes: [],
|
|
71
|
+
treeView: D,
|
|
72
|
+
noData: () => /* @__PURE__ */ t.createElement("div", null, "NO DATA")
|
|
73
|
+
};
|
|
74
|
+
I.defaultProps = i;
|
|
75
|
+
I.displayName = "KendoReactPivotGridFieldsEditor";
|
|
76
|
+
export {
|
|
77
|
+
I as PivotGridFieldsEditor
|
|
78
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react"),o=require("@progress/kendo-react-common"),r=require("@progress/kendo-svg-icons");function g(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,c.get?c:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const n=g(v),l=n.forwardRef((e,a)=>{const t=n.useRef(null),c=n.useRef(null);n.useImperativeHandle(t,()=>({element:c.current,props:e})),n.useImperativeHandle(a,()=>t.current);const[i,u]=o.useCustomComponent(e.icon||d.icon),s=o.useMouse(e,t),m=f=>{e.onIconClick&&e.onIconClick.call(void 0,{syntheticEvent:f.syntheticEvent,target:t.current})};return n.createElement("th",{ref:c,...s,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&&n.createElement(i,{...u,onClick:m,name:`chevron-${e.expanded?"up":"down"}`,"aria-hidden":!0,icon:e.expanded?r.chevronUpIcon:r.chevronDownIcon}),e.children)}),d={icon:o.IconWrap};l.defaultProps=d;l.displayName="KendoReactPivotGridHeaderCell";exports.PivotGridHeaderCell=l;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as n from "react";
|
|
10
|
+
import { useCustomComponent as s, useMouse as v, classNames as f, IconWrap as I } from "@progress/kendo-react-common";
|
|
11
|
+
import { chevronUpIcon as h, chevronDownIcon as x } from "@progress/kendo-svg-icons";
|
|
12
|
+
const o = n.forwardRef((e, d) => {
|
|
13
|
+
const t = n.useRef(null), a = n.useRef(null);
|
|
14
|
+
n.useImperativeHandle(t, () => ({
|
|
15
|
+
element: a.current,
|
|
16
|
+
props: e
|
|
17
|
+
})), n.useImperativeHandle(d, () => t.current);
|
|
18
|
+
const [l, i] = s(e.icon || c.icon), r = v(
|
|
19
|
+
e,
|
|
20
|
+
t
|
|
21
|
+
), m = (u) => {
|
|
22
|
+
e.onIconClick && e.onIconClick.call(void 0, {
|
|
23
|
+
syntheticEvent: u.syntheticEvent,
|
|
24
|
+
target: t.current
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
return /* @__PURE__ */ n.createElement(
|
|
28
|
+
"th",
|
|
29
|
+
{
|
|
30
|
+
ref: a,
|
|
31
|
+
...r,
|
|
32
|
+
colSpan: e.colSpan,
|
|
33
|
+
rowSpan: e.rowSpan,
|
|
34
|
+
id: e.id,
|
|
35
|
+
style: e.style,
|
|
36
|
+
tabIndex: e.tabIndex,
|
|
37
|
+
role: e.role,
|
|
38
|
+
...e.expandable ? { "aria-expanded": e.expanded } : {},
|
|
39
|
+
className: f(
|
|
40
|
+
"k-pivotgrid-cell",
|
|
41
|
+
{
|
|
42
|
+
"k-pivotgrid-header-total": e.total,
|
|
43
|
+
"k-pivotgrid-header-root": e.root,
|
|
44
|
+
"k-pivotgrid-expanded": e.expanded,
|
|
45
|
+
"k-first": e.first
|
|
46
|
+
},
|
|
47
|
+
e.className
|
|
48
|
+
)
|
|
49
|
+
},
|
|
50
|
+
e.expandable && /* @__PURE__ */ n.createElement(
|
|
51
|
+
l,
|
|
52
|
+
{
|
|
53
|
+
...i,
|
|
54
|
+
onClick: m,
|
|
55
|
+
name: `chevron-${e.expanded ? "up" : "down"}`,
|
|
56
|
+
"aria-hidden": !0,
|
|
57
|
+
icon: e.expanded ? h : x
|
|
58
|
+
}
|
|
59
|
+
),
|
|
60
|
+
e.children
|
|
61
|
+
);
|
|
62
|
+
}), c = {
|
|
63
|
+
icon: I
|
|
64
|
+
};
|
|
65
|
+
o.defaultProps = c;
|
|
66
|
+
o.displayName = "KendoReactPivotGridHeaderCell";
|
|
67
|
+
export {
|
|
68
|
+
o as PivotGridHeaderCell
|
|
69
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react"),c=require("@progress/kendo-react-common");function s(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const n=s(i),o=n.forwardRef((e,r)=>{const t=n.useRef(null),a=n.useRef(null);n.useImperativeHandle(t,()=>({element:a.current,props:e})),n.useImperativeHandle(r,()=>t.current);const l=c.useMouse(e,t);return n.createElement("tr",{ref:a,...l,id:e.id,style:e.style,tabIndex:e.tabIndex,children:e.children,role:e.role,"aria-owns":e.ariaOwns,className:c.classNames("k-pivotgrid-row",e.className)})});o.displayName="KendoReactPivotGridRow";exports.PivotGridRow=o;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as t from "react";
|
|
10
|
+
import { useMouse as i, classNames as s } from "@progress/kendo-react-common";
|
|
11
|
+
const c = t.forwardRef((e, r) => {
|
|
12
|
+
const a = t.useRef(null), n = t.useRef(null);
|
|
13
|
+
t.useImperativeHandle(a, () => ({
|
|
14
|
+
element: n.current,
|
|
15
|
+
props: e
|
|
16
|
+
})), t.useImperativeHandle(r, () => a.current);
|
|
17
|
+
const l = i(
|
|
18
|
+
e,
|
|
19
|
+
a
|
|
20
|
+
);
|
|
21
|
+
return /* @__PURE__ */ t.createElement(
|
|
22
|
+
"tr",
|
|
23
|
+
{
|
|
24
|
+
ref: n,
|
|
25
|
+
...l,
|
|
26
|
+
id: e.id,
|
|
27
|
+
style: e.style,
|
|
28
|
+
tabIndex: e.tabIndex,
|
|
29
|
+
children: e.children,
|
|
30
|
+
role: e.role,
|
|
31
|
+
"aria-owns": e.ariaOwns,
|
|
32
|
+
className: s(
|
|
33
|
+
"k-pivotgrid-row",
|
|
34
|
+
e.className
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
});
|
|
39
|
+
c.displayName = "KendoReactPivotGridRow";
|
|
40
|
+
export {
|
|
41
|
+
c as PivotGridRow
|
|
42
|
+
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
(function(A,me){typeof exports=="object"&&typeof module!="undefined"?me(exports,require("react"),require("@progress/kendo-react-common"),require("@progress/kendo-react-intl"),require("@progress/kendo-pivotgrid-common"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-buttons"),require("@progress/kendo-react-form"),require("@progress/kendo-react-labels"),require("@progress/kendo-react-data-tools"),require("@progress/kendo-react-treeview"),require("@progress/kendo-react-indicators")):typeof define=="function"&&define.amd?define(["exports","react","@progress/kendo-react-common","@progress/kendo-react-intl","@progress/kendo-pivotgrid-common","@progress/kendo-svg-icons","@progress/kendo-react-buttons","@progress/kendo-react-form","@progress/kendo-react-labels","@progress/kendo-react-data-tools","@progress/kendo-react-treeview","@progress/kendo-react-indicators"],me):(A=typeof globalThis!="undefined"?globalThis:A||self,me(A.KendoReactPivotgrid={},A.React,A.KendoReactCommon,A.KendoReactIntl,A.KendoPivotgridCommon,A.KendoSvgIcons,A.KendoReactButtons,A.KendoReactForm,A.KendoReactLabels,A.KendoReactDataTools,A.KendoReactTreeview,A.KendoReactIndicators))})(this,function(A,me,c,fe,b,pe,ie,ne,ge,Ee,Te,vt){"use strict";"use client";function xt(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(a,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return a.default=e,Object.freeze(a)}const t=xt(me),pt={name:"@progress/kendo-react-pivotgrid",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},De="pivotgrid.emptyCellAriaLabel",He="pivotgrid.fieldMenuReset",Re="pivotgrid.fieldMenuApply",Ge="pivotgrid.configuratorTitle",Oe="pivotgrid.configuratorCancel",qe="pivotgrid.configuratorApply",Ke="pivotgrid.configuratorColumnsTitle",ke="pivotgrid.configuratorRowsTitle",ze="pivotgrid.configuratorMeasuresTitle",Be="pivotgrid.configuratorEditorSearchTitle",Et="pivotgrid.configuratorEditorSearchPlaceholder",re="pivotgrid.configuratorMissingFields",Ue="pivotgrid.configuratorButtonLabel",Z={[De]:"PivotGrid component. Use the arrow keys to navigate.",[He]:"Reset",[Re]:"Apply",[Oe]:"Cancel",[qe]:"Apply",[Ge]:"Settings",[Be]:"Fields",[Et]:"Search...",[Ke]:"Columns",[ke]:"Rows",[ze]:"Values",[Ue]:"Change settings",[re]:"Select some fields to begin setup"},Ve=t.forwardRef((e,a)=>{const n=t.useRef(null),r=t.useRef(null);t.useImperativeHandle(n,()=>({element:r.current,props:e})),t.useImperativeHandle(a,()=>n.current);const s=c.useMouse(e,n);return t.createElement("tr",{ref:r,...s,id:e.id,style:e.style,tabIndex:e.tabIndex,children:e.children,role:e.role,"aria-owns":e.ariaOwns,className:c.classNames("k-pivotgrid-row",e.className)})});Ve.displayName="KendoReactPivotGridRow";const je=t.forwardRef((e,a)=>{const n=t.useRef(null),r=t.useRef(null);t.useImperativeHandle(n,()=>({element:r.current,props:e})),t.useImperativeHandle(a,()=>n.current);const s=c.useMouse(e,n);return t.createElement("td",{ref:r,...s,id:e.id,style:e.style,tabIndex:e.tabIndex,role:e.role,"aria-describedby":e.ariaDescribedby,className:c.classNames("k-pivotgrid-cell",{"k-pivotgrid-header-total":e.total},e.className)},e.children)});je.displayName="KendoReactPivotGridCell";const et=(e,a,n)=>[e,(s,l)=>{const m=b.headersReducer(e,{...s,tree:a});n&&n(m,l)}],Ce=t.forwardRef((e,a)=>{const n=t.useRef(null),r=t.useRef(null);t.useImperativeHandle(n,()=>({element:r.current,props:e})),t.useImperativeHandle(a,()=>n.current);const[s,l]=c.useCustomComponent(e.icon||tt.icon),m=c.useMouse(e,n),i=C=>{e.onIconClick&&e.onIconClick.call(void 0,{syntheticEvent:C.syntheticEvent,target:n.current})};return t.createElement("th",{ref:r,...m,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:c.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(s,{...l,onClick:i,name:`chevron-${e.expanded?"up":"down"}`,"aria-hidden":!0,icon:e.expanded?pe.chevronUpIcon:pe.chevronDownIcon}),e.children)}),tt={icon:c.IconWrap};Ce.defaultProps=tt,Ce.displayName="KendoReactPivotGridHeaderCell";const Ct=(...e)=>{const a=t.useRef();return r=>{a.current!==void 0&&window.cancelAnimationFrame(a.current);const s=r.currentTarget,l=s.scrollLeft;e.forEach(m=>{const i=m.current;i&&i!==s&&(a.current=window.requestAnimationFrame(()=>{i.scrollLeft=Math.round(l)}))})}},At=(...e)=>{const a=t.useRef();return r=>{a.current!==void 0&&window.cancelAnimationFrame(a.current);const s=r.currentTarget,l=s.scrollTop;e.forEach(m=>{const i=m.current;i&&i!==s&&(a.current=window.requestAnimationFrame(()=>{i.scrollTop=Math.round(l)}))})}},Ae=t.forwardRef((e,a)=>{const n=t.useRef(null),r=t.useRef(null);t.useImperativeHandle(n,()=>({element:r.current,props:e})),t.useImperativeHandle(a,()=>n.current);const s=c.useMouse(e,n);return t.createElement("col",{ref:r,...s,id:e.id,style:e.style,tabIndex:e.tabIndex,children:e.children,className:e.className})}),yt={path:[]};Ae.defaultProps=yt,Ae.displayName="KendoReactPivotGridColumn";const wt=(e,a,n)=>{const r=JSON.parse(JSON.stringify(e||[])),s=JSON.parse(JSON.stringify(a||[])),l=JSON.parse(JSON.stringify(n||[])),m=b.toTree(r),[,i,C]=b.toRows(m),f=b.toTree(s),[,x,,F]=b.toColumns(f);return b.toData(l,x,i,F,C)},ye=(e=[],a={},n=null)=>e.map(r=>{const s={dataItem:r};return Object.keys(a).forEach(l=>{s[l]=a[l](s,n)}),s}),$e=(e=[])=>{let a=[...e];return(e||[]).forEach(n=>{a=a.concat($e(n.children))}),a},_e=(e=[])=>{const a=new Set;return e.forEach(n=>{a.add(String(n.name))}),Array.from(a)},oe=(e=[])=>`${e.join(",")}`,Ft=(e,a)=>`${oe(e.map(n=>n.name))}|${oe(a.map(n=>n.name))}`,bt=(e,a,n)=>{if(!e)return;let r=0,s,l=e.length,m;for(;r<l;r++)m=e[r].operator,(!n&&m!=="in"||m===n)&&e[r].field===a&&(s=e[r]);return s},nt=(e,a,n)=>{if(!e)return[];let r=0,s=[],l=e.length,m;for(;r<l;r++)m=e[r].operator,(!n&&m!=="in"||m===n)&&e[r].field===a&&s.push(e[r]);return s},at=(e,a)=>e.uniqueName===a.uniqueName,rt=t.forwardRef((e,a)=>{c.validatePackage(pt);const{rows:n,rowAxes:r,columns:s,columnAxes:l,data:m}={...he,...e},i=t.useRef(null),C=t.useRef(null),f=t.useRef(null),x=t.useRef(null),F=t.useRef(null),k=t.useRef(null),D=t.useRef(null),j=fe.useLocalization(),G=(v,M)=>{e.onRowAxesChange&&e.onRowAxesChange({value:v,target:C.current,syntheticEvent:M})},$=(v,M)=>{e.onColumnAxesChange&&e.onColumnAxesChange({value:v,target:C.current,syntheticEvent:M})},_=b.toTree((n||[]).slice()),[,p]=et((r||[]).slice(),_,G),[L,g,U,V]=b.toRows(_),O=b.toTree((s||[]).slice()),[,u]=et((l||[]).slice(),O,$),[y,H,,P]=b.toColumns(O),w=b.toData((m||[]).slice(),H,g,P,U);t.useImperativeHandle(C,()=>({props:e,element:i.current,columnHeaderRows:y,rowHeaderRows:L,dataCells:w,rowHeaderBreadth:V,columnHeaderBreadth:P})),t.useImperativeHandle(a,()=>C.current);const J=[],W=[],o=[],[h,E]=c.useCustomComponent(e.row||he.row),[N,T]=c.useCustomComponent(e.column||he.column),[z,X]=c.useCustomComponent(e.cell||he.cell),[d,q]=c.useCustomComponent(e.headerCell||he.headerCell),B=e.columnHeadersRow||h,R=e.columnHeadersColumn||N,ee=e.columnHeadersCell||d,Q=e.rowHeadersRow||h,le=e.rowHeadersColumn||N,Tt=e.rowHeadersCell||d,Dt=e.dataRow||h,Ht=e.dataColumn||N;for(let v=0;v<H.length;v++)J.push(t.createElement(Ht,{key:String(H[v].path),...T,path:H[v].path})),o.push(t.createElement(R,{key:String(H[v].path),...T,path:H[v].path}));for(let v=0;v<V;v++)W.push(t.createElement(le,{key:v,...T}));const Rt=v=>{v.target.props.expandable&&u({type:b.HEADERS_ACTION.toggle,payload:v.target.props.dataItem.path},v.syntheticEvent)},Gt=v=>{v.target.props.expandable&&p({type:b.HEADERS_ACTION.toggle,payload:v.target.props.dataItem.path},v.syntheticEvent)},ft=Ct(D,k),Ot=At(D,F),qt=v=>{ft(v),Ot(v)},gt=t.useCallback(()=>{i.current&&x.current&&(i.current.style.gridTemplateRows="",i.current.style.gridTemplateRows=`${x.current.offsetHeight}px 1fr`)},[]),ht=t.useCallback(()=>{i.current&&f.current&&(i.current.style.gridTemplateColumns="",i.current.style.gridTemplateColumns=`${f.current.offsetWidth}px 1fr`)},[]),ce=t.useRef(new b.PivotGridNavigation({tabIndex:e.tabIndex||0}));t.useEffect(()=>{if(i.current){const v=e.tabIndex||0;if(ce.current.stop(),ce.current.tabIndex=v,e.navigatable){ce.current.start(i.current);const M=ce.current.first;M&&M.setAttribute("tabindex",String(v))}}return()=>{ce.current.stop()}},[e.tabIndex,e.navigatable]),t.useEffect(()=>{ce.current.update()}),t.useEffect(()=>{if(x.current){const v=new window.ResizeObserver(gt);return v.observe(x.current),()=>{v.disconnect()}}},[gt]),t.useEffect(()=>{if(f.current){const v=new window.ResizeObserver(ht);return v.observe(f.current),()=>{v.disconnect()}}},[ht]),c.useIsomorphicLayoutEffect(()=>{if(c.setScrollbarWidth(),f.current){const v=new window.ResizeObserver(c.setScrollbarWidth);return v.observe(f.current),()=>{v.disconnect()}}},[]);const ue=new Array(y.length).fill([]).map(()=>new Array(H.length));y.forEach((v,M)=>{let S=0;Array.from(v.cells).forEach(I=>{const Y=!!(I&&I.children&&I.children.length),Qe=(I?oe(I.normalizedPath)+(I.total?"|[TOTAL]":"")+(Y?"|[EXPANDED]":""):"").replace(/\s/g,"-");if(I)for(let Le=0;Le<(I.colSpan||1);Le++){for(let de=0;de<(I.rowSpan||1);de++){const Kt=ue[M+de].findIndex((kt,zt)=>zt>=S&&!kt);ue[M+de][Kt]=Qe}S++}})});const Me=w.map(v=>v.cells.map(M=>Ft(M.rowTuple.members,M.columnTuple.members).replace(/\s/g,"-")));return t.createElement("div",{ref:i,id:e.id,style:e.style,tabIndex:e.navigatable?void 0:e.tabIndex,className:c.classNames("k-pivotgrid",e.className),role:"grid"},t.createElement("span",{className:"k-pivotgrid-empty-cell"},t.createElement("span",{className:"k-sr-only"},j.toLanguageString(De,Z[De]))),t.createElement("div",{ref:k,className:"k-pivotgrid-column-headers",onScroll:ft},t.createElement("table",{ref:x,className:"k-pivotgrid-table",role:"none"},t.createElement("colgroup",null,o),t.createElement("tbody",{className:"k-pivotgrid-tbody",role:"rowgroup"},y.map((v,M)=>{let S=!1;return t.createElement(B,{key:v.name,role:"row",...E},v.cells.map((I,Y)=>{const Qe=Y!==0&&!S;I&&(S=!0);const Le=I&&!!(I.children&&I.children.length),de=I&&I.hasChildren&&(!I.total||I.total&&I.parent.total);return I?t.createElement(ee,{...q,key:ue[M][Y],"data-key":ue[M][Y],id:ue[M][Y],columnPath:I.normalizedPath,rowSpan:I.rowSpan||void 0,colSpan:I.colSpan||void 0,onIconClick:Rt,dataItem:I,expanded:Le,expandable:de,total:I.total,first:Qe,root:I.levelNum===0,role:"columnheader"},I.caption):null}))})))),t.createElement("div",{ref:F,className:"k-pivotgrid-row-headers"},t.createElement("table",{ref:f,className:"k-pivotgrid-table",role:"none"},t.createElement("colgroup",null,W),t.createElement("tbody",{className:"k-pivotgrid-tbody",role:"rowgroup"},L.map((v,M)=>t.createElement(Q,{key:oe(g[M].path),...E,path:g[M].path,role:"row",ariaOwns:Me[M].join(" ")},v.cells.filter(Boolean).map(S=>S?t.createElement(Tt,{...q,key:oe(S.normalizedPath)+(S.total?"|[TOTAL]":"")+(S.children&&S.children.length?"|[EXPANDED]":""),"data-key":oe(S.normalizedPath)+(S.total?"|[TOTAL]":"")+(S.children&&S.children.length?"|[EXPANDED]":""),rowPath:S.normalizedPath,rowSpan:S.rowSpan||void 0,colSpan:S.colSpan||void 0,dataItem:S,expanded:!!(S.children&&S.children.length),expandable:S.hasChildren&&!S.total,total:S.total,onIconClick:Gt,root:S.levelNum===0,role:"rowheader"},S.caption):null)))))),t.createElement("div",{ref:D,className:"k-pivotgrid-values",onScroll:qt},t.createElement("table",{className:"k-pivotgrid-table",role:"none"},t.createElement("colgroup",null,J),t.createElement("tbody",{className:"k-pivotgrid-tbody",role:"none"},w.map((v,M)=>t.createElement(Dt,{key:oe(g[M].path),...E,path:g[M].path,role:"none"},v.cells.map((S,I)=>t.createElement(z,{key:Me[M][I],"data-key":Me[M][I],id:Me[M][I],...X,rowPath:S.rowTuple.members.map(Y=>Y.name),columnPath:S.columnTuple.members.map(Y=>Y.name),dataItem:S,total:g[M].total||H[I].total,role:"gridcell",ariaDescribedby:ue.map(Y=>Y[I]).join(" ")},S&&S.data&&S.data.fmtValue?S.data.fmtValue:" "))))))))}),he={rowAxes:[],columnAxes:[],data:[],row:Ve,column:Ae,cell:je,headerCell:Ce};rt.displayName="KendoReactPivotGrid";const Xe=t.forwardRef((e,a)=>{const n=t.useRef(null),r=t.useRef(null);return t.useImperativeHandle(r,()=>({props:e,element:n.current})),t.useImperativeHandle(a,()=>r.current),t.createElement("div",{ref:n,id:e.id,style:e.style,tabIndex:e.tabIndex,className:c.classNames("k-d-flex k-pos-relative",{"k-flex-row":e.configuratorPosition==="right","k-flex-row-reverse":e.configuratorPosition==="left","k-flex-column":e.configuratorPosition==="bottom","k-flex-column-reverse":e.configuratorPosition==="top"},e.className)},e.children)}),Nt={configuratorPosition:"right"};Xe.defaultProps=Nt,Xe.displayName="KendoReactPivotGridContainer";const ot=t.createContext({axes:null});var Ze=(e=>(e.toggle="EXPAND_TOGGLE",e.expand="EXPAND_EXPAND",e.collapse="EXPAND_COLLAPSE",e))(Ze||{});const St=(e,a,n)=>{switch(a.type){case"EXPAND_TOGGLE":return Array.isArray(e)?e.find(r=>n(r,a.payload))?[...e.filter(r=>!n(r,a.payload))]:[...e,a.payload]:n(e,a.payload)?null:a.payload;case"EXPAND_EXPAND":if(Array.isArray(e)){if(!e.find(r=>n(r,a.payload)))return[...e,a.payload]}else if(!n(e,a.payload))return a.payload;break;case"EXPAND_COLLAPSE":if(Array.isArray(e)){if(e.find(r=>n(r,a.payload)))return[...e.filter(r=>!n(r,a.payload))]}else n(e,a.payload);break;default:return e}},st=(e=[],a,n,r=(s,l)=>s===l)=>{const[s,l]=t.useState(e);return[s,(i,C)=>{const f=St(s,i,r);a&&a.call(void 0,{value:f,target:n.current,syntheticEvent:C}),l(f)}]};var lt=(e=>(e.toggleExpansion="PIVOT_CONFIGURATOR_ACTION_TOGGLE_EXPANSION",e))(lt||{});const K={...b.PIVOT_CONFIGURATOR_ACTION,...lt},It=(e,a)=>{const n=e.valueGetter("rowAxes"),r=e.valueGetter("columnAxes"),s=e.valueGetter("measureAxes"),l=e.valueGetter("sort"),m=e.valueGetter("filter"),[i,C]=st([],void 0,a,at),[f,x]=t.useState(null),[F,k]=t.useState(null),[D,j]=t.useState(null),[G,$]=t.useState(null);return[{dragItem:f,dropTarget:D,dropZone:F,dropDirection:G,columnAxes:r,rowAxes:n,measureAxes:s,sort:l,filter:m,expanded:i},(p,L)=>{switch(p.type){case K.toggleExpansion:{C({type:Ze.toggle,payload:p.payload},L);break}default:const g=b.configuratorReducer({filter:p.override&&p.override.filter!==void 0?p.override.filter:m,sort:p.override&&p.override.sort!==void 0?p.override.sort:l,rowAxes:p.override&&p.override.rowAxes!==void 0?p.override.rowAxes:n,columnAxes:p.override&&p.override.columnAxes!==void 0?p.override.columnAxes:r,measureAxes:p.override&&p.override.measureAxes!==void 0?p.override.measureAxes:s,dragItem:p.override&&p.override.dragItem!==void 0?p.override.dragItem:f,dropDirection:p.override&&p.override.dropDirection!==void 0?p.override.dropDirection:G,dropTarget:p.override&&p.override.dropTarget!==void 0?p.override.dropTarget:D,dropZone:p.override&&p.override.dropZone!==void 0?p.override.dropZone:F},p);g.columnAxes!==void 0&&e.onChange("columnAxes",{value:g.columnAxes}),g.rowAxes!==void 0&&e.onChange("rowAxes",{value:g.rowAxes}),g.measureAxes!==void 0&&e.onChange("measureAxes",{value:g.measureAxes}),g.sort!==void 0&&e.onChange("sort",{value:g.sort}),g.filter!==void 0&&e.onChange("filter",{value:g.filter}),g.dropDirection!==void 0&&$(g.dropDirection),g.dropTarget!==void 0&&j(g.dropTarget),g.dropZone!==void 0&&k(g.dropZone),g.dragItem!==void 0&&x(g.dragItem);break}}]},it=t.createContext({}),we=t.createContext([{expanded:[],rowAxes:[],columnAxes:[],measureAxes:[],dragItem:null,dropZone:null,dropDirection:null,dropTarget:null},c.noop]),Fe=t.forwardRef((e,a)=>{const{data:n,dataItem:r,defaultFilter:s}={...ae,...e},l=t.useRef(null),m=t.useRef(null),i=fe.useLocalization(),[C,f]=c.useCustomComponent(e.columnMenuItem||ae.columnMenuItem),[x,F]=c.useCustomComponent(e.columnMenuForm||ae.columnMenuForm),[k,D]=c.useCustomComponent(e.resetButton||ae.resetButton),[j,G]=c.useCustomComponent(e.applyButton||ae.applyButton),[$,_]=c.useCustomComponent(e.treeView||ae.treeView),[p,L]=c.useCustomComponent(e.noData||ae.noData);t.useImperativeHandle(m,()=>({props:e,element:l.current})),t.useImperativeHandle(a,()=>m.current);const[g,U]=t.useState(!1),{onAxisFilterFieldsExpandChange:V,onAxisFilterFieldExpand:O}=t.useContext(it),[,u]=t.useContext(we),[y,H]=t.useState(s),P=y?y.value.split(","):[],[w,J]=st([],void 0,m,at),W={caption:d=>d.dataItem.caption,id:d=>d.dataItem.uniqueName,parent:(d,q)=>q&&q.value,value:d=>d.dataItem.defaultHierarchy||d.dataItem.uniqueName,expanded:d=>w.some(q=>q.uniqueName===d.id),checked:d=>!P.length||(P||[]).some(q=>q===d.dataItem.uniqueName),hasChildren:d=>parseInt(d.dataItem.childrenCardinality,10)>0,children:d=>ye(d.dataItem.children,W,d),checkIndeterminate:d=>{const q=(d.children||[]).length&&d.children.every(B=>B.checked);return q&&(d.checked=!0),(d.children||[]).some(B=>B.checked)&&!q}},o=ye(n,W),h=$e(o),E=d=>{U(!g),V&&V({value:!g,target:m.current,syntheticEvent:d})},N=d=>{J({type:Ze.toggle,payload:d.item.dataItem},d.syntheticEvent),O&&O({value:d.item.dataItem,target:m.current,syntheticEvent:d.syntheticEvent})},T=d=>{let q;d.item.checked?q={field:String(r.name),operator:"in",value:h.filter(B=>B.checked).map(B=>String(B.value)).filter(B=>B!==d.item.value&&B!==d.item.parent).join(",")}:q={field:String(r.name),operator:"in",value:h.filter(B=>B.checked).map(B=>String(B.value)).concat([d.item.value]).join(",")},H(q)},z=d=>{U(!1),y&&u({type:K.removeFilter,payload:y},d)},X=d=>{U(!1),y&&u({type:s?K.changeFilter:K.addFilter,payload:y},d)};return t.createElement("div",{ref:l,id:e.id,tabIndex:e.tabIndex,style:e.style,className:c.classNames("k-columnmenu-item-wrapper",e.className)},t.createElement(C,{...f,title:"Include Fields",iconClass:"k-i-grid-layout",svgIcon:pe.gridLayoutIcon,onClick:E}),t.createElement(x,{show:g,actions:t.createElement(t.Fragment,null,t.createElement(k,{type:"reset",onClick:z,...D},i.toLanguageString(He,Z[He])),t.createElement(j,{themeColor:"primary",onClick:X,...G},i.toLanguageString(Re,Z[Re]))),...F},o&&o.length?t.createElement($,{data:o,checkboxes:!0,onExpandChange:N,onCheckChange:T,textField:"caption",expandIcons:!0,hasChildrenField:"hasChildren",checkIndeterminateField:"checkIndeterminate",childrenField:"children",..._}):t.createElement(p,{...L})))}),ae={data:[],resetButton:ie.Button,applyButton:ie.Button,treeView:Te.TreeView,noData:()=>t.createElement(vt.Skeleton,{shape:"rectangle",style:{height:"20px",width:"calc(100% - 16px)",margin:8}}),columnMenuItem:Ee.ColumnMenuItem,columnMenuForm:Ee.ColumnMenuForm};Fe.defaultProps=ae,Fe.displayName="KendoReactPivotGridAxisFilterFieldsEditor";const be=t.forwardRef((e,a)=>{const n=t.useRef(0),r=t.useRef(0),s=t.useRef(null),l=t.useRef(null),m=t.useRef(null),{axes:i}=t.useContext(ot),[C,f]=t.useState(!1),[x,F]=t.useContext(we);t.useImperativeHandle(l,()=>s.current&&s.current.element),t.useImperativeHandle(m,()=>({props:e,element:l.current})),t.useImperativeHandle(a,()=>m.current);const[k,D]=c.useCustomComponent(e.chip||ve.chip),[j,G]=c.useCustomComponent(e.dropClue||ve.dropClue),[$,_]=c.useCustomComponent(e.columnMenuTextColumn||ve.columnMenuTextColumn),[p,L]=c.useCustomComponent(e.filterFieldsEditor||ve.filterFieldsEditor),g=nt(x.filter,String(e.value),"in"),U=nt(x.filter,String(e.value)),V=(o,h)=>{F({type:K.setSort,payload:h},o)},O=(o,h)=>{h.length?F({type:K.setFilter,payload:[...g||[],...h.reduce((E,N)=>[...E,...N.filters.filter(T=>T.value)],[])]},o):F({type:K.setFilter,payload:g},o)},u=o=>{F({type:K.remove,payload:e.dataItem},o.syntheticEvent)},y=o=>{const h=o.slice(),E=bt(x.filter,String(e.dataItem.name),"in");return h.splice(1,0,t.createElement(p,{key:"axis-filter-fields-editor",defaultFilter:E,dataItem:e.dataItem,data:e.dataItem.fields,axes:i,...L})),h},H=o=>{n.current=o.clientX,r.current=o.clientY},P=o=>{Math.abs(n.current-o.clientX)<10&&Math.abs(r.current-o.clientY)<10||(l.current&&(l.current.style.transform=`translate(${o.clientX-n.current}px, ${o.clientY-r.current}px)`),f(!0),F({type:K.setDragItem,payload:e.dataItem}))},w=()=>{f(!1),x.dragItem&&(l.current&&(l.current.style.transform=""),F({type:K.drop,payload:e.dataItem}))},J=o=>{x.dragItem&&(F({type:K.setDropTarget,payload:e.dataItem},o.syntheticEvent),F({type:K.setDropZone,payload:i},o.syntheticEvent))},W=o=>{if(x.dragItem&&!C&&l.current){const h=l.current.getBoundingClientRect(),N=o.syntheticEvent.clientX-h.left<h.width/2?"before":"after";F({type:K.setDropDirection,payload:N},o.syntheticEvent)}};return c.useDraggable(l,{onPress:H,onDrag:P,onRelease:w}),t.createElement(t.Fragment,null,x.dropTarget&&b.compareAxes(x.dropTarget,e.dataItem)&&x.dropDirection==="before"&&t.createElement(j,{...G}),t.createElement(k,{ref:c.canUseRef(k)?s:void 0,...e,removable:!0,onRemove:u,onMouseEnter:J,onMouseMove:W,style:{pointerEvents:C?"none":void 0},rounded:"full",...D},e.text,i!=="measureAxes"&&t.createElement($,{field:String(e.value),itemsRender:y,sort:x.sort,onSortChange:V,filter:U&&U.length?[{logic:"and",filters:U}]:void 0,onFilterChange:O,filterContent:[Ee.ColumnMenuTextFilter],..._})),x.dropTarget&&b.compareAxes(x.dropTarget,e.dataItem)&&x.dropDirection==="after"&&t.createElement(j,{...G}))}),ve={chip:ie.Chip,columnMenuTextColumn:Ee.ColumnMenuTextColumn,filterFieldsEditor:Fe,dropClue:e=>t.createElement("div",{className:"k-grouping-dropclue",style:{position:"relative",zIndex:1e4},...e})};be.defaultProps=ve,be.displayName="KendoReactPivotGridAxisEditor";const se=t.forwardRef((e,a)=>{const{value:n,field:r}={...Je,...e},s=t.useRef(null),l=t.useRef(null),m=t.useRef(null),[i,C]=c.useCustomComponent(e.chipList||Je.chipList);t.useImperativeHandle(l,()=>s.current&&s.current.element),t.useImperativeHandle(m,()=>({props:e,element:l.current})),t.useImperativeHandle(a,()=>m.current);const f=n.filter(x=>x.name.length===1&&x.name.every(F=>F.indexOf("&")===-1)).map(x=>({...x,text:String(x.name)}));return t.createElement(ot.Provider,{value:{axes:r}},t.createElement(i,{ref:c.canUseRef(i)?s:void 0,textField:"text",valueField:"name",data:f,chip:be,style:{position:"relative"},className:e.className,selection:"none",...C}))}),Je={value:[],chipList:ie.ChipList};se.defaultProps=Je,se.displayName="KendoReactPivotGridAxesEditor";const Ne=t.forwardRef((e,a)=>{const{data:n,rowAxes:r,columnAxes:s,measureAxes:l,onExpand:m,onCheck:i}={...Se,...e},C=t.useRef(null),f=t.useRef(null),[x,F]=c.useCustomComponent(e.treeView||Se.treeView),[k,D]=c.useCustomComponent(e.noData||Se.noData);t.useImperativeHandle(f,()=>({props:e,element:C.current&&C.current.element})),t.useImperativeHandle(a,()=>f.current);const[j]=t.useContext(we),G=_e(s),$=_e(r),_=_e(l),L=$e(n).filter(u=>[...G,...$,..._].some(y=>y===u.uniqueName||y===u.defaultHierarchy)),g={caption:u=>u.dataItem.caption,id:u=>u.dataItem.uniqueName,value:u=>u.dataItem.defaultHierarchy||u.dataItem.uniqueName,expanded:u=>j.expanded.some(y=>y.uniqueName===u.dataItem.uniqueName),hasChildren:u=>!("hierarchyUniqueName"in u.dataItem)&&!("aggregator"in u.dataItem),selectable:u=>!(!u.hasChildren&&!u.dataItem.aggregator&&!u.dataItem.measure||u.dataItem.type===2||u.dataItem.uniqueName==="[KPIs]"),children:u=>ye(u.dataItem.children,g,u),checked:u=>L.some(y=>u.dataItem.defaultHierarchy?y.defaultHierarchy===u.dataItem.defaultHierarchy:y.uniqueName===u.dataItem.uniqueName)||u.children.length&&u.children.every(y=>y.checked)},U=u=>{m&&m({value:u.item.dataItem,target:f.current,syntheticEvent:u.syntheticEvent})},V=u=>{i&&i({value:u.item.dataItem,target:f.current,syntheticEvent:u.syntheticEvent})},O=ye(e.data,g);return t.createElement(Te.TreeViewItemPropsContext.Provider,{value:u=>({...u,checkboxes:u.item.selectable})},O&&O.length?t.createElement(x,{ref:c.canUseRef(x)?C:void 0,data:O,checkboxes:!0,onExpandChange:U,onCheckChange:V,textField:"caption",expandIcons:!0,hasChildrenField:"hasChildren",checkIndeterminateField:"checkIndeterminate",childrenField:"children",...F}):t.createElement(k,{...D}))}),Se={data:[],rowAxes:[],columnAxes:[],measureAxes:[],treeView:Te.TreeView,noData:()=>t.createElement("div",null,"NO DATA")};Ne.defaultProps=Se,Ne.displayName="KendoReactPivotGridFieldsEditor";const Ie=t.forwardRef((e,a)=>{const{onFieldsEditorFieldCheck:n,onFieldsEditorFieldCheckAction:r,onFieldsEditorFieldExpand:s,onFieldsEditorFieldExpandAction:l,onAxisFilterFieldExpand:m,onAxisFilterFieldsExpandChange:i}=e,[C,f]=c.useCustomComponent(e.fieldsLabel||te.fieldsLabel),[x,F]=c.useCustomComponent(e.fieldsEditor||te.fieldsEditor),[k,D]=c.useCustomComponent(e.columnAxesLabel||te.columnAxesLabel),[j,G]=c.useCustomComponent(e.columnAxesEditor||te.columnAxesEditor),[$,_]=c.useCustomComponent(e.rowAxesLabel||te.rowAxesLabel),[p,L]=c.useCustomComponent(e.rowAxesEditor||te.rowAxesEditor),[g,U]=c.useCustomComponent(e.measureAxesLabel||te.measureAxesLabel),[V,O]=c.useCustomComponent(e.measureAxesEditor||te.measureAxesEditor),u=t.useRef(null),y=t.useRef(null),H=fe.useLocalization(),[P,w]=It(e,y);t.useImperativeHandle(y,()=>({element:u.current,props:e,state:P})),t.useImperativeHandle(a,()=>y.current);const J=()=>{P.dragItem&&w({type:K.setDropZone,payload:"columnAxes"})},W=()=>{P.dragItem&&w({type:K.setDropZone,payload:null})},o=()=>{P.dragItem&&w({type:K.setDropZone,payload:"rowAxes"})},h=()=>{P.dragItem&&w({type:K.setDropZone,payload:null})},E=()=>{P.dragItem&&w({type:K.setDropZone,payload:"measureAxes"})},N=()=>{P.dragItem&&w({type:K.setDropZone,payload:null})},T=R=>{const ee={target:R.target,currentTarget:y.current,value:R.value,syntheticEvent:R.syntheticEvent};if(l){const Q=l(ee,e,P);Q&&(Array.isArray(Q)?Q.filter(Boolean).map(le=>le&&w({...le},R.syntheticEvent)):w({...Q},R.syntheticEvent))}s&&s({target:R.target,currentTarget:y.current,value:R.value,syntheticEvent:R.syntheticEvent})},z=R=>{const ee={target:R.target,currentTarget:y.current,value:R.value,syntheticEvent:R.syntheticEvent};if(r){const Q=r(ee,e,P);Q&&(Array.isArray(Q)?Q.filter(Boolean).map(le=>le&&w({...le},R.syntheticEvent)):w({...Q},R.syntheticEvent))}n&&n(ee)},X=R=>{const ee={target:R.target,currentTarget:y.current,value:R.value,syntheticEvent:R.syntheticEvent};m&&m(ee)},d=R=>{const ee={target:R.target,currentTarget:y.current,value:R.value,syntheticEvent:R.syntheticEvent};i&&i(ee)},q=e.horizontal?"div":t.Fragment,B=e.horizontal?{className:"k-form-field-wrapper"}:{};return t.createElement(it.Provider,{value:{onAxisFilterFieldExpand:X,onAxisFilterFieldsExpandChange:d}},t.createElement(we.Provider,{value:[P,w]},t.createElement(q,{...B},t.createElement("div",{className:"k-form-field"},t.createElement(C,{name:"",component:ge.Label,...f},H.toLanguageString(Be,Z[Be]))),t.createElement("div",{className:"k-form-field"},t.createElement("div",{className:"k-fields-list-wrapper"},t.createElement(x,{data:e.data,onExpand:T,onCheck:z,columnAxes:P.columnAxes,rowAxes:P.rowAxes,measureAxes:P.measureAxes,...F})))),t.createElement(q,{...B},t.createElement("div",{className:"k-form-field",onMouseEnter:J,onMouseLeave:W},t.createElement(ne.Field,{name:"columnAxes",field:"columnAxes",component:k,...D},H.toLanguageString(Ke,Z[Ke]))),e.valueGetter("columnAxes").length?t.createElement(ne.Field,{name:"columnAxes",field:"columnAxes",component:j,onMouseEnter:J,onMouseLeave:W,className:"k-column-fields",...G}):t.createElement("div",{className:"k-settings-description",onMouseEnter:J,onMouseLeave:W},H.toLanguageString(re,Z[re])),t.createElement("div",{className:"k-form-field",onMouseEnter:o,onMouseLeave:h},t.createElement(ne.Field,{name:"rowAxes",field:"rowAxes",component:$,..._},H.toLanguageString(ke,Z[ke]))),e.valueGetter("rowAxes").length?t.createElement(ne.Field,{name:"rowAxes",field:"rowAxes",component:p,onMouseEnter:o,onMouseLeave:h,className:"k-column-fields",...L}):t.createElement("div",{className:"k-settings-description",onMouseEnter:o,onMouseLeave:h},H.toLanguageString(re,Z[re]))),t.createElement(q,{...B},t.createElement("div",{className:"k-form-field",onMouseEnter:E,onMouseLeave:N},t.createElement(ne.Field,{name:"measureAxes",field:"measureAxes",component:g,...U},H.toLanguageString(ze,Z[ze]))),e.valueGetter("measureAxes").length?t.createElement(ne.Field,{name:"measureAxes",field:"measureAxes",component:V,onMouseEnter:E,onMouseLeave:N,className:"k-column-fields",...O}):t.createElement("div",{className:"k-settings-description",onMouseEnter:E,onMouseLeave:N},H.toLanguageString(re,Z[re])))))}),te={data:[],horizontal:!1,fieldsLabel:ge.Label,fieldsEditor:Ne,columnAxesLabel:ge.Label,columnAxesEditor:se,rowAxesLabel:ge.Label,rowAxesEditor:se,measureAxesLabel:ge.Label,measureAxesEditor:se,axesEditor:se,onFieldsEditorFieldCheckAction:e=>({type:K.toggleSelection,payload:e.value}),onFieldsEditorFieldExpandAction:e=>({type:K.toggleExpansion,payload:e.value})};Ie.defaultProps=te,Ie.displayName="KendoReactPivotGridConfiguratorEditor";const We=t.forwardRef((e,a)=>{const{horizontal:n,data:r,rowAxes:s,columnAxes:l,measureAxes:m}={...xe,...e},i=t.useRef(null),C=t.useRef(null),f=t.useRef(null),x=fe.useLocalization(),[F,k]=c.useCustomComponent(e.editor||xe.editor),[D,j]=c.useCustomComponent(e.form||xe.form),[G,$]=c.useCustomComponent(e.formElement||xe.formElement);t.useImperativeHandle(C,()=>({props:e,element:i.current})),t.useImperativeHandle(a,()=>C.current);const _=(L,g)=>{e.onRowAxesChange&&e.onRowAxesChange({target:C.current,value:L.rowAxes,syntheticEvent:g}),e.onColumnAxesChange&&e.onColumnAxesChange({target:C.current,value:L.columnAxes,syntheticEvent:g}),e.onMeasureAxesChange&&e.onMeasureAxesChange({target:C.current,value:L.measureAxes,syntheticEvent:g}),e.onSortChange&&e.onSortChange({target:C.current,value:L.sort,syntheticEvent:g}),e.onFilterChange&&e.onFilterChange({target:C.current,value:L.filter,syntheticEvent:g})},p={rowAxes:s,columnAxes:l,measureAxes:m,sort:e.sort,filter:e.filter};return t.useEffect(()=>{f.current&&f.current.onChange("rowAxes",{value:s})},[s]),t.useEffect(()=>{f.current&&f.current.onChange("columnAxes",{value:l})},[l]),t.useEffect(()=>{f.current&&f.current.onChange("measureAxes",{value:m})},[m]),t.useEffect(()=>{f.current&&f.current.onChange("sort",{value:e.sort})},[e.sort]),t.useEffect(()=>{f.current&&f.current.onChange("filter",{value:e.filter})},[e.filter]),t.createElement("div",{ref:i,id:e.id,tabIndex:e.tabIndex,style:e.style,className:c.classNames("k-pivotgrid-configurator",e.className)},t.createElement("div",{className:c.classNames("k-pivotgrid-configurator-panel","k-pivotgrid-configurator-push",{"k-pivotgrid-configurator-horizontal":n,"k-pivotgrid-configurator-vertical":!n})},t.createElement("div",{className:"k-pivotgrid-configurator-header"},t.createElement("div",{className:"k-pivotgrid-configurator-header-text"},x.toLanguageString(Ge,Z[Ge]))),t.createElement(D,{ref:c.canUseRef(D)?f:void 0,initialValues:p,onSubmit:_,render:L=>t.createElement(t.Fragment,null,t.createElement("div",{className:"k-pivotgrid-configurator-content"},t.createElement(G,{horizontal:n,...$},t.createElement(F,{...L,horizontal:e.horizontal,onFieldsEditorFieldExpand:e.onFieldsEditorFieldExpand,onFieldsEditorFieldCheck:e.onFieldsEditorFieldCheck,onAxisFilterFieldExpand:e.onAxisFilterFieldExpand,onAxisFilterFieldsExpandChange:e.onAxisFilterFieldsExpandChange,data:r,...k}))),t.createElement("div",{className:"k-pivotgrid-configurator-actions k-actions k-hstack k-justify-content-end"},t.createElement(ie.Button,{type:"submit",onClick:L.onFormReset},x.toLanguageString(Oe,Z[Oe])),t.createElement(ie.Button,{themeColor:"primary",type:"submit",onClick:L.onSubmit},x.toLanguageString(qe,Z[qe])))),...j})))}),xe={form:ne.Form,formElement:ne.FormElement,editor:Ie,horizontal:!1,data:[],columnAxes:[],rowAxes:[],measureAxes:[]};We.defaultProps=xe,We.displayName="KendoReactPivotGridConfigurator";const Ye=t.forwardRef((e,a)=>{const n=t.useRef(null),r=t.useRef(null),s=fe.useLocalization();t.useImperativeHandle(n,()=>({props:e,element:r.current})),t.useImperativeHandle(a,()=>n.current);const[l,m]=c.useCustomComponent(e.icon||ct.icon),i=t.useMemo(()=>c.classNames("k-pivotgrid-configurator-button",e.className),[e.className]),C=c.useMouse(e,n);return t.createElement("div",{ref:r,id:e.id,className:i,tabIndex:e.tabIndex,...C},t.createElement("span",null,s.toLanguageString(Ue,Z[Ue]),t.createElement(l,{name:"gear",icon:pe.gearIcon,...m})))}),ct={icon:c.IconWrap};Ye.defaultProps=ct,Ye.displayName="KendoReactPivotGridConfiguratorButton";const ut=e=>{const[a,n]=t.useState(!0),[r,s]=t.useState({data:[],columns:[],rows:[]}),[l,m]=t.useState([]),[i,C]=t.useState(e.defaultColumnAxes||[]),[f,x]=t.useState(e.defaultRowAxes||[]),[F,k]=t.useState(e.defaultMeasureAxes||[]),[D,j]=t.useState(e.defaultSort||[]),[G,$]=t.useState(e.defaultFilter||[]),_=o=>{x(o.value)},p=o=>{C(o.value)},L=o=>{k(o.value)},g=o=>{j(o.value)},U=o=>{$(o.value)};t.useEffect(()=>{n(!0);const o={connection:{catalog:e.catalog,cube:e.cube},columnAxes:i.slice(),rowAxes:f.slice(),measureAxes:F,sort:D,filter:G};setTimeout(()=>{b.fetchData({url:e.url},c.clone(o)).then(b.createDataState).then(h=>{s(h),n(!1)})})},[i,f,F,G,D,e.cube,e.catalog,e.url]),t.useEffect(()=>{n(!0);const o={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube},command:"schemaDimensions"};b.fetchDiscover({url:e.url},o).then(h=>{b.addKPI(h),m(h),n(!1)})},[e.catalog,e.cube,e.url]);const V=(o=[],h)=>{for(let E=0;E<o.length;E++){const N=o[E];if(String(N.name)===String(h.name))return N}return null},O=(o=[],h)=>{for(let E=0;E<o.length;E++){const N=o[E];if(N.uniqueName===h.uniqueName)return N;let T=O(N.children,h);if(T!==null)return T}return null},u=async o=>{let h,E,N,T,z,X;o.name&&(h="schemaMembers",T=`${String(o.name)}.[(ALL)]`);const d={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube,hierarchyUniqueName:N,dimensionUniqueName:E,levelUniqueName:T,memberUniqueName:z,treeOp:X},command:h};return b.fetchDiscover({url:e.url},d)},y=async o=>{let h,E,N,T,z,X;o.uniqueName&&(h="schemaMembers",z=o.uniqueName.replace(/\&/g,"&"),X=1);const d={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube,hierarchyUniqueName:N,dimensionUniqueName:E,levelUniqueName:T,memberUniqueName:z,treeOp:X},command:h};return b.fetchDiscover({url:e.url},d)},H=async o=>{let h,E,N,T,z,X;o.type===2?h="schemaMeasures":o.dimensionUniqueName?(h="schemaLevels",N=o.uniqueName):(h="schemaHierarchies",E=o.uniqueName);const d={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube,hierarchyUniqueName:N,dimensionUniqueName:E,levelUniqueName:T,memberUniqueName:z,treeOp:X},command:h};return b.fetchDiscover({url:e.url},d)},P=async()=>{const o={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube},command:"schemaKPIs"};return b.fetchDiscover({url:e.url},o)},w=async o=>{const h=l.slice(),E=O(h,o.value);if(E&&E.uniqueName==="[KPIs]"){const N=Mt(await P());E.children=N}else if(E&&E.type==="kpi")E.children=b.buildKPIMeasures(E);else if(E&&!E.children){const N=await H(E);E.children=N}m(h)},J=async o=>{if(!o)return;const h={rowAxes:[f,x],columnAxes:[i,C],measureAxes:[F,k]},[E,N]=h[o.target.props.axes],T=E.slice(),z=V(T,o.target.props.dataItem);if(z&&!z.fields){const X=await u(z);z.fields=X,N(T)}},W=async o=>{if(!o)return;const h={rowAxes:[f,x],columnAxes:[i,C],measureAxes:[F,k]},[E,N]=h[o.target.props.axes],T=E.slice(),z=V(T,o.target.props.dataItem);if(z){const X=(z.fields||[]).slice(),d=O(X,o.value);if(d&&(!d.children||!d.children.length)){const q=await y(d);d.children=q,z.fields=X,N(T)}}};return{pivotProps:{rowAxes:f,columnAxes:i,data:r.data,rows:r.rows,columns:r.columns,onRowAxesChange:_,onColumnAxesChange:p},configuratorProps:{sort:D,onSortChange:g,filter:G,onFilterChange:U,data:l,rowAxes:f,columnAxes:i,measureAxes:F,onRowAxesChange:_,onColumnAxesChange:p,onMeasureAxesChange:L,onFieldsEditorFieldExpand:w,onAxisFilterFieldExpand:W,onAxisFilterFieldsExpandChange:J},state:{loading:a}}},Pt=e=>{const a=ut(e);return e.children(a)},Mt=e=>{for(let a=0,n=e.length;a<n;a++)e[a].uniqueName=e[a].name,e[a].type="kpi";return e},dt={dataField:"aggregate",columnsData:"columns"},Pe="&",mt=e=>{const[a,n]=t.useState(!0),[r,s]=t.useState(e.defaultColumnAxes||[]),[l,m]=t.useState(e.defaultRowAxes||[]),[i,C]=t.useState(e.defaultMeasureAxes||[]),[f,x]=t.useState(e.defaultSort||[]),[F,k]=t.useState(e.defaultFilter||[]),[D,j]=t.useState(new Map),G=t.useCallback(w=>{m(w.value)},[]),$=t.useCallback(w=>{s(w.value)},[]),_=w=>{C(w.value)},p=w=>{x(w.value)},L=w=>{k(w.value)},g=t.useMemo(()=>Array.from(b.rootFields(r).keys()).join(Pe),[r]),U=t.useMemo(()=>Array.from(b.rootFields(l).keys()).join(Pe),[l]),V=t.useCallback(w=>({key:w,...e.dimensions[w]}),[e.dimensions]),O=t.useMemo(()=>g?g.split(Pe).map(V):[],[g,V]),u=t.useMemo(()=>U?U.split(Pe).map(V):[],[U,V]),y=t.useMemo(()=>i.map(w=>e.measures.find(J=>String(J.name)===String(w.name))).filter(Boolean),[i,e.measures]);t.useEffect(()=>{n(!0),setTimeout(()=>{const w=b.createDataTree(e.data,u,O,y,dt,F);j(w),n(!1)},0)},[e.data,u,O,y,F]);const H=t.useMemo(()=>b.createFlatSchemaDimensions(e.dimensions,e.measures),[e.dimensions,e.measures]),P=t.useMemo(()=>b.createLocalDataState({dataTree:D,rowSettings:u,columnSettings:O,rowAxes:l,columnAxes:r,measures:y,sort:f,fields:dt}),[r,O,D,l,u,f]);return{pivotProps:{rowAxes:l,columnAxes:r,data:P.data,rows:P.rows,columns:P.columns,onRowAxesChange:G,onColumnAxesChange:$},configuratorProps:{sort:f,onSortChange:p,filter:F,onFilterChange:L,data:H,rowAxes:l,columnAxes:r,measureAxes:i,onRowAxesChange:G,onColumnAxesChange:$,onMeasureAxesChange:_},state:{loading:a}}},Lt=e=>{const a=mt(e);return e.children(a)};Object.defineProperty(A,"averageAggregate",{enumerable:!0,get:()=>b.averageAggregate}),Object.defineProperty(A,"maxAggregate",{enumerable:!0,get:()=>b.maxAggregate}),Object.defineProperty(A,"minAggregate",{enumerable:!0,get:()=>b.minAggregate}),Object.defineProperty(A,"sumAggregate",{enumerable:!0,get:()=>b.sumAggregate}),A.PivotGrid=rt,A.PivotGridAxesEditor=se,A.PivotGridAxisEditor=be,A.PivotGridAxisFilterFieldsEditor=Fe,A.PivotGridCell=je,A.PivotGridColumn=Ae,A.PivotGridConfigurator=We,A.PivotGridConfiguratorButton=Ye,A.PivotGridConfiguratorEditor=Ie,A.PivotGridContainer=Xe,A.PivotGridFieldsEditor=Ne,A.PivotGridHeaderCell=Ce,A.PivotGridRow=Ve,A.PivotLocalDataService=Lt,A.PivotOLAPService=Pt,A.dataCells=wt,A.usePivotLocalDataService=mt,A.usePivotOLAPService=ut,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@progress/kendo-react-common"),require("@progress/kendo-react-intl"),require("@progress/kendo-pivotgrid-common"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-buttons"),require("@progress/kendo-react-form"),require("@progress/kendo-react-labels"),require("@progress/kendo-react-data-tools"),require("@progress/kendo-react-treeview"),require("@progress/kendo-react-indicators")):"function"==typeof define&&define.amd?define(["exports","react","@progress/kendo-react-common","@progress/kendo-react-intl","@progress/kendo-pivotgrid-common","@progress/kendo-svg-icons","@progress/kendo-react-buttons","@progress/kendo-react-form","@progress/kendo-react-labels","@progress/kendo-react-data-tools","@progress/kendo-react-treeview","@progress/kendo-react-indicators"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactPivotgrid={},e.React,e.KendoReactCommon,e.KendoReactIntl,e.KendoPivotgridCommon,e.KendoSvgIcons,e.KendoReactButtons,e.KendoReactForm,e.KendoReactLabels,e.KendoReactDataTools,e.KendoReactTreeview,e.KendoReactIndicators)}(this,(function(e,t,r,n,a,o,l,s,i,c,u,d){"use strict";function m(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var p=m(t);const g={name:"@progress/kendo-react-pivotgrid",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},v="pivotgrid.emptyCellAriaLabel",f="pivotgrid.fieldMenuReset",h="pivotgrid.fieldMenuApply",x="pivotgrid.configuratorTitle",E="pivotgrid.configuratorCancel",y="pivotgrid.configuratorApply",A="pivotgrid.configuratorColumnsTitle",C="pivotgrid.configuratorRowsTitle",w="pivotgrid.configuratorMeasuresTitle",b="pivotgrid.configuratorEditorSearchTitle",I="pivotgrid.configuratorMissingFields",N="pivotgrid.configuratorButtonLabel",k={[v]:"PivotGrid component. Use the arrow keys to navigate.",[f]:"Reset",[h]:"Apply",[E]:"Cancel",[y]:"Apply",[x]:"Settings",[b]:"Fields","pivotgrid.configuratorEditorSearchPlaceholder":"Search...",[A]:"Columns",[C]:"Rows",[w]:"Values",[N]:"Change settings",[I]:"Select some fields to begin setup"},R=p.forwardRef(((e,t)=>{const n=p.useRef(null),a=p.useRef(null);p.useImperativeHandle(n,(()=>({element:a.current,props:e}))),p.useImperativeHandle(t,(()=>n.current));const o=r.useMouse(e,n);return p.createElement("tr",{ref:a,...o,id:e.id,style:e.style,tabIndex:e.tabIndex,children:e.children,role:e.role,"aria-owns":e.ariaOwns,className:r.classNames("k-pivotgrid-row",e.className)})}));R.displayName="KendoReactPivotGridRow";const S=p.forwardRef(((e,t)=>{const n=p.useRef(null),a=p.useRef(null);p.useImperativeHandle(n,(()=>({element:a.current,props:e}))),p.useImperativeHandle(t,(()=>n.current));const o=r.useMouse(e,n);return p.createElement("td",{ref:a,...o,id:e.id,style:e.style,tabIndex:e.tabIndex,role:e.role,"aria-describedby":e.ariaDescribedby,className:r.classNames("k-pivotgrid-cell",{"k-pivotgrid-header-total":e.total},e.className)},e.children)}));S.displayName="KendoReactPivotGridCell";const F=(e,t,r)=>[e,(n,o)=>{const l=a.headersReducer(e,{...n,tree:t});r&&r(l,o)}],P=p.forwardRef(((e,t)=>{const n=p.useRef(null),a=p.useRef(null);p.useImperativeHandle(n,(()=>({element:a.current,props:e}))),p.useImperativeHandle(t,(()=>n.current));const[l,s]=r.useCustomComponent(e.icon||L.icon),i=r.useMouse(e,n);return p.createElement("th",{ref:a,...i,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:r.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&&p.createElement(l,{...s,onClick:t=>{e.onIconClick&&e.onIconClick.call(void 0,{syntheticEvent:t.syntheticEvent,target:n.current})},name:"chevron-"+(e.expanded?"up":"down"),"aria-hidden":!0,icon:e.expanded?o.chevronUpIcon:o.chevronDownIcon}),e.children)})),L={icon:r.IconWrap};P.defaultProps=L,P.displayName="KendoReactPivotGridHeaderCell";const T=p.forwardRef(((e,t)=>{const n=p.useRef(null),a=p.useRef(null);p.useImperativeHandle(n,(()=>({element:a.current,props:e}))),p.useImperativeHandle(t,(()=>n.current));const o=r.useMouse(e,n);return p.createElement("col",{ref:a,...o,id:e.id,style:e.style,tabIndex:e.tabIndex,children:e.children,className:e.className})}));T.defaultProps={path:[]},T.displayName="KendoReactPivotGridColumn";const D=(e=[],t={},r=null)=>e.map((e=>{const n={dataItem:e};return Object.keys(t).forEach((e=>{n[e]=t[e](n,r)})),n})),M=(e=[])=>{let t=[...e];return(e||[]).forEach((e=>{t=t.concat(M(e.children))})),t},O=(e=[])=>{const t=new Set;return e.forEach((e=>{t.add(String(e.name))})),Array.from(t)},H=(e=[])=>`${e.join(",")}`,q=(e,t,r)=>{if(!e)return[];let n,a=0,o=[],l=e.length;for(;a<l;a++)n=e[a].operator,(!r&&"in"!==n||n===r)&&e[a].field===t&&o.push(e[a]);return o},G=(e,t)=>e.uniqueName===t.uniqueName,K=p.forwardRef(((e,t)=>{r.validatePackage(g);const{rows:o,rowAxes:l,columns:s,columnAxes:i,data:c}={...U,...e},u=p.useRef(null),d=p.useRef(null),m=p.useRef(null),f=p.useRef(null),h=p.useRef(null),x=p.useRef(null),E=p.useRef(null),y=n.useLocalization(),A=a.toTree((o||[]).slice()),[,C]=F((l||[]).slice(),A,((t,r)=>{e.onRowAxesChange&&e.onRowAxesChange({value:t,target:d.current,syntheticEvent:r})})),[w,b,I,N]=a.toRows(A),R=a.toTree((s||[]).slice()),[,S]=F((i||[]).slice(),R,((t,r)=>{e.onColumnAxesChange&&e.onColumnAxesChange({value:t,target:d.current,syntheticEvent:r})})),[P,L,,T]=a.toColumns(R),D=a.toData((c||[]).slice(),L,b,T,I);p.useImperativeHandle(d,(()=>({props:e,element:u.current,columnHeaderRows:P,rowHeaderRows:w,dataCells:D,rowHeaderBreadth:N,columnHeaderBreadth:T}))),p.useImperativeHandle(t,(()=>d.current));const M=[],O=[],q=[],[G,K]=r.useCustomComponent(e.row||U.row),[z,B]=r.useCustomComponent(e.column||U.column),[j,X]=r.useCustomComponent(e.cell||U.cell),[V,Z]=r.useCustomComponent(e.headerCell||U.headerCell),_=e.columnHeadersRow||G,$=e.columnHeadersColumn||z,J=e.columnHeadersCell||V,W=e.rowHeadersRow||G,Y=e.rowHeadersColumn||z,Q=e.rowHeadersCell||V,ee=e.dataRow||G,te=e.dataColumn||z;for(let e=0;e<L.length;e++)M.push(p.createElement(te,{key:String(L[e].path),...B,path:L[e].path})),q.push(p.createElement($,{key:String(L[e].path),...B,path:L[e].path}));for(let e=0;e<N;e++)O.push(p.createElement(Y,{key:e,...B}));const re=e=>{e.target.props.expandable&&S({type:a.HEADERS_ACTION.toggle,payload:e.target.props.dataItem.path},e.syntheticEvent)},ne=e=>{e.target.props.expandable&&C({type:a.HEADERS_ACTION.toggle,payload:e.target.props.dataItem.path},e.syntheticEvent)},ae=((...e)=>{const t=p.useRef();return r=>{void 0!==t.current&&window.cancelAnimationFrame(t.current);const n=r.currentTarget,a=n.scrollLeft;e.forEach((e=>{const r=e.current;r&&r!==n&&(t.current=window.requestAnimationFrame((()=>{r.scrollLeft=Math.round(a)})))}))}})(E,x),oe=((...e)=>{const t=p.useRef();return r=>{void 0!==t.current&&window.cancelAnimationFrame(t.current);const n=r.currentTarget,a=n.scrollTop;e.forEach((e=>{const r=e.current;r&&r!==n&&(t.current=window.requestAnimationFrame((()=>{r.scrollTop=Math.round(a)})))}))}})(E,h),le=p.useCallback((()=>{u.current&&f.current&&(u.current.style.gridTemplateRows="",u.current.style.gridTemplateRows=`${f.current.offsetHeight}px 1fr`)}),[]),se=p.useCallback((()=>{u.current&&m.current&&(u.current.style.gridTemplateColumns="",u.current.style.gridTemplateColumns=`${m.current.offsetWidth}px 1fr`)}),[]),ie=p.useRef(new a.PivotGridNavigation({tabIndex:e.tabIndex||0}));p.useEffect((()=>{if(u.current){const t=e.tabIndex||0;if(ie.current.stop(),ie.current.tabIndex=t,e.navigatable){ie.current.start(u.current);const e=ie.current.first;e&&e.setAttribute("tabindex",String(t))}}return()=>{ie.current.stop()}}),[e.tabIndex,e.navigatable]),p.useEffect((()=>{ie.current.update()})),p.useEffect((()=>{if(f.current){const e=new window.ResizeObserver(le);return e.observe(f.current),()=>{e.disconnect()}}}),[le]),p.useEffect((()=>{if(m.current){const e=new window.ResizeObserver(se);return e.observe(m.current),()=>{e.disconnect()}}}),[se]),r.useIsomorphicLayoutEffect((()=>{if(r.setScrollbarWidth(),m.current){const e=new window.ResizeObserver(r.setScrollbarWidth);return e.observe(m.current),()=>{e.disconnect()}}}),[]);const ce=new Array(P.length).fill([]).map((()=>new Array(L.length)));P.forEach(((e,t)=>{let r=0;Array.from(e.cells).forEach((e=>{const n=!!(e&&e.children&&e.children.length),a=(e?H(e.normalizedPath)+(e.total?"|[TOTAL]":"")+(n?"|[EXPANDED]":""):"").replace(/\s/g,"-");if(e)for(let n=0;n<(e.colSpan||1);n++){for(let n=0;n<(e.rowSpan||1);n++){const e=ce[t+n].findIndex(((e,t)=>t>=r&&!e));ce[t+n][e]=a}r++}}))}));const ue=D.map((e=>e.cells.map((e=>((e,t)=>`${H(e.map((e=>e.name)))}|${H(t.map((e=>e.name)))}`)(e.rowTuple.members,e.columnTuple.members).replace(/\s/g,"-")))));return p.createElement("div",{ref:u,id:e.id,style:e.style,tabIndex:e.navigatable?void 0:e.tabIndex,className:r.classNames("k-pivotgrid",e.className),role:"grid"},p.createElement("span",{className:"k-pivotgrid-empty-cell"},p.createElement("span",{className:"k-sr-only"},y.toLanguageString(v,k[v]))),p.createElement("div",{ref:x,className:"k-pivotgrid-column-headers",onScroll:ae},p.createElement("table",{ref:f,className:"k-pivotgrid-table",role:"none"},p.createElement("colgroup",null,q),p.createElement("tbody",{className:"k-pivotgrid-tbody",role:"rowgroup"},P.map(((e,t)=>{let r=!1;return p.createElement(_,{key:e.name,role:"row",...K},e.cells.map(((e,n)=>{const a=0!==n&&!r;e&&(r=!0);const o=e&&!(!e.children||!e.children.length),l=e&&e.hasChildren&&(!e.total||e.total&&e.parent.total);return e?p.createElement(J,{...Z,key:ce[t][n],"data-key":ce[t][n],id:ce[t][n],columnPath:e.normalizedPath,rowSpan:e.rowSpan||void 0,colSpan:e.colSpan||void 0,onIconClick:re,dataItem:e,expanded:o,expandable:l,total:e.total,first:a,root:0===e.levelNum,role:"columnheader"},e.caption):null})))}))))),p.createElement("div",{ref:h,className:"k-pivotgrid-row-headers"},p.createElement("table",{ref:m,className:"k-pivotgrid-table",role:"none"},p.createElement("colgroup",null,O),p.createElement("tbody",{className:"k-pivotgrid-tbody",role:"rowgroup"},w.map(((e,t)=>p.createElement(W,{key:H(b[t].path),...K,path:b[t].path,role:"row",ariaOwns:ue[t].join(" ")},e.cells.filter(Boolean).map((e=>e?p.createElement(Q,{...Z,key:H(e.normalizedPath)+(e.total?"|[TOTAL]":"")+(e.children&&e.children.length?"|[EXPANDED]":""),"data-key":H(e.normalizedPath)+(e.total?"|[TOTAL]":"")+(e.children&&e.children.length?"|[EXPANDED]":""),rowPath:e.normalizedPath,rowSpan:e.rowSpan||void 0,colSpan:e.colSpan||void 0,dataItem:e,expanded:!(!e.children||!e.children.length),expandable:e.hasChildren&&!e.total,total:e.total,onIconClick:ne,root:0===e.levelNum,role:"rowheader"},e.caption):null)))))))),p.createElement("div",{ref:E,className:"k-pivotgrid-values",onScroll:e=>{ae(e),oe(e)}},p.createElement("table",{className:"k-pivotgrid-table",role:"none"},p.createElement("colgroup",null,M),p.createElement("tbody",{className:"k-pivotgrid-tbody",role:"none"},D.map(((e,t)=>p.createElement(ee,{key:H(b[t].path),...K,path:b[t].path,role:"none"},e.cells.map(((e,r)=>p.createElement(j,{key:ue[t][r],"data-key":ue[t][r],id:ue[t][r],...X,rowPath:e.rowTuple.members.map((e=>e.name)),columnPath:e.columnTuple.members.map((e=>e.name)),dataItem:e,total:b[t].total||L[r].total,role:"gridcell",ariaDescribedby:ce.map((e=>e[r])).join(" ")},e&&e.data&&e.data.fmtValue?e.data.fmtValue:" "))))))))))})),U={rowAxes:[],columnAxes:[],data:[],row:R,column:T,cell:S,headerCell:P};K.displayName="KendoReactPivotGrid";const z=p.forwardRef(((e,t)=>{const n=p.useRef(null),a=p.useRef(null);return p.useImperativeHandle(a,(()=>({props:e,element:n.current}))),p.useImperativeHandle(t,(()=>a.current)),p.createElement("div",{ref:n,id:e.id,style:e.style,tabIndex:e.tabIndex,className:r.classNames("k-d-flex k-pos-relative",{"k-flex-row":"right"===e.configuratorPosition,"k-flex-row-reverse":"left"===e.configuratorPosition,"k-flex-column":"bottom"===e.configuratorPosition,"k-flex-column-reverse":"top"===e.configuratorPosition},e.className)},e.children)}));z.defaultProps={configuratorPosition:"right"},z.displayName="KendoReactPivotGridContainer";const B=p.createContext({axes:null}),j=p.createContext({}),X=p.createContext([{expanded:[],rowAxes:[],columnAxes:[],measureAxes:[],dragItem:null,dropZone:null,dropDirection:null,dropTarget:null},r.noop]);var V=(e=>(e.toggle="EXPAND_TOGGLE",e.expand="EXPAND_EXPAND",e.collapse="EXPAND_COLLAPSE",e))(V||{});const Z=(e=[],t,r,n=((e,t)=>e===t))=>{const[a,o]=p.useState(e);return[a,(e,l)=>{const s=((e,t,r)=>{switch(t.type){case"EXPAND_TOGGLE":return Array.isArray(e)?e.find((e=>r(e,t.payload)))?[...e.filter((e=>!r(e,t.payload)))]:[...e,t.payload]:r(e,t.payload)?null:t.payload;case"EXPAND_EXPAND":if(Array.isArray(e)){if(!e.find((e=>r(e,t.payload))))return[...e,t.payload]}else if(!r(e,t.payload))return t.payload;break;case"EXPAND_COLLAPSE":if(Array.isArray(e)){if(e.find((e=>r(e,t.payload))))return[...e.filter((e=>!r(e,t.payload)))]}else r(e,t.payload);break;default:return e}})(a,e,n);t&&t.call(void 0,{value:s,target:r.current,syntheticEvent:l}),o(s)}]};var _=(e=>(e.toggleExpansion="PIVOT_CONFIGURATOR_ACTION_TOGGLE_EXPANSION",e))(_||{});const $={...a.PIVOT_CONFIGURATOR_ACTION,..._},J=(e,t)=>{const r=e.valueGetter("rowAxes"),n=e.valueGetter("columnAxes"),o=e.valueGetter("measureAxes"),l=e.valueGetter("sort"),s=e.valueGetter("filter"),[i,c]=Z([],void 0,t,G),[u,d]=p.useState(null),[m,g]=p.useState(null),[v,f]=p.useState(null),[h,x]=p.useState(null);return[{dragItem:u,dropTarget:v,dropZone:m,dropDirection:h,columnAxes:n,rowAxes:r,measureAxes:o,sort:l,filter:s,expanded:i},(t,i)=>{if(t.type===$.toggleExpansion)c({type:V.toggle,payload:t.payload},i);else{const i=a.configuratorReducer({filter:t.override&&void 0!==t.override.filter?t.override.filter:s,sort:t.override&&void 0!==t.override.sort?t.override.sort:l,rowAxes:t.override&&void 0!==t.override.rowAxes?t.override.rowAxes:r,columnAxes:t.override&&void 0!==t.override.columnAxes?t.override.columnAxes:n,measureAxes:t.override&&void 0!==t.override.measureAxes?t.override.measureAxes:o,dragItem:t.override&&void 0!==t.override.dragItem?t.override.dragItem:u,dropDirection:t.override&&void 0!==t.override.dropDirection?t.override.dropDirection:h,dropTarget:t.override&&void 0!==t.override.dropTarget?t.override.dropTarget:v,dropZone:t.override&&void 0!==t.override.dropZone?t.override.dropZone:m},t);void 0!==i.columnAxes&&e.onChange("columnAxes",{value:i.columnAxes}),void 0!==i.rowAxes&&e.onChange("rowAxes",{value:i.rowAxes}),void 0!==i.measureAxes&&e.onChange("measureAxes",{value:i.measureAxes}),void 0!==i.sort&&e.onChange("sort",{value:i.sort}),void 0!==i.filter&&e.onChange("filter",{value:i.filter}),void 0!==i.dropDirection&&x(i.dropDirection),void 0!==i.dropTarget&&f(i.dropTarget),void 0!==i.dropZone&&g(i.dropZone),void 0!==i.dragItem&&d(i.dragItem)}}]},W=p.forwardRef(((e,t)=>{const{data:a,dataItem:l,defaultFilter:s}={...Y,...e},i=p.useRef(null),c=p.useRef(null),u=n.useLocalization(),[d,m]=r.useCustomComponent(e.columnMenuItem||Y.columnMenuItem),[g,v]=r.useCustomComponent(e.columnMenuForm||Y.columnMenuForm),[x,E]=r.useCustomComponent(e.resetButton||Y.resetButton),[y,A]=r.useCustomComponent(e.applyButton||Y.applyButton),[C,w]=r.useCustomComponent(e.treeView||Y.treeView),[b,I]=r.useCustomComponent(e.noData||Y.noData);p.useImperativeHandle(c,(()=>({props:e,element:i.current}))),p.useImperativeHandle(t,(()=>c.current));const[N,R]=p.useState(!1),{onAxisFilterFieldsExpandChange:S,onAxisFilterFieldExpand:F}=p.useContext(j),[,P]=p.useContext(X),[L,T]=p.useState(s),O=L?L.value.split(","):[],[H,q]=Z([],void 0,c,G),K={caption:e=>e.dataItem.caption,id:e=>e.dataItem.uniqueName,parent:(e,t)=>t&&t.value,value:e=>e.dataItem.defaultHierarchy||e.dataItem.uniqueName,expanded:e=>H.some((t=>t.uniqueName===e.id)),checked:e=>!O.length||(O||[]).some((t=>t===e.dataItem.uniqueName)),hasChildren:e=>parseInt(e.dataItem.childrenCardinality,10)>0,children:e=>D(e.dataItem.children,K,e),checkIndeterminate:e=>{const t=(e.children||[]).length&&e.children.every((e=>e.checked));return t&&(e.checked=!0),(e.children||[]).some((e=>e.checked))&&!t}},U=D(a,K),z=M(U);return p.createElement("div",{ref:i,id:e.id,tabIndex:e.tabIndex,style:e.style,className:r.classNames("k-columnmenu-item-wrapper",e.className)},p.createElement(d,{...m,title:"Include Fields",iconClass:"k-i-grid-layout",svgIcon:o.gridLayoutIcon,onClick:e=>{R(!N),S&&S({value:!N,target:c.current,syntheticEvent:e})}}),p.createElement(g,{show:N,actions:p.createElement(p.Fragment,null,p.createElement(x,{type:"reset",onClick:e=>{R(!1),L&&P({type:$.removeFilter,payload:L},e)},...E},u.toLanguageString(f,k[f])),p.createElement(y,{themeColor:"primary",onClick:e=>{R(!1),L&&P({type:s?$.changeFilter:$.addFilter,payload:L},e)},...A},u.toLanguageString(h,k[h]))),...v},U&&U.length?p.createElement(C,{data:U,checkboxes:!0,onExpandChange:e=>{q({type:V.toggle,payload:e.item.dataItem},e.syntheticEvent),F&&F({value:e.item.dataItem,target:c.current,syntheticEvent:e.syntheticEvent})},onCheckChange:e=>{let t;t=e.item.checked?{field:String(l.name),operator:"in",value:z.filter((e=>e.checked)).map((e=>String(e.value))).filter((t=>t!==e.item.value&&t!==e.item.parent)).join(",")}:{field:String(l.name),operator:"in",value:z.filter((e=>e.checked)).map((e=>String(e.value))).concat([e.item.value]).join(",")},T(t)},textField:"caption",expandIcons:!0,hasChildrenField:"hasChildren",checkIndeterminateField:"checkIndeterminate",childrenField:"children",...w}):p.createElement(b,{...I})))})),Y={data:[],resetButton:l.Button,applyButton:l.Button,treeView:u.TreeView,noData:()=>p.createElement(d.Skeleton,{shape:"rectangle",style:{height:"20px",width:"calc(100% - 16px)",margin:8}}),columnMenuItem:c.ColumnMenuItem,columnMenuForm:c.ColumnMenuForm};W.defaultProps=Y,W.displayName="KendoReactPivotGridAxisFilterFieldsEditor";const Q=p.forwardRef(((e,t)=>{const n=p.useRef(0),o=p.useRef(0),l=p.useRef(null),s=p.useRef(null),i=p.useRef(null),{axes:u}=p.useContext(B),[d,m]=p.useState(!1),[g,v]=p.useContext(X);p.useImperativeHandle(s,(()=>l.current&&l.current.element)),p.useImperativeHandle(i,(()=>({props:e,element:s.current}))),p.useImperativeHandle(t,(()=>i.current));const[f,h]=r.useCustomComponent(e.chip||ee.chip),[x,E]=r.useCustomComponent(e.dropClue||ee.dropClue),[y,A]=r.useCustomComponent(e.columnMenuTextColumn||ee.columnMenuTextColumn),[C,w]=r.useCustomComponent(e.filterFieldsEditor||ee.filterFieldsEditor),b=q(g.filter,String(e.value),"in"),I=q(g.filter,String(e.value));return r.useDraggable(s,{onPress:e=>{n.current=e.clientX,o.current=e.clientY},onDrag:t=>{Math.abs(n.current-t.clientX)<10&&Math.abs(o.current-t.clientY)<10||(s.current&&(s.current.style.transform=`translate(${t.clientX-n.current}px, ${t.clientY-o.current}px)`),m(!0),v({type:$.setDragItem,payload:e.dataItem}))},onRelease:()=>{m(!1),g.dragItem&&(s.current&&(s.current.style.transform=""),v({type:$.drop,payload:e.dataItem}))}}),p.createElement(p.Fragment,null,g.dropTarget&&a.compareAxes(g.dropTarget,e.dataItem)&&"before"===g.dropDirection&&p.createElement(x,{...E}),p.createElement(f,{ref:r.canUseRef(f)?l:void 0,...e,removable:!0,onRemove:t=>{v({type:$.remove,payload:e.dataItem},t.syntheticEvent)},onMouseEnter:t=>{g.dragItem&&(v({type:$.setDropTarget,payload:e.dataItem},t.syntheticEvent),v({type:$.setDropZone,payload:u},t.syntheticEvent))},onMouseMove:e=>{if(g.dragItem&&!d&&s.current){const t=s.current.getBoundingClientRect(),r=e.syntheticEvent.clientX-t.left<t.width/2?"before":"after";v({type:$.setDropDirection,payload:r},e.syntheticEvent)}},style:{pointerEvents:d?"none":void 0},rounded:"full",...h},e.text,"measureAxes"!==u&&p.createElement(y,{field:String(e.value),itemsRender:t=>{const r=t.slice(),n=((e,t,r)=>{if(!e)return;let n,a,o=0,l=e.length;for(;o<l;o++)a=e[o].operator,(!r&&"in"!==a||a===r)&&e[o].field===t&&(n=e[o]);return n})(g.filter,String(e.dataItem.name),"in");return r.splice(1,0,p.createElement(C,{key:"axis-filter-fields-editor",defaultFilter:n,dataItem:e.dataItem,data:e.dataItem.fields,axes:u,...w})),r},sort:g.sort,onSortChange:(e,t)=>{v({type:$.setSort,payload:t},e)},filter:I&&I.length?[{logic:"and",filters:I}]:void 0,onFilterChange:(e,t)=>{t.length?v({type:$.setFilter,payload:[...b||[],...t.reduce(((e,t)=>[...e,...t.filters.filter((e=>e.value))]),[])]},e):v({type:$.setFilter,payload:b},e)},filterContent:[c.ColumnMenuTextFilter],...A})),g.dropTarget&&a.compareAxes(g.dropTarget,e.dataItem)&&"after"===g.dropDirection&&p.createElement(x,{...E}))})),ee={chip:l.Chip,columnMenuTextColumn:c.ColumnMenuTextColumn,filterFieldsEditor:W,dropClue:e=>p.createElement("div",{className:"k-grouping-dropclue",style:{position:"relative",zIndex:1e4},...e})};Q.defaultProps=ee,Q.displayName="KendoReactPivotGridAxisEditor";const te=p.forwardRef(((e,t)=>{const{value:n,field:a}={...re,...e},o=p.useRef(null),l=p.useRef(null),s=p.useRef(null),[i,c]=r.useCustomComponent(e.chipList||re.chipList);p.useImperativeHandle(l,(()=>o.current&&o.current.element)),p.useImperativeHandle(s,(()=>({props:e,element:l.current}))),p.useImperativeHandle(t,(()=>s.current));const u=n.filter((e=>1===e.name.length&&e.name.every((e=>-1===e.indexOf("&"))))).map((e=>({...e,text:String(e.name)})));return p.createElement(B.Provider,{value:{axes:a}},p.createElement(i,{ref:r.canUseRef(i)?o:void 0,textField:"text",valueField:"name",data:u,chip:Q,style:{position:"relative"},className:e.className,selection:"none",...c}))})),re={value:[],chipList:l.ChipList};te.defaultProps=re,te.displayName="KendoReactPivotGridAxesEditor";const ne=p.forwardRef(((e,t)=>{const{data:n,rowAxes:a,columnAxes:o,measureAxes:l,onExpand:s,onCheck:i}={...ae,...e},c=p.useRef(null),d=p.useRef(null),[m,g]=r.useCustomComponent(e.treeView||ae.treeView),[v,f]=r.useCustomComponent(e.noData||ae.noData);p.useImperativeHandle(d,(()=>({props:e,element:c.current&&c.current.element}))),p.useImperativeHandle(t,(()=>d.current));const[h]=p.useContext(X),x=O(o),E=O(a),y=O(l),A=M(n).filter((e=>[...x,...E,...y].some((t=>t===e.uniqueName||t===e.defaultHierarchy)))),C={caption:e=>e.dataItem.caption,id:e=>e.dataItem.uniqueName,value:e=>e.dataItem.defaultHierarchy||e.dataItem.uniqueName,expanded:e=>h.expanded.some((t=>t.uniqueName===e.dataItem.uniqueName)),hasChildren:e=>!("hierarchyUniqueName"in e.dataItem)&&!("aggregator"in e.dataItem),selectable:e=>!(!e.hasChildren&&!e.dataItem.aggregator&&!e.dataItem.measure||2===e.dataItem.type||"[KPIs]"===e.dataItem.uniqueName),children:e=>D(e.dataItem.children,C,e),checked:e=>A.some((t=>e.dataItem.defaultHierarchy?t.defaultHierarchy===e.dataItem.defaultHierarchy:t.uniqueName===e.dataItem.uniqueName))||e.children.length&&e.children.every((e=>e.checked))},w=D(e.data,C);return p.createElement(u.TreeViewItemPropsContext.Provider,{value:e=>({...e,checkboxes:e.item.selectable})},w&&w.length?p.createElement(m,{ref:r.canUseRef(m)?c:void 0,data:w,checkboxes:!0,onExpandChange:e=>{s&&s({value:e.item.dataItem,target:d.current,syntheticEvent:e.syntheticEvent})},onCheckChange:e=>{i&&i({value:e.item.dataItem,target:d.current,syntheticEvent:e.syntheticEvent})},textField:"caption",expandIcons:!0,hasChildrenField:"hasChildren",checkIndeterminateField:"checkIndeterminate",childrenField:"children",...g}):p.createElement(v,{...f}))})),ae={data:[],rowAxes:[],columnAxes:[],measureAxes:[],treeView:u.TreeView,noData:()=>p.createElement("div",null,"NO DATA")};ne.defaultProps=ae,ne.displayName="KendoReactPivotGridFieldsEditor";const oe=p.forwardRef(((e,t)=>{const{onFieldsEditorFieldCheck:a,onFieldsEditorFieldCheckAction:o,onFieldsEditorFieldExpand:l,onFieldsEditorFieldExpandAction:c,onAxisFilterFieldExpand:u,onAxisFilterFieldsExpandChange:d}=e,[m,g]=r.useCustomComponent(e.fieldsLabel||le.fieldsLabel),[v,f]=r.useCustomComponent(e.fieldsEditor||le.fieldsEditor),[h,x]=r.useCustomComponent(e.columnAxesLabel||le.columnAxesLabel),[E,y]=r.useCustomComponent(e.columnAxesEditor||le.columnAxesEditor),[N,R]=r.useCustomComponent(e.rowAxesLabel||le.rowAxesLabel),[S,F]=r.useCustomComponent(e.rowAxesEditor||le.rowAxesEditor),[P,L]=r.useCustomComponent(e.measureAxesLabel||le.measureAxesLabel),[T,D]=r.useCustomComponent(e.measureAxesEditor||le.measureAxesEditor),M=p.useRef(null),O=p.useRef(null),H=n.useLocalization(),[q,G]=J(e,O);p.useImperativeHandle(O,(()=>({element:M.current,props:e,state:q}))),p.useImperativeHandle(t,(()=>O.current));const K=()=>{q.dragItem&&G({type:$.setDropZone,payload:"columnAxes"})},U=()=>{q.dragItem&&G({type:$.setDropZone,payload:null})},z=()=>{q.dragItem&&G({type:$.setDropZone,payload:"rowAxes"})},B=()=>{q.dragItem&&G({type:$.setDropZone,payload:null})},V=()=>{q.dragItem&&G({type:$.setDropZone,payload:"measureAxes"})},Z=()=>{q.dragItem&&G({type:$.setDropZone,payload:null})},_=e.horizontal?"div":p.Fragment,W=e.horizontal?{className:"k-form-field-wrapper"}:{};return p.createElement(j.Provider,{value:{onAxisFilterFieldExpand:e=>{const t={target:e.target,currentTarget:O.current,value:e.value,syntheticEvent:e.syntheticEvent};u&&u(t)},onAxisFilterFieldsExpandChange:e=>{const t={target:e.target,currentTarget:O.current,value:e.value,syntheticEvent:e.syntheticEvent};d&&d(t)}}},p.createElement(X.Provider,{value:[q,G]},p.createElement(_,{...W},p.createElement("div",{className:"k-form-field"},p.createElement(m,{name:"",component:i.Label,...g},H.toLanguageString(b,k[b]))),p.createElement("div",{className:"k-form-field"},p.createElement("div",{className:"k-fields-list-wrapper"},p.createElement(v,{data:e.data,onExpand:t=>{const r={target:t.target,currentTarget:O.current,value:t.value,syntheticEvent:t.syntheticEvent};if(c){const n=c(r,e,q);n&&(Array.isArray(n)?n.filter(Boolean).map((e=>e&&G({...e},t.syntheticEvent))):G({...n},t.syntheticEvent))}l&&l({target:t.target,currentTarget:O.current,value:t.value,syntheticEvent:t.syntheticEvent})},onCheck:t=>{const r={target:t.target,currentTarget:O.current,value:t.value,syntheticEvent:t.syntheticEvent};if(o){const n=o(r,e,q);n&&(Array.isArray(n)?n.filter(Boolean).map((e=>e&&G({...e},t.syntheticEvent))):G({...n},t.syntheticEvent))}a&&a(r)},columnAxes:q.columnAxes,rowAxes:q.rowAxes,measureAxes:q.measureAxes,...f})))),p.createElement(_,{...W},p.createElement("div",{className:"k-form-field",onMouseEnter:K,onMouseLeave:U},p.createElement(s.Field,{name:"columnAxes",field:"columnAxes",component:h,...x},H.toLanguageString(A,k[A]))),e.valueGetter("columnAxes").length?p.createElement(s.Field,{name:"columnAxes",field:"columnAxes",component:E,onMouseEnter:K,onMouseLeave:U,className:"k-column-fields",...y}):p.createElement("div",{className:"k-settings-description",onMouseEnter:K,onMouseLeave:U},H.toLanguageString(I,k[I])),p.createElement("div",{className:"k-form-field",onMouseEnter:z,onMouseLeave:B},p.createElement(s.Field,{name:"rowAxes",field:"rowAxes",component:N,...R},H.toLanguageString(C,k[C]))),e.valueGetter("rowAxes").length?p.createElement(s.Field,{name:"rowAxes",field:"rowAxes",component:S,onMouseEnter:z,onMouseLeave:B,className:"k-column-fields",...F}):p.createElement("div",{className:"k-settings-description",onMouseEnter:z,onMouseLeave:B},H.toLanguageString(I,k[I]))),p.createElement(_,{...W},p.createElement("div",{className:"k-form-field",onMouseEnter:V,onMouseLeave:Z},p.createElement(s.Field,{name:"measureAxes",field:"measureAxes",component:P,...L},H.toLanguageString(w,k[w]))),e.valueGetter("measureAxes").length?p.createElement(s.Field,{name:"measureAxes",field:"measureAxes",component:T,onMouseEnter:V,onMouseLeave:Z,className:"k-column-fields",...D}):p.createElement("div",{className:"k-settings-description",onMouseEnter:V,onMouseLeave:Z},H.toLanguageString(I,k[I])))))})),le={data:[],horizontal:!1,fieldsLabel:i.Label,fieldsEditor:ne,columnAxesLabel:i.Label,columnAxesEditor:te,rowAxesLabel:i.Label,rowAxesEditor:te,measureAxesLabel:i.Label,measureAxesEditor:te,axesEditor:te,onFieldsEditorFieldCheckAction:e=>({type:$.toggleSelection,payload:e.value}),onFieldsEditorFieldExpandAction:e=>({type:$.toggleExpansion,payload:e.value})};oe.defaultProps=le,oe.displayName="KendoReactPivotGridConfiguratorEditor";const se=p.forwardRef(((e,t)=>{const{horizontal:a,data:o,rowAxes:s,columnAxes:i,measureAxes:c}={...ie,...e},u=p.useRef(null),d=p.useRef(null),m=p.useRef(null),g=n.useLocalization(),[v,f]=r.useCustomComponent(e.editor||ie.editor),[h,A]=r.useCustomComponent(e.form||ie.form),[C,w]=r.useCustomComponent(e.formElement||ie.formElement);p.useImperativeHandle(d,(()=>({props:e,element:u.current}))),p.useImperativeHandle(t,(()=>d.current));const b={rowAxes:s,columnAxes:i,measureAxes:c,sort:e.sort,filter:e.filter};return p.useEffect((()=>{m.current&&m.current.onChange("rowAxes",{value:s})}),[s]),p.useEffect((()=>{m.current&&m.current.onChange("columnAxes",{value:i})}),[i]),p.useEffect((()=>{m.current&&m.current.onChange("measureAxes",{value:c})}),[c]),p.useEffect((()=>{m.current&&m.current.onChange("sort",{value:e.sort})}),[e.sort]),p.useEffect((()=>{m.current&&m.current.onChange("filter",{value:e.filter})}),[e.filter]),p.createElement("div",{ref:u,id:e.id,tabIndex:e.tabIndex,style:e.style,className:r.classNames("k-pivotgrid-configurator",e.className)},p.createElement("div",{className:r.classNames("k-pivotgrid-configurator-panel","k-pivotgrid-configurator-push",{"k-pivotgrid-configurator-horizontal":a,"k-pivotgrid-configurator-vertical":!a})},p.createElement("div",{className:"k-pivotgrid-configurator-header"},p.createElement("div",{className:"k-pivotgrid-configurator-header-text"},g.toLanguageString(x,k[x]))),p.createElement(h,{ref:r.canUseRef(h)?m:void 0,initialValues:b,onSubmit:(t,r)=>{e.onRowAxesChange&&e.onRowAxesChange({target:d.current,value:t.rowAxes,syntheticEvent:r}),e.onColumnAxesChange&&e.onColumnAxesChange({target:d.current,value:t.columnAxes,syntheticEvent:r}),e.onMeasureAxesChange&&e.onMeasureAxesChange({target:d.current,value:t.measureAxes,syntheticEvent:r}),e.onSortChange&&e.onSortChange({target:d.current,value:t.sort,syntheticEvent:r}),e.onFilterChange&&e.onFilterChange({target:d.current,value:t.filter,syntheticEvent:r})},render:t=>p.createElement(p.Fragment,null,p.createElement("div",{className:"k-pivotgrid-configurator-content"},p.createElement(C,{horizontal:a,...w},p.createElement(v,{...t,horizontal:e.horizontal,onFieldsEditorFieldExpand:e.onFieldsEditorFieldExpand,onFieldsEditorFieldCheck:e.onFieldsEditorFieldCheck,onAxisFilterFieldExpand:e.onAxisFilterFieldExpand,onAxisFilterFieldsExpandChange:e.onAxisFilterFieldsExpandChange,data:o,...f}))),p.createElement("div",{className:"k-pivotgrid-configurator-actions k-actions k-hstack k-justify-content-end"},p.createElement(l.Button,{type:"submit",onClick:t.onFormReset},g.toLanguageString(E,k[E])),p.createElement(l.Button,{themeColor:"primary",type:"submit",onClick:t.onSubmit},g.toLanguageString(y,k[y])))),...A})))})),ie={form:s.Form,formElement:s.FormElement,editor:oe,horizontal:!1,data:[],columnAxes:[],rowAxes:[],measureAxes:[]};se.defaultProps=ie,se.displayName="KendoReactPivotGridConfigurator";const ce=p.forwardRef(((e,t)=>{const a=p.useRef(null),l=p.useRef(null),s=n.useLocalization();p.useImperativeHandle(a,(()=>({props:e,element:l.current}))),p.useImperativeHandle(t,(()=>a.current));const[i,c]=r.useCustomComponent(e.icon||ue.icon),u=p.useMemo((()=>r.classNames("k-pivotgrid-configurator-button",e.className)),[e.className]),d=r.useMouse(e,a);return p.createElement("div",{ref:l,id:e.id,className:u,tabIndex:e.tabIndex,...d},p.createElement("span",null,s.toLanguageString(N,k[N]),p.createElement(i,{name:"gear",icon:o.gearIcon,...c})))})),ue={icon:r.IconWrap};ce.defaultProps=ue,ce.displayName="KendoReactPivotGridConfiguratorButton";const de=e=>{const[t,n]=p.useState(!0),[o,l]=p.useState({data:[],columns:[],rows:[]}),[s,i]=p.useState([]),[c,u]=p.useState(e.defaultColumnAxes||[]),[d,m]=p.useState(e.defaultRowAxes||[]),[g,v]=p.useState(e.defaultMeasureAxes||[]),[f,h]=p.useState(e.defaultSort||[]),[x,E]=p.useState(e.defaultFilter||[]),y=e=>{m(e.value)},A=e=>{u(e.value)};p.useEffect((()=>{n(!0);const t={connection:{catalog:e.catalog,cube:e.cube},columnAxes:c.slice(),rowAxes:d.slice(),measureAxes:g,sort:f,filter:x};setTimeout((()=>{a.fetchData({url:e.url},r.clone(t)).then(a.createDataState).then((e=>{l(e),n(!1)}))}))}),[c,d,g,x,f,e.cube,e.catalog,e.url]),p.useEffect((()=>{n(!0);const t={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube},command:"schemaDimensions"};a.fetchDiscover({url:e.url},t).then((e=>{a.addKPI(e),i(e),n(!1)}))}),[e.catalog,e.cube,e.url]);const C=(e=[],t)=>{for(let r=0;r<e.length;r++){const n=e[r];if(String(n.name)===String(t.name))return n}return null},w=(e=[],t)=>{for(let r=0;r<e.length;r++){const n=e[r];if(n.uniqueName===t.uniqueName)return n;let a=w(n.children,t);if(null!==a)return a}return null};return{pivotProps:{rowAxes:d,columnAxes:c,data:o.data,rows:o.rows,columns:o.columns,onRowAxesChange:y,onColumnAxesChange:A},configuratorProps:{sort:f,onSortChange:e=>{h(e.value)},filter:x,onFilterChange:e=>{E(e.value)},data:s,rowAxes:d,columnAxes:c,measureAxes:g,onRowAxesChange:y,onColumnAxesChange:A,onMeasureAxesChange:e=>{v(e.value)},onFieldsEditorFieldExpand:async t=>{const r=s.slice(),n=w(r,t.value);if(n&&"[KPIs]"===n.uniqueName){const t=me(await(async()=>{const t={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube},command:"schemaKPIs"};return a.fetchDiscover({url:e.url},t)})());n.children=t}else if(n&&"kpi"===n.type)n.children=a.buildKPIMeasures(n);else if(n&&!n.children){const t=await(async t=>{let r,n,o;2===t.type?r="schemaMeasures":t.dimensionUniqueName?(r="schemaLevels",o=t.uniqueName):(r="schemaHierarchies",n=t.uniqueName);const l={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube,hierarchyUniqueName:o,dimensionUniqueName:n,levelUniqueName:void 0,memberUniqueName:void 0,treeOp:void 0},command:r};return a.fetchDiscover({url:e.url},l)})(n);n.children=t}i(r)},onAxisFilterFieldExpand:async t=>{if(!t)return;const r={rowAxes:[d,m],columnAxes:[c,u],measureAxes:[g,v]},[n,o]=r[t.target.props.axes],l=n.slice(),s=C(l,t.target.props.dataItem);if(s){const r=(s.fields||[]).slice(),n=w(r,t.value);if(n&&(!n.children||!n.children.length)){const t=await(async t=>{let r,n,o;t.uniqueName&&(r="schemaMembers",n=t.uniqueName.replace(/\&/g,"&"),o=1);const l={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube,hierarchyUniqueName:void 0,dimensionUniqueName:void 0,levelUniqueName:void 0,memberUniqueName:n,treeOp:o},command:r};return a.fetchDiscover({url:e.url},l)})(n);n.children=t,s.fields=r,o(l)}}},onAxisFilterFieldsExpandChange:async t=>{if(!t)return;const r={rowAxes:[d,m],columnAxes:[c,u],measureAxes:[g,v]},[n,o]=r[t.target.props.axes],l=n.slice(),s=C(l,t.target.props.dataItem);if(s&&!s.fields){const t=await(async t=>{let r,n;t.name&&(r="schemaMembers",n=`${String(t.name)}.[(ALL)]`);const o={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube,hierarchyUniqueName:void 0,dimensionUniqueName:void 0,levelUniqueName:n,memberUniqueName:void 0,treeOp:void 0},command:r};return a.fetchDiscover({url:e.url},o)})(s);s.fields=t,o(l)}}},state:{loading:t}}},me=e=>{for(let t=0,r=e.length;t<r;t++)e[t].uniqueName=e[t].name,e[t].type="kpi";return e},pe={dataField:"aggregate",columnsData:"columns"},ge="&",ve=e=>{const[t,r]=p.useState(!0),[n,o]=p.useState(e.defaultColumnAxes||[]),[l,s]=p.useState(e.defaultRowAxes||[]),[i,c]=p.useState(e.defaultMeasureAxes||[]),[u,d]=p.useState(e.defaultSort||[]),[m,g]=p.useState(e.defaultFilter||[]),[v,f]=p.useState(new Map),h=p.useCallback((e=>{s(e.value)}),[]),x=p.useCallback((e=>{o(e.value)}),[]),E=p.useMemo((()=>Array.from(a.rootFields(n).keys()).join(ge)),[n]),y=p.useMemo((()=>Array.from(a.rootFields(l).keys()).join(ge)),[l]),A=p.useCallback((t=>({key:t,...e.dimensions[t]})),[e.dimensions]),C=p.useMemo((()=>E?E.split(ge).map(A):[]),[E,A]),w=p.useMemo((()=>y?y.split(ge).map(A):[]),[y,A]),b=p.useMemo((()=>i.map((t=>e.measures.find((e=>String(e.name)===String(t.name))))).filter(Boolean)),[i,e.measures]);p.useEffect((()=>{r(!0),setTimeout((()=>{const t=a.createDataTree(e.data,w,C,b,pe,m);f(t),r(!1)}),0)}),[e.data,w,C,b,m]);const I=p.useMemo((()=>a.createFlatSchemaDimensions(e.dimensions,e.measures)),[e.dimensions,e.measures]),N=p.useMemo((()=>a.createLocalDataState({dataTree:v,rowSettings:w,columnSettings:C,rowAxes:l,columnAxes:n,measures:b,sort:u,fields:pe})),[n,C,v,l,w,u]);return{pivotProps:{rowAxes:l,columnAxes:n,data:N.data,rows:N.rows,columns:N.columns,onRowAxesChange:h,onColumnAxesChange:x},configuratorProps:{sort:u,onSortChange:e=>{d(e.value)},filter:m,onFilterChange:e=>{g(e.value)},data:I,rowAxes:l,columnAxes:n,measureAxes:i,onRowAxesChange:h,onColumnAxesChange:x,onMeasureAxesChange:e=>{c(e.value)}},state:{loading:t}}};Object.defineProperty(e,"averageAggregate",{enumerable:!0,get:function(){return a.averageAggregate}}),Object.defineProperty(e,"maxAggregate",{enumerable:!0,get:function(){return a.maxAggregate}}),Object.defineProperty(e,"minAggregate",{enumerable:!0,get:function(){return a.minAggregate}}),Object.defineProperty(e,"sumAggregate",{enumerable:!0,get:function(){return a.sumAggregate}}),e.PivotGrid=K,e.PivotGridAxesEditor=te,e.PivotGridAxisEditor=Q,e.PivotGridAxisFilterFieldsEditor=W,e.PivotGridCell=S,e.PivotGridColumn=T,e.PivotGridConfigurator=se,e.PivotGridConfiguratorButton=ce,e.PivotGridConfiguratorEditor=oe,e.PivotGridContainer=z,e.PivotGridFieldsEditor=ne,e.PivotGridHeaderCell=P,e.PivotGridRow=R,e.PivotLocalDataService=e=>{const t=ve(e);return e.children(t)},e.PivotOLAPService=e=>{const t=de(e);return e.children(t)},e.dataCells=(e,t,r)=>{const n=JSON.parse(JSON.stringify(e||[])),o=JSON.parse(JSON.stringify(t||[])),l=JSON.parse(JSON.stringify(r||[])),s=a.toTree(n),[,i,c]=a.toRows(s),u=a.toTree(o),[,d,,m]=a.toColumns(u);return a.toData(l,d,i,m,c)},e.usePivotLocalDataService=ve,e.usePivotOLAPService=de}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react");function y(e){const r=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(r,n,l.get?l:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const s=y(o);var t=(e=>(e.toggle="EXPAND_TOGGLE",e.expand="EXPAND_EXPAND",e.collapse="EXPAND_COLLAPSE",e))(t||{});const p=(e,r,n)=>{switch(r.type){case"EXPAND_TOGGLE":return Array.isArray(e)?e.find(l=>n(l,r.payload))?[...e.filter(l=>!n(l,r.payload))]:[...e,r.payload]:n(e,r.payload)?null:r.payload;case"EXPAND_EXPAND":if(Array.isArray(e)){if(!e.find(l=>n(l,r.payload)))return[...e,r.payload]}else if(!n(e,r.payload))return r.payload;break;case"EXPAND_COLLAPSE":if(Array.isArray(e)){if(e.find(l=>n(l,r.payload)))return[...e.filter(l=>!n(l,r.payload))]}else n(e,r.payload);break;default:return e}},A=(e=[],r,n,l=(a,d)=>a===d)=>{const[a,d]=s.useState(e);return[a,(f,i)=>{const u=p(a,f,l);r&&r.call(void 0,{value:u,target:n.current,syntheticEvent:i}),d(u)}]};exports.EXPANSION_ACTION=t;exports.useExpansion=A;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as p from "react";
|
|
10
|
+
var i = /* @__PURE__ */ ((r) => (r.toggle = "EXPAND_TOGGLE", r.expand = "EXPAND_EXPAND", r.collapse = "EXPAND_COLLAPSE", r))(i || {});
|
|
11
|
+
const A = (r, e, d) => {
|
|
12
|
+
switch (e.type) {
|
|
13
|
+
case "EXPAND_TOGGLE":
|
|
14
|
+
return Array.isArray(r) ? r.find((l) => d(l, e.payload)) ? [...r.filter((l) => !d(l, e.payload))] : [...r, e.payload] : d(r, e.payload) ? null : e.payload;
|
|
15
|
+
case "EXPAND_EXPAND":
|
|
16
|
+
if (Array.isArray(r)) {
|
|
17
|
+
if (!r.find((l) => d(l, e.payload)))
|
|
18
|
+
return [...r, e.payload];
|
|
19
|
+
} else if (!d(r, e.payload))
|
|
20
|
+
return e.payload;
|
|
21
|
+
break;
|
|
22
|
+
case "EXPAND_COLLAPSE":
|
|
23
|
+
if (Array.isArray(r)) {
|
|
24
|
+
if (r.find((l) => d(l, e.payload)))
|
|
25
|
+
return [...r.filter((l) => !d(l, e.payload))];
|
|
26
|
+
} else
|
|
27
|
+
d(r, e.payload);
|
|
28
|
+
break;
|
|
29
|
+
default:
|
|
30
|
+
return r;
|
|
31
|
+
}
|
|
32
|
+
}, s = (r = [], e, d, l = (n, a) => n === a) => {
|
|
33
|
+
const [n, a] = p.useState(r);
|
|
34
|
+
return [n, (u, f) => {
|
|
35
|
+
const y = A(n, u, l);
|
|
36
|
+
e && e.call(void 0, {
|
|
37
|
+
value: y,
|
|
38
|
+
target: d.current,
|
|
39
|
+
syntheticEvent: f
|
|
40
|
+
}), a(y);
|
|
41
|
+
}];
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
i as EXPANSION_ACTION,
|
|
45
|
+
s as useExpansion
|
|
46
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@progress/kendo-pivotgrid-common"),c=(e,n,r)=>[e,(s,d)=>{const o=t.headersReducer(e,{...s,tree:n});r&&r(o,d)}];Object.defineProperty(exports,"HEADERS_ACTION",{enumerable:!0,get:()=>t.HEADERS_ACTION});exports.useHeaders=c;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import { headersReducer as o } from "@progress/kendo-pivotgrid-common";
|
|
10
|
+
import { HEADERS_ACTION as A } from "@progress/kendo-pivotgrid-common";
|
|
11
|
+
const i = (e, s, r) => [e, (t, d) => {
|
|
12
|
+
const n = o(e, { ...t, tree: s });
|
|
13
|
+
r && r(n, d);
|
|
14
|
+
}];
|
|
15
|
+
export {
|
|
16
|
+
A as HEADERS_ACTION,
|
|
17
|
+
i as useHeaders
|
|
18
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react");function i(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const s=i(u),f=(...e)=>{const t=s.useRef();return n=>{t.current!==void 0&&window.cancelAnimationFrame(t.current);const o=n.currentTarget,l=o.scrollLeft;e.forEach(a=>{const c=a.current;c&&c!==o&&(t.current=window.requestAnimationFrame(()=>{c.scrollLeft=Math.round(l)}))})}};exports.useHorizontalScrollSync=f;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as a from "react";
|
|
10
|
+
const i = (...n) => {
|
|
11
|
+
const r = a.useRef();
|
|
12
|
+
return (o) => {
|
|
13
|
+
r.current !== void 0 && window.cancelAnimationFrame(r.current);
|
|
14
|
+
const t = o.currentTarget, c = t.scrollLeft;
|
|
15
|
+
n.forEach((l) => {
|
|
16
|
+
const e = l.current;
|
|
17
|
+
e && e !== t && (r.current = window.requestAnimationFrame(() => {
|
|
18
|
+
e.scrollLeft = Math.round(c);
|
|
19
|
+
}));
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
i as useHorizontalScrollSync
|
|
25
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react"),f=require("./useExpansion.js"),D=require("../utils/index.js"),m=require("@progress/kendo-pivotgrid-common");function E(r){const d=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(d,t,i.get?i:{enumerable:!0,get:()=>r[t]})}}return d.default=r,Object.freeze(d)}const s=E(_);var x=(r=>(r.toggleExpansion="PIVOT_CONFIGURATOR_ACTION_TOGGLE_EXPANSION",r))(x||{});const c={...m.PIVOT_CONFIGURATOR_ACTION,...x},w=(r,d)=>{const t=r.valueGetter("rowAxes"),i=r.valueGetter("columnAxes"),n=r.valueGetter("measureAxes"),u=r.valueGetter("sort"),v=r.valueGetter("filter"),[O,T]=f.useExpansion([],void 0,d,D.compareFields),[l,p]=s.useState(null),[a,I]=s.useState(null),[g,C]=s.useState(null),[A,N]=s.useState(null);return[{dragItem:l,dropTarget:g,dropZone:a,dropDirection:A,columnAxes:i,rowAxes:t,measureAxes:n,sort:u,filter:v,expanded:O},(e,P)=>{switch(e.type){case c.toggleExpansion:{T({type:f.EXPANSION_ACTION.toggle,payload:e.payload},P);break}default:const o=m.configuratorReducer({filter:e.override&&e.override.filter!==void 0?e.override.filter:v,sort:e.override&&e.override.sort!==void 0?e.override.sort:u,rowAxes:e.override&&e.override.rowAxes!==void 0?e.override.rowAxes:t,columnAxes:e.override&&e.override.columnAxes!==void 0?e.override.columnAxes:i,measureAxes:e.override&&e.override.measureAxes!==void 0?e.override.measureAxes:n,dragItem:e.override&&e.override.dragItem!==void 0?e.override.dragItem:l,dropDirection:e.override&&e.override.dropDirection!==void 0?e.override.dropDirection:A,dropTarget:e.override&&e.override.dropTarget!==void 0?e.override.dropTarget:g,dropZone:e.override&&e.override.dropZone!==void 0?e.override.dropZone:a},e);o.columnAxes!==void 0&&r.onChange("columnAxes",{value:o.columnAxes}),o.rowAxes!==void 0&&r.onChange("rowAxes",{value:o.rowAxes}),o.measureAxes!==void 0&&r.onChange("measureAxes",{value:o.measureAxes}),o.sort!==void 0&&r.onChange("sort",{value:o.sort}),o.filter!==void 0&&r.onChange("filter",{value:o.filter}),o.dropDirection!==void 0&&N(o.dropDirection),o.dropTarget!==void 0&&C(o.dropTarget),o.dropZone!==void 0&&I(o.dropZone),o.dragItem!==void 0&&p(o.dragItem);break}}]};exports.PIVOT_CONFIGURATOR_ACTION=c;exports.usePivotConfiguratorEditor=w;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as d from "react";
|
|
10
|
+
import { useExpansion as N, EXPANSION_ACTION as D } from "./useExpansion.mjs";
|
|
11
|
+
import { compareFields as G } from "../utils/index.mjs";
|
|
12
|
+
import { PIVOT_CONFIGURATOR_ACTION as _, configuratorReducer as c } from "@progress/kendo-pivotgrid-common";
|
|
13
|
+
var m = /* @__PURE__ */ ((o) => (o.toggleExpansion = "PIVOT_CONFIGURATOR_ACTION_TOGGLE_EXPANSION", o))(m || {});
|
|
14
|
+
const w = {
|
|
15
|
+
..._,
|
|
16
|
+
...m
|
|
17
|
+
}, S = (o, x) => {
|
|
18
|
+
const t = o.valueGetter("rowAxes"), i = o.valueGetter("columnAxes"), s = o.valueGetter("measureAxes"), v = o.valueGetter("sort"), u = o.valueGetter("filter"), [g, f] = N(
|
|
19
|
+
[],
|
|
20
|
+
void 0,
|
|
21
|
+
x,
|
|
22
|
+
G
|
|
23
|
+
), [l, I] = d.useState(null), [n, T] = d.useState(null), [a, O] = d.useState(null), [A, p] = d.useState(null);
|
|
24
|
+
return [
|
|
25
|
+
{
|
|
26
|
+
dragItem: l,
|
|
27
|
+
dropTarget: a,
|
|
28
|
+
dropZone: n,
|
|
29
|
+
dropDirection: A,
|
|
30
|
+
columnAxes: i,
|
|
31
|
+
rowAxes: t,
|
|
32
|
+
measureAxes: s,
|
|
33
|
+
sort: v,
|
|
34
|
+
filter: u,
|
|
35
|
+
expanded: g
|
|
36
|
+
},
|
|
37
|
+
(e, C) => {
|
|
38
|
+
switch (e.type) {
|
|
39
|
+
case w.toggleExpansion: {
|
|
40
|
+
f({ type: D.toggle, payload: e.payload }, C);
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
default:
|
|
44
|
+
const r = c(
|
|
45
|
+
{
|
|
46
|
+
filter: e.override && e.override.filter !== void 0 ? e.override.filter : u,
|
|
47
|
+
sort: e.override && e.override.sort !== void 0 ? e.override.sort : v,
|
|
48
|
+
rowAxes: e.override && e.override.rowAxes !== void 0 ? e.override.rowAxes : t,
|
|
49
|
+
columnAxes: e.override && e.override.columnAxes !== void 0 ? e.override.columnAxes : i,
|
|
50
|
+
measureAxes: e.override && e.override.measureAxes !== void 0 ? e.override.measureAxes : s,
|
|
51
|
+
dragItem: e.override && e.override.dragItem !== void 0 ? e.override.dragItem : l,
|
|
52
|
+
dropDirection: e.override && e.override.dropDirection !== void 0 ? e.override.dropDirection : A,
|
|
53
|
+
dropTarget: e.override && e.override.dropTarget !== void 0 ? e.override.dropTarget : a,
|
|
54
|
+
dropZone: e.override && e.override.dropZone !== void 0 ? e.override.dropZone : n
|
|
55
|
+
},
|
|
56
|
+
e
|
|
57
|
+
);
|
|
58
|
+
r.columnAxes !== void 0 && o.onChange("columnAxes", { value: r.columnAxes }), r.rowAxes !== void 0 && o.onChange("rowAxes", { value: r.rowAxes }), r.measureAxes !== void 0 && o.onChange("measureAxes", { value: r.measureAxes }), r.sort !== void 0 && o.onChange("sort", { value: r.sort }), r.filter !== void 0 && o.onChange("filter", { value: r.filter }), r.dropDirection !== void 0 && p(r.dropDirection), r.dropTarget !== void 0 && O(r.dropTarget), r.dropZone !== void 0 && T(r.dropZone), r.dragItem !== void 0 && I(r.dragItem);
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
];
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
w as PIVOT_CONFIGURATOR_ACTION,
|
|
66
|
+
S as usePivotConfiguratorEditor
|
|
67
|
+
};
|