@pagent-libs/core 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 +32 -0
- package/dist/canvas/cell-renderer.d.ts +45 -0
- package/dist/canvas/cell-renderer.d.ts.map +1 -0
- package/dist/canvas/grid-renderer.d.ts +29 -0
- package/dist/canvas/grid-renderer.d.ts.map +1 -0
- package/dist/canvas/header-renderer.d.ts +58 -0
- package/dist/canvas/header-renderer.d.ts.map +1 -0
- package/dist/canvas/hit-testing.d.ts +81 -0
- package/dist/canvas/hit-testing.d.ts.map +1 -0
- package/dist/canvas/index.d.ts +9 -0
- package/dist/canvas/index.d.ts.map +1 -0
- package/dist/canvas/renderer.d.ts +140 -0
- package/dist/canvas/renderer.d.ts.map +1 -0
- package/dist/canvas/selection-renderer.d.ts +55 -0
- package/dist/canvas/selection-renderer.d.ts.map +1 -0
- package/dist/canvas/text-renderer.d.ts +49 -0
- package/dist/canvas/text-renderer.d.ts.map +1 -0
- package/dist/canvas/types.d.ts +200 -0
- package/dist/canvas/types.d.ts.map +1 -0
- package/dist/collaboration/firebase-provider.d.ts +13 -0
- package/dist/collaboration/firebase-provider.d.ts.map +1 -0
- package/dist/collaboration/index.d.ts +3 -0
- package/dist/collaboration/index.d.ts.map +1 -0
- package/dist/collaboration/types.d.ts +34 -0
- package/dist/collaboration/types.d.ts.map +1 -0
- package/dist/event-emitter.d.ts +13 -0
- package/dist/event-emitter.d.ts.map +1 -0
- package/dist/export/csv.d.ts +5 -0
- package/dist/export/csv.d.ts.map +1 -0
- package/dist/export/index.d.ts +2 -0
- package/dist/export/index.d.ts.map +1 -0
- package/dist/features/filter.d.ts +58 -0
- package/dist/features/filter.d.ts.map +1 -0
- package/dist/features/freeze.d.ts +86 -0
- package/dist/features/freeze.d.ts.map +1 -0
- package/dist/features/index.d.ts +4 -0
- package/dist/features/index.d.ts.map +1 -0
- package/dist/features/sort.d.ts +15 -0
- package/dist/features/sort.d.ts.map +1 -0
- package/dist/format-pool.d.ts +17 -0
- package/dist/format-pool.d.ts.map +1 -0
- package/dist/formula-graph.d.ts +12 -0
- package/dist/formula-graph.d.ts.map +1 -0
- package/dist/formula-parser/cell-reference.d.ts +7 -0
- package/dist/formula-parser/cell-reference.d.ts.map +1 -0
- package/dist/formula-parser/formula-adjust.d.ts +13 -0
- package/dist/formula-parser/formula-adjust.d.ts.map +1 -0
- package/dist/formula-parser/formula-ranges.d.ts +22 -0
- package/dist/formula-parser/formula-ranges.d.ts.map +1 -0
- package/dist/formula-parser/index.d.ts +6 -0
- package/dist/formula-parser/index.d.ts.map +1 -0
- package/dist/formula-parser/parser.d.ts +18 -0
- package/dist/formula-parser/parser.d.ts.map +1 -0
- package/dist/formula-parser/types.d.ts +33 -0
- package/dist/formula-parser/types.d.ts.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +5823 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +5885 -0
- package/dist/index.js.map +1 -0
- package/dist/sheet.d.ts +119 -0
- package/dist/sheet.d.ts.map +1 -0
- package/dist/style-pool.d.ts +17 -0
- package/dist/style-pool.d.ts.map +1 -0
- package/dist/types.d.ts +260 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/cell-key.d.ts +7 -0
- package/dist/utils/cell-key.d.ts.map +1 -0
- package/dist/utils/format-utils.d.ts +75 -0
- package/dist/utils/format-utils.d.ts.map +1 -0
- package/dist/utils/range.d.ts +13 -0
- package/dist/utils/range.d.ts.map +1 -0
- package/dist/workbook.d.ts +155 -0
- package/dist/workbook.d.ts.map +1 -0
- package/package.json +46 -0
- package/src/canvas/cell-renderer.ts +181 -0
- package/src/canvas/grid-renderer.ts +238 -0
- package/src/canvas/header-renderer.ts +402 -0
- package/src/canvas/hit-testing.ts +537 -0
- package/src/canvas/index.ts +16 -0
- package/src/canvas/renderer.ts +1056 -0
- package/src/canvas/selection-renderer.ts +604 -0
- package/src/canvas/text-renderer.ts +321 -0
- package/src/canvas/types.ts +289 -0
- package/src/collaboration/firebase-provider.ts +48 -0
- package/src/collaboration/index.ts +5 -0
- package/src/collaboration/types.ts +38 -0
- package/src/event-emitter.ts +73 -0
- package/src/export/csv.ts +101 -0
- package/src/export/index.ts +4 -0
- package/src/features/filter.ts +231 -0
- package/src/features/freeze.ts +271 -0
- package/src/features/index.ts +5 -0
- package/src/features/sort.ts +282 -0
- package/src/format-pool.ts +61 -0
- package/src/formula-graph.ts +84 -0
- package/src/formula-parser/cell-reference.ts +99 -0
- package/src/formula-parser/formula-adjust.ts +129 -0
- package/src/formula-parser/formula-ranges.ts +159 -0
- package/src/formula-parser/index.ts +8 -0
- package/src/formula-parser/parser.ts +438 -0
- package/src/formula-parser/types.ts +39 -0
- package/src/index.ts +25 -0
- package/src/sheet.ts +502 -0
- package/src/style-pool.ts +62 -0
- package/src/types.ts +291 -0
- package/src/utils/cell-key.ts +19 -0
- package/src/utils/format-utils.ts +515 -0
- package/src/utils/range.ts +53 -0
- package/src/workbook.ts +1031 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import type { Cell, CellStyle, CellFormat, Selection, ColumnFilter } from '../../src/types';
|
|
2
|
+
/**
|
|
3
|
+
* Rectangle bounds
|
|
4
|
+
*/
|
|
5
|
+
export interface Rect {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Point coordinates
|
|
13
|
+
*/
|
|
14
|
+
export interface Point {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Cell position in the grid
|
|
20
|
+
*/
|
|
21
|
+
export interface CellPosition {
|
|
22
|
+
row: number;
|
|
23
|
+
col: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Viewport state - what's currently visible
|
|
27
|
+
*/
|
|
28
|
+
export interface Viewport {
|
|
29
|
+
scrollTop: number;
|
|
30
|
+
scrollLeft: number;
|
|
31
|
+
width: number;
|
|
32
|
+
height: number;
|
|
33
|
+
startRow: number;
|
|
34
|
+
endRow: number;
|
|
35
|
+
startCol: number;
|
|
36
|
+
endCol: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Text style for rendering
|
|
40
|
+
*/
|
|
41
|
+
export interface TextStyle {
|
|
42
|
+
fontFamily: string;
|
|
43
|
+
fontSize: number;
|
|
44
|
+
fontWeight: 'normal' | 'bold';
|
|
45
|
+
fontStyle: 'normal' | 'italic';
|
|
46
|
+
color: string;
|
|
47
|
+
textAlign: 'left' | 'center' | 'right';
|
|
48
|
+
verticalAlign: 'top' | 'middle' | 'bottom';
|
|
49
|
+
textDecoration?: 'none' | 'underline' | 'line-through';
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Border style for a single edge
|
|
53
|
+
*/
|
|
54
|
+
export interface BorderStyle {
|
|
55
|
+
width: number;
|
|
56
|
+
color: string;
|
|
57
|
+
style: 'solid' | 'dashed' | 'dotted';
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Complete border configuration for a cell
|
|
61
|
+
*/
|
|
62
|
+
export interface CellBorders {
|
|
63
|
+
top?: BorderStyle;
|
|
64
|
+
right?: BorderStyle;
|
|
65
|
+
bottom?: BorderStyle;
|
|
66
|
+
left?: BorderStyle;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Header hit test result
|
|
70
|
+
*/
|
|
71
|
+
export interface HeaderHit {
|
|
72
|
+
type: 'row' | 'column';
|
|
73
|
+
index: number;
|
|
74
|
+
isResize: boolean;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Resize handle hit test result
|
|
78
|
+
*/
|
|
79
|
+
export interface ResizeHandle {
|
|
80
|
+
type: 'row' | 'column';
|
|
81
|
+
index: number;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Theme colors for the canvas
|
|
85
|
+
*/
|
|
86
|
+
export interface CanvasTheme {
|
|
87
|
+
gridLineColor: string;
|
|
88
|
+
gridLineWidth: number;
|
|
89
|
+
headerBackgroundColor: string;
|
|
90
|
+
headerTextColor: string;
|
|
91
|
+
headerBorderColor: string;
|
|
92
|
+
headerFont: string;
|
|
93
|
+
headerFontSize: number;
|
|
94
|
+
cellBackgroundColor: string;
|
|
95
|
+
cellTextColor: string;
|
|
96
|
+
cellFont: string;
|
|
97
|
+
cellFontSize: number;
|
|
98
|
+
selectionBorderColor: string;
|
|
99
|
+
selectionBorderWidth: number;
|
|
100
|
+
selectionFillColor: string;
|
|
101
|
+
activeCellBorderColor: string;
|
|
102
|
+
activeCellBorderWidth: number;
|
|
103
|
+
fillHandleColor: string;
|
|
104
|
+
fillHandleSize: number;
|
|
105
|
+
formulaReferenceColors: Array<{
|
|
106
|
+
border: string;
|
|
107
|
+
fill: string;
|
|
108
|
+
}>;
|
|
109
|
+
freezeDividerColor: string;
|
|
110
|
+
freezeDividerWidth: number;
|
|
111
|
+
freezeShadowColor: string;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Default theme
|
|
115
|
+
*/
|
|
116
|
+
export declare const DEFAULT_THEME: CanvasTheme;
|
|
117
|
+
/**
|
|
118
|
+
* Configuration for the canvas renderer
|
|
119
|
+
*/
|
|
120
|
+
export interface CanvasRendererConfig {
|
|
121
|
+
canvas: HTMLCanvasElement;
|
|
122
|
+
devicePixelRatio?: number;
|
|
123
|
+
defaultRowHeight: number;
|
|
124
|
+
defaultColWidth: number;
|
|
125
|
+
headerHeight: number;
|
|
126
|
+
headerWidth: number;
|
|
127
|
+
theme?: Partial<CanvasTheme>;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Formula range for highlighting cell references in formulas
|
|
131
|
+
*/
|
|
132
|
+
export interface FormulaRangeHighlight {
|
|
133
|
+
startRow: number;
|
|
134
|
+
startCol: number;
|
|
135
|
+
endRow: number;
|
|
136
|
+
endCol: number;
|
|
137
|
+
colorIndex: number;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* State required for rendering
|
|
141
|
+
*/
|
|
142
|
+
export interface RenderState {
|
|
143
|
+
cells: Map<string, Cell>;
|
|
144
|
+
styles: Map<string, CellStyle>;
|
|
145
|
+
formats: Map<string, CellFormat>;
|
|
146
|
+
selection: Selection | null;
|
|
147
|
+
activeCell: CellPosition | null;
|
|
148
|
+
editingCell: CellPosition | null;
|
|
149
|
+
rowHeights: Map<number, number>;
|
|
150
|
+
colWidths: Map<number, number>;
|
|
151
|
+
rowCount: number;
|
|
152
|
+
colCount: number;
|
|
153
|
+
/** Formula ranges to highlight (cell references in formulas) */
|
|
154
|
+
formulaRanges?: FormulaRangeHighlight[];
|
|
155
|
+
/** Hidden rows (Set of row indices) */
|
|
156
|
+
hiddenRows?: Set<number>;
|
|
157
|
+
/** Hidden columns (Set of column indices) */
|
|
158
|
+
hiddenCols?: Set<number>;
|
|
159
|
+
/** Number of frozen rows (rows that stay visible when scrolling vertically) */
|
|
160
|
+
frozenRows?: number;
|
|
161
|
+
/** Number of frozen columns (columns that stay visible when scrolling horizontally) */
|
|
162
|
+
frozenCols?: number;
|
|
163
|
+
/** Active filters (column -> filter) */
|
|
164
|
+
filters?: Map<number, ColumnFilter>;
|
|
165
|
+
/** Filtered rows (rows that should be visible after filtering) */
|
|
166
|
+
filteredRows?: Set<number>;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Region that needs to be redrawn
|
|
170
|
+
*/
|
|
171
|
+
export interface DirtyRegion {
|
|
172
|
+
type: 'all' | 'cells' | 'headers' | 'selection';
|
|
173
|
+
bounds?: Rect;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Cursor types for different interactions
|
|
177
|
+
*/
|
|
178
|
+
export type CursorType = 'default' | 'pointer' | 'cell' | 'col-resize' | 'row-resize' | 'crosshair' | 'grab' | 'grabbing';
|
|
179
|
+
/**
|
|
180
|
+
* Mouse event data with grid coordinates
|
|
181
|
+
*/
|
|
182
|
+
export interface CanvasMouseEvent {
|
|
183
|
+
x: number;
|
|
184
|
+
y: number;
|
|
185
|
+
cell: CellPosition | null;
|
|
186
|
+
header: HeaderHit | null;
|
|
187
|
+
resizeHandle: ResizeHandle | null;
|
|
188
|
+
isFillHandle: boolean;
|
|
189
|
+
originalEvent: MouseEvent;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Scroll event data
|
|
193
|
+
*/
|
|
194
|
+
export interface CanvasScrollEvent {
|
|
195
|
+
scrollTop: number;
|
|
196
|
+
scrollLeft: number;
|
|
197
|
+
deltaX: number;
|
|
198
|
+
deltaY: number;
|
|
199
|
+
}
|
|
200
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/canvas/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAErF;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAA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,YAAY,GACZ,WAAW,GACX,MAAM,GACN,UAAU,CAAC;AAEf;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAE/B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IAEV,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;IAE1B,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;IAEzB,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAElC,YAAY,EAAE,OAAO,CAAC;IAEtB,aAAa,EAAE,UAAU,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CollaborationProvider, Presence } from '../../src/collaboration/types';
|
|
2
|
+
export declare class FirebaseCollaborationProvider implements CollaborationProvider {
|
|
3
|
+
private db;
|
|
4
|
+
private handlers;
|
|
5
|
+
private presences;
|
|
6
|
+
constructor();
|
|
7
|
+
connect(workbookId: string): Promise<void>;
|
|
8
|
+
disconnect(): void;
|
|
9
|
+
on(event: 'change' | 'presence' | 'cursor', handler: (data: unknown) => void): () => void;
|
|
10
|
+
emit(event: 'change' | 'presence' | 'cursor', data: unknown): void;
|
|
11
|
+
getPresences(): Presence[];
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=firebase-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firebase-provider.d.ts","sourceRoot":"","sources":["../../src/collaboration/firebase-provider.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE/D,qBAAa,6BAA8B,YAAW,qBAAqB;IACzE,OAAO,CAAC,EAAE,CAAM;IAChB,OAAO,CAAC,QAAQ,CAAwD;IACxE,OAAO,CAAC,SAAS,CAAoC;;IAO/C,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKhD,UAAU,IAAI,IAAI;IAMlB,EAAE,CAAC,KAAK,EAAE,QAAQ,GAAG,UAAU,GAAG,QAAQ,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,GAAG,MAAM,IAAI;IAWzF,IAAI,CAAC,KAAK,EAAE,QAAQ,GAAG,UAAU,GAAG,QAAQ,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI;IAKlE,YAAY,IAAI,QAAQ,EAAE;CAG3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/collaboration/index.ts"],"names":[],"mappings":"AAEA,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface Presence {
|
|
2
|
+
userId: string;
|
|
3
|
+
username: string;
|
|
4
|
+
color: string;
|
|
5
|
+
selection?: {
|
|
6
|
+
row: number;
|
|
7
|
+
col: number;
|
|
8
|
+
};
|
|
9
|
+
cursor?: {
|
|
10
|
+
row: number;
|
|
11
|
+
col: number;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface CollaborationOperation {
|
|
15
|
+
type: 'cellChange' | 'selectionChange' | 'sheetChange';
|
|
16
|
+
sheetId: string;
|
|
17
|
+
row?: number;
|
|
18
|
+
col?: number;
|
|
19
|
+
value?: unknown;
|
|
20
|
+
selection?: {
|
|
21
|
+
row: number;
|
|
22
|
+
col: number;
|
|
23
|
+
};
|
|
24
|
+
timestamp: number;
|
|
25
|
+
userId: string;
|
|
26
|
+
}
|
|
27
|
+
export interface CollaborationProvider {
|
|
28
|
+
connect(workbookId: string): Promise<void>;
|
|
29
|
+
disconnect(): void;
|
|
30
|
+
on(event: 'change' | 'presence' | 'cursor', handler: (data: unknown) => void): () => void;
|
|
31
|
+
emit(event: 'change' | 'presence' | 'cursor', data: unknown): void;
|
|
32
|
+
getPresences(): Presence[];
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/collaboration/types.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE;QACV,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,MAAM,CAAC,EAAE;QACP,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,YAAY,GAAG,iBAAiB,GAAG,aAAa,CAAC;IACvD,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE;QACV,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,UAAU,IAAI,IAAI,CAAC;IACnB,EAAE,CAAC,KAAK,EAAE,QAAQ,GAAG,UAAU,GAAG,QAAQ,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IAC1F,IAAI,CAAC,KAAK,EAAE,QAAQ,GAAG,UAAU,GAAG,QAAQ,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IACnE,YAAY,IAAI,QAAQ,EAAE,CAAC;CAC5B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { EventHandler, EventType } from '../src/types';
|
|
2
|
+
export declare class EventEmitter {
|
|
3
|
+
private handlers;
|
|
4
|
+
private batchQueue;
|
|
5
|
+
private isBatching;
|
|
6
|
+
on(event: EventType, handler: EventHandler): () => void;
|
|
7
|
+
off(event: EventType, handler: EventHandler): void;
|
|
8
|
+
emit(event: EventType, payload: unknown): void;
|
|
9
|
+
private dispatch;
|
|
10
|
+
batch(operations: () => void): void;
|
|
11
|
+
clear(): void;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=event-emitter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-emitter.d.ts","sourceRoot":"","sources":["../src/event-emitter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAa,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAElE,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAgD;IAChE,OAAO,CAAC,UAAU,CAAmB;IACrC,OAAO,CAAC,UAAU,CAAS;IAE3B,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,GAAG,MAAM,IAAI;IAYvD,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,GAAG,IAAI;IAIlD,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;IAW9C,OAAO,CAAC,QAAQ;IAahB,KAAK,CAAC,UAAU,EAAE,MAAM,IAAI,GAAG,IAAI;IAkBnC,KAAK,IAAI,IAAI;CAId"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Sheet } from '../../src/types';
|
|
2
|
+
import type { WorkbookImpl } from '../../src/workbook';
|
|
3
|
+
export declare function exportToCSV(workbook: WorkbookImpl, sheetId?: string): string;
|
|
4
|
+
export declare function importFromCSV(csv: string, sheet: Sheet): void;
|
|
5
|
+
//# sourceMappingURL=csv.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"csv.d.ts","sourceRoot":"","sources":["../../src/export/csv.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,wBAAgB,WAAW,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAyC5E;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAoB7D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/export/index.ts"],"names":[],"mappings":"AAEA,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { ColumnFilter, Sheet } from '../../src/types';
|
|
2
|
+
/**
|
|
3
|
+
* Manages filtering operations for a spreadsheet sheet
|
|
4
|
+
*/
|
|
5
|
+
export declare class FilterManager {
|
|
6
|
+
/**
|
|
7
|
+
* Apply filters to get visible row indices
|
|
8
|
+
* @param sheet The sheet to filter
|
|
9
|
+
* @param filters Map of column filters
|
|
10
|
+
* @param dataRange Optional range to filter, defaults to data rows (starting from row 1, assuming row 0 is header)
|
|
11
|
+
* @returns Set of visible row indices
|
|
12
|
+
*/
|
|
13
|
+
static getFilteredRows(sheet: Sheet, filters: Map<number, ColumnFilter>, dataRange?: {
|
|
14
|
+
startRow: number;
|
|
15
|
+
endRow: number;
|
|
16
|
+
}): Set<number>;
|
|
17
|
+
/**
|
|
18
|
+
* Check if a cell value matches a filter criteria
|
|
19
|
+
* @param cellValue The cell value to check
|
|
20
|
+
* @param criteria The filter criteria
|
|
21
|
+
* @returns true if the value matches the filter
|
|
22
|
+
*/
|
|
23
|
+
private static matchesFilter;
|
|
24
|
+
/**
|
|
25
|
+
* Get unique values in a column for filter dropdowns
|
|
26
|
+
* @param sheet The sheet to analyze
|
|
27
|
+
* @param column Column index
|
|
28
|
+
* @param dataRange Optional range to analyze, defaults to data rows (starting from row 1, assuming row 0 is header)
|
|
29
|
+
* @returns Set of unique values in the column
|
|
30
|
+
*/
|
|
31
|
+
static getUniqueColumnValues(sheet: Sheet, column: number, dataRange?: {
|
|
32
|
+
startRow: number;
|
|
33
|
+
endRow: number;
|
|
34
|
+
}): Set<string | number>;
|
|
35
|
+
/**
|
|
36
|
+
* Detect the first row that contains data (skip empty rows at the top)
|
|
37
|
+
*/
|
|
38
|
+
private static detectDataStartRow;
|
|
39
|
+
/**
|
|
40
|
+
* Detect the last row that contains data (skip empty rows at the bottom)
|
|
41
|
+
*/
|
|
42
|
+
private static detectDataEndRow;
|
|
43
|
+
/**
|
|
44
|
+
* Check if a column has an active filter
|
|
45
|
+
* @param column Column index
|
|
46
|
+
* @param filters Current filters map
|
|
47
|
+
* @returns true if column has a filter
|
|
48
|
+
*/
|
|
49
|
+
static hasFilter(column: number, filters: Map<number, ColumnFilter>): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Get filter type based on column data
|
|
52
|
+
* @param sheet The sheet to analyze
|
|
53
|
+
* @param column Column index
|
|
54
|
+
* @returns 'text', 'number', or 'date' based on data analysis
|
|
55
|
+
*/
|
|
56
|
+
static detectColumnType(sheet: Sheet, column: number): 'text' | 'number' | 'date';
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=filter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../src/features/filter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAkB,KAAK,EAAE,MAAM,UAAU,CAAC;AAGpE;;GAEG;AACH,qBAAa,aAAa;IACxB;;;;;;OAMG;IACH,MAAM,CAAC,eAAe,CACpB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,EAClC,SAAS,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAC/C,GAAG,CAAC,MAAM,CAAC;IA6Cd;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;IA8D5B;;;;;;OAMG;IACH,MAAM,CAAC,qBAAqB,CAC1B,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,SAAS,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAC/C,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC;IAiBvB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAajC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAa/B;;;;;OAKG;IACH,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,OAAO;IAI7E;;;;;OAKG;IACH,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM;CAqBlF"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for freeze panes
|
|
3
|
+
*/
|
|
4
|
+
export interface FreezeConfig {
|
|
5
|
+
frozenRows: number;
|
|
6
|
+
frozenCols: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Cached dimensions for frozen areas
|
|
10
|
+
*/
|
|
11
|
+
export interface FreezeDimensions {
|
|
12
|
+
/** Total width of all frozen columns */
|
|
13
|
+
frozenWidth: number;
|
|
14
|
+
/** Total height of all frozen rows */
|
|
15
|
+
frozenHeight: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The 4 regions created by freeze panes
|
|
19
|
+
*/
|
|
20
|
+
export type FreezeRegion = 'top-left' | 'top' | 'left' | 'main';
|
|
21
|
+
/**
|
|
22
|
+
* Calculate the total dimensions of frozen areas
|
|
23
|
+
*/
|
|
24
|
+
export declare function calculateFreezeDimensions(frozenRows: number, frozenCols: number, rowHeights: Map<number, number>, colWidths: Map<number, number>, defaultRowHeight: number, defaultColWidth: number, hiddenRows?: Set<number>, hiddenCols?: Set<number>): FreezeDimensions;
|
|
25
|
+
/**
|
|
26
|
+
* Determine which freeze region a canvas point falls into
|
|
27
|
+
*
|
|
28
|
+
* @param x - Canvas x coordinate (relative to canvas origin, after headers)
|
|
29
|
+
* @param y - Canvas y coordinate (relative to canvas origin, after headers)
|
|
30
|
+
* @param frozenWidth - Total width of frozen columns
|
|
31
|
+
* @param frozenHeight - Total height of frozen rows
|
|
32
|
+
* @param headerWidth - Width of row headers
|
|
33
|
+
* @param headerHeight - Height of column headers
|
|
34
|
+
*/
|
|
35
|
+
export declare function getRegionAtPoint(x: number, y: number, frozenWidth: number, frozenHeight: number, headerWidth: number, headerHeight: number): FreezeRegion;
|
|
36
|
+
/**
|
|
37
|
+
* Get the effective scroll offset for a given region
|
|
38
|
+
*/
|
|
39
|
+
export declare function getScrollForRegion(region: FreezeRegion, scrollTop: number, scrollLeft: number): {
|
|
40
|
+
effectiveScrollTop: number;
|
|
41
|
+
effectiveScrollLeft: number;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Convert a canvas point to grid coordinates, accounting for freeze regions
|
|
45
|
+
*
|
|
46
|
+
* @param canvasX - X position on canvas (including headers)
|
|
47
|
+
* @param canvasY - Y position on canvas (including headers)
|
|
48
|
+
* @param scrollTop - Current vertical scroll position
|
|
49
|
+
* @param scrollLeft - Current horizontal scroll position
|
|
50
|
+
* @param frozenWidth - Total width of frozen columns
|
|
51
|
+
* @param frozenHeight - Total height of frozen rows
|
|
52
|
+
* @param headerWidth - Width of row headers
|
|
53
|
+
* @param headerHeight - Height of column headers
|
|
54
|
+
*/
|
|
55
|
+
export declare function canvasToGridCoordinates(canvasX: number, canvasY: number, scrollTop: number, scrollLeft: number, frozenWidth: number, frozenHeight: number, headerWidth: number, headerHeight: number): {
|
|
56
|
+
gridX: number;
|
|
57
|
+
gridY: number;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Calculate clipping rectangle for a freeze region
|
|
61
|
+
*
|
|
62
|
+
* @returns Clip rect in canvas coordinates { x, y, width, height }
|
|
63
|
+
*/
|
|
64
|
+
export declare function getClipRectForRegion(region: FreezeRegion, canvasWidth: number, canvasHeight: number, frozenWidth: number, frozenHeight: number, headerWidth: number, headerHeight: number): {
|
|
65
|
+
x: number;
|
|
66
|
+
y: number;
|
|
67
|
+
width: number;
|
|
68
|
+
height: number;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Check if a row is in the frozen area
|
|
72
|
+
*/
|
|
73
|
+
export declare function isRowFrozen(row: number, frozenRows: number): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Check if a column is in the frozen area
|
|
76
|
+
*/
|
|
77
|
+
export declare function isColFrozen(col: number, frozenCols: number): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Check if a cell is fully in the frozen area (both row and col frozen)
|
|
80
|
+
*/
|
|
81
|
+
export declare function isCellFullyFrozen(row: number, col: number, frozenRows: number, frozenCols: number): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Get the region a cell belongs to based on its row/col indices
|
|
84
|
+
*/
|
|
85
|
+
export declare function getCellRegion(row: number, col: number, frozenRows: number, frozenCols: number): FreezeRegion;
|
|
86
|
+
//# sourceMappingURL=freeze.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"freeze.d.ts","sourceRoot":"","sources":["../../src/features/freeze.ts"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ClB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,GACnB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAgClC;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,GACnB;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CA+BzD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAEpE;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAEpE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,OAAO,CAET;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,YAAY,CAad"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/features/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SortOrder, Sheet } from '../../src/types';
|
|
2
|
+
export declare class SortManager {
|
|
3
|
+
static sortRows(sheet: Sheet, sortOrder: SortOrder[], dataRange?: {
|
|
4
|
+
startRow: number;
|
|
5
|
+
endRow: number;
|
|
6
|
+
}): void;
|
|
7
|
+
private static adjustFormulaForRowSort;
|
|
8
|
+
private static parseCellReference;
|
|
9
|
+
private static reconstructCellReference;
|
|
10
|
+
private static detectDataStartRow;
|
|
11
|
+
private static detectDataEndRow;
|
|
12
|
+
static getColumnSortDirection(column: number, currentSortOrder: SortOrder[]): 'asc' | 'desc' | null;
|
|
13
|
+
static toggleColumnSort(column: number, currentSortOrder: SortOrder[], multiColumn?: boolean): SortOrder[];
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=sort.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../../src/features/sort.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAQ,KAAK,EAAE,MAAM,UAAU,CAAC;AAGvD,qBAAa,WAAW;IACtB,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,SAAS,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IA0G7G,OAAO,CAAC,MAAM,CAAC,uBAAuB;IAkEtC,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAoBjC,OAAO,CAAC,MAAM,CAAC,wBAAwB;IAwBvC,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAajC,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAa/B,MAAM,CAAC,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,SAAS,EAAE,GAAG,KAAK,GAAG,MAAM,GAAG,IAAI;IAKnG,MAAM,CAAC,gBAAgB,CACrB,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,SAAS,EAAE,EAC7B,WAAW,GAAE,OAAe,GAC3B,SAAS,EAAE;CA0Bf"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CellFormat } from '../src/types';
|
|
2
|
+
export declare class FormatPool {
|
|
3
|
+
private formats;
|
|
4
|
+
private formatToId;
|
|
5
|
+
private nextId;
|
|
6
|
+
getOrCreate(format: CellFormat): string;
|
|
7
|
+
get(formatId: string): CellFormat | undefined;
|
|
8
|
+
getFormatKey(format: CellFormat): string;
|
|
9
|
+
clear(): void;
|
|
10
|
+
size(): number;
|
|
11
|
+
getAllFormats(): Map<string, CellFormat>;
|
|
12
|
+
setFormatToId(formatToId: Map<string, string>): void;
|
|
13
|
+
setFormats(formats: Map<string, CellFormat>): void;
|
|
14
|
+
getNextId(): number;
|
|
15
|
+
setNextId(nextId: number): void;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=format-pool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-pool.d.ts","sourceRoot":"","sources":["../src/format-pool.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,qBAAa,UAAU;IACrB,OAAO,CAAC,OAAO,CAAsC;IACrD,OAAO,CAAC,UAAU,CAAkC;IACpD,OAAO,CAAC,MAAM,CAAK;IAEnB,WAAW,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM;IAavC,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAI7C,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM;IAMxC,KAAK,IAAI,IAAI;IAMb,IAAI,IAAI,MAAM;IAId,aAAa,IAAI,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC;IAIxC,aAAa,CAAC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAGpD,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,IAAI;IAIlD,SAAS,IAAI,MAAM;IAInB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;CAGhC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FormulaGraph, FormulaNode, CellValue } from '../src/types';
|
|
2
|
+
export declare class FormulaGraphImpl implements FormulaGraph {
|
|
3
|
+
nodes: Map<string, FormulaNode>;
|
|
4
|
+
addFormula(cellKey: string, formula: string, dependencies: Set<string>): void;
|
|
5
|
+
removeFormula(cellKey: string): void;
|
|
6
|
+
getDependents(cellKey: string): Set<string>;
|
|
7
|
+
getDependencies(cellKey: string): Set<string>;
|
|
8
|
+
invalidate(cellKey: string): void;
|
|
9
|
+
getDirtyCells(): Set<string>;
|
|
10
|
+
markClean(cellKey: string, value: CellValue): void;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=formula-graph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formula-graph.d.ts","sourceRoot":"","sources":["../src/formula-graph.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpE,qBAAa,gBAAiB,YAAW,YAAY;IACnD,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAa;IAE5C,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI;IAoB7E,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAepC,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;IAK3C,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;IAK7C,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAajC,aAAa,IAAI,GAAG,CAAC,MAAM,CAAC;IAU5B,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,IAAI;CAOnD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CellReference, RangeReference } from '../../src/formula-parser/types';
|
|
2
|
+
export declare function parseCellReference(ref: string): CellReference | null;
|
|
3
|
+
export declare function parseRangeReference(ref: string): RangeReference | null;
|
|
4
|
+
export declare function columnLabelToIndex(label: string): number;
|
|
5
|
+
export declare function columnIndexToLabel(index: number): string;
|
|
6
|
+
export declare function cellReferenceToKey(ref: CellReference, currentRow: number, currentCol: number): string;
|
|
7
|
+
//# sourceMappingURL=cell-reference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell-reference.d.ts","sourceRoot":"","sources":["../../src/formula-parser/cell-reference.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAI7D,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CA8BpE;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CA+BtE;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CASxD;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CASxD;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAIrG"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adjusts a formula when copying from source cell to target cell.
|
|
3
|
+
* Increments relative references (without $) and keeps absolute references (with $) unchanged.
|
|
4
|
+
*
|
|
5
|
+
* @param formula The original formula string
|
|
6
|
+
* @param sourceRow Source cell row (0-based)
|
|
7
|
+
* @param sourceCol Source cell column (0-based)
|
|
8
|
+
* @param targetRow Target cell row (0-based)
|
|
9
|
+
* @param targetCol Target cell column (0-based)
|
|
10
|
+
* @returns Adjusted formula string
|
|
11
|
+
*/
|
|
12
|
+
export declare function adjustFormula(formula: string, sourceRow: number, sourceCol: number, targetRow: number, targetCol: number): string;
|
|
13
|
+
//# sourceMappingURL=formula-adjust.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formula-adjust.d.ts","sourceRoot":"","sources":["../../src/formula-parser/formula-adjust.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,MAAM,CA0GR"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CellReference, RangeReference } from '../../src/formula-parser/types';
|
|
2
|
+
export interface FormulaRange {
|
|
3
|
+
type: 'cell' | 'range';
|
|
4
|
+
cellRef?: CellReference;
|
|
5
|
+
rangeRef?: RangeReference;
|
|
6
|
+
startRow: number;
|
|
7
|
+
startCol: number;
|
|
8
|
+
endRow: number;
|
|
9
|
+
endCol: number;
|
|
10
|
+
sheetName?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Extracts all cell references and ranges from a formula string.
|
|
14
|
+
* Returns an array of ranges, where each range represents either:
|
|
15
|
+
* - A single cell (startRow === endRow && startCol === endCol)
|
|
16
|
+
* - A range of cells (e.g., A1:A5)
|
|
17
|
+
*
|
|
18
|
+
* @param formula The formula string (e.g., "=SUM(A1:A5)+B2")
|
|
19
|
+
* @returns Array of FormulaRange objects
|
|
20
|
+
*/
|
|
21
|
+
export declare function extractFormulaRanges(formula: string): FormulaRange[];
|
|
22
|
+
//# sourceMappingURL=formula-ranges.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formula-ranges.d.ts","sourceRoot":"","sources":["../../src/formula-parser/formula-ranges.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE7D,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,EAAE,CAoIpE"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from '../../src/formula-parser/types';
|
|
2
|
+
export * from '../../src/formula-parser/parser';
|
|
3
|
+
export * from '../../src/formula-parser/cell-reference';
|
|
4
|
+
export * from '../../src/formula-parser/formula-adjust';
|
|
5
|
+
export * from '../../src/formula-parser/formula-ranges';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/formula-parser/index.ts"],"names":[],"mappings":"AAEA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ParsedFormulaNode, ParseResult, EvaluationContext } from '../../src/formula-parser/types';
|
|
2
|
+
export declare class FormulaParser {
|
|
3
|
+
private functions;
|
|
4
|
+
constructor();
|
|
5
|
+
private registerBuiltInFunctions;
|
|
6
|
+
parse(formula: string, currentRow?: number, currentCol?: number): ParseResult;
|
|
7
|
+
private parseExpression;
|
|
8
|
+
/**
|
|
9
|
+
* Find the operator with lowest precedence (to parse correctly)
|
|
10
|
+
* Returns the rightmost operator of lowest precedence to handle left-associativity
|
|
11
|
+
*/
|
|
12
|
+
private findLowestPrecedenceOperator;
|
|
13
|
+
private parseArguments;
|
|
14
|
+
evaluate(ast: ParsedFormulaNode, ctx: EvaluationContext, currentRow?: number, currentCol?: number): unknown;
|
|
15
|
+
private evaluateNode;
|
|
16
|
+
private flattenArgs;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/formula-parser/parser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,iBAAiB,EAAkB,MAAM,SAAS,CAAC;AAGjG,qBAAa,aAAa;IACxB,OAAO,CAAC,SAAS,CAAgF;;IAMjG,OAAO,CAAC,wBAAwB;IA+ChC,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,GAAE,MAAU,EAAE,UAAU,GAAE,MAAU,GAAG,WAAW;IAsBnF,OAAO,CAAC,eAAe;IAyIvB;;;OAGG;IACH,OAAO,CAAC,4BAA4B;IA+EpC,OAAO,CAAC,cAAc;IAgCtB,QAAQ,CAAC,GAAG,EAAE,iBAAiB,EAAE,GAAG,EAAE,iBAAiB,EAAE,UAAU,GAAE,MAAU,EAAE,UAAU,GAAE,MAAU,GAAG,OAAO;IAIjH,OAAO,CAAC,YAAY;IAwFpB,OAAO,CAAC,WAAW;CAWpB"}
|