@univerjs/sheets-filter-ui 0.8.2 → 0.8.3-nightly.202506271607

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.
package/lib/index.js CHANGED
@@ -1,18 +1,17 @@
1
1
  var qt = Object.defineProperty;
2
2
  var Kt = (t, e, r) => e in t ? qt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
3
  var f = (t, e, r) => Kt(t, typeof e != "symbol" ? e + "" : e, r);
4
- import { BooleanNumber as rt, createIdentifier as vt, Inject as E, LocaleService as K, IUniverInstanceService as Ge, ILogService as Xt, extractPureTextFromCell as Zt, numfmt as it, Disposable as me, Injector as X, Quantity as gt, Tools as Te, ICommandService as Q, CommandType as Le, IContextService as we, UniverInstanceType as Z, ThemeService as St, RxDisposable as Et, fromCallback as zt, InterceptorEffectEnum as Jt, DependentOn as Tt, IConfigService as Nt, Optional as er, Plugin as je, merge as Ft, registerDependencies as tr, touchDependencies as st } from "@univerjs/core";
5
- import { IRPCChannelService as Ct, toModule as rr, fromModule as ir } from "@univerjs/rpc";
6
- import { CustomFilterOperator as u, SetSheetsFilterCriteriaCommand as re, SheetsFilterService as V, SmartToggleSheetsFilterCommand as pe, ReCalcSheetsFilterCommand as Ye, ClearSheetsFilterCriteriaCommand as qe, FILTER_MUTATIONS as sr, SetSheetsFilterRangeMutation as nr, SetSheetsFilterCriteriaMutation as or, RemoveSheetsFilterMutation as ar, ReCalcSheetsFilterMutation as lr, RemoveSheetFilterCommand as cr, SetSheetFilterRangeCommand as ur, UniverSheetsFilterPlugin as yt } from "@univerjs/sheets-filter";
7
- import { RefRangeService as hr, SheetPermissionCheckController as dr, SheetsSelectionsService as mr, getSheetCommandTarget as pr, WorksheetFilterPermission as ae, WorksheetViewPermission as le, RangeProtectionPermissionViewPoint as ce, expandToContinuousRange as fr, SheetInterceptorService as _r, SetRangeValuesMutation as vr, INTERCEPTOR_POINT as gr } from "@univerjs/sheets";
8
- import { ILayoutService as Sr, useDependency as te, useObservable as B, useComponentsOfPart as Er, ComponentContainer as Tr, getMenuHiddenObservable as Ke, MenuItemType as Xe, RibbonDataGroup as Nr, KeyCode as Fr, MetaKeys as nt, ComponentManager as Cr, IShortcutService as yr, IMenuManagerService as Or, IMessageService as Rr } from "@univerjs/ui";
9
- import { SetCellEditVisibleOperation as Ir, SheetsUIPart as Ar, getObservableWithExclusiveRange$ as Pr, getCurrentRangeDisable$ as br, SheetSkeletonManagerService as Lr, ISheetSelectionRenderService as wr, SelectionControl as Mr, attachSelectionWithCoord as $r, getCoordByCell as Ur, SheetsRenderService as Ot, whenSheetEditorFocused as Hr, SheetCanvasPopManagerService as Dr } from "@univerjs/sheets-ui";
10
- import { BehaviorSubject as q, ReplaySubject as kr, Subject as xr, merge as Br, combineLatest as Wr, throttleTime as Rt, startWith as It, map as ie, shareReplay as Qr, of as fe, switchMap as Ze, filter as Vr, takeUntil as Gr, distinctUntilChanged as jr } from "rxjs";
11
- import { Select as ot, clsx as At, borderClassName as Pt, RadioGroup as Yr, Radio as at, Input as bt, Checkbox as qr, Tree as Kr, Segmented as Xr, Button as Ue, MessageType as Zr } from "@univerjs/design";
12
- import { Rect as lt, Shape as zr, IRenderManagerService as Lt } from "@univerjs/engine-render";
4
+ import { BooleanNumber as rt, createIdentifier as vt, Inject as E, LocaleService as K, IUniverInstanceService as Ge, ILogService as Xt, extractPureTextFromCell as Zt, numfmt as it, Disposable as me, Injector as X, Quantity as gt, Tools as Te, ICommandService as Q, CommandType as Le, IContextService as we, ThemeService as St, RxDisposable as Et, fromCallback as zt, InterceptorEffectEnum as Jt, UniverInstanceType as Z, DependentOn as Tt, IConfigService as Nt, Plugin as je, merge as Ft, Optional as er, registerDependencies as tr, touchDependencies as st } from "@univerjs/core";
5
+ import { CustomFilterOperator as u, SetSheetsFilterCriteriaCommand as re, SheetsFilterService as V, SmartToggleSheetsFilterCommand as pe, FILTER_MUTATIONS as rr, SetSheetsFilterRangeMutation as ir, SetSheetsFilterCriteriaMutation as sr, RemoveSheetsFilterMutation as nr, ReCalcSheetsFilterMutation as or, UniverSheetsFilterPlugin as Ct, ReCalcSheetsFilterCommand as Ye, ClearSheetsFilterCriteriaCommand as qe, RemoveSheetFilterCommand as ar, SetSheetFilterRangeCommand as lr } from "@univerjs/sheets-filter";
6
+ import { ILayoutService as cr, useDependency as te, useObservable as B, useComponentsOfPart as ur, ComponentContainer as hr, getMenuHiddenObservable as Ke, MenuItemType as Xe, RibbonDataGroup as dr, KeyCode as mr, MetaKeys as nt, ComponentManager as pr, IShortcutService as fr, IMenuManagerService as _r, IMessageService as vr } from "@univerjs/ui";
7
+ import { SetCellEditVisibleOperation as gr, SheetSkeletonManagerService as Sr, ISheetSelectionRenderService as Er, SelectionControl as Tr, attachSelectionWithCoord as Nr, getCoordByCell as Fr, SheetsRenderService as yt, SheetsUIPart as Cr, getObservableWithExclusiveRange$ as yr, getCurrentRangeDisable$ as Or, whenSheetEditorFocused as Rr, SheetCanvasPopManagerService as Ir } from "@univerjs/sheets-ui";
8
+ import { RefRangeService as Ar, SheetPermissionCheckController as Pr, SheetsSelectionsService as br, getSheetCommandTarget as Lr, WorksheetFilterPermission as ae, WorksheetViewPermission as le, RangeProtectionPermissionViewPoint as ce, expandToContinuousRange as wr, SheetInterceptorService as Mr, SetRangeValuesMutation as $r, INTERCEPTOR_POINT as Ur } from "@univerjs/sheets";
9
+ import { BehaviorSubject as q, ReplaySubject as Hr, Subject as Dr, merge as kr, combineLatest as xr, throttleTime as Ot, startWith as Rt, map as ie, shareReplay as Br, of as fe, switchMap as Ze, filter as Wr, takeUntil as Qr, distinctUntilChanged as Vr } from "rxjs";
10
+ import { Rect as ot, Shape as Gr, IRenderManagerService as It } from "@univerjs/engine-render";
11
+ import { IRPCChannelService as At, toModule as jr, fromModule as Yr } from "@univerjs/rpc";
12
+ import { Select as at, clsx as Pt, borderClassName as bt, RadioGroup as qr, Radio as lt, Input as Lt, Checkbox as Kr, Tree as Xr, Segmented as Zr, Button as Ue, MessageType as zr } from "@univerjs/design";
13
13
  import { jsx as S, jsxs as b, Fragment as ct } from "react/jsx-runtime";
14
14
  import { forwardRef as wt, useRef as Jr, createElement as Mt, useCallback as D, useMemo as ze } from "react";
15
- const $t = "sheets-filter-ui.config", Ne = {};
16
15
  var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SECOND", t))(F || {}), _ = /* @__PURE__ */ ((t) => (t.NONE = "none", t.STARTS_WITH = "startsWith", t.DOES_NOT_START_WITH = "doesNotStartWith", t.ENDS_WITH = "endsWith", t.DOES_NOT_END_WITH = "doesNotEndWith", t.CONTAINS = "contains", t.DOES_NOT_CONTAIN = "doesNotContain", t.EQUALS = "equals", t.NOT_EQUALS = "notEquals", t.EMPTY = "empty", t.NOT_EMPTY = "notEmpty", t.BETWEEN = "between", t.NOT_BETWEEN = "notBetween", t.CUSTOM = "custom", t))(_ || {}), d;
