@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/lib/locale/ar-SA.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/ar-SA.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "جارٍ تحليل الصيغ...",
|
|
4
4
|
calculating: "جارٍ حساب الصيغ...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "تم"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
export { locale as default };
|
package/lib/locale/ca-ES.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/ca-ES.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "Analitzant fórmules...",
|
|
4
4
|
calculating: "Calculant fórmules...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "Fet"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
export { locale as default };
|
package/lib/locale/de-DE.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/de-DE.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "Formeln werden analysiert...",
|
|
4
4
|
calculating: "Formeln werden berechnet...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "Fertig"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
export { locale as default };
|
package/lib/locale/en-US.js
CHANGED
package/lib/locale/es-ES.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/es-ES.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "Analizando fórmulas...",
|
|
4
4
|
calculating: "Calculando fórmulas...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "Listo"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
export { locale as default };
|
package/lib/locale/fa-IR.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/fa-IR.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "در حال تحلیل فرمولها...",
|
|
4
4
|
calculating: "در حال محاسبه فرمولها...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "انجام شد"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
export { locale as default };
|
package/lib/locale/fr-FR.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/fr-FR.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "Analyse des formules...",
|
|
4
4
|
calculating: "Calcul des formules...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "Terminé"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
export { locale as default };
|
package/lib/locale/id-ID.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/id-ID.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "Menganalisis rumus...",
|
|
4
4
|
calculating: "Menghitung rumus...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "Selesai"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
export { locale as default };
|
package/lib/locale/it-IT.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/it-IT.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "Analisi delle formule...",
|
|
4
4
|
calculating: "Calcolo delle formule...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "Completato"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
export { locale as default };
|
package/lib/locale/ja-JP.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/ja-JP.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "数式を分析中...",
|
|
4
4
|
calculating: "数式を計算中...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "完了"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
export { locale as default };
|
package/lib/locale/ko-KR.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/ko-KR.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "수식 분석 중...",
|
|
4
4
|
calculating: "수식 계산 중...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "완료"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
export { locale as default };
|
package/lib/locale/pl-PL.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/pl-PL.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "Analizowanie formuł...",
|
|
4
4
|
calculating: "Obliczanie formuł...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "Gotowe"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
export { locale as default };
|
package/lib/locale/pt-BR.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/pt-BR.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "Analisando fórmulas...",
|
|
4
4
|
calculating: "Calculando fórmulas...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "Concluído"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
export { locale as default };
|
package/lib/locale/ru-RU.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/ru-RU.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "Анализ формул...",
|
|
4
4
|
calculating: "Вычисление формул...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "Готово"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
export { locale as default };
|
package/lib/locale/sk-SK.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/sk-SK.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "Analyzujú sa vzorce...",
|
|
4
4
|
calculating: "Počítajú sa vzorce...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "Hotovo"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
export { locale as default };
|
package/lib/locale/vi-VN.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/vi-VN.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "Đang phân tích công thức...",
|
|
4
4
|
calculating: "Đang tính toán công thức...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "Hoàn tất"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
export { locale as default };
|
package/lib/locale/zh-CN.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/zh-CN.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "正在分析公式...",
|
|
4
4
|
calculating: "正在计算公式...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "完成"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
export { locale as default };
|
package/lib/locale/zh-HK.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/zh-HK.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "正在分析公式...",
|
|
4
4
|
calculating: "正在計算公式...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "完成"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
export { locale as default };
|
package/lib/locale/zh-TW.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/zh-TW.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "正在分析公式...",
|
|
4
4
|
calculating: "正在計算公式...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "完成"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
export { locale as default };
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { createIdentifier } from "@univerjs/core";
|
|
2
|
+
import { IFunctionService } from "@univerjs/engine-formula";
|
|
3
|
+
|
|
4
|
+
// src/config/config.ts
|
|
5
|
+
/**
|
|
6
|
+
* Base configuration for the plugin.
|
|
7
|
+
*/
|
|
8
|
+
const PLUGIN_CONFIG_KEY_BASE = "sheets-formula.base.config";
|
|
9
|
+
const configSymbolBase = Symbol(PLUGIN_CONFIG_KEY_BASE);
|
|
10
|
+
let CalculationMode = /* @__PURE__ */ function(CalculationMode) {
|
|
11
|
+
/**
|
|
12
|
+
* Force calculation of all formulas
|
|
13
|
+
*/
|
|
14
|
+
CalculationMode[CalculationMode["FORCED"] = 0] = "FORCED";
|
|
15
|
+
/**
|
|
16
|
+
* Partial calculation, only cells with formulas but no v values are calculated
|
|
17
|
+
*/
|
|
18
|
+
CalculationMode[CalculationMode["WHEN_EMPTY"] = 1] = "WHEN_EMPTY";
|
|
19
|
+
/**
|
|
20
|
+
* All formulas are not calculated
|
|
21
|
+
*/
|
|
22
|
+
CalculationMode[CalculationMode["NO_CALCULATION"] = 2] = "NO_CALCULATION";
|
|
23
|
+
return CalculationMode;
|
|
24
|
+
}({});
|
|
25
|
+
const defaultPluginBaseConfig = {};
|
|
26
|
+
/**
|
|
27
|
+
* Remote configuration for the plugin.
|
|
28
|
+
*/
|
|
29
|
+
const PLUGIN_CONFIG_KEY_REMOTE = "sheets-formula.remote.config";
|
|
30
|
+
const configSymbolRemote = Symbol(PLUGIN_CONFIG_KEY_REMOTE);
|
|
31
|
+
const defaultPluginRemoteConfig = {};
|
|
32
|
+
/**
|
|
33
|
+
* Mobile configuration for the plugin.
|
|
34
|
+
*/
|
|
35
|
+
const PLUGIN_CONFIG_KEY_MOBILE = "sheets-formula.mobile.config";
|
|
36
|
+
const configSymbolMobile = Symbol(PLUGIN_CONFIG_KEY_MOBILE);
|
|
37
|
+
|
|
38
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/decorateParam.js
|
|
39
|
+
function __decorateParam(paramIndex, decorator) {
|
|
40
|
+
return function(target, key) {
|
|
41
|
+
decorator(target, key, paramIndex);
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/decorate.js
|
|
46
|
+
function __decorate(decorators, target, key, desc) {
|
|
47
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
48
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
49
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
50
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/typeof.js
|
|
54
|
+
function _typeof(o) {
|
|
55
|
+
"@babel/helpers - typeof";
|
|
56
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
57
|
+
return typeof o;
|
|
58
|
+
} : function(o) {
|
|
59
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
60
|
+
}, _typeof(o);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/toPrimitive.js
|
|
64
|
+
function toPrimitive(t, e) {
|
|
65
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
66
|
+
var r;
|
|
67
|
+
if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) {
|
|
68
|
+
var i = r.call(t, e || "default");
|
|
69
|
+
if ("object" != _typeof(i)) return i;
|
|
70
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
71
|
+
}
|
|
72
|
+
return ("string" === e ? String : Number)(t);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/toPropertyKey.js
|
|
76
|
+
function toPropertyKey(t) {
|
|
77
|
+
var i = toPrimitive(t, "string");
|
|
78
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/defineProperty.js
|
|
82
|
+
function _defineProperty(e, r, t) {
|
|
83
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
84
|
+
value: t,
|
|
85
|
+
enumerable: !0,
|
|
86
|
+
configurable: !0,
|
|
87
|
+
writable: !0
|
|
88
|
+
}) : e[r] = t, e;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// package.json
|
|
92
|
+
var name = "@univerjs/sheets-formula";
|
|
93
|
+
var version = "1.5.0";
|
|
94
|
+
|
|
95
|
+
// src/services/remote/remote-register-function.service.ts
|
|
96
|
+
/**
|
|
97
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
98
|
+
*
|
|
99
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
100
|
+
* you may not use this file except in compliance with the License.
|
|
101
|
+
* You may obtain a copy of the License at
|
|
102
|
+
*
|
|
103
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
104
|
+
*
|
|
105
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
106
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
107
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
108
|
+
* See the License for the specific language governing permissions and
|
|
109
|
+
* limitations under the License.
|
|
110
|
+
*/
|
|
111
|
+
const RemoteRegisterFunctionServiceName = "sheets-formula.remote-register-function.service";
|
|
112
|
+
const IRemoteRegisterFunctionService = createIdentifier(RemoteRegisterFunctionServiceName);
|
|
113
|
+
let RemoteRegisterFunctionService = class RemoteRegisterFunctionService {
|
|
114
|
+
constructor(_functionService) {
|
|
115
|
+
this._functionService = _functionService;
|
|
116
|
+
}
|
|
117
|
+
async registerFunctions(serializedFuncs) {
|
|
118
|
+
rejectRemoteCustomFunctionRegistration(serializedFuncs);
|
|
119
|
+
}
|
|
120
|
+
async registerAsyncFunctions(serializedFuncs) {
|
|
121
|
+
rejectRemoteCustomFunctionRegistration(serializedFuncs);
|
|
122
|
+
}
|
|
123
|
+
async unregisterFunctions(names) {
|
|
124
|
+
this._functionService.unregisterExecutors(...names);
|
|
125
|
+
this._functionService.unregisterDescriptions(...names);
|
|
126
|
+
this._functionService.deleteFormulaAstCacheKey(...names);
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
RemoteRegisterFunctionService = __decorate([__decorateParam(0, IFunctionService)], RemoteRegisterFunctionService);
|
|
130
|
+
function rejectRemoteCustomFunctionRegistration(serializedFuncs) {
|
|
131
|
+
if (serializedFuncs.length === 0) return;
|
|
132
|
+
throw new Error("Remote custom function registration is disabled because function deserialization over RPC is unsafe.");
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export { version as a, __decorateParam as c, PLUGIN_CONFIG_KEY_REMOTE as d, defaultPluginBaseConfig as f, name as i, CalculationMode as l, RemoteRegisterFunctionService as n, _defineProperty as o, defaultPluginRemoteConfig as p, RemoteRegisterFunctionServiceName as r, __decorate as s, IRemoteRegisterFunctionService as t, PLUGIN_CONFIG_KEY_BASE as u };
|
|
@@ -49,6 +49,8 @@ export declare class TriggerCalculationController extends Disposable {
|
|
|
49
49
|
private _getCalculationMode;
|
|
50
50
|
private _commandExecutedListener;
|
|
51
51
|
private _initialExecuteFormulaProcessListener;
|
|
52
|
+
private _updateCalculationProgress;
|
|
53
|
+
private _getCalculationResultMessage;
|
|
52
54
|
private _initialExecuteFormula;
|
|
53
55
|
private _getDirtyDataByCalculationMode;
|
|
54
56
|
}
|
|
@@ -38,6 +38,7 @@ export declare class UpdateFormulaController extends Disposable {
|
|
|
38
38
|
readonly _injector: Injector;
|
|
39
39
|
constructor(_univerInstanceService: IUniverInstanceService, _commandService: ICommandService, _lexerTreeBuilder: LexerTreeBuilder, _formulaDataModel: FormulaDataModel, _sheetInterceptorService: SheetInterceptorService, _definedNamesService: IDefinedNamesService, _configService: IConfigService, _injector: Injector);
|
|
40
40
|
private _commandExecutedListener;
|
|
41
|
+
private _getEditedArrayFormulaDirtyRanges;
|
|
41
42
|
private _handleSetRangeValuesMutation;
|
|
42
43
|
private _handleWorkbookDisposed;
|
|
43
44
|
private _handleInsertSheetMutation;
|
|
@@ -45,4 +46,7 @@ export declare class UpdateFormulaController extends Disposable {
|
|
|
45
46
|
private _getDirtyDataByCalculationMode;
|
|
46
47
|
private _getUpdateFormula;
|
|
47
48
|
private _getFormulaReferenceMoveInfo;
|
|
49
|
+
private _getMovedFormula;
|
|
50
|
+
private _updateFormulaReferenceNodes;
|
|
51
|
+
private _getDefinedNameReferenceToken;
|
|
48
52
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export { TriggerCalculationController } from './controllers/trigger-calculation.
|
|
|
24
24
|
export { collectUnitQualifierFormulaPatches, UnitQualifierRenameController } from './controllers/unit-qualifier-rename.controller';
|
|
25
25
|
export { UpdateDefinedNameController } from './controllers/update-defined-name.controller';
|
|
26
26
|
export { UpdateFormulaController } from './controllers/update-formula.controller';
|
|
27
|
-
export {
|
|
27
|
+
export { UniverSheetsFormulaPlugin } from './plugin';
|
|
28
28
|
export { FormulaRefRangeService } from './services/formula-ref-range.service';
|
|
29
29
|
export { IRemoteRegisterFunctionService, RemoteRegisterFunctionService, } from './services/remote/remote-register-function.service';
|
|
30
30
|
export { calculateFormula } from './util/calculate';
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -13,19 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { IUniverSheetsFormulaBaseConfig, IUniverSheetsFormulaRemoteConfig } from './config/config';
|
|
17
16
|
import { IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
18
|
-
|
|
19
|
-
private readonly _config;
|
|
20
|
-
readonly _injector: Injector;
|
|
21
|
-
private readonly _configService;
|
|
22
|
-
static pluginName: string;
|
|
23
|
-
static packageName: string;
|
|
24
|
-
static version: string;
|
|
25
|
-
static type: UniverInstanceType;
|
|
26
|
-
constructor(_config: Partial<IUniverSheetsFormulaRemoteConfig> | undefined, _injector: Injector, _configService: IConfigService);
|
|
27
|
-
onStarting(): void;
|
|
28
|
-
}
|
|
17
|
+
import type { IUniverSheetsFormulaBaseConfig } from './config/config';
|
|
29
18
|
export declare class UniverSheetsFormulaPlugin extends Plugin {
|
|
30
19
|
private readonly _config;
|
|
31
20
|
readonly _injector: Injector;
|
|
@@ -40,4 +40,12 @@ export declare class FormulaRefRangeService extends Disposable {
|
|
|
40
40
|
registerFormula(unitId: string, subUnitId: string, formula: string, callback: FormulaChangeCallback): IDisposable;
|
|
41
41
|
private _getFormulaDependcy;
|
|
42
42
|
registerRangeFormula(unitId: string, subUnitId: string, oldRanges: IRange[], formulas: string[], callback: RangeFormulaChangeCallback): IDisposable;
|
|
43
|
+
/**
|
|
44
|
+
* A whole column/row/sheet range keeps its anchor, so it is adjusted as a single range:
|
|
45
|
+
* segmenting it would both split the rule and drop the range type.
|
|
46
|
+
*
|
|
47
|
+
* @returns the single rule range to apply, or `undefined` when the regular segmentation applies
|
|
48
|
+
*/
|
|
49
|
+
private _transformWholeRangeFormulas;
|
|
50
|
+
private _appendInsertedBlockItems;
|
|
43
51
|
}
|
|
@@ -20,7 +20,7 @@ export interface IRemoteRegisterFunctionService {
|
|
|
20
20
|
unregisterFunctions(names: string[]): Promise<void>;
|
|
21
21
|
}
|
|
22
22
|
export declare const RemoteRegisterFunctionServiceName = "sheets-formula.remote-register-function.service";
|
|
23
|
-
export declare const IRemoteRegisterFunctionService: import("@
|
|
23
|
+
export declare const IRemoteRegisterFunctionService: import("@univerjs/core").IdentifierDecorator<IRemoteRegisterFunctionService>;
|
|
24
24
|
/**
|
|
25
25
|
* This class should resident in the remote process.
|
|
26
26
|
*/
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
17
|
+
import type { IUniverSheetsFormulaRemoteConfig } from './config/config';
|
|
18
|
+
export declare class UniverRemoteSheetsFormulaPlugin extends Plugin {
|
|
19
|
+
private readonly _config;
|
|
20
|
+
readonly _injector: Injector;
|
|
21
|
+
private readonly _configService;
|
|
22
|
+
static pluginName: string;
|
|
23
|
+
static packageName: string;
|
|
24
|
+
static version: string;
|
|
25
|
+
static type: UniverInstanceType;
|
|
26
|
+
constructor(_config: Partial<IUniverSheetsFormulaRemoteConfig> | undefined, _injector: Injector, _configService: IConfigService);
|
|
27
|
+
onStarting(): void;
|
|
28
|
+
}
|