@toolbox-web/grid 0.5.0 → 1.0.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 (182) hide show
  1. package/README.md +80 -27
  2. package/all.js +725 -1731
  3. package/all.js.map +1 -1
  4. package/index.js +1431 -2379
  5. package/index.js.map +1 -1
  6. package/lib/core/constants.d.ts +8 -0
  7. package/lib/core/constants.d.ts.map +1 -1
  8. package/lib/core/grid.d.ts +721 -55
  9. package/lib/core/grid.d.ts.map +1 -1
  10. package/lib/core/internal/config-manager.d.ts +3 -7
  11. package/lib/core/internal/config-manager.d.ts.map +1 -1
  12. package/lib/core/internal/dom-builder.d.ts +2 -10
  13. package/lib/core/internal/dom-builder.d.ts.map +1 -1
  14. package/lib/core/internal/event-delegation.d.ts +21 -0
  15. package/lib/core/internal/event-delegation.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 +10 -2
  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.map +1 -1
  25. package/lib/core/plugin/base-plugin.d.ts +2 -15
  26. package/lib/core/plugin/base-plugin.d.ts.map +1 -1
  27. package/lib/core/plugin/types.d.ts +33 -6
  28. package/lib/core/plugin/types.d.ts.map +1 -1
  29. package/lib/core/types.d.ts +411 -68
  30. package/lib/core/types.d.ts.map +1 -1
  31. package/lib/plugins/clipboard/ClipboardPlugin.d.ts +89 -2
  32. package/lib/plugins/clipboard/ClipboardPlugin.d.ts.map +1 -1
  33. package/lib/plugins/clipboard/index.d.ts +2 -0
  34. package/lib/plugins/clipboard/index.d.ts.map +1 -1
  35. package/lib/plugins/clipboard/index.js +24 -35
  36. package/lib/plugins/clipboard/index.js.map +1 -1
  37. package/lib/plugins/column-virtualization/ColumnVirtualizationPlugin.d.ts +57 -2
  38. package/lib/plugins/column-virtualization/ColumnVirtualizationPlugin.d.ts.map +1 -1
  39. package/lib/plugins/column-virtualization/index.d.ts +2 -0
  40. package/lib/plugins/column-virtualization/index.d.ts.map +1 -1
  41. package/lib/plugins/column-virtualization/index.js +7 -17
  42. package/lib/plugins/column-virtualization/index.js.map +1 -1
  43. package/lib/plugins/context-menu/ContextMenuPlugin.d.ts +75 -5
  44. package/lib/plugins/context-menu/ContextMenuPlugin.d.ts.map +1 -1
  45. package/lib/plugins/context-menu/index.d.ts +3 -1
  46. package/lib/plugins/context-menu/index.d.ts.map +1 -1
  47. package/lib/plugins/context-menu/index.js +15 -27
  48. package/lib/plugins/context-menu/index.js.map +1 -1
  49. package/lib/plugins/editing/EditingPlugin.d.ts +101 -9
  50. package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
  51. package/lib/plugins/editing/editors.d.ts +9 -1
  52. package/lib/plugins/editing/editors.d.ts.map +1 -1
  53. package/lib/plugins/editing/index.d.ts +4 -2
  54. package/lib/plugins/editing/index.d.ts.map +1 -1
  55. package/lib/plugins/editing/index.js +412 -279
  56. package/lib/plugins/editing/index.js.map +1 -1
  57. package/lib/plugins/editing/types.d.ts +88 -0
  58. package/lib/plugins/editing/types.d.ts.map +1 -1
  59. package/lib/plugins/export/ExportPlugin.d.ts +73 -7
  60. package/lib/plugins/export/ExportPlugin.d.ts.map +1 -1
  61. package/lib/plugins/export/index.d.ts +2 -0
  62. package/lib/plugins/export/index.d.ts.map +1 -1
  63. package/lib/plugins/export/index.js +4 -19
  64. package/lib/plugins/export/index.js.map +1 -1
  65. package/lib/plugins/filtering/FilteringPlugin.d.ts +98 -2
  66. package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -1
  67. package/lib/plugins/filtering/index.d.ts +2 -0
  68. package/lib/plugins/filtering/index.d.ts.map +1 -1
  69. package/lib/plugins/filtering/index.js +50 -58
  70. package/lib/plugins/filtering/index.js.map +1 -1
  71. package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts +80 -6
  72. package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts.map +1 -1
  73. package/lib/plugins/grouping-columns/index.d.ts +2 -0
  74. package/lib/plugins/grouping-columns/index.d.ts.map +1 -1
  75. package/lib/plugins/grouping-columns/index.js +10 -21
  76. package/lib/plugins/grouping-columns/index.js.map +1 -1
  77. package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts +81 -5
  78. package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts.map +1 -1
  79. package/lib/plugins/grouping-rows/index.d.ts +3 -1
  80. package/lib/plugins/grouping-rows/index.d.ts.map +1 -1
  81. package/lib/plugins/grouping-rows/index.js +13 -21
  82. package/lib/plugins/grouping-rows/index.js.map +1 -1
  83. package/lib/plugins/master-detail/MasterDetailPlugin.d.ts +90 -5
  84. package/lib/plugins/master-detail/MasterDetailPlugin.d.ts.map +1 -1
  85. package/lib/plugins/master-detail/index.d.ts +2 -0
  86. package/lib/plugins/master-detail/index.d.ts.map +1 -1
  87. package/lib/plugins/master-detail/index.js +11 -17
  88. package/lib/plugins/master-detail/index.js.map +1 -1
  89. package/lib/plugins/multi-sort/MultiSortPlugin.d.ts +83 -2
  90. package/lib/plugins/multi-sort/MultiSortPlugin.d.ts.map +1 -1
  91. package/lib/plugins/multi-sort/index.d.ts +2 -0
  92. package/lib/plugins/multi-sort/index.d.ts.map +1 -1
  93. package/lib/plugins/multi-sort/index.js +11 -19
  94. package/lib/plugins/multi-sort/index.js.map +1 -1
  95. package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts +61 -2
  96. package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts.map +1 -1
  97. package/lib/plugins/pinned-columns/index.d.ts +3 -1
  98. package/lib/plugins/pinned-columns/index.d.ts.map +1 -1
  99. package/lib/plugins/pinned-columns/index.js +7 -17
  100. package/lib/plugins/pinned-columns/index.js.map +1 -1
  101. package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts +71 -10
  102. package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts.map +1 -1
  103. package/lib/plugins/pinned-rows/index.d.ts +3 -1
  104. package/lib/plugins/pinned-rows/index.d.ts.map +1 -1
  105. package/lib/plugins/pinned-rows/index.js +5 -17
  106. package/lib/plugins/pinned-rows/index.js.map +1 -1
  107. package/lib/plugins/pivot/PivotPlugin.d.ts +81 -4
  108. package/lib/plugins/pivot/PivotPlugin.d.ts.map +1 -1
  109. package/lib/plugins/pivot/index.d.ts +2 -0
  110. package/lib/plugins/pivot/index.d.ts.map +1 -1
  111. package/lib/plugins/pivot/index.js +10 -17
  112. package/lib/plugins/pivot/index.js.map +1 -1
  113. package/lib/plugins/reorder/ReorderPlugin.d.ts +71 -3
  114. package/lib/plugins/reorder/ReorderPlugin.d.ts.map +1 -1
  115. package/lib/plugins/reorder/index.d.ts +2 -0
  116. package/lib/plugins/reorder/index.d.ts.map +1 -1
  117. package/lib/plugins/reorder/index.js +8 -18
  118. package/lib/plugins/reorder/index.js.map +1 -1
  119. package/lib/plugins/reorder/types.d.ts +0 -5
  120. package/lib/plugins/reorder/types.d.ts.map +1 -1
  121. package/lib/plugins/selection/SelectionPlugin.d.ts +84 -20
  122. package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
  123. package/lib/plugins/selection/index.d.ts +2 -1
  124. package/lib/plugins/selection/index.d.ts.map +1 -1
  125. package/lib/plugins/selection/index.js +70 -131
  126. package/lib/plugins/selection/index.js.map +1 -1
  127. package/lib/plugins/selection/types.d.ts +25 -4
  128. package/lib/plugins/selection/types.d.ts.map +1 -1
  129. package/lib/plugins/server-side/ServerSidePlugin.d.ts +65 -4
  130. package/lib/plugins/server-side/ServerSidePlugin.d.ts.map +1 -1
  131. package/lib/plugins/server-side/index.d.ts +3 -1
  132. package/lib/plugins/server-side/index.d.ts.map +1 -1
  133. package/lib/plugins/server-side/index.js +5 -17
  134. package/lib/plugins/server-side/index.js.map +1 -1
  135. package/lib/plugins/tree/TreePlugin.d.ts +89 -2
  136. package/lib/plugins/tree/TreePlugin.d.ts.map +1 -1
  137. package/lib/plugins/tree/index.d.ts +3 -2
  138. package/lib/plugins/tree/index.d.ts.map +1 -1
  139. package/lib/plugins/tree/index.js +59 -94
  140. package/lib/plugins/tree/index.js.map +1 -1
  141. package/lib/plugins/undo-redo/UndoRedoPlugin.d.ts +66 -3
  142. package/lib/plugins/undo-redo/UndoRedoPlugin.d.ts.map +1 -1
  143. package/lib/plugins/undo-redo/index.d.ts +3 -1
  144. package/lib/plugins/undo-redo/index.d.ts.map +1 -1
  145. package/lib/plugins/undo-redo/index.js +5 -17
  146. package/lib/plugins/undo-redo/index.js.map +1 -1
  147. package/lib/plugins/visibility/VisibilityPlugin.d.ts +86 -2
  148. package/lib/plugins/visibility/VisibilityPlugin.d.ts.map +1 -1
  149. package/lib/plugins/visibility/index.d.ts +2 -0
  150. package/lib/plugins/visibility/index.d.ts.map +1 -1
  151. package/lib/plugins/visibility/index.js +6 -17
  152. package/lib/plugins/visibility/index.js.map +1 -1
  153. package/package.json +6 -6
  154. package/public.d.ts +72 -2
  155. package/public.d.ts.map +1 -1
  156. package/umd/grid.all.umd.js +16 -16
  157. package/umd/grid.all.umd.js.map +1 -1
  158. package/umd/grid.umd.js +9 -9
  159. package/umd/grid.umd.js.map +1 -1
  160. package/umd/plugins/clipboard.umd.js.map +1 -1
  161. package/umd/plugins/column-virtualization.umd.js.map +1 -1
  162. package/umd/plugins/context-menu.umd.js.map +1 -1
  163. package/umd/plugins/editing.umd.js +1 -1
  164. package/umd/plugins/editing.umd.js.map +1 -1
  165. package/umd/plugins/export.umd.js.map +1 -1
  166. package/umd/plugins/filtering.umd.js.map +1 -1
  167. package/umd/plugins/grouping-columns.umd.js.map +1 -1
  168. package/umd/plugins/grouping-rows.umd.js.map +1 -1
  169. package/umd/plugins/master-detail.umd.js.map +1 -1
  170. package/umd/plugins/multi-sort.umd.js.map +1 -1
  171. package/umd/plugins/pinned-columns.umd.js.map +1 -1
  172. package/umd/plugins/pinned-rows.umd.js.map +1 -1
  173. package/umd/plugins/pivot.umd.js.map +1 -1
  174. package/umd/plugins/reorder.umd.js +1 -1
  175. package/umd/plugins/reorder.umd.js.map +1 -1
  176. package/umd/plugins/selection.umd.js +1 -1
  177. package/umd/plugins/selection.umd.js.map +1 -1
  178. package/umd/plugins/server-side.umd.js.map +1 -1
  179. package/umd/plugins/tree.umd.js +1 -1
  180. package/umd/plugins/tree.umd.js.map +1 -1
  181. package/umd/plugins/undo-redo.umd.js.map +1 -1
  182. package/umd/plugins/visibility.umd.js.map +1 -1
