@univerjs/sheets-filter-ui 0.6.10 → 0.7.0-beta.1

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
@@ -1,292 +1,292 @@
1
- var jt = Object.defineProperty;
2
- var Yt = (t, e, r) => e in t ? jt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var f = (t, e, r) => Yt(t, typeof e != "symbol" ? e + "" : e, r);
4
- import { BooleanNumber as st, createIdentifier as gt, Inject as E, LocaleService as X, IUniverInstanceService as je, ILogService as qt, extractPureTextFromCell as Kt, numfmt as it, Disposable as pe, Injector as Z, Quantity as vt, Tools as Fe, ICommandService as Q, CommandType as Me, IContextService as $e, UniverInstanceType as z, ThemeService as St, RxDisposable as Et, fromCallback as Xt, InterceptorEffectEnum as Zt, DependentOn as Tt, IConfigService as Ft, Optional as zt, Plugin as Ye, merge as Ct } from "@univerjs/core";
5
- import { IRPCChannelService as Nt, toModule as Jt, fromModule as er } from "@univerjs/rpc";
6
- import { CustomFilterOperator as u, SetSheetsFilterCriteriaCommand as se, SheetsFilterService as G, SmartToggleSheetsFilterCommand as fe, ReCalcSheetsFilterCommand as qe, ClearSheetsFilterCriteriaCommand as Ke, FILTER_MUTATIONS as tr, SetSheetsFilterRangeMutation as rr, SetSheetsFilterCriteriaMutation as sr, RemoveSheetsFilterMutation as ir, ReCalcSheetsFilterMutation as nr, RemoveSheetFilterCommand as or, SetSheetFilterRangeCommand as ar, UniverSheetsFilterPlugin as Pt } from "@univerjs/sheets-filter";
7
- import { RefRangeService as lr, SheetPermissionCheckController as cr, SheetsSelectionsService as ur, getSheetCommandTarget as hr, WorksheetFilterPermission as le, WorksheetViewPermission as ce, RangeProtectionPermissionViewPoint as ue, expandToContinuousRange as mr, SheetInterceptorService as dr, SetRangeValuesMutation as pr, INTERCEPTOR_POINT as fr } from "@univerjs/sheets";
8
- import { ILayoutService as _r, useDependency as re, useObservable as W, useComponentsOfPart as gr, ComponentContainer as vr, getMenuHiddenObservable as Xe, MenuItemType as Ze, RibbonStartGroup as Sr, KeyCode as Er, MetaKeys as nt, ComponentManager as Tr, IShortcutService as Fr, IMenuManagerService as Cr, IMessageService as Nr } from "@univerjs/ui";
9
- import { SetCellEditVisibleOperation as Pr, SheetsUIPart as Or, getObservableWithExclusiveRange$ as yr, getCurrentRangeDisable$ as Ir, SheetSkeletonManagerService as Rr, ISheetSelectionRenderService as Ar, SelectionControl as br, attachSelectionWithCoord as Lr, getCoordByCell as Mr, SheetsRenderService as Ot, whenSheetEditorFocused as $r, SheetCanvasPopManagerService as wr } from "@univerjs/sheets-ui";
10
- import { BehaviorSubject as K, ReplaySubject as Ur, Subject as Hr, merge as Dr, combineLatest as kr, throttleTime as yt, startWith as It, map as ie, shareReplay as Br, of as _e, switchMap as ze, filter as Vr, takeUntil as Wr, distinctUntilChanged as xr } from "rxjs";
11
- import { Select as ot, RadioGroup as Qr, Radio as at, Input as Rt, Checkbox as Gr, Tree as jr, Segmented as Yr, Button as He, MessageType as qr } from "@univerjs/design";
12
- import { Rect as lt, Shape as Kr, IRenderManagerService as At } from "@univerjs/engine-render";
13
- import { jsx as S, jsxs as L, Fragment as ct } from "react/jsx-runtime";
14
- import { forwardRef as bt, useRef as Xr, createElement as Lt, useCallback as k, useMemo as Je } from "react";
15
- const Mt = "sheets-filter-ui.config", Ce = {};
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))(_ || {}), m;
1
+ var Gt = Object.defineProperty;
2
+ var jt = (t, e, r) => e in t ? Gt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var f = (t, e, r) => jt(t, typeof e != "symbol" ? e + "" : e, r);
4
+ import { BooleanNumber as rt, createIdentifier as _t, Inject as E, LocaleService as K, IUniverInstanceService as Ge, ILogService as Yt, extractPureTextFromCell as qt, 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 Kt, InterceptorEffectEnum as Xt, DependentOn as Et, IConfigService as Tt, Optional as Zt, Plugin as je, merge as Nt } from "@univerjs/core";
5
+ import { IRPCChannelService as Ft, toModule as zt, fromModule as Jt } 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 er, SetSheetsFilterRangeMutation as tr, SetSheetsFilterCriteriaMutation as rr, RemoveSheetsFilterMutation as ir, ReCalcSheetsFilterMutation as sr, RemoveSheetFilterCommand as nr, SetSheetFilterRangeCommand as or, UniverSheetsFilterPlugin as Ct } from "@univerjs/sheets-filter";
7
+ import { RefRangeService as ar, SheetPermissionCheckController as lr, SheetsSelectionsService as cr, getSheetCommandTarget as ur, WorksheetFilterPermission as ae, WorksheetViewPermission as le, RangeProtectionPermissionViewPoint as ce, expandToContinuousRange as hr, SheetInterceptorService as dr, SetRangeValuesMutation as mr, INTERCEPTOR_POINT as pr } from "@univerjs/sheets";
8
+ import { ILayoutService as fr, useDependency as te, useObservable as B, useComponentsOfPart as _r, ComponentContainer as vr, getMenuHiddenObservable as Ke, MenuItemType as Xe, RibbonStartGroup as gr, KeyCode as Sr, MetaKeys as st, ComponentManager as Er, IShortcutService as Tr, IMenuManagerService as Nr, IMessageService as Fr } from "@univerjs/ui";
9
+ import { SetCellEditVisibleOperation as Cr, SheetsUIPart as yr, getObservableWithExclusiveRange$ as Or, getCurrentRangeDisable$ as Rr, SheetSkeletonManagerService as Ir, ISheetSelectionRenderService as Ar, SelectionControl as Pr, attachSelectionWithCoord as br, getCoordByCell as Lr, SheetsRenderService as yt, whenSheetEditorFocused as Mr, SheetCanvasPopManagerService as wr } from "@univerjs/sheets-ui";
10
+ import { BehaviorSubject as q, ReplaySubject as $r, Subject as Ur, merge as Hr, combineLatest as Dr, throttleTime as Ot, startWith as Rt, map as ie, shareReplay as kr, of as fe, switchMap as Ze, filter as xr, takeUntil as Br, distinctUntilChanged as Wr } from "rxjs";
11
+ import { Select as nt, RadioGroup as Qr, Radio as ot, Input as It, Checkbox as Vr, Tree as Gr, Segmented as jr, Button as Ue, MessageType as Yr } from "@univerjs/design";
12
+ import { Rect as at, Shape as qr, IRenderManagerService as At } from "@univerjs/engine-render";
13
+ import { jsx as S, jsxs as b, Fragment as lt } from "react/jsx-runtime";
14
+ import { forwardRef as Pt, useRef as Kr, createElement as bt, useCallback as D, useMemo as ze } from "react";
15
+ const Lt = "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;
17
17
  ((t) => {
18
18
  t.NONE = {
19
19
  label: "sheets-filter.conditions.none",
20
20
  operator: _.NONE,
21
- order: C.SECOND,
21
+ order: F.SECOND,
22
22
  numOfParameters: 0,
23
23
  getDefaultFormParams: () => {
24
24
  throw new Error("[FilterConditionItems.NONE]: should not have initial form params!");
25
25
  },
26
- testMappingParams: (s) => s.operator1 === _.NONE,
26
+ testMappingParams: (i) => i.operator1 === _.NONE,
27
27
  mapToFilterColumn: () => null,
28
- testMappingFilterColumn: (s) => !s.customFilters && !s.filters ? {} : !1
28
+ testMappingFilterColumn: (i) => !i.customFilters && !i.filters ? {} : !1
29
29
  }, t.EMPTY = {
30
30
  label: "sheets-filter.conditions.empty",
31
31
  operator: _.EMPTY,
32
- order: C.SECOND,
32
+ order: F.SECOND,
33
33
  numOfParameters: 0,
34
34
  getDefaultFormParams: () => {
35
35
  throw new Error("[FilterConditionItems.EMPTY]: should not have initial form params!");
36
36
  },
37
- testMappingParams: ({ operator1: s }) => s === _.EMPTY,
37
+ testMappingParams: ({ operator1: i }) => i === _.EMPTY,
38
38
  mapToFilterColumn: () => ({ customFilters: { customFilters: [{ val: "" }] } }),
39
- testMappingFilterColumn: (s) => {
39
+ testMappingFilterColumn: (i) => {
40
40
  var c;
41
- if (((c = s.customFilters) == null ? void 0 : c.customFilters.length) !== 1)
41
+ if (((c = i.customFilters) == null ? void 0 : c.customFilters.length) !== 1)
42
42
  return !1;
43
- const o = s.customFilters.customFilters[0];
43
+ const o = i.customFilters.customFilters[0];
44
44
  return o.val === "" && o.operator === void 0 ? { operator1: _.EMPTY } : !1;
45
45
  }
46
46
  }, t.NOT_EMPTY = {
47
47
  label: "sheets-filter.conditions.not-empty",
48
48
  operator: _.NOT_EMPTY,
49
- order: C.SECOND,
49
+ order: F.SECOND,
50
50
  numOfParameters: 0,
51
51
  getDefaultFormParams: () => {
52
52
  throw new Error("[FilterConditionItems.NOT_EMPTY]: should not have initial form params!");
53
53
  },
54
- testMappingParams: ({ operator1: s }) => s === _.NOT_EMPTY,
54
+ testMappingParams: ({ operator1: i }) => i === _.NOT_EMPTY,
55
55
  mapToFilterColumn: () => ({ customFilters: { customFilters: [{ val: "", operator: u.NOT_EQUALS }] } }),
56
- testMappingFilterColumn: (s) => {
56
+ testMappingFilterColumn: (i) => {
57
57
  var c;
58
- if (((c = s.customFilters) == null ? void 0 : c.customFilters.length) !== 1)
58
+ if (((c = i.customFilters) == null ? void 0 : c.customFilters.length) !== 1)
59
59
  return !1;
60
- const o = s.customFilters.customFilters[0];
60
+ const o = i.customFilters.customFilters[0];
61
61
  return o.val === " " && o.operator === u.NOT_EQUALS ? { operator1: _.NOT_EMPTY } : !1;
62
62
  }
63
63
  }, t.TEXT_CONTAINS = {
64
64
  label: "sheets-filter.conditions.text-contains",
65
65
  operator: _.CONTAINS,
66
- order: C.FIRST,
66
+ order: F.FIRST,
67
67
  numOfParameters: 1,
68
68
  getDefaultFormParams: () => ({ operator1: _.CONTAINS, val1: "" }),
69
- testMappingParams: (s) => {
70
- const [o] = M(s);
69
+ testMappingParams: (i) => {
70
+ const [o] = L(i);
71
71
  return o === _.CONTAINS;
72
72
  },
73
- mapToFilterColumn: (s) => {
74
- const { val1: o } = s;
73
+ mapToFilterColumn: (i) => {
74
+ const { val1: o } = i;
75
75
  return o === "" ? null : {
76
76
  customFilters: { customFilters: [{ val: `*${o}*` }] }
77
77
  };
78
78
  },
79
- testMappingFilterColumn: (s) => {
79
+ testMappingFilterColumn: (i) => {
80
80
  var c;
81
- if (((c = s.customFilters) == null ? void 0 : c.customFilters.length) !== 1)
81
+ if (((c = i.customFilters) == null ? void 0 : c.customFilters.length) !== 1)
82
82
  return !1;
83
- const o = s.customFilters.customFilters[0], a = o.val.toString();
83
+ const o = i.customFilters.customFilters[0], a = o.val.toString();
84
84
  return !o.operator && a.startsWith("*") && a.endsWith("*") ? { operator1: _.CONTAINS, val1: a.slice(1, -1) } : !1;
85
85
  }
86
86
  }, t.DOES_NOT_CONTAIN = {
87
87
  label: "sheets-filter.conditions.does-not-contain",
88
88
  operator: _.DOES_NOT_CONTAIN,
89
- order: C.FIRST,
89
+ order: F.FIRST,
90
90
  numOfParameters: 1,
91
91
  getDefaultFormParams: () => ({ operator1: _.DOES_NOT_CONTAIN, val1: "" }),
92
- mapToFilterColumn: (s) => ({
93
- customFilters: { customFilters: [{ val: `*${s.val1}*`, operator: u.NOT_EQUALS }] }
92
+ mapToFilterColumn: (i) => ({
93
+ customFilters: { customFilters: [{ val: `*${i.val1}*`, operator: u.NOT_EQUALS }] }
94
94
  }),
95
- testMappingParams: (s) => {
96
- const [o] = M(s);
95
+ testMappingParams: (i) => {
96
+ const [o] = L(i);
97
97
  return o === _.DOES_NOT_CONTAIN;
98
98
  },
99
- testMappingFilterColumn: (s) => {
99
+ testMappingFilterColumn: (i) => {
100
100
  var c;
101
- if (((c = s.customFilters) == null ? void 0 : c.customFilters.length) !== 1)
101
+ if (((c = i.customFilters) == null ? void 0 : c.customFilters.length) !== 1)
102
102
  return !1;
103
- const o = s.customFilters.customFilters[0], a = o.val.toString();
103
+ const o = i.customFilters.customFilters[0], a = o.val.toString();
104
104
  return o.operator === u.NOT_EQUALS && a.startsWith("*") && a.endsWith("*") ? { operator1: _.DOES_NOT_CONTAIN, val1: a.slice(1, -1) } : !1;
105
105
  }
106
106
  }, t.STARTS_WITH = {
107
107
  label: "sheets-filter.conditions.starts-with",
108
108
  operator: _.STARTS_WITH,
109
- order: C.FIRST,
109
+ order: F.FIRST,
110
110
  numOfParameters: 1,
111
111
  getDefaultFormParams: () => ({ operator1: _.STARTS_WITH, val1: "" }),
112
- mapToFilterColumn: (s) => ({
113
- customFilters: { customFilters: [{ val: `${s.val1}*` }] }
112
+ mapToFilterColumn: (i) => ({
113
+ customFilters: { customFilters: [{ val: `${i.val1}*` }] }
114
114
  }),
115
- testMappingParams: (s) => {
116
- const [o] = M(s);
115
+ testMappingParams: (i) => {
116
+ const [o] = L(i);
117
117
  return o === _.STARTS_WITH;
118
118
  },
119
- testMappingFilterColumn: (s) => {
119
+ testMappingFilterColumn: (i) => {
120
120
  var c;
121
- if (((c = s.customFilters) == null ? void 0 : c.customFilters.length) !== 1)
121
+ if (((c = i.customFilters) == null ? void 0 : c.customFilters.length) !== 1)
122
122
  return !1;
123
- const o = s.customFilters.customFilters[0], a = o.val.toString();
123
+ const o = i.customFilters.customFilters[0], a = o.val.toString();
124
124
  return !o.operator && a.endsWith("*") && !a.startsWith("*") ? { operator1: _.STARTS_WITH, val1: a.slice(0, -1) } : !1;
125
125
  }
126
126
  }, t.ENDS_WITH = {
127
127
  label: "sheets-filter.conditions.ends-with",
128
128
  operator: _.ENDS_WITH,
129
- order: C.FIRST,
129
+ order: F.FIRST,
130
130
  numOfParameters: 1,
131
131
  getDefaultFormParams: () => ({ operator1: _.ENDS_WITH, val1: "" }),
132
- mapToFilterColumn: (s) => ({
133
- customFilters: { customFilters: [{ val: `*${s.val1}` }] }
132
+ mapToFilterColumn: (i) => ({
133
+ customFilters: { customFilters: [{ val: `*${i.val1}` }] }
134
134
  }),
135
- testMappingParams: (s) => {
136
- const [o] = M(s);
135
+ testMappingParams: (i) => {
136
+ const [o] = L(i);
137
137
  return o === _.ENDS_WITH;
138
138
  },
139
- testMappingFilterColumn: (s) => {
139
+ testMappingFilterColumn: (i) => {
140
140
  var c;
141
- if (((c = s.customFilters) == null ? void 0 : c.customFilters.length) !== 1)
141
+ if (((c = i.customFilters) == null ? void 0 : c.customFilters.length) !== 1)
142
142
  return !1;
143
- const o = s.customFilters.customFilters[0], a = o.val.toString();
143
+ const o = i.customFilters.customFilters[0], a = o.val.toString();
144
144
  return !o.operator && a.startsWith("*") && !a.endsWith("*") ? { operator1: _.ENDS_WITH, val1: a.slice(1) } : !1;
145
145
  }
146
146
  }, t.EQUALS = {
147
147
  label: "sheets-filter.conditions.equals",
148
148
  operator: _.EQUALS,
149
- order: C.FIRST,
149
+ order: F.FIRST,
150
150
  numOfParameters: 1,
151
151
  getDefaultFormParams: () => ({ operator1: _.EQUALS, val1: "" }),
152
- testMappingParams: (s) => {
153
- const [o] = M(s);
152
+ testMappingParams: (i) => {
153
+ const [o] = L(i);
154
154
  return o === _.EQUALS;
155
155
  },
156
- mapToFilterColumn: (s) => {
157
- const { val1: o } = s;
156
+ mapToFilterColumn: (i) => {
157
+ const { val1: o } = i;
158
158
  return o === "" ? null : {
159
159
  customFilters: { customFilters: [{ val: o }] }
160
160
  };
161
161
  },
162
- testMappingFilterColumn: (s) => {
162
+ testMappingFilterColumn: (i) => {
163
163
  var o, a, c;
164
- return ((a = (o = s.filters) == null ? void 0 : o.filters) == null ? void 0 : a.length) === 1 ? { operator1: _.EQUALS, val1: "" } : ((c = s.customFilters) == null ? void 0 : c.customFilters.length) === 1 && !s.customFilters.customFilters[0].operator ? { operator1: _.EQUALS, val1: s.customFilters.customFilters[0].val.toString() } : !1;
164
+ return ((a = (o = i.filters) == null ? void 0 : o.filters) == null ? void 0 : a.length) === 1 ? { operator1: _.EQUALS, val1: "" } : ((c = i.customFilters) == null ? void 0 : c.customFilters.length) === 1 && !i.customFilters.customFilters[0].operator ? { operator1: _.EQUALS, val1: i.customFilters.customFilters[0].val.toString() } : !1;
165
165
  }
166
166
  }, t.GREATER_THAN = {
167
167
  label: "sheets-filter.conditions.greater-than",
168
168
  operator: u.GREATER_THAN,
169
169
  numOfParameters: 1,
170
- order: C.FIRST,
170
+ order: F.FIRST,
171
171
  getDefaultFormParams: () => ({ operator1: u.GREATER_THAN, val1: "" }),
172
- mapToFilterColumn: (s) => ({
173
- customFilters: { customFilters: [{ val: s.val1, operator: u.GREATER_THAN }] }
172
+ mapToFilterColumn: (i) => ({
173
+ customFilters: { customFilters: [{ val: i.val1, operator: u.GREATER_THAN }] }
174
174
  }),
175
- testMappingParams: (s) => {
176
- const [o] = M(s);
175
+ testMappingParams: (i) => {
176
+ const [o] = L(i);
177
177
  return o === u.GREATER_THAN;
178
178
  },
179
- testMappingFilterColumn: (s) => {
179
+ testMappingFilterColumn: (i) => {
180
180
  var a;
181
- if (((a = s.customFilters) == null ? void 0 : a.customFilters.length) !== 1)
181
+ if (((a = i.customFilters) == null ? void 0 : a.customFilters.length) !== 1)
182
182
  return !1;
183
- const o = s.customFilters.customFilters[0];
183
+ const o = i.customFilters.customFilters[0];
184
184
  return o.operator !== u.GREATER_THAN ? !1 : { operator1: u.GREATER_THAN, val1: o.val.toString() };
185
185
  }
186
186
  }, t.GREATER_THAN_OR_EQUAL = {
187
187
  label: "sheets-filter.conditions.greater-than-or-equal",
188
188
  operator: u.GREATER_THAN_OR_EQUAL,
189
189
  numOfParameters: 1,
190
- order: C.FIRST,
190
+ order: F.FIRST,
191
191
  getDefaultFormParams: () => ({ operator1: u.GREATER_THAN_OR_EQUAL, val1: "" }),
192
- testMappingParams: (s) => {
193
- const [o] = M(s);
192
+ testMappingParams: (i) => {
193
+ const [o] = L(i);
194
194
  return o === u.GREATER_THAN_OR_EQUAL;
195
195
  },
196
- mapToFilterColumn: (s) => ({
197
- customFilters: { customFilters: [{ val: s.val1, operator: u.GREATER_THAN_OR_EQUAL }] }
196
+ mapToFilterColumn: (i) => ({
197
+ customFilters: { customFilters: [{ val: i.val1, operator: u.GREATER_THAN_OR_EQUAL }] }
198
198
  }),
199
- testMappingFilterColumn: (s) => {
199
+ testMappingFilterColumn: (i) => {
200
200
  var a;
201
- if (((a = s.customFilters) == null ? void 0 : a.customFilters.length) !== 1)
201
+ if (((a = i.customFilters) == null ? void 0 : a.customFilters.length) !== 1)
202
202
  return !1;
203
- const o = s.customFilters.customFilters[0];
203
+ const o = i.customFilters.customFilters[0];
204
204
  return o.operator !== u.GREATER_THAN_OR_EQUAL ? !1 : { operator1: u.GREATER_THAN_OR_EQUAL, val1: o.val.toString() };
205
205
  }
206
206
  }, t.LESS_THAN = {
207
207
  label: "sheets-filter.conditions.less-than",
208
208
  operator: u.LESS_THAN,
209
209
  numOfParameters: 1,
210
- order: C.FIRST,
210
+ order: F.FIRST,
211
211
  getDefaultFormParams: () => ({ operator1: u.LESS_THAN, val1: "" }),
212
- testMappingParams: (s) => {
213
- const [o] = M(s);
212
+ testMappingParams: (i) => {
213
+ const [o] = L(i);
214
214
  return o === u.LESS_THAN;
215
215
  },
216
- mapToFilterColumn: (s) => ({
217
- customFilters: { customFilters: [{ val: s.val1, operator: u.LESS_THAN }] }
216
+ mapToFilterColumn: (i) => ({
217
+ customFilters: { customFilters: [{ val: i.val1, operator: u.LESS_THAN }] }
218
218
  }),
219
- testMappingFilterColumn: (s) => {
219
+ testMappingFilterColumn: (i) => {
220
220
  var a;
221
- if (((a = s.customFilters) == null ? void 0 : a.customFilters.length) !== 1)
221
+ if (((a = i.customFilters) == null ? void 0 : a.customFilters.length) !== 1)
222
222
  return !1;
223
- const o = s.customFilters.customFilters[0];
223
+ const o = i.customFilters.customFilters[0];
224
224
  return o.operator !== u.LESS_THAN ? !1 : { operator1: u.LESS_THAN, val1: o.val.toString() };
225
225
  }
226
226
  }, t.LESS_THAN_OR_EQUAL = {
227
227
  label: "sheets-filter.conditions.less-than-or-equal",
228
228
  operator: u.LESS_THAN_OR_EQUAL,
229
229
  numOfParameters: 1,
230
- order: C.FIRST,
230
+ order: F.FIRST,
231
231
  getDefaultFormParams: () => ({ operator1: u.LESS_THAN_OR_EQUAL, val1: "" }),
232
- testMappingParams: (s) => {
233
- const [o] = M(s);
232
+ testMappingParams: (i) => {
233
+ const [o] = L(i);
234
234
  return o === u.LESS_THAN_OR_EQUAL;
235
235
  },
236
- mapToFilterColumn: (s) => ({
237
- customFilters: { customFilters: [{ val: s.val1, operator: u.LESS_THAN_OR_EQUAL }] }
236
+ mapToFilterColumn: (i) => ({
237
+ customFilters: { customFilters: [{ val: i.val1, operator: u.LESS_THAN_OR_EQUAL }] }
238
238
  }),
239
- testMappingFilterColumn: (s) => {
239
+ testMappingFilterColumn: (i) => {
240
240
  var a;
241
- if (((a = s.customFilters) == null ? void 0 : a.customFilters.length) !== 1)
241
+ if (((a = i.customFilters) == null ? void 0 : a.customFilters.length) !== 1)
242
242
  return !1;
243
- const o = s.customFilters.customFilters[0];
243
+ const o = i.customFilters.customFilters[0];
244
244
  return o.operator !== u.LESS_THAN_OR_EQUAL ? !1 : { operator1: u.LESS_THAN_OR_EQUAL, val1: o.val.toString() };
245
245
  }
246
246
  }, t.EQUAL = {
247
247
  label: "sheets-filter.conditions.equal",
248
248
  operator: u.EQUAL,
249
249
  numOfParameters: 1,
250
- order: C.FIRST,
250
+ order: F.FIRST,
251
251
  getDefaultFormParams: () => ({ operator1: u.EQUAL, val1: "" }),
252
- testMappingParams: (s) => {
253
- const [o] = M(s);
252
+ testMappingParams: (i) => {
253
+ const [o] = L(i);
254
254
  return o === u.EQUAL;
255
255
  },
256
- mapToFilterColumn: (s) => ({
257
- customFilters: { customFilters: [{ val: s.val1, operator: u.EQUAL }] }
256
+ mapToFilterColumn: (i) => ({
257
+ customFilters: { customFilters: [{ val: i.val1, operator: u.EQUAL }] }
258
258
  }),
259
- testMappingFilterColumn: (s) => {
259
+ testMappingFilterColumn: (i) => {
260
260
  var a;
261
- if (((a = s.customFilters) == null ? void 0 : a.customFilters.length) !== 1)
261
+ if (((a = i.customFilters) == null ? void 0 : a.customFilters.length) !== 1)
262
262
  return !1;
263
- const o = s.customFilters.customFilters[0];
263
+ const o = i.customFilters.customFilters[0];
264
264
  return o.operator !== u.EQUAL ? !1 : { operator1: u.EQUAL, val1: o.val.toString() };
265
265
  }
266
266
  }, t.NOT_EQUAL = {
267
267
  label: "sheets-filter.conditions.not-equal",
268
268
  operator: u.NOT_EQUALS,
269
269
  numOfParameters: 1,
270
- order: C.FIRST,
270
+ order: F.FIRST,
271
271
  getDefaultFormParams: () => ({ operator1: u.NOT_EQUALS, val1: "" }),
272
- testMappingParams: (s) => {
273
- const [o] = M(s);
272
+ testMappingParams: (i) => {
273
+ const [o] = L(i);
274
274
  return o === u.NOT_EQUALS;
275
275
  },
276
- mapToFilterColumn: (s) => ({
277
- customFilters: { customFilters: [{ val: s.val1, operator: u.NOT_EQUALS }] }
276
+ mapToFilterColumn: (i) => ({
277
+ customFilters: { customFilters: [{ val: i.val1, operator: u.NOT_EQUALS }] }
278
278
  }),
279
- testMappingFilterColumn: (s) => {
279
+ testMappingFilterColumn: (i) => {
280
280
  var a;
281
- if (((a = s.customFilters) == null ? void 0 : a.customFilters.length) !== 1)
281
+ if (((a = i.customFilters) == null ? void 0 : a.customFilters.length) !== 1)
282
282
  return !1;
283
- const o = s.customFilters.customFilters[0];
283
+ const o = i.customFilters.customFilters[0];
284
284
  return o.operator !== u.NOT_EQUALS ? !1 : { operator1: u.NOT_EQUALS, val1: o.val.toString() };
285
285
  }
286
286
  }, t.BETWEEN = {
287
287
  label: "sheets-filter.conditions.between",
288
288
  operator: _.BETWEEN,
289
- order: C.SECOND,
289
+ order: F.SECOND,
290
290
  numOfParameters: 2,
291
291
  getDefaultFormParams: () => ({
292
292
  and: !0,
@@ -295,17 +295,17 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
295
295
  operator2: u.LESS_THAN_OR_EQUAL,
296
296
  val2: ""
297
297
  }),
298
- testMappingParams: (s) => {
299
- const { and: o, operator1: a, operator2: c } = s;
298
+ testMappingParams: (i) => {
299
+ const { and: o, operator1: a, operator2: c } = i;
300
300
  if (!o) return !1;
301
301
  const h = [a, c];
302
302
  return h.includes(u.GREATER_THAN_OR_EQUAL) && h.includes(u.LESS_THAN_OR_EQUAL);
303
303
  },
304
- mapToFilterColumn: (s) => {
305
- const { val1: o, val2: a, operator1: c } = s, h = c === u.GREATER_THAN_OR_EQUAL;
304
+ mapToFilterColumn: (i) => {
305
+ const { val1: o, val2: a, operator1: c } = i, h = c === u.GREATER_THAN_OR_EQUAL;
306
306
  return {
307
307
  customFilters: {
308
- and: st.TRUE,
308
+ and: rt.TRUE,
309
309
  customFilters: [
310
310
  { val: h ? o : a, operator: u.GREATER_THAN_OR_EQUAL },
311
311
  { val: h ? a : o, operator: u.LESS_THAN_OR_EQUAL }
@@ -313,18 +313,18 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
313
313
  }
314
314
  };
315
315
  },
316
- testMappingFilterColumn: (s) => {
316
+ testMappingFilterColumn: (i) => {
317
317
  var c;
318
- if (((c = s.customFilters) == null ? void 0 : c.customFilters.length) !== 2)
318
+ if (((c = i.customFilters) == null ? void 0 : c.customFilters.length) !== 2)
319
319
  return !1;
320
- const [o, a] = s.customFilters.customFilters;
321
- return o.operator === u.GREATER_THAN_OR_EQUAL && a.operator === u.LESS_THAN_OR_EQUAL && s.customFilters.and ? {
320
+ const [o, a] = i.customFilters.customFilters;
321
+ return o.operator === u.GREATER_THAN_OR_EQUAL && a.operator === u.LESS_THAN_OR_EQUAL && i.customFilters.and ? {
322
322
  and: !0,
323
323
  operator1: u.GREATER_THAN_OR_EQUAL,
324
324
  val1: o.val.toString(),
325
325
  operator2: u.LESS_THAN_OR_EQUAL,
326
326
  val2: a.val.toString()
327
- } : a.operator === u.GREATER_THAN_OR_EQUAL && o.operator === u.LESS_THAN_OR_EQUAL && s.customFilters.and ? {
327
+ } : a.operator === u.GREATER_THAN_OR_EQUAL && o.operator === u.LESS_THAN_OR_EQUAL && i.customFilters.and ? {
328
328
  and: !0,
329
329
  operator1: u.GREATER_THAN_OR_EQUAL,
330
330
  val1: a.val.toString(),
@@ -335,7 +335,7 @@ var C = /* @__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: C.SECOND,
338
+ order: F.SECOND,
339
339
  numOfParameters: 2,
340
340
  getDefaultFormParams: () => ({
341
341
  operator1: u.LESS_THAN,
@@ -343,14 +343,14 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
343
343
  operator2: u.GREATER_THAN,
344
344
  val2: ""
345
345
  }),
346
- testMappingParams: (s) => {
347
- const { and: o, operator1: a, operator2: c } = s;
346
+ testMappingParams: (i) => {
347
+ const { and: o, operator1: a, operator2: c } = i;
348
348
  if (o) return !1;
349
349
  const h = [a, c];
350
350
  return h.includes(u.GREATER_THAN) && h.includes(u.LESS_THAN);
351
351
  },
352
- mapToFilterColumn: (s) => {
353
- const { val1: o, val2: a, operator1: c } = s, h = c === u.GREATER_THAN;
352
+ mapToFilterColumn: (i) => {
353
+ const { val1: o, val2: a, operator1: c } = i, h = c === u.GREATER_THAN;
354
354
  return {
355
355
  customFilters: {
356
356
  customFilters: [
@@ -360,17 +360,17 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
360
360
  }
361
361
  };
362
362
  },
363
- testMappingFilterColumn: (s) => {
363
+ testMappingFilterColumn: (i) => {
364
364
  var c;
365
- if (((c = s.customFilters) == null ? void 0 : c.customFilters.length) !== 2)
365
+ if (((c = i.customFilters) == null ? void 0 : c.customFilters.length) !== 2)
366
366
  return !1;
367
- const [o, a] = s.customFilters.customFilters;
368
- return o.operator === u.LESS_THAN && a.operator === u.GREATER_THAN && !s.customFilters.and ? {
367
+ const [o, a] = i.customFilters.customFilters;
368
+ return o.operator === u.LESS_THAN && a.operator === u.GREATER_THAN && !i.customFilters.and ? {
369
369
  operator1: u.LESS_THAN,
370
370
  val1: o.val.toString(),
371
371
  operator2: u.GREATER_THAN,
372
372
  val2: a.val.toString()
373
- } : a.operator === u.LESS_THAN && o.operator === u.GREATER_THAN && !s.customFilters.and ? {
373
+ } : a.operator === u.LESS_THAN && o.operator === u.GREATER_THAN && !i.customFilters.and ? {
374
374
  operator1: u.GREATER_THAN,
375
375
  val1: a.val.toString(),
376
376
  operator2: u.LESS_THAN,
@@ -380,7 +380,7 @@ var C = /* @__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: C.SECOND,
383
+ order: F.SECOND,
384
384
  numOfParameters: 2,
385
385
  getDefaultFormParams: () => ({
386
386
  operator1: _.NONE,
@@ -389,39 +389,39 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
389
389
  val2: ""
390
390
  }),
391
391
  testMappingParams: () => !0,
392
- mapToFilterColumn: (s) => {
393
- const { and: o, val1: a, val2: c, operator1: h, operator2: d } = s;
394
- function v(I, O) {
395
- for (const $ of t.ALL_CONDITIONS)
396
- if ($.operator === I)
397
- return $.mapToFilterColumn({ val1: O, operator1: I });
392
+ mapToFilterColumn: (i) => {
393
+ const { and: o, val1: a, val2: c, operator1: h, operator2: m } = i;
394
+ function g(R, O) {
395
+ for (const M of t.ALL_CONDITIONS)
396
+ if (M.operator === R)
397
+ return M.mapToFilterColumn({ val1: O, operator1: R });
398
398
  }
399
- const p = !h || h === t.NONE.operator, T = !d || d === t.NONE.operator;
399
+ const p = !h || h === t.NONE.operator, T = !m || m === t.NONE.operator;
400
400
  if (p && T)
401
401
  return t.NONE.mapToFilterColumn({});
402
402
  if (p)
403
- return v(d, c);
403
+ return g(m, c);
404
404
  if (T)
405
- return v(h, a);
406
- const g = v(h, a), N = v(d, c), F = {
405
+ return g(h, a);
406
+ const v = g(h, a), C = g(m, c), N = {
407
407
  customFilters: [
408
- g.customFilters.customFilters[0],
409
- N.customFilters.customFilters[0]
408
+ v.customFilters.customFilters[0],
409
+ C.customFilters.customFilters[0]
410
410
  ]
411
411
  };
412
- return o && (F.and = st.TRUE), { customFilters: F };
412
+ return o && (N.and = rt.TRUE), { customFilters: N };
413
413
  },
414
- testMappingFilterColumn: (s) => {
414
+ testMappingFilterColumn: (i) => {
415
415
  var c;
416
- if (((c = s.customFilters) == null ? void 0 : c.customFilters.length) !== 2)
416
+ if (((c = i.customFilters) == null ? void 0 : c.customFilters.length) !== 2)
417
417
  return !1;
418
- const o = s.customFilters.customFilters.map((h) => l({ customFilters: { customFilters: [h] } })), a = {
418
+ const o = i.customFilters.customFilters.map((h) => l({ customFilters: { customFilters: [h] } })), a = {
419
419
  operator1: o[0][0].operator,
420
420
  val1: o[0][1].val1,
421
421
  operator2: o[1][0].operator,
422
422
  val2: o[1][1].val1
423
423
  };
424
- return s.customFilters.and && (a.and = !0), a;
424
+ return i.customFilters.and && (a.and = !0), a;
425
425
  }
426
426
  }, t.ALL_CONDITIONS = [
427
427
  // ------------------------------
@@ -447,193 +447,193 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
447
447
  // ------------------------------
448
448
  t.CUSTOM
449
449
  ];
450
- function e(s) {
451
- const o = t.ALL_CONDITIONS.find((a) => a.operator === s);
450
+ function e(i) {
451
+ const o = t.ALL_CONDITIONS.find((a) => a.operator === i);
452
452
  if (!o)
453
- throw new Error(`[SheetsFilter]: no condition item found for operator: ${s}`);
453
+ throw new Error(`[SheetsFilter]: no condition item found for operator: ${i}`);
454
454
  return o;
455
455
  }
456
456
  t.getItemByOperator = e;
457
- function r(s, o) {
457
+ function r(i, o) {
458
458
  for (const a of t.ALL_CONDITIONS.filter((c) => c.numOfParameters === o))
459
- if (a.numOfParameters !== 0 && a.testMappingParams(s))
459
+ if (a.numOfParameters !== 0 && a.testMappingParams(i))
460
460
  return a;
461
461
  for (const a of t.ALL_CONDITIONS)
462
- if (a.testMappingParams(s))
462
+ if (a.testMappingParams(i))
463
463
  return a;
464
464
  throw new Error("[SheetsFilter]: no condition item can be mapped from the filter map params!");
465
465
  }
466
466
  t.testMappingParams = r;
467
- function i(s) {
468
- const o = t.ALL_CONDITIONS.find((a) => a.operator === s);
467
+ function s(i) {
468
+ const o = t.ALL_CONDITIONS.find((a) => a.operator === i);
469
469
  return (o == null ? void 0 : o.numOfParameters) === 0 ? { operator1: o.operator } : o.getDefaultFormParams();
470
470
  }
471
- t.getInitialFormParams = i;
472
- function n(s, o) {
473
- return s.mapToFilterColumn(o);
471
+ t.getInitialFormParams = s;
472
+ function n(i, o) {
473
+ return i.mapToFilterColumn(o);
474
474
  }
475
475
  t.mapToFilterColumn = n;
476
- function l(s) {
477
- if (!s)
476
+ function l(i) {
477
+ if (!i)
478
478
  return [t.NONE, {}];
479
479
  for (const o of t.ALL_CONDITIONS) {
480
- const a = o.testMappingFilterColumn(s);
480
+ const a = o.testMappingFilterColumn(i);
481
481
  if (a)
482
482
  return [o, a];
483
483
  }
484
484
  return [t.NONE, {}];
485
485
  }
486
486
  t.testMappingFilterColumn = l;
487
- })(m || (m = {}));
488
- function M(t) {
489
- const { operator1: e, operator2: r, val1: i, val2: n } = t;
487
+ })(d || (d = {}));
488
+ function L(t) {
489
+ const { operator1: e, operator2: r, val1: s, val2: n } = t;
490
490
  if (e && r)
491
491
  throw new Error("Both operator1 and operator2 are set!");
492
492
  if (!e && !r)
493
493
  throw new Error("Neither operator1 and operator2 and both not set!");
494
- return e ? [e, i] : [r, n];
494
+ return e ? [e, s] : [r, n];
495
495
  }
496
- function Ve(t) {
496
+ function xe(t) {
497
497
  const e = [], r = [];
498
- let i = 0, n = 0;
499
- function l(s) {
500
- s.leaf && (s.checked ? (e.push(s), i += s.count) : (r.push(s), n += s.count)), s.children && s.children.forEach(l);
498
+ let s = 0, n = 0;
499
+ function l(i) {
500
+ i.leaf && (i.checked ? (e.push(i), s += i.count) : (r.push(i), n += i.count)), i.children && i.children.forEach(l);
501
501
  }
502
502
  return t.forEach(l), {
503
503
  checkedItems: e,
504
504
  uncheckedItems: r,
505
- checked: i,
505
+ checked: s,
506
506
  unchecked: n
507
507
  };
508
508
  }
509
- var Zr = Object.getOwnPropertyDescriptor, zr = (t, e, r, i) => {
510
- for (var n = i > 1 ? void 0 : i ? Zr(e, r) : e, l = t.length - 1, s; l >= 0; l--)
511
- (s = t[l]) && (n = s(n) || n);
509
+ var Xr = Object.getOwnPropertyDescriptor, Zr = (t, e, r, s) => {
510
+ for (var n = s > 1 ? void 0 : s ? Xr(e, r) : e, l = t.length - 1, i; l >= 0; l--)
511
+ (i = t[l]) && (n = i(n) || n);
512
512
  return n;
513
- }, De = (t, e) => (r, i) => e(r, i, t);
514
- const et = "sheets-filter.generate-filter-values.service", Ne = gt(et), Jr = ["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
- let We = class extends pe {
513
+ }, He = (t, e) => (r, s) => e(r, s, t);
514
+ const Je = "sheets-filter.generate-filter-values.service", Fe = _t(Je), zr = ["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
+ let Be = class extends me {
516
516
  constructor(t, e, r) {
517
517
  super(), this._localeService = t, this._univerInstanceService = e, this._logService = r;
518
518
  }
519
519
  async getFilterValues(t) {
520
520
  var h;
521
- const { unitId: e, subUnitId: r, filteredOutRowsByOtherColumns: i, filters: n, blankChecked: l, iterateRange: s, 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 }), $t(n, this._localeService, s, c, new Set(i), new Set(o.map(String)), l, a.getStyles()));
521
+ 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 }), Mt(n, this._localeService, i, c, new Set(s), new Set(o.map(String)), l, a.getStyles()));
523
523
  }
524
524
  };
525
- We = zr([
526
- De(0, E(X)),
527
- De(1, je),
528
- De(2, qt)
529
- ], We);
530
- function $t(t, e, r, i, n, l, s, o) {
531
- var g, N, F, I, O, $, w, ge, ve;
532
- const a = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), h = "yyyy-mm-dd", d = new Set(Jr), v = "empty";
525
+ Be = Zr([
526
+ He(0, E(K)),
527
+ He(1, Ge),
528
+ He(2, Yt)
529
+ ], Be);
530
+ function Mt(t, e, r, s, n, l, i, o) {
531
+ var v, C, N, R, O, M, w, _e, ve;
532
+ const a = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), h = "yyyy-mm-dd", m = new Set(zr), g = "empty";
533
533
  let p = 0;
534
- for (const R of i.iterateByColumn(r, !1, !1)) {
535
- const { row: xt, rowSpan: rt = 1 } = R;
536
- let J = 0;
537
- for (; J < rt; ) {
538
- const Qt = xt + J;
534
+ for (const I of s.iterateByColumn(r, !1, !1)) {
535
+ const { row: Wt, rowSpan: tt = 1 } = I;
536
+ let z = 0;
537
+ for (; z < tt; ) {
538
+ const Qt = Wt + z;
539
539
  if (n.has(Qt)) {
540
- J++;
540
+ z++;
541
541
  continue;
542
542
  }
543
- const j = R != null && R.value ? Kt(R.value) : "";
544
- if (!j) {
545
- p += 1, J += rt;
543
+ const G = I != null && I.value ? qt(I.value) : "";
544
+ if (!G) {
545
+ p += 1, z += tt;
546
546
  continue;
547
547
  }
548
- const Se = (g = R.value) != null && g.v && !R.value.p ? (I = (F = o.get((N = R.value) == null ? void 0 : N.s)) == null ? void 0 : F.n) == null ? void 0 : I.pattern : "", Gt = Se && it.isDate(Se);
549
- if (Se && Gt && d.has(Se)) {
550
- const B = (O = i.getCellRaw(R.row, R.col)) == null ? void 0 : O.v;
551
- if (!B) {
552
- J++;
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 : "", Vt = ge && it.isDate(ge);
549
+ if (ge && Vt && m.has(ge)) {
550
+ const k = (O = s.getCellRaw(I.row, I.col)) == null ? void 0 : O.v;
551
+ if (!k) {
552
+ z++;
553
553
  continue;
554
554
  }
555
- const ee = it.format(h, B), [P, U, ae] = ee.split("-").map(Number);
556
- let Y = a.get(`${P}`);
557
- Y || (Y = {
558
- title: `${P}`,
559
- key: `${P}`,
555
+ const J = it.format(h, k), [y, $, oe] = J.split("-").map(Number);
556
+ let j = a.get(`${y}`);
557
+ j || (j = {
558
+ title: `${y}`,
559
+ key: `${y}`,
560
560
  children: [],
561
561
  count: 0,
562
562
  leaf: !1,
563
563
  checked: !1
564
- }, a.set(`${P}`, Y), c.set(`${P}`, [`${P}`]));
565
- let H = ($ = Y.children) == null ? void 0 : $.find((Ue) => Ue.key === `${P}-${U}`);
566
- H || (H = {
567
- title: e.t(`sheets-filter.date.${U}`),
568
- key: `${P}-${U}`,
564
+ }, a.set(`${y}`, j), c.set(`${y}`, [`${y}`]));
565
+ let U = (M = j.children) == null ? void 0 : M.find(($e) => $e.key === `${y}-${$}`);
566
+ U || (U = {
567
+ title: e.t(`sheets-filter.date.${$}`),
568
+ key: `${y}-${$}`,
569
569
  children: [],
570
570
  count: 0,
571
571
  leaf: !1,
572
572
  checked: !1
573
- }, (w = Y.children) == null || w.push(H), c.set(`${P}-${U}`, [`${P}`, `${P}-${U}`]));
574
- const we = (ge = H == null ? void 0 : H.children) == null ? void 0 : ge.find((Ue) => Ue.key === `${P}-${U}-${ae}`);
575
- we ? (we.originValues.add(j), we.count++, H.count++, Y.count++) : ((ve = H.children) == null || ve.push({
576
- title: `${ae}`,
577
- key: `${P}-${U}-${ae}`,
573
+ }, (w = j.children) == null || w.push(U), c.set(`${y}-${$}`, [`${y}`, `${y}-${$}`]));
574
+ const we = (_e = U == null ? void 0 : U.children) == null ? void 0 : _e.find(($e) => $e.key === `${y}-${$}-${oe}`);
575
+ we ? (we.originValues.add(G), we.count++, U.count++, j.count++) : ((ve = U.children) == null || ve.push({
576
+ title: `${oe}`,
577
+ key: `${y}-${$}-${oe}`,
578
578
  count: 1,
579
- originValues: /* @__PURE__ */ new Set([j]),
579
+ originValues: /* @__PURE__ */ new Set([G]),
580
580
  leaf: !0,
581
- checked: l.size ? l.has(j) : !s
582
- }), H.count++, Y.count++, c.set(`${P}-${U}-${ae}`, [`${P}`, `${P}-${U}`, `${P}-${U}-${ae}`]));
581
+ checked: l.size ? l.has(G) : !i
582
+ }), U.count++, j.count++, c.set(`${y}-${$}-${oe}`, [`${y}`, `${y}-${$}`, `${y}-${$}-${oe}`]));
583
583
  } else {
584
- const B = j;
585
- let ee = a.get(B);
586
- ee ? ee.count++ : (ee = {
587
- title: j,
584
+ const k = G;
585
+ let J = a.get(k);
586
+ J ? J.count++ : (J = {
587
+ title: G,
588
588
  leaf: !0,
589
- checked: l.size ? l.has(j) : !s,
590
- key: B,
589
+ checked: l.size ? l.has(G) : !i,
590
+ key: k,
591
591
  count: 1
592
- }, a.set(B, ee), c.set(B, [B]));
592
+ }, a.set(k, J), c.set(k, [k]));
593
593
  }
594
- J++;
594
+ z++;
595
595
  }
596
596
  }
597
- const T = t ? s : !0;
597
+ const T = t ? i : !0;
598
598
  if (p > 0) {
599
- const R = {
599
+ const I = {
600
600
  title: e.t("sheets-filter.panel.empty"),
601
601
  count: p,
602
602
  leaf: !0,
603
603
  checked: T,
604
- key: v
604
+ key: g
605
605
  };
606
- a.set("empty", R), c.set("empty", [v]);
606
+ a.set("empty", I), c.set("empty", [g]);
607
607
  }
608
608
  return {
609
- filterTreeItems: es(Array.from(a.values())),
609
+ filterTreeItems: Jr(Array.from(a.values())),
610
610
  filterTreeMapCache: c
611
611
  };
612
612
  }
613
- function es(t) {
614
- return Array.from(t).sort((e, r) => e.children && !r.children ? -1 : !e.children && r.children ? 1 : ts(e.title, r.title)).map((e) => (e.children && e.children.sort((r, i) => {
615
- const n = Number.parseInt(r.key.split("-")[1], 10), l = Number.parseInt(i.key.split("-")[1], 10);
613
+ function Jr(t) {
614
+ return Array.from(t).sort((e, r) => e.children && !r.children ? -1 : !e.children && r.children ? 1 : ei(e.title, r.title)).map((e) => (e.children && e.children.sort((r, s) => {
615
+ const n = Number.parseInt(r.key.split("-")[1], 10), l = Number.parseInt(s.key.split("-")[1], 10);
616
616
  return n - l;
617
617
  }).forEach((r) => {
618
- r.children && r.children.sort((i, n) => {
619
- const l = Number.parseInt(i.key.split("-")[2], 10), s = Number.parseInt(n.key.split("-")[2], 10);
620
- return l - s;
618
+ r.children && r.children.sort((s, n) => {
619
+ const l = Number.parseInt(s.key.split("-")[2], 10), i = Number.parseInt(n.key.split("-")[2], 10);
620
+ return l - i;
621
621
  });
622
622
  }), e));
623
623
  }
624
- const ut = (t) => !Number.isNaN(Number(t)) && !Number.isNaN(Number.parseFloat(t));
625
- function ts(t, e) {
626
- const r = ut(t), i = ut(e);
627
- return r && i ? Number.parseFloat(t) - Number.parseFloat(e) : r && !i ? -1 : !r && i ? 1 : t.localeCompare(e);
624
+ const ct = (t) => !Number.isNaN(Number(t)) && !Number.isNaN(Number.parseFloat(t));
625
+ function ei(t, e) {
626
+ const r = ct(t), s = ct(e);
627
+ return r && s ? Number.parseFloat(t) - Number.parseFloat(e) : r && !s ? -1 : !r && s ? 1 : t.localeCompare(e);
628
628
  }
629
- function xe(t, e) {
629
+ function We(t, e) {
630
630
  for (const r of t) {
631
631
  if (r.key === e)
632
632
  return r;
633
633
  if (r.children) {
634
- const i = xe(r.children, e);
635
- if (i)
636
- return i;
634
+ const s = We(r.children, e);
635
+ if (s)
636
+ return s;
637
637
  }
638
638
  }
639
639
  return null;
@@ -641,51 +641,51 @@ function xe(t, e) {
641
641
  function wt(t) {
642
642
  return t.leaf ? t.checked : t.children ? t.children.every((e) => wt(e)) : !0;
643
643
  }
644
- function he(t, e) {
645
- t.leaf && (e !== void 0 ? t.checked = e : t.checked = !t.checked), t.children && t.children.forEach((r) => he(r, e));
644
+ function ue(t, e) {
645
+ t.leaf && (e !== void 0 ? t.checked = e : t.checked = !t.checked), t.children && t.children.forEach((r) => ue(r, e));
646
646
  }
647
- function Ut(t, e) {
647
+ function $t(t, e) {
648
648
  const r = [];
649
- return t.forEach((i) => {
650
- const n = i.originValues ? e.some(
651
- (o) => Array.from(i.originValues).some(
649
+ return t.forEach((s) => {
650
+ const n = s.originValues ? e.some(
651
+ (o) => Array.from(s.originValues).some(
652
652
  (a) => a.toLowerCase().includes(o.toLowerCase())
653
653
  )
654
654
  ) : !1, l = !n && e.some(
655
- (o) => i.title.toLowerCase().includes(o.toLowerCase())
655
+ (o) => s.title.toLowerCase().includes(o.toLowerCase())
656
656
  );
657
657
  if (n || l)
658
- r.push({ ...i });
659
- else if (i.children) {
660
- const o = Ut(i.children, e);
658
+ r.push({ ...s });
659
+ else if (s.children) {
660
+ const o = $t(s.children, e);
661
661
  if (o.length > 0) {
662
662
  const a = o.reduce((c, h) => c + h.count, 0);
663
- r.push({ ...i, count: a, children: o });
663
+ r.push({ ...s, count: a, children: o });
664
664
  }
665
665
  }
666
666
  }), r;
667
667
  }
668
- var rs = Object.getOwnPropertyDescriptor, tt = (t, e, r, i) => {
669
- for (var n = i > 1 ? void 0 : i ? rs(e, r) : e, l = t.length - 1, s; l >= 0; l--)
670
- (s = t[l]) && (n = s(n) || n);
668
+ var ti = Object.getOwnPropertyDescriptor, et = (t, e, r, s) => {
669
+ for (var n = s > 1 ? void 0 : s ? ti(e, r) : e, l = t.length - 1, i; l >= 0; l--)
670
+ (i = t[l]) && (n = i(n) || n);
671
671
  return n;
672
- }, Pe = (t, e) => (r, i) => e(r, i, t), Oe = /* @__PURE__ */ ((t) => (t[t.VALUES = 0] = "VALUES", t[t.CONDITIONS = 1] = "CONDITIONS", t))(Oe || {});
673
- gt("sheets-filter-ui.sheets-filter-panel.service");
674
- let x = class extends pe {
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 || {});
673
+ _t("sheets-filter-ui.sheets-filter-panel.service");
674
+ let W = class extends me {
675
675
  constructor(e, r) {
676
676
  super();
677
- f(this, "_filterBy$", new K(
677
+ f(this, "_filterBy$", new q(
678
678
  0
679
679
  /* VALUES */
680
680
  ));
681
681
  f(this, "filterBy$", this._filterBy$.asObservable());
682
- f(this, "_filterByModel$", new Ur(1));
682
+ f(this, "_filterByModel$", new $r(1));
683
683
  f(this, "filterByModel$", this._filterByModel$.asObservable());
684
684
  f(this, "_filterByModel", null);
685
- f(this, "_hasCriteria$", new K(!1));
685
+ f(this, "_hasCriteria$", new q(!1));
686
686
  f(this, "hasCriteria$", this._hasCriteria$.asObservable());
687
687
  f(this, "_filterModel", null);
688
- f(this, "_col$", new K(-1));
688
+ f(this, "_col$", new q(-1));
689
689
  f(this, "col$", this._col$.asObservable());
690
690
  f(this, "_filterHeaderListener", null);
691
691
  this._injector = e, this._refRangeService = r;
@@ -710,9 +710,9 @@ let x = class extends pe {
710
710
  }
711
711
  setupCol(e, r) {
712
712
  this.terminate(), this._filterModel = e, this._col$.next(r);
713
- const i = e.getFilterColumn(r);
714
- if (i) {
715
- const n = i.getColumnData();
713
+ const s = e.getFilterColumn(r);
714
+ if (s) {
715
+ const n = s.getColumnData();
716
716
  if (n.customFilters) {
717
717
  this._hasCriteria$.next(!0), this._setupByConditions(e, r);
718
718
  return;
@@ -738,13 +738,13 @@ let x = class extends pe {
738
738
  }
739
739
  _listenToFilterHeaderChange(e, r) {
740
740
  this._disposeFilterHeaderChangeListener();
741
- const i = e.unitId, n = e.subUnitId, l = e.getRange(), s = {
741
+ const s = e.unitId, n = e.subUnitId, l = e.getRange(), i = {
742
742
  startColumn: r,
743
743
  startRow: l.startRow,
744
744
  endRow: l.startRow,
745
745
  endColumn: r
746
746
  };
747
- this._filterHeaderListener = this._refRangeService.watchRange(i, n, s, (o, a) => {
747
+ this._filterHeaderListener = this._refRangeService.watchRange(s, n, i, (o, a) => {
748
748
  if (!a)
749
749
  this.terminate();
750
750
  else {
@@ -755,9 +755,9 @@ let x = class extends pe {
755
755
  }
756
756
  async _setupByValues(e, r) {
757
757
  this._disposePreviousModel();
758
- const i = e.getRange();
759
- if (i.startRow === i.endRow) return !1;
760
- const n = await Ie.fromFilterColumn(
758
+ const s = e.getRange();
759
+ if (s.startRow === s.endRow) return !1;
760
+ const n = await Re.fromFilterColumn(
761
761
  this._injector,
762
762
  e,
763
763
  r
@@ -769,9 +769,9 @@ let x = class extends pe {
769
769
  }
770
770
  _setupByConditions(e, r) {
771
771
  this._disposePreviousModel();
772
- const i = e.getRange();
773
- if (i.startRow === i.endRow) return !1;
774
- const n = ye.fromFilterColumn(
772
+ const s = e.getRange();
773
+ if (s.startRow === s.endRow) return !1;
774
+ const n = Oe.fromFilterColumn(
775
775
  this._injector,
776
776
  e,
777
777
  r,
@@ -787,19 +787,19 @@ let x = class extends pe {
787
787
  (e = this._filterByModel) == null || e.dispose(), this.filterByModel = null;
788
788
  }
789
789
  };
790
- x = tt([
791
- Pe(0, E(Z)),
792
- Pe(1, E(lr))
793
- ], x);
794
- let ye = class extends pe {
795
- constructor(e, r, i, n, l) {
790
+ W = et([
791
+ Ce(0, E(X)),
792
+ Ce(1, E(ar))
793
+ ], W);
794
+ let Oe = class extends me {
795
+ constructor(e, r, s, n, l) {
796
796
  super();
797
- f(this, "canApply$", _e(!0));
797
+ f(this, "canApply$", fe(!0));
798
798
  f(this, "_conditionItem$");
799
799
  f(this, "conditionItem$");
800
800
  f(this, "_filterConditionFormParams$");
801
801
  f(this, "filterConditionFormParams$");
802
- this._filterModel = e, this.col = r, this._commandService = l, this._conditionItem$ = new K(i), this.conditionItem$ = this._conditionItem$.asObservable(), this._filterConditionFormParams$ = new K(n), this.filterConditionFormParams$ = this._filterConditionFormParams$.asObservable();
802
+ this._filterModel = e, this.col = r, this._commandService = l, this._conditionItem$ = new q(s), this.conditionItem$ = this._conditionItem$.asObservable(), this._filterConditionFormParams$ = new q(n), this.filterConditionFormParams$ = this._filterConditionFormParams$.asObservable();
803
803
  }
804
804
  /**
805
805
  * Create a model with targeting filter column. If there is not a filter column, the model would be created with
@@ -812,9 +812,9 @@ let ye = class extends pe {
812
812
  *
813
813
  * @returns the model to control the panel's state
814
814
  */
815
- static fromFilterColumn(e, r, i, n) {
816
- const [l, s] = m.testMappingFilterColumn(n == null ? void 0 : n.getColumnData());
817
- return e.createInstance(ye, r, i, l, s);
815
+ static fromFilterColumn(e, r, s, n) {
816
+ const [l, i] = d.testMappingFilterColumn(n == null ? void 0 : n.getColumnData());
817
+ return e.createInstance(Oe, r, s, l, i);
818
818
  }
819
819
  get conditionItem() {
820
820
  return this._conditionItem$.getValue();
@@ -829,7 +829,7 @@ let ye = class extends pe {
829
829
  this.col += e;
830
830
  }
831
831
  clear() {
832
- return this._disposed ? Promise.resolve(!1) : this._commandService.executeCommand(se.id, {
832
+ return this._disposed ? Promise.resolve(!1) : this._commandService.executeCommand(re.id, {
833
833
  unitId: this._filterModel.unitId,
834
834
  subUnitId: this._filterModel.subUnitId,
835
835
  col: this.col,
@@ -841,8 +841,8 @@ let ye = class extends pe {
841
841
  */
842
842
  async apply() {
843
843
  if (this._disposed) return !1;
844
- const e = m.mapToFilterColumn(this.conditionItem, this.filterConditionFormParams);
845
- return this._commandService.executeCommand(se.id, {
844
+ const e = d.mapToFilterColumn(this.conditionItem, this.filterConditionFormParams);
845
+ return this._commandService.executeCommand(re.id, {
846
846
  unitId: this._filterModel.unitId,
847
847
  subUnitId: this._filterModel.subUnitId,
848
848
  col: this.col,
@@ -854,10 +854,10 @@ let ye = class extends pe {
854
854
  * `IFilterConditionFormParams` and load default condition form params.
855
855
  */
856
856
  onPrimaryConditionChange(e) {
857
- const r = m.ALL_CONDITIONS.find((i) => i.operator === e);
857
+ const r = d.ALL_CONDITIONS.find((s) => s.operator === e);
858
858
  if (!r)
859
859
  throw new Error(`[ByConditionsModel]: condition item not found for operator: ${e}!`);
860
- this._conditionItem$.next(r), this._filterConditionFormParams$.next(m.getInitialFormParams(e));
860
+ this._conditionItem$.next(r), this._filterConditionFormParams$.next(d.getInitialFormParams(e));
861
861
  }
862
862
  /**
863
863
  * This method would be called when user changes the primary conditions, the input values or "AND" "OR" ratio.
@@ -870,17 +870,17 @@ let ye = class extends pe {
870
870
  onConditionFormChange(e) {
871
871
  const r = { ...this.filterConditionFormParams, ...e };
872
872
  if (r.and !== !0 && delete r.and, typeof e.and < "u" || typeof e.operator1 < "u" || typeof e.operator2 < "u") {
873
- const i = m.testMappingParams(r, this.conditionItem.numOfParameters);
874
- this._conditionItem$.next(i);
873
+ const s = d.testMappingParams(r, this.conditionItem.numOfParameters);
874
+ this._conditionItem$.next(s);
875
875
  }
876
876
  this._filterConditionFormParams$.next(r);
877
877
  }
878
878
  };
879
- ye = tt([
880
- Pe(4, Q)
881
- ], ye);
882
- let Ie = class extends pe {
883
- constructor(e, r, i, n, l) {
879
+ Oe = et([
880
+ Ce(4, Q)
881
+ ], Oe);
882
+ let Re = class extends me {
883
+ constructor(e, r, s, n, l) {
884
884
  super();
885
885
  f(this, "_rawFilterItems$");
886
886
  f(this, "rawFilterItems$");
@@ -891,22 +891,22 @@ let Ie = class extends pe {
891
891
  f(this, "_manuallyUpdateFilterItems$");
892
892
  f(this, "_searchString$");
893
893
  f(this, "searchString$");
894
- this._filterModel = e, this.col = r, this._commandService = l, this._treeMapCache = n, this._searchString$ = new K(""), this.searchString$ = this._searchString$.asObservable(), this._rawFilterItems$ = new K(i), this.rawFilterItems$ = this._rawFilterItems$.asObservable(), this._manuallyUpdateFilterItems$ = new Hr(), this.filterItems$ = Dr(
895
- kr([
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 Ur(), this.filterItems$ = Hr(
895
+ Dr([
896
896
  this._searchString$.pipe(
897
- yt(500, void 0, { leading: !0, trailing: !0 }),
898
- It(void 0)
897
+ Ot(500, void 0, { leading: !0, trailing: !0 }),
898
+ Rt(void 0)
899
899
  ),
900
900
  this._rawFilterItems$
901
901
  ]).pipe(
902
- ie(([s, o]) => {
903
- if (!s) return o;
904
- const c = s.toLowerCase().split(/\s+/).filter((h) => !!h);
905
- return Ut(o, c);
902
+ ie(([i, o]) => {
903
+ if (!i) return o;
904
+ const c = i.toLowerCase().split(/\s+/).filter((h) => !!h);
905
+ return $t(o, c);
906
906
  })
907
907
  ),
908
908
  this._manuallyUpdateFilterItems$
909
- ).pipe(Br(1)), this.canApply$ = this.filterItems$.pipe(ie((s) => Ve(s).checked > 0)), this.disposeWithMe(this.filterItems$.subscribe((s) => this._filterItems = s));
909
+ ).pipe(kr(1)), this.canApply$ = this.filterItems$.pipe(ie((i) => xe(i).checked > 0)), this.disposeWithMe(this.filterItems$.subscribe((i) => this._filterItems = i));
910
910
  }
911
911
  /**
912
912
  * Create a model with targeting filter column. If there is not a filter column, the model would be created with
@@ -918,30 +918,30 @@ let Ie = class extends pe {
918
918
  *
919
919
  * @returns the model to control the panel's state
920
920
  */
921
- static async fromFilterColumn(e, r, i) {
922
- var $;
923
- const n = e.get(je), l = e.get(X), s = e.get(Ne, vt.OPTIONAL), { unitId: o, subUnitId: a } = r, c = n.getUniverSheetInstance(o);
921
+ static async fromFilterColumn(e, r, s) {
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);
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 d = r.getRange(), v = i, p = ($ = r.getFilterColumn(i)) == null ? void 0 : $.getColumnData().filters, T = new Set(p == null ? void 0 : p.filters), g = !!(p && p.blank), N = r.getFilteredOutRowsExceptCol(i), F = { ...d, startRow: d.startRow + 1, startColumn: v, endColumn: v };
928
- let I, O;
929
- if (s) {
930
- const w = await s.getFilterValues({
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 };
928
+ let R, O;
929
+ if (i) {
930
+ const w = await i.getFilterValues({
931
931
  unitId: o,
932
932
  subUnitId: a,
933
- filteredOutRowsByOtherColumns: Array.from(N),
933
+ filteredOutRowsByOtherColumns: Array.from(C),
934
934
  filters: !!p,
935
- blankChecked: g,
936
- iterateRange: F,
935
+ blankChecked: v,
936
+ iterateRange: N,
937
937
  alreadyChecked: Array.from(T)
938
938
  });
939
- I = w.filterTreeItems, O = w.filterTreeMapCache;
939
+ R = w.filterTreeItems, O = w.filterTreeMapCache;
940
940
  } else {
941
- const w = $t(!!p, l, F, h, N, T, g, c.getStyles());
942
- I = w.filterTreeItems, O = w.filterTreeMapCache;
941
+ const w = Mt(!!p, l, N, h, C, T, v, c.getStyles());
942
+ R = w.filterTreeItems, O = w.filterTreeMapCache;
943
943
  }
944
- return e.createInstance(Ie, r, i, I, O);
944
+ return e.createInstance(Re, r, s, R, O);
945
945
  }
946
946
  get rawFilterItems() {
947
947
  return this._rawFilterItems$.getValue();
@@ -962,24 +962,24 @@ let Ie = class extends pe {
962
962
  this._searchString$.next(e);
963
963
  }
964
964
  onCheckAllToggled(e) {
965
- const r = Fe.deepClone(this._filterItems);
966
- r.forEach((i) => he(i, e)), this._manuallyUpdateFilterItems(r);
965
+ const r = Te.deepClone(this._filterItems);
966
+ r.forEach((s) => ue(s, e)), this._manuallyUpdateFilterItems(r);
967
967
  }
968
968
  /**
969
969
  * Toggle a filter item.
970
970
  */
971
971
  onFilterCheckToggled(e) {
972
- const r = Fe.deepClone(this._filterItems), i = xe(r, e.key);
973
- if (!i)
972
+ const r = Te.deepClone(this._filterItems), s = We(r, e.key);
973
+ if (!s)
974
974
  return;
975
- const n = wt(i);
976
- he(i, !n), this._manuallyUpdateFilterItems(r);
975
+ const n = wt(s);
976
+ ue(s, !n), this._manuallyUpdateFilterItems(r);
977
977
  }
978
978
  onFilterOnly(e) {
979
- const r = Fe.deepClone(this._filterItems);
980
- r.forEach((i) => he(i, !1)), e.forEach((i) => {
981
- const n = xe(r, i);
982
- n && he(n, !0);
979
+ const r = Te.deepClone(this._filterItems);
980
+ r.forEach((s) => ue(s, !1)), e.forEach((s) => {
981
+ const n = We(r, s);
982
+ n && ue(n, !0);
983
983
  }), this._manuallyUpdateFilterItems(r);
984
984
  }
985
985
  _manuallyUpdateFilterItems(e) {
@@ -988,7 +988,7 @@ let Ie = class extends pe {
988
988
  // expose method here to let the panel change filter items
989
989
  // #region ByValuesModel apply methods
990
990
  clear() {
991
- return this._disposed ? Promise.resolve(!1) : this._commandService.executeCommand(se.id, {
991
+ return this._disposed ? Promise.resolve(!1) : this._commandService.executeCommand(re.id, {
992
992
  unitId: this._filterModel.unitId,
993
993
  subUnitId: this._filterModel.subUnitId,
994
994
  col: this.col,
@@ -1001,15 +1001,15 @@ let Ie = class extends pe {
1001
1001
  async apply() {
1002
1002
  if (this._disposed)
1003
1003
  return !1;
1004
- const e = Ve(this._filterItems), { checked: r, checkedItems: i } = e, n = this.rawFilterItems;
1004
+ const e = xe(this._filterItems), { checked: r, checkedItems: s } = e, n = this.rawFilterItems;
1005
1005
  let l = 0;
1006
1006
  for (const c of n)
1007
1007
  l += c.count;
1008
- const s = r === 0, o = e.checked === l, a = { colId: this.col };
1009
- if (s)
1008
+ const i = r === 0, o = e.checked === l, a = { colId: this.col };
1009
+ if (i)
1010
1010
  throw new Error("[ByValuesModel]: no checked items!");
1011
1011
  if (o)
1012
- return this._commandService.executeCommand(se.id, {
1012
+ return this._commandService.executeCommand(re.id, {
1013
1013
  unitId: this._filterModel.unitId,
1014
1014
  subUnitId: this._filterModel.subUnitId,
1015
1015
  col: this.col,
@@ -1017,12 +1017,12 @@ let Ie = class extends pe {
1017
1017
  });
1018
1018
  {
1019
1019
  a.filters = {};
1020
- const c = i.filter((d) => d.key !== "empty");
1020
+ const c = s.filter((m) => m.key !== "empty");
1021
1021
  c.length > 0 && (a.filters = {
1022
- filters: c.flatMap((d) => d.originValues ? Array.from(d.originValues) : [d.title])
1023
- }), c.length !== i.length && (a.filters.blank = !0);
1022
+ filters: c.flatMap((m) => m.originValues ? Array.from(m.originValues) : [m.title])
1023
+ }), c.length !== s.length && (a.filters.blank = !0);
1024
1024
  }
1025
- return this._commandService.executeCommand(se.id, {
1025
+ return this._commandService.executeCommand(re.id, {
1026
1026
  unitId: this._filterModel.unitId,
1027
1027
  subUnitId: this._filterModel.subUnitId,
1028
1028
  col: this.col,
@@ -1031,474 +1031,575 @@ let Ie = class extends pe {
1031
1031
  }
1032
1032
  // #endregion
1033
1033
  };
1034
- Ie = tt([
1035
- Pe(4, Q)
1036
- ], Ie);
1037
- const ne = "FILTER_PANEL_OPENED", Re = {
1034
+ Re = et([
1035
+ Ce(4, Q)
1036
+ ], Re);
1037
+ const se = "FILTER_PANEL_OPENED", Ie = {
1038
1038
  id: "sheet.operation.open-filter-panel",
1039
- type: Me.OPERATION,
1039
+ type: Le.OPERATION,
1040
1040
  handler: (t, e) => {
1041
- const r = t.get($e), i = t.get(G), n = t.get(x);
1042
- t.get(Q).syncExecuteCommand(Pr.id, { visible: !1 });
1043
- const { unitId: s, subUnitId: o, col: a } = e, c = i.getFilterModel(s, o);
1044
- return c ? (n.setupCol(c, a), r.getContextValue(ne) || r.setContextValue(ne, !0), !0) : !1;
1041
+ const r = t.get(Me), s = t.get(V), n = t.get(W);
1042
+ t.get(Q).syncExecuteCommand(Cr.id, { visible: !1 });
1043
+ const { unitId: i, subUnitId: o, col: a } = e, c = s.getFilterModel(i, o);
1044
+ return c ? (n.setupCol(c, a), r.getContextValue(se) || r.setContextValue(se, !0), !0) : !1;
1045
1045
  }
1046
- }, me = {
1046
+ }, he = {
1047
1047
  id: "sheet.operation.close-filter-panel",
1048
- type: Me.OPERATION,
1048
+ type: Le.OPERATION,
1049
1049
  handler: (t) => {
1050
- const e = t.get($e), r = t.get(x), i = t.get(_r, vt.OPTIONAL);
1051
- return e.getContextValue(ne) ? (e.setContextValue(ne, !1), i == null || i.focus(), r.terminate()) : !1;
1050
+ const e = t.get(Me), r = t.get(W), s = t.get(fr, vt.OPTIONAL);
1051
+ return e.getContextValue(se) ? (e.setContextValue(se, !1), s == null || s.focus(), r.terminate()) : !1;
1052
1052
  }
1053
- }, Ht = {
1053
+ }, Ut = {
1054
1054
  id: "sheet.operation.apply-filter",
1055
- type: Me.OPERATION,
1055
+ type: Le.OPERATION,
1056
1056
  handler: (t, e) => {
1057
1057
  const { filterBy: r } = e;
1058
- return t.get(x).changeFilterBy(r);
1058
+ return t.get(W).changeFilterBy(r);
1059
1059
  }
1060
1060
  };
1061
- var ss = Object.getOwnPropertyDescriptor, is = (t, e, r, i) => {
1062
- for (var n = i > 1 ? void 0 : i ? ss(e, r) : e, l = t.length - 1, s; l >= 0; l--)
1063
- (s = t[l]) && (n = s(n) || n);
1061
+ var ri = Object.getOwnPropertyDescriptor, ii = (t, e, r, s) => {
1062
+ for (var n = s > 1 ? void 0 : s ? ri(e, r) : e, l = t.length - 1, i; l >= 0; l--)
1063
+ (i = t[l]) && (n = i(n) || n);
1064
1064
  return n;
1065
- }, te = (t, e) => (r, i) => e(r, i, t);
1066
- let oe = class extends pe {
1067
- constructor(t, e, r, i, n, l) {
1068
- super(), this._sheetsFilterService = t, this._localeService = e, this._commandService = r, this._sheetPermissionCheckPermission = i, this._injector = n, this._sheetsSelectionService = l, this._commandExecutedListener();
1065
+ }, ee = (t, e) => (r, s) => e(r, s, t);
1066
+ let ne = class extends me {
1067
+ constructor(t, e, r, s, n, l) {
1068
+ super(), this._sheetsFilterService = t, this._localeService = e, this._commandService = r, this._sheetPermissionCheckPermission = s, this._injector = n, this._sheetsSelectionService = l, this._commandExecutedListener();
1069
1069
  }
1070
1070
  _commandExecutedListener() {
1071
1071
  this.disposeWithMe(
1072
1072
  this._commandService.beforeCommandExecuted((t) => {
1073
- var e, r, i;
1074
- if (t.id === fe.id) {
1075
- const n = this._injector.get(je), l = hr(n);
1073
+ var e, r, s;
1074
+ if (t.id === pe.id) {
1075
+ const n = this._injector.get(Ge), l = ur(n);
1076
1076
  if (!l) return;
1077
- const { unitId: s, subUnitId: o, worksheet: a } = l, c = (e = this._sheetsFilterService.getFilterModel(s, o)) == null ? void 0 : e.getRange();
1077
+ const { unitId: i, subUnitId: o, worksheet: a } = l, c = (e = this._sheetsFilterService.getFilterModel(i, o)) == null ? void 0 : e.getRange();
1078
1078
  let h;
1079
1079
  if (c)
1080
1080
  h = this._sheetPermissionCheckPermission.permissionCheckWithRanges({
1081
- rangeTypes: [ue],
1082
- worksheetTypes: [le, ce]
1081
+ rangeTypes: [ce],
1082
+ worksheetTypes: [ae, le]
1083
1083
  }, [c]);
1084
1084
  else {
1085
- const d = (r = this._sheetsSelectionService.getCurrentLastSelection()) == null ? void 0 : r.range;
1086
- if (d) {
1087
- let v = { ...d };
1088
- v = d.startColumn === d.endColumn && d.startRow === d.endRow ? mr(v, { left: !0, right: !0, up: !0, down: !0 }, a) : v, h = this._sheetPermissionCheckPermission.permissionCheckWithRanges({
1089
- rangeTypes: [ue],
1090
- worksheetTypes: [ce, le]
1091
- }, [v], s, o);
1085
+ const m = (r = this._sheetsSelectionService.getCurrentLastSelection()) == null ? void 0 : r.range;
1086
+ if (m) {
1087
+ let g = { ...m };
1088
+ g = m.startColumn === m.endColumn && m.startRow === m.endRow ? hr(g, { left: !0, right: !0, up: !0, down: !0 }, a) : g, h = this._sheetPermissionCheckPermission.permissionCheckWithRanges({
1089
+ rangeTypes: [ce],
1090
+ worksheetTypes: [le, ae]
1091
+ }, [g], i, o);
1092
1092
  } else
1093
1093
  h = this._sheetPermissionCheckPermission.permissionCheckWithoutRange({
1094
- rangeTypes: [ue],
1095
- worksheetTypes: [ce, le]
1094
+ rangeTypes: [ce],
1095
+ worksheetTypes: [le, ae]
1096
1096
  });
1097
1097
  }
1098
1098
  h || this._sheetPermissionCheckPermission.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.filterErr"));
1099
1099
  }
1100
- if (t.id === Re.id) {
1101
- const n = t.params, { unitId: l, subUnitId: s } = n, o = (i = this._sheetsFilterService.getFilterModel(l, s)) == null ? void 0 : i.getRange(), a = Fe.deepClone(o);
1100
+ if (t.id === Ie.id) {
1101
+ 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
1102
  a && (a.startColumn = n.col, a.endColumn = n.col, this._sheetPermissionCheckPermission.permissionCheckWithRanges({
1103
- rangeTypes: [ue],
1104
- worksheetTypes: [le, ce]
1103
+ rangeTypes: [ce],
1104
+ worksheetTypes: [ae, le]
1105
1105
  }, [a]) || this._sheetPermissionCheckPermission.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.filterErr")));
1106
1106
  }
1107
1107
  })
1108
1108
  );
1109
1109
  }
1110
1110
  };
1111
- oe = is([
1112
- te(0, E(G)),
1113
- te(1, E(X)),
1114
- te(2, Q),
1115
- te(3, E(cr)),
1116
- te(4, E(Z)),
1117
- te(5, E(ur))
1118
- ], oe);
1119
- var b = function() {
1120
- return b = Object.assign || function(t) {
1121
- for (var e, r = 1, i = arguments.length; r < i; r++) {
1111
+ ne = ii([
1112
+ ee(0, E(V)),
1113
+ ee(1, E(K)),
1114
+ ee(2, Q),
1115
+ ee(3, E(lr)),
1116
+ ee(4, E(X)),
1117
+ ee(5, E(cr))
1118
+ ], ne);
1119
+ var P = function() {
1120
+ return P = Object.assign || function(t) {
1121
+ for (var e, r = 1, s = arguments.length; r < s; r++) {
1122
1122
  e = arguments[r];
1123
1123
  for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]);
1124
1124
  }
1125
1125
  return t;
1126
- }, b.apply(this, arguments);
1127
- }, ns = function(t, e) {
1126
+ }, P.apply(this, arguments);
1127
+ }, si = function(t, e) {
1128
1128
  var r = {};
1129
- for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (r[i] = t[i]);
1129
+ for (var s in t) Object.prototype.hasOwnProperty.call(t, s) && e.indexOf(s) < 0 && (r[s] = t[s]);
1130
1130
  if (t != null && typeof Object.getOwnPropertySymbols == "function")
1131
- for (var n = 0, i = Object.getOwnPropertySymbols(t); n < i.length; n++)
1132
- e.indexOf(i[n]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[n]) && (r[i[n]] = t[i[n]]);
1131
+ for (var n = 0, s = Object.getOwnPropertySymbols(t); n < s.length; n++)
1132
+ e.indexOf(s[n]) < 0 && Object.prototype.propertyIsEnumerable.call(t, s[n]) && (r[s[n]] = t[s[n]]);
1133
1133
  return r;
1134
- }, Dt = bt(function(t, e) {
1135
- var r = t.icon, i = t.id, n = t.className, l = t.extend, s = ns(t, ["icon", "id", "className", "extend"]), o = "univerjs-icon univerjs-icon-".concat(i, " ").concat(n || "").trim(), a = Xr("_".concat(ls()));
1136
- return kt(r, "".concat(i), { defIds: r.defIds, idSuffix: a.current }, b({ ref: e, className: o }, s), l);
1134
+ }, Ht = Pt(function(t, e) {
1135
+ var r = t.icon, s = t.id, n = t.className, l = t.extend, i = si(t, ["icon", "id", "className", "extend"]), o = "univerjs-icon univerjs-icon-".concat(s, " ").concat(n || "").trim(), a = Kr("_".concat(ai()));
1136
+ return Dt(r, "".concat(s), { defIds: r.defIds, idSuffix: a.current }, P({ ref: e, className: o }, i), l);
1137
1137
  });
1138
- function kt(t, e, r, i, n) {
1139
- return Lt(t.tag, b(b({ key: e }, os(t, r, n)), i), (as(t, r).children || []).map(function(l, s) {
1140
- return kt(l, "".concat(e, "-").concat(t.tag, "-").concat(s), r, void 0, n);
1138
+ function Dt(t, e, r, s, n) {
1139
+ return bt(t.tag, P(P({ key: e }, ni(t, r, n)), s), (oi(t, r).children || []).map(function(l, i) {
1140
+ return Dt(l, "".concat(e, "-").concat(t.tag, "-").concat(i), r, void 0, n);
1141
1141
  }));
1142
1142
  }
1143
- function os(t, e, r) {
1144
- var i = b({}, t.attrs);
1145
- r != null && r.colorChannel1 && i.fill === "colorChannel1" && (i.fill = r.colorChannel1), t.tag === "mask" && i.id && (i.id = i.id + e.idSuffix), Object.entries(i).forEach(function(l) {
1146
- var s = l[0], o = l[1];
1147
- s === "mask" && typeof o == "string" && (i[s] = o.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
1143
+ function ni(t, e, r) {
1144
+ var s = P({}, t.attrs);
1145
+ 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
+ var i = l[0], o = l[1];
1147
+ i === "mask" && typeof o == "string" && (s[i] = o.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
1148
1148
  });
1149
1149
  var n = e.defIds;
1150
- return !n || n.length === 0 || (t.tag === "use" && i["xlink:href"] && (i["xlink:href"] = i["xlink:href"] + e.idSuffix), Object.entries(i).forEach(function(l) {
1151
- var s = l[0], o = l[1];
1152
- typeof o == "string" && (i[s] = o.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
1153
- })), i;
1150
+ return !n || n.length === 0 || (t.tag === "use" && s["xlink:href"] && (s["xlink:href"] = s["xlink:href"] + e.idSuffix), Object.entries(s).forEach(function(l) {
1151
+ var i = l[0], o = l[1];
1152
+ typeof o == "string" && (s[i] = o.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
1153
+ })), s;
1154
1154
  }
1155
- function as(t, e) {
1156
- var r, i = e.defIds;
1157
- return !i || i.length === 0 ? t : t.tag === "defs" && (!((r = t.children) === null || r === void 0) && r.length) ? b(b({}, t), { children: t.children.map(function(n) {
1158
- return typeof n.attrs.id == "string" && i && i.indexOf(n.attrs.id) > -1 ? b(b({}, n), { attrs: b(b({}, n.attrs), { id: n.attrs.id + e.idSuffix }) }) : n;
1155
+ function oi(t, e) {
1156
+ var r, s = e.defIds;
1157
+ 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
+ return typeof n.attrs.id == "string" && s && s.indexOf(n.attrs.id) > -1 ? P(P({}, n), { attrs: P(P({}, n.attrs), { id: n.attrs.id + e.idSuffix }) }) : n;
1159
1159
  }) }) : t;
1160
1160
  }
1161
- function ls() {
1161
+ function ai() {
1162
1162
  return Math.random().toString(36).substring(2, 8);
1163
1163
  }
1164
- Dt.displayName = "UniverIcon";
1165
- var cs = { tag: "svg", attrs: { 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" } }] }, Bt = bt(function(t, e) {
1166
- return Lt(Dt, Object.assign({}, t, {
1164
+ Ht.displayName = "UniverIcon";
1165
+ var li = { tag: "svg", attrs: { 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" } }] }, kt = Pt(function(t, e) {
1166
+ return bt(Ht, Object.assign({}, t, {
1167
1167
  id: "filter-single",
1168
1168
  ref: e,
1169
- icon: cs
1169
+ icon: li
1170
1170
  }));
1171
1171
  });
1172
- Bt.displayName = "FilterSingle";
1173
- const us = "univer-sheets-filter-panel", hs = "univer-sheets-filter-panel-header", ms = "univer-sheets-filter-panel-content", ds = "univer-sheets-filter-panel-values-container", ps = "univer-sheets-filter-panel-values-virtual", fs = "univer-sheets-filter-panel-values-item", _s = "univer-sheets-filter-panel-values-item-inner", gs = "univer-sheets-filter-panel-values-item-count", vs = "univer-sheets-filter-panel-values-item-text", Ss = "univer-sheets-filter-panel-conditions-container", Es = "univer-sheets-filter-panel-conditions-container-inner", Ts = "univer-sheets-filter-panel-conditions-desc", Fs = "univer-sheets-filter-panel-footer", Cs = "univer-sheets-filter-panel-footer-primary-buttons", y = {
1174
- sheetsFilterPanel: us,
1175
- sheetsFilterPanelHeader: hs,
1176
- sheetsFilterPanelContent: ms,
1177
- sheetsFilterPanelValuesContainer: ds,
1178
- sheetsFilterPanelValuesVirtual: ps,
1179
- sheetsFilterPanelValuesItem: fs,
1180
- sheetsFilterPanelValuesItemInner: _s,
1181
- sheetsFilterPanelValuesItemCount: gs,
1182
- sheetsFilterPanelValuesItemText: vs,
1183
- sheetsFilterPanelConditionsContainer: Ss,
1184
- sheetsFilterPanelConditionsContainerInner: Es,
1185
- sheetsFilterPanelConditionsDesc: Ts,
1186
- sheetsFilterPanelFooter: Fs,
1187
- sheetsFilterPanelFooterPrimaryButtons: Cs
1188
- };
1189
- function Ns(t) {
1172
+ kt.displayName = "FilterSingle";
1173
+ function ci(t) {
1190
1174
  var p, T;
1191
- const { model: e } = t, r = re(X), i = W(e.conditionItem$, void 0), n = W(e.filterConditionFormParams$, void 0), l = n != null && n.and ? "AND" : "OR", s = k((g) => {
1192
- e.onConditionFormChange({ and: g === "AND" });
1193
- }, [e]), o = Ps(r), a = k((g) => {
1194
- e.onPrimaryConditionChange(g);
1195
- }, [e]), c = Os(r), h = k((g) => {
1196
- e.onConditionFormChange(g);
1197
- }, [e]), d = r.t("sheets-filter.panel.input-values-placeholder");
1198
- function v(g, N, F) {
1199
- const I = m.getItemByOperator(g).numOfParameters === 1;
1200
- return /* @__PURE__ */ L(ct, { children: [
1201
- F === "operator2" && /* @__PURE__ */ L(Qr, { value: l, onChange: s, children: [
1202
- /* @__PURE__ */ S(at, { value: "AND", children: r.t("sheets-filter.panel.and") }),
1203
- /* @__PURE__ */ S(at, { value: "OR", children: r.t("sheets-filter.panel.or") })
1175
+ 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
+ e.onConditionFormChange({ and: v === "AND" });
1177
+ }, [e]), o = ui(r), a = D((v) => {
1178
+ e.onPrimaryConditionChange(v);
1179
+ }, [e]), c = hi(r), h = D((v) => {
1180
+ e.onConditionFormChange(v);
1181
+ }, [e]), m = r.t("sheets-filter.panel.input-values-placeholder");
1182
+ function g(v, C, N) {
1183
+ const R = d.getItemByOperator(v).numOfParameters === 1;
1184
+ return /* @__PURE__ */ b(lt, { children: [
1185
+ N === "operator2" && /* @__PURE__ */ b(Qr, { value: l, onChange: i, children: [
1186
+ /* @__PURE__ */ S(ot, { value: "AND", children: r.t("sheets-filter.panel.and") }),
1187
+ /* @__PURE__ */ S(ot, { value: "OR", children: r.t("sheets-filter.panel.or") })
1204
1188
  ] }),
1205
- /* @__PURE__ */ S(ot, { value: g, options: c, onChange: (O) => h({ [F]: O }) }),
1206
- I && /* @__PURE__ */ S("div", { children: /* @__PURE__ */ S(Rt, { value: N, placeholder: d, onChange: (O) => h({ [F === "operator1" ? "val1" : "val2"]: O }) }) })
1189
+ /* @__PURE__ */ S(
1190
+ nt,
1191
+ {
1192
+ value: v,
1193
+ options: c,
1194
+ onChange: (O) => h({ [N]: O })
1195
+ }
1196
+ ),
1197
+ R && /* @__PURE__ */ S("div", { children: /* @__PURE__ */ S(
1198
+ It,
1199
+ {
1200
+ className: "univer-mt-2",
1201
+ value: C,
1202
+ placeholder: m,
1203
+ onChange: (O) => h({ [N === "operator1" ? "val1" : "val2"]: O })
1204
+ }
1205
+ ) })
1207
1206
  ] });
1208
1207
  }
1209
- return /* @__PURE__ */ S("div", { className: y.sheetsFilterPanelConditionsContainer, children: i && n && /* @__PURE__ */ L(ct, { children: [
1210
- /* @__PURE__ */ S(ot, { value: i.operator, options: o, onChange: a }),
1211
- m.getItemByOperator(i.operator).numOfParameters !== 0 ? /* @__PURE__ */ L("div", { className: y.sheetsFilterPanelConditionsContainerInner, children: [
1212
- i.numOfParameters >= 1 && v(n.operator1, (p = n.val1) != null ? p : "", "operator1"),
1213
- i.numOfParameters >= 2 && v(n.operator2, (T = n.val2) != null ? T : "", "operator2"),
1214
- /* @__PURE__ */ L("div", { className: y.sheetsFilterPanelConditionsDesc, children: [
1215
- r.t("sheets-filter.panel.?"),
1216
- /* @__PURE__ */ S("br", {}),
1217
- r.t("sheets-filter.panel.*")
1208
+ return /* @__PURE__ */ S(
1209
+ "div",
1210
+ {
1211
+ "data-univer-comp-sheets-filter-panel-conditions-container": !0,
1212
+ className: "univer-flex univer-h-full univer-flex-col",
1213
+ children: s && n && /* @__PURE__ */ b(lt, { children: [
1214
+ /* @__PURE__ */ S(nt, { value: s.operator, options: o, onChange: a }),
1215
+ d.getItemByOperator(s.operator).numOfParameters !== 0 ? /* @__PURE__ */ b(
1216
+ "div",
1217
+ {
1218
+ "data-univer-comp-sheets-filter-panel-conditions-container-inner": !0,
1219
+ className: `
1220
+ univer-mt-2 univer-flex-grow univer-overflow-hidden univer-rounded-md univer-border
1221
+ univer-border-solid univer-border-gray-200 univer-p-2
1222
+ `,
1223
+ children: [
1224
+ s.numOfParameters >= 1 && g(n.operator1, (p = n.val1) != null ? p : "", "operator1"),
1225
+ s.numOfParameters >= 2 && g(n.operator2, (T = n.val2) != null ? T : "", "operator2"),
1226
+ /* @__PURE__ */ b(
1227
+ "div",
1228
+ {
1229
+ "data-univer-comp-sheets-filter-panel-conditions-desc": !0,
1230
+ className: "univer-mt-2 univer-text-xs univer-text-gray-500",
1231
+ children: [
1232
+ r.t("sheets-filter.panel.?"),
1233
+ /* @__PURE__ */ S("br", {}),
1234
+ r.t("sheets-filter.panel.*")
1235
+ ]
1236
+ }
1237
+ )
1238
+ ]
1239
+ }
1240
+ ) : null
1218
1241
  ] })
1219
- ] }) : null
1220
- ] }) });
1242
+ }
1243
+ );
1221
1244
  }
1222
- function Ps(t) {
1245
+ function ui(t) {
1223
1246
  const e = t.getCurrentLocale();
1224
- return Je(
1225
- () => [
1226
- {
1227
- options: [
1228
- { label: t.t(m.NONE.label), value: m.NONE.operator }
1229
- ]
1230
- },
1231
- {
1232
- options: [
1233
- { label: t.t(m.EMPTY.label), value: m.EMPTY.operator },
1234
- { label: t.t(m.NOT_EMPTY.label), value: m.NOT_EMPTY.operator }
1235
- ]
1236
- },
1237
- {
1238
- options: [
1239
- { label: t.t(m.TEXT_CONTAINS.label), value: m.TEXT_CONTAINS.operator },
1240
- { label: t.t(m.DOES_NOT_CONTAIN.label), value: m.DOES_NOT_CONTAIN.operator },
1241
- { label: t.t(m.STARTS_WITH.label), value: m.STARTS_WITH.operator },
1242
- { label: t.t(m.ENDS_WITH.label), value: m.ENDS_WITH.operator },
1243
- { label: t.t(m.EQUALS.label), value: m.EQUALS.operator }
1244
- ]
1245
- },
1246
- {
1247
- options: [
1248
- { label: t.t(m.GREATER_THAN.label), value: m.GREATER_THAN.operator },
1249
- { label: t.t(m.GREATER_THAN_OR_EQUAL.label), value: m.GREATER_THAN_OR_EQUAL.operator },
1250
- { label: t.t(m.LESS_THAN.label), value: m.LESS_THAN.operator },
1251
- { label: t.t(m.LESS_THAN_OR_EQUAL.label), value: m.LESS_THAN_OR_EQUAL.operator },
1252
- { label: t.t(m.EQUAL.label), value: m.EQUAL.operator },
1253
- { label: t.t(m.NOT_EQUAL.label), value: m.NOT_EQUAL.operator },
1254
- { label: t.t(m.BETWEEN.label), value: m.BETWEEN.operator },
1255
- { label: t.t(m.NOT_BETWEEN.label), value: m.NOT_BETWEEN.operator }
1256
- ]
1257
- },
1258
- {
1259
- options: [
1260
- { label: t.t(m.CUSTOM.label), value: m.CUSTOM.operator }
1261
- ]
1262
- }
1263
- ],
1264
- // eslint-disable-next-line react-hooks/exhaustive-deps
1265
- [e, t]
1266
- );
1247
+ return ze(() => [
1248
+ {
1249
+ options: [
1250
+ { label: t.t(d.NONE.label), value: d.NONE.operator }
1251
+ ]
1252
+ },
1253
+ {
1254
+ options: [
1255
+ { label: t.t(d.EMPTY.label), value: d.EMPTY.operator },
1256
+ { label: t.t(d.NOT_EMPTY.label), value: d.NOT_EMPTY.operator }
1257
+ ]
1258
+ },
1259
+ {
1260
+ options: [
1261
+ { label: t.t(d.TEXT_CONTAINS.label), value: d.TEXT_CONTAINS.operator },
1262
+ { label: t.t(d.DOES_NOT_CONTAIN.label), value: d.DOES_NOT_CONTAIN.operator },
1263
+ { label: t.t(d.STARTS_WITH.label), value: d.STARTS_WITH.operator },
1264
+ { label: t.t(d.ENDS_WITH.label), value: d.ENDS_WITH.operator },
1265
+ { label: t.t(d.EQUALS.label), value: d.EQUALS.operator }
1266
+ ]
1267
+ },
1268
+ {
1269
+ options: [
1270
+ { label: t.t(d.GREATER_THAN.label), value: d.GREATER_THAN.operator },
1271
+ { label: t.t(d.GREATER_THAN_OR_EQUAL.label), value: d.GREATER_THAN_OR_EQUAL.operator },
1272
+ { label: t.t(d.LESS_THAN.label), value: d.LESS_THAN.operator },
1273
+ { label: t.t(d.LESS_THAN_OR_EQUAL.label), value: d.LESS_THAN_OR_EQUAL.operator },
1274
+ { label: t.t(d.EQUAL.label), value: d.EQUAL.operator },
1275
+ { label: t.t(d.NOT_EQUAL.label), value: d.NOT_EQUAL.operator },
1276
+ { label: t.t(d.BETWEEN.label), value: d.BETWEEN.operator },
1277
+ { label: t.t(d.NOT_BETWEEN.label), value: d.NOT_BETWEEN.operator }
1278
+ ]
1279
+ },
1280
+ {
1281
+ options: [
1282
+ { label: t.t(d.CUSTOM.label), value: d.CUSTOM.operator }
1283
+ ]
1284
+ }
1285
+ ], [e, t]);
1267
1286
  }
1268
- function Os(t) {
1287
+ function hi(t) {
1269
1288
  const e = t.getCurrentLocale();
1270
- return Je(
1271
- () => m.ALL_CONDITIONS.filter((r) => r.numOfParameters !== 2).map((r) => ({ label: t.t(r.label), value: r.operator })),
1272
- // eslint-disable-next-line react-hooks/exhaustive-deps
1273
- [e, t]
1274
- );
1289
+ return ze(() => d.ALL_CONDITIONS.filter((r) => r.numOfParameters !== 2).map((r) => ({ label: t.t(r.label), value: r.operator })), [e, t]);
1275
1290
  }
1276
- function ys(t) {
1277
- const { model: e } = t, r = re(X), i = W(e.searchString$, "", !0), n = W(e.filterItems$, void 0, !0), l = r.t("sheets-filter.panel.filter-only"), s = Ve(n), o = s.checked > 0 && s.unchecked === 0, a = s.checked > 0 && s.unchecked > 0, c = e.treeMapCache, h = k(() => {
1291
+ function di(t) {
1292
+ 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(() => {
1278
1293
  e.onCheckAllToggled(!o);
1279
- }, [e, o]), d = k((p) => {
1294
+ }, [e, o]), m = D((p) => {
1280
1295
  e.setSearchString(p);
1281
1296
  }, [e]);
1282
- function v(p) {
1297
+ function g(p) {
1283
1298
  let T = [];
1284
- return p.forEach((g) => {
1285
- g.checked && T.push(g.key), g.children && (T = T.concat(v(g.children)));
1299
+ return p.forEach((v) => {
1300
+ v.checked && T.push(v.key), v.children && (T = T.concat(g(v.children)));
1286
1301
  }), T;
1287
1302
  }
1288
- return /* @__PURE__ */ L("div", { className: y.sheetsFilterPanelValuesContainer, children: [
1289
- /* @__PURE__ */ S(
1290
- Rt,
1291
- {
1292
- autoFocus: !0,
1293
- value: i,
1294
- placeholder: r.t("sheets-filter.panel.search-placeholder"),
1295
- onChange: d
1296
- }
1297
- ),
1298
- /* @__PURE__ */ L(
1299
- "div",
1300
- {
1301
- className: `
1303
+ return /* @__PURE__ */ b(
1304
+ "div",
1305
+ {
1306
+ "data-univer-comp-sheets-filter-panel-values-container": !0,
1307
+ className: "univer-flex univer-h-full univer-flex-col",
1308
+ children: [
1309
+ /* @__PURE__ */ S(
1310
+ It,
1311
+ {
1312
+ autoFocus: !0,
1313
+ value: s,
1314
+ placeholder: r.t("sheets-filter.panel.search-placeholder"),
1315
+ onChange: m
1316
+ }
1317
+ ),
1318
+ /* @__PURE__ */ b(
1319
+ "div",
1320
+ {
1321
+ "data-univer-comp-sheets-filter-panel": !0,
1322
+ className: `
1302
1323
  univer-mt-2 univer-box-border univer-flex univer-flex-grow univer-flex-col univer-overflow-hidden
1303
1324
  univer-rounded-md univer-border univer-border-solid univer-border-gray-200 univer-px-2 univer-py-2.5
1304
1325
  `,
1305
- children: [
1306
- /* @__PURE__ */ S("div", { className: y.sheetsFilterPanelValuesItem, children: /* @__PURE__ */ L("div", { className: y.sheetsFilterPanelValuesItemInner, children: [
1307
- /* @__PURE__ */ S(
1308
- Gr,
1309
- {
1310
- indeterminate: a,
1311
- disabled: n.length === 0,
1312
- checked: o,
1313
- onChange: h
1314
- }
1315
- ),
1316
- /* @__PURE__ */ S("span", { className: y.sheetsFilterPanelValuesItemText, children: `${r.t("sheets-filter.panel.select-all")}` }),
1317
- /* @__PURE__ */ S("span", { className: y.sheetsFilterPanelValuesItemCount, children: `(${s.checked}/${s.checked + s.unchecked})` })
1318
- ] }) }),
1319
- /* @__PURE__ */ S("div", { className: y.sheetsFilterPanelValuesVirtual, children: /* @__PURE__ */ S(
1320
- jr,
1321
- {
1322
- data: n,
1323
- defaultExpandAll: !1,
1324
- valueGroup: v(n),
1325
- height: 180,
1326
- onChange: (p) => {
1327
- e.onFilterCheckToggled(p);
1328
- },
1329
- defaultCache: c,
1330
- itemHeight: 28,
1331
- treeNodeClassName: `
1326
+ children: [
1327
+ /* @__PURE__ */ S(
1328
+ "div",
1329
+ {
1330
+ "data-univer-comp-sheets-filter-panel-values-item": !0,
1331
+ className: "univer-box-border univer-h-8 univer-w-full univer-py-0.5",
1332
+ children: /* @__PURE__ */ b(
1333
+ "div",
1334
+ {
1335
+ "data-univer-comp-sheets-filter-panel-values-item-inner": !0,
1336
+ className: `
1337
+ univer-box-border univer-flex univer-h-7 univer-items-center univer-rounded-md univer-pb-0
1338
+ univer-pl-5 univer-pr-0.5 univer-pt-0 univer-text-[13px]
1339
+ `,
1340
+ children: [
1341
+ /* @__PURE__ */ S(
1342
+ Vr,
1343
+ {
1344
+ indeterminate: a,
1345
+ disabled: n.length === 0,
1346
+ checked: o,
1347
+ onChange: h
1348
+ }
1349
+ ),
1350
+ /* @__PURE__ */ S(
1351
+ "span",
1352
+ {
1353
+ "data-univer-comp-sheets-filter-panel-values-item-text": !0,
1354
+ className: `
1355
+ univer-mx-1 univer-inline-block univer-flex-shrink univer-overflow-hidden
1356
+ univer-text-ellipsis univer-whitespace-nowrap univer-text-gray-950
1357
+ dark:univer-text-white
1358
+ `,
1359
+ children: `${r.t("sheets-filter.panel.select-all")}`
1360
+ }
1361
+ ),
1362
+ /* @__PURE__ */ S(
1363
+ "span",
1364
+ {
1365
+ "data-univer-comp-sheets-filter-panel-values-item-count": !0,
1366
+ className: `
1367
+ univer-text-gray-400
1368
+ dark:univer-text-gray-500
1369
+ `,
1370
+ children: `(${i.checked}/${i.checked + i.unchecked})`
1371
+ }
1372
+ )
1373
+ ]
1374
+ }
1375
+ )
1376
+ }
1377
+ ),
1378
+ /* @__PURE__ */ S("div", { "data-univer-comp-sheets-filter-panel-values-virtual": !0, className: "univer-flex-grow", children: /* @__PURE__ */ S(
1379
+ Gr,
1380
+ {
1381
+ data: n,
1382
+ defaultExpandAll: !1,
1383
+ valueGroup: g(n),
1384
+ height: 180,
1385
+ onChange: (p) => {
1386
+ e.onFilterCheckToggled(p);
1387
+ },
1388
+ defaultCache: c,
1389
+ itemHeight: 28,
1390
+ treeNodeClassName: `
1332
1391
  univer-pr-2 univer-border-box univer-max-w-[245px] univer-rounded-md
1333
1392
  [&:hover_a]:univer-inline-block
1334
1393
  hover:univer-bg-gray-50 univer-h-full
1394
+ univer-text-gray-950
1395
+ dark:univer-text-white
1335
1396
  `,
1336
- attachRender: (p) => /* @__PURE__ */ L(
1337
- "div",
1338
- {
1339
- className: `
1397
+ attachRender: (p) => /* @__PURE__ */ b(
1398
+ "div",
1399
+ {
1400
+ className: `
1340
1401
  univer-ml-1 univer-flex univer-h-5 univer-flex-1 univer-cursor-pointer
1341
1402
  univer-items-center univer-justify-between univer-text-[13px] univer-text-primary-500
1342
1403
  `,
1343
- children: [
1344
- /* @__PURE__ */ S("span", { className: y.sheetsFilterPanelValuesItemCount, children: `(${p.count})` }),
1345
- /* @__PURE__ */ S(
1346
- "a",
1347
- {
1348
- className: `
1404
+ children: [
1405
+ /* @__PURE__ */ S(
1406
+ "span",
1407
+ {
1408
+ "data-univer-comp-sheets-filter-panel-values-item-count": !0,
1409
+ className: `
1410
+ univer-text-gray-400
1411
+ dark:univer-text-gray-500
1412
+ `,
1413
+ children: `(${p.count})`
1414
+ }
1415
+ ),
1416
+ /* @__PURE__ */ S(
1417
+ "a",
1418
+ {
1419
+ className: `
1349
1420
  univer-box-border univer-hidden univer-h-4 univer-whitespace-nowrap univer-px-1.5
1350
1421
  `,
1351
- onClick: () => {
1352
- const T = [];
1353
- p.children ? p.children.forEach((g) => {
1354
- g.children ? g.children.forEach((N) => {
1355
- T.push(N.key);
1356
- }) : T.push(g.key);
1357
- }) : T.push(p.key), e.onFilterOnly(T);
1358
- },
1359
- children: l
1360
- }
1361
- )
1362
- ]
1422
+ onClick: () => {
1423
+ const T = [];
1424
+ p.children ? p.children.forEach((v) => {
1425
+ v.children ? v.children.forEach((C) => {
1426
+ T.push(C.key);
1427
+ }) : T.push(v.key);
1428
+ }) : T.push(p.key), e.onFilterOnly(T);
1429
+ },
1430
+ children: l
1431
+ }
1432
+ )
1433
+ ]
1434
+ }
1435
+ )
1363
1436
  }
1364
- )
1365
- }
1366
- ) })
1367
- ]
1368
- }
1369
- )
1370
- ] });
1437
+ ) })
1438
+ ]
1439
+ }
1440
+ )
1441
+ ]
1442
+ }
1443
+ );
1371
1444
  }
1372
- function Is() {
1373
- var N;
1374
- const t = re(x), e = re(X), r = re(Q), i = W(t.filterBy$, void 0, !0), n = W(t.filterByModel$, void 0, !1), l = W(() => (n == null ? void 0 : n.canApply$) || _e(!1), void 0, !1, [n]), s = Rs(e), o = !W(t.hasCriteria$), a = k((F) => {
1375
- r.executeCommand(Ht.id, { filterBy: F });
1376
- }, [r]), c = k(async () => {
1377
- await (n == null ? void 0 : n.clear()), r.executeCommand(me.id);
1378
- }, [n, r]), h = k(() => {
1379
- r.executeCommand(me.id);
1380
- }, [r]), d = k(async () => {
1381
- await (n == null ? void 0 : n.apply()), r.executeCommand(me.id);
1382
- }, [n, r]), p = (N = re(G).activeFilterModel) == null ? void 0 : N.getRange(), T = t.col, g = gr(Or.FILTER_PANEL_EMBED_POINT);
1383
- return /* @__PURE__ */ L("div", { className: y.sheetsFilterPanel, children: [
1384
- /* @__PURE__ */ S(
1385
- vr,
1386
- {
1387
- components: g,
1388
- sharedProps: { range: p, colIndex: T, onClose: h }
1389
- }
1390
- ),
1391
- /* @__PURE__ */ S("div", { className: y.sheetsFilterPanelHeader, children: /* @__PURE__ */ S(
1392
- Yr,
1393
- {
1394
- value: i,
1395
- items: s,
1396
- onChange: (F) => a(F)
1397
- }
1398
- ) }),
1399
- n ? /* @__PURE__ */ S("div", { className: y.sheetsFilterPanelContent, children: i === Oe.VALUES ? /* @__PURE__ */ S(ys, { model: n }) : /* @__PURE__ */ S(Ns, { model: n }) }) : /* @__PURE__ */ S("div", { style: { flex: 1 } }),
1400
- /* @__PURE__ */ L("div", { className: y.sheetsFilterPanelFooter, children: [
1401
- /* @__PURE__ */ S(He, { variant: "link", onClick: c, disabled: o, children: e.t("sheets-filter.panel.clear-filter") }),
1402
- /* @__PURE__ */ L("span", { className: y.sheetsFilterPanelFooterPrimaryButtons, children: [
1403
- /* @__PURE__ */ S(He, { variant: "default", onClick: h, children: e.t("sheets-filter.panel.cancel") }),
1404
- /* @__PURE__ */ S(He, { disabled: !l, variant: "primary", onClick: d, children: e.t("sheets-filter.panel.confirm") })
1405
- ] })
1406
- ] })
1407
- ] });
1445
+ function mi() {
1446
+ var C;
1447
+ 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 = pi(e), o = !B(t.hasCriteria$), a = D((N) => {
1448
+ r.executeCommand(Ut.id, { filterBy: N });
1449
+ }, [r]), c = D(async () => {
1450
+ await (n == null ? void 0 : n.clear()), r.executeCommand(he.id);
1451
+ }, [n, r]), h = D(() => {
1452
+ r.executeCommand(he.id);
1453
+ }, [r]), m = D(async () => {
1454
+ await (n == null ? void 0 : n.apply()), r.executeCommand(he.id);
1455
+ }, [n, r]), p = (C = te(V).activeFilterModel) == null ? void 0 : C.getRange(), T = t.col, v = _r(yr.FILTER_PANEL_EMBED_POINT);
1456
+ return /* @__PURE__ */ b(
1457
+ "div",
1458
+ {
1459
+ "data-u-comp": "sheets-filter-panel",
1460
+ className: `
1461
+ univer-box-border univer-flex univer-h-[432px] univer-w-[312px] univer-flex-col univer-rounded-lg
1462
+ univer-bg-white univer-p-4 univer-shadow-lg
1463
+ dark:univer-border-gray-600 dark:univer-bg-gray-700
1464
+ `,
1465
+ children: [
1466
+ /* @__PURE__ */ S(
1467
+ vr,
1468
+ {
1469
+ components: v,
1470
+ sharedProps: { range: p, colIndex: T, onClose: h }
1471
+ }
1472
+ ),
1473
+ /* @__PURE__ */ S("div", { className: "univer-mb-1 univer-flex-shrink-0 univer-flex-grow-0", children: /* @__PURE__ */ S(
1474
+ jr,
1475
+ {
1476
+ value: s,
1477
+ items: i,
1478
+ onChange: (N) => a(N)
1479
+ }
1480
+ ) }),
1481
+ n ? /* @__PURE__ */ S(
1482
+ "div",
1483
+ {
1484
+ "data-u-comp": "sheets-filter-panel-content",
1485
+ className: "univer-flex-shrink univer-flex-grow univer-pt-2",
1486
+ children: s === ye.VALUES ? /* @__PURE__ */ S(di, { model: n }) : /* @__PURE__ */ S(ci, { model: n })
1487
+ }
1488
+ ) : /* @__PURE__ */ S("div", { style: { flex: 1 } }),
1489
+ /* @__PURE__ */ b(
1490
+ "div",
1491
+ {
1492
+ "data-u-comp": "sheets-filter-panel-footer",
1493
+ className: `
1494
+ univer-mt-4 univer-inline-flex univer-flex-shrink-0 univer-flex-grow-0 univer-flex-nowrap
1495
+ univer-justify-between univer-overflow-hidden
1496
+ `,
1497
+ children: [
1498
+ /* @__PURE__ */ S(Ue, { variant: "link", onClick: c, disabled: o, children: e.t("sheets-filter.panel.clear-filter") }),
1499
+ /* @__PURE__ */ b("span", { className: "univer-space-x-2", children: [
1500
+ /* @__PURE__ */ S(Ue, { variant: "default", onClick: h, children: e.t("sheets-filter.panel.cancel") }),
1501
+ /* @__PURE__ */ S(Ue, { disabled: !l, variant: "primary", onClick: m, children: e.t("sheets-filter.panel.confirm") })
1502
+ ] })
1503
+ ]
1504
+ }
1505
+ )
1506
+ ]
1507
+ }
1508
+ );
1408
1509
  }
1409
- function Rs(t) {
1510
+ function pi(t) {
1410
1511
  const e = t.getCurrentLocale();
1411
- return Je(() => [
1412
- { label: t.t("sheets-filter.panel.by-values"), value: Oe.VALUES },
1413
- { label: t.t("sheets-filter.panel.by-conditions"), value: Oe.CONDITIONS }
1512
+ return ze(() => [
1513
+ { label: t.t("sheets-filter.panel.by-values"), value: ye.VALUES },
1514
+ { label: t.t("sheets-filter.panel.by-conditions"), value: ye.CONDITIONS }
1414
1515
  ], [e, t]);
1415
1516
  }
1416
- function As(t) {
1417
- const e = t.get(G);
1517
+ function fi(t) {
1518
+ const e = t.get(V);
1418
1519
  return {
1419
- id: fe.id,
1420
- type: Ze.BUTTON_SELECTOR,
1520
+ id: pe.id,
1521
+ type: Xe.BUTTON_SELECTOR,
1421
1522
  icon: "FilterSingle",
1422
1523
  tooltip: "sheets-filter.toolbar.smart-toggle-filter-tooltip",
1423
- hidden$: Xe(t, z.UNIVER_SHEET),
1524
+ hidden$: Ke(t, Z.UNIVER_SHEET),
1424
1525
  activated$: e.activeFilterModel$.pipe(ie((r) => !!r)),
1425
- disabled$: yr(t, Ir(t, { worksheetTypes: [le, ce], rangeTypes: [ue] }))
1526
+ disabled$: Or(t, Rr(t, { worksheetTypes: [ae, le], rangeTypes: [ce] }))
1426
1527
  };
1427
1528
  }
1428
- function bs(t) {
1429
- const e = t.get(G);
1529
+ function _i(t) {
1530
+ const e = t.get(V);
1430
1531
  return {
1431
- id: Ke.id,
1432
- type: Ze.BUTTON,
1532
+ id: qe.id,
1533
+ type: Xe.BUTTON,
1433
1534
  title: "sheets-filter.toolbar.clear-filter-criteria",
1434
- hidden$: Xe(t, z.UNIVER_SHEET),
1435
- disabled$: e.activeFilterModel$.pipe(ze((r) => {
1436
- var i;
1437
- return (i = r == null ? void 0 : r.hasCriteria$.pipe(ie((n) => !n))) != null ? i : _e(!0);
1535
+ hidden$: Ke(t, Z.UNIVER_SHEET),
1536
+ disabled$: e.activeFilterModel$.pipe(Ze((r) => {
1537
+ var s;
1538
+ return (s = r == null ? void 0 : r.hasCriteria$.pipe(ie((n) => !n))) != null ? s : fe(!0);
1438
1539
  }))
1439
1540
  };
1440
1541
  }
1441
- function Ls(t) {
1442
- const e = t.get(G);
1542
+ function vi(t) {
1543
+ const e = t.get(V);
1443
1544
  return {
1444
- id: qe.id,
1445
- type: Ze.BUTTON,
1545
+ id: Ye.id,
1546
+ type: Xe.BUTTON,
1446
1547
  title: "sheets-filter.toolbar.re-calc-filter-conditions",
1447
- hidden$: Xe(t, z.UNIVER_SHEET),
1448
- disabled$: e.activeFilterModel$.pipe(ze((r) => {
1449
- var i;
1450
- return (i = r == null ? void 0 : r.hasCriteria$.pipe(ie((n) => !n))) != null ? i : _e(!0);
1548
+ hidden$: Ke(t, Z.UNIVER_SHEET),
1549
+ disabled$: e.activeFilterModel$.pipe(Ze((r) => {
1550
+ var s;
1551
+ return (s = r == null ? void 0 : r.hasCriteria$.pipe(ie((n) => !n))) != null ? s : fe(!0);
1451
1552
  }))
1452
1553
  };
1453
1554
  }
1454
- const Ms = {
1455
- [Sr.FORMULAS_INSERT]: {
1456
- [fe.id]: {
1555
+ const gi = {
1556
+ [gr.FORMULAS_INSERT]: {
1557
+ [pe.id]: {
1457
1558
  order: 10,
1458
- menuItemFactory: As,
1459
- [Ke.id]: {
1559
+ menuItemFactory: fi,
1560
+ [qe.id]: {
1460
1561
  order: 0,
1461
- menuItemFactory: bs
1562
+ menuItemFactory: _i
1462
1563
  },
1463
- [qe.id]: {
1564
+ [Ye.id]: {
1464
1565
  order: 1,
1465
- menuItemFactory: Ls
1566
+ menuItemFactory: vi
1466
1567
  }
1467
1568
  }
1468
1569
  }
1469
- }, V = 16, $s = 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");
1470
- class ht {
1471
- static drawNoCriteria(e, r, i, n) {
1472
- e.save(), lt.drawWith(e, {
1570
+ }, x = 16, Si = 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");
1571
+ class ut {
1572
+ static drawNoCriteria(e, r, s, n) {
1573
+ e.save(), at.drawWith(e, {
1473
1574
  radius: 2,
1474
- width: V,
1475
- height: V,
1575
+ width: x,
1576
+ height: x,
1476
1577
  fill: n
1477
- }), e.lineCap = "square", e.strokeStyle = i, e.scale(r / V, r / V), 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();
1578
+ }), 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();
1478
1579
  }
1479
- static drawHasCriteria(e, r, i, n) {
1480
- e.save(), lt.drawWith(e, {
1580
+ static drawHasCriteria(e, r, s, n) {
1581
+ e.save(), at.drawWith(e, {
1481
1582
  radius: 2,
1482
- width: V,
1483
- height: V,
1583
+ width: x,
1584
+ height: x,
1484
1585
  fill: n
1485
- }), e.scale(r / V, r / V), e.fillStyle = i, e.fill($s), e.restore();
1586
+ }), e.scale(r / x, r / x), e.fillStyle = s, e.fill(Si), e.restore();
1486
1587
  }
1487
1588
  }
1488
- var ws = Object.getOwnPropertyDescriptor, Us = (t, e, r, i) => {
1489
- for (var n = i > 1 ? void 0 : i ? ws(e, r) : e, l = t.length - 1, s; l >= 0; l--)
1490
- (s = t[l]) && (n = s(n) || n);
1589
+ var Ei = Object.getOwnPropertyDescriptor, Ti = (t, e, r, s) => {
1590
+ for (var n = s > 1 ? void 0 : s ? Ei(e, r) : e, l = t.length - 1, i; l >= 0; l--)
1591
+ (i = t[l]) && (n = i(n) || n);
1491
1592
  return n;
1492
- }, ke = (t, e) => (r, i) => e(r, i, t);
1493
- const D = 16, Ee = 1;
1494
- let Qe = class extends Kr {
1495
- constructor(e, r, i, n, l) {
1593
+ }, De = (t, e) => (r, s) => e(r, s, t);
1594
+ const H = 16, Se = 1;
1595
+ let Qe = class extends qr {
1596
+ constructor(e, r, s, n, l) {
1496
1597
  super(e, r);
1497
1598
  f(this, "_cellWidth", 0);
1498
1599
  f(this, "_cellHeight", 0);
1499
1600
  f(this, "_filterParams");
1500
1601
  f(this, "_hovered", !1);
1501
- this._contextService = i, this._commandService = n, this._themeService = l, this.setShapeProps(r), this.onPointerDown$.subscribeEvent((s) => this.onPointerDown(s)), this.onPointerEnter$.subscribeEvent(() => this.onPointerEnter()), this.onPointerLeave$.subscribeEvent(() => this.onPointerLeave());
1602
+ 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());
1502
1603
  }
1503
1604
  setShapeProps(e) {
1504
1605
  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({
@@ -1507,20 +1608,20 @@ let Qe = class extends Kr {
1507
1608
  });
1508
1609
  }
1509
1610
  _draw(e) {
1510
- const r = this._cellHeight, i = this._cellWidth, n = D - i, l = D - r;
1611
+ const r = this._cellHeight, s = this._cellWidth, n = H - s, l = H - r;
1511
1612
  e.save();
1512
- const s = new Path2D();
1513
- s.rect(n, l, i, r), e.clip(s);
1514
- const { hasCriteria: o } = this._filterParams, a = this._themeService.getCurrentTheme().primaryColor, c = this._hovered ? this._themeService.getCurrentTheme().grey50 : "rgba(255, 255, 255, 1.0)";
1515
- o ? ht.drawHasCriteria(e, D, a, c) : ht.drawNoCriteria(e, D, a, c), e.restore();
1613
+ const i = new Path2D();
1614
+ i.rect(n, l, s, r), e.clip(i);
1615
+ 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)";
1616
+ o ? ut.drawHasCriteria(e, H, a, c) : ut.drawNoCriteria(e, H, a, c), e.restore();
1516
1617
  }
1517
1618
  onPointerDown(e) {
1518
1619
  if (e.button === 2)
1519
1620
  return;
1520
- const { col: r, unitId: i, subUnitId: n } = this._filterParams;
1521
- this._contextService.getContextValue(ne) || !this._commandService.hasCommand(Re.id) || setTimeout(() => {
1522
- this._commandService.executeCommand(Re.id, {
1523
- unitId: i,
1621
+ const { col: r, unitId: s, subUnitId: n } = this._filterParams;
1622
+ this._contextService.getContextValue(se) || !this._commandService.hasCommand(Ie.id) || setTimeout(() => {
1623
+ this._commandService.executeCommand(Ie.id, {
1624
+ unitId: s,
1524
1625
  subUnitId: n,
1525
1626
  col: r
1526
1627
  });
@@ -1533,62 +1634,62 @@ let Qe = class extends Kr {
1533
1634
  this._hovered = !1, this.makeDirty(!0);
1534
1635
  }
1535
1636
  };
1536
- Qe = Us([
1537
- ke(2, $e),
1538
- ke(3, Q),
1539
- ke(4, E(St))
1637
+ Qe = Ti([
1638
+ De(2, Me),
1639
+ De(3, Q),
1640
+ De(4, E(gt))
1540
1641
  ], Qe);
1541
- var Hs = Object.getOwnPropertyDescriptor, Ds = (t, e, r, i) => {
1542
- for (var n = i > 1 ? void 0 : i ? Hs(e, r) : e, l = t.length - 1, s; l >= 0; l--)
1543
- (s = t[l]) && (n = s(n) || n);
1642
+ var Ni = Object.getOwnPropertyDescriptor, Fi = (t, e, r, s) => {
1643
+ for (var n = s > 1 ? void 0 : s ? Ni(e, r) : e, l = t.length - 1, i; l >= 0; l--)
1644
+ (i = t[l]) && (n = i(n) || n);
1544
1645
  return n;
1545
- }, q = (t, e) => (r, i) => e(r, i, t);
1546
- const ks = 1e3, Bs = 5e3;
1547
- let Ge = class extends Et {
1548
- constructor(e, r, i, n, l, s, o, a) {
1646
+ }, Y = (t, e) => (r, s) => e(r, s, t);
1647
+ const Ci = 1e3, yi = 5e3;
1648
+ let Ve = class extends St {
1649
+ constructor(e, r, s, n, l, i, o, a) {
1549
1650
  super();
1550
1651
  f(this, "_filterRangeShape", null);
1551
1652
  f(this, "_buttonRenderDisposable", null);
1552
1653
  f(this, "_filterButtonShapes", []);
1553
- this._context = e, this._injector = r, this._sheetSkeletonManagerService = i, this._sheetsFilterService = n, this._themeService = l, this._sheetInterceptorService = s, this._commandService = o, this._selectionRenderService = a, this._initRenderer();
1654
+ 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();
1554
1655
  }
1555
1656
  dispose() {
1556
1657
  super.dispose(), this._disposeRendering();
1557
1658
  }
1558
1659
  _initRenderer() {
1559
1660
  this._sheetSkeletonManagerService.currentSkeleton$.pipe(
1560
- ze((e) => {
1661
+ Ze((e) => {
1561
1662
  var o, a;
1562
- if (!e) return _e(null);
1563
- const { unit: r, unitId: i } = this._context, n = ((o = r.getActiveSheet()) == null ? void 0 : o.getSheetId()) || "", l = (a = this._sheetsFilterService.getFilterModel(i, n)) != null ? a : void 0, s = () => ({
1564
- unitId: i,
1663
+ if (!e) return fe(null);
1664
+ 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 = () => ({
1665
+ unitId: s,
1565
1666
  worksheetId: n,
1566
1667
  filterModel: l,
1567
1668
  range: l == null ? void 0 : l.getRange(),
1568
1669
  skeleton: e.skeleton
1569
1670
  });
1570
- return Xt(this._commandService.onCommandExecuted.bind(this._commandService)).pipe(
1571
- Vr(
1671
+ return Kt(this._commandService.onCommandExecuted.bind(this._commandService)).pipe(
1672
+ xr(
1572
1673
  ([c]) => {
1573
1674
  var h;
1574
- return c.type === Me.MUTATION && ((h = c.params) == null ? void 0 : h.unitId) === r.getUnitId() && (tr.has(c.id) || c.id === pr.id);
1675
+ return c.type === Le.MUTATION && ((h = c.params) == null ? void 0 : h.unitId) === r.getUnitId() && (er.has(c.id) || c.id === mr.id);
1575
1676
  }
1576
1677
  ),
1577
- yt(20, void 0, { leading: !1, trailing: !0 }),
1578
- ie(s),
1579
- It(s())
1678
+ Ot(20, void 0, { leading: !1, trailing: !0 }),
1679
+ ie(i),
1680
+ Rt(i())
1580
1681
  // must trigger once
1581
1682
  );
1582
1683
  }),
1583
- Wr(this.dispose$)
1684
+ Br(this.dispose$)
1584
1685
  ).subscribe((e) => {
1585
1686
  this._disposeRendering(), !(!e || !e.range) && (this._renderRange(e.range, e.skeleton), this._renderButtons(e));
1586
1687
  });
1587
1688
  }
1588
1689
  _renderRange(e, r) {
1589
- const { scene: i } = this._context, { rowHeaderWidth: n, columnHeaderHeight: l } = r, s = this._filterRangeShape = new br(
1590
- i,
1591
- ks,
1690
+ const { scene: s } = this._context, { rowHeaderWidth: n, columnHeaderHeight: l } = r, i = this._filterRangeShape = new Pr(
1691
+ s,
1692
+ Ci,
1592
1693
  this._themeService,
1593
1694
  {
1594
1695
  rowHeaderWidth: n,
@@ -1596,46 +1697,46 @@ let Ge = class extends Et {
1596
1697
  enableAutoFill: !1,
1597
1698
  highlightHeader: !1
1598
1699
  }
1599
- ), a = Lr({
1700
+ ), a = br({
1600
1701
  range: e,
1601
1702
  primary: null,
1602
1703
  style: { fill: "rgba(0, 0, 0, 0.0)" }
1603
1704
  }, r);
1604
- s.updateRangeBySelectionWithCoord(a), s.setEvent(!1), i.makeDirty(!0);
1705
+ i.updateRangeBySelectionWithCoord(a), i.setEvent(!1), s.makeDirty(!0);
1605
1706
  }
1606
1707
  _renderButtons(e) {
1607
- const { range: r, filterModel: i, unitId: n, skeleton: l, worksheetId: s } = e, { scene: o } = this._context;
1608
- this._interceptCellContent(n, s, e.range);
1708
+ const { range: r, filterModel: s, unitId: n, skeleton: l, worksheetId: i } = e, { scene: o } = this._context;
1709
+ this._interceptCellContent(n, i, e.range);
1609
1710
  const { startColumn: a, endColumn: c, startRow: h } = r;
1610
- for (let d = a; d <= c; d++) {
1611
- const v = `sheets-filter-button-${d}`, p = Mr(h, d, o, l), { startX: T, startY: g, endX: N, endY: F } = p, I = N - T, O = F - g;
1612
- if (O <= Ee || I <= Ee)
1711
+ for (let m = a; m <= c; m++) {
1712
+ const g = `sheets-filter-button-${m}`, p = Lr(h, m, o, l), { startX: T, startY: v, endX: C, endY: N } = p, R = C - T, O = N - v;
1713
+ if (O <= Se || R <= Se)
1613
1714
  continue;
1614
- const $ = !!i.getFilterColumn(d), w = N - D - Ee, ge = F - D - Ee, ve = {
1715
+ const M = !!s.getFilterColumn(m), w = C - H - Se, _e = N - H - Se, ve = {
1615
1716
  left: w,
1616
- top: ge,
1617
- height: D,
1618
- width: D,
1619
- zIndex: Bs,
1717
+ top: _e,
1718
+ height: H,
1719
+ width: H,
1720
+ zIndex: yi,
1620
1721
  cellHeight: O,
1621
- cellWidth: I,
1622
- filterParams: { unitId: n, subUnitId: s, col: d, hasCriteria: $ }
1623
- }, R = this._injector.createInstance(Qe, v, ve);
1624
- this._filterButtonShapes.push(R);
1722
+ cellWidth: R,
1723
+ filterParams: { unitId: n, subUnitId: i, col: m, hasCriteria: M }
1724
+ }, I = this._injector.createInstance(Qe, g, ve);
1725
+ this._filterButtonShapes.push(I);
1625
1726
  }
1626
1727
  o.addObjects(this._filterButtonShapes), o.makeDirty();
1627
1728
  }
1628
- _interceptCellContent(e, r, i) {
1629
- const { startRow: n, startColumn: l, endColumn: s } = i;
1630
- this._buttonRenderDisposable = this._sheetInterceptorService.intercept(fr.CELL_CONTENT, {
1631
- effect: Zt.Style,
1729
+ _interceptCellContent(e, r, s) {
1730
+ const { startRow: n, startColumn: l, endColumn: i } = s;
1731
+ this._buttonRenderDisposable = this._sheetInterceptorService.intercept(pr.CELL_CONTENT, {
1732
+ effect: Xt.Style,
1632
1733
  handler: (o, a, c) => {
1633
- const { row: h, col: d, unitId: v, subUnitId: p } = a;
1634
- return v !== e || p !== r || h !== n || d < l || d > s ? c(o) : c({
1734
+ const { row: h, col: m, unitId: g, subUnitId: p } = a;
1735
+ return g !== e || p !== r || h !== n || m < l || m > i ? c(o) : c({
1635
1736
  ...o,
1636
1737
  fontRenderExtension: {
1637
1738
  ...o == null ? void 0 : o.fontRenderExtension,
1638
- rightOffset: D
1739
+ rightOffset: H
1639
1740
  }
1640
1741
  });
1641
1742
  },
@@ -1644,93 +1745,93 @@ let Ge = class extends Et {
1644
1745
  }
1645
1746
  _disposeRendering() {
1646
1747
  var e, r;
1647
- (e = this._filterRangeShape) == null || e.dispose(), this._filterButtonShapes.forEach((i) => i.dispose()), (r = this._buttonRenderDisposable) == null || r.dispose(), this._filterRangeShape = null, this._buttonRenderDisposable = null, this._filterButtonShapes = [];
1748
+ (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 = [];
1648
1749
  }
1649
1750
  };
1650
- Ge = Ds([
1651
- q(1, E(Z)),
1652
- q(2, E(Rr)),
1653
- q(3, E(G)),
1654
- q(4, E(St)),
1655
- q(5, E(dr)),
1656
- q(6, Q),
1657
- q(7, Ar)
1658
- ], Ge);
1659
- var Vs = Object.getOwnPropertyDescriptor, Ws = (t, e, r, i) => {
1660
- for (var n = i > 1 ? void 0 : i ? Vs(e, r) : e, l = t.length - 1, s; l >= 0; l--)
1661
- (s = t[l]) && (n = s(n) || n);
1751
+ Ve = Fi([
1752
+ Y(1, E(X)),
1753
+ Y(2, E(Ir)),
1754
+ Y(3, E(V)),
1755
+ Y(4, E(gt)),
1756
+ Y(5, E(dr)),
1757
+ Y(6, Q),
1758
+ Y(7, Ar)
1759
+ ], Ve);
1760
+ var Oi = Object.getOwnPropertyDescriptor, Ri = (t, e, r, s) => {
1761
+ for (var n = s > 1 ? void 0 : s ? Oi(e, r) : e, l = t.length - 1, i; l >= 0; l--)
1762
+ (i = t[l]) && (n = i(n) || n);
1662
1763
  return n;
1663
- }, mt = (t, e) => (r, i) => e(r, i, t);
1664
- let de = class extends Et {
1764
+ }, ht = (t, e) => (r, s) => e(r, s, t);
1765
+ let de = class extends St {
1665
1766
  constructor(t, e) {
1666
1767
  super(), this._renderManagerService = t, this._sheetsRenderService = e, [
1768
+ tr,
1667
1769
  rr,
1668
- sr,
1669
1770
  ir,
1670
- nr
1771
+ sr
1671
1772
  ].forEach((r) => this.disposeWithMe(this._sheetsRenderService.registerSkeletonChangingMutations(r.id))), this.disposeWithMe(this._renderManagerService.registerRenderModule(
1672
- z.UNIVER_SHEET,
1673
- [Ge]
1773
+ Z.UNIVER_SHEET,
1774
+ [Ve]
1674
1775
  ));
1675
1776
  }
1676
1777
  };
1677
- de = Ws([
1678
- mt(0, At),
1679
- mt(1, E(Ot))
1778
+ de = Ri([
1779
+ ht(0, At),
1780
+ ht(1, E(yt))
1680
1781
  ], de);
1681
- const xs = {
1682
- id: fe.id,
1683
- binding: Er.L | nt.CTRL_COMMAND | nt.SHIFT,
1782
+ const Ii = {
1783
+ id: pe.id,
1784
+ binding: Sr.L | st.CTRL_COMMAND | st.SHIFT,
1684
1785
  description: "sheets-filter.shortcut.smart-toggle-filter",
1685
- preconditions: $r,
1786
+ preconditions: Mr,
1686
1787
  group: "4_sheet-edit"
1687
1788
  };
1688
- var Qs = Object.getOwnPropertyDescriptor, Gs = (t, e, r, i) => {
1689
- for (var n = i > 1 ? void 0 : i ? Qs(e, r) : e, l = t.length - 1, s; l >= 0; l--)
1690
- (s = t[l]) && (n = s(n) || n);
1789
+ var Ai = Object.getOwnPropertyDescriptor, Pi = (t, e, r, s) => {
1790
+ for (var n = s > 1 ? void 0 : s ? Ai(e, r) : e, l = t.length - 1, i; l >= 0; l--)
1791
+ (i = t[l]) && (n = i(n) || n);
1691
1792
  return n;
1692
- }, A = (t, e) => (r, i) => e(r, i, t);
1793
+ }, A = (t, e) => (r, s) => e(r, s, t);
1693
1794
  const dt = "FILTER_PANEL_POPUP";
1694
1795
  let Ae = class extends de {
1695
- constructor(e, r, i, n, l, s, o, a, c, h, d, v, p) {
1696
- super(p, v);
1796
+ constructor(e, r, s, n, l, i, o, a, c, h, m, g, p) {
1797
+ super(p, g);
1697
1798
  f(this, "_popupDisposable");
1698
- this._injector = e, this._componentManager = r, this._sheetsFilterPanelService = i, this._sheetCanvasPopupService = n, this._sheetsFilterService = l, this._localeService = s, this._shortcutService = o, this._commandService = a, this._menuManagerService = c, this._contextService = h, this._messageService = d, this._initCommands(), this._initShortcuts(), this._initMenuItems(), this._initUI();
1799
+ this._injector = e, this._componentManager = r, this._sheetsFilterPanelService = s, this._sheetCanvasPopupService = n, this._sheetsFilterService = l, this._localeService = i, this._shortcutService = o, this._commandService = a, this._menuManagerService = c, this._contextService = h, this._messageService = m, this._initCommands(), this._initShortcuts(), this._initMenuItems(), this._initUI();
1699
1800
  }
1700
1801
  dispose() {
1701
1802
  super.dispose(), this._closeFilterPopup();
1702
1803
  }
1703
1804
  _initShortcuts() {
1704
1805
  [
1705
- xs
1806
+ Ii
1706
1807
  ].forEach((e) => {
1707
1808
  this.disposeWithMe(this._shortcutService.registerShortcut(e));
1708
1809
  });
1709
1810
  }
1710
1811
  _initCommands() {
1711
1812
  [
1712
- fe,
1813
+ pe,
1814
+ nr,
1713
1815
  or,
1714
- ar,
1715
- se,
1716
- Ke,
1816
+ re,
1717
1817
  qe,
1718
- Ht,
1719
- Re,
1720
- me
1818
+ Ye,
1819
+ Ut,
1820
+ Ie,
1821
+ he
1721
1822
  ].forEach((e) => {
1722
1823
  this.disposeWithMe(this._commandService.registerCommand(e));
1723
1824
  });
1724
1825
  }
1725
1826
  _initMenuItems() {
1726
- this._menuManagerService.mergeMenu(Ms);
1827
+ this._menuManagerService.mergeMenu(gi);
1727
1828
  }
1728
1829
  _initUI() {
1729
- this.disposeWithMe(this._componentManager.register(dt, Is)), this.disposeWithMe(this._componentManager.register("FilterSingle", Bt)), this.disposeWithMe(this._contextService.subscribeContextValue$(ne).pipe(xr()).subscribe((e) => {
1830
+ this.disposeWithMe(this._componentManager.register(dt, mi)), this.disposeWithMe(this._componentManager.register("FilterSingle", kt)), this.disposeWithMe(this._contextService.subscribeContextValue$(se).pipe(Wr()).subscribe((e) => {
1730
1831
  e ? this._openFilterPopup() : this._closeFilterPopup();
1731
1832
  })), this.disposeWithMe(this._sheetsFilterService.errorMsg$.subscribe((e) => {
1732
1833
  e && this._messageService.show({
1733
- type: qr.Error,
1834
+ type: Yr.Error,
1734
1835
  content: this._localeService.t(e)
1735
1836
  });
1736
1837
  }));
@@ -1739,11 +1840,11 @@ let Ae = class extends de {
1739
1840
  const e = this._sheetsFilterPanelService.filterModel;
1740
1841
  if (!e)
1741
1842
  throw new Error("[SheetsFilterUIController]: no filter model when opening filter popup!");
1742
- const r = e.getRange(), i = this._sheetsFilterPanelService.col, { startRow: n } = r;
1743
- this._popupDisposable = this._sheetCanvasPopupService.attachPopupToCell(n, i, {
1843
+ const r = e.getRange(), s = this._sheetsFilterPanelService.col, { startRow: n } = r;
1844
+ this._popupDisposable = this._sheetCanvasPopupService.attachPopupToCell(n, s, {
1744
1845
  componentKey: dt,
1745
1846
  direction: "horizontal",
1746
- onClickOutside: () => this._commandService.syncExecuteCommand(me.id),
1847
+ onClickOutside: () => this._commandService.syncExecuteCommand(he.id),
1747
1848
  offset: [5, 0]
1748
1849
  });
1749
1850
  }
@@ -1752,129 +1853,129 @@ let Ae = class extends de {
1752
1853
  (e = this._popupDisposable) == null || e.dispose(), this._popupDisposable = null;
1753
1854
  }
1754
1855
  };
1755
- Ae = Gs([
1756
- A(0, E(Z)),
1757
- A(1, E(Tr)),
1758
- A(2, E(x)),
1856
+ Ae = Pi([
1857
+ A(0, E(X)),
1858
+ A(1, E(Er)),
1859
+ A(2, E(W)),
1759
1860
  A(3, E(wr)),
1760
- A(4, E(G)),
1761
- A(5, E(X)),
1762
- A(6, Fr),
1861
+ A(4, E(V)),
1862
+ A(5, E(K)),
1863
+ A(6, Tr),
1763
1864
  A(7, Q),
1764
- A(8, Cr),
1765
- A(9, $e),
1766
- A(10, Nr),
1767
- A(11, E(Ot)),
1865
+ A(8, Nr),
1866
+ A(9, Me),
1867
+ A(10, Fr),
1868
+ A(11, E(yt)),
1768
1869
  A(12, At)
1769
1870
  ], Ae);
1770
- var js = Object.defineProperty, Ys = Object.getOwnPropertyDescriptor, qs = (t, e, r) => e in t ? js(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Ks = (t, e, r, i) => {
1771
- for (var n = i > 1 ? void 0 : i ? Ys(e, r) : e, l = t.length - 1, s; l >= 0; l--)
1772
- (s = t[l]) && (n = s(n) || n);
1871
+ var bi = Object.defineProperty, Li = Object.getOwnPropertyDescriptor, Mi = (t, e, r) => e in t ? bi(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, wi = (t, e, r, s) => {
1872
+ for (var n = s > 1 ? void 0 : s ? Li(e, r) : e, l = t.length - 1, i; l >= 0; l--)
1873
+ (i = t[l]) && (n = i(n) || n);
1773
1874
  return n;
1774
- }, Be = (t, e) => (r, i) => e(r, i, t), Vt = (t, e, r) => qs(t, typeof e != "symbol" ? e + "" : e, r);
1775
- const Xs = "SHEET_FILTER_UI_PLUGIN";
1776
- let be = class extends Ye {
1777
- constructor(t = Ce, e, r, i) {
1778
- super(), this._config = t, this._injector = e, this._configService = r, this._rpcChannelService = i;
1779
- const { menu: n, ...l } = Ct(
1875
+ }, ke = (t, e) => (r, s) => e(r, s, t), xt = (t, e, r) => Mi(t, typeof e != "symbol" ? e + "" : e, r);
1876
+ const $i = "SHEET_FILTER_UI_PLUGIN";
1877
+ let Pe = class extends je {
1878
+ constructor(t = Ne, e, r, s) {
1879
+ super(), this._config = t, this._injector = e, this._configService = r, this._rpcChannelService = s;
1880
+ const { menu: n, ...l } = Nt(
1780
1881
  {},
1781
- Ce,
1882
+ Ne,
1782
1883
  this._config
1783
1884
  );
1784
- n && this._configService.setConfig("menu", n, { merge: !0 }), this._configService.setConfig(Mt, l);
1885
+ n && this._configService.setConfig("menu", n, { merge: !0 }), this._configService.setConfig(Lt, l);
1785
1886
  }
1786
1887
  onStarting() {
1787
1888
  [
1788
- [x],
1789
- [oe],
1889
+ [W],
1890
+ [ne],
1790
1891
  [Ae]
1791
- ].forEach((t) => this._injector.add(t)), this._config.useRemoteFilterValuesGenerator && this._rpcChannelService && this._injector.add([Ne, {
1792
- useFactory: () => Jt(
1793
- this._rpcChannelService.requestChannel(et)
1892
+ ].forEach((t) => this._injector.add(t)), this._config.useRemoteFilterValuesGenerator && this._rpcChannelService && this._injector.add([Fe, {
1893
+ useFactory: () => zt(
1894
+ this._rpcChannelService.requestChannel(Je)
1794
1895
  )
1795
1896
  }]);
1796
1897
  }
1797
1898
  onReady() {
1798
- this._injector.get(oe);
1899
+ this._injector.get(ne);
1799
1900
  }
1800
1901
  onRendered() {
1801
1902
  this._injector.get(Ae);
1802
1903
  }
1803
1904
  };
1804
- Vt(be, "type", z.UNIVER_SHEET);
1805
- Vt(be, "pluginName", Xs);
1806
- be = Ks([
1807
- Tt(Pt),
1808
- Be(1, E(Z)),
1809
- Be(2, Ft),
1810
- Be(3, zt(Nt))
1811
- ], be);
1812
- var Zs = Object.defineProperty, zs = Object.getOwnPropertyDescriptor, Js = (t, e, r) => e in t ? Zs(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, ei = (t, e, r, i) => {
1813
- for (var n = i > 1 ? void 0 : i ? zs(e, r) : e, l = t.length - 1, s; l >= 0; l--)
1814
- (s = t[l]) && (n = s(n) || n);
1905
+ xt(Pe, "type", Z.UNIVER_SHEET);
1906
+ xt(Pe, "pluginName", $i);
1907
+ Pe = wi([
1908
+ Et(Ct),
1909
+ ke(1, E(X)),
1910
+ ke(2, Tt),
1911
+ ke(3, Zt(Ft))
1912
+ ], Pe);
1913
+ var Ui = Object.defineProperty, Hi = Object.getOwnPropertyDescriptor, Di = (t, e, r) => e in t ? Ui(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, ki = (t, e, r, s) => {
1914
+ for (var n = s > 1 ? void 0 : s ? Hi(e, r) : e, l = t.length - 1, i; l >= 0; l--)
1915
+ (i = t[l]) && (n = i(n) || n);
1815
1916
  return n;
1816
- }, pt = (t, e) => (r, i) => e(r, i, t), Wt = (t, e, r) => Js(t, typeof e != "symbol" ? e + "" : e, r);
1817
- const ti = "SHEET_FILTER_UI_PLUGIN";
1818
- let Le = class extends Ye {
1819
- constructor(t = Ce, e, r) {
1917
+ }, mt = (t, e) => (r, s) => e(r, s, t), Bt = (t, e, r) => Di(t, typeof e != "symbol" ? e + "" : e, r);
1918
+ const xi = "SHEET_FILTER_UI_PLUGIN";
1919
+ let be = class extends je {
1920
+ constructor(t = Ne, e, r) {
1820
1921
  super(), this._config = t, this._injector = e, this._configService = r;
1821
- const { menu: i, ...n } = Ct(
1922
+ const { menu: s, ...n } = Nt(
1822
1923
  {},
1823
- Ce,
1924
+ Ne,
1824
1925
  this._config
1825
1926
  );
1826
- i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(Mt, n);
1927
+ s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(Lt, n);
1827
1928
  }
1828
1929
  onStarting() {
1829
1930
  [
1830
- [oe],
1931
+ [ne],
1831
1932
  [de]
1832
1933
  ].forEach((t) => this._injector.add(t));
1833
1934
  }
1834
1935
  onReady() {
1835
- this._injector.get(oe);
1936
+ this._injector.get(ne);
1836
1937
  }
1837
1938
  onRendered() {
1838
1939
  this._injector.get(de);
1839
1940
  }
1840
1941
  };
1841
- Wt(Le, "type", z.UNIVER_SHEET);
1842
- Wt(Le, "pluginName", ti);
1843
- Le = ei([
1844
- Tt(Pt),
1845
- pt(1, E(Z)),
1846
- pt(2, Ft)
1847
- ], Le);
1848
- var ri = Object.getOwnPropertyDescriptor, si = (t, e, r, i) => {
1849
- for (var n = i > 1 ? void 0 : i ? ri(e, r) : e, l = t.length - 1, s; l >= 0; l--)
1850
- (s = t[l]) && (n = s(n) || n);
1942
+ Bt(be, "type", Z.UNIVER_SHEET);
1943
+ Bt(be, "pluginName", xi);
1944
+ be = ki([
1945
+ Et(Ct),
1946
+ mt(1, E(X)),
1947
+ mt(2, Tt)
1948
+ ], be);
1949
+ var Bi = Object.getOwnPropertyDescriptor, Wi = (t, e, r, s) => {
1950
+ for (var n = s > 1 ? void 0 : s ? Bi(e, r) : e, l = t.length - 1, i; l >= 0; l--)
1951
+ (i = t[l]) && (n = i(n) || n);
1851
1952
  return n;
1852
- }, ft = (t, e) => (r, i) => e(r, i, t), Te;
1853
- let _t = (Te = class extends Ye {
1953
+ }, pt = (t, e) => (r, s) => e(r, s, t), Ee;
1954
+ let ft = (Ee = class extends je {
1854
1955
  constructor(t, e, r) {
1855
1956
  super(), this._config = t, this._injector = e, this._rpcChannelService = r;
1856
1957
  }
1857
1958
  onStarting() {
1858
1959
  [
1859
- [Ne, { useClass: We }]
1960
+ [Fe, { useClass: Be }]
1860
1961
  ].forEach((t) => this._injector.add(t));
1861
1962
  }
1862
1963
  onReady() {
1863
1964
  this._rpcChannelService.registerChannel(
1864
- et,
1865
- er(this._injector.get(Ne))
1965
+ Je,
1966
+ Jt(this._injector.get(Fe))
1866
1967
  );
1867
1968
  }
1868
- }, f(Te, "type", z.UNIVER_SHEET), f(Te, "pluginName", "SHEET_FILTER_UI_WORKER_PLUGIN"), Te);
1869
- _t = si([
1870
- ft(1, E(Z)),
1871
- ft(2, Nt)
1872
- ], _t);
1969
+ }, f(Ee, "type", Z.UNIVER_SHEET), f(Ee, "pluginName", "SHEET_FILTER_UI_WORKER_PLUGIN"), Ee);
1970
+ ft = Wi([
1971
+ pt(1, E(X)),
1972
+ pt(2, Ft)
1973
+ ], ft);
1873
1974
  export {
1874
- Ht as ChangeFilterByOperation,
1875
- me as CloseFilterPanelOperation,
1876
- Re as OpenFilterPanelOperation,
1877
- Le as UniverSheetsFilterMobileUIPlugin,
1878
- be as UniverSheetsFilterUIPlugin,
1879
- _t as UniverSheetsFilterUIWorkerPlugin
1975
+ Ut as ChangeFilterByOperation,
1976
+ he as CloseFilterPanelOperation,
1977
+ Ie as OpenFilterPanelOperation,
1978
+ be as UniverSheetsFilterMobileUIPlugin,
1979
+ Pe as UniverSheetsFilterUIPlugin,
1980
+ ft as UniverSheetsFilterUIWorkerPlugin
1880
1981
  };