@toolbox-web/grid 0.2.3 → 0.2.4
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 +24 -0
- package/all.d.ts +59 -96
- package/index.d.ts +59 -96
- package/index.js +345 -291
- package/index.js.map +1 -1
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/reorder/index.js.map +1 -1
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/visibility/index.js.map +1 -1
- package/package.json +2 -2
- package/umd/grid.all.umd.js +4 -4
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +6 -6
- package/umd/grid.umd.js.map +1 -1
package/README.md
CHANGED
|
@@ -126,6 +126,30 @@ When the same property is set via multiple methods, higher precedence wins:
|
|
|
126
126
|
<tbw-grid></tbw-grid>
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
+
### HTML Attributes
|
|
130
|
+
|
|
131
|
+
The grid supports configuration via HTML attributes with JSON-serialized values:
|
|
132
|
+
|
|
133
|
+
| Attribute | Type | Description |
|
|
134
|
+
| ------------- | ------ | ------------------------------------------- |
|
|
135
|
+
| `rows` | JSON | Data array (JSON-serialized) |
|
|
136
|
+
| `columns` | JSON | Column definitions (JSON-serialized) |
|
|
137
|
+
| `grid-config` | JSON | Full configuration object (JSON-serialized) |
|
|
138
|
+
| `fit-mode` | string | Column sizing: `'stretch'` or `'fixed'` |
|
|
139
|
+
| `edit-on` | string | Edit trigger: `'click'` or `'dblclick'` |
|
|
140
|
+
|
|
141
|
+
**Example with HTML attributes:**
|
|
142
|
+
|
|
143
|
+
```html
|
|
144
|
+
<tbw-grid
|
|
145
|
+
rows='[{"id":1,"name":"Alice"},{"id":2,"name":"Bob"}]'
|
|
146
|
+
columns='[{"field":"id","header":"ID"},{"field":"name","header":"Name"}]'
|
|
147
|
+
fit-mode="stretch"
|
|
148
|
+
edit-on="dblclick"
|
|
149
|
+
>
|
|
150
|
+
</tbw-grid>
|
|
151
|
+
```
|
|
152
|
+
|
|
129
153
|
### Properties
|
|
130
154
|
|
|
131
155
|
| Property | Type | Description |
|
package/all.d.ts
CHANGED
|
@@ -2025,30 +2025,31 @@ export declare class DataGridElement<T = any> extends HTMLElement implements Int
|
|
|
2025
2025
|
#private;
|
|
2026
2026
|
static readonly tagName = "tbw-grid";
|
|
2027
2027
|
static readonly version: string;
|
|
2028
|
+
static get observedAttributes(): string[];
|
|
2028
2029
|
_rows: T[];
|
|
2029
2030
|
get _columns(): ColumnInternal<T>[];
|
|
2030
2031
|
set _columns(value: ColumnInternal<T>[]);
|
|
2031
|
-
get
|
|
2032
|
-
|
|
2032
|
+
get _visibleColumns(): ColumnInternal<T>[];
|
|
2033
|
+
_headerRowEl: HTMLElement;
|
|
2034
|
+
_bodyEl: HTMLElement;
|
|
2035
|
+
_rowPool: HTMLElement[];
|
|
2036
|
+
_resizeController: ResizeController;
|
|
2037
|
+
_virtualization: VirtualState;
|
|
2038
|
+
_focusRow: number;
|
|
2039
|
+
_focusCol: number;
|
|
2040
|
+
_sortState: {
|
|
2041
|
+
field: string;
|
|
2042
|
+
direction: 1 | -1;
|
|
2043
|
+
} | null;
|
|
2044
|
+
_activeEditRows: number;
|
|
2045
|
+
_rowEditSnapshots: Map<number, T>;
|
|
2046
|
+
_changedRowIndices: Set<number>;
|
|
2047
|
+
_gridTemplate: string;
|
|
2033
2048
|
__rowRenderEpoch: number;
|
|
2034
|
-
activeEditRows: number;
|
|
2035
|
-
resizeController: ResizeController;
|
|
2036
2049
|
__didInitialAutoSize: boolean;
|
|
2037
2050
|
__lightDomColumnsCache?: ColumnInternal[];
|
|
2038
2051
|
__originalColumnNodes?: HTMLElement[];
|
|
2039
|
-
headerRowEl: HTMLElement;
|
|
2040
|
-
bodyEl: HTMLElement;
|
|
2041
|
-
virtualization: VirtualState;
|
|
2042
|
-
sortState: {
|
|
2043
|
-
field: string;
|
|
2044
|
-
direction: 1 | -1;
|
|
2045
|
-
} | null;
|
|
2046
2052
|
__originalOrder: T[];
|
|
2047
|
-
focusRow: number;
|
|
2048
|
-
focusCol: number;
|
|
2049
|
-
gridTemplate: string;
|
|
2050
|
-
rowEditSnapshots: Map<number, T>;
|
|
2051
|
-
_changedRowIndices: Set<number>;
|
|
2052
2053
|
get rows(): T[];
|
|
2053
2054
|
set rows(value: T[]);
|
|
2054
2055
|
/**
|
|
@@ -2064,82 +2065,54 @@ export declare class DataGridElement<T = any> extends HTMLElement implements Int
|
|
|
2064
2065
|
set fitMode(value: FitMode | undefined);
|
|
2065
2066
|
get editOn(): string | undefined;
|
|
2066
2067
|
set editOn(value: string | undefined);
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
* Get the disconnect signal for event listener cleanup.
|
|
2070
|
-
* This signal is aborted when the grid disconnects from the DOM.
|
|
2071
|
-
* Plugins and internal code can use this for automatic listener cleanup.
|
|
2072
|
-
* @example
|
|
2073
|
-
* element.addEventListener('click', handler, { signal: this.grid.disconnectSignal });
|
|
2074
|
-
*/
|
|
2075
|
-
get disconnectSignal(): AbortSignal;
|
|
2068
|
+
/* Excluded from this release type: effectiveConfig */
|
|
2069
|
+
/* Excluded from this release type: disconnectSignal */
|
|
2076
2070
|
constructor();
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
getPlugin<P extends BaseGridPlugin>(PluginClass: new (...args: any[]) => P): P | undefined;
|
|
2082
|
-
/**
|
|
2083
|
-
* Get a plugin instance by its name.
|
|
2084
|
-
* Used for loose coupling between plugins (avoids static imports).
|
|
2085
|
-
*/
|
|
2086
|
-
getPluginByName(name: string): BaseGridPlugin | undefined;
|
|
2087
|
-
/**
|
|
2088
|
-
* Request a full re-render of the grid.
|
|
2089
|
-
* Called by plugins when they need the grid to update.
|
|
2090
|
-
* Note: This does NOT reset plugin state - just re-processes rows/columns and renders.
|
|
2091
|
-
*/
|
|
2092
|
-
requestRender(): void;
|
|
2093
|
-
/**
|
|
2094
|
-
* Request a lightweight style update without rebuilding DOM.
|
|
2095
|
-
* Called by plugins when they only need to update CSS classes/styles.
|
|
2096
|
-
* This runs all plugin afterRender hooks without rebuilding row/column DOM.
|
|
2097
|
-
*/
|
|
2098
|
-
requestAfterRender(): void;
|
|
2071
|
+
/* Excluded from this release type: getPlugin */
|
|
2072
|
+
/* Excluded from this release type: getPluginByName */
|
|
2073
|
+
/* Excluded from this release type: requestRender */
|
|
2074
|
+
/* Excluded from this release type: requestAfterRender */
|
|
2099
2075
|
connectedCallback(): void;
|
|
2100
2076
|
disconnectedCallback(): void;
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2077
|
+
/**
|
|
2078
|
+
* Handle HTML attribute changes.
|
|
2079
|
+
* Only processes attribute values when SET (non-null).
|
|
2080
|
+
* Removing an attribute does NOT clear JS-set properties.
|
|
2081
|
+
*/
|
|
2082
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
2083
|
+
_emitCellCommit(detail: CellCommitDetail<T>): void;
|
|
2084
|
+
_emitRowCommit(detail: RowCommitDetail<T>): void;
|
|
2085
|
+
_emitSortChange(detail: SortChangeDetail): void;
|
|
2086
|
+
_emitColumnResize(detail: ColumnResizeDetail): void;
|
|
2087
|
+
_emitActivateCell(detail: ActivateCellDetail): void;
|
|
2088
|
+
/* Excluded from this release type: findHeaderRow */
|
|
2089
|
+
/* Excluded from this release type: findRenderedRowElement */
|
|
2108
2090
|
/**
|
|
2109
2091
|
* Dispatch a cell click event to the plugin system.
|
|
2110
2092
|
* Returns true if any plugin handled the event.
|
|
2111
2093
|
*/
|
|
2112
|
-
|
|
2094
|
+
_dispatchCellClick(event: MouseEvent, rowIndex: number, colIndex: number, cellEl: HTMLElement): boolean;
|
|
2113
2095
|
/**
|
|
2114
2096
|
* Dispatch a header click event to the plugin system.
|
|
2115
2097
|
* Returns true if any plugin handled the event.
|
|
2116
2098
|
*/
|
|
2117
|
-
|
|
2099
|
+
_dispatchHeaderClick(event: MouseEvent, colIndex: number, headerEl: HTMLElement): boolean;
|
|
2118
2100
|
/**
|
|
2119
2101
|
* Dispatch a keyboard event to the plugin system.
|
|
2120
2102
|
* Returns true if any plugin handled the event.
|
|
2121
2103
|
*/
|
|
2122
|
-
|
|
2104
|
+
_dispatchKeyDown(event: KeyboardEvent): boolean;
|
|
2123
2105
|
/**
|
|
2124
2106
|
* Get horizontal scroll boundary offsets from plugins.
|
|
2125
2107
|
* Used by keyboard navigation to ensure focused cells are fully visible
|
|
2126
2108
|
* when plugins like pinned columns obscure part of the scroll area.
|
|
2127
2109
|
*/
|
|
2128
|
-
|
|
2110
|
+
_getHorizontalScrollOffsets(rowEl?: HTMLElement, focusedCell?: HTMLElement): {
|
|
2129
2111
|
left: number;
|
|
2130
2112
|
right: number;
|
|
2131
2113
|
skipScroll?: boolean;
|
|
2132
2114
|
};
|
|
2133
|
-
|
|
2134
|
-
* Query all plugins with a generic query and collect responses.
|
|
2135
|
-
* This enables inter-plugin communication without the core knowing plugin-specific concepts.
|
|
2136
|
-
*
|
|
2137
|
-
* @example
|
|
2138
|
-
* // Check if any plugin vetoes moving a column
|
|
2139
|
-
* const responses = grid.queryPlugins<boolean>({ type: PLUGIN_QUERIES.CAN_MOVE_COLUMN, context: column });
|
|
2140
|
-
* const canMove = !responses.includes(false);
|
|
2141
|
-
*/
|
|
2142
|
-
queryPlugins<T>(query: PluginQuery): T[];
|
|
2115
|
+
/* Excluded from this release type: queryPlugins */
|
|
2143
2116
|
get changedRows(): T[];
|
|
2144
2117
|
get changedRowIndices(): number[];
|
|
2145
2118
|
resetChangedRows(silent?: boolean): Promise<void>;
|
|
@@ -2209,13 +2182,7 @@ export declare class DataGridElement<T = any> extends HTMLElement implements Int
|
|
|
2209
2182
|
* Get the current column state.
|
|
2210
2183
|
*/
|
|
2211
2184
|
get columnState(): GridColumnState | undefined;
|
|
2212
|
-
|
|
2213
|
-
* Request a state change event to be emitted.
|
|
2214
|
-
* Called internally after resize, reorder, visibility, or sort changes.
|
|
2215
|
-
* Plugins should call this after changing their state.
|
|
2216
|
-
* The event is debounced to avoid excessive events during drag operations.
|
|
2217
|
-
*/
|
|
2218
|
-
requestStateChange(): void;
|
|
2185
|
+
/* Excluded from this release type: requestStateChange */
|
|
2219
2186
|
/**
|
|
2220
2187
|
* Reset column state to initial configuration.
|
|
2221
2188
|
* Clears all user modifications (order, width, visibility, sort).
|
|
@@ -2263,11 +2230,7 @@ export declare class DataGridElement<T = any> extends HTMLElement implements Int
|
|
|
2263
2230
|
* Call this after dynamically modifying <tbw-grid-header> children.
|
|
2264
2231
|
*/
|
|
2265
2232
|
refreshShellHeader(): void;
|
|
2266
|
-
|
|
2267
|
-
* Core virtualization routine. Chooses between bypass (small datasets), grouped window rendering,
|
|
2268
|
-
* or standard row window rendering.
|
|
2269
|
-
*/
|
|
2270
|
-
refreshVirtualWindow(force?: boolean): void;
|
|
2233
|
+
/* Excluded from this release type: refreshVirtualWindow */
|
|
2271
2234
|
}
|
|
2272
2235
|
|
|
2273
2236
|
/**
|
|
@@ -3464,12 +3427,12 @@ declare interface InternalGrid<T = any> extends PublicGrid<T>, GridConfig<T> {
|
|
|
3464
3427
|
_rows: T[];
|
|
3465
3428
|
_columns: ColumnInternal<T>[];
|
|
3466
3429
|
/** Visible columns only (excludes hidden). Use for rendering. */
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3430
|
+
_visibleColumns: ColumnInternal<T>[];
|
|
3431
|
+
_headerRowEl: HTMLElement;
|
|
3432
|
+
_bodyEl: HTMLElement;
|
|
3433
|
+
_rowPool: HTMLElement[];
|
|
3434
|
+
_resizeController: ResizeController;
|
|
3435
|
+
_sortState: {
|
|
3473
3436
|
field: string;
|
|
3474
3437
|
direction: 1 | -1;
|
|
3475
3438
|
} | null;
|
|
@@ -3478,12 +3441,12 @@ declare interface InternalGrid<T = any> extends PublicGrid<T>, GridConfig<T> {
|
|
|
3478
3441
|
__didInitialAutoSize?: boolean;
|
|
3479
3442
|
__lightDomColumnsCache?: ColumnInternal[];
|
|
3480
3443
|
__originalColumnNodes?: HTMLElement[];
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3444
|
+
_gridTemplate: string;
|
|
3445
|
+
_virtualization: VirtualState;
|
|
3446
|
+
_focusRow: number;
|
|
3447
|
+
_focusCol: number;
|
|
3448
|
+
_activeEditRows: number;
|
|
3449
|
+
_rowEditSnapshots: Map<number, T>;
|
|
3487
3450
|
_changedRowIndices: Set<number>;
|
|
3488
3451
|
changedRows?: T[];
|
|
3489
3452
|
changedRowIndices?: number[];
|
|
@@ -3495,13 +3458,13 @@ declare interface InternalGrid<T = any> extends PublicGrid<T>, GridConfig<T> {
|
|
|
3495
3458
|
beginBulkEdit?: (rowIndex: number) => void;
|
|
3496
3459
|
commitActiveRowEdit?: () => void;
|
|
3497
3460
|
/** Dispatch cell click to plugin system, returns true if handled */
|
|
3498
|
-
|
|
3461
|
+
_dispatchCellClick?: (event: MouseEvent, rowIndex: number, colIndex: number, cellEl: HTMLElement) => boolean;
|
|
3499
3462
|
/** Dispatch header click to plugin system, returns true if handled */
|
|
3500
|
-
|
|
3463
|
+
_dispatchHeaderClick?: (event: MouseEvent, colIndex: number, headerEl: HTMLElement) => boolean;
|
|
3501
3464
|
/** Dispatch keydown to plugin system, returns true if handled */
|
|
3502
|
-
|
|
3465
|
+
_dispatchKeyDown?: (event: KeyboardEvent) => boolean;
|
|
3503
3466
|
/** Get horizontal scroll boundary offsets from plugins (e.g., pinned columns) */
|
|
3504
|
-
|
|
3467
|
+
_getHorizontalScrollOffsets?: (rowEl?: HTMLElement, focusedCell?: HTMLElement) => {
|
|
3505
3468
|
left: number;
|
|
3506
3469
|
right: number;
|
|
3507
3470
|
skipScroll?: boolean;
|
package/index.d.ts
CHANGED
|
@@ -977,30 +977,31 @@ export declare class DataGridElement<T = any> extends HTMLElement implements Int
|
|
|
977
977
|
#private;
|
|
978
978
|
static readonly tagName = "tbw-grid";
|
|
979
979
|
static readonly version: string;
|
|
980
|
+
static get observedAttributes(): string[];
|
|
980
981
|
_rows: T[];
|
|
981
982
|
get _columns(): ColumnInternal<T>[];
|
|
982
983
|
set _columns(value: ColumnInternal<T>[]);
|
|
983
|
-
get
|
|
984
|
-
|
|
984
|
+
get _visibleColumns(): ColumnInternal<T>[];
|
|
985
|
+
_headerRowEl: HTMLElement;
|
|
986
|
+
_bodyEl: HTMLElement;
|
|
987
|
+
_rowPool: HTMLElement[];
|
|
988
|
+
_resizeController: ResizeController;
|
|
989
|
+
_virtualization: VirtualState;
|
|
990
|
+
_focusRow: number;
|
|
991
|
+
_focusCol: number;
|
|
992
|
+
_sortState: {
|
|
993
|
+
field: string;
|
|
994
|
+
direction: 1 | -1;
|
|
995
|
+
} | null;
|
|
996
|
+
_activeEditRows: number;
|
|
997
|
+
_rowEditSnapshots: Map<number, T>;
|
|
998
|
+
_changedRowIndices: Set<number>;
|
|
999
|
+
_gridTemplate: string;
|
|
985
1000
|
__rowRenderEpoch: number;
|
|
986
|
-
activeEditRows: number;
|
|
987
|
-
resizeController: ResizeController;
|
|
988
1001
|
__didInitialAutoSize: boolean;
|
|
989
1002
|
__lightDomColumnsCache?: ColumnInternal[];
|
|
990
1003
|
__originalColumnNodes?: HTMLElement[];
|
|
991
|
-
headerRowEl: HTMLElement;
|
|
992
|
-
bodyEl: HTMLElement;
|
|
993
|
-
virtualization: VirtualState;
|
|
994
|
-
sortState: {
|
|
995
|
-
field: string;
|
|
996
|
-
direction: 1 | -1;
|
|
997
|
-
} | null;
|
|
998
1004
|
__originalOrder: T[];
|
|
999
|
-
focusRow: number;
|
|
1000
|
-
focusCol: number;
|
|
1001
|
-
gridTemplate: string;
|
|
1002
|
-
rowEditSnapshots: Map<number, T>;
|
|
1003
|
-
_changedRowIndices: Set<number>;
|
|
1004
1005
|
get rows(): T[];
|
|
1005
1006
|
set rows(value: T[]);
|
|
1006
1007
|
/**
|
|
@@ -1016,82 +1017,54 @@ export declare class DataGridElement<T = any> extends HTMLElement implements Int
|
|
|
1016
1017
|
set fitMode(value: FitMode | undefined);
|
|
1017
1018
|
get editOn(): string | undefined;
|
|
1018
1019
|
set editOn(value: string | undefined);
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
* Get the disconnect signal for event listener cleanup.
|
|
1022
|
-
* This signal is aborted when the grid disconnects from the DOM.
|
|
1023
|
-
* Plugins and internal code can use this for automatic listener cleanup.
|
|
1024
|
-
* @example
|
|
1025
|
-
* element.addEventListener('click', handler, { signal: this.grid.disconnectSignal });
|
|
1026
|
-
*/
|
|
1027
|
-
get disconnectSignal(): AbortSignal;
|
|
1020
|
+
/* Excluded from this release type: effectiveConfig */
|
|
1021
|
+
/* Excluded from this release type: disconnectSignal */
|
|
1028
1022
|
constructor();
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
getPlugin<P extends BaseGridPlugin>(PluginClass: new (...args: any[]) => P): P | undefined;
|
|
1034
|
-
/**
|
|
1035
|
-
* Get a plugin instance by its name.
|
|
1036
|
-
* Used for loose coupling between plugins (avoids static imports).
|
|
1037
|
-
*/
|
|
1038
|
-
getPluginByName(name: string): BaseGridPlugin | undefined;
|
|
1039
|
-
/**
|
|
1040
|
-
* Request a full re-render of the grid.
|
|
1041
|
-
* Called by plugins when they need the grid to update.
|
|
1042
|
-
* Note: This does NOT reset plugin state - just re-processes rows/columns and renders.
|
|
1043
|
-
*/
|
|
1044
|
-
requestRender(): void;
|
|
1045
|
-
/**
|
|
1046
|
-
* Request a lightweight style update without rebuilding DOM.
|
|
1047
|
-
* Called by plugins when they only need to update CSS classes/styles.
|
|
1048
|
-
* This runs all plugin afterRender hooks without rebuilding row/column DOM.
|
|
1049
|
-
*/
|
|
1050
|
-
requestAfterRender(): void;
|
|
1023
|
+
/* Excluded from this release type: getPlugin */
|
|
1024
|
+
/* Excluded from this release type: getPluginByName */
|
|
1025
|
+
/* Excluded from this release type: requestRender */
|
|
1026
|
+
/* Excluded from this release type: requestAfterRender */
|
|
1051
1027
|
connectedCallback(): void;
|
|
1052
1028
|
disconnectedCallback(): void;
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1029
|
+
/**
|
|
1030
|
+
* Handle HTML attribute changes.
|
|
1031
|
+
* Only processes attribute values when SET (non-null).
|
|
1032
|
+
* Removing an attribute does NOT clear JS-set properties.
|
|
1033
|
+
*/
|
|
1034
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
1035
|
+
_emitCellCommit(detail: CellCommitDetail<T>): void;
|
|
1036
|
+
_emitRowCommit(detail: RowCommitDetail<T>): void;
|
|
1037
|
+
_emitSortChange(detail: SortChangeDetail): void;
|
|
1038
|
+
_emitColumnResize(detail: ColumnResizeDetail): void;
|
|
1039
|
+
_emitActivateCell(detail: ActivateCellDetail): void;
|
|
1040
|
+
/* Excluded from this release type: findHeaderRow */
|
|
1041
|
+
/* Excluded from this release type: findRenderedRowElement */
|
|
1060
1042
|
/**
|
|
1061
1043
|
* Dispatch a cell click event to the plugin system.
|
|
1062
1044
|
* Returns true if any plugin handled the event.
|
|
1063
1045
|
*/
|
|
1064
|
-
|
|
1046
|
+
_dispatchCellClick(event: MouseEvent, rowIndex: number, colIndex: number, cellEl: HTMLElement): boolean;
|
|
1065
1047
|
/**
|
|
1066
1048
|
* Dispatch a header click event to the plugin system.
|
|
1067
1049
|
* Returns true if any plugin handled the event.
|
|
1068
1050
|
*/
|
|
1069
|
-
|
|
1051
|
+
_dispatchHeaderClick(event: MouseEvent, colIndex: number, headerEl: HTMLElement): boolean;
|
|
1070
1052
|
/**
|
|
1071
1053
|
* Dispatch a keyboard event to the plugin system.
|
|
1072
1054
|
* Returns true if any plugin handled the event.
|
|
1073
1055
|
*/
|
|
1074
|
-
|
|
1056
|
+
_dispatchKeyDown(event: KeyboardEvent): boolean;
|
|
1075
1057
|
/**
|
|
1076
1058
|
* Get horizontal scroll boundary offsets from plugins.
|
|
1077
1059
|
* Used by keyboard navigation to ensure focused cells are fully visible
|
|
1078
1060
|
* when plugins like pinned columns obscure part of the scroll area.
|
|
1079
1061
|
*/
|
|
1080
|
-
|
|
1062
|
+
_getHorizontalScrollOffsets(rowEl?: HTMLElement, focusedCell?: HTMLElement): {
|
|
1081
1063
|
left: number;
|
|
1082
1064
|
right: number;
|
|
1083
1065
|
skipScroll?: boolean;
|
|
1084
1066
|
};
|
|
1085
|
-
|
|
1086
|
-
* Query all plugins with a generic query and collect responses.
|
|
1087
|
-
* This enables inter-plugin communication without the core knowing plugin-specific concepts.
|
|
1088
|
-
*
|
|
1089
|
-
* @example
|
|
1090
|
-
* // Check if any plugin vetoes moving a column
|
|
1091
|
-
* const responses = grid.queryPlugins<boolean>({ type: PLUGIN_QUERIES.CAN_MOVE_COLUMN, context: column });
|
|
1092
|
-
* const canMove = !responses.includes(false);
|
|
1093
|
-
*/
|
|
1094
|
-
queryPlugins<T>(query: PluginQuery): T[];
|
|
1067
|
+
/* Excluded from this release type: queryPlugins */
|
|
1095
1068
|
get changedRows(): T[];
|
|
1096
1069
|
get changedRowIndices(): number[];
|
|
1097
1070
|
resetChangedRows(silent?: boolean): Promise<void>;
|
|
@@ -1161,13 +1134,7 @@ export declare class DataGridElement<T = any> extends HTMLElement implements Int
|
|
|
1161
1134
|
* Get the current column state.
|
|
1162
1135
|
*/
|
|
1163
1136
|
get columnState(): GridColumnState | undefined;
|
|
1164
|
-
|
|
1165
|
-
* Request a state change event to be emitted.
|
|
1166
|
-
* Called internally after resize, reorder, visibility, or sort changes.
|
|
1167
|
-
* Plugins should call this after changing their state.
|
|
1168
|
-
* The event is debounced to avoid excessive events during drag operations.
|
|
1169
|
-
*/
|
|
1170
|
-
requestStateChange(): void;
|
|
1137
|
+
/* Excluded from this release type: requestStateChange */
|
|
1171
1138
|
/**
|
|
1172
1139
|
* Reset column state to initial configuration.
|
|
1173
1140
|
* Clears all user modifications (order, width, visibility, sort).
|
|
@@ -1215,11 +1182,7 @@ export declare class DataGridElement<T = any> extends HTMLElement implements Int
|
|
|
1215
1182
|
* Call this after dynamically modifying <tbw-grid-header> children.
|
|
1216
1183
|
*/
|
|
1217
1184
|
refreshShellHeader(): void;
|
|
1218
|
-
|
|
1219
|
-
* Core virtualization routine. Chooses between bypass (small datasets), grouped window rendering,
|
|
1220
|
-
* or standard row window rendering.
|
|
1221
|
-
*/
|
|
1222
|
-
refreshVirtualWindow(force?: boolean): void;
|
|
1185
|
+
/* Excluded from this release type: refreshVirtualWindow */
|
|
1223
1186
|
}
|
|
1224
1187
|
|
|
1225
1188
|
/**
|
|
@@ -1774,12 +1737,12 @@ declare interface InternalGrid<T = any> extends PublicGrid<T>, GridConfig<T> {
|
|
|
1774
1737
|
_rows: T[];
|
|
1775
1738
|
_columns: ColumnInternal<T>[];
|
|
1776
1739
|
/** Visible columns only (excludes hidden). Use for rendering. */
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1740
|
+
_visibleColumns: ColumnInternal<T>[];
|
|
1741
|
+
_headerRowEl: HTMLElement;
|
|
1742
|
+
_bodyEl: HTMLElement;
|
|
1743
|
+
_rowPool: HTMLElement[];
|
|
1744
|
+
_resizeController: ResizeController;
|
|
1745
|
+
_sortState: {
|
|
1783
1746
|
field: string;
|
|
1784
1747
|
direction: 1 | -1;
|
|
1785
1748
|
} | null;
|
|
@@ -1788,12 +1751,12 @@ declare interface InternalGrid<T = any> extends PublicGrid<T>, GridConfig<T> {
|
|
|
1788
1751
|
__didInitialAutoSize?: boolean;
|
|
1789
1752
|
__lightDomColumnsCache?: ColumnInternal[];
|
|
1790
1753
|
__originalColumnNodes?: HTMLElement[];
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1754
|
+
_gridTemplate: string;
|
|
1755
|
+
_virtualization: VirtualState;
|
|
1756
|
+
_focusRow: number;
|
|
1757
|
+
_focusCol: number;
|
|
1758
|
+
_activeEditRows: number;
|
|
1759
|
+
_rowEditSnapshots: Map<number, T>;
|
|
1797
1760
|
_changedRowIndices: Set<number>;
|
|
1798
1761
|
changedRows?: T[];
|
|
1799
1762
|
changedRowIndices?: number[];
|
|
@@ -1805,13 +1768,13 @@ declare interface InternalGrid<T = any> extends PublicGrid<T>, GridConfig<T> {
|
|
|
1805
1768
|
beginBulkEdit?: (rowIndex: number) => void;
|
|
1806
1769
|
commitActiveRowEdit?: () => void;
|
|
1807
1770
|
/** Dispatch cell click to plugin system, returns true if handled */
|
|
1808
|
-
|
|
1771
|
+
_dispatchCellClick?: (event: MouseEvent, rowIndex: number, colIndex: number, cellEl: HTMLElement) => boolean;
|
|
1809
1772
|
/** Dispatch header click to plugin system, returns true if handled */
|
|
1810
|
-
|
|
1773
|
+
_dispatchHeaderClick?: (event: MouseEvent, colIndex: number, headerEl: HTMLElement) => boolean;
|
|
1811
1774
|
/** Dispatch keydown to plugin system, returns true if handled */
|
|
1812
|
-
|
|
1775
|
+
_dispatchKeyDown?: (event: KeyboardEvent) => boolean;
|
|
1813
1776
|
/** Get horizontal scroll boundary offsets from plugins (e.g., pinned columns) */
|
|
1814
|
-
|
|
1777
|
+
_getHorizontalScrollOffsets?: (rowEl?: HTMLElement, focusedCell?: HTMLElement) => {
|
|
1815
1778
|
left: number;
|
|
1816
1779
|
right: number;
|
|
1817
1780
|
skipScroll?: boolean;
|