@toolbox-web/grid 0.0.7 → 0.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 (86) hide show
  1. package/all.d.ts +151 -95
  2. package/all.js +1554 -1452
  3. package/all.js.map +1 -1
  4. package/custom-elements.json +89 -7
  5. package/index.d.ts +68 -23
  6. package/index.js +1066 -948
  7. package/index.js.map +1 -1
  8. package/lib/plugins/clipboard/index.js +48 -49
  9. package/lib/plugins/clipboard/index.js.map +1 -1
  10. package/lib/plugins/column-virtualization/index.js +6 -6
  11. package/lib/plugins/column-virtualization/index.js.map +1 -1
  12. package/lib/plugins/context-menu/index.js +32 -34
  13. package/lib/plugins/context-menu/index.js.map +1 -1
  14. package/lib/plugins/export/index.js +7 -7
  15. package/lib/plugins/export/index.js.map +1 -1
  16. package/lib/plugins/filtering/index.js +5 -38
  17. package/lib/plugins/filtering/index.js.map +1 -1
  18. package/lib/plugins/grouping-columns/index.js +4 -32
  19. package/lib/plugins/grouping-columns/index.js.map +1 -1
  20. package/lib/plugins/grouping-rows/index.js +8 -45
  21. package/lib/plugins/grouping-rows/index.js.map +1 -1
  22. package/lib/plugins/master-detail/index.js +6 -30
  23. package/lib/plugins/master-detail/index.js.map +1 -1
  24. package/lib/plugins/multi-sort/index.js +19 -42
  25. package/lib/plugins/multi-sort/index.js.map +1 -1
  26. package/lib/plugins/pinned-columns/index.js +5 -6
  27. package/lib/plugins/pinned-columns/index.js.map +1 -1
  28. package/lib/plugins/pinned-rows/index.js +6 -80
  29. package/lib/plugins/pinned-rows/index.js.map +1 -1
  30. package/lib/plugins/pivot/index.js +673 -145
  31. package/lib/plugins/pivot/index.js.map +1 -1
  32. package/lib/plugins/reorder/index.js +22 -51
  33. package/lib/plugins/reorder/index.js.map +1 -1
  34. package/lib/plugins/selection/index.js +53 -83
  35. package/lib/plugins/selection/index.js.map +1 -1
  36. package/lib/plugins/server-side/index.js +2 -2
  37. package/lib/plugins/server-side/index.js.map +1 -1
  38. package/lib/plugins/tree/index.js +6 -14
  39. package/lib/plugins/tree/index.js.map +1 -1
  40. package/lib/plugins/undo-redo/index.js +2 -3
  41. package/lib/plugins/undo-redo/index.js.map +1 -1
  42. package/lib/plugins/visibility/index.js +13 -105
  43. package/lib/plugins/visibility/index.js.map +1 -1
  44. package/package.json +1 -1
  45. package/themes/dg-theme-bootstrap.css +73 -0
  46. package/themes/dg-theme-material.css +71 -0
  47. package/umd/grid.all.umd.js +40 -415
  48. package/umd/grid.all.umd.js.map +1 -1
  49. package/umd/grid.umd.js +29 -60
  50. package/umd/grid.umd.js.map +1 -1
  51. package/umd/plugins/clipboard.umd.js +4 -4
  52. package/umd/plugins/clipboard.umd.js.map +1 -1
  53. package/umd/plugins/column-virtualization.umd.js +1 -1
  54. package/umd/plugins/column-virtualization.umd.js.map +1 -1
  55. package/umd/plugins/context-menu.umd.js +2 -2
  56. package/umd/plugins/context-menu.umd.js.map +1 -1
  57. package/umd/plugins/export.umd.js +1 -1
  58. package/umd/plugins/export.umd.js.map +1 -1
  59. package/umd/plugins/filtering.umd.js +2 -34
  60. package/umd/plugins/filtering.umd.js.map +1 -1
  61. package/umd/plugins/grouping-columns.umd.js +1 -28
  62. package/umd/plugins/grouping-columns.umd.js.map +1 -1
  63. package/umd/plugins/grouping-rows.umd.js +1 -39
  64. package/umd/plugins/grouping-rows.umd.js.map +1 -1
  65. package/umd/plugins/master-detail.umd.js +1 -26
  66. package/umd/plugins/master-detail.umd.js.map +1 -1
  67. package/umd/plugins/multi-sort.umd.js +1 -25
  68. package/umd/plugins/multi-sort.umd.js.map +1 -1
  69. package/umd/plugins/pinned-columns.umd.js +1 -1
  70. package/umd/plugins/pinned-columns.umd.js.map +1 -1
  71. package/umd/plugins/pinned-rows.umd.js +1 -72
  72. package/umd/plugins/pinned-rows.umd.js.map +1 -1
  73. package/umd/plugins/pivot.umd.js +1 -7
  74. package/umd/plugins/pivot.umd.js.map +1 -1
  75. package/umd/plugins/reorder.umd.js +1 -30
  76. package/umd/plugins/reorder.umd.js.map +1 -1
  77. package/umd/plugins/selection.umd.js +1 -33
  78. package/umd/plugins/selection.umd.js.map +1 -1
  79. package/umd/plugins/server-side.umd.js +1 -1
  80. package/umd/plugins/server-side.umd.js.map +1 -1
  81. package/umd/plugins/tree.umd.js +1 -10
  82. package/umd/plugins/tree.umd.js.map +1 -1
  83. package/umd/plugins/undo-redo.umd.js +1 -1
  84. package/umd/plugins/undo-redo.umd.js.map +1 -1
  85. package/umd/plugins/visibility.umd.js +1 -93
  86. package/umd/plugins/visibility.umd.js.map +1 -1
package/all.d.ts CHANGED
@@ -6,6 +6,12 @@ export declare interface ActivateCellDetail {
6
6
  col: number;
7
7
  }
