@toolbox-web/grid 0.0.7 → 0.1.1
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 +1 -1
- package/all.d.ts +156 -95
- package/all.js +1561 -1502
- package/all.js.map +1 -1
- package/custom-elements.json +89 -7
- package/index.d.ts +68 -23
- package/index.js +1617 -1388
- package/index.js.map +1 -1
- package/lib/plugins/clipboard/index.js +48 -49
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/column-virtualization/index.js +6 -6
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/context-menu/index.js +64 -109
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/export/index.js +7 -7
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/index.js +5 -38
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/grouping-columns/index.js +4 -32
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/index.js +8 -45
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/master-detail/index.js +7 -31
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/multi-sort/index.js +19 -42
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/index.js +5 -6
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-rows/index.js +14 -88
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pivot/index.js +673 -145
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/reorder/index.js +22 -51
- package/lib/plugins/reorder/index.js.map +1 -1
- package/lib/plugins/selection/index.js +76 -83
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/server-side/index.js +2 -2
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/tree/index.js +6 -14
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/undo-redo/index.js +2 -3
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/visibility/index.js +13 -105
- package/lib/plugins/visibility/index.js.map +1 -1
- package/package.json +1 -1
- package/themes/dg-theme-bootstrap.css +73 -0
- package/themes/dg-theme-material.css +71 -0
- package/umd/grid.all.umd.js +43 -469
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +35 -66
- package/umd/grid.umd.js.map +1 -1
- package/umd/plugins/clipboard.umd.js +4 -4
- package/umd/plugins/clipboard.umd.js.map +1 -1
- package/umd/plugins/column-virtualization.umd.js +1 -1
- package/umd/plugins/column-virtualization.umd.js.map +1 -1
- package/umd/plugins/context-menu.umd.js +1 -52
- package/umd/plugins/context-menu.umd.js.map +1 -1
- package/umd/plugins/export.umd.js +1 -1
- package/umd/plugins/export.umd.js.map +1 -1
- package/umd/plugins/filtering.umd.js +2 -34
- package/umd/plugins/filtering.umd.js.map +1 -1
- package/umd/plugins/grouping-columns.umd.js +1 -28
- package/umd/plugins/grouping-columns.umd.js.map +1 -1
- package/umd/plugins/grouping-rows.umd.js +1 -39
- package/umd/plugins/grouping-rows.umd.js.map +1 -1
- package/umd/plugins/master-detail.umd.js +1 -26
- package/umd/plugins/master-detail.umd.js.map +1 -1
- package/umd/plugins/multi-sort.umd.js +1 -25
- 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 +1 -72
- package/umd/plugins/pinned-rows.umd.js.map +1 -1
- package/umd/plugins/pivot.umd.js +1 -7
- package/umd/plugins/pivot.umd.js.map +1 -1
- package/umd/plugins/reorder.umd.js +1 -30
- package/umd/plugins/reorder.umd.js.map +1 -1
- package/umd/plugins/selection.umd.js +1 -33
- package/umd/plugins/selection.umd.js.map +1 -1
- package/umd/plugins/server-side.umd.js +1 -1
- package/umd/plugins/server-side.umd.js.map +1 -1
- package/umd/plugins/tree.umd.js +1 -10
- package/umd/plugins/tree.umd.js.map +1 -1
- package/umd/plugins/undo-redo.umd.js +1 -1
- package/umd/plugins/undo-redo.umd.js.map +1 -1
- package/umd/plugins/visibility.umd.js +1 -93
- package/umd/plugins/visibility.umd.js.map +1 -1
package/README.md
CHANGED
|
@@ -506,7 +506,7 @@ For architecture details, rendering pipeline, and plugin development, see [ARCHI
|
|
|
506
506
|
This grid is built and maintained by a single developer in spare time. If it saves you time or money, consider sponsoring to keep development going:
|
|
507
507
|
|
|
508
508
|
[](https://github.com/sponsors/OysteinAmundsen)
|
|
509
|
-
[](https://patreon.com/
|
|
509
|
+
[](https://www.patreon.com/c/OysteinAmundsen)
|
|
510
510
|
|
|
511
511
|
**What sponsorship enables:**
|
|
512
512
|
|
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
|
}
|
|
@@ -1959,6 +1959,11 @@ export declare class ContextMenuPlugin extends BaseGridPlugin_2<ContextMenuConfi
|
|
|
1959
1959
|
attach(grid: GridElement_2): void;
|
|
1960
1960
|
detach(): void;
|
|
1961
1961
|
private installGlobalHandlers;
|
|
1962
|
+
/**
|
|
1963
|
+
* Clean up global handlers when the last instance detaches.
|
|
1964
|
+
* Uses reference counting to ensure handlers persist while any grid uses the plugin.
|
|
1965
|
+
*/
|
|
1966
|
+
private uninstallGlobalHandlers;
|
|
1962
1967
|
afterRender(): void;
|
|
1963
1968
|
/**
|
|
1964
1969
|
* Programmatically show the context menu at the specified position.
|
|
@@ -2207,23 +2212,37 @@ export declare class DataGridElement<T = any> extends HTMLElement implements Int
|
|
|
2207
2212
|
* Clears all user modifications (order, width, visibility, sort).
|
|
2208
2213
|
*/
|
|
2209
2214
|
resetColumnState(): void;
|
|
2215
|
+
/**
|
|
2216
|
+
* Check if the tool panel is currently open.
|
|
2217
|
+
*/
|
|
2218
|
+
get isToolPanelOpen(): boolean;
|
|
2210
2219
|
/**
|
|
2211
2220
|
* Get the currently active tool panel ID, or null if none is open.
|
|
2221
|
+
* @deprecated Use isToolPanelOpen and expandedToolPanelSections instead.
|
|
2212
2222
|
*/
|
|
2213
2223
|
get activeToolPanel(): string | null;
|
|
2214
2224
|
/**
|
|
2215
|
-
*
|
|
2216
|
-
|
|
2225
|
+
* Get the IDs of expanded accordion sections.
|
|
2226
|
+
*/
|
|
2227
|
+
get expandedToolPanelSections(): string[];
|
|
2228
|
+
/**
|
|
2229
|
+
* Open the tool panel (accordion view with all registered panels).
|
|
2217
2230
|
*/
|
|
2218
|
-
openToolPanel(
|
|
2231
|
+
openToolPanel(): void;
|
|
2219
2232
|
/**
|
|
2220
|
-
* Close the
|
|
2233
|
+
* Close the tool panel.
|
|
2221
2234
|
*/
|
|
2222
2235
|
closeToolPanel(): void;
|
|
2223
2236
|
/**
|
|
2224
|
-
* Toggle
|
|
2237
|
+
* Toggle the tool panel open/closed.
|
|
2238
|
+
*/
|
|
2239
|
+
toggleToolPanel(): void;
|
|
2240
|
+
/**
|
|
2241
|
+
* Toggle an accordion section expanded/collapsed.
|
|
2242
|
+
* Only one section can be expanded at a time (exclusive accordion).
|
|
2243
|
+
* When there's only one panel, toggling is disabled (always expanded).
|
|
2225
2244
|
*/
|
|
2226
|
-
|
|
2245
|
+
toggleToolPanelSection(sectionId: string): void;
|
|
2227
2246
|
/**
|
|
2228
2247
|
* Get registered tool panel definitions.
|
|
2229
2248
|
*/
|
|
@@ -2364,8 +2383,6 @@ declare interface EditorExecContext<T = any> extends CellContext<T> {
|
|
|
2364
2383
|
|
|
2365
2384
|
/** Configuration options for the export plugin */
|
|
2366
2385
|
declare interface ExportConfig {
|
|
2367
|
-
/** Whether export is enabled (default: true) */
|
|
2368
|
-
enabled?: boolean;
|
|
2369
2386
|
/** Default file name for exports (default: 'export') */
|
|
2370
2387
|
fileName?: string;
|
|
2371
2388
|
/** Include column headers in export (default: true) */
|
|
@@ -2505,8 +2522,6 @@ export declare interface ExternalMountViewDetail<TRow = any> {
|
|
|
2505
2522
|
|
|
2506
2523
|
/** Configuration options for the filtering plugin */
|
|
2507
2524
|
export declare interface FilterConfig {
|
|
2508
|
-
/** Whether filtering is enabled (default: true) */
|
|
2509
|
-
enabled?: boolean;
|
|
2510
2525
|
/** Debounce delay in ms for filter input (default: 300) */
|
|
2511
2526
|
debounceMs?: number;
|
|
2512
2527
|
/** Whether text filtering is case sensitive (default: false) */
|
|
@@ -2521,8 +2536,6 @@ export declare interface FilterConfig {
|
|
|
2521
2536
|
|
|
2522
2537
|
/** Configuration options for the filtering plugin */
|
|
2523
2538
|
declare interface FilterConfig_2 {
|
|
2524
|
-
/** Whether filtering is enabled (default: true) */
|
|
2525
|
-
enabled?: boolean;
|
|
2526
2539
|
/** Debounce delay in ms for filter input (default: 300) */
|
|
2527
2540
|
debounceMs?: number;
|
|
2528
2541
|
/** Whether text filtering is case sensitive (default: false) */
|
|
@@ -2645,7 +2658,7 @@ export declare class FilteringPlugin extends BaseGridPlugin_2<FilterConfig_2> {
|
|
|
2645
2658
|
* Apply filter state from column state.
|
|
2646
2659
|
*/
|
|
2647
2660
|
applyColumnState(field: string, state: ColumnState_2): void;
|
|
2648
|
-
readonly styles
|
|
2661
|
+
readonly styles: string;
|
|
2649
2662
|
}
|
|
2650
2663
|
|
|
2651
2664
|
/** Filter model representing a single filter condition */
|
|
@@ -2795,6 +2808,15 @@ declare interface GetRowsResult_2 {
|
|
|
2795
2808
|
lastRow?: number;
|
|
2796
2809
|
}
|
|
2797
2810
|
|
|
2811
|
+
/**
|
|
2812
|
+
* Get a value-based aggregator function.
|
|
2813
|
+
* Used by Pivot plugin and other features that aggregate pre-extracted values.
|
|
2814
|
+
*
|
|
2815
|
+
* @param aggFunc - Aggregation function name ('sum', 'avg', 'count', 'min', 'max', 'first', 'last')
|
|
2816
|
+
* @returns Aggregator function that takes number[] and returns number
|
|
2817
|
+
*/
|
|
2818
|
+
export declare function getValueAggregator(aggFunc: string): ValueAggregatorFn;
|
|
2819
|
+
|
|
2798
2820
|
/**
|
|
2799
2821
|
* CSS class names used in the grid's shadow DOM.
|
|
2800
2822
|
* Use these when adding/removing classes or querying elements.
|
|
@@ -3005,6 +3027,8 @@ export declare interface GridIcons {
|
|
|
3005
3027
|
submenuArrow?: IconValue;
|
|
3006
3028
|
/** Drag handle icon for reordering. Default: '⋮⋮' */
|
|
3007
3029
|
dragHandle?: IconValue;
|
|
3030
|
+
/** Tool panel toggle icon in toolbar. Default: '☰' */
|
|
3031
|
+
toolPanel?: IconValue;
|
|
3008
3032
|
}
|
|
3009
3033
|
|
|
3010
3034
|
/**
|
|
@@ -3026,6 +3050,8 @@ declare interface GridIcons_2 {
|
|
|
3026
3050
|
submenuArrow?: IconValue_2;
|
|
3027
3051
|
/** Drag handle icon for reordering. Default: '⋮⋮' */
|
|
3028
3052
|
dragHandle?: IconValue_2;
|
|
3053
|
+
/** Tool panel toggle icon in toolbar. Default: '☰' */
|
|
3054
|
+
toolPanel?: IconValue_2;
|
|
3029
3055
|
}
|
|
3030
3056
|
|
|
3031
3057
|
/**
|
|
@@ -3065,8 +3091,6 @@ declare interface GroupHeaderRenderParams {
|
|
|
3065
3091
|
|
|
3066
3092
|
/** Configuration options for the column groups plugin */
|
|
3067
3093
|
declare interface GroupingColumnsConfig {
|
|
3068
|
-
/** Whether the plugin is enabled (default: true) */
|
|
3069
|
-
enabled?: boolean;
|
|
3070
3094
|
/** Custom group header renderer */
|
|
3071
3095
|
groupHeaderRenderer?: (params: GroupHeaderRenderParams) => HTMLElement | string | void;
|
|
3072
3096
|
/** Whether to show group borders (default: true) */
|
|
@@ -3117,13 +3141,11 @@ export declare class GroupingColumnsPlugin extends BaseGridPlugin_2<GroupingColu
|
|
|
3117
3141
|
* Refresh column groups (recompute from current columns).
|
|
3118
3142
|
*/
|
|
3119
3143
|
refresh(): void;
|
|
3120
|
-
readonly styles
|
|
3144
|
+
readonly styles: string;
|
|
3121
3145
|
}
|
|
3122
3146
|
|
|
3123
3147
|
/** Configuration options for the row grouping plugin */
|
|
3124
3148
|
export declare interface GroupingRowsConfig {
|
|
3125
|
-
/** Whether the plugin is enabled (default: true) */
|
|
3126
|
-
enabled?: boolean;
|
|
3127
3149
|
/**
|
|
3128
3150
|
* Callback to determine group path for a row.
|
|
3129
3151
|
* Return an array of group keys, a single key, null/false to skip grouping.
|
|
@@ -3147,8 +3169,6 @@ export declare interface GroupingRowsConfig {
|
|
|
3147
3169
|
|
|
3148
3170
|
/** Configuration options for the row grouping plugin */
|
|
3149
3171
|
declare interface GroupingRowsConfig_2 {
|
|
3150
|
-
/** Whether the plugin is enabled (default: true) */
|
|
3151
|
-
enabled?: boolean;
|
|
3152
3172
|
/**
|
|
3153
3173
|
* Callback to determine group path for a row.
|
|
3154
3174
|
* Return an array of group keys, a single key, null/false to skip grouping.
|
|
@@ -3269,7 +3289,7 @@ export declare class GroupingRowsPlugin extends BaseGridPlugin_2<GroupingRowsCon
|
|
|
3269
3289
|
* @param fn - The groupOn function or undefined to disable
|
|
3270
3290
|
*/
|
|
3271
3291
|
setGroupOn(fn: ((row: any) => any[] | any | null | false) | undefined): void;
|
|
3272
|
-
readonly styles
|
|
3292
|
+
readonly styles: string;
|
|
3273
3293
|
}
|
|
3274
3294
|
|
|
3275
3295
|
/** Group row model item */
|
|
@@ -3467,8 +3487,6 @@ export declare const listAggregators: () => string[];
|
|
|
3467
3487
|
*/
|
|
3468
3488
|
/** Configuration options for the master-detail plugin */
|
|
3469
3489
|
declare interface MasterDetailConfig {
|
|
3470
|
-
/** Whether master-detail functionality is enabled (default: true) */
|
|
3471
|
-
enabled?: boolean;
|
|
3472
3490
|
/** Renderer function that returns detail content for a row */
|
|
3473
3491
|
detailRenderer?: (row: any, rowIndex: number) => HTMLElement | string;
|
|
3474
3492
|
/** Height of the detail row - number (pixels) or 'auto' (default: 'auto') */
|
|
@@ -3565,13 +3583,11 @@ export declare class MasterDetailPlugin extends BaseGridPlugin_2<MasterDetailCon
|
|
|
3565
3583
|
* @returns The detail HTMLElement or undefined
|
|
3566
3584
|
*/
|
|
3567
3585
|
getDetailElement(rowIndex: number): HTMLElement | undefined;
|
|
3568
|
-
readonly styles
|
|
3586
|
+
readonly styles: string;
|
|
3569
3587
|
}
|
|
3570
3588
|
|
|
3571
3589
|
/** Configuration options for the multi-sort plugin */
|
|
3572
3590
|
export declare interface MultiSortConfig {
|
|
3573
|
-
/** Whether multi-sort is enabled (default: true) */
|
|
3574
|
-
enabled?: boolean;
|
|
3575
3591
|
/** Maximum number of columns to sort by (default: 3) */
|
|
3576
3592
|
maxSortColumns?: number;
|
|
3577
3593
|
/** Whether to show sort order badges (1, 2, 3) on headers (default: true) */
|
|
@@ -3580,8 +3596,6 @@ export declare interface MultiSortConfig {
|
|
|
3580
3596
|
|
|
3581
3597
|
/** Configuration options for the multi-sort plugin */
|
|
3582
3598
|
declare interface MultiSortConfig_2 {
|
|
3583
|
-
/** Whether multi-sort is enabled (default: true) */
|
|
3584
|
-
enabled?: boolean;
|
|
3585
3599
|
/** Maximum number of columns to sort by (default: 3) */
|
|
3586
3600
|
maxSortColumns?: number;
|
|
3587
3601
|
/** Whether to show sort order badges (1, 2, 3) on headers (default: true) */
|
|
@@ -3640,7 +3654,7 @@ export declare class MultiSortPlugin extends BaseGridPlugin_2<MultiSortConfig_2>
|
|
|
3640
3654
|
* Rebuilds the sort model from all column states.
|
|
3641
3655
|
*/
|
|
3642
3656
|
applyColumnState(field: string, state: ColumnState_2): void;
|
|
3643
|
-
readonly styles
|
|
3657
|
+
readonly styles: string;
|
|
3644
3658
|
}
|
|
3645
3659
|
|
|
3646
3660
|
/**
|
|
@@ -3650,8 +3664,6 @@ export declare class MultiSortPlugin extends BaseGridPlugin_2<MultiSortConfig_2>
|
|
|
3650
3664
|
*/
|
|
3651
3665
|
/** Configuration options for the pinned columns plugin */
|
|
3652
3666
|
declare interface PinnedColumnsConfig {
|
|
3653
|
-
/** Whether the plugin is enabled (default: true) */
|
|
3654
|
-
enabled?: boolean;
|
|
3655
3667
|
}
|
|
3656
3668
|
|
|
3657
3669
|
/**
|
|
@@ -3698,8 +3710,6 @@ export declare class PinnedColumnsPlugin extends BaseGridPlugin_2<PinnedColumnsC
|
|
|
3698
3710
|
|
|
3699
3711
|
/** Configuration options for the status bar plugin */
|
|
3700
3712
|
declare interface PinnedRowsConfig {
|
|
3701
|
-
/** Whether the status bar is enabled (default: false) */
|
|
3702
|
-
enabled?: boolean;
|
|
3703
3713
|
/** Position of the info bar (default: 'bottom') */
|
|
3704
3714
|
position?: PinnedRowsPosition;
|
|
3705
3715
|
/** Show total row count in info bar (default: true) */
|
|
@@ -3825,28 +3835,38 @@ export declare class PinnedRowsPlugin extends BaseGridPlugin_2<PinnedRowsConfig>
|
|
|
3825
3835
|
* @param id - The aggregation row ID to remove
|
|
3826
3836
|
*/
|
|
3827
3837
|
removeAggregationRow(id: string): void;
|
|
3828
|
-
readonly styles
|
|
3838
|
+
readonly styles: string;
|
|
3829
3839
|
}
|
|
3830
3840
|
|
|
3831
3841
|
/** Position of the status bar relative to the grid */
|
|
3832
3842
|
declare type PinnedRowsPosition = 'top' | 'bottom';
|
|
3833
3843
|
|
|
3834
3844
|
export declare interface PivotConfig {
|
|
3835
|
-
|
|
3845
|
+
/** Whether pivot view is active on load (default: true when fields are configured) */
|
|
3846
|
+
active?: boolean;
|
|
3836
3847
|
rowGroupFields?: string[];
|
|
3837
3848
|
columnGroupFields?: string[];
|
|
3838
3849
|
valueFields?: PivotValueField[];
|
|
3839
3850
|
showTotals?: boolean;
|
|
3840
3851
|
showGrandTotal?: boolean;
|
|
3852
|
+
/** Whether groups are expanded by default (default: true) */
|
|
3853
|
+
defaultExpanded?: boolean;
|
|
3854
|
+
/** Indent width per depth level in pixels (default: 20) */
|
|
3855
|
+
indentWidth?: number;
|
|
3841
3856
|
}
|
|
3842
3857
|
|
|
3843
3858
|
declare interface PivotConfig_2 {
|
|
3844
|
-
|
|
3859
|
+
/** Whether pivot view is active on load (default: true when fields are configured) */
|
|
3860
|
+
active?: boolean;
|
|
3845
3861
|
rowGroupFields?: string[];
|
|
3846
3862
|
columnGroupFields?: string[];
|
|
3847
3863
|
valueFields?: PivotValueField_2[];
|
|
3848
3864
|
showTotals?: boolean;
|
|
3849
3865
|
showGrandTotal?: boolean;
|
|
3866
|
+
/** Whether groups are expanded by default (default: true) */
|
|
3867
|
+
defaultExpanded?: boolean;
|
|
3868
|
+
/** Indent width per depth level in pixels (default: 20) */
|
|
3869
|
+
indentWidth?: number;
|
|
3850
3870
|
}
|
|
3851
3871
|
|
|
3852
3872
|
declare type PivotDataRow = Record<string, unknown>;
|
|
@@ -3866,50 +3886,73 @@ declare type PivotDataRow = Record<string, unknown>;
|
|
|
3866
3886
|
export declare class PivotPlugin extends BaseGridPlugin_2<PivotConfig_2> {
|
|
3867
3887
|
readonly name = "pivot";
|
|
3868
3888
|
readonly version = "1.0.0";
|
|
3889
|
+
/** Tool panel ID for shell integration */
|
|
3890
|
+
static readonly PANEL_ID = "pivot";
|
|
3869
3891
|
protected get defaultConfig(): Partial<PivotConfig_2>;
|
|
3870
3892
|
private isActive;
|
|
3893
|
+
private hasInitialized;
|
|
3871
3894
|
private pivotResult;
|
|
3872
|
-
private
|
|
3873
|
-
private
|
|
3895
|
+
private fieldHeaderMap;
|
|
3896
|
+
private expandedKeys;
|
|
3897
|
+
private defaultExpanded;
|
|
3898
|
+
private originalColumns;
|
|
3899
|
+
private panelContainer;
|
|
3900
|
+
private grandTotalFooter;
|
|
3901
|
+
/**
|
|
3902
|
+
* Check if the plugin has valid pivot configuration (at least value fields).
|
|
3903
|
+
*/
|
|
3904
|
+
private hasValidPivotConfig;
|
|
3874
3905
|
detach(): void;
|
|
3906
|
+
getToolPanel(): ToolPanelDefinition_2 | undefined;
|
|
3875
3907
|
processRows(rows: readonly unknown[]): PivotDataRow[];
|
|
3876
3908
|
processColumns(columns: readonly ColumnConfig_2[]): ColumnConfig_2[];
|
|
3909
|
+
renderRow(row: Record<string, unknown>, rowEl: HTMLElement): boolean;
|
|
3877
3910
|
/**
|
|
3878
|
-
*
|
|
3911
|
+
* Remove pivot-specific classes, attributes, and inline styles from a row element.
|
|
3912
|
+
* Called when pivot mode is disabled to clean up reused DOM elements.
|
|
3913
|
+
* Clears innerHTML so the grid's default renderer can rebuild the row.
|
|
3879
3914
|
*/
|
|
3880
|
-
|
|
3915
|
+
private cleanupPivotStyling;
|
|
3916
|
+
afterRender(): void;
|
|
3881
3917
|
/**
|
|
3882
|
-
*
|
|
3918
|
+
* Render the grand total row as a sticky footer pinned to the bottom.
|
|
3883
3919
|
*/
|
|
3884
|
-
|
|
3920
|
+
private renderGrandTotalFooter;
|
|
3885
3921
|
/**
|
|
3886
|
-
*
|
|
3922
|
+
* Remove the grand total footer element.
|
|
3887
3923
|
*/
|
|
3924
|
+
private cleanupGrandTotalFooter;
|
|
3925
|
+
toggle(key: string): void;
|
|
3926
|
+
expand(key: string): void;
|
|
3927
|
+
collapse(key: string): void;
|
|
3928
|
+
expandAll(): void;
|
|
3929
|
+
collapseAll(): void;
|
|
3930
|
+
isExpanded(key: string): boolean;
|
|
3931
|
+
enablePivot(): void;
|
|
3932
|
+
disablePivot(): void;
|
|
3888
3933
|
isPivotActive(): boolean;
|
|
3889
|
-
/**
|
|
3890
|
-
* Get the current pivot result.
|
|
3891
|
-
*/
|
|
3892
3934
|
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
3935
|
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
3936
|
setColumnGroupFields(fields: string[]): void;
|
|
3903
|
-
/**
|
|
3904
|
-
* Set the value fields with aggregation functions.
|
|
3905
|
-
* @param fields - Array of value field configurations
|
|
3906
|
-
*/
|
|
3907
3937
|
setValueFields(fields: PivotValueField_2[]): void;
|
|
3908
|
-
/**
|
|
3909
|
-
* Refresh the pivot by clearing cached results.
|
|
3910
|
-
*/
|
|
3911
3938
|
refresh(): void;
|
|
3912
|
-
|
|
3939
|
+
showPanel(): void;
|
|
3940
|
+
hidePanel(): void;
|
|
3941
|
+
togglePanel(): void;
|
|
3942
|
+
isPanelVisible(): boolean;
|
|
3943
|
+
private get gridColumns();
|
|
3944
|
+
private buildFieldHeaderMap;
|
|
3945
|
+
private getAvailableFields;
|
|
3946
|
+
private captureOriginalColumns;
|
|
3947
|
+
private renderPanel;
|
|
3948
|
+
private refreshPanel;
|
|
3949
|
+
private addFieldToZone;
|
|
3950
|
+
private removeFieldFromZone;
|
|
3951
|
+
private removeFromOtherZones;
|
|
3952
|
+
private addValueField;
|
|
3953
|
+
private removeValueField;
|
|
3954
|
+
private updateValueAggFunc;
|
|
3955
|
+
readonly styles: string;
|
|
3913
3956
|
}
|
|
3914
3957
|
|
|
3915
3958
|
export declare interface PivotResult {
|
|
@@ -3927,34 +3970,52 @@ declare interface PivotResult_2 {
|
|
|
3927
3970
|
}
|
|
3928
3971
|
|
|
3929
3972
|
declare interface PivotRow {
|
|
3973
|
+
/** Unique key for this row (hierarchical path) */
|
|
3930
3974
|
rowKey: string;
|
|
3975
|
+
/** Display label for this row */
|
|
3931
3976
|
rowLabel: string;
|
|
3977
|
+
/** Depth level (0 = top level) */
|
|
3932
3978
|
depth: number;
|
|
3979
|
+
/** Aggregated values by column key */
|
|
3933
3980
|
values: Record<string, number | null>;
|
|
3981
|
+
/** Row total across all columns */
|
|
3934
3982
|
total?: number;
|
|
3983
|
+
/** Whether this row has children (is a group header) */
|
|
3935
3984
|
isGroup: boolean;
|
|
3985
|
+
/** Child rows (for hierarchical grouping) */
|
|
3936
3986
|
children?: PivotRow[];
|
|
3987
|
+
/** Number of data rows in this group */
|
|
3988
|
+
rowCount?: number;
|
|
3937
3989
|
}
|
|
3938
3990
|
|
|
3939
3991
|
declare interface PivotRow_2 {
|
|
3992
|
+
/** Unique key for this row (hierarchical path) */
|
|
3940
3993
|
rowKey: string;
|
|
3994
|
+
/** Display label for this row */
|
|
3941
3995
|
rowLabel: string;
|
|
3996
|
+
/** Depth level (0 = top level) */
|
|
3942
3997
|
depth: number;
|
|
3998
|
+
/** Aggregated values by column key */
|
|
3943
3999
|
values: Record<string, number | null>;
|
|
4000
|
+
/** Row total across all columns */
|
|
3944
4001
|
total?: number;
|
|
4002
|
+
/** Whether this row has children (is a group header) */
|
|
3945
4003
|
isGroup: boolean;
|
|
4004
|
+
/** Child rows (for hierarchical grouping) */
|
|
3946
4005
|
children?: PivotRow_2[];
|
|
4006
|
+
/** Number of data rows in this group */
|
|
4007
|
+
rowCount?: number;
|
|
3947
4008
|
}
|
|
3948
4009
|
|
|
3949
4010
|
export declare interface PivotValueField {
|
|
3950
4011
|
field: string;
|
|
3951
|
-
aggFunc:
|
|
4012
|
+
aggFunc: AggFunc_2;
|
|
3952
4013
|
header?: string;
|
|
3953
4014
|
}
|
|
3954
4015
|
|
|
3955
4016
|
declare interface PivotValueField_2 {
|
|
3956
4017
|
field: string;
|
|
3957
|
-
aggFunc:
|
|
4018
|
+
aggFunc: AggFunc;
|
|
3958
4019
|
header?: string;
|
|
3959
4020
|
}
|
|
3960
4021
|
|
|
@@ -4265,8 +4326,6 @@ declare type RenderRow = GroupRowModelItem | DataRowModelItem;
|
|
|
4265
4326
|
*/
|
|
4266
4327
|
/** Configuration options for the reorder plugin */
|
|
4267
4328
|
declare interface ReorderConfig {
|
|
4268
|
-
/** Whether column reordering is enabled (default: true) */
|
|
4269
|
-
enabled?: boolean;
|
|
4270
4329
|
/** Whether to animate column movement (default: true) */
|
|
4271
4330
|
animation?: boolean;
|
|
4272
4331
|
/** Animation duration in milliseconds (default: 200) */
|
|
@@ -4316,7 +4375,7 @@ export declare class ReorderPlugin extends BaseGridPlugin_2<ReorderConfig> {
|
|
|
4316
4375
|
* Reset column order to the original configuration order.
|
|
4317
4376
|
*/
|
|
4318
4377
|
resetColumnOrder(): void;
|
|
4319
|
-
readonly styles
|
|
4378
|
+
readonly styles: string;
|
|
4320
4379
|
}
|
|
4321
4380
|
|
|
4322
4381
|
/** Controller managing drag-based column resize lifecycle. */
|
|
@@ -4378,6 +4437,15 @@ export declare interface RowGroupRenderConfig {
|
|
|
4378
4437
|
|
|
4379
4438
|
export declare const runAggregator: (ref: AggregatorRef_2_2 | undefined, rows: any[], field: string, column?: any) => any;
|
|
4380
4439
|
|
|
4440
|
+
/**
|
|
4441
|
+
* Run a value-based aggregator on a set of values.
|
|
4442
|
+
*
|
|
4443
|
+
* @param aggFunc - Aggregation function name
|
|
4444
|
+
* @param values - Array of numbers to aggregate
|
|
4445
|
+
* @returns Aggregated result
|
|
4446
|
+
*/
|
|
4447
|
+
export declare function runValueAggregator(aggFunc: string, values: number[]): number;
|
|
4448
|
+
|
|
4381
4449
|
/**
|
|
4382
4450
|
* Scroll event
|
|
4383
4451
|
*/
|
|
@@ -4524,11 +4592,10 @@ export declare class SelectionPlugin extends BaseGridPlugin_2<SelectionConfig_2>
|
|
|
4524
4592
|
* Set selected ranges programmatically.
|
|
4525
4593
|
*/
|
|
4526
4594
|
setRanges(ranges: CellRange_2[]): void;
|
|
4527
|
-
readonly styles
|
|
4595
|
+
readonly styles: string;
|
|
4528
4596
|
}
|
|
4529
4597
|
|
|
4530
4598
|
declare interface ServerSideConfig {
|
|
4531
|
-
enabled?: boolean;
|
|
4532
4599
|
pageSize?: number;
|
|
4533
4600
|
cacheBlockSize?: number;
|
|
4534
4601
|
maxConcurrentRequests?: number;
|
|
@@ -4716,13 +4783,13 @@ export declare interface ToolPanelConfig {
|
|
|
4716
4783
|
export declare interface ToolPanelDefinition {
|
|
4717
4784
|
/** Unique panel ID */
|
|
4718
4785
|
id: string;
|
|
4719
|
-
/** Panel title shown in header */
|
|
4786
|
+
/** Panel title shown in accordion header */
|
|
4720
4787
|
title: string;
|
|
4721
|
-
/** Icon for
|
|
4722
|
-
icon
|
|
4723
|
-
/**
|
|
4788
|
+
/** Icon for accordion section header (optional, emoji or SVG) */
|
|
4789
|
+
icon?: string;
|
|
4790
|
+
/** Tooltip for accordion section header */
|
|
4724
4791
|
tooltip?: string;
|
|
4725
|
-
/** Panel content factory - called when panel opens */
|
|
4792
|
+
/** Panel content factory - called when panel section opens */
|
|
4726
4793
|
render: (container: HTMLElement) => void | (() => void);
|
|
4727
4794
|
/** Called when panel closes (for cleanup) */
|
|
4728
4795
|
onClose?: () => void;
|
|
@@ -4736,13 +4803,13 @@ export declare interface ToolPanelDefinition {
|
|
|
4736
4803
|
declare interface ToolPanelDefinition_2 {
|
|
4737
4804
|
/** Unique panel ID */
|
|
4738
4805
|
id: string;
|
|
4739
|
-
/** Panel title shown in header */
|
|
4806
|
+
/** Panel title shown in accordion header */
|
|
4740
4807
|
title: string;
|
|
4741
|
-
/** Icon for
|
|
4742
|
-
icon
|
|
4743
|
-
/**
|
|
4808
|
+
/** Icon for accordion section header (optional, emoji or SVG) */
|
|
4809
|
+
icon?: string;
|
|
4810
|
+
/** Tooltip for accordion section header */
|
|
4744
4811
|
tooltip?: string;
|
|
4745
|
-
/** Panel content factory - called when panel opens */
|
|
4812
|
+
/** Panel content factory - called when panel section opens */
|
|
4746
4813
|
render: (container: HTMLElement) => void | (() => void);
|
|
4747
4814
|
/** Called when panel closes (for cleanup) */
|
|
4748
4815
|
onClose?: () => void;
|
|
@@ -4757,8 +4824,6 @@ declare interface ToolPanelDefinition_2 {
|
|
|
4757
4824
|
*/
|
|
4758
4825
|
/** Configuration options for the tree plugin */
|
|
4759
4826
|
export declare interface TreeConfig {
|
|
4760
|
-
/** Whether tree functionality is enabled (default: true) */
|
|
4761
|
-
enabled?: boolean;
|
|
4762
4827
|
/** Field name containing child rows (default: 'children') */
|
|
4763
4828
|
childrenField?: string;
|
|
4764
4829
|
/** Auto-detect tree structure from data (default: true) */
|
|
@@ -4778,8 +4843,6 @@ export declare interface TreeConfig {
|
|
|
4778
4843
|
*/
|
|
4779
4844
|
/** Configuration options for the tree plugin */
|
|
4780
4845
|
declare interface TreeConfig_2 {
|
|
4781
|
-
/** Whether tree functionality is enabled (default: true) */
|
|
4782
|
-
enabled?: boolean;
|
|
4783
4846
|
/** Field name containing child rows (default: 'children') */
|
|
4784
4847
|
childrenField?: string;
|
|
4785
4848
|
/** Auto-detect tree structure from data (default: true) */
|
|
@@ -4875,7 +4938,7 @@ export declare class TreePlugin extends BaseGridPlugin_2<TreeConfig_2> {
|
|
|
4875
4938
|
* Expand all ancestors of a node to make it visible.
|
|
4876
4939
|
*/
|
|
4877
4940
|
expandToKey(key: string): void;
|
|
4878
|
-
readonly styles
|
|
4941
|
+
readonly styles: string;
|
|
4879
4942
|
}
|
|
4880
4943
|
|
|
4881
4944
|
/**
|
|
@@ -4886,8 +4949,6 @@ export declare class TreePlugin extends BaseGridPlugin_2<TreeConfig_2> {
|
|
|
4886
4949
|
*/
|
|
4887
4950
|
/** Configuration for the undo/redo plugin */
|
|
4888
4951
|
declare interface UndoRedoConfig {
|
|
4889
|
-
/** Whether the plugin is enabled. Default: true */
|
|
4890
|
-
enabled?: boolean;
|
|
4891
4952
|
/** Maximum number of actions to keep in history. Default: 100 */
|
|
4892
4953
|
maxHistorySize?: number;
|
|
4893
4954
|
}
|
|
@@ -4960,6 +5021,8 @@ export declare class UndoRedoPlugin extends BaseGridPlugin_2<UndoRedoConfig> {
|
|
|
4960
5021
|
|
|
4961
5022
|
export declare const unregisterAggregator: (name: string) => void;
|
|
4962
5023
|
|
|
5024
|
+
export declare type ValueAggregatorFn = (values: number[]) => number;
|
|
5025
|
+
|
|
4963
5026
|
/** Virtual window bookkeeping; modified in-place as scroll position changes. */
|
|
4964
5027
|
declare interface VirtualState {
|
|
4965
5028
|
enabled: boolean;
|
|
@@ -4983,8 +5046,6 @@ declare interface VirtualState {
|
|
|
4983
5046
|
*/
|
|
4984
5047
|
/** Configuration options for the visibility plugin */
|
|
4985
5048
|
declare interface VisibilityConfig {
|
|
4986
|
-
/** Whether visibility control is enabled (default: true) */
|
|
4987
|
-
enabled?: boolean;
|
|
4988
5049
|
/** Allow hiding all columns (default: false) */
|
|
4989
5050
|
allowHideAll?: boolean;
|
|
4990
5051
|
}
|
|
@@ -5107,7 +5168,7 @@ export declare class VisibilityPlugin extends BaseGridPlugin_2<VisibilityConfig>
|
|
|
5107
5168
|
* On drop, emits a 'column-reorder-request' event for other plugins to handle.
|
|
5108
5169
|
*/
|
|
5109
5170
|
private setupDragListeners;
|
|
5110
|
-
readonly styles
|
|
5171
|
+
readonly styles: string;
|
|
5111
5172
|
}
|
|
5112
5173
|
|
|
5113
5174
|
export { }
|