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
feat: add support for filter by colors (#5501)
wpxp12345645f389b0f73c
diff --git a/common/shared/package.json b/common/shared/package.jsonindex eca4169afc..37b6ffcba8 100644--- a/common/shared/package.json+++ b/common/shared/package.json@@ -46,8 +46,8 @@},"devDependencies": {"@types/fs-extra": "^11.0.4",- "@univerjs/icons": "^0.4.4",- "@univerjs/icons-svg": "^0.4.4",+ "@univerjs/icons": "^0.4.6",+ "@univerjs/icons-svg": "^0.4.6","@univerjs/protocol": "0.1.46"}}diff --git a/examples/package.json b/examples/package.jsonindex 28b87a78d9..ed2839fce6 100644--- a/examples/package.json+++ b/examples/package.json@@ -35,7 +35,7 @@"@univerjs/engine-formula": "workspace:*","@univerjs/engine-render": "workspace:*","@univerjs/find-replace": "workspace:*",- "@univerjs/icons": "0.4.4",+ "@univerjs/icons": "0.4.6","@univerjs/mockdata": "workspace:*","@univerjs/network": "workspace:*","@univerjs/rpc": "workspace:*",diff --git a/packages-experimental/debugger/package.json b/packages-experimental/debugger/package.jsonindex cc08f889a7..0b261ccca8 100644--- a/packages-experimental/debugger/package.json+++ b/packages-experimental/debugger/package.json@@ -61,7 +61,7 @@"@univerjs/design": "workspace:*","@univerjs/docs-drawing-ui": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@univerjs/mockdata": "workspace:*","@univerjs/sheets": "workspace:*","@univerjs/sheets-drawing-ui": "workspace:*",diff --git a/packages-experimental/uni-formula-ui/package.json b/packages-experimental/uni-formula-ui/package.jsonindex 0e0ea557fb..4a502cdf0b 100644--- a/packages-experimental/uni-formula-ui/package.json+++ b/packages-experimental/uni-formula-ui/package.json@@ -71,7 +71,7 @@"@univerjs/docs": "workspace:*","@univerjs/docs-ui": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@univerjs/rpc": "workspace:*","@univerjs/sheets-formula": "workspace:*","@univerjs/sheets-formula-ui": "workspace:*",diff --git a/packages-experimental/uni-sheets-ui/package.json b/packages-experimental/uni-sheets-ui/package.jsonindex 38c21670cd..5ec181f1ff 100644--- a/packages-experimental/uni-sheets-ui/package.json+++ b/packages-experimental/uni-sheets-ui/package.json@@ -64,7 +64,7 @@"@univerjs/design": "workspace:*","@univerjs/docs": "workspace:*","@univerjs/docs-ui": "workspace:*",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@univerjs/sheets": "workspace:*","@univerjs/sheets-drawing-ui": "workspace:*","@univerjs/sheets-ui": "workspace:*",diff --git a/packages-experimental/uni-slides-ui/package.json b/packages-experimental/uni-slides-ui/package.jsonindex 1442ac867f..873212b1d9 100644--- a/packages-experimental/uni-slides-ui/package.json+++ b/packages-experimental/uni-slides-ui/package.json@@ -62,7 +62,7 @@"@univerjs/core": "workspace:*","@univerjs/design": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@univerjs/slides-ui": "workspace:*","@univerjs/ui": "workspace:*","@univerjs/uniui": "workspace:*"diff --git a/packages-experimental/uniui/package.json b/packages-experimental/uniui/package.jsonindex 9fbe2ef98c..487f04b778 100644--- a/packages-experimental/uniui/package.json+++ b/packages-experimental/uniui/package.json@@ -65,7 +65,7 @@"@univerjs/core": "workspace:*","@univerjs/design": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@univerjs/sheets": "workspace:*","@univerjs/sheets-ui": "workspace:*","@univerjs/ui": "workspace:*",diff --git a/packages/action-recorder/package.json b/packages/action-recorder/package.jsonindex d3cd18d7bf..d8ce9ae5e9 100644--- a/packages/action-recorder/package.json+++ b/packages/action-recorder/package.json@@ -68,7 +68,7 @@"dependencies": {"@univerjs/core": "workspace:*","@univerjs/design": "workspace:*",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@univerjs/sheets": "workspace:*","@univerjs/sheets-filter": "workspace:*","@univerjs/sheets-ui": "workspace:*",diff --git a/packages/core/src/sheets/worksheet.ts b/packages/core/src/sheets/worksheet.tsindex 56576ffd0e..43d144b832 100644--- a/packages/core/src/sheets/worksheet.ts+++ b/packages/core/src/sheets/worksheet.ts@@ -253,6 +253,7 @@ export class Worksheet {** @param {number} row The row index of the cell* @param {number} col The column index of the cell+ * @param {boolean} [rowPriority] If true, row style will precede column style, otherwise use this._isRowStylePrecedeColumnStyle* @returns {IStyleData} The composed style of the cell*/getComposedCellStyle(row: number, col: number, rowPriority?: boolean): IStyleData {@@ -266,6 +267,27 @@ export class Worksheet {: composeStyles(defaultStyle, rowStyle, colStyle, cell?.themeStyle, cellStyle);}+ /**+ * Get the composed style of the cell. If you want to get the style of the cell without merging row style,+ * col style and default style, please use {@link getCellStyle} instead.+ * For performance reason, if you already have the cell data, you can use this method to avoid getting the cell data again.+ *+ * @param {number} row The row index of the cell+ * @param {number} col The column index of the cell+ * @param {Nullable<ICellDataForSheetInterceptor>} cellData The cell data of the cell.+ * @param {boolean} [rowPriority] If true, row style will precede column style, otherwise use this._isRowStylePrecedeColumnStyle+ * @returns {IStyleData} The composed style of the cell+ */+ getComposedCellStyleByCellData(row: number, col: number, cellData: Nullable<ICellDataForSheetInterceptor>, rowPriority?: boolean): IStyleData {+ const defaultStyle = this.getDefaultCellStyleInternal();+ const rowStyle = this.getRowStyle(row);+ const colStyle = this.getColumnStyle(col);+ const cellStyle = this._styles.getStyleByCell(cellData);+ return (rowPriority ?? this._isRowStylePrecedeColumnStyle)+ ? composeStyles(defaultStyle, colStyle, rowStyle, cellData?.themeStyle, cellStyle)+ : composeStyles(defaultStyle, rowStyle, colStyle, cellData?.themeStyle, cellStyle);+ }+/*** Returns WorkSheet Cell Data Matrix* @returns WorkSheet Cell Data Matrix@@ -1236,7 +1258,7 @@ export class Worksheet {* Only used for cell edit, and no need to rotate text when edit cell content!*/getBlankCellDocumentModel(cell: Nullable<ICellData>, row: number, column: number): IDocumentLayoutObject {- const style = this.getComposedCellStyle(row, column);+ const style = this.getComposedCellStyleByCellData(row, column, cell);const textStyle = getFontFormat(style);const documentModelObject = this.getCellDocumentModel(cell, style, { ignoreTextRotation: true });@@ -1274,7 +1296,7 @@ export class Worksheet {// Only used for cell edit, and no need to rotate text when edit cell content!getCellDocumentModelWithFormula(cell: ICellData, row: number, column: number): Nullable<IDocumentLayoutObject> {- const style = this.getComposedCellStyle(row, column);+ const style = this.getComposedCellStyleByCellData(row, column, cell);return this.getCellDocumentModel(cell, style, {isDeepClone: true,displayRawFormula: true,diff --git a/packages/design/package.json b/packages/design/package.jsonindex 7a53d9f01f..6bd68466c5 100644--- a/packages/design/package.json+++ b/packages/design/package.json@@ -76,7 +76,7 @@"@radix-ui/react-slot": "^1.2.3","@radix-ui/react-tooltip": "^1.2.7","@rc-component/trigger": "^2.2.6",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@univerjs/themes": "workspace:*","class-variance-authority": "^0.7.1","clsx": "^2.1.1",diff --git a/packages/docs-hyper-link-ui/package.json b/packages/docs-hyper-link-ui/package.jsonindex 2a897fdfc7..abd57ccdfa 100644--- a/packages/docs-hyper-link-ui/package.json+++ b/packages/docs-hyper-link-ui/package.json@@ -72,7 +72,7 @@"@univerjs/docs-hyper-link": "workspace:*","@univerjs/docs-ui": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@univerjs/ui": "workspace:*"},"devDependencies": {diff --git a/packages/docs-quick-insert-ui/package.json b/packages/docs-quick-insert-ui/package.jsonindex 838bb97071..01e57f7cee 100644--- a/packages/docs-quick-insert-ui/package.json+++ b/packages/docs-quick-insert-ui/package.json@@ -75,7 +75,7 @@"@univerjs/drawing": "workspace:*","@univerjs/drawing-ui": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@univerjs/ui": "workspace:*"},"devDependencies": {diff --git a/packages/docs-thread-comment-ui/package.json b/packages/docs-thread-comment-ui/package.jsonindex e2eb94b959..915ed4cd7c 100644--- a/packages/docs-thread-comment-ui/package.json+++ b/packages/docs-thread-comment-ui/package.json@@ -64,7 +64,7 @@"@univerjs/docs": "workspace:*","@univerjs/docs-ui": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@univerjs/thread-comment": "workspace:*","@univerjs/thread-comment-ui": "workspace:*","@univerjs/ui": "workspace:*"diff --git a/packages/docs-ui/package.json b/packages/docs-ui/package.jsonindex c2de18be70..1f0719580e 100644--- a/packages/docs-ui/package.json+++ b/packages/docs-ui/package.json@@ -84,7 +84,7 @@"@univerjs/docs": "workspace:*","@univerjs/drawing": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@univerjs/ui": "workspace:*"},"devDependencies": {diff --git a/packages/drawing-ui/package.json b/packages/drawing-ui/package.jsonindex 224119226d..93605c0792 100644--- a/packages/drawing-ui/package.json+++ b/packages/drawing-ui/package.json@@ -70,7 +70,7 @@"@univerjs/design": "workspace:*","@univerjs/drawing": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@univerjs/ui": "workspace:*"},"devDependencies": {diff --git a/packages/engine-render/src/components/sheets/sheet.render-skeleton.ts b/packages/engine-render/src/components/sheets/sheet.render-skeleton.tsindex bf3c7ec8dc..5b3b4fa0a1 100644--- a/packages/engine-render/src/components/sheets/sheet.render-skeleton.ts+++ b/packages/engine-render/src/components/sheets/sheet.render-skeleton.ts@@ -485,7 +485,7 @@ export class SpreadsheetSkeleton extends SheetSkeleton {// TODO@weird94: in future, we should use `getCellRaw` instead of `getCell` to improve performance.const cell = this.worksheet.getCell(row, col);- const style = this.worksheet.getComposedCellStyle(row, col);+ const style = this.worksheet.getComposedCellStyleByCellData(row, col, cell);if (cell?.interceptorAutoHeight) {const cellHeight = cell.interceptorAutoHeight();@@ -742,7 +742,7 @@ export class SpreadsheetSkeleton extends SheetSkeleton {return cellWidth;}}- const style = this.worksheet.getComposedCellStyle(row, column);+ const style = this.worksheet.getComposedCellStyleByCellData(row, column, cell);const modelObject = this.worksheet.getCellDocumentModel(cell, style);if (modelObject == null) {return measuredWidth;@@ -1446,7 +1446,7 @@ export class SpreadsheetSkeleton extends SheetSkeleton {}const cell = this.worksheet.getCell(row, col) || this.worksheet.getCellRaw(row, col);- const style = this.worksheet.getComposedCellStyle(row, col);+ const style = this.worksheet.getComposedCellStyleByCellData(row, col, cell);this._setBgStylesCache(row, col, style, options);this._setBorderStylesCache(row, col, style, options);@@ -1504,7 +1504,7 @@ export class SpreadsheetSkeleton extends SheetSkeleton {const themeStyleBackground = cell.themeStyle?.bd;- const style = this.worksheet.getComposedCellStyle(row, column);+ const style = this.worksheet.getComposedCellStyleByCellData(row, column, cell);if (!style && !themeStyleBackground) {isAddBorders = false;break;diff --git a/packages/find-replace/package.json b/packages/find-replace/package.jsonindex 8ac5bb73ad..812a7d302e 100644--- a/packages/find-replace/package.json+++ b/packages/find-replace/package.json@@ -71,7 +71,7 @@"@univerjs/core": "workspace:*","@univerjs/design": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@univerjs/ui": "workspace:*"},"devDependencies": {diff --git a/packages/sheets-conditional-formatting-ui/package.json b/packages/sheets-conditional-formatting-ui/package.jsonindex a615a11077..b371afd058 100644--- a/packages/sheets-conditional-formatting-ui/package.json+++ b/packages/sheets-conditional-formatting-ui/package.json@@ -72,7 +72,7 @@"@univerjs/design": "workspace:*","@univerjs/engine-formula": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@univerjs/sheets": "workspace:*","@univerjs/sheets-conditional-formatting": "workspace:*","@univerjs/sheets-formula-ui": "workspace:*",diff --git a/packages/sheets-conditional-formatting/package.json b/packages/sheets-conditional-formatting/package.jsonindex 0c0c266335..519bdae65a 100644--- a/packages/sheets-conditional-formatting/package.json+++ b/packages/sheets-conditional-formatting/package.json@@ -80,7 +80,7 @@},"devDependencies": {"@univerjs-infra/shared": "workspace:*",- "@univerjs/icons-svg": "^0.4.4",+ "@univerjs/icons-svg": "^0.4.6","rxjs": "^7.8.2","typescript": "^5.8.3","vite": "^6.3.5",diff --git a/packages/sheets-crosshair-highlight/package.json b/packages/sheets-crosshair-highlight/package.jsonindex 53e38f89c6..37a277bd14 100644--- a/packages/sheets-crosshair-highlight/package.json+++ b/packages/sheets-crosshair-highlight/package.json@@ -80,7 +80,7 @@"@univerjs/core": "workspace:*","@univerjs/design": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@univerjs/sheets": "workspace:*","@univerjs/sheets-ui": "workspace:*","@univerjs/ui": "workspace:*"diff --git a/packages/sheets-data-validation-ui/package.json b/packages/sheets-data-validation-ui/package.jsonindex dd3dc10791..db3365e558 100644--- a/packages/sheets-data-validation-ui/package.json+++ b/packages/sheets-data-validation-ui/package.json@@ -75,7 +75,7 @@"@univerjs/design": "workspace:*","@univerjs/engine-formula": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@univerjs/sheets": "workspace:*","@univerjs/sheets-data-validation": "workspace:*","@univerjs/sheets-formula-ui": "workspace:*",diff --git a/packages/sheets-filter-ui/package.json b/packages/sheets-filter-ui/package.jsonindex f2f2afdc59..fbb6c4d39a 100644--- a/packages/sheets-filter-ui/package.json+++ b/packages/sheets-filter-ui/package.json@@ -69,7 +69,7 @@"@univerjs/core": "workspace:*","@univerjs/design": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@univerjs/rpc": "workspace:*","@univerjs/sheets": "workspace:*","@univerjs/sheets-filter": "workspace:*",diff --git a/packages/sheets-filter-ui/src/commands/operations/sheets-filter.operation.ts b/packages/sheets-filter-ui/src/commands/operations/sheets-filter.operation.tsindex 4abfe1234a..f7eaf15cca 100644--- a/packages/sheets-filter-ui/src/commands/operations/sheets-filter.operation.ts+++ b/packages/sheets-filter-ui/src/commands/operations/sheets-filter.operation.ts@@ -15,11 +15,11 @@*/import type { IOperation } from '@univerjs/core';+import type { FilterBy } from '@univerjs/sheets-filter';import { CommandType, ICommandService, IContextService, Quantity } from '@univerjs/core';import { SheetsFilterService } from '@univerjs/sheets-filter';-import { ILayoutService } from '@univerjs/ui';import { SetCellEditVisibleOperation } from '@univerjs/sheets-ui';-import type { FilterBy } from '../../services/sheets-filter-panel.service';+import { ILayoutService } from '@univerjs/ui';import { SheetsFilterPanelService } from '../../services/sheets-filter-panel.service';export const FILTER_PANEL_OPENED_KEY = 'FILTER_PANEL_OPENED';diff --git a/packages/sheets-filter-ui/src/locale/en-US.ts b/packages/sheets-filter-ui/src/locale/en-US.tsindex 83f7da907e..76ba0650e3 100644--- a/packages/sheets-filter-ui/src/locale/en-US.ts+++ b/packages/sheets-filter-ui/src/locale/en-US.ts@@ -32,6 +32,10 @@ const locale = {cancel: 'Cancel',confirm: 'Confirm','by-values': 'By Values',+ 'by-colors': 'By Colors',+ 'filter-by-cell-fill-color': 'Filter by cell fill color',+ 'filter-by-cell-text-color': 'Filter by cell text color',+ 'filter-by-color-none': 'The column contains only one color','by-conditions': 'By Conditions','filter-only': 'Filter Only','search-placeholder': 'Use space to separate keywords',diff --git a/packages/sheets-filter-ui/src/locale/fa-IR.ts b/packages/sheets-filter-ui/src/locale/fa-IR.tsindex 658d7719de..53c94b408b 100644--- a/packages/sheets-filter-ui/src/locale/fa-IR.ts+++ b/packages/sheets-filter-ui/src/locale/fa-IR.ts@@ -34,6 +34,10 @@ const locale: typeof enUS = {cancel: 'انصراف',confirm: 'تایید','by-values': 'بر اساس مقادیر',+ 'by-colors': 'بر اساس رنگها',+ 'filter-by-cell-fill-color': 'فیلتر بر اساس رنگ پر کردن سلول',+ 'filter-by-cell-text-color': 'فیلتر بر اساس رنگ متن سلول',+ 'filter-by-color-none': 'این ستون فقط شامل یک رنگ است','by-conditions': 'بر اساس شرایط','filter-only': 'فقط فیلتر','search-placeholder': 'برای جداسازی کلیدواژهها از فاصله استفاده کنید',diff --git a/packages/sheets-filter-ui/src/locale/fr-FR.ts b/packages/sheets-filter-ui/src/locale/fr-FR.tsindex 34c49fad34..310a9c01f3 100644--- a/packages/sheets-filter-ui/src/locale/fr-FR.ts+++ b/packages/sheets-filter-ui/src/locale/fr-FR.ts@@ -34,6 +34,10 @@ const locale: typeof enUS = {cancel: 'Annuler',confirm: 'Confirmer','by-values': 'Par valeurs',+ 'by-colors': 'Par couleurs',+ 'filter-by-cell-fill-color': 'Filtrer par couleur de remplissage de cellule',+ 'filter-by-cell-text-color': 'Filtrer par couleur de texte de cellule',+ 'filter-by-color-none': 'Cette colonne ne contient qu\'une seule couleur','by-conditions': 'Par conditions','filter-only': 'Filtrer uniquement','search-placeholder': 'Utilisez un espace pour séparer les mots-clés',diff --git a/packages/sheets-filter-ui/src/locale/ko-KR.ts b/packages/sheets-filter-ui/src/locale/ko-KR.tsindex 6626cc8005..1889a0a4bb 100644--- a/packages/sheets-filter-ui/src/locale/ko-KR.ts+++ b/packages/sheets-filter-ui/src/locale/ko-KR.ts@@ -34,6 +34,10 @@ const locale: typeof enUS = {cancel: '취소',confirm: '확인','by-values': '값으로 필터',+ 'by-colors': '색상으로 필터',+ 'filter-by-cell-fill-color': '셀 채우기 색상으로 필터',+ 'filter-by-cell-text-color': '셀 텍스트 색상으로 필터',+ 'filter-by-color-none': '이 열은 단일 색상만 포함합니다','by-conditions': '조건으로 필터','filter-only': '필터만 보기','search-placeholder': '검색어는 공백으로 구분',diff --git a/packages/sheets-filter-ui/src/locale/ru-RU.ts b/packages/sheets-filter-ui/src/locale/ru-RU.tsindex 793dc8b330..d4c897d0f8 100644--- a/packages/sheets-filter-ui/src/locale/ru-RU.ts+++ b/packages/sheets-filter-ui/src/locale/ru-RU.ts@@ -34,6 +34,10 @@ const locale: typeof enUS = {cancel: 'Отмена',confirm: 'Подтвердить','by-values': 'По значениям',+ 'by-colors': 'По цветам',+ 'filter-by-cell-fill-color': 'Фильтр по цвету заливки ячейки',+ 'filter-by-cell-text-color': 'Фильтр по цвету текста ячейки',+ 'filter-by-color-none': 'Этот столбец содержит только один цвет','by-conditions': 'По условиям','filter-only': 'Только фильтр','search-placeholder': 'Используйте пробел для разделения ключевых слов',diff --git a/packages/sheets-filter-ui/src/locale/vi-VN.ts b/packages/sheets-filter-ui/src/locale/vi-VN.tsindex 68250890c1..5bb0094a53 100644--- a/packages/sheets-filter-ui/src/locale/vi-VN.ts+++ b/packages/sheets-filter-ui/src/locale/vi-VN.ts@@ -34,6 +34,10 @@ const locale: typeof enUS = {cancel: 'Hủy bỏ',confirm: 'Xác nhận','by-values': 'Theo giá trị',+ 'by-colors': 'Theo màu sắc',+ 'filter-by-cell-fill-color': 'Lọc theo màu nền ô',+ 'filter-by-cell-text-color': 'Lọc theo màu chữ ô',+ 'filter-by-color-none': 'Cột này chỉ chứa một màu','by-conditions': 'Theo điều kiện','filter-only': 'Chỉ lọc','search-placeholder': 'Sử dụng khoảng trắng để tách các từ khóa',diff --git a/packages/sheets-filter-ui/src/locale/zh-CN.ts b/packages/sheets-filter-ui/src/locale/zh-CN.tsindex 5b52f5de56..da505d5ffb 100644--- a/packages/sheets-filter-ui/src/locale/zh-CN.ts+++ b/packages/sheets-filter-ui/src/locale/zh-CN.ts@@ -34,6 +34,10 @@ const locale: typeof enUS = {cancel: '取消',confirm: '确认','by-values': '按值',+ 'by-colors': '按颜色',+ 'filter-by-cell-fill-color': '按单元格填充颜色筛选',+ 'filter-by-cell-text-color': '按单元格文本颜色筛选',+ 'filter-by-color-none': '该列仅包含一种颜色','by-conditions': '按条件','filter-only': '仅筛选','search-placeholder': '使用空格分隔关键字',diff --git a/packages/sheets-filter-ui/src/locale/zh-TW.ts b/packages/sheets-filter-ui/src/locale/zh-TW.tsindex 84ee967658..3180132fac 100644--- a/packages/sheets-filter-ui/src/locale/zh-TW.ts+++ b/packages/sheets-filter-ui/src/locale/zh-TW.ts@@ -34,6 +34,10 @@ const locale: typeof enUS = {cancel: '取消',confirm: '確認','by-values': '按值',+ 'by-colors': '按顏色',+ 'filter-by-cell-fill-color': '按單元格填充顏色篩選',+ 'filter-by-cell-text-color': '按單元格文本顏色篩選',+ 'filter-by-color-none': '該列僅包含一種顏色','by-conditions': '按條件','filter-only': '僅篩選','search-placeholder': '使用空格分隔關鍵字',diff --git a/packages/sheets-filter-ui/src/services/__tests__/sheets-filter-panel.service.spec.ts b/packages/sheets-filter-ui/src/services/__tests__/sheets-filter-panel.service.spec.tsindex d6ccf66899..2f4875ab24 100644--- a/packages/sheets-filter-ui/src/services/__tests__/sheets-filter-panel.service.spec.ts+++ b/packages/sheets-filter-ui/src/services/__tests__/sheets-filter-panel.service.spec.ts@@ -22,14 +22,14 @@ import type { IFilterByValueWithTreeItem } from '../sheets-filter-panel.service'import { CommandType, ICommandService, Inject, Injector, LocaleService, Plugin, Univer, UniverInstanceType } from '@univerjs/core';import { ActiveDirtyManagerService, IActiveDirtyManagerService, ISheetRowFilteredService, SheetRowFilteredService } from '@univerjs/engine-formula';import { RefRangeService, SheetInterceptorService, SheetsSelectionsService } from '@univerjs/sheets';-import { CustomFilterOperator, SheetsFilterService, UniverSheetsFilterPlugin } from '@univerjs/sheets-filter';+import { CustomFilterOperator, FilterBy, SheetsFilterService, UniverSheetsFilterPlugin } from '@univerjs/sheets-filter';import { SetSheetsFilterCriteriaCommand } from '@univerjs/sheets-filter/commands/commands/sheets-filter.command.js';import { afterEach, beforeEach, describe, expect, it, vitest } from 'vitest';import { E_ITEMS, ITEMS, ITEMS_WITH_EMPTY, WithCustomFilterModelFactory, WithMergedCellFilterFactory, WithMultiEmptyCellsModelFactory, WithTwoFilterColumnsFactory, WithValuesAndEmptyFilterModelFactory, WithValuesFilterModelFactory } from '../../__testing__/data';import { CloseFilterPanelOperation, OpenFilterPanelOperation } from '../../commands/operations/sheets-filter.operation';import { FilterConditionItems } from '../../models/conditions';import { ExtendCustomFilterOperator } from '../../models/extended-operators';-import { ByConditionsModel, ByValuesModel, FilterBy, SheetsFilterPanelService } from '../sheets-filter-panel.service';+import { ByConditionsModel, ByValuesModel, SheetsFilterPanelService } from '../sheets-filter-panel.service';const SetCellEditVisibleOperation: IOperation<IEditorBridgeServiceVisibleParam> = {id: 'sheet.operation.set-cell-edit-visible',diff --git a/packages/sheets-filter-ui/src/services/sheets-filter-panel.service.ts b/packages/sheets-filter-ui/src/services/sheets-filter-panel.service.tsindex f545fa82ab..508dbfd6ef 100644--- a/packages/sheets-filter-ui/src/services/sheets-filter-panel.service.ts+++ b/packages/sheets-filter-ui/src/services/sheets-filter-panel.service.ts@@ -18,21 +18,16 @@ import type { IDisposable, IRange, Nullable } from '@univerjs/core';import type { FilterColumn, FilterModel, IFilterColumn, ISetSheetsFilterCriteriaCommandParams } from '@univerjs/sheets-filter';import type { Observable } from 'rxjs';import type { FilterOperator, IFilterConditionFormParams, IFilterConditionItem } from '../models/conditions';-import { createIdentifier, Disposable, ICommandService, Inject, Injector, IUniverInstanceService, LocaleService, Quantity, Tools } from '@univerjs/core';+import { ColorKit, createIdentifier, Disposable, ICommandService, Inject, Injector, IUniverInstanceService, LocaleService, Quantity, Tools } from '@univerjs/core';+import { COLOR_BLACK_RGB } from '@univerjs/engine-render';import { RefRangeService } from '@univerjs/sheets';-import { SetSheetsFilterCriteriaCommand } from '@univerjs/sheets-filter';-+import { FilterBy, SetSheetsFilterCriteriaCommand } from '@univerjs/sheets-filter';import { BehaviorSubject, combineLatest, map, merge, of, ReplaySubject, shareReplay, startWith, Subject, throttleTime } from 'rxjs';import { FilterConditionItems } from '../models/conditions';import { statisticFilterByValueItems } from '../models/utils';import { getFilterTreeByValueItems, ISheetsGenerateFilterValuesService } from '../worker/generate-filter-values.service';import { areAllLeafNodesChecked, findObjectByKey, searchTree, updateLeafNodesCheckedStatus } from './util';-export enum FilterBy {- VALUES,- CONDITIONS,-}-export interface IFilterByValueItem {value: string;checked: boolean;@@ -55,6 +50,11 @@ export interface IFilterByValueWithTreeItem {children?: IFilterByValueWithTreeItem[];}+export interface IFilterByColorItem {+ color: string | null;+ checked?: boolean;+}+export interface ISheetsFilterPanelService {/*** Set up the panel to change the filter condition on a specific column.@@ -137,6 +137,12 @@ export class SheetsFilterPanelService extends Disposable {return;}+ if (info.colorFilters) {+ this._hasCriteria$.next(true);+ this._setupByColors(filterModel, col);+ return;+ }+if (info.filters) {this._hasCriteria$.next(true);this._setupByValues(filterModel, col);@@ -159,10 +165,16 @@ export class SheetsFilterPanelService extends Disposable {return false;}- if (filterBy === FilterBy.VALUES) {- this._setupByValues(this._filterModel, this.col);- } else {- this._setupByConditions(this._filterModel, this.col);+ switch (filterBy) {+ case FilterBy.VALUES:+ this._setupByValues(this._filterModel, this.col);+ break;+ case FilterBy.COLORS:+ this._setupByColors(this._filterModel, this.col);+ break;+ case FilterBy.CONDITIONS:+ this._setupByConditions(this._filterModel, this.col);+ break;}return true;@@ -227,6 +239,25 @@ export class SheetsFilterPanelService extends Disposable {return true;}+ private async _setupByColors(filterModel: FilterModel, col: number): Promise<boolean> {+ this._disposePreviousModel();++ const range = filterModel.getRange();+ if (range.startRow === range.endRow) return false;++ const filterByModel = await ByColorsModel.fromFilterColumn(+ this._injector,+ filterModel,+ col+ );++ this.filterByModel = filterByModel;+ this._filterBy$.next(FilterBy.COLORS);++ this._listenToFilterHeaderChange(filterModel, col);+ return true;+ }+private _setupByConditions(filterModel: FilterModel, col: number): boolean {this._disposePreviousModel();@@ -417,7 +448,8 @@ export class ByValuesModel extends Disposable implements IFilterByModel {const range = filterModel.getRange();const column = col;- const filters = filterModel.getFilterColumn(col)?.getColumnData().filters;+ const filterColumn = filterModel.getFilterColumn(col);+ const filters = filterColumn?.getColumnData().filters;const alreadyChecked = new Set(filters?.filters);const blankChecked = !!(filters && filters.blank);const filteredOutRowsByOtherColumns = filterModel.getFilteredOutRowsExceptCol(col);@@ -430,6 +462,7 @@ export class ByValuesModel extends Disposable implements IFilterByModel {unitId,subUnitId,filteredOutRowsByOtherColumns: Array.from(filteredOutRowsByOtherColumns),+ filterColumn,filters: !!filters,blankChecked,iterateRange,@@ -439,7 +472,17 @@ export class ByValuesModel extends Disposable implements IFilterByModel {cache = res.filterTreeMapCache;} else {// the first row is filter header and should be added to options- const res = getFilterTreeByValueItems(!!filters, localeService, iterateRange, worksheet, filteredOutRowsByOtherColumns, alreadyChecked, blankChecked, workbook.getStyles());+ const res = getFilterTreeByValueItems(+ !!filters,+ localeService,+ iterateRange,+ worksheet,+ filteredOutRowsByOtherColumns,+ filterColumn,+ alreadyChecked,+ blankChecked,+ workbook.getStyles()+ );items = res.filterTreeItems;cache = res.filterTreeMapCache;}@@ -634,3 +677,234 @@ export class ByValuesModel extends Disposable implements IFilterByModel {}// #endregion++// #region - ByColorsModel++/**+ * This model would be used to control the "Filter By Colors" panel. It should be reconstructed in the following+ * situations:+ *+ * 1. The target `FilterColumn` object is changed+ * 2. User toggles "Filter By"+ */+export class ByColorsModel extends Disposable implements IFilterByModel {+ /**+ * Create a model with targeting filter column. If there is not a filter column, the model would be created with+ * default values.+ *+ * @param injector+ * @param filterModel+ * @param col+ *+ * @returns the model to control the panel's state+ */+ static async fromFilterColumn(injector: Injector, filterModel: FilterModel, col: number): Promise<ByColorsModel> {+ const univerInstanceService = injector.get(IUniverInstanceService);++ const { unitId, subUnitId } = filterModel;+ const workbook = univerInstanceService.getUniverSheetInstance(unitId);+ if (!workbook) throw new Error(`[ByColorsModel]: Workbook not found for filter model with unitId: ${unitId}!`);++ const worksheet = workbook?.getSheetBySheetId(subUnitId);+ if (!worksheet) throw new Error(`[ByColorsModel]: Worksheet not found for filter model with unitId: ${unitId} and subUnitId: ${subUnitId}!`);++ const range = filterModel.getRange();+ const column = col;+ const colorFilters = filterModel.getFilterColumn(col)?.getColumnData().colorFilters;+ const filteredOutRowsByOtherColumns = filterModel.getFilteredOutRowsExceptCol(col);+ const iterateRange: IRange = { ...range, startRow: range.startRow + 1, startColumn: column, endColumn: column };++ const cellFillColors = new Map<string, IFilterByColorItem>();+ const cellFillColorsChecked = new Set<string | null>(colorFilters?.cellFillColors ?? []);+ const cellTextColors = new Map<string, IFilterByColorItem>();+ const cellTextColorsChecked = new Set<string>(colorFilters?.cellTextColors ?? []);++ for (const cell of worksheet.iterateByColumn(iterateRange, false, true)) {+ const { row, col, value } = cell;++ if (filteredOutRowsByOtherColumns.has(row)) {+ // If the row is filtered out by other columns, we skip it.+ continue;+ }++ const style = worksheet.getComposedCellStyleByCellData(row, col, value);++ if (style.bg && style.bg.rgb) {+ const bg = new ColorKit(style.bg.rgb).toRgbString();++ if (!cellFillColors.has(bg)) {+ cellFillColors.set(bg, { color: bg, checked: cellFillColorsChecked.has(bg) });+ }+ } else {+ cellFillColors.set('default-fill-color', { color: null, checked: cellFillColorsChecked.has(null) });+ }++ if (style.cl && style.cl.rgb) {+ const cl = new ColorKit(style.cl.rgb).toRgbString();++ if (!cellTextColors.has(cl)) {+ cellTextColors.set(cl, { color: cl, checked: cellTextColorsChecked.has(cl) });+ }+ } else {+ cellTextColors.set('default-font-color', { color: COLOR_BLACK_RGB, checked: cellTextColorsChecked.has(COLOR_BLACK_RGB) });+ }+ }++ return injector.createInstance(ByColorsModel, filterModel, col, cellFillColors, cellTextColors);+ }++ canApply$: Observable<boolean> = of(true);++ private readonly _cellFillColors$: BehaviorSubject<IFilterByColorItem[]>;+ readonly cellFillColors$: Observable<IFilterByColorItem[]>;+ get cellFillColors(): IFilterByColorItem[] { return this._cellFillColors$.getValue(); }++ private readonly _cellTextColors$: BehaviorSubject<IFilterByColorItem[]>;+ readonly cellTextColors$: Observable<IFilterByColorItem[]>;+ get cellTextColors(): IFilterByColorItem[] { return this._cellTextColors$.getValue(); }++ constructor(+ private readonly _filterModel: FilterModel,+ public col: number,+ /**+ * Filter items would remain unchanged after we create them,+ * though data may change after.+ */+ cellFillColors: Map<string, IFilterByColorItem>,+ cellTextColors: Map<string, IFilterByColorItem>,+ @ICommandService private readonly _commandService: ICommandService+ ) {+ super();++ this._cellFillColors$ = new BehaviorSubject<IFilterByColorItem[]>(Array.from(cellFillColors.values()));+ this.cellFillColors$ = this._cellFillColors$.asObservable();++ this._cellTextColors$ = new BehaviorSubject<IFilterByColorItem[]>(Array.from(cellTextColors.values()));+ this.cellTextColors$ = this._cellTextColors$.asObservable();+ }++ override dispose(): void {+ super.dispose();++ this._cellFillColors$.complete();+ }++ deltaCol(offset: number): void {+ this.col += offset;+ }++ // expose method here to let the panel change filter items++ // #region ByColorsModel apply methods+ clear(): Promise<boolean> {+ if (this._disposed) return Promise.resolve(false);++ return this._commandService.executeCommand(SetSheetsFilterCriteriaCommand.id, {+ unitId: this._filterModel.unitId,+ subUnitId: this._filterModel.subUnitId,+ col: this.col,+ criteria: null,+ } as ISetSheetsFilterCriteriaCommandParams);+ }++ onFilterCheckToggled(item: IFilterByColorItem, isFillColor: boolean = true): void {+ const colors = isFillColor ? this.cellFillColors : this.cellTextColors;+ const items: IFilterByColorItem[] = [];++ let found = false;++ for (let i = 0; i < colors.length; i++) {+ const colorItem = colors[i];++ if (colorItem.color === item.color) {+ found = true;+ items.push({+ color: colorItem.color,+ checked: !colorItem.checked,+ });+ continue;+ }++ items.push({+ color: colorItem.color,+ checked: colorItem.checked,+ });+ }++ if (!found) {+ return;+ }++ // fill color and text color are mutually exclusive+ this._resetColorsCheckedStatus(!isFillColor);++ if (isFillColor) {+ this._cellFillColors$.next([...items]);+ } else {+ this._cellTextColors$.next([...items]);+ }+ }++ private _resetColorsCheckedStatus(isFillColor: boolean = true): void {+ const colors = isFillColor ? this.cellFillColors : this.cellTextColors;+ const items: IFilterByColorItem[] = [];++ for (let i = 0; i < colors.length; i++) {+ items.push({+ color: colors[i].color,+ checked: false,+ });+ }++ if (isFillColor) {+ this._cellFillColors$.next([...items]);+ } else {+ this._cellTextColors$.next([...items]);+ }+ }++ /**+ * Apply the filter condition to the target filter column.+ */+ async apply(): Promise<boolean> {+ if (this._disposed) {+ return false;+ }++ const cellFillColorsChecked = this.cellFillColors.filter((item) => item.checked).map((item) => item.color);+ const cellTextColorsChecked = this.cellTextColors.filter((item) => item.checked).map((item) => item.color);++ if (cellFillColorsChecked.length === 0 && cellTextColorsChecked.length === 0) {+ // If no colors are checked, we clear the filter.+ return this._commandService.executeCommand(SetSheetsFilterCriteriaCommand.id, {+ unitId: this._filterModel.unitId,+ subUnitId: this._filterModel.subUnitId,+ col: this.col,+ criteria: null,+ } as ISetSheetsFilterCriteriaCommandParams);+ }++ const criteria: IFilterColumn = { colId: this.col };++ if (cellFillColorsChecked.length > 0) {+ criteria.colorFilters = {+ cellFillColors: cellFillColorsChecked,+ };+ } else if (cellTextColorsChecked.length > 0) {+ criteria.colorFilters = {+ cellTextColors: cellTextColorsChecked as string[],+ };+ }++ return this._commandService.executeCommand(SetSheetsFilterCriteriaCommand.id, {+ unitId: this._filterModel.unitId,+ subUnitId: this._filterModel.subUnitId,+ col: this.col,+ criteria,+ } as ISetSheetsFilterCriteriaCommandParams);+ }++ // #endregion+}++// #endregiondiff --git a/packages/sheets-filter-ui/src/views/components/SheetsFilterByColorsPanel.tsx b/packages/sheets-filter-ui/src/views/components/SheetsFilterByColorsPanel.tsxnew file mode 100644index 0000000000..b8a4060384--- /dev/null+++ b/packages/sheets-filter-ui/src/views/components/SheetsFilterByColorsPanel.tsx@@ -0,0 +1,174 @@+/**+ * Copyright 2023-present DreamNum Co., Ltd.+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++import type { ByColorsModel, IFilterByColorItem } from '../../services/sheets-filter-panel.service';+import { LocaleService } from '@univerjs/core';+import { borderClassName, clsx } from '@univerjs/design';+import { AIcon, BanIcon, SuccessIcon } from '@univerjs/icons';+import { useDependency, useObservable } from '@univerjs/ui';+import { useCallback } from 'react';++/**+ * Filter by colors.+ */+export function FilterByColor(props: { model: ByColorsModel }) {+ const { model } = props;+ const localeService = useDependency(LocaleService);+ const cellFillColors = useObservable(model.cellFillColors$, [], true);+ const cellTextColors = useObservable(model.cellTextColors$, [], true);++ const handleSelectCellFillColor = useCallback((color: IFilterByColorItem) => {+ model.onFilterCheckToggled(color);+ }, [model]);++ const handleSelectCellTextColor = useCallback((color: IFilterByColorItem) => {+ model.onFilterCheckToggled(color, false);+ }, [model]);++ return (+ <div+ data-u-comp="sheets-filter-panel-colors-container"+ className="univer-flex univer-h-full univer-min-h-[300px] univer-flex-col"+ >+ <div+ data-u-comp="sheets-filter-panel"+ className={clsx(`+ univer-mt-2 univer-box-border univer-flex univer-h-[300px] univer-flex-grow univer-flex-col+ univer-gap-4 univer-overflow-auto univer-rounded-md univer-px-2 univer-py-2.5+ `, borderClassName)}+ >+ {cellFillColors.length > 1 && (+ <div>+ <div+ className={`+ univer-mb-2 univer-text-sm univer-text-gray-900+ dark:!univer-text-white+ `}+ >+ {localeService.t('sheets-filter.panel.filter-by-cell-fill-color')}+ </div>+ <div+ className={`+ univer-grid univer-grid-cols-8 univer-items-center univer-justify-start univer-gap-2+ `}+ >+ {cellFillColors.map((color, index) => (+ <div+ key={`sheets-filter-cell-fill-color-${index}`}+ className="univer-relative univer-h-6 univer-w-6"+ onClick={() => handleSelectCellFillColor(color)}+ >+ {!color.color+ ? (+ <BanIcon+ className={`+ univer-h-6 univer-w-6 univer-cursor-pointer univer-rounded-full+ hover:univer-ring-2 hover:univer-ring-offset-2+ hover:univer-ring-offset-white+ `}+ />+ )+ : (+ <button+ type="button"+ className={clsx(`+ univer-box-border univer-h-6 univer-w-6 univer-cursor-pointer+ univer-rounded-full univer-border univer-border-solid+ univer-border-transparent univer-bg-gray-300 univer-transition-shadow+ hover:univer-ring-2 hover:univer-ring-offset-2+ hover:univer-ring-offset-white+ `)}+ style={{ backgroundColor: color.color }}+ />+ )}++ {color.checked && <CheckedIcon />}+ </div>+ ))}+ </div>+ </div>+ )}++ {cellTextColors.length > 1 && (+ <div>+ <div+ className={`+ univer-mb-2 univer-text-sm univer-text-gray-900+ dark:!univer-text-white+ `}+ >+ {localeService.t('sheets-filter.panel.filter-by-cell-text-color')}+ </div>+ <div+ className={`+ univer-grid univer-grid-cols-8 univer-items-center univer-justify-start univer-gap-2+ `}+ >+ {cellTextColors.map((color, index) => (+ <div+ key={`sheets-filter-cell-text-color-${index}`}+ className="univer-relative univer-h-6 univer-w-6"+ onClick={() => handleSelectCellTextColor(color)}+ >+ <div+ className={`+ univer-box-border univer-flex univer-h-full univer-w-full+ univer-cursor-pointer univer-items-center univer-justify-center+ univer-rounded-full univer-border univer-border-solid+ univer-border-[rgba(13,13,13,0.06)] univer-p-0.5+ hover:univer-ring-2 hover:univer-ring-offset-2 hover:univer-ring-offset-white+ dark:!univer-border-[rgba(255,255,255,0.06)]+ `}+ >+ <AIcon style={{ color: color.color as string }} />+ </div>++ {color.checked && <CheckedIcon />}+ </div>+ ))}+ </div>+ </div>+ )}++ {cellFillColors.length <= 1 && cellTextColors.length <= 1 && (+ <div+ className={`+ univer-flex univer-h-full univer-w-full univer-items-center univer-justify-center+ univer-text-sm univer-text-gray-900+ `}+ >+ {localeService.t('sheets-filter.panel.filter-by-color-none')}+ </div>+ )}+ </div>+ </div>+ );+}++function CheckedIcon() {+ return (+ <div+ className={`+ univer-absolute -univer-bottom-0.5 -univer-right-0.5 univer-flex univer-h-3 univer-w-3+ univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-full univer-bg-white+ `}+ >+ <SuccessIcon+ className="univer-h-full univer-w-full univer-font-bold univer-text-[#418F1F]"+ />+ </div>+ );+}diff --git a/packages/sheets-filter-ui/src/views/components/SheetsFilterPanel.tsx b/packages/sheets-filter-ui/src/views/components/SheetsFilterPanel.tsxindex 40d2890e9a..74a74c07f7 100644--- a/packages/sheets-filter-ui/src/views/components/SheetsFilterPanel.tsx+++ b/packages/sheets-filter-ui/src/views/components/SheetsFilterPanel.tsx@@ -14,16 +14,17 @@* limitations under the License.*/-import type { ByConditionsModel, ByValuesModel } from '../../services/sheets-filter-panel.service';+import type { ByColorsModel, ByConditionsModel, ByValuesModel } from '../../services/sheets-filter-panel.service';import { ICommandService, LocaleService } from '@univerjs/core';import { Button, Segmented } from '@univerjs/design';-import { SheetsFilterService } from '@univerjs/sheets-filter';+import { FilterBy, SheetsFilterService } from '@univerjs/sheets-filter';import { SheetsUIPart } from '@univerjs/sheets-ui';import { ComponentContainer, useComponentsOfPart, useDependency, useObservable } from '@univerjs/ui';import { useCallback, useMemo } from 'react';import { of } from 'rxjs';import { ChangeFilterByOperation, CloseFilterPanelOperation } from '../../commands/operations/sheets-filter.operation';-import { FilterBy, SheetsFilterPanelService } from '../../services/sheets-filter-panel.service';+import { SheetsFilterPanelService } from '../../services/sheets-filter-panel.service';+import { FilterByColor } from './SheetsFilterByColorsPanel';import { FilterByCondition } from './SheetsFilterByConditionsPanel';import { FilterByValue } from './SheetsFilterByValuesPanel';@@ -96,7 +97,9 @@ export function FilterPanel() {>{filterBy === FilterBy.VALUES? <FilterByValue model={filterByModel as ByValuesModel} />- : <FilterByCondition model={filterByModel as ByConditionsModel} />}+ : filterBy === FilterBy.COLORS+ ? <FilterByColor model={filterByModel as ByColorsModel} />+ : <FilterByCondition model={filterByModel as ByConditionsModel} />}</div>): (@@ -129,6 +132,7 @@ function useFilterByOptions(localeService: LocaleService) {const locale = localeService.getCurrentLocale();return useMemo(() => [{ label: localeService.t('sheets-filter.panel.by-values'), value: FilterBy.VALUES },+ { label: localeService.t('sheets-filter.panel.by-colors'), value: FilterBy.COLORS },{ label: localeService.t('sheets-filter.panel.by-conditions'), value: FilterBy.CONDITIONS },], [locale, localeService]);}diff --git a/packages/sheets-filter-ui/src/worker/generate-filter-values.service.ts b/packages/sheets-filter-ui/src/worker/generate-filter-values.service.tsindex b4568cc246..8b82265014 100644--- a/packages/sheets-filter-ui/src/worker/generate-filter-values.service.ts+++ b/packages/sheets-filter-ui/src/worker/generate-filter-values.service.ts@@ -14,15 +14,18 @@* limitations under the License.*/-import type { IRange, Styles, Workbook, Worksheet } from '@univerjs/core';+import type { IRange, Nullable, Styles, Workbook, Worksheet } from '@univerjs/core';+import type { FilterColumn } from '@univerjs/sheets-filter';import type { IFilterByValueItem, IFilterByValueWithTreeItem } from '../services/sheets-filter-panel.service';import { createIdentifier, Disposable, extractPureTextFromCell, ILogService, Inject, IUniverInstanceService, LocaleService, numfmt } from '@univerjs/core';+import { FilterBy } from '@univerjs/sheets-filter';export interface ISheetsGenerateFilterValuesService {getFilterValues(params: {unitId: string;subUnitId: string;filteredOutRowsByOtherColumns: number[];+ filterColumn: Nullable<FilterColumn>;filters: boolean;blankChecked: boolean;iterateRange: IRange;@@ -49,12 +52,13 @@ export class SheetsGenerateFilterValuesService extends Disposable {unitId: string;subUnitId: string;filteredOutRowsByOtherColumns: number[];+ filterColumn: Nullable<FilterColumn>;filters: boolean;blankChecked: boolean;iterateRange: IRange;alreadyChecked: string[];}) {- const { unitId, subUnitId, filteredOutRowsByOtherColumns, filters, blankChecked, iterateRange, alreadyChecked } = params;+ const { unitId, subUnitId, filteredOutRowsByOtherColumns, filterColumn, filters, blankChecked, iterateRange, alreadyChecked } = params;const workbook = this._univerInstanceService.getUnit<Workbook>(unitId);const worksheet = this._univerInstanceService.getUnit<Workbook>(unitId)?.getSheetBySheetId(subUnitId);@@ -62,7 +66,17 @@ export class SheetsGenerateFilterValuesService extends Disposable {this._logService.debug('[SheetsGenerateFilterValuesService]', 'getFilterValues for', { unitId, subUnitId });- return getFilterTreeByValueItems(filters, this._localeService, iterateRange, worksheet, new Set(filteredOutRowsByOtherColumns), new Set(alreadyChecked.map(String)), blankChecked, workbook.getStyles());+ return getFilterTreeByValueItems(+ filters,+ this._localeService,+ iterateRange,+ worksheet,+ new Set(filteredOutRowsByOtherColumns),+ filterColumn,+ new Set(alreadyChecked.map(String)),+ blankChecked,+ workbook.getStyles()+ );}}@@ -142,6 +156,7 @@ export function getFilterTreeByValueItems(iterateRange: IRange,worksheet: Worksheet,filteredOutRowsByOtherColumns: Set<number>,+ filterColumn: Nullable<FilterColumn>,alreadyChecked: Set<string>,blankChecked: boolean,styles: Styles@@ -155,6 +170,12 @@ export function getFilterTreeByValueItems(const DefaultPattern = 'yyyy-mm-dd';const canSplitPatternSet = new Set(CAN_PARSE_DATE_FORMAT);const EmptyKey = 'empty';+ // filter column is the column that is currently being filtered.+ // If the filter column is filter by colors or conditions, it means that the tab is switched from filter by colors or conditions to filter by values,+ // so if the filter column has filtered out rows, we need clear all values checked status, refer to excel and wps.+ const isNeedClearCheckedStatus = !filters+ && (filterColumn?.filterBy === FilterBy.COLORS || filterColumn?.filterBy === FilterBy.CONDITIONS)+ && filterColumn.filteredOutRows?.size;let emptyCount = 0;for (const cell of worksheet.iterateByColumn(iterateRange, false, false)) { // iterate and do not skip empty cells@@ -221,7 +242,11 @@ export function getFilterTreeByValueItems(count: 1,originValues: new Set([value]),leaf: true,- checked: alreadyChecked.size ? alreadyChecked.has(value) : !blankChecked,+ checked: isNeedClearCheckedStatus+ ? false+ : alreadyChecked.size+ ? alreadyChecked.has(value)+ : !blankChecked,});monthItem.count++;yearItem.count++;@@ -239,7 +264,11 @@ export function getFilterTreeByValueItems(item = {title: value,leaf: true,- checked: alreadyChecked.size ? alreadyChecked.has(value) : !blankChecked,+ checked: isNeedClearCheckedStatus+ ? false+ : alreadyChecked.size+ ? alreadyChecked.has(value)+ : !blankChecked,key,count: 1,};@@ -253,7 +282,11 @@ export function getFilterTreeByValueItems(}}- const initialBlankChecked = filters ? blankChecked : true;+ const initialBlankChecked = isNeedClearCheckedStatus+ ? false+ : filters+ ? blankChecked+ : true;if (emptyCount > 0) {const item: IFilterByValueWithTreeItem = {title: localeService.t('sheets-filter.panel.empty'),diff --git a/packages/sheets-filter/package.json b/packages/sheets-filter/package.jsonindex f88fbc4314..3f73035499 100644--- a/packages/sheets-filter/package.json+++ b/packages/sheets-filter/package.json@@ -72,6 +72,7 @@"dependencies": {"@univerjs/core": "workspace:*","@univerjs/engine-formula": "workspace:*",+ "@univerjs/engine-render": "workspace:*","@univerjs/rpc": "workspace:*","@univerjs/sheets": "workspace:*"},diff --git a/packages/sheets-filter/src/index.ts b/packages/sheets-filter/src/index.tsindex f8d269bab1..cf8ee9d1b0 100644--- a/packages/sheets-filter/src/index.ts+++ b/packages/sheets-filter/src/index.ts@@ -44,7 +44,7 @@ export {notEquals,} from './models/custom-filters';export { FilterColumn, FilterModel } from './models/filter-model';-export type { IAutoFilter, ICustomFilter, ICustomFilters, IFilterColumn, IFilters } from './models/types';-export { CustomFilterOperator } from './models/types';+export type { IAutoFilter, IColorFilters, ICustomFilter, ICustomFilters, IFilterColumn, IFilters } from './models/types';+export { CustomFilterOperator, FilterBy } from './models/types';export { UniverSheetsFilterPlugin } from './plugin';export { SHEET_FILTER_SNAPSHOT_ID, SheetsFilterService } from './services/sheet-filter.service';diff --git a/packages/sheets-filter/src/models/filter-model.ts b/packages/sheets-filter/src/models/filter-model.tsindex 83db113190..7c8bac11a5 100644--- a/packages/sheets-filter/src/models/filter-model.ts+++ b/packages/sheets-filter/src/models/filter-model.ts@@ -14,13 +14,14 @@* limitations under the License.*/-import type { CellValue, ICellData, IRange, Nullable, Worksheet } from '@univerjs/core';+import type { CellValue, ICellData, IRange, IStyleData, Nullable, Worksheet } from '@univerjs/core';import type { Observable } from 'rxjs';-import type { IAutoFilter, ICustomFilter, ICustomFilters, IFilterColumn, IFilters } from './types';-import { CellValueType, Disposable, extractPureTextFromCell, mergeSets, Rectangle, Tools } from '@univerjs/core';+import type { IAutoFilter, IColorFilters, ICustomFilter, ICustomFilters, IFilterColumn, IFilters } from './types';+import { CellValueType, ColorKit, Disposable, extractPureTextFromCell, mergeSets, Rectangle, Tools } from '@univerjs/core';+import { COLOR_BLACK_RGB } from '@univerjs/engine-render';import { BehaviorSubject } from 'rxjs';import { ensureNumeric, getCustomFilterFn, isNumericFilterFn, notEquals } from './custom-filters';-import { CustomFilterOperator } from './types';+import { CustomFilterOperator, FilterBy } from './types';const EMPTY = () => new Set<number>();@@ -297,12 +298,13 @@ export class FilterColumn extends Disposable {get filteredOutRows(): Readonly<Nullable<Set<number>>> { return this._filteredOutRows; }/** Cache the filter function. */- private _filterFn: Nullable<FilterFn> = null;+ private _filterFn: Nullable<FilterFn | ColorFilterFn> = null;private _range: Nullable<IRange> = null;private _column: number = 0;- private _filterByValues = false;+ private _filterBy: FilterBy = FilterBy.VALUES;+ get filterBy(): Readonly<FilterBy> { return this._filterBy; }constructor(public readonly unitId: string,@@ -403,10 +405,13 @@ export class FilterColumn extends Disposable {continue;}- const value = this._filterByValues- ? extractPureTextFromCell(this._worksheet.getCell(row, col))- : getFilterValueForConditionalFiltering(this._worksheet, row, col);- if (!this._filterFn(value)) {+ const filterResult = this._filterBy === FilterBy.VALUES+ ? (this._filterFn as FilterFn)(extractPureTextFromCell(this._worksheet.getCell(row, col)))+ : this._filterBy === FilterBy.COLORS+ ? (this._filterFn as ColorFilterFn)(this._worksheet.getComposedCellStyle(row, col))+ : (this._filterFn as FilterFn)(getFilterValueForConditionalFiltering(this._worksheet, row, col));++ if (!filterResult) {filteredOutRows.add(row);// Add all rows into filtered out rows if the cell is a merged cell.@@ -427,7 +432,11 @@ export class FilterColumn extends Disposable {}this._filterFn = generateFilterFn(this._criteria);- this._filterByValues = !!this._criteria.filters;+ this._filterBy = this._criteria.filters+ ? FilterBy.VALUES+ : this._criteria.colorFilters+ ? FilterBy.COLORS+ : FilterBy.CONDITIONS;}}@@ -436,17 +445,22 @@ export class FilterColumn extends Disposable {* "matched" and the corresponding row would not be filtered out.*/export type FilterFn = (value: Nullable<CellValue>) => boolean;+export type ColorFilterFn = (value: Nullable<IStyleData>) => boolean;/*** This functions take a `IFilterColumn` as input and return a function that can be used to filter rows.* @param column* @returns the filter function that takes the cell's value and return a boolean.*/-export function generateFilterFn(column: IFilterColumn): FilterFn {+export function generateFilterFn(column: IFilterColumn): FilterFn | ColorFilterFn {if (column.filters) {return filterByValuesFnFactory(column.filters);}+ if (column.colorFilters) {+ return filterByColorsFnFactory(column.colorFilters);+ }+if (column.customFilters) {return customFilterFnFactory(column.customFilters);}@@ -464,6 +478,37 @@ function filterByValuesFnFactory(values: IFilters): FilterFn {};}+function filterByColorsFnFactory(colorFilters: IColorFilters): ColorFilterFn {+ if (colorFilters.cellFillColors) {+ const fillColorsSet = new Set(colorFilters.cellFillColors);+ return (cellStyle) => {+ // default cell fill color is save as null in the color filters.+ if (!cellStyle || !cellStyle.bg?.rgb) {+ if (fillColorsSet.has(null)) return true;+ return false;+ }++ const bg = new ColorKit(cellStyle.bg.rgb).toRgbString();+ return fillColorsSet.has(bg);+ };+ }++ if (colorFilters.cellTextColors) {+ const textColorsSet = new Set(colorFilters.cellTextColors);+ return (cellStyle) => {+ if (!cellStyle || !cellStyle.cl?.rgb) {+ if (textColorsSet.has(COLOR_BLACK_RGB)) return true;+ return false;+ }++ const cl = new ColorKit(cellStyle.cl.rgb).toRgbString();+ return textColorsSet.has(cl);+ };+ }++ throw new Error('[FilterModel]: color filters are not supported yet.');+}+function customFilterFnFactory(customFilters: ICustomFilters): FilterFn {const customFilterFns: FilterFn[] = customFilters.customFilters.map((filter) => generateCustomFilterFn(filter));if (isCompoundCustomFilter(customFilterFns)) {diff --git a/packages/sheets-filter/src/models/types.ts b/packages/sheets-filter/src/models/types.tsindex 5363c94649..5a9f0f223d 100644--- a/packages/sheets-filter/src/models/types.ts+++ b/packages/sheets-filter/src/models/types.ts@@ -16,6 +16,15 @@import type { BooleanNumber, IRange } from '@univerjs/core';+/**+ * The filter types.+ */+export enum FilterBy {+ VALUES,+ COLORS,+ CONDITIONS,+}+/*** Data of a filter in a {@link Worksheet}.*@@ -43,6 +52,7 @@ export interface IAutoFilter {export interface IFilterColumn {colId: number;filters?: IFilters;+ colorFilters?: IColorFilters;customFilters?: ICustomFilters;};@@ -57,6 +67,17 @@ export interface IFilters {filters?: Array<string>;}+/**+ * Color filters.+ *+ * @property {Array<string | null>} [cellFillColor] The cell fill colors to filter by. If this field is present, cells with these fill colors would be visible.+ * @property {Array<string>} [cellTextColor] The cell text colors to filter by. If this field is present, cells with these text colors would be visible.+ */+export interface IColorFilters {+ cellFillColors?: Array<string | null>;+ cellTextColors?: Array<string>;+}+/*** Custom filters.*diff --git a/packages/sheets-formula-ui/package.json b/packages/sheets-formula-ui/package.jsonindex 4bbac0ab3f..83ef97f20b 100644--- a/packages/sheets-formula-ui/package.json+++ b/packages/sheets-formula-ui/package.json@@ -84,7 +84,7 @@"@univerjs/docs-ui": "workspace:*","@univerjs/engine-formula": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@univerjs/sheets": "workspace:*","@univerjs/sheets-formula": "workspace:*","@univerjs/sheets-ui": "workspace:*",diff --git a/packages/sheets-hyper-link-ui/package.json b/packages/sheets-hyper-link-ui/package.jsonindex fe1db22a87..1ea569c357 100644--- a/packages/sheets-hyper-link-ui/package.json+++ b/packages/sheets-hyper-link-ui/package.json@@ -85,7 +85,7 @@"@univerjs/docs-ui": "workspace:*","@univerjs/engine-formula": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@univerjs/sheets": "workspace:*","@univerjs/sheets-data-validation": "workspace:*","@univerjs/sheets-formula-ui": "workspace:*",diff --git a/packages/sheets-note-ui/package.json b/packages/sheets-note-ui/package.jsonindex 890acd3f6d..d66a421597 100644--- a/packages/sheets-note-ui/package.json+++ b/packages/sheets-note-ui/package.json@@ -66,7 +66,7 @@"@univerjs/core": "workspace:*","@univerjs/design": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@univerjs/sheets": "workspace:*","@univerjs/sheets-note": "workspace:*","@univerjs/sheets-ui": "workspace:*",diff --git a/packages/sheets-numfmt-ui/package.json b/packages/sheets-numfmt-ui/package.jsonindex 031ff781f4..8af19f89df 100644--- a/packages/sheets-numfmt-ui/package.json+++ b/packages/sheets-numfmt-ui/package.json@@ -72,7 +72,7 @@"@univerjs/design": "workspace:*","@univerjs/engine-numfmt": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@univerjs/sheets": "workspace:*","@univerjs/sheets-numfmt": "workspace:*","@univerjs/sheets-ui": "workspace:*",diff --git a/packages/sheets-sort-ui/package.json b/packages/sheets-sort-ui/package.jsonindex 61aaef8aca..00094bc5b5 100644--- a/packages/sheets-sort-ui/package.json+++ b/packages/sheets-sort-ui/package.json@@ -69,7 +69,7 @@"@univerjs/core": "workspace:*","@univerjs/design": "workspace:*","@univerjs/engine-formula": "workspace:*",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@univerjs/sheets": "workspace:*","@univerjs/sheets-sort": "workspace:*","@univerjs/sheets-ui": "workspace:*",diff --git a/packages/sheets-table-ui/package.json b/packages/sheets-table-ui/package.jsonindex 9378945f64..088804b473 100644--- a/packages/sheets-table-ui/package.json+++ b/packages/sheets-table-ui/package.json@@ -75,7 +75,7 @@"@univerjs/design": "workspace:*","@univerjs/engine-formula": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@univerjs/sheets": "workspace:*","@univerjs/sheets-formula-ui": "workspace:*","@univerjs/sheets-sort": "workspace:*",diff --git a/packages/sheets-thread-comment-ui/package.json b/packages/sheets-thread-comment-ui/package.jsonindex 8b0e3f7df8..fb258a8bb8 100644--- a/packages/sheets-thread-comment-ui/package.json+++ b/packages/sheets-thread-comment-ui/package.json@@ -69,7 +69,7 @@"@univerjs/core": "workspace:*","@univerjs/engine-formula": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@univerjs/sheets": "workspace:*","@univerjs/sheets-thread-comment": "workspace:*","@univerjs/sheets-ui": "workspace:*",diff --git a/packages/sheets-ui/package.json b/packages/sheets-ui/package.jsonindex 2c257de735..56b0fd095f 100644--- a/packages/sheets-ui/package.json+++ b/packages/sheets-ui/package.json@@ -86,7 +86,7 @@"@univerjs/engine-formula": "workspace:*","@univerjs/engine-numfmt": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@univerjs/protocol": "0.1.46","@univerjs/sheets": "workspace:*","@univerjs/telemetry": "workspace:*",diff --git a/packages/sheets-zen-editor/package.json b/packages/sheets-zen-editor/package.jsonindex 76137fdb08..dd2d76f11b 100644--- a/packages/sheets-zen-editor/package.json+++ b/packages/sheets-zen-editor/package.json@@ -84,7 +84,7 @@"@univerjs/docs": "workspace:*","@univerjs/docs-ui": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@univerjs/sheets": "workspace:*","@univerjs/sheets-ui": "workspace:*","@univerjs/ui": "workspace:*"diff --git a/packages/slides-ui/package.json b/packages/slides-ui/package.jsonindex 6df2c0faf2..7edc916a01 100644--- a/packages/slides-ui/package.json+++ b/packages/slides-ui/package.json@@ -74,7 +74,7 @@"@univerjs/docs-ui": "workspace:*","@univerjs/drawing": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@univerjs/slides": "workspace:*","@univerjs/ui": "workspace:*"},diff --git a/packages/thread-comment-ui/package.json b/packages/thread-comment-ui/package.jsonindex 44abeefc48..144936065a 100644--- a/packages/thread-comment-ui/package.json+++ b/packages/thread-comment-ui/package.json@@ -69,7 +69,7 @@"@univerjs/core": "workspace:*","@univerjs/design": "workspace:*","@univerjs/docs-ui": "workspace:*",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@univerjs/thread-comment": "workspace:*","@univerjs/ui": "workspace:*"},diff --git a/packages/ui/package.json b/packages/ui/package.jsonindex f289723c8b..78a499adfe 100644--- a/packages/ui/package.json+++ b/packages/ui/package.json@@ -83,7 +83,7 @@"@univerjs/core": "workspace:*","@univerjs/design": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.4.4",+ "@univerjs/icons": "^0.4.6","@wendellhu/redi": "0.18.3","localforage": "^1.10.0"},diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 17fbbc1237..4bd1cbc3bd 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -184,11 +184,11 @@ importers:specifier: ^11.0.4version: 11.0.4'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/icons-svg':- specifier: ^0.4.4- version: 0.4.4+ specifier: ^0.4.6+ version: 0.4.6'@univerjs/protocol':specifier: 0.1.46version: 0.1.46(@grpc/[email protected])([email protected])@@ -332,8 +332,8 @@ importers:specifier: workspace:*version: link:../packages/find-replace'@univerjs/icons':- specifier: 0.4.4+ specifier: 0.4.6'@univerjs/mockdata':specifier: workspace:*version: link:../mockdata@@ -700,8 +700,8 @@ importers:specifier: workspace:*version: link:../../packages/engine-render'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/mockdata':specifier: workspace:*version: link:../../mockdata@@ -832,8 +832,8 @@ importers:specifier: workspace:*version: link:../../packages/engine-render'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/rpc':specifier: workspace:*version: link:../../packages/rpc@@ -893,8 +893,8 @@ importers:specifier: workspace:*version: link:../../packages/docs-ui'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/sheets':specifier: workspace:*version: link:../../packages/sheets@@ -948,8 +948,8 @@ importers:specifier: workspace:*version: link:../../packages/engine-render'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/slides-ui':specifier: workspace:*version: link:../../packages/slides-ui@@ -1000,8 +1000,8 @@ importers:specifier: workspace:*version: link:../../packages/engine-render'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/sheets':specifier: workspace:*version: link:../../packages/sheets@@ -1055,8 +1055,8 @@ importers:specifier: workspace:*version: link:../design'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/sheets':specifier: workspace:*version: link:../sheets@@ -1211,8 +1211,8 @@ importers:specifier: ^2.2.6'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/themes':specifier: workspace:*version: link:../themes@@ -1432,8 +1432,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/ui':specifier: workspace:*version: link:../ui@@ -1536,8 +1536,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/ui':specifier: workspace:*version: link:../ui@@ -1582,8 +1582,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/thread-comment':specifier: workspace:*version: link:../thread-comment@@ -1637,8 +1637,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/ui':specifier: workspace:*version: link:../ui@@ -1717,8 +1717,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/ui':specifier: workspace:*version: link:../ui@@ -1849,8 +1849,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/ui':specifier: workspace:*version: link:../ui@@ -2008,8 +2008,8 @@ importers:specifier: workspace:*version: link:../../common/shared'@univerjs/icons-svg':- specifier: ^0.4.4- version: 0.4.4+ specifier: ^0.4.6+ version: 0.4.6rxjs:specifier: ^7.8.2version: 7.8.2@@ -2038,8 +2038,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/sheets':specifier: workspace:*version: link:../sheets@@ -2093,8 +2093,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/sheets':specifier: workspace:*version: link:../sheets@@ -2188,8 +2188,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/sheets':specifier: workspace:*version: link:../sheets@@ -2328,6 +2328,9 @@ importers:'@univerjs/engine-formula':specifier: workspace:*version: link:../engine-formula+ '@univerjs/engine-render':+ specifier: workspace:*+ version: link:../engine-render'@univerjs/rpc':specifier: workspace:*version: link:../rpc@@ -2363,8 +2366,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/rpc':specifier: workspace:*version: link:../rpc@@ -2498,8 +2501,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/sheets':specifier: workspace:*version: link:../sheets@@ -2615,8 +2618,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/sheets':specifier: workspace:*version: link:../sheets@@ -2698,8 +2701,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/sheets':specifier: workspace:*version: link:../sheets@@ -2787,8 +2790,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/sheets':specifier: workspace:*version: link:../sheets@@ -2867,8 +2870,8 @@ importers:specifier: workspace:*version: link:../engine-formula'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/sheets':specifier: workspace:*version: link:../sheets@@ -2950,8 +2953,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/sheets':specifier: workspace:*version: link:../sheets@@ -3039,8 +3042,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/sheets':specifier: workspace:*version: link:../sheets@@ -3109,8 +3112,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/protocol':specifier: 0.1.46version: 0.1.46(@grpc/[email protected])([email protected])@@ -3170,8 +3173,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/sheets':specifier: workspace:*version: link:../sheets@@ -3250,8 +3253,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/slides':specifier: workspace:*version: link:../slides@@ -3346,8 +3349,8 @@ importers:specifier: workspace:*version: link:../docs-ui'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@univerjs/thread-comment':specifier: workspace:*version: link:../thread-comment@@ -3392,8 +3395,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.4.4+ specifier: ^0.4.6'@wendellhu/redi':specifier: 0.18.3version: 0.18.3@@ -3759,6 +3762,10 @@ packages:resolution: {integrity: sha512-1x3D2xEk2fRo3PAhwQwu5UubzgiVWSXTBfWpVd2Mx2AzRqJuDJCsgaDVZ7HB5iGzDW1Hl1sWN2mFyKjmR9uAog==}engines: {node: '>=6.9.0'}+ '@babel/[email protected]':+ resolution: {integrity: sha512-vbavdySgbTTrmFE+EsiqUTzlOr5bzlnJtUv9PynGCAKvfQqjIXbvFdumPM/GxMDfyuGMJaJAU6TO4zc1Jf1i8Q==}+ engines: {node: '>=6.9.0'}+'@babel/[email protected]':resolution: {integrity: sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==}engines: {node: '>=6.9.0'}@@ -6071,11 +6078,11 @@ packages:resolution: {integrity: sha512-VRwixir4zBWCSTP/ljEo091lbpypz57PoeAQ9imjG+vbeof9LplljsL1mos4ccG6H9IjfrVGM359RozUnuFhpw==}engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}- '@univerjs/[email protected]':- resolution: {integrity: sha512-UNPCPoktGR6S2zoVbv7bdPD7YbsKRxSk9cWB4VHeI1RbiG+ohF97r1YIYOAhkurE/KnVYPK50W8rCs2YXB2HCg==}+ '@univerjs/[email protected]':+ resolution: {integrity: sha512-7WbVw1piJRvDWvIEaW/xjX69g7uIvrUpEE1MNSZSzlcWslAG6MkGeidPq0nAMUekAKzOnLFlEotb8z9+iPhFFg==}- '@univerjs/[email protected]':- resolution: {integrity: sha512-l3UpCm5GU8shuw+p81CmatxZm7+PP0gqso2tTx5JEParzM63fMtyXCRPIbkotDZ6fIL9opdIuHhDrAsa3SkSKg==}+ '@univerjs/[email protected]':+ resolution: {integrity: sha512-TAazMtFR+Jt82E3reHXNZXkSc8/5yV5A0QnSG3MIxhVtGMLIbBupceVjd46tCjogUd965iW+kZg4CjqvWvLU4A==}peerDependencies:react: 19.1.0react-dom: 19.1.0@@ -11554,6 +11561,8 @@ snapshots:'@babel/[email protected]': {}+ '@babel/[email protected]': {}+'@babel/[email protected]':dependencies:'@babel/code-frame': 7.27.1@@ -13515,7 +13524,7 @@ snapshots:'@testing-library/[email protected]':dependencies:'@babel/code-frame': 7.27.1- '@babel/runtime': 7.27.1+ '@babel/runtime': 7.27.6'@types/aria-query': 5.0.4aria-query: 5.3.0chalk: 4.1.2@@ -13927,9 +13936,9 @@ snapshots:'@typescript-eslint/types': 8.35.1eslint-visitor-keys: 4.2.1- '@univerjs/[email protected]': {}+ '@univerjs/[email protected]': {}dependencies:react: 19.1.0react-dom: 19.1.0([email protected])