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,62 @@
|
|
|
1
|
+
import type { Column, RowNode } from '../types';
|
|
2
|
+
import type { EventService } from '../core/eventService';
|
|
3
|
+
import type { Grid } from '../grid';
|
|
4
|
+
export interface FocusedCell {
|
|
5
|
+
rowIndex: number;
|
|
6
|
+
column: Column;
|
|
7
|
+
rowNode: RowNode;
|
|
8
|
+
}
|
|
9
|
+
export declare class EditService {
|
|
10
|
+
private grid;
|
|
11
|
+
private eventService;
|
|
12
|
+
private editing;
|
|
13
|
+
/** full-row editing: one editor per editable cell in the row */
|
|
14
|
+
private fullRowEditors;
|
|
15
|
+
private fullRowNode;
|
|
16
|
+
private focusedCell;
|
|
17
|
+
private suppressClickEdit;
|
|
18
|
+
constructor(grid: Grid, eventService: EventService);
|
|
19
|
+
getFocusedCell(): FocusedCell | null;
|
|
20
|
+
setFocusedCell(rowIndex: number, column: Column): void;
|
|
21
|
+
clearFocusedCell(): void;
|
|
22
|
+
/** remove the focus ring from every cell (only one cell can be focused) */
|
|
23
|
+
private clearFocusClass;
|
|
24
|
+
private findCellElement;
|
|
25
|
+
isEditing(): boolean;
|
|
26
|
+
getEditingCells(): Array<{
|
|
27
|
+
rowIndex: number;
|
|
28
|
+
colId: string;
|
|
29
|
+
}>;
|
|
30
|
+
startEditingCell(params: {
|
|
31
|
+
rowIndex: number;
|
|
32
|
+
colKey: string | Column;
|
|
33
|
+
charPress?: string;
|
|
34
|
+
}): void;
|
|
35
|
+
private startFullRowEditing;
|
|
36
|
+
private createEditor;
|
|
37
|
+
stopEditing(cancel?: boolean): boolean;
|
|
38
|
+
private applyValueSetter;
|
|
39
|
+
private stopFullRowEditing;
|
|
40
|
+
private onEditorKeyDown;
|
|
41
|
+
/** grid level key handling */
|
|
42
|
+
onGridKeyDown(event: KeyboardEvent): void;
|
|
43
|
+
private isTextInput;
|
|
44
|
+
private getPageJump;
|
|
45
|
+
moveFocus(rowDelta: number, colDelta: number): void;
|
|
46
|
+
tabToNextCell(): void;
|
|
47
|
+
tabToPreviousCell(): void;
|
|
48
|
+
/** cell click → focus + maybe edit */
|
|
49
|
+
onCellClicked(params: {
|
|
50
|
+
node: RowNode;
|
|
51
|
+
column: Column;
|
|
52
|
+
event: MouseEvent;
|
|
53
|
+
rowIndex: number;
|
|
54
|
+
}): void;
|
|
55
|
+
onCellDoubleClicked(params: {
|
|
56
|
+
node: RowNode;
|
|
57
|
+
column: Column;
|
|
58
|
+
event: MouseEvent;
|
|
59
|
+
rowIndex: number;
|
|
60
|
+
}): void;
|
|
61
|
+
destroy(): void;
|
|
62
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ExportParams } from '../types';
|
|
2
|
+
import type { Grid } from '../grid';
|
|
3
|
+
import { escapeHtml } from '../core/utils';
|
|
4
|
+
export declare class ExportService {
|
|
5
|
+
private grid;
|
|
6
|
+
private lastCopied;
|
|
7
|
+
constructor(grid: Grid);
|
|
8
|
+
private getExportColumns;
|
|
9
|
+
private getExportRows;
|
|
10
|
+
private getCellValueForExport;
|
|
11
|
+
getDataAsCsv(params?: ExportParams): string;
|
|
12
|
+
private csvRow;
|
|
13
|
+
getDataAsExcel(params?: ExportParams): Blob;
|
|
14
|
+
exportToCsv(params?: ExportParams): void;
|
|
15
|
+
exportToExcel(params?: ExportParams): void;
|
|
16
|
+
/** PDF export — paginated, Helvetica, header row shaded and bold. */
|
|
17
|
+
getDataAsPdf(params?: ExportParams & {
|
|
18
|
+
pageSize?: string;
|
|
19
|
+
title?: string;
|
|
20
|
+
}): Blob;
|
|
21
|
+
exportToPdf(params?: ExportParams & {
|
|
22
|
+
pageSize?: string;
|
|
23
|
+
title?: string;
|
|
24
|
+
}): void;
|
|
25
|
+
/** Excel import — reads .xlsx files and loads the first sheet as row data. */
|
|
26
|
+
importExcel(file: Blob | ArrayBuffer, params?: {
|
|
27
|
+
sheetIndex?: number;
|
|
28
|
+
onSuccess?: (rows: any[]) => void;
|
|
29
|
+
}): Promise<any[]>;
|
|
30
|
+
private fileName;
|
|
31
|
+
private download;
|
|
32
|
+
copyToClipboard(params?: any): void;
|
|
33
|
+
cutToClipboard(params?: any): void;
|
|
34
|
+
pasteFromClipboard(): void;
|
|
35
|
+
pasteText(text: string): void;
|
|
36
|
+
private writeToClipboard;
|
|
37
|
+
private fallbackCopy;
|
|
38
|
+
}
|
|
39
|
+
export { escapeHtml };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Column } from '../types';
|
|
2
|
+
import type { Grid } from '../grid';
|
|
3
|
+
import { PopupService } from './popupService';
|
|
4
|
+
export declare class FilterGui {
|
|
5
|
+
private grid;
|
|
6
|
+
private popupService;
|
|
7
|
+
constructor(grid: Grid, popupService: PopupService);
|
|
8
|
+
openFilter(column: Column, anchor: HTMLElement): void;
|
|
9
|
+
private buildSetFilter;
|
|
10
|
+
private buildConditionSelect;
|
|
11
|
+
/** Multi Filter: several filter types combined with AND/OR on one column. */
|
|
12
|
+
openMultiFilter(column: Column, anchor: HTMLElement): void;
|
|
13
|
+
/** Advanced Filter: cross-column expression builder. */
|
|
14
|
+
openAdvancedFilter(anchor: HTMLElement): void;
|
|
15
|
+
/** Custom column filter component (colDef.filterComponent). */
|
|
16
|
+
private openCustomFilter;
|
|
17
|
+
private getDefaultModel;
|
|
18
|
+
private isMeaningful;
|
|
19
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Column, FilterModelItem } from '../types';
|
|
2
|
+
import type { Grid } from '../grid';
|
|
3
|
+
export interface AdvancedFilterCondition {
|
|
4
|
+
colId: string;
|
|
5
|
+
type: string;
|
|
6
|
+
filter?: any;
|
|
7
|
+
filterTo?: any;
|
|
8
|
+
dateFrom?: string;
|
|
9
|
+
dateTo?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface AdvancedFilterModel {
|
|
12
|
+
filterType: 'advanced';
|
|
13
|
+
operator: 'AND' | 'OR';
|
|
14
|
+
conditions: AdvancedFilterCondition[];
|
|
15
|
+
}
|
|
16
|
+
export declare class FilterService {
|
|
17
|
+
private grid;
|
|
18
|
+
private filterModel;
|
|
19
|
+
private advancedFilterModel;
|
|
20
|
+
constructor(grid: Grid);
|
|
21
|
+
getAdvancedFilterModel(): AdvancedFilterModel | null;
|
|
22
|
+
setAdvancedFilterModel(model: AdvancedFilterModel | null): void;
|
|
23
|
+
isAdvancedFilterEnabled(): boolean;
|
|
24
|
+
/** evaluate the advanced filter model against a node */
|
|
25
|
+
doesNodePassAdvancedFilter(node: any): boolean;
|
|
26
|
+
getFilterModel(): Record<string, FilterModelItem>;
|
|
27
|
+
getFilterInstance(colId: string): FilterModelItem | undefined;
|
|
28
|
+
setFilterModel(model: Record<string, FilterModelItem> | null): void;
|
|
29
|
+
setColumnFilterModel(colKey: string | Column, model: FilterModelItem | null): void;
|
|
30
|
+
isFilterActive(column: Column): boolean;
|
|
31
|
+
private isModelMeaningful;
|
|
32
|
+
/** build a filter model from a floating-filter value */
|
|
33
|
+
handleFloatingFilterChange(column: Column, value: string): void;
|
|
34
|
+
resetFilters(): void;
|
|
35
|
+
onFilterChanged(source: string): void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Grid } from '../grid';
|
|
2
|
+
import type { PopupService } from './popupService';
|
|
3
|
+
export declare class FindService {
|
|
4
|
+
private grid;
|
|
5
|
+
private popupService;
|
|
6
|
+
private matches;
|
|
7
|
+
private activeMatch;
|
|
8
|
+
private searchText;
|
|
9
|
+
private matchCase;
|
|
10
|
+
private ePopup;
|
|
11
|
+
private eCount;
|
|
12
|
+
private eInput;
|
|
13
|
+
private closePopup;
|
|
14
|
+
constructor(grid: Grid, popupService: PopupService);
|
|
15
|
+
isOpen(): boolean;
|
|
16
|
+
open(): void;
|
|
17
|
+
close(): void;
|
|
18
|
+
setFindText(text: string): void;
|
|
19
|
+
getFindText(): string;
|
|
20
|
+
getNumMatches(): number;
|
|
21
|
+
getActiveMatch(): number;
|
|
22
|
+
find(text: string): void;
|
|
23
|
+
findNext(): boolean;
|
|
24
|
+
findPrevious(): boolean;
|
|
25
|
+
private goToActive;
|
|
26
|
+
applyHighlight(): void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Column } from '../types';
|
|
2
|
+
import type { Grid } from '../grid';
|
|
3
|
+
import type { PopupService } from './popupService';
|
|
4
|
+
/** Formula editor popup — edits a column's formula (calculated columns). */
|
|
5
|
+
export declare class FormulaEditorService {
|
|
6
|
+
private grid;
|
|
7
|
+
private popupService;
|
|
8
|
+
constructor(grid: Grid, popupService: PopupService);
|
|
9
|
+
isFormulaColumn(column: Column): boolean;
|
|
10
|
+
openFormulaEditor(column: Column, anchor: HTMLElement): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Grid } from '../grid';
|
|
2
|
+
import type { PopupService } from './popupService';
|
|
3
|
+
interface NoteKey {
|
|
4
|
+
rowNodeId: string;
|
|
5
|
+
colId: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Cell Notes (ag-grid Notes) — note markers in cell corners with an editor popup.
|
|
9
|
+
* Notes can be declared per column (colDef.note) or set at runtime via the API.
|
|
10
|
+
*/
|
|
11
|
+
export declare class NotesService {
|
|
12
|
+
private grid;
|
|
13
|
+
private popupService;
|
|
14
|
+
private runtimeNotes;
|
|
15
|
+
constructor(grid: Grid, popupService: PopupService);
|
|
16
|
+
private keyOf;
|
|
17
|
+
/** the note text for a cell, or undefined when there is none */
|
|
18
|
+
getNote(rowNodeId: string, colId: string, colDefNote?: any, params?: any): string | undefined;
|
|
19
|
+
setNote(rowNodeId: string, colId: string, note: string | undefined): void;
|
|
20
|
+
/** open the note editor popup anchored to the note marker */
|
|
21
|
+
openNoteEditor(rowNodeId: string, colId: string, anchor: HTMLElement): void;
|
|
22
|
+
}
|
|
23
|
+
export type { NoteKey };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Grid } from '../grid';
|
|
2
|
+
export declare class OverlayService {
|
|
3
|
+
private grid;
|
|
4
|
+
private eOverlayWrapper;
|
|
5
|
+
private current;
|
|
6
|
+
constructor(grid: Grid);
|
|
7
|
+
private show;
|
|
8
|
+
showLoadingOverlay(): void;
|
|
9
|
+
showNoRowsOverlay(): void;
|
|
10
|
+
hideOverlay(): void;
|
|
11
|
+
/** auto-show/hide based on row count */
|
|
12
|
+
updateAuto(): void;
|
|
13
|
+
getCurrent(): 'loading' | 'noRows' | null;
|
|
14
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Grid } from '../grid';
|
|
2
|
+
import type { EventService } from '../core/eventService';
|
|
3
|
+
export declare class PaginationService {
|
|
4
|
+
private grid;
|
|
5
|
+
private eventService;
|
|
6
|
+
private enabled;
|
|
7
|
+
private pageSize;
|
|
8
|
+
private currentPage;
|
|
9
|
+
private pageSizeSelector;
|
|
10
|
+
private ePanel;
|
|
11
|
+
private ePageInfo;
|
|
12
|
+
private ePageInput;
|
|
13
|
+
private ePageSizeSelect;
|
|
14
|
+
private ePageSizeContainer;
|
|
15
|
+
private eFromToContainer;
|
|
16
|
+
constructor(grid: Grid, eventService: EventService);
|
|
17
|
+
isEnabled(): boolean;
|
|
18
|
+
setEnabled(enabled: boolean): void;
|
|
19
|
+
getPageSize(): number;
|
|
20
|
+
setPageSize(size: number): void;
|
|
21
|
+
getCurrentPage(): number;
|
|
22
|
+
getTotalPages(): number;
|
|
23
|
+
goToPage(page: number): void;
|
|
24
|
+
goToNextPage(): void;
|
|
25
|
+
goToPreviousPage(): void;
|
|
26
|
+
goToFirstPage(): void;
|
|
27
|
+
goToLastPage(): void;
|
|
28
|
+
/** clamp the current page when row count shrinks; refresh labels */
|
|
29
|
+
update(): void;
|
|
30
|
+
getPanel(): HTMLElement;
|
|
31
|
+
isLastPageFound(): boolean;
|
|
32
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Minimal PDF writer (Helvetica base-14 fonts, no dependencies). */
|
|
2
|
+
export interface PdfCell {
|
|
3
|
+
text: string;
|
|
4
|
+
bold?: boolean;
|
|
5
|
+
align?: 'left' | 'right' | 'center';
|
|
6
|
+
}
|
|
7
|
+
export interface PdfTable {
|
|
8
|
+
/** column widths in points; the table is laid out left to right */
|
|
9
|
+
columnWidths: number[];
|
|
10
|
+
rows: PdfCell[][];
|
|
11
|
+
/** optional row fill colour (0-1 rgb) e.g. header shading */
|
|
12
|
+
rowFill?: Array<[number, number, number] | undefined>;
|
|
13
|
+
}
|
|
14
|
+
export interface PdfOptions {
|
|
15
|
+
pageSize?: 'a4-landscape' | 'a4-portrait' | 'letter-landscape' | 'letter-portrait';
|
|
16
|
+
margin?: number;
|
|
17
|
+
fontSize?: number;
|
|
18
|
+
title?: string;
|
|
19
|
+
headerColor?: [number, number, number];
|
|
20
|
+
borderColor?: [number, number, number];
|
|
21
|
+
rowHeight?: number;
|
|
22
|
+
}
|
|
23
|
+
/** build the PDF bytes from page content streams */
|
|
24
|
+
export declare function createPdf(pages: PdfTable[], options?: PdfOptions): Blob;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Grid } from '../grid';
|
|
2
|
+
/** Generic popup used by filters, menus, find bar and chart panel. */
|
|
3
|
+
export declare class PopupService {
|
|
4
|
+
private grid;
|
|
5
|
+
private openPopups;
|
|
6
|
+
constructor(grid: Grid);
|
|
7
|
+
getParent(): HTMLElement;
|
|
8
|
+
createPopup(width?: number, className?: string): {
|
|
9
|
+
ePopup: HTMLElement;
|
|
10
|
+
close: () => void;
|
|
11
|
+
onClose: (cb: () => void) => void;
|
|
12
|
+
};
|
|
13
|
+
positionAt(ePopup: HTMLElement, anchor: HTMLElement, offsetX?: number): void;
|
|
14
|
+
closeAll(): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Grid } from '../grid';
|
|
2
|
+
import type { EventService } from '../core/eventService';
|
|
3
|
+
import type { Column } from '../types';
|
|
4
|
+
interface RangeState {
|
|
5
|
+
rowStartIndex: number;
|
|
6
|
+
rowEndIndex: number;
|
|
7
|
+
colStartId: string;
|
|
8
|
+
colEndId: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class RangeSelectionService {
|
|
11
|
+
private grid;
|
|
12
|
+
private eventService;
|
|
13
|
+
private ranges;
|
|
14
|
+
private currentRange;
|
|
15
|
+
private eOverlay;
|
|
16
|
+
private eHandle;
|
|
17
|
+
private dragState;
|
|
18
|
+
constructor(grid: Grid, eventService: EventService);
|
|
19
|
+
isEnabled(): boolean;
|
|
20
|
+
getRanges(): RangeState[];
|
|
21
|
+
clearRanges(): void;
|
|
22
|
+
onCellMouseDown(params: {
|
|
23
|
+
event: MouseEvent;
|
|
24
|
+
column: Column;
|
|
25
|
+
rowIndex: number;
|
|
26
|
+
}): void;
|
|
27
|
+
onHandleMouseDown(event: MouseEvent): void;
|
|
28
|
+
private onMouseMove;
|
|
29
|
+
private onMouseUp;
|
|
30
|
+
private getCenterColumns;
|
|
31
|
+
private getRangeBounds;
|
|
32
|
+
updateOverlay(): void;
|
|
33
|
+
/** toggle the highlight class on every rendered cell */
|
|
34
|
+
applyHighlight(): void;
|
|
35
|
+
/** cells covered by the first range */
|
|
36
|
+
getRangeCells(range: RangeState): Array<{
|
|
37
|
+
node: any;
|
|
38
|
+
column: Column;
|
|
39
|
+
}>;
|
|
40
|
+
getCurrentRange(): RangeState | null;
|
|
41
|
+
onGridKeyDown(event: KeyboardEvent): void;
|
|
42
|
+
}
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Grid } from '../grid';
|
|
2
|
+
import type { EventService } from '../core/eventService';
|
|
3
|
+
import type { RowNode } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* Row Dragging — managed (grid reorders the data) and unmanaged (app receives
|
|
6
|
+
* the drop) modes, matching ag-grid's rowDragManaged / rowDragEnd events.
|
|
7
|
+
*/
|
|
8
|
+
export declare class RowDragService {
|
|
9
|
+
private grid;
|
|
10
|
+
private eventService;
|
|
11
|
+
private dragState;
|
|
12
|
+
constructor(grid: Grid, eventService: EventService);
|
|
13
|
+
isEnabled(): boolean;
|
|
14
|
+
private hasDragHandle;
|
|
15
|
+
/** begin dragging a row from its drag handle */
|
|
16
|
+
startDrag(rowNode: RowNode, event: MouseEvent): void;
|
|
17
|
+
private rowLabel;
|
|
18
|
+
private onMouseMove;
|
|
19
|
+
private onMouseUp;
|
|
20
|
+
private onMouseMoveBind;
|
|
21
|
+
private onMouseUpBind;
|
|
22
|
+
private indexOf;
|
|
23
|
+
/** managed reorder — moves the row data and re-applies it */
|
|
24
|
+
private moveRow;
|
|
25
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Grid } from '../grid';
|
|
2
|
+
/** The "Row Groups" drop strip shown above the header (rowGroupPanelShow). */
|
|
3
|
+
export declare class RowGroupPanel {
|
|
4
|
+
private grid;
|
|
5
|
+
private ePanel;
|
|
6
|
+
private eChips;
|
|
7
|
+
constructor(grid: Grid);
|
|
8
|
+
refresh(): void;
|
|
9
|
+
private refreshVisibility;
|
|
10
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { RowNode } from '../types';
|
|
2
|
+
import type { EventService } from '../core/eventService';
|
|
3
|
+
export declare class SelectionService {
|
|
4
|
+
private eventService;
|
|
5
|
+
private getOptions;
|
|
6
|
+
private isNodeSelectable;
|
|
7
|
+
private selectedNodes;
|
|
8
|
+
private lastSelectedNode;
|
|
9
|
+
constructor(eventService: EventService, getOptions: () => any, isNodeSelectable: (node: RowNode) => boolean);
|
|
10
|
+
isEnabled(): boolean;
|
|
11
|
+
getSelectedNodes(): RowNode[];
|
|
12
|
+
getSelectedRows(): any[];
|
|
13
|
+
getSelectedCount(): number;
|
|
14
|
+
isNodeSelected(node: RowNode): boolean;
|
|
15
|
+
selectNode(node: RowNode, clearSelection?: boolean): void;
|
|
16
|
+
deselectNode(node: RowNode): void;
|
|
17
|
+
private selectChildrenRecursively;
|
|
18
|
+
selectAll(): void;
|
|
19
|
+
selectAllFiltered(): void;
|
|
20
|
+
deselectAll(): void;
|
|
21
|
+
toggleNode(node: RowNode): void;
|
|
22
|
+
/** row click handling honouring modifiers */
|
|
23
|
+
handleRowClick(node: RowNode, event: MouseEvent): boolean;
|
|
24
|
+
private selectRange;
|
|
25
|
+
/** called when rows are removed so stale nodes don't linger */
|
|
26
|
+
syncWithModel(): void;
|
|
27
|
+
getLastSelectedNode(): RowNode | null;
|
|
28
|
+
setSelectAllCheckboxState(checked: boolean): void;
|
|
29
|
+
getSelectAllState(): {
|
|
30
|
+
checked: boolean;
|
|
31
|
+
indeterminate: boolean;
|
|
32
|
+
};
|
|
33
|
+
private dispatchChanged;
|
|
34
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Grid } from '../grid';
|
|
2
|
+
export interface ToolPanelDef {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class SideBarService {
|
|
7
|
+
private grid;
|
|
8
|
+
private eBar;
|
|
9
|
+
private eButtons;
|
|
10
|
+
private ePanel;
|
|
11
|
+
private panels;
|
|
12
|
+
private activePanelId;
|
|
13
|
+
private visible;
|
|
14
|
+
private position;
|
|
15
|
+
constructor(grid: Grid);
|
|
16
|
+
private defaultLabel;
|
|
17
|
+
private buildButtons;
|
|
18
|
+
getElement(): HTMLElement;
|
|
19
|
+
setPosition(position: 'left' | 'right'): void;
|
|
20
|
+
setVisible(visible: boolean): void;
|
|
21
|
+
isVisible(): boolean;
|
|
22
|
+
openPanel(id: string): void;
|
|
23
|
+
getActivePanel(): string | null;
|
|
24
|
+
refresh(): void;
|
|
25
|
+
private buildColumnsPanel;
|
|
26
|
+
private buildColumnItem;
|
|
27
|
+
private buildFiltersPanel;
|
|
28
|
+
private buildFilterItem;
|
|
29
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Column, SortDirection, SortModelItem } from '../types';
|
|
2
|
+
import type { Grid } from '../grid';
|
|
3
|
+
export declare class SortService {
|
|
4
|
+
private grid;
|
|
5
|
+
constructor(grid: Grid);
|
|
6
|
+
getSortingOrder(): SortDirection[];
|
|
7
|
+
onSortRequested(column: Column, event: MouseEvent, multiSort: boolean): void;
|
|
8
|
+
private renumberSortIndices;
|
|
9
|
+
getSortModel(): SortModelItem[];
|
|
10
|
+
setSortModel(model: SortModelItem[]): void;
|
|
11
|
+
onSortChanged(source: string): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Grid } from '../grid';
|
|
2
|
+
import type { EventService } from '../core/eventService';
|
|
3
|
+
export declare class StatusBarService {
|
|
4
|
+
private grid;
|
|
5
|
+
private eventService;
|
|
6
|
+
private eBar;
|
|
7
|
+
private panels;
|
|
8
|
+
constructor(grid: Grid, eventService: EventService);
|
|
9
|
+
getElement(): HTMLElement;
|
|
10
|
+
isVisible(): boolean;
|
|
11
|
+
setVisible(visible: boolean): void;
|
|
12
|
+
update(): void;
|
|
13
|
+
private renderPanel;
|
|
14
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Grid } from '../grid';
|
|
2
|
+
import type { EventService } from '../core/eventService';
|
|
3
|
+
export interface UndoRedoAction {
|
|
4
|
+
rowNodeId: string;
|
|
5
|
+
colId: string;
|
|
6
|
+
oldValue: any;
|
|
7
|
+
newValue: any;
|
|
8
|
+
/** batch id — edits committed in one batch share an id and undo together */
|
|
9
|
+
batchId: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Undo / Redo for cell edits (ag-grid undoRedoCellEditing).
|
|
13
|
+
* Records every committed edit and can replay them in both directions.
|
|
14
|
+
*/
|
|
15
|
+
export declare class UndoRedoService {
|
|
16
|
+
private grid;
|
|
17
|
+
private eventService;
|
|
18
|
+
private undoStack;
|
|
19
|
+
private redoStack;
|
|
20
|
+
private limit;
|
|
21
|
+
private batchDepth;
|
|
22
|
+
private batchBuffer;
|
|
23
|
+
private batchCounter;
|
|
24
|
+
private currentBatchId;
|
|
25
|
+
constructor(grid: Grid, eventService: EventService);
|
|
26
|
+
isEnabled(): boolean;
|
|
27
|
+
/** record a committed edit */
|
|
28
|
+
pushAction(action: UndoRedoAction): void;
|
|
29
|
+
canUndo(): boolean;
|
|
30
|
+
canRedo(): boolean;
|
|
31
|
+
getUndoStackSize(): number;
|
|
32
|
+
getRedoStackSize(): number;
|
|
33
|
+
undo(): number;
|
|
34
|
+
redo(): number;
|
|
35
|
+
private applyValue;
|
|
36
|
+
startBatchEdit(): void;
|
|
37
|
+
endBatchEdit(cancel?: boolean): void;
|
|
38
|
+
isBatchEditing(): boolean;
|
|
39
|
+
clear(): void;
|
|
40
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** XLSX reader — ZIP central directory + DOMParser (deflate via DecompressionStream). */
|
|
2
|
+
export interface XlsxSheet {
|
|
3
|
+
name: string;
|
|
4
|
+
rows: string[][];
|
|
5
|
+
}
|
|
6
|
+
/** read every sheet of an xlsx file as string rows */
|
|
7
|
+
export declare function readXlsx(buffer: ArrayBuffer): Promise<XlsxSheet[]>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Minimal XLSX writer: ZIP (store, no compression) + SpreadsheetML. No dependencies. */
|
|
2
|
+
export interface XlsxCell {
|
|
3
|
+
value: string | number | boolean | null | undefined;
|
|
4
|
+
bold?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface XlsxSheet {
|
|
7
|
+
name: string;
|
|
8
|
+
rows: XlsxCell[][];
|
|
9
|
+
}
|
|
10
|
+
export declare function createXlsx(sheets: XlsxSheet[]): Blob;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { GridApi } from '../types';
|
|
2
|
+
import { GanttChart } from './ganttChart';
|
|
3
|
+
import type { GanttUnit } from './ganttChart';
|
|
4
|
+
import type { GanttTask, TeamMember } from './data';
|
|
5
|
+
export interface GanttOptions {
|
|
6
|
+
tasks: GanttTask[];
|
|
7
|
+
members?: TeamMember[];
|
|
8
|
+
title?: string;
|
|
9
|
+
unit?: GanttUnit;
|
|
10
|
+
tableWidth?: number;
|
|
11
|
+
onTaskChange?: (task: GanttTask) => void;
|
|
12
|
+
/** Overrides the built-in text detail dialog when provided. */
|
|
13
|
+
onTaskOpen?: (task: GanttTask) => void;
|
|
14
|
+
}
|
|
15
|
+
export interface GanttApi {
|
|
16
|
+
grid: GridApi;
|
|
17
|
+
chart: GanttChart;
|
|
18
|
+
setTasks(tasks: GanttTask[]): void;
|
|
19
|
+
expandAll(): void;
|
|
20
|
+
collapseAll(): void;
|
|
21
|
+
scrollToTask(id: string): void;
|
|
22
|
+
destroy(): void;
|
|
23
|
+
}
|
|
24
|
+
/** Mount an isolated tree grid and timeline. The caller owns persistence. */
|
|
25
|
+
export declare function createGantt(container: HTMLElement, options: GanttOptions): GanttApi;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface TeamMember {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
}
|
|
5
|
+
export type TaskKind = 'phase' | 'feature' | 'task';
|
|
6
|
+
export type TaskStatus = 'not-started' | 'in-progress' | 'done' | 'delayed';
|
|
7
|
+
export interface GanttTask {
|
|
8
|
+
id: string;
|
|
9
|
+
path: string[];
|
|
10
|
+
name: string;
|
|
11
|
+
kind: TaskKind;
|
|
12
|
+
/** member id; null means nobody assigned yet (one-click fill in the gantt) */
|
|
13
|
+
owner: string | null;
|
|
14
|
+
status: TaskStatus;
|
|
15
|
+
/** YYYY-MM-DD; group rows carry the rolled-up span of their children */
|
|
16
|
+
start: string | null;
|
|
17
|
+
end: string | null;
|
|
18
|
+
/** 0-100 for leaf tasks */
|
|
19
|
+
progress: number;
|
|
20
|
+
hours: number;
|
|
21
|
+
milestone: boolean;
|
|
22
|
+
dependsOn: string[];
|
|
23
|
+
}
|
|
24
|
+
export declare function toDateKey(date: Date): string;
|
|
25
|
+
export declare function parseDateKey(key: string): Date;
|
|
26
|
+
export declare function addDays(date: Date, days: number): Date;
|
|
27
|
+
export declare function dayDiff(from: Date | string, to: Date | string): number;
|
|
28
|
+
export declare function todayKey(): string;
|
|
29
|
+
/** 已延期 is derived: unfinished work whose end date has passed */
|
|
30
|
+
export declare function effectiveTaskStatus(task: GanttTask): TaskStatus;
|
|
31
|
+
export declare function formatCnDate(key: string): string;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { GridApi } from '../types';
|
|
2
|
+
/** 表格外的筛选 / 排序面板(工具栏按钮 + 浮层)。 */
|
|
3
|
+
type FieldKind = 'text' | 'number' | 'date';
|
|
4
|
+
interface FilterFieldDef {
|
|
5
|
+
colId: string;
|
|
6
|
+
label: string;
|
|
7
|
+
kind: FieldKind;
|
|
8
|
+
/** 值域已知的字段用下拉选择,值用原始数据(筛选按字段原值匹配) */
|
|
9
|
+
options?: Array<{
|
|
10
|
+
value: string;
|
|
11
|
+
label: string;
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
14
|
+
interface SortFieldDef {
|
|
15
|
+
colId: string;
|
|
16
|
+
label: string;
|
|
17
|
+
}
|
|
18
|
+
/** 两个浮层共用的容器管理:打开一个会关掉另一个 */
|
|
19
|
+
export declare class FilterSortPanels {
|
|
20
|
+
private api;
|
|
21
|
+
private host;
|
|
22
|
+
private hooks;
|
|
23
|
+
private filterFields;
|
|
24
|
+
private sortFields;
|
|
25
|
+
private filterRows;
|
|
26
|
+
private sorts;
|
|
27
|
+
private filterPanel;
|
|
28
|
+
private sortPanel;
|
|
29
|
+
private filterAnchor;
|
|
30
|
+
private sortAnchor;
|
|
31
|
+
constructor(api: GridApi, host: HTMLElement, fields: {
|
|
32
|
+
filter: FilterFieldDef[];
|
|
33
|
+
sort: SortFieldDef[];
|
|
34
|
+
}, hooks: {
|
|
35
|
+
onFilterButton: (active: boolean, count: number) => void;
|
|
36
|
+
onSortButton: (active: boolean, count: number) => void;
|
|
37
|
+
});
|
|
38
|
+
private onDocumentMouseDown;
|
|
39
|
+
openFilterPanel(anchor: HTMLElement): void;
|
|
40
|
+
private renderFilterRow;
|
|
41
|
+
private applyFilter;
|
|
42
|
+
private closeFilterPanel;
|
|
43
|
+
openSortPanel(anchor: HTMLElement): void;
|
|
44
|
+
private applySort;
|
|
45
|
+
private closeSortPanel;
|
|
46
|
+
private mount;
|
|
47
|
+
destroy(): void;
|
|
48
|
+
closeAll(): void;
|
|
49
|
+
}
|
|
50
|
+
export {};
|