@progress/kendo-react-grid 9.1.0-develop.8 → 9.1.0-develop.9
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/Grid.js +1 -1
- package/Grid.mjs +98 -100
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/footer/Footer.js +1 -1
- package/footer/Footer.mjs +23 -32
- package/header/Header.js +1 -1
- package/header/Header.mjs +12 -13
- package/package-metadata.mjs +1 -1
- package/package.json +10 -10
- package/utils/index.js +1 -1
- package/utils/index.mjs +12 -12
package/Grid.mjs
CHANGED
|
@@ -24,7 +24,7 @@ import { VirtualScroll as jn } from "./VirtualScroll.mjs";
|
|
|
24
24
|
import { VirtualScrollFixed as Rt } from "./VirtualScrollFixed.mjs";
|
|
25
25
|
import { ColumnResize as qn } from "./drag/ColumnResize.mjs";
|
|
26
26
|
import { CommonDragLogic as Jn } from "./drag/CommonDragLogic.mjs";
|
|
27
|
-
import { getColumnWidth as
|
|
27
|
+
import { getColumnWidth as De, isSorted as Ct, sanitizeColumns as Xn, firefox as vt, firefoxMaxHeight as yt, flatData as Yn, autoGenerateColumns as Qn, getNestedValue as wt, resolveCells as Zn, readColumns as pn } from "./utils/index.mjs";
|
|
28
28
|
import { GridCell as er } from "./cells/GridCell.mjs";
|
|
29
29
|
import { GridGroupCell as Et } from "./cells/GridGroupCell.mjs";
|
|
30
30
|
import { GridRow as tr } from "./rows/GridRow.mjs";
|
|
@@ -39,16 +39,16 @@ import { GridDetailHierarchyCell as cr } from "./cells/GridDetailHierarchyCell.m
|
|
|
39
39
|
import { SAFARI_REGEX as ir } from "./constants/index.mjs";
|
|
40
40
|
const kt = r.forwardRef((t, xt) => {
|
|
41
41
|
var nt, rt, at, lt;
|
|
42
|
-
const
|
|
42
|
+
const ue = Rn();
|
|
43
43
|
Cn(St);
|
|
44
44
|
const A = () => {
|
|
45
45
|
var e;
|
|
46
46
|
if (Q)
|
|
47
47
|
return ((e = Z()) == null ? void 0 : e.ownerDocument) || document;
|
|
48
|
-
}, T = () => (t.id ||
|
|
48
|
+
}, T = () => (t.id || ue) + "-role-element-id", V = () => {
|
|
49
49
|
const e = s.current.filter((n) => n.declarationIndex >= 0 && n.parentIndex === -1);
|
|
50
50
|
return Xn(e);
|
|
51
|
-
}, Z = () => k.current,
|
|
51
|
+
}, Z = () => k.current, se = r.useCallback(
|
|
52
52
|
(e) => {
|
|
53
53
|
var l;
|
|
54
54
|
if (!c.current || !((l = c.current) != null && l.container) || t.scrollable === "none")
|
|
@@ -66,17 +66,17 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
[t.scrollable]
|
|
69
|
-
),
|
|
69
|
+
), Ne = r.useCallback(
|
|
70
70
|
(e) => {
|
|
71
|
-
const n = { rowIndex:
|
|
71
|
+
const n = { rowIndex: Ie.current };
|
|
72
72
|
e.forEach((a) => {
|
|
73
|
-
a.isIntersecting ||
|
|
73
|
+
a.isIntersecting || se(n);
|
|
74
74
|
});
|
|
75
75
|
},
|
|
76
|
-
[
|
|
77
|
-
), [,
|
|
78
|
-
Ht() ||
|
|
79
|
-
},
|
|
76
|
+
[se]
|
|
77
|
+
), [, fe] = r.useReducer((e) => !e, !0), Fe = (e) => JSON.stringify(e.map((n) => ({ id: n.id, field: n.field, title: n.title, children: n.children }))), B = r.useMemo(() => r.Children.toArray(t.children), [t.children]), Ht = () => Fe(B) === Fe(s.current), Tt = () => {
|
|
78
|
+
Ht() || fe();
|
|
79
|
+
}, ge = (e, n, a) => {
|
|
80
80
|
if (t.onContextMenu) {
|
|
81
81
|
const l = {
|
|
82
82
|
target: w.current,
|
|
@@ -87,23 +87,23 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
87
87
|
};
|
|
88
88
|
t.onContextMenu.call(void 0, l);
|
|
89
89
|
}
|
|
90
|
-
},
|
|
90
|
+
}, Ge = () => {
|
|
91
91
|
const { data: e, total: n } = t;
|
|
92
92
|
return Array.isArray(e) ? e.length === n : e ? n === e.total : !1;
|
|
93
93
|
}, Dt = () => {
|
|
94
|
-
const { rowHeight: e, detailRowHeight: n, detail: a, expandField: l, groupable: i } = t, u =
|
|
94
|
+
const { rowHeight: e, detailRowHeight: n, detail: a, expandField: l, groupable: i } = t, u = Ge(), d = e !== void 0 && e > 0, h = n !== void 0 && n > 0, E = i === !0 || typeof i == "object" && i.enabled !== !1;
|
|
95
95
|
return !d || E && !u || !!(a && l) && (!h || !u) ? jn : Rt;
|
|
96
96
|
}, Nt = (e, n) => {
|
|
97
97
|
if (c.current) {
|
|
98
|
-
if (c.current.fixedScroll = t.fixedScroll || !1, c.current.PageChange =
|
|
98
|
+
if (c.current.fixedScroll = t.fixedScroll || !1, c.current.PageChange = p, c.current.realSkip = t.skip || 0, c.current.pageSize = (t.take !== void 0 ? t.take : t.pageSize) || 0, c.current.scrollableVirtual = t.scrollable === "virtual", c.current.total = e, c.current.propsSkip = (t.skip || 0) + (t.scrollable === "virtual" ? c.current.topCacheCount + (c.current.attendedSkip - (t.skip || 0)) : 0), t.rowHeight !== void 0 && t.rowHeight > 0 && !n) {
|
|
99
99
|
const a = t.rowHeight * e;
|
|
100
100
|
c.current.containerHeight = vt ? Math.min(yt, a) : a;
|
|
101
101
|
} else
|
|
102
102
|
c.current.containerHeight = 1533915;
|
|
103
|
-
if (c.current.containerRef = _, c.current.tableBodyRef = U, c.current.table = y.current,
|
|
103
|
+
if (c.current.containerRef = _, c.current.tableBodyRef = U, c.current.table = y.current, ae.current = void 0, c.current instanceof Rt) {
|
|
104
104
|
const { rowHeight: a = 0, detail: l, expandField: i } = t;
|
|
105
105
|
let { detailRowHeight: u = 0 } = t;
|
|
106
|
-
u = l && i ? u : a,
|
|
106
|
+
u = l && i ? u : a, Ge() ? (c.current.total = R.current.length, ae.current = R.current.slice(
|
|
107
107
|
c.current.realSkip,
|
|
108
108
|
c.current.realSkip + c.current.pageSize
|
|
109
109
|
), c.current.rowHeightService = new it(
|
|
@@ -116,15 +116,15 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
116
116
|
c.current.containerHeight = vt ? Math.min(yt, d) : d;
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
},
|
|
119
|
+
}, Ae = () => (ye.current || (ye.current = kn() || void 0), ye.current), Ft = (e) => {
|
|
120
120
|
var l;
|
|
121
121
|
if (e.target !== e.currentTarget)
|
|
122
122
|
return;
|
|
123
|
-
clearTimeout(
|
|
123
|
+
clearTimeout(Ee.current), c.current && (c.current.table = y.current);
|
|
124
124
|
const n = e.currentTarget.scrollLeft, a = e.currentTarget.scrollTop;
|
|
125
|
-
t.columnVirtualization && (!((l = c.current) != null && l.scrollableVirtual) || a ===
|
|
126
|
-
|
|
127
|
-
}, 0)), O.current && O.current.setScrollLeft(n), W.current && W.current.setScrollLeft(n), c.current && a !==
|
|
125
|
+
t.columnVirtualization && (!((l = c.current) != null && l.scrollableVirtual) || a === we.current) && (Ee.current = window.setTimeout(() => {
|
|
126
|
+
fe();
|
|
127
|
+
}, 0)), O.current && O.current.setScrollLeft(n), W.current && W.current.setScrollLeft(n), c.current && a !== we.current && c.current.scrollHandler(e), xn(t.onScroll, e, w.current, void 0), we.current = a;
|
|
128
128
|
}, ze = (e) => {
|
|
129
129
|
if (K.onKeyDown(e, {
|
|
130
130
|
navigatable: t.navigatable || !1,
|
|
@@ -138,7 +138,7 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
138
138
|
navigationStateRef: D
|
|
139
139
|
}), t.onKeyDown) {
|
|
140
140
|
const { mode: n, cell: a } = ht(t.selectable), l = {
|
|
141
|
-
dataItems:
|
|
141
|
+
dataItems: ne(),
|
|
142
142
|
mode: n,
|
|
143
143
|
cell: a,
|
|
144
144
|
componentId: T(),
|
|
@@ -155,11 +155,11 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
155
155
|
}, Gt = (e) => {
|
|
156
156
|
if (e.action === "moveToNextPage" && Lt(e.event), e.action === "moveToPrevPage" && Vt(e.event), e.focusElement && e.action === "reorderToRight") {
|
|
157
157
|
const n = parseInt(e.focusElement.ariaColIndex, 10) - 1;
|
|
158
|
-
n < s.current.length - 1 &&
|
|
158
|
+
n < s.current.length - 1 && me(n, n + 1, e.event);
|
|
159
159
|
}
|
|
160
160
|
if (e.focusElement && e.action === "reorderToLeft") {
|
|
161
161
|
const n = parseInt(e.focusElement.ariaColIndex, 10) - 1;
|
|
162
|
-
n > 0 &&
|
|
162
|
+
n > 0 && me(n, n - 1, e.event);
|
|
163
163
|
}
|
|
164
164
|
if (t.onNavigationAction) {
|
|
165
165
|
const n = {
|
|
@@ -204,7 +204,7 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
204
204
|
endColIndex: i,
|
|
205
205
|
startRowIndex: l,
|
|
206
206
|
endRowIndex: l,
|
|
207
|
-
dataItems:
|
|
207
|
+
dataItems: ne(),
|
|
208
208
|
altKey: !1,
|
|
209
209
|
ctrlKey: !1,
|
|
210
210
|
shiftKey: !1,
|
|
@@ -223,7 +223,7 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
223
223
|
nativeEvent: e.syntheticEvent && e.syntheticEvent.nativeEvent,
|
|
224
224
|
syntheticEvent: e.syntheticEvent,
|
|
225
225
|
target: w.current,
|
|
226
|
-
dataItems:
|
|
226
|
+
dataItems: ne(),
|
|
227
227
|
selectedField: t.selectedField
|
|
228
228
|
});
|
|
229
229
|
}, Oe = (e) => {
|
|
@@ -233,7 +233,7 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
233
233
|
target: w.current,
|
|
234
234
|
selectedField: t.selectedField || "",
|
|
235
235
|
componentId: T(),
|
|
236
|
-
dataItems:
|
|
236
|
+
dataItems: ne(),
|
|
237
237
|
dataItem: null,
|
|
238
238
|
startDataItem: n,
|
|
239
239
|
endDataItem: a,
|
|
@@ -241,8 +241,8 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
241
241
|
};
|
|
242
242
|
t.onSelectionChange.call(void 0, l);
|
|
243
243
|
}
|
|
244
|
-
},
|
|
245
|
-
|
|
244
|
+
}, p = (e, n, a) => {
|
|
245
|
+
te(
|
|
246
246
|
t.onPageChange,
|
|
247
247
|
{ page: e },
|
|
248
248
|
{ skip: e.skip, take: e.take },
|
|
@@ -254,35 +254,35 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
254
254
|
return Array.isArray(t.data) ? e = e || t.data.length : t.data && (e = e || t.data.total), e;
|
|
255
255
|
}, Lt = (e) => {
|
|
256
256
|
const n = t.take || 0, a = (t.skip || 0) + n, l = Kt();
|
|
257
|
-
a < l &&
|
|
257
|
+
a < l && p({ skip: a, take: n }, e);
|
|
258
258
|
}, Vt = (e) => {
|
|
259
259
|
const n = t.take || 0, a = (t.skip || 0) - n;
|
|
260
|
-
a >= 0 &&
|
|
260
|
+
a >= 0 && p({ skip: a, take: n }, e);
|
|
261
261
|
}, Bt = (e) => {
|
|
262
|
-
|
|
262
|
+
p({ skip: e.skip, take: e.take }, e.syntheticEvent, e.targetEvent);
|
|
263
263
|
}, Wt = (e, n) => {
|
|
264
|
-
|
|
264
|
+
te(
|
|
265
265
|
t.onSortChange,
|
|
266
266
|
{ sort: e },
|
|
267
267
|
{ sort: e, ...t.scrollable === "virtual" ? { skip: 0 } : {} },
|
|
268
268
|
n
|
|
269
269
|
);
|
|
270
270
|
}, Pe = (e, n) => {
|
|
271
|
-
|
|
271
|
+
te(
|
|
272
272
|
t.onFilterChange,
|
|
273
273
|
{ filter: e },
|
|
274
274
|
{ filter: e || void 0, skip: 0 },
|
|
275
275
|
n
|
|
276
276
|
);
|
|
277
|
-
},
|
|
277
|
+
}, ee = (e, n) => {
|
|
278
278
|
const a = n.nativeEvent ? n : { nativeEvent: n.nativeEvent || n.originalEvent };
|
|
279
|
-
e.length === 0 && t.navigatable && (
|
|
279
|
+
e.length === 0 && t.navigatable && (Re.current = !0), te(
|
|
280
280
|
t.onGroupChange,
|
|
281
281
|
{ group: e },
|
|
282
282
|
{ group: e, skip: 0 },
|
|
283
283
|
a
|
|
284
284
|
);
|
|
285
|
-
},
|
|
285
|
+
}, te = (e, n, a, l, i) => {
|
|
286
286
|
const u = t.onDataStateChange;
|
|
287
287
|
if (e) {
|
|
288
288
|
const d = { ...v(l), ...n, targetEvent: i };
|
|
@@ -296,7 +296,7 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
296
296
|
...a
|
|
297
297
|
}
|
|
298
298
|
});
|
|
299
|
-
},
|
|
299
|
+
}, me = (e, n, a) => {
|
|
300
300
|
const l = s.current[e], i = l.depth, u = (f) => {
|
|
301
301
|
do
|
|
302
302
|
f++;
|
|
@@ -305,9 +305,9 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
305
305
|
}, d = s.current.splice(e, u(e) - e);
|
|
306
306
|
s.current.splice(e < n ? u(n - d.length) : n, 0, ...d), s.current.filter((f) => f.declarationIndex >= 0).forEach((f, P) => f.orderIndex = P);
|
|
307
307
|
const h = s.current[e].locked && s.current[n].locked;
|
|
308
|
-
Fn(M.current, s.current, h ||
|
|
308
|
+
Fn(M.current, s.current, h || oe.current), Gn(M.current, s.current, h || oe.current), be.current && (oe.current = !1, be.current = !1);
|
|
309
309
|
const E = V();
|
|
310
|
-
if (
|
|
310
|
+
if (fe(), t.onColumnReorder) {
|
|
311
311
|
const f = {
|
|
312
312
|
target: w.current,
|
|
313
313
|
columns: E,
|
|
@@ -320,17 +320,17 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
320
320
|
if (t.group === void 0)
|
|
321
321
|
return;
|
|
322
322
|
const l = t.group.slice();
|
|
323
|
-
l.splice(n, 0, ...l.splice(e, 1)),
|
|
323
|
+
l.splice(n, 0, ...l.splice(e, 1)), ee(l, a);
|
|
324
324
|
}, Ke = (e, n, a) => {
|
|
325
325
|
const l = s.current[e].field;
|
|
326
326
|
if (!l)
|
|
327
327
|
return;
|
|
328
328
|
const i = (t.group || []).slice();
|
|
329
|
-
i.splice(n, 0, { field: l }),
|
|
329
|
+
i.splice(n, 0, { field: l }), ee(i, a);
|
|
330
330
|
}, Ut = (e, n) => {
|
|
331
331
|
const a = g.current.getCurrentGroupsLength;
|
|
332
332
|
Ke(e, a, n);
|
|
333
|
-
},
|
|
333
|
+
}, he = () => {
|
|
334
334
|
let e = 0;
|
|
335
335
|
if (!C.current.colGroupMain)
|
|
336
336
|
return;
|
|
@@ -361,7 +361,7 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
361
361
|
const e = Hn(A()), n = e ? e.matches(".k-table-td") ? e : (i = A()) == null ? void 0 : i.body : (u = A()) == null ? void 0 : u.body, a = n.closest(".k-grid-container"), l = n && ((d = k.current) == null ? void 0 : d.contains(n));
|
|
362
362
|
return !!(n && l && a);
|
|
363
363
|
}, qt = (e, n, a, l, i, u) => {
|
|
364
|
-
|
|
364
|
+
he(), oe.current = !0, be.current = !0, t.onColumnResize && t.onColumnResize.call(void 0, {
|
|
365
365
|
columns: V(),
|
|
366
366
|
nativeEvent: l,
|
|
367
367
|
targetColumnId: u,
|
|
@@ -444,16 +444,16 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
444
444
|
nativeEvent: e && e.nativeEvent,
|
|
445
445
|
syntheticEvent: e,
|
|
446
446
|
target: w.current
|
|
447
|
-
}),
|
|
447
|
+
}), ne = () => R.current.filter((e) => e.rowType === "data").map((e) => e.dataItem), Le = () => (ae.current || R.current).filter((e) => e.rowType === "data").map((e) => e.dataItem), tn = () => {
|
|
448
448
|
var e, n, a;
|
|
449
449
|
if (U.current && ((e = U.current) == null ? void 0 : e.getElementsByClassName("k-grid-edit-row").length) > 0) {
|
|
450
|
-
|
|
450
|
+
ve.current = !1, (n = document.activeElement) != null && n.closest(".k-grid-edit-row") ? Ce.current = document.activeElement : Ce.current = void 0;
|
|
451
451
|
const l = Array.from((a = U.current) == null ? void 0 : a.getElementsByClassName("k-grid-edit-row"));
|
|
452
|
-
l.length >
|
|
453
|
-
(i) => !
|
|
454
|
-
)[0] : l.length === 1 && (
|
|
452
|
+
l.length > Se.current.length ? le.current = l.filter(
|
|
453
|
+
(i) => !Se.current.includes(i)
|
|
454
|
+
)[0] : l.length === 1 && (le.current = l[0], ve.current = !0), Se.current = l;
|
|
455
455
|
}
|
|
456
|
-
}, g = r.useRef(), S = r.useRef(), D = r.useRef(),
|
|
456
|
+
}, g = r.useRef(), S = r.useRef(), D = r.useRef(), re = r.useRef(), c = r.useRef(), C = r.useRef(), z = r.useRef(null), R = r.useRef([]), ae = r.useRef(), s = r.useRef([]), M = r.useRef([[]]), be = r.useRef(!1), Re = r.useRef(!1), le = r.useRef(), Ce = r.useRef(), ve = r.useRef(!1), oe = r.useRef(!0), ye = r.useRef(), we = r.useRef(0), Ee = r.useRef(), Ie = r.useRef(), Se = r.useRef([]), W = r.useRef(null), O = r.useRef(null), Ve = r.useRef(null), k = r.useRef(null), y = r.useRef(null), _ = r.useRef(null), U = r.useRef(null), ce = r.useRef(null), nn = _n(), ke = vn(), m = ke && ke.uGrid ? ke.uGrid : yn, rn = wn(St), N = En(k);
|
|
457
457
|
r.useMemo(() => {
|
|
458
458
|
K.onConstructor({
|
|
459
459
|
navigatable: !!t.navigatable,
|
|
@@ -466,39 +466,39 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
466
466
|
(a = c.current) == null || a.reset();
|
|
467
467
|
const e = t.groupable === !0 || typeof t.groupable == "object" && t.groupable.enabled !== !1, n = Dt();
|
|
468
468
|
c.current = new n(e || t.rowHeight === void 0 || t.rowHeight === 0);
|
|
469
|
-
}, [t.scrollable, t.total, t.filter, t.group, t.groupable, t.sort, t.rowHeight]), r.useEffect(() => (t.clipboard && (
|
|
470
|
-
|
|
469
|
+
}, [t.scrollable, t.total, t.filter, t.group, t.groupable, t.sort, t.rowHeight]), r.useEffect(() => (t.clipboard && (re.current = new Tn($t), re.current.addEventListeners(A())), () => {
|
|
470
|
+
re.current && re.current.removeEventListeners(A());
|
|
471
471
|
}), [t.onClipboard, t.clipboard]), r.useMemo(() => {
|
|
472
472
|
C.current = new qn(qt);
|
|
473
473
|
}, [t.onColumnResize]), r.useMemo(() => {
|
|
474
|
-
g.current = new Jn(
|
|
475
|
-
}, [t.onColumnReorder, t.onGroupChange, t.group, t.groupable]), r.useEffect(() => (t.columnVirtualization && !window.navigator.userAgent.match(ir) && (
|
|
474
|
+
g.current = new Jn(me, _t, Ke);
|
|
475
|
+
}, [t.onColumnReorder, t.onGroupChange, t.group, t.groupable]), r.useEffect(() => (t.columnVirtualization && !window.navigator.userAgent.match(ir) && (ce.current && (ce.current.style.display = "block"), y.current && (y.current.style.display = "block")), he(), ct(Ae()), K.onComponentDidMount({
|
|
476
476
|
scope: k.current || void 0,
|
|
477
477
|
contextStateRef: S,
|
|
478
478
|
navigationStateRef: D
|
|
479
479
|
}), () => {
|
|
480
|
-
clearTimeout(
|
|
480
|
+
clearTimeout(Ee.current);
|
|
481
481
|
}), []), r.useEffect(() => {
|
|
482
482
|
var e;
|
|
483
|
-
|
|
483
|
+
he(), ct(Ae()), (e = c.current) != null && e.tableTransform && c.current.table && (c.current.table.style.transform = c.current.tableTransform, c.current.tableTransform = ""), tn(), K.onComponentDidUpdate({
|
|
484
484
|
scope: k.current || void 0,
|
|
485
485
|
contextStateRef: S,
|
|
486
486
|
navigationStateRef: D,
|
|
487
|
-
focusFirst:
|
|
488
|
-
newEditableRow:
|
|
489
|
-
singleEditRow:
|
|
490
|
-
lastActiveElement:
|
|
487
|
+
focusFirst: Re.current,
|
|
488
|
+
newEditableRow: le.current,
|
|
489
|
+
singleEditRow: ve.current,
|
|
490
|
+
lastActiveElement: Ce.current,
|
|
491
491
|
navigatable: t.navigatable
|
|
492
|
-
}),
|
|
492
|
+
}), Re.current = !1, le.current = void 0;
|
|
493
493
|
}), r.useEffect(() => {
|
|
494
494
|
if (Q) {
|
|
495
495
|
const e = {
|
|
496
496
|
rootMargin: "0px",
|
|
497
497
|
threshold: 0.9
|
|
498
498
|
};
|
|
499
|
-
z.current = window.IntersectionObserver && new window.IntersectionObserver(
|
|
499
|
+
z.current = window.IntersectionObserver && new window.IntersectionObserver(Ne, e) || null;
|
|
500
500
|
}
|
|
501
|
-
}, [
|
|
501
|
+
}, [Ne]), r.useEffect(() => {
|
|
502
502
|
let e;
|
|
503
503
|
return Q && window.ResizeObserver && (e = new window.ResizeObserver(Tt), e.observe(k.current)), () => {
|
|
504
504
|
e == null || e.disconnect();
|
|
@@ -520,12 +520,12 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
520
520
|
if (!((l = c.current) != null && l.container) || t.scrollable === "none")
|
|
521
521
|
return;
|
|
522
522
|
const { rowIndex: n } = e;
|
|
523
|
-
|
|
523
|
+
Ie.current = n;
|
|
524
524
|
const a = Z();
|
|
525
525
|
if (z.current && a) {
|
|
526
526
|
z.current.disconnect();
|
|
527
|
-
const i = a.querySelector(`[absolute-row-index="${
|
|
528
|
-
i ? z.current.observe(i) :
|
|
527
|
+
const i = a.querySelector(`[absolute-row-index="${Ie.current}"]`);
|
|
528
|
+
i ? z.current.observe(i) : se(e);
|
|
529
529
|
}
|
|
530
530
|
},
|
|
531
531
|
fitColumns: (e) => {
|
|
@@ -535,10 +535,10 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
535
535
|
), r.useImperativeHandle(xt, () => w.current);
|
|
536
536
|
let F = t.total || 0;
|
|
537
537
|
const $ = L.getIdPrefix(D), { size: x = "medium" } = t;
|
|
538
|
-
let
|
|
539
|
-
Array.isArray(t.data) ? (
|
|
538
|
+
let xe = [];
|
|
539
|
+
Array.isArray(t.data) ? (xe = t.data, F = F || t.data.length) : t.data && (xe = t.data.data, F = F || t.data.total);
|
|
540
540
|
const an = typeof t.groupable == "object" && t.groupable.footer || "none", j = t.scrollable === "virtual", { resolvedGroupsCount: ln, flattedData: on } = Jt(
|
|
541
|
-
|
|
541
|
+
xe,
|
|
542
542
|
an,
|
|
543
543
|
t.skip || 0,
|
|
544
544
|
t.group,
|
|
@@ -557,14 +557,14 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
557
557
|
Bn,
|
|
558
558
|
{
|
|
559
559
|
group: t.group || [],
|
|
560
|
-
groupChange:
|
|
560
|
+
groupChange: ee,
|
|
561
561
|
pressHandler: g.current.pressHandler,
|
|
562
562
|
dragHandler: g.current.dragHandler,
|
|
563
563
|
releaseHandler: g.current.releaseHandler,
|
|
564
564
|
refCallback: g.current.refGroupPanelDiv,
|
|
565
565
|
resolveTitle: pt,
|
|
566
566
|
ariaControls: T(),
|
|
567
|
-
onContextMenu:
|
|
567
|
+
onContextMenu: ge
|
|
568
568
|
}
|
|
569
569
|
), $e = /* @__PURE__ */ r.createElement(
|
|
570
570
|
Kn,
|
|
@@ -576,7 +576,6 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
576
576
|
var e;
|
|
577
577
|
return ((e = c.current) == null ? void 0 : e.container) || null;
|
|
578
578
|
},
|
|
579
|
-
hasScrollbarWidth: !!p(),
|
|
580
579
|
draggable: t.reorderable || q,
|
|
581
580
|
ref: O,
|
|
582
581
|
elemRef: Ve,
|
|
@@ -589,7 +588,7 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
589
588
|
sortChange: Wt,
|
|
590
589
|
group: t.group || [],
|
|
591
590
|
groupable: q,
|
|
592
|
-
groupChange:
|
|
591
|
+
groupChange: ee,
|
|
593
592
|
filter: t.filter,
|
|
594
593
|
filterable: t.filterable,
|
|
595
594
|
filterOperators: t.filterOperators || It,
|
|
@@ -628,7 +627,7 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
628
627
|
ariaRowIndex: M.current.length + 1
|
|
629
628
|
}
|
|
630
629
|
) || void 0,
|
|
631
|
-
cols: H.map((e, n) => /* @__PURE__ */ r.createElement("col", { key: n.toString(), width:
|
|
630
|
+
cols: H.map((e, n) => /* @__PURE__ */ r.createElement("col", { key: n.toString(), width: De(e) }))
|
|
632
631
|
}
|
|
633
632
|
), dn = c.current && c.current.container && c.current.container.scrollLeft || 0, un = parseFloat(((t.style || {}).width || "").toString()), { colSpans: sn, hiddenColumns: fn } = Dn({
|
|
634
633
|
enabled: t.columnVirtualization,
|
|
@@ -648,17 +647,17 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
648
647
|
const I = wt(t.editField, e.dataItem);
|
|
649
648
|
I && (I === !0 || I === d.field) && (i = !0, X = !0);
|
|
650
649
|
}
|
|
651
|
-
const G = d.cell || X && Pn || er,
|
|
650
|
+
const G = d.cell || X && Pn || er, Te = t.expandField && t.detail && d.field === t.expandField;
|
|
652
651
|
return /* @__PURE__ */ r.createElement(
|
|
653
652
|
G,
|
|
654
653
|
{
|
|
655
|
-
onContextMenu:
|
|
654
|
+
onContextMenu: ge,
|
|
656
655
|
key: E,
|
|
657
656
|
locked: t.lockGroups,
|
|
658
657
|
id: L.generateNavigatableId(
|
|
659
658
|
`${n}-${String(h)}`,
|
|
660
659
|
$,
|
|
661
|
-
|
|
660
|
+
Te || e.rowType === "groupHeader" || e.rowType === "groupFooter" || d.field === "value" ? "nodata" : "cell"
|
|
662
661
|
),
|
|
663
662
|
colSpan: sn[h],
|
|
664
663
|
dataItem: e.dataItem,
|
|
@@ -706,17 +705,17 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
706
705
|
}
|
|
707
706
|
const qe = (e) => e >= R.current.length - je;
|
|
708
707
|
let Je = ((nt = c.current) == null ? void 0 : nt.realSkip) || 0;
|
|
709
|
-
const
|
|
710
|
-
let
|
|
708
|
+
const ie = [];
|
|
709
|
+
let He = !1;
|
|
711
710
|
const Xe = M.current.length + (t.filterable ? 1 : 0) + 1;
|
|
712
711
|
let J = 0;
|
|
713
712
|
if (R.current.length) {
|
|
714
713
|
let e = -1, n = 0;
|
|
715
|
-
(
|
|
714
|
+
(ae.current || R.current).forEach((a, l) => {
|
|
716
715
|
var P, X;
|
|
717
716
|
a.rowType === "data" && (Je++, e++);
|
|
718
717
|
const i = Je % 2 === 0, u = t.dataItemKey && In(t.dataItemKey)(a.dataItem), d = l + (((P = c.current) == null ? void 0 : P.realSkip) || 0), h = u || "ai" + d, E = h + "_1", f = gn(a, h, e, i);
|
|
719
|
-
if (J = d + Xe + n,
|
|
718
|
+
if (J = d + Xe + n, ie.push(
|
|
720
719
|
/* @__PURE__ */ r.createElement(
|
|
721
720
|
tr,
|
|
722
721
|
{
|
|
@@ -740,7 +739,7 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
740
739
|
)
|
|
741
740
|
), t.detail && a.rowType === "data" && a.expanded) {
|
|
742
741
|
const G = H.length - (t.expandField ? 1 : 0) - (t.group ? t.group.length : 0) || 1;
|
|
743
|
-
n++, J = d + Xe + n,
|
|
742
|
+
n++, J = d + Xe + n, ie.push(
|
|
744
743
|
/* @__PURE__ */ r.createElement(
|
|
745
744
|
"tr",
|
|
746
745
|
{
|
|
@@ -753,7 +752,7 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
753
752
|
role: "row",
|
|
754
753
|
"aria-rowindex": J
|
|
755
754
|
},
|
|
756
|
-
t.group && t.group.map((
|
|
755
|
+
t.group && t.group.map((Te, I) => {
|
|
757
756
|
var ot;
|
|
758
757
|
const Y = (ot = f == null ? void 0 : f.row[I]) == null ? void 0 : ot.props.style, bn = Y ? N !== "rtl" ? { left: Y.left, right: Y.right } : { left: Y.right, right: Y.left } : {};
|
|
759
758
|
return /* @__PURE__ */ r.createElement(
|
|
@@ -761,7 +760,7 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
761
760
|
{
|
|
762
761
|
id: "",
|
|
763
762
|
dataIndex: a.dataIndex,
|
|
764
|
-
field:
|
|
763
|
+
field: Te.field,
|
|
765
764
|
dataItem: a.dataItem,
|
|
766
765
|
key: I,
|
|
767
766
|
style: bn,
|
|
@@ -782,7 +781,7 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
782
781
|
/* @__PURE__ */ r.createElement(
|
|
783
782
|
or,
|
|
784
783
|
{
|
|
785
|
-
onContextMenu:
|
|
784
|
+
onContextMenu: ge,
|
|
786
785
|
dataItem: a.dataItem,
|
|
787
786
|
dataIndex: a.dataIndex,
|
|
788
787
|
colSpan: G,
|
|
@@ -796,7 +795,7 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
796
795
|
}
|
|
797
796
|
});
|
|
798
797
|
} else
|
|
799
|
-
|
|
798
|
+
He = !0;
|
|
800
799
|
const mn = () => {
|
|
801
800
|
const e = O.current;
|
|
802
801
|
return e && e.table() && e.table().clientWidth;
|
|
@@ -816,7 +815,7 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
816
815
|
take: (t.take !== void 0 ? t.take : t.pageSize) || 10,
|
|
817
816
|
messagesMap: Un,
|
|
818
817
|
...lr(t.pageable || {})
|
|
819
|
-
}, Ze = t.pager ? /* @__PURE__ */ r.createElement(t.pager, { ...Qe }) : /* @__PURE__ */ r.createElement(Nn, { className: b(m.pager({})), ...Qe }), hn = (e, n) => /* @__PURE__ */ r.createElement("col", { key: n.toString(), width:
|
|
818
|
+
}, Ze = t.pager ? /* @__PURE__ */ r.createElement(t.pager, { ...Qe }) : /* @__PURE__ */ r.createElement(Nn, { className: b(m.pager({})), ...Qe }), hn = (e, n) => /* @__PURE__ */ r.createElement("col", { key: n.toString(), width: De(e) }), pe = (at = t.cells) != null && at.footerCell || s.current.some((e) => {
|
|
820
819
|
var n;
|
|
821
820
|
return !!(e.footerCell || (n = e.cells) != null && n.footerCell);
|
|
822
821
|
}) ? /* @__PURE__ */ r.createElement(
|
|
@@ -825,7 +824,6 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
825
824
|
size: x,
|
|
826
825
|
columnResize: C.current,
|
|
827
826
|
staticHeaders: t.scrollable !== "none",
|
|
828
|
-
hasScrollbarWidth: !!p(),
|
|
829
827
|
ref: W,
|
|
830
828
|
row: /* @__PURE__ */ r.createElement(
|
|
831
829
|
ar,
|
|
@@ -851,7 +849,7 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
851
849
|
{
|
|
852
850
|
key: n.toString(),
|
|
853
851
|
className: Ct(e.field, t.sort) ? b(m.sorted({})) : void 0,
|
|
854
|
-
width:
|
|
852
|
+
width: De(e)
|
|
855
853
|
}
|
|
856
854
|
))
|
|
857
855
|
), tt = g.current.reorderable || g.current.groupable;
|
|
@@ -859,7 +857,7 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
859
857
|
return /* @__PURE__ */ r.createElement(dt.Provider, { value: S.current }, /* @__PURE__ */ r.createElement(
|
|
860
858
|
"div",
|
|
861
859
|
{
|
|
862
|
-
id: t.id ||
|
|
860
|
+
id: t.id || ue,
|
|
863
861
|
style: t.style,
|
|
864
862
|
className: b(m.wrapper({ size: x }), t.className),
|
|
865
863
|
ref: k,
|
|
@@ -876,28 +874,28 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
876
874
|
selectable: t.selectable,
|
|
877
875
|
onRelease: Oe,
|
|
878
876
|
childRef: (e) => {
|
|
879
|
-
y.current = e,
|
|
877
|
+
y.current = e, ce.current = e;
|
|
880
878
|
}
|
|
881
879
|
},
|
|
882
|
-
/* @__PURE__ */ r.createElement("table", { ref:
|
|
880
|
+
/* @__PURE__ */ r.createElement("table", { ref: ce, className: b(m.table({ size: x })) }, et, $e, /* @__PURE__ */ r.createElement(
|
|
883
881
|
"tbody",
|
|
884
882
|
{
|
|
885
883
|
role: "rowgroup",
|
|
886
884
|
className: b(m.tbody({})),
|
|
887
885
|
...ft
|
|
888
886
|
},
|
|
889
|
-
|
|
887
|
+
ie
|
|
890
888
|
), pe)
|
|
891
889
|
),
|
|
892
|
-
|
|
890
|
+
He && Ye(),
|
|
893
891
|
tt && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(gt, { ref: g.current.refDropElementClue }), /* @__PURE__ */ r.createElement(mt, { ref: g.current.refDragElementClue }))
|
|
894
892
|
), _e, t.pageable && Ze);
|
|
895
|
-
let
|
|
896
|
-
return j && (
|
|
893
|
+
let de = t.style || {};
|
|
894
|
+
return j && (de.height || (de = Object.assign({}, de, { height: "450px" }))), /* @__PURE__ */ r.createElement(dt.Provider, { value: S.current }, /* @__PURE__ */ r.createElement(
|
|
897
895
|
"div",
|
|
898
896
|
{
|
|
899
|
-
id: t.id ||
|
|
900
|
-
style:
|
|
897
|
+
id: t.id || ue,
|
|
898
|
+
style: de,
|
|
901
899
|
className: b(
|
|
902
900
|
m.wrapper({
|
|
903
901
|
size: x,
|
|
@@ -962,10 +960,10 @@ const kt = r.forwardRef((t, xt) => {
|
|
|
962
960
|
role: "rowgroup",
|
|
963
961
|
...ft
|
|
964
962
|
},
|
|
965
|
-
|
|
963
|
+
ie
|
|
966
964
|
)
|
|
967
965
|
)
|
|
968
|
-
),
|
|
966
|
+
), He && Ye()),
|
|
969
967
|
j && /* @__PURE__ */ r.createElement("div", { className: b(m.heightContainer({})), role: "presentation" }, /* @__PURE__ */ r.createElement(
|
|
970
968
|
"div",
|
|
971
969
|
{
|