@univerjs/sheets-formula v0.5.0-beta.1 • Docs
Class: UpdateFormulaController
Update formula process
-
Command intercepts, converts the command information to adapt refRange, offsets the formula content, and obtains the formula that requires offset content.
-
Use refRange to offset the formula position and return undo/redo data to setRangeValues mutation
- Redo data: Delete the old value at the old position on the match, and add the new value at the new position (the new value first checks whether the old position has offset content, if so, use the new offset content, if not, take the old value)
- Undo data: the old position on the match saves the old value, and the new position delete value. Using undos when undoing will operate the data after the offset position.
-
onCommandExecuted, before formula calculation, use the setRangeValues information to delete the old formulaData, ArrayFormula and ArrayFormulaCellData, and send the worker (complementary setRangeValues after collaborative conflicts, normal operation triggers formula update, undo/redo are captured and processed here)
Extends
Constructors
new UpdateFormulaController()
new UpdateFormulaController(
_univerInstanceService,
_commandService,
_lexerTreeBuilder,
_formulaDataModel,
_sheetInterceptorService,
_definedNamesService,
_configService,
_injector): UpdateFormulaController
Parameters
Parameter | Type |
---|---|
_univerInstanceService | IUniverInstanceService |
_commandService | ICommandService |
_lexerTreeBuilder | LexerTreeBuilder |
_formulaDataModel | FormulaDataModel |
_sheetInterceptorService | SheetInterceptorService |
_definedNamesService | IDefinedNamesService |
_configService | IConfigService |
_injector | Injector |
Returns
Overrides
Defined in
submodules/univer/packages/sheets-formula/src/controllers/update-formula.controller.ts:88
Properties
Property | Modifier | Type | Default value | Inherited from | Defined in |
---|---|---|---|---|---|
_disposed | protected | boolean | false | Disposable ._disposed | submodules/univer/packages/core/src/shared/lifecycle.ts:93 |
_injector | readonly | Injector | undefined | - | submodules/univer/packages/sheets-formula/src/controllers/update-formula.controller.ts:96 |
Methods
dispose()
dispose(): void
Returns
void
Inherited from
Defined in
submodules/univer/packages/core/src/shared/lifecycle.ts:106
disposeWithMe()
disposeWithMe(disposable): IDisposable
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
Defined in
submodules/univer/packages/core/src/shared/lifecycle.ts:96
ensureNotDisposed()
protected ensureNotDisposed(): void
Returns
void
Inherited from
Defined in
submodules/univer/packages/core/src/shared/lifecycle.ts:100