@progress/kendo-react-pivotgrid 9.5.0 → 10.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.js +1 -1
- package/PivotGrid.mjs +114 -114
- 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 +10 -10
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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const He=require("react"),c=require("@progress/kendo-react-common"),ke=require("./package-metadata.js"),Se=require("@progress/kendo-react-intl"),D=require("./messages/index.js"),Pe=require("./components/Row.js"),Ae=require("./components/Cell.js"),J=require("./hooks/useHeaders.js"),xe=require("./components/HeaderCell.js"),Te=require("./hooks/useHorizontalScrollSync.js"),Ne=require("./hooks/useVerticalScrollSync.js"),qe=require("./components/Column.js"),f=require("./utils/index.js"),u=require("@progress/kendo-pivotgrid-common");function De(n){const w=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const m in n)if(m!=="default"){const v=Object.getOwnPropertyDescriptor(n,m);Object.defineProperty(w,m,v.get?v:{enumerable:!0,get:()=>n[m]})}}return w.default=n,Object.freeze(w)}const t=De(He),Q=t.forwardRef((n,w)=>{const m=!c.validatePackage(ke.packageMetadata,{component:"PivotGrid"}),{rows:v,rowAxes:U,columns:Y,columnAxes:Z,data:ee}={...y,...n},s=t.useRef(null),E=t.useRef(null),d=t.useRef(null),b=t.useRef(null),O=t.useRef(null),z=t.useRef(null),S=t.useRef(null),te=Se.useLocalization(),ne=(e,r)=>{n.onRowAxesChange&&n.onRowAxesChange({value:e,target:E.current,syntheticEvent:r})},ae=(e,r)=>{n.onColumnAxesChange&&n.onColumnAxesChange({value:e,target:E.current,syntheticEvent:r})},L=u.toTree((v||[]).slice()),[,oe]=J.useHeaders((U||[]).slice(),L,ne),[I,C,re,G]=u.toRows(L),j=u.toTree((Y||[]).slice()),[,le]=J.useHeaders((Z||[]).slice(),j,ae),[R,i,,K]=u.toColumns(j),P=u.toData((ee||[]).slice(),i,C,K,re);t.useImperativeHandle(E,()=>({props:n,element:s.current,columnHeaderRows:R,rowHeaderRows:I,dataCells:P,rowHeaderBreadth:G,columnHeaderBreadth:K})),t.useImperativeHandle(w,()=>E.current);const B=[],V=[],W=[],[A,x]=c.useCustomComponent(n.row||y.row),[T,N]=c.useCustomComponent(n.column||y.column),[se,ce]=c.useCustomComponent(n.cell||y.cell),[_,M]=c.useCustomComponent(n.headerCell||y.headerCell),ie=n.columnHeadersRow||A,ue=n.columnHeadersColumn||T,de=n.columnHeadersCell||_,me=n.rowHeadersRow||A,Ce=n.rowHeadersColumn||T,pe=n.rowHeadersCell||_,he=n.dataRow||A,ge=n.dataColumn||T;for(let e=0;e<i.length;e++)B.push(t.createElement(ge,{key:String(i[e].path),...N,path:i[e].path})),W.push(t.createElement(ue,{key:String(i[e].path),...N,path:i[e].path}));for(let e=0;e<G;e++)V.push(t.createElement(Ce,{key:e,...N}));const fe=e=>{e.target.props.expandable&&le({type:u.HEADERS_ACTION.toggle,payload:e.target.props.dataItem.path},e.syntheticEvent)},we=e=>{e.target.props.expandable&&oe({type:u.HEADERS_ACTION.toggle,payload:e.target.props.dataItem.path},e.syntheticEvent)},F=Te.useHorizontalScrollSync(S,z),be=Ne.useVerticalScrollSync(S,O),ye=e=>{F(e),be(e)},X=t.useCallback(()=>{s.current&&b.current&&(s.current.style.gridTemplateRows="",s.current.style.gridTemplateRows=`${b.current.offsetHeight}px 1fr`)},[]),$=t.useCallback(()=>{s.current&&d.current&&(s.current.style.gridTemplateColumns="",s.current.style.gridTemplateColumns=`${d.current.offsetWidth}px 1fr`)},[]),p=t.useRef(new u.PivotGridNavigation({tabIndex:n.tabIndex||0}));t.useEffect(()=>{if(s.current){const e=n.tabIndex||0;if(p.current.stop(),p.current.tabIndex=e,n.navigatable){p.current.start(s.current);const r=p.current.first;r&&r.setAttribute("tabindex",String(e))}}return()=>{p.current.stop()}},[n.tabIndex,n.navigatable]),t.useEffect(()=>{p.current.update()}),t.useEffect(()=>{if(b.current){const e=new window.ResizeObserver(()=>{window.requestAnimationFrame(()=>{X()})});return e.observe(b.current),()=>{e.disconnect()}}},[X]),t.useEffect(()=>{if(d.current){const e=new window.ResizeObserver(()=>{window.requestAnimationFrame(()=>{$()})});return e.observe(d.current),()=>{e.disconnect()}}},[$]),c.useIsomorphicLayoutEffect(()=>{if(c.setScrollbarWidth(),d.current){const e=new window.ResizeObserver(()=>window.requestAnimationFrame(()=>{c.setScrollbarWidth()}));return e.observe(d.current),()=>{e.disconnect()}}},[]);const h=new Array(R.length).fill([]).map(()=>new Array(i.length));R.forEach((e,r)=>{let a=0;Array.from(e.cells).forEach(o=>{const l=!!(o&&o.children&&o.children.length),q=(o?f.generateKey(o.normalizedPath)+(o.total?"|[TOTAL]":"")+(l?"|[EXPANDED]":""):"").replace(/\s/g,"-");if(o)for(let k=0;k<(o.colSpan||1);k++){for(let g=0;g<(o.rowSpan||1);g++){const ve=h[r+g].findIndex((Ee,Re)=>Re>=a&&!Ee);h[r+g][ve]=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:s,id:n.id,style:n.style,tabIndex:n.navigatable?void 0:n.tabIndex,className:c.classNames("k-pivotgrid",n.className),role:"grid"},m&&t.createElement(c.WatermarkOverlay,null),t.createElement("span",{className:"k-pivotgrid-empty-cell"},t.createElement("span",{className:"k-sr-only"},te.toLanguageString(D.emptyCellAriaLabel,D.messages[D.emptyCellAriaLabel]))),t.createElement("div",{ref:z,className:"k-pivotgrid-column-headers",onScroll:F},t.createElement("table",{ref:b,className:"k-pivotgrid-table",role:"none"},t.createElement("colgroup",null,W),t.createElement("tbody",{className:"k-pivotgrid-tbody",role:"rowgroup"},R.map((e,r)=>{let a=!1;return t.createElement(ie,{key:e.name,role:"row",...x},e.cells.map((o,l)=>{const q=l!==0&&!a;o&&(a=!0);const k=o&&!!(o.children&&o.children.length),g=o&&o.hasChildren&&(!o.total||o.total&&o.parent.total);return o?t.createElement(de,{...M,key:h[r][l],"data-key":h[r][l],id:h[r][l],columnPath:o.normalizedPath,rowSpan:o.rowSpan||void 0,colSpan:o.colSpan||void 0,onIconClick:fe,dataItem:o,expanded:k,expandable:g,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,V),t.createElement("tbody",{className:"k-pivotgrid-tbody",role:"rowgroup"},I.map((e,r)=>t.createElement(me,{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(pe,{...M,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:we,root:a.levelNum===0,role:"rowheader"},a.caption):null)))))),t.createElement("div",{ref:S,className:"k-pivotgrid-values",onScroll:ye},t.createElement("table",{className:"k-pivotgrid-table",role:"none"},t.createElement("colgroup",null,B),t.createElement("tbody",{className:"k-pivotgrid-tbody",role:"none"},P.map((e,r)=>t.createElement(he,{key:f.generateKey(C[r].path),...x,path:C[r].path,role:"none"},e.cells.map((a,o)=>t.createElement(se,{key:H[r][o],"data-key":H[r][o],id:H[r][o],...ce,rowPath:a.rowTuple.members.map(l=>l.name),columnPath:a.columnTuple.members.map(l=>l.name),dataItem:a,total:C[r].total||i[o].total,role:"gridcell",ariaDescribedby:h.map(l=>l[o]).join(" ")},a&&a.data&&a.data.fmtValue?a.data.fmtValue:" "))))))))}),y={rowAxes:[],columnAxes:[],data:[],row:Pe.PivotGridRow,column:qe.PivotGridColumn,cell:Ae.PivotGridCell,headerCell:xe.PivotGridHeaderCell};Q.displayName="KendoReactPivotGrid";exports.PivotGrid=Q;
|
package/PivotGrid.mjs
CHANGED
|
@@ -6,45 +6,44 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
|
-
import { validatePackage as
|
|
10
|
-
import { packageMetadata as
|
|
11
|
-
import { useLocalization as
|
|
12
|
-
import { emptyCellAriaLabel as
|
|
13
|
-
import { PivotGridRow as
|
|
14
|
-
import { PivotGridCell as
|
|
9
|
+
import { validatePackage as ke, useCustomComponent as y, useIsomorphicLayoutEffect as Se, setScrollbarWidth as X, classNames as xe, WatermarkOverlay as Ae } from "@progress/kendo-react-common";
|
|
10
|
+
import { packageMetadata as Pe } from "./package-metadata.mjs";
|
|
11
|
+
import { useLocalization as Ne } from "@progress/kendo-react-intl";
|
|
12
|
+
import { emptyCellAriaLabel as j, messages as Te } from "./messages/index.mjs";
|
|
13
|
+
import { PivotGridRow as De } from "./components/Row.mjs";
|
|
14
|
+
import { PivotGridCell as ze } 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 Le } from "./components/HeaderCell.mjs";
|
|
17
|
+
import { useHorizontalScrollSync as Oe } from "./hooks/useHorizontalScrollSync.mjs";
|
|
18
|
+
import { useVerticalScrollSync as Ge } from "./hooks/useVerticalScrollSync.mjs";
|
|
19
19
|
import { PivotGridColumn as Ie } from "./components/Column.mjs";
|
|
20
|
-
import { generateKey as f, generateDataKey as
|
|
21
|
-
import { toTree as M, toRows as
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} = { ...C, ...n }, s = t.useRef(null), w = t.useRef(null), i = t.useRef(null), h = t.useRef(null), P = t.useRef(null), N = t.useRef(null), E = t.useRef(null), te = Ae(), oe = (e, r) => {
|
|
20
|
+
import { generateKey as f, generateDataKey as Be } from "./utils/index.mjs";
|
|
21
|
+
import { toTree as M, toRows as Ve, toColumns as We, toData as qe, PivotGridNavigation as Fe, HEADERS_ACTION as _ } from "@progress/kendo-pivotgrid-common";
|
|
22
|
+
const Ke = t.forwardRef((n, J) => {
|
|
23
|
+
const Q = !ke(Pe, { component: "PivotGrid" }), {
|
|
24
|
+
rows: U,
|
|
25
|
+
rowAxes: Y,
|
|
26
|
+
columns: Z,
|
|
27
|
+
columnAxes: ee,
|
|
28
|
+
data: te
|
|
29
|
+
} = { ...C, ...n }, s = t.useRef(null), w = t.useRef(null), i = t.useRef(null), h = t.useRef(null), P = t.useRef(null), N = t.useRef(null), E = t.useRef(null), ae = Ne(), oe = (e, r) => {
|
|
31
30
|
n.onRowAxesChange && n.onRowAxesChange({
|
|
32
31
|
value: e,
|
|
33
32
|
target: w.current,
|
|
34
33
|
syntheticEvent: r
|
|
35
34
|
});
|
|
36
|
-
},
|
|
35
|
+
}, ne = (e, r) => {
|
|
37
36
|
n.onColumnAxesChange && n.onColumnAxesChange({
|
|
38
37
|
value: e,
|
|
39
38
|
target: w.current,
|
|
40
39
|
syntheticEvent: r
|
|
41
40
|
});
|
|
42
|
-
}, T = M((
|
|
43
|
-
(
|
|
41
|
+
}, T = M((U || []).slice()), [, re] = $((Y || []).slice(), T, oe), [D, c, le, z] = Ve(T), L = M((Z || []).slice()), [, se] = $((ee || []).slice(), L, ne), [g, m, , O] = We(L), R = qe(
|
|
42
|
+
(te || []).slice(),
|
|
44
43
|
m,
|
|
45
44
|
c,
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
O,
|
|
46
|
+
le
|
|
48
47
|
);
|
|
49
48
|
t.useImperativeHandle(w, () => ({
|
|
50
49
|
props: n,
|
|
@@ -53,17 +52,17 @@ const Fe = t.forwardRef((n, J) => {
|
|
|
53
52
|
rowHeaderRows: D,
|
|
54
53
|
dataCells: R,
|
|
55
54
|
rowHeaderBreadth: z,
|
|
56
|
-
columnHeaderBreadth:
|
|
55
|
+
columnHeaderBreadth: O
|
|
57
56
|
})), t.useImperativeHandle(J, () => w.current);
|
|
58
|
-
const
|
|
57
|
+
const G = [], I = [], B = [], [H, k] = y(n.row || C.row), [S, x] = y(
|
|
59
58
|
n.column || C.column
|
|
60
|
-
), [
|
|
59
|
+
), [me, ie] = y(n.cell || C.cell), [V, W] = y(
|
|
61
60
|
n.headerCell || C.headerCell
|
|
62
|
-
),
|
|
61
|
+
), ce = n.columnHeadersRow || H, de = n.columnHeadersColumn || S, ue = n.columnHeadersCell || V, pe = n.rowHeadersRow || H, he = n.rowHeadersColumn || S, fe = n.rowHeadersCell || V, Ce = n.dataRow || H, we = n.dataColumn || S;
|
|
63
62
|
for (let e = 0; e < m.length; e++)
|
|
64
|
-
|
|
63
|
+
G.push(
|
|
65
64
|
/* @__PURE__ */ t.createElement(
|
|
66
|
-
|
|
65
|
+
we,
|
|
67
66
|
{
|
|
68
67
|
key: String(m[e].path),
|
|
69
68
|
...x,
|
|
@@ -72,7 +71,7 @@ const Fe = t.forwardRef((n, J) => {
|
|
|
72
71
|
)
|
|
73
72
|
), B.push(
|
|
74
73
|
/* @__PURE__ */ t.createElement(
|
|
75
|
-
|
|
74
|
+
de,
|
|
76
75
|
{
|
|
77
76
|
key: String(m[e].path),
|
|
78
77
|
...x,
|
|
@@ -81,30 +80,30 @@ const Fe = t.forwardRef((n, J) => {
|
|
|
81
80
|
)
|
|
82
81
|
);
|
|
83
82
|
for (let e = 0; e < z; e++)
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
e.target.props.expandable &&
|
|
83
|
+
I.push(/* @__PURE__ */ t.createElement(he, { key: e, ...x }));
|
|
84
|
+
const ge = (e) => {
|
|
85
|
+
e.target.props.expandable && se(
|
|
87
86
|
{
|
|
88
87
|
type: _.toggle,
|
|
89
88
|
payload: e.target.props.dataItem.path
|
|
90
89
|
},
|
|
91
90
|
e.syntheticEvent
|
|
92
91
|
);
|
|
93
|
-
},
|
|
94
|
-
e.target.props.expandable &&
|
|
92
|
+
}, be = (e) => {
|
|
93
|
+
e.target.props.expandable && re(
|
|
95
94
|
{
|
|
96
95
|
type: _.toggle,
|
|
97
96
|
payload: e.target.props.dataItem.path
|
|
98
97
|
},
|
|
99
98
|
e.syntheticEvent
|
|
100
99
|
);
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
},
|
|
100
|
+
}, q = Oe(E, N), ve = Ge(E, P), ye = (e) => {
|
|
101
|
+
q(e), ve(e);
|
|
102
|
+
}, F = t.useCallback(() => {
|
|
104
103
|
s.current && h.current && (s.current.style.gridTemplateRows = "", s.current.style.gridTemplateRows = `${h.current.offsetHeight}px 1fr`);
|
|
105
|
-
}, []),
|
|
104
|
+
}, []), K = t.useCallback(() => {
|
|
106
105
|
s.current && i.current && (s.current.style.gridTemplateColumns = "", s.current.style.gridTemplateColumns = `${i.current.offsetWidth}px 1fr`);
|
|
107
|
-
}, []), d = t.useRef(new
|
|
106
|
+
}, []), d = t.useRef(new Fe({ tabIndex: n.tabIndex || 0 }));
|
|
108
107
|
t.useEffect(() => {
|
|
109
108
|
if (s.current) {
|
|
110
109
|
const e = n.tabIndex || 0;
|
|
@@ -123,29 +122,29 @@ const Fe = t.forwardRef((n, J) => {
|
|
|
123
122
|
if (h.current) {
|
|
124
123
|
const e = new window.ResizeObserver(() => {
|
|
125
124
|
window.requestAnimationFrame(() => {
|
|
126
|
-
|
|
125
|
+
F();
|
|
127
126
|
});
|
|
128
127
|
});
|
|
129
128
|
return e.observe(h.current), () => {
|
|
130
129
|
e.disconnect();
|
|
131
130
|
};
|
|
132
131
|
}
|
|
133
|
-
}, [
|
|
132
|
+
}, [F]), t.useEffect(() => {
|
|
134
133
|
if (i.current) {
|
|
135
134
|
const e = new window.ResizeObserver(() => {
|
|
136
135
|
window.requestAnimationFrame(() => {
|
|
137
|
-
|
|
136
|
+
K();
|
|
138
137
|
});
|
|
139
138
|
});
|
|
140
139
|
return e.observe(i.current), () => {
|
|
141
140
|
e.disconnect();
|
|
142
141
|
};
|
|
143
142
|
}
|
|
144
|
-
}, [
|
|
145
|
-
if (
|
|
143
|
+
}, [K]), Se(() => {
|
|
144
|
+
if (X(), i.current) {
|
|
146
145
|
const e = new window.ResizeObserver(
|
|
147
146
|
() => window.requestAnimationFrame(() => {
|
|
148
|
-
|
|
147
|
+
X();
|
|
149
148
|
})
|
|
150
149
|
);
|
|
151
150
|
return e.observe(i.current), () => {
|
|
@@ -155,23 +154,23 @@ const Fe = t.forwardRef((n, J) => {
|
|
|
155
154
|
}, []);
|
|
156
155
|
const u = new Array(g.length).fill([]).map(() => new Array(m.length));
|
|
157
156
|
g.forEach((e, r) => {
|
|
158
|
-
let
|
|
159
|
-
Array.from(e.cells).forEach((
|
|
160
|
-
const l = !!(
|
|
161
|
-
if (
|
|
162
|
-
for (let v = 0; v < (
|
|
163
|
-
for (let p = 0; p < (
|
|
164
|
-
const
|
|
165
|
-
(
|
|
157
|
+
let a = 0;
|
|
158
|
+
Array.from(e.cells).forEach((o) => {
|
|
159
|
+
const l = !!(o && o.children && o.children.length), A = (o ? f(o.normalizedPath) + (o.total ? "|[TOTAL]" : "") + (l ? "|[EXPANDED]" : "") : "").replace(/\s/g, "-");
|
|
160
|
+
if (o)
|
|
161
|
+
for (let v = 0; v < (o.colSpan || 1); v++) {
|
|
162
|
+
for (let p = 0; p < (o.rowSpan || 1); p++) {
|
|
163
|
+
const Ee = u[r + p].findIndex(
|
|
164
|
+
(Re, He) => He >= a && !Re
|
|
166
165
|
);
|
|
167
|
-
u[r + p][
|
|
166
|
+
u[r + p][Ee] = A;
|
|
168
167
|
}
|
|
169
|
-
|
|
168
|
+
a++;
|
|
170
169
|
}
|
|
171
170
|
});
|
|
172
171
|
});
|
|
173
172
|
const b = R.map((e) => e.cells.map(
|
|
174
|
-
(r) =>
|
|
173
|
+
(r) => Be(r.rowTuple.members, r.columnTuple.members).replace(/\s/g, "-")
|
|
175
174
|
));
|
|
176
175
|
return /* @__PURE__ */ t.createElement(
|
|
177
176
|
"div",
|
|
@@ -180,41 +179,42 @@ const Fe = t.forwardRef((n, J) => {
|
|
|
180
179
|
id: n.id,
|
|
181
180
|
style: n.style,
|
|
182
181
|
tabIndex: n.navigatable ? void 0 : n.tabIndex,
|
|
183
|
-
className:
|
|
182
|
+
className: xe("k-pivotgrid", n.className),
|
|
184
183
|
role: "grid"
|
|
185
184
|
},
|
|
186
|
-
|
|
187
|
-
/* @__PURE__ */ t.createElement("
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
185
|
+
Q && /* @__PURE__ */ t.createElement(Ae, null),
|
|
186
|
+
/* @__PURE__ */ t.createElement("span", { className: "k-pivotgrid-empty-cell" }, /* @__PURE__ */ t.createElement("span", { className: "k-sr-only" }, ae.toLanguageString(j, Te[j]))),
|
|
187
|
+
/* @__PURE__ */ t.createElement("div", { ref: N, className: "k-pivotgrid-column-headers", onScroll: q }, /* @__PURE__ */ t.createElement("table", { ref: h, className: "k-pivotgrid-table", role: "none" }, /* @__PURE__ */ t.createElement("colgroup", null, B), /* @__PURE__ */ t.createElement("tbody", { className: "k-pivotgrid-tbody", role: "rowgroup" }, g.map((e, r) => {
|
|
188
|
+
let a = !1;
|
|
189
|
+
return /* @__PURE__ */ t.createElement(ce, { key: e.name, role: "row", ...k }, e.cells.map((o, l) => {
|
|
190
|
+
const A = l !== 0 && !a;
|
|
191
|
+
o && (a = !0);
|
|
192
|
+
const v = o && !!(o.children && o.children.length), p = o && o.hasChildren && (!o.total || o.total && o.parent.total);
|
|
193
|
+
return o ? /* @__PURE__ */ t.createElement(
|
|
194
|
+
ue,
|
|
195
195
|
{
|
|
196
|
-
...
|
|
196
|
+
...W,
|
|
197
197
|
key: u[r][l],
|
|
198
198
|
"data-key": u[r][l],
|
|
199
199
|
id: u[r][l],
|
|
200
|
-
columnPath:
|
|
201
|
-
rowSpan:
|
|
202
|
-
colSpan:
|
|
203
|
-
onIconClick:
|
|
204
|
-
dataItem:
|
|
200
|
+
columnPath: o.normalizedPath,
|
|
201
|
+
rowSpan: o.rowSpan || void 0,
|
|
202
|
+
colSpan: o.colSpan || void 0,
|
|
203
|
+
onIconClick: ge,
|
|
204
|
+
dataItem: o,
|
|
205
205
|
expanded: v,
|
|
206
206
|
expandable: p,
|
|
207
|
-
total:
|
|
207
|
+
total: o.total,
|
|
208
208
|
first: A,
|
|
209
|
-
root:
|
|
209
|
+
root: o.levelNum === 0,
|
|
210
210
|
role: "columnheader"
|
|
211
211
|
},
|
|
212
|
-
|
|
212
|
+
o.caption
|
|
213
213
|
) : null;
|
|
214
214
|
}));
|
|
215
215
|
})))),
|
|
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,
|
|
217
|
-
|
|
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
|
+
pe,
|
|
218
218
|
{
|
|
219
219
|
key: f(c[r].path),
|
|
220
220
|
...k,
|
|
@@ -223,50 +223,50 @@ const Fe = t.forwardRef((n, J) => {
|
|
|
223
223
|
ariaOwns: b[r].join(" ")
|
|
224
224
|
},
|
|
225
225
|
e.cells.filter(Boolean).map(
|
|
226
|
-
(
|
|
227
|
-
|
|
226
|
+
(a) => a ? /* @__PURE__ */ t.createElement(
|
|
227
|
+
fe,
|
|
228
228
|
{
|
|
229
|
-
...
|
|
230
|
-
key: f(
|
|
231
|
-
"data-key": f(
|
|
232
|
-
rowPath:
|
|
233
|
-
rowSpan:
|
|
234
|
-
colSpan:
|
|
235
|
-
dataItem:
|
|
236
|
-
expanded: !!(
|
|
237
|
-
expandable:
|
|
238
|
-
total:
|
|
239
|
-
onIconClick:
|
|
240
|
-
root:
|
|
229
|
+
...W,
|
|
230
|
+
key: f(a.normalizedPath) + (a.total ? "|[TOTAL]" : "") + (a.children && a.children.length ? "|[EXPANDED]" : ""),
|
|
231
|
+
"data-key": f(a.normalizedPath) + (a.total ? "|[TOTAL]" : "") + (a.children && a.children.length ? "|[EXPANDED]" : ""),
|
|
232
|
+
rowPath: a.normalizedPath,
|
|
233
|
+
rowSpan: a.rowSpan || void 0,
|
|
234
|
+
colSpan: a.colSpan || void 0,
|
|
235
|
+
dataItem: a,
|
|
236
|
+
expanded: !!(a.children && a.children.length),
|
|
237
|
+
expandable: a.hasChildren && !a.total,
|
|
238
|
+
total: a.total,
|
|
239
|
+
onIconClick: be,
|
|
240
|
+
root: a.levelNum === 0,
|
|
241
241
|
role: "rowheader"
|
|
242
242
|
},
|
|
243
|
-
|
|
243
|
+
a.caption
|
|
244
244
|
) : null
|
|
245
245
|
)
|
|
246
246
|
))))),
|
|
247
|
-
/* @__PURE__ */ t.createElement("div", { ref: E, className: "k-pivotgrid-values", onScroll:
|
|
248
|
-
|
|
247
|
+
/* @__PURE__ */ t.createElement("div", { ref: E, className: "k-pivotgrid-values", onScroll: ye }, /* @__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
|
+
Ce,
|
|
249
249
|
{
|
|
250
250
|
key: f(c[r].path),
|
|
251
251
|
...k,
|
|
252
252
|
path: c[r].path,
|
|
253
253
|
role: "none"
|
|
254
254
|
},
|
|
255
|
-
e.cells.map((
|
|
256
|
-
|
|
255
|
+
e.cells.map((a, o) => /* @__PURE__ */ t.createElement(
|
|
256
|
+
me,
|
|
257
257
|
{
|
|
258
|
-
key: b[r][
|
|
259
|
-
"data-key": b[r][
|
|
260
|
-
id: b[r][
|
|
261
|
-
...
|
|
262
|
-
rowPath:
|
|
263
|
-
columnPath:
|
|
264
|
-
dataItem:
|
|
265
|
-
total: c[r].total || m[
|
|
258
|
+
key: b[r][o],
|
|
259
|
+
"data-key": b[r][o],
|
|
260
|
+
id: b[r][o],
|
|
261
|
+
...ie,
|
|
262
|
+
rowPath: a.rowTuple.members.map((l) => l.name),
|
|
263
|
+
columnPath: a.columnTuple.members.map((l) => l.name),
|
|
264
|
+
dataItem: a,
|
|
265
|
+
total: c[r].total || m[o].total,
|
|
266
266
|
role: "gridcell",
|
|
267
|
-
ariaDescribedby: u.map((l) => l[
|
|
267
|
+
ariaDescribedby: u.map((l) => l[o]).join(" ")
|
|
268
268
|
},
|
|
269
|
-
|
|
269
|
+
a && a.data && a.data.fmtValue ? a.data.fmtValue : " "
|
|
270
270
|
))
|
|
271
271
|
)))))
|
|
272
272
|
);
|
|
@@ -274,12 +274,12 @@ const Fe = t.forwardRef((n, J) => {
|
|
|
274
274
|
rowAxes: [],
|
|
275
275
|
columnAxes: [],
|
|
276
276
|
data: [],
|
|
277
|
-
row:
|
|
277
|
+
row: De,
|
|
278
278
|
column: Ie,
|
|
279
|
-
cell:
|
|
280
|
-
headerCell:
|
|
279
|
+
cell: ze,
|
|
280
|
+
headerCell: Le
|
|
281
281
|
};
|
|
282
|
-
|
|
282
|
+
Ke.displayName = "KendoReactPivotGrid";
|
|
283
283
|
export {
|
|
284
|
-
|
|
284
|
+
Ke as PivotGrid
|
|
285
285
|
};
|
|
@@ -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={name:"@progress/kendo-react-pivotgrid",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"$VERSION",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},v="pivotgrid.emptyCellAriaLabel",f="pivotgrid.fieldMenuReset",h="pivotgrid.fieldMenuApply",x="pivotgrid.configuratorTitle",E="pivotgrid.configuratorCancel",y="pivotgrid.configuratorApply",A="pivotgrid.configuratorColumnsTitle",C="pivotgrid.configuratorRowsTitle",w="pivotgrid.configuratorMeasuresTitle",b="pivotgrid.configuratorEditorSearchTitle",I="pivotgrid.configuratorMissingFields",N="pivotgrid.configuratorButtonLabel",k={[v]:"PivotGrid component. Use the arrow keys to navigate.",[f]:"Reset",[h]:"Apply",[E]:"Cancel",[y]:"Apply",[x]:"Settings",[b]:"Fields","pivotgrid.configuratorEditorSearchPlaceholder":"Search...",[A]:"Columns",[C]:"Rows",[w]:"Values",[N]:"Change settings",[I]:"Select some fields to begin setup"},R=p.forwardRef(((e,t)=>{const n=p.useRef(null),a=p.useRef(null);p.useImperativeHandle(n,(()=>({element:a.current,props:e}))),p.useImperativeHandle(t,(()=>n.current));const o=r.useMouse(e,n);return p.createElement("tr",{ref:a,...o,id:e.id,style:e.style,tabIndex:e.tabIndex,children:e.children,role:e.role,"aria-owns":e.ariaOwns,className:r.classNames("k-pivotgrid-row",e.className)})}));R.displayName="KendoReactPivotGridRow";const 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("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)}));F.displayName="KendoReactPivotGridCell";const S=(e,t,r)=>[e,(n,o)=>{const l=a.headersReducer(e,{...n,tree:t});r&&r(l,o)}],P=p.forwardRef(((e,t)=>{const n=p.useRef(null),a=p.useRef(null);p.useImperativeHandle(n,(()=>({element:a.current,props:e}))),p.useImperativeHandle(t,(()=>n.current));const[l,s]=r.useCustomComponent(e.icon||L.icon),i=r.useMouse(e,n);return p.createElement("th",{ref:a,...i,colSpan:e.colSpan,rowSpan:e.rowSpan,id:e.id,style:e.style,tabIndex:e.tabIndex,role:e.role,...e.expandable?{"aria-expanded":e.expanded}:{},className:r.classNames("k-pivotgrid-cell",{"k-pivotgrid-header-total":e.total,"k-pivotgrid-header-root":e.root,"k-pivotgrid-expanded":e.expanded,"k-first":e.first},e.className)},e.expandable&&p.createElement(l,{...s,onClick:t=>{e.onIconClick&&e.onIconClick.call(void 0,{syntheticEvent:t.syntheticEvent,target:n.current})},name:"chevron-"+(e.expanded?"up":"down"),"aria-hidden":!0,icon:e.expanded?o.chevronUpIcon:o.chevronDownIcon}),e.children)})),L={icon:r.IconWrap};P.displayName="KendoReactPivotGridHeaderCell";const T=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=D.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})})),D={path:[]};T.displayName="KendoReactPivotGridColumn";const M=(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},O=(e=[])=>{const t=new Set;return e.forEach((e=>{t.add(String(e.name))})),Array.from(t)},H=(e=[])=>`${e.join(",")}`,G=(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},K=(e,t)=>e.uniqueName===t.uniqueName,z=p.forwardRef(((e,t)=>{r.validatePackage(g);const{rows:o,rowAxes:l,columns:s,columnAxes:i,data:c}={...U,...e},u=p.useRef(null),d=p.useRef(null),m=p.useRef(null),f=p.useRef(null),h=p.useRef(null),x=p.useRef(null),E=p.useRef(null),y=n.useLocalization(),A=a.toTree((o||[]).slice()),[,C]=S((l||[]).slice(),A,((t,r)=>{e.onRowAxesChange&&e.onRowAxesChange({value:t,target:d.current,syntheticEvent:r})})),[w,b,I,N]=a.toRows(A),R=a.toTree((s||[]).slice()),[,F]=S((i||[]).slice(),R,((t,r)=>{e.onColumnAxesChange&&e.onColumnAxesChange({value:t,target:d.current,syntheticEvent:r})})),[P,L,,T]=a.toColumns(R),D=a.toData((c||[]).slice(),L,b,T,I);p.useImperativeHandle(d,(()=>({props:e,element:u.current,columnHeaderRows:P,rowHeaderRows:w,dataCells:D,rowHeaderBreadth:N,columnHeaderBreadth:T}))),p.useImperativeHandle(t,(()=>d.current));const M=[],q=[],O=[],[G,K]=r.useCustomComponent(e.row||U.row),[z,B]=r.useCustomComponent(e.column||U.column),[j,V]=r.useCustomComponent(e.cell||U.cell),[X,Z]=r.useCustomComponent(e.headerCell||U.headerCell),_=e.columnHeadersRow||G,$=e.columnHeadersColumn||z,J=e.columnHeadersCell||X,W=e.rowHeadersRow||G,Y=e.rowHeadersColumn||z,Q=e.rowHeadersCell||X,ee=e.dataRow||G,te=e.dataColumn||z;for(let e=0;e<L.length;e++)M.push(p.createElement(te,{key:String(L[e].path),...B,path:L[e].path})),O.push(p.createElement($,{key:String(L[e].path),...B,path:L[e].path}));for(let e=0;e<N;e++)q.push(p.createElement(Y,{key:e,...B}));const re=e=>{e.target.props.expandable&&F({type:a.HEADERS_ACTION.toggle,payload:e.target.props.dataItem.path},e.syntheticEvent)},ne=e=>{e.target.props.expandable&&C({type:a.HEADERS_ACTION.toggle,payload:e.target.props.dataItem.path},e.syntheticEvent)},ae=((...e)=>{const t=p.useRef();return r=>{void 0!==t.current&&window.cancelAnimationFrame(t.current);const n=r.currentTarget,a=n.scrollLeft;e.forEach((e=>{const r=e.current;r&&r!==n&&(t.current=window.requestAnimationFrame((()=>{r.scrollLeft=Math.round(a)})))}))}})(E,x),oe=((...e)=>{const t=p.useRef();return r=>{void 0!==t.current&&window.cancelAnimationFrame(t.current);const n=r.currentTarget,a=n.scrollTop;e.forEach((e=>{const r=e.current;r&&r!==n&&(t.current=window.requestAnimationFrame((()=>{r.scrollTop=Math.round(a)})))}))}})(E,h),le=p.useCallback((()=>{u.current&&f.current&&(u.current.style.gridTemplateRows="",u.current.style.gridTemplateRows=`${f.current.offsetHeight}px 1fr`)}),[]),se=p.useCallback((()=>{u.current&&m.current&&(u.current.style.gridTemplateColumns="",u.current.style.gridTemplateColumns=`${m.current.offsetWidth}px 1fr`)}),[]),ie=p.useRef(new a.PivotGridNavigation({tabIndex:e.tabIndex||0}));p.useEffect((()=>{if(u.current){const t=e.tabIndex||0;if(ie.current.stop(),ie.current.tabIndex=t,e.navigatable){ie.current.start(u.current);const e=ie.current.first;e&&e.setAttribute("tabindex",String(t))}}return()=>{ie.current.stop()}}),[e.tabIndex,e.navigatable]),p.useEffect((()=>{ie.current.update()})),p.useEffect((()=>{if(f.current){const e=new window.ResizeObserver((()=>{window.requestAnimationFrame((()=>{le()}))}));return e.observe(f.current),()=>{e.disconnect()}}}),[le]),p.useEffect((()=>{if(m.current){const e=new window.ResizeObserver((()=>{window.requestAnimationFrame((()=>{se()}))}));return e.observe(m.current),()=>{e.disconnect()}}}),[se]),r.useIsomorphicLayoutEffect((()=>{if(r.setScrollbarWidth(),m.current){const e=new window.ResizeObserver((()=>window.requestAnimationFrame((()=>{r.setScrollbarWidth()}))));return e.observe(m.current),()=>{e.disconnect()}}}),[]);const ce=new Array(P.length).fill([]).map((()=>new Array(L.length)));P.forEach(((e,t)=>{let r=0;Array.from(e.cells).forEach((e=>{const n=!!(e&&e.children&&e.children.length),a=(e?H(e.normalizedPath)+(e.total?"|[TOTAL]":"")+(n?"|[EXPANDED]":""):"").replace(/\s/g,"-");if(e)for(let n=0;n<(e.colSpan||1);n++){for(let n=0;n<(e.rowSpan||1);n++){const e=ce[t+n].findIndex(((e,t)=>t>=r&&!e));ce[t+n][e]=a}r++}}))}));const ue=D.map((e=>e.cells.map((e=>((e,t)=>`${H(e.map((e=>e.name)))}|${H(t.map((e=>e.name)))}`)(e.rowTuple.members,e.columnTuple.members).replace(/\s/g,"-")))));return p.createElement("div",{ref:u,id:e.id,style:e.style,tabIndex:e.navigatable?void 0:e.tabIndex,className:r.classNames("k-pivotgrid",e.className),role:"grid"},p.createElement("span",{className:"k-pivotgrid-empty-cell"},p.createElement("span",{className:"k-sr-only"},y.toLanguageString(v,k[v]))),p.createElement("div",{ref:x,className:"k-pivotgrid-column-headers",onScroll:ae},p.createElement("table",{ref:f,className:"k-pivotgrid-table",role:"none"},p.createElement("colgroup",null,O),p.createElement("tbody",{className:"k-pivotgrid-tbody",role:"rowgroup"},P.map(((e,t)=>{let r=!1;return p.createElement(_,{key:e.name,role:"row",...K},e.cells.map(((e,n)=>{const a=0!==n&&!r;e&&(r=!0);const o=e&&!(!e.children||!e.children.length),l=e&&e.hasChildren&&(!e.total||e.total&&e.parent.total);return e?p.createElement(J,{...Z,key:ce[t][n],"data-key":ce[t][n],id:ce[t][n],columnPath:e.normalizedPath,rowSpan:e.rowSpan||void 0,colSpan:e.colSpan||void 0,onIconClick:re,dataItem:e,expanded:o,expandable:l,total:e.total,first:a,root:0===e.levelNum,role:"columnheader"},e.caption):null})))}))))),p.createElement("div",{ref:h,className:"k-pivotgrid-row-headers"},p.createElement("table",{ref:m,className:"k-pivotgrid-table",role:"none"},p.createElement("colgroup",null,q),p.createElement("tbody",{className:"k-pivotgrid-tbody",role:"rowgroup"},w.map(((e,t)=>p.createElement(W,{key:H(b[t].path),...K,path:b[t].path,role:"row",ariaOwns:ue[t].join(" ")},e.cells.filter(Boolean).map((e=>e?p.createElement(Q,{...Z,key:H(e.normalizedPath)+(e.total?"|[TOTAL]":"")+(e.children&&e.children.length?"|[EXPANDED]":""),"data-key":H(e.normalizedPath)+(e.total?"|[TOTAL]":"")+(e.children&&e.children.length?"|[EXPANDED]":""),rowPath:e.normalizedPath,rowSpan:e.rowSpan||void 0,colSpan:e.colSpan||void 0,dataItem:e,expanded:!(!e.children||!e.children.length),expandable:e.hasChildren&&!e.total,total:e.total,onIconClick:ne,root:0===e.levelNum,role:"rowheader"},e.caption):null)))))))),p.createElement("div",{ref:E,className:"k-pivotgrid-values",onScroll:e=>{ae(e),oe(e)}},p.createElement("table",{className:"k-pivotgrid-table",role:"none"},p.createElement("colgroup",null,M),p.createElement("tbody",{className:"k-pivotgrid-tbody",role:"none"},D.map(((e,t)=>p.createElement(ee,{key:H(b[t].path),...K,path:b[t].path,role:"none"},e.cells.map(((e,r)=>p.createElement(j,{key:ue[t][r],"data-key":ue[t][r],id:ue[t][r],...V,rowPath:e.rowTuple.members.map((e=>e.name)),columnPath:e.columnTuple.members.map((e=>e.name)),dataItem:e,total:b[t].total||L[r].total,role:"gridcell",ariaDescribedby:ce.map((e=>e[r])).join(" ")},e&&e.data&&e.data.fmtValue?e.data.fmtValue:" "))))))))))})),U={rowAxes:[],columnAxes:[],data:[],row:R,column:T,cell:F,headerCell:P};z.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}={...j,...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)})),j={configuratorPosition:"right"};B.displayName="KendoReactPivotGridContainer";const V=p.createContext({axes:null}),X=p.createContext({}),Z=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 $=(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 W={...a.PIVOT_CONFIGURATOR_ACTION,...J},Y=(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]=$([],0,0,K),[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===W.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)}}]},Q=p.forwardRef(((e,t)=>{const{data:a,dataItem:l,defaultFilter:s}={...ee,...e},i=p.useRef(null),c=p.useRef(null),u=n.useLocalization(),[d,m]=r.useCustomComponent(e.columnMenuItem||ee.columnMenuItem),[g,v]=r.useCustomComponent(e.columnMenuForm||ee.columnMenuForm),[x,E]=r.useCustomComponent(e.resetButton||ee.resetButton),[y,A]=r.useCustomComponent(e.applyButton||ee.applyButton),[C,w]=r.useCustomComponent(e.treeView||ee.treeView),[b,I]=r.useCustomComponent(e.noData||ee.noData);p.useImperativeHandle(c,(()=>({props:e,element:i.current}))),p.useImperativeHandle(t,(()=>c.current));const[N,R]=p.useState(!1),{onAxisFilterFieldsExpandChange:F,onAxisFilterFieldExpand:S}=p.useContext(X),[,P]=p.useContext(Z),[L,T]=p.useState(s),D=L?L.value.split(","):[],[O,H]=$([],0,0,K),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=>O.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=>M(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}},z=M(a,G),U=q(z);return p.createElement("div",{ref:i,id:e.id,tabIndex:e.tabIndex,style:e.style,className:r.classNames("k-columnmenu-item-wrapper",e.className)},p.createElement(d,{...m,title:"Include Fields",iconClass:"k-i-grid-layout",svgIcon:o.gridLayoutIcon,onClick:e=>{R(!N),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=>{R(!1),L&&P({type:W.removeFilter,payload:L},e)},...E},u.toLanguageString(f,k[f])),p.createElement(y,{themeColor:"primary",onClick:e=>{R(!1),L&&P({type:s?W.changeFilter:W.addFilter,payload:L},e)},...A},u.toLanguageString(h,k[h]))),...v},z&&z.length?p.createElement(C,{data:z,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(",")},T(t)},textField:"caption",expandIcons:!0,hasChildrenField:"hasChildren",checkIndeterminateField:"checkIndeterminate",childrenField:"children",...w}):p.createElement(b,{...I})))})),ee={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};Q.displayName="KendoReactPivotGridAxisFilterFieldsEditor";const te=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(V),[d,m]=p.useState(!1),[g,v]=p.useContext(Z);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||re.chip),[x,E]=r.useCustomComponent(e.dropClue||re.dropClue),[y,A]=r.useCustomComponent(e.columnMenuTextColumn||re.columnMenuTextColumn),[C,w]=r.useCustomComponent(e.filterFieldsEditor||re.filterFieldsEditor),b=G(g.filter,String(e.value),"in"),I=G(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:W.setDragItem,payload:e.dataItem}))},onRelease:()=>{m(!1),g.dragItem&&(s.current&&(s.current.style.transform=""),v({type:W.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:W.remove,payload:e.dataItem},t.syntheticEvent)},onMouseEnter:t=>{g.dragItem&&(v({type:W.setDropTarget,payload:e.dataItem},t.syntheticEvent),v({type:W.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:W.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:W.setSort,payload:t},e)},filter:I&&I.length?[{logic:"and",filters:I}]:void 0,onFilterChange:(e,t)=>{t.length?v({type:W.setFilter,payload:[...b||[],...t.reduce(((e,t)=>[...e,...t.filters.filter((e=>e.value))]),[])]},e):v({type:W.setFilter,payload:b},e)},filterContent:[c.ColumnMenuTextFilter],...A})),g.dropTarget&&a.compareAxes(g.dropTarget,e.dataItem)&&"after"===g.dropDirection&&p.createElement(x,{...E}))})),re={chip:l.Chip,columnMenuTextColumn:c.ColumnMenuTextColumn,filterFieldsEditor:Q,dropClue:e=>p.createElement("div",{className:"k-grouping-dropclue",style:{position:"relative",zIndex:1e4},...e})};te.defaultProps=re,te.displayName="KendoReactPivotGridAxisEditor";const ne=p.forwardRef(((e,t)=>{const{value:n,field:a}={...ae,...e},o=p.useRef(null),l=p.useRef(null),s=p.useRef(null),[i,c]=r.useCustomComponent(e.chipList||ae.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(V.Provider,{value:{axes:a}},p.createElement(i,{ref:r.canUseRef(i)?o:void 0,textField:"text",valueField:"name",data:u,chip:te,style:{position:"relative"},className:e.className,selection:"none",...c}))})),ae={value:[],chipList:l.ChipList};ne.defaultProps=ae,ne.displayName="KendoReactPivotGridAxesEditor";const oe=p.forwardRef(((e,t)=>{const{data:n,rowAxes:a,columnAxes:o,measureAxes:l,onExpand:s,onCheck:i}={...le,...e},c=p.useRef(null),d=p.useRef(null),[m,g]=r.useCustomComponent(e.treeView||le.treeView),[v,f]=r.useCustomComponent(e.noData||le.noData);p.useImperativeHandle(d,(()=>({props:e,element:c.current&&c.current.element}))),p.useImperativeHandle(t,(()=>d.current));const[h]=p.useContext(Z),x=O(o),E=O(a),y=O(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=>M(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=M(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}))})),le={data:[],rowAxes:[],columnAxes:[],measureAxes:[],treeView:u.TreeView,noData:()=>p.createElement("div",null,"NO DATA")};oe.displayName="KendoReactPivotGridFieldsEditor";const se=p.forwardRef(((e,t)=>{const{onFieldsEditorFieldCheck:a,onFieldsEditorFieldCheckAction:o=ie.onFieldsEditorFieldCheckAction,onFieldsEditorFieldExpand:l,onFieldsEditorFieldExpandAction:c=ie.onFieldsEditorFieldExpandAction,onAxisFilterFieldExpand:u,onAxisFilterFieldsExpandChange:d}=e,m={onFieldsEditorFieldCheck:a,onFieldsEditorFieldCheckAction:o,horizontal:ie.horizontal,axesEditor:ie.axesEditor,...e},[g,v]=r.useCustomComponent(m.fieldsLabel||ie.fieldsLabel),[f,h]=r.useCustomComponent(m.fieldsEditor||ie.fieldsEditor),[x,E]=r.useCustomComponent(m.columnAxesLabel||ie.columnAxesLabel),[y,N]=r.useCustomComponent(m.columnAxesEditor||ie.columnAxesEditor),[R,F]=r.useCustomComponent(m.rowAxesLabel||ie.rowAxesLabel),[S,P]=r.useCustomComponent(m.rowAxesEditor||ie.rowAxesEditor),[L,T]=r.useCustomComponent(m.measureAxesLabel||ie.measureAxesLabel),[D,M]=r.useCustomComponent(m.measureAxesEditor||ie.measureAxesEditor),q=p.useRef(null),O=p.useRef(null),H=n.useLocalization(),[G,K]=Y(m);p.useImperativeHandle(O,(()=>({element:q.current,props:m,state:G}))),p.useImperativeHandle(t,(()=>O.current));const z=()=>{G.dragItem&&K({type:W.setDropZone,payload:"columnAxes"})},U=()=>{G.dragItem&&K({type:W.setDropZone,payload:null})},B=()=>{G.dragItem&&K({type:W.setDropZone,payload:"rowAxes"})},j=()=>{G.dragItem&&K({type:W.setDropZone,payload:null})},V=()=>{G.dragItem&&K({type:W.setDropZone,payload:"measureAxes"})},_=()=>{G.dragItem&&K({type:W.setDropZone,payload:null})},$=m.horizontal?"div":p.Fragment,J=m.horizontal?{className:"k-form-field-wrapper"}:{};return p.createElement(X.Provider,{value:{onAxisFilterFieldExpand:e=>{const t={target:e.target,currentTarget:O.current,value:e.value,syntheticEvent:e.syntheticEvent};u&&u(t)},onAxisFilterFieldsExpandChange:e=>{const t={target:e.target,currentTarget:O.current,value:e.value,syntheticEvent:e.syntheticEvent};d&&d(t)}}},p.createElement(Z.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,k[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:O.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:O.current,value:e.value,syntheticEvent:e.syntheticEvent})},onCheck:e=>{const t={target:e.target,currentTarget:O.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,k[A]))),m.valueGetter("columnAxes").length?p.createElement(s.Field,{name:"columnAxes",field:"columnAxes",component:y,onMouseEnter:z,onMouseLeave:U,className:"k-column-fields",...N}):p.createElement("div",{className:"k-settings-description",onMouseEnter:z,onMouseLeave:U},H.toLanguageString(I,k[I])),p.createElement("div",{className:"k-form-field",onMouseEnter:B,onMouseLeave:j},p.createElement(s.Field,{name:"rowAxes",field:"rowAxes",component:R,...F},H.toLanguageString(C,k[C]))),m.valueGetter("rowAxes").length?p.createElement(s.Field,{name:"rowAxes",field:"rowAxes",component:S,onMouseEnter:B,onMouseLeave:j,className:"k-column-fields",...P}):p.createElement("div",{className:"k-settings-description",onMouseEnter:B,onMouseLeave:j},H.toLanguageString(I,k[I]))),p.createElement($,{...J},p.createElement("div",{className:"k-form-field",onMouseEnter:V,onMouseLeave:_},p.createElement(s.Field,{name:"measureAxes",field:"measureAxes",component:L,...T},H.toLanguageString(w,k[w]))),m.valueGetter("measureAxes").length?p.createElement(s.Field,{name:"measureAxes",field:"measureAxes",component:D,onMouseEnter:V,onMouseLeave:_,className:"k-column-fields",...M}):p.createElement("div",{className:"k-settings-description",onMouseEnter:V,onMouseLeave:_},H.toLanguageString(I,k[I])))))})),ie={data:[],horizontal:!1,fieldsLabel:i.Label,fieldsEditor:oe,columnAxesLabel:i.Label,columnAxesEditor:ne,rowAxesLabel:i.Label,rowAxesEditor:ne,measureAxesLabel:i.Label,measureAxesEditor:ne,axesEditor:ne,onFieldsEditorFieldCheckAction:e=>({type:W.toggleSelection,payload:e.value}),onFieldsEditorFieldExpandAction:e=>({type:W.toggleExpansion,payload:e.value})};se.displayName="KendoReactPivotGridConfiguratorEditor";const ce=p.forwardRef(((e,t)=>{const{horizontal:a,data:o,rowAxes:s,columnAxes:i,measureAxes:c}={...ue,...e},u=p.useRef(null),d=p.useRef(null),m=p.useRef(null),g=n.useLocalization(),[v,f]=r.useCustomComponent(e.editor||ue.editor),[h,A]=r.useCustomComponent(e.form||ue.form),[C,w]=r.useCustomComponent(e.formElement||ue.formElement);p.useImperativeHandle(d,(()=>({props:e,element:u.current}))),p.useImperativeHandle(t,(()=>d.current));const b={rowAxes:s,columnAxes:i,measureAxes:c,sort:e.sort,filter:e.filter};return p.useEffect((()=>{m.current&&m.current.onChange("rowAxes",{value:s})}),[s]),p.useEffect((()=>{m.current&&m.current.onChange("columnAxes",{value:i})}),[i]),p.useEffect((()=>{m.current&&m.current.onChange("measureAxes",{value:c})}),[c]),p.useEffect((()=>{m.current&&m.current.onChange("sort",{value:e.sort})}),[e.sort]),p.useEffect((()=>{m.current&&m.current.onChange("filter",{value:e.filter})}),[e.filter]),p.createElement("div",{ref:u,id:e.id,tabIndex:e.tabIndex,style:e.style,className:r.classNames("k-pivotgrid-configurator",e.className)},p.createElement("div",{className:r.classNames("k-pivotgrid-configurator-panel","k-pivotgrid-configurator-push",{"k-pivotgrid-configurator-horizontal":a,"k-pivotgrid-configurator-vertical":!a})},p.createElement("div",{className:"k-pivotgrid-configurator-header"},p.createElement("div",{className:"k-pivotgrid-configurator-header-text"},g.toLanguageString(x,k[x]))),p.createElement(h,{ref:r.canUseRef(h)?m:void 0,initialValues:b,onSubmit:(t,r)=>{e.onRowAxesChange&&e.onRowAxesChange({target:d.current,value:t.rowAxes,syntheticEvent:r}),e.onColumnAxesChange&&e.onColumnAxesChange({target:d.current,value:t.columnAxes,syntheticEvent:r}),e.onMeasureAxesChange&&e.onMeasureAxesChange({target:d.current,value:t.measureAxes,syntheticEvent:r}),e.onSortChange&&e.onSortChange({target:d.current,value:t.sort,syntheticEvent:r}),e.onFilterChange&&e.onFilterChange({target:d.current,value:t.filter,syntheticEvent:r})},render:t=>p.createElement(p.Fragment,null,p.createElement("div",{className:"k-pivotgrid-configurator-content"},p.createElement(C,{horizontal:a,...w},p.createElement(v,{...t,horizontal:e.horizontal,onFieldsEditorFieldExpand:e.onFieldsEditorFieldExpand,onFieldsEditorFieldCheck:e.onFieldsEditorFieldCheck,onAxisFilterFieldExpand:e.onAxisFilterFieldExpand,onAxisFilterFieldsExpandChange:e.onAxisFilterFieldsExpandChange,data:o,...f}))),p.createElement("div",{className:"k-pivotgrid-configurator-actions k-actions k-hstack k-justify-content-end"},p.createElement(l.Button,{type:"submit",onClick:t.onFormReset},g.toLanguageString(E,k[E])),p.createElement(l.Button,{themeColor:"primary",type:"submit",onClick:t.onSubmit},g.toLanguageString(y,k[y])))),...A})))})),ue={form:s.Form,formElement:s.FormElement,editor:se,horizontal:!1,data:[],columnAxes:[],rowAxes:[],measureAxes:[]};ce.displayName="KendoReactPivotGridConfigurator";const de=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||me.icon),u=p.useMemo((()=>r.classNames("k-pivotgrid-configurator-button",e.className)),[e.className]),d=r.useMouse(e,a);return p.createElement("div",{ref:l,id:e.id,className:u,tabIndex:e.tabIndex,...d},p.createElement("span",null,s.toLanguageString(N,k[N]),p.createElement(i,{name:"gear",icon:o.gearIcon,...c})))})),me={icon:r.IconWrap};de.displayName="KendoReactPivotGridConfiguratorButton";const pe=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=ge(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}}},ge=e=>{for(let t=0,r=e.length;t<r;t++)e[t].uniqueName=e[t].name,e[t].type="kpi";return e},ve={dataField:"aggregate",columnsData:"columns"},fe="&",he=e=>{const[t,r]=p.useState(!0),[n,o]=p.useState(e.defaultColumnAxes||[]),[l,s]=p.useState(e.defaultRowAxes||[]),[i,c]=p.useState(e.defaultMeasureAxes||[]),[u,d]=p.useState(e.defaultSort||[]),[m,g]=p.useState(e.defaultFilter||[]),[v,f]=p.useState(new Map),h=p.useCallback((e=>{s(e.value)}),[]),x=p.useCallback((e=>{o(e.value)}),[]),E=p.useMemo((()=>Array.from(a.rootFields(n).keys()).join(fe)),[n]),y=p.useMemo((()=>Array.from(a.rootFields(l).keys()).join(fe)),[l]),A=p.useCallback((t=>({key:t,...e.dimensions[t]})),[e.dimensions]),C=p.useMemo((()=>E?E.split(fe).map(A):[]),[E,A]),w=p.useMemo((()=>y?y.split(fe).map(A):[]),[y,A]),b=p.useMemo((()=>i.map((t=>e.measures.find((e=>String(e.name)===String(t.name))))).filter(Boolean)),[i,e.measures]);p.useEffect((()=>{r(!0),setTimeout((()=>{const t=a.createDataTree(e.data,w,C,b,ve,m);f(t),r(!1)}),0)}),[e.data,w,C,b,m]);const I=p.useMemo((()=>a.createFlatSchemaDimensions(e.dimensions,e.measures)),[e.dimensions,e.measures]),N=p.useMemo((()=>a.createLocalDataState({dataTree:v,rowSettings:w,columnSettings:C,rowAxes:l,columnAxes:n,measures:b,sort:u,fields:ve})),[n,C,v,l,w,u]);return{pivotProps:{rowAxes:l,columnAxes:n,data:N.data,rows:N.rows,columns:N.columns,onRowAxesChange:h,onColumnAxesChange:x},configuratorProps:{sort:u,onSortChange:e=>{d(e.value)},filter:m,onFilterChange:e=>{g(e.value)},data:I,rowAxes:l,columnAxes:n,measureAxes:i,onRowAxesChange:h,onColumnAxesChange:x,onMeasureAxesChange:e=>{c(e.value)}},state:{loading:t}}};Object.defineProperty(e,"averageAggregate",{enumerable:!0,get:function(){return a.averageAggregate}}),Object.defineProperty(e,"maxAggregate",{enumerable:!0,get:function(){return a.maxAggregate}}),Object.defineProperty(e,"minAggregate",{enumerable:!0,get:function(){return a.minAggregate}}),Object.defineProperty(e,"sumAggregate",{enumerable:!0,get:function(){return a.sumAggregate}}),e.PivotGrid=z,e.PivotGridAxesEditor=ne,e.PivotGridAxisEditor=te,e.PivotGridAxisFilterFieldsEditor=Q,e.PivotGridCell=F,e.PivotGridColumn=T,e.PivotGridConfigurator=ce,e.PivotGridConfiguratorButton=de,e.PivotGridConfiguratorEditor=se,e.PivotGridContainer=B,e.PivotGridFieldsEditor=oe,e.PivotGridHeaderCell=P,e.PivotGridRow=R,e.PivotLocalDataService=e=>{const t=he(e);return e.children(t)},e.PivotOLAPService=e=>{const t=pe(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=he,e.usePivotOLAPService=pe}));
|
|
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={name:"@progress/kendo-react-pivotgrid",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"$VERSION",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},v="pivotgrid.emptyCellAriaLabel",f="pivotgrid.fieldMenuReset",h="pivotgrid.fieldMenuApply",x="pivotgrid.configuratorTitle",E="pivotgrid.configuratorCancel",y="pivotgrid.configuratorApply",A="pivotgrid.configuratorColumnsTitle",C="pivotgrid.configuratorRowsTitle",w="pivotgrid.configuratorMeasuresTitle",b="pivotgrid.configuratorEditorSearchTitle",I="pivotgrid.configuratorMissingFields",N="pivotgrid.configuratorButtonLabel",k={[v]:"PivotGrid component. Use the arrow keys to navigate.",[f]:"Reset",[h]:"Apply",[E]:"Cancel",[y]:"Apply",[x]:"Settings",[b]:"Fields","pivotgrid.configuratorEditorSearchPlaceholder":"Search...",[A]:"Columns",[C]:"Rows",[w]:"Values",[N]:"Change settings",[I]:"Select some fields to begin setup"},R=p.forwardRef(((e,t)=>{const n=p.useRef(null),a=p.useRef(null);p.useImperativeHandle(n,(()=>({element:a.current,props:e}))),p.useImperativeHandle(t,(()=>n.current));const o=r.useMouse(e,n);return p.createElement("tr",{ref:a,...o,id:e.id,style:e.style,tabIndex:e.tabIndex,children:e.children,role:e.role,"aria-owns":e.ariaOwns,className:r.classNames("k-pivotgrid-row",e.className)})}));R.displayName="KendoReactPivotGridRow";const 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("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)}));F.displayName="KendoReactPivotGridCell";const S=(e,t,r)=>[e,(n,o)=>{const l=a.headersReducer(e,{...n,tree:t});r&&r(l,o)}],P=p.forwardRef(((e,t)=>{const n=p.useRef(null),a=p.useRef(null);p.useImperativeHandle(n,(()=>({element:a.current,props:e}))),p.useImperativeHandle(t,(()=>n.current));const[l,s]=r.useCustomComponent(e.icon||L.icon),i=r.useMouse(e,n);return p.createElement("th",{ref:a,...i,colSpan:e.colSpan,rowSpan:e.rowSpan,id:e.id,style:e.style,tabIndex:e.tabIndex,role:e.role,...e.expandable?{"aria-expanded":e.expanded}:{},className:r.classNames("k-pivotgrid-cell",{"k-pivotgrid-header-total":e.total,"k-pivotgrid-header-root":e.root,"k-pivotgrid-expanded":e.expanded,"k-first":e.first},e.className)},e.expandable&&p.createElement(l,{...s,onClick:t=>{e.onIconClick&&e.onIconClick.call(void 0,{syntheticEvent:t.syntheticEvent,target:n.current})},name:"chevron-"+(e.expanded?"up":"down"),"aria-hidden":!0,icon:e.expanded?o.chevronUpIcon:o.chevronDownIcon}),e.children)})),L={icon:r.IconWrap};P.displayName="KendoReactPivotGridHeaderCell";const T=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=D.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})})),D={path:[]};T.displayName="KendoReactPivotGridColumn";const M=(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},O=(e=[])=>{const t=new Set;return e.forEach((e=>{t.add(String(e.name))})),Array.from(t)},H=(e=[])=>`${e.join(",")}`,G=(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},K=(e,t)=>e.uniqueName===t.uniqueName,z=p.forwardRef(((e,t)=>{const o=!r.validatePackage(g,{component:"PivotGrid"}),{rows:l,rowAxes:s,columns:i,columnAxes:c,data:u}={...U,...e},d=p.useRef(null),m=p.useRef(null),f=p.useRef(null),h=p.useRef(null),x=p.useRef(null),E=p.useRef(null),y=p.useRef(null),A=n.useLocalization(),C=a.toTree((l||[]).slice()),[,w]=S((s||[]).slice(),C,((t,r)=>{e.onRowAxesChange&&e.onRowAxesChange({value:t,target:m.current,syntheticEvent:r})})),[b,I,N,R]=a.toRows(C),F=a.toTree((i||[]).slice()),[,P]=S((c||[]).slice(),F,((t,r)=>{e.onColumnAxesChange&&e.onColumnAxesChange({value:t,target:m.current,syntheticEvent:r})})),[L,T,,D]=a.toColumns(F),M=a.toData((u||[]).slice(),T,I,D,N);p.useImperativeHandle(m,(()=>({props:e,element:d.current,columnHeaderRows:L,rowHeaderRows:b,dataCells:M,rowHeaderBreadth:R,columnHeaderBreadth:D}))),p.useImperativeHandle(t,(()=>m.current));const q=[],O=[],G=[],[K,z]=r.useCustomComponent(e.row||U.row),[B,j]=r.useCustomComponent(e.column||U.column),[V,X]=r.useCustomComponent(e.cell||U.cell),[Z,_]=r.useCustomComponent(e.headerCell||U.headerCell),$=e.columnHeadersRow||K,J=e.columnHeadersColumn||B,W=e.columnHeadersCell||Z,Y=e.rowHeadersRow||K,Q=e.rowHeadersColumn||B,ee=e.rowHeadersCell||Z,te=e.dataRow||K,re=e.dataColumn||B;for(let e=0;e<T.length;e++)q.push(p.createElement(re,{key:String(T[e].path),...j,path:T[e].path})),G.push(p.createElement(J,{key:String(T[e].path),...j,path:T[e].path}));for(let e=0;e<R;e++)O.push(p.createElement(Q,{key:e,...j}));const ne=e=>{e.target.props.expandable&&P({type:a.HEADERS_ACTION.toggle,payload:e.target.props.dataItem.path},e.syntheticEvent)},ae=e=>{e.target.props.expandable&&w({type:a.HEADERS_ACTION.toggle,payload:e.target.props.dataItem.path},e.syntheticEvent)},oe=((...e)=>{const t=p.useRef();return r=>{void 0!==t.current&&window.cancelAnimationFrame(t.current);const n=r.currentTarget,a=n.scrollLeft;e.forEach((e=>{const r=e.current;r&&r!==n&&(t.current=window.requestAnimationFrame((()=>{r.scrollLeft=Math.round(a)})))}))}})(y,E),le=((...e)=>{const t=p.useRef();return r=>{void 0!==t.current&&window.cancelAnimationFrame(t.current);const n=r.currentTarget,a=n.scrollTop;e.forEach((e=>{const r=e.current;r&&r!==n&&(t.current=window.requestAnimationFrame((()=>{r.scrollTop=Math.round(a)})))}))}})(y,x),se=p.useCallback((()=>{d.current&&h.current&&(d.current.style.gridTemplateRows="",d.current.style.gridTemplateRows=`${h.current.offsetHeight}px 1fr`)}),[]),ie=p.useCallback((()=>{d.current&&f.current&&(d.current.style.gridTemplateColumns="",d.current.style.gridTemplateColumns=`${f.current.offsetWidth}px 1fr`)}),[]),ce=p.useRef(new a.PivotGridNavigation({tabIndex:e.tabIndex||0}));p.useEffect((()=>{if(d.current){const t=e.tabIndex||0;if(ce.current.stop(),ce.current.tabIndex=t,e.navigatable){ce.current.start(d.current);const e=ce.current.first;e&&e.setAttribute("tabindex",String(t))}}return()=>{ce.current.stop()}}),[e.tabIndex,e.navigatable]),p.useEffect((()=>{ce.current.update()})),p.useEffect((()=>{if(h.current){const e=new window.ResizeObserver((()=>{window.requestAnimationFrame((()=>{se()}))}));return e.observe(h.current),()=>{e.disconnect()}}}),[se]),p.useEffect((()=>{if(f.current){const e=new window.ResizeObserver((()=>{window.requestAnimationFrame((()=>{ie()}))}));return e.observe(f.current),()=>{e.disconnect()}}}),[ie]),r.useIsomorphicLayoutEffect((()=>{if(r.setScrollbarWidth(),f.current){const e=new window.ResizeObserver((()=>window.requestAnimationFrame((()=>{r.setScrollbarWidth()}))));return e.observe(f.current),()=>{e.disconnect()}}}),[]);const ue=new Array(L.length).fill([]).map((()=>new Array(T.length)));L.forEach(((e,t)=>{let r=0;Array.from(e.cells).forEach((e=>{const n=!!(e&&e.children&&e.children.length),a=(e?H(e.normalizedPath)+(e.total?"|[TOTAL]":"")+(n?"|[EXPANDED]":""):"").replace(/\s/g,"-");if(e)for(let n=0;n<(e.colSpan||1);n++){for(let n=0;n<(e.rowSpan||1);n++){const e=ue[t+n].findIndex(((e,t)=>t>=r&&!e));ue[t+n][e]=a}r++}}))}));const de=M.map((e=>e.cells.map((e=>((e,t)=>`${H(e.map((e=>e.name)))}|${H(t.map((e=>e.name)))}`)(e.rowTuple.members,e.columnTuple.members).replace(/\s/g,"-")))));return p.createElement("div",{ref:d,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,null),p.createElement("span",{className:"k-pivotgrid-empty-cell"},p.createElement("span",{className:"k-sr-only"},A.toLanguageString(v,k[v]))),p.createElement("div",{ref:E,className:"k-pivotgrid-column-headers",onScroll:oe},p.createElement("table",{ref:h,className:"k-pivotgrid-table",role:"none"},p.createElement("colgroup",null,G),p.createElement("tbody",{className:"k-pivotgrid-tbody",role:"rowgroup"},L.map(((e,t)=>{let r=!1;return p.createElement($,{key:e.name,role:"row",...z},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(W,{..._,key:ue[t][n],"data-key":ue[t][n],id:ue[t][n],columnPath:e.normalizedPath,rowSpan:e.rowSpan||void 0,colSpan:e.colSpan||void 0,onIconClick:ne,dataItem:e,expanded:o,expandable:l,total:e.total,first:a,root:0===e.levelNum,role:"columnheader"},e.caption):null})))}))))),p.createElement("div",{ref:x,className:"k-pivotgrid-row-headers"},p.createElement("table",{ref:f,className:"k-pivotgrid-table",role:"none"},p.createElement("colgroup",null,O),p.createElement("tbody",{className:"k-pivotgrid-tbody",role:"rowgroup"},b.map(((e,t)=>p.createElement(Y,{key:H(I[t].path),...z,path:I[t].path,role:"row",ariaOwns:de[t].join(" ")},e.cells.filter(Boolean).map((e=>e?p.createElement(ee,{..._,key:H(e.normalizedPath)+(e.total?"|[TOTAL]":"")+(e.children&&e.children.length?"|[EXPANDED]":""),"data-key":H(e.normalizedPath)+(e.total?"|[TOTAL]":"")+(e.children&&e.children.length?"|[EXPANDED]":""),rowPath:e.normalizedPath,rowSpan:e.rowSpan||void 0,colSpan:e.colSpan||void 0,dataItem:e,expanded:!(!e.children||!e.children.length),expandable:e.hasChildren&&!e.total,total:e.total,onIconClick:ae,root:0===e.levelNum,role:"rowheader"},e.caption):null)))))))),p.createElement("div",{ref:y,className:"k-pivotgrid-values",onScroll:e=>{oe(e),le(e)}},p.createElement("table",{className:"k-pivotgrid-table",role:"none"},p.createElement("colgroup",null,q),p.createElement("tbody",{className:"k-pivotgrid-tbody",role:"none"},M.map(((e,t)=>p.createElement(te,{key:H(I[t].path),...z,path:I[t].path,role:"none"},e.cells.map(((e,r)=>p.createElement(V,{key:de[t][r],"data-key":de[t][r],id:de[t][r],...X,rowPath:e.rowTuple.members.map((e=>e.name)),columnPath:e.columnTuple.members.map((e=>e.name)),dataItem:e,total:I[t].total||T[r].total,role:"gridcell",ariaDescribedby:ue.map((e=>e[r])).join(" ")},e&&e.data&&e.data.fmtValue?e.data.fmtValue:" "))))))))))})),U={rowAxes:[],columnAxes:[],data:[],row:R,column:T,cell:F,headerCell:P};z.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}={...j,...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)})),j={configuratorPosition:"right"};B.displayName="KendoReactPivotGridContainer";const V=p.createContext({axes:null}),X=p.createContext({}),Z=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 $=(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 W={...a.PIVOT_CONFIGURATOR_ACTION,...J},Y=(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]=$([],0,0,K),[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===W.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)}}]},Q=p.forwardRef(((e,t)=>{const{data:a,dataItem:l,defaultFilter:s}={...ee,...e},i=p.useRef(null),c=p.useRef(null),u=n.useLocalization(),[d,m]=r.useCustomComponent(e.columnMenuItem||ee.columnMenuItem),[g,v]=r.useCustomComponent(e.columnMenuForm||ee.columnMenuForm),[x,E]=r.useCustomComponent(e.resetButton||ee.resetButton),[y,A]=r.useCustomComponent(e.applyButton||ee.applyButton),[C,w]=r.useCustomComponent(e.treeView||ee.treeView),[b,I]=r.useCustomComponent(e.noData||ee.noData);p.useImperativeHandle(c,(()=>({props:e,element:i.current}))),p.useImperativeHandle(t,(()=>c.current));const[N,R]=p.useState(!1),{onAxisFilterFieldsExpandChange:F,onAxisFilterFieldExpand:S}=p.useContext(X),[,P]=p.useContext(Z),[L,T]=p.useState(s),D=L?L.value.split(","):[],[O,H]=$([],0,0,K),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=>O.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=>M(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}},z=M(a,G),U=q(z);return p.createElement("div",{ref:i,id:e.id,tabIndex:e.tabIndex,style:e.style,className:r.classNames("k-columnmenu-item-wrapper",e.className)},p.createElement(d,{...m,title:"Include Fields",iconClass:"k-i-grid-layout",svgIcon:o.gridLayoutIcon,onClick:e=>{R(!N),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=>{R(!1),L&&P({type:W.removeFilter,payload:L},e)},...E},u.toLanguageString(f,k[f])),p.createElement(y,{themeColor:"primary",onClick:e=>{R(!1),L&&P({type:s?W.changeFilter:W.addFilter,payload:L},e)},...A},u.toLanguageString(h,k[h]))),...v},z&&z.length?p.createElement(C,{data:z,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(",")},T(t)},textField:"caption",expandIcons:!0,hasChildrenField:"hasChildren",checkIndeterminateField:"checkIndeterminate",childrenField:"children",...w}):p.createElement(b,{...I})))})),ee={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};Q.displayName="KendoReactPivotGridAxisFilterFieldsEditor";const te=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(V),[d,m]=p.useState(!1),[g,v]=p.useContext(Z);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||re.chip),[x,E]=r.useCustomComponent(e.dropClue||re.dropClue),[y,A]=r.useCustomComponent(e.columnMenuTextColumn||re.columnMenuTextColumn),[C,w]=r.useCustomComponent(e.filterFieldsEditor||re.filterFieldsEditor),b=G(g.filter,String(e.value),"in"),I=G(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:W.setDragItem,payload:e.dataItem}))},onRelease:()=>{m(!1),g.dragItem&&(s.current&&(s.current.style.transform=""),v({type:W.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:W.remove,payload:e.dataItem},t.syntheticEvent)},onMouseEnter:t=>{g.dragItem&&(v({type:W.setDropTarget,payload:e.dataItem},t.syntheticEvent),v({type:W.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:W.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:W.setSort,payload:t},e)},filter:I&&I.length?[{logic:"and",filters:I}]:void 0,onFilterChange:(e,t)=>{t.length?v({type:W.setFilter,payload:[...b||[],...t.reduce(((e,t)=>[...e,...t.filters.filter((e=>e.value))]),[])]},e):v({type:W.setFilter,payload:b},e)},filterContent:[c.ColumnMenuTextFilter],...A})),g.dropTarget&&a.compareAxes(g.dropTarget,e.dataItem)&&"after"===g.dropDirection&&p.createElement(x,{...E}))})),re={chip:l.Chip,columnMenuTextColumn:c.ColumnMenuTextColumn,filterFieldsEditor:Q,dropClue:e=>p.createElement("div",{className:"k-grouping-dropclue",style:{position:"relative",zIndex:1e4},...e})};te.defaultProps=re,te.displayName="KendoReactPivotGridAxisEditor";const ne=p.forwardRef(((e,t)=>{const{value:n,field:a}={...ae,...e},o=p.useRef(null),l=p.useRef(null),s=p.useRef(null),[i,c]=r.useCustomComponent(e.chipList||ae.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(V.Provider,{value:{axes:a}},p.createElement(i,{ref:r.canUseRef(i)?o:void 0,textField:"text",valueField:"name",data:u,chip:te,style:{position:"relative"},className:e.className,selection:"none",...c}))})),ae={value:[],chipList:l.ChipList};ne.defaultProps=ae,ne.displayName="KendoReactPivotGridAxesEditor";const oe=p.forwardRef(((e,t)=>{const{data:n,rowAxes:a,columnAxes:o,measureAxes:l,onExpand:s,onCheck:i}={...le,...e},c=p.useRef(null),d=p.useRef(null),[m,g]=r.useCustomComponent(e.treeView||le.treeView),[v,f]=r.useCustomComponent(e.noData||le.noData);p.useImperativeHandle(d,(()=>({props:e,element:c.current&&c.current.element}))),p.useImperativeHandle(t,(()=>d.current));const[h]=p.useContext(Z),x=O(o),E=O(a),y=O(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=>M(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=M(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}))})),le={data:[],rowAxes:[],columnAxes:[],measureAxes:[],treeView:u.TreeView,noData:()=>p.createElement("div",null,"NO DATA")};oe.displayName="KendoReactPivotGridFieldsEditor";const se=p.forwardRef(((e,t)=>{const{onFieldsEditorFieldCheck:a,onFieldsEditorFieldCheckAction:o=ie.onFieldsEditorFieldCheckAction,onFieldsEditorFieldExpand:l,onFieldsEditorFieldExpandAction:c=ie.onFieldsEditorFieldExpandAction,onAxisFilterFieldExpand:u,onAxisFilterFieldsExpandChange:d}=e,m={onFieldsEditorFieldCheck:a,onFieldsEditorFieldCheckAction:o,horizontal:ie.horizontal,axesEditor:ie.axesEditor,...e},[g,v]=r.useCustomComponent(m.fieldsLabel||ie.fieldsLabel),[f,h]=r.useCustomComponent(m.fieldsEditor||ie.fieldsEditor),[x,E]=r.useCustomComponent(m.columnAxesLabel||ie.columnAxesLabel),[y,N]=r.useCustomComponent(m.columnAxesEditor||ie.columnAxesEditor),[R,F]=r.useCustomComponent(m.rowAxesLabel||ie.rowAxesLabel),[S,P]=r.useCustomComponent(m.rowAxesEditor||ie.rowAxesEditor),[L,T]=r.useCustomComponent(m.measureAxesLabel||ie.measureAxesLabel),[D,M]=r.useCustomComponent(m.measureAxesEditor||ie.measureAxesEditor),q=p.useRef(null),O=p.useRef(null),H=n.useLocalization(),[G,K]=Y(m);p.useImperativeHandle(O,(()=>({element:q.current,props:m,state:G}))),p.useImperativeHandle(t,(()=>O.current));const z=()=>{G.dragItem&&K({type:W.setDropZone,payload:"columnAxes"})},U=()=>{G.dragItem&&K({type:W.setDropZone,payload:null})},B=()=>{G.dragItem&&K({type:W.setDropZone,payload:"rowAxes"})},j=()=>{G.dragItem&&K({type:W.setDropZone,payload:null})},V=()=>{G.dragItem&&K({type:W.setDropZone,payload:"measureAxes"})},_=()=>{G.dragItem&&K({type:W.setDropZone,payload:null})},$=m.horizontal?"div":p.Fragment,J=m.horizontal?{className:"k-form-field-wrapper"}:{};return p.createElement(X.Provider,{value:{onAxisFilterFieldExpand:e=>{const t={target:e.target,currentTarget:O.current,value:e.value,syntheticEvent:e.syntheticEvent};u&&u(t)},onAxisFilterFieldsExpandChange:e=>{const t={target:e.target,currentTarget:O.current,value:e.value,syntheticEvent:e.syntheticEvent};d&&d(t)}}},p.createElement(Z.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,k[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:O.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:O.current,value:e.value,syntheticEvent:e.syntheticEvent})},onCheck:e=>{const t={target:e.target,currentTarget:O.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,k[A]))),m.valueGetter("columnAxes").length?p.createElement(s.Field,{name:"columnAxes",field:"columnAxes",component:y,onMouseEnter:z,onMouseLeave:U,className:"k-column-fields",...N}):p.createElement("div",{className:"k-settings-description",onMouseEnter:z,onMouseLeave:U},H.toLanguageString(I,k[I])),p.createElement("div",{className:"k-form-field",onMouseEnter:B,onMouseLeave:j},p.createElement(s.Field,{name:"rowAxes",field:"rowAxes",component:R,...F},H.toLanguageString(C,k[C]))),m.valueGetter("rowAxes").length?p.createElement(s.Field,{name:"rowAxes",field:"rowAxes",component:S,onMouseEnter:B,onMouseLeave:j,className:"k-column-fields",...P}):p.createElement("div",{className:"k-settings-description",onMouseEnter:B,onMouseLeave:j},H.toLanguageString(I,k[I]))),p.createElement($,{...J},p.createElement("div",{className:"k-form-field",onMouseEnter:V,onMouseLeave:_},p.createElement(s.Field,{name:"measureAxes",field:"measureAxes",component:L,...T},H.toLanguageString(w,k[w]))),m.valueGetter("measureAxes").length?p.createElement(s.Field,{name:"measureAxes",field:"measureAxes",component:D,onMouseEnter:V,onMouseLeave:_,className:"k-column-fields",...M}):p.createElement("div",{className:"k-settings-description",onMouseEnter:V,onMouseLeave:_},H.toLanguageString(I,k[I])))))})),ie={data:[],horizontal:!1,fieldsLabel:i.Label,fieldsEditor:oe,columnAxesLabel:i.Label,columnAxesEditor:ne,rowAxesLabel:i.Label,rowAxesEditor:ne,measureAxesLabel:i.Label,measureAxesEditor:ne,axesEditor:ne,onFieldsEditorFieldCheckAction:e=>({type:W.toggleSelection,payload:e.value}),onFieldsEditorFieldExpandAction:e=>({type:W.toggleExpansion,payload:e.value})};se.displayName="KendoReactPivotGridConfiguratorEditor";const ce=p.forwardRef(((e,t)=>{const{horizontal:a,data:o,rowAxes:s,columnAxes:i,measureAxes:c}={...ue,...e},u=p.useRef(null),d=p.useRef(null),m=p.useRef(null),g=n.useLocalization(),[v,f]=r.useCustomComponent(e.editor||ue.editor),[h,A]=r.useCustomComponent(e.form||ue.form),[C,w]=r.useCustomComponent(e.formElement||ue.formElement);p.useImperativeHandle(d,(()=>({props:e,element:u.current}))),p.useImperativeHandle(t,(()=>d.current));const b={rowAxes:s,columnAxes:i,measureAxes:c,sort:e.sort,filter:e.filter};return p.useEffect((()=>{m.current&&m.current.onChange("rowAxes",{value:s})}),[s]),p.useEffect((()=>{m.current&&m.current.onChange("columnAxes",{value:i})}),[i]),p.useEffect((()=>{m.current&&m.current.onChange("measureAxes",{value:c})}),[c]),p.useEffect((()=>{m.current&&m.current.onChange("sort",{value:e.sort})}),[e.sort]),p.useEffect((()=>{m.current&&m.current.onChange("filter",{value:e.filter})}),[e.filter]),p.createElement("div",{ref:u,id:e.id,tabIndex:e.tabIndex,style:e.style,className:r.classNames("k-pivotgrid-configurator",e.className)},p.createElement("div",{className:r.classNames("k-pivotgrid-configurator-panel","k-pivotgrid-configurator-push",{"k-pivotgrid-configurator-horizontal":a,"k-pivotgrid-configurator-vertical":!a})},p.createElement("div",{className:"k-pivotgrid-configurator-header"},p.createElement("div",{className:"k-pivotgrid-configurator-header-text"},g.toLanguageString(x,k[x]))),p.createElement(h,{ref:r.canUseRef(h)?m:void 0,initialValues:b,onSubmit:(t,r)=>{e.onRowAxesChange&&e.onRowAxesChange({target:d.current,value:t.rowAxes,syntheticEvent:r}),e.onColumnAxesChange&&e.onColumnAxesChange({target:d.current,value:t.columnAxes,syntheticEvent:r}),e.onMeasureAxesChange&&e.onMeasureAxesChange({target:d.current,value:t.measureAxes,syntheticEvent:r}),e.onSortChange&&e.onSortChange({target:d.current,value:t.sort,syntheticEvent:r}),e.onFilterChange&&e.onFilterChange({target:d.current,value:t.filter,syntheticEvent:r})},render:t=>p.createElement(p.Fragment,null,p.createElement("div",{className:"k-pivotgrid-configurator-content"},p.createElement(C,{horizontal:a,...w},p.createElement(v,{...t,horizontal:e.horizontal,onFieldsEditorFieldExpand:e.onFieldsEditorFieldExpand,onFieldsEditorFieldCheck:e.onFieldsEditorFieldCheck,onAxisFilterFieldExpand:e.onAxisFilterFieldExpand,onAxisFilterFieldsExpandChange:e.onAxisFilterFieldsExpandChange,data:o,...f}))),p.createElement("div",{className:"k-pivotgrid-configurator-actions k-actions k-hstack k-justify-content-end"},p.createElement(l.Button,{type:"submit",onClick:t.onFormReset},g.toLanguageString(E,k[E])),p.createElement(l.Button,{themeColor:"primary",type:"submit",onClick:t.onSubmit},g.toLanguageString(y,k[y])))),...A})))})),ue={form:s.Form,formElement:s.FormElement,editor:se,horizontal:!1,data:[],columnAxes:[],rowAxes:[],measureAxes:[]};ce.displayName="KendoReactPivotGridConfigurator";const de=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||me.icon),u=p.useMemo((()=>r.classNames("k-pivotgrid-configurator-button",e.className)),[e.className]),d=r.useMouse(e,a);return p.createElement("div",{ref:l,id:e.id,className:u,tabIndex:e.tabIndex,...d},p.createElement("span",null,s.toLanguageString(N,k[N]),p.createElement(i,{name:"gear",icon:o.gearIcon,...c})))})),me={icon:r.IconWrap};de.displayName="KendoReactPivotGridConfiguratorButton";const pe=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=ge(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}}},ge=e=>{for(let t=0,r=e.length;t<r;t++)e[t].uniqueName=e[t].name,e[t].type="kpi";return e},ve={dataField:"aggregate",columnsData:"columns"},fe="&",he=e=>{const[t,r]=p.useState(!0),[n,o]=p.useState(e.defaultColumnAxes||[]),[l,s]=p.useState(e.defaultRowAxes||[]),[i,c]=p.useState(e.defaultMeasureAxes||[]),[u,d]=p.useState(e.defaultSort||[]),[m,g]=p.useState(e.defaultFilter||[]),[v,f]=p.useState(new Map),h=p.useCallback((e=>{s(e.value)}),[]),x=p.useCallback((e=>{o(e.value)}),[]),E=p.useMemo((()=>Array.from(a.rootFields(n).keys()).join(fe)),[n]),y=p.useMemo((()=>Array.from(a.rootFields(l).keys()).join(fe)),[l]),A=p.useCallback((t=>({key:t,...e.dimensions[t]})),[e.dimensions]),C=p.useMemo((()=>E?E.split(fe).map(A):[]),[E,A]),w=p.useMemo((()=>y?y.split(fe).map(A):[]),[y,A]),b=p.useMemo((()=>i.map((t=>e.measures.find((e=>String(e.name)===String(t.name))))).filter(Boolean)),[i,e.measures]);p.useEffect((()=>{r(!0),setTimeout((()=>{const t=a.createDataTree(e.data,w,C,b,ve,m);f(t),r(!1)}),0)}),[e.data,w,C,b,m]);const I=p.useMemo((()=>a.createFlatSchemaDimensions(e.dimensions,e.measures)),[e.dimensions,e.measures]),N=p.useMemo((()=>a.createLocalDataState({dataTree:v,rowSettings:w,columnSettings:C,rowAxes:l,columnAxes:n,measures:b,sort:u,fields:ve})),[n,C,v,l,w,u]);return{pivotProps:{rowAxes:l,columnAxes:n,data:N.data,rows:N.rows,columns:N.columns,onRowAxesChange:h,onColumnAxesChange:x},configuratorProps:{sort:u,onSortChange:e=>{d(e.value)},filter:m,onFilterChange:e=>{g(e.value)},data:I,rowAxes:l,columnAxes:n,measureAxes:i,onRowAxesChange:h,onColumnAxesChange:x,onMeasureAxesChange:e=>{c(e.value)}},state:{loading:t}}};Object.defineProperty(e,"averageAggregate",{enumerable:!0,get:function(){return a.averageAggregate}}),Object.defineProperty(e,"maxAggregate",{enumerable:!0,get:function(){return a.maxAggregate}}),Object.defineProperty(e,"minAggregate",{enumerable:!0,get:function(){return a.minAggregate}}),Object.defineProperty(e,"sumAggregate",{enumerable:!0,get:function(){return a.sumAggregate}}),e.PivotGrid=z,e.PivotGridAxesEditor=ne,e.PivotGridAxisEditor=te,e.PivotGridAxisFilterFieldsEditor=Q,e.PivotGridCell=F,e.PivotGridColumn=T,e.PivotGridConfigurator=ce,e.PivotGridConfiguratorButton=de,e.PivotGridConfiguratorEditor=se,e.PivotGridContainer=B,e.PivotGridFieldsEditor=oe,e.PivotGridHeaderCell=P,e.PivotGridRow=R,e.PivotLocalDataService=e=>{const t=he(e);return e.children(t)},e.PivotOLAPService=e=>{const t=pe(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=he,e.usePivotOLAPService=pe}));
|
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={name:"@progress/kendo-react-pivotgrid",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-pivotgrid",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1741180833,version:"10.0.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -10,8 +10,8 @@ const e = {
|
|
|
10
10
|
productName: "KendoReact",
|
|
11
11
|
productCode: "KENDOUIREACT",
|
|
12
12
|
productCodes: ["KENDOUIREACT"],
|
|
13
|
-
publishDate:
|
|
14
|
-
version: "
|
|
13
|
+
publishDate: 1741180833,
|
|
14
|
+
version: "10.0.0-develop.1",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
16
16
|
};
|
|
17
17
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-pivotgrid",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.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,14 +28,14 @@
|
|
|
28
28
|
"@progress/kendo-data-query": "^1.5.5",
|
|
29
29
|
"@progress/kendo-licensing": "^1.5.0",
|
|
30
30
|
"@progress/kendo-pivotgrid-common": "0.6.2",
|
|
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": "
|
|
31
|
+
"@progress/kendo-react-buttons": "10.0.0-develop.1",
|
|
32
|
+
"@progress/kendo-react-common": "10.0.0-develop.1",
|
|
33
|
+
"@progress/kendo-react-data-tools": "10.0.0-develop.1",
|
|
34
|
+
"@progress/kendo-react-form": "10.0.0-develop.1",
|
|
35
|
+
"@progress/kendo-react-indicators": "10.0.0-develop.1",
|
|
36
|
+
"@progress/kendo-react-intl": "10.0.0-develop.1",
|
|
37
|
+
"@progress/kendo-react-labels": "10.0.0-develop.1",
|
|
38
|
+
"@progress/kendo-react-treeview": "10.0.0-develop.1",
|
|
39
39
|
"@progress/kendo-svg-icons": "^4.0.0",
|
|
40
40
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
41
41
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"package": {
|
|
62
62
|
"productName": "KendoReact",
|
|
63
63
|
"productCode": "KENDOUIREACT",
|
|
64
|
-
"publishDate":
|
|
64
|
+
"publishDate": 1741180833,
|
|
65
65
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
66
66
|
}
|
|
67
67
|
},
|