diff --git a/package.json b/package.json index 53fc9df..dede83a 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,8 @@ "@univerjs/sheets-conditional-formatting": "0.4.0", "@univerjs/sheets-conditional-formatting-ui": "0.4.0", "@univerjs/sheets-crosshair-highlight": "0.4.0", + "@univerjs/sheets-data-validation": "^0.4.0", + "@univerjs/sheets-data-validation-ui": "^0.4.0", "@univerjs/sheets-drawing": "0.4.0", "@univerjs/sheets-drawing-ui": "0.4.0", "@univerjs/sheets-filter": "0.4.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e00f3ce..8b9ac3a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -101,6 +101,12 @@ importers: '@univerjs/sheets-crosshair-highlight': specifier: 0.4.0 version: 0.4.0(@grpc/grpc-js@1.11.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rxjs@7.8.1)(typescript@5.6.2) + '@univerjs/sheets-data-validation': + specifier: ^0.4.0 + version: 0.4.0(@grpc/grpc-js@1.11.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rxjs@7.8.1)(typescript@5.6.2) + '@univerjs/sheets-data-validation-ui': + specifier: ^0.4.0 + version: 0.4.0(@grpc/grpc-js@1.11.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rxjs@7.8.1)(typescript@5.6.2) '@univerjs/sheets-drawing': specifier: 0.4.0 version: 0.4.0(@univerjs/core@0.4.0(@grpc/grpc-js@1.11.3)(react@18.3.1)(rxjs@7.8.1))(@univerjs/drawing@0.4.0(@grpc/grpc-js@1.11.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rxjs@7.8.1)) diff --git a/src/setup-univer.ts b/src/setup-univer.ts index 91a9425..167e841 100644 --- a/src/setup-univer.ts +++ b/src/setup-univer.ts @@ -16,6 +16,7 @@ import '@univerjs-pro/sheets-pivot-ui/lib/index.css' import '@univerjs/thread-comment-ui/lib/index.css' import '@univerjs/sheets-crosshair-highlight/lib/index.css' import '@univerjs/find-replace/lib/index.css' +import '@univerjs/sheets-data-validation-ui/lib/index.css' import { IAuthzIoService, IConfigService, IUndoRedoService, LocaleType, LogLevel, Univer, UniverInstanceType } from '@univerjs/core' import { defaultTheme } from '@univerjs/design' @@ -54,6 +55,10 @@ import { UniverSheetsDrawingPlugin } from '@univerjs/sheets-drawing' import { UniverSheetsDrawingUIPlugin } from '@univerjs/sheets-drawing-ui' // #endregion +import { UniverDataValidationPlugin } from '@univerjs/data-validation' +import { UniverSheetsDataValidationPlugin } from '@univerjs/sheets-data-validation' +import { UniverSheetsDataValidationUIPlugin } from '@univerjs/sheets-data-validation-ui' + import { HTTPService } from '@univerjs/network' import { locales } from './locale' @@ -113,6 +118,15 @@ export function setupUniver() { univer.registerPlugin(UniverFindReplacePlugin) univer.registerPlugin(UniverSheetsFindReplacePlugin) + univer.registerPlugin(UniverDataValidationPlugin) + + univer.registerPlugin(UniverSheetsDataValidationPlugin) + + univer.registerPlugin(UniverSheetsDataValidationUIPlugin, { + // Whether to show the edit button in the dropdown menu + showEditOnDropdown: true, + }) + const injector = univer.__getInjector() const configService = injector.get(IConfigService)