rowvia 0.1.0
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 +228 -0
- package/dist/rowvia.css +1 -0
- package/dist/rowvia.es.js +8962 -0
- package/dist/rowvia.umd.cjs +37 -0
- package/dist/types/api.d.ts +6 -0
- package/dist/types/components/detailDialog.d.ts +13 -0
- package/dist/types/core/clientSideRowModel.d.ts +116 -0
- package/dist/types/core/columnModel.d.ts +95 -0
- package/dist/types/core/eventService.d.ts +11 -0
- package/dist/types/core/formulaEngine.d.ts +42 -0
- package/dist/types/core/localeText.d.ts +15 -0
- package/dist/types/core/remoteRowModels.d.ts +170 -0
- package/dist/types/core/rowNode.d.ts +51 -0
- package/dist/types/core/utils.d.ts +38 -0
- package/dist/types/core/valueService.d.ts +14 -0
- package/dist/types/features/chartService.d.ts +49 -0
- package/dist/types/features/columnMenu.d.ts +9 -0
- package/dist/types/features/contextMenu.d.ts +27 -0
- package/dist/types/features/editService.d.ts +62 -0
- package/dist/types/features/exportService.d.ts +39 -0
- package/dist/types/features/filterGui.d.ts +19 -0
- package/dist/types/features/filterService.d.ts +36 -0
- package/dist/types/features/findService.d.ts +27 -0
- package/dist/types/features/formulaEditor.d.ts +11 -0
- package/dist/types/features/notesService.d.ts +23 -0
- package/dist/types/features/overlays.d.ts +14 -0
- package/dist/types/features/paginationService.d.ts +32 -0
- package/dist/types/features/pdfWriter.d.ts +24 -0
- package/dist/types/features/popupService.d.ts +15 -0
- package/dist/types/features/rangeSelection.d.ts +43 -0
- package/dist/types/features/rowDragService.d.ts +25 -0
- package/dist/types/features/rowGroupPanel.d.ts +10 -0
- package/dist/types/features/selectionService.d.ts +34 -0
- package/dist/types/features/sideBar.d.ts +29 -0
- package/dist/types/features/sortService.d.ts +12 -0
- package/dist/types/features/statusBar.d.ts +14 -0
- package/dist/types/features/undoRedoService.d.ts +40 -0
- package/dist/types/features/xlsxReader.d.ts +7 -0
- package/dist/types/features/xlsxWriter.d.ts +10 -0
- package/dist/types/gantt/component.d.ts +25 -0
- package/dist/types/gantt/data.d.ts +31 -0
- package/dist/types/gantt/filterSort.d.ts +50 -0
- package/dist/types/gantt/ganttChart.d.ts +122 -0
- package/dist/types/gantt/index.d.ts +5 -0
- package/dist/types/gantt/locale.d.ts +10 -0
- package/dist/types/grid.d.ts +168 -0
- package/dist/types/index.d.ts +28 -0
- package/dist/types/personnel/component.d.ts +20 -0
- package/dist/types/personnel/index.d.ts +3 -0
- package/dist/types/personnel/model.d.ts +31 -0
- package/dist/types/render/cellRenderers.d.ts +30 -0
- package/dist/types/render/headerView.d.ts +64 -0
- package/dist/types/render/rowRenderer.d.ts +190 -0
- package/dist/types/render/stickyGroupRows.d.ts +21 -0
- package/dist/types/types.d.ts +889 -0
- package/package.json +47 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface DetailDialogContent {
|
|
2
|
+
title: string;
|
|
3
|
+
fields: Array<{
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}>;
|
|
7
|
+
}
|
|
8
|
+
/** Text-only detail dialog owned by its mount, with no global IDs or selectors. */
|
|
9
|
+
export declare function createDetailDialog(container: HTMLElement): {
|
|
10
|
+
open(content: DetailDialogContent): void;
|
|
11
|
+
close: () => void;
|
|
12
|
+
destroy(): void;
|
|
13
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { Column, GridOptions, RowDataTransaction, RowNode, RowNodeTransactionResult } from '../types';
|
|
2
|
+
import { type RowNodeServices } from './rowNode';
|
|
3
|
+
import { EventService } from './eventService';
|
|
4
|
+
export interface RowModel {
|
|
5
|
+
getType(): string;
|
|
6
|
+
/** optional: notify the model that the visible row window changed */
|
|
7
|
+
onViewportChanged?(startRow: number, endRow: number): void;
|
|
8
|
+
/** optional: remote models re-fetch after sort/filter/group changes */
|
|
9
|
+
onSortOrFilterChanged?(): void;
|
|
10
|
+
/** optional: expand/collapse a group node */
|
|
11
|
+
setNodeExpanded?(node: RowNode, expanded: boolean): void;
|
|
12
|
+
/** optional: grid api handle (client-side model only) */
|
|
13
|
+
setGridApi?(api: any): void;
|
|
14
|
+
getRowCount(): number;
|
|
15
|
+
getRow(index: number): RowNode | undefined;
|
|
16
|
+
getRowNode(id: string): RowNode | undefined;
|
|
17
|
+
forEachNode(callback: (node: RowNode, index: number) => void): void;
|
|
18
|
+
forEachLeafNode(callback: (node: RowNode, index: number) => void): void;
|
|
19
|
+
isEmpty(): boolean;
|
|
20
|
+
getTopLevelRows(): RowNode[];
|
|
21
|
+
refreshModel(step?: string): void;
|
|
22
|
+
updateRowData(rowData: any[]): void;
|
|
23
|
+
applyTransaction(transaction: RowDataTransaction): RowNodeTransactionResult | null;
|
|
24
|
+
destroy(): void;
|
|
25
|
+
expandAll(): void;
|
|
26
|
+
collapseAll(): void;
|
|
27
|
+
getPinnedTopRowCount(): number;
|
|
28
|
+
getPinnedBottomRowCount(): number;
|
|
29
|
+
getRowIndexAtPixel?(pixel: number): number;
|
|
30
|
+
}
|
|
31
|
+
interface FilterModelEntry {
|
|
32
|
+
filterType: string;
|
|
33
|
+
type?: string;
|
|
34
|
+
filter?: any;
|
|
35
|
+
filterTo?: any;
|
|
36
|
+
dateFrom?: string;
|
|
37
|
+
dateTo?: string;
|
|
38
|
+
values?: any[];
|
|
39
|
+
operator?: 'AND' | 'OR';
|
|
40
|
+
condition1?: any;
|
|
41
|
+
condition2?: any;
|
|
42
|
+
filterModels?: any[];
|
|
43
|
+
}
|
|
44
|
+
export declare class ClientSideRowModel implements RowModel {
|
|
45
|
+
private options;
|
|
46
|
+
private eventService;
|
|
47
|
+
private columns;
|
|
48
|
+
private getFilterModel;
|
|
49
|
+
private getQuickFilter;
|
|
50
|
+
private isPaginationEnabled;
|
|
51
|
+
private getPageSize;
|
|
52
|
+
private getCurrentPage;
|
|
53
|
+
private rowHeightProvider;
|
|
54
|
+
private rowNodeServices;
|
|
55
|
+
private rowData;
|
|
56
|
+
private rootRowNodes;
|
|
57
|
+
/** the original (ungrouped) data rows — grouping always starts from these */
|
|
58
|
+
private dataRows;
|
|
59
|
+
private rowsToDisplay;
|
|
60
|
+
private rowNodeMap;
|
|
61
|
+
private expandedGroups;
|
|
62
|
+
private groupDefaultExpandedApplied;
|
|
63
|
+
private pinnedTopRows;
|
|
64
|
+
private pinnedBottomRows;
|
|
65
|
+
private displayStartIndex;
|
|
66
|
+
private totalRowCount;
|
|
67
|
+
constructor(params: {
|
|
68
|
+
options: GridOptions;
|
|
69
|
+
eventService: EventService;
|
|
70
|
+
columns: () => Column[];
|
|
71
|
+
getFilterModel: () => Record<string, FilterModelEntry>;
|
|
72
|
+
getQuickFilter: () => string;
|
|
73
|
+
isPaginationEnabled: () => boolean;
|
|
74
|
+
getPageSize: () => number;
|
|
75
|
+
getCurrentPage: () => number;
|
|
76
|
+
rowHeight: () => number;
|
|
77
|
+
rowNodeServices: RowNodeServices;
|
|
78
|
+
});
|
|
79
|
+
getType(): string;
|
|
80
|
+
isEmpty(): boolean;
|
|
81
|
+
getTopLevelRows(): RowNode[];
|
|
82
|
+
getRowCount(): number;
|
|
83
|
+
/** total rows before pagination slicing */
|
|
84
|
+
getTotalRowCount(): number;
|
|
85
|
+
getRow(index: number): RowNode | undefined;
|
|
86
|
+
getRowNode(id: string): RowNode | undefined;
|
|
87
|
+
forEachNode(callback: (node: RowNode, index: number) => void): void;
|
|
88
|
+
forEachLeafNode(callback: (node: RowNode, index: number) => void): void;
|
|
89
|
+
getPinnedTopRowCount(): number;
|
|
90
|
+
getPinnedBottomRowCount(): number;
|
|
91
|
+
getPinnedTopRow(index: number): RowNode | undefined;
|
|
92
|
+
getPinnedBottomRow(index: number): RowNode | undefined;
|
|
93
|
+
getRowIndexAtPixel(pixel: number): number;
|
|
94
|
+
updateRowData(rowData: any[]): void;
|
|
95
|
+
private rebuildRows;
|
|
96
|
+
private createRowNode;
|
|
97
|
+
private buildTreeData;
|
|
98
|
+
applyTransaction(transaction: RowDataTransaction): RowNodeTransactionResult | null;
|
|
99
|
+
refreshModel(step?: string): void;
|
|
100
|
+
private doFilter;
|
|
101
|
+
/** exposed so the advanced filter can evaluate per-condition models */
|
|
102
|
+
doesNodePassFilterModel(node: RowNode, column: Column, model: any): boolean;
|
|
103
|
+
private doesNodePassFilter;
|
|
104
|
+
private doSort;
|
|
105
|
+
private doGroup;
|
|
106
|
+
private buildDisplayRows;
|
|
107
|
+
private isGrandTotal;
|
|
108
|
+
private createFooterNode;
|
|
109
|
+
private createGrandTotalNode;
|
|
110
|
+
expandAll(): void;
|
|
111
|
+
collapseAll(): void;
|
|
112
|
+
setNodeExpanded(node: RowNode, expanded: boolean): void;
|
|
113
|
+
setGridApi(api: any): void;
|
|
114
|
+
destroy(): void;
|
|
115
|
+
}
|
|
116
|
+
export {};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { ColDef, Column, ColumnState, PinPosition, GridOptions } from '../types';
|
|
2
|
+
import { EventService } from './eventService';
|
|
3
|
+
export interface ColumnGroupInfo {
|
|
4
|
+
id: string;
|
|
5
|
+
headerName: string;
|
|
6
|
+
openByDefault: boolean;
|
|
7
|
+
parentId: string | null;
|
|
8
|
+
depth: number;
|
|
9
|
+
childColumnIds: string[];
|
|
10
|
+
}
|
|
11
|
+
export declare class ColumnModel {
|
|
12
|
+
private options;
|
|
13
|
+
private eventService;
|
|
14
|
+
private gridApi;
|
|
15
|
+
private measureCtx;
|
|
16
|
+
private gridColumnDefs;
|
|
17
|
+
private columns;
|
|
18
|
+
private displayOrder;
|
|
19
|
+
private autoGroupColumnDef;
|
|
20
|
+
pivotMode: boolean;
|
|
21
|
+
private columnGroups;
|
|
22
|
+
private openGroups;
|
|
23
|
+
private groupsInitialised;
|
|
24
|
+
constructor(options: GridOptions, eventService: EventService, gridApi: any);
|
|
25
|
+
setGridApi(api: any): void;
|
|
26
|
+
getAutoGroupColumnDef(): ColDef;
|
|
27
|
+
getOptions(): GridOptions;
|
|
28
|
+
setPivotMode(pivotMode: boolean, source?: string): void;
|
|
29
|
+
isPivotMode(): boolean;
|
|
30
|
+
setColumnDefs(colDefs: ColDef[]): void;
|
|
31
|
+
/** derive columnDefs from the fields of the first row (ag-grid autoGenerateColumnDefs) */
|
|
32
|
+
static generateColumnDefs(rowData: any[], fieldCase?: (field: string) => string): ColDef[];
|
|
33
|
+
/** column groups (spanning headers) */
|
|
34
|
+
getColumnGroups(): ColumnGroupInfo[];
|
|
35
|
+
getGroupDepth(): number;
|
|
36
|
+
isGroupOpen(groupId: string): boolean;
|
|
37
|
+
setGroupOpen(groupId: string, open: boolean): void;
|
|
38
|
+
getColumnDefs(): ColDef[];
|
|
39
|
+
private buildColumns;
|
|
40
|
+
private createColumn;
|
|
41
|
+
private pushColumnInto;
|
|
42
|
+
private buildColumn;
|
|
43
|
+
/**
|
|
44
|
+
* Generates the value columns produced by pivoting: one column per distinct
|
|
45
|
+
* value of each pivot column, grouped under the pivot column's header, plus a
|
|
46
|
+
* grand-total column per pivot column.
|
|
47
|
+
*/
|
|
48
|
+
updatePivotColumns(rowData: any[]): void;
|
|
49
|
+
/** aggregate the leaves of a node for a pivot column/value pair */
|
|
50
|
+
private evaluatePivotValue;
|
|
51
|
+
/** creates/updates/removes the auto group column shown when grouping or using tree data */
|
|
52
|
+
private updateAutoGroupColumn;
|
|
53
|
+
private updateVisible;
|
|
54
|
+
private isGroupChainOpen;
|
|
55
|
+
refreshAll(): void;
|
|
56
|
+
getAllColumns(): Column[];
|
|
57
|
+
getColumn(key: string | Column): Column | undefined;
|
|
58
|
+
/** columns in display order (respects reordering), all sections */
|
|
59
|
+
getColumns(): Column[];
|
|
60
|
+
getDisplayedColumns(): Column[];
|
|
61
|
+
getDisplayedLeftColumns(): Column[];
|
|
62
|
+
getDisplayedCenterColumns(): Column[];
|
|
63
|
+
getDisplayedRightColumns(): Column[];
|
|
64
|
+
getDisplayedColumnsByType(): {
|
|
65
|
+
left: Column[];
|
|
66
|
+
center: Column[];
|
|
67
|
+
right: Column[];
|
|
68
|
+
};
|
|
69
|
+
getRowGroupColumns(): Column[];
|
|
70
|
+
getPivotColumns(): Column[];
|
|
71
|
+
getValueColumns(): Column[];
|
|
72
|
+
isRowGroupActive(): boolean;
|
|
73
|
+
setRowGroupColumns(colIds: Array<string | Column>, source?: string): void;
|
|
74
|
+
addRowGroupColumn(colKey: string | Column, source?: string): void;
|
|
75
|
+
removeRowGroupColumn(colKey: string | Column, source?: string): void;
|
|
76
|
+
setValueColumns(colIds: Array<string | Column>, source?: string): void;
|
|
77
|
+
addValueColumn(colKey: string | Column, aggFunc?: string, source?: string): void;
|
|
78
|
+
setPivotColumns(colIds: Array<string | Column>, source?: string): void;
|
|
79
|
+
setColumnVisible(colKey: string | Column, visible: boolean, source?: string): void;
|
|
80
|
+
setColumnsVisible(keys: Array<string | Column>, visible: boolean, source?: string): void;
|
|
81
|
+
setColumnPinned(colKey: string | Column, pinned: PinPosition, source?: string): void;
|
|
82
|
+
setColumnsPinned(keys: Array<string | Column>, pinned: PinPosition, source?: string): void;
|
|
83
|
+
moveColumn(key: string | Column, toIndex: number, source?: string): void;
|
|
84
|
+
moveColumnByIndex(fromIndex: number, toIndex: number, source?: string): void;
|
|
85
|
+
getColumnState(): ColumnState[];
|
|
86
|
+
applyColumnState(state: ColumnState[], applyOrder?: boolean): void;
|
|
87
|
+
resetColumnState(): void;
|
|
88
|
+
private getMeasureContext;
|
|
89
|
+
measureTextWidth(text: string): number;
|
|
90
|
+
/** assign widths: flex columns share the leftover space of their section */
|
|
91
|
+
sizeColumnsToFit(containerWidth: number, skipColumnIds?: string[]): void;
|
|
92
|
+
autoSizeColumn(colKey: string | Column, skipHeader?: boolean): void;
|
|
93
|
+
autoSizeAllColumns(skipHeader?: boolean): void;
|
|
94
|
+
}
|
|
95
|
+
export declare function titleCase(field: string): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { GridEventType } from '../types';
|
|
2
|
+
type Listener = (event: any) => void;
|
|
3
|
+
/** Minimal pub/sub used across the grid. */
|
|
4
|
+
export declare class EventService {
|
|
5
|
+
private listeners;
|
|
6
|
+
addEventListener(eventType: GridEventType | string, listener: Listener): void;
|
|
7
|
+
removeEventListener(eventType: GridEventType | string, listener: Listener): void;
|
|
8
|
+
dispatchEvent(eventType: GridEventType | string, event?: any): void;
|
|
9
|
+
hasListener(eventType: GridEventType | string): boolean;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formula engine — tokenizer, Pratt parser and evaluator for cell formulas.
|
|
3
|
+
* Supports field references (resolved from row data), A1-style references
|
|
4
|
+
* (resolved via a supplied header map), operators and a function library.
|
|
5
|
+
*/
|
|
6
|
+
export type FormulaValue = number | string | boolean | null | undefined | Date;
|
|
7
|
+
export interface FormulaContext {
|
|
8
|
+
/** row data keyed by field name */
|
|
9
|
+
data?: Record<string, any>;
|
|
10
|
+
/** A1-style lookup: (columnLetter, rowNumber) => value */
|
|
11
|
+
a1Lookup?: (col: string, row: number) => FormulaValue;
|
|
12
|
+
/** the current row number for relative references */
|
|
13
|
+
rowNumber?: number;
|
|
14
|
+
}
|
|
15
|
+
export declare class FormulaError extends Error {
|
|
16
|
+
code: string;
|
|
17
|
+
constructor(code: string);
|
|
18
|
+
}
|
|
19
|
+
type TokenType = 'number' | 'string' | 'ident' | 'cell' | 'op' | 'lparen' | 'rparen' | 'comma';
|
|
20
|
+
interface Token {
|
|
21
|
+
type: TokenType;
|
|
22
|
+
value: string;
|
|
23
|
+
}
|
|
24
|
+
export declare function tokenize(input: string): Token[];
|
|
25
|
+
interface AstNode {
|
|
26
|
+
type: 'number' | 'string' | 'ref' | 'cell' | 'call' | 'unary' | 'binary' | 'range';
|
|
27
|
+
value?: any;
|
|
28
|
+
name?: string;
|
|
29
|
+
args?: AstNode[];
|
|
30
|
+
operator?: string;
|
|
31
|
+
left?: AstNode;
|
|
32
|
+
right?: AstNode;
|
|
33
|
+
}
|
|
34
|
+
export declare function parse(tokens: Token[]): AstNode;
|
|
35
|
+
export declare const FORMULA_FUNCTIONS: string[];
|
|
36
|
+
/** register a custom formula function (ag-grid formula custom functions) */
|
|
37
|
+
export declare function registerFormulaFunction(name: string, fn: (args: FormulaValue[], context: FormulaContext) => FormulaValue): void;
|
|
38
|
+
/** evaluate a formula string (with or without the leading '=') */
|
|
39
|
+
export declare function evaluateFormula(formula: string, context?: FormulaContext): FormulaValue;
|
|
40
|
+
/** true when a value/getter string is a formula */
|
|
41
|
+
export declare function isFormula(value: any): value is string;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UI text for menus, popups and tool panels. Mirrors ag-grid's `localeText`
|
|
3
|
+
* option: the grid merges user-supplied keys over these English defaults and
|
|
4
|
+
* every built-in string resolves through `t(key)` / `translate(key, fallback)`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DEFAULT_LOCALE_TEXT: Record<string, string>;
|
|
7
|
+
/** filter condition value → locale key (same names as ag-grid) */
|
|
8
|
+
export declare const CONDITION_LABELS: Record<string, string>;
|
|
9
|
+
/** resolves UI text: user overrides first, then the English defaults, then the key itself */
|
|
10
|
+
export declare class LocaleText {
|
|
11
|
+
private overrides;
|
|
12
|
+
constructor(overrides: Record<string, string>);
|
|
13
|
+
t(key: string): string;
|
|
14
|
+
}
|
|
15
|
+
export declare function createLocaleText(overrides?: Record<string, string>): LocaleText;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import type { Column, GridOptions, RowDataTransaction, RowNode, RowNodeTransactionResult, SortModelItem } from '../types';
|
|
2
|
+
import { type RowNodeServices } from './rowNode';
|
|
3
|
+
import type { EventService } from './eventService';
|
|
4
|
+
import type { RowModel } from './clientSideRowModel';
|
|
5
|
+
/** ag-grid compatible server-side request */
|
|
6
|
+
export interface ServerSideGetRowsRequest {
|
|
7
|
+
startRow: number;
|
|
8
|
+
endRow: number;
|
|
9
|
+
rowGroupCols: Column[];
|
|
10
|
+
valueCols: Column[];
|
|
11
|
+
pivotCols: Column[];
|
|
12
|
+
groupKeys: string[];
|
|
13
|
+
sortModel: SortModelItem[];
|
|
14
|
+
filterModel: Record<string, any>;
|
|
15
|
+
successCallback: (rowsThisBlock: any[], lastRow?: number) => void;
|
|
16
|
+
failCallback: () => void;
|
|
17
|
+
}
|
|
18
|
+
export interface ServerSideDatasource {
|
|
19
|
+
getRows: (request: ServerSideGetRowsRequest) => void;
|
|
20
|
+
destroy?: () => void;
|
|
21
|
+
}
|
|
22
|
+
/** ag-grid marks server-side group rows with `childCount` / `group` on the data */
|
|
23
|
+
export declare function isServerSideGroupRow(data: any): boolean;
|
|
24
|
+
interface Store {
|
|
25
|
+
rows: (RowNode | null)[];
|
|
26
|
+
lastRow: number | null;
|
|
27
|
+
loading: boolean;
|
|
28
|
+
failed: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface RemoteRowModelParams {
|
|
31
|
+
options: GridOptions;
|
|
32
|
+
eventService: EventService;
|
|
33
|
+
columns: () => Column[];
|
|
34
|
+
getSortModel: () => SortModelItem[];
|
|
35
|
+
getFilterModel: () => Record<string, any>;
|
|
36
|
+
rowHeight: () => number;
|
|
37
|
+
rowNodeServices: RowNodeServices;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Server-Side Row Model — block loading with server-side sorting, filtering and
|
|
41
|
+
* grouping. Stores rows per group path and lazily requests blocks.
|
|
42
|
+
*/
|
|
43
|
+
export declare class ServerSideRowModel implements RowModel {
|
|
44
|
+
private options;
|
|
45
|
+
private eventService;
|
|
46
|
+
private columns;
|
|
47
|
+
private getSortModel;
|
|
48
|
+
private getFilterModel;
|
|
49
|
+
private rowHeightProvider;
|
|
50
|
+
private rowNodeServices;
|
|
51
|
+
private datasource;
|
|
52
|
+
private stores;
|
|
53
|
+
private rowNodeMap;
|
|
54
|
+
private displayRows;
|
|
55
|
+
private blockSize;
|
|
56
|
+
private pureLoad;
|
|
57
|
+
constructor(params: RemoteRowModelParams);
|
|
58
|
+
getType(): string;
|
|
59
|
+
setDatasource(datasource: ServerSideDatasource | null): void;
|
|
60
|
+
getStore(groupPath: string): Store | undefined;
|
|
61
|
+
private getOrCreateStore;
|
|
62
|
+
isLoading(): boolean;
|
|
63
|
+
/** request a block of rows for a group path (creates placeholders while loading) */
|
|
64
|
+
private loadBlock;
|
|
65
|
+
private onBlockLoaded;
|
|
66
|
+
private createNode;
|
|
67
|
+
private buildDisplayRows;
|
|
68
|
+
/** ensure the block covering [startRow, endRow] of the visible window is loaded */
|
|
69
|
+
private ensureLoaded;
|
|
70
|
+
refreshModel(step?: string): void;
|
|
71
|
+
/** called by the grid when the visible range changes */
|
|
72
|
+
onViewportChanged(startRow: number, endRow: number): void;
|
|
73
|
+
setNodeExpanded(node: RowNode, expanded: boolean): void;
|
|
74
|
+
private groupPathFor;
|
|
75
|
+
purgeCache(): void;
|
|
76
|
+
/** refresh after sort/filter/group changes — everything is re-fetched */
|
|
77
|
+
onSortOrFilterChanged(): void;
|
|
78
|
+
getRowCount(): number;
|
|
79
|
+
/** total rows on the server (root store's lastRow) */
|
|
80
|
+
getTotalRowCount(): number;
|
|
81
|
+
getRow(index: number): RowNode | undefined;
|
|
82
|
+
getRowNode(id: string): RowNode | undefined;
|
|
83
|
+
forEachNode(callback: (node: RowNode, index: number) => void): void;
|
|
84
|
+
forEachLeafNode(callback: (node: RowNode, index: number) => void): void;
|
|
85
|
+
isEmpty(): boolean;
|
|
86
|
+
getTopLevelRows(): RowNode[];
|
|
87
|
+
updateRowData(rowData: any[]): void;
|
|
88
|
+
applyTransaction(transaction: RowDataTransaction): RowNodeTransactionResult | null;
|
|
89
|
+
destroy(): void;
|
|
90
|
+
expandAll(): void;
|
|
91
|
+
collapseAll(): void;
|
|
92
|
+
getPinnedTopRowCount(): number;
|
|
93
|
+
getPinnedBottomRowCount(): number;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Infinite Row Model — lazy-loads pages as the user scrolls.
|
|
97
|
+
*/
|
|
98
|
+
export declare class InfiniteRowModel implements RowModel {
|
|
99
|
+
private options;
|
|
100
|
+
private eventService;
|
|
101
|
+
private getSortModel;
|
|
102
|
+
private getFilterModel;
|
|
103
|
+
private rowNodeServices;
|
|
104
|
+
private datasource;
|
|
105
|
+
private nodes;
|
|
106
|
+
private rowNodeMap;
|
|
107
|
+
private blockSize;
|
|
108
|
+
private lastRow;
|
|
109
|
+
private loading;
|
|
110
|
+
constructor(params: RemoteRowModelParams);
|
|
111
|
+
getType(): string;
|
|
112
|
+
setDatasource(datasource: ServerSideDatasource | null): void;
|
|
113
|
+
private loadBlock;
|
|
114
|
+
onViewportChanged(startRow: number, endRow: number): void;
|
|
115
|
+
onSortOrFilterChanged(): void;
|
|
116
|
+
isLoading(): boolean;
|
|
117
|
+
getRowCount(): number;
|
|
118
|
+
getRow(index: number): RowNode | undefined;
|
|
119
|
+
getRowNode(id: string): RowNode | undefined;
|
|
120
|
+
forEachNode(callback: (node: RowNode, index: number) => void): void;
|
|
121
|
+
forEachLeafNode(callback: (node: RowNode, index: number) => void): void;
|
|
122
|
+
isEmpty(): boolean;
|
|
123
|
+
getTopLevelRows(): RowNode[];
|
|
124
|
+
updateRowData(): void;
|
|
125
|
+
applyTransaction(): RowNodeTransactionResult | null;
|
|
126
|
+
destroy(): void;
|
|
127
|
+
refreshModel(): void;
|
|
128
|
+
expandAll(): void;
|
|
129
|
+
collapseAll(): void;
|
|
130
|
+
getPinnedTopRowCount(): number;
|
|
131
|
+
getPinnedBottomRowCount(): number;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Viewport Row Model — renders only the rows inside the current viewport,
|
|
135
|
+
* requesting them from the datasource.
|
|
136
|
+
*/
|
|
137
|
+
export declare class ViewportRowModel implements RowModel {
|
|
138
|
+
private options;
|
|
139
|
+
private eventService;
|
|
140
|
+
private rowNodeServices;
|
|
141
|
+
private datasource;
|
|
142
|
+
private nodes;
|
|
143
|
+
private rowNodeMap;
|
|
144
|
+
private firstRow;
|
|
145
|
+
private lastRow;
|
|
146
|
+
private loading;
|
|
147
|
+
constructor(params: RemoteRowModelParams);
|
|
148
|
+
getType(): string;
|
|
149
|
+
setDatasource(datasource: ServerSideDatasource | null): void;
|
|
150
|
+
setViewportRange(firstRow: number, lastRow: number): void;
|
|
151
|
+
setViewportDatasource(datasource: ServerSideDatasource | null): void;
|
|
152
|
+
onViewportChanged(startRow: number, endRow: number): void;
|
|
153
|
+
isLoading(): boolean;
|
|
154
|
+
getRowCount(): number;
|
|
155
|
+
getRow(index: number): RowNode | undefined;
|
|
156
|
+
getRowNode(id: string): RowNode | undefined;
|
|
157
|
+
forEachNode(callback: (node: RowNode, index: number) => void): void;
|
|
158
|
+
forEachLeafNode(callback: (node: RowNode, index: number) => void): void;
|
|
159
|
+
isEmpty(): boolean;
|
|
160
|
+
getTopLevelRows(): RowNode[];
|
|
161
|
+
updateRowData(): void;
|
|
162
|
+
applyTransaction(): RowNodeTransactionResult | null;
|
|
163
|
+
destroy(): void;
|
|
164
|
+
refreshModel(): void;
|
|
165
|
+
expandAll(): void;
|
|
166
|
+
collapseAll(): void;
|
|
167
|
+
getPinnedTopRowCount(): number;
|
|
168
|
+
getPinnedBottomRowCount(): number;
|
|
169
|
+
}
|
|
170
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { RowNode, Column } from '../types';
|
|
2
|
+
export interface RowNodeServices {
|
|
3
|
+
selectNode: (node: RowNode, clearSelection: boolean) => void;
|
|
4
|
+
deselectNode: (node: RowNode) => void;
|
|
5
|
+
isNodeSelected: (node: RowNode) => boolean;
|
|
6
|
+
getRowGroupColumnCount?: () => number;
|
|
7
|
+
}
|
|
8
|
+
export declare class RowNodeImpl implements RowNode {
|
|
9
|
+
id: string;
|
|
10
|
+
__id: string;
|
|
11
|
+
data: any;
|
|
12
|
+
parent: RowNode | null;
|
|
13
|
+
children: RowNode[] | null;
|
|
14
|
+
group: boolean;
|
|
15
|
+
key: string | null;
|
|
16
|
+
level: number;
|
|
17
|
+
uiLevel: number;
|
|
18
|
+
rowGroupIndex: number | undefined;
|
|
19
|
+
expanded: boolean;
|
|
20
|
+
selectable: boolean;
|
|
21
|
+
selected: boolean;
|
|
22
|
+
rowPinned: 'top' | 'bottom' | null;
|
|
23
|
+
detailNode: RowNode | null;
|
|
24
|
+
masterNode: RowNode | null;
|
|
25
|
+
footer: boolean;
|
|
26
|
+
groupData: Record<string, any> | null;
|
|
27
|
+
rowHeight: number | null;
|
|
28
|
+
allChildrenCount: number | null;
|
|
29
|
+
stub: boolean;
|
|
30
|
+
rowIndex: number | null;
|
|
31
|
+
__displayIndex: number | undefined;
|
|
32
|
+
private services;
|
|
33
|
+
private _id;
|
|
34
|
+
constructor(data: any, services: RowNodeServices, id?: string);
|
|
35
|
+
/** true when this is a group node (row grouping) */
|
|
36
|
+
get isGroup(): boolean;
|
|
37
|
+
/** true when this row has a detail child (master detail) */
|
|
38
|
+
get isMaster(): boolean;
|
|
39
|
+
setSelected(selected: boolean, clearSelection?: boolean, _source?: string): number;
|
|
40
|
+
isSelected(): boolean;
|
|
41
|
+
setData(data: any): void;
|
|
42
|
+
setDataValue(colKey: string | Column, newValue: any): void;
|
|
43
|
+
setExpanded(expanded: boolean): void;
|
|
44
|
+
setPinned(pinned: 'top' | 'bottom' | null): void;
|
|
45
|
+
/** whether node passes the current filter (set by row model) */
|
|
46
|
+
__passesFilter: boolean;
|
|
47
|
+
/** depth-first child count including all descendants */
|
|
48
|
+
__childCount: number;
|
|
49
|
+
/** whether children were already loaded for this group */
|
|
50
|
+
__childrenLoaded: boolean;
|
|
51
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** Internal utilities. */
|
|
2
|
+
export declare const KEY_ENTER = 13;
|
|
3
|
+
export declare const KEY_ESCAPE = 27;
|
|
4
|
+
export declare const KEY_SPACE = 32;
|
|
5
|
+
export declare const KEY_TAB = 9;
|
|
6
|
+
export declare const KEY_BACKSPACE = 8;
|
|
7
|
+
export declare const KEY_DELETE = 46;
|
|
8
|
+
export declare const KEY_LEFT = 37;
|
|
9
|
+
export declare const KEY_UP = 38;
|
|
10
|
+
export declare const KEY_RIGHT = 39;
|
|
11
|
+
export declare const KEY_DOWN = 40;
|
|
12
|
+
export declare const KEY_PAGE_UP = 33;
|
|
13
|
+
export declare const KEY_PAGE_DOWN = 34;
|
|
14
|
+
export declare const KEY_HOME = 36;
|
|
15
|
+
export declare const KEY_END = 35;
|
|
16
|
+
export declare const KEY_A = 65;
|
|
17
|
+
export declare const KEY_C = 67;
|
|
18
|
+
export declare const KEY_V = 86;
|
|
19
|
+
export declare const KEY_X = 88;
|
|
20
|
+
export declare const KEY_F = 70;
|
|
21
|
+
export declare const KEY_P = 80;
|
|
22
|
+
export declare function escapeHtml(value: any): string;
|
|
23
|
+
export declare function escapeString(value: any): string;
|
|
24
|
+
export declare function nextId(prefix?: string): string;
|
|
25
|
+
export declare function debounce(func: (...args: any[]) => void, wait: number): (...args: any[]) => void;
|
|
26
|
+
export declare function throttle(func: (...args: any[]) => void, wait: number): (...args: any[]) => void;
|
|
27
|
+
export declare function requestAnimationFrameThrottle(func: (...args: any[]) => void): (...args: any[]) => void;
|
|
28
|
+
export declare function formatNumberCommas(value: number, decimals?: number): string;
|
|
29
|
+
export declare function parseFloatingPoint(value: any): number | null;
|
|
30
|
+
export declare function isNumeric(value: any): boolean;
|
|
31
|
+
export declare function defaultComparator(valueA: any, valueB: any): number;
|
|
32
|
+
export declare function fuzzyMatch(filterValue: string, cellValue: any): boolean;
|
|
33
|
+
export declare function deepClone<T>(obj: T): T;
|
|
34
|
+
export declare function isEventFromInput(el: EventTarget | null): boolean;
|
|
35
|
+
/** linear interpolation easing used for smooth scrolling */
|
|
36
|
+
export declare function easeInOutCubic(t: number): number;
|
|
37
|
+
export declare function addEventListener(element: Element | Document | Window, type: string, listener: (event: any) => void, options?: AddEventListenerOptions): () => void;
|
|
38
|
+
export declare function setElementSize(element: HTMLElement, width?: string, height?: string): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AggFunc, Column, RowNode, GridApi } from '../types';
|
|
2
|
+
export declare function getValueForColumn(column: Column, node: RowNode, api: GridApi): any;
|
|
3
|
+
export declare function formatValue(column: Column, node: RowNode, api: GridApi): string | null;
|
|
4
|
+
export declare function applyBuiltInFormatter(name: string, value: any, params?: {
|
|
5
|
+
column?: Column;
|
|
6
|
+
}): string | null;
|
|
7
|
+
export declare function formatDate(value: any): string;
|
|
8
|
+
export declare function formatByType(column: Column, value: any): string | null;
|
|
9
|
+
export declare function parseValue(column: Column, value: any): any;
|
|
10
|
+
export declare function applyBuiltInParser(type: string | undefined, value: any): any;
|
|
11
|
+
export declare function getComparator(column: Column): (a: RowNode, b: RowNode) => number;
|
|
12
|
+
/** compare group keys; groups always sort before leaf rows when using default order */
|
|
13
|
+
export declare function compareGroupValues(column: Column, a: RowNode, b: RowNode): number;
|
|
14
|
+
export declare function applyAggregate(column: Column, aggFunc: AggFunc | undefined, values: any[]): any;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Column } from '../types';
|
|
2
|
+
import type { Grid } from '../grid';
|
|
3
|
+
import type { PopupService } from './popupService';
|
|
4
|
+
export type ChartType = 'line' | 'area' | 'column' | 'bar' | 'pie' | 'scatter';
|
|
5
|
+
interface ChartSeries {
|
|
6
|
+
title: string;
|
|
7
|
+
data: number[];
|
|
8
|
+
}
|
|
9
|
+
export interface ChartData {
|
|
10
|
+
categories: string[];
|
|
11
|
+
series: ChartSeries[];
|
|
12
|
+
}
|
|
13
|
+
export declare class ChartService {
|
|
14
|
+
private grid;
|
|
15
|
+
private popupService;
|
|
16
|
+
private charts;
|
|
17
|
+
private chartCounter;
|
|
18
|
+
private currentType;
|
|
19
|
+
private timeSeries;
|
|
20
|
+
constructor(grid: Grid, popupService: PopupService);
|
|
21
|
+
isEnabled(): boolean;
|
|
22
|
+
/** extract chart data from the grid (grouped or flat) */
|
|
23
|
+
getChartData(params?: {
|
|
24
|
+
categoryColumn?: Column;
|
|
25
|
+
valueColumns?: Column[];
|
|
26
|
+
}): ChartData;
|
|
27
|
+
buildChartPanel(): HTMLElement;
|
|
28
|
+
createChart(params?: {
|
|
29
|
+
type?: ChartType;
|
|
30
|
+
categoryColumn?: Column;
|
|
31
|
+
valueColumns?: Column[];
|
|
32
|
+
title?: string;
|
|
33
|
+
}): string;
|
|
34
|
+
destroyChart(id: string): void;
|
|
35
|
+
getChartModels(): any[];
|
|
36
|
+
refreshCharts(): void;
|
|
37
|
+
/** show a tooltip for the data point under the pointer */
|
|
38
|
+
private onChartHover;
|
|
39
|
+
/** persist created charts to localStorage so they survive reloads */
|
|
40
|
+
private storageKey;
|
|
41
|
+
saveCharts(): void;
|
|
42
|
+
loadCharts(): void;
|
|
43
|
+
private restoreChart;
|
|
44
|
+
private renderChart;
|
|
45
|
+
private renderPie;
|
|
46
|
+
private formatTick;
|
|
47
|
+
private truncate;
|
|
48
|
+
}
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Column } from '../types';
|
|
2
|
+
import type { Grid } from '../grid';
|
|
3
|
+
import type { PopupService } from './popupService';
|
|
4
|
+
export declare class ColumnMenuService {
|
|
5
|
+
private grid;
|
|
6
|
+
private popupService;
|
|
7
|
+
constructor(grid: Grid, popupService: PopupService);
|
|
8
|
+
openColumnMenu(column: Column, anchor: HTMLElement): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Grid } from '../grid';
|
|
2
|
+
import type { PopupService } from './popupService';
|
|
3
|
+
export interface MenuItem {
|
|
4
|
+
name: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
checked?: boolean;
|
|
9
|
+
subMenu?: MenuItem[];
|
|
10
|
+
action?: () => void;
|
|
11
|
+
separator?: boolean;
|
|
12
|
+
cssClasses?: string[];
|
|
13
|
+
shortcut?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare class ContextMenuService {
|
|
16
|
+
private grid;
|
|
17
|
+
private popupService;
|
|
18
|
+
constructor(grid: Grid, popupService: PopupService);
|
|
19
|
+
private getDefaultItems;
|
|
20
|
+
private hasSelection;
|
|
21
|
+
private isGroupActive;
|
|
22
|
+
openContextMenu(anchor: HTMLElement, params: {
|
|
23
|
+
column?: any;
|
|
24
|
+
node?: any;
|
|
25
|
+
}): void;
|
|
26
|
+
private buildMenu;
|
|
27
|
+
}
|