@toolbox-web/grid 0.3.3 → 0.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 (137) hide show
  1. package/all.d.ts +19 -19
  2. package/all.d.ts.map +1 -1
  3. package/all.js +1775 -1202
  4. package/all.js.map +1 -1
  5. package/index.js +2152 -2028
  6. package/index.js.map +1 -1
  7. package/lib/core/grid.d.ts +22 -12
  8. package/lib/core/grid.d.ts.map +1 -1
  9. package/lib/core/internal/columns.d.ts +0 -9
  10. package/lib/core/internal/columns.d.ts.map +1 -1
  11. package/lib/core/internal/config-manager.d.ts +236 -0
  12. package/lib/core/internal/config-manager.d.ts.map +1 -0
  13. package/lib/core/internal/event-delegation.d.ts.map +1 -1
  14. package/lib/core/internal/header.d.ts.map +1 -1
  15. package/lib/core/internal/keyboard.d.ts.map +1 -1
  16. package/lib/core/internal/render-scheduler.d.ts +123 -0
  17. package/lib/core/internal/render-scheduler.d.ts.map +1 -0
  18. package/lib/core/internal/rows.d.ts +8 -3
  19. package/lib/core/internal/rows.d.ts.map +1 -1
  20. package/lib/core/internal/sanitize.d.ts +2 -2
  21. package/lib/core/internal/sanitize.d.ts.map +1 -1
  22. package/lib/core/internal/shell.d.ts +40 -2
  23. package/lib/core/internal/shell.d.ts.map +1 -1
  24. package/lib/core/internal/validate-config.d.ts +11 -0
  25. package/lib/core/internal/validate-config.d.ts.map +1 -0
  26. package/lib/core/plugin/base-plugin.d.ts +70 -0
  27. package/lib/core/plugin/base-plugin.d.ts.map +1 -1
  28. package/lib/core/plugin/plugin-manager.d.ts +13 -2
  29. package/lib/core/plugin/plugin-manager.d.ts.map +1 -1
  30. package/lib/core/plugin/types.d.ts +17 -3
  31. package/lib/core/plugin/types.d.ts.map +1 -1
  32. package/lib/core/types.d.ts +112 -12
  33. package/lib/core/types.d.ts.map +1 -1
  34. package/lib/plugins/clipboard/ClipboardPlugin.d.ts.map +1 -1
  35. package/lib/plugins/clipboard/index.js +50 -18
  36. package/lib/plugins/clipboard/index.js.map +1 -1
  37. package/lib/plugins/column-virtualization/index.js +60 -25
  38. package/lib/plugins/column-virtualization/index.js.map +1 -1
  39. package/lib/plugins/context-menu/index.js +51 -16
  40. package/lib/plugins/context-menu/index.js.map +1 -1
  41. package/lib/plugins/editing/EditingPlugin.d.ts +117 -0
  42. package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -0
  43. package/lib/{core/internal → plugins/editing}/editors.d.ts +1 -1
  44. package/lib/plugins/editing/editors.d.ts.map +1 -0
  45. package/lib/plugins/editing/index.d.ts +8 -0
  46. package/lib/plugins/editing/index.d.ts.map +1 -0
  47. package/lib/plugins/editing/index.js +705 -0
  48. package/lib/plugins/editing/index.js.map +1 -0
  49. package/lib/plugins/editing/types.d.ts +45 -0
  50. package/lib/plugins/editing/types.d.ts.map +1 -0
  51. package/lib/plugins/export/ExportPlugin.d.ts.map +1 -1
  52. package/lib/plugins/export/index.js +74 -39
  53. package/lib/plugins/export/index.js.map +1 -1
  54. package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -1
  55. package/lib/plugins/filtering/index.js +87 -50
  56. package/lib/plugins/filtering/index.js.map +1 -1
  57. package/lib/plugins/grouping-columns/grouping-columns.d.ts +4 -4
  58. package/lib/plugins/grouping-columns/grouping-columns.d.ts.map +1 -1
  59. package/lib/plugins/grouping-columns/index.js +59 -24
  60. package/lib/plugins/grouping-columns/index.js.map +1 -1
  61. package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts.map +1 -1
  62. package/lib/plugins/grouping-rows/grouping-rows.d.ts.map +1 -1
  63. package/lib/plugins/grouping-rows/index.js +46 -11
  64. package/lib/plugins/grouping-rows/index.js.map +1 -1
  65. package/lib/plugins/master-detail/MasterDetailPlugin.d.ts +2 -2
  66. package/lib/plugins/master-detail/MasterDetailPlugin.d.ts.map +1 -1
  67. package/lib/plugins/master-detail/index.js +140 -102
  68. package/lib/plugins/master-detail/index.js.map +1 -1
  69. package/lib/plugins/master-detail/types.d.ts +12 -2
  70. package/lib/plugins/master-detail/types.d.ts.map +1 -1
  71. package/lib/plugins/multi-sort/MultiSortPlugin.d.ts.map +1 -1
  72. package/lib/plugins/multi-sort/index.js +59 -22
  73. package/lib/plugins/multi-sort/index.js.map +1 -1
  74. package/lib/plugins/pinned-columns/index.js +41 -6
  75. package/lib/plugins/pinned-columns/index.js.map +1 -1
  76. package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts.map +1 -1
  77. package/lib/plugins/pinned-rows/index.js +45 -9
  78. package/lib/plugins/pinned-rows/index.js.map +1 -1
  79. package/lib/plugins/pivot/index.js +42 -7
  80. package/lib/plugins/pivot/index.js.map +1 -1
  81. package/lib/plugins/reorder/ReorderPlugin.d.ts.map +1 -1
  82. package/lib/plugins/reorder/index.js +59 -19
  83. package/lib/plugins/reorder/index.js.map +1 -1
  84. package/lib/plugins/selection/index.js +41 -6
  85. package/lib/plugins/selection/index.js.map +1 -1
  86. package/lib/plugins/server-side/index.js +48 -13
  87. package/lib/plugins/server-side/index.js.map +1 -1
  88. package/lib/plugins/tree/TreePlugin.d.ts +3 -3
  89. package/lib/plugins/tree/TreePlugin.d.ts.map +1 -1
  90. package/lib/plugins/tree/index.js +165 -126
  91. package/lib/plugins/tree/index.js.map +1 -1
  92. package/lib/plugins/tree/tree-data.d.ts +6 -6
  93. package/lib/plugins/tree/tree-data.d.ts.map +1 -1
  94. package/lib/plugins/tree/tree-detect.d.ts +5 -9
  95. package/lib/plugins/tree/tree-detect.d.ts.map +1 -1
  96. package/lib/plugins/tree/types.d.ts +16 -4
  97. package/lib/plugins/tree/types.d.ts.map +1 -1
  98. package/lib/plugins/undo-redo/index.js +46 -11
  99. package/lib/plugins/undo-redo/index.js.map +1 -1
  100. package/lib/plugins/visibility/index.js +37 -2
  101. package/lib/plugins/visibility/index.js.map +1 -1
  102. package/package.json +1 -1
  103. package/public.d.ts +104 -13
  104. package/public.d.ts.map +1 -1
  105. package/umd/grid.all.umd.js +31 -19
  106. package/umd/grid.all.umd.js.map +1 -1
  107. package/umd/grid.umd.js +18 -6
  108. package/umd/grid.umd.js.map +1 -1
  109. package/umd/plugins/clipboard.umd.js +1 -1
  110. package/umd/plugins/clipboard.umd.js.map +1 -1
  111. package/umd/plugins/editing.umd.js +2 -0
  112. package/umd/plugins/editing.umd.js.map +1 -0
  113. package/umd/plugins/export.umd.js +2 -2
  114. package/umd/plugins/export.umd.js.map +1 -1
  115. package/umd/plugins/filtering.umd.js +1 -1
  116. package/umd/plugins/filtering.umd.js.map +1 -1
  117. package/umd/plugins/grouping-columns.umd.js +1 -1
  118. package/umd/plugins/grouping-columns.umd.js.map +1 -1
  119. package/umd/plugins/grouping-rows.umd.js +1 -1
  120. package/umd/plugins/grouping-rows.umd.js.map +1 -1
  121. package/umd/plugins/master-detail.umd.js +1 -1
  122. package/umd/plugins/master-detail.umd.js.map +1 -1
  123. package/umd/plugins/multi-sort.umd.js +1 -1
  124. package/umd/plugins/multi-sort.umd.js.map +1 -1
  125. package/umd/plugins/pinned-rows.umd.js +1 -1
  126. package/umd/plugins/pinned-rows.umd.js.map +1 -1
  127. package/umd/plugins/reorder.umd.js +1 -1
  128. package/umd/plugins/reorder.umd.js.map +1 -1
  129. package/umd/plugins/tree.umd.js +1 -1
  130. package/umd/plugins/tree.umd.js.map +1 -1
  131. package/lib/core/internal/column-state.d.ts +0 -124
  132. package/lib/core/internal/column-state.d.ts.map +0 -1
  133. package/lib/core/internal/editing.d.ts +0 -76
  134. package/lib/core/internal/editing.d.ts.map +0 -1
  135. package/lib/core/internal/editors.d.ts.map +0 -1
  136. package/lib/core/internal/grid-internals.d.ts +0 -83
  137. package/lib/core/internal/grid-internals.d.ts.map +0 -1
