@univerjs/sheets-filter 0.23.0 → 0.24.0-insiders.20260527-b1d726f

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/lib/cjs/index.js +19 -6
  2. package/lib/cjs/locale/ar-SA.js +9 -0
  3. package/lib/cjs/locale/ca-ES.js +9 -0
  4. package/lib/cjs/locale/de-DE.js +9 -0
  5. package/lib/cjs/locale/en-US.js +24 -0
  6. package/lib/cjs/locale/es-ES.js +9 -0
  7. package/lib/cjs/locale/fa-IR.js +9 -0
  8. package/lib/cjs/locale/fr-FR.js +9 -0
  9. package/lib/cjs/locale/id-ID.js +9 -0
  10. package/lib/cjs/locale/it-IT.js +9 -0
  11. package/lib/cjs/locale/ja-JP.js +9 -0
  12. package/lib/cjs/locale/ko-KR.js +9 -0
  13. package/lib/cjs/locale/pl-PL.js +9 -0
  14. package/lib/cjs/locale/pt-BR.js +9 -0
  15. package/lib/cjs/locale/ru-RU.js +9 -0
  16. package/lib/cjs/locale/sk-SK.js +9 -0
  17. package/lib/cjs/locale/vi-VN.js +9 -0
  18. package/lib/cjs/locale/zh-CN.js +9 -0
  19. package/lib/cjs/locale/zh-HK.js +9 -0
  20. package/lib/cjs/locale/zh-TW.js +9 -0
  21. package/lib/es/index.js +19 -6
  22. package/lib/es/locale/ar-SA.js +8 -0
  23. package/lib/es/locale/ca-ES.js +8 -0
  24. package/lib/es/locale/de-DE.js +8 -0
  25. package/lib/es/locale/en-US.js +23 -0
  26. package/lib/es/locale/es-ES.js +8 -0
  27. package/lib/es/locale/fa-IR.js +8 -0
  28. package/lib/es/locale/fr-FR.js +8 -0
  29. package/lib/es/locale/id-ID.js +8 -0
  30. package/lib/es/locale/it-IT.js +8 -0
  31. package/lib/es/locale/ja-JP.js +8 -0
  32. package/lib/es/locale/ko-KR.js +8 -0
  33. package/lib/es/locale/pl-PL.js +8 -0
  34. package/lib/es/locale/pt-BR.js +8 -0
  35. package/lib/es/locale/ru-RU.js +8 -0
  36. package/lib/es/locale/sk-SK.js +8 -0
  37. package/lib/es/locale/vi-VN.js +8 -0
  38. package/lib/es/locale/zh-CN.js +8 -0
  39. package/lib/es/locale/zh-HK.js +8 -0
  40. package/lib/es/locale/zh-TW.js +8 -0
  41. package/lib/index.js +19 -6
  42. package/lib/locale/ar-SA.js +8 -0
  43. package/lib/locale/ca-ES.js +8 -0
  44. package/lib/locale/de-DE.js +8 -0
  45. package/lib/locale/en-US.js +23 -0
  46. package/lib/locale/es-ES.js +8 -0
  47. package/lib/locale/fa-IR.js +8 -0
  48. package/lib/locale/fr-FR.js +8 -0
  49. package/lib/locale/id-ID.js +8 -0
  50. package/lib/locale/it-IT.js +8 -0
  51. package/lib/locale/ja-JP.js +8 -0
  52. package/lib/locale/ko-KR.js +8 -0
  53. package/lib/locale/pl-PL.js +8 -0
  54. package/lib/locale/pt-BR.js +8 -0
  55. package/lib/locale/ru-RU.js +8 -0
  56. package/lib/locale/sk-SK.js +8 -0
  57. package/lib/locale/vi-VN.js +8 -0
  58. package/lib/locale/zh-CN.js +8 -0
  59. package/lib/locale/zh-HK.js +8 -0
  60. package/lib/locale/zh-TW.js +8 -0
  61. package/lib/types/controllers/sheets-filter.controller.d.ts +1 -0
  62. package/lib/types/locale/ar-SA.d.ts +18 -0
  63. package/lib/types/locale/ca-ES.d.ts +18 -0
  64. package/lib/types/locale/de-DE.d.ts +18 -0
  65. package/lib/types/locale/en-US.d.ts +26 -0
  66. package/lib/types/locale/es-ES.d.ts +18 -0
  67. package/lib/types/locale/fa-IR.d.ts +18 -0
  68. package/lib/types/locale/fr-FR.d.ts +18 -0
  69. package/lib/types/locale/id-ID.d.ts +18 -0
  70. package/lib/types/locale/it-IT.d.ts +18 -0
  71. package/lib/types/locale/ja-JP.d.ts +18 -0
  72. package/lib/types/locale/ko-KR.d.ts +18 -0
  73. package/lib/types/locale/pl-PL.d.ts +18 -0
  74. package/lib/types/locale/pt-BR.d.ts +18 -0
  75. package/lib/types/locale/ru-RU.d.ts +18 -0
  76. package/lib/types/locale/sk-SK.d.ts +18 -0
  77. package/lib/types/locale/vi-VN.d.ts +18 -0
  78. package/lib/types/locale/zh-CN.d.ts +18 -0
  79. package/lib/types/locale/zh-HK.d.ts +18 -0
  80. package/lib/types/locale/zh-TW.d.ts +18 -0
  81. package/lib/umd/index.js +1 -1
  82. package/lib/umd/locale/ar-SA.js +1 -0
  83. package/lib/umd/locale/ca-ES.js +1 -0
  84. package/lib/umd/locale/de-DE.js +1 -0
  85. package/lib/umd/locale/en-US.js +1 -0
  86. package/lib/umd/locale/es-ES.js +1 -0
  87. package/lib/umd/locale/fa-IR.js +1 -0
  88. package/lib/umd/locale/fr-FR.js +1 -0
  89. package/lib/umd/locale/id-ID.js +1 -0
  90. package/lib/umd/locale/it-IT.js +1 -0
  91. package/lib/umd/locale/ja-JP.js +1 -0
  92. package/lib/umd/locale/ko-KR.js +1 -0
  93. package/lib/umd/locale/pl-PL.js +1 -0
  94. package/lib/umd/locale/pt-BR.js +1 -0
  95. package/lib/umd/locale/ru-RU.js +1 -0
  96. package/lib/umd/locale/sk-SK.js +1 -0
  97. package/lib/umd/locale/vi-VN.js +1 -0
  98. package/lib/umd/locale/zh-CN.js +1 -0
  99. package/lib/umd/locale/zh-HK.js +1 -0
  100. package/lib/umd/locale/zh-TW.js +1 -0
  101. package/package.json +12 -7
  102. package/LICENSE +0 -176
