@univerjs/sheets-filter-ui 0.2.6 → 0.2.8

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 (31) hide show
  1. package/lib/cjs/index.js +2 -2
  2. package/lib/es/index.js +331 -238
  3. package/lib/types/__testing__/data.d.ts +0 -1
  4. package/lib/types/commands/commands/sheets-filter.command.d.ts +0 -1
  5. package/lib/types/commands/operations/sheets-filter.operation.d.ts +0 -1
  6. package/lib/types/controllers/sheets-filter-mobile-ui.controller.d.ts +0 -1
  7. package/lib/types/controllers/sheets-filter-permission.controller.d.ts +0 -1
  8. package/lib/types/controllers/sheets-filter-render.controller.d.ts +0 -1
  9. package/lib/types/controllers/sheets-filter-ui.controller.d.ts +1 -1
  10. package/lib/types/controllers/sheets-filter.menu.d.ts +0 -1
  11. package/lib/types/controllers/sheets-filter.shortcut.d.ts +0 -1
  12. package/lib/types/index.d.ts +1 -0
  13. package/lib/types/locale/en-US.d.ts +0 -1
  14. package/lib/types/locale/ru-RU.d.ts +0 -1
  15. package/lib/types/locale/vi-VN.d.ts +0 -1
  16. package/lib/types/locale/zh-TW.d.ts +0 -1
  17. package/lib/types/mobile-plugin.d.ts +0 -1
  18. package/lib/types/models/conditions.d.ts +0 -1
  19. package/lib/types/models/utils.d.ts +0 -1
  20. package/lib/types/plugin.d.ts +4 -4
  21. package/lib/types/services/sheets-filter-panel.service.d.ts +5 -8
  22. package/lib/types/views/components/SheetsFilterByConditionsPanel.d.ts +0 -1
  23. package/lib/types/views/components/SheetsFilterByValuesPanel.d.ts +0 -1
  24. package/lib/types/views/components/SheetsFilterPanel.d.ts +0 -1
  25. package/lib/types/views/components/SheetsFilterPanel.stories.d.ts +0 -1
  26. package/lib/types/views/widgets/drawings.d.ts +0 -1
  27. package/lib/types/views/widgets/filter-button.shape.d.ts +0 -1
  28. package/lib/types/worker/generate-filter-values.service.d.ts +31 -0
  29. package/lib/types/worker/plugin.d.ts +12 -0
  30. package/lib/umd/index.js +2 -2
  31. package/package.json +21 -20
package/lib/es/index.js CHANGED
@@ -2,8 +2,9 @@ var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value;
3
3
  var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value);
5
- import { CommandType, IUniverInstanceService, ICommandService, IUndoRedoService, UniverInstanceType, Quantity, LocaleService, sequenceExecute, BooleanNumber, createIdentifier, Disposable, Inject, Injector, extractPureTextFromCell, IContextService, useDependency, ThemeService, RxDisposable, fromCallback, runOnLifecycle, LifecycleStages, OnLifecycle, Tools, Plugin, DependentOn } from "@univerjs/core";
5
+ import { CommandType, IUniverInstanceService, ICommandService, IUndoRedoService, UniverInstanceType, Quantity, LocaleService, sequenceExecute, BooleanNumber, createIdentifier, Disposable, Inject, extractPureTextFromCell, ILogService, Injector, IContextService, useDependency, ThemeService, RxDisposable, fromCallback, runOnLifecycle, LifecycleStages, OnLifecycle, Tools, Plugin, DependentOn, Optional } from "@univerjs/core";
6
6
  import { SheetsFilterService, RemoveSheetsFilterMutation, SetSheetsFilterRangeMutation, SetSheetsFilterCriteriaMutation, ReCalcSheetsFilterMutation, CustomFilterOperator, FILTER_MUTATIONS, UniverSheetsFilterPlugin } from "@univerjs/sheets-filter";
7
+ import { toModule, IRPCChannelService, fromModule } from "@univerjs/rpc";
7
8
  import { IMessageService, ILayoutService, useObservable, useComponentsOfPart, ComponentContainer, KeyCode, MetaKeys, MenuGroup, MenuItemType, MenuPosition, getMenuHiddenObservable, ComponentManager, IShortcutService, IMenuService } from "@univerjs/ui";
8
9
  import { BehaviorSubject, ReplaySubject, of, Subject, merge, combineLatest, throttleTime, startWith, map, shareReplay, switchMap, filter, takeUntil, distinctUntilChanged } from "rxjs";
9
10
  import { SetCellEditVisibleOperation, SheetsUIPart, whenSheetEditorFocused, getCurrentRangeDisable$, SelectionShape, getCoordByCell, SheetSkeletonManagerService, SheetsRenderService, ISheetSelectionRenderService, SheetCanvasPopManagerService, SheetPermissionInterceptorBaseController } from "@univerjs/sheets-ui";
