@univerjs/engine-formula 0.24.0 → 0.25.0-insiders.20260608-e4336f7
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 +4 -5
- package/lib/cjs/index.js +225 -53
- package/lib/es/facade.js +4 -5
- package/lib/es/index.js +226 -54
- package/lib/facade.js +4 -5
- package/lib/index.js +226 -54
- package/lib/types/basics/common.d.ts +9 -3
- package/lib/types/commands/mutations/set-super-table.mutation.d.ts +1 -0
- package/lib/types/engine/analysis/lexer-tree-builder.d.ts +2 -2
- package/lib/types/engine/utils/compare.d.ts +0 -1
- package/lib/types/facade/f-formula.d.ts +2 -3
- package/lib/types/functions/text/textsplit/index.d.ts +0 -1
- package/lib/types/index.d.ts +1 -1
- package/lib/types/services/active-dirty-manager.service.d.ts +3 -2
- package/lib/types/services/current-data.service.d.ts +8 -4
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +2 -2
- package/package.json +5 -5
- package/LICENSE +0 -176
- package/lib/types/basics/is-null-cell.d.ts +0 -22
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { IUnitRange, LocaleType, Nullable } from '@univerjs/core';
|
|
17
|
-
import type { IArrayFormulaRangeType, IDirtyUnitFeatureMap, IDirtyUnitOtherFormulaMap,
|
|
17
|
+
import type { IArrayFormulaRangeType, IDirtyUnitDefinedNameMap, IDirtyUnitFeatureMap, IDirtyUnitOtherFormulaMap, IDirtyUnitSheetNameMap, IDirtyUnitSuperTableMap, IFormulaData, IFormulaDatasetConfig, IRuntimeUnitDataType, IUnitData, IUnitExcludedCell, IUnitRowData, IUnitSheetIdToNameMap, IUnitSheetNameMap, IUnitStylesData } from '../basics/common';
|
|
18
18
|
import { Disposable, IUniverInstanceService, LocaleService } from '@univerjs/core';
|
|
19
19
|
import { FormulaDataModel } from '../models/formula-data.model';
|
|
20
20
|
import { ISheetRowFilteredService } from './sheet-row-filtered.service';
|
|
@@ -22,7 +22,8 @@ export interface IFormulaDirtyData {
|
|
|
22
22
|
forceCalculation: boolean;
|
|
23
23
|
dirtyRanges: IUnitRange[];
|
|
24
24
|
dirtyNameMap: IDirtyUnitSheetNameMap;
|
|
25
|
-
dirtyDefinedNameMap:
|
|
25
|
+
dirtyDefinedNameMap: IDirtyUnitDefinedNameMap;
|
|
26
|
+
dirtySuperTableMap?: IDirtyUnitSuperTableMap;
|
|
26
27
|
dirtyUnitFeatureMap: IDirtyUnitFeatureMap;
|
|
27
28
|
dirtyUnitOtherFormulaMap: IDirtyUnitOtherFormulaMap;
|
|
28
29
|
clearDependencyTreeCache: IDirtyUnitSheetNameMap;
|
|
@@ -42,7 +43,8 @@ export interface IFormulaCurrentConfigService {
|
|
|
42
43
|
isForceCalculate(): boolean;
|
|
43
44
|
getDirtyRanges(): IUnitRange[];
|
|
44
45
|
getDirtyNameMap(): IDirtyUnitSheetNameMap;
|
|
45
|
-
getDirtyDefinedNameMap():
|
|
46
|
+
getDirtyDefinedNameMap(): IDirtyUnitDefinedNameMap;
|
|
47
|
+
getDirtySuperTableMap(): IDirtyUnitSuperTableMap;
|
|
46
48
|
getDirtyUnitFeatureMap(): IDirtyUnitFeatureMap;
|
|
47
49
|
registerUnitData(unitData: IUnitData): void;
|
|
48
50
|
registerFormulaData(formulaData: IFormulaData): void;
|
|
@@ -90,6 +92,7 @@ export declare class FormulaCurrentConfigService extends Disposable implements I
|
|
|
90
92
|
private _dirtyRanges;
|
|
91
93
|
private _dirtyNameMap;
|
|
92
94
|
private _dirtyDefinedNameMap;
|
|
95
|
+
private _dirtySuperTableMap;
|
|
93
96
|
private _dirtyUnitFeatureMap;
|
|
94
97
|
private _dirtyUnitOtherFormulaMap;
|
|
95
98
|
private _excludedCell;
|
|
@@ -112,7 +115,8 @@ export declare class FormulaCurrentConfigService extends Disposable implements I
|
|
|
112
115
|
isForceCalculate(): boolean;
|
|
113
116
|
getDirtyRanges(): IUnitRange[];
|
|
114
117
|
getDirtyNameMap(): IDirtyUnitSheetNameMap;
|
|
115
|
-
getDirtyDefinedNameMap():
|
|
118
|
+
getDirtyDefinedNameMap(): IDirtyUnitDefinedNameMap;
|
|
119
|
+
getDirtySuperTableMap(): IDirtyUnitSuperTableMap;
|
|
116
120
|
getDirtyUnitFeatureMap(): IDirtyUnitFeatureMap;
|
|
117
121
|
getDirtyUnitOtherFormulaMap(): IDirtyUnitOtherFormulaMap;
|
|
118
122
|
getSheetName(unitId: string, sheetId: string): string;
|
package/lib/umd/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@univerjs/core/facade"),require("@univerjs/core"),require("@univerjs/engine-formula"),require("rxjs")):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/core/facade`,`@univerjs/core`,`@univerjs/engine-formula`,`rxjs`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverEngineFormulaFacade={},e.UniverCoreFacade,e.UniverCore,e.UniverEngineFormula,e.rxjs))})(this,function(e,t,n,r,i){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function a(e,t){return function(n,r){t(n,r,e)}}function o(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let s=class extends t.FBase{constructor(e,t,n,r,i,a,o){super(),this._commandService=e,this._injector=t,this._lexerTreeBuilder=n,this._configService=r,this._functionService=i,this._definedNamesService=a,this._superTableService=o,this._initialize()}_initialize(){}get lexerTreeBuilder(){return this._lexerTreeBuilder}moveFormulaRefOffset(e,t,n,r){return this._lexerTreeBuilder.moveFormulaRefOffset(e,t,n,r)}sequenceNodesBuilder(e){return this._lexerTreeBuilder.sequenceNodesBuilder(e)||[]}executeCalculation(){this._commandService.executeCommand(r.SetTriggerFormulaCalculationStartMutation.id,{commands:[],forceCalculation:!0},{onlyLocal:!0})}stopCalculation(){this._commandService.executeCommand(r.SetFormulaCalculationStopMutation.id,{})}calculationStart(e){return this._commandService.onCommandExecuted(t=>{if(t.id===r.SetFormulaCalculationStartMutation.id){let n=t.params;e(n.forceCalculation)}})}calculationEnd(e){return this._commandService.onCommandExecuted(t=>{if(t.id!==r.SetFormulaCalculationNotificationMutation.id)return;let n=t.params;n.functionsExecutedState!==void 0&&e(n.functionsExecutedState)})}whenComputingCompleteAsync(e){let t=this._injector.get(r.GlobalComputingStatusService);return t.computingStatus?Promise.resolve(!0):(0,i.firstValueFrom)((0,i.race)(t.computingStatus$.pipe((0,i.filter)(e=>e)),(0,i.timer)(e==null?3e4:e).pipe((0,i.map)(()=>!1))))}onCalculationEnd(){return new Promise((e,t)=>{let n=setTimeout(()=>{t(Error(`Calculation end timeout`))},3e4),r=this.calculationEnd(()=>{clearTimeout(n),r.dispose(),e()})})}calculationProcessing(e){return this._commandService.onCommandExecuted(t=>{if(t.id!==r.SetFormulaCalculationNotificationMutation.id)return;let n=t.params;n.stageInfo!==void 0&&e(n.stageInfo)})}setMaxIteration(e){this._configService.setConfig(r.ENGINE_FORMULA_CYCLE_REFERENCE_COUNT,e)}executeFormulas(e,t=3e4){return new Promise((n,i)=>{let a=this._commandService.onCommandExecuted(e=>{if(e.id!==r.SetFormulaStringBatchCalculationResultMutation.id)return;let t=e.params;clearTimeout(o),a.dispose(),t.result==null?i(Error(`Formula batch calculation returned no result`)):n(t.result)}),o=setTimeout(()=>{a.dispose(),i(Error(`Formula batch calculation timeout`))},t);this._commandService.executeCommand(r.SetFormulaStringBatchCalculationMutation.id,{formulas:e},{onlyLocal:!0})})}getAllDependencyTrees(e=3e4){return new Promise((t,n)=>{let i=this._commandService.onCommandExecuted(e=>{if(e.id!==r.SetFormulaDependencyCalculationResultMutation.id)return;let n=e.params;clearTimeout(a),i.dispose(),n.result==null?t([]):t(n.result)}),a=setTimeout(()=>{i.dispose(),n(Error(`Formula dependency calculation timeout`))},e);this._commandService.executeCommand(r.SetFormulaDependencyCalculationMutation.id,void 0,{onlyLocal:!0})})}getCellDependencyTree(e,t=3e4){return new Promise((n,i)=>{let a=this._commandService.onCommandExecuted(e=>{if(e.id!==r.SetCellFormulaDependencyCalculationResultMutation.id)return;let t=e.params;clearTimeout(o),a.dispose(),n(t.result)}),o=setTimeout(()=>{a.dispose(),i(Error(`Cell dependency calculation timeout`))},t);this._commandService.executeCommand(r.SetCellFormulaDependencyCalculationMutation.id,e,{onlyLocal:!0})})}getRangeDependents(e,t=3e4){return new Promise((n,i)=>{let a=this._commandService.onCommandExecuted(e=>{if(e.id!==r.SetQueryFormulaDependencyResultMutation.id)return;let t=e.params;clearTimeout(o),a.dispose(),t.result==null?n([]):n(t.result)}),o=setTimeout(()=>{a.dispose(),i(Error(`Range dependents calculation timeout`))},t);this._commandService.executeCommand(r.SetQueryFormulaDependencyMutation.id,{unitRanges:e},{onlyLocal:!0})})}getInRangeFormulas(e,t=3e4){return new Promise((n,i)=>{let a=this._commandService.onCommandExecuted(e=>{if(e.id!==r.SetQueryFormulaDependencyResultMutation.id)return;let t=e.params;clearTimeout(o),a.dispose(),t.result==null?n([]):n(t.result)}),o=setTimeout(()=>{a.dispose(),i(Error(`In-range formulas calculation timeout`))},t);this._commandService.executeCommand(r.SetQueryFormulaDependencyMutation.id,{unitRanges:e,isInRange:!0},{onlyLocal:!0})})}setFormulaReturnDependencyTree(e){this._configService.setConfig(r.ENGINE_FORMULA_RETURN_DEPENDENCY_TREE,e)}getFormulaExpressTree(e,t){return this._lexerTreeBuilder.getFormulaExprTree(e,t,this._functionService.hasExecutor.bind(this._functionService),this._definedNamesService.getValueByName.bind(this._definedNamesService),this._superTableService.getTable.bind(this._superTableService))}getRangeDependentsAndInRangeFormulas(e,t=3e4){return new Promise((n,i)=>{let a=this._commandService.onCommandExecuted(e=>{if(e.id!==r.SetQueryFormulaDependencyAllResultMutation.id)return;let t=e.params;clearTimeout(o),a.dispose(),t.result==null?n({dependents:[],inRanges:[]}):n(t.result)}),o=setTimeout(()=>{a.dispose(),i(Error(`Range dependents calculation timeout`))},t);this._commandService.executeCommand(r.SetQueryFormulaDependencyAllMutation.id,{unitRanges:e},{onlyLocal:!0})})}};s=o([a(0,(0,n.Inject)(n.ICommandService)),a(1,(0,n.Inject)(n.Injector)),a(2,(0,n.Inject)(r.LexerTreeBuilder)),a(3,n.IConfigService),a(4,r.IFunctionService),a(5,r.IDefinedNamesService),a(6,r.ISuperTableService)],s);var c=class extends t.FUniver{getFormula(){return this._injector.createInstance(s)}};t.FUniver.extend(c),Object.defineProperty(e,"FFormula",{enumerable:!0,get:function(){return s}})});
|