17
16
  ((t) => {
18
17
  t.NONE = {
@@ -511,7 +510,7 @@ var ei = Object.getOwnPropertyDescriptor, ti = (t, e, r, s) => {
511
510
  (i = t[l]) && (n = i(n) || n);
512
511
  return n;
513
512
  }, He = (t, e) => (r, s) => e(r, s, t);
514
- const Je = "sheets-filter.generate-filter-values.service", Fe = vt(Je), ri = ["yyyy-mm-dd", "yyyy-mm-dd;@", "yyyy/mm/dd;@", "yyyy/mm/dd hh:mm", "yyyy-m-d am/pm h:mm", "yyyy-MM-dd", "yyyy/MM/dd", "yyyy/mm/dd", 'yyyy"年"MM"月"dd"日"', "MM-dd", 'M"月"d"日"', "MM-dd A/P hh:mm"];
513
+ const Je = "sheets-filter.generate-filter-values.service", Ne = vt(Je), ri = ["yyyy-mm-dd", "yyyy-mm-dd;@", "yyyy/mm/dd;@", "yyyy/mm/dd hh:mm", "yyyy-m-d am/pm h:mm", "yyyy-MM-dd", "yyyy/MM/dd", "yyyy/mm/dd", 'yyyy"年"MM"月"dd"日"', "MM-dd", 'M"月"d"日"', "MM-dd A/P hh:mm"];
515
514
  let Be = class extends me {
516
515
  constructor(t, e, r) {
517
516
  super(), this._localeService = t, this._univerInstanceService = e, this._logService = r;
@@ -519,7 +518,7 @@ let Be = class extends me {
519
518
  async getFilterValues(t) {
520
519
  var h;
521
520
  const { unitId: e, subUnitId: r, filteredOutRowsByOtherColumns: s, filters: n, blankChecked: l, iterateRange: i, alreadyChecked: o } = t, a = this._univerInstanceService.getUnit(e), c = (h = this._univerInstanceService.getUnit(e)) == null ? void 0 : h.getSheetBySheetId(r);
522
- return !a || !c ? [] : (this._logService.debug("[SheetsGenerateFilterValuesService]", "getFilterValues for", { unitId: e, subUnitId: r }), Ut(n, this._localeService, i, c, new Set(s), new Set(o.map(String)), l, a.getStyles()));
521
+ return !a || !c ? [] : (this._logService.debug("[SheetsGenerateFilterValuesService]", "getFilterValues for", { unitId: e, subUnitId: r }), $t(n, this._localeService, i, c, new Set(s), new Set(o.map(String)), l, a.getStyles()));
523
522
  }
524
523
  };
525
524
  Be = ti([
@@ -527,7 +526,7 @@ Be = ti([
527
526
  He(1, Ge),
528
527
  He(2, Xt)
529
528
  ], Be);
530
- function Ut(t, e, r, s, n, l, i, o) {
529
+ function $t(t, e, r, s, n, l, i, o) {
531
530
  var v, C, N, R, O, w, M, _e, ve;
532
531
  const a = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), h = "yyyy-mm-dd", m = new Set(ri), g = "empty";
533
532
  let p = 0;
@@ -638,13 +637,13 @@ function We(t, e) {
638
637
  }
639
638
  return null;
640
639
  }
641
- function Ht(t) {
642
- return t.leaf ? t.checked : t.children ? t.children.every((e) => Ht(e)) : !0;
640
+ function Ut(t) {
641
+ return t.leaf ? t.checked : t.children ? t.children.every((e) => Ut(e)) : !0;
643
642
  }
644
643
  function ue(t, e) {
645
644
  t.leaf && (e !== void 0 ? t.checked = e : t.checked = !t.checked), t.children && t.children.forEach((r) => ue(r, e));
646
645
  }
647
- function Dt(t, e) {
646
+ function Ht(t, e) {
648
647
  const r = [];
649
648
  return t.forEach((s) => {
650
649
  const n = s.originValues ? e.some(
@@ -657,7 +656,7 @@ function Dt(t, e) {
657
656
  if (n || l)
658
657
  r.push({ ...s });
659
658
  else if (s.children) {
660
- const o = Dt(s.children, e);
659
+ const o = Ht(s.children, e);
661
660
  if (o.length > 0) {
662
661
  const a = o.reduce((c, h) => c + h.count, 0);
663
662
  r.push({ ...s, count: a, children: o });
@@ -669,7 +668,7 @@ var ni = Object.getOwnPropertyDescriptor, et = (t, e, r, s) => {
669
668
  for (var n = s > 1 ? void 0 : s ? ni(e, r) : e, l = t.length - 1, i; l >= 0; l--)
670
669
  (i = t[l]) && (n = i(n) || n);
671
670
  return n;
672
- }, Ce = (t, e) => (r, s) => e(r, s, t), ye = /* @__PURE__ */ ((t) => (t[t.VALUES = 0] = "VALUES", t[t.CONDITIONS = 1] = "CONDITIONS", t))(ye || {});
671
+ }, Fe = (t, e) => (r, s) => e(r, s, t), Ce = /* @__PURE__ */ ((t) => (t[t.VALUES = 0] = "VALUES", t[t.CONDITIONS = 1] = "CONDITIONS", t))(Ce || {});
673
672
  vt("sheets-filter-ui.sheets-filter-panel.service");
674
673
  let W = class extends me {
675
674
  constructor(e, r) {
@@ -679,7 +678,7 @@ let W = class extends me {
679
678
  /* VALUES */
680
679
  ));
681
680
  f(this, "filterBy$", this._filterBy$.asObservable());
682
- f(this, "_filterByModel$", new kr(1));
681
+ f(this, "_filterByModel$", new Hr(1));
683
682
  f(this, "filterByModel$", this._filterByModel$.asObservable());
684
683
  f(this, "_filterByModel", null);
685
684
  f(this, "_hasCriteria$", new q(!1));
@@ -757,7 +756,7 @@ let W = class extends me {
757
756
  this._disposePreviousModel();
758
757
  const s = e.getRange();
759
758
  if (s.startRow === s.endRow) return !1;
760
- const n = await Re.fromFilterColumn(
759
+ const n = await Oe.fromFilterColumn(
761
760
  this._injector,
762
761
  e,
763
762
  r
@@ -771,7 +770,7 @@ let W = class extends me {
771
770
  this._disposePreviousModel();
772
771
  const s = e.getRange();
773
772
  if (s.startRow === s.endRow) return !1;
774
- const n = Oe.fromFilterColumn(
773
+ const n = ye.fromFilterColumn(
775
774
  this._injector,
776
775
  e,
777
776
  r,
@@ -788,10 +787,10 @@ let W = class extends me {
788
787
  }
789
788
  };
790
789
  W = et([
791
- Ce(0, E(X)),
792
- Ce(1, E(hr))
790
+ Fe(0, E(X)),
791
+ Fe(1, E(Ar))
793
792
  ], W);
794
- let Oe = class extends me {
793
+ let ye = class extends me {
795
794
  constructor(e, r, s, n, l) {
796
795
  super();
797
796
  f(this, "canApply$", fe(!0));
@@ -814,7 +813,7 @@ let Oe = class extends me {
814
813
  */
815
814
  static fromFilterColumn(e, r, s, n) {
816
815
  const [l, i] = d.testMappingFilterColumn(n == null ? void 0 : n.getColumnData());
817
- return e.createInstance(Oe, r, s, l, i);
816
+ return e.createInstance(ye, r, s, l, i);
818
817
  }
819
818
  get conditionItem() {
820
819
  return this._conditionItem$.getValue();
@@ -876,10 +875,10 @@ let Oe = class extends me {
876
875
  this._filterConditionFormParams$.next(r);
877
876
  }
878
877
  };
879
- Oe = et([
880
- Ce(4, Q)
881
- ], Oe);
882
- let Re = class extends me {
878
+ ye = et([
879
+ Fe(4, Q)
880
+ ], ye);
881
+ let Oe = class extends me {
883
882
  constructor(e, r, s, n, l) {
884
883
  super();
885
884
  f(this, "_rawFilterItems$");
@@ -891,22 +890,22 @@ let Re = class extends me {
891
890
  f(this, "_manuallyUpdateFilterItems$");
892
891
  f(this, "_searchString$");
893
892
  f(this, "searchString$");
894
- this._filterModel = e, this.col = r, this._commandService = l, this._treeMapCache = n, this._searchString$ = new q(""), this.searchString$ = this._searchString$.asObservable(), this._rawFilterItems$ = new q(s), this.rawFilterItems$ = this._rawFilterItems$.asObservable(), this._manuallyUpdateFilterItems$ = new xr(), this.filterItems$ = Br(
895
- Wr([
893
+ this._filterModel = e, this.col = r, this._commandService = l, this._treeMapCache = n, this._searchString$ = new q(""), this.searchString$ = this._searchString$.asObservable(), this._rawFilterItems$ = new q(s), this.rawFilterItems$ = this._rawFilterItems$.asObservable(), this._manuallyUpdateFilterItems$ = new Dr(), this.filterItems$ = kr(
894
+ xr([
896
895
  this._searchString$.pipe(
897
- Rt(500, void 0, { leading: !0, trailing: !0 }),
898
- It(void 0)
896
+ Ot(500, void 0, { leading: !0, trailing: !0 }),
897
+ Rt(void 0)
899
898
  ),
900
899
  this._rawFilterItems$
901
900
  ]).pipe(
902
901
  ie(([i, o]) => {
903
902
  if (!i) return o;
904
903
  const c = i.toLowerCase().split(/\s+/).filter((h) => !!h);
905
- return Dt(o, c);
904
+ return Ht(o, c);
906
905
  })
907
906
  ),
908
907
  this._manuallyUpdateFilterItems$
909
- ).pipe(Qr(1)), this.canApply$ = this.filterItems$.pipe(ie((i) => xe(i).checked > 0)), this.disposeWithMe(this.filterItems$.subscribe((i) => this._filterItems = i));
908
+ ).pipe(Br(1)), this.canApply$ = this.filterItems$.pipe(ie((i) => xe(i).checked > 0)), this.disposeWithMe(this.filterItems$.subscribe((i) => this._filterItems = i));
910
909
  }
911
910
  /**
912
911
  * Create a model with targeting filter column. If there is not a filter column, the model would be created with
@@ -920,7 +919,7 @@ let Re = class extends me {
920
919
  */
921
920
  static async fromFilterColumn(e, r, s) {
922
921
  var w;
923
- const n = e.get(Ge), l = e.get(K), i = e.get(Fe, gt.OPTIONAL), { unitId: o, subUnitId: a } = r, c = n.getUniverSheetInstance(o);
922
+ const n = e.get(Ge), l = e.get(K), i = e.get(Ne, gt.OPTIONAL), { unitId: o, subUnitId: a } = r, c = n.getUniverSheetInstance(o);
924
923
  if (!c) throw new Error(`[ByValuesModel]: Workbook not found for filter model with unitId: ${o}!`);
925
924
  const h = c == null ? void 0 : c.getSheetBySheetId(a);
926
925
  if (!h) throw new Error(`[ByValuesModel]: Worksheet not found for filter model with unitId: ${o} and subUnitId: ${a}!`);
@@ -938,10 +937,10 @@ let Re = class extends me {
938
937
  });
939
938
  R = M.filterTreeItems, O = M.filterTreeMapCache;
940
939
  } else {
941
- const M = Ut(!!p, l, N, h, C, T, v, c.getStyles());
940
+ const M = $t(!!p, l, N, h, C, T, v, c.getStyles());
942
941
  R = M.filterTreeItems, O = M.filterTreeMapCache;
943
942
  }
944
- return e.createInstance(Re, r, s, R, O);
943
+ return e.createInstance(Oe, r, s, R, O);
945
944
  }
946
945
  get rawFilterItems() {
947
946
  return this._rawFilterItems$.getValue();
@@ -972,7 +971,7 @@ let Re = class extends me {
972
971
  const r = Te.deepClone(this._filterItems), s = We(r, e.key);
973
972
  if (!s)
974
973
  return;
975
- const n = Ht(s);
974
+ const n = Ut(s);
976
975
  ue(s, !n), this._manuallyUpdateFilterItems(r);
977
976
  }
978
977
  onFilterOnly(e) {
@@ -1031,15 +1030,15 @@ let Re = class extends me {
1031
1030
  }
1032
1031
  // #endregion
1033
1032
  };
1034
- Re = et([
1035
- Ce(4, Q)
1036
- ], Re);
1037
- const se = "FILTER_PANEL_OPENED", Ie = {
1033
+ Oe = et([
1034
+ Fe(4, Q)
1035
+ ], Oe);
1036
+ const se = "FILTER_PANEL_OPENED", Re = {
1038
1037
  id: "sheet.operation.open-filter-panel",
1039
1038
  type: Le.OPERATION,
1040
1039
  handler: (t, e) => {
1041
1040
  const r = t.get(we), s = t.get(V), n = t.get(W);
1042
- t.get(Q).syncExecuteCommand(Ir.id, { visible: !1 });
1041
+ t.get(Q).syncExecuteCommand(gr.id, { visible: !1 });
1043
1042
  const { unitId: i, subUnitId: o, col: a } = e, c = s.getFilterModel(i, o);
1044
1043
  return c ? (n.setupCol(c, a), r.getContextValue(se) || r.setContextValue(se, !0), !0) : !1;
1045
1044
  }
@@ -1047,17 +1046,17 @@ const se = "FILTER_PANEL_OPENED", Ie = {
1047
1046
  id: "sheet.operation.close-filter-panel",
1048
1047
  type: Le.OPERATION,
1049
1048
  handler: (t) => {
1050
- const e = t.get(we), r = t.get(W), s = t.get(Sr, gt.OPTIONAL);
1049
+ const e = t.get(we), r = t.get(W), s = t.get(cr, gt.OPTIONAL);
1051
1050
  return e.getContextValue(se) ? (e.setContextValue(se, !1), s == null || s.focus(), r.terminate()) : !1;
1052
1051
  }
1053
- }, kt = {
1052
+ }, Dt = {
1054
1053
  id: "sheet.operation.apply-filter",
1055
1054
  type: Le.OPERATION,
1056
1055
  handler: (t, e) => {
1057
1056
  const { filterBy: r } = e;
1058
1057
  return t.get(W).changeFilterBy(r);
1059
1058
  }
1060
- };
1059
+ }, kt = "sheets-filter-ui.config", Ie = {};
1061
1060
  var oi = Object.getOwnPropertyDescriptor, ai = (t, e, r, s) => {
1062
1061
  for (var n = s > 1 ? void 0 : s ? oi(e, r) : e, l = t.length - 1, i; l >= 0; l--)
1063
1062
  (i = t[l]) && (n = i(n) || n);
@@ -1072,7 +1071,7 @@ let ne = class extends me {
1072
1071
  this._commandService.beforeCommandExecuted((t) => {
1073
1072
  var e, r, s;
1074
1073
  if (t.id === pe.id) {
1075
- const n = this._injector.get(Ge), l = pr(n);
1074
+ const n = this._injector.get(Ge), l = Lr(n);
1076
1075
  if (!l) return;
1077
1076
  const { unitId: i, subUnitId: o, worksheet: a } = l, c = (e = this._sheetsFilterService.getFilterModel(i, o)) == null ? void 0 : e.getRange();
1078
1077
  let h;
@@ -1085,7 +1084,7 @@ let ne = class extends me {
1085
1084
  const m = (r = this._sheetsSelectionService.getCurrentLastSelection()) == null ? void 0 : r.range;
1086
1085
  if (m) {
1087
1086
  let g = { ...m };
1088
- g = m.startColumn === m.endColumn && m.startRow === m.endRow ? fr(g, { left: !0, right: !0, up: !0, down: !0 }, a) : g, h = this._sheetPermissionCheckPermission.permissionCheckWithRanges({
1087
+ g = m.startColumn === m.endColumn && m.startRow === m.endRow ? wr(g, { left: !0, right: !0, up: !0, down: !0 }, a) : g, h = this._sheetPermissionCheckPermission.permissionCheckWithRanges({
1089
1088
  rangeTypes: [ce],
1090
1089
  worksheetTypes: [le, ae]
1091
1090
  }, [g], i, o);
@@ -1097,7 +1096,7 @@ let ne = class extends me {
1097
1096
  }
1098
1097
  h || this._sheetPermissionCheckPermission.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.filterErr"));
1099
1098
  }
1100
- if (t.id === Ie.id) {
1099
+ if (t.id === Re.id) {
1101
1100
  const n = t.params, { unitId: l, subUnitId: i } = n, o = (s = this._sheetsFilterService.getFilterModel(l, i)) == null ? void 0 : s.getRange(), a = Te.deepClone(o);
1102
1101
  a && (a.startColumn = n.col, a.endColumn = n.col, this._sheetPermissionCheckPermission.permissionCheckWithRanges({
1103
1102
  rangeTypes: [ce],
@@ -1112,10 +1111,255 @@ ne = ai([
1112
1111
  ee(0, E(V)),
1113
1112
  ee(1, E(K)),
1114
1113
  ee(2, Q),
1115
- ee(3, E(dr)),
1114
+ ee(3, E(Pr)),
1116
1115
  ee(4, E(X)),
1117
- ee(5, E(mr))
1116
+ ee(5, E(br))
1118
1117
  ], ne);
1118
+ const x = 16, li = new Path2D("M3.30363 3C2.79117 3 2.51457 3.60097 2.84788 3.99024L6.8 8.60593V12.5662C6.8 12.7184 6.8864 12.8575 7.02289 12.9249L8.76717 13.7863C8.96655 13.8847 9.2 13.7396 9.2 13.5173V8.60593L13.1521 3.99024C13.4854 3.60097 13.2088 3 12.6964 3H3.30363Z");
1119
+ class ht {
1120
+ static drawNoCriteria(e, r, s, n) {
1121
+ e.save(), ot.drawWith(e, {
1122
+ radius: 2,
1123
+ width: x,
1124
+ height: x,
1125
+ fill: n
1126
+ }), e.lineCap = "square", e.strokeStyle = s, e.scale(r / x, r / x), e.beginPath(), e.lineWidth = 1, e.lineCap = "round", e.moveTo(3, 4), e.lineTo(13, 4), e.moveTo(4.5, 8), e.lineTo(11.5, 8), e.moveTo(6, 12), e.lineTo(10, 12), e.stroke(), e.restore();
1127
+ }
1128
+ static drawHasCriteria(e, r, s, n) {
1129
+ e.save(), ot.drawWith(e, {
1130
+ radius: 2,
1131
+ width: x,
1132
+ height: x,
1133
+ fill: n
1134
+ }), e.scale(r / x, r / x), e.fillStyle = s, e.fill(li), e.restore();
1135
+ }
1136
+ }
1137
+ var ci = Object.getOwnPropertyDescriptor, ui = (t, e, r, s) => {
1138
+ for (var n = s > 1 ? void 0 : s ? ci(e, r) : e, l = t.length - 1, i; l >= 0; l--)
1139
+ (i = t[l]) && (n = i(n) || n);
1140
+ return n;
1141
+ }, De = (t, e) => (r, s) => e(r, s, t);
1142
+ const H = 16, Se = 1;
1143
+ let Qe = class extends Gr {
1144
+ constructor(e, r, s, n, l) {
1145
+ super(e, r);
1146
+ f(this, "_cellWidth", 0);
1147
+ f(this, "_cellHeight", 0);
1148
+ f(this, "_filterParams");
1149
+ f(this, "_hovered", !1);
1150
+ this._contextService = s, this._commandService = n, this._themeService = l, this.setShapeProps(r), this.onPointerDown$.subscribeEvent((i) => this.onPointerDown(i)), this.onPointerEnter$.subscribeEvent(() => this.onPointerEnter()), this.onPointerLeave$.subscribeEvent(() => this.onPointerLeave());
1151
+ }
1152
+ setShapeProps(e) {
1153
+ typeof e.cellHeight < "u" && (this._cellHeight = e.cellHeight), typeof e.cellWidth < "u" && (this._cellWidth = e.cellWidth), typeof e.filterParams < "u" && (this._filterParams = e.filterParams), this.transformByState({
1154
+ width: e.width,
1155
+ height: e.height
1156
+ });
1157
+ }
1158
+ _draw(e) {
1159
+ const r = this._cellHeight, s = this._cellWidth, n = H - s, l = H - r;
1160
+ e.save();
1161
+ const i = new Path2D();
1162
+ i.rect(n, l, s, r), e.clip(i);
1163
+ const { hasCriteria: o } = this._filterParams, a = this._themeService.getColorFromTheme("primary.600"), c = this._hovered ? this._themeService.getColorFromTheme("gray.50") : "rgba(255, 255, 255, 1.0)";
1164
+ o ? ht.drawHasCriteria(e, H, a, c) : ht.drawNoCriteria(e, H, a, c), e.restore();
1165
+ }
1166
+ onPointerDown(e) {
1167
+ if (e.button === 2)
1168
+ return;
1169
+ const { col: r, unitId: s, subUnitId: n } = this._filterParams;
1170
+ this._contextService.getContextValue(se) || !this._commandService.hasCommand(Re.id) || setTimeout(() => {
1171
+ this._commandService.executeCommand(Re.id, {
1172
+ unitId: s,
1173
+ subUnitId: n,
1174
+ col: r
1175
+ });
1176
+ }, 200);
1177
+ }
1178
+ onPointerEnter() {
1179
+ this._hovered = !0, this.makeDirty(!0);
1180
+ }
1181
+ onPointerLeave() {
1182
+ this._hovered = !1, this.makeDirty(!0);
1183
+ }
1184
+ };
1185
+ Qe = ui([
1186
+ De(2, we),
1187
+ De(3, Q),
1188
+ De(4, E(St))
1189
+ ], Qe);
1190
+ var hi = Object.getOwnPropertyDescriptor, di = (t, e, r, s) => {
1191
+ for (var n = s > 1 ? void 0 : s ? hi(e, r) : e, l = t.length - 1, i; l >= 0; l--)
1192
+ (i = t[l]) && (n = i(n) || n);
1193
+ return n;
1194
+ }, Y = (t, e) => (r, s) => e(r, s, t);
1195
+ const mi = 1e3, pi = 5e3;
1196
+ let Ve = class extends Et {
1197
+ constructor(e, r, s, n, l, i, o, a) {
1198
+ super();
1199
+ f(this, "_filterRangeShape", null);
1200
+ f(this, "_buttonRenderDisposable", null);
1201
+ f(this, "_filterButtonShapes", []);
1202
+ this._context = e, this._injector = r, this._sheetSkeletonManagerService = s, this._sheetsFilterService = n, this._themeService = l, this._sheetInterceptorService = i, this._commandService = o, this._selectionRenderService = a, this._initRenderer();
1203
+ }
1204
+ dispose() {
1205
+ super.dispose(), this._disposeRendering();
1206
+ }
1207
+ _initRenderer() {
1208
+ this._sheetSkeletonManagerService.currentSkeleton$.pipe(
1209
+ Ze((e) => {
1210
+ var o, a;
1211
+ if (!e) return fe(null);
1212
+ const { unit: r, unitId: s } = this._context, n = ((o = r.getActiveSheet()) == null ? void 0 : o.getSheetId()) || "", l = (a = this._sheetsFilterService.getFilterModel(s, n)) != null ? a : void 0, i = () => ({
1213
+ unitId: s,
1214
+ worksheetId: n,
1215
+ filterModel: l,
1216
+ range: l == null ? void 0 : l.getRange(),
1217
+ skeleton: e.skeleton
1218
+ });
1219
+ return zt(this._commandService.onCommandExecuted.bind(this._commandService)).pipe(
1220
+ Wr(
1221
+ ([c]) => {
1222
+ var h;
1223
+ return c.type === Le.MUTATION && ((h = c.params) == null ? void 0 : h.unitId) === r.getUnitId() && (rr.has(c.id) || c.id === $r.id);
1224
+ }
1225
+ ),
1226
+ Ot(20, void 0, { leading: !1, trailing: !0 }),
1227
+ ie(i),
1228
+ Rt(i())
1229
+ // must trigger once
1230
+ );
1231
+ }),
1232
+ Qr(this.dispose$)
1233
+ ).subscribe((e) => {
1234
+ this._disposeRendering(), !(!e || !e.range) && (this._renderRange(e.range, e.skeleton), this._renderButtons(e));
1235
+ });
1236
+ }
1237
+ _renderRange(e, r) {
1238
+ const { scene: s } = this._context, { rowHeaderWidth: n, columnHeaderHeight: l } = r, i = this._filterRangeShape = new Tr(
1239
+ s,
1240
+ mi,
1241
+ this._themeService,
1242
+ {
1243
+ rowHeaderWidth: n,
1244
+ columnHeaderHeight: l,
1245
+ enableAutoFill: !1,
1246
+ highlightHeader: !1
1247
+ }
1248
+ ), a = Nr({
1249
+ range: e,
1250
+ primary: null,
1251
+ style: { fill: "rgba(0, 0, 0, 0.0)" }
1252
+ }, r);
1253
+ i.updateRangeBySelectionWithCoord(a), i.setEvent(!1), s.makeDirty(!0);
1254
+ }
1255
+ _renderButtons(e) {
1256
+ const { range: r, filterModel: s, unitId: n, skeleton: l, worksheetId: i } = e, { scene: o } = this._context;
1257
+ this._interceptCellContent(n, i, e.range);
1258
+ const { startColumn: a, endColumn: c, startRow: h } = r;
1259
+ for (let m = a; m <= c; m++) {
1260
+ const g = `sheets-filter-button-${m}`, p = Fr(h, m, o, l), { startX: T, startY: v, endX: C, endY: N } = p, R = C - T, O = N - v;
1261
+ if (O <= Se || R <= Se)
1262
+ continue;
1263
+ const w = !!s.getFilterColumn(m), M = C - H - Se, _e = N - H - Se, ve = {
1264
+ left: M,
1265
+ top: _e,
1266
+ height: H,
1267
+ width: H,
1268
+ zIndex: pi,
1269
+ cellHeight: O,
1270
+ cellWidth: R,
1271
+ filterParams: { unitId: n, subUnitId: i, col: m, hasCriteria: w }
1272
+ }, I = this._injector.createInstance(Qe, g, ve);
1273
+ this._filterButtonShapes.push(I);
1274
+ }
1275
+ o.addObjects(this._filterButtonShapes), o.makeDirty();
1276
+ }
1277
+ _interceptCellContent(e, r, s) {
1278
+ const { startRow: n, startColumn: l, endColumn: i } = s;
1279
+ this._buttonRenderDisposable = this._sheetInterceptorService.intercept(Ur.CELL_CONTENT, {
1280
+ effect: Jt.Style,
1281
+ handler: (o, a, c) => {
1282
+ const { row: h, col: m, unitId: g, subUnitId: p } = a;
1283
+ return g !== e || p !== r || h !== n || m < l || m > i || ((!o || o === a.rawData) && (o = { ...a.rawData }), o.fontRenderExtension = {
1284
+ ...o == null ? void 0 : o.fontRenderExtension,
1285
+ rightOffset: H
1286
+ }), c(o);
1287
+ },
1288
+ priority: 10
1289
+ });
1290
+ }
1291
+ _disposeRendering() {
1292
+ var e, r;
1293
+ (e = this._filterRangeShape) == null || e.dispose(), this._filterButtonShapes.forEach((s) => s.dispose()), (r = this._buttonRenderDisposable) == null || r.dispose(), this._filterRangeShape = null, this._buttonRenderDisposable = null, this._filterButtonShapes = [];
1294
+ }
1295
+ };
1296
+ Ve = di([
1297
+ Y(1, E(X)),
1298
+ Y(2, E(Sr)),
1299
+ Y(3, E(V)),
1300
+ Y(4, E(St)),
1301
+ Y(5, E(Mr)),
1302
+ Y(6, Q),
1303
+ Y(7, Er)
1304
+ ], Ve);
1305
+ var fi = Object.getOwnPropertyDescriptor, _i = (t, e, r, s) => {
1306
+ for (var n = s > 1 ? void 0 : s ? fi(e, r) : e, l = t.length - 1, i; l >= 0; l--)
1307
+ (i = t[l]) && (n = i(n) || n);
1308
+ return n;
1309
+ }, dt = (t, e) => (r, s) => e(r, s, t);
1310
+ let de = class extends Et {
1311
+ constructor(t, e) {
1312
+ super(), this._renderManagerService = t, this._sheetsRenderService = e, [
1313
+ ir,
1314
+ sr,
1315
+ nr,
1316
+ or
1317
+ ].forEach((r) => this.disposeWithMe(this._sheetsRenderService.registerSkeletonChangingMutations(r.id))), this.disposeWithMe(this._renderManagerService.registerRenderModule(
1318
+ Z.UNIVER_SHEET,
1319
+ [Ve]
1320
+ ));
1321
+ }
1322
+ };
1323
+ de = _i([
1324
+ dt(0, It),
1325
+ dt(1, E(yt))
1326
+ ], de);
1327
+ var vi = Object.defineProperty, gi = Object.getOwnPropertyDescriptor, Si = (t, e, r) => e in t ? vi(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Ei = (t, e, r, s) => {
1328
+ for (var n = s > 1 ? void 0 : s ? gi(e, r) : e, l = t.length - 1, i; l >= 0; l--)
1329
+ (i = t[l]) && (n = i(n) || n);
1330
+ return n;
1331
+ }, mt = (t, e) => (r, s) => e(r, s, t), xt = (t, e, r) => Si(t, typeof e != "symbol" ? e + "" : e, r);
1332
+ const Ti = "SHEET_FILTER_UI_PLUGIN";
1333
+ let Ae = class extends je {
1334
+ constructor(t = Ie, e, r) {
1335
+ super(), this._config = t, this._injector = e, this._configService = r;
1336
+ const { menu: s, ...n } = Ft(
1337
+ {},
1338
+ Ie,
1339
+ this._config
1340
+ );
1341
+ s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(kt, n);
1342
+ }
1343
+ onStarting() {
1344
+ [
1345
+ [ne],
1346
+ [de]
1347
+ ].forEach((t) => this._injector.add(t));
1348
+ }
1349
+ onReady() {
1350
+ this._injector.get(ne);
1351
+ }
1352
+ onRendered() {
1353
+ this._injector.get(de);
1354
+ }
1355
+ };
1356
+ xt(Ae, "type", Z.UNIVER_SHEET);
1357
+ xt(Ae, "pluginName", Ti);
1358
+ Ae = Ei([
1359
+ Tt(Ct),
1360
+ mt(1, E(X)),
1361
+ mt(2, Nt)
1362
+ ], Ae);
1119
1363
  var P = function() {
1120
1364
  return P = Object.assign || function(t) {
1121
1365
  for (var e, r = 1, s = arguments.length; r < s; r++) {
@@ -1124,23 +1368,23 @@ var P = function() {
1124
1368
  }
1125
1369
  return t;
1126
1370
  }, P.apply(this, arguments);
1127
- }, li = function(t, e) {
1371
+ }, Ni = function(t, e) {
1128
1372
  var r = {};
1129
1373
  for (var s in t) Object.prototype.hasOwnProperty.call(t, s) && e.indexOf(s) < 0 && (r[s] = t[s]);
1130
1374
  if (t != null && typeof Object.getOwnPropertySymbols == "function")
1131
1375
  for (var n = 0, s = Object.getOwnPropertySymbols(t); n < s.length; n++)
1132
1376
  e.indexOf(s[n]) < 0 && Object.prototype.propertyIsEnumerable.call(t, s[n]) && (r[s[n]] = t[s[n]]);
1133
1377
  return r;
1134
- }, xt = wt(function(t, e) {
1135
- var r = t.icon, s = t.id, n = t.className, l = t.extend, i = li(t, ["icon", "id", "className", "extend"]), o = "univerjs-icon univerjs-icon-".concat(s, " ").concat(n || "").trim(), a = Jr("_".concat(hi()));
1136
- return Bt(r, "".concat(s), { defIds: r.defIds, idSuffix: a.current }, P({ ref: e, className: o }, i), l);
1378
+ }, Bt = wt(function(t, e) {
1379
+ var r = t.icon, s = t.id, n = t.className, l = t.extend, i = Ni(t, ["icon", "id", "className", "extend"]), o = "univerjs-icon univerjs-icon-".concat(s, " ").concat(n || "").trim(), a = Jr("_".concat(yi()));
1380
+ return Wt(r, "".concat(s), { defIds: r.defIds, idSuffix: a.current }, P({ ref: e, className: o }, i), l);
1137
1381
  });
1138
- function Bt(t, e, r, s, n) {
1139
- return Mt(t.tag, P(P({ key: e }, ci(t, r, n)), s), (ui(t, r).children || []).map(function(l, i) {
1140
- return Bt(l, "".concat(e, "-").concat(t.tag, "-").concat(i), r, void 0, n);
1382
+ function Wt(t, e, r, s, n) {
1383
+ return Mt(t.tag, P(P({ key: e }, Fi(t, r, n)), s), (Ci(t, r).children || []).map(function(l, i) {
1384
+ return Wt(l, "".concat(e, "-").concat(t.tag, "-").concat(i), r, void 0, n);
1141
1385
  }));
1142
1386
  }
1143
- function ci(t, e, r) {
1387
+ function Fi(t, e, r) {
1144
1388
  var s = P({}, t.attrs);
1145
1389
  r != null && r.colorChannel1 && s.fill === "colorChannel1" && (s.fill = r.colorChannel1), t.tag === "mask" && s.id && (s.id = s.id + e.idSuffix), Object.entries(s).forEach(function(l) {
1146
1390
  var i = l[0], o = l[1];
@@ -1152,42 +1396,42 @@ function ci(t, e, r) {
1152
1396
  typeof o == "string" && (s[i] = o.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
1153
1397
  })), s;
1154
1398
  }
1155
- function ui(t, e) {
1399
+ function Ci(t, e) {
1156
1400
  var r, s = e.defIds;
1157
1401
  return !s || s.length === 0 ? t : t.tag === "defs" && (!((r = t.children) === null || r === void 0) && r.length) ? P(P({}, t), { children: t.children.map(function(n) {
1158
1402
  return typeof n.attrs.id == "string" && s && s.includes(n.attrs.id) ? P(P({}, n), { attrs: P(P({}, n.attrs), { id: n.attrs.id + e.idSuffix }) }) : n;
1159
1403
  }) }) : t;
1160
1404
  }
1161
- function hi() {
1405
+ function yi() {
1162
1406
  return Math.random().toString(36).substring(2, 8);
1163
1407
  }
1164
- xt.displayName = "UniverIcon";
1165
- var di = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3.32182 2.60967C2.98161 2.60967 2.79671 3.0074 3.01601 3.2675L6.85819 7.8246C6.94943 7.93282 6.99947 8.06981 6.99947 8.21136V12.7338C6.99947 12.898 7.0998 13.0455 7.2525 13.1058L8.73833 13.6928C9.00085 13.7965 9.28531 13.6031 9.28531 13.3208V8.21136C9.28531 8.06981 9.33535 7.93282 9.42659 7.8246L13.2688 3.2675C13.4881 3.0074 13.3032 2.60967 12.963 2.60967H3.32182ZM2.09858 4.04101C1.22139 3.0006 1.96097 1.40967 3.32182 1.40967H12.963C14.3238 1.40967 15.0634 3.0006 14.1862 4.04101L10.4853 8.43054V13.3208C10.4853 14.4498 9.34747 15.2237 8.29742 14.8089L6.81158 14.2219C6.20078 13.9806 5.79947 13.3905 5.79947 12.7338V8.43054L2.09858 4.04101Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Wt = wt(function(t, e) {
1166
- return Mt(xt, Object.assign({}, t, {
1408
+ Bt.displayName = "UniverIcon";
1409
+ var Oi = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3.32182 2.60967C2.98161 2.60967 2.79671 3.0074 3.01601 3.2675L6.85819 7.8246C6.94943 7.93282 6.99947 8.06981 6.99947 8.21136V12.7338C6.99947 12.898 7.0998 13.0455 7.2525 13.1058L8.73833 13.6928C9.00085 13.7965 9.28531 13.6031 9.28531 13.3208V8.21136C9.28531 8.06981 9.33535 7.93282 9.42659 7.8246L13.2688 3.2675C13.4881 3.0074 13.3032 2.60967 12.963 2.60967H3.32182ZM2.09858 4.04101C1.22139 3.0006 1.96097 1.40967 3.32182 1.40967H12.963C14.3238 1.40967 15.0634 3.0006 14.1862 4.04101L10.4853 8.43054V13.3208C10.4853 14.4498 9.34747 15.2237 8.29742 14.8089L6.81158 14.2219C6.20078 13.9806 5.79947 13.3905 5.79947 12.7338V8.43054L2.09858 4.04101Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Qt = wt(function(t, e) {
1410
+ return Mt(Bt, Object.assign({}, t, {
1167
1411
  id: "filter-icon",
1168
1412
  ref: e,
1169
- icon: di
1413
+ icon: Oi
1170
1414
  }));
1171
1415
  });
1172
- Wt.displayName = "FilterIcon";
1173
- function mi(t) {
1416
+ Qt.displayName = "FilterIcon";
1417
+ function Ri(t) {
1174
1418
  var p, T;
1175
1419
  const { model: e } = t, r = te(K), s = B(e.conditionItem$, void 0), n = B(e.filterConditionFormParams$, void 0), l = n != null && n.and ? "AND" : "OR", i = D((v) => {
1176
1420
  e.onConditionFormChange({ and: v === "AND" });
1177
- }, [e]), o = pi(r), a = D((v) => {
1421
+ }, [e]), o = Ii(r), a = D((v) => {
1178
1422
  e.onPrimaryConditionChange(v);
1179
- }, [e]), c = fi(r), h = D((v) => {
1423
+ }, [e]), c = Ai(r), h = D((v) => {
1180
1424
  e.onConditionFormChange(v);
1181
1425
  }, [e]), m = r.t("sheets-filter.panel.input-values-placeholder");
1182
1426
  function g(v, C, N) {
1183
1427
  const R = d.getItemByOperator(v).numOfParameters === 1;
1184
1428
  return /* @__PURE__ */ b(ct, { children: [
1185
- N === "operator2" && /* @__PURE__ */ b(Yr, { value: l, onChange: i, children: [
1186
- /* @__PURE__ */ S(at, { value: "AND", children: r.t("sheets-filter.panel.and") }),
1187
- /* @__PURE__ */ S(at, { value: "OR", children: r.t("sheets-filter.panel.or") })
1429
+ N === "operator2" && /* @__PURE__ */ b(qr, { value: l, onChange: i, children: [
1430
+ /* @__PURE__ */ S(lt, { value: "AND", children: r.t("sheets-filter.panel.and") }),
1431
+ /* @__PURE__ */ S(lt, { value: "OR", children: r.t("sheets-filter.panel.or") })
1188
1432
  ] }),
1189
1433
  /* @__PURE__ */ S(
1190
- ot,
1434
+ at,
1191
1435
  {
1192
1436
  value: v,
1193
1437
  options: c,
@@ -1195,7 +1439,7 @@ function mi(t) {
1195
1439
  }
1196
1440
  ),
1197
1441
  R && /* @__PURE__ */ S("div", { children: /* @__PURE__ */ S(
1198
- bt,
1442
+ Lt,
1199
1443
  {
1200
1444
  className: "univer-mt-2",
1201
1445
  value: C,
@@ -1211,12 +1455,12 @@ function mi(t) {
1211
1455
  "data-u-comp": "sheets-filter-panel-conditions-container",
1212
1456
  className: "univer-flex univer-h-full univer-flex-col",
1213
1457
  children: s && n && /* @__PURE__ */ b(ct, { children: [
1214
- /* @__PURE__ */ S(ot, { value: s.operator, options: o, onChange: a }),
1458
+ /* @__PURE__ */ S(at, { value: s.operator, options: o, onChange: a }),
1215
1459
  d.getItemByOperator(s.operator).numOfParameters !== 0 ? /* @__PURE__ */ b(
1216
1460
  "div",
1217
1461
  {
1218
1462
  "data-u-comp": "sheets-filter-panel-conditions-container-inner",
1219
- className: At("univer-mt-2 univer-flex-grow univer-overflow-hidden univer-rounded-md univer-p-2", Pt),
1463
+ className: Pt("univer-mt-2 univer-flex-grow univer-overflow-hidden univer-rounded-md univer-p-2", bt),
1220
1464
  children: [
1221
1465
  s.numOfParameters >= 1 && g(n.operator1, (p = n.val1) != null ? p : "", "operator1"),
1222
1466
  s.numOfParameters >= 2 && g(n.operator2, (T = n.val2) != null ? T : "", "operator2"),
@@ -1239,7 +1483,7 @@ function mi(t) {
1239
1483
  }
1240
1484
  );
1241
1485
  }
1242
- function pi(t) {
1486
+ function Ii(t) {
1243
1487
  const e = t.getCurrentLocale();
1244
1488
  return ze(() => [
1245
1489
  {
@@ -1281,11 +1525,11 @@ function pi(t) {
1281
1525
  }
1282
1526
  ], [e, t]);
1283
1527
  }
1284
- function fi(t) {
1528
+ function Ai(t) {
1285
1529
  const e = t.getCurrentLocale();
1286
1530
  return ze(() => d.ALL_CONDITIONS.filter((r) => r.numOfParameters !== 2).map((r) => ({ label: t.t(r.label), value: r.operator })), [e, t]);
1287
1531
  }
1288
- function _i(t) {
1532
+ function Pi(t) {
1289
1533
  const { model: e } = t, r = te(K), s = B(e.searchString$, "", !0), n = B(e.filterItems$, void 0, !0), l = r.t("sheets-filter.panel.filter-only"), i = xe(n), o = i.checked > 0 && i.unchecked === 0, a = i.checked > 0 && i.unchecked > 0, c = e.treeMapCache, h = D(() => {
1290
1534
  e.onCheckAllToggled(!o);
1291
1535
  }, [e, o]), m = D((p) => {
@@ -1304,7 +1548,7 @@ function _i(t) {
1304
1548
  className: "univer-flex univer-h-full univer-flex-col",
1305
1549
  children: [
1306
1550
  /* @__PURE__ */ S(
1307
- bt,
1551
+ Lt,
1308
1552
  {
1309
1553
  autoFocus: !0,
1310
1554
  value: s,
@@ -1316,7 +1560,7 @@ function _i(t) {
1316
1560
  "div",
1317
1561
  {
1318
1562
  "data-u-comp": "sheets-filter-panel",
1319
- className: At("univer-mt-2 univer-box-border univer-flex univer-flex-grow univer-flex-col univer-overflow-hidden univer-rounded-md univer-px-2 univer-py-2.5", Pt),
1563
+ className: Pt("univer-mt-2 univer-box-border univer-flex univer-flex-grow univer-flex-col univer-overflow-hidden univer-rounded-md univer-px-2 univer-py-2.5", bt),
1320
1564
  children: [
1321
1565
  /* @__PURE__ */ S(
1322
1566
  "div",
@@ -1330,7 +1574,7 @@ function _i(t) {
1330
1574
  className: "univer-box-border univer-flex univer-h-7 univer-items-center univer-rounded-md univer-pb-0 univer-pl-5 univer-pr-0.5 univer-pt-0 univer-text-sm",
1331
1575
  children: [
1332
1576
  /* @__PURE__ */ S(
1333
- qr,
1577
+ Kr,
1334
1578
  {
1335
1579
  indeterminate: a,
1336
1580
  disabled: n.length === 0,
@@ -1360,7 +1604,7 @@ function _i(t) {
1360
1604
  }
1361
1605
  ),
1362
1606
  /* @__PURE__ */ S("div", { "data-u-comp": "sheets-filter-panel-values-virtual", className: "univer-flex-grow", children: /* @__PURE__ */ S(
1363
- Kr,
1607
+ Xr,
1364
1608
  {
1365
1609
  data: n,
1366
1610
  defaultExpandAll: !1,
@@ -1418,17 +1662,17 @@ function _i(t) {
1418
1662
  }
1419
1663
  );
1420
1664
  }
1421
- function vi() {
1665
+ function bi() {
1422
1666
  var C;
1423
- const t = te(W), e = te(K), r = te(Q), s = B(t.filterBy$, void 0, !0), n = B(t.filterByModel$, void 0, !1), l = B(() => (n == null ? void 0 : n.canApply$) || fe(!1), void 0, !1, [n]), i = gi(e), o = !B(t.hasCriteria$), a = D((N) => {
1424
- r.executeCommand(kt.id, { filterBy: N });
1667
+ const t = te(W), e = te(K), r = te(Q), s = B(t.filterBy$, void 0, !0), n = B(t.filterByModel$, void 0, !1), l = B(() => (n == null ? void 0 : n.canApply$) || fe(!1), void 0, !1, [n]), i = Li(e), o = !B(t.hasCriteria$), a = D((N) => {
1668
+ r.executeCommand(Dt.id, { filterBy: N });
1425
1669
  }, [r]), c = D(async () => {
1426
1670
  await (n == null ? void 0 : n.clear()), r.executeCommand(he.id);
1427
1671
  }, [n, r]), h = D(() => {
1428
1672
  r.executeCommand(he.id);
1429
1673
  }, [r]), m = D(async () => {
1430
1674
  await (n == null ? void 0 : n.apply()), r.executeCommand(he.id);
1431
- }, [n, r]), p = (C = te(V).activeFilterModel) == null ? void 0 : C.getRange(), T = t.col, v = Er(Ar.FILTER_PANEL_EMBED_POINT);
1675
+ }, [n, r]), p = (C = te(V).activeFilterModel) == null ? void 0 : C.getRange(), T = t.col, v = ur(Cr.FILTER_PANEL_EMBED_POINT);
1432
1676
  return /* @__PURE__ */ b(
1433
1677
  "div",
1434
1678
  {
@@ -1436,14 +1680,14 @@ function vi() {
1436
1680
  className: "univer-box-border univer-flex univer-h-[442px] univer-w-[312px] univer-flex-col univer-rounded-lg univer-bg-white univer-p-4 univer-shadow-lg dark:!univer-border-gray-600 dark:!univer-bg-gray-700",
1437
1681
  children: [
1438
1682
  /* @__PURE__ */ S(
1439
- Tr,
1683
+ hr,
1440
1684
  {
1441
1685
  components: v,
1442
1686
  sharedProps: { range: p, colIndex: T, onClose: h }
1443
1687
  }
1444
1688
  ),
1445
1689
  /* @__PURE__ */ S("div", { className: "univer-mb-1 univer-flex-shrink-0 univer-flex-grow-0", children: /* @__PURE__ */ S(
1446
- Xr,
1690
+ Zr,
1447
1691
  {
1448
1692
  value: s,
1449
1693
  items: i,
@@ -1455,7 +1699,7 @@ function vi() {
1455
1699
  {
1456
1700
  "data-u-comp": "sheets-filter-panel-content",
1457
1701
  className: "univer-flex-shrink univer-flex-grow univer-pt-2",
1458
- children: s === ye.VALUES ? /* @__PURE__ */ S(_i, { model: n }) : /* @__PURE__ */ S(mi, { model: n })
1702
+ children: s === Ce.VALUES ? /* @__PURE__ */ S(Pi, { model: n }) : /* @__PURE__ */ S(Ri, { model: n })
1459
1703
  }
1460
1704
  ) : /* @__PURE__ */ S("div", { className: "univer-flex-1" }),
1461
1705
  /* @__PURE__ */ b(
@@ -1476,14 +1720,14 @@ function vi() {
1476
1720
  }
1477
1721
  );
1478
1722
  }
1479
- function gi(t) {
1723
+ function Li(t) {
1480
1724
  const e = t.getCurrentLocale();
1481
1725
  return ze(() => [
1482
- { label: t.t("sheets-filter.panel.by-values"), value: ye.VALUES },
1483
- { label: t.t("sheets-filter.panel.by-conditions"), value: ye.CONDITIONS }
1726
+ { label: t.t("sheets-filter.panel.by-values"), value: Ce.VALUES },
1727
+ { label: t.t("sheets-filter.panel.by-conditions"), value: Ce.CONDITIONS }
1484
1728
  ], [e, t]);
1485
1729
  }
1486
- function Si(t) {
1730
+ function wi(t) {
1487
1731
  const e = t.get(V);
1488
1732
  return {
1489
1733
  id: pe.id,
@@ -1492,9 +1736,9 @@ function Si(t) {
1492
1736
  tooltip: "sheets-filter.toolbar.smart-toggle-filter-tooltip",
1493
1737
  hidden$: Ke(t, Z.UNIVER_SHEET),
1494
1738
  activated$: e.activeFilterModel$.pipe(ie((r) => !!r)),
1495
- disabled$: Pr(
1739
+ disabled$: yr(
1496
1740
  t,
1497
- br(
1741
+ Or(
1498
1742
  t,
1499
1743
  {
1500
1744
  worksheetTypes: [ae, le],
@@ -1504,7 +1748,7 @@ function Si(t) {
1504
1748
  )
1505
1749
  };
1506
1750
  }
1507
- function Ei(t) {
1751
+ function Mi(t) {
1508
1752
  const e = t.get(V);
1509
1753
  return {
1510
1754
  id: qe.id,
@@ -1517,7 +1761,7 @@ function Ei(t) {
1517
1761
  }))
1518
1762
  };
1519
1763
  }
1520
- function Ti(t) {
1764
+ function $i(t) {
1521
1765
  const e = t.get(V);
1522
1766
  return {
1523
1767
  id: Ye.id,
@@ -1530,244 +1774,35 @@ function Ti(t) {
1530
1774
  }))
1531
1775
  };
1532
1776
  }
1533
- const Ni = {
1534
- [Nr.ORGANIZATION]: {
1777
+ const Ui = {
1778
+ [dr.ORGANIZATION]: {
1535
1779
  [pe.id]: {
1536
1780
  order: 2,
1537
- menuItemFactory: Si,
1781
+ menuItemFactory: wi,
1538
1782
  [qe.id]: {
1539
1783
  order: 0,
1540
- menuItemFactory: Ei
1784
+ menuItemFactory: Mi
1541
1785
  },
1542
1786
  [Ye.id]: {
1543
1787
  order: 1,
1544
- menuItemFactory: Ti
1545
- }
1546
- }
1547
- }
1548
- }, x = 16, Fi = new Path2D("M3.30363 3C2.79117 3 2.51457 3.60097 2.84788 3.99024L6.8 8.60593V12.5662C6.8 12.7184 6.8864 12.8575 7.02289 12.9249L8.76717 13.7863C8.96655 13.8847 9.2 13.7396 9.2 13.5173V8.60593L13.1521 3.99024C13.4854 3.60097 13.2088 3 12.6964 3H3.30363Z");
1549
- class ht {
1550
- static drawNoCriteria(e, r, s, n) {
1551
- e.save(), lt.drawWith(e, {
1552
- radius: 2,
1553
- width: x,
1554
- height: x,
1555
- fill: n
1556
- }), e.lineCap = "square", e.strokeStyle = s, e.scale(r / x, r / x), e.beginPath(), e.lineWidth = 1, e.lineCap = "round", e.moveTo(3, 4), e.lineTo(13, 4), e.moveTo(4.5, 8), e.lineTo(11.5, 8), e.moveTo(6, 12), e.lineTo(10, 12), e.stroke(), e.restore();
1557
- }
1558
- static drawHasCriteria(e, r, s, n) {
1559
- e.save(), lt.drawWith(e, {
1560
- radius: 2,
1561
- width: x,
1562
- height: x,
1563
- fill: n
1564
- }), e.scale(r / x, r / x), e.fillStyle = s, e.fill(Fi), e.restore();
1565
- }
1566
- }
1567
- var Ci = Object.getOwnPropertyDescriptor, yi = (t, e, r, s) => {
1568
- for (var n = s > 1 ? void 0 : s ? Ci(e, r) : e, l = t.length - 1, i; l >= 0; l--)
1569
- (i = t[l]) && (n = i(n) || n);
1570
- return n;
1571
- }, De = (t, e) => (r, s) => e(r, s, t);
1572
- const H = 16, Se = 1;
1573
- let Qe = class extends zr {
1574
- constructor(e, r, s, n, l) {
1575
- super(e, r);
1576
- f(this, "_cellWidth", 0);
1577
- f(this, "_cellHeight", 0);
1578
- f(this, "_filterParams");
1579
- f(this, "_hovered", !1);
1580
- this._contextService = s, this._commandService = n, this._themeService = l, this.setShapeProps(r), this.onPointerDown$.subscribeEvent((i) => this.onPointerDown(i)), this.onPointerEnter$.subscribeEvent(() => this.onPointerEnter()), this.onPointerLeave$.subscribeEvent(() => this.onPointerLeave());
1581
- }
1582
- setShapeProps(e) {
1583
- typeof e.cellHeight < "u" && (this._cellHeight = e.cellHeight), typeof e.cellWidth < "u" && (this._cellWidth = e.cellWidth), typeof e.filterParams < "u" && (this._filterParams = e.filterParams), this.transformByState({
1584
- width: e.width,
1585
- height: e.height
1586
- });
1587
- }
1588
- _draw(e) {
1589
- const r = this._cellHeight, s = this._cellWidth, n = H - s, l = H - r;
1590
- e.save();
1591
- const i = new Path2D();
1592
- i.rect(n, l, s, r), e.clip(i);
1593
- const { hasCriteria: o } = this._filterParams, a = this._themeService.getColorFromTheme("primary.600"), c = this._hovered ? this._themeService.getColorFromTheme("gray.50") : "rgba(255, 255, 255, 1.0)";
1594
- o ? ht.drawHasCriteria(e, H, a, c) : ht.drawNoCriteria(e, H, a, c), e.restore();
1595
- }
1596
- onPointerDown(e) {
1597
- if (e.button === 2)
1598
- return;
1599
- const { col: r, unitId: s, subUnitId: n } = this._filterParams;
1600
- this._contextService.getContextValue(se) || !this._commandService.hasCommand(Ie.id) || setTimeout(() => {
1601
- this._commandService.executeCommand(Ie.id, {
1602
- unitId: s,
1603
- subUnitId: n,
1604
- col: r
1605
- });
1606
- }, 200);
1607
- }
1608
- onPointerEnter() {
1609
- this._hovered = !0, this.makeDirty(!0);
1610
- }
1611
- onPointerLeave() {
1612
- this._hovered = !1, this.makeDirty(!0);
1613
- }
1614
- };
1615
- Qe = yi([
1616
- De(2, we),
1617
- De(3, Q),
1618
- De(4, E(St))
1619
- ], Qe);
1620
- var Oi = Object.getOwnPropertyDescriptor, Ri = (t, e, r, s) => {
1621
- for (var n = s > 1 ? void 0 : s ? Oi(e, r) : e, l = t.length - 1, i; l >= 0; l--)
1622
- (i = t[l]) && (n = i(n) || n);
1623
- return n;
1624
- }, Y = (t, e) => (r, s) => e(r, s, t);
1625
- const Ii = 1e3, Ai = 5e3;
1626
- let Ve = class extends Et {
1627
- constructor(e, r, s, n, l, i, o, a) {
1628
- super();
1629
- f(this, "_filterRangeShape", null);
1630
- f(this, "_buttonRenderDisposable", null);
1631
- f(this, "_filterButtonShapes", []);
1632
- this._context = e, this._injector = r, this._sheetSkeletonManagerService = s, this._sheetsFilterService = n, this._themeService = l, this._sheetInterceptorService = i, this._commandService = o, this._selectionRenderService = a, this._initRenderer();
1633
- }
1634
- dispose() {
1635
- super.dispose(), this._disposeRendering();
1636
- }
1637
- _initRenderer() {
1638
- this._sheetSkeletonManagerService.currentSkeleton$.pipe(
1639
- Ze((e) => {
1640
- var o, a;
1641
- if (!e) return fe(null);
1642
- const { unit: r, unitId: s } = this._context, n = ((o = r.getActiveSheet()) == null ? void 0 : o.getSheetId()) || "", l = (a = this._sheetsFilterService.getFilterModel(s, n)) != null ? a : void 0, i = () => ({
1643
- unitId: s,
1644
- worksheetId: n,
1645
- filterModel: l,
1646
- range: l == null ? void 0 : l.getRange(),
1647
- skeleton: e.skeleton
1648
- });
1649
- return zt(this._commandService.onCommandExecuted.bind(this._commandService)).pipe(
1650
- Vr(
1651
- ([c]) => {
1652
- var h;
1653
- return c.type === Le.MUTATION && ((h = c.params) == null ? void 0 : h.unitId) === r.getUnitId() && (sr.has(c.id) || c.id === vr.id);
1654
- }
1655
- ),
1656
- Rt(20, void 0, { leading: !1, trailing: !0 }),
1657
- ie(i),
1658
- It(i())
1659
- // must trigger once
1660
- );
1661
- }),
1662
- Gr(this.dispose$)
1663
- ).subscribe((e) => {
1664
- this._disposeRendering(), !(!e || !e.range) && (this._renderRange(e.range, e.skeleton), this._renderButtons(e));
1665
- });
1666
- }
1667
- _renderRange(e, r) {
1668
- const { scene: s } = this._context, { rowHeaderWidth: n, columnHeaderHeight: l } = r, i = this._filterRangeShape = new Mr(
1669
- s,
1670
- Ii,
1671
- this._themeService,
1672
- {
1673
- rowHeaderWidth: n,
1674
- columnHeaderHeight: l,
1675
- enableAutoFill: !1,
1676
- highlightHeader: !1
1788
+ menuItemFactory: $i
1677
1789
  }
1678
- ), a = $r({
1679
- range: e,
1680
- primary: null,
1681
- style: { fill: "rgba(0, 0, 0, 0.0)" }
1682
- }, r);
1683
- i.updateRangeBySelectionWithCoord(a), i.setEvent(!1), s.makeDirty(!0);
1684
- }
1685
- _renderButtons(e) {
1686
- const { range: r, filterModel: s, unitId: n, skeleton: l, worksheetId: i } = e, { scene: o } = this._context;
1687
- this._interceptCellContent(n, i, e.range);
1688
- const { startColumn: a, endColumn: c, startRow: h } = r;
1689
- for (let m = a; m <= c; m++) {
1690
- const g = `sheets-filter-button-${m}`, p = Ur(h, m, o, l), { startX: T, startY: v, endX: C, endY: N } = p, R = C - T, O = N - v;
1691
- if (O <= Se || R <= Se)
1692
- continue;
1693
- const w = !!s.getFilterColumn(m), M = C - H - Se, _e = N - H - Se, ve = {
1694
- left: M,
1695
- top: _e,
1696
- height: H,
1697
- width: H,
1698
- zIndex: Ai,
1699
- cellHeight: O,
1700
- cellWidth: R,
1701
- filterParams: { unitId: n, subUnitId: i, col: m, hasCriteria: w }
1702
- }, I = this._injector.createInstance(Qe, g, ve);
1703
- this._filterButtonShapes.push(I);
1704
1790
  }
1705
- o.addObjects(this._filterButtonShapes), o.makeDirty();
1706
- }
1707
- _interceptCellContent(e, r, s) {
1708
- const { startRow: n, startColumn: l, endColumn: i } = s;
1709
- this._buttonRenderDisposable = this._sheetInterceptorService.intercept(gr.CELL_CONTENT, {
1710
- effect: Jt.Style,
1711
- handler: (o, a, c) => {
1712
- const { row: h, col: m, unitId: g, subUnitId: p } = a;
1713
- return g !== e || p !== r || h !== n || m < l || m > i || ((!o || o === a.rawData) && (o = { ...a.rawData }), o.fontRenderExtension = {
1714
- ...o == null ? void 0 : o.fontRenderExtension,
1715
- rightOffset: H
1716
- }), c(o);
1717
- },
1718
- priority: 10
1719
- });
1720
- }
1721
- _disposeRendering() {
1722
- var e, r;
1723
- (e = this._filterRangeShape) == null || e.dispose(), this._filterButtonShapes.forEach((s) => s.dispose()), (r = this._buttonRenderDisposable) == null || r.dispose(), this._filterRangeShape = null, this._buttonRenderDisposable = null, this._filterButtonShapes = [];
1724
- }
1725
- };
1726
- Ve = Ri([
1727
- Y(1, E(X)),
1728
- Y(2, E(Lr)),
1729
- Y(3, E(V)),
1730
- Y(4, E(St)),
1731
- Y(5, E(_r)),
1732
- Y(6, Q),
1733
- Y(7, wr)
1734
- ], Ve);
1735
- var Pi = Object.getOwnPropertyDescriptor, bi = (t, e, r, s) => {
1736
- for (var n = s > 1 ? void 0 : s ? Pi(e, r) : e, l = t.length - 1, i; l >= 0; l--)
1737
- (i = t[l]) && (n = i(n) || n);
1738
- return n;
1739
- }, dt = (t, e) => (r, s) => e(r, s, t);
1740
- let de = class extends Et {
1741
- constructor(t, e) {
1742
- super(), this._renderManagerService = t, this._sheetsRenderService = e, [
1743
- nr,
1744
- or,
1745
- ar,
1746
- lr
1747
- ].forEach((r) => this.disposeWithMe(this._sheetsRenderService.registerSkeletonChangingMutations(r.id))), this.disposeWithMe(this._renderManagerService.registerRenderModule(
1748
- Z.UNIVER_SHEET,
1749
- [Ve]
1750
- ));
1751
1791
  }
1752
- };
1753
- de = bi([
1754
- dt(0, Lt),
1755
- dt(1, E(Ot))
1756
- ], de);
1757
- const Li = {
1792
+ }, Hi = {
1758
1793
  id: pe.id,
1759
- binding: Fr.L | nt.CTRL_COMMAND | nt.SHIFT,
1794
+ binding: mr.L | nt.CTRL_COMMAND | nt.SHIFT,
1760
1795
  description: "sheets-filter.shortcut.smart-toggle-filter",
1761
- preconditions: Hr,
1796
+ preconditions: Rr,
1762
1797
  group: "4_sheet-edit"
1763
1798
  };
1764
- var wi = Object.getOwnPropertyDescriptor, Mi = (t, e, r, s) => {
1765
- for (var n = s > 1 ? void 0 : s ? wi(e, r) : e, l = t.length - 1, i; l >= 0; l--)
1799
+ var Di = Object.getOwnPropertyDescriptor, ki = (t, e, r, s) => {
1800
+ for (var n = s > 1 ? void 0 : s ? Di(e, r) : e, l = t.length - 1, i; l >= 0; l--)
1766
1801
  (i = t[l]) && (n = i(n) || n);
1767
1802
  return n;
1768
1803
  }, A = (t, e) => (r, s) => e(r, s, t);
1769
- const mt = "FILTER_PANEL_POPUP";
1770
- let Ae = class extends de {
1804
+ const pt = "FILTER_PANEL_POPUP";
1805
+ let Pe = class extends de {
1771
1806
  constructor(e, r, s, n, l, i, o, a, c, h, m, g, p) {
1772
1807
  super(p, g);
1773
1808
  f(this, "_popupDisposable");
@@ -1778,7 +1813,7 @@ let Ae = class extends de {
1778
1813
  }
1779
1814
  _initShortcuts() {
1780
1815
  [
1781
- Li
1816
+ Hi
1782
1817
  ].forEach((e) => {
1783
1818
  this.disposeWithMe(this._shortcutService.registerShortcut(e));
1784
1819
  });
@@ -1786,34 +1821,34 @@ let Ae = class extends de {
1786
1821
  _initCommands() {
1787
1822
  [
1788
1823
  pe,
1789
- cr,
1790
- ur,
1824
+ ar,
1825
+ lr,
1791
1826
  re,
1792
1827
  qe,
1793
1828
  Ye,
1794
- kt,
1795
- Ie,
1829
+ Dt,
1830
+ Re,
1796
1831
  he
1797
1832
  ].forEach((e) => {
1798
1833
  this.disposeWithMe(this._commandService.registerCommand(e));
1799
1834
  });
1800
1835
  }
1801
1836
  _initMenuItems() {
1802
- this._menuManagerService.mergeMenu(Ni);
1837
+ this._menuManagerService.mergeMenu(Ui);
1803
1838
  }
1804
1839
  _initUI() {
1805
1840
  [
1806
- [mt, vi],
1807
- ["FilterIcon", Wt]
1841
+ [pt, bi],
1842
+ ["FilterIcon", Qt]
1808
1843
  ].forEach(([e, r]) => {
1809
1844
  this.disposeWithMe(
1810
1845
  this._componentManager.register(e, r)
1811
1846
  );
1812
- }), this.disposeWithMe(this._contextService.subscribeContextValue$(se).pipe(jr()).subscribe((e) => {
1847
+ }), this.disposeWithMe(this._contextService.subscribeContextValue$(se).pipe(Vr()).subscribe((e) => {
1813
1848
  e ? this._openFilterPopup() : this._closeFilterPopup();
1814
1849
  })), this.disposeWithMe(this._sheetsFilterService.errorMsg$.subscribe((e) => {
1815
1850
  e && this._messageService.show({
1816
- type: Zr.Error,
1851
+ type: zr.Error,
1817
1852
  content: this._localeService.t(e)
1818
1853
  });
1819
1854
  }));
@@ -1824,7 +1859,7 @@ let Ae = class extends de {
1824
1859
  throw new Error("[SheetsFilterUIController]: no filter model when opening filter popup!");
1825
1860
  const r = e.getRange(), s = this._sheetsFilterPanelService.col, { startRow: n } = r;
1826
1861
  this._popupDisposable = this._sheetCanvasPopupService.attachPopupToCell(n, s, {
1827
- componentKey: mt,
1862
+ componentKey: pt,
1828
1863
  direction: "horizontal",
1829
1864
  onClickOutside: () => this._commandService.syncExecuteCommand(he.id),
1830
1865
  offset: [5, 0]
@@ -1835,44 +1870,44 @@ let Ae = class extends de {
1835
1870
  (e = this._popupDisposable) == null || e.dispose(), this._popupDisposable = null;
1836
1871
  }
1837
1872
  };
1838
- Ae = Mi([
1873
+ Pe = ki([
1839
1874
  A(0, E(X)),
1840
- A(1, E(Cr)),
1875
+ A(1, E(pr)),
1841
1876
  A(2, E(W)),
1842
- A(3, E(Dr)),
1877
+ A(3, E(Ir)),
1843
1878
  A(4, E(V)),
1844
1879
  A(5, E(K)),
1845
- A(6, yr),
1880
+ A(6, fr),
1846
1881
  A(7, Q),
1847
- A(8, Or),
1882
+ A(8, _r),
1848
1883
  A(9, we),
1849
- A(10, Rr),
1850
- A(11, E(Ot)),
1851
- A(12, Lt)
1852
- ], Ae);
1853
- var $i = Object.defineProperty, Ui = Object.getOwnPropertyDescriptor, Hi = (t, e, r) => e in t ? $i(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Di = (t, e, r, s) => {
1854
- for (var n = s > 1 ? void 0 : s ? Ui(e, r) : e, l = t.length - 1, i; l >= 0; l--)
1884
+ A(10, vr),
1885
+ A(11, E(yt)),
1886
+ A(12, It)
1887
+ ], Pe);
1888
+ var xi = Object.defineProperty, Bi = Object.getOwnPropertyDescriptor, Wi = (t, e, r) => e in t ? xi(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Qi = (t, e, r, s) => {
1889
+ for (var n = s > 1 ? void 0 : s ? Bi(e, r) : e, l = t.length - 1, i; l >= 0; l--)
1855
1890
  (i = t[l]) && (n = i(n) || n);
1856
1891
  return n;
1857
- }, ke = (t, e) => (r, s) => e(r, s, t), Qt = (t, e, r) => Hi(t, typeof e != "symbol" ? e + "" : e, r);
1858
- const ki = "SHEET_FILTER_UI_PLUGIN";
1859
- let Pe = class extends je {
1860
- constructor(t = Ne, e, r, s) {
1892
+ }, ke = (t, e) => (r, s) => e(r, s, t), Vt = (t, e, r) => Wi(t, typeof e != "symbol" ? e + "" : e, r);
1893
+ const Vi = "SHEET_FILTER_UI_PLUGIN";
1894
+ let be = class extends je {
1895
+ constructor(t = Ie, e, r, s) {
1861
1896
  super(), this._config = t, this._injector = e, this._configService = r, this._rpcChannelService = s;
1862
1897
  const { menu: n, ...l } = Ft(
1863
1898
  {},
1864
- Ne,
1899
+ Ie,
1865
1900
  this._config
1866
1901
  );
1867
- n && this._configService.setConfig("menu", n, { merge: !0 }), this._configService.setConfig($t, l);
1902
+ n && this._configService.setConfig("menu", n, { merge: !0 }), this._configService.setConfig(kt, l);
1868
1903
  }
1869
1904
  onStarting() {
1870
1905
  tr(this._injector, [
1871
1906
  [W],
1872
1907
  [ne],
1873
- [Ae]
1874
- ]), this._config.useRemoteFilterValuesGenerator && this._rpcChannelService && this._injector.add([Fe, {
1875
- useFactory: () => rr(
1908
+ [Pe]
1909
+ ]), this._config.useRemoteFilterValuesGenerator && this._rpcChannelService && this._injector.add([Ne, {
1910
+ useFactory: () => jr(
1876
1911
  this._rpcChannelService.requestChannel(Je)
1877
1912
  )
1878
1913
  }]);
@@ -1884,53 +1919,17 @@ let Pe = class extends je {
1884
1919
  }
1885
1920
  onRendered() {
1886
1921
  st(this._injector, [
1887
- [Ae]
1922
+ [Pe]
1888
1923
  ]);
1889
1924
  }
1890
1925
  };
1891
- Qt(Pe, "type", Z.UNIVER_SHEET);
1892
- Qt(Pe, "pluginName", ki);
1893
- Pe = Di([
1894
- Tt(yt),
1895
- ke(1, E(X)),
1896
- ke(2, Nt),
1897
- ke(3, er(Ct))
1898
- ], Pe);
1899
- var xi = Object.defineProperty, Bi = Object.getOwnPropertyDescriptor, Wi = (t, e, r) => e in t ? xi(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Qi = (t, e, r, s) => {
1900
- for (var n = s > 1 ? void 0 : s ? Bi(e, r) : e, l = t.length - 1, i; l >= 0; l--)
1901
- (i = t[l]) && (n = i(n) || n);
1902
- return n;
1903
- }, pt = (t, e) => (r, s) => e(r, s, t), Vt = (t, e, r) => Wi(t, typeof e != "symbol" ? e + "" : e, r);
1904
- const Vi = "SHEET_FILTER_UI_PLUGIN";
1905
- let be = class extends je {
1906
- constructor(t = Ne, e, r) {
1907
- super(), this._config = t, this._injector = e, this._configService = r;
1908
- const { menu: s, ...n } = Ft(
1909
- {},
1910
- Ne,
1911
- this._config
1912
- );
1913
- s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig($t, n);
1914
- }
1915
- onStarting() {
1916
- [
1917
- [ne],
1918
- [de]
1919
- ].forEach((t) => this._injector.add(t));
1920
- }
1921
- onReady() {
1922
- this._injector.get(ne);
1923
- }
1924
- onRendered() {
1925
- this._injector.get(de);
1926
- }
1927
- };
1928
1926
  Vt(be, "type", Z.UNIVER_SHEET);
1929
1927
  Vt(be, "pluginName", Vi);
1930
1928
  be = Qi([
1931
- Tt(yt),
1932
- pt(1, E(X)),
1933
- pt(2, Nt)
1929
+ Tt(Ct),
1930
+ ke(1, E(X)),
1931
+ ke(2, Nt),
1932
+ ke(3, er(At))
1934
1933
  ], be);
1935
1934
  var Gi = Object.getOwnPropertyDescriptor, ji = (t, e, r, s) => {
1936
1935
  for (var n = s > 1 ? void 0 : s ? Gi(e, r) : e, l = t.length - 1, i; l >= 0; l--)
@@ -1943,25 +1942,25 @@ let _t = (Ee = class extends je {
1943
1942
  }
1944
1943
  onStarting() {
1945
1944
  [
1946
- [Fe, { useClass: Be }]
1945
+ [Ne, { useClass: Be }]
1947
1946
  ].forEach((t) => this._injector.add(t));
1948
1947
  }
1949
1948
  onReady() {
1950
1949
  this._rpcChannelService.registerChannel(
1951
1950
  Je,
1952
- ir(this._injector.get(Fe))
1951
+ Yr(this._injector.get(Ne))
1953
1952
  );
1954
1953
  }
1955
1954
  }, f(Ee, "type", Z.UNIVER_SHEET), f(Ee, "pluginName", "SHEET_FILTER_UI_WORKER_PLUGIN"), Ee);
1956
1955
  _t = ji([
1957
1956
  ft(1, E(X)),
1958
- ft(2, Ct)
1957
+ ft(2, At)
1959
1958
  ], _t);
1960
1959
  export {
1961
- kt as ChangeFilterByOperation,
1960
+ Dt as ChangeFilterByOperation,
1962
1961
  he as CloseFilterPanelOperation,
1963
- Ie as OpenFilterPanelOperation,
1964
- be as UniverSheetsFilterMobileUIPlugin,
1965
- Pe as UniverSheetsFilterUIPlugin,
1962
+ Re as OpenFilterPanelOperation,
1963
+ Ae as UniverSheetsFilterMobileUIPlugin,
1964
+ be as UniverSheetsFilterUIPlugin,
1966
1965
  _t as UniverSheetsFilterUIWorkerPlugin
1967
1966
  };