@gridsheet/preact-core 3.0.0-rc.1 → 3.0.0-rc.3
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/dist/components/ColumnMenuFilterSection.d.ts +5 -0
- package/dist/components/ColumnMenuLabelSection.d.ts +5 -0
- package/dist/components/ColumnMenuSortSection.d.ts +5 -0
- package/dist/components/ContextMenu.d.ts +0 -19
- package/dist/components/FunctionGuide.d.ts +3 -2
- package/dist/components/GridSheet.d.ts +6 -4
- package/dist/components/MenuItem.d.ts +18 -0
- package/dist/components/PluginBase.d.ts +2 -2
- package/dist/components/StoreObserver.d.ts +7 -4
- package/dist/constants.d.ts +4 -0
- package/dist/formula/evaluator.d.ts +36 -40
- package/dist/formula/formula-error.d.ts +10 -0
- package/dist/formula/functions/__async.d.ts +17 -12
- package/dist/formula/functions/__base.d.ts +82 -23
- package/dist/formula/functions/__utils.d.ts +4 -0
- package/dist/formula/functions/abs.d.ts +5 -5
- package/dist/formula/functions/add.d.ts +6 -6
- package/dist/formula/functions/and.d.ts +5 -5
- package/dist/formula/functions/arrayformula.d.ts +12 -0
- package/dist/formula/functions/average.d.ts +5 -5
- package/dist/formula/functions/concat.d.ts +5 -5
- package/dist/formula/functions/count.d.ts +4 -4
- package/dist/formula/functions/counta.d.ts +4 -4
- package/dist/formula/functions/divide.d.ts +5 -4
- package/dist/formula/functions/eq.d.ts +4 -4
- package/dist/formula/functions/gt.d.ts +5 -5
- package/dist/formula/functions/gte.d.ts +5 -5
- package/dist/formula/functions/if.d.ts +5 -5
- package/dist/formula/functions/iferror.d.ts +7 -9
- package/dist/formula/functions/len.d.ts +5 -5
- package/dist/formula/functions/lt.d.ts +5 -5
- package/dist/formula/functions/lte.d.ts +5 -5
- package/dist/formula/functions/max.d.ts +5 -5
- package/dist/formula/functions/min.d.ts +5 -5
- package/dist/formula/functions/minus.d.ts +6 -6
- package/dist/formula/functions/multiply.d.ts +5 -5
- package/dist/formula/functions/ne.d.ts +4 -4
- package/dist/formula/functions/not.d.ts +5 -5
- package/dist/formula/functions/now.d.ts +4 -4
- package/dist/formula/functions/or.d.ts +5 -5
- package/dist/formula/functions/power.d.ts +5 -5
- package/dist/formula/functions/sum.d.ts +5 -5
- package/dist/formula/functions/uminus.d.ts +5 -5
- package/dist/formula/mapping.d.ts +4 -3
- package/dist/formula/solver.d.ts +28 -15
- package/dist/index.d.ts +25 -23
- package/dist/index.js +7883 -7796
- package/dist/index.js.map +1 -1
- package/dist/lib/autofill.d.ts +3 -3
- package/dist/lib/{hub.d.ts → book.d.ts} +30 -45
- package/dist/lib/cell.d.ts +6 -4
- package/dist/lib/clipboard.d.ts +16 -1
- package/dist/lib/coords.d.ts +13 -1
- package/dist/lib/dom.d.ts +7 -0
- package/dist/lib/input.d.ts +11 -2
- package/dist/lib/label.d.ts +4 -0
- package/dist/lib/menu.d.ts +99 -0
- package/dist/lib/operation.d.ts +0 -3
- package/dist/lib/popup.d.ts +24 -0
- package/dist/lib/reference.d.ts +10 -4
- package/dist/lib/sheet.d.ts +507 -2
- package/dist/lib/sheet_utils.d.ts +55 -0
- package/dist/lib/spatial.d.ts +5 -20
- package/dist/lib/time.d.ts +19 -15
- package/dist/lib/virtualization.d.ts +4 -4
- package/dist/policy/checkbox.d.ts +3 -0
- package/dist/policy/core.d.ts +128 -18
- package/dist/policy/thousand_separator.d.ts +4 -0
- package/dist/sentinels.d.ts +21 -4
- package/dist/store/actions.d.ts +3 -3
- package/dist/store/dispatchers.d.ts +38 -34
- package/dist/store/helpers.d.ts +13 -4
- package/dist/styles/minified.d.ts +2 -2
- package/dist/types.d.ts +59 -55
- package/package.json +1 -1
- package/dist/formula/functions/acos.d.ts +0 -9
- package/dist/formula/functions/asin.d.ts +0 -9
- package/dist/formula/functions/atan.d.ts +0 -9
- package/dist/formula/functions/atan2.d.ts +0 -9
- package/dist/formula/functions/col.d.ts +0 -9
- package/dist/formula/functions/concatenate.d.ts +0 -9
- package/dist/formula/functions/cos.d.ts +0 -9
- package/dist/formula/functions/countif.d.ts +0 -10
- package/dist/formula/functions/exp.d.ts +0 -9
- package/dist/formula/functions/hlookup.d.ts +0 -10
- package/dist/formula/functions/index.d.ts +0 -10
- package/dist/formula/functions/lenb.d.ts +0 -9
- package/dist/formula/functions/ln.d.ts +0 -9
- package/dist/formula/functions/log.d.ts +0 -9
- package/dist/formula/functions/log10.d.ts +0 -9
- package/dist/formula/functions/match.d.ts +0 -10
- package/dist/formula/functions/match.test.d.ts +0 -2
- package/dist/formula/functions/mod.d.ts +0 -9
- package/dist/formula/functions/pi.d.ts +0 -9
- package/dist/formula/functions/product.d.ts +0 -9
- package/dist/formula/functions/radians.d.ts +0 -9
- package/dist/formula/functions/rand.d.ts +0 -9
- package/dist/formula/functions/round.d.ts +0 -9
- package/dist/formula/functions/rounddown.d.ts +0 -9
- package/dist/formula/functions/roundup.d.ts +0 -9
- package/dist/formula/functions/row.d.ts +0 -9
- package/dist/formula/functions/sin.d.ts +0 -9
- package/dist/formula/functions/sqrt.d.ts +0 -9
- package/dist/formula/functions/sumif.d.ts +0 -10
- package/dist/formula/functions/tan.d.ts +0 -9
- package/dist/formula/functions/vlookup.d.ts +0 -10
- package/dist/lib/table.d.ts +0 -463
- package/dist/parsers/core.d.ts +0 -38
- package/dist/renderers/checkbox.d.ts +0 -5
- package/dist/renderers/core.d.ts +0 -66
- package/dist/renderers/thousand_separator.d.ts +0 -3
package/dist/lib/table.d.ts
DELETED
|
@@ -1,463 +0,0 @@
|
|
|
1
|
-
import { RendererCallProps } from '../renderers/core';
|
|
2
|
-
import { Id, AreaType, CellsByIdType, CellsByAddressType, PointType, Address, CellFilter, MatrixType, CellType, FilterConfig, HistoryType, StorePatchType, ShapeType, OperatorType, OperationType, RawCellType, ExtraPointType, StoreType, RefEvaluation } from '../types';
|
|
3
|
-
import { FunctionMapping } from '../formula/functions/__base';
|
|
4
|
-
import { Wire } from './hub';
|
|
5
|
-
import { PolicyType } from '../policy/core';
|
|
6
|
-
type Props = {
|
|
7
|
-
minNumRows?: number;
|
|
8
|
-
maxNumRows?: number;
|
|
9
|
-
minNumCols?: number;
|
|
10
|
-
maxNumCols?: number;
|
|
11
|
-
functions?: FunctionMapping;
|
|
12
|
-
sheetName?: string;
|
|
13
|
-
hub?: Wire;
|
|
14
|
-
};
|
|
15
|
-
type GetProps = {
|
|
16
|
-
refEvaluation?: RefEvaluation;
|
|
17
|
-
raise?: boolean;
|
|
18
|
-
filter?: CellFilter;
|
|
19
|
-
};
|
|
20
|
-
type MoveProps = {
|
|
21
|
-
srcTable?: UserTable;
|
|
22
|
-
src: AreaType;
|
|
23
|
-
dst: AreaType;
|
|
24
|
-
operator?: OperatorType;
|
|
25
|
-
undoReflection?: StorePatchType;
|
|
26
|
-
redoReflection?: StorePatchType;
|
|
27
|
-
historicize?: boolean;
|
|
28
|
-
};
|
|
29
|
-
type CellField = keyof CellType;
|
|
30
|
-
type GetCellProps = GetProps & {
|
|
31
|
-
ignoreFields?: CellField[];
|
|
32
|
-
};
|
|
33
|
-
type GetFieldProps = GetProps & {
|
|
34
|
-
field?: keyof CellType;
|
|
35
|
-
};
|
|
36
|
-
type GetCellMatrixProps = GetCellProps & {
|
|
37
|
-
area?: AreaType;
|
|
38
|
-
};
|
|
39
|
-
type GetFieldMatrixProps = GetFieldProps & {
|
|
40
|
-
area?: AreaType;
|
|
41
|
-
};
|
|
42
|
-
type GetCellObjectProps = GetCellProps & {
|
|
43
|
-
addresses?: Address[];
|
|
44
|
-
};
|
|
45
|
-
type GetFieldObjectProps = GetFieldProps & {
|
|
46
|
-
addresses?: Address[];
|
|
47
|
-
};
|
|
48
|
-
type GetCellRowsProps = GetCellProps & {
|
|
49
|
-
rows?: number[];
|
|
50
|
-
};
|
|
51
|
-
type GetFieldRowsProps = GetFieldProps & {
|
|
52
|
-
rows?: number[];
|
|
53
|
-
};
|
|
54
|
-
type GetCellColsProps = GetCellProps & {
|
|
55
|
-
cols?: (number | string)[];
|
|
56
|
-
};
|
|
57
|
-
type GetFieldColsProps = GetFieldProps & {
|
|
58
|
-
cols?: (number | string)[];
|
|
59
|
-
};
|
|
60
|
-
export interface UserTable {
|
|
61
|
-
changedTime: number;
|
|
62
|
-
lastChangedTime?: number;
|
|
63
|
-
top: number;
|
|
64
|
-
left: number;
|
|
65
|
-
bottom: number;
|
|
66
|
-
right: number;
|
|
67
|
-
minNumRows: number;
|
|
68
|
-
maxNumRows: number;
|
|
69
|
-
minNumCols: number;
|
|
70
|
-
maxNumCols: number;
|
|
71
|
-
headerWidth: number;
|
|
72
|
-
headerHeight: number;
|
|
73
|
-
sheetName: string;
|
|
74
|
-
/**
|
|
75
|
-
* Returns the raw table object, which is used for internal operations.
|
|
76
|
-
* This is not intended for public use and may change in future versions.
|
|
77
|
-
*/
|
|
78
|
-
__raw__: Table;
|
|
79
|
-
getRectSize(area: AreaType): ShapeType;
|
|
80
|
-
getCellByPoint(point: PointType, refEvaluation?: RefEvaluation, raise?: boolean): CellType | undefined;
|
|
81
|
-
getCellByAddress(address: Address, refEvaluation?: RefEvaluation, raise?: boolean): CellType | undefined;
|
|
82
|
-
getPolicyByPoint(point: PointType): PolicyType;
|
|
83
|
-
getNumRows(base?: number): number;
|
|
84
|
-
getNumCols(base?: number): number;
|
|
85
|
-
getFieldMatrix(args?: GetFieldMatrixProps): any[][];
|
|
86
|
-
getFieldObject(args?: GetFieldObjectProps): {
|
|
87
|
-
[address: Address]: any;
|
|
88
|
-
};
|
|
89
|
-
getFieldRows(args?: GetFieldRowsProps): {
|
|
90
|
-
[address: Address]: any;
|
|
91
|
-
}[];
|
|
92
|
-
getFieldCols(args?: GetFieldColsProps): {
|
|
93
|
-
[address: Address]: any;
|
|
94
|
-
}[];
|
|
95
|
-
getCellMatrix(args?: GetCellMatrixProps): (CellType | null)[][];
|
|
96
|
-
getCellObject(args?: GetCellObjectProps): CellsByAddressType;
|
|
97
|
-
getCellRows(args?: GetCellRowsProps): CellsByAddressType[];
|
|
98
|
-
getCellCols(args?: GetCellColsProps): CellsByAddressType[];
|
|
99
|
-
getHistories(): HistoryType[];
|
|
100
|
-
move(args: MoveProps): UserTable;
|
|
101
|
-
copy(args: MoveProps & {
|
|
102
|
-
onlyValue?: boolean;
|
|
103
|
-
}): UserTable;
|
|
104
|
-
update(args: {
|
|
105
|
-
diff: CellsByAddressType;
|
|
106
|
-
historicize?: boolean;
|
|
107
|
-
partial?: boolean;
|
|
108
|
-
updateChangedTime?: boolean;
|
|
109
|
-
reflection?: StorePatchType;
|
|
110
|
-
}): UserTable;
|
|
111
|
-
writeMatrix(args: {
|
|
112
|
-
point: PointType;
|
|
113
|
-
matrix: MatrixType<string>;
|
|
114
|
-
updateChangedTime?: boolean;
|
|
115
|
-
reflection?: StorePatchType;
|
|
116
|
-
}): UserTable;
|
|
117
|
-
write(args: {
|
|
118
|
-
point: PointType;
|
|
119
|
-
value: string;
|
|
120
|
-
updateChangedTime?: boolean;
|
|
121
|
-
reflection?: StorePatchType;
|
|
122
|
-
}): UserTable;
|
|
123
|
-
insertRows(args: {
|
|
124
|
-
y: number;
|
|
125
|
-
numRows: number;
|
|
126
|
-
baseY: number;
|
|
127
|
-
diff?: CellsByAddressType;
|
|
128
|
-
partial?: boolean;
|
|
129
|
-
updateChangedTime?: boolean;
|
|
130
|
-
reflection?: StorePatchType;
|
|
131
|
-
}): UserTable;
|
|
132
|
-
removeRows(args: {
|
|
133
|
-
y: number;
|
|
134
|
-
numRows: number;
|
|
135
|
-
reflection?: StorePatchType;
|
|
136
|
-
}): UserTable;
|
|
137
|
-
insertCols(args: {
|
|
138
|
-
x: number;
|
|
139
|
-
numCols: number;
|
|
140
|
-
baseX: number;
|
|
141
|
-
diff?: CellsByAddressType;
|
|
142
|
-
partial?: boolean;
|
|
143
|
-
updateChangedTime?: boolean;
|
|
144
|
-
reflection?: StorePatchType;
|
|
145
|
-
}): UserTable;
|
|
146
|
-
removeCols(args: {
|
|
147
|
-
x: number;
|
|
148
|
-
numCols: number;
|
|
149
|
-
reflection?: StorePatchType;
|
|
150
|
-
}): UserTable;
|
|
151
|
-
undo(): {
|
|
152
|
-
history: HistoryType | null;
|
|
153
|
-
};
|
|
154
|
-
redo(): {
|
|
155
|
-
history: HistoryType | null;
|
|
156
|
-
};
|
|
157
|
-
getHistories(): HistoryType[];
|
|
158
|
-
getHistoryIndex(): number;
|
|
159
|
-
getHistorySize(): number;
|
|
160
|
-
setHeaderHeight(height: number, historicize?: boolean): UserTable;
|
|
161
|
-
setHeaderWidth(width: number, historicize?: boolean): UserTable;
|
|
162
|
-
sortRows(args: {
|
|
163
|
-
x: number;
|
|
164
|
-
direction: 'asc' | 'desc';
|
|
165
|
-
}): UserTable;
|
|
166
|
-
filterRows(args?: {
|
|
167
|
-
x?: number;
|
|
168
|
-
filter?: FilterConfig;
|
|
169
|
-
}): UserTable;
|
|
170
|
-
isRowFiltered(y: number): boolean;
|
|
171
|
-
hasActiveFilters(): boolean;
|
|
172
|
-
hasPendingCells(): boolean;
|
|
173
|
-
waitForPending(): Promise<void>;
|
|
174
|
-
getLastChangedAddresses(): Address[];
|
|
175
|
-
stringify(props: {
|
|
176
|
-
point: PointType;
|
|
177
|
-
cell?: CellType;
|
|
178
|
-
refEvaluation?: RefEvaluation;
|
|
179
|
-
}): string;
|
|
180
|
-
}
|
|
181
|
-
export declare class Table implements UserTable {
|
|
182
|
-
changedTime: number;
|
|
183
|
-
lastChangedTime?: number;
|
|
184
|
-
minNumRows: number;
|
|
185
|
-
maxNumRows: number;
|
|
186
|
-
minNumCols: number;
|
|
187
|
-
maxNumCols: number;
|
|
188
|
-
sheetId: number;
|
|
189
|
-
sheetName: string;
|
|
190
|
-
prevSheetName: string;
|
|
191
|
-
status: 0 | 1 | 2;
|
|
192
|
-
wire: Wire;
|
|
193
|
-
idsToBeIdentified: Id[];
|
|
194
|
-
totalWidth: number;
|
|
195
|
-
totalHeight: number;
|
|
196
|
-
fullHeight: number;
|
|
197
|
-
private version;
|
|
198
|
-
private idMatrix;
|
|
199
|
-
private area;
|
|
200
|
-
private addressCaches;
|
|
201
|
-
private lastChangedAddresses;
|
|
202
|
-
constructor({ minNumRows, maxNumRows, minNumCols, maxNumCols, sheetName, hub, }: Props);
|
|
203
|
-
get headerHeight(): number;
|
|
204
|
-
setHeaderHeight(height: number, historicize?: boolean): Table;
|
|
205
|
-
get headerWidth(): number;
|
|
206
|
-
setHeaderWidth(width: number, historicize?: boolean): Table;
|
|
207
|
-
/** Get the raw (mutable) cell data for a point. Unlike getCellByPoint, this returns the actual wire.data reference. */
|
|
208
|
-
private _getRawCellByPoint;
|
|
209
|
-
isRowFiltered(y: number): boolean;
|
|
210
|
-
hasActiveFilters(): boolean;
|
|
211
|
-
/**
|
|
212
|
-
* Returns true if any data cell in this sheet currently holds a Pending value
|
|
213
|
-
* (i.e. an async formula that hasn't resolved yet).
|
|
214
|
-
*/
|
|
215
|
-
hasPendingCells(): boolean;
|
|
216
|
-
/**
|
|
217
|
-
* Returns a Promise that resolves when all in-flight async formula computations
|
|
218
|
-
* have completed and no data cells hold Pending values.
|
|
219
|
-
* If nothing is pending, resolves immediately.
|
|
220
|
-
* Useful for waiting before sort/filter so that cell values are fully resolved.
|
|
221
|
-
*/
|
|
222
|
-
waitForPending(): Promise<void>;
|
|
223
|
-
/**
|
|
224
|
-
* Returns the addresses that were changed in the most recent `_update()` call.
|
|
225
|
-
* Useful inside `onChange` to know which cells were modified.
|
|
226
|
-
*/
|
|
227
|
-
getLastChangedAddresses(): Address[];
|
|
228
|
-
/** Capture the current state of all filter-related cells (column headers + row headers) as a CellsByIdType snapshot */
|
|
229
|
-
/** Capture the full cell state of all filter-related header cells as a CellsByIdType snapshot */
|
|
230
|
-
private _captureFilterCellStates;
|
|
231
|
-
filterRows({ x, filter, }?: {
|
|
232
|
-
x?: number;
|
|
233
|
-
filter?: FilterConfig;
|
|
234
|
-
}): Table;
|
|
235
|
-
private _reapplyFilters;
|
|
236
|
-
sortRows({ x, direction }: {
|
|
237
|
-
x: number;
|
|
238
|
-
direction: 'asc' | 'desc';
|
|
239
|
-
}): Table;
|
|
240
|
-
private _sortRowMapping;
|
|
241
|
-
get isInitialized(): boolean;
|
|
242
|
-
get functions(): FunctionMapping;
|
|
243
|
-
get parsers(): {
|
|
244
|
-
[parserName: string]: import('../parsers/core').Parser | null;
|
|
245
|
-
};
|
|
246
|
-
get renderers(): {
|
|
247
|
-
[rendererName: string]: import('../renderers/core').Renderer | null;
|
|
248
|
-
};
|
|
249
|
-
get labelers(): {
|
|
250
|
-
[labelerName: string]: ((n: number) => string) | null;
|
|
251
|
-
};
|
|
252
|
-
get policies(): {
|
|
253
|
-
[policyName: string]: import('../policy/core').Policy | null;
|
|
254
|
-
};
|
|
255
|
-
identifyFormula(): void;
|
|
256
|
-
getSheetId(): number;
|
|
257
|
-
getTableBySheetName(sheetName: string): Table | null;
|
|
258
|
-
getTableBySheetId(sheetId: number): Table | null;
|
|
259
|
-
private static _stack;
|
|
260
|
-
initialize(cells: CellsByAddressType): void;
|
|
261
|
-
incrementVersion(): void;
|
|
262
|
-
private generateId;
|
|
263
|
-
getRectSize({ top, left, bottom, right }: AreaType): {
|
|
264
|
-
width: number;
|
|
265
|
-
height: number;
|
|
266
|
-
};
|
|
267
|
-
setTotalSize(): void;
|
|
268
|
-
refresh(relocate?: boolean, resize?: boolean): Table;
|
|
269
|
-
clone(relocate?: boolean): Table;
|
|
270
|
-
getPointById(id: Id, slideY?: number, slideX?: number): PointType & {
|
|
271
|
-
absCol: boolean;
|
|
272
|
-
absRow: boolean;
|
|
273
|
-
};
|
|
274
|
-
getAddressById(id: Id, slideY?: number, slideX?: number): string | undefined;
|
|
275
|
-
getAddressesByIds(ids: CellsByIdType): CellsByAddressType;
|
|
276
|
-
clearAddressCaches(): void;
|
|
277
|
-
getId(point: PointType): string;
|
|
278
|
-
getIdFormula(point: ExtraPointType): {
|
|
279
|
-
id: Id | null;
|
|
280
|
-
formula: string | null;
|
|
281
|
-
};
|
|
282
|
-
getCellByPoint(point: PointType, refEvaluation?: RefEvaluation, raise?: boolean): CellType | undefined;
|
|
283
|
-
getCellByAddress(address: Address, refEvaluation?: RefEvaluation, raise?: boolean): CellType | undefined;
|
|
284
|
-
getById(id: Id): CellType<any, any> | undefined;
|
|
285
|
-
getNumRows(base?: number): number;
|
|
286
|
-
getNumCols(base?: number): number;
|
|
287
|
-
get top(): number;
|
|
288
|
-
get left(): number;
|
|
289
|
-
get bottom(): number;
|
|
290
|
-
get right(): number;
|
|
291
|
-
getFullRef(ref: Address): string;
|
|
292
|
-
getFieldMatrix({ area, field, refEvaluation, raise, filter, }?: GetFieldMatrixProps): any[][];
|
|
293
|
-
getFieldObject({ field, refEvaluation, raise, filter, addresses, }?: GetFieldObjectProps): {
|
|
294
|
-
[Address: string]: any;
|
|
295
|
-
};
|
|
296
|
-
getFieldRows({ field, refEvaluation, raise, filter, rows, }?: GetFieldRowsProps): CellsByAddressType[];
|
|
297
|
-
getFieldCols({ field, refEvaluation, raise, filter, cols, }?: GetFieldColsProps): CellsByAddressType[];
|
|
298
|
-
getCellMatrix({ area, refEvaluation, raise, filter, ignoreFields, }?: GetCellMatrixProps): (CellType | null)[][];
|
|
299
|
-
getCellObject({ refEvaluation, raise, filter, addresses, ignoreFields, }?: GetCellObjectProps): CellsByAddressType;
|
|
300
|
-
getCellRows({ refEvaluation, raise, filter, rows, ignoreFields, }?: GetCellRowsProps): CellsByAddressType[];
|
|
301
|
-
getCellCols({ refEvaluation, raise, filter, cols, ignoreFields, }?: GetCellColsProps): CellsByAddressType[];
|
|
302
|
-
private pushHistory;
|
|
303
|
-
private cleanObsolete;
|
|
304
|
-
private cleanStrayed;
|
|
305
|
-
private getNewIdMatrix;
|
|
306
|
-
private getIdMatrixFromArea;
|
|
307
|
-
private setChangedTime;
|
|
308
|
-
private copyCellLayout;
|
|
309
|
-
move({ srcTable, src, dst, historicize, operator, undoReflection, redoReflection, }: MoveProps): Table;
|
|
310
|
-
/**
|
|
311
|
-
* Build MoveRelations from src area to dst area, skipping filtered rows.
|
|
312
|
-
*
|
|
313
|
-
* Layout of the returned array (processed in this order by _moveCells):
|
|
314
|
-
* 1. Entries where [0] is a newly-generated ID — these fill the vacated src cells (processed last in forward order)
|
|
315
|
-
* 2. Entries where [0] is a src address and [1] is a dst address — the actual moves (processed first in forward order, descending)
|
|
316
|
-
* Entries whose [1] is an existing ID mean the destination cell is displaced/overflowed and
|
|
317
|
-
* is no longer addressable; on forward pass they are skipped; on reverse pass the ID is written back.
|
|
318
|
-
*/
|
|
319
|
-
private _createMoveRelations;
|
|
320
|
-
get defaultPolicy(): PolicyType;
|
|
321
|
-
/**
|
|
322
|
-
* Apply (or reverse) a MoveRelations list.
|
|
323
|
-
*
|
|
324
|
-
* Forward (reverse=false): process descending — actual ID moves happen bottom-up so
|
|
325
|
-
* earlier entries don't clobber later ones; vacate entries (at front of array) are
|
|
326
|
-
* applied last.
|
|
327
|
-
* Reverse (reverse=true): process ascending — restores IDs in the natural order.
|
|
328
|
-
*
|
|
329
|
-
* On forward pass: applies policy, collects diffBefore, runs ReferencePreserver.
|
|
330
|
-
* On reverse pass: only moves IDs (caller is responsible for applyDiff(diffBefore)).
|
|
331
|
-
*/
|
|
332
|
-
private _moveCells;
|
|
333
|
-
copy({ srcTable, src, dst, onlyValue, operator, undoReflection, redoReflection, }: MoveProps & {
|
|
334
|
-
onlyValue?: boolean;
|
|
335
|
-
}): Table;
|
|
336
|
-
getPolicyByPoint(point: PointType): PolicyType;
|
|
337
|
-
private _update;
|
|
338
|
-
update({ diff, partial, updateChangedTime, historicize, operator, operation: op, ignoreFields, undoReflection, redoReflection, }: {
|
|
339
|
-
diff: CellsByAddressType;
|
|
340
|
-
partial?: boolean;
|
|
341
|
-
updateChangedTime?: boolean;
|
|
342
|
-
historicize?: boolean;
|
|
343
|
-
operator?: OperatorType;
|
|
344
|
-
operation?: OperationType;
|
|
345
|
-
ignoreFields?: CellField[];
|
|
346
|
-
undoReflection?: StorePatchType;
|
|
347
|
-
redoReflection?: StorePatchType;
|
|
348
|
-
}): Table;
|
|
349
|
-
writeRawCellMatrix({ point, matrix, updateChangedTime, historicize, onlyValue, operator, undoReflection, redoReflection, }: {
|
|
350
|
-
point: PointType;
|
|
351
|
-
matrix: MatrixType<RawCellType>;
|
|
352
|
-
updateChangedTime?: boolean;
|
|
353
|
-
historicize?: boolean;
|
|
354
|
-
onlyValue?: boolean;
|
|
355
|
-
operator?: OperatorType;
|
|
356
|
-
undoReflection?: StorePatchType;
|
|
357
|
-
redoReflection?: StorePatchType;
|
|
358
|
-
}): Table;
|
|
359
|
-
writeMatrix(props: {
|
|
360
|
-
point: PointType;
|
|
361
|
-
matrix: MatrixType<string>;
|
|
362
|
-
updateChangedTime?: boolean;
|
|
363
|
-
historicize?: boolean;
|
|
364
|
-
operator?: OperatorType;
|
|
365
|
-
undoReflection?: StorePatchType;
|
|
366
|
-
redoReflection?: StorePatchType;
|
|
367
|
-
}): Table;
|
|
368
|
-
write(props: {
|
|
369
|
-
point: PointType;
|
|
370
|
-
value: string;
|
|
371
|
-
updateChangedTime?: boolean;
|
|
372
|
-
historicize?: boolean;
|
|
373
|
-
operator?: OperatorType;
|
|
374
|
-
undoReflection?: StorePatchType;
|
|
375
|
-
redoReflection?: StorePatchType;
|
|
376
|
-
}): Table;
|
|
377
|
-
insertRows({ y, numRows, baseY, diff, partial, updateChangedTime, operator, undoReflection, redoReflection, }: {
|
|
378
|
-
y: number;
|
|
379
|
-
numRows: number;
|
|
380
|
-
baseY: number;
|
|
381
|
-
diff?: CellsByAddressType;
|
|
382
|
-
partial?: boolean;
|
|
383
|
-
updateChangedTime?: boolean;
|
|
384
|
-
operator?: OperatorType;
|
|
385
|
-
undoReflection?: StorePatchType;
|
|
386
|
-
redoReflection?: StorePatchType;
|
|
387
|
-
}): Table;
|
|
388
|
-
removeRows({ y, numRows, operator, undoReflection, redoReflection, }: {
|
|
389
|
-
y: number;
|
|
390
|
-
numRows: number;
|
|
391
|
-
operator?: OperatorType;
|
|
392
|
-
undoReflection?: StorePatchType;
|
|
393
|
-
redoReflection?: StorePatchType;
|
|
394
|
-
}): Table;
|
|
395
|
-
insertCols({ x, numCols, baseX, diff, partial, updateChangedTime, operator, undoReflection, redoReflection, }: {
|
|
396
|
-
x: number;
|
|
397
|
-
numCols: number;
|
|
398
|
-
baseX: number;
|
|
399
|
-
diff?: CellsByAddressType;
|
|
400
|
-
partial?: boolean;
|
|
401
|
-
updateChangedTime?: boolean;
|
|
402
|
-
operator?: OperatorType;
|
|
403
|
-
undoReflection?: StorePatchType;
|
|
404
|
-
redoReflection?: StorePatchType;
|
|
405
|
-
}): Table;
|
|
406
|
-
removeCols({ x, numCols, operator, undoReflection, redoReflection, }: {
|
|
407
|
-
x: number;
|
|
408
|
-
numCols: number;
|
|
409
|
-
operator?: OperatorType;
|
|
410
|
-
undoReflection?: StorePatchType;
|
|
411
|
-
redoReflection?: StorePatchType;
|
|
412
|
-
}): Table;
|
|
413
|
-
getHistories(): HistoryType[];
|
|
414
|
-
getHistoryIndex(): number;
|
|
415
|
-
getHistorySize(): number;
|
|
416
|
-
getHistoryLimit(): number;
|
|
417
|
-
getArea(): AreaType;
|
|
418
|
-
parse(point: PointType, value: string): CellType;
|
|
419
|
-
render(props: RendererCallProps): any;
|
|
420
|
-
stringify({ point, cell, refEvaluation, }: {
|
|
421
|
-
point: PointType;
|
|
422
|
-
cell?: CellType;
|
|
423
|
-
refEvaluation?: RefEvaluation;
|
|
424
|
-
}): string;
|
|
425
|
-
trim(area: AreaType): Table;
|
|
426
|
-
private applyDiff;
|
|
427
|
-
undo(): {
|
|
428
|
-
history: null;
|
|
429
|
-
newTable: Table;
|
|
430
|
-
callback?: undefined;
|
|
431
|
-
} | {
|
|
432
|
-
history: HistoryType;
|
|
433
|
-
callback: ({ tableReactive: tableRef }: StoreType) => void;
|
|
434
|
-
newTable?: undefined;
|
|
435
|
-
};
|
|
436
|
-
redo(): {
|
|
437
|
-
history: null;
|
|
438
|
-
newTable: Table;
|
|
439
|
-
callback?: undefined;
|
|
440
|
-
} | {
|
|
441
|
-
history: HistoryType;
|
|
442
|
-
callback: ({ tableReactive: tableRef }: StoreType) => void;
|
|
443
|
-
newTable?: undefined;
|
|
444
|
-
};
|
|
445
|
-
getFunction(name: string): typeof import('../formula/functions/__base').BaseFunction;
|
|
446
|
-
getLabel(label: string | undefined, labelerKey: string | undefined, n: number): string | null;
|
|
447
|
-
getBase(): this;
|
|
448
|
-
addDependents(id: Id, dependency: string): void;
|
|
449
|
-
getSolvedCache(point: PointType): any;
|
|
450
|
-
setSolvingCache(point: PointType): void;
|
|
451
|
-
finishSolvedCache(point: PointType, value: any): void;
|
|
452
|
-
clearSolvedCaches(): void;
|
|
453
|
-
sheetPrefix(omit?: boolean): string;
|
|
454
|
-
rangeToArea(range: string): {
|
|
455
|
-
top: number;
|
|
456
|
-
left: number;
|
|
457
|
-
bottom: number;
|
|
458
|
-
right: number;
|
|
459
|
-
};
|
|
460
|
-
get __raw__(): Table;
|
|
461
|
-
}
|
|
462
|
-
export {};
|
|
463
|
-
//# sourceMappingURL=table.d.ts.map
|
package/dist/parsers/core.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { CellType } from '../types';
|
|
2
|
-
import { TimeDelta } from '../lib/time';
|
|
3
|
-
type Condition = (value: string) => boolean;
|
|
4
|
-
type Stringify = (value: string) => any;
|
|
5
|
-
type Props = {
|
|
6
|
-
condition?: Condition;
|
|
7
|
-
complement?: Stringify;
|
|
8
|
-
mixins?: ParserMixinType[];
|
|
9
|
-
};
|
|
10
|
-
export interface ParserMixinType {
|
|
11
|
-
functions?: ((value: string, cell?: CellType) => any)[];
|
|
12
|
-
callback?(parsed: any, cell?: CellType): CellType;
|
|
13
|
-
parse?(value: string, cell: CellType): any;
|
|
14
|
-
any?(value: string, cell?: CellType): string | undefined;
|
|
15
|
-
bool?(value: string, cell?: CellType): boolean | undefined;
|
|
16
|
-
number?(value: string, cell?: CellType): number | undefined;
|
|
17
|
-
timedelta?(value: string, cell?: CellType): TimeDelta | undefined;
|
|
18
|
-
date?(value: string, cell?: CellType): Date | undefined;
|
|
19
|
-
}
|
|
20
|
-
export declare class Parser implements ParserMixinType {
|
|
21
|
-
functions: ((value: string, cell?: CellType) => any)[];
|
|
22
|
-
private condition?;
|
|
23
|
-
private complement?;
|
|
24
|
-
constructor(props?: Props);
|
|
25
|
-
private applyMixins;
|
|
26
|
-
call(value: string, cell: CellType): CellType;
|
|
27
|
-
callback(parsed: any, cell?: CellType): CellType;
|
|
28
|
-
parse(value: string, cell?: CellType): any;
|
|
29
|
-
any(value: string, cell?: CellType): string | undefined;
|
|
30
|
-
bool(value: string, cell?: CellType): boolean | undefined;
|
|
31
|
-
number(value: string, cell?: CellType): number | undefined;
|
|
32
|
-
timedelta(value: string, cell?: CellType): TimeDelta | undefined;
|
|
33
|
-
date(value: string, cell?: CellType): Date | undefined;
|
|
34
|
-
}
|
|
35
|
-
export type ParserType = Parser;
|
|
36
|
-
export declare const defaultParser: Parser;
|
|
37
|
-
export {};
|
|
38
|
-
//# sourceMappingURL=core.d.ts.map
|
package/dist/renderers/core.d.ts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { CellType, PointType } from '../types';
|
|
2
|
-
import { Table, UserTable } from '../lib/table';
|
|
3
|
-
import { TimeDelta } from '../lib/time';
|
|
4
|
-
type Condition = (value: any) => boolean;
|
|
5
|
-
type Stringify = (value: any) => string;
|
|
6
|
-
export type Props = {
|
|
7
|
-
condition?: Condition;
|
|
8
|
-
complement?: Stringify;
|
|
9
|
-
mixins?: RendererMixinType[];
|
|
10
|
-
};
|
|
11
|
-
export type RendererCallProps = {
|
|
12
|
-
table: Table;
|
|
13
|
-
point: PointType;
|
|
14
|
-
sync?: (table: UserTable) => void;
|
|
15
|
-
};
|
|
16
|
-
export type RenderProps<T extends any = any> = {
|
|
17
|
-
value: T;
|
|
18
|
-
cell?: CellType<T>;
|
|
19
|
-
table: Table;
|
|
20
|
-
point: PointType;
|
|
21
|
-
sync?: (table: UserTable) => void;
|
|
22
|
-
};
|
|
23
|
-
export interface RendererMixinType {
|
|
24
|
-
datetimeFormat?: string;
|
|
25
|
-
dateFormat?: string;
|
|
26
|
-
timeDeltaFormat?: string;
|
|
27
|
-
decorate?(rendered: any, props: RenderProps): any;
|
|
28
|
-
render?(props: RenderProps): any;
|
|
29
|
-
stringify?(props: RenderProps): string;
|
|
30
|
-
string?(props: RenderProps<string>): any;
|
|
31
|
-
table?(props: RenderProps<Table>): any;
|
|
32
|
-
bool?(props: RenderProps<boolean>): any;
|
|
33
|
-
number?(props: RenderProps<number>): any;
|
|
34
|
-
date?(props: RenderProps<Date>): any;
|
|
35
|
-
timedelta?(props: RenderProps<TimeDelta>): any;
|
|
36
|
-
array?(props: RenderProps<any[]>): any;
|
|
37
|
-
object?(props: RenderProps<any>): any;
|
|
38
|
-
null?(props: RenderProps<null | undefined>): any;
|
|
39
|
-
}
|
|
40
|
-
export declare class Renderer implements RendererMixinType {
|
|
41
|
-
datetimeFormat: string;
|
|
42
|
-
dateFormat: string;
|
|
43
|
-
timeDeltaFormat: string;
|
|
44
|
-
private condition?;
|
|
45
|
-
private complement?;
|
|
46
|
-
constructor(props?: Props);
|
|
47
|
-
private applyMixins;
|
|
48
|
-
call(props: RendererCallProps): any;
|
|
49
|
-
decorate(rendered: any, props: RenderProps): any;
|
|
50
|
-
render(props: RenderProps): any;
|
|
51
|
-
pending(_props: RenderProps): any;
|
|
52
|
-
stringify({ value, cell, table, point }: RenderProps): string;
|
|
53
|
-
string({ value }: RenderProps<string>): any;
|
|
54
|
-
table(props: RenderProps<Table>): any;
|
|
55
|
-
bool({ value }: RenderProps<boolean>): any;
|
|
56
|
-
number({ value }: RenderProps<number>): any;
|
|
57
|
-
date({ value }: RenderProps<Date>): any;
|
|
58
|
-
timedelta({ value }: RenderProps<TimeDelta>): string;
|
|
59
|
-
array(props: RenderProps<any[]>): any;
|
|
60
|
-
object({ value }: RenderProps<any>): any;
|
|
61
|
-
null({}: RenderProps<null | undefined>): any;
|
|
62
|
-
}
|
|
63
|
-
export type RendererType = Renderer;
|
|
64
|
-
export declare const defaultRenderer: Renderer;
|
|
65
|
-
export {};
|
|
66
|
-
//# sourceMappingURL=core.d.ts.map
|