@toolbox-web/grid 0.0.4 → 0.0.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 (55) hide show
  1. package/all.d.ts +29 -6
  2. package/all.js +421 -421
  3. package/all.js.map +1 -1
  4. package/index.d.ts +28 -0
  5. package/index.js +774 -726
  6. package/index.js.map +1 -1
  7. package/lib/plugins/clipboard/index.js +55 -35
  8. package/lib/plugins/clipboard/index.js.map +1 -1
  9. package/lib/plugins/column-virtualization/index.js +49 -29
  10. package/lib/plugins/column-virtualization/index.js.map +1 -1
  11. package/lib/plugins/context-menu/index.js +35 -15
  12. package/lib/plugins/context-menu/index.js.map +1 -1
  13. package/lib/plugins/export/index.js +52 -32
  14. package/lib/plugins/export/index.js.map +1 -1
  15. package/lib/plugins/filtering/index.js +116 -99
  16. package/lib/plugins/filtering/index.js.map +1 -1
  17. package/lib/plugins/grouping-columns/index.js +42 -22
  18. package/lib/plugins/grouping-columns/index.js.map +1 -1
  19. package/lib/plugins/grouping-rows/index.js +20 -0
  20. package/lib/plugins/grouping-rows/index.js.map +1 -1
  21. package/lib/plugins/master-detail/index.js +50 -27
  22. package/lib/plugins/master-detail/index.js.map +1 -1
  23. package/lib/plugins/multi-sort/index.js +25 -5
  24. package/lib/plugins/multi-sort/index.js.map +1 -1
  25. package/lib/plugins/pinned-columns/index.js +20 -0
  26. package/lib/plugins/pinned-columns/index.js.map +1 -1
  27. package/lib/plugins/pinned-rows/index.js +20 -0
  28. package/lib/plugins/pinned-rows/index.js.map +1 -1
  29. package/lib/plugins/pivot/index.js +20 -0
  30. package/lib/plugins/pivot/index.js.map +1 -1
  31. package/lib/plugins/reorder/index.js +48 -28
  32. package/lib/plugins/reorder/index.js.map +1 -1
  33. package/lib/plugins/selection/index.js +51 -31
  34. package/lib/plugins/selection/index.js.map +1 -1
  35. package/lib/plugins/server-side/index.js +20 -0
  36. package/lib/plugins/server-side/index.js.map +1 -1
  37. package/lib/plugins/tree/index.js +76 -53
  38. package/lib/plugins/tree/index.js.map +1 -1
  39. package/lib/plugins/undo-redo/index.js +20 -0
  40. package/lib/plugins/undo-redo/index.js.map +1 -1
  41. package/lib/plugins/visibility/index.js +20 -0
  42. package/lib/plugins/visibility/index.js.map +1 -1
  43. package/package.json +1 -1
  44. package/umd/grid.all.umd.js +25 -25
  45. package/umd/grid.all.umd.js.map +1 -1
  46. package/umd/grid.umd.js +12 -12
  47. package/umd/grid.umd.js.map +1 -1
  48. package/umd/plugins/filtering.umd.js +3 -3
  49. package/umd/plugins/filtering.umd.js.map +1 -1
  50. package/umd/plugins/master-detail.umd.js +2 -2
  51. package/umd/plugins/master-detail.umd.js.map +1 -1
  52. package/umd/plugins/reorder.umd.js +1 -1
  53. package/umd/plugins/reorder.umd.js.map +1 -1
  54. package/umd/plugins/tree.umd.js +2 -2
  55. package/umd/plugins/tree.umd.js.map +1 -1
package/all.d.ts CHANGED
@@ -171,6 +171,24 @@ export declare abstract class BaseGridPlugin<TConfig = unknown> {
171
171
  * Get the shadow root of the grid.
172
172
  */
173
173
  protected get shadowRoot(): ShadowRoot | null;
174
+ /**
175
+ * Get the disconnect signal for event listener cleanup.
176
+ * This signal is aborted when the grid disconnects from the DOM.
177
+ * Use this when adding event listeners that should be cleaned up automatically.
178
+ *
179
+ * Best for:
180
+ * - Document/window-level listeners added in attach()
181
+ * - Listeners on the grid element itself
182
+ * - Any listener that should persist across renders
183
+ *
184
+ * Not needed for:
185
+ * - Listeners on elements created in afterRender() (removed with element)
186
+ *
187
+ * @example
188
+ * element.addEventListener('click', handler, { signal: this.disconnectSignal });
189
+ * document.addEventListener('keydown', handler, { signal: this.disconnectSignal });
190
+ */
191
+ protected get disconnectSignal(): AbortSignal;
174
192
  /**
175
193
  * Log a warning message.
176
194
  */
@@ -1171,6 +1189,14 @@ declare class DataGridElement<T = any> extends HTMLElement implements InternalGr
1171
1189
  get editOn(): string | undefined;
1172
1190
  set editOn(value: string | undefined);
1173
1191
  get effectiveConfig(): GridConfig<T>;
1192
+ /**
1193
+ * Get the disconnect signal for event listener cleanup.
1194
+ * This signal is aborted when the grid disconnects from the DOM.
1195
+ * Plugins and internal code can use this for automatic listener cleanup.
1196
+ * @example
1197
+ * element.addEventListener('click', handler, { signal: this.grid.disconnectSignal });
1198
+ */
1199
+ get disconnectSignal(): AbortSignal;
1174
1200
  constructor();
1175
1201
  /**
1176
1202
  * Get a plugin instance by its class.
@@ -1585,7 +1611,7 @@ export declare class FilteringPlugin extends BaseGridPlugin<FilterConfig> {
1585
1611
  private panelElement;
1586
1612
  private searchText;
1587
1613
  private excludedValues;
1588
- private documentClickHandler;
1614
+ private panelAbortController;
1589
1615
  private globalStylesInjected;
1590
1616
  private static readonly LIST_ITEM_HEIGHT;
1591
1617
  private static readonly LIST_OVERSCAN;
@@ -1652,10 +1678,6 @@ export declare class FilteringPlugin extends BaseGridPlugin<FilterConfig> {
1652
1678
  * Close the filter panel
1653
1679
  */
1654
1680
  private closeFilterPanel;
1655
- /**
1656
- * Remove the document click handler
1657
- */
1658
- private removeDocumentClickHandler;
1659
1681
  /**
1660
1682
  * Position the panel below the button
1661
1683
  */
@@ -1927,6 +1949,8 @@ declare interface GridElement_2 {
1927
1949
  rows: any[];
1928
1950
  columns: ColumnConfig[];
1929
1951
  gridConfig: any;
1952
+ /** AbortSignal that is aborted when the grid disconnects from the DOM */
1953
+ disconnectSignal: AbortSignal;
1930
1954
  requestRender(): void;
1931
1955
  requestAfterRender(): void;
1932
1956
  forceLayout(): Promise<void>;
@@ -2822,7 +2846,6 @@ export declare class ReorderPlugin extends BaseGridPlugin<ReorderConfig> {
2822
2846
  private draggedField;
2823
2847
  private draggedIndex;
2824
2848
  private dropIndex;
2825
- private boundReorderRequestHandler;
2826
2849
  attach(grid: GridElement_2): void;
2827
2850
  detach(): void;
2828
2851
  afterRender(): void;