@toolbox-web/grid 0.6.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 (197) hide show
  1. package/README.md +79 -26
  2. package/all.d.ts +1 -0
  3. package/all.d.ts.map +1 -1
  4. package/all.js +1899 -2696
  5. package/all.js.map +1 -1
  6. package/index.js +1498 -2489
  7. package/index.js.map +1 -1
  8. package/lib/core/constants.d.ts +8 -0
  9. package/lib/core/constants.d.ts.map +1 -1
  10. package/lib/core/grid.d.ts +704 -55
  11. package/lib/core/grid.d.ts.map +1 -1
  12. package/lib/core/internal/config-manager.d.ts +3 -7
  13. package/lib/core/internal/config-manager.d.ts.map +1 -1
  14. package/lib/core/internal/dom-builder.d.ts +2 -10
  15. package/lib/core/internal/dom-builder.d.ts.map +1 -1
  16. package/lib/core/internal/inference.d.ts.map +1 -1
  17. package/lib/core/internal/keyboard.d.ts.map +1 -1
  18. package/lib/core/internal/render-scheduler.d.ts +2 -0
  19. package/lib/core/internal/render-scheduler.d.ts.map +1 -1
  20. package/lib/core/internal/rows.d.ts +9 -1
  21. package/lib/core/internal/rows.d.ts.map +1 -1
  22. package/lib/core/internal/shell.d.ts +41 -41
  23. package/lib/core/internal/shell.d.ts.map +1 -1
  24. package/lib/core/internal/validate-config.d.ts +10 -0
  25. package/lib/core/internal/validate-config.d.ts.map +1 -1
  26. package/lib/core/plugin/base-plugin.d.ts +103 -15
  27. package/lib/core/plugin/base-plugin.d.ts.map +1 -1
  28. package/lib/core/plugin/index.d.ts +1 -1
  29. package/lib/core/plugin/index.d.ts.map +1 -1
  30. package/lib/core/plugin/types.d.ts +33 -6
  31. package/lib/core/plugin/types.d.ts.map +1 -1
  32. package/lib/core/types.d.ts +376 -68
  33. package/lib/core/types.d.ts.map +1 -1
  34. package/lib/plugins/clipboard/ClipboardPlugin.d.ts +89 -2
  35. package/lib/plugins/clipboard/ClipboardPlugin.d.ts.map +1 -1
  36. package/lib/plugins/clipboard/index.d.ts +2 -0
  37. package/lib/plugins/clipboard/index.d.ts.map +1 -1
  38. package/lib/plugins/clipboard/index.js +46 -35
  39. package/lib/plugins/clipboard/index.js.map +1 -1
  40. package/lib/plugins/column-virtualization/ColumnVirtualizationPlugin.d.ts +57 -2
  41. package/lib/plugins/column-virtualization/ColumnVirtualizationPlugin.d.ts.map +1 -1
  42. package/lib/plugins/column-virtualization/index.d.ts +2 -0
  43. package/lib/plugins/column-virtualization/index.d.ts.map +1 -1
  44. package/lib/plugins/column-virtualization/index.js +55 -43
  45. package/lib/plugins/column-virtualization/index.js.map +1 -1
  46. package/lib/plugins/context-menu/ContextMenuPlugin.d.ts +75 -5
  47. package/lib/plugins/context-menu/ContextMenuPlugin.d.ts.map +1 -1
  48. package/lib/plugins/context-menu/index.d.ts +3 -1
  49. package/lib/plugins/context-menu/index.d.ts.map +1 -1
  50. package/lib/plugins/context-menu/index.js +76 -66
  51. package/lib/plugins/context-menu/index.js.map +1 -1
  52. package/lib/plugins/editing/EditingPlugin.d.ts +107 -10
  53. package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
  54. package/lib/plugins/editing/editors.d.ts +9 -1
  55. package/lib/plugins/editing/editors.d.ts.map +1 -1
  56. package/lib/plugins/editing/index.d.ts +4 -2
  57. package/lib/plugins/editing/index.d.ts.map +1 -1
  58. package/lib/plugins/editing/index.js +458 -279
  59. package/lib/plugins/editing/index.js.map +1 -1
  60. package/lib/plugins/editing/types.d.ts +88 -0
  61. package/lib/plugins/editing/types.d.ts.map +1 -1
  62. package/lib/plugins/export/ExportPlugin.d.ts +73 -7
  63. package/lib/plugins/export/ExportPlugin.d.ts.map +1 -1
  64. package/lib/plugins/export/index.d.ts +2 -0
  65. package/lib/plugins/export/index.d.ts.map +1 -1
  66. package/lib/plugins/export/index.js +40 -33
  67. package/lib/plugins/export/index.js.map +1 -1
  68. package/lib/plugins/filtering/FilteringPlugin.d.ts +98 -2
  69. package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -1
  70. package/lib/plugins/filtering/index.d.ts +2 -0
  71. package/lib/plugins/filtering/index.d.ts.map +1 -1
  72. package/lib/plugins/filtering/index.js +31 -17
  73. package/lib/plugins/filtering/index.js.map +1 -1
  74. package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts +86 -7
  75. package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts.map +1 -1
  76. package/lib/plugins/grouping-columns/index.d.ts +2 -0
  77. package/lib/plugins/grouping-columns/index.d.ts.map +1 -1
  78. package/lib/plugins/grouping-columns/index.js +57 -27
  79. package/lib/plugins/grouping-columns/index.js.map +1 -1
  80. package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts +81 -5
  81. package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts.map +1 -1
  82. package/lib/plugins/grouping-rows/index.d.ts +3 -1
  83. package/lib/plugins/grouping-rows/index.d.ts.map +1 -1
  84. package/lib/plugins/grouping-rows/index.js +35 -21
  85. package/lib/plugins/grouping-rows/index.js.map +1 -1
  86. package/lib/plugins/master-detail/MasterDetailPlugin.d.ts +90 -5
  87. package/lib/plugins/master-detail/MasterDetailPlugin.d.ts.map +1 -1
  88. package/lib/plugins/master-detail/index.d.ts +2 -0
  89. package/lib/plugins/master-detail/index.d.ts.map +1 -1
  90. package/lib/plugins/master-detail/index.js +33 -17
  91. package/lib/plugins/master-detail/index.js.map +1 -1
  92. package/lib/plugins/multi-sort/MultiSortPlugin.d.ts +83 -2
  93. package/lib/plugins/multi-sort/MultiSortPlugin.d.ts.map +1 -1
  94. package/lib/plugins/multi-sort/index.d.ts +2 -0
  95. package/lib/plugins/multi-sort/index.d.ts.map +1 -1
  96. package/lib/plugins/multi-sort/index.js +33 -19
  97. package/lib/plugins/multi-sort/index.js.map +1 -1
  98. package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts +67 -3
  99. package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts.map +1 -1
  100. package/lib/plugins/pinned-columns/index.d.ts +3 -1
  101. package/lib/plugins/pinned-columns/index.d.ts.map +1 -1
  102. package/lib/plugins/pinned-columns/index.js +43 -17
  103. package/lib/plugins/pinned-columns/index.js.map +1 -1
  104. package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts +71 -10
  105. package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts.map +1 -1
  106. package/lib/plugins/pinned-rows/index.d.ts +3 -1
  107. package/lib/plugins/pinned-rows/index.d.ts.map +1 -1
  108. package/lib/plugins/pinned-rows/index.js +27 -17
  109. package/lib/plugins/pinned-rows/index.js.map +1 -1
  110. package/lib/plugins/pivot/PivotPlugin.d.ts +81 -4
  111. package/lib/plugins/pivot/PivotPlugin.d.ts.map +1 -1
  112. package/lib/plugins/pivot/index.d.ts +2 -0
  113. package/lib/plugins/pivot/index.d.ts.map +1 -1
  114. package/lib/plugins/pivot/index.js +32 -17
  115. package/lib/plugins/pivot/index.js.map +1 -1
  116. package/lib/plugins/reorder/ReorderPlugin.d.ts +71 -3
  117. package/lib/plugins/reorder/ReorderPlugin.d.ts.map +1 -1
  118. package/lib/plugins/reorder/index.d.ts +2 -0
  119. package/lib/plugins/reorder/index.d.ts.map +1 -1
  120. package/lib/plugins/reorder/index.js +30 -18
  121. package/lib/plugins/reorder/index.js.map +1 -1
  122. package/lib/plugins/reorder/types.d.ts +0 -5
  123. package/lib/plugins/reorder/types.d.ts.map +1 -1
  124. package/lib/plugins/responsive/ResponsivePlugin.d.ts +123 -0
  125. package/lib/plugins/responsive/ResponsivePlugin.d.ts.map +1 -0
  126. package/lib/plugins/responsive/index.d.ts +11 -0
  127. package/lib/plugins/responsive/index.d.ts.map +1 -0
  128. package/lib/plugins/responsive/index.js +589 -0
  129. package/lib/plugins/responsive/index.js.map +1 -0
  130. package/lib/plugins/responsive/types.d.ts +133 -0
  131. package/lib/plugins/responsive/types.d.ts.map +1 -0
  132. package/lib/plugins/selection/SelectionPlugin.d.ts +90 -21
  133. package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
  134. package/lib/plugins/selection/index.d.ts +3 -2
  135. package/lib/plugins/selection/index.d.ts.map +1 -1
  136. package/lib/plugins/selection/index.js +125 -144
  137. package/lib/plugins/selection/index.js.map +1 -1
  138. package/lib/plugins/selection/types.d.ts +51 -4
  139. package/lib/plugins/selection/types.d.ts.map +1 -1
  140. package/lib/plugins/server-side/ServerSidePlugin.d.ts +65 -4
  141. package/lib/plugins/server-side/ServerSidePlugin.d.ts.map +1 -1
  142. package/lib/plugins/server-side/index.d.ts +3 -1
  143. package/lib/plugins/server-side/index.d.ts.map +1 -1
  144. package/lib/plugins/server-side/index.js +27 -17
  145. package/lib/plugins/server-side/index.js.map +1 -1
  146. package/lib/plugins/tree/TreePlugin.d.ts +89 -2
  147. package/lib/plugins/tree/TreePlugin.d.ts.map +1 -1
  148. package/lib/plugins/tree/index.d.ts +3 -2
  149. package/lib/plugins/tree/index.d.ts.map +1 -1
  150. package/lib/plugins/tree/index.js +81 -94
  151. package/lib/plugins/tree/index.js.map +1 -1
  152. package/lib/plugins/undo-redo/UndoRedoPlugin.d.ts +66 -3
  153. package/lib/plugins/undo-redo/UndoRedoPlugin.d.ts.map +1 -1
  154. package/lib/plugins/undo-redo/index.d.ts +3 -1
  155. package/lib/plugins/undo-redo/index.d.ts.map +1 -1
  156. package/lib/plugins/undo-redo/index.js +32 -22
  157. package/lib/plugins/undo-redo/index.js.map +1 -1
  158. package/lib/plugins/visibility/VisibilityPlugin.d.ts +86 -2
  159. package/lib/plugins/visibility/VisibilityPlugin.d.ts.map +1 -1
  160. package/lib/plugins/visibility/index.d.ts +2 -0
  161. package/lib/plugins/visibility/index.d.ts.map +1 -1
  162. package/lib/plugins/visibility/index.js +28 -17
  163. package/lib/plugins/visibility/index.js.map +1 -1
  164. package/package.json +1 -1
  165. package/public.d.ts +30 -2
  166. package/public.d.ts.map +1 -1
  167. package/umd/grid.all.umd.js +31 -25
  168. package/umd/grid.all.umd.js.map +1 -1
  169. package/umd/grid.umd.js +21 -17
  170. package/umd/grid.umd.js.map +1 -1
  171. package/umd/plugins/clipboard.umd.js.map +1 -1
  172. package/umd/plugins/column-virtualization.umd.js.map +1 -1
  173. package/umd/plugins/context-menu.umd.js.map +1 -1
  174. package/umd/plugins/editing.umd.js +1 -1
  175. package/umd/plugins/editing.umd.js.map +1 -1
  176. package/umd/plugins/export.umd.js.map +1 -1
  177. package/umd/plugins/filtering.umd.js.map +1 -1
  178. package/umd/plugins/grouping-columns.umd.js +1 -1
  179. package/umd/plugins/grouping-columns.umd.js.map +1 -1
  180. package/umd/plugins/grouping-rows.umd.js.map +1 -1
  181. package/umd/plugins/master-detail.umd.js.map +1 -1
  182. package/umd/plugins/multi-sort.umd.js.map +1 -1
  183. package/umd/plugins/pinned-columns.umd.js +1 -1
  184. package/umd/plugins/pinned-columns.umd.js.map +1 -1
  185. package/umd/plugins/pinned-rows.umd.js.map +1 -1
  186. package/umd/plugins/pivot.umd.js.map +1 -1
  187. package/umd/plugins/reorder.umd.js +1 -1
  188. package/umd/plugins/reorder.umd.js.map +1 -1
  189. package/umd/plugins/responsive.umd.js +2 -0
  190. package/umd/plugins/responsive.umd.js.map +1 -0
  191. package/umd/plugins/selection.umd.js +3 -1
  192. package/umd/plugins/selection.umd.js.map +1 -1
  193. package/umd/plugins/server-side.umd.js.map +1 -1
  194. package/umd/plugins/tree.umd.js +1 -1
  195. package/umd/plugins/tree.umd.js.map +1 -1
  196. package/umd/plugins/undo-redo.umd.js.map +1 -1
  197. package/umd/plugins/visibility.umd.js.map +1 -1
