@univerjs/sheets-filter-ui 0.10.3 → 0.10.4
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/es/index.js +578 -565
- package/lib/index.js +578 -565
- package/lib/umd/index.js +2 -2
- package/package.json +11 -11
package/lib/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { BooleanNumber as
|
|
5
|
-
import { CustomFilterOperator as u, FilterBy as
|
|
6
|
-
import { SetCellEditVisibleOperation as
|
|
7
|
-
import { ILayoutService as
|
|
8
|
-
import { COLOR_BLACK_RGB as
|
|
9
|
-
import { RefRangeService as
|
|
10
|
-
import { BehaviorSubject as V, ReplaySubject as
|
|
11
|
-
import { IRPCChannelService as
|
|
12
|
-
import { clsx as
|
|
13
|
-
import { jsx as
|
|
14
|
-
import { forwardRef as
|
|
1
|
+
var nr = Object.defineProperty;
|
|
2
|
+
var or = (t, e, r) => e in t ? nr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var v = (t, e, r) => or(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { BooleanNumber as mt, createIdentifier as Pt, Inject as T, LocaleService as X, IUniverInstanceService as Be, ILogService as lr, extractPureTextFromCell as ar, numfmt as ft, Disposable as de, Injector as ie, Quantity as wt, Tools as Re, ColorKit as pt, ICommandService as j, CommandType as We, IContextService as Qe, ThemeService as Lt, RxDisposable as Mt, fromCallback as cr, VerticalAlign as Ae, InterceptorEffectEnum as ur, UniverInstanceType as se, DependentOn as $t, IConfigService as xt, Plugin as it, merge as Ut, Optional as hr, registerDependencies as dr, touchDependencies as vt } from "@univerjs/core";
|
|
5
|
+
import { CustomFilterOperator as u, FilterBy as w, SetSheetsFilterCriteriaCommand as Q, SheetsFilterService as z, SmartToggleSheetsFilterCommand as Ne, FILTER_MUTATIONS as mr, SetSheetsFilterRangeMutation as fr, SetSheetsFilterCriteriaMutation as pr, RemoveSheetsFilterMutation as vr, ReCalcSheetsFilterMutation as _r, UniverSheetsFilterPlugin as kt, ReCalcSheetsFilterCommand as st, ClearSheetsFilterCriteriaCommand as nt, RemoveSheetFilterCommand as gr, SetSheetFilterRangeCommand as Sr } from "@univerjs/sheets-filter";
|
|
6
|
+
import { SetCellEditVisibleOperation as Cr, SheetSkeletonManagerService as Tr, ISheetSelectionRenderService as Er, SelectionControl as Nr, attachSelectionWithCoord as Fr, getCoordByCell as yr, SheetsRenderService as Ht, SheetsUIPart as Or, getObservableWithExclusiveRange$ as Ir, getCurrentRangeDisable$ as br, whenSheetEditorFocused as Rr, SheetCanvasPopManagerService as Ar } from "@univerjs/sheets-ui";
|
|
7
|
+
import { ILayoutService as Pr, useDependency as re, useObservable as D, useComponentsOfPart as wr, ComponentContainer as Lr, getMenuHiddenObservable as ot, MenuItemType as lt, RibbonDataGroup as Mr, KeyCode as $r, MetaKeys as _t, ComponentManager as xr, IShortcutService as Ur, IMenuManagerService as kr, IMessageService as Hr } from "@univerjs/ui";
|
|
8
|
+
import { COLOR_BLACK_RGB as gt, Rect as St, Shape as Dr, IRenderManagerService as Dt } from "@univerjs/engine-render";
|
|
9
|
+
import { RefRangeService as Br, SheetPermissionCheckController as Wr, SheetsSelectionsService as Qr, getSheetCommandTarget as Vr, WorksheetFilterPermission as pe, WorksheetViewPermission as ve, RangeProtectionPermissionViewPoint as _e, expandToContinuousRange as jr, SheetInterceptorService as Gr, SetRangeValuesMutation as Yr, INTERCEPTOR_POINT as Zr } from "@univerjs/sheets";
|
|
10
|
+
import { BehaviorSubject as V, ReplaySubject as Kr, Subject as qr, merge as Xr, combineLatest as zr, throttleTime as Bt, startWith as Wt, map as ce, shareReplay as Jr, of as me, switchMap as at, filter as ei, takeUntil as ti, distinctUntilChanged as ri } from "rxjs";
|
|
11
|
+
import { IRPCChannelService as Qt, toModule as ii, fromModule as si } from "@univerjs/rpc";
|
|
12
|
+
import { clsx as Pe, borderClassName as ct, Select as Ct, RadioGroup as ni, Radio as Tt, Input as Vt, Checkbox as oi, Tree as li, Segmented as ai, Button as Ze, MessageType as ci } from "@univerjs/design";
|
|
13
|
+
import { jsx as p, jsxs as I, Fragment as Et } from "react/jsx-runtime";
|
|
14
|
+
import { forwardRef as Fe, useRef as ui, createElement as ye, useCallback as k, useMemo as ut } from "react";
|
|
15
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 = {
|
|
@@ -66,7 +66,7 @@ var y = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
66
66
|
numOfParameters: 1,
|
|
67
67
|
getDefaultFormParams: () => ({ operator1: g.CONTAINS, val1: "" }),
|
|
68
68
|
testMappingParams: (i) => {
|
|
69
|
-
const [o] =
|
|
69
|
+
const [o] = U(i);
|
|
70
70
|
return o === g.CONTAINS;
|
|
71
71
|
},
|
|
72
72
|
mapToFilterColumn: (i) => {
|
|
@@ -92,7 +92,7 @@ var y = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
92
92
|
customFilters: { customFilters: [{ val: `*${i.val1}*`, operator: u.NOT_EQUALS }] }
|
|
93
93
|
}),
|
|
94
94
|
testMappingParams: (i) => {
|
|
95
|
-
const [o] =
|
|
95
|
+
const [o] = U(i);
|
|
96
96
|
return o === g.DOES_NOT_CONTAIN;
|
|
97
97
|
},
|
|
98
98
|
testMappingFilterColumn: (i) => {
|
|
@@ -112,7 +112,7 @@ var y = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
112
112
|
customFilters: { customFilters: [{ val: `${i.val1}*` }] }
|
|
113
113
|
}),
|
|
114
114
|
testMappingParams: (i) => {
|
|
115
|
-
const [o] =
|
|
115
|
+
const [o] = U(i);
|
|
116
116
|
return o === g.STARTS_WITH;
|
|
117
117
|
},
|
|
118
118
|
testMappingFilterColumn: (i) => {
|
|
@@ -132,7 +132,7 @@ var y = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
132
132
|
customFilters: { customFilters: [{ val: `*${i.val1}` }] }
|
|
133
133
|
}),
|
|
134
134
|
testMappingParams: (i) => {
|
|
135
|
-
const [o] =
|
|
135
|
+
const [o] = U(i);
|
|
136
136
|
return o === g.ENDS_WITH;
|
|
137
137
|
},
|
|
138
138
|
testMappingFilterColumn: (i) => {
|
|
@@ -149,7 +149,7 @@ var y = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
149
149
|
numOfParameters: 1,
|
|
150
150
|
getDefaultFormParams: () => ({ operator1: g.EQUALS, val1: "" }),
|
|
151
151
|
testMappingParams: (i) => {
|
|
152
|
-
const [o] =
|
|
152
|
+
const [o] = U(i);
|
|
153
153
|
return o === g.EQUALS;
|
|
154
154
|
},
|
|
155
155
|
mapToFilterColumn: (i) => {
|
|
@@ -172,7 +172,7 @@ var y = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
172
172
|
customFilters: { customFilters: [{ val: i.val1, operator: u.GREATER_THAN }] }
|
|
173
173
|
}),
|
|
174
174
|
testMappingParams: (i) => {
|
|
175
|
-
const [o] =
|
|
175
|
+
const [o] = U(i);
|
|
176
176
|
return o === u.GREATER_THAN;
|
|
177
177
|
},
|
|
178
178
|
testMappingFilterColumn: (i) => {
|
|
@@ -189,7 +189,7 @@ var y = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
189
189
|
order: y.FIRST,
|
|
190
190
|
getDefaultFormParams: () => ({ operator1: u.GREATER_THAN_OR_EQUAL, val1: "" }),
|
|
191
191
|
testMappingParams: (i) => {
|
|
192
|
-
const [o] =
|
|
192
|
+
const [o] = U(i);
|
|
193
193
|
return o === u.GREATER_THAN_OR_EQUAL;
|
|
194
194
|
},
|
|
195
195
|
mapToFilterColumn: (i) => ({
|
|
@@ -209,7 +209,7 @@ var y = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
209
209
|
order: y.FIRST,
|
|
210
210
|
getDefaultFormParams: () => ({ operator1: u.LESS_THAN, val1: "" }),
|
|
211
211
|
testMappingParams: (i) => {
|
|
212
|
-
const [o] =
|
|
212
|
+
const [o] = U(i);
|
|
213
213
|
return o === u.LESS_THAN;
|
|
214
214
|
},
|
|
215
215
|
mapToFilterColumn: (i) => ({
|
|
@@ -229,7 +229,7 @@ var y = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
229
229
|
order: y.FIRST,
|
|
230
230
|
getDefaultFormParams: () => ({ operator1: u.LESS_THAN_OR_EQUAL, val1: "" }),
|
|
231
231
|
testMappingParams: (i) => {
|
|
232
|
-
const [o] =
|
|
232
|
+
const [o] = U(i);
|
|
233
233
|
return o === u.LESS_THAN_OR_EQUAL;
|
|
234
234
|
},
|
|
235
235
|
mapToFilterColumn: (i) => ({
|
|
@@ -249,7 +249,7 @@ var y = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
249
249
|
order: y.FIRST,
|
|
250
250
|
getDefaultFormParams: () => ({ operator1: u.EQUAL, val1: "" }),
|
|
251
251
|
testMappingParams: (i) => {
|
|
252
|
-
const [o] =
|
|
252
|
+
const [o] = U(i);
|
|
253
253
|
return o === u.EQUAL;
|
|
254
254
|
},
|
|
255
255
|
mapToFilterColumn: (i) => ({
|
|
@@ -269,7 +269,7 @@ var y = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
269
269
|
order: y.FIRST,
|
|
270
270
|
getDefaultFormParams: () => ({ operator1: u.NOT_EQUALS, val1: "" }),
|
|
271
271
|
testMappingParams: (i) => {
|
|
272
|
-
const [o] =
|
|
272
|
+
const [o] = U(i);
|
|
273
273
|
return o === u.NOT_EQUALS;
|
|
274
274
|
},
|
|
275
275
|
mapToFilterColumn: (i) => ({
|
|
@@ -304,7 +304,7 @@ var y = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
304
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: mt.TRUE,
|
|
308
308
|
customFilters: [
|
|
309
309
|
{ val: h ? o : l, operator: u.GREATER_THAN_OR_EQUAL },
|
|
310
310
|
{ val: h ? l : o, operator: u.LESS_THAN_OR_EQUAL }
|
|
@@ -395,20 +395,20 @@ var y = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
395
395
|
if (R.operator === b)
|
|
396
396
|
return R.mapToFilterColumn({ val1: F, operator1: b });
|
|
397
397
|
}
|
|
398
|
-
const
|
|
399
|
-
if (
|
|
398
|
+
const f = !h || h === t.NONE.operator, _ = !d || d === t.NONE.operator;
|
|
399
|
+
if (f && _)
|
|
400
400
|
return t.NONE.mapToFilterColumn({});
|
|
401
|
-
if (
|
|
401
|
+
if (f)
|
|
402
402
|
return C(d, c);
|
|
403
403
|
if (_)
|
|
404
404
|
return C(h, l);
|
|
405
|
-
const S = C(h, l),
|
|
405
|
+
const S = C(h, l), E = C(d, c), N = {
|
|
406
406
|
customFilters: [
|
|
407
407
|
S.customFilters.customFilters[0],
|
|
408
|
-
|
|
408
|
+
E.customFilters.customFilters[0]
|
|
409
409
|
]
|
|
410
410
|
};
|
|
411
|
-
return o && (
|
|
411
|
+
return o && (N.and = mt.TRUE), { customFilters: N };
|
|
412
412
|
},
|
|
413
413
|
testMappingFilterColumn: (i) => {
|
|
414
414
|
var c;
|
|
@@ -484,7 +484,7 @@ var y = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
484
484
|
}
|
|
485
485
|
t.testMappingFilterColumn = a;
|
|
486
486
|
})(m || (m = {}));
|
|
487
|
-
function
|
|
487
|
+
function U(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,7 +492,7 @@ function x(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 ze(t) {
|
|
496
496
|
const e = [], r = [];
|
|
497
497
|
let s = 0, n = 0;
|
|
498
498
|
function a(i) {
|
|
@@ -505,20 +505,20 @@ function qe(t) {
|
|
|
505
505
|
unchecked: n
|
|
506
506
|
};
|
|
507
507
|
}
|
|
508
|
-
var
|
|
509
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
508
|
+
var hi = Object.getOwnPropertyDescriptor, di = (t, e, r, s) => {
|
|
509
|
+
for (var n = s > 1 ? void 0 : s ? hi(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
510
510
|
(i = t[a]) && (n = i(n) || n);
|
|
511
511
|
return n;
|
|
512
|
-
},
|
|
513
|
-
const
|
|
514
|
-
let
|
|
512
|
+
}, Ke = (t, e) => (r, s) => e(r, s, t);
|
|
513
|
+
const ht = "sheets-filter.generate-filter-values.service", we = Pt(ht), mi = ["yyyy-mm-dd", "yyyy-mm-dd;@", "yyyy/mm/dd;@", "yyyy/mm/dd hh:mm", "yyyy-m-d am/pm h:mm", "yyyy-MM-dd", "yyyy/MM/dd", "yyyy/mm/dd", 'yyyy"年"MM"月"dd"日"', "MM-dd", 'M"月"d"日"', "MM-dd A/P hh:mm"];
|
|
514
|
+
let Je = class extends de {
|
|
515
515
|
constructor(t, e, r) {
|
|
516
516
|
super(), this._localeService = t, this._univerInstanceService = e, this._logService = r;
|
|
517
517
|
}
|
|
518
518
|
async getFilterValues(t) {
|
|
519
519
|
var d;
|
|
520
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 }),
|
|
521
|
+
return !c || !h ? [] : (this._logService.debug("[SheetsGenerateFilterValuesService]", "getFilterValues for", { unitId: e, subUnitId: r }), jt(
|
|
522
522
|
a,
|
|
523
523
|
this._localeService,
|
|
524
524
|
o,
|
|
@@ -531,96 +531,96 @@ let Xe = class extends de {
|
|
|
531
531
|
));
|
|
532
532
|
}
|
|
533
533
|
};
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
],
|
|
539
|
-
function
|
|
540
|
-
var
|
|
541
|
-
const c = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), d = "yyyy-mm-dd", C = new Set(
|
|
534
|
+
Je = di([
|
|
535
|
+
Ke(0, T(X)),
|
|
536
|
+
Ke(1, Be),
|
|
537
|
+
Ke(2, lr)
|
|
538
|
+
], Je);
|
|
539
|
+
function jt(t, e, r, s, n, a, i, o, l) {
|
|
540
|
+
var N, b, F, R, L, G, Y, ne, x, A;
|
|
541
|
+
const c = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), d = "yyyy-mm-dd", C = new Set(mi), f = "empty", _ = !t && ((a == null ? void 0 : a.filterBy) === w.COLORS || (a == null ? void 0 : a.filterBy) === w.CONDITIONS) && ((N = a.filteredOutRows) == null ? void 0 : N.size);
|
|
542
542
|
let S = 0;
|
|
543
|
-
for (const
|
|
544
|
-
const { row:
|
|
543
|
+
for (const P of s.iterateByColumn(r, !1, !1)) {
|
|
544
|
+
const { row: je, rowSpan: dt = 1 } = P;
|
|
545
545
|
let oe = 0;
|
|
546
|
-
for (; oe <
|
|
547
|
-
const
|
|
548
|
-
if (n.has(
|
|
546
|
+
for (; oe < dt; ) {
|
|
547
|
+
const ir = je + oe;
|
|
548
|
+
if (n.has(ir)) {
|
|
549
549
|
oe++;
|
|
550
550
|
continue;
|
|
551
551
|
}
|
|
552
|
-
const
|
|
553
|
-
if (!
|
|
554
|
-
S += 1, oe +=
|
|
552
|
+
const J = P != null && P.value ? ar(P.value) : "";
|
|
553
|
+
if (!J) {
|
|
554
|
+
S += 1, oe += dt;
|
|
555
555
|
continue;
|
|
556
556
|
}
|
|
557
|
-
const
|
|
558
|
-
if (
|
|
559
|
-
const
|
|
560
|
-
if (!
|
|
557
|
+
const Ie = (b = P.value) != null && b.v && !P.value.p ? (L = (R = l.get((F = P.value) == null ? void 0 : F.s)) == null ? void 0 : R.n) == null ? void 0 : L.pattern : "", sr = Ie && ft.getFormatInfo(Ie).isDate;
|
|
558
|
+
if (Ie && sr && C.has(Ie)) {
|
|
559
|
+
const Z = (G = s.getCellRaw(P.row, P.col)) == null ? void 0 : G.v;
|
|
560
|
+
if (!Z) {
|
|
561
561
|
oe++;
|
|
562
562
|
continue;
|
|
563
563
|
}
|
|
564
|
-
const le =
|
|
565
|
-
let
|
|
566
|
-
|
|
564
|
+
const le = ft.format(d, Z), [O, H, fe] = le.split("-").map(Number);
|
|
565
|
+
let ee = c.get(`${O}`);
|
|
566
|
+
ee || (ee = {
|
|
567
567
|
title: `${O}`,
|
|
568
568
|
key: `${O}`,
|
|
569
569
|
children: [],
|
|
570
570
|
count: 0,
|
|
571
571
|
leaf: !1,
|
|
572
572
|
checked: !1
|
|
573
|
-
}, c.set(`${O}`,
|
|
574
|
-
let
|
|
575
|
-
|
|
576
|
-
title: e.t(`sheets-filter.date.${
|
|
577
|
-
key: `${O}-${
|
|
573
|
+
}, c.set(`${O}`, ee), h.set(`${O}`, [`${O}`]));
|
|
574
|
+
let W = (Y = ee.children) == null ? void 0 : Y.find((Ye) => Ye.key === `${O}-${H}`);
|
|
575
|
+
W || (W = {
|
|
576
|
+
title: e.t(`sheets-filter.date.${H}`),
|
|
577
|
+
key: `${O}-${H}`,
|
|
578
578
|
children: [],
|
|
579
579
|
count: 0,
|
|
580
580
|
leaf: !1,
|
|
581
581
|
checked: !1
|
|
582
|
-
}, (ne =
|
|
583
|
-
const
|
|
584
|
-
|
|
582
|
+
}, (ne = ee.children) == null || ne.push(W), h.set(`${O}-${H}`, [`${O}`, `${O}-${H}`]));
|
|
583
|
+
const Ge = (x = W == null ? void 0 : W.children) == null ? void 0 : x.find((Ye) => Ye.key === `${O}-${H}-${fe}`);
|
|
584
|
+
Ge ? (Ge.originValues.add(J), Ge.count++, W.count++, ee.count++) : ((A = W.children) == null || A.push({
|
|
585
585
|
title: `${fe}`,
|
|
586
|
-
key: `${O}-${
|
|
586
|
+
key: `${O}-${H}-${fe}`,
|
|
587
587
|
count: 1,
|
|
588
|
-
originValues: /* @__PURE__ */ new Set([
|
|
588
|
+
originValues: /* @__PURE__ */ new Set([J]),
|
|
589
589
|
leaf: !0,
|
|
590
|
-
checked: _ ? !1 : i.size ? i.has(
|
|
591
|
-
}),
|
|
590
|
+
checked: _ ? !1 : i.size ? i.has(J) : !o
|
|
591
|
+
}), W.count++, ee.count++, h.set(`${O}-${H}-${fe}`, [`${O}`, `${O}-${H}`, `${O}-${H}-${fe}`]));
|
|
592
592
|
} else {
|
|
593
|
-
const
|
|
594
|
-
let le = c.get(
|
|
593
|
+
const Z = J;
|
|
594
|
+
let le = c.get(Z);
|
|
595
595
|
le ? le.count++ : (le = {
|
|
596
|
-
title:
|
|
596
|
+
title: J,
|
|
597
597
|
leaf: !0,
|
|
598
|
-
checked: _ ? !1 : i.size ? i.has(
|
|
599
|
-
key:
|
|
598
|
+
checked: _ ? !1 : i.size ? i.has(J) : !o,
|
|
599
|
+
key: Z,
|
|
600
600
|
count: 1
|
|
601
|
-
}, c.set(
|
|
601
|
+
}, c.set(Z, le), h.set(Z, [Z]));
|
|
602
602
|
}
|
|
603
603
|
oe++;
|
|
604
604
|
}
|
|
605
605
|
}
|
|
606
|
-
const
|
|
606
|
+
const E = _ ? !1 : t ? o : !0;
|
|
607
607
|
if (S > 0) {
|
|
608
|
-
const
|
|
608
|
+
const P = {
|
|
609
609
|
title: e.t("sheets-filter.panel.empty"),
|
|
610
610
|
count: S,
|
|
611
611
|
leaf: !0,
|
|
612
|
-
checked:
|
|
613
|
-
key:
|
|
612
|
+
checked: E,
|
|
613
|
+
key: f
|
|
614
614
|
};
|
|
615
|
-
c.set("empty",
|
|
615
|
+
c.set("empty", P), h.set("empty", [f]);
|
|
616
616
|
}
|
|
617
617
|
return {
|
|
618
|
-
filterTreeItems:
|
|
618
|
+
filterTreeItems: fi(Array.from(c.values())),
|
|
619
619
|
filterTreeMapCache: h
|
|
620
620
|
};
|
|
621
621
|
}
|
|
622
|
-
function
|
|
623
|
-
return Array.from(t).sort((e, r) => e.children && !r.children ? -1 : !e.children && r.children ? 1 :
|
|
622
|
+
function fi(t) {
|
|
623
|
+
return Array.from(t).sort((e, r) => e.children && !r.children ? -1 : !e.children && r.children ? 1 : pi(e.title, r.title)).map((e) => (e.children && e.children.sort((r, s) => {
|
|
624
624
|
const n = Number.parseInt(r.key.split("-")[1], 10), a = Number.parseInt(s.key.split("-")[1], 10);
|
|
625
625
|
return n - a;
|
|
626
626
|
}).forEach((r) => {
|
|
@@ -630,30 +630,30 @@ function mi(t) {
|
|
|
630
630
|
});
|
|
631
631
|
}), e));
|
|
632
632
|
}
|
|
633
|
-
const
|
|
634
|
-
function
|
|
635
|
-
const r =
|
|
633
|
+
const Nt = (t) => !Number.isNaN(Number(t)) && !Number.isNaN(Number.parseFloat(t));
|
|
634
|
+
function pi(t, e) {
|
|
635
|
+
const r = Nt(t), s = Nt(e);
|
|
636
636
|
return r && s ? Number.parseFloat(t) - Number.parseFloat(e) : r && !s ? -1 : !r && s ? 1 : t.localeCompare(e);
|
|
637
637
|
}
|
|
638
|
-
function
|
|
638
|
+
function et(t, e) {
|
|
639
639
|
for (const r of t) {
|
|
640
640
|
if (r.key === e)
|
|
641
641
|
return r;
|
|
642
642
|
if (r.children) {
|
|
643
|
-
const s =
|
|
643
|
+
const s = et(r.children, e);
|
|
644
644
|
if (s)
|
|
645
645
|
return s;
|
|
646
646
|
}
|
|
647
647
|
}
|
|
648
648
|
return null;
|
|
649
649
|
}
|
|
650
|
-
function
|
|
651
|
-
return t.leaf ? t.checked : t.children ? t.children.every((e) =>
|
|
650
|
+
function Gt(t) {
|
|
651
|
+
return t.leaf ? t.checked : t.children ? t.children.every((e) => Gt(e)) : !0;
|
|
652
652
|
}
|
|
653
653
|
function ge(t, e) {
|
|
654
654
|
t.leaf && (e !== void 0 ? t.checked = e : t.checked = !t.checked), t.children && t.children.forEach((r) => ge(r, e));
|
|
655
655
|
}
|
|
656
|
-
function
|
|
656
|
+
function Yt(t, e) {
|
|
657
657
|
const r = [];
|
|
658
658
|
return t.forEach((s) => {
|
|
659
659
|
const n = s.originValues ? e.some(
|
|
@@ -666,7 +666,7 @@ function jt(t, e) {
|
|
|
666
666
|
if (n || a)
|
|
667
667
|
r.push({ ...s });
|
|
668
668
|
else if (s.children) {
|
|
669
|
-
const o =
|
|
669
|
+
const o = Yt(s.children, e);
|
|
670
670
|
if (o.length > 0) {
|
|
671
671
|
const l = o.reduce((c, h) => c + h.count, 0);
|
|
672
672
|
r.push({ ...s, count: l, children: o });
|
|
@@ -674,26 +674,26 @@ function jt(t, e) {
|
|
|
674
674
|
}
|
|
675
675
|
}), r;
|
|
676
676
|
}
|
|
677
|
-
var
|
|
678
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
677
|
+
var vi = Object.getOwnPropertyDescriptor, Ve = (t, e, r, s) => {
|
|
678
|
+
for (var n = s > 1 ? void 0 : s ? vi(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
679
679
|
(i = t[a]) && (n = i(n) || n);
|
|
680
680
|
return n;
|
|
681
|
-
},
|
|
682
|
-
|
|
683
|
-
let
|
|
681
|
+
}, Te = (t, e) => (r, s) => e(r, s, t);
|
|
682
|
+
Pt("sheets-filter-ui.sheets-filter-panel.service");
|
|
683
|
+
let q = class extends de {
|
|
684
684
|
constructor(e, r) {
|
|
685
685
|
super();
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
686
|
+
v(this, "_filterBy$", new V(w.VALUES));
|
|
687
|
+
v(this, "filterBy$", this._filterBy$.asObservable());
|
|
688
|
+
v(this, "_filterByModel$", new Kr(1));
|
|
689
|
+
v(this, "filterByModel$", this._filterByModel$.asObservable());
|
|
690
|
+
v(this, "_filterByModel", null);
|
|
691
|
+
v(this, "_hasCriteria$", new V(!1));
|
|
692
|
+
v(this, "hasCriteria$", this._hasCriteria$.asObservable());
|
|
693
|
+
v(this, "_filterModel", null);
|
|
694
|
+
v(this, "_col$", new V(-1));
|
|
695
|
+
v(this, "col$", this._col$.asObservable());
|
|
696
|
+
v(this, "_filterHeaderListener", null);
|
|
697
697
|
this._injector = e, this._refRangeService = r;
|
|
698
698
|
}
|
|
699
699
|
get filterBy() {
|
|
@@ -740,13 +740,13 @@ let Z = class extends de {
|
|
|
740
740
|
if (!this._filterModel || this.col === -1)
|
|
741
741
|
return !1;
|
|
742
742
|
switch (e) {
|
|
743
|
-
case
|
|
743
|
+
case w.VALUES:
|
|
744
744
|
this._setupByValues(this._filterModel, this.col);
|
|
745
745
|
break;
|
|
746
|
-
case
|
|
746
|
+
case w.COLORS:
|
|
747
747
|
this._setupByColors(this._filterModel, this.col);
|
|
748
748
|
break;
|
|
749
|
-
case
|
|
749
|
+
case w.CONDITIONS:
|
|
750
750
|
this._setupByConditions(this._filterModel, this.col);
|
|
751
751
|
break;
|
|
752
752
|
}
|
|
@@ -780,12 +780,12 @@ let Z = class extends de {
|
|
|
780
780
|
this._disposePreviousModel();
|
|
781
781
|
const s = e.getRange();
|
|
782
782
|
if (s.startRow === s.endRow) return !1;
|
|
783
|
-
const n = await
|
|
783
|
+
const n = await Me.fromFilterColumn(
|
|
784
784
|
this._injector,
|
|
785
785
|
e,
|
|
786
786
|
r
|
|
787
787
|
);
|
|
788
|
-
return this.filterByModel = n, this._filterBy$.next(
|
|
788
|
+
return this.filterByModel = n, this._filterBy$.next(w.VALUES), this._listenToFilterHeaderChange(e, r), !0;
|
|
789
789
|
}
|
|
790
790
|
async _setupByColors(e, r) {
|
|
791
791
|
this._disposePreviousModel();
|
|
@@ -796,37 +796,37 @@ let Z = class extends de {
|
|
|
796
796
|
e,
|
|
797
797
|
r
|
|
798
798
|
);
|
|
799
|
-
return this.filterByModel = n, this._filterBy$.next(
|
|
799
|
+
return this.filterByModel = n, this._filterBy$.next(w.COLORS), this._listenToFilterHeaderChange(e, r), !0;
|
|
800
800
|
}
|
|
801
801
|
_setupByConditions(e, r) {
|
|
802
802
|
this._disposePreviousModel();
|
|
803
803
|
const s = e.getRange();
|
|
804
804
|
if (s.startRow === s.endRow) return !1;
|
|
805
|
-
const n =
|
|
805
|
+
const n = Le.fromFilterColumn(
|
|
806
806
|
this._injector,
|
|
807
807
|
e,
|
|
808
808
|
r,
|
|
809
809
|
e.getFilterColumn(r)
|
|
810
810
|
);
|
|
811
|
-
return this.filterByModel = n, this._filterBy$.next(
|
|
811
|
+
return this.filterByModel = n, this._filterBy$.next(w.CONDITIONS), this._listenToFilterHeaderChange(e, r), !0;
|
|
812
812
|
}
|
|
813
813
|
_disposePreviousModel() {
|
|
814
814
|
var e;
|
|
815
815
|
(e = this._filterByModel) == null || e.dispose(), this.filterByModel = null;
|
|
816
816
|
}
|
|
817
817
|
};
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
],
|
|
822
|
-
let
|
|
818
|
+
q = Ve([
|
|
819
|
+
Te(0, T(ie)),
|
|
820
|
+
Te(1, T(Br))
|
|
821
|
+
], q);
|
|
822
|
+
let Le = class extends de {
|
|
823
823
|
constructor(e, r, s, n, a) {
|
|
824
824
|
super();
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
825
|
+
v(this, "canApply$", me(!0));
|
|
826
|
+
v(this, "_conditionItem$");
|
|
827
|
+
v(this, "conditionItem$");
|
|
828
|
+
v(this, "_filterConditionFormParams$");
|
|
829
|
+
v(this, "filterConditionFormParams$");
|
|
830
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();
|
|
831
831
|
}
|
|
832
832
|
/**
|
|
@@ -842,7 +842,7 @@ let we = class extends de {
|
|
|
842
842
|
*/
|
|
843
843
|
static fromFilterColumn(e, r, s, n) {
|
|
844
844
|
const [a, i] = m.testMappingFilterColumn(n == null ? void 0 : n.getColumnData());
|
|
845
|
-
return e.createInstance(
|
|
845
|
+
return e.createInstance(Le, r, s, a, i);
|
|
846
846
|
}
|
|
847
847
|
get conditionItem() {
|
|
848
848
|
return this._conditionItem$.getValue();
|
|
@@ -904,37 +904,37 @@ let we = class extends de {
|
|
|
904
904
|
this._filterConditionFormParams$.next(r);
|
|
905
905
|
}
|
|
906
906
|
};
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
],
|
|
910
|
-
let
|
|
907
|
+
Le = Ve([
|
|
908
|
+
Te(4, j)
|
|
909
|
+
], Le);
|
|
910
|
+
let Me = class extends de {
|
|
911
911
|
constructor(e, r, s, n, a) {
|
|
912
912
|
super();
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
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
|
|
923
|
-
|
|
913
|
+
v(this, "_rawFilterItems$");
|
|
914
|
+
v(this, "rawFilterItems$");
|
|
915
|
+
v(this, "filterItems$");
|
|
916
|
+
v(this, "_filterItems", []);
|
|
917
|
+
v(this, "_treeMapCache");
|
|
918
|
+
v(this, "canApply$");
|
|
919
|
+
v(this, "_manuallyUpdateFilterItems$");
|
|
920
|
+
v(this, "_searchString$");
|
|
921
|
+
v(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 qr(), this.filterItems$ = Xr(
|
|
923
|
+
zr([
|
|
924
924
|
this._searchString$.pipe(
|
|
925
|
-
|
|
926
|
-
|
|
925
|
+
Bt(500, void 0, { leading: !0, trailing: !0 }),
|
|
926
|
+
Wt(void 0)
|
|
927
927
|
),
|
|
928
928
|
this._rawFilterItems$
|
|
929
929
|
]).pipe(
|
|
930
930
|
ce(([i, o]) => {
|
|
931
931
|
if (!i) return o;
|
|
932
932
|
const c = i.toLowerCase().split(/\s+/).filter((h) => !!h);
|
|
933
|
-
return
|
|
933
|
+
return Yt(o, c);
|
|
934
934
|
})
|
|
935
935
|
),
|
|
936
936
|
this._manuallyUpdateFilterItems$
|
|
937
|
-
).pipe(
|
|
937
|
+
).pipe(Jr(1)), this.canApply$ = this.filterItems$.pipe(ce((i) => ze(i).checked > 0)), this.disposeWithMe(this.filterItems$.subscribe((i) => this._filterItems = i));
|
|
938
938
|
}
|
|
939
939
|
/**
|
|
940
940
|
* Create a model with targeting filter column. If there is not a filter column, the model would be created with
|
|
@@ -947,39 +947,39 @@ let Le = class extends de {
|
|
|
947
947
|
* @returns the model to control the panel's state
|
|
948
948
|
*/
|
|
949
949
|
static async fromFilterColumn(e, r, s) {
|
|
950
|
-
const n = e.get(
|
|
950
|
+
const n = e.get(Be), a = e.get(X), i = e.get(we, wt.OPTIONAL), { unitId: o, subUnitId: l } = r, c = n.getUniverSheetInstance(o);
|
|
951
951
|
if (!c) throw new Error(`[ByValuesModel]: Workbook not found for filter model with unitId: ${o}!`);
|
|
952
952
|
const h = c == null ? void 0 : c.getSheetBySheetId(l);
|
|
953
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,
|
|
954
|
+
const d = r.getRange(), C = s, f = r.getFilterColumn(s), _ = f == null ? void 0 : f.getColumnData().filters, S = new Set(_ == null ? void 0 : _.filters), E = !!(_ && _.blank), N = r.getFilteredOutRowsExceptCol(s), b = { ...d, startRow: d.startRow + 1, startColumn: C, endColumn: C };
|
|
955
955
|
let F, R;
|
|
956
956
|
if (i) {
|
|
957
|
-
const
|
|
957
|
+
const L = await i.getFilterValues({
|
|
958
958
|
unitId: o,
|
|
959
959
|
subUnitId: l,
|
|
960
|
-
filteredOutRowsByOtherColumns: Array.from(
|
|
961
|
-
filterColumn:
|
|
960
|
+
filteredOutRowsByOtherColumns: Array.from(N),
|
|
961
|
+
filterColumn: f,
|
|
962
962
|
filters: !!_,
|
|
963
|
-
blankChecked:
|
|
963
|
+
blankChecked: E,
|
|
964
964
|
iterateRange: b,
|
|
965
965
|
alreadyChecked: Array.from(S)
|
|
966
966
|
});
|
|
967
|
-
F =
|
|
967
|
+
F = L.filterTreeItems, R = L.filterTreeMapCache;
|
|
968
968
|
} else {
|
|
969
|
-
const
|
|
969
|
+
const L = jt(
|
|
970
970
|
!!_,
|
|
971
971
|
a,
|
|
972
972
|
b,
|
|
973
973
|
h,
|
|
974
|
-
E,
|
|
975
|
-
v,
|
|
976
|
-
S,
|
|
977
974
|
N,
|
|
975
|
+
f,
|
|
976
|
+
S,
|
|
977
|
+
E,
|
|
978
978
|
c.getStyles()
|
|
979
979
|
);
|
|
980
|
-
F =
|
|
980
|
+
F = L.filterTreeItems, R = L.filterTreeMapCache;
|
|
981
981
|
}
|
|
982
|
-
return e.createInstance(
|
|
982
|
+
return e.createInstance(Me, r, s, F, R);
|
|
983
983
|
}
|
|
984
984
|
get rawFilterItems() {
|
|
985
985
|
return this._rawFilterItems$.getValue();
|
|
@@ -1007,16 +1007,16 @@ let Le = class extends de {
|
|
|
1007
1007
|
* Toggle a filter item.
|
|
1008
1008
|
*/
|
|
1009
1009
|
onFilterCheckToggled(e) {
|
|
1010
|
-
const r = Re.deepClone(this._filterItems), s =
|
|
1010
|
+
const r = Re.deepClone(this._filterItems), s = et(r, e.key);
|
|
1011
1011
|
if (!s)
|
|
1012
1012
|
return;
|
|
1013
|
-
const n =
|
|
1013
|
+
const n = Gt(s);
|
|
1014
1014
|
ge(s, !n), this._manuallyUpdateFilterItems(r);
|
|
1015
1015
|
}
|
|
1016
1016
|
onFilterOnly(e) {
|
|
1017
1017
|
const r = Re.deepClone(this._filterItems);
|
|
1018
1018
|
r.forEach((s) => ge(s, !1)), e.forEach((s) => {
|
|
1019
|
-
const n =
|
|
1019
|
+
const n = et(r, s);
|
|
1020
1020
|
n && ge(n, !0);
|
|
1021
1021
|
}), this._manuallyUpdateFilterItems(r);
|
|
1022
1022
|
}
|
|
@@ -1039,7 +1039,7 @@ let Le = class extends de {
|
|
|
1039
1039
|
async apply() {
|
|
1040
1040
|
if (this._disposed)
|
|
1041
1041
|
return !1;
|
|
1042
|
-
const e =
|
|
1042
|
+
const e = ze(this._filterItems), { checked: r, checkedItems: s } = e, n = this.rawFilterItems;
|
|
1043
1043
|
let a = 0;
|
|
1044
1044
|
for (const c of n)
|
|
1045
1045
|
a += c.count;
|
|
@@ -1069,17 +1069,17 @@ let Le = class extends de {
|
|
|
1069
1069
|
}
|
|
1070
1070
|
// #endregion
|
|
1071
1071
|
};
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
],
|
|
1072
|
+
Me = Ve([
|
|
1073
|
+
Te(4, j)
|
|
1074
|
+
], Me);
|
|
1075
1075
|
let $e = class extends de {
|
|
1076
1076
|
constructor(e, r, s, n, a) {
|
|
1077
1077
|
super();
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1078
|
+
v(this, "canApply$", me(!0));
|
|
1079
|
+
v(this, "_cellFillColors$");
|
|
1080
|
+
v(this, "cellFillColors$");
|
|
1081
|
+
v(this, "_cellTextColors$");
|
|
1082
|
+
v(this, "cellTextColors$");
|
|
1083
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
1084
|
}
|
|
1085
1085
|
/**
|
|
@@ -1094,28 +1094,28 @@ let $e = class extends de {
|
|
|
1094
1094
|
*/
|
|
1095
1095
|
static async fromFilterColumn(e, r, s) {
|
|
1096
1096
|
var b, F, R;
|
|
1097
|
-
const n = e.get(
|
|
1097
|
+
const n = e.get(Be), { unitId: a, subUnitId: i } = r, o = n.getUniverSheetInstance(a);
|
|
1098
1098
|
if (!o) throw new Error(`[ByColorsModel]: Workbook not found for filter model with unitId: ${a}!`);
|
|
1099
1099
|
const l = o == null ? void 0 : o.getSheetBySheetId(i);
|
|
1100
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),
|
|
1102
|
-
for (const
|
|
1103
|
-
const { row:
|
|
1104
|
-
if (C.has(
|
|
1101
|
+
const c = r.getRange(), h = s, d = (b = r.getFilterColumn(s)) == null ? void 0 : b.getColumnData().colorFilters, C = r.getFilteredOutRowsExceptCol(s), f = { ...c, startRow: c.startRow + 1, startColumn: h, endColumn: h }, _ = /* @__PURE__ */ new Map(), S = new Set((F = d == null ? void 0 : d.cellFillColors) != null ? F : []), E = /* @__PURE__ */ new Map(), N = new Set((R = d == null ? void 0 : d.cellTextColors) != null ? R : []);
|
|
1102
|
+
for (const L of l.iterateByColumn(f, !1, !0)) {
|
|
1103
|
+
const { row: G, col: Y, value: ne } = L;
|
|
1104
|
+
if (C.has(G))
|
|
1105
1105
|
continue;
|
|
1106
|
-
const
|
|
1107
|
-
if (
|
|
1108
|
-
const
|
|
1109
|
-
_.has(
|
|
1106
|
+
const x = l.getComposedCellStyleByCellData(G, Y, ne);
|
|
1107
|
+
if (x.bg && x.bg.rgb) {
|
|
1108
|
+
const A = new pt(x.bg.rgb).toRgbString();
|
|
1109
|
+
_.has(A) || _.set(A, { color: A, checked: S.has(A) });
|
|
1110
1110
|
} else
|
|
1111
1111
|
_.set("default-fill-color", { color: null, checked: S.has(null) });
|
|
1112
|
-
if (
|
|
1113
|
-
const
|
|
1114
|
-
|
|
1112
|
+
if (x.cl && x.cl.rgb) {
|
|
1113
|
+
const A = new pt(x.cl.rgb).toRgbString();
|
|
1114
|
+
E.has(A) || E.set(A, { color: A, checked: N.has(A) });
|
|
1115
1115
|
} else
|
|
1116
|
-
|
|
1116
|
+
E.set("default-font-color", { color: gt, checked: N.has(gt) });
|
|
1117
1117
|
}
|
|
1118
|
-
return e.createInstance($e, r, s, _,
|
|
1118
|
+
return e.createInstance($e, r, s, _, E);
|
|
1119
1119
|
}
|
|
1120
1120
|
get cellFillColors() {
|
|
1121
1121
|
return this._cellFillColors$.getValue();
|
|
@@ -1195,35 +1195,35 @@ let $e = class extends de {
|
|
|
1195
1195
|
}
|
|
1196
1196
|
// #endregion
|
|
1197
1197
|
};
|
|
1198
|
-
$e =
|
|
1199
|
-
|
|
1198
|
+
$e = Ve([
|
|
1199
|
+
Te(4, j)
|
|
1200
1200
|
], $e);
|
|
1201
|
-
const ue = "FILTER_PANEL_OPENED",
|
|
1201
|
+
const ue = "FILTER_PANEL_OPENED", xe = {
|
|
1202
1202
|
id: "sheet.operation.open-filter-panel",
|
|
1203
|
-
type:
|
|
1203
|
+
type: We.OPERATION,
|
|
1204
1204
|
handler: (t, e) => {
|
|
1205
|
-
const r = t.get(
|
|
1206
|
-
t.get(j).syncExecuteCommand(
|
|
1205
|
+
const r = t.get(Qe), s = t.get(z), n = t.get(q);
|
|
1206
|
+
t.get(j).syncExecuteCommand(Cr.id, { visible: !1 });
|
|
1207
1207
|
const { unitId: i, subUnitId: o, col: l } = e, c = s.getFilterModel(i, o);
|
|
1208
1208
|
return c ? (n.setupCol(c, l), r.getContextValue(ue) || r.setContextValue(ue, !0), !0) : !1;
|
|
1209
1209
|
}
|
|
1210
1210
|
}, Se = {
|
|
1211
1211
|
id: "sheet.operation.close-filter-panel",
|
|
1212
|
-
type:
|
|
1212
|
+
type: We.OPERATION,
|
|
1213
1213
|
handler: (t) => {
|
|
1214
|
-
const e = t.get(
|
|
1214
|
+
const e = t.get(Qe), r = t.get(q), s = t.get(Pr, wt.OPTIONAL);
|
|
1215
1215
|
return e.getContextValue(ue) ? (e.setContextValue(ue, !1), s == null || s.focus(), r.terminate()) : !1;
|
|
1216
1216
|
}
|
|
1217
|
-
},
|
|
1217
|
+
}, Zt = {
|
|
1218
1218
|
id: "sheet.operation.apply-filter",
|
|
1219
|
-
type:
|
|
1219
|
+
type: We.OPERATION,
|
|
1220
1220
|
handler: (t, e) => {
|
|
1221
1221
|
const { filterBy: r } = e;
|
|
1222
|
-
return t.get(
|
|
1222
|
+
return t.get(q).changeFilterBy(r);
|
|
1223
1223
|
}
|
|
1224
|
-
},
|
|
1225
|
-
var
|
|
1226
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
1224
|
+
}, Kt = "sheets-filter-ui.config", Ue = {};
|
|
1225
|
+
var _i = Object.getOwnPropertyDescriptor, gi = (t, e, r, s) => {
|
|
1226
|
+
for (var n = s > 1 ? void 0 : s ? _i(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
1227
1227
|
(i = t[a]) && (n = i(n) || n);
|
|
1228
1228
|
return n;
|
|
1229
1229
|
}, ae = (t, e) => (r, s) => e(r, s, t);
|
|
@@ -1235,8 +1235,8 @@ let he = class extends de {
|
|
|
1235
1235
|
this.disposeWithMe(
|
|
1236
1236
|
this._commandService.beforeCommandExecuted((t) => {
|
|
1237
1237
|
var e, r, s;
|
|
1238
|
-
if (t.id ===
|
|
1239
|
-
const n = this._injector.get(
|
|
1238
|
+
if (t.id === Ne.id) {
|
|
1239
|
+
const n = this._injector.get(Be), a = Vr(n);
|
|
1240
1240
|
if (!a) return;
|
|
1241
1241
|
const { unitId: i, subUnitId: o, worksheet: l } = a, c = (e = this._sheetsFilterService.getFilterModel(i, o)) == null ? void 0 : e.getRange();
|
|
1242
1242
|
let h;
|
|
@@ -1249,7 +1249,7 @@ let he = class extends de {
|
|
|
1249
1249
|
const d = (r = this._sheetsSelectionService.getCurrentLastSelection()) == null ? void 0 : r.range;
|
|
1250
1250
|
if (d) {
|
|
1251
1251
|
let C = { ...d };
|
|
1252
|
-
C = d.startColumn === d.endColumn && d.startRow === d.endRow ?
|
|
1252
|
+
C = d.startColumn === d.endColumn && d.startRow === d.endRow ? jr(C, { left: !0, right: !0, up: !0, down: !0 }, l) : C, h = this._sheetPermissionCheckPermission.permissionCheckWithRanges({
|
|
1253
1253
|
rangeTypes: [_e],
|
|
1254
1254
|
worksheetTypes: [ve, pe]
|
|
1255
1255
|
}, [C], i, o);
|
|
@@ -1261,7 +1261,7 @@ let he = class extends de {
|
|
|
1261
1261
|
}
|
|
1262
1262
|
h || this._sheetPermissionCheckPermission.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.filterErr"));
|
|
1263
1263
|
}
|
|
1264
|
-
if (t.id ===
|
|
1264
|
+
if (t.id === xe.id) {
|
|
1265
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
1266
|
l && (l.startColumn = n.col, l.endColumn = n.col, this._sheetPermissionCheckPermission.permissionCheckWithRanges({
|
|
1267
1267
|
rangeTypes: [_e],
|
|
@@ -1272,46 +1272,46 @@ let he = class extends de {
|
|
|
1272
1272
|
);
|
|
1273
1273
|
}
|
|
1274
1274
|
};
|
|
1275
|
-
he =
|
|
1276
|
-
ae(0, T(
|
|
1277
|
-
ae(1, T(
|
|
1275
|
+
he = gi([
|
|
1276
|
+
ae(0, T(z)),
|
|
1277
|
+
ae(1, T(X)),
|
|
1278
1278
|
ae(2, j),
|
|
1279
|
-
ae(3, T(
|
|
1280
|
-
ae(4, T(
|
|
1281
|
-
ae(5, T(
|
|
1279
|
+
ae(3, T(Wr)),
|
|
1280
|
+
ae(4, T(ie)),
|
|
1281
|
+
ae(5, T(Qr))
|
|
1282
1282
|
], he);
|
|
1283
|
-
const
|
|
1284
|
-
class
|
|
1283
|
+
const K = 16, Si = new Path2D("M3.30363 3C2.79117 3 2.51457 3.60097 2.84788 3.99024L6.8 8.60593V12.5662C6.8 12.7184 6.8864 12.8575 7.02289 12.9249L8.76717 13.7863C8.96655 13.8847 9.2 13.7396 9.2 13.5173V8.60593L13.1521 3.99024C13.4854 3.60097 13.2088 3 12.6964 3H3.30363Z");
|
|
1284
|
+
class Ft {
|
|
1285
1285
|
static drawNoCriteria(e, r, s, n) {
|
|
1286
|
-
e.save(),
|
|
1286
|
+
e.save(), St.drawWith(e, {
|
|
1287
1287
|
radius: 2,
|
|
1288
|
-
width:
|
|
1289
|
-
height:
|
|
1288
|
+
width: K,
|
|
1289
|
+
height: K,
|
|
1290
1290
|
fill: n
|
|
1291
|
-
}), e.lineCap = "square", e.strokeStyle = s, e.scale(r /
|
|
1291
|
+
}), e.lineCap = "square", e.strokeStyle = s, e.scale(r / K, r / K), 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();
|
|
1292
1292
|
}
|
|
1293
1293
|
static drawHasCriteria(e, r, s, n) {
|
|
1294
|
-
e.save(),
|
|
1294
|
+
e.save(), St.drawWith(e, {
|
|
1295
1295
|
radius: 2,
|
|
1296
|
-
width:
|
|
1297
|
-
height:
|
|
1296
|
+
width: K,
|
|
1297
|
+
height: K,
|
|
1298
1298
|
fill: n
|
|
1299
|
-
}), e.scale(r /
|
|
1299
|
+
}), e.scale(r / K, r / K), e.fillStyle = s, e.fill(Si), e.restore();
|
|
1300
1300
|
}
|
|
1301
1301
|
}
|
|
1302
|
-
var
|
|
1303
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
1302
|
+
var Ci = Object.getOwnPropertyDescriptor, Ti = (t, e, r, s) => {
|
|
1303
|
+
for (var n = s > 1 ? void 0 : s ? Ci(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
1304
1304
|
(i = t[a]) && (n = i(n) || n);
|
|
1305
1305
|
return n;
|
|
1306
|
-
},
|
|
1307
|
-
const
|
|
1308
|
-
let
|
|
1306
|
+
}, qe = (t, e) => (r, s) => e(r, s, t);
|
|
1307
|
+
const B = 16, Ce = 1;
|
|
1308
|
+
let tt = class extends Dr {
|
|
1309
1309
|
constructor(e, r, s, n, a) {
|
|
1310
1310
|
super(e, r);
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1311
|
+
v(this, "_cellWidth", 0);
|
|
1312
|
+
v(this, "_cellHeight", 0);
|
|
1313
|
+
v(this, "_filterParams");
|
|
1314
|
+
v(this, "_hovered", !1);
|
|
1315
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());
|
|
1316
1316
|
}
|
|
1317
1317
|
setShapeProps(e) {
|
|
@@ -1321,19 +1321,19 @@ let Je = class extends Hr {
|
|
|
1321
1321
|
});
|
|
1322
1322
|
}
|
|
1323
1323
|
_draw(e) {
|
|
1324
|
-
const r = this._cellHeight, s = this._cellWidth, n =
|
|
1324
|
+
const r = this._cellHeight, s = this._cellWidth, n = B - s, a = B - r;
|
|
1325
1325
|
e.save();
|
|
1326
1326
|
const i = new Path2D();
|
|
1327
1327
|
i.rect(n, a, s, r), e.clip(i);
|
|
1328
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 ?
|
|
1329
|
+
o ? Ft.drawHasCriteria(e, B, l, c) : Ft.drawNoCriteria(e, B, l, c), e.restore();
|
|
1330
1330
|
}
|
|
1331
1331
|
onPointerDown(e) {
|
|
1332
1332
|
if (e.button === 2)
|
|
1333
1333
|
return;
|
|
1334
1334
|
const { col: r, unitId: s, subUnitId: n } = this._filterParams;
|
|
1335
|
-
this._contextService.getContextValue(ue) || !this._commandService.hasCommand(
|
|
1336
|
-
this._commandService.executeCommand(
|
|
1335
|
+
this._contextService.getContextValue(ue) || !this._commandService.hasCommand(xe.id) || setTimeout(() => {
|
|
1336
|
+
this._commandService.executeCommand(xe.id, {
|
|
1337
1337
|
unitId: s,
|
|
1338
1338
|
subUnitId: n,
|
|
1339
1339
|
col: r
|
|
@@ -1347,23 +1347,34 @@ let Je = class extends Hr {
|
|
|
1347
1347
|
this._hovered = !1, this.makeDirty(!0);
|
|
1348
1348
|
}
|
|
1349
1349
|
};
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
],
|
|
1355
|
-
var
|
|
1356
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
1350
|
+
tt = Ti([
|
|
1351
|
+
qe(2, Qe),
|
|
1352
|
+
qe(3, j),
|
|
1353
|
+
qe(4, T(Lt))
|
|
1354
|
+
], tt);
|
|
1355
|
+
var Ei = Object.getOwnPropertyDescriptor, Ni = (t, e, r, s) => {
|
|
1356
|
+
for (var n = s > 1 ? void 0 : s ? Ei(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
1357
1357
|
(i = t[a]) && (n = i(n) || n);
|
|
1358
1358
|
return n;
|
|
1359
|
-
},
|
|
1360
|
-
const
|
|
1361
|
-
|
|
1359
|
+
}, te = (t, e) => (r, s) => e(r, s, t);
|
|
1360
|
+
const Fi = 1e3, yi = 5e3;
|
|
1361
|
+
function Oi(t, e, r, s) {
|
|
1362
|
+
switch (s) {
|
|
1363
|
+
case Ae.TOP:
|
|
1364
|
+
return t + Ce;
|
|
1365
|
+
case Ae.MIDDLE:
|
|
1366
|
+
return t + Math.max(0, (r - B) / 2);
|
|
1367
|
+
case Ae.BOTTOM:
|
|
1368
|
+
default:
|
|
1369
|
+
return e - B - Ce;
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
let rt = class extends Mt {
|
|
1362
1373
|
constructor(e, r, s, n, a, i, o, l) {
|
|
1363
1374
|
super();
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1375
|
+
v(this, "_filterRangeShape", null);
|
|
1376
|
+
v(this, "_buttonRenderDisposable", null);
|
|
1377
|
+
v(this, "_filterButtonShapes", []);
|
|
1367
1378
|
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();
|
|
1368
1379
|
}
|
|
1369
1380
|
dispose() {
|
|
@@ -1371,7 +1382,7 @@ let et = class extends wt {
|
|
|
1371
1382
|
}
|
|
1372
1383
|
_initRenderer() {
|
|
1373
1384
|
this._sheetSkeletonManagerService.currentSkeleton$.pipe(
|
|
1374
|
-
|
|
1385
|
+
at((e) => {
|
|
1375
1386
|
var o, l;
|
|
1376
1387
|
if (!e) return me(null);
|
|
1377
1388
|
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 = () => ({
|
|
@@ -1381,28 +1392,28 @@ let et = class extends wt {
|
|
|
1381
1392
|
range: a == null ? void 0 : a.getRange(),
|
|
1382
1393
|
skeleton: e.skeleton
|
|
1383
1394
|
});
|
|
1384
|
-
return
|
|
1385
|
-
|
|
1395
|
+
return cr(this._commandService.onCommandExecuted.bind(this._commandService)).pipe(
|
|
1396
|
+
ei(
|
|
1386
1397
|
([c]) => {
|
|
1387
1398
|
var h;
|
|
1388
|
-
return c.type ===
|
|
1399
|
+
return c.type === We.MUTATION && ((h = c.params) == null ? void 0 : h.unitId) === r.getUnitId() && (mr.has(c.id) || c.id === Yr.id);
|
|
1389
1400
|
}
|
|
1390
1401
|
),
|
|
1391
|
-
|
|
1402
|
+
Bt(20, void 0, { leading: !1, trailing: !0 }),
|
|
1392
1403
|
ce(i),
|
|
1393
|
-
|
|
1404
|
+
Wt(i())
|
|
1394
1405
|
// must trigger once
|
|
1395
1406
|
);
|
|
1396
1407
|
}),
|
|
1397
|
-
|
|
1408
|
+
ti(this.dispose$)
|
|
1398
1409
|
).subscribe((e) => {
|
|
1399
1410
|
this._disposeRendering(), !(!e || !e.range) && (this._renderRange(e.range, e.skeleton), this._renderButtons(e));
|
|
1400
1411
|
});
|
|
1401
1412
|
}
|
|
1402
1413
|
_renderRange(e, r) {
|
|
1403
|
-
const { scene: s } = this._context, { rowHeaderWidth: n, columnHeaderHeight: a } = r, i = this._filterRangeShape = new
|
|
1414
|
+
const { scene: s } = this._context, { rowHeaderWidth: n, columnHeaderHeight: a } = r, i = this._filterRangeShape = new Nr(
|
|
1404
1415
|
s,
|
|
1405
|
-
|
|
1416
|
+
Fi,
|
|
1406
1417
|
this._themeService,
|
|
1407
1418
|
{
|
|
1408
1419
|
rowHeaderWidth: n,
|
|
@@ -1410,7 +1421,7 @@ let et = class extends wt {
|
|
|
1410
1421
|
enableAutoFill: !1,
|
|
1411
1422
|
highlightHeader: !1
|
|
1412
1423
|
}
|
|
1413
|
-
), l =
|
|
1424
|
+
), l = Fr({
|
|
1414
1425
|
range: e,
|
|
1415
1426
|
primary: null,
|
|
1416
1427
|
style: { fill: "rgba(0, 0, 0, 0.0)" }
|
|
@@ -1418,36 +1429,38 @@ let et = class extends wt {
|
|
|
1418
1429
|
i.updateRangeBySelectionWithCoord(l), i.setEvent(!1), s.makeDirty(!0);
|
|
1419
1430
|
}
|
|
1420
1431
|
_renderButtons(e) {
|
|
1421
|
-
const { range: r, filterModel: s, unitId: n, skeleton: a, worksheetId: i } = e, {
|
|
1432
|
+
const { range: r, filterModel: s, unitId: n, skeleton: a, worksheetId: i } = e, { unit: o, scene: l } = this._context, c = o.getSheetBySheetId(i);
|
|
1433
|
+
if (!c)
|
|
1434
|
+
return;
|
|
1422
1435
|
this._interceptCellContent(n, i, e.range);
|
|
1423
|
-
const { startColumn:
|
|
1424
|
-
for (let
|
|
1425
|
-
const
|
|
1426
|
-
if (
|
|
1436
|
+
const { startColumn: h, endColumn: d, startRow: C } = r;
|
|
1437
|
+
for (let f = h; f <= d; f++) {
|
|
1438
|
+
const _ = `sheets-filter-button-${f}`, S = yr(C, f, l, a), E = c.getComposedCellStyle(C, f), N = (E == null ? void 0 : E.vt) || Ae.BOTTOM, { startX: b, startY: F, endX: R, endY: L } = S, G = R - b, Y = L - F;
|
|
1439
|
+
if (Y <= Ce || G <= Ce)
|
|
1427
1440
|
continue;
|
|
1428
|
-
const
|
|
1429
|
-
left:
|
|
1430
|
-
top:
|
|
1431
|
-
height:
|
|
1432
|
-
width:
|
|
1433
|
-
zIndex:
|
|
1434
|
-
cellHeight:
|
|
1435
|
-
cellWidth:
|
|
1436
|
-
filterParams: { unitId: n, subUnitId: i, col:
|
|
1437
|
-
},
|
|
1438
|
-
this._filterButtonShapes.push(
|
|
1441
|
+
const ne = !!s.getFilterColumn(f), x = R - B - Ce, A = Oi(F, L, Y, N), P = {
|
|
1442
|
+
left: x,
|
|
1443
|
+
top: A,
|
|
1444
|
+
height: B,
|
|
1445
|
+
width: B,
|
|
1446
|
+
zIndex: yi,
|
|
1447
|
+
cellHeight: Y,
|
|
1448
|
+
cellWidth: G,
|
|
1449
|
+
filterParams: { unitId: n, subUnitId: i, col: f, hasCriteria: ne }
|
|
1450
|
+
}, je = this._injector.createInstance(tt, _, P);
|
|
1451
|
+
this._filterButtonShapes.push(je);
|
|
1439
1452
|
}
|
|
1440
|
-
|
|
1453
|
+
l.addObjects(this._filterButtonShapes), l.makeDirty();
|
|
1441
1454
|
}
|
|
1442
1455
|
_interceptCellContent(e, r, s) {
|
|
1443
1456
|
const { startRow: n, startColumn: a, endColumn: i } = s;
|
|
1444
|
-
this._buttonRenderDisposable = this._sheetInterceptorService.intercept(
|
|
1445
|
-
effect:
|
|
1457
|
+
this._buttonRenderDisposable = this._sheetInterceptorService.intercept(Zr.CELL_CONTENT, {
|
|
1458
|
+
effect: ur.Style,
|
|
1446
1459
|
handler: (o, l, c) => {
|
|
1447
|
-
const { row: h, col: d, unitId: C, subUnitId:
|
|
1448
|
-
return C !== e ||
|
|
1460
|
+
const { row: h, col: d, unitId: C, subUnitId: f } = l;
|
|
1461
|
+
return C !== e || f !== r || h !== n || d < a || d > i || ((!o || o === l.rawData) && (o = { ...l.rawData }), o.fontRenderExtension = {
|
|
1449
1462
|
...o == null ? void 0 : o.fontRenderExtension,
|
|
1450
|
-
rightOffset:
|
|
1463
|
+
rightOffset: B
|
|
1451
1464
|
}), c(o);
|
|
1452
1465
|
},
|
|
1453
1466
|
priority: 10
|
|
@@ -1458,99 +1471,99 @@ let et = class extends wt {
|
|
|
1458
1471
|
(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 = [];
|
|
1459
1472
|
}
|
|
1460
1473
|
};
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
],
|
|
1470
|
-
var
|
|
1471
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
1474
|
+
rt = Ni([
|
|
1475
|
+
te(1, T(ie)),
|
|
1476
|
+
te(2, T(Tr)),
|
|
1477
|
+
te(3, T(z)),
|
|
1478
|
+
te(4, T(Lt)),
|
|
1479
|
+
te(5, T(Gr)),
|
|
1480
|
+
te(6, j),
|
|
1481
|
+
te(7, Er)
|
|
1482
|
+
], rt);
|
|
1483
|
+
var Ii = Object.getOwnPropertyDescriptor, bi = (t, e, r, s) => {
|
|
1484
|
+
for (var n = s > 1 ? void 0 : s ? Ii(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
1472
1485
|
(i = t[a]) && (n = i(n) || n);
|
|
1473
1486
|
return n;
|
|
1474
|
-
},
|
|
1475
|
-
let
|
|
1487
|
+
}, yt = (t, e) => (r, s) => e(r, s, t);
|
|
1488
|
+
let Ee = class extends Mt {
|
|
1476
1489
|
constructor(t, e) {
|
|
1477
1490
|
super(), this._renderManagerService = t, this._sheetsRenderService = e, [
|
|
1478
|
-
mr,
|
|
1479
1491
|
fr,
|
|
1480
1492
|
pr,
|
|
1481
|
-
vr
|
|
1493
|
+
vr,
|
|
1494
|
+
_r
|
|
1482
1495
|
].forEach((r) => this.disposeWithMe(this._sheetsRenderService.registerSkeletonChangingMutations(r.id))), this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
1483
|
-
|
|
1484
|
-
[
|
|
1496
|
+
se.UNIVER_SHEET,
|
|
1497
|
+
[rt]
|
|
1485
1498
|
));
|
|
1486
1499
|
}
|
|
1487
1500
|
};
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
],
|
|
1492
|
-
var
|
|
1493
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
1501
|
+
Ee = bi([
|
|
1502
|
+
yt(0, Dt),
|
|
1503
|
+
yt(1, T(Ht))
|
|
1504
|
+
], Ee);
|
|
1505
|
+
var Ri = Object.defineProperty, Ai = Object.getOwnPropertyDescriptor, Pi = (t, e, r) => e in t ? Ri(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, wi = (t, e, r, s) => {
|
|
1506
|
+
for (var n = s > 1 ? void 0 : s ? Ai(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
1494
1507
|
(i = t[a]) && (n = i(n) || n);
|
|
1495
1508
|
return n;
|
|
1496
|
-
},
|
|
1497
|
-
const
|
|
1498
|
-
let
|
|
1499
|
-
constructor(t =
|
|
1509
|
+
}, Ot = (t, e) => (r, s) => e(r, s, t), qt = (t, e, r) => Pi(t, typeof e != "symbol" ? e + "" : e, r);
|
|
1510
|
+
const Li = "SHEET_FILTER_UI_PLUGIN";
|
|
1511
|
+
let ke = class extends it {
|
|
1512
|
+
constructor(t = Ue, e, r) {
|
|
1500
1513
|
super(), this._config = t, this._injector = e, this._configService = r;
|
|
1501
|
-
const { menu: s, ...n } =
|
|
1514
|
+
const { menu: s, ...n } = Ut(
|
|
1502
1515
|
{},
|
|
1503
|
-
|
|
1516
|
+
Ue,
|
|
1504
1517
|
this._config
|
|
1505
1518
|
);
|
|
1506
|
-
s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(
|
|
1519
|
+
s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(Kt, n);
|
|
1507
1520
|
}
|
|
1508
1521
|
onStarting() {
|
|
1509
1522
|
[
|
|
1510
1523
|
[he],
|
|
1511
|
-
[
|
|
1524
|
+
[Ee]
|
|
1512
1525
|
].forEach((t) => this._injector.add(t));
|
|
1513
1526
|
}
|
|
1514
1527
|
onReady() {
|
|
1515
1528
|
this._injector.get(he);
|
|
1516
1529
|
}
|
|
1517
1530
|
onRendered() {
|
|
1518
|
-
this._injector.get(
|
|
1531
|
+
this._injector.get(Ee);
|
|
1519
1532
|
}
|
|
1520
1533
|
};
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
],
|
|
1528
|
-
var
|
|
1529
|
-
return
|
|
1534
|
+
qt(ke, "type", se.UNIVER_SHEET);
|
|
1535
|
+
qt(ke, "pluginName", Li);
|
|
1536
|
+
ke = wi([
|
|
1537
|
+
$t(kt),
|
|
1538
|
+
Ot(1, T(ie)),
|
|
1539
|
+
Ot(2, xt)
|
|
1540
|
+
], ke);
|
|
1541
|
+
var $ = function() {
|
|
1542
|
+
return $ = Object.assign || function(t) {
|
|
1530
1543
|
for (var e, r = 1, s = arguments.length; r < s; r++) {
|
|
1531
1544
|
e = arguments[r];
|
|
1532
1545
|
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]);
|
|
1533
1546
|
}
|
|
1534
1547
|
return t;
|
|
1535
|
-
},
|
|
1536
|
-
},
|
|
1548
|
+
}, $.apply(this, arguments);
|
|
1549
|
+
}, Mi = function(t, e) {
|
|
1537
1550
|
var r = {};
|
|
1538
1551
|
for (var s in t) Object.prototype.hasOwnProperty.call(t, s) && e.indexOf(s) < 0 && (r[s] = t[s]);
|
|
1539
1552
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
1540
1553
|
for (var n = 0, s = Object.getOwnPropertySymbols(t); n < s.length; n++)
|
|
1541
1554
|
e.indexOf(s[n]) < 0 && Object.prototype.propertyIsEnumerable.call(t, s[n]) && (r[s[n]] = t[s[n]]);
|
|
1542
1555
|
return r;
|
|
1543
|
-
},
|
|
1544
|
-
var r = t.icon, s = t.id, n = t.className, a = t.extend, i =
|
|
1545
|
-
return
|
|
1556
|
+
}, Oe = Fe(function(t, e) {
|
|
1557
|
+
var r = t.icon, s = t.id, n = t.className, a = t.extend, i = Mi(t, ["icon", "id", "className", "extend"]), o = "univerjs-icon univerjs-icon-".concat(s, " ").concat(n || "").trim(), l = ui("_".concat(Ui()));
|
|
1558
|
+
return Xt(r, "".concat(s), { defIds: r.defIds, idSuffix: l.current }, $({ ref: e, className: o }, i), a);
|
|
1546
1559
|
});
|
|
1547
|
-
function
|
|
1548
|
-
return
|
|
1549
|
-
return
|
|
1560
|
+
function Xt(t, e, r, s, n) {
|
|
1561
|
+
return ye(t.tag, $($({ key: e }, $i(t, r, n)), s), (xi(t, r).children || []).map(function(a, i) {
|
|
1562
|
+
return Xt(a, "".concat(e, "-").concat(t.tag, "-").concat(i), r, void 0, n);
|
|
1550
1563
|
}));
|
|
1551
1564
|
}
|
|
1552
|
-
function
|
|
1553
|
-
var s =
|
|
1565
|
+
function $i(t, e, r) {
|
|
1566
|
+
var s = $({}, t.attrs);
|
|
1554
1567
|
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
1568
|
var i = a[0], o = a[1];
|
|
1556
1569
|
i === "mask" && typeof o == "string" && (s[i] = o.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
@@ -1561,55 +1574,55 @@ function Li(t, e, r) {
|
|
|
1561
1574
|
typeof o == "string" && (s[i] = o.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
1562
1575
|
})), s;
|
|
1563
1576
|
}
|
|
1564
|
-
function
|
|
1577
|
+
function xi(t, e) {
|
|
1565
1578
|
var r, s = e.defIds;
|
|
1566
|
-
return !s || s.length === 0 ? t : t.tag === "defs" && (!((r = t.children) === null || r === void 0) && r.length) ?
|
|
1567
|
-
return typeof n.attrs.id == "string" && s && s.includes(n.attrs.id) ?
|
|
1579
|
+
return !s || s.length === 0 ? t : t.tag === "defs" && (!((r = t.children) === null || r === void 0) && r.length) ? $($({}, t), { children: t.children.map(function(n) {
|
|
1580
|
+
return typeof n.attrs.id == "string" && s && s.includes(n.attrs.id) ? $($({}, n), { attrs: $($({}, n.attrs), { id: n.attrs.id + e.idSuffix }) }) : n;
|
|
1568
1581
|
}) }) : t;
|
|
1569
1582
|
}
|
|
1570
|
-
function
|
|
1583
|
+
function Ui() {
|
|
1571
1584
|
return Math.random().toString(36).substring(2, 8);
|
|
1572
1585
|
}
|
|
1573
|
-
|
|
1574
|
-
var
|
|
1575
|
-
return
|
|
1586
|
+
Oe.displayName = "UniverIcon";
|
|
1587
|
+
var ki = { 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" } }] }, zt = Fe(function(t, e) {
|
|
1588
|
+
return ye(Oe, Object.assign({}, t, {
|
|
1576
1589
|
id: "a-icon",
|
|
1577
1590
|
ref: e,
|
|
1578
|
-
icon:
|
|
1591
|
+
icon: ki
|
|
1579
1592
|
}));
|
|
1580
1593
|
});
|
|
1581
|
-
|
|
1582
|
-
var
|
|
1583
|
-
return
|
|
1594
|
+
zt.displayName = "AIcon";
|
|
1595
|
+
var Hi = { 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" } }] }, Jt = Fe(function(t, e) {
|
|
1596
|
+
return ye(Oe, Object.assign({}, t, {
|
|
1584
1597
|
id: "ban-icon",
|
|
1585
1598
|
ref: e,
|
|
1586
|
-
icon:
|
|
1599
|
+
icon: Hi
|
|
1587
1600
|
}));
|
|
1588
1601
|
});
|
|
1589
|
-
|
|
1590
|
-
var
|
|
1591
|
-
return
|
|
1602
|
+
Jt.displayName = "BanIcon";
|
|
1603
|
+
var Di = { 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" } }] }, er = Fe(function(t, e) {
|
|
1604
|
+
return ye(Oe, Object.assign({}, t, {
|
|
1592
1605
|
id: "filter-icon",
|
|
1593
1606
|
ref: e,
|
|
1594
|
-
icon:
|
|
1607
|
+
icon: Di
|
|
1595
1608
|
}));
|
|
1596
1609
|
});
|
|
1597
|
-
|
|
1598
|
-
var
|
|
1599
|
-
return
|
|
1610
|
+
er.displayName = "FilterIcon";
|
|
1611
|
+
var Bi = { 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" } }] }, tr = Fe(function(t, e) {
|
|
1612
|
+
return ye(Oe, Object.assign({}, t, {
|
|
1600
1613
|
id: "success-icon",
|
|
1601
1614
|
ref: e,
|
|
1602
|
-
icon:
|
|
1615
|
+
icon: Bi
|
|
1603
1616
|
}));
|
|
1604
1617
|
});
|
|
1605
|
-
|
|
1606
|
-
function
|
|
1607
|
-
const { model: e } = t, r =
|
|
1618
|
+
tr.displayName = "SuccessIcon";
|
|
1619
|
+
function Wi(t) {
|
|
1620
|
+
const { model: e } = t, r = re(X), s = D(e.cellFillColors$, [], !0), n = D(e.cellTextColors$, [], !0), a = k((o) => {
|
|
1608
1621
|
e.onFilterCheckToggled(o);
|
|
1609
|
-
}, [e]), i =
|
|
1622
|
+
}, [e]), i = k((o) => {
|
|
1610
1623
|
e.onFilterCheckToggled(o, !1);
|
|
1611
1624
|
}, [e]);
|
|
1612
|
-
return /* @__PURE__ */
|
|
1625
|
+
return /* @__PURE__ */ p(
|
|
1613
1626
|
"div",
|
|
1614
1627
|
{
|
|
1615
1628
|
"data-u-comp": "sheets-filter-panel-colors-container",
|
|
@@ -1618,17 +1631,17 @@ function Di(t) {
|
|
|
1618
1631
|
"div",
|
|
1619
1632
|
{
|
|
1620
1633
|
"data-u-comp": "sheets-filter-panel",
|
|
1621
|
-
className:
|
|
1634
|
+
className: Pe("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", ct),
|
|
1622
1635
|
children: [
|
|
1623
1636
|
s.length > 1 && /* @__PURE__ */ I("div", { children: [
|
|
1624
|
-
/* @__PURE__ */
|
|
1637
|
+
/* @__PURE__ */ p(
|
|
1625
1638
|
"div",
|
|
1626
1639
|
{
|
|
1627
1640
|
className: "univer-mb-2 univer-text-sm univer-text-gray-900 dark:!univer-text-white",
|
|
1628
1641
|
children: r.t("sheets-filter.panel.filter-by-cell-fill-color")
|
|
1629
1642
|
}
|
|
1630
1643
|
),
|
|
1631
|
-
/* @__PURE__ */
|
|
1644
|
+
/* @__PURE__ */ p(
|
|
1632
1645
|
"div",
|
|
1633
1646
|
{
|
|
1634
1647
|
className: "univer-grid univer-grid-cols-8 univer-items-center univer-justify-start univer-gap-2",
|
|
@@ -1638,20 +1651,20 @@ function Di(t) {
|
|
|
1638
1651
|
className: "univer-relative univer-h-6 univer-w-6",
|
|
1639
1652
|
onClick: () => a(o),
|
|
1640
1653
|
children: [
|
|
1641
|
-
o.color ? /* @__PURE__ */
|
|
1654
|
+
o.color ? /* @__PURE__ */ p(
|
|
1642
1655
|
"button",
|
|
1643
1656
|
{
|
|
1644
1657
|
type: "button",
|
|
1645
|
-
className:
|
|
1658
|
+
className: Pe("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
1659
|
style: { backgroundColor: o.color }
|
|
1647
1660
|
}
|
|
1648
|
-
) : /* @__PURE__ */
|
|
1649
|
-
|
|
1661
|
+
) : /* @__PURE__ */ p(
|
|
1662
|
+
Jt,
|
|
1650
1663
|
{
|
|
1651
1664
|
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
1665
|
}
|
|
1653
1666
|
),
|
|
1654
|
-
o.checked && /* @__PURE__ */
|
|
1667
|
+
o.checked && /* @__PURE__ */ p(It, {})
|
|
1655
1668
|
]
|
|
1656
1669
|
},
|
|
1657
1670
|
`sheets-filter-cell-fill-color-${l}`
|
|
@@ -1660,14 +1673,14 @@ function Di(t) {
|
|
|
1660
1673
|
)
|
|
1661
1674
|
] }),
|
|
1662
1675
|
n.length > 1 && /* @__PURE__ */ I("div", { children: [
|
|
1663
|
-
/* @__PURE__ */
|
|
1676
|
+
/* @__PURE__ */ p(
|
|
1664
1677
|
"div",
|
|
1665
1678
|
{
|
|
1666
1679
|
className: "univer-mb-2 univer-text-sm univer-text-gray-900 dark:!univer-text-white",
|
|
1667
1680
|
children: r.t("sheets-filter.panel.filter-by-cell-text-color")
|
|
1668
1681
|
}
|
|
1669
1682
|
),
|
|
1670
|
-
/* @__PURE__ */
|
|
1683
|
+
/* @__PURE__ */ p(
|
|
1671
1684
|
"div",
|
|
1672
1685
|
{
|
|
1673
1686
|
className: "univer-grid univer-grid-cols-8 univer-items-center univer-justify-start univer-gap-2",
|
|
@@ -1677,14 +1690,14 @@ function Di(t) {
|
|
|
1677
1690
|
className: "univer-relative univer-h-6 univer-w-6",
|
|
1678
1691
|
onClick: () => i(o),
|
|
1679
1692
|
children: [
|
|
1680
|
-
/* @__PURE__ */
|
|
1693
|
+
/* @__PURE__ */ p(
|
|
1681
1694
|
"div",
|
|
1682
1695
|
{
|
|
1683
1696
|
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__ */
|
|
1697
|
+
children: /* @__PURE__ */ p(zt, { style: { color: o.color } })
|
|
1685
1698
|
}
|
|
1686
1699
|
),
|
|
1687
|
-
o.checked && /* @__PURE__ */
|
|
1700
|
+
o.checked && /* @__PURE__ */ p(It, {})
|
|
1688
1701
|
]
|
|
1689
1702
|
},
|
|
1690
1703
|
`sheets-filter-cell-text-color-${l}`
|
|
@@ -1692,7 +1705,7 @@ function Di(t) {
|
|
|
1692
1705
|
}
|
|
1693
1706
|
)
|
|
1694
1707
|
] }),
|
|
1695
|
-
s.length <= 1 && n.length <= 1 && /* @__PURE__ */
|
|
1708
|
+
s.length <= 1 && n.length <= 1 && /* @__PURE__ */ p(
|
|
1696
1709
|
"div",
|
|
1697
1710
|
{
|
|
1698
1711
|
className: "univer-flex univer-h-full univer-w-full univer-items-center univer-justify-center univer-text-sm univer-text-gray-900 dark:!univer-text-gray-200",
|
|
@@ -1705,13 +1718,13 @@ function Di(t) {
|
|
|
1705
1718
|
}
|
|
1706
1719
|
);
|
|
1707
1720
|
}
|
|
1708
|
-
function
|
|
1709
|
-
return /* @__PURE__ */
|
|
1721
|
+
function It() {
|
|
1722
|
+
return /* @__PURE__ */ p(
|
|
1710
1723
|
"div",
|
|
1711
1724
|
{
|
|
1712
1725
|
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__ */
|
|
1714
|
-
|
|
1726
|
+
children: /* @__PURE__ */ p(
|
|
1727
|
+
tr,
|
|
1715
1728
|
{
|
|
1716
1729
|
className: "univer-h-full univer-w-full univer-font-bold univer-text-[#418F1F]"
|
|
1717
1730
|
}
|
|
@@ -1719,55 +1732,55 @@ function yt() {
|
|
|
1719
1732
|
}
|
|
1720
1733
|
);
|
|
1721
1734
|
}
|
|
1722
|
-
function
|
|
1723
|
-
var
|
|
1724
|
-
const { model: e } = t, r =
|
|
1735
|
+
function Qi(t) {
|
|
1736
|
+
var f, _;
|
|
1737
|
+
const { model: e } = t, r = re(X), s = D(e.conditionItem$, void 0), n = D(e.filterConditionFormParams$, void 0), a = n != null && n.and ? "AND" : "OR", i = k((S) => {
|
|
1725
1738
|
e.onConditionFormChange({ and: S === "AND" });
|
|
1726
|
-
}, [e]), o =
|
|
1739
|
+
}, [e]), o = Vi(r), l = k((S) => {
|
|
1727
1740
|
e.onPrimaryConditionChange(S);
|
|
1728
|
-
}, [e]), c =
|
|
1741
|
+
}, [e]), c = ji(r), h = k((S) => {
|
|
1729
1742
|
e.onConditionFormChange(S);
|
|
1730
1743
|
}, [e]), d = r.t("sheets-filter.panel.input-values-placeholder");
|
|
1731
|
-
function C(S,
|
|
1744
|
+
function C(S, E, N) {
|
|
1732
1745
|
const b = m.getItemByOperator(S).numOfParameters === 1;
|
|
1733
|
-
return /* @__PURE__ */ I(
|
|
1734
|
-
|
|
1735
|
-
/* @__PURE__ */
|
|
1736
|
-
/* @__PURE__ */
|
|
1746
|
+
return /* @__PURE__ */ I(Et, { children: [
|
|
1747
|
+
N === "operator2" && /* @__PURE__ */ I(ni, { value: a, onChange: i, children: [
|
|
1748
|
+
/* @__PURE__ */ p(Tt, { value: "AND", children: r.t("sheets-filter.panel.and") }),
|
|
1749
|
+
/* @__PURE__ */ p(Tt, { value: "OR", children: r.t("sheets-filter.panel.or") })
|
|
1737
1750
|
] }),
|
|
1738
|
-
/* @__PURE__ */
|
|
1739
|
-
|
|
1751
|
+
/* @__PURE__ */ p(
|
|
1752
|
+
Ct,
|
|
1740
1753
|
{
|
|
1741
1754
|
value: S,
|
|
1742
1755
|
options: c,
|
|
1743
|
-
onChange: (F) => h({ [
|
|
1756
|
+
onChange: (F) => h({ [N]: F })
|
|
1744
1757
|
}
|
|
1745
1758
|
),
|
|
1746
|
-
b && /* @__PURE__ */
|
|
1747
|
-
|
|
1759
|
+
b && /* @__PURE__ */ p("div", { children: /* @__PURE__ */ p(
|
|
1760
|
+
Vt,
|
|
1748
1761
|
{
|
|
1749
1762
|
className: "univer-mt-2",
|
|
1750
|
-
value:
|
|
1763
|
+
value: E,
|
|
1751
1764
|
placeholder: d,
|
|
1752
|
-
onChange: (F) => h({ [
|
|
1765
|
+
onChange: (F) => h({ [N === "operator1" ? "val1" : "val2"]: F })
|
|
1753
1766
|
}
|
|
1754
1767
|
) })
|
|
1755
1768
|
] });
|
|
1756
1769
|
}
|
|
1757
|
-
return /* @__PURE__ */
|
|
1770
|
+
return /* @__PURE__ */ p(
|
|
1758
1771
|
"div",
|
|
1759
1772
|
{
|
|
1760
1773
|
"data-u-comp": "sheets-filter-panel-conditions-container",
|
|
1761
1774
|
className: "univer-flex univer-h-full univer-min-h-[300px] univer-flex-col",
|
|
1762
|
-
children: s && n && /* @__PURE__ */ I(
|
|
1763
|
-
/* @__PURE__ */
|
|
1775
|
+
children: s && n && /* @__PURE__ */ I(Et, { children: [
|
|
1776
|
+
/* @__PURE__ */ p(Ct, { value: s.operator, options: o, onChange: l }),
|
|
1764
1777
|
m.getItemByOperator(s.operator).numOfParameters !== 0 ? /* @__PURE__ */ I(
|
|
1765
1778
|
"div",
|
|
1766
1779
|
{
|
|
1767
1780
|
"data-u-comp": "sheets-filter-panel-conditions-container-inner",
|
|
1768
|
-
className:
|
|
1781
|
+
className: Pe("univer-mt-2 univer-flex-grow univer-overflow-hidden univer-rounded-md univer-p-2", ct),
|
|
1769
1782
|
children: [
|
|
1770
|
-
s.numOfParameters >= 1 && C(n.operator1, (
|
|
1783
|
+
s.numOfParameters >= 1 && C(n.operator1, (f = n.val1) != null ? f : "", "operator1"),
|
|
1771
1784
|
s.numOfParameters >= 2 && C(n.operator2, (_ = n.val2) != null ? _ : "", "operator2"),
|
|
1772
1785
|
/* @__PURE__ */ I(
|
|
1773
1786
|
"div",
|
|
@@ -1776,7 +1789,7 @@ function Bi(t) {
|
|
|
1776
1789
|
className: "univer-mt-2 univer-text-xs univer-text-gray-500",
|
|
1777
1790
|
children: [
|
|
1778
1791
|
r.t("sheets-filter.panel.?"),
|
|
1779
|
-
/* @__PURE__ */
|
|
1792
|
+
/* @__PURE__ */ p("br", {}),
|
|
1780
1793
|
r.t("sheets-filter.panel.*")
|
|
1781
1794
|
]
|
|
1782
1795
|
}
|
|
@@ -1788,9 +1801,9 @@ function Bi(t) {
|
|
|
1788
1801
|
}
|
|
1789
1802
|
);
|
|
1790
1803
|
}
|
|
1791
|
-
function
|
|
1804
|
+
function Vi(t) {
|
|
1792
1805
|
const e = t.getCurrentLocale();
|
|
1793
|
-
return
|
|
1806
|
+
return ut(() => [
|
|
1794
1807
|
{
|
|
1795
1808
|
options: [
|
|
1796
1809
|
{ label: t.t(m.NONE.label), value: m.NONE.operator }
|
|
@@ -1830,19 +1843,19 @@ function Wi(t) {
|
|
|
1830
1843
|
}
|
|
1831
1844
|
], [e, t]);
|
|
1832
1845
|
}
|
|
1833
|
-
function
|
|
1846
|
+
function ji(t) {
|
|
1834
1847
|
const e = t.getCurrentLocale();
|
|
1835
|
-
return
|
|
1848
|
+
return ut(() => m.ALL_CONDITIONS.filter((r) => r.numOfParameters !== 2).map((r) => ({ label: t.t(r.label), value: r.operator })), [e, t]);
|
|
1836
1849
|
}
|
|
1837
|
-
function
|
|
1838
|
-
const { model: e } = t, r =
|
|
1850
|
+
function Gi(t) {
|
|
1851
|
+
const { model: e } = t, r = re(X), s = D(e.searchString$, "", !0), n = D(e.filterItems$, void 0, !0), a = r.t("sheets-filter.panel.filter-only"), i = ze(n), o = i.checked > 0 && i.unchecked === 0, l = i.checked > 0 && i.unchecked > 0, c = e.treeMapCache, h = k(() => {
|
|
1839
1852
|
e.onCheckAllToggled(!o);
|
|
1840
|
-
}, [e, o]), d =
|
|
1841
|
-
e.setSearchString(
|
|
1853
|
+
}, [e, o]), d = k((f) => {
|
|
1854
|
+
e.setSearchString(f);
|
|
1842
1855
|
}, [e]);
|
|
1843
|
-
function C(
|
|
1856
|
+
function C(f) {
|
|
1844
1857
|
let _ = [];
|
|
1845
|
-
return
|
|
1858
|
+
return f.forEach((S) => {
|
|
1846
1859
|
S.checked && _.push(S.key), S.children && (_ = _.concat(C(S.children)));
|
|
1847
1860
|
}), _;
|
|
1848
1861
|
}
|
|
@@ -1852,8 +1865,8 @@ function Vi(t) {
|
|
|
1852
1865
|
"data-u-comp": "sheets-filter-panel-values-container",
|
|
1853
1866
|
className: "univer-flex univer-h-full univer-min-h-[300px] univer-flex-col",
|
|
1854
1867
|
children: [
|
|
1855
|
-
/* @__PURE__ */
|
|
1856
|
-
|
|
1868
|
+
/* @__PURE__ */ p(
|
|
1869
|
+
Vt,
|
|
1857
1870
|
{
|
|
1858
1871
|
autoFocus: !0,
|
|
1859
1872
|
value: s,
|
|
@@ -1865,9 +1878,9 @@ function Vi(t) {
|
|
|
1865
1878
|
"div",
|
|
1866
1879
|
{
|
|
1867
1880
|
"data-u-comp": "sheets-filter-panel",
|
|
1868
|
-
className:
|
|
1881
|
+
className: Pe("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", ct),
|
|
1869
1882
|
children: [
|
|
1870
|
-
/* @__PURE__ */
|
|
1883
|
+
/* @__PURE__ */ p(
|
|
1871
1884
|
"div",
|
|
1872
1885
|
{
|
|
1873
1886
|
"data-u-comp": "sheets-filter-panel-values-item",
|
|
@@ -1878,8 +1891,8 @@ function Vi(t) {
|
|
|
1878
1891
|
"data-u-comp": "sheets-filter-panel-values-item-inner",
|
|
1879
1892
|
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",
|
|
1880
1893
|
children: [
|
|
1881
|
-
/* @__PURE__ */
|
|
1882
|
-
|
|
1894
|
+
/* @__PURE__ */ p(
|
|
1895
|
+
oi,
|
|
1883
1896
|
{
|
|
1884
1897
|
indeterminate: l,
|
|
1885
1898
|
disabled: n.length === 0,
|
|
@@ -1887,7 +1900,7 @@ function Vi(t) {
|
|
|
1887
1900
|
onChange: h
|
|
1888
1901
|
}
|
|
1889
1902
|
),
|
|
1890
|
-
/* @__PURE__ */
|
|
1903
|
+
/* @__PURE__ */ p(
|
|
1891
1904
|
"span",
|
|
1892
1905
|
{
|
|
1893
1906
|
"data-u-comp": "sheets-filter-panel-values-item-text",
|
|
@@ -1895,7 +1908,7 @@ function Vi(t) {
|
|
|
1895
1908
|
children: `${r.t("sheets-filter.panel.select-all")}`
|
|
1896
1909
|
}
|
|
1897
1910
|
),
|
|
1898
|
-
/* @__PURE__ */
|
|
1911
|
+
/* @__PURE__ */ p(
|
|
1899
1912
|
"span",
|
|
1900
1913
|
{
|
|
1901
1914
|
"data-u-comp": "sheets-filter-panel-values-item-count",
|
|
@@ -1908,14 +1921,14 @@ function Vi(t) {
|
|
|
1908
1921
|
)
|
|
1909
1922
|
}
|
|
1910
1923
|
),
|
|
1911
|
-
/* @__PURE__ */
|
|
1912
|
-
|
|
1924
|
+
/* @__PURE__ */ p("div", { "data-u-comp": "sheets-filter-panel-values-virtual", className: "univer-flex-grow", children: /* @__PURE__ */ p(
|
|
1925
|
+
li,
|
|
1913
1926
|
{
|
|
1914
1927
|
data: n,
|
|
1915
1928
|
defaultExpandAll: !1,
|
|
1916
1929
|
valueGroup: C(n),
|
|
1917
|
-
onChange: (
|
|
1918
|
-
e.onFilterCheckToggled(
|
|
1930
|
+
onChange: (f) => {
|
|
1931
|
+
e.onFilterCheckToggled(f);
|
|
1919
1932
|
},
|
|
1920
1933
|
defaultCache: c,
|
|
1921
1934
|
itemHeight: 28,
|
|
@@ -1926,30 +1939,30 @@ function Vi(t) {
|
|
|
1926
1939
|
univer-text-gray-900 dark:hover:!univer-bg-gray-900
|
|
1927
1940
|
dark:!univer-text-white
|
|
1928
1941
|
`,
|
|
1929
|
-
attachRender: (
|
|
1942
|
+
attachRender: (f) => /* @__PURE__ */ I(
|
|
1930
1943
|
"div",
|
|
1931
1944
|
{
|
|
1932
1945
|
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",
|
|
1933
1946
|
children: [
|
|
1934
|
-
/* @__PURE__ */
|
|
1947
|
+
/* @__PURE__ */ p(
|
|
1935
1948
|
"span",
|
|
1936
1949
|
{
|
|
1937
1950
|
"data-u-comp": "sheets-filter-panel-values-item-count",
|
|
1938
1951
|
className: "univer-text-gray-400 dark:!univer-text-gray-500",
|
|
1939
|
-
children: `(${
|
|
1952
|
+
children: `(${f.count})`
|
|
1940
1953
|
}
|
|
1941
1954
|
),
|
|
1942
|
-
/* @__PURE__ */
|
|
1955
|
+
/* @__PURE__ */ p(
|
|
1943
1956
|
"a",
|
|
1944
1957
|
{
|
|
1945
1958
|
className: "univer-box-border univer-hidden univer-h-4 univer-whitespace-nowrap univer-px-1.5",
|
|
1946
1959
|
onClick: () => {
|
|
1947
1960
|
const _ = [];
|
|
1948
|
-
|
|
1949
|
-
S.children ? S.children.forEach((
|
|
1950
|
-
_.push(
|
|
1961
|
+
f.children ? f.children.forEach((S) => {
|
|
1962
|
+
S.children ? S.children.forEach((E) => {
|
|
1963
|
+
_.push(E.key);
|
|
1951
1964
|
}) : _.push(S.key);
|
|
1952
|
-
}) : _.push(
|
|
1965
|
+
}) : _.push(f.key), e.onFilterOnly(_);
|
|
1953
1966
|
},
|
|
1954
1967
|
children: a
|
|
1955
1968
|
}
|
|
@@ -1966,56 +1979,56 @@ function Vi(t) {
|
|
|
1966
1979
|
}
|
|
1967
1980
|
);
|
|
1968
1981
|
}
|
|
1969
|
-
function
|
|
1970
|
-
var
|
|
1971
|
-
const t =
|
|
1972
|
-
r.executeCommand(
|
|
1973
|
-
}, [r]), c =
|
|
1982
|
+
function Yi() {
|
|
1983
|
+
var E;
|
|
1984
|
+
const t = re(q), e = re(X), r = re(j), s = D(t.filterBy$, void 0, !0), n = D(t.filterByModel$, void 0, !1), a = D(() => (n == null ? void 0 : n.canApply$) || me(!1), void 0, !1, [n]), i = Zi(e), o = !D(t.hasCriteria$), l = k((N) => {
|
|
1985
|
+
r.executeCommand(Zt.id, { filterBy: N });
|
|
1986
|
+
}, [r]), c = k(async () => {
|
|
1974
1987
|
await (n == null ? void 0 : n.clear()), r.executeCommand(Se.id);
|
|
1975
|
-
}, [n, r]), h =
|
|
1988
|
+
}, [n, r]), h = k(() => {
|
|
1976
1989
|
r.executeCommand(Se.id);
|
|
1977
|
-
}, [r]), d =
|
|
1990
|
+
}, [r]), d = k(async () => {
|
|
1978
1991
|
await (n == null ? void 0 : n.apply()), r.executeCommand(Se.id);
|
|
1979
|
-
}, [n, r]),
|
|
1992
|
+
}, [n, r]), f = (E = re(z).activeFilterModel) == null ? void 0 : E.getRange(), _ = t.col, S = wr(Or.FILTER_PANEL_EMBED_POINT);
|
|
1980
1993
|
return /* @__PURE__ */ I(
|
|
1981
1994
|
"div",
|
|
1982
1995
|
{
|
|
1983
1996
|
"data-u-comp": "sheets-filter-panel",
|
|
1984
1997
|
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",
|
|
1985
1998
|
children: [
|
|
1986
|
-
/* @__PURE__ */
|
|
1987
|
-
|
|
1999
|
+
/* @__PURE__ */ p(
|
|
2000
|
+
Lr,
|
|
1988
2001
|
{
|
|
1989
2002
|
components: S,
|
|
1990
|
-
sharedProps: { range:
|
|
2003
|
+
sharedProps: { range: f, colIndex: _, onClose: h }
|
|
1991
2004
|
}
|
|
1992
2005
|
),
|
|
1993
|
-
/* @__PURE__ */
|
|
1994
|
-
|
|
2006
|
+
/* @__PURE__ */ p("div", { className: "univer-mb-1 univer-flex-shrink-0 univer-flex-grow-0", children: /* @__PURE__ */ p(
|
|
2007
|
+
ai,
|
|
1995
2008
|
{
|
|
1996
2009
|
value: s,
|
|
1997
2010
|
items: i,
|
|
1998
|
-
onChange: (
|
|
2011
|
+
onChange: (N) => l(N)
|
|
1999
2012
|
}
|
|
2000
2013
|
) }),
|
|
2001
|
-
n ? /* @__PURE__ */
|
|
2014
|
+
n ? /* @__PURE__ */ p(
|
|
2002
2015
|
"div",
|
|
2003
2016
|
{
|
|
2004
2017
|
"data-u-comp": "sheets-filter-panel-content",
|
|
2005
2018
|
className: "univer-flex-shrink univer-flex-grow univer-pt-2",
|
|
2006
|
-
children: s ===
|
|
2019
|
+
children: s === w.VALUES ? /* @__PURE__ */ p(Gi, { model: n }) : s === w.COLORS ? /* @__PURE__ */ p(Wi, { model: n }) : /* @__PURE__ */ p(Qi, { model: n })
|
|
2007
2020
|
}
|
|
2008
|
-
) : /* @__PURE__ */
|
|
2021
|
+
) : /* @__PURE__ */ p("div", { className: "univer-flex-1" }),
|
|
2009
2022
|
/* @__PURE__ */ I(
|
|
2010
2023
|
"div",
|
|
2011
2024
|
{
|
|
2012
2025
|
"data-u-comp": "sheets-filter-panel-footer",
|
|
2013
2026
|
className: "univer-mt-4 univer-inline-flex univer-flex-shrink-0 univer-flex-grow-0 univer-flex-nowrap univer-justify-between univer-overflow-hidden",
|
|
2014
2027
|
children: [
|
|
2015
|
-
/* @__PURE__ */
|
|
2028
|
+
/* @__PURE__ */ p(Ze, { variant: "link", onClick: c, disabled: o, children: e.t("sheets-filter.panel.clear-filter") }),
|
|
2016
2029
|
/* @__PURE__ */ I("span", { className: "univer-flex univer-gap-2", children: [
|
|
2017
|
-
/* @__PURE__ */
|
|
2018
|
-
/* @__PURE__ */
|
|
2030
|
+
/* @__PURE__ */ p(Ze, { variant: "default", onClick: h, children: e.t("sheets-filter.panel.cancel") }),
|
|
2031
|
+
/* @__PURE__ */ p(Ze, { disabled: !a, variant: "primary", onClick: d, children: e.t("sheets-filter.panel.confirm") })
|
|
2019
2032
|
] })
|
|
2020
2033
|
]
|
|
2021
2034
|
}
|
|
@@ -2024,26 +2037,26 @@ function ji() {
|
|
|
2024
2037
|
}
|
|
2025
2038
|
);
|
|
2026
2039
|
}
|
|
2027
|
-
function
|
|
2040
|
+
function Zi(t) {
|
|
2028
2041
|
const e = t.getCurrentLocale();
|
|
2029
|
-
return
|
|
2030
|
-
{ label: t.t("sheets-filter.panel.by-values"), value:
|
|
2031
|
-
{ label: t.t("sheets-filter.panel.by-colors"), value:
|
|
2032
|
-
{ label: t.t("sheets-filter.panel.by-conditions"), value:
|
|
2042
|
+
return ut(() => [
|
|
2043
|
+
{ label: t.t("sheets-filter.panel.by-values"), value: w.VALUES },
|
|
2044
|
+
{ label: t.t("sheets-filter.panel.by-colors"), value: w.COLORS },
|
|
2045
|
+
{ label: t.t("sheets-filter.panel.by-conditions"), value: w.CONDITIONS }
|
|
2033
2046
|
], [e, t]);
|
|
2034
2047
|
}
|
|
2035
|
-
function
|
|
2036
|
-
const e = t.get(
|
|
2048
|
+
function Ki(t) {
|
|
2049
|
+
const e = t.get(z);
|
|
2037
2050
|
return {
|
|
2038
|
-
id:
|
|
2039
|
-
type:
|
|
2051
|
+
id: Ne.id,
|
|
2052
|
+
type: lt.BUTTON_SELECTOR,
|
|
2040
2053
|
icon: "FilterIcon",
|
|
2041
2054
|
tooltip: "sheets-filter.toolbar.smart-toggle-filter-tooltip",
|
|
2042
|
-
hidden$:
|
|
2055
|
+
hidden$: ot(t, se.UNIVER_SHEET),
|
|
2043
2056
|
activated$: e.activeFilterModel$.pipe(ce((r) => !!r)),
|
|
2044
|
-
disabled$:
|
|
2057
|
+
disabled$: Ir(
|
|
2045
2058
|
t,
|
|
2046
|
-
|
|
2059
|
+
br(
|
|
2047
2060
|
t,
|
|
2048
2061
|
{
|
|
2049
2062
|
worksheetTypes: [pe, ve],
|
|
@@ -2053,64 +2066,64 @@ function Yi(t) {
|
|
|
2053
2066
|
)
|
|
2054
2067
|
};
|
|
2055
2068
|
}
|
|
2056
|
-
function
|
|
2057
|
-
const e = t.get(
|
|
2069
|
+
function qi(t) {
|
|
2070
|
+
const e = t.get(z);
|
|
2058
2071
|
return {
|
|
2059
|
-
id:
|
|
2060
|
-
type:
|
|
2072
|
+
id: nt.id,
|
|
2073
|
+
type: lt.BUTTON,
|
|
2061
2074
|
title: "sheets-filter.toolbar.clear-filter-criteria",
|
|
2062
|
-
hidden$:
|
|
2063
|
-
disabled$: e.activeFilterModel$.pipe(
|
|
2075
|
+
hidden$: ot(t, se.UNIVER_SHEET),
|
|
2076
|
+
disabled$: e.activeFilterModel$.pipe(at((r) => {
|
|
2064
2077
|
var s;
|
|
2065
2078
|
return (s = r == null ? void 0 : r.hasCriteria$.pipe(ce((n) => !n))) != null ? s : me(!0);
|
|
2066
2079
|
}))
|
|
2067
2080
|
};
|
|
2068
2081
|
}
|
|
2069
|
-
function
|
|
2070
|
-
const e = t.get(
|
|
2082
|
+
function Xi(t) {
|
|
2083
|
+
const e = t.get(z);
|
|
2071
2084
|
return {
|
|
2072
|
-
id:
|
|
2073
|
-
type:
|
|
2085
|
+
id: st.id,
|
|
2086
|
+
type: lt.BUTTON,
|
|
2074
2087
|
title: "sheets-filter.toolbar.re-calc-filter-conditions",
|
|
2075
|
-
hidden$:
|
|
2076
|
-
disabled$: e.activeFilterModel$.pipe(
|
|
2088
|
+
hidden$: ot(t, se.UNIVER_SHEET),
|
|
2089
|
+
disabled$: e.activeFilterModel$.pipe(at((r) => {
|
|
2077
2090
|
var s;
|
|
2078
2091
|
return (s = r == null ? void 0 : r.hasCriteria$.pipe(ce((n) => !n))) != null ? s : me(!0);
|
|
2079
2092
|
}))
|
|
2080
2093
|
};
|
|
2081
2094
|
}
|
|
2082
|
-
const
|
|
2083
|
-
[
|
|
2084
|
-
[
|
|
2095
|
+
const zi = {
|
|
2096
|
+
[Mr.ORGANIZATION]: {
|
|
2097
|
+
[Ne.id]: {
|
|
2085
2098
|
order: 2,
|
|
2086
|
-
menuItemFactory:
|
|
2087
|
-
[
|
|
2099
|
+
menuItemFactory: Ki,
|
|
2100
|
+
[nt.id]: {
|
|
2088
2101
|
order: 0,
|
|
2089
|
-
menuItemFactory:
|
|
2102
|
+
menuItemFactory: qi
|
|
2090
2103
|
},
|
|
2091
|
-
[
|
|
2104
|
+
[st.id]: {
|
|
2092
2105
|
order: 1,
|
|
2093
|
-
menuItemFactory:
|
|
2106
|
+
menuItemFactory: Xi
|
|
2094
2107
|
}
|
|
2095
2108
|
}
|
|
2096
2109
|
}
|
|
2097
|
-
},
|
|
2098
|
-
id:
|
|
2099
|
-
binding: $r.L |
|
|
2110
|
+
}, Ji = {
|
|
2111
|
+
id: Ne.id,
|
|
2112
|
+
binding: $r.L | _t.CTRL_COMMAND | _t.SHIFT,
|
|
2100
2113
|
description: "sheets-filter.shortcut.smart-toggle-filter",
|
|
2101
|
-
preconditions:
|
|
2114
|
+
preconditions: Rr,
|
|
2102
2115
|
group: "4_sheet-edit"
|
|
2103
2116
|
};
|
|
2104
|
-
var
|
|
2105
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
2117
|
+
var es = Object.getOwnPropertyDescriptor, ts = (t, e, r, s) => {
|
|
2118
|
+
for (var n = s > 1 ? void 0 : s ? es(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
2106
2119
|
(i = t[a]) && (n = i(n) || n);
|
|
2107
2120
|
return n;
|
|
2108
|
-
},
|
|
2109
|
-
const
|
|
2110
|
-
let
|
|
2111
|
-
constructor(e, r, s, n, a, i, o, l, c, h, d, C,
|
|
2112
|
-
super(
|
|
2113
|
-
|
|
2121
|
+
}, M = (t, e) => (r, s) => e(r, s, t);
|
|
2122
|
+
const bt = "FILTER_PANEL_POPUP";
|
|
2123
|
+
let He = class extends Ee {
|
|
2124
|
+
constructor(e, r, s, n, a, i, o, l, c, h, d, C, f) {
|
|
2125
|
+
super(f, C);
|
|
2126
|
+
v(this, "_popupDisposable");
|
|
2114
2127
|
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();
|
|
2115
2128
|
}
|
|
2116
2129
|
dispose() {
|
|
@@ -2118,42 +2131,42 @@ let ke = class extends Te {
|
|
|
2118
2131
|
}
|
|
2119
2132
|
_initShortcuts() {
|
|
2120
2133
|
[
|
|
2121
|
-
|
|
2134
|
+
Ji
|
|
2122
2135
|
].forEach((e) => {
|
|
2123
2136
|
this.disposeWithMe(this._shortcutService.registerShortcut(e));
|
|
2124
2137
|
});
|
|
2125
2138
|
}
|
|
2126
2139
|
_initCommands() {
|
|
2127
2140
|
[
|
|
2128
|
-
|
|
2129
|
-
_r,
|
|
2141
|
+
Ne,
|
|
2130
2142
|
gr,
|
|
2143
|
+
Sr,
|
|
2131
2144
|
Q,
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2145
|
+
nt,
|
|
2146
|
+
st,
|
|
2147
|
+
Zt,
|
|
2148
|
+
xe,
|
|
2136
2149
|
Se
|
|
2137
2150
|
].forEach((e) => {
|
|
2138
2151
|
this.disposeWithMe(this._commandService.registerCommand(e));
|
|
2139
2152
|
});
|
|
2140
2153
|
}
|
|
2141
2154
|
_initMenuItems() {
|
|
2142
|
-
this._menuManagerService.mergeMenu(
|
|
2155
|
+
this._menuManagerService.mergeMenu(zi);
|
|
2143
2156
|
}
|
|
2144
2157
|
_initUI() {
|
|
2145
2158
|
[
|
|
2146
|
-
[
|
|
2147
|
-
["FilterIcon",
|
|
2159
|
+
[bt, Yi],
|
|
2160
|
+
["FilterIcon", er]
|
|
2148
2161
|
].forEach(([e, r]) => {
|
|
2149
2162
|
this.disposeWithMe(
|
|
2150
2163
|
this._componentManager.register(e, r)
|
|
2151
2164
|
);
|
|
2152
|
-
}), this.disposeWithMe(this._contextService.subscribeContextValue$(ue).pipe(
|
|
2165
|
+
}), this.disposeWithMe(this._contextService.subscribeContextValue$(ue).pipe(ri()).subscribe((e) => {
|
|
2153
2166
|
e ? this._openFilterPopup() : this._closeFilterPopup();
|
|
2154
2167
|
})), this.disposeWithMe(this._sheetsFilterService.errorMsg$.subscribe((e) => {
|
|
2155
2168
|
e && this._messageService.show({
|
|
2156
|
-
type:
|
|
2169
|
+
type: ci.Error,
|
|
2157
2170
|
content: this._localeService.t(e)
|
|
2158
2171
|
});
|
|
2159
2172
|
}));
|
|
@@ -2164,7 +2177,7 @@ let ke = class extends Te {
|
|
|
2164
2177
|
throw new Error("[SheetsFilterUIController]: no filter model when opening filter popup!");
|
|
2165
2178
|
const r = e.getRange(), s = this._sheetsFilterPanelService.col, { startRow: n } = r;
|
|
2166
2179
|
this._popupDisposable = this._sheetCanvasPopupService.attachPopupToCell(n, s, {
|
|
2167
|
-
componentKey:
|
|
2180
|
+
componentKey: bt,
|
|
2168
2181
|
direction: "horizontal",
|
|
2169
2182
|
onClickOutside: () => this._commandService.syncExecuteCommand(Se.id),
|
|
2170
2183
|
offset: [5, 0]
|
|
@@ -2175,97 +2188,97 @@ let ke = class extends Te {
|
|
|
2175
2188
|
(e = this._popupDisposable) == null || e.dispose(), this._popupDisposable = null;
|
|
2176
2189
|
}
|
|
2177
2190
|
};
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
],
|
|
2193
|
-
var
|
|
2194
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
2191
|
+
He = ts([
|
|
2192
|
+
M(0, T(ie)),
|
|
2193
|
+
M(1, T(xr)),
|
|
2194
|
+
M(2, T(q)),
|
|
2195
|
+
M(3, T(Ar)),
|
|
2196
|
+
M(4, T(z)),
|
|
2197
|
+
M(5, T(X)),
|
|
2198
|
+
M(6, Ur),
|
|
2199
|
+
M(7, j),
|
|
2200
|
+
M(8, kr),
|
|
2201
|
+
M(9, Qe),
|
|
2202
|
+
M(10, Hr),
|
|
2203
|
+
M(11, T(Ht)),
|
|
2204
|
+
M(12, Dt)
|
|
2205
|
+
], He);
|
|
2206
|
+
var rs = Object.defineProperty, is = Object.getOwnPropertyDescriptor, ss = (t, e, r) => e in t ? rs(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, ns = (t, e, r, s) => {
|
|
2207
|
+
for (var n = s > 1 ? void 0 : s ? is(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
2195
2208
|
(i = t[a]) && (n = i(n) || n);
|
|
2196
2209
|
return n;
|
|
2197
|
-
},
|
|
2198
|
-
const
|
|
2199
|
-
let
|
|
2200
|
-
constructor(t =
|
|
2210
|
+
}, Xe = (t, e) => (r, s) => e(r, s, t), rr = (t, e, r) => ss(t, typeof e != "symbol" ? e + "" : e, r);
|
|
2211
|
+
const os = "SHEET_FILTER_UI_PLUGIN";
|
|
2212
|
+
let De = class extends it {
|
|
2213
|
+
constructor(t = Ue, e, r, s) {
|
|
2201
2214
|
super(), this._config = t, this._injector = e, this._configService = r, this._rpcChannelService = s;
|
|
2202
|
-
const { menu: n, ...a } =
|
|
2215
|
+
const { menu: n, ...a } = Ut(
|
|
2203
2216
|
{},
|
|
2204
|
-
|
|
2217
|
+
Ue,
|
|
2205
2218
|
this._config
|
|
2206
2219
|
);
|
|
2207
|
-
n && this._configService.setConfig("menu", n, { merge: !0 }), this._configService.setConfig(
|
|
2220
|
+
n && this._configService.setConfig("menu", n, { merge: !0 }), this._configService.setConfig(Kt, a);
|
|
2208
2221
|
}
|
|
2209
2222
|
onStarting() {
|
|
2210
|
-
|
|
2211
|
-
[
|
|
2223
|
+
dr(this._injector, [
|
|
2224
|
+
[q],
|
|
2212
2225
|
[he],
|
|
2213
|
-
[
|
|
2214
|
-
]), this._config.useRemoteFilterValuesGenerator && this._rpcChannelService && this._injector.add([
|
|
2215
|
-
useFactory: () =>
|
|
2216
|
-
this._rpcChannelService.requestChannel(
|
|
2226
|
+
[He]
|
|
2227
|
+
]), this._config.useRemoteFilterValuesGenerator && this._rpcChannelService && this._injector.add([we, {
|
|
2228
|
+
useFactory: () => ii(
|
|
2229
|
+
this._rpcChannelService.requestChannel(ht)
|
|
2217
2230
|
)
|
|
2218
2231
|
}]);
|
|
2219
2232
|
}
|
|
2220
2233
|
onReady() {
|
|
2221
|
-
|
|
2234
|
+
vt(this._injector, [
|
|
2222
2235
|
[he]
|
|
2223
2236
|
]);
|
|
2224
2237
|
}
|
|
2225
2238
|
onRendered() {
|
|
2226
|
-
|
|
2227
|
-
[
|
|
2239
|
+
vt(this._injector, [
|
|
2240
|
+
[He]
|
|
2228
2241
|
]);
|
|
2229
2242
|
}
|
|
2230
2243
|
};
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
],
|
|
2239
|
-
var
|
|
2240
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
2244
|
+
rr(De, "type", se.UNIVER_SHEET);
|
|
2245
|
+
rr(De, "pluginName", os);
|
|
2246
|
+
De = ns([
|
|
2247
|
+
$t(kt),
|
|
2248
|
+
Xe(1, T(ie)),
|
|
2249
|
+
Xe(2, xt),
|
|
2250
|
+
Xe(3, hr(Qt))
|
|
2251
|
+
], De);
|
|
2252
|
+
var ls = Object.getOwnPropertyDescriptor, as = (t, e, r, s) => {
|
|
2253
|
+
for (var n = s > 1 ? void 0 : s ? ls(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
2241
2254
|
(i = t[a]) && (n = i(n) || n);
|
|
2242
2255
|
return n;
|
|
2243
|
-
},
|
|
2244
|
-
let
|
|
2256
|
+
}, Rt = (t, e) => (r, s) => e(r, s, t), be;
|
|
2257
|
+
let At = (be = class extends it {
|
|
2245
2258
|
constructor(t, e, r) {
|
|
2246
2259
|
super(), this._config = t, this._injector = e, this._rpcChannelService = r;
|
|
2247
2260
|
}
|
|
2248
2261
|
onStarting() {
|
|
2249
2262
|
[
|
|
2250
|
-
[
|
|
2263
|
+
[we, { useClass: Je }]
|
|
2251
2264
|
].forEach((t) => this._injector.add(t));
|
|
2252
2265
|
}
|
|
2253
2266
|
onReady() {
|
|
2254
2267
|
this._rpcChannelService.registerChannel(
|
|
2255
|
-
|
|
2256
|
-
|
|
2268
|
+
ht,
|
|
2269
|
+
si(this._injector.get(we))
|
|
2257
2270
|
);
|
|
2258
2271
|
}
|
|
2259
|
-
},
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
],
|
|
2272
|
+
}, v(be, "type", se.UNIVER_SHEET), v(be, "pluginName", "SHEET_FILTER_UI_WORKER_PLUGIN"), be);
|
|
2273
|
+
At = as([
|
|
2274
|
+
Rt(1, T(ie)),
|
|
2275
|
+
Rt(2, Qt)
|
|
2276
|
+
], At);
|
|
2264
2277
|
export {
|
|
2265
|
-
|
|
2278
|
+
Zt as ChangeFilterByOperation,
|
|
2266
2279
|
Se as CloseFilterPanelOperation,
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2280
|
+
xe as OpenFilterPanelOperation,
|
|
2281
|
+
ke as UniverSheetsFilterMobileUIPlugin,
|
|
2282
|
+
De as UniverSheetsFilterUIPlugin,
|
|
2283
|
+
At as UniverSheetsFilterUIWorkerPlugin
|
|
2271
2284
|
};
|