@@ -42,15 +43,15 @@ function replaceRuntimeIdsAndExtInAttrs(node, runtimeProps, extend) {
42
43
  var attrs = __assign({}, node.attrs);
43
44
  extend != null && extend.colorChannel1 && attrs.fill === "colorChannel1" && (attrs.fill = extend.colorChannel1);
44
45
  var defIds = runtimeProps.defIds;
45
- return !defIds || defIds.length === 0 || (node.tag === "use" && attrs["xlink:href"] && (attrs["xlink:href"] = attrs["xlink:href"] + runtimeProps.idSuffix), Object.entries(attrs).forEach(function(_a11) {
46
- var key = _a11[0], value = _a11[1];
46
+ return !defIds || defIds.length === 0 || (node.tag === "use" && attrs["xlink:href"] && (attrs["xlink:href"] = attrs["xlink:href"] + runtimeProps.idSuffix), Object.entries(attrs).forEach(function(_a13) {
47
+ var key = _a13[0], value = _a13[1];
47
48
  typeof value == "string" && (attrs[key] = value.replace(/url\(#(.*)\)/, "url(#$1".concat(runtimeProps.idSuffix, ")")));
48
49
  })), attrs;
49
50
  }
50
51
  __name(replaceRuntimeIdsAndExtInAttrs, "replaceRuntimeIdsAndExtInAttrs");
51
52
  function replaceRuntimeIdsInDefs(node, runtimeProps) {
52
- var _a11, defIds = runtimeProps.defIds;
53
- return !defIds || defIds.length === 0 ? node : node.tag === "defs" && (!((_a11 = node.children) === null || _a11 === void 0) && _a11.length) ? __assign(__assign({}, node), { children: node.children.map(function(child) {
53
+ var _a13, defIds = runtimeProps.defIds;
54
+ return !defIds || defIds.length === 0 ? node : node.tag === "defs" && (!((_a13 = node.children) === null || _a13 === void 0) && _a13.length) ? __assign(__assign({}, node), { children: node.children.map(function(child) {
54
55
  return typeof child.attrs.id == "string" && defIds && defIds.indexOf(child.attrs.id) > -1 ? __assign(__assign({}, child), { attrs: __assign(__assign({}, child.attrs), { id: child.attrs.id + runtimeProps.idSuffix }) }) : child;
55
56
  }) }) : node;
56
57
  }
@@ -160,9 +161,9 @@ function destructFilterModel(unitId, subUnitId, autoFilter) {
160
161
  }
161
162
  __name(destructFilterModel, "destructFilterModel");
162
163
  function destructFilterCriteria(unitId, subUnitId, autoFilter) {
163
- var _a11;
164
+ var _a13;
164
165
  const mutations = [];
165
- return (_a11 = autoFilter.filterColumns) == null || _a11.forEach((filterColumn) => {
166
+ return (_a13 = autoFilter.filterColumns) == null || _a13.forEach((filterColumn) => {
166
167
  const setFilterCriteriaMutation = {
167
168
  id: SetSheetsFilterCriteriaMutation.id,
168
169
  params: {
@@ -177,9 +178,9 @@ function destructFilterCriteria(unitId, subUnitId, autoFilter) {
177
178
  }
178
179
  __name(destructFilterCriteria, "destructFilterCriteria");
179
180
  function generateRemoveCriteriaMutations(unitId, subUnitId, autoFilter) {
180
- var _a11;
181
+ var _a13;
181
182
  const mutations = [];
182
- return (_a11 = autoFilter.filterColumns) == null || _a11.forEach((filterColumn) => {
183
+ return (_a13 = autoFilter.filterColumns) == null || _a13.forEach((filterColumn) => {
183
184
  const removeFilterCriteriaMutation = {
184
185
  id: SetSheetsFilterCriteriaMutation.id,
185
186
  params: {
@@ -240,8 +241,8 @@ var OperatorOrder = /* @__PURE__ */ ((OperatorOrder2) => (OperatorOrder2[Operato
240
241
  testMappingParams: /* @__PURE__ */ __name(({ operator1 }) => operator1 === ExtendCustomFilterOperator.EMPTY, "testMappingParams"),
241
242
  mapToFilterColumn: /* @__PURE__ */ __name(() => ({ customFilters: { customFilters: [{ val: "" }] } }), "mapToFilterColumn"),
242
243
  testMappingFilterColumn: /* @__PURE__ */ __name((filterColumn) => {
243
- var _a11;
244
- if (((_a11 = filterColumn.customFilters) == null ? void 0 : _a11.customFilters.length) !== 1)
244
+ var _a13;
245
+ if (((_a13 = filterColumn.customFilters) == null ? void 0 : _a13.customFilters.length) !== 1)
245
246
  return !1;
246
247
  const firstCustomFilter = filterColumn.customFilters.customFilters[0];
247
248
  return firstCustomFilter.val === "" && firstCustomFilter.operator === void 0 ? { operator1: ExtendCustomFilterOperator.EMPTY } : !1;
@@ -257,8 +258,8 @@ var OperatorOrder = /* @__PURE__ */ ((OperatorOrder2) => (OperatorOrder2[Operato
257
258
  testMappingParams: /* @__PURE__ */ __name(({ operator1 }) => operator1 === ExtendCustomFilterOperator.NOT_EMPTY, "testMappingParams"),
258
259
  mapToFilterColumn: /* @__PURE__ */ __name(() => ({ customFilters: { customFilters: [{ val: "", operator: CustomFilterOperator.NOT_EQUALS }] } }), "mapToFilterColumn"),
259
260
  testMappingFilterColumn: /* @__PURE__ */ __name((filterColumn) => {
260
- var _a11;
261
- if (((_a11 = filterColumn.customFilters) == null ? void 0 : _a11.customFilters.length) !== 1)
261
+ var _a13;
262
+ if (((_a13 = filterColumn.customFilters) == null ? void 0 : _a13.customFilters.length) !== 1)
262
263
  return !1;
263
264
  const firstCustomFilter = filterColumn.customFilters.customFilters[0];
264
265
  return firstCustomFilter.val === " " && firstCustomFilter.operator === CustomFilterOperator.NOT_EQUALS ? { operator1: ExtendCustomFilterOperator.NOT_EMPTY } : !1;
@@ -280,8 +281,8 @@ var OperatorOrder = /* @__PURE__ */ ((OperatorOrder2) => (OperatorOrder2[Operato
280
281
  };
281
282
  }, "mapToFilterColumn"),
282
283
  testMappingFilterColumn: /* @__PURE__ */ __name((filterColumn) => {
283
- var _a11;
284
- if (((_a11 = filterColumn.customFilters) == null ? void 0 : _a11.customFilters.length) !== 1)
284
+ var _a13;
285
+ if (((_a13 = filterColumn.customFilters) == null ? void 0 : _a13.customFilters.length) !== 1)
285
286
  return !1;
286
287
  const firstCustomFilter = filterColumn.customFilters.customFilters[0], valAsString = firstCustomFilter.val.toString();
287
288
  return !firstCustomFilter.operator && valAsString.startsWith("*") && valAsString.endsWith("*") ? { operator1: ExtendCustomFilterOperator.CONTAINS, val1: valAsString.slice(1, -1) } : !1;
@@ -300,8 +301,8 @@ var OperatorOrder = /* @__PURE__ */ ((OperatorOrder2) => (OperatorOrder2[Operato
300
301
  return op === ExtendCustomFilterOperator.DOES_NOT_CONTAIN;
301
302
  }, "testMappingParams"),
302
303
  testMappingFilterColumn: /* @__PURE__ */ __name((filterColumn) => {
303
- var _a11;
304
- if (((_a11 = filterColumn.customFilters) == null ? void 0 : _a11.customFilters.length) !== 1)
304
+ var _a13;
305
+ if (((_a13 = filterColumn.customFilters) == null ? void 0 : _a13.customFilters.length) !== 1)
305
306
  return !1;
306
307
  const firstCustomFilter = filterColumn.customFilters.customFilters[0], valAsString = firstCustomFilter.val.toString();
307
308
  return firstCustomFilter.operator === CustomFilterOperator.NOT_EQUALS && valAsString.startsWith("*") && valAsString.endsWith("*") ? { operator1: ExtendCustomFilterOperator.DOES_NOT_CONTAIN, val1: valAsString.slice(1, -1) } : !1;
@@ -320,8 +321,8 @@ var OperatorOrder = /* @__PURE__ */ ((OperatorOrder2) => (OperatorOrder2[Operato
320
321
  return op === ExtendCustomFilterOperator.STARTS_WITH;
321
322
  }, "testMappingParams"),
322
323
  testMappingFilterColumn: /* @__PURE__ */ __name((filterColumn) => {
323
- var _a11;
324
- if (((_a11 = filterColumn.customFilters) == null ? void 0 : _a11.customFilters.length) !== 1)
324
+ var _a13;
325
+ if (((_a13 = filterColumn.customFilters) == null ? void 0 : _a13.customFilters.length) !== 1)
325
326
  return !1;
326
327
  const firstCustomFilter = filterColumn.customFilters.customFilters[0], valAsString = firstCustomFilter.val.toString();
327
328
  return !firstCustomFilter.operator && valAsString.endsWith("*") && !valAsString.startsWith("*") ? { operator1: ExtendCustomFilterOperator.STARTS_WITH, val1: valAsString.slice(0, -1) } : !1;
@@ -340,8 +341,8 @@ var OperatorOrder = /* @__PURE__ */ ((OperatorOrder2) => (OperatorOrder2[Operato
340
341
  return op === ExtendCustomFilterOperator.ENDS_WITH;
341
342
  }, "testMappingParams"),
342
343
  testMappingFilterColumn: /* @__PURE__ */ __name((filterColumn) => {
343
- var _a11;
344
- if (((_a11 = filterColumn.customFilters) == null ? void 0 : _a11.customFilters.length) !== 1)
344
+ var _a13;
345
+ if (((_a13 = filterColumn.customFilters) == null ? void 0 : _a13.customFilters.length) !== 1)
345
346
  return !1;
346
347
  const firstCustomFilter = filterColumn.customFilters.customFilters[0], valAsString = firstCustomFilter.val.toString();
347
348
  return !firstCustomFilter.operator && valAsString.startsWith("*") && !valAsString.endsWith("*") ? { operator1: ExtendCustomFilterOperator.ENDS_WITH, val1: valAsString.slice(1) } : !1;
@@ -363,8 +364,8 @@ var OperatorOrder = /* @__PURE__ */ ((OperatorOrder2) => (OperatorOrder2[Operato
363
364
  };
364
365
  }, "mapToFilterColumn"),
365
366
  testMappingFilterColumn: /* @__PURE__ */ __name((filterColumn) => {
366
- var _a11, _b, _c;
367
- return ((_b = (_a11 = filterColumn.filters) == null ? void 0 : _a11.filters) == null ? void 0 : _b.length) === 1 ? { operator1: ExtendCustomFilterOperator.EQUALS, val1: "" } : ((_c = filterColumn.customFilters) == null ? void 0 : _c.customFilters.length) === 1 && !filterColumn.customFilters.customFilters[0].operator ? { operator1: ExtendCustomFilterOperator.EQUALS, val1: filterColumn.customFilters.customFilters[0].val.toString() } : !1;
367
+ var _a13, _b, _c;
368
+ return ((_b = (_a13 = filterColumn.filters) == null ? void 0 : _a13.filters) == null ? void 0 : _b.length) === 1 ? { operator1: ExtendCustomFilterOperator.EQUALS, val1: "" } : ((_c = filterColumn.customFilters) == null ? void 0 : _c.customFilters.length) === 1 && !filterColumn.customFilters.customFilters[0].operator ? { operator1: ExtendCustomFilterOperator.EQUALS, val1: filterColumn.customFilters.customFilters[0].val.toString() } : !1;
368
369
  }, "testMappingFilterColumn")
369
370
  }, FilterConditionItems2.GREATER_THAN = {
370
371
  label: "sheets-filter.conditions.greater-than",
@@ -380,8 +381,8 @@ var OperatorOrder = /* @__PURE__ */ ((OperatorOrder2) => (OperatorOrder2[Operato
380
381
  return op === CustomFilterOperator.GREATER_THAN;
381
382
  }, "testMappingParams"),
382
383
  testMappingFilterColumn: /* @__PURE__ */ __name((filterColumn) => {
383
- var _a11;
384
- if (((_a11 = filterColumn.customFilters) == null ? void 0 : _a11.customFilters.length) !== 1)
384
+ var _a13;
385
+ if (((_a13 = filterColumn.customFilters) == null ? void 0 : _a13.customFilters.length) !== 1)
385
386
  return !1;
386
387
  const firstCustomFilter = filterColumn.customFilters.customFilters[0];
387
388
  return firstCustomFilter.operator !== CustomFilterOperator.GREATER_THAN ? !1 : { operator1: CustomFilterOperator.GREATER_THAN, val1: firstCustomFilter.val.toString() };
@@ -400,8 +401,8 @@ var OperatorOrder = /* @__PURE__ */ ((OperatorOrder2) => (OperatorOrder2[Operato
400
401
  customFilters: { customFilters: [{ val: mapParams.val1, operator: CustomFilterOperator.GREATER_THAN_OR_EQUAL }] }
401
402
  }), "mapToFilterColumn"),
402
403
  testMappingFilterColumn: /* @__PURE__ */ __name((filterColumn) => {
403
- var _a11;
404
- if (((_a11 = filterColumn.customFilters) == null ? void 0 : _a11.customFilters.length) !== 1)
404
+ var _a13;
405
+ if (((_a13 = filterColumn.customFilters) == null ? void 0 : _a13.customFilters.length) !== 1)
405
406
  return !1;
406
407
  const firstCustomFilter = filterColumn.customFilters.customFilters[0];
407
408
  return firstCustomFilter.operator !== CustomFilterOperator.GREATER_THAN_OR_EQUAL ? !1 : { operator1: CustomFilterOperator.GREATER_THAN_OR_EQUAL, val1: firstCustomFilter.val.toString() };
@@ -420,8 +421,8 @@ var OperatorOrder = /* @__PURE__ */ ((OperatorOrder2) => (OperatorOrder2[Operato
420
421
  customFilters: { customFilters: [{ val: mapParams.val1, operator: CustomFilterOperator.LESS_THAN }] }
421
422
  }), "mapToFilterColumn"),
422
423
  testMappingFilterColumn: /* @__PURE__ */ __name((filterColumn) => {
423
- var _a11;
424
- if (((_a11 = filterColumn.customFilters) == null ? void 0 : _a11.customFilters.length) !== 1)
424
+ var _a13;
425
+ if (((_a13 = filterColumn.customFilters) == null ? void 0 : _a13.customFilters.length) !== 1)
425
426
  return !1;
426
427
  const firstCustomFilter = filterColumn.customFilters.customFilters[0];
427
428
  return firstCustomFilter.operator !== CustomFilterOperator.LESS_THAN ? !1 : { operator1: CustomFilterOperator.LESS_THAN, val1: firstCustomFilter.val.toString() };
@@ -440,8 +441,8 @@ var OperatorOrder = /* @__PURE__ */ ((OperatorOrder2) => (OperatorOrder2[Operato
440
441
  customFilters: { customFilters: [{ val: mapParams.val1, operator: CustomFilterOperator.LESS_THAN_OR_EQUAL }] }
441
442
  }), "mapToFilterColumn"),
442
443
  testMappingFilterColumn: /* @__PURE__ */ __name((filterColumn) => {
443
- var _a11;
444
- if (((_a11 = filterColumn.customFilters) == null ? void 0 : _a11.customFilters.length) !== 1)
444
+ var _a13;
445
+ if (((_a13 = filterColumn.customFilters) == null ? void 0 : _a13.customFilters.length) !== 1)
445
446
  return !1;
446
447
  const firstCustomFilter = filterColumn.customFilters.customFilters[0];
447
448
  return firstCustomFilter.operator !== CustomFilterOperator.LESS_THAN_OR_EQUAL ? !1 : { operator1: CustomFilterOperator.LESS_THAN_OR_EQUAL, val1: firstCustomFilter.val.toString() };
@@ -460,8 +461,8 @@ var OperatorOrder = /* @__PURE__ */ ((OperatorOrder2) => (OperatorOrder2[Operato
460
461
  customFilters: { customFilters: [{ val: mapParams.val1, operator: CustomFilterOperator.EQUAL }] }
461
462
  }), "mapToFilterColumn"),
462
463
  testMappingFilterColumn: /* @__PURE__ */ __name((filterColumn) => {
463
- var _a11;
464
- if (((_a11 = filterColumn.customFilters) == null ? void 0 : _a11.customFilters.length) !== 1)
464
+ var _a13;
465
+ if (((_a13 = filterColumn.customFilters) == null ? void 0 : _a13.customFilters.length) !== 1)
465
466
  return !1;
466
467
  const firstCustomFilter = filterColumn.customFilters.customFilters[0];
467
468
  return firstCustomFilter.operator !== CustomFilterOperator.EQUAL ? !1 : { operator1: CustomFilterOperator.EQUAL, val1: firstCustomFilter.val.toString() };
@@ -480,8 +481,8 @@ var OperatorOrder = /* @__PURE__ */ ((OperatorOrder2) => (OperatorOrder2[Operato
480
481
  customFilters: { customFilters: [{ val: mapParams.val1, operator: CustomFilterOperator.NOT_EQUALS }] }
481
482
  }), "mapToFilterColumn"),
482
483
  testMappingFilterColumn: /* @__PURE__ */ __name((filterColumn) => {
483
- var _a11;
484
- if (((_a11 = filterColumn.customFilters) == null ? void 0 : _a11.customFilters.length) !== 1)
484
+ var _a13;
485
+ if (((_a13 = filterColumn.customFilters) == null ? void 0 : _a13.customFilters.length) !== 1)
485
486
  return !1;
486
487
  const firstCustomFilter = filterColumn.customFilters.customFilters[0];
487
488
  return firstCustomFilter.operator !== CustomFilterOperator.NOT_EQUALS ? !1 : { operator1: CustomFilterOperator.NOT_EQUALS, val1: firstCustomFilter.val.toString() };
@@ -517,8 +518,8 @@ var OperatorOrder = /* @__PURE__ */ ((OperatorOrder2) => (OperatorOrder2[Operato
517
518
  };
518
519
  }, "mapToFilterColumn"),
519
520
  testMappingFilterColumn: /* @__PURE__ */ __name((filterColumn) => {
520
- var _a11;
521
- if (((_a11 = filterColumn.customFilters) == null ? void 0 : _a11.customFilters.length) !== 2)
521
+ var _a13;
522
+ if (((_a13 = filterColumn.customFilters) == null ? void 0 : _a13.customFilters.length) !== 2)
522
523
  return !1;
523
524
  const [firstCustomFilter, secondCustomFilter] = filterColumn.customFilters.customFilters;
524
525
  return firstCustomFilter.operator === CustomFilterOperator.GREATER_THAN_OR_EQUAL && secondCustomFilter.operator === CustomFilterOperator.LESS_THAN_OR_EQUAL && filterColumn.customFilters.and ? {
@@ -564,8 +565,8 @@ var OperatorOrder = /* @__PURE__ */ ((OperatorOrder2) => (OperatorOrder2[Operato
564
565
  };
565
566
  }, "mapToFilterColumn"),
566
567
  testMappingFilterColumn: /* @__PURE__ */ __name((filterColumn) => {
567
- var _a11;
568
- if (((_a11 = filterColumn.customFilters) == null ? void 0 : _a11.customFilters.length) !== 2)
568
+ var _a13;
569
+ if (((_a13 = filterColumn.customFilters) == null ? void 0 : _a13.customFilters.length) !== 2)
569
570
  return !1;
570
571
  const [firstCustomFilter, secondCustomFilter] = filterColumn.customFilters.customFilters;
571
572
  return firstCustomFilter.operator === CustomFilterOperator.LESS_THAN && secondCustomFilter.operator === CustomFilterOperator.GREATER_THAN && !filterColumn.customFilters.and ? {
@@ -616,8 +617,8 @@ var OperatorOrder = /* @__PURE__ */ ((OperatorOrder2) => (OperatorOrder2[Operato
616
617
  return and && (customFilters.and = BooleanNumber.TRUE), { customFilters };
617
618
  }, "mapToFilterColumn"),
618
619
  testMappingFilterColumn: /* @__PURE__ */ __name((filterColumn) => {
619
- var _a11;
620
- if (((_a11 = filterColumn.customFilters) == null ? void 0 : _a11.customFilters.length) !== 2)
620
+ var _a13;
621
+ if (((_a13 = filterColumn.customFilters) == null ? void 0 : _a13.customFilters.length) !== 2)
621
622
  return !1;
622
623
  const params = filterColumn.customFilters.customFilters.map((customFilter) => testMappingFilterColumn({ customFilters: { customFilters: [customFilter] } })), result = {
623
624
  operator1: params[0][0].operator,
@@ -710,15 +711,92 @@ function statisticFilterByValueItems(items) {
710
711
  };
711
712
  }
712
713
  __name(statisticFilterByValueItems, "statisticFilterByValueItems");
713
- var __defProp$7 = Object.defineProperty, __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor, __decorateClass$7 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
714
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
714
+ var __defProp$9 = Object.defineProperty, __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor, __decorateClass$9 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
715
+ for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
715
716
  (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
716
- return kind && result && __defProp$7(target, key, result), result;
717
- }, "__decorateClass$7"), __decorateParam$7 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$7"), FilterBy = /* @__PURE__ */ ((FilterBy2) => (FilterBy2[FilterBy2.VALUES = 0] = "VALUES", FilterBy2[FilterBy2.CONDITIONS = 1] = "CONDITIONS", FilterBy2))(FilterBy || {});
718
- createIdentifier("sheets-filter-ui.sheets-filter-panel.service");
717
+ return kind && result && __defProp$9(target, key, result), result;
718
+ }, "__decorateClass$9"), __decorateParam$9 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$9");
719
+ const SHEETS_GENERATE_FILTER_VALUES_SERVICE_NAME = "sheets-filter.generate-filter-values.service", ISheetsGenerateFilterValuesService = createIdentifier(SHEETS_GENERATE_FILTER_VALUES_SERVICE_NAME);
719
720
  var _a;
720
- let SheetsFilterPanelService = (_a = class extends Disposable {
721
- constructor(_injector, _sheetsFilterService, _univerInstanceService, _refRangeService) {
721
+ let SheetsGenerateFilterValuesService = (_a = class extends Disposable {
722
+ constructor(_localeService, _univerInstanceService, _logService) {
723
+ super(), this._localeService = _localeService, this._univerInstanceService = _univerInstanceService, this._logService = _logService;
724
+ }
725
+ async getFilterValues(params) {
726
+ var _a13;
727
+ const { unitId, subUnitId, filteredOutRowsByOtherColumns, filters, blankChecked, iterateRange, alreadyChecked } = params, worksheet = (_a13 = this._univerInstanceService.getUnit(unitId)) == null ? void 0 : _a13.getSheetBySheetId(subUnitId);
728
+ return worksheet ? (this._logService.debug("[SheetsGenerateFilterValuesService]", "getFilterValues for", { unitId, subUnitId }), getFilterByValueItems(
729
+ filters,
730
+ blankChecked,
731
+ this._localeService,
732
+ iterateRange,
733
+ worksheet,
734
+ new Set(alreadyChecked.map(String)),
735
+ new Set(filteredOutRowsByOtherColumns)
736
+ )) : [];
737
+ }
738
+ }, __name(_a, "SheetsGenerateFilterValuesService"), _a);
739
+ SheetsGenerateFilterValuesService = __decorateClass$9([
740
+ __decorateParam$9(0, Inject(LocaleService)),
741
+ __decorateParam$9(1, IUniverInstanceService),
742
+ __decorateParam$9(2, ILogService)
743
+ ], SheetsGenerateFilterValuesService);
744
+ function getFilterByValueItems(filters, blankChecked, localeService, iterateRange, worksheet, alreadyChecked, filteredOutRowsByOtherColumns) {
745
+ const items = [], itemsByKey = {};
746
+ let index2 = 0, emptyCount = 0;
747
+ for (const cell of worksheet.iterateByColumn(iterateRange, !1, !1)) {
748
+ const { row, rowSpan = 1 } = cell;
749
+ let rowIndex = 0;
750
+ for (; rowIndex < rowSpan; ) {
751
+ const targetRow = row + rowIndex;
752
+ if (filteredOutRowsByOtherColumns.has(targetRow)) {
753
+ rowIndex++;
754
+ continue;
755
+ }
756
+ const value = cell != null && cell.value ? extractPureTextFromCell(cell.value) : "";
757
+ if (!value) {
758
+ emptyCount += 1, rowIndex += rowSpan;
759
+ continue;
760
+ }
761
+ if (itemsByKey[value])
762
+ itemsByKey[value].count++;
763
+ else {
764
+ const item = {
765
+ value,
766
+ checked: alreadyChecked.size ? alreadyChecked.has(value) : !blankChecked,
767
+ count: 1,
768
+ index: index2,
769
+ isEmpty: !1
770
+ };
771
+ itemsByKey[value] = item, items.push(item);
772
+ }
773
+ rowIndex++;
774
+ }
775
+ index2++;
776
+ }
777
+ const initialBlankChecked = filters ? blankChecked : !0;
778
+ if (emptyCount > 0) {
779
+ const item = {
780
+ value: localeService.t("sheets-filter.panel.empty"),
781
+ checked: initialBlankChecked,
782
+ count: emptyCount,
783
+ index: index2,
784
+ isEmpty: !0
785
+ };
786
+ items.push(item);
787
+ }
788
+ return items;
789
+ }
790
+ __name(getFilterByValueItems, "getFilterByValueItems");
791
+ var __defProp$8 = Object.defineProperty, __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor, __decorateClass$8 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
792
+ for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
793
+ (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
794
+ return kind && result && __defProp$8(target, key, result), result;
795
+ }, "__decorateClass$8"), __decorateParam$8 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$8"), FilterBy = /* @__PURE__ */ ((FilterBy2) => (FilterBy2[FilterBy2.VALUES = 0] = "VALUES", FilterBy2[FilterBy2.CONDITIONS = 1] = "CONDITIONS", FilterBy2))(FilterBy || {});
796
+ createIdentifier("sheets-filter-ui.sheets-filter-panel.service");
797
+ var _a2;
798
+ let SheetsFilterPanelService = (_a2 = class extends Disposable {
799
+ constructor(_injector, _refRangeService) {
722
800
  super();
723
801
  __publicField(this, "_filterBy$", new BehaviorSubject(
724
802
  0
@@ -734,7 +812,7 @@ let SheetsFilterPanelService = (_a = class extends Disposable {
734
812
  __publicField(this, "_col$", new BehaviorSubject(-1));
735
813
  __publicField(this, "col$", this._col$.asObservable());
736
814
  __publicField(this, "_filterHeaderListener", null);
737
- this._injector = _injector, this._sheetsFilterService = _sheetsFilterService, this._univerInstanceService = _univerInstanceService, this._refRangeService = _refRangeService;
815
+ this._injector = _injector, this._refRangeService = _refRangeService;
738
816
  }
739
817
  get filterBy() {
740
818
  return this._filterBy$.getValue();
@@ -759,9 +837,18 @@ let SheetsFilterPanelService = (_a = class extends Disposable {
759
837
  const filterColumn = filterModel.getFilterColumn(col);
760
838
  if (filterColumn) {
761
839
  const info = filterColumn.getColumnData();
762
- return info.customFilters ? (this._hasCriteria$.next(!0), this._setupByConditions(filterModel, col)) : info.filters ? (this._hasCriteria$.next(!0), this._setupByValues(filterModel, col)) : (this._hasCriteria$.next(!1), this._setupByValues(filterModel, col));
840
+ if (info.customFilters) {
841
+ this._hasCriteria$.next(!0), this._setupByConditions(filterModel, col);
842
+ return;
843
+ }
844
+ if (info.filters) {
845
+ this._hasCriteria$.next(!0), this._setupByValues(filterModel, col);
846
+ return;
847
+ }
848
+ this._hasCriteria$.next(!1), this._setupByValues(filterModel, col);
849
+ return;
763
850
  }
764
- return this._hasCriteria$.next(!1), this._setupByValues(filterModel, col);
851
+ this._hasCriteria$.next(!1), this._setupByValues(filterModel, col);
765
852
  }
766
853
  changeFilterBy(filterBy) {
767
854
  return !this._filterModel || this.col === -1 ? !1 : (filterBy === 0 ? this._setupByValues(this._filterModel, this.col) : this._setupByConditions(this._filterModel, this.col), !0);
@@ -770,8 +857,8 @@ let SheetsFilterPanelService = (_a = class extends Disposable {
770
857
  return this._filterModel = null, this._col$.next(-1), this._disposeFilterHeaderChangeListener(), !0;
771
858
  }
772
859
  _disposeFilterHeaderChangeListener() {
773
- var _a11;
774
- (_a11 = this._filterHeaderListener) == null || _a11.dispose(), this._filterHeaderListener = null;
860
+ var _a13;
861
+ (_a13 = this._filterHeaderListener) == null || _a13.dispose(), this._filterHeaderListener = null;
775
862
  }
776
863
  _listenToFilterHeaderChange(filterModel, col) {
777
864
  this._disposeFilterHeaderChangeListener();
@@ -790,16 +877,16 @@ let SheetsFilterPanelService = (_a = class extends Disposable {
790
877
  }
791
878
  });
792
879
  }
793
- _setupByValues(filterModel, col) {
880
+ async _setupByValues(filterModel, col) {
794
881
  this._disposePreviousModel();
795
882
  const range = filterModel.getRange();
796
883
  if (range.startRow === range.endRow) return !1;
797
- const model = ByValuesModel.fromFilterColumn(
884
+ const filterByModel = await ByValuesModel.fromFilterColumn(
798
885
  this._injector,
799
886
  filterModel,
800
887
  col
801
888
  );
802
- return this.filterByModel = model, this._filterBy$.next(
889
+ return this.filterByModel = filterByModel, this._filterBy$.next(
803
890
  0
804
891
  /* VALUES */
805
892
  ), this._listenToFilterHeaderChange(filterModel, col), !0;
@@ -820,18 +907,16 @@ let SheetsFilterPanelService = (_a = class extends Disposable {
820
907
  ), this._listenToFilterHeaderChange(filterModel, col), !0;
821
908
  }
822
909
  _disposePreviousModel() {
823
- var _a11;
824
- (_a11 = this._filterByModel) == null || _a11.dispose(), this.filterByModel = null;
825
- }
826
- }, __name(_a, "SheetsFilterPanelService"), _a);
827
- SheetsFilterPanelService = __decorateClass$7([
828
- __decorateParam$7(0, Inject(Injector)),
829
- __decorateParam$7(1, Inject(SheetsFilterService)),
830
- __decorateParam$7(2, IUniverInstanceService),
831
- __decorateParam$7(3, Inject(RefRangeService))
910
+ var _a13;
911
+ (_a13 = this._filterByModel) == null || _a13.dispose(), this.filterByModel = null;
912
+ }
913
+ }, __name(_a2, "SheetsFilterPanelService"), _a2);
914
+ SheetsFilterPanelService = __decorateClass$8([
915
+ __decorateParam$8(0, Inject(Injector)),
916
+ __decorateParam$8(1, Inject(RefRangeService))
832
917
  ], SheetsFilterPanelService);
833
- var _a2;
834
- let ByConditionsModel = (_a2 = class extends Disposable {
918
+ var _a3;
919
+ let ByConditionsModel = (_a3 = class extends Disposable {
835
920
  constructor(_filterModel, col, conditionItem, conditionParams, _commandService) {
836
921
  super();
837
922
  __publicField(this, "canApply$", of(!0));
@@ -915,12 +1000,12 @@ let ByConditionsModel = (_a2 = class extends Disposable {
915
1000
  }
916
1001
  this._filterConditionFormParams$.next(newParams);
917
1002
  }
918
- }, __name(_a2, "ByConditionsModel"), _a2);
919
- ByConditionsModel = __decorateClass$7([
920
- __decorateParam$7(4, ICommandService)
1003
+ }, __name(_a3, "ByConditionsModel"), _a3);
1004
+ ByConditionsModel = __decorateClass$8([
1005
+ __decorateParam$8(4, ICommandService)
921
1006
  ], ByConditionsModel);
922
- var _a3;
923
- let ByValuesModel = (_a3 = class extends Disposable {
1007
+ var _a4;
1008
+ let ByValuesModel = (_a4 = class extends Disposable {
924
1009
  constructor(_filterModel, col, items, _commandService) {
925
1010
  super();
926
1011
  __publicField(this, "_rawFilterItems$");
@@ -961,56 +1046,31 @@ let ByValuesModel = (_a3 = class extends Disposable {
961
1046
  *
962
1047
  * @returns the model to control the panel's state
963
1048
  */
964
- static fromFilterColumn(injector, filterModel, col) {
965
- var _a11;
966
- const univerInstanceService = injector.get(IUniverInstanceService), localeService = injector.get(LocaleService), { unitId, subUnitId } = filterModel, workbook = univerInstanceService.getUniverSheetInstance(unitId);
1049
+ static async fromFilterColumn(injector, filterModel, col) {
1050
+ var _a13;
1051
+ const univerInstanceService = injector.get(IUniverInstanceService), localeService = injector.get(LocaleService), generateFilterValuesService = injector.get(ISheetsGenerateFilterValuesService, Quantity.OPTIONAL), { unitId, subUnitId } = filterModel, workbook = univerInstanceService.getUniverSheetInstance(unitId);
967
1052
  if (!workbook) throw new Error(`[ByValuesModel]: Workbook not found for filter model with unitId: ${unitId}!`);
968
1053
  const worksheet = workbook == null ? void 0 : workbook.getSheetBySheetId(subUnitId);
969
1054
  if (!worksheet) throw new Error(`[ByValuesModel]: Worksheet not found for filter model with unitId: ${unitId} and subUnitId: ${subUnitId}!`);
970
- const range = filterModel.getRange(), column = col, filters = (_a11 = filterModel.getFilterColumn(col)) == null ? void 0 : _a11.getColumnData().filters, blankChecked = !!(filters && filters.blank), iterateRange = { ...range, startRow: range.startRow + 1, startColumn: column, endColumn: column }, items = [], itemsByKey = {}, alreadyChecked = new Set(filters == null ? void 0 : filters.filters), filteredOutRowsByOtherColumns = filterModel.getFilteredOutRowsExceptCol(col);
971
- let index2 = 0, emptyCount = 0;
972
- for (const cell of worksheet.iterateByColumn(iterateRange, !1, !1)) {
973
- const { row, rowSpan = 1 } = cell;
974
- let rowIndex = 0;
975
- for (; rowIndex < rowSpan; ) {
976
- const targetRow = row + rowIndex;
977
- if (filteredOutRowsByOtherColumns.has(targetRow)) {
978
- rowIndex++;
979
- continue;
980
- }
981
- const value = cell != null && cell.value ? extractPureTextFromCell(cell.value) : "";
982
- if (!value) {
983
- emptyCount += 1, rowIndex += rowSpan;
984
- continue;
985
- }
986
- if (itemsByKey[value])
987
- itemsByKey[value].count++;
988
- else {
989
- const item = {
990
- value,
991
- checked: alreadyChecked.size ? alreadyChecked.has(value) : !blankChecked,
992
- count: 1,
993
- index: index2,
994
- isEmpty: !1
995
- };
996
- itemsByKey[value] = item, items.push(item);
997
- }
998
- rowIndex++;
999
- }
1000
- index2++;
1001
- }
1002
- const initialBlankChecked = filters ? blankChecked : !0;
1003
- if (emptyCount > 0) {
1004
- const item = {
1005
- value: localeService.t("sheets-filter.panel.empty"),
1006
- checked: initialBlankChecked,
1007
- count: emptyCount,
1008
- index: index2,
1009
- isEmpty: !0
1010
- };
1011
- items.push(item);
1012
- }
1013
- return injector.createInstance(ByValuesModel, filterModel, col, items);
1055
+ const range = filterModel.getRange(), column = col, filters = (_a13 = filterModel.getFilterColumn(col)) == null ? void 0 : _a13.getColumnData().filters, alreadyChecked = new Set(filters == null ? void 0 : filters.filters), blankChecked = !!(filters && filters.blank), filteredOutRowsByOtherColumns = filterModel.getFilteredOutRowsExceptCol(col), iterateRange = { ...range, startRow: range.startRow + 1, startColumn: column, endColumn: column };
1056
+ let items;
1057
+ return generateFilterValuesService ? items = await generateFilterValuesService.getFilterValues({
1058
+ unitId,
1059
+ subUnitId,
1060
+ filteredOutRowsByOtherColumns: Array.from(filteredOutRowsByOtherColumns),
1061
+ filters: !!filters,
1062
+ blankChecked,
1063
+ iterateRange,
1064
+ alreadyChecked: Array.from(alreadyChecked)
1065
+ }) : items = getFilterByValueItems(
1066
+ !!filters,
1067
+ blankChecked,
1068
+ localeService,
1069
+ iterateRange,
1070
+ worksheet,
1071
+ alreadyChecked,
1072
+ filteredOutRowsByOtherColumns
1073
+ ), injector.createInstance(ByValuesModel, filterModel, col, items);
1014
1074
  }
1015
1075
  get rawFilterItems() {
1016
1076
  return this._rawFilterItems$.getValue();
@@ -1084,9 +1144,9 @@ let ByValuesModel = (_a3 = class extends Disposable {
1084
1144
  });
1085
1145
  }
1086
1146
  // #endregion
1087
- }, __name(_a3, "ByValuesModel"), _a3);
1088
- ByValuesModel = __decorateClass$7([
1089
- __decorateParam$7(3, ICommandService)
1147
+ }, __name(_a4, "ByValuesModel"), _a4);
1148
+ ByValuesModel = __decorateClass$8([
1149
+ __decorateParam$8(3, ICommandService)
1090
1150
  ], ByValuesModel);
1091
1151
  const FILTER_PANEL_OPENED_KEY = "FILTER_PANEL_OPENED", OpenFilterPanelOperation = {
1092
1152
  id: "sheet.operation.open-filter-panel",
@@ -1095,7 +1155,7 @@ const FILTER_PANEL_OPENED_KEY = "FILTER_PANEL_OPENED", OpenFilterPanelOperation
1095
1155
  const contextService = accessor.get(IContextService), sheetsFilterService = accessor.get(SheetsFilterService), sheetsFilterPanelService = accessor.get(SheetsFilterPanelService);
1096
1156
  accessor.get(ICommandService).syncExecuteCommand(SetCellEditVisibleOperation.id, { visible: !1 });
1097
1157
  const { unitId, subUnitId, col } = params, filterModel = sheetsFilterService.getFilterModel(unitId, subUnitId);
1098
- return !filterModel || !sheetsFilterPanelService.setupCol(filterModel, col) ? !1 : (contextService.getContextValue(FILTER_PANEL_OPENED_KEY) || contextService.setContextValue(FILTER_PANEL_OPENED_KEY, !0), !0);
1158
+ return filterModel ? (sheetsFilterPanelService.setupCol(filterModel, col), contextService.getContextValue(FILTER_PANEL_OPENED_KEY) || contextService.setContextValue(FILTER_PANEL_OPENED_KEY, !0), !0) : !1;
1099
1159
  }, "handler")
1100
1160
  }, CloseFilterPanelOperation = {
1101
1161
  id: "sheet.operation.close-filter-panel",
@@ -1610,8 +1670,8 @@ var MapShim = function() {
1610
1670
  this.__entries__.splice(0);
1611
1671
  }, class_1.prototype.forEach = function(callback, ctx) {
1612
1672
  ctx === void 0 && (ctx = null);
1613
- for (var _i = 0, _a11 = this.__entries__; _i < _a11.length; _i++) {
1614
- var entry = _a11[_i];
1673
+ for (var _i = 0, _a13 = this.__entries__; _i < _a13.length; _i++) {
1674
+ var entry = _a13[_i];
1615
1675
  callback.call(ctx, entry[1], entry[0]);
1616
1676
  }
1617
1677
  }, class_1;
@@ -1678,8 +1738,8 @@ var REFRESH_DELAY = 20, transitionKeys = ["top", "right", "bottom", "left", "wid
1678
1738
  })) : (document.addEventListener("DOMSubtreeModified", this.refresh), this.mutationEventsAdded_ = !0), this.connected_ = !0);
1679
1739
  }, ResizeObserverController2.prototype.disconnect_ = function() {
1680
1740
  !isBrowser || !this.connected_ || (document.removeEventListener("transitionend", this.onTransitionEnd_), window.removeEventListener("resize", this.refresh), this.mutationsObserver_ && this.mutationsObserver_.disconnect(), this.mutationEventsAdded_ && document.removeEventListener("DOMSubtreeModified", this.refresh), this.mutationsObserver_ = null, this.mutationEventsAdded_ = !1, this.connected_ = !1);
1681
- }, ResizeObserverController2.prototype.onTransitionEnd_ = function(_a11) {
1682
- var _b = _a11.propertyName, propertyName = _b === void 0 ? "" : _b, isReflowProperty = transitionKeys.some(function(key) {
1741
+ }, ResizeObserverController2.prototype.onTransitionEnd_ = function(_a13) {
1742
+ var _b = _a13.propertyName, propertyName = _b === void 0 ? "" : _b, isReflowProperty = transitionKeys.some(function(key) {
1683
1743
  return !!~propertyName.indexOf(key);
1684
1744
  });
1685
1745
  isReflowProperty && this.refresh();
@@ -1688,8 +1748,8 @@ var REFRESH_DELAY = 20, transitionKeys = ["top", "right", "bottom", "left", "wid
1688
1748
  }, ResizeObserverController2.instance_ = null, ResizeObserverController2;
1689
1749
  }()
1690
1750
  ), defineConfigurable = /* @__PURE__ */ __name(function(target, props) {
1691
- for (var _i = 0, _a11 = Object.keys(props); _i < _a11.length; _i++) {
1692
- var key = _a11[_i];
1751
+ for (var _i = 0, _a13 = Object.keys(props); _i < _a13.length; _i++) {
1752
+ var key = _a13[_i];
1693
1753
  Object.defineProperty(target, key, {
1694
1754
  value: props[key],
1695
1755
  enumerable: !1,
@@ -1755,8 +1815,8 @@ function getContentRect(target) {
1755
1815
  return isBrowser ? isSVGGraphicsElement(target) ? getSVGContentRect(target) : getHTMLElementContentRect(target) : emptyRect;
1756
1816
  }
1757
1817
  __name(getContentRect, "getContentRect");
1758
- function createReadOnlyRect(_a11) {
1759
- var x = _a11.x, y = _a11.y, width = _a11.width, height = _a11.height, Constr = typeof DOMRectReadOnly < "u" ? DOMRectReadOnly : Object, rect = Object.create(Constr.prototype);
1818
+ function createReadOnlyRect(_a13) {
1819
+ var x = _a13.x, y = _a13.y, width = _a13.width, height = _a13.height, Constr = typeof DOMRectReadOnly < "u" ? DOMRectReadOnly : Object, rect = Object.create(Constr.prototype);
1760
1820
  return defineConfigurable(rect, {
1761
1821
  x,
1762
1822
  y,
@@ -1862,8 +1922,8 @@ var ResizeObservation = (
1862
1922
  "disconnect"
1863
1923
  ].forEach(function(method) {
1864
1924
  ResizeObserver$1.prototype[method] = function() {
1865
- var _a11;
1866
- return (_a11 = observers.get(this))[method].apply(_a11, arguments);
1925
+ var _a13;
1926
+ return (_a13 = observers.get(this))[method].apply(_a13, arguments);
1867
1927
  };
1868
1928
  });
1869
1929
  var index = function() {
@@ -2792,7 +2852,7 @@ function FilterByValue(props) {
2792
2852
  }
2793
2853
  __name(FilterByValue, "FilterByValue");
2794
2854
  function FilterPanel() {
2795
- var _a11;
2855
+ var _a13;
2796
2856
  const sheetsFilterPanelService = useDependency(SheetsFilterPanelService), localeService = useDependency(LocaleService), commandService = useDependency(ICommandService), filterBy = useObservable(sheetsFilterPanelService.filterBy$, void 0, !0), filterByModel = useObservable(sheetsFilterPanelService.filterByModel$, void 0, !1), canApply = useObservable(() => (filterByModel == null ? void 0 : filterByModel.canApply$) || of(!1), void 0, !1, [filterByModel]), options = useFilterByOptions(localeService), clearFilterDisabled = !useObservable(sheetsFilterPanelService.hasCriteria$), onFilterByTypeChange = useCallback((value) => {
2797
2857
  commandService.executeCommand(ChangeFilterByOperation.id, { filterBy: value });
2798
2858
  }, [commandService]), onClearCriteria = useCallback(async () => {
@@ -2801,7 +2861,7 @@ function FilterPanel() {
2801
2861
  commandService.executeCommand(CloseFilterPanelOperation.id);
2802
2862
  }, [commandService]), onApply = useCallback(async () => {
2803
2863
  await (filterByModel == null ? void 0 : filterByModel.apply()), commandService.executeCommand(CloseFilterPanelOperation.id);
2804
- }, [filterByModel, commandService]), range = (_a11 = useDependency(SheetsFilterService).activeFilterModel) == null ? void 0 : _a11.getRange(), colIndex = sheetsFilterPanelService.col, FilterPanelEmbedPointPart = useComponentsOfPart(SheetsUIPart.FILTER_PANEL_EMBED_POINT);
2864
+ }, [filterByModel, commandService]), range = (_a13 = useDependency(SheetsFilterService).activeFilterModel) == null ? void 0 : _a13.getRange(), colIndex = sheetsFilterPanelService.col, FilterPanelEmbedPointPart = useComponentsOfPart(SheetsUIPart.FILTER_PANEL_EMBED_POINT);
2805
2865
  return /* @__PURE__ */ React__default.createElement("div", { className: styles.sheetsFilterPanel }, /* @__PURE__ */ React__default.createElement(
2806
2866
  ComponentContainer,
2807
2867
  {
@@ -2854,8 +2914,8 @@ function ClearFilterCriteriaMenuItemFactory(accessor) {
2854
2914
  positions: [SmartToggleSheetsFilterCommand.id],
2855
2915
  hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET),
2856
2916
  disabled$: sheetsFilterService.activeFilterModel$.pipe(switchMap((model) => {
2857
- var _a11;
2858
- return (_a11 = model == null ? void 0 : model.hasCriteria$.pipe(map((m2) => !m2))) != null ? _a11 : of(!0);
2917
+ var _a13;
2918
+ return (_a13 = model == null ? void 0 : model.hasCriteria$.pipe(map((m2) => !m2))) != null ? _a13 : of(!0);
2859
2919
  }))
2860
2920
  };
2861
2921
  }
@@ -2870,8 +2930,8 @@ function ReCalcFilterMenuItemFactory(accessor) {
2870
2930
  positions: [SmartToggleSheetsFilterCommand.id],
2871
2931
  hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET),
2872
2932
  disabled$: sheetsFilterService.activeFilterModel$.pipe(switchMap((model) => {
2873
- var _a11;
2874
- return (_a11 = model == null ? void 0 : model.hasCriteria$.pipe(map((m2) => !m2))) != null ? _a11 : of(!0);
2933
+ var _a13;
2934
+ return (_a13 = model == null ? void 0 : model.hasCriteria$.pipe(map((m2) => !m2))) != null ? _a13 : of(!0);
2875
2935
  }))
2876
2936
  };
2877
2937
  }
@@ -2896,14 +2956,14 @@ const BUTTON_VIEWPORT = 16, FILTER_BUTTON_EMPTY = new Path2D("M3.30363 3C2.79117
2896
2956
  };
2897
2957
  __name(_FilterButton, "FilterButton");
2898
2958
  let FilterButton = _FilterButton;
2899
- var __defProp$6 = Object.defineProperty, __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor, __decorateClass$6 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
2900
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
2959
+ var __defProp$7 = Object.defineProperty, __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor, __decorateClass$7 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
2960
+ for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
2901
2961
  (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
2902
- return kind && result && __defProp$6(target, key, result), result;
2903
- }, "__decorateClass$6"), __decorateParam$6 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$6");
2962
+ return kind && result && __defProp$7(target, key, result), result;
2963
+ }, "__decorateClass$7"), __decorateParam$7 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$7");
2904
2964
  const FILTER_ICON_SIZE = 16, FILTER_ICON_PADDING = 1;
2905
- var _a4;
2906
- let SheetsFilterButtonShape = (_a4 = class extends Shape {
2965
+ var _a5;
2966
+ let SheetsFilterButtonShape = (_a5 = class extends Shape {
2907
2967
  constructor(key, props, _contextService, _commandService, _themeService) {
2908
2968
  super(key, props);
2909
2969
  __publicField(this, "_cellWidth", 0);
@@ -2944,20 +3004,20 @@ let SheetsFilterButtonShape = (_a4 = class extends Shape {
2944
3004
  onPointerLeave() {
2945
3005
  this._hovered = !1, this.makeDirty(!0);
2946
3006
  }
2947
- }, __name(_a4, "SheetsFilterButtonShape"), _a4);
2948
- SheetsFilterButtonShape = __decorateClass$6([
2949
- __decorateParam$6(2, IContextService),
2950
- __decorateParam$6(3, ICommandService),
2951
- __decorateParam$6(4, Inject(ThemeService))
3007
+ }, __name(_a5, "SheetsFilterButtonShape"), _a5);
3008
+ SheetsFilterButtonShape = __decorateClass$7([
3009
+ __decorateParam$7(2, IContextService),
3010
+ __decorateParam$7(3, ICommandService),
3011
+ __decorateParam$7(4, Inject(ThemeService))
2952
3012
  ], SheetsFilterButtonShape);
2953
- var __defProp$5 = Object.defineProperty, __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor, __decorateClass$5 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
2954
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
3013
+ var __defProp$6 = Object.defineProperty, __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor, __decorateClass$6 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
3014
+ for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
2955
3015
  (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
2956
- return kind && result && __defProp$5(target, key, result), result;
2957
- }, "__decorateClass$5"), __decorateParam$5 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$5");
3016
+ return kind && result && __defProp$6(target, key, result), result;
3017
+ }, "__decorateClass$6"), __decorateParam$6 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$6");
2958
3018
  const DEFAULT_Z_INDEX = 1e3, SHEETS_FILTER_BUTTON_Z_INDEX = 5e3;
2959
- var _a5;
2960
- let SheetsFilterRenderController = (_a5 = class extends RxDisposable {
3019
+ var _a6;
3020
+ let SheetsFilterRenderController = (_a6 = class extends RxDisposable {
2961
3021
  constructor(_context, _injector, _sheetSkeletonManagerService, _sheetsFilterService, _themeService, _sheetInterceptorService, _sheetsRenderService, _commandService, _renderManagerService, _selectionRenderService) {
2962
3022
  super();
2963
3023
  __publicField(this, "_filterRangeShape", null);
@@ -2973,9 +3033,9 @@ let SheetsFilterRenderController = (_a5 = class extends RxDisposable {
2973
3033
  _initRenderer() {
2974
3034
  this._sheetSkeletonManagerService.currentSkeleton$.pipe(
2975
3035
  switchMap((skeletonParams) => {
2976
- var _a11, _b;
3036
+ var _a13, _b;
2977
3037
  if (!skeletonParams) return of(null);
2978
- const { unit: workbook, unitId } = this._context, worksheetId = ((_a11 = workbook.getActiveSheet()) == null ? void 0 : _a11.getSheetId()) || "", filterModel = (_b = this._sheetsFilterService.getFilterModel(unitId, worksheetId)) != null ? _b : void 0, getParams = /* @__PURE__ */ __name(() => ({
3038
+ const { unit: workbook, unitId } = this._context, worksheetId = ((_a13 = workbook.getActiveSheet()) == null ? void 0 : _a13.getSheetId()) || "", filterModel = (_b = this._sheetsFilterService.getFilterModel(unitId, worksheetId)) != null ? _b : void 0, getParams = /* @__PURE__ */ __name(() => ({
2979
3039
  unitId,
2980
3040
  worksheetId,
2981
3041
  filterModel,
@@ -3056,46 +3116,46 @@ let SheetsFilterRenderController = (_a5 = class extends RxDisposable {
3056
3116
  });
3057
3117
  }
3058
3118
  _disposeRendering() {
3059
- var _a11, _b;
3060
- (_a11 = this._filterRangeShape) == null || _a11.dispose(), this._filterButtonShapes.forEach((s) => s.dispose()), (_b = this._buttonRenderDisposable) == null || _b.dispose(), this._filterRangeShape = null, this._buttonRenderDisposable = null, this._filterButtonShapes = [];
3061
- }
3062
- }, __name(_a5, "SheetsFilterRenderController"), _a5);
3063
- SheetsFilterRenderController = __decorateClass$5([
3064
- __decorateParam$5(1, Inject(Injector)),
3065
- __decorateParam$5(2, Inject(SheetSkeletonManagerService)),
3066
- __decorateParam$5(3, Inject(SheetsFilterService)),
3067
- __decorateParam$5(4, Inject(ThemeService)),
3068
- __decorateParam$5(5, Inject(SheetInterceptorService)),
3069
- __decorateParam$5(6, Inject(SheetsRenderService)),
3070
- __decorateParam$5(7, ICommandService),
3071
- __decorateParam$5(8, IRenderManagerService),
3072
- __decorateParam$5(9, ISheetSelectionRenderService)
3119
+ var _a13, _b;
3120
+ (_a13 = this._filterRangeShape) == null || _a13.dispose(), this._filterButtonShapes.forEach((s) => s.dispose()), (_b = this._buttonRenderDisposable) == null || _b.dispose(), this._filterRangeShape = null, this._buttonRenderDisposable = null, this._filterButtonShapes = [];
3121
+ }
3122
+ }, __name(_a6, "SheetsFilterRenderController"), _a6);
3123
+ SheetsFilterRenderController = __decorateClass$6([
3124
+ __decorateParam$6(1, Inject(Injector)),
3125
+ __decorateParam$6(2, Inject(SheetSkeletonManagerService)),
3126
+ __decorateParam$6(3, Inject(SheetsFilterService)),
3127
+ __decorateParam$6(4, Inject(ThemeService)),
3128
+ __decorateParam$6(5, Inject(SheetInterceptorService)),
3129
+ __decorateParam$6(6, Inject(SheetsRenderService)),
3130
+ __decorateParam$6(7, ICommandService),
3131
+ __decorateParam$6(8, IRenderManagerService),
3132
+ __decorateParam$6(9, ISheetSelectionRenderService)
3073
3133
  ], SheetsFilterRenderController);
3074
- var __defProp$4 = Object.defineProperty, __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor, __decorateClass$4 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
3075
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
3134
+ var __defProp$5 = Object.defineProperty, __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor, __decorateClass$5 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
3135
+ for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
3076
3136
  (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
3077
- return kind && result && __defProp$4(target, key, result), result;
3078
- }, "__decorateClass$4"), __decorateParam$4 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$4"), _a6;
3079
- let SheetsFilterMobileUIController = (_a6 = class extends RxDisposable {
3137
+ return kind && result && __defProp$5(target, key, result), result;
3138
+ }, "__decorateClass$5"), __decorateParam$5 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$5"), _a7;
3139
+ let SheetsFilterMobileUIController = (_a7 = class extends RxDisposable {
3080
3140
  constructor(_renderManagerService) {
3081
3141
  super(), this._renderManagerService = _renderManagerService, this._initRenderControllers();
3082
3142
  }
3083
3143
  _initRenderControllers() {
3084
3144
  this.disposeWithMe(this._renderManagerService.registerRenderModule(UniverInstanceType.UNIVER_SHEET, [SheetsFilterRenderController]));
3085
3145
  }
3086
- }, __name(_a6, "SheetsFilterMobileUIController"), _a6);
3087
- SheetsFilterMobileUIController = __decorateClass$4([
3088
- __decorateParam$4(0, IRenderManagerService)
3146
+ }, __name(_a7, "SheetsFilterMobileUIController"), _a7);
3147
+ SheetsFilterMobileUIController = __decorateClass$5([
3148
+ __decorateParam$5(0, IRenderManagerService)
3089
3149
  ], SheetsFilterMobileUIController);
3090
3150
  runOnLifecycle(LifecycleStages.Rendered, SheetsFilterMobileUIController);
3091
- var __defProp$3 = Object.defineProperty, __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor, __decorateClass$3 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
3092
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
3151
+ var __defProp$4 = Object.defineProperty, __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor, __decorateClass$4 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
3152
+ for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
3093
3153
  (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
3094
- return kind && result && __defProp$3(target, key, result), result;
3095
- }, "__decorateClass$3"), __decorateParam$3 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$3");
3154
+ return kind && result && __defProp$4(target, key, result), result;
3155
+ }, "__decorateClass$4"), __decorateParam$4 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$4");
3096
3156
  const DefaultSheetFilterUiConfig = {}, FILTER_PANEL_POPUP_KEY = "FILTER_PANEL_POPUP";
3097
- var _a7;
3098
- let SheetsFilterUIController = (_a7 = class extends SheetsFilterMobileUIController {
3157
+ var _a8;
3158
+ let SheetsFilterUIController = (_a8 = class extends SheetsFilterMobileUIController {
3099
3159
  constructor(_config, _injector, _componentManager, _sheetsFilterPanelService, _sheetCanvasPopupService, _sheetsFilterService, _localeService, _shortcutService, _commandService, _menuService, _contextService, _messageService, _renderManagerService) {
3100
3160
  super(_renderManagerService);
3101
3161
  __publicField(this, "_popupDisposable");
@@ -3158,44 +3218,44 @@ let SheetsFilterUIController = (_a7 = class extends SheetsFilterMobileUIControll
3158
3218
  });
3159
3219
  }
3160
3220
  _closeFilterPopup() {
3161
- var _a11;
3162
- (_a11 = this._popupDisposable) == null || _a11.dispose(), this._popupDisposable = null;
3221
+ var _a13;
3222
+ (_a13 = this._popupDisposable) == null || _a13.dispose(), this._popupDisposable = null;
3163
3223
  }
3164
- }, __name(_a7, "SheetsFilterUIController"), _a7);
3165
- SheetsFilterUIController = __decorateClass$3([
3224
+ }, __name(_a8, "SheetsFilterUIController"), _a8);
3225
+ SheetsFilterUIController = __decorateClass$4([
3166
3226
  OnLifecycle(LifecycleStages.Rendered, SheetsFilterUIController),
3167
- __decorateParam$3(1, Inject(Injector)),
3168
- __decorateParam$3(2, Inject(ComponentManager)),
3169
- __decorateParam$3(3, Inject(SheetsFilterPanelService)),
3170
- __decorateParam$3(4, Inject(SheetCanvasPopManagerService)),
3171
- __decorateParam$3(5, Inject(SheetsFilterService)),
3172
- __decorateParam$3(6, Inject(LocaleService)),
3173
- __decorateParam$3(7, IShortcutService),
3174
- __decorateParam$3(8, ICommandService),
3175
- __decorateParam$3(9, IMenuService),
3176
- __decorateParam$3(10, IContextService),
3177
- __decorateParam$3(11, IMessageService),
3178
- __decorateParam$3(12, IRenderManagerService)
3227
+ __decorateParam$4(1, Inject(Injector)),
3228
+ __decorateParam$4(2, Inject(ComponentManager)),
3229
+ __decorateParam$4(3, Inject(SheetsFilterPanelService)),
3230
+ __decorateParam$4(4, Inject(SheetCanvasPopManagerService)),
3231
+ __decorateParam$4(5, Inject(SheetsFilterService)),
3232
+ __decorateParam$4(6, Inject(LocaleService)),
3233
+ __decorateParam$4(7, IShortcutService),
3234
+ __decorateParam$4(8, ICommandService),
3235
+ __decorateParam$4(9, IMenuService),
3236
+ __decorateParam$4(10, IContextService),
3237
+ __decorateParam$4(11, IMessageService),
3238
+ __decorateParam$4(12, IRenderManagerService)
3179
3239
  ], SheetsFilterUIController);
3180
- var __defProp$2 = Object.defineProperty, __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor, __decorateClass$2 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
3181
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
3240
+ var __defProp$3 = Object.defineProperty, __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor, __decorateClass$3 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
3241
+ for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
3182
3242
  (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
3183
- return kind && result && __defProp$2(target, key, result), result;
3184
- }, "__decorateClass$2"), __decorateParam$2 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$2"), _a8;
3185
- let SheetsFilterPermissionController = (_a8 = class extends Disposable {
3243
+ return kind && result && __defProp$3(target, key, result), result;
3244
+ }, "__decorateClass$3"), __decorateParam$3 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$3"), _a9;
3245
+ let SheetsFilterPermissionController = (_a9 = class extends Disposable {
3186
3246
  constructor(_sheetsFilterService, _localeService, _commandService, _sheetPermissionInterceptorBaseController) {
3187
3247
  super(), this._sheetsFilterService = _sheetsFilterService, this._localeService = _localeService, this._commandService = _commandService, this._sheetPermissionInterceptorBaseController = _sheetPermissionInterceptorBaseController, this._commandExecutedListener();
3188
3248
  }
3189
3249
  _commandExecutedListener() {
3190
3250
  this.disposeWithMe(
3191
3251
  this._commandService.beforeCommandExecuted((command) => {
3192
- var _a11;
3252
+ var _a13;
3193
3253
  if (command.id === SmartToggleSheetsFilterCommand.id && (this._sheetPermissionInterceptorBaseController.permissionCheckWithoutRange({
3194
3254
  workbookTypes: [WorkbookEditablePermission],
3195
3255
  rangeTypes: [RangeProtectionPermissionViewPoint],
3196
3256
  worksheetTypes: [WorksheetFilterPermission, WorksheetEditPermission]
3197
3257
  }) || this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.filterErr"))), command.id === OpenFilterPanelOperation.id) {
3198
- const params = command.params, { unitId, subUnitId } = params, filterRange = (_a11 = this._sheetsFilterService.getFilterModel(unitId, subUnitId)) == null ? void 0 : _a11.getRange(), colRange = Tools.deepClone(filterRange);
3258
+ const params = command.params, { unitId, subUnitId } = params, filterRange = (_a13 = this._sheetsFilterService.getFilterModel(unitId, subUnitId)) == null ? void 0 : _a13.getRange(), colRange = Tools.deepClone(filterRange);
3199
3259
  colRange && (colRange.startColumn = params.col, colRange.endColumn = params.col, this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
3200
3260
  workbookTypes: [WorkbookEditablePermission],
3201
3261
  rangeTypes: [RangeProtectionPermissionViewPoint],
@@ -3205,24 +3265,24 @@ let SheetsFilterPermissionController = (_a8 = class extends Disposable {
3205
3265
  })
3206
3266
  );
3207
3267
  }
3208
- }, __name(_a8, "SheetsFilterPermissionController"), _a8);
3209
- SheetsFilterPermissionController = __decorateClass$2([
3268
+ }, __name(_a9, "SheetsFilterPermissionController"), _a9);
3269
+ SheetsFilterPermissionController = __decorateClass$3([
3210
3270
  OnLifecycle(LifecycleStages.Ready, SheetsFilterPermissionController),
3211
- __decorateParam$2(0, Inject(SheetsFilterService)),
3212
- __decorateParam$2(1, Inject(LocaleService)),
3213
- __decorateParam$2(2, ICommandService),
3214
- __decorateParam$2(3, Inject(SheetPermissionInterceptorBaseController))
3271
+ __decorateParam$3(0, Inject(SheetsFilterService)),
3272
+ __decorateParam$3(1, Inject(LocaleService)),
3273
+ __decorateParam$3(2, ICommandService),
3274
+ __decorateParam$3(3, Inject(SheetPermissionInterceptorBaseController))
3215
3275
  ], SheetsFilterPermissionController);
3216
- var __defProp$1 = Object.defineProperty, __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor, __defNormalProp$1 = /* @__PURE__ */ __name((obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, "__defNormalProp$1"), __decorateClass$1 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
3217
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
3276
+ var __defProp$2 = Object.defineProperty, __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor, __defNormalProp$1 = /* @__PURE__ */ __name((obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, "__defNormalProp$1"), __decorateClass$2 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
3277
+ for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
3218
3278
  (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
3219
- return kind && result && __defProp$1(target, key, result), result;
3220
- }, "__decorateClass$1"), __decorateParam$1 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$1"), __publicField$1 = /* @__PURE__ */ __name((obj, key, value) => __defNormalProp$1(obj, typeof key != "symbol" ? key + "" : key, value), "__publicField$1");
3279
+ return kind && result && __defProp$2(target, key, result), result;
3280
+ }, "__decorateClass$2"), __decorateParam$2 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$2"), __publicField$1 = /* @__PURE__ */ __name((obj, key, value) => __defNormalProp$1(obj, typeof key != "symbol" ? key + "" : key, value), "__publicField$1");
3221
3281
  const NAME$1 = "SHEET_FILTER_UI_PLUGIN";
3222
- var _a9;
3223
- let UniverSheetsFilterUIPlugin = (_a9 = class extends Plugin {
3224
- constructor(_config = {}, _injector, _localeService) {
3225
- super(), this._config = _config, this._injector = _injector, this._localeService = _localeService, this._config = Tools.deepMerge({}, DefaultSheetFilterUiConfig, this._config);
3282
+ var _a10;
3283
+ let UniverSheetsFilterUIPlugin = (_a10 = class extends Plugin {
3284
+ constructor(_config = {}, _injector, _rpcChannelService) {
3285
+ super(), this._config = _config, this._injector = _injector, this._rpcChannelService = _rpcChannelService, this._config = Tools.deepMerge({}, DefaultSheetFilterUiConfig, this._config);
3226
3286
  }
3227
3287
  onStarting() {
3228
3288
  [
@@ -3234,24 +3294,31 @@ let UniverSheetsFilterUIPlugin = (_a9 = class extends Plugin {
3234
3294
  useFactory: /* @__PURE__ */ __name(() => this._injector.createInstance(SheetsFilterUIController, this._config), "useFactory")
3235
3295
  }
3236
3296
  ]
3237
- ].forEach((d2) => this._injector.add(d2));
3297
+ ].forEach((d2) => this._injector.add(d2)), this._config.useRemoteFilterValuesGenerator && this._rpcChannelService && this._injector.add([
3298
+ ISheetsGenerateFilterValuesService,
3299
+ {
3300
+ useFactory: /* @__PURE__ */ __name(() => toModule(
3301
+ this._rpcChannelService.requestChannel(SHEETS_GENERATE_FILTER_VALUES_SERVICE_NAME)
3302
+ ), "useFactory")
3303
+ }
3304
+ ]);
3238
3305
  }
3239
- }, __name(_a9, "UniverSheetsFilterUIPlugin"), _a9);
3306
+ }, __name(_a10, "UniverSheetsFilterUIPlugin"), _a10);
3240
3307
  __publicField$1(UniverSheetsFilterUIPlugin, "type", UniverInstanceType.UNIVER_SHEET);
3241
3308
  __publicField$1(UniverSheetsFilterUIPlugin, "pluginName", NAME$1);
3242
- UniverSheetsFilterUIPlugin = __decorateClass$1([
3309
+ UniverSheetsFilterUIPlugin = __decorateClass$2([
3243
3310
  DependentOn(UniverSheetsFilterPlugin),
3244
- __decorateParam$1(1, Inject(Injector)),
3245
- __decorateParam$1(2, Inject(LocaleService))
3311
+ __decorateParam$2(1, Inject(Injector)),
3312
+ __decorateParam$2(2, Optional(IRPCChannelService))
3246
3313
  ], UniverSheetsFilterUIPlugin);
3247
- var __defProp2 = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __defNormalProp2 = /* @__PURE__ */ __name((obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, "__defNormalProp"), __decorateClass = /* @__PURE__ */ __name((decorators, target, key, kind) => {
3248
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
3314
+ var __defProp$1 = Object.defineProperty, __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor, __defNormalProp2 = /* @__PURE__ */ __name((obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, "__defNormalProp"), __decorateClass$1 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
3315
+ for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
3249
3316
  (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
3250
- return kind && result && __defProp2(target, key, result), result;
3251
- }, "__decorateClass"), __decorateParam = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam"), __publicField2 = /* @__PURE__ */ __name((obj, key, value) => __defNormalProp2(obj, typeof key != "symbol" ? key + "" : key, value), "__publicField");
3317
+ return kind && result && __defProp$1(target, key, result), result;
3318
+ }, "__decorateClass$1"), __decorateParam$1 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$1"), __publicField2 = /* @__PURE__ */ __name((obj, key, value) => __defNormalProp2(obj, typeof key != "symbol" ? key + "" : key, value), "__publicField");
3252
3319
  const NAME = "SHEET_FILTER_UI_PLUGIN";
3253
- var _a10;
3254
- let UniverSheetsFilterMobileUIPlugin = (_a10 = class extends Plugin {
3320
+ var _a11;
3321
+ let UniverSheetsFilterMobileUIPlugin = (_a11 = class extends Plugin {
3255
3322
  constructor(_config = {}, _injector) {
3256
3323
  super(), this._config = _config, this._injector = _injector, this._config = Tools.deepMerge({}, DefaultSheetFilterUiConfig, this._config);
3257
3324
  }
@@ -3261,13 +3328,38 @@ let UniverSheetsFilterMobileUIPlugin = (_a10 = class extends Plugin {
3261
3328
  [SheetsFilterMobileUIController]
3262
3329
  ].forEach((d2) => this._injector.add(d2));
3263
3330
  }
3264
- }, __name(_a10, "UniverSheetsFilterMobileUIPlugin"), _a10);
3331
+ }, __name(_a11, "UniverSheetsFilterMobileUIPlugin"), _a11);
3265
3332
  __publicField2(UniverSheetsFilterMobileUIPlugin, "type", UniverInstanceType.UNIVER_SHEET);
3266
3333
  __publicField2(UniverSheetsFilterMobileUIPlugin, "pluginName", NAME);
3267
- UniverSheetsFilterMobileUIPlugin = __decorateClass([
3334
+ UniverSheetsFilterMobileUIPlugin = __decorateClass$1([
3268
3335
  DependentOn(UniverSheetsFilterPlugin),
3269
- __decorateParam(1, Inject(Injector))
3336
+ __decorateParam$1(1, Inject(Injector))
3270
3337
  ], UniverSheetsFilterMobileUIPlugin);
3338
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __decorateClass = /* @__PURE__ */ __name((decorators, target, key, kind) => {
3339
+ for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
3340
+ (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
3341
+ return kind && result && __defProp2(target, key, result), result;
3342
+ }, "__decorateClass"), __decorateParam = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam"), _a12;
3343
+ let UniverSheetsFilterUIWorkerPlugin = (_a12 = class extends Plugin {
3344
+ constructor(_config, _injector, _rpcChannelService) {
3345
+ super(), this._config = _config, this._injector = _injector, this._rpcChannelService = _rpcChannelService;
3346
+ }
3347
+ onStarting() {
3348
+ [
3349
+ [ISheetsGenerateFilterValuesService, { useClass: SheetsGenerateFilterValuesService }]
3350
+ ].forEach((d2) => this._injector.add(d2));
3351
+ }
3352
+ onReady() {
3353
+ this._rpcChannelService.registerChannel(
3354
+ SHEETS_GENERATE_FILTER_VALUES_SERVICE_NAME,
3355
+ fromModule(this._injector.get(ISheetsGenerateFilterValuesService))
3356
+ );
3357
+ }
3358
+ }, __name(_a12, "UniverSheetsFilterUIWorkerPlugin"), __publicField(_a12, "type", UniverInstanceType.UNIVER_SHEET), __publicField(_a12, "pluginName", "SHEET_FILTER_UI_WORKER_PLUGIN"), _a12);
3359
+ UniverSheetsFilterUIWorkerPlugin = __decorateClass([
3360
+ __decorateParam(1, Inject(Injector)),
3361
+ __decorateParam(2, IRPCChannelService)
3362
+ ], UniverSheetsFilterUIWorkerPlugin);
3271
3363
  export {
3272
3364
  ChangeFilterByOperation,
3273
3365
  ClearSheetsFilterCriteriaCommand,
@@ -3277,5 +3369,6 @@ export {
3277
3369
  SetSheetsFilterCriteriaCommand,
3278
3370
  SmartToggleSheetsFilterCommand,
3279
3371
  UniverSheetsFilterMobileUIPlugin,
3280
- UniverSheetsFilterUIPlugin
3372
+ UniverSheetsFilterUIPlugin,
3373
+ UniverSheetsFilterUIWorkerPlugin
3281
3374
  };