package/lib/cjs/index.js CHANGED
@@ -670,7 +670,7 @@ let SheetsFilterService = class SheetsFilterService extends _univerjs_core.Dispo
670
670
  _updateActiveFilterModel() {
671
671
  let workbook;
672
672
  try {
673
- workbook = this._univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
673
+ workbook = this._univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
674
674
  if (!workbook) {
675
675
  this._activeFilterModel$.next(null);
676
676
  return;
@@ -912,7 +912,7 @@ const SmartToggleSheetsFilterCommand = {
912
912
  const univerInstanceService = accessor.get(_univerjs_core.IUniverInstanceService);
913
913
  const sheetsFilterService = accessor.get(SheetsFilterService);
914
914
  const commandService = accessor.get(_univerjs_core.ICommandService);
915
- const currentWorkbook = univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
915
+ const currentWorkbook = univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
916
916
  const currentWorksheet = currentWorkbook === null || currentWorkbook === void 0 ? void 0 : currentWorkbook.getActiveSheet();
917
917
  if (!currentWorksheet || !currentWorkbook) return false;
918
918
  const unitId = currentWorkbook.getUnitId();
@@ -1202,6 +1202,15 @@ let SheetsFilterController = class SheetsFilterController extends _univerjs_core
1202
1202
  }));
1203
1203
  }
