@progress/kendo-react-pivotgrid 8.4.0-develop.3 → 8.4.0-develop.4
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 +80 -58
- package/dist/cdn/js/kendo-react-pivotgrid.js +1 -1
- package/package-metadata.mjs +1 -1
- package/package.json +9 -9
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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Re=require("react"),c=require("@progress/kendo-react-common"),He=require("./package-metadata.js"),Se=require("@progress/kendo-react-intl"),O=require("./messages/index.js"),ke=require("./components/Row.js"),Pe=require("./components/Cell.js"),J=require("./hooks/useHeaders.js"),xe=require("./components/HeaderCell.js"),Ae=require("./hooks/useHorizontalScrollSync.js"),Te=require("./hooks/useVerticalScrollSync.js"),Ne=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(Re),Q=t.forwardRef((n,w)=>{c.validatePackage(He.packageMetadata);const{rows:m,rowAxes:v,columns:U,columnAxes:Y,data:Z}={...y,...n},s=t.useRef(null),E=t.useRef(null),d=t.useRef(null),b=t.useRef(null),q=t.useRef(null),z=t.useRef(null),k=t.useRef(null),ee=Se.useLocalization(),te=(e,r)=>{n.onRowAxesChange&&n.onRowAxesChange({value:e,target:E.current,syntheticEvent:r})},ne=(e,r)=>{n.onColumnAxesChange&&n.onColumnAxesChange({value:e,target:E.current,syntheticEvent:r})},I=u.toTree((m||[]).slice()),[,ae]=J.useHeaders((v||[]).slice(),I,te),[L,C,oe,B]=u.toRows(I),G=u.toTree((U||[]).slice()),[,re]=J.useHeaders((Y||[]).slice(),G,ne),[R,i,,j]=u.toColumns(G),P=u.toData((Z||[]).slice(),i,C,j,oe);t.useImperativeHandle(E,()=>({props:n,element:s.current,columnHeaderRows:R,rowHeaderRows:L,dataCells:P,rowHeaderBreadth:B,columnHeaderBreadth:j})),t.useImperativeHandle(w,()=>E.current);const K=[],V=[],_=[],[x,A]=c.useCustomComponent(n.row||y.row),[T,N]=c.useCustomComponent(n.column||y.column),[le,se]=c.useCustomComponent(n.cell||y.cell),[M,W]=c.useCustomComponent(n.headerCell||y.headerCell),ce=n.columnHeadersRow||x,ie=n.columnHeadersColumn||T,ue=n.columnHeadersCell||M,de=n.rowHeadersRow||x,me=n.rowHeadersColumn||T,Ce=n.rowHeadersCell||M,pe=n.dataRow||x,he=n.dataColumn||T;for(let e=0;e<i.length;e++)K.push(t.createElement(he,{key:String(i[e].path),...N,path:i[e].path})),_.push(t.createElement(ie,{key:String(i[e].path),...N,path:i[e].path}));for(let e=0;e<B;e++)V.push(t.createElement(me,{key:e,...N}));const ge=e=>{e.target.props.expandable&&re({type:u.HEADERS_ACTION.toggle,payload:e.target.props.dataItem.path},e.syntheticEvent)},fe=e=>{e.target.props.expandable&&ae({type:u.HEADERS_ACTION.toggle,payload:e.target.props.dataItem.path},e.syntheticEvent)},X=Ae.useHorizontalScrollSync(k,z),we=Te.useVerticalScrollSync(k,q),be=e=>{X(e),we(e)},$=t.useCallback(()=>{s.current&&b.current&&(s.current.style.gridTemplateRows="",s.current.style.gridTemplateRows=`${b.current.offsetHeight}px 1fr`)},[]),F=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($);return e.observe(b.current),()=>{e.disconnect()}}},[$]),t.useEffect(()=>{if(d.current){const e=new window.ResizeObserver(F);return e.observe(d.current),()=>{e.disconnect()}}},[F]),c.useIsomorphicLayoutEffect(()=>{if(c.setScrollbarWidth(),d.current){const e=new window.ResizeObserver(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),D=(o?f.generateKey(o.normalizedPath)+(o.total?"|[TOTAL]":"")+(l?"|[EXPANDED]":""):"").replace(/\s/g,"-");if(o)for(let S=0;S<(o.colSpan||1);S++){for(let g=0;g<(o.rowSpan||1);g++){const ye=h[r+g].findIndex((ve,Ee)=>Ee>=a&&!ve);h[r+g][ye]=D}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"},t.createElement("span",{className:"k-pivotgrid-empty-cell"},t.createElement("span",{className:"k-sr-only"},ee.toLanguageString(O.emptyCellAriaLabel,O.messages[O.emptyCellAriaLabel]))),t.createElement("div",{ref:z,className:"k-pivotgrid-column-headers",onScroll:X},t.createElement("table",{ref:b,className:"k-pivotgrid-table",role:"none"},t.createElement("colgroup",null,_),t.createElement("tbody",{className:"k-pivotgrid-tbody",role:"rowgroup"},R.map((e,r)=>{let a=!1;return t.createElement(ce,{key:e.name,role:"row",...A},e.cells.map((o,l)=>{const D=l!==0&&!a;o&&(a=!0);const S=o&&!!(o.children&&o.children.length),g=o&&o.hasChildren&&(!o.total||o.total&&o.parent.total);return o?t.createElement(ue,{...W,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:ge,dataItem:o,expanded:S,expandable:g,total:o.total,first:D,root:o.levelNum===0,role:"columnheader"},o.caption):null}))})))),t.createElement("div",{ref:q,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"},L.map((e,r)=>t.createElement(de,{key:f.generateKey(C[r].path),...A,path:C[r].path,role:"row",ariaOwns:H[r].join(" ")},e.cells.filter(Boolean).map(a=>a?t.createElement(Ce,{...W,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:fe,root:a.levelNum===0,role:"rowheader"},a.caption):null)))))),t.createElement("div",{ref:k,className:"k-pivotgrid-values",onScroll:be},t.createElement("table",{className:"k-pivotgrid-table",role:"none"},t.createElement("colgroup",null,K),t.createElement("tbody",{className:"k-pivotgrid-tbody",role:"none"},P.map((e,r)=>t.createElement(pe,{key:f.generateKey(C[r].path),...A,path:C[r].path,role:"none"},e.cells.map((a,o)=>t.createElement(le,{key:H[r][o],"data-key":H[r][o],id:H[r][o],...se,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:ke.PivotGridRow,column:Ne.PivotGridColumn,cell:Pe.PivotGridCell,headerCell:xe.PivotGridHeaderCell};Q.displayName="KendoReactPivotGrid";exports.PivotGrid=Q;
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Re=require("react"),c=require("@progress/kendo-react-common"),He=require("./package-metadata.js"),Se=require("@progress/kendo-react-intl"),O=require("./messages/index.js"),ke=require("./components/Row.js"),Pe=require("./components/Cell.js"),J=require("./hooks/useHeaders.js"),xe=require("./components/HeaderCell.js"),Ae=require("./hooks/useHorizontalScrollSync.js"),Te=require("./hooks/useVerticalScrollSync.js"),Ne=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(Re),Q=t.forwardRef((n,w)=>{c.validatePackage(He.packageMetadata);const{rows:m,rowAxes:v,columns:U,columnAxes:Y,data:Z}={...y,...n},s=t.useRef(null),E=t.useRef(null),d=t.useRef(null),b=t.useRef(null),q=t.useRef(null),z=t.useRef(null),k=t.useRef(null),ee=Se.useLocalization(),te=(e,r)=>{n.onRowAxesChange&&n.onRowAxesChange({value:e,target:E.current,syntheticEvent:r})},ne=(e,r)=>{n.onColumnAxesChange&&n.onColumnAxesChange({value:e,target:E.current,syntheticEvent:r})},I=u.toTree((m||[]).slice()),[,ae]=J.useHeaders((v||[]).slice(),I,te),[L,C,oe,B]=u.toRows(I),G=u.toTree((U||[]).slice()),[,re]=J.useHeaders((Y||[]).slice(),G,ne),[R,i,,j]=u.toColumns(G),P=u.toData((Z||[]).slice(),i,C,j,oe);t.useImperativeHandle(E,()=>({props:n,element:s.current,columnHeaderRows:R,rowHeaderRows:L,dataCells:P,rowHeaderBreadth:B,columnHeaderBreadth:j})),t.useImperativeHandle(w,()=>E.current);const K=[],V=[],_=[],[x,A]=c.useCustomComponent(n.row||y.row),[T,N]=c.useCustomComponent(n.column||y.column),[le,se]=c.useCustomComponent(n.cell||y.cell),[M,W]=c.useCustomComponent(n.headerCell||y.headerCell),ce=n.columnHeadersRow||x,ie=n.columnHeadersColumn||T,ue=n.columnHeadersCell||M,de=n.rowHeadersRow||x,me=n.rowHeadersColumn||T,Ce=n.rowHeadersCell||M,pe=n.dataRow||x,he=n.dataColumn||T;for(let e=0;e<i.length;e++)K.push(t.createElement(he,{key:String(i[e].path),...N,path:i[e].path})),_.push(t.createElement(ie,{key:String(i[e].path),...N,path:i[e].path}));for(let e=0;e<B;e++)V.push(t.createElement(me,{key:e,...N}));const ge=e=>{e.target.props.expandable&&re({type:u.HEADERS_ACTION.toggle,payload:e.target.props.dataItem.path},e.syntheticEvent)},fe=e=>{e.target.props.expandable&&ae({type:u.HEADERS_ACTION.toggle,payload:e.target.props.dataItem.path},e.syntheticEvent)},X=Ae.useHorizontalScrollSync(k,z),we=Te.useVerticalScrollSync(k,q),be=e=>{X(e),we(e)},$=t.useCallback(()=>{s.current&&b.current&&(s.current.style.gridTemplateRows="",s.current.style.gridTemplateRows=`${b.current.offsetHeight}px 1fr`)},[]),F=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($);return e.observe(b.current),()=>{e.disconnect()}}},[$]),t.useEffect(()=>{if(d.current){const e=new window.ResizeObserver(F);return e.observe(d.current),()=>{e.disconnect()}}},[F]),c.useIsomorphicLayoutEffect(()=>{if(c.setScrollbarWidth(),d.current){const e=new window.ResizeObserver(()=>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),D=(o?f.generateKey(o.normalizedPath)+(o.total?"|[TOTAL]":"")+(l?"|[EXPANDED]":""):"").replace(/\s/g,"-");if(o)for(let S=0;S<(o.colSpan||1);S++){for(let g=0;g<(o.rowSpan||1);g++){const ye=h[r+g].findIndex((ve,Ee)=>Ee>=a&&!ve);h[r+g][ye]=D}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"},t.createElement("span",{className:"k-pivotgrid-empty-cell"},t.createElement("span",{className:"k-sr-only"},ee.toLanguageString(O.emptyCellAriaLabel,O.messages[O.emptyCellAriaLabel]))),t.createElement("div",{ref:z,className:"k-pivotgrid-column-headers",onScroll:X},t.createElement("table",{ref:b,className:"k-pivotgrid-table",role:"none"},t.createElement("colgroup",null,_),t.createElement("tbody",{className:"k-pivotgrid-tbody",role:"rowgroup"},R.map((e,r)=>{let a=!1;return t.createElement(ce,{key:e.name,role:"row",...A},e.cells.map((o,l)=>{const D=l!==0&&!a;o&&(a=!0);const S=o&&!!(o.children&&o.children.length),g=o&&o.hasChildren&&(!o.total||o.total&&o.parent.total);return o?t.createElement(ue,{...W,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:ge,dataItem:o,expanded:S,expandable:g,total:o.total,first:D,root:o.levelNum===0,role:"columnheader"},o.caption):null}))})))),t.createElement("div",{ref:q,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"},L.map((e,r)=>t.createElement(de,{key:f.generateKey(C[r].path),...A,path:C[r].path,role:"row",ariaOwns:H[r].join(" ")},e.cells.filter(Boolean).map(a=>a?t.createElement(Ce,{...W,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:fe,root:a.levelNum===0,role:"rowheader"},a.caption):null)))))),t.createElement("div",{ref:k,className:"k-pivotgrid-values",onScroll:be},t.createElement("table",{className:"k-pivotgrid-table",role:"none"},t.createElement("colgroup",null,K),t.createElement("tbody",{className:"k-pivotgrid-tbody",role:"none"},P.map((e,r)=>t.createElement(pe,{key:f.generateKey(C[r].path),...A,path:C[r].path,role:"none"},e.cells.map((a,o)=>t.createElement(le,{key:H[r][o],"data-key":H[r][o],id:H[r][o],...se,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:ke.PivotGridRow,column:Ne.PivotGridColumn,cell:Pe.PivotGridCell,headerCell:xe.PivotGridHeaderCell};Q.displayName="KendoReactPivotGrid";exports.PivotGrid=Q;
|
package/PivotGrid.mjs
CHANGED
|
@@ -40,7 +40,13 @@ const Xe = t.forwardRef((n, J) => {
|
|
|
40
40
|
target: g.current,
|
|
41
41
|
syntheticEvent: r
|
|
42
42
|
});
|
|
43
|
-
}, T = q((Q || []).slice()), [, ne] = _((U || []).slice(), T, oe), [D, c, re, z] = Oe(T), L = q((Y || []).slice()), [, le] = _((Z || []).slice(), L, ae), [w, m, , B] = Ge(L), R = Ve(
|
|
43
|
+
}, T = q((Q || []).slice()), [, ne] = _((U || []).slice(), T, oe), [D, c, re, z] = Oe(T), L = q((Y || []).slice()), [, le] = _((Z || []).slice(), L, ae), [w, m, , B] = Ge(L), R = Ve(
|
|
44
|
+
(ee || []).slice(),
|
|
45
|
+
m,
|
|
46
|
+
c,
|
|
47
|
+
B,
|
|
48
|
+
re
|
|
49
|
+
);
|
|
44
50
|
t.useImperativeHandle(g, () => ({
|
|
45
51
|
props: n,
|
|
46
52
|
element: s.current,
|
|
@@ -50,9 +56,31 @@ const Xe = t.forwardRef((n, J) => {
|
|
|
50
56
|
rowHeaderBreadth: z,
|
|
51
57
|
columnHeaderBreadth: B
|
|
52
58
|
})), t.useImperativeHandle(J, () => g.current);
|
|
53
|
-
const I = [], O = [], G = [], [H, k] = y(n.row || C.row), [S, x] = y(
|
|
59
|
+
const I = [], O = [], G = [], [H, k] = y(n.row || C.row), [S, x] = y(
|
|
60
|
+
n.column || C.column
|
|
61
|
+
), [se, me] = y(n.cell || C.cell), [V, K] = y(
|
|
62
|
+
n.headerCell || C.headerCell
|
|
63
|
+
), ie = n.columnHeadersRow || H, ce = n.columnHeadersColumn || S, de = n.columnHeadersCell || V, ue = n.rowHeadersRow || H, pe = n.rowHeadersColumn || S, he = n.rowHeadersCell || V, fe = n.dataRow || H, Ce = n.dataColumn || S;
|
|
54
64
|
for (let e = 0; e < m.length; e++)
|
|
55
|
-
I.push(
|
|
65
|
+
I.push(
|
|
66
|
+
/* @__PURE__ */ t.createElement(
|
|
67
|
+
Ce,
|
|
68
|
+
{
|
|
69
|
+
key: String(m[e].path),
|
|
70
|
+
...x,
|
|
71
|
+
path: m[e].path
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
), G.push(
|
|
75
|
+
/* @__PURE__ */ t.createElement(
|
|
76
|
+
ce,
|
|
77
|
+
{
|
|
78
|
+
key: String(m[e].path),
|
|
79
|
+
...x,
|
|
80
|
+
path: m[e].path
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
);
|
|
56
84
|
for (let e = 0; e < z; e++)
|
|
57
85
|
O.push(/* @__PURE__ */ t.createElement(pe, { key: e, ...x }));
|
|
58
86
|
const ge = (e) => {
|
|
@@ -108,7 +136,7 @@ const Xe = t.forwardRef((n, J) => {
|
|
|
108
136
|
}
|
|
109
137
|
}, [W]), ke(() => {
|
|
110
138
|
if ($(), i.current) {
|
|
111
|
-
const e = new window.ResizeObserver($);
|
|
139
|
+
const e = new window.ResizeObserver(() => $());
|
|
112
140
|
return e.observe(i.current), () => {
|
|
113
141
|
e.disconnect();
|
|
114
142
|
};
|
|
@@ -122,14 +150,18 @@ const Xe = t.forwardRef((n, J) => {
|
|
|
122
150
|
if (a)
|
|
123
151
|
for (let v = 0; v < (a.colSpan || 1); v++) {
|
|
124
152
|
for (let p = 0; p < (a.rowSpan || 1); p++) {
|
|
125
|
-
const ye = u[r + p].findIndex(
|
|
153
|
+
const ye = u[r + p].findIndex(
|
|
154
|
+
(Ee, Re) => Re >= o && !Ee
|
|
155
|
+
);
|
|
126
156
|
u[r + p][ye] = P;
|
|
127
157
|
}
|
|
128
158
|
o++;
|
|
129
159
|
}
|
|
130
160
|
});
|
|
131
161
|
});
|
|
132
|
-
const b = R.map((e) => e.cells.map(
|
|
162
|
+
const b = R.map((e) => e.cells.map(
|
|
163
|
+
(r) => Ie(r.rowTuple.members, r.columnTuple.members).replace(/\s/g, "-")
|
|
164
|
+
));
|
|
133
165
|
return /* @__PURE__ */ t.createElement(
|
|
134
166
|
"div",
|
|
135
167
|
{
|
|
@@ -143,40 +175,32 @@ const Xe = t.forwardRef((n, J) => {
|
|
|
143
175
|
/* @__PURE__ */ t.createElement("span", { className: "k-pivotgrid-empty-cell" }, /* @__PURE__ */ t.createElement("span", { className: "k-sr-only" }, te.toLanguageString(M, Ae[M]))),
|
|
144
176
|
/* @__PURE__ */ t.createElement("div", { ref: N, className: "k-pivotgrid-column-headers", onScroll: X }, /* @__PURE__ */ t.createElement("table", { ref: h, className: "k-pivotgrid-table", role: "none" }, /* @__PURE__ */ t.createElement("colgroup", null, G), /* @__PURE__ */ t.createElement("tbody", { className: "k-pivotgrid-tbody", role: "rowgroup" }, w.map((e, r) => {
|
|
145
177
|
let o = !1;
|
|
146
|
-
return /* @__PURE__ */ t.createElement(
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
first: P,
|
|
173
|
-
root: a.levelNum === 0,
|
|
174
|
-
role: "columnheader"
|
|
175
|
-
},
|
|
176
|
-
a.caption
|
|
177
|
-
) : null;
|
|
178
|
-
})
|
|
179
|
-
);
|
|
178
|
+
return /* @__PURE__ */ t.createElement(ie, { key: e.name, role: "row", ...k }, e.cells.map((a, l) => {
|
|
179
|
+
const P = l !== 0 && !o;
|
|
180
|
+
a && (o = !0);
|
|
181
|
+
const v = a && !!(a.children && a.children.length), p = a && a.hasChildren && (!a.total || a.total && a.parent.total);
|
|
182
|
+
return a ? /* @__PURE__ */ t.createElement(
|
|
183
|
+
de,
|
|
184
|
+
{
|
|
185
|
+
...K,
|
|
186
|
+
key: u[r][l],
|
|
187
|
+
"data-key": u[r][l],
|
|
188
|
+
id: u[r][l],
|
|
189
|
+
columnPath: a.normalizedPath,
|
|
190
|
+
rowSpan: a.rowSpan || void 0,
|
|
191
|
+
colSpan: a.colSpan || void 0,
|
|
192
|
+
onIconClick: ge,
|
|
193
|
+
dataItem: a,
|
|
194
|
+
expanded: v,
|
|
195
|
+
expandable: p,
|
|
196
|
+
total: a.total,
|
|
197
|
+
first: P,
|
|
198
|
+
root: a.levelNum === 0,
|
|
199
|
+
role: "columnheader"
|
|
200
|
+
},
|
|
201
|
+
a.caption
|
|
202
|
+
) : null;
|
|
203
|
+
}));
|
|
180
204
|
})))),
|
|
181
205
|
/* @__PURE__ */ t.createElement("div", { ref: A, className: "k-pivotgrid-row-headers" }, /* @__PURE__ */ t.createElement("table", { ref: i, className: "k-pivotgrid-table", role: "none" }, /* @__PURE__ */ t.createElement("colgroup", null, O), /* @__PURE__ */ t.createElement("tbody", { className: "k-pivotgrid-tbody", role: "rowgroup" }, D.map((e, r) => /* @__PURE__ */ t.createElement(
|
|
182
206
|
ue,
|
|
@@ -217,24 +241,22 @@ const Xe = t.forwardRef((n, J) => {
|
|
|
217
241
|
path: c[r].path,
|
|
218
242
|
role: "none"
|
|
219
243
|
},
|
|
220
|
-
e.cells.map(
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
)
|
|
237
|
-
)
|
|
244
|
+
e.cells.map((o, a) => /* @__PURE__ */ t.createElement(
|
|
245
|
+
se,
|
|
246
|
+
{
|
|
247
|
+
key: b[r][a],
|
|
248
|
+
"data-key": b[r][a],
|
|
249
|
+
id: b[r][a],
|
|
250
|
+
...me,
|
|
251
|
+
rowPath: o.rowTuple.members.map((l) => l.name),
|
|
252
|
+
columnPath: o.columnTuple.members.map((l) => l.name),
|
|
253
|
+
dataItem: o,
|
|
254
|
+
total: c[r].total || m[a].total,
|
|
255
|
+
role: "gridcell",
|
|
256
|
+
ariaDescribedby: u.map((l) => l[a]).join(" ")
|
|
257
|
+
},
|
|
258
|
+
o && o.data && o.data.fmtValue ? o.data.fmtValue : " "
|
|
259
|
+
))
|
|
238
260
|
)))))
|
|
239
261
|
);
|
|
240
262
|
}), C = {
|
|
@@ -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
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@progress/kendo-react-common"),require("@progress/kendo-react-intl"),require("@progress/kendo-pivotgrid-common"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-buttons"),require("@progress/kendo-react-form"),require("@progress/kendo-react-labels"),require("@progress/kendo-react-data-tools"),require("@progress/kendo-react-treeview"),require("@progress/kendo-react-indicators")):"function"==typeof define&&define.amd?define(["exports","react","@progress/kendo-react-common","@progress/kendo-react-intl","@progress/kendo-pivotgrid-common","@progress/kendo-svg-icons","@progress/kendo-react-buttons","@progress/kendo-react-form","@progress/kendo-react-labels","@progress/kendo-react-data-tools","@progress/kendo-react-treeview","@progress/kendo-react-indicators"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactPivotgrid={},e.React,e.KendoReactCommon,e.KendoReactIntl,e.KendoPivotgridCommon,e.KendoSvgIcons,e.KendoReactButtons,e.KendoReactForm,e.KendoReactLabels,e.KendoReactDataTools,e.KendoReactTreeview,e.KendoReactIndicators)}(this,(function(e,t,r,n,a,o,l,s,i,c,u,d){"use strict";function m(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var p=m(t);const g={name:"@progress/kendo-react-pivotgrid",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},v="pivotgrid.emptyCellAriaLabel",f="pivotgrid.fieldMenuReset",h="pivotgrid.fieldMenuApply",x="pivotgrid.configuratorTitle",E="pivotgrid.configuratorCancel",y="pivotgrid.configuratorApply",A="pivotgrid.configuratorColumnsTitle",C="pivotgrid.configuratorRowsTitle",w="pivotgrid.configuratorMeasuresTitle",b="pivotgrid.configuratorEditorSearchTitle",I="pivotgrid.configuratorMissingFields",N="pivotgrid.configuratorButtonLabel",k={[v]:"PivotGrid component. Use the arrow keys to navigate.",[f]:"Reset",[h]:"Apply",[E]:"Cancel",[y]:"Apply",[x]:"Settings",[b]:"Fields","pivotgrid.configuratorEditorSearchPlaceholder":"Search...",[A]:"Columns",[C]:"Rows",[w]:"Values",[N]:"Change settings",[I]:"Select some fields to begin setup"},R=p.forwardRef(((e,t)=>{const n=p.useRef(null),a=p.useRef(null);p.useImperativeHandle(n,(()=>({element:a.current,props:e}))),p.useImperativeHandle(t,(()=>n.current));const o=r.useMouse(e,n);return p.createElement("tr",{ref:a,...o,id:e.id,style:e.style,tabIndex:e.tabIndex,children:e.children,role:e.role,"aria-owns":e.ariaOwns,className:r.classNames("k-pivotgrid-row",e.className)})}));R.displayName="KendoReactPivotGridRow";const 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})),O=(e=[])=>{let t=[...e];return(e||[]).forEach((e=>{t=t.concat(O(e.children))})),t},H=(e=[])=>{const t=new Set;return e.forEach((e=>{t.add(String(e.name))})),Array.from(t)},q=(e=[])=>`${e.join(",")}`,G=(e,t,r)=>{if(!e)return[];let n,a=0,o=[],l=e.length;for(;a<l;a++)n=e[a].operator,(!r&&"in"!==n||n===r)&&e[a].field===t&&o.push(e[a]);return o},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=[],O=[],H=[],[G,K]=r.useCustomComponent(e.row||U.row),[z,B]=r.useCustomComponent(e.column||U.column),[j,X]=r.useCustomComponent(e.cell||U.cell),[V,Z]=r.useCustomComponent(e.headerCell||U.headerCell),_=e.columnHeadersRow||G,$=e.columnHeadersColumn||z,J=e.columnHeadersCell||V,W=e.rowHeadersRow||G,Y=e.rowHeadersColumn||z,Q=e.rowHeadersCell||V,ee=e.dataRow||G,te=e.dataColumn||z;for(let e=0;e<L.length;e++)M.push(p.createElement(te,{key:String(L[e].path),...B,path:L[e].path})),H.push(p.createElement($,{key:String(L[e].path),...B,path:L[e].path}));for(let e=0;e<N;e++)O.push(p.createElement(Y,{key:e,...B}));const re=e=>{e.target.props.expandable&&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(le);return e.observe(f.current),()=>{e.disconnect()}}}),[le]),p.useEffect((()=>{if(m.current){const e=new window.ResizeObserver(se);return e.observe(m.current),()=>{e.disconnect()}}}),[se]),r.useIsomorphicLayoutEffect((()=>{if(r.setScrollbarWidth(),m.current){const e=new window.ResizeObserver(r.setScrollbarWidth);return e.observe(m.current),()=>{e.disconnect()}}}),[]);const ce=new Array(P.length).fill([]).map((()=>new Array(L.length)));P.forEach(((e,t)=>{let r=0;Array.from(e.cells).forEach((e=>{const n=!!(e&&e.children&&e.children.length),a=(e?q(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)=>`${q(e.map((e=>e.name)))}|${q(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,H),p.createElement("tbody",{className:"k-pivotgrid-tbody",role:"rowgroup"},P.map(((e,t)=>{let r=!1;return p.createElement(_,{key:e.name,role:"row",...K},e.cells.map(((e,n)=>{const a=0!==n&&!r;e&&(r=!0);const o=e&&!(!e.children||!e.children.length),l=e&&e.hasChildren&&(!e.total||e.total&&e.parent.total);return e?p.createElement(J,{...Z,key:ce[t][n],"data-key":ce[t][n],id:ce[t][n],columnPath:e.normalizedPath,rowSpan:e.rowSpan||void 0,colSpan:e.colSpan||void 0,onIconClick:re,dataItem:e,expanded:o,expandable:l,total:e.total,first:a,root:0===e.levelNum,role:"columnheader"},e.caption):null})))}))))),p.createElement("div",{ref:h,className:"k-pivotgrid-row-headers"},p.createElement("table",{ref:m,className:"k-pivotgrid-table",role:"none"},p.createElement("colgroup",null,O),p.createElement("tbody",{className:"k-pivotgrid-tbody",role:"rowgroup"},w.map(((e,t)=>p.createElement(W,{key:q(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:q(e.normalizedPath)+(e.total?"|[TOTAL]":"")+(e.children&&e.children.length?"|[EXPANDED]":""),"data-key":q(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:q(b[t].path),...K,path:b[t].path,role:"none"},e.cells.map(((e,r)=>p.createElement(j,{key:ue[t][r],"data-key":ue[t][r],id:ue[t][r],...X,rowPath:e.rowTuple.members.map((e=>e.name)),columnPath:e.columnTuple.members.map((e=>e.name)),dataItem:e,total:b[t].total||L[r].total,role:"gridcell",ariaDescribedby:ce.map((e=>e[r])).join(" ")},e&&e.data&&e.data.fmtValue?e.data.fmtValue:" "))))))))))})),U={rowAxes:[],columnAxes:[],data:[],row:R,column:T,cell: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 X=p.createContext({axes:null}),V=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(V),[,P]=p.useContext(Z),[L,T]=p.useState(s),D=L?L.value.split(","):[],[H,q]=$([],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=>H.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=O(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=>{q({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(X),[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,o=0,l=e.length;for(;o<l;o++)a=e[o].operator,a===r&&e[o].field===t&&(n=e[o]);return n})(g.filter,String(e.dataItem.name),"in");return r.splice(1,0,p.createElement(C,{key:"axis-filter-fields-editor",defaultFilter:n,dataItem:e.dataItem,data:e.dataItem.fields,axes:u,...w})),r},sort:g.sort,onSortChange:(e,t)=>{v({type: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(X.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=H(o),E=H(a),y=H(l),A=O(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),O=p.useRef(null),H=p.useRef(null),q=n.useLocalization(),[G,K]=Y(m);p.useImperativeHandle(H,(()=>({element:O.current,props:m,state:G}))),p.useImperativeHandle(t,(()=>H.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})},X=()=>{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(V.Provider,{value:{onAxisFilterFieldExpand:e=>{const t={target:e.target,currentTarget:H.current,value:e.value,syntheticEvent:e.syntheticEvent};u&&u(t)},onAxisFilterFieldsExpandChange:e=>{const t={target:e.target,currentTarget:H.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},q.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:H.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:H.current,value:e.value,syntheticEvent:e.syntheticEvent})},onCheck:e=>{const t={target:e.target,currentTarget:H.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},q.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},q.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},q.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},q.toLanguageString(I,k[I]))),p.createElement($,{...J},p.createElement("div",{className:"k-form-field",onMouseEnter:X,onMouseLeave:_},p.createElement(s.Field,{name:"measureAxes",field:"measureAxes",component:L,...T},q.toLanguageString(w,k[w]))),m.valueGetter("measureAxes").length?p.createElement(s.Field,{name:"measureAxes",field:"measureAxes",component:D,onMouseEnter:X,onMouseLeave:_,className:"k-column-fields",...M}):p.createElement("div",{className:"k-settings-description",onMouseEnter:X,onMouseLeave:_},q.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;let a=w(n.children,t);if(null!==a)return a}return null};return{pivotProps:{rowAxes:d,columnAxes:c,data:o.data,rows:o.rows,columns:o.columns,onRowAxesChange:y,onColumnAxesChange:A},configuratorProps:{sort:f,onSortChange:e=>{h(e.value)},filter:x,onFilterChange:e=>{E(e.value)},data:s,rowAxes:d,columnAxes:c,measureAxes:g,onRowAxesChange:y,onColumnAxesChange:A,onMeasureAxesChange:e=>{v(e.value)},onFieldsEditorFieldExpand:async t=>{const r=s.slice(),n=w(r,t.value);if(n&&"[KPIs]"===n.uniqueName){const t=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}));
|
|
8
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@progress/kendo-react-common"),require("@progress/kendo-react-intl"),require("@progress/kendo-pivotgrid-common"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-buttons"),require("@progress/kendo-react-form"),require("@progress/kendo-react-labels"),require("@progress/kendo-react-data-tools"),require("@progress/kendo-react-treeview"),require("@progress/kendo-react-indicators")):"function"==typeof define&&define.amd?define(["exports","react","@progress/kendo-react-common","@progress/kendo-react-intl","@progress/kendo-pivotgrid-common","@progress/kendo-svg-icons","@progress/kendo-react-buttons","@progress/kendo-react-form","@progress/kendo-react-labels","@progress/kendo-react-data-tools","@progress/kendo-react-treeview","@progress/kendo-react-indicators"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactPivotgrid={},e.React,e.KendoReactCommon,e.KendoReactIntl,e.KendoPivotgridCommon,e.KendoSvgIcons,e.KendoReactButtons,e.KendoReactForm,e.KendoReactLabels,e.KendoReactDataTools,e.KendoReactTreeview,e.KendoReactIndicators)}(this,(function(e,t,r,n,a,o,l,s,i,c,u,d){"use strict";function m(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var p=m(t);const g={name:"@progress/kendo-react-pivotgrid",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},v="pivotgrid.emptyCellAriaLabel",f="pivotgrid.fieldMenuReset",h="pivotgrid.fieldMenuApply",x="pivotgrid.configuratorTitle",E="pivotgrid.configuratorCancel",y="pivotgrid.configuratorApply",A="pivotgrid.configuratorColumnsTitle",C="pivotgrid.configuratorRowsTitle",w="pivotgrid.configuratorMeasuresTitle",b="pivotgrid.configuratorEditorSearchTitle",I="pivotgrid.configuratorMissingFields",N="pivotgrid.configuratorButtonLabel",k={[v]:"PivotGrid component. Use the arrow keys to navigate.",[f]:"Reset",[h]:"Apply",[E]:"Cancel",[y]:"Apply",[x]:"Settings",[b]:"Fields","pivotgrid.configuratorEditorSearchPlaceholder":"Search...",[A]:"Columns",[C]:"Rows",[w]:"Values",[N]:"Change settings",[I]:"Select some fields to begin setup"},R=p.forwardRef(((e,t)=>{const n=p.useRef(null),a=p.useRef(null);p.useImperativeHandle(n,(()=>({element:a.current,props:e}))),p.useImperativeHandle(t,(()=>n.current));const o=r.useMouse(e,n);return p.createElement("tr",{ref:a,...o,id:e.id,style:e.style,tabIndex:e.tabIndex,children:e.children,role:e.role,"aria-owns":e.ariaOwns,className:r.classNames("k-pivotgrid-row",e.className)})}));R.displayName="KendoReactPivotGridRow";const 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})),O=(e=[])=>{let t=[...e];return(e||[]).forEach((e=>{t=t.concat(O(e.children))})),t},H=(e=[])=>{const t=new Set;return e.forEach((e=>{t.add(String(e.name))})),Array.from(t)},q=(e=[])=>`${e.join(",")}`,G=(e,t,r)=>{if(!e)return[];let n,a=0,o=[],l=e.length;for(;a<l;a++)n=e[a].operator,(!r&&"in"!==n||n===r)&&e[a].field===t&&o.push(e[a]);return o},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=[],O=[],H=[],[G,K]=r.useCustomComponent(e.row||U.row),[z,B]=r.useCustomComponent(e.column||U.column),[j,X]=r.useCustomComponent(e.cell||U.cell),[V,Z]=r.useCustomComponent(e.headerCell||U.headerCell),_=e.columnHeadersRow||G,$=e.columnHeadersColumn||z,J=e.columnHeadersCell||V,W=e.rowHeadersRow||G,Y=e.rowHeadersColumn||z,Q=e.rowHeadersCell||V,ee=e.dataRow||G,te=e.dataColumn||z;for(let e=0;e<L.length;e++)M.push(p.createElement(te,{key:String(L[e].path),...B,path:L[e].path})),H.push(p.createElement($,{key:String(L[e].path),...B,path:L[e].path}));for(let e=0;e<N;e++)O.push(p.createElement(Y,{key:e,...B}));const re=e=>{e.target.props.expandable&&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(le);return e.observe(f.current),()=>{e.disconnect()}}}),[le]),p.useEffect((()=>{if(m.current){const e=new window.ResizeObserver(se);return e.observe(m.current),()=>{e.disconnect()}}}),[se]),r.useIsomorphicLayoutEffect((()=>{if(r.setScrollbarWidth(),m.current){const e=new window.ResizeObserver((()=>r.setScrollbarWidth()));return e.observe(m.current),()=>{e.disconnect()}}}),[]);const ce=new Array(P.length).fill([]).map((()=>new Array(L.length)));P.forEach(((e,t)=>{let r=0;Array.from(e.cells).forEach((e=>{const n=!!(e&&e.children&&e.children.length),a=(e?q(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)=>`${q(e.map((e=>e.name)))}|${q(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,H),p.createElement("tbody",{className:"k-pivotgrid-tbody",role:"rowgroup"},P.map(((e,t)=>{let r=!1;return p.createElement(_,{key:e.name,role:"row",...K},e.cells.map(((e,n)=>{const a=0!==n&&!r;e&&(r=!0);const o=e&&!(!e.children||!e.children.length),l=e&&e.hasChildren&&(!e.total||e.total&&e.parent.total);return e?p.createElement(J,{...Z,key:ce[t][n],"data-key":ce[t][n],id:ce[t][n],columnPath:e.normalizedPath,rowSpan:e.rowSpan||void 0,colSpan:e.colSpan||void 0,onIconClick:re,dataItem:e,expanded:o,expandable:l,total:e.total,first:a,root:0===e.levelNum,role:"columnheader"},e.caption):null})))}))))),p.createElement("div",{ref:h,className:"k-pivotgrid-row-headers"},p.createElement("table",{ref:m,className:"k-pivotgrid-table",role:"none"},p.createElement("colgroup",null,O),p.createElement("tbody",{className:"k-pivotgrid-tbody",role:"rowgroup"},w.map(((e,t)=>p.createElement(W,{key:q(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:q(e.normalizedPath)+(e.total?"|[TOTAL]":"")+(e.children&&e.children.length?"|[EXPANDED]":""),"data-key":q(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:q(b[t].path),...K,path:b[t].path,role:"none"},e.cells.map(((e,r)=>p.createElement(j,{key:ue[t][r],"data-key":ue[t][r],id:ue[t][r],...X,rowPath:e.rowTuple.members.map((e=>e.name)),columnPath:e.columnTuple.members.map((e=>e.name)),dataItem:e,total:b[t].total||L[r].total,role:"gridcell",ariaDescribedby:ce.map((e=>e[r])).join(" ")},e&&e.data&&e.data.fmtValue?e.data.fmtValue:" "))))))))))})),U={rowAxes:[],columnAxes:[],data:[],row:R,column:T,cell: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 X=p.createContext({axes:null}),V=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(V),[,P]=p.useContext(Z),[L,T]=p.useState(s),D=L?L.value.split(","):[],[H,q]=$([],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=>H.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=O(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=>{q({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(X),[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,o=0,l=e.length;for(;o<l;o++)a=e[o].operator,a===r&&e[o].field===t&&(n=e[o]);return n})(g.filter,String(e.dataItem.name),"in");return r.splice(1,0,p.createElement(C,{key:"axis-filter-fields-editor",defaultFilter:n,dataItem:e.dataItem,data:e.dataItem.fields,axes:u,...w})),r},sort:g.sort,onSortChange:(e,t)=>{v({type: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(X.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=H(o),E=H(a),y=H(l),A=O(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),O=p.useRef(null),H=p.useRef(null),q=n.useLocalization(),[G,K]=Y(m);p.useImperativeHandle(H,(()=>({element:O.current,props:m,state:G}))),p.useImperativeHandle(t,(()=>H.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})},X=()=>{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(V.Provider,{value:{onAxisFilterFieldExpand:e=>{const t={target:e.target,currentTarget:H.current,value:e.value,syntheticEvent:e.syntheticEvent};u&&u(t)},onAxisFilterFieldsExpandChange:e=>{const t={target:e.target,currentTarget:H.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},q.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:H.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:H.current,value:e.value,syntheticEvent:e.syntheticEvent})},onCheck:e=>{const t={target:e.target,currentTarget:H.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},q.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},q.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},q.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},q.toLanguageString(I,k[I]))),p.createElement($,{...J},p.createElement("div",{className:"k-form-field",onMouseEnter:X,onMouseLeave:_},p.createElement(s.Field,{name:"measureAxes",field:"measureAxes",component:L,...T},q.toLanguageString(w,k[w]))),m.valueGetter("measureAxes").length?p.createElement(s.Field,{name:"measureAxes",field:"measureAxes",component:D,onMouseEnter:X,onMouseLeave:_,className:"k-column-fields",...M}):p.createElement("div",{className:"k-settings-description",onMouseEnter:X,onMouseLeave:_},q.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;let a=w(n.children,t);if(null!==a)return a}return null};return{pivotProps:{rowAxes:d,columnAxes:c,data:o.data,rows:o.rows,columns:o.columns,onRowAxesChange:y,onColumnAxesChange:A},configuratorProps:{sort:f,onSortChange:e=>{h(e.value)},filter:x,onFilterChange:e=>{E(e.value)},data:s,rowAxes:d,columnAxes:c,measureAxes:g,onRowAxesChange:y,onColumnAxesChange:A,onMeasureAxesChange:e=>{v(e.value)},onFieldsEditorFieldExpand:async t=>{const r=s.slice(),n=w(r,t.value);if(n&&"[KPIs]"===n.uniqueName){const t=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.mjs
CHANGED
|
@@ -10,7 +10,7 @@ const e = {
|
|
|
10
10
|
name: "@progress/kendo-react-pivotgrid",
|
|
11
11
|
productName: "KendoReact",
|
|
12
12
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
13
|
-
publishDate:
|
|
13
|
+
publishDate: 1727785521,
|
|
14
14
|
version: "",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
16
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-pivotgrid",
|
|
3
|
-
"version": "8.4.0-develop.
|
|
3
|
+
"version": "8.4.0-develop.4",
|
|
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",
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
"@progress/kendo-data-query": "^1.5.5",
|
|
26
26
|
"@progress/kendo-licensing": "^1.3.4",
|
|
27
27
|
"@progress/kendo-pivotgrid-common": "0.6.0",
|
|
28
|
-
"@progress/kendo-react-buttons": "8.4.0-develop.
|
|
29
|
-
"@progress/kendo-react-common": "8.4.0-develop.
|
|
30
|
-
"@progress/kendo-react-data-tools": "8.4.0-develop.
|
|
31
|
-
"@progress/kendo-react-form": "8.4.0-develop.
|
|
32
|
-
"@progress/kendo-react-indicators": "8.4.0-develop.
|
|
33
|
-
"@progress/kendo-react-intl": "8.4.0-develop.
|
|
34
|
-
"@progress/kendo-react-labels": "8.4.0-develop.
|
|
35
|
-
"@progress/kendo-react-treeview": "8.4.0-develop.
|
|
28
|
+
"@progress/kendo-react-buttons": "8.4.0-develop.4",
|
|
29
|
+
"@progress/kendo-react-common": "8.4.0-develop.4",
|
|
30
|
+
"@progress/kendo-react-data-tools": "8.4.0-develop.4",
|
|
31
|
+
"@progress/kendo-react-form": "8.4.0-develop.4",
|
|
32
|
+
"@progress/kendo-react-indicators": "8.4.0-develop.4",
|
|
33
|
+
"@progress/kendo-react-intl": "8.4.0-develop.4",
|
|
34
|
+
"@progress/kendo-react-labels": "8.4.0-develop.4",
|
|
35
|
+
"@progress/kendo-react-treeview": "8.4.0-develop.4",
|
|
36
36
|
"@progress/kendo-svg-icons": "^3.0.0",
|
|
37
37
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|
|
38
38
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|