@progress/kendo-react-grid 9.4.0-develop.9 → 9.4.0

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