Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
fix(sheets-data-validation): data-validation formula-error (#4606)
zhangw0d6c8b40dc9f
diff --git a/e2e/visual-comparison/sheets/sheets-visual-comparison.spec.ts-snapshots/demo-sheet-ci-chromium-linux.png b/e2e/visual-comparison/sheets/sheets-visual-comparison.spec.ts-snapshots/demo-sheet-ci-chromium-linux.pngindex 4a6de9231e..77ee4f123e 100644Binary files a/e2e/visual-comparison/sheets/sheets-visual-comparison.spec.ts-snapshots/demo-sheet-ci-chromium-linux.png and b/e2e/visual-comparison/sheets/sheets-visual-comparison.spec.ts-snapshots/demo-sheet-ci-chromium-linux.png differdiff --git a/mockdata/src/sheets/demo/default-workbook-data-demo.ts b/mockdata/src/sheets/demo/default-workbook-data-demo.tsindex 130253a071..3f34591475 100644--- a/mockdata/src/sheets/demo/default-workbook-data-demo.ts+++ b/mockdata/src/sheets/demo/default-workbook-data-demo.ts@@ -14027,6 +14027,9 @@ export const DEFAULT_WORKBOOK_DATA_DEMO: IWorkbookData = {},},4: {+ 5: {+ v: 2,+ },10: {v: 123,},diff --git a/packages/sheets-data-validation/src/plugin.ts b/packages/sheets-data-validation/src/plugin.tsindex 03bd8762c9..0fbcde7630 100644--- a/packages/sheets-data-validation/src/plugin.ts+++ b/packages/sheets-data-validation/src/plugin.ts@@ -14,16 +14,16 @@* limitations under the License.*/+import type { Dependency } from '@univerjs/core';import type { IUniverSheetsDataValidationConfig } from './controllers/config.schema';import {DependentOn,ICommandService,IConfigService,- merge,- Plugin,- UniverInstanceType,+ Inject,+ Injector,+ merge, Plugin, UniverInstanceType,} from '@univerjs/core';-import { type Dependency, Inject, Injector } from '@univerjs/core';import { UniverDataValidationPlugin } from '@univerjs/data-validation';import {AddSheetDataValidationCommand,@@ -99,6 +99,7 @@ export class UniverSheetsDataValidationPlugin extends Plugin {this._injector.get(DataValidationCacheService);this._injector.get(SheetsDataValidationValidatorService);+ this._injector.get(DataValidationController);this._injector.get(DataValidationFormulaRefRangeController);this._injector.get(DataValidationRefRangeController);}@@ -108,7 +109,6 @@ export class UniverSheetsDataValidationPlugin extends Plugin {}override onRendered(): void {- this._injector.get(DataValidationController);this._injector.get(DataValidationFormulaController);}}diff --git a/packages/sheets-formula/src/services/register-other-formula.service.ts b/packages/sheets-formula/src/services/register-other-formula.service.tsindex d6def09aab..ac903cf474 100644--- a/packages/sheets-formula/src/services/register-other-formula.service.ts+++ b/packages/sheets-formula/src/services/register-other-formula.service.ts@@ -17,11 +17,12 @@import type { IRange, Nullable } from '@univerjs/core';import type { IRemoveOtherFormulaMutationParams, ISetFormulaCalculationResultMutation, ISetOtherFormulaMutationParams } from '@univerjs/engine-formula';import type { IOtherFormulaMarkDirtyParams } from '../commands/mutations/formula.mutation';+import type { IOtherFormulaResult } from './formula-common';import { Disposable, ICommandService, Inject, LifecycleService, ObjectMatrix, Tools } from '@univerjs/core';import { IActiveDirtyManagerService, RemoveOtherFormulaMutation, SetFormulaCalculationResultMutation, SetOtherFormulaMutation } from '@univerjs/engine-formula';import { BehaviorSubject, bufferWhen, filter, Subject } from 'rxjs';import { OtherFormulaMarkDirty } from '../commands/mutations/formula.mutation';-import { FormulaResultStatus, type IOtherFormulaResult } from './formula-common';+import { FormulaResultStatus } from './formula-common';export class RegisterOtherFormulaService extends Disposable {private _formulaCacheMap: Map<string, Map<string, Map<string, IOtherFormulaResult>>> = new Map();diff --git a/packages/sheets/src/facade/f-univer.ts b/packages/sheets/src/facade/f-univer.tsindex 447cb10bba..685f087c53 100644--- a/packages/sheets/src/facade/f-univer.ts+++ b/packages/sheets/src/facade/f-univer.ts@@ -20,7 +20,7 @@ import type { IBeforeSheetCreateEventParams, ISheetCreatedEventParams } from './import type { FRange } from './f-range';import type { FWorksheet } from './f-worksheet';import { CanceledError, FUniver, ICommandService, IUniverInstanceService, toDisposable, UniverInstanceType } from '@univerjs/core';-import { COMMAND_LISTENER_VALUE_CHANGE, getValueChangedEffectedRange, InsertSheetCommand, RemoveSheetCommand, SetGridlinesColorCommand, SetTabColorCommand, SetWorksheetActivateCommand, SetWorksheetHideCommand, SetWorksheetNameCommand, SetWorksheetOrderCommand, ToggleGridlinesCommand } from '@univerjs/sheets';+import { COMMAND_LISTENER_VALUE_CHANGE, getValueChangedEffectedRange, InsertSheetCommand, RemoveSheetCommand, SetGridlinesColorCommand, SetTabColorCommand, SetWorksheetActiveOperation, SetWorksheetHideCommand, SetWorksheetNameCommand, SetWorksheetOrderCommand, ToggleGridlinesCommand } from '@univerjs/sheets';import { FDefinedNameBuilder } from './f-defined-name';import { FPermission } from './f-permission';import { FWorkbook } from './f-workbook';@@ -237,7 +237,7 @@ export class FUniverSheetsMixin extends FUniver implements IFUniverSheetsMixin {}break;}- case SetWorksheetActivateCommand.id: {+ case SetWorksheetActiveOperation.id: {if (!this._eventListend(this.Event.BeforeActiveSheetChange)) return;const { subUnitId: sheetId, unitId } = commandInfo.params as ISetWorksheetActivateCommandParams;const workbook = unitId ? this.getUniverSheet(unitId) : this.getActiveWorkbook?.();@@ -358,7 +358,7 @@ export class FUniverSheetsMixin extends FUniver implements IFUniverSheetsMixin {);break;}- case SetWorksheetActivateCommand.id: {+ case SetWorksheetActiveOperation.id: {if (!this._eventListend(this.Event.ActiveSheetChanged)) return;const target = this.getActiveSheet();if (!target) return;