@@ -16,19 +16,89 @@ export interface GroupState {
16
16
  /**
17
17
  * Row Grouping Plugin for tbw-grid
18
18
  *
19
- * @example
19
+ * Organizes rows into collapsible hierarchical groups. Perfect for organizing data
20
+ * by category, department, status, or any other dimension—or even multiple dimensions
21
+ * for nested grouping. Includes aggregation support for summarizing group data.
22
+ *
23
+ * ## Installation
24
+ *
25
+ * ```ts
26
+ * import { GroupingRowsPlugin } from '@toolbox-web/grid/plugins/grouping-rows';
27
+ * ```
28
+ *
29
+ * ## Configuration Options
30
+ *
31
+ * | Option | Type | Default | Description |
32
+ * |--------|------|---------|-------------|
33
+ * | `groupOn` | `(row) => string[]` | - | Callback returning group path array |
34
+ * | `defaultExpanded` | `boolean` | `false` | Start all groups expanded |
35
+ * | `showRowCount` | `boolean` | `true` | Show row count in group header |
36
+ * | `indentWidth` | `number` | `20` | Indentation per level (pixels) |
37
+ * | `fullWidth` | `boolean` | `true` | Group row spans full width |
38
+ * | `animation` | `false \| 'slide' \| 'fade'` | `'slide'` | Expand/collapse animation |
39
+ *
40
+ * ## Programmatic API
41
+ *
42
+ * | Method | Signature | Description |
43
+ * |--------|-----------|-------------|
44
+ * | `expandGroup` | `(path: string[]) => void` | Expand a specific group |
45
+ * | `collapseGroup` | `(path: string[]) => void` | Collapse a specific group |
46
+ * | `expandAll` | `() => void` | Expand all groups |
47
+ * | `collapseAll` | `() => void` | Collapse all groups |
48
+ * | `isGroupExpanded` | `(path: string[]) => boolean` | Check if group is expanded |
49
+ * | `getGroupState` | `() => GroupState` | Get current grouping state |
50
+ *
51
+ * ## CSS Custom Properties
52
+ *
53
+ * | Property | Default | Description |
54
+ * |----------|---------|-------------|
55
+ * | `--tbw-group-indent-width` | `1.25em` | Indentation per group level |
56
+ * | `--tbw-grouping-rows-bg` | `var(--tbw-color-panel-bg)` | Group row background |
57
+ * | `--tbw-grouping-rows-count-color` | `var(--tbw-color-fg-muted)` | Count badge color |
58
+ * | `--tbw-animation-duration` | `200ms` | Expand/collapse animation |
59
+ *
60
+ * @example Single-Level Grouping by Department
61
+ * ```ts
62
+ * import '@toolbox-web/grid';
63
+ * import { GroupingRowsPlugin } from '@toolbox-web/grid/plugins/grouping-rows';
64
+ *
65
+ * const grid = document.querySelector('tbw-grid');
66
+ * grid.gridConfig = {
67
+ * columns: [
68
+ * { field: 'name', header: 'Employee' },
69
+ * { field: 'department', header: 'Department' },
70
+ * { field: 'salary', header: 'Salary', type: 'currency' },
71
+ * ],
72
+ * plugins: [
73
+ * new GroupingRowsPlugin({
74
+ * groupOn: (row) => [row.department],
75
+ * showRowCount: true,
76
+ * defaultExpanded: false,
77
+ * }),
78
+ * ],
79
+ * };
80
+ * ```
81
+ *
82
+ * @example Multi-Level Grouping
20
83
  * ```ts
21
84
  * new GroupingRowsPlugin({
22
- * enabled: true,
23
- * groupOn: (row) => row.category,
24
- * defaultExpanded: false,
25
- * showRowCount: true,
85
+ * groupOn: (row) => [row.region, row.department, row.team],
86
+ * indentWidth: 24,
87
+ * animation: 'slide',
26
88
  * })
27
89
  * ```
90
+ *
91
+ * @see {@link GroupingRowsConfig} for all configuration options
92
+ * @see {@link GroupState} for the group state structure
93
+ *
94
+ * @internal Extends BaseGridPlugin
28
95
  */
29
96
  export declare class GroupingRowsPlugin extends BaseGridPlugin<GroupingRowsConfig> {
97
+ /** @internal */
30
98
  readonly name = "groupingRows";
99
+ /** @internal */
31
100
  readonly styles: string;
101
+ /** @internal */
32
102
  protected get defaultConfig(): Partial<GroupingRowsConfig>;
33
103
  private expandedKeys;
34
104
  private flattenedRows;
@@ -40,19 +110,25 @@ export declare class GroupingRowsPlugin extends BaseGridPlugin<GroupingRowsConfi
40
110
  * Uses base class isAnimationEnabled to respect grid-level settings.
41
111
  */
42
112
  private get animationStyle();
113
+ /** @internal */
43
114
  detach(): void;
44
115
  /**
45
116
  * Auto-detect grouping configuration from grid config.
46
117
  * Called by plugin system to determine if plugin should activate.
47
118
  */
48
119
  static detect(rows: readonly any[], config: any): boolean;
120
+ /** @internal */
49
121
  processRows(rows: readonly any[]): any[];
122
+ /** @internal */
50
123
  onCellClick(event: CellClickEvent): boolean | void;
124
+ /** @internal */
51
125
  onKeyDown(event: KeyboardEvent): boolean | void;
52
126
  /**
53
127
  * Render a row. Returns true if we handled the row (group row), false otherwise.
128
+ * @internal
54
129
  */
55
130
  renderRow(row: any, rowEl: HTMLElement, _rowIndex: number): boolean;
131
+ /** @internal */
56
132
  afterRender(): void;
57
133
  /**
58
134
  * Create a toggle button for expanding/collapsing a group.
@@ -1 +1 @@
1
- {"version":3,"file":"GroupingRowsPlugin.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/grouping-rows/GroupingRowsPlugin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAY/E,OAAO,KAAK,EAEV,kBAAkB,EAGlB,SAAS,EACV,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,2CAA2C;IAC3C,QAAQ,EAAE,OAAO,CAAC;IAClB,gCAAgC;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,6BAA6B;IAC7B,WAAW,EAAE,MAAM,CAAC;IAC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,OAAO;IAIhC;;;OAGG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAOzB;;;OAGG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAS3B;;;OAGG;IACH,aAAa,IAAI,UAAU;IAU3B;;;OAGG;IACH,WAAW,IAAI,MAAM;IAIrB;;;OAGG;IACH,aAAa,IAAI,IAAI;IAIrB;;;OAGG;IACH,iBAAiB,IAAI,MAAM,EAAE;IAI7B;;;OAGG;IACH,gBAAgB,IAAI,SAAS,EAAE;IAI/B;;;OAGG;IACH,gBAAgB,IAAI,OAAO;IAI3B;;;OAGG;IACH,UAAU,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,GAAG,KAAK,CAAC,GAAG,SAAS,GAAG,IAAI;CAK7E"}
@@ -1,7 +1,9 @@
1
1
  /**
2
2
  * Grouping Rows Plugin Entry Point
3
3
  * Re-exports plugin class and types for tree-shakeable imports.
4
+ *
5
+ * @module Plugins/Row Grouping
4
6
  */
5
7
  export { GroupingRowsPlugin } from './GroupingRowsPlugin';
6
- export type { GroupingRowsConfig, GroupRowRenderParams } from './types';
8
+ export type { GroupRowRenderParams, GroupingRowsConfig } 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/grouping-rows/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/grouping-rows/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC"}
@@ -184,23 +184,6 @@ class R {
184
184
  get gridElement() {
185
185
  return this.grid;
186
186
  }
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
187
  /**
205
188
  * Get the disconnect signal for event listener cleanup.
206
189
  * This signal is aborted when the grid disconnects from the DOM.
@@ -400,13 +383,13 @@ function k(n, e) {
400
383
  const t = new Set(n);
401
384
  return t.has(e) ? t.delete(e) : t.add(e), t;
402
385
  }
403
- function E(n) {
386
+ function S(n) {
404
387
  const e = /* @__PURE__ */ new Set();
405
388
  for (const t of n)
406
389
  t.kind === "group" && e.add(t.key);
407
390
  return e;
408
391
  }
409
- function S() {
392
+ function E() {
410
393
  return /* @__PURE__ */ new Set();
411
394
  }
412
395
  function K(n) {
@@ -414,8 +397,11 @@ function K(n) {
414
397
  }
415
398
  const G = "@layer tbw-plugins{.group-row{display:grid;grid-template-columns:var(--tbw-column-template);background:var(--tbw-grouping-rows-bg, var(--tbw-color-panel-bg));font-weight:500;border-bottom:var(--tbw-row-divider);min-height:var(--tbw-row-height)}.group-row .cell{display:flex;align-items:center;padding:var(--tbw-cell-padding, .125rem .5rem)}.group-row:hover{background:var(--tbw-grouping-rows-bg-hover, var(--tbw-color-row-hover))}.group-toggle{cursor:pointer;-webkit-user-select:none;user-select:none;display:inline-flex;align-items:center;justify-content:center;width:var(--tbw-toggle-size, 1.25rem);height:var(--tbw-toggle-size, 1.25rem);margin-right:.25rem;background:none;border:0;font:inherit}.group-toggle:hover{background:var(--tbw-grouping-rows-toggle-hover, var(--tbw-color-row-hover));border-radius:var(--tbw-border-radius, .125rem)}.group-label{display:inline-flex;align-items:center;gap:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem))}.group-count{color:var(--tbw-grouping-rows-count-color, var(--tbw-color-fg-muted));font-size:var(--tbw-font-size-xs, .85em);font-weight:400}.group-row{padding-left:calc(var(--tbw-group-depth, 0) * var(--tbw-group-indent-width, 1.25em))}.data-grid-row.tbw-group-slide-in{animation:tbw-group-slide-in var(--tbw-animation-duration, .2s) var(--tbw-animation-easing, ease-out) forwards}@keyframes tbw-group-slide-in{0%{opacity:0;transform:translate(-8px)}to{opacity:1;transform:translate(0)}}.data-grid-row.tbw-group-fade-in{animation:tbw-group-fade-in var(--tbw-animation-duration, .2s) var(--tbw-animation-easing, ease-out) forwards}@keyframes tbw-group-fade-in{0%{opacity:0}to{opacity:1}}}";
416
399
  class T extends R {
400
+ /** @internal */
417
401
  name = "groupingRows";
402
+ /** @internal */
418
403
  styles = G;
404
+ /** @internal */
419
405
  get defaultConfig() {
420
406
  return {
421
407
  defaultExpanded: !1,
@@ -442,6 +428,7 @@ class T extends R {
442
428
  }
443
429
  // #endregion
444
430
  // #region Lifecycle
431
+ /** @internal */
445
432
  detach() {
446
433
  this.expandedKeys.clear(), this.flattenedRows = [], this.isActive = !1, this.previousVisibleKeys.clear(), this.keysToAnimate.clear();
447
434
  }
@@ -454,6 +441,7 @@ class T extends R {
454
441
  static detect(e, t) {
455
442
  return typeof t?.groupOn == "function" || typeof t?.enableRowGrouping == "boolean";
456
443
  }
444
+ /** @internal */
457
445
  processRows(e) {
458
446
  const t = this.config;
459
447
  if (typeof t.groupOn != "function")
@@ -482,11 +470,13 @@ class T extends R {
482
470
  __groupRowCount: K(i)
483
471
  } : i.row);
484
472
  }
473
+ /** @internal */
485
474
  onCellClick(e) {
486
475
  const t = e.row;
487
476
  if (t?.__isGroupRow && e.originalEvent.target?.closest(".group-toggle"))
488
477
  return this.toggle(t.__groupKey), !0;
489
478
  }
479
+ /** @internal */
490
480
  onKeyDown(e) {
491
481
  if (e.key !== " ") return;
492
482
  const t = this.grid._focusRow, r = this.rows[t];
@@ -495,6 +485,7 @@ class T extends R {
495
485
  }
496
486
  /**
497
487
  * Render a row. Returns true if we handled the row (group row), false otherwise.
488
+ * @internal
498
489
  */
499
490
  renderRow(e, t, r) {
500
491
  if (!e?.__isGroupRow)
@@ -519,6 +510,7 @@ class T extends R {
519
510
  };
520
511
  return t.className = "data-grid-row group-row", t.__isCustomRow = !0, t.setAttribute("data-group-depth", String(e.__groupDepth)), t.setAttribute("role", "row"), t.setAttribute("aria-expanded", String(e.__groupExpanded)), t.style.setProperty("--tbw-group-depth", String(e.__groupDepth || 0)), s.indentWidth !== void 0 && t.style.setProperty("--tbw-group-indent-width", `${s.indentWidth}px`), t.innerHTML = "", s.fullWidth !== !1 ? this.renderFullWidthGroupRow(e, t, i) : this.renderPerColumnGroupRow(e, t, i), !0;
521
512
  }
513
+ /** @internal */
522
514
  afterRender() {
523
515
  const e = this.animationStyle;
524
516
  if (e === !1 || this.keysToAnimate.size === 0) return;
@@ -598,13 +590,13 @@ class T extends R {
598
590
  * Expand all groups.
599
591
  */
600
592
  expandAll() {
601
- this.expandedKeys = E(this.flattenedRows), this.requestRender();
593
+ this.expandedKeys = S(this.flattenedRows), this.requestRender();
602
594
  }
603
595
  /**
604
596
  * Collapse all groups.
605
597
  */
606
598
  collapseAll() {
607
- this.expandedKeys = S(), this.requestRender();
599
+ this.expandedKeys = E(), this.requestRender();
608
600
  }
609
601
  /**
610
602
  * Toggle expansion of a specific group.