@progress/kendo-react-pivotgrid 7.2.4-develop.3 → 7.3.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PivotGrid.js +8 -0
- package/PivotGrid.mjs +252 -0
- package/components/AxesEditor.js +8 -0
- package/components/AxesEditor.mjs +43 -0
- package/components/AxisEditor.js +8 -0
- package/components/AxisEditor.mjs +108 -0
- package/components/AxisFilterFieldsEditor.js +8 -0
- package/components/AxisFilterFieldsEditor.mjs +159 -0
- package/components/Cell.js +8 -0
- package/components/Cell.mjs +45 -0
- package/components/Column.js +8 -0
- package/components/Column.mjs +40 -0
- package/components/Configurator.js +8 -0
- package/components/Configurator.mjs +134 -0
- package/components/ConfiguratorButton.js +8 -0
- package/components/ConfiguratorButton.mjs +42 -0
- package/components/ConfiguratorEditor.js +8 -0
- package/components/ConfiguratorEditor.mjs +240 -0
- package/components/Container.js +8 -0
- package/components/Container.mjs +40 -0
- package/components/EditorContext.js +8 -0
- package/components/EditorContext.mjs +13 -0
- package/components/FieldsEditor.js +8 -0
- package/components/FieldsEditor.mjs +78 -0
- package/components/HeaderCell.js +8 -0
- package/components/HeaderCell.mjs +69 -0
- package/components/Row.js +8 -0
- package/components/Row.mjs +42 -0
- package/dist/cdn/js/kendo-react-pivotgrid.js +8 -5
- package/hooks/useExpansion.js +8 -0
- package/hooks/useExpansion.mjs +46 -0
- package/hooks/useHeaders.js +8 -0
- package/hooks/useHeaders.mjs +18 -0
- package/hooks/useHorizontalScrollSync.js +8 -0
- package/hooks/useHorizontalScrollSync.mjs +25 -0
- package/hooks/usePivotConfiguratorEditor.js +8 -0
- package/hooks/usePivotConfiguratorEditor.mjs +67 -0
- package/hooks/usePivotLocalDataService.js +8 -0
- package/hooks/usePivotLocalDataService.mjs +94 -0
- package/hooks/usePivotOLAPService.js +8 -0
- package/hooks/usePivotOLAPService.mjs +230 -0
- package/hooks/useVerticalScrollSync.js +8 -0
- package/hooks/useVerticalScrollSync.mjs +25 -0
- package/index.d.mts +1342 -5
- package/index.d.ts +1342 -22
- package/index.js +8 -5
- package/index.mjs +46 -1583
- package/messages/index.js +8 -0
- package/messages/index.mjs +39 -0
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +19 -0
- package/package.json +9 -9
- package/shared/PivotGridConfiguratorEditorEventsContext.js +8 -0
- package/shared/PivotGridConfiguratorEditorEventsContext.mjs +13 -0
- package/shared/PivotGridConfiguratorEditorStateContext.js +8 -0
- package/shared/PivotGridConfiguratorEditorStateContext.mjs +28 -0
- package/utils/index.js +8 -0
- package/utils/index.mjs +59 -0
- package/PivotGrid.d.ts +0 -181
- package/components/AxesEditor.d.ts +0 -44
- package/components/AxisEditor.d.ts +0 -56
- package/components/AxisFilterFieldsEditor.d.ts +0 -118
- package/components/Cell.d.ts +0 -69
- package/components/Column.d.ts +0 -46
- package/components/Configurator.d.ts +0 -129
- package/components/ConfiguratorButton.d.ts +0 -44
- package/components/ConfiguratorEditor.d.ts +0 -130
- package/components/Container.d.ts +0 -50
- package/components/EditorContext.d.ts +0 -11
- package/components/FieldsEditor.d.ts +0 -78
- package/components/HeaderCell.d.ts +0 -100
- package/components/Row.d.ts +0 -54
- package/hooks/index.d.ts +0 -6
- package/hooks/useExpansion.d.ts +0 -23
- package/hooks/useHeaders.d.ts +0 -16
- package/hooks/useHorizontalScrollSync.d.ts +0 -9
- package/hooks/usePivotConfiguratorEditor.d.ts +0 -87
- package/hooks/usePivotLocalDataService.d.ts +0 -83
- package/hooks/usePivotOLAPService.d.ts +0 -45
- package/hooks/useVerticalScrollSync.d.ts +0 -9
- package/messages/index.d.ts +0 -74
- package/models/index.d.ts +0 -48
- package/package-metadata.d.ts +0 -9
- package/shared/PivotGridConfiguratorEditorEventsContext.d.ts +0 -17
- package/shared/PivotGridConfiguratorEditorStateContext.d.ts +0 -10
- package/shared/index.d.ts +0 -6
- package/utils/index.d.ts +0 -51
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react"),u=require("@progress/kendo-pivotgrid-common");function q(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const s=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(n,a,s.get?s:{enumerable:!0,get:()=>e[a]})}}return n.default=e,Object.freeze(n)}const t=q(_),z="aggregate",B="columns",M={dataField:z,columnsData:B},m="&",b=e=>{const[n,a]=t.useState(!0),[s,w]=t.useState(e.defaultColumnAxes||[]),[r,D]=t.useState(e.defaultRowAxes||[]),[d,P]=t.useState(e.defaultMeasureAxes||[]),[S,F]=t.useState(e.defaultSort||[]),[f,y]=t.useState(e.defaultFilter||[]),[h,R]=t.useState(new Map),v=t.useCallback(o=>{D(o.value)},[]),p=t.useCallback(o=>{w(o.value)},[]),j=o=>{P(o.value)},k=o=>{F(o.value)},L=o=>{y(o.value)},g=t.useMemo(()=>Array.from(u.rootFields(s).keys()).join(m),[s]),A=t.useMemo(()=>Array.from(u.rootFields(r).keys()).join(m),[r]),c=t.useCallback(o=>({key:o,...e.dimensions[o]}),[e.dimensions]),l=t.useMemo(()=>g?g.split(m).map(c):[],[g,c]),i=t.useMemo(()=>A?A.split(m).map(c):[],[A,c]),C=t.useMemo(()=>d.map(o=>e.measures.find(T=>String(T.name)===String(o.name))).filter(Boolean),[d,e.measures]);t.useEffect(()=>{a(!0),setTimeout(()=>{const o=u.createDataTree(e.data,i,l,C,M,f);R(o),a(!1)},0)},[e.data,i,l,C,f]);const O=t.useMemo(()=>u.createFlatSchemaDimensions(e.dimensions,e.measures),[e.dimensions,e.measures]),x=t.useMemo(()=>u.createLocalDataState({dataTree:h,rowSettings:i,columnSettings:l,rowAxes:r,columnAxes:s,measures:C,sort:S,fields:M}),[s,l,h,r,i,S]);return{pivotProps:{rowAxes:r,columnAxes:s,data:x.data,rows:x.rows,columns:x.columns,onRowAxesChange:v,onColumnAxesChange:p},configuratorProps:{sort:S,onSortChange:k,filter:f,onFilterChange:L,data:O,rowAxes:r,columnAxes:s,measureAxes:d,onRowAxesChange:v,onColumnAxesChange:p,onMeasureAxesChange:j},state:{loading:n}}},E=e=>{const n=b(e);return e.children(n)};exports.PivotLocalDataService=E;exports.usePivotLocalDataService=b;
|
|
@@ -0,0 +1,94 @@
|
|
|
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 { rootFields as p, createDataTree as B, createFlatSchemaDimensions as E, createLocalDataState as q } from "@progress/kendo-pivotgrid-common";
|
|
11
|
+
const z = "aggregate", G = "columns", w = { dataField: z, columnsData: G }, r = "&", H = (e) => {
|
|
12
|
+
const [c, h] = t.useState(!0), [o, v] = t.useState(e.defaultColumnAxes || []), [a, D] = t.useState(e.defaultRowAxes || []), [i, F] = t.useState(e.defaultMeasureAxes || []), [m, R] = t.useState(e.defaultSort || []), [d, b] = t.useState(e.defaultFilter || []), [f, k] = t.useState(/* @__PURE__ */ new Map()), g = t.useCallback((s) => {
|
|
13
|
+
D(s.value);
|
|
14
|
+
}, []), M = t.useCallback((s) => {
|
|
15
|
+
v(s.value);
|
|
16
|
+
}, []), L = (s) => {
|
|
17
|
+
F(s.value);
|
|
18
|
+
}, P = (s) => {
|
|
19
|
+
R(s.value);
|
|
20
|
+
}, T = (s) => {
|
|
21
|
+
b(s.value);
|
|
22
|
+
}, S = t.useMemo(() => Array.from(p(o).keys()).join(r), [o]), A = t.useMemo(() => Array.from(p(a).keys()).join(r), [a]), n = t.useCallback(
|
|
23
|
+
(s) => ({ key: s, ...e.dimensions[s] }),
|
|
24
|
+
[e.dimensions]
|
|
25
|
+
), u = t.useMemo(
|
|
26
|
+
() => S ? S.split(r).map(n) : [],
|
|
27
|
+
[S, n]
|
|
28
|
+
), l = t.useMemo(
|
|
29
|
+
() => A ? A.split(r).map(n) : [],
|
|
30
|
+
[A, n]
|
|
31
|
+
), x = t.useMemo(
|
|
32
|
+
() => i.map((s) => e.measures.find((j) => String(j.name) === String(s.name))).filter(Boolean),
|
|
33
|
+
[i, e.measures]
|
|
34
|
+
);
|
|
35
|
+
t.useEffect(
|
|
36
|
+
() => {
|
|
37
|
+
h(!0), setTimeout(() => {
|
|
38
|
+
const s = B(e.data, l, u, x, w, d);
|
|
39
|
+
k(s), h(!1);
|
|
40
|
+
}, 0);
|
|
41
|
+
},
|
|
42
|
+
[e.data, l, u, x, d]
|
|
43
|
+
);
|
|
44
|
+
const y = t.useMemo(
|
|
45
|
+
() => E(e.dimensions, e.measures),
|
|
46
|
+
[e.dimensions, e.measures]
|
|
47
|
+
), C = t.useMemo(
|
|
48
|
+
() => q({
|
|
49
|
+
dataTree: f,
|
|
50
|
+
rowSettings: l,
|
|
51
|
+
columnSettings: u,
|
|
52
|
+
rowAxes: a,
|
|
53
|
+
columnAxes: o,
|
|
54
|
+
measures: x,
|
|
55
|
+
sort: m,
|
|
56
|
+
fields: w
|
|
57
|
+
}),
|
|
58
|
+
[o, u, f, a, l, m]
|
|
59
|
+
);
|
|
60
|
+
return {
|
|
61
|
+
pivotProps: {
|
|
62
|
+
rowAxes: a,
|
|
63
|
+
columnAxes: o,
|
|
64
|
+
data: C.data,
|
|
65
|
+
rows: C.rows,
|
|
66
|
+
columns: C.columns,
|
|
67
|
+
onRowAxesChange: g,
|
|
68
|
+
onColumnAxesChange: M
|
|
69
|
+
},
|
|
70
|
+
configuratorProps: {
|
|
71
|
+
sort: m,
|
|
72
|
+
onSortChange: P,
|
|
73
|
+
filter: d,
|
|
74
|
+
onFilterChange: T,
|
|
75
|
+
data: y,
|
|
76
|
+
rowAxes: a,
|
|
77
|
+
columnAxes: o,
|
|
78
|
+
measureAxes: i,
|
|
79
|
+
onRowAxesChange: g,
|
|
80
|
+
onColumnAxesChange: M,
|
|
81
|
+
onMeasureAxesChange: L
|
|
82
|
+
},
|
|
83
|
+
state: {
|
|
84
|
+
loading: c
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}, J = (e) => {
|
|
88
|
+
const c = H(e);
|
|
89
|
+
return e.children(c);
|
|
90
|
+
};
|
|
91
|
+
export {
|
|
92
|
+
J as PivotLocalDataService,
|
|
93
|
+
H as usePivotLocalDataService
|
|
94
|
+
};
|
|
@@ -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 H=require("react"),d=require("@progress/kendo-pivotgrid-common"),$=require("@progress/kendo-react-common");function B(e){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const h=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(l,i,h.get?h:{enumerable:!0,get:()=>e[i]})}}return l.default=e,Object.freeze(l)}const m=B(H),y=e=>{const[l,i]=m.useState(!0),[h,O]=m.useState({data:[],columns:[],rows:[]}),[q,v]=m.useState([]),[f,b]=m.useState(e.defaultColumnAxes||[]),[x,A]=m.useState(e.defaultRowAxes||[]),[p,N]=m.useState(e.defaultMeasureAxes||[]),[S,U]=m.useState(e.defaultSort||[]),[g,D]=m.useState(e.defaultFilter||[]),C=t=>{A(t.value)},P=t=>{b(t.value)},M=t=>{N(t.value)},E=t=>{U(t.value)},I=t=>{D(t.value)};m.useEffect(()=>{i(!0);const t={connection:{catalog:e.catalog,cube:e.cube},columnAxes:f.slice(),rowAxes:x.slice(),measureAxes:p,sort:S,filter:g};setTimeout(()=>{d.fetchData({url:e.url},$.clone(t)).then(d.createDataState).then(o=>{O(o),i(!1)})})},[f,x,p,g,S,e.cube,e.catalog,e.url]),m.useEffect(()=>{i(!0);const t={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube},command:"schemaDimensions"};d.fetchDiscover({url:e.url},t).then(o=>{d.addKPI(o),v(o),i(!1)})},[e.catalog,e.cube,e.url]);const w=(t=[],o)=>{for(let n=0;n<t.length;n++){const c=t[n];if(String(c.name)===String(o.name))return c}return null},F=(t=[],o)=>{for(let n=0;n<t.length;n++){const c=t[n];if(c.uniqueName===o.uniqueName)return c;let a=F(c.children,o);if(a!==null)return a}return null},L=async t=>{let o,n,c,a,s,u;t.name&&(o="schemaMembers",a=`${String(t.name)}.[(ALL)]`);const r={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube,hierarchyUniqueName:c,dimensionUniqueName:n,levelUniqueName:a,memberUniqueName:s,treeOp:u},command:o};return d.fetchDiscover({url:e.url},r)},R=async t=>{let o,n,c,a,s,u;t.uniqueName&&(o="schemaMembers",s=t.uniqueName.replace(/\&/g,"&"),u=1);const r={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube,hierarchyUniqueName:c,dimensionUniqueName:n,levelUniqueName:a,memberUniqueName:s,treeOp:u},command:o};return d.fetchDiscover({url:e.url},r)},K=async t=>{let o,n,c,a,s,u;t.type===2?o="schemaMeasures":t.dimensionUniqueName?(o="schemaLevels",c=t.uniqueName):(o="schemaHierarchies",n=t.uniqueName);const r={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube,hierarchyUniqueName:c,dimensionUniqueName:n,levelUniqueName:a,memberUniqueName:s,treeOp:u},command:o};return d.fetchDiscover({url:e.url},r)},j=async()=>{const t={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube},command:"schemaKPIs"};return d.fetchDiscover({url:e.url},t)},k=async t=>{const o=q.slice(),n=F(o,t.value);if(n&&n.uniqueName==="[KPIs]"){const c=J(await j());n.children=c}else if(n&&n.type==="kpi")n.children=d.buildKPIMeasures(n);else if(n&&!n.children){const c=await K(n);n.children=c}v(o)},T=async t=>{if(!t)return;const o={rowAxes:[x,A],columnAxes:[f,b],measureAxes:[p,N]},[n,c]=o[t.target.props.axes],a=n.slice(),s=w(a,t.target.props.dataItem);if(s&&!s.fields){const u=await L(s);s.fields=u,c(a)}},_=async t=>{if(!t)return;const o={rowAxes:[x,A],columnAxes:[f,b],measureAxes:[p,N]},[n,c]=o[t.target.props.axes],a=n.slice(),s=w(a,t.target.props.dataItem);if(s){const u=(s.fields||[]).slice(),r=F(u,t.value);if(r&&(!r.children||!r.children.length)){const z=await R(r);r.children=z,s.fields=u,c(a)}}};return{pivotProps:{rowAxes:x,columnAxes:f,data:h.data,rows:h.rows,columns:h.columns,onRowAxesChange:C,onColumnAxesChange:P},configuratorProps:{sort:S,onSortChange:E,filter:g,onFilterChange:I,data:q,rowAxes:x,columnAxes:f,measureAxes:p,onRowAxesChange:C,onColumnAxesChange:P,onMeasureAxesChange:M,onFieldsEditorFieldExpand:k,onAxisFilterFieldExpand:_,onAxisFilterFieldsExpandChange:T},state:{loading:l}}},G=e=>{const l=y(e);return e.children(l)},J=e=>{for(let l=0,i=e.length;l<i;l++)e[l].uniqueName=e[l].name,e[l].type="kpi";return e};exports.PivotOLAPService=G;exports.usePivotOLAPService=y;
|
|
@@ -0,0 +1,230 @@
|
|
|
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 u from "react";
|
|
10
|
+
import { fetchData as $, createDataState as j, fetchDiscover as f, addKPI as B, buildKPIMeasures as G } from "@progress/kendo-pivotgrid-common";
|
|
11
|
+
import { clone as J } from "@progress/kendo-react-common";
|
|
12
|
+
const Q = (e) => {
|
|
13
|
+
const [r, m] = u.useState(!0), [p, U] = u.useState({ data: [], columns: [], rows: [] }), [C, w] = u.useState([]), [d, A] = u.useState(e.defaultColumnAxes || []), [h, b] = u.useState(e.defaultRowAxes || []), [x, N] = u.useState(e.defaultMeasureAxes || []), [F, v] = u.useState(e.defaultSort || []), [q, E] = u.useState(e.defaultFilter || []), g = (t) => {
|
|
14
|
+
b(t.value);
|
|
15
|
+
}, y = (t) => {
|
|
16
|
+
A(t.value);
|
|
17
|
+
}, I = (t) => {
|
|
18
|
+
N(t.value);
|
|
19
|
+
}, M = (t) => {
|
|
20
|
+
v(t.value);
|
|
21
|
+
}, K = (t) => {
|
|
22
|
+
E(t.value);
|
|
23
|
+
};
|
|
24
|
+
u.useEffect(() => {
|
|
25
|
+
m(!0);
|
|
26
|
+
const t = {
|
|
27
|
+
connection: {
|
|
28
|
+
catalog: e.catalog,
|
|
29
|
+
cube: e.cube
|
|
30
|
+
},
|
|
31
|
+
columnAxes: d.slice(),
|
|
32
|
+
rowAxes: h.slice(),
|
|
33
|
+
measureAxes: x,
|
|
34
|
+
sort: F,
|
|
35
|
+
filter: q
|
|
36
|
+
};
|
|
37
|
+
setTimeout(() => {
|
|
38
|
+
$({ url: e.url }, J(t)).then(j).then((o) => {
|
|
39
|
+
U(o), m(!1);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
}, [d, h, x, q, F, e.cube, e.catalog, e.url]), u.useEffect(() => {
|
|
43
|
+
m(!0);
|
|
44
|
+
const t = {
|
|
45
|
+
connection: {
|
|
46
|
+
catalog: e.catalog,
|
|
47
|
+
cube: e.cube
|
|
48
|
+
},
|
|
49
|
+
restrictions: {
|
|
50
|
+
catalogName: e.catalog,
|
|
51
|
+
cubeName: e.cube
|
|
52
|
+
},
|
|
53
|
+
command: "schemaDimensions"
|
|
54
|
+
};
|
|
55
|
+
f({ url: e.url }, t).then((o) => {
|
|
56
|
+
B(o), w(o), m(!1);
|
|
57
|
+
});
|
|
58
|
+
}, [e.catalog, e.cube, e.url]);
|
|
59
|
+
const P = (t = [], o) => {
|
|
60
|
+
for (let n = 0; n < t.length; n++) {
|
|
61
|
+
const a = t[n];
|
|
62
|
+
if (String(a.name) === String(o.name))
|
|
63
|
+
return a;
|
|
64
|
+
}
|
|
65
|
+
return null;
|
|
66
|
+
}, S = (t = [], o) => {
|
|
67
|
+
for (let n = 0; n < t.length; n++) {
|
|
68
|
+
const a = t[n];
|
|
69
|
+
if (a.uniqueName === o.uniqueName)
|
|
70
|
+
return a;
|
|
71
|
+
let l = S(a.children, o);
|
|
72
|
+
if (l !== null)
|
|
73
|
+
return l;
|
|
74
|
+
}
|
|
75
|
+
return null;
|
|
76
|
+
}, L = async (t) => {
|
|
77
|
+
let o, n, a, l, c, s;
|
|
78
|
+
t.name && (o = "schemaMembers", l = `${String(t.name)}.[(ALL)]`);
|
|
79
|
+
const i = {
|
|
80
|
+
connection: {
|
|
81
|
+
catalog: e.catalog,
|
|
82
|
+
cube: e.cube
|
|
83
|
+
},
|
|
84
|
+
restrictions: {
|
|
85
|
+
catalogName: e.catalog,
|
|
86
|
+
cubeName: e.cube,
|
|
87
|
+
hierarchyUniqueName: a,
|
|
88
|
+
dimensionUniqueName: n,
|
|
89
|
+
levelUniqueName: l,
|
|
90
|
+
memberUniqueName: c,
|
|
91
|
+
treeOp: s
|
|
92
|
+
},
|
|
93
|
+
command: o
|
|
94
|
+
};
|
|
95
|
+
return f({ url: e.url }, i);
|
|
96
|
+
}, R = async (t) => {
|
|
97
|
+
let o, n, a, l, c, s;
|
|
98
|
+
t.uniqueName && (o = "schemaMembers", c = t.uniqueName.replace(/\&/g, "&"), s = 1);
|
|
99
|
+
const i = {
|
|
100
|
+
connection: {
|
|
101
|
+
catalog: e.catalog,
|
|
102
|
+
cube: e.cube
|
|
103
|
+
},
|
|
104
|
+
restrictions: {
|
|
105
|
+
catalogName: e.catalog,
|
|
106
|
+
cubeName: e.cube,
|
|
107
|
+
hierarchyUniqueName: a,
|
|
108
|
+
dimensionUniqueName: n,
|
|
109
|
+
levelUniqueName: l,
|
|
110
|
+
memberUniqueName: c,
|
|
111
|
+
treeOp: s
|
|
112
|
+
},
|
|
113
|
+
command: o
|
|
114
|
+
};
|
|
115
|
+
return f({ url: e.url }, i);
|
|
116
|
+
}, D = async (t) => {
|
|
117
|
+
let o, n, a, l, c, s;
|
|
118
|
+
t.type === 2 ? o = "schemaMeasures" : t.dimensionUniqueName ? (o = "schemaLevels", a = t.uniqueName) : (o = "schemaHierarchies", n = t.uniqueName);
|
|
119
|
+
const i = {
|
|
120
|
+
connection: {
|
|
121
|
+
catalog: e.catalog,
|
|
122
|
+
cube: e.cube
|
|
123
|
+
},
|
|
124
|
+
restrictions: {
|
|
125
|
+
catalogName: e.catalog,
|
|
126
|
+
cubeName: e.cube,
|
|
127
|
+
hierarchyUniqueName: a,
|
|
128
|
+
dimensionUniqueName: n,
|
|
129
|
+
levelUniqueName: l,
|
|
130
|
+
memberUniqueName: c,
|
|
131
|
+
treeOp: s
|
|
132
|
+
},
|
|
133
|
+
command: o
|
|
134
|
+
};
|
|
135
|
+
return f({ url: e.url }, i);
|
|
136
|
+
}, O = async () => {
|
|
137
|
+
const t = {
|
|
138
|
+
connection: {
|
|
139
|
+
catalog: e.catalog,
|
|
140
|
+
cube: e.cube
|
|
141
|
+
},
|
|
142
|
+
restrictions: {
|
|
143
|
+
catalogName: e.catalog,
|
|
144
|
+
cubeName: e.cube
|
|
145
|
+
},
|
|
146
|
+
command: "schemaKPIs"
|
|
147
|
+
};
|
|
148
|
+
return f({ url: e.url }, t);
|
|
149
|
+
}, k = async (t) => {
|
|
150
|
+
const o = C.slice(), n = S(o, t.value);
|
|
151
|
+
if (n && n.uniqueName === "[KPIs]") {
|
|
152
|
+
const a = V(await O());
|
|
153
|
+
n.children = a;
|
|
154
|
+
} else if (n && n.type === "kpi")
|
|
155
|
+
n.children = G(n);
|
|
156
|
+
else if (n && !n.children) {
|
|
157
|
+
const a = await D(n);
|
|
158
|
+
n.children = a;
|
|
159
|
+
}
|
|
160
|
+
w(o);
|
|
161
|
+
}, z = async (t) => {
|
|
162
|
+
if (!t)
|
|
163
|
+
return;
|
|
164
|
+
const o = {
|
|
165
|
+
rowAxes: [h, b],
|
|
166
|
+
columnAxes: [d, A],
|
|
167
|
+
measureAxes: [x, N]
|
|
168
|
+
}, [n, a] = o[t.target.props.axes], l = n.slice(), c = P(l, t.target.props.dataItem);
|
|
169
|
+
if (c && !c.fields) {
|
|
170
|
+
const s = await L(c);
|
|
171
|
+
c.fields = s, a(l);
|
|
172
|
+
}
|
|
173
|
+
}, H = async (t) => {
|
|
174
|
+
if (!t)
|
|
175
|
+
return;
|
|
176
|
+
const o = {
|
|
177
|
+
rowAxes: [h, b],
|
|
178
|
+
columnAxes: [d, A],
|
|
179
|
+
measureAxes: [x, N]
|
|
180
|
+
}, [n, a] = o[t.target.props.axes], l = n.slice(), c = P(l, t.target.props.dataItem);
|
|
181
|
+
if (c) {
|
|
182
|
+
const s = (c.fields || []).slice(), i = S(s, t.value);
|
|
183
|
+
if (i && (!i.children || !i.children.length)) {
|
|
184
|
+
const T = await R(i);
|
|
185
|
+
i.children = T, c.fields = s, a(l);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
return {
|
|
190
|
+
pivotProps: {
|
|
191
|
+
rowAxes: h,
|
|
192
|
+
columnAxes: d,
|
|
193
|
+
data: p.data,
|
|
194
|
+
rows: p.rows,
|
|
195
|
+
columns: p.columns,
|
|
196
|
+
onRowAxesChange: g,
|
|
197
|
+
onColumnAxesChange: y
|
|
198
|
+
},
|
|
199
|
+
configuratorProps: {
|
|
200
|
+
sort: F,
|
|
201
|
+
onSortChange: M,
|
|
202
|
+
filter: q,
|
|
203
|
+
onFilterChange: K,
|
|
204
|
+
data: C,
|
|
205
|
+
rowAxes: h,
|
|
206
|
+
columnAxes: d,
|
|
207
|
+
measureAxes: x,
|
|
208
|
+
onRowAxesChange: g,
|
|
209
|
+
onColumnAxesChange: y,
|
|
210
|
+
onMeasureAxesChange: I,
|
|
211
|
+
onFieldsEditorFieldExpand: k,
|
|
212
|
+
onAxisFilterFieldExpand: H,
|
|
213
|
+
onAxisFilterFieldsExpandChange: z
|
|
214
|
+
},
|
|
215
|
+
state: {
|
|
216
|
+
loading: r
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
}, Y = (e) => {
|
|
220
|
+
const r = Q(e);
|
|
221
|
+
return e.children(r);
|
|
222
|
+
}, V = (e) => {
|
|
223
|
+
for (let r = 0, m = e.length; r < m; r++)
|
|
224
|
+
e[r].uniqueName = e[r].name, e[r].type = "kpi";
|
|
225
|
+
return e;
|
|
226
|
+
};
|
|
227
|
+
export {
|
|
228
|
+
Y as PivotOLAPService,
|
|
229
|
+
Q as usePivotOLAPService
|
|
230
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react");function i(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const s=i(u),f=(...e)=>{const t=s.useRef();return n=>{t.current!==void 0&&window.cancelAnimationFrame(t.current);const o=n.currentTarget,l=o.scrollTop;e.forEach(a=>{const c=a.current;c&&c!==o&&(t.current=window.requestAnimationFrame(()=>{c.scrollTop=Math.round(l)}))})}};exports.useVerticalScrollSync=f;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as a from "react";
|
|
10
|
+
const i = (...t) => {
|
|
11
|
+
const r = a.useRef();
|
|
12
|
+
return (c) => {
|
|
13
|
+
r.current !== void 0 && window.cancelAnimationFrame(r.current);
|
|
14
|
+
const n = c.currentTarget, o = n.scrollTop;
|
|
15
|
+
t.forEach((l) => {
|
|
16
|
+
const e = l.current;
|
|
17
|
+
e && e !== n && (r.current = window.requestAnimationFrame(() => {
|
|
18
|
+
e.scrollTop = Math.round(o);
|
|
19
|
+
}));
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
i as useVerticalScrollSync
|
|
25
|
+
};
|