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