@@ -1,83 +0,0 @@
1
- import { BaseGridPlugin } from '../plugin';
2
- import { ColumnInternal, GridConfig, InternalGrid } from '../types';
3
- /**
4
- * Callback interface for grid operations that modules need to trigger.
5
- * These are provided by the grid to modules so they can trigger re-renders,
6
- * emit events, etc. without direct coupling.
7
- */
8
- export interface GridCallbacks<T = any> {
9
- /** Emit a custom event from the grid element */
10
- emit: (eventName: string, detail: any) => void;
11
- /** Trigger full grid setup (re-parse columns, re-render) */
12
- setup: () => void;
13
- /** Refresh the virtual window (re-render visible rows) */
14
- refreshVirtualWindow: (full: boolean) => void;
15
- /** Update CSS grid template for column widths */
16
- updateTemplate: () => void;
17
- /** Render the header row */
18
- renderHeader: () => void;
19
- /** Get array of attached plugins */
20
- getPlugins: () => BaseGridPlugin[];
21
- /** Find rendered row element by index */
22
- findRenderedRowElement: (rowIndex: number) => HTMLElement | null;
23
- }
24
- /**
25
- * Interface for internal grid state access.
26
- *
27
- * Extracted modules (columns.ts, column-state.ts, editing.ts, shell.ts) receive
28
- * this interface instead of the full Grid class. This:
29
- * 1. Makes dependencies explicit
30
- * 2. Enables tree-shaking (modules don't depend on entire Grid)
31
- * 3. Improves testability (can mock this interface)
32
- */
33
- export interface GridInternals<T = any> {
34
- /** The merged effective config - single source of truth */
35
- effectiveConfig: GridConfig<T>;
36
- /** All columns including hidden */
37
- _columns: ColumnInternal<T>[];
38
- /** Visible columns only (computed from _columns) */
39
- readonly _visibleColumns: ColumnInternal<T>[];
40
- /** Processed rows (after plugin hooks) */
41
- _rows: T[];
42
- /** Source rows before processing */
43
- readonly sourceRows: T[];
44
- /** Currently active edit row index (-1 if none) */
45
- _activeEditRows: number;
46
- /** Snapshots of row data before editing started */
47
- _rowEditSnapshots: Map<number, T>;
48
- /** Set of row indices that have been modified */
49
- _changedRowIndices: Set<number>;
50
- /** Currently focused row index */
51
- _focusRow: number;
52
- /** Currently focused column index */
53
- _focusCol: number;
54
- /** Current sort state */
55
- _sortState: {
56
- field: string;
57
- direction: 1 | -1;
58
- } | null;
59
- /** Shadow root of the grid element */
60
- readonly shadowRoot: ShadowRoot | null;
61
- /** Header row element */
62
- readonly _headerRowEl: HTMLElement;
63
- /** Body container element (holds rendered rows) */
64
- readonly _bodyEl: HTMLElement;
65
- /** Row element pool for virtualization */
66
- _rowPool: HTMLElement[];
67
- /** Epoch counter for row rendering (incremented on structural changes) */
68
- __rowRenderEpoch: number;
69
- /** Grid operation callbacks */
70
- readonly _callbacks: GridCallbacks<T>;
71
- }
72
- /**
73
- * Create a GridInternals adapter from an InternalGrid instance.
74
- *
75
- * This function bridges the gap between the full grid and the minimal interface
76
- * that extracted modules need. Call this in grid.ts to create the adapter once.
77
- *
78
- * @param grid - The full grid instance
79
- * @param callbacks - Callbacks for grid operations
80
- * @returns GridInternals interface backed by the grid
81
- */
82
- export declare function createGridInternals<T>(grid: InternalGrid<T>, callbacks: GridCallbacks<T>): GridInternals<T>;
83
- //# sourceMappingURL=grid-internals.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"grid-internals.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/core/internal/grid-internals.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEzE;;;;GAIG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,GAAG;IACpC,gDAAgD;IAChD,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/C,4DAA4D;IAC5D,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,0DAA0D;IAC1D,oBAAoB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,iDAAiD;IACjD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,4BAA4B;IAC5B,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,oCAAoC;IACpC,UAAU,EAAE,MAAM,cAAc,EAAE,CAAC;IACnC,yCAAyC;IACzC,sBAAsB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,WAAW,GAAG,IAA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