@toolbox-web/grid 0.2.8 → 0.3.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 +13 -13
- package/all.d.ts +25 -5659
- package/all.d.ts.map +1 -0
- package/all.js +524 -450
- package/all.js.map +1 -1
- package/index.d.ts +8 -2678
- package/index.d.ts.map +1 -0
- package/index.js +3929 -25
- package/index.js.map +1 -1
- package/lib/core/constants.d.ts +114 -0
- package/lib/core/constants.d.ts.map +1 -0
- package/lib/core/grid.d.ts +337 -0
- package/lib/core/grid.d.ts.map +1 -0
- package/lib/core/internal/aggregators.d.ts +67 -0
- package/lib/core/internal/aggregators.d.ts.map +1 -0
- package/lib/core/internal/column-state.d.ts +124 -0
- package/lib/core/internal/column-state.d.ts.map +1 -0
- package/lib/core/internal/columns.d.ts +107 -0
- package/lib/core/internal/columns.d.ts.map +1 -0
- package/lib/core/internal/dom-builder.d.ts +115 -0
- package/lib/core/internal/dom-builder.d.ts.map +1 -0
- package/lib/core/internal/editing.d.ts +76 -0
- package/lib/core/internal/editing.d.ts.map +1 -0
- package/lib/core/internal/editors.d.ts +8 -0
- package/lib/core/internal/editors.d.ts.map +1 -0
- package/lib/core/internal/event-delegation.d.ts +11 -0
- package/lib/core/internal/event-delegation.d.ts.map +1 -0
- package/lib/core/internal/grid-internals.d.ts +83 -0
- package/lib/core/internal/grid-internals.d.ts.map +1 -0
- package/lib/core/internal/header.d.ts +7 -0
- package/lib/core/internal/header.d.ts.map +1 -0
- package/lib/core/internal/idle-scheduler.d.ts +65 -0
- package/lib/core/internal/idle-scheduler.d.ts.map +1 -0
- package/lib/core/internal/inference.d.ts +12 -0
- package/lib/core/internal/inference.d.ts.map +1 -0
- package/lib/core/internal/keyboard.d.ts +18 -0
- package/lib/core/internal/keyboard.d.ts.map +1 -0
- package/lib/core/internal/resize.d.ts +3 -0
- package/lib/core/internal/resize.d.ts.map +1 -0
- package/lib/core/internal/rows.d.ts +35 -0
- package/lib/core/internal/rows.d.ts.map +1 -0
- package/lib/core/internal/sanitize.d.ts +13 -0
- package/lib/core/internal/sanitize.d.ts.map +1 -0
- package/lib/core/internal/shell.d.ts +228 -0
- package/lib/core/internal/shell.d.ts.map +1 -0
- package/lib/core/internal/sorting.d.ts +24 -0
- package/lib/core/internal/sorting.d.ts.map +1 -0
- package/lib/core/internal/touch-scroll.d.ts +54 -0
- package/lib/core/internal/touch-scroll.d.ts.map +1 -0
- package/lib/core/internal/utils.d.ts +38 -0
- package/lib/core/internal/utils.d.ts.map +1 -0
- package/lib/core/internal/virtualization.d.ts +66 -0
- package/lib/core/internal/virtualization.d.ts.map +1 -0
- package/lib/core/plugin/base-plugin.d.ts +616 -0
- package/lib/core/plugin/base-plugin.d.ts.map +1 -0
- package/lib/core/plugin/index.d.ts +11 -0
- package/lib/core/plugin/index.d.ts.map +1 -0
- package/lib/core/plugin/plugin-manager.d.ts +183 -0
- package/lib/core/plugin/plugin-manager.d.ts.map +1 -0
- package/lib/core/plugin/types.d.ts +196 -0
- package/lib/core/plugin/types.d.ts.map +1 -0
- package/lib/core/types.d.ts +841 -0
- package/lib/core/types.d.ts.map +1 -0
- package/lib/plugins/clipboard/ClipboardPlugin.d.ts +46 -0
- package/lib/plugins/clipboard/ClipboardPlugin.d.ts.map +1 -0
- package/lib/plugins/clipboard/copy.d.ts +47 -0
- package/lib/plugins/clipboard/copy.d.ts.map +1 -0
- package/lib/plugins/clipboard/index.d.ts +7 -0
- package/lib/plugins/clipboard/index.d.ts.map +1 -0
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/clipboard/paste.d.ts +25 -0
- package/lib/plugins/clipboard/paste.d.ts.map +1 -0
- package/lib/plugins/clipboard/types.d.ts +40 -0
- package/lib/plugins/clipboard/types.d.ts.map +1 -0
- package/lib/plugins/column-virtualization/ColumnVirtualizationPlugin.d.ts +54 -0
- package/lib/plugins/column-virtualization/ColumnVirtualizationPlugin.d.ts.map +1 -0
- package/lib/plugins/column-virtualization/column-virtualization.d.ts +53 -0
- package/lib/plugins/column-virtualization/column-virtualization.d.ts.map +1 -0
- package/lib/plugins/column-virtualization/index.d.ts +7 -0
- package/lib/plugins/column-virtualization/index.d.ts.map +1 -0
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/column-virtualization/types.d.ts +41 -0
- package/lib/plugins/column-virtualization/types.d.ts.map +1 -0
- package/lib/plugins/context-menu/ContextMenuPlugin.d.ts +52 -0
- package/lib/plugins/context-menu/ContextMenuPlugin.d.ts.map +1 -0
- package/lib/plugins/context-menu/index.d.ts +7 -0
- package/lib/plugins/context-menu/index.d.ts.map +1 -0
- package/lib/plugins/context-menu/index.js +24 -24
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/context-menu/menu.d.ts +38 -0
- package/lib/plugins/context-menu/menu.d.ts.map +1 -0
- package/lib/plugins/context-menu/types.d.ts +77 -0
- package/lib/plugins/context-menu/types.d.ts.map +1 -0
- package/lib/plugins/export/ExportPlugin.d.ts +53 -0
- package/lib/plugins/export/ExportPlugin.d.ts.map +1 -0
- package/lib/plugins/export/csv.d.ts +31 -0
- package/lib/plugins/export/csv.d.ts.map +1 -0
- package/lib/plugins/export/excel.d.ts +12 -0
- package/lib/plugins/export/excel.d.ts.map +1 -0
- package/lib/plugins/export/index.d.ts +7 -0
- package/lib/plugins/export/index.d.ts.map +1 -0
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/export/types.d.ts +57 -0
- package/lib/plugins/export/types.d.ts.map +1 -0
- package/lib/plugins/filtering/FilteringPlugin.d.ts +128 -0
- package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -0
- package/lib/plugins/filtering/filter-model.d.ts +38 -0
- package/lib/plugins/filtering/filter-model.d.ts.map +1 -0
- package/lib/plugins/filtering/index.d.ts +7 -0
- package/lib/plugins/filtering/index.d.ts.map +1 -0
- package/lib/plugins/filtering/index.js +5 -5
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/filtering/types.d.ts +157 -0
- package/lib/plugins/filtering/types.d.ts.map +1 -0
- package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts +51 -0
- package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts.map +1 -0
- package/lib/plugins/grouping-columns/grouping-columns.d.ts +41 -0
- package/lib/plugins/grouping-columns/grouping-columns.d.ts.map +1 -0
- package/lib/plugins/grouping-columns/index.d.ts +7 -0
- package/lib/plugins/grouping-columns/index.d.ts.map +1 -0
- package/lib/plugins/grouping-columns/index.js +58 -42
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-columns/types.d.ts +91 -0
- package/lib/plugins/grouping-columns/types.d.ts.map +1 -0
- package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts +120 -0
- package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts.map +1 -0
- package/lib/plugins/grouping-rows/grouping-rows.d.ts +51 -0
- package/lib/plugins/grouping-rows/grouping-rows.d.ts.map +1 -0
- package/lib/plugins/grouping-rows/index.d.ts +7 -0
- package/lib/plugins/grouping-rows/index.d.ts.map +1 -0
- package/lib/plugins/grouping-rows/index.js +51 -51
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/grouping-rows/types.d.ts +95 -0
- package/lib/plugins/grouping-rows/types.d.ts.map +1 -0
- package/lib/plugins/master-detail/MasterDetailPlugin.d.ts +147 -0
- package/lib/plugins/master-detail/MasterDetailPlugin.d.ts.map +1 -0
- package/lib/plugins/master-detail/index.d.ts +7 -0
- package/lib/plugins/master-detail/index.d.ts.map +1 -0
- package/lib/plugins/master-detail/index.js +235 -78
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/master-detail/master-detail.d.ts +30 -0
- package/lib/plugins/master-detail/master-detail.d.ts.map +1 -0
- package/lib/plugins/master-detail/types.d.ts +40 -0
- package/lib/plugins/master-detail/types.d.ts.map +1 -0
- package/lib/plugins/multi-sort/MultiSortPlugin.d.ts +58 -0
- package/lib/plugins/multi-sort/MultiSortPlugin.d.ts.map +1 -0
- package/lib/plugins/multi-sort/index.d.ts +7 -0
- package/lib/plugins/multi-sort/index.d.ts.map +1 -0
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/multi-sort/multi-sort.d.ts +51 -0
- package/lib/plugins/multi-sort/multi-sort.d.ts.map +1 -0
- package/lib/plugins/multi-sort/types.d.ts +25 -0
- package/lib/plugins/multi-sort/types.d.ts.map +1 -0
- package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts +58 -0
- package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts.map +1 -0
- package/lib/plugins/pinned-columns/index.d.ts +7 -0
- package/lib/plugins/pinned-columns/index.d.ts.map +1 -0
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-columns/pinned-columns.d.ts +62 -0
- package/lib/plugins/pinned-columns/pinned-columns.d.ts.map +1 -0
- package/lib/plugins/pinned-columns/types.d.ts +20 -0
- package/lib/plugins/pinned-columns/types.d.ts.map +1 -0
- package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts +64 -0
- package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts.map +1 -0
- package/lib/plugins/pinned-rows/index.d.ts +7 -0
- package/lib/plugins/pinned-rows/index.d.ts.map +1 -0
- package/lib/plugins/pinned-rows/index.js +1 -1
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pinned-rows/pinned-rows.d.ts +43 -0
- package/lib/plugins/pinned-rows/pinned-rows.d.ts.map +1 -0
- package/lib/plugins/pinned-rows/types.d.ts +95 -0
- package/lib/plugins/pinned-rows/types.d.ts.map +1 -0
- package/lib/plugins/pivot/PivotPlugin.d.ts +94 -0
- package/lib/plugins/pivot/PivotPlugin.d.ts.map +1 -0
- package/lib/plugins/pivot/index.d.ts +7 -0
- package/lib/plugins/pivot/index.d.ts.map +1 -0
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/pivot/pivot-engine.d.ts +50 -0
- package/lib/plugins/pivot/pivot-engine.d.ts.map +1 -0
- package/lib/plugins/pivot/pivot-model.d.ts +6 -0
- package/lib/plugins/pivot/pivot-model.d.ts.map +1 -0
- package/lib/plugins/pivot/pivot-panel.d.ts +25 -0
- package/lib/plugins/pivot/pivot-panel.d.ts.map +1 -0
- package/lib/plugins/pivot/pivot-rows.d.ts +33 -0
- package/lib/plugins/pivot/pivot-rows.d.ts.map +1 -0
- package/lib/plugins/pivot/types.d.ts +62 -0
- package/lib/plugins/pivot/types.d.ts.map +1 -0
- package/lib/plugins/reorder/ReorderPlugin.d.ts +81 -0
- package/lib/plugins/reorder/ReorderPlugin.d.ts.map +1 -0
- package/lib/plugins/reorder/column-drag.d.ts +41 -0
- package/lib/plugins/reorder/column-drag.d.ts.map +1 -0
- package/lib/plugins/reorder/index.d.ts +7 -0
- package/lib/plugins/reorder/index.d.ts.map +1 -0
- package/lib/plugins/reorder/index.js +51 -48
- package/lib/plugins/reorder/index.js.map +1 -1
- package/lib/plugins/reorder/types.d.ts +54 -0
- package/lib/plugins/reorder/types.d.ts.map +1 -0
- package/lib/plugins/selection/SelectionPlugin.d.ts +77 -0
- package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -0
- package/lib/plugins/selection/index.d.ts +8 -0
- package/lib/plugins/selection/index.d.ts.map +1 -0
- package/lib/plugins/selection/index.js +86 -75
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/selection/range-selection.d.ts +109 -0
- package/lib/plugins/selection/range-selection.d.ts.map +1 -0
- package/lib/plugins/selection/row-selection.d.ts +48 -0
- package/lib/plugins/selection/row-selection.d.ts.map +1 -0
- package/lib/plugins/selection/types.d.ts +80 -0
- package/lib/plugins/selection/types.d.ts.map +1 -0
- package/lib/plugins/server-side/ServerSidePlugin.d.ts +56 -0
- package/lib/plugins/server-side/ServerSidePlugin.d.ts.map +1 -0
- package/lib/plugins/server-side/cache.d.ts +14 -0
- package/lib/plugins/server-side/cache.d.ts.map +1 -0
- package/lib/plugins/server-side/datasource.d.ts +12 -0
- package/lib/plugins/server-side/datasource.d.ts.map +1 -0
- package/lib/plugins/server-side/index.d.ts +7 -0
- package/lib/plugins/server-side/index.d.ts.map +1 -0
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/server-side/types.d.ts +43 -0
- package/lib/plugins/server-side/types.d.ts.map +1 -0
- package/lib/plugins/tree/TreePlugin.d.ts +49 -0
- package/lib/plugins/tree/TreePlugin.d.ts.map +1 -0
- package/lib/plugins/tree/index.d.ts +8 -0
- package/lib/plugins/tree/index.d.ts.map +1 -0
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/tree/tree-data.d.ts +42 -0
- package/lib/plugins/tree/tree-data.d.ts.map +1 -0
- package/lib/plugins/tree/tree-detect.d.ts +24 -0
- package/lib/plugins/tree/tree-detect.d.ts.map +1 -0
- package/lib/plugins/tree/types.d.ts +61 -0
- package/lib/plugins/tree/types.d.ts.map +1 -0
- package/lib/plugins/undo-redo/UndoRedoPlugin.d.ts +68 -0
- package/lib/plugins/undo-redo/UndoRedoPlugin.d.ts.map +1 -0
- package/lib/plugins/undo-redo/history.d.ts +64 -0
- package/lib/plugins/undo-redo/history.d.ts.map +1 -0
- package/lib/plugins/undo-redo/index.d.ts +7 -0
- package/lib/plugins/undo-redo/index.d.ts.map +1 -0
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/undo-redo/types.d.ts +41 -0
- package/lib/plugins/undo-redo/types.d.ts.map +1 -0
- package/lib/plugins/visibility/VisibilityPlugin.d.ts +135 -0
- package/lib/plugins/visibility/VisibilityPlugin.d.ts.map +1 -0
- package/lib/plugins/visibility/index.d.ts +8 -0
- package/lib/plugins/visibility/index.d.ts.map +1 -0
- package/lib/plugins/visibility/index.js.map +1 -1
- package/lib/plugins/visibility/types.d.ts +33 -0
- package/lib/plugins/visibility/types.d.ts.map +1 -0
- package/lib/plugins/visibility/visibility.d.ts +30 -0
- package/lib/plugins/visibility/visibility.d.ts.map +1 -0
- package/package.json +6 -2
- package/public.d.ts +52 -0
- package/public.d.ts.map +1 -0
- package/umd/grid.all.umd.js +32 -74
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +22 -64
- package/umd/grid.umd.js.map +1 -1
- package/umd/plugins/context-menu.umd.js +1 -1
- package/umd/plugins/context-menu.umd.js.map +1 -1
- package/umd/plugins/filtering.umd.js +1 -1
- package/umd/plugins/filtering.umd.js.map +1 -1
- package/umd/plugins/grouping-columns.umd.js +1 -1
- package/umd/plugins/grouping-columns.umd.js.map +1 -1
- package/umd/plugins/grouping-rows.umd.js +1 -1
- package/umd/plugins/grouping-rows.umd.js.map +1 -1
- package/umd/plugins/master-detail.umd.js +1 -1
- package/umd/plugins/master-detail.umd.js.map +1 -1
- package/umd/plugins/pinned-rows.umd.js +1 -1
- package/umd/plugins/pinned-rows.umd.js.map +1 -1
- package/umd/plugins/pivot.umd.js.map +1 -1
- package/umd/plugins/selection.umd.js +1 -1
- package/umd/plugins/selection.umd.js.map +1 -1
- package/index-YjW60MHD.js +0 -3235
- package/index-YjW60MHD.js.map +0 -1
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { ColumnConfig } from '../../core/types';
|
|
2
|
+
/** Position of the status bar relative to the grid */
|
|
3
|
+
export type PinnedRowsPosition = 'top' | 'bottom';
|
|
4
|
+
/** Aggregator function signature */
|
|
5
|
+
export type AggregatorFn = (rows: unknown[], field: string, column?: ColumnConfig) => unknown;
|
|
6
|
+
/** Aggregator formatter function - formats the computed value for display */
|
|
7
|
+
export type AggregatorFormatter = (value: unknown, field: string, column?: ColumnConfig) => string;
|
|
8
|
+
/** Simple aggregator reference - string key for built-in or custom function */
|
|
9
|
+
export type AggregatorRef = string | AggregatorFn;
|
|
10
|
+
/** Full aggregator config with optional formatter */
|
|
11
|
+
export interface AggregatorConfig {
|
|
12
|
+
/** The aggregator function or built-in key ('sum', 'avg', 'min', 'max', 'count', 'first', 'last') */
|
|
13
|
+
aggFunc: AggregatorRef;
|
|
14
|
+
/** Optional formatter to format the computed value for display */
|
|
15
|
+
formatter?: AggregatorFormatter;
|
|
16
|
+
}
|
|
17
|
+
/** Aggregator definition - simple string/function or full config object */
|
|
18
|
+
export type AggregatorDefinition = AggregatorRef | AggregatorConfig;
|
|
19
|
+
/**
|
|
20
|
+
* Configuration for an aggregation row (footer/header row with computed values).
|
|
21
|
+
* Replaces the core FooterRowConfig functionality.
|
|
22
|
+
*/
|
|
23
|
+
export interface AggregationRowConfig {
|
|
24
|
+
/** Optional identifier (useful for diffing or targeted updates) */
|
|
25
|
+
id?: string;
|
|
26
|
+
/** Position: 'top' renders above grid body, 'bottom' renders below (default: 'bottom') */
|
|
27
|
+
position?: 'top' | 'bottom';
|
|
28
|
+
/** If true, row rendered as single spanning cell with label */
|
|
29
|
+
fullWidth?: boolean;
|
|
30
|
+
/** Label when in fullWidth mode */
|
|
31
|
+
label?: string;
|
|
32
|
+
/** Static or computed cell values keyed by field */
|
|
33
|
+
cells?: Record<string, unknown | string | ((rows: unknown[], field: string, column?: ColumnConfig) => unknown)>;
|
|
34
|
+
/**
|
|
35
|
+
* Per-field aggregator configuration.
|
|
36
|
+
* Can be a simple string ('sum', 'avg', etc.), a function, or an object with aggFunc and formatter.
|
|
37
|
+
* @example
|
|
38
|
+
* aggregators: {
|
|
39
|
+
* quantity: 'sum', // simple built-in
|
|
40
|
+
* price: { aggFunc: 'sum', formatter: (v) => `$${v.toFixed(2)}` } // with formatter
|
|
41
|
+
* }
|
|
42
|
+
*/
|
|
43
|
+
aggregators?: Record<string, AggregatorDefinition>;
|
|
44
|
+
}
|
|
45
|
+
/** Configuration options for the status bar plugin */
|
|
46
|
+
export interface PinnedRowsConfig {
|
|
47
|
+
/** Position of the info bar (default: 'bottom') */
|
|
48
|
+
position?: PinnedRowsPosition;
|
|
49
|
+
/** Show total row count in info bar (default: true) */
|
|
50
|
+
showRowCount?: boolean;
|
|
51
|
+
/** Show selected row count in info bar (default: true) */
|
|
52
|
+
showSelectedCount?: boolean;
|
|
53
|
+
/** Show filtered row count when filter is active (default: true) */
|
|
54
|
+
showFilteredCount?: boolean;
|
|
55
|
+
/** Custom panels to display in the info bar */
|
|
56
|
+
customPanels?: PinnedRowsPanel[];
|
|
57
|
+
/** Aggregation rows (footer/header rows with computed values) */
|
|
58
|
+
aggregationRows?: AggregationRowConfig[];
|
|
59
|
+
}
|
|
60
|
+
/** Custom panel definition for the status bar */
|
|
61
|
+
export interface PinnedRowsPanel {
|
|
62
|
+
/** Unique identifier for the panel */
|
|
63
|
+
id: string;
|
|
64
|
+
/** Position within the status bar */
|
|
65
|
+
position: 'left' | 'center' | 'right';
|
|
66
|
+
/** Render function for the panel content */
|
|
67
|
+
render: (context: PinnedRowsContext) => HTMLElement | string;
|
|
68
|
+
}
|
|
69
|
+
/** Context provided to panel renderers */
|
|
70
|
+
export interface PinnedRowsContext {
|
|
71
|
+
/** Total number of rows in the grid */
|
|
72
|
+
totalRows: number;
|
|
73
|
+
/** Number of rows after filtering */
|
|
74
|
+
filteredRows: number;
|
|
75
|
+
/** Number of selected rows */
|
|
76
|
+
selectedRows: number;
|
|
77
|
+
/** Current column configuration */
|
|
78
|
+
columns: ColumnConfig[];
|
|
79
|
+
/** Current row data */
|
|
80
|
+
rows: unknown[];
|
|
81
|
+
/** Reference to the grid element */
|
|
82
|
+
grid: HTMLElement;
|
|
83
|
+
}
|
|
84
|
+
/** Internal state managed by the status bar plugin */
|
|
85
|
+
export interface PinnedRowsState {
|
|
86
|
+
/** The info bar DOM element */
|
|
87
|
+
infoBarElement: HTMLElement | null;
|
|
88
|
+
/** Top aggregation rows container */
|
|
89
|
+
topAggregationContainer: HTMLElement | null;
|
|
90
|
+
/** Bottom aggregation rows container */
|
|
91
|
+
bottomAggregationContainer: HTMLElement | null;
|
|
92
|
+
/** Footer wrapper for sticky bottom elements */
|
|
93
|
+
footerWrapper: HTMLElement | null;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/pinned-rows/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,sDAAsD;AACtD,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,QAAQ,CAAC;AAElD,oCAAoC;AACpC,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,KAAK,OAAO,CAAC;AAE9F,6EAA6E;AAC7E,MAAM,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,KAAK,MAAM,CAAC;AAEnG,+EAA+E;AAC/E,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,YAAY,CAAC;AAElD,qDAAqD;AACrD,MAAM,WAAW,gBAAgB;IAC/B,qGAAqG;IACrG,OAAO,EAAE,aAAa,CAAC;IACvB,kEAAkE;IAClE,SAAS,CAAC,EAAE,mBAAmB,CAAC;CACjC;AAED,2EAA2E;AAC3E,MAAM,MAAM,oBAAoB,GAAG,aAAa,GAAG,gBAAgB,CAAC;AAEpE;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,mEAAmE;IACnE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC5B,+DAA+D;IAC/D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mCAAmC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,MA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B;IAC/B,cAAc,EAAE,WAAW,GAAG,IAAI,CAAC;IACnC,qCAAqC;IACrC,uBAAuB,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5C,wCAAwC;IACxC,0BAA0B,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/C,gDAAgD;IAChD,aAAa,EAAE,WAAW,GAAG,IAAI,CAAC;CACnC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { BaseGridPlugin } from '../../core/plugin/base-plugin';
|
|
2
|
+
import { ColumnConfig, ToolPanelDefinition } from '../../core/types';
|
|
3
|
+
import { PivotDataRow } from './pivot-engine';
|
|
4
|
+
import { PivotConfig, PivotResult, PivotValueField } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Pivot Plugin for tbw-grid
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* new PivotPlugin({
|
|
11
|
+
* rowGroupFields: ['category'],
|
|
12
|
+
* columnGroupFields: ['region'],
|
|
13
|
+
* valueFields: [{ field: 'sales', aggFunc: 'sum' }]
|
|
14
|
+
* })
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare class PivotPlugin extends BaseGridPlugin<PivotConfig> {
|
|
18
|
+
readonly name = "pivot";
|
|
19
|
+
readonly version = "1.0.0";
|
|
20
|
+
/** Tool panel ID for shell integration */
|
|
21
|
+
static readonly PANEL_ID = "pivot";
|
|
22
|
+
protected get defaultConfig(): Partial<PivotConfig>;
|
|
23
|
+
private isActive;
|
|
24
|
+
private hasInitialized;
|
|
25
|
+
private pivotResult;
|
|
26
|
+
private fieldHeaderMap;
|
|
27
|
+
private expandedKeys;
|
|
28
|
+
private defaultExpanded;
|
|
29
|
+
private originalColumns;
|
|
30
|
+
private panelContainer;
|
|
31
|
+
private grandTotalFooter;
|
|
32
|
+
private previousVisibleKeys;
|
|
33
|
+
private keysToAnimate;
|
|
34
|
+
/**
|
|
35
|
+
* Check if the plugin has valid pivot configuration (at least value fields).
|
|
36
|
+
*/
|
|
37
|
+
private hasValidPivotConfig;
|
|
38
|
+
/**
|
|
39
|
+
* Get animation style respecting grid-level animation mode.
|
|
40
|
+
*/
|
|
41
|
+
private get animationStyle();
|
|
42
|
+
detach(): void;
|
|
43
|
+
getToolPanel(): ToolPanelDefinition | undefined;
|
|
44
|
+
processRows(rows: readonly unknown[]): PivotDataRow[];
|
|
45
|
+
processColumns(columns: readonly ColumnConfig[]): ColumnConfig[];
|
|
46
|
+
renderRow(row: Record<string, unknown>, rowEl: HTMLElement): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Remove pivot-specific classes, attributes, and inline styles from a row element.
|
|
49
|
+
* Called when pivot mode is disabled to clean up reused DOM elements.
|
|
50
|
+
* Clears innerHTML so the grid's default renderer can rebuild the row.
|
|
51
|
+
*/
|
|
52
|
+
private cleanupPivotStyling;
|
|
53
|
+
afterRender(): void;
|
|
54
|
+
/**
|
|
55
|
+
* Render the grand total row as a sticky footer pinned to the bottom.
|
|
56
|
+
*/
|
|
57
|
+
private renderGrandTotalFooter;
|
|
58
|
+
/**
|
|
59
|
+
* Remove the grand total footer element.
|
|
60
|
+
*/
|
|
61
|
+
private cleanupGrandTotalFooter;
|
|
62
|
+
toggle(key: string): void;
|
|
63
|
+
expand(key: string): void;
|
|
64
|
+
collapse(key: string): void;
|
|
65
|
+
expandAll(): void;
|
|
66
|
+
collapseAll(): void;
|
|
67
|
+
isExpanded(key: string): boolean;
|
|
68
|
+
enablePivot(): void;
|
|
69
|
+
disablePivot(): void;
|
|
70
|
+
isPivotActive(): boolean;
|
|
71
|
+
getPivotResult(): PivotResult | null;
|
|
72
|
+
setRowGroupFields(fields: string[]): void;
|
|
73
|
+
setColumnGroupFields(fields: string[]): void;
|
|
74
|
+
setValueFields(fields: PivotValueField[]): void;
|
|
75
|
+
refresh(): void;
|
|
76
|
+
showPanel(): void;
|
|
77
|
+
hidePanel(): void;
|
|
78
|
+
togglePanel(): void;
|
|
79
|
+
isPanelVisible(): boolean;
|
|
80
|
+
private get gridColumns();
|
|
81
|
+
private buildFieldHeaderMap;
|
|
82
|
+
private getAvailableFields;
|
|
83
|
+
private captureOriginalColumns;
|
|
84
|
+
private renderPanel;
|
|
85
|
+
private refreshPanel;
|
|
86
|
+
private addFieldToZone;
|
|
87
|
+
private removeFieldFromZone;
|
|
88
|
+
private removeFromOtherZones;
|
|
89
|
+
private addValueField;
|
|
90
|
+
private removeValueField;
|
|
91
|
+
private updateValueAggFunc;
|
|
92
|
+
readonly styles: string;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=PivotPlugin.d.ts.map
|
|
@@ -0,0 +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,EAAc,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACtF,OAAO,EAAiD,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAIlG,OAAO,KAAK,EAAoC,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAmB3G;;;;;;;;;;;GAWG;AACH,qBAAa,WAAY,SAAQ,cAAc,CAAC,WAAW,CAAC;IAC1D,QAAQ,CAAC,IAAI,WAAW;IACxB,SAAkB,OAAO,WAAW;IAEpC,0CAA0C;IAC1C,MAAM,CAAC,QAAQ,CAAC,QAAQ,WAAW;IAEnC,cAAuB,aAAa,IAAI,OAAO,CAAC,WAAW,CAAC,CAQ3D;IAGD,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,WAAW,CAA4B;IAC/C,OAAO,CAAC,cAAc,CAAkC;IACxD,OAAO,CAAC,YAAY,CAA0B;IAC9C,OAAO,CAAC,eA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AE,GAAG,IAAI;IAK/C,OAAO,IAAI,IAAI;IASf,SAAS,IAAI,IAAI;IAKjB,SAAS,IAAI,IAAI;IAKjB,WAAW,IAAI,IAAI;IAKnB,cAAc,IAAI,OAAO;IASzB,OAAO,KAAK,WAAW,GAGtB;IAED,OAAO,CAAC,mBAAmB;IAQ3B,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,sBAAsB;IAgB9B,OAAO,CAAC,WAAW;IA+BnB,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,cAAc;IAkBtB,OAAO,CAAC,mBAAmB;IAW3B,OAAO,CAAC,oBAAoB;IAY5B,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,kBAAkB;IAc1B,SAAkB,MAAM,SAAU;CAGnC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pivot Plugin Entry Point
|
|
3
|
+
* Re-exports plugin class and types for tree-shakeable imports.
|
|
4
|
+
*/
|
|
5
|
+
export { PivotPlugin } from './PivotPlugin';
|
|
6
|
+
export type { AggFunc, PivotConfig, PivotResult, PivotValueField } from './types';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/pivot/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
|