@progress/kendo-react-grid 9.4.1-develop.4 → 9.4.1-develop.5
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/GridClientContextReader.js +1 -1
- package/GridClientContextReader.mjs +16 -16
- package/cells/client/DetailCellContainer.js +1 -1
- package/cells/client/DetailCellContainer.mjs +7 -6
- package/cells/client/GridCellContainer.js +1 -1
- package/cells/client/GridCellContainer.mjs +27 -26
- package/cells/client/GridEditCellContainer.js +1 -1
- package/cells/client/GridEditCellContainer.mjs +32 -31
- package/cells/client/GridGroupCellContainer.js +1 -1
- package/cells/client/GridGroupCellContainer.mjs +26 -25
- package/cells/client/GridHierarchyCellContainer.js +1 -1
- package/cells/client/GridHierarchyCellContainer.mjs +30 -29
- package/cells/client/GridRowReorderContainer.js +1 -1
- package/cells/client/GridRowReorderContainer.mjs +15 -14
- package/cells/client/GridSelectionCellContainer.js +1 -1
- package/cells/client/GridSelectionCellContainer.mjs +31 -30
- package/components/GridContainerElementContainer.js +1 -1
- package/components/GridContainerElementContainer.mjs +8 -8
- package/components/GridCustomCellClientContainer.js +1 -1
- package/components/GridCustomCellClientContainer.mjs +8 -7
- package/components/GridDraggableRowsContainer.js +1 -1
- package/components/GridDraggableRowsContainer.mjs +10 -9
- package/components/GridElementContainer.js +1 -1
- package/components/GridElementContainer.mjs +6 -6
- package/components/PagerContainer.js +1 -1
- package/components/PagerContainer.mjs +9 -9
- package/components/table/GridTableBody.js +1 -1
- package/components/table/GridTableBody.mjs +9 -9
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/footer/client/FooterCellContainer.js +1 -1
- package/footer/client/FooterCellContainer.mjs +10 -9
- package/header/client/GridFilterCellContainer.js +1 -1
- package/header/client/GridFilterCellContainer.mjs +13 -12
- package/header/client/GridFilterCellElementContainer.js +1 -1
- package/header/client/GridFilterCellElementContainer.mjs +4 -3
- package/header/client/GridHeaderCellContainer.js +1 -1
- package/header/client/GridHeaderCellContainer.mjs +13 -12
- package/header/client/GridHeaderCellElementContainer.js +1 -1
- package/header/client/GridHeaderCellElementContainer.mjs +11 -10
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +13 -13
- package/utils/index.js +1 -1
- package/utils/index.mjs +119 -110
package/utils/index.mjs
CHANGED
|
@@ -5,149 +5,150 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
8
|
+
import * as y from "react";
|
|
9
|
+
import { gridDefaultProps as b } from "../GridColumn.mjs";
|
|
10
|
+
import { getter as u } from "@progress/kendo-data-query";
|
|
11
|
+
import { findGroupExpand as A, updateLeft as E, updateRight as M, tableKeyboardNavigationTools as m } from "@progress/kendo-react-data-tools";
|
|
12
|
+
import { ServerFragment as D } from "./_serverModule.mjs";
|
|
13
|
+
import { ClientFragment as T } from "./_clientModule.mjs";
|
|
13
14
|
import { GridContextMenuItemNames as g } from "../contextMenu/enums.mjs";
|
|
14
|
-
function
|
|
15
|
-
const
|
|
15
|
+
function w(e, t) {
|
|
16
|
+
const n = (e != null ? e : "").split(".");
|
|
16
17
|
let i = t;
|
|
17
|
-
return
|
|
18
|
+
return n.forEach((l) => {
|
|
18
19
|
i = i ? i[l] : void 0;
|
|
19
20
|
}), i;
|
|
20
21
|
}
|
|
21
|
-
function
|
|
22
|
+
function B(e, t, n, i, l, f, r, a, d, o, s = 0, c) {
|
|
22
23
|
var v;
|
|
23
|
-
let C =
|
|
24
|
-
for (let
|
|
24
|
+
let C = s;
|
|
25
|
+
for (let h = 0; h < t.length; h++) {
|
|
25
26
|
let S;
|
|
26
|
-
if (!l || t[
|
|
27
|
+
if (!l || t[h].value === void 0 || t[h].items === void 0) {
|
|
27
28
|
e[e.length] = {
|
|
28
29
|
dataIndex: i.index,
|
|
29
|
-
dataItem: t[
|
|
30
|
+
dataItem: t[h],
|
|
30
31
|
rowType: "data",
|
|
31
|
-
level:
|
|
32
|
-
group:
|
|
32
|
+
level: s,
|
|
33
|
+
group: c,
|
|
33
34
|
// This is related to detail-row expansion
|
|
34
|
-
expanded: (v = f ?
|
|
35
|
+
expanded: (v = f ? w(f, t[h]) : o && !!(r != null && r[u(o)(t[h])])) != null ? v : !1
|
|
35
36
|
}, i.index++;
|
|
36
37
|
continue;
|
|
37
38
|
} else {
|
|
38
39
|
let I;
|
|
39
|
-
|
|
40
|
-
field: t[
|
|
41
|
-
value: t[
|
|
40
|
+
c != null && c.parents ? I = [{ field: c.field, value: c.value }, ...c.parents] : c ? I = [c] : I = [], S = {
|
|
41
|
+
field: t[h].field,
|
|
42
|
+
value: t[h].value,
|
|
42
43
|
parents: I
|
|
43
44
|
};
|
|
44
45
|
}
|
|
45
|
-
C = Math.max(C,
|
|
46
|
+
C = Math.max(C, s + 1);
|
|
46
47
|
let x = !1;
|
|
47
48
|
if (f)
|
|
48
|
-
x =
|
|
49
|
+
x = w(f, t[h]) !== !1;
|
|
49
50
|
else {
|
|
50
|
-
const I =
|
|
51
|
+
const I = A(a || [], S);
|
|
51
52
|
I ? x = I.expanded !== !1 : x = d !== !1;
|
|
52
53
|
}
|
|
53
54
|
e[e.length] = {
|
|
54
55
|
dataIndex: -1,
|
|
55
|
-
dataItem: t[
|
|
56
|
-
level:
|
|
56
|
+
dataItem: t[h],
|
|
57
|
+
level: s,
|
|
57
58
|
group: S,
|
|
58
59
|
rowType: "groupHeader",
|
|
59
60
|
expanded: x
|
|
60
61
|
}, x && (S.expanded = x, C = Math.max(
|
|
61
|
-
|
|
62
|
+
B(
|
|
62
63
|
e,
|
|
63
|
-
t[
|
|
64
|
-
|
|
64
|
+
t[h].items,
|
|
65
|
+
n,
|
|
65
66
|
i,
|
|
66
67
|
l,
|
|
67
68
|
f,
|
|
68
69
|
r,
|
|
69
|
-
|
|
70
|
+
a,
|
|
70
71
|
d,
|
|
71
72
|
o,
|
|
72
|
-
|
|
73
|
+
s + 1,
|
|
73
74
|
S
|
|
74
75
|
),
|
|
75
76
|
C
|
|
76
|
-
)), (
|
|
77
|
+
)), (n === "always" || x && n === "visible") && (e[e.length] = {
|
|
77
78
|
dataIndex: -1,
|
|
78
|
-
dataItem: t[
|
|
79
|
+
dataItem: t[h],
|
|
79
80
|
rowType: "groupFooter",
|
|
80
|
-
level:
|
|
81
|
+
level: s,
|
|
81
82
|
expanded: x
|
|
82
83
|
});
|
|
83
84
|
}
|
|
84
85
|
return C;
|
|
85
86
|
}
|
|
86
|
-
const
|
|
87
|
-
function
|
|
88
|
-
const
|
|
87
|
+
const z = (e, t) => typeof e.colSpan == "function" ? e.colSpan({ dataItem: t, column: e }) : e.colSpan || 1;
|
|
88
|
+
function W(e, t) {
|
|
89
|
+
const n = [[]];
|
|
89
90
|
let i = 0;
|
|
90
91
|
for (let r = e.length - 1; r >= 0; r--)
|
|
91
92
|
i = Math.max(i, e[r].depth), e[r].headerColSpan = e[r].headerColSpan || 1, e[r].children.length > 0 && (e[r].headerColSpan = e[r].children.reduce(
|
|
92
|
-
(
|
|
93
|
+
(a, d) => d.hidden ? a : a + d.headerColSpan,
|
|
93
94
|
0
|
|
94
95
|
));
|
|
95
96
|
const l = [];
|
|
96
97
|
let f = 1;
|
|
97
|
-
return e.forEach((r,
|
|
98
|
-
|
|
98
|
+
return e.forEach((r, a) => {
|
|
99
|
+
n[r.depth] = n[r.depth] || [];
|
|
99
100
|
let d = !1;
|
|
100
|
-
|
|
101
|
+
n[r.depth].length === 0 && (f <= 1 ? f = 1 + (r.children.length > 0 ? 0 : i - r.depth) : (f--, d = !0)), r.rowSpan = 1 + (r.children.length > 0 ? 0 : i - r.depth), r.kFirst = d, r.index = n[r.depth].length, n[r.depth].push(a), r.ariaColumnIndex = l[r.depth] ? l[r.depth] + 1 : 1;
|
|
101
102
|
for (let o = r.depth; o < r.depth + r.rowSpan; o++)
|
|
102
103
|
l[o] = (l[o] || 0) + r.headerColSpan;
|
|
103
|
-
}),
|
|
104
|
+
}), E(n, e, t), M(n, e, t), n;
|
|
104
105
|
}
|
|
105
|
-
function j(e, t,
|
|
106
|
+
function j(e, t, n, i = 0) {
|
|
106
107
|
const l = [];
|
|
107
108
|
if (!e)
|
|
108
109
|
return [];
|
|
109
|
-
e && e.length === void 0 && (e = [e]), e.filter((
|
|
110
|
-
|
|
111
|
-
const o = t[d] || null,
|
|
112
|
-
|
|
110
|
+
e && e.length === void 0 && (e = [e]), e.filter((a) => a && a.props ? !a.props.hidden : !a.hidden).forEach((a, d) => {
|
|
111
|
+
a = a.props ? a.props : a;
|
|
112
|
+
const o = t[d] || null, s = j(
|
|
113
|
+
a.children,
|
|
113
114
|
o && o.children || [],
|
|
114
|
-
|
|
115
|
+
n,
|
|
115
116
|
i + 1
|
|
116
117
|
);
|
|
117
118
|
l.push(
|
|
118
119
|
Object.assign(
|
|
119
120
|
{ depth: i },
|
|
120
|
-
|
|
121
|
-
|
|
121
|
+
b,
|
|
122
|
+
s.length ? { cell: () => null, filterCell: () => null } : {},
|
|
122
123
|
o ? { width: o.width, orderIndex: o.orderIndex } : {},
|
|
123
|
-
|
|
124
|
+
a,
|
|
124
125
|
{
|
|
125
|
-
id:
|
|
126
|
+
id: a.id ? a.id : m.generateNavigatableId(`${n.prevId++}`, n.idPrefix, "column"),
|
|
126
127
|
declarationIndex: l.length,
|
|
127
|
-
children:
|
|
128
|
-
headerColSpan:
|
|
128
|
+
children: s,
|
|
129
|
+
headerColSpan: a.headerColSpan,
|
|
129
130
|
rowSpan: 0,
|
|
130
|
-
columnType:
|
|
131
|
-
colSpan:
|
|
131
|
+
columnType: a.columnType || "data",
|
|
132
|
+
colSpan: a.colSpan || 1,
|
|
132
133
|
isAccessible: !0,
|
|
133
|
-
left:
|
|
134
|
-
right:
|
|
135
|
-
rowSpannable:
|
|
134
|
+
left: a.lockedColumn ? o && Math.floor(o.left) : null,
|
|
135
|
+
right: a.lockedColumn ? o && Math.floor(o.right) : null,
|
|
136
|
+
rowSpannable: a.rowSpannable
|
|
136
137
|
}
|
|
137
138
|
)
|
|
138
139
|
);
|
|
139
140
|
});
|
|
140
|
-
const r = (
|
|
141
|
+
const r = (a, d) => a.orderIndex === d.orderIndex ? a.declarationIndex - d.declarationIndex : (a.orderIndex || 0) - (d.orderIndex || 0);
|
|
141
142
|
if (l.sort(r), i === 0) {
|
|
142
|
-
const
|
|
143
|
-
|
|
143
|
+
const a = [], d = (o, s) => o.forEach((c) => {
|
|
144
|
+
c.parentIndex = s, d(c.children, a.push(c) - 1);
|
|
144
145
|
});
|
|
145
|
-
return d(l, -1),
|
|
146
|
+
return d(l, -1), a;
|
|
146
147
|
}
|
|
147
148
|
return l;
|
|
148
149
|
}
|
|
149
150
|
const k = (e) => Array.isArray(e) ? e : e ? e.data : [];
|
|
150
|
-
function
|
|
151
|
+
function J(e, t, n, i) {
|
|
151
152
|
const l = k(e), f = [];
|
|
152
153
|
if (l.length > 0) {
|
|
153
154
|
let r = l[0];
|
|
@@ -155,10 +156,10 @@ function V(e, t, a, i) {
|
|
|
155
156
|
for (let d = 0; d < t.length; d++)
|
|
156
157
|
r = r.items && r.items[0];
|
|
157
158
|
Object.getOwnPropertyNames(r).forEach((d) => {
|
|
158
|
-
d !==
|
|
159
|
+
d !== n.column && f.push(
|
|
159
160
|
Object.assign(
|
|
160
161
|
{
|
|
161
|
-
id:
|
|
162
|
+
id: m.generateNavigatableId(`${i.prevId++}`, i.idPrefix, "column"),
|
|
162
163
|
declarationIndex: -1,
|
|
163
164
|
parentIndex: -1,
|
|
164
165
|
depth: 0,
|
|
@@ -174,7 +175,7 @@ function V(e, t, a, i) {
|
|
|
174
175
|
ariaColumnIndex: 0,
|
|
175
176
|
isAccessible: !0
|
|
176
177
|
},
|
|
177
|
-
|
|
178
|
+
b,
|
|
178
179
|
{ field: d }
|
|
179
180
|
)
|
|
180
181
|
);
|
|
@@ -182,30 +183,30 @@ function V(e, t, a, i) {
|
|
|
182
183
|
}
|
|
183
184
|
return f;
|
|
184
185
|
}
|
|
185
|
-
const
|
|
186
|
-
let
|
|
187
|
-
for (;
|
|
188
|
-
if (
|
|
186
|
+
const p = (e, t) => {
|
|
187
|
+
let n = e[t.parentIndex];
|
|
188
|
+
for (; n; ) {
|
|
189
|
+
if (n.footerCell)
|
|
189
190
|
return !0;
|
|
190
|
-
|
|
191
|
+
n = e[n.parentIndex];
|
|
191
192
|
}
|
|
192
193
|
return !1;
|
|
193
|
-
},
|
|
194
|
-
const { declarationIndex:
|
|
194
|
+
}, K = (e) => e.filter((t) => p(e, t) ? !1 : !!t.footerCell || !(t.children && t.children.length > 0)), Q = (e) => e.width !== void 0 ? Math.floor(parseFloat(e.width.toString())) + "px" : void 0, U = (e, t) => t && t.filter((n) => n.field === e).length > 0, F = (e) => (e.sort((t, n) => t.declarationIndex - n.declarationIndex), e.map((t) => {
|
|
195
|
+
const { declarationIndex: n, parentIndex: i, depth: l, headerColSpan: f, rowSpan: r, index: a, kFirst: d, children: o, ...s } = t;
|
|
195
196
|
return o.length ? {
|
|
196
|
-
children:
|
|
197
|
-
...
|
|
198
|
-
} :
|
|
199
|
-
})),
|
|
200
|
-
const { filterCell: t, headerCell:
|
|
197
|
+
children: F(o),
|
|
198
|
+
...s
|
|
199
|
+
} : s;
|
|
200
|
+
})), R = (e) => {
|
|
201
|
+
const { filterCell: t, headerCell: n, footerCell: i, cells: l, cell: f, rowSpannable: r, ...a } = e;
|
|
201
202
|
return e.children.length ? {
|
|
202
|
-
...
|
|
203
|
-
children: e.children.map(
|
|
204
|
-
} :
|
|
205
|
-
},
|
|
203
|
+
...a,
|
|
204
|
+
children: e.children.map(R)
|
|
205
|
+
} : a;
|
|
206
|
+
}, X = typeof window != "undefined" && /Firefox/.test(window.navigator.userAgent), Y = 17895697, Z = (e) => {
|
|
206
207
|
let t = [];
|
|
207
208
|
return e.sortable && (t = t.concat([g.sortAsc, g.sortDesc])), t;
|
|
208
|
-
},
|
|
209
|
+
}, _ = (e) => {
|
|
209
210
|
let t = [];
|
|
210
211
|
return e.clipboard && (t = t.concat([
|
|
211
212
|
g.copySelection,
|
|
@@ -216,7 +217,7 @@ const F = (e, t) => {
|
|
|
216
217
|
g.edit,
|
|
217
218
|
g.delete
|
|
218
219
|
])), e.selectable && (t.length && (t = t.concat([g.separator])), t = t.concat([g.select])), e.rowReorderable && (t.length && (t = t.concat([g.separator])), t = t.concat([g.reorderRow])), t;
|
|
219
|
-
},
|
|
220
|
+
}, G = (e, t) => {
|
|
220
221
|
if (!(!e && !t))
|
|
221
222
|
return t ? e ? {
|
|
222
223
|
...e,
|
|
@@ -238,10 +239,10 @@ const F = (e, t) => {
|
|
|
238
239
|
...t.edit || {}
|
|
239
240
|
}
|
|
240
241
|
} : t : e;
|
|
241
|
-
},
|
|
242
|
-
var
|
|
243
|
-
return typeof e == "object" ? (
|
|
244
|
-
},
|
|
242
|
+
}, P = (e) => {
|
|
243
|
+
var n;
|
|
244
|
+
return typeof e == "object" ? (n = e.enabled) != null ? n : !0 : e != null ? e : !1;
|
|
245
|
+
}, ee = () => D === T, te = (e) => !!(e && e.$$typeof === Symbol.for("react.client.reference")), re = (e) => ({
|
|
245
246
|
id: e.id,
|
|
246
247
|
ariaColumnIndex: e.ariaColumnIndex,
|
|
247
248
|
isSelected: e.isSelected,
|
|
@@ -267,32 +268,40 @@ const F = (e, t) => {
|
|
|
267
268
|
rowDataIndex: e.rowDataIndex,
|
|
268
269
|
columnPosition: e.columnPosition,
|
|
269
270
|
group: e.group
|
|
270
|
-
}),
|
|
271
|
+
}), ne = (e) => {
|
|
271
272
|
var i, l;
|
|
272
|
-
const t = typeof e == "object" ? (i = e.enabled) != null ? i : !0 : e != null ? e : !1,
|
|
273
|
-
return { enabled: t, valueGetter:
|
|
273
|
+
const t = typeof e == "object" ? (i = e.enabled) != null ? i : !0 : e != null ? e : !1, n = typeof e == "object" ? (l = e.valueGetter) != null ? l : (f, r) => u(r)(f) : (f, r) => u(r)(f);
|
|
274
|
+
return { enabled: t, valueGetter: n };
|
|
275
|
+
}, N = (e) => {
|
|
276
|
+
var t;
|
|
277
|
+
return y.isValidElement(e) ? e : (t = y.Children.toArray(e)) == null ? void 0 : t[0];
|
|
278
|
+
}, ae = (e, t) => {
|
|
279
|
+
const n = N(e);
|
|
280
|
+
return n ? y.cloneElement(n, t) : null;
|
|
274
281
|
};
|
|
275
282
|
export {
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
283
|
+
J as autoGenerateColumns,
|
|
284
|
+
R as clientColumn,
|
|
285
|
+
ae as cloneReactElement,
|
|
286
|
+
X as firefox,
|
|
287
|
+
Y as firefoxMaxHeight,
|
|
288
|
+
B as flatData,
|
|
289
|
+
K as footerColumns,
|
|
290
|
+
re as getClientCellProps,
|
|
291
|
+
z as getColSpan,
|
|
292
|
+
Q as getColumnWidth,
|
|
285
293
|
k as getDataAsArray,
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
294
|
+
_ as getDefaultBodyContextMenuItems,
|
|
295
|
+
Z as getDefaultHeadContextMenuItems,
|
|
296
|
+
w as getNestedValue,
|
|
297
|
+
N as getReactElement,
|
|
298
|
+
ne as getRowSpanOptions,
|
|
299
|
+
ee as isClient,
|
|
300
|
+
te as isClientReference,
|
|
301
|
+
P as isRowReorderEnabled,
|
|
302
|
+
U as isSorted,
|
|
303
|
+
W as mapColumns,
|
|
295
304
|
j as readColumns,
|
|
296
|
-
|
|
297
|
-
|
|
305
|
+
G as resolveCells,
|
|
306
|
+
F as sanitizeColumns
|
|
298
307
|
};
|