@toolbox-web/grid 1.2.0 → 1.3.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.
Files changed (79) hide show
  1. package/README.md +80 -22
  2. package/all.js +619 -571
  3. package/all.js.map +1 -1
  4. package/index.js +362 -302
  5. package/index.js.map +1 -1
  6. package/lib/core/grid.d.ts +64 -1
  7. package/lib/core/grid.d.ts.map +1 -1
  8. package/lib/core/internal/row-animation.d.ts +37 -0
  9. package/lib/core/internal/row-animation.d.ts.map +1 -0
  10. package/lib/core/types.d.ts +17 -0
  11. package/lib/core/types.d.ts.map +1 -1
  12. package/lib/plugins/clipboard/index.js +82 -76
  13. package/lib/plugins/clipboard/index.js.map +1 -1
  14. package/lib/plugins/clipboard/types.d.ts +1 -0
  15. package/lib/plugins/clipboard/types.d.ts.map +1 -1
  16. package/lib/plugins/column-virtualization/index.js +43 -41
  17. package/lib/plugins/column-virtualization/index.js.map +1 -1
  18. package/lib/plugins/context-menu/index.js +24 -22
  19. package/lib/plugins/context-menu/index.js.map +1 -1
  20. package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
  21. package/lib/plugins/editing/index.js +83 -52
  22. package/lib/plugins/editing/index.js.map +1 -1
  23. package/lib/plugins/export/index.js +22 -20
  24. package/lib/plugins/export/index.js.map +1 -1
  25. package/lib/plugins/filtering/FilteringPlugin.d.ts +11 -1
  26. package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -1
  27. package/lib/plugins/filtering/index.js +160 -125
  28. package/lib/plugins/filtering/index.js.map +1 -1
  29. package/lib/plugins/grouping-columns/index.js +20 -18
  30. package/lib/plugins/grouping-columns/index.js.map +1 -1
  31. package/lib/plugins/grouping-rows/index.js +66 -64
  32. package/lib/plugins/grouping-rows/index.js.map +1 -1
  33. package/lib/plugins/master-detail/index.js +51 -49
  34. package/lib/plugins/master-detail/index.js.map +1 -1
  35. package/lib/plugins/multi-sort/index.js +17 -15
  36. package/lib/plugins/multi-sort/index.js.map +1 -1
  37. package/lib/plugins/pinned-columns/index.js +24 -22
  38. package/lib/plugins/pinned-columns/index.js.map +1 -1
  39. package/lib/plugins/pinned-rows/index.js +25 -23
  40. package/lib/plugins/pinned-rows/index.js.map +1 -1
  41. package/lib/plugins/pivot/index.js +49 -47
  42. package/lib/plugins/pivot/index.js.map +1 -1
  43. package/lib/plugins/reorder/index.js +24 -22
  44. package/lib/plugins/reorder/index.js.map +1 -1
  45. package/lib/plugins/responsive/index.js +19 -17
  46. package/lib/plugins/responsive/index.js.map +1 -1
  47. package/lib/plugins/row-reorder/index.js +38 -36
  48. package/lib/plugins/row-reorder/index.js.map +1 -1
  49. package/lib/plugins/selection/SelectionPlugin.d.ts +13 -0
  50. package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
  51. package/lib/plugins/selection/index.d.ts +1 -1
  52. package/lib/plugins/selection/index.d.ts.map +1 -1
  53. package/lib/plugins/selection/index.js +118 -85
  54. package/lib/plugins/selection/index.js.map +1 -1
  55. package/lib/plugins/selection/types.d.ts +50 -6
  56. package/lib/plugins/selection/types.d.ts.map +1 -1
  57. package/lib/plugins/server-side/index.js +34 -32
  58. package/lib/plugins/server-side/index.js.map +1 -1
  59. package/lib/plugins/tree/index.js +25 -23
  60. package/lib/plugins/tree/index.js.map +1 -1
  61. package/lib/plugins/undo-redo/index.js +22 -20
  62. package/lib/plugins/undo-redo/index.js.map +1 -1
  63. package/lib/plugins/visibility/index.js +21 -19
  64. package/lib/plugins/visibility/index.js.map +1 -1
  65. package/package.json +21 -4
  66. package/public.d.ts +1 -1
  67. package/public.d.ts.map +1 -1
  68. package/umd/grid.all.umd.js +19 -19
  69. package/umd/grid.all.umd.js.map +1 -1
  70. package/umd/grid.umd.js +9 -9
  71. package/umd/grid.umd.js.map +1 -1
  72. package/umd/plugins/clipboard.umd.js +5 -5
  73. package/umd/plugins/clipboard.umd.js.map +1 -1
  74. package/umd/plugins/editing.umd.js +1 -1
  75. package/umd/plugins/editing.umd.js.map +1 -1
  76. package/umd/plugins/filtering.umd.js +1 -1
  77. package/umd/plugins/filtering.umd.js.map +1 -1
  78. package/umd/plugins/selection.umd.js +2 -2
  79. package/umd/plugins/selection.umd.js.map +1 -1
