@univerjs/sheets-filter-ui 0.16.1 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +2 -2
- package/lib/es/index.js +486 -480
- package/lib/index.js +486 -480
- package/lib/types/index.d.ts +1 -1
- package/lib/types/mobile-plugin.d.ts +3 -1
- package/lib/types/plugin.d.ts +3 -1
- package/lib/types/worker/plugin.d.ts +2 -0
- package/lib/umd/index.js +2 -2
- package/package.json +12 -12
- /package/lib/types/{controllers/config.schema.d.ts → config/config.d.ts} +0 -0
- /package/lib/types/{controllers/menu.schema.d.ts → menu/schema.d.ts} +0 -0
- /package/lib/types/{controllers → menu}/sheets-filter.menu.d.ts +0 -0
package/lib/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var v = (t, e, r) =>
|
|
4
|
-
import { BooleanNumber as
|
|
5
|
-
import { CustomFilterOperator as u, FilterBy as P, SetSheetsFilterCriteriaCommand as V, SheetsFilterService as X, SmartToggleSheetsFilterCommand as
|
|
6
|
-
import { IEditorBridgeService as
|
|
7
|
-
import { ILayoutService as
|
|
8
|
-
import { COLOR_BLACK_RGB as
|
|
9
|
-
import { RefRangeService as
|
|
10
|
-
import { BehaviorSubject as Q, ReplaySubject as
|
|
11
|
-
import { IRPCChannelService as
|
|
12
|
-
import { clsx as
|
|
13
|
-
import { useRef as
|
|
14
|
-
import { jsx as d, jsxs as y, Fragment as
|
|
1
|
+
var cr = Object.defineProperty;
|
|
2
|
+
var ur = (t, e, r) => e in t ? cr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var v = (t, e, r) => ur(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { BooleanNumber as _t, createIdentifier as Mt, Inject as T, LocaleService as G, IUniverInstanceService as Be, ILogService as hr, extractPureTextFromCell as dr, numfmt as Ke, Disposable as fe, Injector as re, Quantity as xt, Tools as Pe, ColorKit as gt, ICommandService as j, CommandType as We, IContextService as Ve, ThemeService as Ut, RxDisposable as kt, fromCallback as mr, VerticalAlign as we, InterceptorEffectEnum as fr, UniverInstanceType as ie, DependentOn as Ht, IConfigService as Dt, Plugin as ot, merge as Bt, Optional as pr, registerDependencies as vr, touchDependencies as St } from "@univerjs/core";
|
|
5
|
+
import { CustomFilterOperator as u, FilterBy as P, SetSheetsFilterCriteriaCommand as V, SheetsFilterService as X, SmartToggleSheetsFilterCommand as Oe, FILTER_MUTATIONS as _r, SetSheetsFilterRangeMutation as gr, SetSheetsFilterCriteriaMutation as Sr, RemoveSheetsFilterMutation as Cr, ReCalcSheetsFilterMutation as Tr, UniverSheetsFilterPlugin as Wt, ReCalcSheetsFilterCommand as lt, ClearSheetsFilterCriteriaCommand as at, SheetsFilterSyncController as Er, RemoveSheetFilterCommand as Nr, SetSheetFilterRangeCommand as Fr } from "@univerjs/sheets-filter";
|
|
6
|
+
import { IEditorBridgeService as Ct, SetCellEditVisibleOperation as Ir, SheetSkeletonManagerService as yr, ISheetSelectionRenderService as Or, SelectionControl as br, attachSelectionWithCoord as Rr, getCoordByCell as Ar, SheetsRenderService as Vt, getObservableWithExclusiveRange$ as Pr, getCurrentRangeDisable$ as wr, SheetsUIPart as $r, whenSheetEditorFocused as Lr, SheetCanvasPopManagerService as Mr } from "@univerjs/sheets-ui";
|
|
7
|
+
import { ILayoutService as xr, getMenuHiddenObservable as ct, MenuItemType as ut, RibbonDataGroup as Ur, useDependency as D, useObservable as L, IMessageService as Qt, useComponentsOfPart as kr, ComponentContainer as Hr, KeyCode as Dr, MetaKeys as Tt, ComponentManager as Br, IShortcutService as Wr, IMenuManagerService as Vr } from "@univerjs/ui";
|
|
8
|
+
import { COLOR_BLACK_RGB as Et, Rect as Nt, Shape as Qr, IRenderManagerService as Gt } from "@univerjs/engine-render";
|
|
9
|
+
import { RefRangeService as Gr, SheetPermissionCheckController as jr, SheetsSelectionsService as Yr, getSheetCommandTarget as Zr, WorksheetFilterPermission as Se, WorksheetViewPermission as Ce, RangeProtectionPermissionViewPoint as Te, expandToContinuousRange as zr, SheetInterceptorService as Kr, SetRangeValuesMutation as qr, INTERCEPTOR_POINT as Xr } from "@univerjs/sheets";
|
|
10
|
+
import { BehaviorSubject as Q, ReplaySubject as Jr, Subject as ei, merge as ti, combineLatest as ri, throttleTime as jt, startWith as Yt, map as ae, shareReplay as ii, of as pe, switchMap as ht, filter as si, takeUntil as ni, distinctUntilChanged as oi } from "rxjs";
|
|
11
|
+
import { IRPCChannelService as Zt, toModule as li, fromModule as ai } from "@univerjs/rpc";
|
|
12
|
+
import { clsx as $e, borderClassName as dt, Select as Ft, RadioGroup as ci, Radio as It, Input as zt, Checkbox as ui, Tree as hi, Tooltip as di, Switch as mi, MessageType as Kt, Segmented as fi, Button as qe } from "@univerjs/design";
|
|
13
|
+
import { useRef as pi, createElement as ve, forwardRef as be, useCallback as U, useMemo as mt } from "react";
|
|
14
|
+
import { jsx as d, jsxs as y, Fragment as yt } from "react/jsx-runtime";
|
|
15
15
|
var b = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SECOND", t))(b || {}), 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 || {}), f;
|
|
16
16
|
((t) => {
|
|
17
17
|
t.NONE = {
|
|
@@ -304,7 +304,7 @@ var b = /* @__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: _t.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 }
|
|
@@ -402,13 +402,13 @@ var b = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
402
402
|
return S(m, c);
|
|
403
403
|
if (_)
|
|
404
404
|
return S(h, l);
|
|
405
|
-
const C = S(h, l),
|
|
405
|
+
const C = S(h, l), N = S(m, c), F = {
|
|
406
406
|
customFilters: [
|
|
407
407
|
C.customFilters.customFilters[0],
|
|
408
|
-
|
|
408
|
+
N.customFilters.customFilters[0]
|
|
409
409
|
]
|
|
410
410
|
};
|
|
411
|
-
return o && (
|
|
411
|
+
return o && (F.and = _t.TRUE), { customFilters: F };
|
|
412
412
|
},
|
|
413
413
|
testMappingFilterColumn: (i) => {
|
|
414
414
|
var c;
|
|
@@ -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 tt(t) {
|
|
496
496
|
const e = [], r = [];
|
|
497
497
|
let s = 0, n = 0;
|
|
498
498
|
function a(i) {
|
|
@@ -505,20 +505,20 @@ function Xe(t) {
|
|
|
505
505
|
unchecked: n
|
|
506
506
|
};
|
|
507
507
|
}
|
|
508
|
-
var
|
|
509
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
508
|
+
var vi = Object.getOwnPropertyDescriptor, _i = (t, e, r, s) => {
|
|
509
|
+
for (var n = s > 1 ? void 0 : s ? vi(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
|
+
}, Xe = (t, e) => (r, s) => e(r, s, t);
|
|
513
|
+
const ft = "sheets-filter.generate-filter-values.service", Le = Mt(ft);
|
|
514
|
+
let rt = class extends fe {
|
|
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 m;
|
|
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 = (m = this._univerInstanceService.getUnit(e)) == null ? void 0 : m.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 }), qt(
|
|
522
522
|
a,
|
|
523
523
|
this._localeService,
|
|
524
524
|
o,
|
|
@@ -531,42 +531,42 @@ let Je = class extends ue {
|
|
|
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(), m = "yyyy-mm-dd", S = "empty", p = !t && ((a == null ? void 0 : a.filterBy) === P.COLORS || (a == null ? void 0 : a.filterBy) === P.CONDITIONS) && ((
|
|
534
|
+
rt = _i([
|
|
535
|
+
Xe(0, T(G)),
|
|
536
|
+
Xe(1, Be),
|
|
537
|
+
Xe(2, hr)
|
|
538
|
+
], rt);
|
|
539
|
+
function qt(t, e, r, s, n, a, i, o, l) {
|
|
540
|
+
var N, F, R, O, A, w, Y, Z, se, M;
|
|
541
|
+
const c = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), m = "yyyy-mm-dd", S = "empty", p = !t && ((a == null ? void 0 : a.filterBy) === P.COLORS || (a == null ? void 0 : a.filterBy) === P.CONDITIONS) && ((N = a.filteredOutRows) == null ? void 0 : N.size);
|
|
542
542
|
let _ = 0;
|
|
543
543
|
for (const E of s.iterateByColumn(r, !1, !1)) {
|
|
544
|
-
const { row:
|
|
544
|
+
const { row: Ye, rowSpan: Re = 1 } = E;
|
|
545
545
|
let ne = 0;
|
|
546
|
-
for (; ne <
|
|
547
|
-
const
|
|
548
|
-
if (n.has(
|
|
546
|
+
for (; ne < Re; ) {
|
|
547
|
+
const ar = Ye + ne;
|
|
548
|
+
if (n.has(ar)) {
|
|
549
549
|
ne++;
|
|
550
550
|
continue;
|
|
551
551
|
}
|
|
552
|
-
const J = E != null && E.value ?
|
|
552
|
+
const J = E != null && E.value ? dr(E.value) : "";
|
|
553
553
|
if (!J) {
|
|
554
|
-
_ += 1, ne +=
|
|
554
|
+
_ += 1, ne += Re;
|
|
555
555
|
continue;
|
|
556
556
|
}
|
|
557
|
-
const
|
|
558
|
-
let
|
|
559
|
-
if (
|
|
560
|
-
const { year: k, month: z, day: I } =
|
|
561
|
-
|
|
557
|
+
const Ae = (F = E.value) != null && F.v && !E.value.p ? (A = (O = l.get((R = E.value) == null ? void 0 : R.s)) == null ? void 0 : O.n) == null ? void 0 : A.pattern : "", pt = Ae && Ke.getFormatInfo(Ae).isDate;
|
|
558
|
+
let vt = !1;
|
|
559
|
+
if (pt) {
|
|
560
|
+
const { year: k, month: z, day: I } = Ke.getFormatDateInfo(Ae);
|
|
561
|
+
vt = k || z || I;
|
|
562
562
|
}
|
|
563
|
-
if (
|
|
563
|
+
if (Ae && pt && vt) {
|
|
564
564
|
const k = (w = s.getCellRaw(E.row, E.col)) == null ? void 0 : w.v;
|
|
565
565
|
if (!k) {
|
|
566
566
|
ne++;
|
|
567
567
|
continue;
|
|
568
568
|
}
|
|
569
|
-
const z =
|
|
569
|
+
const z = Ke.format(m, Number(k)), [I, H, ge] = z.split("-").map(Number);
|
|
570
570
|
let ee = c.get(`${I}`);
|
|
571
571
|
ee || (ee = {
|
|
572
572
|
title: `${I}`,
|
|
@@ -576,7 +576,7 @@ function Zt(t, e, r, s, n, a, i, o, l) {
|
|
|
576
576
|
leaf: !1,
|
|
577
577
|
checked: !1
|
|
578
578
|
}, c.set(`${I}`, ee), h.set(`${I}`, [`${I}`]));
|
|
579
|
-
let W = (Y = ee.children) == null ? void 0 : Y.find((
|
|
579
|
+
let W = (Y = ee.children) == null ? void 0 : Y.find((ze) => ze.key === `${I}-${H}`);
|
|
580
580
|
W || (W = {
|
|
581
581
|
title: e.t(`sheets-filter.date.${H}`),
|
|
582
582
|
key: `${I}-${H}`,
|
|
@@ -585,15 +585,15 @@ function Zt(t, e, r, s, n, a, i, o, l) {
|
|
|
585
585
|
leaf: !1,
|
|
586
586
|
checked: !1
|
|
587
587
|
}, (Z = ee.children) == null || Z.push(W), h.set(`${I}-${H}`, [`${I}`, `${I}-${H}`]));
|
|
588
|
-
const
|
|
589
|
-
|
|
590
|
-
title: `${
|
|
591
|
-
key: `${I}-${H}-${
|
|
588
|
+
const Ze = (se = W == null ? void 0 : W.children) == null ? void 0 : se.find((ze) => ze.key === `${I}-${H}-${ge}`);
|
|
589
|
+
Ze ? (Ze.originValues.add(J), Ze.count++, W.count++, ee.count++) : ((M = W.children) == null || M.push({
|
|
590
|
+
title: `${ge}`,
|
|
591
|
+
key: `${I}-${H}-${ge}`,
|
|
592
592
|
count: 1,
|
|
593
593
|
originValues: /* @__PURE__ */ new Set([J]),
|
|
594
594
|
leaf: !0,
|
|
595
595
|
checked: p ? !1 : i.size ? i.has(J) : !o
|
|
596
|
-
}), W.count++, ee.count++, h.set(`${I}-${H}-${
|
|
596
|
+
}), W.count++, ee.count++, h.set(`${I}-${H}-${ge}`, [`${I}`, `${I}-${H}`, `${I}-${H}-${ge}`]));
|
|
597
597
|
} else {
|
|
598
598
|
const k = J;
|
|
599
599
|
let z = c.get(k);
|
|
@@ -620,12 +620,12 @@ function Zt(t, e, r, s, n, a, i, o, l) {
|
|
|
620
620
|
c.set("empty", E), h.set("empty", [S]);
|
|
621
621
|
}
|
|
622
622
|
return {
|
|
623
|
-
filterTreeItems:
|
|
623
|
+
filterTreeItems: gi(Array.from(c.values())),
|
|
624
624
|
filterTreeMapCache: h
|
|
625
625
|
};
|
|
626
626
|
}
|
|
627
|
-
function
|
|
628
|
-
return Array.from(t).sort((e, r) => e.children && !r.children ? -1 : !e.children && r.children ? 1 :
|
|
627
|
+
function gi(t) {
|
|
628
|
+
return Array.from(t).sort((e, r) => e.children && !r.children ? -1 : !e.children && r.children ? 1 : Si(e.title, r.title)).map((e) => (e.children && e.children.sort((r, s) => {
|
|
629
629
|
const n = Number.parseInt(r.key.split("-")[1], 10), a = Number.parseInt(s.key.split("-")[1], 10);
|
|
630
630
|
return n - a;
|
|
631
631
|
}).forEach((r) => {
|
|
@@ -635,30 +635,30 @@ function _i(t) {
|
|
|
635
635
|
});
|
|
636
636
|
}), e));
|
|
637
637
|
}
|
|
638
|
-
const
|
|
639
|
-
function
|
|
640
|
-
const r =
|
|
638
|
+
const Ot = (t) => !Number.isNaN(Number(t)) && !Number.isNaN(Number.parseFloat(t));
|
|
639
|
+
function Si(t, e) {
|
|
640
|
+
const r = Ot(t), s = Ot(e);
|
|
641
641
|
return r && s ? Number.parseFloat(t) - Number.parseFloat(e) : r && !s ? -1 : !r && s ? 1 : t.localeCompare(e);
|
|
642
642
|
}
|
|
643
|
-
function
|
|
643
|
+
function it(t, e) {
|
|
644
644
|
for (const r of t) {
|
|
645
645
|
if (r.key === e)
|
|
646
646
|
return r;
|
|
647
647
|
if (r.children) {
|
|
648
|
-
const s =
|
|
648
|
+
const s = it(r.children, e);
|
|
649
649
|
if (s)
|
|
650
650
|
return s;
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
653
|
return null;
|
|
654
654
|
}
|
|
655
|
-
function
|
|
656
|
-
return t.leaf ? t.checked : t.children ? t.children.every((e) =>
|
|
655
|
+
function Xt(t) {
|
|
656
|
+
return t.leaf ? t.checked : t.children ? t.children.every((e) => Xt(e)) : !0;
|
|
657
657
|
}
|
|
658
|
-
function
|
|
659
|
-
t.leaf && (e !== void 0 ? t.checked = e : t.checked = !t.checked), t.children && t.children.forEach((r) =>
|
|
658
|
+
function Ee(t, e) {
|
|
659
|
+
t.leaf && (e !== void 0 ? t.checked = e : t.checked = !t.checked), t.children && t.children.forEach((r) => Ee(r, e));
|
|
660
660
|
}
|
|
661
|
-
function
|
|
661
|
+
function Jt(t, e) {
|
|
662
662
|
const r = [];
|
|
663
663
|
return t.forEach((s) => {
|
|
664
664
|
const n = s.originValues ? e.some(
|
|
@@ -671,7 +671,7 @@ function Kt(t, e) {
|
|
|
671
671
|
if (n || a)
|
|
672
672
|
r.push({ ...s });
|
|
673
673
|
else if (s.children) {
|
|
674
|
-
const o =
|
|
674
|
+
const o = Jt(s.children, e);
|
|
675
675
|
if (o.length > 0) {
|
|
676
676
|
const l = o.reduce((c, h) => c + h.count, 0);
|
|
677
677
|
r.push({ ...s, count: l, children: o });
|
|
@@ -679,18 +679,18 @@ function Kt(t, e) {
|
|
|
679
679
|
}
|
|
680
680
|
}), r;
|
|
681
681
|
}
|
|
682
|
-
var
|
|
683
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
682
|
+
var Ci = Object.getOwnPropertyDescriptor, Qe = (t, e, r, s) => {
|
|
683
|
+
for (var n = s > 1 ? void 0 : s ? Ci(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
684
684
|
(i = t[a]) && (n = i(n) || n);
|
|
685
685
|
return n;
|
|
686
|
-
},
|
|
687
|
-
|
|
688
|
-
let q = class extends
|
|
686
|
+
}, Ie = (t, e) => (r, s) => e(r, s, t);
|
|
687
|
+
Mt("sheets-filter-ui.sheets-filter-panel.service");
|
|
688
|
+
let q = class extends fe {
|
|
689
689
|
constructor(e, r) {
|
|
690
690
|
super();
|
|
691
691
|
v(this, "_filterBy$", new Q(P.VALUES));
|
|
692
692
|
v(this, "filterBy$", this._filterBy$.asObservable());
|
|
693
|
-
v(this, "_filterByModel$", new
|
|
693
|
+
v(this, "_filterByModel$", new Jr(1));
|
|
694
694
|
v(this, "filterByModel$", this._filterByModel$.asObservable());
|
|
695
695
|
v(this, "_filterByModel", null);
|
|
696
696
|
v(this, "_hasCriteria$", new Q(!1));
|
|
@@ -785,7 +785,7 @@ let q = class extends ue {
|
|
|
785
785
|
this._disposePreviousModel();
|
|
786
786
|
const s = e.getRange();
|
|
787
787
|
if (s.startRow === s.endRow) return !1;
|
|
788
|
-
const n = await
|
|
788
|
+
const n = await xe.fromFilterColumn(
|
|
789
789
|
this._injector,
|
|
790
790
|
e,
|
|
791
791
|
r
|
|
@@ -796,7 +796,7 @@ let q = class extends ue {
|
|
|
796
796
|
this._disposePreviousModel();
|
|
797
797
|
const s = e.getRange();
|
|
798
798
|
if (s.startRow === s.endRow) return !1;
|
|
799
|
-
const n = await
|
|
799
|
+
const n = await Ue.fromFilterColumn(
|
|
800
800
|
this._injector,
|
|
801
801
|
e,
|
|
802
802
|
r
|
|
@@ -807,7 +807,7 @@ let q = class extends ue {
|
|
|
807
807
|
this._disposePreviousModel();
|
|
808
808
|
const s = e.getRange();
|
|
809
809
|
if (s.startRow === s.endRow) return !1;
|
|
810
|
-
const n =
|
|
810
|
+
const n = Me.fromFilterColumn(
|
|
811
811
|
this._injector,
|
|
812
812
|
e,
|
|
813
813
|
r,
|
|
@@ -820,14 +820,14 @@ let q = class extends ue {
|
|
|
820
820
|
(e = this._filterByModel) == null || e.dispose(), this.filterByModel = null;
|
|
821
821
|
}
|
|
822
822
|
};
|
|
823
|
-
q =
|
|
824
|
-
|
|
825
|
-
|
|
823
|
+
q = Qe([
|
|
824
|
+
Ie(0, T(re)),
|
|
825
|
+
Ie(1, T(Gr))
|
|
826
826
|
], q);
|
|
827
|
-
let
|
|
827
|
+
let Me = class extends fe {
|
|
828
828
|
constructor(e, r, s, n, a) {
|
|
829
829
|
super();
|
|
830
|
-
v(this, "canApply$",
|
|
830
|
+
v(this, "canApply$", pe(!0));
|
|
831
831
|
v(this, "_conditionItem$");
|
|
832
832
|
v(this, "conditionItem$");
|
|
833
833
|
v(this, "_filterConditionFormParams$");
|
|
@@ -847,7 +847,7 @@ let we = class extends ue {
|
|
|
847
847
|
*/
|
|
848
848
|
static fromFilterColumn(e, r, s, n) {
|
|
849
849
|
const [a, i] = f.testMappingFilterColumn(n == null ? void 0 : n.getColumnData());
|
|
850
|
-
return e.createInstance(
|
|
850
|
+
return e.createInstance(Me, r, s, a, i);
|
|
851
851
|
}
|
|
852
852
|
get conditionItem() {
|
|
853
853
|
return this._conditionItem$.getValue();
|
|
@@ -909,10 +909,10 @@ let we = class extends ue {
|
|
|
909
909
|
this._filterConditionFormParams$.next(r);
|
|
910
910
|
}
|
|
911
911
|
};
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
],
|
|
915
|
-
let
|
|
912
|
+
Me = Qe([
|
|
913
|
+
Ie(4, j)
|
|
914
|
+
], Me);
|
|
915
|
+
let xe = class extends fe {
|
|
916
916
|
constructor(e, r, s, n, a) {
|
|
917
917
|
super();
|
|
918
918
|
v(this, "_rawFilterItems$");
|
|
@@ -924,22 +924,22 @@ let $e = class extends ue {
|
|
|
924
924
|
v(this, "_manuallyUpdateFilterItems$");
|
|
925
925
|
v(this, "_searchString$");
|
|
926
926
|
v(this, "searchString$");
|
|
927
|
-
this._filterModel = e, this.col = r, this._commandService = a, this._treeMapCache = n, this._searchString$ = new Q(""), this.searchString$ = this._searchString$.asObservable(), this._rawFilterItems$ = new Q(s), this.rawFilterItems$ = this._rawFilterItems$.asObservable(), this._manuallyUpdateFilterItems$ = new
|
|
928
|
-
|
|
927
|
+
this._filterModel = e, this.col = r, this._commandService = a, this._treeMapCache = n, this._searchString$ = new Q(""), this.searchString$ = this._searchString$.asObservable(), this._rawFilterItems$ = new Q(s), this.rawFilterItems$ = this._rawFilterItems$.asObservable(), this._manuallyUpdateFilterItems$ = new ei(), this.filterItems$ = ti(
|
|
928
|
+
ri([
|
|
929
929
|
this._searchString$.pipe(
|
|
930
|
-
|
|
931
|
-
|
|
930
|
+
jt(500, void 0, { leading: !0, trailing: !0 }),
|
|
931
|
+
Yt(void 0)
|
|
932
932
|
),
|
|
933
933
|
this._rawFilterItems$
|
|
934
934
|
]).pipe(
|
|
935
|
-
|
|
935
|
+
ae(([i, o]) => {
|
|
936
936
|
if (!i) return o;
|
|
937
937
|
const c = i.toLowerCase().split(/\s+/).filter((h) => !!h);
|
|
938
|
-
return
|
|
938
|
+
return Jt(o, c);
|
|
939
939
|
})
|
|
940
940
|
),
|
|
941
941
|
this._manuallyUpdateFilterItems$
|
|
942
|
-
).pipe(
|
|
942
|
+
).pipe(ii(1)), this.canApply$ = this.filterItems$.pipe(ae((i) => tt(i).checked > 0)), this.disposeWithMe(this.filterItems$.subscribe((i) => this._filterItems = i));
|
|
943
943
|
}
|
|
944
944
|
/**
|
|
945
945
|
* Create a model with targeting filter column. If there is not a filter column, the model would be created with
|
|
@@ -952,39 +952,39 @@ let $e = class extends ue {
|
|
|
952
952
|
* @returns the model to control the panel's state
|
|
953
953
|
*/
|
|
954
954
|
static async fromFilterColumn(e, r, s) {
|
|
955
|
-
const n = e.get(
|
|
955
|
+
const n = e.get(Be), a = e.get(G), i = e.get(Le, xt.OPTIONAL), { unitId: o, subUnitId: l } = r, c = n.getUniverSheetInstance(o);
|
|
956
956
|
if (!c) throw new Error(`[ByValuesModel]: Workbook not found for filter model with unitId: ${o}!`);
|
|
957
957
|
const h = c == null ? void 0 : c.getSheetBySheetId(l);
|
|
958
958
|
if (!h) throw new Error(`[ByValuesModel]: Worksheet not found for filter model with unitId: ${o} and subUnitId: ${l}!`);
|
|
959
|
-
const m = r.getRange(), S = s, p = r.getFilterColumn(s), _ = p == null ? void 0 : p.getColumnData().filters, C = new Set(_ == null ? void 0 : _.filters),
|
|
959
|
+
const m = r.getRange(), S = s, p = r.getFilterColumn(s), _ = p == null ? void 0 : p.getColumnData().filters, C = new Set(_ == null ? void 0 : _.filters), N = !!(_ && _.blank), F = r.getFilteredOutRowsExceptCol(s), R = { ...m, startRow: m.startRow + 1, startColumn: S, endColumn: S };
|
|
960
960
|
let O, A;
|
|
961
961
|
if (i) {
|
|
962
962
|
const w = await i.getFilterValues({
|
|
963
963
|
unitId: o,
|
|
964
964
|
subUnitId: l,
|
|
965
|
-
filteredOutRowsByOtherColumns: Array.from(
|
|
965
|
+
filteredOutRowsByOtherColumns: Array.from(F),
|
|
966
966
|
filterColumn: p,
|
|
967
967
|
filters: !!_,
|
|
968
|
-
blankChecked:
|
|
968
|
+
blankChecked: N,
|
|
969
969
|
iterateRange: R,
|
|
970
970
|
alreadyChecked: Array.from(C)
|
|
971
971
|
});
|
|
972
972
|
O = w.filterTreeItems, A = w.filterTreeMapCache;
|
|
973
973
|
} else {
|
|
974
|
-
const w =
|
|
974
|
+
const w = qt(
|
|
975
975
|
!!_,
|
|
976
976
|
a,
|
|
977
977
|
R,
|
|
978
978
|
h,
|
|
979
|
-
|
|
979
|
+
F,
|
|
980
980
|
p,
|
|
981
981
|
C,
|
|
982
|
-
|
|
982
|
+
N,
|
|
983
983
|
c.getStyles()
|
|
984
984
|
);
|
|
985
985
|
O = w.filterTreeItems, A = w.filterTreeMapCache;
|
|
986
986
|
}
|
|
987
|
-
return e.createInstance(
|
|
987
|
+
return e.createInstance(xe, r, s, O, A);
|
|
988
988
|
}
|
|
989
989
|
get rawFilterItems() {
|
|
990
990
|
return this._rawFilterItems$.getValue();
|
|
@@ -1005,24 +1005,24 @@ let $e = class extends ue {
|
|
|
1005
1005
|
this._searchString$.next(e);
|
|
1006
1006
|
}
|
|
1007
1007
|
onCheckAllToggled(e) {
|
|
1008
|
-
const r =
|
|
1009
|
-
r.forEach((s) =>
|
|
1008
|
+
const r = Pe.deepClone(this._filterItems);
|
|
1009
|
+
r.forEach((s) => Ee(s, e)), this._manuallyUpdateFilterItems(r);
|
|
1010
1010
|
}
|
|
1011
1011
|
/**
|
|
1012
1012
|
* Toggle a filter item.
|
|
1013
1013
|
*/
|
|
1014
1014
|
onFilterCheckToggled(e) {
|
|
1015
|
-
const r =
|
|
1015
|
+
const r = Pe.deepClone(this._filterItems), s = it(r, e.key);
|
|
1016
1016
|
if (!s)
|
|
1017
1017
|
return;
|
|
1018
|
-
const n =
|
|
1019
|
-
|
|
1018
|
+
const n = Xt(s);
|
|
1019
|
+
Ee(s, !n), this._manuallyUpdateFilterItems(r);
|
|
1020
1020
|
}
|
|
1021
1021
|
onFilterOnly(e) {
|
|
1022
|
-
const r =
|
|
1023
|
-
r.forEach((s) =>
|
|
1024
|
-
const n =
|
|
1025
|
-
n &&
|
|
1022
|
+
const r = Pe.deepClone(this._filterItems);
|
|
1023
|
+
r.forEach((s) => Ee(s, !1)), e.forEach((s) => {
|
|
1024
|
+
const n = it(r, s);
|
|
1025
|
+
n && Ee(n, !0);
|
|
1026
1026
|
}), this._manuallyUpdateFilterItems(r);
|
|
1027
1027
|
}
|
|
1028
1028
|
_manuallyUpdateFilterItems(e) {
|
|
@@ -1044,7 +1044,7 @@ let $e = class extends ue {
|
|
|
1044
1044
|
async apply() {
|
|
1045
1045
|
if (this._disposed)
|
|
1046
1046
|
return !1;
|
|
1047
|
-
const e =
|
|
1047
|
+
const e = tt(this._filterItems), { checked: r, checkedItems: s } = e, n = this.rawFilterItems;
|
|
1048
1048
|
let a = 0;
|
|
1049
1049
|
for (const c of n)
|
|
1050
1050
|
a += c.count;
|
|
@@ -1074,13 +1074,13 @@ let $e = class extends ue {
|
|
|
1074
1074
|
}
|
|
1075
1075
|
// #endregion
|
|
1076
1076
|
};
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
],
|
|
1080
|
-
let
|
|
1077
|
+
xe = Qe([
|
|
1078
|
+
Ie(4, j)
|
|
1079
|
+
], xe);
|
|
1080
|
+
let Ue = class extends fe {
|
|
1081
1081
|
constructor(e, r, s, n, a) {
|
|
1082
1082
|
super();
|
|
1083
|
-
v(this, "canApply$",
|
|
1083
|
+
v(this, "canApply$", pe(!0));
|
|
1084
1084
|
v(this, "_cellFillColors$");
|
|
1085
1085
|
v(this, "cellFillColors$");
|
|
1086
1086
|
v(this, "_cellTextColors$");
|
|
@@ -1099,28 +1099,28 @@ let Le = class extends ue {
|
|
|
1099
1099
|
*/
|
|
1100
1100
|
static async fromFilterColumn(e, r, s) {
|
|
1101
1101
|
var R, O, A;
|
|
1102
|
-
const n = e.get(
|
|
1102
|
+
const n = e.get(Be), { unitId: a, subUnitId: i } = r, o = n.getUniverSheetInstance(a);
|
|
1103
1103
|
if (!o) throw new Error(`[ByColorsModel]: Workbook not found for filter model with unitId: ${a}!`);
|
|
1104
1104
|
const l = o == null ? void 0 : o.getSheetBySheetId(i);
|
|
1105
1105
|
if (!l) throw new Error(`[ByColorsModel]: Worksheet not found for filter model with unitId: ${a} and subUnitId: ${i}!`);
|
|
1106
|
-
const c = r.getRange(), h = s, m = (R = r.getFilterColumn(s)) == null ? void 0 : R.getColumnData().colorFilters, S = r.getFilteredOutRowsExceptCol(s), p = { ...c, startRow: c.startRow + 1, startColumn: h, endColumn: h }, _ = /* @__PURE__ */ new Map(), C = new Set((O = m == null ? void 0 : m.cellFillColors) != null ? O : []),
|
|
1106
|
+
const c = r.getRange(), h = s, m = (R = r.getFilterColumn(s)) == null ? void 0 : R.getColumnData().colorFilters, S = r.getFilteredOutRowsExceptCol(s), p = { ...c, startRow: c.startRow + 1, startColumn: h, endColumn: h }, _ = /* @__PURE__ */ new Map(), C = new Set((O = m == null ? void 0 : m.cellFillColors) != null ? O : []), N = /* @__PURE__ */ new Map(), F = new Set((A = m == null ? void 0 : m.cellTextColors) != null ? A : []);
|
|
1107
1107
|
for (const w of l.iterateByColumn(p, !1, !0)) {
|
|
1108
1108
|
const { row: Y, col: Z, value: se } = w;
|
|
1109
1109
|
if (S.has(Y))
|
|
1110
1110
|
continue;
|
|
1111
1111
|
const M = l.getComposedCellStyleByCellData(Y, Z, se);
|
|
1112
1112
|
if (M.bg && M.bg.rgb) {
|
|
1113
|
-
const E = new
|
|
1113
|
+
const E = new gt(M.bg.rgb).toRgbString();
|
|
1114
1114
|
_.has(E) || _.set(E, { color: E, checked: C.has(E) });
|
|
1115
1115
|
} else
|
|
1116
1116
|
_.set("default-fill-color", { color: null, checked: C.has(null) });
|
|
1117
1117
|
if (M.cl && M.cl.rgb) {
|
|
1118
|
-
const E = new
|
|
1119
|
-
|
|
1118
|
+
const E = new gt(M.cl.rgb).toRgbString();
|
|
1119
|
+
N.has(E) || N.set(E, { color: E, checked: F.has(E) });
|
|
1120
1120
|
} else
|
|
1121
|
-
|
|
1121
|
+
N.set("default-font-color", { color: Et, checked: F.has(Et) });
|
|
1122
1122
|
}
|
|
1123
|
-
return e.createInstance(
|
|
1123
|
+
return e.createInstance(Ue, r, s, _, N);
|
|
1124
1124
|
}
|
|
1125
1125
|
get cellFillColors() {
|
|
1126
1126
|
return this._cellFillColors$.getValue();
|
|
@@ -1200,39 +1200,42 @@ let Le = class extends ue {
|
|
|
1200
1200
|
}
|
|
1201
1201
|
// #endregion
|
|
1202
1202
|
};
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
],
|
|
1206
|
-
const
|
|
1203
|
+
Ue = Qe([
|
|
1204
|
+
Ie(4, j)
|
|
1205
|
+
], Ue);
|
|
1206
|
+
const ce = "FILTER_PANEL_OPENED", ke = {
|
|
1207
1207
|
id: "sheet.operation.open-filter-panel",
|
|
1208
|
-
type:
|
|
1208
|
+
type: We.OPERATION,
|
|
1209
1209
|
handler: (t, e) => {
|
|
1210
|
-
const r = t.get(
|
|
1211
|
-
i != null && i.isVisible().visible && a.syncExecuteCommand(
|
|
1210
|
+
const r = t.get(Ve), s = t.get(X), n = t.get(q), a = t.get(j), i = t.has(Ct) ? t.get(Ct) : null;
|
|
1211
|
+
i != null && i.isVisible().visible && a.syncExecuteCommand(Ir.id, { visible: !1 });
|
|
1212
1212
|
const { unitId: o, subUnitId: l, col: c } = e, h = s.getFilterModel(o, l);
|
|
1213
|
-
return h ? (n.setupCol(h, c), r.getContextValue(
|
|
1213
|
+
return h ? (n.setupCol(h, c), r.getContextValue(ce) || r.setContextValue(ce, !0), !0) : !1;
|
|
1214
1214
|
}
|
|
1215
|
-
},
|
|
1215
|
+
}, Ne = {
|
|
1216
1216
|
id: "sheet.operation.close-filter-panel",
|
|
1217
|
-
type:
|
|
1217
|
+
type: We.OPERATION,
|
|
1218
1218
|
handler: (t) => {
|
|
1219
|
-
const e = t.get(
|
|
1220
|
-
return e.getContextValue(
|
|
1219
|
+
const e = t.get(Ve), r = t.get(q), s = t.get(xr, xt.OPTIONAL);
|
|
1220
|
+
return e.getContextValue(ce) ? (e.setContextValue(ce, !1), s == null || s.focus(), r.terminate()) : !1;
|
|
1221
1221
|
}
|
|
1222
|
-
},
|
|
1222
|
+
}, er = {
|
|
1223
1223
|
id: "sheet.operation.apply-filter",
|
|
1224
|
-
type:
|
|
1224
|
+
type: We.OPERATION,
|
|
1225
1225
|
handler: (t, e) => {
|
|
1226
1226
|
const { filterBy: r } = e;
|
|
1227
1227
|
return t.get(q).changeFilterBy(r);
|
|
1228
1228
|
}
|
|
1229
|
-
},
|
|
1230
|
-
|
|
1231
|
-
|
|
1229
|
+
}, Ti = "@univerjs/sheets-filter-ui", Ei = "0.17.0", ue = {
|
|
1230
|
+
name: Ti,
|
|
1231
|
+
version: Ei
|
|
1232
|
+
}, tr = "sheets-filter-ui.config", He = {};
|
|
1233
|
+
var Ni = Object.getOwnPropertyDescriptor, Fi = (t, e, r, s) => {
|
|
1234
|
+
for (var n = s > 1 ? void 0 : s ? Ni(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
1232
1235
|
(i = t[a]) && (n = i(n) || n);
|
|
1233
1236
|
return n;
|
|
1234
1237
|
}, oe = (t, e) => (r, s) => e(r, s, t);
|
|
1235
|
-
let
|
|
1238
|
+
let he = class extends fe {
|
|
1236
1239
|
constructor(t, e, r, s, n, a) {
|
|
1237
1240
|
super(), this._sheetsFilterService = t, this._localeService = e, this._commandService = r, this._sheetPermissionCheckPermission = s, this._injector = n, this._sheetsSelectionService = a, this._commandExecutedListener();
|
|
1238
1241
|
}
|
|
@@ -1240,55 +1243,55 @@ let ce = class extends ue {
|
|
|
1240
1243
|
this.disposeWithMe(
|
|
1241
1244
|
this._commandService.beforeCommandExecuted((t) => {
|
|
1242
1245
|
var e, r, s;
|
|
1243
|
-
if (t.id ===
|
|
1244
|
-
const n = this._injector.get(
|
|
1246
|
+
if (t.id === Oe.id) {
|
|
1247
|
+
const n = this._injector.get(Be), a = Zr(n);
|
|
1245
1248
|
if (!a) return;
|
|
1246
1249
|
const { unitId: i, subUnitId: o, worksheet: l } = a, c = (e = this._sheetsFilterService.getFilterModel(i, o)) == null ? void 0 : e.getRange();
|
|
1247
1250
|
let h;
|
|
1248
1251
|
if (c)
|
|
1249
1252
|
h = this._sheetPermissionCheckPermission.permissionCheckWithRanges({
|
|
1250
|
-
rangeTypes: [
|
|
1251
|
-
worksheetTypes: [
|
|
1253
|
+
rangeTypes: [Te],
|
|
1254
|
+
worksheetTypes: [Se, Ce]
|
|
1252
1255
|
}, [c], i, o);
|
|
1253
1256
|
else {
|
|
1254
1257
|
const m = (r = this._sheetsSelectionService.getCurrentLastSelection()) == null ? void 0 : r.range;
|
|
1255
1258
|
if (m) {
|
|
1256
1259
|
let S = { ...m };
|
|
1257
|
-
S = m.startColumn === m.endColumn && m.startRow === m.endRow ?
|
|
1258
|
-
rangeTypes: [
|
|
1259
|
-
worksheetTypes: [
|
|
1260
|
+
S = m.startColumn === m.endColumn && m.startRow === m.endRow ? zr(S, { left: !0, right: !0, up: !0, down: !0 }, l) : S, h = this._sheetPermissionCheckPermission.permissionCheckWithRanges({
|
|
1261
|
+
rangeTypes: [Te],
|
|
1262
|
+
worksheetTypes: [Ce, Se]
|
|
1260
1263
|
}, [S], i, o);
|
|
1261
1264
|
} else
|
|
1262
1265
|
h = this._sheetPermissionCheckPermission.permissionCheckWithoutRange({
|
|
1263
|
-
rangeTypes: [
|
|
1264
|
-
worksheetTypes: [
|
|
1266
|
+
rangeTypes: [Te],
|
|
1267
|
+
worksheetTypes: [Ce, Se]
|
|
1265
1268
|
});
|
|
1266
1269
|
}
|
|
1267
1270
|
h || this._sheetPermissionCheckPermission.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.filterErr"));
|
|
1268
1271
|
}
|
|
1269
|
-
if (t.id ===
|
|
1270
|
-
const n = t.params, { unitId: a, subUnitId: i } = n, o = (s = this._sheetsFilterService.getFilterModel(a, i)) == null ? void 0 : s.getRange(), l =
|
|
1272
|
+
if (t.id === ke.id) {
|
|
1273
|
+
const n = t.params, { unitId: a, subUnitId: i } = n, o = (s = this._sheetsFilterService.getFilterModel(a, i)) == null ? void 0 : s.getRange(), l = Pe.deepClone(o);
|
|
1271
1274
|
l && (l.startColumn = n.col, l.endColumn = n.col, this._sheetPermissionCheckPermission.permissionCheckWithRanges({
|
|
1272
|
-
rangeTypes: [
|
|
1273
|
-
worksheetTypes: [
|
|
1275
|
+
rangeTypes: [Te],
|
|
1276
|
+
worksheetTypes: [Se, Ce]
|
|
1274
1277
|
}, [l], a, i) || this._sheetPermissionCheckPermission.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.filterErr")));
|
|
1275
1278
|
}
|
|
1276
1279
|
})
|
|
1277
1280
|
);
|
|
1278
1281
|
}
|
|
1279
1282
|
};
|
|
1280
|
-
|
|
1283
|
+
he = Fi([
|
|
1281
1284
|
oe(0, T(X)),
|
|
1282
1285
|
oe(1, T(G)),
|
|
1283
1286
|
oe(2, j),
|
|
1284
|
-
oe(3, T(
|
|
1287
|
+
oe(3, T(jr)),
|
|
1285
1288
|
oe(4, T(re)),
|
|
1286
|
-
oe(5, T(
|
|
1287
|
-
],
|
|
1288
|
-
const K = 16,
|
|
1289
|
-
class
|
|
1289
|
+
oe(5, T(Yr))
|
|
1290
|
+
], he);
|
|
1291
|
+
const K = 16, Ii = 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");
|
|
1292
|
+
class bt {
|
|
1290
1293
|
static drawNoCriteria(e, r, s, n) {
|
|
1291
|
-
e.save(),
|
|
1294
|
+
e.save(), Nt.drawWith(e, {
|
|
1292
1295
|
radius: 2,
|
|
1293
1296
|
width: K,
|
|
1294
1297
|
height: K,
|
|
@@ -1296,21 +1299,21 @@ class It {
|
|
|
1296
1299
|
}), 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();
|
|
1297
1300
|
}
|
|
1298
1301
|
static drawHasCriteria(e, r, s, n) {
|
|
1299
|
-
e.save(),
|
|
1302
|
+
e.save(), Nt.drawWith(e, {
|
|
1300
1303
|
radius: 2,
|
|
1301
1304
|
width: K,
|
|
1302
1305
|
height: K,
|
|
1303
1306
|
fill: n
|
|
1304
|
-
}), e.scale(r / K, r / K), e.fillStyle = s, e.fill(
|
|
1307
|
+
}), e.scale(r / K, r / K), e.fillStyle = s, e.fill(Ii), e.restore();
|
|
1305
1308
|
}
|
|
1306
1309
|
}
|
|
1307
|
-
var
|
|
1308
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
1310
|
+
var yi = Object.getOwnPropertyDescriptor, Oi = (t, e, r, s) => {
|
|
1311
|
+
for (var n = s > 1 ? void 0 : s ? yi(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
1309
1312
|
(i = t[a]) && (n = i(n) || n);
|
|
1310
1313
|
return n;
|
|
1311
|
-
},
|
|
1312
|
-
const B = 16,
|
|
1313
|
-
let
|
|
1314
|
+
}, Je = (t, e) => (r, s) => e(r, s, t);
|
|
1315
|
+
const B = 16, Fe = 1;
|
|
1316
|
+
let st = class extends Qr {
|
|
1314
1317
|
constructor(e, r, s, n, a) {
|
|
1315
1318
|
super(e, r);
|
|
1316
1319
|
v(this, "_cellWidth", 0);
|
|
@@ -1331,14 +1334,14 @@ let tt = class extends Vr {
|
|
|
1331
1334
|
const i = new Path2D();
|
|
1332
1335
|
i.rect(n, a, s, r), e.clip(i);
|
|
1333
1336
|
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)";
|
|
1334
|
-
o ?
|
|
1337
|
+
o ? bt.drawHasCriteria(e, B, l, c) : bt.drawNoCriteria(e, B, l, c), e.restore();
|
|
1335
1338
|
}
|
|
1336
1339
|
onPointerDown(e) {
|
|
1337
1340
|
if (e.button === 2)
|
|
1338
1341
|
return;
|
|
1339
1342
|
const { col: r, unitId: s, subUnitId: n } = this._filterParams;
|
|
1340
|
-
this._contextService.getContextValue(
|
|
1341
|
-
this._commandService.executeCommand(
|
|
1343
|
+
this._contextService.getContextValue(ce) || !this._commandService.hasCommand(ke.id) || setTimeout(() => {
|
|
1344
|
+
this._commandService.executeCommand(ke.id, {
|
|
1342
1345
|
unitId: s,
|
|
1343
1346
|
subUnitId: n,
|
|
1344
1347
|
col: r
|
|
@@ -1352,29 +1355,29 @@ let tt = class extends Vr {
|
|
|
1352
1355
|
this._hovered = !1, this.makeDirty(!0);
|
|
1353
1356
|
}
|
|
1354
1357
|
};
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
],
|
|
1360
|
-
var
|
|
1361
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
1358
|
+
st = Oi([
|
|
1359
|
+
Je(2, Ve),
|
|
1360
|
+
Je(3, j),
|
|
1361
|
+
Je(4, T(Ut))
|
|
1362
|
+
], st);
|
|
1363
|
+
var bi = Object.getOwnPropertyDescriptor, Ri = (t, e, r, s) => {
|
|
1364
|
+
for (var n = s > 1 ? void 0 : s ? bi(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
1362
1365
|
(i = t[a]) && (n = i(n) || n);
|
|
1363
1366
|
return n;
|
|
1364
1367
|
}, te = (t, e) => (r, s) => e(r, s, t);
|
|
1365
|
-
const
|
|
1366
|
-
function
|
|
1368
|
+
const Ai = 1e3, Pi = 5e3;
|
|
1369
|
+
function wi(t, e, r, s) {
|
|
1367
1370
|
switch (s) {
|
|
1368
|
-
case
|
|
1369
|
-
return t +
|
|
1370
|
-
case
|
|
1371
|
+
case we.TOP:
|
|
1372
|
+
return t + Fe;
|
|
1373
|
+
case we.MIDDLE:
|
|
1371
1374
|
return t + Math.max(0, (r - B) / 2);
|
|
1372
|
-
case
|
|
1375
|
+
case we.BOTTOM:
|
|
1373
1376
|
default:
|
|
1374
|
-
return e - B -
|
|
1377
|
+
return e - B - Fe;
|
|
1375
1378
|
}
|
|
1376
1379
|
}
|
|
1377
|
-
let
|
|
1380
|
+
let nt = class extends kt {
|
|
1378
1381
|
constructor(e, r, s, n, a, i, o, l) {
|
|
1379
1382
|
super();
|
|
1380
1383
|
v(this, "_filterRangeShape", null);
|
|
@@ -1387,9 +1390,9 @@ let rt = class extends Mt {
|
|
|
1387
1390
|
}
|
|
1388
1391
|
_initRenderer() {
|
|
1389
1392
|
this._sheetSkeletonManagerService.currentSkeleton$.pipe(
|
|
1390
|
-
|
|
1393
|
+
ht((e) => {
|
|
1391
1394
|
var o, l;
|
|
1392
|
-
if (!e) return
|
|
1395
|
+
if (!e) return pe(null);
|
|
1393
1396
|
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 = () => ({
|
|
1394
1397
|
unitId: s,
|
|
1395
1398
|
worksheetId: n,
|
|
@@ -1397,28 +1400,28 @@ let rt = class extends Mt {
|
|
|
1397
1400
|
range: a == null ? void 0 : a.getRange(),
|
|
1398
1401
|
skeleton: e.skeleton
|
|
1399
1402
|
});
|
|
1400
|
-
return
|
|
1401
|
-
|
|
1403
|
+
return mr(this._commandService.onCommandExecuted.bind(this._commandService)).pipe(
|
|
1404
|
+
si(
|
|
1402
1405
|
([c]) => {
|
|
1403
1406
|
var h;
|
|
1404
|
-
return c.type ===
|
|
1407
|
+
return c.type === We.MUTATION && ((h = c.params) == null ? void 0 : h.unitId) === r.getUnitId() && (_r.has(c.id) || c.id === qr.id);
|
|
1405
1408
|
}
|
|
1406
1409
|
),
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
+
jt(20, void 0, { leading: !1, trailing: !0 }),
|
|
1411
|
+
ae(i),
|
|
1412
|
+
Yt(i())
|
|
1410
1413
|
// must trigger once
|
|
1411
1414
|
);
|
|
1412
1415
|
}),
|
|
1413
|
-
|
|
1416
|
+
ni(this.dispose$)
|
|
1414
1417
|
).subscribe((e) => {
|
|
1415
1418
|
this._disposeRendering(), !(!e || !e.range) && (this._renderRange(e.range, e.skeleton), this._renderButtons(e));
|
|
1416
1419
|
});
|
|
1417
1420
|
}
|
|
1418
1421
|
_renderRange(e, r) {
|
|
1419
|
-
const { scene: s } = this._context, { rowHeaderWidth: n, columnHeaderHeight: a } = r, i = this._filterRangeShape = new
|
|
1422
|
+
const { scene: s } = this._context, { rowHeaderWidth: n, columnHeaderHeight: a } = r, i = this._filterRangeShape = new br(
|
|
1420
1423
|
s,
|
|
1421
|
-
|
|
1424
|
+
Ai,
|
|
1422
1425
|
this._themeService,
|
|
1423
1426
|
{
|
|
1424
1427
|
rowHeaderWidth: n,
|
|
@@ -1426,7 +1429,7 @@ let rt = class extends Mt {
|
|
|
1426
1429
|
enableAutoFill: !1,
|
|
1427
1430
|
highlightHeader: !1
|
|
1428
1431
|
}
|
|
1429
|
-
), l =
|
|
1432
|
+
), l = Rr({
|
|
1430
1433
|
range: e,
|
|
1431
1434
|
primary: null,
|
|
1432
1435
|
style: { fill: "rgba(0, 0, 0, 0.0)" }
|
|
@@ -1440,27 +1443,27 @@ let rt = class extends Mt {
|
|
|
1440
1443
|
this._interceptCellContent(n, i, e.range);
|
|
1441
1444
|
const { startColumn: h, endColumn: m, startRow: S } = r;
|
|
1442
1445
|
for (let p = h; p <= m; p++) {
|
|
1443
|
-
const _ = `sheets-filter-button-${p}`, C =
|
|
1444
|
-
if (Z <=
|
|
1446
|
+
const _ = `sheets-filter-button-${p}`, C = Ar(S, p, l, a), N = c.getComposedCellStyle(S, p), F = (N == null ? void 0 : N.vt) || we.BOTTOM, { startX: R, startY: O, endX: A, endY: w } = C, Y = A - R, Z = w - O;
|
|
1447
|
+
if (Z <= Fe || Y <= Fe)
|
|
1445
1448
|
continue;
|
|
1446
|
-
const se = !!s.getFilterColumn(p), M = A - B -
|
|
1449
|
+
const se = !!s.getFilterColumn(p), M = A - B - Fe, E = wi(O, w, Z, F), Ye = {
|
|
1447
1450
|
left: M,
|
|
1448
1451
|
top: E,
|
|
1449
1452
|
height: B,
|
|
1450
1453
|
width: B,
|
|
1451
|
-
zIndex:
|
|
1454
|
+
zIndex: Pi,
|
|
1452
1455
|
cellHeight: Z,
|
|
1453
1456
|
cellWidth: Y,
|
|
1454
1457
|
filterParams: { unitId: n, subUnitId: i, col: p, hasCriteria: se }
|
|
1455
|
-
},
|
|
1456
|
-
this._filterButtonShapes.push(
|
|
1458
|
+
}, Re = this._injector.createInstance(st, _, Ye);
|
|
1459
|
+
this._filterButtonShapes.push(Re);
|
|
1457
1460
|
}
|
|
1458
1461
|
l.addObjects(this._filterButtonShapes), l.makeDirty();
|
|
1459
1462
|
}
|
|
1460
1463
|
_interceptCellContent(e, r, s) {
|
|
1461
1464
|
const { startRow: n, startColumn: a, endColumn: i } = s;
|
|
1462
|
-
this._buttonRenderDisposable = this._sheetInterceptorService.intercept(
|
|
1463
|
-
effect:
|
|
1465
|
+
this._buttonRenderDisposable = this._sheetInterceptorService.intercept(Xr.CELL_CONTENT, {
|
|
1466
|
+
effect: fr.Style,
|
|
1464
1467
|
handler: (o, l, c) => {
|
|
1465
1468
|
const { row: h, col: m, unitId: S, subUnitId: p } = l;
|
|
1466
1469
|
return S !== e || p !== r || h !== n || m < a || m > i || ((!o || o === l.rawData) && (o = { ...l.rawData }), o.fontRenderExtension = {
|
|
@@ -1476,76 +1479,77 @@ let rt = class extends Mt {
|
|
|
1476
1479
|
(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 = [];
|
|
1477
1480
|
}
|
|
1478
1481
|
};
|
|
1479
|
-
|
|
1482
|
+
nt = Ri([
|
|
1480
1483
|
te(1, T(re)),
|
|
1481
|
-
te(2, T(
|
|
1484
|
+
te(2, T(yr)),
|
|
1482
1485
|
te(3, T(X)),
|
|
1483
|
-
te(4, T(
|
|
1484
|
-
te(5, T(
|
|
1486
|
+
te(4, T(Ut)),
|
|
1487
|
+
te(5, T(Kr)),
|
|
1485
1488
|
te(6, j),
|
|
1486
|
-
te(7,
|
|
1487
|
-
],
|
|
1488
|
-
var
|
|
1489
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
1489
|
+
te(7, Or)
|
|
1490
|
+
], nt);
|
|
1491
|
+
var $i = Object.getOwnPropertyDescriptor, Li = (t, e, r, s) => {
|
|
1492
|
+
for (var n = s > 1 ? void 0 : s ? $i(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
1490
1493
|
(i = t[a]) && (n = i(n) || n);
|
|
1491
1494
|
return n;
|
|
1492
|
-
},
|
|
1493
|
-
let
|
|
1495
|
+
}, Rt = (t, e) => (r, s) => e(r, s, t);
|
|
1496
|
+
let ye = class extends kt {
|
|
1494
1497
|
constructor(t, e) {
|
|
1495
1498
|
super(), this._renderManagerService = t, this._sheetsRenderService = e, [
|
|
1496
|
-
_r,
|
|
1497
1499
|
gr,
|
|
1498
1500
|
Sr,
|
|
1499
|
-
Cr
|
|
1501
|
+
Cr,
|
|
1502
|
+
Tr
|
|
1500
1503
|
].forEach((r) => this.disposeWithMe(this._sheetsRenderService.registerSkeletonChangingMutations(r.id))), this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
1501
1504
|
ie.UNIVER_SHEET,
|
|
1502
|
-
[
|
|
1505
|
+
[nt]
|
|
1503
1506
|
));
|
|
1504
1507
|
}
|
|
1505
1508
|
};
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
],
|
|
1510
|
-
var
|
|
1511
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
1509
|
+
ye = Li([
|
|
1510
|
+
Rt(0, Gt),
|
|
1511
|
+
Rt(1, T(Vt))
|
|
1512
|
+
], ye);
|
|
1513
|
+
var Mi = Object.defineProperty, xi = Object.getOwnPropertyDescriptor, Ui = (t, e, r) => e in t ? Mi(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, ki = (t, e, r, s) => {
|
|
1514
|
+
for (var n = s > 1 ? void 0 : s ? xi(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
1512
1515
|
(i = t[a]) && (n = i(n) || n);
|
|
1513
1516
|
return n;
|
|
1514
|
-
},
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
constructor(t = xe, e, r) {
|
|
1517
|
+
}, At = (t, e) => (r, s) => e(r, s, t), Ge = (t, e, r) => Ui(t, typeof e != "symbol" ? e + "" : e, r);
|
|
1518
|
+
let de = class extends ot {
|
|
1519
|
+
constructor(t = He, e, r) {
|
|
1518
1520
|
super(), this._config = t, this._injector = e, this._configService = r;
|
|
1519
|
-
const { menu: s, ...n } =
|
|
1521
|
+
const { menu: s, ...n } = Bt(
|
|
1520
1522
|
{},
|
|
1521
|
-
|
|
1523
|
+
He,
|
|
1522
1524
|
this._config
|
|
1523
1525
|
);
|
|
1524
|
-
s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(
|
|
1526
|
+
s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(tr, n);
|
|
1525
1527
|
}
|
|
1526
1528
|
onStarting() {
|
|
1527
1529
|
[
|
|
1528
|
-
[
|
|
1529
|
-
[
|
|
1530
|
+
[he],
|
|
1531
|
+
[ye]
|
|
1530
1532
|
].forEach((t) => this._injector.add(t));
|
|
1531
1533
|
}
|
|
1532
1534
|
onReady() {
|
|
1533
|
-
this._injector.get(
|
|
1535
|
+
this._injector.get(he);
|
|
1534
1536
|
}
|
|
1535
1537
|
onRendered() {
|
|
1536
|
-
this._injector.get(
|
|
1538
|
+
this._injector.get(ye);
|
|
1537
1539
|
}
|
|
1538
1540
|
};
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1541
|
+
Ge(de, "type", ie.UNIVER_SHEET);
|
|
1542
|
+
Ge(de, "pluginName", "SHEET_FILTER_UI_PLUGIN");
|
|
1543
|
+
Ge(de, "packageName", ue.name);
|
|
1544
|
+
Ge(de, "version", ue.version);
|
|
1545
|
+
de = ki([
|
|
1546
|
+
Ht(Wt),
|
|
1547
|
+
At(1, T(re)),
|
|
1548
|
+
At(2, Dt)
|
|
1549
|
+
], de);
|
|
1550
|
+
function _e({ ref: t, ...e }) {
|
|
1551
|
+
const { icon: r, id: s, className: n, extend: a, ...i } = e, o = `univerjs-icon univerjs-icon-${s} ${n || ""}`.trim(), l = pi(`_${Bi()}`);
|
|
1552
|
+
return rr(r, `${s}`, {
|
|
1549
1553
|
defIds: r.defIds,
|
|
1550
1554
|
idSuffix: l.current
|
|
1551
1555
|
}, {
|
|
@@ -1554,14 +1558,14 @@ function me({ ref: t, ...e }) {
|
|
|
1554
1558
|
...i
|
|
1555
1559
|
}, a);
|
|
1556
1560
|
}
|
|
1557
|
-
function
|
|
1558
|
-
return
|
|
1561
|
+
function rr(t, e, r, s, n) {
|
|
1562
|
+
return ve(t.tag, {
|
|
1559
1563
|
key: e,
|
|
1560
|
-
...
|
|
1564
|
+
...Hi(t, r, n),
|
|
1561
1565
|
...s
|
|
1562
|
-
}, (
|
|
1566
|
+
}, (Di(t, r).children || []).map((a, i) => rr(a, `${e}-${t.tag}-${i}`, r, void 0, n)));
|
|
1563
1567
|
}
|
|
1564
|
-
function
|
|
1568
|
+
function Hi(t, e, r) {
|
|
1565
1569
|
const s = { ...t.attrs };
|
|
1566
1570
|
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(([a, i]) => {
|
|
1567
1571
|
a === "mask" && typeof i == "string" && (s[a] = i.replace(/url\(#(.*)\)/, `url(#$1${e.idSuffix})`));
|
|
@@ -1571,7 +1575,7 @@ function Ui(t, e, r) {
|
|
|
1571
1575
|
typeof i == "string" && (s[a] = i.replace(/url\(#(.*)\)/, `url(#$1${e.idSuffix})`));
|
|
1572
1576
|
})), s;
|
|
1573
1577
|
}
|
|
1574
|
-
function
|
|
1578
|
+
function Di(t, e) {
|
|
1575
1579
|
var s;
|
|
1576
1580
|
const { defIds: r } = e;
|
|
1577
1581
|
return !r || r.length === 0 ? t : t.tag === "defs" && ((s = t.children) != null && s.length) ? {
|
|
@@ -1585,11 +1589,11 @@ function ki(t, e) {
|
|
|
1585
1589
|
} : n)
|
|
1586
1590
|
} : t;
|
|
1587
1591
|
}
|
|
1588
|
-
function
|
|
1592
|
+
function Bi() {
|
|
1589
1593
|
return Math.random().toString(36).substring(2, 8);
|
|
1590
1594
|
}
|
|
1591
|
-
|
|
1592
|
-
const
|
|
1595
|
+
_e.displayName = "UniverIcon";
|
|
1596
|
+
const Wi = {
|
|
1593
1597
|
tag: "svg",
|
|
1594
1598
|
attrs: {
|
|
1595
1599
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1611,15 +1615,15 @@ const Di = {
|
|
|
1611
1615
|
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"
|
|
1612
1616
|
}
|
|
1613
1617
|
}]
|
|
1614
|
-
},
|
|
1615
|
-
return
|
|
1618
|
+
}, ir = be(function(e, r) {
|
|
1619
|
+
return ve(_e, Object.assign({}, e, {
|
|
1616
1620
|
id: "a-icon",
|
|
1617
1621
|
ref: r,
|
|
1618
|
-
icon:
|
|
1622
|
+
icon: Wi
|
|
1619
1623
|
}));
|
|
1620
1624
|
});
|
|
1621
|
-
|
|
1622
|
-
const
|
|
1625
|
+
ir.displayName = "AIcon";
|
|
1626
|
+
const Vi = {
|
|
1623
1627
|
tag: "svg",
|
|
1624
1628
|
attrs: {
|
|
1625
1629
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1641,15 +1645,15 @@ const Bi = {
|
|
|
1641
1645
|
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"
|
|
1642
1646
|
}
|
|
1643
1647
|
}]
|
|
1644
|
-
},
|
|
1645
|
-
return
|
|
1648
|
+
}, sr = be(function(e, r) {
|
|
1649
|
+
return ve(_e, Object.assign({}, e, {
|
|
1646
1650
|
id: "ban-icon",
|
|
1647
1651
|
ref: r,
|
|
1648
|
-
icon:
|
|
1652
|
+
icon: Vi
|
|
1649
1653
|
}));
|
|
1650
1654
|
});
|
|
1651
|
-
|
|
1652
|
-
const
|
|
1655
|
+
sr.displayName = "BanIcon";
|
|
1656
|
+
const Qi = {
|
|
1653
1657
|
tag: "svg",
|
|
1654
1658
|
attrs: {
|
|
1655
1659
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1667,15 +1671,15 @@ const Wi = {
|
|
|
1667
1671
|
clipRule: "evenodd"
|
|
1668
1672
|
}
|
|
1669
1673
|
}]
|
|
1670
|
-
},
|
|
1671
|
-
return
|
|
1674
|
+
}, nr = be(function(e, r) {
|
|
1675
|
+
return ve(_e, Object.assign({}, e, {
|
|
1672
1676
|
id: "filter-icon",
|
|
1673
1677
|
ref: r,
|
|
1674
|
-
icon:
|
|
1678
|
+
icon: Qi
|
|
1675
1679
|
}));
|
|
1676
1680
|
});
|
|
1677
|
-
|
|
1678
|
-
const
|
|
1681
|
+
nr.displayName = "FilterIcon";
|
|
1682
|
+
const Gi = {
|
|
1679
1683
|
tag: "svg",
|
|
1680
1684
|
attrs: {
|
|
1681
1685
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1691,15 +1695,15 @@ const Vi = {
|
|
|
1691
1695
|
d: "M8.00016 1.33203C6.68162 1.33203 5.39269 1.72302 4.29636 2.45557C3.20004 3.18811 2.34555 4.2293 1.84097 5.44747C1.33638 6.66565 1.20436 8.00609 1.4616 9.2993C1.71883 10.5925 2.35377 11.7804 3.28612 12.7127C4.21847 13.6451 5.40636 14.28 6.69956 14.5373C7.99277 14.7945 9.33321 14.6625 10.5514 14.1579C11.7696 13.6533 12.8108 12.7988 13.5433 11.7025C14.2758 10.6062 14.6668 9.31724 14.6668 7.9987C14.6649 6.23118 13.9619 4.53662 12.7121 3.2868C11.4622 2.03697 9.76768 1.33397 8.00016 1.33203ZM7.66683 3.9987C7.86461 3.9987 8.05795 4.05735 8.2224 4.16723C8.38685 4.27711 8.51502 4.43329 8.59071 4.61601C8.6664 4.79874 8.6862 4.99981 8.64762 5.19379C8.60903 5.38777 8.51379 5.56595 8.37394 5.7058C8.23409 5.84566 8.0559 5.9409 7.86192 5.97948C7.66794 6.01807 7.46687 5.99826 7.28415 5.92258C7.10142 5.84689 6.94524 5.71872 6.83536 5.55427C6.72548 5.38982 6.66683 5.19648 6.66683 4.9987C6.66683 4.73348 6.77219 4.47913 6.95972 4.29159C7.14726 4.10405 7.40162 3.9987 7.66683 3.9987ZM9.3335 11.332H6.66683C6.49002 11.332 6.32045 11.2618 6.19543 11.1368C6.0704 11.0117 6.00016 10.8422 6.00016 10.6654C6.00016 10.4886 6.0704 10.319 6.19543 10.194C6.32045 10.0689 6.49002 9.9987 6.66683 9.9987H7.3335V7.9987H6.66683C6.49002 7.9987 6.32045 7.92846 6.19543 7.80343C6.0704 7.67841 6.00016 7.50884 6.00016 7.33203C6.00016 7.15522 6.0704 6.98565 6.19543 6.86063C6.32045 6.7356 6.49002 6.66536 6.66683 6.66536H8.00016C8.17698 6.66536 8.34655 6.7356 8.47157 6.86063C8.59659 6.98565 8.66683 7.15522 8.66683 7.33203V9.9987H9.3335C9.51031 9.9987 9.67988 10.0689 9.8049 10.194C9.92993 10.319 10.0002 10.4886 10.0002 10.6654C10.0002 10.8422 9.92993 11.0117 9.8049 11.1368C9.67988 11.2618 9.51031 11.332 9.3335 11.332Z"
|
|
1692
1696
|
}
|
|
1693
1697
|
}]
|
|
1694
|
-
},
|
|
1695
|
-
return
|
|
1698
|
+
}, or = be(function(e, r) {
|
|
1699
|
+
return ve(_e, Object.assign({}, e, {
|
|
1696
1700
|
id: "info-icon",
|
|
1697
1701
|
ref: r,
|
|
1698
|
-
icon:
|
|
1702
|
+
icon: Gi
|
|
1699
1703
|
}));
|
|
1700
1704
|
});
|
|
1701
|
-
|
|
1702
|
-
const
|
|
1705
|
+
or.displayName = "InfoIcon";
|
|
1706
|
+
const ji = {
|
|
1703
1707
|
tag: "svg",
|
|
1704
1708
|
attrs: {
|
|
1705
1709
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1717,15 +1721,78 @@ const Qi = {
|
|
|
1717
1721
|
clipRule: "evenodd"
|
|
1718
1722
|
}
|
|
1719
1723
|
}]
|
|
1720
|
-
},
|
|
1721
|
-
return
|
|
1724
|
+
}, lr = be(function(e, r) {
|
|
1725
|
+
return ve(_e, Object.assign({}, e, {
|
|
1722
1726
|
id: "success-icon",
|
|
1723
1727
|
ref: r,
|
|
1724
|
-
icon:
|
|
1728
|
+
icon: ji
|
|
1725
1729
|
}));
|
|
1726
1730
|
});
|
|
1727
|
-
|
|
1728
|
-
function
|
|
1731
|
+
lr.displayName = "SuccessIcon";
|
|
1732
|
+
function Yi(t) {
|
|
1733
|
+
const e = t.get(X);
|
|
1734
|
+
return {
|
|
1735
|
+
id: Oe.id,
|
|
1736
|
+
type: ut.BUTTON_SELECTOR,
|
|
1737
|
+
icon: "FilterIcon",
|
|
1738
|
+
tooltip: "sheets-filter.toolbar.smart-toggle-filter-tooltip",
|
|
1739
|
+
hidden$: ct(t, ie.UNIVER_SHEET),
|
|
1740
|
+
activated$: e.activeFilterModel$.pipe(ae((r) => !!r)),
|
|
1741
|
+
disabled$: Pr(
|
|
1742
|
+
t,
|
|
1743
|
+
wr(
|
|
1744
|
+
t,
|
|
1745
|
+
{
|
|
1746
|
+
worksheetTypes: [Se, Ce],
|
|
1747
|
+
rangeTypes: [Te]
|
|
1748
|
+
}
|
|
1749
|
+
)
|
|
1750
|
+
)
|
|
1751
|
+
};
|
|
1752
|
+
}
|
|
1753
|
+
function Zi(t) {
|
|
1754
|
+
const e = t.get(X);
|
|
1755
|
+
return {
|
|
1756
|
+
id: at.id,
|
|
1757
|
+
type: ut.BUTTON,
|
|
1758
|
+
title: "sheets-filter.toolbar.clear-filter-criteria",
|
|
1759
|
+
hidden$: ct(t, ie.UNIVER_SHEET),
|
|
1760
|
+
disabled$: e.activeFilterModel$.pipe(ht((r) => {
|
|
1761
|
+
var s;
|
|
1762
|
+
return (s = r == null ? void 0 : r.hasCriteria$.pipe(ae((n) => !n))) != null ? s : pe(!0);
|
|
1763
|
+
}))
|
|
1764
|
+
};
|
|
1765
|
+
}
|
|
1766
|
+
function zi(t) {
|
|
1767
|
+
const e = t.get(X);
|
|
1768
|
+
return {
|
|
1769
|
+
id: lt.id,
|
|
1770
|
+
type: ut.BUTTON,
|
|
1771
|
+
title: "sheets-filter.toolbar.re-calc-filter-conditions",
|
|
1772
|
+
hidden$: ct(t, ie.UNIVER_SHEET),
|
|
1773
|
+
disabled$: e.activeFilterModel$.pipe(ht((r) => {
|
|
1774
|
+
var s;
|
|
1775
|
+
return (s = r == null ? void 0 : r.hasCriteria$.pipe(ae((n) => !n))) != null ? s : pe(!0);
|
|
1776
|
+
}))
|
|
1777
|
+
};
|
|
1778
|
+
}
|
|
1779
|
+
const Ki = {
|
|
1780
|
+
[Ur.ORGANIZATION]: {
|
|
1781
|
+
[Oe.id]: {
|
|
1782
|
+
order: 2,
|
|
1783
|
+
menuItemFactory: Yi,
|
|
1784
|
+
[at.id]: {
|
|
1785
|
+
order: 0,
|
|
1786
|
+
menuItemFactory: Zi
|
|
1787
|
+
},
|
|
1788
|
+
[lt.id]: {
|
|
1789
|
+
order: 1,
|
|
1790
|
+
menuItemFactory: zi
|
|
1791
|
+
}
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
};
|
|
1795
|
+
function qi(t) {
|
|
1729
1796
|
const { model: e } = t, r = D(G), s = L(e.cellFillColors$, [], !0), n = L(e.cellTextColors$, [], !0), a = U((o) => {
|
|
1730
1797
|
e.onFilterCheckToggled(o);
|
|
1731
1798
|
}, [e]), i = U((o) => {
|
|
@@ -1740,7 +1807,7 @@ function Gi(t) {
|
|
|
1740
1807
|
"div",
|
|
1741
1808
|
{
|
|
1742
1809
|
"data-u-comp": "sheets-filter-panel",
|
|
1743
|
-
className:
|
|
1810
|
+
className: $e("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", dt),
|
|
1744
1811
|
children: [
|
|
1745
1812
|
s.length > 1 && /* @__PURE__ */ y("div", { children: [
|
|
1746
1813
|
/* @__PURE__ */ d(
|
|
@@ -1764,16 +1831,16 @@ function Gi(t) {
|
|
|
1764
1831
|
"button",
|
|
1765
1832
|
{
|
|
1766
1833
|
type: "button",
|
|
1767
|
-
className:
|
|
1834
|
+
className: $e("univer-box-border univer-size-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"),
|
|
1768
1835
|
style: { backgroundColor: o.color }
|
|
1769
1836
|
}
|
|
1770
1837
|
) : /* @__PURE__ */ d(
|
|
1771
|
-
|
|
1838
|
+
sr,
|
|
1772
1839
|
{
|
|
1773
1840
|
className: "univer-size-6 univer-cursor-pointer univer-rounded-full hover:univer-ring-2 hover:univer-ring-offset-2 hover:univer-ring-offset-white"
|
|
1774
1841
|
}
|
|
1775
1842
|
),
|
|
1776
|
-
o.checked && /* @__PURE__ */ d(
|
|
1843
|
+
o.checked && /* @__PURE__ */ d(Pt, {})
|
|
1777
1844
|
]
|
|
1778
1845
|
},
|
|
1779
1846
|
`sheets-filter-cell-fill-color-${l}`
|
|
@@ -1803,10 +1870,10 @@ function Gi(t) {
|
|
|
1803
1870
|
"div",
|
|
1804
1871
|
{
|
|
1805
1872
|
className: "univer-box-border univer-flex univer-size-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)]",
|
|
1806
|
-
children: /* @__PURE__ */ d(
|
|
1873
|
+
children: /* @__PURE__ */ d(ir, { style: { color: o.color } })
|
|
1807
1874
|
}
|
|
1808
1875
|
),
|
|
1809
|
-
o.checked && /* @__PURE__ */ d(
|
|
1876
|
+
o.checked && /* @__PURE__ */ d(Pt, {})
|
|
1810
1877
|
]
|
|
1811
1878
|
},
|
|
1812
1879
|
`sheets-filter-cell-text-color-${l}`
|
|
@@ -1827,13 +1894,13 @@ function Gi(t) {
|
|
|
1827
1894
|
}
|
|
1828
1895
|
);
|
|
1829
1896
|
}
|
|
1830
|
-
function
|
|
1897
|
+
function Pt() {
|
|
1831
1898
|
return /* @__PURE__ */ d(
|
|
1832
1899
|
"div",
|
|
1833
1900
|
{
|
|
1834
1901
|
className: "univer-absolute -univer-bottom-0.5 -univer-right-0.5 univer-flex univer-size-3 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-full univer-bg-white",
|
|
1835
1902
|
children: /* @__PURE__ */ d(
|
|
1836
|
-
|
|
1903
|
+
lr,
|
|
1837
1904
|
{
|
|
1838
1905
|
className: "univer-size-full univer-font-bold univer-text-[#418F1F]"
|
|
1839
1906
|
}
|
|
@@ -1841,37 +1908,37 @@ function bt() {
|
|
|
1841
1908
|
}
|
|
1842
1909
|
);
|
|
1843
1910
|
}
|
|
1844
|
-
function
|
|
1911
|
+
function Xi(t) {
|
|
1845
1912
|
var p, _;
|
|
1846
1913
|
const { model: e } = t, r = D(G), s = L(e.conditionItem$, void 0), n = L(e.filterConditionFormParams$, void 0), a = n != null && n.and ? "AND" : "OR", i = U((C) => {
|
|
1847
1914
|
e.onConditionFormChange({ and: C === "AND" });
|
|
1848
|
-
}, [e]), o =
|
|
1915
|
+
}, [e]), o = Ji(r), l = U((C) => {
|
|
1849
1916
|
e.onPrimaryConditionChange(C);
|
|
1850
|
-
}, [e]), c =
|
|
1917
|
+
}, [e]), c = es(r), h = U((C) => {
|
|
1851
1918
|
e.onConditionFormChange(C);
|
|
1852
1919
|
}, [e]), m = r.t("sheets-filter.panel.input-values-placeholder");
|
|
1853
|
-
function S(C,
|
|
1920
|
+
function S(C, N, F) {
|
|
1854
1921
|
const R = f.getItemByOperator(C).numOfParameters === 1;
|
|
1855
|
-
return /* @__PURE__ */ y(
|
|
1856
|
-
|
|
1857
|
-
/* @__PURE__ */ d(
|
|
1858
|
-
/* @__PURE__ */ d(
|
|
1922
|
+
return /* @__PURE__ */ y(yt, { children: [
|
|
1923
|
+
F === "operator2" && /* @__PURE__ */ y(ci, { value: a, onChange: i, children: [
|
|
1924
|
+
/* @__PURE__ */ d(It, { value: "AND", children: r.t("sheets-filter.panel.and") }),
|
|
1925
|
+
/* @__PURE__ */ d(It, { value: "OR", children: r.t("sheets-filter.panel.or") })
|
|
1859
1926
|
] }),
|
|
1860
1927
|
/* @__PURE__ */ d(
|
|
1861
|
-
|
|
1928
|
+
Ft,
|
|
1862
1929
|
{
|
|
1863
1930
|
value: C,
|
|
1864
1931
|
options: c,
|
|
1865
|
-
onChange: (O) => h({ [
|
|
1932
|
+
onChange: (O) => h({ [F]: O })
|
|
1866
1933
|
}
|
|
1867
1934
|
),
|
|
1868
1935
|
R && /* @__PURE__ */ d("div", { children: /* @__PURE__ */ d(
|
|
1869
|
-
|
|
1936
|
+
zt,
|
|
1870
1937
|
{
|
|
1871
1938
|
className: "univer-mt-2",
|
|
1872
|
-
value:
|
|
1939
|
+
value: N,
|
|
1873
1940
|
placeholder: m,
|
|
1874
|
-
onChange: (O) => h({ [
|
|
1941
|
+
onChange: (O) => h({ [F === "operator1" ? "val1" : "val2"]: O })
|
|
1875
1942
|
}
|
|
1876
1943
|
) })
|
|
1877
1944
|
] });
|
|
@@ -1881,13 +1948,13 @@ function ji(t) {
|
|
|
1881
1948
|
{
|
|
1882
1949
|
"data-u-comp": "sheets-filter-panel-conditions-container",
|
|
1883
1950
|
className: "univer-flex univer-h-full univer-min-h-[300px] univer-flex-col",
|
|
1884
|
-
children: s && n && /* @__PURE__ */ y(
|
|
1885
|
-
/* @__PURE__ */ d(
|
|
1951
|
+
children: s && n && /* @__PURE__ */ y(yt, { children: [
|
|
1952
|
+
/* @__PURE__ */ d(Ft, { value: s.operator, options: o, onChange: l }),
|
|
1886
1953
|
f.getItemByOperator(s.operator).numOfParameters !== 0 ? /* @__PURE__ */ y(
|
|
1887
1954
|
"div",
|
|
1888
1955
|
{
|
|
1889
1956
|
"data-u-comp": "sheets-filter-panel-conditions-container-inner",
|
|
1890
|
-
className:
|
|
1957
|
+
className: $e("univer-mt-2 univer-flex-grow univer-overflow-hidden univer-rounded-md univer-p-2", dt),
|
|
1891
1958
|
children: [
|
|
1892
1959
|
s.numOfParameters >= 1 && S(n.operator1, (p = n.val1) != null ? p : "", "operator1"),
|
|
1893
1960
|
s.numOfParameters >= 2 && S(n.operator2, (_ = n.val2) != null ? _ : "", "operator2"),
|
|
@@ -1910,9 +1977,9 @@ function ji(t) {
|
|
|
1910
1977
|
}
|
|
1911
1978
|
);
|
|
1912
1979
|
}
|
|
1913
|
-
function
|
|
1980
|
+
function Ji(t) {
|
|
1914
1981
|
const e = t.getCurrentLocale();
|
|
1915
|
-
return
|
|
1982
|
+
return mt(() => [
|
|
1916
1983
|
{
|
|
1917
1984
|
options: [
|
|
1918
1985
|
{ label: t.t(f.NONE.label), value: f.NONE.operator }
|
|
@@ -1952,12 +2019,12 @@ function Yi(t) {
|
|
|
1952
2019
|
}
|
|
1953
2020
|
], [e, t]);
|
|
1954
2021
|
}
|
|
1955
|
-
function
|
|
2022
|
+
function es(t) {
|
|
1956
2023
|
const e = t.getCurrentLocale();
|
|
1957
|
-
return
|
|
2024
|
+
return mt(() => f.ALL_CONDITIONS.filter((r) => r.numOfParameters !== 2).map((r) => ({ label: t.t(r.label), value: r.operator })), [e, t]);
|
|
1958
2025
|
}
|
|
1959
|
-
function
|
|
1960
|
-
const { model: e } = t, r = D(G), s = L(e.searchString$, "", !0), n = L(e.filterItems$, void 0, !0), a = r.t("sheets-filter.panel.filter-only"), i =
|
|
2026
|
+
function ts(t) {
|
|
2027
|
+
const { model: e } = t, r = D(G), s = L(e.searchString$, "", !0), n = L(e.filterItems$, void 0, !0), a = r.t("sheets-filter.panel.filter-only"), i = tt(n), o = i.checked > 0 && i.unchecked === 0, l = i.checked > 0 && i.unchecked > 0, c = e.treeMapCache, h = U(() => {
|
|
1961
2028
|
e.onCheckAllToggled(!o);
|
|
1962
2029
|
}, [e, o]), m = U((p) => {
|
|
1963
2030
|
e.setSearchString(p);
|
|
@@ -1975,7 +2042,7 @@ function zi(t) {
|
|
|
1975
2042
|
className: "univer-flex univer-h-full univer-min-h-[300px] univer-flex-col",
|
|
1976
2043
|
children: [
|
|
1977
2044
|
/* @__PURE__ */ d(
|
|
1978
|
-
|
|
2045
|
+
zt,
|
|
1979
2046
|
{
|
|
1980
2047
|
autoFocus: !0,
|
|
1981
2048
|
value: s,
|
|
@@ -1987,7 +2054,7 @@ function zi(t) {
|
|
|
1987
2054
|
"div",
|
|
1988
2055
|
{
|
|
1989
2056
|
"data-u-comp": "sheets-filter-panel",
|
|
1990
|
-
className:
|
|
2057
|
+
className: $e("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", dt),
|
|
1991
2058
|
children: [
|
|
1992
2059
|
/* @__PURE__ */ d(
|
|
1993
2060
|
"div",
|
|
@@ -2001,7 +2068,7 @@ function zi(t) {
|
|
|
2001
2068
|
className: "univer-box-border univer-flex univer-h-7 univer-items-center univer-rounded-md univer-py-0 univer-pl-5 univer-pr-0.5 univer-text-sm",
|
|
2002
2069
|
children: [
|
|
2003
2070
|
/* @__PURE__ */ d(
|
|
2004
|
-
|
|
2071
|
+
ui,
|
|
2005
2072
|
{
|
|
2006
2073
|
indeterminate: l,
|
|
2007
2074
|
disabled: n.length === 0,
|
|
@@ -2031,7 +2098,7 @@ function zi(t) {
|
|
|
2031
2098
|
}
|
|
2032
2099
|
),
|
|
2033
2100
|
/* @__PURE__ */ d("div", { "data-u-comp": "sheets-filter-panel-values-virtual", className: "univer-flex-grow", children: /* @__PURE__ */ d(
|
|
2034
|
-
|
|
2101
|
+
hi,
|
|
2035
2102
|
{
|
|
2036
2103
|
data: n,
|
|
2037
2104
|
defaultExpandAll: !1,
|
|
@@ -2068,8 +2135,8 @@ function zi(t) {
|
|
|
2068
2135
|
onClick: () => {
|
|
2069
2136
|
const _ = [];
|
|
2070
2137
|
p.children ? p.children.forEach((C) => {
|
|
2071
|
-
C.children ? C.children.forEach((
|
|
2072
|
-
_.push(
|
|
2138
|
+
C.children ? C.children.forEach((N) => {
|
|
2139
|
+
_.push(N.key);
|
|
2073
2140
|
}) : _.push(C.key);
|
|
2074
2141
|
}) : _.push(p.key), e.onFilterOnly(_);
|
|
2075
2142
|
},
|
|
@@ -2088,10 +2155,10 @@ function zi(t) {
|
|
|
2088
2155
|
}
|
|
2089
2156
|
);
|
|
2090
2157
|
}
|
|
2091
|
-
function
|
|
2092
|
-
const t = D(
|
|
2158
|
+
function rs() {
|
|
2159
|
+
const t = D(Er);
|
|
2093
2160
|
if (!L(t.visible$, void 0, !0)) return null;
|
|
2094
|
-
const r = D(G), s = D(
|
|
2161
|
+
const r = D(G), s = D(Qt), n = L(t.enabled$, void 0, !0);
|
|
2095
2162
|
return /* @__PURE__ */ y(
|
|
2096
2163
|
"div",
|
|
2097
2164
|
{
|
|
@@ -2100,23 +2167,23 @@ function Ki() {
|
|
|
2100
2167
|
/* @__PURE__ */ y("div", { className: "univer-flex univer-items-center univer-gap-1", children: [
|
|
2101
2168
|
/* @__PURE__ */ d("span", { children: r.t("sheets-filter.sync.title") }),
|
|
2102
2169
|
/* @__PURE__ */ d(
|
|
2103
|
-
|
|
2170
|
+
di,
|
|
2104
2171
|
{
|
|
2105
2172
|
title: n ? r.t("sheets-filter.sync.statusTips.off") : r.t("sheets-filter.sync.statusTips.on"),
|
|
2106
2173
|
asChild: !0,
|
|
2107
|
-
children: /* @__PURE__ */ d(
|
|
2174
|
+
children: /* @__PURE__ */ d(or, { className: "univer-block" })
|
|
2108
2175
|
}
|
|
2109
2176
|
)
|
|
2110
2177
|
] }),
|
|
2111
2178
|
/* @__PURE__ */ d(
|
|
2112
|
-
|
|
2179
|
+
mi,
|
|
2113
2180
|
{
|
|
2114
2181
|
defaultChecked: n,
|
|
2115
2182
|
onChange: (a) => {
|
|
2116
2183
|
const i = a ? r.t("sheets-filter.sync.switchTips.on") : r.t("sheets-filter.sync.switchTips.off");
|
|
2117
2184
|
t.setEnabled(a), s.show({
|
|
2118
2185
|
content: i,
|
|
2119
|
-
type:
|
|
2186
|
+
type: Kt.Success,
|
|
2120
2187
|
duration: 2e3
|
|
2121
2188
|
});
|
|
2122
2189
|
}
|
|
@@ -2126,17 +2193,17 @@ function Ki() {
|
|
|
2126
2193
|
}
|
|
2127
2194
|
);
|
|
2128
2195
|
}
|
|
2129
|
-
function
|
|
2130
|
-
var
|
|
2131
|
-
const t = D(q), e = D(G), r = D(j), s = L(t.filterBy$, void 0, !0), n = L(t.filterByModel$, void 0, !1), a = L(() => (n == null ? void 0 : n.canApply$) ||
|
|
2132
|
-
r.executeCommand(
|
|
2196
|
+
function is() {
|
|
2197
|
+
var N;
|
|
2198
|
+
const t = D(q), e = D(G), r = D(j), s = L(t.filterBy$, void 0, !0), n = L(t.filterByModel$, void 0, !1), a = L(() => (n == null ? void 0 : n.canApply$) || pe(!1), void 0, !1, [n]), i = ss(e), o = !L(t.hasCriteria$), l = U((F) => {
|
|
2199
|
+
r.executeCommand(er.id, { filterBy: F });
|
|
2133
2200
|
}, [r]), c = U(async () => {
|
|
2134
|
-
await (n == null ? void 0 : n.clear()), r.executeCommand(
|
|
2201
|
+
await (n == null ? void 0 : n.clear()), r.executeCommand(Ne.id);
|
|
2135
2202
|
}, [n, r]), h = U(() => {
|
|
2136
|
-
r.executeCommand(
|
|
2203
|
+
r.executeCommand(Ne.id);
|
|
2137
2204
|
}, [r]), m = U(async () => {
|
|
2138
|
-
await (n == null ? void 0 : n.apply()), r.executeCommand(
|
|
2139
|
-
}, [n, r]), p = (
|
|
2205
|
+
await (n == null ? void 0 : n.apply()), r.executeCommand(Ne.id);
|
|
2206
|
+
}, [n, r]), p = (N = D(X).activeFilterModel) == null ? void 0 : N.getRange(), _ = t.col, C = kr($r.FILTER_PANEL_EMBED_POINT);
|
|
2140
2207
|
return /* @__PURE__ */ y(
|
|
2141
2208
|
"div",
|
|
2142
2209
|
{
|
|
@@ -2144,18 +2211,18 @@ function qi() {
|
|
|
2144
2211
|
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",
|
|
2145
2212
|
children: [
|
|
2146
2213
|
/* @__PURE__ */ d(
|
|
2147
|
-
|
|
2214
|
+
Hr,
|
|
2148
2215
|
{
|
|
2149
2216
|
components: C,
|
|
2150
2217
|
sharedProps: { range: p, colIndex: _, onClose: h }
|
|
2151
2218
|
}
|
|
2152
2219
|
),
|
|
2153
2220
|
/* @__PURE__ */ d("div", { className: "univer-mb-1 univer-flex-shrink-0 univer-flex-grow-0", children: /* @__PURE__ */ d(
|
|
2154
|
-
|
|
2221
|
+
fi,
|
|
2155
2222
|
{
|
|
2156
2223
|
value: s,
|
|
2157
2224
|
items: i,
|
|
2158
|
-
onChange: (
|
|
2225
|
+
onChange: (F) => l(F)
|
|
2159
2226
|
}
|
|
2160
2227
|
) }),
|
|
2161
2228
|
n ? /* @__PURE__ */ d(
|
|
@@ -2163,20 +2230,20 @@ function qi() {
|
|
|
2163
2230
|
{
|
|
2164
2231
|
"data-u-comp": "sheets-filter-panel-content",
|
|
2165
2232
|
className: "univer-flex-shrink univer-flex-grow univer-pt-2",
|
|
2166
|
-
children: s === P.VALUES ? /* @__PURE__ */ d(
|
|
2233
|
+
children: s === P.VALUES ? /* @__PURE__ */ d(ts, { model: n }) : s === P.COLORS ? /* @__PURE__ */ d(qi, { model: n }) : /* @__PURE__ */ d(Xi, { model: n })
|
|
2167
2234
|
}
|
|
2168
2235
|
) : /* @__PURE__ */ d("div", { className: "univer-flex-1" }),
|
|
2169
|
-
/* @__PURE__ */ d(
|
|
2236
|
+
/* @__PURE__ */ d(rs, {}),
|
|
2170
2237
|
/* @__PURE__ */ y(
|
|
2171
2238
|
"div",
|
|
2172
2239
|
{
|
|
2173
2240
|
"data-u-comp": "sheets-filter-panel-footer",
|
|
2174
2241
|
className: "univer-mt-4 univer-inline-flex univer-flex-shrink-0 univer-flex-grow-0 univer-flex-nowrap univer-justify-between univer-overflow-hidden",
|
|
2175
2242
|
children: [
|
|
2176
|
-
/* @__PURE__ */ d(
|
|
2243
|
+
/* @__PURE__ */ d(qe, { variant: "link", onClick: c, disabled: o, children: e.t("sheets-filter.panel.clear-filter") }),
|
|
2177
2244
|
/* @__PURE__ */ y("span", { className: "univer-flex univer-gap-2", children: [
|
|
2178
|
-
/* @__PURE__ */ d(
|
|
2179
|
-
/* @__PURE__ */ d(
|
|
2245
|
+
/* @__PURE__ */ d(qe, { variant: "default", onClick: h, children: e.t("sheets-filter.panel.cancel") }),
|
|
2246
|
+
/* @__PURE__ */ d(qe, { disabled: !a, variant: "primary", onClick: m, children: e.t("sheets-filter.panel.confirm") })
|
|
2180
2247
|
] })
|
|
2181
2248
|
]
|
|
2182
2249
|
}
|
|
@@ -2185,90 +2252,28 @@ function qi() {
|
|
|
2185
2252
|
}
|
|
2186
2253
|
);
|
|
2187
2254
|
}
|
|
2188
|
-
function
|
|
2255
|
+
function ss(t) {
|
|
2189
2256
|
const e = t.getCurrentLocale();
|
|
2190
|
-
return
|
|
2257
|
+
return mt(() => [
|
|
2191
2258
|
{ label: t.t("sheets-filter.panel.by-values"), value: P.VALUES },
|
|
2192
2259
|
{ label: t.t("sheets-filter.panel.by-colors"), value: P.COLORS },
|
|
2193
2260
|
{ label: t.t("sheets-filter.panel.by-conditions"), value: P.CONDITIONS }
|
|
2194
2261
|
], [e, t]);
|
|
2195
2262
|
}
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
id: Fe.id,
|
|
2200
|
-
type: lt.BUTTON_SELECTOR,
|
|
2201
|
-
icon: "FilterIcon",
|
|
2202
|
-
tooltip: "sheets-filter.toolbar.smart-toggle-filter-tooltip",
|
|
2203
|
-
hidden$: ot(t, ie.UNIVER_SHEET),
|
|
2204
|
-
activated$: e.activeFilterModel$.pipe(le((r) => !!r)),
|
|
2205
|
-
disabled$: Pr(
|
|
2206
|
-
t,
|
|
2207
|
-
wr(
|
|
2208
|
-
t,
|
|
2209
|
-
{
|
|
2210
|
-
worksheetTypes: [pe, ve],
|
|
2211
|
-
rangeTypes: [_e]
|
|
2212
|
-
}
|
|
2213
|
-
)
|
|
2214
|
-
)
|
|
2215
|
-
};
|
|
2216
|
-
}
|
|
2217
|
-
function es(t) {
|
|
2218
|
-
const e = t.get(X);
|
|
2219
|
-
return {
|
|
2220
|
-
id: nt.id,
|
|
2221
|
-
type: lt.BUTTON,
|
|
2222
|
-
title: "sheets-filter.toolbar.clear-filter-criteria",
|
|
2223
|
-
hidden$: ot(t, ie.UNIVER_SHEET),
|
|
2224
|
-
disabled$: e.activeFilterModel$.pipe(at((r) => {
|
|
2225
|
-
var s;
|
|
2226
|
-
return (s = r == null ? void 0 : r.hasCriteria$.pipe(le((n) => !n))) != null ? s : he(!0);
|
|
2227
|
-
}))
|
|
2228
|
-
};
|
|
2229
|
-
}
|
|
2230
|
-
function ts(t) {
|
|
2231
|
-
const e = t.get(X);
|
|
2232
|
-
return {
|
|
2233
|
-
id: st.id,
|
|
2234
|
-
type: lt.BUTTON,
|
|
2235
|
-
title: "sheets-filter.toolbar.re-calc-filter-conditions",
|
|
2236
|
-
hidden$: ot(t, ie.UNIVER_SHEET),
|
|
2237
|
-
disabled$: e.activeFilterModel$.pipe(at((r) => {
|
|
2238
|
-
var s;
|
|
2239
|
-
return (s = r == null ? void 0 : r.hasCriteria$.pipe(le((n) => !n))) != null ? s : he(!0);
|
|
2240
|
-
}))
|
|
2241
|
-
};
|
|
2242
|
-
}
|
|
2243
|
-
const rs = {
|
|
2244
|
-
[kr.ORGANIZATION]: {
|
|
2245
|
-
[Fe.id]: {
|
|
2246
|
-
order: 2,
|
|
2247
|
-
menuItemFactory: Ji,
|
|
2248
|
-
[nt.id]: {
|
|
2249
|
-
order: 0,
|
|
2250
|
-
menuItemFactory: es
|
|
2251
|
-
},
|
|
2252
|
-
[st.id]: {
|
|
2253
|
-
order: 1,
|
|
2254
|
-
menuItemFactory: ts
|
|
2255
|
-
}
|
|
2256
|
-
}
|
|
2257
|
-
}
|
|
2258
|
-
}, is = {
|
|
2259
|
-
id: Fe.id,
|
|
2260
|
-
binding: Hr.L | gt.CTRL_COMMAND | gt.SHIFT,
|
|
2263
|
+
const ns = {
|
|
2264
|
+
id: Oe.id,
|
|
2265
|
+
binding: Dr.L | Tt.CTRL_COMMAND | Tt.SHIFT,
|
|
2261
2266
|
description: "sheets-filter.shortcut.smart-toggle-filter",
|
|
2262
|
-
preconditions:
|
|
2267
|
+
preconditions: Lr,
|
|
2263
2268
|
group: "4_sheet-edit"
|
|
2264
2269
|
};
|
|
2265
|
-
var
|
|
2266
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
2270
|
+
var os = Object.getOwnPropertyDescriptor, ls = (t, e, r, s) => {
|
|
2271
|
+
for (var n = s > 1 ? void 0 : s ? os(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
2267
2272
|
(i = t[a]) && (n = i(n) || n);
|
|
2268
2273
|
return n;
|
|
2269
2274
|
}, $ = (t, e) => (r, s) => e(r, s, t);
|
|
2270
|
-
const
|
|
2271
|
-
let
|
|
2275
|
+
const wt = "FILTER_PANEL_POPUP";
|
|
2276
|
+
let De = class extends ye {
|
|
2272
2277
|
constructor(e, r, s, n, a, i, o, l, c, h, m, S, p) {
|
|
2273
2278
|
super(p, S);
|
|
2274
2279
|
v(this, "_popupDisposable");
|
|
@@ -2279,42 +2284,42 @@ let ke = class extends Ee {
|
|
|
2279
2284
|
}
|
|
2280
2285
|
_initShortcuts() {
|
|
2281
2286
|
[
|
|
2282
|
-
|
|
2287
|
+
ns
|
|
2283
2288
|
].forEach((e) => {
|
|
2284
2289
|
this.disposeWithMe(this._shortcutService.registerShortcut(e));
|
|
2285
2290
|
});
|
|
2286
2291
|
}
|
|
2287
2292
|
_initCommands() {
|
|
2288
2293
|
[
|
|
2289
|
-
|
|
2290
|
-
|
|
2294
|
+
Oe,
|
|
2295
|
+
Nr,
|
|
2291
2296
|
Fr,
|
|
2292
2297
|
V,
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
+
at,
|
|
2299
|
+
lt,
|
|
2300
|
+
er,
|
|
2301
|
+
ke,
|
|
2302
|
+
Ne
|
|
2298
2303
|
].forEach((e) => {
|
|
2299
2304
|
this.disposeWithMe(this._commandService.registerCommand(e));
|
|
2300
2305
|
});
|
|
2301
2306
|
}
|
|
2302
2307
|
_initMenuItems() {
|
|
2303
|
-
this._menuManagerService.mergeMenu(
|
|
2308
|
+
this._menuManagerService.mergeMenu(Ki);
|
|
2304
2309
|
}
|
|
2305
2310
|
_initUI() {
|
|
2306
2311
|
[
|
|
2307
|
-
[
|
|
2308
|
-
["FilterIcon",
|
|
2312
|
+
[wt, is],
|
|
2313
|
+
["FilterIcon", nr]
|
|
2309
2314
|
].forEach(([e, r]) => {
|
|
2310
2315
|
this.disposeWithMe(
|
|
2311
2316
|
this._componentManager.register(e, r)
|
|
2312
2317
|
);
|
|
2313
|
-
}), this.disposeWithMe(this._contextService.subscribeContextValue$(
|
|
2318
|
+
}), this.disposeWithMe(this._contextService.subscribeContextValue$(ce).pipe(oi()).subscribe((e) => {
|
|
2314
2319
|
e ? this._openFilterPopup() : this._closeFilterPopup();
|
|
2315
2320
|
})), this.disposeWithMe(this._sheetsFilterService.errorMsg$.subscribe((e) => {
|
|
2316
2321
|
e && this._messageService.show({
|
|
2317
|
-
type:
|
|
2322
|
+
type: Kt.Error,
|
|
2318
2323
|
content: this._localeService.t(e)
|
|
2319
2324
|
});
|
|
2320
2325
|
}));
|
|
@@ -2325,9 +2330,9 @@ let ke = class extends Ee {
|
|
|
2325
2330
|
throw new Error("[SheetsFilterUIController]: no filter model when opening filter popup!");
|
|
2326
2331
|
const r = e.getRange(), s = this._sheetsFilterPanelService.col, { startRow: n } = r;
|
|
2327
2332
|
this._popupDisposable = this._sheetCanvasPopupService.attachPopupToCell(n, s, {
|
|
2328
|
-
componentKey:
|
|
2333
|
+
componentKey: wt,
|
|
2329
2334
|
direction: "horizontal",
|
|
2330
|
-
onClickOutside: () => this._commandService.syncExecuteCommand(
|
|
2335
|
+
onClickOutside: () => this._commandService.syncExecuteCommand(Ne.id),
|
|
2331
2336
|
offset: [5, 0]
|
|
2332
2337
|
});
|
|
2333
2338
|
}
|
|
@@ -2336,97 +2341,98 @@ let ke = class extends Ee {
|
|
|
2336
2341
|
(e = this._popupDisposable) == null || e.dispose(), this._popupDisposable = null;
|
|
2337
2342
|
}
|
|
2338
2343
|
};
|
|
2339
|
-
|
|
2344
|
+
De = ls([
|
|
2340
2345
|
$(0, T(re)),
|
|
2341
|
-
$(1, T(
|
|
2346
|
+
$(1, T(Br)),
|
|
2342
2347
|
$(2, T(q)),
|
|
2343
|
-
$(3, T(
|
|
2348
|
+
$(3, T(Mr)),
|
|
2344
2349
|
$(4, T(X)),
|
|
2345
2350
|
$(5, T(G)),
|
|
2346
|
-
$(6,
|
|
2351
|
+
$(6, Wr),
|
|
2347
2352
|
$(7, j),
|
|
2348
|
-
$(8,
|
|
2349
|
-
$(9,
|
|
2350
|
-
$(10,
|
|
2351
|
-
$(11, T(
|
|
2352
|
-
$(12,
|
|
2353
|
-
],
|
|
2354
|
-
var
|
|
2355
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
2353
|
+
$(8, Vr),
|
|
2354
|
+
$(9, Ve),
|
|
2355
|
+
$(10, Qt),
|
|
2356
|
+
$(11, T(Vt)),
|
|
2357
|
+
$(12, Gt)
|
|
2358
|
+
], De);
|
|
2359
|
+
var as = Object.defineProperty, cs = Object.getOwnPropertyDescriptor, us = (t, e, r) => e in t ? as(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, hs = (t, e, r, s) => {
|
|
2360
|
+
for (var n = s > 1 ? void 0 : s ? cs(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
2356
2361
|
(i = t[a]) && (n = i(n) || n);
|
|
2357
2362
|
return n;
|
|
2358
|
-
},
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
constructor(t = xe, e, r, s) {
|
|
2363
|
+
}, et = (t, e) => (r, s) => e(r, s, t), je = (t, e, r) => us(t, typeof e != "symbol" ? e + "" : e, r);
|
|
2364
|
+
let me = class extends ot {
|
|
2365
|
+
constructor(t = He, e, r, s) {
|
|
2362
2366
|
super(), this._config = t, this._injector = e, this._configService = r, this._rpcChannelService = s;
|
|
2363
|
-
const { menu: n, ...a } =
|
|
2367
|
+
const { menu: n, ...a } = Bt(
|
|
2364
2368
|
{},
|
|
2365
|
-
|
|
2369
|
+
He,
|
|
2366
2370
|
this._config
|
|
2367
2371
|
);
|
|
2368
|
-
n && this._configService.setConfig("menu", n, { merge: !0 }), this._configService.setConfig(
|
|
2372
|
+
n && this._configService.setConfig("menu", n, { merge: !0 }), this._configService.setConfig(tr, a);
|
|
2369
2373
|
}
|
|
2370
2374
|
onStarting() {
|
|
2371
|
-
|
|
2375
|
+
vr(this._injector, [
|
|
2372
2376
|
[q],
|
|
2373
|
-
[
|
|
2374
|
-
[
|
|
2375
|
-
]), this._config.useRemoteFilterValuesGenerator && this._rpcChannelService && this._injector.add([
|
|
2376
|
-
useFactory: () =>
|
|
2377
|
-
this._rpcChannelService.requestChannel(
|
|
2377
|
+
[he],
|
|
2378
|
+
[De]
|
|
2379
|
+
]), this._config.useRemoteFilterValuesGenerator && this._rpcChannelService && this._injector.add([Le, {
|
|
2380
|
+
useFactory: () => li(
|
|
2381
|
+
this._rpcChannelService.requestChannel(ft)
|
|
2378
2382
|
)
|
|
2379
2383
|
}]);
|
|
2380
2384
|
}
|
|
2381
2385
|
onReady() {
|
|
2382
|
-
|
|
2383
|
-
[
|
|
2386
|
+
St(this._injector, [
|
|
2387
|
+
[he]
|
|
2384
2388
|
]);
|
|
2385
2389
|
}
|
|
2386
2390
|
onRendered() {
|
|
2387
|
-
|
|
2388
|
-
[
|
|
2391
|
+
St(this._injector, [
|
|
2392
|
+
[De]
|
|
2389
2393
|
]);
|
|
2390
2394
|
}
|
|
2391
2395
|
};
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2396
|
+
je(me, "type", ie.UNIVER_SHEET);
|
|
2397
|
+
je(me, "pluginName", "SHEET_FILTER_UI_PLUGIN");
|
|
2398
|
+
je(me, "packageName", ue.name);
|
|
2399
|
+
je(me, "version", ue.version);
|
|
2400
|
+
me = hs([
|
|
2401
|
+
Ht(Wt),
|
|
2402
|
+
et(1, T(re)),
|
|
2403
|
+
et(2, Dt),
|
|
2404
|
+
et(3, pr(Zt))
|
|
2405
|
+
], me);
|
|
2406
|
+
var ds = Object.getOwnPropertyDescriptor, ms = (t, e, r, s) => {
|
|
2407
|
+
for (var n = s > 1 ? void 0 : s ? ds(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
2402
2408
|
(i = t[a]) && (n = i(n) || n);
|
|
2403
2409
|
return n;
|
|
2404
|
-
},
|
|
2405
|
-
let
|
|
2410
|
+
}, $t = (t, e) => (r, s) => e(r, s, t), le;
|
|
2411
|
+
let Lt = (le = class extends ot {
|
|
2406
2412
|
constructor(t, e, r) {
|
|
2407
2413
|
super(), this._config = t, this._injector = e, this._rpcChannelService = r;
|
|
2408
2414
|
}
|
|
2409
2415
|
onStarting() {
|
|
2410
2416
|
[
|
|
2411
|
-
[
|
|
2417
|
+
[Le, { useClass: rt }]
|
|
2412
2418
|
].forEach((t) => this._injector.add(t));
|
|
2413
2419
|
}
|
|
2414
2420
|
onReady() {
|
|
2415
2421
|
this._rpcChannelService.registerChannel(
|
|
2416
|
-
|
|
2417
|
-
|
|
2422
|
+
ft,
|
|
2423
|
+
ai(this._injector.get(Le))
|
|
2418
2424
|
);
|
|
2419
2425
|
}
|
|
2420
|
-
}, v(
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
],
|
|
2426
|
+
}, v(le, "type", ie.UNIVER_SHEET), v(le, "pluginName", "SHEET_FILTER_UI_WORKER_PLUGIN"), v(le, "packageName", ue.name), v(le, "version", ue.version), le);
|
|
2427
|
+
Lt = ms([
|
|
2428
|
+
$t(1, T(re)),
|
|
2429
|
+
$t(2, Zt)
|
|
2430
|
+
], Lt);
|
|
2425
2431
|
export {
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
+
er as ChangeFilterByOperation,
|
|
2433
|
+
Ne as CloseFilterPanelOperation,
|
|
2434
|
+
ke as OpenFilterPanelOperation,
|
|
2435
|
+
de as UniverSheetsFilterMobileUIPlugin,
|
|
2436
|
+
me as UniverSheetsFilterUIPlugin,
|
|
2437
|
+
Lt as UniverSheetsFilterUIWorkerPlugin
|
|
2432
2438
|
};
|