@univerjs/sheets-formula v0.4.2 • 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,
_injector): UpdateFormulaController
Parameters
Parameter | Type |
---|---|
_univerInstanceService | IUniverInstanceService |
_commandService | ICommandService |
_lexerTreeBuilder | LexerTreeBuilder |
_formulaDataModel | FormulaDataModel |
_sheetInterceptorService | SheetInterceptorService |
_definedNamesService | IDefinedNamesService |
_injector | Injector |
Returns
Overrides
Defined in
packages/sheets-formula/src/controllers/update-formula.controller.ts:84 (opens in a new tab)
Properties
Property | Modifier | Type | Default value | Inherited from | Defined in |
---|---|---|---|---|---|
_disposed | protected | boolean | false | Disposable ._disposed | packages/core/src/shared/lifecycle.ts:93 (opens in a new tab) |
_injector | readonly | Injector | undefined | - | packages/sheets-formula/src/controllers/update-formula.controller.ts:91 (opens in a new tab) |
Methods
dispose()
dispose(): void
Returns
void
Inherited from
Defined in
packages/core/src/shared/lifecycle.ts:106 (opens in a new tab)
disposeWithMe()
disposeWithMe(disposable): IDisposable
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
Defined in
packages/core/src/shared/lifecycle.ts:96 (opens in a new tab)
ensureNotDisposed()
protected ensureNotDisposed(): void
Returns
void
Inherited from
Defined in
packages/core/src/shared/lifecycle.ts:100 (opens in a new tab)