@univerjs/sheets-filter-ui 0.7.0-beta.0 → 0.7.0-beta.1
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 +5 -5
- package/lib/es/index.js +68 -75
- package/lib/index.css +1 -1
- package/lib/index.js +68 -75
- package/lib/types/views/widgets/filter-button.shape.d.ts +1 -1
- package/lib/umd/index.js +4 -4
- package/package.json +14 -15
package/lib/es/index.js
CHANGED
|
@@ -2,23 +2,23 @@ var Gt = Object.defineProperty;
|
|
|
2
2
|
var jt = (t, e, r) => e in t ? Gt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
3
|
var f = (t, e, r) => jt(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
4
|
import { BooleanNumber as rt, createIdentifier as _t, Inject as E, LocaleService as K, IUniverInstanceService as Ge, ILogService as Yt, extractPureTextFromCell as qt, numfmt as it, Disposable as me, Injector as X, Quantity as vt, Tools as Te, ICommandService as Q, CommandType as Le, IContextService as Me, UniverInstanceType as Z, ThemeService as gt, RxDisposable as St, fromCallback as Kt, InterceptorEffectEnum as Xt, DependentOn as Et, IConfigService as Tt, Optional as Zt, Plugin as je, merge as Nt } from "@univerjs/core";
|
|
5
|
-
import { IRPCChannelService as
|
|
6
|
-
import { CustomFilterOperator as u, SetSheetsFilterCriteriaCommand as re, SheetsFilterService as V, SmartToggleSheetsFilterCommand as pe, ReCalcSheetsFilterCommand as Ye, ClearSheetsFilterCriteriaCommand as qe, FILTER_MUTATIONS as er, SetSheetsFilterRangeMutation as tr, SetSheetsFilterCriteriaMutation as rr, RemoveSheetsFilterMutation as ir, ReCalcSheetsFilterMutation as sr, RemoveSheetFilterCommand as nr, SetSheetFilterRangeCommand as or, UniverSheetsFilterPlugin as
|
|
5
|
+
import { IRPCChannelService as Ft, toModule as zt, fromModule as Jt } from "@univerjs/rpc";
|
|
6
|
+
import { CustomFilterOperator as u, SetSheetsFilterCriteriaCommand as re, SheetsFilterService as V, SmartToggleSheetsFilterCommand as pe, ReCalcSheetsFilterCommand as Ye, ClearSheetsFilterCriteriaCommand as qe, FILTER_MUTATIONS as er, SetSheetsFilterRangeMutation as tr, SetSheetsFilterCriteriaMutation as rr, RemoveSheetsFilterMutation as ir, ReCalcSheetsFilterMutation as sr, RemoveSheetFilterCommand as nr, SetSheetFilterRangeCommand as or, UniverSheetsFilterPlugin as Ct } from "@univerjs/sheets-filter";
|
|
7
7
|
import { RefRangeService as ar, SheetPermissionCheckController as lr, SheetsSelectionsService as cr, getSheetCommandTarget as ur, WorksheetFilterPermission as ae, WorksheetViewPermission as le, RangeProtectionPermissionViewPoint as ce, expandToContinuousRange as hr, SheetInterceptorService as dr, SetRangeValuesMutation as mr, INTERCEPTOR_POINT as pr } from "@univerjs/sheets";
|
|
8
|
-
import { ILayoutService as fr, useDependency as te, useObservable as B, useComponentsOfPart as _r, ComponentContainer as vr, getMenuHiddenObservable as Ke, MenuItemType as Xe, RibbonStartGroup as gr, KeyCode as Sr, MetaKeys as st, ComponentManager as Er, IShortcutService as Tr, IMenuManagerService as Nr, IMessageService as
|
|
9
|
-
import { SetCellEditVisibleOperation as
|
|
8
|
+
import { ILayoutService as fr, useDependency as te, useObservable as B, useComponentsOfPart as _r, ComponentContainer as vr, getMenuHiddenObservable as Ke, MenuItemType as Xe, RibbonStartGroup as gr, KeyCode as Sr, MetaKeys as st, ComponentManager as Er, IShortcutService as Tr, IMenuManagerService as Nr, IMessageService as Fr } from "@univerjs/ui";
|
|
9
|
+
import { SetCellEditVisibleOperation as Cr, SheetsUIPart as yr, getObservableWithExclusiveRange$ as Or, getCurrentRangeDisable$ as Rr, SheetSkeletonManagerService as Ir, ISheetSelectionRenderService as Ar, SelectionControl as Pr, attachSelectionWithCoord as br, getCoordByCell as Lr, SheetsRenderService as yt, whenSheetEditorFocused as Mr, SheetCanvasPopManagerService as wr } from "@univerjs/sheets-ui";
|
|
10
10
|
import { BehaviorSubject as q, ReplaySubject as $r, Subject as Ur, merge as Hr, combineLatest as Dr, throttleTime as Ot, startWith as Rt, map as ie, shareReplay as kr, of as fe, switchMap as Ze, filter as xr, takeUntil as Br, distinctUntilChanged as Wr } from "rxjs";
|
|
11
11
|
import { Select as nt, RadioGroup as Qr, Radio as ot, Input as It, Checkbox as Vr, Tree as Gr, Segmented as jr, Button as Ue, MessageType as Yr } from "@univerjs/design";
|
|
12
12
|
import { Rect as at, Shape as qr, IRenderManagerService as At } from "@univerjs/engine-render";
|
|
13
13
|
import { jsx as S, jsxs as b, Fragment as lt } from "react/jsx-runtime";
|
|
14
14
|
import { forwardRef as Pt, useRef as Kr, createElement as bt, useCallback as D, useMemo as ze } from "react";
|
|
15
15
|
const Lt = "sheets-filter-ui.config", Ne = {};
|
|
16
|
-
var
|
|
16
|
+
var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SECOND", t))(F || {}), _ = /* @__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))(_ || {}), d;
|
|
17
17
|
((t) => {
|
|
18
18
|
t.NONE = {
|
|
19
19
|
label: "sheets-filter.conditions.none",
|
|
20
20
|
operator: _.NONE,
|
|
21
|
-
order:
|
|
21
|
+
order: F.SECOND,
|
|
22
22
|
numOfParameters: 0,
|
|
23
23
|
getDefaultFormParams: () => {
|
|
24
24
|
throw new Error("[FilterConditionItems.NONE]: should not have initial form params!");
|
|
@@ -29,7 +29,7 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
29
29
|
}, t.EMPTY = {
|
|
30
30
|
label: "sheets-filter.conditions.empty",
|
|
31
31
|
operator: _.EMPTY,
|
|
32
|
-
order:
|
|
32
|
+
order: F.SECOND,
|
|
33
33
|
numOfParameters: 0,
|
|
34
34
|
getDefaultFormParams: () => {
|
|
35
35
|
throw new Error("[FilterConditionItems.EMPTY]: should not have initial form params!");
|
|
@@ -46,7 +46,7 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
46
46
|
}, t.NOT_EMPTY = {
|
|
47
47
|
label: "sheets-filter.conditions.not-empty",
|
|
48
48
|
operator: _.NOT_EMPTY,
|
|
49
|
-
order:
|
|
49
|
+
order: F.SECOND,
|
|
50
50
|
numOfParameters: 0,
|
|
51
51
|
getDefaultFormParams: () => {
|
|
52
52
|
throw new Error("[FilterConditionItems.NOT_EMPTY]: should not have initial form params!");
|
|
@@ -63,7 +63,7 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
63
63
|
}, t.TEXT_CONTAINS = {
|
|
64
64
|
label: "sheets-filter.conditions.text-contains",
|
|
65
65
|
operator: _.CONTAINS,
|
|
66
|
-
order:
|
|
66
|
+
order: F.FIRST,
|
|
67
67
|
numOfParameters: 1,
|
|
68
68
|
getDefaultFormParams: () => ({ operator1: _.CONTAINS, val1: "" }),
|
|
69
69
|
testMappingParams: (i) => {
|
|
@@ -86,7 +86,7 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
86
86
|
}, t.DOES_NOT_CONTAIN = {
|
|
87
87
|
label: "sheets-filter.conditions.does-not-contain",
|
|
88
88
|
operator: _.DOES_NOT_CONTAIN,
|
|
89
|
-
order:
|
|
89
|
+
order: F.FIRST,
|
|
90
90
|
numOfParameters: 1,
|
|
91
91
|
getDefaultFormParams: () => ({ operator1: _.DOES_NOT_CONTAIN, val1: "" }),
|
|
92
92
|
mapToFilterColumn: (i) => ({
|
|
@@ -106,7 +106,7 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
106
106
|
}, t.STARTS_WITH = {
|
|
107
107
|
label: "sheets-filter.conditions.starts-with",
|
|
108
108
|
operator: _.STARTS_WITH,
|
|
109
|
-
order:
|
|
109
|
+
order: F.FIRST,
|
|
110
110
|
numOfParameters: 1,
|
|
111
111
|
getDefaultFormParams: () => ({ operator1: _.STARTS_WITH, val1: "" }),
|
|
112
112
|
mapToFilterColumn: (i) => ({
|
|
@@ -126,7 +126,7 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
126
126
|
}, t.ENDS_WITH = {
|
|
127
127
|
label: "sheets-filter.conditions.ends-with",
|
|
128
128
|
operator: _.ENDS_WITH,
|
|
129
|
-
order:
|
|
129
|
+
order: F.FIRST,
|
|
130
130
|
numOfParameters: 1,
|
|
131
131
|
getDefaultFormParams: () => ({ operator1: _.ENDS_WITH, val1: "" }),
|
|
132
132
|
mapToFilterColumn: (i) => ({
|
|
@@ -146,7 +146,7 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
146
146
|
}, t.EQUALS = {
|
|
147
147
|
label: "sheets-filter.conditions.equals",
|
|
148
148
|
operator: _.EQUALS,
|
|
149
|
-
order:
|
|
149
|
+
order: F.FIRST,
|
|
150
150
|
numOfParameters: 1,
|
|
151
151
|
getDefaultFormParams: () => ({ operator1: _.EQUALS, val1: "" }),
|
|
152
152
|
testMappingParams: (i) => {
|
|
@@ -167,7 +167,7 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
167
167
|
label: "sheets-filter.conditions.greater-than",
|
|
168
168
|
operator: u.GREATER_THAN,
|
|
169
169
|
numOfParameters: 1,
|
|
170
|
-
order:
|
|
170
|
+
order: F.FIRST,
|
|
171
171
|
getDefaultFormParams: () => ({ operator1: u.GREATER_THAN, val1: "" }),
|
|
172
172
|
mapToFilterColumn: (i) => ({
|
|
173
173
|
customFilters: { customFilters: [{ val: i.val1, operator: u.GREATER_THAN }] }
|
|
@@ -187,7 +187,7 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
187
187
|
label: "sheets-filter.conditions.greater-than-or-equal",
|
|
188
188
|
operator: u.GREATER_THAN_OR_EQUAL,
|
|
189
189
|
numOfParameters: 1,
|
|
190
|
-
order:
|
|
190
|
+
order: F.FIRST,
|
|
191
191
|
getDefaultFormParams: () => ({ operator1: u.GREATER_THAN_OR_EQUAL, val1: "" }),
|
|
192
192
|
testMappingParams: (i) => {
|
|
193
193
|
const [o] = L(i);
|
|
@@ -207,7 +207,7 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
207
207
|
label: "sheets-filter.conditions.less-than",
|
|
208
208
|
operator: u.LESS_THAN,
|
|
209
209
|
numOfParameters: 1,
|
|
210
|
-
order:
|
|
210
|
+
order: F.FIRST,
|
|
211
211
|
getDefaultFormParams: () => ({ operator1: u.LESS_THAN, val1: "" }),
|
|
212
212
|
testMappingParams: (i) => {
|
|
213
213
|
const [o] = L(i);
|
|
@@ -227,7 +227,7 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
227
227
|
label: "sheets-filter.conditions.less-than-or-equal",
|
|
228
228
|
operator: u.LESS_THAN_OR_EQUAL,
|
|
229
229
|
numOfParameters: 1,
|
|
230
|
-
order:
|
|
230
|
+
order: F.FIRST,
|
|
231
231
|
getDefaultFormParams: () => ({ operator1: u.LESS_THAN_OR_EQUAL, val1: "" }),
|
|
232
232
|
testMappingParams: (i) => {
|
|
233
233
|
const [o] = L(i);
|
|
@@ -247,7 +247,7 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
247
247
|
label: "sheets-filter.conditions.equal",
|
|
248
248
|
operator: u.EQUAL,
|
|
249
249
|
numOfParameters: 1,
|
|
250
|
-
order:
|
|
250
|
+
order: F.FIRST,
|
|
251
251
|
getDefaultFormParams: () => ({ operator1: u.EQUAL, val1: "" }),
|
|
252
252
|
testMappingParams: (i) => {
|
|
253
253
|
const [o] = L(i);
|
|
@@ -267,7 +267,7 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
267
267
|
label: "sheets-filter.conditions.not-equal",
|
|
268
268
|
operator: u.NOT_EQUALS,
|
|
269
269
|
numOfParameters: 1,
|
|
270
|
-
order:
|
|
270
|
+
order: F.FIRST,
|
|
271
271
|
getDefaultFormParams: () => ({ operator1: u.NOT_EQUALS, val1: "" }),
|
|
272
272
|
testMappingParams: (i) => {
|
|
273
273
|
const [o] = L(i);
|
|
@@ -286,7 +286,7 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
286
286
|
}, t.BETWEEN = {
|
|
287
287
|
label: "sheets-filter.conditions.between",
|
|
288
288
|
operator: _.BETWEEN,
|
|
289
|
-
order:
|
|
289
|
+
order: F.SECOND,
|
|
290
290
|
numOfParameters: 2,
|
|
291
291
|
getDefaultFormParams: () => ({
|
|
292
292
|
and: !0,
|
|
@@ -335,7 +335,7 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
335
335
|
}, t.NOT_BETWEEN = {
|
|
336
336
|
label: "sheets-filter.conditions.not-between",
|
|
337
337
|
operator: _.NOT_BETWEEN,
|
|
338
|
-
order:
|
|
338
|
+
order: F.SECOND,
|
|
339
339
|
numOfParameters: 2,
|
|
340
340
|
getDefaultFormParams: () => ({
|
|
341
341
|
operator1: u.LESS_THAN,
|
|
@@ -380,7 +380,7 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
380
380
|
}, t.CUSTOM = {
|
|
381
381
|
label: "sheets-filter.conditions.custom",
|
|
382
382
|
operator: _.CUSTOM,
|
|
383
|
-
order:
|
|
383
|
+
order: F.SECOND,
|
|
384
384
|
numOfParameters: 2,
|
|
385
385
|
getDefaultFormParams: () => ({
|
|
386
386
|
operator1: _.NONE,
|
|
@@ -403,10 +403,10 @@ var C = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
403
403
|
return g(m, c);
|
|
404
404
|
if (T)
|
|
405
405
|
return g(h, a);
|
|
406
|
-
const v = g(h, a),
|
|
406
|
+
const v = g(h, a), C = g(m, c), N = {
|
|
407
407
|
customFilters: [
|
|
408
408
|
v.customFilters.customFilters[0],
|
|
409
|
-
|
|
409
|
+
C.customFilters.customFilters[0]
|
|
410
410
|
]
|
|
411
411
|
};
|
|
412
412
|
return o && (N.and = rt.TRUE), { customFilters: N };
|
|
@@ -511,7 +511,7 @@ var Xr = Object.getOwnPropertyDescriptor, Zr = (t, e, r, s) => {
|
|
|
511
511
|
(i = t[l]) && (n = i(n) || n);
|
|
512
512
|
return n;
|
|
513
513
|
}, He = (t, e) => (r, s) => e(r, s, t);
|
|
514
|
-
const Je = "sheets-filter.generate-filter-values.service",
|
|
514
|
+
const Je = "sheets-filter.generate-filter-values.service", Fe = _t(Je), zr = ["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"];
|
|
515
515
|
let Be = class extends me {
|
|
516
516
|
constructor(t, e, r) {
|
|
517
517
|
super(), this._localeService = t, this._univerInstanceService = e, this._logService = r;
|
|
@@ -528,7 +528,7 @@ Be = Zr([
|
|
|
528
528
|
He(2, Yt)
|
|
529
529
|
], Be);
|
|
530
530
|
function Mt(t, e, r, s, n, l, i, o) {
|
|
531
|
-
var v,
|
|
531
|
+
var v, C, N, R, O, M, w, _e, ve;
|
|
532
532
|
const a = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), h = "yyyy-mm-dd", m = new Set(zr), g = "empty";
|
|
533
533
|
let p = 0;
|
|
534
534
|
for (const I of s.iterateByColumn(r, !1, !1)) {
|
|
@@ -545,7 +545,7 @@ function Mt(t, e, r, s, n, l, i, o) {
|
|
|
545
545
|
p += 1, z += tt;
|
|
546
546
|
continue;
|
|
547
547
|
}
|
|
548
|
-
const ge = (v = I.value) != null && v.v && !I.value.p ? (R = (N = o.get((
|
|
548
|
+
const ge = (v = I.value) != null && v.v && !I.value.p ? (R = (N = o.get((C = I.value) == null ? void 0 : C.s)) == null ? void 0 : N.n) == null ? void 0 : R.pattern : "", Vt = ge && it.isDate(ge);
|
|
549
549
|
if (ge && Vt && m.has(ge)) {
|
|
550
550
|
const k = (O = s.getCellRaw(I.row, I.col)) == null ? void 0 : O.v;
|
|
551
551
|
if (!k) {
|
|
@@ -669,7 +669,7 @@ var ti = Object.getOwnPropertyDescriptor, et = (t, e, r, s) => {
|
|
|
669
669
|
for (var n = s > 1 ? void 0 : s ? ti(e, r) : e, l = t.length - 1, i; l >= 0; l--)
|
|
670
670
|
(i = t[l]) && (n = i(n) || n);
|
|
671
671
|
return n;
|
|
672
|
-
},
|
|
672
|
+
}, Ce = (t, e) => (r, s) => e(r, s, t), ye = /* @__PURE__ */ ((t) => (t[t.VALUES = 0] = "VALUES", t[t.CONDITIONS = 1] = "CONDITIONS", t))(ye || {});
|
|
673
673
|
_t("sheets-filter-ui.sheets-filter-panel.service");
|
|
674
674
|
let W = class extends me {
|
|
675
675
|
constructor(e, r) {
|
|
@@ -788,8 +788,8 @@ let W = class extends me {
|
|
|
788
788
|
}
|
|
789
789
|
};
|
|
790
790
|
W = et([
|
|
791
|
-
|
|
792
|
-
|
|
791
|
+
Ce(0, E(X)),
|
|
792
|
+
Ce(1, E(ar))
|
|
793
793
|
], W);
|
|
794
794
|
let Oe = class extends me {
|
|
795
795
|
constructor(e, r, s, n, l) {
|
|
@@ -877,7 +877,7 @@ let Oe = class extends me {
|
|
|
877
877
|
}
|
|
878
878
|
};
|
|
879
879
|
Oe = et([
|
|
880
|
-
|
|
880
|
+
Ce(4, Q)
|
|
881
881
|
], Oe);
|
|
882
882
|
let Re = class extends me {
|
|
883
883
|
constructor(e, r, s, n, l) {
|
|
@@ -920,17 +920,17 @@ let Re = class extends me {
|
|
|
920
920
|
*/
|
|
921
921
|
static async fromFilterColumn(e, r, s) {
|
|
922
922
|
var M;
|
|
923
|
-
const n = e.get(Ge), l = e.get(K), i = e.get(
|
|
923
|
+
const n = e.get(Ge), l = e.get(K), i = e.get(Fe, vt.OPTIONAL), { unitId: o, subUnitId: a } = r, c = n.getUniverSheetInstance(o);
|
|
924
924
|
if (!c) throw new Error(`[ByValuesModel]: Workbook not found for filter model with unitId: ${o}!`);
|
|
925
925
|
const h = c == null ? void 0 : c.getSheetBySheetId(a);
|
|
926
926
|
if (!h) throw new Error(`[ByValuesModel]: Worksheet not found for filter model with unitId: ${o} and subUnitId: ${a}!`);
|
|
927
|
-
const m = r.getRange(), g = s, p = (M = r.getFilterColumn(s)) == null ? void 0 : M.getColumnData().filters, T = new Set(p == null ? void 0 : p.filters), v = !!(p && p.blank),
|
|
927
|
+
const m = r.getRange(), g = s, p = (M = r.getFilterColumn(s)) == null ? void 0 : M.getColumnData().filters, T = new Set(p == null ? void 0 : p.filters), v = !!(p && p.blank), C = r.getFilteredOutRowsExceptCol(s), N = { ...m, startRow: m.startRow + 1, startColumn: g, endColumn: g };
|
|
928
928
|
let R, O;
|
|
929
929
|
if (i) {
|
|
930
930
|
const w = await i.getFilterValues({
|
|
931
931
|
unitId: o,
|
|
932
932
|
subUnitId: a,
|
|
933
|
-
filteredOutRowsByOtherColumns: Array.from(
|
|
933
|
+
filteredOutRowsByOtherColumns: Array.from(C),
|
|
934
934
|
filters: !!p,
|
|
935
935
|
blankChecked: v,
|
|
936
936
|
iterateRange: N,
|
|
@@ -938,7 +938,7 @@ let Re = class extends me {
|
|
|
938
938
|
});
|
|
939
939
|
R = w.filterTreeItems, O = w.filterTreeMapCache;
|
|
940
940
|
} else {
|
|
941
|
-
const w = Mt(!!p, l, N, h,
|
|
941
|
+
const w = Mt(!!p, l, N, h, C, T, v, c.getStyles());
|
|
942
942
|
R = w.filterTreeItems, O = w.filterTreeMapCache;
|
|
943
943
|
}
|
|
944
944
|
return e.createInstance(Re, r, s, R, O);
|
|
@@ -1032,14 +1032,14 @@ let Re = class extends me {
|
|
|
1032
1032
|
// #endregion
|
|
1033
1033
|
};
|
|
1034
1034
|
Re = et([
|
|
1035
|
-
|
|
1035
|
+
Ce(4, Q)
|
|
1036
1036
|
], Re);
|
|
1037
1037
|
const se = "FILTER_PANEL_OPENED", Ie = {
|
|
1038
1038
|
id: "sheet.operation.open-filter-panel",
|
|
1039
1039
|
type: Le.OPERATION,
|
|
1040
1040
|
handler: (t, e) => {
|
|
1041
1041
|
const r = t.get(Me), s = t.get(V), n = t.get(W);
|
|
1042
|
-
t.get(Q).syncExecuteCommand(
|
|
1042
|
+
t.get(Q).syncExecuteCommand(Cr.id, { visible: !1 });
|
|
1043
1043
|
const { unitId: i, subUnitId: o, col: a } = e, c = s.getFilterModel(i, o);
|
|
1044
1044
|
return c ? (n.setupCol(c, a), r.getContextValue(se) || r.setContextValue(se, !0), !0) : !1;
|
|
1045
1045
|
}
|
|
@@ -1179,7 +1179,7 @@ function ci(t) {
|
|
|
1179
1179
|
}, [e]), c = hi(r), h = D((v) => {
|
|
1180
1180
|
e.onConditionFormChange(v);
|
|
1181
1181
|
}, [e]), m = r.t("sheets-filter.panel.input-values-placeholder");
|
|
1182
|
-
function g(v,
|
|
1182
|
+
function g(v, C, N) {
|
|
1183
1183
|
const R = d.getItemByOperator(v).numOfParameters === 1;
|
|
1184
1184
|
return /* @__PURE__ */ b(lt, { children: [
|
|
1185
1185
|
N === "operator2" && /* @__PURE__ */ b(Qr, { value: l, onChange: i, children: [
|
|
@@ -1198,7 +1198,7 @@ function ci(t) {
|
|
|
1198
1198
|
It,
|
|
1199
1199
|
{
|
|
1200
1200
|
className: "univer-mt-2",
|
|
1201
|
-
value:
|
|
1201
|
+
value: C,
|
|
1202
1202
|
placeholder: m,
|
|
1203
1203
|
onChange: (O) => h({ [N === "operator1" ? "val1" : "val2"]: O })
|
|
1204
1204
|
}
|
|
@@ -1422,8 +1422,8 @@ function di(t) {
|
|
|
1422
1422
|
onClick: () => {
|
|
1423
1423
|
const T = [];
|
|
1424
1424
|
p.children ? p.children.forEach((v) => {
|
|
1425
|
-
v.children ? v.children.forEach((
|
|
1426
|
-
T.push(
|
|
1425
|
+
v.children ? v.children.forEach((C) => {
|
|
1426
|
+
T.push(C.key);
|
|
1427
1427
|
}) : T.push(v.key);
|
|
1428
1428
|
}) : T.push(p.key), e.onFilterOnly(T);
|
|
1429
1429
|
},
|
|
@@ -1443,7 +1443,7 @@ function di(t) {
|
|
|
1443
1443
|
);
|
|
1444
1444
|
}
|
|
1445
1445
|
function mi() {
|
|
1446
|
-
var
|
|
1446
|
+
var C;
|
|
1447
1447
|
const t = te(W), e = te(K), r = te(Q), s = B(t.filterBy$, void 0, !0), n = B(t.filterByModel$, void 0, !1), l = B(() => (n == null ? void 0 : n.canApply$) || fe(!1), void 0, !1, [n]), i = pi(e), o = !B(t.hasCriteria$), a = D((N) => {
|
|
1448
1448
|
r.executeCommand(Ut.id, { filterBy: N });
|
|
1449
1449
|
}, [r]), c = D(async () => {
|
|
@@ -1452,15 +1452,15 @@ function mi() {
|
|
|
1452
1452
|
r.executeCommand(he.id);
|
|
1453
1453
|
}, [r]), m = D(async () => {
|
|
1454
1454
|
await (n == null ? void 0 : n.apply()), r.executeCommand(he.id);
|
|
1455
|
-
}, [n, r]), p = (
|
|
1455
|
+
}, [n, r]), p = (C = te(V).activeFilterModel) == null ? void 0 : C.getRange(), T = t.col, v = _r(yr.FILTER_PANEL_EMBED_POINT);
|
|
1456
1456
|
return /* @__PURE__ */ b(
|
|
1457
1457
|
"div",
|
|
1458
1458
|
{
|
|
1459
|
-
"data-u-comp
|
|
1459
|
+
"data-u-comp": "sheets-filter-panel",
|
|
1460
1460
|
className: `
|
|
1461
1461
|
univer-box-border univer-flex univer-h-[432px] univer-w-[312px] univer-flex-col univer-rounded-lg
|
|
1462
1462
|
univer-bg-white univer-p-4 univer-shadow-lg
|
|
1463
|
-
dark:univer-bg-
|
|
1463
|
+
dark:univer-border-gray-600 dark:univer-bg-gray-700
|
|
1464
1464
|
`,
|
|
1465
1465
|
children: [
|
|
1466
1466
|
/* @__PURE__ */ S(
|
|
@@ -1470,25 +1470,18 @@ function mi() {
|
|
|
1470
1470
|
sharedProps: { range: p, colIndex: T, onClose: h }
|
|
1471
1471
|
}
|
|
1472
1472
|
),
|
|
1473
|
-
/* @__PURE__ */ S(
|
|
1474
|
-
|
|
1473
|
+
/* @__PURE__ */ S("div", { className: "univer-mb-1 univer-flex-shrink-0 univer-flex-grow-0", children: /* @__PURE__ */ S(
|
|
1474
|
+
jr,
|
|
1475
1475
|
{
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
jr,
|
|
1480
|
-
{
|
|
1481
|
-
value: s,
|
|
1482
|
-
items: i,
|
|
1483
|
-
onChange: (N) => a(N)
|
|
1484
|
-
}
|
|
1485
|
-
)
|
|
1476
|
+
value: s,
|
|
1477
|
+
items: i,
|
|
1478
|
+
onChange: (N) => a(N)
|
|
1486
1479
|
}
|
|
1487
|
-
),
|
|
1480
|
+
) }),
|
|
1488
1481
|
n ? /* @__PURE__ */ S(
|
|
1489
1482
|
"div",
|
|
1490
1483
|
{
|
|
1491
|
-
"data-u-comp
|
|
1484
|
+
"data-u-comp": "sheets-filter-panel-content",
|
|
1492
1485
|
className: "univer-flex-shrink univer-flex-grow univer-pt-2",
|
|
1493
1486
|
children: s === ye.VALUES ? /* @__PURE__ */ S(di, { model: n }) : /* @__PURE__ */ S(ci, { model: n })
|
|
1494
1487
|
}
|
|
@@ -1496,7 +1489,7 @@ function mi() {
|
|
|
1496
1489
|
/* @__PURE__ */ b(
|
|
1497
1490
|
"div",
|
|
1498
1491
|
{
|
|
1499
|
-
"data-u-comp
|
|
1492
|
+
"data-u-comp": "sheets-filter-panel-footer",
|
|
1500
1493
|
className: `
|
|
1501
1494
|
univer-mt-4 univer-inline-flex univer-flex-shrink-0 univer-flex-grow-0 univer-flex-nowrap
|
|
1502
1495
|
univer-justify-between univer-overflow-hidden
|
|
@@ -1619,7 +1612,7 @@ let Qe = class extends qr {
|
|
|
1619
1612
|
e.save();
|
|
1620
1613
|
const i = new Path2D();
|
|
1621
1614
|
i.rect(n, l, s, r), e.clip(i);
|
|
1622
|
-
const { hasCriteria: o } = this._filterParams, a = this._themeService.
|
|
1615
|
+
const { hasCriteria: o } = this._filterParams, a = this._themeService.getColorFromTheme("primary.600"), c = this._hovered ? this._themeService.getColorFromTheme("gray.50") : "rgba(255, 255, 255, 1.0)";
|
|
1623
1616
|
o ? ut.drawHasCriteria(e, H, a, c) : ut.drawNoCriteria(e, H, a, c), e.restore();
|
|
1624
1617
|
}
|
|
1625
1618
|
onPointerDown(e) {
|
|
@@ -1646,12 +1639,12 @@ Qe = Ti([
|
|
|
1646
1639
|
De(3, Q),
|
|
1647
1640
|
De(4, E(gt))
|
|
1648
1641
|
], Qe);
|
|
1649
|
-
var Ni = Object.getOwnPropertyDescriptor,
|
|
1642
|
+
var Ni = Object.getOwnPropertyDescriptor, Fi = (t, e, r, s) => {
|
|
1650
1643
|
for (var n = s > 1 ? void 0 : s ? Ni(e, r) : e, l = t.length - 1, i; l >= 0; l--)
|
|
1651
1644
|
(i = t[l]) && (n = i(n) || n);
|
|
1652
1645
|
return n;
|
|
1653
1646
|
}, Y = (t, e) => (r, s) => e(r, s, t);
|
|
1654
|
-
const
|
|
1647
|
+
const Ci = 1e3, yi = 5e3;
|
|
1655
1648
|
let Ve = class extends St {
|
|
1656
1649
|
constructor(e, r, s, n, l, i, o, a) {
|
|
1657
1650
|
super();
|
|
@@ -1696,7 +1689,7 @@ let Ve = class extends St {
|
|
|
1696
1689
|
_renderRange(e, r) {
|
|
1697
1690
|
const { scene: s } = this._context, { rowHeaderWidth: n, columnHeaderHeight: l } = r, i = this._filterRangeShape = new Pr(
|
|
1698
1691
|
s,
|
|
1699
|
-
|
|
1692
|
+
Ci,
|
|
1700
1693
|
this._themeService,
|
|
1701
1694
|
{
|
|
1702
1695
|
rowHeaderWidth: n,
|
|
@@ -1716,10 +1709,10 @@ let Ve = class extends St {
|
|
|
1716
1709
|
this._interceptCellContent(n, i, e.range);
|
|
1717
1710
|
const { startColumn: a, endColumn: c, startRow: h } = r;
|
|
1718
1711
|
for (let m = a; m <= c; m++) {
|
|
1719
|
-
const g = `sheets-filter-button-${m}`, p = Lr(h, m, o, l), { startX: T, startY: v, endX:
|
|
1712
|
+
const g = `sheets-filter-button-${m}`, p = Lr(h, m, o, l), { startX: T, startY: v, endX: C, endY: N } = p, R = C - T, O = N - v;
|
|
1720
1713
|
if (O <= Se || R <= Se)
|
|
1721
1714
|
continue;
|
|
1722
|
-
const M = !!s.getFilterColumn(m), w =
|
|
1715
|
+
const M = !!s.getFilterColumn(m), w = C - H - Se, _e = N - H - Se, ve = {
|
|
1723
1716
|
left: w,
|
|
1724
1717
|
top: _e,
|
|
1725
1718
|
height: H,
|
|
@@ -1755,7 +1748,7 @@ let Ve = class extends St {
|
|
|
1755
1748
|
(e = this._filterRangeShape) == null || e.dispose(), this._filterButtonShapes.forEach((s) => s.dispose()), (r = this._buttonRenderDisposable) == null || r.dispose(), this._filterRangeShape = null, this._buttonRenderDisposable = null, this._filterButtonShapes = [];
|
|
1756
1749
|
}
|
|
1757
1750
|
};
|
|
1758
|
-
Ve =
|
|
1751
|
+
Ve = Fi([
|
|
1759
1752
|
Y(1, E(X)),
|
|
1760
1753
|
Y(2, E(Ir)),
|
|
1761
1754
|
Y(3, E(V)),
|
|
@@ -1871,7 +1864,7 @@ Ae = Pi([
|
|
|
1871
1864
|
A(7, Q),
|
|
1872
1865
|
A(8, Nr),
|
|
1873
1866
|
A(9, Me),
|
|
1874
|
-
A(10,
|
|
1867
|
+
A(10, Fr),
|
|
1875
1868
|
A(11, E(yt)),
|
|
1876
1869
|
A(12, At)
|
|
1877
1870
|
], Ae);
|
|
@@ -1896,7 +1889,7 @@ let Pe = class extends je {
|
|
|
1896
1889
|
[W],
|
|
1897
1890
|
[ne],
|
|
1898
1891
|
[Ae]
|
|
1899
|
-
].forEach((t) => this._injector.add(t)), this._config.useRemoteFilterValuesGenerator && this._rpcChannelService && this._injector.add([
|
|
1892
|
+
].forEach((t) => this._injector.add(t)), this._config.useRemoteFilterValuesGenerator && this._rpcChannelService && this._injector.add([Fe, {
|
|
1900
1893
|
useFactory: () => zt(
|
|
1901
1894
|
this._rpcChannelService.requestChannel(Je)
|
|
1902
1895
|
)
|
|
@@ -1912,10 +1905,10 @@ let Pe = class extends je {
|
|
|
1912
1905
|
xt(Pe, "type", Z.UNIVER_SHEET);
|
|
1913
1906
|
xt(Pe, "pluginName", $i);
|
|
1914
1907
|
Pe = wi([
|
|
1915
|
-
Et(
|
|
1908
|
+
Et(Ct),
|
|
1916
1909
|
ke(1, E(X)),
|
|
1917
1910
|
ke(2, Tt),
|
|
1918
|
-
ke(3, Zt(
|
|
1911
|
+
ke(3, Zt(Ft))
|
|
1919
1912
|
], Pe);
|
|
1920
1913
|
var Ui = Object.defineProperty, Hi = Object.getOwnPropertyDescriptor, Di = (t, e, r) => e in t ? Ui(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, ki = (t, e, r, s) => {
|
|
1921
1914
|
for (var n = s > 1 ? void 0 : s ? Hi(e, r) : e, l = t.length - 1, i; l >= 0; l--)
|
|
@@ -1949,7 +1942,7 @@ let be = class extends je {
|
|
|
1949
1942
|
Bt(be, "type", Z.UNIVER_SHEET);
|
|
1950
1943
|
Bt(be, "pluginName", xi);
|
|
1951
1944
|
be = ki([
|
|
1952
|
-
Et(
|
|
1945
|
+
Et(Ct),
|
|
1953
1946
|
mt(1, E(X)),
|
|
1954
1947
|
mt(2, Tt)
|
|
1955
1948
|
], be);
|
|
@@ -1964,19 +1957,19 @@ let ft = (Ee = class extends je {
|
|
|
1964
1957
|
}
|
|
1965
1958
|
onStarting() {
|
|
1966
1959
|
[
|
|
1967
|
-
[
|
|
1960
|
+
[Fe, { useClass: Be }]
|
|
1968
1961
|
].forEach((t) => this._injector.add(t));
|
|
1969
1962
|
}
|
|
1970
1963
|
onReady() {
|
|
1971
1964
|
this._rpcChannelService.registerChannel(
|
|
1972
1965
|
Je,
|
|
1973
|
-
Jt(this._injector.get(
|
|
1966
|
+
Jt(this._injector.get(Fe))
|
|
1974
1967
|
);
|
|
1975
1968
|
}
|
|
1976
1969
|
}, f(Ee, "type", Z.UNIVER_SHEET), f(Ee, "pluginName", "SHEET_FILTER_UI_WORKER_PLUGIN"), Ee);
|
|
1977
1970
|
ft = Wi([
|
|
1978
1971
|
pt(1, E(X)),
|
|
1979
|
-
pt(2,
|
|
1972
|
+
pt(2, Ft)
|
|
1980
1973
|
], ft);
|
|
1981
1974
|
export {
|
|
1982
1975
|
Ut as ChangeFilterByOperation,
|
package/lib/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.univer-mx-1{margin-left:4px;margin-right:4px}.univer-mb-1{margin-bottom:4px}.univer-ml-1{margin-left:4px}.univer-mt-2{margin-top:8px}.univer-mt-4{margin-top:16px}.univer-box-border{box-sizing:border-box}.univer-inline-block{display:inline-block}.univer-flex{display:flex}.univer-inline-flex{display:inline-flex}.univer-hidden{display:none}.univer-h-4{height:16px}.univer-h-5{height:20px}.univer-h-7{height:28px}.univer-h-8{height:32px}.univer-h-\[432px\]{height:432px}.univer-h-full{height:100%}.univer-w-\[312px\]{width:312px}.univer-w-full{width:100%}.univer-max-w-\[245px\]{max-width:245px}.univer-flex-1{flex:1 1 0%}.univer-flex-shrink{flex-shrink:1}.univer-flex-shrink-0{flex-shrink:0}.univer-flex-grow{flex-grow:1}.univer-flex-grow-0{flex-grow:0}.univer-cursor-pointer{cursor:pointer}.univer-flex-col{flex-direction:column}.univer-flex-nowrap{flex-wrap:nowrap}.univer-items-center{align-items:center}.univer-justify-between{justify-content:space-between}.univer-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:0;margin-right:calc(8px * var(--tw-space-x-reverse));margin-left:calc(8px * (1 - var(--tw-space-x-reverse)));margin-left:8px;margin-left:calc(8px * calc(1 - var(--tw-space-x-reverse)))}.univer-overflow-hidden{overflow:hidden}.univer-text-ellipsis{text-overflow:ellipsis}.univer-whitespace-nowrap{white-space:nowrap}.univer-rounded-lg{border-radius:8px}.univer-rounded-md{border-radius:6px}.univer-border{border-width:1px}.univer-border-solid{border-style:solid}.univer-border-gray-200{
|
|
1
|
+
.univer-mx-1{margin-left:4px;margin-right:4px}.univer-mb-1{margin-bottom:4px}.univer-ml-1{margin-left:4px}.univer-mt-2{margin-top:8px}.univer-mt-4{margin-top:16px}.univer-box-border{box-sizing:border-box}.univer-inline-block{display:inline-block}.univer-flex{display:flex}.univer-inline-flex{display:inline-flex}.univer-hidden{display:none}.univer-h-4{height:16px}.univer-h-5{height:20px}.univer-h-7{height:28px}.univer-h-8{height:32px}.univer-h-\[432px\]{height:432px}.univer-h-full{height:100%}.univer-w-\[312px\]{width:312px}.univer-w-full{width:100%}.univer-max-w-\[245px\]{max-width:245px}.univer-flex-1{flex:1 1 0%}.univer-flex-shrink{flex-shrink:1}.univer-flex-shrink-0{flex-shrink:0}.univer-flex-grow{flex-grow:1}.univer-flex-grow-0{flex-grow:0}.univer-cursor-pointer{cursor:pointer}.univer-flex-col{flex-direction:column}.univer-flex-nowrap{flex-wrap:nowrap}.univer-items-center{align-items:center}.univer-justify-between{justify-content:space-between}.univer-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:0;margin-right:calc(8px * var(--tw-space-x-reverse));margin-left:calc(8px * (1 - var(--tw-space-x-reverse)));margin-left:8px;margin-left:calc(8px * calc(1 - var(--tw-space-x-reverse)))}.univer-overflow-hidden{overflow:hidden}.univer-text-ellipsis{text-overflow:ellipsis}.univer-whitespace-nowrap{white-space:nowrap}.univer-rounded-lg{border-radius:8px}.univer-rounded-md{border-radius:6px}.univer-border{border-width:1px}.univer-border-solid{border-style:solid}.univer-border-gray-200{border-color:var(--univer-gray-200)}.univer-bg-white{background-color:var(--univer-white)}.univer-p-2{padding:8px}.univer-p-4{padding:16px}.univer-px-1\.5{padding-left:6px;padding-right:6px}.univer-px-2{padding-left:8px;padding-right:8px}.univer-py-0\.5{padding-top:2px;padding-bottom:2px}.univer-py-2\.5{padding-top:10px;padding-bottom:10px}.univer-pb-0{padding-bottom:0}.univer-pl-5{padding-left:20px}.univer-pr-0\.5{padding-right:2px}.univer-pr-2{padding-right:8px}.univer-pt-0{padding-top:0}.univer-pt-2{padding-top:8px}.univer-text-\[13px\]{font-size:13px}.univer-text-xs{font-size:12px;line-height:16px}.univer-text-gray-400{color:var(--univer-gray-400)}.univer-text-gray-500{color:var(--univer-gray-500)}.univer-text-gray-950{--tw-text-opacity: 1;color:#030712;color:rgba(3,7,18,var(--tw-text-opacity, 1))}.univer-text-primary-500{color:var(--univer-primary-500)}.univer-shadow-lg{--tw-shadow: 0px 4px 6px 0px rgba(30, 40, 77, .05), 0px 10px 15px -3px rgba(30, 40, 77, .1);--tw-shadow-colored: 0px 4px 6px 0px var(--tw-shadow-color), 0px 10px 15px -3px var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 4px 6px #1e284d0d,0 10px 15px -3px #1e284d1a;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.hover\:univer-bg-gray-50:hover{background-color:var(--univer-gray-50)}.dark\:univer-border-gray-600:where(.univer-dark,.univer-dark *){border-color:var(--univer-gray-600)}.dark\:univer-bg-gray-700:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-700)}.dark\:univer-text-gray-500:where(.univer-dark,.univer-dark *){color:var(--univer-gray-500)}.dark\:univer-text-white:where(.univer-dark,.univer-dark *){color:var(--univer-white)}.\[\&\:hover_a\]\:univer-inline-block:hover a{display:inline-block}
|