@toolbox-web/grid 0.2.8 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +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,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Grid DOM Constants
|
|
3
|
+
*
|
|
4
|
+
* Centralized constants for CSS classes, data attributes, and selectors
|
|
5
|
+
* used throughout the grid. Use these instead of magic strings.
|
|
6
|
+
*
|
|
7
|
+
* Note: Some constants here are used by plugins but defined in core because:
|
|
8
|
+
* 1. The core CSS needs to style these elements (e.g., sticky positioning)
|
|
9
|
+
* 2. Multiple plugins may share the same class names
|
|
10
|
+
*
|
|
11
|
+
* Plugins can define their own additional constants and export them.
|
|
12
|
+
* See each plugin's index.ts for plugin-specific exports.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* CSS class names used in the grid's shadow DOM.
|
|
16
|
+
* Use these when adding/removing classes or querying elements.
|
|
17
|
+
*
|
|
18
|
+
* Classes are organized by:
|
|
19
|
+
* - Core: Used by the grid core for structure and basic functionality
|
|
20
|
+
* - Shared: Used by multiple features/plugins, styled by core CSS
|
|
21
|
+
*/
|
|
22
|
+
export declare const GridClasses: {
|
|
23
|
+
readonly ROOT: "tbw-grid-root";
|
|
24
|
+
readonly HEADER: "header";
|
|
25
|
+
readonly HEADER_ROW: "header-row";
|
|
26
|
+
readonly HEADER_CELL: "header-cell";
|
|
27
|
+
readonly ROWS_VIEWPORT: "rows-viewport";
|
|
28
|
+
readonly ROWS_SPACER: "rows-spacer";
|
|
29
|
+
readonly ROWS_CONTAINER: "rows";
|
|
30
|
+
readonly DATA_ROW: "data-row";
|
|
31
|
+
readonly GROUP_ROW: "group-row";
|
|
32
|
+
readonly DATA_CELL: "data-cell";
|
|
33
|
+
readonly SELECTED: "selected";
|
|
34
|
+
readonly FOCUSED: "focused";
|
|
35
|
+
readonly EDITING: "editing";
|
|
36
|
+
readonly EXPANDED: "expanded";
|
|
37
|
+
readonly COLLAPSED: "collapsed";
|
|
38
|
+
readonly DRAGGING: "dragging";
|
|
39
|
+
readonly RESIZING: "resizing";
|
|
40
|
+
readonly SORTABLE: "sortable";
|
|
41
|
+
readonly SORTED_ASC: "sorted-asc";
|
|
42
|
+
readonly SORTED_DESC: "sorted-desc";
|
|
43
|
+
readonly HIDDEN: "hidden";
|
|
44
|
+
readonly STICKY_LEFT: "sticky-left";
|
|
45
|
+
readonly STICKY_RIGHT: "sticky-right";
|
|
46
|
+
readonly PINNED_TOP: "pinned-top";
|
|
47
|
+
readonly PINNED_BOTTOM: "pinned-bottom";
|
|
48
|
+
readonly TREE_TOGGLE: "tree-toggle";
|
|
49
|
+
readonly TREE_INDENT: "tree-indent";
|
|
50
|
+
readonly GROUP_TOGGLE: "group-toggle";
|
|
51
|
+
readonly GROUP_LABEL: "group-label";
|
|
52
|
+
readonly GROUP_COUNT: "group-count";
|
|
53
|
+
readonly RANGE_SELECTION: "range-selection";
|
|
54
|
+
readonly SELECTION_OVERLAY: "selection-overlay";
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Data attribute names used on grid elements.
|
|
58
|
+
* Use these when getting/setting data attributes.
|
|
59
|
+
*/
|
|
60
|
+
export declare const GridDataAttrs: {
|
|
61
|
+
readonly ROW_INDEX: "data-row-index";
|
|
62
|
+
readonly COL_INDEX: "data-col-index";
|
|
63
|
+
readonly FIELD: "data-field";
|
|
64
|
+
readonly GROUP_KEY: "data-group-key";
|
|
65
|
+
readonly TREE_LEVEL: "data-tree-level";
|
|
66
|
+
readonly STICKY: "data-sticky";
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Common CSS selectors for querying grid elements.
|
|
70
|
+
* Built from the class constants for consistency.
|
|
71
|
+
*/
|
|
72
|
+
export declare const GridSelectors: {
|
|
73
|
+
readonly ROOT: ".tbw-grid-root";
|
|
74
|
+
readonly HEADER: ".header";
|
|
75
|
+
readonly HEADER_ROW: ".header-row";
|
|
76
|
+
readonly HEADER_CELL: ".header-cell";
|
|
77
|
+
readonly ROWS_VIEWPORT: ".rows-viewport";
|
|
78
|
+
readonly ROWS_CONTAINER: ".rows";
|
|
79
|
+
readonly DATA_ROW: ".data-row";
|
|
80
|
+
readonly DATA_CELL: ".data-cell";
|
|
81
|
+
readonly GROUP_ROW: ".group-row";
|
|
82
|
+
readonly ROW_BY_INDEX: (index: number) => string;
|
|
83
|
+
readonly CELL_BY_FIELD: (field: string) => string;
|
|
84
|
+
readonly CELL_AT: (row: number, col: number) => string;
|
|
85
|
+
readonly SELECTED_ROWS: ".data-row.selected";
|
|
86
|
+
readonly EDITING_CELL: ".data-cell.editing";
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* CSS custom property names for theming.
|
|
90
|
+
* Use these when programmatically setting styles.
|
|
91
|
+
*/
|
|
92
|
+
export declare const GridCSSVars: {
|
|
93
|
+
readonly COLOR_BG: "--tbw-color-bg";
|
|
94
|
+
readonly COLOR_FG: "--tbw-color-fg";
|
|
95
|
+
readonly COLOR_FG_MUTED: "--tbw-color-fg-muted";
|
|
96
|
+
readonly COLOR_BORDER: "--tbw-color-border";
|
|
97
|
+
readonly COLOR_ACCENT: "--tbw-color-accent";
|
|
98
|
+
readonly COLOR_HEADER_BG: "--tbw-color-header-bg";
|
|
99
|
+
readonly COLOR_HEADER_FG: "--tbw-color-header-fg";
|
|
100
|
+
readonly COLOR_SELECTION: "--tbw-color-selection";
|
|
101
|
+
readonly COLOR_ROW_HOVER: "--tbw-color-row-hover";
|
|
102
|
+
readonly COLOR_ROW_ALT: "--tbw-color-row-alt";
|
|
103
|
+
readonly ROW_HEIGHT: "--tbw-row-height";
|
|
104
|
+
readonly HEADER_HEIGHT: "--tbw-header-height";
|
|
105
|
+
readonly CELL_PADDING: "--tbw-cell-padding";
|
|
106
|
+
readonly FONT_FAMILY: "--tbw-font-family";
|
|
107
|
+
readonly FONT_SIZE: "--tbw-font-size";
|
|
108
|
+
readonly BORDER_RADIUS: "--tbw-border-radius";
|
|
109
|
+
readonly FOCUS_OUTLINE: "--tbw-focus-outline";
|
|
110
|
+
};
|
|
111
|
+
export type GridClassName = (typeof GridClasses)[keyof typeof GridClasses];
|
|
112
|
+
export type GridDataAttr = (typeof GridDataAttrs)[keyof typeof GridDataAttrs];
|
|
113
|
+
export type GridCSSVar = (typeof GridCSSVars)[keyof typeof GridCSSVars];
|
|
114
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../libs/grid/src/lib/core/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4Dd,CAAC;AAMX;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;;CAUhB,CAAC;AAMX;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;mCAYF,MAAM;oCACL,MAAM;4BACd,MAAM,OAAO,MAAM;;;CAM1B,CAAC;AAMX;;;GAGG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;CAyBd,CAAC;AAKX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAC3E,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAC9E,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import { BaseGridPlugin, PluginQuery } from './plugin/base-plugin';
|
|
2
|
+
import { ActivateCellDetail, CellCommitDetail, ColumnConfig, ColumnConfigMap, ColumnInternal, ColumnResizeDetail, FitMode, FrameworkAdapter, GridColumnState, GridConfig, HeaderContentDefinition, InternalGrid, ResizeController, RowCommitDetail, SortChangeDetail, ToolbarButtonConfig, ToolbarButtonInfo, ToolPanelDefinition, VirtualState } from './types';
|
|
3
|
+
export declare class DataGridElement<T = any> extends HTMLElement implements InternalGrid<T> {
|
|
4
|
+
#private;
|
|
5
|
+
static readonly tagName = "tbw-grid";
|
|
6
|
+
static readonly version: string;
|
|
7
|
+
/**
|
|
8
|
+
* Registry of framework adapters that handle converting light DOM elements
|
|
9
|
+
* to functional renderers/editors. Framework libraries (Angular, React, Vue)
|
|
10
|
+
* register adapters to enable zero-boilerplate component integration.
|
|
11
|
+
*/
|
|
12
|
+
private static adapters;
|
|
13
|
+
/**
|
|
14
|
+
* Register a framework adapter for handling framework-specific components.
|
|
15
|
+
* Adapters are checked in registration order when processing light DOM templates.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* // In @toolbox-web/grid-angular
|
|
20
|
+
* import { AngularGridAdapter } from '@toolbox-web/grid-angular';
|
|
21
|
+
*
|
|
22
|
+
* // One-time setup in app
|
|
23
|
+
* GridElement.registerAdapter(new AngularGridAdapter(injector, appRef));
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
static registerAdapter(adapter: FrameworkAdapter): void;
|
|
27
|
+
/**
|
|
28
|
+
* Get all registered framework adapters.
|
|
29
|
+
* Used internally by light DOM parsing to find adapters that can handle templates.
|
|
30
|
+
*/
|
|
31
|
+
static getAdapters(): readonly FrameworkAdapter[];
|
|
32
|
+
/**
|
|
33
|
+
* Clear all registered adapters (primarily for testing).
|
|
34
|
+
*/
|
|
35
|
+
static clearAdapters(): void;
|
|
36
|
+
static get observedAttributes(): string[];
|
|
37
|
+
_rows: T[];
|
|
38
|
+
get _columns(): ColumnInternal<T>[];
|
|
39
|
+
set _columns(value: ColumnInternal<T>[]);
|
|
40
|
+
get _visibleColumns(): ColumnInternal<T>[];
|
|
41
|
+
_headerRowEl: HTMLElement;
|
|
42
|
+
_bodyEl: HTMLElement;
|
|
43
|
+
_rowPool: HTMLElement[];
|
|
44
|
+
_resizeController: ResizeController;
|
|
45
|
+
_virtualization: VirtualState;
|
|
46
|
+
_focusRow: number;
|
|
47
|
+
_focusCol: number;
|
|
48
|
+
_sortState: {
|
|
49
|
+
field: string;
|
|
50
|
+
direction: 1 | -1;
|
|
51
|
+
} | null;
|
|
52
|
+
_activeEditRows: number;
|
|
53
|
+
_rowEditSnapshots: Map<number, T>;
|
|
54
|
+
_changedRowIndices: Set<number>;
|
|
55
|
+
_gridTemplate: string;
|
|
56
|
+
__rowRenderEpoch: number;
|
|
57
|
+
__didInitialAutoSize: boolean;
|
|
58
|
+
__lightDomColumnsCache?: ColumnInternal[];
|
|
59
|
+
__originalColumnNodes?: HTMLElement[];
|
|
60
|
+
__originalOrder: T[];
|
|
61
|
+
__rowsBodyEl: HTMLElement | null;
|
|
62
|
+
__scrollAreaEl: HTMLElement | null;
|
|
63
|
+
__footerEl: HTMLElement | null;
|
|
64
|
+
get rows(): T[];
|
|
65
|
+
set rows(value: T[]);
|
|
66
|
+
/**
|
|
67
|
+
* Get the original unfiltered/unprocessed rows.
|
|
68
|
+
* Use this when you need access to all source data regardless of active filters.
|
|
69
|
+
*/
|
|
70
|
+
get sourceRows(): T[];
|
|
71
|
+
get columns(): ColumnConfig<T>[];
|
|
72
|
+
set columns(value: ColumnConfig<T>[] | ColumnConfigMap<T> | undefined);
|
|
73
|
+
get gridConfig(): GridConfig<T>;
|
|
74
|
+
set gridConfig(value: GridConfig<T> | undefined);
|
|
75
|
+
get fitMode(): FitMode;
|
|
76
|
+
set fitMode(value: FitMode | undefined);
|
|
77
|
+
get editOn(): string | boolean | undefined;
|
|
78
|
+
set editOn(value: string | boolean | undefined);
|
|
79
|
+
/**
|
|
80
|
+
* Effective config accessor for internal modules and plugins.
|
|
81
|
+
* Returns the merged config (single source of truth) before plugin processing.
|
|
82
|
+
* Use this when you need the raw merged config (e.g., for column definitions including hidden).
|
|
83
|
+
* @internal Plugin API
|
|
84
|
+
*/
|
|
85
|
+
get effectiveConfig(): GridConfig<T>;
|
|
86
|
+
/**
|
|
87
|
+
* Get the disconnect signal for event listener cleanup.
|
|
88
|
+
* This signal is aborted when the grid disconnects from the DOM.
|
|
89
|
+
* Plugins and internal code can use this for automatic listener cleanup.
|
|
90
|
+
* @internal Plugin API
|
|
91
|
+
* @example
|
|
92
|
+
* element.addEventListener('click', handler, { signal: this.grid.disconnectSignal });
|
|
93
|
+
*/
|
|
94
|
+
get disconnectSignal(): AbortSignal;
|
|
95
|
+
constructor();
|
|
96
|
+
/**
|
|
97
|
+
* Get a plugin instance by its class.
|
|
98
|
+
* Used by plugins for inter-plugin communication.
|
|
99
|
+
* @internal Plugin API
|
|
100
|
+
*/
|
|
101
|
+
getPlugin<P extends BaseGridPlugin>(PluginClass: new (...args: any[]) => P): P | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* Get a plugin instance by its name.
|
|
104
|
+
* Used for loose coupling between plugins (avoids static imports).
|
|
105
|
+
* @internal Plugin API
|
|
106
|
+
*/
|
|
107
|
+
getPluginByName(name: string): BaseGridPlugin | undefined;
|
|
108
|
+
/**
|
|
109
|
+
* Request a full re-render of the grid.
|
|
110
|
+
* Called by plugins when they need the grid to update.
|
|
111
|
+
* Note: This does NOT reset plugin state - just re-processes rows/columns and renders.
|
|
112
|
+
* @internal Plugin API
|
|
113
|
+
*/
|
|
114
|
+
requestRender(): void;
|
|
115
|
+
/**
|
|
116
|
+
* Update the grid's column template CSS.
|
|
117
|
+
* Called by resize controller during column resize operations.
|
|
118
|
+
* @internal
|
|
119
|
+
*/
|
|
120
|
+
updateTemplate(): void;
|
|
121
|
+
/**
|
|
122
|
+
* Request a lightweight style update without rebuilding DOM.
|
|
123
|
+
* Called by plugins when they only need to update CSS classes/styles.
|
|
124
|
+
* This runs all plugin afterRender hooks without rebuilding row/column DOM.
|
|
125
|
+
* @internal Plugin API
|
|
126
|
+
*/
|
|
127
|
+
requestAfterRender(): void;
|
|
128
|
+
connectedCallback(): void;
|
|
129
|
+
disconnectedCallback(): void;
|
|
130
|
+
/**
|
|
131
|
+
* Handle HTML attribute changes.
|
|
132
|
+
* Only processes attribute values when SET (non-null).
|
|
133
|
+
* Removing an attribute does NOT clear JS-set properties.
|
|
134
|
+
*/
|
|
135
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
136
|
+
_emitCellCommit(detail: CellCommitDetail<T>): void;
|
|
137
|
+
_emitRowCommit(detail: RowCommitDetail<T>): void;
|
|
138
|
+
_emitSortChange(detail: SortChangeDetail): void;
|
|
139
|
+
_emitColumnResize(detail: ColumnResizeDetail): void;
|
|
140
|
+
_emitActivateCell(detail: ActivateCellDetail): void;
|
|
141
|
+
/**
|
|
142
|
+
* Find the header row element in the shadow DOM.
|
|
143
|
+
* Used by plugins that need to access header cells for styling or measurement.
|
|
144
|
+
* @internal Plugin API
|
|
145
|
+
*/
|
|
146
|
+
findHeaderRow(): HTMLElement;
|
|
147
|
+
/**
|
|
148
|
+
* Find a rendered row element by its data row index.
|
|
149
|
+
* Returns null if the row is not currently rendered (virtualized out of view).
|
|
150
|
+
* Used by plugins that need to access specific row elements for styling or measurement.
|
|
151
|
+
* @internal Plugin API
|
|
152
|
+
* @param rowIndex - The data row index (not the DOM position)
|
|
153
|
+
*/
|
|
154
|
+
findRenderedRowElement(rowIndex: number): HTMLElement | null;
|
|
155
|
+
/**
|
|
156
|
+
* Dispatch a cell click event to the plugin system.
|
|
157
|
+
* Returns true if any plugin handled the event.
|
|
158
|
+
*/
|
|
159
|
+
_dispatchCellClick(event: MouseEvent, rowIndex: number, colIndex: number, cellEl: HTMLElement): boolean;
|
|
160
|
+
/**
|
|
161
|
+
* Dispatch a row click event to the plugin system.
|
|
162
|
+
* Returns true if any plugin handled the event.
|
|
163
|
+
*/
|
|
164
|
+
_dispatchRowClick(event: MouseEvent, rowIndex: number, row: any, rowEl: HTMLElement): boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Dispatch a header click event to the plugin system.
|
|
167
|
+
* Returns true if any plugin handled the event.
|
|
168
|
+
*/
|
|
169
|
+
_dispatchHeaderClick(event: MouseEvent, colIndex: number, headerEl: HTMLElement): boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Dispatch a keyboard event to the plugin system.
|
|
172
|
+
* Returns true if any plugin handled the event.
|
|
173
|
+
*/
|
|
174
|
+
_dispatchKeyDown(event: KeyboardEvent): boolean;
|
|
175
|
+
/**
|
|
176
|
+
* Get horizontal scroll boundary offsets from plugins.
|
|
177
|
+
* Used by keyboard navigation to ensure focused cells are fully visible
|
|
178
|
+
* when plugins like pinned columns obscure part of the scroll area.
|
|
179
|
+
*/
|
|
180
|
+
_getHorizontalScrollOffsets(rowEl?: HTMLElement, focusedCell?: HTMLElement): {
|
|
181
|
+
left: number;
|
|
182
|
+
right: number;
|
|
183
|
+
skipScroll?: boolean;
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* Query all plugins with a generic query and collect responses.
|
|
187
|
+
* This enables inter-plugin communication without the core knowing plugin-specific concepts.
|
|
188
|
+
* @internal Plugin API
|
|
189
|
+
*
|
|
190
|
+
* @example
|
|
191
|
+
* // Check if any plugin vetoes moving a column
|
|
192
|
+
* const responses = grid.queryPlugins<boolean>({ type: PLUGIN_QUERIES.CAN_MOVE_COLUMN, context: column });
|
|
193
|
+
* const canMove = !responses.includes(false);
|
|
194
|
+
*/
|
|
195
|
+
queryPlugins<T>(query: PluginQuery): T[];
|
|
196
|
+
get changedRows(): T[];
|
|
197
|
+
get changedRowIndices(): number[];
|
|
198
|
+
resetChangedRows(silent?: boolean): Promise<void>;
|
|
199
|
+
beginBulkEdit(rowIndex: number): Promise<void>;
|
|
200
|
+
commitActiveRowEdit(): Promise<void>;
|
|
201
|
+
cancelActiveRowEdit(): Promise<void>;
|
|
202
|
+
ready(): Promise<void>;
|
|
203
|
+
forceLayout(): Promise<void>;
|
|
204
|
+
/** Public method: returns a frozen snapshot of the merged effective configuration */
|
|
205
|
+
getConfig(): Promise<Readonly<GridConfig<T>>>;
|
|
206
|
+
setColumnVisible(field: string, visible: boolean): boolean;
|
|
207
|
+
toggleColumnVisibility(field: string): boolean;
|
|
208
|
+
isColumnVisible(field: string): boolean;
|
|
209
|
+
showAllColumns(): void;
|
|
210
|
+
getAllColumns(): Array<{
|
|
211
|
+
field: string;
|
|
212
|
+
header: string;
|
|
213
|
+
visible: boolean;
|
|
214
|
+
lockVisible?: boolean;
|
|
215
|
+
}>;
|
|
216
|
+
setColumnOrder(order: string[]): void;
|
|
217
|
+
getColumnOrder(): string[];
|
|
218
|
+
/**
|
|
219
|
+
* Get the current column state, including order, width, visibility, sort, and plugin state.
|
|
220
|
+
* Returns a serializable object suitable for localStorage or database storage.
|
|
221
|
+
*/
|
|
222
|
+
getColumnState(): GridColumnState;
|
|
223
|
+
/**
|
|
224
|
+
* Set the column state, restoring order, width, visibility, sort, and plugin state.
|
|
225
|
+
* Use this to restore previously saved column state.
|
|
226
|
+
*/
|
|
227
|
+
set columnState(state: GridColumnState | undefined);
|
|
228
|
+
/**
|
|
229
|
+
* Get the current column state.
|
|
230
|
+
*/
|
|
231
|
+
get columnState(): GridColumnState | undefined;
|
|
232
|
+
/**
|
|
233
|
+
* Request a state change event to be emitted.
|
|
234
|
+
* Called internally after resize, reorder, visibility, or sort changes.
|
|
235
|
+
* Plugins should call this after changing their state.
|
|
236
|
+
* The event is debounced to avoid excessive events during drag operations.
|
|
237
|
+
* @internal Plugin API
|
|
238
|
+
*/
|
|
239
|
+
requestStateChange(): void;
|
|
240
|
+
/**
|
|
241
|
+
* Reset column state to initial configuration.
|
|
242
|
+
* Clears all user modifications (order, width, visibility, sort).
|
|
243
|
+
*/
|
|
244
|
+
resetColumnState(): void;
|
|
245
|
+
/** Check if the tool panel is currently open. */
|
|
246
|
+
get isToolPanelOpen(): boolean;
|
|
247
|
+
/**
|
|
248
|
+
* Get the currently active tool panel ID, or null if none is open.
|
|
249
|
+
* @deprecated Use isToolPanelOpen and expandedToolPanelSections instead.
|
|
250
|
+
*/
|
|
251
|
+
get activeToolPanel(): string | null;
|
|
252
|
+
/** Get the IDs of expanded accordion sections. */
|
|
253
|
+
get expandedToolPanelSections(): string[];
|
|
254
|
+
/** Open the tool panel (accordion view with all registered panels). */
|
|
255
|
+
openToolPanel(): void;
|
|
256
|
+
/** Close the tool panel. */
|
|
257
|
+
closeToolPanel(): void;
|
|
258
|
+
/** Toggle the tool panel open/closed. */
|
|
259
|
+
toggleToolPanel(): void;
|
|
260
|
+
/** Toggle an accordion section expanded/collapsed. */
|
|
261
|
+
toggleToolPanelSection(sectionId: string): void;
|
|
262
|
+
/** Get registered tool panel definitions. */
|
|
263
|
+
getToolPanels(): ToolPanelDefinition[];
|
|
264
|
+
/** Register a custom tool panel (without creating a plugin). */
|
|
265
|
+
registerToolPanel(panel: ToolPanelDefinition): void;
|
|
266
|
+
/** Unregister a custom tool panel. */
|
|
267
|
+
unregisterToolPanel(panelId: string): void;
|
|
268
|
+
/** Get registered header content definitions. */
|
|
269
|
+
getHeaderContents(): HeaderContentDefinition[];
|
|
270
|
+
/** Register custom header content (without creating a plugin). */
|
|
271
|
+
registerHeaderContent(content: HeaderContentDefinition): void;
|
|
272
|
+
/** Unregister custom header content. */
|
|
273
|
+
unregisterHeaderContent(contentId: string): void;
|
|
274
|
+
/** Get all registered toolbar buttons. */
|
|
275
|
+
getToolbarButtons(): ToolbarButtonInfo[];
|
|
276
|
+
/** Register a custom toolbar button programmatically. */
|
|
277
|
+
registerToolbarButton(button: ToolbarButtonConfig): void;
|
|
278
|
+
/** Unregister a custom toolbar button. */
|
|
279
|
+
unregisterToolbarButton(buttonId: string): void;
|
|
280
|
+
/** Enable/disable a toolbar button by ID. */
|
|
281
|
+
setToolbarButtonDisabled(buttonId: string, disabled: boolean): void;
|
|
282
|
+
/**
|
|
283
|
+
* Re-parse light DOM shell elements and refresh shell header.
|
|
284
|
+
* Call this after dynamically modifying <tbw-grid-header> children.
|
|
285
|
+
*/
|
|
286
|
+
refreshShellHeader(): void;
|
|
287
|
+
/**
|
|
288
|
+
* Register custom CSS styles to be injected into the grid's shadow DOM.
|
|
289
|
+
* Use this to style custom cell renderers, editors, or detail panels.
|
|
290
|
+
*
|
|
291
|
+
* @param id - Unique identifier for the style block (for removal/updates)
|
|
292
|
+
* @param css - CSS string to inject
|
|
293
|
+
*
|
|
294
|
+
* @example
|
|
295
|
+
* ```typescript
|
|
296
|
+
* // Register custom styles for a detail panel
|
|
297
|
+
* grid.registerStyles('my-detail-styles', `
|
|
298
|
+
* .my-detail-panel { padding: 16px; }
|
|
299
|
+
* .my-detail-table { width: 100%; }
|
|
300
|
+
* `);
|
|
301
|
+
*
|
|
302
|
+
* // Update styles later
|
|
303
|
+
* grid.registerStyles('my-detail-styles', updatedCss);
|
|
304
|
+
*
|
|
305
|
+
* // Remove styles
|
|
306
|
+
* grid.unregisterStyles('my-detail-styles');
|
|
307
|
+
* ```
|
|
308
|
+
*/
|
|
309
|
+
registerStyles(id: string, css: string): void;
|
|
310
|
+
/**
|
|
311
|
+
* Remove previously registered custom styles.
|
|
312
|
+
* @param id - The ID used when registering the styles
|
|
313
|
+
*/
|
|
314
|
+
unregisterStyles(id: string): void;
|
|
315
|
+
/**
|
|
316
|
+
* Get list of registered custom style IDs.
|
|
317
|
+
*/
|
|
318
|
+
getRegisteredStyles(): string[];
|
|
319
|
+
/**
|
|
320
|
+
* Re-parse light DOM column elements and refresh the grid.
|
|
321
|
+
* Call this after framework adapters have registered their templates.
|
|
322
|
+
* @internal Used by framework integration libraries (Angular, React, Vue)
|
|
323
|
+
*/
|
|
324
|
+
refreshColumns(): void;
|
|
325
|
+
/**
|
|
326
|
+
* Core virtualization routine. Chooses between bypass (small datasets), grouped window rendering,
|
|
327
|
+
* or standard row window rendering.
|
|
328
|
+
* @internal Plugin API
|
|
329
|
+
*/
|
|
330
|
+
refreshVirtualWindow(force?: boolean): void;
|
|
331
|
+
}
|
|
332
|
+
declare global {
|
|
333
|
+
interface HTMLElementTagNameMap {
|
|
334
|
+
'tbw-grid': DataGridElement;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
//# sourceMappingURL=grid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../../../../libs/grid/src/lib/core/grid.ts"],"names":[],"mappings":"AAuDA,OAAO,KAAK,EACV,cAAc,EAGd,WAAW,EAEZ,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EACV,kBAAkB,EAElB,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,OAAO,EACP,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,uBAAuB,EACvB,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACb,MAAM,SAAS,CAAC;AAmDjB,qBAAa,e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,IAAI;IAInE;;;OAGG;IACH,kBAAkB,IAAI,IAAI;IAc1B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAY7C;;;OAGG;IACH,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAQlC;;OAEG;IACH,mBAAmB,IAAI,MAAM,EAAE;IAsG/B;;;;OAIG;IACH,cAAc,IAAI,IAAI;IAsEtB;;;;OAIG;IACH,oBAAoB,CAAC,KAAK,UAAQ,GAAG,IAAI;CAwM1C;AAWD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,eAAe,CAAC;KAC7B;CACF"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Aggregators Core Registry
|
|
3
|
+
*
|
|
4
|
+
* Provides a central registry for aggregator functions.
|
|
5
|
+
* Built-in aggregators are provided by default.
|
|
6
|
+
* Plugins can register additional aggregators.
|
|
7
|
+
*
|
|
8
|
+
* The registry is exposed as a singleton object that can be accessed:
|
|
9
|
+
* - By ES module imports: import { aggregatorRegistry } from '@toolbox-web/grid'
|
|
10
|
+
* - By UMD/CDN: TbwGrid.aggregatorRegistry
|
|
11
|
+
* - By plugins via context: ctx.aggregatorRegistry
|
|
12
|
+
*/
|
|
13
|
+
export type AggregatorFn = (rows: any[], field: string, column?: any) => any;
|
|
14
|
+
export type AggregatorRef = string | AggregatorFn;
|
|
15
|
+
/**
|
|
16
|
+
* The aggregator registry singleton.
|
|
17
|
+
* Plugins should access this through context or the global namespace.
|
|
18
|
+
*/
|
|
19
|
+
export declare const aggregatorRegistry: {
|
|
20
|
+
/**
|
|
21
|
+
* Register a custom aggregator function.
|
|
22
|
+
*/
|
|
23
|
+
register(name: string, fn: AggregatorFn): void;
|
|
24
|
+
/**
|
|
25
|
+
* Unregister a custom aggregator function.
|
|
26
|
+
*/
|
|
27
|
+
unregister(name: string): void;
|
|
28
|
+
/**
|
|
29
|
+
* Get an aggregator function by reference.
|
|
30
|
+
*/
|
|
31
|
+
get(ref: AggregatorRef | undefined): AggregatorFn | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Run an aggregator on a set of rows.
|
|
34
|
+
*/
|
|
35
|
+
run(ref: AggregatorRef | undefined, rows: any[], field: string, column?: any): any;
|
|
36
|
+
/**
|
|
37
|
+
* Check if an aggregator exists.
|
|
38
|
+
*/
|
|
39
|
+
has(name: string): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* List all available aggregator names.
|
|
42
|
+
*/
|
|
43
|
+
list(): string[];
|
|
44
|
+
};
|
|
45
|
+
export type ValueAggregatorFn = (values: number[]) => number;
|
|
46
|
+
/**
|
|
47
|
+
* Get a value-based aggregator function.
|
|
48
|
+
* Used by Pivot plugin and other features that aggregate pre-extracted values.
|
|
49
|
+
*
|
|
50
|
+
* @param aggFunc - Aggregation function name ('sum', 'avg', 'count', 'min', 'max', 'first', 'last')
|
|
51
|
+
* @returns Aggregator function that takes number[] and returns number
|
|
52
|
+
*/
|
|
53
|
+
export declare function getValueAggregator(aggFunc: string): ValueAggregatorFn;
|
|
54
|
+
/**
|
|
55
|
+
* Run a value-based aggregator on a set of values.
|
|
56
|
+
*
|
|
57
|
+
* @param aggFunc - Aggregation function name
|
|
58
|
+
* @param values - Array of numbers to aggregate
|
|
59
|
+
* @returns Aggregated result
|
|
60
|
+
*/
|
|
61
|
+
export declare function runValueAggregator(aggFunc: string, values: number[]): number;
|
|
62
|
+
export declare const registerAggregator: (name: string, fn: AggregatorFn) => void;
|
|
63
|
+
export declare const unregisterAggregator: (name: string) => void;
|
|
64
|
+
export declare const getAggregator: (ref: AggregatorRef | undefined) => AggregatorFn | undefined;
|
|
65
|
+
export declare const runAggregator: (ref: AggregatorRef | undefined, rows: any[], field: string, column?: any) => any;
|
|
66
|
+
export declare const listAggregators: () => string[];
|
|
67
|
+
//# sourceMappingURL=aggregators.d.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AlEf,aAAa,GAAG,SAAS,QAAQ,GAAG,EAAE,SAAS,MAAM,WAAW,GAAG,KAAG,GAkEL,CAAC;AAC7E,eAAO,MAAM,eAAe,QApDlB,MAAM,EAoD+D,CAAC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { BaseGridPlugin } from '../plugin';
|
|
2
|
+
import { ColumnConfig, GridColumnState, InternalGrid } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Collect column state from the grid and all plugins.
|
|
5
|
+
* Returns a complete GridColumnState object ready for serialization.
|
|
6
|
+
*/
|
|
7
|
+
export declare function collectColumnState<T>(grid: InternalGrid<T>, plugins: BaseGridPlugin[]): GridColumnState;
|
|
8
|
+
/**
|
|
9
|
+
* Apply column state to the grid and all plugins.
|
|
10
|
+
* Modifies the grid's internal state and triggers plugin state restoration.
|
|
11
|
+
*
|
|
12
|
+
* @param grid - The grid instance
|
|
13
|
+
* @param state - The state to apply
|
|
14
|
+
* @param allColumns - All available columns (including hidden ones)
|
|
15
|
+
* @param plugins - Plugins that may have applyColumnState hooks
|
|
16
|
+
*/
|
|
17
|
+
export declare function applyColumnState<T>(grid: InternalGrid<T>, state: GridColumnState, allColumns: ColumnConfig<T>[], plugins: BaseGridPlugin[]): void;
|
|
18
|
+
/**
|
|
19
|
+
* Create a state change handler with debouncing.
|
|
20
|
+
* Returns a function that, when called, will eventually emit the state change event.
|
|
21
|
+
*/
|
|
22
|
+
export declare function createStateChangeHandler<T>(grid: InternalGrid<T>, getPlugins: () => BaseGridPlugin[], emit: (detail: GridColumnState) => void): () => void;
|
|
23
|
+
/**
|
|
24
|
+
* Compare two column states to check if they are equal.
|
|
25
|
+
* Useful for preventing duplicate state change events.
|
|
26
|
+
*/
|
|
27
|
+
export declare function areColumnStatesEqual(a: GridColumnState, b: GridColumnState): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* State manager for a grid instance.
|
|
30
|
+
* Encapsulates the state change handler and initial state storage.
|
|
31
|
+
*/
|
|
32
|
+
export interface ColumnStateManager {
|
|
33
|
+
/** The initial state to apply after initialization */
|
|
34
|
+
initialState: GridColumnState | undefined;
|
|
35
|
+
/** Debounced state change handler */
|
|
36
|
+
stateChangeHandler: (() => void) | undefined;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Create a column state manager for a grid.
|
|
40
|
+
*/
|
|
41
|
+
export declare function createColumnStateManager(): ColumnStateManager;
|
|
42
|
+
/**
|
|
43
|
+
* Get the current column state from the grid.
|
|
44
|
+
* @param grid - The grid instance
|
|
45
|
+
* @param plugins - Array of attached plugins
|
|
46
|
+
* @returns Serializable column state object
|
|
47
|
+
*/
|
|
48
|
+
export declare function getGridColumnState<T>(grid: InternalGrid<T>, plugins: BaseGridPlugin[]): GridColumnState;
|
|
49
|
+
/**
|
|
50
|
+
* Set column state on a grid, storing for later if not yet initialized.
|
|
51
|
+
* @param grid - The grid instance
|
|
52
|
+
* @param state - The state to apply
|
|
53
|
+
* @param manager - The column state manager
|
|
54
|
+
* @param isInitialized - Whether the grid is initialized
|
|
55
|
+
* @param applyNow - Function to apply the state immediately
|
|
56
|
+
*/
|
|
57
|
+
export declare function setGridColumnState<T>(state: GridColumnState | undefined, manager: ColumnStateManager, isInitialized: boolean, applyNow: (state: GridColumnState) => void): void;
|
|
58
|
+
/**
|
|
59
|
+
* Request a state change event emission (debounced).
|
|
60
|
+
* @param grid - The grid instance
|
|
61
|
+
* @param manager - The column state manager
|
|
62
|
+
* @param getPlugins - Function to get attached plugins
|
|
63
|
+
* @param emit - Function to emit the event
|
|
64
|
+
*/
|
|
65
|
+
export declare function requestGridStateChange<T>(grid: InternalGrid<T>, manager: ColumnStateManager, getPlugins: () => BaseGridPlugin[], emit: (state: GridColumnState) => void): void;
|
|
66
|
+
/**
|
|
67
|
+
* Reset column state to initial configuration.
|
|
68
|
+
* @param grid - The grid instance
|
|
69
|
+
* @param manager - The column state manager
|
|
70
|
+
* @param plugins - Array of attached plugins
|
|
71
|
+
* @param callbacks - Grid callbacks for triggering updates
|
|
72
|
+
*/
|
|
73
|
+
export declare function resetGridColumnState<T>(grid: InternalGrid<T>, manager: ColumnStateManager, plugins: BaseGridPlugin[], callbacks: {
|
|
74
|
+
mergeEffectiveConfig: () => void;
|
|
75
|
+
setup: () => void;
|
|
76
|
+
requestStateChange: () => void;
|
|
77
|
+
}): void;
|
|
78
|
+
/** Callbacks for visibility changes that need grid integration */
|
|
79
|
+
export interface VisibilityCallbacks {
|
|
80
|
+
emit: (eventName: string, detail: unknown) => void;
|
|
81
|
+
clearRowPool: () => void;
|
|
82
|
+
setup: () => void;
|
|
83
|
+
requestStateChange: () => void;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Set the visibility of a column.
|
|
87
|
+
* @returns true if visibility changed, false otherwise
|
|
88
|
+
*/
|
|
89
|
+
export declare function setColumnVisible<T>(grid: InternalGrid<T>, field: string, visible: boolean, callbacks: VisibilityCallbacks): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Toggle column visibility.
|
|
92
|
+
* @returns true if toggled, false if column not found or locked
|
|
93
|
+
*/
|
|
94
|
+
export declare function toggleColumnVisibility<T>(grid: InternalGrid<T>, field: string, callbacks: VisibilityCallbacks): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Check if a column is visible.
|
|
97
|
+
*/
|
|
98
|
+
export declare function isColumnVisible<T>(grid: InternalGrid<T>, field: string): boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Show all columns.
|
|
101
|
+
*/
|
|
102
|
+
export declare function showAllColumns<T>(grid: InternalGrid<T>, callbacks: VisibilityCallbacks): void;
|
|
103
|
+
/**
|
|
104
|
+
* Get all columns with visibility info.
|
|
105
|
+
*/
|
|
106
|
+
export declare function getAllColumns<T>(grid: InternalGrid<T>): Array<{
|
|
107
|
+
field: string;
|
|
108
|
+
header: string;
|
|
109
|
+
visible: boolean;
|
|
110
|
+
lockVisible?: boolean;
|
|
111
|
+
}>;
|
|
112
|
+
/**
|
|
113
|
+
* Get current column order.
|
|
114
|
+
*/
|
|
115
|
+
export declare function getColumnOrder<T>(grid: InternalGrid<T>): string[];
|
|
116
|
+
/**
|
|
117
|
+
* Set column order.
|
|
118
|
+
*/
|
|
119
|
+
export declare function setColumnOrder<T>(grid: InternalGrid<T>, order: string[], callbacks: {
|
|
120
|
+
renderHeader: () => void;
|
|
121
|
+
updateTemplate: () => void;
|
|
122
|
+
refreshVirtualWindow: () => void;
|
|
123
|
+
}): void;
|
|
124
|
+
//# sourceMappingURL=column-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"column-state.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/core/internal/column-state.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EACV,YAAY,EAIZ,eAAe,EACf,YAAY,EACb,MAAM,UAAU,CAAC;AAsBlB;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,eAAe,CAwCvG;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,EACrB,KAAK,EAAE,eAAe,EACtB,UAAU,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,EAC7B,OAAO,EAAE,cAAc,EAAE,GACxB,IAAI,CA8DN;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,EACxC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,EACrB,UAAU,EAAE,MAAM,cAAc,EAAE,EAClC,IAAI,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,GACtC,MAAM,IAAI,CAgBZ;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,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