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