@univerjs/sheets-table-ui 0.7.0-nightly.202505061607 → 0.7.0-nightly.202505071607
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 +23 -16
- package/lib/es/index.js +573 -555
- package/lib/index.css +1 -1
- package/lib/index.js +573 -555
- package/lib/umd/index.js +24 -17
- package/package.json +11 -11
package/lib/es/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
var Ir = Object.defineProperty;
|
|
2
2
|
var Mr = (r, e, t) => e in r ? Ir(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
-
var
|
|
4
|
-
import { Inject as
|
|
5
|
-
import { IRenderManagerService as Zt, SHEET_VIEWPORT_KEY as
|
|
6
|
-
import { TableManager as te, SheetTableService as
|
|
7
|
-
import { SheetCanvasPopManagerService as
|
|
8
|
-
import { useDependency as R, ComponentManager as Xt, IDialogService as Kt, ISidebarService as
|
|
9
|
-
import { startWith as Jt, distinctUntilChanged as
|
|
10
|
-
import { jsxs as
|
|
11
|
-
import {
|
|
12
|
-
import { SetRangeValuesMutation as
|
|
13
|
-
import { SortRangeCommand as Nn, SortType as
|
|
14
|
-
import { forwardRef as re, useRef as
|
|
15
|
-
import { serializeRange as
|
|
16
|
-
import { RangeSelector as
|
|
17
|
-
const
|
|
3
|
+
var A = (r, e, t) => Mr(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { Inject as N, IUniverInstanceService as Ce, ICommandService as ee, Disposable as Fe, ObjectMatrix as Rr, cellToRange as Ht, Rectangle as pe, LocaleService as oe, Injector as He, dayjs as ve, IPermissionService as Vt, IContextService as ft, CommandType as At, IConfigService as Ut, ThemeService as jt, RxDisposable as Wt, InterceptorEffectEnum as xr, ErrorService as Nr, ColorKit as le, UniverInstanceType as it, DependentOn as Er, Plugin as Lr, registerDependencies as $r, touchDependencies as Or } from "@univerjs/core";
|
|
5
|
+
import { IRenderManagerService as Zt, SHEET_VIEWPORT_KEY as Pr, convertTransformToOffsetX as kr, convertTransformToOffsetY as Dr, Rect as It, Shape as Br } from "@univerjs/engine-render";
|
|
6
|
+
import { TableManager as te, SheetTableService as Fr, SetSheetTableFilterCommand as Mt, isConditionFilter as Hr, isManualFilter as Vr, TableDateCompareTypeEnum as l, TableStringCompareTypeEnum as U, TableConditionTypeEnum as F, TableNumberCompareTypeEnum as $, SheetsTableSortStateEnum as Ye, TableColumnFilterTypeEnum as Rt, AddSheetTableCommand as Ar, SHEET_TABLE_CUSTOM_THEME_PREFIX as Ur, DeleteSheetTableCommand as jr, SetSheetTableCommand as vt, SheetsTableButtonStateEnum as Le, processStyleWithBorderStyle as xt, customEmptyThemeWithBorderStyle as Wr, AddTableThemeCommand as Zr, RemoveTableThemeCommand as qr, SheetTableRemoveColCommand as qt, SheetTableRemoveRowCommand as Yt, SheetTableInsertColCommand as Qt, SheetTableInsertRowCommand as zt, SheetsTableController as Gt, UniverSheetTablePlugin as Yr } from "@univerjs/sheets-table";
|
|
7
|
+
import { SheetCanvasPopManagerService as Qr, SheetSkeletonManagerService as at, SheetScrollManagerService as zr, SetZoomRatioOperation as Gr, SetScrollOperation as Xr, getSheetObject as Kr, ISheetSelectionRenderService as Jr, getCoordByCell as en, SelectAllCommand as tn } from "@univerjs/sheets-ui";
|
|
8
|
+
import { useDependency as R, ComponentManager as Xt, IDialogService as Kt, ISidebarService as rn, useObservable as Me, IUIPartsService as nn, BuiltInUIPart as an, connectInjector as sn, MenuItemType as Ne, ContextMenuPosition as ln, ContextMenuGroup as on, RibbonStartGroup as cn, IMenuManagerService as un } from "@univerjs/ui";
|
|
9
|
+
import { startWith as Jt, distinctUntilChanged as dn, Subject as hn, BehaviorSubject as Nt, merge as Ct, filter as vn, debounceTime as bn, switchMap as Re, of as X, map as gn, takeUntil as mn } from "rxjs";
|
|
10
|
+
import { jsxs as _, jsx as o, Fragment as St } from "react/jsx-runtime";
|
|
11
|
+
import { Dropdown as ke, CascaderList as pn, Input as _t, InputNumber as ct, DatePicker as fn, DateRangePicker as Cn, Select as Sn, clsx as _n, Checkbox as Et, scrollbarClassName as Tn, Segmented as yn, Button as We, ColorPicker as Qe } from "@univerjs/design";
|
|
12
|
+
import { SetRangeValuesMutation as wn, WorkbookEditablePermission as er, getSheetCommandTarget as st, SheetsSelectionsService as lt, isSingleCellSelection as In, expandToContinuousRange as Mn, SetRangeThemeMutation as tr, WorkbookPermissionService as rr, SheetRangeThemeModel as nr, SheetInterceptorService as ir, INTERCEPTOR_POINT as Rn, RangeThemeStyle as xn, getPrimaryForRange as Lt, SetSelectionsOperation as $t } from "@univerjs/sheets";
|
|
13
|
+
import { SortRangeCommand as Nn, SortType as Ot } from "@univerjs/sheets-sort";
|
|
14
|
+
import { forwardRef as re, useRef as En, createElement as ne, useState as W, useMemo as ar, useCallback as Pt, useEffect as sr } from "react";
|
|
15
|
+
import { serializeRange as kt, deserializeRangeWithSheet as Ln } from "@univerjs/engine-formula";
|
|
16
|
+
import { RangeSelector as $n } from "@univerjs/sheets-formula-ui";
|
|
17
|
+
const On = "SHEET_TABLE_UI_PLUGIN", ge = "SHEETS_TABLE_FILTER_PANEL_OPENED_KEY", Pn = "UNIVER_SHEET_Table_FILTER_PANEL_ID", lr = "TABLE_TOOLBAR_BUTTON", Pe = "TABLE_SELECTOR_DIALOG", kn = "SHEET_TABLE_THEME_PANEL_ID", or = "SHEET_TABLE_THEME_PANEL", ut = "table-custom-", Dn = "table-default-", be = "rgb(255, 255, 255)", Y = "none", $e = "1px solid rgb(var(--grey-200))", Dt = "1px solid rgb(var(--blue-500))";
|
|
18
18
|
var Q = function() {
|
|
19
19
|
return Q = Object.assign || function(r) {
|
|
20
20
|
for (var e, t = 1, n = arguments.length; t < n; t++) {
|
|
@@ -23,7 +23,7 @@ var Q = function() {
|
|
|
23
23
|
}
|
|
24
24
|
return r;
|
|
25
25
|
}, Q.apply(this, arguments);
|
|
26
|
-
},
|
|
26
|
+
}, Bn = function(r, e) {
|
|
27
27
|
var t = {};
|
|
28
28
|
for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && e.indexOf(n) < 0 && (t[n] = r[n]);
|
|
29
29
|
if (r != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -31,15 +31,15 @@ var Q = function() {
|
|
|
31
31
|
e.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(r, n[i]) && (t[n[i]] = r[n[i]]);
|
|
32
32
|
return t;
|
|
33
33
|
}, ie = re(function(r, e) {
|
|
34
|
-
var t = r.icon, n = r.id, i = r.className, a = r.extend, s =
|
|
35
|
-
return cr(t, "".concat(n), { defIds: t.defIds, idSuffix:
|
|
34
|
+
var t = r.icon, n = r.id, i = r.className, a = r.extend, s = Bn(r, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(n, " ").concat(i || "").trim(), d = En("_".concat(Vn()));
|
|
35
|
+
return cr(t, "".concat(n), { defIds: t.defIds, idSuffix: d.current }, Q({ ref: e, className: c }, s), a);
|
|
36
36
|
});
|
|
37
37
|
function cr(r, e, t, n, i) {
|
|
38
|
-
return ne(r.tag, Q(Q({ key: e },
|
|
38
|
+
return ne(r.tag, Q(Q({ key: e }, Fn(r, t, i)), n), (Hn(r, t).children || []).map(function(a, s) {
|
|
39
39
|
return cr(a, "".concat(e, "-").concat(r.tag, "-").concat(s), t, void 0, i);
|
|
40
40
|
}));
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function Fn(r, e, t) {
|
|
43
43
|
var n = Q({}, r.attrs);
|
|
44
44
|
t != null && t.colorChannel1 && n.fill === "colorChannel1" && (n.fill = t.colorChannel1), r.tag === "mask" && n.id && (n.id = n.id + e.idSuffix), Object.entries(n).forEach(function(a) {
|
|
45
45
|
var s = a[0], c = a[1];
|
|
@@ -51,124 +51,124 @@ function Bn(r, e, t) {
|
|
|
51
51
|
typeof c == "string" && (n[s] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
52
52
|
})), n;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function Hn(r, e) {
|
|
55
55
|
var t, n = e.defIds;
|
|
56
56
|
return !n || n.length === 0 ? r : r.tag === "defs" && (!((t = r.children) === null || t === void 0) && t.length) ? Q(Q({}, r), { children: r.children.map(function(i) {
|
|
57
57
|
return typeof i.attrs.id == "string" && n && n.indexOf(i.attrs.id) > -1 ? Q(Q({}, i), { attrs: Q(Q({}, i.attrs), { id: i.attrs.id + e.idSuffix }) }) : i;
|
|
58
58
|
}) }) : r;
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function Vn() {
|
|
61
61
|
return Math.random().toString(36).substring(2, 8);
|
|
62
62
|
}
|
|
63
63
|
ie.displayName = "UniverIcon";
|
|
64
|
-
var
|
|
64
|
+
var An = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.4208 14.4667C12.4208 14.798 12.1522 15.0667 11.8208 15.0667C11.4895 15.0667 11.2208 14.798 11.2208 14.4667V2.98193L9.97861 4.22417C9.7443 4.45848 9.3644 4.45848 9.13008 4.22417C8.89577 3.98985 8.89577 3.60995 9.13008 3.37564L11.3967 1.10897C11.6311 0.874657 12.011 0.874657 12.2453 1.10897L14.5119 3.37564C14.7463 3.60995 14.7463 3.98985 14.5119 4.22417C14.2776 4.45848 13.8977 4.45848 13.6634 4.22417L12.4208 2.9816V14.4667Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.98967 10.2798C1.6583 10.2798 1.38967 10.0112 1.38967 9.67983 1.38967 9.34846 1.6583 9.07983 1.98967 9.07983H6.50138C6.74406 9.07983 6.96284 9.22602 7.05571 9.45022 7.14858 9.67443 7.09725 9.9325 6.92565 10.1041L3.43819 13.5916H6.50138C6.83276 13.5916 7.10138 13.8602 7.10138 14.1916 7.10138 14.5229 6.83276 14.7916 6.50138 14.7916H1.98967C1.74699 14.7916 1.52821 14.6454 1.43534 14.4212 1.34247 14.197 1.3938 13.9389 1.5654 13.7673L5.05286 10.2798H1.98967zM5.1846 1.86439C4.8641.989866 3.62725.989866 3.30674 1.86439L1.34882 7.20672C1.23479 7.51786 1.39458 7.86252 1.70571 7.97655 2.01684 8.09058 2.3615 7.93079 2.47553 7.61966L3.06159 6.02055 3.06338 6.02056H5.42975L6.01581 7.61966C6.12984 7.93079 6.4745 8.09058 6.78563 7.97655 7.09677 7.86252 7.25655 7.51786 7.14252 7.20672L5.1846 1.86439zM4.98996 4.82056L4.24567 2.78971 3.50138 4.82056H4.98996z", fillRule: "evenodd", clipRule: "evenodd" } }] }, ur = re(function(r, e) {
|
|
65
65
|
return ne(ie, Object.assign({}, r, {
|
|
66
66
|
id: "ascending- single",
|
|
67
67
|
ref: e,
|
|
68
|
-
icon:
|
|
68
|
+
icon: An
|
|
69
69
|
}));
|
|
70
70
|
});
|
|
71
71
|
ur.displayName = "AscendingSingle";
|
|
72
|
-
var
|
|
72
|
+
var Un = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, dr = re(function(r, e) {
|
|
73
73
|
return ne(ie, Object.assign({}, r, {
|
|
74
74
|
id: "delete-single",
|
|
75
75
|
ref: e,
|
|
76
|
-
icon:
|
|
76
|
+
icon: Un
|
|
77
77
|
}));
|
|
78
78
|
});
|
|
79
79
|
dr.displayName = "DeleteSingle";
|
|
80
|
-
var
|
|
80
|
+
var jn = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.4208 1.53335C12.4208 1.20198 12.1522 0.93335 11.8208 0.93335C11.4895 0.93335 11.2208 1.20198 11.2208 1.53335V13.0181L9.97861 11.7758C9.7443 11.5415 9.3644 11.5415 9.13008 11.7758C8.89577 12.0101 8.89577 12.39 9.13008 12.6244L11.3967 14.891C11.6311 15.1253 12.011 15.1253 12.2453 14.891L14.5119 12.6244C14.7463 12.39 14.7463 12.0101 14.5119 11.7758C14.2776 11.5415 13.8977 11.5415 13.6634 11.7758L12.4208 13.0184V1.53335Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.98967 10.2798C1.6583 10.2798 1.38967 10.0112 1.38967 9.67983 1.38967 9.34846 1.6583 9.07983 1.98967 9.07983H6.50138C6.74406 9.07983 6.96284 9.22602 7.05571 9.45022 7.14858 9.67443 7.09725 9.9325 6.92565 10.1041L3.43819 13.5916H6.50138C6.83276 13.5916 7.10138 13.8602 7.10138 14.1916 7.10138 14.5229 6.83276 14.7916 6.50138 14.7916H1.98967C1.74699 14.7916 1.52821 14.6454 1.43534 14.4212 1.34247 14.197 1.3938 13.9389 1.5654 13.7673L5.05286 10.2798H1.98967zM5.1846 1.86439C4.8641.989866 3.62725.989866 3.30674 1.86439L1.34882 7.20672C1.23479 7.51786 1.39458 7.86252 1.70571 7.97655 2.01684 8.09058 2.3615 7.93079 2.47553 7.61966L3.06159 6.02055 3.06338 6.02056H5.42975L6.01581 7.61966C6.12984 7.93079 6.4745 8.09058 6.78563 7.97655 7.09677 7.86252 7.25655 7.51786 7.14252 7.20672L5.1846 1.86439zM4.98996 4.82056L4.24567 2.78971 3.50138 4.82056H4.98996z", fillRule: "evenodd", clipRule: "evenodd" } }] }, hr = re(function(r, e) {
|
|
81
81
|
return ne(ie, Object.assign({}, r, {
|
|
82
82
|
id: "descending-single",
|
|
83
83
|
ref: e,
|
|
84
|
-
icon:
|
|
84
|
+
icon: jn
|
|
85
85
|
}));
|
|
86
86
|
});
|
|
87
87
|
hr.displayName = "DescendingSingle";
|
|
88
|
-
var
|
|
88
|
+
var Wn = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.85869 12.9216C8.38445 13.4708 7.61555 13.4708 7.14131 12.9216L0.358114 5.06726C-0.406895 4.18144 0.134916 2.66683 1.2168 2.66683L14.7832 2.66683C15.8651 2.66683 16.4069 4.18144 15.6419 5.06726L8.85869 12.9216Z" } }] }, je = re(function(r, e) {
|
|
89
89
|
return ne(ie, Object.assign({}, r, {
|
|
90
90
|
id: "dropdown-single",
|
|
91
91
|
ref: e,
|
|
92
|
-
icon:
|
|
92
|
+
icon: Wn
|
|
93
93
|
}));
|
|
94
94
|
});
|
|
95
95
|
je.displayName = "DropdownSingle";
|
|
96
|
-
var
|
|
96
|
+
var Zn = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3.33333 3.33333V6H6V3.33333H3.33333ZM2 3.238C2 2.55427 2.55427 2 3.238 2H6.09533C6.77906 2 7.33333 2.55427 7.33333 3.238V6.09533C7.33333 6.77906 6.77906 7.33333 6.09533 7.33333H3.238C2.55427 7.33333 2 6.77906 2 6.09533V3.238ZM10 3.33333V6H12.6667V3.33333H10ZM8.66667 3.238C8.66667 2.55427 9.22094 2 9.90467 2H12.762C13.4457 2 14 2.55427 14 3.238V6.09533C14 6.77906 13.4457 7.33333 12.762 7.33333H9.90467C9.22094 7.33333 8.66667 6.77906 8.66667 6.09533V3.238ZM3.33333 10V12.6667H6V10H3.33333ZM2 9.90467C2 9.22094 2.55427 8.66667 3.238 8.66667H6.09533C6.77906 8.66667 7.33333 9.22094 7.33333 9.90467V12.762C7.33333 13.4457 6.77906 14 6.09533 14H3.238C2.55427 14 2 13.4457 2 12.762V9.90467ZM10 10V12.6667H12.6667V10H10ZM8.66667 9.90467C8.66667 9.22094 9.22094 8.66667 9.90467 8.66667H12.762C13.4457 8.66667 14 9.22094 14 9.90467V12.762C14 13.4457 13.4457 14 12.762 14H9.90467C9.22094 14 8.66667 13.4457 8.66667 12.762V9.90467Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, vr = re(function(r, e) {
|
|
97
97
|
return ne(ie, Object.assign({}, r, {
|
|
98
98
|
id: "grid-outline-single",
|
|
99
99
|
ref: e,
|
|
100
|
-
icon:
|
|
100
|
+
icon: Zn
|
|
101
101
|
}));
|
|
102
102
|
});
|
|
103
103
|
vr.displayName = "GridOutlineSingle";
|
|
104
|
-
var
|
|
104
|
+
var qn = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Tt = re(function(r, e) {
|
|
105
105
|
return ne(ie, Object.assign({}, r, {
|
|
106
106
|
id: "more-down-single",
|
|
107
107
|
ref: e,
|
|
108
|
-
icon:
|
|
108
|
+
icon: qn
|
|
109
109
|
}));
|
|
110
110
|
});
|
|
111
|
-
|
|
112
|
-
var
|
|
111
|
+
Tt.displayName = "MoreDownSingle";
|
|
112
|
+
var Yn = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.01281 1.36643C8.79386 0.585377 10.0602 0.585378 10.8412 1.36643L12.9223 3.44752C13.7034 4.22857 13.7034 5.4949 12.9223 6.27595L9.36445 9.83383C8.5834 10.6149 7.31707 10.6149 6.53602 9.83383L4.45493 7.75273C3.67388 6.97168 3.67388 5.70535 4.45493 4.9243L8.01281 1.36643ZM9.9927 2.21495C9.68028 1.90253 9.17375 1.90253 8.86133 2.21495L5.30346 5.77283L5.29671 5.77966L10.839 6.66224L12.0738 5.42742C12.3862 5.115 12.3862 4.60847 12.0738 4.29605L9.9927 2.21495Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M14.5179 9.48875C14.5179 9.99175 14.1101 10.3995 13.607 10.3995C13.1041 10.3995 12.6963 9.99175 12.6963 9.48875C12.6963 9.1773 13.0455 8.59966 13.3114 8.20487C13.4549 7.99177 13.7591 7.99177 13.9027 8.20486C14.1687 8.59965 14.5179 9.1773 14.5179 9.48875Z" } }, { tag: "path", attrs: { fill: "colorChannel1", d: "M1.98682 13.4992C1.98682 12.5603 2.74793 11.7992 3.68682 11.7992H14.2868C15.2257 11.7992 15.9868 12.5603 15.9868 13.4992V13.4992C15.9868 14.4381 15.2257 15.1992 14.2868 15.1992H3.68682C2.74793 15.1992 1.98682 14.4381 1.98682 13.4992V13.4992Z" } }] }, br = re(function(r, e) {
|
|
113
113
|
return ne(ie, Object.assign({}, r, {
|
|
114
114
|
id: "paint-bucket",
|
|
115
115
|
ref: e,
|
|
116
|
-
icon:
|
|
116
|
+
icon: Yn
|
|
117
117
|
}));
|
|
118
118
|
});
|
|
119
|
-
|
|
120
|
-
var
|
|
119
|
+
br.displayName = "PaintBucket";
|
|
120
|
+
var Qn = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3.80068 2.57257L7.27955 2.57256C7.61092 2.57256 7.87954 2.30393 7.87954 1.97256C7.87954 1.64119 7.61091 1.37256 7.27954 1.37256L3.80068 1.37257C2.36473 1.37257 1.20067 2.53665 1.20068 3.97259L1.20074 12.3001C1.20075 13.736 2.36481 14.9 3.80074 14.9H12.1282C13.5641 14.9 14.7282 13.736 14.7282 12.3V8.82116C14.7282 8.48979 14.4595 8.22116 14.1282 8.22116C13.7968 8.22116 13.5282 8.48979 13.5282 8.82116V12.3C13.5282 13.0732 12.9014 13.7 12.1282 13.7H3.80074C3.02754 13.7 2.40074 13.0732 2.40074 12.3001L2.40068 3.97258C2.40068 3.19938 3.02748 2.57257 3.80068 2.57257Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M14.0072 2.0955C13.0997 1.18757 11.6278 1.18794 10.7207 2.09632L6.17749 6.646C6.10294 6.72065 6.04543 6.81056 6.00889 6.90954L4.59817 10.7315C4.51713 10.951 4.57116 11.1977 4.73657 11.3633C4.90198 11.5288 5.14858 11.5831 5.36823 11.5023L9.20237 10.0916C9.30186 10.055 9.3922 9.99722 9.46714 9.92224L14.0073 5.37972C14.9139 4.47266 14.9138 3.00252 14.0072 2.0955ZM11.5698 2.94424C12.0083 2.50513 12.7198 2.50496 13.1585 2.94384C13.5968 3.38229 13.5968 4.09294 13.1585 4.53141L8.69127 9.00102L6.1742 9.92713L7.09912 7.42132L11.5698 2.94424Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, gr = re(function(r, e) {
|
|
121
121
|
return ne(ie, Object.assign({}, r, {
|
|
122
122
|
id: "rename-single",
|
|
123
123
|
ref: e,
|
|
124
|
-
icon:
|
|
124
|
+
icon: Qn
|
|
125
125
|
}));
|
|
126
126
|
});
|
|
127
|
-
|
|
128
|
-
var
|
|
127
|
+
gr.displayName = "RenameSingle";
|
|
128
|
+
var zn = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M1.7643 4.13354C1.7643 2.82523 2.82488 1.76465 4.13319 1.76465H11.8665C13.1748 1.76465 14.2354 2.82524 14.2354 4.13354V11.8669C14.2354 13.1752 13.1748 14.2358 11.8665 14.2358H4.13318C2.82488 14.2358 1.7643 13.1752 1.7643 11.8669V6.1462C1.76388 6.13711 1.76367 6.12797 1.76367 6.11878C1.76367 6.10959 1.76388 6.10045 1.7643 6.09136V4.13354ZM2.94652 6.70989V11.8669C2.94652 12.5222 3.47781 13.0535 4.13318 13.0535H5.52732V6.70989H2.94652ZM5.52732 5.52767H2.94652V4.13354C2.94652 3.47816 3.47781 2.94687 4.13319 2.94687H5.52732V5.52767ZM6.70954 6.70989V13.0535H11.8665C12.5219 13.0535 13.0532 12.5222 13.0532 11.8669V6.70989L6.70954 6.70989ZM13.0532 5.52767L6.70954 5.52767V2.94687H11.8665C12.5219 2.94687 13.0532 3.47816 13.0532 4.13354V5.52767Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, mr = re(function(r, e) {
|
|
129
129
|
return ne(ie, Object.assign({}, r, {
|
|
130
130
|
id: "table-single",
|
|
131
131
|
ref: e,
|
|
132
|
-
icon:
|
|
132
|
+
icon: zn
|
|
133
133
|
}));
|
|
134
134
|
});
|
|
135
|
-
|
|
136
|
-
var fe = /* @__PURE__ */ ((r) => (r.Items = "items", r.Condition = "condition", r))(fe || {}),
|
|
137
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
135
|
+
mr.displayName = "TableSingle";
|
|
136
|
+
var fe = /* @__PURE__ */ ((r) => (r.Items = "items", r.Condition = "condition", r))(fe || {}), Gn = Object.getOwnPropertyDescriptor, Xn = (r, e, t, n) => {
|
|
137
|
+
for (var i = n > 1 ? void 0 : n ? Gn(e, t) : e, a = r.length - 1, s; a >= 0; a--)
|
|
138
138
|
(s = r[a]) && (i = s(i) || i);
|
|
139
139
|
return i;
|
|
140
140
|
}, ze = (r, e) => (t, n) => e(t, n, r);
|
|
141
|
-
let
|
|
141
|
+
let De = class extends Fe {
|
|
142
142
|
constructor(e, t, n, i) {
|
|
143
143
|
super();
|
|
144
|
-
|
|
144
|
+
A(this, "_itemsCache", /* @__PURE__ */ new Map());
|
|
145
145
|
this._tableManager = e, this._sheetTableService = t, this._univerInstanceService = n, this._commandService = i, this._registerTableFilterChangeEvent();
|
|
146
146
|
}
|
|
147
147
|
_registerTableFilterChangeEvent() {
|
|
148
148
|
this._commandService.onCommandExecuted((e) => {
|
|
149
|
-
if (e.id ===
|
|
149
|
+
if (e.id === wn.id) {
|
|
150
150
|
const { unitId: t, subUnitId: n, cellValue: i } = e.params, a = this._tableManager.getTablesBySubunitId(t, n);
|
|
151
151
|
if (!a.length)
|
|
152
152
|
return;
|
|
153
|
-
new Rr(i).forValue((c,
|
|
154
|
-
const u = Ht(c,
|
|
153
|
+
new Rr(i).forValue((c, d, h) => {
|
|
154
|
+
const u = Ht(c, d), b = a.find((S) => {
|
|
155
155
|
const C = S.getTableFilterRange();
|
|
156
156
|
return pe.intersects(C, u);
|
|
157
157
|
});
|
|
158
|
-
if (
|
|
159
|
-
const S =
|
|
160
|
-
this._itemsCache.delete(
|
|
158
|
+
if (b) {
|
|
159
|
+
const S = d - b.getRange().startColumn;
|
|
160
|
+
this._itemsCache.delete(b.getId() + S);
|
|
161
161
|
}
|
|
162
162
|
});
|
|
163
|
-
} else if (e.id ===
|
|
163
|
+
} else if (e.id === Mt.id) {
|
|
164
164
|
const { unitId: t, tableId: n } = e.params, i = this._tableManager.getTable(t, n);
|
|
165
165
|
if (!i)
|
|
166
166
|
return;
|
|
167
167
|
const a = i.getSubunitId();
|
|
168
168
|
this._tableManager.getTablesBySubunitId(t, a).forEach((c) => {
|
|
169
|
-
const
|
|
170
|
-
for (let
|
|
171
|
-
this._itemsCache.delete(c.getId() +
|
|
169
|
+
const d = c.getRange();
|
|
170
|
+
for (let h = d.startColumn; h <= d.endColumn; h++)
|
|
171
|
+
this._itemsCache.delete(c.getId() + h);
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
174
|
});
|
|
@@ -179,7 +179,7 @@ let Pe = class extends Be {
|
|
|
179
179
|
unitId: e,
|
|
180
180
|
subUnitId: t,
|
|
181
181
|
tableFilter: c,
|
|
182
|
-
currentFilterBy:
|
|
182
|
+
currentFilterBy: Hr(c) ? fe.Condition : fe.Items,
|
|
183
183
|
tableId: n,
|
|
184
184
|
columnIndex: i - s.startColumn
|
|
185
185
|
};
|
|
@@ -188,7 +188,7 @@ let Pe = class extends Be {
|
|
|
188
188
|
const i = this._tableManager.getTable(e, t), a = [];
|
|
189
189
|
if (i) {
|
|
190
190
|
const s = i.getTableFilterColumn(n);
|
|
191
|
-
s &&
|
|
191
|
+
s && Vr(s) && a.push(...s.values);
|
|
192
192
|
}
|
|
193
193
|
return a;
|
|
194
194
|
}
|
|
@@ -201,46 +201,46 @@ let Pe = class extends Be {
|
|
|
201
201
|
column: n,
|
|
202
202
|
tableFilter: i
|
|
203
203
|
};
|
|
204
|
-
this._commandService.executeCommand(
|
|
204
|
+
this._commandService.executeCommand(Mt.id, s);
|
|
205
205
|
}
|
|
206
206
|
getTableFilterItems(e, t, n, i) {
|
|
207
|
-
var
|
|
207
|
+
var O;
|
|
208
208
|
if (this._itemsCache.has(n + i))
|
|
209
209
|
return this._itemsCache.get(n + i) || { data: [], itemsCountMap: /* @__PURE__ */ new Map(), allItemsCount: 0 };
|
|
210
210
|
const a = this._tableManager.getTable(e, n);
|
|
211
211
|
if (!a)
|
|
212
212
|
return { data: [], itemsCountMap: /* @__PURE__ */ new Map(), allItemsCount: 0 };
|
|
213
|
-
const s = a.getTableFilterRange(), { startRow: c, endRow:
|
|
214
|
-
if (!
|
|
213
|
+
const s = a.getTableFilterRange(), { startRow: c, endRow: d, startColumn: h } = s, u = h + i, b = (O = this._univerInstanceService.getUnit(e)) == null ? void 0 : O.getSheetBySheetId(t);
|
|
214
|
+
if (!b)
|
|
215
215
|
return { data: [], itemsCountMap: /* @__PURE__ */ new Map(), allItemsCount: 0 };
|
|
216
216
|
const S = [], C = /* @__PURE__ */ new Map();
|
|
217
|
-
let
|
|
218
|
-
for (let p = c; p <=
|
|
219
|
-
if (
|
|
217
|
+
let T = 0;
|
|
218
|
+
for (let p = c; p <= d; p++) {
|
|
219
|
+
if (b.isRowFiltered(p))
|
|
220
220
|
continue;
|
|
221
|
-
const I = this._sheetTableService.getCellValueWithConditionType(
|
|
221
|
+
const I = this._sheetTableService.getCellValueWithConditionType(b, p, u);
|
|
222
222
|
C.has(I) || S.push({
|
|
223
223
|
title: I,
|
|
224
224
|
key: `${u}_${p}`,
|
|
225
225
|
leaf: !0
|
|
226
|
-
}),
|
|
226
|
+
}), T++, C.set(I, (C.get(I) || 0) + 1);
|
|
227
227
|
}
|
|
228
|
-
return this._itemsCache.set(n + i, { data: S, itemsCountMap: C, allItemsCount:
|
|
228
|
+
return this._itemsCache.set(n + i, { data: S, itemsCountMap: C, allItemsCount: T }), { data: S, itemsCountMap: C, allItemsCount: T };
|
|
229
229
|
}
|
|
230
230
|
};
|
|
231
|
-
|
|
232
|
-
ze(0,
|
|
233
|
-
ze(1,
|
|
234
|
-
ze(2,
|
|
231
|
+
De = Xn([
|
|
232
|
+
ze(0, N(te)),
|
|
233
|
+
ze(1, N(Fr)),
|
|
234
|
+
ze(2, N(Ce)),
|
|
235
235
|
ze(3, ee)
|
|
236
|
-
],
|
|
236
|
+
], De);
|
|
237
237
|
var j = /* @__PURE__ */ ((r) => (r.DatePicker = "DatePicker", r.DateRange = "DateRange", r.Input = "Input", r.Inputs = "Inputs", r.Select = "Select", r.None = "None", r))(j || {});
|
|
238
|
-
function
|
|
238
|
+
function Kn(r) {
|
|
239
239
|
const t = r.get(oe).t;
|
|
240
240
|
return [
|
|
241
241
|
{
|
|
242
|
-
value:
|
|
243
|
-
label: t(`sheets-table.condition.${
|
|
242
|
+
value: F.String,
|
|
243
|
+
label: t(`sheets-table.condition.${F.String}`),
|
|
244
244
|
children: [
|
|
245
245
|
{
|
|
246
246
|
value: U.Equal,
|
|
@@ -269,8 +269,8 @@ function Xn(r) {
|
|
|
269
269
|
]
|
|
270
270
|
},
|
|
271
271
|
{
|
|
272
|
-
value:
|
|
273
|
-
label: t(`sheets-table.condition.${
|
|
272
|
+
value: F.Number,
|
|
273
|
+
label: t(`sheets-table.condition.${F.Number}`),
|
|
274
274
|
children: [
|
|
275
275
|
{
|
|
276
276
|
value: $.Equal,
|
|
@@ -319,8 +319,8 @@ function Xn(r) {
|
|
|
319
319
|
]
|
|
320
320
|
},
|
|
321
321
|
{
|
|
322
|
-
value:
|
|
323
|
-
label: t(`sheets-table.condition.${
|
|
322
|
+
value: F.Date,
|
|
323
|
+
label: t(`sheets-table.condition.${F.Date}`),
|
|
324
324
|
children: [
|
|
325
325
|
{
|
|
326
326
|
value: l.Equal,
|
|
@@ -414,7 +414,7 @@ function Xn(r) {
|
|
|
414
414
|
}
|
|
415
415
|
];
|
|
416
416
|
}
|
|
417
|
-
function
|
|
417
|
+
function Jn(r, e) {
|
|
418
418
|
if (!e)
|
|
419
419
|
return [];
|
|
420
420
|
const n = r.get(oe).t;
|
|
@@ -493,7 +493,7 @@ function Kn(r, e) {
|
|
|
493
493
|
return [];
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
|
-
const
|
|
496
|
+
const yt = /* @__PURE__ */ new Set([
|
|
497
497
|
l.Equal,
|
|
498
498
|
l.NotEqual,
|
|
499
499
|
l.After,
|
|
@@ -501,18 +501,18 @@ const Tt = /* @__PURE__ */ new Set([
|
|
|
501
501
|
l.Before,
|
|
502
502
|
l.BeforeOrEqual
|
|
503
503
|
]);
|
|
504
|
-
function
|
|
505
|
-
return e ? r ===
|
|
504
|
+
function ei(r, e) {
|
|
505
|
+
return e ? r === F.String ? j.Input : r === F.Number ? e === $.Between || e === $.NotBetween ? j.Inputs : j.Input : r === F.Date ? e === l.Between || e === l.NotBetween ? j.DateRange : e === l.Quarter || e === l.Month ? j.Select : yt.has(e) ? j.DatePicker : j.None : j.None : j.None;
|
|
506
506
|
}
|
|
507
|
-
function
|
|
507
|
+
function ti(r) {
|
|
508
508
|
if (!r || r.filterType !== "condition")
|
|
509
509
|
return {
|
|
510
|
-
type:
|
|
510
|
+
type: F.String,
|
|
511
511
|
compareType: U.Equal,
|
|
512
512
|
info: {}
|
|
513
513
|
};
|
|
514
514
|
const e = r.filterInfo, { conditionType: t, compareType: n } = e;
|
|
515
|
-
return t ===
|
|
515
|
+
return t === F.Date ? n === l.Between || n === l.NotBetween ? {
|
|
516
516
|
type: t,
|
|
517
517
|
compare: n,
|
|
518
518
|
info: {
|
|
@@ -522,7 +522,7 @@ function ei(r) {
|
|
|
522
522
|
type: t,
|
|
523
523
|
compare: n,
|
|
524
524
|
info: {}
|
|
525
|
-
} :
|
|
525
|
+
} : yt.has(n) ? {
|
|
526
526
|
type: t,
|
|
527
527
|
compare: n,
|
|
528
528
|
info: {
|
|
@@ -540,7 +540,7 @@ function ei(r) {
|
|
|
540
540
|
info: {
|
|
541
541
|
dateSelect: e.compareType
|
|
542
542
|
}
|
|
543
|
-
} : t ===
|
|
543
|
+
} : t === F.Number ? n === $.Between || n === $.NotBetween ? {
|
|
544
544
|
type: t,
|
|
545
545
|
compare: n,
|
|
546
546
|
info: {
|
|
@@ -552,43 +552,45 @@ function ei(r) {
|
|
|
552
552
|
info: {
|
|
553
553
|
number: e.expectedValue
|
|
554
554
|
}
|
|
555
|
-
} : t ===
|
|
555
|
+
} : t === F.String ? {
|
|
556
556
|
type: t,
|
|
557
557
|
compare: n,
|
|
558
558
|
info: {
|
|
559
559
|
string: e.expectedValue
|
|
560
560
|
}
|
|
561
561
|
} : {
|
|
562
|
-
type:
|
|
562
|
+
type: F.String,
|
|
563
563
|
compare: U.Equal,
|
|
564
564
|
info: {}
|
|
565
565
|
};
|
|
566
566
|
}
|
|
567
|
-
const
|
|
568
|
-
var C,
|
|
569
|
-
const { conditionInfo: e, onChange: t } = r, n = R(oe), [i, a] = W(
|
|
570
|
-
var f;
|
|
571
|
-
const m = b[0], L = b[1];
|
|
572
|
-
L && a(Math.random());
|
|
573
|
-
const M = {};
|
|
574
|
-
m === H.Date ? L === l.Quarter ? M.dateSelect = l.Q1 : L === l.Month ? M.dateSelect = l.M1 : Tt.has(L) ? M.date = /* @__PURE__ */ new Date() : M.dateRange = [/* @__PURE__ */ new Date(), /* @__PURE__ */ new Date()] : m === H.Number ? M.number = 0 : m === H.String && (M.string = ""), v(M, b[0], (f = b[1]) != null ? f : U.Equal);
|
|
575
|
-
}, d = Jn(e.type, e.compare);
|
|
576
|
-
let u = "";
|
|
577
|
-
e.compare ? u = `${n.t(`sheets-table.condition.${e.type}`)} - ${n.t(`sheets-table.${e.type}.compare.${e.compare}`)}` : u = n.t(`sheets-table.condition.${e.type}`);
|
|
578
|
-
const v = (b, m, L) => {
|
|
567
|
+
const ri = (r) => {
|
|
568
|
+
var C, T, O, p, E, I, k;
|
|
569
|
+
const { conditionInfo: e, onChange: t } = r, n = R(oe), [i, a] = W(!1), s = R(He), c = Kn(s), d = (v, m, L) => {
|
|
579
570
|
t({
|
|
580
571
|
type: m != null ? m : e.type,
|
|
581
572
|
compare: L != null ? L : e.compare,
|
|
582
|
-
info:
|
|
573
|
+
info: v
|
|
583
574
|
});
|
|
584
|
-
},
|
|
585
|
-
|
|
575
|
+
}, h = (v) => {
|
|
576
|
+
var f;
|
|
577
|
+
const m = v[0], L = v[1];
|
|
578
|
+
L && a(!1);
|
|
579
|
+
const M = {};
|
|
580
|
+
m === F.Date ? L === l.Quarter ? M.dateSelect = l.Q1 : L === l.Month ? M.dateSelect = l.M1 : yt.has(L) ? M.date = /* @__PURE__ */ new Date() : M.dateRange = [/* @__PURE__ */ new Date(), /* @__PURE__ */ new Date()] : m === F.Number ? M.number = 0 : m === F.String && (M.string = ""), d(M, v[0], (f = v[1]) != null ? f : U.Equal);
|
|
581
|
+
}, u = ei(e.type, e.compare);
|
|
582
|
+
let b = "";
|
|
583
|
+
e.compare ? b = `${n.t(`sheets-table.condition.${e.type}`)} - ${n.t(`sheets-table.${e.type}.compare.${e.compare}`)}` : b = n.t(`sheets-table.condition.${e.type}`);
|
|
584
|
+
const S = Jn(s, e.compare);
|
|
585
|
+
return /* @__PURE__ */ _("div", { children: [
|
|
586
586
|
/* @__PURE__ */ o(
|
|
587
|
-
|
|
587
|
+
ke,
|
|
588
588
|
{
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
589
|
+
align: "start",
|
|
590
|
+
open: i,
|
|
591
|
+
onOpenChange: a,
|
|
592
|
+
overlay: /* @__PURE__ */ o(
|
|
593
|
+
pn,
|
|
592
594
|
{
|
|
593
595
|
value: [e.type, e.compare],
|
|
594
596
|
options: c,
|
|
@@ -597,20 +599,33 @@ const ti = (r) => {
|
|
|
597
599
|
wrapperClassName: "!univer-h-[150px]"
|
|
598
600
|
}
|
|
599
601
|
),
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
602
|
+
children: /* @__PURE__ */ _(
|
|
603
|
+
"div",
|
|
604
|
+
{
|
|
605
|
+
className: `
|
|
606
|
+
univer-box-border univer-flex univer-h-8 univer-w-full univer-items-center univer-justify-between
|
|
607
|
+
univer-rounded-md univer-border univer-border-solid univer-border-gray-200 univer-bg-white
|
|
608
|
+
univer-px-2 univer-text-sm univer-transition-colors univer-duration-200
|
|
609
|
+
dark:univer-border-gray-600 dark:univer-bg-gray-700 dark:univer-text-white
|
|
610
|
+
focus:univer-border-primary-600 focus:univer-outline-none focus:univer-ring-2
|
|
611
|
+
hover:univer-border-primary-600
|
|
612
|
+
`,
|
|
613
|
+
children: [
|
|
614
|
+
/* @__PURE__ */ o("span", { children: b }),
|
|
615
|
+
/* @__PURE__ */ o(Tt, { className: "univer-text-gray-400" })
|
|
616
|
+
]
|
|
617
|
+
}
|
|
618
|
+
)
|
|
619
|
+
}
|
|
605
620
|
),
|
|
606
|
-
/* @__PURE__ */
|
|
607
|
-
|
|
621
|
+
/* @__PURE__ */ _("div", { className: "univer-mt-3 univer-w-full", children: [
|
|
622
|
+
u === j.Input && /* @__PURE__ */ o(St, { children: e.type === F.String ? /* @__PURE__ */ o(
|
|
608
623
|
_t,
|
|
609
624
|
{
|
|
610
625
|
className: "univer-w-full",
|
|
611
626
|
placeholder: "请输入",
|
|
612
627
|
value: e.info.string,
|
|
613
|
-
onChange: (
|
|
628
|
+
onChange: (v) => d({ string: v })
|
|
614
629
|
}
|
|
615
630
|
) : /* @__PURE__ */ o(
|
|
616
631
|
ct,
|
|
@@ -618,44 +633,44 @@ const ti = (r) => {
|
|
|
618
633
|
className: "univer-h-7 univer-w-full",
|
|
619
634
|
value: e.info.number,
|
|
620
635
|
controls: !1,
|
|
621
|
-
onChange: (
|
|
622
|
-
|
|
636
|
+
onChange: (v) => {
|
|
637
|
+
v !== null && d({ number: v });
|
|
623
638
|
}
|
|
624
639
|
}
|
|
625
640
|
) }),
|
|
626
|
-
|
|
627
|
-
|
|
641
|
+
u === j.DatePicker && /* @__PURE__ */ o("div", { id: "univer-table-date-picker-wrapper", style: { background: "#fff", position: "relative" }, children: /* @__PURE__ */ o(
|
|
642
|
+
fn,
|
|
628
643
|
{
|
|
629
644
|
value: ve(e.info.date),
|
|
630
645
|
defaultPickerValue: ve(),
|
|
631
|
-
onChange: (
|
|
646
|
+
onChange: (v) => d({ date: v.toDate() }),
|
|
632
647
|
getPopupContainer: () => document.getElementById("univer-table-date-picker-wrapper") || document.body,
|
|
633
648
|
className: "univer-w-full",
|
|
634
649
|
allowClear: !1
|
|
635
650
|
}
|
|
636
651
|
) }),
|
|
637
|
-
|
|
638
|
-
|
|
652
|
+
u === j.DateRange && /* @__PURE__ */ o("div", { id: "univer-table-date-range-wrapper", style: { background: "#fff", position: "relative" }, children: /* @__PURE__ */ o(
|
|
653
|
+
Cn,
|
|
639
654
|
{
|
|
640
|
-
value: [(
|
|
655
|
+
value: [(T = ve((C = e.info.dateRange) == null ? void 0 : C[0])) != null ? T : ve(), (p = ve((O = e.info.dateRange) == null ? void 0 : O[1])) != null ? p : ve()],
|
|
641
656
|
defaultPickerValue: [ve(), ve()],
|
|
642
|
-
onChange: (
|
|
643
|
-
v
|
|
657
|
+
onChange: (v) => {
|
|
658
|
+
d(v ? { dateRange: v.map((m) => m == null ? void 0 : m.toDate()) } : {});
|
|
644
659
|
},
|
|
645
660
|
getPopupContainer: () => document.getElementById("univer-table-date-range-wrapper") || document.body,
|
|
646
661
|
classNames: { popup: "univer-w-[400px]" },
|
|
647
662
|
allowClear: !1
|
|
648
663
|
}
|
|
649
664
|
) }),
|
|
650
|
-
|
|
665
|
+
u === j.Inputs && /* @__PURE__ */ _("div", { className: "univer-flex univer-items-center univer-gap-2", children: [
|
|
651
666
|
/* @__PURE__ */ o(
|
|
652
667
|
ct,
|
|
653
668
|
{
|
|
654
669
|
className: "univer-w-full",
|
|
655
670
|
value: (E = e.info.numberRange) == null ? void 0 : E[0],
|
|
656
|
-
onChange: (
|
|
671
|
+
onChange: (v) => {
|
|
657
672
|
var m;
|
|
658
|
-
|
|
673
|
+
v !== null && d({ numberRange: [v, (m = e.info.numberRange) == null ? void 0 : m[1]] });
|
|
659
674
|
},
|
|
660
675
|
controls: !1
|
|
661
676
|
}
|
|
@@ -667,51 +682,51 @@ const ti = (r) => {
|
|
|
667
682
|
className: "univer-w-full",
|
|
668
683
|
value: (I = e.info.numberRange) == null ? void 0 : I[1],
|
|
669
684
|
controls: !1,
|
|
670
|
-
onChange: (
|
|
685
|
+
onChange: (v) => {
|
|
671
686
|
var m;
|
|
672
|
-
|
|
687
|
+
v !== null && d({ numberRange: [(m = e.info.numberRange) == null ? void 0 : m[0], v] });
|
|
673
688
|
}
|
|
674
689
|
}
|
|
675
690
|
)
|
|
676
691
|
] }),
|
|
677
|
-
|
|
678
|
-
|
|
692
|
+
u === j.Select && /* @__PURE__ */ o(
|
|
693
|
+
Sn,
|
|
679
694
|
{
|
|
680
695
|
className: "univer-w-full",
|
|
681
|
-
value: (
|
|
696
|
+
value: (k = e.info.dateSelect) != null ? k : S[0].value,
|
|
682
697
|
options: S,
|
|
683
|
-
onChange: (
|
|
698
|
+
onChange: (v) => d({ dateSelect: v })
|
|
684
699
|
}
|
|
685
700
|
)
|
|
686
701
|
] })
|
|
687
702
|
] });
|
|
688
|
-
},
|
|
703
|
+
}, ni = (r) => {
|
|
689
704
|
let e = 0;
|
|
690
705
|
return r.forEach((t) => {
|
|
691
706
|
e += t;
|
|
692
707
|
}), e;
|
|
693
708
|
};
|
|
694
|
-
function
|
|
695
|
-
const { unitId: e, tableId: t, subUnitId: n, columnIndex: i, checkedItemSet: a, setCheckedItemSet: s, tableFilter: c } = r,
|
|
696
|
-
C ? (a.clear(), s(new Set(a)),
|
|
709
|
+
function ii(r) {
|
|
710
|
+
const { unitId: e, tableId: t, subUnitId: n, columnIndex: i, checkedItemSet: a, setCheckedItemSet: s, tableFilter: c } = r, d = R(oe), h = R(De), { data: u, itemsCountMap: b, allItemsCount: S } = h.getTableFilterItems(e, n, t, i), [C, T] = W(c === void 0 ? !0 : a.size === b.size), [O, p] = W(C ? S : ni(b)), E = !C && a.size > 0, [I, k] = W(""), v = ar(() => I ? u.filter((f) => String(f.title).toLowerCase().includes(I.toLowerCase())) : u, [I, u]), m = Pt(() => {
|
|
711
|
+
C ? (a.clear(), s(new Set(a)), T(!1)) : (v.forEach((f) => {
|
|
697
712
|
a.add(f.title);
|
|
698
|
-
}), s(new Set(a)),
|
|
699
|
-
}, [C]), L =
|
|
700
|
-
f === "" ? (
|
|
701
|
-
a.add(
|
|
702
|
-
}), p(S)) : (a.clear(),
|
|
713
|
+
}), s(new Set(a)), T(!0));
|
|
714
|
+
}, [C]), L = Pt((f) => {
|
|
715
|
+
f === "" ? (T(!0), u.forEach((V) => {
|
|
716
|
+
a.add(V.title);
|
|
717
|
+
}), p(S)) : (a.clear(), T(!1), p(0)), k(f);
|
|
703
718
|
}, []), M = (f) => {
|
|
704
719
|
if (C) {
|
|
705
|
-
|
|
706
|
-
const
|
|
707
|
-
for (const { title:
|
|
708
|
-
f !==
|
|
709
|
-
p(S -
|
|
720
|
+
T(!1);
|
|
721
|
+
const V = /* @__PURE__ */ new Set();
|
|
722
|
+
for (const { title: P } of u)
|
|
723
|
+
f !== P && V.add(P);
|
|
724
|
+
p(S - b.get(f)), s(V);
|
|
710
725
|
} else
|
|
711
|
-
a.has(f) ? (a.delete(f), p(
|
|
726
|
+
a.has(f) ? (a.delete(f), p(O - b.get(f))) : (a.add(f), p(O + b.get(f))), s(new Set(a));
|
|
712
727
|
};
|
|
713
|
-
return /* @__PURE__ */
|
|
714
|
-
/* @__PURE__ */ o(_t, { autoFocus: !0, value: I, placeholder:
|
|
728
|
+
return /* @__PURE__ */ _("div", { className: "univer-flex univer-h-full univer-flex-col", children: [
|
|
729
|
+
/* @__PURE__ */ o(_t, { autoFocus: !0, value: I, placeholder: d.t("sheets-filter.panel.search-placeholder"), onChange: L }),
|
|
715
730
|
/* @__PURE__ */ o(
|
|
716
731
|
"div",
|
|
717
732
|
{
|
|
@@ -723,15 +738,15 @@ function ni(r) {
|
|
|
723
738
|
children: /* @__PURE__ */ o(
|
|
724
739
|
"div",
|
|
725
740
|
{
|
|
726
|
-
className:
|
|
727
|
-
children: /* @__PURE__ */
|
|
728
|
-
/* @__PURE__ */
|
|
741
|
+
className: _n("univer-h-40 univer-overflow-y-auto univer-py-1 univer-pl-2", Tn),
|
|
742
|
+
children: /* @__PURE__ */ _("div", { className: "univer-h-full", children: [
|
|
743
|
+
/* @__PURE__ */ _(
|
|
729
744
|
"div",
|
|
730
745
|
{
|
|
731
746
|
className: "univer-flex univer-items-center univer-px-2 univer-py-1",
|
|
732
747
|
children: [
|
|
733
748
|
/* @__PURE__ */ o(
|
|
734
|
-
|
|
749
|
+
Et,
|
|
735
750
|
{
|
|
736
751
|
indeterminate: E,
|
|
737
752
|
disabled: u.length === 0,
|
|
@@ -739,30 +754,30 @@ function ni(r) {
|
|
|
739
754
|
onChange: m
|
|
740
755
|
}
|
|
741
756
|
),
|
|
742
|
-
/* @__PURE__ */
|
|
757
|
+
/* @__PURE__ */ _(
|
|
743
758
|
"div",
|
|
744
759
|
{
|
|
745
760
|
className: `
|
|
746
761
|
univer-ml-1 univer-flex univer-h-5 univer-flex-1 univer-items-center univer-text-sm
|
|
747
762
|
`,
|
|
748
763
|
children: [
|
|
749
|
-
/* @__PURE__ */ o("span", { className: "univer-inline-block univer-truncate", children: `${
|
|
750
|
-
/* @__PURE__ */ o("span", { className: "univer-ml univer-text-gray-400", children: `(${
|
|
764
|
+
/* @__PURE__ */ o("span", { className: "univer-inline-block univer-truncate", children: `${d.t("sheets-filter.panel.select-all")}` }),
|
|
765
|
+
/* @__PURE__ */ o("span", { className: "univer-ml univer-text-gray-400", children: `(${O}/${I ? v.length : S})` })
|
|
751
766
|
]
|
|
752
767
|
}
|
|
753
768
|
)
|
|
754
769
|
]
|
|
755
770
|
}
|
|
756
771
|
),
|
|
757
|
-
|
|
772
|
+
v.map((f) => /* @__PURE__ */ _(
|
|
758
773
|
"div",
|
|
759
774
|
{
|
|
760
775
|
className: "univer-flex univer-items-center univer-px-2 univer-py-1",
|
|
761
776
|
children: [
|
|
762
|
-
/* @__PURE__ */ o(
|
|
777
|
+
/* @__PURE__ */ o(Et, { checked: C || a.has(f.title), onChange: () => {
|
|
763
778
|
M(f.title);
|
|
764
779
|
} }),
|
|
765
|
-
/* @__PURE__ */
|
|
780
|
+
/* @__PURE__ */ _(
|
|
766
781
|
"div",
|
|
767
782
|
{
|
|
768
783
|
className: `
|
|
@@ -771,7 +786,7 @@ function ni(r) {
|
|
|
771
786
|
`,
|
|
772
787
|
children: [
|
|
773
788
|
/* @__PURE__ */ o("span", { className: "univer-inline-block univer-truncate", children: f.title }),
|
|
774
|
-
/* @__PURE__ */ o("span", { className: "univer-ml-1 univer-text-gray-400", children: `(${
|
|
789
|
+
/* @__PURE__ */ o("span", { className: "univer-ml-1 univer-text-gray-400", children: `(${b.get(f.title) || 0})` })
|
|
775
790
|
]
|
|
776
791
|
}
|
|
777
792
|
)
|
|
@@ -786,68 +801,68 @@ function ni(r) {
|
|
|
786
801
|
)
|
|
787
802
|
] });
|
|
788
803
|
}
|
|
789
|
-
function
|
|
790
|
-
var
|
|
791
|
-
const r = R(oe), e =
|
|
792
|
-
const
|
|
793
|
-
return
|
|
794
|
-
}), M = n.getTable(
|
|
804
|
+
function ai() {
|
|
805
|
+
var H;
|
|
806
|
+
const r = R(oe), e = si(r), t = R(De), n = R(te), i = R(ee), a = R(Vt), s = R(Be), c = s.getCurrentTableFilterInfo(), d = t.getTableFilterPanelInitProps(c.unitId, c.subUnitId, c.tableId, c.column), { unitId: h, subUnitId: u, tableId: b, tableFilter: S, currentFilterBy: C, columnIndex: T } = d, { data: O } = t.getTableFilterItems(h, u, b, T), p = t.getTableFilterCheckedItems(h, b, T), [E, I] = W(new Set(p)), [k, v] = W(C || fe.Items), [m, L] = W(() => {
|
|
807
|
+
const x = d.tableFilter;
|
|
808
|
+
return ti(x);
|
|
809
|
+
}), M = n.getTable(h, b);
|
|
795
810
|
if (!M) return null;
|
|
796
|
-
const f = M.getTableFilters(),
|
|
811
|
+
const f = M.getTableFilters(), V = f.getSortState(), P = V.columnIndex === T && V.sortState === Ye.Asc, q = V.columnIndex === T && V.sortState === Ye.Desc, D = () => {
|
|
797
812
|
s.closeFilterPanel();
|
|
798
813
|
}, K = () => {
|
|
799
814
|
D();
|
|
800
|
-
}, Se = (
|
|
815
|
+
}, Se = (x) => {
|
|
801
816
|
const B = M.getTableFilterRange();
|
|
802
817
|
i.executeCommand(Nn.id, {
|
|
803
|
-
unitId:
|
|
818
|
+
unitId: h,
|
|
804
819
|
subUnitId: u,
|
|
805
820
|
range: B,
|
|
806
|
-
orderRules: [{ colIndex:
|
|
821
|
+
orderRules: [{ colIndex: T + B.startColumn, type: x ? Ot.ASC : Ot.DESC }],
|
|
807
822
|
hasTitle: !1
|
|
808
|
-
}), f.setSortState(
|
|
823
|
+
}), f.setSortState(T, x ? Ye.Asc : Ye.Desc), D();
|
|
809
824
|
}, Ee = () => {
|
|
810
|
-
if (
|
|
811
|
-
const
|
|
812
|
-
for (const ce of
|
|
813
|
-
E.has(ce.title) &&
|
|
814
|
-
const B = M.getTableFilterColumn(
|
|
825
|
+
if (k === fe.Items) {
|
|
826
|
+
const x = [];
|
|
827
|
+
for (const ce of O)
|
|
828
|
+
E.has(ce.title) && x.push(ce.title);
|
|
829
|
+
const B = M.getTableFilterColumn(T);
|
|
815
830
|
if (B) {
|
|
816
|
-
if (B.values.join(",") ===
|
|
831
|
+
if (B.values.join(",") === x.join(",")) {
|
|
817
832
|
D();
|
|
818
833
|
return;
|
|
819
834
|
}
|
|
820
|
-
} else if (
|
|
835
|
+
} else if (x.length === 0) {
|
|
821
836
|
D();
|
|
822
837
|
return;
|
|
823
838
|
}
|
|
824
|
-
const
|
|
825
|
-
filterType:
|
|
826
|
-
values:
|
|
839
|
+
const Ve = {
|
|
840
|
+
filterType: Rt.manual,
|
|
841
|
+
values: x
|
|
827
842
|
};
|
|
828
|
-
t.setTableFilter(
|
|
843
|
+
t.setTableFilter(h, b, T, Ve);
|
|
829
844
|
} else {
|
|
830
|
-
let
|
|
831
|
-
m.compare === l.Quarter || m.compare === l.Month ?
|
|
845
|
+
let x;
|
|
846
|
+
m.compare === l.Quarter || m.compare === l.Month ? x = {
|
|
832
847
|
conditionType: m.type,
|
|
833
848
|
compareType: Object.values(m.info)[0]
|
|
834
|
-
} :
|
|
849
|
+
} : x = {
|
|
835
850
|
conditionType: m.type,
|
|
836
851
|
compareType: m.compare,
|
|
837
852
|
expectedValue: Object.values(m.info)[0]
|
|
838
853
|
};
|
|
839
854
|
const B = {
|
|
840
|
-
filterType:
|
|
855
|
+
filterType: Rt.condition,
|
|
841
856
|
// @ts-ignore
|
|
842
|
-
filterInfo:
|
|
857
|
+
filterInfo: x
|
|
843
858
|
};
|
|
844
|
-
t.setTableFilter(
|
|
859
|
+
t.setTableFilter(h, b, T, B);
|
|
845
860
|
}
|
|
846
861
|
D();
|
|
847
862
|
}, _e = () => {
|
|
848
|
-
t.setTableFilter(
|
|
849
|
-
}, Te = new er(
|
|
850
|
-
return /* @__PURE__ */
|
|
863
|
+
t.setTableFilter(h, b, T, void 0), D();
|
|
864
|
+
}, Te = new er(h).id, w = (H = a.getPermissionPoint(Te)) == null ? void 0 : H.value;
|
|
865
|
+
return /* @__PURE__ */ _(
|
|
851
866
|
"div",
|
|
852
867
|
{
|
|
853
868
|
className: `
|
|
@@ -855,8 +870,8 @@ function ii() {
|
|
|
855
870
|
univer-p-4 univer-shadow-lg
|
|
856
871
|
`,
|
|
857
872
|
children: [
|
|
858
|
-
w && /* @__PURE__ */
|
|
859
|
-
/* @__PURE__ */
|
|
873
|
+
w && /* @__PURE__ */ _("div", { className: "univer-mb-3 univer-flex", children: [
|
|
874
|
+
/* @__PURE__ */ _(
|
|
860
875
|
"div",
|
|
861
876
|
{
|
|
862
877
|
className: `
|
|
@@ -864,7 +879,7 @@ function ii() {
|
|
|
864
879
|
univer-justify-center univer-gap-1 univer-rounded-l-md univer-border univer-border-solid
|
|
865
880
|
univer-border-gray-200 univer-py-1.5 univer-text-[13px] univer-font-normal
|
|
866
881
|
hover:univer-cursor-pointer hover:univer-bg-gray-100
|
|
867
|
-
${
|
|
882
|
+
${P ? "univer-bg-gray-100" : ""}
|
|
868
883
|
`,
|
|
869
884
|
onClick: () => Se(!0),
|
|
870
885
|
children: [
|
|
@@ -873,7 +888,7 @@ function ii() {
|
|
|
873
888
|
]
|
|
874
889
|
}
|
|
875
890
|
),
|
|
876
|
-
/* @__PURE__ */
|
|
891
|
+
/* @__PURE__ */ _(
|
|
877
892
|
"div",
|
|
878
893
|
{
|
|
879
894
|
className: `
|
|
@@ -892,37 +907,37 @@ function ii() {
|
|
|
892
907
|
)
|
|
893
908
|
] }),
|
|
894
909
|
/* @__PURE__ */ o("div", { className: "univer-w-full", children: /* @__PURE__ */ o(
|
|
895
|
-
|
|
910
|
+
yn,
|
|
896
911
|
{
|
|
897
|
-
value:
|
|
912
|
+
value: k,
|
|
898
913
|
items: e,
|
|
899
|
-
onChange: (
|
|
914
|
+
onChange: (x) => v(x)
|
|
900
915
|
}
|
|
901
916
|
) }),
|
|
902
|
-
/* @__PURE__ */ o("div", { className: "univer-z-10 univer-h-60 univer-w-[280px]", children: /* @__PURE__ */ o("div", { className: "univer-mt-3 univer-h-full univer-w-full", children:
|
|
903
|
-
|
|
917
|
+
/* @__PURE__ */ o("div", { className: "univer-z-10 univer-h-60 univer-w-[280px]", children: /* @__PURE__ */ o("div", { className: "univer-mt-3 univer-h-full univer-w-full", children: k === fe.Items ? /* @__PURE__ */ o(
|
|
918
|
+
ii,
|
|
904
919
|
{
|
|
905
920
|
tableFilter: S,
|
|
906
|
-
unitId:
|
|
921
|
+
unitId: h,
|
|
907
922
|
subUnitId: u,
|
|
908
|
-
tableId:
|
|
909
|
-
columnIndex:
|
|
923
|
+
tableId: b,
|
|
924
|
+
columnIndex: T,
|
|
910
925
|
checkedItemSet: E,
|
|
911
926
|
setCheckedItemSet: I
|
|
912
927
|
}
|
|
913
928
|
) : /* @__PURE__ */ o(
|
|
914
|
-
|
|
929
|
+
ri,
|
|
915
930
|
{
|
|
916
931
|
tableFilter: S,
|
|
917
|
-
unitId:
|
|
932
|
+
unitId: h,
|
|
918
933
|
subUnitId: u,
|
|
919
|
-
tableId:
|
|
920
|
-
columnIndex:
|
|
934
|
+
tableId: b,
|
|
935
|
+
columnIndex: T,
|
|
921
936
|
conditionInfo: m,
|
|
922
937
|
onChange: L
|
|
923
938
|
}
|
|
924
939
|
) }) }),
|
|
925
|
-
/* @__PURE__ */
|
|
940
|
+
/* @__PURE__ */ _(
|
|
926
941
|
"div",
|
|
927
942
|
{
|
|
928
943
|
className: `
|
|
@@ -938,7 +953,7 @@ function ii() {
|
|
|
938
953
|
children: r.t("sheets-filter.panel.clear-filter")
|
|
939
954
|
}
|
|
940
955
|
),
|
|
941
|
-
/* @__PURE__ */
|
|
956
|
+
/* @__PURE__ */ _("div", { children: [
|
|
942
957
|
/* @__PURE__ */ o(We, { className: "univer-mr-2", onClick: K, children: r.t("sheets-filter.panel.cancel") }),
|
|
943
958
|
/* @__PURE__ */ o(We, { variant: "primary", onClick: Ee, children: r.t("sheets-filter.panel.confirm") })
|
|
944
959
|
] })
|
|
@@ -949,23 +964,23 @@ function ii() {
|
|
|
949
964
|
}
|
|
950
965
|
);
|
|
951
966
|
}
|
|
952
|
-
function
|
|
967
|
+
function si(r) {
|
|
953
968
|
const e = r.getCurrentLocale();
|
|
954
969
|
return ar(() => [
|
|
955
970
|
{ label: r.t("sheets-filter.panel.by-values"), value: fe.Items },
|
|
956
971
|
{ label: r.t("sheets-filter.panel.by-conditions"), value: fe.Condition }
|
|
957
972
|
], [e, r]);
|
|
958
973
|
}
|
|
959
|
-
var
|
|
960
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
974
|
+
var li = Object.getOwnPropertyDescriptor, oi = (r, e, t, n) => {
|
|
975
|
+
for (var i = n > 1 ? void 0 : n ? li(e, t) : e, a = r.length - 1, s; a >= 0; a--)
|
|
961
976
|
(s = r[a]) && (i = s(i) || i);
|
|
962
977
|
return i;
|
|
963
978
|
}, Ge = (r, e) => (t, n) => e(t, n, r);
|
|
964
|
-
let
|
|
979
|
+
let Be = class extends Fe {
|
|
965
980
|
constructor(e, t, n, i) {
|
|
966
981
|
super();
|
|
967
|
-
|
|
968
|
-
|
|
982
|
+
A(this, "_popupDisposable");
|
|
983
|
+
A(this, "_currentTableFilterInfo", null);
|
|
969
984
|
this._componentManager = e, this._contextService = t, this._sheetCanvasPopupService = n, this._dialogService = i, this._initComponents(), this._initUIPopup();
|
|
970
985
|
}
|
|
971
986
|
setCurrentTableFilterInfo(e) {
|
|
@@ -979,13 +994,13 @@ let De = class extends Be {
|
|
|
979
994
|
}
|
|
980
995
|
_initComponents() {
|
|
981
996
|
[
|
|
982
|
-
[ge,
|
|
997
|
+
[ge, ai]
|
|
983
998
|
].forEach(([e, t]) => {
|
|
984
999
|
this.disposeWithMe(this._componentManager.register(e, t));
|
|
985
1000
|
});
|
|
986
1001
|
}
|
|
987
1002
|
_initUIPopup() {
|
|
988
|
-
this.disposeWithMe(this._contextService.subscribeContextValue$(ge).pipe(Jt(void 0),
|
|
1003
|
+
this.disposeWithMe(this._contextService.subscribeContextValue$(ge).pipe(Jt(void 0), dn()).subscribe((e) => {
|
|
989
1004
|
e ? this._openFilterPopup() : e === !1 && this._closeFilterPopup();
|
|
990
1005
|
}));
|
|
991
1006
|
}
|
|
@@ -1001,7 +1016,7 @@ let De = class extends Be {
|
|
|
1001
1016
|
componentKey: ge,
|
|
1002
1017
|
direction: "horizontal",
|
|
1003
1018
|
onClickOutside: () => {
|
|
1004
|
-
this._dialogService.close(
|
|
1019
|
+
this._dialogService.close(Pn), this._contextService.setContextValue(ge, !1);
|
|
1005
1020
|
},
|
|
1006
1021
|
offset: [5, 0]
|
|
1007
1022
|
});
|
|
@@ -1011,22 +1026,22 @@ let De = class extends Be {
|
|
|
1011
1026
|
(e = this._popupDisposable) == null || e.dispose(), this._popupDisposable = null, this.clearCurrentTableFilterInfo();
|
|
1012
1027
|
}
|
|
1013
1028
|
};
|
|
1014
|
-
|
|
1015
|
-
Ge(0,
|
|
1029
|
+
Be = oi([
|
|
1030
|
+
Ge(0, N(Xt)),
|
|
1016
1031
|
Ge(1, ft),
|
|
1017
|
-
Ge(2,
|
|
1018
|
-
Ge(3,
|
|
1019
|
-
],
|
|
1032
|
+
Ge(2, N(Qr)),
|
|
1033
|
+
Ge(3, N(Kt))
|
|
1034
|
+
], Be);
|
|
1020
1035
|
const bt = {
|
|
1021
1036
|
type: At.OPERATION,
|
|
1022
1037
|
id: "sheet.operation.open-table-filter-panel",
|
|
1023
1038
|
async handler(r, e) {
|
|
1024
1039
|
if (!e)
|
|
1025
1040
|
return !1;
|
|
1026
|
-
const { row: t, col: n, unitId: i, subUnitId: a, tableId: s } = e, c = r.get(te),
|
|
1027
|
-
return c.getTable(i, s) ? (
|
|
1041
|
+
const { row: t, col: n, unitId: i, subUnitId: a, tableId: s } = e, c = r.get(te), d = r.get(ft), h = r.get(Be);
|
|
1042
|
+
return c.getTable(i, s) ? (d.getContextValue(ge) || (h.setCurrentTableFilterInfo({ unitId: i, subUnitId: a, row: t, tableId: s, column: n }), d.setContextValue(ge, !0)), !0) : !1;
|
|
1028
1043
|
}
|
|
1029
|
-
},
|
|
1044
|
+
}, wt = {
|
|
1030
1045
|
type: At.OPERATION,
|
|
1031
1046
|
id: "sheet.operation.open-table-selector",
|
|
1032
1047
|
async handler(r) {
|
|
@@ -1034,27 +1049,27 @@ const bt = {
|
|
|
1034
1049
|
const e = r.get(Ce), t = r.get(ee), n = st(e);
|
|
1035
1050
|
if (!n)
|
|
1036
1051
|
return !1;
|
|
1037
|
-
const { unitId: i, subUnitId: a, worksheet: s } = n,
|
|
1038
|
-
return S ? (t.executeCommand(
|
|
1052
|
+
const { unitId: i, subUnitId: a, worksheet: s } = n, d = r.get(lt).getCurrentLastSelection(), h = (C = d == null ? void 0 : d.range) != null ? C : { startRow: 0, endRow: 0, startColumn: 0, endColumn: 0 }, b = In(d) ? Mn(h, { up: !0, left: !0, right: !0, down: !0 }, s) : h, S = await pr(r, i, a, b);
|
|
1053
|
+
return S ? (t.executeCommand(Ar.id, { ...S }), !0) : !1;
|
|
1039
1054
|
}
|
|
1040
1055
|
};
|
|
1041
|
-
async function
|
|
1056
|
+
async function pr(r, e, t, n, i) {
|
|
1042
1057
|
const a = r.get(Kt), s = r.get(oe);
|
|
1043
1058
|
return new Promise((c) => {
|
|
1044
|
-
const
|
|
1059
|
+
const d = {
|
|
1045
1060
|
unitId: e,
|
|
1046
1061
|
subUnitId: t,
|
|
1047
1062
|
range: n,
|
|
1048
1063
|
tableId: i,
|
|
1049
|
-
onConfirm: (
|
|
1050
|
-
c(
|
|
1064
|
+
onConfirm: (h) => {
|
|
1065
|
+
c(h), a.close(Pe);
|
|
1051
1066
|
},
|
|
1052
1067
|
onCancel: () => {
|
|
1053
|
-
c(null), a.close(
|
|
1068
|
+
c(null), a.close(Pe);
|
|
1054
1069
|
}
|
|
1055
1070
|
};
|
|
1056
1071
|
a.open({
|
|
1057
|
-
id:
|
|
1072
|
+
id: Pe,
|
|
1058
1073
|
title: { title: s.t("sheets-table.selectRange") },
|
|
1059
1074
|
draggable: !0,
|
|
1060
1075
|
destroyOnClose: !0,
|
|
@@ -1062,28 +1077,28 @@ async function fr(r, e, t, n, i) {
|
|
|
1062
1077
|
maskClosable: !1,
|
|
1063
1078
|
children: {
|
|
1064
1079
|
label: {
|
|
1065
|
-
name:
|
|
1066
|
-
props:
|
|
1080
|
+
name: Pe,
|
|
1081
|
+
props: d
|
|
1067
1082
|
}
|
|
1068
1083
|
},
|
|
1069
1084
|
width: 300,
|
|
1070
1085
|
onClose: () => {
|
|
1071
|
-
c(null), a.close(
|
|
1086
|
+
c(null), a.close(Pe);
|
|
1072
1087
|
}
|
|
1073
1088
|
});
|
|
1074
1089
|
});
|
|
1075
1090
|
}
|
|
1076
|
-
const
|
|
1077
|
-
var
|
|
1078
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1091
|
+
const fr = "sheets-table-ui.config";
|
|
1092
|
+
var ci = Object.getOwnPropertyDescriptor, ui = (r, e, t, n) => {
|
|
1093
|
+
for (var i = n > 1 ? void 0 : n ? ci(e, t) : e, a = r.length - 1, s; a >= 0; a--)
|
|
1079
1094
|
(s = r[a]) && (i = s(i) || i);
|
|
1080
1095
|
return i;
|
|
1081
|
-
},
|
|
1082
|
-
let
|
|
1096
|
+
}, di = (r, e) => (t, n) => e(t, n, r);
|
|
1097
|
+
let xe = class extends Fe {
|
|
1083
1098
|
constructor(e) {
|
|
1084
1099
|
super();
|
|
1085
|
-
|
|
1086
|
-
|
|
1100
|
+
A(this, "_refreshTable", new hn());
|
|
1101
|
+
A(this, "refreshTable$", this._refreshTable.asObservable());
|
|
1087
1102
|
this._commandService = e, this._initListener();
|
|
1088
1103
|
}
|
|
1089
1104
|
_initListener() {
|
|
@@ -1091,44 +1106,44 @@ let Ne = class extends Be {
|
|
|
1091
1106
|
this._commandService.onCommandExecuted((e) => {
|
|
1092
1107
|
if (e.id === tr.id) {
|
|
1093
1108
|
const t = e.params, { styleName: n } = t;
|
|
1094
|
-
n.startsWith(
|
|
1109
|
+
n.startsWith(Ur) && this._refreshTable.next(Math.random());
|
|
1095
1110
|
}
|
|
1096
1111
|
})
|
|
1097
1112
|
);
|
|
1098
1113
|
}
|
|
1099
1114
|
};
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
],
|
|
1103
|
-
const
|
|
1115
|
+
xe = ui([
|
|
1116
|
+
di(0, N(ee))
|
|
1117
|
+
], xe);
|
|
1118
|
+
const hi = () => {
|
|
1104
1119
|
var _e, Te;
|
|
1105
|
-
const [r, e] = W(""), [t, n] = W(""), i = R(
|
|
1106
|
-
s((
|
|
1107
|
-
...
|
|
1108
|
-
[w]:
|
|
1120
|
+
const [r, e] = W(""), [t, n] = W(""), i = R(rn), [a, s] = W({}), c = R(He), d = R(et), h = Me(d.anchorPosition$), u = R(ee), b = R(Ce), S = R(rr), C = Me(S.unitPermissionInitStateChange$, !1), T = R(te), O = R(nr), p = R(xe), E = Me(p.refreshTable$), I = R(oe), k = R(lt), v = Me(k.selectionChanged$, [{ range: Ht(0, 0), primary: null }]), [, m] = W(Math.random()), M = R(Ut).getConfig(fr), f = (_e = M == null ? void 0 : M.anchorHeight) != null ? _e : 24, V = (Te = M == null ? void 0 : M.anchorBackgroundColor) != null ? Te : "rgb(53,91,183)", P = (w, H) => {
|
|
1121
|
+
s((x) => ({
|
|
1122
|
+
...x,
|
|
1123
|
+
[w]: H
|
|
1109
1124
|
}));
|
|
1110
1125
|
};
|
|
1111
1126
|
if (sr(() => {
|
|
1112
1127
|
m(Math.random());
|
|
1113
|
-
}, [E]), !(
|
|
1128
|
+
}, [E]), !(h != null && h.length))
|
|
1114
1129
|
return null;
|
|
1115
|
-
const q = st(
|
|
1130
|
+
const q = st(b);
|
|
1116
1131
|
if (!q) return null;
|
|
1117
|
-
const { unitId: D, subUnitId: K } = q, Se = (w,
|
|
1132
|
+
const { unitId: D, subUnitId: K } = q, Se = (w, H) => {
|
|
1118
1133
|
var B;
|
|
1119
|
-
if (((B =
|
|
1134
|
+
if (((B = T.getTableById(D, w)) == null ? void 0 : B.getDisplayName()) === H) {
|
|
1120
1135
|
e(""), n("");
|
|
1121
1136
|
return;
|
|
1122
1137
|
}
|
|
1123
1138
|
u.executeCommand(vt.id, {
|
|
1124
1139
|
tableId: w,
|
|
1125
1140
|
unitId: D,
|
|
1126
|
-
name:
|
|
1141
|
+
name: H
|
|
1127
1142
|
}), n(""), e("");
|
|
1128
1143
|
}, Ee = async (w) => {
|
|
1129
|
-
const
|
|
1130
|
-
if (!
|
|
1131
|
-
const
|
|
1144
|
+
const H = T.getTableById(D, w);
|
|
1145
|
+
if (!H) return;
|
|
1146
|
+
const x = H.getRange(), B = await pr(c, D, K, x, w);
|
|
1132
1147
|
B && u.executeCommand(vt.id, {
|
|
1133
1148
|
tableId: w,
|
|
1134
1149
|
unitId: D,
|
|
@@ -1142,15 +1157,15 @@ const di = () => {
|
|
|
1142
1157
|
{
|
|
1143
1158
|
className: "univer-absolute univer-z-50 univer-h-0 univer-w-0",
|
|
1144
1159
|
style: {},
|
|
1145
|
-
children:
|
|
1160
|
+
children: h.map((w) => {
|
|
1146
1161
|
var z, G, ae, se, ue, de, he;
|
|
1147
|
-
const
|
|
1148
|
-
if (!
|
|
1149
|
-
const
|
|
1150
|
-
if (!(
|
|
1162
|
+
const H = T.getTableById(D, w.tableId);
|
|
1163
|
+
if (!H) return null;
|
|
1164
|
+
const x = O.getRangeThemeStyle(D, H.getTableStyleId()), B = (ae = (G = (z = x == null ? void 0 : x.getHeaderRowStyle()) == null ? void 0 : z.bg) == null ? void 0 : G.rgb) != null ? ae : V, ce = (de = (ue = (se = x == null ? void 0 : x.getHeaderRowStyle()) == null ? void 0 : se.cl) == null ? void 0 : ue.rgb) != null ? de : "rgb(255, 255, 255)", Ze = H.getRange();
|
|
1165
|
+
if (!(v != null && v.length))
|
|
1151
1166
|
return null;
|
|
1152
|
-
const qe =
|
|
1153
|
-
return /* @__PURE__ */
|
|
1167
|
+
const qe = v[v.length - 1].range, y = !pe.intersects(Ze, qe) && w.y <= 20;
|
|
1168
|
+
return /* @__PURE__ */ _(
|
|
1154
1169
|
"div",
|
|
1155
1170
|
{
|
|
1156
1171
|
className: `
|
|
@@ -1183,14 +1198,14 @@ const di = () => {
|
|
|
1183
1198
|
}
|
|
1184
1199
|
) : /* @__PURE__ */ o("div", { className: "univer-h-[18px] univer-max-w-24 univer-truncate univer-text-sm", children: w.tableName }) }),
|
|
1185
1200
|
/* @__PURE__ */ o(
|
|
1186
|
-
|
|
1201
|
+
ke,
|
|
1187
1202
|
{
|
|
1188
1203
|
open: (he = a[w.tableId]) != null ? he : !1,
|
|
1189
1204
|
onOpenChange: (Z) => {
|
|
1190
|
-
|
|
1205
|
+
P(w.tableId, Z);
|
|
1191
1206
|
},
|
|
1192
|
-
overlay: /* @__PURE__ */
|
|
1193
|
-
/* @__PURE__ */
|
|
1207
|
+
overlay: /* @__PURE__ */ _("div", { className: "univer-pb-2 univer-pt-2", children: [
|
|
1208
|
+
/* @__PURE__ */ _(
|
|
1194
1209
|
"div",
|
|
1195
1210
|
{
|
|
1196
1211
|
className: `
|
|
@@ -1202,7 +1217,7 @@ const di = () => {
|
|
|
1202
1217
|
e(w.tableId), n(w.tableName);
|
|
1203
1218
|
},
|
|
1204
1219
|
children: [
|
|
1205
|
-
/* @__PURE__ */ o(
|
|
1220
|
+
/* @__PURE__ */ o(gr, { className: "univer-mr-2" }),
|
|
1206
1221
|
I.t("sheets-table.rename")
|
|
1207
1222
|
]
|
|
1208
1223
|
}
|
|
@@ -1215,7 +1230,7 @@ const di = () => {
|
|
|
1215
1230
|
`
|
|
1216
1231
|
}
|
|
1217
1232
|
),
|
|
1218
|
-
/* @__PURE__ */
|
|
1233
|
+
/* @__PURE__ */ _(
|
|
1219
1234
|
"div",
|
|
1220
1235
|
{
|
|
1221
1236
|
onClick: () => Ee(w.tableId),
|
|
@@ -1230,7 +1245,7 @@ const di = () => {
|
|
|
1230
1245
|
]
|
|
1231
1246
|
}
|
|
1232
1247
|
),
|
|
1233
|
-
/* @__PURE__ */
|
|
1248
|
+
/* @__PURE__ */ _(
|
|
1234
1249
|
"div",
|
|
1235
1250
|
{
|
|
1236
1251
|
className: `
|
|
@@ -1239,11 +1254,11 @@ const di = () => {
|
|
|
1239
1254
|
hover:univer-bg-gray-200
|
|
1240
1255
|
`,
|
|
1241
1256
|
onClick: () => {
|
|
1242
|
-
|
|
1243
|
-
const Z =
|
|
1257
|
+
P(w.tableId, !1);
|
|
1258
|
+
const Z = T.getTableById(D, w.tableId);
|
|
1244
1259
|
if (!Z) return;
|
|
1245
1260
|
const ye = Z.getTableConfig(), we = {
|
|
1246
|
-
id:
|
|
1261
|
+
id: kn,
|
|
1247
1262
|
header: { title: I.t("sheets-table.tableStyle") },
|
|
1248
1263
|
children: {
|
|
1249
1264
|
label: or,
|
|
@@ -1258,7 +1273,7 @@ const di = () => {
|
|
|
1258
1273
|
},
|
|
1259
1274
|
children: [
|
|
1260
1275
|
/* @__PURE__ */ o(
|
|
1261
|
-
|
|
1276
|
+
br,
|
|
1262
1277
|
{
|
|
1263
1278
|
extend: { colorChannel1: "rgb(53,91,183)" },
|
|
1264
1279
|
className: "univer-mr-2"
|
|
@@ -1276,7 +1291,7 @@ const di = () => {
|
|
|
1276
1291
|
`
|
|
1277
1292
|
}
|
|
1278
1293
|
),
|
|
1279
|
-
/* @__PURE__ */
|
|
1294
|
+
/* @__PURE__ */ _(
|
|
1280
1295
|
"div",
|
|
1281
1296
|
{
|
|
1282
1297
|
className: `
|
|
@@ -1285,7 +1300,7 @@ const di = () => {
|
|
|
1285
1300
|
hover:univer-bg-gray-200
|
|
1286
1301
|
`,
|
|
1287
1302
|
onClick: () => {
|
|
1288
|
-
|
|
1303
|
+
P(w.tableId, !1), u.executeCommand(jr.id, {
|
|
1289
1304
|
tableId: w.tableId,
|
|
1290
1305
|
subUnitId: K,
|
|
1291
1306
|
unitId: D
|
|
@@ -1299,7 +1314,7 @@ const di = () => {
|
|
|
1299
1314
|
)
|
|
1300
1315
|
] }),
|
|
1301
1316
|
align: "start",
|
|
1302
|
-
children: /* @__PURE__ */ o(
|
|
1317
|
+
children: /* @__PURE__ */ o(Tt, {})
|
|
1303
1318
|
},
|
|
1304
1319
|
w.tableId
|
|
1305
1320
|
)
|
|
@@ -1311,29 +1326,29 @@ const di = () => {
|
|
|
1311
1326
|
}
|
|
1312
1327
|
) : null;
|
|
1313
1328
|
};
|
|
1314
|
-
var
|
|
1315
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1329
|
+
var vi = Object.getOwnPropertyDescriptor, bi = (r, e, t, n) => {
|
|
1330
|
+
for (var i = n > 1 ? void 0 : n ? vi(e, t) : e, a = r.length - 1, s; a >= 0; a--)
|
|
1316
1331
|
(s = r[a]) && (i = s(i) || i);
|
|
1317
1332
|
return i;
|
|
1318
1333
|
}, J = (r, e) => (t, n) => e(t, n, r);
|
|
1319
|
-
let
|
|
1320
|
-
constructor(e, t, n, i, a, s, c,
|
|
1334
|
+
let et = class extends Fe {
|
|
1335
|
+
constructor(e, t, n, i, a, s, c, d, h, u, b) {
|
|
1321
1336
|
super();
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
this._context = e, this._injector = t, this._sheetSkeletonManagerService = n, this._renderManagerService = i, this._commandService = a, this._univerInstanceService = s, this._uiPartsService = c, this._tableManager =
|
|
1337
|
+
A(this, "_anchorVisible$", new Nt(!0));
|
|
1338
|
+
A(this, "_timer");
|
|
1339
|
+
A(this, "_anchorPosition$", new Nt([]));
|
|
1340
|
+
A(this, "anchorPosition$", this._anchorPosition$.asObservable());
|
|
1341
|
+
this._context = e, this._injector = t, this._sheetSkeletonManagerService = n, this._renderManagerService = i, this._commandService = a, this._univerInstanceService = s, this._uiPartsService = c, this._tableManager = d, this._scrollManagerService = h, this._workbookPermissionService = u, this._permissionService = b, this._initUI(), this._initListener(), this._initTableAnchor();
|
|
1327
1342
|
}
|
|
1328
1343
|
_initUI() {
|
|
1329
1344
|
this.disposeWithMe(
|
|
1330
|
-
this._uiPartsService.registerComponent(
|
|
1345
|
+
this._uiPartsService.registerComponent(an.CONTENT, () => sn(hi, this._injector))
|
|
1331
1346
|
);
|
|
1332
1347
|
}
|
|
1333
1348
|
_initListener() {
|
|
1334
1349
|
this.disposeWithMe(
|
|
1335
1350
|
this._commandService.onCommandExecuted((e) => {
|
|
1336
|
-
(e.id ===
|
|
1351
|
+
(e.id === Gr.id || e.id === Xr.id) && (this._anchorVisible$.next(!1), this._timer && clearTimeout(this._timer), this._timer = setTimeout(() => {
|
|
1337
1352
|
this._anchorVisible$.next(!0);
|
|
1338
1353
|
}, 300));
|
|
1339
1354
|
})
|
|
@@ -1350,11 +1365,11 @@ let rt = class extends Be {
|
|
|
1350
1365
|
this._tableManager.tableNameChanged$,
|
|
1351
1366
|
this._tableManager.tableRangeChanged$,
|
|
1352
1367
|
this._tableManager.tableThemeChanged$,
|
|
1353
|
-
this._workbookPermissionService.unitPermissionInitStateChange$.pipe(
|
|
1354
|
-
this._permissionService.permissionPointUpdate$.pipe(
|
|
1368
|
+
this._workbookPermissionService.unitPermissionInitStateChange$.pipe(vn((e) => e)),
|
|
1369
|
+
this._permissionService.permissionPointUpdate$.pipe(bn(300)),
|
|
1355
1370
|
this._anchorVisible$
|
|
1356
1371
|
).subscribe(() => {
|
|
1357
|
-
var
|
|
1372
|
+
var h;
|
|
1358
1373
|
if (!this._anchorVisible$.getValue()) {
|
|
1359
1374
|
this._anchorPosition$.next([]);
|
|
1360
1375
|
return;
|
|
@@ -1364,60 +1379,60 @@ let rt = class extends Be {
|
|
|
1364
1379
|
this._anchorPosition$.next([]);
|
|
1365
1380
|
return;
|
|
1366
1381
|
}
|
|
1367
|
-
if (!((
|
|
1382
|
+
if (!((h = this._permissionService.getPermissionPoint(new er(t.getUnitId()).id)) == null ? void 0 : h.value)) {
|
|
1368
1383
|
this._anchorPosition$.next([]);
|
|
1369
1384
|
return;
|
|
1370
1385
|
}
|
|
1371
|
-
const
|
|
1372
|
-
const { startRow: S, startColumn: C } =
|
|
1373
|
-
if (!
|
|
1374
|
-
const { scene: p } =
|
|
1386
|
+
const d = a.reduce((u, b) => {
|
|
1387
|
+
const { startRow: S, startColumn: C } = b.range, T = s.with(at), O = Kr(this._univerInstanceService, this._renderManagerService);
|
|
1388
|
+
if (!O) return u;
|
|
1389
|
+
const { scene: p } = O, E = p.getViewport(Pr.VIEW_MAIN);
|
|
1375
1390
|
if (!E) return u;
|
|
1376
|
-
const I = p == null ? void 0 : p.scaleX,
|
|
1377
|
-
if (!I || !p || !
|
|
1378
|
-
const m =
|
|
1391
|
+
const I = p == null ? void 0 : p.scaleX, k = p == null ? void 0 : p.scaleY, v = p == null ? void 0 : p.getViewportScrollXY(E);
|
|
1392
|
+
if (!I || !p || !k || !v) return u;
|
|
1393
|
+
const m = T.getCurrentSkeleton();
|
|
1379
1394
|
if (!m) return u;
|
|
1380
|
-
const L = m.getNoMergeCellWithCoordByIndex(S, C), M =
|
|
1395
|
+
const L = m.getNoMergeCellWithCoordByIndex(S, C), M = kr(L.startX, I, v), f = Dr(L.startY, k, v) - 25 - 4;
|
|
1381
1396
|
return f >= -10 && M >= 45 && u.push({
|
|
1382
1397
|
x: M,
|
|
1383
1398
|
y: f,
|
|
1384
|
-
tableId:
|
|
1385
|
-
tableName:
|
|
1399
|
+
tableId: b.id,
|
|
1400
|
+
tableName: b.name
|
|
1386
1401
|
}), u;
|
|
1387
1402
|
}, []);
|
|
1388
|
-
this._anchorPosition$.next(
|
|
1403
|
+
this._anchorPosition$.next(d);
|
|
1389
1404
|
})
|
|
1390
1405
|
);
|
|
1391
1406
|
}
|
|
1392
1407
|
};
|
|
1393
|
-
|
|
1394
|
-
J(1,
|
|
1395
|
-
J(2,
|
|
1408
|
+
et = bi([
|
|
1409
|
+
J(1, N(He)),
|
|
1410
|
+
J(2, N(at)),
|
|
1396
1411
|
J(3, Zt),
|
|
1397
1412
|
J(4, ee),
|
|
1398
1413
|
J(5, Ce),
|
|
1399
|
-
J(6,
|
|
1400
|
-
J(7,
|
|
1401
|
-
J(8,
|
|
1402
|
-
J(9,
|
|
1403
|
-
J(10,
|
|
1404
|
-
],
|
|
1405
|
-
const
|
|
1414
|
+
J(6, nn),
|
|
1415
|
+
J(7, N(te)),
|
|
1416
|
+
J(8, N(zr)),
|
|
1417
|
+
J(9, N(rr)),
|
|
1418
|
+
J(10, N(Vt))
|
|
1419
|
+
], et);
|
|
1420
|
+
const Oe = 16;
|
|
1406
1421
|
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");
|
|
1407
|
-
class
|
|
1422
|
+
class Bt {
|
|
1408
1423
|
static drawNoSetting(e, t, n, i) {
|
|
1409
|
-
e.save(),
|
|
1424
|
+
e.save(), It.drawWith(e, {
|
|
1410
1425
|
radius: 2,
|
|
1411
|
-
width:
|
|
1412
|
-
height:
|
|
1426
|
+
width: Oe,
|
|
1427
|
+
height: Oe,
|
|
1413
1428
|
fill: i
|
|
1414
|
-
}), e.lineCap = "square", e.strokeStyle = n, e.scale(t /
|
|
1429
|
+
}), e.lineCap = "square", e.strokeStyle = n, e.scale(t / Oe, t / Oe), 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();
|
|
1415
1430
|
}
|
|
1416
1431
|
static drawIconByPath(e, t, n, i) {
|
|
1417
|
-
e.save(), e.strokeStyle = n, e.fillStyle = i,
|
|
1432
|
+
e.save(), e.strokeStyle = n, e.fillStyle = i, It.drawWith(e, {
|
|
1418
1433
|
radius: 2,
|
|
1419
|
-
width:
|
|
1420
|
-
height:
|
|
1434
|
+
width: Oe,
|
|
1435
|
+
height: Oe,
|
|
1421
1436
|
fill: i
|
|
1422
1437
|
}), t.forEach((a) => {
|
|
1423
1438
|
const s = new Path2D(a);
|
|
@@ -1425,36 +1440,36 @@ class Dt {
|
|
|
1425
1440
|
}), e.restore();
|
|
1426
1441
|
}
|
|
1427
1442
|
}
|
|
1428
|
-
const
|
|
1443
|
+
const gi = [
|
|
1429
1444
|
"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"
|
|
1430
|
-
],
|
|
1445
|
+
], mi = [
|
|
1431
1446
|
"M12.4008 13.1831C12.6907 13.1831 12.9258 12.9481 12.9258 12.6581V4.60873L14.013 5.69597C14.218 5.901 14.5505 5.901 14.7555 5.69597C14.9605 5.49094 14.9605 5.15853 14.7555 4.95351L12.7721 2.97017C12.5671 2.76515 12.2347 2.76515 12.0297 2.97017L10.0463 4.95351C9.84132 5.15853 9.84132 5.49094 10.0463 5.69597C10.2514 5.901 10.5838 5.901 10.7888 5.69597L11.8758 4.60901V12.6581C11.8758 12.9481 12.1108 13.1831 12.4008 13.1831Z",
|
|
1432
1447
|
"M1.28069 4.85447C0.842195 4.33439 1.21191 3.5391 1.89218 3.5391H8.59333C9.2736 3.5391 9.64331 4.33439 9.20482 4.85447L6.51052 8.0501V11.6601C6.51052 12.2245 5.94174 12.6114 5.41683 12.404L4.48092 12.0343C4.1756 11.9136 3.97498 11.6187 3.97498 11.2904V8.0501L1.28069 4.85447Z"
|
|
1433
|
-
],
|
|
1448
|
+
], pi = [
|
|
1434
1449
|
"M12.4008 2.81641C12.6907 2.81641 12.9258 3.05146 12.9258 3.34141V11.3908L14.013 10.3036C14.218 10.0986 14.5505 10.0986 14.7555 10.3036C14.9605 10.5086 14.9605 10.841 14.7555 11.046L12.7721 13.0294C12.5671 13.2344 12.2347 13.2344 12.0297 13.0294L10.0463 11.046C9.84132 10.841 9.84132 10.5086 10.0463 10.3036C10.2514 10.0986 10.5838 10.0986 10.7888 10.3036L11.8758 11.3905V3.34141C11.8758 3.05146 12.1108 2.81641 12.4008 2.81641Z",
|
|
1435
1450
|
"M1.28069 4.85444C0.842195 4.33435 1.21191 3.53906 1.89218 3.53906H8.59333C9.2736 3.53906 9.64331 4.33435 9.20482 4.85443L6.51052 8.05006V11.6601C6.51052 12.2245 5.94174 12.6113 5.41683 12.404L4.48092 12.0342C4.1756 11.9136 3.97498 11.6186 3.97498 11.2903V8.05006L1.28069 4.85444Z"
|
|
1436
|
-
],
|
|
1451
|
+
], fi = [
|
|
1437
1452
|
"M11.9003 13.7046C11.9003 13.9969 11.6633 14.2339 11.371 14.2339C11.0787 14.2339 10.8417 13.9969 10.8417 13.7046V3.57272L9.74577 4.66862C9.53906 4.87534 9.20391 4.87534 8.9972 4.66862C8.79048 4.46191 8.79048 4.12676 8.9972 3.92005L10.9969 1.92039C11.2036 1.71368 11.5387 1.71368 11.7454 1.92039L13.7451 3.92005C13.9518 4.12676 13.9518 4.46191 13.7451 4.66862C13.5384 4.87534 13.2032 4.87534 12.9965 4.66862L11.9003 3.57243V13.7046Z",
|
|
1438
1453
|
"M2.69779 10.0113C2.40546 10.0113 2.16847 9.77429 2.16847 9.48196C2.16847 9.18962 2.40546 8.95264 2.69779 8.95264H6.67804C6.89213 8.95264 7.08514 9.0816 7.16707 9.2794C7.249 9.47719 7.20371 9.70486 7.05233 9.85624L3.97569 12.9329H6.67804C6.97038 12.9329 7.20736 13.1699 7.20736 13.4622C7.20736 13.7545 6.97038 13.9915 6.67804 13.9915H2.69779C2.4837 13.9915 2.29069 13.8626 2.20876 13.6648C2.12684 13.467 2.17212 13.2393 2.32351 13.0879L5.40015 10.0113H2.69779Z",
|
|
1439
1454
|
"M5.51638 2.58693C5.23363 1.81542 4.14248 1.81543 3.85973 2.58693L2.13245 7.29995C2.03185 7.57443 2.17281 7.87849 2.4473 7.97909C2.72178 8.07969 3.02584 7.93872 3.12644 7.66424L3.64346 6.25351L3.64504 6.25351H5.73266L6.24968 7.66424C6.35027 7.93872 6.65433 8.07969 6.92882 7.97909C7.2033 7.87849 7.34426 7.57443 7.24367 7.29995L5.51638 2.58693ZM5.34467 5.19487L4.68806 3.40325L4.03144 5.19487H5.34467Z"
|
|
1440
|
-
],
|
|
1455
|
+
], Ci = [
|
|
1441
1456
|
"M11.9003 2.29495C11.9003 2.00261 11.6633 1.76562 11.371 1.76562C11.0787 1.76562 10.8417 2.00261 10.8417 2.29495V12.4268L9.74577 11.3309C9.53906 11.1242 9.20391 11.1242 8.9972 11.3309C8.79048 11.5376 8.79048 11.8727 8.9972 12.0795L10.9969 14.0791C11.2036 14.2858 11.5387 14.2858 11.7454 14.0791L13.7451 12.0795C13.9518 11.8727 13.9518 11.5376 13.7451 11.3309C13.5384 11.1242 13.2032 11.1242 12.9965 11.3309L11.9003 12.4271V2.29495Z",
|
|
1442
1457
|
"M2.69792 10.0113C2.40558 10.0113 2.16859 9.77429 2.16859 9.48196C2.16859 9.18962 2.40558 8.95264 2.69792 8.95264H6.67816C6.89225 8.95264 7.08526 9.0816 7.16719 9.2794C7.24912 9.47719 7.20384 9.70486 7.05245 9.85624L3.97581 12.9329H6.67816C6.9705 12.9329 7.20749 13.1699 7.20749 13.4622C7.20749 13.7545 6.9705 13.9915 6.67816 13.9915H2.69792C2.48383 13.9915 2.29082 13.8626 2.20889 13.6648C2.12696 13.467 2.17224 13.2393 2.32363 13.0879L5.40027 10.0113H2.69792Z",
|
|
1443
1458
|
"M5.5165 2.58693C5.23375 1.81542 4.1426 1.81543 3.85985 2.58693L2.13257 7.29995C2.03197 7.57443 2.17294 7.8785 2.44742 7.97909C2.7219 8.07969 3.02596 7.93872 3.12656 7.66424L3.64358 6.25351L3.64516 6.25351H5.73278L6.2498 7.66424C6.35039 7.93872 6.65446 8.07969 6.92894 7.97909C7.20342 7.8785 7.34438 7.57443 7.24379 7.29995L5.5165 2.58693ZM5.34479 5.19487L4.68818 3.40325L4.03156 5.19487H5.34479Z"
|
|
1444
1459
|
];
|
|
1445
|
-
var
|
|
1446
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1460
|
+
var Si = Object.getOwnPropertyDescriptor, _i = (r, e, t, n) => {
|
|
1461
|
+
for (var i = n > 1 ? void 0 : n ? Si(e, t) : e, a = r.length - 1, s; a >= 0; a--)
|
|
1447
1462
|
(s = r[a]) && (i = s(i) || i);
|
|
1448
1463
|
return i;
|
|
1449
1464
|
}, dt = (r, e) => (t, n) => e(t, n, r);
|
|
1450
1465
|
const me = 16, Xe = 1;
|
|
1451
|
-
let gt = class extends
|
|
1466
|
+
let gt = class extends Br {
|
|
1452
1467
|
constructor(e, t, n, i, a) {
|
|
1453
1468
|
super(e, t);
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1469
|
+
A(this, "_cellWidth", 0);
|
|
1470
|
+
A(this, "_cellHeight", 0);
|
|
1471
|
+
A(this, "_filterParams");
|
|
1472
|
+
A(this, "_hovered", !1);
|
|
1458
1473
|
this._contextService = n, this._commandService = i, this._themeService = a, this.setShapeProps(t), this.onPointerDown$.subscribeEvent((s) => this.onPointerDown(s)), this.onPointerEnter$.subscribeEvent(() => this.onPointerEnter()), this.onPointerLeave$.subscribeEvent(() => this.onPointerLeave());
|
|
1459
1474
|
}
|
|
1460
1475
|
setShapeProps(e) {
|
|
@@ -1468,42 +1483,42 @@ let gt = class extends Dr {
|
|
|
1468
1483
|
e.save();
|
|
1469
1484
|
const s = new Path2D();
|
|
1470
1485
|
s.rect(i, a, n, t), e.clip(s);
|
|
1471
|
-
const { buttonState: c } = this._filterParams,
|
|
1486
|
+
const { buttonState: c } = this._filterParams, d = this._themeService.getColorFromTheme("primary.600"), h = this._hovered ? this._themeService.getColorFromTheme("gray.50") : "rgba(255, 255, 255, 1.0)";
|
|
1472
1487
|
let u;
|
|
1473
1488
|
switch (c) {
|
|
1474
1489
|
case Le.FilteredSortNone:
|
|
1475
|
-
u =
|
|
1490
|
+
u = gi;
|
|
1476
1491
|
break;
|
|
1477
1492
|
case Le.FilteredSortAsc:
|
|
1478
|
-
u =
|
|
1493
|
+
u = mi;
|
|
1479
1494
|
break;
|
|
1480
1495
|
case Le.FilteredSortDesc:
|
|
1481
|
-
u =
|
|
1496
|
+
u = pi;
|
|
1482
1497
|
break;
|
|
1483
1498
|
case Le.FilterNoneSortNone:
|
|
1484
1499
|
break;
|
|
1485
1500
|
case Le.FilterNoneSortAsc:
|
|
1486
|
-
u =
|
|
1501
|
+
u = fi;
|
|
1487
1502
|
break;
|
|
1488
1503
|
case Le.FilterNoneSortDesc:
|
|
1489
|
-
u =
|
|
1504
|
+
u = Ci;
|
|
1490
1505
|
break;
|
|
1491
1506
|
}
|
|
1492
|
-
u ?
|
|
1507
|
+
u ? Bt.drawIconByPath(e, u, d, h) : c !== void 0 && Bt.drawNoSetting(e, me, d, h), e.restore();
|
|
1493
1508
|
}
|
|
1494
1509
|
onPointerDown(e) {
|
|
1495
1510
|
if (e.button === 2)
|
|
1496
1511
|
return;
|
|
1497
1512
|
const { row: t, col: n, unitId: i, subUnitId: a, tableId: s } = this._filterParams;
|
|
1498
1513
|
this._contextService.getContextValue(ge) || !this._commandService.hasCommand(bt.id) || setTimeout(() => {
|
|
1499
|
-
const
|
|
1514
|
+
const d = {
|
|
1500
1515
|
row: t,
|
|
1501
1516
|
col: n,
|
|
1502
1517
|
unitId: i,
|
|
1503
1518
|
subUnitId: a,
|
|
1504
1519
|
tableId: s
|
|
1505
1520
|
};
|
|
1506
|
-
this._commandService.executeCommand(bt.id,
|
|
1521
|
+
this._commandService.executeCommand(bt.id, d);
|
|
1507
1522
|
}, 200);
|
|
1508
1523
|
}
|
|
1509
1524
|
onPointerEnter() {
|
|
@@ -1513,23 +1528,23 @@ let gt = class extends Dr {
|
|
|
1513
1528
|
this._hovered = !1, this.makeDirty(!0);
|
|
1514
1529
|
}
|
|
1515
1530
|
};
|
|
1516
|
-
gt =
|
|
1531
|
+
gt = _i([
|
|
1517
1532
|
dt(2, ft),
|
|
1518
1533
|
dt(3, ee),
|
|
1519
|
-
dt(4,
|
|
1534
|
+
dt(4, N(jt))
|
|
1520
1535
|
], gt);
|
|
1521
|
-
var
|
|
1522
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1536
|
+
var Ti = Object.getOwnPropertyDescriptor, yi = (r, e, t, n) => {
|
|
1537
|
+
for (var i = n > 1 ? void 0 : n ? Ti(e, t) : e, a = r.length - 1, s; a >= 0; a--)
|
|
1523
1538
|
(s = r[a]) && (i = s(i) || i);
|
|
1524
1539
|
return i;
|
|
1525
1540
|
}, Ie = (r, e) => (t, n) => e(t, n, r);
|
|
1526
|
-
const
|
|
1541
|
+
const wi = 5e3;
|
|
1527
1542
|
let mt = class extends Wt {
|
|
1528
|
-
constructor(e, t, n, i, a, s, c,
|
|
1543
|
+
constructor(e, t, n, i, a, s, c, d) {
|
|
1529
1544
|
super();
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
this._context = e, this._injector = t, this._sheetSkeletonManagerService = n, this._themeService = i, this._sheetInterceptorService = a, this._commandService = s, this._selectionRenderService = c, this._tableManager =
|
|
1545
|
+
A(this, "_buttonRenderDisposable", null);
|
|
1546
|
+
A(this, "_tableFilterButtonShapes", []);
|
|
1547
|
+
this._context = e, this._injector = t, this._sheetSkeletonManagerService = n, this._themeService = i, this._sheetInterceptorService = a, this._commandService = s, this._selectionRenderService = c, this._tableManager = d, this._initRenderer();
|
|
1533
1548
|
}
|
|
1534
1549
|
dispose() {
|
|
1535
1550
|
super.dispose(), this._disposeRendering();
|
|
@@ -1554,46 +1569,46 @@ let mt = class extends Wt {
|
|
|
1554
1569
|
e.tableDelete$,
|
|
1555
1570
|
e.tableFilterChanged$
|
|
1556
1571
|
).pipe(
|
|
1557
|
-
|
|
1572
|
+
gn(() => s()),
|
|
1558
1573
|
Jt(s())
|
|
1559
1574
|
);
|
|
1560
1575
|
}),
|
|
1561
|
-
|
|
1576
|
+
mn(this.dispose$)
|
|
1562
1577
|
).subscribe((t) => {
|
|
1563
1578
|
this._disposeRendering(), !(!t || !t.tableFilterRanges) && this._renderButtons(t);
|
|
1564
1579
|
});
|
|
1565
1580
|
}
|
|
1566
1581
|
_renderButtons(e) {
|
|
1567
1582
|
const { tableFilterRanges: t, unitId: n, skeleton: i, worksheetId: a } = e, { scene: s } = this._context;
|
|
1568
|
-
for (const { range: c, states:
|
|
1569
|
-
const { startRow: u, startColumn:
|
|
1583
|
+
for (const { range: c, states: d, tableId: h } of t) {
|
|
1584
|
+
const { startRow: u, startColumn: b, endColumn: S } = c;
|
|
1570
1585
|
this._interceptCellContent(n, a, c);
|
|
1571
|
-
for (let C =
|
|
1572
|
-
const
|
|
1573
|
-
if (m <= Xe ||
|
|
1586
|
+
for (let C = b; C <= S; C++) {
|
|
1587
|
+
const T = `sheets-table-filter-button-${u}-${C}`, O = en(u, C, s, i), { startX: p, startY: E, endX: I, endY: k } = O, v = I - p, m = k - E;
|
|
1588
|
+
if (m <= Xe || v <= Xe)
|
|
1574
1589
|
continue;
|
|
1575
|
-
const L =
|
|
1590
|
+
const L = d[C - b], M = I - me - Xe, f = k - me - Xe, V = {
|
|
1576
1591
|
left: M,
|
|
1577
1592
|
top: f,
|
|
1578
1593
|
height: me,
|
|
1579
1594
|
width: me,
|
|
1580
|
-
zIndex:
|
|
1595
|
+
zIndex: wi,
|
|
1581
1596
|
cellHeight: m,
|
|
1582
|
-
cellWidth:
|
|
1583
|
-
filterParams: { unitId: n, subUnitId: a, row: u, col: C, buttonState: L, tableId:
|
|
1584
|
-
},
|
|
1585
|
-
this._tableFilterButtonShapes.push(
|
|
1597
|
+
cellWidth: v,
|
|
1598
|
+
filterParams: { unitId: n, subUnitId: a, row: u, col: C, buttonState: L, tableId: h }
|
|
1599
|
+
}, P = this._injector.createInstance(gt, T, V);
|
|
1600
|
+
this._tableFilterButtonShapes.push(P);
|
|
1586
1601
|
}
|
|
1587
1602
|
}
|
|
1588
1603
|
s.addObjects(this._tableFilterButtonShapes), s.makeDirty();
|
|
1589
1604
|
}
|
|
1590
1605
|
_interceptCellContent(e, t, n) {
|
|
1591
1606
|
const { startRow: i, startColumn: a, endColumn: s } = n;
|
|
1592
|
-
this._buttonRenderDisposable = this._sheetInterceptorService.intercept(
|
|
1593
|
-
effect:
|
|
1594
|
-
handler: (c,
|
|
1595
|
-
const { row: u, col:
|
|
1596
|
-
return S !== e || C !== t || u !== i ||
|
|
1607
|
+
this._buttonRenderDisposable = this._sheetInterceptorService.intercept(Rn.CELL_CONTENT, {
|
|
1608
|
+
effect: xr.Style,
|
|
1609
|
+
handler: (c, d, h) => {
|
|
1610
|
+
const { row: u, col: b, unitId: S, subUnitId: C } = d;
|
|
1611
|
+
return S !== e || C !== t || u !== i || b < a || b > s ? h(c) : h({
|
|
1597
1612
|
...c,
|
|
1598
1613
|
fontRenderExtension: {
|
|
1599
1614
|
...c == null ? void 0 : c.fontRenderExtension,
|
|
@@ -1609,73 +1624,73 @@ let mt = class extends Wt {
|
|
|
1609
1624
|
this._tableFilterButtonShapes.forEach((t) => t.dispose()), (e = this._buttonRenderDisposable) == null || e.dispose(), this._buttonRenderDisposable = null, this._tableFilterButtonShapes = [];
|
|
1610
1625
|
}
|
|
1611
1626
|
};
|
|
1612
|
-
mt =
|
|
1613
|
-
Ie(1,
|
|
1614
|
-
Ie(2,
|
|
1615
|
-
Ie(3,
|
|
1616
|
-
Ie(4,
|
|
1627
|
+
mt = yi([
|
|
1628
|
+
Ie(1, N(He)),
|
|
1629
|
+
Ie(2, N(at)),
|
|
1630
|
+
Ie(3, N(jt)),
|
|
1631
|
+
Ie(4, N(ir)),
|
|
1617
1632
|
Ie(5, ee),
|
|
1618
|
-
Ie(6,
|
|
1619
|
-
Ie(7,
|
|
1633
|
+
Ie(6, Jr),
|
|
1634
|
+
Ie(7, N(te))
|
|
1620
1635
|
], mt);
|
|
1621
|
-
const
|
|
1622
|
-
const { unitId: e, subUnitId: t, range: n, onCancel: i, onConfirm: a, tableId: s } = r, c = R(te), [
|
|
1623
|
-
return /* @__PURE__ */
|
|
1636
|
+
const Ii = (r) => {
|
|
1637
|
+
const { unitId: e, subUnitId: t, range: n, onCancel: i, onConfirm: a, tableId: s } = r, c = R(te), [d, h] = W(n), [u, b] = W(""), S = R(oe), C = R(Ce);
|
|
1638
|
+
return /* @__PURE__ */ _(St, { children: [
|
|
1624
1639
|
/* @__PURE__ */ o(
|
|
1625
|
-
|
|
1640
|
+
$n,
|
|
1626
1641
|
{
|
|
1627
1642
|
maxRangeCount: 1,
|
|
1628
1643
|
unitId: e,
|
|
1629
1644
|
subUnitId: t,
|
|
1630
|
-
initialValue:
|
|
1631
|
-
onChange: (
|
|
1632
|
-
const p =
|
|
1645
|
+
initialValue: kt(n),
|
|
1646
|
+
onChange: (T, O) => {
|
|
1647
|
+
const p = kt(n), E = Ln(O).range, I = st(C, { unitId: e, subUnitId: t });
|
|
1633
1648
|
if (!I)
|
|
1634
1649
|
return;
|
|
1635
|
-
if (I.worksheet.getMergeData().some((
|
|
1636
|
-
|
|
1650
|
+
if (I.worksheet.getMergeData().some((P) => pe.intersects(E, P))) {
|
|
1651
|
+
b(S.t("sheets-table.tableRangeWithMergeError"));
|
|
1637
1652
|
return;
|
|
1638
1653
|
}
|
|
1639
|
-
if (c.getTablesBySubunitId(e, t).some((
|
|
1640
|
-
if (
|
|
1654
|
+
if (c.getTablesBySubunitId(e, t).some((P) => {
|
|
1655
|
+
if (P.getId() === s)
|
|
1641
1656
|
return !1;
|
|
1642
|
-
const q =
|
|
1657
|
+
const q = P.getRange();
|
|
1643
1658
|
return pe.intersects(E, q);
|
|
1644
1659
|
})) {
|
|
1645
|
-
|
|
1660
|
+
b(S.t("sheets-table.tableRangeWithOtherTableError"));
|
|
1646
1661
|
return;
|
|
1647
1662
|
}
|
|
1648
1663
|
const { startRow: M, endRow: f } = E;
|
|
1649
1664
|
if (M === f) {
|
|
1650
|
-
|
|
1665
|
+
b(S.t("sheets-table.tableRangeSingleRowError"));
|
|
1651
1666
|
return;
|
|
1652
1667
|
}
|
|
1653
|
-
if (p !==
|
|
1668
|
+
if (p !== O) {
|
|
1654
1669
|
if (s) {
|
|
1655
|
-
const
|
|
1656
|
-
if (
|
|
1657
|
-
const q =
|
|
1670
|
+
const P = c.getTableById(e, s);
|
|
1671
|
+
if (P) {
|
|
1672
|
+
const q = P.getRange();
|
|
1658
1673
|
if (pe.intersects(E, q) && q.startRow === E.startRow) {
|
|
1659
|
-
|
|
1674
|
+
h(E), b(""), a({
|
|
1660
1675
|
unitId: e,
|
|
1661
1676
|
subUnitId: t,
|
|
1662
1677
|
range: E
|
|
1663
1678
|
});
|
|
1664
1679
|
return;
|
|
1665
1680
|
} else {
|
|
1666
|
-
|
|
1681
|
+
b(S.t("sheets-table.updateError"));
|
|
1667
1682
|
return;
|
|
1668
1683
|
}
|
|
1669
1684
|
}
|
|
1670
1685
|
}
|
|
1671
|
-
|
|
1686
|
+
h(E), b("");
|
|
1672
1687
|
}
|
|
1673
1688
|
},
|
|
1674
1689
|
supportAcrossSheet: !1
|
|
1675
1690
|
}
|
|
1676
1691
|
),
|
|
1677
1692
|
u && /* @__PURE__ */ o("div", { className: "univer-mt-1 univer-text-xs univer-text-red-500", children: u }),
|
|
1678
|
-
/* @__PURE__ */
|
|
1693
|
+
/* @__PURE__ */ _("div", { className: "univer-mt-4 univer-flex univer-justify-end", children: [
|
|
1679
1694
|
/* @__PURE__ */ o(We, { onClick: i, children: S.t("sheets-table.cancel") }),
|
|
1680
1695
|
/* @__PURE__ */ o(
|
|
1681
1696
|
We,
|
|
@@ -1685,7 +1700,7 @@ const wi = (r) => {
|
|
|
1685
1700
|
u || a({
|
|
1686
1701
|
unitId: e,
|
|
1687
1702
|
subUnitId: t,
|
|
1688
|
-
range:
|
|
1703
|
+
range: d
|
|
1689
1704
|
});
|
|
1690
1705
|
},
|
|
1691
1706
|
className: "univer-ml-2",
|
|
@@ -1694,15 +1709,15 @@ const wi = (r) => {
|
|
|
1694
1709
|
)
|
|
1695
1710
|
] })
|
|
1696
1711
|
] });
|
|
1697
|
-
},
|
|
1698
|
-
var Ee, _e, Te, w,
|
|
1699
|
-
const { unitId: e, subUnitId: t, tableId: n } = r, i = R(ee), a = R(oe), s = R(te), c = s.getTableById(e, n),
|
|
1712
|
+
}, Mi = (r) => {
|
|
1713
|
+
var Ee, _e, Te, w, H, x, B, Ve, ce, Ze, ot, qe;
|
|
1714
|
+
const { unitId: e, subUnitId: t, tableId: n } = r, i = R(ee), a = R(oe), s = R(te), c = s.getTableById(e, n), d = R(nr), h = R(xe), u = Me(d.rangeThemeMapChange$), b = Me(h.refreshTable$), S = R(Nr), [, C] = W(Math.random()), T = Me(s.tableThemeChanged$, {
|
|
1700
1715
|
theme: c == null ? void 0 : c.getTableStyleId(),
|
|
1701
1716
|
oldTheme: c == null ? void 0 : c.getTableStyleId(),
|
|
1702
1717
|
unitId: e,
|
|
1703
1718
|
subUnitId: t,
|
|
1704
1719
|
tableId: n
|
|
1705
|
-
}),
|
|
1720
|
+
}), O = d.getRegisteredRangeThemes().filter((g) => g == null ? void 0 : g.startsWith(Dn)), p = d.getALLRegisteredTheme(e).filter((g) => g == null ? void 0 : g.startsWith(ut)), E = c == null ? void 0 : c.getTableStyleId(), I = p.find((g) => g === E), k = I || p[0], v = d.getCustomRangeThemeStyle(e, k), m = (Te = (_e = (Ee = v == null ? void 0 : v.getHeaderRowStyle()) == null ? void 0 : Ee.bg) == null ? void 0 : _e.rgb) != null ? Te : be, L = (x = (H = (w = v == null ? void 0 : v.getFirstRowStyle()) == null ? void 0 : w.bg) == null ? void 0 : H.rgb) != null ? x : be, M = (ce = (Ve = (B = v == null ? void 0 : v.getSecondRowStyle()) == null ? void 0 : B.bg) == null ? void 0 : Ve.rgb) != null ? ce : be, f = (qe = (ot = (Ze = v == null ? void 0 : v.getLastRowStyle()) == null ? void 0 : Ze.bg) == null ? void 0 : ot.rgb) != null ? qe : be, [V, P] = W(null), q = (g) => {
|
|
1706
1721
|
i.executeCommand(vt.id, {
|
|
1707
1722
|
unitId: e,
|
|
1708
1723
|
tableId: n,
|
|
@@ -1719,8 +1734,8 @@ const wi = (r) => {
|
|
|
1719
1734
|
const G = Number(g.split("-")[2]);
|
|
1720
1735
|
y = `${ut}${G + 1}`;
|
|
1721
1736
|
}
|
|
1722
|
-
const z = new
|
|
1723
|
-
i.executeCommand(
|
|
1737
|
+
const z = new xn(y, { ...Wr });
|
|
1738
|
+
i.executeCommand(Zr.id, {
|
|
1724
1739
|
unitId: e,
|
|
1725
1740
|
tableId: n,
|
|
1726
1741
|
themeStyle: z
|
|
@@ -1733,7 +1748,7 @@ const wi = (r) => {
|
|
|
1733
1748
|
style: y
|
|
1734
1749
|
});
|
|
1735
1750
|
}, Se = (g) => {
|
|
1736
|
-
i.executeCommand(
|
|
1751
|
+
i.executeCommand(qr.id, {
|
|
1737
1752
|
unitId: e,
|
|
1738
1753
|
tableId: n,
|
|
1739
1754
|
themeName: g
|
|
@@ -1741,18 +1756,18 @@ const wi = (r) => {
|
|
|
1741
1756
|
};
|
|
1742
1757
|
return sr(() => {
|
|
1743
1758
|
C(Math.random());
|
|
1744
|
-
}, [u,
|
|
1759
|
+
}, [u, b]), c ? /* @__PURE__ */ _("div", { children: [
|
|
1745
1760
|
/* @__PURE__ */ o("h5", { children: a.t("sheets-table.defaultStyle") }),
|
|
1746
|
-
/* @__PURE__ */ o("div", { className: "univer-flex univer-gap-2", children:
|
|
1747
|
-
var ue, de, he, Z, ye, we,
|
|
1748
|
-
const y =
|
|
1749
|
-
return /* @__PURE__ */
|
|
1761
|
+
/* @__PURE__ */ o("div", { className: "univer-flex univer-gap-2", children: O.map((g) => {
|
|
1762
|
+
var ue, de, he, Z, ye, we, Ae, Ue;
|
|
1763
|
+
const y = d.getDefaultRangeThemeStyle(g), z = ((de = (ue = y == null ? void 0 : y.getHeaderRowStyle()) == null ? void 0 : ue.bg) == null ? void 0 : de.rgb) || be, G = ((Z = (he = y == null ? void 0 : y.getFirstRowStyle()) == null ? void 0 : he.bg) == null ? void 0 : Z.rgb) || be, ae = ((we = (ye = y == null ? void 0 : y.getSecondRowStyle()) == null ? void 0 : ye.bg) == null ? void 0 : we.rgb) || be, se = ((Ue = (Ae = y == null ? void 0 : y.getLastRowStyle()) == null ? void 0 : Ae.bg) == null ? void 0 : Ue.rgb) || be;
|
|
1764
|
+
return /* @__PURE__ */ _(
|
|
1750
1765
|
"div",
|
|
1751
1766
|
{
|
|
1752
1767
|
className: "univer-h-10 univer-w-8 univer-cursor-pointer univer-p-px",
|
|
1753
1768
|
onClick: () => q(g),
|
|
1754
1769
|
style: {
|
|
1755
|
-
border: g ===
|
|
1770
|
+
border: g === T.theme ? Dt : $e
|
|
1756
1771
|
},
|
|
1757
1772
|
children: [
|
|
1758
1773
|
/* @__PURE__ */ o("div", { className: "univer-box-border univer-h-2.5", style: { background: z, border: `${Y}` } }),
|
|
@@ -1765,8 +1780,8 @@ const wi = (r) => {
|
|
|
1765
1780
|
);
|
|
1766
1781
|
}) }),
|
|
1767
1782
|
/* @__PURE__ */ o("h5", { children: a.t("sheets-table.customStyle") }),
|
|
1768
|
-
/* @__PURE__ */
|
|
1769
|
-
/* @__PURE__ */
|
|
1783
|
+
/* @__PURE__ */ _("div", { className: "univer-w-full univer-rounded-sm univer-border univer-border-solid univer-border-gray-200", children: [
|
|
1784
|
+
/* @__PURE__ */ _("div", { className: "univer-flex univer-flex-wrap univer-gap-2 univer-p-2", children: [
|
|
1770
1785
|
/* @__PURE__ */ o(
|
|
1771
1786
|
"div",
|
|
1772
1787
|
{
|
|
@@ -1779,18 +1794,18 @@ const wi = (r) => {
|
|
|
1779
1794
|
}
|
|
1780
1795
|
),
|
|
1781
1796
|
p.map((g) => {
|
|
1782
|
-
var ue, de, he, Z, ye, we,
|
|
1783
|
-
const y =
|
|
1784
|
-
return /* @__PURE__ */
|
|
1797
|
+
var ue, de, he, Z, ye, we, Ae, Ue;
|
|
1798
|
+
const y = d.getCustomRangeThemeStyle(e, g), z = (de = (ue = y == null ? void 0 : y.getHeaderRowStyle()) == null ? void 0 : ue.bg) == null ? void 0 : de.rgb, G = (Z = (he = y == null ? void 0 : y.getFirstRowStyle()) == null ? void 0 : he.bg) == null ? void 0 : Z.rgb, ae = (we = (ye = y == null ? void 0 : y.getSecondRowStyle()) == null ? void 0 : ye.bg) == null ? void 0 : we.rgb, se = (Ue = (Ae = y == null ? void 0 : y.getLastRowStyle()) == null ? void 0 : Ae.bg) == null ? void 0 : Ue.rgb;
|
|
1799
|
+
return /* @__PURE__ */ _(
|
|
1785
1800
|
"div",
|
|
1786
1801
|
{
|
|
1787
1802
|
className: "univer-relative univer-h-10 univer-w-8 univer-cursor-pointer univer-p-px",
|
|
1788
1803
|
onClick: () => q(g),
|
|
1789
1804
|
style: {
|
|
1790
|
-
border: g ===
|
|
1805
|
+
border: g === T.theme ? Dt : $e
|
|
1791
1806
|
},
|
|
1792
|
-
onMouseEnter: () =>
|
|
1793
|
-
onMouseLeave: () =>
|
|
1807
|
+
onMouseEnter: () => P(g),
|
|
1808
|
+
onMouseLeave: () => P(null),
|
|
1794
1809
|
children: [
|
|
1795
1810
|
/* @__PURE__ */ o("div", { className: "univer-box-border univer-h-2.5", style: { background: z != null ? z : Y, border: `${z ? Y : $e}` } }),
|
|
1796
1811
|
/* @__PURE__ */ o("div", { className: "univer-box-border univer-h-2.5", style: { background: G != null ? G : Y, border: `${G ? Y : $e}` } }),
|
|
@@ -1804,7 +1819,7 @@ const wi = (r) => {
|
|
|
1804
1819
|
univer-rounded-md univer-bg-gray-200 univer-text-center univer-text-xs
|
|
1805
1820
|
univer-leading-[10px]
|
|
1806
1821
|
`,
|
|
1807
|
-
style: { display:
|
|
1822
|
+
style: { display: V === g ? "block" : "none" },
|
|
1808
1823
|
onClick: (wr) => {
|
|
1809
1824
|
wr.stopPropagation(), Se(g);
|
|
1810
1825
|
},
|
|
@@ -1817,10 +1832,10 @@ const wi = (r) => {
|
|
|
1817
1832
|
);
|
|
1818
1833
|
})
|
|
1819
1834
|
] }),
|
|
1820
|
-
I && /* @__PURE__ */
|
|
1835
|
+
I && /* @__PURE__ */ _(St, { children: [
|
|
1821
1836
|
/* @__PURE__ */ o("div", { className: "univer-h-px univer-w-full univer-bg-gray-200" }),
|
|
1822
|
-
/* @__PURE__ */
|
|
1823
|
-
/* @__PURE__ */
|
|
1837
|
+
/* @__PURE__ */ _("div", { className: "univer-flex univer-flex-col univer-gap-2 univer-p-2", children: [
|
|
1838
|
+
/* @__PURE__ */ _("div", { className: "univer-flex univer-h-9 univer-gap-2", children: [
|
|
1824
1839
|
/* @__PURE__ */ o(
|
|
1825
1840
|
"div",
|
|
1826
1841
|
{
|
|
@@ -1836,14 +1851,14 @@ const wi = (r) => {
|
|
|
1836
1851
|
}
|
|
1837
1852
|
),
|
|
1838
1853
|
/* @__PURE__ */ o(
|
|
1839
|
-
|
|
1854
|
+
ke,
|
|
1840
1855
|
{
|
|
1841
1856
|
overlay: /* @__PURE__ */ o("div", { className: "univer-p-2", children: /* @__PURE__ */ o(
|
|
1842
1857
|
Qe,
|
|
1843
1858
|
{
|
|
1844
1859
|
value: m,
|
|
1845
1860
|
onChange: (g) => {
|
|
1846
|
-
const y =
|
|
1861
|
+
const y = xt("headerRowStyle", {
|
|
1847
1862
|
bg: {
|
|
1848
1863
|
rgb: g
|
|
1849
1864
|
},
|
|
@@ -1855,7 +1870,7 @@ const wi = (r) => {
|
|
|
1855
1870
|
}
|
|
1856
1871
|
}
|
|
1857
1872
|
) }),
|
|
1858
|
-
children: /* @__PURE__ */
|
|
1873
|
+
children: /* @__PURE__ */ _(
|
|
1859
1874
|
"div",
|
|
1860
1875
|
{
|
|
1861
1876
|
className: `
|
|
@@ -1884,7 +1899,7 @@ const wi = (r) => {
|
|
|
1884
1899
|
}
|
|
1885
1900
|
)
|
|
1886
1901
|
] }),
|
|
1887
|
-
/* @__PURE__ */
|
|
1902
|
+
/* @__PURE__ */ _("div", { className: "univer-flex univer-h-9 univer-gap-2", children: [
|
|
1888
1903
|
/* @__PURE__ */ o(
|
|
1889
1904
|
"div",
|
|
1890
1905
|
{
|
|
@@ -1900,7 +1915,7 @@ const wi = (r) => {
|
|
|
1900
1915
|
}
|
|
1901
1916
|
),
|
|
1902
1917
|
/* @__PURE__ */ o(
|
|
1903
|
-
|
|
1918
|
+
ke,
|
|
1904
1919
|
{
|
|
1905
1920
|
overlay: /* @__PURE__ */ o("div", { className: "univer-p-2", children: /* @__PURE__ */ o(
|
|
1906
1921
|
Qe,
|
|
@@ -1920,7 +1935,7 @@ const wi = (r) => {
|
|
|
1920
1935
|
}
|
|
1921
1936
|
}
|
|
1922
1937
|
) }),
|
|
1923
|
-
children: /* @__PURE__ */
|
|
1938
|
+
children: /* @__PURE__ */ _(
|
|
1924
1939
|
"div",
|
|
1925
1940
|
{
|
|
1926
1941
|
className: `
|
|
@@ -1946,7 +1961,7 @@ const wi = (r) => {
|
|
|
1946
1961
|
}
|
|
1947
1962
|
)
|
|
1948
1963
|
] }),
|
|
1949
|
-
/* @__PURE__ */
|
|
1964
|
+
/* @__PURE__ */ _("div", { className: "univer-flex univer-h-9 univer-gap-2", children: [
|
|
1950
1965
|
/* @__PURE__ */ o(
|
|
1951
1966
|
"div",
|
|
1952
1967
|
{
|
|
@@ -1962,7 +1977,7 @@ const wi = (r) => {
|
|
|
1962
1977
|
}
|
|
1963
1978
|
),
|
|
1964
1979
|
/* @__PURE__ */ o(
|
|
1965
|
-
|
|
1980
|
+
ke,
|
|
1966
1981
|
{
|
|
1967
1982
|
overlay: /* @__PURE__ */ o("div", { className: "univer-p-2", children: /* @__PURE__ */ o(
|
|
1968
1983
|
Qe,
|
|
@@ -1980,7 +1995,7 @@ const wi = (r) => {
|
|
|
1980
1995
|
})
|
|
1981
1996
|
}
|
|
1982
1997
|
) }),
|
|
1983
|
-
children: /* @__PURE__ */
|
|
1998
|
+
children: /* @__PURE__ */ _(
|
|
1984
1999
|
"div",
|
|
1985
2000
|
{
|
|
1986
2001
|
className: `
|
|
@@ -2006,7 +2021,7 @@ const wi = (r) => {
|
|
|
2006
2021
|
}
|
|
2007
2022
|
)
|
|
2008
2023
|
] }),
|
|
2009
|
-
/* @__PURE__ */
|
|
2024
|
+
/* @__PURE__ */ _("div", { className: "univer-flex univer-h-9 univer-gap-2", children: [
|
|
2010
2025
|
/* @__PURE__ */ o(
|
|
2011
2026
|
"div",
|
|
2012
2027
|
{
|
|
@@ -2022,14 +2037,14 @@ const wi = (r) => {
|
|
|
2022
2037
|
}
|
|
2023
2038
|
),
|
|
2024
2039
|
/* @__PURE__ */ o(
|
|
2025
|
-
|
|
2040
|
+
ke,
|
|
2026
2041
|
{
|
|
2027
2042
|
overlay: /* @__PURE__ */ o("div", { className: "univer-p-2", children: /* @__PURE__ */ o(
|
|
2028
2043
|
Qe,
|
|
2029
2044
|
{
|
|
2030
2045
|
value: f,
|
|
2031
2046
|
onChange: (g) => {
|
|
2032
|
-
const y =
|
|
2047
|
+
const y = xt("lastRowStyle", {
|
|
2033
2048
|
bg: {
|
|
2034
2049
|
rgb: g
|
|
2035
2050
|
},
|
|
@@ -2041,7 +2056,7 @@ const wi = (r) => {
|
|
|
2041
2056
|
}
|
|
2042
2057
|
}
|
|
2043
2058
|
) }),
|
|
2044
|
-
children: /* @__PURE__ */
|
|
2059
|
+
children: /* @__PURE__ */ _(
|
|
2045
2060
|
"div",
|
|
2046
2061
|
{
|
|
2047
2062
|
className: `
|
|
@@ -2071,159 +2086,159 @@ const wi = (r) => {
|
|
|
2071
2086
|
] })
|
|
2072
2087
|
] })
|
|
2073
2088
|
] }) : null;
|
|
2074
|
-
},
|
|
2075
|
-
function
|
|
2089
|
+
}, Cr = "sheet.table.context-insert_menu-id", Sr = "sheet.table.context-remove_menu-id";
|
|
2090
|
+
function Ri(r) {
|
|
2076
2091
|
return {
|
|
2077
|
-
id:
|
|
2078
|
-
type:
|
|
2092
|
+
id: wt.id,
|
|
2093
|
+
type: Ne.BUTTON,
|
|
2079
2094
|
icon: lr,
|
|
2080
2095
|
tooltip: "sheets-table.title",
|
|
2081
2096
|
title: "sheets-table.title"
|
|
2082
2097
|
};
|
|
2083
2098
|
}
|
|
2084
|
-
function
|
|
2099
|
+
function xi(r) {
|
|
2085
2100
|
return {
|
|
2086
|
-
id:
|
|
2087
|
-
type:
|
|
2101
|
+
id: Cr,
|
|
2102
|
+
type: Ne.SUBITEMS,
|
|
2088
2103
|
icon: "Insert",
|
|
2089
2104
|
title: "sheets-table.insert.main",
|
|
2090
|
-
hidden$:
|
|
2105
|
+
hidden$: _r(r)
|
|
2091
2106
|
};
|
|
2092
2107
|
}
|
|
2093
2108
|
function Ni(r) {
|
|
2094
2109
|
return {
|
|
2095
|
-
id:
|
|
2096
|
-
type:
|
|
2110
|
+
id: Sr,
|
|
2111
|
+
type: Ne.SUBITEMS,
|
|
2097
2112
|
icon: "Reduce",
|
|
2098
2113
|
title: "sheets-table.remove.main",
|
|
2099
|
-
hidden$:
|
|
2114
|
+
hidden$: _r(r)
|
|
2100
2115
|
};
|
|
2101
2116
|
}
|
|
2102
|
-
function
|
|
2117
|
+
function Ei(r) {
|
|
2103
2118
|
return {
|
|
2104
2119
|
id: zt.id,
|
|
2105
|
-
type:
|
|
2120
|
+
type: Ne.BUTTON,
|
|
2106
2121
|
title: "sheets-table.insert.row",
|
|
2107
|
-
hidden$:
|
|
2122
|
+
hidden$: Tr(r)
|
|
2108
2123
|
};
|
|
2109
2124
|
}
|
|
2110
|
-
function
|
|
2125
|
+
function Li(r) {
|
|
2111
2126
|
return {
|
|
2112
2127
|
id: Qt.id,
|
|
2113
2128
|
title: "sheets-table.insert.col",
|
|
2114
|
-
type:
|
|
2129
|
+
type: Ne.BUTTON
|
|
2115
2130
|
};
|
|
2116
2131
|
}
|
|
2117
|
-
function
|
|
2132
|
+
function $i(r) {
|
|
2118
2133
|
return {
|
|
2119
2134
|
id: Yt.id,
|
|
2120
|
-
type:
|
|
2135
|
+
type: Ne.BUTTON,
|
|
2121
2136
|
title: "sheets-table.remove.row",
|
|
2122
|
-
hidden$:
|
|
2137
|
+
hidden$: Tr(r)
|
|
2123
2138
|
};
|
|
2124
2139
|
}
|
|
2125
|
-
function
|
|
2140
|
+
function Oi(r) {
|
|
2126
2141
|
return {
|
|
2127
2142
|
id: qt.id,
|
|
2128
2143
|
title: "sheets-table.remove.col",
|
|
2129
|
-
type:
|
|
2144
|
+
type: Ne.BUTTON
|
|
2130
2145
|
};
|
|
2131
2146
|
}
|
|
2132
|
-
function
|
|
2147
|
+
function _r(r) {
|
|
2133
2148
|
const e = r.get(lt);
|
|
2134
|
-
return r.get(Ce).getCurrentTypeOfUnit$(
|
|
2149
|
+
return r.get(Ce).getCurrentTypeOfUnit$(it.UNIVER_SHEET).pipe(
|
|
2135
2150
|
Re((i) => i ? i.activeSheet$.pipe(
|
|
2136
2151
|
Re((a) => a ? e.selectionMoveEnd$.pipe(
|
|
2137
2152
|
Re((s) => {
|
|
2138
2153
|
if (!s.length || s.length > 1) return X(!0);
|
|
2139
|
-
const
|
|
2154
|
+
const d = s[0].range, u = r.get(Gt).getContainerTableWithRange(i.getUnitId(), a.getSheetId(), d);
|
|
2140
2155
|
return X(!u);
|
|
2141
2156
|
})
|
|
2142
2157
|
) : X(!0))
|
|
2143
2158
|
) : X(!0))
|
|
2144
2159
|
);
|
|
2145
2160
|
}
|
|
2146
|
-
function
|
|
2161
|
+
function Tr(r) {
|
|
2147
2162
|
const e = r.get(lt);
|
|
2148
|
-
return r.get(Ce).getCurrentTypeOfUnit$(
|
|
2163
|
+
return r.get(Ce).getCurrentTypeOfUnit$(it.UNIVER_SHEET).pipe(
|
|
2149
2164
|
Re((i) => i ? i.activeSheet$.pipe(
|
|
2150
2165
|
Re((a) => a ? e.selectionMoveEnd$.pipe(
|
|
2151
2166
|
Re((s) => {
|
|
2152
2167
|
if (!s.length || s.length > 1) return X(!0);
|
|
2153
|
-
const
|
|
2168
|
+
const d = s[0].range, u = r.get(Gt).getContainerTableWithRange(i.getUnitId(), a.getSheetId(), d);
|
|
2154
2169
|
if (!u)
|
|
2155
2170
|
return X(!0);
|
|
2156
|
-
const
|
|
2157
|
-
return
|
|
2171
|
+
const b = u.getRange();
|
|
2172
|
+
return d.startRow === b.startRow ? X(!0) : X(!1);
|
|
2158
2173
|
})
|
|
2159
2174
|
) : X(!0))
|
|
2160
2175
|
) : X(!0))
|
|
2161
2176
|
);
|
|
2162
2177
|
}
|
|
2163
|
-
const
|
|
2164
|
-
[
|
|
2165
|
-
[
|
|
2178
|
+
const Pi = {
|
|
2179
|
+
[cn.FORMULAS_VIEW]: {
|
|
2180
|
+
[wt.id]: {
|
|
2166
2181
|
order: 0,
|
|
2167
|
-
menuItemFactory:
|
|
2182
|
+
menuItemFactory: Ri
|
|
2168
2183
|
}
|
|
2169
2184
|
},
|
|
2170
|
-
[
|
|
2171
|
-
[
|
|
2172
|
-
[
|
|
2185
|
+
[ln.MAIN_AREA]: {
|
|
2186
|
+
[on.LAYOUT]: {
|
|
2187
|
+
[Cr]: {
|
|
2173
2188
|
order: 5,
|
|
2174
|
-
menuItemFactory:
|
|
2189
|
+
menuItemFactory: xi,
|
|
2175
2190
|
[zt.id]: {
|
|
2176
2191
|
order: 1,
|
|
2177
|
-
menuItemFactory:
|
|
2192
|
+
menuItemFactory: Ei
|
|
2178
2193
|
},
|
|
2179
2194
|
[Qt.id]: {
|
|
2180
2195
|
order: 2,
|
|
2181
|
-
menuItemFactory:
|
|
2196
|
+
menuItemFactory: Li
|
|
2182
2197
|
}
|
|
2183
2198
|
},
|
|
2184
|
-
[
|
|
2199
|
+
[Sr]: {
|
|
2185
2200
|
order: 6,
|
|
2186
2201
|
menuItemFactory: Ni,
|
|
2187
2202
|
[Yt.id]: {
|
|
2188
2203
|
order: 1,
|
|
2189
|
-
menuItemFactory:
|
|
2204
|
+
menuItemFactory: $i
|
|
2190
2205
|
},
|
|
2191
2206
|
[qt.id]: {
|
|
2192
2207
|
order: 2,
|
|
2193
|
-
menuItemFactory:
|
|
2208
|
+
menuItemFactory: Oi
|
|
2194
2209
|
}
|
|
2195
2210
|
}
|
|
2196
2211
|
}
|
|
2197
2212
|
}
|
|
2198
2213
|
};
|
|
2199
|
-
var
|
|
2200
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
2214
|
+
var ki = Object.getOwnPropertyDescriptor, Di = (r, e, t, n) => {
|
|
2215
|
+
for (var i = n > 1 ? void 0 : n ? ki(e, t) : e, a = r.length - 1, s; a >= 0; a--)
|
|
2201
2216
|
(s = r[a]) && (i = s(i) || i);
|
|
2202
2217
|
return i;
|
|
2203
|
-
},
|
|
2204
|
-
let
|
|
2218
|
+
}, Ft = (r, e) => (t, n) => e(t, n, r);
|
|
2219
|
+
let tt = class extends Fe {
|
|
2205
2220
|
constructor(r, e) {
|
|
2206
2221
|
super(), this._componentManager = r, this._menuManagerService = e, this._initComponents(), this._initMenu();
|
|
2207
2222
|
}
|
|
2208
2223
|
_initComponents() {
|
|
2209
2224
|
[
|
|
2210
|
-
[lr,
|
|
2211
|
-
[
|
|
2212
|
-
[or,
|
|
2225
|
+
[lr, mr],
|
|
2226
|
+
[Pe, Ii],
|
|
2227
|
+
[or, Mi]
|
|
2213
2228
|
].forEach(([r, e]) => {
|
|
2214
2229
|
this.disposeWithMe(this._componentManager.register(r, e));
|
|
2215
2230
|
});
|
|
2216
2231
|
}
|
|
2217
2232
|
_initMenu() {
|
|
2218
|
-
this._menuManagerService.mergeMenu(
|
|
2233
|
+
this._menuManagerService.mergeMenu(Pi);
|
|
2219
2234
|
}
|
|
2220
2235
|
};
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
],
|
|
2225
|
-
var
|
|
2226
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
2236
|
+
tt = Di([
|
|
2237
|
+
Ft(0, N(Xt)),
|
|
2238
|
+
Ft(1, N(un))
|
|
2239
|
+
], tt);
|
|
2240
|
+
var Bi = Object.getOwnPropertyDescriptor, Fi = (r, e, t, n) => {
|
|
2241
|
+
for (var i = n > 1 ? void 0 : n ? Bi(e, t) : e, a = r.length - 1, s; a >= 0; a--)
|
|
2227
2242
|
(s = r[a]) && (i = s(i) || i);
|
|
2228
2243
|
return i;
|
|
2229
2244
|
}, Ke = (r, e) => (t, n) => e(t, n, r);
|
|
@@ -2258,18 +2273,18 @@ let pt = class extends Wt {
|
|
|
2258
2273
|
);
|
|
2259
2274
|
}
|
|
2260
2275
|
};
|
|
2261
|
-
pt =
|
|
2262
|
-
Ke(1,
|
|
2263
|
-
Ke(2,
|
|
2264
|
-
Ke(3,
|
|
2265
|
-
Ke(4,
|
|
2276
|
+
pt = Fi([
|
|
2277
|
+
Ke(1, N(He)),
|
|
2278
|
+
Ke(2, N(at)),
|
|
2279
|
+
Ke(3, N(te)),
|
|
2280
|
+
Ke(4, N(xe))
|
|
2266
2281
|
], pt);
|
|
2267
|
-
var
|
|
2268
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
2282
|
+
var Hi = Object.getOwnPropertyDescriptor, Vi = (r, e, t, n) => {
|
|
2283
|
+
for (var i = n > 1 ? void 0 : n ? Hi(e, t) : e, a = r.length - 1, s; a >= 0; a--)
|
|
2269
2284
|
(s = r[a]) && (i = s(i) || i);
|
|
2270
2285
|
return i;
|
|
2271
2286
|
}, ht = (r, e) => (t, n) => e(t, n, r);
|
|
2272
|
-
let
|
|
2287
|
+
let rt = class extends Fe {
|
|
2273
2288
|
constructor(r, e, t) {
|
|
2274
2289
|
super(), this._sheetInterceptorService = r, this._univerInstanceService = e, this._tableManager = t, this._initSelectionChange();
|
|
2275
2290
|
}
|
|
@@ -2277,31 +2292,31 @@ let it = class extends Be {
|
|
|
2277
2292
|
this.disposeWithMe(
|
|
2278
2293
|
this._sheetInterceptorService.interceptCommand({
|
|
2279
2294
|
getMutations: (r) => {
|
|
2280
|
-
if (r.id ===
|
|
2295
|
+
if (r.id === tn.id) {
|
|
2281
2296
|
const e = st(this._univerInstanceService);
|
|
2282
2297
|
if (!e)
|
|
2283
2298
|
return { redos: [], undos: [] };
|
|
2284
|
-
const t = r.params, { range: n } = t, { unitId: i, subUnitId: a, worksheet: s } = e,
|
|
2285
|
-
const u =
|
|
2299
|
+
const t = r.params, { range: n } = t, { unitId: i, subUnitId: a, worksheet: s } = e, d = this._tableManager.getTablesBySubunitId(i, a).find((h) => {
|
|
2300
|
+
const u = h.getRange();
|
|
2286
2301
|
return pe.contains(u, n);
|
|
2287
2302
|
});
|
|
2288
|
-
if (
|
|
2289
|
-
const
|
|
2290
|
-
...
|
|
2291
|
-
startRow:
|
|
2303
|
+
if (d) {
|
|
2304
|
+
const h = d.getRange(), u = {
|
|
2305
|
+
...h,
|
|
2306
|
+
startRow: h.startRow + 1
|
|
2292
2307
|
};
|
|
2293
|
-
return pe.equals(
|
|
2308
|
+
return pe.equals(h, n) ? { undos: [], redos: [] } : pe.equals(u, n) ? {
|
|
2294
2309
|
undos: [],
|
|
2295
2310
|
redos: [
|
|
2296
2311
|
{
|
|
2297
|
-
id:
|
|
2312
|
+
id: $t.id,
|
|
2298
2313
|
params: {
|
|
2299
2314
|
unitId: i,
|
|
2300
2315
|
subUnitId: a,
|
|
2301
2316
|
selections: [
|
|
2302
2317
|
{
|
|
2303
|
-
range:
|
|
2304
|
-
primary:
|
|
2318
|
+
range: h,
|
|
2319
|
+
primary: Lt(h, s)
|
|
2305
2320
|
}
|
|
2306
2321
|
]
|
|
2307
2322
|
}
|
|
@@ -2311,14 +2326,14 @@ let it = class extends Be {
|
|
|
2311
2326
|
undos: [],
|
|
2312
2327
|
redos: [
|
|
2313
2328
|
{
|
|
2314
|
-
id:
|
|
2329
|
+
id: $t.id,
|
|
2315
2330
|
params: {
|
|
2316
2331
|
unitId: i,
|
|
2317
2332
|
subUnitId: a,
|
|
2318
2333
|
selections: [
|
|
2319
2334
|
{
|
|
2320
2335
|
range: u,
|
|
2321
|
-
primary:
|
|
2336
|
+
primary: Lt(u, s)
|
|
2322
2337
|
}
|
|
2323
2338
|
]
|
|
2324
2339
|
}
|
|
@@ -2333,36 +2348,36 @@ let it = class extends Be {
|
|
|
2333
2348
|
);
|
|
2334
2349
|
}
|
|
2335
2350
|
};
|
|
2336
|
-
|
|
2337
|
-
ht(0,
|
|
2338
|
-
ht(1,
|
|
2339
|
-
ht(2,
|
|
2340
|
-
],
|
|
2341
|
-
var
|
|
2342
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
2351
|
+
rt = Vi([
|
|
2352
|
+
ht(0, N(ir)),
|
|
2353
|
+
ht(1, N(Ce)),
|
|
2354
|
+
ht(2, N(te))
|
|
2355
|
+
], rt);
|
|
2356
|
+
var Ai = Object.defineProperty, Ui = Object.getOwnPropertyDescriptor, ji = (r, e, t) => e in r ? Ai(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, Wi = (r, e, t, n) => {
|
|
2357
|
+
for (var i = n > 1 ? void 0 : n ? Ui(e, t) : e, a = r.length - 1, s; a >= 0; a--)
|
|
2343
2358
|
(s = r[a]) && (i = s(i) || i);
|
|
2344
2359
|
return i;
|
|
2345
|
-
}, Je = (r, e) => (t, n) => e(t, n, r),
|
|
2346
|
-
let
|
|
2360
|
+
}, Je = (r, e) => (t, n) => e(t, n, r), yr = (r, e, t) => ji(r, typeof e != "symbol" ? e + "" : e, t);
|
|
2361
|
+
let nt = class extends Lr {
|
|
2347
2362
|
constructor(r = {}, e, t, n, i) {
|
|
2348
|
-
super(), this._config = r, this._injector = e, this._commandService = t, this._configService = n, this._renderManagerService = i, this._initRegisterCommand(), this._configService.setConfig(
|
|
2363
|
+
super(), this._config = r, this._injector = e, this._commandService = t, this._configService = n, this._renderManagerService = i, this._initRegisterCommand(), this._configService.setConfig(fr, this._config);
|
|
2349
2364
|
}
|
|
2350
2365
|
onStarting() {
|
|
2351
|
-
|
|
2366
|
+
$r(this._injector, [
|
|
2367
|
+
[Be],
|
|
2352
2368
|
[De],
|
|
2353
|
-
[
|
|
2354
|
-
[
|
|
2355
|
-
[
|
|
2356
|
-
[it]
|
|
2369
|
+
[tt],
|
|
2370
|
+
[xe],
|
|
2371
|
+
[rt]
|
|
2357
2372
|
]);
|
|
2358
2373
|
}
|
|
2359
2374
|
onReady() {
|
|
2360
|
-
|
|
2375
|
+
Or(this._injector, [
|
|
2376
|
+
[Be],
|
|
2361
2377
|
[De],
|
|
2362
|
-
[
|
|
2363
|
-
[
|
|
2364
|
-
[
|
|
2365
|
-
[it]
|
|
2378
|
+
[tt],
|
|
2379
|
+
[xe],
|
|
2380
|
+
[rt]
|
|
2366
2381
|
]);
|
|
2367
2382
|
}
|
|
2368
2383
|
onRendered() {
|
|
@@ -2373,23 +2388,26 @@ let Ft = (et = class extends Er {
|
|
|
2373
2388
|
[mt],
|
|
2374
2389
|
[pt]
|
|
2375
2390
|
];
|
|
2376
|
-
this._config.hideAnchor !== !0 && r.push([
|
|
2377
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
2391
|
+
this._config.hideAnchor !== !0 && r.push([et]), r.forEach((e) => {
|
|
2392
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(it.UNIVER_SHEET, e));
|
|
2378
2393
|
});
|
|
2379
2394
|
}
|
|
2380
2395
|
_initRegisterCommand() {
|
|
2381
2396
|
[
|
|
2382
2397
|
bt,
|
|
2383
|
-
|
|
2398
|
+
wt
|
|
2384
2399
|
].forEach((r) => this._commandService.registerCommand(r));
|
|
2385
2400
|
}
|
|
2386
|
-
}
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2401
|
+
};
|
|
2402
|
+
yr(nt, "pluginName", On);
|
|
2403
|
+
yr(nt, "type", it.UNIVER_SHEET);
|
|
2404
|
+
nt = Wi([
|
|
2405
|
+
Er(Yr),
|
|
2406
|
+
Je(1, N(He)),
|
|
2407
|
+
Je(2, N(ee)),
|
|
2390
2408
|
Je(3, Ut),
|
|
2391
2409
|
Je(4, Zt)
|
|
2392
|
-
],
|
|
2410
|
+
], nt);
|
|
2393
2411
|
export {
|
|
2394
|
-
|
|
2412
|
+
nt as UniverSheetTableUIPlugin
|
|
2395
2413
|
};
|