@univerjs/sheets-formula 0.6.1 → 0.6.2
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/es/facade.js +37 -33
- package/lib/es/index.js +449 -429
- package/lib/types/controllers/trigger-calculation.controller.d.ts +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/util/calculate.d.ts +3 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +9 -9
|
@@ -28,7 +28,6 @@ export declare class TriggerCalculationController extends Disposable {
|
|
|
28
28
|
private _doneCalculationTaskCount;
|
|
29
29
|
private _executionInProgressParams;
|
|
30
30
|
private _restartCalculation;
|
|
31
|
-
private _calculationMode;
|
|
32
31
|
/**
|
|
33
32
|
* The mark of forced calculation. If a new mutation triggers dirty area calculation during the forced calculation process, forced calculation is still required.
|
|
34
33
|
*/
|
|
@@ -42,6 +41,7 @@ export declare class TriggerCalculationController extends Disposable {
|
|
|
42
41
|
clearProgress(): void;
|
|
43
42
|
constructor(_commandService: ICommandService, _activeDirtyManagerService: IActiveDirtyManagerService, _logService: ILogService, _configService: IConfigService, _formulaDataModel: FormulaDataModel, _localeService: LocaleService, _registerOtherFormulaService: RegisterOtherFormulaService);
|
|
44
43
|
dispose(): void;
|
|
44
|
+
private _getCalculationMode;
|
|
45
45
|
private _commandExecutedListener;
|
|
46
46
|
private _generateDirty;
|
|
47
47
|
private _mergeDirty;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export { UpdateDefinedNameController } from './controllers/update-defined-name.c
|
|
|
19
19
|
export { TriggerCalculationController } from './controllers/trigger-calculation.controller';
|
|
20
20
|
export { CalculationMode, type IUniverSheetsFormulaBaseConfig, PLUGIN_CONFIG_KEY_BASE } from './controllers/config.schema';
|
|
21
21
|
export type { IRegisterAsyncFunction, IRegisterFunction, ISingleFunctionRegisterParams } from './services/register-function.service';
|
|
22
|
+
export { calculateFormula } from './util/calculate';
|
|
22
23
|
export { UpdateFormulaController } from './controllers/update-formula.controller';
|
|
23
24
|
export { DescriptionService, IDescriptionService, type ISearchItem } from './services/description.service';
|
|
24
25
|
export type { IFormulaInfo, IOtherFormulaResult } from './services/formula-common';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Injector } from '@univerjs/core';
|
|
2
|
+
import { ISheetData } from '@univerjs/engine-formula';
|
|
3
|
+
export declare function calculateFormula(inject: Injector, formulaString: string, unitId: string, sheetData: ISheetData): string | number | boolean | (string | number | boolean | null)[][];
|
package/lib/umd/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(i,o){typeof exports=="object"&&typeof module<"u"?o(require("@univerjs/core"),require("@univerjs/core/facade"),require("@univerjs/engine-formula"),require("@univerjs/sheets-formula"),require("@univerjs/engine-formula/facade")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/core/facade","@univerjs/engine-formula","@univerjs/sheets-formula","@univerjs/engine-formula/facade"],o):(i=typeof globalThis<"u"?globalThis:i||self,o(i.UniverCore,i.UniverCoreFacade,i.UniverEngineFormula,i.UniverSheetsFormula,i.UniverEngineFormulaFacade))})(this,function(i,o,l,t,d){"use strict";class f extends o.FUniver{_initialize(){this._debouncedFormulaCalculation=i.debounce(()=>{this._commandService.executeCommand(l.SetFormulaCalculationStartMutation.id,{commands:[],forceCalculation:!0},{onlyLocal:!0})},10)}registerFunction(r){let c=this._injector.get(t.IRegisterFunctionService);c||(this._injector.add([t.IRegisterFunctionService,{useClass:t.RegisterFunctionService}]),c=this._injector.get(t.IRegisterFunctionService));const e=c.registerFunctions(r);return this._debouncedFormulaCalculation(),e}}o.FUniver.extend(f);class g extends d.FFormula{_initialize(){this._debouncedFormulaCalculation=i.debounce(()=>{this._commandService.executeCommand(l.SetFormulaCalculationStartMutation.id,{commands:[],forceCalculation:!0},{onlyLocal:!0})},10)}setInitialFormulaComputing(r){const e=this._injector.get(i.LifecycleService).stage,n=this._injector.get(i.ILogService),
|
|
1
|
+
(function(i,o){typeof exports=="object"&&typeof module<"u"?o(require("@univerjs/core"),require("@univerjs/core/facade"),require("@univerjs/engine-formula"),require("@univerjs/sheets-formula"),require("@univerjs/engine-formula/facade")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/core/facade","@univerjs/engine-formula","@univerjs/sheets-formula","@univerjs/engine-formula/facade"],o):(i=typeof globalThis<"u"?globalThis:i||self,o(i.UniverCore,i.UniverCoreFacade,i.UniverEngineFormula,i.UniverSheetsFormula,i.UniverEngineFormulaFacade))})(this,function(i,o,l,t,d){"use strict";class f extends o.FUniver{_initialize(){this._debouncedFormulaCalculation=i.debounce(()=>{this._commandService.executeCommand(l.SetFormulaCalculationStartMutation.id,{commands:[],forceCalculation:!0},{onlyLocal:!0})},10)}registerFunction(r){let c=this._injector.get(t.IRegisterFunctionService);c||(this._injector.add([t.IRegisterFunctionService,{useClass:t.RegisterFunctionService}]),c=this._injector.get(t.IRegisterFunctionService));const e=c.registerFunctions(r);return this._debouncedFormulaCalculation(),e}}o.FUniver.extend(f);class g extends d.FFormula{_initialize(){this._debouncedFormulaCalculation=i.debounce(()=>{this._commandService.executeCommand(l.SetFormulaCalculationStartMutation.id,{commands:[],forceCalculation:!0},{onlyLocal:!0})},10)}setInitialFormulaComputing(r){const e=this._injector.get(i.LifecycleService).stage,n=this._injector.get(i.ILogService),u=this._injector.get(i.IConfigService);e>i.LifecycleStages.Starting&&n.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.");const s=u.getConfig(t.PLUGIN_CONFIG_KEY_BASE);if(!s){u.setConfig(t.PLUGIN_CONFIG_KEY_BASE,{initialFormulaComputing:r});return}s.initialFormulaComputing=r}registerFunction(r,c,e){var a;let n=this._injector.get(t.IRegisterFunctionService);n||(this._injector.add([t.IRegisterFunctionService,{useClass:t.RegisterFunctionService}]),n=this._injector.get(t.IRegisterFunctionService));const u={name:r,func:c,description:typeof e=="string"?e:(a=e==null?void 0:e.description)!=null?a:"",locales:typeof e=="object"?e.locales:void 0},s=n.registerFunction(u);return this._debouncedFormulaCalculation(),s}registerAsyncFunction(r,c,e){var a;let n=this._injector.get(t.IRegisterFunctionService);n||(this._injector.add([t.IRegisterFunctionService,{useClass:t.RegisterFunctionService}]),n=this._injector.get(t.IRegisterFunctionService));const u={name:r,func:c,description:typeof e=="string"?e:(a=e==null?void 0:e.description)!=null?a:"",locales:typeof e=="object"?e.locales:void 0},s=n.registerAsyncFunction(u);return this._debouncedFormulaCalculation(),s}}d.FFormula.extend(g)});
|