@univerjs/engine-formula 0.12.3-nightly.202512060617 → 0.12.4-experimental.20251208-c4b8a44
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 +184 -38
- package/lib/es/index.js +5521 -5212
- package/lib/facade.js +184 -38
- package/lib/index.js +5521 -5212
- package/lib/types/basics/common.d.ts +14 -0
- package/lib/types/basics/date.d.ts +0 -1
- package/lib/types/commands/mutations/set-formula-calculation.mutation.d.ts +29 -1
- package/lib/types/controller/calculate.controller.d.ts +3 -0
- package/lib/types/engine/dependency/dependency-tree.d.ts +39 -0
- package/lib/types/engine/dependency/formula-dependency.d.ts +17 -2
- package/lib/types/facade/f-formula.d.ts +128 -1
- package/lib/types/index.d.ts +3 -3
- package/lib/types/services/calculate-formula.service.d.ts +10 -3
- package/lib/types/services/current-data.service.d.ts +3 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +4 -4
package/lib/cjs/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@univerjs/core/facade"),u=require("@univerjs/core"),a=require("@univerjs/engine-formula"),c=require("rxjs");var d=Object.getOwnPropertyDescriptor,p=(o,e,t,r)=>{for(var i=r>1?void 0:r?d(e,t):e,n=o.length-1,m;n>=0;n--)(m=o[n])&&(i=m(i)||i);return i},l=(o,e)=>(t,r)=>e(t,r,o);exports.FFormula=class extends s.FBase{constructor(e,t,r,i){super(),this._commandService=e,this._injector=t,this._lexerTreeBuilder=r,this._configService=i,this._initialize()}_initialize(){}get lexerTreeBuilder(){return this._lexerTreeBuilder}moveFormulaRefOffset(e,t,r,i){return this._lexerTreeBuilder.moveFormulaRefOffset(e,t,r,i)}sequenceNodesBuilder(e){return this._lexerTreeBuilder.sequenceNodesBuilder(e)||[]}executeCalculation(){this._commandService.executeCommand(a.SetFormulaCalculationStartMutation.id,{commands:[],forceCalculation:!0},{onlyLocal:!0})}stopCalculation(){this._commandService.executeCommand(a.SetFormulaCalculationStopMutation.id,{})}calculationStart(e){return this._commandService.onCommandExecuted(t=>{if(t.id===a.SetFormulaCalculationStartMutation.id){const r=t.params;e(r.forceCalculation)}})}calculationEnd(e){return this._commandService.onCommandExecuted(t=>{if(t.id!==a.SetFormulaCalculationNotificationMutation.id)return;const r=t.params;r.functionsExecutedState!==void 0&&e(r.functionsExecutedState)})}whenComputingCompleteAsync(e){const t=this._injector.get(a.GlobalComputingStatusService);return t.computingStatus?Promise.resolve(!0):c.firstValueFrom(c.race(t.computingStatus$.pipe(c.filter(r=>r)),c.timer(e!=null?e:3e4).pipe(c.map(()=>!1))))}onCalculationEnd(){return new Promise((e,t)=>{const r=setTimeout(()=>{t(new Error("Calculation end timeout"))},3e4),i=this.calculationEnd(()=>{clearTimeout(r),i.dispose(),e()})})}calculationProcessing(e){return this._commandService.onCommandExecuted(t=>{if(t.id!==a.SetFormulaCalculationNotificationMutation.id)return;const r=t.params;r.stageInfo!==void 0&&e(r.stageInfo)})}setMaxIteration(e){this._configService.setConfig(a.ENGINE_FORMULA_CYCLE_REFERENCE_COUNT,e)}executeFormulas(e,t){this._commandService.executeCommand(a.SetFormulaStringBatchCalculationMutation.id,{formulas:e},{onlyLocal:!0});const r=this._commandService.onCommandExecuted(i=>{if(i.id!==a.SetFormulaStringBatchCalculationResultMutation.id)return;const n=i.params;n.result!=null&&t(n.result),r.dispose()})}getAllDependencyTrees(e){this._commandService.executeCommand(a.SetFormulaDependencyCalculationMutation.id,void 0,{onlyLocal:!0});const t=this._commandService.onCommandExecuted(r=>{if(r.id!==a.SetFormulaDependencyCalculationResultMutation.id)return;const i=r.params;i.result!=null&&e(i.result),t.dispose()})}getCellDependencyTree(e,t){this._commandService.executeCommand(a.SetCellFormulaDependencyCalculationMutation.id,e,{onlyLocal:!0});const r=this._commandService.onCommandExecuted(i=>{if(i.id!==a.SetCellFormulaDependencyCalculationResultMutation.id)return;const n=i.params;n.result!==void 0&&t(n.result),r.dispose()})}};exports.FFormula=p([l(0,u.Inject(u.ICommandService)),l(1,u.Inject(u.Injector)),l(2,u.Inject(a.LexerTreeBuilder)),l(3,u.IConfigService)],exports.FFormula);class C extends s.FUniver{getFormula(){return this._injector.createInstance(exports.FFormula)}}s.FUniver.extend(C);
|