@toolbox-web/grid 0.6.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.
- package/README.md +79 -26
- package/all.js +731 -1739
- package/all.js.map +1 -1
- package/index.js +1382 -2410
- 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.map +1 -1
- package/lib/core/plugin/base-plugin.d.ts +2 -15
- package/lib/core/plugin/base-plugin.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 +24 -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 +7 -17
- 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 +15 -27
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/editing/EditingPlugin.d.ts +101 -9
- 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 +412 -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 +4 -19
- 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 +50 -58
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts +80 -6
- 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 +10 -21
- 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 +13 -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 +11 -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 +11 -19
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts +61 -2
- 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 +7 -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 +5 -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 +10 -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 +8 -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/selection/SelectionPlugin.d.ts +84 -20
- package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
- package/lib/plugins/selection/index.d.ts +2 -1
- package/lib/plugins/selection/index.d.ts.map +1 -1
- package/lib/plugins/selection/index.js +70 -131
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/selection/types.d.ts +25 -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 +5 -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 +59 -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 +5 -17
- 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 +6 -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 +19 -19
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +11 -11
- 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.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.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/selection.umd.js +1 -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
|
@@ -3,22 +3,92 @@ import { ColumnConfig, ToolPanelDefinition } from '../../core/types';
|
|
|
3
3
|
import { PivotDataRow } from './pivot-engine';
|
|
4
4
|
import { PivotConfig, PivotResult, PivotValueField } from './types';
|
|
5
5
|
/**
|
|
6
|
-
* Pivot Plugin for tbw-grid
|
|
6
|
+
* Pivot Table Plugin for tbw-grid
|
|
7
|
+
*
|
|
8
|
+
* Transforms flat data into a pivot table view with grouped rows, grouped columns,
|
|
9
|
+
* and aggregated values. Includes an interactive tool panel for configuring
|
|
10
|
+
* row groups, column groups, and value aggregations at runtime.
|
|
11
|
+
*
|
|
12
|
+
* ## Installation
|
|
7
13
|
*
|
|
8
|
-
*
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { PivotPlugin } from '@toolbox-web/grid/plugins/pivot';
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* ## Configuration Options
|
|
19
|
+
*
|
|
20
|
+
* | Option | Type | Default | Description |
|
|
21
|
+
* |--------|------|---------|-------------|
|
|
22
|
+
* | `active` | `boolean` | `true` | Whether pivot is active on load |
|
|
23
|
+
* | `rowGroupFields` | `string[]` | `[]` | Fields for row grouping |
|
|
24
|
+
* | `columnGroupFields` | `string[]` | `[]` | Fields for column grouping |
|
|
25
|
+
* | `valueFields` | `ValueField[]` | `[]` | Aggregation value fields |
|
|
26
|
+
* | `showTotals` | `boolean` | `true` | Show row subtotals |
|
|
27
|
+
* | `showGrandTotal` | `boolean` | `true` | Show grand total row |
|
|
28
|
+
* | `showToolPanel` | `boolean` | `true` | Show interactive pivot panel |
|
|
29
|
+
* | `defaultExpanded` | `boolean` | `true` | Groups expanded by default |
|
|
30
|
+
* | `indentWidth` | `number` | `20` | Indent per depth level (px) |
|
|
31
|
+
* | `animation` | `false \| 'slide' \| 'fade'` | `'slide'` | Expand/collapse animation |
|
|
32
|
+
*
|
|
33
|
+
* ## Aggregation Functions
|
|
34
|
+
*
|
|
35
|
+
* `sum`, `avg`, `count`, `min`, `max`, `first`, `last`
|
|
36
|
+
*
|
|
37
|
+
* ## Programmatic API
|
|
38
|
+
*
|
|
39
|
+
* | Method | Signature | Description |
|
|
40
|
+
* |--------|-----------|-------------|
|
|
41
|
+
* | `expandGroup` | `(path: string[]) => void` | Expand a specific group |
|
|
42
|
+
* | `collapseGroup` | `(path: string[]) => void` | Collapse a specific group |
|
|
43
|
+
* | `expandAll` | `() => void` | Expand all groups |
|
|
44
|
+
* | `collapseAll` | `() => void` | Collapse all groups |
|
|
45
|
+
*
|
|
46
|
+
* ## CSS Custom Properties
|
|
47
|
+
*
|
|
48
|
+
* | Property | Default | Description |
|
|
49
|
+
* |----------|---------|-------------|
|
|
50
|
+
* | `--tbw-pivot-group-bg` | `var(--tbw-color-row-alt)` | Group row background |
|
|
51
|
+
* | `--tbw-pivot-grand-total-bg` | `var(--tbw-color-header-bg)` | Grand total row |
|
|
52
|
+
*
|
|
53
|
+
* @example Basic Pivot Table
|
|
54
|
+
* ```ts
|
|
55
|
+
* import '@toolbox-web/grid';
|
|
56
|
+
* import { PivotPlugin } from '@toolbox-web/grid/plugins/pivot';
|
|
57
|
+
*
|
|
58
|
+
* grid.gridConfig = {
|
|
59
|
+
* columns: [...],
|
|
60
|
+
* plugins: [
|
|
61
|
+
* new PivotPlugin({
|
|
62
|
+
* rowGroupFields: ['region', 'product'],
|
|
63
|
+
* columnGroupFields: ['quarter'],
|
|
64
|
+
* valueFields: [{ field: 'sales', aggFunc: 'sum', header: 'Total' }],
|
|
65
|
+
* }),
|
|
66
|
+
* ],
|
|
67
|
+
* };
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* @example Programmatic-Only (No Tool Panel)
|
|
9
71
|
* ```ts
|
|
10
72
|
* new PivotPlugin({
|
|
73
|
+
* showToolPanel: false,
|
|
11
74
|
* rowGroupFields: ['category'],
|
|
12
|
-
*
|
|
13
|
-
* valueFields: [{ field: 'sales', aggFunc: 'sum' }]
|
|
75
|
+
* valueFields: [{ field: 'amount', aggFunc: 'sum' }],
|
|
14
76
|
* })
|
|
15
77
|
* ```
|
|
78
|
+
*
|
|
79
|
+
* @see {@link PivotConfig} for all configuration options
|
|
80
|
+
* @see {@link PivotValueField} for value field structure
|
|
81
|
+
*
|
|
82
|
+
* @internal Extends BaseGridPlugin
|
|
16
83
|
*/
|
|
17
84
|
export declare class PivotPlugin extends BaseGridPlugin<PivotConfig> {
|
|
85
|
+
/** @internal */
|
|
18
86
|
readonly name = "pivot";
|
|
87
|
+
/** @internal */
|
|
19
88
|
readonly styles: string;
|
|
20
89
|
/** Tool panel ID for shell integration */
|
|
21
90
|
static readonly PANEL_ID = "pivot";
|
|
91
|
+
/** @internal */
|
|
22
92
|
protected get defaultConfig(): Partial<PivotConfig>;
|
|
23
93
|
private isActive;
|
|
24
94
|
private hasInitialized;
|
|
@@ -40,10 +110,15 @@ export declare class PivotPlugin extends BaseGridPlugin<PivotConfig> {
|
|
|
40
110
|
* Uses base class isAnimationEnabled to respect grid-level settings.
|
|
41
111
|
*/
|
|
42
112
|
private get animationStyle();
|
|
113
|
+
/** @internal */
|
|
43
114
|
detach(): void;
|
|
115
|
+
/** @internal */
|
|
44
116
|
getToolPanel(): ToolPanelDefinition | undefined;
|
|
117
|
+
/** @internal */
|
|
45
118
|
processRows(rows: readonly unknown[]): PivotDataRow[];
|
|
119
|
+
/** @internal */
|
|
46
120
|
processColumns(columns: readonly ColumnConfig[]): ColumnConfig[];
|
|
121
|
+
/** @internal */
|
|
47
122
|
renderRow(row: Record<string, unknown>, rowEl: HTMLElement, rowIndex: number): boolean;
|
|
48
123
|
/**
|
|
49
124
|
* Remove pivot-specific classes, attributes, and inline styles from a row element.
|
|
@@ -51,7 +126,9 @@ export declare class PivotPlugin extends BaseGridPlugin<PivotConfig> {
|
|
|
51
126
|
* Clears innerHTML so the grid's default renderer can rebuild the row.
|
|
52
127
|
*/
|
|
53
128
|
private cleanupPivotStyling;
|
|
129
|
+
/** @internal */
|
|
54
130
|
onKeyDown(event: KeyboardEvent): boolean | void;
|
|
131
|
+
/** @internal */
|
|
55
132
|
afterRender(): void;
|
|
56
133
|
/**
|
|
57
134
|
* Render the grand total row as a sticky footer pinned to the bottom.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PivotPlugin.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/pivot/PivotPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAiD,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAIlG,OAAO,KAAK,EAAoC,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAK3G
|
|
1
|
+
{"version":3,"file":"PivotPlugin.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/pivot/PivotPlugin.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/pivot/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/pivot/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -184,23 +184,6 @@ class P {
|
|
|
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.
|
|
@@ -760,10 +743,13 @@ function J(i, e, t) {
|
|
|
760
743
|
}
|
|
761
744
|
const Q = '@layer tbw-plugins{.pivot-group-row{display:grid;grid-template-columns:var(--tbw-column-template);font-weight:600;background:var(--tbw-pivot-group-bg, var(--tbw-color-row-alt));min-height:var(--tbw-row-height);border-bottom:var(--tbw-row-divider)}.pivot-group-row:hover{background:var(--tbw-pivot-group-hover, var(--tbw-color-row-hover))}.pivot-leaf-row{display:grid;grid-template-columns:var(--tbw-column-template);background:var(--tbw-pivot-leaf-bg, var(--tbw-color-bg));min-height:var(--tbw-row-height);border-bottom:var(--tbw-row-divider)}.pivot-grand-total-row{display:grid;grid-template-columns:var(--tbw-column-template);font-weight:700;background:var(--tbw-pivot-grand-total-bg, var(--tbw-color-header-bg));min-height:var(--tbw-row-height);border-top:2px solid var(--tbw-color-border-strong)}.pivot-grand-total-row>.cell{display:flex;align-items:center;padding:var(--tbw-cell-padding);border-right:1px solid var(--tbw-color-border-cell);overflow:hidden;min-width:0}.pivot-grand-total-row>.cell:last-child{border-right:0}.pivot-grand-total-footer{position:sticky;bottom:0;z-index:var(--tbw-z-layer-pinned-rows, 20);background:var(--tbw-pivot-grand-total-bg, var(--tbw-color-header-bg));min-width:fit-content}.pivot-group-row>.cell,.pivot-leaf-row>.cell{display:flex;align-items:center;padding:var(--tbw-cell-padding);border-right:1px solid var(--tbw-color-border-cell);overflow:hidden;min-width:0}.pivot-group-row>.cell:last-child,.pivot-leaf-row>.cell:last-child{border-right:0}.pivot-toggle{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;margin-right:6px;border:none;background:transparent;cursor:pointer;color:var(--tbw-pivot-toggle-color, var(--tbw-color-fg-muted));border-radius:var(--tbw-border-radius);transition:background .15s,color .15s}.pivot-toggle:hover{background:var(--tbw-pivot-toggle-hover-bg, var(--tbw-color-row-hover));color:var(--tbw-pivot-toggle-hover-color, var(--tbw-color-fg))}.pivot-toggle:focus{outline:var(--tbw-focus-outline);outline-offset:var(--tbw-focus-outline-offset)}.pivot-label{font-weight:inherit}.pivot-count{color:var(--tbw-pivot-count-color, var(--tbw-color-fg-muted));font-size:.9em;font-weight:400}.pivot-total-row{font-weight:700;border-top:2px solid var(--tbw-pivot-border, var(--tbw-color-border-strong))}[data-pivot-depth="1"]{--tbw-pivot-depth: 1}[data-pivot-depth="2"]{--tbw-pivot-depth: 2}[data-pivot-depth="3"]{--tbw-pivot-depth: 3}[data-pivot-depth="4"]{--tbw-pivot-depth: 4}.tbw-pivot-panel{display:flex;flex-direction:column;gap:var(--tbw-panel-padding, var(--tbw-spacing-lg, .75rem));padding:var(--tbw-panel-padding, var(--tbw-spacing-lg, .75rem));height:100%;overflow-y:auto;font-size:var(--tbw-font-size-sm, .8125rem)}.tbw-pivot-section{border:1px solid var(--tbw-pivot-border, var(--tbw-color-border));border-radius:var(--tbw-border-radius);background:var(--tbw-pivot-section-bg, var(--tbw-color-bg))}.tbw-pivot-section-header{padding:var(--tbw-button-padding, var(--tbw-spacing-md, .5rem) var(--tbw-spacing-lg, .75rem));font-weight:600;background:var(--tbw-pivot-header-bg, var(--tbw-color-header-bg));border-bottom:1px solid var(--tbw-pivot-border, var(--tbw-color-border));border-radius:var(--tbw-border-radius) var(--tbw-border-radius) 0 0}.tbw-pivot-section-content{padding:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem))}.tbw-pivot-toggle-wrapper{display:flex;align-items:center}.tbw-pivot-toggle-label{display:flex;align-items:center;gap:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));cursor:pointer}.tbw-pivot-toggle-label input{width:var(--tbw-icon-size, 1rem);height:var(--tbw-icon-size, 1rem);cursor:pointer}.tbw-pivot-drop-zone{min-height:60px;padding:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));border:2px dashed var(--tbw-pivot-drop-border, var(--tbw-color-border));border-radius:var(--tbw-border-radius);background:var(--tbw-pivot-drop-bg, var(--tbw-color-row-alt));display:flex;flex-wrap:wrap;gap:var(--tbw-spacing-sm, .375rem);align-content:flex-start;transition:all .15s ease}.tbw-pivot-drop-zone.drag-over{border-color:var(--tbw-color-accent);background:var(--tbw-pivot-drop-active, var(--tbw-focus-background))}.tbw-pivot-placeholder{color:var(--tbw-color-fg-muted);font-style:italic;padding:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));text-align:center;width:100%}.tbw-pivot-field-chip{display:inline-flex;align-items:center;gap:var(--tbw-spacing-sm, .375rem);padding:var(--tbw-button-padding-sm, var(--tbw-spacing-xs, .25rem) var(--tbw-spacing-md, .5rem));background:var(--tbw-pivot-chip-bg, var(--tbw-color-header-bg));border:1px solid var(--tbw-pivot-chip-border, var(--tbw-color-border));border-radius:var(--tbw-border-radius);cursor:grab;font-size:var(--tbw-font-size-xs, .75rem);transition:all .15s ease}.tbw-pivot-field-chip:hover{background:var(--tbw-pivot-chip-hover, var(--tbw-color-row-hover));border-color:var(--tbw-color-accent)}.tbw-pivot-field-chip.available{background:var(--tbw-color-bg)}.tbw-pivot-field-chip.dragging{opacity:.5;cursor:grabbing}.tbw-pivot-chip-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:120px}.tbw-pivot-chip-remove{display:flex;align-items:center;justify-content:center;width:var(--tbw-icon-size, 1rem);height:var(--tbw-icon-size, 1rem);padding:0;border:none;background:transparent;color:var(--tbw-color-fg-muted);font-size:var(--tbw-font-size-sm, .875rem);font-weight:700;cursor:pointer;border-radius:50%;transition:all .15s ease}.tbw-pivot-chip-remove:hover{background:var(--tbw-pivot-chip-remove-hover-bg, var(--tbw-color-accent));color:var(--tbw-pivot-chip-remove-hover-fg, var(--tbw-color-accent-fg))}.tbw-pivot-value-chip{padding:var(--tbw-button-padding-sm, var(--tbw-spacing-xs, .25rem) var(--tbw-spacing-md, .5rem))}.tbw-pivot-value-label-wrapper{display:flex;align-items:center;gap:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));flex:1;min-width:0}.tbw-pivot-agg-select{padding:var(--tbw-spacing-xs, .125rem) var(--tbw-spacing-xs, .25rem);font-size:var(--tbw-font-size-xs, .6875rem);border:1px solid var(--tbw-color-border);border-radius:var(--tbw-border-radius);background:var(--tbw-color-bg);cursor:pointer}.tbw-pivot-available-fields{display:flex;flex-wrap:wrap;gap:var(--tbw-spacing-sm, .375rem);min-height:40px}.tbw-pivot-options{display:flex;flex-direction:column;gap:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem))}.tbw-pivot-checkbox{display:flex;align-items:center;gap:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));cursor:pointer}.tbw-pivot-checkbox input{width:var(--tbw-icon-size-sm, .875rem);height:var(--tbw-icon-size-sm, .875rem);cursor:pointer}.pivot-group-row.tbw-pivot-slide-in,.pivot-leaf-row.tbw-pivot-slide-in{animation:tbw-pivot-slide-in var(--tbw-animation-duration, .2s) var(--tbw-animation-easing, ease-out) forwards}@keyframes tbw-pivot-slide-in{0%{opacity:0;transform:translate(-8px)}to{opacity:1;transform:translate(0)}}.pivot-group-row.tbw-pivot-fade-in,.pivot-leaf-row.tbw-pivot-fade-in{animation:tbw-pivot-fade-in var(--tbw-animation-duration, .2s) var(--tbw-animation-easing, ease-out) forwards}@keyframes tbw-pivot-fade-in{0%{opacity:0}to{opacity:1}}}';
|
|
762
745
|
class v extends P {
|
|
746
|
+
/** @internal */
|
|
763
747
|
name = "pivot";
|
|
748
|
+
/** @internal */
|
|
764
749
|
styles = Q;
|
|
765
750
|
/** Tool panel ID for shell integration */
|
|
766
751
|
static PANEL_ID = "pivot";
|
|
752
|
+
/** @internal */
|
|
767
753
|
get defaultConfig() {
|
|
768
754
|
return {
|
|
769
755
|
active: !0,
|
|
@@ -800,11 +786,13 @@ class v extends P {
|
|
|
800
786
|
}
|
|
801
787
|
// #endregion
|
|
802
788
|
// #region Lifecycle
|
|
789
|
+
/** @internal */
|
|
803
790
|
detach() {
|
|
804
791
|
this.isActive = !1, this.hasInitialized = !1, this.pivotResult = null, this.fieldHeaderMap.clear(), this.originalColumns = [], this.panelContainer = null, this.cleanupGrandTotalFooter(), this.previousVisibleKeys.clear(), this.keysToAnimate.clear();
|
|
805
792
|
}
|
|
806
793
|
// #endregion
|
|
807
794
|
// #region Shell Integration
|
|
795
|
+
/** @internal */
|
|
808
796
|
getToolPanel() {
|
|
809
797
|
if ((this.config?.showToolPanel ?? this.userConfig?.showToolPanel ?? !0) !== !1)
|
|
810
798
|
return {
|
|
@@ -818,6 +806,7 @@ class v extends P {
|
|
|
818
806
|
}
|
|
819
807
|
// #endregion
|
|
820
808
|
// #region Hooks
|
|
809
|
+
/** @internal */
|
|
821
810
|
processRows(e) {
|
|
822
811
|
if (!this.hasInitialized && this.config.active !== !1 && this.hasValidPivotConfig() && (this.hasInitialized = !0, this.isActive = !0), !this.isActive)
|
|
823
812
|
return [...e];
|
|
@@ -849,6 +838,7 @@ class v extends P {
|
|
|
849
838
|
}
|
|
850
839
|
return this.previousVisibleKeys = n, r;
|
|
851
840
|
}
|
|
841
|
+
/** @internal */
|
|
852
842
|
processColumns(e) {
|
|
853
843
|
if (!this.isActive || !this.pivotResult)
|
|
854
844
|
return [...e];
|
|
@@ -875,6 +865,7 @@ class v extends P {
|
|
|
875
865
|
type: "number"
|
|
876
866
|
}), t;
|
|
877
867
|
}
|
|
868
|
+
/** @internal */
|
|
878
869
|
renderRow(e, t, o) {
|
|
879
870
|
const r = e;
|
|
880
871
|
return r.__pivotRowKey && r.__pivotHasChildren ? U(r, t, {
|
|
@@ -893,12 +884,14 @@ class v extends P {
|
|
|
893
884
|
cleanupPivotStyling(e) {
|
|
894
885
|
(e.classList.contains("pivot-group-row") || e.classList.contains("pivot-leaf-row") || e.classList.contains("pivot-grand-total-row")) && (e.classList.remove("pivot-group-row", "pivot-leaf-row", "pivot-grand-total-row"), e.classList.add("data-grid-row"), e.removeAttribute("data-pivot-depth"), e.innerHTML = "");
|
|
895
886
|
}
|
|
887
|
+
/** @internal */
|
|
896
888
|
onKeyDown(e) {
|
|
897
889
|
if (e.key !== " " || !this.isActive) return;
|
|
898
890
|
const t = this.grid._focusRow, o = this.rows[t];
|
|
899
891
|
if (!(!o?.__pivotIsGroup || !o.__pivotHasChildren))
|
|
900
892
|
return e.preventDefault(), this.toggle(o.__pivotRowKey), this.requestRenderWithFocus(), !0;
|
|
901
893
|
}
|
|
894
|
+
/** @internal */
|
|
902
895
|
afterRender() {
|
|
903
896
|
this.isActive && this.config.showGrandTotal && this.pivotResult ? this.renderGrandTotalFooter() : this.cleanupGrandTotalFooter();
|
|
904
897
|
const e = this.animationStyle;
|