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