@@ -102,6 +102,7 @@ export interface PasteDetail {
102
102
  * Behavior:
103
103
  * - Single cell selection: paste expands freely, adds new rows if needed
104
104
  * - Range/row selection: paste is clipped to fit within selection bounds
105
+ * - Non-editable columns: values are skipped (column alignment preserved)
105
106
  *
106
107
  * @param detail - The parsed paste data from clipboard
107
108
  * @param grid - The grid element to update
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/clipboard/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,KAAK,OAAO,GAAG,IAAI,CAAC;AAEtF,qDAAqD;AACrD,MAAM,WAAW,eAAe;IAC9B,6DAA6D;IAC7D,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,sDAAsD;IACtD,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,KAAK,MAAM,CAAC;IACtE;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;CACpC;AAED,qDAAqD;AACrD,MAAM,WAAW,cAAc;IAC7B,qDAAqD;IACrD,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,6D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AE,CAAC;CAClB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,CAwDhF"}
@@ -1,4 +1,4 @@
1
- const C = {
1
+ const d = '<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>', b = {
2
2
  expand: "▶",
3
3
  collapse: "▼",
4
4
  sortAsc: "▲",
@@ -6,9 +6,11 @@ const C = {
6
6
  sortNone: "⇅",
7
7
  submenuArrow: "▶",
8
8
  dragHandle: "⋮⋮",
9
- toolPanel: "☰"
9
+ toolPanel: "☰",
10
+ filter: d,
11
+ filterActive: d
10
12
  };
11
- class b {
13
+ class p {
12
14
  /**
13
15
  * Plugin dependencies - declare other plugins this one requires.
14
16
  *
@@ -232,7 +234,7 @@ class b {
232
234
  */
233
235
  get gridIcons() {
234
236
  const t = this.grid?.gridConfig?.icons ?? {};
235
- return { ...C, ...t };
237
+ return { ...b, ...t };
236
238
  }
237
239
  // #region Animation Helpers
238
240
  /**
@@ -308,61 +310,61 @@ class b {
308
310
  }
309
311
  // #endregion
310
312
  }
311
- const h = 100;
312
- function a(s) {
313
- if (s == null)
314
- return h;
315
- if (typeof s == "number")
316
- return s;
317
- const t = parseFloat(s);
318
- return isNaN(t) ? h : t;
313
+ const c = 100;
314
+ function a(r) {
315
+ if (r == null)
316
+ return c;
317
+ if (typeof r == "number")
318
+ return r;
319
+ const t = parseFloat(r);
320
+ return isNaN(t) ? c : t;
319
321
  }
320
- function c(s) {
321
- return s.map((t) => a(t.width));
322
+ function f(r) {
323
+ return r.map((t) => a(t.width));
322
324
  }
323
- function f(s) {
325
+ function g(r) {
324
326
  const t = [];
325
327
  let e = 0;
326
- for (const i of s)
328
+ for (const i of r)
327
329
  t.push(e), e += a(i.width);
328
330
  return t;
329
331
  }
330
- function g(s) {
331
- return s.reduce((t, e) => t + a(e.width), 0);
332
+ function m(r) {
333
+ return r.reduce((t, e) => t + a(e.width), 0);
332
334
  }
333
- function p(s, t, e, i, n) {
334
- const r = e.length;
335
- if (r === 0)
335
+ function w(r, t, e, i, n) {
336
+ const s = e.length;
337
+ if (s === 0)
336
338
  return { startCol: 0, endCol: 0, visibleColumns: [] };
337
- let o = w(s, e, i);
339
+ let o = v(r, e, i);
338
340
  o = Math.max(0, o - n);
339
- const m = s + t;
341
+ const C = r + t;
340
342
  let u = o;
341
- for (let l = o; l < r; l++) {
342
- if (e[l] >= m) {
343
+ for (let l = o; l < s; l++) {
344
+ if (e[l] >= C) {
343
345
  u = l - 1;
344
346
  break;
345
347
  }
346
348
  u = l;
347
349
  }
348
- u = Math.min(r - 1, u + n);
349
- const d = [];
350
+ u = Math.min(s - 1, u + n);
351
+ const h = [];
350
352
  for (let l = o; l <= u; l++)
351
- d.push(l);
352
- return { startCol: o, endCol: u, visibleColumns: d };
353
+ h.push(l);
354
+ return { startCol: o, endCol: u, visibleColumns: h };
353
355
  }
354
- function w(s, t, e) {
356
+ function v(r, t, e) {
355
357
  let i = 0, n = t.length - 1;
356
358
  for (; i < n; ) {
357
- const r = Math.floor((i + n) / 2);
358
- t[r] + e[r] <= s ? i = r + 1 : n = r;
359
+ const s = Math.floor((i + n) / 2);
360
+ t[s] + e[s] <= r ? i = s + 1 : n = s;
359
361
  }
360
362
  return i;
361
363
  }
362
- function R(s, t, e) {
363
- return e ? s > t : !1;
364
+ function R(r, t, e) {
365
+ return e ? r > t : !1;
364
366
  }
365
- class E extends b {
367
+ class E extends p {
366
368
  /** @internal */
367
369
  name = "columnVirtualization";
368
370
  /** @internal */
@@ -387,7 +389,7 @@ class E extends b {
387
389
  attach(t) {
388
390
  super.attach(t);
389
391
  const e = this.columns;
390
- this.columnWidths = c(e), this.columnOffsets = f(e), this.totalWidth = g(e), this.endCol = e.length - 1;
392
+ this.columnWidths = f(e), this.columnOffsets = g(e), this.totalWidth = m(e), this.endCol = e.length - 1;
391
393
  }
392
394
  /** @internal */
393
395
  detach() {
@@ -398,16 +400,16 @@ class E extends b {
398
400
  /** @internal */
399
401
  processColumns(t) {
400
402
  const e = R(t.length, this.config.threshold ?? 30, this.config.autoEnable ?? !0);
401
- if (this.isVirtualized = e ?? !1, this.columnWidths = c(t), this.columnOffsets = f(t), this.totalWidth = g(t), !e)
403
+ if (this.isVirtualized = e ?? !1, this.columnWidths = f(t), this.columnOffsets = g(t), this.totalWidth = m(t), !e)
402
404
  return this.startCol = 0, this.endCol = t.length - 1, [...t];
403
- const i = this.grid.clientWidth || 800, n = p(
405
+ const i = this.grid.clientWidth || 800, n = w(
404
406
  this.scrollLeft,
405
407
  i,
406
408
  this.columnOffsets,
407
409
  this.columnWidths,
408
410
  this.config.overscan ?? 3
409
411
  );
410
- return this.startCol = n.startCol, this.endCol = n.endCol, n.visibleColumns.map((r) => t[r]);
412
+ return this.startCol = n.startCol, this.endCol = n.endCol, n.visibleColumns.map((s) => t[s]);
411
413
  }
412
414
  /** @internal */
413
415
  afterRender() {
@@ -418,8 +420,8 @@ class E extends b {
418
420
  i && (i.style.paddingLeft = `${e}px`), n.forEach((o) => {
419
421
  o.style.paddingLeft = `${e}px`;
420
422
  });
421
- const r = t.querySelector(".rows-viewport .rows");
422
- r && (r.style.width = `${this.totalWidth}px`);
423
+ const s = t.querySelector(".rows-viewport .rows");
424
+ s && (s.style.width = `${this.totalWidth}px`);
423
425
  }
424
426
  /** @internal */
425
427
  onScroll(t) {