8
8
 
9
+ /** Available aggregation function types */
10
+ declare type AggFunc = 'sum' | 'avg' | 'count' | 'min' | 'max' | 'first' | 'last';
11
+
12
+ /** Available aggregation function types */
13
+ declare type AggFunc_2 = 'sum' | 'avg' | 'count' | 'min' | 'max' | 'first' | 'last';
14
+
9
15
  /**
10
16
  * Configuration for an aggregation row (footer/header row with computed values).
11
17
  * Replaces the core FooterRowConfig functionality.
@@ -1494,8 +1500,6 @@ export declare interface ChangedRowsResetDetail<TRow = any> {
1494
1500
  */
1495
1501
  /** Configuration options for the clipboard plugin */
1496
1502
  declare interface ClipboardConfig {
1497
- /** Whether clipboard functionality is enabled (default: true) */
1498
- enabled?: boolean;
1499
1503
  /** Include column headers in copied text (default: false) */
1500
1504
  includeHeaders?: boolean;
1501
1505
  /** Column delimiter character (default: '\t' for tab) */
@@ -1751,8 +1755,6 @@ declare type ColumnViewRenderer_2<TRow = any, TValue = any> = (ctx: CellRenderCo
1751
1755
  */
1752
1756
  /** Configuration options for the column virtualization plugin */
1753
1757
  declare interface ColumnVirtualizationConfig {
1754
- /** Whether the plugin is enabled (default: true) */
1755
- enabled?: boolean;
1756
1758
  /** Auto-enable when column count exceeds threshold (default: true) */
1757
1759
  autoEnable?: boolean;
1758
1760
  /** Column count threshold for auto-enabling (default: 30) */
@@ -1816,8 +1818,6 @@ export declare class ColumnVirtualizationPlugin extends BaseGridPlugin_2<ColumnV
1816
1818
  * Configuration options for the context menu plugin.
1817
1819
  */
1818
1820
  declare interface ContextMenuConfig {
1819
- /** Whether the context menu is enabled (default: true) */
1820
- enabled?: boolean;
1821
1821
  /** Menu items - static array or function returning items */
1822
1822
  items?: ContextMenuItem_3[] | ((params: ContextMenuParams_3) => ContextMenuItem_3[]);
1823
1823
  }
@@ -2207,23 +2207,37 @@ export declare class DataGridElement<T = any> extends HTMLElement implements Int
2207
2207
  * Clears all user modifications (order, width, visibility, sort).
2208
2208
  */
2209
2209
  resetColumnState(): void;
2210
+ /**
2211
+ * Check if the tool panel is currently open.
2212
+ */
2213
+ get isToolPanelOpen(): boolean;
2210
2214
  /**
2211
2215
  * Get the currently active tool panel ID, or null if none is open.
2216
+ * @deprecated Use isToolPanelOpen and expandedToolPanelSections instead.
2212
2217
  */
2213
2218
  get activeToolPanel(): string | null;
2214
2219
  /**
2215
- * Open a tool panel by ID.
2216
- * Closes any currently open panel first.
2220
+ * Get the IDs of expanded accordion sections.
2217
2221
  */
2218
- openToolPanel(panelId: string): void;
2222
+ get expandedToolPanelSections(): string[];
2219
2223
  /**
2220
- * Close the currently open tool panel.
2224
+ * Open the tool panel (accordion view with all registered panels).
2225
+ */
2226
+ openToolPanel(): void;
2227
+ /**
2228
+ * Close the tool panel.
2221
2229
  */
2222
2230
  closeToolPanel(): void;
2223
2231
  /**
2224
- * Toggle a tool panel open/closed.
2232
+ * Toggle the tool panel open/closed.
2225
2233
  */
2226
- toggleToolPanel(panelId: string): void;
2234
+ toggleToolPanel(): void;
2235
+ /**
2236
+ * Toggle an accordion section expanded/collapsed.
2237
+ * Only one section can be expanded at a time (exclusive accordion).
2238
+ * When there's only one panel, toggling is disabled (always expanded).
2239
+ */
2240
+ toggleToolPanelSection(sectionId: string): void;
2227
2241
  /**
2228
2242
  * Get registered tool panel definitions.
2229
2243
  */
@@ -2364,8 +2378,6 @@ declare interface EditorExecContext<T = any> extends CellContext<T> {
2364
2378
 
2365
2379
  /** Configuration options for the export plugin */
2366
2380
  declare interface ExportConfig {
2367
- /** Whether export is enabled (default: true) */
2368
- enabled?: boolean;
2369
2381
  /** Default file name for exports (default: 'export') */
2370
2382
  fileName?: string;
2371
2383
  /** Include column headers in export (default: true) */
@@ -2505,8 +2517,6 @@ export declare interface ExternalMountViewDetail<TRow = any> {
2505
2517
 
2506
2518
  /** Configuration options for the filtering plugin */
2507
2519
  export declare interface FilterConfig {
2508
- /** Whether filtering is enabled (default: true) */
2509
- enabled?: boolean;
2510
2520
  /** Debounce delay in ms for filter input (default: 300) */
2511
2521
  debounceMs?: number;
2512
2522
  /** Whether text filtering is case sensitive (default: false) */
@@ -2521,8 +2531,6 @@ export declare interface FilterConfig {
2521
2531
 
2522
2532
  /** Configuration options for the filtering plugin */
2523
2533
  declare interface FilterConfig_2 {
2524
- /** Whether filtering is enabled (default: true) */
2525
- enabled?: boolean;
2526
2534
  /** Debounce delay in ms for filter input (default: 300) */
2527
2535
  debounceMs?: number;
2528
2536
  /** Whether text filtering is case sensitive (default: false) */
@@ -2645,7 +2653,7 @@ export declare class FilteringPlugin extends BaseGridPlugin_2<FilterConfig_2> {
2645
2653
  * Apply filter state from column state.
2646
2654
  */
2647
2655
  applyColumnState(field: string, state: ColumnState_2): void;
2648
- readonly styles = "\n .header-cell.filtered::before {\n content: '';\n position: absolute;\n top: 4px;\n right: 4px;\n width: 6px;\n height: 6px;\n background: var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));\n border-radius: 50%;\n }\n .tbw-filter-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background: transparent;\n border: none;\n cursor: pointer;\n padding: 2px;\n margin-left: 4px;\n opacity: 0.4;\n transition: opacity 0.15s;\n color: inherit;\n vertical-align: middle;\n }\n .tbw-filter-btn:hover,\n .tbw-filter-btn.active {\n opacity: 1;\n }\n .tbw-filter-btn.active {\n color: var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));\n }\n ";
2656
+ readonly styles: string;
2649
2657
  }
2650
2658
 
2651
2659
  /** Filter model representing a single filter condition */
@@ -2795,6 +2803,15 @@ declare interface GetRowsResult_2 {
2795
2803
  lastRow?: number;
2796
2804
  }
2797
2805
 
2806
+ /**
2807
+ * Get a value-based aggregator function.
2808
+ * Used by Pivot plugin and other features that aggregate pre-extracted values.
2809
+ *
2810
+ * @param aggFunc - Aggregation function name ('sum', 'avg', 'count', 'min', 'max', 'first', 'last')
2811
+ * @returns Aggregator function that takes number[] and returns number
2812
+ */
2813
+ export declare function getValueAggregator(aggFunc: string): ValueAggregatorFn;
2814
+
2798
2815
  /**
2799
2816
  * CSS class names used in the grid's shadow DOM.
2800
2817
  * Use these when adding/removing classes or querying elements.
@@ -3005,6 +3022,8 @@ export declare interface GridIcons {
3005
3022
  submenuArrow?: IconValue;
3006
3023
  /** Drag handle icon for reordering. Default: '⋮⋮' */
3007
3024
  dragHandle?: IconValue;
3025
+ /** Tool panel toggle icon in toolbar. Default: '☰' */
3026
+ toolPanel?: IconValue;
3008
3027
  }
3009
3028
 
3010
3029
  /**
@@ -3026,6 +3045,8 @@ declare interface GridIcons_2 {
3026
3045
  submenuArrow?: IconValue_2;
3027
3046
  /** Drag handle icon for reordering. Default: '⋮⋮' */
3028
3047
  dragHandle?: IconValue_2;
3048
+ /** Tool panel toggle icon in toolbar. Default: '☰' */
3049
+ toolPanel?: IconValue_2;
3029
3050
  }
3030
3051
 
3031
3052
  /**
@@ -3065,8 +3086,6 @@ declare interface GroupHeaderRenderParams {
3065
3086
 
3066
3087
  /** Configuration options for the column groups plugin */
3067
3088
  declare interface GroupingColumnsConfig {
3068
- /** Whether the plugin is enabled (default: true) */
3069
- enabled?: boolean;
3070
3089
  /** Custom group header renderer */
3071
3090
  groupHeaderRenderer?: (params: GroupHeaderRenderParams) => HTMLElement | string | void;
3072
3091
  /** Whether to show group borders (default: true) */
@@ -3117,13 +3136,11 @@ export declare class GroupingColumnsPlugin extends BaseGridPlugin_2<GroupingColu
3117
3136
  * Refresh column groups (recompute from current columns).
3118
3137
  */
3119
3138
  refresh(): void;
3120
- readonly styles = "\n .header-group-row {\n display: grid;\n grid-auto-flow: column;\n background: var(--tbw-grouping-columns-header-bg, var(--tbw-color-header-bg));\n border-bottom: 1px solid var(--tbw-grouping-columns-border, var(--tbw-color-border));\n }\n .header-group-cell {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 4px 8px;\n font-weight: 600;\n font-size: 0.9em;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n border-right: 1px solid var(--tbw-grouping-columns-border, var(--tbw-color-border));\n }\n .header-group-cell:last-child {\n border-right: none;\n }\n .header-row .cell.grouped {\n border-top: none;\n }\n .header-row .cell.group-end {\n border-right: 2px solid var(--tbw-grouping-columns-separator, var(--tbw-color-border-strong));\n }\n ";
3139
+ readonly styles: string;
3121
3140
  }
3122
3141
 
3123
3142
  /** Configuration options for the row grouping plugin */
3124
3143
  export declare interface GroupingRowsConfig {
3125
- /** Whether the plugin is enabled (default: true) */
3126
- enabled?: boolean;
3127
3144
  /**
3128
3145
  * Callback to determine group path for a row.
3129
3146
  * Return an array of group keys, a single key, null/false to skip grouping.
@@ -3147,8 +3164,6 @@ export declare interface GroupingRowsConfig {
3147
3164
 
3148
3165
  /** Configuration options for the row grouping plugin */
3149
3166
  declare interface GroupingRowsConfig_2 {
3150
- /** Whether the plugin is enabled (default: true) */
3151
- enabled?: boolean;
3152
3167
  /**
3153
3168
  * Callback to determine group path for a row.
3154
3169
  * Return an array of group keys, a single key, null/false to skip grouping.
@@ -3269,7 +3284,7 @@ export declare class GroupingRowsPlugin extends BaseGridPlugin_2<GroupingRowsCon
3269
3284
  * @param fn - The groupOn function or undefined to disable
3270
3285
  */
3271
3286
  setGroupOn(fn: ((row: any) => any[] | any | null | false) | undefined): void;
3272
- readonly styles = "\n .group-row {\n background: var(--tbw-grouping-rows-bg, var(--tbw-color-panel-bg));\n font-weight: 500;\n }\n .group-row:hover {\n background: var(--tbw-grouping-rows-bg-hover, var(--tbw-color-row-hover));\n }\n .group-toggle {\n cursor: pointer;\n user-select: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n margin-right: 4px;\n font-size: 10px;\n }\n .group-toggle:hover {\n background: var(--tbw-grouping-rows-toggle-hover, var(--tbw-color-row-hover));\n border-radius: 2px;\n }\n .group-label {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n }\n .group-count {\n color: var(--tbw-grouping-rows-count-color, var(--tbw-color-fg-muted));\n font-size: 0.85em;\n font-weight: normal;\n }\n [data-group-depth=\"0\"] .group-label { padding-left: 0; }\n [data-group-depth=\"1\"] .group-label { padding-left: 20px; }\n [data-group-depth=\"2\"] .group-label { padding-left: 40px; }\n [data-group-depth=\"3\"] .group-label { padding-left: 60px; }\n [data-group-depth=\"4\"] .group-label { padding-left: 80px; }\n ";
3287
+ readonly styles: string;
3273
3288
  }
3274
3289
 
3275
3290
  /** Group row model item */
@@ -3467,8 +3482,6 @@ export declare const listAggregators: () => string[];
3467
3482
  */
3468
3483
  /** Configuration options for the master-detail plugin */
3469
3484
  declare interface MasterDetailConfig {
3470
- /** Whether master-detail functionality is enabled (default: true) */
3471
- enabled?: boolean;
3472
3485
  /** Renderer function that returns detail content for a row */
3473
3486
  detailRenderer?: (row: any, rowIndex: number) => HTMLElement | string;
3474
3487
  /** Height of the detail row - number (pixels) or 'auto' (default: 'auto') */
@@ -3565,13 +3578,11 @@ export declare class MasterDetailPlugin extends BaseGridPlugin_2<MasterDetailCon
3565
3578
  * @returns The detail HTMLElement or undefined
3566
3579
  */
3567
3580
  getDetailElement(rowIndex: number): HTMLElement | undefined;
3568
- readonly styles = "\n .master-detail-cell-wrapper {\n display: flex;\n align-items: center;\n gap: 4px;\n }\n .master-detail-toggle {\n cursor: pointer;\n font-size: 10px;\n opacity: 0.7;\n user-select: none;\n }\n .master-detail-toggle:hover {\n opacity: 1;\n }\n .master-detail-row {\n grid-column: 1 / -1;\n display: grid;\n background: var(--tbw-master-detail-bg, var(--tbw-color-row-alt));\n border-bottom: 1px solid var(--tbw-master-detail-border, var(--tbw-color-border));\n }\n .master-detail-cell {\n padding: 16px;\n overflow: auto;\n }\n ";
3581
+ readonly styles: string;
3569
3582
  }
3570
3583
 
3571
3584
  /** Configuration options for the multi-sort plugin */
3572
3585
  export declare interface MultiSortConfig {
3573
- /** Whether multi-sort is enabled (default: true) */
3574
- enabled?: boolean;
3575
3586
  /** Maximum number of columns to sort by (default: 3) */
3576
3587
  maxSortColumns?: number;
3577
3588
  /** Whether to show sort order badges (1, 2, 3) on headers (default: true) */
@@ -3580,8 +3591,6 @@ export declare interface MultiSortConfig {
3580
3591
 
3581
3592
  /** Configuration options for the multi-sort plugin */
3582
3593
  declare interface MultiSortConfig_2 {
3583
- /** Whether multi-sort is enabled (default: true) */
3584
- enabled?: boolean;
3585
3594
  /** Maximum number of columns to sort by (default: 3) */
3586
3595
  maxSortColumns?: number;
3587
3596
  /** Whether to show sort order badges (1, 2, 3) on headers (default: true) */
@@ -3640,7 +3649,7 @@ export declare class MultiSortPlugin extends BaseGridPlugin_2<MultiSortConfig_2>
3640
3649
  * Rebuilds the sort model from all column states.
3641
3650
  */
3642
3651
  applyColumnState(field: string, state: ColumnState_2): void;
3643
- readonly styles = "\n .header-cell[data-sort=\"asc\"]::after {\n content: '\u2191';\n margin-left: 4px;\n opacity: 0.8;\n }\n .header-cell[data-sort=\"desc\"]::after {\n content: '\u2193';\n margin-left: 4px;\n opacity: 0.8;\n }\n .sort-index {\n font-size: 10px;\n background: var(--tbw-multi-sort-badge-bg, var(--tbw-color-panel-bg));\n color: var(--tbw-multi-sort-badge-color, var(--tbw-color-fg));\n border-radius: 50%;\n width: 14px;\n height: 14px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n margin-left: 2px;\n font-weight: 600;\n }\n ";
3652
+ readonly styles: string;
3644
3653
  }
3645
3654
 
3646
3655
  /**
@@ -3650,8 +3659,6 @@ export declare class MultiSortPlugin extends BaseGridPlugin_2<MultiSortConfig_2>
3650
3659
  */
3651
3660
  /** Configuration options for the pinned columns plugin */
3652
3661
  declare interface PinnedColumnsConfig {
3653
- /** Whether the plugin is enabled (default: true) */
3654
- enabled?: boolean;
3655
3662
  }
3656
3663
 
3657
3664
  /**
@@ -3698,8 +3705,6 @@ export declare class PinnedColumnsPlugin extends BaseGridPlugin_2<PinnedColumnsC
3698
3705
 
3699
3706
  /** Configuration options for the status bar plugin */
3700
3707
  declare interface PinnedRowsConfig {
3701
- /** Whether the status bar is enabled (default: false) */
3702
- enabled?: boolean;
3703
3708
  /** Position of the info bar (default: 'bottom') */
3704
3709
  position?: PinnedRowsPosition;
3705
3710
  /** Show total row count in info bar (default: true) */
@@ -3825,28 +3830,38 @@ export declare class PinnedRowsPlugin extends BaseGridPlugin_2<PinnedRowsConfig>
3825
3830
  * @param id - The aggregation row ID to remove
3826
3831
  */
3827
3832
  removeAggregationRow(id: string): void;
3828
- readonly styles = "\n .tbw-footer {\n position: sticky;\n bottom: 0;\n z-index: var(--tbw-z-layer-pinned-rows, 20);\n background: var(--tbw-color-panel-bg);\n }\n\n .tbw-pinned-rows {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 8px 12px;\n background: var(--tbw-pinned-rows-bg, var(--tbw-color-panel-bg));\n border-top: 1px solid var(--tbw-pinned-rows-border, var(--tbw-color-border));\n font-size: 12px;\n color: var(--tbw-pinned-rows-color, var(--tbw-color-fg-muted));\n min-height: 32px;\n box-sizing: border-box;\n min-width: fit-content;\n }\n .tbw-pinned-rows-left,\n .tbw-pinned-rows-center,\n .tbw-pinned-rows-right {\n display: flex;\n align-items: center;\n gap: 16px;\n }\n .tbw-pinned-rows-left {\n justify-content: flex-start;\n }\n .tbw-pinned-rows-center {\n justify-content: center;\n flex: 1;\n }\n .tbw-pinned-rows-right {\n justify-content: flex-end;\n }\n .tbw-status-panel {\n white-space: nowrap;\n }\n\n .tbw-aggregation-rows {\n min-width: fit-content;\n background: var(--tbw-aggregation-bg, var(--tbw-color-header-bg));\n }\n .tbw-aggregation-rows-top {\n border-bottom: 1px solid var(--tbw-aggregation-border, var(--tbw-color-border));\n }\n .tbw-aggregation-rows-bottom {\n border-top: 1px solid var(--tbw-aggregation-border, var(--tbw-color-border));\n }\n .tbw-aggregation-row {\n display: grid;\n grid-template-columns: var(--tbw-column-template);\n font-weight: var(--tbw-aggregation-font-weight, 600);\n }\n .tbw-aggregation-cell {\n padding: var(--tbw-cell-padding, 2px 8px);\n min-height: var(--tbw-row-height, 28px);\n display: flex;\n align-items: center;\n border-right: 1px solid var(--tbw-color-border-cell);\n }\n .tbw-aggregation-cell:last-child {\n border-right: 0;\n }\n .tbw-aggregation-cell-full {\n grid-column: 1 / -1;\n border-right: 0;\n }\n ";
3833
+ readonly styles: string;
3829
3834
  }
3830
3835
 
3831
3836
  /** Position of the status bar relative to the grid */
3832
3837
  declare type PinnedRowsPosition = 'top' | 'bottom';
3833
3838
 
3834
3839
  export declare interface PivotConfig {
3835
- enabled?: boolean;
3840
+ /** Whether pivot view is active on load (default: true when fields are configured) */
3841
+ active?: boolean;
3836
3842
  rowGroupFields?: string[];
3837
3843
  columnGroupFields?: string[];
3838
3844
  valueFields?: PivotValueField[];
3839
3845
  showTotals?: boolean;
3840
3846
  showGrandTotal?: boolean;
3847
+ /** Whether groups are expanded by default (default: true) */
3848
+ defaultExpanded?: boolean;
3849
+ /** Indent width per depth level in pixels (default: 20) */
3850
+ indentWidth?: number;
3841
3851
  }
3842
3852
 
3843
3853
  declare interface PivotConfig_2 {
3844
- enabled?: boolean;
3854
+ /** Whether pivot view is active on load (default: true when fields are configured) */
3855
+ active?: boolean;
3845
3856
  rowGroupFields?: string[];
3846
3857
  columnGroupFields?: string[];
3847
3858
  valueFields?: PivotValueField_2[];
3848
3859
  showTotals?: boolean;
3849
3860
  showGrandTotal?: boolean;
3861
+ /** Whether groups are expanded by default (default: true) */
3862
+ defaultExpanded?: boolean;
3863
+ /** Indent width per depth level in pixels (default: 20) */
3864
+ indentWidth?: number;
3850
3865
  }
3851
3866
 
3852
3867
  declare type PivotDataRow = Record<string, unknown>;
@@ -3866,50 +3881,73 @@ declare type PivotDataRow = Record<string, unknown>;
3866
3881
  export declare class PivotPlugin extends BaseGridPlugin_2<PivotConfig_2> {
3867
3882
  readonly name = "pivot";
3868
3883
  readonly version = "1.0.0";
3884
+ /** Tool panel ID for shell integration */
3885
+ static readonly PANEL_ID = "pivot";
3869
3886
  protected get defaultConfig(): Partial<PivotConfig_2>;
3870
3887
  private isActive;
3888
+ private hasInitialized;
3871
3889
  private pivotResult;
3872
- private columnHeaders;
3873
- private rowHeaders;
3890
+ private fieldHeaderMap;
3891
+ private expandedKeys;
3892
+ private defaultExpanded;
3893
+ private originalColumns;
3894
+ private panelContainer;
3895
+ private grandTotalFooter;
3896
+ /**
3897
+ * Check if the plugin has valid pivot configuration (at least value fields).
3898
+ */
3899
+ private hasValidPivotConfig;
3874
3900
  detach(): void;
3901
+ getToolPanel(): ToolPanelDefinition_2 | undefined;
3875
3902
  processRows(rows: readonly unknown[]): PivotDataRow[];
3876
3903
  processColumns(columns: readonly ColumnConfig_2[]): ColumnConfig_2[];
3904
+ renderRow(row: Record<string, unknown>, rowEl: HTMLElement): boolean;
3877
3905
  /**
3878
- * Enable pivot mode.
3906
+ * Remove pivot-specific classes, attributes, and inline styles from a row element.
3907
+ * Called when pivot mode is disabled to clean up reused DOM elements.
3908
+ * Clears innerHTML so the grid's default renderer can rebuild the row.
3879
3909
  */
3880
- enablePivot(): void;
3910
+ private cleanupPivotStyling;
3911
+ afterRender(): void;
3881
3912
  /**
3882
- * Disable pivot mode and return to normal grid view.
3913
+ * Render the grand total row as a sticky footer pinned to the bottom.
3883
3914
  */
3884
- disablePivot(): void;
3915
+ private renderGrandTotalFooter;
3885
3916
  /**
3886
- * Check if pivot mode is currently active.
3917
+ * Remove the grand total footer element.
3887
3918
  */
3919
+ private cleanupGrandTotalFooter;
3920
+ toggle(key: string): void;
3921
+ expand(key: string): void;
3922
+ collapse(key: string): void;
3923
+ expandAll(): void;
3924
+ collapseAll(): void;
3925
+ isExpanded(key: string): boolean;
3926
+ enablePivot(): void;
3927
+ disablePivot(): void;
3888
3928
  isPivotActive(): boolean;
3889
- /**
3890
- * Get the current pivot result.
3891
- */
3892
3929
  getPivotResult(): PivotResult_2 | null;
3893
- /**
3894
- * Set the row group fields for pivoting.
3895
- * @param fields - Array of field names to group rows by
3896
- */
3897
3930
  setRowGroupFields(fields: string[]): void;
3898
- /**
3899
- * Set the column group fields for pivoting.
3900
- * @param fields - Array of field names to create columns from
3901
- */
3902
3931
  setColumnGroupFields(fields: string[]): void;
3903
- /**
3904
- * Set the value fields with aggregation functions.
3905
- * @param fields - Array of value field configurations
3906
- */
3907
3932
  setValueFields(fields: PivotValueField_2[]): void;
3908
- /**
3909
- * Refresh the pivot by clearing cached results.
3910
- */
3911
3933
  refresh(): void;
3912
- readonly styles = "\n [data-pivot-depth=\"1\"] { padding-left: 20px; }\n [data-pivot-depth=\"2\"] { padding-left: 40px; }\n [data-pivot-depth=\"3\"] { padding-left: 60px; }\n .pivot-group-row { font-weight: bold; background: var(--tbw-pivot-group-bg, var(--tbw-color-panel-bg)); }\n .pivot-total-row { font-weight: bold; border-top: 2px solid var(--tbw-pivot-border, var(--tbw-color-border-strong)); }\n ";
3934
+ showPanel(): void;
3935
+ hidePanel(): void;
3936
+ togglePanel(): void;
3937
+ isPanelVisible(): boolean;
3938
+ private get gridColumns();
3939
+ private buildFieldHeaderMap;
3940
+ private getAvailableFields;
3941
+ private captureOriginalColumns;
3942
+ private renderPanel;
3943
+ private refreshPanel;
3944
+ private addFieldToZone;
3945
+ private removeFieldFromZone;
3946
+ private removeFromOtherZones;
3947
+ private addValueField;
3948
+ private removeValueField;
3949
+ private updateValueAggFunc;
3950
+ readonly styles: string;
3913
3951
  }
3914
3952
 
3915
3953
  export declare interface PivotResult {
@@ -3927,34 +3965,52 @@ declare interface PivotResult_2 {
3927
3965
  }
3928
3966
 
3929
3967
  declare interface PivotRow {
3968
+ /** Unique key for this row (hierarchical path) */
3930
3969
  rowKey: string;
3970
+ /** Display label for this row */
3931
3971
  rowLabel: string;
3972
+ /** Depth level (0 = top level) */
3932
3973
  depth: number;
3974
+ /** Aggregated values by column key */
3933
3975
  values: Record<string, number | null>;
3976
+ /** Row total across all columns */
3934
3977
  total?: number;
3978
+ /** Whether this row has children (is a group header) */
3935
3979
  isGroup: boolean;
3980
+ /** Child rows (for hierarchical grouping) */
3936
3981
  children?: PivotRow[];
3982
+ /** Number of data rows in this group */
3983
+ rowCount?: number;
3937
3984
  }
3938
3985
 
3939
3986
  declare interface PivotRow_2 {
3987
+ /** Unique key for this row (hierarchical path) */
3940
3988
  rowKey: string;
3989
+ /** Display label for this row */
3941
3990
  rowLabel: string;
3991
+ /** Depth level (0 = top level) */
3942
3992
  depth: number;
3993
+ /** Aggregated values by column key */
3943
3994
  values: Record<string, number | null>;
3995
+ /** Row total across all columns */
3944
3996
  total?: number;
3997
+ /** Whether this row has children (is a group header) */
3945
3998
  isGroup: boolean;
3999
+ /** Child rows (for hierarchical grouping) */
3946
4000
  children?: PivotRow_2[];
4001
+ /** Number of data rows in this group */
4002
+ rowCount?: number;
3947
4003
  }
3948
4004
 
3949
4005
  export declare interface PivotValueField {
3950
4006
  field: string;
3951
- aggFunc: 'sum' | 'avg' | 'count' | 'min' | 'max' | 'first' | 'last';
4007
+ aggFunc: AggFunc_2;
3952
4008
  header?: string;
3953
4009
  }
3954
4010
 
3955
4011
  declare interface PivotValueField_2 {
3956
4012
  field: string;
3957
- aggFunc: 'sum' | 'avg' | 'count' | 'min' | 'max' | 'first' | 'last';
4013
+ aggFunc: AggFunc;
3958
4014
  header?: string;
3959
4015
  }
3960
4016
 
@@ -4265,8 +4321,6 @@ declare type RenderRow = GroupRowModelItem | DataRowModelItem;
4265
4321
  */
4266
4322
  /** Configuration options for the reorder plugin */
4267
4323
  declare interface ReorderConfig {
4268
- /** Whether column reordering is enabled (default: true) */
4269
- enabled?: boolean;
4270
4324
  /** Whether to animate column movement (default: true) */
4271
4325
  animation?: boolean;
4272
4326
  /** Animation duration in milliseconds (default: 200) */
@@ -4316,7 +4370,7 @@ export declare class ReorderPlugin extends BaseGridPlugin_2<ReorderConfig> {
4316
4370
  * Reset column order to the original configuration order.
4317
4371
  */
4318
4372
  resetColumnOrder(): void;
4319
- readonly styles = "\n .header-row > .cell[draggable=\"true\"] {\n cursor: grab;\n position: relative;\n }\n .header-row > .cell.dragging {\n opacity: 0.5;\n cursor: grabbing;\n }\n .header-row > .cell.drop-before::before {\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n width: 2px;\n background: var(--tbw-reorder-indicator, var(--tbw-color-accent));\n z-index: 1;\n }\n .header-row > .cell.drop-after::after {\n content: '';\n position: absolute;\n right: 0;\n top: 0;\n bottom: 0;\n width: 2px;\n background: var(--tbw-reorder-indicator, var(--tbw-color-accent));\n z-index: 1;\n }\n ";
4373
+ readonly styles: string;
4320
4374
  }
4321
4375
 
4322
4376
  /** Controller managing drag-based column resize lifecycle. */
@@ -4378,6 +4432,15 @@ export declare interface RowGroupRenderConfig {
4378
4432
 
4379
4433
  export declare const runAggregator: (ref: AggregatorRef_2_2 | undefined, rows: any[], field: string, column?: any) => any;
4380
4434
 
4435
+ /**
4436
+ * Run a value-based aggregator on a set of values.
4437
+ *
4438
+ * @param aggFunc - Aggregation function name
4439
+ * @param values - Array of numbers to aggregate
4440
+ * @returns Aggregated result
4441
+ */
4442
+ export declare function runValueAggregator(aggFunc: string, values: number[]): number;
4443
+
4381
4444
  /**
4382
4445
  * Scroll event
4383
4446
  */
@@ -4524,11 +4587,10 @@ export declare class SelectionPlugin extends BaseGridPlugin_2<SelectionConfig_2>
4524
4587
  * Set selected ranges programmatically.
4525
4588
  */
4526
4589
  setRanges(ranges: CellRange_2[]): void;
4527
- readonly styles = "\n /* Prevent text selection during range drag */\n :host .selecting .data-grid-row > .cell {\n user-select: none;\n }\n\n /* Row selection - use accent color for row focus */\n :host .data-grid-row.row-focus {\n background-color: var(--tbw-focus-background, rgba(from var(--tbw-color-accent) r g b / 12%));\n }\n\n /* Disable cell-focus outline in row mode - row is the focus unit */\n :host([data-selection-mode=\"row\"]) .cell-focus {\n outline: none;\n }\n\n /* Selection cell styles - for range mode */\n :host .data-grid-row > .cell.selected {\n background-color: var(--tbw-range-selection-bg);\n }\n :host .data-grid-row > .cell.selected.top {\n border-top: 2px solid var(--tbw-range-border-color);\n }\n :host .data-grid-row > .cell.selected.bottom {\n border-bottom: 2px solid var(--tbw-range-border-color);\n }\n :host .data-grid-row > .cell.selected.first {\n border-left: 2px solid var(--tbw-range-border-color);\n }\n :host .data-grid-row > .cell.selected.last {\n border-right: 2px solid var(--tbw-range-border-color);\n }\n ";
4590
+ readonly styles: string;
4528
4591
  }
4529
4592
 
4530
4593
  declare interface ServerSideConfig {
4531
- enabled?: boolean;
4532
4594
  pageSize?: number;
4533
4595
  cacheBlockSize?: number;
4534
4596
  maxConcurrentRequests?: number;
@@ -4716,13 +4778,13 @@ export declare interface ToolPanelConfig {
4716
4778
  export declare interface ToolPanelDefinition {
4717
4779
  /** Unique panel ID */
4718
4780
  id: string;
4719
- /** Panel title shown in header */
4781
+ /** Panel title shown in accordion header */
4720
4782
  title: string;
4721
- /** Icon for toolbar button (SVG string or emoji) */
4722
- icon: string;
4723
- /** Toolbar button tooltip */
4783
+ /** Icon for accordion section header (optional, emoji or SVG) */
4784
+ icon?: string;
4785
+ /** Tooltip for accordion section header */
4724
4786
  tooltip?: string;
4725
- /** Panel content factory - called when panel opens */
4787
+ /** Panel content factory - called when panel section opens */
4726
4788
  render: (container: HTMLElement) => void | (() => void);
4727
4789
  /** Called when panel closes (for cleanup) */
4728
4790
  onClose?: () => void;
@@ -4736,13 +4798,13 @@ export declare interface ToolPanelDefinition {
4736
4798
  declare interface ToolPanelDefinition_2 {
4737
4799
  /** Unique panel ID */
4738
4800
  id: string;
4739
- /** Panel title shown in header */
4801
+ /** Panel title shown in accordion header */
4740
4802
  title: string;
4741
- /** Icon for toolbar button (SVG string or emoji) */
4742
- icon: string;
4743
- /** Toolbar button tooltip */
4803
+ /** Icon for accordion section header (optional, emoji or SVG) */
4804
+ icon?: string;
4805
+ /** Tooltip for accordion section header */
4744
4806
  tooltip?: string;
4745
- /** Panel content factory - called when panel opens */
4807
+ /** Panel content factory - called when panel section opens */
4746
4808
  render: (container: HTMLElement) => void | (() => void);
4747
4809
  /** Called when panel closes (for cleanup) */
4748
4810
  onClose?: () => void;
@@ -4757,8 +4819,6 @@ declare interface ToolPanelDefinition_2 {
4757
4819
  */
4758
4820
  /** Configuration options for the tree plugin */
4759
4821
  export declare interface TreeConfig {
4760
- /** Whether tree functionality is enabled (default: true) */
4761
- enabled?: boolean;
4762
4822
  /** Field name containing child rows (default: 'children') */
4763
4823
  childrenField?: string;
4764
4824
  /** Auto-detect tree structure from data (default: true) */
@@ -4778,8 +4838,6 @@ export declare interface TreeConfig {
4778
4838
  */
4779
4839
  /** Configuration options for the tree plugin */
4780
4840
  declare interface TreeConfig_2 {
4781
- /** Whether tree functionality is enabled (default: true) */
4782
- enabled?: boolean;
4783
4841
  /** Field name containing child rows (default: 'children') */
4784
4842
  childrenField?: string;
4785
4843
  /** Auto-detect tree structure from data (default: true) */
@@ -4875,7 +4933,7 @@ export declare class TreePlugin extends BaseGridPlugin_2<TreeConfig_2> {
4875
4933
  * Expand all ancestors of a node to make it visible.
4876
4934
  */
4877
4935
  expandToKey(key: string): void;
4878
- readonly styles = "\n .tree-toggle {\n cursor: pointer;\n user-select: none;\n transition: transform 0.2s;\n }\n .tree-toggle:hover {\n color: var(--tbw-tree-accent, var(--tbw-color-accent));\n }\n ";
4936
+ readonly styles: string;
4879
4937
  }
4880
4938
 
4881
4939
  /**
@@ -4886,8 +4944,6 @@ export declare class TreePlugin extends BaseGridPlugin_2<TreeConfig_2> {
4886
4944
  */
4887
4945
  /** Configuration for the undo/redo plugin */
4888
4946
  declare interface UndoRedoConfig {
4889
- /** Whether the plugin is enabled. Default: true */
4890
- enabled?: boolean;
4891
4947
  /** Maximum number of actions to keep in history. Default: 100 */
4892
4948
  maxHistorySize?: number;
4893
4949
  }
@@ -4960,6 +5016,8 @@ export declare class UndoRedoPlugin extends BaseGridPlugin_2<UndoRedoConfig> {
4960
5016
 
4961
5017
  export declare const unregisterAggregator: (name: string) => void;
4962
5018
 
5019
+ export declare type ValueAggregatorFn = (values: number[]) => number;
5020
+
4963
5021
  /** Virtual window bookkeeping; modified in-place as scroll position changes. */
4964
5022
  declare interface VirtualState {
4965
5023
  enabled: boolean;
@@ -4983,8 +5041,6 @@ declare interface VirtualState {
4983
5041
  */
4984
5042
  /** Configuration options for the visibility plugin */
4985
5043
  declare interface VisibilityConfig {
4986
- /** Whether visibility control is enabled (default: true) */
4987
- enabled?: boolean;
4988
5044
  /** Allow hiding all columns (default: false) */
4989
5045
  allowHideAll?: boolean;
4990
5046
  }
@@ -5107,7 +5163,7 @@ export declare class VisibilityPlugin extends BaseGridPlugin_2<VisibilityConfig>
5107
5163
  * On drop, emits a 'column-reorder-request' event for other plugins to handle.
5108
5164
  */
5109
5165
  private setupDragListeners;
5110
- readonly styles = "\n .tbw-visibility-content {\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n .tbw-visibility-list {\n flex: 1;\n overflow-y: auto;\n padding: 8px;\n }\n\n .tbw-visibility-row {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 6px 4px;\n cursor: pointer;\n font-size: 13px;\n border-radius: var(--tbw-border-radius, 4px);\n position: relative;\n }\n .tbw-visibility-row:hover {\n background: var(--tbw-visibility-hover, var(--tbw-color-row-hover, #f3f4f6));\n }\n .tbw-visibility-row input[type=\"checkbox\"] {\n cursor: pointer;\n }\n .tbw-visibility-row.locked span {\n color: var(--tbw-color-fg-muted, #888);\n }\n\n /* Drag handle */\n .tbw-visibility-handle {\n cursor: grab;\n color: var(--tbw-color-fg-muted, #888);\n font-size: 10px;\n letter-spacing: -2px;\n user-select: none;\n flex-shrink: 0;\n }\n .tbw-visibility-row.reorderable:hover .tbw-visibility-handle {\n color: var(--tbw-color-fg, #1f2937);\n }\n\n /* Label wrapper for checkbox and text */\n .tbw-visibility-label {\n display: flex;\n align-items: center;\n gap: 8px;\n flex: 1;\n cursor: pointer;\n }\n\n /* Drag states */\n .tbw-visibility-row.dragging {\n opacity: 0.5;\n cursor: grabbing;\n }\n .tbw-visibility-row.drop-before::before {\n content: '';\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n height: 2px;\n background: var(--tbw-reorder-indicator, var(--tbw-color-accent, #3b82f6));\n }\n .tbw-visibility-row.drop-after::after {\n content: '';\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n height: 2px;\n background: var(--tbw-reorder-indicator, var(--tbw-color-accent, #3b82f6));\n }\n\n .tbw-visibility-show-all {\n margin: 8px;\n padding: 8px 12px;\n border: 1px solid var(--tbw-visibility-border, var(--tbw-color-border, #e5e7eb));\n border-radius: var(--tbw-border-radius, 4px);\n background: var(--tbw-visibility-btn-bg, var(--tbw-color-header-bg, #f9fafb));\n color: var(--tbw-color-fg, #1f2937);\n cursor: pointer;\n font-size: 13px;\n }\n .tbw-visibility-show-all:hover {\n background: var(--tbw-visibility-hover, var(--tbw-color-row-hover, #f3f4f6));\n }\n ";
5166
+ readonly styles: string;
5111
5167
  }
5112
5168
 
5113
5169
  export { }