@toolbox-web/grid 1.3.0 → 1.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 (82) hide show
  1. package/all.d.ts +1 -0
  2. package/all.d.ts.map +1 -1
  3. package/all.js +997 -710
  4. package/all.js.map +1 -1
  5. package/index.js +642 -599
  6. package/index.js.map +1 -1
  7. package/lib/core/grid.d.ts.map +1 -1
  8. package/lib/core/internal/header.d.ts +7 -0
  9. package/lib/core/internal/header.d.ts.map +1 -1
  10. package/lib/core/types.d.ts +151 -0
  11. package/lib/core/types.d.ts.map +1 -1
  12. package/lib/plugins/clipboard/index.js +19 -16
  13. package/lib/plugins/clipboard/index.js.map +1 -1
  14. package/lib/plugins/column-virtualization/index.js +42 -39
  15. package/lib/plugins/column-virtualization/index.js.map +1 -1
  16. package/lib/plugins/context-menu/index.js +25 -22
  17. package/lib/plugins/context-menu/index.js.map +1 -1
  18. package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
  19. package/lib/plugins/editing/index.js +53 -48
  20. package/lib/plugins/editing/index.js.map +1 -1
  21. package/lib/plugins/export/index.js +23 -20
  22. package/lib/plugins/export/index.js.map +1 -1
  23. package/lib/plugins/filtering/FilteringPlugin.d.ts +11 -1
  24. package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -1
  25. package/lib/plugins/filtering/index.js +186 -150
  26. package/lib/plugins/filtering/index.js.map +1 -1
  27. package/lib/plugins/grouping-columns/index.js +21 -18
  28. package/lib/plugins/grouping-columns/index.js.map +1 -1
  29. package/lib/plugins/grouping-rows/index.js +67 -64
  30. package/lib/plugins/grouping-rows/index.js.map +1 -1
  31. package/lib/plugins/master-detail/index.js +52 -49
  32. package/lib/plugins/master-detail/index.js.map +1 -1
  33. package/lib/plugins/multi-sort/index.js +18 -15
  34. package/lib/plugins/multi-sort/index.js.map +1 -1
  35. package/lib/plugins/pinned-columns/index.js +25 -22
  36. package/lib/plugins/pinned-columns/index.js.map +1 -1
  37. package/lib/plugins/pinned-rows/index.js +26 -23
  38. package/lib/plugins/pinned-rows/index.js.map +1 -1
  39. package/lib/plugins/pivot/index.js +50 -47
  40. package/lib/plugins/pivot/index.js.map +1 -1
  41. package/lib/plugins/print/PrintPlugin.d.ts +98 -0
  42. package/lib/plugins/print/PrintPlugin.d.ts.map +1 -0
  43. package/lib/plugins/print/index.d.ts +10 -0
  44. package/lib/plugins/print/index.d.ts.map +1 -0
  45. package/lib/plugins/print/index.js +626 -0
  46. package/lib/plugins/print/index.js.map +1 -0
  47. package/lib/plugins/print/print-isolated.d.ts +26 -0
  48. package/lib/plugins/print/print-isolated.d.ts.map +1 -0
  49. package/lib/plugins/print/types.d.ts +147 -0
  50. package/lib/plugins/print/types.d.ts.map +1 -0
  51. package/lib/plugins/reorder/index.js +25 -22
  52. package/lib/plugins/reorder/index.js.map +1 -1
  53. package/lib/plugins/responsive/index.js +20 -17
  54. package/lib/plugins/responsive/index.js.map +1 -1
  55. package/lib/plugins/row-reorder/index.js +39 -36
  56. package/lib/plugins/row-reorder/index.js.map +1 -1
  57. package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
  58. package/lib/plugins/selection/index.js +115 -101
  59. package/lib/plugins/selection/index.js.map +1 -1
  60. package/lib/plugins/server-side/index.js +35 -32
  61. package/lib/plugins/server-side/index.js.map +1 -1
  62. package/lib/plugins/tree/index.js +26 -23
  63. package/lib/plugins/tree/index.js.map +1 -1
  64. package/lib/plugins/undo-redo/index.js +23 -20
  65. package/lib/plugins/undo-redo/index.js.map +1 -1
  66. package/lib/plugins/visibility/index.js +22 -19
  67. package/lib/plugins/visibility/index.js.map +1 -1
  68. package/package.json +1 -1
  69. package/public.d.ts +1 -1
  70. package/public.d.ts.map +1 -1
  71. package/umd/grid.all.umd.js +98 -24
  72. package/umd/grid.all.umd.js.map +1 -1
  73. package/umd/grid.umd.js +11 -11
  74. package/umd/grid.umd.js.map +1 -1
  75. package/umd/plugins/editing.umd.js +1 -1
  76. package/umd/plugins/editing.umd.js.map +1 -1
  77. package/umd/plugins/filtering.umd.js +1 -1
  78. package/umd/plugins/filtering.umd.js.map +1 -1
  79. package/umd/plugins/print.umd.js +76 -0
  80. package/umd/plugins/print.umd.js.map +1 -0
  81. package/umd/plugins/selection.umd.js +2 -2
  82. package/umd/plugins/selection.umd.js.map +1 -1
