@univerjs/sheets-filter-ui 0.7.0 → 0.8.0-beta.0

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/es/index.js CHANGED
@@ -2,10 +2,10 @@ var Yt = Object.defineProperty;
2
2
  var qt = (t, e, r) => e in t ? Yt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
3
  var f = (t, e, r) => qt(t, typeof e != "symbol" ? e + "" : e, r);
4
4
  import { BooleanNumber as rt, createIdentifier as _t, Inject as E, LocaleService as K, IUniverInstanceService as Ge, ILogService as Kt, extractPureTextFromCell as Xt, numfmt as it, Disposable as me, Injector as X, Quantity as vt, Tools as Te, ICommandService as Q, CommandType as Le, IContextService as Me, UniverInstanceType as Z, ThemeService as gt, RxDisposable as St, fromCallback as Zt, InterceptorEffectEnum as zt, DependentOn as Et, IConfigService as Tt, Optional as Jt, Plugin as je, merge as Nt } from "@univerjs/core";
5
- import { IRPCChannelService as Ft, toModule as er, fromModule as tr } 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 rr, SetSheetsFilterRangeMutation as ir, SetSheetsFilterCriteriaMutation as sr, RemoveSheetsFilterMutation as nr, ReCalcSheetsFilterMutation as or, RemoveSheetFilterCommand as ar, SetSheetFilterRangeCommand as lr, UniverSheetsFilterPlugin as Ct } from "@univerjs/sheets-filter";
5
+ import { IRPCChannelService as Ct, toModule as er, fromModule as tr } 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 rr, SetSheetsFilterRangeMutation as ir, SetSheetsFilterCriteriaMutation as sr, RemoveSheetsFilterMutation as nr, ReCalcSheetsFilterMutation as or, RemoveSheetFilterCommand as ar, SetSheetFilterRangeCommand as lr, UniverSheetsFilterPlugin as Ft } from "@univerjs/sheets-filter";
7
7
  import { RefRangeService as cr, SheetPermissionCheckController as ur, SheetsSelectionsService as hr, getSheetCommandTarget as dr, WorksheetFilterPermission as ae, WorksheetViewPermission as le, RangeProtectionPermissionViewPoint as ce, expandToContinuousRange as mr, SheetInterceptorService as pr, SetRangeValuesMutation as fr, INTERCEPTOR_POINT as _r } from "@univerjs/sheets";
8
- import { ILayoutService as vr, useDependency as te, useObservable as B, useComponentsOfPart as gr, ComponentContainer as Sr, getMenuHiddenObservable as Ke, MenuItemType as Xe, RibbonStartGroup as Er, KeyCode as Tr, MetaKeys as st, ComponentManager as Nr, IShortcutService as Fr, IMenuManagerService as Cr, IMessageService as yr } from "@univerjs/ui";
8
+ import { ILayoutService as vr, useDependency as te, useObservable as B, useComponentsOfPart as gr, ComponentContainer as Sr, getMenuHiddenObservable as Ke, MenuItemType as Xe, RibbonDataGroup as Er, KeyCode as Tr, MetaKeys as st, ComponentManager as Nr, IShortcutService as Cr, IMenuManagerService as Fr, IMessageService as yr } from "@univerjs/ui";
9
9
  import { SetCellEditVisibleOperation as Or, SheetsUIPart as Rr, getObservableWithExclusiveRange$ as Ir, getCurrentRangeDisable$ as Ar, SheetSkeletonManagerService as Pr, ISheetSelectionRenderService as br, SelectionControl as Lr, attachSelectionWithCoord as Mr, getCoordByCell as wr, SheetsRenderService as yt, whenSheetEditorFocused as $r, SheetCanvasPopManagerService as Ur } from "@univerjs/sheets-ui";
10
10
  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";
11
11
  import { Select as nt, clsx as It, borderClassName as At, RadioGroup as Gr, Radio as ot, Input as Pt, Checkbox as jr, Tree as Yr, Segmented as qr, Button as Ue, MessageType as Kr } from "@univerjs/design";
@@ -13,12 +13,12 @@ import { Rect as at, Shape as Xr, IRenderManagerService as bt } from "@univerjs/
13
13
  import { jsx as S, jsxs as b, Fragment as lt } from "react/jsx-runtime";
14
14
  import { forwardRef as Lt, useRef as Zr, createElement as Mt, useCallback as D, useMemo as ze } from "react";
15
15
  const wt = "sheets-filter-ui.config", Ne = {};
