Some checks failed
📦 Build / build (push) Has been cancelled
🧪 CI Test / test shard (1/4) (push) Has been cancelled
🧪 CI Test / test shard (2/4) (push) Has been cancelled
🧪 CI Test / test shard (3/4) (push) Has been cancelled
🧪 CI Test / test shard (4/4) (push) Has been cancelled
🧪 CI Test / test (push) Has been cancelled
🧪 CI Test / eslint (push) Has been cancelled
🧪 CI Test / typecheck (push) Has been cancelled
🔫 Sync to Pro / dispatch-sync (push) Has been cancelled
🔮 Sync Mirror / sync (push) Has been cancelled
51 lines
1.9 KiB
Markdown
51 lines
1.9 KiB
Markdown
# @univerjs/sheets-conditional-formatting
|
|
|
|
[](https://npmjs.com/package/@univerjs/sheets-conditional-formatting)
|
|
[](https://npmjs.com/package/@univerjs/sheets-conditional-formatting)
|
|
[](https://npmjs.com/package/@univerjs/sheets-conditional-formatting)
|
|
|
|
`@univerjs/sheets-conditional-formatting` adds the core conditional formatting model, commands, and calculation support for Univer Sheets.
|
|
|
|
## Package Overview
|
|
|
|
| Package | UMD global | CSS | Locales | Facade entry |
|
|
| --- | --- | :---: | :---: | :---: |
|
|
| `@univerjs/sheets-conditional-formatting` | `UniverSheetsConditionalFormatting` | No | Yes | Yes |
|
|
|
|
## Installation
|
|
|
|
```sh
|
|
pnpm add @univerjs/sheets-conditional-formatting
|
|
# or
|
|
npm install @univerjs/sheets-conditional-formatting
|
|
```
|
|
|
|
Keep all `@univerjs/*` packages on the same version.
|
|
|
|
## Usage
|
|
|
|
```ts
|
|
import { LocaleType, mergeLocales, Univer } from '@univerjs/core';
|
|
import { UniverSheetsConditionalFormattingPlugin } from '@univerjs/sheets-conditional-formatting';
|
|
import EnUS from '@univerjs/sheets-conditional-formatting/locale/en-US';
|
|
|
|
const univer = new Univer({
|
|
locale: LocaleType.EN_US,
|
|
locales: {
|
|
[LocaleType.EN_US]: mergeLocales(EnUS),
|
|
},
|
|
});
|
|
|
|
univer.registerPlugin(UniverSheetsConditionalFormattingPlugin);
|
|
```
|
|
|
|
## Integration Notes
|
|
|
|
Use this package with `@univerjs/sheets-conditional-formatting-ui` when users need menus and rule-management panels.
|
|
|
|
## Resources
|
|
|
|
- [Documentation](https://docs.univer.ai)
|
|
- [NPM package](https://npmjs.com/package/@univerjs/sheets-conditional-formatting)
|
|
- [GitHub repository](https://github.com/dream-num/univer)
|