eru-grid 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -0
- package/fesm2022/eru-grid.mjs +4756 -0
- package/fesm2022/eru-grid.mjs.map +1 -0
- package/index.d.ts +788 -0
- package/package.json +23 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,788 @@
|
|
|
1
|
+
import * as eru_grid from 'eru-grid';
|
|
2
|
+
import * as _angular_core from '@angular/core';
|
|
3
|
+
import { OnInit, AfterViewInit, OnDestroy, ElementRef, ChangeDetectorRef } from '@angular/core';
|
|
4
|
+
import { Observable } from 'rxjs';
|
|
5
|
+
import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
|
|
6
|
+
|
|
7
|
+
interface Row {
|
|
8
|
+
entity_id: string;
|
|
9
|
+
title: string;
|
|
10
|
+
groupId: string;
|
|
11
|
+
status: string;
|
|
12
|
+
index?: number;
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}
|
|
15
|
+
interface RowGroup {
|
|
16
|
+
id: string;
|
|
17
|
+
title: string;
|
|
18
|
+
totalRowCount: number;
|
|
19
|
+
rows: Row[];
|
|
20
|
+
isExpanded?: boolean;
|
|
21
|
+
isLoading?: boolean;
|
|
22
|
+
currentPage?: number;
|
|
23
|
+
hasMoreRows?: boolean;
|
|
24
|
+
currentLoadedRows: number;
|
|
25
|
+
}
|
|
26
|
+
interface GroupItem$1 {
|
|
27
|
+
type: 'header' | 'row' | 'table-header' | 'row-place-holder' | 'ghost-loading';
|
|
28
|
+
group?: RowGroup;
|
|
29
|
+
row?: Row;
|
|
30
|
+
}
|
|
31
|
+
interface ColumnWidthConstraints {
|
|
32
|
+
minWidth?: number;
|
|
33
|
+
maxWidth?: number;
|
|
34
|
+
}
|
|
35
|
+
type GridMode = 'table' | 'pivot';
|
|
36
|
+
interface GridFeatures {
|
|
37
|
+
editable: boolean;
|
|
38
|
+
columnResizable: boolean;
|
|
39
|
+
columnReorderable: boolean;
|
|
40
|
+
cellSelection: boolean;
|
|
41
|
+
rowSelection: boolean;
|
|
42
|
+
exportable: boolean;
|
|
43
|
+
filtering: boolean;
|
|
44
|
+
showColumnLines?: boolean;
|
|
45
|
+
showRowLines?: boolean;
|
|
46
|
+
enableRowSubtotals?: boolean;
|
|
47
|
+
enableColumnSubtotals?: boolean;
|
|
48
|
+
enableGrandTotal?: boolean;
|
|
49
|
+
subtotalPosition?: 'before' | 'after';
|
|
50
|
+
subtotalLabel?: string;
|
|
51
|
+
freezeField?: string;
|
|
52
|
+
}
|
|
53
|
+
interface GridStyles {
|
|
54
|
+
gridLineColor?: string;
|
|
55
|
+
gridLineWidth?: number;
|
|
56
|
+
subtotalStyle?: 'bold' | 'italic' | 'highlighted';
|
|
57
|
+
grandTotalStyle?: 'bold' | 'italic' | 'highlighted';
|
|
58
|
+
}
|
|
59
|
+
interface GridConfiguration {
|
|
60
|
+
mode: GridMode;
|
|
61
|
+
config: GridFeatures;
|
|
62
|
+
styles?: GridStyles;
|
|
63
|
+
pivot?: PivotConfiguration;
|
|
64
|
+
data?: any[];
|
|
65
|
+
columnConstraints?: {
|
|
66
|
+
global?: ColumnWidthConstraints;
|
|
67
|
+
byDatatype?: Partial<Record<DataTypes, ColumnWidthConstraints>>;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
interface Field {
|
|
71
|
+
name: string;
|
|
72
|
+
label: string;
|
|
73
|
+
datatype: DataTypes;
|
|
74
|
+
field_size: number;
|
|
75
|
+
grid_index: number;
|
|
76
|
+
minWidth?: number;
|
|
77
|
+
maxWidth?: number;
|
|
78
|
+
symbol?: string;
|
|
79
|
+
isLeaf?: boolean;
|
|
80
|
+
parentPath?: string[];
|
|
81
|
+
children?: Field[];
|
|
82
|
+
level?: number;
|
|
83
|
+
colspan?: number;
|
|
84
|
+
rowspan?: number;
|
|
85
|
+
showSubtotals?: boolean;
|
|
86
|
+
aggregationFunction?: AggregationFunction;
|
|
87
|
+
}
|
|
88
|
+
type DataTypes = 'number' | 'textbox' | 'currency' | 'date' | 'dropdown_single_select' | 'dropdown_multi_select' | 'location' | 'email' | 'people' | 'checkbox' | 'phone' | 'priority' | 'status' | 'progress' | 'attachment' | 'tags';
|
|
89
|
+
type AggregationFunction = 'sum' | 'count' | 'avg' | 'min' | 'max';
|
|
90
|
+
interface PivotColumnGroupState {
|
|
91
|
+
[groupKey: string]: {
|
|
92
|
+
isExpanded: boolean;
|
|
93
|
+
level: number;
|
|
94
|
+
childGroups?: string[];
|
|
95
|
+
parentGroup?: string;
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
interface PivotConfiguration {
|
|
99
|
+
rows: string[];
|
|
100
|
+
cols: string[];
|
|
101
|
+
aggregations: Field[];
|
|
102
|
+
clientSideThreshold?: number;
|
|
103
|
+
}
|
|
104
|
+
interface PivotMetadata {
|
|
105
|
+
totalRows: number;
|
|
106
|
+
totalColumns: number;
|
|
107
|
+
processingTime?: number;
|
|
108
|
+
memoryUsed?: number;
|
|
109
|
+
dataSize: number;
|
|
110
|
+
}
|
|
111
|
+
interface PivotRow {
|
|
112
|
+
[key: string]: any;
|
|
113
|
+
_rowKey: string;
|
|
114
|
+
_sourceCount: number;
|
|
115
|
+
_isSubtotal?: boolean;
|
|
116
|
+
_isGrandTotal?: boolean;
|
|
117
|
+
_subtotalLevel?: number;
|
|
118
|
+
_subtotalLabel?: string;
|
|
119
|
+
}
|
|
120
|
+
interface PivotColumnHeader {
|
|
121
|
+
label: string;
|
|
122
|
+
children?: PivotColumnHeader[];
|
|
123
|
+
leafColumns?: string[];
|
|
124
|
+
level: number;
|
|
125
|
+
colspan: number;
|
|
126
|
+
rowspan: number;
|
|
127
|
+
isSubtotal?: boolean;
|
|
128
|
+
isGrandTotal?: boolean;
|
|
129
|
+
subtotalLevel?: number;
|
|
130
|
+
isCollapsible?: boolean;
|
|
131
|
+
isExpanded?: boolean;
|
|
132
|
+
groupKey?: string;
|
|
133
|
+
parentGroupKey?: string;
|
|
134
|
+
collapsedValue?: any;
|
|
135
|
+
collapsedDisplayMode?: 'subtotal' | 'aggregated' | 'first-value' | 'count';
|
|
136
|
+
}
|
|
137
|
+
interface PivotHeaderStructure {
|
|
138
|
+
maxDepth: number;
|
|
139
|
+
headerRows: PivotColumnHeader[][];
|
|
140
|
+
leafColumns: Field[];
|
|
141
|
+
}
|
|
142
|
+
interface PivotResult {
|
|
143
|
+
data: PivotRow[];
|
|
144
|
+
columnDefinitions: Field[];
|
|
145
|
+
rowCount: number;
|
|
146
|
+
metadata: PivotMetadata;
|
|
147
|
+
configuration: PivotConfiguration;
|
|
148
|
+
headerStructure?: PivotHeaderStructure;
|
|
149
|
+
columnGroupState?: PivotColumnGroupState;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
declare class PivotTransformService {
|
|
153
|
+
private columnGroupState;
|
|
154
|
+
/**
|
|
155
|
+
* Main method to transform flat data into pivot table
|
|
156
|
+
*/
|
|
157
|
+
transformData(sourceData: any[], configuration: PivotConfiguration, gridConfiguration?: GridConfiguration): PivotResult;
|
|
158
|
+
/**
|
|
159
|
+
* Group data by row dimensions
|
|
160
|
+
*/
|
|
161
|
+
private groupByDimensions;
|
|
162
|
+
/**
|
|
163
|
+
* Sort grouped data hierarchically so parent dimensions appear with their children grouped together
|
|
164
|
+
*/
|
|
165
|
+
private sortGroupsHierarchically;
|
|
166
|
+
/**
|
|
167
|
+
* Natural sort that handles numbers properly
|
|
168
|
+
*/
|
|
169
|
+
private naturalSort;
|
|
170
|
+
/**
|
|
171
|
+
* Generate unique pivot column values using cartesian product of all dimension values
|
|
172
|
+
*/
|
|
173
|
+
private generatePivotColumns;
|
|
174
|
+
/**
|
|
175
|
+
* Create pivot rows with aggregated data (PERFORMANCE OPTIMIZED)
|
|
176
|
+
*/
|
|
177
|
+
private createPivotRows;
|
|
178
|
+
/**
|
|
179
|
+
* Calculate aggregation for a field (PERFORMANCE OPTIMIZED)
|
|
180
|
+
*/
|
|
181
|
+
private calculateAggregationOptimized;
|
|
182
|
+
/**
|
|
183
|
+
* Calculate aggregation for a field (ORIGINAL - kept for compatibility)
|
|
184
|
+
*/
|
|
185
|
+
private calculateAggregation;
|
|
186
|
+
/**
|
|
187
|
+
* Generate column definitions for the pivot table
|
|
188
|
+
*/
|
|
189
|
+
private generateColumnDefinitions;
|
|
190
|
+
/**
|
|
191
|
+
* Format column label for display
|
|
192
|
+
*/
|
|
193
|
+
private formatColumnLabel;
|
|
194
|
+
/**
|
|
195
|
+
* Get appropriate data type for aggregation function
|
|
196
|
+
*/
|
|
197
|
+
private getAggregationDataType;
|
|
198
|
+
/**
|
|
199
|
+
* Optimize data for large datasets by processing in chunks
|
|
200
|
+
*/
|
|
201
|
+
transformDataAsync(sourceData: any[], configuration: PivotConfiguration, chunkSize?: number): Promise<PivotResult>;
|
|
202
|
+
/**
|
|
203
|
+
* Split array into chunks
|
|
204
|
+
*/
|
|
205
|
+
private chunkArray;
|
|
206
|
+
/**
|
|
207
|
+
* Generate nested header structure for multi-dimensional columns
|
|
208
|
+
*/
|
|
209
|
+
private generateNestedHeaderStructure;
|
|
210
|
+
/**
|
|
211
|
+
* Build nested column headers recursively - generates complete cartesian product structure
|
|
212
|
+
*/
|
|
213
|
+
private buildNestedHeaders;
|
|
214
|
+
/**
|
|
215
|
+
* Calculate colspan for a header at given level
|
|
216
|
+
*/
|
|
217
|
+
private calculateColspan;
|
|
218
|
+
/**
|
|
219
|
+
* Generate leaf columns for the actual data with collapsible support
|
|
220
|
+
*/
|
|
221
|
+
private generateLeafColumnsWithCollapsible;
|
|
222
|
+
/**
|
|
223
|
+
* Get collapsed levels for a combination path
|
|
224
|
+
*/
|
|
225
|
+
private getCollapsedLevels;
|
|
226
|
+
/**
|
|
227
|
+
* Generate leaf columns for the actual data
|
|
228
|
+
*/
|
|
229
|
+
private generateLeafColumns;
|
|
230
|
+
/**
|
|
231
|
+
* Generate all combinations of dimension values
|
|
232
|
+
*/
|
|
233
|
+
private generateCombinations;
|
|
234
|
+
/**
|
|
235
|
+
* Generate flat header structure for single dimension
|
|
236
|
+
*/
|
|
237
|
+
private generateFlatHeaderStructure;
|
|
238
|
+
/**
|
|
239
|
+
* Add subtotals to pivot data based on configuration
|
|
240
|
+
*/
|
|
241
|
+
private addSubtotals;
|
|
242
|
+
/**
|
|
243
|
+
* Add subtotal rows for row dimensions
|
|
244
|
+
*/
|
|
245
|
+
private addRowSubtotals;
|
|
246
|
+
/**
|
|
247
|
+
* Add grand total row
|
|
248
|
+
*/
|
|
249
|
+
private addGrandTotalRow;
|
|
250
|
+
/**
|
|
251
|
+
* Calculate grand total values for all rows (ignores showSubtotals flag)
|
|
252
|
+
*/
|
|
253
|
+
private calculateGrandTotalRow;
|
|
254
|
+
/**
|
|
255
|
+
* Calculate subtotal values for a group of rows
|
|
256
|
+
*/
|
|
257
|
+
private calculateSubtotalRow;
|
|
258
|
+
/**
|
|
259
|
+
* Apply aggregation function to array of values
|
|
260
|
+
*/
|
|
261
|
+
private applyAggregationFunction;
|
|
262
|
+
/**
|
|
263
|
+
* Group rows by dimension values
|
|
264
|
+
*/
|
|
265
|
+
private groupRowsByDimensions;
|
|
266
|
+
/**
|
|
267
|
+
* Export pivot data to CSV format
|
|
268
|
+
*/
|
|
269
|
+
exportToCsv(pivotResult: PivotResult): string;
|
|
270
|
+
/**
|
|
271
|
+
* Initialize column group state based on configuration
|
|
272
|
+
*/
|
|
273
|
+
/**
|
|
274
|
+
* Generate unique key for column group
|
|
275
|
+
*/
|
|
276
|
+
private generateColumnGroupKey;
|
|
277
|
+
/**
|
|
278
|
+
* Toggle collapse/expand state of a column group
|
|
279
|
+
*/
|
|
280
|
+
toggleColumnGroup(groupKey: string, configuration: PivotConfiguration): void;
|
|
281
|
+
/**
|
|
282
|
+
* Check if a column group is expanded
|
|
283
|
+
*/
|
|
284
|
+
isColumnGroupExpanded(groupKey: string): boolean;
|
|
285
|
+
/**
|
|
286
|
+
* Get collapsed value for a column group
|
|
287
|
+
*/
|
|
288
|
+
/**
|
|
289
|
+
* Calculate subtotal for a column group
|
|
290
|
+
*/
|
|
291
|
+
private calculateGroupSubtotal;
|
|
292
|
+
/**
|
|
293
|
+
* Calculate aggregated value for a column group
|
|
294
|
+
*/
|
|
295
|
+
private calculateGroupAggregation;
|
|
296
|
+
/**
|
|
297
|
+
* Get column keys that belong to a specific group
|
|
298
|
+
*/
|
|
299
|
+
private getGroupColumnKeys;
|
|
300
|
+
/**
|
|
301
|
+
* Get first child value for a column group
|
|
302
|
+
*/
|
|
303
|
+
private getFirstChildValue;
|
|
304
|
+
/**
|
|
305
|
+
* Get count of non-null values in a column group
|
|
306
|
+
*/
|
|
307
|
+
private getGroupValueCount;
|
|
308
|
+
/**
|
|
309
|
+
* Get current column group state
|
|
310
|
+
*/
|
|
311
|
+
getColumnGroupState(): PivotColumnGroupState;
|
|
312
|
+
/**
|
|
313
|
+
* Set column group state (for restoring state)
|
|
314
|
+
*/
|
|
315
|
+
setColumnGroupState(state: PivotColumnGroupState): void;
|
|
316
|
+
/**
|
|
317
|
+
* Calculate rowspan information for pivot rows to merge cells with same values
|
|
318
|
+
* in earlier dimensions
|
|
319
|
+
*/
|
|
320
|
+
calculateRowspanInfo(pivotRows: PivotRow[], rowDimensions: string[]): Map<string, {
|
|
321
|
+
rowspan: number;
|
|
322
|
+
skip: boolean;
|
|
323
|
+
parentSpan: number;
|
|
324
|
+
}>;
|
|
325
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PivotTransformService, never>;
|
|
326
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<PivotTransformService>;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
declare class GridStore {
|
|
330
|
+
private readonly gridConfigService;
|
|
331
|
+
private readonly pivotTransformService;
|
|
332
|
+
private readonly _columns;
|
|
333
|
+
private readonly _groups;
|
|
334
|
+
private readonly _rows;
|
|
335
|
+
private readonly _selectedRowIds;
|
|
336
|
+
private readonly _configuration;
|
|
337
|
+
private readonly _isLoading;
|
|
338
|
+
private readonly _error;
|
|
339
|
+
private readonly _activeCell;
|
|
340
|
+
private readonly _pivotConfiguration;
|
|
341
|
+
private readonly _pivotResult;
|
|
342
|
+
readonly columns: _angular_core.Signal<Field[]>;
|
|
343
|
+
readonly groups: _angular_core.Signal<RowGroup[]>;
|
|
344
|
+
readonly rows: _angular_core.Signal<Row[]>;
|
|
345
|
+
readonly selectedRowIds: _angular_core.Signal<Set<string>>;
|
|
346
|
+
readonly configuration: _angular_core.Signal<GridConfiguration>;
|
|
347
|
+
readonly isLoading: _angular_core.Signal<boolean>;
|
|
348
|
+
readonly error: _angular_core.Signal<string | null>;
|
|
349
|
+
readonly activeCell: _angular_core.Signal<any>;
|
|
350
|
+
readonly pivotConfiguration: _angular_core.Signal<PivotConfiguration | null>;
|
|
351
|
+
readonly pivotResult: _angular_core.Signal<PivotResult | null>;
|
|
352
|
+
readonly selectedRows: _angular_core.Signal<Row[]>;
|
|
353
|
+
readonly totalSelectedCount: _angular_core.Signal<number>;
|
|
354
|
+
readonly hasSelection: _angular_core.Signal<boolean>;
|
|
355
|
+
readonly expandedGroups: _angular_core.Signal<RowGroup[]>;
|
|
356
|
+
readonly visibleColumns: _angular_core.Signal<Field[]>;
|
|
357
|
+
readonly rowsByGroup: _angular_core.Signal<Map<string, Row[]>>;
|
|
358
|
+
readonly currentMode: _angular_core.Signal<GridMode>;
|
|
359
|
+
readonly isPivotMode: _angular_core.Signal<boolean>;
|
|
360
|
+
readonly isEditingEnabled: _angular_core.Signal<boolean>;
|
|
361
|
+
readonly displayColumns: _angular_core.Signal<Field[]>;
|
|
362
|
+
readonly displayData: _angular_core.Signal<Row[] | eru_grid.PivotRow[]>;
|
|
363
|
+
readonly pivotDisplayData: _angular_core.Signal<eru_grid.PivotRow[]>;
|
|
364
|
+
readonly tableDisplayData: _angular_core.Signal<Row[]>;
|
|
365
|
+
setColumns(columns: Field[]): void;
|
|
366
|
+
reorderColumns(fromIndex: number, toIndex: number): void;
|
|
367
|
+
updateColumnWidth(columnName: string, field_size: number): void;
|
|
368
|
+
setGroups(groups: RowGroup[]): void;
|
|
369
|
+
toggleGroupExpansion(groupId: string): void;
|
|
370
|
+
updateGroupLoadingState(groupId: string, isLoading: boolean): void;
|
|
371
|
+
updateGroupAfterLoading(groupId: string, loadedCount: number, fullyExhausted?: boolean): void;
|
|
372
|
+
setRows(rows: Row[]): void;
|
|
373
|
+
addRows(newRows: Row[]): void;
|
|
374
|
+
updateRow(rowId: string, updates: Partial<Row>): void;
|
|
375
|
+
selectRow(rowId: string): void;
|
|
376
|
+
deselectRow(rowId: string): void;
|
|
377
|
+
toggleRowSelection(rowId: string): void;
|
|
378
|
+
selectAllRowsInGroup(groupId: string): void;
|
|
379
|
+
deselectAllRowsInGroup(groupId: string): void;
|
|
380
|
+
clearSelection(): void;
|
|
381
|
+
setConfiguration(configuration: GridConfiguration): void;
|
|
382
|
+
gridConfiguration(): GridConfiguration;
|
|
383
|
+
setActiveCell(activeCell: any): void;
|
|
384
|
+
setLoading(isLoading: boolean): void;
|
|
385
|
+
setError(error: string | null): void;
|
|
386
|
+
fetchNewRowData(pageSize: number, page: number, group: RowGroup): Observable<any[]>;
|
|
387
|
+
isRowSelected(rowId: string): boolean;
|
|
388
|
+
isGroupSelected(groupId: string): boolean;
|
|
389
|
+
getRowsForGroup(groupId: string): Row[];
|
|
390
|
+
setGridMode(mode: GridMode): void;
|
|
391
|
+
updateGridConfiguration(updates: Partial<GridConfiguration>): void;
|
|
392
|
+
setPivotConfiguration(pivotConfig: PivotConfiguration): void;
|
|
393
|
+
setSourceData(data: any[]): void;
|
|
394
|
+
private transformToPivot;
|
|
395
|
+
clearPivot(): void;
|
|
396
|
+
forceRefreshPivot(): void;
|
|
397
|
+
exportPivotToCsv(): string | null;
|
|
398
|
+
validatePivotConfiguration(config: PivotConfiguration): {
|
|
399
|
+
isValid: boolean;
|
|
400
|
+
errors: string[];
|
|
401
|
+
};
|
|
402
|
+
isFeatureEnabled(feature: keyof Omit<GridFeatures, 'subtotalPosition' | 'subtotalLabel' | 'freezeField'>): boolean;
|
|
403
|
+
/**
|
|
404
|
+
* Get access to the PivotTransformService for external manipulation
|
|
405
|
+
*/
|
|
406
|
+
getPivotTransformService(): PivotTransformService;
|
|
407
|
+
/**
|
|
408
|
+
* Regenerate pivot data (useful after column group state changes)
|
|
409
|
+
*/
|
|
410
|
+
regeneratePivotData(): void;
|
|
411
|
+
/**
|
|
412
|
+
* Update pivot configuration and regenerate if needed
|
|
413
|
+
*/
|
|
414
|
+
updatePivotConfiguration(updates: Partial<PivotConfiguration>): void;
|
|
415
|
+
/**
|
|
416
|
+
* Check if freeze is enabled and valid for current mode
|
|
417
|
+
*/
|
|
418
|
+
isFreezeEnabled(): boolean;
|
|
419
|
+
/**
|
|
420
|
+
* Validate freeze field for pivot mode
|
|
421
|
+
*/
|
|
422
|
+
private isValidPivotFreezeField;
|
|
423
|
+
/**
|
|
424
|
+
* Get the freeze field name
|
|
425
|
+
*/
|
|
426
|
+
getFreezeField(): string | null;
|
|
427
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<GridStore, never>;
|
|
428
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<GridStore>;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
type Theme = 'light' | 'dark' | 'high-contrast' | 'auto';
|
|
432
|
+
declare class ThemeService {
|
|
433
|
+
private document;
|
|
434
|
+
private readonly storageKey;
|
|
435
|
+
private readonly _currentTheme;
|
|
436
|
+
private readonly _systemTheme;
|
|
437
|
+
readonly currentTheme: _angular_core.Signal<Theme>;
|
|
438
|
+
readonly systemTheme: _angular_core.Signal<"light" | "dark">;
|
|
439
|
+
readonly effectiveTheme: _angular_core.WritableSignal<"light" | "dark" | "high-contrast">;
|
|
440
|
+
constructor();
|
|
441
|
+
private initializeTheme;
|
|
442
|
+
private setupSystemThemeListener;
|
|
443
|
+
private applyTheme;
|
|
444
|
+
private updateCSSVariables;
|
|
445
|
+
setTheme(theme: Theme): void;
|
|
446
|
+
toggleTheme(): void;
|
|
447
|
+
getAvailableThemes(): Array<{
|
|
448
|
+
value: Theme;
|
|
449
|
+
label: string;
|
|
450
|
+
}>;
|
|
451
|
+
isLightTheme(): boolean;
|
|
452
|
+
isDarkTheme(): boolean;
|
|
453
|
+
isHighContrastTheme(): boolean;
|
|
454
|
+
isAutoTheme(): boolean;
|
|
455
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ThemeService, never>;
|
|
456
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ThemeService>;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
declare class ColumnConstraintsService {
|
|
460
|
+
private readonly DATATYPE_DEFAULTS;
|
|
461
|
+
/**
|
|
462
|
+
* Get effective constraints for a column, considering all override levels
|
|
463
|
+
*/
|
|
464
|
+
getColumnConstraints(column: Field | undefined, gridConfig?: GridConfiguration): ColumnWidthConstraints;
|
|
465
|
+
/**
|
|
466
|
+
* Validate and constrain a width value for a column
|
|
467
|
+
*/
|
|
468
|
+
constrainWidth(width: number, column: Field | undefined, gridConfig?: GridConfiguration): number;
|
|
469
|
+
/**
|
|
470
|
+
* Get all datatype defaults (for documentation/debugging)
|
|
471
|
+
*/
|
|
472
|
+
getDatatypeDefaults(): Record<DataTypes, ColumnWidthConstraints>;
|
|
473
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ColumnConstraintsService, never>;
|
|
474
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ColumnConstraintsService>;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
declare class EruGridService {
|
|
478
|
+
private gridStore;
|
|
479
|
+
private themeService;
|
|
480
|
+
private columnConstraintsService;
|
|
481
|
+
constructor(gridStore: GridStore, themeService: ThemeService, columnConstraintsService: ColumnConstraintsService);
|
|
482
|
+
set_table_configuration(data: GridConfiguration): void;
|
|
483
|
+
set_table_column(data: Field[]): void;
|
|
484
|
+
set_table_group(data: RowGroup[]): void;
|
|
485
|
+
get columns(): _angular_core.Signal<Field[]>;
|
|
486
|
+
get groups(): _angular_core.Signal<RowGroup[]>;
|
|
487
|
+
get rows(): _angular_core.Signal<eru_grid.Row[]>;
|
|
488
|
+
get selectedRowIds(): _angular_core.Signal<Set<string>>;
|
|
489
|
+
get hasSelection(): _angular_core.Signal<boolean>;
|
|
490
|
+
get theme(): ThemeService;
|
|
491
|
+
getColumnConstraints(column: Field | undefined): eru_grid.ColumnWidthConstraints;
|
|
492
|
+
constrainColumnWidth(width: number, column: Field | undefined): number;
|
|
493
|
+
getDatatypeDefaults(): Record<DataTypes, eru_grid.ColumnWidthConstraints>;
|
|
494
|
+
/**
|
|
495
|
+
* Configure the grid for pivot mode with pivot configuration
|
|
496
|
+
*/
|
|
497
|
+
set_pivot_configuration(pivotConfig: PivotConfiguration, sourceData?: any[]): void;
|
|
498
|
+
/**
|
|
499
|
+
* Switch grid to table mode or pivot mode
|
|
500
|
+
*/
|
|
501
|
+
set_grid_mode(mode: GridMode): void;
|
|
502
|
+
/**
|
|
503
|
+
* Update grid configuration with new settings
|
|
504
|
+
*/
|
|
505
|
+
update_grid_configuration(updates: Partial<GridConfiguration>): void;
|
|
506
|
+
/**
|
|
507
|
+
* Enable or disable specific grid features
|
|
508
|
+
*/
|
|
509
|
+
set_grid_features(features: Partial<GridFeatures>): void;
|
|
510
|
+
/**
|
|
511
|
+
* Clear pivot configuration and return to table mode
|
|
512
|
+
*/
|
|
513
|
+
clear_pivot(): void;
|
|
514
|
+
/**
|
|
515
|
+
* Export pivot data to CSV format
|
|
516
|
+
*/
|
|
517
|
+
export_pivot_to_csv(): string | null;
|
|
518
|
+
/**
|
|
519
|
+
* Validate pivot configuration
|
|
520
|
+
*/
|
|
521
|
+
validate_pivot_configuration(config: PivotConfiguration): {
|
|
522
|
+
isValid: boolean;
|
|
523
|
+
errors: string[];
|
|
524
|
+
};
|
|
525
|
+
get currentMode(): _angular_core.Signal<GridMode>;
|
|
526
|
+
get isPivotMode(): _angular_core.Signal<boolean>;
|
|
527
|
+
get pivotConfiguration(): _angular_core.Signal<PivotConfiguration | null>;
|
|
528
|
+
get pivotResult(): _angular_core.Signal<eru_grid.PivotResult | null>;
|
|
529
|
+
get displayColumns(): _angular_core.Signal<Field[]>;
|
|
530
|
+
get displayData(): _angular_core.Signal<eru_grid.Row[] | eru_grid.PivotRow[]>;
|
|
531
|
+
get isEditingEnabled(): _angular_core.Signal<boolean>;
|
|
532
|
+
get configuration(): _angular_core.Signal<GridConfiguration>;
|
|
533
|
+
get isLoading(): _angular_core.Signal<boolean>;
|
|
534
|
+
get error(): _angular_core.Signal<string | null>;
|
|
535
|
+
/**
|
|
536
|
+
* Check if a specific feature is enabled
|
|
537
|
+
*/
|
|
538
|
+
isFeatureEnabled(feature: keyof Omit<GridFeatures, 'subtotalPosition' | 'subtotalLabel' | 'freezeField'>): boolean;
|
|
539
|
+
/**
|
|
540
|
+
* Get direct access to grid store (for debugging purposes)
|
|
541
|
+
*/
|
|
542
|
+
getGridStore(): GridStore;
|
|
543
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EruGridService, never>;
|
|
544
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<EruGridService>;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
declare class EruGridComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
548
|
+
private changeDetectorRef;
|
|
549
|
+
gridStore: GridStore;
|
|
550
|
+
private resizeObserver;
|
|
551
|
+
isColumnReordering: _angular_core.WritableSignal<boolean>;
|
|
552
|
+
viewport?: CdkVirtualScrollViewport;
|
|
553
|
+
rowContainer?: ElementRef;
|
|
554
|
+
private rowLoadQueue;
|
|
555
|
+
private isProcessingQueue;
|
|
556
|
+
groupedRows: _angular_core.Signal<GroupItem[]>;
|
|
557
|
+
columns: _angular_core.Signal<Field[]>;
|
|
558
|
+
selectedRowIds: _angular_core.Signal<Set<string>>;
|
|
559
|
+
currentPivotScrollIndex: _angular_core.WritableSignal<number>;
|
|
560
|
+
firstDataRowIndex: _angular_core.WritableSignal<number>;
|
|
561
|
+
private _virtualRowspanCache;
|
|
562
|
+
showColumnLines: _angular_core.Signal<boolean>;
|
|
563
|
+
showRowLines: _angular_core.Signal<boolean>;
|
|
564
|
+
gridLineColor: _angular_core.Signal<string>;
|
|
565
|
+
gridLineWidth: _angular_core.Signal<number>;
|
|
566
|
+
maxDepth: _angular_core.Signal<number>;
|
|
567
|
+
subtotalStyle: _angular_core.Signal<"bold" | "italic" | "highlighted">;
|
|
568
|
+
grandTotalStyle: _angular_core.Signal<"bold" | "italic" | "highlighted">;
|
|
569
|
+
/**
|
|
570
|
+
* Check if a row is the first visible row in the pivot viewport
|
|
571
|
+
* @param rowIndex The index of the row in the virtual scroll
|
|
572
|
+
* @returns true if this is the first visible row
|
|
573
|
+
*/
|
|
574
|
+
isFirstVisiblePivotRow(rowIndex: number): boolean;
|
|
575
|
+
/**
|
|
576
|
+
* Check if a specific row is the first visible row by comparing with scroll index
|
|
577
|
+
* @param rowIndex The index of the row to check
|
|
578
|
+
* @returns true if this row is the first visible row
|
|
579
|
+
*/
|
|
580
|
+
isRowFirstVisible(rowIndex: number): boolean;
|
|
581
|
+
/**
|
|
582
|
+
* Handle scroll events for pivot mode
|
|
583
|
+
* @param scrollIndex The current scroll index
|
|
584
|
+
*/
|
|
585
|
+
onPivotScroll(scrollIndex: number): void;
|
|
586
|
+
/**
|
|
587
|
+
* Get the actual data index of the first visible row in the pivot data array
|
|
588
|
+
* @returns The actual index in the pivot data array, or -1 if not available
|
|
589
|
+
*/
|
|
590
|
+
getFirstVisiblePivotDataIndex(): number;
|
|
591
|
+
/**
|
|
592
|
+
* Get the truly visible range (what's actually visible on screen)
|
|
593
|
+
* @returns Object with start, end, and count of visible items
|
|
594
|
+
*/
|
|
595
|
+
getVisibleRange(): {
|
|
596
|
+
start: number;
|
|
597
|
+
end: number;
|
|
598
|
+
count: number;
|
|
599
|
+
};
|
|
600
|
+
/**
|
|
601
|
+
* Calculate the actual number of items visible in the viewport
|
|
602
|
+
* This accounts for headers, padding, and actual viewport dimensions
|
|
603
|
+
*/
|
|
604
|
+
private getActualVisibleItemCount;
|
|
605
|
+
/**
|
|
606
|
+
* Get the rendered range (what's in the DOM including buffer)
|
|
607
|
+
* @returns Object with start, end, and count of rendered items
|
|
608
|
+
*/
|
|
609
|
+
getRenderedRange(): {
|
|
610
|
+
start: number;
|
|
611
|
+
end: number;
|
|
612
|
+
count: number;
|
|
613
|
+
};
|
|
614
|
+
/**
|
|
615
|
+
* Get current scroll and visibility information for debugging
|
|
616
|
+
* @returns Object with current scroll state and ranges
|
|
617
|
+
*/
|
|
618
|
+
getCurrentScrollInfo(): {
|
|
619
|
+
scrollIndex: number;
|
|
620
|
+
visibleRange: {
|
|
621
|
+
start: number;
|
|
622
|
+
end: number;
|
|
623
|
+
count: number;
|
|
624
|
+
};
|
|
625
|
+
renderedRange: {
|
|
626
|
+
start: number;
|
|
627
|
+
end: number;
|
|
628
|
+
count: number;
|
|
629
|
+
};
|
|
630
|
+
cdkViewportSize: number;
|
|
631
|
+
actualVisibleCount: number;
|
|
632
|
+
dataLength: number;
|
|
633
|
+
viewportHeight: number;
|
|
634
|
+
};
|
|
635
|
+
private updateGridLineStyles;
|
|
636
|
+
private readonly ROWS_PER_PAGE;
|
|
637
|
+
private readonly SCROLL_THRESHOLD;
|
|
638
|
+
private lastLoadedGroupIds;
|
|
639
|
+
constructor(changeDetectorRef: ChangeDetectorRef);
|
|
640
|
+
ngOnInit(): void;
|
|
641
|
+
ngAfterViewInit(): void;
|
|
642
|
+
ngOnDestroy(): void;
|
|
643
|
+
private createGroupedRows;
|
|
644
|
+
private recalculateViewport;
|
|
645
|
+
initializeGroups(): void;
|
|
646
|
+
private fetchInitialRows;
|
|
647
|
+
fetchRowsForGroup(groupId: string, page: number, pageSize?: number): Promise<void>;
|
|
648
|
+
private updateGroupLoadingState;
|
|
649
|
+
private updateGroupAfterLoading;
|
|
650
|
+
onScroll(scrollIndex: number): void;
|
|
651
|
+
private getVisibleGroups;
|
|
652
|
+
private getGroupItemAtIndex;
|
|
653
|
+
private checkAndLoadMoreRows;
|
|
654
|
+
private intelligentRowLoading;
|
|
655
|
+
private checkGroupRowLoading;
|
|
656
|
+
private queueRowLoading;
|
|
657
|
+
private adjustColumnWidths;
|
|
658
|
+
private ensureHorizontalScroll;
|
|
659
|
+
trackByColumnFn(index: number, column: Field): string;
|
|
660
|
+
trackByGroupItemFn(index: number, groupItem: GroupItem): string;
|
|
661
|
+
trackByPivotRowFn(index: number, pivotRow: PivotRow): string;
|
|
662
|
+
trackByHeaderFn(index: number, header: any): string;
|
|
663
|
+
hasNestedHeaders(): boolean;
|
|
664
|
+
getHeaderRows(): any[][];
|
|
665
|
+
getLeafColumns(): Field[];
|
|
666
|
+
isRowDimensionHeader(header: any): boolean;
|
|
667
|
+
getPivotGridColumns(): string;
|
|
668
|
+
private initializeColumnWidths;
|
|
669
|
+
private measureAndSetContainerDimensions;
|
|
670
|
+
private normalizeRowData;
|
|
671
|
+
private getDisplayValue;
|
|
672
|
+
private getGenericRowDisplay;
|
|
673
|
+
toggleRowSelection(event: Event, row: any): void;
|
|
674
|
+
toggleGroupSelection(event: Event, groupId: string): void;
|
|
675
|
+
toggleAllGroups(event: Event): void;
|
|
676
|
+
isRowSelected(rowId?: string): boolean;
|
|
677
|
+
isGroupSelected(groupId: string): boolean;
|
|
678
|
+
isAllGroupsSelected(): boolean;
|
|
679
|
+
getSelectedRows(): any[];
|
|
680
|
+
private markGroupAsNoMoreRows;
|
|
681
|
+
toggleGroupExpansion(groupId: string): void;
|
|
682
|
+
private processRowLoadQueue;
|
|
683
|
+
/**
|
|
684
|
+
* Toggle collapse/expand state of a column group
|
|
685
|
+
*/
|
|
686
|
+
toggleColumnGroup(groupKey: string): void;
|
|
687
|
+
/**
|
|
688
|
+
* Check if a column group is expanded
|
|
689
|
+
*/
|
|
690
|
+
isColumnGroupExpanded(groupKey: string): boolean;
|
|
691
|
+
/**
|
|
692
|
+
* Get rowspan information for pivot table cells
|
|
693
|
+
*/
|
|
694
|
+
private _rowspanInfo;
|
|
695
|
+
/**
|
|
696
|
+
* Debug counter for sticky column debugging
|
|
697
|
+
*/
|
|
698
|
+
private _stickyDebugCount;
|
|
699
|
+
getRowspanInfo(): Map<string, {
|
|
700
|
+
rowspan: number;
|
|
701
|
+
skip: boolean;
|
|
702
|
+
parentSpan: number;
|
|
703
|
+
}>;
|
|
704
|
+
/**
|
|
705
|
+
* Clear rowspan cache when pivot data changes
|
|
706
|
+
*/
|
|
707
|
+
clearRowspanCache(): void;
|
|
708
|
+
/**
|
|
709
|
+
* Get the effective rowspan for a cell in virtual scrolling context
|
|
710
|
+
* This method ensures proper rowspan continuity when scrolling
|
|
711
|
+
*/
|
|
712
|
+
getEffectiveRowspan(visibleRowIndex: number, columnName: string): number | null;
|
|
713
|
+
/**
|
|
714
|
+
* Find virtual parent information for cells that inherit rowspan from a parent row
|
|
715
|
+
*/
|
|
716
|
+
private findVirtualParent;
|
|
717
|
+
/**
|
|
718
|
+
* Find the first visible row index that should show the value for a given column
|
|
719
|
+
*/
|
|
720
|
+
private findFirstVisibleRowForColumn;
|
|
721
|
+
/**
|
|
722
|
+
* Check if a cell should be skipped (hidden due to rowspan) - ENHANCED FOR VIRTUAL SCROLLING
|
|
723
|
+
*/
|
|
724
|
+
shouldSkipCell(rowIndex: number, columnName: string): boolean;
|
|
725
|
+
/**
|
|
726
|
+
* Get the effective cell value, considering virtual parents for virtual scrolling
|
|
727
|
+
*/
|
|
728
|
+
getEffectiveCellValue(index: number, columnName: string, pivotRow: any): any;
|
|
729
|
+
/**
|
|
730
|
+
* Get rowspan value for a specific cell - VIRTUAL SCROLLING COMPATIBLE
|
|
731
|
+
* This is a compatibility wrapper around getEffectiveRowspan
|
|
732
|
+
*/
|
|
733
|
+
getCellRowspan(rowIndex: number, columnName: string): number;
|
|
734
|
+
/**
|
|
735
|
+
* Get columns that should be frozen on the left (all row dimensions up to and including freezeField)
|
|
736
|
+
*/
|
|
737
|
+
getRowDimensionColumns(): any[];
|
|
738
|
+
/**
|
|
739
|
+
* Get columns that should be scrollable on the right (all except frozen fields)
|
|
740
|
+
*/
|
|
741
|
+
getColumnDimensionColumns(): any[];
|
|
742
|
+
/**
|
|
743
|
+
* Get headers that should be frozen (all row dimension headers up to and including freezeField)
|
|
744
|
+
*/
|
|
745
|
+
getRowDimensionHeaders(headerRow: any[]): any[];
|
|
746
|
+
/**
|
|
747
|
+
* Get headers that should be scrollable (all except frozen fields)
|
|
748
|
+
*/
|
|
749
|
+
getColumnDimensionHeaders(headerRow: any[]): any[];
|
|
750
|
+
/**
|
|
751
|
+
* Check if a column should be sticky (frozen on the left)
|
|
752
|
+
*/
|
|
753
|
+
isStickyColumn(columnName: string, colIndex: number): boolean;
|
|
754
|
+
/**
|
|
755
|
+
* Get the left position for sticky columns (CSS left value)
|
|
756
|
+
*/
|
|
757
|
+
getStickyColumnLeft(columnName: string, colIndex: number): number;
|
|
758
|
+
/**
|
|
759
|
+
* Check if a column is a row dimension column
|
|
760
|
+
*/
|
|
761
|
+
isRowDimensionColumn(columnName: string): boolean;
|
|
762
|
+
private setupScrollSync;
|
|
763
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EruGridComponent, never>;
|
|
764
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<EruGridComponent, "eru-grid", never, {}, {}, never, never, true, never>;
|
|
765
|
+
}
|
|
766
|
+
interface GroupItem {
|
|
767
|
+
type: 'header' | 'row' | 'table-header' | 'row-place-holder' | 'ghost-loading';
|
|
768
|
+
group?: RowGroup;
|
|
769
|
+
row?: Row;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
declare class ThemeToggleComponent {
|
|
773
|
+
private themeService;
|
|
774
|
+
availableThemes: {
|
|
775
|
+
value: Theme;
|
|
776
|
+
label: string;
|
|
777
|
+
}[];
|
|
778
|
+
getCurrentThemeLabel(): string;
|
|
779
|
+
getCurrentThemeIcon(): string;
|
|
780
|
+
getThemeIcon(theme: Theme): string;
|
|
781
|
+
isActiveTheme(theme: Theme): boolean;
|
|
782
|
+
setTheme(theme: Theme): void;
|
|
783
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ThemeToggleComponent, never>;
|
|
784
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ThemeToggleComponent, "eru-theme-toggle", never, {}, {}, never, never, true, never>;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
export { ColumnConstraintsService, EruGridComponent, EruGridService, GridStore, ThemeService, ThemeToggleComponent };
|
|
788
|
+
export type { AggregationFunction, ColumnWidthConstraints, DataTypes, Field, GridConfiguration, GridFeatures, GridMode, GridStyles, GroupItem$1 as GroupItem, PivotColumnGroupState, PivotColumnHeader, PivotConfiguration, PivotHeaderStructure, PivotMetadata, PivotResult, PivotRow, Row, RowGroup, Theme };
|