16
- 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;
16
+ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SECOND", t))(C || {}), _ = /* @__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
17
  ((t) => {
18
18
  t.NONE = {
19
19
  label: "sheets-filter.conditions.none",
20
20
  operator: _.NONE,
21
- order: F.SECOND,
21
+ order: C.SECOND,
22
22
  numOfParameters: 0,
23
23
  getDefaultFormParams: () => {
24
24
  throw new Error("[FilterConditionItems.NONE]: should not have initial form params!");
@@ -29,7 +29,7 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
29
29
  }, t.EMPTY = {
30
30
  label: "sheets-filter.conditions.empty",
31
31
  operator: _.EMPTY,
32
- order: F.SECOND,
32
+ order: C.SECOND,
33
33
  numOfParameters: 0,
34
34
  getDefaultFormParams: () => {
35
35
  throw new Error("[FilterConditionItems.EMPTY]: should not have initial form params!");
@@ -46,7 +46,7 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
46
46
  }, t.NOT_EMPTY = {
47
47
  label: "sheets-filter.conditions.not-empty",
48
48
  operator: _.NOT_EMPTY,
49
- order: F.SECOND,
49
+ order: C.SECOND,
50
50
  numOfParameters: 0,
51
51
  getDefaultFormParams: () => {
52
52
  throw new Error("[FilterConditionItems.NOT_EMPTY]: should not have initial form params!");
@@ -63,7 +63,7 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
63
63
  }, t.TEXT_CONTAINS = {
64
64
  label: "sheets-filter.conditions.text-contains",
65
65
  operator: _.CONTAINS,
66
- order: F.FIRST,
66
+ order: C.FIRST,
67
67
  numOfParameters: 1,
68
68
  getDefaultFormParams: () => ({ operator1: _.CONTAINS, val1: "" }),
69
69
  testMappingParams: (i) => {
@@ -86,7 +86,7 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
86
86
  }, t.DOES_NOT_CONTAIN = {
87
87
  label: "sheets-filter.conditions.does-not-contain",
88
88
  operator: _.DOES_NOT_CONTAIN,
89
- order: F.FIRST,
89
+ order: C.FIRST,
90
90
  numOfParameters: 1,
91
91
  getDefaultFormParams: () => ({ operator1: _.DOES_NOT_CONTAIN, val1: "" }),
92
92
  mapToFilterColumn: (i) => ({
@@ -106,7 +106,7 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
106
106
  }, t.STARTS_WITH = {
107
107
  label: "sheets-filter.conditions.starts-with",
108
108
  operator: _.STARTS_WITH,
109
- order: F.FIRST,
109
+ order: C.FIRST,
110
110
  numOfParameters: 1,
111
111
  getDefaultFormParams: () => ({ operator1: _.STARTS_WITH, val1: "" }),
112
112
  mapToFilterColumn: (i) => ({
@@ -126,7 +126,7 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
126
126
  }, t.ENDS_WITH = {
127
127
  label: "sheets-filter.conditions.ends-with",
128
128
  operator: _.ENDS_WITH,
129
- order: F.FIRST,
129
+ order: C.FIRST,
130
130
  numOfParameters: 1,
131
131
  getDefaultFormParams: () => ({ operator1: _.ENDS_WITH, val1: "" }),
132
132
  mapToFilterColumn: (i) => ({
@@ -146,7 +146,7 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
146
146
  }, t.EQUALS = {
147
147
  label: "sheets-filter.conditions.equals",
148
148
  operator: _.EQUALS,
149
- order: F.FIRST,
149
+ order: C.FIRST,
150
150
  numOfParameters: 1,
151
151
  getDefaultFormParams: () => ({ operator1: _.EQUALS, val1: "" }),
152
152
  testMappingParams: (i) => {
@@ -167,7 +167,7 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
167
167
  label: "sheets-filter.conditions.greater-than",
168
168
  operator: u.GREATER_THAN,
169
169
  numOfParameters: 1,
170
- order: F.FIRST,
170
+ order: C.FIRST,
171
171
  getDefaultFormParams: () => ({ operator1: u.GREATER_THAN, val1: "" }),
172
172
  mapToFilterColumn: (i) => ({
173
173
  customFilters: { customFilters: [{ val: i.val1, operator: u.GREATER_THAN }] }
@@ -187,7 +187,7 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
187
187
  label: "sheets-filter.conditions.greater-than-or-equal",
188
188
  operator: u.GREATER_THAN_OR_EQUAL,
189
189
  numOfParameters: 1,
190
- order: F.FIRST,
190
+ order: C.FIRST,
191
191
  getDefaultFormParams: () => ({ operator1: u.GREATER_THAN_OR_EQUAL, val1: "" }),
192
192
  testMappingParams: (i) => {
193
193
  const [o] = L(i);
@@ -207,7 +207,7 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
207
207
  label: "sheets-filter.conditions.less-than",
208
208
  operator: u.LESS_THAN,
209
209
  numOfParameters: 1,
210
- order: F.FIRST,
210
+ order: C.FIRST,
211
211
  getDefaultFormParams: () => ({ operator1: u.LESS_THAN, val1: "" }),
212
212
  testMappingParams: (i) => {
213
213
  const [o] = L(i);
@@ -227,7 +227,7 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
227
227
  label: "sheets-filter.conditions.less-than-or-equal",
228
228
  operator: u.LESS_THAN_OR_EQUAL,
229
229
  numOfParameters: 1,
230
- order: F.FIRST,
230
+ order: C.FIRST,
231
231
  getDefaultFormParams: () => ({ operator1: u.LESS_THAN_OR_EQUAL, val1: "" }),
232
232
  testMappingParams: (i) => {
233
233
  const [o] = L(i);
@@ -247,7 +247,7 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
247
247
  label: "sheets-filter.conditions.equal",
248
248
  operator: u.EQUAL,
249
249
  numOfParameters: 1,
250
- order: F.FIRST,
250
+ order: C.FIRST,
251
251
  getDefaultFormParams: () => ({ operator1: u.EQUAL, val1: "" }),
252
252
  testMappingParams: (i) => {
253
253
  const [o] = L(i);
@@ -267,7 +267,7 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
267
267
  label: "sheets-filter.conditions.not-equal",
268
268
  operator: u.NOT_EQUALS,
269
269
  numOfParameters: 1,
270
- order: F.FIRST,
270
+ order: C.FIRST,
271
271
  getDefaultFormParams: () => ({ operator1: u.NOT_EQUALS, val1: "" }),
272
272
  testMappingParams: (i) => {
273
273
  const [o] = L(i);
@@ -286,7 +286,7 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
286
286
  }, t.BETWEEN = {
287
287
  label: "sheets-filter.conditions.between",
288
288
  operator: _.BETWEEN,
289
- order: F.SECOND,
289
+ order: C.SECOND,
290
290
  numOfParameters: 2,
291
291
  getDefaultFormParams: () => ({
292
292
  and: !0,
@@ -335,7 +335,7 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
335
335
  }, t.NOT_BETWEEN = {
336
336
  label: "sheets-filter.conditions.not-between",
337
337
  operator: _.NOT_BETWEEN,
338
- order: F.SECOND,
338
+ order: C.SECOND,
339
339
  numOfParameters: 2,
340
340
  getDefaultFormParams: () => ({
341
341
  operator1: u.LESS_THAN,
@@ -380,7 +380,7 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
380
380
  }, t.CUSTOM = {
381
381
  label: "sheets-filter.conditions.custom",
382
382
  operator: _.CUSTOM,
383
- order: F.SECOND,
383
+ order: C.SECOND,
384
384
  numOfParameters: 2,
385
385
  getDefaultFormParams: () => ({
386
386
  operator1: _.NONE,
@@ -403,10 +403,10 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
403
403
  return g(m, c);
404
404
  if (T)
405
405
  return g(h, a);
406
- const v = g(h, a), C = g(m, c), N = {
406
+ const v = g(h, a), F = g(m, c), N = {
407
407
  customFilters: [
408
408
  v.customFilters.customFilters[0],
409
- C.customFilters.customFilters[0]
409
+ F.customFilters.customFilters[0]
410
410
  ]
411
411
  };
412
412
  return o && (N.and = rt.TRUE), { customFilters: N };
@@ -511,7 +511,7 @@ var zr = Object.getOwnPropertyDescriptor, Jr = (t, e, r, s) => {
511
511
  (i = t[l]) && (n = i(n) || n);
512
512
  return n;
513
513
  }, He = (t, e) => (r, s) => e(r, s, t);
514
- const Je = "sheets-filter.generate-filter-values.service", Fe = _t(Je), ei = ["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"];
514
+ const Je = "sheets-filter.generate-filter-values.service", Ce = _t(Je), ei = ["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
515
  let Be = class extends me {
516
516
  constructor(t, e, r) {
517
517
  super(), this._localeService = t, this._univerInstanceService = e, this._logService = r;
@@ -528,7 +528,7 @@ Be = Jr([
528
528
  He(2, Kt)
529
529
  ], Be);
530
530
  function $t(t, e, r, s, n, l, i, o) {
531
- var v, C, N, R, O, M, w, _e, ve;
531
+ var v, F, N, R, O, M, w, _e, ve;
532
532
  const a = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), h = "yyyy-mm-dd", m = new Set(ei), g = "empty";
533
533
  let p = 0;
534
534
  for (const I of s.iterateByColumn(r, !1, !1)) {
@@ -545,7 +545,7 @@ function $t(t, e, r, s, n, l, i, o) {
545
545
  p += 1, z += tt;
546
546
  continue;
547
547
  }
548
- const ge = (v = I.value) != null && v.v && !I.value.p ? (R = (N = o.get((C = I.value) == null ? void 0 : C.s)) == null ? void 0 : N.n) == null ? void 0 : R.pattern : "", jt = ge && it.isDate(ge);
548
+ const ge = (v = I.value) != null && v.v && !I.value.p ? (R = (N = o.get((F = I.value) == null ? void 0 : F.s)) == null ? void 0 : N.n) == null ? void 0 : R.pattern : "", jt = ge && it.isDate(ge);
549
549
  if (ge && jt && m.has(ge)) {
550
550
  const k = (O = s.getCellRaw(I.row, I.col)) == null ? void 0 : O.v;
551
551
  if (!k) {
@@ -669,7 +669,7 @@ var ii = Object.getOwnPropertyDescriptor, et = (t, e, r, s) => {
669
669
  for (var n = s > 1 ? void 0 : s ? ii(e, r) : e, l = t.length - 1, i; l >= 0; l--)
670
670
  (i = t[l]) && (n = i(n) || n);
671
671
  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 || {});
672
+ }, Fe = (t, e) => (r, s) => e(r, s, t), ye = /* @__PURE__ */ ((t) => (t[t.VALUES = 0] = "VALUES", t[t.CONDITIONS = 1] = "CONDITIONS", t))(ye || {});
673
673
  _t("sheets-filter-ui.sheets-filter-panel.service");
674
674
  let W = class extends me {
675
675
  constructor(e, r) {
@@ -788,8 +788,8 @@ let W = class extends me {
788
788
  }
789
789
  };
790
790
  W = et([
791
- Ce(0, E(X)),
792
- Ce(1, E(cr))
791
+ Fe(0, E(X)),
792
+ Fe(1, E(cr))
793
793
  ], W);
794
794
  let Oe = class extends me {
795
795
  constructor(e, r, s, n, l) {
@@ -877,7 +877,7 @@ let Oe = class extends me {
877
877
  }
878
878
  };
879
879
  Oe = et([
880
- Ce(4, Q)
880
+ Fe(4, Q)
881
881
  ], Oe);
882
882
  let Re = class extends me {
883
883
  constructor(e, r, s, n, l) {
@@ -920,17 +920,17 @@ let Re = class extends me {
920
920
  */
921
921
  static async fromFilterColumn(e, r, s) {
922
922
  var M;
923
- const n = e.get(Ge), l = e.get(K), i = e.get(Fe, vt.OPTIONAL), { unitId: o, subUnitId: a } = r, c = n.getUniverSheetInstance(o);
923
+ const n = e.get(Ge), l = e.get(K), i = e.get(Ce, vt.OPTIONAL), { unitId: o, subUnitId: a } = r, c = n.getUniverSheetInstance(o);
924
924
  if (!c) throw new Error(`[ByValuesModel]: Workbook not found for filter model with unitId: ${o}!`);
925
925
  const h = c == null ? void 0 : c.getSheetBySheetId(a);
926
926
  if (!h) throw new Error(`[ByValuesModel]: Worksheet not found for filter model with unitId: ${o} and subUnitId: ${a}!`);
927
- const m = r.getRange(), g = s, p = (M = r.getFilterColumn(s)) == null ? void 0 : M.getColumnData().filters, T = new Set(p == null ? void 0 : p.filters), v = !!(p && p.blank), C = r.getFilteredOutRowsExceptCol(s), N = { ...m, startRow: m.startRow + 1, startColumn: g, endColumn: g };
927
+ const m = r.getRange(), g = s, p = (M = r.getFilterColumn(s)) == null ? void 0 : M.getColumnData().filters, T = new Set(p == null ? void 0 : p.filters), v = !!(p && p.blank), F = r.getFilteredOutRowsExceptCol(s), N = { ...m, startRow: m.startRow + 1, startColumn: g, endColumn: g };
928
928
  let R, O;
929
929
  if (i) {
930
930
  const w = await i.getFilterValues({
931
931
  unitId: o,
932
932
  subUnitId: a,
933
- filteredOutRowsByOtherColumns: Array.from(C),
933
+ filteredOutRowsByOtherColumns: Array.from(F),
934
934
  filters: !!p,
935
935
  blankChecked: v,
936
936
  iterateRange: N,
@@ -938,7 +938,7 @@ let Re = class extends me {
938
938
  });
939
939
  R = w.filterTreeItems, O = w.filterTreeMapCache;
940
940
  } else {
941
- const w = $t(!!p, l, N, h, C, T, v, c.getStyles());
941
+ const w = $t(!!p, l, N, h, F, T, v, c.getStyles());
942
942
  R = w.filterTreeItems, O = w.filterTreeMapCache;
943
943
  }
944
944
  return e.createInstance(Re, r, s, R, O);
@@ -1032,7 +1032,7 @@ let Re = class extends me {
1032
1032
  // #endregion
1033
1033
  };
1034
1034
  Re = et([
1035
- Ce(4, Q)
1035
+ Fe(4, Q)
1036
1036
  ], Re);
1037
1037
  const se = "FILTER_PANEL_OPENED", Ie = {
1038
1038
  id: "sheet.operation.open-filter-panel",
@@ -1179,7 +1179,7 @@ function hi(t) {
1179
1179
  }, [e]), c = mi(r), h = D((v) => {
1180
1180
  e.onConditionFormChange(v);
1181
1181
  }, [e]), m = r.t("sheets-filter.panel.input-values-placeholder");
1182
- function g(v, C, N) {
1182
+ function g(v, F, N) {
1183
1183
  const R = d.getItemByOperator(v).numOfParameters === 1;
1184
1184
  return /* @__PURE__ */ b(lt, { children: [
1185
1185
  N === "operator2" && /* @__PURE__ */ b(Gr, { value: l, onChange: i, children: [
@@ -1198,7 +1198,7 @@ function hi(t) {
1198
1198
  Pt,
1199
1199
  {
1200
1200
  className: "univer-mt-2",
1201
- value: C,
1201
+ value: F,
1202
1202
  placeholder: m,
1203
1203
  onChange: (O) => h({ [N === "operator1" ? "val1" : "val2"]: O })
1204
1204
  }
@@ -1342,7 +1342,7 @@ function pi(t) {
1342
1342
  "span",
1343
1343
  {
1344
1344
  "data-u-comp": "sheets-filter-panel-values-item-text",
1345
- className: "univer-mx-1 univer-inline-block univer-flex-shrink univer-overflow-hidden univer-text-ellipsis univer-whitespace-nowrap univer-text-gray-900 dark:univer-text-white",
1345
+ className: "univer-mx-1 univer-inline-block univer-flex-shrink univer-overflow-hidden univer-text-ellipsis univer-whitespace-nowrap univer-text-gray-900 dark:!univer-text-white",
1346
1346
  children: `${r.t("sheets-filter.panel.select-all")}`
1347
1347
  }
1348
1348
  ),
@@ -1350,7 +1350,7 @@ function pi(t) {
1350
1350
  "span",
1351
1351
  {
1352
1352
  "data-u-comp": "sheets-filter-panel-values-item-count",
1353
- className: "univer-text-gray-400 dark:univer-text-gray-500",
1353
+ className: "univer-text-gray-400 dark:!univer-text-gray-500",
1354
1354
  children: `(${i.checked}/${i.checked + i.unchecked})`
1355
1355
  }
1356
1356
  )
@@ -1375,8 +1375,8 @@ function pi(t) {
1375
1375
  univer-pr-2 univer-border-box univer-max-w-[245px] univer-rounded-md
1376
1376
  [&:hover_a]:univer-inline-block
1377
1377
  hover:univer-bg-gray-50 univer-h-full
1378
- univer-text-gray-900 dark:hover:univer-bg-gray-900
1379
- dark:univer-text-white
1378
+ univer-text-gray-900 dark:hover:!univer-bg-gray-900
1379
+ dark:!univer-text-white
1380
1380
  `,
1381
1381
  attachRender: (p) => /* @__PURE__ */ b(
1382
1382
  "div",
@@ -1387,7 +1387,7 @@ function pi(t) {
1387
1387
  "span",
1388
1388
  {
1389
1389
  "data-u-comp": "sheets-filter-panel-values-item-count",
1390
- className: "univer-text-gray-400 dark:univer-text-gray-500",
1390
+ className: "univer-text-gray-400 dark:!univer-text-gray-500",
1391
1391
  children: `(${p.count})`
1392
1392
  }
1393
1393
  ),
@@ -1398,8 +1398,8 @@ function pi(t) {
1398
1398
  onClick: () => {
1399
1399
  const T = [];
1400
1400
  p.children ? p.children.forEach((v) => {
1401
- v.children ? v.children.forEach((C) => {
1402
- T.push(C.key);
1401
+ v.children ? v.children.forEach((F) => {
1402
+ T.push(F.key);
1403
1403
  }) : T.push(v.key);
1404
1404
  }) : T.push(p.key), e.onFilterOnly(T);
1405
1405
  },
@@ -1419,7 +1419,7 @@ function pi(t) {
1419
1419
  );
1420
1420
  }
1421
1421
  function fi() {
1422
- var C;
1422
+ var F;
1423
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 = _i(e), o = !B(t.hasCriteria$), a = D((N) => {
1424
1424
  r.executeCommand(Dt.id, { filterBy: N });
1425
1425
  }, [r]), c = D(async () => {
@@ -1428,12 +1428,12 @@ function fi() {
1428
1428
  r.executeCommand(he.id);
1429
1429
  }, [r]), m = D(async () => {
1430
1430
  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 = gr(Rr.FILTER_PANEL_EMBED_POINT);
1431
+ }, [n, r]), p = (F = te(V).activeFilterModel) == null ? void 0 : F.getRange(), T = t.col, v = gr(Rr.FILTER_PANEL_EMBED_POINT);
1432
1432
  return /* @__PURE__ */ b(
1433
1433
  "div",
1434
1434
  {
1435
1435
  "data-u-comp": "sheets-filter-panel",
1436
- className: "univer-box-border univer-flex univer-h-[432px] 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",
1436
+ 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
1437
  children: [
1438
1438
  /* @__PURE__ */ S(
1439
1439
  Sr,
@@ -1457,7 +1457,7 @@ function fi() {
1457
1457
  className: "univer-flex-shrink univer-flex-grow univer-pt-2",
1458
1458
  children: s === ye.VALUES ? /* @__PURE__ */ S(pi, { model: n }) : /* @__PURE__ */ S(hi, { model: n })
1459
1459
  }
1460
- ) : /* @__PURE__ */ S("div", { style: { flex: 1 } }),
1460
+ ) : /* @__PURE__ */ S("div", { className: "univer-flex-1" }),
1461
1461
  /* @__PURE__ */ b(
1462
1462
  "div",
1463
1463
  {
@@ -1465,7 +1465,7 @@ function fi() {
1465
1465
  className: "univer-mt-4 univer-inline-flex univer-flex-shrink-0 univer-flex-grow-0 univer-flex-nowrap univer-justify-between univer-overflow-hidden",
1466
1466
  children: [
1467
1467
  /* @__PURE__ */ S(Ue, { variant: "link", onClick: c, disabled: o, children: e.t("sheets-filter.panel.clear-filter") }),
1468
- /* @__PURE__ */ b("span", { className: "univer-space-x-2", children: [
1468
+ /* @__PURE__ */ b("span", { className: "univer-flex univer-gap-2", children: [
1469
1469
  /* @__PURE__ */ S(Ue, { variant: "default", onClick: h, children: e.t("sheets-filter.panel.cancel") }),
1470
1470
  /* @__PURE__ */ S(Ue, { disabled: !l, variant: "primary", onClick: m, children: e.t("sheets-filter.panel.confirm") })
1471
1471
  ] })
@@ -1522,9 +1522,9 @@ function Si(t) {
1522
1522
  };
1523
1523
  }
1524
1524
  const Ei = {
1525
- [Er.FORMULAS_INSERT]: {
1525
+ [Er.ORGANIZATION]: {
1526
1526
  [pe.id]: {
1527
- order: 10,
1527
+ order: 2,
1528
1528
  menuItemFactory: vi,
1529
1529
  [qe.id]: {
1530
1530
  order: 0,
@@ -1555,7 +1555,7 @@ class ut {
1555
1555
  }), e.scale(r / x, r / x), e.fillStyle = s, e.fill(Ti), e.restore();
1556
1556
  }
1557
1557
  }
1558
- var Ni = Object.getOwnPropertyDescriptor, Fi = (t, e, r, s) => {
1558
+ var Ni = Object.getOwnPropertyDescriptor, Ci = (t, e, r, s) => {
1559
1559
  for (var n = s > 1 ? void 0 : s ? Ni(e, r) : e, l = t.length - 1, i; l >= 0; l--)
1560
1560
  (i = t[l]) && (n = i(n) || n);
1561
1561
  return n;
@@ -1603,13 +1603,13 @@ let Qe = class extends Xr {
1603
1603
  this._hovered = !1, this.makeDirty(!0);
1604
1604
  }
1605
1605
  };
1606
- Qe = Fi([
1606
+ Qe = Ci([
1607
1607
  De(2, Me),
1608
1608
  De(3, Q),
1609
1609
  De(4, E(gt))
1610
1610
  ], Qe);
1611
- var Ci = Object.getOwnPropertyDescriptor, yi = (t, e, r, s) => {
1612
- for (var n = s > 1 ? void 0 : s ? Ci(e, r) : e, l = t.length - 1, i; l >= 0; l--)
1611
+ var Fi = Object.getOwnPropertyDescriptor, yi = (t, e, r, s) => {
1612
+ for (var n = s > 1 ? void 0 : s ? Fi(e, r) : e, l = t.length - 1, i; l >= 0; l--)
1613
1613
  (i = t[l]) && (n = i(n) || n);
1614
1614
  return n;
1615
1615
  }, Y = (t, e) => (r, s) => e(r, s, t);
@@ -1678,10 +1678,10 @@ let Ve = class extends St {
1678
1678
  this._interceptCellContent(n, i, e.range);
1679
1679
  const { startColumn: a, endColumn: c, startRow: h } = r;
1680
1680
  for (let m = a; m <= c; m++) {
1681
- const g = `sheets-filter-button-${m}`, p = wr(h, m, o, l), { startX: T, startY: v, endX: C, endY: N } = p, R = C - T, O = N - v;
1681
+ const g = `sheets-filter-button-${m}`, p = wr(h, m, o, l), { startX: T, startY: v, endX: F, endY: N } = p, R = F - T, O = N - v;
1682
1682
  if (O <= Se || R <= Se)
1683
1683
  continue;
1684
- const M = !!s.getFilterColumn(m), w = C - H - Se, _e = N - H - Se, ve = {
1684
+ const M = !!s.getFilterColumn(m), w = F - H - Se, _e = N - H - Se, ve = {
1685
1685
  left: w,
1686
1686
  top: _e,
1687
1687
  height: H,
@@ -1796,7 +1796,14 @@ let Ae = class extends de {
1796
1796
  this._menuManagerService.mergeMenu(Ei);
1797
1797
  }
1798
1798
  _initUI() {
1799
- this.disposeWithMe(this._componentManager.register(dt, fi)), this.disposeWithMe(this._componentManager.register("FilterSingle", Bt)), this.disposeWithMe(this._contextService.subscribeContextValue$(se).pipe(Vr()).subscribe((e) => {
1799
+ [
1800
+ [dt, fi],
1801
+ ["FilterSingle", Bt]
1802
+ ].forEach(([e, r]) => {
1803
+ this.disposeWithMe(
1804
+ this._componentManager.register(e, r)
1805
+ );
1806
+ }), this.disposeWithMe(this._contextService.subscribeContextValue$(se).pipe(Vr()).subscribe((e) => {
1800
1807
  e ? this._openFilterPopup() : this._closeFilterPopup();
1801
1808
  })), this.disposeWithMe(this._sheetsFilterService.errorMsg$.subscribe((e) => {
1802
1809
  e && this._messageService.show({
@@ -1829,9 +1836,9 @@ Ae = Li([
1829
1836
  A(3, E(Ur)),
1830
1837
  A(4, E(V)),
1831
1838
  A(5, E(K)),
1832
- A(6, Fr),
1839
+ A(6, Cr),
1833
1840
  A(7, Q),
1834
- A(8, Cr),
1841
+ A(8, Fr),
1835
1842
  A(9, Me),
1836
1843
  A(10, yr),
1837
1844
  A(11, E(yt)),
@@ -1858,7 +1865,7 @@ let Pe = class extends je {
1858
1865
  [W],
1859
1866
  [ne],
1860
1867
  [Ae]
1861
- ].forEach((t) => this._injector.add(t)), this._config.useRemoteFilterValuesGenerator && this._rpcChannelService && this._injector.add([Fe, {
1868
+ ].forEach((t) => this._injector.add(t)), this._config.useRemoteFilterValuesGenerator && this._rpcChannelService && this._injector.add([Ce, {
1862
1869
  useFactory: () => er(
1863
1870
  this._rpcChannelService.requestChannel(Je)
1864
1871
  )
@@ -1874,10 +1881,10 @@ let Pe = class extends je {
1874
1881
  Wt(Pe, "type", Z.UNIVER_SHEET);
1875
1882
  Wt(Pe, "pluginName", Hi);
1876
1883
  Pe = Ui([
1877
- Et(Ct),
1884
+ Et(Ft),
1878
1885
  ke(1, E(X)),
1879
1886
  ke(2, Tt),
1880
- ke(3, Jt(Ft))
1887
+ ke(3, Jt(Ct))
1881
1888
  ], Pe);
1882
1889
  var Di = Object.defineProperty, ki = Object.getOwnPropertyDescriptor, xi = (t, e, r) => e in t ? Di(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Bi = (t, e, r, s) => {
1883
1890
  for (var n = s > 1 ? void 0 : s ? ki(e, r) : e, l = t.length - 1, i; l >= 0; l--)
@@ -1911,7 +1918,7 @@ let be = class extends je {
1911
1918
  Qt(be, "type", Z.UNIVER_SHEET);
1912
1919
  Qt(be, "pluginName", Wi);
1913
1920
  be = Bi([
1914
- Et(Ct),
1921
+ Et(Ft),
1915
1922
  mt(1, E(X)),
1916
1923
  mt(2, Tt)
1917
1924
  ], be);
@@ -1926,19 +1933,19 @@ let ft = (Ee = class extends je {
1926
1933
  }
1927
1934
  onStarting() {
1928
1935
  [
1929
- [Fe, { useClass: Be }]
1936
+ [Ce, { useClass: Be }]
1930
1937
  ].forEach((t) => this._injector.add(t));
1931
1938
  }
1932
1939
  onReady() {
1933
1940
  this._rpcChannelService.registerChannel(
1934
1941
  Je,
1935
- tr(this._injector.get(Fe))
1942
+ tr(this._injector.get(Ce))
1936
1943
  );
1937
1944
  }
1938
1945
  }, f(Ee, "type", Z.UNIVER_SHEET), f(Ee, "pluginName", "SHEET_FILTER_UI_WORKER_PLUGIN"), Ee);
1939
1946
  ft = Vi([
1940
1947
  pt(1, E(X)),
1941
- pt(2, Ft)
1948
+ pt(2, Ct)
1942
1949
  ], ft);
1943
1950
  export {
1944
1951
  Dt as ChangeFilterByOperation,
package/lib/index.css CHANGED
@@ -1 +1 @@
1
- .univer-mx-1{margin-left:4px;margin-right:4px}.univer-mb-1{margin-bottom:4px}.univer-ml-1{margin-left:4px}.univer-mt-2{margin-top:8px}.univer-mt-4{margin-top:16px}.univer-box-border{box-sizing:border-box}.univer-inline-block{display:inline-block}.univer-flex{display:flex}.univer-inline-flex{display:inline-flex}.univer-hidden{display:none}.univer-h-4{height:16px}.univer-h-5{height:20px}.univer-h-7{height:28px}.univer-h-8{height:32px}.univer-h-\[432px\]{height:432px}.univer-h-full{height:100%}.univer-w-\[312px\]{width:312px}.univer-w-full{width:100%}.univer-max-w-\[245px\]{max-width:245px}.univer-flex-1{flex:1 1 0%}.univer-flex-shrink{flex-shrink:1}.univer-flex-shrink-0{flex-shrink:0}.univer-flex-grow{flex-grow:1}.univer-flex-grow-0{flex-grow:0}.univer-cursor-pointer{cursor:pointer}.univer-flex-col{flex-direction:column}.univer-flex-nowrap{flex-wrap:nowrap}.univer-items-center{align-items:center}.univer-justify-between{justify-content:space-between}.univer-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:0;margin-right:calc(8px * var(--tw-space-x-reverse));margin-left:calc(8px * (1 - var(--tw-space-x-reverse)));margin-left:8px;margin-left:calc(8px * calc(1 - var(--tw-space-x-reverse)))}.univer-overflow-hidden{overflow:hidden}.univer-text-ellipsis{text-overflow:ellipsis}.univer-whitespace-nowrap{white-space:nowrap}.univer-rounded-lg{border-radius:8px}.univer-rounded-md{border-radius:6px}.univer-bg-white{background-color:var(--univer-white)}.univer-p-2{padding:8px}.univer-p-4{padding:16px}.univer-px-1\.5{padding-left:6px;padding-right:6px}.univer-px-2{padding-left:8px;padding-right:8px}.univer-py-0\.5{padding-top:2px;padding-bottom:2px}.univer-py-2\.5{padding-top:10px;padding-bottom:10px}.univer-pb-0{padding-bottom:0}.univer-pl-5{padding-left:20px}.univer-pr-0\.5{padding-right:2px}.univer-pr-2{padding-right:8px}.univer-pt-0{padding-top:0}.univer-pt-2{padding-top:8px}.univer-text-sm{font-size:14px;line-height:20px}.univer-text-xs{font-size:12px;line-height:16px}.univer-text-gray-400{color:var(--univer-gray-400)}.univer-text-gray-500{color:var(--univer-gray-500)}.univer-text-gray-900{color:var(--univer-gray-900)}.univer-text-primary-500{color:var(--univer-primary-500)}.univer-shadow-lg{--tw-shadow: 0px 4px 6px 0px rgba(30, 40, 77, .05), 0px 10px 15px -3px rgba(30, 40, 77, .1);--tw-shadow-colored: 0px 4px 6px 0px var(--tw-shadow-color), 0px 10px 15px -3px var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 4px 6px #1e284d0d,0 10px 15px -3px #1e284d1a;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.hover\:univer-bg-gray-50:hover{background-color:var(--univer-gray-50)}.dark\:univer-border-gray-600:where(.univer-dark,.univer-dark *){border-color:var(--univer-gray-600)}.dark\:univer-bg-gray-700:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-700)}.dark\:univer-text-gray-500:where(.univer-dark,.univer-dark *){color:var(--univer-gray-500)}.dark\:univer-text-white:where(.univer-dark,.univer-dark *){color:var(--univer-white)}.dark\:hover\:univer-bg-gray-900:hover:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-900)}.\[\&\:hover_a\]\:univer-inline-block:hover a{display:inline-block}
1
+ .univer-mx-1{margin-left:4px;margin-right:4px}.univer-mb-1{margin-bottom:4px}.univer-ml-1{margin-left:4px}.univer-mt-2{margin-top:8px}.univer-mt-4{margin-top:16px}.univer-box-border{box-sizing:border-box}.univer-inline-block{display:inline-block}.univer-flex{display:flex}.univer-inline-flex{display:inline-flex}.univer-hidden{display:none}.univer-h-4{height:16px}.univer-h-5{height:20px}.univer-h-7{height:28px}.univer-h-8{height:32px}.univer-h-\[442px\]{height:442px}.univer-h-full{height:100%}.univer-w-\[312px\]{width:312px}.univer-w-full{width:100%}.univer-max-w-\[245px\]{max-width:245px}.univer-flex-1{flex:1 1 0%}.univer-flex-shrink{flex-shrink:1}.univer-flex-shrink-0{flex-shrink:0}.univer-flex-grow{flex-grow:1}.univer-flex-grow-0{flex-grow:0}.univer-cursor-pointer{cursor:pointer}.univer-flex-col{flex-direction:column}.univer-flex-nowrap{flex-wrap:nowrap}.univer-items-center{align-items:center}.univer-justify-between{justify-content:space-between}.univer-gap-2{gap:8px}.univer-overflow-hidden{overflow:hidden}.univer-text-ellipsis{text-overflow:ellipsis}.univer-whitespace-nowrap{white-space:nowrap}.univer-rounded-lg{border-radius:8px}.univer-rounded-md{border-radius:6px}.univer-bg-white{background-color:var(--univer-white)}.univer-p-2{padding:8px}.univer-p-4{padding:16px}.univer-px-1\.5{padding-left:6px;padding-right:6px}.univer-px-2{padding-left:8px;padding-right:8px}.univer-py-0\.5{padding-top:2px;padding-bottom:2px}.univer-py-2\.5{padding-top:10px;padding-bottom:10px}.univer-pb-0{padding-bottom:0}.univer-pl-5{padding-left:20px}.univer-pr-0\.5{padding-right:2px}.univer-pr-2{padding-right:8px}.univer-pt-0{padding-top:0}.univer-pt-2{padding-top:8px}.univer-text-sm{font-size:14px;line-height:20px}.univer-text-xs{font-size:12px;line-height:16px}.univer-text-gray-400{color:var(--univer-gray-400)}.univer-text-gray-500{color:var(--univer-gray-500)}.univer-text-gray-900{color:var(--univer-gray-900)}.univer-text-primary-500{color:var(--univer-primary-500)}.univer-shadow-lg{--tw-shadow: 0px 4px 6px 0px rgba(30, 40, 77, .05), 0px 10px 15px -3px rgba(30, 40, 77, .1);--tw-shadow-colored: 0px 4px 6px 0px var(--tw-shadow-color), 0px 10px 15px -3px var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 4px 6px #1e284d0d,0 10px 15px -3px #1e284d1a;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.hover\:univer-bg-gray-50:hover{background-color:var(--univer-gray-50)}.dark\:\!univer-border-gray-600:where(.univer-dark,.univer-dark *){border-color:var(--univer-gray-600)!important}.dark\:\!univer-bg-gray-700:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-700)!important}.dark\:\!univer-text-gray-500:where(.univer-dark,.univer-dark *){color:var(--univer-gray-500)!important}.dark\:\!univer-text-white:where(.univer-dark,.univer-dark *){color:var(--univer-white)!important}.dark\:hover\:\!univer-bg-gray-900:hover:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-900)!important}.\[\&\:hover_a\]\:univer-inline-block:hover a{display:inline-block}