@progress/kendo-react-grid 12.3.0-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
package/utils/index.mjs
CHANGED
|
@@ -5,149 +5,158 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
8
|
+
import * as S from "react";
|
|
9
9
|
import { gridDefaultProps as v } from "../GridColumn.mjs";
|
|
10
|
-
import { getter as
|
|
10
|
+
import { getter as w } from "@progress/kendo-data-query";
|
|
11
11
|
import { findGroupExpand as F, updateLeft as D, updateRight as E, tableKeyboardNavigationTools as p } from "@progress/kendo-react-data-tools";
|
|
12
12
|
import { ServerFragment as M } from "./_serverModule.mjs";
|
|
13
13
|
import { ClientFragment as b } from "./_clientModule.mjs";
|
|
14
|
-
import { GridContextMenuItemNames as
|
|
14
|
+
import { GridContextMenuItemNames as s } from "../contextMenu/enums.mjs";
|
|
15
15
|
import { canUseDOM as A } from "@progress/kendo-react-common";
|
|
16
|
-
function
|
|
17
|
-
const
|
|
16
|
+
function K(e, t) {
|
|
17
|
+
const r = (e != null ? e : "").split(".");
|
|
18
18
|
let i = t;
|
|
19
|
-
return
|
|
20
|
-
i = i ? i[
|
|
19
|
+
return r.forEach((a) => {
|
|
20
|
+
i = i ? i[a] : void 0;
|
|
21
21
|
}), i;
|
|
22
22
|
}
|
|
23
|
-
function R(e, t,
|
|
23
|
+
function R(e, t, r, i, a, d, f, n, l, c = 0, o) {
|
|
24
24
|
var x;
|
|
25
|
-
let g =
|
|
26
|
-
for (let
|
|
25
|
+
let g = c;
|
|
26
|
+
for (let h = 0; h < t.length; h++) {
|
|
27
27
|
let I;
|
|
28
|
-
if (!
|
|
28
|
+
if (!a || t[h].value === void 0 || t[h].items === void 0) {
|
|
29
29
|
e[e.length] = {
|
|
30
30
|
dataIndex: i.index,
|
|
31
|
-
dataItem: t[
|
|
31
|
+
dataItem: t[h],
|
|
32
32
|
rowType: "data",
|
|
33
|
-
level:
|
|
34
|
-
group:
|
|
33
|
+
level: c,
|
|
34
|
+
group: o,
|
|
35
35
|
// This is related to detail-row expansion
|
|
36
|
-
expanded: (x = l ? !!(
|
|
36
|
+
expanded: (x = l ? !!(d != null && d[w(l)(t[h])]) : !1) != null ? x : !1
|
|
37
37
|
}, i.index++;
|
|
38
38
|
continue;
|
|
39
39
|
} else {
|
|
40
|
-
let
|
|
41
|
-
|
|
42
|
-
field: t[
|
|
43
|
-
value: t[
|
|
44
|
-
parents:
|
|
40
|
+
let y;
|
|
41
|
+
o != null && o.parents ? y = [{ field: o.field, value: o.value }, ...o.parents] : o ? y = [o] : y = [], I = {
|
|
42
|
+
field: t[h].field,
|
|
43
|
+
value: t[h].value,
|
|
44
|
+
parents: y
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
g = Math.max(g,
|
|
47
|
+
g = Math.max(g, c + 1);
|
|
48
48
|
let C = !1;
|
|
49
|
-
const u = F(
|
|
50
|
-
u ? C = u.expanded !== !1 : C =
|
|
49
|
+
const u = F(f || [], I);
|
|
50
|
+
u ? C = u.expanded !== !1 : C = n !== !1, e[e.length] = {
|
|
51
51
|
dataIndex: -1,
|
|
52
|
-
dataItem: t[
|
|
53
|
-
level:
|
|
52
|
+
dataItem: t[h],
|
|
53
|
+
level: c,
|
|
54
54
|
group: I,
|
|
55
55
|
rowType: "groupHeader",
|
|
56
56
|
expanded: C
|
|
57
57
|
}, C && (I.expanded = C, g = Math.max(
|
|
58
58
|
R(
|
|
59
59
|
e,
|
|
60
|
-
t[
|
|
61
|
-
n,
|
|
62
|
-
i,
|
|
63
|
-
d,
|
|
64
|
-
o,
|
|
60
|
+
t[h].items,
|
|
65
61
|
r,
|
|
62
|
+
i,
|
|
66
63
|
a,
|
|
64
|
+
d,
|
|
65
|
+
f,
|
|
66
|
+
n,
|
|
67
67
|
l,
|
|
68
|
-
|
|
68
|
+
c + 1,
|
|
69
69
|
I
|
|
70
70
|
),
|
|
71
71
|
g
|
|
72
|
-
)), (
|
|
72
|
+
)), (r === "always" || C && r === "visible") && (e[e.length] = {
|
|
73
73
|
dataIndex: -1,
|
|
74
|
-
dataItem: t[
|
|
74
|
+
dataItem: t[h],
|
|
75
75
|
rowType: "groupFooter",
|
|
76
|
-
level:
|
|
76
|
+
level: c,
|
|
77
77
|
expanded: C
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
return g;
|
|
81
81
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
82
|
+
function H(e, t) {
|
|
83
|
+
for (let r = 0; r < e.length; r++) {
|
|
84
|
+
const i = e[r];
|
|
85
|
+
if (!i.locked) {
|
|
86
|
+
const a = t[i.index];
|
|
87
|
+
a && (i.locked = a.locked);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
const Q = (e, t) => typeof e.colSpan == "function" ? e.colSpan({ dataItem: t, column: e }) : e.colSpan || 1;
|
|
92
|
+
function X(e, t, r) {
|
|
93
|
+
const i = [[]];
|
|
94
|
+
let a = 0;
|
|
95
|
+
for (let n = e.length - 1; n >= 0; n--)
|
|
96
|
+
a = Math.max(a, e[n].depth), e[n].headerColSpan = e[n].headerColSpan || 1, e[n].children.length > 0 && (e[n].headerColSpan = e[n].children.reduce(
|
|
97
|
+
(l, c) => c.hidden ? l : l + c.headerColSpan,
|
|
89
98
|
0
|
|
90
99
|
));
|
|
91
100
|
const d = [];
|
|
92
|
-
let
|
|
93
|
-
return e.forEach((
|
|
94
|
-
n
|
|
95
|
-
let
|
|
96
|
-
n
|
|
97
|
-
for (let
|
|
98
|
-
d[
|
|
99
|
-
}), D(
|
|
101
|
+
let f = 1;
|
|
102
|
+
return e.forEach((n, l) => {
|
|
103
|
+
i[n.depth] = i[n.depth] || [];
|
|
104
|
+
let c = !1;
|
|
105
|
+
i[n.depth].length === 0 && (f <= 1 ? f = 1 + (n.children.length > 0 ? 0 : a - n.depth) : (f--, c = !0)), n.rowSpan = 1 + (n.children.length > 0 ? 0 : a - n.depth), n.kFirst = c, n.index = i[n.depth].length, i[n.depth].push(l), n.ariaColumnIndex = d[n.depth] ? d[n.depth] + 1 : 1;
|
|
106
|
+
for (let o = n.depth; o < n.depth + n.rowSpan; o++)
|
|
107
|
+
d[o] = (d[o] || 0) + n.headerColSpan;
|
|
108
|
+
}), H(e, t), D(i, e, r), E(i, e, r), i;
|
|
100
109
|
}
|
|
101
|
-
function
|
|
102
|
-
const
|
|
110
|
+
function T(e, t, r, i = 0, a = !1) {
|
|
111
|
+
const d = [];
|
|
103
112
|
if (!e)
|
|
104
113
|
return [];
|
|
105
|
-
e && e.length === void 0 && (e = [e]), e.forEach((
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
-
|
|
114
|
+
e && e.length === void 0 && (e = [e]), e.forEach((n, l) => {
|
|
115
|
+
n = n.props ? n.props : n;
|
|
116
|
+
const c = n.id ? n.id : p.generateNavigatableId(`${r.prevId++}`, r.idPrefix, "column"), o = A && n.media && window.matchMedia ? !window.matchMedia(n.media).matches : !1, g = a || o || n.hidden, x = t == null ? void 0 : t.find((I) => I.id === c), h = T(n.children, (x == null ? void 0 : x.children) || [], r, i + 1, g);
|
|
117
|
+
d.push(
|
|
109
118
|
Object.assign(
|
|
110
119
|
{ depth: i },
|
|
111
120
|
v,
|
|
112
|
-
|
|
113
|
-
|
|
121
|
+
h.length ? { cell: () => null, filterCell: () => null } : {},
|
|
122
|
+
n,
|
|
114
123
|
{
|
|
115
|
-
id:
|
|
116
|
-
declarationIndex:
|
|
117
|
-
children:
|
|
124
|
+
id: c,
|
|
125
|
+
declarationIndex: d.length,
|
|
126
|
+
children: h,
|
|
118
127
|
headerColSpan: 0,
|
|
119
128
|
rowSpan: 0,
|
|
120
|
-
columnType:
|
|
121
|
-
colSpan:
|
|
129
|
+
columnType: n.columnType || "data",
|
|
130
|
+
colSpan: n.colSpan || 1,
|
|
122
131
|
isAccessible: !0,
|
|
123
132
|
hidden: g,
|
|
124
133
|
left: null,
|
|
125
134
|
right: null,
|
|
126
|
-
rowSpannable:
|
|
135
|
+
rowSpannable: n.rowSpannable
|
|
127
136
|
},
|
|
128
137
|
x ? { width: x.width, orderIndex: x.orderIndex } : {}
|
|
129
138
|
)
|
|
130
139
|
);
|
|
131
140
|
});
|
|
132
|
-
const
|
|
133
|
-
if (
|
|
134
|
-
const
|
|
135
|
-
g.parentIndex =
|
|
141
|
+
const f = (n, l) => n.orderIndex === l.orderIndex ? n.declarationIndex - l.declarationIndex : (n.orderIndex || 0) - (l.orderIndex || 0);
|
|
142
|
+
if (d.sort(f), i === 0) {
|
|
143
|
+
const n = [], l = (c, o) => c.forEach((g) => {
|
|
144
|
+
g.parentIndex = o, l(g.children, n.push(g) - 1);
|
|
136
145
|
});
|
|
137
|
-
return l(
|
|
146
|
+
return l(d, -1), n;
|
|
138
147
|
}
|
|
139
|
-
return
|
|
148
|
+
return d;
|
|
140
149
|
}
|
|
141
|
-
const
|
|
142
|
-
function
|
|
143
|
-
const
|
|
144
|
-
if (
|
|
145
|
-
let
|
|
150
|
+
const k = (e) => Array.isArray(e) ? e : e ? e.data : [];
|
|
151
|
+
function Y(e, t, r, i) {
|
|
152
|
+
const a = k(e), d = [];
|
|
153
|
+
if (a.length > 0) {
|
|
154
|
+
let f = a[0];
|
|
146
155
|
if (t)
|
|
147
156
|
for (let l = 0; l < t.length; l++)
|
|
148
|
-
|
|
149
|
-
Object.getOwnPropertyNames(
|
|
150
|
-
l !==
|
|
157
|
+
f = f.items && f.items[0];
|
|
158
|
+
Object.getOwnPropertyNames(f).forEach((l) => {
|
|
159
|
+
l !== r.column && d.push(
|
|
151
160
|
Object.assign(
|
|
152
161
|
{
|
|
153
162
|
id: p.generateNavigatableId(`${i.prevId++}`, i.idPrefix, "column"),
|
|
@@ -172,32 +181,32 @@ function X(e, t, n, i) {
|
|
|
172
181
|
);
|
|
173
182
|
});
|
|
174
183
|
}
|
|
175
|
-
return
|
|
184
|
+
return d;
|
|
176
185
|
}
|
|
177
186
|
const m = (e, t) => {
|
|
178
187
|
var i;
|
|
179
|
-
let
|
|
180
|
-
for (;
|
|
181
|
-
if ((i =
|
|
188
|
+
let r = e[t.parentIndex];
|
|
189
|
+
for (; r; ) {
|
|
190
|
+
if ((i = r.cells) != null && i.footerCell)
|
|
182
191
|
return !0;
|
|
183
|
-
|
|
192
|
+
r = e[r.parentIndex];
|
|
184
193
|
}
|
|
185
194
|
return !1;
|
|
186
|
-
},
|
|
187
|
-
var
|
|
188
|
-
return m(e, t) ? !1 : !!((
|
|
189
|
-
}),
|
|
190
|
-
const { declarationIndex:
|
|
191
|
-
return
|
|
192
|
-
children: j(
|
|
193
|
-
...
|
|
194
|
-
} :
|
|
195
|
+
}, Z = (e) => e.filter((t) => {
|
|
196
|
+
var r;
|
|
197
|
+
return m(e, t) ? !1 : !!((r = t.cells) != null && r.footerCell) || !(t.children && t.children.length > 0);
|
|
198
|
+
}), _ = (e) => e.width !== void 0 ? Math.floor(parseFloat(e.width.toString())) + "px" : void 0, P = (e, t) => t && t.filter((r) => r.field === e).length > 0, j = (e) => (e.sort((t, r) => t.declarationIndex - r.declarationIndex), e.map((t) => {
|
|
199
|
+
const { declarationIndex: r, parentIndex: i, depth: a, headerColSpan: d, rowSpan: f, index: n, kFirst: l, children: c, ...o } = t;
|
|
200
|
+
return c.length ? {
|
|
201
|
+
children: j(c),
|
|
202
|
+
...o
|
|
203
|
+
} : o;
|
|
195
204
|
})), B = (e) => {
|
|
196
|
-
const { cells: t, rowSpannable:
|
|
205
|
+
const { cells: t, rowSpannable: r, defaultCell: i, ...a } = e;
|
|
197
206
|
return e.children.length ? {
|
|
198
|
-
...
|
|
207
|
+
...a,
|
|
199
208
|
children: e.children.map(B)
|
|
200
|
-
} :
|
|
209
|
+
} : a;
|
|
201
210
|
}, O = (e) => ({
|
|
202
211
|
id: e.id,
|
|
203
212
|
field: e.field,
|
|
@@ -206,26 +215,26 @@ const m = (e, t) => {
|
|
|
206
215
|
orderIndex: e.orderIndex,
|
|
207
216
|
hidden: !1,
|
|
208
217
|
children: e.children ? N(e.children) : null
|
|
209
|
-
}), N = (e) => e.map(O),
|
|
210
|
-
const t = [],
|
|
211
|
-
t.push(
|
|
218
|
+
}), N = (e) => e.map(O), G = (e) => {
|
|
219
|
+
const t = [], r = (i) => i == null ? void 0 : i.forEach((a) => {
|
|
220
|
+
t.push(a), r(a.children);
|
|
212
221
|
});
|
|
213
|
-
return
|
|
214
|
-
},
|
|
222
|
+
return r(e), t;
|
|
223
|
+
}, ee = typeof window != "undefined" && /Firefox/.test(window.navigator.userAgent), te = 17895697, ne = (e) => {
|
|
215
224
|
let t = [];
|
|
216
|
-
return e.sortable && (t = t.concat([
|
|
217
|
-
},
|
|
225
|
+
return e.sortable && (t = t.concat([s.sortAsc, s.sortDesc])), e.pdf && (t.length && (t = t.concat([s.separator])), t = t.concat([s.exportPDF])), t;
|
|
226
|
+
}, re = (e) => {
|
|
218
227
|
let t = [];
|
|
219
228
|
return e.clipboard && (t = t.concat([
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
])), e.editable && (t.length && (t = t.concat([
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
])), e.selectable && (t.length && (t = t.concat([
|
|
228
|
-
},
|
|
229
|
+
s.copySelection,
|
|
230
|
+
s.copySelectionNoHeaders,
|
|
231
|
+
s.paste
|
|
232
|
+
])), e.editable && (t.length && (t = t.concat([s.separator])), t = t.concat([
|
|
233
|
+
s.create,
|
|
234
|
+
s.edit,
|
|
235
|
+
s.delete
|
|
236
|
+
])), e.selectable && (t.length && (t = t.concat([s.separator])), t = t.concat([s.select])), e.rowReorderable && (t.length && (t = t.concat([s.separator])), t = t.concat([s.reorderRow])), e.pdf && (t.length && (t = t.concat([s.separator])), t = t.concat([s.exportPDF])), t;
|
|
237
|
+
}, ie = (e, t) => {
|
|
229
238
|
if (!(!e && !t))
|
|
230
239
|
return t ? e ? {
|
|
231
240
|
...e,
|
|
@@ -247,10 +256,10 @@ const m = (e, t) => {
|
|
|
247
256
|
...t.edit || {}
|
|
248
257
|
}
|
|
249
258
|
} : t : e;
|
|
250
|
-
},
|
|
251
|
-
var
|
|
252
|
-
return typeof e == "object" ? (
|
|
253
|
-
},
|
|
259
|
+
}, ae = (e) => {
|
|
260
|
+
var r;
|
|
261
|
+
return typeof e == "object" ? (r = e.enabled) != null ? r : !0 : e != null ? e : !1;
|
|
262
|
+
}, de = () => M === b, le = (e) => !!(e && e.$$typeof === Symbol.for("react.client.reference")), oe = (e) => ({
|
|
254
263
|
id: e.id,
|
|
255
264
|
ariaColumnIndex: e.ariaColumnIndex,
|
|
256
265
|
isSelected: e.isSelected,
|
|
@@ -276,51 +285,52 @@ const m = (e, t) => {
|
|
|
276
285
|
rowDataIndex: e.rowDataIndex,
|
|
277
286
|
columnPosition: e.columnPosition,
|
|
278
287
|
group: e.group
|
|
279
|
-
}),
|
|
280
|
-
var i,
|
|
281
|
-
const t = typeof e == "object" ? (i = e.enabled) != null ? i : !0 : e != null ? e : !1,
|
|
282
|
-
return { enabled: t, valueGetter:
|
|
283
|
-
},
|
|
288
|
+
}), ce = (e) => {
|
|
289
|
+
var i, a;
|
|
290
|
+
const t = typeof e == "object" ? (i = e.enabled) != null ? i : !0 : e != null ? e : !1, r = typeof e == "object" ? (a = e.valueGetter) != null ? a : (d, f) => w(f)(d) : (d, f) => w(f)(d);
|
|
291
|
+
return { enabled: t, valueGetter: r };
|
|
292
|
+
}, $ = (e) => {
|
|
284
293
|
var t;
|
|
285
|
-
return
|
|
294
|
+
return S.isValidElement(e) ? e : (t = S.Children.toArray(e)) == null ? void 0 : t[0];
|
|
286
295
|
}, fe = (e, t) => {
|
|
287
|
-
const
|
|
288
|
-
return
|
|
289
|
-
},
|
|
296
|
+
const r = $(e);
|
|
297
|
+
return r ? S.cloneElement(r, t) : null;
|
|
298
|
+
}, se = (e) => {
|
|
290
299
|
let t = 0;
|
|
291
300
|
if (e) {
|
|
292
|
-
const
|
|
293
|
-
i.textContent = " ", t =
|
|
301
|
+
const r = e.insertRow(0), i = r.insertCell(0);
|
|
302
|
+
i.textContent = " ", t = r.getBoundingClientRect().height, e.deleteRow(0);
|
|
294
303
|
}
|
|
295
304
|
return t;
|
|
296
305
|
};
|
|
297
306
|
export {
|
|
298
|
-
|
|
299
|
-
|
|
307
|
+
Y as autoGenerateColumns,
|
|
308
|
+
se as calcRowHeight,
|
|
300
309
|
B as clientColumn,
|
|
301
310
|
fe as cloneReactElement,
|
|
302
|
-
|
|
303
|
-
|
|
311
|
+
ee as firefox,
|
|
312
|
+
te as firefoxMaxHeight,
|
|
304
313
|
R as flatData,
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
314
|
+
Z as footerColumns,
|
|
315
|
+
oe as getClientCellProps,
|
|
316
|
+
Q as getColSpan,
|
|
308
317
|
O as getColumnState,
|
|
309
|
-
|
|
318
|
+
_ as getColumnWidth,
|
|
310
319
|
N as getColumnsState,
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
j as sanitizeColumns
|
|
320
|
+
k as getDataAsArray,
|
|
321
|
+
re as getDefaultBodyContextMenuItems,
|
|
322
|
+
ne as getDefaultHeadContextMenuItems,
|
|
323
|
+
G as getFlatColumnsState,
|
|
324
|
+
K as getNestedValue,
|
|
325
|
+
$ as getReactElement,
|
|
326
|
+
ce as getRowSpanOptions,
|
|
327
|
+
de as isClient,
|
|
328
|
+
le as isClientReference,
|
|
329
|
+
ae as isRowReorderEnabled,
|
|
330
|
+
P as isSorted,
|
|
331
|
+
X as mapColumns,
|
|
332
|
+
T as readColumns,
|
|
333
|
+
ie as resolveCells,
|
|
334
|
+
j as sanitizeColumns,
|
|
335
|
+
H as syncLockedColumns
|
|
326
336
|
};
|