@univerjs/sheets-filter-ui 0.7.0 → 0.8.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 +4 -4
- package/lib/es/index.js +62 -58
- package/lib/index.css +1 -1
- package/lib/index.js +62 -58
- package/lib/types/locale/en-US.d.ts +82 -2
- package/lib/types/locale/fa-IR.d.ts +2 -2
- package/lib/types/locale/ru-RU.d.ts +2 -2
- package/lib/types/locale/vi-VN.d.ts +2 -2
- package/lib/types/locale/zh-CN.d.ts +2 -82
- package/lib/types/locale/zh-TW.d.ts +2 -2
- package/lib/umd/index.js +4 -4
- package/package.json +13 -13
package/lib/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
var Yt = Object.defineProperty;
|
|
2
2
|
var qt = (t, e, r) => e in t ? Yt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
3
|
var f = (t, e, r) => qt(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
-
import { BooleanNumber as rt, createIdentifier as _t, Inject as E, LocaleService as K, IUniverInstanceService as Ge, ILogService as Kt, extractPureTextFromCell as Xt, numfmt as it, Disposable as me, Injector as X, Quantity as vt, Tools as Te, ICommandService as Q, CommandType as Le, IContextService as
|
|
4
|
+
import { BooleanNumber as rt, createIdentifier as _t, Inject as E, LocaleService as K, IUniverInstanceService as Ge, ILogService as Kt, extractPureTextFromCell as Xt, numfmt as it, Disposable as me, Injector as X, Quantity as vt, Tools as Te, ICommandService as Q, CommandType as Le, IContextService as we, UniverInstanceType as Z, ThemeService as gt, RxDisposable as St, fromCallback as Zt, InterceptorEffectEnum as zt, DependentOn as Et, IConfigService as Tt, Optional as Jt, Plugin as je, merge as Nt } from "@univerjs/core";
|
|
5
5
|
import { IRPCChannelService as Ft, toModule as er, fromModule as tr } from "@univerjs/rpc";
|
|
6
6
|
import { CustomFilterOperator as u, SetSheetsFilterCriteriaCommand as re, SheetsFilterService as V, SmartToggleSheetsFilterCommand as pe, ReCalcSheetsFilterCommand as Ye, ClearSheetsFilterCriteriaCommand as qe, FILTER_MUTATIONS as rr, SetSheetsFilterRangeMutation as ir, SetSheetsFilterCriteriaMutation as sr, RemoveSheetsFilterMutation as nr, ReCalcSheetsFilterMutation as or, RemoveSheetFilterCommand as ar, SetSheetFilterRangeCommand as lr, UniverSheetsFilterPlugin as Ct } from "@univerjs/sheets-filter";
|
|
7
7
|
import { RefRangeService as cr, SheetPermissionCheckController as ur, SheetsSelectionsService as hr, getSheetCommandTarget as dr, WorksheetFilterPermission as ae, WorksheetViewPermission as le, RangeProtectionPermissionViewPoint as ce, expandToContinuousRange as mr, SheetInterceptorService as pr, SetRangeValuesMutation as fr, INTERCEPTOR_POINT as _r } from "@univerjs/sheets";
|
|
8
|
-
import { ILayoutService as vr, useDependency as te, useObservable as B, useComponentsOfPart as gr, ComponentContainer as Sr, getMenuHiddenObservable as Ke, MenuItemType as Xe,
|
|
9
|
-
import { SetCellEditVisibleOperation as Or, SheetsUIPart as Rr, getObservableWithExclusiveRange$ as Ir, getCurrentRangeDisable$ as Ar, SheetSkeletonManagerService as Pr, ISheetSelectionRenderService as br, SelectionControl as Lr, attachSelectionWithCoord as
|
|
8
|
+
import { ILayoutService as vr, useDependency as te, useObservable as B, useComponentsOfPart as gr, ComponentContainer as Sr, getMenuHiddenObservable as Ke, MenuItemType as Xe, RibbonDataGroup as Er, KeyCode as Tr, MetaKeys as st, ComponentManager as Nr, IShortcutService as Fr, IMenuManagerService as Cr, IMessageService as yr } from "@univerjs/ui";
|
|
9
|
+
import { SetCellEditVisibleOperation as Or, SheetsUIPart as Rr, getObservableWithExclusiveRange$ as Ir, getCurrentRangeDisable$ as Ar, SheetSkeletonManagerService as Pr, ISheetSelectionRenderService as br, SelectionControl as Lr, attachSelectionWithCoord as wr, getCoordByCell as Mr, SheetsRenderService as yt, whenSheetEditorFocused as $r, SheetCanvasPopManagerService as Ur } from "@univerjs/sheets-ui";
|
|
10
10
|
import { BehaviorSubject as q, ReplaySubject as Hr, Subject as Dr, merge as kr, combineLatest as xr, throttleTime as Ot, startWith as Rt, map as ie, shareReplay as Br, of as fe, switchMap as Ze, filter as Wr, takeUntil as Qr, distinctUntilChanged as Vr } from "rxjs";
|
|
11
11
|
import { Select as nt, clsx as It, borderClassName as At, RadioGroup as Gr, Radio as ot, Input as Pt, Checkbox as jr, Tree as Yr, Segmented as qr, Button as Ue, MessageType as Kr } from "@univerjs/design";
|
|
12
12
|
import { Rect as at, Shape as Xr, IRenderManagerService as bt } from "@univerjs/engine-render";
|
|
13
13
|
import { jsx as S, jsxs as b, Fragment as lt } from "react/jsx-runtime";
|
|
14
|
-
import { forwardRef as Lt, useRef as Zr, createElement as
|
|
15
|
-
const
|
|
14
|
+
import { forwardRef as Lt, useRef as Zr, createElement as wt, useCallback as D, useMemo as ze } from "react";
|
|
15
|
+
const Mt = "sheets-filter-ui.config", Ne = {};
|
|
16
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 = {
|
|
@@ -392,9 +392,9 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
|
|
|
392
392
|
mapToFilterColumn: (i) => {
|
|
393
393
|
const { and: o, val1: a, val2: c, operator1: h, operator2: m } = i;
|
|
394
394
|
function g(R, O) {
|
|
395
|
-
for (const
|
|
396
|
-
if (
|
|
397
|
-
return
|
|
395
|
+
for (const w of t.ALL_CONDITIONS)
|
|
396
|
+
if (w.operator === R)
|
|
397
|
+
return w.mapToFilterColumn({ val1: O, operator1: R });
|
|
398
398
|
}
|
|
399
399
|
const p = !h || h === t.NONE.operator, T = !m || m === t.NONE.operator;
|
|
400
400
|
if (p && T)
|
|
@@ -528,7 +528,7 @@ Be = Jr([
|
|
|
528
528
|
He(2, Kt)
|
|
529
529
|
], Be);
|
|
530
530
|
function $t(t, e, r, s, n, l, i, o) {
|
|
531
|
-
var v, C, N, R, O,
|
|
531
|
+
var v, C, N, R, O, w, M, _e, ve;
|
|
532
532
|
const a = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), h = "yyyy-mm-dd", m = new Set(ei), g = "empty";
|
|
533
533
|
let p = 0;
|
|
534
534
|
for (const I of s.iterateByColumn(r, !1, !1)) {
|
|
@@ -545,7 +545,7 @@ function $t(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((C = I.value) == null ? void 0 : C.s)) == null ? void 0 : N.n) == null ? void 0 : R.pattern : "", jt = ge && it.
|
|
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 : "", jt = ge && it.getFormatInfo(ge).isDate;
|
|
549
549
|
if (ge && jt && m.has(ge)) {
|
|
550
550
|
const k = (O = s.getCellRaw(I.row, I.col)) == null ? void 0 : O.v;
|
|
551
551
|
if (!k) {
|
|
@@ -562,7 +562,7 @@ function $t(t, e, r, s, n, l, i, o) {
|
|
|
562
562
|
leaf: !1,
|
|
563
563
|
checked: !1
|
|
564
564
|
}, a.set(`${y}`, j), c.set(`${y}`, [`${y}`]));
|
|
565
|
-
let U = (
|
|
565
|
+
let U = (w = j.children) == null ? void 0 : w.find(($e) => $e.key === `${y}-${$}`);
|
|
566
566
|
U || (U = {
|
|
567
567
|
title: e.t(`sheets-filter.date.${$}`),
|
|
568
568
|
key: `${y}-${$}`,
|
|
@@ -570,9 +570,9 @@ function $t(t, e, r, s, n, l, i, o) {
|
|
|
570
570
|
count: 0,
|
|
571
571
|
leaf: !1,
|
|
572
572
|
checked: !1
|
|
573
|
-
}, (
|
|
574
|
-
const
|
|
575
|
-
|
|
573
|
+
}, (M = j.children) == null || M.push(U), c.set(`${y}-${$}`, [`${y}`, `${y}-${$}`]));
|
|
574
|
+
const Me = (_e = U == null ? void 0 : U.children) == null ? void 0 : _e.find(($e) => $e.key === `${y}-${$}-${oe}`);
|
|
575
|
+
Me ? (Me.originValues.add(G), Me.count++, U.count++, j.count++) : ((ve = U.children) == null || ve.push({
|
|
576
576
|
title: `${oe}`,
|
|
577
577
|
key: `${y}-${$}-${oe}`,
|
|
578
578
|
count: 1,
|
|
@@ -919,15 +919,15 @@ let Re = class extends me {
|
|
|
919
919
|
* @returns the model to control the panel's state
|
|
920
920
|
*/
|
|
921
921
|
static async fromFilterColumn(e, r, s) {
|
|
922
|
-
var
|
|
922
|
+
var w;
|
|
923
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 = (
|
|
927
|
+
const m = r.getRange(), g = s, p = (w = r.getFilterColumn(s)) == null ? void 0 : w.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
|
-
const
|
|
930
|
+
const M = await i.getFilterValues({
|
|
931
931
|
unitId: o,
|
|
932
932
|
subUnitId: a,
|
|
933
933
|
filteredOutRowsByOtherColumns: Array.from(C),
|
|
@@ -936,10 +936,10 @@ let Re = class extends me {
|
|
|
936
936
|
iterateRange: N,
|
|
937
937
|
alreadyChecked: Array.from(T)
|
|
938
938
|
});
|
|
939
|
-
R =
|
|
939
|
+
R = M.filterTreeItems, O = M.filterTreeMapCache;
|
|
940
940
|
} else {
|
|
941
|
-
const
|
|
942
|
-
R =
|
|
941
|
+
const M = $t(!!p, l, N, h, C, T, v, c.getStyles());
|
|
942
|
+
R = M.filterTreeItems, O = M.filterTreeMapCache;
|
|
943
943
|
}
|
|
944
944
|
return e.createInstance(Re, r, s, R, O);
|
|
945
945
|
}
|
|
@@ -1038,7 +1038,7 @@ 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
|
-
const r = t.get(
|
|
1041
|
+
const r = t.get(we), s = t.get(V), n = t.get(W);
|
|
1042
1042
|
t.get(Q).syncExecuteCommand(Or.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;
|
|
@@ -1047,7 +1047,7 @@ const se = "FILTER_PANEL_OPENED", Ie = {
|
|
|
1047
1047
|
id: "sheet.operation.close-filter-panel",
|
|
1048
1048
|
type: Le.OPERATION,
|
|
1049
1049
|
handler: (t) => {
|
|
1050
|
-
const e = t.get(
|
|
1050
|
+
const e = t.get(we), r = t.get(W), s = t.get(vr, vt.OPTIONAL);
|
|
1051
1051
|
return e.getContextValue(se) ? (e.setContextValue(se, !1), s == null || s.focus(), r.terminate()) : !1;
|
|
1052
1052
|
}
|
|
1053
1053
|
}, Dt = {
|
|
@@ -1136,7 +1136,7 @@ var P = function() {
|
|
|
1136
1136
|
return xt(r, "".concat(s), { defIds: r.defIds, idSuffix: a.current }, P({ ref: e, className: o }, i), l);
|
|
1137
1137
|
});
|
|
1138
1138
|
function xt(t, e, r, s, n) {
|
|
1139
|
-
return
|
|
1139
|
+
return wt(t.tag, P(P({ key: e }, ai(t, r, n)), s), (li(t, r).children || []).map(function(l, i) {
|
|
1140
1140
|
return xt(l, "".concat(e, "-").concat(t.tag, "-").concat(i), r, void 0, n);
|
|
1141
1141
|
}));
|
|
1142
1142
|
}
|
|
@@ -1155,21 +1155,21 @@ function ai(t, e, r) {
|
|
|
1155
1155
|
function li(t, e) {
|
|
1156
1156
|
var r, s = e.defIds;
|
|
1157
1157
|
return !s || s.length === 0 ? t : t.tag === "defs" && (!((r = t.children) === null || r === void 0) && r.length) ? P(P({}, t), { children: t.children.map(function(n) {
|
|
1158
|
-
return typeof n.attrs.id == "string" && s && s.
|
|
1158
|
+
return typeof n.attrs.id == "string" && s && s.includes(n.attrs.id) ? P(P({}, n), { attrs: P(P({}, n.attrs), { id: n.attrs.id + e.idSuffix }) }) : n;
|
|
1159
1159
|
}) }) : t;
|
|
1160
1160
|
}
|
|
1161
1161
|
function ci() {
|
|
1162
1162
|
return Math.random().toString(36).substring(2, 8);
|
|
1163
1163
|
}
|
|
1164
1164
|
kt.displayName = "UniverIcon";
|
|
1165
|
-
var ui = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3.32182 2.60967C2.98161 2.60967 2.79671 3.0074 3.01601 3.2675L6.85819 7.8246C6.94943 7.93282 6.99947 8.06981 6.99947 8.21136V12.7338C6.99947 12.898 7.0998 13.0455 7.2525 13.1058L8.73833 13.6928C9.00085 13.7965 9.28531 13.6031 9.28531 13.3208V8.21136C9.28531 8.06981 9.33535 7.93282 9.42659 7.8246L13.2688 3.2675C13.4881 3.0074 13.3032 2.60967 12.963 2.60967H3.32182ZM2.09858 4.04101C1.22139 3.0006 1.96097 1.40967 3.32182 1.40967H12.963C14.3238 1.40967 15.0634 3.0006 14.1862 4.04101L10.4853 8.43054V13.3208C10.4853 14.4498 9.34747 15.2237 8.29742 14.8089L6.81158 14.2219C6.20078 13.9806 5.79947 13.3905 5.79947 12.7338V8.43054L2.09858 4.04101Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Bt = Lt(function(t, e) {
|
|
1166
|
-
return
|
|
1167
|
-
id: "filter-
|
|
1165
|
+
var ui = { 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" } }] }, Bt = Lt(function(t, e) {
|
|
1166
|
+
return wt(kt, Object.assign({}, t, {
|
|
1167
|
+
id: "filter-icon",
|
|
1168
1168
|
ref: e,
|
|
1169
1169
|
icon: ui
|
|
1170
1170
|
}));
|
|
1171
1171
|
});
|
|
1172
|
-
Bt.displayName = "
|
|
1172
|
+
Bt.displayName = "FilterIcon";
|
|
1173
1173
|
function hi(t) {
|
|
1174
1174
|
var p, T;
|
|
1175
1175
|
const { model: e } = t, r = te(K), s = B(e.conditionItem$, void 0), n = B(e.filterConditionFormParams$, void 0), l = n != null && n.and ? "AND" : "OR", i = D((v) => {
|
|
@@ -1342,7 +1342,7 @@ function pi(t) {
|
|
|
1342
1342
|
"span",
|
|
1343
1343
|
{
|
|
1344
1344
|
"data-u-comp": "sheets-filter-panel-values-item-text",
|
|
1345
|
-
className: "univer-mx-1 univer-inline-block univer-flex-shrink univer-overflow-hidden univer-text-ellipsis univer-whitespace-nowrap univer-text-gray-900 dark
|
|
1345
|
+
className: "univer-mx-1 univer-inline-block univer-flex-shrink univer-overflow-hidden univer-text-ellipsis univer-whitespace-nowrap univer-text-gray-900 dark:!univer-text-white",
|
|
1346
1346
|
children: `${r.t("sheets-filter.panel.select-all")}`
|
|
1347
1347
|
}
|
|
1348
1348
|
),
|
|
@@ -1350,7 +1350,7 @@ function pi(t) {
|
|
|
1350
1350
|
"span",
|
|
1351
1351
|
{
|
|
1352
1352
|
"data-u-comp": "sheets-filter-panel-values-item-count",
|
|
1353
|
-
className: "univer-text-gray-400 dark
|
|
1353
|
+
className: "univer-text-gray-400 dark:!univer-text-gray-500",
|
|
1354
1354
|
children: `(${i.checked}/${i.checked + i.unchecked})`
|
|
1355
1355
|
}
|
|
1356
1356
|
)
|
|
@@ -1375,8 +1375,8 @@ function pi(t) {
|
|
|
1375
1375
|
univer-pr-2 univer-border-box univer-max-w-[245px] univer-rounded-md
|
|
1376
1376
|
[&:hover_a]:univer-inline-block
|
|
1377
1377
|
hover:univer-bg-gray-50 univer-h-full
|
|
1378
|
-
univer-text-gray-900 dark:hover
|
|
1379
|
-
dark
|
|
1378
|
+
univer-text-gray-900 dark:hover:!univer-bg-gray-900
|
|
1379
|
+
dark:!univer-text-white
|
|
1380
1380
|
`,
|
|
1381
1381
|
attachRender: (p) => /* @__PURE__ */ b(
|
|
1382
1382
|
"div",
|
|
@@ -1387,7 +1387,7 @@ function pi(t) {
|
|
|
1387
1387
|
"span",
|
|
1388
1388
|
{
|
|
1389
1389
|
"data-u-comp": "sheets-filter-panel-values-item-count",
|
|
1390
|
-
className: "univer-text-gray-400 dark
|
|
1390
|
+
className: "univer-text-gray-400 dark:!univer-text-gray-500",
|
|
1391
1391
|
children: `(${p.count})`
|
|
1392
1392
|
}
|
|
1393
1393
|
),
|
|
@@ -1433,7 +1433,7 @@ function fi() {
|
|
|
1433
1433
|
"div",
|
|
1434
1434
|
{
|
|
1435
1435
|
"data-u-comp": "sheets-filter-panel",
|
|
1436
|
-
className: "univer-box-border univer-flex univer-h-[
|
|
1436
|
+
className: "univer-box-border univer-flex univer-h-[442px] univer-w-[312px] 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",
|
|
1437
1437
|
children: [
|
|
1438
1438
|
/* @__PURE__ */ S(
|
|
1439
1439
|
Sr,
|
|
@@ -1457,7 +1457,7 @@ function fi() {
|
|
|
1457
1457
|
className: "univer-flex-shrink univer-flex-grow univer-pt-2",
|
|
1458
1458
|
children: s === ye.VALUES ? /* @__PURE__ */ S(pi, { model: n }) : /* @__PURE__ */ S(hi, { model: n })
|
|
1459
1459
|
}
|
|
1460
|
-
) : /* @__PURE__ */ S("div", {
|
|
1460
|
+
) : /* @__PURE__ */ S("div", { className: "univer-flex-1" }),
|
|
1461
1461
|
/* @__PURE__ */ b(
|
|
1462
1462
|
"div",
|
|
1463
1463
|
{
|
|
@@ -1465,7 +1465,7 @@ function fi() {
|
|
|
1465
1465
|
className: "univer-mt-4 univer-inline-flex univer-flex-shrink-0 univer-flex-grow-0 univer-flex-nowrap univer-justify-between univer-overflow-hidden",
|
|
1466
1466
|
children: [
|
|
1467
1467
|
/* @__PURE__ */ S(Ue, { variant: "link", onClick: c, disabled: o, children: e.t("sheets-filter.panel.clear-filter") }),
|
|
1468
|
-
/* @__PURE__ */ b("span", { className: "univer-
|
|
1468
|
+
/* @__PURE__ */ b("span", { className: "univer-flex univer-gap-2", children: [
|
|
1469
1469
|
/* @__PURE__ */ S(Ue, { variant: "default", onClick: h, children: e.t("sheets-filter.panel.cancel") }),
|
|
1470
1470
|
/* @__PURE__ */ S(Ue, { disabled: !l, variant: "primary", onClick: m, children: e.t("sheets-filter.panel.confirm") })
|
|
1471
1471
|
] })
|
|
@@ -1488,7 +1488,7 @@ function vi(t) {
|
|
|
1488
1488
|
return {
|
|
1489
1489
|
id: pe.id,
|
|
1490
1490
|
type: Xe.BUTTON_SELECTOR,
|
|
1491
|
-
icon: "
|
|
1491
|
+
icon: "FilterIcon",
|
|
1492
1492
|
tooltip: "sheets-filter.toolbar.smart-toggle-filter-tooltip",
|
|
1493
1493
|
hidden$: Ke(t, Z.UNIVER_SHEET),
|
|
1494
1494
|
activated$: e.activeFilterModel$.pipe(ie((r) => !!r)),
|
|
@@ -1522,9 +1522,9 @@ function Si(t) {
|
|
|
1522
1522
|
};
|
|
1523
1523
|
}
|
|
1524
1524
|
const Ei = {
|
|
1525
|
-
[Er.
|
|
1525
|
+
[Er.ORGANIZATION]: {
|
|
1526
1526
|
[pe.id]: {
|
|
1527
|
-
order:
|
|
1527
|
+
order: 2,
|
|
1528
1528
|
menuItemFactory: vi,
|
|
1529
1529
|
[qe.id]: {
|
|
1530
1530
|
order: 0,
|
|
@@ -1604,7 +1604,7 @@ let Qe = class extends Xr {
|
|
|
1604
1604
|
}
|
|
1605
1605
|
};
|
|
1606
1606
|
Qe = Fi([
|
|
1607
|
-
De(2,
|
|
1607
|
+
De(2, we),
|
|
1608
1608
|
De(3, Q),
|
|
1609
1609
|
De(4, E(gt))
|
|
1610
1610
|
], Qe);
|
|
@@ -1666,7 +1666,7 @@ let Ve = class extends St {
|
|
|
1666
1666
|
enableAutoFill: !1,
|
|
1667
1667
|
highlightHeader: !1
|
|
1668
1668
|
}
|
|
1669
|
-
), a =
|
|
1669
|
+
), a = wr({
|
|
1670
1670
|
range: e,
|
|
1671
1671
|
primary: null,
|
|
1672
1672
|
style: { fill: "rgba(0, 0, 0, 0.0)" }
|
|
@@ -1678,18 +1678,18 @@ let Ve = class extends St {
|
|
|
1678
1678
|
this._interceptCellContent(n, i, e.range);
|
|
1679
1679
|
const { startColumn: a, endColumn: c, startRow: h } = r;
|
|
1680
1680
|
for (let m = a; m <= c; m++) {
|
|
1681
|
-
const g = `sheets-filter-button-${m}`, p =
|
|
1681
|
+
const g = `sheets-filter-button-${m}`, p = Mr(h, m, o, l), { startX: T, startY: v, endX: C, endY: N } = p, R = C - T, O = N - v;
|
|
1682
1682
|
if (O <= Se || R <= Se)
|
|
1683
1683
|
continue;
|
|
1684
|
-
const
|
|
1685
|
-
left:
|
|
1684
|
+
const w = !!s.getFilterColumn(m), M = C - H - Se, _e = N - H - Se, ve = {
|
|
1685
|
+
left: M,
|
|
1686
1686
|
top: _e,
|
|
1687
1687
|
height: H,
|
|
1688
1688
|
width: H,
|
|
1689
1689
|
zIndex: Ri,
|
|
1690
1690
|
cellHeight: O,
|
|
1691
1691
|
cellWidth: R,
|
|
1692
|
-
filterParams: { unitId: n, subUnitId: i, col: m, hasCriteria:
|
|
1692
|
+
filterParams: { unitId: n, subUnitId: i, col: m, hasCriteria: w }
|
|
1693
1693
|
}, I = this._injector.createInstance(Qe, g, ve);
|
|
1694
1694
|
this._filterButtonShapes.push(I);
|
|
1695
1695
|
}
|
|
@@ -1701,13 +1701,10 @@ let Ve = class extends St {
|
|
|
1701
1701
|
effect: zt.Style,
|
|
1702
1702
|
handler: (o, a, c) => {
|
|
1703
1703
|
const { row: h, col: m, unitId: g, subUnitId: p } = a;
|
|
1704
|
-
return g !== e || p !== r || h !== n || m < l || m > i
|
|
1705
|
-
...o,
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
rightOffset: H
|
|
1709
|
-
}
|
|
1710
|
-
});
|
|
1704
|
+
return g !== e || p !== r || h !== n || m < l || m > i || ((!o || o === a.rawData) && (o = { ...a.rawData }), o.fontRenderExtension = {
|
|
1705
|
+
...o == null ? void 0 : o.fontRenderExtension,
|
|
1706
|
+
rightOffset: H
|
|
1707
|
+
}), c(o);
|
|
1711
1708
|
},
|
|
1712
1709
|
priority: 10
|
|
1713
1710
|
});
|
|
@@ -1796,7 +1793,14 @@ let Ae = class extends de {
|
|
|
1796
1793
|
this._menuManagerService.mergeMenu(Ei);
|
|
1797
1794
|
}
|
|
1798
1795
|
_initUI() {
|
|
1799
|
-
|
|
1796
|
+
[
|
|
1797
|
+
[dt, fi],
|
|
1798
|
+
["FilterIcon", Bt]
|
|
1799
|
+
].forEach(([e, r]) => {
|
|
1800
|
+
this.disposeWithMe(
|
|
1801
|
+
this._componentManager.register(e, r)
|
|
1802
|
+
);
|
|
1803
|
+
}), this.disposeWithMe(this._contextService.subscribeContextValue$(se).pipe(Vr()).subscribe((e) => {
|
|
1800
1804
|
e ? this._openFilterPopup() : this._closeFilterPopup();
|
|
1801
1805
|
})), this.disposeWithMe(this._sheetsFilterService.errorMsg$.subscribe((e) => {
|
|
1802
1806
|
e && this._messageService.show({
|
|
@@ -1832,13 +1836,13 @@ Ae = Li([
|
|
|
1832
1836
|
A(6, Fr),
|
|
1833
1837
|
A(7, Q),
|
|
1834
1838
|
A(8, Cr),
|
|
1835
|
-
A(9,
|
|
1839
|
+
A(9, we),
|
|
1836
1840
|
A(10, yr),
|
|
1837
1841
|
A(11, E(yt)),
|
|
1838
1842
|
A(12, bt)
|
|
1839
1843
|
], Ae);
|
|
1840
|
-
var
|
|
1841
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
1844
|
+
var wi = Object.defineProperty, Mi = Object.getOwnPropertyDescriptor, $i = (t, e, r) => e in t ? wi(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Ui = (t, e, r, s) => {
|
|
1845
|
+
for (var n = s > 1 ? void 0 : s ? Mi(e, r) : e, l = t.length - 1, i; l >= 0; l--)
|
|
1842
1846
|
(i = t[l]) && (n = i(n) || n);
|
|
1843
1847
|
return n;
|
|
1844
1848
|
}, ke = (t, e) => (r, s) => e(r, s, t), Wt = (t, e, r) => $i(t, typeof e != "symbol" ? e + "" : e, r);
|
|
@@ -1851,7 +1855,7 @@ let Pe = class extends je {
|
|
|
1851
1855
|
Ne,
|
|
1852
1856
|
this._config
|
|
1853
1857
|
);
|
|
1854
|
-
n && this._configService.setConfig("menu", n, { merge: !0 }), this._configService.setConfig(
|
|
1858
|
+
n && this._configService.setConfig("menu", n, { merge: !0 }), this._configService.setConfig(Mt, l);
|
|
1855
1859
|
}
|
|
1856
1860
|
onStarting() {
|
|
1857
1861
|
[
|
|
@@ -1893,7 +1897,7 @@ let be = class extends je {
|
|
|
1893
1897
|
Ne,
|
|
1894
1898
|
this._config
|
|
1895
1899
|
);
|
|
1896
|
-
s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(
|
|
1900
|
+
s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(Mt, n);
|
|
1897
1901
|
}
|
|
1898
1902
|
onStarting() {
|
|
1899
1903
|
[
|
|
@@ -1,3 +1,83 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
declare const locale: {
|
|
17
|
+
'sheets-filter': {
|
|
18
|
+
toolbar: {
|
|
19
|
+
'smart-toggle-filter-tooltip': string;
|
|
20
|
+
'clear-filter-criteria': string;
|
|
21
|
+
're-calc-filter-conditions': string;
|
|
22
|
+
};
|
|
23
|
+
command: {
|
|
24
|
+
'not-valid-filter-range': string;
|
|
25
|
+
};
|
|
26
|
+
shortcut: {
|
|
27
|
+
'smart-toggle-filter': string;
|
|
28
|
+
};
|
|
29
|
+
panel: {
|
|
30
|
+
'clear-filter': string;
|
|
31
|
+
cancel: string;
|
|
32
|
+
confirm: string;
|
|
33
|
+
'by-values': string;
|
|
34
|
+
'by-conditions': string;
|
|
35
|
+
'filter-only': string;
|
|
36
|
+
'search-placeholder': string;
|
|
37
|
+
'select-all': string;
|
|
38
|
+
'input-values-placeholder': string;
|
|
39
|
+
and: string;
|
|
40
|
+
or: string;
|
|
41
|
+
empty: string;
|
|
42
|
+
'?': string;
|
|
43
|
+
'*': string;
|
|
44
|
+
};
|
|
45
|
+
conditions: {
|
|
46
|
+
none: string;
|
|
47
|
+
empty: string;
|
|
48
|
+
'not-empty': string;
|
|
49
|
+
'text-contains': string;
|
|
50
|
+
'does-not-contain': string;
|
|
51
|
+
'starts-with': string;
|
|
52
|
+
'ends-with': string;
|
|
53
|
+
equals: string;
|
|
54
|
+
'greater-than': string;
|
|
55
|
+
'greater-than-or-equal': string;
|
|
56
|
+
'less-than': string;
|
|
57
|
+
'less-than-or-equal': string;
|
|
58
|
+
equal: string;
|
|
59
|
+
'not-equal': string;
|
|
60
|
+
between: string;
|
|
61
|
+
'not-between': string;
|
|
62
|
+
custom: string;
|
|
63
|
+
};
|
|
64
|
+
msg: {
|
|
65
|
+
'filter-header-forbidden': string;
|
|
66
|
+
};
|
|
67
|
+
date: {
|
|
68
|
+
1: string;
|
|
69
|
+
2: string;
|
|
70
|
+
3: string;
|
|
71
|
+
4: string;
|
|
72
|
+
5: string;
|
|
73
|
+
6: string;
|
|
74
|
+
7: string;
|
|
75
|
+
8: string;
|
|
76
|
+
9: string;
|
|
77
|
+
10: string;
|
|
78
|
+
11: string;
|
|
79
|
+
12: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
};
|
|
3
83
|
export default locale;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
declare const locale: typeof
|
|
1
|
+
import { default as enUS } from './en-US';
|
|
2
|
+
declare const locale: typeof enUS;
|
|
3
3
|
export default locale;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
declare const locale: typeof
|
|
1
|
+
import { default as enUS } from './en-US';
|
|
2
|
+
declare const locale: typeof enUS;
|
|
3
3
|
export default locale;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
declare const locale: typeof
|
|
1
|
+
import { default as enUS } from './en-US';
|
|
2
|
+
declare const locale: typeof enUS;
|
|
3
3
|
export default locale;
|
|
@@ -1,83 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
declare const locale: {
|
|
17
|
-
'sheets-filter': {
|
|
18
|
-
toolbar: {
|
|
19
|
-
'smart-toggle-filter-tooltip': string;
|
|
20
|
-
'clear-filter-criteria': string;
|
|
21
|
-
're-calc-filter-conditions': string;
|
|
22
|
-
};
|
|
23
|
-
command: {
|
|
24
|
-
'not-valid-filter-range': string;
|
|
25
|
-
};
|
|
26
|
-
shortcut: {
|
|
27
|
-
'smart-toggle-filter': string;
|
|
28
|
-
};
|
|
29
|
-
panel: {
|
|
30
|
-
'clear-filter': string;
|
|
31
|
-
cancel: string;
|
|
32
|
-
confirm: string;
|
|
33
|
-
'by-values': string;
|
|
34
|
-
'by-conditions': string;
|
|
35
|
-
'filter-only': string;
|
|
36
|
-
'search-placeholder': string;
|
|
37
|
-
'select-all': string;
|
|
38
|
-
'input-values-placeholder': string;
|
|
39
|
-
or: string;
|
|
40
|
-
and: string;
|
|
41
|
-
empty: string;
|
|
42
|
-
'?': string;
|
|
43
|
-
'*': string;
|
|
44
|
-
};
|
|
45
|
-
conditions: {
|
|
46
|
-
none: string;
|
|
47
|
-
empty: string;
|
|
48
|
-
'not-empty': string;
|
|
49
|
-
'text-contains': string;
|
|
50
|
-
'does-not-contain': string;
|
|
51
|
-
'starts-with': string;
|
|
52
|
-
'ends-with': string;
|
|
53
|
-
equals: string;
|
|
54
|
-
'greater-than': string;
|
|
55
|
-
'greater-than-or-equal': string;
|
|
56
|
-
'less-than': string;
|
|
57
|
-
'less-than-or-equal': string;
|
|
58
|
-
equal: string;
|
|
59
|
-
'not-equal': string;
|
|
60
|
-
between: string;
|
|
61
|
-
'not-between': string;
|
|
62
|
-
custom: string;
|
|
63
|
-
};
|
|
64
|
-
msg: {
|
|
65
|
-
'filter-header-forbidden': string;
|
|
66
|
-
};
|
|
67
|
-
date: {
|
|
68
|
-
1: string;
|
|
69
|
-
2: string;
|
|
70
|
-
3: string;
|
|
71
|
-
4: string;
|
|
72
|
-
5: string;
|
|
73
|
-
6: string;
|
|
74
|
-
7: string;
|
|
75
|
-
8: string;
|
|
76
|
-
9: string;
|
|
77
|
-
10: string;
|
|
78
|
-
11: string;
|
|
79
|
-
12: string;
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
};
|
|
1
|
+
import { default as enUS } from './en-US';
|
|
2
|
+
declare const locale: typeof enUS;
|
|
83
3
|
export default locale;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
declare const locale: typeof
|
|
1
|
+
import { default as enUS } from './en-US';
|
|
2
|
+
declare const locale: typeof enUS;
|
|
3
3
|
export default locale;
|