@@ -1,4 +1,4 @@
1
- const a = {
1
+ const c = '<svg viewBox="0 0 16 16" width="12" height="12"><path fill="currentColor" d="M6 10.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"/></svg>', d = {
2
2
  expand: "▶",
3
3
  collapse: "▼",
4
4
  sortAsc: "▲",
@@ -6,9 +6,12 @@ const a = {
6
6
  sortNone: "⇅",
7
7
  submenuArrow: "▶",
8
8
  dragHandle: "⋮⋮",
9
- toolPanel: "☰"
9
+ toolPanel: "☰",
10
+ filter: c,
11
+ filterActive: c,
12
+ print: "🖨️"
10
13
  };
11
- class d {
14
+ class u {
12
15
  /**
13
16
  * Plugin dependencies - declare other plugins this one requires.
14
17
  *
@@ -232,7 +235,7 @@ class d {
232
235
  */
233
236
  get gridIcons() {
234
237
  const e = this.grid?.gridConfig?.icons ?? {};
235
- return { ...a, ...e };
238
+ return { ...d, ...e };
236
239
  }
237
240
  // #region Animation Helpers
238
241
  /**
@@ -311,35 +314,35 @@ class d {
311
314
  function l(s, e) {
312
315
  return Math.floor(s / e);
313
316
  }
314
- function u(s, e) {
317
+ function h(s, e) {
315
318
  return {
316
319
  start: s * e,
317
320
  end: (s + 1) * e
318
321
  };
319
322
  }
320
- function h(s, e, t) {
321
- const o = l(s, t), i = l(e - 1, t), r = [];
322
- for (let n = o; n <= i; n++)
323
- r.push(n);
324
- return r;
323
+ function g(s, e, t) {
324
+ const o = l(s, t), r = l(e - 1, t), i = [];
325
+ for (let n = o; n <= r; n++)
326
+ i.push(n);
327
+ return i;
325
328
  }
326
- async function c(s, e, t, o) {
327
- const i = u(e, t);
329
+ async function a(s, e, t, o) {
330
+ const r = h(e, t);
328
331
  return s.getRows({
329
- startRow: i.start,
330
- endRow: i.end,
332
+ startRow: r.start,
333
+ endRow: r.end,
331
334
  sortModel: o.sortModel,
332
335
  filterModel: o.filterModel
333
336
  });
334
337
  }
335
- function g(s, e, t) {
336
- const o = l(s, e), i = t.get(o);
337
- if (!i) return;
338
- const r = s % e;
339
- return i[r];
338
+ function f(s, e, t) {
339
+ const o = l(s, e), r = t.get(o);
340
+ if (!r) return;
341
+ const i = s % e;
342
+ return r[i];
340
343
  }
341
- const f = 100;
342
- class R extends d {
344
+ const R = 100;
345
+ class k extends u {
343
346
  /** @internal */
344
347
  name = "serverSide";
345
348
  /** @internal */
@@ -370,15 +373,15 @@ class R extends d {
370
373
  */
371
374
  loadRequiredBlocks() {
372
375
  if (!this.dataSource) return;
373
- const e = this.grid, t = this.config.cacheBlockSize ?? 100, o = { startRow: e._virtualization.start, endRow: e._virtualization.end }, i = h(o.startRow, o.endRow, t);
374
- for (const r of i)
375
- if (!(this.loadedBlocks.has(r) || this.loadingBlocks.has(r))) {
376
+ const e = this.grid, t = this.config.cacheBlockSize ?? 100, o = { startRow: e._virtualization.start, endRow: e._virtualization.end }, r = g(o.startRow, o.endRow, t);
377
+ for (const i of r)
378
+ if (!(this.loadedBlocks.has(i) || this.loadingBlocks.has(i))) {
376
379
  if (this.loadingBlocks.size >= (this.config.maxConcurrentRequests ?? 2))
377
380
  break;
378
- this.loadingBlocks.add(r), c(this.dataSource, r, t, {}).then((n) => {
379
- this.loadedBlocks.set(r, n.rows), this.totalRowCount = n.totalRowCount, this.loadingBlocks.delete(r), this.requestRender(), this.loadRequiredBlocks();
381
+ this.loadingBlocks.add(i), a(this.dataSource, i, t, {}).then((n) => {
382
+ this.loadedBlocks.set(i, n.rows), this.totalRowCount = n.totalRowCount, this.loadingBlocks.delete(i), this.requestRender(), this.loadRequiredBlocks();
380
383
  }).catch(() => {
381
- this.loadingBlocks.delete(r);
384
+ this.loadingBlocks.delete(i);
382
385
  });
383
386
  }
384
387
  }
@@ -389,8 +392,8 @@ class R extends d {
389
392
  if (!this.dataSource) return [...e];
390
393
  const t = [];
391
394
  for (let o = 0; o < this.totalRowCount; o++) {
392
- const i = g(o, this.config.cacheBlockSize ?? 100, this.loadedBlocks);
393
- t.push(i ?? { __loading: !0, __index: o });
395
+ const r = f(o, this.config.cacheBlockSize ?? 100, this.loadedBlocks);
396
+ t.push(r ?? { __loading: !0, __index: o });
394
397
  }
395
398
  return t;
396
399
  }
@@ -398,7 +401,7 @@ class R extends d {
398
401
  onScroll(e) {
399
402
  this.dataSource && (this.loadRequiredBlocks(), this.scrollDebounceTimer && clearTimeout(this.scrollDebounceTimer), this.scrollDebounceTimer = setTimeout(() => {
400
403
  this.loadRequiredBlocks();
401
- }, f));
404
+ }, R));
402
405
  }
403
406
  // #endregion
404
407
  // #region Public API
@@ -409,7 +412,7 @@ class R extends d {
409
412
  setDataSource(e) {
410
413
  this.dataSource = e, this.loadedBlocks.clear(), this.loadingBlocks.clear();
411
414
  const t = this.config.cacheBlockSize ?? 100;
412
- c(e, 0, t, {}).then((o) => {
415
+ a(e, 0, t, {}).then((o) => {
413
416
  this.loadedBlocks.set(0, o.rows), this.totalRowCount = o.totalRowCount, this.requestRender();
414
417
  });
415
418
  }
@@ -448,6 +451,6 @@ class R extends d {
448
451
  // #endregion
449
452
  }
450
453
  export {
451
- R as ServerSidePlugin
454
+ k as ServerSidePlugin
452
455
  };
453
456
  //# sourceMappingURL=index.js.map