1204
1204
  _initCommands() {
1205
+ [
1206
+ SetSheetFilterRangeCommand,
1207
+ RemoveSheetFilterCommand,
1208
+ SetSheetsFilterCriteriaCommand,
1209
+ ClearSheetsFilterCriteriaCommand,
1210
+ ReCalcSheetsFilterCommand
1211
+ ].forEach((command) => {
1212
+ this.disposeWithMe(this._commandService.registerCommand(command));
1213
+ });
1205
1214
  [
1206
1215
  SetSheetsFilterCriteriaMutation,
1207
1216
  SetSheetsFilterRangeMutation,
@@ -1565,10 +1574,9 @@ let SheetsFilterController = class SheetsFilterController extends _univerjs_core
1565
1574
  var _this$_univerInstance;
1566
1575
  const worksheet = (_this$_univerInstance = this._univerInstanceService.getUniverSheetInstance(unitId)) === null || _this$_univerInstance === void 0 ? void 0 : _this$_univerInstance.getSheetBySheetId(subUnitId);
1567
1576
  if (!worksheet) return this._handleNull();
1568
- const hiddenRows = [];
1569
- for (let r = removeStartRow; r <= removeEndRow; r++) if (worksheet.getRowFiltered(r)) hiddenRows.push(r);
1577
+ const hiddenRowCount = this._getFilteredRowCount(worksheet, removeStartRow, removeEndRow);
1570
1578
  const afterStartRow = Math.min(startRow, removeStartRow);
1571
- const afterEndRow = afterStartRow + (endRow - startRow) - count + hiddenRows.length;
1579
+ const afterEndRow = afterStartRow + (endRow - startRow) - count + hiddenRowCount;
1572
1580
  const setFilterRangeMutationParams = {
1573
1581
  unitId,
1574
1582
  subUnitId,
@@ -1588,6 +1596,11 @@ let SheetsFilterController = class SheetsFilterController extends _univerjs_core
1588
1596
  redos: mergeSetFilterCriteria(redos)
1589
1597
  };
1590
1598
  }
1599
+ _getFilteredRowCount(worksheet, startRow, endRow) {
1600
+ let count = 0;
1601
+ for (let row = startRow; row <= endRow; row++) if (worksheet.getRowFiltered(row)) count++;
1602
+ return count;
1603
+ }
1591
1604
  handleMoveColsCommand({ fromRange, toRange }, unitId, subUnitId) {
1592
1605
  var _filterModel$getRange4;
1593
1606
  const filterModel = this._sheetsFilterService.getFilterModel(unitId, subUnitId);
@@ -2216,7 +2229,7 @@ SheetsFilterSyncController = __decorate([
2216
2229
  //#endregion
2217
2230
  //#region package.json
2218
2231
  var name = "@univerjs/sheets-filter";
2219
- var version = "0.23.0";
2232
+ var version = "0.24.0-insiders.20260527-b1d726f";
2220
2233
 
2221
2234
  //#endregion
2222
2235
  //#region src/services/sheet-filter-formula.service.ts
@@ -0,0 +1,9 @@
1
+
2
+ //#region src/locale/ar-SA.ts
3
+ const locale = { "sheets-filter": {
4
+ command: { "not-valid-filter-range": "يحتوي النطاق المحدد على صف واحد فقط وهو غير صالح للتصفية." },
5
+ msg: { "filter-header-forbidden": "لا يمكنك نقل صف الرأس الخاص بالتصفية." }
6
+ } };
7
+
8
+ //#endregion
9
+ module.exports = locale;
@@ -0,0 +1,9 @@
1
+
2
+ //#region src/locale/ca-ES.ts
3
+ const locale = { "sheets-filter": {
4
+ command: { "not-valid-filter-range": "L'interval seleccionat només té una fila i no és vàlid per filtrar." },
5
+ msg: { "filter-header-forbidden": "No pots moure la fila de capçalera d'un filtre." }
6
+ } };
7
+
8
+ //#endregion
9
+ module.exports = locale;
@@ -0,0 +1,9 @@
1
+
2
+ //#region src/locale/de-DE.ts
3
+ const locale = { "sheets-filter": {
4
+ command: { "not-valid-filter-range": "Der ausgewählte Bereich hat nur eine Zeile und ist für den Filter ungültig." },
5
+ msg: { "filter-header-forbidden": "Die Kopfzeile eines Filters kann nicht verschoben werden." }
6
+ } };
7
+
8
+ //#endregion
9
+ module.exports = locale;
@@ -0,0 +1,24 @@
1
+
2
+ //#region src/locale/en-US.ts
3
+ /**
4
+ * Copyright 2023-present DreamNum Co., Ltd.
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ const locale = { "sheets-filter": {
19
+ command: { "not-valid-filter-range": "The selected range only has one row and not valid for filter." },
20
+ msg: { "filter-header-forbidden": "You can't move the header row of a filter." }
21
+ } };
22
+
23
+ //#endregion
24
+ module.exports = locale;
@@ -0,0 +1,9 @@
1
+
2
+ //#region src/locale/es-ES.ts
3
+ const locale = { "sheets-filter": {
4
+ command: { "not-valid-filter-range": "El rango seleccionado solo tiene una fila y no es válido para filtrar." },
5
+ msg: { "filter-header-forbidden": "No puedes mover la fila de encabezado de un filtro." }
6
+ } };
7
+
8
+ //#endregion
9
+ module.exports = locale;
@@ -0,0 +1,9 @@
1
+
2
+ //#region src/locale/fa-IR.ts
3
+ const locale = { "sheets-filter": {
4
+ command: { "not-valid-filter-range": "محدوده انتخاب شده فقط یک ردیف دارد و برای فیلتر معتبر نیست." },
5
+ msg: { "filter-header-forbidden": "شما نمی‌توانید ردیف هدر یک فیلتر را جابه‌جا کنید." }
6
+ } };
7
+
8
+ //#endregion
9
+ module.exports = locale;
@@ -0,0 +1,9 @@
1
+
2
+ //#region src/locale/fr-FR.ts
3
+ const locale = { "sheets-filter": {
4
+ command: { "not-valid-filter-range": "La plage sélectionnée n'a qu'une seule ligne et n'est pas valide pour le filtre." },
5
+ msg: { "filter-header-forbidden": "Vous ne pouvez pas déplacer la ligne d'en-tête d'un filtre." }
6
+ } };
7
+
8
+ //#endregion
9
+ module.exports = locale;
@@ -0,0 +1,9 @@
1
+
2
+ //#region src/locale/id-ID.ts
3
+ const locale = { "sheets-filter": {
4
+ command: { "not-valid-filter-range": "Rentang yang dipilih hanya memiliki satu baris dan tidak valid untuk filter." },
5
+ msg: { "filter-header-forbidden": "Anda tidak dapat memindahkan baris header filter." }
6
+ } };
7
+
8
+ //#endregion
9
+ module.exports = locale;
@@ -0,0 +1,9 @@
1
+
2
+ //#region src/locale/it-IT.ts
3
+ const locale = { "sheets-filter": {
4
+ command: { "not-valid-filter-range": "L'intervallo selezionato ha una sola riga e non è valido per il filtro." },
5
+ msg: { "filter-header-forbidden": "Non è possibile spostare la riga di intestazione di un filtro." }
6
+ } };
7
+
8
+ //#endregion
9
+ module.exports = locale;
@@ -0,0 +1,9 @@
1
+
2
+ //#region src/locale/ja-JP.ts
3
+ const locale = { "sheets-filter": {
4
+ command: { "not-valid-filter-range": "選択範囲に1行しか含まれていないため、フィルタを適用できません。" },
5
+ msg: { "filter-header-forbidden": "フィルタヘッダー行は移動できません。" }
6
+ } };
7
+
8
+ //#endregion
9
+ module.exports = locale;
@@ -0,0 +1,9 @@
1
+
2
+ //#region src/locale/ko-KR.ts
3
+ const locale = { "sheets-filter": {
4
+ command: { "not-valid-filter-range": "선택한 범위에 한 행만 있어 필터를 적용할 수 없습니다." },
5
+ msg: { "filter-header-forbidden": "필터 헤더 행은 이동할 수 없습니다." }
6
+ } };
7
+
8
+ //#endregion
9
+ module.exports = locale;
@@ -0,0 +1,9 @@
1
+
2
+ //#region src/locale/pl-PL.ts
3
+ const locale = { "sheets-filter": {
4
+ command: { "not-valid-filter-range": "Wybrany zakres ma tylko jeden wiersz i nie jest prawidłowy do filtrowania." },
5
+ msg: { "filter-header-forbidden": "Nie można przenieść wiersza nagłówka filtra." }
6
+ } };
7
+
8
+ //#endregion
9
+ module.exports = locale;
@@ -0,0 +1,9 @@
1
+
2
+ //#region src/locale/pt-BR.ts
3
+ const locale = { "sheets-filter": {
4
+ command: { "not-valid-filter-range": "O intervalo selecionado possui apenas uma linha e não é válido para filtro." },
5
+ msg: { "filter-header-forbidden": "Você não pode mover a linha de cabeçalho de um filtro." }
6
+ } };
7
+
8
+ //#endregion
9
+ module.exports = locale;
@@ -0,0 +1,9 @@
1
+
2
+ //#region src/locale/ru-RU.ts
3
+ const locale = { "sheets-filter": {
4
+ command: { "not-valid-filter-range": "Выбранный диапазон содержит только одну строку и не подходит для фильтра." },
5
+ msg: { "filter-header-forbidden": "Вы не можете переместить строку заголовка фильтра." }
6
+ } };
7
+
8
+ //#endregion
9
+ module.exports = locale;
@@ -0,0 +1,9 @@
1
+
2
+ //#region src/locale/sk-SK.ts
3
+ const locale = { "sheets-filter": {
4
+ command: { "not-valid-filter-range": "Vybraný rozsah má iba jeden riadok a nie je vhodný na filtrovanie." },
5
+ msg: { "filter-header-forbidden": "Riadok hlavičky filtra sa nedá presunúť." }
6
+ } };
7
+
8
+ //#endregion
9
+ module.exports = locale;
@@ -0,0 +1,9 @@
1
+
2
+ //#region src/locale/vi-VN.ts
3
+ const locale = { "sheets-filter": {
4
+ command: { "not-valid-filter-range": "Khu vực được chọn chỉ có một hàng, không thể lọc" },
5
+ msg: { "filter-header-forbidden": "Không thể di chuyển hàng đầu lọc" }
6
+ } };
7
+
8
+ //#endregion
9
+ module.exports = locale;
@@ -0,0 +1,9 @@
1
+
2
+ //#region src/locale/zh-CN.ts
3
+ const locale = { "sheets-filter": {
4
+ command: { "not-valid-filter-range": "选中的区域只有一行,无法进行筛选" },
5
+ msg: { "filter-header-forbidden": "无法移动筛选行头" }
6
+ } };
7
+
8
+ //#endregion
9
+ module.exports = locale;
@@ -0,0 +1,9 @@
1
+
2
+ //#region src/locale/zh-HK.ts
3
+ const locale = { "sheets-filter": {
4
+ command: { "not-valid-filter-range": "選取的區域只有一列,無法進行篩選" },
5
+ msg: { "filter-header-forbidden": "無法移動篩選列頭" }
6
+ } };
7
+
8
+ //#endregion
9
+ module.exports = locale;
@@ -0,0 +1,9 @@
1
+
2
+ //#region src/locale/zh-TW.ts
3
+ const locale = { "sheets-filter": {
4
+ command: { "not-valid-filter-range": "選取的區域只有一列,無法進行篩選" },
5
+ msg: { "filter-header-forbidden": "無法移動篩選列頭" }
6
+ } };
7
+
8
+ //#endregion
9
+ module.exports = locale;
package/lib/es/index.js CHANGED
@@ -669,7 +669,7 @@ let SheetsFilterService = class SheetsFilterService extends Disposable {
669
669
  _updateActiveFilterModel() {
670
670
  let workbook;
671
671
  try {
672
- workbook = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
672
+ workbook = this._univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_SHEET);
673
673
  if (!workbook) {
674
674
  this._activeFilterModel$.next(null);
675
675
  return;
@@ -911,7 +911,7 @@ const SmartToggleSheetsFilterCommand = {
911
911
  const univerInstanceService = accessor.get(IUniverInstanceService);
912
912
  const sheetsFilterService = accessor.get(SheetsFilterService);
913
913
  const commandService = accessor.get(ICommandService);
914
- const currentWorkbook = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
914
+ const currentWorkbook = univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_SHEET);
915
915
  const currentWorksheet = currentWorkbook === null || currentWorkbook === void 0 ? void 0 : currentWorkbook.getActiveSheet();
916
916
  if (!currentWorksheet || !currentWorkbook) return false;
917
917
  const unitId = currentWorkbook.getUnitId();
@@ -1201,6 +1201,15 @@ let SheetsFilterController = class SheetsFilterController extends Disposable {
1201
1201
  }));
1202
1202
  }
1203
1203
  _initCommands() {
1204
+ [
1205
+ SetSheetFilterRangeCommand,
1206
+ RemoveSheetFilterCommand,
1207
+ SetSheetsFilterCriteriaCommand,
1208
+ ClearSheetsFilterCriteriaCommand,
1209
+ ReCalcSheetsFilterCommand
1210
+ ].forEach((command) => {
1211
+ this.disposeWithMe(this._commandService.registerCommand(command));
1212
+ });
1204
1213
  [
1205
1214
  SetSheetsFilterCriteriaMutation,
1206
1215
  SetSheetsFilterRangeMutation,
@@ -1564,10 +1573,9 @@ let SheetsFilterController = class SheetsFilterController extends Disposable {
1564
1573
  var _this$_univerInstance;
1565
1574
  const worksheet = (_this$_univerInstance = this._univerInstanceService.getUniverSheetInstance(unitId)) === null || _this$_univerInstance === void 0 ? void 0 : _this$_univerInstance.getSheetBySheetId(subUnitId);
1566
1575
  if (!worksheet) return this._handleNull();
1567
- const hiddenRows = [];
1568
- for (let r = removeStartRow; r <= removeEndRow; r++) if (worksheet.getRowFiltered(r)) hiddenRows.push(r);
1576
+ const hiddenRowCount = this._getFilteredRowCount(worksheet, removeStartRow, removeEndRow);
1569
1577
  const afterStartRow = Math.min(startRow, removeStartRow);
1570
- const afterEndRow = afterStartRow + (endRow - startRow) - count + hiddenRows.length;
1578
+ const afterEndRow = afterStartRow + (endRow - startRow) - count + hiddenRowCount;
1571
1579
  const setFilterRangeMutationParams = {
1572
1580
  unitId,
1573
1581
  subUnitId,
@@ -1587,6 +1595,11 @@ let SheetsFilterController = class SheetsFilterController extends Disposable {
1587
1595
  redos: mergeSetFilterCriteria(redos)
1588
1596
  };
1589
1597
  }
1598
+ _getFilteredRowCount(worksheet, startRow, endRow) {
1599
+ let count = 0;
1600
+ for (let row = startRow; row <= endRow; row++) if (worksheet.getRowFiltered(row)) count++;
1601
+ return count;
1602
+ }
1590
1603
  handleMoveColsCommand({ fromRange, toRange }, unitId, subUnitId) {
1591
1604
  var _filterModel$getRange4;
1592
1605
  const filterModel = this._sheetsFilterService.getFilterModel(unitId, subUnitId);
@@ -2215,7 +2228,7 @@ SheetsFilterSyncController = __decorate([
2215
2228
  //#endregion
2216
2229
  //#region package.json
2217
2230
  var name = "@univerjs/sheets-filter";
2218
- var version = "0.23.0";
2231
+ var version = "0.24.0-insiders.20260527-b1d726f";
2219
2232
 
2220
2233
  //#endregion
2221
2234
  //#region src/services/sheet-filter-formula.service.ts
@@ -0,0 +1,8 @@
1
+ //#region src/locale/ar-SA.ts
2
+ const locale = { "sheets-filter": {
3
+ command: { "not-valid-filter-range": "يحتوي النطاق المحدد على صف واحد فقط وهو غير صالح للتصفية." },
4
+ msg: { "filter-header-forbidden": "لا يمكنك نقل صف الرأس الخاص بالتصفية." }
5
+ } };
6
+
7
+ //#endregion
8
+ export { locale as default };
@@ -0,0 +1,8 @@
1
+ //#region src/locale/ca-ES.ts
2
+ const locale = { "sheets-filter": {
3
+ command: { "not-valid-filter-range": "L'interval seleccionat només té una fila i no és vàlid per filtrar." },
4
+ msg: { "filter-header-forbidden": "No pots moure la fila de capçalera d'un filtre." }
5
+ } };
6
+
7
+ //#endregion
8
+ export { locale as default };
@@ -0,0 +1,8 @@
1
+ //#region src/locale/de-DE.ts
2
+ const locale = { "sheets-filter": {
3
+ command: { "not-valid-filter-range": "Der ausgewählte Bereich hat nur eine Zeile und ist für den Filter ungültig." },
4
+ msg: { "filter-header-forbidden": "Die Kopfzeile eines Filters kann nicht verschoben werden." }
5
+ } };
6
+
7
+ //#endregion
8
+ export { locale as default };
@@ -0,0 +1,23 @@
1
+ //#region src/locale/en-US.ts
2
+ /**
3
+ * Copyright 2023-present DreamNum Co., Ltd.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ const locale = { "sheets-filter": {
18
+ command: { "not-valid-filter-range": "The selected range only has one row and not valid for filter." },
19
+ msg: { "filter-header-forbidden": "You can't move the header row of a filter." }
20
+ } };
21
+
22
+ //#endregion
23
+ export { locale as default };
@@ -0,0 +1,8 @@
1
+ //#region src/locale/es-ES.ts
2
+ const locale = { "sheets-filter": {
3
+ command: { "not-valid-filter-range": "El rango seleccionado solo tiene una fila y no es válido para filtrar." },
4
+ msg: { "filter-header-forbidden": "No puedes mover la fila de encabezado de un filtro." }
5
+ } };
6
+
7
+ //#endregion
8
+ export { locale as default };
@@ -0,0 +1,8 @@
1
+ //#region src/locale/fa-IR.ts
2
+ const locale = { "sheets-filter": {
3
+ command: { "not-valid-filter-range": "محدوده انتخاب شده فقط یک ردیف دارد و برای فیلتر معتبر نیست." },
4
+ msg: { "filter-header-forbidden": "شما نمی‌توانید ردیف هدر یک فیلتر را جابه‌جا کنید." }
5
+ } };
6
+
7
+ //#endregion
8
+ export { locale as default };
@@ -0,0 +1,8 @@
1
+ //#region src/locale/fr-FR.ts
2
+ const locale = { "sheets-filter": {
3
+ command: { "not-valid-filter-range": "La plage sélectionnée n'a qu'une seule ligne et n'est pas valide pour le filtre." },
4
+ msg: { "filter-header-forbidden": "Vous ne pouvez pas déplacer la ligne d'en-tête d'un filtre." }
5
+ } };
6
+
7
+ //#endregion
8
+ export { locale as default };
@@ -0,0 +1,8 @@
1
+ //#region src/locale/id-ID.ts
2
+ const locale = { "sheets-filter": {
3
+ command: { "not-valid-filter-range": "Rentang yang dipilih hanya memiliki satu baris dan tidak valid untuk filter." },
4
+ msg: { "filter-header-forbidden": "Anda tidak dapat memindahkan baris header filter." }
5
+ } };
6
+
7
+ //#endregion
8
+ export { locale as default };
@@ -0,0 +1,8 @@
1
+ //#region src/locale/it-IT.ts
2
+ const locale = { "sheets-filter": {
3
+ command: { "not-valid-filter-range": "L'intervallo selezionato ha una sola riga e non è valido per il filtro." },
4
+ msg: { "filter-header-forbidden": "Non è possibile spostare la riga di intestazione di un filtro." }
5
+ } };
6
+
7
+ //#endregion
8
+ export { locale as default };
@@ -0,0 +1,8 @@
1
+ //#region src/locale/ja-JP.ts
2
+ const locale = { "sheets-filter": {
3
+ command: { "not-valid-filter-range": "選択範囲に1行しか含まれていないため、フィルタを適用できません。" },
4
+ msg: { "filter-header-forbidden": "フィルタヘッダー行は移動できません。" }
5
+ } };
6
+
7
+ //#endregion
8
+ export { locale as default };
@@ -0,0 +1,8 @@
1
+ //#region src/locale/ko-KR.ts
2
+ const locale = { "sheets-filter": {
3
+ command: { "not-valid-filter-range": "선택한 범위에 한 행만 있어 필터를 적용할 수 없습니다." },
4
+ msg: { "filter-header-forbidden": "필터 헤더 행은 이동할 수 없습니다." }
5
+ } };
6
+
7
+ //#endregion
8
+ export { locale as default };
@@ -0,0 +1,8 @@
1
+ //#region src/locale/pl-PL.ts
2
+ const locale = { "sheets-filter": {
3
+ command: { "not-valid-filter-range": "Wybrany zakres ma tylko jeden wiersz i nie jest prawidłowy do filtrowania." },
4
+ msg: { "filter-header-forbidden": "Nie można przenieść wiersza nagłówka filtra." }
5
+ } };
6
+
7
+ //#endregion
8
+ export { locale as default };
@@ -0,0 +1,8 @@
1
+ //#region src/locale/pt-BR.ts
2
+ const locale = { "sheets-filter": {
3
+ command: { "not-valid-filter-range": "O intervalo selecionado possui apenas uma linha e não é válido para filtro." },
4
+ msg: { "filter-header-forbidden": "Você não pode mover a linha de cabeçalho de um filtro." }
5
+ } };
6
+
7
+ //#endregion
8
+ export { locale as default };
@@ -0,0 +1,8 @@
1
+ //#region src/locale/ru-RU.ts
2
+ const locale = { "sheets-filter": {
3
+ command: { "not-valid-filter-range": "Выбранный диапазон содержит только одну строку и не подходит для фильтра." },
4
+ msg: { "filter-header-forbidden": "Вы не можете переместить строку заголовка фильтра." }
5
+ } };
6
+
7
+ //#endregion
8
+ export { locale as default };
@@ -0,0 +1,8 @@
1
+ //#region src/locale/sk-SK.ts
2
+ const locale = { "sheets-filter": {
3
+ command: { "not-valid-filter-range": "Vybraný rozsah má iba jeden riadok a nie je vhodný na filtrovanie." },
4
+ msg: { "filter-header-forbidden": "Riadok hlavičky filtra sa nedá presunúť." }
5
+ } };
6
+
7
+ //#endregion
8
+ export { locale as default };
@@ -0,0 +1,8 @@
1
+ //#region src/locale/vi-VN.ts
2
+ const locale = { "sheets-filter": {
3
+ command: { "not-valid-filter-range": "Khu vực được chọn chỉ có một hàng, không thể lọc" },
4
+ msg: { "filter-header-forbidden": "Không thể di chuyển hàng đầu lọc" }
5
+ } };
6
+
7
+ //#endregion
8
+ export { locale as default };
@@ -0,0 +1,8 @@
1
+ //#region src/locale/zh-CN.ts
2
+ const locale = { "sheets-filter": {
3
+ command: { "not-valid-filter-range": "选中的区域只有一行,无法进行筛选" },
4
+ msg: { "filter-header-forbidden": "无法移动筛选行头" }
5
+ } };
6
+
7
+ //#endregion
8
+ export { locale as default };
@@ -0,0 +1,8 @@
1
+ //#region src/locale/zh-HK.ts
2
+ const locale = { "sheets-filter": {
3
+ command: { "not-valid-filter-range": "選取的區域只有一列,無法進行篩選" },
4
+ msg: { "filter-header-forbidden": "無法移動篩選列頭" }
5
+ } };
6
+
7
+ //#endregion
8
+ export { locale as default };
@@ -0,0 +1,8 @@
1
+ //#region src/locale/zh-TW.ts
2
+ const locale = { "sheets-filter": {
3
+ command: { "not-valid-filter-range": "選取的區域只有一列,無法進行篩選" },
4
+ msg: { "filter-header-forbidden": "無法移動篩選列頭" }
5
+ } };
6
+
7
+ //#endregion
8
+ export { locale as default };
package/lib/index.js CHANGED
@@ -669,7 +669,7 @@ let SheetsFilterService = class SheetsFilterService extends Disposable {
669
669
  _updateActiveFilterModel() {
670
670
  let workbook;
671
671
  try {
672
- workbook = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
672
+ workbook = this._univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_SHEET);
673
673
  if (!workbook) {
674
674
  this._activeFilterModel$.next(null);
675
675
  return;
@@ -911,7 +911,7 @@ const SmartToggleSheetsFilterCommand = {
911
911
  const univerInstanceService = accessor.get(IUniverInstanceService);
912
912
  const sheetsFilterService = accessor.get(SheetsFilterService);
913
913
  const commandService = accessor.get(ICommandService);
914
- const currentWorkbook = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
914
+ const currentWorkbook = univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_SHEET);
915
915
  const currentWorksheet = currentWorkbook === null || currentWorkbook === void 0 ? void 0 : currentWorkbook.getActiveSheet();
916
916
  if (!currentWorksheet || !currentWorkbook) return false;
917
917
  const unitId = currentWorkbook.getUnitId();
@@ -1201,6 +1201,15 @@ let SheetsFilterController = class SheetsFilterController extends Disposable {
1201
1201
  }));
1202
1202
  }
1203
1203
  _initCommands() {
1204
+ [
1205
+ SetSheetFilterRangeCommand,
1206
+ RemoveSheetFilterCommand,
1207
+ SetSheetsFilterCriteriaCommand,
1208
+ ClearSheetsFilterCriteriaCommand,
1209
+ ReCalcSheetsFilterCommand
1210
+ ].forEach((command) => {
1211
+ this.disposeWithMe(this._commandService.registerCommand(command));
1212
+ });
1204
1213
  [
1205
1214
  SetSheetsFilterCriteriaMutation,
1206
1215
  SetSheetsFilterRangeMutation,
@@ -1564,10 +1573,9 @@ let SheetsFilterController = class SheetsFilterController extends Disposable {
1564
1573
  var _this$_univerInstance;
1565
1574
  const worksheet = (_this$_univerInstance = this._univerInstanceService.getUniverSheetInstance(unitId)) === null || _this$_univerInstance === void 0 ? void 0 : _this$_univerInstance.getSheetBySheetId(subUnitId);
1566
1575
  if (!worksheet) return this._handleNull();
1567
- const hiddenRows = [];
1568
- for (let r = removeStartRow; r <= removeEndRow; r++) if (worksheet.getRowFiltered(r)) hiddenRows.push(r);
1576
+ const hiddenRowCount = this._getFilteredRowCount(worksheet, removeStartRow, removeEndRow);
1569
1577
  const afterStartRow = Math.min(startRow, removeStartRow);
1570
- const afterEndRow = afterStartRow + (endRow - startRow) - count + hiddenRows.length;
1578
+ const afterEndRow = afterStartRow + (endRow - startRow) - count + hiddenRowCount;
1571
1579
  const setFilterRangeMutationParams = {
1572
1580
  unitId,
1573
1581
  subUnitId,
@@ -1587,6 +1595,11 @@ let SheetsFilterController = class SheetsFilterController extends Disposable {
1587
1595
  redos: mergeSetFilterCriteria(redos)
1588
1596
  };
1589
1597
  }
1598
+ _getFilteredRowCount(worksheet, startRow, endRow) {
1599
+ let count = 0;
1600
+ for (let row = startRow; row <= endRow; row++) if (worksheet.getRowFiltered(row)) count++;
1601
+ return count;
1602
+ }
1590
1603
  handleMoveColsCommand({ fromRange, toRange }, unitId, subUnitId) {
1591
1604
  var _filterModel$getRange4;
1592
1605
  const filterModel = this._sheetsFilterService.getFilterModel(unitId, subUnitId);
@@ -2215,7 +2228,7 @@ SheetsFilterSyncController = __decorate([
2215
2228
  //#endregion
2216
2229
  //#region package.json
2217
2230
  var name = "@univerjs/sheets-filter";
2218
- var version = "0.23.0";
2231
+ var version = "0.24.0-insiders.20260527-b1d726f";
2219
2232
 
2220
2233
  //#endregion
2221
2234
  //#region src/services/sheet-filter-formula.service.ts
@@ -0,0 +1,8 @@
1
+ //#region src/locale/ar-SA.ts
2
+ const locale = { "sheets-filter": {
3
+ command: { "not-valid-filter-range": "يحتوي النطاق المحدد على صف واحد فقط وهو غير صالح للتصفية." },
4
+ msg: { "filter-header-forbidden": "لا يمكنك نقل صف الرأس الخاص بالتصفية." }
5
+ } };
6
+
7
+ //#endregion
8
+ export { locale as default };