@progress/kendo-react-grid 12.2.1-develop.1 → 12.3.0-develop.10
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/GridClientWrapper.js +1 -1
- package/GridClientWrapper.mjs +498 -416
- package/GridComponent.js +1 -1
- package/GridComponent.mjs +326 -311
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/header/HeaderRow.js +1 -1
- package/header/HeaderRow.mjs +64 -63
- package/index.d.mts +169 -1
- package/index.d.ts +169 -1
- package/index.js +1 -1
- package/index.mjs +54 -53
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +17 -17
- package/toolbar-tools/GridToolbarAIAssistant.js +2 -2
- package/toolbar-tools/GridToolbarAIAssistant.mjs +264 -161
- package/utils/index.js +1 -1
- package/utils/index.mjs +158 -148
|
@@ -5,200 +5,303 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
9
|
-
import { GridContext as
|
|
10
|
-
import { Button as
|
|
11
|
-
import { sparklesIcon as
|
|
12
|
-
import
|
|
13
|
-
import { useLocalization as
|
|
14
|
-
import { toolbarAI as S, messages as
|
|
15
|
-
import { useCustomComponent as
|
|
16
|
-
import { Window as
|
|
17
|
-
import { GridAIPrompt as
|
|
18
|
-
import { combineSmartFilters as
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}),
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}, [
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
if (
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
let r = t.data.highlight;
|
|
69
|
-
Array.isArray(r) && (r = r.map((s) => (s != null && s.filters && Array.isArray(s.filters) && gt(s), s))), o.applyHighlightDescriptor(r);
|
|
70
|
-
}
|
|
71
|
-
if (o && t.data.group)
|
|
72
|
-
if (t.data.group.length === 0)
|
|
73
|
-
o.groupChange([], t);
|
|
74
|
-
else {
|
|
75
|
-
const r = (C = o.group) != null ? C : [], s = [];
|
|
76
|
-
r.forEach((f) => {
|
|
77
|
-
t.data.group.some((y) => y.field === f.field) || s.push(f);
|
|
78
|
-
}), s.push(...t.data.group), o.groupChange(s, t);
|
|
79
|
-
}
|
|
80
|
-
if (t.data.messages) {
|
|
81
|
-
const r = [
|
|
82
|
-
u.toLanguageString(F, w[F])
|
|
83
|
-
], s = ht(t.data.messages, o.columnsRef).join(
|
|
84
|
-
`
|
|
85
|
-
`
|
|
8
|
+
import * as a from "react";
|
|
9
|
+
import { GridContext as fe } from "../utils/GridContext.mjs";
|
|
10
|
+
import { Button as ge } from "@progress/kendo-react-buttons";
|
|
11
|
+
import { sparklesIcon as he } from "@progress/kendo-svg-icons";
|
|
12
|
+
import z from "axios";
|
|
13
|
+
import { useLocalization as Ce } from "@progress/kendo-react-intl";
|
|
14
|
+
import { toolbarAI as S, messages as G, aIResponseData as O, generatedWithAI as j } from "../messages/index.mjs";
|
|
15
|
+
import { useCustomComponent as Se, classNames as Ge } from "@progress/kendo-react-common";
|
|
16
|
+
import { Window as me } from "@progress/kendo-react-dialogs";
|
|
17
|
+
import { GridAIPrompt as be } from "./ai-tool/GridAIPrompt.mjs";
|
|
18
|
+
import { combineSmartFilters as ke } from "../filterCommon.mjs";
|
|
19
|
+
var Re = /* @__PURE__ */ ((n) => (n.GridClearFilter = "GridClearFilter", n.GridClearSort = "GridClearSort", n.GridClearGroup = "GridClearGroup", n.GridClearHighlight = "GridClearHighlight", n.GridClearSelect = "GridClearSelect", n.GridSort = "GridSort", n.GridFilter = "GridFilter", n.GridGroup = "GridGroup", n.GridHighlight = "GridHighlight", n.GridSelect = "GridSelect", n.GridExportPDF = "GridExportPDF", n.GridColumnResize = "GridColumnResize", n.GridColumnHide = "GridColumnHide", n.GridColumnShow = "GridColumnShow", n.GridColumnReorder = "GridColumnReorder", n.GridColumnLock = "GridColumnLock", n.GridColumnUnlock = "GridColumnUnlock", n))(Re || {});
|
|
20
|
+
const we = (n, m) => n.map((d) => {
|
|
21
|
+
let p = d;
|
|
22
|
+
return m.forEach((c) => {
|
|
23
|
+
c.field && p.includes(c.field) && (p = p.replace(new RegExp(c.field, "g"), c.title || c.field));
|
|
24
|
+
}), p;
|
|
25
|
+
}), xe = a.forwardRef(
|
|
26
|
+
(n, m) => {
|
|
27
|
+
const t = a.useContext(fe), d = Ce(), {
|
|
28
|
+
requestUrl: p,
|
|
29
|
+
requestOptions: c,
|
|
30
|
+
onPromptRequest: v,
|
|
31
|
+
onResponseSuccess: P,
|
|
32
|
+
onResponseError: b,
|
|
33
|
+
role: W = "user",
|
|
34
|
+
gridAIPrompt: A = be,
|
|
35
|
+
icon: F,
|
|
36
|
+
svgIcon: B,
|
|
37
|
+
onCloseWindow: k,
|
|
38
|
+
promptPlaceHolder: M,
|
|
39
|
+
suggestionsList: N,
|
|
40
|
+
streaming: U,
|
|
41
|
+
loading: I,
|
|
42
|
+
outputs: K,
|
|
43
|
+
enableSpeechToText: V
|
|
44
|
+
} = n, [R, H] = a.useState([]), X = a.useMemo(() => t && Array.isArray(t.columnsRef) && Array.isArray(t.hiddenColumnsRef) ? [...t.columnsRef, ...t.hiddenColumnsRef].map((e) => {
|
|
45
|
+
var r;
|
|
46
|
+
return {
|
|
47
|
+
id: e.id,
|
|
48
|
+
field: e.field,
|
|
49
|
+
values: (r = e.values) != null ? r : []
|
|
50
|
+
};
|
|
51
|
+
}) : [], [t]), [Y, g] = a.useState(!1), [w, x] = a.useState(!1), [$, J] = a.useState(), [Q, Z] = a.useState(), f = a.useRef(null), y = a.useRef(null), _ = (e) => {
|
|
52
|
+
e.preventDefault(), x(!w);
|
|
53
|
+
}, h = a.useMemo(() => {
|
|
54
|
+
var e;
|
|
55
|
+
return (e = n.show) != null ? e : w;
|
|
56
|
+
}, [n.show, w]), C = a.useCallback(() => {
|
|
57
|
+
var e;
|
|
58
|
+
k && k(), H([]), x(!1), f.current && ((e = f.current.element) == null || e.focus());
|
|
59
|
+
}, [k]), q = (e, r) => {
|
|
60
|
+
var i;
|
|
61
|
+
if (t.sortable && e) {
|
|
62
|
+
const o = Array.isArray(e) ? e : [e];
|
|
63
|
+
if (o.length === 0)
|
|
64
|
+
t.sortChange([], r);
|
|
65
|
+
else {
|
|
66
|
+
const u = ((i = t.sort) != null ? i : []).filter(
|
|
67
|
+
(s) => !o.some((T) => T.field === s.field)
|
|
86
68
|
);
|
|
87
|
-
|
|
88
|
-
{
|
|
89
|
-
id: R.length + 1,
|
|
90
|
-
title: u.toLanguageString(W, w[W]),
|
|
91
|
-
subTitle: n,
|
|
92
|
-
prompt: n,
|
|
93
|
-
responseContent: r.concat(s).join(""),
|
|
94
|
-
isRetry: d
|
|
95
|
-
},
|
|
96
|
-
...R
|
|
97
|
-
]);
|
|
69
|
+
u.push(...o), t.sortChange(u, r);
|
|
98
70
|
}
|
|
99
71
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
72
|
+
}, ee = (e, r) => {
|
|
73
|
+
if (!e)
|
|
74
|
+
return;
|
|
75
|
+
const i = ke(
|
|
76
|
+
{
|
|
77
|
+
logic: e.logic ? e.logic : "and",
|
|
78
|
+
filters: e.filters
|
|
79
|
+
},
|
|
80
|
+
t.filter
|
|
81
|
+
);
|
|
82
|
+
t.filterChange(i, r);
|
|
83
|
+
}, te = (e, r) => {
|
|
84
|
+
var o;
|
|
85
|
+
if (!e)
|
|
86
|
+
return;
|
|
87
|
+
const i = Array.isArray(e) ? e : [e];
|
|
88
|
+
if (i.length === 0)
|
|
89
|
+
t.groupChange([], r);
|
|
90
|
+
else {
|
|
91
|
+
const u = ((o = t.group) != null ? o : []).filter(
|
|
92
|
+
(s) => !i.some((T) => T.field === s.field)
|
|
93
|
+
);
|
|
94
|
+
u.push(...i), t.groupChange(u, r);
|
|
95
|
+
}
|
|
96
|
+
}, re = (e, r, i) => {
|
|
97
|
+
const o = [d.toLanguageString(O, G[O])], l = we([e], t.columnsRef).join(`
|
|
98
|
+
`);
|
|
99
|
+
H([
|
|
100
|
+
{
|
|
101
|
+
id: R.length + 1,
|
|
102
|
+
title: d.toLanguageString(j, G[j]),
|
|
103
|
+
subTitle: r,
|
|
104
|
+
prompt: r,
|
|
105
|
+
responseContent: o.concat(l).join(""),
|
|
106
|
+
isRetry: i
|
|
107
|
+
},
|
|
108
|
+
...R
|
|
109
|
+
]);
|
|
110
|
+
}, oe = (e, r, i) => {
|
|
111
|
+
const o = t.columnsRef.findIndex((l) => l.id === e);
|
|
112
|
+
t.reorderable && t.columnReorder(o, r, i);
|
|
113
|
+
}, D = (e, r) => {
|
|
114
|
+
const i = t.columnsState.findIndex((l) => l.id === e), o = t.columnsState.map(
|
|
115
|
+
(l) => l.id === e ? { ...l, hidden: r } : l
|
|
116
|
+
);
|
|
117
|
+
i !== -1 && t.onColumnsStateChange(o);
|
|
118
|
+
}, L = (e, r) => {
|
|
119
|
+
const i = t.columnsRef.findIndex((l) => l.id === e), o = t.columnsState.map(
|
|
120
|
+
(l) => l.id === e ? { ...l, locked: r } : l
|
|
121
|
+
);
|
|
122
|
+
i !== -1 && t.onColumnsStateChange(o);
|
|
123
|
+
}, se = (e, r, i) => {
|
|
124
|
+
const o = t.columnsRef.findIndex((s) => s.id === e), l = t.columnsState[o], u = t.columnsState.map(
|
|
125
|
+
(s) => s.id === e ? { ...s, width: parseFloat(r) } : s
|
|
126
|
+
);
|
|
127
|
+
o !== -1 && t.onResize(
|
|
128
|
+
o,
|
|
129
|
+
// index: number
|
|
130
|
+
parseFloat(r),
|
|
131
|
+
// newWidth: 200
|
|
132
|
+
parseFloat(l.width) || 0,
|
|
133
|
+
// oldWidth: current width
|
|
134
|
+
i,
|
|
135
|
+
// nativeEvent: mock event
|
|
136
|
+
!0,
|
|
137
|
+
// end: true (resize is complete)
|
|
138
|
+
u,
|
|
139
|
+
// colState: current columns state
|
|
140
|
+
e
|
|
141
|
+
// targetId: column ID
|
|
142
|
+
);
|
|
143
|
+
}, ne = (e, r, i) => {
|
|
144
|
+
var o, l, u;
|
|
145
|
+
g(!1), (o = e == null ? void 0 : e.data) == null || o.commands.forEach((s) => {
|
|
146
|
+
switch (s.type) {
|
|
147
|
+
case "GridSort":
|
|
148
|
+
q(s.sort, e);
|
|
149
|
+
break;
|
|
150
|
+
case "GridFilter":
|
|
151
|
+
ee(s.filter, e);
|
|
152
|
+
break;
|
|
153
|
+
case "GridHighlight":
|
|
154
|
+
t.applyHighlightDescriptor([s.highlight]);
|
|
155
|
+
break;
|
|
156
|
+
case "GridGroup":
|
|
157
|
+
te(s.group, e);
|
|
158
|
+
break;
|
|
159
|
+
case "GridClearFilter":
|
|
160
|
+
t.filterChange(void 0);
|
|
161
|
+
break;
|
|
162
|
+
case "GridClearGroup":
|
|
163
|
+
t.groupChange([], e);
|
|
164
|
+
break;
|
|
165
|
+
case "GridClearHighlight":
|
|
166
|
+
t.applyHighlightDescriptor([]);
|
|
167
|
+
break;
|
|
168
|
+
case "GridClearSort":
|
|
169
|
+
t.sortChange(void 0);
|
|
170
|
+
break;
|
|
171
|
+
case "GridSelect":
|
|
172
|
+
t.applySelectionDescriptor([s.select]);
|
|
173
|
+
break;
|
|
174
|
+
case "GridClearSelect":
|
|
175
|
+
t.applySelectionDescriptor([]);
|
|
176
|
+
break;
|
|
177
|
+
case "GridExportPDF":
|
|
178
|
+
t.exportAsPdf();
|
|
179
|
+
break;
|
|
180
|
+
case "GridColumnResize":
|
|
181
|
+
se(s.id, s.size, e);
|
|
182
|
+
break;
|
|
183
|
+
case "GridColumnHide":
|
|
184
|
+
D(s.id, !0);
|
|
185
|
+
break;
|
|
186
|
+
case "GridColumnShow":
|
|
187
|
+
D(s.id, !1);
|
|
188
|
+
break;
|
|
189
|
+
case "GridColumnReorder":
|
|
190
|
+
oe(s.id, s.position, e);
|
|
191
|
+
break;
|
|
192
|
+
case "GridColumnLock":
|
|
193
|
+
L(s.id, !0);
|
|
194
|
+
break;
|
|
195
|
+
case "GridColumnUnlock":
|
|
196
|
+
L(s.id, !1);
|
|
197
|
+
break;
|
|
198
|
+
}
|
|
199
|
+
}), (u = (l = e == null ? void 0 : e.data) == null ? void 0 : l.commands) != null && u.length || re(e.data.message, r, i), P && P(e, r, i);
|
|
200
|
+
}, ie = (e) => {
|
|
201
|
+
b == null || b(e), g(!1);
|
|
202
|
+
}, le = (e, r) => {
|
|
203
|
+
const i = z.CancelToken.source(), o = {
|
|
204
|
+
role: W || "user",
|
|
205
|
+
columns: X || [],
|
|
107
206
|
headers: {
|
|
108
207
|
Accept: "*/*",
|
|
109
208
|
"Content-Type": "application/json"
|
|
110
209
|
},
|
|
111
|
-
promptMessage:
|
|
210
|
+
promptMessage: e,
|
|
112
211
|
requestOptions: {
|
|
113
|
-
url:
|
|
212
|
+
url: p,
|
|
114
213
|
method: "POST",
|
|
115
214
|
withCredentials: !1,
|
|
116
215
|
responseType: "json",
|
|
117
|
-
cancelToken:
|
|
118
|
-
...
|
|
216
|
+
cancelToken: i.token,
|
|
217
|
+
...c
|
|
119
218
|
}
|
|
120
219
|
};
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
},
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
ot,
|
|
220
|
+
if (v && v(o, r), o.requestOptions.url !== void 0) {
|
|
221
|
+
g(!0);
|
|
222
|
+
const { url: l, ...u } = o.requestOptions;
|
|
223
|
+
z(l, {
|
|
224
|
+
...u,
|
|
225
|
+
headers: o.headers,
|
|
226
|
+
data: {
|
|
227
|
+
columns: o.columns,
|
|
228
|
+
contents: [{ text: o.promptMessage }]
|
|
229
|
+
},
|
|
230
|
+
responseType: "json"
|
|
231
|
+
// Ensure correct type
|
|
232
|
+
}).then((s) => ne(s, o.promptMessage, r)).catch(ie), y.current = i;
|
|
233
|
+
}
|
|
234
|
+
}, ae = a.useCallback(() => {
|
|
235
|
+
y.current && y.current.cancel("Request cancelled by user."), g(!1);
|
|
236
|
+
}, []), [ue, E] = Se(
|
|
237
|
+
A
|
|
238
|
+
), ce = Object.keys(E).length > 0 ? E : {}, de = /* @__PURE__ */ a.createElement(
|
|
239
|
+
ue,
|
|
142
240
|
{
|
|
143
|
-
onPromptRequest:
|
|
144
|
-
onCancel:
|
|
145
|
-
onClose:
|
|
146
|
-
streaming:
|
|
147
|
-
loading:
|
|
148
|
-
outputs:
|
|
149
|
-
promptPlaceHolder:
|
|
150
|
-
suggestionsList:
|
|
151
|
-
enableSpeechToText:
|
|
152
|
-
...
|
|
241
|
+
onPromptRequest: le,
|
|
242
|
+
onCancel: ae,
|
|
243
|
+
onClose: C,
|
|
244
|
+
streaming: U || Y,
|
|
245
|
+
loading: I,
|
|
246
|
+
outputs: K || R,
|
|
247
|
+
promptPlaceHolder: M,
|
|
248
|
+
suggestionsList: N,
|
|
249
|
+
enableSpeechToText: V,
|
|
250
|
+
...ce
|
|
153
251
|
}
|
|
154
|
-
),
|
|
155
|
-
|
|
252
|
+
), pe = /* @__PURE__ */ a.createElement(
|
|
253
|
+
ge,
|
|
156
254
|
{
|
|
157
|
-
ref:
|
|
255
|
+
ref: f,
|
|
158
256
|
togglable: !0,
|
|
159
257
|
themeColor: "primary",
|
|
160
258
|
rounded: "full",
|
|
161
|
-
selected:
|
|
162
|
-
svgIcon:
|
|
163
|
-
icon:
|
|
164
|
-
size:
|
|
165
|
-
className:
|
|
166
|
-
title:
|
|
167
|
-
onClick:
|
|
259
|
+
selected: h,
|
|
260
|
+
svgIcon: B || (F ? void 0 : he),
|
|
261
|
+
icon: F,
|
|
262
|
+
size: t.mobileMode ? "large" : "medium",
|
|
263
|
+
className: Ge("k-toolbar-button", { "k-icon-button": t.mobileMode }),
|
|
264
|
+
title: d.toLanguageString(S, G[S]),
|
|
265
|
+
onClick: _
|
|
168
266
|
}
|
|
169
267
|
);
|
|
170
|
-
return
|
|
171
|
-
var
|
|
172
|
-
if (
|
|
173
|
-
const
|
|
174
|
-
|
|
268
|
+
return a.useEffect(() => {
|
|
269
|
+
var e;
|
|
270
|
+
if (f.current && h) {
|
|
271
|
+
const r = (e = f.current.element) == null ? void 0 : e.getBoundingClientRect();
|
|
272
|
+
r && (J(r.top + window.scrollY + r.height), Z(r.left + window.scrollX + r.width));
|
|
175
273
|
}
|
|
176
|
-
}, [
|
|
177
|
-
|
|
274
|
+
}, [h]), a.useImperativeHandle(
|
|
275
|
+
m,
|
|
178
276
|
() => ({
|
|
179
|
-
show: () =>
|
|
180
|
-
hide: () =>
|
|
277
|
+
show: () => x(!0),
|
|
278
|
+
hide: () => C()
|
|
181
279
|
}),
|
|
182
|
-
[
|
|
183
|
-
), /* @__PURE__ */
|
|
184
|
-
|
|
280
|
+
[C]
|
|
281
|
+
), /* @__PURE__ */ a.createElement(a.Fragment, null, pe, h && /* @__PURE__ */ a.createElement(
|
|
282
|
+
me,
|
|
185
283
|
{
|
|
186
284
|
autoFocus: !1,
|
|
187
|
-
title:
|
|
188
|
-
initialTop:
|
|
285
|
+
title: d.toLanguageString(S, G[S]),
|
|
286
|
+
initialTop: $,
|
|
189
287
|
initialLeft: Q,
|
|
190
|
-
initialWidth:
|
|
191
|
-
|
|
192
|
-
|
|
288
|
+
initialWidth: 560,
|
|
289
|
+
style: {
|
|
290
|
+
height: "auto",
|
|
291
|
+
minWidth: "90px",
|
|
292
|
+
minHeight: "50px"
|
|
293
|
+
},
|
|
294
|
+
onClose: C,
|
|
193
295
|
resizable: !0,
|
|
194
296
|
draggable: !0,
|
|
195
297
|
className: "k-grid-assistant-window"
|
|
196
298
|
},
|
|
197
|
-
|
|
299
|
+
de
|
|
198
300
|
));
|
|
199
301
|
}
|
|
200
302
|
);
|
|
201
|
-
|
|
303
|
+
xe.displayName = "KendoReactGridToolbarAIAssistant";
|
|
202
304
|
export {
|
|
203
|
-
|
|
305
|
+
Re as GridAICommands,
|
|
306
|
+
xe as GridToolbarAIAssistant
|
|
204
307
|
};
|
package/utils/index.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("react"),w=require("../GridColumn.js"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("react"),w=require("../GridColumn.js"),y=require("@progress/kendo-data-query"),I=require("@progress/kendo-react-data-tools"),G=require("./_serverModule.js"),O=require("./_clientModule.js"),f=require("../contextMenu/enums.js"),T=require("@progress/kendo-react-common");function H(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const S=H(A);function j(e,t){const a=(e!=null?e:"").split(".");let r=t;return a.forEach(i=>{r=r?r[i]:void 0}),r}function v(e,t,a,r,i,d,c,n,o,s=0,l){var u;let g=s;for(let h=0;h<t.length;h++){let x;if(!i||t[h].value===void 0||t[h].items===void 0){e[e.length]={dataIndex:r.index,dataItem:t[h],rowType:"data",level:s,group:l,expanded:(u=o?!!(d!=null&&d[y.getter(o)(t[h])]):!1)!=null?u:!1},r.index++;continue}else{let m;l!=null&&l.parents?m=[{field:l.field,value:l.value},...l.parents]:l?m=[l]:m=[],x={field:t[h].field,value:t[h].value,parents:m}}g=Math.max(g,s+1);let C=!1;const M=I.findGroupExpand(c||[],x);M?C=M.expanded!==!1:C=n!==!1,e[e.length]={dataIndex:-1,dataItem:t[h],level:s,group:x,rowType:"groupHeader",expanded:C},C&&(x.expanded=C,g=Math.max(v(e,t[h].items,a,r,i,d,c,n,o,s+1,x),g)),(a==="always"||C&&a==="visible")&&(e[e.length]={dataIndex:-1,dataItem:t[h],rowType:"groupFooter",level:s,expanded:C})}return g}function N(e,t){for(let a=0;a<e.length;a++){const r=e[a];if(!r.locked){const i=t[r.index];i&&(r.locked=i.locked)}}}const q=(e,t)=>typeof e.colSpan=="function"?e.colSpan({dataItem:t,column:e}):e.colSpan||1;function B(e,t,a){const r=[[]];let i=0;for(let n=e.length-1;n>=0;n--)i=Math.max(i,e[n].depth),e[n].headerColSpan=e[n].headerColSpan||1,e[n].children.length>0&&(e[n].headerColSpan=e[n].children.reduce((o,s)=>s.hidden?o:o+s.headerColSpan,0));const d=[];let c=1;return e.forEach((n,o)=>{r[n.depth]=r[n.depth]||[];let s=!1;r[n.depth].length===0&&(c<=1?c=1+(n.children.length>0?0:i-n.depth):(c--,s=!0)),n.rowSpan=1+(n.children.length>0?0:i-n.depth),n.kFirst=s,n.index=r[n.depth].length,r[n.depth].push(o),n.ariaColumnIndex=d[n.depth]?d[n.depth]+1:1;for(let l=n.depth;l<n.depth+n.rowSpan;l++)d[l]=(d[l]||0)+n.headerColSpan}),N(e,t),I.updateLeft(r,e,a),I.updateRight(r,e,a),r}function b(e,t,a,r=0,i=!1){const d=[];if(!e)return[];e&&e.length===void 0&&(e=[e]),e.forEach((n,o)=>{n=n.props?n.props:n;const s=n.id?n.id:I.tableKeyboardNavigationTools.generateNavigatableId(`${a.prevId++}`,a.idPrefix,"column"),l=T.canUseDOM&&n.media&&window.matchMedia?!window.matchMedia(n.media).matches:!1,g=i||l||n.hidden,u=t==null?void 0:t.find(x=>x.id===s),h=b(n.children,(u==null?void 0:u.children)||[],a,r+1,g);d.push(Object.assign({depth:r},w.gridDefaultProps,h.length?{cell:()=>null,filterCell:()=>null}:{},n,{id:s,declarationIndex:d.length,children:h,headerColSpan:0,rowSpan:0,columnType:n.columnType||"data",colSpan:n.colSpan||1,isAccessible:!0,hidden:g,left:null,right:null,rowSpannable:n.rowSpannable},u?{width:u.width,orderIndex:u.orderIndex}:{}))});const c=(n,o)=>n.orderIndex===o.orderIndex?n.declarationIndex-o.declarationIndex:(n.orderIndex||0)-(o.orderIndex||0);if(d.sort(c),r===0){const n=[],o=(s,l)=>s.forEach(g=>{g.parentIndex=l,o(g.children,n.push(g)-1)});return o(d,-1),n}return d}const D=e=>Array.isArray(e)?e:e?e.data:[];function _(e,t,a,r){const i=D(e),d=[];if(i.length>0){let c=i[0];if(t)for(let o=0;o<t.length;o++)c=c.items&&c.items[0];Object.getOwnPropertyNames(c).forEach(o=>{o!==a.column&&d.push(Object.assign({id:I.tableKeyboardNavigationTools.generateNavigatableId(`${r.prevId++}`,r.idPrefix,"column"),declarationIndex:-1,parentIndex:-1,depth:0,colSpan:0,headerColSpan:0,rowSpan:0,index:0,columnType:"data",left:0,right:0,rightBorder:!1,children:[],ariaColumnIndex:0,isAccessible:!0},w.gridDefaultProps,{field:o}))})}return d}const L=(e,t)=>{var r;let a=e[t.parentIndex];for(;a;){if((r=a.cells)!=null&&r.footerCell)return!0;a=e[a.parentIndex]}return!1},$=e=>e.filter(t=>{var a;return L(e,t)?!1:!!((a=t.cells)!=null&&a.footerCell)||!(t.children&&t.children.length>0)}),z=e=>e.width!==void 0?Math.floor(parseFloat(e.width.toString()))+"px":void 0,V=(e,t)=>t&&t.filter(a=>a.field===e).length>0,R=e=>(e.sort((t,a)=>t.declarationIndex-a.declarationIndex),e.map(t=>{const{declarationIndex:a,parentIndex:r,depth:i,headerColSpan:d,rowSpan:c,index:n,kFirst:o,children:s,...l}=t;return s.length?{children:R(s),...l}:l})),p=e=>{const{cells:t,rowSpannable:a,defaultCell:r,...i}=e;return e.children.length?{...i,children:e.children.map(p)}:i},E=e=>({id:e.id,field:e.field,title:e.title,width:e.width,orderIndex:e.orderIndex,hidden:!1,children:e.children?F(e.children):null}),F=e=>e.map(E),P=e=>{const t=[],a=r=>r==null?void 0:r.forEach(i=>{t.push(i),a(i.children)});return a(e),t},W=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),K=17895697,Q=e=>{let t=[];return e.sortable&&(t=t.concat([f.GridContextMenuItemNames.sortAsc,f.GridContextMenuItemNames.sortDesc])),e.pdf&&(t.length&&(t=t.concat([f.GridContextMenuItemNames.separator])),t=t.concat([f.GridContextMenuItemNames.exportPDF])),t},U=e=>{let t=[];return e.clipboard&&(t=t.concat([f.GridContextMenuItemNames.copySelection,f.GridContextMenuItemNames.copySelectionNoHeaders,f.GridContextMenuItemNames.paste])),e.editable&&(t.length&&(t=t.concat([f.GridContextMenuItemNames.separator])),t=t.concat([f.GridContextMenuItemNames.create,f.GridContextMenuItemNames.edit,f.GridContextMenuItemNames.delete])),e.selectable&&(t.length&&(t=t.concat([f.GridContextMenuItemNames.separator])),t=t.concat([f.GridContextMenuItemNames.select])),e.rowReorderable&&(t.length&&(t=t.concat([f.GridContextMenuItemNames.separator])),t=t.concat([f.GridContextMenuItemNames.reorderRow])),e.pdf&&(t.length&&(t=t.concat([f.GridContextMenuItemNames.separator])),t=t.concat([f.GridContextMenuItemNames.exportPDF])),t},J=(e,t)=>{if(!(!e&&!t))return t?e?{...e,...t,select:{...e.select||{},...t.select||{}},hierarchy:{...e.hierarchy||{},...t.hierarchy||{}},group:{...e.group||{},...t.group||{}},edit:{...e.edit||{},...t.edit||{}}}:t:e},X=e=>{var a;return typeof e=="object"?(a=e.enabled)!=null?a:!0:e!=null?e:!1},Y=()=>G.ServerFragment===O.ClientFragment,Z=e=>!!(e&&e.$$typeof===Symbol.for("react.client.reference")),ee=e=>({id:e.id,ariaColumnIndex:e.ariaColumnIndex,isSelected:e.isSelected,isHighlighted:e.isHighlighted,isInEdit:e.isInEdit,isSorted:e.isSorted,isAlt:e.isAlt,expanded:e.expanded,className:e.className,style:e.style,field:e.field,dataItem:e.dataItem,format:e.format,colSpan:e.colSpan,dataIndex:e.dataIndex,columnIndex:e.columnIndex,columnsCount:e.columnsCount,rowType:e.rowType,level:e.level,editor:e.editor,locked:e.locked,isRtl:e.isRtl,rowDataIndex:e.rowDataIndex,columnPosition:e.columnPosition,group:e.group}),te=e=>{var r,i;const t=typeof e=="object"?(r=e.enabled)!=null?r:!0:e!=null?e:!1,a=typeof e=="object"?(i=e.valueGetter)!=null?i:(d,c)=>y.getter(c)(d):(d,c)=>y.getter(c)(d);return{enabled:t,valueGetter:a}},k=e=>{var t;return S.isValidElement(e)?e:(t=S.Children.toArray(e))==null?void 0:t[0]},ne=(e,t)=>{const a=k(e);return a?S.cloneElement(a,t):null},ae=e=>{let t=0;if(e){const a=e.insertRow(0),r=a.insertCell(0);r.textContent=" ",t=a.getBoundingClientRect().height,e.deleteRow(0)}return t};exports.autoGenerateColumns=_;exports.calcRowHeight=ae;exports.clientColumn=p;exports.cloneReactElement=ne;exports.firefox=W;exports.firefoxMaxHeight=K;exports.flatData=v;exports.footerColumns=$;exports.getClientCellProps=ee;exports.getColSpan=q;exports.getColumnState=E;exports.getColumnWidth=z;exports.getColumnsState=F;exports.getDataAsArray=D;exports.getDefaultBodyContextMenuItems=U;exports.getDefaultHeadContextMenuItems=Q;exports.getFlatColumnsState=P;exports.getNestedValue=j;exports.getReactElement=k;exports.getRowSpanOptions=te;exports.isClient=Y;exports.isClientReference=Z;exports.isRowReorderEnabled=X;exports.isSorted=V;exports.mapColumns=B;exports.readColumns=b;exports.resolveCells=J;exports.sanitizeColumns=R;exports.syncLockedColumns=N;
|