@toolbox-web/grid 1.0.0 → 1.1.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 (87) hide show
  1. package/all.d.ts +1 -0
  2. package/all.d.ts.map +1 -1
  3. package/all.js +1655 -1444
  4. package/all.js.map +1 -1
  5. package/index.js +438 -401
  6. package/index.js.map +1 -1
  7. package/lib/core/grid.d.ts.map +1 -1
  8. package/lib/core/internal/rows.d.ts.map +1 -1
  9. package/lib/core/internal/validate-config.d.ts +10 -0
  10. package/lib/core/internal/validate-config.d.ts.map +1 -1
  11. package/lib/core/plugin/base-plugin.d.ts +101 -0
  12. package/lib/core/plugin/base-plugin.d.ts.map +1 -1
  13. package/lib/core/plugin/index.d.ts +1 -1
  14. package/lib/core/plugin/index.d.ts.map +1 -1
  15. package/lib/plugins/clipboard/index.js +22 -0
  16. package/lib/plugins/clipboard/index.js.map +1 -1
  17. package/lib/plugins/column-virtualization/index.js +48 -26
  18. package/lib/plugins/column-virtualization/index.js.map +1 -1
  19. package/lib/plugins/context-menu/index.js +64 -42
  20. package/lib/plugins/context-menu/index.js.map +1 -1
  21. package/lib/plugins/editing/EditingPlugin.d.ts +6 -1
  22. package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
  23. package/lib/plugins/editing/index.js +50 -4
  24. package/lib/plugins/editing/index.js.map +1 -1
  25. package/lib/plugins/export/index.js +36 -14
  26. package/lib/plugins/export/index.js.map +1 -1
  27. package/lib/plugins/filtering/index.js +63 -41
  28. package/lib/plugins/filtering/index.js.map +1 -1
  29. package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts +6 -1
  30. package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts.map +1 -1
  31. package/lib/plugins/grouping-columns/index.js +47 -6
  32. package/lib/plugins/grouping-columns/index.js.map +1 -1
  33. package/lib/plugins/grouping-rows/index.js +22 -0
  34. package/lib/plugins/grouping-rows/index.js.map +1 -1
  35. package/lib/plugins/master-detail/index.js +22 -0
  36. package/lib/plugins/master-detail/index.js.map +1 -1
  37. package/lib/plugins/multi-sort/index.js +22 -0
  38. package/lib/plugins/multi-sort/index.js.map +1 -1
  39. package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts +6 -1
  40. package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts.map +1 -1
  41. package/lib/plugins/pinned-columns/index.js +36 -0
  42. package/lib/plugins/pinned-columns/index.js.map +1 -1
  43. package/lib/plugins/pinned-rows/index.js +22 -0
  44. package/lib/plugins/pinned-rows/index.js.map +1 -1
  45. package/lib/plugins/pivot/index.js +22 -0
  46. package/lib/plugins/pivot/index.js.map +1 -1
  47. package/lib/plugins/reorder/index.js +22 -0
  48. package/lib/plugins/reorder/index.js.map +1 -1
  49. package/lib/plugins/responsive/ResponsivePlugin.d.ts +123 -0
  50. package/lib/plugins/responsive/ResponsivePlugin.d.ts.map +1 -0
  51. package/lib/plugins/responsive/index.d.ts +11 -0
  52. package/lib/plugins/responsive/index.d.ts.map +1 -0
  53. package/lib/plugins/responsive/index.js +589 -0
  54. package/lib/plugins/responsive/index.js.map +1 -0
  55. package/lib/plugins/responsive/types.d.ts +133 -0
  56. package/lib/plugins/responsive/types.d.ts.map +1 -0
  57. package/lib/plugins/selection/SelectionPlugin.d.ts +6 -1
  58. package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
  59. package/lib/plugins/selection/index.d.ts +1 -1
  60. package/lib/plugins/selection/index.d.ts.map +1 -1
  61. package/lib/plugins/selection/index.js +105 -63
  62. package/lib/plugins/selection/index.js.map +1 -1
  63. package/lib/plugins/selection/types.d.ts +26 -0
  64. package/lib/plugins/selection/types.d.ts.map +1 -1
  65. package/lib/plugins/server-side/index.js +22 -0
  66. package/lib/plugins/server-side/index.js.map +1 -1
  67. package/lib/plugins/tree/index.js +22 -0
  68. package/lib/plugins/tree/index.js.map +1 -1
  69. package/lib/plugins/undo-redo/index.js +27 -5
  70. package/lib/plugins/undo-redo/index.js.map +1 -1
  71. package/lib/plugins/visibility/index.js +22 -0
  72. package/lib/plugins/visibility/index.js.map +1 -1
  73. package/package.json +1 -1
  74. package/umd/grid.all.umd.js +28 -22
  75. package/umd/grid.all.umd.js.map +1 -1
  76. package/umd/grid.umd.js +18 -14
  77. package/umd/grid.umd.js.map +1 -1
  78. package/umd/plugins/editing.umd.js +1 -1
  79. package/umd/plugins/editing.umd.js.map +1 -1
  80. package/umd/plugins/grouping-columns.umd.js +1 -1
  81. package/umd/plugins/grouping-columns.umd.js.map +1 -1
  82. package/umd/plugins/pinned-columns.umd.js +1 -1
  83. package/umd/plugins/pinned-columns.umd.js.map +1 -1
  84. package/umd/plugins/responsive.umd.js +2 -0
  85. package/umd/plugins/responsive.umd.js.map +1 -0
  86. package/umd/plugins/selection.umd.js +3 -1
  87. package/umd/plugins/selection.umd.js.map +1 -1
