@univerjs/sheets-filter-ui 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +2 -2
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/index.js +1121 -815
- package/lib/es/locale/en-US.js +4 -0
- package/lib/es/locale/fa-IR.js +4 -0
- package/lib/es/locale/fr-FR.js +4 -0
- package/lib/es/locale/ko-KR.js +4 -0
- package/lib/es/locale/ru-RU.js +4 -0
- package/lib/es/locale/vi-VN.js +4 -0
- package/lib/es/locale/zh-CN.js +4 -0
- package/lib/es/locale/zh-TW.js +4 -0
- package/lib/index.css +1 -1
- package/lib/index.js +1121 -815
- package/lib/locale/en-US.js +4 -0
- package/lib/locale/fa-IR.js +4 -0
- package/lib/locale/fr-FR.js +4 -0
- package/lib/locale/ko-KR.js +4 -0
- package/lib/locale/ru-RU.js +4 -0
- package/lib/locale/vi-VN.js +4 -0
- package/lib/locale/zh-CN.js +4 -0
- package/lib/locale/zh-TW.js +4 -0
- package/lib/types/commands/operations/sheets-filter.operation.d.ts +1 -1
- package/lib/types/locale/en-US.d.ts +4 -0
- package/lib/types/services/sheets-filter-panel.service.d.ts +51 -5
- package/lib/types/views/components/SheetsFilterByColorsPanel.d.ts +7 -0
- package/lib/types/worker/generate-filter-values.service.d.ts +5 -2
- package/lib/umd/index.js +2 -2
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +12 -12
package/lib/es/index.js
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { BooleanNumber as
|
|
5
|
-
import { CustomFilterOperator as u, SetSheetsFilterCriteriaCommand as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { IRPCChannelService as
|
|
12
|
-
import {
|
|
13
|
-
import { jsx as
|
|
14
|
-
import { forwardRef as
|
|
15
|
-
var
|
|
1
|
+
var sr = Object.defineProperty;
|
|
2
|
+
var nr = (t, e, r) => e in t ? sr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var p = (t, e, r) => nr(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { BooleanNumber as ht, createIdentifier as Rt, Inject as T, LocaleService as K, IUniverInstanceService as De, ILogService as or, extractPureTextFromCell as lr, numfmt as dt, Disposable as de, Injector as re, Quantity as At, Tools as Re, ColorKit as mt, ICommandService as j, CommandType as Be, IContextService as We, ThemeService as Pt, RxDisposable as wt, fromCallback as ar, InterceptorEffectEnum as cr, UniverInstanceType as ie, DependentOn as Lt, IConfigService as $t, Plugin as tt, merge as Mt, Optional as ur, registerDependencies as hr, touchDependencies as ft } from "@univerjs/core";
|
|
5
|
+
import { CustomFilterOperator as u, FilterBy as A, SetSheetsFilterCriteriaCommand as Q, SheetsFilterService as q, SmartToggleSheetsFilterCommand as Ee, FILTER_MUTATIONS as dr, SetSheetsFilterRangeMutation as mr, SetSheetsFilterCriteriaMutation as fr, RemoveSheetsFilterMutation as pr, ReCalcSheetsFilterMutation as vr, UniverSheetsFilterPlugin as xt, ReCalcSheetsFilterCommand as rt, ClearSheetsFilterCriteriaCommand as it, RemoveSheetFilterCommand as _r, SetSheetFilterRangeCommand as gr } from "@univerjs/sheets-filter";
|
|
6
|
+
import { SetCellEditVisibleOperation as Sr, SheetSkeletonManagerService as Cr, ISheetSelectionRenderService as Tr, SelectionControl as Er, attachSelectionWithCoord as Nr, getCoordByCell as Fr, SheetsRenderService as Ut, SheetsUIPart as yr, getObservableWithExclusiveRange$ as Or, getCurrentRangeDisable$ as Ir, whenSheetEditorFocused as br, SheetCanvasPopManagerService as Rr } from "@univerjs/sheets-ui";
|
|
7
|
+
import { ILayoutService as Ar, useDependency as te, useObservable as H, useComponentsOfPart as Pr, ComponentContainer as wr, getMenuHiddenObservable as st, MenuItemType as nt, RibbonDataGroup as Lr, KeyCode as $r, MetaKeys as pt, ComponentManager as Mr, IShortcutService as xr, IMenuManagerService as Ur, IMessageService as kr } from "@univerjs/ui";
|
|
8
|
+
import { COLOR_BLACK_RGB as vt, Rect as _t, Shape as Hr, IRenderManagerService as kt } from "@univerjs/engine-render";
|
|
9
|
+
import { RefRangeService as Dr, SheetPermissionCheckController as Br, SheetsSelectionsService as Wr, getSheetCommandTarget as Qr, WorksheetFilterPermission as pe, WorksheetViewPermission as ve, RangeProtectionPermissionViewPoint as _e, expandToContinuousRange as Vr, SheetInterceptorService as jr, SetRangeValuesMutation as Gr, INTERCEPTOR_POINT as Yr } from "@univerjs/sheets";
|
|
10
|
+
import { BehaviorSubject as V, ReplaySubject as Zr, Subject as Kr, merge as qr, combineLatest as Xr, throttleTime as Ht, startWith as Dt, map as ce, shareReplay as zr, of as me, switchMap as ot, filter as Jr, takeUntil as ei, distinctUntilChanged as ti } from "rxjs";
|
|
11
|
+
import { IRPCChannelService as Bt, toModule as ri, fromModule as ii } from "@univerjs/rpc";
|
|
12
|
+
import { clsx as Ae, borderClassName as lt, Select as gt, RadioGroup as si, Radio as St, Input as Wt, Checkbox as ni, Tree as oi, Segmented as li, Button as Ge, MessageType as ai } from "@univerjs/design";
|
|
13
|
+
import { jsx as f, jsxs as I, Fragment as Ct } from "react/jsx-runtime";
|
|
14
|
+
import { forwardRef as Ne, useRef as ci, createElement as Fe, useCallback as U, useMemo as at } from "react";
|
|
15
|
+
var y = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SECOND", t))(y || {}), g = /* @__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))(g || {}), m;
|
|
16
16
|
((t) => {
|
|
17
17
|
t.NONE = {
|
|
18
18
|
label: "sheets-filter.conditions.none",
|
|
19
|
-
operator:
|
|
20
|
-
order:
|
|
19
|
+
operator: g.NONE,
|
|
20
|
+
order: y.SECOND,
|
|
21
21
|
numOfParameters: 0,
|
|
22
22
|
getDefaultFormParams: () => {
|
|
23
23
|
throw new Error("[FilterConditionItems.NONE]: should not have initial form params!");
|
|
24
24
|
},
|
|
25
|
-
testMappingParams: (i) => i.operator1 ===
|
|
25
|
+
testMappingParams: (i) => i.operator1 === g.NONE,
|
|
26
26
|
mapToFilterColumn: () => null,
|
|
27
27
|
testMappingFilterColumn: (i) => !i.customFilters && !i.filters ? {} : !1
|
|
28
28
|
}, t.EMPTY = {
|
|
29
29
|
label: "sheets-filter.conditions.empty",
|
|
30
|
-
operator:
|
|
31
|
-
order:
|
|
30
|
+
operator: g.EMPTY,
|
|
31
|
+
order: y.SECOND,
|
|
32
32
|
numOfParameters: 0,
|
|
33
33
|
getDefaultFormParams: () => {
|
|
34
34
|
throw new Error("[FilterConditionItems.EMPTY]: should not have initial form params!");
|
|
35
35
|
},
|
|
36
|
-
testMappingParams: ({ operator1: i }) => i ===
|
|
36
|
+
testMappingParams: ({ operator1: i }) => i === g.EMPTY,
|
|
37
37
|
mapToFilterColumn: () => ({ customFilters: { customFilters: [{ val: "" }] } }),
|
|
38
38
|
testMappingFilterColumn: (i) => {
|
|
39
39
|
var c;
|
|
40
40
|
if (((c = i.customFilters) == null ? void 0 : c.customFilters.length) !== 1)
|
|
41
41
|
return !1;
|
|
42
42
|
const o = i.customFilters.customFilters[0];
|
|
43
|
-
return o.val === "" && o.operator === void 0 ? { operator1:
|
|
43
|
+
return o.val === "" && o.operator === void 0 ? { operator1: g.EMPTY } : !1;
|
|
44
44
|
}
|
|
45
45
|
}, t.NOT_EMPTY = {
|
|
46
46
|
label: "sheets-filter.conditions.not-empty",
|
|
47
|
-
operator:
|
|
48
|
-
order:
|
|
47
|
+
operator: g.NOT_EMPTY,
|
|
48
|
+
order: y.SECOND,
|
|
49
49
|
numOfParameters: 0,
|
|
50
50
|
getDefaultFormParams: () => {
|
|
51
51
|
throw new Error("[FilterConditionItems.NOT_EMPTY]: should not have initial form params!");
|
|
52
52
|
},
|
|
53
|
-
testMappingParams: ({ operator1: i }) => i ===
|
|
53
|
+
testMappingParams: ({ operator1: i }) => i === g.NOT_EMPTY,
|
|
54
54
|
mapToFilterColumn: () => ({ customFilters: { customFilters: [{ val: "", operator: u.NOT_EQUALS }] } }),
|
|
55
55
|
testMappingFilterColumn: (i) => {
|
|
56
56
|
var c;
|
|
57
57
|
if (((c = i.customFilters) == null ? void 0 : c.customFilters.length) !== 1)
|
|
58
58
|
return !1;
|
|
59
59
|
const o = i.customFilters.customFilters[0];
|
|
60
|
-
return o.val === " " && o.operator === u.NOT_EQUALS ? { operator1:
|
|
60
|
+
return o.val === " " && o.operator === u.NOT_EQUALS ? { operator1: g.NOT_EMPTY } : !1;
|
|
61
61
|
}
|
|
62
62
|
}, t.TEXT_CONTAINS = {
|
|
63
63
|
label: "sheets-filter.conditions.text-contains",
|
|
64
|
-
operator:
|
|
65
|
-
order:
|
|
64
|
+
operator: g.CONTAINS,
|
|
65
|
+
order: y.FIRST,
|
|
66
66
|
numOfParameters: 1,
|
|
67
|
-
getDefaultFormParams: () => ({ operator1:
|
|
67
|
+
getDefaultFormParams: () => ({ operator1: g.CONTAINS, val1: "" }),
|
|
68
68
|
testMappingParams: (i) => {
|
|
69
|
-
const [o] =
|
|
70
|
-
return o ===
|
|
69
|
+
const [o] = x(i);
|
|
70
|
+
return o === g.CONTAINS;
|
|
71
71
|
},
|
|
72
72
|
mapToFilterColumn: (i) => {
|
|
73
73
|
const { val1: o } = i;
|
|
@@ -79,78 +79,78 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
79
79
|
var c;
|
|
80
80
|
if (((c = i.customFilters) == null ? void 0 : c.customFilters.length) !== 1)
|
|
81
81
|
return !1;
|
|
82
|
-
const o = i.customFilters.customFilters[0],
|
|
83
|
-
return !o.operator &&
|
|
82
|
+
const o = i.customFilters.customFilters[0], l = o.val.toString();
|
|
83
|
+
return !o.operator && l.startsWith("*") && l.endsWith("*") ? { operator1: g.CONTAINS, val1: l.slice(1, -1) } : !1;
|
|
84
84
|
}
|
|
85
85
|
}, t.DOES_NOT_CONTAIN = {
|
|
86
86
|
label: "sheets-filter.conditions.does-not-contain",
|
|
87
|
-
operator:
|
|
88
|
-
order:
|
|
87
|
+
operator: g.DOES_NOT_CONTAIN,
|
|
88
|
+
order: y.FIRST,
|
|
89
89
|
numOfParameters: 1,
|
|
90
|
-
getDefaultFormParams: () => ({ operator1:
|
|
90
|
+
getDefaultFormParams: () => ({ operator1: g.DOES_NOT_CONTAIN, val1: "" }),
|
|
91
91
|
mapToFilterColumn: (i) => ({
|
|
92
92
|
customFilters: { customFilters: [{ val: `*${i.val1}*`, operator: u.NOT_EQUALS }] }
|
|
93
93
|
}),
|
|
94
94
|
testMappingParams: (i) => {
|
|
95
|
-
const [o] =
|
|
96
|
-
return o ===
|
|
95
|
+
const [o] = x(i);
|
|
96
|
+
return o === g.DOES_NOT_CONTAIN;
|
|
97
97
|
},
|
|
98
98
|
testMappingFilterColumn: (i) => {
|
|
99
99
|
var c;
|
|
100
100
|
if (((c = i.customFilters) == null ? void 0 : c.customFilters.length) !== 1)
|
|
101
101
|
return !1;
|
|
102
|
-
const o = i.customFilters.customFilters[0],
|
|
103
|
-
return o.operator === u.NOT_EQUALS &&
|
|
102
|
+
const o = i.customFilters.customFilters[0], l = o.val.toString();
|
|
103
|
+
return o.operator === u.NOT_EQUALS && l.startsWith("*") && l.endsWith("*") ? { operator1: g.DOES_NOT_CONTAIN, val1: l.slice(1, -1) } : !1;
|
|
104
104
|
}
|
|
105
105
|
}, t.STARTS_WITH = {
|
|
106
106
|
label: "sheets-filter.conditions.starts-with",
|
|
107
|
-
operator:
|
|
108
|
-
order:
|
|
107
|
+
operator: g.STARTS_WITH,
|
|
108
|
+
order: y.FIRST,
|
|
109
109
|
numOfParameters: 1,
|
|
110
|
-
getDefaultFormParams: () => ({ operator1:
|
|
110
|
+
getDefaultFormParams: () => ({ operator1: g.STARTS_WITH, val1: "" }),
|
|
111
111
|
mapToFilterColumn: (i) => ({
|
|
112
112
|
customFilters: { customFilters: [{ val: `${i.val1}*` }] }
|
|
113
113
|
}),
|
|
114
114
|
testMappingParams: (i) => {
|
|
115
|
-
const [o] =
|
|
116
|
-
return o ===
|
|
115
|
+
const [o] = x(i);
|
|
116
|
+
return o === g.STARTS_WITH;
|
|
117
117
|
},
|
|
118
118
|
testMappingFilterColumn: (i) => {
|
|
119
119
|
var c;
|
|
120
120
|
if (((c = i.customFilters) == null ? void 0 : c.customFilters.length) !== 1)
|
|
121
121
|
return !1;
|
|
122
|
-
const o = i.customFilters.customFilters[0],
|
|
123
|
-
return !o.operator &&
|
|
122
|
+
const o = i.customFilters.customFilters[0], l = o.val.toString();
|
|
123
|
+
return !o.operator && l.endsWith("*") && !l.startsWith("*") ? { operator1: g.STARTS_WITH, val1: l.slice(0, -1) } : !1;
|
|
124
124
|
}
|
|
125
125
|
}, t.ENDS_WITH = {
|
|
126
126
|
label: "sheets-filter.conditions.ends-with",
|
|
127
|
-
operator:
|
|
128
|
-
order:
|
|
127
|
+
operator: g.ENDS_WITH,
|
|
128
|
+
order: y.FIRST,
|
|
129
129
|
numOfParameters: 1,
|
|
130
|
-
getDefaultFormParams: () => ({ operator1:
|
|
130
|
+
getDefaultFormParams: () => ({ operator1: g.ENDS_WITH, val1: "" }),
|
|
131
131
|
mapToFilterColumn: (i) => ({
|
|
132
132
|
customFilters: { customFilters: [{ val: `*${i.val1}` }] }
|
|
133
133
|
}),
|
|
134
134
|
testMappingParams: (i) => {
|
|
135
|
-
const [o] =
|
|
136
|
-
return o ===
|
|
135
|
+
const [o] = x(i);
|
|
136
|
+
return o === g.ENDS_WITH;
|
|
137
137
|
},
|
|
138
138
|
testMappingFilterColumn: (i) => {
|
|
139
139
|
var c;
|
|
140
140
|
if (((c = i.customFilters) == null ? void 0 : c.customFilters.length) !== 1)
|
|
141
141
|
return !1;
|
|
142
|
-
const o = i.customFilters.customFilters[0],
|
|
143
|
-
return !o.operator &&
|
|
142
|
+
const o = i.customFilters.customFilters[0], l = o.val.toString();
|
|
143
|
+
return !o.operator && l.startsWith("*") && !l.endsWith("*") ? { operator1: g.ENDS_WITH, val1: l.slice(1) } : !1;
|
|
144
144
|
}
|
|
145
145
|
}, t.EQUALS = {
|
|
146
146
|
label: "sheets-filter.conditions.equals",
|
|
147
|
-
operator:
|
|
148
|
-
order:
|
|
147
|
+
operator: g.EQUALS,
|
|
148
|
+
order: y.FIRST,
|
|
149
149
|
numOfParameters: 1,
|
|
150
|
-
getDefaultFormParams: () => ({ operator1:
|
|
150
|
+
getDefaultFormParams: () => ({ operator1: g.EQUALS, val1: "" }),
|
|
151
151
|
testMappingParams: (i) => {
|
|
152
|
-
const [o] =
|
|
153
|
-
return o ===
|
|
152
|
+
const [o] = x(i);
|
|
153
|
+
return o === g.EQUALS;
|
|
154
154
|
},
|
|
155
155
|
mapToFilterColumn: (i) => {
|
|
156
156
|
const { val1: o } = i;
|
|
@@ -159,25 +159,25 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
159
159
|
};
|
|
160
160
|
},
|
|
161
161
|
testMappingFilterColumn: (i) => {
|
|
162
|
-
var o,
|
|
163
|
-
return ((
|
|
162
|
+
var o, l, c;
|
|
163
|
+
return ((l = (o = i.filters) == null ? void 0 : o.filters) == null ? void 0 : l.length) === 1 ? { operator1: g.EQUALS, val1: "" } : ((c = i.customFilters) == null ? void 0 : c.customFilters.length) === 1 && !i.customFilters.customFilters[0].operator ? { operator1: g.EQUALS, val1: i.customFilters.customFilters[0].val.toString() } : !1;
|
|
164
164
|
}
|
|
165
165
|
}, t.GREATER_THAN = {
|
|
166
166
|
label: "sheets-filter.conditions.greater-than",
|
|
167
167
|
operator: u.GREATER_THAN,
|
|
168
168
|
numOfParameters: 1,
|
|
169
|
-
order:
|
|
169
|
+
order: y.FIRST,
|
|
170
170
|
getDefaultFormParams: () => ({ operator1: u.GREATER_THAN, val1: "" }),
|
|
171
171
|
mapToFilterColumn: (i) => ({
|
|
172
172
|
customFilters: { customFilters: [{ val: i.val1, operator: u.GREATER_THAN }] }
|
|
173
173
|
}),
|
|
174
174
|
testMappingParams: (i) => {
|
|
175
|
-
const [o] =
|
|
175
|
+
const [o] = x(i);
|
|
176
176
|
return o === u.GREATER_THAN;
|
|
177
177
|
},
|
|
178
178
|
testMappingFilterColumn: (i) => {
|
|
179
|
-
var
|
|
180
|
-
if (((
|
|
179
|
+
var l;
|
|
180
|
+
if (((l = i.customFilters) == null ? void 0 : l.customFilters.length) !== 1)
|
|
181
181
|
return !1;
|
|
182
182
|
const o = i.customFilters.customFilters[0];
|
|
183
183
|
return o.operator !== u.GREATER_THAN ? !1 : { operator1: u.GREATER_THAN, val1: o.val.toString() };
|
|
@@ -186,18 +186,18 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
186
186
|
label: "sheets-filter.conditions.greater-than-or-equal",
|
|
187
187
|
operator: u.GREATER_THAN_OR_EQUAL,
|
|
188
188
|
numOfParameters: 1,
|
|
189
|
-
order:
|
|
189
|
+
order: y.FIRST,
|
|
190
190
|
getDefaultFormParams: () => ({ operator1: u.GREATER_THAN_OR_EQUAL, val1: "" }),
|
|
191
191
|
testMappingParams: (i) => {
|
|
192
|
-
const [o] =
|
|
192
|
+
const [o] = x(i);
|
|
193
193
|
return o === u.GREATER_THAN_OR_EQUAL;
|
|
194
194
|
},
|
|
195
195
|
mapToFilterColumn: (i) => ({
|
|
196
196
|
customFilters: { customFilters: [{ val: i.val1, operator: u.GREATER_THAN_OR_EQUAL }] }
|
|
197
197
|
}),
|
|
198
198
|
testMappingFilterColumn: (i) => {
|
|
199
|
-
var
|
|
200
|
-
if (((
|
|
199
|
+
var l;
|
|
200
|
+
if (((l = i.customFilters) == null ? void 0 : l.customFilters.length) !== 1)
|
|
201
201
|
return !1;
|
|
202
202
|
const o = i.customFilters.customFilters[0];
|
|
203
203
|
return o.operator !== u.GREATER_THAN_OR_EQUAL ? !1 : { operator1: u.GREATER_THAN_OR_EQUAL, val1: o.val.toString() };
|
|
@@ -206,18 +206,18 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
206
206
|
label: "sheets-filter.conditions.less-than",
|
|
207
207
|
operator: u.LESS_THAN,
|
|
208
208
|
numOfParameters: 1,
|
|
209
|
-
order:
|
|
209
|
+
order: y.FIRST,
|
|
210
210
|
getDefaultFormParams: () => ({ operator1: u.LESS_THAN, val1: "" }),
|
|
211
211
|
testMappingParams: (i) => {
|
|
212
|
-
const [o] =
|
|
212
|
+
const [o] = x(i);
|
|
213
213
|
return o === u.LESS_THAN;
|
|
214
214
|
},
|
|
215
215
|
mapToFilterColumn: (i) => ({
|
|
216
216
|
customFilters: { customFilters: [{ val: i.val1, operator: u.LESS_THAN }] }
|
|
217
217
|
}),
|
|
218
218
|
testMappingFilterColumn: (i) => {
|
|
219
|
-
var
|
|
220
|
-
if (((
|
|
219
|
+
var l;
|
|
220
|
+
if (((l = i.customFilters) == null ? void 0 : l.customFilters.length) !== 1)
|
|
221
221
|
return !1;
|
|
222
222
|
const o = i.customFilters.customFilters[0];
|
|
223
223
|
return o.operator !== u.LESS_THAN ? !1 : { operator1: u.LESS_THAN, val1: o.val.toString() };
|
|
@@ -226,18 +226,18 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
226
226
|
label: "sheets-filter.conditions.less-than-or-equal",
|
|
227
227
|
operator: u.LESS_THAN_OR_EQUAL,
|
|
228
228
|
numOfParameters: 1,
|
|
229
|
-
order:
|
|
229
|
+
order: y.FIRST,
|
|
230
230
|
getDefaultFormParams: () => ({ operator1: u.LESS_THAN_OR_EQUAL, val1: "" }),
|
|
231
231
|
testMappingParams: (i) => {
|
|
232
|
-
const [o] =
|
|
232
|
+
const [o] = x(i);
|
|
233
233
|
return o === u.LESS_THAN_OR_EQUAL;
|
|
234
234
|
},
|
|
235
235
|
mapToFilterColumn: (i) => ({
|
|
236
236
|
customFilters: { customFilters: [{ val: i.val1, operator: u.LESS_THAN_OR_EQUAL }] }
|
|
237
237
|
}),
|
|
238
238
|
testMappingFilterColumn: (i) => {
|
|
239
|
-
var
|
|
240
|
-
if (((
|
|
239
|
+
var l;
|
|
240
|
+
if (((l = i.customFilters) == null ? void 0 : l.customFilters.length) !== 1)
|
|
241
241
|
return !1;
|
|
242
242
|
const o = i.customFilters.customFilters[0];
|
|
243
243
|
return o.operator !== u.LESS_THAN_OR_EQUAL ? !1 : { operator1: u.LESS_THAN_OR_EQUAL, val1: o.val.toString() };
|
|
@@ -246,18 +246,18 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
246
246
|
label: "sheets-filter.conditions.equal",
|
|
247
247
|
operator: u.EQUAL,
|
|
248
248
|
numOfParameters: 1,
|
|
249
|
-
order:
|
|
249
|
+
order: y.FIRST,
|
|
250
250
|
getDefaultFormParams: () => ({ operator1: u.EQUAL, val1: "" }),
|
|
251
251
|
testMappingParams: (i) => {
|
|
252
|
-
const [o] =
|
|
252
|
+
const [o] = x(i);
|
|
253
253
|
return o === u.EQUAL;
|
|
254
254
|
},
|
|
255
255
|
mapToFilterColumn: (i) => ({
|
|
256
256
|
customFilters: { customFilters: [{ val: i.val1, operator: u.EQUAL }] }
|
|
257
257
|
}),
|
|
258
258
|
testMappingFilterColumn: (i) => {
|
|
259
|
-
var
|
|
260
|
-
if (((
|
|
259
|
+
var l;
|
|
260
|
+
if (((l = i.customFilters) == null ? void 0 : l.customFilters.length) !== 1)
|
|
261
261
|
return !1;
|
|
262
262
|
const o = i.customFilters.customFilters[0];
|
|
263
263
|
return o.operator !== u.EQUAL ? !1 : { operator1: u.EQUAL, val1: o.val.toString() };
|
|
@@ -266,26 +266,26 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
266
266
|
label: "sheets-filter.conditions.not-equal",
|
|
267
267
|
operator: u.NOT_EQUALS,
|
|
268
268
|
numOfParameters: 1,
|
|
269
|
-
order:
|
|
269
|
+
order: y.FIRST,
|
|
270
270
|
getDefaultFormParams: () => ({ operator1: u.NOT_EQUALS, val1: "" }),
|
|
271
271
|
testMappingParams: (i) => {
|
|
272
|
-
const [o] =
|
|
272
|
+
const [o] = x(i);
|
|
273
273
|
return o === u.NOT_EQUALS;
|
|
274
274
|
},
|
|
275
275
|
mapToFilterColumn: (i) => ({
|
|
276
276
|
customFilters: { customFilters: [{ val: i.val1, operator: u.NOT_EQUALS }] }
|
|
277
277
|
}),
|
|
278
278
|
testMappingFilterColumn: (i) => {
|
|
279
|
-
var
|
|
280
|
-
if (((
|
|
279
|
+
var l;
|
|
280
|
+
if (((l = i.customFilters) == null ? void 0 : l.customFilters.length) !== 1)
|
|
281
281
|
return !1;
|
|
282
282
|
const o = i.customFilters.customFilters[0];
|
|
283
283
|
return o.operator !== u.NOT_EQUALS ? !1 : { operator1: u.NOT_EQUALS, val1: o.val.toString() };
|
|
284
284
|
}
|
|
285
285
|
}, t.BETWEEN = {
|
|
286
286
|
label: "sheets-filter.conditions.between",
|
|
287
|
-
operator:
|
|
288
|
-
order:
|
|
287
|
+
operator: g.BETWEEN,
|
|
288
|
+
order: y.SECOND,
|
|
289
289
|
numOfParameters: 2,
|
|
290
290
|
getDefaultFormParams: () => ({
|
|
291
291
|
and: !0,
|
|
@@ -295,19 +295,19 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
295
295
|
val2: ""
|
|
296
296
|
}),
|
|
297
297
|
testMappingParams: (i) => {
|
|
298
|
-
const { and: o, operator1:
|
|
298
|
+
const { and: o, operator1: l, operator2: c } = i;
|
|
299
299
|
if (!o) return !1;
|
|
300
|
-
const h = [
|
|
300
|
+
const h = [l, c];
|
|
301
301
|
return h.includes(u.GREATER_THAN_OR_EQUAL) && h.includes(u.LESS_THAN_OR_EQUAL);
|
|
302
302
|
},
|
|
303
303
|
mapToFilterColumn: (i) => {
|
|
304
|
-
const { val1: o, val2:
|
|
304
|
+
const { val1: o, val2: l, operator1: c } = i, h = c === u.GREATER_THAN_OR_EQUAL;
|
|
305
305
|
return {
|
|
306
306
|
customFilters: {
|
|
307
|
-
and:
|
|
307
|
+
and: ht.TRUE,
|
|
308
308
|
customFilters: [
|
|
309
|
-
{ val: h ? o :
|
|
310
|
-
{ val: h ?
|
|
309
|
+
{ val: h ? o : l, operator: u.GREATER_THAN_OR_EQUAL },
|
|
310
|
+
{ val: h ? l : o, operator: u.LESS_THAN_OR_EQUAL }
|
|
311
311
|
]
|
|
312
312
|
}
|
|
313
313
|
};
|
|
@@ -316,25 +316,25 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
316
316
|
var c;
|
|
317
317
|
if (((c = i.customFilters) == null ? void 0 : c.customFilters.length) !== 2)
|
|
318
318
|
return !1;
|
|
319
|
-
const [o,
|
|
320
|
-
return o.operator === u.GREATER_THAN_OR_EQUAL &&
|
|
319
|
+
const [o, l] = i.customFilters.customFilters;
|
|
320
|
+
return o.operator === u.GREATER_THAN_OR_EQUAL && l.operator === u.LESS_THAN_OR_EQUAL && i.customFilters.and ? {
|
|
321
321
|
and: !0,
|
|
322
322
|
operator1: u.GREATER_THAN_OR_EQUAL,
|
|
323
323
|
val1: o.val.toString(),
|
|
324
324
|
operator2: u.LESS_THAN_OR_EQUAL,
|
|
325
|
-
val2:
|
|
326
|
-
} :
|
|
325
|
+
val2: l.val.toString()
|
|
326
|
+
} : l.operator === u.GREATER_THAN_OR_EQUAL && o.operator === u.LESS_THAN_OR_EQUAL && i.customFilters.and ? {
|
|
327
327
|
and: !0,
|
|
328
328
|
operator1: u.GREATER_THAN_OR_EQUAL,
|
|
329
|
-
val1:
|
|
329
|
+
val1: l.val.toString(),
|
|
330
330
|
operator2: u.LESS_THAN_OR_EQUAL,
|
|
331
331
|
val2: o.val.toLocaleString()
|
|
332
332
|
} : !1;
|
|
333
333
|
}
|
|
334
334
|
}, t.NOT_BETWEEN = {
|
|
335
335
|
label: "sheets-filter.conditions.not-between",
|
|
336
|
-
operator:
|
|
337
|
-
order:
|
|
336
|
+
operator: g.NOT_BETWEEN,
|
|
337
|
+
order: y.SECOND,
|
|
338
338
|
numOfParameters: 2,
|
|
339
339
|
getDefaultFormParams: () => ({
|
|
340
340
|
operator1: u.LESS_THAN,
|
|
@@ -343,18 +343,18 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
343
343
|
val2: ""
|
|
344
344
|
}),
|
|
345
345
|
testMappingParams: (i) => {
|
|
346
|
-
const { and: o, operator1:
|
|
346
|
+
const { and: o, operator1: l, operator2: c } = i;
|
|
347
347
|
if (o) return !1;
|
|
348
|
-
const h = [
|
|
348
|
+
const h = [l, c];
|
|
349
349
|
return h.includes(u.GREATER_THAN) && h.includes(u.LESS_THAN);
|
|
350
350
|
},
|
|
351
351
|
mapToFilterColumn: (i) => {
|
|
352
|
-
const { val1: o, val2:
|
|
352
|
+
const { val1: o, val2: l, operator1: c } = i, h = c === u.GREATER_THAN;
|
|
353
353
|
return {
|
|
354
354
|
customFilters: {
|
|
355
355
|
customFilters: [
|
|
356
|
-
{ val: h ? o :
|
|
357
|
-
{ val: h ?
|
|
356
|
+
{ val: h ? o : l, operator: u.GREATER_THAN },
|
|
357
|
+
{ val: h ? l : o, operator: u.LESS_THAN }
|
|
358
358
|
]
|
|
359
359
|
}
|
|
360
360
|
};
|
|
@@ -363,64 +363,64 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
363
363
|
var c;
|
|
364
364
|
if (((c = i.customFilters) == null ? void 0 : c.customFilters.length) !== 2)
|
|
365
365
|
return !1;
|
|
366
|
-
const [o,
|
|
367
|
-
return o.operator === u.LESS_THAN &&
|
|
366
|
+
const [o, l] = i.customFilters.customFilters;
|
|
367
|
+
return o.operator === u.LESS_THAN && l.operator === u.GREATER_THAN && !i.customFilters.and ? {
|
|
368
368
|
operator1: u.LESS_THAN,
|
|
369
369
|
val1: o.val.toString(),
|
|
370
370
|
operator2: u.GREATER_THAN,
|
|
371
|
-
val2:
|
|
372
|
-
} :
|
|
371
|
+
val2: l.val.toString()
|
|
372
|
+
} : l.operator === u.LESS_THAN && o.operator === u.GREATER_THAN && !i.customFilters.and ? {
|
|
373
373
|
operator1: u.GREATER_THAN,
|
|
374
|
-
val1:
|
|
374
|
+
val1: l.val.toString(),
|
|
375
375
|
operator2: u.LESS_THAN,
|
|
376
376
|
val2: o.val.toLocaleString()
|
|
377
377
|
} : !1;
|
|
378
378
|
}
|
|
379
379
|
}, t.CUSTOM = {
|
|
380
380
|
label: "sheets-filter.conditions.custom",
|
|
381
|
-
operator:
|
|
382
|
-
order:
|
|
381
|
+
operator: g.CUSTOM,
|
|
382
|
+
order: y.SECOND,
|
|
383
383
|
numOfParameters: 2,
|
|
384
384
|
getDefaultFormParams: () => ({
|
|
385
|
-
operator1:
|
|
385
|
+
operator1: g.NONE,
|
|
386
386
|
val1: "",
|
|
387
|
-
operator2:
|
|
387
|
+
operator2: g.NONE,
|
|
388
388
|
val2: ""
|
|
389
389
|
}),
|
|
390
390
|
testMappingParams: () => !0,
|
|
391
391
|
mapToFilterColumn: (i) => {
|
|
392
|
-
const { and: o, val1:
|
|
393
|
-
function
|
|
394
|
-
for (const
|
|
395
|
-
if (
|
|
396
|
-
return
|
|
392
|
+
const { and: o, val1: l, val2: c, operator1: h, operator2: d } = i;
|
|
393
|
+
function C(b, F) {
|
|
394
|
+
for (const R of t.ALL_CONDITIONS)
|
|
395
|
+
if (R.operator === b)
|
|
396
|
+
return R.mapToFilterColumn({ val1: F, operator1: b });
|
|
397
397
|
}
|
|
398
|
-
const
|
|
399
|
-
if (
|
|
398
|
+
const v = !h || h === t.NONE.operator, _ = !d || d === t.NONE.operator;
|
|
399
|
+
if (v && _)
|
|
400
400
|
return t.NONE.mapToFilterColumn({});
|
|
401
|
-
if (
|
|
402
|
-
return
|
|
403
|
-
if (
|
|
404
|
-
return
|
|
405
|
-
const
|
|
401
|
+
if (v)
|
|
402
|
+
return C(d, c);
|
|
403
|
+
if (_)
|
|
404
|
+
return C(h, l);
|
|
405
|
+
const S = C(h, l), N = C(d, c), E = {
|
|
406
406
|
customFilters: [
|
|
407
|
-
|
|
408
|
-
|
|
407
|
+
S.customFilters.customFilters[0],
|
|
408
|
+
N.customFilters.customFilters[0]
|
|
409
409
|
]
|
|
410
410
|
};
|
|
411
|
-
return o && (
|
|
411
|
+
return o && (E.and = ht.TRUE), { customFilters: E };
|
|
412
412
|
},
|
|
413
413
|
testMappingFilterColumn: (i) => {
|
|
414
414
|
var c;
|
|
415
415
|
if (((c = i.customFilters) == null ? void 0 : c.customFilters.length) !== 2)
|
|
416
416
|
return !1;
|
|
417
|
-
const o = i.customFilters.customFilters.map((h) =>
|
|
417
|
+
const o = i.customFilters.customFilters.map((h) => a({ customFilters: { customFilters: [h] } })), l = {
|
|
418
418
|
operator1: o[0][0].operator,
|
|
419
419
|
val1: o[0][1].val1,
|
|
420
420
|
operator2: o[1][0].operator,
|
|
421
421
|
val2: o[1][1].val1
|
|
422
422
|
};
|
|
423
|
-
return i.customFilters.and && (
|
|
423
|
+
return i.customFilters.and && (l.and = !0), l;
|
|
424
424
|
}
|
|
425
425
|
}, t.ALL_CONDITIONS = [
|
|
426
426
|
// ------------------------------
|
|
@@ -447,24 +447,24 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
447
447
|
t.CUSTOM
|
|
448
448
|
];
|
|
449
449
|
function e(i) {
|
|
450
|
-
const o = t.ALL_CONDITIONS.find((
|
|
450
|
+
const o = t.ALL_CONDITIONS.find((l) => l.operator === i);
|
|
451
451
|
if (!o)
|
|
452
452
|
throw new Error(`[SheetsFilter]: no condition item found for operator: ${i}`);
|
|
453
453
|
return o;
|
|
454
454
|
}
|
|
455
455
|
t.getItemByOperator = e;
|
|
456
456
|
function r(i, o) {
|
|
457
|
-
for (const
|
|
458
|
-
if (
|
|
459
|
-
return
|
|
460
|
-
for (const
|
|
461
|
-
if (
|
|
462
|
-
return
|
|
457
|
+
for (const l of t.ALL_CONDITIONS.filter((c) => c.numOfParameters === o))
|
|
458
|
+
if (l.numOfParameters !== 0 && l.testMappingParams(i))
|
|
459
|
+
return l;
|
|
460
|
+
for (const l of t.ALL_CONDITIONS)
|
|
461
|
+
if (l.testMappingParams(i))
|
|
462
|
+
return l;
|
|
463
463
|
throw new Error("[SheetsFilter]: no condition item can be mapped from the filter map params!");
|
|
464
464
|
}
|
|
465
465
|
t.testMappingParams = r;
|
|
466
466
|
function s(i) {
|
|
467
|
-
const o = t.ALL_CONDITIONS.find((
|
|
467
|
+
const o = t.ALL_CONDITIONS.find((l) => l.operator === i);
|
|
468
468
|
return (o == null ? void 0 : o.numOfParameters) === 0 ? { operator1: o.operator } : o.getDefaultFormParams();
|
|
469
469
|
}
|
|
470
470
|
t.getInitialFormParams = s;
|
|
@@ -472,19 +472,19 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
472
472
|
return i.mapToFilterColumn(o);
|
|
473
473
|
}
|
|
474
474
|
t.mapToFilterColumn = n;
|
|
475
|
-
function
|
|
475
|
+
function a(i) {
|
|
476
476
|
if (!i)
|
|
477
477
|
return [t.NONE, {}];
|
|
478
478
|
for (const o of t.ALL_CONDITIONS) {
|
|
479
|
-
const
|
|
480
|
-
if (
|
|
481
|
-
return [o,
|
|
479
|
+
const l = o.testMappingFilterColumn(i);
|
|
480
|
+
if (l)
|
|
481
|
+
return [o, l];
|
|
482
482
|
}
|
|
483
483
|
return [t.NONE, {}];
|
|
484
484
|
}
|
|
485
|
-
t.testMappingFilterColumn =
|
|
486
|
-
})(
|
|
487
|
-
function
|
|
485
|
+
t.testMappingFilterColumn = a;
|
|
486
|
+
})(m || (m = {}));
|
|
487
|
+
function x(t) {
|
|
488
488
|
const { operator1: e, operator2: r, val1: s, val2: n } = t;
|
|
489
489
|
if (e && r)
|
|
490
490
|
throw new Error("Both operator1 and operator2 are set!");
|
|
@@ -492,201 +492,208 @@ function L(t) {
|
|
|
492
492
|
throw new Error("Neither operator1 and operator2 and both not set!");
|
|
493
493
|
return e ? [e, s] : [r, n];
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function qe(t) {
|
|
496
496
|
const e = [], r = [];
|
|
497
497
|
let s = 0, n = 0;
|
|
498
|
-
function
|
|
499
|
-
i.leaf && (i.checked ? (e.push(i), s += i.count) : (r.push(i), n += i.count)), i.children && i.children.forEach(
|
|
498
|
+
function a(i) {
|
|
499
|
+
i.leaf && (i.checked ? (e.push(i), s += i.count) : (r.push(i), n += i.count)), i.children && i.children.forEach(a);
|
|
500
500
|
}
|
|
501
|
-
return t.forEach(
|
|
501
|
+
return t.forEach(a), {
|
|
502
502
|
checkedItems: e,
|
|
503
503
|
uncheckedItems: r,
|
|
504
504
|
checked: s,
|
|
505
505
|
unchecked: n
|
|
506
506
|
};
|
|
507
507
|
}
|
|
508
|
-
var
|
|
509
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
510
|
-
(i = t[
|
|
508
|
+
var ui = Object.getOwnPropertyDescriptor, hi = (t, e, r, s) => {
|
|
509
|
+
for (var n = s > 1 ? void 0 : s ? ui(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
510
|
+
(i = t[a]) && (n = i(n) || n);
|
|
511
511
|
return n;
|
|
512
|
-
},
|
|
513
|
-
const
|
|
514
|
-
let
|
|
512
|
+
}, Ye = (t, e) => (r, s) => e(r, s, t);
|
|
513
|
+
const ct = "sheets-filter.generate-filter-values.service", Pe = Rt(ct), di = ["yyyy-mm-dd", "yyyy-mm-dd;@", "yyyy/mm/dd;@", "yyyy/mm/dd hh:mm", "yyyy-m-d am/pm h:mm", "yyyy-MM-dd", "yyyy/MM/dd", "yyyy/mm/dd", 'yyyy"年"MM"月"dd"日"', "MM-dd", 'M"月"d"日"', "MM-dd A/P hh:mm"];
|
|
514
|
+
let Xe = class extends de {
|
|
515
515
|
constructor(t, e, r) {
|
|
516
516
|
super(), this._localeService = t, this._univerInstanceService = e, this._logService = r;
|
|
517
517
|
}
|
|
518
518
|
async getFilterValues(t) {
|
|
519
|
-
var
|
|
520
|
-
const { unitId: e, subUnitId: r, filteredOutRowsByOtherColumns: s,
|
|
521
|
-
return !
|
|
519
|
+
var d;
|
|
520
|
+
const { unitId: e, subUnitId: r, filteredOutRowsByOtherColumns: s, filterColumn: n, filters: a, blankChecked: i, iterateRange: o, alreadyChecked: l } = t, c = this._univerInstanceService.getUnit(e), h = (d = this._univerInstanceService.getUnit(e)) == null ? void 0 : d.getSheetBySheetId(r);
|
|
521
|
+
return !c || !h ? [] : (this._logService.debug("[SheetsGenerateFilterValuesService]", "getFilterValues for", { unitId: e, subUnitId: r }), Qt(
|
|
522
|
+
a,
|
|
523
|
+
this._localeService,
|
|
524
|
+
o,
|
|
525
|
+
h,
|
|
526
|
+
new Set(s),
|
|
527
|
+
n,
|
|
528
|
+
new Set(l.map(String)),
|
|
529
|
+
i,
|
|
530
|
+
c.getStyles()
|
|
531
|
+
));
|
|
522
532
|
}
|
|
523
533
|
};
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
],
|
|
529
|
-
function
|
|
530
|
-
var
|
|
531
|
-
const
|
|
532
|
-
let
|
|
533
|
-
for (const
|
|
534
|
-
const { row:
|
|
535
|
-
let
|
|
536
|
-
for (;
|
|
537
|
-
const
|
|
538
|
-
if (n.has(
|
|
539
|
-
|
|
534
|
+
Xe = hi([
|
|
535
|
+
Ye(0, T(K)),
|
|
536
|
+
Ye(1, De),
|
|
537
|
+
Ye(2, or)
|
|
538
|
+
], Xe);
|
|
539
|
+
function Qt(t, e, r, s, n, a, i, o, l) {
|
|
540
|
+
var E, b, F, R, w, X, se, ne, D, L;
|
|
541
|
+
const c = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), d = "yyyy-mm-dd", C = new Set(di), v = "empty", _ = !t && ((a == null ? void 0 : a.filterBy) === A.COLORS || (a == null ? void 0 : a.filterBy) === A.CONDITIONS) && ((E = a.filteredOutRows) == null ? void 0 : E.size);
|
|
542
|
+
let S = 0;
|
|
543
|
+
for (const $ of s.iterateByColumn(r, !1, !1)) {
|
|
544
|
+
const { row: tr, rowSpan: ut = 1 } = $;
|
|
545
|
+
let oe = 0;
|
|
546
|
+
for (; oe < ut; ) {
|
|
547
|
+
const rr = tr + oe;
|
|
548
|
+
if (n.has(rr)) {
|
|
549
|
+
oe++;
|
|
540
550
|
continue;
|
|
541
551
|
}
|
|
542
|
-
const
|
|
543
|
-
if (!
|
|
544
|
-
|
|
552
|
+
const z = $ != null && $.value ? lr($.value) : "";
|
|
553
|
+
if (!z) {
|
|
554
|
+
S += 1, oe += ut;
|
|
545
555
|
continue;
|
|
546
556
|
}
|
|
547
|
-
const
|
|
548
|
-
if (
|
|
549
|
-
const
|
|
550
|
-
if (!
|
|
551
|
-
|
|
557
|
+
const Oe = (b = $.value) != null && b.v && !$.value.p ? (w = (R = l.get((F = $.value) == null ? void 0 : F.s)) == null ? void 0 : R.n) == null ? void 0 : w.pattern : "", ir = Oe && dt.getFormatInfo(Oe).isDate;
|
|
558
|
+
if (Oe && ir && C.has(Oe)) {
|
|
559
|
+
const G = (X = s.getCellRaw($.row, $.col)) == null ? void 0 : X.v;
|
|
560
|
+
if (!G) {
|
|
561
|
+
oe++;
|
|
552
562
|
continue;
|
|
553
563
|
}
|
|
554
|
-
const
|
|
555
|
-
let
|
|
556
|
-
|
|
557
|
-
title: `${
|
|
558
|
-
key: `${
|
|
564
|
+
const le = dt.format(d, G), [O, k, fe] = le.split("-").map(Number);
|
|
565
|
+
let J = c.get(`${O}`);
|
|
566
|
+
J || (J = {
|
|
567
|
+
title: `${O}`,
|
|
568
|
+
key: `${O}`,
|
|
559
569
|
children: [],
|
|
560
570
|
count: 0,
|
|
561
571
|
leaf: !1,
|
|
562
572
|
checked: !1
|
|
563
|
-
},
|
|
564
|
-
let
|
|
565
|
-
|
|
566
|
-
title: e.t(`sheets-filter.date.${
|
|
567
|
-
key: `${
|
|
573
|
+
}, c.set(`${O}`, J), h.set(`${O}`, [`${O}`]));
|
|
574
|
+
let B = (se = J.children) == null ? void 0 : se.find((je) => je.key === `${O}-${k}`);
|
|
575
|
+
B || (B = {
|
|
576
|
+
title: e.t(`sheets-filter.date.${k}`),
|
|
577
|
+
key: `${O}-${k}`,
|
|
568
578
|
children: [],
|
|
569
579
|
count: 0,
|
|
570
580
|
leaf: !1,
|
|
571
581
|
checked: !1
|
|
572
|
-
}, (
|
|
573
|
-
const
|
|
574
|
-
|
|
575
|
-
title: `${
|
|
576
|
-
key: `${
|
|
582
|
+
}, (ne = J.children) == null || ne.push(B), h.set(`${O}-${k}`, [`${O}`, `${O}-${k}`]));
|
|
583
|
+
const Ve = (D = B == null ? void 0 : B.children) == null ? void 0 : D.find((je) => je.key === `${O}-${k}-${fe}`);
|
|
584
|
+
Ve ? (Ve.originValues.add(z), Ve.count++, B.count++, J.count++) : ((L = B.children) == null || L.push({
|
|
585
|
+
title: `${fe}`,
|
|
586
|
+
key: `${O}-${k}-${fe}`,
|
|
577
587
|
count: 1,
|
|
578
|
-
originValues: /* @__PURE__ */ new Set([
|
|
588
|
+
originValues: /* @__PURE__ */ new Set([z]),
|
|
579
589
|
leaf: !0,
|
|
580
|
-
checked:
|
|
581
|
-
}),
|
|
590
|
+
checked: _ ? !1 : i.size ? i.has(z) : !o
|
|
591
|
+
}), B.count++, J.count++, h.set(`${O}-${k}-${fe}`, [`${O}`, `${O}-${k}`, `${O}-${k}-${fe}`]));
|
|
582
592
|
} else {
|
|
583
|
-
const
|
|
584
|
-
let
|
|
585
|
-
|
|
586
|
-
title:
|
|
593
|
+
const G = z;
|
|
594
|
+
let le = c.get(G);
|
|
595
|
+
le ? le.count++ : (le = {
|
|
596
|
+
title: z,
|
|
587
597
|
leaf: !0,
|
|
588
|
-
checked:
|
|
589
|
-
key:
|
|
598
|
+
checked: _ ? !1 : i.size ? i.has(z) : !o,
|
|
599
|
+
key: G,
|
|
590
600
|
count: 1
|
|
591
|
-
},
|
|
601
|
+
}, c.set(G, le), h.set(G, [G]));
|
|
592
602
|
}
|
|
593
|
-
|
|
603
|
+
oe++;
|
|
594
604
|
}
|
|
595
605
|
}
|
|
596
|
-
const
|
|
597
|
-
if (
|
|
598
|
-
const
|
|
606
|
+
const N = _ ? !1 : t ? o : !0;
|
|
607
|
+
if (S > 0) {
|
|
608
|
+
const $ = {
|
|
599
609
|
title: e.t("sheets-filter.panel.empty"),
|
|
600
|
-
count:
|
|
610
|
+
count: S,
|
|
601
611
|
leaf: !0,
|
|
602
|
-
checked:
|
|
603
|
-
key:
|
|
612
|
+
checked: N,
|
|
613
|
+
key: v
|
|
604
614
|
};
|
|
605
|
-
|
|
615
|
+
c.set("empty", $), h.set("empty", [v]);
|
|
606
616
|
}
|
|
607
617
|
return {
|
|
608
|
-
filterTreeItems:
|
|
609
|
-
filterTreeMapCache:
|
|
618
|
+
filterTreeItems: mi(Array.from(c.values())),
|
|
619
|
+
filterTreeMapCache: h
|
|
610
620
|
};
|
|
611
621
|
}
|
|
612
|
-
function
|
|
613
|
-
return Array.from(t).sort((e, r) => e.children && !r.children ? -1 : !e.children && r.children ? 1 :
|
|
614
|
-
const n = Number.parseInt(r.key.split("-")[1], 10),
|
|
615
|
-
return n -
|
|
622
|
+
function mi(t) {
|
|
623
|
+
return Array.from(t).sort((e, r) => e.children && !r.children ? -1 : !e.children && r.children ? 1 : fi(e.title, r.title)).map((e) => (e.children && e.children.sort((r, s) => {
|
|
624
|
+
const n = Number.parseInt(r.key.split("-")[1], 10), a = Number.parseInt(s.key.split("-")[1], 10);
|
|
625
|
+
return n - a;
|
|
616
626
|
}).forEach((r) => {
|
|
617
627
|
r.children && r.children.sort((s, n) => {
|
|
618
|
-
const
|
|
619
|
-
return
|
|
628
|
+
const a = Number.parseInt(s.key.split("-")[2], 10), i = Number.parseInt(n.key.split("-")[2], 10);
|
|
629
|
+
return a - i;
|
|
620
630
|
});
|
|
621
631
|
}), e));
|
|
622
632
|
}
|
|
623
|
-
const
|
|
624
|
-
function
|
|
625
|
-
const r =
|
|
633
|
+
const Tt = (t) => !Number.isNaN(Number(t)) && !Number.isNaN(Number.parseFloat(t));
|
|
634
|
+
function fi(t, e) {
|
|
635
|
+
const r = Tt(t), s = Tt(e);
|
|
626
636
|
return r && s ? Number.parseFloat(t) - Number.parseFloat(e) : r && !s ? -1 : !r && s ? 1 : t.localeCompare(e);
|
|
627
637
|
}
|
|
628
|
-
function
|
|
638
|
+
function ze(t, e) {
|
|
629
639
|
for (const r of t) {
|
|
630
640
|
if (r.key === e)
|
|
631
641
|
return r;
|
|
632
642
|
if (r.children) {
|
|
633
|
-
const s =
|
|
643
|
+
const s = ze(r.children, e);
|
|
634
644
|
if (s)
|
|
635
645
|
return s;
|
|
636
646
|
}
|
|
637
647
|
}
|
|
638
648
|
return null;
|
|
639
649
|
}
|
|
640
|
-
function
|
|
641
|
-
return t.leaf ? t.checked : t.children ? t.children.every((e) =>
|
|
650
|
+
function Vt(t) {
|
|
651
|
+
return t.leaf ? t.checked : t.children ? t.children.every((e) => Vt(e)) : !0;
|
|
642
652
|
}
|
|
643
|
-
function
|
|
644
|
-
t.leaf && (e !== void 0 ? t.checked = e : t.checked = !t.checked), t.children && t.children.forEach((r) =>
|
|
653
|
+
function ge(t, e) {
|
|
654
|
+
t.leaf && (e !== void 0 ? t.checked = e : t.checked = !t.checked), t.children && t.children.forEach((r) => ge(r, e));
|
|
645
655
|
}
|
|
646
|
-
function
|
|
656
|
+
function jt(t, e) {
|
|
647
657
|
const r = [];
|
|
648
658
|
return t.forEach((s) => {
|
|
649
659
|
const n = s.originValues ? e.some(
|
|
650
660
|
(o) => Array.from(s.originValues).some(
|
|
651
|
-
(
|
|
661
|
+
(l) => l.toLowerCase().includes(o.toLowerCase())
|
|
652
662
|
)
|
|
653
|
-
) : !1,
|
|
663
|
+
) : !1, a = !n && e.some(
|
|
654
664
|
(o) => s.title.toLowerCase().includes(o.toLowerCase())
|
|
655
665
|
);
|
|
656
|
-
if (n ||
|
|
666
|
+
if (n || a)
|
|
657
667
|
r.push({ ...s });
|
|
658
668
|
else if (s.children) {
|
|
659
|
-
const o =
|
|
669
|
+
const o = jt(s.children, e);
|
|
660
670
|
if (o.length > 0) {
|
|
661
|
-
const
|
|
662
|
-
r.push({ ...s, count:
|
|
671
|
+
const l = o.reduce((c, h) => c + h.count, 0);
|
|
672
|
+
r.push({ ...s, count: l, children: o });
|
|
663
673
|
}
|
|
664
674
|
}
|
|
665
675
|
}), r;
|
|
666
676
|
}
|
|
667
|
-
var
|
|
668
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
669
|
-
(i = t[
|
|
677
|
+
var pi = Object.getOwnPropertyDescriptor, Qe = (t, e, r, s) => {
|
|
678
|
+
for (var n = s > 1 ? void 0 : s ? pi(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
679
|
+
(i = t[a]) && (n = i(n) || n);
|
|
670
680
|
return n;
|
|
671
|
-
},
|
|
672
|
-
|
|
673
|
-
let
|
|
681
|
+
}, Ce = (t, e) => (r, s) => e(r, s, t);
|
|
682
|
+
Rt("sheets-filter-ui.sheets-filter-panel.service");
|
|
683
|
+
let Z = class extends de {
|
|
674
684
|
constructor(e, r) {
|
|
675
685
|
super();
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
));
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
f(this, "_col$", new q(-1));
|
|
688
|
-
f(this, "col$", this._col$.asObservable());
|
|
689
|
-
f(this, "_filterHeaderListener", null);
|
|
686
|
+
p(this, "_filterBy$", new V(A.VALUES));
|
|
687
|
+
p(this, "filterBy$", this._filterBy$.asObservable());
|
|
688
|
+
p(this, "_filterByModel$", new Zr(1));
|
|
689
|
+
p(this, "filterByModel$", this._filterByModel$.asObservable());
|
|
690
|
+
p(this, "_filterByModel", null);
|
|
691
|
+
p(this, "_hasCriteria$", new V(!1));
|
|
692
|
+
p(this, "hasCriteria$", this._hasCriteria$.asObservable());
|
|
693
|
+
p(this, "_filterModel", null);
|
|
694
|
+
p(this, "_col$", new V(-1));
|
|
695
|
+
p(this, "col$", this._col$.asObservable());
|
|
696
|
+
p(this, "_filterHeaderListener", null);
|
|
690
697
|
this._injector = e, this._refRangeService = r;
|
|
691
698
|
}
|
|
692
699
|
get filterBy() {
|
|
@@ -716,6 +723,10 @@ let W = class extends me {
|
|
|
716
723
|
this._hasCriteria$.next(!0), this._setupByConditions(e, r);
|
|
717
724
|
return;
|
|
718
725
|
}
|
|
726
|
+
if (n.colorFilters) {
|
|
727
|
+
this._hasCriteria$.next(!0), this._setupByColors(e, r);
|
|
728
|
+
return;
|
|
729
|
+
}
|
|
719
730
|
if (n.filters) {
|
|
720
731
|
this._hasCriteria$.next(!0), this._setupByValues(e, r);
|
|
721
732
|
return;
|
|
@@ -726,7 +737,20 @@ let W = class extends me {
|
|
|
726
737
|
this._hasCriteria$.next(!1), this._setupByValues(e, r);
|
|
727
738
|
}
|
|
728
739
|
changeFilterBy(e) {
|
|
729
|
-
|
|
740
|
+
if (!this._filterModel || this.col === -1)
|
|
741
|
+
return !1;
|
|
742
|
+
switch (e) {
|
|
743
|
+
case A.VALUES:
|
|
744
|
+
this._setupByValues(this._filterModel, this.col);
|
|
745
|
+
break;
|
|
746
|
+
case A.COLORS:
|
|
747
|
+
this._setupByColors(this._filterModel, this.col);
|
|
748
|
+
break;
|
|
749
|
+
case A.CONDITIONS:
|
|
750
|
+
this._setupByConditions(this._filterModel, this.col);
|
|
751
|
+
break;
|
|
752
|
+
}
|
|
753
|
+
return !0;
|
|
730
754
|
}
|
|
731
755
|
terminate() {
|
|
732
756
|
return this._filterModel = null, this._col$.next(-1), this._disposeFilterHeaderChangeListener(), !0;
|
|
@@ -737,17 +761,17 @@ let W = class extends me {
|
|
|
737
761
|
}
|
|
738
762
|
_listenToFilterHeaderChange(e, r) {
|
|
739
763
|
this._disposeFilterHeaderChangeListener();
|
|
740
|
-
const s = e.unitId, n = e.subUnitId,
|
|
764
|
+
const s = e.unitId, n = e.subUnitId, a = e.getRange(), i = {
|
|
741
765
|
startColumn: r,
|
|
742
|
-
startRow:
|
|
743
|
-
endRow:
|
|
766
|
+
startRow: a.startRow,
|
|
767
|
+
endRow: a.startRow,
|
|
744
768
|
endColumn: r
|
|
745
769
|
};
|
|
746
|
-
this._filterHeaderListener = this._refRangeService.watchRange(s, n, i, (o,
|
|
747
|
-
if (!
|
|
770
|
+
this._filterHeaderListener = this._refRangeService.watchRange(s, n, i, (o, l) => {
|
|
771
|
+
if (!l)
|
|
748
772
|
this.terminate();
|
|
749
773
|
else {
|
|
750
|
-
const c =
|
|
774
|
+
const c = l.startColumn - o.startColumn;
|
|
751
775
|
c !== 0 && this._filterByModel.deltaCol(c);
|
|
752
776
|
}
|
|
753
777
|
});
|
|
@@ -756,49 +780,54 @@ let W = class extends me {
|
|
|
756
780
|
this._disposePreviousModel();
|
|
757
781
|
const s = e.getRange();
|
|
758
782
|
if (s.startRow === s.endRow) return !1;
|
|
759
|
-
const n = await
|
|
783
|
+
const n = await Le.fromFilterColumn(
|
|
760
784
|
this._injector,
|
|
761
785
|
e,
|
|
762
786
|
r
|
|
763
787
|
);
|
|
764
|
-
return this.filterByModel = n, this._filterBy$.next(
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
788
|
+
return this.filterByModel = n, this._filterBy$.next(A.VALUES), this._listenToFilterHeaderChange(e, r), !0;
|
|
789
|
+
}
|
|
790
|
+
async _setupByColors(e, r) {
|
|
791
|
+
this._disposePreviousModel();
|
|
792
|
+
const s = e.getRange();
|
|
793
|
+
if (s.startRow === s.endRow) return !1;
|
|
794
|
+
const n = await $e.fromFilterColumn(
|
|
795
|
+
this._injector,
|
|
796
|
+
e,
|
|
797
|
+
r
|
|
798
|
+
);
|
|
799
|
+
return this.filterByModel = n, this._filterBy$.next(A.COLORS), this._listenToFilterHeaderChange(e, r), !0;
|
|
768
800
|
}
|
|
769
801
|
_setupByConditions(e, r) {
|
|
770
802
|
this._disposePreviousModel();
|
|
771
803
|
const s = e.getRange();
|
|
772
804
|
if (s.startRow === s.endRow) return !1;
|
|
773
|
-
const n =
|
|
805
|
+
const n = we.fromFilterColumn(
|
|
774
806
|
this._injector,
|
|
775
807
|
e,
|
|
776
808
|
r,
|
|
777
809
|
e.getFilterColumn(r)
|
|
778
810
|
);
|
|
779
|
-
return this.filterByModel = n, this._filterBy$.next(
|
|
780
|
-
1
|
|
781
|
-
/* CONDITIONS */
|
|
782
|
-
), this._listenToFilterHeaderChange(e, r), !0;
|
|
811
|
+
return this.filterByModel = n, this._filterBy$.next(A.CONDITIONS), this._listenToFilterHeaderChange(e, r), !0;
|
|
783
812
|
}
|
|
784
813
|
_disposePreviousModel() {
|
|
785
814
|
var e;
|
|
786
815
|
(e = this._filterByModel) == null || e.dispose(), this.filterByModel = null;
|
|
787
816
|
}
|
|
788
817
|
};
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
],
|
|
793
|
-
let
|
|
794
|
-
constructor(e, r, s, n,
|
|
818
|
+
Z = Qe([
|
|
819
|
+
Ce(0, T(re)),
|
|
820
|
+
Ce(1, T(Dr))
|
|
821
|
+
], Z);
|
|
822
|
+
let we = class extends de {
|
|
823
|
+
constructor(e, r, s, n, a) {
|
|
795
824
|
super();
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
this._filterModel = e, this.col = r, this._commandService =
|
|
825
|
+
p(this, "canApply$", me(!0));
|
|
826
|
+
p(this, "_conditionItem$");
|
|
827
|
+
p(this, "conditionItem$");
|
|
828
|
+
p(this, "_filterConditionFormParams$");
|
|
829
|
+
p(this, "filterConditionFormParams$");
|
|
830
|
+
this._filterModel = e, this.col = r, this._commandService = a, this._conditionItem$ = new V(s), this.conditionItem$ = this._conditionItem$.asObservable(), this._filterConditionFormParams$ = new V(n), this.filterConditionFormParams$ = this._filterConditionFormParams$.asObservable();
|
|
802
831
|
}
|
|
803
832
|
/**
|
|
804
833
|
* Create a model with targeting filter column. If there is not a filter column, the model would be created with
|
|
@@ -812,8 +841,8 @@ let ye = class extends me {
|
|
|
812
841
|
* @returns the model to control the panel's state
|
|
813
842
|
*/
|
|
814
843
|
static fromFilterColumn(e, r, s, n) {
|
|
815
|
-
const [
|
|
816
|
-
return e.createInstance(
|
|
844
|
+
const [a, i] = m.testMappingFilterColumn(n == null ? void 0 : n.getColumnData());
|
|
845
|
+
return e.createInstance(we, r, s, a, i);
|
|
817
846
|
}
|
|
818
847
|
get conditionItem() {
|
|
819
848
|
return this._conditionItem$.getValue();
|
|
@@ -828,7 +857,7 @@ let ye = class extends me {
|
|
|
828
857
|
this.col += e;
|
|
829
858
|
}
|
|
830
859
|
clear() {
|
|
831
|
-
return this._disposed ? Promise.resolve(!1) : this._commandService.executeCommand(
|
|
860
|
+
return this._disposed ? Promise.resolve(!1) : this._commandService.executeCommand(Q.id, {
|
|
832
861
|
unitId: this._filterModel.unitId,
|
|
833
862
|
subUnitId: this._filterModel.subUnitId,
|
|
834
863
|
col: this.col,
|
|
@@ -840,8 +869,8 @@ let ye = class extends me {
|
|
|
840
869
|
*/
|
|
841
870
|
async apply() {
|
|
842
871
|
if (this._disposed) return !1;
|
|
843
|
-
const e =
|
|
844
|
-
return this._commandService.executeCommand(
|
|
872
|
+
const e = m.mapToFilterColumn(this.conditionItem, this.filterConditionFormParams);
|
|
873
|
+
return this._commandService.executeCommand(Q.id, {
|
|
845
874
|
unitId: this._filterModel.unitId,
|
|
846
875
|
subUnitId: this._filterModel.subUnitId,
|
|
847
876
|
col: this.col,
|
|
@@ -853,10 +882,10 @@ let ye = class extends me {
|
|
|
853
882
|
* `IFilterConditionFormParams` and load default condition form params.
|
|
854
883
|
*/
|
|
855
884
|
onPrimaryConditionChange(e) {
|
|
856
|
-
const r =
|
|
885
|
+
const r = m.ALL_CONDITIONS.find((s) => s.operator === e);
|
|
857
886
|
if (!r)
|
|
858
887
|
throw new Error(`[ByConditionsModel]: condition item not found for operator: ${e}!`);
|
|
859
|
-
this._conditionItem$.next(r), this._filterConditionFormParams$.next(
|
|
888
|
+
this._conditionItem$.next(r), this._filterConditionFormParams$.next(m.getInitialFormParams(e));
|
|
860
889
|
}
|
|
861
890
|
/**
|
|
862
891
|
* This method would be called when user changes the primary conditions, the input values or "AND" "OR" ratio.
|
|
@@ -869,43 +898,43 @@ let ye = class extends me {
|
|
|
869
898
|
onConditionFormChange(e) {
|
|
870
899
|
const r = { ...this.filterConditionFormParams, ...e };
|
|
871
900
|
if (r.and !== !0 && delete r.and, typeof e.and < "u" || typeof e.operator1 < "u" || typeof e.operator2 < "u") {
|
|
872
|
-
const s =
|
|
901
|
+
const s = m.testMappingParams(r, this.conditionItem.numOfParameters);
|
|
873
902
|
this._conditionItem$.next(s);
|
|
874
903
|
}
|
|
875
904
|
this._filterConditionFormParams$.next(r);
|
|
876
905
|
}
|
|
877
906
|
};
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
],
|
|
881
|
-
let
|
|
882
|
-
constructor(e, r, s, n,
|
|
907
|
+
we = Qe([
|
|
908
|
+
Ce(4, j)
|
|
909
|
+
], we);
|
|
910
|
+
let Le = class extends de {
|
|
911
|
+
constructor(e, r, s, n, a) {
|
|
883
912
|
super();
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
this._filterModel = e, this.col = r, this._commandService =
|
|
894
|
-
|
|
913
|
+
p(this, "_rawFilterItems$");
|
|
914
|
+
p(this, "rawFilterItems$");
|
|
915
|
+
p(this, "filterItems$");
|
|
916
|
+
p(this, "_filterItems", []);
|
|
917
|
+
p(this, "_treeMapCache");
|
|
918
|
+
p(this, "canApply$");
|
|
919
|
+
p(this, "_manuallyUpdateFilterItems$");
|
|
920
|
+
p(this, "_searchString$");
|
|
921
|
+
p(this, "searchString$");
|
|
922
|
+
this._filterModel = e, this.col = r, this._commandService = a, this._treeMapCache = n, this._searchString$ = new V(""), this.searchString$ = this._searchString$.asObservable(), this._rawFilterItems$ = new V(s), this.rawFilterItems$ = this._rawFilterItems$.asObservable(), this._manuallyUpdateFilterItems$ = new Kr(), this.filterItems$ = qr(
|
|
923
|
+
Xr([
|
|
895
924
|
this._searchString$.pipe(
|
|
896
|
-
|
|
897
|
-
|
|
925
|
+
Ht(500, void 0, { leading: !0, trailing: !0 }),
|
|
926
|
+
Dt(void 0)
|
|
898
927
|
),
|
|
899
928
|
this._rawFilterItems$
|
|
900
929
|
]).pipe(
|
|
901
|
-
|
|
930
|
+
ce(([i, o]) => {
|
|
902
931
|
if (!i) return o;
|
|
903
932
|
const c = i.toLowerCase().split(/\s+/).filter((h) => !!h);
|
|
904
|
-
return
|
|
933
|
+
return jt(o, c);
|
|
905
934
|
})
|
|
906
935
|
),
|
|
907
936
|
this._manuallyUpdateFilterItems$
|
|
908
|
-
).pipe(
|
|
937
|
+
).pipe(zr(1)), this.canApply$ = this.filterItems$.pipe(ce((i) => qe(i).checked > 0)), this.disposeWithMe(this.filterItems$.subscribe((i) => this._filterItems = i));
|
|
909
938
|
}
|
|
910
939
|
/**
|
|
911
940
|
* Create a model with targeting filter column. If there is not a filter column, the model would be created with
|
|
@@ -918,29 +947,39 @@ let Oe = class extends me {
|
|
|
918
947
|
* @returns the model to control the panel's state
|
|
919
948
|
*/
|
|
920
949
|
static async fromFilterColumn(e, r, s) {
|
|
921
|
-
|
|
922
|
-
const n = e.get(Ge), l = e.get(K), i = e.get(Ne, gt.OPTIONAL), { unitId: o, subUnitId: a } = r, c = n.getUniverSheetInstance(o);
|
|
950
|
+
const n = e.get(De), a = e.get(K), i = e.get(Pe, At.OPTIONAL), { unitId: o, subUnitId: l } = r, c = n.getUniverSheetInstance(o);
|
|
923
951
|
if (!c) throw new Error(`[ByValuesModel]: Workbook not found for filter model with unitId: ${o}!`);
|
|
924
|
-
const h = c == null ? void 0 : c.getSheetBySheetId(
|
|
925
|
-
if (!h) throw new Error(`[ByValuesModel]: Worksheet not found for filter model with unitId: ${o} and subUnitId: ${
|
|
926
|
-
const
|
|
927
|
-
let
|
|
952
|
+
const h = c == null ? void 0 : c.getSheetBySheetId(l);
|
|
953
|
+
if (!h) throw new Error(`[ByValuesModel]: Worksheet not found for filter model with unitId: ${o} and subUnitId: ${l}!`);
|
|
954
|
+
const d = r.getRange(), C = s, v = r.getFilterColumn(s), _ = v == null ? void 0 : v.getColumnData().filters, S = new Set(_ == null ? void 0 : _.filters), N = !!(_ && _.blank), E = r.getFilteredOutRowsExceptCol(s), b = { ...d, startRow: d.startRow + 1, startColumn: C, endColumn: C };
|
|
955
|
+
let F, R;
|
|
928
956
|
if (i) {
|
|
929
|
-
const
|
|
957
|
+
const w = await i.getFilterValues({
|
|
930
958
|
unitId: o,
|
|
931
|
-
subUnitId:
|
|
932
|
-
filteredOutRowsByOtherColumns: Array.from(
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
959
|
+
subUnitId: l,
|
|
960
|
+
filteredOutRowsByOtherColumns: Array.from(E),
|
|
961
|
+
filterColumn: v,
|
|
962
|
+
filters: !!_,
|
|
963
|
+
blankChecked: N,
|
|
964
|
+
iterateRange: b,
|
|
965
|
+
alreadyChecked: Array.from(S)
|
|
937
966
|
});
|
|
938
|
-
|
|
967
|
+
F = w.filterTreeItems, R = w.filterTreeMapCache;
|
|
939
968
|
} else {
|
|
940
|
-
const
|
|
941
|
-
|
|
969
|
+
const w = Qt(
|
|
970
|
+
!!_,
|
|
971
|
+
a,
|
|
972
|
+
b,
|
|
973
|
+
h,
|
|
974
|
+
E,
|
|
975
|
+
v,
|
|
976
|
+
S,
|
|
977
|
+
N,
|
|
978
|
+
c.getStyles()
|
|
979
|
+
);
|
|
980
|
+
F = w.filterTreeItems, R = w.filterTreeMapCache;
|
|
942
981
|
}
|
|
943
|
-
return e.createInstance(
|
|
982
|
+
return e.createInstance(Le, r, s, F, R);
|
|
944
983
|
}
|
|
945
984
|
get rawFilterItems() {
|
|
946
985
|
return this._rawFilterItems$.getValue();
|
|
@@ -961,24 +1000,24 @@ let Oe = class extends me {
|
|
|
961
1000
|
this._searchString$.next(e);
|
|
962
1001
|
}
|
|
963
1002
|
onCheckAllToggled(e) {
|
|
964
|
-
const r =
|
|
965
|
-
r.forEach((s) =>
|
|
1003
|
+
const r = Re.deepClone(this._filterItems);
|
|
1004
|
+
r.forEach((s) => ge(s, e)), this._manuallyUpdateFilterItems(r);
|
|
966
1005
|
}
|
|
967
1006
|
/**
|
|
968
1007
|
* Toggle a filter item.
|
|
969
1008
|
*/
|
|
970
1009
|
onFilterCheckToggled(e) {
|
|
971
|
-
const r =
|
|
1010
|
+
const r = Re.deepClone(this._filterItems), s = ze(r, e.key);
|
|
972
1011
|
if (!s)
|
|
973
1012
|
return;
|
|
974
|
-
const n =
|
|
975
|
-
|
|
1013
|
+
const n = Vt(s);
|
|
1014
|
+
ge(s, !n), this._manuallyUpdateFilterItems(r);
|
|
976
1015
|
}
|
|
977
1016
|
onFilterOnly(e) {
|
|
978
|
-
const r =
|
|
979
|
-
r.forEach((s) =>
|
|
980
|
-
const n =
|
|
981
|
-
n &&
|
|
1017
|
+
const r = Re.deepClone(this._filterItems);
|
|
1018
|
+
r.forEach((s) => ge(s, !1)), e.forEach((s) => {
|
|
1019
|
+
const n = ze(r, s);
|
|
1020
|
+
n && ge(n, !0);
|
|
982
1021
|
}), this._manuallyUpdateFilterItems(r);
|
|
983
1022
|
}
|
|
984
1023
|
_manuallyUpdateFilterItems(e) {
|
|
@@ -987,7 +1026,7 @@ let Oe = class extends me {
|
|
|
987
1026
|
// expose method here to let the panel change filter items
|
|
988
1027
|
// #region ByValuesModel apply methods
|
|
989
1028
|
clear() {
|
|
990
|
-
return this._disposed ? Promise.resolve(!1) : this._commandService.executeCommand(
|
|
1029
|
+
return this._disposed ? Promise.resolve(!1) : this._commandService.executeCommand(Q.id, {
|
|
991
1030
|
unitId: this._filterModel.unitId,
|
|
992
1031
|
subUnitId: this._filterModel.subUnitId,
|
|
993
1032
|
col: this.col,
|
|
@@ -1000,154 +1039,280 @@ let Oe = class extends me {
|
|
|
1000
1039
|
async apply() {
|
|
1001
1040
|
if (this._disposed)
|
|
1002
1041
|
return !1;
|
|
1003
|
-
const e =
|
|
1004
|
-
let
|
|
1042
|
+
const e = qe(this._filterItems), { checked: r, checkedItems: s } = e, n = this.rawFilterItems;
|
|
1043
|
+
let a = 0;
|
|
1005
1044
|
for (const c of n)
|
|
1006
|
-
|
|
1007
|
-
const i = r === 0, o = e.checked ===
|
|
1045
|
+
a += c.count;
|
|
1046
|
+
const i = r === 0, o = e.checked === a, l = { colId: this.col };
|
|
1008
1047
|
if (i)
|
|
1009
1048
|
throw new Error("[ByValuesModel]: no checked items!");
|
|
1010
1049
|
if (o)
|
|
1011
|
-
return this._commandService.executeCommand(
|
|
1050
|
+
return this._commandService.executeCommand(Q.id, {
|
|
1012
1051
|
unitId: this._filterModel.unitId,
|
|
1013
1052
|
subUnitId: this._filterModel.subUnitId,
|
|
1014
1053
|
col: this.col,
|
|
1015
1054
|
criteria: null
|
|
1016
1055
|
});
|
|
1017
1056
|
{
|
|
1018
|
-
|
|
1019
|
-
const c = s.filter((
|
|
1020
|
-
c.length > 0 && (
|
|
1021
|
-
filters: c.flatMap((
|
|
1022
|
-
}), c.length !== s.length && (
|
|
1057
|
+
l.filters = {};
|
|
1058
|
+
const c = s.filter((d) => d.key !== "empty");
|
|
1059
|
+
c.length > 0 && (l.filters = {
|
|
1060
|
+
filters: c.flatMap((d) => d.originValues ? Array.from(d.originValues) : [d.title])
|
|
1061
|
+
}), c.length !== s.length && (l.filters.blank = !0);
|
|
1023
1062
|
}
|
|
1024
|
-
return this._commandService.executeCommand(
|
|
1063
|
+
return this._commandService.executeCommand(Q.id, {
|
|
1025
1064
|
unitId: this._filterModel.unitId,
|
|
1026
1065
|
subUnitId: this._filterModel.subUnitId,
|
|
1027
1066
|
col: this.col,
|
|
1028
|
-
criteria:
|
|
1067
|
+
criteria: l
|
|
1029
1068
|
});
|
|
1030
1069
|
}
|
|
1031
1070
|
// #endregion
|
|
1032
1071
|
};
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
],
|
|
1036
|
-
|
|
1072
|
+
Le = Qe([
|
|
1073
|
+
Ce(4, j)
|
|
1074
|
+
], Le);
|
|
1075
|
+
let $e = class extends de {
|
|
1076
|
+
constructor(e, r, s, n, a) {
|
|
1077
|
+
super();
|
|
1078
|
+
p(this, "canApply$", me(!0));
|
|
1079
|
+
p(this, "_cellFillColors$");
|
|
1080
|
+
p(this, "cellFillColors$");
|
|
1081
|
+
p(this, "_cellTextColors$");
|
|
1082
|
+
p(this, "cellTextColors$");
|
|
1083
|
+
this._filterModel = e, this.col = r, this._commandService = a, this._cellFillColors$ = new V(Array.from(s.values())), this.cellFillColors$ = this._cellFillColors$.asObservable(), this._cellTextColors$ = new V(Array.from(n.values())), this.cellTextColors$ = this._cellTextColors$.asObservable();
|
|
1084
|
+
}
|
|
1085
|
+
/**
|
|
1086
|
+
* Create a model with targeting filter column. If there is not a filter column, the model would be created with
|
|
1087
|
+
* default values.
|
|
1088
|
+
*
|
|
1089
|
+
* @param injector
|
|
1090
|
+
* @param filterModel
|
|
1091
|
+
* @param col
|
|
1092
|
+
*
|
|
1093
|
+
* @returns the model to control the panel's state
|
|
1094
|
+
*/
|
|
1095
|
+
static async fromFilterColumn(e, r, s) {
|
|
1096
|
+
var b, F, R;
|
|
1097
|
+
const n = e.get(De), { unitId: a, subUnitId: i } = r, o = n.getUniverSheetInstance(a);
|
|
1098
|
+
if (!o) throw new Error(`[ByColorsModel]: Workbook not found for filter model with unitId: ${a}!`);
|
|
1099
|
+
const l = o == null ? void 0 : o.getSheetBySheetId(i);
|
|
1100
|
+
if (!l) throw new Error(`[ByColorsModel]: Worksheet not found for filter model with unitId: ${a} and subUnitId: ${i}!`);
|
|
1101
|
+
const c = r.getRange(), h = s, d = (b = r.getFilterColumn(s)) == null ? void 0 : b.getColumnData().colorFilters, C = r.getFilteredOutRowsExceptCol(s), v = { ...c, startRow: c.startRow + 1, startColumn: h, endColumn: h }, _ = /* @__PURE__ */ new Map(), S = new Set((F = d == null ? void 0 : d.cellFillColors) != null ? F : []), N = /* @__PURE__ */ new Map(), E = new Set((R = d == null ? void 0 : d.cellTextColors) != null ? R : []);
|
|
1102
|
+
for (const w of l.iterateByColumn(v, !1, !0)) {
|
|
1103
|
+
const { row: X, col: se, value: ne } = w;
|
|
1104
|
+
if (C.has(X))
|
|
1105
|
+
continue;
|
|
1106
|
+
const D = l.getComposedCellStyleByCellData(X, se, ne);
|
|
1107
|
+
if (D.bg && D.bg.rgb) {
|
|
1108
|
+
const L = new mt(D.bg.rgb).toRgbString();
|
|
1109
|
+
_.has(L) || _.set(L, { color: L, checked: S.has(L) });
|
|
1110
|
+
} else
|
|
1111
|
+
_.set("default-fill-color", { color: null, checked: S.has(null) });
|
|
1112
|
+
if (D.cl && D.cl.rgb) {
|
|
1113
|
+
const L = new mt(D.cl.rgb).toRgbString();
|
|
1114
|
+
N.has(L) || N.set(L, { color: L, checked: E.has(L) });
|
|
1115
|
+
} else
|
|
1116
|
+
N.set("default-font-color", { color: vt, checked: E.has(vt) });
|
|
1117
|
+
}
|
|
1118
|
+
return e.createInstance($e, r, s, _, N);
|
|
1119
|
+
}
|
|
1120
|
+
get cellFillColors() {
|
|
1121
|
+
return this._cellFillColors$.getValue();
|
|
1122
|
+
}
|
|
1123
|
+
get cellTextColors() {
|
|
1124
|
+
return this._cellTextColors$.getValue();
|
|
1125
|
+
}
|
|
1126
|
+
dispose() {
|
|
1127
|
+
super.dispose(), this._cellFillColors$.complete();
|
|
1128
|
+
}
|
|
1129
|
+
deltaCol(e) {
|
|
1130
|
+
this.col += e;
|
|
1131
|
+
}
|
|
1132
|
+
// expose method here to let the panel change filter items
|
|
1133
|
+
// #region ByColorsModel apply methods
|
|
1134
|
+
clear() {
|
|
1135
|
+
return this._disposed ? Promise.resolve(!1) : this._commandService.executeCommand(Q.id, {
|
|
1136
|
+
unitId: this._filterModel.unitId,
|
|
1137
|
+
subUnitId: this._filterModel.subUnitId,
|
|
1138
|
+
col: this.col,
|
|
1139
|
+
criteria: null
|
|
1140
|
+
});
|
|
1141
|
+
}
|
|
1142
|
+
onFilterCheckToggled(e, r = !0) {
|
|
1143
|
+
const s = r ? this.cellFillColors : this.cellTextColors, n = [];
|
|
1144
|
+
let a = !1;
|
|
1145
|
+
for (let i = 0; i < s.length; i++) {
|
|
1146
|
+
const o = s[i];
|
|
1147
|
+
if (o.color === e.color) {
|
|
1148
|
+
a = !0, n.push({
|
|
1149
|
+
color: o.color,
|
|
1150
|
+
checked: !o.checked
|
|
1151
|
+
});
|
|
1152
|
+
continue;
|
|
1153
|
+
}
|
|
1154
|
+
n.push({
|
|
1155
|
+
color: o.color,
|
|
1156
|
+
checked: o.checked
|
|
1157
|
+
});
|
|
1158
|
+
}
|
|
1159
|
+
a && (this._resetColorsCheckedStatus(!r), r ? this._cellFillColors$.next([...n]) : this._cellTextColors$.next([...n]));
|
|
1160
|
+
}
|
|
1161
|
+
_resetColorsCheckedStatus(e = !0) {
|
|
1162
|
+
const r = e ? this.cellFillColors : this.cellTextColors, s = [];
|
|
1163
|
+
for (let n = 0; n < r.length; n++)
|
|
1164
|
+
s.push({
|
|
1165
|
+
color: r[n].color,
|
|
1166
|
+
checked: !1
|
|
1167
|
+
});
|
|
1168
|
+
e ? this._cellFillColors$.next([...s]) : this._cellTextColors$.next([...s]);
|
|
1169
|
+
}
|
|
1170
|
+
/**
|
|
1171
|
+
* Apply the filter condition to the target filter column.
|
|
1172
|
+
*/
|
|
1173
|
+
async apply() {
|
|
1174
|
+
if (this._disposed)
|
|
1175
|
+
return !1;
|
|
1176
|
+
const e = this.cellFillColors.filter((n) => n.checked).map((n) => n.color), r = this.cellTextColors.filter((n) => n.checked).map((n) => n.color);
|
|
1177
|
+
if (e.length === 0 && r.length === 0)
|
|
1178
|
+
return this._commandService.executeCommand(Q.id, {
|
|
1179
|
+
unitId: this._filterModel.unitId,
|
|
1180
|
+
subUnitId: this._filterModel.subUnitId,
|
|
1181
|
+
col: this.col,
|
|
1182
|
+
criteria: null
|
|
1183
|
+
});
|
|
1184
|
+
const s = { colId: this.col };
|
|
1185
|
+
return e.length > 0 ? s.colorFilters = {
|
|
1186
|
+
cellFillColors: e
|
|
1187
|
+
} : r.length > 0 && (s.colorFilters = {
|
|
1188
|
+
cellTextColors: r
|
|
1189
|
+
}), this._commandService.executeCommand(Q.id, {
|
|
1190
|
+
unitId: this._filterModel.unitId,
|
|
1191
|
+
subUnitId: this._filterModel.subUnitId,
|
|
1192
|
+
col: this.col,
|
|
1193
|
+
criteria: s
|
|
1194
|
+
});
|
|
1195
|
+
}
|
|
1196
|
+
// #endregion
|
|
1197
|
+
};
|
|
1198
|
+
$e = Qe([
|
|
1199
|
+
Ce(4, j)
|
|
1200
|
+
], $e);
|
|
1201
|
+
const ue = "FILTER_PANEL_OPENED", Me = {
|
|
1037
1202
|
id: "sheet.operation.open-filter-panel",
|
|
1038
|
-
type:
|
|
1203
|
+
type: Be.OPERATION,
|
|
1039
1204
|
handler: (t, e) => {
|
|
1040
|
-
const r = t.get(
|
|
1041
|
-
t.get(
|
|
1042
|
-
const { unitId: i, subUnitId: o, col:
|
|
1043
|
-
return c ? (n.setupCol(c,
|
|
1205
|
+
const r = t.get(We), s = t.get(q), n = t.get(Z);
|
|
1206
|
+
t.get(j).syncExecuteCommand(Sr.id, { visible: !1 });
|
|
1207
|
+
const { unitId: i, subUnitId: o, col: l } = e, c = s.getFilterModel(i, o);
|
|
1208
|
+
return c ? (n.setupCol(c, l), r.getContextValue(ue) || r.setContextValue(ue, !0), !0) : !1;
|
|
1044
1209
|
}
|
|
1045
|
-
},
|
|
1210
|
+
}, Se = {
|
|
1046
1211
|
id: "sheet.operation.close-filter-panel",
|
|
1047
|
-
type:
|
|
1212
|
+
type: Be.OPERATION,
|
|
1048
1213
|
handler: (t) => {
|
|
1049
|
-
const e = t.get(
|
|
1050
|
-
return e.getContextValue(
|
|
1214
|
+
const e = t.get(We), r = t.get(Z), s = t.get(Ar, At.OPTIONAL);
|
|
1215
|
+
return e.getContextValue(ue) ? (e.setContextValue(ue, !1), s == null || s.focus(), r.terminate()) : !1;
|
|
1051
1216
|
}
|
|
1052
|
-
},
|
|
1217
|
+
}, Gt = {
|
|
1053
1218
|
id: "sheet.operation.apply-filter",
|
|
1054
|
-
type:
|
|
1219
|
+
type: Be.OPERATION,
|
|
1055
1220
|
handler: (t, e) => {
|
|
1056
1221
|
const { filterBy: r } = e;
|
|
1057
|
-
return t.get(
|
|
1222
|
+
return t.get(Z).changeFilterBy(r);
|
|
1058
1223
|
}
|
|
1059
|
-
},
|
|
1060
|
-
var
|
|
1061
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
1062
|
-
(i = t[
|
|
1224
|
+
}, Yt = "sheets-filter-ui.config", xe = {};
|
|
1225
|
+
var vi = Object.getOwnPropertyDescriptor, _i = (t, e, r, s) => {
|
|
1226
|
+
for (var n = s > 1 ? void 0 : s ? vi(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
1227
|
+
(i = t[a]) && (n = i(n) || n);
|
|
1063
1228
|
return n;
|
|
1064
|
-
},
|
|
1065
|
-
let
|
|
1066
|
-
constructor(t, e, r, s, n,
|
|
1067
|
-
super(), this._sheetsFilterService = t, this._localeService = e, this._commandService = r, this._sheetPermissionCheckPermission = s, this._injector = n, this._sheetsSelectionService =
|
|
1229
|
+
}, ae = (t, e) => (r, s) => e(r, s, t);
|
|
1230
|
+
let he = class extends de {
|
|
1231
|
+
constructor(t, e, r, s, n, a) {
|
|
1232
|
+
super(), this._sheetsFilterService = t, this._localeService = e, this._commandService = r, this._sheetPermissionCheckPermission = s, this._injector = n, this._sheetsSelectionService = a, this._commandExecutedListener();
|
|
1068
1233
|
}
|
|
1069
1234
|
_commandExecutedListener() {
|
|
1070
1235
|
this.disposeWithMe(
|
|
1071
1236
|
this._commandService.beforeCommandExecuted((t) => {
|
|
1072
1237
|
var e, r, s;
|
|
1073
|
-
if (t.id ===
|
|
1074
|
-
const n = this._injector.get(
|
|
1075
|
-
if (!
|
|
1076
|
-
const { unitId: i, subUnitId: o, worksheet:
|
|
1238
|
+
if (t.id === Ee.id) {
|
|
1239
|
+
const n = this._injector.get(De), a = Qr(n);
|
|
1240
|
+
if (!a) return;
|
|
1241
|
+
const { unitId: i, subUnitId: o, worksheet: l } = a, c = (e = this._sheetsFilterService.getFilterModel(i, o)) == null ? void 0 : e.getRange();
|
|
1077
1242
|
let h;
|
|
1078
1243
|
if (c)
|
|
1079
1244
|
h = this._sheetPermissionCheckPermission.permissionCheckWithRanges({
|
|
1080
|
-
rangeTypes: [
|
|
1081
|
-
worksheetTypes: [
|
|
1245
|
+
rangeTypes: [_e],
|
|
1246
|
+
worksheetTypes: [pe, ve]
|
|
1082
1247
|
}, [c]);
|
|
1083
1248
|
else {
|
|
1084
|
-
const
|
|
1085
|
-
if (
|
|
1086
|
-
let
|
|
1087
|
-
|
|
1088
|
-
rangeTypes: [
|
|
1089
|
-
worksheetTypes: [
|
|
1090
|
-
}, [
|
|
1249
|
+
const d = (r = this._sheetsSelectionService.getCurrentLastSelection()) == null ? void 0 : r.range;
|
|
1250
|
+
if (d) {
|
|
1251
|
+
let C = { ...d };
|
|
1252
|
+
C = d.startColumn === d.endColumn && d.startRow === d.endRow ? Vr(C, { left: !0, right: !0, up: !0, down: !0 }, l) : C, h = this._sheetPermissionCheckPermission.permissionCheckWithRanges({
|
|
1253
|
+
rangeTypes: [_e],
|
|
1254
|
+
worksheetTypes: [ve, pe]
|
|
1255
|
+
}, [C], i, o);
|
|
1091
1256
|
} else
|
|
1092
1257
|
h = this._sheetPermissionCheckPermission.permissionCheckWithoutRange({
|
|
1093
|
-
rangeTypes: [
|
|
1094
|
-
worksheetTypes: [
|
|
1258
|
+
rangeTypes: [_e],
|
|
1259
|
+
worksheetTypes: [ve, pe]
|
|
1095
1260
|
});
|
|
1096
1261
|
}
|
|
1097
1262
|
h || this._sheetPermissionCheckPermission.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.filterErr"));
|
|
1098
1263
|
}
|
|
1099
|
-
if (t.id ===
|
|
1100
|
-
const n = t.params, { unitId:
|
|
1101
|
-
|
|
1102
|
-
rangeTypes: [
|
|
1103
|
-
worksheetTypes: [
|
|
1104
|
-
}, [
|
|
1264
|
+
if (t.id === Me.id) {
|
|
1265
|
+
const n = t.params, { unitId: a, subUnitId: i } = n, o = (s = this._sheetsFilterService.getFilterModel(a, i)) == null ? void 0 : s.getRange(), l = Re.deepClone(o);
|
|
1266
|
+
l && (l.startColumn = n.col, l.endColumn = n.col, this._sheetPermissionCheckPermission.permissionCheckWithRanges({
|
|
1267
|
+
rangeTypes: [_e],
|
|
1268
|
+
worksheetTypes: [pe, ve]
|
|
1269
|
+
}, [l]) || this._sheetPermissionCheckPermission.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.filterErr")));
|
|
1105
1270
|
}
|
|
1106
1271
|
})
|
|
1107
1272
|
);
|
|
1108
1273
|
}
|
|
1109
1274
|
};
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
],
|
|
1118
|
-
const
|
|
1119
|
-
class
|
|
1275
|
+
he = _i([
|
|
1276
|
+
ae(0, T(q)),
|
|
1277
|
+
ae(1, T(K)),
|
|
1278
|
+
ae(2, j),
|
|
1279
|
+
ae(3, T(Br)),
|
|
1280
|
+
ae(4, T(re)),
|
|
1281
|
+
ae(5, T(Wr))
|
|
1282
|
+
], he);
|
|
1283
|
+
const Y = 16, gi = 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");
|
|
1284
|
+
class Et {
|
|
1120
1285
|
static drawNoCriteria(e, r, s, n) {
|
|
1121
|
-
e.save(),
|
|
1286
|
+
e.save(), _t.drawWith(e, {
|
|
1122
1287
|
radius: 2,
|
|
1123
|
-
width:
|
|
1124
|
-
height:
|
|
1288
|
+
width: Y,
|
|
1289
|
+
height: Y,
|
|
1125
1290
|
fill: n
|
|
1126
|
-
}), e.lineCap = "square", e.strokeStyle = s, e.scale(r /
|
|
1291
|
+
}), e.lineCap = "square", e.strokeStyle = s, e.scale(r / Y, r / Y), 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();
|
|
1127
1292
|
}
|
|
1128
1293
|
static drawHasCriteria(e, r, s, n) {
|
|
1129
|
-
e.save(),
|
|
1294
|
+
e.save(), _t.drawWith(e, {
|
|
1130
1295
|
radius: 2,
|
|
1131
|
-
width:
|
|
1132
|
-
height:
|
|
1296
|
+
width: Y,
|
|
1297
|
+
height: Y,
|
|
1133
1298
|
fill: n
|
|
1134
|
-
}), e.scale(r /
|
|
1299
|
+
}), e.scale(r / Y, r / Y), e.fillStyle = s, e.fill(gi), e.restore();
|
|
1135
1300
|
}
|
|
1136
1301
|
}
|
|
1137
|
-
var
|
|
1138
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
1139
|
-
(i = t[
|
|
1302
|
+
var Si = Object.getOwnPropertyDescriptor, Ci = (t, e, r, s) => {
|
|
1303
|
+
for (var n = s > 1 ? void 0 : s ? Si(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
1304
|
+
(i = t[a]) && (n = i(n) || n);
|
|
1140
1305
|
return n;
|
|
1141
|
-
},
|
|
1142
|
-
const
|
|
1143
|
-
let
|
|
1144
|
-
constructor(e, r, s, n,
|
|
1306
|
+
}, Ze = (t, e) => (r, s) => e(r, s, t);
|
|
1307
|
+
const W = 16, Ie = 1;
|
|
1308
|
+
let Je = class extends Hr {
|
|
1309
|
+
constructor(e, r, s, n, a) {
|
|
1145
1310
|
super(e, r);
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
this._contextService = s, this._commandService = n, this._themeService =
|
|
1311
|
+
p(this, "_cellWidth", 0);
|
|
1312
|
+
p(this, "_cellHeight", 0);
|
|
1313
|
+
p(this, "_filterParams");
|
|
1314
|
+
p(this, "_hovered", !1);
|
|
1315
|
+
this._contextService = s, this._commandService = n, this._themeService = a, this.setShapeProps(r), this.onPointerDown$.subscribeEvent((i) => this.onPointerDown(i)), this.onPointerEnter$.subscribeEvent(() => this.onPointerEnter()), this.onPointerLeave$.subscribeEvent(() => this.onPointerLeave());
|
|
1151
1316
|
}
|
|
1152
1317
|
setShapeProps(e) {
|
|
1153
1318
|
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({
|
|
@@ -1156,19 +1321,19 @@ let Qe = class extends Gr {
|
|
|
1156
1321
|
});
|
|
1157
1322
|
}
|
|
1158
1323
|
_draw(e) {
|
|
1159
|
-
const r = this._cellHeight, s = this._cellWidth, n =
|
|
1324
|
+
const r = this._cellHeight, s = this._cellWidth, n = W - s, a = W - r;
|
|
1160
1325
|
e.save();
|
|
1161
1326
|
const i = new Path2D();
|
|
1162
|
-
i.rect(n,
|
|
1163
|
-
const { hasCriteria: o } = this._filterParams,
|
|
1164
|
-
o ?
|
|
1327
|
+
i.rect(n, a, s, r), e.clip(i);
|
|
1328
|
+
const { hasCriteria: o } = this._filterParams, l = this._themeService.getColorFromTheme("primary.600"), c = this._hovered ? this._themeService.getColorFromTheme("gray.50") : "rgba(255, 255, 255, 1.0)";
|
|
1329
|
+
o ? Et.drawHasCriteria(e, W, l, c) : Et.drawNoCriteria(e, W, l, c), e.restore();
|
|
1165
1330
|
}
|
|
1166
1331
|
onPointerDown(e) {
|
|
1167
1332
|
if (e.button === 2)
|
|
1168
1333
|
return;
|
|
1169
1334
|
const { col: r, unitId: s, subUnitId: n } = this._filterParams;
|
|
1170
|
-
this._contextService.getContextValue(
|
|
1171
|
-
this._commandService.executeCommand(
|
|
1335
|
+
this._contextService.getContextValue(ue) || !this._commandService.hasCommand(Me.id) || setTimeout(() => {
|
|
1336
|
+
this._commandService.executeCommand(Me.id, {
|
|
1172
1337
|
unitId: s,
|
|
1173
1338
|
subUnitId: n,
|
|
1174
1339
|
col: r
|
|
@@ -1182,107 +1347,107 @@ let Qe = class extends Gr {
|
|
|
1182
1347
|
this._hovered = !1, this.makeDirty(!0);
|
|
1183
1348
|
}
|
|
1184
1349
|
};
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
],
|
|
1190
|
-
var
|
|
1191
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
1192
|
-
(i = t[
|
|
1350
|
+
Je = Ci([
|
|
1351
|
+
Ze(2, We),
|
|
1352
|
+
Ze(3, j),
|
|
1353
|
+
Ze(4, T(Pt))
|
|
1354
|
+
], Je);
|
|
1355
|
+
var Ti = Object.getOwnPropertyDescriptor, Ei = (t, e, r, s) => {
|
|
1356
|
+
for (var n = s > 1 ? void 0 : s ? Ti(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
1357
|
+
(i = t[a]) && (n = i(n) || n);
|
|
1193
1358
|
return n;
|
|
1194
|
-
},
|
|
1195
|
-
const
|
|
1196
|
-
let
|
|
1197
|
-
constructor(e, r, s, n,
|
|
1359
|
+
}, ee = (t, e) => (r, s) => e(r, s, t);
|
|
1360
|
+
const Ni = 1e3, Fi = 5e3;
|
|
1361
|
+
let et = class extends wt {
|
|
1362
|
+
constructor(e, r, s, n, a, i, o, l) {
|
|
1198
1363
|
super();
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
this._context = e, this._injector = r, this._sheetSkeletonManagerService = s, this._sheetsFilterService = n, this._themeService =
|
|
1364
|
+
p(this, "_filterRangeShape", null);
|
|
1365
|
+
p(this, "_buttonRenderDisposable", null);
|
|
1366
|
+
p(this, "_filterButtonShapes", []);
|
|
1367
|
+
this._context = e, this._injector = r, this._sheetSkeletonManagerService = s, this._sheetsFilterService = n, this._themeService = a, this._sheetInterceptorService = i, this._commandService = o, this._selectionRenderService = l, this._initRenderer();
|
|
1203
1368
|
}
|
|
1204
1369
|
dispose() {
|
|
1205
1370
|
super.dispose(), this._disposeRendering();
|
|
1206
1371
|
}
|
|
1207
1372
|
_initRenderer() {
|
|
1208
1373
|
this._sheetSkeletonManagerService.currentSkeleton$.pipe(
|
|
1209
|
-
|
|
1210
|
-
var o,
|
|
1211
|
-
if (!e) return
|
|
1212
|
-
const { unit: r, unitId: s } = this._context, n = ((o = r.getActiveSheet()) == null ? void 0 : o.getSheetId()) || "",
|
|
1374
|
+
ot((e) => {
|
|
1375
|
+
var o, l;
|
|
1376
|
+
if (!e) return me(null);
|
|
1377
|
+
const { unit: r, unitId: s } = this._context, n = ((o = r.getActiveSheet()) == null ? void 0 : o.getSheetId()) || "", a = (l = this._sheetsFilterService.getFilterModel(s, n)) != null ? l : void 0, i = () => ({
|
|
1213
1378
|
unitId: s,
|
|
1214
1379
|
worksheetId: n,
|
|
1215
|
-
filterModel:
|
|
1216
|
-
range:
|
|
1380
|
+
filterModel: a,
|
|
1381
|
+
range: a == null ? void 0 : a.getRange(),
|
|
1217
1382
|
skeleton: e.skeleton
|
|
1218
1383
|
});
|
|
1219
|
-
return
|
|
1220
|
-
|
|
1384
|
+
return ar(this._commandService.onCommandExecuted.bind(this._commandService)).pipe(
|
|
1385
|
+
Jr(
|
|
1221
1386
|
([c]) => {
|
|
1222
1387
|
var h;
|
|
1223
|
-
return c.type ===
|
|
1388
|
+
return c.type === Be.MUTATION && ((h = c.params) == null ? void 0 : h.unitId) === r.getUnitId() && (dr.has(c.id) || c.id === Gr.id);
|
|
1224
1389
|
}
|
|
1225
1390
|
),
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1391
|
+
Ht(20, void 0, { leading: !1, trailing: !0 }),
|
|
1392
|
+
ce(i),
|
|
1393
|
+
Dt(i())
|
|
1229
1394
|
// must trigger once
|
|
1230
1395
|
);
|
|
1231
1396
|
}),
|
|
1232
|
-
|
|
1397
|
+
ei(this.dispose$)
|
|
1233
1398
|
).subscribe((e) => {
|
|
1234
1399
|
this._disposeRendering(), !(!e || !e.range) && (this._renderRange(e.range, e.skeleton), this._renderButtons(e));
|
|
1235
1400
|
});
|
|
1236
1401
|
}
|
|
1237
1402
|
_renderRange(e, r) {
|
|
1238
|
-
const { scene: s } = this._context, { rowHeaderWidth: n, columnHeaderHeight:
|
|
1403
|
+
const { scene: s } = this._context, { rowHeaderWidth: n, columnHeaderHeight: a } = r, i = this._filterRangeShape = new Er(
|
|
1239
1404
|
s,
|
|
1240
|
-
|
|
1405
|
+
Ni,
|
|
1241
1406
|
this._themeService,
|
|
1242
1407
|
{
|
|
1243
1408
|
rowHeaderWidth: n,
|
|
1244
|
-
columnHeaderHeight:
|
|
1409
|
+
columnHeaderHeight: a,
|
|
1245
1410
|
enableAutoFill: !1,
|
|
1246
1411
|
highlightHeader: !1
|
|
1247
1412
|
}
|
|
1248
|
-
),
|
|
1413
|
+
), l = Nr({
|
|
1249
1414
|
range: e,
|
|
1250
1415
|
primary: null,
|
|
1251
1416
|
style: { fill: "rgba(0, 0, 0, 0.0)" }
|
|
1252
1417
|
}, r);
|
|
1253
|
-
i.updateRangeBySelectionWithCoord(
|
|
1418
|
+
i.updateRangeBySelectionWithCoord(l), i.setEvent(!1), s.makeDirty(!0);
|
|
1254
1419
|
}
|
|
1255
1420
|
_renderButtons(e) {
|
|
1256
|
-
const { range: r, filterModel: s, unitId: n, skeleton:
|
|
1421
|
+
const { range: r, filterModel: s, unitId: n, skeleton: a, worksheetId: i } = e, { scene: o } = this._context;
|
|
1257
1422
|
this._interceptCellContent(n, i, e.range);
|
|
1258
|
-
const { startColumn:
|
|
1259
|
-
for (let
|
|
1260
|
-
const
|
|
1261
|
-
if (
|
|
1423
|
+
const { startColumn: l, endColumn: c, startRow: h } = r;
|
|
1424
|
+
for (let d = l; d <= c; d++) {
|
|
1425
|
+
const C = `sheets-filter-button-${d}`, v = Fr(h, d, o, a), { startX: _, startY: S, endX: N, endY: E } = v, b = N - _, F = E - S;
|
|
1426
|
+
if (F <= Ie || b <= Ie)
|
|
1262
1427
|
continue;
|
|
1263
|
-
const
|
|
1264
|
-
left:
|
|
1265
|
-
top:
|
|
1266
|
-
height:
|
|
1267
|
-
width:
|
|
1268
|
-
zIndex:
|
|
1269
|
-
cellHeight:
|
|
1270
|
-
cellWidth:
|
|
1271
|
-
filterParams: { unitId: n, subUnitId: i, col:
|
|
1272
|
-
},
|
|
1273
|
-
this._filterButtonShapes.push(
|
|
1428
|
+
const R = !!s.getFilterColumn(d), w = N - W - Ie, X = E - W - Ie, se = {
|
|
1429
|
+
left: w,
|
|
1430
|
+
top: X,
|
|
1431
|
+
height: W,
|
|
1432
|
+
width: W,
|
|
1433
|
+
zIndex: Fi,
|
|
1434
|
+
cellHeight: F,
|
|
1435
|
+
cellWidth: b,
|
|
1436
|
+
filterParams: { unitId: n, subUnitId: i, col: d, hasCriteria: R }
|
|
1437
|
+
}, ne = this._injector.createInstance(Je, C, se);
|
|
1438
|
+
this._filterButtonShapes.push(ne);
|
|
1274
1439
|
}
|
|
1275
1440
|
o.addObjects(this._filterButtonShapes), o.makeDirty();
|
|
1276
1441
|
}
|
|
1277
1442
|
_interceptCellContent(e, r, s) {
|
|
1278
|
-
const { startRow: n, startColumn:
|
|
1279
|
-
this._buttonRenderDisposable = this._sheetInterceptorService.intercept(
|
|
1280
|
-
effect:
|
|
1281
|
-
handler: (o,
|
|
1282
|
-
const { row: h, col:
|
|
1283
|
-
return
|
|
1443
|
+
const { startRow: n, startColumn: a, endColumn: i } = s;
|
|
1444
|
+
this._buttonRenderDisposable = this._sheetInterceptorService.intercept(Yr.CELL_CONTENT, {
|
|
1445
|
+
effect: cr.Style,
|
|
1446
|
+
handler: (o, l, c) => {
|
|
1447
|
+
const { row: h, col: d, unitId: C, subUnitId: v } = l;
|
|
1448
|
+
return C !== e || v !== r || h !== n || d < a || d > i || ((!o || o === l.rawData) && (o = { ...l.rawData }), o.fontRenderExtension = {
|
|
1284
1449
|
...o == null ? void 0 : o.fontRenderExtension,
|
|
1285
|
-
rightOffset:
|
|
1450
|
+
rightOffset: W
|
|
1286
1451
|
}), c(o);
|
|
1287
1452
|
},
|
|
1288
1453
|
priority: 10
|
|
@@ -1293,185 +1458,325 @@ let Ve = class extends Et {
|
|
|
1293
1458
|
(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 = [];
|
|
1294
1459
|
}
|
|
1295
1460
|
};
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
],
|
|
1305
|
-
var
|
|
1306
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
1307
|
-
(i = t[
|
|
1461
|
+
et = Ei([
|
|
1462
|
+
ee(1, T(re)),
|
|
1463
|
+
ee(2, T(Cr)),
|
|
1464
|
+
ee(3, T(q)),
|
|
1465
|
+
ee(4, T(Pt)),
|
|
1466
|
+
ee(5, T(jr)),
|
|
1467
|
+
ee(6, j),
|
|
1468
|
+
ee(7, Tr)
|
|
1469
|
+
], et);
|
|
1470
|
+
var yi = Object.getOwnPropertyDescriptor, Oi = (t, e, r, s) => {
|
|
1471
|
+
for (var n = s > 1 ? void 0 : s ? yi(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
1472
|
+
(i = t[a]) && (n = i(n) || n);
|
|
1308
1473
|
return n;
|
|
1309
|
-
},
|
|
1310
|
-
let
|
|
1474
|
+
}, Nt = (t, e) => (r, s) => e(r, s, t);
|
|
1475
|
+
let Te = class extends wt {
|
|
1311
1476
|
constructor(t, e) {
|
|
1312
1477
|
super(), this._renderManagerService = t, this._sheetsRenderService = e, [
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1478
|
+
mr,
|
|
1479
|
+
fr,
|
|
1480
|
+
pr,
|
|
1481
|
+
vr
|
|
1317
1482
|
].forEach((r) => this.disposeWithMe(this._sheetsRenderService.registerSkeletonChangingMutations(r.id))), this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
1318
|
-
|
|
1319
|
-
[
|
|
1483
|
+
ie.UNIVER_SHEET,
|
|
1484
|
+
[et]
|
|
1320
1485
|
));
|
|
1321
1486
|
}
|
|
1322
1487
|
};
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
],
|
|
1327
|
-
var
|
|
1328
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
1329
|
-
(i = t[
|
|
1488
|
+
Te = Oi([
|
|
1489
|
+
Nt(0, kt),
|
|
1490
|
+
Nt(1, T(Ut))
|
|
1491
|
+
], Te);
|
|
1492
|
+
var Ii = Object.defineProperty, bi = Object.getOwnPropertyDescriptor, Ri = (t, e, r) => e in t ? Ii(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Ai = (t, e, r, s) => {
|
|
1493
|
+
for (var n = s > 1 ? void 0 : s ? bi(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
1494
|
+
(i = t[a]) && (n = i(n) || n);
|
|
1330
1495
|
return n;
|
|
1331
|
-
},
|
|
1332
|
-
const
|
|
1333
|
-
let
|
|
1334
|
-
constructor(t =
|
|
1496
|
+
}, Ft = (t, e) => (r, s) => e(r, s, t), Zt = (t, e, r) => Ri(t, typeof e != "symbol" ? e + "" : e, r);
|
|
1497
|
+
const Pi = "SHEET_FILTER_UI_PLUGIN";
|
|
1498
|
+
let Ue = class extends tt {
|
|
1499
|
+
constructor(t = xe, e, r) {
|
|
1335
1500
|
super(), this._config = t, this._injector = e, this._configService = r;
|
|
1336
|
-
const { menu: s, ...n } =
|
|
1501
|
+
const { menu: s, ...n } = Mt(
|
|
1337
1502
|
{},
|
|
1338
|
-
|
|
1503
|
+
xe,
|
|
1339
1504
|
this._config
|
|
1340
1505
|
);
|
|
1341
|
-
s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(
|
|
1506
|
+
s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(Yt, n);
|
|
1342
1507
|
}
|
|
1343
1508
|
onStarting() {
|
|
1344
1509
|
[
|
|
1345
|
-
[
|
|
1346
|
-
[
|
|
1510
|
+
[he],
|
|
1511
|
+
[Te]
|
|
1347
1512
|
].forEach((t) => this._injector.add(t));
|
|
1348
1513
|
}
|
|
1349
1514
|
onReady() {
|
|
1350
|
-
this._injector.get(
|
|
1515
|
+
this._injector.get(he);
|
|
1351
1516
|
}
|
|
1352
1517
|
onRendered() {
|
|
1353
|
-
this._injector.get(
|
|
1518
|
+
this._injector.get(Te);
|
|
1354
1519
|
}
|
|
1355
1520
|
};
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
],
|
|
1363
|
-
var
|
|
1364
|
-
return
|
|
1521
|
+
Zt(Ue, "type", ie.UNIVER_SHEET);
|
|
1522
|
+
Zt(Ue, "pluginName", Pi);
|
|
1523
|
+
Ue = Ai([
|
|
1524
|
+
Lt(xt),
|
|
1525
|
+
Ft(1, T(re)),
|
|
1526
|
+
Ft(2, $t)
|
|
1527
|
+
], Ue);
|
|
1528
|
+
var M = function() {
|
|
1529
|
+
return M = Object.assign || function(t) {
|
|
1365
1530
|
for (var e, r = 1, s = arguments.length; r < s; r++) {
|
|
1366
1531
|
e = arguments[r];
|
|
1367
1532
|
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]);
|
|
1368
1533
|
}
|
|
1369
1534
|
return t;
|
|
1370
|
-
},
|
|
1371
|
-
},
|
|
1535
|
+
}, M.apply(this, arguments);
|
|
1536
|
+
}, wi = function(t, e) {
|
|
1372
1537
|
var r = {};
|
|
1373
1538
|
for (var s in t) Object.prototype.hasOwnProperty.call(t, s) && e.indexOf(s) < 0 && (r[s] = t[s]);
|
|
1374
1539
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
1375
1540
|
for (var n = 0, s = Object.getOwnPropertySymbols(t); n < s.length; n++)
|
|
1376
1541
|
e.indexOf(s[n]) < 0 && Object.prototype.propertyIsEnumerable.call(t, s[n]) && (r[s[n]] = t[s[n]]);
|
|
1377
1542
|
return r;
|
|
1378
|
-
},
|
|
1379
|
-
var r = t.icon, s = t.id, n = t.className,
|
|
1380
|
-
return
|
|
1543
|
+
}, ye = Ne(function(t, e) {
|
|
1544
|
+
var r = t.icon, s = t.id, n = t.className, a = t.extend, i = wi(t, ["icon", "id", "className", "extend"]), o = "univerjs-icon univerjs-icon-".concat(s, " ").concat(n || "").trim(), l = ci("_".concat(Mi()));
|
|
1545
|
+
return Kt(r, "".concat(s), { defIds: r.defIds, idSuffix: l.current }, M({ ref: e, className: o }, i), a);
|
|
1381
1546
|
});
|
|
1382
|
-
function
|
|
1383
|
-
return
|
|
1384
|
-
return
|
|
1547
|
+
function Kt(t, e, r, s, n) {
|
|
1548
|
+
return Fe(t.tag, M(M({ key: e }, Li(t, r, n)), s), ($i(t, r).children || []).map(function(a, i) {
|
|
1549
|
+
return Kt(a, "".concat(e, "-").concat(t.tag, "-").concat(i), r, void 0, n);
|
|
1385
1550
|
}));
|
|
1386
1551
|
}
|
|
1387
|
-
function
|
|
1388
|
-
var s =
|
|
1389
|
-
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(
|
|
1390
|
-
var i =
|
|
1552
|
+
function Li(t, e, r) {
|
|
1553
|
+
var s = M({}, t.attrs);
|
|
1554
|
+
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(a) {
|
|
1555
|
+
var i = a[0], o = a[1];
|
|
1391
1556
|
i === "mask" && typeof o == "string" && (s[i] = o.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
1392
1557
|
});
|
|
1393
1558
|
var n = e.defIds;
|
|
1394
|
-
return !n || n.length === 0 || (t.tag === "use" && s["xlink:href"] && (s["xlink:href"] = s["xlink:href"] + e.idSuffix), Object.entries(s).forEach(function(
|
|
1395
|
-
var i =
|
|
1559
|
+
return !n || n.length === 0 || (t.tag === "use" && s["xlink:href"] && (s["xlink:href"] = s["xlink:href"] + e.idSuffix), Object.entries(s).forEach(function(a) {
|
|
1560
|
+
var i = a[0], o = a[1];
|
|
1396
1561
|
typeof o == "string" && (s[i] = o.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
1397
1562
|
})), s;
|
|
1398
1563
|
}
|
|
1399
|
-
function
|
|
1564
|
+
function $i(t, e) {
|
|
1400
1565
|
var r, s = e.defIds;
|
|
1401
|
-
return !s || s.length === 0 ? t : t.tag === "defs" && (!((r = t.children) === null || r === void 0) && r.length) ?
|
|
1402
|
-
return typeof n.attrs.id == "string" && s && s.includes(n.attrs.id) ?
|
|
1566
|
+
return !s || s.length === 0 ? t : t.tag === "defs" && (!((r = t.children) === null || r === void 0) && r.length) ? M(M({}, t), { children: t.children.map(function(n) {
|
|
1567
|
+
return typeof n.attrs.id == "string" && s && s.includes(n.attrs.id) ? M(M({}, n), { attrs: M(M({}, n.attrs), { id: n.attrs.id + e.idSuffix }) }) : n;
|
|
1403
1568
|
}) }) : t;
|
|
1404
1569
|
}
|
|
1405
|
-
function
|
|
1570
|
+
function Mi() {
|
|
1406
1571
|
return Math.random().toString(36).substring(2, 8);
|
|
1407
1572
|
}
|
|
1408
|
-
|
|
1409
|
-
var
|
|
1410
|
-
return
|
|
1573
|
+
ye.displayName = "UniverIcon";
|
|
1574
|
+
var xi = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 20 20", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M10 1.05957C10.356 1.05957 10.6816 1.26162 10.8408 1.58008L18.8408 17.5801L18.8799 17.668C19.0486 18.1134 18.8551 18.6232 18.4199 18.8408C17.9557 19.0727 17.3913 18.8841 17.1592 18.4199L10 4.10156L2.84082 18.4199C2.60871 18.8841 2.04434 19.0727 1.58008 18.8408C1.11587 18.6087 0.92731 18.0443 1.15918 17.5801L9.15918 1.58008C9.31841 1.26162 9.64395 1.05957 10 1.05957Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M15.3337 11.7261L15.4294 11.731C15.9035 11.779 16.2732 12.1798 16.2732 12.6665C16.2732 13.1532 15.9035 13.554 15.4294 13.602L15.3337 13.6069H4.66675C4.1476 13.6069 3.72632 13.1856 3.72632 12.6665C3.72632 12.1474 4.1476 11.7261 4.66675 11.7261H15.3337Z" } }] }, qt = Ne(function(t, e) {
|
|
1575
|
+
return Fe(ye, Object.assign({}, t, {
|
|
1576
|
+
id: "a-icon",
|
|
1577
|
+
ref: e,
|
|
1578
|
+
icon: xi
|
|
1579
|
+
}));
|
|
1580
|
+
});
|
|
1581
|
+
qt.displayName = "AIcon";
|
|
1582
|
+
var Ui = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 20 20", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M17.0596 10C17.0596 6.10087 13.8992 2.94043 10 2.94043C6.10087 2.94043 2.94043 6.10087 2.94043 10C2.94043 13.8992 6.10087 17.0596 10 17.0596C13.8992 17.0596 17.0596 13.8992 17.0596 10ZM18.9404 10C18.9404 14.9374 14.9374 18.9404 10 18.9404C5.06257 18.9404 1.05957 14.9374 1.05957 10C1.05957 5.06257 5.06257 1.05957 10 1.05957C14.9374 1.05957 18.9404 5.06257 18.9404 10Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.29492 4.13476C4.63911 3.79057 5.1845 3.76906 5.55371 4.07031L5.625 4.13476L16.0244 14.5352L16.0889 14.6064C16.3902 14.9757 16.3686 15.52 16.0244 15.8643C15.6573 16.2313 15.0624 16.2313 14.6953 15.8643L4.29492 5.46484L4.23047 5.39355C3.92922 5.02434 3.95073 4.47895 4.29492 4.13476Z" } }] }, Xt = Ne(function(t, e) {
|
|
1583
|
+
return Fe(ye, Object.assign({}, t, {
|
|
1584
|
+
id: "ban-icon",
|
|
1585
|
+
ref: e,
|
|
1586
|
+
icon: Ui
|
|
1587
|
+
}));
|
|
1588
|
+
});
|
|
1589
|
+
Xt.displayName = "BanIcon";
|
|
1590
|
+
var ki = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", 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" } }] }, zt = Ne(function(t, e) {
|
|
1591
|
+
return Fe(ye, Object.assign({}, t, {
|
|
1411
1592
|
id: "filter-icon",
|
|
1412
1593
|
ref: e,
|
|
1413
|
-
icon:
|
|
1594
|
+
icon: ki
|
|
1595
|
+
}));
|
|
1596
|
+
});
|
|
1597
|
+
zt.displayName = "FilterIcon";
|
|
1598
|
+
var Hi = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM11.7245 6.42417C11.9588 6.18985 11.9588 5.80995 11.7245 5.57564C11.4901 5.34132 11.1102 5.34132 10.8759 5.57564L7.3002 9.15137L5.72446 7.57564C5.49014 7.34132 5.11025 7.34132 4.87593 7.57564C4.64162 7.80995 4.64162 8.18985 4.87593 8.42417L6.87593 10.4242C7.11025 10.6585 7.49014 10.6585 7.72446 10.4242L11.7245 6.42417Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Jt = Ne(function(t, e) {
|
|
1599
|
+
return Fe(ye, Object.assign({}, t, {
|
|
1600
|
+
id: "success-icon",
|
|
1601
|
+
ref: e,
|
|
1602
|
+
icon: Hi
|
|
1414
1603
|
}));
|
|
1415
1604
|
});
|
|
1416
|
-
|
|
1417
|
-
function
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1605
|
+
Jt.displayName = "SuccessIcon";
|
|
1606
|
+
function Di(t) {
|
|
1607
|
+
const { model: e } = t, r = te(K), s = H(e.cellFillColors$, [], !0), n = H(e.cellTextColors$, [], !0), a = U((o) => {
|
|
1608
|
+
e.onFilterCheckToggled(o);
|
|
1609
|
+
}, [e]), i = U((o) => {
|
|
1610
|
+
e.onFilterCheckToggled(o, !1);
|
|
1611
|
+
}, [e]);
|
|
1612
|
+
return /* @__PURE__ */ f(
|
|
1613
|
+
"div",
|
|
1614
|
+
{
|
|
1615
|
+
"data-u-comp": "sheets-filter-panel-colors-container",
|
|
1616
|
+
className: "univer-flex univer-h-full univer-min-h-[300px] univer-flex-col",
|
|
1617
|
+
children: /* @__PURE__ */ I(
|
|
1618
|
+
"div",
|
|
1619
|
+
{
|
|
1620
|
+
"data-u-comp": "sheets-filter-panel",
|
|
1621
|
+
className: Ae("univer-mt-2 univer-box-border univer-flex univer-h-[300px] univer-flex-grow univer-flex-col univer-gap-4 univer-overflow-auto univer-rounded-md univer-px-2 univer-py-2.5", lt),
|
|
1622
|
+
children: [
|
|
1623
|
+
s.length > 1 && /* @__PURE__ */ I("div", { children: [
|
|
1624
|
+
/* @__PURE__ */ f(
|
|
1625
|
+
"div",
|
|
1626
|
+
{
|
|
1627
|
+
className: "univer-mb-2 univer-text-sm univer-text-gray-900 dark:!univer-text-white",
|
|
1628
|
+
children: r.t("sheets-filter.panel.filter-by-cell-fill-color")
|
|
1629
|
+
}
|
|
1630
|
+
),
|
|
1631
|
+
/* @__PURE__ */ f(
|
|
1632
|
+
"div",
|
|
1633
|
+
{
|
|
1634
|
+
className: "univer-grid univer-grid-cols-8 univer-items-center univer-justify-start univer-gap-2",
|
|
1635
|
+
children: s.map((o, l) => /* @__PURE__ */ I(
|
|
1636
|
+
"div",
|
|
1637
|
+
{
|
|
1638
|
+
className: "univer-relative univer-h-6 univer-w-6",
|
|
1639
|
+
onClick: () => a(o),
|
|
1640
|
+
children: [
|
|
1641
|
+
o.color ? /* @__PURE__ */ f(
|
|
1642
|
+
"button",
|
|
1643
|
+
{
|
|
1644
|
+
type: "button",
|
|
1645
|
+
className: Ae("univer-box-border univer-h-6 univer-w-6 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow hover:univer-ring-2 hover:univer-ring-offset-2 hover:univer-ring-offset-white"),
|
|
1646
|
+
style: { backgroundColor: o.color }
|
|
1647
|
+
}
|
|
1648
|
+
) : /* @__PURE__ */ f(
|
|
1649
|
+
Xt,
|
|
1650
|
+
{
|
|
1651
|
+
className: "univer-h-6 univer-w-6 univer-cursor-pointer univer-rounded-full hover:univer-ring-2 hover:univer-ring-offset-2 hover:univer-ring-offset-white"
|
|
1652
|
+
}
|
|
1653
|
+
),
|
|
1654
|
+
o.checked && /* @__PURE__ */ f(yt, {})
|
|
1655
|
+
]
|
|
1656
|
+
},
|
|
1657
|
+
`sheets-filter-cell-fill-color-${l}`
|
|
1658
|
+
))
|
|
1659
|
+
}
|
|
1660
|
+
)
|
|
1661
|
+
] }),
|
|
1662
|
+
n.length > 1 && /* @__PURE__ */ I("div", { children: [
|
|
1663
|
+
/* @__PURE__ */ f(
|
|
1664
|
+
"div",
|
|
1665
|
+
{
|
|
1666
|
+
className: "univer-mb-2 univer-text-sm univer-text-gray-900 dark:!univer-text-white",
|
|
1667
|
+
children: r.t("sheets-filter.panel.filter-by-cell-text-color")
|
|
1668
|
+
}
|
|
1669
|
+
),
|
|
1670
|
+
/* @__PURE__ */ f(
|
|
1671
|
+
"div",
|
|
1672
|
+
{
|
|
1673
|
+
className: "univer-grid univer-grid-cols-8 univer-items-center univer-justify-start univer-gap-2",
|
|
1674
|
+
children: n.map((o, l) => /* @__PURE__ */ I(
|
|
1675
|
+
"div",
|
|
1676
|
+
{
|
|
1677
|
+
className: "univer-relative univer-h-6 univer-w-6",
|
|
1678
|
+
onClick: () => i(o),
|
|
1679
|
+
children: [
|
|
1680
|
+
/* @__PURE__ */ f(
|
|
1681
|
+
"div",
|
|
1682
|
+
{
|
|
1683
|
+
className: "univer-box-border univer-flex univer-h-full univer-w-full univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-full univer-border univer-border-solid univer-border-[rgba(13,13,13,0.06)] univer-p-0.5 hover:univer-ring-2 hover:univer-ring-offset-2 hover:univer-ring-offset-white dark:!univer-border-[rgba(255,255,255,0.06)]",
|
|
1684
|
+
children: /* @__PURE__ */ f(qt, { style: { color: o.color } })
|
|
1685
|
+
}
|
|
1686
|
+
),
|
|
1687
|
+
o.checked && /* @__PURE__ */ f(yt, {})
|
|
1688
|
+
]
|
|
1689
|
+
},
|
|
1690
|
+
`sheets-filter-cell-text-color-${l}`
|
|
1691
|
+
))
|
|
1692
|
+
}
|
|
1693
|
+
)
|
|
1694
|
+
] }),
|
|
1695
|
+
s.length <= 1 && n.length <= 1 && /* @__PURE__ */ f(
|
|
1696
|
+
"div",
|
|
1697
|
+
{
|
|
1698
|
+
className: "univer-flex univer-h-full univer-w-full univer-items-center univer-justify-center univer-text-sm univer-text-gray-900",
|
|
1699
|
+
children: r.t("sheets-filter.panel.filter-by-color-none")
|
|
1700
|
+
}
|
|
1701
|
+
)
|
|
1702
|
+
]
|
|
1703
|
+
}
|
|
1704
|
+
)
|
|
1705
|
+
}
|
|
1706
|
+
);
|
|
1707
|
+
}
|
|
1708
|
+
function yt() {
|
|
1709
|
+
return /* @__PURE__ */ f(
|
|
1710
|
+
"div",
|
|
1711
|
+
{
|
|
1712
|
+
className: "univer-absolute -univer-bottom-0.5 -univer-right-0.5 univer-flex univer-h-3 univer-w-3 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-full univer-bg-white",
|
|
1713
|
+
children: /* @__PURE__ */ f(
|
|
1714
|
+
Jt,
|
|
1715
|
+
{
|
|
1716
|
+
className: "univer-h-full univer-w-full univer-font-bold univer-text-[#418F1F]"
|
|
1717
|
+
}
|
|
1718
|
+
)
|
|
1719
|
+
}
|
|
1720
|
+
);
|
|
1721
|
+
}
|
|
1722
|
+
function Bi(t) {
|
|
1723
|
+
var v, _;
|
|
1724
|
+
const { model: e } = t, r = te(K), s = H(e.conditionItem$, void 0), n = H(e.filterConditionFormParams$, void 0), a = n != null && n.and ? "AND" : "OR", i = U((S) => {
|
|
1725
|
+
e.onConditionFormChange({ and: S === "AND" });
|
|
1726
|
+
}, [e]), o = Wi(r), l = U((S) => {
|
|
1727
|
+
e.onPrimaryConditionChange(S);
|
|
1728
|
+
}, [e]), c = Qi(r), h = U((S) => {
|
|
1729
|
+
e.onConditionFormChange(S);
|
|
1730
|
+
}, [e]), d = r.t("sheets-filter.panel.input-values-placeholder");
|
|
1731
|
+
function C(S, N, E) {
|
|
1732
|
+
const b = m.getItemByOperator(S).numOfParameters === 1;
|
|
1733
|
+
return /* @__PURE__ */ I(Ct, { children: [
|
|
1734
|
+
E === "operator2" && /* @__PURE__ */ I(si, { value: a, onChange: i, children: [
|
|
1735
|
+
/* @__PURE__ */ f(St, { value: "AND", children: r.t("sheets-filter.panel.and") }),
|
|
1736
|
+
/* @__PURE__ */ f(St, { value: "OR", children: r.t("sheets-filter.panel.or") })
|
|
1432
1737
|
] }),
|
|
1433
|
-
/* @__PURE__ */
|
|
1434
|
-
|
|
1738
|
+
/* @__PURE__ */ f(
|
|
1739
|
+
gt,
|
|
1435
1740
|
{
|
|
1436
|
-
value:
|
|
1741
|
+
value: S,
|
|
1437
1742
|
options: c,
|
|
1438
|
-
onChange: (
|
|
1743
|
+
onChange: (F) => h({ [E]: F })
|
|
1439
1744
|
}
|
|
1440
1745
|
),
|
|
1441
|
-
|
|
1442
|
-
|
|
1746
|
+
b && /* @__PURE__ */ f("div", { children: /* @__PURE__ */ f(
|
|
1747
|
+
Wt,
|
|
1443
1748
|
{
|
|
1444
1749
|
className: "univer-mt-2",
|
|
1445
|
-
value:
|
|
1446
|
-
placeholder:
|
|
1447
|
-
onChange: (
|
|
1750
|
+
value: N,
|
|
1751
|
+
placeholder: d,
|
|
1752
|
+
onChange: (F) => h({ [E === "operator1" ? "val1" : "val2"]: F })
|
|
1448
1753
|
}
|
|
1449
1754
|
) })
|
|
1450
1755
|
] });
|
|
1451
1756
|
}
|
|
1452
|
-
return /* @__PURE__ */
|
|
1757
|
+
return /* @__PURE__ */ f(
|
|
1453
1758
|
"div",
|
|
1454
1759
|
{
|
|
1455
1760
|
"data-u-comp": "sheets-filter-panel-conditions-container",
|
|
1456
1761
|
className: "univer-flex univer-h-full univer-min-h-[300px] univer-flex-col",
|
|
1457
|
-
children: s && n && /* @__PURE__ */
|
|
1458
|
-
/* @__PURE__ */
|
|
1459
|
-
|
|
1762
|
+
children: s && n && /* @__PURE__ */ I(Ct, { children: [
|
|
1763
|
+
/* @__PURE__ */ f(gt, { value: s.operator, options: o, onChange: l }),
|
|
1764
|
+
m.getItemByOperator(s.operator).numOfParameters !== 0 ? /* @__PURE__ */ I(
|
|
1460
1765
|
"div",
|
|
1461
1766
|
{
|
|
1462
1767
|
"data-u-comp": "sheets-filter-panel-conditions-container-inner",
|
|
1463
|
-
className:
|
|
1768
|
+
className: Ae("univer-mt-2 univer-flex-grow univer-overflow-hidden univer-rounded-md univer-p-2", lt),
|
|
1464
1769
|
children: [
|
|
1465
|
-
s.numOfParameters >= 1 &&
|
|
1466
|
-
s.numOfParameters >= 2 &&
|
|
1467
|
-
/* @__PURE__ */
|
|
1770
|
+
s.numOfParameters >= 1 && C(n.operator1, (v = n.val1) != null ? v : "", "operator1"),
|
|
1771
|
+
s.numOfParameters >= 2 && C(n.operator2, (_ = n.val2) != null ? _ : "", "operator2"),
|
|
1772
|
+
/* @__PURE__ */ I(
|
|
1468
1773
|
"div",
|
|
1469
1774
|
{
|
|
1470
1775
|
"data-u-comp": "sheets-filter-panel-conditions-desc",
|
|
1471
1776
|
className: "univer-mt-2 univer-text-xs univer-text-gray-500",
|
|
1472
1777
|
children: [
|
|
1473
1778
|
r.t("sheets-filter.panel.?"),
|
|
1474
|
-
/* @__PURE__ */
|
|
1779
|
+
/* @__PURE__ */ f("br", {}),
|
|
1475
1780
|
r.t("sheets-filter.panel.*")
|
|
1476
1781
|
]
|
|
1477
1782
|
}
|
|
@@ -1483,106 +1788,106 @@ function Ri(t) {
|
|
|
1483
1788
|
}
|
|
1484
1789
|
);
|
|
1485
1790
|
}
|
|
1486
|
-
function
|
|
1791
|
+
function Wi(t) {
|
|
1487
1792
|
const e = t.getCurrentLocale();
|
|
1488
|
-
return
|
|
1793
|
+
return at(() => [
|
|
1489
1794
|
{
|
|
1490
1795
|
options: [
|
|
1491
|
-
{ label: t.t(
|
|
1796
|
+
{ label: t.t(m.NONE.label), value: m.NONE.operator }
|
|
1492
1797
|
]
|
|
1493
1798
|
},
|
|
1494
1799
|
{
|
|
1495
1800
|
options: [
|
|
1496
|
-
{ label: t.t(
|
|
1497
|
-
{ label: t.t(
|
|
1801
|
+
{ label: t.t(m.EMPTY.label), value: m.EMPTY.operator },
|
|
1802
|
+
{ label: t.t(m.NOT_EMPTY.label), value: m.NOT_EMPTY.operator }
|
|
1498
1803
|
]
|
|
1499
1804
|
},
|
|
1500
1805
|
{
|
|
1501
1806
|
options: [
|
|
1502
|
-
{ label: t.t(
|
|
1503
|
-
{ label: t.t(
|
|
1504
|
-
{ label: t.t(
|
|
1505
|
-
{ label: t.t(
|
|
1506
|
-
{ label: t.t(
|
|
1807
|
+
{ label: t.t(m.TEXT_CONTAINS.label), value: m.TEXT_CONTAINS.operator },
|
|
1808
|
+
{ label: t.t(m.DOES_NOT_CONTAIN.label), value: m.DOES_NOT_CONTAIN.operator },
|
|
1809
|
+
{ label: t.t(m.STARTS_WITH.label), value: m.STARTS_WITH.operator },
|
|
1810
|
+
{ label: t.t(m.ENDS_WITH.label), value: m.ENDS_WITH.operator },
|
|
1811
|
+
{ label: t.t(m.EQUALS.label), value: m.EQUALS.operator }
|
|
1507
1812
|
]
|
|
1508
1813
|
},
|
|
1509
1814
|
{
|
|
1510
1815
|
options: [
|
|
1511
|
-
{ label: t.t(
|
|
1512
|
-
{ label: t.t(
|
|
1513
|
-
{ label: t.t(
|
|
1514
|
-
{ label: t.t(
|
|
1515
|
-
{ label: t.t(
|
|
1516
|
-
{ label: t.t(
|
|
1517
|
-
{ label: t.t(
|
|
1518
|
-
{ label: t.t(
|
|
1816
|
+
{ label: t.t(m.GREATER_THAN.label), value: m.GREATER_THAN.operator },
|
|
1817
|
+
{ label: t.t(m.GREATER_THAN_OR_EQUAL.label), value: m.GREATER_THAN_OR_EQUAL.operator },
|
|
1818
|
+
{ label: t.t(m.LESS_THAN.label), value: m.LESS_THAN.operator },
|
|
1819
|
+
{ label: t.t(m.LESS_THAN_OR_EQUAL.label), value: m.LESS_THAN_OR_EQUAL.operator },
|
|
1820
|
+
{ label: t.t(m.EQUAL.label), value: m.EQUAL.operator },
|
|
1821
|
+
{ label: t.t(m.NOT_EQUAL.label), value: m.NOT_EQUAL.operator },
|
|
1822
|
+
{ label: t.t(m.BETWEEN.label), value: m.BETWEEN.operator },
|
|
1823
|
+
{ label: t.t(m.NOT_BETWEEN.label), value: m.NOT_BETWEEN.operator }
|
|
1519
1824
|
]
|
|
1520
1825
|
},
|
|
1521
1826
|
{
|
|
1522
1827
|
options: [
|
|
1523
|
-
{ label: t.t(
|
|
1828
|
+
{ label: t.t(m.CUSTOM.label), value: m.CUSTOM.operator }
|
|
1524
1829
|
]
|
|
1525
1830
|
}
|
|
1526
1831
|
], [e, t]);
|
|
1527
1832
|
}
|
|
1528
|
-
function
|
|
1833
|
+
function Qi(t) {
|
|
1529
1834
|
const e = t.getCurrentLocale();
|
|
1530
|
-
return
|
|
1835
|
+
return at(() => m.ALL_CONDITIONS.filter((r) => r.numOfParameters !== 2).map((r) => ({ label: t.t(r.label), value: r.operator })), [e, t]);
|
|
1531
1836
|
}
|
|
1532
|
-
function
|
|
1533
|
-
const { model: e } = t, r = te(K), s =
|
|
1837
|
+
function Vi(t) {
|
|
1838
|
+
const { model: e } = t, r = te(K), s = H(e.searchString$, "", !0), n = H(e.filterItems$, void 0, !0), a = r.t("sheets-filter.panel.filter-only"), i = qe(n), o = i.checked > 0 && i.unchecked === 0, l = i.checked > 0 && i.unchecked > 0, c = e.treeMapCache, h = U(() => {
|
|
1534
1839
|
e.onCheckAllToggled(!o);
|
|
1535
|
-
}, [e, o]),
|
|
1536
|
-
e.setSearchString(
|
|
1840
|
+
}, [e, o]), d = U((v) => {
|
|
1841
|
+
e.setSearchString(v);
|
|
1537
1842
|
}, [e]);
|
|
1538
|
-
function
|
|
1539
|
-
let
|
|
1540
|
-
return
|
|
1541
|
-
|
|
1542
|
-
}),
|
|
1843
|
+
function C(v) {
|
|
1844
|
+
let _ = [];
|
|
1845
|
+
return v.forEach((S) => {
|
|
1846
|
+
S.checked && _.push(S.key), S.children && (_ = _.concat(C(S.children)));
|
|
1847
|
+
}), _;
|
|
1543
1848
|
}
|
|
1544
|
-
return /* @__PURE__ */
|
|
1849
|
+
return /* @__PURE__ */ I(
|
|
1545
1850
|
"div",
|
|
1546
1851
|
{
|
|
1547
1852
|
"data-u-comp": "sheets-filter-panel-values-container",
|
|
1548
1853
|
className: "univer-flex univer-h-full univer-min-h-[300px] univer-flex-col",
|
|
1549
1854
|
children: [
|
|
1550
|
-
/* @__PURE__ */
|
|
1551
|
-
|
|
1855
|
+
/* @__PURE__ */ f(
|
|
1856
|
+
Wt,
|
|
1552
1857
|
{
|
|
1553
1858
|
autoFocus: !0,
|
|
1554
1859
|
value: s,
|
|
1555
1860
|
placeholder: r.t("sheets-filter.panel.search-placeholder"),
|
|
1556
|
-
onChange:
|
|
1861
|
+
onChange: d
|
|
1557
1862
|
}
|
|
1558
1863
|
),
|
|
1559
|
-
/* @__PURE__ */
|
|
1864
|
+
/* @__PURE__ */ I(
|
|
1560
1865
|
"div",
|
|
1561
1866
|
{
|
|
1562
1867
|
"data-u-comp": "sheets-filter-panel",
|
|
1563
|
-
className:
|
|
1868
|
+
className: Ae("univer-mt-2 univer-box-border univer-flex univer-flex-grow univer-flex-col univer-overflow-hidden univer-rounded-md univer-px-2 univer-py-2.5", lt),
|
|
1564
1869
|
children: [
|
|
1565
|
-
/* @__PURE__ */
|
|
1870
|
+
/* @__PURE__ */ f(
|
|
1566
1871
|
"div",
|
|
1567
1872
|
{
|
|
1568
1873
|
"data-u-comp": "sheets-filter-panel-values-item",
|
|
1569
1874
|
className: "univer-box-border univer-h-8 univer-w-full univer-py-0.5",
|
|
1570
|
-
children: /* @__PURE__ */
|
|
1875
|
+
children: /* @__PURE__ */ I(
|
|
1571
1876
|
"div",
|
|
1572
1877
|
{
|
|
1573
1878
|
"data-u-comp": "sheets-filter-panel-values-item-inner",
|
|
1574
1879
|
className: "univer-box-border univer-flex univer-h-7 univer-items-center univer-rounded-md univer-pb-0 univer-pl-5 univer-pr-0.5 univer-pt-0 univer-text-sm",
|
|
1575
1880
|
children: [
|
|
1576
|
-
/* @__PURE__ */
|
|
1577
|
-
|
|
1881
|
+
/* @__PURE__ */ f(
|
|
1882
|
+
ni,
|
|
1578
1883
|
{
|
|
1579
|
-
indeterminate:
|
|
1884
|
+
indeterminate: l,
|
|
1580
1885
|
disabled: n.length === 0,
|
|
1581
1886
|
checked: o,
|
|
1582
1887
|
onChange: h
|
|
1583
1888
|
}
|
|
1584
1889
|
),
|
|
1585
|
-
/* @__PURE__ */
|
|
1890
|
+
/* @__PURE__ */ f(
|
|
1586
1891
|
"span",
|
|
1587
1892
|
{
|
|
1588
1893
|
"data-u-comp": "sheets-filter-panel-values-item-text",
|
|
@@ -1590,7 +1895,7 @@ function Pi(t) {
|
|
|
1590
1895
|
children: `${r.t("sheets-filter.panel.select-all")}`
|
|
1591
1896
|
}
|
|
1592
1897
|
),
|
|
1593
|
-
/* @__PURE__ */
|
|
1898
|
+
/* @__PURE__ */ f(
|
|
1594
1899
|
"span",
|
|
1595
1900
|
{
|
|
1596
1901
|
"data-u-comp": "sheets-filter-panel-values-item-count",
|
|
@@ -1603,14 +1908,14 @@ function Pi(t) {
|
|
|
1603
1908
|
)
|
|
1604
1909
|
}
|
|
1605
1910
|
),
|
|
1606
|
-
/* @__PURE__ */
|
|
1607
|
-
|
|
1911
|
+
/* @__PURE__ */ f("div", { "data-u-comp": "sheets-filter-panel-values-virtual", className: "univer-flex-grow", children: /* @__PURE__ */ f(
|
|
1912
|
+
oi,
|
|
1608
1913
|
{
|
|
1609
1914
|
data: n,
|
|
1610
1915
|
defaultExpandAll: !1,
|
|
1611
|
-
valueGroup:
|
|
1612
|
-
onChange: (
|
|
1613
|
-
e.onFilterCheckToggled(
|
|
1916
|
+
valueGroup: C(n),
|
|
1917
|
+
onChange: (v) => {
|
|
1918
|
+
e.onFilterCheckToggled(v);
|
|
1614
1919
|
},
|
|
1615
1920
|
defaultCache: c,
|
|
1616
1921
|
itemHeight: 28,
|
|
@@ -1621,32 +1926,32 @@ function Pi(t) {
|
|
|
1621
1926
|
univer-text-gray-900 dark:hover:!univer-bg-gray-900
|
|
1622
1927
|
dark:!univer-text-white
|
|
1623
1928
|
`,
|
|
1624
|
-
attachRender: (
|
|
1929
|
+
attachRender: (v) => /* @__PURE__ */ I(
|
|
1625
1930
|
"div",
|
|
1626
1931
|
{
|
|
1627
1932
|
className: "univer-ml-1 univer-flex univer-h-5 univer-flex-1 univer-cursor-pointer univer-items-center univer-justify-between univer-text-sm univer-text-primary-500",
|
|
1628
1933
|
children: [
|
|
1629
|
-
/* @__PURE__ */
|
|
1934
|
+
/* @__PURE__ */ f(
|
|
1630
1935
|
"span",
|
|
1631
1936
|
{
|
|
1632
1937
|
"data-u-comp": "sheets-filter-panel-values-item-count",
|
|
1633
1938
|
className: "univer-text-gray-400 dark:!univer-text-gray-500",
|
|
1634
|
-
children: `(${
|
|
1939
|
+
children: `(${v.count})`
|
|
1635
1940
|
}
|
|
1636
1941
|
),
|
|
1637
|
-
/* @__PURE__ */
|
|
1942
|
+
/* @__PURE__ */ f(
|
|
1638
1943
|
"a",
|
|
1639
1944
|
{
|
|
1640
1945
|
className: "univer-box-border univer-hidden univer-h-4 univer-whitespace-nowrap univer-px-1.5",
|
|
1641
1946
|
onClick: () => {
|
|
1642
|
-
const
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
}) :
|
|
1647
|
-
}) :
|
|
1947
|
+
const _ = [];
|
|
1948
|
+
v.children ? v.children.forEach((S) => {
|
|
1949
|
+
S.children ? S.children.forEach((N) => {
|
|
1950
|
+
_.push(N.key);
|
|
1951
|
+
}) : _.push(S.key);
|
|
1952
|
+
}) : _.push(v.key), e.onFilterOnly(_);
|
|
1648
1953
|
},
|
|
1649
|
-
children:
|
|
1954
|
+
children: a
|
|
1650
1955
|
}
|
|
1651
1956
|
)
|
|
1652
1957
|
]
|
|
@@ -1661,56 +1966,56 @@ function Pi(t) {
|
|
|
1661
1966
|
}
|
|
1662
1967
|
);
|
|
1663
1968
|
}
|
|
1664
|
-
function
|
|
1665
|
-
var
|
|
1666
|
-
const t = te(
|
|
1667
|
-
r.executeCommand(
|
|
1668
|
-
}, [r]), c =
|
|
1669
|
-
await (n == null ? void 0 : n.clear()), r.executeCommand(
|
|
1670
|
-
}, [n, r]), h =
|
|
1671
|
-
r.executeCommand(
|
|
1672
|
-
}, [r]),
|
|
1673
|
-
await (n == null ? void 0 : n.apply()), r.executeCommand(
|
|
1674
|
-
}, [n, r]),
|
|
1675
|
-
return /* @__PURE__ */
|
|
1969
|
+
function ji() {
|
|
1970
|
+
var N;
|
|
1971
|
+
const t = te(Z), e = te(K), r = te(j), s = H(t.filterBy$, void 0, !0), n = H(t.filterByModel$, void 0, !1), a = H(() => (n == null ? void 0 : n.canApply$) || me(!1), void 0, !1, [n]), i = Gi(e), o = !H(t.hasCriteria$), l = U((E) => {
|
|
1972
|
+
r.executeCommand(Gt.id, { filterBy: E });
|
|
1973
|
+
}, [r]), c = U(async () => {
|
|
1974
|
+
await (n == null ? void 0 : n.clear()), r.executeCommand(Se.id);
|
|
1975
|
+
}, [n, r]), h = U(() => {
|
|
1976
|
+
r.executeCommand(Se.id);
|
|
1977
|
+
}, [r]), d = U(async () => {
|
|
1978
|
+
await (n == null ? void 0 : n.apply()), r.executeCommand(Se.id);
|
|
1979
|
+
}, [n, r]), v = (N = te(q).activeFilterModel) == null ? void 0 : N.getRange(), _ = t.col, S = Pr(yr.FILTER_PANEL_EMBED_POINT);
|
|
1980
|
+
return /* @__PURE__ */ I(
|
|
1676
1981
|
"div",
|
|
1677
1982
|
{
|
|
1678
1983
|
"data-u-comp": "sheets-filter-panel",
|
|
1679
|
-
className: "univer-box-border univer-flex univer-max-h-[500px] univer-w-[
|
|
1984
|
+
className: "univer-box-border univer-flex univer-max-h-[500px] univer-w-[400px] univer-flex-col univer-rounded-lg univer-bg-white univer-p-4 univer-shadow-lg dark:!univer-border-gray-600 dark:!univer-bg-gray-700",
|
|
1680
1985
|
children: [
|
|
1681
|
-
/* @__PURE__ */
|
|
1682
|
-
|
|
1986
|
+
/* @__PURE__ */ f(
|
|
1987
|
+
wr,
|
|
1683
1988
|
{
|
|
1684
|
-
components:
|
|
1685
|
-
sharedProps: { range:
|
|
1989
|
+
components: S,
|
|
1990
|
+
sharedProps: { range: v, colIndex: _, onClose: h }
|
|
1686
1991
|
}
|
|
1687
1992
|
),
|
|
1688
|
-
/* @__PURE__ */
|
|
1689
|
-
|
|
1993
|
+
/* @__PURE__ */ f("div", { className: "univer-mb-1 univer-flex-shrink-0 univer-flex-grow-0", children: /* @__PURE__ */ f(
|
|
1994
|
+
li,
|
|
1690
1995
|
{
|
|
1691
1996
|
value: s,
|
|
1692
1997
|
items: i,
|
|
1693
|
-
onChange: (
|
|
1998
|
+
onChange: (E) => l(E)
|
|
1694
1999
|
}
|
|
1695
2000
|
) }),
|
|
1696
|
-
n ? /* @__PURE__ */
|
|
2001
|
+
n ? /* @__PURE__ */ f(
|
|
1697
2002
|
"div",
|
|
1698
2003
|
{
|
|
1699
2004
|
"data-u-comp": "sheets-filter-panel-content",
|
|
1700
2005
|
className: "univer-flex-shrink univer-flex-grow univer-pt-2",
|
|
1701
|
-
children: s ===
|
|
2006
|
+
children: s === A.VALUES ? /* @__PURE__ */ f(Vi, { model: n }) : s === A.COLORS ? /* @__PURE__ */ f(Di, { model: n }) : /* @__PURE__ */ f(Bi, { model: n })
|
|
1702
2007
|
}
|
|
1703
|
-
) : /* @__PURE__ */
|
|
1704
|
-
/* @__PURE__ */
|
|
2008
|
+
) : /* @__PURE__ */ f("div", { className: "univer-flex-1" }),
|
|
2009
|
+
/* @__PURE__ */ I(
|
|
1705
2010
|
"div",
|
|
1706
2011
|
{
|
|
1707
2012
|
"data-u-comp": "sheets-filter-panel-footer",
|
|
1708
2013
|
className: "univer-mt-4 univer-inline-flex univer-flex-shrink-0 univer-flex-grow-0 univer-flex-nowrap univer-justify-between univer-overflow-hidden",
|
|
1709
2014
|
children: [
|
|
1710
|
-
/* @__PURE__ */
|
|
1711
|
-
/* @__PURE__ */
|
|
1712
|
-
/* @__PURE__ */
|
|
1713
|
-
/* @__PURE__ */
|
|
2015
|
+
/* @__PURE__ */ f(Ge, { variant: "link", onClick: c, disabled: o, children: e.t("sheets-filter.panel.clear-filter") }),
|
|
2016
|
+
/* @__PURE__ */ I("span", { className: "univer-flex univer-gap-2", children: [
|
|
2017
|
+
/* @__PURE__ */ f(Ge, { variant: "default", onClick: h, children: e.t("sheets-filter.panel.cancel") }),
|
|
2018
|
+
/* @__PURE__ */ f(Ge, { disabled: !a, variant: "primary", onClick: d, children: e.t("sheets-filter.panel.confirm") })
|
|
1714
2019
|
] })
|
|
1715
2020
|
]
|
|
1716
2021
|
}
|
|
@@ -1719,135 +2024,136 @@ function bi() {
|
|
|
1719
2024
|
}
|
|
1720
2025
|
);
|
|
1721
2026
|
}
|
|
1722
|
-
function
|
|
2027
|
+
function Gi(t) {
|
|
1723
2028
|
const e = t.getCurrentLocale();
|
|
1724
|
-
return
|
|
1725
|
-
{ label: t.t("sheets-filter.panel.by-values"), value:
|
|
1726
|
-
{ label: t.t("sheets-filter.panel.by-
|
|
2029
|
+
return at(() => [
|
|
2030
|
+
{ label: t.t("sheets-filter.panel.by-values"), value: A.VALUES },
|
|
2031
|
+
{ label: t.t("sheets-filter.panel.by-colors"), value: A.COLORS },
|
|
2032
|
+
{ label: t.t("sheets-filter.panel.by-conditions"), value: A.CONDITIONS }
|
|
1727
2033
|
], [e, t]);
|
|
1728
2034
|
}
|
|
1729
|
-
function
|
|
1730
|
-
const e = t.get(
|
|
2035
|
+
function Yi(t) {
|
|
2036
|
+
const e = t.get(q);
|
|
1731
2037
|
return {
|
|
1732
|
-
id:
|
|
1733
|
-
type:
|
|
2038
|
+
id: Ee.id,
|
|
2039
|
+
type: nt.BUTTON_SELECTOR,
|
|
1734
2040
|
icon: "FilterIcon",
|
|
1735
2041
|
tooltip: "sheets-filter.toolbar.smart-toggle-filter-tooltip",
|
|
1736
|
-
hidden$:
|
|
1737
|
-
activated$: e.activeFilterModel$.pipe(
|
|
1738
|
-
disabled$:
|
|
2042
|
+
hidden$: st(t, ie.UNIVER_SHEET),
|
|
2043
|
+
activated$: e.activeFilterModel$.pipe(ce((r) => !!r)),
|
|
2044
|
+
disabled$: Or(
|
|
1739
2045
|
t,
|
|
1740
|
-
|
|
2046
|
+
Ir(
|
|
1741
2047
|
t,
|
|
1742
2048
|
{
|
|
1743
|
-
worksheetTypes: [
|
|
1744
|
-
rangeTypes: [
|
|
2049
|
+
worksheetTypes: [pe, ve],
|
|
2050
|
+
rangeTypes: [_e]
|
|
1745
2051
|
}
|
|
1746
2052
|
)
|
|
1747
2053
|
)
|
|
1748
2054
|
};
|
|
1749
2055
|
}
|
|
1750
|
-
function
|
|
1751
|
-
const e = t.get(
|
|
2056
|
+
function Zi(t) {
|
|
2057
|
+
const e = t.get(q);
|
|
1752
2058
|
return {
|
|
1753
|
-
id:
|
|
1754
|
-
type:
|
|
2059
|
+
id: it.id,
|
|
2060
|
+
type: nt.BUTTON,
|
|
1755
2061
|
title: "sheets-filter.toolbar.clear-filter-criteria",
|
|
1756
|
-
hidden$:
|
|
1757
|
-
disabled$: e.activeFilterModel$.pipe(
|
|
2062
|
+
hidden$: st(t, ie.UNIVER_SHEET),
|
|
2063
|
+
disabled$: e.activeFilterModel$.pipe(ot((r) => {
|
|
1758
2064
|
var s;
|
|
1759
|
-
return (s = r == null ? void 0 : r.hasCriteria$.pipe(
|
|
2065
|
+
return (s = r == null ? void 0 : r.hasCriteria$.pipe(ce((n) => !n))) != null ? s : me(!0);
|
|
1760
2066
|
}))
|
|
1761
2067
|
};
|
|
1762
2068
|
}
|
|
1763
|
-
function
|
|
1764
|
-
const e = t.get(
|
|
2069
|
+
function Ki(t) {
|
|
2070
|
+
const e = t.get(q);
|
|
1765
2071
|
return {
|
|
1766
|
-
id:
|
|
1767
|
-
type:
|
|
2072
|
+
id: rt.id,
|
|
2073
|
+
type: nt.BUTTON,
|
|
1768
2074
|
title: "sheets-filter.toolbar.re-calc-filter-conditions",
|
|
1769
|
-
hidden$:
|
|
1770
|
-
disabled$: e.activeFilterModel$.pipe(
|
|
2075
|
+
hidden$: st(t, ie.UNIVER_SHEET),
|
|
2076
|
+
disabled$: e.activeFilterModel$.pipe(ot((r) => {
|
|
1771
2077
|
var s;
|
|
1772
|
-
return (s = r == null ? void 0 : r.hasCriteria$.pipe(
|
|
2078
|
+
return (s = r == null ? void 0 : r.hasCriteria$.pipe(ce((n) => !n))) != null ? s : me(!0);
|
|
1773
2079
|
}))
|
|
1774
2080
|
};
|
|
1775
2081
|
}
|
|
1776
|
-
const
|
|
1777
|
-
[
|
|
1778
|
-
[
|
|
2082
|
+
const qi = {
|
|
2083
|
+
[Lr.ORGANIZATION]: {
|
|
2084
|
+
[Ee.id]: {
|
|
1779
2085
|
order: 2,
|
|
1780
|
-
menuItemFactory:
|
|
1781
|
-
[
|
|
2086
|
+
menuItemFactory: Yi,
|
|
2087
|
+
[it.id]: {
|
|
1782
2088
|
order: 0,
|
|
1783
|
-
menuItemFactory:
|
|
2089
|
+
menuItemFactory: Zi
|
|
1784
2090
|
},
|
|
1785
|
-
[
|
|
2091
|
+
[rt.id]: {
|
|
1786
2092
|
order: 1,
|
|
1787
|
-
menuItemFactory:
|
|
2093
|
+
menuItemFactory: Ki
|
|
1788
2094
|
}
|
|
1789
2095
|
}
|
|
1790
2096
|
}
|
|
1791
|
-
},
|
|
1792
|
-
id:
|
|
1793
|
-
binding:
|
|
2097
|
+
}, Xi = {
|
|
2098
|
+
id: Ee.id,
|
|
2099
|
+
binding: $r.L | pt.CTRL_COMMAND | pt.SHIFT,
|
|
1794
2100
|
description: "sheets-filter.shortcut.smart-toggle-filter",
|
|
1795
|
-
preconditions:
|
|
2101
|
+
preconditions: br,
|
|
1796
2102
|
group: "4_sheet-edit"
|
|
1797
2103
|
};
|
|
1798
|
-
var
|
|
1799
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
1800
|
-
(i = t[
|
|
2104
|
+
var zi = Object.getOwnPropertyDescriptor, Ji = (t, e, r, s) => {
|
|
2105
|
+
for (var n = s > 1 ? void 0 : s ? zi(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
2106
|
+
(i = t[a]) && (n = i(n) || n);
|
|
1801
2107
|
return n;
|
|
1802
|
-
},
|
|
1803
|
-
const
|
|
1804
|
-
let
|
|
1805
|
-
constructor(e, r, s, n,
|
|
1806
|
-
super(
|
|
1807
|
-
|
|
1808
|
-
this._injector = e, this._componentManager = r, this._sheetsFilterPanelService = s, this._sheetCanvasPopupService = n, this._sheetsFilterService =
|
|
2108
|
+
}, P = (t, e) => (r, s) => e(r, s, t);
|
|
2109
|
+
const Ot = "FILTER_PANEL_POPUP";
|
|
2110
|
+
let ke = class extends Te {
|
|
2111
|
+
constructor(e, r, s, n, a, i, o, l, c, h, d, C, v) {
|
|
2112
|
+
super(v, C);
|
|
2113
|
+
p(this, "_popupDisposable");
|
|
2114
|
+
this._injector = e, this._componentManager = r, this._sheetsFilterPanelService = s, this._sheetCanvasPopupService = n, this._sheetsFilterService = a, this._localeService = i, this._shortcutService = o, this._commandService = l, this._menuManagerService = c, this._contextService = h, this._messageService = d, this._initCommands(), this._initShortcuts(), this._initMenuItems(), this._initUI();
|
|
1809
2115
|
}
|
|
1810
2116
|
dispose() {
|
|
1811
2117
|
super.dispose(), this._closeFilterPopup();
|
|
1812
2118
|
}
|
|
1813
2119
|
_initShortcuts() {
|
|
1814
2120
|
[
|
|
1815
|
-
|
|
2121
|
+
Xi
|
|
1816
2122
|
].forEach((e) => {
|
|
1817
2123
|
this.disposeWithMe(this._shortcutService.registerShortcut(e));
|
|
1818
2124
|
});
|
|
1819
2125
|
}
|
|
1820
2126
|
_initCommands() {
|
|
1821
2127
|
[
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
2128
|
+
Ee,
|
|
2129
|
+
_r,
|
|
2130
|
+
gr,
|
|
2131
|
+
Q,
|
|
2132
|
+
it,
|
|
2133
|
+
rt,
|
|
2134
|
+
Gt,
|
|
2135
|
+
Me,
|
|
2136
|
+
Se
|
|
1831
2137
|
].forEach((e) => {
|
|
1832
2138
|
this.disposeWithMe(this._commandService.registerCommand(e));
|
|
1833
2139
|
});
|
|
1834
2140
|
}
|
|
1835
2141
|
_initMenuItems() {
|
|
1836
|
-
this._menuManagerService.mergeMenu(
|
|
2142
|
+
this._menuManagerService.mergeMenu(qi);
|
|
1837
2143
|
}
|
|
1838
2144
|
_initUI() {
|
|
1839
2145
|
[
|
|
1840
|
-
[
|
|
1841
|
-
["FilterIcon",
|
|
2146
|
+
[Ot, ji],
|
|
2147
|
+
["FilterIcon", zt]
|
|
1842
2148
|
].forEach(([e, r]) => {
|
|
1843
2149
|
this.disposeWithMe(
|
|
1844
2150
|
this._componentManager.register(e, r)
|
|
1845
2151
|
);
|
|
1846
|
-
}), this.disposeWithMe(this._contextService.subscribeContextValue$(
|
|
2152
|
+
}), this.disposeWithMe(this._contextService.subscribeContextValue$(ue).pipe(ti()).subscribe((e) => {
|
|
1847
2153
|
e ? this._openFilterPopup() : this._closeFilterPopup();
|
|
1848
2154
|
})), this.disposeWithMe(this._sheetsFilterService.errorMsg$.subscribe((e) => {
|
|
1849
2155
|
e && this._messageService.show({
|
|
1850
|
-
type:
|
|
2156
|
+
type: ai.Error,
|
|
1851
2157
|
content: this._localeService.t(e)
|
|
1852
2158
|
});
|
|
1853
2159
|
}));
|
|
@@ -1858,9 +2164,9 @@ let Pe = class extends de {
|
|
|
1858
2164
|
throw new Error("[SheetsFilterUIController]: no filter model when opening filter popup!");
|
|
1859
2165
|
const r = e.getRange(), s = this._sheetsFilterPanelService.col, { startRow: n } = r;
|
|
1860
2166
|
this._popupDisposable = this._sheetCanvasPopupService.attachPopupToCell(n, s, {
|
|
1861
|
-
componentKey:
|
|
2167
|
+
componentKey: Ot,
|
|
1862
2168
|
direction: "horizontal",
|
|
1863
|
-
onClickOutside: () => this._commandService.syncExecuteCommand(
|
|
2169
|
+
onClickOutside: () => this._commandService.syncExecuteCommand(Se.id),
|
|
1864
2170
|
offset: [5, 0]
|
|
1865
2171
|
});
|
|
1866
2172
|
}
|
|
@@ -1869,97 +2175,97 @@ let Pe = class extends de {
|
|
|
1869
2175
|
(e = this._popupDisposable) == null || e.dispose(), this._popupDisposable = null;
|
|
1870
2176
|
}
|
|
1871
2177
|
};
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
],
|
|
1887
|
-
var
|
|
1888
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
1889
|
-
(i = t[
|
|
2178
|
+
ke = Ji([
|
|
2179
|
+
P(0, T(re)),
|
|
2180
|
+
P(1, T(Mr)),
|
|
2181
|
+
P(2, T(Z)),
|
|
2182
|
+
P(3, T(Rr)),
|
|
2183
|
+
P(4, T(q)),
|
|
2184
|
+
P(5, T(K)),
|
|
2185
|
+
P(6, xr),
|
|
2186
|
+
P(7, j),
|
|
2187
|
+
P(8, Ur),
|
|
2188
|
+
P(9, We),
|
|
2189
|
+
P(10, kr),
|
|
2190
|
+
P(11, T(Ut)),
|
|
2191
|
+
P(12, kt)
|
|
2192
|
+
], ke);
|
|
2193
|
+
var es = Object.defineProperty, ts = Object.getOwnPropertyDescriptor, rs = (t, e, r) => e in t ? es(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, is = (t, e, r, s) => {
|
|
2194
|
+
for (var n = s > 1 ? void 0 : s ? ts(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
2195
|
+
(i = t[a]) && (n = i(n) || n);
|
|
1890
2196
|
return n;
|
|
1891
|
-
},
|
|
1892
|
-
const
|
|
1893
|
-
let
|
|
1894
|
-
constructor(t =
|
|
2197
|
+
}, Ke = (t, e) => (r, s) => e(r, s, t), er = (t, e, r) => rs(t, typeof e != "symbol" ? e + "" : e, r);
|
|
2198
|
+
const ss = "SHEET_FILTER_UI_PLUGIN";
|
|
2199
|
+
let He = class extends tt {
|
|
2200
|
+
constructor(t = xe, e, r, s) {
|
|
1895
2201
|
super(), this._config = t, this._injector = e, this._configService = r, this._rpcChannelService = s;
|
|
1896
|
-
const { menu: n, ...
|
|
2202
|
+
const { menu: n, ...a } = Mt(
|
|
1897
2203
|
{},
|
|
1898
|
-
|
|
2204
|
+
xe,
|
|
1899
2205
|
this._config
|
|
1900
2206
|
);
|
|
1901
|
-
n && this._configService.setConfig("menu", n, { merge: !0 }), this._configService.setConfig(
|
|
2207
|
+
n && this._configService.setConfig("menu", n, { merge: !0 }), this._configService.setConfig(Yt, a);
|
|
1902
2208
|
}
|
|
1903
2209
|
onStarting() {
|
|
1904
|
-
|
|
1905
|
-
[
|
|
1906
|
-
[
|
|
1907
|
-
[
|
|
1908
|
-
]), this._config.useRemoteFilterValuesGenerator && this._rpcChannelService && this._injector.add([
|
|
1909
|
-
useFactory: () =>
|
|
1910
|
-
this._rpcChannelService.requestChannel(
|
|
2210
|
+
hr(this._injector, [
|
|
2211
|
+
[Z],
|
|
2212
|
+
[he],
|
|
2213
|
+
[ke]
|
|
2214
|
+
]), this._config.useRemoteFilterValuesGenerator && this._rpcChannelService && this._injector.add([Pe, {
|
|
2215
|
+
useFactory: () => ri(
|
|
2216
|
+
this._rpcChannelService.requestChannel(ct)
|
|
1911
2217
|
)
|
|
1912
2218
|
}]);
|
|
1913
2219
|
}
|
|
1914
2220
|
onReady() {
|
|
1915
|
-
|
|
1916
|
-
[
|
|
2221
|
+
ft(this._injector, [
|
|
2222
|
+
[he]
|
|
1917
2223
|
]);
|
|
1918
2224
|
}
|
|
1919
2225
|
onRendered() {
|
|
1920
|
-
|
|
1921
|
-
[
|
|
2226
|
+
ft(this._injector, [
|
|
2227
|
+
[ke]
|
|
1922
2228
|
]);
|
|
1923
2229
|
}
|
|
1924
2230
|
};
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
],
|
|
1933
|
-
var
|
|
1934
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
1935
|
-
(i = t[
|
|
2231
|
+
er(He, "type", ie.UNIVER_SHEET);
|
|
2232
|
+
er(He, "pluginName", ss);
|
|
2233
|
+
He = is([
|
|
2234
|
+
Lt(xt),
|
|
2235
|
+
Ke(1, T(re)),
|
|
2236
|
+
Ke(2, $t),
|
|
2237
|
+
Ke(3, ur(Bt))
|
|
2238
|
+
], He);
|
|
2239
|
+
var ns = Object.getOwnPropertyDescriptor, os = (t, e, r, s) => {
|
|
2240
|
+
for (var n = s > 1 ? void 0 : s ? ns(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
2241
|
+
(i = t[a]) && (n = i(n) || n);
|
|
1936
2242
|
return n;
|
|
1937
|
-
},
|
|
1938
|
-
let
|
|
2243
|
+
}, It = (t, e) => (r, s) => e(r, s, t), be;
|
|
2244
|
+
let bt = (be = class extends tt {
|
|
1939
2245
|
constructor(t, e, r) {
|
|
1940
2246
|
super(), this._config = t, this._injector = e, this._rpcChannelService = r;
|
|
1941
2247
|
}
|
|
1942
2248
|
onStarting() {
|
|
1943
2249
|
[
|
|
1944
|
-
[
|
|
2250
|
+
[Pe, { useClass: Xe }]
|
|
1945
2251
|
].forEach((t) => this._injector.add(t));
|
|
1946
2252
|
}
|
|
1947
2253
|
onReady() {
|
|
1948
2254
|
this._rpcChannelService.registerChannel(
|
|
1949
|
-
|
|
1950
|
-
|
|
2255
|
+
ct,
|
|
2256
|
+
ii(this._injector.get(Pe))
|
|
1951
2257
|
);
|
|
1952
2258
|
}
|
|
1953
|
-
},
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
],
|
|
2259
|
+
}, p(be, "type", ie.UNIVER_SHEET), p(be, "pluginName", "SHEET_FILTER_UI_WORKER_PLUGIN"), be);
|
|
2260
|
+
bt = os([
|
|
2261
|
+
It(1, T(re)),
|
|
2262
|
+
It(2, Bt)
|
|
2263
|
+
], bt);
|
|
1958
2264
|
export {
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
2265
|
+
Gt as ChangeFilterByOperation,
|
|
2266
|
+
Se as CloseFilterPanelOperation,
|
|
2267
|
+
Me as OpenFilterPanelOperation,
|
|
2268
|
+
Ue as UniverSheetsFilterMobileUIPlugin,
|
|
2269
|
+
He as UniverSheetsFilterUIPlugin,
|
|
2270
|
+
bt as UniverSheetsFilterUIWorkerPlugin
|
|
1965
2271
|
};
|