@univerjs/sheets-filter-ui 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +2 -2
- package/lib/es/index.js +351 -343
- package/lib/index.css +1 -1
- package/lib/umd/index.js +2 -2
- package/package.json +13 -13
package/lib/es/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var _ = (t, e, r) =>
|
|
4
|
-
import { BooleanNumber as
|
|
5
|
-
import { IRPCChannelService as
|
|
6
|
-
import { CustomFilterOperator as u, SetSheetsFilterCriteriaCommand as re, SheetsFilterService as Q, SmartToggleSheetsFilterCommand as fe, ClearSheetsFilterCriteriaCommand as
|
|
7
|
-
import { RefRangeService as
|
|
8
|
-
import { SetCellEditVisibleOperation as
|
|
9
|
-
import { ILayoutService as
|
|
10
|
-
import { BehaviorSubject as q, ReplaySubject as
|
|
11
|
-
import { Select as
|
|
12
|
-
import { Rect as
|
|
13
|
-
import
|
|
14
|
-
const
|
|
1
|
+
var Kt = Object.defineProperty;
|
|
2
|
+
var Xt = (t, e, r) => e in t ? Kt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var _ = (t, e, r) => Xt(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { BooleanNumber as nt, createIdentifier as St, Inject as E, LocaleService as K, Disposable as de, IUniverInstanceService as Ye, ILogService as Zt, extractPureTextFromCell as Jt, numfmt as it, Injector as X, ICommandService as W, Quantity as gt, Tools as Fe, CommandType as $e, IContextService as we, useDependency as te, UniverInstanceType as Z, ThemeService as Et, RxDisposable as Tt, fromCallback as zt, InterceptorEffectEnum as er, DependentOn as Ft, Optional as tr, Plugin as qe, merge as Ct, IConfigService as Nt } from "@univerjs/core";
|
|
5
|
+
import { IRPCChannelService as Pt, toModule as rr, fromModule as sr } from "@univerjs/rpc";
|
|
6
|
+
import { CustomFilterOperator as u, SetSheetsFilterCriteriaCommand as re, SheetsFilterService as Q, SmartToggleSheetsFilterCommand as fe, ClearSheetsFilterCriteriaCommand as Ke, ReCalcSheetsFilterCommand as Xe, FILTER_MUTATIONS as nr, SetSheetsFilterRangeMutation as ir, SetSheetsFilterCriteriaMutation as or, RemoveSheetsFilterMutation as ar, ReCalcSheetsFilterMutation as lr, RemoveSheetFilterCommand as cr, SetSheetFilterRangeCommand as ur, UniverSheetsFilterPlugin as Ot } from "@univerjs/sheets-filter";
|
|
7
|
+
import { RefRangeService as hr, SheetsSelectionsService as pr, getSheetCommandTarget as mr, RangeProtectionPermissionViewPoint as le, WorksheetFilterPermission as ce, WorksheetViewPermission as ue, expandToContinuousRange as dr, SheetInterceptorService as fr, SetRangeValuesMutation as _r, INTERCEPTOR_POINT as vr } from "@univerjs/sheets";
|
|
8
|
+
import { SetCellEditVisibleOperation as Sr, SheetPermissionInterceptorBaseController as gr, SheetsUIPart as Er, getObservableWithExclusiveRange$ as Tr, getCurrentRangeDisable$ as Fr, whenSheetEditorFocused as Cr, SheetSkeletonManagerService as Nr, ISheetSelectionRenderService as Pr, SelectionControl as Or, attachSelectionWithCoord as Ir, getCoordByCell as Rr, SheetsRenderService as It, SheetCanvasPopManagerService as yr } from "@univerjs/sheets-ui";
|
|
9
|
+
import { ILayoutService as Ar, useObservable as V, useComponentsOfPart as br, ComponentContainer as Lr, MenuItemType as Ze, getMenuHiddenObservable as Je, RibbonStartGroup as Mr, KeyCode as $r, MetaKeys as ot, ComponentManager as wr, IShortcutService as Ur, IMenuManagerService as Hr, IMessageService as Dr } from "@univerjs/ui";
|
|
10
|
+
import { BehaviorSubject as q, ReplaySubject as xr, of as _e, Subject as Br, merge as Vr, combineLatest as jr, throttleTime as Rt, startWith as yt, map as se, shareReplay as Wr, switchMap as ze, filter as Qr, takeUntil as kr, distinctUntilChanged as Gr } from "rxjs";
|
|
11
|
+
import { Select as at, RadioGroup as Yr, Radio as lt, Input as At, Checkbox as qr, Tree as Kr, Button as Ce, Segmented as Xr, MessageType as Zr } from "@univerjs/design";
|
|
12
|
+
import { Rect as ct, Shape as Jr, IRenderManagerService as bt } from "@univerjs/engine-render";
|
|
13
|
+
import zr, { forwardRef as Lt, useRef as es, createElement as Mt, useCallback as D, useMemo as et } from "react";
|
|
14
|
+
const $t = "sheets-filter-ui.config", Ne = {};
|
|
15
15
|
var N = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SECOND", t))(N || {}), v = /* @__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))(v || {}), m;
|
|
16
16
|
((t) => {
|
|
17
17
|
t.NONE = {
|
|
@@ -304,7 +304,7 @@ var N = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
304
304
|
const { val1: o, val2: a, operator1: c } = s, h = c === u.GREATER_THAN_OR_EQUAL;
|
|
305
305
|
return {
|
|
306
306
|
customFilters: {
|
|
307
|
-
and:
|
|
307
|
+
and: nt.TRUE,
|
|
308
308
|
customFilters: [
|
|
309
309
|
{ val: h ? o : a, operator: u.GREATER_THAN_OR_EQUAL },
|
|
310
310
|
{ val: h ? a : o, operator: u.LESS_THAN_OR_EQUAL }
|
|
@@ -408,7 +408,7 @@ var N = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
408
408
|
P.customFilters.customFilters[0]
|
|
409
409
|
]
|
|
410
410
|
};
|
|
411
|
-
return o && (F.and =
|
|
411
|
+
return o && (F.and = nt.TRUE), { customFilters: F };
|
|
412
412
|
},
|
|
413
413
|
testMappingFilterColumn: (s) => {
|
|
414
414
|
var c;
|
|
@@ -492,7 +492,7 @@ function L(t) {
|
|
|
492
492
|
throw new Error("Neither operator1 and operator2 and both not set!");
|
|
493
493
|
return e ? [e, n] : [r, i];
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function je(t) {
|
|
496
496
|
const e = [], r = [];
|
|
497
497
|
let n = 0, i = 0;
|
|
498
498
|
function l(s) {
|
|
@@ -505,53 +505,53 @@ function Ve(t) {
|
|
|
505
505
|
unchecked: i
|
|
506
506
|
};
|
|
507
507
|
}
|
|
508
|
-
var
|
|
509
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
508
|
+
var ts = Object.defineProperty, rs = Object.getOwnPropertyDescriptor, ss = (t, e, r, n) => {
|
|
509
|
+
for (var i = n > 1 ? void 0 : n ? rs(e, r) : e, l = t.length - 1, s; l >= 0; l--)
|
|
510
510
|
(s = t[l]) && (i = (n ? s(e, r, i) : s(i)) || i);
|
|
511
|
-
return n && i &&
|
|
512
|
-
},
|
|
513
|
-
const
|
|
514
|
-
let
|
|
511
|
+
return n && i && ts(e, r, i), i;
|
|
512
|
+
}, De = (t, e) => (r, n) => e(r, n, t);
|
|
513
|
+
const tt = "sheets-filter.generate-filter-values.service", Pe = St(tt), ns = ["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 We = 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 h;
|
|
520
520
|
const { unitId: e, subUnitId: r, filteredOutRowsByOtherColumns: n, filters: i, blankChecked: l, iterateRange: s, alreadyChecked: o } = t, a = this._univerInstanceService.getUnit(e), c = (h = this._univerInstanceService.getUnit(e)) == null ? void 0 : h.getSheetBySheetId(r);
|
|
521
|
-
return !a || !c ? [] : (this._logService.debug("[SheetsGenerateFilterValuesService]", "getFilterValues for", { unitId: e, subUnitId: r }),
|
|
521
|
+
return !a || !c ? [] : (this._logService.debug("[SheetsGenerateFilterValuesService]", "getFilterValues for", { unitId: e, subUnitId: r }), wt(i, this._localeService, s, c, new Set(n), new Set(o.map(String)), l, a.getStyles()));
|
|
522
522
|
}
|
|
523
523
|
};
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
],
|
|
529
|
-
function
|
|
524
|
+
We = ss([
|
|
525
|
+
De(0, E(K)),
|
|
526
|
+
De(1, Ye),
|
|
527
|
+
De(2, Zt)
|
|
528
|
+
], We);
|
|
529
|
+
function wt(t, e, r, n, i, l, s, o) {
|
|
530
530
|
var g, P, F, R, I, M, $, ve, Se;
|
|
531
|
-
const a = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), h = "yyyy-mm-dd", p = new Set(
|
|
531
|
+
const a = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), h = "yyyy-mm-dd", p = new Set(ns), S = "empty";
|
|
532
532
|
let f = 0;
|
|
533
533
|
for (const y of n.iterateByColumn(r, !1, !1)) {
|
|
534
|
-
const { row:
|
|
534
|
+
const { row: Gt, rowSpan: st = 1 } = y;
|
|
535
535
|
let J = 0;
|
|
536
|
-
for (; J <
|
|
537
|
-
const
|
|
538
|
-
if (i.has(
|
|
536
|
+
for (; J < st; ) {
|
|
537
|
+
const Yt = Gt + J;
|
|
538
|
+
if (i.has(Yt)) {
|
|
539
539
|
J++;
|
|
540
540
|
continue;
|
|
541
541
|
}
|
|
542
|
-
const k = y != null && y.value ?
|
|
542
|
+
const k = y != null && y.value ? Jt(y.value) : "";
|
|
543
543
|
if (!k) {
|
|
544
|
-
f += 1, J +=
|
|
544
|
+
f += 1, J += st;
|
|
545
545
|
continue;
|
|
546
546
|
}
|
|
547
|
-
const ge = (g = y.value) != null && g.v && !y.value.p ? (R = (F = o.get((P = y.value) == null ? void 0 : P.s)) == null ? void 0 : F.n) == null ? void 0 : R.pattern : "",
|
|
548
|
-
if (ge &&
|
|
547
|
+
const ge = (g = y.value) != null && g.v && !y.value.p ? (R = (F = o.get((P = y.value) == null ? void 0 : P.s)) == null ? void 0 : F.n) == null ? void 0 : R.pattern : "", qt = ge && it.isDate(ge);
|
|
548
|
+
if (ge && qt && p.has(ge)) {
|
|
549
549
|
const x = (I = n.getCellRaw(y.row, y.col)) == null ? void 0 : I.v;
|
|
550
550
|
if (!x) {
|
|
551
551
|
J++;
|
|
552
552
|
continue;
|
|
553
553
|
}
|
|
554
|
-
const z =
|
|
554
|
+
const z = it.format(h, x), [O, w, oe] = z.split("-").map(Number);
|
|
555
555
|
let G = a.get(`${O}`);
|
|
556
556
|
G || (G = {
|
|
557
557
|
title: `${O}`,
|
|
@@ -561,7 +561,7 @@ function $t(t, e, r, n, i, l, s, o) {
|
|
|
561
561
|
leaf: !1,
|
|
562
562
|
checked: !1
|
|
563
563
|
}, a.set(`${O}`, G), c.set(`${O}`, [`${O}`]));
|
|
564
|
-
let U = (M = G.children) == null ? void 0 : M.find((
|
|
564
|
+
let U = (M = G.children) == null ? void 0 : M.find((He) => He.key === `${O}-${w}`);
|
|
565
565
|
U || (U = {
|
|
566
566
|
title: e.t(`sheets-filter.date.${w}`),
|
|
567
567
|
key: `${O}-${w}`,
|
|
@@ -570,8 +570,8 @@ function $t(t, e, r, n, i, l, s, o) {
|
|
|
570
570
|
leaf: !1,
|
|
571
571
|
checked: !1
|
|
572
572
|
}, ($ = G.children) == null || $.push(U), c.set(`${O}-${w}`, [`${O}`, `${O}-${w}`]));
|
|
573
|
-
const
|
|
574
|
-
|
|
573
|
+
const Ue = (ve = U == null ? void 0 : U.children) == null ? void 0 : ve.find((He) => He.key === `${O}-${w}-${oe}`);
|
|
574
|
+
Ue ? (Ue.originValues.add(k), Ue.count++, U.count++, G.count++) : ((Se = U.children) == null || Se.push({
|
|
575
575
|
title: `${oe}`,
|
|
576
576
|
key: `${O}-${w}-${oe}`,
|
|
577
577
|
count: 1,
|
|
@@ -605,11 +605,11 @@ function $t(t, e, r, n, i, l, s, o) {
|
|
|
605
605
|
a.set("empty", y), c.set("empty", [S]);
|
|
606
606
|
}
|
|
607
607
|
return {
|
|
608
|
-
filterTreeItems:
|
|
608
|
+
filterTreeItems: is(Array.from(a.values())),
|
|
609
609
|
filterTreeMapCache: c
|
|
610
610
|
};
|
|
611
611
|
}
|
|
612
|
-
function
|
|
612
|
+
function is(t) {
|
|
613
613
|
return Array.from(t).sort((e, r) => e.children && !r.children ? -1 : !e.children && r.children ? 1 : r.title.localeCompare(e.title)).map((e) => (e.children && e.children.sort((r, n) => {
|
|
614
614
|
const i = Number.parseInt(r.key.split("-")[1], 10), l = Number.parseInt(n.key.split("-")[1], 10);
|
|
615
615
|
return i - l;
|
|
@@ -620,25 +620,25 @@ function ns(t) {
|
|
|
620
620
|
});
|
|
621
621
|
}), e));
|
|
622
622
|
}
|
|
623
|
-
function
|
|
623
|
+
function Qe(t, e) {
|
|
624
624
|
for (const r of t) {
|
|
625
625
|
if (r.key === e)
|
|
626
626
|
return r;
|
|
627
627
|
if (r.children) {
|
|
628
|
-
const n =
|
|
628
|
+
const n = Qe(r.children, e);
|
|
629
629
|
if (n)
|
|
630
630
|
return n;
|
|
631
631
|
}
|
|
632
632
|
}
|
|
633
633
|
return null;
|
|
634
634
|
}
|
|
635
|
-
function
|
|
636
|
-
return t.leaf ? t.checked : t.children ? t.children.every((e) =>
|
|
635
|
+
function Ut(t) {
|
|
636
|
+
return t.leaf ? t.checked : t.children ? t.children.every((e) => Ut(e)) : !0;
|
|
637
637
|
}
|
|
638
638
|
function he(t, e) {
|
|
639
639
|
t.leaf && (e !== void 0 ? t.checked = e : t.checked = !t.checked), t.children && t.children.forEach((r) => he(r, e));
|
|
640
640
|
}
|
|
641
|
-
function
|
|
641
|
+
function Ht(t, e) {
|
|
642
642
|
const r = [];
|
|
643
643
|
return t.forEach((n) => {
|
|
644
644
|
const i = n.originValues ? e.some(
|
|
@@ -651,7 +651,7 @@ function Ut(t, e) {
|
|
|
651
651
|
if (i || l)
|
|
652
652
|
r.push({ ...n });
|
|
653
653
|
else if (n.children) {
|
|
654
|
-
const o =
|
|
654
|
+
const o = Ht(n.children, e);
|
|
655
655
|
if (o.length > 0) {
|
|
656
656
|
const a = o.reduce((c, h) => c + h.count, 0);
|
|
657
657
|
r.push({ ...n, count: a, children: o });
|
|
@@ -659,12 +659,12 @@ function Ut(t, e) {
|
|
|
659
659
|
}
|
|
660
660
|
}), r;
|
|
661
661
|
}
|
|
662
|
-
var
|
|
663
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
662
|
+
var os = Object.defineProperty, as = Object.getOwnPropertyDescriptor, rt = (t, e, r, n) => {
|
|
663
|
+
for (var i = n > 1 ? void 0 : n ? as(e, r) : e, l = t.length - 1, s; l >= 0; l--)
|
|
664
664
|
(s = t[l]) && (i = (n ? s(e, r, i) : s(i)) || i);
|
|
665
|
-
return n && i &&
|
|
666
|
-
},
|
|
667
|
-
|
|
665
|
+
return n && i && os(e, r, i), i;
|
|
666
|
+
}, Oe = (t, e) => (r, n) => e(r, n, t), Ie = /* @__PURE__ */ ((t) => (t[t.VALUES = 0] = "VALUES", t[t.CONDITIONS = 1] = "CONDITIONS", t))(Ie || {});
|
|
667
|
+
St("sheets-filter-ui.sheets-filter-panel.service");
|
|
668
668
|
let j = class extends de {
|
|
669
669
|
constructor(e, r) {
|
|
670
670
|
super();
|
|
@@ -673,7 +673,7 @@ let j = class extends de {
|
|
|
673
673
|
/* VALUES */
|
|
674
674
|
));
|
|
675
675
|
_(this, "filterBy$", this._filterBy$.asObservable());
|
|
676
|
-
_(this, "_filterByModel$", new
|
|
676
|
+
_(this, "_filterByModel$", new xr(1));
|
|
677
677
|
_(this, "filterByModel$", this._filterByModel$.asObservable());
|
|
678
678
|
_(this, "_filterByModel", null);
|
|
679
679
|
_(this, "_hasCriteria$", new q(!1));
|
|
@@ -751,7 +751,7 @@ let j = class extends de {
|
|
|
751
751
|
this._disposePreviousModel();
|
|
752
752
|
const n = e.getRange();
|
|
753
753
|
if (n.startRow === n.endRow) return !1;
|
|
754
|
-
const i = await
|
|
754
|
+
const i = await ye.fromFilterColumn(
|
|
755
755
|
this._injector,
|
|
756
756
|
e,
|
|
757
757
|
r
|
|
@@ -765,7 +765,7 @@ let j = class extends de {
|
|
|
765
765
|
this._disposePreviousModel();
|
|
766
766
|
const n = e.getRange();
|
|
767
767
|
if (n.startRow === n.endRow) return !1;
|
|
768
|
-
const i =
|
|
768
|
+
const i = Re.fromFilterColumn(
|
|
769
769
|
this._injector,
|
|
770
770
|
e,
|
|
771
771
|
r,
|
|
@@ -781,11 +781,11 @@ let j = class extends de {
|
|
|
781
781
|
(e = this._filterByModel) == null || e.dispose(), this.filterByModel = null;
|
|
782
782
|
}
|
|
783
783
|
};
|
|
784
|
-
j =
|
|
785
|
-
|
|
786
|
-
|
|
784
|
+
j = rt([
|
|
785
|
+
Oe(0, E(X)),
|
|
786
|
+
Oe(1, E(hr))
|
|
787
787
|
], j);
|
|
788
|
-
let
|
|
788
|
+
let Re = class extends de {
|
|
789
789
|
constructor(e, r, n, i, l) {
|
|
790
790
|
super();
|
|
791
791
|
_(this, "canApply$", _e(!0));
|
|
@@ -808,7 +808,7 @@ let Ie = class extends de {
|
|
|
808
808
|
*/
|
|
809
809
|
static fromFilterColumn(e, r, n, i) {
|
|
810
810
|
const [l, s] = m.testMappingFilterColumn(i == null ? void 0 : i.getColumnData());
|
|
811
|
-
return e.createInstance(
|
|
811
|
+
return e.createInstance(Re, r, n, l, s);
|
|
812
812
|
}
|
|
813
813
|
get conditionItem() {
|
|
814
814
|
return this._conditionItem$.getValue();
|
|
@@ -870,10 +870,10 @@ let Ie = class extends de {
|
|
|
870
870
|
this._filterConditionFormParams$.next(r);
|
|
871
871
|
}
|
|
872
872
|
};
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
],
|
|
876
|
-
let
|
|
873
|
+
Re = rt([
|
|
874
|
+
Oe(4, W)
|
|
875
|
+
], Re);
|
|
876
|
+
let ye = class extends de {
|
|
877
877
|
constructor(e, r, n, i, l) {
|
|
878
878
|
super();
|
|
879
879
|
_(this, "_rawFilterItems$");
|
|
@@ -885,22 +885,22 @@ let Re = class extends de {
|
|
|
885
885
|
_(this, "_manuallyUpdateFilterItems$");
|
|
886
886
|
_(this, "_searchString$");
|
|
887
887
|
_(this, "searchString$");
|
|
888
|
-
this._filterModel = e, this.col = r, this._commandService = l, this._treeMapCache = i, this._searchString$ = new q(""), this.searchString$ = this._searchString$.asObservable(), this._rawFilterItems$ = new q(n), this.rawFilterItems$ = this._rawFilterItems$.asObservable(), this._manuallyUpdateFilterItems$ = new
|
|
889
|
-
|
|
888
|
+
this._filterModel = e, this.col = r, this._commandService = l, this._treeMapCache = i, this._searchString$ = new q(""), this.searchString$ = this._searchString$.asObservable(), this._rawFilterItems$ = new q(n), this.rawFilterItems$ = this._rawFilterItems$.asObservable(), this._manuallyUpdateFilterItems$ = new Br(), this.filterItems$ = Vr(
|
|
889
|
+
jr([
|
|
890
890
|
this._searchString$.pipe(
|
|
891
|
-
|
|
892
|
-
|
|
891
|
+
Rt(500, void 0, { leading: !0, trailing: !0 }),
|
|
892
|
+
yt(void 0)
|
|
893
893
|
),
|
|
894
894
|
this._rawFilterItems$
|
|
895
895
|
]).pipe(
|
|
896
896
|
se(([s, o]) => {
|
|
897
897
|
if (!s) return o;
|
|
898
898
|
const c = s.toLowerCase().split(/\s+/).filter((h) => !!h);
|
|
899
|
-
return
|
|
899
|
+
return Ht(o, c);
|
|
900
900
|
})
|
|
901
901
|
),
|
|
902
902
|
this._manuallyUpdateFilterItems$
|
|
903
|
-
).pipe(
|
|
903
|
+
).pipe(Wr(1)), this.canApply$ = this.filterItems$.pipe(se((s) => je(s).checked > 0)), this.disposeWithMe(this.filterItems$.subscribe((s) => this._filterItems = s));
|
|
904
904
|
}
|
|
905
905
|
/**
|
|
906
906
|
* Create a model with targeting filter column. If there is not a filter column, the model would be created with
|
|
@@ -914,7 +914,7 @@ let Re = class extends de {
|
|
|
914
914
|
*/
|
|
915
915
|
static async fromFilterColumn(e, r, n) {
|
|
916
916
|
var M;
|
|
917
|
-
const i = e.get(
|
|
917
|
+
const i = e.get(Ye), l = e.get(K), s = e.get(Pe, gt.OPTIONAL), { unitId: o, subUnitId: a } = r, c = i.getUniverSheetInstance(o);
|
|
918
918
|
if (!c) throw new Error(`[ByValuesModel]: Workbook not found for filter model with unitId: ${o}!`);
|
|
919
919
|
const h = c == null ? void 0 : c.getSheetBySheetId(a);
|
|
920
920
|
if (!h) throw new Error(`[ByValuesModel]: Worksheet not found for filter model with unitId: ${o} and subUnitId: ${a}!`);
|
|
@@ -932,10 +932,10 @@ let Re = class extends de {
|
|
|
932
932
|
});
|
|
933
933
|
R = $.filterTreeItems, I = $.filterTreeMapCache;
|
|
934
934
|
} else {
|
|
935
|
-
const $ =
|
|
935
|
+
const $ = wt(!!f, l, F, h, P, T, g, c.getStyles());
|
|
936
936
|
R = $.filterTreeItems, I = $.filterTreeMapCache;
|
|
937
937
|
}
|
|
938
|
-
return e.createInstance(
|
|
938
|
+
return e.createInstance(ye, r, n, R, I);
|
|
939
939
|
}
|
|
940
940
|
get rawFilterItems() {
|
|
941
941
|
return this._rawFilterItems$.getValue();
|
|
@@ -963,16 +963,16 @@ let Re = class extends de {
|
|
|
963
963
|
* Toggle a filter item.
|
|
964
964
|
*/
|
|
965
965
|
onFilterCheckToggled(e) {
|
|
966
|
-
const r = Fe.deepClone(this._filterItems), n =
|
|
966
|
+
const r = Fe.deepClone(this._filterItems), n = Qe(r, e.key);
|
|
967
967
|
if (!n)
|
|
968
968
|
return;
|
|
969
|
-
const i =
|
|
969
|
+
const i = Ut(n);
|
|
970
970
|
he(n, !i), this._manuallyUpdateFilterItems(r);
|
|
971
971
|
}
|
|
972
972
|
onFilterOnly(e) {
|
|
973
973
|
const r = Fe.deepClone(this._filterItems);
|
|
974
974
|
r.forEach((n) => he(n, !1)), e.forEach((n) => {
|
|
975
|
-
const i =
|
|
975
|
+
const i = Qe(r, n);
|
|
976
976
|
i && he(i, !0);
|
|
977
977
|
}), this._manuallyUpdateFilterItems(r);
|
|
978
978
|
}
|
|
@@ -995,7 +995,7 @@ let Re = class extends de {
|
|
|
995
995
|
async apply() {
|
|
996
996
|
if (this._disposed)
|
|
997
997
|
return !1;
|
|
998
|
-
const e =
|
|
998
|
+
const e = je(this._filterItems), { checked: r, checkedItems: n } = e, i = this.rawFilterItems;
|
|
999
999
|
let l = 0;
|
|
1000
1000
|
for (const c of i)
|
|
1001
1001
|
l += c.count;
|
|
@@ -1025,37 +1025,37 @@ let Re = class extends de {
|
|
|
1025
1025
|
}
|
|
1026
1026
|
// #endregion
|
|
1027
1027
|
};
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
],
|
|
1031
|
-
const ne = "FILTER_PANEL_OPENED",
|
|
1028
|
+
ye = rt([
|
|
1029
|
+
Oe(4, W)
|
|
1030
|
+
], ye);
|
|
1031
|
+
const ne = "FILTER_PANEL_OPENED", Ae = {
|
|
1032
1032
|
id: "sheet.operation.open-filter-panel",
|
|
1033
|
-
type:
|
|
1033
|
+
type: $e.OPERATION,
|
|
1034
1034
|
handler: (t, e) => {
|
|
1035
|
-
const r = t.get(
|
|
1036
|
-
t.get(W).syncExecuteCommand(
|
|
1035
|
+
const r = t.get(we), n = t.get(Q), i = t.get(j);
|
|
1036
|
+
t.get(W).syncExecuteCommand(Sr.id, { visible: !1 });
|
|
1037
1037
|
const { unitId: s, subUnitId: o, col: a } = e, c = n.getFilterModel(s, o);
|
|
1038
1038
|
return c ? (i.setupCol(c, a), r.getContextValue(ne) || r.setContextValue(ne, !0), !0) : !1;
|
|
1039
1039
|
}
|
|
1040
1040
|
}, pe = {
|
|
1041
1041
|
id: "sheet.operation.close-filter-panel",
|
|
1042
|
-
type:
|
|
1042
|
+
type: $e.OPERATION,
|
|
1043
1043
|
handler: (t) => {
|
|
1044
|
-
const e = t.get(
|
|
1044
|
+
const e = t.get(we), r = t.get(j), n = t.get(Ar, gt.OPTIONAL);
|
|
1045
1045
|
return e.getContextValue(ne) ? (e.setContextValue(ne, !1), n == null || n.focus(), r.terminate()) : !1;
|
|
1046
1046
|
}
|
|
1047
|
-
},
|
|
1047
|
+
}, Dt = {
|
|
1048
1048
|
id: "sheet.operation.apply-filter",
|
|
1049
|
-
type:
|
|
1049
|
+
type: $e.OPERATION,
|
|
1050
1050
|
handler: (t, e) => {
|
|
1051
1051
|
const { filterBy: r } = e;
|
|
1052
1052
|
return t.get(j).changeFilterBy(r);
|
|
1053
1053
|
}
|
|
1054
1054
|
};
|
|
1055
|
-
var
|
|
1056
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1055
|
+
var ls = Object.defineProperty, cs = Object.getOwnPropertyDescriptor, us = (t, e, r, n) => {
|
|
1056
|
+
for (var i = n > 1 ? void 0 : n ? cs(e, r) : e, l = t.length - 1, s; l >= 0; l--)
|
|
1057
1057
|
(s = t[l]) && (i = (n ? s(e, r, i) : s(i)) || i);
|
|
1058
|
-
return n && i &&
|
|
1058
|
+
return n && i && ls(e, r, i), i;
|
|
1059
1059
|
}, ee = (t, e) => (r, n) => e(r, n, t);
|
|
1060
1060
|
let ie = class extends de {
|
|
1061
1061
|
constructor(t, e, r, n, i, l) {
|
|
@@ -1066,7 +1066,7 @@ let ie = class extends de {
|
|
|
1066
1066
|
this._commandService.beforeCommandExecuted((t) => {
|
|
1067
1067
|
var e, r, n;
|
|
1068
1068
|
if (t.id === fe.id) {
|
|
1069
|
-
const i = this._injector.get(
|
|
1069
|
+
const i = this._injector.get(Ye), l = mr(i);
|
|
1070
1070
|
if (!l) return;
|
|
1071
1071
|
const { unitId: s, subUnitId: o, worksheet: a } = l, c = (e = this._sheetsFilterService.getFilterModel(s, o)) == null ? void 0 : e.getRange();
|
|
1072
1072
|
let h;
|
|
@@ -1079,7 +1079,7 @@ let ie = class extends de {
|
|
|
1079
1079
|
const p = (r = this._sheetsSelectionService.getCurrentLastSelection()) == null ? void 0 : r.range;
|
|
1080
1080
|
if (p) {
|
|
1081
1081
|
let S = { ...p };
|
|
1082
|
-
S = p.startColumn === p.endColumn && p.startRow === p.endRow ?
|
|
1082
|
+
S = p.startColumn === p.endColumn && p.startRow === p.endRow ? dr(S, { left: !0, right: !0, up: !0, down: !0 }, a) : S, h = this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
|
|
1083
1083
|
rangeTypes: [le],
|
|
1084
1084
|
worksheetTypes: [ue, ce]
|
|
1085
1085
|
}, [S], s, o);
|
|
@@ -1091,7 +1091,7 @@ let ie = class extends de {
|
|
|
1091
1091
|
}
|
|
1092
1092
|
h || this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.filterErr"));
|
|
1093
1093
|
}
|
|
1094
|
-
if (t.id ===
|
|
1094
|
+
if (t.id === Ae.id) {
|
|
1095
1095
|
const i = t.params, { unitId: l, subUnitId: s } = i, o = (n = this._sheetsFilterService.getFilterModel(l, s)) == null ? void 0 : n.getRange(), a = Fe.deepClone(o);
|
|
1096
1096
|
a && (a.startColumn = i.col, a.endColumn = i.col, this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
|
|
1097
1097
|
rangeTypes: [le],
|
|
@@ -1102,13 +1102,13 @@ let ie = class extends de {
|
|
|
1102
1102
|
);
|
|
1103
1103
|
}
|
|
1104
1104
|
};
|
|
1105
|
-
ie =
|
|
1105
|
+
ie = us([
|
|
1106
1106
|
ee(0, E(Q)),
|
|
1107
1107
|
ee(1, E(K)),
|
|
1108
1108
|
ee(2, W),
|
|
1109
|
-
ee(3, E(
|
|
1109
|
+
ee(3, E(gr)),
|
|
1110
1110
|
ee(4, E(X)),
|
|
1111
|
-
ee(5, E(
|
|
1111
|
+
ee(5, E(pr))
|
|
1112
1112
|
], ie);
|
|
1113
1113
|
var b = function() {
|
|
1114
1114
|
return b = Object.assign || function(t) {
|
|
@@ -1118,23 +1118,23 @@ var b = function() {
|
|
|
1118
1118
|
}
|
|
1119
1119
|
return t;
|
|
1120
1120
|
}, b.apply(this, arguments);
|
|
1121
|
-
},
|
|
1121
|
+
}, hs = function(t, e) {
|
|
1122
1122
|
var r = {};
|
|
1123
1123
|
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (r[n] = t[n]);
|
|
1124
1124
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
1125
1125
|
for (var i = 0, n = Object.getOwnPropertySymbols(t); i < n.length; i++)
|
|
1126
1126
|
e.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[i]) && (r[n[i]] = t[n[i]]);
|
|
1127
1127
|
return r;
|
|
1128
|
-
},
|
|
1129
|
-
var r = t.icon, n = t.id, i = t.className, l = t.extend, s =
|
|
1130
|
-
return
|
|
1128
|
+
}, xt = Lt(function(t, e) {
|
|
1129
|
+
var r = t.icon, n = t.id, i = t.className, l = t.extend, s = hs(t, ["icon", "id", "className", "extend"]), o = "univerjs-icon univerjs-icon-".concat(n, " ").concat(i || "").trim(), a = es("_".concat(ds()));
|
|
1130
|
+
return Bt(r, "".concat(n), { defIds: r.defIds, idSuffix: a.current }, b({ ref: e, className: o }, s), l);
|
|
1131
1131
|
});
|
|
1132
|
-
function
|
|
1133
|
-
return
|
|
1134
|
-
return
|
|
1132
|
+
function Bt(t, e, r, n, i) {
|
|
1133
|
+
return Mt(t.tag, b(b({ key: e }, ps(t, r, i)), n), (ms(t, r).children || []).map(function(l, s) {
|
|
1134
|
+
return Bt(l, "".concat(e, "-").concat(t.tag, "-").concat(s), r, void 0, i);
|
|
1135
1135
|
}));
|
|
1136
1136
|
}
|
|
1137
|
-
function
|
|
1137
|
+
function ps(t, e, r) {
|
|
1138
1138
|
var n = b({}, t.attrs);
|
|
1139
1139
|
r != null && r.colorChannel1 && n.fill === "colorChannel1" && (n.fill = r.colorChannel1);
|
|
1140
1140
|
var i = e.defIds;
|
|
@@ -1143,25 +1143,25 @@ function hs(t, e, r) {
|
|
|
1143
1143
|
typeof o == "string" && (n[s] = o.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
1144
1144
|
})), n;
|
|
1145
1145
|
}
|
|
1146
|
-
function
|
|
1146
|
+
function ms(t, e) {
|
|
1147
1147
|
var r, n = e.defIds;
|
|
1148
1148
|
return !n || n.length === 0 ? t : t.tag === "defs" && (!((r = t.children) === null || r === void 0) && r.length) ? b(b({}, t), { children: t.children.map(function(i) {
|
|
1149
1149
|
return typeof i.attrs.id == "string" && n && n.indexOf(i.attrs.id) > -1 ? b(b({}, i), { attrs: b(b({}, i.attrs), { id: i.attrs.id + e.idSuffix }) }) : i;
|
|
1150
1150
|
}) }) : t;
|
|
1151
1151
|
}
|
|
1152
|
-
function
|
|
1152
|
+
function ds() {
|
|
1153
1153
|
return Math.random().toString(36).substring(2, 8);
|
|
1154
1154
|
}
|
|
1155
|
-
|
|
1156
|
-
var
|
|
1157
|
-
return
|
|
1155
|
+
xt.displayName = "UniverIcon";
|
|
1156
|
+
var fs = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3.32182 2.60967C2.98161 2.60967 2.79671 3.0074 3.01601 3.2675L6.85819 7.8246C6.94943 7.93282 6.99947 8.06981 6.99947 8.21136V12.7338C6.99947 12.898 7.0998 13.0455 7.2525 13.1058L8.73833 13.6928C9.00085 13.7965 9.28531 13.6031 9.28531 13.3208V8.21136C9.28531 8.06981 9.33535 7.93282 9.42659 7.8246L13.2688 3.2675C13.4881 3.0074 13.3032 2.60967 12.963 2.60967H3.32182ZM2.09858 4.04101C1.22139 3.0006 1.96097 1.40967 3.32182 1.40967H12.963C14.3238 1.40967 15.0634 3.0006 14.1862 4.04101L10.4853 8.43054V13.3208C10.4853 14.4498 9.34747 15.2237 8.29742 14.8089L6.81158 14.2219C6.20078 13.9806 5.79947 13.3905 5.79947 12.7338V8.43054L2.09858 4.04101Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Vt = Lt(function(t, e) {
|
|
1157
|
+
return Mt(xt, Object.assign({}, t, {
|
|
1158
1158
|
id: "filter-single",
|
|
1159
1159
|
ref: e,
|
|
1160
|
-
icon:
|
|
1160
|
+
icon: fs
|
|
1161
1161
|
}));
|
|
1162
1162
|
});
|
|
1163
|
-
|
|
1164
|
-
var
|
|
1163
|
+
Vt.displayName = "FilterSingle";
|
|
1164
|
+
var xe = { exports: {} }, ae = {};
|
|
1165
1165
|
/**
|
|
1166
1166
|
* @license React
|
|
1167
1167
|
* react-jsx-runtime.production.min.js
|
|
@@ -1171,11 +1171,11 @@ var De = { exports: {} }, ae = {};
|
|
|
1171
1171
|
* This source code is licensed under the MIT license found in the
|
|
1172
1172
|
* LICENSE file in the root directory of this source tree.
|
|
1173
1173
|
*/
|
|
1174
|
-
var
|
|
1175
|
-
function
|
|
1176
|
-
if (
|
|
1177
|
-
|
|
1178
|
-
var t =
|
|
1174
|
+
var ut;
|
|
1175
|
+
function _s() {
|
|
1176
|
+
if (ut) return ae;
|
|
1177
|
+
ut = 1;
|
|
1178
|
+
var t = zr, e = Symbol.for("react.element"), r = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, i = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
1179
1179
|
function s(o, a, c) {
|
|
1180
1180
|
var h, p = {}, S = null, f = null;
|
|
1181
1181
|
c !== void 0 && (S = "" + c), a.key !== void 0 && (S = "" + a.key), a.ref !== void 0 && (f = a.ref);
|
|
@@ -1185,64 +1185,64 @@ function fs() {
|
|
|
1185
1185
|
}
|
|
1186
1186
|
return ae.Fragment = r, ae.jsx = s, ae.jsxs = s, ae;
|
|
1187
1187
|
}
|
|
1188
|
-
var
|
|
1189
|
-
function
|
|
1190
|
-
return
|
|
1188
|
+
var ht;
|
|
1189
|
+
function vs() {
|
|
1190
|
+
return ht || (ht = 1, xe.exports = _s()), xe.exports;
|
|
1191
1191
|
}
|
|
1192
|
-
var d =
|
|
1193
|
-
const
|
|
1194
|
-
sheetsFilterPanel:
|
|
1195
|
-
sheetsFilterPanelHeader:
|
|
1196
|
-
sheetsFilterPanelContent:
|
|
1197
|
-
sheetsFilterPanelSelectAll:
|
|
1198
|
-
sheetsFilterPanelSelectAllCount:
|
|
1199
|
-
sheetsFilterPanelValuesContainer:
|
|
1200
|
-
inputAffixWrapper:
|
|
1201
|
-
select:
|
|
1202
|
-
radioGroup:
|
|
1203
|
-
sheetsFilterPanelValuesFind:
|
|
1204
|
-
sheetsFilterPanelValuesList:
|
|
1205
|
-
sheetsFilterPanelValuesListInnerContainer:
|
|
1206
|
-
sheetsFilterPanelValuesVirtual:
|
|
1207
|
-
sheetsFilterPanelValuesItem:
|
|
1208
|
-
sheetsFilterPanelValuesItemInner:
|
|
1209
|
-
sheetsFilterPanelValuesItemCount:
|
|
1210
|
-
sheetsFilterPanelValuesItemExcludeButton:
|
|
1211
|
-
sheetsFilterPanelValuesItemText:
|
|
1212
|
-
sheetsFilterPanelConditionsContainer:
|
|
1213
|
-
sheetsFilterPanelConditionsContainerInner:
|
|
1214
|
-
sheetsFilterPanelConditionsDesc:
|
|
1215
|
-
sheetsFilterPanelFooter:
|
|
1216
|
-
sheetsFilterPanelFooterPrimaryButtons:
|
|
1217
|
-
button:
|
|
1218
|
-
input:
|
|
1219
|
-
formDualColumnLayout:
|
|
1220
|
-
sheetsFilterTreeNode:
|
|
1221
|
-
sheetsFilterTreeNodeFilterOnly:
|
|
1222
|
-
sheetsFilterTreeNodeAttach:
|
|
1192
|
+
var d = vs();
|
|
1193
|
+
const Ss = "univer-sheets-filter-panel", gs = "univer-sheets-filter-panel-header", Es = "univer-sheets-filter-panel-content", Ts = "univer-sheets-filter-panel-select-all", Fs = "univer-sheets-filter-panel-select-all-count", Cs = "univer-sheets-filter-panel-values-container", Ns = "univer-input-affix-wrapper", Ps = "univer-select", Os = "univer-radio-group", Is = "univer-sheets-filter-panel-values-find", Rs = "univer-sheets-filter-panel-values-list", ys = "univer-sheets-filter-panel-values-list-inner-container", As = "univer-sheets-filter-panel-values-virtual", bs = "univer-sheets-filter-panel-values-item", Ls = "univer-sheets-filter-panel-values-item-inner", Ms = "univer-sheets-filter-panel-values-item-count", $s = "univer-sheets-filter-panel-values-item-exclude-button", ws = "univer-sheets-filter-panel-values-item-text", Us = "univer-sheets-filter-panel-conditions-container", Hs = "univer-sheets-filter-panel-conditions-container-inner", Ds = "univer-sheets-filter-panel-conditions-desc", xs = "univer-sheets-filter-panel-footer", Bs = "univer-sheets-filter-panel-footer-primary-buttons", Vs = "univer-button", js = "univer-input", Ws = "univer-form-dual-column-layout", Qs = "univer-sheets-filter-tree-node", ks = "univer-sheets-filter-tree-node-filter-only", Gs = "univer-sheets-filter-tree-node-attach", C = {
|
|
1194
|
+
sheetsFilterPanel: Ss,
|
|
1195
|
+
sheetsFilterPanelHeader: gs,
|
|
1196
|
+
sheetsFilterPanelContent: Es,
|
|
1197
|
+
sheetsFilterPanelSelectAll: Ts,
|
|
1198
|
+
sheetsFilterPanelSelectAllCount: Fs,
|
|
1199
|
+
sheetsFilterPanelValuesContainer: Cs,
|
|
1200
|
+
inputAffixWrapper: Ns,
|
|
1201
|
+
select: Ps,
|
|
1202
|
+
radioGroup: Os,
|
|
1203
|
+
sheetsFilterPanelValuesFind: Is,
|
|
1204
|
+
sheetsFilterPanelValuesList: Rs,
|
|
1205
|
+
sheetsFilterPanelValuesListInnerContainer: ys,
|
|
1206
|
+
sheetsFilterPanelValuesVirtual: As,
|
|
1207
|
+
sheetsFilterPanelValuesItem: bs,
|
|
1208
|
+
sheetsFilterPanelValuesItemInner: Ls,
|
|
1209
|
+
sheetsFilterPanelValuesItemCount: Ms,
|
|
1210
|
+
sheetsFilterPanelValuesItemExcludeButton: $s,
|
|
1211
|
+
sheetsFilterPanelValuesItemText: ws,
|
|
1212
|
+
sheetsFilterPanelConditionsContainer: Us,
|
|
1213
|
+
sheetsFilterPanelConditionsContainerInner: Hs,
|
|
1214
|
+
sheetsFilterPanelConditionsDesc: Ds,
|
|
1215
|
+
sheetsFilterPanelFooter: xs,
|
|
1216
|
+
sheetsFilterPanelFooterPrimaryButtons: Bs,
|
|
1217
|
+
button: Vs,
|
|
1218
|
+
input: js,
|
|
1219
|
+
formDualColumnLayout: Ws,
|
|
1220
|
+
sheetsFilterTreeNode: Qs,
|
|
1221
|
+
sheetsFilterTreeNodeFilterOnly: ks,
|
|
1222
|
+
sheetsFilterTreeNodeAttach: Gs
|
|
1223
1223
|
};
|
|
1224
|
-
function
|
|
1224
|
+
function Ys(t) {
|
|
1225
1225
|
var f, T;
|
|
1226
1226
|
const { model: e } = t, r = te(K), n = V(e.conditionItem$, void 0), i = V(e.filterConditionFormParams$, void 0), l = i != null && i.and ? "AND" : "OR", s = D((g) => {
|
|
1227
1227
|
e.onConditionFormChange({ and: g === "AND" });
|
|
1228
|
-
}, [e]), o =
|
|
1228
|
+
}, [e]), o = qs(r), a = D((g) => {
|
|
1229
1229
|
e.onPrimaryConditionChange(g);
|
|
1230
|
-
}, [e]), c =
|
|
1230
|
+
}, [e]), c = Ks(r), h = D((g) => {
|
|
1231
1231
|
e.onConditionFormChange(g);
|
|
1232
1232
|
}, [e]), p = r.t("sheets-filter.panel.input-values-placeholder");
|
|
1233
1233
|
function S(g, P, F) {
|
|
1234
1234
|
const R = m.getItemByOperator(g).numOfParameters === 1;
|
|
1235
1235
|
return /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
|
1236
|
-
F === "operator2" && /* @__PURE__ */ d.jsxs(
|
|
1237
|
-
/* @__PURE__ */ d.jsx(
|
|
1238
|
-
/* @__PURE__ */ d.jsx(
|
|
1236
|
+
F === "operator2" && /* @__PURE__ */ d.jsxs(Yr, { value: l, onChange: s, children: [
|
|
1237
|
+
/* @__PURE__ */ d.jsx(lt, { value: "AND", children: r.t("sheets-filter.panel.and") }),
|
|
1238
|
+
/* @__PURE__ */ d.jsx(lt, { value: "OR", children: r.t("sheets-filter.panel.or") })
|
|
1239
1239
|
] }),
|
|
1240
|
-
/* @__PURE__ */ d.jsx(
|
|
1241
|
-
R && /* @__PURE__ */ d.jsx("div", { children: /* @__PURE__ */ d.jsx(
|
|
1240
|
+
/* @__PURE__ */ d.jsx(at, { value: g, options: c, onChange: (I) => h({ [F]: I }) }),
|
|
1241
|
+
R && /* @__PURE__ */ d.jsx("div", { children: /* @__PURE__ */ d.jsx(At, { value: P, placeholder: p, onChange: (I) => h({ [F === "operator1" ? "val1" : "val2"]: I }) }) })
|
|
1242
1242
|
] });
|
|
1243
1243
|
}
|
|
1244
1244
|
return /* @__PURE__ */ d.jsx("div", { className: C.sheetsFilterPanelConditionsContainer, children: n && i && /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
|
1245
|
-
/* @__PURE__ */ d.jsx(
|
|
1245
|
+
/* @__PURE__ */ d.jsx(at, { value: n.operator, options: o, onChange: a }),
|
|
1246
1246
|
m.getItemByOperator(n.operator).numOfParameters !== 0 ? /* @__PURE__ */ d.jsxs("div", { className: C.sheetsFilterPanelConditionsContainerInner, children: [
|
|
1247
1247
|
n.numOfParameters >= 1 && S(i.operator1, (f = i.val1) != null ? f : "", "operator1"),
|
|
1248
1248
|
n.numOfParameters >= 2 && S(i.operator2, (T = i.val2) != null ? T : "", "operator2"),
|
|
@@ -1254,9 +1254,9 @@ function Gs(t) {
|
|
|
1254
1254
|
] }) : null
|
|
1255
1255
|
] }) });
|
|
1256
1256
|
}
|
|
1257
|
-
function
|
|
1257
|
+
function qs(t) {
|
|
1258
1258
|
const e = t.getCurrentLocale();
|
|
1259
|
-
return
|
|
1259
|
+
return et(
|
|
1260
1260
|
() => [
|
|
1261
1261
|
{
|
|
1262
1262
|
options: [
|
|
@@ -1300,16 +1300,16 @@ function Ys(t) {
|
|
|
1300
1300
|
[e, t]
|
|
1301
1301
|
);
|
|
1302
1302
|
}
|
|
1303
|
-
function
|
|
1303
|
+
function Ks(t) {
|
|
1304
1304
|
const e = t.getCurrentLocale();
|
|
1305
|
-
return
|
|
1305
|
+
return et(
|
|
1306
1306
|
() => m.ALL_CONDITIONS.filter((r) => r.numOfParameters !== 2).map((r) => ({ label: t.t(r.label), value: r.operator })),
|
|
1307
1307
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1308
1308
|
[e, t]
|
|
1309
1309
|
);
|
|
1310
1310
|
}
|
|
1311
|
-
function
|
|
1312
|
-
const { model: e } = t, r = te(K), n = V(e.searchString$, "", !0), i = V(e.filterItems$, void 0, !0), l = r.t("sheets-filter.panel.filter-only"), s =
|
|
1311
|
+
function Xs(t) {
|
|
1312
|
+
const { model: e } = t, r = te(K), n = V(e.searchString$, "", !0), i = V(e.filterItems$, void 0, !0), l = r.t("sheets-filter.panel.filter-only"), s = je(i), o = s.checked > 0 && s.unchecked === 0, a = s.checked > 0 && s.unchecked > 0, c = e.treeMapCache, h = D(() => {
|
|
1313
1313
|
e.onCheckAllToggled(!o);
|
|
1314
1314
|
}, [e, o]), p = D((f) => {
|
|
1315
1315
|
e.setSearchString(f);
|
|
@@ -1321,11 +1321,11 @@ function Ks(t) {
|
|
|
1321
1321
|
}), T;
|
|
1322
1322
|
}
|
|
1323
1323
|
return /* @__PURE__ */ d.jsxs("div", { className: C.sheetsFilterPanelValuesContainer, children: [
|
|
1324
|
-
/* @__PURE__ */ d.jsx(
|
|
1324
|
+
/* @__PURE__ */ d.jsx(At, { autoFocus: !0, value: n, placeholder: r.t("sheets-filter.panel.search-placeholder"), onChange: p }),
|
|
1325
1325
|
/* @__PURE__ */ d.jsxs("div", { className: C.sheetsFilterPanelValuesList, children: [
|
|
1326
1326
|
/* @__PURE__ */ d.jsx("div", { className: C.sheetsFilterPanelValuesItem, children: /* @__PURE__ */ d.jsxs("div", { className: C.sheetsFilterPanelValuesItemInner, children: [
|
|
1327
1327
|
/* @__PURE__ */ d.jsx(
|
|
1328
|
-
|
|
1328
|
+
qr,
|
|
1329
1329
|
{
|
|
1330
1330
|
indeterminate: a,
|
|
1331
1331
|
disabled: i.length === 0,
|
|
@@ -1337,7 +1337,7 @@ function Ks(t) {
|
|
|
1337
1337
|
/* @__PURE__ */ d.jsx("span", { className: C.sheetsFilterPanelValuesItemCount, children: `(${s.checked}/${s.checked + s.unchecked})` })
|
|
1338
1338
|
] }) }),
|
|
1339
1339
|
/* @__PURE__ */ d.jsx("div", { className: C.sheetsFilterPanelValuesVirtual, children: /* @__PURE__ */ d.jsx(
|
|
1340
|
-
|
|
1340
|
+
Kr,
|
|
1341
1341
|
{
|
|
1342
1342
|
data: i,
|
|
1343
1343
|
defaultExpandAll: !1,
|
|
@@ -1374,27 +1374,27 @@ function Ks(t) {
|
|
|
1374
1374
|
] })
|
|
1375
1375
|
] });
|
|
1376
1376
|
}
|
|
1377
|
-
function
|
|
1377
|
+
function Zs() {
|
|
1378
1378
|
var P;
|
|
1379
|
-
const t = te(j), e = te(K), r = te(W), n = V(t.filterBy$, void 0, !0), i = V(t.filterByModel$, void 0, !1), l = V(() => (i == null ? void 0 : i.canApply$) || _e(!1), void 0, !1, [i]), s =
|
|
1380
|
-
r.executeCommand(
|
|
1379
|
+
const t = te(j), e = te(K), r = te(W), n = V(t.filterBy$, void 0, !0), i = V(t.filterByModel$, void 0, !1), l = V(() => (i == null ? void 0 : i.canApply$) || _e(!1), void 0, !1, [i]), s = Js(e), o = !V(t.hasCriteria$), a = D((F) => {
|
|
1380
|
+
r.executeCommand(Dt.id, { filterBy: F });
|
|
1381
1381
|
}, [r]), c = D(async () => {
|
|
1382
1382
|
await (i == null ? void 0 : i.clear()), r.executeCommand(pe.id);
|
|
1383
1383
|
}, [i, r]), h = D(() => {
|
|
1384
1384
|
r.executeCommand(pe.id);
|
|
1385
1385
|
}, [r]), p = D(async () => {
|
|
1386
1386
|
await (i == null ? void 0 : i.apply()), r.executeCommand(pe.id);
|
|
1387
|
-
}, [i, r]), f = (P = te(Q).activeFilterModel) == null ? void 0 : P.getRange(), T = t.col, g =
|
|
1387
|
+
}, [i, r]), f = (P = te(Q).activeFilterModel) == null ? void 0 : P.getRange(), T = t.col, g = br(Er.FILTER_PANEL_EMBED_POINT);
|
|
1388
1388
|
return /* @__PURE__ */ d.jsxs("div", { className: C.sheetsFilterPanel, children: [
|
|
1389
1389
|
/* @__PURE__ */ d.jsx(
|
|
1390
|
-
|
|
1390
|
+
Lr,
|
|
1391
1391
|
{
|
|
1392
1392
|
components: g,
|
|
1393
1393
|
sharedProps: { range: f, colIndex: T, onClose: h }
|
|
1394
1394
|
}
|
|
1395
1395
|
),
|
|
1396
|
-
/* @__PURE__ */ d.jsx("div", { className: C.sheetsFilterPanelHeader, children: /* @__PURE__ */ d.jsx(
|
|
1397
|
-
i ? /* @__PURE__ */ d.jsx("div", { className: C.sheetsFilterPanelContent, children: n ===
|
|
1396
|
+
/* @__PURE__ */ d.jsx("div", { className: C.sheetsFilterPanelHeader, children: /* @__PURE__ */ d.jsx(Xr, { value: n, options: s, onChange: (F) => a(F) }) }),
|
|
1397
|
+
i ? /* @__PURE__ */ d.jsx("div", { className: C.sheetsFilterPanelContent, children: n === Ie.VALUES ? /* @__PURE__ */ d.jsx(Xs, { model: i }) : /* @__PURE__ */ d.jsx(Ys, { model: i }) }) : /* @__PURE__ */ d.jsx("div", { style: { flex: 1 } }),
|
|
1398
1398
|
/* @__PURE__ */ d.jsxs("div", { className: C.sheetsFilterPanelFooter, children: [
|
|
1399
1399
|
/* @__PURE__ */ d.jsx(Ce, { type: "link", onClick: c, disabled: o, children: e.t("sheets-filter.panel.clear-filter") }),
|
|
1400
1400
|
/* @__PURE__ */ d.jsxs("span", { className: C.sheetsFilterPanelFooterPrimaryButtons, children: [
|
|
@@ -1404,79 +1404,79 @@ function Xs() {
|
|
|
1404
1404
|
] })
|
|
1405
1405
|
] });
|
|
1406
1406
|
}
|
|
1407
|
-
function
|
|
1407
|
+
function Js(t) {
|
|
1408
1408
|
const e = t.getCurrentLocale();
|
|
1409
|
-
return
|
|
1409
|
+
return et(
|
|
1410
1410
|
() => [
|
|
1411
|
-
{ label: t.t("sheets-filter.panel.by-values"), value:
|
|
1412
|
-
{ label: t.t("sheets-filter.panel.by-conditions"), value:
|
|
1411
|
+
{ label: t.t("sheets-filter.panel.by-values"), value: Ie.VALUES },
|
|
1412
|
+
{ label: t.t("sheets-filter.panel.by-conditions"), value: Ie.CONDITIONS }
|
|
1413
1413
|
],
|
|
1414
1414
|
[e, t]
|
|
1415
1415
|
);
|
|
1416
1416
|
}
|
|
1417
|
-
function
|
|
1417
|
+
function zs(t) {
|
|
1418
1418
|
const e = t.get(Q);
|
|
1419
1419
|
return {
|
|
1420
1420
|
id: fe.id,
|
|
1421
|
-
type:
|
|
1421
|
+
type: Ze.BUTTON_SELECTOR,
|
|
1422
1422
|
icon: "FilterSingle",
|
|
1423
1423
|
tooltip: "sheets-filter.toolbar.smart-toggle-filter-tooltip",
|
|
1424
|
-
hidden$:
|
|
1424
|
+
hidden$: Je(t, Z.UNIVER_SHEET),
|
|
1425
1425
|
activated$: e.activeFilterModel$.pipe(se((r) => !!r)),
|
|
1426
|
-
disabled$:
|
|
1426
|
+
disabled$: Tr(t, Fr(t, { worksheetTypes: [ce, ue], rangeTypes: [le] }))
|
|
1427
1427
|
};
|
|
1428
1428
|
}
|
|
1429
|
-
function
|
|
1429
|
+
function en(t) {
|
|
1430
1430
|
const e = t.get(Q);
|
|
1431
1431
|
return {
|
|
1432
|
-
id:
|
|
1433
|
-
type:
|
|
1432
|
+
id: Ke.id,
|
|
1433
|
+
type: Ze.BUTTON,
|
|
1434
1434
|
title: "sheets-filter.toolbar.clear-filter-criteria",
|
|
1435
|
-
hidden$:
|
|
1436
|
-
disabled$: e.activeFilterModel$.pipe(
|
|
1435
|
+
hidden$: Je(t, Z.UNIVER_SHEET),
|
|
1436
|
+
disabled$: e.activeFilterModel$.pipe(ze((r) => {
|
|
1437
1437
|
var n;
|
|
1438
1438
|
return (n = r == null ? void 0 : r.hasCriteria$.pipe(se((i) => !i))) != null ? n : _e(!0);
|
|
1439
1439
|
}))
|
|
1440
1440
|
};
|
|
1441
1441
|
}
|
|
1442
|
-
function
|
|
1442
|
+
function tn(t) {
|
|
1443
1443
|
const e = t.get(Q);
|
|
1444
1444
|
return {
|
|
1445
|
-
id:
|
|
1446
|
-
type:
|
|
1445
|
+
id: Xe.id,
|
|
1446
|
+
type: Ze.BUTTON,
|
|
1447
1447
|
title: "sheets-filter.toolbar.re-calc-filter-conditions",
|
|
1448
|
-
hidden$:
|
|
1449
|
-
disabled$: e.activeFilterModel$.pipe(
|
|
1448
|
+
hidden$: Je(t, Z.UNIVER_SHEET),
|
|
1449
|
+
disabled$: e.activeFilterModel$.pipe(ze((r) => {
|
|
1450
1450
|
var n;
|
|
1451
1451
|
return (n = r == null ? void 0 : r.hasCriteria$.pipe(se((i) => !i))) != null ? n : _e(!0);
|
|
1452
1452
|
}))
|
|
1453
1453
|
};
|
|
1454
1454
|
}
|
|
1455
|
-
const
|
|
1456
|
-
[
|
|
1455
|
+
const rn = {
|
|
1456
|
+
[Mr.FORMULAS_INSERT]: {
|
|
1457
1457
|
[fe.id]: {
|
|
1458
1458
|
order: 10,
|
|
1459
|
-
menuItemFactory:
|
|
1460
|
-
[
|
|
1459
|
+
menuItemFactory: zs,
|
|
1460
|
+
[Ke.id]: {
|
|
1461
1461
|
order: 0,
|
|
1462
|
-
menuItemFactory:
|
|
1462
|
+
menuItemFactory: en
|
|
1463
1463
|
},
|
|
1464
|
-
[
|
|
1464
|
+
[Xe.id]: {
|
|
1465
1465
|
order: 1,
|
|
1466
|
-
menuItemFactory:
|
|
1466
|
+
menuItemFactory: tn
|
|
1467
1467
|
}
|
|
1468
1468
|
}
|
|
1469
1469
|
}
|
|
1470
|
-
},
|
|
1470
|
+
}, sn = {
|
|
1471
1471
|
id: fe.id,
|
|
1472
|
-
binding:
|
|
1472
|
+
binding: $r.L | ot.CTRL_COMMAND | ot.SHIFT,
|
|
1473
1473
|
description: "sheets-filter.shortcut.smart-toggle-filter",
|
|
1474
|
-
preconditions:
|
|
1474
|
+
preconditions: Cr,
|
|
1475
1475
|
group: "4_sheet-edit"
|
|
1476
|
-
}, B = 16,
|
|
1477
|
-
class
|
|
1476
|
+
}, B = 16, nn = 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");
|
|
1477
|
+
class pt {
|
|
1478
1478
|
static drawNoCriteria(e, r, n, i) {
|
|
1479
|
-
e.save(),
|
|
1479
|
+
e.save(), ct.drawWith(e, {
|
|
1480
1480
|
radius: 2,
|
|
1481
1481
|
width: B,
|
|
1482
1482
|
height: B,
|
|
@@ -1484,21 +1484,21 @@ class ht {
|
|
|
1484
1484
|
}), e.lineCap = "square", e.strokeStyle = n, e.scale(r / B, r / B), 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();
|
|
1485
1485
|
}
|
|
1486
1486
|
static drawHasCriteria(e, r, n, i) {
|
|
1487
|
-
e.save(),
|
|
1487
|
+
e.save(), ct.drawWith(e, {
|
|
1488
1488
|
radius: 2,
|
|
1489
1489
|
width: B,
|
|
1490
1490
|
height: B,
|
|
1491
1491
|
fill: i
|
|
1492
|
-
}), e.scale(r / B, r / B), e.fillStyle = n, e.fill(
|
|
1492
|
+
}), e.scale(r / B, r / B), e.fillStyle = n, e.fill(nn), e.restore();
|
|
1493
1493
|
}
|
|
1494
1494
|
}
|
|
1495
|
-
var
|
|
1496
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1495
|
+
var on = Object.defineProperty, an = Object.getOwnPropertyDescriptor, ln = (t, e, r, n) => {
|
|
1496
|
+
for (var i = n > 1 ? void 0 : n ? an(e, r) : e, l = t.length - 1, s; l >= 0; l--)
|
|
1497
1497
|
(s = t[l]) && (i = (n ? s(e, r, i) : s(i)) || i);
|
|
1498
|
-
return n && i &&
|
|
1499
|
-
},
|
|
1498
|
+
return n && i && on(e, r, i), i;
|
|
1499
|
+
}, Be = (t, e) => (r, n) => e(r, n, t);
|
|
1500
1500
|
const H = 16, Ee = 1;
|
|
1501
|
-
let
|
|
1501
|
+
let ke = class extends Jr {
|
|
1502
1502
|
constructor(e, r, n, i, l) {
|
|
1503
1503
|
super(e, r);
|
|
1504
1504
|
_(this, "_cellWidth", 0);
|
|
@@ -1519,14 +1519,14 @@ let Qe = class extends Zr {
|
|
|
1519
1519
|
const s = new Path2D();
|
|
1520
1520
|
s.rect(i, l, n, r), e.clip(s);
|
|
1521
1521
|
const { hasCriteria: o } = this._filterParams, a = this._themeService.getCurrentTheme().primaryColor, c = this._hovered ? this._themeService.getCurrentTheme().grey50 : "rgba(255, 255, 255, 1.0)";
|
|
1522
|
-
o ?
|
|
1522
|
+
o ? pt.drawHasCriteria(e, H, a, c) : pt.drawNoCriteria(e, H, a, c), e.restore();
|
|
1523
1523
|
}
|
|
1524
1524
|
onPointerDown(e) {
|
|
1525
1525
|
if (e.button === 2)
|
|
1526
1526
|
return;
|
|
1527
1527
|
const { col: r, unitId: n, subUnitId: i } = this._filterParams;
|
|
1528
|
-
this._contextService.getContextValue(ne) || !this._commandService.hasCommand(
|
|
1529
|
-
this._commandService.executeCommand(
|
|
1528
|
+
this._contextService.getContextValue(ne) || !this._commandService.hasCommand(Ae.id) || setTimeout(() => {
|
|
1529
|
+
this._commandService.executeCommand(Ae.id, {
|
|
1530
1530
|
unitId: n,
|
|
1531
1531
|
subUnitId: i,
|
|
1532
1532
|
col: r
|
|
@@ -1540,18 +1540,18 @@ let Qe = class extends Zr {
|
|
|
1540
1540
|
this._hovered = !1, this.makeDirty(!0);
|
|
1541
1541
|
}
|
|
1542
1542
|
};
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
],
|
|
1548
|
-
var
|
|
1549
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1543
|
+
ke = ln([
|
|
1544
|
+
Be(2, we),
|
|
1545
|
+
Be(3, W),
|
|
1546
|
+
Be(4, E(Et))
|
|
1547
|
+
], ke);
|
|
1548
|
+
var cn = Object.defineProperty, un = Object.getOwnPropertyDescriptor, hn = (t, e, r, n) => {
|
|
1549
|
+
for (var i = n > 1 ? void 0 : n ? un(e, r) : e, l = t.length - 1, s; l >= 0; l--)
|
|
1550
1550
|
(s = t[l]) && (i = (n ? s(e, r, i) : s(i)) || i);
|
|
1551
|
-
return n && i &&
|
|
1551
|
+
return n && i && cn(e, r, i), i;
|
|
1552
1552
|
}, Y = (t, e) => (r, n) => e(r, n, t);
|
|
1553
|
-
const
|
|
1554
|
-
let
|
|
1553
|
+
const pn = 1e3, mn = 5e3;
|
|
1554
|
+
let Ge = class extends Tt {
|
|
1555
1555
|
constructor(e, r, n, i, l, s, o, a) {
|
|
1556
1556
|
super();
|
|
1557
1557
|
_(this, "_filterRangeShape", null);
|
|
@@ -1564,7 +1564,7 @@ let ke = class extends Et {
|
|
|
1564
1564
|
}
|
|
1565
1565
|
_initRenderer() {
|
|
1566
1566
|
this._sheetSkeletonManagerService.currentSkeleton$.pipe(
|
|
1567
|
-
|
|
1567
|
+
ze((e) => {
|
|
1568
1568
|
var o, a;
|
|
1569
1569
|
if (!e) return _e(null);
|
|
1570
1570
|
const { unit: r, unitId: n } = this._context, i = ((o = r.getActiveSheet()) == null ? void 0 : o.getSheetId()) || "", l = (a = this._sheetsFilterService.getFilterModel(n, i)) != null ? a : void 0, s = () => ({
|
|
@@ -1574,28 +1574,28 @@ let ke = class extends Et {
|
|
|
1574
1574
|
range: l == null ? void 0 : l.getRange(),
|
|
1575
1575
|
skeleton: e.skeleton
|
|
1576
1576
|
});
|
|
1577
|
-
return
|
|
1578
|
-
|
|
1577
|
+
return zt(this._commandService.onCommandExecuted.bind(this._commandService)).pipe(
|
|
1578
|
+
Qr(
|
|
1579
1579
|
([c]) => {
|
|
1580
1580
|
var h;
|
|
1581
|
-
return c.type ===
|
|
1581
|
+
return c.type === $e.MUTATION && ((h = c.params) == null ? void 0 : h.unitId) === r.getUnitId() && (nr.has(c.id) || c.id === _r.id);
|
|
1582
1582
|
}
|
|
1583
1583
|
),
|
|
1584
|
-
|
|
1584
|
+
Rt(20, void 0, { leading: !1, trailing: !0 }),
|
|
1585
1585
|
se(s),
|
|
1586
|
-
|
|
1586
|
+
yt(s())
|
|
1587
1587
|
// must trigger once
|
|
1588
1588
|
);
|
|
1589
1589
|
}),
|
|
1590
|
-
|
|
1590
|
+
kr(this.dispose$)
|
|
1591
1591
|
).subscribe((e) => {
|
|
1592
1592
|
this._disposeRendering(), !(!e || !e.range) && (this._renderRange(e.range, e.skeleton), this._renderButtons(e));
|
|
1593
1593
|
});
|
|
1594
1594
|
}
|
|
1595
1595
|
_renderRange(e, r) {
|
|
1596
|
-
const { scene: n } = this._context, { rowHeaderWidth: i, columnHeaderHeight: l } = r, s = this._filterRangeShape = new
|
|
1596
|
+
const { scene: n } = this._context, { rowHeaderWidth: i, columnHeaderHeight: l } = r, s = this._filterRangeShape = new Or(
|
|
1597
1597
|
n,
|
|
1598
|
-
|
|
1598
|
+
pn,
|
|
1599
1599
|
this._themeService,
|
|
1600
1600
|
{
|
|
1601
1601
|
rowHeaderWidth: i,
|
|
@@ -1603,7 +1603,7 @@ let ke = class extends Et {
|
|
|
1603
1603
|
enableAutoFill: !1,
|
|
1604
1604
|
highlightHeader: !1
|
|
1605
1605
|
}
|
|
1606
|
-
), a =
|
|
1606
|
+
), a = Ir({
|
|
1607
1607
|
range: e,
|
|
1608
1608
|
primary: null,
|
|
1609
1609
|
style: { fill: "rgba(0, 0, 0, 0.0)" }
|
|
@@ -1615,7 +1615,7 @@ let ke = class extends Et {
|
|
|
1615
1615
|
this._interceptCellContent(i, s, e.range);
|
|
1616
1616
|
const { startColumn: a, endColumn: c, startRow: h } = r;
|
|
1617
1617
|
for (let p = a; p <= c; p++) {
|
|
1618
|
-
const S = `sheets-filter-button-${p}`, f =
|
|
1618
|
+
const S = `sheets-filter-button-${p}`, f = Rr(h, p, o, l), { startX: T, startY: g, endX: P, endY: F } = f, R = P - T, I = F - g;
|
|
1619
1619
|
if (I <= Ee || R <= Ee)
|
|
1620
1620
|
continue;
|
|
1621
1621
|
const M = !!n.getFilterColumn(p), $ = P - H - Ee, ve = F - H - Ee, Se = {
|
|
@@ -1623,19 +1623,19 @@ let ke = class extends Et {
|
|
|
1623
1623
|
top: ve,
|
|
1624
1624
|
height: H,
|
|
1625
1625
|
width: H,
|
|
1626
|
-
zIndex:
|
|
1626
|
+
zIndex: mn,
|
|
1627
1627
|
cellHeight: I,
|
|
1628
1628
|
cellWidth: R,
|
|
1629
1629
|
filterParams: { unitId: i, subUnitId: s, col: p, hasCriteria: M }
|
|
1630
|
-
}, y = this._injector.createInstance(
|
|
1630
|
+
}, y = this._injector.createInstance(ke, S, Se);
|
|
1631
1631
|
this._filterButtonShapes.push(y);
|
|
1632
1632
|
}
|
|
1633
1633
|
o.addObjects(this._filterButtonShapes), o.makeDirty();
|
|
1634
1634
|
}
|
|
1635
1635
|
_interceptCellContent(e, r, n) {
|
|
1636
1636
|
const { startRow: i, startColumn: l, endColumn: s } = n;
|
|
1637
|
-
this._buttonRenderDisposable = this._sheetInterceptorService.intercept(
|
|
1638
|
-
effect:
|
|
1637
|
+
this._buttonRenderDisposable = this._sheetInterceptorService.intercept(vr.CELL_CONTENT, {
|
|
1638
|
+
effect: er.Style,
|
|
1639
1639
|
handler: (o, a, c) => {
|
|
1640
1640
|
const { row: h, col: p, unitId: S, subUnitId: f } = a;
|
|
1641
1641
|
return S !== e || f !== r || h !== i || p < l || p > s ? c(o) : c({
|
|
@@ -1654,44 +1654,44 @@ let ke = class extends Et {
|
|
|
1654
1654
|
(e = this._filterRangeShape) == null || e.dispose(), this._filterButtonShapes.forEach((n) => n.dispose()), (r = this._buttonRenderDisposable) == null || r.dispose(), this._filterRangeShape = null, this._buttonRenderDisposable = null, this._filterButtonShapes = [];
|
|
1655
1655
|
}
|
|
1656
1656
|
};
|
|
1657
|
-
|
|
1657
|
+
Ge = hn([
|
|
1658
1658
|
Y(1, E(X)),
|
|
1659
|
-
Y(2, E(
|
|
1659
|
+
Y(2, E(Nr)),
|
|
1660
1660
|
Y(3, E(Q)),
|
|
1661
|
-
Y(4, E(
|
|
1662
|
-
Y(5, E(
|
|
1661
|
+
Y(4, E(Et)),
|
|
1662
|
+
Y(5, E(fr)),
|
|
1663
1663
|
Y(6, W),
|
|
1664
|
-
Y(7,
|
|
1665
|
-
],
|
|
1666
|
-
var
|
|
1667
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1664
|
+
Y(7, Pr)
|
|
1665
|
+
], Ge);
|
|
1666
|
+
var dn = Object.defineProperty, fn = Object.getOwnPropertyDescriptor, _n = (t, e, r, n) => {
|
|
1667
|
+
for (var i = n > 1 ? void 0 : n ? fn(e, r) : e, l = t.length - 1, s; l >= 0; l--)
|
|
1668
1668
|
(s = t[l]) && (i = (n ? s(e, r, i) : s(i)) || i);
|
|
1669
|
-
return n && i &&
|
|
1670
|
-
},
|
|
1671
|
-
let me = class extends
|
|
1669
|
+
return n && i && dn(e, r, i), i;
|
|
1670
|
+
}, mt = (t, e) => (r, n) => e(r, n, t);
|
|
1671
|
+
let me = class extends Tt {
|
|
1672
1672
|
constructor(t, e) {
|
|
1673
1673
|
super(), this._renderManagerService = t, this._sheetsRenderService = e, [
|
|
1674
|
-
nr,
|
|
1675
1674
|
ir,
|
|
1676
1675
|
or,
|
|
1677
|
-
ar
|
|
1676
|
+
ar,
|
|
1677
|
+
lr
|
|
1678
1678
|
].forEach((r) => this.disposeWithMe(this._sheetsRenderService.registerSkeletonChangingMutations(r.id))), this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
1679
1679
|
Z.UNIVER_SHEET,
|
|
1680
|
-
[
|
|
1680
|
+
[Ge]
|
|
1681
1681
|
));
|
|
1682
1682
|
}
|
|
1683
1683
|
};
|
|
1684
|
-
me =
|
|
1685
|
-
|
|
1686
|
-
|
|
1684
|
+
me = _n([
|
|
1685
|
+
mt(0, bt),
|
|
1686
|
+
mt(1, E(It))
|
|
1687
1687
|
], me);
|
|
1688
|
-
var
|
|
1689
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1688
|
+
var vn = Object.defineProperty, Sn = Object.getOwnPropertyDescriptor, gn = (t, e, r, n) => {
|
|
1689
|
+
for (var i = n > 1 ? void 0 : n ? Sn(e, r) : e, l = t.length - 1, s; l >= 0; l--)
|
|
1690
1690
|
(s = t[l]) && (i = (n ? s(e, r, i) : s(i)) || i);
|
|
1691
|
-
return n && i &&
|
|
1691
|
+
return n && i && vn(e, r, i), i;
|
|
1692
1692
|
}, A = (t, e) => (r, n) => e(r, n, t);
|
|
1693
|
-
const
|
|
1694
|
-
let
|
|
1693
|
+
const dt = "FILTER_PANEL_POPUP";
|
|
1694
|
+
let be = class extends me {
|
|
1695
1695
|
constructor(e, r, n, i, l, s, o, a, c, h, p, S, f) {
|
|
1696
1696
|
super(f, S);
|
|
1697
1697
|
_(this, "_popupDisposable");
|
|
@@ -1702,7 +1702,7 @@ let Ae = class extends me {
|
|
|
1702
1702
|
}
|
|
1703
1703
|
_initShortcuts() {
|
|
1704
1704
|
[
|
|
1705
|
-
|
|
1705
|
+
sn
|
|
1706
1706
|
].forEach((e) => {
|
|
1707
1707
|
this.disposeWithMe(this._shortcutService.registerShortcut(e));
|
|
1708
1708
|
});
|
|
@@ -1710,27 +1710,27 @@ let Ae = class extends me {
|
|
|
1710
1710
|
_initCommands() {
|
|
1711
1711
|
[
|
|
1712
1712
|
fe,
|
|
1713
|
-
lr,
|
|
1714
1713
|
cr,
|
|
1714
|
+
ur,
|
|
1715
1715
|
re,
|
|
1716
|
-
qe,
|
|
1717
1716
|
Ke,
|
|
1718
|
-
|
|
1719
|
-
|
|
1717
|
+
Xe,
|
|
1718
|
+
Dt,
|
|
1719
|
+
Ae,
|
|
1720
1720
|
pe
|
|
1721
1721
|
].forEach((e) => {
|
|
1722
1722
|
this.disposeWithMe(this._commandService.registerCommand(e));
|
|
1723
1723
|
});
|
|
1724
1724
|
}
|
|
1725
1725
|
_initMenuItems() {
|
|
1726
|
-
this._menuManagerService.mergeMenu(
|
|
1726
|
+
this._menuManagerService.mergeMenu(rn);
|
|
1727
1727
|
}
|
|
1728
1728
|
_initUI() {
|
|
1729
|
-
this.disposeWithMe(this._componentManager.register(
|
|
1729
|
+
this.disposeWithMe(this._componentManager.register(dt, Zs)), this.disposeWithMe(this._componentManager.register("FilterSingle", Vt)), this.disposeWithMe(this._contextService.subscribeContextValue$(ne).pipe(Gr()).subscribe((e) => {
|
|
1730
1730
|
e ? this._openFilterPopup() : this._closeFilterPopup();
|
|
1731
1731
|
})), this.disposeWithMe(this._sheetsFilterService.errorMsg$.subscribe((e) => {
|
|
1732
1732
|
e && this._messageService.show({
|
|
1733
|
-
type:
|
|
1733
|
+
type: Zr.Error,
|
|
1734
1734
|
content: this._localeService.t(e)
|
|
1735
1735
|
});
|
|
1736
1736
|
}));
|
|
@@ -1741,7 +1741,7 @@ let Ae = class extends me {
|
|
|
1741
1741
|
throw new Error("[SheetsFilterUIController]: no filter model when opening filter popup!");
|
|
1742
1742
|
const r = e.getRange(), n = this._sheetsFilterPanelService.col, { startRow: i } = r;
|
|
1743
1743
|
this._popupDisposable = this._sheetCanvasPopupService.attachPopupToCell(i, n, {
|
|
1744
|
-
componentKey:
|
|
1744
|
+
componentKey: dt,
|
|
1745
1745
|
direction: "horizontal",
|
|
1746
1746
|
onClickOutside: () => this._commandService.syncExecuteCommand(pe.id),
|
|
1747
1747
|
offset: [5, 0]
|
|
@@ -1752,41 +1752,45 @@ let Ae = class extends me {
|
|
|
1752
1752
|
(e = this._popupDisposable) == null || e.dispose(), this._popupDisposable = null;
|
|
1753
1753
|
}
|
|
1754
1754
|
};
|
|
1755
|
-
|
|
1755
|
+
be = gn([
|
|
1756
1756
|
A(0, E(X)),
|
|
1757
|
-
A(1, E(
|
|
1757
|
+
A(1, E(wr)),
|
|
1758
1758
|
A(2, E(j)),
|
|
1759
|
-
A(3, E(
|
|
1759
|
+
A(3, E(yr)),
|
|
1760
1760
|
A(4, E(Q)),
|
|
1761
1761
|
A(5, E(K)),
|
|
1762
|
-
A(6,
|
|
1762
|
+
A(6, Ur),
|
|
1763
1763
|
A(7, W),
|
|
1764
|
-
A(8,
|
|
1765
|
-
A(9,
|
|
1766
|
-
A(10,
|
|
1767
|
-
A(11, E(
|
|
1768
|
-
A(12,
|
|
1769
|
-
],
|
|
1770
|
-
var
|
|
1771
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1764
|
+
A(8, Hr),
|
|
1765
|
+
A(9, we),
|
|
1766
|
+
A(10, Dr),
|
|
1767
|
+
A(11, E(It)),
|
|
1768
|
+
A(12, bt)
|
|
1769
|
+
], be);
|
|
1770
|
+
var jt = Object.defineProperty, En = Object.getOwnPropertyDescriptor, Tn = (t, e, r) => e in t ? jt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Fn = (t, e, r, n) => {
|
|
1771
|
+
for (var i = n > 1 ? void 0 : n ? En(e, r) : e, l = t.length - 1, s; l >= 0; l--)
|
|
1772
1772
|
(s = t[l]) && (i = (n ? s(e, r, i) : s(i)) || i);
|
|
1773
|
-
return n && i &&
|
|
1774
|
-
},
|
|
1775
|
-
const
|
|
1776
|
-
let
|
|
1777
|
-
constructor(t =
|
|
1773
|
+
return n && i && jt(e, r, i), i;
|
|
1774
|
+
}, Ve = (t, e) => (r, n) => e(r, n, t), Wt = (t, e, r) => Tn(t, typeof e != "symbol" ? e + "" : e, r);
|
|
1775
|
+
const Cn = "SHEET_FILTER_UI_PLUGIN";
|
|
1776
|
+
let Le = class extends qe {
|
|
1777
|
+
constructor(t = Ne, e, r, n) {
|
|
1778
1778
|
super(), this._config = t, this._injector = e, this._configService = r, this._rpcChannelService = n;
|
|
1779
|
-
const { menu: i, ...l } =
|
|
1780
|
-
|
|
1779
|
+
const { menu: i, ...l } = Ct(
|
|
1780
|
+
{},
|
|
1781
|
+
Ne,
|
|
1782
|
+
this._config
|
|
1783
|
+
);
|
|
1784
|
+
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig($t, l);
|
|
1781
1785
|
}
|
|
1782
1786
|
onStarting() {
|
|
1783
1787
|
[
|
|
1784
1788
|
[j],
|
|
1785
1789
|
[ie],
|
|
1786
|
-
[
|
|
1787
|
-
].forEach((t) => this._injector.add(t)), this._config.useRemoteFilterValuesGenerator && this._rpcChannelService && this._injector.add([
|
|
1788
|
-
useFactory: () =>
|
|
1789
|
-
this._rpcChannelService.requestChannel(
|
|
1790
|
+
[be]
|
|
1791
|
+
].forEach((t) => this._injector.add(t)), this._config.useRemoteFilterValuesGenerator && this._rpcChannelService && this._injector.add([Pe, {
|
|
1792
|
+
useFactory: () => rr(
|
|
1793
|
+
this._rpcChannelService.requestChannel(tt)
|
|
1790
1794
|
)
|
|
1791
1795
|
}]);
|
|
1792
1796
|
}
|
|
@@ -1794,28 +1798,32 @@ let be = class extends Ye {
|
|
|
1794
1798
|
this._injector.get(ie);
|
|
1795
1799
|
}
|
|
1796
1800
|
onRendered() {
|
|
1797
|
-
this._injector.get(
|
|
1801
|
+
this._injector.get(be);
|
|
1798
1802
|
}
|
|
1799
1803
|
};
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
],
|
|
1808
|
-
var
|
|
1809
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1804
|
+
Wt(Le, "type", Z.UNIVER_SHEET);
|
|
1805
|
+
Wt(Le, "pluginName", Cn);
|
|
1806
|
+
Le = Fn([
|
|
1807
|
+
Ft(Ot),
|
|
1808
|
+
Ve(1, E(X)),
|
|
1809
|
+
Ve(2, Nt),
|
|
1810
|
+
Ve(3, tr(Pt))
|
|
1811
|
+
], Le);
|
|
1812
|
+
var Qt = Object.defineProperty, Nn = Object.getOwnPropertyDescriptor, Pn = (t, e, r) => e in t ? Qt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, On = (t, e, r, n) => {
|
|
1813
|
+
for (var i = n > 1 ? void 0 : n ? Nn(e, r) : e, l = t.length - 1, s; l >= 0; l--)
|
|
1810
1814
|
(s = t[l]) && (i = (n ? s(e, r, i) : s(i)) || i);
|
|
1811
|
-
return n && i &&
|
|
1812
|
-
},
|
|
1813
|
-
const
|
|
1814
|
-
let
|
|
1815
|
-
constructor(t =
|
|
1815
|
+
return n && i && Qt(e, r, i), i;
|
|
1816
|
+
}, ft = (t, e) => (r, n) => e(r, n, t), kt = (t, e, r) => Pn(t, typeof e != "symbol" ? e + "" : e, r);
|
|
1817
|
+
const In = "SHEET_FILTER_UI_PLUGIN";
|
|
1818
|
+
let Me = class extends qe {
|
|
1819
|
+
constructor(t = Ne, e, r) {
|
|
1816
1820
|
super(), this._config = t, this._injector = e, this._configService = r;
|
|
1817
|
-
const { menu: n, ...i } =
|
|
1818
|
-
|
|
1821
|
+
const { menu: n, ...i } = Ct(
|
|
1822
|
+
{},
|
|
1823
|
+
Ne,
|
|
1824
|
+
this._config
|
|
1825
|
+
);
|
|
1826
|
+
n && this._configService.setConfig("menu", n, { merge: !0 }), this._configService.setConfig($t, i);
|
|
1819
1827
|
}
|
|
1820
1828
|
onStarting() {
|
|
1821
1829
|
[
|
|
@@ -1830,43 +1838,43 @@ let Le = class extends Ye {
|
|
|
1830
1838
|
this._injector.get(me);
|
|
1831
1839
|
}
|
|
1832
1840
|
};
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
],
|
|
1840
|
-
var
|
|
1841
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1841
|
+
kt(Me, "type", Z.UNIVER_SHEET);
|
|
1842
|
+
kt(Me, "pluginName", In);
|
|
1843
|
+
Me = On([
|
|
1844
|
+
Ft(Ot),
|
|
1845
|
+
ft(1, E(X)),
|
|
1846
|
+
ft(2, Nt)
|
|
1847
|
+
], Me);
|
|
1848
|
+
var Rn = Object.defineProperty, yn = Object.getOwnPropertyDescriptor, An = (t, e, r, n) => {
|
|
1849
|
+
for (var i = n > 1 ? void 0 : n ? yn(e, r) : e, l = t.length - 1, s; l >= 0; l--)
|
|
1842
1850
|
(s = t[l]) && (i = (n ? s(e, r, i) : s(i)) || i);
|
|
1843
|
-
return n && i &&
|
|
1844
|
-
},
|
|
1845
|
-
let
|
|
1851
|
+
return n && i && Rn(e, r, i), i;
|
|
1852
|
+
}, _t = (t, e) => (r, n) => e(r, n, t), Te;
|
|
1853
|
+
let vt = (Te = class extends qe {
|
|
1846
1854
|
constructor(t, e, r) {
|
|
1847
1855
|
super(), this._config = t, this._injector = e, this._rpcChannelService = r;
|
|
1848
1856
|
}
|
|
1849
1857
|
onStarting() {
|
|
1850
1858
|
[
|
|
1851
|
-
[
|
|
1859
|
+
[Pe, { useClass: We }]
|
|
1852
1860
|
].forEach((t) => this._injector.add(t));
|
|
1853
1861
|
}
|
|
1854
1862
|
onReady() {
|
|
1855
1863
|
this._rpcChannelService.registerChannel(
|
|
1856
|
-
|
|
1857
|
-
|
|
1864
|
+
tt,
|
|
1865
|
+
sr(this._injector.get(Pe))
|
|
1858
1866
|
);
|
|
1859
1867
|
}
|
|
1860
1868
|
}, _(Te, "type", Z.UNIVER_SHEET), _(Te, "pluginName", "SHEET_FILTER_UI_WORKER_PLUGIN"), Te);
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
],
|
|
1869
|
+
vt = An([
|
|
1870
|
+
_t(1, E(X)),
|
|
1871
|
+
_t(2, Pt)
|
|
1872
|
+
], vt);
|
|
1865
1873
|
export {
|
|
1866
|
-
|
|
1874
|
+
Dt as ChangeFilterByOperation,
|
|
1867
1875
|
pe as CloseFilterPanelOperation,
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1876
|
+
Ae as OpenFilterPanelOperation,
|
|
1877
|
+
Me as UniverSheetsFilterMobileUIPlugin,
|
|
1878
|
+
Le as UniverSheetsFilterUIPlugin,
|
|
1879
|
+
vt as UniverSheetsFilterUIWorkerPlugin
|
|
1872
1880
|
};
|