@univerjs/sheets-filter-ui 0.5.0 → 0.5.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/cjs/index.js +2 -2
- package/lib/cjs/locale/fr-FR.js +1 -0
- package/lib/es/index.js +589 -582
- package/lib/es/locale/fr-FR.js +70 -0
- package/lib/types/controllers/config.schema.d.ts +1 -1
- package/lib/types/filter-ui-mobile.plugin.d.ts +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/locale/fr-FR.d.ts +3 -0
- package/lib/umd/index.js +2 -2
- package/lib/umd/locale/fr-FR.js +1 -0
- package/package.json +17 -15
package/lib/es/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var _ = (t, e, r) =>
|
|
4
|
-
import { BooleanNumber as
|
|
5
|
-
import { IRPCChannelService as
|
|
6
|
-
import { CustomFilterOperator as u, SetSheetsFilterCriteriaCommand as
|
|
7
|
-
import { RefRangeService as
|
|
8
|
-
import { SetCellEditVisibleOperation as
|
|
9
|
-
import { ILayoutService as yr, useObservable as
|
|
10
|
-
import { BehaviorSubject as
|
|
11
|
-
import { Select as
|
|
12
|
-
import { Rect as
|
|
13
|
-
import
|
|
14
|
-
const
|
|
15
|
-
var
|
|
1
|
+
var qt = Object.defineProperty;
|
|
2
|
+
var Kt = (t, e, r) => e in t ? qt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var _ = (t, e, r) => Kt(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { BooleanNumber as st, createIdentifier as vt, Inject as E, LocaleService as K, Disposable as de, IUniverInstanceService as Ge, ILogService as Xt, extractPureTextFromCell as Zt, numfmt as nt, Injector as X, ICommandService as W, Quantity as St, Tools as Fe, CommandType as Me, IContextService as $e, useDependency as te, UniverInstanceType as Z, ThemeService as gt, RxDisposable as Et, fromCallback as Jt, InterceptorEffectEnum as zt, DependentOn as Tt, Optional as er, Plugin as Ye, IConfigService as Ft } from "@univerjs/core";
|
|
5
|
+
import { IRPCChannelService as Ct, toModule as tr, fromModule as rr } from "@univerjs/rpc";
|
|
6
|
+
import { CustomFilterOperator as u, SetSheetsFilterCriteriaCommand as re, SheetsFilterService as Q, SmartToggleSheetsFilterCommand as fe, ClearSheetsFilterCriteriaCommand as qe, ReCalcSheetsFilterCommand as Ke, FILTER_MUTATIONS as sr, SetSheetsFilterRangeMutation as nr, SetSheetsFilterCriteriaMutation as ir, RemoveSheetsFilterMutation as or, ReCalcSheetsFilterMutation as ar, RemoveSheetFilterCommand as lr, SetSheetFilterRangeCommand as cr, UniverSheetsFilterPlugin as Nt } from "@univerjs/sheets-filter";
|
|
7
|
+
import { RefRangeService as ur, SheetsSelectionsService as hr, getSheetCommandTarget as pr, RangeProtectionPermissionViewPoint as le, WorksheetFilterPermission as ce, WorksheetViewPermission as ue, expandToContinuousRange as mr, SheetInterceptorService as dr, SetRangeValuesMutation as fr, INTERCEPTOR_POINT as _r } from "@univerjs/sheets";
|
|
8
|
+
import { SetCellEditVisibleOperation as vr, SheetPermissionInterceptorBaseController as Sr, SheetsUIPart as gr, getObservableWithExclusiveRange$ as Er, getCurrentRangeDisable$ as Tr, whenSheetEditorFocused as Fr, SheetSkeletonManagerService as Cr, ISheetSelectionRenderService as Nr, SelectionControl as Pr, attachSelectionWithCoord as Or, getCoordByCell as Ir, SheetsRenderService as Pt, SheetCanvasPopManagerService as Rr } from "@univerjs/sheets-ui";
|
|
9
|
+
import { ILayoutService as yr, useObservable as V, useComponentsOfPart as Ar, ComponentContainer as br, MenuItemType as Xe, getMenuHiddenObservable as Ze, RibbonStartGroup as Lr, KeyCode as Mr, MetaKeys as it, ComponentManager as $r, IShortcutService as wr, IMenuManagerService as Ur, IMessageService as Hr } from "@univerjs/ui";
|
|
10
|
+
import { BehaviorSubject as q, ReplaySubject as Dr, of as _e, Subject as xr, merge as Br, combineLatest as Vr, throttleTime as Ot, startWith as It, map as se, shareReplay as jr, switchMap as Je, filter as Wr, takeUntil as Qr, distinctUntilChanged as kr } from "rxjs";
|
|
11
|
+
import { Select as ot, RadioGroup as Gr, Radio as at, Input as Rt, Checkbox as Yr, Tree as qr, Button as Ce, Segmented as Kr, MessageType as Xr } from "@univerjs/design";
|
|
12
|
+
import { Rect as lt, Shape as Zr, IRenderManagerService as yt } from "@univerjs/engine-render";
|
|
13
|
+
import Jr, { forwardRef as At, useRef as zr, createElement as bt, useCallback as D, useMemo as ze } from "react";
|
|
14
|
+
const Lt = "sheets-filter-ui.config", Mt = {};
|
|
15
|
+
var N = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SECOND", t))(N || {}), v = /* @__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))(v || {}), m;
|
|
16
16
|
((t) => {
|
|
17
17
|
t.NONE = {
|
|
18
18
|
label: "sheets-filter.conditions.none",
|
|
19
19
|
operator: v.NONE,
|
|
20
|
-
order:
|
|
20
|
+
order: N.SECOND,
|
|
21
21
|
numOfParameters: 0,
|
|
22
22
|
getDefaultFormParams: () => {
|
|
23
23
|
throw new Error("[FilterConditionItems.NONE]: should not have initial form params!");
|
|
@@ -28,7 +28,7 @@ var O = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
28
28
|
}, t.EMPTY = {
|
|
29
29
|
label: "sheets-filter.conditions.empty",
|
|
30
30
|
operator: v.EMPTY,
|
|
31
|
-
order:
|
|
31
|
+
order: N.SECOND,
|
|
32
32
|
numOfParameters: 0,
|
|
33
33
|
getDefaultFormParams: () => {
|
|
34
34
|
throw new Error("[FilterConditionItems.EMPTY]: should not have initial form params!");
|
|
@@ -45,7 +45,7 @@ var O = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
45
45
|
}, t.NOT_EMPTY = {
|
|
46
46
|
label: "sheets-filter.conditions.not-empty",
|
|
47
47
|
operator: v.NOT_EMPTY,
|
|
48
|
-
order:
|
|
48
|
+
order: N.SECOND,
|
|
49
49
|
numOfParameters: 0,
|
|
50
50
|
getDefaultFormParams: () => {
|
|
51
51
|
throw new Error("[FilterConditionItems.NOT_EMPTY]: should not have initial form params!");
|
|
@@ -62,11 +62,11 @@ var O = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
62
62
|
}, t.TEXT_CONTAINS = {
|
|
63
63
|
label: "sheets-filter.conditions.text-contains",
|
|
64
64
|
operator: v.CONTAINS,
|
|
65
|
-
order:
|
|
65
|
+
order: N.FIRST,
|
|
66
66
|
numOfParameters: 1,
|
|
67
67
|
getDefaultFormParams: () => ({ operator1: v.CONTAINS, val1: "" }),
|
|
68
68
|
testMappingParams: (s) => {
|
|
69
|
-
const [o] =
|
|
69
|
+
const [o] = L(s);
|
|
70
70
|
return o === v.CONTAINS;
|
|
71
71
|
},
|
|
72
72
|
mapToFilterColumn: (s) => {
|
|
@@ -85,14 +85,14 @@ var O = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
85
85
|
}, t.DOES_NOT_CONTAIN = {
|
|
86
86
|
label: "sheets-filter.conditions.does-not-contain",
|
|
87
87
|
operator: v.DOES_NOT_CONTAIN,
|
|
88
|
-
order:
|
|
88
|
+
order: N.FIRST,
|
|
89
89
|
numOfParameters: 1,
|
|
90
90
|
getDefaultFormParams: () => ({ operator1: v.DOES_NOT_CONTAIN, val1: "" }),
|
|
91
91
|
mapToFilterColumn: (s) => ({
|
|
92
92
|
customFilters: { customFilters: [{ val: `*${s.val1}*`, operator: u.NOT_EQUALS }] }
|
|
93
93
|
}),
|
|
94
94
|
testMappingParams: (s) => {
|
|
95
|
-
const [o] =
|
|
95
|
+
const [o] = L(s);
|
|
96
96
|
return o === v.DOES_NOT_CONTAIN;
|
|
97
97
|
},
|
|
98
98
|
testMappingFilterColumn: (s) => {
|
|
@@ -105,14 +105,14 @@ var O = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
105
105
|
}, t.STARTS_WITH = {
|
|
106
106
|
label: "sheets-filter.conditions.starts-with",
|
|
107
107
|
operator: v.STARTS_WITH,
|
|
108
|
-
order:
|
|
108
|
+
order: N.FIRST,
|
|
109
109
|
numOfParameters: 1,
|
|
110
110
|
getDefaultFormParams: () => ({ operator1: v.STARTS_WITH, val1: "" }),
|
|
111
111
|
mapToFilterColumn: (s) => ({
|
|
112
112
|
customFilters: { customFilters: [{ val: `${s.val1}*` }] }
|
|
113
113
|
}),
|
|
114
114
|
testMappingParams: (s) => {
|
|
115
|
-
const [o] =
|
|
115
|
+
const [o] = L(s);
|
|
116
116
|
return o === v.STARTS_WITH;
|
|
117
117
|
},
|
|
118
118
|
testMappingFilterColumn: (s) => {
|
|
@@ -125,14 +125,14 @@ var O = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
125
125
|
}, t.ENDS_WITH = {
|
|
126
126
|
label: "sheets-filter.conditions.ends-with",
|
|
127
127
|
operator: v.ENDS_WITH,
|
|
128
|
-
order:
|
|
128
|
+
order: N.FIRST,
|
|
129
129
|
numOfParameters: 1,
|
|
130
130
|
getDefaultFormParams: () => ({ operator1: v.ENDS_WITH, val1: "" }),
|
|
131
131
|
mapToFilterColumn: (s) => ({
|
|
132
132
|
customFilters: { customFilters: [{ val: `*${s.val1}` }] }
|
|
133
133
|
}),
|
|
134
134
|
testMappingParams: (s) => {
|
|
135
|
-
const [o] =
|
|
135
|
+
const [o] = L(s);
|
|
136
136
|
return o === v.ENDS_WITH;
|
|
137
137
|
},
|
|
138
138
|
testMappingFilterColumn: (s) => {
|
|
@@ -145,11 +145,11 @@ var O = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
145
145
|
}, t.EQUALS = {
|
|
146
146
|
label: "sheets-filter.conditions.equals",
|
|
147
147
|
operator: v.EQUALS,
|
|
148
|
-
order:
|
|
148
|
+
order: N.FIRST,
|
|
149
149
|
numOfParameters: 1,
|
|
150
150
|
getDefaultFormParams: () => ({ operator1: v.EQUALS, val1: "" }),
|
|
151
151
|
testMappingParams: (s) => {
|
|
152
|
-
const [o] =
|
|
152
|
+
const [o] = L(s);
|
|
153
153
|
return o === v.EQUALS;
|
|
154
154
|
},
|
|
155
155
|
mapToFilterColumn: (s) => {
|
|
@@ -166,13 +166,13 @@ var O = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
166
166
|
label: "sheets-filter.conditions.greater-than",
|
|
167
167
|
operator: u.GREATER_THAN,
|
|
168
168
|
numOfParameters: 1,
|
|
169
|
-
order:
|
|
169
|
+
order: N.FIRST,
|
|
170
170
|
getDefaultFormParams: () => ({ operator1: u.GREATER_THAN, val1: "" }),
|
|
171
171
|
mapToFilterColumn: (s) => ({
|
|
172
172
|
customFilters: { customFilters: [{ val: s.val1, operator: u.GREATER_THAN }] }
|
|
173
173
|
}),
|
|
174
174
|
testMappingParams: (s) => {
|
|
175
|
-
const [o] =
|
|
175
|
+
const [o] = L(s);
|
|
176
176
|
return o === u.GREATER_THAN;
|
|
177
177
|
},
|
|
178
178
|
testMappingFilterColumn: (s) => {
|
|
@@ -186,10 +186,10 @@ var O = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
186
186
|
label: "sheets-filter.conditions.greater-than-or-equal",
|
|
187
187
|
operator: u.GREATER_THAN_OR_EQUAL,
|
|
188
188
|
numOfParameters: 1,
|
|
189
|
-
order:
|
|
189
|
+
order: N.FIRST,
|
|
190
190
|
getDefaultFormParams: () => ({ operator1: u.GREATER_THAN_OR_EQUAL, val1: "" }),
|
|
191
191
|
testMappingParams: (s) => {
|
|
192
|
-
const [o] =
|
|
192
|
+
const [o] = L(s);
|
|
193
193
|
return o === u.GREATER_THAN_OR_EQUAL;
|
|
194
194
|
},
|
|
195
195
|
mapToFilterColumn: (s) => ({
|
|
@@ -206,10 +206,10 @@ var O = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
206
206
|
label: "sheets-filter.conditions.less-than",
|
|
207
207
|
operator: u.LESS_THAN,
|
|
208
208
|
numOfParameters: 1,
|
|
209
|
-
order:
|
|
209
|
+
order: N.FIRST,
|
|
210
210
|
getDefaultFormParams: () => ({ operator1: u.LESS_THAN, val1: "" }),
|
|
211
211
|
testMappingParams: (s) => {
|
|
212
|
-
const [o] =
|
|
212
|
+
const [o] = L(s);
|
|
213
213
|
return o === u.LESS_THAN;
|
|
214
214
|
},
|
|
215
215
|
mapToFilterColumn: (s) => ({
|
|
@@ -226,10 +226,10 @@ var O = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
226
226
|
label: "sheets-filter.conditions.less-than-or-equal",
|
|
227
227
|
operator: u.LESS_THAN_OR_EQUAL,
|
|
228
228
|
numOfParameters: 1,
|
|
229
|
-
order:
|
|
229
|
+
order: N.FIRST,
|
|
230
230
|
getDefaultFormParams: () => ({ operator1: u.LESS_THAN_OR_EQUAL, val1: "" }),
|
|
231
231
|
testMappingParams: (s) => {
|
|
232
|
-
const [o] =
|
|
232
|
+
const [o] = L(s);
|
|
233
233
|
return o === u.LESS_THAN_OR_EQUAL;
|
|
234
234
|
},
|
|
235
235
|
mapToFilterColumn: (s) => ({
|
|
@@ -246,10 +246,10 @@ var O = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
246
246
|
label: "sheets-filter.conditions.equal",
|
|
247
247
|
operator: u.EQUAL,
|
|
248
248
|
numOfParameters: 1,
|
|
249
|
-
order:
|
|
249
|
+
order: N.FIRST,
|
|
250
250
|
getDefaultFormParams: () => ({ operator1: u.EQUAL, val1: "" }),
|
|
251
251
|
testMappingParams: (s) => {
|
|
252
|
-
const [o] =
|
|
252
|
+
const [o] = L(s);
|
|
253
253
|
return o === u.EQUAL;
|
|
254
254
|
},
|
|
255
255
|
mapToFilterColumn: (s) => ({
|
|
@@ -266,10 +266,10 @@ var O = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
266
266
|
label: "sheets-filter.conditions.not-equal",
|
|
267
267
|
operator: u.NOT_EQUALS,
|
|
268
268
|
numOfParameters: 1,
|
|
269
|
-
order:
|
|
269
|
+
order: N.FIRST,
|
|
270
270
|
getDefaultFormParams: () => ({ operator1: u.NOT_EQUALS, val1: "" }),
|
|
271
271
|
testMappingParams: (s) => {
|
|
272
|
-
const [o] =
|
|
272
|
+
const [o] = L(s);
|
|
273
273
|
return o === u.NOT_EQUALS;
|
|
274
274
|
},
|
|
275
275
|
mapToFilterColumn: (s) => ({
|
|
@@ -285,7 +285,7 @@ var O = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
285
285
|
}, t.BETWEEN = {
|
|
286
286
|
label: "sheets-filter.conditions.between",
|
|
287
287
|
operator: v.BETWEEN,
|
|
288
|
-
order:
|
|
288
|
+
order: N.SECOND,
|
|
289
289
|
numOfParameters: 2,
|
|
290
290
|
getDefaultFormParams: () => ({
|
|
291
291
|
and: !0,
|
|
@@ -304,7 +304,7 @@ var O = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
304
304
|
const { val1: o, val2: a, operator1: c } = s, h = c === u.GREATER_THAN_OR_EQUAL;
|
|
305
305
|
return {
|
|
306
306
|
customFilters: {
|
|
307
|
-
and:
|
|
307
|
+
and: st.TRUE,
|
|
308
308
|
customFilters: [
|
|
309
309
|
{ val: h ? o : a, operator: u.GREATER_THAN_OR_EQUAL },
|
|
310
310
|
{ val: h ? a : o, operator: u.LESS_THAN_OR_EQUAL }
|
|
@@ -334,7 +334,7 @@ var O = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
334
334
|
}, t.NOT_BETWEEN = {
|
|
335
335
|
label: "sheets-filter.conditions.not-between",
|
|
336
336
|
operator: v.NOT_BETWEEN,
|
|
337
|
-
order:
|
|
337
|
+
order: N.SECOND,
|
|
338
338
|
numOfParameters: 2,
|
|
339
339
|
getDefaultFormParams: () => ({
|
|
340
340
|
operator1: u.LESS_THAN,
|
|
@@ -379,7 +379,7 @@ var O = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
379
379
|
}, t.CUSTOM = {
|
|
380
380
|
label: "sheets-filter.conditions.custom",
|
|
381
381
|
operator: v.CUSTOM,
|
|
382
|
-
order:
|
|
382
|
+
order: N.SECOND,
|
|
383
383
|
numOfParameters: 2,
|
|
384
384
|
getDefaultFormParams: () => ({
|
|
385
385
|
operator1: v.NONE,
|
|
@@ -389,26 +389,26 @@ var O = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
389
389
|
}),
|
|
390
390
|
testMappingParams: () => !0,
|
|
391
391
|
mapToFilterColumn: (s) => {
|
|
392
|
-
const { and: o, val1: a, val2: c, operator1: h, operator2:
|
|
393
|
-
function S(R,
|
|
394
|
-
for (const
|
|
395
|
-
if (
|
|
396
|
-
return
|
|
392
|
+
const { and: o, val1: a, val2: c, operator1: h, operator2: p } = s;
|
|
393
|
+
function S(R, I) {
|
|
394
|
+
for (const M of t.ALL_CONDITIONS)
|
|
395
|
+
if (M.operator === R)
|
|
396
|
+
return M.mapToFilterColumn({ val1: I, operator1: R });
|
|
397
397
|
}
|
|
398
|
-
const f = !h || h === t.NONE.operator,
|
|
399
|
-
if (f &&
|
|
398
|
+
const f = !h || h === t.NONE.operator, T = !p || p === t.NONE.operator;
|
|
399
|
+
if (f && T)
|
|
400
400
|
return t.NONE.mapToFilterColumn({});
|
|
401
401
|
if (f)
|
|
402
|
-
return S(
|
|
403
|
-
if (
|
|
402
|
+
return S(p, c);
|
|
403
|
+
if (T)
|
|
404
404
|
return S(h, a);
|
|
405
|
-
const
|
|
405
|
+
const g = S(h, a), P = S(p, c), F = {
|
|
406
406
|
customFilters: [
|
|
407
|
-
|
|
408
|
-
|
|
407
|
+
g.customFilters.customFilters[0],
|
|
408
|
+
P.customFilters.customFilters[0]
|
|
409
409
|
]
|
|
410
410
|
};
|
|
411
|
-
return o && (
|
|
411
|
+
return o && (F.and = st.TRUE), { customFilters: F };
|
|
412
412
|
},
|
|
413
413
|
testMappingFilterColumn: (s) => {
|
|
414
414
|
var c;
|
|
@@ -483,8 +483,8 @@ var O = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
483
483
|
return [t.NONE, {}];
|
|
484
484
|
}
|
|
485
485
|
t.testMappingFilterColumn = l;
|
|
486
|
-
})(
|
|
487
|
-
function
|
|
486
|
+
})(m || (m = {}));
|
|
487
|
+
function L(t) {
|
|
488
488
|
const { operator1: e, operator2: r, val1: n, val2: i } = t;
|
|
489
489
|
if (e && r)
|
|
490
490
|
throw new Error("Both operator1 and operator2 are set!");
|
|
@@ -492,7 +492,7 @@ function $(t) {
|
|
|
492
492
|
throw new Error("Neither operator1 and operator2 and both not set!");
|
|
493
493
|
return e ? [e, n] : [r, i];
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function Ve(t) {
|
|
496
496
|
const e = [], r = [];
|
|
497
497
|
let n = 0, i = 0;
|
|
498
498
|
function l(s) {
|
|
@@ -505,111 +505,111 @@ function xe(t) {
|
|
|
505
505
|
unchecked: i
|
|
506
506
|
};
|
|
507
507
|
}
|
|
508
|
-
var
|
|
509
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
508
|
+
var es = Object.defineProperty, ts = Object.getOwnPropertyDescriptor, rs = (t, e, r, n) => {
|
|
509
|
+
for (var i = n > 1 ? void 0 : n ? ts(e, r) : e, l = t.length - 1, s; l >= 0; l--)
|
|
510
510
|
(s = t[l]) && (i = (n ? s(e, r, i) : s(i)) || i);
|
|
511
|
-
return n && i &&
|
|
511
|
+
return n && i && es(e, r, i), i;
|
|
512
512
|
}, He = (t, e) => (r, n) => e(r, n, t);
|
|
513
|
-
const
|
|
514
|
-
let
|
|
513
|
+
const et = "sheets-filter.generate-filter-values.service", Ne = vt(et), ss = ["yyyy-mm-dd", "yyyy-mm-dd;@", "yyyy/mm/dd;@", "yyyy/mm/dd hh:mm", "yyyy-m-d am/pm h:mm", "yyyy-MM-dd", "yyyy/MM/dd", "yyyy/mm/dd", 'yyyy"年"MM"月"dd"日"', "MM-dd", 'M"月"d"日"', "MM-dd A/P hh:mm"];
|
|
514
|
+
let je = class extends de {
|
|
515
515
|
constructor(t, e, r) {
|
|
516
516
|
super(), this._localeService = t, this._univerInstanceService = e, this._logService = r;
|
|
517
517
|
}
|
|
518
518
|
async getFilterValues(t) {
|
|
519
519
|
var h;
|
|
520
520
|
const { unitId: e, subUnitId: r, filteredOutRowsByOtherColumns: n, filters: i, blankChecked: l, iterateRange: s, alreadyChecked: o } = t, a = this._univerInstanceService.getUnit(e), c = (h = this._univerInstanceService.getUnit(e)) == null ? void 0 : h.getSheetBySheetId(r);
|
|
521
|
-
return !a || !c ? [] : (this._logService.debug("[SheetsGenerateFilterValuesService]", "getFilterValues for", { unitId: e, subUnitId: r }),
|
|
521
|
+
return !a || !c ? [] : (this._logService.debug("[SheetsGenerateFilterValuesService]", "getFilterValues for", { unitId: e, subUnitId: r }), $t(i, this._localeService, s, c, new Set(n), new Set(o.map(String)), l, a.getStyles()));
|
|
522
522
|
}
|
|
523
523
|
};
|
|
524
|
-
|
|
525
|
-
He(0,
|
|
526
|
-
He(1,
|
|
527
|
-
He(2,
|
|
528
|
-
],
|
|
529
|
-
function
|
|
530
|
-
var
|
|
531
|
-
const a = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), h = "yyyy-mm-dd",
|
|
524
|
+
je = rs([
|
|
525
|
+
He(0, E(K)),
|
|
526
|
+
He(1, Ge),
|
|
527
|
+
He(2, Xt)
|
|
528
|
+
], je);
|
|
529
|
+
function $t(t, e, r, n, i, l, s, o) {
|
|
530
|
+
var g, P, F, R, I, M, $, ve, Se;
|
|
531
|
+
const a = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), h = "yyyy-mm-dd", p = new Set(ss), S = "empty";
|
|
532
532
|
let f = 0;
|
|
533
|
-
for (const
|
|
534
|
-
const { row:
|
|
535
|
-
let
|
|
536
|
-
for (;
|
|
537
|
-
const
|
|
538
|
-
if (i.has(
|
|
539
|
-
|
|
533
|
+
for (const y of n.iterateByColumn(r, !1, !1)) {
|
|
534
|
+
const { row: kt, rowSpan: rt = 1 } = y;
|
|
535
|
+
let J = 0;
|
|
536
|
+
for (; J < rt; ) {
|
|
537
|
+
const Gt = kt + J;
|
|
538
|
+
if (i.has(Gt)) {
|
|
539
|
+
J++;
|
|
540
540
|
continue;
|
|
541
541
|
}
|
|
542
|
-
const
|
|
543
|
-
if (!
|
|
544
|
-
f += 1,
|
|
542
|
+
const k = y != null && y.value ? Zt(y.value) : "";
|
|
543
|
+
if (!k) {
|
|
544
|
+
f += 1, J += rt;
|
|
545
545
|
continue;
|
|
546
546
|
}
|
|
547
|
-
const
|
|
548
|
-
if (
|
|
549
|
-
const x = (
|
|
547
|
+
const ge = (g = y.value) != null && g.v && !y.value.p ? (R = (F = o.get((P = y.value) == null ? void 0 : P.s)) == null ? void 0 : F.n) == null ? void 0 : R.pattern : "", Yt = ge && nt.isDate(ge);
|
|
548
|
+
if (ge && Yt && p.has(ge)) {
|
|
549
|
+
const x = (I = n.getCellRaw(y.row, y.col)) == null ? void 0 : I.v;
|
|
550
550
|
if (!x) {
|
|
551
|
-
|
|
551
|
+
J++;
|
|
552
552
|
continue;
|
|
553
553
|
}
|
|
554
|
-
const
|
|
555
|
-
let
|
|
556
|
-
|
|
557
|
-
title: `${
|
|
558
|
-
key: `${
|
|
554
|
+
const z = nt.format(h, x), [O, w, oe] = z.split("-").map(Number);
|
|
555
|
+
let G = a.get(`${O}`);
|
|
556
|
+
G || (G = {
|
|
557
|
+
title: `${O}`,
|
|
558
|
+
key: `${O}`,
|
|
559
559
|
children: [],
|
|
560
560
|
count: 0,
|
|
561
561
|
leaf: !1,
|
|
562
562
|
checked: !1
|
|
563
|
-
}, a.set(`${
|
|
564
|
-
let U = (
|
|
563
|
+
}, a.set(`${O}`, G), c.set(`${O}`, [`${O}`]));
|
|
564
|
+
let U = (M = G.children) == null ? void 0 : M.find((Ue) => Ue.key === `${O}-${w}`);
|
|
565
565
|
U || (U = {
|
|
566
566
|
title: e.t(`sheets-filter.date.${w}`),
|
|
567
|
-
key: `${
|
|
567
|
+
key: `${O}-${w}`,
|
|
568
568
|
children: [],
|
|
569
569
|
count: 0,
|
|
570
570
|
leaf: !1,
|
|
571
571
|
checked: !1
|
|
572
|
-
}, (
|
|
573
|
-
const we = (
|
|
574
|
-
we ? (we.originValues.add(
|
|
575
|
-
title: `${
|
|
576
|
-
key: `${
|
|
572
|
+
}, ($ = G.children) == null || $.push(U), c.set(`${O}-${w}`, [`${O}`, `${O}-${w}`]));
|
|
573
|
+
const we = (ve = U == null ? void 0 : U.children) == null ? void 0 : ve.find((Ue) => Ue.key === `${O}-${w}-${oe}`);
|
|
574
|
+
we ? (we.originValues.add(k), we.count++, U.count++, G.count++) : ((Se = U.children) == null || Se.push({
|
|
575
|
+
title: `${oe}`,
|
|
576
|
+
key: `${O}-${w}-${oe}`,
|
|
577
577
|
count: 1,
|
|
578
|
-
originValues: /* @__PURE__ */ new Set([
|
|
578
|
+
originValues: /* @__PURE__ */ new Set([k]),
|
|
579
579
|
leaf: !0,
|
|
580
|
-
checked: l.size ? l.has(
|
|
581
|
-
}), U.count++,
|
|
580
|
+
checked: l.size ? l.has(k) : !s
|
|
581
|
+
}), U.count++, G.count++, c.set(`${O}-${w}-${oe}`, [`${O}`, `${O}-${w}`, `${O}-${w}-${oe}`]));
|
|
582
582
|
} else {
|
|
583
|
-
const x =
|
|
584
|
-
let
|
|
585
|
-
|
|
586
|
-
title:
|
|
583
|
+
const x = k;
|
|
584
|
+
let z = a.get(x);
|
|
585
|
+
z ? z.count++ : (z = {
|
|
586
|
+
title: k,
|
|
587
587
|
leaf: !0,
|
|
588
|
-
checked: l.size ? l.has(
|
|
588
|
+
checked: l.size ? l.has(k) : !s,
|
|
589
589
|
key: x,
|
|
590
590
|
count: 1
|
|
591
|
-
}, a.set(x,
|
|
591
|
+
}, a.set(x, z), c.set(x, [x]));
|
|
592
592
|
}
|
|
593
|
-
|
|
593
|
+
J++;
|
|
594
594
|
}
|
|
595
595
|
}
|
|
596
|
-
const
|
|
596
|
+
const T = t ? s : !0;
|
|
597
597
|
if (f > 0) {
|
|
598
|
-
const
|
|
598
|
+
const y = {
|
|
599
599
|
title: e.t("sheets-filter.panel.empty"),
|
|
600
600
|
count: f,
|
|
601
601
|
leaf: !0,
|
|
602
|
-
checked:
|
|
602
|
+
checked: T,
|
|
603
603
|
key: S
|
|
604
604
|
};
|
|
605
|
-
a.set("empty",
|
|
605
|
+
a.set("empty", y), c.set("empty", [S]);
|
|
606
606
|
}
|
|
607
607
|
return {
|
|
608
|
-
filterTreeItems:
|
|
608
|
+
filterTreeItems: ns(Array.from(a.values())),
|
|
609
609
|
filterTreeMapCache: c
|
|
610
610
|
};
|
|
611
611
|
}
|
|
612
|
-
function
|
|
612
|
+
function ns(t) {
|
|
613
613
|
return Array.from(t).sort((e, r) => e.children && !r.children ? -1 : !e.children && r.children ? 1 : r.title.localeCompare(e.title)).map((e) => (e.children && e.children.sort((r, n) => {
|
|
614
614
|
const i = Number.parseInt(r.key.split("-")[1], 10), l = Number.parseInt(n.key.split("-")[1], 10);
|
|
615
615
|
return i - l;
|
|
@@ -620,25 +620,25 @@ function ss(t) {
|
|
|
620
620
|
});
|
|
621
621
|
}), e));
|
|
622
622
|
}
|
|
623
|
-
function
|
|
623
|
+
function We(t, e) {
|
|
624
624
|
for (const r of t) {
|
|
625
625
|
if (r.key === e)
|
|
626
626
|
return r;
|
|
627
627
|
if (r.children) {
|
|
628
|
-
const n =
|
|
628
|
+
const n = We(r.children, e);
|
|
629
629
|
if (n)
|
|
630
630
|
return n;
|
|
631
631
|
}
|
|
632
632
|
}
|
|
633
633
|
return null;
|
|
634
634
|
}
|
|
635
|
-
function
|
|
636
|
-
return t.leaf ? t.checked : t.children ? t.children.every((e) =>
|
|
635
|
+
function wt(t) {
|
|
636
|
+
return t.leaf ? t.checked : t.children ? t.children.every((e) => wt(e)) : !0;
|
|
637
637
|
}
|
|
638
|
-
function
|
|
639
|
-
t.leaf && (e !== void 0 ? t.checked = e : t.checked = !t.checked), t.children && t.children.forEach((r) =>
|
|
638
|
+
function he(t, e) {
|
|
639
|
+
t.leaf && (e !== void 0 ? t.checked = e : t.checked = !t.checked), t.children && t.children.forEach((r) => he(r, e));
|
|
640
640
|
}
|
|
641
|
-
function
|
|
641
|
+
function Ut(t, e) {
|
|
642
642
|
const r = [];
|
|
643
643
|
return t.forEach((n) => {
|
|
644
644
|
const i = n.originValues ? e.some(
|
|
@@ -651,7 +651,7 @@ function Mt(t, e) {
|
|
|
651
651
|
if (i || l)
|
|
652
652
|
r.push({ ...n });
|
|
653
653
|
else if (n.children) {
|
|
654
|
-
const o =
|
|
654
|
+
const o = Ut(n.children, e);
|
|
655
655
|
if (o.length > 0) {
|
|
656
656
|
const a = o.reduce((c, h) => c + h.count, 0);
|
|
657
657
|
r.push({ ...n, count: a, children: o });
|
|
@@ -659,27 +659,27 @@ function Mt(t, e) {
|
|
|
659
659
|
}
|
|
660
660
|
}), r;
|
|
661
661
|
}
|
|
662
|
-
var
|
|
663
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
662
|
+
var is = Object.defineProperty, os = Object.getOwnPropertyDescriptor, tt = (t, e, r, n) => {
|
|
663
|
+
for (var i = n > 1 ? void 0 : n ? os(e, r) : e, l = t.length - 1, s; l >= 0; l--)
|
|
664
664
|
(s = t[l]) && (i = (n ? s(e, r, i) : s(i)) || i);
|
|
665
|
-
return n && i &&
|
|
666
|
-
},
|
|
667
|
-
|
|
668
|
-
let
|
|
665
|
+
return n && i && is(e, r, i), i;
|
|
666
|
+
}, Pe = (t, e) => (r, n) => e(r, n, t), Oe = /* @__PURE__ */ ((t) => (t[t.VALUES = 0] = "VALUES", t[t.CONDITIONS = 1] = "CONDITIONS", t))(Oe || {});
|
|
667
|
+
vt("sheets-filter-ui.sheets-filter-panel.service");
|
|
668
|
+
let j = class extends de {
|
|
669
669
|
constructor(e, r) {
|
|
670
670
|
super();
|
|
671
|
-
_(this, "_filterBy$", new
|
|
671
|
+
_(this, "_filterBy$", new q(
|
|
672
672
|
0
|
|
673
673
|
/* VALUES */
|
|
674
674
|
));
|
|
675
675
|
_(this, "filterBy$", this._filterBy$.asObservable());
|
|
676
|
-
_(this, "_filterByModel$", new
|
|
676
|
+
_(this, "_filterByModel$", new Dr(1));
|
|
677
677
|
_(this, "filterByModel$", this._filterByModel$.asObservable());
|
|
678
678
|
_(this, "_filterByModel", null);
|
|
679
|
-
_(this, "_hasCriteria$", new
|
|
679
|
+
_(this, "_hasCriteria$", new q(!1));
|
|
680
680
|
_(this, "hasCriteria$", this._hasCriteria$.asObservable());
|
|
681
681
|
_(this, "_filterModel", null);
|
|
682
|
-
_(this, "_col$", new
|
|
682
|
+
_(this, "_col$", new q(-1));
|
|
683
683
|
_(this, "col$", this._col$.asObservable());
|
|
684
684
|
_(this, "_filterHeaderListener", null);
|
|
685
685
|
this._injector = e, this._refRangeService = r;
|
|
@@ -751,7 +751,7 @@ let W = class extends fe {
|
|
|
751
751
|
this._disposePreviousModel();
|
|
752
752
|
const n = e.getRange();
|
|
753
753
|
if (n.startRow === n.endRow) return !1;
|
|
754
|
-
const i = await
|
|
754
|
+
const i = await Re.fromFilterColumn(
|
|
755
755
|
this._injector,
|
|
756
756
|
e,
|
|
757
757
|
r
|
|
@@ -765,7 +765,7 @@ let W = class extends fe {
|
|
|
765
765
|
this._disposePreviousModel();
|
|
766
766
|
const n = e.getRange();
|
|
767
767
|
if (n.startRow === n.endRow) return !1;
|
|
768
|
-
const i =
|
|
768
|
+
const i = Ie.fromFilterColumn(
|
|
769
769
|
this._injector,
|
|
770
770
|
e,
|
|
771
771
|
r,
|
|
@@ -781,19 +781,19 @@ let W = class extends fe {
|
|
|
781
781
|
(e = this._filterByModel) == null || e.dispose(), this.filterByModel = null;
|
|
782
782
|
}
|
|
783
783
|
};
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
],
|
|
788
|
-
let
|
|
784
|
+
j = tt([
|
|
785
|
+
Pe(0, E(X)),
|
|
786
|
+
Pe(1, E(ur))
|
|
787
|
+
], j);
|
|
788
|
+
let Ie = class extends de {
|
|
789
789
|
constructor(e, r, n, i, l) {
|
|
790
790
|
super();
|
|
791
|
-
_(this, "canApply$",
|
|
791
|
+
_(this, "canApply$", _e(!0));
|
|
792
792
|
_(this, "_conditionItem$");
|
|
793
793
|
_(this, "conditionItem$");
|
|
794
794
|
_(this, "_filterConditionFormParams$");
|
|
795
795
|
_(this, "filterConditionFormParams$");
|
|
796
|
-
this._filterModel = e, this.col = r, this._commandService = l, this._conditionItem$ = new
|
|
796
|
+
this._filterModel = e, this.col = r, this._commandService = l, this._conditionItem$ = new q(n), this.conditionItem$ = this._conditionItem$.asObservable(), this._filterConditionFormParams$ = new q(i), this.filterConditionFormParams$ = this._filterConditionFormParams$.asObservable();
|
|
797
797
|
}
|
|
798
798
|
/**
|
|
799
799
|
* Create a model with targeting filter column. If there is not a filter column, the model would be created with
|
|
@@ -807,8 +807,8 @@ let Oe = class extends fe {
|
|
|
807
807
|
* @returns the model to control the panel's state
|
|
808
808
|
*/
|
|
809
809
|
static fromFilterColumn(e, r, n, i) {
|
|
810
|
-
const [l, s] =
|
|
811
|
-
return e.createInstance(
|
|
810
|
+
const [l, s] = m.testMappingFilterColumn(i == null ? void 0 : i.getColumnData());
|
|
811
|
+
return e.createInstance(Ie, r, n, l, s);
|
|
812
812
|
}
|
|
813
813
|
get conditionItem() {
|
|
814
814
|
return this._conditionItem$.getValue();
|
|
@@ -823,7 +823,7 @@ let Oe = class extends fe {
|
|
|
823
823
|
this.col += e;
|
|
824
824
|
}
|
|
825
825
|
clear() {
|
|
826
|
-
return this._disposed ? Promise.resolve(!1) : this._commandService.executeCommand(
|
|
826
|
+
return this._disposed ? Promise.resolve(!1) : this._commandService.executeCommand(re.id, {
|
|
827
827
|
unitId: this._filterModel.unitId,
|
|
828
828
|
subUnitId: this._filterModel.subUnitId,
|
|
829
829
|
col: this.col,
|
|
@@ -835,8 +835,8 @@ let Oe = class extends fe {
|
|
|
835
835
|
*/
|
|
836
836
|
async apply() {
|
|
837
837
|
if (this._disposed) return !1;
|
|
838
|
-
const e =
|
|
839
|
-
return this._commandService.executeCommand(
|
|
838
|
+
const e = m.mapToFilterColumn(this.conditionItem, this.filterConditionFormParams);
|
|
839
|
+
return this._commandService.executeCommand(re.id, {
|
|
840
840
|
unitId: this._filterModel.unitId,
|
|
841
841
|
subUnitId: this._filterModel.subUnitId,
|
|
842
842
|
col: this.col,
|
|
@@ -848,10 +848,10 @@ let Oe = class extends fe {
|
|
|
848
848
|
* `IFilterConditionFormParams` and load default condition form params.
|
|
849
849
|
*/
|
|
850
850
|
onPrimaryConditionChange(e) {
|
|
851
|
-
const r =
|
|
851
|
+
const r = m.ALL_CONDITIONS.find((n) => n.operator === e);
|
|
852
852
|
if (!r)
|
|
853
853
|
throw new Error(`[ByConditionsModel]: condition item not found for operator: ${e}!`);
|
|
854
|
-
this._conditionItem$.next(r), this._filterConditionFormParams$.next(
|
|
854
|
+
this._conditionItem$.next(r), this._filterConditionFormParams$.next(m.getInitialFormParams(e));
|
|
855
855
|
}
|
|
856
856
|
/**
|
|
857
857
|
* This method would be called when user changes the primary conditions, the input values or "AND" "OR" ratio.
|
|
@@ -864,16 +864,16 @@ let Oe = class extends fe {
|
|
|
864
864
|
onConditionFormChange(e) {
|
|
865
865
|
const r = { ...this.filterConditionFormParams, ...e };
|
|
866
866
|
if (r.and !== !0 && delete r.and, typeof e.and < "u" || typeof e.operator1 < "u" || typeof e.operator2 < "u") {
|
|
867
|
-
const n =
|
|
867
|
+
const n = m.testMappingParams(r, this.conditionItem.numOfParameters);
|
|
868
868
|
this._conditionItem$.next(n);
|
|
869
869
|
}
|
|
870
870
|
this._filterConditionFormParams$.next(r);
|
|
871
871
|
}
|
|
872
872
|
};
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
],
|
|
876
|
-
let
|
|
873
|
+
Ie = tt([
|
|
874
|
+
Pe(4, W)
|
|
875
|
+
], Ie);
|
|
876
|
+
let Re = class extends de {
|
|
877
877
|
constructor(e, r, n, i, l) {
|
|
878
878
|
super();
|
|
879
879
|
_(this, "_rawFilterItems$");
|
|
@@ -885,22 +885,22 @@ let Ie = class extends fe {
|
|
|
885
885
|
_(this, "_manuallyUpdateFilterItems$");
|
|
886
886
|
_(this, "_searchString$");
|
|
887
887
|
_(this, "searchString$");
|
|
888
|
-
this._filterModel = e, this.col = r, this._commandService = l, this._treeMapCache = i, this._searchString$ = new
|
|
889
|
-
|
|
888
|
+
this._filterModel = e, this.col = r, this._commandService = l, this._treeMapCache = i, this._searchString$ = new q(""), this.searchString$ = this._searchString$.asObservable(), this._rawFilterItems$ = new q(n), this.rawFilterItems$ = this._rawFilterItems$.asObservable(), this._manuallyUpdateFilterItems$ = new xr(), this.filterItems$ = Br(
|
|
889
|
+
Vr([
|
|
890
890
|
this._searchString$.pipe(
|
|
891
|
-
|
|
892
|
-
|
|
891
|
+
Ot(500, void 0, { leading: !0, trailing: !0 }),
|
|
892
|
+
It(void 0)
|
|
893
893
|
),
|
|
894
894
|
this._rawFilterItems$
|
|
895
895
|
]).pipe(
|
|
896
|
-
|
|
896
|
+
se(([s, o]) => {
|
|
897
897
|
if (!s) return o;
|
|
898
898
|
const c = s.toLowerCase().split(/\s+/).filter((h) => !!h);
|
|
899
|
-
return
|
|
899
|
+
return Ut(o, c);
|
|
900
900
|
})
|
|
901
901
|
),
|
|
902
902
|
this._manuallyUpdateFilterItems$
|
|
903
|
-
).pipe(
|
|
903
|
+
).pipe(jr(1)), this.canApply$ = this.filterItems$.pipe(se((s) => Ve(s).checked > 0)), this.disposeWithMe(this.filterItems$.subscribe((s) => this._filterItems = s));
|
|
904
904
|
}
|
|
905
905
|
/**
|
|
906
906
|
* Create a model with targeting filter column. If there is not a filter column, the model would be created with
|
|
@@ -913,29 +913,29 @@ let Ie = class extends fe {
|
|
|
913
913
|
* @returns the model to control the panel's state
|
|
914
914
|
*/
|
|
915
915
|
static async fromFilterColumn(e, r, n) {
|
|
916
|
-
var
|
|
917
|
-
const i = e.get(
|
|
916
|
+
var M;
|
|
917
|
+
const i = e.get(Ge), l = e.get(K), s = e.get(Ne, St.OPTIONAL), { unitId: o, subUnitId: a } = r, c = i.getUniverSheetInstance(o);
|
|
918
918
|
if (!c) throw new Error(`[ByValuesModel]: Workbook not found for filter model with unitId: ${o}!`);
|
|
919
919
|
const h = c == null ? void 0 : c.getSheetBySheetId(a);
|
|
920
920
|
if (!h) throw new Error(`[ByValuesModel]: Worksheet not found for filter model with unitId: ${o} and subUnitId: ${a}!`);
|
|
921
|
-
const
|
|
922
|
-
let R,
|
|
921
|
+
const p = r.getRange(), S = n, f = (M = r.getFilterColumn(n)) == null ? void 0 : M.getColumnData().filters, T = new Set(f == null ? void 0 : f.filters), g = !!(f && f.blank), P = r.getFilteredOutRowsExceptCol(n), F = { ...p, startRow: p.startRow + 1, startColumn: S, endColumn: S };
|
|
922
|
+
let R, I;
|
|
923
923
|
if (s) {
|
|
924
|
-
const
|
|
924
|
+
const $ = await s.getFilterValues({
|
|
925
925
|
unitId: o,
|
|
926
926
|
subUnitId: a,
|
|
927
|
-
filteredOutRowsByOtherColumns: Array.from(
|
|
927
|
+
filteredOutRowsByOtherColumns: Array.from(P),
|
|
928
928
|
filters: !!f,
|
|
929
|
-
blankChecked:
|
|
930
|
-
iterateRange:
|
|
931
|
-
alreadyChecked: Array.from(
|
|
929
|
+
blankChecked: g,
|
|
930
|
+
iterateRange: F,
|
|
931
|
+
alreadyChecked: Array.from(T)
|
|
932
932
|
});
|
|
933
|
-
R =
|
|
933
|
+
R = $.filterTreeItems, I = $.filterTreeMapCache;
|
|
934
934
|
} else {
|
|
935
|
-
const
|
|
936
|
-
R =
|
|
935
|
+
const $ = $t(!!f, l, F, h, P, T, g, c.getStyles());
|
|
936
|
+
R = $.filterTreeItems, I = $.filterTreeMapCache;
|
|
937
937
|
}
|
|
938
|
-
return e.createInstance(
|
|
938
|
+
return e.createInstance(Re, r, n, R, I);
|
|
939
939
|
}
|
|
940
940
|
get rawFilterItems() {
|
|
941
941
|
return this._rawFilterItems$.getValue();
|
|
@@ -956,24 +956,24 @@ let Ie = class extends fe {
|
|
|
956
956
|
this._searchString$.next(e);
|
|
957
957
|
}
|
|
958
958
|
onCheckAllToggled(e) {
|
|
959
|
-
const r =
|
|
960
|
-
r.forEach((n) =>
|
|
959
|
+
const r = Fe.deepClone(this._filterItems);
|
|
960
|
+
r.forEach((n) => he(n, e)), this._manuallyUpdateFilterItems(r);
|
|
961
961
|
}
|
|
962
962
|
/**
|
|
963
963
|
* Toggle a filter item.
|
|
964
964
|
*/
|
|
965
965
|
onFilterCheckToggled(e) {
|
|
966
|
-
const r =
|
|
966
|
+
const r = Fe.deepClone(this._filterItems), n = We(r, e.key);
|
|
967
967
|
if (!n)
|
|
968
968
|
return;
|
|
969
|
-
const i =
|
|
970
|
-
|
|
969
|
+
const i = wt(n);
|
|
970
|
+
he(n, !i), this._manuallyUpdateFilterItems(r);
|
|
971
971
|
}
|
|
972
972
|
onFilterOnly(e) {
|
|
973
|
-
const r =
|
|
974
|
-
r.forEach((n) =>
|
|
975
|
-
const i =
|
|
976
|
-
i &&
|
|
973
|
+
const r = Fe.deepClone(this._filterItems);
|
|
974
|
+
r.forEach((n) => he(n, !1)), e.forEach((n) => {
|
|
975
|
+
const i = We(r, n);
|
|
976
|
+
i && he(i, !0);
|
|
977
977
|
}), this._manuallyUpdateFilterItems(r);
|
|
978
978
|
}
|
|
979
979
|
_manuallyUpdateFilterItems(e) {
|
|
@@ -982,7 +982,7 @@ let Ie = class extends fe {
|
|
|
982
982
|
// expose method here to let the panel change filter items
|
|
983
983
|
// #region ByValuesModel apply methods
|
|
984
984
|
clear() {
|
|
985
|
-
return this._disposed ? Promise.resolve(!1) : this._commandService.executeCommand(
|
|
985
|
+
return this._disposed ? Promise.resolve(!1) : this._commandService.executeCommand(re.id, {
|
|
986
986
|
unitId: this._filterModel.unitId,
|
|
987
987
|
subUnitId: this._filterModel.subUnitId,
|
|
988
988
|
col: this.col,
|
|
@@ -995,7 +995,7 @@ let Ie = class extends fe {
|
|
|
995
995
|
async apply() {
|
|
996
996
|
if (this._disposed)
|
|
997
997
|
return !1;
|
|
998
|
-
const e =
|
|
998
|
+
const e = Ve(this._filterItems), { checked: r, checkedItems: n } = e, i = this.rawFilterItems;
|
|
999
999
|
let l = 0;
|
|
1000
1000
|
for (const c of i)
|
|
1001
1001
|
l += c.count;
|
|
@@ -1003,7 +1003,7 @@ let Ie = class extends fe {
|
|
|
1003
1003
|
if (s)
|
|
1004
1004
|
throw new Error("[ByValuesModel]: no checked items!");
|
|
1005
1005
|
if (o)
|
|
1006
|
-
return this._commandService.executeCommand(
|
|
1006
|
+
return this._commandService.executeCommand(re.id, {
|
|
1007
1007
|
unitId: this._filterModel.unitId,
|
|
1008
1008
|
subUnitId: this._filterModel.subUnitId,
|
|
1009
1009
|
col: this.col,
|
|
@@ -1011,12 +1011,12 @@ let Ie = class extends fe {
|
|
|
1011
1011
|
});
|
|
1012
1012
|
{
|
|
1013
1013
|
a.filters = {};
|
|
1014
|
-
const c = n.filter((
|
|
1014
|
+
const c = n.filter((p) => p.key !== "empty");
|
|
1015
1015
|
c.length > 0 && (a.filters = {
|
|
1016
|
-
filters: c.flatMap((
|
|
1016
|
+
filters: c.flatMap((p) => p.originValues ? Array.from(p.originValues) : [p.title])
|
|
1017
1017
|
}), c.length !== n.length && (a.filters.blank = !0);
|
|
1018
1018
|
}
|
|
1019
|
-
return this._commandService.executeCommand(
|
|
1019
|
+
return this._commandService.executeCommand(re.id, {
|
|
1020
1020
|
unitId: this._filterModel.unitId,
|
|
1021
1021
|
subUnitId: this._filterModel.subUnitId,
|
|
1022
1022
|
col: this.col,
|
|
@@ -1025,39 +1025,39 @@ let Ie = class extends fe {
|
|
|
1025
1025
|
}
|
|
1026
1026
|
// #endregion
|
|
1027
1027
|
};
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
],
|
|
1031
|
-
const
|
|
1028
|
+
Re = tt([
|
|
1029
|
+
Pe(4, W)
|
|
1030
|
+
], Re);
|
|
1031
|
+
const ne = "FILTER_PANEL_OPENED", ye = {
|
|
1032
1032
|
id: "sheet.operation.open-filter-panel",
|
|
1033
|
-
type:
|
|
1033
|
+
type: Me.OPERATION,
|
|
1034
1034
|
handler: (t, e) => {
|
|
1035
|
-
const r = t.get(
|
|
1036
|
-
t.get(
|
|
1035
|
+
const r = t.get($e), n = t.get(Q), i = t.get(j);
|
|
1036
|
+
t.get(W).syncExecuteCommand(vr.id, { visible: !1 });
|
|
1037
1037
|
const { unitId: s, subUnitId: o, col: a } = e, c = n.getFilterModel(s, o);
|
|
1038
|
-
return c ? (i.setupCol(c, a), r.getContextValue(
|
|
1038
|
+
return c ? (i.setupCol(c, a), r.getContextValue(ne) || r.setContextValue(ne, !0), !0) : !1;
|
|
1039
1039
|
}
|
|
1040
|
-
},
|
|
1040
|
+
}, pe = {
|
|
1041
1041
|
id: "sheet.operation.close-filter-panel",
|
|
1042
|
-
type:
|
|
1042
|
+
type: Me.OPERATION,
|
|
1043
1043
|
handler: (t) => {
|
|
1044
|
-
const e = t.get(
|
|
1045
|
-
return e.getContextValue(
|
|
1044
|
+
const e = t.get($e), r = t.get(j), n = t.get(yr, St.OPTIONAL);
|
|
1045
|
+
return e.getContextValue(ne) ? (e.setContextValue(ne, !1), n == null || n.focus(), r.terminate()) : !1;
|
|
1046
1046
|
}
|
|
1047
|
-
},
|
|
1047
|
+
}, Ht = {
|
|
1048
1048
|
id: "sheet.operation.apply-filter",
|
|
1049
|
-
type:
|
|
1049
|
+
type: Me.OPERATION,
|
|
1050
1050
|
handler: (t, e) => {
|
|
1051
1051
|
const { filterBy: r } = e;
|
|
1052
|
-
return t.get(
|
|
1052
|
+
return t.get(j).changeFilterBy(r);
|
|
1053
1053
|
}
|
|
1054
1054
|
};
|
|
1055
|
-
var
|
|
1056
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1055
|
+
var as = Object.defineProperty, ls = Object.getOwnPropertyDescriptor, cs = (t, e, r, n) => {
|
|
1056
|
+
for (var i = n > 1 ? void 0 : n ? ls(e, r) : e, l = t.length - 1, s; l >= 0; l--)
|
|
1057
1057
|
(s = t[l]) && (i = (n ? s(e, r, i) : s(i)) || i);
|
|
1058
|
-
return n && i &&
|
|
1059
|
-
},
|
|
1060
|
-
let
|
|
1058
|
+
return n && i && as(e, r, i), i;
|
|
1059
|
+
}, ee = (t, e) => (r, n) => e(r, n, t);
|
|
1060
|
+
let ie = class extends de {
|
|
1061
1061
|
constructor(t, e, r, n, i, l) {
|
|
1062
1062
|
super(), this._sheetsFilterService = t, this._localeService = e, this._commandService = r, this._sheetPermissionInterceptorBaseController = n, this._injector = i, this._sheetsSelectionService = l, this._commandExecutedListener();
|
|
1063
1063
|
}
|
|
@@ -1065,77 +1065,77 @@ let ae = class extends fe {
|
|
|
1065
1065
|
this.disposeWithMe(
|
|
1066
1066
|
this._commandService.beforeCommandExecuted((t) => {
|
|
1067
1067
|
var e, r, n;
|
|
1068
|
-
if (t.id ===
|
|
1069
|
-
const i = this._injector.get(
|
|
1068
|
+
if (t.id === fe.id) {
|
|
1069
|
+
const i = this._injector.get(Ge), l = pr(i);
|
|
1070
1070
|
if (!l) return;
|
|
1071
1071
|
const { unitId: s, subUnitId: o, worksheet: a } = l, c = (e = this._sheetsFilterService.getFilterModel(s, o)) == null ? void 0 : e.getRange();
|
|
1072
1072
|
let h;
|
|
1073
1073
|
if (c)
|
|
1074
1074
|
h = this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
|
|
1075
|
-
rangeTypes: [
|
|
1076
|
-
worksheetTypes: [
|
|
1075
|
+
rangeTypes: [le],
|
|
1076
|
+
worksheetTypes: [ce, ue]
|
|
1077
1077
|
}, [c]);
|
|
1078
1078
|
else {
|
|
1079
|
-
const
|
|
1080
|
-
if (
|
|
1081
|
-
let S = { ...
|
|
1082
|
-
S =
|
|
1083
|
-
rangeTypes: [
|
|
1084
|
-
worksheetTypes: [
|
|
1079
|
+
const p = (r = this._sheetsSelectionService.getCurrentLastSelection()) == null ? void 0 : r.range;
|
|
1080
|
+
if (p) {
|
|
1081
|
+
let S = { ...p };
|
|
1082
|
+
S = p.startColumn === p.endColumn && p.startRow === p.endRow ? mr(S, { left: !0, right: !0, up: !0, down: !0 }, a) : S, h = this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
|
|
1083
|
+
rangeTypes: [le],
|
|
1084
|
+
worksheetTypes: [ue, ce]
|
|
1085
1085
|
}, [S], s, o);
|
|
1086
1086
|
} else
|
|
1087
1087
|
h = this._sheetPermissionInterceptorBaseController.permissionCheckWithoutRange({
|
|
1088
|
-
rangeTypes: [
|
|
1089
|
-
worksheetTypes: [
|
|
1088
|
+
rangeTypes: [le],
|
|
1089
|
+
worksheetTypes: [ue, ce]
|
|
1090
1090
|
});
|
|
1091
1091
|
}
|
|
1092
1092
|
h || this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.filterErr"));
|
|
1093
1093
|
}
|
|
1094
1094
|
if (t.id === ye.id) {
|
|
1095
|
-
const i = t.params, { unitId: l, subUnitId: s } = i, o = (n = this._sheetsFilterService.getFilterModel(l, s)) == null ? void 0 : n.getRange(), a =
|
|
1095
|
+
const i = t.params, { unitId: l, subUnitId: s } = i, o = (n = this._sheetsFilterService.getFilterModel(l, s)) == null ? void 0 : n.getRange(), a = Fe.deepClone(o);
|
|
1096
1096
|
a && (a.startColumn = i.col, a.endColumn = i.col, this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
|
|
1097
|
-
rangeTypes: [
|
|
1098
|
-
worksheetTypes: [
|
|
1097
|
+
rangeTypes: [le],
|
|
1098
|
+
worksheetTypes: [ce, ue]
|
|
1099
1099
|
}, [a]) || this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.filterErr")));
|
|
1100
1100
|
}
|
|
1101
1101
|
})
|
|
1102
1102
|
);
|
|
1103
1103
|
}
|
|
1104
1104
|
};
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
],
|
|
1113
|
-
var
|
|
1114
|
-
return
|
|
1105
|
+
ie = cs([
|
|
1106
|
+
ee(0, E(Q)),
|
|
1107
|
+
ee(1, E(K)),
|
|
1108
|
+
ee(2, W),
|
|
1109
|
+
ee(3, E(Sr)),
|
|
1110
|
+
ee(4, E(X)),
|
|
1111
|
+
ee(5, E(hr))
|
|
1112
|
+
], ie);
|
|
1113
|
+
var b = function() {
|
|
1114
|
+
return b = Object.assign || function(t) {
|
|
1115
1115
|
for (var e, r = 1, n = arguments.length; r < n; r++) {
|
|
1116
1116
|
e = arguments[r];
|
|
1117
1117
|
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
|
|
1118
1118
|
}
|
|
1119
1119
|
return t;
|
|
1120
|
-
},
|
|
1121
|
-
},
|
|
1120
|
+
}, b.apply(this, arguments);
|
|
1121
|
+
}, us = function(t, e) {
|
|
1122
1122
|
var r = {};
|
|
1123
1123
|
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (r[n] = t[n]);
|
|
1124
1124
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
1125
1125
|
for (var i = 0, n = Object.getOwnPropertySymbols(t); i < n.length; i++)
|
|
1126
1126
|
e.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[i]) && (r[n[i]] = t[n[i]]);
|
|
1127
1127
|
return r;
|
|
1128
|
-
},
|
|
1129
|
-
var r = t.icon, n = t.id, i = t.className, l = t.extend, s =
|
|
1130
|
-
return
|
|
1128
|
+
}, Dt = At(function(t, e) {
|
|
1129
|
+
var r = t.icon, n = t.id, i = t.className, l = t.extend, s = us(t, ["icon", "id", "className", "extend"]), o = "univerjs-icon univerjs-icon-".concat(n, " ").concat(i || "").trim(), a = zr("_".concat(ms()));
|
|
1130
|
+
return xt(r, "".concat(n), { defIds: r.defIds, idSuffix: a.current }, b({ ref: e, className: o }, s), l);
|
|
1131
1131
|
});
|
|
1132
|
-
function
|
|
1133
|
-
return
|
|
1134
|
-
return
|
|
1132
|
+
function xt(t, e, r, n, i) {
|
|
1133
|
+
return bt(t.tag, b(b({ key: e }, hs(t, r, i)), n), (ps(t, r).children || []).map(function(l, s) {
|
|
1134
|
+
return xt(l, "".concat(e, "-").concat(t.tag, "-").concat(s), r, void 0, i);
|
|
1135
1135
|
}));
|
|
1136
1136
|
}
|
|
1137
|
-
function
|
|
1138
|
-
var n =
|
|
1137
|
+
function hs(t, e, r) {
|
|
1138
|
+
var n = b({}, t.attrs);
|
|
1139
1139
|
r != null && r.colorChannel1 && n.fill === "colorChannel1" && (n.fill = r.colorChannel1);
|
|
1140
1140
|
var i = e.defIds;
|
|
1141
1141
|
return !i || i.length === 0 || (t.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + e.idSuffix), Object.entries(n).forEach(function(l) {
|
|
@@ -1143,25 +1143,25 @@ function us(t, e, r) {
|
|
|
1143
1143
|
typeof o == "string" && (n[s] = o.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
1144
1144
|
})), n;
|
|
1145
1145
|
}
|
|
1146
|
-
function
|
|
1146
|
+
function ps(t, e) {
|
|
1147
1147
|
var r, n = e.defIds;
|
|
1148
|
-
return !n || n.length === 0 ? t : t.tag === "defs" && (!((r = t.children) === null || r === void 0) && r.length) ?
|
|
1149
|
-
return typeof i.attrs.id == "string" && n && n.indexOf(i.attrs.id) > -1 ?
|
|
1148
|
+
return !n || n.length === 0 ? t : t.tag === "defs" && (!((r = t.children) === null || r === void 0) && r.length) ? b(b({}, t), { children: t.children.map(function(i) {
|
|
1149
|
+
return typeof i.attrs.id == "string" && n && n.indexOf(i.attrs.id) > -1 ? b(b({}, i), { attrs: b(b({}, i.attrs), { id: i.attrs.id + e.idSuffix }) }) : i;
|
|
1150
1150
|
}) }) : t;
|
|
1151
1151
|
}
|
|
1152
|
-
function
|
|
1152
|
+
function ms() {
|
|
1153
1153
|
return Math.random().toString(36).substring(2, 8);
|
|
1154
1154
|
}
|
|
1155
|
-
|
|
1156
|
-
var
|
|
1157
|
-
return
|
|
1155
|
+
Dt.displayName = "UniverIcon";
|
|
1156
|
+
var ds = { 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 = At(function(t, e) {
|
|
1157
|
+
return bt(Dt, Object.assign({}, t, {
|
|
1158
1158
|
id: "filter-single",
|
|
1159
1159
|
ref: e,
|
|
1160
|
-
icon:
|
|
1160
|
+
icon: ds
|
|
1161
1161
|
}));
|
|
1162
1162
|
});
|
|
1163
|
-
|
|
1164
|
-
var
|
|
1163
|
+
Bt.displayName = "FilterSingle";
|
|
1164
|
+
var De = { exports: {} }, ae = {};
|
|
1165
1165
|
/**
|
|
1166
1166
|
* @license React
|
|
1167
1167
|
* react-jsx-runtime.production.min.js
|
|
@@ -1171,121 +1171,128 @@ var Dt = { exports: {} }, $e = {};
|
|
|
1171
1171
|
* This source code is licensed under the MIT license found in the
|
|
1172
1172
|
* LICENSE file in the root directory of this source tree.
|
|
1173
1173
|
*/
|
|
1174
|
-
var
|
|
1175
|
-
function
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1174
|
+
var ct;
|
|
1175
|
+
function fs() {
|
|
1176
|
+
if (ct) return ae;
|
|
1177
|
+
ct = 1;
|
|
1178
|
+
var t = Jr, e = Symbol.for("react.element"), r = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, i = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
1179
|
+
function s(o, a, c) {
|
|
1180
|
+
var h, p = {}, S = null, f = null;
|
|
1181
|
+
c !== void 0 && (S = "" + c), a.key !== void 0 && (S = "" + a.key), a.ref !== void 0 && (f = a.ref);
|
|
1182
|
+
for (h in a) n.call(a, h) && !l.hasOwnProperty(h) && (p[h] = a[h]);
|
|
1183
|
+
if (o && o.defaultProps) for (h in a = o.defaultProps, a) p[h] === void 0 && (p[h] = a[h]);
|
|
1184
|
+
return { $$typeof: e, type: o, key: S, ref: f, props: p, _owner: i.current };
|
|
1185
|
+
}
|
|
1186
|
+
return ae.Fragment = r, ae.jsx = s, ae.jsxs = s, ae;
|
|
1187
|
+
}
|
|
1188
|
+
var ut;
|
|
1189
|
+
function _s() {
|
|
1190
|
+
return ut || (ut = 1, De.exports = fs()), De.exports;
|
|
1181
1191
|
}
|
|
1182
|
-
|
|
1183
|
-
$
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
formDualColumnLayout: ks,
|
|
1214
|
-
sheetsFilterTreeNode: Gs,
|
|
1215
|
-
sheetsFilterTreeNodeFilterOnly: Ys,
|
|
1216
|
-
sheetsFilterTreeNodeAttach: qs
|
|
1192
|
+
var d = _s();
|
|
1193
|
+
const vs = "univer-sheets-filter-panel", Ss = "univer-sheets-filter-panel-header", gs = "univer-sheets-filter-panel-content", Es = "univer-sheets-filter-panel-select-all", Ts = "univer-sheets-filter-panel-select-all-count", Fs = "univer-sheets-filter-panel-values-container", Cs = "univer-input-affix-wrapper", Ns = "univer-select", Ps = "univer-radio-group", Os = "univer-sheets-filter-panel-values-find", Is = "univer-sheets-filter-panel-values-list", Rs = "univer-sheets-filter-panel-values-list-inner-container", ys = "univer-sheets-filter-panel-values-virtual", As = "univer-sheets-filter-panel-values-item", bs = "univer-sheets-filter-panel-values-item-inner", Ls = "univer-sheets-filter-panel-values-item-count", Ms = "univer-sheets-filter-panel-values-item-exclude-button", $s = "univer-sheets-filter-panel-values-item-text", ws = "univer-sheets-filter-panel-conditions-container", Us = "univer-sheets-filter-panel-conditions-container-inner", Hs = "univer-sheets-filter-panel-conditions-desc", Ds = "univer-sheets-filter-panel-footer", xs = "univer-sheets-filter-panel-footer-primary-buttons", Bs = "univer-button", Vs = "univer-input", js = "univer-form-dual-column-layout", Ws = "univer-sheets-filter-tree-node", Qs = "univer-sheets-filter-tree-node-filter-only", ks = "univer-sheets-filter-tree-node-attach", C = {
|
|
1194
|
+
sheetsFilterPanel: vs,
|
|
1195
|
+
sheetsFilterPanelHeader: Ss,
|
|
1196
|
+
sheetsFilterPanelContent: gs,
|
|
1197
|
+
sheetsFilterPanelSelectAll: Es,
|
|
1198
|
+
sheetsFilterPanelSelectAllCount: Ts,
|
|
1199
|
+
sheetsFilterPanelValuesContainer: Fs,
|
|
1200
|
+
inputAffixWrapper: Cs,
|
|
1201
|
+
select: Ns,
|
|
1202
|
+
radioGroup: Ps,
|
|
1203
|
+
sheetsFilterPanelValuesFind: Os,
|
|
1204
|
+
sheetsFilterPanelValuesList: Is,
|
|
1205
|
+
sheetsFilterPanelValuesListInnerContainer: Rs,
|
|
1206
|
+
sheetsFilterPanelValuesVirtual: ys,
|
|
1207
|
+
sheetsFilterPanelValuesItem: As,
|
|
1208
|
+
sheetsFilterPanelValuesItemInner: bs,
|
|
1209
|
+
sheetsFilterPanelValuesItemCount: Ls,
|
|
1210
|
+
sheetsFilterPanelValuesItemExcludeButton: Ms,
|
|
1211
|
+
sheetsFilterPanelValuesItemText: $s,
|
|
1212
|
+
sheetsFilterPanelConditionsContainer: ws,
|
|
1213
|
+
sheetsFilterPanelConditionsContainerInner: Us,
|
|
1214
|
+
sheetsFilterPanelConditionsDesc: Hs,
|
|
1215
|
+
sheetsFilterPanelFooter: Ds,
|
|
1216
|
+
sheetsFilterPanelFooterPrimaryButtons: xs,
|
|
1217
|
+
button: Bs,
|
|
1218
|
+
input: Vs,
|
|
1219
|
+
formDualColumnLayout: js,
|
|
1220
|
+
sheetsFilterTreeNode: Ws,
|
|
1221
|
+
sheetsFilterTreeNodeFilterOnly: Qs,
|
|
1222
|
+
sheetsFilterTreeNodeAttach: ks
|
|
1217
1223
|
};
|
|
1218
|
-
function
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1224
|
+
function Gs(t) {
|
|
1225
|
+
var f, T;
|
|
1226
|
+
const { model: e } = t, r = te(K), n = V(e.conditionItem$, void 0), i = V(e.filterConditionFormParams$, void 0), l = i != null && i.and ? "AND" : "OR", s = D((g) => {
|
|
1227
|
+
e.onConditionFormChange({ and: g === "AND" });
|
|
1228
|
+
}, [e]), o = Ys(r), a = D((g) => {
|
|
1229
|
+
e.onPrimaryConditionChange(g);
|
|
1230
|
+
}, [e]), c = qs(r), h = D((g) => {
|
|
1231
|
+
e.onConditionFormChange(g);
|
|
1232
|
+
}, [e]), p = r.t("sheets-filter.panel.input-values-placeholder");
|
|
1233
|
+
function S(g, P, F) {
|
|
1234
|
+
const R = m.getItemByOperator(g).numOfParameters === 1;
|
|
1228
1235
|
return /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
|
1229
|
-
|
|
1230
|
-
/* @__PURE__ */ d.jsx(
|
|
1231
|
-
/* @__PURE__ */ d.jsx(
|
|
1236
|
+
F === "operator2" && /* @__PURE__ */ d.jsxs(Gr, { value: l, onChange: s, children: [
|
|
1237
|
+
/* @__PURE__ */ d.jsx(at, { value: "AND", children: r.t("sheets-filter.panel.and") }),
|
|
1238
|
+
/* @__PURE__ */ d.jsx(at, { value: "OR", children: r.t("sheets-filter.panel.or") })
|
|
1232
1239
|
] }),
|
|
1233
|
-
/* @__PURE__ */ d.jsx(
|
|
1234
|
-
|
|
1240
|
+
/* @__PURE__ */ d.jsx(ot, { value: g, options: c, onChange: (I) => h({ [F]: I }) }),
|
|
1241
|
+
R && /* @__PURE__ */ d.jsx("div", { children: /* @__PURE__ */ d.jsx(Rt, { value: P, placeholder: p, onChange: (I) => h({ [F === "operator1" ? "val1" : "val2"]: I }) }) })
|
|
1235
1242
|
] });
|
|
1236
1243
|
}
|
|
1237
|
-
return /* @__PURE__ */ d.
|
|
1238
|
-
/* @__PURE__ */ d.jsx(
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1244
|
+
return /* @__PURE__ */ d.jsx("div", { className: C.sheetsFilterPanelConditionsContainer, children: n && i && /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
|
1245
|
+
/* @__PURE__ */ d.jsx(ot, { value: n.operator, options: o, onChange: a }),
|
|
1246
|
+
m.getItemByOperator(n.operator).numOfParameters !== 0 ? /* @__PURE__ */ d.jsxs("div", { className: C.sheetsFilterPanelConditionsContainerInner, children: [
|
|
1247
|
+
n.numOfParameters >= 1 && S(i.operator1, (f = i.val1) != null ? f : "", "operator1"),
|
|
1248
|
+
n.numOfParameters >= 2 && S(i.operator2, (T = i.val2) != null ? T : "", "operator2"),
|
|
1242
1249
|
/* @__PURE__ */ d.jsxs("div", { className: C.sheetsFilterPanelConditionsDesc, children: [
|
|
1243
1250
|
r.t("sheets-filter.panel.?"),
|
|
1244
1251
|
/* @__PURE__ */ d.jsx("br", {}),
|
|
1245
1252
|
r.t("sheets-filter.panel.*")
|
|
1246
1253
|
] })
|
|
1247
1254
|
] }) : null
|
|
1248
|
-
] });
|
|
1255
|
+
] }) });
|
|
1249
1256
|
}
|
|
1250
|
-
function
|
|
1257
|
+
function Ys(t) {
|
|
1251
1258
|
const e = t.getCurrentLocale();
|
|
1252
1259
|
return ze(
|
|
1253
1260
|
() => [
|
|
1254
1261
|
{
|
|
1255
1262
|
options: [
|
|
1256
|
-
{ label: t.t(
|
|
1263
|
+
{ label: t.t(m.NONE.label), value: m.NONE.operator }
|
|
1257
1264
|
]
|
|
1258
1265
|
},
|
|
1259
1266
|
{
|
|
1260
1267
|
options: [
|
|
1261
|
-
{ label: t.t(
|
|
1262
|
-
{ label: t.t(
|
|
1268
|
+
{ label: t.t(m.EMPTY.label), value: m.EMPTY.operator },
|
|
1269
|
+
{ label: t.t(m.NOT_EMPTY.label), value: m.NOT_EMPTY.operator }
|
|
1263
1270
|
]
|
|
1264
1271
|
},
|
|
1265
1272
|
{
|
|
1266
1273
|
options: [
|
|
1267
|
-
{ label: t.t(
|
|
1268
|
-
{ label: t.t(
|
|
1269
|
-
{ label: t.t(
|
|
1270
|
-
{ label: t.t(
|
|
1271
|
-
{ label: t.t(
|
|
1274
|
+
{ label: t.t(m.TEXT_CONTAINS.label), value: m.TEXT_CONTAINS.operator },
|
|
1275
|
+
{ label: t.t(m.DOES_NOT_CONTAIN.label), value: m.DOES_NOT_CONTAIN.operator },
|
|
1276
|
+
{ label: t.t(m.STARTS_WITH.label), value: m.STARTS_WITH.operator },
|
|
1277
|
+
{ label: t.t(m.ENDS_WITH.label), value: m.ENDS_WITH.operator },
|
|
1278
|
+
{ label: t.t(m.EQUALS.label), value: m.EQUALS.operator }
|
|
1272
1279
|
]
|
|
1273
1280
|
},
|
|
1274
1281
|
{
|
|
1275
1282
|
options: [
|
|
1276
|
-
{ label: t.t(
|
|
1277
|
-
{ label: t.t(
|
|
1278
|
-
{ label: t.t(
|
|
1279
|
-
{ label: t.t(
|
|
1280
|
-
{ label: t.t(
|
|
1281
|
-
{ label: t.t(
|
|
1282
|
-
{ label: t.t(
|
|
1283
|
-
{ label: t.t(
|
|
1283
|
+
{ label: t.t(m.GREATER_THAN.label), value: m.GREATER_THAN.operator },
|
|
1284
|
+
{ label: t.t(m.GREATER_THAN_OR_EQUAL.label), value: m.GREATER_THAN_OR_EQUAL.operator },
|
|
1285
|
+
{ label: t.t(m.LESS_THAN.label), value: m.LESS_THAN.operator },
|
|
1286
|
+
{ label: t.t(m.LESS_THAN_OR_EQUAL.label), value: m.LESS_THAN_OR_EQUAL.operator },
|
|
1287
|
+
{ label: t.t(m.EQUAL.label), value: m.EQUAL.operator },
|
|
1288
|
+
{ label: t.t(m.NOT_EQUAL.label), value: m.NOT_EQUAL.operator },
|
|
1289
|
+
{ label: t.t(m.BETWEEN.label), value: m.BETWEEN.operator },
|
|
1290
|
+
{ label: t.t(m.NOT_BETWEEN.label), value: m.NOT_BETWEEN.operator }
|
|
1284
1291
|
]
|
|
1285
1292
|
},
|
|
1286
1293
|
{
|
|
1287
1294
|
options: [
|
|
1288
|
-
{ label: t.t(
|
|
1295
|
+
{ label: t.t(m.CUSTOM.label), value: m.CUSTOM.operator }
|
|
1289
1296
|
]
|
|
1290
1297
|
}
|
|
1291
1298
|
],
|
|
@@ -1293,32 +1300,32 @@ function Xs(t) {
|
|
|
1293
1300
|
[e, t]
|
|
1294
1301
|
);
|
|
1295
1302
|
}
|
|
1296
|
-
function
|
|
1303
|
+
function qs(t) {
|
|
1297
1304
|
const e = t.getCurrentLocale();
|
|
1298
1305
|
return ze(
|
|
1299
|
-
() =>
|
|
1306
|
+
() => m.ALL_CONDITIONS.filter((r) => r.numOfParameters !== 2).map((r) => ({ label: t.t(r.label), value: r.operator })),
|
|
1300
1307
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1301
1308
|
[e, t]
|
|
1302
1309
|
);
|
|
1303
1310
|
}
|
|
1304
|
-
function
|
|
1305
|
-
const { model: e } = t, r =
|
|
1311
|
+
function Ks(t) {
|
|
1312
|
+
const { model: e } = t, r = te(K), n = V(e.searchString$, "", !0), i = V(e.filterItems$, void 0, !0), l = r.t("sheets-filter.panel.filter-only"), s = Ve(i), o = s.checked > 0 && s.unchecked === 0, a = s.checked > 0 && s.unchecked > 0, c = e.treeMapCache, h = D(() => {
|
|
1306
1313
|
e.onCheckAllToggled(!o);
|
|
1307
|
-
}, [e, o]),
|
|
1314
|
+
}, [e, o]), p = D((f) => {
|
|
1308
1315
|
e.setSearchString(f);
|
|
1309
1316
|
}, [e]);
|
|
1310
1317
|
function S(f) {
|
|
1311
|
-
let
|
|
1312
|
-
return f.forEach((
|
|
1313
|
-
|
|
1314
|
-
}),
|
|
1318
|
+
let T = [];
|
|
1319
|
+
return f.forEach((g) => {
|
|
1320
|
+
g.checked && T.push(g.key), g.children && (T = T.concat(S(g.children)));
|
|
1321
|
+
}), T;
|
|
1315
1322
|
}
|
|
1316
1323
|
return /* @__PURE__ */ d.jsxs("div", { className: C.sheetsFilterPanelValuesContainer, children: [
|
|
1317
|
-
/* @__PURE__ */ d.jsx(
|
|
1324
|
+
/* @__PURE__ */ d.jsx(Rt, { autoFocus: !0, value: n, placeholder: r.t("sheets-filter.panel.search-placeholder"), onChange: p }),
|
|
1318
1325
|
/* @__PURE__ */ d.jsxs("div", { className: C.sheetsFilterPanelValuesList, children: [
|
|
1319
1326
|
/* @__PURE__ */ d.jsx("div", { className: C.sheetsFilterPanelValuesItem, children: /* @__PURE__ */ d.jsxs("div", { className: C.sheetsFilterPanelValuesItemInner, children: [
|
|
1320
1327
|
/* @__PURE__ */ d.jsx(
|
|
1321
|
-
|
|
1328
|
+
Yr,
|
|
1322
1329
|
{
|
|
1323
1330
|
indeterminate: a,
|
|
1324
1331
|
disabled: i.length === 0,
|
|
@@ -1330,7 +1337,7 @@ function zs(t) {
|
|
|
1330
1337
|
/* @__PURE__ */ d.jsx("span", { className: C.sheetsFilterPanelValuesItemCount, children: `(${s.checked}/${s.checked + s.unchecked})` })
|
|
1331
1338
|
] }) }),
|
|
1332
1339
|
/* @__PURE__ */ d.jsx("div", { className: C.sheetsFilterPanelValuesVirtual, children: /* @__PURE__ */ d.jsx(
|
|
1333
|
-
|
|
1340
|
+
qr,
|
|
1334
1341
|
{
|
|
1335
1342
|
data: i,
|
|
1336
1343
|
defaultExpandAll: !1,
|
|
@@ -1345,18 +1352,18 @@ function zs(t) {
|
|
|
1345
1352
|
attachRender: (f) => /* @__PURE__ */ d.jsxs("div", { className: C.sheetsFilterTreeNodeAttach, children: [
|
|
1346
1353
|
/* @__PURE__ */ d.jsx("span", { className: C.sheetsFilterPanelValuesItemCount, children: `(${f.count})` }),
|
|
1347
1354
|
/* @__PURE__ */ d.jsx(
|
|
1348
|
-
|
|
1355
|
+
Ce,
|
|
1349
1356
|
{
|
|
1350
1357
|
className: C.sheetsFilterTreeNodeFilterOnly,
|
|
1351
1358
|
size: "small",
|
|
1352
1359
|
type: "link",
|
|
1353
1360
|
onClick: () => {
|
|
1354
|
-
const
|
|
1355
|
-
f.children ? f.children.forEach((
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
}) :
|
|
1359
|
-
}) :
|
|
1361
|
+
const T = [];
|
|
1362
|
+
f.children ? f.children.forEach((g) => {
|
|
1363
|
+
g.children ? g.children.forEach((P) => {
|
|
1364
|
+
T.push(P.key);
|
|
1365
|
+
}) : T.push(g.key);
|
|
1366
|
+
}) : T.push(f.key), e.onFilterOnly(T);
|
|
1360
1367
|
},
|
|
1361
1368
|
children: l
|
|
1362
1369
|
}
|
|
@@ -1367,131 +1374,131 @@ function zs(t) {
|
|
|
1367
1374
|
] })
|
|
1368
1375
|
] });
|
|
1369
1376
|
}
|
|
1370
|
-
function
|
|
1371
|
-
var
|
|
1372
|
-
const t =
|
|
1373
|
-
r.executeCommand(
|
|
1377
|
+
function Xs() {
|
|
1378
|
+
var P;
|
|
1379
|
+
const t = te(j), e = te(K), r = te(W), n = V(t.filterBy$, void 0, !0), i = V(t.filterByModel$, void 0, !1), l = V(() => (i == null ? void 0 : i.canApply$) || _e(!1), void 0, !1, [i]), s = Zs(e), o = !V(t.hasCriteria$), a = D((F) => {
|
|
1380
|
+
r.executeCommand(Ht.id, { filterBy: F });
|
|
1374
1381
|
}, [r]), c = D(async () => {
|
|
1375
|
-
await (i == null ? void 0 : i.clear()), r.executeCommand(
|
|
1382
|
+
await (i == null ? void 0 : i.clear()), r.executeCommand(pe.id);
|
|
1376
1383
|
}, [i, r]), h = D(() => {
|
|
1377
|
-
r.executeCommand(
|
|
1378
|
-
}, [r]),
|
|
1379
|
-
await (i == null ? void 0 : i.apply()), r.executeCommand(
|
|
1380
|
-
}, [i, r]), f = (
|
|
1384
|
+
r.executeCommand(pe.id);
|
|
1385
|
+
}, [r]), p = D(async () => {
|
|
1386
|
+
await (i == null ? void 0 : i.apply()), r.executeCommand(pe.id);
|
|
1387
|
+
}, [i, r]), f = (P = te(Q).activeFilterModel) == null ? void 0 : P.getRange(), T = t.col, g = Ar(gr.FILTER_PANEL_EMBED_POINT);
|
|
1381
1388
|
return /* @__PURE__ */ d.jsxs("div", { className: C.sheetsFilterPanel, children: [
|
|
1382
1389
|
/* @__PURE__ */ d.jsx(
|
|
1383
|
-
|
|
1390
|
+
br,
|
|
1384
1391
|
{
|
|
1385
|
-
components:
|
|
1386
|
-
sharedProps: { range: f, colIndex:
|
|
1392
|
+
components: g,
|
|
1393
|
+
sharedProps: { range: f, colIndex: T, onClose: h }
|
|
1387
1394
|
}
|
|
1388
1395
|
),
|
|
1389
|
-
/* @__PURE__ */ d.jsx("div", { className: C.sheetsFilterPanelHeader, children: /* @__PURE__ */ d.jsx(
|
|
1390
|
-
i ? /* @__PURE__ */ d.jsx("div", { className: C.sheetsFilterPanelContent, children: n ===
|
|
1396
|
+
/* @__PURE__ */ d.jsx("div", { className: C.sheetsFilterPanelHeader, children: /* @__PURE__ */ d.jsx(Kr, { value: n, options: s, onChange: (F) => a(F) }) }),
|
|
1397
|
+
i ? /* @__PURE__ */ d.jsx("div", { className: C.sheetsFilterPanelContent, children: n === Oe.VALUES ? /* @__PURE__ */ d.jsx(Ks, { model: i }) : /* @__PURE__ */ d.jsx(Gs, { model: i }) }) : /* @__PURE__ */ d.jsx("div", { style: { flex: 1 } }),
|
|
1391
1398
|
/* @__PURE__ */ d.jsxs("div", { className: C.sheetsFilterPanelFooter, children: [
|
|
1392
|
-
/* @__PURE__ */ d.jsx(
|
|
1399
|
+
/* @__PURE__ */ d.jsx(Ce, { type: "link", onClick: c, disabled: o, children: e.t("sheets-filter.panel.clear-filter") }),
|
|
1393
1400
|
/* @__PURE__ */ d.jsxs("span", { className: C.sheetsFilterPanelFooterPrimaryButtons, children: [
|
|
1394
|
-
/* @__PURE__ */ d.jsx(
|
|
1395
|
-
/* @__PURE__ */ d.jsx(
|
|
1401
|
+
/* @__PURE__ */ d.jsx(Ce, { type: "default", onClick: h, children: e.t("sheets-filter.panel.cancel") }),
|
|
1402
|
+
/* @__PURE__ */ d.jsx(Ce, { disabled: !l, type: "primary", onClick: p, children: e.t("sheets-filter.panel.confirm") })
|
|
1396
1403
|
] })
|
|
1397
1404
|
] })
|
|
1398
1405
|
] });
|
|
1399
1406
|
}
|
|
1400
|
-
function
|
|
1407
|
+
function Zs(t) {
|
|
1401
1408
|
const e = t.getCurrentLocale();
|
|
1402
1409
|
return ze(
|
|
1403
1410
|
() => [
|
|
1404
|
-
{ label: t.t("sheets-filter.panel.by-values"), value:
|
|
1405
|
-
{ label: t.t("sheets-filter.panel.by-conditions"), value:
|
|
1411
|
+
{ label: t.t("sheets-filter.panel.by-values"), value: Oe.VALUES },
|
|
1412
|
+
{ label: t.t("sheets-filter.panel.by-conditions"), value: Oe.CONDITIONS }
|
|
1406
1413
|
],
|
|
1407
1414
|
[e, t]
|
|
1408
1415
|
);
|
|
1409
1416
|
}
|
|
1410
|
-
function
|
|
1411
|
-
const e = t.get(
|
|
1417
|
+
function Js(t) {
|
|
1418
|
+
const e = t.get(Q);
|
|
1412
1419
|
return {
|
|
1413
|
-
id:
|
|
1414
|
-
type:
|
|
1420
|
+
id: fe.id,
|
|
1421
|
+
type: Xe.BUTTON_SELECTOR,
|
|
1415
1422
|
icon: "FilterSingle",
|
|
1416
1423
|
tooltip: "sheets-filter.toolbar.smart-toggle-filter-tooltip",
|
|
1417
|
-
hidden$:
|
|
1418
|
-
activated$: e.activeFilterModel$.pipe(
|
|
1419
|
-
disabled$:
|
|
1424
|
+
hidden$: Ze(t, Z.UNIVER_SHEET),
|
|
1425
|
+
activated$: e.activeFilterModel$.pipe(se((r) => !!r)),
|
|
1426
|
+
disabled$: Er(t, Tr(t, { worksheetTypes: [ce, ue], rangeTypes: [le] }))
|
|
1420
1427
|
};
|
|
1421
1428
|
}
|
|
1422
|
-
function
|
|
1423
|
-
const e = t.get(
|
|
1429
|
+
function zs(t) {
|
|
1430
|
+
const e = t.get(Q);
|
|
1424
1431
|
return {
|
|
1425
|
-
id:
|
|
1426
|
-
type:
|
|
1432
|
+
id: qe.id,
|
|
1433
|
+
type: Xe.BUTTON,
|
|
1427
1434
|
title: "sheets-filter.toolbar.clear-filter-criteria",
|
|
1428
|
-
hidden$:
|
|
1429
|
-
disabled$: e.activeFilterModel$.pipe(
|
|
1435
|
+
hidden$: Ze(t, Z.UNIVER_SHEET),
|
|
1436
|
+
disabled$: e.activeFilterModel$.pipe(Je((r) => {
|
|
1430
1437
|
var n;
|
|
1431
|
-
return (n = r == null ? void 0 : r.hasCriteria$.pipe(
|
|
1438
|
+
return (n = r == null ? void 0 : r.hasCriteria$.pipe(se((i) => !i))) != null ? n : _e(!0);
|
|
1432
1439
|
}))
|
|
1433
1440
|
};
|
|
1434
1441
|
}
|
|
1435
|
-
function
|
|
1436
|
-
const e = t.get(
|
|
1442
|
+
function en(t) {
|
|
1443
|
+
const e = t.get(Q);
|
|
1437
1444
|
return {
|
|
1438
|
-
id:
|
|
1439
|
-
type:
|
|
1445
|
+
id: Ke.id,
|
|
1446
|
+
type: Xe.BUTTON,
|
|
1440
1447
|
title: "sheets-filter.toolbar.re-calc-filter-conditions",
|
|
1441
|
-
hidden$:
|
|
1442
|
-
disabled$: e.activeFilterModel$.pipe(
|
|
1448
|
+
hidden$: Ze(t, Z.UNIVER_SHEET),
|
|
1449
|
+
disabled$: e.activeFilterModel$.pipe(Je((r) => {
|
|
1443
1450
|
var n;
|
|
1444
|
-
return (n = r == null ? void 0 : r.hasCriteria$.pipe(
|
|
1451
|
+
return (n = r == null ? void 0 : r.hasCriteria$.pipe(se((i) => !i))) != null ? n : _e(!0);
|
|
1445
1452
|
}))
|
|
1446
1453
|
};
|
|
1447
1454
|
}
|
|
1448
|
-
const
|
|
1449
|
-
[
|
|
1450
|
-
[
|
|
1455
|
+
const tn = {
|
|
1456
|
+
[Lr.FORMULAS_INSERT]: {
|
|
1457
|
+
[fe.id]: {
|
|
1451
1458
|
order: 10,
|
|
1452
|
-
menuItemFactory:
|
|
1453
|
-
[
|
|
1459
|
+
menuItemFactory: Js,
|
|
1460
|
+
[qe.id]: {
|
|
1454
1461
|
order: 0,
|
|
1455
|
-
menuItemFactory:
|
|
1462
|
+
menuItemFactory: zs
|
|
1456
1463
|
},
|
|
1457
|
-
[
|
|
1464
|
+
[Ke.id]: {
|
|
1458
1465
|
order: 1,
|
|
1459
|
-
menuItemFactory:
|
|
1466
|
+
menuItemFactory: en
|
|
1460
1467
|
}
|
|
1461
1468
|
}
|
|
1462
1469
|
}
|
|
1463
|
-
},
|
|
1464
|
-
id:
|
|
1465
|
-
binding:
|
|
1470
|
+
}, rn = {
|
|
1471
|
+
id: fe.id,
|
|
1472
|
+
binding: Mr.L | it.CTRL_COMMAND | it.SHIFT,
|
|
1466
1473
|
description: "sheets-filter.shortcut.smart-toggle-filter",
|
|
1467
|
-
preconditions:
|
|
1474
|
+
preconditions: Fr,
|
|
1468
1475
|
group: "4_sheet-edit"
|
|
1469
|
-
},
|
|
1470
|
-
class
|
|
1476
|
+
}, B = 16, sn = 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");
|
|
1477
|
+
class ht {
|
|
1471
1478
|
static drawNoCriteria(e, r, n, i) {
|
|
1472
|
-
e.save(),
|
|
1479
|
+
e.save(), lt.drawWith(e, {
|
|
1473
1480
|
radius: 2,
|
|
1474
|
-
width:
|
|
1475
|
-
height:
|
|
1481
|
+
width: B,
|
|
1482
|
+
height: B,
|
|
1476
1483
|
fill: i
|
|
1477
|
-
}), e.lineCap = "square", e.strokeStyle = n, e.scale(r /
|
|
1484
|
+
}), e.lineCap = "square", e.strokeStyle = n, e.scale(r / B, r / B), 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
1485
|
}
|
|
1479
1486
|
static drawHasCriteria(e, r, n, i) {
|
|
1480
|
-
e.save(),
|
|
1487
|
+
e.save(), lt.drawWith(e, {
|
|
1481
1488
|
radius: 2,
|
|
1482
|
-
width:
|
|
1483
|
-
height:
|
|
1489
|
+
width: B,
|
|
1490
|
+
height: B,
|
|
1484
1491
|
fill: i
|
|
1485
|
-
}), e.scale(r /
|
|
1492
|
+
}), e.scale(r / B, r / B), e.fillStyle = n, e.fill(sn), e.restore();
|
|
1486
1493
|
}
|
|
1487
1494
|
}
|
|
1488
|
-
var
|
|
1489
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1495
|
+
var nn = Object.defineProperty, on = Object.getOwnPropertyDescriptor, an = (t, e, r, n) => {
|
|
1496
|
+
for (var i = n > 1 ? void 0 : n ? on(e, r) : e, l = t.length - 1, s; l >= 0; l--)
|
|
1490
1497
|
(s = t[l]) && (i = (n ? s(e, r, i) : s(i)) || i);
|
|
1491
|
-
return n && i &&
|
|
1492
|
-
},
|
|
1493
|
-
const H = 16,
|
|
1494
|
-
let
|
|
1498
|
+
return n && i && nn(e, r, i), i;
|
|
1499
|
+
}, xe = (t, e) => (r, n) => e(r, n, t);
|
|
1500
|
+
const H = 16, Ee = 1;
|
|
1501
|
+
let Qe = class extends Zr {
|
|
1495
1502
|
constructor(e, r, n, i, l) {
|
|
1496
1503
|
super(e, r);
|
|
1497
1504
|
_(this, "_cellWidth", 0);
|
|
@@ -1512,13 +1519,13 @@ let We = class extends Xr {
|
|
|
1512
1519
|
const s = new Path2D();
|
|
1513
1520
|
s.rect(i, l, n, r), e.clip(s);
|
|
1514
1521
|
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 ?
|
|
1522
|
+
o ? ht.drawHasCriteria(e, H, a, c) : ht.drawNoCriteria(e, H, a, c), e.restore();
|
|
1516
1523
|
}
|
|
1517
1524
|
onPointerDown(e) {
|
|
1518
1525
|
if (e.button === 2)
|
|
1519
1526
|
return;
|
|
1520
1527
|
const { col: r, unitId: n, subUnitId: i } = this._filterParams;
|
|
1521
|
-
this._contextService.getContextValue(
|
|
1528
|
+
this._contextService.getContextValue(ne) || !this._commandService.hasCommand(ye.id) || setTimeout(() => {
|
|
1522
1529
|
this._commandService.executeCommand(ye.id, {
|
|
1523
1530
|
unitId: n,
|
|
1524
1531
|
subUnitId: i,
|
|
@@ -1533,18 +1540,18 @@ let We = class extends Xr {
|
|
|
1533
1540
|
this._hovered = !1, this.makeDirty(!0);
|
|
1534
1541
|
}
|
|
1535
1542
|
};
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
],
|
|
1541
|
-
var
|
|
1542
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1543
|
+
Qe = an([
|
|
1544
|
+
xe(2, $e),
|
|
1545
|
+
xe(3, W),
|
|
1546
|
+
xe(4, E(gt))
|
|
1547
|
+
], Qe);
|
|
1548
|
+
var ln = Object.defineProperty, cn = Object.getOwnPropertyDescriptor, un = (t, e, r, n) => {
|
|
1549
|
+
for (var i = n > 1 ? void 0 : n ? cn(e, r) : e, l = t.length - 1, s; l >= 0; l--)
|
|
1543
1550
|
(s = t[l]) && (i = (n ? s(e, r, i) : s(i)) || i);
|
|
1544
|
-
return n && i &&
|
|
1545
|
-
},
|
|
1546
|
-
const
|
|
1547
|
-
let
|
|
1551
|
+
return n && i && ln(e, r, i), i;
|
|
1552
|
+
}, Y = (t, e) => (r, n) => e(r, n, t);
|
|
1553
|
+
const hn = 1e3, pn = 5e3;
|
|
1554
|
+
let ke = class extends Et {
|
|
1548
1555
|
constructor(e, r, n, i, l, s, o, a) {
|
|
1549
1556
|
super();
|
|
1550
1557
|
_(this, "_filterRangeShape", null);
|
|
@@ -1557,9 +1564,9 @@ let Qe = class extends vt {
|
|
|
1557
1564
|
}
|
|
1558
1565
|
_initRenderer() {
|
|
1559
1566
|
this._sheetSkeletonManagerService.currentSkeleton$.pipe(
|
|
1560
|
-
|
|
1567
|
+
Je((e) => {
|
|
1561
1568
|
var o, a;
|
|
1562
|
-
if (!e) return
|
|
1569
|
+
if (!e) return _e(null);
|
|
1563
1570
|
const { unit: r, unitId: n } = this._context, i = ((o = r.getActiveSheet()) == null ? void 0 : o.getSheetId()) || "", l = (a = this._sheetsFilterService.getFilterModel(n, i)) != null ? a : void 0, s = () => ({
|
|
1564
1571
|
unitId: n,
|
|
1565
1572
|
worksheetId: i,
|
|
@@ -1567,28 +1574,28 @@ let Qe = class extends vt {
|
|
|
1567
1574
|
range: l == null ? void 0 : l.getRange(),
|
|
1568
1575
|
skeleton: e.skeleton
|
|
1569
1576
|
});
|
|
1570
|
-
return
|
|
1571
|
-
|
|
1577
|
+
return Jt(this._commandService.onCommandExecuted.bind(this._commandService)).pipe(
|
|
1578
|
+
Wr(
|
|
1572
1579
|
([c]) => {
|
|
1573
1580
|
var h;
|
|
1574
|
-
return c.type ===
|
|
1581
|
+
return c.type === Me.MUTATION && ((h = c.params) == null ? void 0 : h.unitId) === r.getUnitId() && (sr.has(c.id) || c.id === fr.id);
|
|
1575
1582
|
}
|
|
1576
1583
|
),
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1584
|
+
Ot(20, void 0, { leading: !1, trailing: !0 }),
|
|
1585
|
+
se(s),
|
|
1586
|
+
It(s())
|
|
1580
1587
|
// must trigger once
|
|
1581
1588
|
);
|
|
1582
1589
|
}),
|
|
1583
|
-
|
|
1590
|
+
Qr(this.dispose$)
|
|
1584
1591
|
).subscribe((e) => {
|
|
1585
1592
|
this._disposeRendering(), !(!e || !e.range) && (this._renderRange(e.range, e.skeleton), this._renderButtons(e));
|
|
1586
1593
|
});
|
|
1587
1594
|
}
|
|
1588
1595
|
_renderRange(e, r) {
|
|
1589
|
-
const { scene: n } = this._context, { rowHeaderWidth: i, columnHeaderHeight: l } = r, s = this._filterRangeShape = new
|
|
1596
|
+
const { scene: n } = this._context, { rowHeaderWidth: i, columnHeaderHeight: l } = r, s = this._filterRangeShape = new Pr(
|
|
1590
1597
|
n,
|
|
1591
|
-
|
|
1598
|
+
hn,
|
|
1592
1599
|
this._themeService,
|
|
1593
1600
|
{
|
|
1594
1601
|
rowHeaderWidth: i,
|
|
@@ -1596,7 +1603,7 @@ let Qe = class extends vt {
|
|
|
1596
1603
|
enableAutoFill: !1,
|
|
1597
1604
|
highlightHeader: !1
|
|
1598
1605
|
}
|
|
1599
|
-
), a =
|
|
1606
|
+
), a = Or({
|
|
1600
1607
|
range: e,
|
|
1601
1608
|
primary: null,
|
|
1602
1609
|
style: { fill: "rgba(0, 0, 0, 0.0)" }
|
|
@@ -1607,31 +1614,31 @@ let Qe = class extends vt {
|
|
|
1607
1614
|
const { range: r, filterModel: n, unitId: i, skeleton: l, worksheetId: s } = e, { scene: o } = this._context;
|
|
1608
1615
|
this._interceptCellContent(i, s, e.range);
|
|
1609
1616
|
const { startColumn: a, endColumn: c, startRow: h } = r;
|
|
1610
|
-
for (let
|
|
1611
|
-
const S = `sheets-filter-button-${
|
|
1612
|
-
if (
|
|
1617
|
+
for (let p = a; p <= c; p++) {
|
|
1618
|
+
const S = `sheets-filter-button-${p}`, f = Ir(h, p, o, l), { startX: T, startY: g, endX: P, endY: F } = f, R = P - T, I = F - g;
|
|
1619
|
+
if (I <= Ee || R <= Ee)
|
|
1613
1620
|
continue;
|
|
1614
|
-
const
|
|
1615
|
-
left:
|
|
1616
|
-
top:
|
|
1621
|
+
const M = !!n.getFilterColumn(p), $ = P - H - Ee, ve = F - H - Ee, Se = {
|
|
1622
|
+
left: $,
|
|
1623
|
+
top: ve,
|
|
1617
1624
|
height: H,
|
|
1618
1625
|
width: H,
|
|
1619
|
-
zIndex:
|
|
1620
|
-
cellHeight:
|
|
1626
|
+
zIndex: pn,
|
|
1627
|
+
cellHeight: I,
|
|
1621
1628
|
cellWidth: R,
|
|
1622
|
-
filterParams: { unitId: i, subUnitId: s, col:
|
|
1623
|
-
},
|
|
1624
|
-
this._filterButtonShapes.push(
|
|
1629
|
+
filterParams: { unitId: i, subUnitId: s, col: p, hasCriteria: M }
|
|
1630
|
+
}, y = this._injector.createInstance(Qe, S, Se);
|
|
1631
|
+
this._filterButtonShapes.push(y);
|
|
1625
1632
|
}
|
|
1626
1633
|
o.addObjects(this._filterButtonShapes), o.makeDirty();
|
|
1627
1634
|
}
|
|
1628
1635
|
_interceptCellContent(e, r, n) {
|
|
1629
1636
|
const { startRow: i, startColumn: l, endColumn: s } = n;
|
|
1630
|
-
this._buttonRenderDisposable = this._sheetInterceptorService.intercept(
|
|
1637
|
+
this._buttonRenderDisposable = this._sheetInterceptorService.intercept(_r.CELL_CONTENT, {
|
|
1631
1638
|
effect: zt.Style,
|
|
1632
1639
|
handler: (o, a, c) => {
|
|
1633
|
-
const { row: h, col:
|
|
1634
|
-
return S !== e || f !== r || h !== i ||
|
|
1640
|
+
const { row: h, col: p, unitId: S, subUnitId: f } = a;
|
|
1641
|
+
return S !== e || f !== r || h !== i || p < l || p > s ? c(o) : c({
|
|
1635
1642
|
...o,
|
|
1636
1643
|
fontRenderExtension: {
|
|
1637
1644
|
...o == null ? void 0 : o.fontRenderExtension,
|
|
@@ -1647,83 +1654,83 @@ let Qe = class extends vt {
|
|
|
1647
1654
|
(e = this._filterRangeShape) == null || e.dispose(), this._filterButtonShapes.forEach((n) => n.dispose()), (r = this._buttonRenderDisposable) == null || r.dispose(), this._filterRangeShape = null, this._buttonRenderDisposable = null, this._filterButtonShapes = [];
|
|
1648
1655
|
}
|
|
1649
1656
|
};
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
],
|
|
1659
|
-
var
|
|
1660
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1657
|
+
ke = un([
|
|
1658
|
+
Y(1, E(X)),
|
|
1659
|
+
Y(2, E(Cr)),
|
|
1660
|
+
Y(3, E(Q)),
|
|
1661
|
+
Y(4, E(gt)),
|
|
1662
|
+
Y(5, E(dr)),
|
|
1663
|
+
Y(6, W),
|
|
1664
|
+
Y(7, Nr)
|
|
1665
|
+
], ke);
|
|
1666
|
+
var mn = Object.defineProperty, dn = Object.getOwnPropertyDescriptor, fn = (t, e, r, n) => {
|
|
1667
|
+
for (var i = n > 1 ? void 0 : n ? dn(e, r) : e, l = t.length - 1, s; l >= 0; l--)
|
|
1661
1668
|
(s = t[l]) && (i = (n ? s(e, r, i) : s(i)) || i);
|
|
1662
|
-
return n && i &&
|
|
1663
|
-
},
|
|
1664
|
-
let
|
|
1669
|
+
return n && i && mn(e, r, i), i;
|
|
1670
|
+
}, pt = (t, e) => (r, n) => e(r, n, t);
|
|
1671
|
+
let me = class extends Et {
|
|
1665
1672
|
constructor(t, e) {
|
|
1666
1673
|
super(), this._renderManagerService = t, this._sheetsRenderService = e, [
|
|
1667
|
-
sr,
|
|
1668
1674
|
nr,
|
|
1669
1675
|
ir,
|
|
1670
|
-
or
|
|
1676
|
+
or,
|
|
1677
|
+
ar
|
|
1671
1678
|
].forEach((r) => this.disposeWithMe(this._sheetsRenderService.registerSkeletonChangingMutations(r.id))), this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
1672
|
-
|
|
1673
|
-
[
|
|
1679
|
+
Z.UNIVER_SHEET,
|
|
1680
|
+
[ke]
|
|
1674
1681
|
));
|
|
1675
1682
|
}
|
|
1676
1683
|
};
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
],
|
|
1681
|
-
var
|
|
1682
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1684
|
+
me = fn([
|
|
1685
|
+
pt(0, yt),
|
|
1686
|
+
pt(1, E(Pt))
|
|
1687
|
+
], me);
|
|
1688
|
+
var _n = Object.defineProperty, vn = Object.getOwnPropertyDescriptor, Sn = (t, e, r, n) => {
|
|
1689
|
+
for (var i = n > 1 ? void 0 : n ? vn(e, r) : e, l = t.length - 1, s; l >= 0; l--)
|
|
1683
1690
|
(s = t[l]) && (i = (n ? s(e, r, i) : s(i)) || i);
|
|
1684
|
-
return n && i &&
|
|
1685
|
-
},
|
|
1686
|
-
const
|
|
1687
|
-
let
|
|
1688
|
-
constructor(e, r, n, i, l, s, o, a, c, h,
|
|
1691
|
+
return n && i && _n(e, r, i), i;
|
|
1692
|
+
}, A = (t, e) => (r, n) => e(r, n, t);
|
|
1693
|
+
const mt = "FILTER_PANEL_POPUP";
|
|
1694
|
+
let Ae = class extends me {
|
|
1695
|
+
constructor(e, r, n, i, l, s, o, a, c, h, p, S, f) {
|
|
1689
1696
|
super(f, S);
|
|
1690
1697
|
_(this, "_popupDisposable");
|
|
1691
|
-
this._injector = e, this._componentManager = r, this._sheetsFilterPanelService = n, this._sheetCanvasPopupService = i, this._sheetsFilterService = l, this._localeService = s, this._shortcutService = o, this._commandService = a, this._menuManagerService = c, this._contextService = h, this._messageService =
|
|
1698
|
+
this._injector = e, this._componentManager = r, this._sheetsFilterPanelService = n, this._sheetCanvasPopupService = i, this._sheetsFilterService = l, this._localeService = s, this._shortcutService = o, this._commandService = a, this._menuManagerService = c, this._contextService = h, this._messageService = p, this._initCommands(), this._initShortcuts(), this._initMenuItems(), this._initUI();
|
|
1692
1699
|
}
|
|
1693
1700
|
dispose() {
|
|
1694
1701
|
super.dispose(), this._closeFilterPopup();
|
|
1695
1702
|
}
|
|
1696
1703
|
_initShortcuts() {
|
|
1697
1704
|
[
|
|
1698
|
-
|
|
1705
|
+
rn
|
|
1699
1706
|
].forEach((e) => {
|
|
1700
1707
|
this.disposeWithMe(this._shortcutService.registerShortcut(e));
|
|
1701
1708
|
});
|
|
1702
1709
|
}
|
|
1703
1710
|
_initCommands() {
|
|
1704
1711
|
[
|
|
1705
|
-
|
|
1706
|
-
ar,
|
|
1712
|
+
fe,
|
|
1707
1713
|
lr,
|
|
1708
|
-
|
|
1709
|
-
|
|
1714
|
+
cr,
|
|
1715
|
+
re,
|
|
1710
1716
|
qe,
|
|
1711
|
-
|
|
1717
|
+
Ke,
|
|
1718
|
+
Ht,
|
|
1712
1719
|
ye,
|
|
1713
|
-
|
|
1720
|
+
pe
|
|
1714
1721
|
].forEach((e) => {
|
|
1715
1722
|
this.disposeWithMe(this._commandService.registerCommand(e));
|
|
1716
1723
|
});
|
|
1717
1724
|
}
|
|
1718
1725
|
_initMenuItems() {
|
|
1719
|
-
this._menuManagerService.mergeMenu(
|
|
1726
|
+
this._menuManagerService.mergeMenu(tn);
|
|
1720
1727
|
}
|
|
1721
1728
|
_initUI() {
|
|
1722
|
-
this.disposeWithMe(this._componentManager.register(
|
|
1729
|
+
this.disposeWithMe(this._componentManager.register(mt, Xs)), this.disposeWithMe(this._componentManager.register("FilterSingle", Bt)), this.disposeWithMe(this._contextService.subscribeContextValue$(ne).pipe(kr()).subscribe((e) => {
|
|
1723
1730
|
e ? this._openFilterPopup() : this._closeFilterPopup();
|
|
1724
1731
|
})), this.disposeWithMe(this._sheetsFilterService.errorMsg$.subscribe((e) => {
|
|
1725
1732
|
e && this._messageService.show({
|
|
1726
|
-
type:
|
|
1733
|
+
type: Xr.Error,
|
|
1727
1734
|
content: this._localeService.t(e)
|
|
1728
1735
|
});
|
|
1729
1736
|
}));
|
|
@@ -1734,9 +1741,9 @@ let Re = class extends de {
|
|
|
1734
1741
|
throw new Error("[SheetsFilterUIController]: no filter model when opening filter popup!");
|
|
1735
1742
|
const r = e.getRange(), n = this._sheetsFilterPanelService.col, { startRow: i } = r;
|
|
1736
1743
|
this._popupDisposable = this._sheetCanvasPopupService.attachPopupToCell(i, n, {
|
|
1737
|
-
componentKey:
|
|
1744
|
+
componentKey: mt,
|
|
1738
1745
|
direction: "horizontal",
|
|
1739
|
-
onClickOutside: () => this._commandService.syncExecuteCommand(
|
|
1746
|
+
onClickOutside: () => this._commandService.syncExecuteCommand(pe.id),
|
|
1740
1747
|
offset: [5, 0]
|
|
1741
1748
|
});
|
|
1742
1749
|
}
|
|
@@ -1745,121 +1752,121 @@ let Re = class extends de {
|
|
|
1745
1752
|
(e = this._popupDisposable) == null || e.dispose(), this._popupDisposable = null;
|
|
1746
1753
|
}
|
|
1747
1754
|
};
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
],
|
|
1763
|
-
var
|
|
1764
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1755
|
+
Ae = Sn([
|
|
1756
|
+
A(0, E(X)),
|
|
1757
|
+
A(1, E($r)),
|
|
1758
|
+
A(2, E(j)),
|
|
1759
|
+
A(3, E(Rr)),
|
|
1760
|
+
A(4, E(Q)),
|
|
1761
|
+
A(5, E(K)),
|
|
1762
|
+
A(6, wr),
|
|
1763
|
+
A(7, W),
|
|
1764
|
+
A(8, Ur),
|
|
1765
|
+
A(9, $e),
|
|
1766
|
+
A(10, Hr),
|
|
1767
|
+
A(11, E(Pt)),
|
|
1768
|
+
A(12, yt)
|
|
1769
|
+
], Ae);
|
|
1770
|
+
var Vt = Object.defineProperty, gn = Object.getOwnPropertyDescriptor, En = (t, e, r) => e in t ? Vt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Tn = (t, e, r, n) => {
|
|
1771
|
+
for (var i = n > 1 ? void 0 : n ? gn(e, r) : e, l = t.length - 1, s; l >= 0; l--)
|
|
1765
1772
|
(s = t[l]) && (i = (n ? s(e, r, i) : s(i)) || i);
|
|
1766
|
-
return n && i &&
|
|
1767
|
-
}, Be = (t, e) => (r, n) => e(r, n, t),
|
|
1768
|
-
const
|
|
1769
|
-
let
|
|
1770
|
-
constructor(t =
|
|
1773
|
+
return n && i && Vt(e, r, i), i;
|
|
1774
|
+
}, Be = (t, e) => (r, n) => e(r, n, t), jt = (t, e, r) => En(t, typeof e != "symbol" ? e + "" : e, r);
|
|
1775
|
+
const Fn = "SHEET_FILTER_UI_PLUGIN";
|
|
1776
|
+
let be = class extends Ye {
|
|
1777
|
+
constructor(t = Mt, e, r, n) {
|
|
1771
1778
|
super(), this._config = t, this._injector = e, this._configService = r, this._rpcChannelService = n;
|
|
1772
1779
|
const { menu: i, ...l } = this._config;
|
|
1773
|
-
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(
|
|
1780
|
+
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(Lt, l);
|
|
1774
1781
|
}
|
|
1775
1782
|
onStarting() {
|
|
1776
1783
|
[
|
|
1777
|
-
[
|
|
1778
|
-
[
|
|
1779
|
-
[
|
|
1780
|
-
].forEach((t) => this._injector.add(t)), this._config.useRemoteFilterValuesGenerator && this._rpcChannelService && this._injector.add([
|
|
1781
|
-
useFactory: () =>
|
|
1782
|
-
this._rpcChannelService.requestChannel(
|
|
1784
|
+
[j],
|
|
1785
|
+
[ie],
|
|
1786
|
+
[Ae]
|
|
1787
|
+
].forEach((t) => this._injector.add(t)), this._config.useRemoteFilterValuesGenerator && this._rpcChannelService && this._injector.add([Ne, {
|
|
1788
|
+
useFactory: () => tr(
|
|
1789
|
+
this._rpcChannelService.requestChannel(et)
|
|
1783
1790
|
)
|
|
1784
1791
|
}]);
|
|
1785
1792
|
}
|
|
1786
1793
|
onReady() {
|
|
1787
|
-
this._injector.get(
|
|
1794
|
+
this._injector.get(ie);
|
|
1788
1795
|
}
|
|
1789
1796
|
onRendered() {
|
|
1790
|
-
this._injector.get(
|
|
1797
|
+
this._injector.get(Ae);
|
|
1791
1798
|
}
|
|
1792
1799
|
};
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
Be(1,
|
|
1798
|
-
Be(2,
|
|
1799
|
-
Be(3,
|
|
1800
|
-
],
|
|
1801
|
-
var
|
|
1802
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1800
|
+
jt(be, "type", Z.UNIVER_SHEET);
|
|
1801
|
+
jt(be, "pluginName", Fn);
|
|
1802
|
+
be = Tn([
|
|
1803
|
+
Tt(Nt),
|
|
1804
|
+
Be(1, E(X)),
|
|
1805
|
+
Be(2, Ft),
|
|
1806
|
+
Be(3, er(Ct))
|
|
1807
|
+
], be);
|
|
1808
|
+
var Wt = Object.defineProperty, Cn = Object.getOwnPropertyDescriptor, Nn = (t, e, r) => e in t ? Wt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Pn = (t, e, r, n) => {
|
|
1809
|
+
for (var i = n > 1 ? void 0 : n ? Cn(e, r) : e, l = t.length - 1, s; l >= 0; l--)
|
|
1803
1810
|
(s = t[l]) && (i = (n ? s(e, r, i) : s(i)) || i);
|
|
1804
|
-
return n && i &&
|
|
1805
|
-
},
|
|
1806
|
-
const
|
|
1807
|
-
let
|
|
1808
|
-
constructor(t =
|
|
1811
|
+
return n && i && Wt(e, r, i), i;
|
|
1812
|
+
}, dt = (t, e) => (r, n) => e(r, n, t), Qt = (t, e, r) => Nn(t, typeof e != "symbol" ? e + "" : e, r);
|
|
1813
|
+
const On = "SHEET_FILTER_UI_PLUGIN";
|
|
1814
|
+
let Le = class extends Ye {
|
|
1815
|
+
constructor(t = Mt, e, r) {
|
|
1809
1816
|
super(), this._config = t, this._injector = e, this._configService = r;
|
|
1810
1817
|
const { menu: n, ...i } = this._config;
|
|
1811
|
-
n && this._configService.setConfig("menu", n, { merge: !0 }), this._configService.setConfig(
|
|
1818
|
+
n && this._configService.setConfig("menu", n, { merge: !0 }), this._configService.setConfig(Lt, i);
|
|
1812
1819
|
}
|
|
1813
1820
|
onStarting() {
|
|
1814
1821
|
[
|
|
1815
|
-
[
|
|
1816
|
-
[
|
|
1822
|
+
[ie],
|
|
1823
|
+
[me]
|
|
1817
1824
|
].forEach((t) => this._injector.add(t));
|
|
1818
1825
|
}
|
|
1819
1826
|
onReady() {
|
|
1820
|
-
this._injector.get(
|
|
1827
|
+
this._injector.get(ie);
|
|
1821
1828
|
}
|
|
1822
1829
|
onRendered() {
|
|
1823
|
-
this._injector.get(
|
|
1830
|
+
this._injector.get(me);
|
|
1824
1831
|
}
|
|
1825
1832
|
};
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
],
|
|
1833
|
-
var
|
|
1834
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1833
|
+
Qt(Le, "type", Z.UNIVER_SHEET);
|
|
1834
|
+
Qt(Le, "pluginName", On);
|
|
1835
|
+
Le = Pn([
|
|
1836
|
+
Tt(Nt),
|
|
1837
|
+
dt(1, E(X)),
|
|
1838
|
+
dt(2, Ft)
|
|
1839
|
+
], Le);
|
|
1840
|
+
var In = Object.defineProperty, Rn = Object.getOwnPropertyDescriptor, yn = (t, e, r, n) => {
|
|
1841
|
+
for (var i = n > 1 ? void 0 : n ? Rn(e, r) : e, l = t.length - 1, s; l >= 0; l--)
|
|
1835
1842
|
(s = t[l]) && (i = (n ? s(e, r, i) : s(i)) || i);
|
|
1836
|
-
return n && i &&
|
|
1837
|
-
},
|
|
1838
|
-
let
|
|
1843
|
+
return n && i && In(e, r, i), i;
|
|
1844
|
+
}, ft = (t, e) => (r, n) => e(r, n, t), Te;
|
|
1845
|
+
let _t = (Te = class extends Ye {
|
|
1839
1846
|
constructor(t, e, r) {
|
|
1840
1847
|
super(), this._config = t, this._injector = e, this._rpcChannelService = r;
|
|
1841
1848
|
}
|
|
1842
1849
|
onStarting() {
|
|
1843
1850
|
[
|
|
1844
|
-
[
|
|
1851
|
+
[Ne, { useClass: je }]
|
|
1845
1852
|
].forEach((t) => this._injector.add(t));
|
|
1846
1853
|
}
|
|
1847
1854
|
onReady() {
|
|
1848
1855
|
this._rpcChannelService.registerChannel(
|
|
1849
|
-
|
|
1850
|
-
|
|
1856
|
+
et,
|
|
1857
|
+
rr(this._injector.get(Ne))
|
|
1851
1858
|
);
|
|
1852
1859
|
}
|
|
1853
|
-
}, _(
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
],
|
|
1860
|
+
}, _(Te, "type", Z.UNIVER_SHEET), _(Te, "pluginName", "SHEET_FILTER_UI_WORKER_PLUGIN"), Te);
|
|
1861
|
+
_t = yn([
|
|
1862
|
+
ft(1, E(X)),
|
|
1863
|
+
ft(2, Ct)
|
|
1864
|
+
], _t);
|
|
1858
1865
|
export {
|
|
1859
|
-
|
|
1860
|
-
|
|
1866
|
+
Ht as ChangeFilterByOperation,
|
|
1867
|
+
pe as CloseFilterPanelOperation,
|
|
1861
1868
|
ye as OpenFilterPanelOperation,
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1869
|
+
Le as UniverSheetsFilterMobileUIPlugin,
|
|
1870
|
+
be as UniverSheetsFilterUIPlugin,
|
|
1871
|
+
_t as UniverSheetsFilterUIWorkerPlugin
|
|
1865
1872
|
};
|