@univerjs/sheets-formula 0.5.4 → 0.5.5-experimental.20250123-34738ff
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/lib/cjs/facade.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/facade.js +54 -48
- package/lib/es/index.js +3108 -3043
- package/lib/es/locale/en-US.js +2 -2
- package/lib/es/locale/fa-IR.js +2 -2
- package/lib/es/locale/fr-FR.js +2 -2
- package/lib/es/locale/ru-RU.js +2 -2
- package/lib/es/locale/vi-VN.js +2 -2
- package/lib/es/locale/zh-CN.js +2 -2
- package/lib/es/locale/zh-TW.js +2 -2
- package/lib/types/facade/f-formula.d.ts +4 -1
- package/lib/types/facade/f-univer.d.ts +7 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +8 -8
- package/LICENSE +0 -176
- package/lib/types/controllers/utils/__tests__/offset-formula-data.spec.d.ts +0 -16
- package/lib/types/controllers/utils/__tests__/ref-range-formula.spec.d.ts +0 -16
- package/lib/types/controllers/utils/__tests__/ref-range-move.spec.d.ts +0 -16
package/lib/cjs/locale/en-US.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const locale={formula:{progress:{analyzing:"Analyzing",calculating:"Calculating","array-analysis":"Array Analysis","array-calculation":"Array Calculation",done:"Done"}}};module.exports=locale;
|
package/lib/cjs/locale/fa-IR.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const locale={formula:{progress:{analyzing:"در حال تحلیل",calculating:"در حال محاسبه","array-analysis":"تحلیل آرایه","array-calculation":"محاسبه آرایه",done:"تمام"}}};module.exports=locale;
|
package/lib/cjs/locale/fr-FR.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const locale={formula:{progress:{analyzing:"Analyse en cours",calculating:"Calcul en cours","array-analysis":"Analyse de tableau","array-calculation":"Calcul de tableau",done:"Terminé"}}};module.exports=locale;
|
package/lib/cjs/locale/ru-RU.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const locale={formula:{progress:{analyzing:"Анализ",calculating:"Вычисление","array-analysis":"Анализ массива","array-calculation":"Вычисление массива",done:"Готово"}}};module.exports=locale;
|
package/lib/cjs/locale/vi-VN.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const locale={formula:{progress:{analyzing:"Đang phân tích",calculating:"Đang tính toán","array-analysis":"Phân tích mảng","array-calculation":"Tính toán mảng",done:"Hoàn tất"}}};module.exports=locale;
|
package/lib/cjs/locale/zh-CN.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const locale={formula:{progress:{analyzing:"分析中",calculating:"计算中","array-analysis":"数组分析","array-calculation":"数组计算",done:"完成"}}};module.exports=locale;
|
package/lib/cjs/locale/zh-TW.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const locale={formula:{progress:{analyzing:"分析中",calculating:"計算中","array-analysis":"陣列分析","array-calculation":"陣列計算",done:"完成"}}};module.exports=locale;
|
package/lib/es/facade.js
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
|
|
3
|
+
import { FUniver, debounce, LifecycleService, ILogService, IConfigService, LifecycleStages } from "@univerjs/core";
|
|
4
|
+
import { SetFormulaCalculationStartMutation } from "@univerjs/engine-formula";
|
|
5
|
+
import { IRegisterFunctionService, RegisterFunctionService, PLUGIN_CONFIG_KEY_BASE } from "@univerjs/sheets-formula";
|
|
6
|
+
import { FFormula } from "@univerjs/engine-formula/facade";
|
|
7
|
+
const _FUniverSheetsFormulaMixin = class _FUniverSheetsFormulaMixin extends FUniver {
|
|
6
8
|
/**
|
|
7
9
|
* Initialize the FUniver instance.
|
|
8
|
-
* @
|
|
10
|
+
* @ignore
|
|
9
11
|
*/
|
|
10
12
|
_initialize() {
|
|
11
|
-
this._debouncedFormulaCalculation =
|
|
13
|
+
this._debouncedFormulaCalculation = debounce(() => {
|
|
12
14
|
this._commandService.executeCommand(
|
|
13
|
-
|
|
15
|
+
SetFormulaCalculationStartMutation.id,
|
|
14
16
|
{
|
|
15
17
|
commands: [],
|
|
16
18
|
forceCalculation: !0
|
|
@@ -21,23 +23,25 @@ class C extends s {
|
|
|
21
23
|
);
|
|
22
24
|
}, 10);
|
|
23
25
|
}
|
|
24
|
-
registerFunction(
|
|
25
|
-
let
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
return this._debouncedFormulaCalculation(),
|
|
26
|
+
registerFunction(config) {
|
|
27
|
+
let registerFunctionService = this._injector.get(IRegisterFunctionService);
|
|
28
|
+
registerFunctionService || (this._injector.add([IRegisterFunctionService, { useClass: RegisterFunctionService }]), registerFunctionService = this._injector.get(IRegisterFunctionService));
|
|
29
|
+
const functionsDisposable = registerFunctionService.registerFunctions(config);
|
|
30
|
+
return this._debouncedFormulaCalculation(), functionsDisposable;
|
|
29
31
|
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
};
|
|
33
|
+
__name(_FUniverSheetsFormulaMixin, "FUniverSheetsFormulaMixin");
|
|
34
|
+
let FUniverSheetsFormulaMixin = _FUniverSheetsFormulaMixin;
|
|
35
|
+
FUniver.extend(FUniverSheetsFormulaMixin);
|
|
36
|
+
const _FFormulaSheetsMixin = class _FFormulaSheetsMixin extends FFormula {
|
|
33
37
|
/**
|
|
34
38
|
* Initialize the FUniver instance.
|
|
35
|
-
* @
|
|
39
|
+
* @ignore
|
|
36
40
|
*/
|
|
37
41
|
_initialize() {
|
|
38
|
-
this._debouncedFormulaCalculation =
|
|
42
|
+
this._debouncedFormulaCalculation = debounce(() => {
|
|
39
43
|
this._commandService.executeCommand(
|
|
40
|
-
|
|
44
|
+
SetFormulaCalculationStartMutation.id,
|
|
41
45
|
{
|
|
42
46
|
commands: [],
|
|
43
47
|
forceCalculation: !0
|
|
@@ -48,35 +52,37 @@ class v extends f {
|
|
|
48
52
|
);
|
|
49
53
|
}, 10);
|
|
50
54
|
}
|
|
51
|
-
setInitialFormulaComputing(
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
|
|
55
|
+
setInitialFormulaComputing(calculationMode) {
|
|
56
|
+
const lifecycleStage = this._injector.get(LifecycleService).stage, logService = this._injector.get(ILogService), configService = this._injector.get(IConfigService);
|
|
57
|
+
lifecycleStage > LifecycleStages.Starting && logService.warn("[FFormula]", "CalculationMode is called after the Starting lifecycle and will take effect the next time the Univer Sheet is constructed. If you want it to take effect when the Univer Sheet is initialized this time, consider calling it before the Ready lifecycle or using configuration.");
|
|
58
|
+
const config = configService.getConfig(PLUGIN_CONFIG_KEY_BASE);
|
|
59
|
+
config && (config.initialFormulaComputing = calculationMode);
|
|
56
60
|
}
|
|
57
|
-
registerFunction(
|
|
58
|
-
var
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
name
|
|
63
|
-
func
|
|
64
|
-
description: typeof
|
|
65
|
-
locales: typeof
|
|
66
|
-
},
|
|
67
|
-
return this._debouncedFormulaCalculation(),
|
|
61
|
+
registerFunction(name, func, options) {
|
|
62
|
+
var _a;
|
|
63
|
+
let registerFunctionService = this._injector.get(IRegisterFunctionService);
|
|
64
|
+
registerFunctionService || (this._injector.add([IRegisterFunctionService, { useClass: RegisterFunctionService }]), registerFunctionService = this._injector.get(IRegisterFunctionService));
|
|
65
|
+
const params = {
|
|
66
|
+
name,
|
|
67
|
+
func,
|
|
68
|
+
description: typeof options == "string" ? options : (_a = options == null ? void 0 : options.description) != null ? _a : "",
|
|
69
|
+
locales: typeof options == "object" ? options.locales : void 0
|
|
70
|
+
}, functionsDisposable = registerFunctionService.registerFunction(params);
|
|
71
|
+
return this._debouncedFormulaCalculation(), functionsDisposable;
|
|
68
72
|
}
|
|
69
|
-
registerAsyncFunction(
|
|
70
|
-
var
|
|
71
|
-
let
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
-
name
|
|
75
|
-
func
|
|
76
|
-
description: typeof
|
|
77
|
-
locales: typeof
|
|
78
|
-
},
|
|
79
|
-
return this._debouncedFormulaCalculation(),
|
|
73
|
+
registerAsyncFunction(name, func, options) {
|
|
74
|
+
var _a;
|
|
75
|
+
let registerFunctionService = this._injector.get(IRegisterFunctionService);
|
|
76
|
+
registerFunctionService || (this._injector.add([IRegisterFunctionService, { useClass: RegisterFunctionService }]), registerFunctionService = this._injector.get(IRegisterFunctionService));
|
|
77
|
+
const params = {
|
|
78
|
+
name,
|
|
79
|
+
func,
|
|
80
|
+
description: typeof options == "string" ? options : (_a = options == null ? void 0 : options.description) != null ? _a : "",
|
|
81
|
+
locales: typeof options == "object" ? options.locales : void 0
|
|
82
|
+
}, functionsDisposable = registerFunctionService.registerAsyncFunction(params);
|
|
83
|
+
return this._debouncedFormulaCalculation(), functionsDisposable;
|
|
80
84
|
}
|
|
81
|
-
}
|
|
82
|
-
|
|
85
|
+
};
|
|
86
|
+
__name(_FFormulaSheetsMixin, "FFormulaSheetsMixin");
|
|
87
|
+
let FFormulaSheetsMixin = _FFormulaSheetsMixin;
|
|
88
|
+
FFormula.extend(FFormulaSheetsMixin);
|