@progress/kendo-react-grid 10.0.0-develop.2 → 10.0.0-develop.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/GridComponent.mjs CHANGED
@@ -8,7 +8,7 @@
8
8
  import * as l from "react";
9
9
  import { uGrid as St, validatePackage as vt, getter as H, classNames as f, WatermarkOverlay as Rt, canUseDOM as xt } from "@progress/kendo-react-common";
10
10
  import { process as Gt } from "@progress/kendo-data-query";
11
- import { combineFilters as kt, getDetailExpandableOptions as Nt, getGroupExpandableOptions as Ft, getSelectionOptions as Dt, tableKeyboardNavigationTools as te, Pager as Tt, tableKeyboardNavigationBodyAttributes as Pt, tableKeyboardNavigationScopeAttributes as Ae, tableColumnsVirtualization as Ht } from "@progress/kendo-react-data-tools";
11
+ import { combineFilters as kt, getDetailExpandableOptions as Nt, getGroupExpandableOptions as Ft, getSelectionOptions as Dt, tableKeyboardNavigationTools as le, Pager as Tt, tableKeyboardNavigationBodyAttributes as Pt, tableKeyboardNavigationScopeAttributes as Ae, tableColumnsVirtualization as Ht } from "@progress/kendo-react-data-tools";
12
12
  import { GridSelectionCell as Kt } from "./cells/GridSelectionCell.mjs";
13
13
  import { GridHierarchyCell as At } from "./cells/GridHierarchyCell.mjs";
14
14
  import { GridEditCell as Bt } from "./cells/GridEditCell.mjs";
@@ -17,7 +17,7 @@ import { HeaderRow as Lt } from "./header/HeaderRow.mjs";
17
17
  import { FilterRow as Ot } from "./header/FilterRow.mjs";
18
18
  import { GroupPanel as _t } from "./header/GroupPanel.mjs";
19
19
  import { Footer as zt } from "./footer/Footer.mjs";
20
- import { isRowReorderEnabled as Mt, getRowSpanOptions as Be, getColumnWidth as le, isSorted as Ve, flatData as Wt, autoGenerateColumns as jt, mapColumns as $t, clientColumn as Ut, getNestedValue as Le, getColSpan as Oe, resolveCells as Jt, isClientReference as Qt, sanitizeColumns as Xt, readColumns as Yt } from "./utils/index.mjs";
20
+ import { isRowReorderEnabled as Mt, getRowSpanOptions as Be, getColumnWidth as ae, isSorted as Ve, flatData as Wt, autoGenerateColumns as jt, mapColumns as $t, clientColumn as Ut, getNestedValue as Le, getColSpan as Oe, resolveCells as Jt, isClientReference as Qt, sanitizeColumns as Xt, readColumns as Yt } from "./utils/index.mjs";
21
21
  import { GridCell as Zt } from "./cells/GridCell.mjs";
22
22
  import { GridGroupCell as _e } from "./cells/GridGroupCell.mjs";
23
23
  import { GridRow as qt } from "./rows/GridRow.mjs";
@@ -51,7 +51,7 @@ import { GridHeaderRowReorderCell as hl } from "./header/client/GridHeaderRowReo
51
51
  import { GridLoader as Ye } from "./components/GridLoader.mjs";
52
52
  import { gridPremiumFeatures as yl } from "./utils/premium.mjs";
53
53
  import { LocalizationService as Cl, IntlService as wl } from "@progress/kendo-react-intl";
