@progress/kendo-react-grid 9.4.1-develop.3 → 9.4.1-develop.5

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