@univerjs/sheets-filter-ui 0.6.10 → 0.7.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +29 -4
- package/lib/es/index.js +961 -853
- package/lib/index.css +1 -1
- package/lib/index.js +961 -853
- package/lib/umd/index.js +30 -5
- package/package.json +14 -14
package/lib/es/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
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 C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SECOND", t))(C || {}), _ = /* @__PURE__ */ ((t) => (t.NONE = "none", t.STARTS_WITH = "startsWith", t.DOES_NOT_START_WITH = "doesNotStartWith", t.ENDS_WITH = "endsWith", t.DOES_NOT_END_WITH = "doesNotEndWith", t.CONTAINS = "contains", t.DOES_NOT_CONTAIN = "doesNotContain", t.EQUALS = "equals", t.NOT_EQUALS = "notEquals", t.EMPTY = "empty", t.NOT_EMPTY = "notEmpty", t.BETWEEN = "between", t.NOT_BETWEEN = "notBetween", t.CUSTOM = "custom", t))(_ || {}),
|
|
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 Ct, 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 Ft } 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 Cr } from "@univerjs/ui";
|
|
9
|
+
import { SetCellEditVisibleOperation as Fr, 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 C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SECOND", t))(C || {}), _ = /* @__PURE__ */ ((t) => (t.NONE = "none", t.STARTS_WITH = "startsWith", t.DOES_NOT_START_WITH = "doesNotStartWith", t.ENDS_WITH = "endsWith", t.DOES_NOT_END_WITH = "doesNotEndWith", t.CONTAINS = "contains", t.DOES_NOT_CONTAIN = "doesNotContain", t.EQUALS = "equals", t.NOT_EQUALS = "notEquals", t.EMPTY = "empty", t.NOT_EMPTY = "notEmpty", t.BETWEEN = "between", t.NOT_BETWEEN = "notBetween", t.CUSTOM = "custom", t))(_ || {}), d;
|
|
17
17
|
((t) => {
|
|
18
18
|
t.NONE = {
|
|
19
19
|
label: "sheets-filter.conditions.none",
|
|
@@ -23,9 +23,9 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
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,
|
|
@@ -34,13 +34,13 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
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 = {
|
|
@@ -51,13 +51,13 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
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 = {
|
|
@@ -66,21 +66,21 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
66
66
|
order: C.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 = {
|
|
@@ -89,18 +89,18 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
89
89
|
order: C.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 = {
|
|
@@ -109,18 +109,18 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
109
109
|
order: C.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 = {
|
|
@@ -129,18 +129,18 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
129
129
|
order: C.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 = {
|
|
@@ -149,19 +149,19 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
149
149
|
order: C.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",
|
|
@@ -169,18 +169,18 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
169
169
|
numOfParameters: 1,
|
|
170
170
|
order: C.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 = {
|
|
@@ -189,18 +189,18 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
189
189
|
numOfParameters: 1,
|
|
190
190
|
order: C.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 = {
|
|
@@ -209,18 +209,18 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
209
209
|
numOfParameters: 1,
|
|
210
210
|
order: C.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 = {
|
|
@@ -229,18 +229,18 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
229
229
|
numOfParameters: 1,
|
|
230
230
|
order: C.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 = {
|
|
@@ -249,18 +249,18 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
249
249
|
numOfParameters: 1,
|
|
250
250
|
order: C.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 = {
|
|
@@ -269,18 +269,18 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
269
269
|
numOfParameters: 1,
|
|
270
270
|
order: C.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 = {
|
|
@@ -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(),
|
|
@@ -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,
|
|
@@ -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), F = g(m, c), N = {
|
|
407
407
|
customFilters: [
|
|
408
|
-
|
|
409
|
-
|
|
408
|
+
v.customFilters.customFilters[0],
|
|
409
|
+
F.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", Ce = _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, F, 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((F = I.value) == null ? void 0 : F.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
|
+
}, Fe = (t, e) => (r, s) => e(r, s, t), ye = /* @__PURE__ */ ((t) => (t[t.VALUES = 0] = "VALUES", t[t.CONDITIONS = 1] = "CONDITIONS", t))(ye || {});
|
|
673
|
+
_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
|
+
Fe(0, E(X)),
|
|
792
|
+
Fe(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
|
+
Fe(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(Ce, vt.OPTIONAL), { unitId: o, subUnitId: a } = r, c = n.getUniverSheetInstance(o);
|
|
924
924
|
if (!c) throw new Error(`[ByValuesModel]: Workbook not found for filter model with unitId: ${o}!`);
|
|
925
925
|
const h = c == null ? void 0 : c.getSheetBySheetId(a);
|
|
926
926
|
if (!h) throw new Error(`[ByValuesModel]: Worksheet not found for filter model with unitId: ${o} and subUnitId: ${a}!`);
|
|
927
|
-
const
|
|
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), F = 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(F),
|
|
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, F, 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,582 @@ let Ie = class extends pe {
|
|
|
1031
1031
|
}
|
|
1032
1032
|
// #endregion
|
|
1033
1033
|
};
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
],
|
|
1037
|
-
const
|
|
1034
|
+
Re = et([
|
|
1035
|
+
Fe(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(Fr.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, F, 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: F,
|
|
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((F) => {
|
|
1426
|
+
T.push(F.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 F;
|
|
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 = (F = te(V).activeFilterModel) == null ? void 0 : F.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": !0,
|
|
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-bg-black
|
|
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(
|
|
1474
|
+
"div",
|
|
1475
|
+
{
|
|
1476
|
+
"data-u-comp-sheets-filter-panel-header": !0,
|
|
1477
|
+
className: "univer-mb-1 univer-flex-shrink-0 univer-flex-grow-0",
|
|
1478
|
+
children: /* @__PURE__ */ S(
|
|
1479
|
+
jr,
|
|
1480
|
+
{
|
|
1481
|
+
value: s,
|
|
1482
|
+
items: i,
|
|
1483
|
+
onChange: (N) => a(N)
|
|
1484
|
+
}
|
|
1485
|
+
)
|
|
1486
|
+
}
|
|
1487
|
+
),
|
|
1488
|
+
n ? /* @__PURE__ */ S(
|
|
1489
|
+
"div",
|
|
1490
|
+
{
|
|
1491
|
+
"data-u-comp-sheets-filter-panel-content": !0,
|
|
1492
|
+
className: "univer-flex-shrink univer-flex-grow univer-pt-2",
|
|
1493
|
+
children: s === ye.VALUES ? /* @__PURE__ */ S(di, { model: n }) : /* @__PURE__ */ S(ci, { model: n })
|
|
1494
|
+
}
|
|
1495
|
+
) : /* @__PURE__ */ S("div", { style: { flex: 1 } }),
|
|
1496
|
+
/* @__PURE__ */ b(
|
|
1497
|
+
"div",
|
|
1498
|
+
{
|
|
1499
|
+
"data-u-comp-sheets-filter-panel-footer": !0,
|
|
1500
|
+
className: `
|
|
1501
|
+
univer-mt-4 univer-inline-flex univer-flex-shrink-0 univer-flex-grow-0 univer-flex-nowrap
|
|
1502
|
+
univer-justify-between univer-overflow-hidden
|
|
1503
|
+
`,
|
|
1504
|
+
children: [
|
|
1505
|
+
/* @__PURE__ */ S(Ue, { variant: "link", onClick: c, disabled: o, children: e.t("sheets-filter.panel.clear-filter") }),
|
|
1506
|
+
/* @__PURE__ */ b("span", { className: "univer-space-x-2", children: [
|
|
1507
|
+
/* @__PURE__ */ S(Ue, { variant: "default", onClick: h, children: e.t("sheets-filter.panel.cancel") }),
|
|
1508
|
+
/* @__PURE__ */ S(Ue, { disabled: !l, variant: "primary", onClick: m, children: e.t("sheets-filter.panel.confirm") })
|
|
1509
|
+
] })
|
|
1510
|
+
]
|
|
1511
|
+
}
|
|
1512
|
+
)
|
|
1513
|
+
]
|
|
1514
|
+
}
|
|
1515
|
+
);
|
|
1408
1516
|
}
|
|
1409
|
-
function
|
|
1517
|
+
function pi(t) {
|
|
1410
1518
|
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:
|
|
1519
|
+
return ze(() => [
|
|
1520
|
+
{ label: t.t("sheets-filter.panel.by-values"), value: ye.VALUES },
|
|
1521
|
+
{ label: t.t("sheets-filter.panel.by-conditions"), value: ye.CONDITIONS }
|
|
1414
1522
|
], [e, t]);
|
|
1415
1523
|
}
|
|
1416
|
-
function
|
|
1417
|
-
const e = t.get(
|
|
1524
|
+
function fi(t) {
|
|
1525
|
+
const e = t.get(V);
|
|
1418
1526
|
return {
|
|
1419
|
-
id:
|
|
1420
|
-
type:
|
|
1527
|
+
id: pe.id,
|
|
1528
|
+
type: Xe.BUTTON_SELECTOR,
|
|
1421
1529
|
icon: "FilterSingle",
|
|
1422
1530
|
tooltip: "sheets-filter.toolbar.smart-toggle-filter-tooltip",
|
|
1423
|
-
hidden$:
|
|
1531
|
+
hidden$: Ke(t, Z.UNIVER_SHEET),
|
|
1424
1532
|
activated$: e.activeFilterModel$.pipe(ie((r) => !!r)),
|
|
1425
|
-
disabled$:
|
|
1533
|
+
disabled$: Or(t, Rr(t, { worksheetTypes: [ae, le], rangeTypes: [ce] }))
|
|
1426
1534
|
};
|
|
1427
1535
|
}
|
|
1428
|
-
function
|
|
1429
|
-
const e = t.get(
|
|
1536
|
+
function _i(t) {
|
|
1537
|
+
const e = t.get(V);
|
|
1430
1538
|
return {
|
|
1431
|
-
id:
|
|
1432
|
-
type:
|
|
1539
|
+
id: qe.id,
|
|
1540
|
+
type: Xe.BUTTON,
|
|
1433
1541
|
title: "sheets-filter.toolbar.clear-filter-criteria",
|
|
1434
|
-
hidden$:
|
|
1435
|
-
disabled$: e.activeFilterModel$.pipe(
|
|
1436
|
-
var
|
|
1437
|
-
return (
|
|
1542
|
+
hidden$: Ke(t, Z.UNIVER_SHEET),
|
|
1543
|
+
disabled$: e.activeFilterModel$.pipe(Ze((r) => {
|
|
1544
|
+
var s;
|
|
1545
|
+
return (s = r == null ? void 0 : r.hasCriteria$.pipe(ie((n) => !n))) != null ? s : fe(!0);
|
|
1438
1546
|
}))
|
|
1439
1547
|
};
|
|
1440
1548
|
}
|
|
1441
|
-
function
|
|
1442
|
-
const e = t.get(
|
|
1549
|
+
function vi(t) {
|
|
1550
|
+
const e = t.get(V);
|
|
1443
1551
|
return {
|
|
1444
|
-
id:
|
|
1445
|
-
type:
|
|
1552
|
+
id: Ye.id,
|
|
1553
|
+
type: Xe.BUTTON,
|
|
1446
1554
|
title: "sheets-filter.toolbar.re-calc-filter-conditions",
|
|
1447
|
-
hidden$:
|
|
1448
|
-
disabled$: e.activeFilterModel$.pipe(
|
|
1449
|
-
var
|
|
1450
|
-
return (
|
|
1555
|
+
hidden$: Ke(t, Z.UNIVER_SHEET),
|
|
1556
|
+
disabled$: e.activeFilterModel$.pipe(Ze((r) => {
|
|
1557
|
+
var s;
|
|
1558
|
+
return (s = r == null ? void 0 : r.hasCriteria$.pipe(ie((n) => !n))) != null ? s : fe(!0);
|
|
1451
1559
|
}))
|
|
1452
1560
|
};
|
|
1453
1561
|
}
|
|
1454
|
-
const
|
|
1455
|
-
[
|
|
1456
|
-
[
|
|
1562
|
+
const gi = {
|
|
1563
|
+
[gr.FORMULAS_INSERT]: {
|
|
1564
|
+
[pe.id]: {
|
|
1457
1565
|
order: 10,
|
|
1458
|
-
menuItemFactory:
|
|
1459
|
-
[
|
|
1566
|
+
menuItemFactory: fi,
|
|
1567
|
+
[qe.id]: {
|
|
1460
1568
|
order: 0,
|
|
1461
|
-
menuItemFactory:
|
|
1569
|
+
menuItemFactory: _i
|
|
1462
1570
|
},
|
|
1463
|
-
[
|
|
1571
|
+
[Ye.id]: {
|
|
1464
1572
|
order: 1,
|
|
1465
|
-
menuItemFactory:
|
|
1573
|
+
menuItemFactory: vi
|
|
1466
1574
|
}
|
|
1467
1575
|
}
|
|
1468
1576
|
}
|
|
1469
|
-
},
|
|
1470
|
-
class
|
|
1471
|
-
static drawNoCriteria(e, r,
|
|
1472
|
-
e.save(),
|
|
1577
|
+
}, 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");
|
|
1578
|
+
class ut {
|
|
1579
|
+
static drawNoCriteria(e, r, s, n) {
|
|
1580
|
+
e.save(), at.drawWith(e, {
|
|
1473
1581
|
radius: 2,
|
|
1474
|
-
width:
|
|
1475
|
-
height:
|
|
1582
|
+
width: x,
|
|
1583
|
+
height: x,
|
|
1476
1584
|
fill: n
|
|
1477
|
-
}), e.lineCap = "square", e.strokeStyle =
|
|
1585
|
+
}), 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
1586
|
}
|
|
1479
|
-
static drawHasCriteria(e, r,
|
|
1480
|
-
e.save(),
|
|
1587
|
+
static drawHasCriteria(e, r, s, n) {
|
|
1588
|
+
e.save(), at.drawWith(e, {
|
|
1481
1589
|
radius: 2,
|
|
1482
|
-
width:
|
|
1483
|
-
height:
|
|
1590
|
+
width: x,
|
|
1591
|
+
height: x,
|
|
1484
1592
|
fill: n
|
|
1485
|
-
}), e.scale(r /
|
|
1593
|
+
}), e.scale(r / x, r / x), e.fillStyle = s, e.fill(Si), e.restore();
|
|
1486
1594
|
}
|
|
1487
1595
|
}
|
|
1488
|
-
var
|
|
1489
|
-
for (var n =
|
|
1490
|
-
(
|
|
1596
|
+
var Ei = Object.getOwnPropertyDescriptor, Ti = (t, e, r, s) => {
|
|
1597
|
+
for (var n = s > 1 ? void 0 : s ? Ei(e, r) : e, l = t.length - 1, i; l >= 0; l--)
|
|
1598
|
+
(i = t[l]) && (n = i(n) || n);
|
|
1491
1599
|
return n;
|
|
1492
|
-
},
|
|
1493
|
-
const
|
|
1494
|
-
let Qe = class extends
|
|
1495
|
-
constructor(e, r,
|
|
1600
|
+
}, De = (t, e) => (r, s) => e(r, s, t);
|
|
1601
|
+
const H = 16, Se = 1;
|
|
1602
|
+
let Qe = class extends qr {
|
|
1603
|
+
constructor(e, r, s, n, l) {
|
|
1496
1604
|
super(e, r);
|
|
1497
1605
|
f(this, "_cellWidth", 0);
|
|
1498
1606
|
f(this, "_cellHeight", 0);
|
|
1499
1607
|
f(this, "_filterParams");
|
|
1500
1608
|
f(this, "_hovered", !1);
|
|
1501
|
-
this._contextService =
|
|
1609
|
+
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
1610
|
}
|
|
1503
1611
|
setShapeProps(e) {
|
|
1504
1612
|
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 +1615,20 @@ let Qe = class extends Kr {
|
|
|
1507
1615
|
});
|
|
1508
1616
|
}
|
|
1509
1617
|
_draw(e) {
|
|
1510
|
-
const r = this._cellHeight,
|
|
1618
|
+
const r = this._cellHeight, s = this._cellWidth, n = H - s, l = H - r;
|
|
1511
1619
|
e.save();
|
|
1512
|
-
const
|
|
1513
|
-
|
|
1620
|
+
const i = new Path2D();
|
|
1621
|
+
i.rect(n, l, s, r), e.clip(i);
|
|
1514
1622
|
const { hasCriteria: o } = this._filterParams, a = this._themeService.getCurrentTheme().primaryColor, c = this._hovered ? this._themeService.getCurrentTheme().grey50 : "rgba(255, 255, 255, 1.0)";
|
|
1515
|
-
o ?
|
|
1623
|
+
o ? ut.drawHasCriteria(e, H, a, c) : ut.drawNoCriteria(e, H, a, c), e.restore();
|
|
1516
1624
|
}
|
|
1517
1625
|
onPointerDown(e) {
|
|
1518
1626
|
if (e.button === 2)
|
|
1519
1627
|
return;
|
|
1520
|
-
const { col: r, unitId:
|
|
1521
|
-
this._contextService.getContextValue(
|
|
1522
|
-
this._commandService.executeCommand(
|
|
1523
|
-
unitId:
|
|
1628
|
+
const { col: r, unitId: s, subUnitId: n } = this._filterParams;
|
|
1629
|
+
this._contextService.getContextValue(se) || !this._commandService.hasCommand(Ie.id) || setTimeout(() => {
|
|
1630
|
+
this._commandService.executeCommand(Ie.id, {
|
|
1631
|
+
unitId: s,
|
|
1524
1632
|
subUnitId: n,
|
|
1525
1633
|
col: r
|
|
1526
1634
|
});
|
|
@@ -1533,62 +1641,62 @@ let Qe = class extends Kr {
|
|
|
1533
1641
|
this._hovered = !1, this.makeDirty(!0);
|
|
1534
1642
|
}
|
|
1535
1643
|
};
|
|
1536
|
-
Qe =
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1644
|
+
Qe = Ti([
|
|
1645
|
+
De(2, Me),
|
|
1646
|
+
De(3, Q),
|
|
1647
|
+
De(4, E(gt))
|
|
1540
1648
|
], Qe);
|
|
1541
|
-
var
|
|
1542
|
-
for (var n =
|
|
1543
|
-
(
|
|
1649
|
+
var Ni = Object.getOwnPropertyDescriptor, Ci = (t, e, r, s) => {
|
|
1650
|
+
for (var n = s > 1 ? void 0 : s ? Ni(e, r) : e, l = t.length - 1, i; l >= 0; l--)
|
|
1651
|
+
(i = t[l]) && (n = i(n) || n);
|
|
1544
1652
|
return n;
|
|
1545
|
-
},
|
|
1546
|
-
const
|
|
1547
|
-
let
|
|
1548
|
-
constructor(e, r,
|
|
1653
|
+
}, Y = (t, e) => (r, s) => e(r, s, t);
|
|
1654
|
+
const Fi = 1e3, yi = 5e3;
|
|
1655
|
+
let Ve = class extends St {
|
|
1656
|
+
constructor(e, r, s, n, l, i, o, a) {
|
|
1549
1657
|
super();
|
|
1550
1658
|
f(this, "_filterRangeShape", null);
|
|
1551
1659
|
f(this, "_buttonRenderDisposable", null);
|
|
1552
1660
|
f(this, "_filterButtonShapes", []);
|
|
1553
|
-
this._context = e, this._injector = r, this._sheetSkeletonManagerService =
|
|
1661
|
+
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
1662
|
}
|
|
1555
1663
|
dispose() {
|
|
1556
1664
|
super.dispose(), this._disposeRendering();
|
|
1557
1665
|
}
|
|
1558
1666
|
_initRenderer() {
|
|
1559
1667
|
this._sheetSkeletonManagerService.currentSkeleton$.pipe(
|
|
1560
|
-
|
|
1668
|
+
Ze((e) => {
|
|
1561
1669
|
var o, a;
|
|
1562
|
-
if (!e) return
|
|
1563
|
-
const { unit: r, unitId:
|
|
1564
|
-
unitId:
|
|
1670
|
+
if (!e) return fe(null);
|
|
1671
|
+
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 = () => ({
|
|
1672
|
+
unitId: s,
|
|
1565
1673
|
worksheetId: n,
|
|
1566
1674
|
filterModel: l,
|
|
1567
1675
|
range: l == null ? void 0 : l.getRange(),
|
|
1568
1676
|
skeleton: e.skeleton
|
|
1569
1677
|
});
|
|
1570
|
-
return
|
|
1571
|
-
|
|
1678
|
+
return Kt(this._commandService.onCommandExecuted.bind(this._commandService)).pipe(
|
|
1679
|
+
xr(
|
|
1572
1680
|
([c]) => {
|
|
1573
1681
|
var h;
|
|
1574
|
-
return c.type ===
|
|
1682
|
+
return c.type === Le.MUTATION && ((h = c.params) == null ? void 0 : h.unitId) === r.getUnitId() && (er.has(c.id) || c.id === mr.id);
|
|
1575
1683
|
}
|
|
1576
1684
|
),
|
|
1577
|
-
|
|
1578
|
-
ie(
|
|
1579
|
-
|
|
1685
|
+
Ot(20, void 0, { leading: !1, trailing: !0 }),
|
|
1686
|
+
ie(i),
|
|
1687
|
+
Rt(i())
|
|
1580
1688
|
// must trigger once
|
|
1581
1689
|
);
|
|
1582
1690
|
}),
|
|
1583
|
-
|
|
1691
|
+
Br(this.dispose$)
|
|
1584
1692
|
).subscribe((e) => {
|
|
1585
1693
|
this._disposeRendering(), !(!e || !e.range) && (this._renderRange(e.range, e.skeleton), this._renderButtons(e));
|
|
1586
1694
|
});
|
|
1587
1695
|
}
|
|
1588
1696
|
_renderRange(e, r) {
|
|
1589
|
-
const { scene:
|
|
1590
|
-
|
|
1591
|
-
|
|
1697
|
+
const { scene: s } = this._context, { rowHeaderWidth: n, columnHeaderHeight: l } = r, i = this._filterRangeShape = new Pr(
|
|
1698
|
+
s,
|
|
1699
|
+
Fi,
|
|
1592
1700
|
this._themeService,
|
|
1593
1701
|
{
|
|
1594
1702
|
rowHeaderWidth: n,
|
|
@@ -1596,46 +1704,46 @@ let Ge = class extends Et {
|
|
|
1596
1704
|
enableAutoFill: !1,
|
|
1597
1705
|
highlightHeader: !1
|
|
1598
1706
|
}
|
|
1599
|
-
), a =
|
|
1707
|
+
), a = br({
|
|
1600
1708
|
range: e,
|
|
1601
1709
|
primary: null,
|
|
1602
1710
|
style: { fill: "rgba(0, 0, 0, 0.0)" }
|
|
1603
1711
|
}, r);
|
|
1604
|
-
|
|
1712
|
+
i.updateRangeBySelectionWithCoord(a), i.setEvent(!1), s.makeDirty(!0);
|
|
1605
1713
|
}
|
|
1606
1714
|
_renderButtons(e) {
|
|
1607
|
-
const { range: r, filterModel:
|
|
1608
|
-
this._interceptCellContent(n,
|
|
1715
|
+
const { range: r, filterModel: s, unitId: n, skeleton: l, worksheetId: i } = e, { scene: o } = this._context;
|
|
1716
|
+
this._interceptCellContent(n, i, e.range);
|
|
1609
1717
|
const { startColumn: a, endColumn: c, startRow: h } = r;
|
|
1610
|
-
for (let
|
|
1611
|
-
const
|
|
1612
|
-
if (O <=
|
|
1718
|
+
for (let m = a; m <= c; m++) {
|
|
1719
|
+
const g = `sheets-filter-button-${m}`, p = Lr(h, m, o, l), { startX: T, startY: v, endX: F, endY: N } = p, R = F - T, O = N - v;
|
|
1720
|
+
if (O <= Se || R <= Se)
|
|
1613
1721
|
continue;
|
|
1614
|
-
const
|
|
1722
|
+
const M = !!s.getFilterColumn(m), w = F - H - Se, _e = N - H - Se, ve = {
|
|
1615
1723
|
left: w,
|
|
1616
|
-
top:
|
|
1617
|
-
height:
|
|
1618
|
-
width:
|
|
1619
|
-
zIndex:
|
|
1724
|
+
top: _e,
|
|
1725
|
+
height: H,
|
|
1726
|
+
width: H,
|
|
1727
|
+
zIndex: yi,
|
|
1620
1728
|
cellHeight: O,
|
|
1621
|
-
cellWidth:
|
|
1622
|
-
filterParams: { unitId: n, subUnitId:
|
|
1623
|
-
},
|
|
1624
|
-
this._filterButtonShapes.push(
|
|
1729
|
+
cellWidth: R,
|
|
1730
|
+
filterParams: { unitId: n, subUnitId: i, col: m, hasCriteria: M }
|
|
1731
|
+
}, I = this._injector.createInstance(Qe, g, ve);
|
|
1732
|
+
this._filterButtonShapes.push(I);
|
|
1625
1733
|
}
|
|
1626
1734
|
o.addObjects(this._filterButtonShapes), o.makeDirty();
|
|
1627
1735
|
}
|
|
1628
|
-
_interceptCellContent(e, r,
|
|
1629
|
-
const { startRow: n, startColumn: l, endColumn:
|
|
1630
|
-
this._buttonRenderDisposable = this._sheetInterceptorService.intercept(
|
|
1631
|
-
effect:
|
|
1736
|
+
_interceptCellContent(e, r, s) {
|
|
1737
|
+
const { startRow: n, startColumn: l, endColumn: i } = s;
|
|
1738
|
+
this._buttonRenderDisposable = this._sheetInterceptorService.intercept(pr.CELL_CONTENT, {
|
|
1739
|
+
effect: Xt.Style,
|
|
1632
1740
|
handler: (o, a, c) => {
|
|
1633
|
-
const { row: h, col:
|
|
1634
|
-
return
|
|
1741
|
+
const { row: h, col: m, unitId: g, subUnitId: p } = a;
|
|
1742
|
+
return g !== e || p !== r || h !== n || m < l || m > i ? c(o) : c({
|
|
1635
1743
|
...o,
|
|
1636
1744
|
fontRenderExtension: {
|
|
1637
1745
|
...o == null ? void 0 : o.fontRenderExtension,
|
|
1638
|
-
rightOffset:
|
|
1746
|
+
rightOffset: H
|
|
1639
1747
|
}
|
|
1640
1748
|
});
|
|
1641
1749
|
},
|
|
@@ -1644,93 +1752,93 @@ let Ge = class extends Et {
|
|
|
1644
1752
|
}
|
|
1645
1753
|
_disposeRendering() {
|
|
1646
1754
|
var e, r;
|
|
1647
|
-
(e = this._filterRangeShape) == null || e.dispose(), this._filterButtonShapes.forEach((
|
|
1755
|
+
(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
1756
|
}
|
|
1649
1757
|
};
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
],
|
|
1659
|
-
var
|
|
1660
|
-
for (var n =
|
|
1661
|
-
(
|
|
1758
|
+
Ve = Ci([
|
|
1759
|
+
Y(1, E(X)),
|
|
1760
|
+
Y(2, E(Ir)),
|
|
1761
|
+
Y(3, E(V)),
|
|
1762
|
+
Y(4, E(gt)),
|
|
1763
|
+
Y(5, E(dr)),
|
|
1764
|
+
Y(6, Q),
|
|
1765
|
+
Y(7, Ar)
|
|
1766
|
+
], Ve);
|
|
1767
|
+
var Oi = Object.getOwnPropertyDescriptor, Ri = (t, e, r, s) => {
|
|
1768
|
+
for (var n = s > 1 ? void 0 : s ? Oi(e, r) : e, l = t.length - 1, i; l >= 0; l--)
|
|
1769
|
+
(i = t[l]) && (n = i(n) || n);
|
|
1662
1770
|
return n;
|
|
1663
|
-
},
|
|
1664
|
-
let de = class extends
|
|
1771
|
+
}, ht = (t, e) => (r, s) => e(r, s, t);
|
|
1772
|
+
let de = class extends St {
|
|
1665
1773
|
constructor(t, e) {
|
|
1666
1774
|
super(), this._renderManagerService = t, this._sheetsRenderService = e, [
|
|
1775
|
+
tr,
|
|
1667
1776
|
rr,
|
|
1668
|
-
sr,
|
|
1669
1777
|
ir,
|
|
1670
|
-
|
|
1778
|
+
sr
|
|
1671
1779
|
].forEach((r) => this.disposeWithMe(this._sheetsRenderService.registerSkeletonChangingMutations(r.id))), this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
1672
|
-
|
|
1673
|
-
[
|
|
1780
|
+
Z.UNIVER_SHEET,
|
|
1781
|
+
[Ve]
|
|
1674
1782
|
));
|
|
1675
1783
|
}
|
|
1676
1784
|
};
|
|
1677
|
-
de =
|
|
1678
|
-
|
|
1679
|
-
|
|
1785
|
+
de = Ri([
|
|
1786
|
+
ht(0, At),
|
|
1787
|
+
ht(1, E(yt))
|
|
1680
1788
|
], de);
|
|
1681
|
-
const
|
|
1682
|
-
id:
|
|
1683
|
-
binding:
|
|
1789
|
+
const Ii = {
|
|
1790
|
+
id: pe.id,
|
|
1791
|
+
binding: Sr.L | st.CTRL_COMMAND | st.SHIFT,
|
|
1684
1792
|
description: "sheets-filter.shortcut.smart-toggle-filter",
|
|
1685
|
-
preconditions:
|
|
1793
|
+
preconditions: Mr,
|
|
1686
1794
|
group: "4_sheet-edit"
|
|
1687
1795
|
};
|
|
1688
|
-
var
|
|
1689
|
-
for (var n =
|
|
1690
|
-
(
|
|
1796
|
+
var Ai = Object.getOwnPropertyDescriptor, Pi = (t, e, r, s) => {
|
|
1797
|
+
for (var n = s > 1 ? void 0 : s ? Ai(e, r) : e, l = t.length - 1, i; l >= 0; l--)
|
|
1798
|
+
(i = t[l]) && (n = i(n) || n);
|
|
1691
1799
|
return n;
|
|
1692
|
-
}, A = (t, e) => (r,
|
|
1800
|
+
}, A = (t, e) => (r, s) => e(r, s, t);
|
|
1693
1801
|
const dt = "FILTER_PANEL_POPUP";
|
|
1694
1802
|
let Ae = class extends de {
|
|
1695
|
-
constructor(e, r,
|
|
1696
|
-
super(p,
|
|
1803
|
+
constructor(e, r, s, n, l, i, o, a, c, h, m, g, p) {
|
|
1804
|
+
super(p, g);
|
|
1697
1805
|
f(this, "_popupDisposable");
|
|
1698
|
-
this._injector = e, this._componentManager = r, this._sheetsFilterPanelService =
|
|
1806
|
+
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
1807
|
}
|
|
1700
1808
|
dispose() {
|
|
1701
1809
|
super.dispose(), this._closeFilterPopup();
|
|
1702
1810
|
}
|
|
1703
1811
|
_initShortcuts() {
|
|
1704
1812
|
[
|
|
1705
|
-
|
|
1813
|
+
Ii
|
|
1706
1814
|
].forEach((e) => {
|
|
1707
1815
|
this.disposeWithMe(this._shortcutService.registerShortcut(e));
|
|
1708
1816
|
});
|
|
1709
1817
|
}
|
|
1710
1818
|
_initCommands() {
|
|
1711
1819
|
[
|
|
1712
|
-
|
|
1820
|
+
pe,
|
|
1821
|
+
nr,
|
|
1713
1822
|
or,
|
|
1714
|
-
|
|
1715
|
-
se,
|
|
1716
|
-
Ke,
|
|
1823
|
+
re,
|
|
1717
1824
|
qe,
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1825
|
+
Ye,
|
|
1826
|
+
Ut,
|
|
1827
|
+
Ie,
|
|
1828
|
+
he
|
|
1721
1829
|
].forEach((e) => {
|
|
1722
1830
|
this.disposeWithMe(this._commandService.registerCommand(e));
|
|
1723
1831
|
});
|
|
1724
1832
|
}
|
|
1725
1833
|
_initMenuItems() {
|
|
1726
|
-
this._menuManagerService.mergeMenu(
|
|
1834
|
+
this._menuManagerService.mergeMenu(gi);
|
|
1727
1835
|
}
|
|
1728
1836
|
_initUI() {
|
|
1729
|
-
this.disposeWithMe(this._componentManager.register(dt,
|
|
1837
|
+
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
1838
|
e ? this._openFilterPopup() : this._closeFilterPopup();
|
|
1731
1839
|
})), this.disposeWithMe(this._sheetsFilterService.errorMsg$.subscribe((e) => {
|
|
1732
1840
|
e && this._messageService.show({
|
|
1733
|
-
type:
|
|
1841
|
+
type: Yr.Error,
|
|
1734
1842
|
content: this._localeService.t(e)
|
|
1735
1843
|
});
|
|
1736
1844
|
}));
|
|
@@ -1739,11 +1847,11 @@ let Ae = class extends de {
|
|
|
1739
1847
|
const e = this._sheetsFilterPanelService.filterModel;
|
|
1740
1848
|
if (!e)
|
|
1741
1849
|
throw new Error("[SheetsFilterUIController]: no filter model when opening filter popup!");
|
|
1742
|
-
const r = e.getRange(),
|
|
1743
|
-
this._popupDisposable = this._sheetCanvasPopupService.attachPopupToCell(n,
|
|
1850
|
+
const r = e.getRange(), s = this._sheetsFilterPanelService.col, { startRow: n } = r;
|
|
1851
|
+
this._popupDisposable = this._sheetCanvasPopupService.attachPopupToCell(n, s, {
|
|
1744
1852
|
componentKey: dt,
|
|
1745
1853
|
direction: "horizontal",
|
|
1746
|
-
onClickOutside: () => this._commandService.syncExecuteCommand(
|
|
1854
|
+
onClickOutside: () => this._commandService.syncExecuteCommand(he.id),
|
|
1747
1855
|
offset: [5, 0]
|
|
1748
1856
|
});
|
|
1749
1857
|
}
|
|
@@ -1752,129 +1860,129 @@ let Ae = class extends de {
|
|
|
1752
1860
|
(e = this._popupDisposable) == null || e.dispose(), this._popupDisposable = null;
|
|
1753
1861
|
}
|
|
1754
1862
|
};
|
|
1755
|
-
Ae =
|
|
1756
|
-
A(0, E(
|
|
1757
|
-
A(1, E(
|
|
1758
|
-
A(2, E(
|
|
1863
|
+
Ae = Pi([
|
|
1864
|
+
A(0, E(X)),
|
|
1865
|
+
A(1, E(Er)),
|
|
1866
|
+
A(2, E(W)),
|
|
1759
1867
|
A(3, E(wr)),
|
|
1760
|
-
A(4, E(
|
|
1761
|
-
A(5, E(
|
|
1762
|
-
A(6,
|
|
1868
|
+
A(4, E(V)),
|
|
1869
|
+
A(5, E(K)),
|
|
1870
|
+
A(6, Tr),
|
|
1763
1871
|
A(7, Q),
|
|
1764
|
-
A(8,
|
|
1765
|
-
A(9,
|
|
1766
|
-
A(10,
|
|
1767
|
-
A(11, E(
|
|
1872
|
+
A(8, Nr),
|
|
1873
|
+
A(9, Me),
|
|
1874
|
+
A(10, Cr),
|
|
1875
|
+
A(11, E(yt)),
|
|
1768
1876
|
A(12, At)
|
|
1769
1877
|
], Ae);
|
|
1770
|
-
var
|
|
1771
|
-
for (var n =
|
|
1772
|
-
(
|
|
1878
|
+
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) => {
|
|
1879
|
+
for (var n = s > 1 ? void 0 : s ? Li(e, r) : e, l = t.length - 1, i; l >= 0; l--)
|
|
1880
|
+
(i = t[l]) && (n = i(n) || n);
|
|
1773
1881
|
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 } =
|
|
1882
|
+
}, ke = (t, e) => (r, s) => e(r, s, t), xt = (t, e, r) => Mi(t, typeof e != "symbol" ? e + "" : e, r);
|
|
1883
|
+
const $i = "SHEET_FILTER_UI_PLUGIN";
|
|
1884
|
+
let Pe = class extends je {
|
|
1885
|
+
constructor(t = Ne, e, r, s) {
|
|
1886
|
+
super(), this._config = t, this._injector = e, this._configService = r, this._rpcChannelService = s;
|
|
1887
|
+
const { menu: n, ...l } = Nt(
|
|
1780
1888
|
{},
|
|
1781
|
-
|
|
1889
|
+
Ne,
|
|
1782
1890
|
this._config
|
|
1783
1891
|
);
|
|
1784
|
-
n && this._configService.setConfig("menu", n, { merge: !0 }), this._configService.setConfig(
|
|
1892
|
+
n && this._configService.setConfig("menu", n, { merge: !0 }), this._configService.setConfig(Lt, l);
|
|
1785
1893
|
}
|
|
1786
1894
|
onStarting() {
|
|
1787
1895
|
[
|
|
1788
|
-
[
|
|
1789
|
-
[
|
|
1896
|
+
[W],
|
|
1897
|
+
[ne],
|
|
1790
1898
|
[Ae]
|
|
1791
|
-
].forEach((t) => this._injector.add(t)), this._config.useRemoteFilterValuesGenerator && this._rpcChannelService && this._injector.add([
|
|
1792
|
-
useFactory: () =>
|
|
1793
|
-
this._rpcChannelService.requestChannel(
|
|
1899
|
+
].forEach((t) => this._injector.add(t)), this._config.useRemoteFilterValuesGenerator && this._rpcChannelService && this._injector.add([Ce, {
|
|
1900
|
+
useFactory: () => zt(
|
|
1901
|
+
this._rpcChannelService.requestChannel(Je)
|
|
1794
1902
|
)
|
|
1795
1903
|
}]);
|
|
1796
1904
|
}
|
|
1797
1905
|
onReady() {
|
|
1798
|
-
this._injector.get(
|
|
1906
|
+
this._injector.get(ne);
|
|
1799
1907
|
}
|
|
1800
1908
|
onRendered() {
|
|
1801
1909
|
this._injector.get(Ae);
|
|
1802
1910
|
}
|
|
1803
1911
|
};
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
],
|
|
1812
|
-
var
|
|
1813
|
-
for (var n =
|
|
1814
|
-
(
|
|
1912
|
+
xt(Pe, "type", Z.UNIVER_SHEET);
|
|
1913
|
+
xt(Pe, "pluginName", $i);
|
|
1914
|
+
Pe = wi([
|
|
1915
|
+
Et(Ft),
|
|
1916
|
+
ke(1, E(X)),
|
|
1917
|
+
ke(2, Tt),
|
|
1918
|
+
ke(3, Zt(Ct))
|
|
1919
|
+
], Pe);
|
|
1920
|
+
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) => {
|
|
1921
|
+
for (var n = s > 1 ? void 0 : s ? Hi(e, r) : e, l = t.length - 1, i; l >= 0; l--)
|
|
1922
|
+
(i = t[l]) && (n = i(n) || n);
|
|
1815
1923
|
return n;
|
|
1816
|
-
},
|
|
1817
|
-
const
|
|
1818
|
-
let
|
|
1819
|
-
constructor(t =
|
|
1924
|
+
}, mt = (t, e) => (r, s) => e(r, s, t), Bt = (t, e, r) => Di(t, typeof e != "symbol" ? e + "" : e, r);
|
|
1925
|
+
const xi = "SHEET_FILTER_UI_PLUGIN";
|
|
1926
|
+
let be = class extends je {
|
|
1927
|
+
constructor(t = Ne, e, r) {
|
|
1820
1928
|
super(), this._config = t, this._injector = e, this._configService = r;
|
|
1821
|
-
const { menu:
|
|
1929
|
+
const { menu: s, ...n } = Nt(
|
|
1822
1930
|
{},
|
|
1823
|
-
|
|
1931
|
+
Ne,
|
|
1824
1932
|
this._config
|
|
1825
1933
|
);
|
|
1826
|
-
|
|
1934
|
+
s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(Lt, n);
|
|
1827
1935
|
}
|
|
1828
1936
|
onStarting() {
|
|
1829
1937
|
[
|
|
1830
|
-
[
|
|
1938
|
+
[ne],
|
|
1831
1939
|
[de]
|
|
1832
1940
|
].forEach((t) => this._injector.add(t));
|
|
1833
1941
|
}
|
|
1834
1942
|
onReady() {
|
|
1835
|
-
this._injector.get(
|
|
1943
|
+
this._injector.get(ne);
|
|
1836
1944
|
}
|
|
1837
1945
|
onRendered() {
|
|
1838
1946
|
this._injector.get(de);
|
|
1839
1947
|
}
|
|
1840
1948
|
};
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
],
|
|
1848
|
-
var
|
|
1849
|
-
for (var n =
|
|
1850
|
-
(
|
|
1949
|
+
Bt(be, "type", Z.UNIVER_SHEET);
|
|
1950
|
+
Bt(be, "pluginName", xi);
|
|
1951
|
+
be = ki([
|
|
1952
|
+
Et(Ft),
|
|
1953
|
+
mt(1, E(X)),
|
|
1954
|
+
mt(2, Tt)
|
|
1955
|
+
], be);
|
|
1956
|
+
var Bi = Object.getOwnPropertyDescriptor, Wi = (t, e, r, s) => {
|
|
1957
|
+
for (var n = s > 1 ? void 0 : s ? Bi(e, r) : e, l = t.length - 1, i; l >= 0; l--)
|
|
1958
|
+
(i = t[l]) && (n = i(n) || n);
|
|
1851
1959
|
return n;
|
|
1852
|
-
},
|
|
1853
|
-
let
|
|
1960
|
+
}, pt = (t, e) => (r, s) => e(r, s, t), Ee;
|
|
1961
|
+
let ft = (Ee = class extends je {
|
|
1854
1962
|
constructor(t, e, r) {
|
|
1855
1963
|
super(), this._config = t, this._injector = e, this._rpcChannelService = r;
|
|
1856
1964
|
}
|
|
1857
1965
|
onStarting() {
|
|
1858
1966
|
[
|
|
1859
|
-
[
|
|
1967
|
+
[Ce, { useClass: Be }]
|
|
1860
1968
|
].forEach((t) => this._injector.add(t));
|
|
1861
1969
|
}
|
|
1862
1970
|
onReady() {
|
|
1863
1971
|
this._rpcChannelService.registerChannel(
|
|
1864
|
-
|
|
1865
|
-
|
|
1972
|
+
Je,
|
|
1973
|
+
Jt(this._injector.get(Ce))
|
|
1866
1974
|
);
|
|
1867
1975
|
}
|
|
1868
|
-
}, f(
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
],
|
|
1976
|
+
}, f(Ee, "type", Z.UNIVER_SHEET), f(Ee, "pluginName", "SHEET_FILTER_UI_WORKER_PLUGIN"), Ee);
|
|
1977
|
+
ft = Wi([
|
|
1978
|
+
pt(1, E(X)),
|
|
1979
|
+
pt(2, Ct)
|
|
1980
|
+
], ft);
|
|
1873
1981
|
export {
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1982
|
+
Ut as ChangeFilterByOperation,
|
|
1983
|
+
he as CloseFilterPanelOperation,
|
|
1984
|
+
Ie as OpenFilterPanelOperation,
|
|
1985
|
+
be as UniverSheetsFilterMobileUIPlugin,
|
|
1986
|
+
Pe as UniverSheetsFilterUIPlugin,
|
|
1987
|
+
ft as UniverSheetsFilterUIWorkerPlugin
|
|
1880
1988
|
};
|