@@ -25,6 +25,28 @@ class b {
25
25
  * ```
26
26
  */
27
27
  static dependencies;
28
+ /**
29
+ * Plugin manifest - declares owned properties, config rules, and hook priorities.
30
+ *
31
+ * This is read by the configuration validator to:
32
+ * - Validate that required plugins are loaded when their properties are used
33
+ * - Execute configRules to detect invalid/conflicting settings
34
+ * - Order hook execution based on priority
35
+ *
36
+ * @example
37
+ * ```typescript
38
+ * static override readonly manifest: PluginManifest<MyConfig> = {
39
+ * ownedProperties: [
40
+ * { property: 'myProp', level: 'column', description: 'the "myProp" column property' },
41
+ * ],
42
+ * configRules: [
43
+ * { id: 'myPlugin/conflict', severity: 'warn', message: '...', check: (c) => c.a && c.b },
44
+ * ],
45
+ * };
46
+ * ```
47
+ */
48
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
49
+ static manifest;
28
50
  /**
29
51
  * Plugin version - defaults to grid version for built-in plugins.
30
52
  * Third-party plugins can override with their own semver.
@@ -287,58 +309,58 @@ class b {
287
309
  // #endregion
288
310
  }
289
311
  const h = 100;
290
- function a(r) {
291
- if (r == null)
312
+ function a(s) {
313
+ if (s == null)
292
314
  return h;
293
- if (typeof r == "number")
294
- return r;
295
- const t = parseFloat(r);
315
+ if (typeof s == "number")
316
+ return s;
317
+ const t = parseFloat(s);
296
318
  return isNaN(t) ? h : t;
297
319
  }
298
- function c(r) {
299
- return r.map((t) => a(t.width));
320
+ function c(s) {
321
+ return s.map((t) => a(t.width));
300
322
  }
301
- function f(r) {
323
+ function f(s) {
302
324
  const t = [];
303
325
  let e = 0;
304
- for (const i of r)
326
+ for (const i of s)
305
327
  t.push(e), e += a(i.width);
306
328
  return t;
307
329
  }
308
- function g(r) {
309
- return r.reduce((t, e) => t + a(e.width), 0);
330
+ function g(s) {
331
+ return s.reduce((t, e) => t + a(e.width), 0);
310
332
  }
311
- function p(r, t, e, i, n) {
312
- const s = e.length;
313
- if (s === 0)
333
+ function p(s, t, e, i, n) {
334
+ const r = e.length;
335
+ if (r === 0)
314
336
  return { startCol: 0, endCol: 0, visibleColumns: [] };
315
- let o = w(r, e, i);
337
+ let o = w(s, e, i);
316
338
  o = Math.max(0, o - n);
317
- const m = r + t;
339
+ const m = s + t;
318
340
  let u = o;
319
- for (let l = o; l < s; l++) {
341
+ for (let l = o; l < r; l++) {
320
342
  if (e[l] >= m) {
321
343
  u = l - 1;
322
344
  break;
323
345
  }
324
346
  u = l;
325
347
  }
326
- u = Math.min(s - 1, u + n);
348
+ u = Math.min(r - 1, u + n);
327
349
  const d = [];
328
350
  for (let l = o; l <= u; l++)
329
351
  d.push(l);
330
352
  return { startCol: o, endCol: u, visibleColumns: d };
331
353
  }
332
- function w(r, t, e) {
354
+ function w(s, t, e) {
333
355
  let i = 0, n = t.length - 1;
334
356
  for (; i < n; ) {
335
- const s = Math.floor((i + n) / 2);
336
- t[s] + e[s] <= r ? i = s + 1 : n = s;
357
+ const r = Math.floor((i + n) / 2);
358
+ t[r] + e[r] <= s ? i = r + 1 : n = r;
337
359
  }
338
360
  return i;
339
361
  }
340
- function R(r, t, e) {
341
- return e ? r > t : !1;
362
+ function R(s, t, e) {
363
+ return e ? s > t : !1;
342
364
  }
343
365
  class E extends b {
344
366
  /** @internal */
@@ -385,7 +407,7 @@ class E extends b {
385
407
  this.columnWidths,
386
408
  this.config.overscan ?? 3
387
409
  );
388
- return this.startCol = n.startCol, this.endCol = n.endCol, n.visibleColumns.map((s) => t[s]);
410
+ return this.startCol = n.startCol, this.endCol = n.endCol, n.visibleColumns.map((r) => t[r]);
389
411
  }
390
412
  /** @internal */
391
413
  afterRender() {
@@ -396,8 +418,8 @@ class E extends b {
396
418
  i && (i.style.paddingLeft = `${e}px`), n.forEach((o) => {
397
419
  o.style.paddingLeft = `${e}px`;
398
420
  });
399
- const s = t.querySelector(".rows-viewport .rows");
400
- s && (s.style.width = `${this.totalWidth}px`);
421
+ const r = t.querySelector(".rows-viewport .rows");
422
+ r && (r.style.width = `${this.totalWidth}px`);
401
423
  }
402
424
  /** @internal */
403
425
  onScroll(t) {