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