@gridsheet/preact-core 3.0.0-rc.7 → 3.0.0-rc.8
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/hooks-hS8l-fYa.mjs +1440 -0
- package/dist/hooks-hS8l-fYa.mjs.map +1 -0
- package/dist/index.d.ts +3 -34
- package/dist/index.js +358 -9246
- package/dist/index.js.map +1 -1
- package/dist/{components → react-core/src/components}/FunctionGuide.d.ts +2 -2
- package/dist/{components → react-core/src/components}/useAutocomplete.d.ts +3 -3
- package/dist/react-core/src/index.d.ts +17 -0
- package/dist/{lib → react-core/src/lib}/clipboard.d.ts +1 -1
- package/dist/{components → react-core/src/lib}/hooks.d.ts +2 -0
- package/dist/{lib → react-core/src/lib}/menu.d.ts +1 -1
- package/dist/react-core/src/lib/style.d.ts +12 -0
- package/dist/react-core/src/policy/checkbox.d.ts +3 -0
- package/dist/react-core/src/spellbook.d.ts +6 -0
- package/dist/{store → react-core/src/store}/actions.d.ts +1 -1
- package/dist/{store/dispatchers.d.ts → react-core/src/store/applyers.d.ts} +1 -1
- package/dist/{store → react-core/src/store}/helpers.d.ts +1 -2
- package/dist/react-core/src/types.d.ts +104 -0
- package/dist/spellbook.d.ts +2 -0
- package/dist/spellbook.js +10 -0
- package/dist/spellbook.js.map +1 -0
- package/package.json +18 -2
- package/dist/constants.d.ts +0 -21
- package/dist/formula/evaluator.d.ts +0 -134
- package/dist/formula/formula-error.d.ts +0 -10
- package/dist/formula/functions/__async.d.ts +0 -67
- package/dist/formula/functions/__base.d.ts +0 -112
- package/dist/formula/functions/__utils.d.ts +0 -23
- package/dist/formula/functions/abs.d.ts +0 -9
- package/dist/formula/functions/add.d.ts +0 -10
- package/dist/formula/functions/and.d.ts +0 -9
- package/dist/formula/functions/arrayformula.d.ts +0 -12
- package/dist/formula/functions/average.d.ts +0 -9
- package/dist/formula/functions/concat.d.ts +0 -9
- package/dist/formula/functions/count.d.ts +0 -9
- package/dist/formula/functions/counta.d.ts +0 -9
- package/dist/formula/functions/divide.d.ts +0 -10
- package/dist/formula/functions/eq.d.ts +0 -9
- package/dist/formula/functions/gt.d.ts +0 -9
- package/dist/formula/functions/gte.d.ts +0 -9
- package/dist/formula/functions/if.d.ts +0 -9
- package/dist/formula/functions/iferror.d.ts +0 -10
- package/dist/formula/functions/len.d.ts +0 -9
- package/dist/formula/functions/lt.d.ts +0 -9
- package/dist/formula/functions/lte.d.ts +0 -9
- package/dist/formula/functions/max.d.ts +0 -9
- package/dist/formula/functions/min.d.ts +0 -9
- package/dist/formula/functions/minus.d.ts +0 -10
- package/dist/formula/functions/multiply.d.ts +0 -9
- package/dist/formula/functions/ne.d.ts +0 -9
- package/dist/formula/functions/not.d.ts +0 -9
- package/dist/formula/functions/now.d.ts +0 -9
- package/dist/formula/functions/or.d.ts +0 -9
- package/dist/formula/functions/power.d.ts +0 -9
- package/dist/formula/functions/sum.d.ts +0 -9
- package/dist/formula/functions/uminus.d.ts +0 -9
- package/dist/formula/mapping.d.ts +0 -11
- package/dist/formula/solver.d.ts +0 -39
- package/dist/lib/autofill.d.ts +0 -17
- package/dist/lib/book.d.ts +0 -127
- package/dist/lib/cell.d.ts +0 -17
- package/dist/lib/coords.d.ts +0 -22
- package/dist/lib/date.d.ts +0 -2
- package/dist/lib/dom.d.ts +0 -7
- package/dist/lib/filter.d.ts +0 -7
- package/dist/lib/input.d.ts +0 -24
- package/dist/lib/label.d.ts +0 -4
- package/dist/lib/operation.d.ts +0 -31
- package/dist/lib/palette.d.ts +0 -2
- package/dist/lib/popup.d.ts +0 -24
- package/dist/lib/reference.d.ts +0 -19
- package/dist/lib/sheet.d.ts +0 -508
- package/dist/lib/sheet_utils.d.ts +0 -55
- package/dist/lib/spatial.d.ts +0 -79
- package/dist/lib/time.d.ts +0 -29
- package/dist/lib/virtualization.d.ts +0 -22
- package/dist/policy/checkbox.d.ts +0 -3
- package/dist/policy/core.d.ts +0 -164
- package/dist/policy/thousand_separator.d.ts +0 -4
- package/dist/sentinels.d.ts +0 -40
- package/dist/styles/embedder.d.ts +0 -2
- package/dist/styles/minified.d.ts +0 -3
- package/dist/styles/utils.d.ts +0 -52
- package/dist/types.d.ts +0 -369
- package/dist/utils.d.ts +0 -2
- /package/dist/{components → react-core/src/components}/Cell.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/CellStateOverlay.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/ColumnMenu.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/ColumnMenuFilterSection.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/ColumnMenuLabelSection.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/ColumnMenuSortSection.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/ContextMenu.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/Editor.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/EditorOptions.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/Emitter.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/Fixed.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/FormulaBar.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/GridSheet.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/HeaderCellLeft.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/HeaderCellTop.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/MenuItem.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/PluginBase.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/Resizer.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/RowMenu.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/ScrollHandle.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/SearchBar.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/StoreObserver.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/Tabular.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/svg/AddIcon.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/svg/Base.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/svg/CloseIcon.d.ts +0 -0
- /package/dist/{components → react-core/src/components}/svg/SearchIcon.d.ts +0 -0
- /package/dist/{lib → react-core/src/lib}/events.d.ts +0 -0
- /package/dist/{lib → react-core/src/lib}/paste.d.ts +0 -0
- /package/dist/{store → react-core/src/store}/index.d.ts +0 -0
package/dist/lib/operation.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { OperationType as operations } from '../types';
|
|
2
|
-
export declare const RemoveRows: operations;
|
|
3
|
-
export declare const RemoveCols: operations;
|
|
4
|
-
export declare const InsertRowsAbove: operations;
|
|
5
|
-
export declare const InsertRowsBelow: operations;
|
|
6
|
-
export declare const InsertColsLeft: operations;
|
|
7
|
-
export declare const InsertColsRight: operations;
|
|
8
|
-
export declare const MoveFrom: operations;
|
|
9
|
-
export declare const MoveTo: operations;
|
|
10
|
-
export declare const Write: operations;
|
|
11
|
-
export declare const Style: operations;
|
|
12
|
-
export declare const Copy: operations;
|
|
13
|
-
export declare const Resize: operations;
|
|
14
|
-
export declare const SetPolicy: operations;
|
|
15
|
-
export declare const Sort: operations;
|
|
16
|
-
export declare const Filter: operations;
|
|
17
|
-
export declare const SetLabel: operations;
|
|
18
|
-
export declare const NoOperation: operations;
|
|
19
|
-
export declare const Move: operations;
|
|
20
|
-
export declare const Update: operations;
|
|
21
|
-
export declare const InsertRows: operations;
|
|
22
|
-
export declare const InsertCols: operations;
|
|
23
|
-
export declare const Add: operations;
|
|
24
|
-
export declare const Delete: operations;
|
|
25
|
-
export declare const ReadOnly: operations;
|
|
26
|
-
export declare const ColumnMenu: operations;
|
|
27
|
-
export declare const RowMenu: operations;
|
|
28
|
-
export declare const ViewOnly: operations;
|
|
29
|
-
export declare const hasOperation: (operation: operations | undefined, flag: operations) => boolean;
|
|
30
|
-
export declare const debugOperations: (prevention: operations | undefined) => string[];
|
|
31
|
-
//# sourceMappingURL=operation.d.ts.map
|
package/dist/lib/palette.d.ts
DELETED
package/dist/lib/popup.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* lib/popup.ts
|
|
3
|
-
*
|
|
4
|
-
* Utility functions for computing the position of floating UI elements
|
|
5
|
-
* (tooltips, dropdowns, autocomplete lists, function guides, etc.)
|
|
6
|
-
* so they don't overflow the viewport.
|
|
7
|
-
*/
|
|
8
|
-
export type HAlign = 'left' | 'right';
|
|
9
|
-
export type VAlign = 'top' | 'bottom';
|
|
10
|
-
export type PopupPosition = {
|
|
11
|
-
x: number;
|
|
12
|
-
y: number;
|
|
13
|
-
hAlign: HAlign;
|
|
14
|
-
};
|
|
15
|
-
export declare const calcBelowPosition: (rect: DOMRect, maxWidth?: number, margin?: number) => PopupPosition;
|
|
16
|
-
export declare const clampLeft: (left: number, width: number, margin?: number) => number;
|
|
17
|
-
export type SideStyle = {
|
|
18
|
-
left: string;
|
|
19
|
-
right: string;
|
|
20
|
-
};
|
|
21
|
-
export declare const calcSideStyle: (el: HTMLElement, gap?: number) => SideStyle;
|
|
22
|
-
export declare const clampPopup: (el: HTMLElement) => void;
|
|
23
|
-
export declare const hAlignTransform: (hAlign: HAlign) => string;
|
|
24
|
-
//# sourceMappingURL=popup.d.ts.map
|
package/dist/lib/reference.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { CellsByIdType, Id } from '../types';
|
|
2
|
-
import { Sheet } from './sheet';
|
|
3
|
-
export declare class ReferencePreserver {
|
|
4
|
-
map: {
|
|
5
|
-
[id: Id]: Id;
|
|
6
|
-
};
|
|
7
|
-
private sheet;
|
|
8
|
-
private dependentIds;
|
|
9
|
-
constructor(sheet: Sheet);
|
|
10
|
-
collectDependents(...ids: Id[]): void;
|
|
11
|
-
/**
|
|
12
|
-
* Compare two idMatrix snapshots (`before` and `after`) and populate
|
|
13
|
-
* `this.map` and collect dependents for every position where the occupying
|
|
14
|
-
* cell ID changed. Works for any rearrangement (sort, move, etc.).
|
|
15
|
-
*/
|
|
16
|
-
buildMap(before: Id[], after: Id[]): void;
|
|
17
|
-
resolveDependents(operation?: 'move' | 'removeRows' | 'removeCols'): CellsByIdType;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=reference.d.ts.map
|
package/dist/lib/sheet.d.ts
DELETED
|
@@ -1,508 +0,0 @@
|
|
|
1
|
-
import { Id, AreaType, CellsByAddressType, PointType, Address, CellFilter, MatrixType, CellType, FilterConfig, HistoryType, StorePatchType, ShapeType, RectType, OperatorType, OperationType, RawCellType, StoreType, Resolution, System } from '../types';
|
|
2
|
-
import { FunctionMapping } from '../formula/functions/__base';
|
|
3
|
-
import { ProcessFormulaProps } from '../formula/evaluator';
|
|
4
|
-
import { SolveOptions } from '../formula/solver';
|
|
5
|
-
import { Registry } from './book';
|
|
6
|
-
import { PolicyType, RenderProps } from '../policy/core';
|
|
7
|
-
type CellField = keyof CellType;
|
|
8
|
-
export type SheetLimits = {
|
|
9
|
-
minRows?: number;
|
|
10
|
-
maxRows?: number;
|
|
11
|
-
minCols?: number;
|
|
12
|
-
maxCols?: number;
|
|
13
|
-
};
|
|
14
|
-
type Props = {
|
|
15
|
-
limits?: SheetLimits;
|
|
16
|
-
functions?: FunctionMapping;
|
|
17
|
-
name?: string;
|
|
18
|
-
registry?: Registry;
|
|
19
|
-
};
|
|
20
|
-
type MoveProps = {
|
|
21
|
-
srcSheet?: UserSheet;
|
|
22
|
-
src: AreaType;
|
|
23
|
-
dst: AreaType;
|
|
24
|
-
operator?: OperatorType;
|
|
25
|
-
undoReflection?: StorePatchType;
|
|
26
|
-
redoReflection?: StorePatchType;
|
|
27
|
-
historicize?: boolean;
|
|
28
|
-
};
|
|
29
|
-
export interface UserSheet {
|
|
30
|
-
changedTime: number;
|
|
31
|
-
lastChangedTime?: number;
|
|
32
|
-
area: AreaType;
|
|
33
|
-
top: number;
|
|
34
|
-
left: number;
|
|
35
|
-
bottom: number;
|
|
36
|
-
right: number;
|
|
37
|
-
minNumRows: number;
|
|
38
|
-
maxNumRows: number;
|
|
39
|
-
minNumCols: number;
|
|
40
|
-
maxNumCols: number;
|
|
41
|
-
headerWidth: number;
|
|
42
|
-
headerHeight: number;
|
|
43
|
-
name: string;
|
|
44
|
-
/**
|
|
45
|
-
* Returns the raw sheet object, which is used for internal operations.
|
|
46
|
-
* This is not intended for public use and may change in future versions.
|
|
47
|
-
*/
|
|
48
|
-
__raw__: Sheet;
|
|
49
|
-
getRectSize(area: AreaType): RectType;
|
|
50
|
-
getCell(point: PointType, options?: {
|
|
51
|
-
resolution?: Resolution;
|
|
52
|
-
raise?: boolean;
|
|
53
|
-
}): CellType | undefined;
|
|
54
|
-
getPolicy(point: PointType): PolicyType;
|
|
55
|
-
get numRows(): number;
|
|
56
|
-
get numCols(): number;
|
|
57
|
-
get shape(): ShapeType;
|
|
58
|
-
move(args: MoveProps): UserSheet;
|
|
59
|
-
copy(args: MoveProps & {
|
|
60
|
-
onlyValue?: boolean;
|
|
61
|
-
}): UserSheet;
|
|
62
|
-
update(args: {
|
|
63
|
-
diff: CellsByAddressType;
|
|
64
|
-
historicize?: boolean;
|
|
65
|
-
partial?: boolean;
|
|
66
|
-
updateChangedTime?: boolean;
|
|
67
|
-
reflection?: StorePatchType;
|
|
68
|
-
}): UserSheet;
|
|
69
|
-
writeMatrix(args: {
|
|
70
|
-
point: PointType;
|
|
71
|
-
matrix: MatrixType<string>;
|
|
72
|
-
updateChangedTime?: boolean;
|
|
73
|
-
reflection?: StorePatchType;
|
|
74
|
-
}): UserSheet;
|
|
75
|
-
write(args: {
|
|
76
|
-
point: PointType;
|
|
77
|
-
value: string;
|
|
78
|
-
updateChangedTime?: boolean;
|
|
79
|
-
reflection?: StorePatchType;
|
|
80
|
-
}): UserSheet;
|
|
81
|
-
insertRows(args: {
|
|
82
|
-
y: number;
|
|
83
|
-
numRows: number;
|
|
84
|
-
baseY: number;
|
|
85
|
-
diff?: CellsByAddressType;
|
|
86
|
-
partial?: boolean;
|
|
87
|
-
updateChangedTime?: boolean;
|
|
88
|
-
reflection?: StorePatchType;
|
|
89
|
-
}): UserSheet;
|
|
90
|
-
removeRows(args: {
|
|
91
|
-
y: number;
|
|
92
|
-
numRows: number;
|
|
93
|
-
reflection?: StorePatchType;
|
|
94
|
-
}): UserSheet;
|
|
95
|
-
insertCols(args: {
|
|
96
|
-
x: number;
|
|
97
|
-
numCols: number;
|
|
98
|
-
baseX: number;
|
|
99
|
-
diff?: CellsByAddressType;
|
|
100
|
-
partial?: boolean;
|
|
101
|
-
updateChangedTime?: boolean;
|
|
102
|
-
reflection?: StorePatchType;
|
|
103
|
-
}): UserSheet;
|
|
104
|
-
removeCols(args: {
|
|
105
|
-
x: number;
|
|
106
|
-
numCols: number;
|
|
107
|
-
reflection?: StorePatchType;
|
|
108
|
-
}): UserSheet;
|
|
109
|
-
undo(): {
|
|
110
|
-
history: HistoryType | null;
|
|
111
|
-
};
|
|
112
|
-
redo(): {
|
|
113
|
-
history: HistoryType | null;
|
|
114
|
-
};
|
|
115
|
-
histories(): HistoryType[];
|
|
116
|
-
historyIndex(): number;
|
|
117
|
-
historySize(): number;
|
|
118
|
-
setHeaderHeight(height: number, historicize?: boolean): UserSheet;
|
|
119
|
-
setHeaderWidth(width: number, historicize?: boolean): UserSheet;
|
|
120
|
-
sortRows(args: {
|
|
121
|
-
x: number;
|
|
122
|
-
direction: 'asc' | 'desc';
|
|
123
|
-
}): UserSheet;
|
|
124
|
-
filterRows(args?: {
|
|
125
|
-
x?: number;
|
|
126
|
-
filter?: FilterConfig;
|
|
127
|
-
}): UserSheet;
|
|
128
|
-
isRowFiltered(y: number): boolean;
|
|
129
|
-
hasActiveFilters(): boolean;
|
|
130
|
-
hasPendingCells(): boolean;
|
|
131
|
-
waitForPending(): Promise<void>;
|
|
132
|
-
getLastChangedAddresses(): Address[];
|
|
133
|
-
getSerializedValue(props: {
|
|
134
|
-
point: PointType;
|
|
135
|
-
cell?: CellType;
|
|
136
|
-
resolution?: Resolution;
|
|
137
|
-
}): string;
|
|
138
|
-
}
|
|
139
|
-
type InternalToValueMatrixProps = {
|
|
140
|
-
area?: AreaType;
|
|
141
|
-
resolution?: Resolution;
|
|
142
|
-
raise?: boolean;
|
|
143
|
-
filter?: CellFilter;
|
|
144
|
-
asScalar?: boolean;
|
|
145
|
-
at?: Id;
|
|
146
|
-
};
|
|
147
|
-
export declare class Sheet implements UserSheet {
|
|
148
|
-
/** @internal */
|
|
149
|
-
__gsType: string;
|
|
150
|
-
changedTime: number;
|
|
151
|
-
lastChangedTime?: number;
|
|
152
|
-
area: AreaType;
|
|
153
|
-
/** @internal */
|
|
154
|
-
private _limits;
|
|
155
|
-
get minNumRows(): number;
|
|
156
|
-
get maxNumRows(): number;
|
|
157
|
-
get minNumCols(): number;
|
|
158
|
-
get maxNumCols(): number;
|
|
159
|
-
/** @internal */
|
|
160
|
-
id: number;
|
|
161
|
-
name: string;
|
|
162
|
-
/** @internal */
|
|
163
|
-
prevName: string;
|
|
164
|
-
/** @internal */
|
|
165
|
-
status: 0 | 1 | 2;
|
|
166
|
-
/** @internal */
|
|
167
|
-
registry: Registry;
|
|
168
|
-
/** @internal */
|
|
169
|
-
idsToBeIdentified: Id[];
|
|
170
|
-
/** @internal */
|
|
171
|
-
totalWidth: number;
|
|
172
|
-
/** @internal */
|
|
173
|
-
totalHeight: number;
|
|
174
|
-
/** @internal */
|
|
175
|
-
fullHeight: number;
|
|
176
|
-
/** @internal */
|
|
177
|
-
defaultColWidth: number;
|
|
178
|
-
/** @internal */
|
|
179
|
-
defaultRowHeight: number;
|
|
180
|
-
/** @internal */
|
|
181
|
-
private version;
|
|
182
|
-
/** @internal */
|
|
183
|
-
private idMatrix;
|
|
184
|
-
/** @internal */
|
|
185
|
-
private addressCaches;
|
|
186
|
-
/** @internal */
|
|
187
|
-
private lastChangedAddresses;
|
|
188
|
-
constructor({ limits, name, registry }: Props);
|
|
189
|
-
static is(obj: any): obj is Sheet;
|
|
190
|
-
toString(): string;
|
|
191
|
-
get headerHeight(): number;
|
|
192
|
-
setHeaderHeight(height: number, historicize?: boolean): Sheet;
|
|
193
|
-
get headerWidth(): number;
|
|
194
|
-
setHeaderWidth(width: number, historicize?: boolean): Sheet;
|
|
195
|
-
/**
|
|
196
|
-
* Get the raw (mutable) cell data for a point. Unlike getCell, this returns the actual registry.data reference.
|
|
197
|
-
* @internal
|
|
198
|
-
*/
|
|
199
|
-
private _pointToRawCell;
|
|
200
|
-
isRowFiltered(y: number): boolean;
|
|
201
|
-
hasActiveFilters(): boolean;
|
|
202
|
-
/**
|
|
203
|
-
* Returns true if any data cell in this sheet currently holds a Pending value
|
|
204
|
-
* (i.e. an async formula that hasn't resolved yet).
|
|
205
|
-
*/
|
|
206
|
-
hasPendingCells(): boolean;
|
|
207
|
-
/**
|
|
208
|
-
* Returns a Promise that resolves when all in-flight async formula computations
|
|
209
|
-
* have completed and no data cells hold Pending values.
|
|
210
|
-
* If nothing is pending, resolves immediately.
|
|
211
|
-
* Useful for waiting before sort/filter so that cell values are fully resolved.
|
|
212
|
-
*/
|
|
213
|
-
waitForPending(): Promise<void>;
|
|
214
|
-
/**
|
|
215
|
-
* Returns the addresses that were changed in the most recent `_update()` call.
|
|
216
|
-
* Useful inside `onChange` to know which cells were modified.
|
|
217
|
-
*/
|
|
218
|
-
getLastChangedAddresses(): Address[];
|
|
219
|
-
/**
|
|
220
|
-
* Capture the full cell state of all filter-related header cells as a CellsByIdType snapshot.
|
|
221
|
-
* @internal
|
|
222
|
-
*/
|
|
223
|
-
private _captureFilterCellStates;
|
|
224
|
-
filterRows({ x, filter, }?: {
|
|
225
|
-
x?: number;
|
|
226
|
-
filter?: FilterConfig;
|
|
227
|
-
}): Sheet;
|
|
228
|
-
/** @internal */
|
|
229
|
-
private _reapplyFilters;
|
|
230
|
-
sortRows({ x, direction }: {
|
|
231
|
-
x: number;
|
|
232
|
-
direction: 'asc' | 'desc';
|
|
233
|
-
}): Sheet;
|
|
234
|
-
/** @internal */
|
|
235
|
-
private _sortRowMapping;
|
|
236
|
-
get isInitialized(): boolean;
|
|
237
|
-
get policies(): {
|
|
238
|
-
[policyName: string]: import('../policy/core').Policy | null;
|
|
239
|
-
};
|
|
240
|
-
/** @internal */
|
|
241
|
-
getSystem(point: PointType): System | undefined;
|
|
242
|
-
/** @internal */
|
|
243
|
-
processFormula(value: any, { idMap, ...props }: ProcessFormulaProps): any;
|
|
244
|
-
/** @internal */
|
|
245
|
-
resolveFormulas(): void;
|
|
246
|
-
/** @internal */
|
|
247
|
-
getSheetBySheetName(sheetName: string): Sheet | null;
|
|
248
|
-
/** @internal */
|
|
249
|
-
getSheetBySheetId(sheetId: number): Sheet | null;
|
|
250
|
-
/** @internal */
|
|
251
|
-
private static _stack;
|
|
252
|
-
/** @internal */
|
|
253
|
-
initialize(cells: CellsByAddressType): void;
|
|
254
|
-
/** @internal */
|
|
255
|
-
private _incrementVersion;
|
|
256
|
-
/** @internal */
|
|
257
|
-
private _xsheetDispatch;
|
|
258
|
-
/** @internal */
|
|
259
|
-
private _generateId;
|
|
260
|
-
getRectSize({ top, left, bottom, right }: AreaType): RectType;
|
|
261
|
-
/** @internal */
|
|
262
|
-
setTotalSize(): void;
|
|
263
|
-
/** @internal */
|
|
264
|
-
refresh(relocate?: boolean, resize?: boolean): Sheet;
|
|
265
|
-
/** @internal */
|
|
266
|
-
clone(relocate?: boolean): Sheet;
|
|
267
|
-
/** @internal */
|
|
268
|
-
getPointById(id: Id, slideY?: number, slideX?: number): PointType & {
|
|
269
|
-
absCol: boolean;
|
|
270
|
-
absRow: boolean;
|
|
271
|
-
};
|
|
272
|
-
/** @internal */
|
|
273
|
-
getAddressById(id: Id, slideY?: number, slideX?: number): string | undefined;
|
|
274
|
-
/** @internal */
|
|
275
|
-
clearAddressCaches(): void;
|
|
276
|
-
/** @internal */
|
|
277
|
-
private _warmAddressCaches;
|
|
278
|
-
/** @internal */
|
|
279
|
-
getId(point: PointType): string;
|
|
280
|
-
/** @internal */
|
|
281
|
-
getCell(point: PointType, { resolution, raise }?: SolveOptions): CellType | undefined;
|
|
282
|
-
/** @internal */
|
|
283
|
-
get numRows(): number;
|
|
284
|
-
get numCols(): number;
|
|
285
|
-
get top(): number;
|
|
286
|
-
get left(): number;
|
|
287
|
-
get bottom(): number;
|
|
288
|
-
get right(): number;
|
|
289
|
-
/** @internal */
|
|
290
|
-
_toValueMatrix({ area, at, resolution, raise, filter, asScalar, }?: InternalToValueMatrixProps): any[][];
|
|
291
|
-
/** @internal */
|
|
292
|
-
private _pushHistory;
|
|
293
|
-
/** @internal */
|
|
294
|
-
private _cleanObsolete;
|
|
295
|
-
/** @internal */
|
|
296
|
-
private _cleanStrayed;
|
|
297
|
-
/**
|
|
298
|
-
* Remove an id from registry.data and registry.dependents entirely.
|
|
299
|
-
* @internal
|
|
300
|
-
*/
|
|
301
|
-
private _deleteOrphanedId;
|
|
302
|
-
/** @internal */
|
|
303
|
-
private _copyCellLayout;
|
|
304
|
-
move({ srcSheet, src, dst, historicize, operator, undoReflection, redoReflection, }: MoveProps): Sheet;
|
|
305
|
-
/**
|
|
306
|
-
* Build MoveRelations from src area to dst area, skipping filtered rows.
|
|
307
|
-
*
|
|
308
|
-
* Layout of the returned array (processed in this order by _moveCells):
|
|
309
|
-
* 1. Entries where [0] is a newly-generated ID — these fill the vacated src cells (processed last in forward order)
|
|
310
|
-
* 2. Entries where [0] is a src address and [1] is a dst address — the actual moves (processed first in forward order, descending)
|
|
311
|
-
* Entries whose [1] is an existing ID mean the destination cell is displaced/overflowed and
|
|
312
|
-
* is no longer addressable; on forward pass they are skipped; on reverse pass the ID is written back.
|
|
313
|
-
*/
|
|
314
|
-
/** @internal */
|
|
315
|
-
private _createMoveRelations;
|
|
316
|
-
get defaultPolicy(): PolicyType;
|
|
317
|
-
/**
|
|
318
|
-
* Apply (or reverse) a MoveRelations list.
|
|
319
|
-
*
|
|
320
|
-
* Forward (reverse=false): process descending — actual ID moves happen bottom-up so
|
|
321
|
-
* earlier entries don't clobber later ones; vacate entries (at front of array) are
|
|
322
|
-
* applied last.
|
|
323
|
-
* Reverse (reverse=true): process ascending — restores IDs in the natural order.
|
|
324
|
-
*
|
|
325
|
-
* On forward pass: applies policy, collects diffBefore, runs ReferencePreserver.
|
|
326
|
-
* On reverse pass: only moves IDs (caller is responsible for applyDiff(diffBefore)).
|
|
327
|
-
*/
|
|
328
|
-
/** @internal */
|
|
329
|
-
private _moveCells;
|
|
330
|
-
copy({ srcSheet, src, dst, onlyValue, operator, undoReflection, redoReflection, }: MoveProps & {
|
|
331
|
-
onlyValue?: boolean;
|
|
332
|
-
}): Sheet;
|
|
333
|
-
getPolicy(point: PointType): PolicyType;
|
|
334
|
-
/** @internal */
|
|
335
|
-
private _update;
|
|
336
|
-
update({ diff, partial, updateChangedTime, historicize, operator, operation: op, ignoreFields, undoReflection, redoReflection, }: {
|
|
337
|
-
diff: CellsByAddressType;
|
|
338
|
-
partial?: boolean;
|
|
339
|
-
updateChangedTime?: boolean;
|
|
340
|
-
historicize?: boolean;
|
|
341
|
-
operator?: OperatorType;
|
|
342
|
-
operation?: OperationType;
|
|
343
|
-
ignoreFields?: CellField[];
|
|
344
|
-
undoReflection?: StorePatchType;
|
|
345
|
-
redoReflection?: StorePatchType;
|
|
346
|
-
}): Sheet;
|
|
347
|
-
/** @internal */
|
|
348
|
-
writeRawCellMatrix({ point, matrix, updateChangedTime, historicize, onlyValue, operator, undoReflection, redoReflection, }: {
|
|
349
|
-
point: PointType;
|
|
350
|
-
matrix: MatrixType<RawCellType>;
|
|
351
|
-
updateChangedTime?: boolean;
|
|
352
|
-
historicize?: boolean;
|
|
353
|
-
onlyValue?: boolean;
|
|
354
|
-
operator?: OperatorType;
|
|
355
|
-
undoReflection?: StorePatchType;
|
|
356
|
-
redoReflection?: StorePatchType;
|
|
357
|
-
}): Sheet;
|
|
358
|
-
writeMatrix(props: {
|
|
359
|
-
point: PointType;
|
|
360
|
-
matrix: MatrixType<string>;
|
|
361
|
-
updateChangedTime?: boolean;
|
|
362
|
-
historicize?: boolean;
|
|
363
|
-
operator?: OperatorType;
|
|
364
|
-
undoReflection?: StorePatchType;
|
|
365
|
-
redoReflection?: StorePatchType;
|
|
366
|
-
}): Sheet;
|
|
367
|
-
write(props: {
|
|
368
|
-
point: PointType;
|
|
369
|
-
value: string;
|
|
370
|
-
updateChangedTime?: boolean;
|
|
371
|
-
historicize?: boolean;
|
|
372
|
-
operator?: OperatorType;
|
|
373
|
-
undoReflection?: StorePatchType;
|
|
374
|
-
redoReflection?: StorePatchType;
|
|
375
|
-
}): Sheet;
|
|
376
|
-
insertRows({ y, numRows, baseY, diff, partial, updateChangedTime, operator, undoReflection, redoReflection, }: {
|
|
377
|
-
y: number;
|
|
378
|
-
numRows: number;
|
|
379
|
-
baseY: number;
|
|
380
|
-
diff?: CellsByAddressType;
|
|
381
|
-
partial?: boolean;
|
|
382
|
-
updateChangedTime?: boolean;
|
|
383
|
-
operator?: OperatorType;
|
|
384
|
-
undoReflection?: StorePatchType;
|
|
385
|
-
redoReflection?: StorePatchType;
|
|
386
|
-
}): Sheet;
|
|
387
|
-
removeRows({ y, numRows, operator, undoReflection, redoReflection, }: {
|
|
388
|
-
y: number;
|
|
389
|
-
numRows: number;
|
|
390
|
-
operator?: OperatorType;
|
|
391
|
-
undoReflection?: StorePatchType;
|
|
392
|
-
redoReflection?: StorePatchType;
|
|
393
|
-
}): Sheet;
|
|
394
|
-
insertCols({ x, numCols, baseX, diff, partial, updateChangedTime, operator, undoReflection, redoReflection, }: {
|
|
395
|
-
x: number;
|
|
396
|
-
numCols: number;
|
|
397
|
-
baseX: number;
|
|
398
|
-
diff?: CellsByAddressType;
|
|
399
|
-
partial?: boolean;
|
|
400
|
-
updateChangedTime?: boolean;
|
|
401
|
-
operator?: OperatorType;
|
|
402
|
-
undoReflection?: StorePatchType;
|
|
403
|
-
redoReflection?: StorePatchType;
|
|
404
|
-
}): Sheet;
|
|
405
|
-
removeCols({ x, numCols, operator, undoReflection, redoReflection, }: {
|
|
406
|
-
x: number;
|
|
407
|
-
numCols: number;
|
|
408
|
-
operator?: OperatorType;
|
|
409
|
-
undoReflection?: StorePatchType;
|
|
410
|
-
redoReflection?: StorePatchType;
|
|
411
|
-
}): Sheet;
|
|
412
|
-
/** @internal */
|
|
413
|
-
histories(): HistoryType[];
|
|
414
|
-
/** @internal */
|
|
415
|
-
historyIndex(): number;
|
|
416
|
-
/** @internal */
|
|
417
|
-
historySize(): number;
|
|
418
|
-
/** @internal */
|
|
419
|
-
getHistoryLimit(): number;
|
|
420
|
-
/** @internal */
|
|
421
|
-
parse(point: PointType, value: any): CellType;
|
|
422
|
-
/** @internal */
|
|
423
|
-
render(props: RenderProps): any;
|
|
424
|
-
getSerializedValue({ point, cell, resolution, }: {
|
|
425
|
-
point: PointType;
|
|
426
|
-
cell?: CellType;
|
|
427
|
-
resolution?: Resolution;
|
|
428
|
-
}): string;
|
|
429
|
-
/** @internal */
|
|
430
|
-
trim(area: AreaType): Sheet;
|
|
431
|
-
/**
|
|
432
|
-
* Solve all formulas in this sheet and return a 2D matrix of resolved values.
|
|
433
|
-
* @internal
|
|
434
|
-
*/
|
|
435
|
-
solve({ raise, at }: {
|
|
436
|
-
raise?: boolean;
|
|
437
|
-
at: Id;
|
|
438
|
-
}): any[][];
|
|
439
|
-
/**
|
|
440
|
-
* Collapse this sheet to a scalar (top-left cell value).
|
|
441
|
-
* @internal
|
|
442
|
-
*/
|
|
443
|
-
strip({ raise, at }: {
|
|
444
|
-
raise?: boolean;
|
|
445
|
-
at?: Id;
|
|
446
|
-
}): any;
|
|
447
|
-
/** @internal */
|
|
448
|
-
private _applyDiff;
|
|
449
|
-
undo(): {
|
|
450
|
-
history: null;
|
|
451
|
-
newSheet: Sheet;
|
|
452
|
-
callback?: undefined;
|
|
453
|
-
} | {
|
|
454
|
-
history: HistoryType;
|
|
455
|
-
callback: ({ sheetReactive: sheetRef }: StoreType) => void;
|
|
456
|
-
newSheet?: undefined;
|
|
457
|
-
};
|
|
458
|
-
redo(): {
|
|
459
|
-
history: null;
|
|
460
|
-
newSheet: Sheet;
|
|
461
|
-
callback?: undefined;
|
|
462
|
-
} | {
|
|
463
|
-
history: HistoryType;
|
|
464
|
-
callback: ({ sheetReactive: sheetRef }: StoreType) => void;
|
|
465
|
-
newSheet?: undefined;
|
|
466
|
-
};
|
|
467
|
-
/** @internal */
|
|
468
|
-
getFunctionByName(name: string): typeof import('../formula/functions/__base').BaseFunction;
|
|
469
|
-
/** @internal */
|
|
470
|
-
clearDependencies(id: Id): void;
|
|
471
|
-
/** @internal */
|
|
472
|
-
addDependency(id: Id, dependency: Id): void;
|
|
473
|
-
/** @internal */
|
|
474
|
-
getSolvedCache(point: PointType): [boolean, any];
|
|
475
|
-
/** @internal */
|
|
476
|
-
setSolvingCache(point: PointType): void;
|
|
477
|
-
/** @internal */
|
|
478
|
-
finishSolvedCache(point: PointType, value: any): void;
|
|
479
|
-
/** @internal */
|
|
480
|
-
clearSolvedCaches(): void;
|
|
481
|
-
/**
|
|
482
|
-
* Spill a 2D matrix of values starting from the origin cell.
|
|
483
|
-
* The origin cell receives matrix[0][0] and adjacent cells receive spill values in solvedCaches.
|
|
484
|
-
* For a 1×1 matrix, no spill occurs — the single value is cached directly.
|
|
485
|
-
* Throws FormulaError('#REF!') if the spill range is obstructed.
|
|
486
|
-
*
|
|
487
|
-
* @param origin The anchor cell that produced the spill.
|
|
488
|
-
* @param matrix The 2D array of resolved scalar values.
|
|
489
|
-
* @returns The top-left value (matrix[0][0]).
|
|
490
|
-
* @internal
|
|
491
|
-
*/
|
|
492
|
-
spill(origin: PointType, matrix: any[][]): any;
|
|
493
|
-
/** @internal */
|
|
494
|
-
sheetPrefix(omit?: boolean): string;
|
|
495
|
-
/** @internal */
|
|
496
|
-
rangeToArea(range: string): {
|
|
497
|
-
top: number;
|
|
498
|
-
left: number;
|
|
499
|
-
bottom: number;
|
|
500
|
-
right: number;
|
|
501
|
-
};
|
|
502
|
-
get __raw__(): Sheet;
|
|
503
|
-
get shape(): ShapeType;
|
|
504
|
-
get hasSingleCell(): boolean;
|
|
505
|
-
get currentVersion(): number;
|
|
506
|
-
}
|
|
507
|
-
export {};
|
|
508
|
-
//# sourceMappingURL=sheet.d.ts.map
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { Address, AreaType, CellsByAddressType, CellType, CellFilter, Resolution } from '../types';
|
|
2
|
-
import { UserSheet } from './sheet';
|
|
3
|
-
import { SolveOptions } from '../formula/solver';
|
|
4
|
-
type CellField = keyof CellType;
|
|
5
|
-
type ToProps = {
|
|
6
|
-
resolution?: Resolution;
|
|
7
|
-
raise?: boolean;
|
|
8
|
-
filter?: CellFilter;
|
|
9
|
-
asScalar?: boolean;
|
|
10
|
-
};
|
|
11
|
-
type ToCellProps = ToProps & {
|
|
12
|
-
ignoreFields?: CellField[];
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* @internal — used by Sheet._toValueMatrix and solver.ts; keeps resolution for internal wiring.
|
|
16
|
-
*/
|
|
17
|
-
export type ToValueMatrixProps = ToProps & {
|
|
18
|
-
area?: AreaType;
|
|
19
|
-
};
|
|
20
|
-
export type ToCellMatrixProps = ToCellProps & {
|
|
21
|
-
area?: AreaType;
|
|
22
|
-
};
|
|
23
|
-
export type ToValueObjectProps = ToProps & {
|
|
24
|
-
addresses?: Address[];
|
|
25
|
-
};
|
|
26
|
-
export type ToCellObjectProps = ToCellProps & {
|
|
27
|
-
addresses?: Address[];
|
|
28
|
-
};
|
|
29
|
-
export type ToValueRowsProps = ToProps & {
|
|
30
|
-
rows?: number[];
|
|
31
|
-
};
|
|
32
|
-
export type ToCellRowsProps = ToCellProps & {
|
|
33
|
-
rows?: number[];
|
|
34
|
-
};
|
|
35
|
-
export type ToValueColsProps = ToProps & {
|
|
36
|
-
cols?: (number | string)[];
|
|
37
|
-
};
|
|
38
|
-
export type ToCellColsProps = ToCellProps & {
|
|
39
|
-
cols?: (number | string)[];
|
|
40
|
-
};
|
|
41
|
-
export declare const getCellByAddress: (sheet: UserSheet, address: Address, options?: SolveOptions) => CellType | undefined;
|
|
42
|
-
export declare const toValueMatrix: (sheet: UserSheet, { area, resolution, raise, filter, asScalar }?: ToValueMatrixProps) => any[][];
|
|
43
|
-
export declare const toValueObject: (sheet: UserSheet, { resolution, raise, filter, addresses, asScalar }?: ToValueObjectProps) => {
|
|
44
|
-
[address: Address]: any;
|
|
45
|
-
};
|
|
46
|
-
export declare const toValueRows: (sheet: UserSheet, { resolution, raise, filter, rows, asScalar }?: ToValueRowsProps) => CellsByAddressType[];
|
|
47
|
-
export declare const toValueCols: (sheet: UserSheet, { resolution, raise, filter, cols, asScalar }?: ToValueColsProps) => CellsByAddressType[];
|
|
48
|
-
export declare const toCellMatrix: (sheet: UserSheet, { area, resolution, raise, filter, ignoreFields }?: ToCellMatrixProps) => (CellType | null)[][];
|
|
49
|
-
export declare const toCellObject: (sheet: UserSheet, { resolution, raise, filter, addresses, ignoreFields }?: ToCellObjectProps) => CellsByAddressType;
|
|
50
|
-
export declare const toCellRows: (sheet: UserSheet, { resolution, raise, filter, rows, ignoreFields }?: ToCellRowsProps) => CellsByAddressType[];
|
|
51
|
-
export declare const escapeSheetName: (name: string) => string;
|
|
52
|
-
export declare const toSheetPrefix: (name?: string) => string;
|
|
53
|
-
export declare const toCellCols: (sheet: UserSheet, { resolution, raise, filter, cols, ignoreFields }?: ToCellColsProps) => CellsByAddressType[];
|
|
54
|
-
export {};
|
|
55
|
-
//# sourceMappingURL=sheet_utils.d.ts.map
|