Skip to content

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.

2.0 KB
Raw Blame

@univerjs/sheets-data-validation

npm version license downloads

@univerjs/sheets-data-validation connects shared data validation rules to Univer Sheets and provides sheet-specific commands, services, and Facade APIs.

Package Overview

Package UMD global CSS Locales Facade entry Worker entry
@univerjs/sheets-data-validation UniverSheetsDataValidation No Yes Yes No

Installation

pnpm add @univerjs/sheets-data-validation
# or
npm install @univerjs/sheets-data-validation

Usage

Start with the integration setup for your document type, including its required plugins, styles, and locale resources. The snippet below assumes that setup is complete.

import { LocaleType, mergeLocales, Univer } from '@univerjs/core';
import { UniverSheetsDataValidationPlugin } from '@univerjs/sheets-data-validation';
import EnUS from '@univerjs/sheets-data-validation/locale/en-US';

const univer = new Univer({
    locale: LocaleType.EN_US,
    locales: {
        [LocaleType.EN_US]: mergeLocales(EnUS),
    },
});

univer.registerPlugin(UniverSheetsDataValidationPlugin);

Integration Notes

Use this package with @univerjs/sheets-data-validation-ui when users need validation dialogs, dropdowns, and error UI.

  • Import @univerjs/sheets-data-validation/facade when using this package through Univer Facade APIs.

Resources