@univerjs/sheets-table-ui 0.7.0-nightly.202505161607 → 0.7.0-nightly.202505171606
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 +1 -1
- package/lib/es/index.js +416 -418
- package/lib/index.css +1 -1
- package/lib/index.js +416 -418
- package/lib/umd/index.js +1 -1
- package/package.json +11 -11
package/lib/es/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
var Nn = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { Inject as
|
|
5
|
-
import { IRenderManagerService as
|
|
6
|
-
import { TableManager as ne, SheetTableService as
|
|
7
|
-
import { SheetCanvasPopManagerService as
|
|
8
|
-
import { useDependency as
|
|
9
|
-
import { startWith as
|
|
2
|
+
var Rn = (t, e, n) => e in t ? Nn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var A = (t, e, n) => Rn(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { Inject as R, IUniverInstanceService as _e, ICommandService as ce, Disposable as Fe, ObjectMatrix as En, cellToRange as At, Rectangle as Ce, LocaleService as ue, Injector as He, dayjs as be, IPermissionService as Ut, IContextService as St, CommandType as Wt, IConfigService as jt, ThemeService as xn, RxDisposable as Zt, InterceptorEffectEnum as Ln, ErrorService as $n, ColorKit as oe, UniverInstanceType as at, DependentOn as Pn, Plugin as On, merge as kn, registerDependencies as Dn, touchDependencies as Bn } from "@univerjs/core";
|
|
5
|
+
import { IRenderManagerService as qt, SHEET_VIEWPORT_KEY as Fn, convertTransformToOffsetX as Hn, convertTransformToOffsetY as Vn, Rect as Nt, Shape as An } from "@univerjs/engine-render";
|
|
6
|
+
import { TableManager as ne, SheetTableService as Un, SetSheetTableFilterCommand as Rt, isConditionFilter as Wn, isManualFilter as jn, TableDateCompareTypeEnum as l, TableStringCompareTypeEnum as W, TableConditionTypeEnum as B, TableNumberCompareTypeEnum as $, SheetsTableSortStateEnum as qe, TableColumnFilterTypeEnum as Et, AddSheetTableCommand as Zn, SHEET_TABLE_CUSTOM_THEME_PREFIX as qn, DeleteSheetTableCommand as Yn, SetSheetTableCommand as bt, SheetsTableButtonStateEnum as $e, processStyleWithBorderStyle as xt, customEmptyThemeWithBorderStyle as Qn, AddTableThemeCommand as Gn, RemoveTableThemeCommand as zn, SheetTableRemoveColCommand as Yt, SheetTableRemoveRowCommand as Qt, SheetTableInsertColCommand as Gt, SheetTableInsertRowCommand as zt, SheetsTableController as Xt, UniverSheetsTablePlugin as Xn } from "@univerjs/sheets-table";
|
|
7
|
+
import { SheetCanvasPopManagerService as Kn, SheetSkeletonManagerService as st, SheetScrollManagerService as Jn, SetZoomRatioOperation as er, SetScrollOperation as tr, getSheetObject as nr, getCoordByCell as rr, getCurrentRangeDisable$ as ir, SelectAllCommand as ar } from "@univerjs/sheets-ui";
|
|
8
|
+
import { useDependency as N, ComponentManager as Kt, IDialogService as Jt, ISidebarService as sr, useObservable as Me, IUIPartsService as lr, BuiltInUIPart as or, connectInjector as cr, MenuItemType as Ee, ContextMenuPosition as ur, ContextMenuGroup as dr, RibbonDataGroup as hr, IMenuManagerService as vr } from "@univerjs/ui";
|
|
9
|
+
import { startWith as en, distinctUntilChanged as gr, Subject as br, BehaviorSubject as Lt, merge as _t, filter as mr, debounceTime as pr, switchMap as Ne, of as J, map as fr, takeUntil as Cr } from "rxjs";
|
|
10
10
|
import { jsxs as w, jsx as o, Fragment as Tt } from "react/jsx-runtime";
|
|
11
|
-
import { Dropdown as
|
|
12
|
-
import { SetRangeValuesMutation as Nr, WorkbookEditablePermission as
|
|
13
|
-
import { SortRangeCommand as
|
|
14
|
-
import { forwardRef as re, useRef as Pr, createElement as ie, useState as Z, useMemo as
|
|
15
|
-
import { serializeRange as Bt, deserializeRangeWithSheet as
|
|
16
|
-
import { RangeSelector as
|
|
17
|
-
const
|
|
11
|
+
import { Dropdown as ke, clsx as k, borderClassName as F, CascaderList as Sr, Input as wt, InputNumber as dt, DatePicker as _r, DateRangePicker as Tr, Select as wr, Checkbox as $t, scrollbarClassName as Ir, ButtonGroup as yr, Button as ye, Segmented as Mr, ColorPicker as Ye } from "@univerjs/design";
|
|
12
|
+
import { SetRangeValuesMutation as Nr, WorkbookEditablePermission as tn, getSheetCommandTarget as lt, SheetsSelectionsService as ot, isSingleCellSelection as Rr, expandToContinuousRange as Er, SetRangeThemeMutation as nn, WorkbookPermissionService as rn, SheetRangeThemeModel as an, SheetInterceptorService as sn, INTERCEPTOR_POINT as xr, RangeThemeStyle as Lr, getPrimaryForRange as Pt, SetSelectionsOperation as Ot } from "@univerjs/sheets";
|
|
13
|
+
import { SortRangeCommand as $r, SortType as kt } from "@univerjs/sheets-sort";
|
|
14
|
+
import { forwardRef as re, useRef as Pr, createElement as ie, useState as Z, useMemo as ln, useCallback as Dt, useEffect as on } from "react";
|
|
15
|
+
import { serializeRange as Bt, deserializeRangeWithSheet as Or } from "@univerjs/engine-formula";
|
|
16
|
+
import { RangeSelector as kr } from "@univerjs/sheets-formula-ui";
|
|
17
|
+
const Dr = "SHEET_TABLE_UI_PLUGIN", pe = "SHEETS_TABLE_FILTER_PANEL_OPENED_KEY", Br = "UNIVER_SHEET_Table_FILTER_PANEL_ID", cn = "TABLE_TOOLBAR_BUTTON", Oe = "TABLE_SELECTOR_DIALOG", Fr = "SHEET_TABLE_THEME_PANEL_ID", un = "SHEET_TABLE_THEME_PANEL", ht = "table-custom-", Hr = "table-default-", me = "rgb(255, 255, 255)", G = "none", Qe = "1px solid rgb(var(--grey-200))";
|
|
18
18
|
var z = function() {
|
|
19
19
|
return z = Object.assign || function(t) {
|
|
20
20
|
for (var e, n = 1, r = arguments.length; n < r; n++) {
|
|
@@ -23,7 +23,7 @@ var z = function() {
|
|
|
23
23
|
}
|
|
24
24
|
return t;
|
|
25
25
|
}, z.apply(this, arguments);
|
|
26
|
-
},
|
|
26
|
+
}, Vr = function(t, e) {
|
|
27
27
|
var n = {};
|
|
28
28
|
for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]);
|
|
29
29
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -31,15 +31,15 @@ var z = function() {
|
|
|
31
31
|
e.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[i]) && (n[r[i]] = t[r[i]]);
|
|
32
32
|
return n;
|
|
33
33
|
}, ae = re(function(t, e) {
|
|
34
|
-
var n = t.icon, r = t.id, i = t.className, a = t.extend, s =
|
|
35
|
-
return
|
|
34
|
+
var n = t.icon, r = t.id, i = t.className, a = t.extend, s = Vr(t, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(r, " ").concat(i || "").trim(), d = Pr("_".concat(Wr()));
|
|
35
|
+
return dn(n, "".concat(r), { defIds: n.defIds, idSuffix: d.current }, z({ ref: e, className: c }, s), a);
|
|
36
36
|
});
|
|
37
|
-
function
|
|
38
|
-
return ie(t.tag, z(z({ key: e },
|
|
39
|
-
return
|
|
37
|
+
function dn(t, e, n, r, i) {
|
|
38
|
+
return ie(t.tag, z(z({ key: e }, Ar(t, n, i)), r), (Ur(t, n).children || []).map(function(a, s) {
|
|
39
|
+
return dn(a, "".concat(e, "-").concat(t.tag, "-").concat(s), n, void 0, i);
|
|
40
40
|
}));
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function Ar(t, e, n) {
|
|
43
43
|
var r = z({}, t.attrs);
|
|
44
44
|
n != null && n.colorChannel1 && r.fill === "colorChannel1" && (r.fill = n.colorChannel1), t.tag === "mask" && r.id && (r.id = r.id + e.idSuffix), Object.entries(r).forEach(function(a) {
|
|
45
45
|
var s = a[0], c = a[1];
|
|
@@ -51,97 +51,97 @@ function Ur(t, e, n) {
|
|
|
51
51
|
typeof c == "string" && (r[s] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
52
52
|
})), r;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function Ur(t, e) {
|
|
55
55
|
var n, r = e.defIds;
|
|
56
56
|
return !r || r.length === 0 ? t : t.tag === "defs" && (!((n = t.children) === null || n === void 0) && n.length) ? z(z({}, t), { children: t.children.map(function(i) {
|
|
57
57
|
return typeof i.attrs.id == "string" && r && r.indexOf(i.attrs.id) > -1 ? z(z({}, i), { attrs: z(z({}, i.attrs), { id: i.attrs.id + e.idSuffix }) }) : i;
|
|
58
58
|
}) }) : t;
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function Wr() {
|
|
61
61
|
return Math.random().toString(36).substring(2, 8);
|
|
62
62
|
}
|
|
63
63
|
ae.displayName = "UniverIcon";
|
|
64
|
-
var
|
|
64
|
+
var jr = { 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" } }] }, hn = re(function(t, e) {
|
|
65
65
|
return ie(ae, Object.assign({}, t, {
|
|
66
66
|
id: "ascending- single",
|
|
67
67
|
ref: e,
|
|
68
|
-
icon:
|
|
68
|
+
icon: jr
|
|
69
69
|
}));
|
|
70
70
|
});
|
|
71
|
-
|
|
72
|
-
var
|
|
71
|
+
hn.displayName = "AscendingSingle";
|
|
72
|
+
var Zr = { 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" } }] }, vn = re(function(t, e) {
|
|
73
73
|
return ie(ae, Object.assign({}, t, {
|
|
74
74
|
id: "delete-single",
|
|
75
75
|
ref: e,
|
|
76
|
-
icon:
|
|
76
|
+
icon: Zr
|
|
77
77
|
}));
|
|
78
78
|
});
|
|
79
|
-
|
|
80
|
-
var
|
|
79
|
+
vn.displayName = "DeleteSingle";
|
|
80
|
+
var qr = { 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" } }] }, gn = re(function(t, e) {
|
|
81
81
|
return ie(ae, Object.assign({}, t, {
|
|
82
82
|
id: "descending-single",
|
|
83
83
|
ref: e,
|
|
84
|
-
icon:
|
|
84
|
+
icon: qr
|
|
85
85
|
}));
|
|
86
86
|
});
|
|
87
|
-
|
|
88
|
-
var
|
|
87
|
+
gn.displayName = "DescendingSingle";
|
|
88
|
+
var Yr = { 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" } }] }, Ue = re(function(t, e) {
|
|
89
89
|
return ie(ae, Object.assign({}, t, {
|
|
90
90
|
id: "dropdown-single",
|
|
91
91
|
ref: e,
|
|
92
|
-
icon:
|
|
92
|
+
icon: Yr
|
|
93
93
|
}));
|
|
94
94
|
});
|
|
95
|
-
|
|
96
|
-
var
|
|
95
|
+
Ue.displayName = "DropdownSingle";
|
|
96
|
+
var Qr = { 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" } }] }, bn = re(function(t, e) {
|
|
97
97
|
return ie(ae, Object.assign({}, t, {
|
|
98
98
|
id: "grid-outline-single",
|
|
99
99
|
ref: e,
|
|
100
|
-
icon:
|
|
100
|
+
icon: Qr
|
|
101
101
|
}));
|
|
102
102
|
});
|
|
103
|
-
|
|
104
|
-
var
|
|
103
|
+
bn.displayName = "GridOutlineSingle";
|
|
104
|
+
var Gr = { 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" } }] }, It = re(function(t, e) {
|
|
105
105
|
return ie(ae, Object.assign({}, t, {
|
|
106
106
|
id: "more-down-single",
|
|
107
107
|
ref: e,
|
|
108
|
-
icon:
|
|
108
|
+
icon: Gr
|
|
109
109
|
}));
|
|
110
110
|
});
|
|
111
111
|
It.displayName = "MoreDownSingle";
|
|
112
|
-
var
|
|
112
|
+
var zr = { 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" } }] }, mn = re(function(t, e) {
|
|
113
113
|
return ie(ae, Object.assign({}, t, {
|
|
114
114
|
id: "paint-bucket",
|
|
115
115
|
ref: e,
|
|
116
|
-
icon:
|
|
116
|
+
icon: zr
|
|
117
117
|
}));
|
|
118
118
|
});
|
|
119
|
-
|
|
120
|
-
var
|
|
119
|
+
mn.displayName = "PaintBucket";
|
|
120
|
+
var Xr = { 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" } }] }, pn = re(function(t, e) {
|
|
121
121
|
return ie(ae, Object.assign({}, t, {
|
|
122
122
|
id: "rename-single",
|
|
123
123
|
ref: e,
|
|
124
|
-
icon:
|
|
124
|
+
icon: Xr
|
|
125
125
|
}));
|
|
126
126
|
});
|
|
127
|
-
|
|
128
|
-
var
|
|
127
|
+
pn.displayName = "RenameSingle";
|
|
128
|
+
var Kr = { 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" } }] }, fn = re(function(t, e) {
|
|
129
129
|
return ie(ae, Object.assign({}, t, {
|
|
130
130
|
id: "table-single",
|
|
131
131
|
ref: e,
|
|
132
|
-
icon:
|
|
132
|
+
icon: Kr
|
|
133
133
|
}));
|
|
134
134
|
});
|
|
135
|
-
|
|
136
|
-
var Se = /* @__PURE__ */ ((t) => (t.Items = "items", t.Condition = "condition", t))(Se || {}),
|
|
137
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
135
|
+
fn.displayName = "TableSingle";
|
|
136
|
+
var Se = /* @__PURE__ */ ((t) => (t.Items = "items", t.Condition = "condition", t))(Se || {}), Jr = Object.getOwnPropertyDescriptor, ei = (t, e, n, r) => {
|
|
137
|
+
for (var i = r > 1 ? void 0 : r ? Jr(e, n) : e, a = t.length - 1, s; a >= 0; a--)
|
|
138
138
|
(s = t[a]) && (i = s(i) || i);
|
|
139
139
|
return i;
|
|
140
140
|
}, Ge = (t, e) => (n, r) => e(n, r, t);
|
|
141
|
-
let
|
|
141
|
+
let De = class extends Fe {
|
|
142
142
|
constructor(e, n, r, i) {
|
|
143
143
|
super();
|
|
144
|
-
|
|
144
|
+
A(this, "_itemsCache", /* @__PURE__ */ new Map());
|
|
145
145
|
this._tableManager = e, this._sheetTableService = n, this._univerInstanceService = r, this._commandService = i, this._registerTableFilterChangeEvent();
|
|
146
146
|
}
|
|
147
147
|
_registerTableFilterChangeEvent() {
|
|
@@ -150,8 +150,8 @@ let Be = class extends He {
|
|
|
150
150
|
const { unitId: n, subUnitId: r, cellValue: i } = e.params, a = this._tableManager.getTablesBySubunitId(n, r);
|
|
151
151
|
if (!a.length)
|
|
152
152
|
return;
|
|
153
|
-
new
|
|
154
|
-
const u =
|
|
153
|
+
new En(i).forValue((c, d, h) => {
|
|
154
|
+
const u = At(c, d), g = a.find((_) => {
|
|
155
155
|
const S = _.getTableFilterRange();
|
|
156
156
|
return Ce.intersects(S, u);
|
|
157
157
|
});
|
|
@@ -160,7 +160,7 @@ let Be = class extends He {
|
|
|
160
160
|
this._itemsCache.delete(g.getId() + _);
|
|
161
161
|
}
|
|
162
162
|
});
|
|
163
|
-
} else if (e.id ===
|
|
163
|
+
} else if (e.id === Rt.id) {
|
|
164
164
|
const { unitId: n, tableId: r } = e.params, i = this._tableManager.getTable(n, r);
|
|
165
165
|
if (!i)
|
|
166
166
|
return;
|
|
@@ -179,7 +179,7 @@ let Be = class extends He {
|
|
|
179
179
|
unitId: e,
|
|
180
180
|
subUnitId: n,
|
|
181
181
|
tableFilter: c,
|
|
182
|
-
currentFilterBy:
|
|
182
|
+
currentFilterBy: Wn(c) ? Se.Condition : Se.Items,
|
|
183
183
|
tableId: r,
|
|
184
184
|
columnIndex: i - s.startColumn
|
|
185
185
|
};
|
|
@@ -188,7 +188,7 @@ let Be = class extends He {
|
|
|
188
188
|
const i = this._tableManager.getTable(e, n), a = [];
|
|
189
189
|
if (i) {
|
|
190
190
|
const s = i.getTableFilterColumn(r);
|
|
191
|
-
s &&
|
|
191
|
+
s && jn(s) && a.push(...s.values);
|
|
192
192
|
}
|
|
193
193
|
return a;
|
|
194
194
|
}
|
|
@@ -201,16 +201,16 @@ let Be = class extends He {
|
|
|
201
201
|
column: r,
|
|
202
202
|
tableFilter: i
|
|
203
203
|
};
|
|
204
|
-
this._commandService.executeCommand(
|
|
204
|
+
this._commandService.executeCommand(Rt.id, s);
|
|
205
205
|
}
|
|
206
206
|
getTableFilterItems(e, n, r, i) {
|
|
207
|
-
var
|
|
207
|
+
var P;
|
|
208
208
|
if (this._itemsCache.has(r + i))
|
|
209
209
|
return this._itemsCache.get(r + i) || { data: [], itemsCountMap: /* @__PURE__ */ new Map(), allItemsCount: 0 };
|
|
210
210
|
const a = this._tableManager.getTable(e, r);
|
|
211
211
|
if (!a)
|
|
212
212
|
return { data: [], itemsCountMap: /* @__PURE__ */ new Map(), allItemsCount: 0 };
|
|
213
|
-
const s = a.getTableFilterRange(), { startRow: c, endRow: d, startColumn: h } = s, u = h + i, g = (
|
|
213
|
+
const s = a.getTableFilterRange(), { startRow: c, endRow: d, startColumn: h } = s, u = h + i, g = (P = this._univerInstanceService.getUnit(e)) == null ? void 0 : P.getSheetBySheetId(n);
|
|
214
214
|
if (!g)
|
|
215
215
|
return { data: [], itemsCountMap: /* @__PURE__ */ new Map(), allItemsCount: 0 };
|
|
216
216
|
const _ = [], S = /* @__PURE__ */ new Map();
|
|
@@ -228,14 +228,14 @@ let Be = class extends He {
|
|
|
228
228
|
return this._itemsCache.set(r + i, { data: _, itemsCountMap: S, allItemsCount: T }), { data: _, itemsCountMap: S, allItemsCount: T };
|
|
229
229
|
}
|
|
230
230
|
};
|
|
231
|
-
|
|
232
|
-
Ge(0,
|
|
233
|
-
Ge(1,
|
|
234
|
-
Ge(2,
|
|
231
|
+
De = ei([
|
|
232
|
+
Ge(0, R(ne)),
|
|
233
|
+
Ge(1, R(Un)),
|
|
234
|
+
Ge(2, R(_e)),
|
|
235
235
|
Ge(3, ce)
|
|
236
|
-
],
|
|
236
|
+
], De);
|
|
237
237
|
var j = /* @__PURE__ */ ((t) => (t.DatePicker = "DatePicker", t.DateRange = "DateRange", t.Input = "Input", t.Inputs = "Inputs", t.Select = "Select", t.None = "None", t))(j || {});
|
|
238
|
-
function
|
|
238
|
+
function ti(t) {
|
|
239
239
|
const n = t.get(ue).t;
|
|
240
240
|
return [
|
|
241
241
|
{
|
|
@@ -414,7 +414,7 @@ function ni(t) {
|
|
|
414
414
|
}
|
|
415
415
|
];
|
|
416
416
|
}
|
|
417
|
-
function
|
|
417
|
+
function ni(t, e) {
|
|
418
418
|
if (!e)
|
|
419
419
|
return [];
|
|
420
420
|
const r = t.get(ue).t;
|
|
@@ -501,10 +501,10 @@ const yt = /* @__PURE__ */ new Set([
|
|
|
501
501
|
l.Before,
|
|
502
502
|
l.BeforeOrEqual
|
|
503
503
|
]);
|
|
504
|
-
function
|
|
504
|
+
function ri(t, e) {
|
|
505
505
|
return e ? t === B.String ? j.Input : t === B.Number ? e === $.Between || e === $.NotBetween ? j.Inputs : j.Input : t === B.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 ii(t) {
|
|
508
508
|
if (!t || t.filterType !== "condition")
|
|
509
509
|
return {
|
|
510
510
|
type: B.String,
|
|
@@ -564,9 +564,9 @@ function ai(t) {
|
|
|
564
564
|
info: {}
|
|
565
565
|
};
|
|
566
566
|
}
|
|
567
|
-
const
|
|
568
|
-
var S, T,
|
|
569
|
-
const { conditionInfo: e, onChange: n } = t, r =
|
|
567
|
+
const ai = (t) => {
|
|
568
|
+
var S, T, P, f, E, y, D;
|
|
569
|
+
const { conditionInfo: e, onChange: n } = t, r = N(ue), [i, a] = Z(!1), s = N(He), c = ti(s), d = (v, p, L) => {
|
|
570
570
|
n({
|
|
571
571
|
type: p != null ? p : e.type,
|
|
572
572
|
compare: L != null ? L : e.compare,
|
|
@@ -578,19 +578,19 @@ const si = (t) => {
|
|
|
578
578
|
L && a(!1);
|
|
579
579
|
const M = {};
|
|
580
580
|
p === B.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()] : p === B.Number ? M.number = 0 : p === B.String && (M.string = ""), d(M, v[0], (C = v[1]) != null ? C : W.Equal);
|
|
581
|
-
}, u =
|
|
581
|
+
}, u = ri(e.type, e.compare);
|
|
582
582
|
let g = "";
|
|
583
583
|
e.compare ? g = `${r.t(`sheets-table.condition.${e.type}`)} - ${r.t(`sheets-table.${e.type}.compare.${e.compare}`)}` : g = r.t(`sheets-table.condition.${e.type}`);
|
|
584
|
-
const _ =
|
|
584
|
+
const _ = ni(s, e.compare);
|
|
585
585
|
return /* @__PURE__ */ w("div", { children: [
|
|
586
586
|
/* @__PURE__ */ o(
|
|
587
|
-
|
|
587
|
+
ke,
|
|
588
588
|
{
|
|
589
589
|
align: "start",
|
|
590
590
|
open: i,
|
|
591
591
|
onOpenChange: a,
|
|
592
592
|
overlay: /* @__PURE__ */ o(
|
|
593
|
-
|
|
593
|
+
Sr,
|
|
594
594
|
{
|
|
595
595
|
value: [e.type, e.compare],
|
|
596
596
|
options: c,
|
|
@@ -602,7 +602,7 @@ const si = (t) => {
|
|
|
602
602
|
children: /* @__PURE__ */ w(
|
|
603
603
|
"div",
|
|
604
604
|
{
|
|
605
|
-
className:
|
|
605
|
+
className: k("univer-box-border univer-flex univer-h-8 univer-w-full univer-items-center univer-justify-between univer-rounded-md univer-bg-white univer-px-2 univer-text-sm univer-transition-colors univer-duration-200 dark:!univer-bg-gray-700 dark:!univer-text-white focus:univer-border-primary-600 focus:univer-outline-none focus:univer-ring-2 hover:univer-border-primary-600", F),
|
|
606
606
|
children: [
|
|
607
607
|
/* @__PURE__ */ o("span", { children: g }),
|
|
608
608
|
/* @__PURE__ */ o(It, {})
|
|
@@ -632,7 +632,7 @@ const si = (t) => {
|
|
|
632
632
|
}
|
|
633
633
|
) }),
|
|
634
634
|
u === j.DatePicker && /* @__PURE__ */ o("div", { id: "univer-table-date-picker-wrapper", children: /* @__PURE__ */ o(
|
|
635
|
-
|
|
635
|
+
_r,
|
|
636
636
|
{
|
|
637
637
|
value: be(e.info.date),
|
|
638
638
|
defaultPickerValue: be(),
|
|
@@ -643,9 +643,9 @@ const si = (t) => {
|
|
|
643
643
|
}
|
|
644
644
|
) }),
|
|
645
645
|
u === j.DateRange && /* @__PURE__ */ o("div", { id: "univer-table-date-range-wrapper", children: /* @__PURE__ */ o(
|
|
646
|
-
|
|
646
|
+
Tr,
|
|
647
647
|
{
|
|
648
|
-
value: [(T = be((S = e.info.dateRange) == null ? void 0 : S[0])) != null ? T : be(), (f = be((
|
|
648
|
+
value: [(T = be((S = e.info.dateRange) == null ? void 0 : S[0])) != null ? T : be(), (f = be((P = e.info.dateRange) == null ? void 0 : P[1])) != null ? f : be()],
|
|
649
649
|
defaultPickerValue: [be(), be()],
|
|
650
650
|
onChange: (v) => {
|
|
651
651
|
d(v ? { dateRange: v.map((p) => p == null ? void 0 : p.toDate()) } : {});
|
|
@@ -683,51 +683,51 @@ const si = (t) => {
|
|
|
683
683
|
)
|
|
684
684
|
] }),
|
|
685
685
|
u === j.Select && /* @__PURE__ */ o(
|
|
686
|
-
|
|
686
|
+
wr,
|
|
687
687
|
{
|
|
688
688
|
className: "univer-w-full",
|
|
689
|
-
value: (
|
|
689
|
+
value: (D = e.info.dateSelect) != null ? D : _[0].value,
|
|
690
690
|
options: _,
|
|
691
691
|
onChange: (v) => d({ dateSelect: v })
|
|
692
692
|
}
|
|
693
693
|
)
|
|
694
694
|
] })
|
|
695
695
|
] });
|
|
696
|
-
},
|
|
696
|
+
}, si = (t) => {
|
|
697
697
|
let e = 0;
|
|
698
698
|
return t.forEach((n) => {
|
|
699
699
|
e += n;
|
|
700
700
|
}), e;
|
|
701
701
|
};
|
|
702
|
-
function
|
|
703
|
-
const { unitId: e, tableId: n, subUnitId: r, columnIndex: i, checkedItemSet: a, setCheckedItemSet: s, tableFilter: c } = t, d =
|
|
702
|
+
function li(t) {
|
|
703
|
+
const { unitId: e, tableId: n, subUnitId: r, columnIndex: i, checkedItemSet: a, setCheckedItemSet: s, tableFilter: c } = t, d = N(ue), h = N(De), { data: u, itemsCountMap: g, allItemsCount: _ } = h.getTableFilterItems(e, r, n, i), [S, T] = Z(c === void 0 ? !0 : a.size === g.size), [P, f] = Z(S ? _ : si(g)), E = !S && a.size > 0, [y, D] = Z(""), v = ln(() => y ? u.filter((C) => String(C.title).toLowerCase().includes(y.toLowerCase())) : u, [y, u]), p = Dt(() => {
|
|
704
704
|
S ? (a.clear(), s(new Set(a)), T(!1)) : (v.forEach((C) => {
|
|
705
705
|
a.add(C.title);
|
|
706
706
|
}), s(new Set(a)), T(!0));
|
|
707
707
|
}, [S]), L = Dt((C) => {
|
|
708
|
-
C === "" ? (T(!0), u.forEach((
|
|
709
|
-
a.add(
|
|
710
|
-
}), f(_)) : (a.clear(), T(!1), f(0)),
|
|
708
|
+
C === "" ? (T(!0), u.forEach((H) => {
|
|
709
|
+
a.add(H.title);
|
|
710
|
+
}), f(_)) : (a.clear(), T(!1), f(0)), D(C);
|
|
711
711
|
}, []), M = (C) => {
|
|
712
712
|
if (S) {
|
|
713
713
|
T(!1);
|
|
714
|
-
const
|
|
714
|
+
const H = /* @__PURE__ */ new Set();
|
|
715
715
|
for (const { title: x } of u)
|
|
716
|
-
C !== x &&
|
|
717
|
-
f(_ - g.get(C)), s(
|
|
716
|
+
C !== x && H.add(x);
|
|
717
|
+
f(_ - g.get(C)), s(H);
|
|
718
718
|
} else
|
|
719
|
-
a.has(C) ? (a.delete(C), f(
|
|
719
|
+
a.has(C) ? (a.delete(C), f(P - g.get(C))) : (a.add(C), f(P + g.get(C))), s(new Set(a));
|
|
720
720
|
};
|
|
721
721
|
return /* @__PURE__ */ w("div", { className: "univer-flex univer-h-full univer-flex-col", children: [
|
|
722
722
|
/* @__PURE__ */ o(wt, { autoFocus: !0, value: y, placeholder: d.t("sheets-filter.panel.search-placeholder"), onChange: L }),
|
|
723
723
|
/* @__PURE__ */ o(
|
|
724
724
|
"div",
|
|
725
725
|
{
|
|
726
|
-
className:
|
|
726
|
+
className: k("univer-mt-2 univer-box-border univer-flex univer-h-[180px] univer-max-h-[180px] univer-flex-grow univer-flex-col univer-overflow-hidden univer-rounded-md univer-py-1.5 univer-pl-2", F),
|
|
727
727
|
children: /* @__PURE__ */ o(
|
|
728
728
|
"div",
|
|
729
729
|
{
|
|
730
|
-
className:
|
|
730
|
+
className: k("univer-h-40 univer-overflow-y-auto univer-py-1 univer-pl-2", Ir),
|
|
731
731
|
children: /* @__PURE__ */ w("div", { className: "univer-h-full", children: [
|
|
732
732
|
/* @__PURE__ */ o("div", { className: "univer-flex univer-items-center univer-px-2 univer-py-1", children: /* @__PURE__ */ o(
|
|
733
733
|
$t,
|
|
@@ -738,7 +738,7 @@ function oi(t) {
|
|
|
738
738
|
onChange: p,
|
|
739
739
|
children: /* @__PURE__ */ w("div", { className: "univer-flex univer-h-5 univer-flex-1 univer-items-center univer-text-sm", children: [
|
|
740
740
|
/* @__PURE__ */ o("span", { className: "univer-inline-block univer-truncate", children: `${d.t("sheets-filter.panel.select-all")}` }),
|
|
741
|
-
/* @__PURE__ */ o("span", { className: "univer-ml univer-text-gray-400", children: `(${
|
|
741
|
+
/* @__PURE__ */ o("span", { className: "univer-ml univer-text-gray-400", children: `(${P}/${y ? v.length : _})` })
|
|
742
742
|
] })
|
|
743
743
|
}
|
|
744
744
|
) }),
|
|
@@ -769,36 +769,36 @@ function oi(t) {
|
|
|
769
769
|
)
|
|
770
770
|
] });
|
|
771
771
|
}
|
|
772
|
-
function
|
|
772
|
+
function oi() {
|
|
773
773
|
var de;
|
|
774
|
-
const t =
|
|
774
|
+
const t = N(ue), e = ci(t), n = N(De), r = N(ne), i = N(ce), a = N(Ut), s = N(Be), c = s.getCurrentTableFilterInfo(), d = n.getTableFilterPanelInitProps(c.unitId, c.subUnitId, c.tableId, c.column), { unitId: h, subUnitId: u, tableId: g, tableFilter: _, currentFilterBy: S, columnIndex: T } = d, { data: P } = n.getTableFilterItems(h, u, g, T), f = n.getTableFilterCheckedItems(h, g, T), [E, y] = Z(new Set(f)), [D, v] = Z(S || Se.Items), [p, L] = Z(() => {
|
|
775
775
|
const b = d.tableFilter;
|
|
776
|
-
return
|
|
776
|
+
return ii(b);
|
|
777
777
|
}), M = r.getTable(h, g);
|
|
778
778
|
if (!M) return null;
|
|
779
|
-
const C = M.getTableFilters(),
|
|
780
|
-
|
|
779
|
+
const C = M.getTableFilters(), H = C.getSortState();
|
|
780
|
+
H.columnIndex === T && (H.sortState, qe.Asc), H.columnIndex === T && (H.sortState, qe.Desc);
|
|
781
781
|
const x = () => {
|
|
782
782
|
s.closeFilterPanel();
|
|
783
783
|
}, Q = () => {
|
|
784
784
|
x();
|
|
785
785
|
}, U = (b) => {
|
|
786
|
-
const
|
|
787
|
-
i.executeCommand(
|
|
786
|
+
const O = M.getTableFilterRange();
|
|
787
|
+
i.executeCommand($r.id, {
|
|
788
788
|
unitId: h,
|
|
789
789
|
subUnitId: u,
|
|
790
|
-
range:
|
|
791
|
-
orderRules: [{ colIndex: T +
|
|
790
|
+
range: O,
|
|
791
|
+
orderRules: [{ colIndex: T + O.startColumn, type: b ? kt.ASC : kt.DESC }],
|
|
792
792
|
hasTitle: !1
|
|
793
|
-
}), C.setSortState(T, b ?
|
|
793
|
+
}), C.setSortState(T, b ? qe.Asc : qe.Desc), x();
|
|
794
794
|
}, ee = () => {
|
|
795
|
-
if (
|
|
795
|
+
if (D === Se.Items) {
|
|
796
796
|
const b = [];
|
|
797
|
-
for (const q of
|
|
797
|
+
for (const q of P)
|
|
798
798
|
E.has(q.title) && b.push(q.title);
|
|
799
|
-
const
|
|
800
|
-
if (
|
|
801
|
-
if (
|
|
799
|
+
const O = M.getTableFilterColumn(T);
|
|
800
|
+
if (O) {
|
|
801
|
+
if (O.values.join(",") === b.join(",")) {
|
|
802
802
|
x();
|
|
803
803
|
return;
|
|
804
804
|
}
|
|
@@ -806,11 +806,11 @@ function ci() {
|
|
|
806
806
|
x();
|
|
807
807
|
return;
|
|
808
808
|
}
|
|
809
|
-
const
|
|
809
|
+
const V = {
|
|
810
810
|
filterType: Et.manual,
|
|
811
811
|
values: b
|
|
812
812
|
};
|
|
813
|
-
n.setTableFilter(h, g, T,
|
|
813
|
+
n.setTableFilter(h, g, T, V);
|
|
814
814
|
} else {
|
|
815
815
|
let b;
|
|
816
816
|
p.compare === l.Quarter || p.compare === l.Month ? b = {
|
|
@@ -821,42 +821,42 @@ function ci() {
|
|
|
821
821
|
compareType: p.compare,
|
|
822
822
|
expectedValue: Object.values(p.info)[0]
|
|
823
823
|
};
|
|
824
|
-
const
|
|
824
|
+
const O = {
|
|
825
825
|
filterType: Et.condition,
|
|
826
826
|
// @ts-ignore
|
|
827
827
|
filterInfo: b
|
|
828
828
|
};
|
|
829
|
-
n.setTableFilter(h, g, T,
|
|
829
|
+
n.setTableFilter(h, g, T, O);
|
|
830
830
|
}
|
|
831
831
|
x();
|
|
832
832
|
}, xe = () => {
|
|
833
833
|
n.setTableFilter(h, g, T, void 0), x();
|
|
834
|
-
}, Le = new
|
|
834
|
+
}, Le = new tn(h).id, Te = (de = a.getPermissionPoint(Le)) == null ? void 0 : de.value;
|
|
835
835
|
return /* @__PURE__ */ w(
|
|
836
836
|
"div",
|
|
837
837
|
{
|
|
838
838
|
className: "univer-box-border univer-flex univer-w-[312px] univer-flex-col univer-rounded-[10px] univer-bg-white univer-p-4 univer-shadow-lg dark:!univer-border-gray-600 dark:!univer-bg-gray-700",
|
|
839
839
|
children: [
|
|
840
|
-
Te && /* @__PURE__ */ o("div", { className: "univer-mb-3 univer-flex", children: /* @__PURE__ */ w(
|
|
840
|
+
Te && /* @__PURE__ */ o("div", { className: "univer-mb-3 univer-flex", children: /* @__PURE__ */ w(yr, { className: "univer-mb-3 univer-w-full", children: [
|
|
841
841
|
/* @__PURE__ */ w(ye, { className: "univer-w-1/2", onClick: () => U(!0), children: [
|
|
842
|
-
/* @__PURE__ */ o(
|
|
842
|
+
/* @__PURE__ */ o(hn, { className: "univer-mr-1" }),
|
|
843
843
|
t.t("sheets-sort.general.sort-asc")
|
|
844
844
|
] }),
|
|
845
845
|
/* @__PURE__ */ w(ye, { className: "univer-w-1/2", onClick: () => U(!1), children: [
|
|
846
|
-
/* @__PURE__ */ o(
|
|
846
|
+
/* @__PURE__ */ o(gn, { className: "univer-mr-1" }),
|
|
847
847
|
t.t("sheets-sort.general.sort-desc")
|
|
848
848
|
] })
|
|
849
849
|
] }) }),
|
|
850
850
|
/* @__PURE__ */ o("div", { className: "univer-w-full", children: /* @__PURE__ */ o(
|
|
851
|
-
|
|
851
|
+
Mr,
|
|
852
852
|
{
|
|
853
|
-
value:
|
|
853
|
+
value: D,
|
|
854
854
|
items: e,
|
|
855
855
|
onChange: (b) => v(b)
|
|
856
856
|
}
|
|
857
857
|
) }),
|
|
858
|
-
/* @__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:
|
|
859
|
-
|
|
858
|
+
/* @__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: D === Se.Items ? /* @__PURE__ */ o(
|
|
859
|
+
li,
|
|
860
860
|
{
|
|
861
861
|
tableFilter: _,
|
|
862
862
|
unitId: h,
|
|
@@ -867,7 +867,7 @@ function ci() {
|
|
|
867
867
|
setCheckedItemSet: y
|
|
868
868
|
}
|
|
869
869
|
) : /* @__PURE__ */ o(
|
|
870
|
-
|
|
870
|
+
ai,
|
|
871
871
|
{
|
|
872
872
|
tableFilter: _,
|
|
873
873
|
unitId: h,
|
|
@@ -902,23 +902,23 @@ function ci() {
|
|
|
902
902
|
}
|
|
903
903
|
);
|
|
904
904
|
}
|
|
905
|
-
function
|
|
905
|
+
function ci(t) {
|
|
906
906
|
const e = t.getCurrentLocale();
|
|
907
|
-
return
|
|
907
|
+
return ln(() => [
|
|
908
908
|
{ label: t.t("sheets-filter.panel.by-values"), value: Se.Items },
|
|
909
909
|
{ label: t.t("sheets-filter.panel.by-conditions"), value: Se.Condition }
|
|
910
910
|
], [e, t]);
|
|
911
911
|
}
|
|
912
|
-
var
|
|
913
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
912
|
+
var ui = Object.getOwnPropertyDescriptor, di = (t, e, n, r) => {
|
|
913
|
+
for (var i = r > 1 ? void 0 : r ? ui(e, n) : e, a = t.length - 1, s; a >= 0; a--)
|
|
914
914
|
(s = t[a]) && (i = s(i) || i);
|
|
915
915
|
return i;
|
|
916
916
|
}, ze = (t, e) => (n, r) => e(n, r, t);
|
|
917
|
-
let
|
|
917
|
+
let Be = class extends Fe {
|
|
918
918
|
constructor(e, n, r, i) {
|
|
919
919
|
super();
|
|
920
|
-
|
|
921
|
-
|
|
920
|
+
A(this, "_popupDisposable");
|
|
921
|
+
A(this, "_currentTableFilterInfo", null);
|
|
922
922
|
this._componentManager = e, this._contextService = n, this._sheetCanvasPopupService = r, this._dialogService = i, this._initComponents(), this._initUIPopup();
|
|
923
923
|
}
|
|
924
924
|
setCurrentTableFilterInfo(e) {
|
|
@@ -932,13 +932,13 @@ let Fe = class extends He {
|
|
|
932
932
|
}
|
|
933
933
|
_initComponents() {
|
|
934
934
|
[
|
|
935
|
-
[pe,
|
|
935
|
+
[pe, oi]
|
|
936
936
|
].forEach(([e, n]) => {
|
|
937
937
|
this.disposeWithMe(this._componentManager.register(e, n));
|
|
938
938
|
});
|
|
939
939
|
}
|
|
940
940
|
_initUIPopup() {
|
|
941
|
-
this.disposeWithMe(this._contextService.subscribeContextValue$(pe).pipe(
|
|
941
|
+
this.disposeWithMe(this._contextService.subscribeContextValue$(pe).pipe(en(void 0), gr()).subscribe((e) => {
|
|
942
942
|
e ? this._openFilterPopup() : e === !1 && this._closeFilterPopup();
|
|
943
943
|
}));
|
|
944
944
|
}
|
|
@@ -954,7 +954,7 @@ let Fe = class extends He {
|
|
|
954
954
|
componentKey: pe,
|
|
955
955
|
direction: "horizontal",
|
|
956
956
|
onClickOutside: () => {
|
|
957
|
-
this._dialogService.close(
|
|
957
|
+
this._dialogService.close(Br), this._contextService.setContextValue(pe, !1);
|
|
958
958
|
},
|
|
959
959
|
offset: [5, 0]
|
|
960
960
|
});
|
|
@@ -964,35 +964,35 @@ let Fe = class extends He {
|
|
|
964
964
|
(e = this._popupDisposable) == null || e.dispose(), this._popupDisposable = null, this.clearCurrentTableFilterInfo();
|
|
965
965
|
}
|
|
966
966
|
};
|
|
967
|
-
|
|
968
|
-
ze(0,
|
|
967
|
+
Be = di([
|
|
968
|
+
ze(0, R(Kt)),
|
|
969
969
|
ze(1, St),
|
|
970
|
-
ze(2,
|
|
971
|
-
ze(3,
|
|
972
|
-
],
|
|
970
|
+
ze(2, R(Kn)),
|
|
971
|
+
ze(3, R(Jt))
|
|
972
|
+
], Be);
|
|
973
973
|
const mt = {
|
|
974
|
-
type:
|
|
974
|
+
type: Wt.OPERATION,
|
|
975
975
|
id: "sheet.operation.open-table-filter-panel",
|
|
976
976
|
async handler(t, e) {
|
|
977
977
|
if (!e)
|
|
978
978
|
return !1;
|
|
979
|
-
const { row: n, col: r, unitId: i, subUnitId: a, tableId: s } = e, c = t.get(ne), d = t.get(St), h = t.get(
|
|
979
|
+
const { row: n, col: r, unitId: i, subUnitId: a, tableId: s } = e, c = t.get(ne), d = t.get(St), h = t.get(Be);
|
|
980
980
|
return c.getTable(i, s) ? (d.getContextValue(pe) || (h.setCurrentTableFilterInfo({ unitId: i, subUnitId: a, row: n, tableId: s, column: r }), d.setContextValue(pe, !0)), !0) : !1;
|
|
981
981
|
}
|
|
982
982
|
}, Mt = {
|
|
983
|
-
type:
|
|
983
|
+
type: Wt.OPERATION,
|
|
984
984
|
id: "sheet.operation.open-table-selector",
|
|
985
985
|
async handler(t) {
|
|
986
986
|
var S;
|
|
987
987
|
const e = t.get(_e), n = t.get(ce), r = lt(e);
|
|
988
988
|
if (!r)
|
|
989
989
|
return !1;
|
|
990
|
-
const { unitId: i, subUnitId: a, worksheet: s } = r, d = t.get(ot).getCurrentLastSelection(), h = (S = d == null ? void 0 : d.range) != null ? S : { startRow: 0, endRow: 0, startColumn: 0, endColumn: 0 }, g =
|
|
991
|
-
return _ ? (n.executeCommand(
|
|
990
|
+
const { unitId: i, subUnitId: a, worksheet: s } = r, d = t.get(ot).getCurrentLastSelection(), h = (S = d == null ? void 0 : d.range) != null ? S : { startRow: 0, endRow: 0, startColumn: 0, endColumn: 0 }, g = Rr(d) ? Er(h, { up: !0, left: !0, right: !0, down: !0 }, s) : h, _ = await Cn(t, i, a, g);
|
|
991
|
+
return _ ? (n.executeCommand(Zn.id, { ..._ }), !0) : !1;
|
|
992
992
|
}
|
|
993
993
|
};
|
|
994
|
-
async function
|
|
995
|
-
const a = t.get(
|
|
994
|
+
async function Cn(t, e, n, r, i) {
|
|
995
|
+
const a = t.get(Jt), s = t.get(ue);
|
|
996
996
|
return new Promise((c) => {
|
|
997
997
|
const d = {
|
|
998
998
|
unitId: e,
|
|
@@ -1000,14 +1000,14 @@ async function Sn(t, e, n, r, i) {
|
|
|
1000
1000
|
range: r,
|
|
1001
1001
|
tableId: i,
|
|
1002
1002
|
onConfirm: (h) => {
|
|
1003
|
-
c(h), a.close(
|
|
1003
|
+
c(h), a.close(Oe);
|
|
1004
1004
|
},
|
|
1005
1005
|
onCancel: () => {
|
|
1006
|
-
c(null), a.close(
|
|
1006
|
+
c(null), a.close(Oe);
|
|
1007
1007
|
}
|
|
1008
1008
|
};
|
|
1009
1009
|
a.open({
|
|
1010
|
-
id:
|
|
1010
|
+
id: Oe,
|
|
1011
1011
|
title: { title: s.t("sheets-table.selectRange") },
|
|
1012
1012
|
draggable: !0,
|
|
1013
1013
|
destroyOnClose: !0,
|
|
@@ -1015,76 +1015,76 @@ async function Sn(t, e, n, r, i) {
|
|
|
1015
1015
|
maskClosable: !1,
|
|
1016
1016
|
children: {
|
|
1017
1017
|
label: {
|
|
1018
|
-
name:
|
|
1018
|
+
name: Oe,
|
|
1019
1019
|
props: d
|
|
1020
1020
|
}
|
|
1021
1021
|
},
|
|
1022
1022
|
width: 300,
|
|
1023
1023
|
onClose: () => {
|
|
1024
|
-
c(null), a.close(
|
|
1024
|
+
c(null), a.close(Oe);
|
|
1025
1025
|
}
|
|
1026
1026
|
});
|
|
1027
1027
|
});
|
|
1028
1028
|
}
|
|
1029
|
-
const
|
|
1029
|
+
const Sn = "sheets-table-ui.config", Ft = {
|
|
1030
1030
|
anchorHeight: 24,
|
|
1031
1031
|
anchorBackgroundColor: "rgb(134,139,156)"
|
|
1032
1032
|
};
|
|
1033
|
-
var
|
|
1034
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
1033
|
+
var hi = Object.getOwnPropertyDescriptor, vi = (t, e, n, r) => {
|
|
1034
|
+
for (var i = r > 1 ? void 0 : r ? hi(e, n) : e, a = t.length - 1, s; a >= 0; a--)
|
|
1035
1035
|
(s = t[a]) && (i = s(i) || i);
|
|
1036
1036
|
return i;
|
|
1037
|
-
},
|
|
1038
|
-
let
|
|
1037
|
+
}, gi = (t, e) => (n, r) => e(n, r, t);
|
|
1038
|
+
let Re = class extends Fe {
|
|
1039
1039
|
constructor(e) {
|
|
1040
1040
|
super();
|
|
1041
|
-
|
|
1042
|
-
|
|
1041
|
+
A(this, "_refreshTable", new br());
|
|
1042
|
+
A(this, "refreshTable$", this._refreshTable.asObservable());
|
|
1043
1043
|
this._commandService = e, this._initListener();
|
|
1044
1044
|
}
|
|
1045
1045
|
_initListener() {
|
|
1046
1046
|
this.disposeWithMe(
|
|
1047
1047
|
this._commandService.onCommandExecuted((e) => {
|
|
1048
|
-
if (e.id ===
|
|
1048
|
+
if (e.id === nn.id) {
|
|
1049
1049
|
const n = e.params, { styleName: r } = n;
|
|
1050
|
-
r.startsWith(
|
|
1050
|
+
r.startsWith(qn) && this._refreshTable.next(Math.random());
|
|
1051
1051
|
}
|
|
1052
1052
|
})
|
|
1053
1053
|
);
|
|
1054
1054
|
}
|
|
1055
1055
|
};
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
],
|
|
1059
|
-
const
|
|
1056
|
+
Re = vi([
|
|
1057
|
+
gi(0, R(ce))
|
|
1058
|
+
], Re);
|
|
1059
|
+
const bi = () => {
|
|
1060
1060
|
var Te, de;
|
|
1061
|
-
const [t, e] = Z(""), [n, r] = Z(""), i =
|
|
1062
|
-
s((
|
|
1063
|
-
...
|
|
1064
|
-
[b]:
|
|
1061
|
+
const [t, e] = Z(""), [n, r] = Z(""), i = N(sr), [a, s] = Z({}), c = N(He), d = N(tt), h = Me(d.anchorPosition$), u = N(ce), g = N(_e), _ = N(rn), S = Me(_.unitPermissionInitStateChange$, !1), T = N(ne), P = N(an), f = N(Re), E = Me(f.refreshTable$), y = N(ue), D = N(ot), v = Me(D.selectionChanged$, [{ range: At(0, 0), primary: null }]), [, p] = Z(Math.random()), M = N(jt).getConfig(Sn), C = (Te = M == null ? void 0 : M.anchorHeight) != null ? Te : 24, H = (de = M == null ? void 0 : M.anchorBackgroundColor) != null ? de : "rgb(53,91,183)", x = (b, O) => {
|
|
1062
|
+
s((V) => ({
|
|
1063
|
+
...V,
|
|
1064
|
+
[b]: O
|
|
1065
1065
|
}));
|
|
1066
1066
|
};
|
|
1067
|
-
if (
|
|
1067
|
+
if (on(() => {
|
|
1068
1068
|
p(Math.random());
|
|
1069
1069
|
}, [E]), !(h != null && h.length))
|
|
1070
1070
|
return null;
|
|
1071
1071
|
const Q = lt(g);
|
|
1072
1072
|
if (!Q) return null;
|
|
1073
|
-
const { unitId: U, subUnitId: ee } = Q, xe = (b,
|
|
1073
|
+
const { unitId: U, subUnitId: ee } = Q, xe = (b, O) => {
|
|
1074
1074
|
var q;
|
|
1075
|
-
if (((q = T.getTableById(U, b)) == null ? void 0 : q.getDisplayName()) ===
|
|
1075
|
+
if (((q = T.getTableById(U, b)) == null ? void 0 : q.getDisplayName()) === O) {
|
|
1076
1076
|
e(""), r("");
|
|
1077
1077
|
return;
|
|
1078
1078
|
}
|
|
1079
1079
|
u.executeCommand(bt.id, {
|
|
1080
1080
|
tableId: b,
|
|
1081
1081
|
unitId: U,
|
|
1082
|
-
name:
|
|
1082
|
+
name: O
|
|
1083
1083
|
}), r(""), e("");
|
|
1084
1084
|
}, Le = async (b) => {
|
|
1085
|
-
const
|
|
1086
|
-
if (!
|
|
1087
|
-
const
|
|
1085
|
+
const O = T.getTableById(U, b);
|
|
1086
|
+
if (!O) return;
|
|
1087
|
+
const V = O.getRange(), q = await Cn(c, U, ee, V, b);
|
|
1088
1088
|
q && u.executeCommand(bt.id, {
|
|
1089
1089
|
tableId: b,
|
|
1090
1090
|
unitId: U,
|
|
@@ -1100,21 +1100,21 @@ const mi = () => {
|
|
|
1100
1100
|
style: {},
|
|
1101
1101
|
children: h.map((b) => {
|
|
1102
1102
|
var X, K, se, le, he, ve, ge;
|
|
1103
|
-
const
|
|
1104
|
-
if (!
|
|
1105
|
-
const
|
|
1103
|
+
const O = T.getTableById(U, b.tableId);
|
|
1104
|
+
if (!O) return null;
|
|
1105
|
+
const V = P.getRangeThemeStyle(U, O.getTableStyleId()), q = (se = (K = (X = V == null ? void 0 : V.getHeaderRowStyle()) == null ? void 0 : X.bg) == null ? void 0 : K.rgb) != null ? se : H, We = (ve = (he = (le = V == null ? void 0 : V.getHeaderRowStyle()) == null ? void 0 : le.cl) == null ? void 0 : he.rgb) != null ? ve : "rgb(255, 255, 255)", je = O.getRange();
|
|
1106
1106
|
if (!(v != null && v.length))
|
|
1107
1107
|
return null;
|
|
1108
|
-
const
|
|
1108
|
+
const Ze = v[v.length - 1].range, I = !Ce.intersects(je, Ze) && b.y <= 20;
|
|
1109
1109
|
return /* @__PURE__ */ w(
|
|
1110
1110
|
"div",
|
|
1111
1111
|
{
|
|
1112
|
-
className:
|
|
1112
|
+
className: k("univer-absolute univer-box-border univer-flex univer-cursor-pointer univer-items-center univer-rounded-xl univer-pl-2 univer-pr-2 univer-shadow-xs", F),
|
|
1113
1113
|
style: {
|
|
1114
1114
|
left: b.x,
|
|
1115
1115
|
top: Math.max(b.y, 0),
|
|
1116
1116
|
backgroundColor: q,
|
|
1117
|
-
color:
|
|
1117
|
+
color: We,
|
|
1118
1118
|
borderWidth: "0.5px",
|
|
1119
1119
|
display: I ? "none" : "flex",
|
|
1120
1120
|
height: C ? `${C}px` : "24px"
|
|
@@ -1135,7 +1135,7 @@ const mi = () => {
|
|
|
1135
1135
|
}
|
|
1136
1136
|
) : /* @__PURE__ */ o("div", { className: "univer-h-[18px] univer-max-w-24 univer-truncate univer-text-sm", children: b.tableName }) }),
|
|
1137
1137
|
/* @__PURE__ */ o(
|
|
1138
|
-
|
|
1138
|
+
ke,
|
|
1139
1139
|
{
|
|
1140
1140
|
open: (ge = a[b.tableId]) != null ? ge : !1,
|
|
1141
1141
|
onOpenChange: (Y) => {
|
|
@@ -1150,7 +1150,7 @@ const mi = () => {
|
|
|
1150
1150
|
e(b.tableId), r(b.tableName);
|
|
1151
1151
|
},
|
|
1152
1152
|
children: [
|
|
1153
|
-
/* @__PURE__ */ o(
|
|
1153
|
+
/* @__PURE__ */ o(pn, { className: "univer-mr-2" }),
|
|
1154
1154
|
y.t("sheets-table.rename")
|
|
1155
1155
|
]
|
|
1156
1156
|
}
|
|
@@ -1167,7 +1167,7 @@ const mi = () => {
|
|
|
1167
1167
|
onClick: () => Le(b.tableId),
|
|
1168
1168
|
className: "univer-flex univer-min-w-32 univer-cursor-pointer univer-items-center univer-pb-1 univer-pl-2 univer-pr-2 univer-pt-1 univer-text-sm hover:univer-bg-gray-200",
|
|
1169
1169
|
children: [
|
|
1170
|
-
/* @__PURE__ */ o(
|
|
1170
|
+
/* @__PURE__ */ o(bn, { className: "univer-mr-2" }),
|
|
1171
1171
|
y.t("sheets-table.updateRange")
|
|
1172
1172
|
]
|
|
1173
1173
|
}
|
|
@@ -1181,10 +1181,10 @@ const mi = () => {
|
|
|
1181
1181
|
const Y = T.getTableById(U, b.tableId);
|
|
1182
1182
|
if (!Y) return;
|
|
1183
1183
|
const we = Y.getTableConfig(), Ie = {
|
|
1184
|
-
id:
|
|
1184
|
+
id: Fr,
|
|
1185
1185
|
header: { title: y.t("sheets-table.tableStyle") },
|
|
1186
1186
|
children: {
|
|
1187
|
-
label:
|
|
1187
|
+
label: un,
|
|
1188
1188
|
oldConfig: we,
|
|
1189
1189
|
unitId: U,
|
|
1190
1190
|
subUnitId: ee,
|
|
@@ -1196,7 +1196,7 @@ const mi = () => {
|
|
|
1196
1196
|
},
|
|
1197
1197
|
children: [
|
|
1198
1198
|
/* @__PURE__ */ o(
|
|
1199
|
-
|
|
1199
|
+
mn,
|
|
1200
1200
|
{
|
|
1201
1201
|
extend: { colorChannel1: "rgb(53,91,183)" },
|
|
1202
1202
|
className: "univer-mr-2"
|
|
@@ -1217,14 +1217,14 @@ const mi = () => {
|
|
|
1217
1217
|
{
|
|
1218
1218
|
className: "univer-flex univer-min-w-32 univer-cursor-pointer univer-items-center univer-pb-1 univer-pl-2 univer-pr-2 univer-pt-1 univer-text-sm hover:univer-bg-gray-200",
|
|
1219
1219
|
onClick: () => {
|
|
1220
|
-
x(b.tableId, !1), u.executeCommand(
|
|
1220
|
+
x(b.tableId, !1), u.executeCommand(Yn.id, {
|
|
1221
1221
|
tableId: b.tableId,
|
|
1222
1222
|
subUnitId: ee,
|
|
1223
1223
|
unitId: U
|
|
1224
1224
|
});
|
|
1225
1225
|
},
|
|
1226
1226
|
children: [
|
|
1227
|
-
/* @__PURE__ */ o(
|
|
1227
|
+
/* @__PURE__ */ o(vn, { className: "univer-mr-2" }),
|
|
1228
1228
|
y.t("sheets-table.removeTable")
|
|
1229
1229
|
]
|
|
1230
1230
|
}
|
|
@@ -1243,29 +1243,29 @@ const mi = () => {
|
|
|
1243
1243
|
}
|
|
1244
1244
|
) : null;
|
|
1245
1245
|
};
|
|
1246
|
-
var
|
|
1247
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
1246
|
+
var mi = Object.getOwnPropertyDescriptor, pi = (t, e, n, r) => {
|
|
1247
|
+
for (var i = r > 1 ? void 0 : r ? mi(e, n) : e, a = t.length - 1, s; a >= 0; a--)
|
|
1248
1248
|
(s = t[a]) && (i = s(i) || i);
|
|
1249
1249
|
return i;
|
|
1250
1250
|
}, te = (t, e) => (n, r) => e(n, r, t);
|
|
1251
|
-
let tt = class extends
|
|
1251
|
+
let tt = class extends Fe {
|
|
1252
1252
|
constructor(e, n, r, i, a, s, c, d, h, u, g) {
|
|
1253
1253
|
super();
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1254
|
+
A(this, "_anchorVisible$", new Lt(!0));
|
|
1255
|
+
A(this, "_timer");
|
|
1256
|
+
A(this, "_anchorPosition$", new Lt([]));
|
|
1257
|
+
A(this, "anchorPosition$", this._anchorPosition$.asObservable());
|
|
1258
1258
|
this._context = e, this._injector = n, this._sheetSkeletonManagerService = r, this._renderManagerService = i, this._commandService = a, this._univerInstanceService = s, this._uiPartsService = c, this._tableManager = d, this._scrollManagerService = h, this._workbookPermissionService = u, this._permissionService = g, this._initUI(), this._initListener(), this._initTableAnchor();
|
|
1259
1259
|
}
|
|
1260
1260
|
_initUI() {
|
|
1261
1261
|
this.disposeWithMe(
|
|
1262
|
-
this._uiPartsService.registerComponent(
|
|
1262
|
+
this._uiPartsService.registerComponent(or.CONTENT, () => cr(bi, this._injector))
|
|
1263
1263
|
);
|
|
1264
1264
|
}
|
|
1265
1265
|
_initListener() {
|
|
1266
1266
|
this.disposeWithMe(
|
|
1267
1267
|
this._commandService.onCommandExecuted((e) => {
|
|
1268
|
-
(e.id ===
|
|
1268
|
+
(e.id === er.id || e.id === tr.id) && (this._anchorVisible$.next(!1), this._timer && clearTimeout(this._timer), this._timer = setTimeout(() => {
|
|
1269
1269
|
this._anchorVisible$.next(!0);
|
|
1270
1270
|
}, 300));
|
|
1271
1271
|
})
|
|
@@ -1282,8 +1282,8 @@ let tt = class extends He {
|
|
|
1282
1282
|
this._tableManager.tableNameChanged$,
|
|
1283
1283
|
this._tableManager.tableRangeChanged$,
|
|
1284
1284
|
this._tableManager.tableThemeChanged$,
|
|
1285
|
-
this._workbookPermissionService.unitPermissionInitStateChange$.pipe(
|
|
1286
|
-
this._permissionService.permissionPointUpdate$.pipe(
|
|
1285
|
+
this._workbookPermissionService.unitPermissionInitStateChange$.pipe(mr((e) => e)),
|
|
1286
|
+
this._permissionService.permissionPointUpdate$.pipe(pr(300)),
|
|
1287
1287
|
this._anchorVisible$
|
|
1288
1288
|
).subscribe(() => {
|
|
1289
1289
|
var h;
|
|
@@ -1296,20 +1296,20 @@ let tt = class extends He {
|
|
|
1296
1296
|
this._anchorPosition$.next([]);
|
|
1297
1297
|
return;
|
|
1298
1298
|
}
|
|
1299
|
-
if (!((h = this._permissionService.getPermissionPoint(new
|
|
1299
|
+
if (!((h = this._permissionService.getPermissionPoint(new tn(n.getUnitId()).id)) == null ? void 0 : h.value)) {
|
|
1300
1300
|
this._anchorPosition$.next([]);
|
|
1301
1301
|
return;
|
|
1302
1302
|
}
|
|
1303
1303
|
const d = a.reduce((u, g) => {
|
|
1304
|
-
const { startRow: _, startColumn: S } = g.range, T = s.with(st),
|
|
1305
|
-
if (!
|
|
1306
|
-
const { scene: f } =
|
|
1304
|
+
const { startRow: _, startColumn: S } = g.range, T = s.with(st), P = nr(this._univerInstanceService, this._renderManagerService);
|
|
1305
|
+
if (!P) return u;
|
|
1306
|
+
const { scene: f } = P, E = f.getViewport(Fn.VIEW_MAIN);
|
|
1307
1307
|
if (!E) return u;
|
|
1308
|
-
const y = f == null ? void 0 : f.scaleX,
|
|
1309
|
-
if (!y || !f || !
|
|
1308
|
+
const y = f == null ? void 0 : f.scaleX, D = f == null ? void 0 : f.scaleY, v = f == null ? void 0 : f.getViewportScrollXY(E);
|
|
1309
|
+
if (!y || !f || !D || !v) return u;
|
|
1310
1310
|
const p = T.getCurrentSkeleton();
|
|
1311
1311
|
if (!p) return u;
|
|
1312
|
-
const L = p.getNoMergeCellWithCoordByIndex(_, S), M =
|
|
1312
|
+
const L = p.getNoMergeCellWithCoordByIndex(_, S), M = Hn(L.startX, y, v), C = Vn(L.startY, D, v) - 25 - 4;
|
|
1313
1313
|
return C >= -10 && M >= 45 && u.push({
|
|
1314
1314
|
x: M,
|
|
1315
1315
|
y: C,
|
|
@@ -1322,23 +1322,23 @@ let tt = class extends He {
|
|
|
1322
1322
|
);
|
|
1323
1323
|
}
|
|
1324
1324
|
};
|
|
1325
|
-
tt =
|
|
1326
|
-
te(1,
|
|
1327
|
-
te(2,
|
|
1328
|
-
te(3,
|
|
1325
|
+
tt = pi([
|
|
1326
|
+
te(1, R(He)),
|
|
1327
|
+
te(2, R(st)),
|
|
1328
|
+
te(3, qt),
|
|
1329
1329
|
te(4, ce),
|
|
1330
1330
|
te(5, _e),
|
|
1331
|
-
te(6,
|
|
1332
|
-
te(7,
|
|
1333
|
-
te(8,
|
|
1334
|
-
te(9,
|
|
1335
|
-
te(10,
|
|
1331
|
+
te(6, lr),
|
|
1332
|
+
te(7, R(ne)),
|
|
1333
|
+
te(8, R(Jn)),
|
|
1334
|
+
te(9, R(rn)),
|
|
1335
|
+
te(10, R(Ut))
|
|
1336
1336
|
], tt);
|
|
1337
1337
|
const Pe = 16;
|
|
1338
1338
|
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");
|
|
1339
|
-
class
|
|
1339
|
+
class Ht {
|
|
1340
1340
|
static drawNoSetting(e, n, r, i) {
|
|
1341
|
-
e.save(),
|
|
1341
|
+
e.save(), Nt.drawWith(e, {
|
|
1342
1342
|
radius: 2,
|
|
1343
1343
|
width: Pe,
|
|
1344
1344
|
height: Pe,
|
|
@@ -1346,7 +1346,7 @@ class Vt {
|
|
|
1346
1346
|
}), e.lineCap = "square", e.strokeStyle = r, e.scale(n / Pe, n / Pe), 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();
|
|
1347
1347
|
}
|
|
1348
1348
|
static drawIconByPath(e, n, r, i) {
|
|
1349
|
-
e.save(), e.strokeStyle = r, e.fillStyle = i,
|
|
1349
|
+
e.save(), e.strokeStyle = r, e.fillStyle = i, Nt.drawWith(e, {
|
|
1350
1350
|
radius: 2,
|
|
1351
1351
|
width: Pe,
|
|
1352
1352
|
height: Pe,
|
|
@@ -1357,36 +1357,36 @@ class Vt {
|
|
|
1357
1357
|
}), e.restore();
|
|
1358
1358
|
}
|
|
1359
1359
|
}
|
|
1360
|
-
const
|
|
1360
|
+
const fi = [
|
|
1361
1361
|
"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"
|
|
1362
|
-
],
|
|
1362
|
+
], Ci = [
|
|
1363
1363
|
"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",
|
|
1364
1364
|
"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"
|
|
1365
|
-
],
|
|
1365
|
+
], Si = [
|
|
1366
1366
|
"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",
|
|
1367
1367
|
"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"
|
|
1368
|
-
],
|
|
1368
|
+
], _i = [
|
|
1369
1369
|
"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",
|
|
1370
1370
|
"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",
|
|
1371
1371
|
"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"
|
|
1372
|
-
],
|
|
1372
|
+
], Ti = [
|
|
1373
1373
|
"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",
|
|
1374
1374
|
"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",
|
|
1375
1375
|
"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"
|
|
1376
1376
|
];
|
|
1377
|
-
var
|
|
1378
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
1377
|
+
var wi = Object.getOwnPropertyDescriptor, Ii = (t, e, n, r) => {
|
|
1378
|
+
for (var i = r > 1 ? void 0 : r ? wi(e, n) : e, a = t.length - 1, s; a >= 0; a--)
|
|
1379
1379
|
(s = t[a]) && (i = s(i) || i);
|
|
1380
1380
|
return i;
|
|
1381
1381
|
}, vt = (t, e) => (n, r) => e(n, r, t);
|
|
1382
1382
|
const fe = 16, Xe = 1;
|
|
1383
|
-
let pt = class extends
|
|
1383
|
+
let pt = class extends An {
|
|
1384
1384
|
constructor(e, n, r, i, a) {
|
|
1385
1385
|
super(e, n);
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1386
|
+
A(this, "_cellWidth", 0);
|
|
1387
|
+
A(this, "_cellHeight", 0);
|
|
1388
|
+
A(this, "_filterParams");
|
|
1389
|
+
A(this, "_hovered", !1);
|
|
1390
1390
|
this._contextService = r, this._commandService = i, this._themeService = a, this.setShapeProps(n), this.onPointerDown$.subscribeEvent((s) => this.onPointerDown(s)), this.onPointerEnter$.subscribeEvent(() => this.onPointerEnter()), this.onPointerLeave$.subscribeEvent(() => this.onPointerLeave());
|
|
1391
1391
|
}
|
|
1392
1392
|
setShapeProps(e) {
|
|
@@ -1404,24 +1404,24 @@ let pt = class extends Un {
|
|
|
1404
1404
|
let u;
|
|
1405
1405
|
switch (c) {
|
|
1406
1406
|
case $e.FilteredSortNone:
|
|
1407
|
-
u =
|
|
1407
|
+
u = fi;
|
|
1408
1408
|
break;
|
|
1409
1409
|
case $e.FilteredSortAsc:
|
|
1410
|
-
u =
|
|
1410
|
+
u = Ci;
|
|
1411
1411
|
break;
|
|
1412
1412
|
case $e.FilteredSortDesc:
|
|
1413
|
-
u =
|
|
1413
|
+
u = Si;
|
|
1414
1414
|
break;
|
|
1415
1415
|
case $e.FilterNoneSortNone:
|
|
1416
1416
|
break;
|
|
1417
1417
|
case $e.FilterNoneSortAsc:
|
|
1418
|
-
u =
|
|
1418
|
+
u = _i;
|
|
1419
1419
|
break;
|
|
1420
1420
|
case $e.FilterNoneSortDesc:
|
|
1421
|
-
u =
|
|
1421
|
+
u = Ti;
|
|
1422
1422
|
break;
|
|
1423
1423
|
}
|
|
1424
|
-
u ?
|
|
1424
|
+
u ? Ht.drawIconByPath(e, u, d, h) : c !== void 0 && Ht.drawNoSetting(e, fe, d, h), e.restore();
|
|
1425
1425
|
}
|
|
1426
1426
|
onPointerDown(e) {
|
|
1427
1427
|
if (e.button === 2)
|
|
@@ -1445,22 +1445,22 @@ let pt = class extends Un {
|
|
|
1445
1445
|
this._hovered = !1, this.makeDirty(!0);
|
|
1446
1446
|
}
|
|
1447
1447
|
};
|
|
1448
|
-
pt =
|
|
1448
|
+
pt = Ii([
|
|
1449
1449
|
vt(2, St),
|
|
1450
1450
|
vt(3, ce),
|
|
1451
|
-
vt(4,
|
|
1451
|
+
vt(4, R(xn))
|
|
1452
1452
|
], pt);
|
|
1453
|
-
var
|
|
1454
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
1453
|
+
var yi = Object.getOwnPropertyDescriptor, Mi = (t, e, n, r) => {
|
|
1454
|
+
for (var i = r > 1 ? void 0 : r ? yi(e, n) : e, a = t.length - 1, s; a >= 0; a--)
|
|
1455
1455
|
(s = t[a]) && (i = s(i) || i);
|
|
1456
1456
|
return i;
|
|
1457
1457
|
}, Ke = (t, e) => (n, r) => e(n, r, t);
|
|
1458
1458
|
const Ni = 5e3;
|
|
1459
|
-
let ft = class extends
|
|
1459
|
+
let ft = class extends Zt {
|
|
1460
1460
|
constructor(e, n, r, i, a) {
|
|
1461
1461
|
super();
|
|
1462
|
-
|
|
1463
|
-
|
|
1462
|
+
A(this, "_buttonRenderDisposable", null);
|
|
1463
|
+
A(this, "_tableFilterButtonShapes", []);
|
|
1464
1464
|
this._context = e, this._injector = n, this._sheetSkeletonManagerService = r, this._sheetInterceptorService = i, this._tableManager = a, this._initRenderer();
|
|
1465
1465
|
}
|
|
1466
1466
|
dispose() {
|
|
@@ -1469,7 +1469,7 @@ let ft = class extends qt {
|
|
|
1469
1469
|
_initRenderer() {
|
|
1470
1470
|
const e = this._tableManager;
|
|
1471
1471
|
this._sheetSkeletonManagerService.currentSkeleton$.pipe(
|
|
1472
|
-
|
|
1472
|
+
Ne((n) => {
|
|
1473
1473
|
var c;
|
|
1474
1474
|
if (!n) return J(null);
|
|
1475
1475
|
const { unit: r, unitId: i } = this._context, a = ((c = r.getActiveSheet()) == null ? void 0 : c.getSheetId()) || "", s = () => ({
|
|
@@ -1486,11 +1486,11 @@ let ft = class extends qt {
|
|
|
1486
1486
|
e.tableDelete$,
|
|
1487
1487
|
e.tableFilterChanged$
|
|
1488
1488
|
).pipe(
|
|
1489
|
-
|
|
1490
|
-
|
|
1489
|
+
fr(() => s()),
|
|
1490
|
+
en(s())
|
|
1491
1491
|
);
|
|
1492
1492
|
}),
|
|
1493
|
-
|
|
1493
|
+
Cr(this.dispose$)
|
|
1494
1494
|
).subscribe((n) => {
|
|
1495
1495
|
this._disposeRendering(), !(!n || !n.tableFilterRanges) && this._renderButtons(n);
|
|
1496
1496
|
});
|
|
@@ -1501,10 +1501,10 @@ let ft = class extends qt {
|
|
|
1501
1501
|
const { startRow: u, startColumn: g, endColumn: _ } = c;
|
|
1502
1502
|
this._interceptCellContent(r, a, c);
|
|
1503
1503
|
for (let S = g; S <= _; S++) {
|
|
1504
|
-
const T = `sheets-table-filter-button-${u}-${S}`,
|
|
1504
|
+
const T = `sheets-table-filter-button-${u}-${S}`, P = rr(u, S, s, i), { startX: f, startY: E, endX: y, endY: D } = P, v = y - f, p = D - E;
|
|
1505
1505
|
if (p <= Xe || v <= Xe)
|
|
1506
1506
|
continue;
|
|
1507
|
-
const L = d[S - g], M = y - fe - Xe, C =
|
|
1507
|
+
const L = d[S - g], M = y - fe - Xe, C = D - fe - Xe, H = {
|
|
1508
1508
|
left: M,
|
|
1509
1509
|
top: C,
|
|
1510
1510
|
height: fe,
|
|
@@ -1513,7 +1513,7 @@ let ft = class extends qt {
|
|
|
1513
1513
|
cellHeight: p,
|
|
1514
1514
|
cellWidth: v,
|
|
1515
1515
|
filterParams: { unitId: r, subUnitId: a, row: u, col: S, buttonState: L, tableId: h }
|
|
1516
|
-
}, x = this._injector.createInstance(pt, T,
|
|
1516
|
+
}, x = this._injector.createInstance(pt, T, H);
|
|
1517
1517
|
this._tableFilterButtonShapes.push(x);
|
|
1518
1518
|
}
|
|
1519
1519
|
}
|
|
@@ -1521,8 +1521,8 @@ let ft = class extends qt {
|
|
|
1521
1521
|
}
|
|
1522
1522
|
_interceptCellContent(e, n, r) {
|
|
1523
1523
|
const { startRow: i, startColumn: a, endColumn: s } = r;
|
|
1524
|
-
this._buttonRenderDisposable = this._sheetInterceptorService.intercept(
|
|
1525
|
-
effect:
|
|
1524
|
+
this._buttonRenderDisposable = this._sheetInterceptorService.intercept(xr.CELL_CONTENT, {
|
|
1525
|
+
effect: Ln.Style,
|
|
1526
1526
|
handler: (c, d, h) => {
|
|
1527
1527
|
const { row: u, col: g, unitId: _, subUnitId: S } = d;
|
|
1528
1528
|
return _ !== e || S !== n || u !== i || g < a || g > s ? h(c) : h({
|
|
@@ -1541,24 +1541,24 @@ let ft = class extends qt {
|
|
|
1541
1541
|
this._tableFilterButtonShapes.forEach((n) => n.dispose()), (e = this._buttonRenderDisposable) == null || e.dispose(), this._buttonRenderDisposable = null, this._tableFilterButtonShapes = [];
|
|
1542
1542
|
}
|
|
1543
1543
|
};
|
|
1544
|
-
ft =
|
|
1545
|
-
Ke(1,
|
|
1546
|
-
Ke(2,
|
|
1547
|
-
Ke(3,
|
|
1548
|
-
Ke(4,
|
|
1544
|
+
ft = Mi([
|
|
1545
|
+
Ke(1, R(He)),
|
|
1546
|
+
Ke(2, R(st)),
|
|
1547
|
+
Ke(3, R(sn)),
|
|
1548
|
+
Ke(4, R(ne))
|
|
1549
1549
|
], ft);
|
|
1550
|
-
const
|
|
1551
|
-
const { unitId: e, subUnitId: n, range: r, onCancel: i, onConfirm: a, tableId: s } = t, c =
|
|
1550
|
+
const Ri = (t) => {
|
|
1551
|
+
const { unitId: e, subUnitId: n, range: r, onCancel: i, onConfirm: a, tableId: s } = t, c = N(ne), [d, h] = Z(r), [u, g] = Z(""), _ = N(ue), S = N(_e);
|
|
1552
1552
|
return /* @__PURE__ */ w(Tt, { children: [
|
|
1553
1553
|
/* @__PURE__ */ o(
|
|
1554
|
-
|
|
1554
|
+
kr,
|
|
1555
1555
|
{
|
|
1556
1556
|
maxRangeCount: 1,
|
|
1557
1557
|
unitId: e,
|
|
1558
1558
|
subUnitId: n,
|
|
1559
1559
|
initialValue: Bt(r),
|
|
1560
|
-
onChange: (T,
|
|
1561
|
-
const f = Bt(r), E =
|
|
1560
|
+
onChange: (T, P) => {
|
|
1561
|
+
const f = Bt(r), E = Or(P).range, y = lt(S, { unitId: e, subUnitId: n });
|
|
1562
1562
|
if (!y)
|
|
1563
1563
|
return;
|
|
1564
1564
|
if (y.worksheet.getMergeData().some((x) => Ce.intersects(E, x))) {
|
|
@@ -1579,7 +1579,7 @@ const Ei = (t) => {
|
|
|
1579
1579
|
g(_.t("sheets-table.tableRangeSingleRowError"));
|
|
1580
1580
|
return;
|
|
1581
1581
|
}
|
|
1582
|
-
if (f !==
|
|
1582
|
+
if (f !== P) {
|
|
1583
1583
|
if (s) {
|
|
1584
1584
|
const x = c.getTableById(e, s);
|
|
1585
1585
|
if (x) {
|
|
@@ -1623,15 +1623,15 @@ const Ei = (t) => {
|
|
|
1623
1623
|
)
|
|
1624
1624
|
] })
|
|
1625
1625
|
] });
|
|
1626
|
-
},
|
|
1627
|
-
var Le, Te, de, b,
|
|
1628
|
-
const { unitId: e, subUnitId: n, tableId: r } = t, i =
|
|
1626
|
+
}, Ei = (t) => {
|
|
1627
|
+
var Le, Te, de, b, O, V, q, ct, We, je, ut, Ze;
|
|
1628
|
+
const { unitId: e, subUnitId: n, tableId: r } = t, i = N(ce), a = N(ue), s = N(ne), c = s.getTableById(e, r), d = N(an), h = N(Re), u = Me(d.rangeThemeMapChange$), g = Me(h.refreshTable$), _ = N($n), [, S] = Z(Math.random()), T = Me(s.tableThemeChanged$, {
|
|
1629
1629
|
theme: c == null ? void 0 : c.getTableStyleId(),
|
|
1630
1630
|
oldTheme: c == null ? void 0 : c.getTableStyleId(),
|
|
1631
1631
|
unitId: e,
|
|
1632
1632
|
subUnitId: n,
|
|
1633
1633
|
tableId: r
|
|
1634
|
-
}),
|
|
1634
|
+
}), P = d.getRegisteredRangeThemes().filter((m) => m == null ? void 0 : m.startsWith(Hr)), f = d.getALLRegisteredTheme(e).filter((m) => m == null ? void 0 : m.startsWith(ht)), E = c == null ? void 0 : c.getTableStyleId(), y = f.find((m) => m === E), D = y || f[0], v = d.getCustomRangeThemeStyle(e, D), p = (de = (Te = (Le = v == null ? void 0 : v.getHeaderRowStyle()) == null ? void 0 : Le.bg) == null ? void 0 : Te.rgb) != null ? de : me, L = (V = (O = (b = v == null ? void 0 : v.getFirstRowStyle()) == null ? void 0 : b.bg) == null ? void 0 : O.rgb) != null ? V : me, M = (We = (ct = (q = v == null ? void 0 : v.getSecondRowStyle()) == null ? void 0 : q.bg) == null ? void 0 : ct.rgb) != null ? We : me, C = (Ze = (ut = (je = v == null ? void 0 : v.getLastRowStyle()) == null ? void 0 : je.bg) == null ? void 0 : ut.rgb) != null ? Ze : me, [H, x] = Z(null), Q = (m) => {
|
|
1635
1635
|
i.executeCommand(bt.id, {
|
|
1636
1636
|
unitId: e,
|
|
1637
1637
|
tableId: r,
|
|
@@ -1648,41 +1648,40 @@ const Ei = (t) => {
|
|
|
1648
1648
|
const K = Number(m.split("-")[2]);
|
|
1649
1649
|
I = `${ht}${K + 1}`;
|
|
1650
1650
|
}
|
|
1651
|
-
const X = new
|
|
1652
|
-
i.executeCommand(
|
|
1651
|
+
const X = new Lr(I, { ...Qn });
|
|
1652
|
+
i.executeCommand(Gn.id, {
|
|
1653
1653
|
unitId: e,
|
|
1654
1654
|
tableId: r,
|
|
1655
1655
|
themeStyle: X
|
|
1656
1656
|
});
|
|
1657
1657
|
}, ee = (m, I) => {
|
|
1658
|
-
i.executeCommand(
|
|
1658
|
+
i.executeCommand(nn.id, {
|
|
1659
1659
|
unitId: e,
|
|
1660
1660
|
subUnitId: n,
|
|
1661
1661
|
styleName: m,
|
|
1662
1662
|
style: I
|
|
1663
1663
|
});
|
|
1664
1664
|
}, xe = (m) => {
|
|
1665
|
-
i.executeCommand(
|
|
1665
|
+
i.executeCommand(zn.id, {
|
|
1666
1666
|
unitId: e,
|
|
1667
1667
|
tableId: r,
|
|
1668
1668
|
themeName: m
|
|
1669
1669
|
});
|
|
1670
1670
|
};
|
|
1671
|
-
return
|
|
1671
|
+
return on(() => {
|
|
1672
1672
|
S(Math.random());
|
|
1673
1673
|
}, [u, g]), c ? /* @__PURE__ */ w("div", { children: [
|
|
1674
1674
|
/* @__PURE__ */ o("h5", { children: a.t("sheets-table.defaultStyle") }),
|
|
1675
|
-
/* @__PURE__ */ o("div", { className: "univer-flex univer-gap-2", children:
|
|
1676
|
-
var he, ve, ge, Y, we, Ie,
|
|
1677
|
-
const I = d.getDefaultRangeThemeStyle(m), X = ((ve = (he = I == null ? void 0 : I.getHeaderRowStyle()) == null ? void 0 : he.bg) == null ? void 0 : ve.rgb) || me, K = ((Y = (ge = I == null ? void 0 : I.getFirstRowStyle()) == null ? void 0 : ge.bg) == null ? void 0 : Y.rgb) || me, se = ((Ie = (we = I == null ? void 0 : I.getSecondRowStyle()) == null ? void 0 : we.bg) == null ? void 0 : Ie.rgb) || me, le = ((
|
|
1675
|
+
/* @__PURE__ */ o("div", { className: "univer-flex univer-gap-2", children: P.map((m) => {
|
|
1676
|
+
var he, ve, ge, Y, we, Ie, Ve, Ae;
|
|
1677
|
+
const I = d.getDefaultRangeThemeStyle(m), X = ((ve = (he = I == null ? void 0 : I.getHeaderRowStyle()) == null ? void 0 : he.bg) == null ? void 0 : ve.rgb) || me, K = ((Y = (ge = I == null ? void 0 : I.getFirstRowStyle()) == null ? void 0 : ge.bg) == null ? void 0 : Y.rgb) || me, se = ((Ie = (we = I == null ? void 0 : I.getSecondRowStyle()) == null ? void 0 : we.bg) == null ? void 0 : Ie.rgb) || me, le = ((Ae = (Ve = I == null ? void 0 : I.getLastRowStyle()) == null ? void 0 : Ve.bg) == null ? void 0 : Ae.rgb) || me;
|
|
1678
1678
|
return /* @__PURE__ */ w(
|
|
1679
1679
|
"div",
|
|
1680
1680
|
{
|
|
1681
|
-
className: "univer-h-10 univer-w-8 univer-cursor-pointer univer-p-px",
|
|
1681
|
+
className: k("univer-h-10 univer-w-8 univer-cursor-pointer univer-p-px univer-border univer-border-solid univer-border-gray-200", {
|
|
1682
|
+
"univer-border-blue-500": m === T.theme
|
|
1683
|
+
}),
|
|
1682
1684
|
onClick: () => Q(m),
|
|
1683
|
-
style: {
|
|
1684
|
-
border: m === T.theme ? Ft : Oe
|
|
1685
|
-
},
|
|
1686
1685
|
children: [
|
|
1687
1686
|
/* @__PURE__ */ o("div", { className: "univer-box-border univer-h-2.5", style: { background: X, border: `${G}` } }),
|
|
1688
1687
|
/* @__PURE__ */ o("div", { className: "univer-box-border univer-h-2.5", style: { background: K, border: `${G}` } }),
|
|
@@ -1694,41 +1693,40 @@ const Ei = (t) => {
|
|
|
1694
1693
|
);
|
|
1695
1694
|
}) }),
|
|
1696
1695
|
/* @__PURE__ */ o("h5", { children: a.t("sheets-table.customStyle") }),
|
|
1697
|
-
/* @__PURE__ */ w("div", { className:
|
|
1696
|
+
/* @__PURE__ */ w("div", { className: k("univer-w-full univer-rounded-sm", F), children: [
|
|
1698
1697
|
/* @__PURE__ */ w("div", { className: "univer-flex univer-flex-wrap univer-gap-2 univer-p-2", children: [
|
|
1699
1698
|
/* @__PURE__ */ o(
|
|
1700
1699
|
"div",
|
|
1701
1700
|
{
|
|
1702
|
-
className:
|
|
1701
|
+
className: k("univer-h-10 univer-w-8 univer-cursor-pointer univer-p-px univer-text-center univer-leading-10", F),
|
|
1703
1702
|
onClick: U,
|
|
1704
1703
|
children: "+"
|
|
1705
1704
|
}
|
|
1706
1705
|
),
|
|
1707
1706
|
f.map((m) => {
|
|
1708
|
-
var he, ve, ge, Y, we, Ie,
|
|
1709
|
-
const I = d.getCustomRangeThemeStyle(e, m), X = (ve = (he = I == null ? void 0 : I.getHeaderRowStyle()) == null ? void 0 : he.bg) == null ? void 0 : ve.rgb, K = (Y = (ge = I == null ? void 0 : I.getFirstRowStyle()) == null ? void 0 : ge.bg) == null ? void 0 : Y.rgb, se = (Ie = (we = I == null ? void 0 : I.getSecondRowStyle()) == null ? void 0 : we.bg) == null ? void 0 : Ie.rgb, le = (
|
|
1707
|
+
var he, ve, ge, Y, we, Ie, Ve, Ae;
|
|
1708
|
+
const I = d.getCustomRangeThemeStyle(e, m), X = (ve = (he = I == null ? void 0 : I.getHeaderRowStyle()) == null ? void 0 : he.bg) == null ? void 0 : ve.rgb, K = (Y = (ge = I == null ? void 0 : I.getFirstRowStyle()) == null ? void 0 : ge.bg) == null ? void 0 : Y.rgb, se = (Ie = (we = I == null ? void 0 : I.getSecondRowStyle()) == null ? void 0 : we.bg) == null ? void 0 : Ie.rgb, le = (Ae = (Ve = I == null ? void 0 : I.getLastRowStyle()) == null ? void 0 : Ve.bg) == null ? void 0 : Ae.rgb;
|
|
1710
1709
|
return /* @__PURE__ */ w(
|
|
1711
1710
|
"div",
|
|
1712
1711
|
{
|
|
1713
|
-
className: "univer-relative univer-h-10 univer-w-8 univer-cursor-pointer univer-p-px",
|
|
1712
|
+
className: k("univer-relative univer-h-10 univer-w-8 univer-cursor-pointer univer-p-px univer-border univer-border-solid univer-border-gray-200", {
|
|
1713
|
+
"univer-border-blue-500": m === T.theme
|
|
1714
|
+
}),
|
|
1714
1715
|
onClick: () => Q(m),
|
|
1715
|
-
style: {
|
|
1716
|
-
border: m === T.theme ? Ft : Oe
|
|
1717
|
-
},
|
|
1718
1716
|
onMouseEnter: () => x(m),
|
|
1719
1717
|
onMouseLeave: () => x(null),
|
|
1720
1718
|
children: [
|
|
1721
|
-
/* @__PURE__ */ o("div", { className: "univer-box-border univer-h-2.5", style: { background: X != null ? X : G, border: `${X ? G :
|
|
1722
|
-
/* @__PURE__ */ o("div", { className: "univer-box-border univer-h-2.5", style: { background: K != null ? K : G, border: `${K ? G :
|
|
1723
|
-
/* @__PURE__ */ o("div", { className: "univer-box-border univer-h-2.5", style: { background: se != null ? se : G, border: `${se ? G :
|
|
1724
|
-
/* @__PURE__ */ o("div", { className: "univer-box-border univer-h-2.5", style: { background: le != null ? le : G, border: `${le ? G :
|
|
1719
|
+
/* @__PURE__ */ o("div", { className: "univer-box-border univer-h-2.5", style: { background: X != null ? X : G, border: `${X ? G : Qe}` } }),
|
|
1720
|
+
/* @__PURE__ */ o("div", { className: "univer-box-border univer-h-2.5", style: { background: K != null ? K : G, border: `${K ? G : Qe}` } }),
|
|
1721
|
+
/* @__PURE__ */ o("div", { className: "univer-box-border univer-h-2.5", style: { background: se != null ? se : G, border: `${se ? G : Qe}` } }),
|
|
1722
|
+
/* @__PURE__ */ o("div", { className: "univer-box-border univer-h-2.5", style: { background: le != null ? le : G, border: `${le ? G : Qe}` } }),
|
|
1725
1723
|
/* @__PURE__ */ o(
|
|
1726
1724
|
"div",
|
|
1727
1725
|
{
|
|
1728
1726
|
className: "univer-absolute univer-right-[-3px] univer-top-[-3px] univer-h-3 univer-w-3 univer-rounded-md univer-bg-gray-200 univer-text-center univer-text-xs univer-leading-[10px]",
|
|
1729
|
-
style: { display:
|
|
1730
|
-
onClick: (
|
|
1731
|
-
|
|
1727
|
+
style: { display: H === m ? "block" : "none" },
|
|
1728
|
+
onClick: (Mn) => {
|
|
1729
|
+
Mn.stopPropagation(), xe(m);
|
|
1732
1730
|
},
|
|
1733
1731
|
children: "x"
|
|
1734
1732
|
}
|
|
@@ -1746,7 +1744,7 @@ const Ei = (t) => {
|
|
|
1746
1744
|
/* @__PURE__ */ o(
|
|
1747
1745
|
"div",
|
|
1748
1746
|
{
|
|
1749
|
-
className:
|
|
1747
|
+
className: k("univer-box-border univer-h-full univer-w-52 univer-rounded-sm univer-text-center univer-leading-9", F),
|
|
1750
1748
|
style: {
|
|
1751
1749
|
background: p,
|
|
1752
1750
|
color: new oe(p).isDark() ? "#fff" : "#000"
|
|
@@ -1755,10 +1753,10 @@ const Ei = (t) => {
|
|
|
1755
1753
|
}
|
|
1756
1754
|
),
|
|
1757
1755
|
/* @__PURE__ */ o(
|
|
1758
|
-
|
|
1756
|
+
ke,
|
|
1759
1757
|
{
|
|
1760
1758
|
overlay: /* @__PURE__ */ o("div", { className: "univer-p-2", children: /* @__PURE__ */ o(
|
|
1761
|
-
|
|
1759
|
+
Ye,
|
|
1762
1760
|
{
|
|
1763
1761
|
value: p,
|
|
1764
1762
|
onChange: (m) => {
|
|
@@ -1777,19 +1775,19 @@ const Ei = (t) => {
|
|
|
1777
1775
|
children: /* @__PURE__ */ w(
|
|
1778
1776
|
"div",
|
|
1779
1777
|
{
|
|
1780
|
-
className:
|
|
1778
|
+
className: k("univer-flex univer-cursor-pointer univer-items-center univer-gap-2 univer-rounded-sm univer-bg-white univer-p-1", F),
|
|
1781
1779
|
children: [
|
|
1782
1780
|
/* @__PURE__ */ o(
|
|
1783
1781
|
"div",
|
|
1784
1782
|
{
|
|
1785
|
-
className:
|
|
1783
|
+
className: k("univer-h-4 univer-w-4 univer-rounded-lg univer-bg-gray-400", F),
|
|
1786
1784
|
style: {
|
|
1787
1785
|
background: p,
|
|
1788
1786
|
color: new oe(p).isDark() ? "#fff" : "#000"
|
|
1789
1787
|
}
|
|
1790
1788
|
}
|
|
1791
1789
|
),
|
|
1792
|
-
/* @__PURE__ */ o(
|
|
1790
|
+
/* @__PURE__ */ o(Ue, { className: "univer-h-2 univer-w-2" })
|
|
1793
1791
|
]
|
|
1794
1792
|
}
|
|
1795
1793
|
)
|
|
@@ -1800,7 +1798,7 @@ const Ei = (t) => {
|
|
|
1800
1798
|
/* @__PURE__ */ o(
|
|
1801
1799
|
"div",
|
|
1802
1800
|
{
|
|
1803
|
-
className:
|
|
1801
|
+
className: k("univer-box-border univer-h-full univer-w-52 univer-rounded-sm univer-text-center univer-leading-9", F),
|
|
1804
1802
|
style: {
|
|
1805
1803
|
background: L,
|
|
1806
1804
|
color: new oe(L).isDark() ? "#fff" : "#000"
|
|
@@ -1809,10 +1807,10 @@ const Ei = (t) => {
|
|
|
1809
1807
|
}
|
|
1810
1808
|
),
|
|
1811
1809
|
/* @__PURE__ */ o(
|
|
1812
|
-
|
|
1810
|
+
ke,
|
|
1813
1811
|
{
|
|
1814
1812
|
overlay: /* @__PURE__ */ o("div", { className: "univer-p-2", children: /* @__PURE__ */ o(
|
|
1815
|
-
|
|
1813
|
+
Ye,
|
|
1816
1814
|
{
|
|
1817
1815
|
value: L,
|
|
1818
1816
|
onChange: (m) => {
|
|
@@ -1832,16 +1830,16 @@ const Ei = (t) => {
|
|
|
1832
1830
|
children: /* @__PURE__ */ w(
|
|
1833
1831
|
"div",
|
|
1834
1832
|
{
|
|
1835
|
-
className:
|
|
1833
|
+
className: k("univer-flex univer-cursor-pointer univer-items-center univer-gap-2 univer-rounded-sm univer-bg-white univer-p-1", F),
|
|
1836
1834
|
children: [
|
|
1837
1835
|
/* @__PURE__ */ o(
|
|
1838
1836
|
"div",
|
|
1839
1837
|
{
|
|
1840
|
-
className:
|
|
1838
|
+
className: k("univer-h-4 univer-w-4 univer-rounded-lg univer-bg-gray-400", F),
|
|
1841
1839
|
style: { background: L }
|
|
1842
1840
|
}
|
|
1843
1841
|
),
|
|
1844
|
-
/* @__PURE__ */ o(
|
|
1842
|
+
/* @__PURE__ */ o(Ue, { className: "univer-h-2 univer-w-2" })
|
|
1845
1843
|
]
|
|
1846
1844
|
}
|
|
1847
1845
|
)
|
|
@@ -1852,7 +1850,7 @@ const Ei = (t) => {
|
|
|
1852
1850
|
/* @__PURE__ */ o(
|
|
1853
1851
|
"div",
|
|
1854
1852
|
{
|
|
1855
|
-
className:
|
|
1853
|
+
className: k("univer-box-border univer-h-full univer-w-52 univer-rounded-sm univer-text-center univer-leading-9", F),
|
|
1856
1854
|
style: {
|
|
1857
1855
|
background: M,
|
|
1858
1856
|
color: new oe(M).isDark() ? "#fff" : "#000"
|
|
@@ -1861,10 +1859,10 @@ const Ei = (t) => {
|
|
|
1861
1859
|
}
|
|
1862
1860
|
),
|
|
1863
1861
|
/* @__PURE__ */ o(
|
|
1864
|
-
|
|
1862
|
+
ke,
|
|
1865
1863
|
{
|
|
1866
1864
|
overlay: /* @__PURE__ */ o("div", { className: "univer-p-2", children: /* @__PURE__ */ o(
|
|
1867
|
-
|
|
1865
|
+
Ye,
|
|
1868
1866
|
{
|
|
1869
1867
|
value: M,
|
|
1870
1868
|
onChange: (m) => ee(c.getTableStyleId(), {
|
|
@@ -1882,16 +1880,16 @@ const Ei = (t) => {
|
|
|
1882
1880
|
children: /* @__PURE__ */ w(
|
|
1883
1881
|
"div",
|
|
1884
1882
|
{
|
|
1885
|
-
className:
|
|
1883
|
+
className: k("univer-flex univer-cursor-pointer univer-items-center univer-gap-2 univer-rounded-sm univer-bg-white univer-p-1", F),
|
|
1886
1884
|
children: [
|
|
1887
1885
|
/* @__PURE__ */ o(
|
|
1888
1886
|
"div",
|
|
1889
1887
|
{
|
|
1890
|
-
className:
|
|
1888
|
+
className: k("univer-h-4 univer-w-4 univer-rounded-lg univer-bg-gray-400", F),
|
|
1891
1889
|
style: { background: M }
|
|
1892
1890
|
}
|
|
1893
1891
|
),
|
|
1894
|
-
/* @__PURE__ */ o(
|
|
1892
|
+
/* @__PURE__ */ o(Ue, { className: "univer-h-2 univer-w-2" })
|
|
1895
1893
|
]
|
|
1896
1894
|
}
|
|
1897
1895
|
)
|
|
@@ -1902,7 +1900,7 @@ const Ei = (t) => {
|
|
|
1902
1900
|
/* @__PURE__ */ o(
|
|
1903
1901
|
"div",
|
|
1904
1902
|
{
|
|
1905
|
-
className:
|
|
1903
|
+
className: k("univer-box-border univer-h-full univer-w-52 univer-rounded-sm univer-text-center univer-leading-9", F),
|
|
1906
1904
|
style: {
|
|
1907
1905
|
background: C,
|
|
1908
1906
|
color: new oe(C).isDark() ? "#fff" : "#000"
|
|
@@ -1911,10 +1909,10 @@ const Ei = (t) => {
|
|
|
1911
1909
|
}
|
|
1912
1910
|
),
|
|
1913
1911
|
/* @__PURE__ */ o(
|
|
1914
|
-
|
|
1912
|
+
ke,
|
|
1915
1913
|
{
|
|
1916
1914
|
overlay: /* @__PURE__ */ o("div", { className: "univer-p-2", children: /* @__PURE__ */ o(
|
|
1917
|
-
|
|
1915
|
+
Ye,
|
|
1918
1916
|
{
|
|
1919
1917
|
value: C,
|
|
1920
1918
|
onChange: (m) => {
|
|
@@ -1933,16 +1931,16 @@ const Ei = (t) => {
|
|
|
1933
1931
|
children: /* @__PURE__ */ w(
|
|
1934
1932
|
"div",
|
|
1935
1933
|
{
|
|
1936
|
-
className:
|
|
1934
|
+
className: k("univer-flex univer-cursor-pointer univer-items-center univer-gap-2 univer-rounded-sm univer-bg-white univer-p-1", F),
|
|
1937
1935
|
children: [
|
|
1938
1936
|
/* @__PURE__ */ o(
|
|
1939
1937
|
"div",
|
|
1940
1938
|
{
|
|
1941
|
-
className:
|
|
1939
|
+
className: k("univer-h-4 univer-w-4 univer-rounded-lg univer-bg-gray-400", F),
|
|
1942
1940
|
style: { background: C }
|
|
1943
1941
|
}
|
|
1944
1942
|
),
|
|
1945
|
-
/* @__PURE__ */ o(
|
|
1943
|
+
/* @__PURE__ */ o(Ue, { className: "univer-h-2 univer-w-2" })
|
|
1946
1944
|
]
|
|
1947
1945
|
}
|
|
1948
1946
|
)
|
|
@@ -1953,87 +1951,87 @@ const Ei = (t) => {
|
|
|
1953
1951
|
] })
|
|
1954
1952
|
] })
|
|
1955
1953
|
] }) : null;
|
|
1956
|
-
},
|
|
1957
|
-
function
|
|
1954
|
+
}, _n = "sheet.table.context-insert_menu-id", Tn = "sheet.table.context-remove_menu-id";
|
|
1955
|
+
function xi(t) {
|
|
1958
1956
|
return {
|
|
1959
1957
|
id: Mt.id,
|
|
1960
1958
|
type: Ee.BUTTON,
|
|
1961
|
-
icon:
|
|
1959
|
+
icon: cn,
|
|
1962
1960
|
tooltip: "sheets-table.title",
|
|
1963
1961
|
title: "sheets-table.title",
|
|
1964
|
-
disabled$:
|
|
1962
|
+
disabled$: ir(t, {}, !0)
|
|
1965
1963
|
};
|
|
1966
1964
|
}
|
|
1967
|
-
function
|
|
1965
|
+
function Li(t) {
|
|
1968
1966
|
return {
|
|
1969
|
-
id:
|
|
1967
|
+
id: _n,
|
|
1970
1968
|
type: Ee.SUBITEMS,
|
|
1971
1969
|
icon: "Insert",
|
|
1972
1970
|
title: "sheets-table.insert.main",
|
|
1973
|
-
hidden$:
|
|
1971
|
+
hidden$: wn(t)
|
|
1974
1972
|
};
|
|
1975
1973
|
}
|
|
1976
|
-
function
|
|
1974
|
+
function $i(t) {
|
|
1977
1975
|
return {
|
|
1978
|
-
id:
|
|
1976
|
+
id: Tn,
|
|
1979
1977
|
type: Ee.SUBITEMS,
|
|
1980
1978
|
icon: "Reduce",
|
|
1981
1979
|
title: "sheets-table.remove.main",
|
|
1982
|
-
hidden$:
|
|
1980
|
+
hidden$: wn(t)
|
|
1983
1981
|
};
|
|
1984
1982
|
}
|
|
1985
1983
|
function Pi(t) {
|
|
1986
1984
|
return {
|
|
1987
|
-
id:
|
|
1985
|
+
id: zt.id,
|
|
1988
1986
|
type: Ee.BUTTON,
|
|
1989
1987
|
title: "sheets-table.insert.row",
|
|
1990
|
-
hidden$:
|
|
1988
|
+
hidden$: In(t)
|
|
1991
1989
|
};
|
|
1992
1990
|
}
|
|
1993
|
-
function
|
|
1991
|
+
function Oi(t) {
|
|
1994
1992
|
return {
|
|
1995
|
-
id:
|
|
1993
|
+
id: Gt.id,
|
|
1996
1994
|
title: "sheets-table.insert.col",
|
|
1997
1995
|
type: Ee.BUTTON
|
|
1998
1996
|
};
|
|
1999
1997
|
}
|
|
2000
|
-
function
|
|
1998
|
+
function ki(t) {
|
|
2001
1999
|
return {
|
|
2002
|
-
id:
|
|
2000
|
+
id: Qt.id,
|
|
2003
2001
|
type: Ee.BUTTON,
|
|
2004
2002
|
title: "sheets-table.remove.row",
|
|
2005
|
-
hidden$:
|
|
2003
|
+
hidden$: In(t)
|
|
2006
2004
|
};
|
|
2007
2005
|
}
|
|
2008
|
-
function
|
|
2006
|
+
function Di(t) {
|
|
2009
2007
|
return {
|
|
2010
|
-
id:
|
|
2008
|
+
id: Yt.id,
|
|
2011
2009
|
title: "sheets-table.remove.col",
|
|
2012
2010
|
type: Ee.BUTTON
|
|
2013
2011
|
};
|
|
2014
2012
|
}
|
|
2015
|
-
function
|
|
2013
|
+
function wn(t) {
|
|
2016
2014
|
const e = t.get(ot);
|
|
2017
2015
|
return t.get(_e).getCurrentTypeOfUnit$(at.UNIVER_SHEET).pipe(
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2016
|
+
Ne((i) => i ? i.activeSheet$.pipe(
|
|
2017
|
+
Ne((a) => a ? e.selectionMoveEnd$.pipe(
|
|
2018
|
+
Ne((s) => {
|
|
2021
2019
|
if (!s.length || s.length > 1) return J(!0);
|
|
2022
|
-
const d = s[0].range, u = t.get(
|
|
2020
|
+
const d = s[0].range, u = t.get(Xt).getContainerTableWithRange(i.getUnitId(), a.getSheetId(), d);
|
|
2023
2021
|
return J(!u);
|
|
2024
2022
|
})
|
|
2025
2023
|
) : J(!0))
|
|
2026
2024
|
) : J(!0))
|
|
2027
2025
|
);
|
|
2028
2026
|
}
|
|
2029
|
-
function
|
|
2027
|
+
function In(t) {
|
|
2030
2028
|
const e = t.get(ot);
|
|
2031
2029
|
return t.get(_e).getCurrentTypeOfUnit$(at.UNIVER_SHEET).pipe(
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2030
|
+
Ne((i) => i ? i.activeSheet$.pipe(
|
|
2031
|
+
Ne((a) => a ? e.selectionMoveEnd$.pipe(
|
|
2032
|
+
Ne((s) => {
|
|
2035
2033
|
if (!s.length || s.length > 1) return J(!0);
|
|
2036
|
-
const d = s[0].range, u = t.get(
|
|
2034
|
+
const d = s[0].range, u = t.get(Xt).getContainerTableWithRange(i.getUnitId(), a.getSheetId(), d);
|
|
2037
2035
|
if (!u)
|
|
2038
2036
|
return J(!0);
|
|
2039
2037
|
const g = u.getRange();
|
|
@@ -2043,74 +2041,74 @@ function yn(t) {
|
|
|
2043
2041
|
) : J(!0))
|
|
2044
2042
|
);
|
|
2045
2043
|
}
|
|
2046
|
-
const
|
|
2047
|
-
[
|
|
2044
|
+
const Bi = {
|
|
2045
|
+
[hr.ORGANIZATION]: {
|
|
2048
2046
|
[Mt.id]: {
|
|
2049
2047
|
order: 0,
|
|
2050
|
-
menuItemFactory:
|
|
2048
|
+
menuItemFactory: xi
|
|
2051
2049
|
}
|
|
2052
2050
|
},
|
|
2053
|
-
[
|
|
2054
|
-
[
|
|
2055
|
-
[
|
|
2051
|
+
[ur.MAIN_AREA]: {
|
|
2052
|
+
[dr.LAYOUT]: {
|
|
2053
|
+
[_n]: {
|
|
2056
2054
|
order: 5,
|
|
2057
|
-
menuItemFactory:
|
|
2058
|
-
[
|
|
2055
|
+
menuItemFactory: Li,
|
|
2056
|
+
[zt.id]: {
|
|
2059
2057
|
order: 1,
|
|
2060
2058
|
menuItemFactory: Pi
|
|
2061
2059
|
},
|
|
2062
|
-
[
|
|
2060
|
+
[Gt.id]: {
|
|
2063
2061
|
order: 2,
|
|
2064
|
-
menuItemFactory:
|
|
2062
|
+
menuItemFactory: Oi
|
|
2065
2063
|
}
|
|
2066
2064
|
},
|
|
2067
|
-
[
|
|
2065
|
+
[Tn]: {
|
|
2068
2066
|
order: 6,
|
|
2069
|
-
menuItemFactory:
|
|
2070
|
-
[
|
|
2067
|
+
menuItemFactory: $i,
|
|
2068
|
+
[Qt.id]: {
|
|
2071
2069
|
order: 1,
|
|
2072
|
-
menuItemFactory:
|
|
2070
|
+
menuItemFactory: ki
|
|
2073
2071
|
},
|
|
2074
|
-
[
|
|
2072
|
+
[Yt.id]: {
|
|
2075
2073
|
order: 2,
|
|
2076
|
-
menuItemFactory:
|
|
2074
|
+
menuItemFactory: Di
|
|
2077
2075
|
}
|
|
2078
2076
|
}
|
|
2079
2077
|
}
|
|
2080
2078
|
}
|
|
2081
2079
|
};
|
|
2082
|
-
var
|
|
2083
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
2080
|
+
var Fi = Object.getOwnPropertyDescriptor, Hi = (t, e, n, r) => {
|
|
2081
|
+
for (var i = r > 1 ? void 0 : r ? Fi(e, n) : e, a = t.length - 1, s; a >= 0; a--)
|
|
2084
2082
|
(s = t[a]) && (i = s(i) || i);
|
|
2085
2083
|
return i;
|
|
2086
|
-
},
|
|
2087
|
-
let nt = class extends
|
|
2084
|
+
}, Vt = (t, e) => (n, r) => e(n, r, t);
|
|
2085
|
+
let nt = class extends Fe {
|
|
2088
2086
|
constructor(t, e) {
|
|
2089
2087
|
super(), this._componentManager = t, this._menuManagerService = e, this._initComponents(), this._initMenu();
|
|
2090
2088
|
}
|
|
2091
2089
|
_initComponents() {
|
|
2092
2090
|
[
|
|
2093
|
-
[
|
|
2094
|
-
[
|
|
2095
|
-
[
|
|
2091
|
+
[cn, fn],
|
|
2092
|
+
[Oe, Ri],
|
|
2093
|
+
[un, Ei]
|
|
2096
2094
|
].forEach(([t, e]) => {
|
|
2097
2095
|
this.disposeWithMe(this._componentManager.register(t, e));
|
|
2098
2096
|
});
|
|
2099
2097
|
}
|
|
2100
2098
|
_initMenu() {
|
|
2101
|
-
this._menuManagerService.mergeMenu(
|
|
2099
|
+
this._menuManagerService.mergeMenu(Bi);
|
|
2102
2100
|
}
|
|
2103
2101
|
};
|
|
2104
|
-
nt =
|
|
2105
|
-
|
|
2106
|
-
|
|
2102
|
+
nt = Hi([
|
|
2103
|
+
Vt(0, R(Kt)),
|
|
2104
|
+
Vt(1, R(vr))
|
|
2107
2105
|
], nt);
|
|
2108
|
-
var
|
|
2109
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
2106
|
+
var Vi = Object.getOwnPropertyDescriptor, Ai = (t, e, n, r) => {
|
|
2107
|
+
for (var i = r > 1 ? void 0 : r ? Vi(e, n) : e, a = t.length - 1, s; a >= 0; a--)
|
|
2110
2108
|
(s = t[a]) && (i = s(i) || i);
|
|
2111
2109
|
return i;
|
|
2112
2110
|
}, Je = (t, e) => (n, r) => e(n, r, t);
|
|
2113
|
-
let Ct = class extends
|
|
2111
|
+
let Ct = class extends Zt {
|
|
2114
2112
|
constructor(t, e, n, r, i) {
|
|
2115
2113
|
super(), this._context = t, this._injector = e, this._sheetSkeletonManagerService = n, this._tableManager = r, this._sheetTableThemeUIController = i, this._initListener();
|
|
2116
2114
|
}
|
|
@@ -2141,18 +2139,18 @@ let Ct = class extends qt {
|
|
|
2141
2139
|
);
|
|
2142
2140
|
}
|
|
2143
2141
|
};
|
|
2144
|
-
Ct =
|
|
2145
|
-
Je(1,
|
|
2146
|
-
Je(2,
|
|
2147
|
-
Je(3,
|
|
2148
|
-
Je(4,
|
|
2142
|
+
Ct = Ai([
|
|
2143
|
+
Je(1, R(He)),
|
|
2144
|
+
Je(2, R(st)),
|
|
2145
|
+
Je(3, R(ne)),
|
|
2146
|
+
Je(4, R(Re))
|
|
2149
2147
|
], Ct);
|
|
2150
|
-
var
|
|
2151
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
2148
|
+
var Ui = Object.getOwnPropertyDescriptor, Wi = (t, e, n, r) => {
|
|
2149
|
+
for (var i = r > 1 ? void 0 : r ? Ui(e, n) : e, a = t.length - 1, s; a >= 0; a--)
|
|
2152
2150
|
(s = t[a]) && (i = s(i) || i);
|
|
2153
2151
|
return i;
|
|
2154
2152
|
}, gt = (t, e) => (n, r) => e(n, r, t);
|
|
2155
|
-
let rt = class extends
|
|
2153
|
+
let rt = class extends Fe {
|
|
2156
2154
|
constructor(t, e, n) {
|
|
2157
2155
|
super(), this._sheetInterceptorService = t, this._univerInstanceService = e, this._tableManager = n, this._initSelectionChange();
|
|
2158
2156
|
}
|
|
@@ -2160,7 +2158,7 @@ let rt = class extends He {
|
|
|
2160
2158
|
this.disposeWithMe(
|
|
2161
2159
|
this._sheetInterceptorService.interceptCommand({
|
|
2162
2160
|
getMutations: (t) => {
|
|
2163
|
-
if (t.id ===
|
|
2161
|
+
if (t.id === ar.id) {
|
|
2164
2162
|
const e = lt(this._univerInstanceService);
|
|
2165
2163
|
if (!e)
|
|
2166
2164
|
return { redos: [], undos: [] };
|
|
@@ -2177,14 +2175,14 @@ let rt = class extends He {
|
|
|
2177
2175
|
undos: [],
|
|
2178
2176
|
redos: [
|
|
2179
2177
|
{
|
|
2180
|
-
id:
|
|
2178
|
+
id: Ot.id,
|
|
2181
2179
|
params: {
|
|
2182
2180
|
unitId: i,
|
|
2183
2181
|
subUnitId: a,
|
|
2184
2182
|
selections: [
|
|
2185
2183
|
{
|
|
2186
2184
|
range: h,
|
|
2187
|
-
primary:
|
|
2185
|
+
primary: Pt(h, s)
|
|
2188
2186
|
}
|
|
2189
2187
|
]
|
|
2190
2188
|
}
|
|
@@ -2194,14 +2192,14 @@ let rt = class extends He {
|
|
|
2194
2192
|
undos: [],
|
|
2195
2193
|
redos: [
|
|
2196
2194
|
{
|
|
2197
|
-
id:
|
|
2195
|
+
id: Ot.id,
|
|
2198
2196
|
params: {
|
|
2199
2197
|
unitId: i,
|
|
2200
2198
|
subUnitId: a,
|
|
2201
2199
|
selections: [
|
|
2202
2200
|
{
|
|
2203
2201
|
range: u,
|
|
2204
|
-
primary:
|
|
2202
|
+
primary: Pt(u, s)
|
|
2205
2203
|
}
|
|
2206
2204
|
]
|
|
2207
2205
|
}
|
|
@@ -2216,41 +2214,41 @@ let rt = class extends He {
|
|
|
2216
2214
|
);
|
|
2217
2215
|
}
|
|
2218
2216
|
};
|
|
2219
|
-
rt =
|
|
2220
|
-
gt(0,
|
|
2221
|
-
gt(1,
|
|
2222
|
-
gt(2,
|
|
2217
|
+
rt = Wi([
|
|
2218
|
+
gt(0, R(sn)),
|
|
2219
|
+
gt(1, R(_e)),
|
|
2220
|
+
gt(2, R(ne))
|
|
2223
2221
|
], rt);
|
|
2224
|
-
var
|
|
2225
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
2222
|
+
var ji = Object.defineProperty, Zi = Object.getOwnPropertyDescriptor, qi = (t, e, n) => e in t ? ji(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Yi = (t, e, n, r) => {
|
|
2223
|
+
for (var i = r > 1 ? void 0 : r ? Zi(e, n) : e, a = t.length - 1, s; a >= 0; a--)
|
|
2226
2224
|
(s = t[a]) && (i = s(i) || i);
|
|
2227
2225
|
return i;
|
|
2228
|
-
}, et = (t, e) => (n, r) => e(n, r, t),
|
|
2229
|
-
let it = class extends
|
|
2230
|
-
constructor(t =
|
|
2226
|
+
}, et = (t, e) => (n, r) => e(n, r, t), yn = (t, e, n) => qi(t, typeof e != "symbol" ? e + "" : e, n);
|
|
2227
|
+
let it = class extends On {
|
|
2228
|
+
constructor(t = Ft, e, n, r, i) {
|
|
2231
2229
|
super(), this._config = t, this._injector = e, this._commandService = n, this._configService = r, this._renderManagerService = i;
|
|
2232
|
-
const { menu: a, ...s } =
|
|
2230
|
+
const { menu: a, ...s } = kn(
|
|
2233
2231
|
{},
|
|
2234
|
-
|
|
2232
|
+
Ft,
|
|
2235
2233
|
this._config
|
|
2236
2234
|
);
|
|
2237
|
-
a && this._configService.setConfig("menu", a, { merge: !0 }), this._configService.setConfig(
|
|
2235
|
+
a && this._configService.setConfig("menu", a, { merge: !0 }), this._configService.setConfig(Sn, s), this._initRegisterCommand();
|
|
2238
2236
|
}
|
|
2239
2237
|
onStarting() {
|
|
2240
|
-
|
|
2241
|
-
[Fe],
|
|
2238
|
+
Dn(this._injector, [
|
|
2242
2239
|
[Be],
|
|
2240
|
+
[De],
|
|
2243
2241
|
[nt],
|
|
2244
|
-
[
|
|
2242
|
+
[Re],
|
|
2245
2243
|
[rt]
|
|
2246
2244
|
]);
|
|
2247
2245
|
}
|
|
2248
2246
|
onReady() {
|
|
2249
|
-
|
|
2250
|
-
[Fe],
|
|
2247
|
+
Bn(this._injector, [
|
|
2251
2248
|
[Be],
|
|
2249
|
+
[De],
|
|
2252
2250
|
[nt],
|
|
2253
|
-
[
|
|
2251
|
+
[Re],
|
|
2254
2252
|
[rt]
|
|
2255
2253
|
]);
|
|
2256
2254
|
}
|
|
@@ -2273,14 +2271,14 @@ let it = class extends kn {
|
|
|
2273
2271
|
].forEach((t) => this._commandService.registerCommand(t));
|
|
2274
2272
|
}
|
|
2275
2273
|
};
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
it =
|
|
2279
|
-
Pn(
|
|
2280
|
-
et(1,
|
|
2281
|
-
et(2,
|
|
2282
|
-
et(3,
|
|
2283
|
-
et(4,
|
|
2274
|
+
yn(it, "pluginName", Dr);
|
|
2275
|
+
yn(it, "type", at.UNIVER_SHEET);
|
|
2276
|
+
it = Yi([
|
|
2277
|
+
Pn(Xn),
|
|
2278
|
+
et(1, R(He)),
|
|
2279
|
+
et(2, R(ce)),
|
|
2280
|
+
et(3, jt),
|
|
2281
|
+
et(4, qt)
|
|
2284
2282
|
], it);
|
|
2285
2283
|
export {
|
|
2286
2284
|
it as UniverSheetsTableUIPlugin
|