54
- const El = l.forwardRef((e, ae) => {
54
+ const El = l.forwardRef((e, re) => {
55
55
  var ve, Re, xe, Ge, ke, Ne, Fe, De;
56
56
  const R = e.id + "-role-element-id", x = e.navigatable ? R : "", Ze = (t, r, d, o, i, a, c) => {
57
57
  const u = [], h = Wt(
@@ -147,17 +147,17 @@ const El = l.forwardRef((e, ae) => {
147
147
  t.slice(o).forEach((a) => {
148
148
  a.parentIndex >= 0 && (a.parentIndex += o), a.rowSpannable = a.rowSpannable !== void 0 ? Be(a.rowSpannable) : oe;
149
149
  });
150
- }, re = () => C.length === e.total, rt = () => {
151
- const { rowHeight: t, detailRowHeight: r, detail: d, expandField: o } = e, i = re(), a = t !== void 0 && t > 0, c = r !== void 0 && r > 0;
150
+ }, $ = () => C.length === e.total, rt = () => {
151
+ const { rowHeight: t, detailRowHeight: r, detail: d, expandField: o } = e, i = $(), a = t !== void 0 && t > 0, c = r !== void 0 && r > 0;
152
152
  return !a || K && !i || !!(d && o) && (!c || !i) ? ml : j;
153
- }, $ = () => e.isClient ? s : ne, nt = (t, r, d, o, i, a) => {
153
+ }, U = () => e.isClient ? s : ne, nt = (t, r, d, o, i, a) => {
154
154
  let c = Oe(t, r);
155
155
  if (e.columnVirtualization && t.colSpan === 1)
156
156
  return { colSpan: a, colsToSkip: i };
157
157
  let u = d.length - 1 === o, h = d.length - o;
158
158
  return e.columnVirtualization && (u = b.length - 1 === o, h = b.length - o), c > 1 && !u ? i = c - 1 : c = 1, h <= c && !u && (c = h), { colSpan: c, colsToSkip: i };
159
159
  };
160
- let U, g = [], O;
160
+ let J, g = [], O;
161
161
  const s = e.columnsRef || { current: [] }, ne = { current: [] };
162
162
  let G = [[]];
163
163
  const it = e.scrollLeftRef || { current: 0 }, _ = e.localization || new Cl(e.language), ot = e.intl || new wl((ve = e.locale) != null ? ve : "en"), k = e.unstyled, m = k && k.uGrid ? k.uGrid : St, N = Mt(e.rowReorderable), F = e.autoProcessData === !0 ? {
@@ -195,22 +195,22 @@ const El = l.forwardRef((e, ae) => {
195
195
  e.dataItemKey
196
196
  );
197
197
  g = ut;
198
- const J = rt();
199
- J === j && re() && (O = g.slice(
198
+ const Q = rt();
199
+ Q === j && $() && (O = g.slice(
200
200
  e.skip || 0,
201
201
  (e.skip || 0) + ((e.take !== void 0 ? e.take : e.pageSize) || 0)
202
202
  ));
203
203
  const ie = Dt(e.selectable || !!e.selectedField), oe = Be(e.rowSpannable), mt = ie && ie.drag ? "none" : void 0, z = l.useMemo(() => l.Children.toArray(e.children), [e.children]);
204
204
  lt(z, st);
205
- const Q = l.useMemo(() => {
205
+ const X = l.useMemo(() => {
206
206
  const t = yl(e, s.current);
207
207
  return {
208
208
  premium: t.length > 0,
209
209
  features: t
210
210
  };
211
- }, [e, s]), ft = l.useMemo(() => Q.premium ? !vt(ll, { component: "Grid", features: Q.features }) : !1, [Q.premium]), de = z.map((t) => t && t.type && t.type.displayName === "KendoReactGridToolbar" ? l.cloneElement(t, { ...t.props, ariaControls: R }) : null), M = z.filter((t) => t && t.type && t.type.displayName === "KendoReactGridNoRecords"), ce = z.filter(
211
+ }, [e, s]), ft = l.useMemo(() => X.premium ? !vt(ll, { component: "Grid", features: X.features }) : !1, [X.premium]), de = z.map((t) => t && t.type && t.type.displayName === "KendoReactGridToolbar" ? l.cloneElement(t, { ...t.props, ariaControls: R }) : null), M = z.filter((t) => t && t.type && t.type.displayName === "KendoReactGridNoRecords"), ce = z.filter(
212
212
  (t) => t && t.type && t.type.displayName === "KendoReactGridStatusBar"
213
- ), b = s.current.filter((t) => t.children.length === 0), se = K && /* @__PURE__ */ l.createElement(_t, { columns: $().current, group: e.group || [], ariaControls: R }), ue = /* @__PURE__ */ l.createElement(
213
+ ), b = s.current.filter((t) => t.children.length === 0), se = K && /* @__PURE__ */ l.createElement(_t, { columns: U().current, group: e.group || [], ariaControls: R }), ue = /* @__PURE__ */ l.createElement(
214
214
  Vt,
215
215
  {
216
216
  size: E,
@@ -255,7 +255,7 @@ const El = l.forwardRef((e, ae) => {
255
255
  localization: _
256
256
  }
257
257
  ) || void 0,
258
- cols: b.map((t, r) => /* @__PURE__ */ l.createElement("col", { key: r.toString(), width: le(t) }))
258
+ cols: b.map((t, r) => /* @__PURE__ */ l.createElement("col", { key: r.toString(), width: ae(t) }))
259
259
  }
260
260
  ), gt = it.current || 0, bt = parseFloat(((e.style || {}).width || "").toString()), ht = (t, r, d, o, i) => {
261
261
  let a = !1;
@@ -281,7 +281,7 @@ const El = l.forwardRef((e, ae) => {
281
281
  const S = n.field ? (He = (Pe = n.rowSpannable).valueGetter) == null ? void 0 : He.call(Pe, t.dataItem, n.field) : null;
282
282
  w = { value: S, count: 1 }, i[n.field] && ((Ke = i[n.field]) == null ? void 0 : Ke.value) === S && i[n.field] !== null ? (i[n.field].count++, w.count = null) : i[n.field] = w;
283
283
  }
284
- const { colSpan: V, colsToSkip: Z } = nt(
284
+ const { colSpan: V, colsToSkip: q } = nt(
285
285
  n,
286
286
  t.dataItem,
287
287
  I,
@@ -289,16 +289,16 @@ const El = l.forwardRef((e, ae) => {
289
289
  u,
290
290
  h[y]
291
291
  );
292
- u = Z;
292
+ u = q;
293
293
  const L = n.id ? n.id : y, wt = f(m.contentSticky({ locked: n.locked }), n.className), Et = n.left !== void 0 ? { left: n.left, right: n.right } : {};
294
- let q = !1;
294
+ let p = !1;
295
295
  if (n.editable && (e.editable || e.editField)) {
296
- const S = e.editField ? Le(e.editField, t.dataItem) : e.edit && e.dataItemKey ? e.edit[H(e.dataItemKey)(t.dataItem)] : void 0, ee = typeof S == "boolean" ? S : Array.isArray(S) ? S.indexOf(n.field) > -1 : n.field !== void 0 && S === n.field;
297
- ee && n.columnType === "data" && (ee === !0 || ee === n.field) && (a = !0, q = !0);
296
+ const S = e.editField ? Le(e.editField, t.dataItem) : e.edit && e.dataItemKey ? e.edit[H(e.dataItemKey)(t.dataItem)] : void 0, te = typeof S == "boolean" ? S : Array.isArray(S) ? S.indexOf(n.field) > -1 : n.field !== void 0 && S === n.field;
297
+ te && n.columnType === "data" && (te === !0 || te === n.field) && (a = !0, p = !0);
298
298
  }
299
- const p = n.cell || q && Bt || Zt, It = e.expandField && e.detail && n.field === e.expandField || n._type === "expand", P = {
299
+ const ee = n.cell || p && Bt || Zt, It = e.expandField && e.detail && n.field === e.expandField || n._type === "expand", P = {
300
300
  locked: e.lockGroups,
301
- id: te.generateNavigatableId(
301
+ id: le.generateNavigatableId(
302
302
  `${r}-${String(y)}`,
303
303
  x,
304
304
  It || t.rowType === "groupHeader" || t.rowType === "groupFooter" || n.field === "value" ? "nodata" : "cell"
@@ -325,7 +325,7 @@ const El = l.forwardRef((e, ae) => {
325
325
  ariaColumnIndex: n.ariaColumnIndex,
326
326
  isSelected: (n == null ? void 0 : n._type) === "edit" ? c : Array.isArray(c) && c.indexOf(y) > -1,
327
327
  isSorted: !!Ve(n.field, e.sort),
328
- isInEdit: q,
328
+ isInEdit: p,
329
329
  isAlt: o,
330
330
  unstyled: k,
331
331
  group: t.group,
@@ -337,22 +337,22 @@ const El = l.forwardRef((e, ae) => {
337
337
  fl,
338
338
  {
339
339
  key: L,
340
- isClient: Qt(p),
340
+ isClient: Qt(ee),
341
341
  dataItem: P.dataItem,
342
342
  rowDataIndex: P.rowDataIndex,
343
343
  columnIndex: P.columnIndex,
344
344
  columnPosition: P.columnPosition
345
345
  },
346
- /* @__PURE__ */ l.createElement(p, { ...P })
347
- ) : /* @__PURE__ */ l.createElement(p, { key: L, ...P });
346
+ /* @__PURE__ */ l.createElement(ee, { ...P })
347
+ ) : /* @__PURE__ */ l.createElement(ee, { key: L, ...P });
348
348
  }),
349
349
  isInEdit: a,
350
350
  isSelected: typeof c == "boolean" && c
351
351
  };
352
352
  };
353
353
  let me = 0;
354
- if (D && U)
355
- for (let t = 0; t < U.topCacheCount + U.attendedSkip - (e.skip || 0); t++) {
354
+ if (D && J)
355
+ for (let t = 0; t < J.topCacheCount + J.attendedSkip - (e.skip || 0); t++) {
356
356
  const r = g.shift();
357
357
  if (r)
358
358
  g.push(r), me++, r.rowType === "groupHeader" && t--;
@@ -361,7 +361,7 @@ const El = l.forwardRef((e, ae) => {
361
361
  }
362
362
  const fe = (t) => t >= g.length - me;
363
363
  let ge = e.skip || 0;
364
- const X = [], be = !g.length, he = G.length + (e.filterable ? 1 : 0) + 1;
364
+ const Y = [], be = !g.length, he = G.length + (e.filterable ? 1 : 0) + 1;
365
365
  let B = 0;
366
366
  if (g.length) {
367
367
  let t = -1, r = 0;
@@ -369,7 +369,7 @@ const El = l.forwardRef((e, ae) => {
369
369
  (O || g).forEach((o, i) => {
370
370
  o.rowType === "data" && (ge++, t++);
371
371
  const a = ge % 2 === 0, c = e.dataItemKey && H(e.dataItemKey)(o.dataItem), u = i + (e.skip || 0), h = c || "ai" + u, T = h + "_1", I = ht(o, h, t, a, d);
372
- if (B = u + he + r, X.push(
372
+ if (B = u + he + r, Y.push(
373
373
  /* @__PURE__ */ l.createElement(
374
374
  qt,
375
375
  {
@@ -395,7 +395,7 @@ const El = l.forwardRef((e, ae) => {
395
395
  )
396
396
  ), e.detail && o.rowType === "data" && o.expanded) {
397
397
  const n = b.length - (e.expandField || A.enabled ? 1 : 0) - (e.group ? e.group.length : 0) || 1;
398
- r++, B = u + he + r, X.push(
398
+ r++, B = u + he + r, Y.push(
399
399
  /* @__PURE__ */ l.createElement(
400
400
  "tr",
401
401
  {
@@ -410,7 +410,7 @@ const El = l.forwardRef((e, ae) => {
410
410
  },
411
411
  e.group && e.group.map((y, w) => {
412
412
  var L;
413
- const V = (L = I == null ? void 0 : I.row[w]) == null ? void 0 : L.props.style, Z = V ? { left: V.left, right: V.right } : {};
413
+ const V = (L = I == null ? void 0 : I.row[w]) == null ? void 0 : L.props.style, q = V ? { left: V.left, right: V.right } : {};
414
414
  return /* @__PURE__ */ l.createElement(
415
415
  _e,
416
416
  {
@@ -419,7 +419,7 @@ const El = l.forwardRef((e, ae) => {
419
419
  field: y.field,
420
420
  dataItem: o.dataItem,
421
421
  key: w,
422
- columnPosition: Z,
422
+ columnPosition: q,
423
423
  style: {},
424
424
  ariaColumnIndex: 1 + w,
425
425
  isSelected: !1,
@@ -433,7 +433,7 @@ const El = l.forwardRef((e, ae) => {
433
433
  rl,
434
434
  {
435
435
  unstyled: k,
436
- id: te.generateNavigatableId(`${T}-dhcell`, x)
436
+ id: le.generateNavigatableId(`${T}-dhcell`, x)
437
437
  }
438
438
  ),
439
439
  /* @__PURE__ */ l.createElement(
@@ -444,7 +444,7 @@ const El = l.forwardRef((e, ae) => {
444
444
  colSpan: n,
445
445
  ariaColIndex: 2 + (e.group ? e.group.length : 0),
446
446
  detail: e.detail,
447
- id: te.generateNavigatableId(`${T}-dcell`, x)
447
+ id: le.generateNavigatableId(`${T}-dcell`, x)
448
448
  }
449
449
  )
450
450
  )
@@ -458,7 +458,7 @@ const El = l.forwardRef((e, ae) => {
458
458
  skip: e.skip || 0,
459
459
  take: (e.take !== void 0 ? e.take : e.pageSize) || 10,
460
460
  ...tl(e.pageable || {})
461
- }, Ce = /* @__PURE__ */ l.createElement(ol, null, e.pager ? /* @__PURE__ */ l.createElement(e.pager, { ...ye }) : /* @__PURE__ */ l.createElement(Tt, { className: f(m.pager({})), ...ye })), yt = (t, r) => /* @__PURE__ */ l.createElement("col", { key: r.toString(), width: le(t) }), Ct = (De = e.cells) != null && De.footerCell || s.current.some((t) => {
461
+ }, Ce = /* @__PURE__ */ l.createElement(ol, null, e.pager ? /* @__PURE__ */ l.createElement(e.pager, { ...ye }) : /* @__PURE__ */ l.createElement(Tt, { className: f(m.pager({})), ...ye })), yt = (t, r) => /* @__PURE__ */ l.createElement("col", { key: r.toString(), width: ae(t) }), Ct = (De = e.cells) != null && De.footerCell || s.current.some((t) => {
462
462
  var r;
463
463
  return !!(t.footerCell || (r = t.cells) != null && r.footerCell);
464
464
  }) ? /* @__PURE__ */ l.createElement(
@@ -482,7 +482,7 @@ const El = l.forwardRef((e, ae) => {
482
482
  {
483
483
  key: r.toString(),
484
484
  className: Ve(t.field, e.sort) ? f(m.sorted({})) : void 0,
485
- width: le(t)
485
+ width: ae(t)
486
486
  }
487
487
  ))), Ee = e.reorderable || K, { detail: Il, cells: Sl, rows: vl, ...Ie } = e, Se = /* @__PURE__ */ l.createElement(
488
488
  "tbody",
@@ -491,10 +491,10 @@ const El = l.forwardRef((e, ae) => {
491
491
  className: f(m.tbody({})),
492
492
  ...Pt
493
493
  },
494
- X
494
+ Y
495
495
  );
496
- let Y = Se;
497
- if (N && (Y = /* @__PURE__ */ l.createElement(
496
+ let Z = Se;
497
+ if (N && (Z = /* @__PURE__ */ l.createElement(
498
498
  gl,
499
499
  {
500
500
  unstyled: m,
@@ -506,15 +506,16 @@ const El = l.forwardRef((e, ae) => {
506
506
  return /* @__PURE__ */ l.createElement(
507
507
  je,
508
508
  {
509
- gridRef: ae,
509
+ gridRef: re,
510
510
  gridProps: Ie,
511
- columnsRef: $(),
511
+ columnsRef: U(),
512
512
  columnsMapRef: G,
513
513
  dataRef: g,
514
514
  slicedData: O,
515
- isFixedVirtualScroll: J === j,
515
+ isFixedVirtualScroll: Q === j,
516
516
  id: R,
517
517
  total: v,
518
+ isAllData: $(),
518
519
  detailExpandable: !!e.detail
519
520
  },
520
521
  /* @__PURE__ */ l.createElement(Qe, null, /* @__PURE__ */ l.createElement(
@@ -536,7 +537,7 @@ const El = l.forwardRef((e, ae) => {
536
537
  },
537
538
  we,
538
539
  ue,
539
- /* @__PURE__ */ l.createElement(Je, { rowReorderable: N }, Y)
540
+ /* @__PURE__ */ l.createElement(Je, { rowReorderable: N }, Z)
540
541
  ),
541
542
  be && /* @__PURE__ */ l.createElement(We, null, M.length ? M : /* @__PURE__ */ l.createElement(ze, null)),
542
543
  Ee && /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement($e, null), /* @__PURE__ */ l.createElement(Ue, null))
@@ -549,13 +550,13 @@ const El = l.forwardRef((e, ae) => {
549
550
  return D && (W.height || (W = Object.assign({}, W, { height: "450px" }))), /* @__PURE__ */ l.createElement(
550
551
  je,
551
552
  {
552
- gridRef: ae,
553
+ gridRef: re,
553
554
  gridProps: Ie,
554
- columnsRef: $(),
555
+ columnsRef: U(),
555
556
  columnsMapRef: G,
556
557
  dataRef: g,
557
558
  slicedData: O,
558
- isFixedVirtualScroll: J === j,
559
+ isFixedVirtualScroll: Q === j,
559
560
  id: R,
560
561
  total: v,
561
562
  detailExpandable: !!e.detail
@@ -600,7 +601,7 @@ const El = l.forwardRef((e, ae) => {
600
601
  tableStyle: { userSelect: mt }
601
602
  },
602
603
  we,
603
- /* @__PURE__ */ l.createElement(Je, { rowReorderable: N }, Y)
604
+ /* @__PURE__ */ l.createElement(Je, { rowReorderable: N }, Z)
604
605
  ), be && /* @__PURE__ */ l.createElement(We, null, M.length ? M : /* @__PURE__ */ l.createElement(ze, null))), D && /* @__PURE__ */ l.createElement(
605
606
  "div",
606
607
  {