@@ -4,16 +4,63 @@
4
4
  * Type definitions for the selection feature.
5
5
  */
6
6
  /**
7
- * Selection mode for the grid:
8
- * - 'cell': Single cell selection (default). No border, just focus highlight.
9
- * - 'row': Row selection. Clicking a cell selects the entire row. Uses focus outline color.
10
- * - 'range': Range selection. Shift+click or drag to select rectangular cell ranges. Uses success border color.
7
+ * Selection mode for the grid.
8
+ *
9
+ * Each mode offers different selection behavior suited to different use cases:
10
+ *
11
+ * | Mode | Use Case | Behavior |
12
+ * |------|----------|----------|
13
+ * | `'cell'` | Spreadsheet-style editing | Single cell focus. Click to select one cell at a time. |
14
+ * | `'row'` | Record-based operations | Full row selection. Click anywhere to select the entire row. |
15
+ * | `'range'` | Bulk operations, export | Rectangular selection. Drag or Shift+Click to select ranges. |
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * // Cell mode (default) - for spreadsheet-like interaction
20
+ * new SelectionPlugin({ mode: 'cell' })
21
+ *
22
+ * // Row mode - for selecting complete records
23
+ * new SelectionPlugin({ mode: 'row' })
24
+ *
25
+ * // Range mode - for bulk copy/paste operations
26
+ * new SelectionPlugin({ mode: 'range' })
27
+ * ```
28
+ *
29
+ * @see [Cell Mode Demo](?path=/story/grid-plugins-selection--default) - Click cells to select
30
+ * @see [Row Mode Demo](?path=/story/grid-plugins-selection--row-mode) - Full row selection
31
+ * @see [Range Mode Demo](?path=/story/grid-plugins-selection--range-mode) - Drag to select ranges
11
32
  */
