@gp-grid/vue 0.8.0 → 0.8.2
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/dist/index.d.ts +90 -1523
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,1453 +1,24 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as vue from "vue";
|
|
2
2
|
import { Component as Component$1, ComputedRef, Ref, ShallowRef, VNode } from "vue";
|
|
3
|
+
import * as _gp_grid_core0 from "@gp-grid/core";
|
|
4
|
+
import { CellDataType, CellPosition, CellPosition as CellPosition$1, CellRange, CellRange as CellRange$1, CellRendererParams, CellRendererParams as CellRendererParams$1, CellValue, CellValue as CellValue$1, CellValueChangedEvent, CellValueChangedEvent as CellValueChangedEvent$1, ColumnDefinition, ColumnDefinition as ColumnDefinition$1, ColumnFilterModel, ColumnFilterModel as ColumnFilterModel$1, ContainerBounds, DataSource, DataSource as DataSource$1, DataSourceRequest, DataSourceResponse, DateFilterCondition, DragState, DragState as DragState$1, EditRendererParams, EditRendererParams as EditRendererParams$1, FilterCondition, FilterModel, FilterPopupState, GridCore, GridCore as GridCore$1, GridInstruction, GridInstruction as GridInstruction$1, GridState, GridState as GridState$1, HeaderData, HeaderData as HeaderData$1, HeaderRendererParams, HeaderRendererParams as HeaderRendererParams$1, HighlightingOptions, KeyEventData, MutableDataSource, MutableDataSource as MutableDataSource$1, NumberFilterCondition, ParallelSortOptions, PointerEventData, Row, Row as Row$1, RowId, RowId as RowId$1, SelectionState, SlotData, SlotData as SlotData$1, SortDirection, SortDirection as SortDirection$1, SortModel, TextFilterCondition, buildCellClasses, buildCellClasses as buildCellClasses$1, calculateColumnPositions, createClientDataSource, createDataSourceFromArray, createMutableClientDataSource, createServerDataSource, findColumnAtX, getTotalWidth, gridStyles, injectStyles, isCellActive, isCellActive as isCellActive$1, isCellEditing, isCellEditing as isCellEditing$1, isCellInFillPreview, isCellInFillPreview as isCellInFillPreview$1, isCellSelected, isCellSelected as isCellSelected$1, isRowVisible } from "@gp-grid/core";
|
|
3
5
|
|
|
4
|
-
//#region ../core/src/types/basic.d.ts
|
|
5
|
-
/** Cell data type primitive types */
|
|
6
|
-
type CellDataType = "text" | "number" | "boolean" | "date" | "dateString" | "dateTime" | "dateTimeString" | "object";
|
|
7
|
-
/** Cell value type */
|
|
8
|
-
type CellValue = string | number | boolean | Date | object | null;
|
|
9
|
-
/** Row type */
|
|
10
|
-
type Row = unknown;
|
|
11
|
-
/** Row ID type for transaction operations */
|
|
12
|
-
type RowId = string | number;
|
|
13
|
-
/** Sort direction type */
|
|
14
|
-
type SortDirection = "asc" | "desc";
|
|
15
|
-
/** Sort model type */
|
|
16
|
-
type SortModel = {
|
|
17
|
-
colId: string;
|
|
18
|
-
direction: SortDirection;
|
|
19
|
-
};
|
|
20
|
-
/** Cell position */
|
|
21
|
-
interface CellPosition {
|
|
22
|
-
row: number;
|
|
23
|
-
col: number;
|
|
24
|
-
}
|
|
25
|
-
/** Cell range */
|
|
26
|
-
interface CellRange {
|
|
27
|
-
startRow: number;
|
|
28
|
-
startCol: number;
|
|
29
|
-
endRow: number;
|
|
30
|
-
endCol: number;
|
|
31
|
-
}
|
|
32
|
-
/** Selection state */
|
|
33
|
-
interface SelectionState {
|
|
34
|
-
/** Active cell position */
|
|
35
|
-
activeCell: CellPosition | null;
|
|
36
|
-
/** Selection range */
|
|
37
|
-
range: CellRange | null;
|
|
38
|
-
/** Anchor cell for shift-extend selection */
|
|
39
|
-
anchor: CellPosition | null;
|
|
40
|
-
/** Whether selection mode is active (ctrl held) */
|
|
41
|
-
selectionMode: boolean;
|
|
42
|
-
}
|
|
43
|
-
/** Edit state */
|
|
44
|
-
interface EditState {
|
|
45
|
-
/** Row index */
|
|
46
|
-
row: number;
|
|
47
|
-
/** Column index */
|
|
48
|
-
col: number;
|
|
49
|
-
/** Initial value */
|
|
50
|
-
initialValue: CellValue;
|
|
51
|
-
/** Current value */
|
|
52
|
-
currentValue: CellValue;
|
|
53
|
-
}
|
|
54
|
-
/** Fill handle state */
|
|
55
|
-
interface FillHandleState {
|
|
56
|
-
/** Source range */
|
|
57
|
-
sourceRange: CellRange;
|
|
58
|
-
/** Target row */
|
|
59
|
-
targetRow: number;
|
|
60
|
-
/** Target column */
|
|
61
|
-
targetCol: number;
|
|
62
|
-
}
|
|
63
|
-
/** Event emitted when a cell value is changed via editing or fill drag */
|
|
64
|
-
interface CellValueChangedEvent<TData = Row> {
|
|
65
|
-
/** Stable row ID (from getRowId) */
|
|
66
|
-
rowId: RowId;
|
|
67
|
-
/** Column index */
|
|
68
|
-
colIndex: number;
|
|
69
|
-
/** Column field name */
|
|
70
|
-
field: string;
|
|
71
|
-
/** Previous cell value */
|
|
72
|
-
oldValue: CellValue;
|
|
73
|
-
/** New cell value */
|
|
74
|
-
newValue: CellValue;
|
|
75
|
-
/** The full row data object */
|
|
76
|
-
rowData: TData;
|
|
77
|
-
}
|
|
78
|
-
//#endregion
|
|
79
|
-
//#region ../core/src/types/highlighting.d.ts
|
|
80
|
-
/**
|
|
81
|
-
* Minimal column info for highlighting context.
|
|
82
|
-
* Uses structural typing to avoid circular dependency with columns.ts.
|
|
83
|
-
*/
|
|
84
|
-
interface HighlightColumnInfo {
|
|
85
|
-
field: string;
|
|
86
|
-
colId?: string;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Unified context for row, column, and cell highlighting.
|
|
90
|
-
*
|
|
91
|
-
* - Row context: `rowIndex` is set, `colIndex` is null
|
|
92
|
-
* - Column context: `colIndex` is set, `rowIndex` is null
|
|
93
|
-
* - Cell context: both `rowIndex` and `colIndex` are set
|
|
94
|
-
*/
|
|
95
|
-
interface HighlightContext<TData = Record<string, unknown>> {
|
|
96
|
-
/** Row index. Null for column-only context. */
|
|
97
|
-
rowIndex: number | null;
|
|
98
|
-
/** Column index. Null for row-only context. */
|
|
99
|
-
colIndex: number | null;
|
|
100
|
-
/** Column definition. Present for column and cell contexts. */
|
|
101
|
-
column?: HighlightColumnInfo;
|
|
102
|
-
/** Row data. Present for row and cell contexts. */
|
|
103
|
-
rowData?: TData;
|
|
104
|
-
/** Currently hovered cell position, null if not hovering */
|
|
105
|
-
hoverPosition: CellPosition | null;
|
|
106
|
-
/** Currently active (focused) cell position */
|
|
107
|
-
activeCell: CellPosition | null;
|
|
108
|
-
/** Current selection range */
|
|
109
|
-
selectionRange: CellRange | null;
|
|
110
|
-
/** Whether this row/column/cell is hovered (respects hoverScope) */
|
|
111
|
-
isHovered: boolean;
|
|
112
|
-
/** Whether this row/column contains or is the active cell */
|
|
113
|
-
isActive: boolean;
|
|
114
|
-
/** Whether this row/column/cell overlaps or is in the selection range */
|
|
115
|
-
isSelected: boolean;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Grid-level highlighting options.
|
|
119
|
-
* Hover tracking is automatically enabled when any highlighting callback is defined.
|
|
120
|
-
* Each callback type has its own natural interpretation of `isHovered`:
|
|
121
|
-
* - computeRowClasses: isHovered = mouse is on any cell in this row
|
|
122
|
-
* - computeColumnClasses: isHovered = mouse is on any cell in this column
|
|
123
|
-
* - computeCellClasses: isHovered = mouse is on this exact cell
|
|
124
|
-
*
|
|
125
|
-
* For a crosshair effect, implement both computeRowClasses and computeColumnClasses.
|
|
126
|
-
*/
|
|
127
|
-
interface HighlightingOptions<TData = Record<string, unknown>> {
|
|
128
|
-
/**
|
|
129
|
-
* Row-level class callback.
|
|
130
|
-
* Classes returned are applied to the row container element.
|
|
131
|
-
* Context has `rowIndex` set, `colIndex` is null.
|
|
132
|
-
* `isHovered` is true when the mouse is on any cell in this row.
|
|
133
|
-
* @returns Array of CSS class names
|
|
134
|
-
*/
|
|
135
|
-
computeRowClasses?: (context: HighlightContext<TData>) => string[];
|
|
136
|
-
/**
|
|
137
|
-
* Column-level class callback.
|
|
138
|
-
* Classes returned are applied to all cells in that column (not header).
|
|
139
|
-
* Context has `colIndex` set, `rowIndex` is null.
|
|
140
|
-
* `isHovered` is true when the mouse is on any cell in this column.
|
|
141
|
-
* @returns Array of CSS class names
|
|
142
|
-
*/
|
|
143
|
-
computeColumnClasses?: (context: HighlightContext<TData>) => string[];
|
|
144
|
-
/**
|
|
145
|
-
* Cell-level class callback.
|
|
146
|
-
* Classes returned are applied to individual cells for fine-grained control.
|
|
147
|
-
* Context has both `rowIndex` and `colIndex` set.
|
|
148
|
-
* `isHovered` is true only when the mouse is on this exact cell.
|
|
149
|
-
* @returns Array of CSS class names
|
|
150
|
-
*/
|
|
151
|
-
computeCellClasses?: (context: HighlightContext<TData>) => string[];
|
|
152
|
-
}
|
|
153
|
-
//#endregion
|
|
154
|
-
//#region ../core/src/types/columns.d.ts
|
|
155
|
-
/** Column definition */
|
|
156
|
-
interface ColumnDefinition {
|
|
157
|
-
field: string;
|
|
158
|
-
colId?: string;
|
|
159
|
-
cellDataType: CellDataType;
|
|
160
|
-
width: number;
|
|
161
|
-
headerName?: string;
|
|
162
|
-
editable?: boolean;
|
|
163
|
-
/** Whether column is sortable. Default: true when sortingEnabled */
|
|
164
|
-
sortable?: boolean;
|
|
165
|
-
/** Whether column is filterable. Default: true */
|
|
166
|
-
filterable?: boolean;
|
|
167
|
-
/** Whether column is hidden. Hidden columns are not rendered but still exist in the definition. Default: false */
|
|
168
|
-
hidden?: boolean;
|
|
169
|
-
/** Renderer key for adapter lookup, or inline renderer function */
|
|
170
|
-
cellRenderer?: string;
|
|
171
|
-
editRenderer?: string;
|
|
172
|
-
headerRenderer?: string;
|
|
173
|
-
/**
|
|
174
|
-
* Per-column override for column-level highlighting.
|
|
175
|
-
* If defined, overrides grid-level computeColumnClasses for this column.
|
|
176
|
-
* Context has `colIndex` set, `rowIndex` is null.
|
|
177
|
-
* @returns Array of CSS class names to apply to all cells in this column
|
|
178
|
-
*/
|
|
179
|
-
computeColumnClasses?: (context: HighlightContext) => string[];
|
|
180
|
-
/**
|
|
181
|
-
* Per-column override for cell-level highlighting.
|
|
182
|
-
* If defined, overrides grid-level computeCellClasses for cells in this column.
|
|
183
|
-
* Context has both `rowIndex` and `colIndex` set.
|
|
184
|
-
* @returns Array of CSS class names to apply to individual cells
|
|
185
|
-
*/
|
|
186
|
-
computeCellClasses?: (context: HighlightContext) => string[];
|
|
187
|
-
}
|
|
188
|
-
//#endregion
|
|
189
|
-
//#region ../core/src/types/filters.d.ts
|
|
190
|
-
/** Text filter operators */
|
|
191
|
-
type TextFilterOperator = "contains" | "notContains" | "equals" | "notEquals" | "startsWith" | "endsWith" | "blank" | "notBlank";
|
|
192
|
-
/** Number filter operators (symbols for display) */
|
|
193
|
-
type NumberFilterOperator = "=" | "!=" | ">" | "<" | ">=" | "<=" | "between" | "blank" | "notBlank";
|
|
194
|
-
/** Date filter operators */
|
|
195
|
-
type DateFilterOperator = "=" | "!=" | ">" | "<" | "between" | "blank" | "notBlank";
|
|
196
|
-
/** Filter combination mode */
|
|
197
|
-
type FilterCombination = "and" | "or";
|
|
198
|
-
/** Text filter condition */
|
|
199
|
-
interface TextFilterCondition {
|
|
200
|
-
type: "text";
|
|
201
|
-
operator: TextFilterOperator;
|
|
202
|
-
value?: string;
|
|
203
|
-
/** Selected distinct values for checkbox-style filtering */
|
|
204
|
-
selectedValues?: Set<string>;
|
|
205
|
-
/** Include blank values */
|
|
206
|
-
includeBlank?: boolean;
|
|
207
|
-
/** Operator connecting this condition to the next. Defaults to ColumnFilterModel.combination */
|
|
208
|
-
nextOperator?: FilterCombination;
|
|
209
|
-
}
|
|
210
|
-
/** Number filter condition */
|
|
211
|
-
interface NumberFilterCondition {
|
|
212
|
-
type: "number";
|
|
213
|
-
operator: NumberFilterOperator;
|
|
214
|
-
value?: number;
|
|
215
|
-
/** Second value for "between" operator */
|
|
216
|
-
valueTo?: number;
|
|
217
|
-
/** Operator connecting this condition to the next. Defaults to ColumnFilterModel.combination */
|
|
218
|
-
nextOperator?: FilterCombination;
|
|
219
|
-
}
|
|
220
|
-
/** Date filter condition */
|
|
221
|
-
interface DateFilterCondition {
|
|
222
|
-
type: "date";
|
|
223
|
-
operator: DateFilterOperator;
|
|
224
|
-
value?: Date | string;
|
|
225
|
-
/** Second value for "between" operator */
|
|
226
|
-
valueTo?: Date | string;
|
|
227
|
-
/** Operator connecting this condition to the next. Defaults to ColumnFilterModel.combination */
|
|
228
|
-
nextOperator?: FilterCombination;
|
|
229
|
-
}
|
|
230
|
-
/** Union of filter condition types */
|
|
231
|
-
type FilterCondition = TextFilterCondition | NumberFilterCondition | DateFilterCondition;
|
|
232
|
-
/** Column filter model with multiple conditions */
|
|
233
|
-
interface ColumnFilterModel {
|
|
234
|
-
conditions: FilterCondition[];
|
|
235
|
-
combination: FilterCombination;
|
|
236
|
-
}
|
|
237
|
-
/** Filter model type - maps column ID to filter */
|
|
238
|
-
type FilterModel = Record<string, ColumnFilterModel>;
|
|
239
|
-
//#endregion
|
|
240
|
-
//#region ../core/src/types/data-source.d.ts
|
|
241
|
-
/** Data source request */
|
|
242
|
-
interface DataSourceRequest {
|
|
243
|
-
/** Pagination */
|
|
244
|
-
pagination: {
|
|
245
|
-
/** Page index */
|
|
246
|
-
pageIndex: number;
|
|
247
|
-
/** Page size */
|
|
248
|
-
pageSize: number;
|
|
249
|
-
};
|
|
250
|
-
/** Sort */
|
|
251
|
-
sort?: SortModel[];
|
|
252
|
-
/** Filter */
|
|
253
|
-
filter?: FilterModel;
|
|
254
|
-
}
|
|
255
|
-
/** Data source response */
|
|
256
|
-
interface DataSourceResponse<TData = Row> {
|
|
257
|
-
/** Rows */
|
|
258
|
-
rows: TData[];
|
|
259
|
-
/** Total rows */
|
|
260
|
-
totalRows: number;
|
|
261
|
-
}
|
|
262
|
-
/** Data source interface */
|
|
263
|
-
interface DataSource<TData = Row> {
|
|
264
|
-
fetch(request: DataSourceRequest): Promise<DataSourceResponse<TData>>;
|
|
265
|
-
/** Optional cleanup method to release resources */
|
|
266
|
-
destroy?: () => void;
|
|
267
|
-
}
|
|
268
|
-
//#endregion
|
|
269
|
-
//#region ../core/src/types/instructions.d.ts
|
|
270
|
-
/** Create slot instruction */
|
|
271
|
-
interface CreateSlotInstruction {
|
|
272
|
-
type: "CREATE_SLOT";
|
|
273
|
-
slotId: string;
|
|
274
|
-
}
|
|
275
|
-
/** Destroy slot instruction */
|
|
276
|
-
interface DestroySlotInstruction {
|
|
277
|
-
type: "DESTROY_SLOT";
|
|
278
|
-
slotId: string;
|
|
279
|
-
}
|
|
280
|
-
/** Assign slot instruction */
|
|
281
|
-
interface AssignSlotInstruction {
|
|
282
|
-
type: "ASSIGN_SLOT";
|
|
283
|
-
slotId: string;
|
|
284
|
-
rowIndex: number;
|
|
285
|
-
rowData: Row;
|
|
286
|
-
}
|
|
287
|
-
/** Move slot instruction */
|
|
288
|
-
interface MoveSlotInstruction {
|
|
289
|
-
type: "MOVE_SLOT";
|
|
290
|
-
slotId: string;
|
|
291
|
-
translateY: number;
|
|
292
|
-
}
|
|
293
|
-
/** Set active cell instruction */
|
|
294
|
-
interface SetActiveCellInstruction {
|
|
295
|
-
type: "SET_ACTIVE_CELL";
|
|
296
|
-
position: CellPosition | null;
|
|
297
|
-
}
|
|
298
|
-
/** Set hover position instruction (for highlighting) */
|
|
299
|
-
interface SetHoverPositionInstruction {
|
|
300
|
-
type: "SET_HOVER_POSITION";
|
|
301
|
-
position: CellPosition | null;
|
|
302
|
-
}
|
|
303
|
-
/** Set selection range instruction */
|
|
304
|
-
interface SetSelectionRangeInstruction {
|
|
305
|
-
type: "SET_SELECTION_RANGE";
|
|
306
|
-
range: CellRange | null;
|
|
307
|
-
}
|
|
308
|
-
/** Update visible range instruction - emitted when selection moves outside visible viewport */
|
|
309
|
-
interface UpdateVisibleRangeInstruction {
|
|
310
|
-
type: "UPDATE_VISIBLE_RANGE";
|
|
311
|
-
start: number;
|
|
312
|
-
end: number;
|
|
313
|
-
}
|
|
314
|
-
/** Start edit instruction */
|
|
315
|
-
interface StartEditInstruction {
|
|
316
|
-
type: "START_EDIT";
|
|
317
|
-
row: number;
|
|
318
|
-
col: number;
|
|
319
|
-
initialValue: CellValue;
|
|
320
|
-
}
|
|
321
|
-
/** Stop edit instruction */
|
|
322
|
-
interface StopEditInstruction {
|
|
323
|
-
type: "STOP_EDIT";
|
|
324
|
-
}
|
|
325
|
-
/** Commit edit instruction */
|
|
326
|
-
interface CommitEditInstruction {
|
|
327
|
-
type: "COMMIT_EDIT";
|
|
328
|
-
row: number;
|
|
329
|
-
col: number;
|
|
330
|
-
value: CellValue;
|
|
331
|
-
}
|
|
332
|
-
/** Set content size instruction */
|
|
333
|
-
interface SetContentSizeInstruction {
|
|
334
|
-
type: "SET_CONTENT_SIZE";
|
|
335
|
-
width: number;
|
|
336
|
-
height: number;
|
|
337
|
-
viewportWidth: number;
|
|
338
|
-
}
|
|
339
|
-
/** Update header instruction */
|
|
340
|
-
interface UpdateHeaderInstruction {
|
|
341
|
-
type: "UPDATE_HEADER";
|
|
342
|
-
colIndex: number;
|
|
343
|
-
column: ColumnDefinition;
|
|
344
|
-
sortDirection?: SortDirection;
|
|
345
|
-
sortIndex?: number;
|
|
346
|
-
/** Whether column is sortable */
|
|
347
|
-
sortable: boolean;
|
|
348
|
-
/** Whether column is filterable */
|
|
349
|
-
filterable: boolean;
|
|
350
|
-
/** Whether column has an active filter */
|
|
351
|
-
hasFilter: boolean;
|
|
352
|
-
}
|
|
353
|
-
/** Open filter popup instruction */
|
|
354
|
-
interface OpenFilterPopupInstruction {
|
|
355
|
-
type: "OPEN_FILTER_POPUP";
|
|
356
|
-
colIndex: number;
|
|
357
|
-
column: ColumnDefinition;
|
|
358
|
-
anchorRect: {
|
|
359
|
-
top: number;
|
|
360
|
-
left: number;
|
|
361
|
-
width: number;
|
|
362
|
-
height: number;
|
|
363
|
-
};
|
|
364
|
-
distinctValues: CellValue[];
|
|
365
|
-
currentFilter?: ColumnFilterModel;
|
|
366
|
-
}
|
|
367
|
-
/** Close filter popup instruction */
|
|
368
|
-
interface CloseFilterPopupInstruction {
|
|
369
|
-
type: "CLOSE_FILTER_POPUP";
|
|
370
|
-
}
|
|
371
|
-
/** Start fill instruction */
|
|
372
|
-
interface StartFillInstruction {
|
|
373
|
-
type: "START_FILL";
|
|
374
|
-
sourceRange: CellRange;
|
|
375
|
-
}
|
|
376
|
-
/** Update fill instruction */
|
|
377
|
-
interface UpdateFillInstruction {
|
|
378
|
-
type: "UPDATE_FILL";
|
|
379
|
-
targetRow: number;
|
|
380
|
-
targetCol: number;
|
|
381
|
-
}
|
|
382
|
-
/** Commit fill instruction */
|
|
383
|
-
interface CommitFillInstruction {
|
|
384
|
-
type: "COMMIT_FILL";
|
|
385
|
-
filledCells: Array<{
|
|
386
|
-
row: number;
|
|
387
|
-
col: number;
|
|
388
|
-
value: CellValue;
|
|
389
|
-
}>;
|
|
390
|
-
}
|
|
391
|
-
/** Cancel fill instruction */
|
|
392
|
-
interface CancelFillInstruction {
|
|
393
|
-
type: "CANCEL_FILL";
|
|
394
|
-
}
|
|
395
|
-
/** Data loading instruction */
|
|
396
|
-
interface DataLoadingInstruction {
|
|
397
|
-
type: "DATA_LOADING";
|
|
398
|
-
}
|
|
399
|
-
/** Data loaded instruction */
|
|
400
|
-
interface DataLoadedInstruction {
|
|
401
|
-
type: "DATA_LOADED";
|
|
402
|
-
totalRows: number;
|
|
403
|
-
}
|
|
404
|
-
/** Data error instruction */
|
|
405
|
-
interface DataErrorInstruction {
|
|
406
|
-
type: "DATA_ERROR";
|
|
407
|
-
error: string;
|
|
408
|
-
}
|
|
409
|
-
/** Rows added instruction */
|
|
410
|
-
interface RowsAddedInstruction {
|
|
411
|
-
type: "ROWS_ADDED";
|
|
412
|
-
indices: number[];
|
|
413
|
-
count: number;
|
|
414
|
-
totalRows: number;
|
|
415
|
-
}
|
|
416
|
-
/** Rows removed instruction */
|
|
417
|
-
interface RowsRemovedInstruction {
|
|
418
|
-
type: "ROWS_REMOVED";
|
|
419
|
-
indices: number[];
|
|
420
|
-
totalRows: number;
|
|
421
|
-
}
|
|
422
|
-
/** Rows updated instruction */
|
|
423
|
-
interface RowsUpdatedInstruction {
|
|
424
|
-
type: "ROWS_UPDATED";
|
|
425
|
-
indices: number[];
|
|
426
|
-
}
|
|
427
|
-
/** Transaction processed instruction */
|
|
428
|
-
interface TransactionProcessedInstruction {
|
|
429
|
-
type: "TRANSACTION_PROCESSED";
|
|
430
|
-
added: number;
|
|
431
|
-
removed: number;
|
|
432
|
-
updated: number;
|
|
433
|
-
}
|
|
434
|
-
/** Union type of all instructions */
|
|
435
|
-
type GridInstruction = /** Slot lifecycle */
|
|
436
|
-
CreateSlotInstruction | DestroySlotInstruction | AssignSlotInstruction | MoveSlotInstruction
|
|
437
|
-
/** Selection */ | SetActiveCellInstruction | SetSelectionRangeInstruction | UpdateVisibleRangeInstruction
|
|
438
|
-
/** Highlighting */ | SetHoverPositionInstruction
|
|
439
|
-
/** Editing */ | StartEditInstruction | StopEditInstruction | CommitEditInstruction
|
|
440
|
-
/** Layout */ | SetContentSizeInstruction | UpdateHeaderInstruction
|
|
441
|
-
/** Filter popup */ | OpenFilterPopupInstruction | CloseFilterPopupInstruction
|
|
442
|
-
/** Fill handle */ | StartFillInstruction | UpdateFillInstruction | CommitFillInstruction | CancelFillInstruction
|
|
443
|
-
/** Data */ | DataLoadingInstruction | DataLoadedInstruction | DataErrorInstruction
|
|
444
|
-
/** Transactions */ | RowsAddedInstruction | RowsRemovedInstruction | RowsUpdatedInstruction | TransactionProcessedInstruction;
|
|
445
|
-
/** Instruction listener: Single instruction Listener that receives a single instruction, used by frameworks to update their state */
|
|
446
|
-
type InstructionListener = (instruction: GridInstruction) => void;
|
|
447
|
-
//#endregion
|
|
448
|
-
//#region ../core/src/types/renderers.d.ts
|
|
449
|
-
/** Cell renderer params */
|
|
450
|
-
interface CellRendererParams<TData extends Row = Row> {
|
|
451
|
-
/** Cell value */
|
|
452
|
-
value: CellValue;
|
|
453
|
-
/** Row data */
|
|
454
|
-
rowData: TData;
|
|
455
|
-
/** Column definition */
|
|
456
|
-
column: ColumnDefinition;
|
|
457
|
-
/** Row index */
|
|
458
|
-
rowIndex: number;
|
|
459
|
-
/** Column index */
|
|
460
|
-
colIndex: number;
|
|
461
|
-
/** Is active cell */
|
|
462
|
-
isActive: boolean;
|
|
463
|
-
/** Is selected cell */
|
|
464
|
-
isSelected: boolean;
|
|
465
|
-
/** Is editing cell */
|
|
466
|
-
isEditing: boolean;
|
|
467
|
-
}
|
|
468
|
-
/** Edit renderer params */
|
|
469
|
-
interface EditRendererParams<TData extends Row = Row> extends CellRendererParams<TData> {
|
|
470
|
-
/** Initial value */
|
|
471
|
-
initialValue: CellValue;
|
|
472
|
-
/** On value change */
|
|
473
|
-
onValueChange: (newValue: CellValue) => void;
|
|
474
|
-
/** On commit */
|
|
475
|
-
onCommit: () => void;
|
|
476
|
-
/** On cancel */
|
|
477
|
-
onCancel: () => void;
|
|
478
|
-
}
|
|
479
|
-
/** Header renderer params */
|
|
480
|
-
interface HeaderRendererParams {
|
|
481
|
-
/** Column definition */
|
|
482
|
-
column: ColumnDefinition;
|
|
483
|
-
/** Column index */
|
|
484
|
-
colIndex: number;
|
|
485
|
-
/** Sort direction */
|
|
486
|
-
sortDirection?: SortDirection;
|
|
487
|
-
/** Sort index */
|
|
488
|
-
sortIndex?: number;
|
|
489
|
-
/** Whether column is sortable */
|
|
490
|
-
sortable: boolean;
|
|
491
|
-
/** Whether column is filterable */
|
|
492
|
-
filterable: boolean;
|
|
493
|
-
/** Whether column has an active filter */
|
|
494
|
-
hasFilter: boolean;
|
|
495
|
-
/** On sort */
|
|
496
|
-
onSort: (direction: SortDirection | null, addToExisting: boolean) => void;
|
|
497
|
-
/** On filter click */
|
|
498
|
-
onFilterClick: () => void;
|
|
499
|
-
}
|
|
500
|
-
//#endregion
|
|
501
|
-
//#region ../core/src/types/options.d.ts
|
|
502
|
-
/** Grid core options */
|
|
503
|
-
interface GridCoreOptions<TData = Row> {
|
|
504
|
-
/** Column definitions */
|
|
505
|
-
columns: ColumnDefinition[];
|
|
506
|
-
/** Data source */
|
|
507
|
-
dataSource: DataSource<TData>;
|
|
508
|
-
/** Row height */
|
|
509
|
-
rowHeight: number;
|
|
510
|
-
/** Header height: Default to row height */
|
|
511
|
-
headerHeight?: number;
|
|
512
|
-
/** Overscan: How many rows to render outside the viewport */
|
|
513
|
-
overscan?: number;
|
|
514
|
-
/** Enable/disable sorting globally. Default: true */
|
|
515
|
-
sortingEnabled?: boolean;
|
|
516
|
-
/** Debounce time for transactions in ms. Default 50. Set to 0 for sync. */
|
|
517
|
-
transactionDebounceMs?: number;
|
|
518
|
-
/** Function to extract unique ID from row. Required for mutations. */
|
|
519
|
-
getRowId?: (row: TData) => RowId;
|
|
520
|
-
/** Row/column/cell highlighting configuration */
|
|
521
|
-
highlighting?: HighlightingOptions<TData>;
|
|
522
|
-
/** Called when a cell value is changed via editing or fill drag. Requires getRowId. */
|
|
523
|
-
onCellValueChanged?: (event: CellValueChangedEvent<TData>) => void;
|
|
524
|
-
}
|
|
525
|
-
//#endregion
|
|
526
|
-
//#region ../core/src/types/input.d.ts
|
|
527
|
-
/** Framework-agnostic pointer/mouse event data */
|
|
528
|
-
interface PointerEventData {
|
|
529
|
-
/** X coordinate relative to viewport */
|
|
530
|
-
clientX: number;
|
|
531
|
-
/** Y coordinate relative to viewport */
|
|
532
|
-
clientY: number;
|
|
533
|
-
/** Mouse button (0 = left, 1 = middle, 2 = right) */
|
|
534
|
-
button: number;
|
|
535
|
-
/** Whether Shift key is pressed */
|
|
536
|
-
shiftKey: boolean;
|
|
537
|
-
/** Whether Ctrl key is pressed */
|
|
538
|
-
ctrlKey: boolean;
|
|
539
|
-
/** Whether Meta/Command key is pressed */
|
|
540
|
-
metaKey: boolean;
|
|
541
|
-
}
|
|
542
|
-
/** Framework-agnostic keyboard event data */
|
|
543
|
-
interface KeyEventData {
|
|
544
|
-
/** Key value (e.g., 'Enter', 'ArrowUp', 'a') */
|
|
545
|
-
key: string;
|
|
546
|
-
/** Whether Shift key is pressed */
|
|
547
|
-
shiftKey: boolean;
|
|
548
|
-
/** Whether Ctrl key is pressed */
|
|
549
|
-
ctrlKey: boolean;
|
|
550
|
-
/** Whether Meta/Command key is pressed */
|
|
551
|
-
metaKey: boolean;
|
|
552
|
-
}
|
|
553
|
-
/** Container bounds and scroll position */
|
|
554
|
-
interface ContainerBounds {
|
|
555
|
-
/** Top position relative to viewport */
|
|
556
|
-
top: number;
|
|
557
|
-
/** Left position relative to viewport */
|
|
558
|
-
left: number;
|
|
559
|
-
/** Container width */
|
|
560
|
-
width: number;
|
|
561
|
-
/** Container height */
|
|
562
|
-
height: number;
|
|
563
|
-
/** Current scroll top position */
|
|
564
|
-
scrollTop: number;
|
|
565
|
-
/** Current scroll left position */
|
|
566
|
-
scrollLeft: number;
|
|
567
|
-
}
|
|
568
|
-
/** Result from mouse/pointer input handlers */
|
|
569
|
-
interface InputResult {
|
|
570
|
-
/** Whether to call preventDefault() on the event */
|
|
571
|
-
preventDefault: boolean;
|
|
572
|
-
/** Whether to call stopPropagation() on the event */
|
|
573
|
-
stopPropagation: boolean;
|
|
574
|
-
/** Whether framework should focus the container element */
|
|
575
|
-
focusContainer?: boolean;
|
|
576
|
-
/** Type of drag operation to start (framework manages global listeners) */
|
|
577
|
-
startDrag?: "selection" | "fill";
|
|
578
|
-
}
|
|
579
|
-
/** Result from keyboard input handler */
|
|
580
|
-
interface KeyboardResult {
|
|
581
|
-
/** Whether to call preventDefault() on the event */
|
|
582
|
-
preventDefault: boolean;
|
|
583
|
-
/** Cell to scroll into view (if navigation occurred) */
|
|
584
|
-
scrollToCell?: CellPosition;
|
|
585
|
-
}
|
|
586
|
-
/** Result from drag move handler */
|
|
587
|
-
interface DragMoveResult {
|
|
588
|
-
/** Target row index */
|
|
589
|
-
targetRow: number;
|
|
590
|
-
/** Target column index */
|
|
591
|
-
targetCol: number;
|
|
592
|
-
/** Auto-scroll deltas (null if no auto-scroll needed) */
|
|
593
|
-
autoScroll: {
|
|
594
|
-
dx: number;
|
|
595
|
-
dy: number;
|
|
596
|
-
} | null;
|
|
597
|
-
}
|
|
598
|
-
/** Options for InputHandler constructor */
|
|
599
|
-
interface InputHandlerDeps {
|
|
600
|
-
/** Get header height */
|
|
601
|
-
getHeaderHeight: () => number;
|
|
602
|
-
/** Get row height */
|
|
603
|
-
getRowHeight: () => number;
|
|
604
|
-
/** Get column positions array (indexed by visible column) */
|
|
605
|
-
getColumnPositions: () => number[];
|
|
606
|
-
/** Get visible column count */
|
|
607
|
-
getColumnCount: () => number;
|
|
608
|
-
/**
|
|
609
|
-
* Convert visible column index to original column index.
|
|
610
|
-
* Used when columns can be hidden. Returns the original index for selection tracking.
|
|
611
|
-
* If not provided, visible index is used directly (no hidden columns).
|
|
612
|
-
*/
|
|
613
|
-
getOriginalColumnIndex?: (visibleIndex: number) => number;
|
|
614
|
-
}
|
|
615
|
-
/** Current drag state for UI rendering */
|
|
616
|
-
interface DragState {
|
|
617
|
-
/** Whether any drag operation is active */
|
|
618
|
-
isDragging: boolean;
|
|
619
|
-
/** Type of active drag operation */
|
|
620
|
-
dragType: "selection" | "fill" | null;
|
|
621
|
-
/** Source range for fill operations */
|
|
622
|
-
fillSourceRange: CellRange | null;
|
|
623
|
-
/** Current fill target position */
|
|
624
|
-
fillTarget: {
|
|
625
|
-
row: number;
|
|
626
|
-
col: number;
|
|
627
|
-
} | null;
|
|
628
|
-
}
|
|
629
|
-
//#endregion
|
|
630
|
-
//#region ../core/src/utils/positioning.d.ts
|
|
631
|
-
/**
|
|
632
|
-
* Calculate cumulative column positions (prefix sums)
|
|
633
|
-
* Returns an array where positions[i] is the left position of column i
|
|
634
|
-
* positions[columns.length] is the total width
|
|
635
|
-
*/
|
|
636
|
-
declare const calculateColumnPositions: (columns: ColumnDefinition[]) => number[];
|
|
637
|
-
/**
|
|
638
|
-
* Get total width from column positions
|
|
639
|
-
*/
|
|
640
|
-
declare const getTotalWidth: (columnPositions: number[]) => number;
|
|
641
|
-
/**
|
|
642
|
-
* Find column index at a given X coordinate
|
|
643
|
-
*/
|
|
644
|
-
declare const findColumnAtX: (x: number, columnPositions: number[]) => number;
|
|
645
|
-
//#endregion
|
|
646
|
-
//#region ../core/src/utils/classNames.d.ts
|
|
647
|
-
/**
|
|
648
|
-
* Check if a cell is within the selection range
|
|
649
|
-
*/
|
|
650
|
-
declare const isCellSelected: (row: number, col: number, selectionRange: CellRange | null) => boolean;
|
|
651
|
-
/**
|
|
652
|
-
* Check if a cell is the active cell
|
|
653
|
-
*/
|
|
654
|
-
declare const isCellActive: (row: number, col: number, activeCell: CellPosition | null) => boolean;
|
|
655
|
-
/**
|
|
656
|
-
* Check if a row is within the visible range (not in overscan)
|
|
657
|
-
*/
|
|
658
|
-
declare const isRowVisible: (row: number, visibleRowRange: {
|
|
659
|
-
start: number;
|
|
660
|
-
end: number;
|
|
661
|
-
} | null) => boolean;
|
|
662
|
-
/**
|
|
663
|
-
* Check if a cell is being edited
|
|
664
|
-
*/
|
|
665
|
-
declare const isCellEditing: (row: number, col: number, editingCell: {
|
|
666
|
-
row: number;
|
|
667
|
-
col: number;
|
|
668
|
-
} | null) => boolean;
|
|
669
|
-
/**
|
|
670
|
-
* Check if a cell is in the fill preview range (vertical-only fill)
|
|
671
|
-
*/
|
|
672
|
-
declare const isCellInFillPreview: (row: number, col: number, isDraggingFill: boolean, fillSourceRange: CellRange | null, fillTarget: {
|
|
673
|
-
row: number;
|
|
674
|
-
col: number;
|
|
675
|
-
} | null) => boolean;
|
|
676
|
-
/**
|
|
677
|
-
* Build cell CSS classes based on state
|
|
678
|
-
*/
|
|
679
|
-
declare const buildCellClasses: (isActive: boolean, isSelected: boolean, isEditing: boolean, inFillPreview: boolean) => string;
|
|
680
|
-
//#endregion
|
|
681
|
-
//#region ../core/src/utils/event-emitter.d.ts
|
|
682
|
-
/**
|
|
683
|
-
* Batch instruction listener for efficient state updates
|
|
684
|
-
*/
|
|
685
|
-
type BatchInstructionListener = (instructions: GridInstruction[]) => void;
|
|
686
|
-
//#endregion
|
|
687
|
-
//#region ../core/src/selection.d.ts
|
|
688
|
-
type Direction = "up" | "down" | "left" | "right";
|
|
689
|
-
interface SelectionManagerOptions {
|
|
690
|
-
getRowCount: () => number;
|
|
691
|
-
getColumnCount: () => number;
|
|
692
|
-
getCellValue: (row: number, col: number) => CellValue;
|
|
693
|
-
getRowData: (row: number) => Row | undefined;
|
|
694
|
-
getColumn: (col: number) => ColumnDefinition | undefined;
|
|
695
|
-
}
|
|
696
|
-
/**
|
|
697
|
-
* Manages Excel-style cell selection, keyboard navigation, and clipboard operations.
|
|
698
|
-
*/
|
|
699
|
-
declare class SelectionManager {
|
|
700
|
-
private state;
|
|
701
|
-
private options;
|
|
702
|
-
private emitter;
|
|
703
|
-
onInstruction: (listener: InstructionListener) => () => void;
|
|
704
|
-
private emit;
|
|
705
|
-
constructor(options: SelectionManagerOptions);
|
|
706
|
-
getState(): SelectionState;
|
|
707
|
-
getActiveCell(): CellPosition | null;
|
|
708
|
-
getSelectionRange(): CellRange | null;
|
|
709
|
-
isSelected(row: number, col: number): boolean;
|
|
710
|
-
isActiveCell(row: number, col: number): boolean;
|
|
711
|
-
/**
|
|
712
|
-
* Start a selection at the given cell.
|
|
713
|
-
* @param cell - The cell to select
|
|
714
|
-
* @param opts.shift - Extend selection from anchor (range select)
|
|
715
|
-
* @param opts.ctrl - Toggle selection mode
|
|
716
|
-
*/
|
|
717
|
-
startSelection(cell: CellPosition, opts?: {
|
|
718
|
-
shift?: boolean;
|
|
719
|
-
ctrl?: boolean;
|
|
720
|
-
}): void;
|
|
721
|
-
/**
|
|
722
|
-
* Move focus in a direction, optionally extending the selection.
|
|
723
|
-
*/
|
|
724
|
-
moveFocus(direction: Direction, extend?: boolean): void;
|
|
725
|
-
/**
|
|
726
|
-
* Select all cells in the grid (Ctrl+A).
|
|
727
|
-
*/
|
|
728
|
-
selectAll(): void;
|
|
729
|
-
/**
|
|
730
|
-
* Clear the current selection.
|
|
731
|
-
*/
|
|
732
|
-
clearSelection(): void;
|
|
733
|
-
/**
|
|
734
|
-
* Set the active cell directly.
|
|
735
|
-
*/
|
|
736
|
-
setActiveCell(row: number, col: number): void;
|
|
737
|
-
/**
|
|
738
|
-
* Set the selection range directly.
|
|
739
|
-
*/
|
|
740
|
-
setSelectionRange(range: CellRange): void;
|
|
741
|
-
/**
|
|
742
|
-
* Get the data from the currently selected cells as a 2D array.
|
|
743
|
-
*/
|
|
744
|
-
getSelectedData(): CellValue[][];
|
|
745
|
-
/**
|
|
746
|
-
* Copy the selected data to the clipboard (Ctrl+C).
|
|
747
|
-
*/
|
|
748
|
-
copySelectionToClipboard(): Promise<void>;
|
|
749
|
-
/**
|
|
750
|
-
* Clean up resources for garbage collection.
|
|
751
|
-
*/
|
|
752
|
-
destroy(): void;
|
|
753
|
-
private clampPosition;
|
|
754
|
-
}
|
|
755
|
-
//#endregion
|
|
756
|
-
//#region ../core/src/fill.d.ts
|
|
757
|
-
interface FillManagerOptions {
|
|
758
|
-
getRowCount: () => number;
|
|
759
|
-
getColumnCount: () => number;
|
|
760
|
-
getCellValue: (row: number, col: number) => CellValue;
|
|
761
|
-
getColumn: (col: number) => ColumnDefinition | undefined;
|
|
762
|
-
setCellValue: (row: number, col: number, value: CellValue) => void;
|
|
763
|
-
}
|
|
764
|
-
/**
|
|
765
|
-
* Manages fill handle operations including pattern detection and auto-fill.
|
|
766
|
-
*/
|
|
767
|
-
declare class FillManager {
|
|
768
|
-
private state;
|
|
769
|
-
private options;
|
|
770
|
-
private emitter;
|
|
771
|
-
onInstruction: (listener: InstructionListener) => () => void;
|
|
772
|
-
private emit;
|
|
773
|
-
constructor(options: FillManagerOptions);
|
|
774
|
-
getState(): FillHandleState | null;
|
|
775
|
-
isActive(): boolean;
|
|
776
|
-
/**
|
|
777
|
-
* Start a fill drag operation from a source range.
|
|
778
|
-
*/
|
|
779
|
-
startFillDrag(sourceRange: CellRange): void;
|
|
780
|
-
/**
|
|
781
|
-
* Update the fill drag target position.
|
|
782
|
-
*/
|
|
783
|
-
updateFillDrag(targetRow: number, targetCol: number): void;
|
|
784
|
-
/**
|
|
785
|
-
* Commit the fill operation - apply pattern to target cells.
|
|
786
|
-
*/
|
|
787
|
-
commitFillDrag(): void;
|
|
788
|
-
/**
|
|
789
|
-
* Cancel the fill operation.
|
|
790
|
-
*/
|
|
791
|
-
cancelFillDrag(): void;
|
|
792
|
-
/**
|
|
793
|
-
* Clean up resources for garbage collection.
|
|
794
|
-
*/
|
|
795
|
-
destroy(): void;
|
|
796
|
-
/**
|
|
797
|
-
* Calculate the values to fill based on source pattern.
|
|
798
|
-
*/
|
|
799
|
-
private calculateFilledCells;
|
|
800
|
-
private getSourceColumnValues;
|
|
801
|
-
private detectPattern;
|
|
802
|
-
private applyPattern;
|
|
803
|
-
}
|
|
804
|
-
//#endregion
|
|
805
|
-
//#region ../core/src/input-handler.d.ts
|
|
806
|
-
declare class InputHandler<TData extends Row = Row> {
|
|
807
|
-
private core;
|
|
808
|
-
private deps;
|
|
809
|
-
private isDraggingSelection;
|
|
810
|
-
private isDraggingFill;
|
|
811
|
-
private fillSourceRange;
|
|
812
|
-
private fillTarget;
|
|
813
|
-
constructor(core: GridCore<TData>, deps: InputHandlerDeps);
|
|
814
|
-
/**
|
|
815
|
-
* Update dependencies (called when options change)
|
|
816
|
-
*/
|
|
817
|
-
updateDeps(deps: Partial<InputHandlerDeps>): void;
|
|
818
|
-
/**
|
|
819
|
-
* Get current drag state for UI rendering
|
|
820
|
-
*/
|
|
821
|
-
getDragState(): DragState;
|
|
822
|
-
/**
|
|
823
|
-
* Handle cell mouse down event
|
|
824
|
-
*/
|
|
825
|
-
handleCellMouseDown(rowIndex: number, colIndex: number, event: PointerEventData): InputResult;
|
|
826
|
-
/**
|
|
827
|
-
* Handle cell double click event (start editing)
|
|
828
|
-
*/
|
|
829
|
-
handleCellDoubleClick(rowIndex: number, colIndex: number): void;
|
|
830
|
-
/**
|
|
831
|
-
* Handle cell mouse enter event (for hover highlighting)
|
|
832
|
-
*/
|
|
833
|
-
handleCellMouseEnter(rowIndex: number, colIndex: number): void;
|
|
834
|
-
/**
|
|
835
|
-
* Handle cell mouse leave event (for hover highlighting)
|
|
836
|
-
*/
|
|
837
|
-
handleCellMouseLeave(): void;
|
|
838
|
-
/**
|
|
839
|
-
* Handle fill handle mouse down event
|
|
840
|
-
*/
|
|
841
|
-
handleFillHandleMouseDown(activeCell: CellPosition | null, selectionRange: CellRange | null, _event: PointerEventData): InputResult;
|
|
842
|
-
/**
|
|
843
|
-
* Handle header click event (cycle sort direction)
|
|
844
|
-
*/
|
|
845
|
-
handleHeaderClick(colId: string, addToExisting: boolean): void;
|
|
846
|
-
/**
|
|
847
|
-
* Start selection drag (called by framework after handleCellMouseDown returns startDrag: 'selection')
|
|
848
|
-
*/
|
|
849
|
-
startSelectionDrag(): void;
|
|
850
|
-
/**
|
|
851
|
-
* Handle drag move event (selection or fill)
|
|
852
|
-
*/
|
|
853
|
-
handleDragMove(event: PointerEventData, bounds: ContainerBounds): DragMoveResult | null;
|
|
854
|
-
/**
|
|
855
|
-
* Handle drag end event
|
|
856
|
-
*/
|
|
857
|
-
handleDragEnd(): void;
|
|
858
|
-
/**
|
|
859
|
-
* Handle wheel event with dampening for large datasets
|
|
860
|
-
* Returns scroll deltas or null if no dampening needed
|
|
861
|
-
*/
|
|
862
|
-
handleWheel(deltaY: number, deltaX: number, dampening: number): {
|
|
863
|
-
dy: number;
|
|
864
|
-
dx: number;
|
|
865
|
-
} | null;
|
|
866
|
-
/**
|
|
867
|
-
* Handle keyboard event
|
|
868
|
-
*/
|
|
869
|
-
handleKeyDown(event: KeyEventData, activeCell: CellPosition | null, editingCell: {
|
|
870
|
-
row: number;
|
|
871
|
-
col: number;
|
|
872
|
-
} | null, filterPopupOpen: boolean): KeyboardResult;
|
|
873
|
-
/**
|
|
874
|
-
* Calculate auto-scroll deltas based on mouse position
|
|
875
|
-
*/
|
|
876
|
-
private calculateAutoScroll;
|
|
877
|
-
}
|
|
878
|
-
//#endregion
|
|
879
|
-
//#region ../core/src/highlight-manager.d.ts
|
|
880
|
-
interface HighlightManagerOptions {
|
|
881
|
-
getActiveCell: () => CellPosition | null;
|
|
882
|
-
getSelectionRange: () => CellRange | null;
|
|
883
|
-
getColumn: (colIndex: number) => ColumnDefinition | undefined;
|
|
884
|
-
}
|
|
885
|
-
/**
|
|
886
|
-
* Manages row/column/cell highlighting state and class computation.
|
|
887
|
-
* Emits SET_HOVER_POSITION instructions when hover position changes.
|
|
888
|
-
*/
|
|
889
|
-
declare class HighlightManager<TData = Record<string, unknown>> {
|
|
890
|
-
private options;
|
|
891
|
-
private highlightingOptions;
|
|
892
|
-
private hoverPosition;
|
|
893
|
-
private emitter;
|
|
894
|
-
onInstruction: (listener: InstructionListener) => () => void;
|
|
895
|
-
private emit;
|
|
896
|
-
private rowClassCache;
|
|
897
|
-
private columnClassCache;
|
|
898
|
-
private cellClassCache;
|
|
899
|
-
constructor(options: HighlightManagerOptions, highlightingOptions?: HighlightingOptions<TData>);
|
|
900
|
-
/**
|
|
901
|
-
* Check if highlighting is enabled (any callback defined).
|
|
902
|
-
* Hover tracking is automatically enabled when highlighting is enabled.
|
|
903
|
-
*/
|
|
904
|
-
isEnabled(): boolean;
|
|
905
|
-
/**
|
|
906
|
-
* Update highlighting options. Clears all caches.
|
|
907
|
-
*/
|
|
908
|
-
updateOptions(options: HighlightingOptions<TData>): void;
|
|
909
|
-
/**
|
|
910
|
-
* Set the current hover position. Clears caches and emits instruction.
|
|
911
|
-
* Hover tracking is automatically enabled when any highlighting callback is defined.
|
|
912
|
-
*/
|
|
913
|
-
setHoverPosition(position: CellPosition | null): void;
|
|
914
|
-
/**
|
|
915
|
-
* Get the current hover position
|
|
916
|
-
*/
|
|
917
|
-
getHoverPosition(): CellPosition | null;
|
|
918
|
-
/**
|
|
919
|
-
* Called when selection changes. Clears all caches.
|
|
920
|
-
*/
|
|
921
|
-
onSelectionChange(): void;
|
|
922
|
-
/**
|
|
923
|
-
* Build context for row highlighting callback.
|
|
924
|
-
* Returns context with `rowIndex` set, `colIndex` is null.
|
|
925
|
-
* `isHovered` is true when the mouse is on any cell in this row.
|
|
926
|
-
*/
|
|
927
|
-
buildRowContext(rowIndex: number, rowData?: TData): HighlightContext<TData>;
|
|
928
|
-
/**
|
|
929
|
-
* Build context for column highlighting callback.
|
|
930
|
-
* Returns context with `colIndex` set, `rowIndex` is null.
|
|
931
|
-
* `isHovered` is true when the mouse is on any cell in this column.
|
|
932
|
-
*/
|
|
933
|
-
buildColumnContext(colIndex: number, column: ColumnDefinition): HighlightContext<TData>;
|
|
934
|
-
/**
|
|
935
|
-
* Build context for cell highlighting callback.
|
|
936
|
-
* Returns context with both `rowIndex` and `colIndex` set.
|
|
937
|
-
* `isHovered` is true only when the mouse is on this exact cell.
|
|
938
|
-
*/
|
|
939
|
-
buildCellContext(rowIndex: number, colIndex: number, column: ColumnDefinition, rowData?: TData): HighlightContext<TData>;
|
|
940
|
-
/**
|
|
941
|
-
* Compute row classes using cache and user callback
|
|
942
|
-
*/
|
|
943
|
-
computeRowClasses(rowIndex: number, rowData?: TData): string[];
|
|
944
|
-
/**
|
|
945
|
-
* Compute column classes using cache and user callback (or per-column override)
|
|
946
|
-
*/
|
|
947
|
-
computeColumnClasses(colIndex: number, column: ColumnDefinition): string[];
|
|
948
|
-
/**
|
|
949
|
-
* Compute cell classes using cache and user callback (or per-column override)
|
|
950
|
-
*/
|
|
951
|
-
computeCellClasses(rowIndex: number, colIndex: number, column: ColumnDefinition, rowData?: TData): string[];
|
|
952
|
-
/**
|
|
953
|
-
* Compute combined cell classes (column + cell classes flattened)
|
|
954
|
-
*/
|
|
955
|
-
computeCombinedCellClasses(rowIndex: number, colIndex: number, column: ColumnDefinition, rowData?: TData): string[];
|
|
956
|
-
/**
|
|
957
|
-
* Clear all caches
|
|
958
|
-
*/
|
|
959
|
-
clearAllCaches(): void;
|
|
960
|
-
/**
|
|
961
|
-
* Destroy the manager and release resources
|
|
962
|
-
*/
|
|
963
|
-
destroy(): void;
|
|
964
|
-
}
|
|
965
|
-
//#endregion
|
|
966
|
-
//#region ../core/src/sort-filter-manager.d.ts
|
|
967
|
-
interface SortFilterManagerOptions<TData> {
|
|
968
|
-
/** Get all columns */
|
|
969
|
-
getColumns: () => ColumnDefinition[];
|
|
970
|
-
/** Check if sorting is enabled globally */
|
|
971
|
-
isSortingEnabled: () => boolean;
|
|
972
|
-
/** Get cached rows for distinct value computation */
|
|
973
|
-
getCachedRows: () => Map<number, TData>;
|
|
974
|
-
/** Called when sort/filter changes to trigger data refresh */
|
|
975
|
-
onSortFilterChange: () => Promise<void>;
|
|
976
|
-
/** Called after data refresh to update UI */
|
|
977
|
-
onDataRefreshed: () => void;
|
|
978
|
-
}
|
|
979
|
-
/**
|
|
980
|
-
* Manages sorting and filtering state and operations.
|
|
981
|
-
*/
|
|
982
|
-
declare class SortFilterManager<TData = Record<string, unknown>> {
|
|
983
|
-
private options;
|
|
984
|
-
private emitter;
|
|
985
|
-
private sortModel;
|
|
986
|
-
private filterModel;
|
|
987
|
-
private openFilterColIndex;
|
|
988
|
-
onInstruction: (listener: InstructionListener) => () => void;
|
|
989
|
-
private emit;
|
|
990
|
-
constructor(options: SortFilterManagerOptions<TData>);
|
|
991
|
-
setSort(colId: string, direction: SortDirection | null, addToExisting?: boolean): Promise<void>;
|
|
992
|
-
getSortModel(): SortModel[];
|
|
993
|
-
setFilter(colId: string, filter: ColumnFilterModel | string | null): Promise<void>;
|
|
994
|
-
getFilterModel(): FilterModel;
|
|
995
|
-
/**
|
|
996
|
-
* Check if a column has an active filter
|
|
997
|
-
*/
|
|
998
|
-
hasActiveFilter(colId: string): boolean;
|
|
999
|
-
/**
|
|
1000
|
-
* Check if a column is sortable
|
|
1001
|
-
*/
|
|
1002
|
-
isColumnSortable(colIndex: number): boolean;
|
|
1003
|
-
/**
|
|
1004
|
-
* Check if a column is filterable
|
|
1005
|
-
*/
|
|
1006
|
-
isColumnFilterable(colIndex: number): boolean;
|
|
1007
|
-
/**
|
|
1008
|
-
* Get distinct values for a column (for filter dropdowns)
|
|
1009
|
-
* For array-type columns (like tags), each unique array combination is returned.
|
|
1010
|
-
* Arrays are sorted internally for consistent comparison.
|
|
1011
|
-
* Limited to maxValues to avoid performance issues with large datasets.
|
|
1012
|
-
*/
|
|
1013
|
-
getDistinctValuesForColumn(colId: string, maxValues?: number): CellValue[];
|
|
1014
|
-
/**
|
|
1015
|
-
* Open filter popup for a column (toggles if already open for same column)
|
|
1016
|
-
*/
|
|
1017
|
-
openFilterPopup(colIndex: number, anchorRect: {
|
|
1018
|
-
top: number;
|
|
1019
|
-
left: number;
|
|
1020
|
-
width: number;
|
|
1021
|
-
height: number;
|
|
1022
|
-
}): void;
|
|
1023
|
-
/**
|
|
1024
|
-
* Close filter popup
|
|
1025
|
-
*/
|
|
1026
|
-
closeFilterPopup(): void;
|
|
1027
|
-
/**
|
|
1028
|
-
* Get sort info map for header rendering
|
|
1029
|
-
*/
|
|
1030
|
-
getSortInfoMap(): Map<string, {
|
|
1031
|
-
direction: SortDirection;
|
|
1032
|
-
index: number;
|
|
1033
|
-
}>;
|
|
1034
|
-
destroy(): void;
|
|
1035
|
-
}
|
|
1036
|
-
//#endregion
|
|
1037
|
-
//#region ../core/src/row-mutation-manager.d.ts
|
|
1038
|
-
interface RowMutationManagerOptions<TData> {
|
|
1039
|
-
/** Get the cached rows map */
|
|
1040
|
-
getCachedRows: () => Map<number, TData>;
|
|
1041
|
-
/** Set the cached rows map (for bulk operations) */
|
|
1042
|
-
setCachedRows: (rows: Map<number, TData>) => void;
|
|
1043
|
-
/** Get total row count */
|
|
1044
|
-
getTotalRows: () => number;
|
|
1045
|
-
/** Set total row count */
|
|
1046
|
-
setTotalRows: (count: number) => void;
|
|
1047
|
-
/** Update a single slot after row change */
|
|
1048
|
-
updateSlot: (rowIndex: number) => void;
|
|
1049
|
-
/** Refresh all slots after bulk changes */
|
|
1050
|
-
refreshAllSlots: () => void;
|
|
1051
|
-
/** Emit content size change */
|
|
1052
|
-
emitContentSize: () => void;
|
|
1053
|
-
/** Clear selection if it references invalid rows */
|
|
1054
|
-
clearSelectionIfInvalid: (maxValidRow: number) => void;
|
|
1055
|
-
}
|
|
1056
|
-
/**
|
|
1057
|
-
* Manages row CRUD operations and cache management.
|
|
1058
|
-
*/
|
|
1059
|
-
declare class RowMutationManager<TData extends Row = Row> {
|
|
1060
|
-
private options;
|
|
1061
|
-
private emitter;
|
|
1062
|
-
onInstruction: (listener: InstructionListener) => () => void;
|
|
1063
|
-
private emit;
|
|
1064
|
-
constructor(options: RowMutationManagerOptions<TData>);
|
|
1065
|
-
/**
|
|
1066
|
-
* Get a row by index.
|
|
1067
|
-
*/
|
|
1068
|
-
getRow(index: number): TData | undefined;
|
|
1069
|
-
/**
|
|
1070
|
-
* Add rows to the grid at the specified index.
|
|
1071
|
-
* If no index is provided, rows are added at the end.
|
|
1072
|
-
*/
|
|
1073
|
-
addRows(rows: TData[], index?: number): void;
|
|
1074
|
-
/**
|
|
1075
|
-
* Update existing rows with partial data.
|
|
1076
|
-
*/
|
|
1077
|
-
updateRows(updates: Array<{
|
|
1078
|
-
index: number;
|
|
1079
|
-
data: Partial<TData>;
|
|
1080
|
-
}>): void;
|
|
1081
|
-
/**
|
|
1082
|
-
* Delete rows at the specified indices.
|
|
1083
|
-
*/
|
|
1084
|
-
deleteRows(indices: number[]): void;
|
|
1085
|
-
/**
|
|
1086
|
-
* Set a complete row at the specified index.
|
|
1087
|
-
* Use this for complete row replacement. For partial updates, use updateRows.
|
|
1088
|
-
*/
|
|
1089
|
-
setRow(index: number, data: TData): void;
|
|
1090
|
-
destroy(): void;
|
|
1091
|
-
}
|
|
1092
|
-
//#endregion
|
|
1093
|
-
//#region ../core/src/grid-core.d.ts
|
|
1094
|
-
declare class GridCore<TData extends Row = Row> {
|
|
1095
|
-
private columns;
|
|
1096
|
-
private dataSource;
|
|
1097
|
-
private rowHeight;
|
|
1098
|
-
private headerHeight;
|
|
1099
|
-
private overscan;
|
|
1100
|
-
private sortingEnabled;
|
|
1101
|
-
private getRowId?;
|
|
1102
|
-
private onCellValueChanged?;
|
|
1103
|
-
private scrollTop;
|
|
1104
|
-
private scrollLeft;
|
|
1105
|
-
private viewportWidth;
|
|
1106
|
-
private viewportHeight;
|
|
1107
|
-
private cachedRows;
|
|
1108
|
-
private totalRows;
|
|
1109
|
-
private currentPageIndex;
|
|
1110
|
-
private pageSize;
|
|
1111
|
-
readonly selection: SelectionManager;
|
|
1112
|
-
readonly fill: FillManager;
|
|
1113
|
-
readonly input: InputHandler<TData>;
|
|
1114
|
-
readonly highlight: HighlightManager<TData> | null;
|
|
1115
|
-
readonly sortFilter: SortFilterManager<TData>;
|
|
1116
|
-
readonly rowMutation: RowMutationManager<TData>;
|
|
1117
|
-
private readonly slotPool;
|
|
1118
|
-
private readonly editManager;
|
|
1119
|
-
private columnPositions;
|
|
1120
|
-
private emitter;
|
|
1121
|
-
onInstruction: (listener: InstructionListener) => () => void;
|
|
1122
|
-
onBatchInstruction: (listener: BatchInstructionListener) => () => void;
|
|
1123
|
-
private emit;
|
|
1124
|
-
private emitBatch;
|
|
1125
|
-
private naturalContentHeight;
|
|
1126
|
-
private virtualContentHeight;
|
|
1127
|
-
private scrollRatio;
|
|
1128
|
-
private isDestroyed;
|
|
1129
|
-
private _isDataLoading;
|
|
1130
|
-
constructor(options: GridCoreOptions<TData>);
|
|
1131
|
-
/**
|
|
1132
|
-
* Initialize the grid and load initial data.
|
|
1133
|
-
*/
|
|
1134
|
-
initialize(): Promise<void>;
|
|
1135
|
-
/**
|
|
1136
|
-
* Update viewport measurements and sync slots.
|
|
1137
|
-
* When scroll virtualization is active, maps the DOM scroll position to the actual row position.
|
|
1138
|
-
*/
|
|
1139
|
-
setViewport(scrollTop: number, scrollLeft: number, width: number, height: number): void;
|
|
1140
|
-
private fetchData;
|
|
1141
|
-
private fetchAllData;
|
|
1142
|
-
setSort(colId: string, direction: SortDirection | null, addToExisting?: boolean): Promise<void>;
|
|
1143
|
-
setFilter(colId: string, filter: ColumnFilterModel | string | null): Promise<void>;
|
|
1144
|
-
hasActiveFilter(colId: string): boolean;
|
|
1145
|
-
isColumnSortable(colIndex: number): boolean;
|
|
1146
|
-
isColumnFilterable(colIndex: number): boolean;
|
|
1147
|
-
getDistinctValuesForColumn(colId: string, maxValues?: number): CellValue[];
|
|
1148
|
-
openFilterPopup(colIndex: number, anchorRect: {
|
|
1149
|
-
top: number;
|
|
1150
|
-
left: number;
|
|
1151
|
-
width: number;
|
|
1152
|
-
height: number;
|
|
1153
|
-
}): void;
|
|
1154
|
-
closeFilterPopup(): void;
|
|
1155
|
-
getSortModel(): SortModel[];
|
|
1156
|
-
getFilterModel(): FilterModel;
|
|
1157
|
-
startEdit(row: number, col: number): void;
|
|
1158
|
-
updateEditValue(value: CellValue): void;
|
|
1159
|
-
commitEdit(): void;
|
|
1160
|
-
cancelEdit(): void;
|
|
1161
|
-
getEditState(): EditState | null;
|
|
1162
|
-
getCellValue(row: number, col: number): CellValue;
|
|
1163
|
-
setCellValue(row: number, col: number, value: CellValue): void;
|
|
1164
|
-
private clearSelectionIfInvalid;
|
|
1165
|
-
private computeColumnPositions;
|
|
1166
|
-
private emitContentSize;
|
|
1167
|
-
private emitHeaders;
|
|
1168
|
-
getColumns(): ColumnDefinition[];
|
|
1169
|
-
getColumnPositions(): number[];
|
|
1170
|
-
getRowCount(): number;
|
|
1171
|
-
getRowHeight(): number;
|
|
1172
|
-
getHeaderHeight(): number;
|
|
1173
|
-
getTotalWidth(): number;
|
|
1174
|
-
getTotalHeight(): number;
|
|
1175
|
-
/**
|
|
1176
|
-
* Check if scroll scaling is active (large datasets exceeding browser scroll limits).
|
|
1177
|
-
* When scaling is active, scrollRatio < 1 and scroll positions are compressed.
|
|
1178
|
-
*/
|
|
1179
|
-
isScalingActive(): boolean;
|
|
1180
|
-
/**
|
|
1181
|
-
* Get the natural (uncapped) content height.
|
|
1182
|
-
* Useful for debugging or displaying actual content size.
|
|
1183
|
-
*/
|
|
1184
|
-
getNaturalHeight(): number;
|
|
1185
|
-
/**
|
|
1186
|
-
* Get the scroll ratio used for scroll virtualization.
|
|
1187
|
-
* Returns 1 when no virtualization is needed, < 1 when content exceeds browser limits.
|
|
1188
|
-
*/
|
|
1189
|
-
getScrollRatio(): number;
|
|
1190
|
-
/**
|
|
1191
|
-
* Get the visible row range (excluding overscan).
|
|
1192
|
-
* Returns the first and last row indices that are actually visible in the viewport.
|
|
1193
|
-
* Includes partially visible rows to avoid false positives when clicking on edge rows.
|
|
1194
|
-
*/
|
|
1195
|
-
getVisibleRowRange(): {
|
|
1196
|
-
start: number;
|
|
1197
|
-
end: number;
|
|
1198
|
-
};
|
|
1199
|
-
/**
|
|
1200
|
-
* Get the scroll position needed to bring a row into view.
|
|
1201
|
-
* Accounts for scroll scaling when active.
|
|
1202
|
-
*/
|
|
1203
|
-
getScrollTopForRow(rowIndex: number): number;
|
|
1204
|
-
/**
|
|
1205
|
-
* Get the row index at a given viewport Y position.
|
|
1206
|
-
* Accounts for scroll scaling when active.
|
|
1207
|
-
* @param viewportY Y position in viewport (physical pixels below header, NOT including scroll)
|
|
1208
|
-
* @param virtualScrollTop Current scroll position from container.scrollTop (virtual/scaled)
|
|
1209
|
-
*/
|
|
1210
|
-
getRowIndexAtDisplayY(viewportY: number, virtualScrollTop: number): number;
|
|
1211
|
-
getRowData(rowIndex: number): TData | undefined;
|
|
1212
|
-
/**
|
|
1213
|
-
* Refresh data from the data source.
|
|
1214
|
-
*/
|
|
1215
|
-
refresh(): Promise<void>;
|
|
1216
|
-
/**
|
|
1217
|
-
* Fast-path refresh for transaction-based mutations.
|
|
1218
|
-
* Only re-fetches the visible window instead of all rows.
|
|
1219
|
-
* Use this when data was mutated via MutableDataSource transactions.
|
|
1220
|
-
*/
|
|
1221
|
-
refreshFromTransaction(): Promise<void>;
|
|
1222
|
-
/**
|
|
1223
|
-
* Refresh slot display without refetching data.
|
|
1224
|
-
* Useful after in-place data modifications like fill operations.
|
|
1225
|
-
*/
|
|
1226
|
-
refreshSlotData(): void;
|
|
1227
|
-
/**
|
|
1228
|
-
* Add rows to the grid at the specified index.
|
|
1229
|
-
* If no index is provided, rows are added at the end.
|
|
1230
|
-
*/
|
|
1231
|
-
addRows(rows: TData[], index?: number): void;
|
|
1232
|
-
/**
|
|
1233
|
-
* Update existing rows with partial data.
|
|
1234
|
-
*/
|
|
1235
|
-
updateRows(updates: Array<{
|
|
1236
|
-
index: number;
|
|
1237
|
-
data: Partial<TData>;
|
|
1238
|
-
}>): void;
|
|
1239
|
-
/**
|
|
1240
|
-
* Delete rows at the specified indices.
|
|
1241
|
-
*/
|
|
1242
|
-
deleteRows(indices: number[]): void;
|
|
1243
|
-
/**
|
|
1244
|
-
* Get a row by index.
|
|
1245
|
-
*/
|
|
1246
|
-
getRow(index: number): TData | undefined;
|
|
1247
|
-
/**
|
|
1248
|
-
* Set a complete row at the specified index.
|
|
1249
|
-
* Use this for complete row replacement. For partial updates, use updateRows.
|
|
1250
|
-
*/
|
|
1251
|
-
setRow(index: number, data: TData): void;
|
|
1252
|
-
/**
|
|
1253
|
-
* Update the data source and refresh.
|
|
1254
|
-
* Preserves grid state (sort, filter, scroll position).
|
|
1255
|
-
* Cancels any active edit and clamps selection to valid range.
|
|
1256
|
-
*/
|
|
1257
|
-
setDataSource(dataSource: DataSource<TData>): Promise<void>;
|
|
1258
|
-
/**
|
|
1259
|
-
* Update columns and recompute layout.
|
|
1260
|
-
*/
|
|
1261
|
-
setColumns(columns: ColumnDefinition[]): void;
|
|
1262
|
-
/**
|
|
1263
|
-
* Destroy the grid core and release all references.
|
|
1264
|
-
* Call this before discarding the GridCore to ensure proper cleanup.
|
|
1265
|
-
* This method is idempotent - safe to call multiple times.
|
|
1266
|
-
*/
|
|
1267
|
-
destroy(): void;
|
|
1268
|
-
}
|
|
1269
|
-
//#endregion
|
|
1270
|
-
//#region ../core/src/sorting/parallel-sort-manager.d.ts
|
|
1271
|
-
interface ParallelSortOptions {
|
|
1272
|
-
/** Maximum number of workers (default: navigator.hardwareConcurrency || 4) */
|
|
1273
|
-
maxWorkers?: number;
|
|
1274
|
-
/** Threshold for parallel sorting (default: 400000) */
|
|
1275
|
-
parallelThreshold?: number;
|
|
1276
|
-
/** Minimum chunk size (default: 50000) */
|
|
1277
|
-
minChunkSize?: number;
|
|
1278
|
-
}
|
|
1279
|
-
//#endregion
|
|
1280
|
-
//#region ../core/src/data-source/client-data-source.d.ts
|
|
1281
|
-
interface ClientDataSourceOptions<TData> {
|
|
1282
|
-
/** Custom field accessor for nested properties */
|
|
1283
|
-
getFieldValue?: (row: TData, field: string) => CellValue;
|
|
1284
|
-
/** Use Web Worker for sorting large datasets (default: true) */
|
|
1285
|
-
useWorker?: boolean;
|
|
1286
|
-
/** Options for parallel sorting (only used when useWorker is true) */
|
|
1287
|
-
parallelSort?: ParallelSortOptions | false;
|
|
1288
|
-
}
|
|
1289
|
-
/**
|
|
1290
|
-
* Creates a client-side data source that holds all data in memory.
|
|
1291
|
-
* Sorting and filtering are performed client-side.
|
|
1292
|
-
* For large datasets, sorting is automatically offloaded to a Web Worker.
|
|
1293
|
-
*/
|
|
1294
|
-
declare function createClientDataSource<TData extends Row = Row>(data: TData[], options?: ClientDataSourceOptions<TData>): DataSource<TData>;
|
|
1295
|
-
/**
|
|
1296
|
-
* Convenience function to create a data source from an array.
|
|
1297
|
-
* This provides backwards compatibility with the old `rowData` prop.
|
|
1298
|
-
*/
|
|
1299
|
-
declare function createDataSourceFromArray<TData extends Row = Row>(data: TData[]): DataSource<TData>;
|
|
1300
|
-
//#endregion
|
|
1301
|
-
//#region ../core/src/data-source/server-data-source.d.ts
|
|
1302
|
-
type ServerFetchFunction<TData> = (request: DataSourceRequest) => Promise<DataSourceResponse<TData>>;
|
|
1303
|
-
/**
|
|
1304
|
-
* Creates a server-side data source that delegates all operations to the server.
|
|
1305
|
-
* The fetch function receives sort/filter/pagination params to pass to the API.
|
|
1306
|
-
*/
|
|
1307
|
-
declare function createServerDataSource<TData extends Row = Row>(fetchFn: ServerFetchFunction<TData>): DataSource<TData>;
|
|
1308
|
-
//#endregion
|
|
1309
|
-
//#region ../core/src/transaction-manager.d.ts
|
|
1310
|
-
interface TransactionResult {
|
|
1311
|
-
added: number;
|
|
1312
|
-
removed: number;
|
|
1313
|
-
updated: number;
|
|
1314
|
-
}
|
|
1315
|
-
//#endregion
|
|
1316
|
-
//#region ../core/src/data-source/mutable-data-source.d.ts
|
|
1317
|
-
/** Callback for data change notifications */
|
|
1318
|
-
type DataChangeListener = (result: TransactionResult) => void;
|
|
1319
|
-
/**
|
|
1320
|
-
* Data source with mutation capabilities.
|
|
1321
|
-
* Extends DataSource with add, remove, and update operations.
|
|
1322
|
-
*/
|
|
1323
|
-
interface MutableDataSource<TData = Row> extends DataSource<TData> {
|
|
1324
|
-
/** Add rows to the data source. Queued and processed after debounce. */
|
|
1325
|
-
addRows(rows: TData[]): void;
|
|
1326
|
-
/** Remove rows by ID. Queued and processed after debounce. */
|
|
1327
|
-
removeRows(ids: RowId[]): void;
|
|
1328
|
-
/** Update a cell value. Queued and processed after debounce. */
|
|
1329
|
-
updateCell(id: RowId, field: string, value: CellValue): void;
|
|
1330
|
-
/** Update multiple fields on a row. Queued and processed after debounce. */
|
|
1331
|
-
updateRow(id: RowId, data: Partial<TData>): void;
|
|
1332
|
-
/** Force immediate processing of queued transactions. */
|
|
1333
|
-
flushTransactions(): Promise<void>;
|
|
1334
|
-
/** Check if there are pending transactions. */
|
|
1335
|
-
hasPendingTransactions(): boolean;
|
|
1336
|
-
/** Get distinct values for a field (for filter UI). */
|
|
1337
|
-
getDistinctValues(field: string): CellValue[];
|
|
1338
|
-
/** Get a row by ID. */
|
|
1339
|
-
getRowById(id: RowId): TData | undefined;
|
|
1340
|
-
/** Get total row count. */
|
|
1341
|
-
getTotalRowCount(): number;
|
|
1342
|
-
/** Subscribe to data change notifications. Returns unsubscribe function. */
|
|
1343
|
-
subscribe(listener: DataChangeListener): () => void;
|
|
1344
|
-
/** Clear all data from the data source. */
|
|
1345
|
-
clear(): void;
|
|
1346
|
-
}
|
|
1347
|
-
interface MutableClientDataSourceOptions<TData> {
|
|
1348
|
-
/** Function to extract unique ID from row. Required. */
|
|
1349
|
-
getRowId: (row: TData) => RowId;
|
|
1350
|
-
/** Custom field accessor for nested properties. */
|
|
1351
|
-
getFieldValue?: (row: TData, field: string) => CellValue;
|
|
1352
|
-
/** Debounce time for transactions in ms. Default 50. Set to 0 for sync. */
|
|
1353
|
-
debounceMs?: number;
|
|
1354
|
-
/** Callback when transactions are processed. */
|
|
1355
|
-
onTransactionProcessed?: (result: TransactionResult) => void;
|
|
1356
|
-
/** Use Web Worker for sorting large datasets (default: true) */
|
|
1357
|
-
useWorker?: boolean;
|
|
1358
|
-
/** Options for parallel sorting (only used when useWorker is true) */
|
|
1359
|
-
parallelSort?: ParallelSortOptions | false;
|
|
1360
|
-
}
|
|
1361
|
-
/**
|
|
1362
|
-
* Creates a mutable client-side data source with transaction support.
|
|
1363
|
-
* Uses IndexedDataStore for efficient incremental operations.
|
|
1364
|
-
* For large datasets, sorting is automatically offloaded to a Web Worker.
|
|
1365
|
-
*/
|
|
1366
|
-
declare function createMutableClientDataSource<TData extends Row = Row>(data: TData[], options: MutableClientDataSourceOptions<TData>): MutableDataSource<TData>;
|
|
1367
|
-
//#endregion
|
|
1368
|
-
//#region ../core/src/styles/index.d.ts
|
|
1369
|
-
/**
|
|
1370
|
-
* Combined grid styles from all modules
|
|
1371
|
-
*/
|
|
1372
|
-
declare const gridStyles: string;
|
|
1373
|
-
/**
|
|
1374
|
-
* Inject grid styles into the document head.
|
|
1375
|
-
* This is called automatically when the Grid component mounts.
|
|
1376
|
-
* Styles are only injected once, even if multiple Grid instances exist.
|
|
1377
|
-
*/
|
|
1378
|
-
declare function injectStyles(): void;
|
|
1379
|
-
//#endregion
|
|
1380
|
-
//#region ../core/src/types/ui-state.d.ts
|
|
1381
|
-
interface SlotData<TData = Row> {
|
|
1382
|
-
slotId: string;
|
|
1383
|
-
rowIndex: number;
|
|
1384
|
-
rowData: TData;
|
|
1385
|
-
translateY: number;
|
|
1386
|
-
}
|
|
1387
|
-
interface HeaderData {
|
|
1388
|
-
column: ColumnDefinition;
|
|
1389
|
-
sortDirection?: SortDirection;
|
|
1390
|
-
sortIndex?: number;
|
|
1391
|
-
sortable: boolean;
|
|
1392
|
-
filterable: boolean;
|
|
1393
|
-
hasFilter: boolean;
|
|
1394
|
-
}
|
|
1395
|
-
interface FilterPopupState {
|
|
1396
|
-
isOpen: boolean;
|
|
1397
|
-
colIndex: number;
|
|
1398
|
-
column: ColumnDefinition | null;
|
|
1399
|
-
anchorRect: {
|
|
1400
|
-
top: number;
|
|
1401
|
-
left: number;
|
|
1402
|
-
width: number;
|
|
1403
|
-
height: number;
|
|
1404
|
-
} | null;
|
|
1405
|
-
distinctValues: CellValue[];
|
|
1406
|
-
currentFilter?: ColumnFilterModel;
|
|
1407
|
-
}
|
|
1408
|
-
interface GridState<TData = Row> {
|
|
1409
|
-
slots: Map<string, SlotData<TData>>;
|
|
1410
|
-
activeCell: CellPosition | null;
|
|
1411
|
-
selectionRange: CellRange | null;
|
|
1412
|
-
editingCell: {
|
|
1413
|
-
row: number;
|
|
1414
|
-
col: number;
|
|
1415
|
-
initialValue: CellValue;
|
|
1416
|
-
} | null;
|
|
1417
|
-
contentWidth: number;
|
|
1418
|
-
contentHeight: number;
|
|
1419
|
-
/** Viewport width (container's visible width) for column scaling */
|
|
1420
|
-
viewportWidth: number;
|
|
1421
|
-
headers: Map<number, HeaderData>;
|
|
1422
|
-
filterPopup: FilterPopupState | null;
|
|
1423
|
-
isLoading: boolean;
|
|
1424
|
-
error: string | null;
|
|
1425
|
-
totalRows: number;
|
|
1426
|
-
/** Visible row range (start inclusive, end inclusive). Used to prevent selection showing in overscan. */
|
|
1427
|
-
visibleRowRange: {
|
|
1428
|
-
start: number;
|
|
1429
|
-
end: number;
|
|
1430
|
-
} | null;
|
|
1431
|
-
/** Currently hovered cell position (for highlighting) */
|
|
1432
|
-
hoverPosition: CellPosition | null;
|
|
1433
|
-
}
|
|
1434
|
-
//#endregion
|
|
1435
6
|
//#region src/types.d.ts
|
|
1436
7
|
/**
|
|
1437
8
|
* Vue cell renderer - can return a VNode or a string
|
|
1438
9
|
*/
|
|
1439
|
-
type VueCellRenderer<TData extends Row = Row> = (params: CellRendererParams<TData>) => VNode | string | null;
|
|
10
|
+
type VueCellRenderer<TData extends Row$1 = Row$1> = (params: CellRendererParams$1<TData>) => VNode | string | null;
|
|
1440
11
|
/**
|
|
1441
12
|
* Vue edit renderer - returns a VNode for the edit input
|
|
1442
13
|
*/
|
|
1443
|
-
type VueEditRenderer<TData extends Row = Row> = (params: EditRendererParams<TData>) => VNode | null;
|
|
14
|
+
type VueEditRenderer<TData extends Row$1 = Row$1> = (params: EditRendererParams$1<TData>) => VNode | null;
|
|
1444
15
|
/**
|
|
1445
16
|
* Vue header renderer - returns a VNode for the header content
|
|
1446
17
|
*/
|
|
1447
|
-
type VueHeaderRenderer = (params: HeaderRendererParams) => VNode | string | null;
|
|
1448
|
-
interface GpGridProps<TData extends Row = Row> {
|
|
1449
|
-
columns: ColumnDefinition[];
|
|
1450
|
-
dataSource?: DataSource<TData>;
|
|
18
|
+
type VueHeaderRenderer = (params: HeaderRendererParams$1) => VNode | string | null;
|
|
19
|
+
interface GpGridProps<TData extends Row$1 = Row$1> {
|
|
20
|
+
columns: ColumnDefinition$1[];
|
|
21
|
+
dataSource?: DataSource$1<TData>;
|
|
1451
22
|
rowData?: TData[];
|
|
1452
23
|
rowHeight: number;
|
|
1453
24
|
headerHeight?: number;
|
|
@@ -1462,9 +33,9 @@ interface GpGridProps<TData extends Row = Row> {
|
|
|
1462
33
|
editRenderer?: VueEditRenderer<TData> | Component$1;
|
|
1463
34
|
headerRenderer?: VueHeaderRenderer | Component$1;
|
|
1464
35
|
/** Function to extract unique ID from row. Required when onCellValueChanged is provided. */
|
|
1465
|
-
getRowId?: (row: TData) => RowId;
|
|
36
|
+
getRowId?: (row: TData) => RowId$1;
|
|
1466
37
|
/** Called when a cell value is changed via editing or fill drag. Requires getRowId. */
|
|
1467
|
-
onCellValueChanged?: (event: CellValueChangedEvent<TData>) => void;
|
|
38
|
+
onCellValueChanged?: (event: CellValueChangedEvent$1<TData>) => void;
|
|
1468
39
|
/** Custom loading component to render instead of default spinner */
|
|
1469
40
|
loadingComponent?: Component$1<{
|
|
1470
41
|
isLoading: boolean;
|
|
@@ -1473,9 +44,9 @@ interface GpGridProps<TData extends Row = Row> {
|
|
|
1473
44
|
//#endregion
|
|
1474
45
|
//#region src/GpGrid.vue.d.ts
|
|
1475
46
|
type __VLS_Props = {
|
|
1476
|
-
columns: ColumnDefinition[];
|
|
1477
|
-
dataSource?: DataSource<Row>;
|
|
1478
|
-
rowData?: Row[];
|
|
47
|
+
columns: ColumnDefinition$1[];
|
|
48
|
+
dataSource?: DataSource$1<Row$1>;
|
|
49
|
+
rowData?: Row$1[];
|
|
1479
50
|
rowHeight: number;
|
|
1480
51
|
headerHeight?: number;
|
|
1481
52
|
overscan?: number;
|
|
@@ -1487,25 +58,19 @@ type __VLS_Props = {
|
|
|
1487
58
|
headerRenderers?: Record<string, VueHeaderRenderer>;
|
|
1488
59
|
cellRenderer?: VueCellRenderer;
|
|
1489
60
|
editRenderer?: VueEditRenderer;
|
|
1490
|
-
headerRenderer?: VueHeaderRenderer;
|
|
1491
|
-
/** Initial viewport
|
|
1492
|
-
|
|
1493
|
-
/**
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
highlighting?: HighlightingOptions<Row>;
|
|
1497
|
-
/** Function to extract unique ID from row. Required when onCellValueChanged is provided. */
|
|
1498
|
-
getRowId?: (row: Row) => RowId;
|
|
1499
|
-
/** Called when a cell value is changed via editing or fill drag. Requires getRowId. */
|
|
1500
|
-
onCellValueChanged?: (event: CellValueChangedEvent<Row>) => void;
|
|
1501
|
-
/** Custom loading component to render instead of default spinner */
|
|
61
|
+
headerRenderer?: VueHeaderRenderer; /** Initial viewport width for SSR (pixels). ResizeObserver takes over on client. */
|
|
62
|
+
initialWidth?: number; /** Initial viewport height for SSR (pixels). ResizeObserver takes over on client. */
|
|
63
|
+
initialHeight?: number; /** Row/column/cell highlighting configuration */
|
|
64
|
+
highlighting?: HighlightingOptions<Row$1>; /** Function to extract unique ID from row. Required when onCellValueChanged is provided. */
|
|
65
|
+
getRowId?: (row: Row$1) => RowId$1; /** Called when a cell value is changed via editing or fill drag. Requires getRowId. */
|
|
66
|
+
onCellValueChanged?: (event: CellValueChangedEvent$1<Row$1>) => void; /** Custom loading component to render instead of default spinner */
|
|
1502
67
|
loadingComponent?: Component<{
|
|
1503
68
|
isLoading: boolean;
|
|
1504
69
|
}>;
|
|
1505
70
|
};
|
|
1506
|
-
declare const __VLS_export:
|
|
1507
|
-
core:
|
|
1508
|
-
}, {}, {}, {},
|
|
71
|
+
declare const __VLS_export: vue.DefineComponent<__VLS_Props, {
|
|
72
|
+
core: vue.ShallowRef<GridCore$1<unknown> | null, GridCore$1<unknown> | null>;
|
|
73
|
+
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
1509
74
|
overscan: number;
|
|
1510
75
|
sortingEnabled: boolean;
|
|
1511
76
|
darkMode: boolean;
|
|
@@ -1513,13 +78,13 @@ declare const __VLS_export: vue0.DefineComponent<__VLS_Props, {
|
|
|
1513
78
|
cellRenderers: Record<string, VueCellRenderer>;
|
|
1514
79
|
editRenderers: Record<string, VueEditRenderer>;
|
|
1515
80
|
headerRenderers: Record<string, VueHeaderRenderer>;
|
|
1516
|
-
}, {}, {}, {}, string,
|
|
81
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
1517
82
|
declare const _default: typeof __VLS_export;
|
|
1518
83
|
//#endregion
|
|
1519
84
|
//#region src/composables/useGpGrid.d.ts
|
|
1520
|
-
interface UseGpGridOptions<TData extends Row = Row> {
|
|
1521
|
-
columns: ColumnDefinition[];
|
|
1522
|
-
dataSource?: DataSource<TData>;
|
|
85
|
+
interface UseGpGridOptions<TData extends Row$1 = Row$1> {
|
|
86
|
+
columns: ColumnDefinition$1[];
|
|
87
|
+
dataSource?: DataSource$1<TData>;
|
|
1523
88
|
rowData?: TData[];
|
|
1524
89
|
rowHeight: number;
|
|
1525
90
|
headerHeight?: number;
|
|
@@ -1529,9 +94,9 @@ interface UseGpGridOptions<TData extends Row = Row> {
|
|
|
1529
94
|
wheelDampening?: number;
|
|
1530
95
|
highlighting?: HighlightingOptions<TData>;
|
|
1531
96
|
/** Function to extract unique ID from row. Required when onCellValueChanged is provided. */
|
|
1532
|
-
getRowId?: (row: TData) => RowId;
|
|
97
|
+
getRowId?: (row: TData) => RowId$1;
|
|
1533
98
|
/** Called when a cell value is changed via editing or fill drag. Requires getRowId. */
|
|
1534
|
-
onCellValueChanged?: (event: CellValueChangedEvent<TData>) => void;
|
|
99
|
+
onCellValueChanged?: (event: CellValueChangedEvent$1<TData>) => void;
|
|
1535
100
|
cellRenderers?: Record<string, VueCellRenderer<TData>>;
|
|
1536
101
|
editRenderers?: Record<string, VueEditRenderer<TData>>;
|
|
1537
102
|
headerRenderers?: Record<string, VueHeaderRenderer>;
|
|
@@ -1539,11 +104,11 @@ interface UseGpGridOptions<TData extends Row = Row> {
|
|
|
1539
104
|
editRenderer?: VueEditRenderer<TData>;
|
|
1540
105
|
headerRenderer?: VueHeaderRenderer;
|
|
1541
106
|
}
|
|
1542
|
-
interface UseGpGridResult<TData extends Row = Row> {
|
|
107
|
+
interface UseGpGridResult<TData extends Row$1 = Row$1> {
|
|
1543
108
|
containerRef: Ref<HTMLDivElement | null>;
|
|
1544
|
-
coreRef: Ref<GridCore<TData> | null>;
|
|
1545
|
-
state: GridState;
|
|
1546
|
-
slotsArray: ComputedRef<SlotData[]>;
|
|
109
|
+
coreRef: Ref<GridCore$1<TData> | null>;
|
|
110
|
+
state: GridState$1;
|
|
111
|
+
slotsArray: ComputedRef<SlotData$1[]>;
|
|
1547
112
|
totalHeaderHeight: ComputedRef<number>;
|
|
1548
113
|
columnPositions: ComputedRef<number[]>;
|
|
1549
114
|
columnWidths: ComputedRef<number[]>;
|
|
@@ -1559,7 +124,7 @@ interface UseGpGridResult<TData extends Row = Row> {
|
|
|
1559
124
|
handleHeaderClick: (colIndex: number, e: MouseEvent) => void;
|
|
1560
125
|
handleKeyDown: (e: KeyboardEvent) => void;
|
|
1561
126
|
handleWheel: (e: WheelEvent, wheelDampening: number) => void;
|
|
1562
|
-
handleFilterApply: (colId: string, filter: ColumnFilterModel | null) => void;
|
|
127
|
+
handleFilterApply: (colId: string, filter: ColumnFilterModel$1 | null) => void;
|
|
1563
128
|
handleFilterPopupClose: () => void;
|
|
1564
129
|
handleCellMouseEnter: (rowIndex: number, colIndex: number) => void;
|
|
1565
130
|
handleCellMouseLeave: () => void;
|
|
@@ -1577,22 +142,22 @@ interface UseGpGridResult<TData extends Row = Row> {
|
|
|
1577
142
|
col: number;
|
|
1578
143
|
} | null;
|
|
1579
144
|
}>;
|
|
1580
|
-
isCellSelected: typeof isCellSelected;
|
|
1581
|
-
isCellActive: typeof isCellActive;
|
|
1582
|
-
isCellEditing: typeof isCellEditing;
|
|
1583
|
-
isCellInFillPreview: typeof isCellInFillPreview;
|
|
1584
|
-
buildCellClasses: typeof buildCellClasses;
|
|
145
|
+
isCellSelected: typeof isCellSelected$1;
|
|
146
|
+
isCellActive: typeof isCellActive$1;
|
|
147
|
+
isCellEditing: typeof isCellEditing$1;
|
|
148
|
+
isCellInFillPreview: typeof isCellInFillPreview$1;
|
|
149
|
+
buildCellClasses: typeof buildCellClasses$1;
|
|
1585
150
|
}
|
|
1586
151
|
/**
|
|
1587
152
|
* Nuxt-friendly composable for using gp-grid.
|
|
1588
153
|
* Returns all the pieces needed to build a custom grid component.
|
|
1589
154
|
*/
|
|
1590
|
-
declare function useGpGrid<TData extends Row = Row>(options: UseGpGridOptions<TData>): UseGpGridResult<TData>;
|
|
155
|
+
declare function useGpGrid<TData extends Row$1 = Row$1>(options: UseGpGridOptions<TData>): UseGpGridResult<TData>;
|
|
1591
156
|
//#endregion
|
|
1592
157
|
//#region src/composables/useGridData.d.ts
|
|
1593
158
|
interface UseGridDataOptions<TData> {
|
|
1594
159
|
/** Function to extract a unique ID from each row. Required. */
|
|
1595
|
-
getRowId: (row: TData) => RowId;
|
|
160
|
+
getRowId: (row: TData) => RowId$1;
|
|
1596
161
|
/** Debounce time for batching transactions in ms. Default 50. */
|
|
1597
162
|
debounceMs?: number;
|
|
1598
163
|
/** Use Web Worker for sorting large datasets (default: true) */
|
|
@@ -1602,19 +167,19 @@ interface UseGridDataOptions<TData> {
|
|
|
1602
167
|
}
|
|
1603
168
|
interface UseGridDataResult<TData> {
|
|
1604
169
|
/** The data source to pass to <GpGrid :data-source="dataSource" />. */
|
|
1605
|
-
dataSource: MutableDataSource<TData>;
|
|
170
|
+
dataSource: MutableDataSource$1<TData>;
|
|
1606
171
|
/** Update a single row by ID with partial data. */
|
|
1607
|
-
updateRow: (id: RowId, data: Partial<TData>) => void;
|
|
172
|
+
updateRow: (id: RowId$1, data: Partial<TData>) => void;
|
|
1608
173
|
/** Add rows to the data source. */
|
|
1609
174
|
addRows: (rows: TData[]) => void;
|
|
1610
175
|
/** Remove rows by ID. */
|
|
1611
|
-
removeRows: (ids: RowId[]) => void;
|
|
176
|
+
removeRows: (ids: RowId$1[]) => void;
|
|
1612
177
|
/** Update a single cell value. */
|
|
1613
|
-
updateCell: (id: RowId, field: string, value: CellValue) => void;
|
|
178
|
+
updateCell: (id: RowId$1, field: string, value: CellValue$1) => void;
|
|
1614
179
|
/** Clear all data from the data source. */
|
|
1615
180
|
clear: () => void;
|
|
1616
181
|
/** Get a row by its ID. */
|
|
1617
|
-
getRowById: (id: RowId) => TData | undefined;
|
|
182
|
+
getRowById: (id: RowId$1) => TData | undefined;
|
|
1618
183
|
/** Get the current total row count. */
|
|
1619
184
|
getTotalRowCount: () => number;
|
|
1620
185
|
/** Force immediate processing of queued transactions. */
|
|
@@ -1639,16 +204,16 @@ interface UseGridDataResult<TData> {
|
|
|
1639
204
|
* </template>
|
|
1640
205
|
* ```
|
|
1641
206
|
*/
|
|
1642
|
-
declare const useGridData: <TData extends Row = Row>(initialData: TData[], options: UseGridDataOptions<TData>) => UseGridDataResult<TData>;
|
|
207
|
+
declare const useGridData: <TData extends Row$1 = Row$1>(initialData: TData[], options: UseGridDataOptions<TData>) => UseGridDataResult<TData>;
|
|
1643
208
|
//#endregion
|
|
1644
209
|
//#region src/composables/useInputHandler.d.ts
|
|
1645
210
|
interface VisibleColumnInfo$1 {
|
|
1646
|
-
column: ColumnDefinition;
|
|
211
|
+
column: ColumnDefinition$1;
|
|
1647
212
|
originalIndex: number;
|
|
1648
213
|
}
|
|
1649
214
|
interface UseInputHandlerOptions {
|
|
1650
|
-
activeCell: ComputedRef<CellPosition | null>;
|
|
1651
|
-
selectionRange: ComputedRef<CellRange | null>;
|
|
215
|
+
activeCell: ComputedRef<CellPosition$1 | null>;
|
|
216
|
+
selectionRange: ComputedRef<CellRange$1 | null>;
|
|
1652
217
|
editingCell: ComputedRef<{
|
|
1653
218
|
row: number;
|
|
1654
219
|
col: number;
|
|
@@ -1659,7 +224,7 @@ interface UseInputHandlerOptions {
|
|
|
1659
224
|
columnPositions: ComputedRef<number[]>;
|
|
1660
225
|
/** Visible columns with their original indices (for hidden column support) */
|
|
1661
226
|
visibleColumnsWithIndices: ComputedRef<VisibleColumnInfo$1[]>;
|
|
1662
|
-
slots: ComputedRef<Map<string, SlotData>>;
|
|
227
|
+
slots: ComputedRef<Map<string, SlotData$1>>;
|
|
1663
228
|
}
|
|
1664
229
|
interface UseInputHandlerResult {
|
|
1665
230
|
handleCellMouseDown: (rowIndex: number, colIndex: number, e: MouseEvent) => void;
|
|
@@ -1668,12 +233,12 @@ interface UseInputHandlerResult {
|
|
|
1668
233
|
handleHeaderClick: (colIndex: number, e: MouseEvent) => void;
|
|
1669
234
|
handleKeyDown: (e: KeyboardEvent) => void;
|
|
1670
235
|
handleWheel: (e: WheelEvent, wheelDampening: number) => void;
|
|
1671
|
-
dragState: Ref<DragState>;
|
|
236
|
+
dragState: Ref<DragState$1>;
|
|
1672
237
|
}
|
|
1673
238
|
/**
|
|
1674
239
|
* Vue composable for handling all input interactions
|
|
1675
240
|
*/
|
|
1676
|
-
declare function useInputHandler<TData extends Row = Row>(coreRef: ShallowRef<GridCore<TData> | null>, containerRef: Ref<HTMLDivElement | null>, columns: ComputedRef<ColumnDefinition[]>, options: UseInputHandlerOptions): UseInputHandlerResult;
|
|
241
|
+
declare function useInputHandler<TData extends Row$1 = Row$1>(coreRef: ShallowRef<GridCore$1<TData> | null>, containerRef: Ref<HTMLDivElement | null>, columns: ComputedRef<ColumnDefinition$1[]>, options: UseInputHandlerOptions): UseInputHandlerResult;
|
|
1677
242
|
//#endregion
|
|
1678
243
|
//#region src/composables/useAutoScroll.d.ts
|
|
1679
244
|
/**
|
|
@@ -1686,14 +251,14 @@ declare function useAutoScroll(containerRef: Ref<HTMLDivElement | null>): {
|
|
|
1686
251
|
//#endregion
|
|
1687
252
|
//#region src/composables/useFillHandle.d.ts
|
|
1688
253
|
interface VisibleColumnInfo {
|
|
1689
|
-
column: ColumnDefinition;
|
|
254
|
+
column: ColumnDefinition$1;
|
|
1690
255
|
originalIndex: number;
|
|
1691
256
|
}
|
|
1692
257
|
interface UseFillHandleOptions {
|
|
1693
|
-
activeCell: ComputedRef<CellPosition | null>;
|
|
1694
|
-
selectionRange: ComputedRef<CellRange | null>;
|
|
1695
|
-
slots: ComputedRef<Map<string, SlotData>>;
|
|
1696
|
-
columns: ComputedRef<ColumnDefinition[]>;
|
|
258
|
+
activeCell: ComputedRef<CellPosition$1 | null>;
|
|
259
|
+
selectionRange: ComputedRef<CellRange$1 | null>;
|
|
260
|
+
slots: ComputedRef<Map<string, SlotData$1>>;
|
|
261
|
+
columns: ComputedRef<ColumnDefinition$1[]>;
|
|
1697
262
|
visibleColumnsWithIndices: ComputedRef<VisibleColumnInfo[]>;
|
|
1698
263
|
columnPositions: ComputedRef<number[]>;
|
|
1699
264
|
columnWidths: ComputedRef<number[]>;
|
|
@@ -1748,7 +313,7 @@ interface InitialStateArgs {
|
|
|
1748
313
|
initialWidth?: number;
|
|
1749
314
|
initialHeight?: number;
|
|
1750
315
|
}
|
|
1751
|
-
declare function createInitialState(args?: InitialStateArgs): GridState;
|
|
316
|
+
declare function createInitialState(args?: InitialStateArgs): GridState$1;
|
|
1752
317
|
/**
|
|
1753
318
|
* Vue composable for managing grid state
|
|
1754
319
|
*/
|
|
@@ -1759,7 +324,7 @@ declare function useGridState(args?: InitialStateArgs): {
|
|
|
1759
324
|
rowIndex: number;
|
|
1760
325
|
rowData: unknown;
|
|
1761
326
|
translateY: number;
|
|
1762
|
-
}> & Omit<Map<string, SlotData<unknown>>, keyof Map<any, any>>;
|
|
327
|
+
}> & Omit<Map<string, SlotData$1<unknown>>, keyof Map<any, any>>;
|
|
1763
328
|
activeCell: {
|
|
1764
329
|
row: number;
|
|
1765
330
|
col: number;
|
|
@@ -1773,16 +338,18 @@ declare function useGridState(args?: InitialStateArgs): {
|
|
|
1773
338
|
editingCell: {
|
|
1774
339
|
row: number;
|
|
1775
340
|
col: number;
|
|
1776
|
-
initialValue: CellValue;
|
|
341
|
+
initialValue: _gp_grid_core0.CellValue;
|
|
1777
342
|
} | null;
|
|
1778
343
|
contentWidth: number;
|
|
1779
344
|
contentHeight: number;
|
|
1780
345
|
viewportWidth: number;
|
|
346
|
+
viewportHeight: number;
|
|
347
|
+
rowsWrapperOffset: number;
|
|
1781
348
|
headers: Map<number, {
|
|
1782
349
|
column: {
|
|
1783
350
|
field: string;
|
|
1784
351
|
colId?: string | undefined;
|
|
1785
|
-
cellDataType: CellDataType;
|
|
352
|
+
cellDataType: _gp_grid_core0.CellDataType;
|
|
1786
353
|
width: number;
|
|
1787
354
|
headerName?: string | undefined;
|
|
1788
355
|
editable?: boolean | undefined;
|
|
@@ -1792,22 +359,22 @@ declare function useGridState(args?: InitialStateArgs): {
|
|
|
1792
359
|
cellRenderer?: string | undefined;
|
|
1793
360
|
editRenderer?: string | undefined;
|
|
1794
361
|
headerRenderer?: string | undefined;
|
|
1795
|
-
computeColumnClasses?: ((context: HighlightContext) => string[]) | undefined;
|
|
1796
|
-
computeCellClasses?: ((context: HighlightContext) => string[]) | undefined;
|
|
362
|
+
computeColumnClasses?: ((context: _gp_grid_core0.HighlightContext) => string[]) | undefined;
|
|
363
|
+
computeCellClasses?: ((context: _gp_grid_core0.HighlightContext) => string[]) | undefined;
|
|
1797
364
|
};
|
|
1798
|
-
sortDirection?: SortDirection | undefined;
|
|
365
|
+
sortDirection?: _gp_grid_core0.SortDirection | undefined;
|
|
1799
366
|
sortIndex?: number | undefined;
|
|
1800
367
|
sortable: boolean;
|
|
1801
368
|
filterable: boolean;
|
|
1802
369
|
hasFilter: boolean;
|
|
1803
|
-
}> & Omit<Map<number, HeaderData>, keyof Map<any, any>>;
|
|
370
|
+
}> & Omit<Map<number, HeaderData$1>, keyof Map<any, any>>;
|
|
1804
371
|
filterPopup: {
|
|
1805
372
|
isOpen: boolean;
|
|
1806
373
|
colIndex: number;
|
|
1807
374
|
column: {
|
|
1808
375
|
field: string;
|
|
1809
376
|
colId?: string | undefined;
|
|
1810
|
-
cellDataType: CellDataType;
|
|
377
|
+
cellDataType: _gp_grid_core0.CellDataType;
|
|
1811
378
|
width: number;
|
|
1812
379
|
headerName?: string | undefined;
|
|
1813
380
|
editable?: boolean | undefined;
|
|
@@ -1817,8 +384,8 @@ declare function useGridState(args?: InitialStateArgs): {
|
|
|
1817
384
|
cellRenderer?: string | undefined;
|
|
1818
385
|
editRenderer?: string | undefined;
|
|
1819
386
|
headerRenderer?: string | undefined;
|
|
1820
|
-
computeColumnClasses?: ((context: HighlightContext) => string[]) | undefined;
|
|
1821
|
-
computeCellClasses?: ((context: HighlightContext) => string[]) | undefined;
|
|
387
|
+
computeColumnClasses?: ((context: _gp_grid_core0.HighlightContext) => string[]) | undefined;
|
|
388
|
+
computeCellClasses?: ((context: _gp_grid_core0.HighlightContext) => string[]) | undefined;
|
|
1822
389
|
} | null;
|
|
1823
390
|
anchorRect: {
|
|
1824
391
|
top: number;
|
|
@@ -1826,29 +393,29 @@ declare function useGridState(args?: InitialStateArgs): {
|
|
|
1826
393
|
width: number;
|
|
1827
394
|
height: number;
|
|
1828
395
|
} | null;
|
|
1829
|
-
distinctValues: CellValue[];
|
|
396
|
+
distinctValues: _gp_grid_core0.CellValue[];
|
|
1830
397
|
currentFilter?: {
|
|
1831
398
|
conditions: ({
|
|
1832
399
|
type: "text";
|
|
1833
|
-
operator: TextFilterOperator;
|
|
400
|
+
operator: _gp_grid_core0.TextFilterOperator;
|
|
1834
401
|
value?: string | undefined;
|
|
1835
402
|
selectedValues?: (Set<string> & Omit<Set<string>, keyof Set<any>>) | undefined;
|
|
1836
403
|
includeBlank?: boolean | undefined;
|
|
1837
|
-
nextOperator?: FilterCombination | undefined;
|
|
404
|
+
nextOperator?: _gp_grid_core0.FilterCombination | undefined;
|
|
1838
405
|
} | {
|
|
1839
406
|
type: "number";
|
|
1840
|
-
operator: NumberFilterOperator;
|
|
407
|
+
operator: _gp_grid_core0.NumberFilterOperator;
|
|
1841
408
|
value?: number | undefined;
|
|
1842
409
|
valueTo?: number | undefined;
|
|
1843
|
-
nextOperator?: FilterCombination | undefined;
|
|
410
|
+
nextOperator?: _gp_grid_core0.FilterCombination | undefined;
|
|
1844
411
|
} | {
|
|
1845
412
|
type: "date";
|
|
1846
|
-
operator: DateFilterOperator;
|
|
413
|
+
operator: _gp_grid_core0.DateFilterOperator;
|
|
1847
414
|
value?: (Date | string) | undefined;
|
|
1848
415
|
valueTo?: (Date | string) | undefined;
|
|
1849
|
-
nextOperator?: FilterCombination | undefined;
|
|
416
|
+
nextOperator?: _gp_grid_core0.FilterCombination | undefined;
|
|
1850
417
|
})[];
|
|
1851
|
-
combination: FilterCombination;
|
|
418
|
+
combination: _gp_grid_core0.FilterCombination;
|
|
1852
419
|
} | undefined;
|
|
1853
420
|
} | null;
|
|
1854
421
|
isLoading: boolean;
|
|
@@ -1863,7 +430,7 @@ declare function useGridState(args?: InitialStateArgs): {
|
|
|
1863
430
|
col: number;
|
|
1864
431
|
} | null;
|
|
1865
432
|
};
|
|
1866
|
-
applyInstructions: (instructions: GridInstruction[]) => void;
|
|
433
|
+
applyInstructions: (instructions: GridInstruction$1[]) => void;
|
|
1867
434
|
reset: () => void;
|
|
1868
435
|
};
|
|
1869
436
|
//#endregion
|
|
@@ -1871,10 +438,10 @@ declare function useGridState(args?: InitialStateArgs): {
|
|
|
1871
438
|
/**
|
|
1872
439
|
* Get cell value from row data, supporting dot-notation for nested fields
|
|
1873
440
|
*/
|
|
1874
|
-
declare function getCellValue(rowData: Row, field: string): CellValue;
|
|
441
|
+
declare function getCellValue(rowData: Row$1, field: string): CellValue$1;
|
|
1875
442
|
interface RenderCellOptions {
|
|
1876
|
-
column: ColumnDefinition;
|
|
1877
|
-
rowData: Row;
|
|
443
|
+
column: ColumnDefinition$1;
|
|
444
|
+
rowData: Row$1;
|
|
1878
445
|
rowIndex: number;
|
|
1879
446
|
colIndex: number;
|
|
1880
447
|
isActive: boolean;
|
|
@@ -1890,12 +457,12 @@ declare function renderCell(options: RenderCellOptions): VNode;
|
|
|
1890
457
|
//#endregion
|
|
1891
458
|
//#region src/renderers/editRenderer.d.ts
|
|
1892
459
|
interface RenderEditCellOptions {
|
|
1893
|
-
column: ColumnDefinition;
|
|
1894
|
-
rowData: Row;
|
|
460
|
+
column: ColumnDefinition$1;
|
|
461
|
+
rowData: Row$1;
|
|
1895
462
|
rowIndex: number;
|
|
1896
463
|
colIndex: number;
|
|
1897
|
-
initialValue: CellValue;
|
|
1898
|
-
core: GridCore | null;
|
|
464
|
+
initialValue: CellValue$1;
|
|
465
|
+
core: GridCore$1 | null;
|
|
1899
466
|
editRenderers: Record<string, VueEditRenderer>;
|
|
1900
467
|
globalEditRenderer?: VueEditRenderer;
|
|
1901
468
|
}
|
|
@@ -1906,14 +473,14 @@ declare function renderEditCell(options: RenderEditCellOptions): VNode;
|
|
|
1906
473
|
//#endregion
|
|
1907
474
|
//#region src/renderers/headerRenderer.d.ts
|
|
1908
475
|
interface RenderHeaderOptions {
|
|
1909
|
-
column: ColumnDefinition;
|
|
476
|
+
column: ColumnDefinition$1;
|
|
1910
477
|
colIndex: number;
|
|
1911
|
-
sortDirection?: SortDirection;
|
|
478
|
+
sortDirection?: SortDirection$1;
|
|
1912
479
|
sortIndex?: number;
|
|
1913
480
|
sortable: boolean;
|
|
1914
481
|
filterable: boolean;
|
|
1915
482
|
hasFilter: boolean;
|
|
1916
|
-
core: GridCore | null;
|
|
483
|
+
core: GridCore$1 | null;
|
|
1917
484
|
container: HTMLDivElement | null;
|
|
1918
485
|
headerRenderers: Record<string, VueHeaderRenderer>;
|
|
1919
486
|
globalHeaderRenderer?: VueHeaderRenderer;
|