@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.
- package/README.md +79 -26
- package/all.d.ts +1 -0
- package/all.d.ts.map +1 -1
- package/all.js +1899 -2696
- package/all.js.map +1 -1
- package/index.js +1498 -2489
- package/index.js.map +1 -1
- package/lib/core/constants.d.ts +8 -0
- package/lib/core/constants.d.ts.map +1 -1
- package/lib/core/grid.d.ts +704 -55
- package/lib/core/grid.d.ts.map +1 -1
- package/lib/core/internal/config-manager.d.ts +3 -7
- package/lib/core/internal/config-manager.d.ts.map +1 -1
- package/lib/core/internal/dom-builder.d.ts +2 -10
- package/lib/core/internal/dom-builder.d.ts.map +1 -1
- package/lib/core/internal/inference.d.ts.map +1 -1
- package/lib/core/internal/keyboard.d.ts.map +1 -1
- package/lib/core/internal/render-scheduler.d.ts +2 -0
- package/lib/core/internal/render-scheduler.d.ts.map +1 -1
- package/lib/core/internal/rows.d.ts +9 -1
- package/lib/core/internal/rows.d.ts.map +1 -1
- package/lib/core/internal/shell.d.ts +41 -41
- package/lib/core/internal/shell.d.ts.map +1 -1
- package/lib/core/internal/validate-config.d.ts +10 -0
- package/lib/core/internal/validate-config.d.ts.map +1 -1
- package/lib/core/plugin/base-plugin.d.ts +103 -15
- package/lib/core/plugin/base-plugin.d.ts.map +1 -1
- package/lib/core/plugin/index.d.ts +1 -1
- package/lib/core/plugin/index.d.ts.map +1 -1
- package/lib/core/plugin/types.d.ts +33 -6
- package/lib/core/plugin/types.d.ts.map +1 -1
- package/lib/core/types.d.ts +376 -68
- package/lib/core/types.d.ts.map +1 -1
- package/lib/plugins/clipboard/ClipboardPlugin.d.ts +89 -2
- package/lib/plugins/clipboard/ClipboardPlugin.d.ts.map +1 -1
- package/lib/plugins/clipboard/index.d.ts +2 -0
- package/lib/plugins/clipboard/index.d.ts.map +1 -1
- package/lib/plugins/clipboard/index.js +46 -35
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/column-virtualization/ColumnVirtualizationPlugin.d.ts +57 -2
- package/lib/plugins/column-virtualization/ColumnVirtualizationPlugin.d.ts.map +1 -1
- package/lib/plugins/column-virtualization/index.d.ts +2 -0
- package/lib/plugins/column-virtualization/index.d.ts.map +1 -1
- package/lib/plugins/column-virtualization/index.js +55 -43
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/context-menu/ContextMenuPlugin.d.ts +75 -5
- package/lib/plugins/context-menu/ContextMenuPlugin.d.ts.map +1 -1
- package/lib/plugins/context-menu/index.d.ts +3 -1
- package/lib/plugins/context-menu/index.d.ts.map +1 -1
- package/lib/plugins/context-menu/index.js +76 -66
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/editing/EditingPlugin.d.ts +107 -10
- package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
- package/lib/plugins/editing/editors.d.ts +9 -1
- package/lib/plugins/editing/editors.d.ts.map +1 -1
- package/lib/plugins/editing/index.d.ts +4 -2
- package/lib/plugins/editing/index.d.ts.map +1 -1
- package/lib/plugins/editing/index.js +458 -279
- package/lib/plugins/editing/index.js.map +1 -1
- package/lib/plugins/editing/types.d.ts +88 -0
- package/lib/plugins/editing/types.d.ts.map +1 -1
- package/lib/plugins/export/ExportPlugin.d.ts +73 -7
- package/lib/plugins/export/ExportPlugin.d.ts.map +1 -1
- package/lib/plugins/export/index.d.ts +2 -0
- package/lib/plugins/export/index.d.ts.map +1 -1
- package/lib/plugins/export/index.js +40 -33
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/FilteringPlugin.d.ts +98 -2
- package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -1
- package/lib/plugins/filtering/index.d.ts +2 -0
- package/lib/plugins/filtering/index.d.ts.map +1 -1
- package/lib/plugins/filtering/index.js +31 -17
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts +86 -7
- package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts.map +1 -1
- package/lib/plugins/grouping-columns/index.d.ts +2 -0
- package/lib/plugins/grouping-columns/index.d.ts.map +1 -1
- package/lib/plugins/grouping-columns/index.js +57 -27
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts +81 -5
- package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts.map +1 -1
- package/lib/plugins/grouping-rows/index.d.ts +3 -1
- package/lib/plugins/grouping-rows/index.d.ts.map +1 -1
- package/lib/plugins/grouping-rows/index.js +35 -21
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/master-detail/MasterDetailPlugin.d.ts +90 -5
- package/lib/plugins/master-detail/MasterDetailPlugin.d.ts.map +1 -1
- package/lib/plugins/master-detail/index.d.ts +2 -0
- package/lib/plugins/master-detail/index.d.ts.map +1 -1
- package/lib/plugins/master-detail/index.js +33 -17
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/multi-sort/MultiSortPlugin.d.ts +83 -2
- package/lib/plugins/multi-sort/MultiSortPlugin.d.ts.map +1 -1
- package/lib/plugins/multi-sort/index.d.ts +2 -0
- package/lib/plugins/multi-sort/index.d.ts.map +1 -1
- package/lib/plugins/multi-sort/index.js +33 -19
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts +67 -3
- package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts.map +1 -1
- package/lib/plugins/pinned-columns/index.d.ts +3 -1
- package/lib/plugins/pinned-columns/index.d.ts.map +1 -1
- package/lib/plugins/pinned-columns/index.js +43 -17
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts +71 -10
- package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts.map +1 -1
- package/lib/plugins/pinned-rows/index.d.ts +3 -1
- package/lib/plugins/pinned-rows/index.d.ts.map +1 -1
- package/lib/plugins/pinned-rows/index.js +27 -17
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pivot/PivotPlugin.d.ts +81 -4
- package/lib/plugins/pivot/PivotPlugin.d.ts.map +1 -1
- package/lib/plugins/pivot/index.d.ts +2 -0
- package/lib/plugins/pivot/index.d.ts.map +1 -1
- package/lib/plugins/pivot/index.js +32 -17
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/reorder/ReorderPlugin.d.ts +71 -3
- package/lib/plugins/reorder/ReorderPlugin.d.ts.map +1 -1
- package/lib/plugins/reorder/index.d.ts +2 -0
- package/lib/plugins/reorder/index.d.ts.map +1 -1
- package/lib/plugins/reorder/index.js +30 -18
- package/lib/plugins/reorder/index.js.map +1 -1
- package/lib/plugins/reorder/types.d.ts +0 -5
- package/lib/plugins/reorder/types.d.ts.map +1 -1
- package/lib/plugins/responsive/ResponsivePlugin.d.ts +123 -0
- package/lib/plugins/responsive/ResponsivePlugin.d.ts.map +1 -0
- package/lib/plugins/responsive/index.d.ts +11 -0
- package/lib/plugins/responsive/index.d.ts.map +1 -0
- package/lib/plugins/responsive/index.js +589 -0
- package/lib/plugins/responsive/index.js.map +1 -0
- package/lib/plugins/responsive/types.d.ts +133 -0
- package/lib/plugins/responsive/types.d.ts.map +1 -0
- package/lib/plugins/selection/SelectionPlugin.d.ts +90 -21
- package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
- package/lib/plugins/selection/index.d.ts +3 -2
- package/lib/plugins/selection/index.d.ts.map +1 -1
- package/lib/plugins/selection/index.js +125 -144
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/selection/types.d.ts +51 -4
- package/lib/plugins/selection/types.d.ts.map +1 -1
- package/lib/plugins/server-side/ServerSidePlugin.d.ts +65 -4
- package/lib/plugins/server-side/ServerSidePlugin.d.ts.map +1 -1
- package/lib/plugins/server-side/index.d.ts +3 -1
- package/lib/plugins/server-side/index.d.ts.map +1 -1
- package/lib/plugins/server-side/index.js +27 -17
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/tree/TreePlugin.d.ts +89 -2
- package/lib/plugins/tree/TreePlugin.d.ts.map +1 -1
- package/lib/plugins/tree/index.d.ts +3 -2
- package/lib/plugins/tree/index.d.ts.map +1 -1
- package/lib/plugins/tree/index.js +81 -94
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/undo-redo/UndoRedoPlugin.d.ts +66 -3
- package/lib/plugins/undo-redo/UndoRedoPlugin.d.ts.map +1 -1
- package/lib/plugins/undo-redo/index.d.ts +3 -1
- package/lib/plugins/undo-redo/index.d.ts.map +1 -1
- package/lib/plugins/undo-redo/index.js +32 -22
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/visibility/VisibilityPlugin.d.ts +86 -2
- package/lib/plugins/visibility/VisibilityPlugin.d.ts.map +1 -1
- package/lib/plugins/visibility/index.d.ts +2 -0
- package/lib/plugins/visibility/index.d.ts.map +1 -1
- package/lib/plugins/visibility/index.js +28 -17
- package/lib/plugins/visibility/index.js.map +1 -1
- package/package.json +1 -1
- package/public.d.ts +30 -2
- package/public.d.ts.map +1 -1
- package/umd/grid.all.umd.js +31 -25
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +21 -17
- package/umd/grid.umd.js.map +1 -1
- package/umd/plugins/clipboard.umd.js.map +1 -1
- package/umd/plugins/column-virtualization.umd.js.map +1 -1
- package/umd/plugins/context-menu.umd.js.map +1 -1
- package/umd/plugins/editing.umd.js +1 -1
- package/umd/plugins/editing.umd.js.map +1 -1
- package/umd/plugins/export.umd.js.map +1 -1
- package/umd/plugins/filtering.umd.js.map +1 -1
- package/umd/plugins/grouping-columns.umd.js +1 -1
- package/umd/plugins/grouping-columns.umd.js.map +1 -1
- package/umd/plugins/grouping-rows.umd.js.map +1 -1
- package/umd/plugins/master-detail.umd.js.map +1 -1
- package/umd/plugins/multi-sort.umd.js.map +1 -1
- package/umd/plugins/pinned-columns.umd.js +1 -1
- package/umd/plugins/pinned-columns.umd.js.map +1 -1
- package/umd/plugins/pinned-rows.umd.js.map +1 -1
- package/umd/plugins/pivot.umd.js.map +1 -1
- package/umd/plugins/reorder.umd.js +1 -1
- package/umd/plugins/reorder.umd.js.map +1 -1
- package/umd/plugins/responsive.umd.js +2 -0
- package/umd/plugins/responsive.umd.js.map +1 -0
- package/umd/plugins/selection.umd.js +3 -1
- package/umd/plugins/selection.umd.js.map +1 -1
- package/umd/plugins/server-side.umd.js.map +1 -1
- package/umd/plugins/tree.umd.js +1 -1
- package/umd/plugins/tree.umd.js.map +1 -1
- package/umd/plugins/undo-redo.umd.js.map +1 -1
- 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
|
-
*
|
|
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
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
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;IACpB,mCAAmC;IACnC,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED
|
|
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;IACpB,mCAAmC;IACnC,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AACH,qBAAa,kBAAmB,SAAQ,cAAc,CAAC,kBAAkB,CAAC;IACxE,gBAAgB;IAChB,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,gBAAgB;IAChB,SAAkB,MAAM,SAAU;IAElC,gBAAgB;IAChB,cAAuB,aAAa,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAQlE;IAGD,OAAO,CAAC,YAAY,CAA0B;IAC9C,OAAO,CAAC,aAAa,CAAmB;IACxC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,mBAAmB,CAAqB;IAChD,OAAO,CAAC,aAAa,CAAqB;IAK1C;;;OAGG;IACH,OAAO,KAAK,cAAc,GAGzB;IAMD,gBAAgB;IACP,MAAM,IAAI,IAAI;IAWvB;;;OAGG;IACH,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,EAAE,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO;IAIzD,gBAAgB;IACP,WAAW,CAAC,IAAI,EAAE,SAAS,GAAG,EAAE,GAAG,GAAG,EAAE;IA2DjD,gBAAgB;IACP,WAAW,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,GAAG,IAAI;IAa3D,gBAAgB;IACP,SAAS,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,GAAG,IAAI;IAkBxD;;;OAGG;IACM,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO;IAkE5E,gBAAgB;IACP,WAAW,IAAI,IAAI;IAyB5B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAa1B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,uBAAuB;IA8B/B,OAAO,CAAC,uBAAuB;IAsE/B;;OAEG;IACH,SAAS,IAAI,IAAI;IAKjB;;OAEG;IACH,WAAW,IAAI,IAAI;IAKnB;;;OAGG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAgBzB;;;;OAIG;IACH,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,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 {
|
|
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
|
|
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"}
|
|
@@ -25,6 +25,28 @@ class R {
|
|
|
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 R {
|
|
|
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.
|
|
@@ -400,13 +405,13 @@ function k(n, e) {
|
|
|
400
405
|
const t = new Set(n);
|
|
401
406
|
return t.has(e) ? t.delete(e) : t.add(e), t;
|
|
402
407
|
}
|
|
403
|
-
function
|
|
408
|
+
function S(n) {
|
|
404
409
|
const e = /* @__PURE__ */ new Set();
|
|
405
410
|
for (const t of n)
|
|
406
411
|
t.kind === "group" && e.add(t.key);
|
|
407
412
|
return e;
|
|
408
413
|
}
|
|
409
|
-
function
|
|
414
|
+
function E() {
|
|
410
415
|
return /* @__PURE__ */ new Set();
|
|
411
416
|
}
|
|
412
417
|
function K(n) {
|
|
@@ -414,8 +419,11 @@ function K(n) {
|
|
|
414
419
|
}
|
|
415
420
|
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
421
|
class T extends R {
|
|
422
|
+
/** @internal */
|
|
417
423
|
name = "groupingRows";
|
|
424
|
+
/** @internal */
|
|
418
425
|
styles = G;
|
|
426
|
+
/** @internal */
|
|
419
427
|
get defaultConfig() {
|
|
420
428
|
return {
|
|
421
429
|
defaultExpanded: !1,
|
|
@@ -442,6 +450,7 @@ class T extends R {
|
|
|
442
450
|
}
|
|
443
451
|
// #endregion
|
|
444
452
|
// #region Lifecycle
|
|
453
|
+
/** @internal */
|
|
445
454
|
detach() {
|
|
446
455
|
this.expandedKeys.clear(), this.flattenedRows = [], this.isActive = !1, this.previousVisibleKeys.clear(), this.keysToAnimate.clear();
|
|
447
456
|
}
|
|
@@ -454,6 +463,7 @@ class T extends R {
|
|
|
454
463
|
static detect(e, t) {
|
|
455
464
|
return typeof t?.groupOn == "function" || typeof t?.enableRowGrouping == "boolean";
|
|
456
465
|
}
|
|
466
|
+
/** @internal */
|
|
457
467
|
processRows(e) {
|
|
458
468
|
const t = this.config;
|
|
459
469
|
if (typeof t.groupOn != "function")
|
|
@@ -482,11 +492,13 @@ class T extends R {
|
|
|
482
492
|
__groupRowCount: K(i)
|
|
483
493
|
} : i.row);
|
|
484
494
|
}
|
|
495
|
+
/** @internal */
|
|
485
496
|
onCellClick(e) {
|
|
486
497
|
const t = e.row;
|
|
487
498
|
if (t?.__isGroupRow && e.originalEvent.target?.closest(".group-toggle"))
|
|
488
499
|
return this.toggle(t.__groupKey), !0;
|
|
489
500
|
}
|
|
501
|
+
/** @internal */
|
|
490
502
|
onKeyDown(e) {
|
|
491
503
|
if (e.key !== " ") return;
|
|
492
504
|
const t = this.grid._focusRow, r = this.rows[t];
|
|
@@ -495,6 +507,7 @@ class T extends R {
|
|
|
495
507
|
}
|
|
496
508
|
/**
|
|
497
509
|
* Render a row. Returns true if we handled the row (group row), false otherwise.
|
|
510
|
+
* @internal
|
|
498
511
|
*/
|
|
499
512
|
renderRow(e, t, r) {
|
|
500
513
|
if (!e?.__isGroupRow)
|
|
@@ -519,6 +532,7 @@ class T extends R {
|
|
|
519
532
|
};
|
|
520
533
|
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
534
|
}
|
|
535
|
+
/** @internal */
|
|
522
536
|
afterRender() {
|
|
523
537
|
const e = this.animationStyle;
|
|
524
538
|
if (e === !1 || this.keysToAnimate.size === 0) return;
|
|
@@ -598,13 +612,13 @@ class T extends R {
|
|
|
598
612
|
* Expand all groups.
|
|
599
613
|
*/
|
|
600
614
|
expandAll() {
|
|
601
|
-
this.expandedKeys =
|
|
615
|
+
this.expandedKeys = S(this.flattenedRows), this.requestRender();
|
|
602
616
|
}
|
|
603
617
|
/**
|
|
604
618
|
* Collapse all groups.
|
|
605
619
|
*/
|
|
606
620
|
collapseAll() {
|
|
607
|
-
this.expandedKeys =
|
|
621
|
+
this.expandedKeys = E(), this.requestRender();
|
|
608
622
|
}
|
|
609
623
|
/**
|
|
610
624
|
* Toggle expansion of a specific group.
|