gp-grid-vue 0.1.6
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 +1426 -0
- package/dist/index.js +1819 -0
- package/dist/index.js.map +1 -0
- package/package.json +55 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1426 @@
|
|
|
1
|
+
import * as vue0 from "vue";
|
|
2
|
+
import { Component, ComputedRef, Ref, ShallowRef, VNode } from "vue";
|
|
3
|
+
|
|
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/columns.d.ts
|
|
65
|
+
/** Column definition */
|
|
66
|
+
interface ColumnDefinition {
|
|
67
|
+
field: string;
|
|
68
|
+
colId?: string;
|
|
69
|
+
cellDataType: CellDataType;
|
|
70
|
+
width: number;
|
|
71
|
+
headerName?: string;
|
|
72
|
+
editable?: boolean;
|
|
73
|
+
/** Whether column is sortable. Default: true when sortingEnabled */
|
|
74
|
+
sortable?: boolean;
|
|
75
|
+
/** Whether column is filterable. Default: true */
|
|
76
|
+
filterable?: boolean;
|
|
77
|
+
/** Renderer key for adapter lookup, or inline renderer function */
|
|
78
|
+
cellRenderer?: string;
|
|
79
|
+
editRenderer?: string;
|
|
80
|
+
headerRenderer?: string;
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region ../core/src/types/filters.d.ts
|
|
84
|
+
/** Text filter operators */
|
|
85
|
+
type TextFilterOperator = "contains" | "notContains" | "equals" | "notEquals" | "startsWith" | "endsWith" | "blank" | "notBlank";
|
|
86
|
+
/** Number filter operators (symbols for display) */
|
|
87
|
+
type NumberFilterOperator = "=" | "!=" | ">" | "<" | ">=" | "<=" | "between" | "blank" | "notBlank";
|
|
88
|
+
/** Date filter operators */
|
|
89
|
+
type DateFilterOperator = "=" | "!=" | ">" | "<" | "between" | "blank" | "notBlank";
|
|
90
|
+
/** Filter combination mode */
|
|
91
|
+
type FilterCombination = "and" | "or";
|
|
92
|
+
/** Text filter condition */
|
|
93
|
+
interface TextFilterCondition {
|
|
94
|
+
type: "text";
|
|
95
|
+
operator: TextFilterOperator;
|
|
96
|
+
value?: string;
|
|
97
|
+
/** Selected distinct values for checkbox-style filtering */
|
|
98
|
+
selectedValues?: Set<string>;
|
|
99
|
+
/** Include blank values */
|
|
100
|
+
includeBlank?: boolean;
|
|
101
|
+
/** Operator connecting this condition to the next. Defaults to ColumnFilterModel.combination */
|
|
102
|
+
nextOperator?: FilterCombination;
|
|
103
|
+
}
|
|
104
|
+
/** Number filter condition */
|
|
105
|
+
interface NumberFilterCondition {
|
|
106
|
+
type: "number";
|
|
107
|
+
operator: NumberFilterOperator;
|
|
108
|
+
value?: number;
|
|
109
|
+
/** Second value for "between" operator */
|
|
110
|
+
valueTo?: number;
|
|
111
|
+
/** Operator connecting this condition to the next. Defaults to ColumnFilterModel.combination */
|
|
112
|
+
nextOperator?: FilterCombination;
|
|
113
|
+
}
|
|
114
|
+
/** Date filter condition */
|
|
115
|
+
interface DateFilterCondition {
|
|
116
|
+
type: "date";
|
|
117
|
+
operator: DateFilterOperator;
|
|
118
|
+
value?: Date | string;
|
|
119
|
+
/** Second value for "between" operator */
|
|
120
|
+
valueTo?: Date | string;
|
|
121
|
+
/** Operator connecting this condition to the next. Defaults to ColumnFilterModel.combination */
|
|
122
|
+
nextOperator?: FilterCombination;
|
|
123
|
+
}
|
|
124
|
+
/** Union of filter condition types */
|
|
125
|
+
type FilterCondition = TextFilterCondition | NumberFilterCondition | DateFilterCondition;
|
|
126
|
+
/** Column filter model with multiple conditions */
|
|
127
|
+
interface ColumnFilterModel {
|
|
128
|
+
conditions: FilterCondition[];
|
|
129
|
+
combination: FilterCombination;
|
|
130
|
+
}
|
|
131
|
+
/** Filter model type - maps column ID to filter */
|
|
132
|
+
type FilterModel = Record<string, ColumnFilterModel>;
|
|
133
|
+
//#endregion
|
|
134
|
+
//#region ../core/src/types/data-source.d.ts
|
|
135
|
+
/** Data source request */
|
|
136
|
+
interface DataSourceRequest {
|
|
137
|
+
/** Pagination */
|
|
138
|
+
pagination: {
|
|
139
|
+
/** Page index */
|
|
140
|
+
pageIndex: number;
|
|
141
|
+
/** Page size */
|
|
142
|
+
pageSize: number;
|
|
143
|
+
};
|
|
144
|
+
/** Sort */
|
|
145
|
+
sort?: SortModel[];
|
|
146
|
+
/** Filter */
|
|
147
|
+
filter?: FilterModel;
|
|
148
|
+
}
|
|
149
|
+
/** Data source response */
|
|
150
|
+
interface DataSourceResponse<TData = Row> {
|
|
151
|
+
/** Rows */
|
|
152
|
+
rows: TData[];
|
|
153
|
+
/** Total rows */
|
|
154
|
+
totalRows: number;
|
|
155
|
+
}
|
|
156
|
+
/** Data source interface */
|
|
157
|
+
interface DataSource<TData = Row> {
|
|
158
|
+
fetch(request: DataSourceRequest): Promise<DataSourceResponse<TData>>;
|
|
159
|
+
}
|
|
160
|
+
//#endregion
|
|
161
|
+
//#region ../core/src/types/instructions.d.ts
|
|
162
|
+
/** Create slot instruction */
|
|
163
|
+
interface CreateSlotInstruction {
|
|
164
|
+
type: "CREATE_SLOT";
|
|
165
|
+
slotId: string;
|
|
166
|
+
}
|
|
167
|
+
/** Destroy slot instruction */
|
|
168
|
+
interface DestroySlotInstruction {
|
|
169
|
+
type: "DESTROY_SLOT";
|
|
170
|
+
slotId: string;
|
|
171
|
+
}
|
|
172
|
+
/** Assign slot instruction */
|
|
173
|
+
interface AssignSlotInstruction {
|
|
174
|
+
type: "ASSIGN_SLOT";
|
|
175
|
+
slotId: string;
|
|
176
|
+
rowIndex: number;
|
|
177
|
+
rowData: Row;
|
|
178
|
+
}
|
|
179
|
+
/** Move slot instruction */
|
|
180
|
+
interface MoveSlotInstruction {
|
|
181
|
+
type: "MOVE_SLOT";
|
|
182
|
+
slotId: string;
|
|
183
|
+
translateY: number;
|
|
184
|
+
}
|
|
185
|
+
/** Set active cell instruction */
|
|
186
|
+
interface SetActiveCellInstruction {
|
|
187
|
+
type: "SET_ACTIVE_CELL";
|
|
188
|
+
position: CellPosition | null;
|
|
189
|
+
}
|
|
190
|
+
/** Set selection range instruction */
|
|
191
|
+
interface SetSelectionRangeInstruction {
|
|
192
|
+
type: "SET_SELECTION_RANGE";
|
|
193
|
+
range: CellRange | null;
|
|
194
|
+
}
|
|
195
|
+
/** Update visible range instruction - emitted when selection moves outside visible viewport */
|
|
196
|
+
interface UpdateVisibleRangeInstruction {
|
|
197
|
+
type: "UPDATE_VISIBLE_RANGE";
|
|
198
|
+
start: number;
|
|
199
|
+
end: number;
|
|
200
|
+
}
|
|
201
|
+
/** Start edit instruction */
|
|
202
|
+
interface StartEditInstruction {
|
|
203
|
+
type: "START_EDIT";
|
|
204
|
+
row: number;
|
|
205
|
+
col: number;
|
|
206
|
+
initialValue: CellValue;
|
|
207
|
+
}
|
|
208
|
+
/** Stop edit instruction */
|
|
209
|
+
interface StopEditInstruction {
|
|
210
|
+
type: "STOP_EDIT";
|
|
211
|
+
}
|
|
212
|
+
/** Commit edit instruction */
|
|
213
|
+
interface CommitEditInstruction {
|
|
214
|
+
type: "COMMIT_EDIT";
|
|
215
|
+
row: number;
|
|
216
|
+
col: number;
|
|
217
|
+
value: CellValue;
|
|
218
|
+
}
|
|
219
|
+
/** Set content size instruction */
|
|
220
|
+
interface SetContentSizeInstruction {
|
|
221
|
+
type: "SET_CONTENT_SIZE";
|
|
222
|
+
width: number;
|
|
223
|
+
height: number;
|
|
224
|
+
}
|
|
225
|
+
/** Update header instruction */
|
|
226
|
+
interface UpdateHeaderInstruction {
|
|
227
|
+
type: "UPDATE_HEADER";
|
|
228
|
+
colIndex: number;
|
|
229
|
+
column: ColumnDefinition;
|
|
230
|
+
sortDirection?: SortDirection;
|
|
231
|
+
sortIndex?: number;
|
|
232
|
+
/** Whether column is sortable */
|
|
233
|
+
sortable: boolean;
|
|
234
|
+
/** Whether column is filterable */
|
|
235
|
+
filterable: boolean;
|
|
236
|
+
/** Whether column has an active filter */
|
|
237
|
+
hasFilter: boolean;
|
|
238
|
+
}
|
|
239
|
+
/** Open filter popup instruction */
|
|
240
|
+
interface OpenFilterPopupInstruction {
|
|
241
|
+
type: "OPEN_FILTER_POPUP";
|
|
242
|
+
colIndex: number;
|
|
243
|
+
column: ColumnDefinition;
|
|
244
|
+
anchorRect: {
|
|
245
|
+
top: number;
|
|
246
|
+
left: number;
|
|
247
|
+
width: number;
|
|
248
|
+
height: number;
|
|
249
|
+
};
|
|
250
|
+
distinctValues: CellValue[];
|
|
251
|
+
currentFilter?: ColumnFilterModel;
|
|
252
|
+
}
|
|
253
|
+
/** Close filter popup instruction */
|
|
254
|
+
interface CloseFilterPopupInstruction {
|
|
255
|
+
type: "CLOSE_FILTER_POPUP";
|
|
256
|
+
}
|
|
257
|
+
/** Start fill instruction */
|
|
258
|
+
interface StartFillInstruction {
|
|
259
|
+
type: "START_FILL";
|
|
260
|
+
sourceRange: CellRange;
|
|
261
|
+
}
|
|
262
|
+
/** Update fill instruction */
|
|
263
|
+
interface UpdateFillInstruction {
|
|
264
|
+
type: "UPDATE_FILL";
|
|
265
|
+
targetRow: number;
|
|
266
|
+
targetCol: number;
|
|
267
|
+
}
|
|
268
|
+
/** Commit fill instruction */
|
|
269
|
+
interface CommitFillInstruction {
|
|
270
|
+
type: "COMMIT_FILL";
|
|
271
|
+
filledCells: Array<{
|
|
272
|
+
row: number;
|
|
273
|
+
col: number;
|
|
274
|
+
value: CellValue;
|
|
275
|
+
}>;
|
|
276
|
+
}
|
|
277
|
+
/** Cancel fill instruction */
|
|
278
|
+
interface CancelFillInstruction {
|
|
279
|
+
type: "CANCEL_FILL";
|
|
280
|
+
}
|
|
281
|
+
/** Data loading instruction */
|
|
282
|
+
interface DataLoadingInstruction {
|
|
283
|
+
type: "DATA_LOADING";
|
|
284
|
+
}
|
|
285
|
+
/** Data loaded instruction */
|
|
286
|
+
interface DataLoadedInstruction {
|
|
287
|
+
type: "DATA_LOADED";
|
|
288
|
+
totalRows: number;
|
|
289
|
+
}
|
|
290
|
+
/** Data error instruction */
|
|
291
|
+
interface DataErrorInstruction {
|
|
292
|
+
type: "DATA_ERROR";
|
|
293
|
+
error: string;
|
|
294
|
+
}
|
|
295
|
+
/** Rows added instruction */
|
|
296
|
+
interface RowsAddedInstruction {
|
|
297
|
+
type: "ROWS_ADDED";
|
|
298
|
+
count: number;
|
|
299
|
+
totalRows: number;
|
|
300
|
+
}
|
|
301
|
+
/** Rows removed instruction */
|
|
302
|
+
interface RowsRemovedInstruction {
|
|
303
|
+
type: "ROWS_REMOVED";
|
|
304
|
+
count: number;
|
|
305
|
+
totalRows: number;
|
|
306
|
+
}
|
|
307
|
+
/** Rows updated instruction */
|
|
308
|
+
interface RowsUpdatedInstruction {
|
|
309
|
+
type: "ROWS_UPDATED";
|
|
310
|
+
count: number;
|
|
311
|
+
}
|
|
312
|
+
/** Transaction processed instruction */
|
|
313
|
+
interface TransactionProcessedInstruction {
|
|
314
|
+
type: "TRANSACTION_PROCESSED";
|
|
315
|
+
added: number;
|
|
316
|
+
removed: number;
|
|
317
|
+
updated: number;
|
|
318
|
+
}
|
|
319
|
+
/** Union type of all instructions */
|
|
320
|
+
type GridInstruction = /** Slot lifecycle */
|
|
321
|
+
CreateSlotInstruction | DestroySlotInstruction | AssignSlotInstruction | MoveSlotInstruction
|
|
322
|
+
/** Selection */ | SetActiveCellInstruction | SetSelectionRangeInstruction | UpdateVisibleRangeInstruction
|
|
323
|
+
/** Editing */ | StartEditInstruction | StopEditInstruction | CommitEditInstruction
|
|
324
|
+
/** Layout */ | SetContentSizeInstruction | UpdateHeaderInstruction
|
|
325
|
+
/** Filter popup */ | OpenFilterPopupInstruction | CloseFilterPopupInstruction
|
|
326
|
+
/** Fill handle */ | StartFillInstruction | UpdateFillInstruction | CommitFillInstruction | CancelFillInstruction
|
|
327
|
+
/** Data */ | DataLoadingInstruction | DataLoadedInstruction | DataErrorInstruction
|
|
328
|
+
/** Transactions */ | RowsAddedInstruction | RowsRemovedInstruction | RowsUpdatedInstruction | TransactionProcessedInstruction;
|
|
329
|
+
/** Instruction listener: Single instruction Listener that receives a single instruction, used by frameworks to update their state */
|
|
330
|
+
type InstructionListener = (instruction: GridInstruction) => void;
|
|
331
|
+
/** Batch instruction listener: Batch instruction Listener that receives an array of instructions, used by frameworks to update their state */
|
|
332
|
+
type BatchInstructionListener = (instructions: GridInstruction[]) => void;
|
|
333
|
+
//#endregion
|
|
334
|
+
//#region ../core/src/types/renderers.d.ts
|
|
335
|
+
/** Cell renderer params */
|
|
336
|
+
interface CellRendererParams {
|
|
337
|
+
/** Cell value */
|
|
338
|
+
value: CellValue;
|
|
339
|
+
/** Row data */
|
|
340
|
+
rowData: Row;
|
|
341
|
+
/** Column definition */
|
|
342
|
+
column: ColumnDefinition;
|
|
343
|
+
/** Row index */
|
|
344
|
+
rowIndex: number;
|
|
345
|
+
/** Column index */
|
|
346
|
+
colIndex: number;
|
|
347
|
+
/** Is active cell */
|
|
348
|
+
isActive: boolean;
|
|
349
|
+
/** Is selected cell */
|
|
350
|
+
isSelected: boolean;
|
|
351
|
+
/** Is editing cell */
|
|
352
|
+
isEditing: boolean;
|
|
353
|
+
}
|
|
354
|
+
/** Edit renderer params */
|
|
355
|
+
interface EditRendererParams extends CellRendererParams {
|
|
356
|
+
/** Initial value */
|
|
357
|
+
initialValue: CellValue;
|
|
358
|
+
/** On value change */
|
|
359
|
+
onValueChange: (newValue: CellValue) => void;
|
|
360
|
+
/** On commit */
|
|
361
|
+
onCommit: () => void;
|
|
362
|
+
/** On cancel */
|
|
363
|
+
onCancel: () => void;
|
|
364
|
+
}
|
|
365
|
+
/** Header renderer params */
|
|
366
|
+
interface HeaderRendererParams {
|
|
367
|
+
/** Column definition */
|
|
368
|
+
column: ColumnDefinition;
|
|
369
|
+
/** Column index */
|
|
370
|
+
colIndex: number;
|
|
371
|
+
/** Sort direction */
|
|
372
|
+
sortDirection?: SortDirection;
|
|
373
|
+
/** Sort index */
|
|
374
|
+
sortIndex?: number;
|
|
375
|
+
/** Whether column is sortable */
|
|
376
|
+
sortable: boolean;
|
|
377
|
+
/** Whether column is filterable */
|
|
378
|
+
filterable: boolean;
|
|
379
|
+
/** Whether column has an active filter */
|
|
380
|
+
hasFilter: boolean;
|
|
381
|
+
/** On sort */
|
|
382
|
+
onSort: (direction: SortDirection | null, addToExisting: boolean) => void;
|
|
383
|
+
/** On filter click */
|
|
384
|
+
onFilterClick: () => void;
|
|
385
|
+
}
|
|
386
|
+
//#endregion
|
|
387
|
+
//#region ../core/src/types/options.d.ts
|
|
388
|
+
/** Grid core options */
|
|
389
|
+
interface GridCoreOptions<TData = Row> {
|
|
390
|
+
/** Column definitions */
|
|
391
|
+
columns: ColumnDefinition[];
|
|
392
|
+
/** Data source */
|
|
393
|
+
dataSource: DataSource<TData>;
|
|
394
|
+
/** Row height */
|
|
395
|
+
rowHeight: number;
|
|
396
|
+
/** Header height: Default to row height */
|
|
397
|
+
headerHeight?: number;
|
|
398
|
+
/** Overscan: How many rows to render outside the viewport */
|
|
399
|
+
overscan?: number;
|
|
400
|
+
/** Enable/disable sorting globally. Default: true */
|
|
401
|
+
sortingEnabled?: boolean;
|
|
402
|
+
/** Debounce time for transactions in ms. Default 50. Set to 0 for sync. */
|
|
403
|
+
transactionDebounceMs?: number;
|
|
404
|
+
/** Function to extract unique ID from row. Required for mutations. */
|
|
405
|
+
getRowId?: (row: TData) => RowId;
|
|
406
|
+
}
|
|
407
|
+
//#endregion
|
|
408
|
+
//#region ../core/src/types/input.d.ts
|
|
409
|
+
/** Framework-agnostic pointer/mouse event data */
|
|
410
|
+
interface PointerEventData {
|
|
411
|
+
/** X coordinate relative to viewport */
|
|
412
|
+
clientX: number;
|
|
413
|
+
/** Y coordinate relative to viewport */
|
|
414
|
+
clientY: number;
|
|
415
|
+
/** Mouse button (0 = left, 1 = middle, 2 = right) */
|
|
416
|
+
button: number;
|
|
417
|
+
/** Whether Shift key is pressed */
|
|
418
|
+
shiftKey: boolean;
|
|
419
|
+
/** Whether Ctrl key is pressed */
|
|
420
|
+
ctrlKey: boolean;
|
|
421
|
+
/** Whether Meta/Command key is pressed */
|
|
422
|
+
metaKey: boolean;
|
|
423
|
+
}
|
|
424
|
+
/** Framework-agnostic keyboard event data */
|
|
425
|
+
interface KeyEventData {
|
|
426
|
+
/** Key value (e.g., 'Enter', 'ArrowUp', 'a') */
|
|
427
|
+
key: string;
|
|
428
|
+
/** Whether Shift key is pressed */
|
|
429
|
+
shiftKey: boolean;
|
|
430
|
+
/** Whether Ctrl key is pressed */
|
|
431
|
+
ctrlKey: boolean;
|
|
432
|
+
/** Whether Meta/Command key is pressed */
|
|
433
|
+
metaKey: boolean;
|
|
434
|
+
}
|
|
435
|
+
/** Container bounds and scroll position */
|
|
436
|
+
interface ContainerBounds {
|
|
437
|
+
/** Top position relative to viewport */
|
|
438
|
+
top: number;
|
|
439
|
+
/** Left position relative to viewport */
|
|
440
|
+
left: number;
|
|
441
|
+
/** Container width */
|
|
442
|
+
width: number;
|
|
443
|
+
/** Container height */
|
|
444
|
+
height: number;
|
|
445
|
+
/** Current scroll top position */
|
|
446
|
+
scrollTop: number;
|
|
447
|
+
/** Current scroll left position */
|
|
448
|
+
scrollLeft: number;
|
|
449
|
+
}
|
|
450
|
+
/** Result from mouse/pointer input handlers */
|
|
451
|
+
interface InputResult {
|
|
452
|
+
/** Whether to call preventDefault() on the event */
|
|
453
|
+
preventDefault: boolean;
|
|
454
|
+
/** Whether to call stopPropagation() on the event */
|
|
455
|
+
stopPropagation: boolean;
|
|
456
|
+
/** Whether framework should focus the container element */
|
|
457
|
+
focusContainer?: boolean;
|
|
458
|
+
/** Type of drag operation to start (framework manages global listeners) */
|
|
459
|
+
startDrag?: "selection" | "fill";
|
|
460
|
+
}
|
|
461
|
+
/** Result from keyboard input handler */
|
|
462
|
+
interface KeyboardResult {
|
|
463
|
+
/** Whether to call preventDefault() on the event */
|
|
464
|
+
preventDefault: boolean;
|
|
465
|
+
/** Cell to scroll into view (if navigation occurred) */
|
|
466
|
+
scrollToCell?: CellPosition;
|
|
467
|
+
}
|
|
468
|
+
/** Result from drag move handler */
|
|
469
|
+
interface DragMoveResult {
|
|
470
|
+
/** Target row index */
|
|
471
|
+
targetRow: number;
|
|
472
|
+
/** Target column index */
|
|
473
|
+
targetCol: number;
|
|
474
|
+
/** Auto-scroll deltas (null if no auto-scroll needed) */
|
|
475
|
+
autoScroll: {
|
|
476
|
+
dx: number;
|
|
477
|
+
dy: number;
|
|
478
|
+
} | null;
|
|
479
|
+
}
|
|
480
|
+
/** Options for InputHandler constructor */
|
|
481
|
+
interface InputHandlerDeps {
|
|
482
|
+
/** Get header height */
|
|
483
|
+
getHeaderHeight: () => number;
|
|
484
|
+
/** Get row height */
|
|
485
|
+
getRowHeight: () => number;
|
|
486
|
+
/** Get column positions array */
|
|
487
|
+
getColumnPositions: () => number[];
|
|
488
|
+
/** Get column count */
|
|
489
|
+
getColumnCount: () => number;
|
|
490
|
+
}
|
|
491
|
+
/** Current drag state for UI rendering */
|
|
492
|
+
interface DragState {
|
|
493
|
+
/** Whether any drag operation is active */
|
|
494
|
+
isDragging: boolean;
|
|
495
|
+
/** Type of active drag operation */
|
|
496
|
+
dragType: "selection" | "fill" | null;
|
|
497
|
+
/** Source range for fill operations */
|
|
498
|
+
fillSourceRange: CellRange | null;
|
|
499
|
+
/** Current fill target position */
|
|
500
|
+
fillTarget: {
|
|
501
|
+
row: number;
|
|
502
|
+
col: number;
|
|
503
|
+
} | null;
|
|
504
|
+
}
|
|
505
|
+
//#endregion
|
|
506
|
+
//#region ../core/src/selection.d.ts
|
|
507
|
+
type Direction = "up" | "down" | "left" | "right";
|
|
508
|
+
interface SelectionManagerOptions {
|
|
509
|
+
getRowCount: () => number;
|
|
510
|
+
getColumnCount: () => number;
|
|
511
|
+
getCellValue: (row: number, col: number) => CellValue;
|
|
512
|
+
getRowData: (row: number) => Row | undefined;
|
|
513
|
+
getColumn: (col: number) => ColumnDefinition | undefined;
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* Manages Excel-style cell selection, keyboard navigation, and clipboard operations.
|
|
517
|
+
*/
|
|
518
|
+
declare class SelectionManager {
|
|
519
|
+
private state;
|
|
520
|
+
private options;
|
|
521
|
+
private listeners;
|
|
522
|
+
constructor(options: SelectionManagerOptions);
|
|
523
|
+
onInstruction(listener: InstructionListener): () => void;
|
|
524
|
+
private emit;
|
|
525
|
+
getState(): SelectionState;
|
|
526
|
+
getActiveCell(): CellPosition | null;
|
|
527
|
+
getSelectionRange(): CellRange | null;
|
|
528
|
+
isSelected(row: number, col: number): boolean;
|
|
529
|
+
isActiveCell(row: number, col: number): boolean;
|
|
530
|
+
/**
|
|
531
|
+
* Start a selection at the given cell.
|
|
532
|
+
* @param cell - The cell to select
|
|
533
|
+
* @param opts.shift - Extend selection from anchor (range select)
|
|
534
|
+
* @param opts.ctrl - Toggle selection mode
|
|
535
|
+
*/
|
|
536
|
+
startSelection(cell: CellPosition, opts?: {
|
|
537
|
+
shift?: boolean;
|
|
538
|
+
ctrl?: boolean;
|
|
539
|
+
}): void;
|
|
540
|
+
/**
|
|
541
|
+
* Move focus in a direction, optionally extending the selection.
|
|
542
|
+
*/
|
|
543
|
+
moveFocus(direction: Direction, extend?: boolean): void;
|
|
544
|
+
/**
|
|
545
|
+
* Select all cells in the grid (Ctrl+A).
|
|
546
|
+
*/
|
|
547
|
+
selectAll(): void;
|
|
548
|
+
/**
|
|
549
|
+
* Clear the current selection.
|
|
550
|
+
*/
|
|
551
|
+
clearSelection(): void;
|
|
552
|
+
/**
|
|
553
|
+
* Set the active cell directly.
|
|
554
|
+
*/
|
|
555
|
+
setActiveCell(row: number, col: number): void;
|
|
556
|
+
/**
|
|
557
|
+
* Set the selection range directly.
|
|
558
|
+
*/
|
|
559
|
+
setSelectionRange(range: CellRange): void;
|
|
560
|
+
/**
|
|
561
|
+
* Get the data from the currently selected cells as a 2D array.
|
|
562
|
+
*/
|
|
563
|
+
getSelectedData(): CellValue[][];
|
|
564
|
+
/**
|
|
565
|
+
* Copy the selected data to the clipboard (Ctrl+C).
|
|
566
|
+
*/
|
|
567
|
+
copySelectionToClipboard(): Promise<void>;
|
|
568
|
+
private clampPosition;
|
|
569
|
+
}
|
|
570
|
+
//#endregion
|
|
571
|
+
//#region ../core/src/fill.d.ts
|
|
572
|
+
interface FillManagerOptions {
|
|
573
|
+
getRowCount: () => number;
|
|
574
|
+
getColumnCount: () => number;
|
|
575
|
+
getCellValue: (row: number, col: number) => CellValue;
|
|
576
|
+
getColumn: (col: number) => ColumnDefinition | undefined;
|
|
577
|
+
setCellValue: (row: number, col: number, value: CellValue) => void;
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* Manages fill handle operations including pattern detection and auto-fill.
|
|
581
|
+
*/
|
|
582
|
+
declare class FillManager {
|
|
583
|
+
private state;
|
|
584
|
+
private options;
|
|
585
|
+
private listeners;
|
|
586
|
+
constructor(options: FillManagerOptions);
|
|
587
|
+
onInstruction(listener: InstructionListener): () => void;
|
|
588
|
+
private emit;
|
|
589
|
+
getState(): FillHandleState | null;
|
|
590
|
+
isActive(): boolean;
|
|
591
|
+
/**
|
|
592
|
+
* Start a fill drag operation from a source range.
|
|
593
|
+
*/
|
|
594
|
+
startFillDrag(sourceRange: CellRange): void;
|
|
595
|
+
/**
|
|
596
|
+
* Update the fill drag target position.
|
|
597
|
+
*/
|
|
598
|
+
updateFillDrag(targetRow: number, targetCol: number): void;
|
|
599
|
+
/**
|
|
600
|
+
* Commit the fill operation - apply pattern to target cells.
|
|
601
|
+
*/
|
|
602
|
+
commitFillDrag(): void;
|
|
603
|
+
/**
|
|
604
|
+
* Cancel the fill operation.
|
|
605
|
+
*/
|
|
606
|
+
cancelFillDrag(): void;
|
|
607
|
+
/**
|
|
608
|
+
* Calculate the values to fill based on source pattern.
|
|
609
|
+
*/
|
|
610
|
+
private calculateFilledCells;
|
|
611
|
+
private getSourceColumnValues;
|
|
612
|
+
private detectPattern;
|
|
613
|
+
private applyPattern;
|
|
614
|
+
}
|
|
615
|
+
//#endregion
|
|
616
|
+
//#region ../core/src/input-handler.d.ts
|
|
617
|
+
declare class InputHandler<TData extends Row = Row> {
|
|
618
|
+
private core;
|
|
619
|
+
private deps;
|
|
620
|
+
private isDraggingSelection;
|
|
621
|
+
private isDraggingFill;
|
|
622
|
+
private fillSourceRange;
|
|
623
|
+
private fillTarget;
|
|
624
|
+
constructor(core: GridCore<TData>, deps: InputHandlerDeps);
|
|
625
|
+
/**
|
|
626
|
+
* Update dependencies (called when options change)
|
|
627
|
+
*/
|
|
628
|
+
updateDeps(deps: Partial<InputHandlerDeps>): void;
|
|
629
|
+
/**
|
|
630
|
+
* Get current drag state for UI rendering
|
|
631
|
+
*/
|
|
632
|
+
getDragState(): DragState;
|
|
633
|
+
/**
|
|
634
|
+
* Handle cell mouse down event
|
|
635
|
+
*/
|
|
636
|
+
handleCellMouseDown(rowIndex: number, colIndex: number, event: PointerEventData): InputResult;
|
|
637
|
+
/**
|
|
638
|
+
* Handle cell double click event (start editing)
|
|
639
|
+
*/
|
|
640
|
+
handleCellDoubleClick(rowIndex: number, colIndex: number): void;
|
|
641
|
+
/**
|
|
642
|
+
* Handle fill handle mouse down event
|
|
643
|
+
*/
|
|
644
|
+
handleFillHandleMouseDown(activeCell: CellPosition | null, selectionRange: CellRange | null, _event: PointerEventData): InputResult;
|
|
645
|
+
/**
|
|
646
|
+
* Handle header click event (cycle sort direction)
|
|
647
|
+
*/
|
|
648
|
+
handleHeaderClick(colId: string, addToExisting: boolean): void;
|
|
649
|
+
/**
|
|
650
|
+
* Start selection drag (called by framework after handleCellMouseDown returns startDrag: 'selection')
|
|
651
|
+
*/
|
|
652
|
+
startSelectionDrag(): void;
|
|
653
|
+
/**
|
|
654
|
+
* Handle drag move event (selection or fill)
|
|
655
|
+
*/
|
|
656
|
+
handleDragMove(event: PointerEventData, bounds: ContainerBounds): DragMoveResult | null;
|
|
657
|
+
/**
|
|
658
|
+
* Handle drag end event
|
|
659
|
+
*/
|
|
660
|
+
handleDragEnd(): void;
|
|
661
|
+
/**
|
|
662
|
+
* Handle wheel event with dampening for large datasets
|
|
663
|
+
* Returns scroll deltas or null if no dampening needed
|
|
664
|
+
*/
|
|
665
|
+
handleWheel(deltaY: number, deltaX: number, dampening: number): {
|
|
666
|
+
dy: number;
|
|
667
|
+
dx: number;
|
|
668
|
+
} | null;
|
|
669
|
+
/**
|
|
670
|
+
* Handle keyboard event
|
|
671
|
+
*/
|
|
672
|
+
handleKeyDown(event: KeyEventData, activeCell: CellPosition | null, editingCell: {
|
|
673
|
+
row: number;
|
|
674
|
+
col: number;
|
|
675
|
+
} | null, filterPopupOpen: boolean): KeyboardResult;
|
|
676
|
+
/**
|
|
677
|
+
* Find column index at a given X coordinate
|
|
678
|
+
*/
|
|
679
|
+
private findColumnAtX;
|
|
680
|
+
/**
|
|
681
|
+
* Calculate auto-scroll deltas based on mouse position
|
|
682
|
+
*/
|
|
683
|
+
private calculateAutoScroll;
|
|
684
|
+
}
|
|
685
|
+
//#endregion
|
|
686
|
+
//#region ../core/src/grid-core.d.ts
|
|
687
|
+
declare class GridCore<TData extends Row = Row> {
|
|
688
|
+
private columns;
|
|
689
|
+
private dataSource;
|
|
690
|
+
private rowHeight;
|
|
691
|
+
private headerHeight;
|
|
692
|
+
private overscan;
|
|
693
|
+
private sortingEnabled;
|
|
694
|
+
private scrollTop;
|
|
695
|
+
private scrollLeft;
|
|
696
|
+
private viewportWidth;
|
|
697
|
+
private viewportHeight;
|
|
698
|
+
private cachedRows;
|
|
699
|
+
private totalRows;
|
|
700
|
+
private currentPageIndex;
|
|
701
|
+
private pageSize;
|
|
702
|
+
private sortModel;
|
|
703
|
+
private filterModel;
|
|
704
|
+
private openFilterColIndex;
|
|
705
|
+
readonly selection: SelectionManager;
|
|
706
|
+
readonly fill: FillManager;
|
|
707
|
+
readonly input: InputHandler<TData>;
|
|
708
|
+
private readonly slotPool;
|
|
709
|
+
private readonly editManager;
|
|
710
|
+
private columnPositions;
|
|
711
|
+
private listeners;
|
|
712
|
+
private batchListeners;
|
|
713
|
+
private naturalContentHeight;
|
|
714
|
+
private virtualContentHeight;
|
|
715
|
+
private scrollRatio;
|
|
716
|
+
constructor(options: GridCoreOptions<TData>);
|
|
717
|
+
onInstruction(listener: InstructionListener): () => void;
|
|
718
|
+
/**
|
|
719
|
+
* Subscribe to batched instructions for efficient React state updates.
|
|
720
|
+
* Batch listeners receive arrays of instructions instead of individual ones.
|
|
721
|
+
*/
|
|
722
|
+
onBatchInstruction(listener: BatchInstructionListener): () => void;
|
|
723
|
+
private emit;
|
|
724
|
+
private emitBatch;
|
|
725
|
+
/**
|
|
726
|
+
* Initialize the grid and load initial data.
|
|
727
|
+
*/
|
|
728
|
+
initialize(): Promise<void>;
|
|
729
|
+
/**
|
|
730
|
+
* Update viewport measurements and sync slots.
|
|
731
|
+
* When scroll virtualization is active, maps the DOM scroll position to the actual row position.
|
|
732
|
+
*/
|
|
733
|
+
setViewport(scrollTop: number, scrollLeft: number, width: number, height: number): void;
|
|
734
|
+
private fetchData;
|
|
735
|
+
private fetchAllData;
|
|
736
|
+
setSort(colId: string, direction: SortDirection | null, addToExisting?: boolean): Promise<void>;
|
|
737
|
+
setFilter(colId: string, filter: ColumnFilterModel | string | null): Promise<void>;
|
|
738
|
+
/**
|
|
739
|
+
* Check if a column has an active filter
|
|
740
|
+
*/
|
|
741
|
+
hasActiveFilter(colId: string): boolean;
|
|
742
|
+
/**
|
|
743
|
+
* Check if a column is sortable
|
|
744
|
+
*/
|
|
745
|
+
isColumnSortable(colIndex: number): boolean;
|
|
746
|
+
/**
|
|
747
|
+
* Check if a column is filterable
|
|
748
|
+
*/
|
|
749
|
+
isColumnFilterable(colIndex: number): boolean;
|
|
750
|
+
/**
|
|
751
|
+
* Get distinct values for a column (for filter dropdowns)
|
|
752
|
+
* For array-type columns (like tags), each unique array combination is returned.
|
|
753
|
+
* Arrays are sorted internally for consistent comparison.
|
|
754
|
+
* Limited to MAX_DISTINCT_VALUES to avoid performance issues with large datasets.
|
|
755
|
+
*/
|
|
756
|
+
getDistinctValuesForColumn(colId: string, maxValues?: number): CellValue[];
|
|
757
|
+
/**
|
|
758
|
+
* Open filter popup for a column (toggles if already open for same column)
|
|
759
|
+
*/
|
|
760
|
+
openFilterPopup(colIndex: number, anchorRect: {
|
|
761
|
+
top: number;
|
|
762
|
+
left: number;
|
|
763
|
+
width: number;
|
|
764
|
+
height: number;
|
|
765
|
+
}): void;
|
|
766
|
+
/**
|
|
767
|
+
* Close filter popup
|
|
768
|
+
*/
|
|
769
|
+
closeFilterPopup(): void;
|
|
770
|
+
getSortModel(): SortModel[];
|
|
771
|
+
getFilterModel(): FilterModel;
|
|
772
|
+
startEdit(row: number, col: number): void;
|
|
773
|
+
updateEditValue(value: CellValue): void;
|
|
774
|
+
commitEdit(): void;
|
|
775
|
+
cancelEdit(): void;
|
|
776
|
+
getEditState(): EditState | null;
|
|
777
|
+
getCellValue(row: number, col: number): CellValue;
|
|
778
|
+
setCellValue(row: number, col: number, value: CellValue): void;
|
|
779
|
+
private getFieldValue;
|
|
780
|
+
private setFieldValue;
|
|
781
|
+
private computeColumnPositions;
|
|
782
|
+
private emitContentSize;
|
|
783
|
+
private emitHeaders;
|
|
784
|
+
getColumns(): ColumnDefinition[];
|
|
785
|
+
getColumnPositions(): number[];
|
|
786
|
+
getRowCount(): number;
|
|
787
|
+
getRowHeight(): number;
|
|
788
|
+
getHeaderHeight(): number;
|
|
789
|
+
getTotalWidth(): number;
|
|
790
|
+
getTotalHeight(): number;
|
|
791
|
+
/**
|
|
792
|
+
* Check if scroll scaling is active (large datasets exceeding browser scroll limits).
|
|
793
|
+
* When scaling is active, scrollRatio < 1 and scroll positions are compressed.
|
|
794
|
+
*/
|
|
795
|
+
isScalingActive(): boolean;
|
|
796
|
+
/**
|
|
797
|
+
* Get the natural (uncapped) content height.
|
|
798
|
+
* Useful for debugging or displaying actual content size.
|
|
799
|
+
*/
|
|
800
|
+
getNaturalHeight(): number;
|
|
801
|
+
/**
|
|
802
|
+
* Get the scroll ratio used for scroll virtualization.
|
|
803
|
+
* Returns 1 when no virtualization is needed, < 1 when content exceeds browser limits.
|
|
804
|
+
*/
|
|
805
|
+
getScrollRatio(): number;
|
|
806
|
+
/**
|
|
807
|
+
* Get the visible row range (excluding overscan).
|
|
808
|
+
* Returns the first and last row indices that are actually visible in the viewport.
|
|
809
|
+
* Includes partially visible rows to avoid false positives when clicking on edge rows.
|
|
810
|
+
*/
|
|
811
|
+
getVisibleRowRange(): {
|
|
812
|
+
start: number;
|
|
813
|
+
end: number;
|
|
814
|
+
};
|
|
815
|
+
/**
|
|
816
|
+
* Get the scroll position needed to bring a row into view.
|
|
817
|
+
* Accounts for scroll scaling when active.
|
|
818
|
+
*/
|
|
819
|
+
getScrollTopForRow(rowIndex: number): number;
|
|
820
|
+
/**
|
|
821
|
+
* Get the row index at a given viewport Y position.
|
|
822
|
+
* Accounts for scroll scaling when active.
|
|
823
|
+
* @param viewportY Y position in viewport (physical pixels below header, NOT including scroll)
|
|
824
|
+
* @param virtualScrollTop Current scroll position from container.scrollTop (virtual/scaled)
|
|
825
|
+
*/
|
|
826
|
+
getRowIndexAtDisplayY(viewportY: number, virtualScrollTop: number): number;
|
|
827
|
+
getRowData(rowIndex: number): TData | undefined;
|
|
828
|
+
/**
|
|
829
|
+
* Refresh data from the data source.
|
|
830
|
+
*/
|
|
831
|
+
refresh(): Promise<void>;
|
|
832
|
+
/**
|
|
833
|
+
* Refresh slot display without refetching data.
|
|
834
|
+
* Useful after in-place data modifications like fill operations.
|
|
835
|
+
*/
|
|
836
|
+
refreshSlotData(): void;
|
|
837
|
+
/**
|
|
838
|
+
* Update the data source and refresh.
|
|
839
|
+
*/
|
|
840
|
+
setDataSource(dataSource: DataSource<TData>): Promise<void>;
|
|
841
|
+
/**
|
|
842
|
+
* Update columns and recompute layout.
|
|
843
|
+
*/
|
|
844
|
+
setColumns(columns: ColumnDefinition[]): void;
|
|
845
|
+
}
|
|
846
|
+
//#endregion
|
|
847
|
+
//#region ../core/src/data-source/client-data-source.d.ts
|
|
848
|
+
interface ClientDataSourceOptions<TData> {
|
|
849
|
+
/** Custom field accessor for nested properties */
|
|
850
|
+
getFieldValue?: (row: TData, field: string) => CellValue;
|
|
851
|
+
/** Use Web Worker for sorting large datasets (default: true) */
|
|
852
|
+
useWorker?: boolean;
|
|
853
|
+
}
|
|
854
|
+
/**
|
|
855
|
+
* Creates a client-side data source that holds all data in memory.
|
|
856
|
+
* Sorting and filtering are performed client-side.
|
|
857
|
+
* For large datasets, sorting is automatically offloaded to a Web Worker.
|
|
858
|
+
*/
|
|
859
|
+
declare function createClientDataSource<TData extends Row = Row>(data: TData[], options?: ClientDataSourceOptions<TData>): DataSource<TData>;
|
|
860
|
+
/**
|
|
861
|
+
* Convenience function to create a data source from an array.
|
|
862
|
+
* This provides backwards compatibility with the old `rowData` prop.
|
|
863
|
+
*/
|
|
864
|
+
declare function createDataSourceFromArray<TData extends Row = Row>(data: TData[]): DataSource<TData>;
|
|
865
|
+
//#endregion
|
|
866
|
+
//#region ../core/src/data-source/server-data-source.d.ts
|
|
867
|
+
type ServerFetchFunction<TData> = (request: DataSourceRequest) => Promise<DataSourceResponse<TData>>;
|
|
868
|
+
/**
|
|
869
|
+
* Creates a server-side data source that delegates all operations to the server.
|
|
870
|
+
* The fetch function receives sort/filter/pagination params to pass to the API.
|
|
871
|
+
*/
|
|
872
|
+
declare function createServerDataSource<TData extends Row = Row>(fetchFn: ServerFetchFunction<TData>): DataSource<TData>;
|
|
873
|
+
//#endregion
|
|
874
|
+
//#region ../core/src/transaction-manager.d.ts
|
|
875
|
+
interface TransactionResult {
|
|
876
|
+
added: number;
|
|
877
|
+
removed: number;
|
|
878
|
+
updated: number;
|
|
879
|
+
}
|
|
880
|
+
//#endregion
|
|
881
|
+
//#region ../core/src/data-source/mutable-data-source.d.ts
|
|
882
|
+
/** Callback for data change notifications */
|
|
883
|
+
type DataChangeListener = (result: TransactionResult) => void;
|
|
884
|
+
/**
|
|
885
|
+
* Data source with mutation capabilities.
|
|
886
|
+
* Extends DataSource with add, remove, and update operations.
|
|
887
|
+
*/
|
|
888
|
+
interface MutableDataSource<TData = Row> extends DataSource<TData> {
|
|
889
|
+
/** Add rows to the data source. Queued and processed after debounce. */
|
|
890
|
+
addRows(rows: TData[]): void;
|
|
891
|
+
/** Remove rows by ID. Queued and processed after debounce. */
|
|
892
|
+
removeRows(ids: RowId[]): void;
|
|
893
|
+
/** Update a cell value. Queued and processed after debounce. */
|
|
894
|
+
updateCell(id: RowId, field: string, value: CellValue): void;
|
|
895
|
+
/** Update multiple fields on a row. Queued and processed after debounce. */
|
|
896
|
+
updateRow(id: RowId, data: Partial<TData>): void;
|
|
897
|
+
/** Force immediate processing of queued transactions. */
|
|
898
|
+
flushTransactions(): Promise<void>;
|
|
899
|
+
/** Check if there are pending transactions. */
|
|
900
|
+
hasPendingTransactions(): boolean;
|
|
901
|
+
/** Get distinct values for a field (for filter UI). */
|
|
902
|
+
getDistinctValues(field: string): CellValue[];
|
|
903
|
+
/** Get a row by ID. */
|
|
904
|
+
getRowById(id: RowId): TData | undefined;
|
|
905
|
+
/** Get total row count. */
|
|
906
|
+
getTotalRowCount(): number;
|
|
907
|
+
/** Subscribe to data change notifications. Returns unsubscribe function. */
|
|
908
|
+
subscribe(listener: DataChangeListener): () => void;
|
|
909
|
+
}
|
|
910
|
+
interface MutableClientDataSourceOptions<TData> {
|
|
911
|
+
/** Function to extract unique ID from row. Required. */
|
|
912
|
+
getRowId: (row: TData) => RowId;
|
|
913
|
+
/** Custom field accessor for nested properties. */
|
|
914
|
+
getFieldValue?: (row: TData, field: string) => CellValue;
|
|
915
|
+
/** Debounce time for transactions in ms. Default 50. Set to 0 for sync. */
|
|
916
|
+
debounceMs?: number;
|
|
917
|
+
/** Callback when transactions are processed. */
|
|
918
|
+
onTransactionProcessed?: (result: TransactionResult) => void;
|
|
919
|
+
}
|
|
920
|
+
/**
|
|
921
|
+
* Creates a mutable client-side data source with transaction support.
|
|
922
|
+
* Uses IndexedDataStore for efficient incremental operations.
|
|
923
|
+
*/
|
|
924
|
+
declare function createMutableClientDataSource<TData extends Row = Row>(data: TData[], options: MutableClientDataSourceOptions<TData>): MutableDataSource<TData>;
|
|
925
|
+
//#endregion
|
|
926
|
+
//#region ../core/src/styles/index.d.ts
|
|
927
|
+
/**
|
|
928
|
+
* Combined grid styles from all modules
|
|
929
|
+
*/
|
|
930
|
+
declare const gridStyles: string;
|
|
931
|
+
/**
|
|
932
|
+
* Inject grid styles into the document head.
|
|
933
|
+
* This is called automatically when the Grid component mounts.
|
|
934
|
+
* Styles are only injected once, even if multiple Grid instances exist.
|
|
935
|
+
*/
|
|
936
|
+
declare function injectStyles(): void;
|
|
937
|
+
//#endregion
|
|
938
|
+
//#region ../core/src/utils/positioning.d.ts
|
|
939
|
+
/**
|
|
940
|
+
* Calculate cumulative column positions (prefix sums)
|
|
941
|
+
* Returns an array where positions[i] is the left position of column i
|
|
942
|
+
* positions[columns.length] is the total width
|
|
943
|
+
*/
|
|
944
|
+
declare function calculateColumnPositions(columns: ColumnDefinition[]): number[];
|
|
945
|
+
/**
|
|
946
|
+
* Get total width from column positions
|
|
947
|
+
*/
|
|
948
|
+
declare function getTotalWidth(columnPositions: number[]): number;
|
|
949
|
+
/**
|
|
950
|
+
* Find column index at a given X coordinate
|
|
951
|
+
*/
|
|
952
|
+
declare function findColumnAtX(x: number, columnPositions: number[]): number;
|
|
953
|
+
//#endregion
|
|
954
|
+
//#region ../core/src/utils/classNames.d.ts
|
|
955
|
+
/**
|
|
956
|
+
* Check if a cell is within the selection range
|
|
957
|
+
*/
|
|
958
|
+
declare function isCellSelected(row: number, col: number, selectionRange: CellRange | null): boolean;
|
|
959
|
+
/**
|
|
960
|
+
* Check if a cell is the active cell
|
|
961
|
+
*/
|
|
962
|
+
declare function isCellActive(row: number, col: number, activeCell: CellPosition | null): boolean;
|
|
963
|
+
/**
|
|
964
|
+
* Check if a row is within the visible range (not in overscan)
|
|
965
|
+
*/
|
|
966
|
+
declare function isRowVisible(row: number, visibleRowRange: {
|
|
967
|
+
start: number;
|
|
968
|
+
end: number;
|
|
969
|
+
} | null): boolean;
|
|
970
|
+
/**
|
|
971
|
+
* Check if a cell is being edited
|
|
972
|
+
*/
|
|
973
|
+
declare function isCellEditing(row: number, col: number, editingCell: {
|
|
974
|
+
row: number;
|
|
975
|
+
col: number;
|
|
976
|
+
} | null): boolean;
|
|
977
|
+
/**
|
|
978
|
+
* Check if a cell is in the fill preview range (vertical-only fill)
|
|
979
|
+
*/
|
|
980
|
+
declare function isCellInFillPreview(row: number, col: number, isDraggingFill: boolean, fillSourceRange: {
|
|
981
|
+
startRow: number;
|
|
982
|
+
startCol: number;
|
|
983
|
+
endRow: number;
|
|
984
|
+
endCol: number;
|
|
985
|
+
} | null, fillTarget: {
|
|
986
|
+
row: number;
|
|
987
|
+
col: number;
|
|
988
|
+
} | null): boolean;
|
|
989
|
+
/**
|
|
990
|
+
* Build cell CSS classes based on state
|
|
991
|
+
*/
|
|
992
|
+
declare function buildCellClasses(isActive: boolean, isSelected: boolean, isEditing: boolean, inFillPreview: boolean): string;
|
|
993
|
+
//#endregion
|
|
994
|
+
//#region ../core/src/types/ui-state.d.ts
|
|
995
|
+
interface SlotData {
|
|
996
|
+
slotId: string;
|
|
997
|
+
rowIndex: number;
|
|
998
|
+
rowData: Row;
|
|
999
|
+
translateY: number;
|
|
1000
|
+
}
|
|
1001
|
+
interface HeaderData {
|
|
1002
|
+
column: ColumnDefinition;
|
|
1003
|
+
sortDirection?: SortDirection;
|
|
1004
|
+
sortIndex?: number;
|
|
1005
|
+
sortable: boolean;
|
|
1006
|
+
filterable: boolean;
|
|
1007
|
+
hasFilter: boolean;
|
|
1008
|
+
}
|
|
1009
|
+
interface FilterPopupState {
|
|
1010
|
+
isOpen: boolean;
|
|
1011
|
+
colIndex: number;
|
|
1012
|
+
column: ColumnDefinition | null;
|
|
1013
|
+
anchorRect: {
|
|
1014
|
+
top: number;
|
|
1015
|
+
left: number;
|
|
1016
|
+
width: number;
|
|
1017
|
+
height: number;
|
|
1018
|
+
} | null;
|
|
1019
|
+
distinctValues: CellValue[];
|
|
1020
|
+
currentFilter?: ColumnFilterModel;
|
|
1021
|
+
}
|
|
1022
|
+
interface GridState {
|
|
1023
|
+
slots: Map<string, SlotData>;
|
|
1024
|
+
activeCell: CellPosition | null;
|
|
1025
|
+
selectionRange: CellRange | null;
|
|
1026
|
+
editingCell: {
|
|
1027
|
+
row: number;
|
|
1028
|
+
col: number;
|
|
1029
|
+
initialValue: CellValue;
|
|
1030
|
+
} | null;
|
|
1031
|
+
contentWidth: number;
|
|
1032
|
+
contentHeight: number;
|
|
1033
|
+
headers: Map<number, HeaderData>;
|
|
1034
|
+
filterPopup: FilterPopupState | null;
|
|
1035
|
+
isLoading: boolean;
|
|
1036
|
+
error: string | null;
|
|
1037
|
+
totalRows: number;
|
|
1038
|
+
/** Visible row range (start inclusive, end inclusive). Used to prevent selection showing in overscan. */
|
|
1039
|
+
visibleRowRange: {
|
|
1040
|
+
start: number;
|
|
1041
|
+
end: number;
|
|
1042
|
+
} | null;
|
|
1043
|
+
}
|
|
1044
|
+
//#endregion
|
|
1045
|
+
//#region src/types.d.ts
|
|
1046
|
+
/**
|
|
1047
|
+
* Vue cell renderer - can return a VNode or a string
|
|
1048
|
+
*/
|
|
1049
|
+
type VueCellRenderer<TData extends Row = Row> = (params: CellRendererParams<TData>) => VNode | string | null;
|
|
1050
|
+
/**
|
|
1051
|
+
* Vue edit renderer - returns a VNode for the edit input
|
|
1052
|
+
*/
|
|
1053
|
+
type VueEditRenderer<TData extends Row = Row> = (params: EditRendererParams<TData>) => VNode | null;
|
|
1054
|
+
/**
|
|
1055
|
+
* Vue header renderer - returns a VNode for the header content
|
|
1056
|
+
*/
|
|
1057
|
+
type VueHeaderRenderer = (params: HeaderRendererParams) => VNode | string | null;
|
|
1058
|
+
interface GpGridProps<TData extends Row = Row> {
|
|
1059
|
+
columns: ColumnDefinition[];
|
|
1060
|
+
dataSource?: DataSource<TData>;
|
|
1061
|
+
rowData?: TData[];
|
|
1062
|
+
rowHeight: number;
|
|
1063
|
+
headerHeight?: number;
|
|
1064
|
+
overscan?: number;
|
|
1065
|
+
sortingEnabled?: boolean;
|
|
1066
|
+
darkMode?: boolean;
|
|
1067
|
+
wheelDampening?: number;
|
|
1068
|
+
cellRenderers?: Record<string, VueCellRenderer<TData> | Component>;
|
|
1069
|
+
editRenderers?: Record<string, VueEditRenderer<TData> | Component>;
|
|
1070
|
+
headerRenderers?: Record<string, VueHeaderRenderer | Component>;
|
|
1071
|
+
cellRenderer?: VueCellRenderer<TData> | Component;
|
|
1072
|
+
editRenderer?: VueEditRenderer<TData> | Component;
|
|
1073
|
+
headerRenderer?: VueHeaderRenderer | Component;
|
|
1074
|
+
}
|
|
1075
|
+
//#endregion
|
|
1076
|
+
//#region src/GpGrid.vue.d.ts
|
|
1077
|
+
type __VLS_Props = {
|
|
1078
|
+
columns: ColumnDefinition[];
|
|
1079
|
+
dataSource?: DataSource<Row>;
|
|
1080
|
+
rowData?: Row[];
|
|
1081
|
+
rowHeight: number;
|
|
1082
|
+
headerHeight?: number;
|
|
1083
|
+
overscan?: number;
|
|
1084
|
+
sortingEnabled?: boolean;
|
|
1085
|
+
darkMode?: boolean;
|
|
1086
|
+
wheelDampening?: number;
|
|
1087
|
+
cellRenderers?: Record<string, VueCellRenderer>;
|
|
1088
|
+
editRenderers?: Record<string, VueEditRenderer>;
|
|
1089
|
+
headerRenderers?: Record<string, VueHeaderRenderer>;
|
|
1090
|
+
cellRenderer?: VueCellRenderer;
|
|
1091
|
+
editRenderer?: VueEditRenderer;
|
|
1092
|
+
headerRenderer?: VueHeaderRenderer;
|
|
1093
|
+
};
|
|
1094
|
+
declare const __VLS_export: vue0.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue0.ComponentOptionsMixin, vue0.ComponentOptionsMixin, {}, string, vue0.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
1095
|
+
overscan: number;
|
|
1096
|
+
sortingEnabled: boolean;
|
|
1097
|
+
darkMode: boolean;
|
|
1098
|
+
wheelDampening: number;
|
|
1099
|
+
cellRenderers: Record<string, VueCellRenderer>;
|
|
1100
|
+
editRenderers: Record<string, VueEditRenderer>;
|
|
1101
|
+
headerRenderers: Record<string, VueHeaderRenderer>;
|
|
1102
|
+
}, {}, {}, {}, string, vue0.ComponentProvideOptions, false, {}, any>;
|
|
1103
|
+
declare const _default: typeof __VLS_export;
|
|
1104
|
+
//#endregion
|
|
1105
|
+
//#region src/composables/useGpGrid.d.ts
|
|
1106
|
+
interface UseGpGridOptions<TData extends Row = Row> {
|
|
1107
|
+
columns: ColumnDefinition[];
|
|
1108
|
+
dataSource?: DataSource<TData>;
|
|
1109
|
+
rowData?: TData[];
|
|
1110
|
+
rowHeight: number;
|
|
1111
|
+
headerHeight?: number;
|
|
1112
|
+
overscan?: number;
|
|
1113
|
+
sortingEnabled?: boolean;
|
|
1114
|
+
darkMode?: boolean;
|
|
1115
|
+
wheelDampening?: number;
|
|
1116
|
+
cellRenderers?: Record<string, VueCellRenderer<TData>>;
|
|
1117
|
+
editRenderers?: Record<string, VueEditRenderer<TData>>;
|
|
1118
|
+
headerRenderers?: Record<string, VueHeaderRenderer>;
|
|
1119
|
+
cellRenderer?: VueCellRenderer<TData>;
|
|
1120
|
+
editRenderer?: VueEditRenderer<TData>;
|
|
1121
|
+
headerRenderer?: VueHeaderRenderer;
|
|
1122
|
+
}
|
|
1123
|
+
interface UseGpGridResult<TData extends Row = Row> {
|
|
1124
|
+
containerRef: Ref<HTMLDivElement | null>;
|
|
1125
|
+
coreRef: Ref<GridCore<TData> | null>;
|
|
1126
|
+
state: GridState;
|
|
1127
|
+
slotsArray: ComputedRef<SlotData[]>;
|
|
1128
|
+
totalHeaderHeight: ComputedRef<number>;
|
|
1129
|
+
columnPositions: ComputedRef<number[]>;
|
|
1130
|
+
totalWidth: ComputedRef<number>;
|
|
1131
|
+
fillHandlePosition: ComputedRef<{
|
|
1132
|
+
top: number;
|
|
1133
|
+
left: number;
|
|
1134
|
+
} | null>;
|
|
1135
|
+
handleScroll: () => void;
|
|
1136
|
+
handleCellMouseDown: (rowIndex: number, colIndex: number, e: MouseEvent) => void;
|
|
1137
|
+
handleCellDoubleClick: (rowIndex: number, colIndex: number) => void;
|
|
1138
|
+
handleFillHandleMouseDown: (e: MouseEvent) => void;
|
|
1139
|
+
handleHeaderClick: (colIndex: number, e: MouseEvent) => void;
|
|
1140
|
+
handleKeyDown: (e: KeyboardEvent) => void;
|
|
1141
|
+
handleWheel: (e: WheelEvent, wheelDampening: number) => void;
|
|
1142
|
+
handleFilterApply: (colId: string, filter: ColumnFilterModel | null) => void;
|
|
1143
|
+
handleFilterPopupClose: () => void;
|
|
1144
|
+
dragState: Ref<{
|
|
1145
|
+
isDragging: boolean;
|
|
1146
|
+
dragType: "selection" | "fill" | null;
|
|
1147
|
+
fillSourceRange: {
|
|
1148
|
+
startRow: number;
|
|
1149
|
+
startCol: number;
|
|
1150
|
+
endRow: number;
|
|
1151
|
+
endCol: number;
|
|
1152
|
+
} | null;
|
|
1153
|
+
fillTarget: {
|
|
1154
|
+
row: number;
|
|
1155
|
+
col: number;
|
|
1156
|
+
} | null;
|
|
1157
|
+
}>;
|
|
1158
|
+
isCellSelected: typeof isCellSelected;
|
|
1159
|
+
isCellActive: typeof isCellActive;
|
|
1160
|
+
isCellEditing: typeof isCellEditing;
|
|
1161
|
+
isCellInFillPreview: typeof isCellInFillPreview;
|
|
1162
|
+
buildCellClasses: typeof buildCellClasses;
|
|
1163
|
+
}
|
|
1164
|
+
/**
|
|
1165
|
+
* Nuxt-friendly composable for using gp-grid.
|
|
1166
|
+
* Returns all the pieces needed to build a custom grid component.
|
|
1167
|
+
*/
|
|
1168
|
+
declare function useGpGrid<TData extends Row = Row>(options: UseGpGridOptions<TData>): UseGpGridResult<TData>;
|
|
1169
|
+
//#endregion
|
|
1170
|
+
//#region src/composables/useInputHandler.d.ts
|
|
1171
|
+
interface UseInputHandlerOptions {
|
|
1172
|
+
activeCell: ComputedRef<CellPosition | null>;
|
|
1173
|
+
selectionRange: ComputedRef<CellRange | null>;
|
|
1174
|
+
editingCell: ComputedRef<{
|
|
1175
|
+
row: number;
|
|
1176
|
+
col: number;
|
|
1177
|
+
} | null>;
|
|
1178
|
+
filterPopupOpen: ComputedRef<boolean>;
|
|
1179
|
+
rowHeight: number;
|
|
1180
|
+
headerHeight: number;
|
|
1181
|
+
columnPositions: ComputedRef<number[]>;
|
|
1182
|
+
slots: ComputedRef<Map<string, SlotData>>;
|
|
1183
|
+
}
|
|
1184
|
+
interface UseInputHandlerResult {
|
|
1185
|
+
handleCellMouseDown: (rowIndex: number, colIndex: number, e: MouseEvent) => void;
|
|
1186
|
+
handleCellDoubleClick: (rowIndex: number, colIndex: number) => void;
|
|
1187
|
+
handleFillHandleMouseDown: (e: MouseEvent) => void;
|
|
1188
|
+
handleHeaderClick: (colIndex: number, e: MouseEvent) => void;
|
|
1189
|
+
handleKeyDown: (e: KeyboardEvent) => void;
|
|
1190
|
+
handleWheel: (e: WheelEvent, wheelDampening: number) => void;
|
|
1191
|
+
dragState: Ref<DragState>;
|
|
1192
|
+
}
|
|
1193
|
+
/**
|
|
1194
|
+
* Vue composable for handling all input interactions
|
|
1195
|
+
*/
|
|
1196
|
+
declare function useInputHandler(coreRef: ShallowRef<GridCore | null>, containerRef: Ref<HTMLDivElement | null>, columns: ComputedRef<ColumnDefinition[]>, options: UseInputHandlerOptions): UseInputHandlerResult;
|
|
1197
|
+
//#endregion
|
|
1198
|
+
//#region src/composables/useAutoScroll.d.ts
|
|
1199
|
+
/**
|
|
1200
|
+
* Vue composable for auto-scrolling during drag operations
|
|
1201
|
+
*/
|
|
1202
|
+
declare function useAutoScroll(containerRef: Ref<HTMLDivElement | null>): {
|
|
1203
|
+
startAutoScroll: (dx: number, dy: number) => void;
|
|
1204
|
+
stopAutoScroll: () => void;
|
|
1205
|
+
};
|
|
1206
|
+
//#endregion
|
|
1207
|
+
//#region src/composables/useFillHandle.d.ts
|
|
1208
|
+
interface UseFillHandleOptions {
|
|
1209
|
+
activeCell: ComputedRef<CellPosition | null>;
|
|
1210
|
+
selectionRange: ComputedRef<CellRange | null>;
|
|
1211
|
+
slots: ComputedRef<Map<string, SlotData>>;
|
|
1212
|
+
columns: ComputedRef<ColumnDefinition[]>;
|
|
1213
|
+
columnPositions: ComputedRef<number[]>;
|
|
1214
|
+
rowHeight: number;
|
|
1215
|
+
}
|
|
1216
|
+
interface UseFillHandleResult {
|
|
1217
|
+
fillHandlePosition: ComputedRef<{
|
|
1218
|
+
top: number;
|
|
1219
|
+
left: number;
|
|
1220
|
+
} | null>;
|
|
1221
|
+
}
|
|
1222
|
+
/**
|
|
1223
|
+
* Composable for calculating the fill handle position.
|
|
1224
|
+
* The fill handle appears at the bottom-right corner of the selection
|
|
1225
|
+
* when all selected columns are editable.
|
|
1226
|
+
*/
|
|
1227
|
+
declare function useFillHandle(options: UseFillHandleOptions): UseFillHandleResult;
|
|
1228
|
+
//#endregion
|
|
1229
|
+
//#region src/composables/useFilterPopup.d.ts
|
|
1230
|
+
interface UseFilterPopupOptions {
|
|
1231
|
+
onClose: () => void;
|
|
1232
|
+
ignoreSelector?: string;
|
|
1233
|
+
}
|
|
1234
|
+
/**
|
|
1235
|
+
* Composable for filter popup behavior.
|
|
1236
|
+
* Handles click-outside detection and escape key to close the popup.
|
|
1237
|
+
*/
|
|
1238
|
+
declare function useFilterPopup(popupRef: Ref<HTMLElement | null>, options: UseFilterPopupOptions): void;
|
|
1239
|
+
//#endregion
|
|
1240
|
+
//#region src/composables/useFilterConditions.d.ts
|
|
1241
|
+
interface LocalFilterCondition<TOperator extends string> {
|
|
1242
|
+
operator: TOperator;
|
|
1243
|
+
value: string;
|
|
1244
|
+
valueTo: string;
|
|
1245
|
+
nextOperator: "and" | "or";
|
|
1246
|
+
}
|
|
1247
|
+
interface UseFilterConditionsResult<TOperator extends string> {
|
|
1248
|
+
conditions: Ref<LocalFilterCondition<TOperator>[]>;
|
|
1249
|
+
combination: Ref<"and" | "or">;
|
|
1250
|
+
updateCondition: (index: number, updates: Partial<LocalFilterCondition<TOperator>>) => void;
|
|
1251
|
+
addCondition: (defaultOperator: TOperator) => void;
|
|
1252
|
+
removeCondition: (index: number) => void;
|
|
1253
|
+
}
|
|
1254
|
+
/**
|
|
1255
|
+
* Composable for managing filter conditions.
|
|
1256
|
+
* Used by NumberFilterContent, DateFilterContent, and TextFilterContent (condition mode).
|
|
1257
|
+
*/
|
|
1258
|
+
declare function useFilterConditions<TOperator extends string>(initialConditions: LocalFilterCondition<TOperator>[], initialCombination?: "and" | "or"): UseFilterConditionsResult<TOperator>;
|
|
1259
|
+
//#endregion
|
|
1260
|
+
//#region src/gridState/useGridState.d.ts
|
|
1261
|
+
declare function createInitialState(): GridState;
|
|
1262
|
+
/**
|
|
1263
|
+
* Vue composable for managing grid state
|
|
1264
|
+
*/
|
|
1265
|
+
declare function useGridState(): {
|
|
1266
|
+
state: {
|
|
1267
|
+
slots: Map<string, {
|
|
1268
|
+
slotId: string;
|
|
1269
|
+
rowIndex: number;
|
|
1270
|
+
rowData: Row;
|
|
1271
|
+
translateY: number;
|
|
1272
|
+
}> & Omit<Map<string, SlotData>, keyof Map<any, any>>;
|
|
1273
|
+
activeCell: {
|
|
1274
|
+
row: number;
|
|
1275
|
+
col: number;
|
|
1276
|
+
} | null;
|
|
1277
|
+
selectionRange: {
|
|
1278
|
+
startRow: number;
|
|
1279
|
+
startCol: number;
|
|
1280
|
+
endRow: number;
|
|
1281
|
+
endCol: number;
|
|
1282
|
+
} | null;
|
|
1283
|
+
editingCell: {
|
|
1284
|
+
row: number;
|
|
1285
|
+
col: number;
|
|
1286
|
+
initialValue: CellValue;
|
|
1287
|
+
} | null;
|
|
1288
|
+
contentWidth: number;
|
|
1289
|
+
contentHeight: number;
|
|
1290
|
+
headers: Map<number, {
|
|
1291
|
+
column: {
|
|
1292
|
+
field: string;
|
|
1293
|
+
colId?: string | undefined;
|
|
1294
|
+
cellDataType: CellDataType;
|
|
1295
|
+
width: number;
|
|
1296
|
+
headerName?: string | undefined;
|
|
1297
|
+
editable?: boolean | undefined;
|
|
1298
|
+
sortable?: boolean | undefined;
|
|
1299
|
+
filterable?: boolean | undefined;
|
|
1300
|
+
cellRenderer?: string | undefined;
|
|
1301
|
+
editRenderer?: string | undefined;
|
|
1302
|
+
headerRenderer?: string | undefined;
|
|
1303
|
+
};
|
|
1304
|
+
sortDirection?: SortDirection | undefined;
|
|
1305
|
+
sortIndex?: number | undefined;
|
|
1306
|
+
sortable: boolean;
|
|
1307
|
+
filterable: boolean;
|
|
1308
|
+
hasFilter: boolean;
|
|
1309
|
+
}> & Omit<Map<number, HeaderData>, keyof Map<any, any>>;
|
|
1310
|
+
filterPopup: {
|
|
1311
|
+
isOpen: boolean;
|
|
1312
|
+
colIndex: number;
|
|
1313
|
+
column: {
|
|
1314
|
+
field: string;
|
|
1315
|
+
colId?: string | undefined;
|
|
1316
|
+
cellDataType: CellDataType;
|
|
1317
|
+
width: number;
|
|
1318
|
+
headerName?: string | undefined;
|
|
1319
|
+
editable?: boolean | undefined;
|
|
1320
|
+
sortable?: boolean | undefined;
|
|
1321
|
+
filterable?: boolean | undefined;
|
|
1322
|
+
cellRenderer?: string | undefined;
|
|
1323
|
+
editRenderer?: string | undefined;
|
|
1324
|
+
headerRenderer?: string | undefined;
|
|
1325
|
+
} | null;
|
|
1326
|
+
anchorRect: {
|
|
1327
|
+
top: number;
|
|
1328
|
+
left: number;
|
|
1329
|
+
width: number;
|
|
1330
|
+
height: number;
|
|
1331
|
+
} | null;
|
|
1332
|
+
distinctValues: CellValue[];
|
|
1333
|
+
currentFilter?: {
|
|
1334
|
+
conditions: ({
|
|
1335
|
+
type: "text";
|
|
1336
|
+
operator: TextFilterOperator;
|
|
1337
|
+
value?: string | undefined;
|
|
1338
|
+
selectedValues?: (Set<string> & Omit<Set<string>, keyof Set<any>>) | undefined;
|
|
1339
|
+
includeBlank?: boolean | undefined;
|
|
1340
|
+
nextOperator?: FilterCombination | undefined;
|
|
1341
|
+
} | {
|
|
1342
|
+
type: "number";
|
|
1343
|
+
operator: NumberFilterOperator;
|
|
1344
|
+
value?: number | undefined;
|
|
1345
|
+
valueTo?: number | undefined;
|
|
1346
|
+
nextOperator?: FilterCombination | undefined;
|
|
1347
|
+
} | {
|
|
1348
|
+
type: "date";
|
|
1349
|
+
operator: DateFilterOperator;
|
|
1350
|
+
value?: (Date | string) | undefined;
|
|
1351
|
+
valueTo?: (Date | string) | undefined;
|
|
1352
|
+
nextOperator?: FilterCombination | undefined;
|
|
1353
|
+
})[];
|
|
1354
|
+
combination: FilterCombination;
|
|
1355
|
+
} | undefined;
|
|
1356
|
+
} | null;
|
|
1357
|
+
isLoading: boolean;
|
|
1358
|
+
error: string | null;
|
|
1359
|
+
totalRows: number;
|
|
1360
|
+
visibleRowRange: {
|
|
1361
|
+
start: number;
|
|
1362
|
+
end: number;
|
|
1363
|
+
} | null;
|
|
1364
|
+
};
|
|
1365
|
+
applyInstructions: (instructions: GridInstruction[]) => void;
|
|
1366
|
+
reset: () => void;
|
|
1367
|
+
};
|
|
1368
|
+
//#endregion
|
|
1369
|
+
//#region src/renderers/cellRenderer.d.ts
|
|
1370
|
+
/**
|
|
1371
|
+
* Get cell value from row data, supporting dot-notation for nested fields
|
|
1372
|
+
*/
|
|
1373
|
+
declare function getCellValue(rowData: Row, field: string): CellValue;
|
|
1374
|
+
interface RenderCellOptions {
|
|
1375
|
+
column: ColumnDefinition;
|
|
1376
|
+
rowData: Row;
|
|
1377
|
+
rowIndex: number;
|
|
1378
|
+
colIndex: number;
|
|
1379
|
+
isActive: boolean;
|
|
1380
|
+
isSelected: boolean;
|
|
1381
|
+
isEditing: boolean;
|
|
1382
|
+
cellRenderers: Record<string, VueCellRenderer>;
|
|
1383
|
+
globalCellRenderer?: VueCellRenderer;
|
|
1384
|
+
}
|
|
1385
|
+
/**
|
|
1386
|
+
* Render cell content based on column configuration and renderer registries
|
|
1387
|
+
*/
|
|
1388
|
+
declare function renderCell(options: RenderCellOptions): VNode;
|
|
1389
|
+
//#endregion
|
|
1390
|
+
//#region src/renderers/editRenderer.d.ts
|
|
1391
|
+
interface RenderEditCellOptions {
|
|
1392
|
+
column: ColumnDefinition;
|
|
1393
|
+
rowData: Row;
|
|
1394
|
+
rowIndex: number;
|
|
1395
|
+
colIndex: number;
|
|
1396
|
+
initialValue: CellValue;
|
|
1397
|
+
core: GridCore | null;
|
|
1398
|
+
editRenderers: Record<string, VueEditRenderer>;
|
|
1399
|
+
globalEditRenderer?: VueEditRenderer;
|
|
1400
|
+
}
|
|
1401
|
+
/**
|
|
1402
|
+
* Render edit cell content based on column configuration and renderer registries
|
|
1403
|
+
*/
|
|
1404
|
+
declare function renderEditCell(options: RenderEditCellOptions): VNode;
|
|
1405
|
+
//#endregion
|
|
1406
|
+
//#region src/renderers/headerRenderer.d.ts
|
|
1407
|
+
interface RenderHeaderOptions {
|
|
1408
|
+
column: ColumnDefinition;
|
|
1409
|
+
colIndex: number;
|
|
1410
|
+
sortDirection?: SortDirection;
|
|
1411
|
+
sortIndex?: number;
|
|
1412
|
+
sortable: boolean;
|
|
1413
|
+
filterable: boolean;
|
|
1414
|
+
hasFilter: boolean;
|
|
1415
|
+
core: GridCore | null;
|
|
1416
|
+
container: HTMLDivElement | null;
|
|
1417
|
+
headerRenderers: Record<string, VueHeaderRenderer>;
|
|
1418
|
+
globalHeaderRenderer?: VueHeaderRenderer;
|
|
1419
|
+
}
|
|
1420
|
+
/**
|
|
1421
|
+
* Render header content based on column configuration and renderer registries
|
|
1422
|
+
*/
|
|
1423
|
+
declare function renderHeader(options: RenderHeaderOptions): VNode;
|
|
1424
|
+
//#endregion
|
|
1425
|
+
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, 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 };
|
|
1426
|
+
//# sourceMappingURL=index.d.ts.map
|