@univerjs/sheets-formula 1.3.1 → 1.5.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 +19 -7
- package/lib/cjs/facade.js +4 -9
- package/lib/cjs/index.js +436 -490
- package/lib/cjs/locale/ar-SA.js +1 -2
- package/lib/cjs/locale/ca-ES.js +1 -2
- package/lib/cjs/locale/de-DE.js +1 -2
- package/lib/cjs/locale/en-US.js +1 -2
- package/lib/cjs/locale/es-ES.js +1 -2
- package/lib/cjs/locale/fa-IR.js +1 -2
- package/lib/cjs/locale/fr-FR.js +1 -2
- package/lib/cjs/locale/id-ID.js +1 -2
- package/lib/cjs/locale/it-IT.js +1 -2
- package/lib/cjs/locale/ja-JP.js +1 -2
- package/lib/cjs/locale/ko-KR.js +1 -2
- package/lib/cjs/locale/pl-PL.js +1 -2
- package/lib/cjs/locale/pt-BR.js +1 -2
- package/lib/cjs/locale/ru-RU.js +1 -2
- package/lib/cjs/locale/sk-SK.js +1 -2
- package/lib/cjs/locale/vi-VN.js +1 -2
- package/lib/cjs/locale/zh-CN.js +1 -2
- package/lib/cjs/locale/zh-HK.js +1 -2
- package/lib/cjs/locale/zh-TW.js +1 -2
- package/lib/cjs/remote-register-function.service-D0P1G4Uh.js +212 -0
- package/lib/cjs/worker.js +52 -0
- package/lib/es/facade.js +4 -8
- package/lib/es/index.js +353 -401
- package/lib/es/locale/ar-SA.js +1 -2
- package/lib/es/locale/ca-ES.js +1 -2
- package/lib/es/locale/de-DE.js +1 -2
- package/lib/es/locale/en-US.js +1 -2
- package/lib/es/locale/es-ES.js +1 -2
- package/lib/es/locale/fa-IR.js +1 -2
- package/lib/es/locale/fr-FR.js +1 -2
- package/lib/es/locale/id-ID.js +1 -2
- package/lib/es/locale/it-IT.js +1 -2
- package/lib/es/locale/ja-JP.js +1 -2
- package/lib/es/locale/ko-KR.js +1 -2
- package/lib/es/locale/pl-PL.js +1 -2
- package/lib/es/locale/pt-BR.js +1 -2
- package/lib/es/locale/ru-RU.js +1 -2
- package/lib/es/locale/sk-SK.js +1 -2
- package/lib/es/locale/vi-VN.js +1 -2
- package/lib/es/locale/zh-CN.js +1 -2
- package/lib/es/locale/zh-HK.js +1 -2
- package/lib/es/locale/zh-TW.js +1 -2
- package/lib/es/remote-register-function.service-CaKs4mpz.js +135 -0
- package/lib/es/worker.js +46 -0
- package/lib/facade.js +4 -8
- package/lib/index.js +353 -401
- package/lib/locale/ar-SA.js +1 -2
- package/lib/locale/ca-ES.js +1 -2
- package/lib/locale/de-DE.js +1 -2
- package/lib/locale/en-US.js +1 -2
- package/lib/locale/es-ES.js +1 -2
- package/lib/locale/fa-IR.js +1 -2
- package/lib/locale/fr-FR.js +1 -2
- package/lib/locale/id-ID.js +1 -2
- package/lib/locale/it-IT.js +1 -2
- package/lib/locale/ja-JP.js +1 -2
- package/lib/locale/ko-KR.js +1 -2
- package/lib/locale/pl-PL.js +1 -2
- package/lib/locale/pt-BR.js +1 -2
- package/lib/locale/ru-RU.js +1 -2
- package/lib/locale/sk-SK.js +1 -2
- package/lib/locale/vi-VN.js +1 -2
- package/lib/locale/zh-CN.js +1 -2
- package/lib/locale/zh-HK.js +1 -2
- package/lib/locale/zh-TW.js +1 -2
- package/lib/remote-register-function.service-CaKs4mpz.js +135 -0
- package/lib/types/controllers/trigger-calculation.controller.d.ts +2 -0
- package/lib/types/controllers/update-formula.controller.d.ts +4 -0
- package/lib/types/index.d.ts +1 -1
- package/lib/types/plugin.d.ts +1 -12
- package/lib/types/services/formula-ref-range.service.d.ts +8 -0
- package/lib/types/services/remote/remote-register-function.service.d.ts +1 -1
- package/lib/types/worker.d.ts +28 -0
- package/lib/umd/index.js +1 -1
- package/lib/worker.js +46 -0
- package/package.json +17 -12
package/README.md
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
## Package Overview
|
|
10
10
|
|
|
11
|
-
| Package | UMD global | CSS | Locales | Facade entry |
|
|
12
|
-
| --- | --- | :---: | :---: | :---: |
|
|
13
|
-
| `@univerjs/sheets-formula` | `UniverSheetsFormula` | No | Yes | Yes |
|
|
11
|
+
| Package | UMD global | CSS | Locales | Facade entry | Worker entry |
|
|
12
|
+
| --- | --- | :---: | :---: | :---: | :---: |
|
|
13
|
+
| `@univerjs/sheets-formula` | `UniverSheetsFormula` | No | Yes | Yes | Yes |
|
|
14
14
|
|
|
15
15
|
## Installation
|
|
16
16
|
|
|
@@ -20,10 +20,10 @@ pnpm add @univerjs/sheets-formula
|
|
|
20
20
|
npm install @univerjs/sheets-formula
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
Keep all `@univerjs/*` packages on the same version.
|
|
24
|
-
|
|
25
23
|
## Usage
|
|
26
24
|
|
|
25
|
+
Start with the [integration setup](https://docs.univer.ai/) for your document type, including its required plugins, styles, and locale resources. The snippet below assumes that setup is complete.
|
|
26
|
+
|
|
27
27
|
```ts
|
|
28
28
|
import EnUS from '@univerjs/sheets-formula/locale/en-US';
|
|
29
29
|
import { UniverSheetsFormulaPlugin } from '@univerjs/sheets-formula';
|
|
@@ -33,14 +33,26 @@ univer.registerPlugin(UniverSheetsFormulaPlugin);
|
|
|
33
33
|
// Merge EnUS into your Univer locale map when this package contributes UI text.
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
Main-thread plugin classes:
|
|
37
37
|
|
|
38
38
|
- `UniverSheetsFormulaPlugin`
|
|
39
|
-
|
|
39
|
+
|
|
40
|
+
### Worker usage
|
|
41
|
+
|
|
42
|
+
On the main thread, import `UniverSheetsFormulaPlugin` from `@univerjs/sheets-formula`. Set `notExecuteFormula: true` to delegate calculation to the worker.
|
|
43
|
+
|
|
44
|
+
In the worker entry, import `UniverRemoteSheetsFormulaPlugin` from `@univerjs/sheets-formula/worker`:
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
import { UniverRemoteSheetsFormulaPlugin } from '@univerjs/sheets-formula/worker';
|
|
48
|
+
|
|
49
|
+
univer.registerPlugin(UniverRemoteSheetsFormulaPlugin);
|
|
50
|
+
```
|
|
40
51
|
|
|
41
52
|
## Integration Notes
|
|
42
53
|
|
|
43
54
|
Register this package with `@univerjs/engine-formula` and `@univerjs/sheets` before adding formula UI packages.
|
|
55
|
+
- Import `@univerjs/sheets-formula/facade` when using this package through Univer Facade APIs.
|
|
44
56
|
|
|
45
57
|
## Resources
|
|
46
58
|
|
package/lib/cjs/facade.js
CHANGED
|
@@ -5,7 +5,7 @@ let _univerjs_sheets_formula = require("@univerjs/sheets-formula");
|
|
|
5
5
|
let _univerjs_core_facade = require("@univerjs/core/facade");
|
|
6
6
|
let _univerjs_sheets_facade = require("@univerjs/sheets/facade");
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/facade/f-formula.ts
|
|
9
9
|
var FFormulaSheetsMixin = class extends _univerjs_engine_formula_facade.FFormula {
|
|
10
10
|
/**
|
|
11
11
|
* Initialize the FUniver instance.
|
|
@@ -58,8 +58,7 @@ var FFormulaSheetsMixin = class extends _univerjs_engine_formula_facade.FFormula
|
|
|
58
58
|
};
|
|
59
59
|
_univerjs_engine_formula_facade.FFormula.extend(FFormulaSheetsMixin);
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
//#region src/facade/f-enum.ts
|
|
61
|
+
// src/facade/f-enum.ts
|
|
63
62
|
/**
|
|
64
63
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
65
64
|
*
|
|
@@ -82,8 +81,7 @@ var FSheetsFormulaEnumMixin = class extends _univerjs_core_facade.FEnum {
|
|
|
82
81
|
};
|
|
83
82
|
_univerjs_core_facade.FEnum.extend(FSheetsFormulaEnumMixin);
|
|
84
83
|
|
|
85
|
-
|
|
86
|
-
//#region src/facade/f-workbook.ts
|
|
84
|
+
// src/facade/f-workbook.ts
|
|
87
85
|
var FWorkbookEngineFormulaMixin = class extends _univerjs_sheets_facade.FWorkbook {
|
|
88
86
|
getAllFormulaError() {
|
|
89
87
|
const errors = [];
|
|
@@ -119,8 +117,7 @@ var FWorkbookEngineFormulaMixin = class extends _univerjs_sheets_facade.FWorkboo
|
|
|
119
117
|
};
|
|
120
118
|
_univerjs_sheets_facade.FWorkbook.extend(FWorkbookEngineFormulaMixin);
|
|
121
119
|
|
|
122
|
-
|
|
123
|
-
//#region src/facade/f-range.ts
|
|
120
|
+
// src/facade/f-range.ts
|
|
124
121
|
/**
|
|
125
122
|
* @ignore
|
|
126
123
|
*/
|
|
@@ -155,5 +152,3 @@ var FRangeEngineFormulaMixin = class extends _univerjs_sheets_facade.FRange {
|
|
|
155
152
|
}
|
|
156
153
|
};
|
|
157
154
|
_univerjs_sheets_facade.FRange.extend(FRangeEngineFormulaMixin);
|
|
158
|
-
|
|
159
|
-
//#endregion
|