12
33
  export type SelectionMode = 'cell' | 'row' | 'range';
34
+ /**
35
+ * Mouse event type that triggers selection.
36
+ *
37
+ * - `'click'` - Single click activates selection (default)
38
+ * - `'dblclick'` - Double-click activates selection; single-click only focuses
39
+ *
40
+ * **Note:** Only applies to `'cell'` and `'row'` modes. Range mode uses drag
41
+ * selection (mousedown → mousemove) which is unaffected by this option.
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * // Double-click to select - useful for data entry grids
46
+ * new SelectionPlugin({ mode: 'cell', triggerOn: 'dblclick' })
47
+ * ```
48
+ */
49
+ export type SelectionTrigger = 'click' | 'dblclick';
13
50
  /** Configuration options for the selection plugin */
14
51
  export interface SelectionConfig {
15
52
  /** Selection mode (default: 'cell') */
16
53
  mode: SelectionMode;
54
+ /**
55
+ * Mouse event type that triggers selection (default: 'click').
56
+ *
57
+ * - `'click'` - Single click activates selection
58
+ * - `'dblclick'` - Double-click activates selection; single-click only focuses
59
+ *
60
+ * **Note:** Only applies to `'cell'` and `'row'` modes. Range mode uses drag
61
+ * selection which is unaffected by this option.
62
+ */
63
+ triggerOn?: SelectionTrigger;
17
64
  }
