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,122 @@
|
|
|
1
|
+
import type { GanttTask, TeamMember } from './data';
|
|
2
|
+
export type GanttUnit = 'day' | 'week' | 'biweek' | 'month' | 'bimonth' | 'quarter' | 'halfyear' | 'year';
|
|
3
|
+
export type GanttTheme = 'content' | 'color';
|
|
4
|
+
export declare const GANTT_UNITS: GanttUnit[];
|
|
5
|
+
export declare const UNIT_LABEL: Record<GanttUnit, string>;
|
|
6
|
+
export interface ChartRow {
|
|
7
|
+
id: string;
|
|
8
|
+
group: boolean;
|
|
9
|
+
expanded: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface GanttChartOptions {
|
|
12
|
+
members: TeamMember[];
|
|
13
|
+
rowHeight: number;
|
|
14
|
+
onSelect: (id: string | null) => void;
|
|
15
|
+
onHover: (id: string | null) => void;
|
|
16
|
+
onTaskChange: (task: GanttTask) => void;
|
|
17
|
+
onAssign: (id: string, memberId: string | null) => void;
|
|
18
|
+
}
|
|
19
|
+
export declare class GanttChart {
|
|
20
|
+
private options;
|
|
21
|
+
private eRoot;
|
|
22
|
+
private eHeader;
|
|
23
|
+
private eRuler;
|
|
24
|
+
private rulerCtx;
|
|
25
|
+
private eRulerTools;
|
|
26
|
+
private eStepLabel;
|
|
27
|
+
private eZoomValue;
|
|
28
|
+
private eStepMenu;
|
|
29
|
+
private eScroll;
|
|
30
|
+
private eSpacer;
|
|
31
|
+
private eCanvas;
|
|
32
|
+
private ctx;
|
|
33
|
+
private eTooltip;
|
|
34
|
+
private eTodayBadge;
|
|
35
|
+
private ePopup;
|
|
36
|
+
private tasks;
|
|
37
|
+
private tasksById;
|
|
38
|
+
private rows;
|
|
39
|
+
private selectedId;
|
|
40
|
+
private hoverId;
|
|
41
|
+
private unit;
|
|
42
|
+
private zoom;
|
|
43
|
+
private theme;
|
|
44
|
+
private epochStart;
|
|
45
|
+
private totalDays;
|
|
46
|
+
private hits;
|
|
47
|
+
private hitsByRow;
|
|
48
|
+
private drag;
|
|
49
|
+
private ghost;
|
|
50
|
+
private dirty;
|
|
51
|
+
private lastLeft;
|
|
52
|
+
private lastTop;
|
|
53
|
+
private timer;
|
|
54
|
+
private observer;
|
|
55
|
+
private resizeHandler;
|
|
56
|
+
private showChildren;
|
|
57
|
+
private milestonesOnly;
|
|
58
|
+
private locateHits;
|
|
59
|
+
constructor(container: HTMLElement, options: GanttChartOptions);
|
|
60
|
+
destroy(): void;
|
|
61
|
+
setHover(id: string | null): void;
|
|
62
|
+
setShowChildren(value: boolean): void;
|
|
63
|
+
setMilestonesOnly(value: boolean): void;
|
|
64
|
+
scrollToTask(id: string): void;
|
|
65
|
+
setTasks(tasks: GanttTask[]): void;
|
|
66
|
+
setRows(rows: ChartRow[]): void;
|
|
67
|
+
setSelected(id: string | null): void;
|
|
68
|
+
setUnit(unit: GanttUnit): void;
|
|
69
|
+
setZoom(zoom: number): void;
|
|
70
|
+
setTheme(theme: GanttTheme): void;
|
|
71
|
+
get dayWidth(): number;
|
|
72
|
+
get scrollElement(): HTMLElement;
|
|
73
|
+
/** keep the timeline aligned with the grid's vertical scroll */
|
|
74
|
+
setScrollTop(top: number): void;
|
|
75
|
+
/** ask for a repaint on the next frame tick (the page's sync loop calls this) */
|
|
76
|
+
redraw(): void;
|
|
77
|
+
private markDirty;
|
|
78
|
+
/** scroll the timeline so today sits at `fraction` of the viewport, and bring the active row into view */
|
|
79
|
+
scrollToToday(fraction?: number): void;
|
|
80
|
+
private computeDomain;
|
|
81
|
+
private dateX;
|
|
82
|
+
private xToDate;
|
|
83
|
+
private resizeCanvases;
|
|
84
|
+
private tick;
|
|
85
|
+
private onScroll;
|
|
86
|
+
private draw;
|
|
87
|
+
private drawRuler;
|
|
88
|
+
private drawBody;
|
|
89
|
+
private drawWeekends;
|
|
90
|
+
private drawGridlines;
|
|
91
|
+
private drawRowBackgrounds;
|
|
92
|
+
private drawTodayLine;
|
|
93
|
+
private todayLabelX;
|
|
94
|
+
private drawTodayLabel;
|
|
95
|
+
private drawDependencies;
|
|
96
|
+
private drawBars;
|
|
97
|
+
private drawTaskBar;
|
|
98
|
+
private drawSummaryBar;
|
|
99
|
+
private firstVisibleChildIndex;
|
|
100
|
+
private drawMilestone;
|
|
101
|
+
private pushHit;
|
|
102
|
+
private drawLocateButtons;
|
|
103
|
+
/** content-space point under the pointer */
|
|
104
|
+
private pointAt;
|
|
105
|
+
private hitAt;
|
|
106
|
+
private onCanvasMouseMove;
|
|
107
|
+
private onCanvasMouseDown;
|
|
108
|
+
private updateDrag;
|
|
109
|
+
private endDrag;
|
|
110
|
+
private onRootMouseLeave;
|
|
111
|
+
private buildRulerTools;
|
|
112
|
+
private toolButton;
|
|
113
|
+
private zoomBy;
|
|
114
|
+
private pageBy;
|
|
115
|
+
private toggleStepMenu;
|
|
116
|
+
private closeStepMenu;
|
|
117
|
+
private updateRulerTools;
|
|
118
|
+
private openAssigneePopup;
|
|
119
|
+
private closeAssigneePopup;
|
|
120
|
+
private onDocumentMouseDown;
|
|
121
|
+
}
|
|
122
|
+
export declare function memberColor(id: string): string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { createGantt } from './component';
|
|
2
|
+
export type { GanttApi, GanttOptions } from './component';
|
|
3
|
+
export type { GanttTask, TeamMember, TaskKind, TaskStatus } from './data';
|
|
4
|
+
export { GanttChart, GANTT_UNITS, UNIT_LABEL } from './ganttChart';
|
|
5
|
+
export type { GanttUnit, GanttTheme } from './ganttChart';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { GridOptions } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Chinese UI text for the grid chrome in this demo (column menu, context menu,
|
|
4
|
+
* filter popup, tool panels, pagination, find, overlays). Keys not listed here
|
|
5
|
+
* keep the library's English defaults.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ZH_LOCALE_TEXT: Record<string, string>;
|
|
8
|
+
/** all locale keys the library ships, so the demo can assert full coverage */
|
|
9
|
+
export declare const LOCALE_KEYS: string[];
|
|
10
|
+
export declare function withLocale(gridOptions: GridOptions): GridOptions;
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import type { Column, ColumnApi, GridApi, GridOptions, RowDataTransaction, RowNode, RowNodeTransactionResult } from './types';
|
|
2
|
+
import { EventService } from './core/eventService';
|
|
3
|
+
import { ColumnModel } from './core/columnModel';
|
|
4
|
+
import { RowModel } from './core/clientSideRowModel';
|
|
5
|
+
import { InfiniteRowModel, ServerSideRowModel, ViewportRowModel } from './core/remoteRowModels';
|
|
6
|
+
import { RowRenderer } from './render/rowRenderer';
|
|
7
|
+
import { HeaderView } from './render/headerView';
|
|
8
|
+
import { SelectionService } from './features/selectionService';
|
|
9
|
+
import { EditService } from './features/editService';
|
|
10
|
+
import { FilterService } from './features/filterService';
|
|
11
|
+
import { SortService } from './features/sortService';
|
|
12
|
+
import { PaginationService } from './features/paginationService';
|
|
13
|
+
import { PopupService } from './features/popupService';
|
|
14
|
+
import { FilterGui } from './features/filterGui';
|
|
15
|
+
import { SideBarService } from './features/sideBar';
|
|
16
|
+
import { FindService } from './features/findService';
|
|
17
|
+
import { RangeSelectionService } from './features/rangeSelection';
|
|
18
|
+
import { ChartService } from './features/chartService';
|
|
19
|
+
import { OverlayService } from './features/overlays';
|
|
20
|
+
import { ExportService } from './features/exportService';
|
|
21
|
+
import { RowGroupPanel } from './features/rowGroupPanel';
|
|
22
|
+
import { UndoRedoService } from './features/undoRedoService';
|
|
23
|
+
import { FormulaEditorService } from './features/formulaEditor';
|
|
24
|
+
import { NotesService } from './features/notesService';
|
|
25
|
+
import { RowDragService } from './features/rowDragService';
|
|
26
|
+
export declare class Grid {
|
|
27
|
+
private options;
|
|
28
|
+
private eventService;
|
|
29
|
+
private columnModel;
|
|
30
|
+
private rowModel;
|
|
31
|
+
private clientSideRowModel;
|
|
32
|
+
private serverSideRowModel;
|
|
33
|
+
private infiniteRowModel;
|
|
34
|
+
private viewportRowModel;
|
|
35
|
+
private rowRenderer;
|
|
36
|
+
private headerView;
|
|
37
|
+
private selectionService;
|
|
38
|
+
private editService;
|
|
39
|
+
private filterService;
|
|
40
|
+
private sortService;
|
|
41
|
+
private paginationService;
|
|
42
|
+
private popupService;
|
|
43
|
+
private filterGui;
|
|
44
|
+
private contextMenuService;
|
|
45
|
+
private columnMenuService;
|
|
46
|
+
private statusBarService;
|
|
47
|
+
private sideBarService;
|
|
48
|
+
private findService;
|
|
49
|
+
private rangeSelectionService;
|
|
50
|
+
private chartService;
|
|
51
|
+
private overlayService;
|
|
52
|
+
private exportService;
|
|
53
|
+
private rowGroupPanel;
|
|
54
|
+
private undoRedoService;
|
|
55
|
+
private formulaEditorService;
|
|
56
|
+
private notesService;
|
|
57
|
+
private rowDragService;
|
|
58
|
+
private api;
|
|
59
|
+
private columnApi;
|
|
60
|
+
private localeText;
|
|
61
|
+
private rowNodeServices;
|
|
62
|
+
private eGridDiv;
|
|
63
|
+
private eRoot;
|
|
64
|
+
private eMain;
|
|
65
|
+
private eHeader;
|
|
66
|
+
private quickFilter;
|
|
67
|
+
private resizeObserver;
|
|
68
|
+
private destroyed;
|
|
69
|
+
private gridReadyDispatched;
|
|
70
|
+
private context;
|
|
71
|
+
constructor(eGridDiv: HTMLElement, gridOptions: GridOptions);
|
|
72
|
+
getOptions(): GridOptions;
|
|
73
|
+
/** UI strings for menus / popups / panels */
|
|
74
|
+
t(key: string): string;
|
|
75
|
+
/** localisation lookup that keeps its English fallback for unknown keys */
|
|
76
|
+
translate(key: string, fallback: string): string;
|
|
77
|
+
getContext(): any;
|
|
78
|
+
getEventService(): EventService;
|
|
79
|
+
getColumnModel(): ColumnModel;
|
|
80
|
+
getRowModel(): RowModel;
|
|
81
|
+
getRowRenderer(): RowRenderer;
|
|
82
|
+
getHeaderView(): HeaderView;
|
|
83
|
+
getSelectionService(): SelectionService;
|
|
84
|
+
getEditService(): EditService;
|
|
85
|
+
getFilterService(): FilterService;
|
|
86
|
+
getSortService(): SortService;
|
|
87
|
+
getFilterGui(): FilterGui;
|
|
88
|
+
getPaginationService(): PaginationService | null;
|
|
89
|
+
getSideBarService(): SideBarService;
|
|
90
|
+
getChartService(): ChartService;
|
|
91
|
+
getFindService(): FindService;
|
|
92
|
+
getRangeSelectionService(): RangeSelectionService;
|
|
93
|
+
getExportService(): ExportService;
|
|
94
|
+
getPopupService(): PopupService;
|
|
95
|
+
getOverlayService(): OverlayService;
|
|
96
|
+
getRowGroupPanel(): RowGroupPanel | null;
|
|
97
|
+
getUndoRedoService(): UndoRedoService;
|
|
98
|
+
getFormulaEditorService(): FormulaEditorService;
|
|
99
|
+
getNotesService(): NotesService;
|
|
100
|
+
getRowDragService(): RowDragService;
|
|
101
|
+
getServerSideRowModel(): ServerSideRowModel | null;
|
|
102
|
+
getInfiniteRowModel(): InfiniteRowModel | null;
|
|
103
|
+
getViewportRowModel(): ViewportRowModel | null;
|
|
104
|
+
/** cache column totals so `showValueAs: 'percentOfTotal'` can render */
|
|
105
|
+
private updateColumnTotalCache;
|
|
106
|
+
/** (re)generate pivot result columns from the current row data */
|
|
107
|
+
refreshPivotColumns(): void;
|
|
108
|
+
private onRemoteModelChanged;
|
|
109
|
+
isRemoteLoading(): boolean;
|
|
110
|
+
getApi(): GridApi;
|
|
111
|
+
getColumnApi(): ColumnApi;
|
|
112
|
+
getRootElement(): HTMLElement;
|
|
113
|
+
getMainElement(): HTMLElement;
|
|
114
|
+
getHeaderElement(): HTMLElement;
|
|
115
|
+
getGridDiv(): HTMLElement;
|
|
116
|
+
getColumns(): {
|
|
117
|
+
left: Column[];
|
|
118
|
+
center: Column[];
|
|
119
|
+
right: Column[];
|
|
120
|
+
};
|
|
121
|
+
getAllColumns(): Column[];
|
|
122
|
+
getColumn(key: string | Column): Column | undefined;
|
|
123
|
+
getDisplayedRowCount(): number;
|
|
124
|
+
getDisplayedRowAtIndex(index: number): RowNode | undefined;
|
|
125
|
+
getRowNode(id: string): RowNode | undefined;
|
|
126
|
+
getRowHeight(node: RowNode): number;
|
|
127
|
+
getRowClass(node: RowNode): string;
|
|
128
|
+
getRowStyle(node: RowNode): Record<string, any>;
|
|
129
|
+
isNodeSelectable(node: RowNode): boolean;
|
|
130
|
+
isCellEditable(column: Column, node: RowNode): boolean;
|
|
131
|
+
setRowData(rowData: any[], initial?: boolean): void;
|
|
132
|
+
applyTransaction(transaction: RowDataTransaction): RowNodeTransactionResult | null;
|
|
133
|
+
setCellValue(column: Column, node: RowNode, value: any, source?: string, oldValueOverride?: any): void;
|
|
134
|
+
refreshModel(step?: string): void;
|
|
135
|
+
refreshCells(params?: {
|
|
136
|
+
rowNodes?: RowNode[];
|
|
137
|
+
columns?: Array<string | Column>;
|
|
138
|
+
force?: boolean;
|
|
139
|
+
flash?: boolean;
|
|
140
|
+
}): void;
|
|
141
|
+
setQuickFilter(text: string): void;
|
|
142
|
+
getQuickFilter(): string;
|
|
143
|
+
setRowNodePinned(node: RowNode, pinned: 'top' | 'bottom' | null): void;
|
|
144
|
+
/** open the find bar (Ctrl+F) */
|
|
145
|
+
openFind(): void;
|
|
146
|
+
closeFind(): void;
|
|
147
|
+
private onCellClicked;
|
|
148
|
+
private onCellMouseDown;
|
|
149
|
+
private onRowClicked;
|
|
150
|
+
private onRowDoubleClicked;
|
|
151
|
+
private onCellContextMenu;
|
|
152
|
+
private onRowGroupClicked;
|
|
153
|
+
private onHeaderCheckboxChanged;
|
|
154
|
+
private updateHeaderCheckboxes;
|
|
155
|
+
private onViewportKeyDown;
|
|
156
|
+
private onColumnResized;
|
|
157
|
+
private onColumnMoved;
|
|
158
|
+
private onColumnsChanged;
|
|
159
|
+
private onModelUpdated;
|
|
160
|
+
onGridSizeChanged(): void;
|
|
161
|
+
private onWindowResize;
|
|
162
|
+
/** outside clicks (or clicks on the grid chrome) commit the edit and drop focus */
|
|
163
|
+
private onDocumentMouseDown;
|
|
164
|
+
private renderDetailRow;
|
|
165
|
+
private dispatchGridReady;
|
|
166
|
+
updateGridOptions(options: Partial<GridOptions>): void;
|
|
167
|
+
destroy(): void;
|
|
168
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Grid } from './grid';
|
|
2
|
+
import type { GridOptions, GridApi, ColumnApi } from './types';
|
|
3
|
+
import { CELL_RENDERERS, CELL_EDITORS } from './render/cellRenderers';
|
|
4
|
+
import { createSparklineSvg } from './render/cellRenderers';
|
|
5
|
+
import { formatNumberCommas } from './core/utils';
|
|
6
|
+
export { Grid };
|
|
7
|
+
export type { GridOptions, ColDef, GridApi, ColumnApi, RowNode, Column, ColumnState, SortModelItem, FilterModelItem, CellRange, CellRendererParams, ValueFormatterParams, ValueGetterParams, CellClassParams, ICellRenderer, ICellEditor, AggFunc, ExportParams, RowDataTransaction, SideBarDef, StatusPanelDef, } from './types';
|
|
8
|
+
/**
|
|
9
|
+
* Create a grid inside the given element. Mirrors ag-grid's createGrid().
|
|
10
|
+
*/
|
|
11
|
+
export declare function createGrid(eGridDiv: HTMLElement, gridOptions: GridOptions): {
|
|
12
|
+
api: GridApi;
|
|
13
|
+
columnApi: ColumnApi;
|
|
14
|
+
grid: Grid;
|
|
15
|
+
};
|
|
16
|
+
/** Register custom cell renderers / editors (ag-grid module-style registry). */
|
|
17
|
+
export declare function registerRenderer(name: string, factory: (params: any) => any): void;
|
|
18
|
+
export declare function registerEditor(name: string, factory: (params: any) => any): void;
|
|
19
|
+
export { CELL_RENDERERS, CELL_EDITORS, createSparklineSvg, formatNumberCommas };
|
|
20
|
+
export { computeStickyGroupRows } from './render/stickyGroupRows';
|
|
21
|
+
export { DEFAULT_LOCALE_TEXT } from './core/localeText';
|
|
22
|
+
export { evaluateFormula, isFormula, tokenize, parse, FORMULA_FUNCTIONS, registerFormulaFunction } from './core/formulaEngine';
|
|
23
|
+
export type { FormulaContext, FormulaValue } from './core/formulaEngine';
|
|
24
|
+
export default Grid;
|
|
25
|
+
export * from './gantt';
|
|
26
|
+
export * from './personnel';
|
|
27
|
+
export { createDetailDialog } from './components/detailDialog';
|
|
28
|
+
export type { DetailDialogContent } from './components/detailDialog';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ScheduleItem, SchedulePerson } from './model';
|
|
2
|
+
export interface PersonnelScheduleOptions {
|
|
3
|
+
people: SchedulePerson[];
|
|
4
|
+
items: ScheduleItem[];
|
|
5
|
+
today?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
workItemLabel?: string;
|
|
8
|
+
/** Use distinct keys to isolate saved views by application or workspace. */
|
|
9
|
+
viewStorageKey?: string;
|
|
10
|
+
onItemChange?: (item: ScheduleItem) => void;
|
|
11
|
+
onItemOpen?: (item: ScheduleItem) => void;
|
|
12
|
+
}
|
|
13
|
+
export interface PersonnelScheduleApi {
|
|
14
|
+
setData(people: SchedulePerson[], items: ScheduleItem[]): void;
|
|
15
|
+
getItems(): ScheduleItem[];
|
|
16
|
+
updateItem(id: string, changes: Partial<Omit<ScheduleItem, 'id'>>): void;
|
|
17
|
+
setPeople(ids: string[]): void;
|
|
18
|
+
destroy(): void;
|
|
19
|
+
}
|
|
20
|
+
export declare function createPersonnelSchedule(container: HTMLElement, options: PersonnelScheduleOptions): PersonnelScheduleApi;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface SchedulePerson {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
color?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ScheduleItem {
|
|
7
|
+
id: string;
|
|
8
|
+
personId: string;
|
|
9
|
+
name: string;
|
|
10
|
+
status: string;
|
|
11
|
+
node: string;
|
|
12
|
+
estimate: number;
|
|
13
|
+
start: string | null;
|
|
14
|
+
end: string | null;
|
|
15
|
+
color?: string;
|
|
16
|
+
parentId?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const dateNumber: (key: string) => number;
|
|
19
|
+
export declare const dateKey: (n: number) => string;
|
|
20
|
+
export declare const isScheduled: (item: ScheduleItem) => boolean;
|
|
21
|
+
export declare function validateSchedule(people: SchedulePerson[], items: ScheduleItem[]): void;
|
|
22
|
+
/** Interval packing keeps overlapping assignments on separate lanes. */
|
|
23
|
+
export declare function scheduleLanes(items: ScheduleItem[], expanded?: boolean): Array<{
|
|
24
|
+
item: ScheduleItem;
|
|
25
|
+
lane: number;
|
|
26
|
+
}>;
|
|
27
|
+
export declare function scheduleStats(items: ScheduleItem[]): {
|
|
28
|
+
scheduled: number;
|
|
29
|
+
unscheduled: number;
|
|
30
|
+
estimate: number;
|
|
31
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ICellEditor, ICellRenderer } from '../types';
|
|
2
|
+
export declare function createSparklineSvg(values: number[] | Array<{
|
|
3
|
+
value: number;
|
|
4
|
+
}>, width: number, height: number, options?: {
|
|
5
|
+
type?: 'line' | 'area' | 'bar';
|
|
6
|
+
direction?: 'horizontal' | 'vertical';
|
|
7
|
+
fill?: boolean;
|
|
8
|
+
tooltip?: {
|
|
9
|
+
enabled?: boolean;
|
|
10
|
+
};
|
|
11
|
+
axis?: {
|
|
12
|
+
type?: 'number' | 'category';
|
|
13
|
+
strokeWidth?: number;
|
|
14
|
+
};
|
|
15
|
+
pointsOfInterest?: {
|
|
16
|
+
show?: boolean;
|
|
17
|
+
};
|
|
18
|
+
}): SVGElement;
|
|
19
|
+
export declare const CELL_RENDERERS: Record<string, (params: any) => ICellRenderer | HTMLElement>;
|
|
20
|
+
export declare function formatGroupValue(value: any): string;
|
|
21
|
+
export declare const CELL_EDITORS: Record<string, (params: any) => ICellEditor>;
|
|
22
|
+
export declare const ICON_CARET_RIGHT = "<svg viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" fill=\"currentColor\"><path d=\"M6 4l4 4-4 4V4z\"/></svg>";
|
|
23
|
+
export declare const ICON_CARET_DOWN = "<svg viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" fill=\"currentColor\"><path d=\"M4 6l4 4 4-4H4z\"/></svg>";
|
|
24
|
+
export declare const ICON_DRAG = "<svg viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" fill=\"currentColor\"><circle cx=\"5\" cy=\"3\" r=\"1.4\"/><circle cx=\"11\" cy=\"3\" r=\"1.4\"/><circle cx=\"5\" cy=\"8\" r=\"1.4\"/><circle cx=\"11\" cy=\"8\" r=\"1.4\"/><circle cx=\"5\" cy=\"13\" r=\"1.4\"/><circle cx=\"11\" cy=\"13\" r=\"1.4\"/></svg>";
|
|
25
|
+
export declare const ICON_MENU = "<svg viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" fill=\"currentColor\"><circle cx=\"3\" cy=\"8\" r=\"1.4\"/><circle cx=\"8\" cy=\"8\" r=\"1.4\"/><circle cx=\"13\" cy=\"8\" r=\"1.4\"/></svg>";
|
|
26
|
+
export declare const ICON_FILTER = "<svg viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" fill=\"currentColor\"><path d=\"M1 2h14l-5.2 6v5.3L6.2 15V8L1 2z\"/></svg>";
|
|
27
|
+
export declare const ICON_SORT_ASC = "<svg viewBox=\"0 0 16 16\" width=\"12\" height=\"12\" fill=\"currentColor\"><path d=\"M8 3l4.5 7h-9L8 3z\"/></svg>";
|
|
28
|
+
export declare const ICON_SORT_DESC = "<svg viewBox=\"0 0 16 16\" width=\"12\" height=\"12\" fill=\"currentColor\"><path d=\"M8 13L3.5 6h9L8 13z\"/></svg>";
|
|
29
|
+
export declare const ICON_ARROW_DOWN = "<svg viewBox=\"0 0 16 16\" width=\"12\" height=\"12\" fill=\"currentColor\"><path d=\"M8 12L3 5h10L8 12z\"/></svg>";
|
|
30
|
+
export declare const ICON_CHECK = "<svg viewBox=\"0 0 16 16\" width=\"12\" height=\"12\" fill=\"currentColor\"><path d=\"M6 11.2L2.8 8l-1 1L6 13.2 14.6 4.6l-1-1L6 11.2z\"/></svg>";
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { Column, GridOptions } from '../types';
|
|
2
|
+
import { EventService } from '../core/eventService';
|
|
3
|
+
export interface HeaderContext {
|
|
4
|
+
options: GridOptions;
|
|
5
|
+
/** UI text lookup (localeText) */
|
|
6
|
+
t: (key: string) => string;
|
|
7
|
+
/** lazy accessors — the api does not exist yet when the header is created */
|
|
8
|
+
getApi?: () => any;
|
|
9
|
+
getFilterModel?: (colId: string) => any;
|
|
10
|
+
onFilterModelChange?: (column: Column, model: any) => void;
|
|
11
|
+
eventService: EventService;
|
|
12
|
+
getColumns: () => {
|
|
13
|
+
left: Column[];
|
|
14
|
+
center: Column[];
|
|
15
|
+
right: Column[];
|
|
16
|
+
};
|
|
17
|
+
getColumnModel: () => any;
|
|
18
|
+
getSortState: () => {
|
|
19
|
+
sortColumns: Column[];
|
|
20
|
+
};
|
|
21
|
+
onSortRequested: (column: Column, event: MouseEvent, multiSort: boolean) => void;
|
|
22
|
+
onColumnResized: (column: Column, width: number, finished: boolean) => void;
|
|
23
|
+
onColumnMoved: (fromColId: string, toColId: string | null) => void;
|
|
24
|
+
onColumnMenuClicked: (column: Column, eButton: HTMLElement) => void;
|
|
25
|
+
onFilterOpened: (column: Column, eButton: HTMLElement) => void;
|
|
26
|
+
isFilterActive: (column: Column) => boolean;
|
|
27
|
+
getQuickFilterText: () => string;
|
|
28
|
+
onFloatingFilterChanged: (column: Column, value: string) => void;
|
|
29
|
+
onHeaderCheckboxChanged: (column: Column, checked: boolean) => void;
|
|
30
|
+
onColumnPinnedRequested: (column: Column) => void;
|
|
31
|
+
isColumnMenuSuppressed: (column: Column) => boolean;
|
|
32
|
+
headerHeight: number;
|
|
33
|
+
}
|
|
34
|
+
export declare class HeaderView {
|
|
35
|
+
private ctx;
|
|
36
|
+
private eHeader;
|
|
37
|
+
private ePinnedLeftHeader;
|
|
38
|
+
private ePinnedRightHeader;
|
|
39
|
+
private eHeaderViewport;
|
|
40
|
+
private eHeaderContainer;
|
|
41
|
+
private eHeaderRow;
|
|
42
|
+
private eFloatingFiltersRow;
|
|
43
|
+
private eGroupRows;
|
|
44
|
+
private headerCells;
|
|
45
|
+
private customHeaderComponents;
|
|
46
|
+
private resizeState;
|
|
47
|
+
private dragState;
|
|
48
|
+
private lastWidths;
|
|
49
|
+
constructor(eHeader: HTMLElement, ctx: HeaderContext);
|
|
50
|
+
refresh(): void;
|
|
51
|
+
/** render spanning column-group header rows (one row per group depth) */
|
|
52
|
+
private renderGroupRows;
|
|
53
|
+
private renderSection;
|
|
54
|
+
private createHeaderCell;
|
|
55
|
+
private createFloatingFilter;
|
|
56
|
+
private updateSortIndicator;
|
|
57
|
+
/** update sort/filter visuals without rebuilding the DOM */
|
|
58
|
+
updateIndicators(): void;
|
|
59
|
+
private headerColumnIndex;
|
|
60
|
+
private layoutPositions;
|
|
61
|
+
setScrollLeft(left: number): void;
|
|
62
|
+
getHeaderCell(column: Column): HTMLElement | undefined;
|
|
63
|
+
getHeaderRow(): HTMLElement;
|
|
64
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import type { Column, GridOptions, RowNode } from '../types';
|
|
2
|
+
import type { RowModel } from '../core/clientSideRowModel';
|
|
3
|
+
import type { EventService } from '../core/eventService';
|
|
4
|
+
import { escapeHtml } from '../core/utils';
|
|
5
|
+
export interface RowRendererContext {
|
|
6
|
+
options: GridOptions;
|
|
7
|
+
eventService: EventService;
|
|
8
|
+
rowModel: RowModel;
|
|
9
|
+
getColumns: () => {
|
|
10
|
+
left: Column[];
|
|
11
|
+
center: Column[];
|
|
12
|
+
right: Column[];
|
|
13
|
+
};
|
|
14
|
+
getRowHeight: (node: RowNode) => number;
|
|
15
|
+
isNodeSelected: (node: RowNode) => boolean;
|
|
16
|
+
isRowSelectable: (node: RowNode) => boolean;
|
|
17
|
+
getRowClass: (node: RowNode) => string;
|
|
18
|
+
getRowStyle: (node: RowNode) => Record<string, any>;
|
|
19
|
+
onCellClicked: (params: any) => void;
|
|
20
|
+
onCellDoubleClicked: (params: any) => void;
|
|
21
|
+
onCellMouseDown: (params: any) => void;
|
|
22
|
+
onCellContextMenu: (params: any) => void;
|
|
23
|
+
onRowClicked: (params: any) => void;
|
|
24
|
+
onRowDoubleClicked: (params: any) => void;
|
|
25
|
+
onRowGroupClicked?: (node: RowNode) => void;
|
|
26
|
+
onViewportKeyDown: (event: KeyboardEvent) => void;
|
|
27
|
+
onViewportScroll?: () => void;
|
|
28
|
+
getCellText: (column: Column, node: RowNode) => string;
|
|
29
|
+
renderDetailRow?: (node: RowNode, eRow: HTMLElement) => {
|
|
30
|
+
eDetail: HTMLElement;
|
|
31
|
+
height: number;
|
|
32
|
+
} | null;
|
|
33
|
+
rowDragEnabled: () => boolean;
|
|
34
|
+
onRowDragStart?: (node: RowNode, eGui: HTMLElement, event: MouseEvent) => void;
|
|
35
|
+
getNote?: (rowNodeId: string, colId: string, colDefNote: any, params: any) => string | undefined;
|
|
36
|
+
onNoteClick?: (rowNodeId: string, colId: string, anchor: HTMLElement) => void;
|
|
37
|
+
rowNumberOffset?: () => number;
|
|
38
|
+
}
|
|
39
|
+
export declare class RowRenderer {
|
|
40
|
+
private ctx;
|
|
41
|
+
private eRoot;
|
|
42
|
+
private eHeader;
|
|
43
|
+
private eBody;
|
|
44
|
+
private ePinnedLeft;
|
|
45
|
+
private ePinnedRight;
|
|
46
|
+
private ePinnedLeftInner;
|
|
47
|
+
private ePinnedRightInner;
|
|
48
|
+
private eViewport;
|
|
49
|
+
private eContainer;
|
|
50
|
+
private eFloatingTop;
|
|
51
|
+
private eFloatingBottom;
|
|
52
|
+
private eFloatingTopLeft;
|
|
53
|
+
private eFloatingTopRight;
|
|
54
|
+
private eFloatingBottomLeft;
|
|
55
|
+
private eFloatingBottomRight;
|
|
56
|
+
private eStickyTop;
|
|
57
|
+
private eStickyLeft;
|
|
58
|
+
private eStickyCenter;
|
|
59
|
+
private eStickyRight;
|
|
60
|
+
private eRangeOverlay;
|
|
61
|
+
private rowComps;
|
|
62
|
+
private stickyComps;
|
|
63
|
+
private hoveredRowId;
|
|
64
|
+
private rowOffsets;
|
|
65
|
+
private rowInfos;
|
|
66
|
+
private totalHeight;
|
|
67
|
+
private lastScrollTop;
|
|
68
|
+
private lastRange;
|
|
69
|
+
private firstRendered;
|
|
70
|
+
private heightVersion;
|
|
71
|
+
constructor(eRoot: HTMLElement, eHeader: HTMLElement, ctx: RowRendererContext);
|
|
72
|
+
/**
|
|
73
|
+
* Forward wheel gestures from the non-scrollable sections (pinned column
|
|
74
|
+
* areas, sticky rows, floating rows, header) to the scrolling viewport.
|
|
75
|
+
*/
|
|
76
|
+
private onSectionWheel;
|
|
77
|
+
private onBodyMouseOver;
|
|
78
|
+
private onBodyMouseLeave;
|
|
79
|
+
private setRowHovered;
|
|
80
|
+
getViewport(): HTMLElement;
|
|
81
|
+
getBody(): HTMLElement;
|
|
82
|
+
getContainer(): HTMLElement;
|
|
83
|
+
getRowComps(): Map<string, RowComp>;
|
|
84
|
+
setRangeOverlay(eOverlay: HTMLElement | null): void;
|
|
85
|
+
getHeaderElement(): HTMLElement;
|
|
86
|
+
/** recompute row offsets (variable heights) */
|
|
87
|
+
private recomputeOffsets;
|
|
88
|
+
/** level and group flag of the row at the given index */
|
|
89
|
+
private rowInfoAt;
|
|
90
|
+
private hasVariableHeights;
|
|
91
|
+
private getFixedRowHeight;
|
|
92
|
+
private getRowHeightForIndex;
|
|
93
|
+
/** full refresh: rows were added/removed/reordered */
|
|
94
|
+
refreshRows(): void;
|
|
95
|
+
/** called when heights may have changed (e.g. detail auto height) */
|
|
96
|
+
invalidateRowHeights(): void;
|
|
97
|
+
redrawAllRows(): void;
|
|
98
|
+
private renderPinnedRows;
|
|
99
|
+
/** refresh cell values for given rows (or all rendered) */
|
|
100
|
+
refreshCells(params?: {
|
|
101
|
+
rowNodes?: RowNode[];
|
|
102
|
+
columns?: Array<string | Column>;
|
|
103
|
+
force?: boolean;
|
|
104
|
+
flash?: boolean;
|
|
105
|
+
}): void;
|
|
106
|
+
flashCells(params: {
|
|
107
|
+
rowNodes?: RowNode[];
|
|
108
|
+
columns?: Array<string | Column>;
|
|
109
|
+
}): void;
|
|
110
|
+
redrawRows(params?: {
|
|
111
|
+
rowNodes?: RowNode[];
|
|
112
|
+
}): void;
|
|
113
|
+
private rowCompKey;
|
|
114
|
+
private findRowIndex;
|
|
115
|
+
private onScroll;
|
|
116
|
+
/** keep the pinned column sections aligned with the vertical scroll position */
|
|
117
|
+
private syncPinnedScroll;
|
|
118
|
+
/**
|
|
119
|
+
* The centre slice of the sticky rows scrolls horizontally with the columns.
|
|
120
|
+
* The translation is applied to the rows inside the slice, not to the slice
|
|
121
|
+
* itself: moving the slice would shift its clipping window over the pinned
|
|
122
|
+
* column area and hide the cells there.
|
|
123
|
+
*/
|
|
124
|
+
private syncStickyHorizontal;
|
|
125
|
+
getVerticalScrollTop(): number;
|
|
126
|
+
setVerticalScrollTop(top: number): void;
|
|
127
|
+
getHorizontalScrollLeft(): number;
|
|
128
|
+
setHorizontalScrollLeft(left: number): void;
|
|
129
|
+
/**
|
|
130
|
+
* Re-renders the group rows that stick to the top of the viewport. A group
|
|
131
|
+
* row sticks when it has scrolled past the top while one of its own rows is
|
|
132
|
+
* still visible; the stick rows are the ancestor chain of the first visible
|
|
133
|
+
* row, stacked shallowest-first. Returns the set of node ids now shown in the
|
|
134
|
+
* sticky overlay so the caller can skip their normal row comps.
|
|
135
|
+
*/
|
|
136
|
+
private syncStickyGroupRows;
|
|
137
|
+
renderVisibleRows(force?: boolean): void;
|
|
138
|
+
private findIndexAtPixel;
|
|
139
|
+
/** scroll so that the given row index is visible */
|
|
140
|
+
ensureIndexVisible(index: number, position?: 'top' | 'bottom' | 'middle'): void;
|
|
141
|
+
getFirstVisibleRowIndex(): number;
|
|
142
|
+
getLastVisibleRowIndex(): number;
|
|
143
|
+
ensureColumnVisible(column: Column, position?: 'start' | 'end' | 'middle'): void;
|
|
144
|
+
/** pixel x of a cell for a given column and row index */
|
|
145
|
+
getCellPosition(rowIndex: number, column: Column): {
|
|
146
|
+
top: number;
|
|
147
|
+
left: number;
|
|
148
|
+
height: number;
|
|
149
|
+
width: number;
|
|
150
|
+
};
|
|
151
|
+
getRowOffsets(): number[];
|
|
152
|
+
getTotalHeight(): number;
|
|
153
|
+
private findCellFromEvent;
|
|
154
|
+
private getRowIndexForNode;
|
|
155
|
+
private onClick;
|
|
156
|
+
private onDoubleClick;
|
|
157
|
+
private onMouseDown;
|
|
158
|
+
private onContextMenu;
|
|
159
|
+
destroy(): void;
|
|
160
|
+
}
|
|
161
|
+
declare class RowComp {
|
|
162
|
+
private ctx;
|
|
163
|
+
private node;
|
|
164
|
+
private rowHeight;
|
|
165
|
+
private heightVersion;
|
|
166
|
+
private eLeft;
|
|
167
|
+
private eCenter;
|
|
168
|
+
private eRight;
|
|
169
|
+
private cellComps;
|
|
170
|
+
private pinned;
|
|
171
|
+
constructor(ctx: RowRendererContext, node: RowNode, leftColumns: Column[], centerColumns: Column[], rightColumns: Column[], rowHeight: number, heightVersion: number);
|
|
172
|
+
isPinned(): boolean;
|
|
173
|
+
/** marks the row as a sticky group row (rendered in the sticky overlay) */
|
|
174
|
+
setSticky(sticky: boolean): void;
|
|
175
|
+
/** hover highlight spans every section of the row */
|
|
176
|
+
setHovered(hovered: boolean): void;
|
|
177
|
+
getNode(): RowNode;
|
|
178
|
+
private createRowElement;
|
|
179
|
+
private cellColumnIndex;
|
|
180
|
+
private createCell;
|
|
181
|
+
private updateCellContent;
|
|
182
|
+
refreshCells(columns?: Column[], force?: boolean, flash?: boolean): void;
|
|
183
|
+
appendTo(leftContainer: HTMLElement, centerContainer: HTMLElement, rightContainer: HTMLElement): void;
|
|
184
|
+
ensureVisibleCells(): void;
|
|
185
|
+
setTop(top: number): void;
|
|
186
|
+
getCenterElement(): HTMLElement | null;
|
|
187
|
+
getCellElements(): HTMLElement[];
|
|
188
|
+
destroy(): void;
|
|
189
|
+
}
|
|
190
|
+
export { escapeHtml };
|