@progress/kendo-react-pivotgrid 14.5.0-develop.8 → 15.0.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.d.ts +6 -1
- package/PivotGrid.js +1 -1
- package/PivotGrid.mjs +52 -52
- package/README.md +4 -4
- package/dist/cdn/js/kendo-react-pivotgrid.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +16 -11
package/PivotGrid.d.ts
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
+
import { WebMcpProps, CustomComponent } from '@progress/kendo-react-common';
|
|
8
9
|
import { PivotGridRowProps } from './components/Row.js';
|
|
9
10
|
import { PivotGridCellProps } from './components/Cell.js';
|
|
10
11
|
import { PivotGridHeaderCellProps } from './components/HeaderCell.js';
|
|
11
12
|
import { PivotGridColumnProps } from './components/Column.js';
|
|
12
|
-
import { CustomComponent } from '@progress/kendo-react-common';
|
|
13
13
|
import { PivotGridAxis, PivotDataItem, Tuple, AxisRow } from '@progress/kendo-pivotgrid-common';
|
|
14
14
|
import { PivotGridAxesChangeEvent } from './models/index.js';
|
|
15
15
|
import * as React from 'react';
|
|
@@ -260,6 +260,11 @@ export interface PivotGridProps {
|
|
|
260
260
|
* ```
|
|
261
261
|
*/
|
|
262
262
|
dataColumn?: React.ComponentType<PivotGridColumnProps>;
|
|
263
|
+
/**
|
|
264
|
+
* Enables Web MCP tool registration for this component.
|
|
265
|
+
* Requires a parent `WebMcpProvider` from `@progress/kendo-react-webmcp`.
|
|
266
|
+
*/
|
|
267
|
+
webMcp?: boolean | WebMcpProps;
|
|
263
268
|
}
|
|
264
269
|
/**
|
|
265
270
|
* Represents the object which is passed to the [`ref`](https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom) callback of the PivotGrid component.
|
package/PivotGrid.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Se=require("react"),l=require("@progress/kendo-react-common"),J=require("./package-metadata.js"),Pe=require("@progress/kendo-react-intl"),D=require("./messages/index.js"),Ae=require("./components/Row.js"),xe=require("./components/Cell.js"),Q=require("./hooks/useHeaders.js"),Te=require("./components/HeaderCell.js"),Ne=require("./hooks/useHorizontalScrollSync.js"),qe=require("./hooks/useVerticalScrollSync.js"),De=require("./components/Column.js"),f=require("./utils/index.js"),u=require("@progress/kendo-pivotgrid-common");function Oe(n){const w=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const m in n)if(m!=="default"){const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Se=require("react"),l=require("@progress/kendo-react-common"),J=require("./package-metadata.js"),Pe=require("@progress/kendo-react-intl"),D=require("./messages/index.js"),Ae=require("./components/Row.js"),xe=require("./components/Cell.js"),Q=require("./hooks/useHeaders.js"),Te=require("./components/HeaderCell.js"),Ne=require("./hooks/useHorizontalScrollSync.js"),qe=require("./hooks/useVerticalScrollSync.js"),De=require("./components/Column.js"),f=require("./utils/index.js"),u=require("@progress/kendo-pivotgrid-common");function Oe(n){const w=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const m in n)if(m!=="default"){const E=Object.getOwnPropertyDescriptor(n,m);Object.defineProperty(w,m,E.get?E:{enumerable:!0,get:()=>n[m]})}}return w.default=n,Object.freeze(w)}const t=Oe(Se),U=t.forwardRef((n,w)=>{const m=!l.validatePackage(J.packageMetadata,{component:"PivotGrid"}),E=l.getLicenseMessage(J.packageMetadata),{rows:Y,rowAxes:Z,columns:ee,columnAxes:te,data:ne}={...v,...n},c=t.useRef(null),b=t.useRef(null),d=t.useRef(null),y=t.useRef(null),O=t.useRef(null),z=t.useRef(null),S=t.useRef(null),ae=Pe.useLocalization(),oe=(e,r)=>{n.onRowAxesChange&&n.onRowAxesChange({value:e,target:b.current,syntheticEvent:r})},re=(e,r)=>{n.onColumnAxesChange&&n.onColumnAxesChange({value:e,target:b.current,syntheticEvent:r})},L=u.toTree((Y||[]).slice()),[,se]=Q.useHeaders((Z||[]).slice(),L,oe),[I,C,le,G]=u.toRows(L),M=u.toTree((ee||[]).slice()),[,ce]=Q.useHeaders((te||[]).slice(),M,re),[R,i,,j]=u.toColumns(M),P=u.toData((ne||[]).slice(),i,C,j,le);t.useImperativeHandle(b,()=>({props:n,element:c.current,columnHeaderRows:R,rowHeaderRows:I,dataCells:P,rowHeaderBreadth:G,columnHeaderBreadth:j})),t.useImperativeHandle(w,()=>b.current),l.useWebMcpRegister("pivotgrid",b,n,n.webMcp);const K=[],B=[],V=[],[A,x]=l.useCustomComponent(n.row||v.row),[T,N]=l.useCustomComponent(n.column||v.column),[ie,ue]=l.useCustomComponent(n.cell||v.cell),[W,_]=l.useCustomComponent(n.headerCell||v.headerCell),de=n.columnHeadersRow||A,me=n.columnHeadersColumn||T,Ce=n.columnHeadersCell||W,ge=n.rowHeadersRow||A,pe=n.rowHeadersColumn||T,he=n.rowHeadersCell||W,fe=n.dataRow||A,we=n.dataColumn||T;for(let e=0;e<i.length;e++)K.push(t.createElement(we,{key:String(i[e].path),...N,path:i[e].path})),V.push(t.createElement(me,{key:String(i[e].path),...N,path:i[e].path}));for(let e=0;e<G;e++)B.push(t.createElement(pe,{key:e,...N}));const be=e=>{e.target.props.expandable&&ce({type:u.HEADERS_ACTION.toggle,payload:e.target.props.dataItem.path},e.syntheticEvent)},ye=e=>{e.target.props.expandable&&se({type:u.HEADERS_ACTION.toggle,payload:e.target.props.dataItem.path},e.syntheticEvent)},F=Ne.useHorizontalScrollSync(S,z),ve=qe.useVerticalScrollSync(S,O),Ee=e=>{F(e),ve(e)},X=t.useCallback(()=>{c.current&&y.current&&(c.current.style.gridTemplateRows="",c.current.style.gridTemplateRows=`${y.current.offsetHeight}px 1fr`)},[]),$=t.useCallback(()=>{c.current&&d.current&&(c.current.style.gridTemplateColumns="",c.current.style.gridTemplateColumns=`${d.current.offsetWidth}px 1fr`)},[]),g=t.useRef(new u.PivotGridNavigation({tabIndex:n.tabIndex||0}));t.useEffect(()=>{if(c.current){const e=n.tabIndex||0;if(g.current.stop(),g.current.tabIndex=e,n.navigatable){g.current.start(c.current);const r=g.current.first;r&&r.setAttribute("tabindex",String(e))}}return()=>{g.current.stop()}},[n.tabIndex,n.navigatable]),t.useEffect(()=>{g.current.update()}),t.useEffect(()=>{if(y.current){const e=new window.ResizeObserver(()=>{window.requestAnimationFrame(()=>{X()})});return e.observe(y.current),()=>{e.disconnect()}}},[X]),t.useEffect(()=>{if(d.current){const e=new window.ResizeObserver(()=>{window.requestAnimationFrame(()=>{$()})});return e.observe(d.current),()=>{e.disconnect()}}},[$]),l.useIsomorphicLayoutEffect(()=>{if(l.setScrollbarWidth(),d.current){const e=new window.ResizeObserver(()=>window.requestAnimationFrame(()=>{l.setScrollbarWidth()}));return e.observe(d.current),()=>{e.disconnect()}}},[]);const p=new Array(R.length).fill([]).map(()=>new Array(i.length));R.forEach((e,r)=>{let a=0;Array.from(e.cells).forEach(o=>{const s=!!(o&&o.children&&o.children.length),q=(o?f.generateKey(o.normalizedPath)+(o.total?"|[TOTAL]":"")+(s?"|[EXPANDED]":""):"").replace(/\s/g,"-");if(o)for(let k=0;k<(o.colSpan||1);k++){for(let h=0;h<(o.rowSpan||1);h++){const Re=p[r+h].findIndex((He,ke)=>ke>=a&&!He);p[r+h][Re]=q}a++}})});const H=P.map(e=>e.cells.map(r=>f.generateDataKey(r.rowTuple.members,r.columnTuple.members).replace(/\s/g,"-")));return t.createElement("div",{ref:c,id:n.id,style:n.style,tabIndex:n.navigatable?void 0:n.tabIndex,className:l.classNames("k-pivotgrid",n.className),role:"grid"},m&&t.createElement(l.WatermarkOverlay,{message:E}),t.createElement("span",{className:"k-pivotgrid-empty-cell"},t.createElement("span",{className:"k-sr-only"},ae.toLanguageString(D.emptyCellAriaLabel,D.messages[D.emptyCellAriaLabel]))),t.createElement("div",{ref:z,className:"k-pivotgrid-column-headers",onScroll:F},t.createElement("table",{ref:y,className:"k-pivotgrid-table",role:"none"},t.createElement("colgroup",null,V),t.createElement("tbody",{className:"k-pivotgrid-tbody",role:"rowgroup"},R.map((e,r)=>{let a=!1;return t.createElement(de,{key:e.name,role:"row",...x},e.cells.map((o,s)=>{const q=s!==0&&!a;o&&(a=!0);const k=o&&!!(o.children&&o.children.length),h=o&&o.hasChildren&&(!o.total||o.total&&o.parent.total);return o?t.createElement(Ce,{..._,key:p[r][s],"data-key":p[r][s],id:p[r][s],columnPath:o.normalizedPath,rowSpan:o.rowSpan||void 0,colSpan:o.colSpan||void 0,onIconClick:be,dataItem:o,expanded:k,expandable:h,total:o.total,first:q,root:o.levelNum===0,role:"columnheader"},o.caption):null}))})))),t.createElement("div",{ref:O,className:"k-pivotgrid-row-headers"},t.createElement("table",{ref:d,className:"k-pivotgrid-table",role:"none"},t.createElement("colgroup",null,B),t.createElement("tbody",{className:"k-pivotgrid-tbody",role:"rowgroup"},I.map((e,r)=>t.createElement(ge,{key:f.generateKey(C[r].path),...x,path:C[r].path,role:"row",ariaOwns:H[r].join(" ")},e.cells.filter(Boolean).map(a=>a?t.createElement(he,{..._,key:f.generateKey(a.normalizedPath)+(a.total?"|[TOTAL]":"")+(a.children&&a.children.length?"|[EXPANDED]":""),"data-key":f.generateKey(a.normalizedPath)+(a.total?"|[TOTAL]":"")+(a.children&&a.children.length?"|[EXPANDED]":""),rowPath:a.normalizedPath,rowSpan:a.rowSpan||void 0,colSpan:a.colSpan||void 0,dataItem:a,expanded:!!(a.children&&a.children.length),expandable:a.hasChildren&&!a.total,total:a.total,onIconClick:ye,root:a.levelNum===0,role:"rowheader"},a.caption):null)))))),t.createElement("div",{ref:S,className:"k-pivotgrid-values",onScroll:Ee},t.createElement("table",{className:"k-pivotgrid-table",role:"none"},t.createElement("colgroup",null,K),t.createElement("tbody",{className:"k-pivotgrid-tbody",role:"none"},P.map((e,r)=>t.createElement(fe,{key:f.generateKey(C[r].path),...x,path:C[r].path,role:"none"},e.cells.map((a,o)=>t.createElement(ie,{key:H[r][o],"data-key":H[r][o],id:H[r][o],...ue,rowPath:a.rowTuple.members.map(s=>s.name),columnPath:a.columnTuple.members.map(s=>s.name),dataItem:a,total:C[r].total||i[o].total,role:"gridcell",ariaDescribedby:p.map(s=>s[o]).join(" ")},a&&a.data&&a.data.fmtValue?a.data.fmtValue:" "))))))))}),v={rowAxes:[],columnAxes:[],data:[],row:Ae.PivotGridRow,column:De.PivotGridColumn,cell:xe.PivotGridCell,headerCell:Te.PivotGridHeaderCell};U.displayName="KendoReactPivotGrid";exports.PivotGrid=U;
|
package/PivotGrid.mjs
CHANGED
|
@@ -6,36 +6,36 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
|
-
import { validatePackage as xe, getLicenseMessage as Ae, useCustomComponent as y, useIsomorphicLayoutEffect as
|
|
9
|
+
import { validatePackage as xe, getLicenseMessage as Ae, useWebMcpRegister as Pe, useCustomComponent as y, useIsomorphicLayoutEffect as Ne, setScrollbarWidth as K, classNames as Te, WatermarkOverlay as De } from "@progress/kendo-react-common";
|
|
10
10
|
import { packageMetadata as X } from "./package-metadata.mjs";
|
|
11
|
-
import { useLocalization as
|
|
12
|
-
import { emptyCellAriaLabel as j, messages as
|
|
13
|
-
import { PivotGridRow as
|
|
14
|
-
import { PivotGridCell as
|
|
11
|
+
import { useLocalization as ze } from "@progress/kendo-react-intl";
|
|
12
|
+
import { emptyCellAriaLabel as j, messages as Le } from "./messages/index.mjs";
|
|
13
|
+
import { PivotGridRow as Oe } from "./components/Row.mjs";
|
|
14
|
+
import { PivotGridCell as Ge } from "./components/Cell.mjs";
|
|
15
15
|
import { useHeaders as $ } from "./hooks/useHeaders.mjs";
|
|
16
|
-
import { PivotGridHeaderCell as
|
|
17
|
-
import { useHorizontalScrollSync as
|
|
18
|
-
import { useVerticalScrollSync as
|
|
16
|
+
import { PivotGridHeaderCell as Ie } from "./components/HeaderCell.mjs";
|
|
17
|
+
import { useHorizontalScrollSync as Be } from "./hooks/useHorizontalScrollSync.mjs";
|
|
18
|
+
import { useVerticalScrollSync as Me } from "./hooks/useVerticalScrollSync.mjs";
|
|
19
19
|
import { PivotGridColumn as Ve } from "./components/Column.mjs";
|
|
20
|
-
import { generateKey as
|
|
21
|
-
import { toTree as _, toRows as qe, toColumns as Fe, toData as Ke, PivotGridNavigation as
|
|
22
|
-
const
|
|
20
|
+
import { generateKey as C, generateDataKey as We } from "./utils/index.mjs";
|
|
21
|
+
import { toTree as _, toRows as qe, toColumns as Fe, toData as Ke, PivotGridNavigation as Xe, HEADERS_ACTION as J } from "@progress/kendo-pivotgrid-common";
|
|
22
|
+
const je = t.forwardRef((o, Q) => {
|
|
23
23
|
const U = !xe(X, { component: "PivotGrid" }), Y = Ae(X), {
|
|
24
24
|
rows: Z,
|
|
25
25
|
rowAxes: ee,
|
|
26
26
|
columns: te,
|
|
27
27
|
columnAxes: ae,
|
|
28
28
|
data: ne
|
|
29
|
-
} = { ...
|
|
29
|
+
} = { ...g, ...o }, s = t.useRef(null), h = t.useRef(null), i = t.useRef(null), f = t.useRef(null), P = t.useRef(null), N = t.useRef(null), E = t.useRef(null), oe = ze(), re = (e, r) => {
|
|
30
30
|
o.onRowAxesChange && o.onRowAxesChange({
|
|
31
31
|
value: e,
|
|
32
|
-
target:
|
|
32
|
+
target: h.current,
|
|
33
33
|
syntheticEvent: r
|
|
34
34
|
});
|
|
35
35
|
}, le = (e, r) => {
|
|
36
36
|
o.onColumnAxesChange && o.onColumnAxesChange({
|
|
37
37
|
value: e,
|
|
38
|
-
target:
|
|
38
|
+
target: h.current,
|
|
39
39
|
syntheticEvent: r
|
|
40
40
|
});
|
|
41
41
|
}, T = _((Z || []).slice()), [, se] = $((ee || []).slice(), T, re), [D, c, me, z] = qe(T), L = _((te || []).slice()), [, ie] = $((ae || []).slice(), L, le), [w, m, , O] = Fe(L), R = Ke(
|
|
@@ -45,7 +45,7 @@ const Xe = t.forwardRef((o, Q) => {
|
|
|
45
45
|
O,
|
|
46
46
|
me
|
|
47
47
|
);
|
|
48
|
-
t.useImperativeHandle(
|
|
48
|
+
t.useImperativeHandle(h, () => ({
|
|
49
49
|
props: o,
|
|
50
50
|
element: s.current,
|
|
51
51
|
columnHeaderRows: w,
|
|
@@ -53,12 +53,12 @@ const Xe = t.forwardRef((o, Q) => {
|
|
|
53
53
|
dataCells: R,
|
|
54
54
|
rowHeaderBreadth: z,
|
|
55
55
|
columnHeaderBreadth: O
|
|
56
|
-
})), t.useImperativeHandle(Q, () =>
|
|
57
|
-
const G = [], I = [], B = [], [H, k] = y(o.row ||
|
|
58
|
-
o.column ||
|
|
59
|
-
), [ce, de] = y(o.cell ||
|
|
60
|
-
o.headerCell ||
|
|
61
|
-
), ue = o.columnHeadersRow || H, pe = o.columnHeadersColumn || S, he = o.columnHeadersCell ||
|
|
56
|
+
})), t.useImperativeHandle(Q, () => h.current), Pe("pivotgrid", h, o, o.webMcp);
|
|
57
|
+
const G = [], I = [], B = [], [H, k] = y(o.row || g.row), [S, x] = y(
|
|
58
|
+
o.column || g.column
|
|
59
|
+
), [ce, de] = y(o.cell || g.cell), [M, V] = y(
|
|
60
|
+
o.headerCell || g.headerCell
|
|
61
|
+
), ue = o.columnHeadersRow || H, pe = o.columnHeadersColumn || S, he = o.columnHeadersCell || M, fe = o.rowHeadersRow || H, Ce = o.rowHeadersColumn || S, ge = o.rowHeadersCell || M, we = o.dataRow || H, be = o.dataColumn || S;
|
|
62
62
|
for (let e = 0; e < m.length; e++)
|
|
63
63
|
G.push(
|
|
64
64
|
/* @__PURE__ */ t.createElement(
|
|
@@ -97,13 +97,13 @@ const Xe = t.forwardRef((o, Q) => {
|
|
|
97
97
|
},
|
|
98
98
|
e.syntheticEvent
|
|
99
99
|
);
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
},
|
|
103
|
-
s.current &&
|
|
104
|
-
}, []),
|
|
100
|
+
}, W = Be(E, N), Ee = Me(E, P), Re = (e) => {
|
|
101
|
+
W(e), Ee(e);
|
|
102
|
+
}, q = t.useCallback(() => {
|
|
103
|
+
s.current && f.current && (s.current.style.gridTemplateRows = "", s.current.style.gridTemplateRows = `${f.current.offsetHeight}px 1fr`);
|
|
104
|
+
}, []), F = t.useCallback(() => {
|
|
105
105
|
s.current && i.current && (s.current.style.gridTemplateColumns = "", s.current.style.gridTemplateColumns = `${i.current.offsetWidth}px 1fr`);
|
|
106
|
-
}, []), d = t.useRef(new
|
|
106
|
+
}, []), d = t.useRef(new Xe({ tabIndex: o.tabIndex || 0 }));
|
|
107
107
|
t.useEffect(() => {
|
|
108
108
|
if (s.current) {
|
|
109
109
|
const e = o.tabIndex || 0;
|
|
@@ -119,32 +119,32 @@ const Xe = t.forwardRef((o, Q) => {
|
|
|
119
119
|
}, [o.tabIndex, o.navigatable]), t.useEffect(() => {
|
|
120
120
|
d.current.update();
|
|
121
121
|
}), t.useEffect(() => {
|
|
122
|
-
if (
|
|
122
|
+
if (f.current) {
|
|
123
123
|
const e = new window.ResizeObserver(() => {
|
|
124
124
|
window.requestAnimationFrame(() => {
|
|
125
|
-
|
|
125
|
+
q();
|
|
126
126
|
});
|
|
127
127
|
});
|
|
128
|
-
return e.observe(
|
|
128
|
+
return e.observe(f.current), () => {
|
|
129
129
|
e.disconnect();
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
|
-
}, [
|
|
132
|
+
}, [q]), t.useEffect(() => {
|
|
133
133
|
if (i.current) {
|
|
134
134
|
const e = new window.ResizeObserver(() => {
|
|
135
135
|
window.requestAnimationFrame(() => {
|
|
136
|
-
|
|
136
|
+
F();
|
|
137
137
|
});
|
|
138
138
|
});
|
|
139
139
|
return e.observe(i.current), () => {
|
|
140
140
|
e.disconnect();
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
|
-
}, [
|
|
144
|
-
if (
|
|
143
|
+
}, [F]), Ne(() => {
|
|
144
|
+
if (K(), i.current) {
|
|
145
145
|
const e = new window.ResizeObserver(
|
|
146
146
|
() => window.requestAnimationFrame(() => {
|
|
147
|
-
|
|
147
|
+
K();
|
|
148
148
|
})
|
|
149
149
|
);
|
|
150
150
|
return e.observe(i.current), () => {
|
|
@@ -156,7 +156,7 @@ const Xe = t.forwardRef((o, Q) => {
|
|
|
156
156
|
w.forEach((e, r) => {
|
|
157
157
|
let a = 0;
|
|
158
158
|
Array.from(e.cells).forEach((n) => {
|
|
159
|
-
const l = !!(n && n.children && n.children.length), A = (n ?
|
|
159
|
+
const l = !!(n && n.children && n.children.length), A = (n ? C(n.normalizedPath) + (n.total ? "|[TOTAL]" : "") + (l ? "|[EXPANDED]" : "") : "").replace(/\s/g, "-");
|
|
160
160
|
if (n)
|
|
161
161
|
for (let v = 0; v < (n.colSpan || 1); v++) {
|
|
162
162
|
for (let p = 0; p < (n.rowSpan || 1); p++) {
|
|
@@ -179,12 +179,12 @@ const Xe = t.forwardRef((o, Q) => {
|
|
|
179
179
|
id: o.id,
|
|
180
180
|
style: o.style,
|
|
181
181
|
tabIndex: o.navigatable ? void 0 : o.tabIndex,
|
|
182
|
-
className:
|
|
182
|
+
className: Te("k-pivotgrid", o.className),
|
|
183
183
|
role: "grid"
|
|
184
184
|
},
|
|
185
|
-
U && /* @__PURE__ */ t.createElement(
|
|
186
|
-
/* @__PURE__ */ t.createElement("span", { className: "k-pivotgrid-empty-cell" }, /* @__PURE__ */ t.createElement("span", { className: "k-sr-only" }, oe.toLanguageString(j,
|
|
187
|
-
/* @__PURE__ */ t.createElement("div", { ref: N, className: "k-pivotgrid-column-headers", onScroll:
|
|
185
|
+
U && /* @__PURE__ */ t.createElement(De, { message: Y }),
|
|
186
|
+
/* @__PURE__ */ t.createElement("span", { className: "k-pivotgrid-empty-cell" }, /* @__PURE__ */ t.createElement("span", { className: "k-sr-only" }, oe.toLanguageString(j, Le[j]))),
|
|
187
|
+
/* @__PURE__ */ t.createElement("div", { ref: N, className: "k-pivotgrid-column-headers", onScroll: W }, /* @__PURE__ */ t.createElement("table", { ref: f, className: "k-pivotgrid-table", role: "none" }, /* @__PURE__ */ t.createElement("colgroup", null, B), /* @__PURE__ */ t.createElement("tbody", { className: "k-pivotgrid-tbody", role: "rowgroup" }, w.map((e, r) => {
|
|
188
188
|
let a = !1;
|
|
189
189
|
return /* @__PURE__ */ t.createElement(ue, { key: e.name, role: "row", ...k }, e.cells.map((n, l) => {
|
|
190
190
|
const A = l !== 0 && !a;
|
|
@@ -193,7 +193,7 @@ const Xe = t.forwardRef((o, Q) => {
|
|
|
193
193
|
return n ? /* @__PURE__ */ t.createElement(
|
|
194
194
|
he,
|
|
195
195
|
{
|
|
196
|
-
...
|
|
196
|
+
...V,
|
|
197
197
|
key: u[r][l],
|
|
198
198
|
"data-key": u[r][l],
|
|
199
199
|
id: u[r][l],
|
|
@@ -216,7 +216,7 @@ const Xe = t.forwardRef((o, Q) => {
|
|
|
216
216
|
/* @__PURE__ */ t.createElement("div", { ref: P, className: "k-pivotgrid-row-headers" }, /* @__PURE__ */ t.createElement("table", { ref: i, className: "k-pivotgrid-table", role: "none" }, /* @__PURE__ */ t.createElement("colgroup", null, I), /* @__PURE__ */ t.createElement("tbody", { className: "k-pivotgrid-tbody", role: "rowgroup" }, D.map((e, r) => /* @__PURE__ */ t.createElement(
|
|
217
217
|
fe,
|
|
218
218
|
{
|
|
219
|
-
key:
|
|
219
|
+
key: C(c[r].path),
|
|
220
220
|
...k,
|
|
221
221
|
path: c[r].path,
|
|
222
222
|
role: "row",
|
|
@@ -226,9 +226,9 @@ const Xe = t.forwardRef((o, Q) => {
|
|
|
226
226
|
(a) => a ? /* @__PURE__ */ t.createElement(
|
|
227
227
|
ge,
|
|
228
228
|
{
|
|
229
|
-
...
|
|
230
|
-
key:
|
|
231
|
-
"data-key":
|
|
229
|
+
...V,
|
|
230
|
+
key: C(a.normalizedPath) + (a.total ? "|[TOTAL]" : "") + (a.children && a.children.length ? "|[EXPANDED]" : ""),
|
|
231
|
+
"data-key": C(a.normalizedPath) + (a.total ? "|[TOTAL]" : "") + (a.children && a.children.length ? "|[EXPANDED]" : ""),
|
|
232
232
|
rowPath: a.normalizedPath,
|
|
233
233
|
rowSpan: a.rowSpan || void 0,
|
|
234
234
|
colSpan: a.colSpan || void 0,
|
|
@@ -247,7 +247,7 @@ const Xe = t.forwardRef((o, Q) => {
|
|
|
247
247
|
/* @__PURE__ */ t.createElement("div", { ref: E, className: "k-pivotgrid-values", onScroll: Re }, /* @__PURE__ */ t.createElement("table", { className: "k-pivotgrid-table", role: "none" }, /* @__PURE__ */ t.createElement("colgroup", null, G), /* @__PURE__ */ t.createElement("tbody", { className: "k-pivotgrid-tbody", role: "none" }, R.map((e, r) => /* @__PURE__ */ t.createElement(
|
|
248
248
|
we,
|
|
249
249
|
{
|
|
250
|
-
key:
|
|
250
|
+
key: C(c[r].path),
|
|
251
251
|
...k,
|
|
252
252
|
path: c[r].path,
|
|
253
253
|
role: "none"
|
|
@@ -270,16 +270,16 @@ const Xe = t.forwardRef((o, Q) => {
|
|
|
270
270
|
))
|
|
271
271
|
)))))
|
|
272
272
|
);
|
|
273
|
-
}),
|
|
273
|
+
}), g = {
|
|
274
274
|
rowAxes: [],
|
|
275
275
|
columnAxes: [],
|
|
276
276
|
data: [],
|
|
277
|
-
row:
|
|
277
|
+
row: Oe,
|
|
278
278
|
column: Ve,
|
|
279
|
-
cell:
|
|
280
|
-
headerCell:
|
|
279
|
+
cell: Ge,
|
|
280
|
+
headerCell: Ie
|
|
281
281
|
};
|
|
282
|
-
|
|
282
|
+
je.displayName = "KendoReactPivotGrid";
|
|
283
283
|
export {
|
|
284
|
-
|
|
284
|
+
je as PivotGrid
|
|
285
285
|
};
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[](https://www.telerik.com/kendo-react-ui/components/free?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-pivotgrid&utm_content=banner)
|
|
1
|
+
[](https://www.telerik.com/kendo-react-ui/components/getting-started/free-vs-premium?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-pivotgrid&utm_content=banner)
|
|
2
2
|
|
|
3
3
|
# KendoReact PivotGrid (Pivot Table) Component for React
|
|
4
4
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
>
|
|
13
13
|
> [Start using KendoReact](https://www.telerik.com/try/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-pivotgrid) and speed up your development process!
|
|
14
14
|
>
|
|
15
|
-
> If you're looking for free React components, check out [Get Started with KendoReact Free](https://www.telerik.com/kendo-react-ui/components/
|
|
15
|
+
> If you're looking for free React components, check out [Get Started with KendoReact Free](https://www.telerik.com/kendo-react-ui/components/getting-started).
|
|
16
16
|
|
|
17
17
|
[The KendoReact Data Grid (Table)](https://www.telerik.com/kendo-react-ui/components/grid/) provides 100+ ready-to-use data grid features covering everything from paging, sorting, filtering, editing, and grouping to row and column virtualization, export to PDF and Excel.
|
|
18
18
|
|
|
@@ -35,7 +35,7 @@ Key KendoReact PivotGrid features:
|
|
|
35
35
|
|
|
36
36
|
The following table outlines the key resources available with KendoReact and KendoReact Free.
|
|
37
37
|
|
|
38
|
-
| | [KendoReact Free](https://www.telerik.com/kendo-react-ui/components/free)
|
|
38
|
+
| | [KendoReact Free](https://www.telerik.com/kendo-react-ui/components/getting-started/free-vs-premium) | [KendoReact](https://www.telerik.com/kendo-react-ui) |
|
|
39
39
|
| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
40
40
|
| React components | 50+ | 120+ |
|
|
41
41
|
| Four professional themes | <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z" stroke="white" stroke-width="2"/></svg> | <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z" stroke="white" stroke-width="2"/></svg> |
|
|
@@ -58,7 +58,7 @@ For any issues you might encounter while working with the KendoReact PivotGrid,
|
|
|
58
58
|
## Resources
|
|
59
59
|
|
|
60
60
|
- [Getting Started with KendoReact](https://www.telerik.com/kendo-react-ui/components/getting-started/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-pivotgrid)
|
|
61
|
-
- [Get Started with KendoReact Free](https://www.telerik.com/kendo-react-ui/components/
|
|
61
|
+
- [Get Started with KendoReact Free](https://www.telerik.com/kendo-react-ui/components/getting-started)
|
|
62
62
|
- [API Reference of the KendoReact PivotGrid](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/PivotGridProps/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-pivotgrid)
|
|
63
63
|
- [KendoReact Roadmap](https://www.telerik.com/support/whats-new/kendo-react-ui/roadmap?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-pivotgrid)
|
|
64
64
|
- [Blogs](https://www.telerik.com/blogs/tag/kendoreact?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-pivotgrid)
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
13
13
|
*-------------------------------------------------------------------------------------------
|
|
14
14
|
*/
|
|
15
|
-
!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=Object.freeze({name:"@progress/kendo-react-pivotgrid",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"14.5.0-develop.8",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.configuratorEditorSearchPlaceholder",N="pivotgrid.configuratorMissingFields",k="pivotgrid.configuratorButtonLabel",R={[v]:"PivotGrid component. Use the arrow keys to navigate.",[f]:"Reset",[h]:"Apply",[E]:"Cancel",[y]:"Apply",[x]:"Settings",[b]:"Fields",[I]:"Search...",[A]:"Columns",[C]:"Rows",[w]:"Values",[k]:"Change settings",[N]:"Select some fields to begin setup"},F=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)})});F.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 P=(e,t,r)=>[e,(n,o)=>{const l=a.headersReducer(e,{...n,tree:t});r&&r(l,o)}],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[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,className:"k-pivotgrid-toggle",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};T.displayName="KendoReactPivotGridHeaderCell";const D=p.forwardRef((e,t)=>{const n=p.useRef(null),a=p.useRef(null),{id:o,style:l,tabIndex:s,children:i,className:c,path:u=M.path}=e;p.useImperativeHandle(n,()=>({element:a.current,props:{path:u,...e}})),p.useImperativeHandle(t,()=>n.current);const d=r.useMouse(e,n);return p.createElement("col",{ref:a,...d,id:o,style:l,tabIndex:s,children:i,className:c})}),M={path:[]};D.displayName="KendoReactPivotGridColumn";const O=(e=[],t={},r=null)=>e.map(e=>{const n={dataItem:e};return Object.keys(t).forEach(e=>{n[e]=t[e](n,r)}),n}),q=(e=[])=>{let t=[...e];return(e||[]).forEach(e=>{t=t.concat(q(e.children))}),t},H=(e=[])=>{const t=new Set;return e.forEach(e=>{t.add(String(e.name))}),Array.from(t)},G=(e=[])=>`${e.join(",")}`,K=(e,t,r)=>{if(!e)return[];let n=0;const a=[],o=e.length;let l;for(;n<o;n++)l=e[n].operator,(!r&&"in"!==l||l===r)&&e[n].field===t&&a.push(e[n]);return a},z=(e,t)=>e.uniqueName===t.uniqueName,U=p.forwardRef((e,t)=>{const o=!r.validatePackage(g,{component:"PivotGrid"}),l=r.getLicenseMessage(g),{rows:s,rowAxes:i,columns:c,columnAxes:u,data:d}={...j,...e},m=p.useRef(null),f=p.useRef(null),h=p.useRef(null),x=p.useRef(null),E=p.useRef(null),y=p.useRef(null),A=p.useRef(null),C=n.useLocalization(),w=a.toTree((s||[]).slice()),[,b]=P((i||[]).slice(),w,(t,r)=>{e.onRowAxesChange&&e.onRowAxesChange({value:t,target:f.current,syntheticEvent:r})}),[I,N,k,F]=a.toRows(w),S=a.toTree((c||[]).slice()),[,T]=P((u||[]).slice(),S,(t,r)=>{e.onColumnAxesChange&&e.onColumnAxesChange({value:t,target:f.current,syntheticEvent:r})}),[L,D,,M]=a.toColumns(S),O=a.toData((d||[]).slice(),D,N,M,k);p.useImperativeHandle(f,()=>({props:e,element:m.current,columnHeaderRows:L,rowHeaderRows:I,dataCells:O,rowHeaderBreadth:F,columnHeaderBreadth:M})),p.useImperativeHandle(t,()=>f.current);const q=[],H=[],K=[],[z,U]=r.useCustomComponent(e.row||j.row),[B,V]=r.useCustomComponent(e.column||j.column),[X,Z]=r.useCustomComponent(e.cell||j.cell),[_,$]=r.useCustomComponent(e.headerCell||j.headerCell),J=e.columnHeadersRow||z,W=e.columnHeadersColumn||B,Y=e.columnHeadersCell||_,Q=e.rowHeadersRow||z,ee=e.rowHeadersColumn||B,te=e.rowHeadersCell||_,re=e.dataRow||z,ne=e.dataColumn||B;for(let e=0;e<D.length;e++)q.push(p.createElement(ne,{key:String(D[e].path),...V,path:D[e].path})),K.push(p.createElement(W,{key:String(D[e].path),...V,path:D[e].path}));for(let e=0;e<F;e++)H.push(p.createElement(ee,{key:e,...V}));const ae=e=>{e.target.props.expandable&&T({type:a.HEADERS_ACTION.toggle,payload:e.target.props.dataItem.path},e.syntheticEvent)},oe=e=>{e.target.props.expandable&&b({type:a.HEADERS_ACTION.toggle,payload:e.target.props.dataItem.path},e.syntheticEvent)},le=((...e)=>{const t=p.useRef(void 0);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)}))})}})(A,y),se=((...e)=>{const t=p.useRef(void 0);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)}))})}})(A,E),ie=p.useCallback(()=>{m.current&&x.current&&(m.current.style.gridTemplateRows="",m.current.style.gridTemplateRows=`${x.current.offsetHeight}px 1fr`)},[]),ce=p.useCallback(()=>{m.current&&h.current&&(m.current.style.gridTemplateColumns="",m.current.style.gridTemplateColumns=`${h.current.offsetWidth}px 1fr`)},[]),ue=p.useRef(new a.PivotGridNavigation({tabIndex:e.tabIndex||0}));p.useEffect(()=>{if(m.current){const t=e.tabIndex||0;if(ue.current.stop(),ue.current.tabIndex=t,e.navigatable){ue.current.start(m.current);const e=ue.current.first;e&&e.setAttribute("tabindex",String(t))}}return()=>{ue.current.stop()}},[e.tabIndex,e.navigatable]),p.useEffect(()=>{ue.current.update()}),p.useEffect(()=>{if(x.current){const e=new window.ResizeObserver(()=>{window.requestAnimationFrame(()=>{ie()})});return e.observe(x.current),()=>{e.disconnect()}}},[ie]),p.useEffect(()=>{if(h.current){const e=new window.ResizeObserver(()=>{window.requestAnimationFrame(()=>{ce()})});return e.observe(h.current),()=>{e.disconnect()}}},[ce]),r.useIsomorphicLayoutEffect(()=>{if(r.setScrollbarWidth(),h.current){const e=new window.ResizeObserver(()=>window.requestAnimationFrame(()=>{r.setScrollbarWidth()}));return e.observe(h.current),()=>{e.disconnect()}}},[]);const de=new Array(L.length).fill([]).map(()=>new Array(D.length));L.forEach((e,t)=>{let r=0;Array.from(e.cells).forEach(e=>{const n=!!(e&&e.children&&e.children.length),a=(e?G(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=de[t+n].findIndex((e,t)=>t>=r&&!e);de[t+n][e]=a}r++}})});const me=O.map(e=>e.cells.map(e=>((e,t)=>`${G(e.map(e=>e.name))}|${G(t.map(e=>e.name))}`)(e.rowTuple.members,e.columnTuple.members).replace(/\s/g,"-")));return p.createElement("div",{ref:m,id:e.id,style:e.style,tabIndex:e.navigatable?void 0:e.tabIndex,className:r.classNames("k-pivotgrid",e.className),role:"grid"},o&&p.createElement(r.WatermarkOverlay,{message:l}),p.createElement("span",{className:"k-pivotgrid-empty-cell"},p.createElement("span",{className:"k-sr-only"},C.toLanguageString(v,R[v]))),p.createElement("div",{ref:y,className:"k-pivotgrid-column-headers",onScroll:le},p.createElement("table",{ref:x,className:"k-pivotgrid-table",role:"none"},p.createElement("colgroup",null,K),p.createElement("tbody",{className:"k-pivotgrid-tbody",role:"rowgroup"},L.map((e,t)=>{let r=!1;return p.createElement(J,{key:e.name,role:"row",...U},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(Y,{...$,key:de[t][n],"data-key":de[t][n],id:de[t][n],columnPath:e.normalizedPath,rowSpan:e.rowSpan||void 0,colSpan:e.colSpan||void 0,onIconClick:ae,dataItem:e,expanded:o,expandable:l,total:e.total,first:a,root:0===e.levelNum,role:"columnheader"},e.caption):null}))})))),p.createElement("div",{ref:E,className:"k-pivotgrid-row-headers"},p.createElement("table",{ref:h,className:"k-pivotgrid-table",role:"none"},p.createElement("colgroup",null,H),p.createElement("tbody",{className:"k-pivotgrid-tbody",role:"rowgroup"},I.map((e,t)=>p.createElement(Q,{key:G(N[t].path),...U,path:N[t].path,role:"row",ariaOwns:me[t].join(" ")},e.cells.filter(Boolean).map(e=>e?p.createElement(te,{...$,key:G(e.normalizedPath)+(e.total?"|[TOTAL]":"")+(e.children&&e.children.length?"|[EXPANDED]":""),"data-key":G(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:oe,root:0===e.levelNum,role:"rowheader"},e.caption):null)))))),p.createElement("div",{ref:A,className:"k-pivotgrid-values",onScroll:e=>{le(e),se(e)}},p.createElement("table",{className:"k-pivotgrid-table",role:"none"},p.createElement("colgroup",null,q),p.createElement("tbody",{className:"k-pivotgrid-tbody",role:"none"},O.map((e,t)=>p.createElement(re,{key:G(N[t].path),...U,path:N[t].path,role:"none"},e.cells.map((e,r)=>p.createElement(X,{key:me[t][r],"data-key":me[t][r],id:me[t][r],...Z,rowPath:e.rowTuple.members.map(e=>e.name),columnPath:e.columnTuple.members.map(e=>e.name),dataItem:e,total:N[t].total||D[r].total,role:"gridcell",ariaDescribedby:de.map(e=>e[r]).join(" ")},e&&e.data&&e.data.fmtValue?e.data.fmtValue:" "))))))))}),j={rowAxes:[],columnAxes:[],data:[],row:F,column:D,cell:S,headerCell:T};U.displayName="KendoReactPivotGrid";const B=p.forwardRef((e,t)=>{const n=p.useRef(null),a=p.useRef(null);p.useImperativeHandle(a,()=>({props:e,element:n.current})),p.useImperativeHandle(t,()=>a.current);const{id:o,style:l,tabIndex:s,configuratorPosition:i,className:c,children:u}={...V,...e};return p.createElement("div",{ref:n,id:o,style:l,tabIndex:s,className:r.classNames("k-d-flex k-pos-relative",{"k-flex-row":"right"===i,"k-flex-row-reverse":"left"===i,"k-flex-column":"bottom"===i,"k-flex-column-reverse":"top"===i},c)},u)}),V={configuratorPosition:"right"};B.displayName="KendoReactPivotGridContainer";const X=p.createContext({axes:null}),Z=p.createContext({}),_=p.createContext([{expanded:[],rowAxes:[],columnAxes:[],measureAxes:[],dragItem:null,dropZone:null,dropDirection:null,dropTarget:null},r.noop]);var $=(e=>(e.toggle="EXPAND_TOGGLE",e.expand="EXPAND_EXPAND",e.collapse="EXPAND_COLLAPSE",e))($||{});const J=(e=[],t,r,n=(e,t)=>e===t)=>{const[a,o]=p.useState(e);return[a,(e,t)=>{const r=((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);o(r)}]};var W=(e=>(e.toggleExpansion="PIVOT_CONFIGURATOR_ACTION_TOGGLE_EXPANSION",e))(W||{});const Y={...a.PIVOT_CONFIGURATOR_ACTION,...W},Q=(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]=J([],0,0,z),[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===Y.toggleExpansion)c({type:$.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)}}]},ee=p.forwardRef((e,t)=>{const{data:a,dataItem:l,defaultFilter:s}={...te,...e},i=p.useRef(null),c=p.useRef(null),u=n.useLocalization(),[d,m]=r.useCustomComponent(e.columnMenuItem||te.columnMenuItem),[g,v]=r.useCustomComponent(e.columnMenuForm||te.columnMenuForm),[x,E]=r.useCustomComponent(e.resetButton||te.resetButton),[y,A]=r.useCustomComponent(e.applyButton||te.applyButton),[C,w]=r.useCustomComponent(e.treeView||te.treeView),[b,I]=r.useCustomComponent(e.noData||te.noData);p.useImperativeHandle(c,()=>({props:e,element:i.current})),p.useImperativeHandle(t,()=>c.current);const[N,k]=p.useState(!1),{onAxisFilterFieldsExpandChange:F,onAxisFilterFieldExpand:S}=p.useContext(Z),[,P]=p.useContext(_),[T,L]=p.useState(s),D=T?T.value.split(","):[],[M,H]=J([],0,0,z),G={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=>M.some(t=>t.uniqueName===e.id),checked:e=>!D.length||(D||[]).some(t=>t===e.dataItem.uniqueName),hasChildren:e=>parseInt(e.dataItem.childrenCardinality,10)>0,children:e=>O(e.dataItem.children,G,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}},K=O(a,G),U=q(K);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=>{k(!N),F&&F({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=>{k(!1),T&&P({type:Y.removeFilter,payload:T},e)},...E},u.toLanguageString(f,R[f])),p.createElement(y,{themeColor:"primary",onClick:e=>{k(!1),T&&P({type:s?Y.changeFilter:Y.addFilter,payload:T},e)},...A},u.toLanguageString(h,R[h]))),...v},K&&K.length?p.createElement(C,{data:K,checkboxes:!0,onExpandChange:e=>{H({type:$.toggle,payload:e.item.dataItem},e.syntheticEvent),S&&S({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:U.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:U.filter(e=>e.checked).map(e=>String(e.value)).concat([e.item.value]).join(",")},L(t)},textField:"caption",expandIcons:!0,hasChildrenField:"hasChildren",checkIndeterminateField:"checkIndeterminate",childrenField:"children",...w}):p.createElement(b,{...I})))}),te={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};ee.displayName="KendoReactPivotGridAxisFilterFieldsEditor";const re=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(X),[d,m]=p.useState(!1),[g,v]=p.useContext(_);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||ne.chip),[x,E]=r.useCustomComponent(e.dropClue||ne.dropClue),[y,A]=r.useCustomComponent(e.columnMenuTextColumn||ne.columnMenuTextColumn),[C,w]=r.useCustomComponent(e.filterFieldsEditor||ne.filterFieldsEditor),b=K(g.filter,String(e.value),"in"),I=K(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:Y.setDragItem,payload:e.dataItem}))},onRelease:()=>{m(!1),g.dragItem&&(s.current&&(s.current.style.transform=""),v({type:Y.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:Y.remove,payload:e.dataItem},t.syntheticEvent)},onMouseEnter:t=>{g.dragItem&&(v({type:Y.setDropTarget,payload:e.dataItem},t.syntheticEvent),v({type:Y.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:Y.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=0;const o=e.length;let l;for(;a<o;a++)l=e[a].operator,l===r&&e[a].field===t&&(n=e[a]);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:Y.setSort,payload:t},e)},filter:I&&I.length?[{logic:"and",filters:I}]:void 0,onFilterChange:(e,t)=>{t.length?v({type:Y.setFilter,payload:[...b||[],...t.reduce((e,t)=>[...e,...t.filters.filter(e=>e.value)],[])]},e):v({type:Y.setFilter,payload:b},e)},filterContent:[c.ColumnMenuTextFilter],...A})),g.dropTarget&&a.compareAxes(g.dropTarget,e.dataItem)&&"after"===g.dropDirection&&p.createElement(x,{...E}))}),ne={chip:l.Chip,columnMenuTextColumn:c.ColumnMenuTextColumn,filterFieldsEditor:ee,dropClue:e=>p.createElement("div",{className:"k-grouping-dropclue",style:{position:"relative",zIndex:1e4},...e})};re.displayName="KendoReactPivotGridAxisEditor";const ae=p.forwardRef((e,t)=>{const{value:n=oe.value,field:a}=e,o=p.useRef(null),l=p.useRef(null),s=p.useRef(null),[i,c]=r.useCustomComponent(e.chipList||oe.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(X.Provider,{value:{axes:a}},p.createElement(i,{ref:r.canUseRef(i)?o:void 0,textField:"text",valueField:"name",data:u,chip:re,style:{position:"relative"},className:e.className,selection:"none",...c}))}),oe={value:[],chipList:l.ChipList};ae.displayName="KendoReactPivotGridAxesEditor";const le=p.forwardRef((e,t)=>{const{data:n,rowAxes:a,columnAxes:o,measureAxes:l,onExpand:s,onCheck:i}={...se,...e},c=p.useRef(null),d=p.useRef(null),[m,g]=r.useCustomComponent(e.treeView||se.treeView),[v,f]=r.useCustomComponent(e.noData||se.noData);p.useImperativeHandle(d,()=>({props:e,element:c.current&&c.current.element})),p.useImperativeHandle(t,()=>d.current);const[h]=p.useContext(_),x=H(o),E=H(a),y=H(l),A=q(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=>O(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=O(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}))}),se={data:[],rowAxes:[],columnAxes:[],measureAxes:[],treeView:u.TreeView,noData:()=>p.createElement("div",null,"NO DATA")};le.displayName="KendoReactPivotGridFieldsEditor";const ie=p.forwardRef((e,t)=>{const{onFieldsEditorFieldCheck:a,onFieldsEditorFieldCheckAction:o=ce.onFieldsEditorFieldCheckAction,onFieldsEditorFieldExpand:l,onFieldsEditorFieldExpandAction:c=ce.onFieldsEditorFieldExpandAction,onAxisFilterFieldExpand:u,onAxisFilterFieldsExpandChange:d}=e,m={onFieldsEditorFieldCheck:a,onFieldsEditorFieldCheckAction:o,horizontal:ce.horizontal,axesEditor:ce.axesEditor,...e},[g,v]=r.useCustomComponent(m.fieldsLabel||ce.fieldsLabel),[f,h]=r.useCustomComponent(m.fieldsEditor||ce.fieldsEditor),[x,E]=r.useCustomComponent(m.columnAxesLabel||ce.columnAxesLabel),[y,I]=r.useCustomComponent(m.columnAxesEditor||ce.columnAxesEditor),[k,F]=r.useCustomComponent(m.rowAxesLabel||ce.rowAxesLabel),[S,P]=r.useCustomComponent(m.rowAxesEditor||ce.rowAxesEditor),[T,L]=r.useCustomComponent(m.measureAxesLabel||ce.measureAxesLabel),[D,M]=r.useCustomComponent(m.measureAxesEditor||ce.measureAxesEditor),O=p.useRef(null),q=p.useRef(null),H=n.useLocalization(),[G,K]=Q(m);p.useImperativeHandle(q,()=>({element:O.current,props:m,state:G})),p.useImperativeHandle(t,()=>q.current);const z=()=>{G.dragItem&&K({type:Y.setDropZone,payload:"columnAxes"})},U=()=>{G.dragItem&&K({type:Y.setDropZone,payload:null})},j=()=>{G.dragItem&&K({type:Y.setDropZone,payload:"rowAxes"})},B=()=>{G.dragItem&&K({type:Y.setDropZone,payload:null})},V=()=>{G.dragItem&&K({type:Y.setDropZone,payload:"measureAxes"})},X=()=>{G.dragItem&&K({type:Y.setDropZone,payload:null})},$=m.horizontal?"div":p.Fragment,J=m.horizontal?{className:"k-form-field-wrapper"}:{};return p.createElement(Z.Provider,{value:{onAxisFilterFieldExpand:e=>{const t={target:e.target,currentTarget:q.current,value:e.value,syntheticEvent:e.syntheticEvent};u&&u(t)},onAxisFilterFieldsExpandChange:e=>{const t={target:e.target,currentTarget:q.current,value:e.value,syntheticEvent:e.syntheticEvent};d&&d(t)}}},p.createElement(_.Provider,{value:[G,K]},p.createElement($,{...J},p.createElement("div",{className:"k-form-field"},p.createElement(g,{name:"",component:i.Label,...v},H.toLanguageString(b,R[b]))),p.createElement("div",{className:"k-form-field"},p.createElement("div",{className:"k-fields-list-wrapper"},p.createElement(f,{data:m.data,onExpand:e=>{const t={target:e.target,currentTarget:q.current,value:e.value,syntheticEvent:e.syntheticEvent};if(c){const r=c(t,m,G);r&&(Array.isArray(r)?r.filter(Boolean).map(t=>t&&K({...t},e.syntheticEvent)):K({...r},e.syntheticEvent))}l&&l({target:e.target,currentTarget:q.current,value:e.value,syntheticEvent:e.syntheticEvent})},onCheck:e=>{const t={target:e.target,currentTarget:q.current,value:e.value,syntheticEvent:e.syntheticEvent};if(o){const r=o(t,m,G);r&&(Array.isArray(r)?r.filter(Boolean).map(t=>t&&K({...t},e.syntheticEvent)):K({...r},e.syntheticEvent))}a&&a(t)},columnAxes:G.columnAxes,rowAxes:G.rowAxes,measureAxes:G.measureAxes,...h})))),p.createElement($,{...J},p.createElement("div",{className:"k-form-field",onMouseEnter:z,onMouseLeave:U},p.createElement(s.Field,{name:"columnAxes",field:"columnAxes",component:x,...E},H.toLanguageString(A,R[A]))),m.valueGetter("columnAxes").length?p.createElement(s.Field,{name:"columnAxes",field:"columnAxes",component:y,onMouseEnter:z,onMouseLeave:U,className:"k-column-fields",...I}):p.createElement("div",{className:"k-settings-description",onMouseEnter:z,onMouseLeave:U},H.toLanguageString(N,R[N])),p.createElement("div",{className:"k-form-field",onMouseEnter:j,onMouseLeave:B},p.createElement(s.Field,{name:"rowAxes",field:"rowAxes",component:k,...F},H.toLanguageString(C,R[C]))),m.valueGetter("rowAxes").length?p.createElement(s.Field,{name:"rowAxes",field:"rowAxes",component:S,onMouseEnter:j,onMouseLeave:B,className:"k-column-fields",...P}):p.createElement("div",{className:"k-settings-description",onMouseEnter:j,onMouseLeave:B},H.toLanguageString(N,R[N]))),p.createElement($,{...J},p.createElement("div",{className:"k-form-field",onMouseEnter:V,onMouseLeave:X},p.createElement(s.Field,{name:"measureAxes",field:"measureAxes",component:T,...L},H.toLanguageString(w,R[w]))),m.valueGetter("measureAxes").length?p.createElement(s.Field,{name:"measureAxes",field:"measureAxes",component:D,onMouseEnter:V,onMouseLeave:X,className:"k-column-fields",...M}):p.createElement("div",{className:"k-settings-description",onMouseEnter:V,onMouseLeave:X},H.toLanguageString(N,R[N])))))}),ce={horizontal:!1,fieldsLabel:i.Label,fieldsEditor:le,columnAxesLabel:i.Label,columnAxesEditor:ae,rowAxesLabel:i.Label,rowAxesEditor:ae,measureAxesLabel:i.Label,measureAxesEditor:ae,axesEditor:ae,onFieldsEditorFieldCheckAction:e=>({type:Y.toggleSelection,payload:e.value}),onFieldsEditorFieldExpandAction:e=>({type:Y.toggleExpansion,payload:e.value})};ie.displayName="KendoReactPivotGridConfiguratorEditor";const ue=p.forwardRef((e,t)=>{const{horizontal:a,data:o,rowAxes:s,columnAxes:i,measureAxes:c}={...de,...e},u=p.useRef(null),d=p.useRef(null),m=p.useRef(null),g=n.useLocalization(),[v,f]=r.useCustomComponent(e.editor||de.editor),[h,A]=r.useCustomComponent(e.form||de.form),[C,w]=r.useCustomComponent(e.formElement||de.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,R[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,R[E])),p.createElement(l.Button,{themeColor:"primary",type:"submit",onClick:t.onSubmit},g.toLanguageString(y,R[y])))),...A})))}),de={form:s.Form,formElement:s.FormElement,editor:ie,horizontal:!1,data:[],columnAxes:[],rowAxes:[],measureAxes:[]};ue.displayName="KendoReactPivotGridConfigurator";const me=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||pe.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(k,R[k]),p.createElement(i,{name:"gear",icon:o.gearIcon,...c})))}),pe={icon:r.IconWrap};me.displayName="KendoReactPivotGridConfiguratorButton";const ge=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;const 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=ve(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}}},ve=e=>{for(let t=0,r=e.length;t<r;t++)e[t].uniqueName=e[t].name,e[t].type="kpi";return e},fe={dataField:"aggregate",columnsData:"columns"},he="&",xe=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({data:[],rows:[],columns:[]}),h=p.useCallback(e=>{s(e.value)},[]),x=p.useCallback(e=>{o(e.value)},[]),E=p.useMemo(()=>Array.from(a.rootFields(n).keys()).join(he),[n]),y=p.useMemo(()=>Array.from(a.rootFields(l).keys()).join(he),[l]),A=p.useCallback(t=>({key:t,...e.dimensions[t]}),[e.dimensions]),C=p.useMemo(()=>E?E.split(he).map(A):[],[E,A]),w=p.useMemo(()=>y?y.split(he).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=new Map(a.createDataTree(e.data,w,C,b,fe,m));f(a.createLocalDataState({dataTree:t,rowSettings:w,columnSettings:C,rowAxes:l,columnAxes:n,measures:b,sort:u,fields:fe})),r(!1)},0)},[e.data,w,C,b,m,l,n,u]);const I=p.useMemo(()=>a.createFlatSchemaDimensions(e.dimensions,e.measures),[e.dimensions,e.measures]);return{pivotProps:{rowAxes:l,columnAxes:n,data:v.data,rows:v.rows,columns:v.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,"AggregateType",{enumerable:!0,get:function(){return a.AggregateType}}),Object.defineProperty(e,"averageAggregate",{enumerable:!0,get:function(){return a.averageAggregate}}),Object.defineProperty(e,"createAggregate",{enumerable:!0,get:function(){return a.createAggregate}}),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=U,e.PivotGridAxesEditor=ae,e.PivotGridAxisEditor=re,e.PivotGridAxisFilterFieldsEditor=ee,e.PivotGridCell=S,e.PivotGridColumn=D,e.PivotGridConfigurator=ue,e.PivotGridConfiguratorButton=me,e.PivotGridConfiguratorEditor=ie,e.PivotGridContainer=B,e.PivotGridFieldsEditor=le,e.PivotGridHeaderCell=T,e.PivotGridRow=F,e.PivotLocalDataService=e=>{const t=xe(e);return e.children(t)},e.PivotOLAPService=e=>{const t=ge(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=xe,e.usePivotOLAPService=ge});
|
|
15
|
+
!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=Object.freeze({name:"@progress/kendo-react-pivotgrid",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"15.0.0-develop.1",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.configuratorEditorSearchPlaceholder",N="pivotgrid.configuratorMissingFields",k="pivotgrid.configuratorButtonLabel",R={[v]:"PivotGrid component. Use the arrow keys to navigate.",[f]:"Reset",[h]:"Apply",[E]:"Cancel",[y]:"Apply",[x]:"Settings",[b]:"Fields",[I]:"Search...",[A]:"Columns",[C]:"Rows",[w]:"Values",[k]:"Change settings",[N]:"Select some fields to begin setup"},F=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)})});F.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 P=(e,t,r)=>[e,(n,o)=>{const l=a.headersReducer(e,{...n,tree:t});r&&r(l,o)}],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[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,className:"k-pivotgrid-toggle",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};T.displayName="KendoReactPivotGridHeaderCell";const D=p.forwardRef((e,t)=>{const n=p.useRef(null),a=p.useRef(null),{id:o,style:l,tabIndex:s,children:i,className:c,path:u=M.path}=e;p.useImperativeHandle(n,()=>({element:a.current,props:{path:u,...e}})),p.useImperativeHandle(t,()=>n.current);const d=r.useMouse(e,n);return p.createElement("col",{ref:a,...d,id:o,style:l,tabIndex:s,children:i,className:c})}),M={path:[]};D.displayName="KendoReactPivotGridColumn";const O=(e=[],t={},r=null)=>e.map(e=>{const n={dataItem:e};return Object.keys(t).forEach(e=>{n[e]=t[e](n,r)}),n}),q=(e=[])=>{let t=[...e];return(e||[]).forEach(e=>{t=t.concat(q(e.children))}),t},H=(e=[])=>{const t=new Set;return e.forEach(e=>{t.add(String(e.name))}),Array.from(t)},G=(e=[])=>`${e.join(",")}`,K=(e,t,r)=>{if(!e)return[];let n=0;const a=[],o=e.length;let l;for(;n<o;n++)l=e[n].operator,(!r&&"in"!==l||l===r)&&e[n].field===t&&a.push(e[n]);return a},z=(e,t)=>e.uniqueName===t.uniqueName,U=p.forwardRef((e,t)=>{const o=!r.validatePackage(g,{component:"PivotGrid"}),l=r.getLicenseMessage(g),{rows:s,rowAxes:i,columns:c,columnAxes:u,data:d}={...j,...e},m=p.useRef(null),f=p.useRef(null),h=p.useRef(null),x=p.useRef(null),E=p.useRef(null),y=p.useRef(null),A=p.useRef(null),C=n.useLocalization(),w=a.toTree((s||[]).slice()),[,b]=P((i||[]).slice(),w,(t,r)=>{e.onRowAxesChange&&e.onRowAxesChange({value:t,target:f.current,syntheticEvent:r})}),[I,N,k,F]=a.toRows(w),S=a.toTree((c||[]).slice()),[,T]=P((u||[]).slice(),S,(t,r)=>{e.onColumnAxesChange&&e.onColumnAxesChange({value:t,target:f.current,syntheticEvent:r})}),[L,D,,M]=a.toColumns(S),O=a.toData((d||[]).slice(),D,N,M,k);p.useImperativeHandle(f,()=>({props:e,element:m.current,columnHeaderRows:L,rowHeaderRows:I,dataCells:O,rowHeaderBreadth:F,columnHeaderBreadth:M})),p.useImperativeHandle(t,()=>f.current),r.useWebMcpRegister("pivotgrid",f,e,e.webMcp);const q=[],H=[],K=[],[z,U]=r.useCustomComponent(e.row||j.row),[B,V]=r.useCustomComponent(e.column||j.column),[X,Z]=r.useCustomComponent(e.cell||j.cell),[_,$]=r.useCustomComponent(e.headerCell||j.headerCell),W=e.columnHeadersRow||z,J=e.columnHeadersColumn||B,Y=e.columnHeadersCell||_,Q=e.rowHeadersRow||z,ee=e.rowHeadersColumn||B,te=e.rowHeadersCell||_,re=e.dataRow||z,ne=e.dataColumn||B;for(let e=0;e<D.length;e++)q.push(p.createElement(ne,{key:String(D[e].path),...V,path:D[e].path})),K.push(p.createElement(J,{key:String(D[e].path),...V,path:D[e].path}));for(let e=0;e<F;e++)H.push(p.createElement(ee,{key:e,...V}));const ae=e=>{e.target.props.expandable&&T({type:a.HEADERS_ACTION.toggle,payload:e.target.props.dataItem.path},e.syntheticEvent)},oe=e=>{e.target.props.expandable&&b({type:a.HEADERS_ACTION.toggle,payload:e.target.props.dataItem.path},e.syntheticEvent)},le=((...e)=>{const t=p.useRef(void 0);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)}))})}})(A,y),se=((...e)=>{const t=p.useRef(void 0);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)}))})}})(A,E),ie=p.useCallback(()=>{m.current&&x.current&&(m.current.style.gridTemplateRows="",m.current.style.gridTemplateRows=`${x.current.offsetHeight}px 1fr`)},[]),ce=p.useCallback(()=>{m.current&&h.current&&(m.current.style.gridTemplateColumns="",m.current.style.gridTemplateColumns=`${h.current.offsetWidth}px 1fr`)},[]),ue=p.useRef(new a.PivotGridNavigation({tabIndex:e.tabIndex||0}));p.useEffect(()=>{if(m.current){const t=e.tabIndex||0;if(ue.current.stop(),ue.current.tabIndex=t,e.navigatable){ue.current.start(m.current);const e=ue.current.first;e&&e.setAttribute("tabindex",String(t))}}return()=>{ue.current.stop()}},[e.tabIndex,e.navigatable]),p.useEffect(()=>{ue.current.update()}),p.useEffect(()=>{if(x.current){const e=new window.ResizeObserver(()=>{window.requestAnimationFrame(()=>{ie()})});return e.observe(x.current),()=>{e.disconnect()}}},[ie]),p.useEffect(()=>{if(h.current){const e=new window.ResizeObserver(()=>{window.requestAnimationFrame(()=>{ce()})});return e.observe(h.current),()=>{e.disconnect()}}},[ce]),r.useIsomorphicLayoutEffect(()=>{if(r.setScrollbarWidth(),h.current){const e=new window.ResizeObserver(()=>window.requestAnimationFrame(()=>{r.setScrollbarWidth()}));return e.observe(h.current),()=>{e.disconnect()}}},[]);const de=new Array(L.length).fill([]).map(()=>new Array(D.length));L.forEach((e,t)=>{let r=0;Array.from(e.cells).forEach(e=>{const n=!!(e&&e.children&&e.children.length),a=(e?G(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=de[t+n].findIndex((e,t)=>t>=r&&!e);de[t+n][e]=a}r++}})});const me=O.map(e=>e.cells.map(e=>((e,t)=>`${G(e.map(e=>e.name))}|${G(t.map(e=>e.name))}`)(e.rowTuple.members,e.columnTuple.members).replace(/\s/g,"-")));return p.createElement("div",{ref:m,id:e.id,style:e.style,tabIndex:e.navigatable?void 0:e.tabIndex,className:r.classNames("k-pivotgrid",e.className),role:"grid"},o&&p.createElement(r.WatermarkOverlay,{message:l}),p.createElement("span",{className:"k-pivotgrid-empty-cell"},p.createElement("span",{className:"k-sr-only"},C.toLanguageString(v,R[v]))),p.createElement("div",{ref:y,className:"k-pivotgrid-column-headers",onScroll:le},p.createElement("table",{ref:x,className:"k-pivotgrid-table",role:"none"},p.createElement("colgroup",null,K),p.createElement("tbody",{className:"k-pivotgrid-tbody",role:"rowgroup"},L.map((e,t)=>{let r=!1;return p.createElement(W,{key:e.name,role:"row",...U},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(Y,{...$,key:de[t][n],"data-key":de[t][n],id:de[t][n],columnPath:e.normalizedPath,rowSpan:e.rowSpan||void 0,colSpan:e.colSpan||void 0,onIconClick:ae,dataItem:e,expanded:o,expandable:l,total:e.total,first:a,root:0===e.levelNum,role:"columnheader"},e.caption):null}))})))),p.createElement("div",{ref:E,className:"k-pivotgrid-row-headers"},p.createElement("table",{ref:h,className:"k-pivotgrid-table",role:"none"},p.createElement("colgroup",null,H),p.createElement("tbody",{className:"k-pivotgrid-tbody",role:"rowgroup"},I.map((e,t)=>p.createElement(Q,{key:G(N[t].path),...U,path:N[t].path,role:"row",ariaOwns:me[t].join(" ")},e.cells.filter(Boolean).map(e=>e?p.createElement(te,{...$,key:G(e.normalizedPath)+(e.total?"|[TOTAL]":"")+(e.children&&e.children.length?"|[EXPANDED]":""),"data-key":G(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:oe,root:0===e.levelNum,role:"rowheader"},e.caption):null)))))),p.createElement("div",{ref:A,className:"k-pivotgrid-values",onScroll:e=>{le(e),se(e)}},p.createElement("table",{className:"k-pivotgrid-table",role:"none"},p.createElement("colgroup",null,q),p.createElement("tbody",{className:"k-pivotgrid-tbody",role:"none"},O.map((e,t)=>p.createElement(re,{key:G(N[t].path),...U,path:N[t].path,role:"none"},e.cells.map((e,r)=>p.createElement(X,{key:me[t][r],"data-key":me[t][r],id:me[t][r],...Z,rowPath:e.rowTuple.members.map(e=>e.name),columnPath:e.columnTuple.members.map(e=>e.name),dataItem:e,total:N[t].total||D[r].total,role:"gridcell",ariaDescribedby:de.map(e=>e[r]).join(" ")},e&&e.data&&e.data.fmtValue?e.data.fmtValue:" "))))))))}),j={rowAxes:[],columnAxes:[],data:[],row:F,column:D,cell:S,headerCell:T};U.displayName="KendoReactPivotGrid";const B=p.forwardRef((e,t)=>{const n=p.useRef(null),a=p.useRef(null);p.useImperativeHandle(a,()=>({props:e,element:n.current})),p.useImperativeHandle(t,()=>a.current);const{id:o,style:l,tabIndex:s,configuratorPosition:i,className:c,children:u}={...V,...e};return p.createElement("div",{ref:n,id:o,style:l,tabIndex:s,className:r.classNames("k-d-flex k-pos-relative",{"k-flex-row":"right"===i,"k-flex-row-reverse":"left"===i,"k-flex-column":"bottom"===i,"k-flex-column-reverse":"top"===i},c)},u)}),V={configuratorPosition:"right"};B.displayName="KendoReactPivotGridContainer";const X=p.createContext({axes:null}),Z=p.createContext({}),_=p.createContext([{expanded:[],rowAxes:[],columnAxes:[],measureAxes:[],dragItem:null,dropZone:null,dropDirection:null,dropTarget:null},r.noop]);var $=(e=>(e.toggle="EXPAND_TOGGLE",e.expand="EXPAND_EXPAND",e.collapse="EXPAND_COLLAPSE",e))($||{});const W=(e=[],t,r,n=(e,t)=>e===t)=>{const[a,o]=p.useState(e);return[a,(e,t)=>{const r=((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);o(r)}]};var J=(e=>(e.toggleExpansion="PIVOT_CONFIGURATOR_ACTION_TOGGLE_EXPANSION",e))(J||{});const Y={...a.PIVOT_CONFIGURATOR_ACTION,...J},Q=(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]=W([],0,0,z),[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===Y.toggleExpansion)c({type:$.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)}}]},ee=p.forwardRef((e,t)=>{const{data:a,dataItem:l,defaultFilter:s}={...te,...e},i=p.useRef(null),c=p.useRef(null),u=n.useLocalization(),[d,m]=r.useCustomComponent(e.columnMenuItem||te.columnMenuItem),[g,v]=r.useCustomComponent(e.columnMenuForm||te.columnMenuForm),[x,E]=r.useCustomComponent(e.resetButton||te.resetButton),[y,A]=r.useCustomComponent(e.applyButton||te.applyButton),[C,w]=r.useCustomComponent(e.treeView||te.treeView),[b,I]=r.useCustomComponent(e.noData||te.noData);p.useImperativeHandle(c,()=>({props:e,element:i.current})),p.useImperativeHandle(t,()=>c.current);const[N,k]=p.useState(!1),{onAxisFilterFieldsExpandChange:F,onAxisFilterFieldExpand:S}=p.useContext(Z),[,P]=p.useContext(_),[T,L]=p.useState(s),D=T?T.value.split(","):[],[M,H]=W([],0,0,z),G={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=>M.some(t=>t.uniqueName===e.id),checked:e=>!D.length||(D||[]).some(t=>t===e.dataItem.uniqueName),hasChildren:e=>parseInt(e.dataItem.childrenCardinality,10)>0,children:e=>O(e.dataItem.children,G,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}},K=O(a,G),U=q(K);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=>{k(!N),F&&F({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=>{k(!1),T&&P({type:Y.removeFilter,payload:T},e)},...E},u.toLanguageString(f,R[f])),p.createElement(y,{themeColor:"primary",onClick:e=>{k(!1),T&&P({type:s?Y.changeFilter:Y.addFilter,payload:T},e)},...A},u.toLanguageString(h,R[h]))),...v},K&&K.length?p.createElement(C,{data:K,checkboxes:!0,onExpandChange:e=>{H({type:$.toggle,payload:e.item.dataItem},e.syntheticEvent),S&&S({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:U.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:U.filter(e=>e.checked).map(e=>String(e.value)).concat([e.item.value]).join(",")},L(t)},textField:"caption",expandIcons:!0,hasChildrenField:"hasChildren",checkIndeterminateField:"checkIndeterminate",childrenField:"children",...w}):p.createElement(b,{...I})))}),te={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};ee.displayName="KendoReactPivotGridAxisFilterFieldsEditor";const re=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(X),[d,m]=p.useState(!1),[g,v]=p.useContext(_);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||ne.chip),[x,E]=r.useCustomComponent(e.dropClue||ne.dropClue),[y,A]=r.useCustomComponent(e.columnMenuTextColumn||ne.columnMenuTextColumn),[C,w]=r.useCustomComponent(e.filterFieldsEditor||ne.filterFieldsEditor),b=K(g.filter,String(e.value),"in"),I=K(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:Y.setDragItem,payload:e.dataItem}))},onRelease:()=>{m(!1),g.dragItem&&(s.current&&(s.current.style.transform=""),v({type:Y.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:Y.remove,payload:e.dataItem},t.syntheticEvent)},onMouseEnter:t=>{g.dragItem&&(v({type:Y.setDropTarget,payload:e.dataItem},t.syntheticEvent),v({type:Y.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:Y.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=0;const o=e.length;let l;for(;a<o;a++)l=e[a].operator,l===r&&e[a].field===t&&(n=e[a]);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:Y.setSort,payload:t},e)},filter:I&&I.length?[{logic:"and",filters:I}]:void 0,onFilterChange:(e,t)=>{t.length?v({type:Y.setFilter,payload:[...b||[],...t.reduce((e,t)=>[...e,...t.filters.filter(e=>e.value)],[])]},e):v({type:Y.setFilter,payload:b},e)},filterContent:[c.ColumnMenuTextFilter],...A})),g.dropTarget&&a.compareAxes(g.dropTarget,e.dataItem)&&"after"===g.dropDirection&&p.createElement(x,{...E}))}),ne={chip:l.Chip,columnMenuTextColumn:c.ColumnMenuTextColumn,filterFieldsEditor:ee,dropClue:e=>p.createElement("div",{className:"k-grouping-dropclue",style:{position:"relative",zIndex:1e4},...e})};re.displayName="KendoReactPivotGridAxisEditor";const ae=p.forwardRef((e,t)=>{const{value:n=oe.value,field:a}=e,o=p.useRef(null),l=p.useRef(null),s=p.useRef(null),[i,c]=r.useCustomComponent(e.chipList||oe.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(X.Provider,{value:{axes:a}},p.createElement(i,{ref:r.canUseRef(i)?o:void 0,textField:"text",valueField:"name",data:u,chip:re,style:{position:"relative"},className:e.className,selection:"none",...c}))}),oe={value:[],chipList:l.ChipList};ae.displayName="KendoReactPivotGridAxesEditor";const le=p.forwardRef((e,t)=>{const{data:n,rowAxes:a,columnAxes:o,measureAxes:l,onExpand:s,onCheck:i}={...se,...e},c=p.useRef(null),d=p.useRef(null),[m,g]=r.useCustomComponent(e.treeView||se.treeView),[v,f]=r.useCustomComponent(e.noData||se.noData);p.useImperativeHandle(d,()=>({props:e,element:c.current&&c.current.element})),p.useImperativeHandle(t,()=>d.current);const[h]=p.useContext(_),x=H(o),E=H(a),y=H(l),A=q(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=>O(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=O(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}))}),se={data:[],rowAxes:[],columnAxes:[],measureAxes:[],treeView:u.TreeView,noData:()=>p.createElement("div",null,"NO DATA")};le.displayName="KendoReactPivotGridFieldsEditor";const ie=p.forwardRef((e,t)=>{const{onFieldsEditorFieldCheck:a,onFieldsEditorFieldCheckAction:o=ce.onFieldsEditorFieldCheckAction,onFieldsEditorFieldExpand:l,onFieldsEditorFieldExpandAction:c=ce.onFieldsEditorFieldExpandAction,onAxisFilterFieldExpand:u,onAxisFilterFieldsExpandChange:d}=e,m={onFieldsEditorFieldCheck:a,onFieldsEditorFieldCheckAction:o,horizontal:ce.horizontal,axesEditor:ce.axesEditor,...e},[g,v]=r.useCustomComponent(m.fieldsLabel||ce.fieldsLabel),[f,h]=r.useCustomComponent(m.fieldsEditor||ce.fieldsEditor),[x,E]=r.useCustomComponent(m.columnAxesLabel||ce.columnAxesLabel),[y,I]=r.useCustomComponent(m.columnAxesEditor||ce.columnAxesEditor),[k,F]=r.useCustomComponent(m.rowAxesLabel||ce.rowAxesLabel),[S,P]=r.useCustomComponent(m.rowAxesEditor||ce.rowAxesEditor),[T,L]=r.useCustomComponent(m.measureAxesLabel||ce.measureAxesLabel),[D,M]=r.useCustomComponent(m.measureAxesEditor||ce.measureAxesEditor),O=p.useRef(null),q=p.useRef(null),H=n.useLocalization(),[G,K]=Q(m);p.useImperativeHandle(q,()=>({element:O.current,props:m,state:G})),p.useImperativeHandle(t,()=>q.current);const z=()=>{G.dragItem&&K({type:Y.setDropZone,payload:"columnAxes"})},U=()=>{G.dragItem&&K({type:Y.setDropZone,payload:null})},j=()=>{G.dragItem&&K({type:Y.setDropZone,payload:"rowAxes"})},B=()=>{G.dragItem&&K({type:Y.setDropZone,payload:null})},V=()=>{G.dragItem&&K({type:Y.setDropZone,payload:"measureAxes"})},X=()=>{G.dragItem&&K({type:Y.setDropZone,payload:null})},$=m.horizontal?"div":p.Fragment,W=m.horizontal?{className:"k-form-field-wrapper"}:{};return p.createElement(Z.Provider,{value:{onAxisFilterFieldExpand:e=>{const t={target:e.target,currentTarget:q.current,value:e.value,syntheticEvent:e.syntheticEvent};u&&u(t)},onAxisFilterFieldsExpandChange:e=>{const t={target:e.target,currentTarget:q.current,value:e.value,syntheticEvent:e.syntheticEvent};d&&d(t)}}},p.createElement(_.Provider,{value:[G,K]},p.createElement($,{...W},p.createElement("div",{className:"k-form-field"},p.createElement(g,{name:"",component:i.Label,...v},H.toLanguageString(b,R[b]))),p.createElement("div",{className:"k-form-field"},p.createElement("div",{className:"k-fields-list-wrapper"},p.createElement(f,{data:m.data,onExpand:e=>{const t={target:e.target,currentTarget:q.current,value:e.value,syntheticEvent:e.syntheticEvent};if(c){const r=c(t,m,G);r&&(Array.isArray(r)?r.filter(Boolean).map(t=>t&&K({...t},e.syntheticEvent)):K({...r},e.syntheticEvent))}l&&l({target:e.target,currentTarget:q.current,value:e.value,syntheticEvent:e.syntheticEvent})},onCheck:e=>{const t={target:e.target,currentTarget:q.current,value:e.value,syntheticEvent:e.syntheticEvent};if(o){const r=o(t,m,G);r&&(Array.isArray(r)?r.filter(Boolean).map(t=>t&&K({...t},e.syntheticEvent)):K({...r},e.syntheticEvent))}a&&a(t)},columnAxes:G.columnAxes,rowAxes:G.rowAxes,measureAxes:G.measureAxes,...h})))),p.createElement($,{...W},p.createElement("div",{className:"k-form-field",onMouseEnter:z,onMouseLeave:U},p.createElement(s.Field,{name:"columnAxes",field:"columnAxes",component:x,...E},H.toLanguageString(A,R[A]))),m.valueGetter("columnAxes").length?p.createElement(s.Field,{name:"columnAxes",field:"columnAxes",component:y,onMouseEnter:z,onMouseLeave:U,className:"k-column-fields",...I}):p.createElement("div",{className:"k-settings-description",onMouseEnter:z,onMouseLeave:U},H.toLanguageString(N,R[N])),p.createElement("div",{className:"k-form-field",onMouseEnter:j,onMouseLeave:B},p.createElement(s.Field,{name:"rowAxes",field:"rowAxes",component:k,...F},H.toLanguageString(C,R[C]))),m.valueGetter("rowAxes").length?p.createElement(s.Field,{name:"rowAxes",field:"rowAxes",component:S,onMouseEnter:j,onMouseLeave:B,className:"k-column-fields",...P}):p.createElement("div",{className:"k-settings-description",onMouseEnter:j,onMouseLeave:B},H.toLanguageString(N,R[N]))),p.createElement($,{...W},p.createElement("div",{className:"k-form-field",onMouseEnter:V,onMouseLeave:X},p.createElement(s.Field,{name:"measureAxes",field:"measureAxes",component:T,...L},H.toLanguageString(w,R[w]))),m.valueGetter("measureAxes").length?p.createElement(s.Field,{name:"measureAxes",field:"measureAxes",component:D,onMouseEnter:V,onMouseLeave:X,className:"k-column-fields",...M}):p.createElement("div",{className:"k-settings-description",onMouseEnter:V,onMouseLeave:X},H.toLanguageString(N,R[N])))))}),ce={horizontal:!1,fieldsLabel:i.Label,fieldsEditor:le,columnAxesLabel:i.Label,columnAxesEditor:ae,rowAxesLabel:i.Label,rowAxesEditor:ae,measureAxesLabel:i.Label,measureAxesEditor:ae,axesEditor:ae,onFieldsEditorFieldCheckAction:e=>({type:Y.toggleSelection,payload:e.value}),onFieldsEditorFieldExpandAction:e=>({type:Y.toggleExpansion,payload:e.value})};ie.displayName="KendoReactPivotGridConfiguratorEditor";const ue=p.forwardRef((e,t)=>{const{horizontal:a,data:o,rowAxes:s,columnAxes:i,measureAxes:c}={...de,...e},u=p.useRef(null),d=p.useRef(null),m=p.useRef(null),g=n.useLocalization(),[v,f]=r.useCustomComponent(e.editor||de.editor),[h,A]=r.useCustomComponent(e.form||de.form),[C,w]=r.useCustomComponent(e.formElement||de.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,R[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,R[E])),p.createElement(l.Button,{themeColor:"primary",type:"submit",onClick:t.onSubmit},g.toLanguageString(y,R[y])))),...A})))}),de={form:s.Form,formElement:s.FormElement,editor:ie,horizontal:!1,data:[],columnAxes:[],rowAxes:[],measureAxes:[]};ue.displayName="KendoReactPivotGridConfigurator";const me=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||pe.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(k,R[k]),p.createElement(i,{name:"gear",icon:o.gearIcon,...c})))}),pe={icon:r.IconWrap};me.displayName="KendoReactPivotGridConfiguratorButton";const ge=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;const 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=ve(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}}},ve=e=>{for(let t=0,r=e.length;t<r;t++)e[t].uniqueName=e[t].name,e[t].type="kpi";return e},fe={dataField:"aggregate",columnsData:"columns"},he="&",xe=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({data:[],rows:[],columns:[]}),h=p.useCallback(e=>{s(e.value)},[]),x=p.useCallback(e=>{o(e.value)},[]),E=p.useMemo(()=>Array.from(a.rootFields(n).keys()).join(he),[n]),y=p.useMemo(()=>Array.from(a.rootFields(l).keys()).join(he),[l]),A=p.useCallback(t=>({key:t,...e.dimensions[t]}),[e.dimensions]),C=p.useMemo(()=>E?E.split(he).map(A):[],[E,A]),w=p.useMemo(()=>y?y.split(he).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=new Map(a.createDataTree(e.data,w,C,b,fe,m));f(a.createLocalDataState({dataTree:t,rowSettings:w,columnSettings:C,rowAxes:l,columnAxes:n,measures:b,sort:u,fields:fe})),r(!1)},0)},[e.data,w,C,b,m,l,n,u]);const I=p.useMemo(()=>a.createFlatSchemaDimensions(e.dimensions,e.measures),[e.dimensions,e.measures]);return{pivotProps:{rowAxes:l,columnAxes:n,data:v.data,rows:v.rows,columns:v.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,"AggregateType",{enumerable:!0,get:function(){return a.AggregateType}}),Object.defineProperty(e,"averageAggregate",{enumerable:!0,get:function(){return a.averageAggregate}}),Object.defineProperty(e,"createAggregate",{enumerable:!0,get:function(){return a.createAggregate}}),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=U,e.PivotGridAxesEditor=ae,e.PivotGridAxisEditor=re,e.PivotGridAxisFilterFieldsEditor=ee,e.PivotGridCell=S,e.PivotGridColumn=D,e.PivotGridConfigurator=ue,e.PivotGridConfiguratorButton=me,e.PivotGridConfiguratorEditor=ie,e.PivotGridContainer=B,e.PivotGridFieldsEditor=le,e.PivotGridHeaderCell=T,e.PivotGridRow=F,e.PivotLocalDataService=e=>{const t=xe(e);return e.children(t)},e.PivotOLAPService=e=>{const t=ge(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=xe,e.usePivotOLAPService=ge});
|
package/package-metadata.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-pivotgrid",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-pivotgrid",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1779199903,version:"15.0.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"});exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -7,7 +7,7 @@ export const packageMetadata = Object.freeze({
|
|
|
7
7
|
productName: 'KendoReact',
|
|
8
8
|
productCode: 'KENDOUIREACT',
|
|
9
9
|
productCodes: ['KENDOUIREACT'],
|
|
10
|
-
publishDate:
|
|
11
|
-
version: '
|
|
10
|
+
publishDate: 1779199903,
|
|
11
|
+
version: '15.0.0-develop.1',
|
|
12
12
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/components/my-license/'
|
|
13
13
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-pivotgrid",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.0-develop.1",
|
|
4
4
|
"description": "React PivotGrid (also called Pivot Table) can be data-bound to an OLAP service and customized extensively. KendoReact PivotGrid package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -28,15 +28,15 @@
|
|
|
28
28
|
"@progress/kendo-data-query": "^1.7.2",
|
|
29
29
|
"@progress/kendo-licensing": "^1.7.2",
|
|
30
30
|
"@progress/kendo-pivotgrid-common": "0.6.3",
|
|
31
|
-
"@progress/kendo-react-buttons": "
|
|
32
|
-
"@progress/kendo-react-common": "
|
|
33
|
-
"@progress/kendo-react-data-tools": "
|
|
34
|
-
"@progress/kendo-react-form": "
|
|
35
|
-
"@progress/kendo-react-indicators": "
|
|
36
|
-
"@progress/kendo-react-intl": "
|
|
37
|
-
"@progress/kendo-react-labels": "
|
|
38
|
-
"@progress/kendo-react-treeview": "
|
|
39
|
-
"@progress/kendo-svg-icons": "^4.0.0",
|
|
31
|
+
"@progress/kendo-react-buttons": "15.0.0-develop.1",
|
|
32
|
+
"@progress/kendo-react-common": "15.0.0-develop.1",
|
|
33
|
+
"@progress/kendo-react-data-tools": "15.0.0-develop.1",
|
|
34
|
+
"@progress/kendo-react-form": "15.0.0-develop.1",
|
|
35
|
+
"@progress/kendo-react-indicators": "15.0.0-develop.1",
|
|
36
|
+
"@progress/kendo-react-intl": "15.0.0-develop.1",
|
|
37
|
+
"@progress/kendo-react-labels": "15.0.0-develop.1",
|
|
38
|
+
"@progress/kendo-react-treeview": "15.0.0-develop.1",
|
|
39
|
+
"@progress/kendo-svg-icons": "^4.9.0 || ^5.0.0",
|
|
40
40
|
"react": "^18.0.0 || ^19.0.0",
|
|
41
41
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
42
42
|
},
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"package": {
|
|
62
62
|
"productName": "KendoReact",
|
|
63
63
|
"productCode": "KENDOUIREACT",
|
|
64
|
-
"publishDate":
|
|
64
|
+
"publishDate": 1779199903,
|
|
65
65
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
66
66
|
}
|
|
67
67
|
},
|
|
@@ -71,5 +71,10 @@
|
|
|
71
71
|
},
|
|
72
72
|
"publishConfig": {
|
|
73
73
|
"access": "public"
|
|
74
|
+
},
|
|
75
|
+
"peerDependenciesMeta": {
|
|
76
|
+
"@progress/kendo-svg-icons": {
|
|
77
|
+
"optional": true
|
|
78
|
+
}
|
|
74
79
|
}
|
|
75
80
|
}
|