@progress/kendo-react-pivotgrid 6.1.1 → 7.0.0-develop.2
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/LICENSE.md +1 -1
- package/{dist/npm/PivotGrid.d.ts → PivotGrid.d.ts} +4 -0
- package/{dist/es/components → components}/AxesEditor.d.ts +4 -6
- package/{dist/npm/components → components}/AxisEditor.d.ts +4 -0
- package/{dist/es/components → components}/AxisFilterFieldsEditor.d.ts +4 -0
- package/{dist/npm/components → components}/Cell.d.ts +4 -0
- package/{dist/es/components → components}/Column.d.ts +4 -0
- package/{dist/npm/components → components}/Configurator.d.ts +4 -0
- package/{dist/npm/components → components}/ConfiguratorButton.d.ts +4 -0
- package/{dist/es/components → components}/ConfiguratorEditor.d.ts +4 -0
- package/{dist/es/components → components}/Container.d.ts +4 -0
- package/components/EditorContext.d.ts +11 -0
- package/{dist/npm/components → components}/FieldsEditor.d.ts +4 -0
- package/{dist/es/components → components}/HeaderCell.d.ts +4 -0
- package/{dist/es/components → components}/Row.d.ts +4 -0
- package/dist/cdn/js/kendo-react-pivotgrid.js +5 -2
- package/hooks/index.d.ts +6 -0
- package/{dist/es/hooks → hooks}/useExpansion.d.ts +5 -1
- package/{dist/es/hooks → hooks}/useHeaders.d.ts +5 -1
- package/hooks/useHorizontalScrollSync.d.ts +9 -0
- package/{dist/es/hooks → hooks}/usePivotConfiguratorEditor.d.ts +5 -1
- package/{dist/npm/hooks → hooks}/usePivotLocalDataService.d.ts +4 -0
- package/{dist/npm/hooks → hooks}/usePivotOLAPService.d.ts +4 -0
- package/hooks/useVerticalScrollSync.d.ts +9 -0
- package/index.d.ts +22 -0
- package/index.js +5 -0
- package/index.mjs +1585 -0
- package/{dist/es/messages → messages}/index.d.ts +4 -0
- package/{dist/es/models → models}/index.d.ts +4 -1
- package/package-metadata.d.ts +9 -0
- package/package.json +36 -54
- package/{dist/es/shared → shared}/PivotGridConfiguratorEditorEventsContext.d.ts +4 -0
- package/{dist/npm/shared → shared}/PivotGridConfiguratorEditorStateContext.d.ts +4 -0
- package/shared/index.d.ts +6 -0
- package/{dist/es/utils → utils}/index.d.ts +4 -0
- package/about.md +0 -3
- package/dist/cdn/js/kendo-react-pivotgrid.js.LICENSE.txt +0 -14
- package/dist/es/PivotGrid.d.ts +0 -177
- package/dist/es/PivotGrid.js +0 -245
- package/dist/es/components/AxesEditor.js +0 -43
- package/dist/es/components/AxisEditor.d.ts +0 -52
- package/dist/es/components/AxisEditor.js +0 -138
- package/dist/es/components/AxisFilterFieldsEditor.js +0 -150
- package/dist/es/components/Cell.d.ts +0 -65
- package/dist/es/components/Cell.js +0 -31
- package/dist/es/components/Column.js +0 -33
- package/dist/es/components/Configurator.d.ts +0 -125
- package/dist/es/components/Configurator.js +0 -118
- package/dist/es/components/ConfiguratorButton.d.ts +0 -40
- package/dist/es/components/ConfiguratorButton.js +0 -39
- package/dist/es/components/ConfiguratorEditor.js +0 -191
- package/dist/es/components/Container.js +0 -22
- package/dist/es/components/FieldsEditor.d.ts +0 -74
- package/dist/es/components/FieldsEditor.js +0 -90
- package/dist/es/components/HeaderCell.js +0 -50
- package/dist/es/components/Row.js +0 -28
- package/dist/es/hooks/index.d.ts +0 -2
- package/dist/es/hooks/index.js +0 -2
- package/dist/es/hooks/useExpansion.js +0 -89
- package/dist/es/hooks/useHeaders.js +0 -25
- package/dist/es/hooks/useHorizontalScrollSync.d.ts +0 -5
- package/dist/es/hooks/useHorizontalScrollSync.js +0 -27
- package/dist/es/hooks/usePivotConfiguratorEditor.js +0 -103
- package/dist/es/hooks/usePivotLocalDataService.d.ts +0 -79
- package/dist/es/hooks/usePivotLocalDataService.js +0 -105
- package/dist/es/hooks/usePivotOLAPService.d.ts +0 -41
- package/dist/es/hooks/usePivotOLAPService.js +0 -371
- package/dist/es/hooks/useVerticalScrollSync.d.ts +0 -5
- package/dist/es/hooks/useVerticalScrollSync.js +0 -27
- package/dist/es/main.d.ts +0 -18
- package/dist/es/main.js +0 -17
- package/dist/es/messages/index.js +0 -71
- package/dist/es/models/index.js +0 -1
- package/dist/es/package-metadata.d.ts +0 -5
- package/dist/es/package-metadata.js +0 -11
- package/dist/es/shared/PivotGridConfiguratorEditorEventsContext.js +0 -5
- package/dist/es/shared/PivotGridConfiguratorEditorStateContext.d.ts +0 -6
- package/dist/es/shared/PivotGridConfiguratorEditorStateContext.js +0 -18
- package/dist/es/shared/index.d.ts +0 -2
- package/dist/es/shared/index.js +0 -2
- package/dist/es/utils/index.js +0 -118
- package/dist/npm/PivotGrid.js +0 -248
- package/dist/npm/components/AxesEditor.d.ts +0 -46
- package/dist/npm/components/AxesEditor.js +0 -46
- package/dist/npm/components/AxisEditor.js +0 -141
- package/dist/npm/components/AxisFilterFieldsEditor.d.ts +0 -114
- package/dist/npm/components/AxisFilterFieldsEditor.js +0 -153
- package/dist/npm/components/Cell.js +0 -34
- package/dist/npm/components/Column.d.ts +0 -42
- package/dist/npm/components/Column.js +0 -36
- package/dist/npm/components/Configurator.js +0 -121
- package/dist/npm/components/ConfiguratorButton.js +0 -42
- package/dist/npm/components/ConfiguratorEditor.d.ts +0 -126
- package/dist/npm/components/ConfiguratorEditor.js +0 -194
- package/dist/npm/components/Container.d.ts +0 -46
- package/dist/npm/components/Container.js +0 -25
- package/dist/npm/components/FieldsEditor.js +0 -93
- package/dist/npm/components/HeaderCell.d.ts +0 -96
- package/dist/npm/components/HeaderCell.js +0 -53
- package/dist/npm/components/Row.d.ts +0 -50
- package/dist/npm/components/Row.js +0 -31
- package/dist/npm/hooks/index.d.ts +0 -2
- package/dist/npm/hooks/index.js +0 -18
- package/dist/npm/hooks/useExpansion.d.ts +0 -19
- package/dist/npm/hooks/useExpansion.js +0 -93
- package/dist/npm/hooks/useHeaders.d.ts +0 -12
- package/dist/npm/hooks/useHeaders.js +0 -30
- package/dist/npm/hooks/useHorizontalScrollSync.d.ts +0 -5
- package/dist/npm/hooks/useHorizontalScrollSync.js +0 -31
- package/dist/npm/hooks/usePivotConfiguratorEditor.d.ts +0 -83
- package/dist/npm/hooks/usePivotConfiguratorEditor.js +0 -107
- package/dist/npm/hooks/usePivotLocalDataService.js +0 -110
- package/dist/npm/hooks/usePivotOLAPService.js +0 -376
- package/dist/npm/hooks/useVerticalScrollSync.d.ts +0 -5
- package/dist/npm/hooks/useVerticalScrollSync.js +0 -31
- package/dist/npm/main.d.ts +0 -18
- package/dist/npm/main.js +0 -43
- package/dist/npm/messages/index.d.ts +0 -70
- package/dist/npm/messages/index.js +0 -74
- package/dist/npm/models/index.d.ts +0 -45
- package/dist/npm/models/index.js +0 -2
- package/dist/npm/package-metadata.d.ts +0 -5
- package/dist/npm/package-metadata.js +0 -14
- package/dist/npm/shared/PivotGridConfiguratorEditorEventsContext.d.ts +0 -13
- package/dist/npm/shared/PivotGridConfiguratorEditorEventsContext.js +0 -8
- package/dist/npm/shared/PivotGridConfiguratorEditorStateContext.js +0 -21
- package/dist/npm/shared/index.d.ts +0 -2
- package/dist/npm/shared/index.js +0 -18
- package/dist/npm/utils/index.d.ts +0 -47
- package/dist/npm/utils/index.js +0 -130
- package/dist/systemjs/kendo-react-pivotgrid.js +0 -1
- package/e2e-next/basic.tests.ts +0 -24
package/index.mjs
ADDED
|
@@ -0,0 +1,1585 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as t from "react";
|
|
6
|
+
import { useMouse as he, classNames as ee, useCustomComponent as I, IconWrap as ot, validatePackage as kt, setScrollbarWidth as Ye, noop as Mt, useDraggable as Tt, canUseRef as Fe, clone as Lt } from "@progress/kendo-react-common";
|
|
7
|
+
import { useLocalization as xe } from "@progress/kendo-react-intl";
|
|
8
|
+
import { headersReducer as Dt, toTree as pe, toRows as rt, toColumns as lt, toData as it, PivotGridNavigation as Ht, HEADERS_ACTION as We, PIVOT_CONFIGURATOR_ACTION as Gt, configuratorReducer as Ot, compareAxes as Qe, fetchData as qt, createDataState as Bt, fetchDiscover as de, addKPI as zt, buildKPIMeasures as Kt, rootFields as et, createDataTree as Ut, createFlatSchemaDimensions as Vt, createLocalDataState as $t } from "@progress/kendo-pivotgrid-common";
|
|
9
|
+
import { averageAggregate as On, maxAggregate as qn, minAggregate as Bn, sumAggregate as zn } from "@progress/kendo-pivotgrid-common";
|
|
10
|
+
import { chevronUpIcon as _t, chevronDownIcon as Xt, gridLayoutIcon as Zt, gearIcon as jt } from "@progress/kendo-svg-icons";
|
|
11
|
+
import { Button as ye, Chip as Jt, ChipList as Yt } from "@progress/kendo-react-buttons";
|
|
12
|
+
import { Field as se, Form as Wt, FormElement as Qt } from "@progress/kendo-react-form";
|
|
13
|
+
import { Label as me } from "@progress/kendo-react-labels";
|
|
14
|
+
import { ColumnMenuItem as en, ColumnMenuForm as tn, ColumnMenuTextFilter as nn, ColumnMenuTextColumn as an } from "@progress/kendo-react-data-tools";
|
|
15
|
+
import { TreeView as st, TreeViewItemPropsContext as on } from "@progress/kendo-react-treeview";
|
|
16
|
+
import { Skeleton as rn } from "@progress/kendo-react-indicators";
|
|
17
|
+
const ln = {
|
|
18
|
+
name: "@progress/kendo-react-pivotgrid",
|
|
19
|
+
productName: "KendoReact",
|
|
20
|
+
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
21
|
+
publishDate: 1700573618,
|
|
22
|
+
version: "",
|
|
23
|
+
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
24
|
+
}, Re = "pivotgrid.emptyCellAriaLabel", Ne = "pivotgrid.fieldMenuReset", Se = "pivotgrid.fieldMenuApply", ke = "pivotgrid.configuratorTitle", Me = "pivotgrid.configuratorCancel", Te = "pivotgrid.configuratorApply", Le = "pivotgrid.configuratorColumnsTitle", De = "pivotgrid.configuratorRowsTitle", He = "pivotgrid.configuratorMeasuresTitle", Ge = "pivotgrid.configuratorEditorSearchTitle", sn = "pivotgrid.configuratorEditorSearchPlaceholder", ae = "pivotgrid.configuratorMissingFields", Oe = "pivotgrid.configuratorButtonLabel", Z = {
|
|
25
|
+
[Re]: "PivotGrid component. Use the arrow keys to navigate.",
|
|
26
|
+
[Ne]: "Reset",
|
|
27
|
+
[Se]: "Apply",
|
|
28
|
+
[Me]: "Cancel",
|
|
29
|
+
[Te]: "Apply",
|
|
30
|
+
[ke]: "Settings",
|
|
31
|
+
[Ge]: "Fields",
|
|
32
|
+
[sn]: "Search...",
|
|
33
|
+
[Le]: "Columns",
|
|
34
|
+
[De]: "Rows",
|
|
35
|
+
[He]: "Values",
|
|
36
|
+
[Oe]: "Change settings",
|
|
37
|
+
[ae]: "Select some fields to begin setup"
|
|
38
|
+
}, ct = t.forwardRef((e, a) => {
|
|
39
|
+
const n = t.useRef(null), o = t.useRef(null);
|
|
40
|
+
t.useImperativeHandle(n, () => ({
|
|
41
|
+
element: o.current,
|
|
42
|
+
props: e
|
|
43
|
+
})), t.useImperativeHandle(a, () => n.current);
|
|
44
|
+
const l = he(
|
|
45
|
+
e,
|
|
46
|
+
n
|
|
47
|
+
);
|
|
48
|
+
return /* @__PURE__ */ t.createElement(
|
|
49
|
+
"tr",
|
|
50
|
+
{
|
|
51
|
+
ref: o,
|
|
52
|
+
...l,
|
|
53
|
+
id: e.id,
|
|
54
|
+
style: e.style,
|
|
55
|
+
tabIndex: e.tabIndex,
|
|
56
|
+
children: e.children,
|
|
57
|
+
role: e.role,
|
|
58
|
+
"aria-owns": e.ariaOwns,
|
|
59
|
+
className: ee(
|
|
60
|
+
"k-pivotgrid-row",
|
|
61
|
+
e.className
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
});
|
|
66
|
+
ct.displayName = "KendoReactPivotGridRow";
|
|
67
|
+
const dt = t.forwardRef((e, a) => {
|
|
68
|
+
const n = t.useRef(null), o = t.useRef(null);
|
|
69
|
+
t.useImperativeHandle(n, () => ({
|
|
70
|
+
element: o.current,
|
|
71
|
+
props: e
|
|
72
|
+
})), t.useImperativeHandle(a, () => n.current);
|
|
73
|
+
const l = he(
|
|
74
|
+
e,
|
|
75
|
+
n
|
|
76
|
+
);
|
|
77
|
+
return /* @__PURE__ */ t.createElement(
|
|
78
|
+
"td",
|
|
79
|
+
{
|
|
80
|
+
ref: o,
|
|
81
|
+
...l,
|
|
82
|
+
id: e.id,
|
|
83
|
+
style: e.style,
|
|
84
|
+
tabIndex: e.tabIndex,
|
|
85
|
+
role: e.role,
|
|
86
|
+
"aria-describedby": e.ariaDescribedby,
|
|
87
|
+
className: ee(
|
|
88
|
+
"k-pivotgrid-cell",
|
|
89
|
+
{
|
|
90
|
+
"k-pivotgrid-header-total": e.total
|
|
91
|
+
},
|
|
92
|
+
e.className
|
|
93
|
+
)
|
|
94
|
+
},
|
|
95
|
+
e.children
|
|
96
|
+
);
|
|
97
|
+
});
|
|
98
|
+
dt.displayName = "KendoReactPivotGridCell";
|
|
99
|
+
const tt = (e, a, n) => [e, (l, i) => {
|
|
100
|
+
const u = Dt(e, { ...l, tree: a });
|
|
101
|
+
n && n(u, i);
|
|
102
|
+
}], Be = t.forwardRef((e, a) => {
|
|
103
|
+
const n = t.useRef(null), o = t.useRef(null);
|
|
104
|
+
t.useImperativeHandle(n, () => ({
|
|
105
|
+
element: o.current,
|
|
106
|
+
props: e
|
|
107
|
+
})), t.useImperativeHandle(a, () => n.current);
|
|
108
|
+
const [l, i] = I(e.icon || ut.icon), u = he(
|
|
109
|
+
e,
|
|
110
|
+
n
|
|
111
|
+
), s = (E) => {
|
|
112
|
+
e.onIconClick && e.onIconClick.call(void 0, {
|
|
113
|
+
syntheticEvent: E.syntheticEvent,
|
|
114
|
+
target: n.current
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
return /* @__PURE__ */ t.createElement(
|
|
118
|
+
"th",
|
|
119
|
+
{
|
|
120
|
+
ref: o,
|
|
121
|
+
...u,
|
|
122
|
+
colSpan: e.colSpan,
|
|
123
|
+
rowSpan: e.rowSpan,
|
|
124
|
+
id: e.id,
|
|
125
|
+
style: e.style,
|
|
126
|
+
tabIndex: e.tabIndex,
|
|
127
|
+
role: e.role,
|
|
128
|
+
...e.expandable ? { "aria-expanded": e.expanded } : {},
|
|
129
|
+
className: ee(
|
|
130
|
+
"k-pivotgrid-cell",
|
|
131
|
+
{
|
|
132
|
+
"k-pivotgrid-header-total": e.total,
|
|
133
|
+
"k-pivotgrid-header-root": e.root,
|
|
134
|
+
"k-pivotgrid-expanded": e.expanded,
|
|
135
|
+
"k-first": e.first
|
|
136
|
+
},
|
|
137
|
+
e.className
|
|
138
|
+
)
|
|
139
|
+
},
|
|
140
|
+
e.expandable && /* @__PURE__ */ t.createElement(
|
|
141
|
+
l,
|
|
142
|
+
{
|
|
143
|
+
...i,
|
|
144
|
+
onClick: s,
|
|
145
|
+
name: `chevron-${e.expanded ? "up" : "down"}`,
|
|
146
|
+
"aria-hidden": !0,
|
|
147
|
+
icon: e.expanded ? _t : Xt
|
|
148
|
+
}
|
|
149
|
+
),
|
|
150
|
+
e.children
|
|
151
|
+
);
|
|
152
|
+
}), ut = {
|
|
153
|
+
icon: ot
|
|
154
|
+
};
|
|
155
|
+
Be.defaultProps = ut;
|
|
156
|
+
Be.displayName = "KendoReactPivotGridHeaderCell";
|
|
157
|
+
const cn = (...e) => {
|
|
158
|
+
const a = t.useRef();
|
|
159
|
+
return (o) => {
|
|
160
|
+
a.current !== void 0 && window.cancelAnimationFrame(a.current);
|
|
161
|
+
const l = o.currentTarget, i = l.scrollLeft;
|
|
162
|
+
e.forEach((u) => {
|
|
163
|
+
const s = u.current;
|
|
164
|
+
s && s !== l && (a.current = window.requestAnimationFrame(() => {
|
|
165
|
+
s.scrollLeft = Math.round(i);
|
|
166
|
+
}));
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
}, dn = (...e) => {
|
|
170
|
+
const a = t.useRef();
|
|
171
|
+
return (o) => {
|
|
172
|
+
a.current !== void 0 && window.cancelAnimationFrame(a.current);
|
|
173
|
+
const l = o.currentTarget, i = l.scrollTop;
|
|
174
|
+
e.forEach((u) => {
|
|
175
|
+
const s = u.current;
|
|
176
|
+
s && s !== l && (a.current = window.requestAnimationFrame(() => {
|
|
177
|
+
s.scrollTop = Math.round(i);
|
|
178
|
+
}));
|
|
179
|
+
});
|
|
180
|
+
};
|
|
181
|
+
}, ze = t.forwardRef((e, a) => {
|
|
182
|
+
const n = t.useRef(null), o = t.useRef(null);
|
|
183
|
+
t.useImperativeHandle(n, () => ({
|
|
184
|
+
element: o.current,
|
|
185
|
+
props: e
|
|
186
|
+
})), t.useImperativeHandle(a, () => n.current);
|
|
187
|
+
const l = he(
|
|
188
|
+
e,
|
|
189
|
+
n
|
|
190
|
+
);
|
|
191
|
+
return /* @__PURE__ */ t.createElement(
|
|
192
|
+
"col",
|
|
193
|
+
{
|
|
194
|
+
ref: o,
|
|
195
|
+
...l,
|
|
196
|
+
id: e.id,
|
|
197
|
+
style: e.style,
|
|
198
|
+
tabIndex: e.tabIndex,
|
|
199
|
+
children: e.children,
|
|
200
|
+
className: e.className
|
|
201
|
+
}
|
|
202
|
+
);
|
|
203
|
+
}), un = {
|
|
204
|
+
path: []
|
|
205
|
+
};
|
|
206
|
+
ze.defaultProps = un;
|
|
207
|
+
ze.displayName = "KendoReactPivotGridColumn";
|
|
208
|
+
const Tn = (e, a, n) => {
|
|
209
|
+
const o = JSON.parse(JSON.stringify(e || [])), l = JSON.parse(JSON.stringify(a || [])), i = JSON.parse(JSON.stringify(n || [])), u = pe(o), [, s, E] = rt(u), m = pe(l), [, x, , y] = lt(m);
|
|
210
|
+
return it(
|
|
211
|
+
i,
|
|
212
|
+
x,
|
|
213
|
+
s,
|
|
214
|
+
y,
|
|
215
|
+
E
|
|
216
|
+
);
|
|
217
|
+
}, we = (e = [], a = {}, n = null) => e.map((o) => {
|
|
218
|
+
const l = { dataItem: o };
|
|
219
|
+
return Object.keys(a).forEach((i) => {
|
|
220
|
+
l[i] = a[i](l, n);
|
|
221
|
+
}), l;
|
|
222
|
+
}), Ke = (e = []) => {
|
|
223
|
+
let a = [...e];
|
|
224
|
+
return (e || []).forEach((n) => {
|
|
225
|
+
a = a.concat(Ke(n.children));
|
|
226
|
+
}), a;
|
|
227
|
+
}, Pe = (e = []) => {
|
|
228
|
+
const a = /* @__PURE__ */ new Set();
|
|
229
|
+
return e.forEach((n) => {
|
|
230
|
+
a.add(String(n.name));
|
|
231
|
+
}), Array.from(a);
|
|
232
|
+
}, oe = (e = []) => `${e.join(",")}`, mn = (e, a) => `${oe(e.map((n) => n.name))}|${oe(a.map((n) => n.name))}`, fn = (e, a, n) => {
|
|
233
|
+
if (!e)
|
|
234
|
+
return;
|
|
235
|
+
let o = 0, l, i = e.length, u;
|
|
236
|
+
for (; o < i; o++)
|
|
237
|
+
u = e[o].operator, (!n && u !== "in" || u === n) && e[o].field === a && (l = e[o]);
|
|
238
|
+
return l;
|
|
239
|
+
}, nt = (e, a, n) => {
|
|
240
|
+
if (!e)
|
|
241
|
+
return [];
|
|
242
|
+
let o = 0, l = [], i = e.length, u;
|
|
243
|
+
for (; o < i; o++)
|
|
244
|
+
u = e[o].operator, (!n && u !== "in" || u === n) && e[o].field === a && l.push(e[o]);
|
|
245
|
+
return l;
|
|
246
|
+
}, mt = (e, a) => e.uniqueName === a.uniqueName, gn = t.forwardRef((e, a) => {
|
|
247
|
+
kt(ln);
|
|
248
|
+
const {
|
|
249
|
+
rows: n,
|
|
250
|
+
rowAxes: o,
|
|
251
|
+
columns: l,
|
|
252
|
+
columnAxes: i,
|
|
253
|
+
data: u
|
|
254
|
+
} = { ...ue, ...e }, s = t.useRef(null), E = t.useRef(null), m = t.useRef(null), x = t.useRef(null), y = t.useRef(null), G = t.useRef(null), k = t.useRef(null), U = xe(), L = (h, R) => {
|
|
255
|
+
e.onRowAxesChange && e.onRowAxesChange({
|
|
256
|
+
value: h,
|
|
257
|
+
target: E.current,
|
|
258
|
+
syntheticEvent: R
|
|
259
|
+
});
|
|
260
|
+
}, V = (h, R) => {
|
|
261
|
+
e.onColumnAxesChange && e.onColumnAxesChange({
|
|
262
|
+
value: h,
|
|
263
|
+
target: E.current,
|
|
264
|
+
syntheticEvent: R
|
|
265
|
+
});
|
|
266
|
+
}, $ = pe((n || []).slice()), [, v] = tt((o || []).slice(), $, L), [N, f, z, K] = rt($), D = pe((l || []).slice()), [, c] = tt((i || []).slice(), D, V), [A, M, , P] = lt(D), p = it((u || []).slice(), M, f, P, z);
|
|
267
|
+
t.useImperativeHandle(E, () => ({
|
|
268
|
+
props: e,
|
|
269
|
+
element: s.current,
|
|
270
|
+
columnHeaderRows: A,
|
|
271
|
+
rowHeaderRows: N,
|
|
272
|
+
dataCells: p,
|
|
273
|
+
rowHeaderBreadth: K,
|
|
274
|
+
columnHeaderBreadth: P
|
|
275
|
+
})), t.useImperativeHandle(a, () => E.current);
|
|
276
|
+
const X = [], j = [], r = [], [g, C] = I(e.row || ue.row), [w, S] = I(e.column || ue.column), [O, _] = I(e.cell || ue.cell), [d, H] = I(e.headerCell || ue.headerCell), B = e.columnHeadersRow || g, T = e.columnHeadersColumn || w, W = e.columnHeadersCell || d, Y = e.rowHeadersRow || g, ne = e.rowHeadersColumn || w, pt = e.rowHeadersCell || d, yt = e.dataRow || g, wt = e.dataColumn || w;
|
|
277
|
+
for (let h = 0; h < M.length; h++)
|
|
278
|
+
X.push(/* @__PURE__ */ t.createElement(wt, { key: String(M[h].path), ...S, path: M[h].path })), r.push(/* @__PURE__ */ t.createElement(T, { key: String(M[h].path), ...S, path: M[h].path }));
|
|
279
|
+
for (let h = 0; h < K; h++)
|
|
280
|
+
j.push(/* @__PURE__ */ t.createElement(ne, { key: h, ...S }));
|
|
281
|
+
const Ft = (h) => {
|
|
282
|
+
h.target.props.expandable && c(
|
|
283
|
+
{
|
|
284
|
+
type: We.toggle,
|
|
285
|
+
payload: h.target.props.dataItem.path
|
|
286
|
+
},
|
|
287
|
+
h.syntheticEvent
|
|
288
|
+
);
|
|
289
|
+
}, bt = (h) => {
|
|
290
|
+
h.target.props.expandable && v(
|
|
291
|
+
{
|
|
292
|
+
type: We.toggle,
|
|
293
|
+
payload: h.target.props.dataItem.path
|
|
294
|
+
},
|
|
295
|
+
h.syntheticEvent
|
|
296
|
+
);
|
|
297
|
+
}, Ze = cn(k, G), It = dn(k, y), Pt = (h) => {
|
|
298
|
+
Ze(h), It(h);
|
|
299
|
+
}, je = t.useCallback(() => {
|
|
300
|
+
s.current && x.current && (s.current.style.gridTemplateRows = "", s.current.style.gridTemplateRows = `${x.current.offsetHeight}px 1fr`);
|
|
301
|
+
}, []), Je = t.useCallback(() => {
|
|
302
|
+
s.current && m.current && (s.current.style.gridTemplateColumns = "", s.current.style.gridTemplateColumns = `${m.current.offsetWidth}px 1fr`);
|
|
303
|
+
}, []), re = t.useRef(new Ht({ tabIndex: e.tabIndex || 0 }));
|
|
304
|
+
t.useEffect(() => {
|
|
305
|
+
if (s.current) {
|
|
306
|
+
const h = e.tabIndex || 0;
|
|
307
|
+
if (re.current.stop(), re.current.tabIndex = h, e.navigatable) {
|
|
308
|
+
re.current.start(s.current);
|
|
309
|
+
const R = re.current.first;
|
|
310
|
+
R && R.setAttribute("tabindex", String(h));
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
return () => {
|
|
314
|
+
re.current.stop();
|
|
315
|
+
};
|
|
316
|
+
}, [e.tabIndex, e.navigatable]), t.useEffect(() => {
|
|
317
|
+
re.current.update();
|
|
318
|
+
}), t.useEffect(() => {
|
|
319
|
+
if (x.current) {
|
|
320
|
+
const h = new window.ResizeObserver(je);
|
|
321
|
+
return h.observe(x.current), () => {
|
|
322
|
+
h.disconnect();
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
}, [je]), t.useEffect(() => {
|
|
326
|
+
if (m.current) {
|
|
327
|
+
const h = new window.ResizeObserver(Je);
|
|
328
|
+
return h.observe(m.current), () => {
|
|
329
|
+
h.disconnect();
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
}, [Je]), t.useLayoutEffect(() => {
|
|
333
|
+
if (Ye(), m.current) {
|
|
334
|
+
const h = new window.ResizeObserver(Ye);
|
|
335
|
+
return h.observe(m.current), () => {
|
|
336
|
+
h.disconnect();
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
}, []);
|
|
340
|
+
const le = new Array(A.length).fill([]).map(() => new Array(M.length));
|
|
341
|
+
A.forEach((h, R) => {
|
|
342
|
+
let F = 0;
|
|
343
|
+
Array.from(h.cells).forEach((b) => {
|
|
344
|
+
const J = !!(b && b.children && b.children.length), Ie = (b ? oe(b.normalizedPath) + (b.total ? "|[TOTAL]" : "") + (J ? "|[EXPANDED]" : "") : "").replace(/\s/g, "-");
|
|
345
|
+
if (b)
|
|
346
|
+
for (let Ce = 0; Ce < (b.colSpan || 1); Ce++) {
|
|
347
|
+
for (let ie = 0; ie < (b.rowSpan || 1); ie++) {
|
|
348
|
+
const Rt = le[R + ie].findIndex((Nt, St) => St >= F && !Nt);
|
|
349
|
+
le[R + ie][Rt] = Ie;
|
|
350
|
+
}
|
|
351
|
+
F++;
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
});
|
|
355
|
+
const ve = p.map((h) => h.cells.map((R) => mn(R.rowTuple.members, R.columnTuple.members).replace(/\s/g, "-")));
|
|
356
|
+
return /* @__PURE__ */ t.createElement(
|
|
357
|
+
"div",
|
|
358
|
+
{
|
|
359
|
+
ref: s,
|
|
360
|
+
id: e.id,
|
|
361
|
+
style: e.style,
|
|
362
|
+
tabIndex: e.navigatable ? void 0 : e.tabIndex,
|
|
363
|
+
className: ee("k-pivotgrid", e.className),
|
|
364
|
+
role: "grid"
|
|
365
|
+
},
|
|
366
|
+
/* @__PURE__ */ t.createElement("span", { className: "k-pivotgrid-empty-cell" }, /* @__PURE__ */ t.createElement("span", { className: "k-sr-only" }, U.toLanguageString(Re, Z[Re]))),
|
|
367
|
+
/* @__PURE__ */ t.createElement("div", { ref: G, className: "k-pivotgrid-column-headers", onScroll: Ze }, /* @__PURE__ */ t.createElement("table", { ref: x, className: "k-pivotgrid-table", role: "none" }, /* @__PURE__ */ t.createElement("colgroup", null, r), /* @__PURE__ */ t.createElement("tbody", { className: "k-pivotgrid-tbody", role: "rowgroup" }, A.map((h, R) => {
|
|
368
|
+
let F = !1;
|
|
369
|
+
return /* @__PURE__ */ t.createElement(
|
|
370
|
+
B,
|
|
371
|
+
{
|
|
372
|
+
key: h.name,
|
|
373
|
+
role: "row",
|
|
374
|
+
...C
|
|
375
|
+
},
|
|
376
|
+
h.cells.map((b, J) => {
|
|
377
|
+
const Ie = J !== 0 && !F;
|
|
378
|
+
b && (F = !0);
|
|
379
|
+
const Ce = b && !!(b.children && b.children.length), ie = b && b.hasChildren && (!b.total || b.total && b.parent.total);
|
|
380
|
+
return b ? /* @__PURE__ */ t.createElement(
|
|
381
|
+
W,
|
|
382
|
+
{
|
|
383
|
+
...H,
|
|
384
|
+
key: le[R][J],
|
|
385
|
+
"data-key": le[R][J],
|
|
386
|
+
id: le[R][J],
|
|
387
|
+
columnPath: b.normalizedPath,
|
|
388
|
+
rowSpan: b.rowSpan || void 0,
|
|
389
|
+
colSpan: b.colSpan || void 0,
|
|
390
|
+
onIconClick: Ft,
|
|
391
|
+
dataItem: b,
|
|
392
|
+
expanded: Ce,
|
|
393
|
+
expandable: ie,
|
|
394
|
+
total: b.total,
|
|
395
|
+
first: Ie,
|
|
396
|
+
root: b.levelNum === 0,
|
|
397
|
+
role: "columnheader"
|
|
398
|
+
},
|
|
399
|
+
b.caption
|
|
400
|
+
) : null;
|
|
401
|
+
})
|
|
402
|
+
);
|
|
403
|
+
})))),
|
|
404
|
+
/* @__PURE__ */ t.createElement("div", { ref: y, className: "k-pivotgrid-row-headers" }, /* @__PURE__ */ t.createElement("table", { ref: m, className: "k-pivotgrid-table", role: "none" }, /* @__PURE__ */ t.createElement("colgroup", null, j), /* @__PURE__ */ t.createElement("tbody", { className: "k-pivotgrid-tbody", role: "rowgroup" }, N.map((h, R) => /* @__PURE__ */ t.createElement(
|
|
405
|
+
Y,
|
|
406
|
+
{
|
|
407
|
+
key: oe(f[R].path),
|
|
408
|
+
...C,
|
|
409
|
+
path: f[R].path,
|
|
410
|
+
role: "row",
|
|
411
|
+
ariaOwns: ve[R].join(" ")
|
|
412
|
+
},
|
|
413
|
+
h.cells.filter(Boolean).map(
|
|
414
|
+
(F) => F ? /* @__PURE__ */ t.createElement(
|
|
415
|
+
pt,
|
|
416
|
+
{
|
|
417
|
+
...H,
|
|
418
|
+
key: oe(F.normalizedPath) + (F.total ? "|[TOTAL]" : "") + (F.children && F.children.length ? "|[EXPANDED]" : ""),
|
|
419
|
+
"data-key": oe(F.normalizedPath) + (F.total ? "|[TOTAL]" : "") + (F.children && F.children.length ? "|[EXPANDED]" : ""),
|
|
420
|
+
rowPath: F.normalizedPath,
|
|
421
|
+
rowSpan: F.rowSpan || void 0,
|
|
422
|
+
colSpan: F.colSpan || void 0,
|
|
423
|
+
dataItem: F,
|
|
424
|
+
expanded: !!(F.children && F.children.length),
|
|
425
|
+
expandable: F.hasChildren && !F.total,
|
|
426
|
+
total: F.total,
|
|
427
|
+
onIconClick: bt,
|
|
428
|
+
root: F.levelNum === 0,
|
|
429
|
+
role: "rowheader"
|
|
430
|
+
},
|
|
431
|
+
F.caption
|
|
432
|
+
) : null
|
|
433
|
+
)
|
|
434
|
+
))))),
|
|
435
|
+
/* @__PURE__ */ t.createElement("div", { ref: k, className: "k-pivotgrid-values", onScroll: Pt }, /* @__PURE__ */ t.createElement("table", { className: "k-pivotgrid-table", role: "none" }, /* @__PURE__ */ t.createElement("colgroup", null, X), /* @__PURE__ */ t.createElement("tbody", { className: "k-pivotgrid-tbody", role: "none" }, p.map((h, R) => /* @__PURE__ */ t.createElement(
|
|
436
|
+
yt,
|
|
437
|
+
{
|
|
438
|
+
key: oe(f[R].path),
|
|
439
|
+
...C,
|
|
440
|
+
path: f[R].path,
|
|
441
|
+
role: "none"
|
|
442
|
+
},
|
|
443
|
+
h.cells.map(
|
|
444
|
+
(F, b) => /* @__PURE__ */ t.createElement(
|
|
445
|
+
O,
|
|
446
|
+
{
|
|
447
|
+
key: ve[R][b],
|
|
448
|
+
"data-key": ve[R][b],
|
|
449
|
+
id: ve[R][b],
|
|
450
|
+
..._,
|
|
451
|
+
rowPath: F.rowTuple.members.map((J) => J.name),
|
|
452
|
+
columnPath: F.columnTuple.members.map((J) => J.name),
|
|
453
|
+
dataItem: F,
|
|
454
|
+
total: f[R].total || M[b].total,
|
|
455
|
+
role: "gridcell",
|
|
456
|
+
ariaDescribedby: le.map((J) => J[b]).join(" ")
|
|
457
|
+
},
|
|
458
|
+
F && F.data && F.data.fmtValue ? F.data.fmtValue : " "
|
|
459
|
+
)
|
|
460
|
+
)
|
|
461
|
+
)))))
|
|
462
|
+
);
|
|
463
|
+
}), ue = {
|
|
464
|
+
rowAxes: [],
|
|
465
|
+
columnAxes: [],
|
|
466
|
+
data: [],
|
|
467
|
+
row: ct,
|
|
468
|
+
column: ze,
|
|
469
|
+
cell: dt,
|
|
470
|
+
headerCell: Be
|
|
471
|
+
};
|
|
472
|
+
gn.displayName = "KendoReactPivotGrid";
|
|
473
|
+
const ft = t.forwardRef((e, a) => {
|
|
474
|
+
const n = t.useRef(null), o = t.useRef(null);
|
|
475
|
+
return t.useImperativeHandle(o, () => ({ props: e, element: n.current })), t.useImperativeHandle(a, () => o.current), /* @__PURE__ */ t.createElement(
|
|
476
|
+
"div",
|
|
477
|
+
{
|
|
478
|
+
ref: n,
|
|
479
|
+
id: e.id,
|
|
480
|
+
style: e.style,
|
|
481
|
+
tabIndex: e.tabIndex,
|
|
482
|
+
className: ee(
|
|
483
|
+
"k-d-flex k-pos-relative",
|
|
484
|
+
{
|
|
485
|
+
"k-flex-row": e.configuratorPosition === "right",
|
|
486
|
+
"k-flex-row-reverse": e.configuratorPosition === "left",
|
|
487
|
+
"k-flex-column": e.configuratorPosition === "bottom",
|
|
488
|
+
"k-flex-column-reverse": e.configuratorPosition === "top"
|
|
489
|
+
},
|
|
490
|
+
e.className
|
|
491
|
+
)
|
|
492
|
+
},
|
|
493
|
+
e.children
|
|
494
|
+
);
|
|
495
|
+
}), hn = {
|
|
496
|
+
configuratorPosition: "right"
|
|
497
|
+
};
|
|
498
|
+
ft.defaultProps = hn;
|
|
499
|
+
ft.displayName = "KendoReactPivotGridContainer";
|
|
500
|
+
const gt = t.createContext({ axes: null });
|
|
501
|
+
var Ue = /* @__PURE__ */ ((e) => (e.toggle = "EXPAND_TOGGLE", e.expand = "EXPAND_EXPAND", e.collapse = "EXPAND_COLLAPSE", e))(Ue || {});
|
|
502
|
+
const xn = (e, a, n) => {
|
|
503
|
+
switch (a.type) {
|
|
504
|
+
case "EXPAND_TOGGLE":
|
|
505
|
+
return Array.isArray(e) ? e.find((o) => n(o, a.payload)) ? [...e.filter((o) => !n(o, a.payload))] : [...e, a.payload] : n(e, a.payload) ? null : a.payload;
|
|
506
|
+
case "EXPAND_EXPAND":
|
|
507
|
+
if (Array.isArray(e)) {
|
|
508
|
+
if (!e.find((o) => n(o, a.payload)))
|
|
509
|
+
return [...e, a.payload];
|
|
510
|
+
} else if (!n(e, a.payload))
|
|
511
|
+
return a.payload;
|
|
512
|
+
break;
|
|
513
|
+
case "EXPAND_COLLAPSE":
|
|
514
|
+
if (Array.isArray(e)) {
|
|
515
|
+
if (e.find((o) => n(o, a.payload)))
|
|
516
|
+
return [...e.filter((o) => !n(o, a.payload))];
|
|
517
|
+
} else
|
|
518
|
+
n(e, a.payload);
|
|
519
|
+
break;
|
|
520
|
+
default:
|
|
521
|
+
return e;
|
|
522
|
+
}
|
|
523
|
+
}, ht = (e = [], a, n, o = (l, i) => l === i) => {
|
|
524
|
+
const [l, i] = t.useState(e);
|
|
525
|
+
return [l, (s, E) => {
|
|
526
|
+
const m = xn(l, s, o);
|
|
527
|
+
a && a.call(void 0, {
|
|
528
|
+
value: m,
|
|
529
|
+
target: n.current,
|
|
530
|
+
syntheticEvent: E
|
|
531
|
+
}), i(m);
|
|
532
|
+
}];
|
|
533
|
+
};
|
|
534
|
+
var xt = /* @__PURE__ */ ((e) => (e.toggleExpansion = "PIVOT_CONFIGURATOR_ACTION_TOGGLE_EXPANSION", e))(xt || {});
|
|
535
|
+
const q = {
|
|
536
|
+
...Gt,
|
|
537
|
+
...xt
|
|
538
|
+
}, vn = (e, a) => {
|
|
539
|
+
const n = e.valueGetter("rowAxes"), o = e.valueGetter("columnAxes"), l = e.valueGetter("measureAxes"), i = e.valueGetter("sort"), u = e.valueGetter("filter"), [s, E] = ht(
|
|
540
|
+
[],
|
|
541
|
+
void 0,
|
|
542
|
+
a,
|
|
543
|
+
mt
|
|
544
|
+
), [m, x] = t.useState(null), [y, G] = t.useState(null), [k, U] = t.useState(null), [L, V] = t.useState(null);
|
|
545
|
+
return [
|
|
546
|
+
{
|
|
547
|
+
dragItem: m,
|
|
548
|
+
dropTarget: k,
|
|
549
|
+
dropZone: y,
|
|
550
|
+
dropDirection: L,
|
|
551
|
+
columnAxes: o,
|
|
552
|
+
rowAxes: n,
|
|
553
|
+
measureAxes: l,
|
|
554
|
+
sort: i,
|
|
555
|
+
filter: u,
|
|
556
|
+
expanded: s
|
|
557
|
+
},
|
|
558
|
+
(v, N) => {
|
|
559
|
+
switch (v.type) {
|
|
560
|
+
case q.toggleExpansion: {
|
|
561
|
+
E({ type: Ue.toggle, payload: v.payload }, N);
|
|
562
|
+
break;
|
|
563
|
+
}
|
|
564
|
+
default:
|
|
565
|
+
const f = Ot(
|
|
566
|
+
{
|
|
567
|
+
filter: v.override && v.override.filter !== void 0 ? v.override.filter : u,
|
|
568
|
+
sort: v.override && v.override.sort !== void 0 ? v.override.sort : i,
|
|
569
|
+
rowAxes: v.override && v.override.rowAxes !== void 0 ? v.override.rowAxes : n,
|
|
570
|
+
columnAxes: v.override && v.override.columnAxes !== void 0 ? v.override.columnAxes : o,
|
|
571
|
+
measureAxes: v.override && v.override.measureAxes !== void 0 ? v.override.measureAxes : l,
|
|
572
|
+
dragItem: v.override && v.override.dragItem !== void 0 ? v.override.dragItem : m,
|
|
573
|
+
dropDirection: v.override && v.override.dropDirection !== void 0 ? v.override.dropDirection : L,
|
|
574
|
+
dropTarget: v.override && v.override.dropTarget !== void 0 ? v.override.dropTarget : k,
|
|
575
|
+
dropZone: v.override && v.override.dropZone !== void 0 ? v.override.dropZone : y
|
|
576
|
+
},
|
|
577
|
+
v
|
|
578
|
+
);
|
|
579
|
+
f.columnAxes !== void 0 && e.onChange("columnAxes", { value: f.columnAxes }), f.rowAxes !== void 0 && e.onChange("rowAxes", { value: f.rowAxes }), f.measureAxes !== void 0 && e.onChange("measureAxes", { value: f.measureAxes }), f.sort !== void 0 && e.onChange("sort", { value: f.sort }), f.filter !== void 0 && e.onChange("filter", { value: f.filter }), f.dropDirection !== void 0 && V(f.dropDirection), f.dropTarget !== void 0 && U(f.dropTarget), f.dropZone !== void 0 && G(f.dropZone), f.dragItem !== void 0 && x(f.dragItem);
|
|
580
|
+
break;
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
];
|
|
584
|
+
}, vt = t.createContext({}), be = t.createContext(
|
|
585
|
+
[
|
|
586
|
+
{
|
|
587
|
+
expanded: [],
|
|
588
|
+
rowAxes: [],
|
|
589
|
+
columnAxes: [],
|
|
590
|
+
measureAxes: [],
|
|
591
|
+
dragItem: null,
|
|
592
|
+
dropZone: null,
|
|
593
|
+
dropDirection: null,
|
|
594
|
+
dropTarget: null
|
|
595
|
+
},
|
|
596
|
+
Mt
|
|
597
|
+
]
|
|
598
|
+
), Ve = t.forwardRef(
|
|
599
|
+
(e, a) => {
|
|
600
|
+
const {
|
|
601
|
+
data: n,
|
|
602
|
+
dataItem: o,
|
|
603
|
+
defaultFilter: l
|
|
604
|
+
} = { ...te, ...e }, i = t.useRef(null), u = t.useRef(null), s = xe(), [E, m] = I(e.columnMenuItem || te.columnMenuItem), [x, y] = I(e.columnMenuForm || te.columnMenuForm), [G, k] = I(e.resetButton || te.resetButton), [U, L] = I(e.applyButton || te.applyButton), [V, $] = I(e.treeView || te.treeView), [v, N] = I(e.noData || te.noData);
|
|
605
|
+
t.useImperativeHandle(u, () => ({ props: e, element: i.current })), t.useImperativeHandle(a, () => u.current);
|
|
606
|
+
const [f, z] = t.useState(!1), {
|
|
607
|
+
onAxisFilterFieldsExpandChange: K,
|
|
608
|
+
onAxisFilterFieldExpand: D
|
|
609
|
+
} = t.useContext(vt), [, c] = t.useContext(be), [A, M] = t.useState(l), P = A ? A.value.split(",") : [], [p, X] = ht(
|
|
610
|
+
[],
|
|
611
|
+
void 0,
|
|
612
|
+
u,
|
|
613
|
+
mt
|
|
614
|
+
), j = {
|
|
615
|
+
caption: (d) => d.dataItem.caption,
|
|
616
|
+
id: (d) => d.dataItem.uniqueName,
|
|
617
|
+
parent: (d, H) => H && H.value,
|
|
618
|
+
value: (d) => d.dataItem.defaultHierarchy || d.dataItem.uniqueName,
|
|
619
|
+
expanded: (d) => p.some((H) => H.uniqueName === d.id),
|
|
620
|
+
checked: (d) => !P.length || (P || []).some((H) => H === d.dataItem.uniqueName),
|
|
621
|
+
hasChildren: (d) => parseInt(d.dataItem.childrenCardinality, 10) > 0,
|
|
622
|
+
children: (d) => we(d.dataItem.children, j, d),
|
|
623
|
+
checkIndeterminate: (d) => {
|
|
624
|
+
const H = (d.children || []).length && d.children.every((B) => B.checked);
|
|
625
|
+
return H && (d.checked = !0), (d.children || []).some((B) => B.checked) && !H;
|
|
626
|
+
}
|
|
627
|
+
}, r = we(n, j), g = Ke(r), C = (d) => {
|
|
628
|
+
z(!f), K && K({
|
|
629
|
+
value: !f,
|
|
630
|
+
target: u.current,
|
|
631
|
+
syntheticEvent: d
|
|
632
|
+
});
|
|
633
|
+
}, w = (d) => {
|
|
634
|
+
X({ type: Ue.toggle, payload: d.item.dataItem }, d.syntheticEvent), D && D({
|
|
635
|
+
value: d.item.dataItem,
|
|
636
|
+
target: u.current,
|
|
637
|
+
syntheticEvent: d.syntheticEvent
|
|
638
|
+
});
|
|
639
|
+
}, S = (d) => {
|
|
640
|
+
let H;
|
|
641
|
+
d.item.checked ? H = {
|
|
642
|
+
field: String(o.name),
|
|
643
|
+
operator: "in",
|
|
644
|
+
value: g.filter((B) => B.checked).map((B) => String(B.value)).filter((B) => B !== d.item.value && B !== d.item.parent).join(",")
|
|
645
|
+
} : H = {
|
|
646
|
+
field: String(o.name),
|
|
647
|
+
operator: "in",
|
|
648
|
+
value: g.filter((B) => B.checked).map((B) => String(B.value)).concat([d.item.value]).join(",")
|
|
649
|
+
}, M(H);
|
|
650
|
+
}, O = (d) => {
|
|
651
|
+
z(!1), A && c({
|
|
652
|
+
type: q.removeFilter,
|
|
653
|
+
payload: A
|
|
654
|
+
}, d);
|
|
655
|
+
}, _ = (d) => {
|
|
656
|
+
z(!1), A && c({
|
|
657
|
+
type: l ? q.changeFilter : q.addFilter,
|
|
658
|
+
payload: A
|
|
659
|
+
}, d);
|
|
660
|
+
};
|
|
661
|
+
return /* @__PURE__ */ t.createElement(
|
|
662
|
+
"div",
|
|
663
|
+
{
|
|
664
|
+
ref: i,
|
|
665
|
+
id: e.id,
|
|
666
|
+
tabIndex: e.tabIndex,
|
|
667
|
+
style: e.style,
|
|
668
|
+
className: ee("k-columnmenu-item-wrapper", e.className)
|
|
669
|
+
},
|
|
670
|
+
/* @__PURE__ */ t.createElement(
|
|
671
|
+
E,
|
|
672
|
+
{
|
|
673
|
+
...m,
|
|
674
|
+
title: "Include Fields",
|
|
675
|
+
iconClass: "k-i-grid-layout",
|
|
676
|
+
svgIcon: Zt,
|
|
677
|
+
onClick: C
|
|
678
|
+
}
|
|
679
|
+
),
|
|
680
|
+
/* @__PURE__ */ t.createElement(
|
|
681
|
+
x,
|
|
682
|
+
{
|
|
683
|
+
show: f,
|
|
684
|
+
actions: /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
|
|
685
|
+
G,
|
|
686
|
+
{
|
|
687
|
+
type: "reset",
|
|
688
|
+
onClick: O,
|
|
689
|
+
...k
|
|
690
|
+
},
|
|
691
|
+
s.toLanguageString(Ne, Z[Ne])
|
|
692
|
+
), /* @__PURE__ */ t.createElement(
|
|
693
|
+
U,
|
|
694
|
+
{
|
|
695
|
+
themeColor: "primary",
|
|
696
|
+
onClick: _,
|
|
697
|
+
...L
|
|
698
|
+
},
|
|
699
|
+
s.toLanguageString(Se, Z[Se])
|
|
700
|
+
)),
|
|
701
|
+
...y
|
|
702
|
+
},
|
|
703
|
+
r && r.length ? /* @__PURE__ */ t.createElement(
|
|
704
|
+
V,
|
|
705
|
+
{
|
|
706
|
+
data: r,
|
|
707
|
+
checkboxes: !0,
|
|
708
|
+
onExpandChange: w,
|
|
709
|
+
onCheckChange: S,
|
|
710
|
+
textField: "caption",
|
|
711
|
+
expandIcons: !0,
|
|
712
|
+
hasChildrenField: "hasChildren",
|
|
713
|
+
checkIndeterminateField: "checkIndeterminate",
|
|
714
|
+
childrenField: "children",
|
|
715
|
+
...$
|
|
716
|
+
}
|
|
717
|
+
) : /* @__PURE__ */ t.createElement(v, { ...N })
|
|
718
|
+
)
|
|
719
|
+
);
|
|
720
|
+
}
|
|
721
|
+
), te = {
|
|
722
|
+
data: [],
|
|
723
|
+
resetButton: ye,
|
|
724
|
+
applyButton: ye,
|
|
725
|
+
treeView: st,
|
|
726
|
+
noData: () => /* @__PURE__ */ t.createElement(rn, { shape: "rectangle", style: { height: "20px", width: "calc(100% - 16px)", margin: 8 } }),
|
|
727
|
+
columnMenuItem: en,
|
|
728
|
+
columnMenuForm: tn
|
|
729
|
+
};
|
|
730
|
+
Ve.defaultProps = te;
|
|
731
|
+
Ve.displayName = "KendoReactPivotGridAxisFilterFieldsEditor";
|
|
732
|
+
const $e = t.forwardRef((e, a) => {
|
|
733
|
+
const n = t.useRef(0), o = t.useRef(0), l = t.useRef(null), i = t.useRef(null), u = t.useRef(null), { axes: s } = t.useContext(gt), [E, m] = t.useState(!1), [x, y] = t.useContext(be);
|
|
734
|
+
t.useImperativeHandle(i, () => l.current && l.current.element), t.useImperativeHandle(u, () => ({ props: e, element: i.current })), t.useImperativeHandle(a, () => u.current);
|
|
735
|
+
const [G, k] = I(e.chip || fe.chip), [U, L] = I(e.dropClue || fe.dropClue), [V, $] = I(e.columnMenuTextColumn || fe.columnMenuTextColumn), [v, N] = I(e.filterFieldsEditor || fe.filterFieldsEditor), f = nt(x.filter, String(e.value), "in"), z = nt(x.filter, String(e.value)), K = (r, g) => {
|
|
736
|
+
y({ type: q.setSort, payload: g }, r);
|
|
737
|
+
}, D = (r, g) => {
|
|
738
|
+
g.length ? y({
|
|
739
|
+
type: q.setFilter,
|
|
740
|
+
payload: [
|
|
741
|
+
...f || [],
|
|
742
|
+
...g.reduce((C, w) => [
|
|
743
|
+
...C,
|
|
744
|
+
...w.filters.filter((S) => S.value)
|
|
745
|
+
], [])
|
|
746
|
+
]
|
|
747
|
+
}, r) : y({ type: q.setFilter, payload: f }, r);
|
|
748
|
+
}, c = (r) => {
|
|
749
|
+
y({ type: q.remove, payload: e.dataItem }, r.syntheticEvent);
|
|
750
|
+
}, A = (r) => {
|
|
751
|
+
const g = r.slice(), C = fn(x.filter, String(e.dataItem.name), "in");
|
|
752
|
+
return g.splice(1, 0, /* @__PURE__ */ t.createElement(
|
|
753
|
+
v,
|
|
754
|
+
{
|
|
755
|
+
key: "axis-filter-fields-editor",
|
|
756
|
+
defaultFilter: C,
|
|
757
|
+
dataItem: e.dataItem,
|
|
758
|
+
data: e.dataItem.fields,
|
|
759
|
+
axes: s,
|
|
760
|
+
...N
|
|
761
|
+
}
|
|
762
|
+
)), g;
|
|
763
|
+
}, M = (r) => {
|
|
764
|
+
n.current = r.clientX, o.current = r.clientY;
|
|
765
|
+
}, P = (r) => {
|
|
766
|
+
Math.abs(n.current - r.clientX) < 10 && Math.abs(o.current - r.clientY) < 10 || (i.current && (i.current.style.transform = `translate(${r.clientX - n.current}px, ${r.clientY - o.current}px)`), m(!0), y({ type: q.setDragItem, payload: e.dataItem }));
|
|
767
|
+
}, p = () => {
|
|
768
|
+
m(!1), x.dragItem && (i.current && (i.current.style.transform = ""), y({ type: q.drop, payload: e.dataItem }));
|
|
769
|
+
}, X = (r) => {
|
|
770
|
+
x.dragItem && (y({ type: q.setDropTarget, payload: e.dataItem }, r.syntheticEvent), y({ type: q.setDropZone, payload: s }, r.syntheticEvent));
|
|
771
|
+
}, j = (r) => {
|
|
772
|
+
if (x.dragItem && !E && i.current) {
|
|
773
|
+
const g = i.current.getBoundingClientRect(), w = r.syntheticEvent.clientX - g.left < g.width / 2 ? "before" : "after";
|
|
774
|
+
y({ type: q.setDropDirection, payload: w }, r.syntheticEvent);
|
|
775
|
+
}
|
|
776
|
+
};
|
|
777
|
+
return Tt(i, {
|
|
778
|
+
onPress: M,
|
|
779
|
+
onDrag: P,
|
|
780
|
+
onRelease: p
|
|
781
|
+
}), /* @__PURE__ */ t.createElement(t.Fragment, null, x.dropTarget && Qe(x.dropTarget, e.dataItem) && x.dropDirection === "before" && /* @__PURE__ */ t.createElement(U, { ...L }), /* @__PURE__ */ t.createElement(
|
|
782
|
+
G,
|
|
783
|
+
{
|
|
784
|
+
ref: Fe(G) ? l : void 0,
|
|
785
|
+
...e,
|
|
786
|
+
removable: !0,
|
|
787
|
+
onRemove: c,
|
|
788
|
+
onMouseEnter: X,
|
|
789
|
+
onMouseMove: j,
|
|
790
|
+
style: { pointerEvents: E ? "none" : void 0 },
|
|
791
|
+
rounded: "full",
|
|
792
|
+
...k
|
|
793
|
+
},
|
|
794
|
+
e.text,
|
|
795
|
+
s !== "measureAxes" && /* @__PURE__ */ t.createElement(
|
|
796
|
+
V,
|
|
797
|
+
{
|
|
798
|
+
field: String(e.value),
|
|
799
|
+
itemsRender: A,
|
|
800
|
+
sort: x.sort,
|
|
801
|
+
onSortChange: K,
|
|
802
|
+
filter: z && z.length ? [{ logic: "and", filters: z }] : void 0,
|
|
803
|
+
onFilterChange: D,
|
|
804
|
+
filterContent: [
|
|
805
|
+
nn
|
|
806
|
+
],
|
|
807
|
+
...$
|
|
808
|
+
}
|
|
809
|
+
)
|
|
810
|
+
), x.dropTarget && Qe(x.dropTarget, e.dataItem) && x.dropDirection === "after" && /* @__PURE__ */ t.createElement(U, { ...L }));
|
|
811
|
+
}), fe = {
|
|
812
|
+
chip: Jt,
|
|
813
|
+
columnMenuTextColumn: an,
|
|
814
|
+
filterFieldsEditor: Ve,
|
|
815
|
+
dropClue: (e) => /* @__PURE__ */ t.createElement("div", { className: "k-grouping-dropclue", style: { position: "relative", zIndex: 1e4 }, ...e })
|
|
816
|
+
};
|
|
817
|
+
$e.defaultProps = fe;
|
|
818
|
+
$e.displayName = "KendoReactPivotGridAxisEditor";
|
|
819
|
+
const ce = t.forwardRef((e, a) => {
|
|
820
|
+
const {
|
|
821
|
+
value: n,
|
|
822
|
+
field: o
|
|
823
|
+
} = { ...qe, ...e }, l = t.useRef(null), i = t.useRef(null), u = t.useRef(null), [s, E] = I(e.chipList || qe.chipList);
|
|
824
|
+
t.useImperativeHandle(i, () => l.current && l.current.element), t.useImperativeHandle(u, () => ({ props: e, element: i.current })), t.useImperativeHandle(a, () => u.current);
|
|
825
|
+
const m = n.filter((x) => x.name.length === 1 && x.name.every((y) => y.indexOf("&") === -1)).map((x) => ({ ...x, text: String(x.name) }));
|
|
826
|
+
return /* @__PURE__ */ t.createElement(gt.Provider, { value: { axes: o } }, /* @__PURE__ */ t.createElement(
|
|
827
|
+
s,
|
|
828
|
+
{
|
|
829
|
+
ref: Fe(s) ? l : void 0,
|
|
830
|
+
textField: "text",
|
|
831
|
+
valueField: "name",
|
|
832
|
+
data: m,
|
|
833
|
+
chip: $e,
|
|
834
|
+
style: { position: "relative" },
|
|
835
|
+
className: e.className,
|
|
836
|
+
selection: "none",
|
|
837
|
+
...E
|
|
838
|
+
}
|
|
839
|
+
));
|
|
840
|
+
}), qe = {
|
|
841
|
+
value: [],
|
|
842
|
+
chipList: Yt
|
|
843
|
+
};
|
|
844
|
+
ce.defaultProps = qe;
|
|
845
|
+
ce.displayName = "KendoReactPivotGridAxesEditor";
|
|
846
|
+
const _e = t.forwardRef((e, a) => {
|
|
847
|
+
const {
|
|
848
|
+
data: n,
|
|
849
|
+
rowAxes: o,
|
|
850
|
+
columnAxes: l,
|
|
851
|
+
measureAxes: i,
|
|
852
|
+
onExpand: u,
|
|
853
|
+
onCheck: s
|
|
854
|
+
} = { ...Ae, ...e }, E = t.useRef(null), m = t.useRef(null), [x, y] = I(e.treeView || Ae.treeView), [G, k] = I(e.noData || Ae.noData);
|
|
855
|
+
t.useImperativeHandle(m, () => ({ props: e, element: E.current && E.current.element })), t.useImperativeHandle(a, () => m.current);
|
|
856
|
+
const [U] = t.useContext(be), L = Pe(l), V = Pe(o), $ = Pe(i), N = Ke(n).filter((c) => [
|
|
857
|
+
...L,
|
|
858
|
+
...V,
|
|
859
|
+
...$
|
|
860
|
+
].some((A) => A === c.uniqueName || A === c.defaultHierarchy)), f = {
|
|
861
|
+
caption: (c) => c.dataItem.caption,
|
|
862
|
+
id: (c) => c.dataItem.uniqueName,
|
|
863
|
+
value: (c) => c.dataItem.defaultHierarchy || c.dataItem.uniqueName,
|
|
864
|
+
expanded: (c) => U.expanded.some((A) => A.uniqueName === c.dataItem.uniqueName),
|
|
865
|
+
hasChildren: (c) => !("hierarchyUniqueName" in c.dataItem) && !("aggregator" in c.dataItem),
|
|
866
|
+
selectable: (c) => !(!c.hasChildren && !c.dataItem.aggregator && !c.dataItem.measure || c.dataItem.type === 2 || c.dataItem.uniqueName === "[KPIs]"),
|
|
867
|
+
children: (c) => we(c.dataItem.children, f, c),
|
|
868
|
+
checked: (c) => N.some((A) => c.dataItem.defaultHierarchy ? A.defaultHierarchy === c.dataItem.defaultHierarchy : A.uniqueName === c.dataItem.uniqueName) || c.children.length && c.children.every((A) => A.checked)
|
|
869
|
+
}, z = (c) => {
|
|
870
|
+
u && u({
|
|
871
|
+
value: c.item.dataItem,
|
|
872
|
+
target: m.current,
|
|
873
|
+
syntheticEvent: c.syntheticEvent
|
|
874
|
+
});
|
|
875
|
+
}, K = (c) => {
|
|
876
|
+
s && s({
|
|
877
|
+
value: c.item.dataItem,
|
|
878
|
+
target: m.current,
|
|
879
|
+
syntheticEvent: c.syntheticEvent
|
|
880
|
+
});
|
|
881
|
+
}, D = we(e.data, f);
|
|
882
|
+
return /* @__PURE__ */ t.createElement(on.Provider, { value: (c) => ({ ...c, checkboxes: c.item.selectable }) }, D && D.length ? /* @__PURE__ */ t.createElement(
|
|
883
|
+
x,
|
|
884
|
+
{
|
|
885
|
+
ref: Fe(x) ? E : void 0,
|
|
886
|
+
data: D,
|
|
887
|
+
checkboxes: !0,
|
|
888
|
+
onExpandChange: z,
|
|
889
|
+
onCheckChange: K,
|
|
890
|
+
textField: "caption",
|
|
891
|
+
expandIcons: !0,
|
|
892
|
+
hasChildrenField: "hasChildren",
|
|
893
|
+
checkIndeterminateField: "checkIndeterminate",
|
|
894
|
+
childrenField: "children",
|
|
895
|
+
...y
|
|
896
|
+
}
|
|
897
|
+
) : /* @__PURE__ */ t.createElement(G, { ...k }));
|
|
898
|
+
}), Ae = {
|
|
899
|
+
data: [],
|
|
900
|
+
rowAxes: [],
|
|
901
|
+
columnAxes: [],
|
|
902
|
+
measureAxes: [],
|
|
903
|
+
treeView: st,
|
|
904
|
+
noData: () => /* @__PURE__ */ t.createElement("div", null, "NO DATA")
|
|
905
|
+
};
|
|
906
|
+
_e.defaultProps = Ae;
|
|
907
|
+
_e.displayName = "KendoReactPivotGridFieldsEditor";
|
|
908
|
+
const Xe = t.forwardRef((e, a) => {
|
|
909
|
+
const {
|
|
910
|
+
onFieldsEditorFieldCheck: n,
|
|
911
|
+
onFieldsEditorFieldCheckAction: o,
|
|
912
|
+
onFieldsEditorFieldExpand: l,
|
|
913
|
+
onFieldsEditorFieldExpandAction: i,
|
|
914
|
+
onAxisFilterFieldExpand: u,
|
|
915
|
+
onAxisFilterFieldsExpandChange: s
|
|
916
|
+
} = e, [E, m] = I(e.fieldsLabel || Q.fieldsLabel), [x, y] = I(e.fieldsEditor || Q.fieldsEditor), [G, k] = I(e.columnAxesLabel || Q.columnAxesLabel), [U, L] = I(e.columnAxesEditor || Q.columnAxesEditor), [V, $] = I(e.rowAxesLabel || Q.rowAxesLabel), [v, N] = I(e.rowAxesEditor || Q.rowAxesEditor), [f, z] = I(e.measureAxesLabel || Q.measureAxesLabel), [K, D] = I(e.measureAxesEditor || Q.measureAxesEditor), c = t.useRef(null), A = t.useRef(null), M = xe(), [P, p] = vn(e, A);
|
|
917
|
+
t.useImperativeHandle(A, () => ({
|
|
918
|
+
element: c.current,
|
|
919
|
+
props: e,
|
|
920
|
+
state: P
|
|
921
|
+
})), t.useImperativeHandle(a, () => A.current);
|
|
922
|
+
const X = () => {
|
|
923
|
+
P.dragItem && p({ type: q.setDropZone, payload: "columnAxes" });
|
|
924
|
+
}, j = () => {
|
|
925
|
+
P.dragItem && p({ type: q.setDropZone, payload: null });
|
|
926
|
+
}, r = () => {
|
|
927
|
+
P.dragItem && p({ type: q.setDropZone, payload: "rowAxes" });
|
|
928
|
+
}, g = () => {
|
|
929
|
+
P.dragItem && p({ type: q.setDropZone, payload: null });
|
|
930
|
+
}, C = () => {
|
|
931
|
+
P.dragItem && p({ type: q.setDropZone, payload: "measureAxes" });
|
|
932
|
+
}, w = () => {
|
|
933
|
+
P.dragItem && p({ type: q.setDropZone, payload: null });
|
|
934
|
+
}, S = (T) => {
|
|
935
|
+
const W = {
|
|
936
|
+
target: T.target,
|
|
937
|
+
currentTarget: A.current,
|
|
938
|
+
value: T.value,
|
|
939
|
+
syntheticEvent: T.syntheticEvent
|
|
940
|
+
};
|
|
941
|
+
if (i) {
|
|
942
|
+
const Y = i(W, e, P);
|
|
943
|
+
Y && (Array.isArray(Y) ? Y.filter(Boolean).map((ne) => ne && p({ ...ne }, T.syntheticEvent)) : p({ ...Y }, T.syntheticEvent));
|
|
944
|
+
}
|
|
945
|
+
l && l({
|
|
946
|
+
target: T.target,
|
|
947
|
+
currentTarget: A.current,
|
|
948
|
+
value: T.value,
|
|
949
|
+
syntheticEvent: T.syntheticEvent
|
|
950
|
+
});
|
|
951
|
+
}, O = (T) => {
|
|
952
|
+
const W = {
|
|
953
|
+
target: T.target,
|
|
954
|
+
currentTarget: A.current,
|
|
955
|
+
value: T.value,
|
|
956
|
+
syntheticEvent: T.syntheticEvent
|
|
957
|
+
};
|
|
958
|
+
if (o) {
|
|
959
|
+
const Y = o(W, e, P);
|
|
960
|
+
Y && (Array.isArray(Y) ? Y.filter(Boolean).map((ne) => ne && p({ ...ne }, T.syntheticEvent)) : p({ ...Y }, T.syntheticEvent));
|
|
961
|
+
}
|
|
962
|
+
n && n(W);
|
|
963
|
+
}, _ = (T) => {
|
|
964
|
+
const W = {
|
|
965
|
+
target: T.target,
|
|
966
|
+
currentTarget: A.current,
|
|
967
|
+
value: T.value,
|
|
968
|
+
syntheticEvent: T.syntheticEvent
|
|
969
|
+
};
|
|
970
|
+
u && u(W);
|
|
971
|
+
}, d = (T) => {
|
|
972
|
+
const W = {
|
|
973
|
+
target: T.target,
|
|
974
|
+
currentTarget: A.current,
|
|
975
|
+
value: T.value,
|
|
976
|
+
syntheticEvent: T.syntheticEvent
|
|
977
|
+
};
|
|
978
|
+
s && s(W);
|
|
979
|
+
}, H = e.horizontal ? "div" : t.Fragment, B = e.horizontal ? { className: "k-form-field-wrapper" } : {};
|
|
980
|
+
return /* @__PURE__ */ t.createElement(
|
|
981
|
+
vt.Provider,
|
|
982
|
+
{
|
|
983
|
+
value: {
|
|
984
|
+
onAxisFilterFieldExpand: _,
|
|
985
|
+
onAxisFilterFieldsExpandChange: d
|
|
986
|
+
}
|
|
987
|
+
},
|
|
988
|
+
/* @__PURE__ */ t.createElement(be.Provider, { value: [P, p] }, /* @__PURE__ */ t.createElement(H, { ...B }, /* @__PURE__ */ t.createElement("div", { className: "k-form-field" }, /* @__PURE__ */ t.createElement(E, { name: "", component: me, ...m }, M.toLanguageString(Ge, Z[Ge]))), /* @__PURE__ */ t.createElement("div", { className: "k-form-field" }, /* @__PURE__ */ t.createElement("div", { className: "k-fields-list-wrapper" }, /* @__PURE__ */ t.createElement(
|
|
989
|
+
x,
|
|
990
|
+
{
|
|
991
|
+
data: e.data,
|
|
992
|
+
onExpand: S,
|
|
993
|
+
onCheck: O,
|
|
994
|
+
columnAxes: P.columnAxes,
|
|
995
|
+
rowAxes: P.rowAxes,
|
|
996
|
+
measureAxes: P.measureAxes,
|
|
997
|
+
...y
|
|
998
|
+
}
|
|
999
|
+
)))), /* @__PURE__ */ t.createElement(H, { ...B }, /* @__PURE__ */ t.createElement(
|
|
1000
|
+
"div",
|
|
1001
|
+
{
|
|
1002
|
+
className: "k-form-field",
|
|
1003
|
+
onMouseEnter: X,
|
|
1004
|
+
onMouseLeave: j
|
|
1005
|
+
},
|
|
1006
|
+
/* @__PURE__ */ t.createElement(
|
|
1007
|
+
se,
|
|
1008
|
+
{
|
|
1009
|
+
name: "columnAxes",
|
|
1010
|
+
field: "columnAxes",
|
|
1011
|
+
component: G,
|
|
1012
|
+
...k
|
|
1013
|
+
},
|
|
1014
|
+
M.toLanguageString(Le, Z[Le])
|
|
1015
|
+
)
|
|
1016
|
+
), e.valueGetter("columnAxes").length ? /* @__PURE__ */ t.createElement(
|
|
1017
|
+
se,
|
|
1018
|
+
{
|
|
1019
|
+
name: "columnAxes",
|
|
1020
|
+
field: "columnAxes",
|
|
1021
|
+
component: U,
|
|
1022
|
+
onMouseEnter: X,
|
|
1023
|
+
onMouseLeave: j,
|
|
1024
|
+
className: "k-column-fields",
|
|
1025
|
+
...L
|
|
1026
|
+
}
|
|
1027
|
+
) : /* @__PURE__ */ t.createElement(
|
|
1028
|
+
"div",
|
|
1029
|
+
{
|
|
1030
|
+
className: "k-settings-description",
|
|
1031
|
+
onMouseEnter: X,
|
|
1032
|
+
onMouseLeave: j
|
|
1033
|
+
},
|
|
1034
|
+
M.toLanguageString(ae, Z[ae])
|
|
1035
|
+
), /* @__PURE__ */ t.createElement(
|
|
1036
|
+
"div",
|
|
1037
|
+
{
|
|
1038
|
+
className: "k-form-field",
|
|
1039
|
+
onMouseEnter: r,
|
|
1040
|
+
onMouseLeave: g
|
|
1041
|
+
},
|
|
1042
|
+
/* @__PURE__ */ t.createElement(
|
|
1043
|
+
se,
|
|
1044
|
+
{
|
|
1045
|
+
name: "rowAxes",
|
|
1046
|
+
field: "rowAxes",
|
|
1047
|
+
component: V,
|
|
1048
|
+
...$
|
|
1049
|
+
},
|
|
1050
|
+
M.toLanguageString(De, Z[De])
|
|
1051
|
+
)
|
|
1052
|
+
), e.valueGetter("rowAxes").length ? /* @__PURE__ */ t.createElement(
|
|
1053
|
+
se,
|
|
1054
|
+
{
|
|
1055
|
+
name: "rowAxes",
|
|
1056
|
+
field: "rowAxes",
|
|
1057
|
+
component: v,
|
|
1058
|
+
onMouseEnter: r,
|
|
1059
|
+
onMouseLeave: g,
|
|
1060
|
+
className: "k-column-fields",
|
|
1061
|
+
...N
|
|
1062
|
+
}
|
|
1063
|
+
) : /* @__PURE__ */ t.createElement(
|
|
1064
|
+
"div",
|
|
1065
|
+
{
|
|
1066
|
+
className: "k-settings-description",
|
|
1067
|
+
onMouseEnter: r,
|
|
1068
|
+
onMouseLeave: g
|
|
1069
|
+
},
|
|
1070
|
+
M.toLanguageString(ae, Z[ae])
|
|
1071
|
+
)), /* @__PURE__ */ t.createElement(H, { ...B }, /* @__PURE__ */ t.createElement(
|
|
1072
|
+
"div",
|
|
1073
|
+
{
|
|
1074
|
+
className: "k-form-field",
|
|
1075
|
+
onMouseEnter: C,
|
|
1076
|
+
onMouseLeave: w
|
|
1077
|
+
},
|
|
1078
|
+
/* @__PURE__ */ t.createElement(
|
|
1079
|
+
se,
|
|
1080
|
+
{
|
|
1081
|
+
name: "measureAxes",
|
|
1082
|
+
field: "measureAxes",
|
|
1083
|
+
component: f,
|
|
1084
|
+
...z
|
|
1085
|
+
},
|
|
1086
|
+
M.toLanguageString(He, Z[He])
|
|
1087
|
+
)
|
|
1088
|
+
), e.valueGetter("measureAxes").length ? /* @__PURE__ */ t.createElement(
|
|
1089
|
+
se,
|
|
1090
|
+
{
|
|
1091
|
+
name: "measureAxes",
|
|
1092
|
+
field: "measureAxes",
|
|
1093
|
+
component: K,
|
|
1094
|
+
onMouseEnter: C,
|
|
1095
|
+
onMouseLeave: w,
|
|
1096
|
+
className: "k-column-fields",
|
|
1097
|
+
...D
|
|
1098
|
+
}
|
|
1099
|
+
) : /* @__PURE__ */ t.createElement(
|
|
1100
|
+
"div",
|
|
1101
|
+
{
|
|
1102
|
+
className: "k-settings-description",
|
|
1103
|
+
onMouseEnter: C,
|
|
1104
|
+
onMouseLeave: w
|
|
1105
|
+
},
|
|
1106
|
+
M.toLanguageString(ae, Z[ae])
|
|
1107
|
+
)))
|
|
1108
|
+
);
|
|
1109
|
+
}), Q = {
|
|
1110
|
+
data: [],
|
|
1111
|
+
horizontal: !1,
|
|
1112
|
+
fieldsLabel: me,
|
|
1113
|
+
fieldsEditor: _e,
|
|
1114
|
+
columnAxesLabel: me,
|
|
1115
|
+
columnAxesEditor: ce,
|
|
1116
|
+
rowAxesLabel: me,
|
|
1117
|
+
rowAxesEditor: ce,
|
|
1118
|
+
measureAxesLabel: me,
|
|
1119
|
+
measureAxesEditor: ce,
|
|
1120
|
+
axesEditor: ce,
|
|
1121
|
+
onFieldsEditorFieldCheckAction: (e) => ({ type: q.toggleSelection, payload: e.value }),
|
|
1122
|
+
onFieldsEditorFieldExpandAction: (e) => ({ type: q.toggleExpansion, payload: e.value })
|
|
1123
|
+
};
|
|
1124
|
+
Xe.defaultProps = Q;
|
|
1125
|
+
Xe.displayName = "KendoReactPivotGridConfiguratorEditor";
|
|
1126
|
+
const Ct = t.forwardRef((e, a) => {
|
|
1127
|
+
const {
|
|
1128
|
+
horizontal: n,
|
|
1129
|
+
data: o,
|
|
1130
|
+
rowAxes: l,
|
|
1131
|
+
columnAxes: i,
|
|
1132
|
+
measureAxes: u
|
|
1133
|
+
} = { ...ge, ...e }, s = t.useRef(null), E = t.useRef(null), m = t.useRef(null), x = xe(), [y, G] = I(e.editor || ge.editor), [k, U] = I(e.form || ge.form), [L, V] = I(e.formElement || ge.formElement);
|
|
1134
|
+
t.useImperativeHandle(E, () => ({ props: e, element: s.current })), t.useImperativeHandle(a, () => E.current);
|
|
1135
|
+
const $ = (N, f) => {
|
|
1136
|
+
e.onRowAxesChange && e.onRowAxesChange({
|
|
1137
|
+
target: E.current,
|
|
1138
|
+
value: N.rowAxes,
|
|
1139
|
+
syntheticEvent: f
|
|
1140
|
+
}), e.onColumnAxesChange && e.onColumnAxesChange({
|
|
1141
|
+
target: E.current,
|
|
1142
|
+
value: N.columnAxes,
|
|
1143
|
+
syntheticEvent: f
|
|
1144
|
+
}), e.onMeasureAxesChange && e.onMeasureAxesChange({
|
|
1145
|
+
target: E.current,
|
|
1146
|
+
value: N.measureAxes,
|
|
1147
|
+
syntheticEvent: f
|
|
1148
|
+
}), e.onSortChange && e.onSortChange({
|
|
1149
|
+
target: E.current,
|
|
1150
|
+
value: N.sort,
|
|
1151
|
+
syntheticEvent: f
|
|
1152
|
+
}), e.onFilterChange && e.onFilterChange({
|
|
1153
|
+
target: E.current,
|
|
1154
|
+
value: N.filter,
|
|
1155
|
+
syntheticEvent: f
|
|
1156
|
+
});
|
|
1157
|
+
}, v = {
|
|
1158
|
+
rowAxes: l,
|
|
1159
|
+
columnAxes: i,
|
|
1160
|
+
measureAxes: u,
|
|
1161
|
+
sort: e.sort,
|
|
1162
|
+
filter: e.filter
|
|
1163
|
+
};
|
|
1164
|
+
return t.useEffect(() => {
|
|
1165
|
+
m.current && m.current.onChange("rowAxes", { value: l });
|
|
1166
|
+
}, [l]), t.useEffect(() => {
|
|
1167
|
+
m.current && m.current.onChange("columnAxes", { value: i });
|
|
1168
|
+
}, [i]), t.useEffect(() => {
|
|
1169
|
+
m.current && m.current.onChange("measureAxes", { value: u });
|
|
1170
|
+
}, [u]), t.useEffect(() => {
|
|
1171
|
+
m.current && m.current.onChange("sort", { value: e.sort });
|
|
1172
|
+
}, [e.sort]), t.useEffect(() => {
|
|
1173
|
+
m.current && m.current.onChange("filter", { value: e.filter });
|
|
1174
|
+
}, [e.filter]), /* @__PURE__ */ t.createElement(
|
|
1175
|
+
"div",
|
|
1176
|
+
{
|
|
1177
|
+
ref: s,
|
|
1178
|
+
id: e.id,
|
|
1179
|
+
tabIndex: e.tabIndex,
|
|
1180
|
+
style: e.style,
|
|
1181
|
+
className: ee(
|
|
1182
|
+
"k-pivotgrid-configurator",
|
|
1183
|
+
e.className
|
|
1184
|
+
)
|
|
1185
|
+
},
|
|
1186
|
+
/* @__PURE__ */ t.createElement(
|
|
1187
|
+
"div",
|
|
1188
|
+
{
|
|
1189
|
+
className: ee(
|
|
1190
|
+
"k-pivotgrid-configurator-panel",
|
|
1191
|
+
"k-pivotgrid-configurator-push",
|
|
1192
|
+
{
|
|
1193
|
+
"k-pivotgrid-configurator-horizontal": n,
|
|
1194
|
+
"k-pivotgrid-configurator-vertical": !n
|
|
1195
|
+
}
|
|
1196
|
+
)
|
|
1197
|
+
},
|
|
1198
|
+
/* @__PURE__ */ t.createElement("div", { className: "k-pivotgrid-configurator-header" }, /* @__PURE__ */ t.createElement("div", { className: "k-pivotgrid-configurator-header-text" }, x.toLanguageString(ke, Z[ke]))),
|
|
1199
|
+
/* @__PURE__ */ t.createElement(
|
|
1200
|
+
k,
|
|
1201
|
+
{
|
|
1202
|
+
ref: Fe(k) ? m : void 0,
|
|
1203
|
+
initialValues: v,
|
|
1204
|
+
onSubmit: $,
|
|
1205
|
+
render: (N) => /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("div", { className: "k-pivotgrid-configurator-content" }, /* @__PURE__ */ t.createElement(
|
|
1206
|
+
L,
|
|
1207
|
+
{
|
|
1208
|
+
horizontal: n,
|
|
1209
|
+
...V
|
|
1210
|
+
},
|
|
1211
|
+
/* @__PURE__ */ t.createElement(
|
|
1212
|
+
y,
|
|
1213
|
+
{
|
|
1214
|
+
...N,
|
|
1215
|
+
horizontal: e.horizontal,
|
|
1216
|
+
onFieldsEditorFieldExpand: e.onFieldsEditorFieldExpand,
|
|
1217
|
+
onFieldsEditorFieldCheck: e.onFieldsEditorFieldCheck,
|
|
1218
|
+
onAxisFilterFieldExpand: e.onAxisFilterFieldExpand,
|
|
1219
|
+
onAxisFilterFieldsExpandChange: e.onAxisFilterFieldsExpandChange,
|
|
1220
|
+
data: o,
|
|
1221
|
+
...G
|
|
1222
|
+
}
|
|
1223
|
+
)
|
|
1224
|
+
)), /* @__PURE__ */ t.createElement("div", { className: "k-pivotgrid-configurator-actions k-actions k-hstack k-justify-content-end" }, /* @__PURE__ */ t.createElement(ye, { type: "submit", onClick: N.onFormReset }, x.toLanguageString(Me, Z[Me])), /* @__PURE__ */ t.createElement(ye, { themeColor: "primary", type: "submit", onClick: N.onSubmit }, x.toLanguageString(Te, Z[Te])))),
|
|
1225
|
+
...U
|
|
1226
|
+
}
|
|
1227
|
+
)
|
|
1228
|
+
)
|
|
1229
|
+
);
|
|
1230
|
+
}), ge = {
|
|
1231
|
+
form: Wt,
|
|
1232
|
+
formElement: Qt,
|
|
1233
|
+
editor: Xe,
|
|
1234
|
+
horizontal: !1,
|
|
1235
|
+
data: [],
|
|
1236
|
+
columnAxes: [],
|
|
1237
|
+
rowAxes: [],
|
|
1238
|
+
measureAxes: []
|
|
1239
|
+
};
|
|
1240
|
+
Ct.defaultProps = ge;
|
|
1241
|
+
Ct.displayName = "KendoReactPivotGridConfigurator";
|
|
1242
|
+
const Et = t.forwardRef((e, a) => {
|
|
1243
|
+
const n = t.useRef(null), o = t.useRef(null), l = xe();
|
|
1244
|
+
t.useImperativeHandle(n, () => ({ props: e, element: o.current })), t.useImperativeHandle(a, () => n.current);
|
|
1245
|
+
const [i, u] = I(e.icon || At.icon), s = t.useMemo(
|
|
1246
|
+
() => ee("k-pivotgrid-configurator-button", e.className),
|
|
1247
|
+
[e.className]
|
|
1248
|
+
), E = he(
|
|
1249
|
+
e,
|
|
1250
|
+
n
|
|
1251
|
+
);
|
|
1252
|
+
return /* @__PURE__ */ t.createElement(
|
|
1253
|
+
"div",
|
|
1254
|
+
{
|
|
1255
|
+
ref: o,
|
|
1256
|
+
id: e.id,
|
|
1257
|
+
className: s,
|
|
1258
|
+
tabIndex: e.tabIndex,
|
|
1259
|
+
...E
|
|
1260
|
+
},
|
|
1261
|
+
/* @__PURE__ */ t.createElement("span", null, l.toLanguageString(Oe, Z[Oe]), /* @__PURE__ */ t.createElement(i, { name: "gear", icon: jt, ...u }))
|
|
1262
|
+
);
|
|
1263
|
+
}), At = {
|
|
1264
|
+
icon: ot
|
|
1265
|
+
};
|
|
1266
|
+
Et.defaultProps = At;
|
|
1267
|
+
Et.displayName = "KendoReactPivotGridConfiguratorButton";
|
|
1268
|
+
const Cn = (e) => {
|
|
1269
|
+
const [a, n] = t.useState(!0), [o, l] = t.useState({ data: [], columns: [], rows: [] }), [i, u] = t.useState([]), [s, E] = t.useState(e.defaultColumnAxes || []), [m, x] = t.useState(e.defaultRowAxes || []), [y, G] = t.useState(e.defaultMeasureAxes || []), [k, U] = t.useState(e.defaultSort || []), [L, V] = t.useState(e.defaultFilter || []), $ = (r) => {
|
|
1270
|
+
x(r.value);
|
|
1271
|
+
}, v = (r) => {
|
|
1272
|
+
E(r.value);
|
|
1273
|
+
}, N = (r) => {
|
|
1274
|
+
G(r.value);
|
|
1275
|
+
}, f = (r) => {
|
|
1276
|
+
U(r.value);
|
|
1277
|
+
}, z = (r) => {
|
|
1278
|
+
V(r.value);
|
|
1279
|
+
};
|
|
1280
|
+
t.useEffect(() => {
|
|
1281
|
+
n(!0);
|
|
1282
|
+
const r = {
|
|
1283
|
+
connection: {
|
|
1284
|
+
catalog: e.catalog,
|
|
1285
|
+
cube: e.cube
|
|
1286
|
+
},
|
|
1287
|
+
columnAxes: s.slice(),
|
|
1288
|
+
rowAxes: m.slice(),
|
|
1289
|
+
measureAxes: y,
|
|
1290
|
+
sort: k,
|
|
1291
|
+
filter: L
|
|
1292
|
+
};
|
|
1293
|
+
setTimeout(() => {
|
|
1294
|
+
qt({ url: e.url }, Lt(r)).then(Bt).then((g) => {
|
|
1295
|
+
l(g), n(!1);
|
|
1296
|
+
});
|
|
1297
|
+
});
|
|
1298
|
+
}, [s, m, y, L, k, e.cube, e.catalog, e.url]), t.useEffect(() => {
|
|
1299
|
+
n(!0);
|
|
1300
|
+
const r = {
|
|
1301
|
+
connection: {
|
|
1302
|
+
catalog: e.catalog,
|
|
1303
|
+
cube: e.cube
|
|
1304
|
+
},
|
|
1305
|
+
restrictions: {
|
|
1306
|
+
catalogName: e.catalog,
|
|
1307
|
+
cubeName: e.cube
|
|
1308
|
+
},
|
|
1309
|
+
command: "schemaDimensions"
|
|
1310
|
+
};
|
|
1311
|
+
de({ url: e.url }, r).then((g) => {
|
|
1312
|
+
zt(g), u(g), n(!1);
|
|
1313
|
+
});
|
|
1314
|
+
}, [e.catalog, e.cube, e.url]);
|
|
1315
|
+
const K = (r = [], g) => {
|
|
1316
|
+
for (let C = 0; C < r.length; C++) {
|
|
1317
|
+
const w = r[C];
|
|
1318
|
+
if (String(w.name) === String(g.name))
|
|
1319
|
+
return w;
|
|
1320
|
+
}
|
|
1321
|
+
return null;
|
|
1322
|
+
}, D = (r = [], g) => {
|
|
1323
|
+
for (let C = 0; C < r.length; C++) {
|
|
1324
|
+
const w = r[C];
|
|
1325
|
+
if (w.uniqueName === g.uniqueName)
|
|
1326
|
+
return w;
|
|
1327
|
+
let S = D(w.children, g);
|
|
1328
|
+
if (S !== null)
|
|
1329
|
+
return S;
|
|
1330
|
+
}
|
|
1331
|
+
return null;
|
|
1332
|
+
}, c = async (r) => {
|
|
1333
|
+
let g, C, w, S, O, _;
|
|
1334
|
+
r.name && (g = "schemaMembers", S = `${String(r.name)}.[(ALL)]`);
|
|
1335
|
+
const d = {
|
|
1336
|
+
connection: {
|
|
1337
|
+
catalog: e.catalog,
|
|
1338
|
+
cube: e.cube
|
|
1339
|
+
},
|
|
1340
|
+
restrictions: {
|
|
1341
|
+
catalogName: e.catalog,
|
|
1342
|
+
cubeName: e.cube,
|
|
1343
|
+
hierarchyUniqueName: w,
|
|
1344
|
+
dimensionUniqueName: C,
|
|
1345
|
+
levelUniqueName: S,
|
|
1346
|
+
memberUniqueName: O,
|
|
1347
|
+
treeOp: _
|
|
1348
|
+
},
|
|
1349
|
+
command: g
|
|
1350
|
+
};
|
|
1351
|
+
return de({ url: e.url }, d);
|
|
1352
|
+
}, A = async (r) => {
|
|
1353
|
+
let g, C, w, S, O, _;
|
|
1354
|
+
r.uniqueName && (g = "schemaMembers", O = r.uniqueName.replace(/\&/g, "&"), _ = 1);
|
|
1355
|
+
const d = {
|
|
1356
|
+
connection: {
|
|
1357
|
+
catalog: e.catalog,
|
|
1358
|
+
cube: e.cube
|
|
1359
|
+
},
|
|
1360
|
+
restrictions: {
|
|
1361
|
+
catalogName: e.catalog,
|
|
1362
|
+
cubeName: e.cube,
|
|
1363
|
+
hierarchyUniqueName: w,
|
|
1364
|
+
dimensionUniqueName: C,
|
|
1365
|
+
levelUniqueName: S,
|
|
1366
|
+
memberUniqueName: O,
|
|
1367
|
+
treeOp: _
|
|
1368
|
+
},
|
|
1369
|
+
command: g
|
|
1370
|
+
};
|
|
1371
|
+
return de({ url: e.url }, d);
|
|
1372
|
+
}, M = async (r) => {
|
|
1373
|
+
let g, C, w, S, O, _;
|
|
1374
|
+
r.type === 2 ? g = "schemaMeasures" : r.dimensionUniqueName ? (g = "schemaLevels", w = r.uniqueName) : (g = "schemaHierarchies", C = r.uniqueName);
|
|
1375
|
+
const d = {
|
|
1376
|
+
connection: {
|
|
1377
|
+
catalog: e.catalog,
|
|
1378
|
+
cube: e.cube
|
|
1379
|
+
},
|
|
1380
|
+
restrictions: {
|
|
1381
|
+
catalogName: e.catalog,
|
|
1382
|
+
cubeName: e.cube,
|
|
1383
|
+
hierarchyUniqueName: w,
|
|
1384
|
+
dimensionUniqueName: C,
|
|
1385
|
+
levelUniqueName: S,
|
|
1386
|
+
memberUniqueName: O,
|
|
1387
|
+
treeOp: _
|
|
1388
|
+
},
|
|
1389
|
+
command: g
|
|
1390
|
+
};
|
|
1391
|
+
return de({ url: e.url }, d);
|
|
1392
|
+
}, P = async () => {
|
|
1393
|
+
const r = {
|
|
1394
|
+
connection: {
|
|
1395
|
+
catalog: e.catalog,
|
|
1396
|
+
cube: e.cube
|
|
1397
|
+
},
|
|
1398
|
+
restrictions: {
|
|
1399
|
+
catalogName: e.catalog,
|
|
1400
|
+
cubeName: e.cube
|
|
1401
|
+
},
|
|
1402
|
+
command: "schemaKPIs"
|
|
1403
|
+
};
|
|
1404
|
+
return de({ url: e.url }, r);
|
|
1405
|
+
}, p = async (r) => {
|
|
1406
|
+
const g = i.slice(), C = D(g, r.value);
|
|
1407
|
+
if (C && C.uniqueName === "[KPIs]") {
|
|
1408
|
+
const w = En(await P());
|
|
1409
|
+
C.children = w;
|
|
1410
|
+
} else if (C && C.type === "kpi")
|
|
1411
|
+
C.children = Kt(C);
|
|
1412
|
+
else if (C && !C.children) {
|
|
1413
|
+
const w = await M(C);
|
|
1414
|
+
C.children = w;
|
|
1415
|
+
}
|
|
1416
|
+
u(g);
|
|
1417
|
+
}, X = async (r) => {
|
|
1418
|
+
if (!r)
|
|
1419
|
+
return;
|
|
1420
|
+
const g = {
|
|
1421
|
+
rowAxes: [m, x],
|
|
1422
|
+
columnAxes: [s, E],
|
|
1423
|
+
measureAxes: [y, G]
|
|
1424
|
+
}, [C, w] = g[r.target.props.axes], S = C.slice(), O = K(S, r.target.props.dataItem);
|
|
1425
|
+
if (O && !O.fields) {
|
|
1426
|
+
const _ = await c(O);
|
|
1427
|
+
O.fields = _, w(S);
|
|
1428
|
+
}
|
|
1429
|
+
}, j = async (r) => {
|
|
1430
|
+
if (!r)
|
|
1431
|
+
return;
|
|
1432
|
+
const g = {
|
|
1433
|
+
rowAxes: [m, x],
|
|
1434
|
+
columnAxes: [s, E],
|
|
1435
|
+
measureAxes: [y, G]
|
|
1436
|
+
}, [C, w] = g[r.target.props.axes], S = C.slice(), O = K(S, r.target.props.dataItem);
|
|
1437
|
+
if (O) {
|
|
1438
|
+
const _ = (O.fields || []).slice(), d = D(_, r.value);
|
|
1439
|
+
if (d && (!d.children || !d.children.length)) {
|
|
1440
|
+
const H = await A(d);
|
|
1441
|
+
d.children = H, O.fields = _, w(S);
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
};
|
|
1445
|
+
return {
|
|
1446
|
+
pivotProps: {
|
|
1447
|
+
rowAxes: m,
|
|
1448
|
+
columnAxes: s,
|
|
1449
|
+
data: o.data,
|
|
1450
|
+
rows: o.rows,
|
|
1451
|
+
columns: o.columns,
|
|
1452
|
+
onRowAxesChange: $,
|
|
1453
|
+
onColumnAxesChange: v
|
|
1454
|
+
},
|
|
1455
|
+
configuratorProps: {
|
|
1456
|
+
sort: k,
|
|
1457
|
+
onSortChange: f,
|
|
1458
|
+
filter: L,
|
|
1459
|
+
onFilterChange: z,
|
|
1460
|
+
data: i,
|
|
1461
|
+
rowAxes: m,
|
|
1462
|
+
columnAxes: s,
|
|
1463
|
+
measureAxes: y,
|
|
1464
|
+
onRowAxesChange: $,
|
|
1465
|
+
onColumnAxesChange: v,
|
|
1466
|
+
onMeasureAxesChange: N,
|
|
1467
|
+
onFieldsEditorFieldExpand: p,
|
|
1468
|
+
onAxisFilterFieldExpand: j,
|
|
1469
|
+
onAxisFilterFieldsExpandChange: X
|
|
1470
|
+
},
|
|
1471
|
+
state: {
|
|
1472
|
+
loading: a
|
|
1473
|
+
}
|
|
1474
|
+
};
|
|
1475
|
+
}, Ln = (e) => {
|
|
1476
|
+
const a = Cn(e);
|
|
1477
|
+
return e.children(a);
|
|
1478
|
+
}, En = (e) => {
|
|
1479
|
+
for (let a = 0, n = e.length; a < n; a++)
|
|
1480
|
+
e[a].uniqueName = e[a].name, e[a].type = "kpi";
|
|
1481
|
+
return e;
|
|
1482
|
+
}, An = "aggregate", pn = "columns", at = { dataField: An, columnsData: pn }, Ee = "&", yn = (e) => {
|
|
1483
|
+
const [a, n] = t.useState(!0), [o, l] = t.useState(e.defaultColumnAxes || []), [i, u] = t.useState(e.defaultRowAxes || []), [s, E] = t.useState(e.defaultMeasureAxes || []), [m, x] = t.useState(e.defaultSort || []), [y, G] = t.useState(e.defaultFilter || []), [k, U] = t.useState(/* @__PURE__ */ new Map()), L = t.useCallback((p) => {
|
|
1484
|
+
u(p.value);
|
|
1485
|
+
}, []), V = t.useCallback((p) => {
|
|
1486
|
+
l(p.value);
|
|
1487
|
+
}, []), $ = (p) => {
|
|
1488
|
+
E(p.value);
|
|
1489
|
+
}, v = (p) => {
|
|
1490
|
+
x(p.value);
|
|
1491
|
+
}, N = (p) => {
|
|
1492
|
+
G(p.value);
|
|
1493
|
+
}, f = t.useMemo(() => Array.from(et(o).keys()).join(Ee), [o]), z = t.useMemo(() => Array.from(et(i).keys()).join(Ee), [i]), K = t.useCallback(
|
|
1494
|
+
(p) => ({ key: p, ...e.dimensions[p] }),
|
|
1495
|
+
[e.dimensions]
|
|
1496
|
+
), D = t.useMemo(
|
|
1497
|
+
() => f ? f.split(Ee).map(K) : [],
|
|
1498
|
+
[f, K]
|
|
1499
|
+
), c = t.useMemo(
|
|
1500
|
+
() => z ? z.split(Ee).map(K) : [],
|
|
1501
|
+
[z, K]
|
|
1502
|
+
), A = t.useMemo(
|
|
1503
|
+
() => s.map((p) => e.measures.find((X) => String(X.name) === String(p.name))).filter(Boolean),
|
|
1504
|
+
[s, e.measures]
|
|
1505
|
+
);
|
|
1506
|
+
t.useEffect(
|
|
1507
|
+
() => {
|
|
1508
|
+
n(!0), setTimeout(() => {
|
|
1509
|
+
const p = Ut(e.data, c, D, A, at, y);
|
|
1510
|
+
U(p), n(!1);
|
|
1511
|
+
}, 0);
|
|
1512
|
+
},
|
|
1513
|
+
[e.data, c, D, A, y]
|
|
1514
|
+
);
|
|
1515
|
+
const M = t.useMemo(
|
|
1516
|
+
() => Vt(e.dimensions, e.measures),
|
|
1517
|
+
[e.dimensions, e.measures]
|
|
1518
|
+
), P = t.useMemo(
|
|
1519
|
+
() => $t({
|
|
1520
|
+
dataTree: k,
|
|
1521
|
+
rowSettings: c,
|
|
1522
|
+
columnSettings: D,
|
|
1523
|
+
rowAxes: i,
|
|
1524
|
+
columnAxes: o,
|
|
1525
|
+
measures: A,
|
|
1526
|
+
sort: m,
|
|
1527
|
+
fields: at
|
|
1528
|
+
}),
|
|
1529
|
+
[o, D, k, i, c, m]
|
|
1530
|
+
);
|
|
1531
|
+
return {
|
|
1532
|
+
pivotProps: {
|
|
1533
|
+
rowAxes: i,
|
|
1534
|
+
columnAxes: o,
|
|
1535
|
+
data: P.data,
|
|
1536
|
+
rows: P.rows,
|
|
1537
|
+
columns: P.columns,
|
|
1538
|
+
onRowAxesChange: L,
|
|
1539
|
+
onColumnAxesChange: V
|
|
1540
|
+
},
|
|
1541
|
+
configuratorProps: {
|
|
1542
|
+
sort: m,
|
|
1543
|
+
onSortChange: v,
|
|
1544
|
+
filter: y,
|
|
1545
|
+
onFilterChange: N,
|
|
1546
|
+
data: M,
|
|
1547
|
+
rowAxes: i,
|
|
1548
|
+
columnAxes: o,
|
|
1549
|
+
measureAxes: s,
|
|
1550
|
+
onRowAxesChange: L,
|
|
1551
|
+
onColumnAxesChange: V,
|
|
1552
|
+
onMeasureAxesChange: $
|
|
1553
|
+
},
|
|
1554
|
+
state: {
|
|
1555
|
+
loading: a
|
|
1556
|
+
}
|
|
1557
|
+
};
|
|
1558
|
+
}, Dn = (e) => {
|
|
1559
|
+
const a = yn(e);
|
|
1560
|
+
return e.children(a);
|
|
1561
|
+
};
|
|
1562
|
+
export {
|
|
1563
|
+
gn as PivotGrid,
|
|
1564
|
+
ce as PivotGridAxesEditor,
|
|
1565
|
+
$e as PivotGridAxisEditor,
|
|
1566
|
+
Ve as PivotGridAxisFilterFieldsEditor,
|
|
1567
|
+
dt as PivotGridCell,
|
|
1568
|
+
ze as PivotGridColumn,
|
|
1569
|
+
Ct as PivotGridConfigurator,
|
|
1570
|
+
Et as PivotGridConfiguratorButton,
|
|
1571
|
+
Xe as PivotGridConfiguratorEditor,
|
|
1572
|
+
ft as PivotGridContainer,
|
|
1573
|
+
_e as PivotGridFieldsEditor,
|
|
1574
|
+
Be as PivotGridHeaderCell,
|
|
1575
|
+
ct as PivotGridRow,
|
|
1576
|
+
Dn as PivotLocalDataService,
|
|
1577
|
+
Ln as PivotOLAPService,
|
|
1578
|
+
On as averageAggregate,
|
|
1579
|
+
Tn as dataCells,
|
|
1580
|
+
qn as maxAggregate,
|
|
1581
|
+
Bn as minAggregate,
|
|
1582
|
+
zn as sumAggregate,
|
|
1583
|
+
yn as usePivotLocalDataService,
|
|
1584
|
+
Cn as usePivotOLAPService
|
|
1585
|
+
};
|