@progress/kendo-react-pivotgrid 7.2.4-develop.3 → 7.3.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PivotGrid.js +8 -0
- package/PivotGrid.mjs +252 -0
- package/components/AxesEditor.js +8 -0
- package/components/AxesEditor.mjs +43 -0
- package/components/AxisEditor.js +8 -0
- package/components/AxisEditor.mjs +108 -0
- package/components/AxisFilterFieldsEditor.js +8 -0
- package/components/AxisFilterFieldsEditor.mjs +159 -0
- package/components/Cell.js +8 -0
- package/components/Cell.mjs +45 -0
- package/components/Column.js +8 -0
- package/components/Column.mjs +40 -0
- package/components/Configurator.js +8 -0
- package/components/Configurator.mjs +134 -0
- package/components/ConfiguratorButton.js +8 -0
- package/components/ConfiguratorButton.mjs +42 -0
- package/components/ConfiguratorEditor.js +8 -0
- package/components/ConfiguratorEditor.mjs +240 -0
- package/components/Container.js +8 -0
- package/components/Container.mjs +40 -0
- package/components/EditorContext.js +8 -0
- package/components/EditorContext.mjs +13 -0
- package/components/FieldsEditor.js +8 -0
- package/components/FieldsEditor.mjs +78 -0
- package/components/HeaderCell.js +8 -0
- package/components/HeaderCell.mjs +69 -0
- package/components/Row.js +8 -0
- package/components/Row.mjs +42 -0
- package/dist/cdn/js/kendo-react-pivotgrid.js +8 -5
- package/hooks/useExpansion.js +8 -0
- package/hooks/useExpansion.mjs +46 -0
- package/hooks/useHeaders.js +8 -0
- package/hooks/useHeaders.mjs +18 -0
- package/hooks/useHorizontalScrollSync.js +8 -0
- package/hooks/useHorizontalScrollSync.mjs +25 -0
- package/hooks/usePivotConfiguratorEditor.js +8 -0
- package/hooks/usePivotConfiguratorEditor.mjs +67 -0
- package/hooks/usePivotLocalDataService.js +8 -0
- package/hooks/usePivotLocalDataService.mjs +94 -0
- package/hooks/usePivotOLAPService.js +8 -0
- package/hooks/usePivotOLAPService.mjs +230 -0
- package/hooks/useVerticalScrollSync.js +8 -0
- package/hooks/useVerticalScrollSync.mjs +25 -0
- package/index.d.mts +1342 -5
- package/index.d.ts +1342 -22
- package/index.js +8 -5
- package/index.mjs +46 -1583
- package/messages/index.js +8 -0
- package/messages/index.mjs +39 -0
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +19 -0
- package/package.json +9 -9
- package/shared/PivotGridConfiguratorEditorEventsContext.js +8 -0
- package/shared/PivotGridConfiguratorEditorEventsContext.mjs +13 -0
- package/shared/PivotGridConfiguratorEditorStateContext.js +8 -0
- package/shared/PivotGridConfiguratorEditorStateContext.mjs +28 -0
- package/utils/index.js +8 -0
- package/utils/index.mjs +59 -0
- package/PivotGrid.d.ts +0 -181
- package/components/AxesEditor.d.ts +0 -44
- package/components/AxisEditor.d.ts +0 -56
- package/components/AxisFilterFieldsEditor.d.ts +0 -118
- package/components/Cell.d.ts +0 -69
- package/components/Column.d.ts +0 -46
- package/components/Configurator.d.ts +0 -129
- package/components/ConfiguratorButton.d.ts +0 -44
- package/components/ConfiguratorEditor.d.ts +0 -130
- package/components/Container.d.ts +0 -50
- package/components/EditorContext.d.ts +0 -11
- package/components/FieldsEditor.d.ts +0 -78
- package/components/HeaderCell.d.ts +0 -100
- package/components/Row.d.ts +0 -54
- package/hooks/index.d.ts +0 -6
- package/hooks/useExpansion.d.ts +0 -23
- package/hooks/useHeaders.d.ts +0 -16
- package/hooks/useHorizontalScrollSync.d.ts +0 -9
- package/hooks/usePivotConfiguratorEditor.d.ts +0 -87
- package/hooks/usePivotLocalDataService.d.ts +0 -83
- package/hooks/usePivotOLAPService.d.ts +0 -45
- package/hooks/useVerticalScrollSync.d.ts +0 -9
- package/messages/index.d.ts +0 -74
- package/models/index.d.ts +0 -48
- package/package-metadata.d.ts +0 -9
- package/shared/PivotGridConfiguratorEditorEventsContext.d.ts +0 -17
- package/shared/PivotGridConfiguratorEditorStateContext.d.ts +0 -10
- package/shared/index.d.ts +0 -6
- package/utils/index.d.ts +0 -51
package/PivotGrid.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const 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
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as t from "react";
|
|
10
|
+
import { validatePackage as He, useCustomComponent as y, useIsomorphicLayoutEffect as ke, setScrollbarWidth as $, classNames as Se } from "@progress/kendo-react-common";
|
|
11
|
+
import { packageMetadata as xe } from "./package-metadata.mjs";
|
|
12
|
+
import { useLocalization as Pe } from "@progress/kendo-react-intl";
|
|
13
|
+
import { emptyCellAriaLabel as M, messages as Ae } from "./messages/index.mjs";
|
|
14
|
+
import { PivotGridRow as Ne } from "./components/Row.mjs";
|
|
15
|
+
import { PivotGridCell as Te } from "./components/Cell.mjs";
|
|
16
|
+
import { useHeaders as _ } from "./hooks/useHeaders.mjs";
|
|
17
|
+
import { PivotGridHeaderCell as De } from "./components/HeaderCell.mjs";
|
|
18
|
+
import { useHorizontalScrollSync as ze } from "./hooks/useHorizontalScrollSync.mjs";
|
|
19
|
+
import { useVerticalScrollSync as Le } from "./hooks/useVerticalScrollSync.mjs";
|
|
20
|
+
import { PivotGridColumn as Be } from "./components/Column.mjs";
|
|
21
|
+
import { generateKey as f, generateDataKey as Ie } from "./utils/index.mjs";
|
|
22
|
+
import { toTree as q, toRows as Oe, toColumns as Ge, toData as Ve, PivotGridNavigation as Ke, HEADERS_ACTION as F } from "@progress/kendo-pivotgrid-common";
|
|
23
|
+
const Xe = t.forwardRef((n, J) => {
|
|
24
|
+
He(xe);
|
|
25
|
+
const {
|
|
26
|
+
rows: Q,
|
|
27
|
+
rowAxes: U,
|
|
28
|
+
columns: Y,
|
|
29
|
+
columnAxes: Z,
|
|
30
|
+
data: ee
|
|
31
|
+
} = { ...C, ...n }, s = t.useRef(null), g = t.useRef(null), i = t.useRef(null), h = t.useRef(null), A = t.useRef(null), N = t.useRef(null), E = t.useRef(null), te = Pe(), oe = (e, r) => {
|
|
32
|
+
n.onRowAxesChange && n.onRowAxesChange({
|
|
33
|
+
value: e,
|
|
34
|
+
target: g.current,
|
|
35
|
+
syntheticEvent: r
|
|
36
|
+
});
|
|
37
|
+
}, ae = (e, r) => {
|
|
38
|
+
n.onColumnAxesChange && n.onColumnAxesChange({
|
|
39
|
+
value: e,
|
|
40
|
+
target: g.current,
|
|
41
|
+
syntheticEvent: r
|
|
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((ee || []).slice(), m, c, B, re);
|
|
44
|
+
t.useImperativeHandle(g, () => ({
|
|
45
|
+
props: n,
|
|
46
|
+
element: s.current,
|
|
47
|
+
columnHeaderRows: w,
|
|
48
|
+
rowHeaderRows: D,
|
|
49
|
+
dataCells: R,
|
|
50
|
+
rowHeaderBreadth: z,
|
|
51
|
+
columnHeaderBreadth: B
|
|
52
|
+
})), t.useImperativeHandle(J, () => g.current);
|
|
53
|
+
const I = [], O = [], G = [], [H, k] = y(n.row || C.row), [S, x] = y(n.column || C.column), [se, me] = y(n.cell || C.cell), [V, K] = y(n.headerCell || C.headerCell), 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
|
+
for (let e = 0; e < m.length; e++)
|
|
55
|
+
I.push(/* @__PURE__ */ t.createElement(Ce, { key: String(m[e].path), ...x, path: m[e].path })), G.push(/* @__PURE__ */ t.createElement(ce, { key: String(m[e].path), ...x, path: m[e].path }));
|
|
56
|
+
for (let e = 0; e < z; e++)
|
|
57
|
+
O.push(/* @__PURE__ */ t.createElement(pe, { key: e, ...x }));
|
|
58
|
+
const ge = (e) => {
|
|
59
|
+
e.target.props.expandable && le(
|
|
60
|
+
{
|
|
61
|
+
type: F.toggle,
|
|
62
|
+
payload: e.target.props.dataItem.path
|
|
63
|
+
},
|
|
64
|
+
e.syntheticEvent
|
|
65
|
+
);
|
|
66
|
+
}, we = (e) => {
|
|
67
|
+
e.target.props.expandable && ne(
|
|
68
|
+
{
|
|
69
|
+
type: F.toggle,
|
|
70
|
+
payload: e.target.props.dataItem.path
|
|
71
|
+
},
|
|
72
|
+
e.syntheticEvent
|
|
73
|
+
);
|
|
74
|
+
}, X = ze(E, N), be = Le(E, A), ve = (e) => {
|
|
75
|
+
X(e), be(e);
|
|
76
|
+
}, j = t.useCallback(() => {
|
|
77
|
+
s.current && h.current && (s.current.style.gridTemplateRows = "", s.current.style.gridTemplateRows = `${h.current.offsetHeight}px 1fr`);
|
|
78
|
+
}, []), W = t.useCallback(() => {
|
|
79
|
+
s.current && i.current && (s.current.style.gridTemplateColumns = "", s.current.style.gridTemplateColumns = `${i.current.offsetWidth}px 1fr`);
|
|
80
|
+
}, []), d = t.useRef(new Ke({ tabIndex: n.tabIndex || 0 }));
|
|
81
|
+
t.useEffect(() => {
|
|
82
|
+
if (s.current) {
|
|
83
|
+
const e = n.tabIndex || 0;
|
|
84
|
+
if (d.current.stop(), d.current.tabIndex = e, n.navigatable) {
|
|
85
|
+
d.current.start(s.current);
|
|
86
|
+
const r = d.current.first;
|
|
87
|
+
r && r.setAttribute("tabindex", String(e));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return () => {
|
|
91
|
+
d.current.stop();
|
|
92
|
+
};
|
|
93
|
+
}, [n.tabIndex, n.navigatable]), t.useEffect(() => {
|
|
94
|
+
d.current.update();
|
|
95
|
+
}), t.useEffect(() => {
|
|
96
|
+
if (h.current) {
|
|
97
|
+
const e = new window.ResizeObserver(j);
|
|
98
|
+
return e.observe(h.current), () => {
|
|
99
|
+
e.disconnect();
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}, [j]), t.useEffect(() => {
|
|
103
|
+
if (i.current) {
|
|
104
|
+
const e = new window.ResizeObserver(W);
|
|
105
|
+
return e.observe(i.current), () => {
|
|
106
|
+
e.disconnect();
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
}, [W]), ke(() => {
|
|
110
|
+
if ($(), i.current) {
|
|
111
|
+
const e = new window.ResizeObserver($);
|
|
112
|
+
return e.observe(i.current), () => {
|
|
113
|
+
e.disconnect();
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}, []);
|
|
117
|
+
const u = new Array(w.length).fill([]).map(() => new Array(m.length));
|
|
118
|
+
w.forEach((e, r) => {
|
|
119
|
+
let o = 0;
|
|
120
|
+
Array.from(e.cells).forEach((a) => {
|
|
121
|
+
const l = !!(a && a.children && a.children.length), P = (a ? f(a.normalizedPath) + (a.total ? "|[TOTAL]" : "") + (l ? "|[EXPANDED]" : "") : "").replace(/\s/g, "-");
|
|
122
|
+
if (a)
|
|
123
|
+
for (let v = 0; v < (a.colSpan || 1); v++) {
|
|
124
|
+
for (let p = 0; p < (a.rowSpan || 1); p++) {
|
|
125
|
+
const ye = u[r + p].findIndex((Ee, Re) => Re >= o && !Ee);
|
|
126
|
+
u[r + p][ye] = P;
|
|
127
|
+
}
|
|
128
|
+
o++;
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
const b = R.map((e) => e.cells.map((r) => Ie(r.rowTuple.members, r.columnTuple.members).replace(/\s/g, "-")));
|
|
133
|
+
return /* @__PURE__ */ t.createElement(
|
|
134
|
+
"div",
|
|
135
|
+
{
|
|
136
|
+
ref: s,
|
|
137
|
+
id: n.id,
|
|
138
|
+
style: n.style,
|
|
139
|
+
tabIndex: n.navigatable ? void 0 : n.tabIndex,
|
|
140
|
+
className: Se("k-pivotgrid", n.className),
|
|
141
|
+
role: "grid"
|
|
142
|
+
},
|
|
143
|
+
/* @__PURE__ */ t.createElement("span", { className: "k-pivotgrid-empty-cell" }, /* @__PURE__ */ t.createElement("span", { className: "k-sr-only" }, te.toLanguageString(M, Ae[M]))),
|
|
144
|
+
/* @__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
|
+
let o = !1;
|
|
146
|
+
return /* @__PURE__ */ t.createElement(
|
|
147
|
+
ie,
|
|
148
|
+
{
|
|
149
|
+
key: e.name,
|
|
150
|
+
role: "row",
|
|
151
|
+
...k
|
|
152
|
+
},
|
|
153
|
+
e.cells.map((a, l) => {
|
|
154
|
+
const P = l !== 0 && !o;
|
|
155
|
+
a && (o = !0);
|
|
156
|
+
const v = a && !!(a.children && a.children.length), p = a && a.hasChildren && (!a.total || a.total && a.parent.total);
|
|
157
|
+
return a ? /* @__PURE__ */ t.createElement(
|
|
158
|
+
de,
|
|
159
|
+
{
|
|
160
|
+
...K,
|
|
161
|
+
key: u[r][l],
|
|
162
|
+
"data-key": u[r][l],
|
|
163
|
+
id: u[r][l],
|
|
164
|
+
columnPath: a.normalizedPath,
|
|
165
|
+
rowSpan: a.rowSpan || void 0,
|
|
166
|
+
colSpan: a.colSpan || void 0,
|
|
167
|
+
onIconClick: ge,
|
|
168
|
+
dataItem: a,
|
|
169
|
+
expanded: v,
|
|
170
|
+
expandable: p,
|
|
171
|
+
total: a.total,
|
|
172
|
+
first: P,
|
|
173
|
+
root: a.levelNum === 0,
|
|
174
|
+
role: "columnheader"
|
|
175
|
+
},
|
|
176
|
+
a.caption
|
|
177
|
+
) : null;
|
|
178
|
+
})
|
|
179
|
+
);
|
|
180
|
+
})))),
|
|
181
|
+
/* @__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
|
+
ue,
|
|
183
|
+
{
|
|
184
|
+
key: f(c[r].path),
|
|
185
|
+
...k,
|
|
186
|
+
path: c[r].path,
|
|
187
|
+
role: "row",
|
|
188
|
+
ariaOwns: b[r].join(" ")
|
|
189
|
+
},
|
|
190
|
+
e.cells.filter(Boolean).map(
|
|
191
|
+
(o) => o ? /* @__PURE__ */ t.createElement(
|
|
192
|
+
he,
|
|
193
|
+
{
|
|
194
|
+
...K,
|
|
195
|
+
key: f(o.normalizedPath) + (o.total ? "|[TOTAL]" : "") + (o.children && o.children.length ? "|[EXPANDED]" : ""),
|
|
196
|
+
"data-key": f(o.normalizedPath) + (o.total ? "|[TOTAL]" : "") + (o.children && o.children.length ? "|[EXPANDED]" : ""),
|
|
197
|
+
rowPath: o.normalizedPath,
|
|
198
|
+
rowSpan: o.rowSpan || void 0,
|
|
199
|
+
colSpan: o.colSpan || void 0,
|
|
200
|
+
dataItem: o,
|
|
201
|
+
expanded: !!(o.children && o.children.length),
|
|
202
|
+
expandable: o.hasChildren && !o.total,
|
|
203
|
+
total: o.total,
|
|
204
|
+
onIconClick: we,
|
|
205
|
+
root: o.levelNum === 0,
|
|
206
|
+
role: "rowheader"
|
|
207
|
+
},
|
|
208
|
+
o.caption
|
|
209
|
+
) : null
|
|
210
|
+
)
|
|
211
|
+
))))),
|
|
212
|
+
/* @__PURE__ */ t.createElement("div", { ref: E, className: "k-pivotgrid-values", onScroll: ve }, /* @__PURE__ */ t.createElement("table", { className: "k-pivotgrid-table", role: "none" }, /* @__PURE__ */ t.createElement("colgroup", null, I), /* @__PURE__ */ t.createElement("tbody", { className: "k-pivotgrid-tbody", role: "none" }, R.map((e, r) => /* @__PURE__ */ t.createElement(
|
|
213
|
+
fe,
|
|
214
|
+
{
|
|
215
|
+
key: f(c[r].path),
|
|
216
|
+
...k,
|
|
217
|
+
path: c[r].path,
|
|
218
|
+
role: "none"
|
|
219
|
+
},
|
|
220
|
+
e.cells.map(
|
|
221
|
+
(o, a) => /* @__PURE__ */ t.createElement(
|
|
222
|
+
se,
|
|
223
|
+
{
|
|
224
|
+
key: b[r][a],
|
|
225
|
+
"data-key": b[r][a],
|
|
226
|
+
id: b[r][a],
|
|
227
|
+
...me,
|
|
228
|
+
rowPath: o.rowTuple.members.map((l) => l.name),
|
|
229
|
+
columnPath: o.columnTuple.members.map((l) => l.name),
|
|
230
|
+
dataItem: o,
|
|
231
|
+
total: c[r].total || m[a].total,
|
|
232
|
+
role: "gridcell",
|
|
233
|
+
ariaDescribedby: u.map((l) => l[a]).join(" ")
|
|
234
|
+
},
|
|
235
|
+
o && o.data && o.data.fmtValue ? o.data.fmtValue : " "
|
|
236
|
+
)
|
|
237
|
+
)
|
|
238
|
+
)))))
|
|
239
|
+
);
|
|
240
|
+
}), C = {
|
|
241
|
+
rowAxes: [],
|
|
242
|
+
columnAxes: [],
|
|
243
|
+
data: [],
|
|
244
|
+
row: Ne,
|
|
245
|
+
column: Be,
|
|
246
|
+
cell: Te,
|
|
247
|
+
headerCell: De
|
|
248
|
+
};
|
|
249
|
+
Xe.displayName = "KendoReactPivotGrid";
|
|
250
|
+
export {
|
|
251
|
+
Xe as PivotGrid
|
|
252
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("react"),P=require("@progress/kendo-react-buttons"),m=require("@progress/kendo-react-common"),g=require("./EditorContext.js"),C=require("./AxisEditor.js");function R(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const t=R(x),c=t.forwardRef((e,r)=>{const{value:n,field:o}={...a,...e},s=t.useRef(null),l=t.useRef(null),u=t.useRef(null),[d,f]=m.useCustomComponent(e.chipList||a.chipList);t.useImperativeHandle(l,()=>s.current&&s.current.element),t.useImperativeHandle(u,()=>({props:e,element:l.current})),t.useImperativeHandle(r,()=>u.current);const p=n.filter(i=>i.name.length===1&&i.name.every(v=>v.indexOf("&")===-1)).map(i=>({...i,text:String(i.name)}));return t.createElement(g.PivotGridConfiguratorEditorAxesContext.Provider,{value:{axes:o}},t.createElement(d,{ref:m.canUseRef(d)?s:void 0,textField:"text",valueField:"name",data:p,chip:C.PivotGridAxisEditor,style:{position:"relative"},className:e.className,selection:"none",...f}))}),a={value:[],chipList:P.ChipList};c.defaultProps=a;c.displayName="KendoReactPivotGridAxesEditor";exports.PivotGridAxesEditor=c;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as e from "react";
|
|
10
|
+
import { ChipList as v } from "@progress/kendo-react-buttons";
|
|
11
|
+
import { useCustomComponent as x, canUseRef as h } from "@progress/kendo-react-common";
|
|
12
|
+
import { PivotGridConfiguratorEditorAxesContext as C } from "./EditorContext.mjs";
|
|
13
|
+
import { PivotGridAxisEditor as P } from "./AxisEditor.mjs";
|
|
14
|
+
const l = e.forwardRef((i, m) => {
|
|
15
|
+
const {
|
|
16
|
+
value: c,
|
|
17
|
+
field: u
|
|
18
|
+
} = { ...n, ...i }, r = e.useRef(null), o = e.useRef(null), s = e.useRef(null), [a, d] = x(i.chipList || n.chipList);
|
|
19
|
+
e.useImperativeHandle(o, () => r.current && r.current.element), e.useImperativeHandle(s, () => ({ props: i, element: o.current })), e.useImperativeHandle(m, () => s.current);
|
|
20
|
+
const p = c.filter((t) => t.name.length === 1 && t.name.every((f) => f.indexOf("&") === -1)).map((t) => ({ ...t, text: String(t.name) }));
|
|
21
|
+
return /* @__PURE__ */ e.createElement(C.Provider, { value: { axes: u } }, /* @__PURE__ */ e.createElement(
|
|
22
|
+
a,
|
|
23
|
+
{
|
|
24
|
+
ref: h(a) ? r : void 0,
|
|
25
|
+
textField: "text",
|
|
26
|
+
valueField: "name",
|
|
27
|
+
data: p,
|
|
28
|
+
chip: P,
|
|
29
|
+
style: { position: "relative" },
|
|
30
|
+
className: i.className,
|
|
31
|
+
selection: "none",
|
|
32
|
+
...d
|
|
33
|
+
}
|
|
34
|
+
));
|
|
35
|
+
}), n = {
|
|
36
|
+
value: [],
|
|
37
|
+
chipList: v
|
|
38
|
+
};
|
|
39
|
+
l.defaultProps = n;
|
|
40
|
+
l.displayName = "KendoReactPivotGridAxesEditor";
|
|
41
|
+
export {
|
|
42
|
+
l as PivotGridAxesEditor
|
|
43
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("react"),v=require("@progress/kendo-pivotgrid-common"),u=require("@progress/kendo-react-common"),A=require("@progress/kendo-react-data-tools"),H=require("@progress/kendo-react-buttons"),T=require("../utils/index.js"),B=require("./EditorContext.js"),$=require("./AxisFilterFieldsEditor.js"),K=require("../shared/PivotGridConfiguratorEditorStateContext.js"),l=require("../hooks/usePivotConfiguratorEditor.js");function Z(e){const d=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const c=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(d,s,c.get?c:{enumerable:!0,get:()=>e[s]})}}return d.default=e,Object.freeze(d)}const n=Z(z),p=n.forwardRef((e,d)=>{const s=n.useRef(0),c=n.useRef(0),f=n.useRef(null),i=n.useRef(null),R=n.useRef(null),{axes:I}=n.useContext(B.PivotGridConfiguratorEditorAxesContext),[y,x]=n.useState(!1),[r,a]=n.useContext(K.PivotGridConfiguratorEditorStateContext);n.useImperativeHandle(i,()=>f.current&&f.current.element),n.useImperativeHandle(R,()=>({props:e,element:i.current})),n.useImperativeHandle(d,()=>R.current);const[F,N]=u.useCustomComponent(e.chip||m.chip),[h,E]=u.useCustomComponent(e.dropClue||m.dropClue),[_,M]=u.useCustomComponent(e.columnMenuTextColumn||m.columnMenuTextColumn),[D,G]=u.useCustomComponent(e.filterFieldsEditor||m.filterFieldsEditor),P=T.findFilters(r.filter,String(e.value),"in"),g=T.findFilters(r.filter,String(e.value)),S=(t,o)=>{a({type:l.PIVOT_CONFIGURATOR_ACTION.setSort,payload:o},t)},b=(t,o)=>{o.length?a({type:l.PIVOT_CONFIGURATOR_ACTION.setFilter,payload:[...P||[],...o.reduce((C,O)=>[...C,...O.filters.filter(w=>w.value)],[])]},t):a({type:l.PIVOT_CONFIGURATOR_ACTION.setFilter,payload:P},t)},q=t=>{a({type:l.PIVOT_CONFIGURATOR_ACTION.remove,payload:e.dataItem},t.syntheticEvent)},U=t=>{const o=t.slice(),C=T.findFilter(r.filter,String(e.dataItem.name),"in");return o.splice(1,0,n.createElement(D,{key:"axis-filter-fields-editor",defaultFilter:C,dataItem:e.dataItem,data:e.dataItem.fields,axes:I,...G})),o},V=t=>{s.current=t.clientX,c.current=t.clientY},k=t=>{Math.abs(s.current-t.clientX)<10&&Math.abs(c.current-t.clientY)<10||(i.current&&(i.current.style.transform=`translate(${t.clientX-s.current}px, ${t.clientY-c.current}px)`),x(!0),a({type:l.PIVOT_CONFIGURATOR_ACTION.setDragItem,payload:e.dataItem}))},j=()=>{x(!1),r.dragItem&&(i.current&&(i.current.style.transform=""),a({type:l.PIVOT_CONFIGURATOR_ACTION.drop,payload:e.dataItem}))},X=t=>{r.dragItem&&(a({type:l.PIVOT_CONFIGURATOR_ACTION.setDropTarget,payload:e.dataItem},t.syntheticEvent),a({type:l.PIVOT_CONFIGURATOR_ACTION.setDropZone,payload:I},t.syntheticEvent))},Y=t=>{if(r.dragItem&&!y&&i.current){const o=i.current.getBoundingClientRect(),O=t.syntheticEvent.clientX-o.left<o.width/2?"before":"after";a({type:l.PIVOT_CONFIGURATOR_ACTION.setDropDirection,payload:O},t.syntheticEvent)}};return u.useDraggable(i,{onPress:V,onDrag:k,onRelease:j}),n.createElement(n.Fragment,null,r.dropTarget&&v.compareAxes(r.dropTarget,e.dataItem)&&r.dropDirection==="before"&&n.createElement(h,{...E}),n.createElement(F,{ref:u.canUseRef(F)?f:void 0,...e,removable:!0,onRemove:q,onMouseEnter:X,onMouseMove:Y,style:{pointerEvents:y?"none":void 0},rounded:"full",...N},e.text,I!=="measureAxes"&&n.createElement(_,{field:String(e.value),itemsRender:U,sort:r.sort,onSortChange:S,filter:g&&g.length?[{logic:"and",filters:g}]:void 0,onFilterChange:b,filterContent:[A.ColumnMenuTextFilter],...M})),r.dropTarget&&v.compareAxes(r.dropTarget,e.dataItem)&&r.dropDirection==="after"&&n.createElement(h,{...E}))}),m={chip:H.Chip,columnMenuTextColumn:A.ColumnMenuTextColumn,filterFieldsEditor:$.PivotGridAxisFilterFieldsEditor,dropClue:e=>n.createElement("div",{className:"k-grouping-dropclue",style:{position:"relative",zIndex:1e4},...e})};p.defaultProps=m;p.displayName="KendoReactPivotGridAxisEditor";exports.PivotGridAxisEditor=p;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as r from "react";
|
|
10
|
+
import { compareAxes as R } from "@progress/kendo-pivotgrid-common";
|
|
11
|
+
import { useCustomComponent as c, useDraggable as $, canUseRef as B } from "@progress/kendo-react-common";
|
|
12
|
+
import { ColumnMenuTextFilter as K, ColumnMenuTextColumn as V } from "@progress/kendo-react-data-tools";
|
|
13
|
+
import { Chip as Z } from "@progress/kendo-react-buttons";
|
|
14
|
+
import { findFilters as M, findFilter as j } from "../utils/index.mjs";
|
|
15
|
+
import { PivotGridConfiguratorEditorAxesContext as q } from "./EditorContext.mjs";
|
|
16
|
+
import { PivotGridAxisFilterFieldsEditor as J } from "./AxisFilterFieldsEditor.mjs";
|
|
17
|
+
import { PivotGridConfiguratorEditorStateContext as L } from "../shared/PivotGridConfiguratorEditorStateContext.mjs";
|
|
18
|
+
import { PIVOT_CONFIGURATOR_ACTION as a } from "../hooks/usePivotConfiguratorEditor.mjs";
|
|
19
|
+
const T = r.forwardRef((t, P) => {
|
|
20
|
+
const u = r.useRef(0), m = r.useRef(0), f = r.useRef(null), i = r.useRef(null), h = r.useRef(null), { axes: p } = r.useContext(q), [y, x] = r.useState(!1), [n, l] = r.useContext(L);
|
|
21
|
+
r.useImperativeHandle(i, () => f.current && f.current.element), r.useImperativeHandle(h, () => ({ props: t, element: i.current })), r.useImperativeHandle(P, () => h.current);
|
|
22
|
+
const [E, D] = c(t.chip || s.chip), [v, F] = c(t.dropClue || s.dropClue), [S, A] = c(t.columnMenuTextColumn || s.columnMenuTextColumn), [b, G] = c(t.filterFieldsEditor || s.filterFieldsEditor), I = M(n.filter, String(t.value), "in"), C = M(n.filter, String(t.value)), X = (e, o) => {
|
|
23
|
+
l({ type: a.setSort, payload: o }, e);
|
|
24
|
+
}, N = (e, o) => {
|
|
25
|
+
o.length ? l({
|
|
26
|
+
type: a.setFilter,
|
|
27
|
+
payload: [
|
|
28
|
+
...I || [],
|
|
29
|
+
...o.reduce((d, g) => [
|
|
30
|
+
...d,
|
|
31
|
+
...g.filters.filter((_) => _.value)
|
|
32
|
+
], [])
|
|
33
|
+
]
|
|
34
|
+
}, e) : l({ type: a.setFilter, payload: I }, e);
|
|
35
|
+
}, O = (e) => {
|
|
36
|
+
l({ type: a.remove, payload: t.dataItem }, e.syntheticEvent);
|
|
37
|
+
}, Y = (e) => {
|
|
38
|
+
const o = e.slice(), d = j(n.filter, String(t.dataItem.name), "in");
|
|
39
|
+
return o.splice(1, 0, /* @__PURE__ */ r.createElement(
|
|
40
|
+
b,
|
|
41
|
+
{
|
|
42
|
+
key: "axis-filter-fields-editor",
|
|
43
|
+
defaultFilter: d,
|
|
44
|
+
dataItem: t.dataItem,
|
|
45
|
+
data: t.dataItem.fields,
|
|
46
|
+
axes: p,
|
|
47
|
+
...G
|
|
48
|
+
}
|
|
49
|
+
)), o;
|
|
50
|
+
}, H = (e) => {
|
|
51
|
+
u.current = e.clientX, m.current = e.clientY;
|
|
52
|
+
}, k = (e) => {
|
|
53
|
+
Math.abs(u.current - e.clientX) < 10 && Math.abs(m.current - e.clientY) < 10 || (i.current && (i.current.style.transform = `translate(${e.clientX - u.current}px, ${e.clientY - m.current}px)`), x(!0), l({ type: a.setDragItem, payload: t.dataItem }));
|
|
54
|
+
}, w = () => {
|
|
55
|
+
x(!1), n.dragItem && (i.current && (i.current.style.transform = ""), l({ type: a.drop, payload: t.dataItem }));
|
|
56
|
+
}, z = (e) => {
|
|
57
|
+
n.dragItem && (l({ type: a.setDropTarget, payload: t.dataItem }, e.syntheticEvent), l({ type: a.setDropZone, payload: p }, e.syntheticEvent));
|
|
58
|
+
}, U = (e) => {
|
|
59
|
+
if (n.dragItem && !y && i.current) {
|
|
60
|
+
const o = i.current.getBoundingClientRect(), g = e.syntheticEvent.clientX - o.left < o.width / 2 ? "before" : "after";
|
|
61
|
+
l({ type: a.setDropDirection, payload: g }, e.syntheticEvent);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
return $(i, {
|
|
65
|
+
onPress: H,
|
|
66
|
+
onDrag: k,
|
|
67
|
+
onRelease: w
|
|
68
|
+
}), /* @__PURE__ */ r.createElement(r.Fragment, null, n.dropTarget && R(n.dropTarget, t.dataItem) && n.dropDirection === "before" && /* @__PURE__ */ r.createElement(v, { ...F }), /* @__PURE__ */ r.createElement(
|
|
69
|
+
E,
|
|
70
|
+
{
|
|
71
|
+
ref: B(E) ? f : void 0,
|
|
72
|
+
...t,
|
|
73
|
+
removable: !0,
|
|
74
|
+
onRemove: O,
|
|
75
|
+
onMouseEnter: z,
|
|
76
|
+
onMouseMove: U,
|
|
77
|
+
style: { pointerEvents: y ? "none" : void 0 },
|
|
78
|
+
rounded: "full",
|
|
79
|
+
...D
|
|
80
|
+
},
|
|
81
|
+
t.text,
|
|
82
|
+
p !== "measureAxes" && /* @__PURE__ */ r.createElement(
|
|
83
|
+
S,
|
|
84
|
+
{
|
|
85
|
+
field: String(t.value),
|
|
86
|
+
itemsRender: Y,
|
|
87
|
+
sort: n.sort,
|
|
88
|
+
onSortChange: X,
|
|
89
|
+
filter: C && C.length ? [{ logic: "and", filters: C }] : void 0,
|
|
90
|
+
onFilterChange: N,
|
|
91
|
+
filterContent: [
|
|
92
|
+
K
|
|
93
|
+
],
|
|
94
|
+
...A
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
), n.dropTarget && R(n.dropTarget, t.dataItem) && n.dropDirection === "after" && /* @__PURE__ */ r.createElement(v, { ...F }));
|
|
98
|
+
}), s = {
|
|
99
|
+
chip: Z,
|
|
100
|
+
columnMenuTextColumn: V,
|
|
101
|
+
filterFieldsEditor: J,
|
|
102
|
+
dropClue: (t) => /* @__PURE__ */ r.createElement("div", { className: "k-grouping-dropclue", style: { position: "relative", zIndex: 1e4 }, ...t })
|
|
103
|
+
};
|
|
104
|
+
T.defaultProps = s;
|
|
105
|
+
T.displayName = "KendoReactPivotGridAxisEditor";
|
|
106
|
+
export {
|
|
107
|
+
T as PivotGridAxisEditor
|
|
108
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("react"),Y=require("@progress/kendo-react-treeview"),N=require("@progress/kendo-react-buttons"),Z=require("@progress/kendo-react-indicators"),ee=require("@progress/kendo-react-intl"),O=require("@progress/kendo-react-data-tools"),r=require("@progress/kendo-react-common"),te=require("@progress/kendo-svg-icons"),C=require("../utils/index.js"),s=require("../messages/index.js"),ne=require("../shared/PivotGridConfiguratorEditorEventsContext.js"),oe=require("../shared/PivotGridConfiguratorEditorStateContext.js"),S=require("../hooks/useExpansion.js"),g=require("../hooks/usePivotConfiguratorEditor.js");function ae(n){const u=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const l in n)if(l!=="default"){const d=Object.getOwnPropertyDescriptor(n,l);Object.defineProperty(u,l,d.get?d:{enumerable:!0,get:()=>n[l]})}}return u.default=n,Object.freeze(u)}const t=ae(W),I=t.forwardRef((n,u)=>{const{data:l,dataItem:d,defaultFilter:F}={...i,...n},y=t.useRef(null),m=t.useRef(null),v=ee.useLocalization(),[q,A]=r.useCustomComponent(n.columnMenuItem||i.columnMenuItem),[T,w]=r.useCustomComponent(n.columnMenuForm||i.columnMenuForm),[B,b]=r.useCustomComponent(n.resetButton||i.resetButton),[_,G]=r.useCustomComponent(n.applyButton||i.applyButton),[V,D]=r.useCustomComponent(n.treeView||i.treeView),[j,L]=r.useCustomComponent(n.noData||i.noData);t.useImperativeHandle(m,()=>({props:n,element:y.current})),t.useImperativeHandle(u,()=>m.current);const[h,f]=t.useState(!1),{onAxisFilterFieldsExpandChange:k,onAxisFilterFieldExpand:E}=t.useContext(ne.PivotGridConfiguratorEditorEventsContext),[,x]=t.useContext(oe.PivotGridConfiguratorEditorStateContext),[c,z]=t.useState(F),P=c?c.value.split(","):[],[H,U]=S.useExpansion([],void 0,m,C.compareFields),R={caption:e=>e.dataItem.caption,id:e=>e.dataItem.uniqueName,parent:(e,a)=>a&&a.value,value:e=>e.dataItem.defaultHierarchy||e.dataItem.uniqueName,expanded:e=>H.some(a=>a.uniqueName===e.id),checked:e=>!P.length||(P||[]).some(a=>a===e.dataItem.uniqueName),hasChildren:e=>parseInt(e.dataItem.childrenCardinality,10)>0,children:e=>C.recursiveMap(e.dataItem.children,R,e),checkIndeterminate:e=>{const a=(e.children||[]).length&&e.children.every(o=>o.checked);return a&&(e.checked=!0),(e.children||[]).some(o=>o.checked)&&!a}},p=C.recursiveMap(l,R),M=C.flatMap(p),K=e=>{f(!h),k&&k({value:!h,target:m.current,syntheticEvent:e})},X=e=>{U({type:S.EXPANSION_ACTION.toggle,payload:e.item.dataItem},e.syntheticEvent),E&&E({value:e.item.dataItem,target:m.current,syntheticEvent:e.syntheticEvent})},$=e=>{let a;e.item.checked?a={field:String(d.name),operator:"in",value:M.filter(o=>o.checked).map(o=>String(o.value)).filter(o=>o!==e.item.value&&o!==e.item.parent).join(",")}:a={field:String(d.name),operator:"in",value:M.filter(o=>o.checked).map(o=>String(o.value)).concat([e.item.value]).join(",")},z(a)},J=e=>{f(!1),c&&x({type:g.PIVOT_CONFIGURATOR_ACTION.removeFilter,payload:c},e)},Q=e=>{f(!1),c&&x({type:F?g.PIVOT_CONFIGURATOR_ACTION.changeFilter:g.PIVOT_CONFIGURATOR_ACTION.addFilter,payload:c},e)};return t.createElement("div",{ref:y,id:n.id,tabIndex:n.tabIndex,style:n.style,className:r.classNames("k-columnmenu-item-wrapper",n.className)},t.createElement(q,{...A,title:"Include Fields",iconClass:"k-i-grid-layout",svgIcon:te.gridLayoutIcon,onClick:K}),t.createElement(T,{show:h,actions:t.createElement(t.Fragment,null,t.createElement(B,{type:"reset",onClick:J,...b},v.toLanguageString(s.fieldMenuReset,s.messages[s.fieldMenuReset])),t.createElement(_,{themeColor:"primary",onClick:Q,...G},v.toLanguageString(s.fieldMenuApply,s.messages[s.fieldMenuApply]))),...w},p&&p.length?t.createElement(V,{data:p,checkboxes:!0,onExpandChange:X,onCheckChange:$,textField:"caption",expandIcons:!0,hasChildrenField:"hasChildren",checkIndeterminateField:"checkIndeterminate",childrenField:"children",...D}):t.createElement(j,{...L})))}),i={data:[],resetButton:N.Button,applyButton:N.Button,treeView:Y.TreeView,noData:()=>t.createElement(Z.Skeleton,{shape:"rectangle",style:{height:"20px",width:"calc(100% - 16px)",margin:8}}),columnMenuItem:O.ColumnMenuItem,columnMenuForm:O.ColumnMenuForm};I.defaultProps=i;I.displayName="KendoReactPivotGridAxisFilterFieldsEditor";exports.PivotGridAxisFilterFieldsEditor=I;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as t from "react";
|
|
10
|
+
import { TreeView as Y } from "@progress/kendo-react-treeview";
|
|
11
|
+
import { Button as k } from "@progress/kendo-react-buttons";
|
|
12
|
+
import { Skeleton as Z } from "@progress/kendo-react-indicators";
|
|
13
|
+
import { useLocalization as $ } from "@progress/kendo-react-intl";
|
|
14
|
+
import { ColumnMenuItem as ee, ColumnMenuForm as te } from "@progress/kendo-react-data-tools";
|
|
15
|
+
import { useCustomComponent as l, classNames as ne } from "@progress/kendo-react-common";
|
|
16
|
+
import { gridLayoutIcon as ae } from "@progress/kendo-svg-icons";
|
|
17
|
+
import { recursiveMap as v, flatMap as oe, compareFields as ie } from "../utils/index.mjs";
|
|
18
|
+
import { fieldMenuReset as M, messages as N, fieldMenuApply as P } from "../messages/index.mjs";
|
|
19
|
+
import { PivotGridConfiguratorEditorEventsContext as re } from "../shared/PivotGridConfiguratorEditorEventsContext.mjs";
|
|
20
|
+
import { PivotGridConfiguratorEditorStateContext as le } from "../shared/PivotGridConfiguratorEditorStateContext.mjs";
|
|
21
|
+
import { useExpansion as ce, EXPANSION_ACTION as me } from "../hooks/useExpansion.mjs";
|
|
22
|
+
import { PIVOT_CONFIGURATOR_ACTION as u } from "../hooks/usePivotConfiguratorEditor.mjs";
|
|
23
|
+
const S = t.forwardRef(
|
|
24
|
+
(o, w) => {
|
|
25
|
+
const {
|
|
26
|
+
data: A,
|
|
27
|
+
dataItem: p,
|
|
28
|
+
defaultFilter: h
|
|
29
|
+
} = { ...i, ...o }, f = t.useRef(null), c = t.useRef(null), C = $(), [B, R] = l(o.columnMenuItem || i.columnMenuItem), [T, V] = l(o.columnMenuForm || i.columnMenuForm), [O, D] = l(o.resetButton || i.resetButton), [G, q] = l(o.applyButton || i.applyButton), [L, _] = l(o.treeView || i.treeView), [b, H] = l(o.noData || i.noData);
|
|
30
|
+
t.useImperativeHandle(c, () => ({ props: o, element: f.current })), t.useImperativeHandle(w, () => c.current);
|
|
31
|
+
const [s, d] = t.useState(!1), {
|
|
32
|
+
onAxisFilterFieldsExpandChange: I,
|
|
33
|
+
onAxisFilterFieldExpand: g
|
|
34
|
+
} = t.useContext(re), [, F] = t.useContext(le), [r, j] = t.useState(h), y = r ? r.value.split(",") : [], [z, K] = ce(
|
|
35
|
+
[],
|
|
36
|
+
void 0,
|
|
37
|
+
c,
|
|
38
|
+
ie
|
|
39
|
+
), x = {
|
|
40
|
+
caption: (e) => e.dataItem.caption,
|
|
41
|
+
id: (e) => e.dataItem.uniqueName,
|
|
42
|
+
parent: (e, a) => a && a.value,
|
|
43
|
+
value: (e) => e.dataItem.defaultHierarchy || e.dataItem.uniqueName,
|
|
44
|
+
expanded: (e) => z.some((a) => a.uniqueName === e.id),
|
|
45
|
+
checked: (e) => !y.length || (y || []).some((a) => a === e.dataItem.uniqueName),
|
|
46
|
+
hasChildren: (e) => parseInt(e.dataItem.childrenCardinality, 10) > 0,
|
|
47
|
+
children: (e) => v(e.dataItem.children, x, e),
|
|
48
|
+
checkIndeterminate: (e) => {
|
|
49
|
+
const a = (e.children || []).length && e.children.every((n) => n.checked);
|
|
50
|
+
return a && (e.checked = !0), (e.children || []).some((n) => n.checked) && !a;
|
|
51
|
+
}
|
|
52
|
+
}, m = v(A, x), E = oe(m), U = (e) => {
|
|
53
|
+
d(!s), I && I({
|
|
54
|
+
value: !s,
|
|
55
|
+
target: c.current,
|
|
56
|
+
syntheticEvent: e
|
|
57
|
+
});
|
|
58
|
+
}, X = (e) => {
|
|
59
|
+
K({ type: me.toggle, payload: e.item.dataItem }, e.syntheticEvent), g && g({
|
|
60
|
+
value: e.item.dataItem,
|
|
61
|
+
target: c.current,
|
|
62
|
+
syntheticEvent: e.syntheticEvent
|
|
63
|
+
});
|
|
64
|
+
}, J = (e) => {
|
|
65
|
+
let a;
|
|
66
|
+
e.item.checked ? a = {
|
|
67
|
+
field: String(p.name),
|
|
68
|
+
operator: "in",
|
|
69
|
+
value: E.filter((n) => n.checked).map((n) => String(n.value)).filter((n) => n !== e.item.value && n !== e.item.parent).join(",")
|
|
70
|
+
} : a = {
|
|
71
|
+
field: String(p.name),
|
|
72
|
+
operator: "in",
|
|
73
|
+
value: E.filter((n) => n.checked).map((n) => String(n.value)).concat([e.item.value]).join(",")
|
|
74
|
+
}, j(a);
|
|
75
|
+
}, Q = (e) => {
|
|
76
|
+
d(!1), r && F({
|
|
77
|
+
type: u.removeFilter,
|
|
78
|
+
payload: r
|
|
79
|
+
}, e);
|
|
80
|
+
}, W = (e) => {
|
|
81
|
+
d(!1), r && F({
|
|
82
|
+
type: h ? u.changeFilter : u.addFilter,
|
|
83
|
+
payload: r
|
|
84
|
+
}, e);
|
|
85
|
+
};
|
|
86
|
+
return /* @__PURE__ */ t.createElement(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
ref: f,
|
|
90
|
+
id: o.id,
|
|
91
|
+
tabIndex: o.tabIndex,
|
|
92
|
+
style: o.style,
|
|
93
|
+
className: ne("k-columnmenu-item-wrapper", o.className)
|
|
94
|
+
},
|
|
95
|
+
/* @__PURE__ */ t.createElement(
|
|
96
|
+
B,
|
|
97
|
+
{
|
|
98
|
+
...R,
|
|
99
|
+
title: "Include Fields",
|
|
100
|
+
iconClass: "k-i-grid-layout",
|
|
101
|
+
svgIcon: ae,
|
|
102
|
+
onClick: U
|
|
103
|
+
}
|
|
104
|
+
),
|
|
105
|
+
/* @__PURE__ */ t.createElement(
|
|
106
|
+
T,
|
|
107
|
+
{
|
|
108
|
+
show: s,
|
|
109
|
+
actions: /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
|
|
110
|
+
O,
|
|
111
|
+
{
|
|
112
|
+
type: "reset",
|
|
113
|
+
onClick: Q,
|
|
114
|
+
...D
|
|
115
|
+
},
|
|
116
|
+
C.toLanguageString(M, N[M])
|
|
117
|
+
), /* @__PURE__ */ t.createElement(
|
|
118
|
+
G,
|
|
119
|
+
{
|
|
120
|
+
themeColor: "primary",
|
|
121
|
+
onClick: W,
|
|
122
|
+
...q
|
|
123
|
+
},
|
|
124
|
+
C.toLanguageString(P, N[P])
|
|
125
|
+
)),
|
|
126
|
+
...V
|
|
127
|
+
},
|
|
128
|
+
m && m.length ? /* @__PURE__ */ t.createElement(
|
|
129
|
+
L,
|
|
130
|
+
{
|
|
131
|
+
data: m,
|
|
132
|
+
checkboxes: !0,
|
|
133
|
+
onExpandChange: X,
|
|
134
|
+
onCheckChange: J,
|
|
135
|
+
textField: "caption",
|
|
136
|
+
expandIcons: !0,
|
|
137
|
+
hasChildrenField: "hasChildren",
|
|
138
|
+
checkIndeterminateField: "checkIndeterminate",
|
|
139
|
+
childrenField: "children",
|
|
140
|
+
..._
|
|
141
|
+
}
|
|
142
|
+
) : /* @__PURE__ */ t.createElement(b, { ...H })
|
|
143
|
+
)
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
), i = {
|
|
147
|
+
data: [],
|
|
148
|
+
resetButton: k,
|
|
149
|
+
applyButton: k,
|
|
150
|
+
treeView: Y,
|
|
151
|
+
noData: () => /* @__PURE__ */ t.createElement(Z, { shape: "rectangle", style: { height: "20px", width: "calc(100% - 16px)", margin: 8 } }),
|
|
152
|
+
columnMenuItem: ee,
|
|
153
|
+
columnMenuForm: te
|
|
154
|
+
};
|
|
155
|
+
S.defaultProps = i;
|
|
156
|
+
S.displayName = "KendoReactPivotGridAxisFilterFieldsEditor";
|
|
157
|
+
export {
|
|
158
|
+
S as PivotGridAxisFilterFieldsEditor
|
|
159
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),r=require("@progress/kendo-react-common");function d(e){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(l,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return l.default=e,Object.freeze(l)}const a=d(o),c=a.forwardRef((e,l)=>{const t=a.useRef(null),n=a.useRef(null);a.useImperativeHandle(t,()=>({element:n.current,props:e})),a.useImperativeHandle(l,()=>t.current);const i=r.useMouse(e,t);return a.createElement("td",{ref:n,...i,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)});c.displayName="KendoReactPivotGridCell";exports.PivotGridCell=c;
|