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