18
65
  /** Internal state managed by the selection plugin */
19
66
  export interface SelectionState {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/selection/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,CAAC;AAErD,qDAAqD;AACrD,MAAM,WAAW,eAAe;IAC9B,uCAAuC;IACvC,IAAI,EAAE,aAAa,CAAC;CACrB;AAED,qDAAqD;AACrD,MAAM,WAAW,cAAc;IAC7B,kCAAkC;IAClC,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACtB,wDAAwD;IACxD,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,iDAAiD;IACjD,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAID,0DAA0D;AAC1D,MAAM,WAAW,iBAAiB;IAChC,yBAAyB;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,uBAAuB;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,0BAA0B;IAC1B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,yDAAyD;AACzD,MAAM,WAAW,SAAS;IACxB,gCAAgC;IAChC,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,8BAA8B;IAC9B,EAAE,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,mDAAmD;IACnD,IAAI,EAAE,aAAa,CAAC;IACpB,iHAAiH;IACjH,MAAM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iB,GAAG,IAAI,CAAC;IACtC,sCAAsC;IACtC,UAAU,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAChD,0CAA0C;IAC1C,UAAU,EAAE,OAAO,CAAC;IACpB,oCAAoC;IACpC,YAAY,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CACnD"}
@@ -1,16 +1,74 @@
1
1
  import { BaseGridPlugin, ScrollEvent } from '../../core/plugin/base-plugin';
2
2
  import { ServerSideConfig, ServerSideDataSource } from './types';
3
3
  /**
4
- * Server-Side Plugin for tbw-grid
4
+ * Server-Side Data Plugin for tbw-grid
5
5
  *
6
- * @example
6
+ * Enables lazy loading of data from a remote server with caching and block-based fetching.
7
+ * Ideal for large datasets where loading all data upfront is impractical.
8
+ *
9
+ * ## Installation
10
+ *
11
+ * ```ts
12
+ * import { ServerSidePlugin } from '@toolbox-web/grid/plugins/server-side';
13
+ * ```
14
+ *
15
+ * ## Configuration Options
16
+ *
17
+ * | Option | Type | Default | Description |
18
+ * |--------|------|---------|-------------|
19
+ * | `pageSize` | `number` | `100` | Rows per block |
20
+ * | `cacheBlockSize` | `number` | `pageSize` | Cache block size |
21
+ * | `maxConcurrentRequests` | `number` | `2` | Max parallel data requests |
22
+ *
23
+ * ## DataSource Interface
24
+ *
25
+ * ```ts
26
+ * interface ServerSideDataSource {
27
+ * getRows(params: GetRowsParams): Promise<GetRowsResult>;
28
+ * }
29
+ * ```
30
+ *
31
+ * ## Programmatic API
32
+ *
33
+ * | Method | Signature | Description |
34
+ * |--------|-----------|-------------|
35
+ * | `setDataSource` | `(ds: ServerSideDataSource) => void` | Set the data source |
36
+ * | `refresh` | `() => void` | Refresh current data |
37
+ * | `clearCache` | `() => void` | Clear all cached blocks |
38
+ *
39
+ * @example Basic Server-Side Loading
7
40
  * ```ts
8
- * const plugin = new ServerSidePlugin({ cacheBlockSize: 100 });
9
- * plugin.setDataSource(myDataSource);
41
+ * import '@toolbox-web/grid';
42
+ * import { ServerSidePlugin } from '@toolbox-web/grid/plugins/server-side';
43
+ *
44
+ * const dataSource = {
45
+ * async getRows(params) {
46
+ * const response = await fetch(
47
+ * `/api/data?start=${params.startRow}&end=${params.endRow}`
48
+ * );
49
+ * const data = await response.json();
50
+ * return { rows: data.rows, totalRowCount: data.total };
51
+ * },
52
+ * };
53
+ *
54
+ * const plugin = new ServerSidePlugin({ pageSize: 50 });
55
+ * grid.gridConfig = {
56
+ * columns: [...],
57
+ * plugins: [plugin],
58
+ * };
59
+ *
60
+ * grid.ready().then(() => plugin.setDataSource(dataSource));
10
61
  * ```
62
+ *
63
+ * @see {@link ServerSideConfig} for configuration options
64
+ * @see {@link ServerSideDataSource} for data source interface
65
+ *
66
+ * @internal Extends BaseGridPlugin
11
67
  */
12
68
  export declare class ServerSidePlugin extends BaseGridPlugin<ServerSideConfig> {
69
+ /** @internal */
13
70
  readonly name = "serverSide";
71
+ /** @internal */
14
72
  protected get defaultConfig(): Partial<ServerSideConfig>;
15
73
  private dataSource;
16
74
  private totalRowCount;
@@ -18,12 +76,15 @@ export declare class ServerSidePlugin extends BaseGridPlugin<ServerSideConfig> {
18
76
  private loadingBlocks;
19
77
  private lastRequestId;
20
78
  private scrollDebounceTimer?;
79
+ /** @internal */
21
80
  detach(): void;
22
81
  /**
23
82
  * Check current viewport and load any missing blocks.
24
83
  */
25
84
  private loadRequiredBlocks;
85
+ /** @internal */
26
86
  processRows(rows: readonly unknown[]): unknown[];
87
+ /** @internal */
27
88
  onScroll(event: ScrollEvent): void;
28
89
  /**
29
90
  * Set the data source for server-side loading.
@@ -1 +1 @@
1
- {"version":3,"file":"ServerSidePlugin.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/server-side/ServerSidePlugin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACH,qBAAa,gBAAiB,SAAQ,cAAc,CAAC,gBAAgB,CAAC;IACpE,gBAAgB;IAChB,QAAQ,CAAC,IAAI,gBAAgB;IAE7B,gBAAgB;IAChB,cAAuB,aAAa,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAMhE;IAGD,OAAO,CAAC,UAAU,CAAqC;IACvD,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,YAAY,CAAgC;IACpD,OAAO,CAAC,aAAa,CAAqB;IAC1C,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,mBAAmB,CAAC,CAAgC;IAK5D,gBAAgB;IACP,MAAM,IAAI,IAAI;IAevB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA0C1B,gBAAgB;IACP,WAAW,CAAC,IAAI,EAAE,SAAS,OAAO,EAAE,GAAG,OAAO,EAAE;IAazD,gBAAgB;IACP,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAkB3C;;;OAGG;IACH,aAAa,CAAC,UAAU,EAAE,oBAAoB,GAAG,IAAI;IAcrD;;OAEG;IACH,OAAO,IAAI,IAAI;IAOf;;OAEG;IACH,UAAU,IAAI,IAAI;IAIlB;;OAEG;IACH,gBAAgB,IAAI,MAAM;IAI1B;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAMtC;;OAEG;IACH,mBAAmB,IAAI,MAAM;CAI9B"}
@@ -1,7 +1,9 @@
1
1
  /**
2
2
  * Server Side Plugin Entry Point
3
3
  * Re-exports plugin class and types for tree-shakeable imports.
4
+ *
5
+ * @module Plugins/Server-Side
4
6
  */
5
7
  export { ServerSidePlugin } from './ServerSidePlugin';
6
- export type { ServerSideConfig, ServerSideDataSource, GetRowsParams, GetRowsResult } from './types';
8
+ export type { GetRowsParams, GetRowsResult, ServerSideConfig, ServerSideDataSource } from './types';
7
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/server-side/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/server-side/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC"}
@@ -25,6 +25,28 @@ class d {
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.
@@ -184,23 +206,6 @@ class d {
184
206
  get gridElement() {
185
207
  return this.grid;
186
208
  }
187
- /**
188
- * Get the render root of the grid for DOM queries.
189
- * @deprecated Use `gridElement` instead. This getter exists only for backward compatibility.
190
- *
191
- * With Shadow DOM removed, the grid element itself is the render root.
192
- * All new code should use `this.gridElement` for DOM queries.
193
- *
194
- * @example
195
- * // OLD (deprecated)
196
- * const rows = this.shadowRoot?.querySelector('.rows');
197
- *
198
- * // NEW (preferred)
199
- * const rows = this.gridElement.querySelector('.rows');
200
- */
201
- get shadowRoot() {
202
- return this.gridElement;
203
- }
204
209
  /**
205
210
  * Get the disconnect signal for event listener cleanup.
206
211
  * This signal is aborted when the grid disconnects from the DOM.
@@ -335,7 +340,9 @@ function g(s, e, t) {
335
340
  }
336
341
  const f = 100;
337
342
  class R extends d {
343
+ /** @internal */
338
344
  name = "serverSide";
345
+ /** @internal */
339
346
  get defaultConfig() {
340
347
  return {
341
348
  pageSize: 100,
@@ -352,6 +359,7 @@ class R extends d {
352
359
  scrollDebounceTimer;
353
360
  // #endregion
354
361
  // #region Lifecycle
362
+ /** @internal */
355
363
  detach() {
356
364
  this.dataSource = null, this.totalRowCount = 0, this.loadedBlocks.clear(), this.loadingBlocks.clear(), this.lastRequestId = 0, this.scrollDebounceTimer && (clearTimeout(this.scrollDebounceTimer), this.scrollDebounceTimer = void 0);
357
365
  }
@@ -376,6 +384,7 @@ class R extends d {
376
384
  }
377
385
  // #endregion
378
386
  // #region Hooks
387
+ /** @internal */
379
388
  processRows(e) {
380
389
  if (!this.dataSource) return [...e];
381
390
  const t = [];
@@ -385,6 +394,7 @@ class R extends d {
385
394
  }
386
395
  return t;
387
396
  }
397
+ /** @internal */
388
398
  onScroll(e) {
389
399
  this.dataSource && (this.loadRequiredBlocks(), this.scrollDebounceTimer && clearTimeout(this.scrollDebounceTimer), this.scrollDebounceTimer = setTimeout(() => {
390
400
  this.loadRequiredBlocks();