@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,616 @@
|
|
|
1
|
+
import { ColumnConfig, ColumnState, GridPlugin, HeaderContentDefinition, IconValue, ToolPanelDefinition, DEFAULT_GRID_ICONS } from '../types';
|
|
2
|
+
import { CellClickEvent, CellEditor, CellMouseEvent, CellRenderer, GridElementRef, HeaderClickEvent, HeaderRenderer, PluginQuery, RowClickEvent, ScrollEvent } from './types';
|
|
3
|
+
export { PLUGIN_QUERIES } from './types';
|
|
4
|
+
export type { CellClickEvent, CellCoords, CellEditor, CellMouseEvent, CellRenderer, ContextMenuItem, ContextMenuParams, GridElementRef, HeaderClickEvent, HeaderRenderer, KeyboardModifiers, PluginCellRenderContext, PluginQuery, RowClickEvent, ScrollEvent, } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Grid element interface for plugins.
|
|
7
|
+
* Extends GridElementRef with plugin-specific methods.
|
|
8
|
+
*/
|
|
9
|
+
export interface GridElement extends GridElementRef {
|
|
10
|
+
getPlugin<T extends BaseGridPlugin>(PluginClass: new (...args: any[]) => T): T | undefined;
|
|
11
|
+
getPluginByName(name: string): BaseGridPlugin | undefined;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Header render context for plugin header renderers.
|
|
15
|
+
*/
|
|
16
|
+
export interface PluginHeaderRenderContext {
|
|
17
|
+
/** Column configuration */
|
|
18
|
+
column: ColumnConfig;
|
|
19
|
+
/** Column index */
|
|
20
|
+
colIndex: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Abstract base class for all grid plugins.
|
|
24
|
+
*
|
|
25
|
+
* @template TConfig - Configuration type for the plugin
|
|
26
|
+
*/
|
|
27
|
+
export declare abstract class BaseGridPlugin<TConfig = unknown> implements GridPlugin {
|
|
28
|
+
/** Unique plugin identifier (derived from class name by default) */
|
|
29
|
+
abstract readonly name: string;
|
|
30
|
+
/** Plugin version - override in subclass if needed */
|
|
31
|
+
readonly version: string;
|
|
32
|
+
/** CSS styles to inject into the grid's shadow DOM */
|
|
33
|
+
readonly styles?: string;
|
|
34
|
+
/** Custom cell renderers keyed by type name */
|
|
35
|
+
readonly cellRenderers?: Record<string, CellRenderer>;
|
|
36
|
+
/** Custom header renderers keyed by type name */
|
|
37
|
+
readonly headerRenderers?: Record<string, HeaderRenderer>;
|
|
38
|
+
/** Custom cell editors keyed by type name */
|
|
39
|
+
readonly cellEditors?: Record<string, CellEditor>;
|
|
40
|
+
/** The grid instance this plugin is attached to */
|
|
41
|
+
protected grid: GridElement;
|
|
42
|
+
/** Plugin configuration - merged with defaults in attach() */
|
|
43
|
+
protected config: TConfig;
|
|
44
|
+
/** User-provided configuration from constructor */
|
|
45
|
+
protected readonly userConfig: Partial<TConfig>;
|
|
46
|
+
/**
|
|
47
|
+
* Default configuration - subclasses should override this getter.
|
|
48
|
+
* Note: This must be a getter (not property initializer) for proper inheritance
|
|
49
|
+
* since property initializers run after parent constructor.
|
|
50
|
+
*/
|
|
51
|
+
protected get defaultConfig(): Partial<TConfig>;
|
|
52
|
+
constructor(config?: Partial<TConfig>);
|
|
53
|
+
/**
|
|
54
|
+
* Called when the plugin is attached to a grid.
|
|
55
|
+
* Override to set up event listeners, initialize state, etc.
|
|
56
|
+
*/
|
|
57
|
+
attach(grid: GridElement): void;
|
|
58
|
+
/**
|
|
59
|
+
* Called when the plugin is detached from a grid.
|
|
60
|
+
* Override to clean up event listeners, timers, etc.
|
|
61
|
+
*/
|
|
62
|
+
detach(): void;
|
|
63
|
+
/**
|
|
64
|
+
* Get another plugin instance from the same grid.
|
|
65
|
+
* Use for inter-plugin communication.
|
|
66
|
+
*/
|
|
67
|
+
protected getPlugin<T extends BaseGridPlugin>(PluginClass: new (...args: any[]) => T): T | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* Emit a custom event from the grid.
|
|
70
|
+
*/
|
|
71
|
+
protected emit<T>(eventName: string, detail: T): void;
|
|
72
|
+
/**
|
|
73
|
+
* Request a re-render of the grid.
|
|
74
|
+
*/
|
|
75
|
+
protected requestRender(): void;
|
|
76
|
+
/**
|
|
77
|
+
* Request a lightweight style update without rebuilding DOM.
|
|
78
|
+
* Use this instead of requestRender() when only CSS classes need updating.
|
|
79
|
+
*/
|
|
80
|
+
protected requestAfterRender(): void;
|
|
81
|
+
/**
|
|
82
|
+
* Get the current rows from the grid.
|
|
83
|
+
*/
|
|
84
|
+
protected get rows(): any[];
|
|
85
|
+
/**
|
|
86
|
+
* Get the original unfiltered/unprocessed rows from the grid.
|
|
87
|
+
* Use this when you need all source data regardless of active filters.
|
|
88
|
+
*/
|
|
89
|
+
protected get sourceRows(): any[];
|
|
90
|
+
/**
|
|
91
|
+
* Get the current columns from the grid.
|
|
92
|
+
*/
|
|
93
|
+
protected get columns(): ColumnConfig[];
|
|
94
|
+
/**
|
|
95
|
+
* Get only visible columns from the grid (excludes hidden).
|
|
96
|
+
* Use this for rendering that needs to match the grid template.
|
|
97
|
+
*/
|
|
98
|
+
protected get visibleColumns(): ColumnConfig[];
|
|
99
|
+
/**
|
|
100
|
+
* Get the shadow root of the grid.
|
|
101
|
+
*/
|
|
102
|
+
protected get shadowRoot(): ShadowRoot | null;
|
|
103
|
+
/**
|
|
104
|
+
* Get the disconnect signal for event listener cleanup.
|
|
105
|
+
* This signal is aborted when the grid disconnects from the DOM.
|
|
106
|
+
* Use this when adding event listeners that should be cleaned up automatically.
|
|
107
|
+
*
|
|
108
|
+
* Best for:
|
|
109
|
+
* - Document/window-level listeners added in attach()
|
|
110
|
+
* - Listeners on the grid element itself
|
|
111
|
+
* - Any listener that should persist across renders
|
|
112
|
+
*
|
|
113
|
+
* Not needed for:
|
|
114
|
+
* - Listeners on elements created in afterRender() (removed with element)
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* element.addEventListener('click', handler, { signal: this.disconnectSignal });
|
|
118
|
+
* document.addEventListener('keydown', handler, { signal: this.disconnectSignal });
|
|
119
|
+
*/
|
|
120
|
+
protected get disconnectSignal(): AbortSignal;
|
|
121
|
+
/**
|
|
122
|
+
* Get the grid-level icons configuration.
|
|
123
|
+
* Returns merged icons (user config + defaults).
|
|
124
|
+
*/
|
|
125
|
+
protected get gridIcons(): typeof DEFAULT_GRID_ICONS;
|
|
126
|
+
/**
|
|
127
|
+
* Resolve an icon value to string or HTMLElement.
|
|
128
|
+
* Checks plugin config first, then grid-level icons, then defaults.
|
|
129
|
+
*
|
|
130
|
+
* @param iconKey - The icon key in GridIcons (e.g., 'expand', 'collapse')
|
|
131
|
+
* @param pluginOverride - Optional plugin-level override
|
|
132
|
+
* @returns The resolved icon value
|
|
133
|
+
*/
|
|
134
|
+
protected resolveIcon(iconKey: keyof typeof DEFAULT_GRID_ICONS, pluginOverride?: IconValue): IconValue;
|
|
135
|
+
/**
|
|
136
|
+
* Set an icon value on an element.
|
|
137
|
+
* Handles both string (text/HTML) and HTMLElement values.
|
|
138
|
+
*
|
|
139
|
+
* @param element - The element to set the icon on
|
|
140
|
+
* @param icon - The icon value (string or HTMLElement)
|
|
141
|
+
*/
|
|
142
|
+
protected setIcon(element: HTMLElement, icon: IconValue): void;
|
|
143
|
+
/**
|
|
144
|
+
* Log a warning message.
|
|
145
|
+
*/
|
|
146
|
+
protected warn(message: string): void;
|
|
147
|
+
/**
|
|
148
|
+
* Transform rows before rendering.
|
|
149
|
+
* Called during each render cycle before rows are rendered to the DOM.
|
|
150
|
+
* Use this to filter, sort, or add computed properties to rows.
|
|
151
|
+
*
|
|
152
|
+
* @param rows - The current rows array (readonly to encourage returning a new array)
|
|
153
|
+
* @returns The modified rows array to render
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* ```ts
|
|
157
|
+
* processRows(rows: readonly any[]): any[] {
|
|
158
|
+
* // Filter out hidden rows
|
|
159
|
+
* return rows.filter(row => !row._hidden);
|
|
160
|
+
* }
|
|
161
|
+
* ```
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* ```ts
|
|
165
|
+
* processRows(rows: readonly any[]): any[] {
|
|
166
|
+
* // Add computed properties
|
|
167
|
+
* return rows.map(row => ({
|
|
168
|
+
* ...row,
|
|
169
|
+
* _fullName: `${row.firstName} ${row.lastName}`
|
|
170
|
+
* }));
|
|
171
|
+
* }
|
|
172
|
+
* ```
|
|
173
|
+
*/
|
|
174
|
+
processRows?(rows: readonly any[]): any[];
|
|
175
|
+
/**
|
|
176
|
+
* Transform columns before rendering.
|
|
177
|
+
* Called during each render cycle before column headers and cells are rendered.
|
|
178
|
+
* Use this to add, remove, or modify column definitions.
|
|
179
|
+
*
|
|
180
|
+
* @param columns - The current columns array (readonly to encourage returning a new array)
|
|
181
|
+
* @returns The modified columns array to render
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```ts
|
|
185
|
+
* processColumns(columns: readonly ColumnConfig[]): ColumnConfig[] {
|
|
186
|
+
* // Add a selection checkbox column
|
|
187
|
+
* return [
|
|
188
|
+
* { field: '_select', header: '', width: 40 },
|
|
189
|
+
* ...columns
|
|
190
|
+
* ];
|
|
191
|
+
* }
|
|
192
|
+
* ```
|
|
193
|
+
*/
|
|
194
|
+
processColumns?(columns: readonly ColumnConfig[]): ColumnConfig[];
|
|
195
|
+
/**
|
|
196
|
+
* Called before each render cycle begins.
|
|
197
|
+
* Use this to prepare state or cache values needed during rendering.
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* ```ts
|
|
201
|
+
* beforeRender(): void {
|
|
202
|
+
* this.visibleRowCount = this.calculateVisibleRows();
|
|
203
|
+
* }
|
|
204
|
+
* ```
|
|
205
|
+
*/
|
|
206
|
+
beforeRender?(): void;
|
|
207
|
+
/**
|
|
208
|
+
* Called after each render cycle completes.
|
|
209
|
+
* Use this for DOM manipulation, adding event listeners to rendered elements,
|
|
210
|
+
* or applying visual effects like selection highlights.
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* ```ts
|
|
214
|
+
* afterRender(): void {
|
|
215
|
+
* // Apply selection styling to rendered rows
|
|
216
|
+
* const rows = this.shadowRoot?.querySelectorAll('.data-row');
|
|
217
|
+
* rows?.forEach((row, i) => {
|
|
218
|
+
* row.classList.toggle('selected', this.selectedRows.has(i));
|
|
219
|
+
* });
|
|
220
|
+
* }
|
|
221
|
+
* ```
|
|
222
|
+
*/
|
|
223
|
+
afterRender?(): void;
|
|
224
|
+
/**
|
|
225
|
+
* Called after scroll-triggered row rendering completes.
|
|
226
|
+
* This is a lightweight hook for applying visual state to recycled DOM elements.
|
|
227
|
+
* Use this instead of afterRender when you need to reapply styling during scroll.
|
|
228
|
+
*
|
|
229
|
+
* Performance note: This is called frequently during scroll. Keep implementation fast.
|
|
230
|
+
*
|
|
231
|
+
* @example
|
|
232
|
+
* ```ts
|
|
233
|
+
* onScrollRender(): void {
|
|
234
|
+
* // Reapply selection state to visible cells
|
|
235
|
+
* this.applySelectionToVisibleCells();
|
|
236
|
+
* }
|
|
237
|
+
* ```
|
|
238
|
+
*/
|
|
239
|
+
onScrollRender?(): void;
|
|
240
|
+
/**
|
|
241
|
+
* Return extra height contributed by this plugin (e.g., expanded detail rows).
|
|
242
|
+
* Used to adjust scrollbar height calculations for virtualization.
|
|
243
|
+
*
|
|
244
|
+
* @returns Total extra height in pixels
|
|
245
|
+
*
|
|
246
|
+
* @example
|
|
247
|
+
* ```ts
|
|
248
|
+
* getExtraHeight(): number {
|
|
249
|
+
* return this.expandedRows.size * this.detailHeight;
|
|
250
|
+
* }
|
|
251
|
+
* ```
|
|
252
|
+
*/
|
|
253
|
+
getExtraHeight?(): number;
|
|
254
|
+
/**
|
|
255
|
+
* Return extra height that appears before a given row index.
|
|
256
|
+
* Used by virtualization to correctly calculate scroll positions when
|
|
257
|
+
* there's variable height content (like expanded detail rows) above the viewport.
|
|
258
|
+
*
|
|
259
|
+
* @param beforeRowIndex - The row index to calculate extra height before
|
|
260
|
+
* @returns Extra height in pixels that appears before this row
|
|
261
|
+
*
|
|
262
|
+
* @example
|
|
263
|
+
* ```ts
|
|
264
|
+
* getExtraHeightBefore(beforeRowIndex: number): number {
|
|
265
|
+
* let height = 0;
|
|
266
|
+
* for (const expandedRowIndex of this.expandedRowIndices) {
|
|
267
|
+
* if (expandedRowIndex < beforeRowIndex) {
|
|
268
|
+
* height += this.getDetailHeight(expandedRowIndex);
|
|
269
|
+
* }
|
|
270
|
+
* }
|
|
271
|
+
* return height;
|
|
272
|
+
* }
|
|
273
|
+
* ```
|
|
274
|
+
*/
|
|
275
|
+
getExtraHeightBefore?(beforeRowIndex: number): number;
|
|
276
|
+
/**
|
|
277
|
+
* Adjust the virtualization start index to render additional rows before the visible range.
|
|
278
|
+
* Use this when expanded content (like detail rows) needs its parent row to remain rendered
|
|
279
|
+
* even when the parent row itself has scrolled above the viewport.
|
|
280
|
+
*
|
|
281
|
+
* @param start - The calculated start row index
|
|
282
|
+
* @param scrollTop - The current scroll position
|
|
283
|
+
* @param rowHeight - The height of a single row
|
|
284
|
+
* @returns The adjusted start index (lower than or equal to original start)
|
|
285
|
+
*
|
|
286
|
+
* @example
|
|
287
|
+
* ```ts
|
|
288
|
+
* adjustVirtualStart(start: number, scrollTop: number, rowHeight: number): number {
|
|
289
|
+
* // If row 5 is expanded and scrolled partially, keep it rendered
|
|
290
|
+
* for (const expandedRowIndex of this.expandedRowIndices) {
|
|
291
|
+
* const expandedRowTop = expandedRowIndex * rowHeight;
|
|
292
|
+
* const expandedRowBottom = expandedRowTop + rowHeight + this.detailHeight;
|
|
293
|
+
* if (expandedRowBottom > scrollTop && expandedRowIndex < start) {
|
|
294
|
+
* return expandedRowIndex;
|
|
295
|
+
* }
|
|
296
|
+
* }
|
|
297
|
+
* return start;
|
|
298
|
+
* }
|
|
299
|
+
* ```
|
|
300
|
+
*/
|
|
301
|
+
adjustVirtualStart?(start: number, scrollTop: number, rowHeight: number): number;
|
|
302
|
+
/**
|
|
303
|
+
* Render a custom row, bypassing the default row rendering.
|
|
304
|
+
* Use this for special row types like group headers, detail rows, or footers.
|
|
305
|
+
*
|
|
306
|
+
* @param row - The row data object
|
|
307
|
+
* @param rowEl - The row DOM element to render into
|
|
308
|
+
* @param rowIndex - The index of the row in the data array
|
|
309
|
+
* @returns `true` if the plugin handled rendering (prevents default), `false`/`void` for default rendering
|
|
310
|
+
*
|
|
311
|
+
* @example
|
|
312
|
+
* ```ts
|
|
313
|
+
* renderRow(row: any, rowEl: HTMLElement, rowIndex: number): boolean | void {
|
|
314
|
+
* if (row._isGroupHeader) {
|
|
315
|
+
* rowEl.innerHTML = `<div class="group-header">${row._groupLabel}</div>`;
|
|
316
|
+
* return true; // Handled - skip default rendering
|
|
317
|
+
* }
|
|
318
|
+
* // Return void to let default rendering proceed
|
|
319
|
+
* }
|
|
320
|
+
* ```
|
|
321
|
+
*/
|
|
322
|
+
renderRow?(row: any, rowEl: HTMLElement, rowIndex: number): boolean | void;
|
|
323
|
+
/**
|
|
324
|
+
* Handle queries from other plugins.
|
|
325
|
+
* This is the generic mechanism for inter-plugin communication.
|
|
326
|
+
* Plugins can respond to well-known query types or define their own.
|
|
327
|
+
*
|
|
328
|
+
* @param query - The query object with type and context
|
|
329
|
+
* @returns Query-specific response, or undefined if not handling this query
|
|
330
|
+
*
|
|
331
|
+
* @example
|
|
332
|
+
* ```ts
|
|
333
|
+
* onPluginQuery(query: PluginQuery): unknown {
|
|
334
|
+
* switch (query.type) {
|
|
335
|
+
* case PLUGIN_QUERIES.CAN_MOVE_COLUMN:
|
|
336
|
+
* // Prevent moving pinned columns
|
|
337
|
+
* const column = query.context as ColumnConfig;
|
|
338
|
+
* if (column.sticky === 'left' || column.sticky === 'right') {
|
|
339
|
+
* return false;
|
|
340
|
+
* }
|
|
341
|
+
* break;
|
|
342
|
+
* case PLUGIN_QUERIES.GET_CONTEXT_MENU_ITEMS:
|
|
343
|
+
* const params = query.context as ContextMenuParams;
|
|
344
|
+
* return [{ id: 'my-action', label: 'My Action', action: () => {} }];
|
|
345
|
+
* }
|
|
346
|
+
* }
|
|
347
|
+
* ```
|
|
348
|
+
*/
|
|
349
|
+
onPluginQuery?(query: PluginQuery): unknown;
|
|
350
|
+
/**
|
|
351
|
+
* Handle keyboard events on the grid.
|
|
352
|
+
* Called when a key is pressed while the grid or a cell has focus.
|
|
353
|
+
*
|
|
354
|
+
* @param event - The native KeyboardEvent
|
|
355
|
+
* @returns `true` to prevent default behavior and stop propagation, `false`/`void` to allow default
|
|
356
|
+
*
|
|
357
|
+
* @example
|
|
358
|
+
* ```ts
|
|
359
|
+
* onKeyDown(event: KeyboardEvent): boolean | void {
|
|
360
|
+
* // Handle Ctrl+A for select all
|
|
361
|
+
* if (event.ctrlKey && event.key === 'a') {
|
|
362
|
+
* this.selectAllRows();
|
|
363
|
+
* return true; // Prevent default browser select-all
|
|
364
|
+
* }
|
|
365
|
+
* }
|
|
366
|
+
* ```
|
|
367
|
+
*/
|
|
368
|
+
onKeyDown?(event: KeyboardEvent): boolean | void;
|
|
369
|
+
/**
|
|
370
|
+
* Handle cell click events.
|
|
371
|
+
* Called when a data cell is clicked (not headers).
|
|
372
|
+
*
|
|
373
|
+
* @param event - Cell click event with row/column context
|
|
374
|
+
* @returns `true` to prevent default behavior and stop propagation, `false`/`void` to allow default
|
|
375
|
+
*
|
|
376
|
+
* @example
|
|
377
|
+
* ```ts
|
|
378
|
+
* onCellClick(event: CellClickEvent): boolean | void {
|
|
379
|
+
* if (event.field === '_select') {
|
|
380
|
+
* this.toggleRowSelection(event.rowIndex);
|
|
381
|
+
* return true; // Handled
|
|
382
|
+
* }
|
|
383
|
+
* }
|
|
384
|
+
* ```
|
|
385
|
+
*/
|
|
386
|
+
onCellClick?(event: CellClickEvent): boolean | void;
|
|
387
|
+
/**
|
|
388
|
+
* Handle row click events.
|
|
389
|
+
* Called when any part of a data row is clicked.
|
|
390
|
+
* Note: This is called in addition to onCellClick, not instead of.
|
|
391
|
+
*
|
|
392
|
+
* @param event - Row click event with row context
|
|
393
|
+
* @returns `true` to prevent default behavior and stop propagation, `false`/`void` to allow default
|
|
394
|
+
*
|
|
395
|
+
* @example
|
|
396
|
+
* ```ts
|
|
397
|
+
* onRowClick(event: RowClickEvent): boolean | void {
|
|
398
|
+
* if (this.config.mode === 'row') {
|
|
399
|
+
* this.selectRow(event.rowIndex, event.originalEvent);
|
|
400
|
+
* return true;
|
|
401
|
+
* }
|
|
402
|
+
* }
|
|
403
|
+
* ```
|
|
404
|
+
*/
|
|
405
|
+
onRowClick?(event: RowClickEvent): boolean | void;
|
|
406
|
+
/**
|
|
407
|
+
* Handle header click events.
|
|
408
|
+
* Called when a column header is clicked. Commonly used for sorting.
|
|
409
|
+
*
|
|
410
|
+
* @param event - Header click event with column context
|
|
411
|
+
* @returns `true` to prevent default behavior and stop propagation, `false`/`void` to allow default
|
|
412
|
+
*
|
|
413
|
+
* @example
|
|
414
|
+
* ```ts
|
|
415
|
+
* onHeaderClick(event: HeaderClickEvent): boolean | void {
|
|
416
|
+
* if (event.column.sortable !== false) {
|
|
417
|
+
* this.toggleSort(event.field);
|
|
418
|
+
* return true;
|
|
419
|
+
* }
|
|
420
|
+
* }
|
|
421
|
+
* ```
|
|
422
|
+
*/
|
|
423
|
+
onHeaderClick?(event: HeaderClickEvent): boolean | void;
|
|
424
|
+
/**
|
|
425
|
+
* Handle scroll events on the grid viewport.
|
|
426
|
+
* Called during scrolling. Note: This may be called frequently; debounce if needed.
|
|
427
|
+
*
|
|
428
|
+
* @param event - Scroll event with scroll position and viewport dimensions
|
|
429
|
+
*
|
|
430
|
+
* @example
|
|
431
|
+
* ```ts
|
|
432
|
+
* onScroll(event: ScrollEvent): void {
|
|
433
|
+
* // Update sticky column positions
|
|
434
|
+
* this.updateStickyPositions(event.scrollLeft);
|
|
435
|
+
* }
|
|
436
|
+
* ```
|
|
437
|
+
*/
|
|
438
|
+
onScroll?(event: ScrollEvent): void;
|
|
439
|
+
/**
|
|
440
|
+
* Handle cell mousedown events.
|
|
441
|
+
* Used for initiating drag operations like range selection or column resize.
|
|
442
|
+
*
|
|
443
|
+
* @param event - Mouse event with cell context
|
|
444
|
+
* @returns `true` to indicate drag started (prevents text selection), `false`/`void` otherwise
|
|
445
|
+
*
|
|
446
|
+
* @example
|
|
447
|
+
* ```ts
|
|
448
|
+
* onCellMouseDown(event: CellMouseEvent): boolean | void {
|
|
449
|
+
* if (event.rowIndex !== undefined && this.config.mode === 'range') {
|
|
450
|
+
* this.startDragSelection(event.rowIndex, event.colIndex);
|
|
451
|
+
* return true; // Prevent text selection
|
|
452
|
+
* }
|
|
453
|
+
* }
|
|
454
|
+
* ```
|
|
455
|
+
*/
|
|
456
|
+
onCellMouseDown?(event: CellMouseEvent): boolean | void;
|
|
457
|
+
/**
|
|
458
|
+
* Handle cell mousemove events during drag operations.
|
|
459
|
+
* Only called when a drag is in progress (after mousedown returned true).
|
|
460
|
+
*
|
|
461
|
+
* @param event - Mouse event with current cell context
|
|
462
|
+
* @returns `true` to continue handling the drag, `false`/`void` otherwise
|
|
463
|
+
*
|
|
464
|
+
* @example
|
|
465
|
+
* ```ts
|
|
466
|
+
* onCellMouseMove(event: CellMouseEvent): boolean | void {
|
|
467
|
+
* if (this.isDragging && event.rowIndex !== undefined) {
|
|
468
|
+
* this.extendSelection(event.rowIndex, event.colIndex);
|
|
469
|
+
* return true;
|
|
470
|
+
* }
|
|
471
|
+
* }
|
|
472
|
+
* ```
|
|
473
|
+
*/
|
|
474
|
+
onCellMouseMove?(event: CellMouseEvent): boolean | void;
|
|
475
|
+
/**
|
|
476
|
+
* Handle cell mouseup events to end drag operations.
|
|
477
|
+
*
|
|
478
|
+
* @param event - Mouse event with final cell context
|
|
479
|
+
* @returns `true` if drag was finalized, `false`/`void` otherwise
|
|
480
|
+
*
|
|
481
|
+
* @example
|
|
482
|
+
* ```ts
|
|
483
|
+
* onCellMouseUp(event: CellMouseEvent): boolean | void {
|
|
484
|
+
* if (this.isDragging) {
|
|
485
|
+
* this.finalizeDragSelection();
|
|
486
|
+
* this.isDragging = false;
|
|
487
|
+
* return true;
|
|
488
|
+
* }
|
|
489
|
+
* }
|
|
490
|
+
* ```
|
|
491
|
+
*/
|
|
492
|
+
onCellMouseUp?(event: CellMouseEvent): boolean | void;
|
|
493
|
+
/**
|
|
494
|
+
* Contribute plugin-specific state for a column.
|
|
495
|
+
* Called by the grid when collecting column state for serialization.
|
|
496
|
+
* Plugins can add their own properties to the column state.
|
|
497
|
+
*
|
|
498
|
+
* @param field - The field name of the column
|
|
499
|
+
* @returns Partial column state with plugin-specific properties, or undefined if no state to contribute
|
|
500
|
+
*
|
|
501
|
+
* @example
|
|
502
|
+
* ```ts
|
|
503
|
+
* getColumnState(field: string): Partial<ColumnState> | undefined {
|
|
504
|
+
* const filterModel = this.filterModels.get(field);
|
|
505
|
+
* if (filterModel) {
|
|
506
|
+
* // Uses module augmentation to add filter property to ColumnState
|
|
507
|
+
* return { filter: filterModel } as Partial<ColumnState>;
|
|
508
|
+
* }
|
|
509
|
+
* return undefined;
|
|
510
|
+
* }
|
|
511
|
+
* ```
|
|
512
|
+
*/
|
|
513
|
+
getColumnState?(field: string): Partial<ColumnState> | undefined;
|
|
514
|
+
/**
|
|
515
|
+
* Apply plugin-specific state to a column.
|
|
516
|
+
* Called by the grid when restoring column state from serialized data.
|
|
517
|
+
* Plugins should restore their internal state based on the provided state.
|
|
518
|
+
*
|
|
519
|
+
* @param field - The field name of the column
|
|
520
|
+
* @param state - The column state to apply (may contain plugin-specific properties)
|
|
521
|
+
*
|
|
522
|
+
* @example
|
|
523
|
+
* ```ts
|
|
524
|
+
* applyColumnState(field: string, state: ColumnState): void {
|
|
525
|
+
* // Check for filter property added via module augmentation
|
|
526
|
+
* const filter = (state as any).filter;
|
|
527
|
+
* if (filter) {
|
|
528
|
+
* this.filterModels.set(field, filter);
|
|
529
|
+
* this.applyFilter();
|
|
530
|
+
* }
|
|
531
|
+
* }
|
|
532
|
+
* ```
|
|
533
|
+
*/
|
|
534
|
+
applyColumnState?(field: string, state: ColumnState): void;
|
|
535
|
+
/**
|
|
536
|
+
* Report horizontal scroll boundary offsets for this plugin.
|
|
537
|
+
* Plugins that obscure part of the scroll area (e.g., pinned/sticky columns)
|
|
538
|
+
* should return how much space they occupy on each side.
|
|
539
|
+
* The keyboard navigation uses this to ensure focused cells are fully visible.
|
|
540
|
+
*
|
|
541
|
+
* @param rowEl - The row element (optional, for calculating widths from rendered cells)
|
|
542
|
+
* @param focusedCell - The currently focused cell element (optional, to determine if scrolling should be skipped)
|
|
543
|
+
* @returns Object with left/right pixel offsets and optional skipScroll flag, or undefined if plugin has no offsets
|
|
544
|
+
*
|
|
545
|
+
* @example
|
|
546
|
+
* ```ts
|
|
547
|
+
* getHorizontalScrollOffsets(rowEl?: HTMLElement, focusedCell?: HTMLElement): { left: number; right: number; skipScroll?: boolean } | undefined {
|
|
548
|
+
* // Calculate total width of left-pinned columns
|
|
549
|
+
* const leftCells = rowEl?.querySelectorAll('.sticky-left') ?? [];
|
|
550
|
+
* let left = 0;
|
|
551
|
+
* leftCells.forEach(el => { left += (el as HTMLElement).offsetWidth; });
|
|
552
|
+
* // Skip scroll if focused cell is pinned (always visible)
|
|
553
|
+
* const skipScroll = focusedCell?.classList.contains('sticky-left');
|
|
554
|
+
* return { left, right: 0, skipScroll };
|
|
555
|
+
* }
|
|
556
|
+
* ```
|
|
557
|
+
*/
|
|
558
|
+
getHorizontalScrollOffsets?(rowEl?: HTMLElement, focusedCell?: HTMLElement): {
|
|
559
|
+
left: number;
|
|
560
|
+
right: number;
|
|
561
|
+
skipScroll?: boolean;
|
|
562
|
+
} | undefined;
|
|
563
|
+
/**
|
|
564
|
+
* Register a tool panel for this plugin.
|
|
565
|
+
* Return undefined if plugin has no tool panel.
|
|
566
|
+
* The shell will create a toolbar toggle button and render the panel content
|
|
567
|
+
* when the user opens the panel.
|
|
568
|
+
*
|
|
569
|
+
* @returns Tool panel definition, or undefined if plugin has no panel
|
|
570
|
+
*
|
|
571
|
+
* @example
|
|
572
|
+
* ```ts
|
|
573
|
+
* getToolPanel(): ToolPanelDefinition | undefined {
|
|
574
|
+
* return {
|
|
575
|
+
* id: 'columns',
|
|
576
|
+
* title: 'Columns',
|
|
577
|
+
* icon: '☰',
|
|
578
|
+
* tooltip: 'Show/hide columns',
|
|
579
|
+
* order: 10,
|
|
580
|
+
* render: (container) => {
|
|
581
|
+
* this.renderColumnList(container);
|
|
582
|
+
* return () => this.cleanup();
|
|
583
|
+
* },
|
|
584
|
+
* };
|
|
585
|
+
* }
|
|
586
|
+
* ```
|
|
587
|
+
*/
|
|
588
|
+
getToolPanel?(): ToolPanelDefinition | undefined;
|
|
589
|
+
/**
|
|
590
|
+
* Register content for the shell header center section.
|
|
591
|
+
* Return undefined if plugin has no header content.
|
|
592
|
+
* Examples: search input, selection summary, status indicators.
|
|
593
|
+
*
|
|
594
|
+
* @returns Header content definition, or undefined if plugin has no header content
|
|
595
|
+
*
|
|
596
|
+
* @example
|
|
597
|
+
* ```ts
|
|
598
|
+
* getHeaderContent(): HeaderContentDefinition | undefined {
|
|
599
|
+
* return {
|
|
600
|
+
* id: 'quick-filter',
|
|
601
|
+
* order: 10,
|
|
602
|
+
* render: (container) => {
|
|
603
|
+
* const input = document.createElement('input');
|
|
604
|
+
* input.type = 'text';
|
|
605
|
+
* input.placeholder = 'Search...';
|
|
606
|
+
* input.addEventListener('input', this.handleInput);
|
|
607
|
+
* container.appendChild(input);
|
|
608
|
+
* return () => input.removeEventListener('input', this.handleInput);
|
|
609
|
+
* },
|
|
610
|
+
* };
|
|
611
|
+
* }
|
|
612
|
+
* ```
|
|
613
|
+
*/
|
|
614
|
+
getHeaderContent?(): HeaderContentDefinition | undefined;
|
|
615
|
+
}
|
|
616
|
+
//# sourceMappingURL=base-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-plugin.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/core/plugin/base-plugin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,UAAU,EACV,uBAAuB,EACvB,SAAS,EACT,mBAAmB,EACpB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAG9C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,YAAY,EACV,cAAc,EACd,UAAU,EACV,UAAU,EACV,cAAc,EACd,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,uBAAuB,EACvB,WAAW,EACX,aAAa,EACb,WAAW,GACZ,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,cAAc,EACd,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,aAAa,EACb,WAAW,EACZ,MAAM,SAAS,CAAC;AAEjB;;;GAGG;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plugin infrastructure.
|
|
5
|
+
* All plugins extend BaseGridPlugin and are attached to grids via PluginManager.
|
|
6
|
+
*/
|
|
7
|
+
export { BaseGridPlugin, PLUGIN_QUERIES } from './base-plugin';
|
|
8
|
+
export type { CellClickEvent, CellCoords, CellEditor, CellMouseEvent, CellRenderer, ContextMenuItem, ContextMenuParams, GridElement, HeaderClickEvent, HeaderRenderer, KeyboardModifiers, PluginCellRenderContext, PluginHeaderRenderContext, PluginQuery, RowClickEvent, ScrollEvent, } from './base-plugin';
|
|
9
|
+
export { PluginManager } from './plugin-manager';
|
|
10
|
+
export type { ColumnConfig } from '../types';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/core/plugin/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/D,YAAY,EACV,cAAc,EACd,UAAU,EACV,UAAU,EACV,cAAc,EACd,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,uBAAuB,EACvB,yBAAyB,EACzB,WAAW,EACX,aAAa,EACb,WAAW,GACZ,MAAM,eAAe,CAAC;AAIvB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAIjD,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC"}
|