@progress/kendo-react-grid 14.5.0-develop.9 → 15.0.0-develop.1
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 +84 -84
- package/GridWebMcpProps.d.ts +82 -0
- package/README.md +4 -4
- package/cells/datacell/utils.js +1 -1
- package/cells/datacell/utils.mjs +19 -13
- package/columnMenu/GridColumnMenuFilterCell.js +1 -1
- package/columnMenu/GridColumnMenuFilterCell.mjs +4 -4
- package/columnMenu/GridColumnMenuWrapper.js +1 -1
- package/columnMenu/GridColumnMenuWrapper.mjs +46 -46
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/filterCommon.d.ts +1 -1
- package/filterCommon.js +1 -1
- package/filterCommon.mjs +56 -58
- package/header/HeaderRow.js +1 -1
- package/header/HeaderRow.mjs +30 -29
- package/index.d.mts +3 -1
- package/index.d.ts +3 -1
- package/interfaces/GridProps.d.ts +22 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +17 -17
- package/utils/handleAIResponse.d.ts +7 -3
package/GridClientWrapper.mjs
CHANGED
|
@@ -7,30 +7,30 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as c from "react";
|
|
10
|
-
import { useAdaptiveModeContext as wn, canUseDOM as ae, getActiveElement as yn, useDir as En, setScrollbarWidth as at, cloneArray as xn,
|
|
11
|
-
import { filterBy as
|
|
12
|
-
import { getSelectionOptions as we, populateClipboardData as
|
|
13
|
-
import { ColumnResize as
|
|
14
|
-
import { CommonDragLogic as
|
|
15
|
-
import { useStickyGroups as
|
|
16
|
-
import { getDefaultHeadContextMenuItems as
|
|
17
|
-
import { VirtualScroll as
|
|
18
|
-
import { GridContextMenu as
|
|
10
|
+
import { useAdaptiveModeContext as wn, canUseDOM as ae, getActiveElement as yn, useDir as En, setScrollbarWidth as at, cloneArray as xn, useWebMcpRegister as Sn, RowHeightService as kn, getter as te } from "@progress/kendo-react-common";
|
|
11
|
+
import { filterBy as Dn } from "@progress/kendo-data-query";
|
|
12
|
+
import { getSelectionOptions as we, populateClipboardData as Kn, ClipboardActionType as ze, getEditableOptions as Gn, tableKeyboardNavigation as ne, ClipboardService as Tn, TableKeyboardNavigationContext as Hn, updateLeft as Mn, updateRight as An, getGroupExpandableOptions as Fn, groupExpandReducer as Ln, getDetailExpandableOptions as Bn, detailExpandReducer as Wn, getSelectedState as ct, editReducer as zn, EDIT_ACTION as On, closestTagName as ye, getSelectedStateFromKeyDown as pn, getColumnIndex as Nn, getRowIndex as Un } from "@progress/kendo-react-data-tools";
|
|
13
|
+
import { ColumnResize as Vn } from "./drag/ColumnResize.mjs";
|
|
14
|
+
import { CommonDragLogic as jn } from "./drag/CommonDragLogic.mjs";
|
|
15
|
+
import { useStickyGroups as qn } from "./hooks/useStickyGroups.mjs";
|
|
16
|
+
import { getDefaultHeadContextMenuItems as $n, getDefaultBodyContextMenuItems as _n, isRowReorderEnabled as Zn, calcRowHeight as Jn, sanitizeColumns as Xn, getFlatColumnsState as Yn, getDataAsArray as Qn } from "./utils/index.mjs";
|
|
17
|
+
import { VirtualScroll as er } from "./VirtualScroll.mjs";
|
|
18
|
+
import { GridContextMenu as tr, contextMenuItemsMap as nr } from "./contextMenu/GridContextMenu.mjs";
|
|
19
19
|
import { GridContextMenuAnchorPart as dt, GridContextMenuItemNames as Ee } from "./contextMenu/enums.mjs";
|
|
20
|
-
import { normalizeSortable as
|
|
21
|
-
import { BasePDFExport as
|
|
22
|
-
import { BaseCSVExport as
|
|
23
|
-
import { GridContext as
|
|
24
|
-
import { operators as
|
|
25
|
-
const
|
|
26
|
-
const re = Object.keys(
|
|
20
|
+
import { normalizeSortable as rr, firstLevelSortSeqMap as or } from "./sortCommon.mjs";
|
|
21
|
+
import { BasePDFExport as ir } from "./BasePDFExport.mjs";
|
|
22
|
+
import { BaseCSVExport as ar } from "./BaseCSVExport.mjs";
|
|
23
|
+
import { GridContext as cr } from "./utils/GridContext.mjs";
|
|
24
|
+
import { operators as dr } from "./filterCommon.mjs";
|
|
25
|
+
const sr = (t, S, b, z) => {
|
|
26
|
+
const re = Object.keys(S.cells).map((k) => b.findIndex((O) => O.field === k)), Z = Object.keys(S.cells).length > 0 ? re : !0;
|
|
27
27
|
return t.reduce((k, O) => (k[O[z != null ? z : "id"]] = Z, k), {});
|
|
28
|
-
}, st = (t,
|
|
28
|
+
}, st = (t, S, b, z) => S.reduce((Z, k) => ({
|
|
29
29
|
...Z,
|
|
30
|
-
...
|
|
31
|
-
}), {}),
|
|
30
|
+
...sr(Dn(t, k), k, b, z)
|
|
31
|
+
}), {}), xr = (t) => {
|
|
32
32
|
var it;
|
|
33
|
-
const
|
|
33
|
+
const S = t.gridProps.isClient, [b, z] = c.useState({}), re = wn(), Z = c.useRef(null), k = c.useRef(null), O = c.useRef({}), lt = (e) => {
|
|
34
34
|
e.event.preventDefault(), z({
|
|
35
35
|
...b,
|
|
36
36
|
show: !0,
|
|
@@ -46,7 +46,7 @@ const dr = (t, x, b, z) => {
|
|
|
46
46
|
}, ut = (e) => {
|
|
47
47
|
const n = t.gridProps.dataItemKey || "", o = b.dataItem, r = t.gridProps.pinnedTopRows || [], i = t.gridProps.pinnedBottomRows || [], a = n ? o[n] : void 0, d = a !== void 0 && r.some((s) => s[n] === a), l = a !== void 0 && i.some((s) => s[n] === a);
|
|
48
48
|
return e.map((s) => {
|
|
49
|
-
const u = typeof s == "string" ?
|
|
49
|
+
const u = typeof s == "string" ? nr[s] : s;
|
|
50
50
|
return (u == null ? void 0 : u.name) === Ee.pinRow && u.items ? {
|
|
51
51
|
...u,
|
|
52
52
|
items: u.items.filter((m) => m.name === Ee.pinTop ? !d : m.name === Ee.pinBottom ? !l : m.name === Ee.unpin ? d || l : !0)
|
|
@@ -54,17 +54,17 @@ const dr = (t, x, b, z) => {
|
|
|
54
54
|
});
|
|
55
55
|
}, y = c.useMemo(() => t.columnsRef.find((e) => e.field === b.field), [t.columnsRef, b]), pe = c.useMemo(() => {
|
|
56
56
|
const e = t.gridProps.sortable && (y == null ? void 0 : y.sortable);
|
|
57
|
-
return
|
|
57
|
+
return $n({
|
|
58
58
|
pdf: !!t.gridProps.pdf,
|
|
59
59
|
sortable: !!e,
|
|
60
60
|
selectable: we(t.gridProps.selectable).enabled,
|
|
61
61
|
clipboard: !!t.gridProps.clipboard
|
|
62
62
|
});
|
|
63
|
-
}, [y, t.gridProps.sortable, t.gridProps.selectable, t.gridProps.clipboard]), Ne = c.useMemo(() => (t.gridProps.sortable && (y == null || y.sortable),
|
|
63
|
+
}, [y, t.gridProps.sortable, t.gridProps.selectable, t.gridProps.clipboard]), Ne = c.useMemo(() => (t.gridProps.sortable && (y == null || y.sortable), _n({
|
|
64
64
|
pdf: !!t.gridProps.pdf,
|
|
65
65
|
selectable: we(t.gridProps.selectable).enabled,
|
|
66
66
|
clipboard: !!t.gridProps.clipboard,
|
|
67
|
-
rowReorderable:
|
|
67
|
+
rowReorderable: Zn(t.gridProps.rowReorderable),
|
|
68
68
|
pinnable: !!t.gridProps.pinnable
|
|
69
69
|
})), [
|
|
70
70
|
y,
|
|
@@ -91,7 +91,7 @@ const dr = (t, x, b, z) => {
|
|
|
91
91
|
]), gt = (e) => {
|
|
92
92
|
var d, l, s, u, m, w, h, N, g;
|
|
93
93
|
const n = e.event.item, o = {
|
|
94
|
-
target:
|
|
94
|
+
target: E.current,
|
|
95
95
|
syntheticEvent: e.event.syntheticEvent,
|
|
96
96
|
nativeEvent: e.event.nativeEvent,
|
|
97
97
|
menuItem: n,
|
|
@@ -114,11 +114,11 @@ const dr = (t, x, b, z) => {
|
|
|
114
114
|
isDrag: !1,
|
|
115
115
|
...we(t.gridProps.selectable),
|
|
116
116
|
...o
|
|
117
|
-
}, a = r.findIndex((
|
|
117
|
+
}, a = r.findIndex((x) => x === e.dataItem);
|
|
118
118
|
switch ((d = n.data) == null ? void 0 : d.action) {
|
|
119
119
|
case "SortCommand":
|
|
120
120
|
if (y) {
|
|
121
|
-
const
|
|
121
|
+
const x = (l = n.name) == null ? void 0 : l.toLowerCase().includes("asc"), _ = ((s = n.name) == null ? void 0 : s.toLowerCase().includes("desc")) ? "desc" : void 0, W = x ? "asc" : _, ee = n.name ? W : void 0;
|
|
122
122
|
Ue(e.event.syntheticEvent, y, ee);
|
|
123
123
|
}
|
|
124
124
|
break;
|
|
@@ -172,11 +172,11 @@ const dr = (t, x, b, z) => {
|
|
|
172
172
|
Oe();
|
|
173
173
|
}, de = () => {
|
|
174
174
|
const e = t.columnsRef.filter((n) => n.declarationIndex >= 0 && n.parentIndex === -1);
|
|
175
|
-
return
|
|
175
|
+
return Xn(e);
|
|
176
176
|
}, ft = (e, n, o) => {
|
|
177
|
-
if (t.gridProps.onContextMenu &&
|
|
177
|
+
if (t.gridProps.onContextMenu && S) {
|
|
178
178
|
const r = {
|
|
179
|
-
target:
|
|
179
|
+
target: E.current,
|
|
180
180
|
syntheticEvent: e,
|
|
181
181
|
nativeEvent: e.nativeEvent,
|
|
182
182
|
dataItem: n,
|
|
@@ -201,7 +201,7 @@ const dr = (t, x, b, z) => {
|
|
|
201
201
|
const r = (a = t.gridProps.virtualSkipRef) == null ? void 0 : a.current;
|
|
202
202
|
C.current && o !== Ae.current && C.current.scrollHandler(e);
|
|
203
203
|
const i = K && ((d = t.gridProps.virtualSkipRef) == null ? void 0 : d.current) !== r;
|
|
204
|
-
t.gridProps.onScroll &&
|
|
204
|
+
t.gridProps.onScroll && S && f(t.gridProps.onScroll, {
|
|
205
205
|
...I(e)
|
|
206
206
|
}), Ae.current = o, i || nt();
|
|
207
207
|
}, Pt = (e) => {
|
|
@@ -256,7 +256,7 @@ const dr = (t, x, b, z) => {
|
|
|
256
256
|
selectedField: "",
|
|
257
257
|
...I(e)
|
|
258
258
|
};
|
|
259
|
-
t.gridProps.onKeyDown &&
|
|
259
|
+
t.gridProps.onKeyDown && S && f(t.gridProps.onKeyDown, n);
|
|
260
260
|
}, bt = (e) => {
|
|
261
261
|
ne.onFocus(e, {
|
|
262
262
|
navigatable: !!t.gridProps.navigatable,
|
|
@@ -279,7 +279,7 @@ const dr = (t, x, b, z) => {
|
|
|
279
279
|
ue(o, o - 1, e.event);
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
|
-
if (e.action === "select" && Gt(e.event), t.gridProps.onNavigationAction &&
|
|
282
|
+
if (e.action === "select" && Gt(e.event), t.gridProps.onNavigationAction && S) {
|
|
283
283
|
const o = {
|
|
284
284
|
focusElement: e.focusElement,
|
|
285
285
|
...I(e.event)
|
|
@@ -315,8 +315,8 @@ const dr = (t, x, b, z) => {
|
|
|
315
315
|
const d = !!((i = (r = e.target).closest) != null && i.call(r, ".k-grid-pinned-container"));
|
|
316
316
|
t.gridProps.editZoneRef.current = d ? "pinned" : "body";
|
|
317
317
|
}
|
|
318
|
-
const a =
|
|
319
|
-
type:
|
|
318
|
+
const a = zn(t.gridProps.edit, {
|
|
319
|
+
type: On.ENTER_FIELD_EDIT,
|
|
320
320
|
payload: { id: n[t.gridProps.dataItemKey], field: o }
|
|
321
321
|
});
|
|
322
322
|
t.gridProps.onEditChange && f(t.gridProps.onEditChange, {
|
|
@@ -326,8 +326,8 @@ const dr = (t, x, b, z) => {
|
|
|
326
326
|
}
|
|
327
327
|
}, xt = (e, n) => {
|
|
328
328
|
var r;
|
|
329
|
-
if (
|
|
330
|
-
const i =
|
|
329
|
+
if (Bn(t.detailExpandable).enabled) {
|
|
330
|
+
const i = Wn((r = t.gridProps.detailExpand) != null ? r : {}, e);
|
|
331
331
|
t.gridProps.onDetailExpandChange && f(t.gridProps.onDetailExpandChange, {
|
|
332
332
|
...I(n),
|
|
333
333
|
detailExpand: i
|
|
@@ -335,11 +335,11 @@ const dr = (t, x, b, z) => {
|
|
|
335
335
|
}
|
|
336
336
|
}, St = (e, n) => {
|
|
337
337
|
var r;
|
|
338
|
-
const o =
|
|
338
|
+
const o = Fn(
|
|
339
339
|
typeof t.gridProps.groupable == "object" ? t.gridProps.groupable.expandable !== !1 : t.gridProps.groupable
|
|
340
340
|
);
|
|
341
341
|
if (o.enabled) {
|
|
342
|
-
const i =
|
|
342
|
+
const i = Ln((r = t.gridProps.groupExpand) != null ? r : [], e, o);
|
|
343
343
|
t.gridProps.onGroupExpandChange && f(t.gridProps.onGroupExpandChange, {
|
|
344
344
|
...I(n),
|
|
345
345
|
groupExpand: i
|
|
@@ -375,10 +375,10 @@ const dr = (t, x, b, z) => {
|
|
|
375
375
|
}
|
|
376
376
|
t.gridProps.onRowPinChange && f(t.gridProps.onRowPinChange, s);
|
|
377
377
|
}, Ue = (e, n, o) => {
|
|
378
|
-
const { allowUnsort: r, mode: i } =
|
|
378
|
+
const { allowUnsort: r, mode: i } = rr(
|
|
379
379
|
t.gridProps.sortable || !1,
|
|
380
380
|
n.sortable || !1
|
|
381
|
-
), a = (t.gridProps.sort || []).filter((s) => s.field === n.field)[0], d = o ||
|
|
381
|
+
), a = (t.gridProps.sort || []).filter((s) => s.field === n.field)[0], d = o || or[r][a && a.dir || ""], l = i === "single" ? [] : (t.gridProps.sort || []).filter((s) => s.field !== n.field);
|
|
382
382
|
d !== "" && n.field && l.push({ field: n.field, dir: d }), je(l, e);
|
|
383
383
|
}, Dt = (e) => {
|
|
384
384
|
t.gridProps.onItemChange && f(t.gridProps.onItemChange, {
|
|
@@ -429,16 +429,16 @@ const dr = (t, x, b, z) => {
|
|
|
429
429
|
componentId: t.id,
|
|
430
430
|
selectedField: "",
|
|
431
431
|
...I(e)
|
|
432
|
-
}, o =
|
|
432
|
+
}, o = pn({
|
|
433
433
|
event: n,
|
|
434
434
|
selectedState: (s = t.gridProps.select) != null ? s : {},
|
|
435
435
|
dataItemKey: t.gridProps.dataItemKey
|
|
436
436
|
});
|
|
437
437
|
if (o === t.gridProps.select)
|
|
438
438
|
return;
|
|
439
|
-
const r = e.target, i = ye(r, "TD"), a = ye(r, "TR"), d =
|
|
439
|
+
const r = e.target, i = ye(r, "TD"), a = ye(r, "TR"), d = Nn(i), l = Un(a);
|
|
440
440
|
if (d !== void 0 && l !== void 0) {
|
|
441
|
-
const m = (u =
|
|
441
|
+
const m = (u = Qn(t.gridProps.data)) == null ? void 0 : u[l];
|
|
442
442
|
t.gridProps.onSelectionChange && f(t.gridProps.onSelectionChange, {
|
|
443
443
|
...n,
|
|
444
444
|
select: o,
|
|
@@ -464,7 +464,7 @@ const dr = (t, x, b, z) => {
|
|
|
464
464
|
field: e.field,
|
|
465
465
|
nativeEvent: e.syntheticEvent && e.syntheticEvent.nativeEvent,
|
|
466
466
|
syntheticEvent: e.syntheticEvent,
|
|
467
|
-
target:
|
|
467
|
+
target: E.current,
|
|
468
468
|
dataItems: n
|
|
469
469
|
});
|
|
470
470
|
}
|
|
@@ -488,7 +488,7 @@ const dr = (t, x, b, z) => {
|
|
|
488
488
|
if (t.gridProps.onSelectionChange && v.enabled) {
|
|
489
489
|
const o = D(), r = o[e.startRowIndex], i = o[e.endRowIndex], a = {
|
|
490
490
|
syntheticEvent: void 0,
|
|
491
|
-
target:
|
|
491
|
+
target: E.current,
|
|
492
492
|
selectedField: "",
|
|
493
493
|
componentId: t.id,
|
|
494
494
|
dataItems: o,
|
|
@@ -540,7 +540,7 @@ const dr = (t, x, b, z) => {
|
|
|
540
540
|
const n = D(), o = {
|
|
541
541
|
syntheticEvent: void 0,
|
|
542
542
|
nativeEvent: void 0,
|
|
543
|
-
target:
|
|
543
|
+
target: E.current,
|
|
544
544
|
selectedField: "",
|
|
545
545
|
componentId: t.id,
|
|
546
546
|
dataItems: n,
|
|
@@ -720,13 +720,13 @@ const dr = (t, x, b, z) => {
|
|
|
720
720
|
}, De = (e) => {
|
|
721
721
|
if (t.gridProps.onColumnsStateChange) {
|
|
722
722
|
const n = {
|
|
723
|
-
target:
|
|
723
|
+
target: E.current,
|
|
724
724
|
columnsState: e
|
|
725
725
|
};
|
|
726
726
|
f(t.gridProps.onColumnsStateChange, n);
|
|
727
727
|
}
|
|
728
728
|
}, ue = (e, n, o) => {
|
|
729
|
-
const { columnsRef: r, columnsState: i } = t, a = r[e], d =
|
|
729
|
+
const { columnsRef: r, columnsState: i } = t, a = r[e], d = Yn(i), l = a.depth, s = (h) => {
|
|
730
730
|
do
|
|
731
731
|
h++;
|
|
732
732
|
while (h < r.length && r[h].depth > l);
|
|
@@ -734,15 +734,15 @@ const dr = (t, x, b, z) => {
|
|
|
734
734
|
}, u = r.splice(e, s(e) - e);
|
|
735
735
|
r.splice(e < n ? s(n - u.length) : n, 0, ...u), r.filter((h) => h.declarationIndex >= 0).forEach((h, N) => {
|
|
736
736
|
h.orderIndex = N;
|
|
737
|
-
const g = d.find((
|
|
737
|
+
const g = d.find((x) => x.id === h.id);
|
|
738
738
|
g && (g.orderIndex = N);
|
|
739
739
|
});
|
|
740
740
|
const m = r[e].locked && r[n].locked;
|
|
741
|
-
|
|
741
|
+
Mn(t.columnsMapRef, r, m || be.current), An(t.columnsMapRef, r, m || be.current), Ge.current && (be.current = !1, Ge.current = !1);
|
|
742
742
|
const w = de();
|
|
743
743
|
if (Y(), t.gridProps.onColumnReorder) {
|
|
744
744
|
const h = {
|
|
745
|
-
target:
|
|
745
|
+
target: E.current,
|
|
746
746
|
columns: w,
|
|
747
747
|
columnId: a.id,
|
|
748
748
|
nativeEvent: o
|
|
@@ -761,7 +761,7 @@ const dr = (t, x, b, z) => {
|
|
|
761
761
|
dropPosition: o,
|
|
762
762
|
nativeEvent: e.originalEvent,
|
|
763
763
|
dragEvent: e,
|
|
764
|
-
target:
|
|
764
|
+
target: E.current
|
|
765
765
|
}), ie.current = null;
|
|
766
766
|
}, $t = (e, n, o) => {
|
|
767
767
|
if (t.gridProps.group === void 0)
|
|
@@ -782,15 +782,15 @@ const dr = (t, x, b, z) => {
|
|
|
782
782
|
if (t.gridProps.dataLayoutMode === "stacked") {
|
|
783
783
|
const g = ((e = M.current) == null ? void 0 : e.offsetWidth) || 0;
|
|
784
784
|
if ((n = P.current) != null && n.colGroupMain && g) {
|
|
785
|
-
const
|
|
785
|
+
const x = P.current.colGroupMain.children, R = x.length - 1;
|
|
786
786
|
if (R >= 0) {
|
|
787
787
|
let _ = 0;
|
|
788
788
|
for (let ee = 0; ee < R; ee++) {
|
|
789
|
-
const In = parseFloat((
|
|
789
|
+
const In = parseFloat((x[ee].width || 0).toString()) || x[ee].clientWidth;
|
|
790
790
|
_ += In;
|
|
791
791
|
}
|
|
792
792
|
const W = Math.max(0, g - _);
|
|
793
|
-
|
|
793
|
+
x[R].width = W + "px", (r = (o = P.current.colGroupHeader) == null ? void 0 : o.children) != null && r[R] && (P.current.colGroupHeader.children[R].width = W + "px"), (a = (i = P.current.colGroupFooter) == null ? void 0 : i.children) != null && a[R] && (P.current.colGroupFooter.children[R].width = W + "px"), (l = (d = P.current.colGroupStickyHeader) == null ? void 0 : d.children) != null && l[R] && (P.current.colGroupStickyHeader.children[R].width = W + "px"), (u = (s = P.current.colGroupStickyFooter) == null ? void 0 : s.children) != null && u[R] && (P.current.colGroupStickyFooter.children[R].width = W + "px"), (w = (m = P.current.colGroupPinnedTop) == null ? void 0 : m.children) != null && w[R] && (P.current.colGroupPinnedTop.children[R].width = W + "px"), (N = (h = P.current.colGroupPinnedBottom) == null ? void 0 : h.children) != null && N[R] && (P.current.colGroupPinnedBottom.children[R].width = W + "px");
|
|
794
794
|
}
|
|
795
795
|
}
|
|
796
796
|
$.current && $.current.setWidth(g), q.current && q.current.setWidth(g), A.current && A.current.setWidth(g), F.current && F.current.setWidth(g), L.current && L.current.setWidth(g), B.current && B.current.setWidth(g), j.current && (j.current.style.width = g ? g + "px" : "");
|
|
@@ -798,9 +798,9 @@ const dr = (t, x, b, z) => {
|
|
|
798
798
|
let g = 0;
|
|
799
799
|
if (!P.current.colGroupMain)
|
|
800
800
|
return;
|
|
801
|
-
const
|
|
802
|
-
for (let R = 0; R <
|
|
803
|
-
const _ =
|
|
801
|
+
const x = P.current.colGroupMain.children;
|
|
802
|
+
for (let R = 0; R < x.length; R++) {
|
|
803
|
+
const _ = x[R].width;
|
|
804
804
|
if (!_) {
|
|
805
805
|
g = 0;
|
|
806
806
|
break;
|
|
@@ -822,7 +822,7 @@ const dr = (t, x, b, z) => {
|
|
|
822
822
|
}, Jt = () => {
|
|
823
823
|
const e = t.gridProps.minRowHeightRef;
|
|
824
824
|
if (e && !e.current && !t.gridProps.rowHeight) {
|
|
825
|
-
const n =
|
|
825
|
+
const n = Jn(T.current);
|
|
826
826
|
n && (e.current = n, Y());
|
|
827
827
|
}
|
|
828
828
|
}, fe = c.useCallback(
|
|
@@ -839,13 +839,13 @@ const dr = (t, x, b, z) => {
|
|
|
839
839
|
field: i,
|
|
840
840
|
...typeof t.gridProps.clipboard != "boolean" ? t.gridProps.clipboard : {},
|
|
841
841
|
...o
|
|
842
|
-
}, d = D(), l =
|
|
842
|
+
}, d = D(), l = Kn({
|
|
843
843
|
event: a,
|
|
844
844
|
data: d,
|
|
845
845
|
selectedState: (s = t.gridProps.select) != null ? s : {},
|
|
846
846
|
previousCopiedItems: tt.current
|
|
847
847
|
});
|
|
848
|
-
e !== ze.paste && (tt.current = l.copiedItems), t.gridProps.onClipboard &&
|
|
848
|
+
e !== ze.paste && (tt.current = l.copiedItems), t.gridProps.onClipboard && S && f(t.gridProps.onClipboard, {
|
|
849
849
|
...a,
|
|
850
850
|
...l
|
|
851
851
|
});
|
|
@@ -864,7 +864,7 @@ const dr = (t, x, b, z) => {
|
|
|
864
864
|
const e = yn(p()), n = e ? e.matches(".k-table-td") ? e : (i = p()) == null ? void 0 : i.body : (a = p()) == null ? void 0 : a.body, o = n.closest(".k-grid-container"), r = n && ((d = M.current) == null ? void 0 : d.contains(n));
|
|
865
865
|
return !!(n && r && o);
|
|
866
866
|
}, Xe = (e, n, o, r, i, a, d) => {
|
|
867
|
-
Ke(), be.current = !0, Ge.current = !0, t.gridProps.onColumnResize &&
|
|
867
|
+
Ke(), be.current = !0, Ge.current = !0, t.gridProps.onColumnResize && S && f(t.gridProps.onColumnResize, {
|
|
868
868
|
columns: de(),
|
|
869
869
|
nativeEvent: r,
|
|
870
870
|
targetColumnId: d,
|
|
@@ -872,7 +872,7 @@ const dr = (t, x, b, z) => {
|
|
|
872
872
|
newWidth: n,
|
|
873
873
|
oldWidth: o,
|
|
874
874
|
end: i,
|
|
875
|
-
target:
|
|
875
|
+
target: E.current
|
|
876
876
|
}), i && De(a);
|
|
877
877
|
}, Yt = () => {
|
|
878
878
|
var e;
|
|
@@ -886,7 +886,7 @@ const dr = (t, x, b, z) => {
|
|
|
886
886
|
}, I = (e) => ({
|
|
887
887
|
nativeEvent: e && e.nativeEvent,
|
|
888
888
|
syntheticEvent: e,
|
|
889
|
-
target:
|
|
889
|
+
target: E.current
|
|
890
890
|
}), Qt = (e) => ({
|
|
891
891
|
...e,
|
|
892
892
|
nativeEvent: void 0,
|
|
@@ -934,7 +934,7 @@ const dr = (t, x, b, z) => {
|
|
|
934
934
|
}, rn = () => {
|
|
935
935
|
var a;
|
|
936
936
|
const { virtualTotal: e, virtualPageSize: n, gridProps: o } = t, r = C.current, i = t.gridProps.rowHeight || ((a = o.minRowHeightRef) == null ? void 0 : a.current) || 0;
|
|
937
|
-
r && (r.fixedScroll = o.fixedScroll || !1, r.PageChange = Bt, r.pageSize = n, r.scrollableVirtual = K, r.container = H.current, r.tableBody = T.current, r.scrollHeightContainer = et.current, r.table = j.current, (!r.rowHeightService || r.total !== e) && i && (r.total = e, r.rowHeightService = new
|
|
937
|
+
r && (r.fixedScroll = o.fixedScroll || !1, r.PageChange = Bt, r.pageSize = n, r.scrollableVirtual = K, r.container = H.current, r.tableBody = T.current, r.scrollHeightContainer = et.current, r.table = j.current, (!r.rowHeightService || r.total !== e) && i && (r.total = e, r.rowHeightService = new kn(e, i)));
|
|
938
938
|
}, Qe = c.useCallback(
|
|
939
939
|
(e) => {
|
|
940
940
|
const n = { rowIndex: Le.current };
|
|
@@ -945,7 +945,7 @@ const dr = (t, x, b, z) => {
|
|
|
945
945
|
[Pe]
|
|
946
946
|
), Y = () => {
|
|
947
947
|
t.gridProps.forceUpdate && t.gridProps.forceUpdate();
|
|
948
|
-
}, on = (e) => e.left !== void 0 ? We !== "rtl" ? { left: e.left, right: e.right } : { left: e.right, right: e.left } : {},
|
|
948
|
+
}, on = (e) => e.left !== void 0 ? We !== "rtl" ? { left: e.left, right: e.right } : { left: e.right, right: e.left } : {}, E = c.useRef(null), C = c.useRef(void 0), P = c.useRef(void 0), U = c.useRef(void 0), V = c.useRef(void 0), Q = c.useRef(void 0), he = c.useRef(void 0), G = c.useRef(null), T = c.useRef(null), an = c.useRef(null), H = c.useRef(null), j = c.useRef(null), cn = c.useRef(null), M = c.useRef(null), et = c.useRef(null), q = c.useRef(null), $ = c.useRef(null), A = c.useRef(null), F = c.useRef(null), L = c.useRef(null), B = c.useRef(null), dn = c.useRef(null), sn = c.useRef(null), Ge = c.useRef(!1), Te = c.useRef(!1), Re = c.useRef(void 0), He = c.useRef(void 0), Me = c.useRef(!1), be = c.useRef(!0), Ae = c.useRef(0), Fe = c.useRef(void 0), Le = c.useRef(void 0), Be = c.useRef([]), tt = c.useRef([]), ve = c.useRef(0), Ce = c.useRef(
|
|
949
949
|
null
|
|
950
950
|
), ln = typeof t.gridProps.groupable == "object" && !!t.gridProps.groupable.stickyHeaders, un = typeof t.gridProps.groupable == "object" && !!t.gridProps.groupable.stickyFooters, gn = !!((it = t.gridProps.group) != null && it.length), {
|
|
951
951
|
stickyHeaderItems: fn,
|
|
@@ -954,7 +954,7 @@ const dr = (t, x, b, z) => {
|
|
|
954
954
|
stickyFooterRef: Ie,
|
|
955
955
|
scrollToStickyGroup: hn,
|
|
956
956
|
update: nt
|
|
957
|
-
} =
|
|
957
|
+
} = qn({
|
|
958
958
|
enabled: ln,
|
|
959
959
|
enabledFooters: un,
|
|
960
960
|
flatData: t.dataRef,
|
|
@@ -969,14 +969,14 @@ const dr = (t, x, b, z) => {
|
|
|
969
969
|
return (e = C.current) == null ? void 0 : e.rowHeightService;
|
|
970
970
|
}
|
|
971
971
|
}
|
|
972
|
-
}), ie = c.useRef(null), Rn = c.useRef(null), bn = c.useRef(null), We = En(M), K = t.isVirtualScroll, vn = c.useMemo(() => c.Children.toArray(t.gridProps.children), [t.gridProps.children]), rt = t.gridProps.groupable === !0 || typeof t.gridProps.groupable == "object" && t.gridProps.groupable.enabled !== !1, v = we(t.gridProps.selectable), ot =
|
|
972
|
+
}), ie = c.useRef(null), Rn = c.useRef(null), bn = c.useRef(null), We = En(M), K = t.isVirtualScroll, vn = c.useMemo(() => c.Children.toArray(t.gridProps.children), [t.gridProps.children]), rt = t.gridProps.groupable === !0 || typeof t.gridProps.groupable == "object" && t.gridProps.groupable.enabled !== !1, v = we(t.gridProps.selectable), ot = Gn(t.gridProps.editable), Cn = ve.current && re && ve.current <= re.medium && t.gridProps.adaptive;
|
|
973
973
|
return c.useMemo(() => {
|
|
974
974
|
ne.onConstructor({
|
|
975
975
|
navigatable: !!t.gridProps.navigatable,
|
|
976
976
|
contextStateRef: V,
|
|
977
977
|
navigationStateRef: Q,
|
|
978
978
|
idPrefix: t.id
|
|
979
|
-
}), C.current = new
|
|
979
|
+
}), C.current = new er();
|
|
980
980
|
}, []), c.useMemo(() => {
|
|
981
981
|
var e;
|
|
982
982
|
(e = C.current) == null || e.reset();
|
|
@@ -990,7 +990,7 @@ const dr = (t, x, b, z) => {
|
|
|
990
990
|
t.gridProps.rowHeight
|
|
991
991
|
]), c.useEffect(() => {
|
|
992
992
|
O.current = {};
|
|
993
|
-
}), c.useEffect(() => (t.gridProps.clipboard && (he.current = new
|
|
993
|
+
}), c.useEffect(() => (t.gridProps.clipboard && (he.current = new Tn(fe), he.current.addEventListeners(p())), () => {
|
|
994
994
|
he.current && he.current.removeEventListeners(p());
|
|
995
995
|
}), [t.gridProps.onClipboard, t.gridProps.clipboard, fe, p]), c.useEffect(() => (Je(), Ke(), at(), ne.onComponentDidMount({
|
|
996
996
|
scope: M.current || void 0,
|
|
@@ -1043,7 +1043,7 @@ const dr = (t, x, b, z) => {
|
|
|
1043
1043
|
n.disconnect();
|
|
1044
1044
|
};
|
|
1045
1045
|
}, [K, ge]), c.useImperativeHandle(
|
|
1046
|
-
|
|
1046
|
+
E,
|
|
1047
1047
|
() => ({
|
|
1048
1048
|
get element() {
|
|
1049
1049
|
return me();
|
|
@@ -1074,21 +1074,21 @@ const dr = (t, x, b, z) => {
|
|
|
1074
1074
|
getTotal: xe,
|
|
1075
1075
|
getLeafDataItems: D
|
|
1076
1076
|
})
|
|
1077
|
-
), c.useImperativeHandle(t.gridRef, () =>
|
|
1078
|
-
P.current = new
|
|
1077
|
+
), c.useImperativeHandle(t.gridRef, () => E.current), c.useMemo(() => {
|
|
1078
|
+
P.current = new Vn(Xe);
|
|
1079
1079
|
}, [t.gridProps.onColumnResize, t.columnsRef]), c.useMemo(() => {
|
|
1080
|
-
U.current = new
|
|
1080
|
+
U.current = new jn(ue, $t, Ze);
|
|
1081
1081
|
}, [
|
|
1082
1082
|
t.gridProps.onColumnReorder,
|
|
1083
1083
|
t.gridProps.onGroupChange,
|
|
1084
1084
|
t.gridProps.group,
|
|
1085
1085
|
t.columnsRef,
|
|
1086
1086
|
t.gridProps.groupable
|
|
1087
|
-
]), P.current.resizable = t.gridProps.resizable || !1, P.current.columns = t.columnsRef, P.current.columnsState = xn(t.columnsState), U.current.reorderable = t.gridProps.reorderable || !1, U.current.groupable = rt, U.current.columns = t.columnsRef, U.current.dir = We, rn(), /* @__PURE__ */ c.createElement(
|
|
1088
|
-
|
|
1087
|
+
]), P.current.resizable = t.gridProps.resizable || !1, P.current.columns = t.columnsRef, P.current.columnsState = xn(t.columnsState), U.current.reorderable = t.gridProps.reorderable || !1, U.current.groupable = rt, U.current.columns = t.columnsRef, U.current.dir = We, rn(), Sn("grid", E, t.gridProps, t.gridProps.webMcp), /* @__PURE__ */ c.createElement(
|
|
1088
|
+
cr.Provider,
|
|
1089
1089
|
{
|
|
1090
1090
|
value: {
|
|
1091
|
-
isClient:
|
|
1091
|
+
isClient: S,
|
|
1092
1092
|
rowReorder: oe,
|
|
1093
1093
|
activeDragRowDataItemRef: ie,
|
|
1094
1094
|
reorderRowDragTargetRef: Rn,
|
|
@@ -1130,7 +1130,7 @@ const dr = (t, x, b, z) => {
|
|
|
1130
1130
|
filterable: t.gridProps.filterable,
|
|
1131
1131
|
filter: t.gridProps.filter,
|
|
1132
1132
|
defaultFilter: t.gridProps.defaultFilter,
|
|
1133
|
-
filterOperators: t.gridProps.filterOperators ||
|
|
1133
|
+
filterOperators: t.gridProps.filterOperators || dr,
|
|
1134
1134
|
getLeafDataItems: D,
|
|
1135
1135
|
filterChange: Nt,
|
|
1136
1136
|
applyHighlightDescriptor: Ut,
|
|
@@ -1180,9 +1180,9 @@ const dr = (t, x, b, z) => {
|
|
|
1180
1180
|
getRowPinPosition: kt
|
|
1181
1181
|
}
|
|
1182
1182
|
},
|
|
1183
|
-
/* @__PURE__ */ c.createElement(
|
|
1183
|
+
/* @__PURE__ */ c.createElement(Hn.Provider, { value: V.current }, t.children),
|
|
1184
1184
|
/* @__PURE__ */ c.createElement(
|
|
1185
|
-
|
|
1185
|
+
tr,
|
|
1186
1186
|
{
|
|
1187
1187
|
show: b.show && (ce == null ? void 0 : ce.length),
|
|
1188
1188
|
dataItem: b.dataItem,
|
|
@@ -1194,7 +1194,7 @@ const dr = (t, x, b, z) => {
|
|
|
1194
1194
|
}
|
|
1195
1195
|
),
|
|
1196
1196
|
t.gridProps.pdf && /* @__PURE__ */ c.createElement(
|
|
1197
|
-
|
|
1197
|
+
ir,
|
|
1198
1198
|
{
|
|
1199
1199
|
gridProps: t.gridProps,
|
|
1200
1200
|
innerGrid: t.innerGrid,
|
|
@@ -1204,7 +1204,7 @@ const dr = (t, x, b, z) => {
|
|
|
1204
1204
|
}
|
|
1205
1205
|
),
|
|
1206
1206
|
t.gridProps.csv && /* @__PURE__ */ c.createElement(
|
|
1207
|
-
|
|
1207
|
+
ar,
|
|
1208
1208
|
{
|
|
1209
1209
|
gridProps: t.gridProps,
|
|
1210
1210
|
csv: typeof t.gridProps.csv == "object" ? t.gridProps.csv : {},
|
|
@@ -1216,5 +1216,5 @@ const dr = (t, x, b, z) => {
|
|
|
1216
1216
|
);
|
|
1217
1217
|
};
|
|
1218
1218
|
export {
|
|
1219
|
-
|
|
1219
|
+
xr as GridClientWrapper
|
|
1220
1220
|
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { McpToolOption } from '@progress/kendo-react-common';
|
|
9
|
+
/**
|
|
10
|
+
* Configuration for the Grid's `webMcp` prop.
|
|
11
|
+
*
|
|
12
|
+
* Enables browser-native AI agent tools via Web MCP (Chrome 146+).
|
|
13
|
+
* Pass `true` for defaults or an object for fine-grained control.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* // Boolean — generic "data" label, tools auto-inferred from Grid props
|
|
18
|
+
* <Grid webMcp={true} sortable />
|
|
19
|
+
*
|
|
20
|
+
* // Config object — semantic naming in any language
|
|
21
|
+
* <Grid webMcp={{ dataName: 'employees' }} sortable />
|
|
22
|
+
* <Grid webMcp={{ dataName: 'empleados' }} sortable />
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export type GridWebMcpProps = boolean | {
|
|
26
|
+
/**
|
|
27
|
+
* Human-readable name for the data exposed by the grid.
|
|
28
|
+
* AI agents are multilingual — any language works.
|
|
29
|
+
*
|
|
30
|
+
* @example 'employees', 'empleados', 'employés'
|
|
31
|
+
*/
|
|
32
|
+
dataName: string;
|
|
33
|
+
/**
|
|
34
|
+
* Tool name prefix. Auto-generated from `dataName` when omitted.
|
|
35
|
+
* Tools are named `{groupName}_{action}`, e.g. `employees_grid_sort`.
|
|
36
|
+
*/
|
|
37
|
+
groupName?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Customize the built-in tools before they are registered.
|
|
40
|
+
* Receives the auto-generated tool list and a helpers object.
|
|
41
|
+
* Return a modified array to remove, rename, re-describe, or add custom tools.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```tsx
|
|
45
|
+
* // Override a description
|
|
46
|
+
* tools: (tools) => tools.map(t =>
|
|
47
|
+
* t.commandType === 'GridSort'
|
|
48
|
+
* ? { ...t, description: 'Reorder employees by column' }
|
|
49
|
+
* : t
|
|
50
|
+
* )
|
|
51
|
+
*
|
|
52
|
+
* // Remove sort tools
|
|
53
|
+
* tools: (tools) => tools.filter(t => t.commandType !== 'GridSort')
|
|
54
|
+
*
|
|
55
|
+
* // Add a custom tool
|
|
56
|
+
* tools: (tools, helpers) => [
|
|
57
|
+
* ...tools,
|
|
58
|
+
* { name: 'validate', description: 'Validate data', commandType: 'Custom', enabled: true }
|
|
59
|
+
* ]
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
tools?: GridWebMcpToolsCallback;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Helpers passed to the `tools` callback.
|
|
66
|
+
*/
|
|
67
|
+
export interface GridWebMcpToolsHelpers {
|
|
68
|
+
/** Generates a prefixed tool name: `{groupName}_{suffix}`. */
|
|
69
|
+
tname: (suffix: string) => string;
|
|
70
|
+
/** The column metadata extracted from GridColumn children. */
|
|
71
|
+
columns: Array<{
|
|
72
|
+
field: string;
|
|
73
|
+
id: string;
|
|
74
|
+
}>;
|
|
75
|
+
/** The current grid data (visible rows). */
|
|
76
|
+
data: any;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Callback that receives the auto-generated tool list and returns a
|
|
80
|
+
* (possibly modified) list to register.
|
|
81
|
+
*/
|
|
82
|
+
export type GridWebMcpToolsCallback = (tools: McpToolOption[], helpers: GridWebMcpToolsHelpers) => McpToolOption[];
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[](https://www.telerik.com/kendo-react-ui/components/free?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-grid&utm_content=banner)
|
|
1
|
+
[](https://www.telerik.com/kendo-react-ui/components/getting-started/free-vs-premium?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-grid&utm_content=banner)
|
|
2
2
|
|
|
3
3
|
# KendoReact Data Grid (Table) Component for React
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
>
|
|
7
7
|
> - This package is а part of [KendoReact](https://www.telerik.com/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-grid)—an enterprise-grade UI library with 120+ free and premium components.
|
|
8
8
|
> - This is a free React Data Grid (Table) component with premium features. To use the premium features of the KendoReact Data Grid, you must install a license key file, whether you are on a paid license or a 30-day free trial. To receive a license key, either [purchase a license](https://www.telerik.com/kendo-react-ui/pricing) or start a [free trial](https://www.telerik.com/download-login-v2-kendo-react-ui). You can use the free features even in production, no sign-up or license required.
|
|
9
|
-
> - If you're looking for more free React components, check out [Get Started with KendoReact Free](https://www.telerik.com/kendo-react-ui/components/
|
|
9
|
+
> - If you're looking for more free React components, check out [Get Started with KendoReact Free](https://www.telerik.com/kendo-react-ui/components/getting-started).
|
|
10
10
|
> - If you have an active license, visit the [KendoReact My License page](https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-grid) to learn how to configure your KendoReact licensing.
|
|
11
11
|
> - Installing and working with this package indicates that you [accept the KendoReact License Agreement](https://www.telerik.com/purchase/license-agreement/progress-kendoreact?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-grid).
|
|
12
12
|
> - The [30-day free trial](https://www.telerik.com/try/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-grid) gives you access to all KendoReact components and their full functionality. Additionally, for the period of your trial, you can use our legendary technical support provided directly by the KendoReact dev team!
|
|
@@ -84,7 +84,7 @@ import { Grid, GridColumn } from '@progress/kendo-react-grid';
|
|
|
84
84
|
|
|
85
85
|
The following table outlines the key resources available with KendoReact and KendoReact Free.
|
|
86
86
|
|
|
87
|
-
| | [KendoReact Free](https://www.telerik.com/kendo-react-ui/components/free)
|
|
87
|
+
| | [KendoReact Free](https://www.telerik.com/kendo-react-ui/components/getting-started/free-vs-premium) | [KendoReact](https://www.telerik.com/kendo-react-ui) |
|
|
88
88
|
| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
89
89
|
| React components | 50+ | 120+ |
|
|
90
90
|
| Four professional themes | <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z" stroke="white" stroke-width="2"/></svg> | <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z" stroke="white" stroke-width="2"/></svg> |
|
|
@@ -107,7 +107,7 @@ For any issues you might encounter while working with the KendoReact Grid, use a
|
|
|
107
107
|
## Resources
|
|
108
108
|
|
|
109
109
|
- [Getting Started with KendoReact](https://www.telerik.com/kendo-react-ui/components/getting-started/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-grid)
|
|
110
|
-
- [Get Started with KendoReact Free](https://www.telerik.com/kendo-react-ui/components/
|
|
110
|
+
- [Get Started with KendoReact Free](https://www.telerik.com/kendo-react-ui/components/getting-started)
|
|
111
111
|
- [Get Started with the KendoReact Data Grid](https://www.telerik.com/kendo-react-ui/components/grid/get-started/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-grid)
|
|
112
112
|
- [API Reference of the KendoReact Data Grid](https://www.telerik.com/kendo-react-ui/components/grid/api/GridProps/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-grid)
|
|
113
113
|
- [KendoReact Roadmap](https://www.telerik.com/support/whats-new/kendo-react-ui/roadmap?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-grid)
|
package/cells/datacell/utils.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../../utils/index.js"),r=require("../../constants/index.js"),i=require("@progress/kendo-react-common"),g=e=>{var c,o;let t=null,a=null;const d=e.unstyled,n=d&&d.uGrid?d.uGrid:i.uGrid;if(e.rowType==="groupFooter")t={className:i.classNames(n.td({}),e.className),role:"gridcell"};else if(e.rowType!=="groupHeader"){if(e.field!==void 0){const l=u.getNestedValue(e.field,e.dataItem);l!=null&&(a=e.intl&&e.format?e.intl.format(e.format,l):l.toString())}const s=i.classNames(n.td({selected:e.isSelected,highlighted:e.isHighlighted,sorted:e.isSorted,alt:e.isAlt}),e.className);t={rowSpan:(o=(c=e._rowSpan)==null?void 0:c.count)!=null?o:void 0,colSpan:e.colSpan,style:e.style,className:s,role:"gridcell","aria-colindex":e.ariaColumnIndex,"aria-selected":e.isSelected,[r.GRID_COL_INDEX_ATTRIBUTE]:e.columnIndex}}return{tdProps:t,content:a}},m=e=>{var t;return(t=e.cells)==null?void 0:t[e.rowType||"data"]};exports.getCellTdProps=g;exports.getCustomCell=m;
|