@fileverse-dev/fortune-core 1.0.2-mod-11 → 1.0.2-mod-12
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/api/sheet.d.ts +2 -2
- package/dist/context.d.ts +1 -0
- package/dist/index.esm.js +781 -332
- package/dist/index.js +782 -330
- package/dist/locale/en.d.ts +29 -0
- package/dist/locale/es.d.ts +29 -0
- package/dist/locale/hi.d.ts +29 -0
- package/dist/locale/index.d.ts +29 -0
- package/dist/locale/zh.d.ts +29 -0
- package/dist/locale/zh_tw.d.ts +29 -0
- package/dist/modules/cell.d.ts +2 -2
- package/dist/modules/formula.d.ts +8 -3
- package/dist/modules/formulaHelper.d.ts +5 -0
- package/dist/modules/validation.d.ts +1 -1
- package/dist/types.d.ts +33 -0
- package/package.json +2 -2
package/dist/locale/en.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ declare const _default: {
|
|
|
21
21
|
moreFormats: string;
|
|
22
22
|
"border-all": string;
|
|
23
23
|
"merge-all": string;
|
|
24
|
+
format: string;
|
|
24
25
|
font: string;
|
|
25
26
|
"font-size": string;
|
|
26
27
|
bold: string;
|
|
@@ -151,12 +152,40 @@ declare const _default: {
|
|
|
151
152
|
tipRowHeightLimit: string;
|
|
152
153
|
tipColumnWidthLimit: string;
|
|
153
154
|
pageInfoFull: string;
|
|
155
|
+
sheetIsFocused: string;
|
|
156
|
+
sheetNotFocused: string;
|
|
157
|
+
sheetSrIntro: string;
|
|
158
|
+
currentCellInput: string;
|
|
159
|
+
newSheet: string;
|
|
160
|
+
sheetOptions: string;
|
|
161
|
+
Dropdown: string;
|
|
162
|
+
zoomIn: string;
|
|
163
|
+
zoomOut: string;
|
|
164
|
+
toggleSheetFocusShortcut: string;
|
|
165
|
+
selectRangeShortcut: string;
|
|
166
|
+
autoFillDownShortcut: string;
|
|
167
|
+
autoFillRightShortcut: string;
|
|
168
|
+
boldTextShortcut: string;
|
|
169
|
+
copyShortcut: string;
|
|
170
|
+
pasteShortcut: string;
|
|
171
|
+
undoShortcut: string;
|
|
172
|
+
redoShortcut: string;
|
|
173
|
+
deleteCellContentShortcut: string;
|
|
174
|
+
confirmCellEditShortcut: string;
|
|
175
|
+
moveRightShortcut: string;
|
|
176
|
+
moveLeftShortcut: string;
|
|
177
|
+
shortcuts: string;
|
|
154
178
|
};
|
|
155
179
|
currencyDetail: {
|
|
156
180
|
name: string;
|
|
157
181
|
pos: string;
|
|
158
182
|
value: string;
|
|
159
183
|
}[];
|
|
184
|
+
numberFmtList: {
|
|
185
|
+
name: string;
|
|
186
|
+
pos: string;
|
|
187
|
+
value: string;
|
|
188
|
+
}[];
|
|
160
189
|
defaultFmt: (currency: string) => ({
|
|
161
190
|
text: string;
|
|
162
191
|
value: string;
|
package/dist/locale/es.d.ts
CHANGED
|
@@ -59,6 +59,7 @@ declare const _default: {
|
|
|
59
59
|
numberDecrease: string;
|
|
60
60
|
numberIncrease: string;
|
|
61
61
|
moreFormats: string;
|
|
62
|
+
format: string;
|
|
62
63
|
font: string;
|
|
63
64
|
"font-size": string;
|
|
64
65
|
bold: string;
|
|
@@ -177,6 +178,29 @@ declare const _default: {
|
|
|
177
178
|
tipRowHeightLimit: string;
|
|
178
179
|
tipColumnWidthLimit: string;
|
|
179
180
|
pageInfoFull: string;
|
|
181
|
+
sheetIsFocused: string;
|
|
182
|
+
sheetNotFocused: string;
|
|
183
|
+
sheetSrIntro: string;
|
|
184
|
+
currentCellInput: string;
|
|
185
|
+
newSheet: string;
|
|
186
|
+
sheetOptions: string;
|
|
187
|
+
Dropdown: string;
|
|
188
|
+
zoomIn: string;
|
|
189
|
+
zoomOut: string;
|
|
190
|
+
toggleSheetFocusShortcut: string;
|
|
191
|
+
selectRangeShortcut: string;
|
|
192
|
+
autoFillDownShortcut: string;
|
|
193
|
+
autoFillRightShortcut: string;
|
|
194
|
+
boldTextShortcut: string;
|
|
195
|
+
copyShortcut: string;
|
|
196
|
+
pasteShortcut: string;
|
|
197
|
+
undoShortcut: string;
|
|
198
|
+
redoShortcut: string;
|
|
199
|
+
deleteCellContentShortcut: string;
|
|
200
|
+
confirmCellEditShortcut: string;
|
|
201
|
+
moveRightShortcut: string;
|
|
202
|
+
moveLeftShortcut: string;
|
|
203
|
+
shortcuts: string;
|
|
180
204
|
};
|
|
181
205
|
currencyDetail: {
|
|
182
206
|
RMB: string;
|
|
@@ -337,6 +361,11 @@ declare const _default: {
|
|
|
337
361
|
ChileanPeso: string;
|
|
338
362
|
CFAFrancBEAC: string;
|
|
339
363
|
};
|
|
364
|
+
numberFmtList: {
|
|
365
|
+
name: string;
|
|
366
|
+
pos: string;
|
|
367
|
+
value: string;
|
|
368
|
+
}[];
|
|
340
369
|
defaultFmt: (currency: string) => {
|
|
341
370
|
text: string;
|
|
342
371
|
value: string;
|
package/dist/locale/hi.d.ts
CHANGED
|
@@ -61,6 +61,7 @@ declare const _default: {
|
|
|
61
61
|
"number-decrease": string;
|
|
62
62
|
"number-increase": string;
|
|
63
63
|
moreFormats: string;
|
|
64
|
+
format: string;
|
|
64
65
|
"border-all": string;
|
|
65
66
|
"merge-all": string;
|
|
66
67
|
font: string;
|
|
@@ -193,12 +194,40 @@ declare const _default: {
|
|
|
193
194
|
tipRowHeightLimit: string;
|
|
194
195
|
tipColumnWidthLimit: string;
|
|
195
196
|
pageInfoFull: string;
|
|
197
|
+
sheetIsFocused: string;
|
|
198
|
+
sheetNotFocused: string;
|
|
199
|
+
sheetSrIntro: string;
|
|
200
|
+
currentCellInput: string;
|
|
201
|
+
newSheet: string;
|
|
202
|
+
sheetOptions: string;
|
|
203
|
+
Dropdown: string;
|
|
204
|
+
zoomIn: string;
|
|
205
|
+
zoomOut: string;
|
|
206
|
+
toggleSheetFocusShortcut: string;
|
|
207
|
+
selectRangeShortcut: string;
|
|
208
|
+
autoFillDownShortcut: string;
|
|
209
|
+
autoFillRightShortcut: string;
|
|
210
|
+
boldTextShortcut: string;
|
|
211
|
+
copyShortcut: string;
|
|
212
|
+
pasteShortcut: string;
|
|
213
|
+
undoShortcut: string;
|
|
214
|
+
redoShortcut: string;
|
|
215
|
+
deleteCellContentShortcut: string;
|
|
216
|
+
confirmCellEditShortcut: string;
|
|
217
|
+
moveRightShortcut: string;
|
|
218
|
+
moveLeftShortcut: string;
|
|
219
|
+
shortcuts: string;
|
|
196
220
|
};
|
|
197
221
|
currencyDetail: {
|
|
198
222
|
name: string;
|
|
199
223
|
pos: string;
|
|
200
224
|
value: string;
|
|
201
225
|
}[];
|
|
226
|
+
numberFmtList: {
|
|
227
|
+
name: string;
|
|
228
|
+
pos: string;
|
|
229
|
+
value: string;
|
|
230
|
+
}[];
|
|
202
231
|
defaultFmt: (currency: string) => ({
|
|
203
232
|
text: string;
|
|
204
233
|
value: string;
|
package/dist/locale/index.d.ts
CHANGED
|
@@ -63,6 +63,7 @@ declare function locale(ctx: Context): {
|
|
|
63
63
|
moreFormats: string;
|
|
64
64
|
"border-all": string;
|
|
65
65
|
"merge-all": string;
|
|
66
|
+
format: string;
|
|
66
67
|
font: string;
|
|
67
68
|
"font-size": string;
|
|
68
69
|
bold: string;
|
|
@@ -193,12 +194,40 @@ declare function locale(ctx: Context): {
|
|
|
193
194
|
tipRowHeightLimit: string;
|
|
194
195
|
tipColumnWidthLimit: string;
|
|
195
196
|
pageInfoFull: string;
|
|
197
|
+
sheetIsFocused: string;
|
|
198
|
+
sheetNotFocused: string;
|
|
199
|
+
sheetSrIntro: string;
|
|
200
|
+
currentCellInput: string;
|
|
201
|
+
newSheet: string;
|
|
202
|
+
sheetOptions: string;
|
|
203
|
+
Dropdown: string;
|
|
204
|
+
zoomIn: string;
|
|
205
|
+
zoomOut: string;
|
|
206
|
+
toggleSheetFocusShortcut: string;
|
|
207
|
+
selectRangeShortcut: string;
|
|
208
|
+
autoFillDownShortcut: string;
|
|
209
|
+
autoFillRightShortcut: string;
|
|
210
|
+
boldTextShortcut: string;
|
|
211
|
+
copyShortcut: string;
|
|
212
|
+
pasteShortcut: string;
|
|
213
|
+
undoShortcut: string;
|
|
214
|
+
redoShortcut: string;
|
|
215
|
+
deleteCellContentShortcut: string;
|
|
216
|
+
confirmCellEditShortcut: string;
|
|
217
|
+
moveRightShortcut: string;
|
|
218
|
+
moveLeftShortcut: string;
|
|
219
|
+
shortcuts: string;
|
|
196
220
|
};
|
|
197
221
|
currencyDetail: {
|
|
198
222
|
name: string;
|
|
199
223
|
pos: string;
|
|
200
224
|
value: string;
|
|
201
225
|
}[];
|
|
226
|
+
numberFmtList: {
|
|
227
|
+
name: string;
|
|
228
|
+
pos: string;
|
|
229
|
+
value: string;
|
|
230
|
+
}[];
|
|
202
231
|
defaultFmt: (currency: string) => ({
|
|
203
232
|
text: string;
|
|
204
233
|
value: string;
|
package/dist/locale/zh.d.ts
CHANGED
|
@@ -62,6 +62,7 @@ declare const _default: {
|
|
|
62
62
|
moreFormats: string;
|
|
63
63
|
"border-all": string;
|
|
64
64
|
"merge-all": string;
|
|
65
|
+
format: string;
|
|
65
66
|
font: string;
|
|
66
67
|
"font-size": string;
|
|
67
68
|
bold: string;
|
|
@@ -192,12 +193,40 @@ declare const _default: {
|
|
|
192
193
|
tipRowHeightLimit: string;
|
|
193
194
|
tipColumnWidthLimit: string;
|
|
194
195
|
pageInfoFull: string;
|
|
196
|
+
sheetIsFocused: string;
|
|
197
|
+
sheetNotFocused: string;
|
|
198
|
+
sheetSrIntro: string;
|
|
199
|
+
currentCellInput: string;
|
|
200
|
+
newSheet: string;
|
|
201
|
+
sheetOptions: string;
|
|
202
|
+
Dropdown: string;
|
|
203
|
+
zoomIn: string;
|
|
204
|
+
zoomOut: string;
|
|
205
|
+
toggleSheetFocusShortcut: string;
|
|
206
|
+
selectRangeShortcut: string;
|
|
207
|
+
autoFillDownShortcut: string;
|
|
208
|
+
autoFillRightShortcut: string;
|
|
209
|
+
boldTextShortcut: string;
|
|
210
|
+
copyShortcut: string;
|
|
211
|
+
pasteShortcut: string;
|
|
212
|
+
undoShortcut: string;
|
|
213
|
+
redoShortcut: string;
|
|
214
|
+
deleteCellContentShortcut: string;
|
|
215
|
+
confirmCellEditShortcut: string;
|
|
216
|
+
moveRightShortcut: string;
|
|
217
|
+
moveLeftShortcut: string;
|
|
218
|
+
shortcuts: string;
|
|
195
219
|
};
|
|
196
220
|
currencyDetail: {
|
|
197
221
|
name: string;
|
|
198
222
|
pos: string;
|
|
199
223
|
value: string;
|
|
200
224
|
}[];
|
|
225
|
+
numberFmtList: {
|
|
226
|
+
name: string;
|
|
227
|
+
pos: string;
|
|
228
|
+
value: string;
|
|
229
|
+
}[];
|
|
201
230
|
defaultFmt: (currency: string) => ({
|
|
202
231
|
text: string;
|
|
203
232
|
value: string;
|
package/dist/locale/zh_tw.d.ts
CHANGED
|
@@ -73,6 +73,7 @@ declare const _default: {
|
|
|
73
73
|
numberDecrease: string;
|
|
74
74
|
numberIncrease: string;
|
|
75
75
|
moreFormats: string;
|
|
76
|
+
format: string;
|
|
76
77
|
font: string;
|
|
77
78
|
"font-size": string;
|
|
78
79
|
bold: string;
|
|
@@ -192,6 +193,29 @@ declare const _default: {
|
|
|
192
193
|
tipRowHeightLimit: string;
|
|
193
194
|
tipColumnWidthLimit: string;
|
|
194
195
|
pageInfoFull: string;
|
|
196
|
+
sheetIsFocused: string;
|
|
197
|
+
sheetNotFocused: string;
|
|
198
|
+
sheetSrIntro: string;
|
|
199
|
+
currentCellInput: string;
|
|
200
|
+
newSheet: string;
|
|
201
|
+
sheetOptions: string;
|
|
202
|
+
Dropdown: string;
|
|
203
|
+
zoomIn: string;
|
|
204
|
+
zoomOut: string;
|
|
205
|
+
toggleSheetFocusShortcut: string;
|
|
206
|
+
selectRangeShortcut: string;
|
|
207
|
+
autoFillDownShortcut: string;
|
|
208
|
+
autoFillRightShortcut: string;
|
|
209
|
+
boldTextShortcut: string;
|
|
210
|
+
copyShortcut: string;
|
|
211
|
+
pasteShortcut: string;
|
|
212
|
+
undoShortcut: string;
|
|
213
|
+
redoShortcut: string;
|
|
214
|
+
deleteCellContentShortcut: string;
|
|
215
|
+
confirmCellEditShortcut: string;
|
|
216
|
+
moveRightShortcut: string;
|
|
217
|
+
moveLeftShortcut: string;
|
|
218
|
+
shortcuts: string;
|
|
195
219
|
};
|
|
196
220
|
currencyDetail: {
|
|
197
221
|
RMB: string;
|
|
@@ -352,6 +376,11 @@ declare const _default: {
|
|
|
352
376
|
ChileanPeso: string;
|
|
353
377
|
CFAFrancBEAC: string;
|
|
354
378
|
};
|
|
379
|
+
numberFmtList: {
|
|
380
|
+
name: string;
|
|
381
|
+
pos: string;
|
|
382
|
+
value: string;
|
|
383
|
+
}[];
|
|
355
384
|
defaultFmt: (currency: string) => {
|
|
356
385
|
text: string;
|
|
357
386
|
value: string;
|
package/dist/modules/cell.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Context } from "../context";
|
|
2
|
-
import { Cell, CellMatrix, Range, Selection, SingleRange } from "../types";
|
|
2
|
+
import { Cell, CellMatrix, FormulaDependency, Range, Selection, SingleRange } from "../types";
|
|
3
3
|
export declare function normalizedCellAttr(cell: Cell, attr: keyof Cell, defaultFontSize?: number): any;
|
|
4
4
|
export declare function normalizedAttr(data: CellMatrix, r: number, c: number, attr: keyof Cell): any;
|
|
5
5
|
export declare function getCellValue(r: number, c: number, data: CellMatrix, attr?: keyof Cell): any;
|
|
@@ -21,7 +21,7 @@ export declare function getFlattenedRange(ctx: Context, range?: Range): {
|
|
|
21
21
|
c: number;
|
|
22
22
|
}[];
|
|
23
23
|
export declare function getRangetxt(ctx: Context, sheetId: string, range: SingleRange, currentId?: string): string;
|
|
24
|
-
export declare function getRangeByTxt(ctx: Context, txt: string):
|
|
24
|
+
export declare function getRangeByTxt(ctx: Context, txt: string): (FormulaDependency | null)[];
|
|
25
25
|
export declare function isAllSelectedCellsInStatus(ctx: Context, attr: keyof Cell, status: any): boolean;
|
|
26
26
|
export declare function getFontStyleByCell(cell: Cell | null | undefined, checksAF?: any[], checksCF?: any, isCheck?: boolean): any;
|
|
27
27
|
export declare function getStyleByCell(ctx: Context, d: CellMatrix, r: number, c: number): any;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { Cell, Rect, Selection } from "../types";
|
|
1
|
+
import type { Cell, CellMatrix, FormulaDependency, FormulaCell, FormulaCellInfoMap, History, Rect, Selection } from "../types";
|
|
2
2
|
import { Context } from "../context";
|
|
3
|
+
export declare function isFormula(value: any): boolean;
|
|
3
4
|
export declare class FormulaCache {
|
|
4
5
|
parser: any;
|
|
5
6
|
func_selectedrange?: Selection;
|
|
@@ -24,16 +25,20 @@ export declare class FormulaCache {
|
|
|
24
25
|
functionlistMap: any;
|
|
25
26
|
execFunctionExist?: any[];
|
|
26
27
|
execFunctionGlobalData: any;
|
|
28
|
+
formulaCellInfoMap: FormulaCellInfoMap | null;
|
|
27
29
|
constructor();
|
|
28
30
|
tryGetCellAsNumber(cell: Cell): string | number | boolean | undefined;
|
|
31
|
+
updateFormulaCache(ctx: Context, history: History, type: "undo" | "redo", data?: CellMatrix): void;
|
|
29
32
|
}
|
|
30
33
|
export declare function iscelldata(txt: string): boolean;
|
|
31
|
-
export declare function getcellrange(ctx: Context, txt: string, formulaId?: string):
|
|
32
|
-
export declare function
|
|
34
|
+
export declare function getcellrange(ctx: Context, txt: string, formulaId?: string, data?: CellMatrix): FormulaDependency | null;
|
|
35
|
+
export declare function isFunctionRange(ctx: Context, txt: string, r: number | null, c: number | null, id: string, dynamicArray_compute: any, cellRangeFunction: any): string;
|
|
36
|
+
export declare function getAllFunctionGroup(ctx: Context): FormulaCell[];
|
|
33
37
|
export declare function delFunctionGroup(ctx: Context, r: number, c: number, id?: string): void;
|
|
34
38
|
export declare function insertUpdateFunctionGroup(ctx: Context, r: number, c: number, id?: string, calcChainSet?: Set<string>): void;
|
|
35
39
|
export declare function execfunction(ctx: Context, txt: string, r: number, c: number, id?: string, calcChainSet?: Set<string>, isrefresh?: boolean, notInsertFunc?: boolean): any[];
|
|
36
40
|
export declare function groupValuesRefresh(ctx: Context): void;
|
|
41
|
+
export declare function setFormulaCellInfoMap(ctx: Context, calcChains?: any[], data?: CellMatrix): void;
|
|
37
42
|
export declare function execFunctionGroup(ctx: Context, origin_r: number, origin_c: number, value: any, id?: string, data?: any, isForce?: boolean): void;
|
|
38
43
|
export declare function createFormulaRangeSelect(ctx: Context, select: {
|
|
39
44
|
rangeIndex: number;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CellMatrix, Context, FormulaCell } from "..";
|
|
2
|
+
export declare function setFormulaCellInfo(ctx: Context, formulaCell: FormulaCell, data?: CellMatrix): void;
|
|
3
|
+
export declare function executeAffectedFormulas(ctx: Context, formulaRunList: any[], calcChains: any): void;
|
|
4
|
+
export declare function getFormulaRunList(updateValueArray: any[], formulaCellInfoMap: any): any[];
|
|
5
|
+
export declare const arrayMatch: (arrayMatchCache: any, formulaDependency: any, _formulaCellInfoMap: any, _updateValueObjects: any, func: any) => void;
|
|
@@ -12,7 +12,7 @@ export declare const error: {
|
|
|
12
12
|
export declare function valueIsError(value: string): boolean;
|
|
13
13
|
export declare function isRealNull(val: any): boolean;
|
|
14
14
|
export declare function isRealNum(val: any): boolean;
|
|
15
|
-
export declare function isdatetime(s: any): boolean;
|
|
15
|
+
export declare function isdatetime(s: any, format?: string): boolean;
|
|
16
16
|
export declare function diff(now: any, then: any): number;
|
|
17
17
|
export declare function isdatatypemulti(s: any): any;
|
|
18
18
|
export declare function isdatatype(s: any): string;
|
package/dist/types.d.ts
CHANGED
|
@@ -352,3 +352,36 @@ export type SingleRange = {
|
|
|
352
352
|
column: number[];
|
|
353
353
|
};
|
|
354
354
|
export type Range = SingleRange[];
|
|
355
|
+
export type FormulaDependency = {
|
|
356
|
+
row: [number, number];
|
|
357
|
+
column: [number, number];
|
|
358
|
+
sheetId: string | undefined;
|
|
359
|
+
};
|
|
360
|
+
type AncestorFormulaCell = {
|
|
361
|
+
[rxcxix: string]: number;
|
|
362
|
+
};
|
|
363
|
+
export type FormulaCellInfo = {
|
|
364
|
+
formulaDependency: FormulaDependency[];
|
|
365
|
+
calc_funcStr: string;
|
|
366
|
+
key: string;
|
|
367
|
+
r: number;
|
|
368
|
+
c: number;
|
|
369
|
+
id: string;
|
|
370
|
+
parents: AncestorFormulaCell;
|
|
371
|
+
chidren: AncestorFormulaCell;
|
|
372
|
+
color: string;
|
|
373
|
+
};
|
|
374
|
+
export type FormulaCellInfoMap = {
|
|
375
|
+
[rxcxix: string]: FormulaCellInfo;
|
|
376
|
+
};
|
|
377
|
+
export type FormulaCell = {
|
|
378
|
+
r: number;
|
|
379
|
+
c: number;
|
|
380
|
+
id: string;
|
|
381
|
+
parent?: AncestorFormulaCell;
|
|
382
|
+
func?: [boolean, number, string];
|
|
383
|
+
color?: string;
|
|
384
|
+
chidren?: AncestorFormulaCell;
|
|
385
|
+
times?: number;
|
|
386
|
+
};
|
|
387
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fileverse-dev/fortune-core",
|
|
3
|
-
"version": "1.0.2-mod-
|
|
3
|
+
"version": "1.0.2-mod-12",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.esm.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"repository": "https://github.com/ruilisi/fortune-sheet",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
|
|
13
|
+
"@fileverse-dev/formula-parser": "^0.2.13-mod-4",
|
|
14
14
|
"dayjs": "^1.11.0",
|
|
15
15
|
"immer": "^9.0.12",
|
|
16
16
|
"lodash": "^4.17.21",
|