ia-table 0.13.3 → 0.14.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.
@@ -0,0 +1,2153 @@
1
+ import { CSSProperties } from 'react';
2
+ import { default as default_2 } from 'react';
3
+ import { MutableRefObject } from 'react';
4
+
5
+ declare const ACTION_TYPES: {
6
+ readonly SET_DATA: "SET_DATA";
7
+ readonly SET_FILTERED_DATA: "SET_FILTERED_DATA";
8
+ readonly SET_COLUMNS: "SET_COLUMNS";
9
+ readonly SET_SORT: "SET_SORT";
10
+ readonly SET_PAGE: "SET_PAGE";
11
+ readonly SET_PAGE_SIZE: "SET_PAGE_SIZE";
12
+ readonly SET_SELECTED_ROWS: "SET_SELECTED_ROWS";
13
+ readonly SET_COLUMN_FILTER: "SET_COLUMN_FILTER";
14
+ readonly REMOVE_COLUMN_FILTER: "REMOVE_COLUMN_FILTER";
15
+ readonly APPLY_FILTERS: "APPLY_FILTERS";
16
+ readonly TOGGLE_GROUP_EXPANSION: "TOGGLE_GROUP_EXPANSION";
17
+ readonly SET_FIELD_KEYS: "SET_FIELD_KEYS";
18
+ readonly UPDATE_ROW_DATA: "UPDATE_ROW_DATA";
19
+ readonly SELECTION_CHANGED_HANDLED: "SELECTION_CHANGED_HANDLED";
20
+ readonly FREEZE_COLUMN: "FREEZE_COLUMN";
21
+ readonly UNFREEZE_COLUMN: "UNFREEZE_COLUMN";
22
+ readonly PIN_COLUMN_RIGHT: "PIN_COLUMN_RIGHT";
23
+ readonly UNPIN_COLUMN_RIGHT: "UNPIN_COLUMN_RIGHT";
24
+ readonly SET_COLUMN_WIDTH: "SET_COLUMN_WIDTH";
25
+ readonly SET_COLUMNS_WIDTH: "SET_COLUMNS_WIDTH";
26
+ readonly SHOW_NOTIFICATION: "SHOW_NOTIFICATION";
27
+ readonly HIDE_NOTIFICATION: "HIDE_NOTIFICATION";
28
+ readonly AUTOSIZE_COLUMNS_REQUESTED: "AUTOSIZE_COLUMNS_REQUESTED";
29
+ readonly TOGGLE_FREEZE_COLUMN: "TOGGLE_FREEZE_COLUMN";
30
+ readonly REORDER_COLUMNS: "REORDER_COLUMNS";
31
+ readonly SET_PREV_ACTION: "SET_PREV_ACTION";
32
+ readonly SET_CHECK_CONFIGURATION: "SET_CHECK_CONFIGURATION";
33
+ readonly SET_IS_SELECT_ALL_RECORDS: "SET_IS_SELECT_ALL_RECORDS";
34
+ readonly BATCH_UPDATE: "BATCH_UPDATE";
35
+ readonly UPDATE_ROW_DATA_OBJECT: "UPDATE_ROW_DATA_OBJECT";
36
+ readonly TOGGLE_COLUMN_VISIBILITY: "TOGGLE_COLUMN_VISIBILITY";
37
+ readonly TOGGLE_MASTER_DETAIL: "TOGGLE_MASTER_DETAIL";
38
+ readonly SET_DETAIL_RENDERER: "SET_DETAIL_RENDERER";
39
+ readonly SET_MASTER_DETAIL_CONFIG: "SET_MASTER_DETAIL_CONFIG";
40
+ readonly ADD_EVENT_LISTENER: "ADD_EVENT_LISTENER";
41
+ readonly REMOVE_EVENT_LISTENER: "REMOVE_EVENT_LISTENER";
42
+ readonly TOGGLE_COLUMN_GROUP: "TOGGLE_COLUMN_GROUP";
43
+ readonly SET_EXPANDED_COLUMN_GROUPS: "SET_EXPANDED_COLUMN_GROUPS";
44
+ readonly ENABLE_ROW_SPAN: "ENABLE_ROW_SPAN";
45
+ readonly SET_ROW_SPAN_COLUMN: "SET_ROW_SPAN_COLUMN";
46
+ readonly MOVE_ROW: "MOVE_ROW";
47
+ readonly PREVIEW_ROW_MOVE: "PREVIEW_ROW_MOVE";
48
+ readonly RESET_ROW_PREVIEW: "RESET_ROW_PREVIEW";
49
+ readonly SET_PINNED_TOP_ROWS: "SET_PINNED_TOP_ROWS";
50
+ readonly SET_PINNED_BOTTOM_ROWS: "SET_PINNED_BOTTOM_ROWS";
51
+ readonly TOGGLE_ROW_GROUP: "TOGGLE_ROW_GROUP";
52
+ readonly LOAD_ROW_GROUP_DATA: "LOAD_ROW_GROUP_DATA";
53
+ readonly SET_ROW_GROUP_DATA: "SET_ROW_GROUP_DATA";
54
+ readonly SET_ROW_GROUP_LOADING: "SET_ROW_GROUP_LOADING";
55
+ readonly SET_ROW_GROUP_PAGINATION: "SET_ROW_GROUP_PAGINATION";
56
+ readonly CLEAR_ROW_GROUP_CACHE: "CLEAR_ROW_GROUP_CACHE";
57
+ readonly REFRESH_ROW_GROUP_DATA: "REFRESH_ROW_GROUP_DATA";
58
+ readonly SET_API: "SET_API";
59
+ readonly SET_COLUMN_MAP: "SET_COLUMN_MAP";
60
+ readonly SET_NUMBER_FORMAT: "SET_NUMBER_FORMAT";
61
+ readonly SET_HEADER_ROW_HEIGHT: "SET_HEADER_ROW_HEIGHT";
62
+ readonly CLEANUP_TABLE_RESOURCES: "CLEANUP_TABLE_RESOURCES";
63
+ readonly ADD_TABLE_INSTANCE: "ADD_TABLE_INSTANCE";
64
+ readonly ROW_DRAG_MANAGED: "ROW_DRAG_MANAGED";
65
+ readonly INFINITE_SCROLL: "INFINITE_SCROLL";
66
+ readonly SET_INITIAL_EXPANDED_COLUMN_GROUPS: "SET_INITIAL_EXPANDED_COLUMN_GROUPS";
67
+ readonly SET_SERVER_SIDE: "SET_SERVER_SIDE";
68
+ readonly SET_TABLE_API: "SET_TABLE_API";
69
+ readonly EXPAND_COLLAPSE_ALL_COLUMNS: "EXPAND_COLLAPSE_ALL_COLUMNS";
70
+ readonly SET_SMART_GRID_MENU_OPTIONS: "SET_SMART_GRID_MENU_OPTIONS";
71
+ readonly ROW_GROUP_CACHE_ENABLE: "ROW_GROUP_CACHE_ENABLE";
72
+ readonly DETAIL_RENDERER_TABLE: "DETAIL_RENDERER_TABLE";
73
+ readonly IS_SAVE_VIEW_ENABLED: "IS_SAVE_VIEW_ENABLED";
74
+ readonly SAVE_VIEW_CALLBACKS: "SAVE_VIEW_CALLBACKS";
75
+ readonly SET_ROW_HEIGHT: "SET_ROW_HEIGHT";
76
+ readonly EXPAND_COLLAPSE_ALL_ROWS: "EXPAND_COLLAPSE_ALL_ROWS";
77
+ readonly SET_LOADING: "SET_LOADING";
78
+ readonly SET_REFS: "SET_REFS";
79
+ readonly SET_TABLE_ID: "SET_TABLE_ID";
80
+ readonly SET_IS_SINGLE_SELECT: "SET_IS_SINGLE_SELECT";
81
+ readonly SET_DEFAULT_COL_DEF: "SET_DEFAULT_COL_DEF";
82
+ readonly SET_SELECTABLE: "SET_SELECTABLE";
83
+ readonly SET_DISABLE_SELECT_ALL_RECORDS_OPTION: "SET_DISABLE_SELECT_ALL_RECORDS_OPTION";
84
+ readonly SET_COLUMN_BUFFER_SIZE: "SET_COLUMN_BUFFER_SIZE";
85
+ readonly SET_LAZY_LOAD_CELL_RENDERER: "SET_LAZY_LOAD_CELL_RENDERER";
86
+ readonly SET_HAS_SPLIT_RENDERER: "SET_HAS_SPLIT_RENDERER";
87
+ readonly SET_HAS_SPLIT_RENDERER_KEYS: "SET_HAS_SPLIT_RENDERER_KEYS";
88
+ readonly SET_REMOVE_SELECTION_ON_OPERATION: "SET_REMOVE_SELECTION_ON_OPERATION";
89
+ };
90
+
91
+ declare class InfiniteBlock {
92
+ static STATE_WAITING_TO_LOAD: string;
93
+ static STATE_LOADING: string;
94
+ static STATE_LOADED: string;
95
+ static STATE_FAILED: string;
96
+ static MAX_EMPTY_BLOCKS_TO_KEEP: number;
97
+ id: number;
98
+ parentCache: SmartGridInfiniteCacheInterface;
99
+ parent: SmartGridInfiniteCacheInterface;
100
+ params: SmartGridBlockParams;
101
+ state: string;
102
+ version: number;
103
+ lastAccessed: number;
104
+ rows: Record<number, SmartGridRowData>;
105
+ infiniteCache: SmartGridInfiniteCacheInterface;
106
+ startRow: number;
107
+ endRow: number;
108
+ rowNodes: SmartGridBlockRowNode[];
109
+ loadStartedAt?: number;
110
+ _targetPage?: number;
111
+ _responseMetadata?: SmartGridResponseMetadata;
112
+ _processingInProgress?: boolean;
113
+ _actualRowCount?: number;
114
+ _inactiveForPageTransition?: boolean;
115
+ constructor(id: number, parentCache: SmartGridInfiniteCacheInterface, params: SmartGridBlockParams);
116
+ /**
117
+ * Create empty row nodes
118
+ */
119
+ createRowNodes(): void;
120
+ /**
121
+ * Gets the block ID
122
+ */
123
+ getId(): number;
124
+ /**
125
+ * Gets the current state of the block
126
+ */
127
+ getState(): string;
128
+ /**
129
+ * Gets the start row index of this block
130
+ */
131
+ getStartRow(): number;
132
+ /**
133
+ * Gets the end row index of this block
134
+ */
135
+ getEndRow(): number;
136
+ /**
137
+ * Gets the current version of this block
138
+ * Used to ignore responses from outdated requests
139
+ */
140
+ getVersion(): number;
141
+ /**
142
+ * Gets the last time this block was accessed
143
+ * Used for LRU cache management
144
+ */
145
+ getLastAccessed(): number;
146
+ /**
147
+ * Gets a row node at the specified index
148
+ * Updates the last accessed time for LRU cache management
149
+ */
150
+ getRow(rowIndex: number, dontTouchLastAccessed?: boolean): SmartGridBlockRowNode | null;
151
+ /**
152
+ * Load data from datasource
153
+ */
154
+ loadFromDatasource(): void;
155
+ /**
156
+ * Process the response from the server
157
+ */
158
+ processServerResponse(rows: SmartGridRowData[], lastRow?: number, lastRowIndexKnown?: boolean): void;
159
+ /**
160
+ * Initialize block from server response
161
+ */
162
+ initBlockFromServerResponse(rows: SmartGridRowData[]): void;
163
+ /**
164
+ * Sets data and ID for a row node
165
+ */
166
+ setDataAndId(rowNode: SmartGridBlockRowNode, data: SmartGridRowData, rowIndex: number): void;
167
+ /**
168
+ * Set state to waiting to load
169
+ */
170
+ setStateWaitingToLoad(): void;
171
+ /**
172
+ * Iterates through each row node
173
+ */
174
+ forEachNode(callback: (rowNode: SmartGridBlockRowNode, index: number) => void): void;
175
+ /**
176
+ * Returns block state as JSON for debugging
177
+ */
178
+ getBlockStateJson(): SmartGridBlockStateJson;
179
+ /**
180
+ * Clean up row nodes before the block is destroyed
181
+ */
182
+ destroyRowNodes(): void;
183
+ /**
184
+ * Determines the index of the last row that has data
185
+ */
186
+ getLastRow(): number;
187
+ isBlockBeyondEndOfScope(): boolean;
188
+ getRowNode(rowIndex: number): SmartGridBlockRowNode | null;
189
+ pageLoaded(version: number): void;
190
+ loadFailed(version?: number): void;
191
+ getRowNodes(): SmartGridBlockRowNode[];
192
+ /**
193
+ * Gets the number of rows in this block that have data
194
+ */
195
+ getRowCount(): number;
196
+ }
197
+
198
+ declare class InfiniteCache {
199
+ static PURGE_STRATEGY_LRU: string;
200
+ static PURGE_STRATEGY_FURTHEST_FROM_VIEWPORT: string;
201
+ static PURGE_STRATEGY_MEMORY_OPTIMIZED: string;
202
+ params: SmartGridCacheParams;
203
+ blocks: Record<number, InfiniteBlock>;
204
+ blockCount: number;
205
+ rowCount: number;
206
+ lastRowIndexKnown: boolean;
207
+ eventListeners: Record<string, Array<(event: SmartGridCacheEvent) => void>>;
208
+ lastRequestedPage: number;
209
+ analytics: SmartGridCacheAnalytics_2;
210
+ rowsMaxIndex?: number;
211
+ _currentRequestedPage?: number;
212
+ _blockCreationQueue?: Set<number>;
213
+ constructor(params: Partial<SmartGridCacheParams>);
214
+ /**
215
+ * Gets a row at a specific index, creating blocks as needed
216
+ */
217
+ getRow(rowIndex: number, dontCreateBlock?: boolean): SmartGridBlockRowNode | undefined;
218
+ /**
219
+ * Creates a new block to manage a range of rows
220
+ */
221
+ createBlock(blockId: number): InfiniteBlock;
222
+ /**
223
+ * Get row indexes for a specific block
224
+ */
225
+ getRowIndexesForBlock(blockId: number): number[];
226
+ /**
227
+ * Notify about block state changes
228
+ */
229
+ notifyBlockStateChanged(blockId: number, state: string, rowIndexes: number[]): void;
230
+ /**
231
+ * Gets a block by ID
232
+ */
233
+ getBlock(blockId: number): InfiniteBlock | undefined;
234
+ /**
235
+ * Gets the current row count
236
+ */
237
+ getRowCount(): number;
238
+ /**
239
+ * Checks if total row count is known or virtual
240
+ */
241
+ isLastRowIndexKnown(): boolean;
242
+ /**
243
+ * Sets the row count and updates lastRowIndexKnown flag
244
+ */
245
+ setRowCount(rowCount: number, lastRowIndexKnown?: boolean): void;
246
+ /**
247
+ * Count the total number of rows with data across all blocks in the cache
248
+ */
249
+ getTotalCachedRowCount(): {
250
+ totalRows: number;
251
+ rowsWithData: number;
252
+ blockCount: number;
253
+ blocksWithData: Array<{
254
+ blockId: number;
255
+ rowCount: number;
256
+ }>;
257
+ };
258
+ /**
259
+ * Callback for when a block finishes loading
260
+ */
261
+ pageLoaded(block: InfiniteBlock, lastRow?: number): void;
262
+ /**
263
+ * Print all cached data from all blocks
264
+ * Shows a complete snapshot of what's actually in the cache
265
+ */
266
+ printAllCachedData(): void;
267
+ /**
268
+ * Check and update row count based on loaded block data
269
+ */
270
+ checkRowCount(block: InfiniteBlock, lastRow: number | boolean | null): void;
271
+ /**
272
+ * Gets all blocks in the cache, sorted by ID
273
+ */
274
+ getBlocksInOrder(): InfiniteBlock[];
275
+ /**
276
+ * Removes expired blocks from the cache using configured strategy
277
+ */
278
+ purgeBlocksIfNeeded(blockToExclude: InfiniteBlock): void;
279
+ /**
280
+ * Sorts blocks based on the specified strategy
281
+ */
282
+ sortBlocksByStrategy(blocks: InfiniteBlock[], strategy: string): InfiniteBlock[];
283
+ /**
284
+ * Compares two blocks based on the specified strategy
285
+ * Returns a negative number if a should be removed before b
286
+ */
287
+ compareBlocksByStrategy(a: InfiniteBlock, b: InfiniteBlock, strategy: string): number;
288
+ /**
289
+ * Sort blocks by distance from viewport (for furthest-from-viewport strategy)
290
+ */
291
+ sortBlocksByDistanceFromViewport(blocks: InfiniteBlock[]): void;
292
+ /**
293
+ * Sort blocks using the memory-optimized strategy
294
+ * This uses a combined heuristic considering:
295
+ * 1. Block access recency
296
+ * 2. Distance from viewport
297
+ * 3. Block data size (if available)
298
+ */
299
+ sortBlocksByMemoryOptimized(blocks: InfiniteBlock[]): void;
300
+ /**
301
+ * Checks if a block is currently in the visible viewport
302
+ */
303
+ isBlockCurrentlyDisplayed(block: InfiniteBlock): boolean;
304
+ /**
305
+ * Removes a block from the cache and destroys it
306
+ */
307
+ removeBlockFromCache(blockToRemove: InfiniteBlock): void;
308
+ /**
309
+ * Gets all row nodes in a range (used for selection)
310
+ */
311
+ getRowNodesInRange(firstIndex: number, lastIndex: number): SmartGridBlockRowNode[];
312
+ /**
313
+ * Iterates over all row nodes in the cache
314
+ */
315
+ forEachNodeDeep(callback: (rowNode: SmartGridBlockRowNode, index: number) => void): void;
316
+ /**
317
+ * Purges the entire cache
318
+ */
319
+ purgeCache(options?: Record<string, unknown>): void;
320
+ /**
321
+ * Refreshes the cache without purging it completely
322
+ */
323
+ refreshCache(): void;
324
+ /**
325
+ * Refreshes the cache partially, preserving specified fields
326
+ */
327
+ refreshCachePartial(preserveFields?: string[]): void;
328
+ /**
329
+ * Sets view port range
330
+ */
331
+ setViewportRange(startRow: number, endRow: number): void;
332
+ /**
333
+ * Returns all data from all blocks as a flattened array
334
+ */
335
+ /**
336
+ * Ensures blocks are loaded for the specified range
337
+ */
338
+ ensureBlocksLoadedForRange(startRow: number, endRow: number): void;
339
+ /**
340
+ * Adds an event listener
341
+ */
342
+ addEventListener(type: string, listener: (event: SmartGridCacheEvent) => void): void;
343
+ /**
344
+ * Removes an event listener
345
+ */
346
+ removeEventListener(type: string, listener: (event: SmartGridCacheEvent) => void): void;
347
+ /**
348
+ * Dispatches an event to all listeners
349
+ */
350
+ dispatchEvent(event: SmartGridCacheEvent): void;
351
+ /**
352
+ * Returns cache state for debugging
353
+ */
354
+ getCacheState(): SmartGridCacheState;
355
+ /**
356
+ * Returns analytics data
357
+ */
358
+ getAnalytics(): SmartGridCacheAnalytics_2 & {
359
+ uptime: number;
360
+ hitRatio: number;
361
+ avgLoadTime: number;
362
+ hitsPerSecond: number;
363
+ missesPerSecond: number;
364
+ blocksPurgedPerSecond: number;
365
+ bytesPerSecond: number;
366
+ };
367
+ /**
368
+ * Resets analytics data
369
+ */
370
+ resetAnalytics(): void;
371
+ /**
372
+ * Save cache state to persistence if enabled
373
+ */
374
+ persistCacheIfEnabled(): void;
375
+ /**
376
+ * Restore cache from persistence
377
+ */
378
+ restoreFromPersistence(): void;
379
+ /**
380
+ * Clear persisted cache state
381
+ */
382
+ clearPersistence(): void;
383
+ /**
384
+ * Sets the purge strategy
385
+ */
386
+ setPurgeStrategy(strategy: string): void;
387
+ isBlockInCreationQueue(blockId: number): boolean;
388
+ /**
389
+ * Logs a summary of the current cache state
390
+ * Can be called from outside to check the cache status at any time
391
+ */
392
+ logCacheSummary(): {
393
+ totalRows: number;
394
+ rowsWithData: number;
395
+ blockCount: number;
396
+ blocksWithData: Array<{
397
+ blockId: number;
398
+ rowCount: number;
399
+ }>;
400
+ };
401
+ isBlockCached(blockId: number): boolean;
402
+ getBlockData(blockId: number): (SmartGridRowData | null)[] | null;
403
+ getAllCachedData(): SmartGridRowData[];
404
+ updatePageData(pageNo: number, updatedData: SmartGridRowData[], notifyChanges?: boolean, options?: Record<string, unknown>): {
405
+ success: boolean;
406
+ pageNo: number;
407
+ updatedRows: number;
408
+ errors: string[];
409
+ };
410
+ updateBlockData(blockId: number, newData: SmartGridRowData[], notifyChanges?: boolean): {
411
+ success: boolean;
412
+ blockId: number;
413
+ updatedRows: number;
414
+ errors: string[];
415
+ };
416
+ updateWholeData(wholeData: SmartGridRowData[], pageSize: number): SmartGridUpdateDataReturnType;
417
+ }
418
+
419
+ export declare const PivotWrapper: React.FC<SmartGridPivotWrapperProps>;
420
+
421
+ declare interface RowGroupParams {
422
+ page: number;
423
+ pageSize: number;
424
+ groupId?: string;
425
+ noDataUpdate?: boolean;
426
+ }
427
+
428
+ export declare type SmartGridAggregationType = "sum" | "count" | "avg" | "min" | "max";
429
+
430
+ declare interface SmartGridAPI {
431
+ getInfiniteRowModel: () => SmartGridInfiniteRowModel | null;
432
+ getInfiniteCache: () => SmartGridInfiniteCache | null;
433
+ getModel: () => SmartGridTableModel;
434
+ onCellValueChanged: (params: SmartGridCellValueChangedParams) => void;
435
+ getPrevAction: () => string;
436
+ setPrevAction: (value: string) => void;
437
+ getCheckConfiguration: () => SmartGridCheckConfiguration[];
438
+ setCheckConfiguration: (config: SmartGridCheckConfiguration[]) => void;
439
+ addToCheckConfiguration: (item: SmartGridCheckConfiguration) => void;
440
+ getIsSelectAllRecords: () => boolean;
441
+ setIsSelectAllRecords: (value: boolean) => void;
442
+ getSelectedRows: () => SmartGridRowData[];
443
+ setSelectedRows: (rowIds: (string | number)[]) => void;
444
+ clearSelection: () => void;
445
+ selectAll: () => void;
446
+ refreshCells: () => void;
447
+ getCache: () => SmartGridInfiniteCache | null;
448
+ getCacheState: () => SmartGridCacheState_2 | null;
449
+ getInfiniteCacheInstance: () => SmartGridInfiniteCache | null;
450
+ refreshServerSideStore: (options?: SmartGridRefreshOptions) => void;
451
+ getCachedBlockData: () => SmartGridCachedBlockData;
452
+ logCacheSummary: () => void | null;
453
+ getCachedRowById: (id: string | number) => SmartGridRowData | null;
454
+ getRowNode: (key: string | number) => Partial<SmartGridRowNode> | null;
455
+ setVisibleRange: (startRow: number, endRow: number) => void;
456
+ refreshCache: (options?: SmartGridRefreshOptions) => boolean;
457
+ deselectAll: () => void;
458
+ getRenderedNodes: () => SmartGridDisplayedRowNode[];
459
+ gridOptionsWrapper: {
460
+ gridOptions: SmartGridOptions;
461
+ };
462
+ getDisplayedRowAtIndex: (index: number, wholeData?: SmartGridRowData[], api?: Partial<SmartGridAPI>) => SmartGridDisplayedRowAtIndex | null;
463
+ getTableWidth: () => number;
464
+ sizeColumnsToFit: () => void;
465
+ setRowData: (newData: SmartGridRowData[]) => boolean | void;
466
+ forEachNode: (callback: (node: SmartGridRowNode, index: number) => void) => void;
467
+ getColumnDefs: () => SmartGridColumnDefinition[];
468
+ getAllColumns: () => SmartGridColumnDefinition[];
469
+ setColumnDefs: (newColumns: SmartGridColumnDefinition) => void;
470
+ addEventListener: (event: string, listener: Function, once?: boolean) => void;
471
+ removeEventListener: (event: string, listener: Function) => void;
472
+ getPinnedTopRow: () => SmartGridRowData[] | null;
473
+ setPinnedTopRowData: (rows: SmartGridRowData[]) => void;
474
+ getPinnedBottomRow: () => SmartGridRowData[] | null;
475
+ setPinnedBottomRowData: (rows: SmartGridRowData[]) => void;
476
+ getRowData: (params: SmartGridGetRowDataParams, columnName: string) => string | number | boolean;
477
+ tableId: string;
478
+ getFocusedCell: () => SmartGridFocusedCell | null;
479
+ getSelectedCells: () => SmartGridSelectedCell[];
480
+ getAllDisplayedColumns: () => SmartGridDisplayedColumn[];
481
+ getDisplayedRowCount: () => number;
482
+ setFocusedCell: (rowIndex: number, colKey: SmartGridColumnDefinition | string | number) => boolean;
483
+ ensureColumnVisible: (colKey: SmartGridColumnDefinition | string | number) => boolean;
484
+ getColumnByField: (fieldName: string) => SmartGridColumnDefinition | null;
485
+ getTableInstance: () => SmartGridTableInstance | undefined;
486
+ getFilterModel: () => SmartGridFilterModel | Record<string, SmartGridFilterModel[]>;
487
+ setFilterModel: (field: string, rules: SmartGridFilterModel) => void;
488
+ getTableDispatcher: () => (action: SmartGridDisptach) => void;
489
+ getTableStateContext: () => SmartGridStateContext;
490
+ showNotification: (notification: SmartGridNotification) => void;
491
+ hideNotification: () => void;
492
+ applySearch: () => void;
493
+ getCurrentPageData: () => SmartGridRowData[];
494
+ getWholeTableData: () => SmartGridRowData[];
495
+ flashCells: () => void;
496
+ redrawRows: () => void;
497
+ refreshClientSideRowModel: () => void;
498
+ resetRecentSearchChanges: () => void;
499
+ onFilterChanged: () => void;
500
+ onRowDataChanged?: (params: any) => void;
501
+ getRowGroupState?: () => SmartGridRowGroupState;
502
+ setRowGroupLoading?: (groupId: string, isLoading: boolean) => void;
503
+ setRowGroupPagination?: (groupId: string, pagination: SmartGridRowGroupStatePagination) => void;
504
+ setRowGroupData?: (groupId: string, data: SmartGridRowData[], append?: boolean) => void;
505
+ rowRenderer?: {
506
+ firstRenderedRow: number;
507
+ lastRenderedRow: number;
508
+ setRenderedRange: (start: number, end: number) => void;
509
+ };
510
+ columnApi?: SmartGridAPI;
511
+ dispatchEvent?: (eventType: string, eventData: Record<string, unknown>) => void;
512
+ toggleRowGroup?: (groupId: string, rowIndex: number, { fieldName, value }: {
513
+ fieldName: string;
514
+ value: unknown;
515
+ }) => void;
516
+ setServerSideDataSource: (dataSource: SmartGridServerSideDataSource, resetCache?: boolean) => void;
517
+ updateSmartGridTableData: (wholeData: SmartGridRowData[]) => void;
518
+ downloadSmartGridExcel: (fileName?: string, visibleOnly?: boolean) => void;
519
+ downloadSmartGridCSV: (fileName?: string, visibleOnly?: boolean) => void;
520
+ }
521
+
522
+ declare interface SmartGridBaseColumnDefinition {
523
+ field?: string;
524
+ groupId?: string;
525
+ headerName?: string;
526
+ column_name?: string;
527
+ label?: string;
528
+ width?: number;
529
+ minWidth?: number;
530
+ maxWidth?: number;
531
+ hide?: boolean;
532
+ hidden?: boolean;
533
+ pinned?: SmartGridFrozenState;
534
+ is_frozen?: boolean;
535
+ children?: SmartGridColumnDefinition[];
536
+ parent_id?: (string | number)[];
537
+ type?: string;
538
+ cellDataType?: string;
539
+ valueFormatter?: ((params: SmartGridValueFormatterParams) => string) | SmartGridValueFormatterConfig | undefined;
540
+ valueGetter?: (params: SmartGridValueGetterParams) => unknown;
541
+ leftTotalWidth?: number;
542
+ originalWidth?: number;
543
+ defaultWidth?: number;
544
+ isAutoWidth?: boolean;
545
+ filterable?: boolean;
546
+ isSortable?: boolean;
547
+ is_sortable?: boolean;
548
+ resizable?: boolean;
549
+ align?: "left" | "center" | "right";
550
+ cellRenderer?: string | ((params: SmartGridCellRenderer) => JSX.Element);
551
+ cellRendererParams?: SmartGridCellRendererParams;
552
+ cellClassName?: string;
553
+ cellStyle?: {
554
+ textAlign?: "left" | "center" | "right";
555
+ [key: string]: unknown;
556
+ };
557
+ autoHeight?: boolean;
558
+ wrapHeaderText?: boolean;
559
+ editable?: boolean;
560
+ is_editable?: boolean;
561
+ is_disabled?: boolean;
562
+ is_searchable?: boolean;
563
+ isSearchable?: boolean;
564
+ advanceSearchEnabled?: boolean;
565
+ sortable?: boolean;
566
+ rowGroup?: boolean;
567
+ enableRowGroup?: boolean;
568
+ rowGroupIndex?: number;
569
+ aggFunc?: string;
570
+ columnGroupShow?: "open" | "closed" | undefined | null;
571
+ originalIndex?: number;
572
+ parentColumns?: string[];
573
+ hasChildren?: boolean;
574
+ hasAnyFrozenChildren?: boolean;
575
+ hasAnyRightPinnedChildren?: boolean;
576
+ isChildWithoutParent?: boolean;
577
+ colorClass?: string;
578
+ isLeaf?: boolean;
579
+ isStandalone?: boolean;
580
+ isWithEmptyHeaderName?: boolean;
581
+ isParentWithChildEmptyHeaderName?: boolean;
582
+ path?: string[];
583
+ pathIdentifier?: string;
584
+ parentField?: string | null;
585
+ value?: string | number;
586
+ dimension_type?: string;
587
+ originalFields?: string[];
588
+ colId?: string;
589
+ colSpan?: number;
590
+ rowSpan?: number;
591
+ comparator?: (valueA: unknown, valueB: unknown, nodeA: SmartGridRowData, nodeB: SmartGridRowData, sortModel: SmartGridSortModel | SmartGridSortModel[]) => number;
592
+ headerTooltip?: string;
593
+ filter?: string | boolean;
594
+ filterParams?: {
595
+ filterOptions?: string[];
596
+ textCustomComparator?: (filter: string, value: unknown, filterText: string) => boolean;
597
+ numberCustomComparator?: (filter: number, value: unknown) => boolean;
598
+ dateCustomComparator?: (filterLocalDateAtMidnight: Date, cellValue: string) => number;
599
+ comparator?: (filterValue: unknown, cellValue: unknown) => boolean;
600
+ [key: string]: unknown;
601
+ };
602
+ order_of_display?: number;
603
+ is_hidden?: boolean;
604
+ formatter?: string | null;
605
+ accessor?: string;
606
+ id?: string;
607
+ required?: boolean;
608
+ sub_headers?: SmartGridColumnDefinition[];
609
+ extra?: {
610
+ width?: number;
611
+ is_grouping_key?: boolean;
612
+ is_disabled?: boolean;
613
+ isDisabled?: boolean;
614
+ columnGroupShow?: "open" | "closed";
615
+ is_multi?: boolean;
616
+ options_column?: string;
617
+ aggregation_func?: SmartGridSelectOption[];
618
+ [key: string]: unknown;
619
+ };
620
+ headerComponent?: default_2.FC<SmartGridHeaderStyleParams>;
621
+ headerStyle?: (params: SmartGridHeaderStyleParams) => CSSProperties;
622
+ tooltipValueGetter?: (params: SmartGridTooltipGetterParams) => string;
623
+ cellRendererLazyType?: string;
624
+ originalPath?: string[] | null;
625
+ isReorderedColumn?: boolean | null;
626
+ processCellForClipboard?: (params: SmartGridCellRendererParams) => string;
627
+ pivotAggregation?: "sum" | "count" | "avg" | "min" | "max";
628
+ pivotFilterValue?: string;
629
+ pivotFilterMode?: "value" | "condition";
630
+ pivotFilterCondition?: string;
631
+ [key: string]: unknown;
632
+ }
633
+
634
+ /** Block context */
635
+ declare interface SmartGridBlockContext {
636
+ updateData?: (rows: SmartGridRowData[], blockId: number, metadata?: SmartGridResponseMetadata) => void;
637
+ tableContextRef?: {
638
+ current?: {
639
+ state?: {
640
+ expandedChildRows?: Record<string, {
641
+ childRowsCount: number;
642
+ }>;
643
+ };
644
+ };
645
+ };
646
+ infiniteCache?: SmartGridInfiniteCacheInterface;
647
+ [key: string]: unknown;
648
+ }
649
+
650
+ /** Datasource interface */
651
+ declare interface SmartGridBlockDatasource {
652
+ getRows: (params: SmartGridDatasourceGetRowsParams) => void;
653
+ }
654
+
655
+ /** Block params */
656
+ declare interface SmartGridBlockParams {
657
+ updatedPageSizeRef: SmartGridPageSizeRef_2;
658
+ pageSize?: number;
659
+ lastAccessedSequence: SmartGridLastAccessedSequence_2;
660
+ datasource?: SmartGridBlockDatasource;
661
+ sortModel?: SmartGridSortModel;
662
+ filterModel?: SmartGridFilterModel;
663
+ context?: SmartGridBlockContext;
664
+ loadSequentially?: boolean;
665
+ _directPaginationRequest?: boolean;
666
+ isPaginationMode?: boolean;
667
+ _targetPage?: number;
668
+ tableId: string;
669
+ }
670
+
671
+ /** Row node in a block */
672
+ declare interface SmartGridBlockRowNode {
673
+ id: number;
674
+ data: SmartGridRowData | null;
675
+ rowIndex: number;
676
+ rowHeight?: number;
677
+ rowTop?: number;
678
+ }
679
+
680
+ /** Block state change callback */
681
+ declare type SmartGridBlockStateChangedCallback = (blockId: number, state: string, rowIndexes: number[]) => void;
682
+
683
+ /** Block state JSON */
684
+ declare interface SmartGridBlockStateJson {
685
+ id: number;
686
+ state: string;
687
+ startRow: number;
688
+ endRow: number;
689
+ version: number;
690
+ lastAccessed: number;
691
+ }
692
+
693
+ /** Block state JSON from getBlockStateJson */
694
+ declare interface SmartGridBlockStateJsonExtended {
695
+ id: number;
696
+ state: string;
697
+ startRow: number;
698
+ endRow: number;
699
+ version: number;
700
+ lastAccessed: number;
701
+ }
702
+
703
+ declare type SmartGridCacheAnalytics = {
704
+ blockEvictions: number;
705
+ blockLoadTimestamps: number[];
706
+ blockLoads: number;
707
+ bytesLoaded: number;
708
+ cachePurges: number;
709
+ cacheRefreshes: number;
710
+ hits: number;
711
+ lastBlockLoadTime: number;
712
+ misses: number;
713
+ startTime: number;
714
+ totalBlockLoadTime: number;
715
+ };
716
+
717
+ /** Cache analytics */
718
+ declare interface SmartGridCacheAnalytics_2 {
719
+ hits: number;
720
+ misses: number;
721
+ blockLoads: number;
722
+ blockEvictions: number;
723
+ totalBlockLoadTime: number;
724
+ lastBlockLoadTime: number;
725
+ bytesLoaded: number;
726
+ startTime: number;
727
+ blockLoadTimestamps: Array<{
728
+ blockId: number;
729
+ timestamp: number;
730
+ loadTime: number;
731
+ }>;
732
+ cachePurges: number;
733
+ cacheRefreshes: number;
734
+ }
735
+
736
+ declare interface SmartGridCacheAnalyticsData {
737
+ hitRatio: number;
738
+ hits: number;
739
+ misses: number;
740
+ blockLoads: number;
741
+ blockEvictions: number;
742
+ }
743
+
744
+ declare type SmartGridCacheBlock = {
745
+ endRow: number;
746
+ id: number;
747
+ infiniteCache: SmartGridInfiniteCache;
748
+ lastAccessed: number;
749
+ loadStartedAt: number;
750
+ params: SmartGridCacheBlockParams;
751
+ parent: SmartGridInfiniteCache | null;
752
+ parentCache: SmartGridInfiniteCache | null;
753
+ rowNodes: {
754
+ data: SmartGridRowData;
755
+ id: number;
756
+ rowIndex: number;
757
+ }[];
758
+ rows: unknown;
759
+ startRow: number;
760
+ state: string;
761
+ version: number;
762
+ _inactiveForPageTransition: boolean;
763
+ _processingInProgress: boolean;
764
+ _targetPage: number;
765
+ };
766
+
767
+ declare type SmartGridCacheBlockParams = Record<string, unknown>;
768
+
769
+ /** Cache context */
770
+ declare interface SmartGridCacheContext {
771
+ tableContextRef?: MutableRefObject<SmartGridTableContextValue | null>;
772
+ infiniteCache?: InfiniteCache;
773
+ updateData?: (rows: SmartGridRowData[], blockId: number, metadata?: Record<string, unknown> | undefined) => void;
774
+ }
775
+
776
+ declare interface SmartGridCachedBlockData {
777
+ [blockId: string]: SmartGridRowData[];
778
+ }
779
+
780
+ /** Cache event */
781
+ declare interface SmartGridCacheEvent {
782
+ type: string;
783
+ blockId?: number;
784
+ source?: string;
785
+ options?: Record<string, unknown>;
786
+ pageNo?: number;
787
+ }
788
+
789
+ declare type SmartGridCacheMetadata = {
790
+ lastUpdated: number;
791
+ timestamp?: number;
792
+ };
793
+
794
+ /** Cache params */
795
+ declare interface SmartGridCacheParams {
796
+ overflowSize: number;
797
+ maxBlocksInCache: number;
798
+ initialRowCount: number;
799
+ rowHeight: number;
800
+ lastAccessedSequence: SmartGridLastAccessedSequence;
801
+ uniqueIdField: string;
802
+ onBlockStateChanged: SmartGridBlockStateChangedCallback | null;
803
+ purgeStrategy: string;
804
+ enablePersistence: boolean;
805
+ persistenceStorageKey: string;
806
+ persistenceOptions: SmartGridPersistenceOptions;
807
+ isPaginationMode: boolean;
808
+ datasource?: SmartGridClientSideDatasource | SmartGridServerSideDatasource;
809
+ filterModel?: SmartGridSearchWithSearchKey;
810
+ sortModel?: SmartGridSortModel;
811
+ context?: SmartGridCacheContext;
812
+ updatedPageSizeRef?: SmartGridPageSizeRef;
813
+ viewportRange?: SmartGridViewportRange;
814
+ tableId?: string;
815
+ pageSize?: number;
816
+ loadSequentially?: boolean;
817
+ }
818
+
819
+ /** Cache state for debugging */
820
+ declare interface SmartGridCacheState {
821
+ blockCount: number;
822
+ rowCount: number;
823
+ lastRowIndexKnown: boolean;
824
+ blocks: SmartGridBlockStateJsonExtended[];
825
+ analytics: SmartGridCacheAnalytics_2;
826
+ }
827
+
828
+ declare interface SmartGridCacheState_2 {
829
+ blockCount: number;
830
+ cache?: SmartGridInfiniteCache;
831
+ lastRowKnown: boolean;
832
+ rowCount: number;
833
+ status: string;
834
+ }
835
+
836
+ declare interface SmartGridCacheStateReturn {
837
+ cache: unknown;
838
+ rowCount: number;
839
+ lastRowKnown: boolean;
840
+ blockCount: number;
841
+ status: string;
842
+ }
843
+
844
+ declare interface SmartGridCallbackRefCurrent {
845
+ onSelectionChanged?: ((event: SmartGridOnSelectionChangedParams) => void) | undefined;
846
+ onRowDragStart?: ((event: SmartGridRowDragStartParams) => void) | null;
847
+ onRowDragEnd?: ((event: SmartGridRowDragEndParams) => void) | null;
848
+ onRowClicked?: ((event: unknown) => void) | null;
849
+ onCellValueChanged?: ((event: SmartGridCellValueChangedParams) => void) | null;
850
+ onRowGroupOpened?: ((event: SmartGridRowGrouOpenParams) => void) | null;
851
+ customTabFunction?: ((e: KeyboardEvent, column: SmartGridColumnDefinition, context: {
852
+ api: SmartGridAPI | null;
853
+ }) => void) | null;
854
+ onPageChange?: ((page: number) => void) | null;
855
+ onSortChange?: ((sortModel: SmartGridSortModel) => void) | null;
856
+ onFilterChange?: ((filterModel: SmartGridFilterModel) => void) | null;
857
+ onSearch?: ((searchTerm: SmartGridSearchFunctionParams) => void) | null;
858
+ }
859
+
860
+ declare type SmartGridCellRenderer = {
861
+ value: unknown;
862
+ data: SmartGridRowData;
863
+ rowIndex: number;
864
+ colIndex: number;
865
+ column: SmartGridColumnDefinition;
866
+ colDef: SmartGridColumnDefinition;
867
+ node: SmartGridCellRendererNode;
868
+ api: SmartGridAPI;
869
+ eGridCell: HTMLDivElement | null;
870
+ wholeData: SmartGridRowData[] | null | undefined;
871
+ actions: Record<string, unknown>;
872
+ setDataValue: (colId: string, newValue: unknown) => void;
873
+ isCellLockable?: boolean;
874
+ };
875
+
876
+ declare type SmartGridCellRendererNode = {
877
+ data: SmartGridRowData;
878
+ rowIndex: number;
879
+ id: string | number;
880
+ parent: SmartGridUpdateData & {
881
+ id: string | number;
882
+ level: number;
883
+ setExpanded: () => void;
884
+ };
885
+ setDataValue: (colId: string, newValue: unknown) => void;
886
+ childrenMapped: Record<string, string>;
887
+ allLeafChildren: Record<string, string>[];
888
+ group: boolean;
889
+ level: number;
890
+ childIndex: number;
891
+ isSelected: () => boolean;
892
+ isExpandable: () => boolean;
893
+ isExpanded: () => boolean;
894
+ };
895
+
896
+ declare type SmartGridCellRendererParams = {
897
+ dateFormat?: SmartGridDateFormat;
898
+ startYear?: number;
899
+ endYear?: number;
900
+ minDate?: string;
901
+ maxDate?: string;
902
+ options?: Array<{
903
+ label: string;
904
+ value: string | number;
905
+ }>;
906
+ isMultiSelect?: boolean;
907
+ type?: SmartGridInputType;
908
+ disabled?: boolean;
909
+ disableOnlyPast?: boolean;
910
+ disableOnlyFuture?: boolean;
911
+ disablePast?: boolean;
912
+ disableFuture?: boolean;
913
+ startDate?: string | Date;
914
+ endDate?: string | Date;
915
+ inputType?: SmartGridInputType;
916
+ leftLabel?: string;
917
+ rightLabel?: string;
918
+ splits?: SmartGridColumnDefinition[];
919
+ isEnableResetButton?: boolean;
920
+ } & Record<string, unknown>;
921
+
922
+ declare interface SmartGridCellValueChangedParams {
923
+ colDef: SmartGridColumnDefinition;
924
+ column: SmartGridColumnDefinition;
925
+ data: SmartGridRowData;
926
+ newValue: unknown;
927
+ node: {
928
+ data: SmartGridRowData;
929
+ id: string | number;
930
+ level: number;
931
+ parent?: SmartGridUpdateData;
932
+ rowIndex: number;
933
+ };
934
+ value: unknown;
935
+ }
936
+
937
+ declare type SmartGridCheckConfigraitonSearchField = {
938
+ type: string;
939
+ filterType: string;
940
+ filter: string;
941
+ };
942
+
943
+ declare interface SmartGridCheckConfiguration {
944
+ checkedRows?: string[];
945
+ unCheckedRows?: string[];
946
+ checkAll?: boolean;
947
+ searchColumns?: SmartGridCheckConfigraitonSearchField | {
948
+ [key: string]: SmartGridCheckConfigraitonSearchField;
949
+ };
950
+ unCheckAll?: boolean;
951
+ }
952
+
953
+ /** Client-side datasource interface */
954
+ declare interface SmartGridClientSideDatasource {
955
+ getRows: (params: SmartGridGetRowsRequestParams) => void;
956
+ destroy?: () => void;
957
+ _isWrapped?: boolean;
958
+ _cleanup?: () => void;
959
+ updateData?: (state: SmartGridStateContext, newData: SmartGridRowData[]) => void;
960
+ getWholeData?: () => SmartGridRowData[];
961
+ updateCacheReference?: (newCache: InfiniteCache) => boolean;
962
+ _cacheInjected?: boolean;
963
+ infiniteCache?: InfiniteCache;
964
+ context?: SmartGridDataSourceContext;
965
+ updateWholeData: (wholeData: SmartGridRowData[]) => void;
966
+ }
967
+
968
+ declare type SmartGridColumnDefinition = SmartGridColumnWithField | SmartGridColumnWithGroupId | SmartGridColumnWithColId;
969
+
970
+ declare interface SmartGridColumnState {
971
+ colId: string;
972
+ hide: boolean;
973
+ width: number;
974
+ sort: SmartGridSortDirection | null;
975
+ filter: SmartGridFilterModel[] | null;
976
+ }
977
+
978
+ declare interface SmartGridColumnWithColId extends SmartGridBaseColumnDefinition {
979
+ field?: string;
980
+ groupId?: string;
981
+ colId: string;
982
+ }
983
+
984
+ declare interface SmartGridColumnWithField extends SmartGridBaseColumnDefinition {
985
+ field: string;
986
+ groupId?: string;
987
+ }
988
+
989
+ declare interface SmartGridColumnWithGroupId extends SmartGridBaseColumnDefinition {
990
+ field?: string;
991
+ groupId: string;
992
+ }
993
+
994
+ /** Data source context */
995
+ declare interface SmartGridDataSourceContext {
996
+ infiniteCache?: InfiniteCache;
997
+ tableContextRef?: MutableRefObject<SmartGridTableContextValue | null>;
998
+ updateData?: (rows: SmartGridRowData[], blockId: number, metadata?: Record<string, unknown> | undefined) => void;
999
+ getWholeData?: () => SmartGridRowData[];
1000
+ [key: string]: unknown;
1001
+ }
1002
+
1003
+ /** Datasource getRows params */
1004
+ declare interface SmartGridDatasourceGetRowsParams {
1005
+ startRow: number;
1006
+ endRow: number;
1007
+ sortModel?: SmartGridSortModel;
1008
+ filterModel?: SmartGridFilterModel;
1009
+ pageSize: number;
1010
+ successCallback: (rows: SmartGridRowData[], lastRow?: number, lastRowIndexKnown?: boolean) => void;
1011
+ failCallback: (error?: unknown) => void;
1012
+ context?: SmartGridBlockContext;
1013
+ request?: {
1014
+ startRow: number;
1015
+ endRow: number;
1016
+ sortModel?: SmartGridSortModel;
1017
+ filterModel?: SmartGridFilterModel;
1018
+ pageSize: number;
1019
+ groupKeys: string[];
1020
+ };
1021
+ }
1022
+
1023
+ declare interface SmartGridDataSourceParams {
1024
+ startRow: number;
1025
+ endRow: number;
1026
+ successCallback: (rows: SmartGridRowData[], lastRow?: number | null) => void;
1027
+ failCallback: (error: Error) => void;
1028
+ request: RowGroupParams & {
1029
+ groupKeys: unknown[];
1030
+ rowGroupCols: SmartGridColumnDefinition[];
1031
+ startRow: number;
1032
+ endRow: number;
1033
+ };
1034
+ [key: string]: unknown;
1035
+ }
1036
+
1037
+ declare type SmartGridDateFormat = "YYYY-MM-DD" | "DD-MM-YYYY" | "MM-DD-YYYY";
1038
+
1039
+ declare type SmartGridDefaultColDef = {
1040
+ minWidth: number;
1041
+ headerComponentParams?: {
1042
+ innerHeaderComponent: React.FC<SmartGridHeaderStyleParams> | null;
1043
+ };
1044
+ headerComponent?: React.FC<SmartGridHeaderStyleParams> | null;
1045
+ };
1046
+
1047
+ declare type SmartGridDispatch = (action: {
1048
+ type: string;
1049
+ payload: unknown;
1050
+ meta?: {
1051
+ fromAlignedGrid?: boolean;
1052
+ defaultColDef?: SmartGridDefaultColDef;
1053
+ } | Record<string, unknown>;
1054
+ }) => void;
1055
+
1056
+ declare interface SmartGridDisplayedColumn {
1057
+ colDef: SmartGridColumnDefinition;
1058
+ colId: string;
1059
+ getColId: () => string;
1060
+ isVisible: () => boolean;
1061
+ isPinned: () => SmartGridPinnedType;
1062
+ label: string;
1063
+ }
1064
+
1065
+ declare interface SmartGridDisplayedRowAtIndex {
1066
+ data: SmartGridRowData;
1067
+ rowIndex: number;
1068
+ node: SmartGridParamsNode;
1069
+ api: SmartGridAPI;
1070
+ }
1071
+
1072
+ declare interface SmartGridDisplayedRowNode extends SmartGridRowNode {
1073
+ rowIndex: number;
1074
+ absoluteRowIndex: number;
1075
+ originalData: SmartGridRowData;
1076
+ rowHeight?: number;
1077
+ }
1078
+
1079
+ declare interface SmartGridDisptach {
1080
+ type: string;
1081
+ payload?: unknown;
1082
+ }
1083
+
1084
+ declare interface SmartGridEvent {
1085
+ type: string;
1086
+ api?: SmartGridAPI;
1087
+ [key: string]: unknown;
1088
+ }
1089
+
1090
+ declare type SmartGridEventListener = {
1091
+ fn: SmartGridEventListenerFn;
1092
+ once: boolean;
1093
+ };
1094
+
1095
+ declare type SmartGridEventListenerFn = (event: SmartGridEvent) => void;
1096
+
1097
+ declare type SmartGridExpandedChildRows = {
1098
+ childRowsCount: number;
1099
+ rowId: string | number;
1100
+ rowIndex: number;
1101
+ children?: SmartGridRowData[];
1102
+ };
1103
+
1104
+ declare type SmartGridExpandedColumnGroups = {
1105
+ isAllGroupExpanded?: boolean;
1106
+ [key: string]: boolean | undefined;
1107
+ };
1108
+
1109
+ /** Extended filter model with search and column filters */
1110
+ declare interface SmartGridExtendedFilterModel extends SmartGridFilterModel {
1111
+ _search?: SmartGridFilterModel[];
1112
+ _columnFilters?: Record<string, unknown>;
1113
+ }
1114
+
1115
+ declare type SmartGridFetchDataFunctionBody = {
1116
+ range: SmartGridRangeFilter[];
1117
+ search: SmartGridStringFilter[];
1118
+ sort: SmartGridSortModel[];
1119
+ };
1120
+
1121
+ declare interface SmartGridFetchDataResponse {
1122
+ rowData: SmartGridRowData[];
1123
+ lastRow?: number;
1124
+ rowCount?: number;
1125
+ totalCount?: number;
1126
+ }
1127
+
1128
+ /** Fetch function ref type */
1129
+ declare interface SmartGridFetchFunctionRef {
1130
+ current?: SmartGridFetDataParams | null;
1131
+ }
1132
+
1133
+ /** Fetch response */
1134
+ declare interface SmartGridFetchResponse {
1135
+ data?: SmartGridRowData[];
1136
+ rowCount?: number;
1137
+ totalItems?: number;
1138
+ total?: number;
1139
+ lastRow?: number;
1140
+ lastRowIndexKnown?: boolean;
1141
+ }
1142
+
1143
+ declare type SmartGridFetDataParams = (body: SmartGridFetchDataFunctionBody, page: number, context?: SmartGridDataSourceContext, pageNum?: number, options?: {
1144
+ pageSize: number;
1145
+ }) => Promise<SmartGridFetchResponse & {
1146
+ totalCount?: number | null;
1147
+ }>;
1148
+
1149
+ export declare type SmartGridFilterMode = "value" | "condition";
1150
+
1151
+ declare interface SmartGridFilterModel {
1152
+ pattern: string;
1153
+ search_type: string;
1154
+ column?: string;
1155
+ field?: string;
1156
+ min_val?: number;
1157
+ max_val?: number;
1158
+ type?: string;
1159
+ operator?: string;
1160
+ value?: string;
1161
+ operators?: SmartGridSearchOperatorOption[];
1162
+ [key: string]: unknown;
1163
+ }
1164
+
1165
+ declare type SmartGridFloatingType = "top" | "bottom" | null;
1166
+
1167
+ declare interface SmartGridFocusedCell extends SmartGridSelectedCell {
1168
+ floating: SmartGridFloatingType;
1169
+ }
1170
+
1171
+ declare type SmartGridFrozenColumnsDetails = {
1172
+ indexes: string[];
1173
+ positions: Record<string, number>;
1174
+ totalWidth: number;
1175
+ rightPinned: {
1176
+ indexes: string[];
1177
+ positions: Record<string, number>;
1178
+ totalWidth: number;
1179
+ };
1180
+ };
1181
+
1182
+ declare type SmartGridFrozenState = "left" | "right" | boolean | null | undefined;
1183
+
1184
+ declare interface SmartGridGetRowDataParams {
1185
+ data: SmartGridRowData;
1186
+ rowIndex?: number;
1187
+ node: SmartGridParamsNode;
1188
+ api: SmartGridAPI;
1189
+ }
1190
+
1191
+ /** Request params for getRows */
1192
+ declare interface SmartGridGetRowsRequestParams {
1193
+ startRow: number;
1194
+ endRow: number;
1195
+ pageSize: number;
1196
+ sortModel?: SmartGridSortModel;
1197
+ filterModel?: SmartGridExtendedFilterModel;
1198
+ successCallback: (rows: SmartGridRowData[], lastRow?: number, lastRowIndexKnown?: boolean) => void;
1199
+ failCallback: (error?: unknown) => void;
1200
+ context?: SmartGridDataSourceContext;
1201
+ request?: {
1202
+ startRow: number;
1203
+ endRow: number;
1204
+ sortModel?: SmartGridSortModel;
1205
+ filterModel?: SmartGridFilterModel;
1206
+ pageSize: number;
1207
+ groupKeys: string[];
1208
+ };
1209
+ }
1210
+
1211
+ declare type SmartGridHeaderRowHeight = {
1212
+ maxHeight: number;
1213
+ maxLineCount: number;
1214
+ };
1215
+
1216
+ declare type SmartGridHeaderStyleParams = {
1217
+ column: SmartGridColumnDefinition;
1218
+ displayName: string;
1219
+ enableSorting: boolean;
1220
+ sortState: SmartGridSortModel;
1221
+ onSort: (field: string, direction: string) => void;
1222
+ isSearchable?: boolean;
1223
+ showSortIcon: boolean;
1224
+ toggleSearchModal: (e: default_2.MouseEvent<HTMLElement>) => void;
1225
+ hasFilters: boolean;
1226
+ isExpandable?: boolean;
1227
+ onToggle?: (field: string, isExpandable: boolean) => void;
1228
+ api: SmartGridAPI;
1229
+ availableWidth: number;
1230
+ wrapHeaderText: boolean;
1231
+ menuButtonRef: default_2.RefObject<HTMLDivElement>;
1232
+ menuToggle: (e: default_2.MouseEvent<HTMLElement>) => void;
1233
+ toggleAdvancedSeach: default_2.Dispatch<default_2.SetStateAction<boolean>>;
1234
+ };
1235
+
1236
+ declare interface SmartGridInfiniteCache {
1237
+ analytics: SmartGridCacheAnalytics;
1238
+ blockCount: number;
1239
+ blocks: Record<number, SmartGridCacheBlock>;
1240
+ eventListeners: Record<"cacheUpdated", Function[]>;
1241
+ lastRequestedPage: number;
1242
+ lastRowIndexKnown: boolean;
1243
+ params: SmartGridInfiniteCacheParams;
1244
+ rowCount: number;
1245
+ _currentRequestedPage: number;
1246
+ getAllCachedData: () => SmartGridRowData[];
1247
+ updatePageData?: (page: number, data: SmartGridRowData[], replace: boolean, options?: {
1248
+ isRefreshData?: boolean;
1249
+ }) => void;
1250
+ purgeCache?: (options?: {
1251
+ isRefreshData?: boolean;
1252
+ }) => void;
1253
+ getTotalCachedRowCount?: () => number;
1254
+ printAllCachedData?: () => void;
1255
+ setViewportRange?: (start: number, end: number) => void;
1256
+ updateWholeData: (wholeData: SmartGridRowData[], pageSize?: number) => void;
1257
+ getBlockData: (blockId: number) => (SmartGridRowData | null)[] | null;
1258
+ }
1259
+
1260
+ declare type SmartGridInfiniteCacheDataSourceParams = {
1261
+ getWholeData: () => SmartGridRowData[];
1262
+ updateData?: (state: SmartGridStateContext, data: SmartGridRowData[], rowId?: string, rowIndex?: number) => void;
1263
+ _cacheInjected: boolean;
1264
+ _isDestroyed: boolean;
1265
+ _loadingBlocks: Record<string, unknown>;
1266
+ _originalDatasource: {
1267
+ getRows: (params: SmartGridDataSourceParams) => void;
1268
+ };
1269
+ _pendingRAFs: number[];
1270
+ _pendingRequests: Record<string, unknown>;
1271
+ infiniteCache: SmartGridInfiniteCache;
1272
+ destroy: () => void;
1273
+ getRows: (params: SmartGridDataSourceParams) => void;
1274
+ updateCacheReference: (cache: SmartGridInfiniteCache) => void;
1275
+ updateWholeData: (wholeData: SmartGridRowData[], pageSize?: number) => void;
1276
+ };
1277
+
1278
+ /** Infinite cache interface (forward declaration) */
1279
+ declare interface SmartGridInfiniteCacheInterface {
1280
+ rowsMaxIndex?: number;
1281
+ _currentRequestedPage?: number;
1282
+ isLastRowIndexKnown: () => boolean;
1283
+ getRowCount: () => number;
1284
+ pageLoaded: (block: InfiniteBlock, lastRow?: number) => void;
1285
+ getBlock: (blockId: number) => InfiniteBlock | undefined;
1286
+ isBlockInCreationQueue: (blockId: number) => boolean;
1287
+ createBlock: (blockId: number) => InfiniteBlock;
1288
+ setRowCount?: (count: number, lastRowIndexKnown: boolean) => void;
1289
+ }
1290
+
1291
+ declare interface SmartGridInfiniteCacheParams {
1292
+ datasource: SmartGridInfiniteCacheDataSourceParams;
1293
+ updatedPageSizeRef: MutableRefObject<number>;
1294
+ pageSize: number;
1295
+ overflowSize: number;
1296
+ }
1297
+
1298
+ declare interface SmartGridInfiniteCacheReturn {
1299
+ cacheReady: boolean;
1300
+ shouldUseCacheRef: MutableRefObject<boolean>;
1301
+ getRows: (startRow: number, endRow: number) => SmartGridRowData[];
1302
+ setVisibleRange: (startRow: number, endRow: number) => void;
1303
+ setSortModel: (sortModel: SmartGridSortModel) => void;
1304
+ setFilterModel: (filterModel: SmartGridFilterModel | Record<string, unknown>, options?: Record<string, unknown>) => void;
1305
+ refreshCache: (options?: SmartGridRefreshCacheOptions) => void;
1306
+ setServerSideDataSource: (datasource: SmartGridServerSideDataSource, resetCache?: boolean) => SmartGridWrappedDataSource | null;
1307
+ setPurgeStrategy: (strategy: string) => void;
1308
+ setPersistence: (enabled: boolean, options?: Record<string, unknown>) => void;
1309
+ clearPersistedCache: () => void;
1310
+ getCacheState: () => SmartGridCacheStateReturn | null;
1311
+ modelRef: MutableRefObject<SmartGridInfiniteRowModelRef | null>;
1312
+ dataSourceRef?: MutableRefObject<SmartGridWrappedDataSource | null>;
1313
+ setVisibleData?: (data: SmartGridRowData[]) => void;
1314
+ getAllCachedData?: () => SmartGridRowData[];
1315
+ }
1316
+
1317
+ declare interface SmartGridInfiniteRowModel {
1318
+ infiniteCache?: SmartGridInfiniteCache;
1319
+ setViewportRange?: (startRow: number, endRow: number) => void;
1320
+ logCacheSummary?: () => void;
1321
+ datasource: {
1322
+ getWholeData: () => SmartGridRowData[];
1323
+ };
1324
+ [key: string]: unknown;
1325
+ }
1326
+
1327
+ declare interface SmartGridInfiniteRowModelRef {
1328
+ infiniteCache?: SmartGridInfiniteCache;
1329
+ params?: {
1330
+ context?: unknown;
1331
+ filterModel?: SmartGridFilterModel | Record<string, unknown>;
1332
+ sortModel?: SmartGridSortModel | null;
1333
+ [key: string]: unknown;
1334
+ };
1335
+ setViewportRange?: (startRow: number, endRow: number) => void;
1336
+ logCacheSummary?: () => void;
1337
+ setDatasource?: (datasource: unknown, preserveCache?: boolean) => void;
1338
+ setSortModel?: (sortModel: SmartGridSortModel) => void;
1339
+ setFilterModel?: (filterModel: SmartGridFilterModel | {
1340
+ _search: SmartGridSearchFunctionParams;
1341
+ } | Record<string, unknown>, options?: Record<string, unknown>) => void;
1342
+ purgeCache?: () => void;
1343
+ refreshCache?: () => void;
1344
+ refreshCachePartial?: (preserveFields: string[]) => void;
1345
+ resetCache?: () => void;
1346
+ setPurgeStrategy?: (strategy: string) => void;
1347
+ setCachePersistence?: (enabled: boolean, options?: Record<string, unknown>) => void;
1348
+ clearPersistedCache?: () => void;
1349
+ getCacheState?: () => SmartGridCacheStateReturn;
1350
+ getCacheAnalytics?: () => SmartGridCacheAnalyticsData | null;
1351
+ getMemoryUsageEstimate?: () => number;
1352
+ resetCacheAnalytics?: () => void;
1353
+ datasource?: SmartGridDataSourceContext;
1354
+ getRow?: (index: number) => {
1355
+ data: SmartGridRowData;
1356
+ } | null;
1357
+ }
1358
+
1359
+ declare type SmartGridInputType = "text" | "password" | "email" | "number" | "tel" | "int" | "url";
1360
+
1361
+ declare interface SmartGridInternalGetRowsParams {
1362
+ startRow: number;
1363
+ endRow: number;
1364
+ filterModel?: SmartGridFilterModel | null;
1365
+ sortModel?: SmartGridSortModel | null;
1366
+ request?: Record<string, unknown>;
1367
+ successCallback?: (rowData: SmartGridRowData[], lastRow?: number) => void;
1368
+ failCallback?: () => void;
1369
+ noDataUpdate?: boolean;
1370
+ }
1371
+
1372
+ /** Last accessed sequence generator */
1373
+ declare interface SmartGridLastAccessedSequence {
1374
+ value: number;
1375
+ next: () => number;
1376
+ }
1377
+
1378
+ /** Last accessed sequence generator */
1379
+ declare interface SmartGridLastAccessedSequence_2 {
1380
+ value: number;
1381
+ next: () => number;
1382
+ }
1383
+
1384
+ declare type SmartGridModelType = "normal" | "serverSide" | "infinite";
1385
+
1386
+ declare interface SmartGridNewSortModel {
1387
+ column: string | null;
1388
+ order: SmartGridSortDirection | null;
1389
+ }
1390
+
1391
+ declare interface SmartGridNotification {
1392
+ message: string;
1393
+ type?: "success" | "error" | "warning" | "info";
1394
+ duration?: number;
1395
+ timeout?: number;
1396
+ }
1397
+
1398
+ declare type SmartGridNumberFormat = "full" | "thousands" | "millions" | "billions";
1399
+
1400
+ declare interface SmartGridOldSortModel {
1401
+ colId: string;
1402
+ sort: SmartGridSortDirection;
1403
+ }
1404
+
1405
+ declare type SmartGridOnSelectionChangedParams = {
1406
+ api: SmartGridAPI;
1407
+ type: string;
1408
+ source: string;
1409
+ };
1410
+
1411
+ declare interface SmartGridOptions {
1412
+ [key: string]: unknown;
1413
+ }
1414
+
1415
+ /** Page size ref */
1416
+ declare interface SmartGridPageSizeRef {
1417
+ current: number;
1418
+ }
1419
+
1420
+ /** Page size ref */
1421
+ declare interface SmartGridPageSizeRef_2 {
1422
+ current: number;
1423
+ }
1424
+
1425
+ declare interface SmartGridPaginationModel {
1426
+ currentPage: number;
1427
+ pageSize: number;
1428
+ totalPages: number;
1429
+ totalRecords: number;
1430
+ }
1431
+
1432
+ declare interface SmartGridParamsNode {
1433
+ rowIndex: number;
1434
+ data: SmartGridRowData;
1435
+ api: SmartGridAPI;
1436
+ }
1437
+
1438
+ /** Pending request with abort capability */
1439
+ declare interface SmartGridPendingRequest {
1440
+ abort?: () => void;
1441
+ }
1442
+
1443
+ /** Persistence options for cache */
1444
+ declare interface SmartGridPersistenceOptions {
1445
+ maxPersistedBlocks: number;
1446
+ persistBlockData: boolean;
1447
+ compressionEnabled: boolean;
1448
+ }
1449
+
1450
+ declare type SmartGridPinnedType = "leftPinned" | "rightPinned" | null;
1451
+
1452
+ export declare interface SmartGridPivotAggregationOption {
1453
+ value: string;
1454
+ label: string;
1455
+ }
1456
+
1457
+ declare interface SmartGridPivotConfig {
1458
+ PivotComponent: React.FC<SmartGridPivotWrapperProps>;
1459
+ savedPivotState: SmartGridPivotState | undefined;
1460
+ pivotPanelColumnDef: SmartGridColumnDefinition[];
1461
+ enablePivotTutorial?: boolean;
1462
+ savedPivots?: SmartGridPivotState[];
1463
+ recentlyUsedPivots?: SmartGridPivotState[];
1464
+ isHidePivotSave?: boolean;
1465
+ pivotChildren?: React.ReactNode;
1466
+ handlePivotSave?: (state: SmartGridPivotSavePayload, setIsPivotOpen: React.Dispatch<React.SetStateAction<boolean>>) => void;
1467
+ handlePivotApply?: (state: SmartGridPivotState, setIsPivotOpen: React.Dispatch<React.SetStateAction<boolean>>) => void;
1468
+ pivotAggregationFunc?: SmartGridSelectOption[];
1469
+ showPivotTotalsSection?: boolean;
1470
+ isPivotRowGrandTotal?: boolean;
1471
+ isPivotColumnGrandTotal?: boolean;
1472
+ isPivotRowSubTotal?: boolean;
1473
+ isPivotColumnSubTotal?: boolean;
1474
+ isHideFilters?: boolean;
1475
+ isHideValues?: boolean;
1476
+ }
1477
+
1478
+ export declare interface SmartGridPivotDropZoneItem {
1479
+ mode: string;
1480
+ filterValue: string;
1481
+ id: string;
1482
+ name: string;
1483
+ aggregation?: SmartGridAggregationType;
1484
+ condition?: string;
1485
+ }
1486
+
1487
+ export declare interface SmartGridPivotDropZoneProps {
1488
+ type: "rows" | "columns" | "values";
1489
+ items: SmartGridColumnDefinition[];
1490
+ defaultExpanded?: boolean;
1491
+ onDrop: (column: SmartGridColumnDefinition) => void;
1492
+ onRemoveItem: (itemId: string) => void;
1493
+ isDragOver?: boolean;
1494
+ onClearAll?: () => void;
1495
+ }
1496
+
1497
+ export declare interface SmartGridPivotField {
1498
+ id: string;
1499
+ name: string;
1500
+ type: "dimension" | "measure";
1501
+ }
1502
+
1503
+ export declare interface SmartGridPivotFieldItemProps {
1504
+ column: SmartGridColumnDefinition;
1505
+ isDragging?: boolean;
1506
+ }
1507
+
1508
+ export declare interface SmartGridPivotFieldListProps {
1509
+ fields: SmartGridColumnDefinition[];
1510
+ }
1511
+
1512
+ export declare interface SmartGridPivotFilterConditionOption {
1513
+ value: string;
1514
+ label: string;
1515
+ }
1516
+
1517
+ export declare interface SmartGridPivotFilterConditions {
1518
+ number?: SmartGridPivotFilterConditionOption[];
1519
+ text?: SmartGridPivotFilterConditionOption[];
1520
+ }
1521
+
1522
+ export declare interface SmartGridPivotFilterItem {
1523
+ id: string;
1524
+ name: string;
1525
+ value: string;
1526
+ mode: SmartGridFilterMode;
1527
+ condition?: string;
1528
+ }
1529
+
1530
+ export declare interface SmartGridPivotFiltersSectionProps {
1531
+ items: SmartGridColumnDefinition[];
1532
+ defaultExpanded?: boolean;
1533
+ onDrop: (column: SmartGridColumnDefinition) => void;
1534
+ onRemoveItem: (id: string) => void;
1535
+ onFilterValueChange: (id: string, value: string) => void;
1536
+ onFilterModeChange?: (id: string, mode: SmartGridFilterMode) => void;
1537
+ onFilterConditionChange?: (id: string, condition: string) => void;
1538
+ onClearAll?: () => void;
1539
+ }
1540
+
1541
+ export declare interface SmartGridPivotFooterProps {
1542
+ onCancel: () => void;
1543
+ onSave?: () => void;
1544
+ onApply?: () => void;
1545
+ isSaveDisabled?: boolean;
1546
+ isApplyDisabled?: boolean;
1547
+ isHideSave?: boolean;
1548
+ cancelText?: string;
1549
+ saveText?: string;
1550
+ applyText?: string;
1551
+ }
1552
+
1553
+ export declare interface SmartGridPivotHeaderProps {
1554
+ title: string;
1555
+ onClose: () => void;
1556
+ }
1557
+
1558
+ export declare type SmartGridPivotMode = "saved" | "create";
1559
+
1560
+ export declare interface SmartGridPivotNotificationProps {
1561
+ message: string;
1562
+ defaultVisible?: boolean;
1563
+ onClose?: () => void;
1564
+ }
1565
+
1566
+ export declare interface SmartGridPivotPanelProps {
1567
+ isOpen: boolean;
1568
+ onClose: () => void;
1569
+ onSave: (state: SmartGridPivotSavePayload) => void;
1570
+ availableFields: SmartGridColumnDefinition[];
1571
+ versions?: SmartGridPivotVersion[];
1572
+ selectedVersion?: SmartGridPivotVersion;
1573
+ onVersionChange?: (version: SmartGridPivotVersion) => void;
1574
+ initialState?: Partial<SmartGridPivotState>;
1575
+ showNotification?: boolean;
1576
+ onNotificationClose?: () => void;
1577
+ pivotAggrValues?: SmartGridPivotAggregationOption[];
1578
+ pivotFilterConditions?: SmartGridPivotFilterConditions;
1579
+ pivotChildren?: React.ReactNode;
1580
+ savedPivots?: SmartGridPivotState[];
1581
+ recentlyUsedPivots?: SmartGridPivotState[];
1582
+ onDeleteSavedPivot?: (pivotId: string) => void;
1583
+ onEditSavedPivot?: (pivot: SmartGridPivotState) => void;
1584
+ defaultMode?: SmartGridPivotMode;
1585
+ handlePivotApply?: (state: SmartGridPivotState) => void;
1586
+ isHidePivotSave?: boolean;
1587
+ showTotalsSection?: boolean;
1588
+ pivotAggregationFunc?: SmartGridSelectOption[];
1589
+ isPivotRowGrandTotal?: boolean;
1590
+ isPivotColumnGrandTotal?: boolean;
1591
+ isPivotRowSubTotal?: boolean;
1592
+ isPivotColumnSubTotal?: boolean;
1593
+ isHideFilters?: boolean;
1594
+ isHideValues?: boolean;
1595
+ }
1596
+
1597
+ export declare interface SmartGridPivotSavePayload extends SmartGridPivotState {
1598
+ isReplace?: boolean;
1599
+ isUpdated?: boolean;
1600
+ oldName?: string;
1601
+ }
1602
+
1603
+ export declare interface SmartGridPivotSectionProps {
1604
+ title: string;
1605
+ type: SmartGridPivotSectionType;
1606
+ isExpanded: boolean;
1607
+ onToggleExpand: () => void;
1608
+ children?: React.ReactNode;
1609
+ }
1610
+
1611
+ export declare interface SmartGridPivotSectionState {
1612
+ items: SmartGridColumnDefinition[];
1613
+ }
1614
+
1615
+ export declare type SmartGridPivotSectionType = "rows" | "columns" | "values" | "filters" | "totals";
1616
+
1617
+ export declare interface SmartGridPivotState {
1618
+ id?: string;
1619
+ name: string;
1620
+ viewType?: SmartGridPivotViewType;
1621
+ isDefault?: boolean;
1622
+ rows: SmartGridPivotSectionState;
1623
+ columns: SmartGridPivotSectionState;
1624
+ values: SmartGridPivotSectionState;
1625
+ filters: SmartGridPivotSectionState;
1626
+ totals: SmartGridPivotTotalsState;
1627
+ }
1628
+
1629
+ export declare interface SmartGridPivotTotalsState {
1630
+ showRowGrandTotal: boolean;
1631
+ showColumnGrandTotal: boolean;
1632
+ showRowSubTotal: boolean;
1633
+ showColumnSubTotal: boolean;
1634
+ }
1635
+
1636
+ export declare interface SmartGridPivotValueItem {
1637
+ id: string;
1638
+ name: string;
1639
+ aggregation: SmartGridAggregationType;
1640
+ }
1641
+
1642
+ export declare interface SmartGridPivotValuesSectionProps {
1643
+ items: SmartGridColumnDefinition[];
1644
+ defaultExpanded?: boolean;
1645
+ onDrop: (column: SmartGridColumnDefinition) => void;
1646
+ onRemoveItem: (id: string) => void;
1647
+ onAggregationChange: (id: string, aggregation: SmartGridAggregationType) => void;
1648
+ onClearAll?: () => void;
1649
+ pivotAggregationFunc?: SmartGridSelectOption[];
1650
+ }
1651
+
1652
+ export declare interface SmartGridPivotVersion {
1653
+ value: string;
1654
+ label: string;
1655
+ }
1656
+
1657
+ export declare interface SmartGridPivotVersionSelectProps {
1658
+ label: string;
1659
+ versions: SmartGridPivotVersion[];
1660
+ selectedVersion: SmartGridPivotVersion | null;
1661
+ onVersionChange: (version: SmartGridPivotVersion) => void;
1662
+ }
1663
+
1664
+ export declare type SmartGridPivotViewType = "global" | "personal";
1665
+
1666
+ export declare interface SmartGridPivotWrapperProps {
1667
+ pivotConfig: SmartGridPivotConfig;
1668
+ shouldRenderTable: boolean;
1669
+ showSaveTableConfig: boolean;
1670
+ }
1671
+
1672
+ declare type SmartGridRangeFilter = {
1673
+ column: string;
1674
+ min_val: number;
1675
+ max_val: number;
1676
+ search_type: string;
1677
+ operator?: string;
1678
+ };
1679
+
1680
+ declare interface SmartGridRefreshCacheOptions {
1681
+ purge?: boolean;
1682
+ partialRefresh?: boolean;
1683
+ preserveFields?: string[];
1684
+ userInitiated?: boolean;
1685
+ }
1686
+
1687
+ declare interface SmartGridRefreshOptions {
1688
+ purge?: boolean;
1689
+ resetPage?: boolean;
1690
+ userInitiated?: boolean;
1691
+ resetFilters?: boolean;
1692
+ }
1693
+
1694
+ /** Response metadata */
1695
+ declare interface SmartGridResponseMetadata {
1696
+ totalCount?: number;
1697
+ lastRowIndexKnown?: boolean;
1698
+ }
1699
+
1700
+ declare interface SmartGridRowData {
1701
+ [key: string]: unknown;
1702
+ id?: string | number;
1703
+ isChildRow?: boolean;
1704
+ isChildGroup?: boolean;
1705
+ childIndex?: number;
1706
+ groupingLevel?: number;
1707
+ level?: number;
1708
+ parentRowIndex?: number;
1709
+ parentRowData?: SmartGridRowData;
1710
+ __parentPath?: string;
1711
+ _rowHeight?: number;
1712
+ _isPinnedTop?: boolean;
1713
+ _isPinnedBottom?: boolean;
1714
+ __isAggregationRow?: boolean;
1715
+ subTotalAggreRow?: boolean;
1716
+ grandTotalAggreRow?: boolean;
1717
+ isGrandTotalRow?: boolean;
1718
+ __parentId?: string | number | null;
1719
+ __rowSpanInfo?: SmartGridRowSpanInfo;
1720
+ __flattenedRowId?: string;
1721
+ __rowIndex?: number;
1722
+ __split?: {
1723
+ key?: string;
1724
+ };
1725
+ }
1726
+
1727
+ declare interface SmartGridRowDragEndParams {
1728
+ api: SmartGridAPI;
1729
+ type: "rowDragEnd";
1730
+ fromIndex: number;
1731
+ toIndex: number;
1732
+ rowData: SmartGridRowData;
1733
+ }
1734
+
1735
+ declare interface SmartGridRowDragStartParams {
1736
+ api: SmartGridAPI;
1737
+ type: "rowDragStart";
1738
+ rowIndex: number;
1739
+ rowData: SmartGridRowData;
1740
+ }
1741
+
1742
+ declare type SmartGridRowGrouOpenParams = {
1743
+ rowId: string;
1744
+ rowIndex: number;
1745
+ api: SmartGridAPI;
1746
+ isExpanded: boolean;
1747
+ };
1748
+
1749
+ declare type SmartGridRowGroupState = {
1750
+ expandedGroups: Record<string, SmartGridRowGroupStateExpandedGroups>;
1751
+ loadedData: Record<string, SmartGridRowData[]>;
1752
+ loading: Record<string, boolean>;
1753
+ pagination: Record<string, SmartGridRowGroupStatePagination>;
1754
+ cache: {
1755
+ metadata: Record<string, SmartGridCacheMetadata>;
1756
+ expirationTime: number;
1757
+ };
1758
+ api: SmartGridAPI | null;
1759
+ isLoadingSomething: boolean;
1760
+ isAllRowExpanded: boolean;
1761
+ isManuallyChanged: boolean;
1762
+ };
1763
+
1764
+ declare type SmartGridRowGroupStateExpandedGroups = {
1765
+ count: number;
1766
+ fieldName: string;
1767
+ rowIndex: number;
1768
+ value: string;
1769
+ [key: string]: boolean | number | string;
1770
+ };
1771
+
1772
+ declare type SmartGridRowGroupStatePagination = {
1773
+ hasMore: boolean;
1774
+ lastUpdated: number;
1775
+ page: number;
1776
+ pageSize: number;
1777
+ totalItems?: number;
1778
+ totalPages?: number;
1779
+ error?: boolean;
1780
+ };
1781
+
1782
+ declare type SmartGridRowInfo = {
1783
+ isFirst: boolean;
1784
+ span: number;
1785
+ rowIds?: (string | number)[];
1786
+ };
1787
+
1788
+ declare interface SmartGridRowNode extends SmartGridUpdateData {
1789
+ id: string | number;
1790
+ childIndex?: number;
1791
+ selected: boolean;
1792
+ rowIndex?: number;
1793
+ absoluteRowIndex?: number;
1794
+ originalData?: SmartGridRowData;
1795
+ rowHeight?: number;
1796
+ setSelected: (selected: boolean, clearSelection?: boolean) => void | ((value: string | number | boolean) => void);
1797
+ isGroup?: () => boolean;
1798
+ }
1799
+
1800
+ declare interface SmartGridRowSpanInfo {
1801
+ [key: string]: SmartGridRowInfo | boolean | undefined;
1802
+ isRowSpan?: boolean;
1803
+ Selection?: SmartGridRowInfo;
1804
+ }
1805
+
1806
+ declare type SmartGridRowStyleParams = {
1807
+ api: SmartGridAPI;
1808
+ data: SmartGridRowData;
1809
+ pinned: boolean;
1810
+ node: {
1811
+ rowIndex: number;
1812
+ data: SmartGridRowData;
1813
+ api: SmartGridAPI;
1814
+ pinned: boolean;
1815
+ };
1816
+ };
1817
+
1818
+ declare type SmartGridSavedViewsOptions = {
1819
+ isActive: boolean;
1820
+ isDefaultView: boolean;
1821
+ viewName: string;
1822
+ viewType: "personal" | "global";
1823
+ };
1824
+
1825
+ declare interface SmartGridSaveViewCallbackRefCurrent {
1826
+ handleSetDefaultView?: ((view: SmartGridSavedViewsOptions) => void) | null;
1827
+ handleSavedViewClick?: ((view: SmartGridSavedViewsOptions) => void) | null;
1828
+ handleEditSaveView?: ((updatedData: SmartGridSavedViewsOptions, view: SmartGridSavedViewsOptions) => void) | null;
1829
+ handleSaveAndApply?: ((view: SmartGridSavedViewsOptions) => void) | null;
1830
+ handleDeleteViewClick?: ((view: SmartGridSavedViewsOptions) => void) | null;
1831
+ }
1832
+
1833
+ declare type SmartGridSearchFunctionParams = SmartGridFilterModel[] | Record<string, SmartGridFilterModel[]>;
1834
+
1835
+ declare type SmartGridSearchFunctionParamsWithField = Record<string, SmartGridFilterModel>;
1836
+
1837
+ declare interface SmartGridSearchOperatorOption {
1838
+ value: string;
1839
+ label: string;
1840
+ type?: string;
1841
+ }
1842
+
1843
+ declare interface SmartGridSearchWithSearchKey {
1844
+ _search: SmartGridSearchFunctionParamsWithField;
1845
+ }
1846
+
1847
+ declare interface SmartGridSelectedCell {
1848
+ colIndex: number;
1849
+ column: SmartGridColumnDefinition;
1850
+ data: SmartGridRowData;
1851
+ field: string;
1852
+ rowId: string | number;
1853
+ rowIndex: number;
1854
+ value: unknown;
1855
+ }
1856
+
1857
+ declare interface SmartGridSelectOption {
1858
+ value: string | number;
1859
+ label: string;
1860
+ isDisabled?: boolean;
1861
+ }
1862
+
1863
+ declare interface SmartGridServerSideDataSource {
1864
+ getRows: (params: SmartGridServerSideGetRowsParams) => {
1865
+ abort?: () => void;
1866
+ } | void;
1867
+ }
1868
+
1869
+ /** Server-side datasource interface */
1870
+ declare interface SmartGridServerSideDatasource {
1871
+ infiniteCache: InfiniteCache | undefined;
1872
+ _originalParams: SmartGridServerSideDataSourceParams;
1873
+ _loadingBlocks: Record<number, boolean>;
1874
+ _pendingRequests: Record<string, SmartGridPendingRequest>;
1875
+ _lastRequestParams: SmartGridGetRowsRequestParams | null;
1876
+ _isDestroyed: boolean;
1877
+ updateCacheReference: (newCache: InfiniteCache) => boolean;
1878
+ updateConfig: (newConfig: Partial<SmartGridServerSideDataSourceParams>) => SmartGridServerSideDatasource;
1879
+ destroy: () => void;
1880
+ resetLoadState: () => void;
1881
+ getRows: (requestParams: SmartGridGetRowsRequestParams) => void;
1882
+ _cacheInjected?: boolean;
1883
+ _isWrapped?: boolean;
1884
+ context?: SmartGridDataSourceContext;
1885
+ }
1886
+
1887
+ /** Server-side datasource params */
1888
+ declare interface SmartGridServerSideDataSourceParams {
1889
+ fetchFunc?: SmartGridFetchFunctionRef;
1890
+ apiUrl?: string;
1891
+ sortModel: SmartGridSortModel;
1892
+ filterModel: SmartGridSearchWithSearchKey | null;
1893
+ infiniteCache: InfiniteCache | null;
1894
+ context: SmartGridDataSourceContext;
1895
+ pageSize: number;
1896
+ resetState?: boolean;
1897
+ updatedPageSizeRef?: SmartGridUpdatedPageSizeRef;
1898
+ }
1899
+
1900
+ declare interface SmartGridServerSideGetRowsParams {
1901
+ request: {
1902
+ startRow: number;
1903
+ endRow: number;
1904
+ filterModel?: SmartGridFilterModel | SmartGridSearchWithSearchKey | null;
1905
+ sortModel?: SmartGridSortModel | null;
1906
+ };
1907
+ api: SmartGridAPI;
1908
+ success: (response: SmartGridFetchDataResponse) => void;
1909
+ fail: () => void;
1910
+ }
1911
+
1912
+ declare type SmartGridSortDirection = "asc" | "desc" | "none";
1913
+
1914
+ declare type SmartGridSortModel = SmartGridOldSortModel | SmartGridNewSortModel | null;
1915
+
1916
+ declare interface SmartGridStateContext {
1917
+ data?: SmartGridRowData[] | null;
1918
+ filteredData: SmartGridRowData[] | null;
1919
+ originalData: SmartGridRowData[] | null;
1920
+ previewMode: boolean;
1921
+ isLoading: boolean;
1922
+ columns: SmartGridColumnDefinition[];
1923
+ columnMap: Record<string, SmartGridColumnDefinition>;
1924
+ sortState: SmartGridSortModel;
1925
+ pagination: {
1926
+ currentPage: number;
1927
+ pageSize: number;
1928
+ totalPages: number | null;
1929
+ isCountUnknown: boolean;
1930
+ totalItems: number;
1931
+ currentLoadedPage: number;
1932
+ allTotalPages: number;
1933
+ page: number;
1934
+ };
1935
+ selectedRows: (string | number)[];
1936
+ selectedRowsObject: Record<string, boolean>;
1937
+ columnFilters: Record<string, SmartGridFilterModel[]>;
1938
+ expandedChildRows: Record<string, SmartGridExpandedChildRows>;
1939
+ expandedColumnGroups: SmartGridExpandedColumnGroups;
1940
+ uniqueIdField: string;
1941
+ childKeyField: string;
1942
+ frozenColumns: SmartGridFrozenColumnsDetails;
1943
+ notification: SmartGridNotification & {
1944
+ show: boolean;
1945
+ };
1946
+ columnsToAutosize: string[] | Record<string, boolean>;
1947
+ prevAction: string;
1948
+ checkConfiguration: SmartGridCheckConfiguration[];
1949
+ isSelectAllRecords: boolean;
1950
+ unCheckedRows: Record<string, boolean>;
1951
+ isSelectionChanged: boolean;
1952
+ masterDetail: {
1953
+ enabled: boolean;
1954
+ expandedRows: (string | number)[];
1955
+ detailRenderer: null | Function;
1956
+ detailRowHeight: number;
1957
+ detailPadding: number;
1958
+ expandedRowData: SmartGridRowData | SmartGridRowData[] | null;
1959
+ currentRowStyles?: {
1960
+ height?: number;
1961
+ top?: number;
1962
+ };
1963
+ rowIndex?: number | null;
1964
+ };
1965
+ eventListeners: Record<string, SmartGridEventListener[]>;
1966
+ defaultColDef: SmartGridDefaultColDef | null;
1967
+ api: SmartGridAPI | null;
1968
+ actions: {};
1969
+ serverSide: boolean;
1970
+ enableRowSpan: boolean;
1971
+ rowSpanColumn: string | string[] | null;
1972
+ rowDragManaged: boolean;
1973
+ format: {
1974
+ fontSize: "medium" | "small" | "large";
1975
+ numberFormat: SmartGridNumberFormat;
1976
+ };
1977
+ pinnedTopRows: SmartGridRowData[];
1978
+ pinnedBottomRows: SmartGridRowData[];
1979
+ rowGroupState: SmartGridRowGroupState;
1980
+ tableInstance: MutableRefObject<HTMLElement | null>;
1981
+ headerRowHeightwithIndex: Record<string, SmartGridHeaderRowHeight>;
1982
+ infiniteScroll: boolean;
1983
+ smartGridMenuOptions: {
1984
+ withColumMenu?: boolean;
1985
+ autoWithColumMenu?: boolean;
1986
+ freezeColumnMenu?: boolean;
1987
+ sortColumnMenu?: boolean;
1988
+ collapseColumnAll?: boolean;
1989
+ expandColumnAll?: boolean;
1990
+ wrapText?: boolean;
1991
+ };
1992
+ purgeClosedRowNodes: boolean;
1993
+ detailRendererTable: boolean;
1994
+ isSaveViewEnabled: boolean;
1995
+ rowHeight: {
1996
+ type: "default" | "compact" | "comfortable";
1997
+ height: number;
1998
+ padding: number;
1999
+ };
2000
+ aggregationTotalRow: SmartGridRowData | null;
2001
+ hasAggregation: boolean;
2002
+ callBackRef: MutableRefObject<SmartGridCallbackRefCurrent | null>;
2003
+ exportCallbackRef: MutableRefObject<{
2004
+ downloadExcelHandler?: null | Function;
2005
+ downloadCSVHandler?: null | Function;
2006
+ copyToClipboardHandler?: null | Function;
2007
+ }>;
2008
+ saveViewOptionsRef: MutableRefObject<{
2009
+ maxSavedViews?: null | number;
2010
+ deleteViewPromptText?: null | string;
2011
+ }>;
2012
+ saveViewCallbackRef: MutableRefObject<SmartGridSaveViewCallbackRefCurrent>;
2013
+ tableId: string;
2014
+ isSingleSelect: boolean;
2015
+ selectable: boolean;
2016
+ disableSelectAllRecords: boolean;
2017
+ columnBufferSize?: number;
2018
+ lazyLoadCellRenderer?: boolean;
2019
+ hasSplitRenderer?: boolean;
2020
+ splitRendererKeys?: string[] | null;
2021
+ originalFromIndex?: number | null;
2022
+ lastToIndex?: number | null;
2023
+ hasExpandedChildren?: boolean;
2024
+ isDraggingDownward?: boolean;
2025
+ saveViewCallbacks?: {
2026
+ isSavingViewLoading?: boolean;
2027
+ savedViewsOptions?: SmartGridSavedViewsOptions[];
2028
+ } & Record<string, unknown>;
2029
+ pivotPanelColumnDef: null | SmartGridColumnDefinition[];
2030
+ [key: string]: unknown;
2031
+ }
2032
+
2033
+ declare type SmartGridStringFilter = {
2034
+ column: string;
2035
+ pattern: string;
2036
+ search_type: string;
2037
+ operator?: string;
2038
+ };
2039
+
2040
+ declare interface SmartGridTableContextValue {
2041
+ state: SmartGridStateContext;
2042
+ tableApi: SmartGridAPI | null;
2043
+ dispatch: SmartGridDispatch;
2044
+ ACTION_TYPES: typeof ACTION_TYPES;
2045
+ toggleGroupExpansion: (rowId: string | number, rowIndex: number) => void;
2046
+ dispatchEvent: (eventType: string, eventData: Record<string, unknown>) => void;
2047
+ getRowStyle?: (params: SmartGridRowStyleParams) => CSSProperties;
2048
+ }
2049
+
2050
+ declare interface SmartGridTableInstance {
2051
+ current: HTMLElement | null;
2052
+ }
2053
+
2054
+ declare interface SmartGridTableModel {
2055
+ getData: () => SmartGridRowData[];
2056
+ modelRef?: {
2057
+ current?: SmartGridInfiniteRowModel;
2058
+ };
2059
+ infiniteCache: SmartGridInfiniteCacheReturn | null;
2060
+ getColumnDefs: () => SmartGridColumnDefinition[];
2061
+ getSortModel: () => SmartGridSortModel[];
2062
+ getFilterModel: () => SmartGridFilterModel;
2063
+ getType: () => SmartGridModelType;
2064
+ getRowsToDisplay: () => number;
2065
+ forEachNode: (callback: (node: SmartGridRowNode, index: number) => void) => void;
2066
+ getRowNode: (id: string | number) => SmartGridRowNode | null;
2067
+ getSelectedRows: () => SmartGridRowData[];
2068
+ getPaginationModel: () => SmartGridPaginationModel;
2069
+ getColumnState: () => SmartGridColumnState[];
2070
+ rowsToDisplay: SmartGridRowData[];
2071
+ }
2072
+
2073
+ declare type SmartGridTooltipGetterParams = {
2074
+ api: SmartGridAPI;
2075
+ colDef: SmartGridColumnDefinition;
2076
+ column: SmartGridColumnDefinition;
2077
+ data: SmartGridRowData;
2078
+ location: string;
2079
+ node: {
2080
+ data: SmartGridRowData;
2081
+ id: string;
2082
+ level: number;
2083
+ parent: SmartGridUpdateData;
2084
+ rowIndex: number;
2085
+ };
2086
+ rowIndex: number;
2087
+ value: unknown;
2088
+ };
2089
+
2090
+ declare type SmartGridUpdateData = {
2091
+ data: SmartGridRowData;
2092
+ setData: (data: SmartGridRowData) => void;
2093
+ setDataValue: (field: string, value: unknown, callbackNeeded?: boolean) => void;
2094
+ };
2095
+
2096
+ declare type SmartGridUpdateDataReturnType = {
2097
+ success: boolean;
2098
+ totalRows: number;
2099
+ blocksUpdated: number;
2100
+ errors: string[];
2101
+ };
2102
+
2103
+ /** Page size ref for server-side */
2104
+ declare interface SmartGridUpdatedPageSizeRef {
2105
+ current: number;
2106
+ }
2107
+
2108
+ declare type SmartGridValueFormatterConfig = {
2109
+ type?: string;
2110
+ symbol?: string;
2111
+ position?: "prefix" | "suffix";
2112
+ decimals?: number;
2113
+ };
2114
+
2115
+ declare interface SmartGridValueFormatterParams {
2116
+ value: unknown;
2117
+ data: SmartGridRowData;
2118
+ colDef: SmartGridColumnDefinition;
2119
+ }
2120
+
2121
+ declare interface SmartGridValueGetterParams {
2122
+ data: SmartGridRowData;
2123
+ node: {
2124
+ data: SmartGridRowData;
2125
+ };
2126
+ colDef: SmartGridColumnDefinition;
2127
+ column: SmartGridColumnDefinition;
2128
+ api: SmartGridAPI | null;
2129
+ columnApi?: SmartGridAPI;
2130
+ getValue: (field: string) => unknown;
2131
+ }
2132
+
2133
+ /** Viewport range */
2134
+ declare interface SmartGridViewportRange {
2135
+ startRow: number;
2136
+ endRow: number;
2137
+ }
2138
+
2139
+ declare interface SmartGridWrappedDataSource {
2140
+ _originalDatasource: SmartGridServerSideDataSource;
2141
+ _loadingBlocks: Record<number, boolean>;
2142
+ _pendingRequests: Record<number, {
2143
+ abort?: () => void;
2144
+ }>;
2145
+ _isDestroyed: boolean;
2146
+ _pendingRAFs?: number[];
2147
+ infiniteCache: unknown;
2148
+ updateCacheReference: (newCache: unknown) => void;
2149
+ destroy: () => void;
2150
+ getRows: (params: SmartGridInternalGetRowsParams) => void;
2151
+ }
2152
+
2153
+ export { }