@univerjs/sheets-table-ui 0.10.1 → 0.10.2
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/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/index.js +828 -810
- package/lib/es/locale/ca-ES.js +1 -0
- package/lib/es/locale/en-US.js +1 -0
- package/lib/es/locale/es-ES.js +1 -0
- package/lib/es/locale/fa-IR.js +1 -0
- package/lib/es/locale/fr-FR.js +1 -0
- package/lib/es/locale/ko-KR.js +1 -0
- package/lib/es/locale/ru-RU.js +1 -0
- package/lib/es/locale/vi-VN.js +1 -0
- package/lib/es/locale/zh-CN.js +1 -0
- package/lib/es/locale/zh-TW.js +1 -0
- package/lib/index.css +1 -1
- package/lib/index.js +828 -810
- package/lib/locale/ca-ES.js +1 -0
- package/lib/locale/en-US.js +1 -0
- package/lib/locale/es-ES.js +1 -0
- package/lib/locale/fa-IR.js +1 -0
- package/lib/locale/fr-FR.js +1 -0
- package/lib/locale/ko-KR.js +1 -0
- package/lib/locale/ru-RU.js +1 -0
- package/lib/locale/vi-VN.js +1 -0
- package/lib/locale/zh-CN.js +1 -0
- package/lib/locale/zh-TW.js +1 -0
- package/lib/types/locale/en-US.d.ts +1 -0
- package/lib/types/views/components/util.d.ts +1 -1
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +13 -13
package/lib/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var A = (t, e, n) =>
|
|
4
|
-
import { Inject as
|
|
5
|
-
import { IRenderManagerService as
|
|
6
|
-
import { TableManager as ne, SheetTableService as
|
|
7
|
-
import { SheetCanvasPopManagerService as
|
|
8
|
-
import { useDependency as M, ComponentManager as
|
|
9
|
-
import { startWith as
|
|
10
|
-
import { jsxs as
|
|
11
|
-
import { Dropdown as
|
|
12
|
-
import { SetRangeValuesMutation as
|
|
13
|
-
import { SortRangeCommand as
|
|
14
|
-
import { forwardRef as re, useRef as
|
|
15
|
-
import { serializeRange as
|
|
16
|
-
import { RangeSelector as
|
|
17
|
-
const
|
|
1
|
+
var En = Object.defineProperty;
|
|
2
|
+
var Ln = (t, e, n) => e in t ? En(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var A = (t, e, n) => Ln(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { Inject as N, IUniverInstanceService as pe, ICommandService as le, Disposable as Oe, ObjectMatrix as $n, cellToRange as jt, Rectangle as be, LocaleService as oe, Injector as ke, IPermissionService as Zt, IContextService as wt, CommandType as qt, IConfigService as Yt, ThemeService as On, RxDisposable as Qt, InterceptorEffectEnum as kn, ErrorService as Pn, ColorKit as de, UniverInstanceType as Ze, DependentOn as Dn, Plugin as Bn, merge as Fn, registerDependencies as Hn, touchDependencies as Vn } from "@univerjs/core";
|
|
5
|
+
import { IRenderManagerService as Gt, SHEET_VIEWPORT_KEY as An, convertTransformToOffsetX as Un, convertTransformToOffsetY as Wn, Rect as Et, Shape as jn } from "@univerjs/engine-render";
|
|
6
|
+
import { TableManager as ne, SheetTableService as Zn, SetSheetTableFilterCommand as Lt, isConditionFilter as qn, isManualFilter as Yn, TableDateCompareTypeEnum as l, TableStringCompareTypeEnum as j, TableConditionTypeEnum as F, TableNumberCompareTypeEnum as $, SheetsTableSortStateEnum as Ge, TableColumnFilterTypeEnum as $t, AddSheetTableCommand as Qn, SHEET_TABLE_CUSTOM_THEME_PREFIX as Gn, DeleteSheetTableCommand as Xn, SetSheetTableCommand as ft, SheetsTableButtonStateEnum as Me, processStyleWithBorderStyle as Ot, customEmptyThemeWithBorderStyle as zn, AddTableThemeCommand as Kn, RemoveTableThemeCommand as Jn, SheetTableRemoveColCommand as Xt, SheetTableRemoveRowCommand as zt, SheetTableInsertColCommand as Kt, SheetTableInsertRowCommand as Jt, SheetsTableController as en, UniverSheetsTablePlugin as er } from "@univerjs/sheets-table";
|
|
7
|
+
import { SheetCanvasPopManagerService as tr, SheetSkeletonManagerService as ot, SheetScrollManagerService as nr, SetZoomRatioOperation as rr, SetScrollOperation as ir, getSheetObject as ar, getCoordByCell as sr, getCurrentRangeDisable$ as lr, SelectAllCommand as or } from "@univerjs/sheets-ui";
|
|
8
|
+
import { useDependency as M, ComponentManager as tn, IDialogService as nn, ISidebarService as cr, useObservable as Te, IUIPartsService as ur, BuiltInUIPart as dr, connectInjector as hr, MenuItemType as ye, getMenuHiddenObservable as vr, ContextMenuPosition as gr, ContextMenuGroup as br, RibbonDataGroup as mr, IMenuManagerService as pr } from "@univerjs/ui";
|
|
9
|
+
import { startWith as rn, distinctUntilChanged as fr, Subject as Cr, BehaviorSubject as kt, merge as It, filter as Sr, debounceTime as _r, switchMap as we, of as J, map as Tr, takeUntil as wr } from "rxjs";
|
|
10
|
+
import { jsxs as w, jsx as o, Fragment as yt } from "react/jsx-runtime";
|
|
11
|
+
import { Dropdown as Ee, clsx as P, borderClassName as H, CascaderList as Ir, Input as Rt, InputNumber as gt, DatePicker as yr, DateRangePicker as Rr, Select as Mr, Checkbox as Pt, scrollbarClassName as xr, ButtonGroup as Nr, Button as _e, Segmented as Er, ColorPicker as Xe } from "@univerjs/design";
|
|
12
|
+
import { SetRangeValuesMutation as Lr, WorkbookEditablePermission as an, getSheetCommandTarget as ct, SheetsSelectionsService as ut, isSingleCellSelection as $r, expandToContinuousRange as Or, SetRangeThemeMutation as sn, WorkbookPermissionService as ln, SheetRangeThemeModel as on, SheetInterceptorService as cn, INTERCEPTOR_POINT as kr, RangeThemeStyle as Pr, getPrimaryForRange as Dt, SetSelectionsOperation as Bt } from "@univerjs/sheets";
|
|
13
|
+
import { SortRangeCommand as Dr, SortType as Ft } from "@univerjs/sheets-sort";
|
|
14
|
+
import { forwardRef as re, useRef as Br, createElement as ie, useState as q, useMemo as un, useCallback as Ht, useEffect as dn } from "react";
|
|
15
|
+
import { serializeRange as Vt, deserializeRangeWithSheet as Fr } from "@univerjs/engine-formula";
|
|
16
|
+
import { RangeSelector as Hr } from "@univerjs/sheets-formula-ui";
|
|
17
|
+
const Vr = "SHEET_TABLE_UI_PLUGIN", ve = "SHEETS_TABLE_FILTER_PANEL_OPENED_KEY", Ar = "UNIVER_SHEET_Table_FILTER_PANEL_ID", hn = "TABLE_TOOLBAR_BUTTON", Ne = "TABLE_SELECTOR_DIALOG", Ur = "SHEET_TABLE_THEME_PANEL_ID", vn = "SHEET_TABLE_THEME_PANEL", bt = "table-custom-", Wr = "table-default-", he = "rgb(255, 255, 255)", G = "none", ze = "1px solid rgb(var(--grey-200))";
|
|
18
18
|
var X = function() {
|
|
19
19
|
return X = Object.assign || function(t) {
|
|
20
20
|
for (var e, n = 1, r = arguments.length; n < r; n++) {
|
|
@@ -23,7 +23,7 @@ var X = function() {
|
|
|
23
23
|
}
|
|
24
24
|
return t;
|
|
25
25
|
}, X.apply(this, arguments);
|
|
26
|
-
},
|
|
26
|
+
}, jr = 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 X = 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 = jr(t, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(r, " ").concat(i || "").trim(), d = Br("_".concat(Yr()));
|
|
35
|
+
return gn(n, "".concat(r), { defIds: n.defIds, idSuffix: d.current }, X({ ref: e, className: c }, s), a);
|
|
36
36
|
});
|
|
37
|
-
function
|
|
38
|
-
return ie(t.tag, X(X({ key: e },
|
|
39
|
-
return
|
|
37
|
+
function gn(t, e, n, r, i) {
|
|
38
|
+
return ie(t.tag, X(X({ key: e }, Zr(t, n, i)), r), (qr(t, n).children || []).map(function(a, s) {
|
|
39
|
+
return gn(a, "".concat(e, "-").concat(t.tag, "-").concat(s), n, void 0, i);
|
|
40
40
|
}));
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function Zr(t, e, n) {
|
|
43
43
|
var r = X({}, 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,94 +51,94 @@ function qr(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 qr(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) ? X(X({}, t), { children: t.children.map(function(i) {
|
|
57
57
|
return typeof i.attrs.id == "string" && r && r.includes(i.attrs.id) ? X(X({}, i), { attrs: X(X({}, i.attrs), { id: i.attrs.id + e.idSuffix }) }) : i;
|
|
58
58
|
}) }) : t;
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function Yr() {
|
|
61
61
|
return Math.random().toString(36).substring(2, 8);
|
|
62
62
|
}
|
|
63
63
|
ae.displayName = "UniverIcon";
|
|
64
|
-
var
|
|
64
|
+
var Qr = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "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.67983C1.38967 9.34846 1.6583 9.07983 1.98967 9.07983H6.50138C6.74406 9.07983 6.96284 9.22602 7.05571 9.45022C7.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.1916C7.10138 14.5229 6.83276 14.7916 6.50138 14.7916H1.98967C1.74699 14.7916 1.52821 14.6454 1.43534 14.4212C1.34247 14.197 1.3938 13.9389 1.5654 13.7673L5.05286 10.2798H1.98967Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M5.1846 1.86439C4.8641 0.989866 3.62725 0.989866 3.30674 1.86439L1.34882 7.20672C1.23479 7.51786 1.39458 7.86252 1.70571 7.97655C2.01684 8.09058 2.3615 7.93079 2.47553 7.61966L3.06159 6.02055L3.06338 6.02056H5.42975L6.01581 7.61966C6.12984 7.93079 6.4745 8.09058 6.78563 7.97655C7.09677 7.86252 7.25655 7.51786 7.14252 7.20672L5.1846 1.86439ZM4.98996 4.82056L4.24567 2.78971L3.50138 4.82056H4.98996Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, bn = re(function(t, e) {
|
|
65
65
|
return ie(ae, Object.assign({}, t, {
|
|
66
66
|
id: "ascending-icon",
|
|
67
67
|
ref: e,
|
|
68
|
-
icon:
|
|
68
|
+
icon: Qr
|
|
69
69
|
}));
|
|
70
70
|
});
|
|
71
|
-
|
|
72
|
-
var
|
|
71
|
+
bn.displayName = "AscendingIcon";
|
|
72
|
+
var Gr = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.3313 1.4667C5.3313 1.13533 5.59993 0.866699 5.9313 0.866699H10.069C10.4004 0.866699 10.669 1.13533 10.669 1.4667C10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.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.64443C14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928L9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171C10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778L9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539C9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263L6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539C5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778L6.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" } }] }, mn = re(function(t, e) {
|
|
73
73
|
return ie(ae, Object.assign({}, t, {
|
|
74
74
|
id: "delete-icon",
|
|
75
75
|
ref: e,
|
|
76
|
-
icon:
|
|
76
|
+
icon: Gr
|
|
77
77
|
}));
|
|
78
78
|
});
|
|
79
|
-
|
|
80
|
-
var
|
|
79
|
+
mn.displayName = "DeleteIcon";
|
|
80
|
+
var Xr = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "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.67983C1.38967 9.34846 1.6583 9.07983 1.98967 9.07983H6.50138C6.74406 9.07983 6.96284 9.22602 7.05571 9.45022C7.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.1916C7.10138 14.5229 6.83276 14.7916 6.50138 14.7916H1.98967C1.74699 14.7916 1.52821 14.6454 1.43534 14.4212C1.34247 14.197 1.3938 13.9389 1.5654 13.7673L5.05286 10.2798H1.98967Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M5.1846 1.86439C4.8641 0.989866 3.62725 0.989866 3.30674 1.86439L1.34882 7.20672C1.23479 7.51786 1.39458 7.86252 1.70571 7.97655C2.01684 8.09058 2.3615 7.93079 2.47553 7.61966L3.06159 6.02055L3.06338 6.02056H5.42975L6.01581 7.61966C6.12984 7.93079 6.4745 8.09058 6.78563 7.97655C7.09677 7.86252 7.25655 7.51786 7.14252 7.20672L5.1846 1.86439ZM4.98996 4.82056L4.24567 2.78971L3.50138 4.82056H4.98996Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, pn = re(function(t, e) {
|
|
81
81
|
return ie(ae, Object.assign({}, t, {
|
|
82
82
|
id: "descending-icon",
|
|
83
83
|
ref: e,
|
|
84
|
-
icon:
|
|
84
|
+
icon: Xr
|
|
85
85
|
}));
|
|
86
86
|
});
|
|
87
|
-
|
|
88
|
-
var
|
|
87
|
+
pn.displayName = "DescendingIcon";
|
|
88
|
+
var zr = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.85869 12.9216C8.38445 13.4708 7.61555 13.4708 7.14131 12.9216L0.358114 5.06726C-0.406895 4.18144 0.134916 2.66683 1.2168 2.66683L14.7832 2.66683C15.8651 2.66683 16.4069 4.18144 15.6419 5.06726L8.85869 12.9216Z" } }] }, je = re(function(t, e) {
|
|
89
89
|
return ie(ae, Object.assign({}, t, {
|
|
90
90
|
id: "dropdown-icon",
|
|
91
91
|
ref: e,
|
|
92
|
-
icon:
|
|
92
|
+
icon: zr
|
|
93
93
|
}));
|
|
94
94
|
});
|
|
95
|
-
|
|
96
|
-
var
|
|
95
|
+
je.displayName = "DropdownIcon";
|
|
96
|
+
var Kr = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "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" } }] }, fn = re(function(t, e) {
|
|
97
97
|
return ie(ae, Object.assign({}, t, {
|
|
98
98
|
id: "grid-outline-icon",
|
|
99
99
|
ref: e,
|
|
100
|
-
icon:
|
|
100
|
+
icon: Kr
|
|
101
101
|
}));
|
|
102
102
|
});
|
|
103
|
-
|
|
104
|
-
var
|
|
103
|
+
fn.displayName = "GridOutlineIcon";
|
|
104
|
+
var Jr = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "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" } }] }, Mt = re(function(t, e) {
|
|
105
105
|
return ie(ae, Object.assign({}, t, {
|
|
106
106
|
id: "more-down-icon",
|
|
107
107
|
ref: e,
|
|
108
|
-
icon:
|
|
108
|
+
icon: Jr
|
|
109
109
|
}));
|
|
110
110
|
});
|
|
111
|
-
|
|
112
|
-
var
|
|
111
|
+
Mt.displayName = "MoreDownIcon";
|
|
112
|
+
var ei = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "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" } }] }, Cn = re(function(t, e) {
|
|
113
113
|
return ie(ae, Object.assign({}, t, {
|
|
114
114
|
id: "paint-bucket-double-icon",
|
|
115
115
|
ref: e,
|
|
116
|
-
icon:
|
|
116
|
+
icon: ei
|
|
117
117
|
}));
|
|
118
118
|
});
|
|
119
|
-
|
|
120
|
-
var
|
|
119
|
+
Cn.displayName = "PaintBucketDoubleIcon";
|
|
120
|
+
var ti = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "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" } }] }, Sn = re(function(t, e) {
|
|
121
121
|
return ie(ae, Object.assign({}, t, {
|
|
122
122
|
id: "rename-icon",
|
|
123
123
|
ref: e,
|
|
124
|
-
icon:
|
|
124
|
+
icon: ti
|
|
125
125
|
}));
|
|
126
126
|
});
|
|
127
|
-
|
|
128
|
-
var
|
|
127
|
+
Sn.displayName = "RenameIcon";
|
|
128
|
+
var ni = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "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" } }] }, _n = re(function(t, e) {
|
|
129
129
|
return ie(ae, Object.assign({}, t, {
|
|
130
130
|
id: "table-icon",
|
|
131
131
|
ref: e,
|
|
132
|
-
icon:
|
|
132
|
+
icon: ni
|
|
133
133
|
}));
|
|
134
134
|
});
|
|
135
|
-
|
|
136
|
-
var
|
|
137
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
135
|
+
_n.displayName = "TableIcon";
|
|
136
|
+
var me = /* @__PURE__ */ ((t) => (t.Items = "items", t.Condition = "condition", t))(me || {}), ri = Object.getOwnPropertyDescriptor, ii = (t, e, n, r) => {
|
|
137
|
+
for (var i = r > 1 ? void 0 : r ? ri(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
|
-
},
|
|
141
|
-
let
|
|
140
|
+
}, Ke = (t, e) => (n, r) => e(n, r, t);
|
|
141
|
+
let Le = class extends Oe {
|
|
142
142
|
constructor(e, n, r, i) {
|
|
143
143
|
super();
|
|
144
144
|
A(this, "_itemsCache", /* @__PURE__ */ new Map());
|
|
@@ -146,21 +146,21 @@ let $e = class extends Pe {
|
|
|
146
146
|
}
|
|
147
147
|
_registerTableFilterChangeEvent() {
|
|
148
148
|
this._commandService.onCommandExecuted((e) => {
|
|
149
|
-
if (e.id ===
|
|
149
|
+
if (e.id === Lr.id) {
|
|
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 =
|
|
155
|
-
const
|
|
156
|
-
return
|
|
153
|
+
new $n(i).forValue((c, d, h) => {
|
|
154
|
+
const u = jt(c, d), v = a.find((S) => {
|
|
155
|
+
const C = S.getTableFilterRange();
|
|
156
|
+
return be.intersects(C, u);
|
|
157
157
|
});
|
|
158
|
-
if (
|
|
159
|
-
const
|
|
160
|
-
this._itemsCache.delete(
|
|
158
|
+
if (v) {
|
|
159
|
+
const S = d - v.getRange().startColumn;
|
|
160
|
+
this._itemsCache.delete(v.getId() + S);
|
|
161
161
|
}
|
|
162
162
|
});
|
|
163
|
-
} else if (e.id ===
|
|
163
|
+
} else if (e.id === Lt.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 $e = class extends Pe {
|
|
|
179
179
|
unitId: e,
|
|
180
180
|
subUnitId: n,
|
|
181
181
|
tableFilter: c,
|
|
182
|
-
currentFilterBy:
|
|
182
|
+
currentFilterBy: qn(c) ? me.Condition : me.Items,
|
|
183
183
|
tableId: r,
|
|
184
184
|
columnIndex: i - s.startColumn
|
|
185
185
|
};
|
|
@@ -188,7 +188,7 @@ let $e = class extends Pe {
|
|
|
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 && Yn(s) && a.push(...s.values);
|
|
192
192
|
}
|
|
193
193
|
return a;
|
|
194
194
|
}
|
|
@@ -201,46 +201,46 @@ let $e = class extends Pe {
|
|
|
201
201
|
column: r,
|
|
202
202
|
tableFilter: i
|
|
203
203
|
};
|
|
204
|
-
this._commandService.executeCommand(
|
|
204
|
+
this._commandService.executeCommand(Lt.id, s);
|
|
205
205
|
}
|
|
206
206
|
getTableFilterItems(e, n, r, i) {
|
|
207
|
-
var
|
|
207
|
+
var O;
|
|
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,
|
|
214
|
-
if (!
|
|
213
|
+
const s = a.getTableFilterRange(), { startRow: c, endRow: d, startColumn: h } = s, u = h + i, v = (O = this._univerInstanceService.getUnit(e)) == null ? void 0 : O.getSheetBySheetId(n);
|
|
214
|
+
if (!v)
|
|
215
215
|
return { data: [], itemsCountMap: /* @__PURE__ */ new Map(), allItemsCount: 0 };
|
|
216
|
-
const
|
|
217
|
-
let
|
|
216
|
+
const S = [], C = /* @__PURE__ */ new Map();
|
|
217
|
+
let _ = 0;
|
|
218
218
|
for (let f = c; f <= d; f++) {
|
|
219
|
-
if (
|
|
219
|
+
if (v.isRowFiltered(f))
|
|
220
220
|
continue;
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
title:
|
|
221
|
+
const R = this._sheetTableService.getCellValueWithConditionType(v, f, u);
|
|
222
|
+
C.has(R) || S.push({
|
|
223
|
+
title: R,
|
|
224
224
|
key: `${u}_${f}`,
|
|
225
225
|
leaf: !0
|
|
226
|
-
}),
|
|
226
|
+
}), _++, C.set(R, (C.get(R) || 0) + 1);
|
|
227
227
|
}
|
|
228
|
-
return this._itemsCache.set(r + i, { data:
|
|
228
|
+
return this._itemsCache.set(r + i, { data: S, itemsCountMap: C, allItemsCount: _ }), { data: S, itemsCountMap: C, allItemsCount: _ };
|
|
229
229
|
}
|
|
230
230
|
};
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
],
|
|
231
|
+
Le = ii([
|
|
232
|
+
Ke(0, N(ne)),
|
|
233
|
+
Ke(1, N(Zn)),
|
|
234
|
+
Ke(2, N(pe)),
|
|
235
|
+
Ke(3, le)
|
|
236
|
+
], Le);
|
|
237
237
|
var Z = /* @__PURE__ */ ((t) => (t.DatePicker = "DatePicker", t.DateRange = "DateRange", t.Input = "Input", t.Inputs = "Inputs", t.Select = "Select", t.None = "None", t))(Z || {});
|
|
238
|
-
function
|
|
238
|
+
function ai(t) {
|
|
239
239
|
const n = t.get(oe).t;
|
|
240
240
|
return [
|
|
241
241
|
{
|
|
242
|
-
value:
|
|
243
|
-
label: n(`sheets-table.condition.${
|
|
242
|
+
value: F.String,
|
|
243
|
+
label: n(`sheets-table.condition.${F.String}`),
|
|
244
244
|
children: [
|
|
245
245
|
{
|
|
246
246
|
value: j.Equal,
|
|
@@ -269,8 +269,8 @@ function si(t) {
|
|
|
269
269
|
]
|
|
270
270
|
},
|
|
271
271
|
{
|
|
272
|
-
value:
|
|
273
|
-
label: n(`sheets-table.condition.${
|
|
272
|
+
value: F.Number,
|
|
273
|
+
label: n(`sheets-table.condition.${F.Number}`),
|
|
274
274
|
children: [
|
|
275
275
|
{
|
|
276
276
|
value: $.Equal,
|
|
@@ -319,8 +319,8 @@ function si(t) {
|
|
|
319
319
|
]
|
|
320
320
|
},
|
|
321
321
|
{
|
|
322
|
-
value:
|
|
323
|
-
label: n(`sheets-table.condition.${
|
|
322
|
+
value: F.Date,
|
|
323
|
+
label: n(`sheets-table.condition.${F.Date}`),
|
|
324
324
|
children: [
|
|
325
325
|
{
|
|
326
326
|
value: l.Equal,
|
|
@@ -414,7 +414,7 @@ function si(t) {
|
|
|
414
414
|
}
|
|
415
415
|
];
|
|
416
416
|
}
|
|
417
|
-
function
|
|
417
|
+
function si(t, e) {
|
|
418
418
|
if (!e)
|
|
419
419
|
return [];
|
|
420
420
|
const r = t.get(oe).t;
|
|
@@ -493,7 +493,7 @@ function li(t, e) {
|
|
|
493
493
|
return [];
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
|
-
const
|
|
496
|
+
const xt = /* @__PURE__ */ new Set([
|
|
497
497
|
l.Equal,
|
|
498
498
|
l.NotEqual,
|
|
499
499
|
l.After,
|
|
@@ -501,96 +501,120 @@ const Nt = /* @__PURE__ */ new Set([
|
|
|
501
501
|
l.Before,
|
|
502
502
|
l.BeforeOrEqual
|
|
503
503
|
]);
|
|
504
|
-
function
|
|
505
|
-
return e ? t ===
|
|
504
|
+
function li(t, e) {
|
|
505
|
+
return e ? t === F.String ? Z.Input : t === F.Number ? e === $.Between || e === $.NotBetween ? Z.Inputs : Z.Input : t === F.Date ? e === l.Between || e === l.NotBetween ? Z.DateRange : e === l.Quarter || e === l.Month ? Z.Select : xt.has(e) ? Z.DatePicker : Z.None : Z.None : Z.None;
|
|
506
506
|
}
|
|
507
|
-
function
|
|
507
|
+
function oi(t) {
|
|
508
508
|
if (!t || t.filterType !== "condition")
|
|
509
509
|
return {
|
|
510
|
-
type:
|
|
510
|
+
type: F.String,
|
|
511
511
|
compareType: j.Equal,
|
|
512
512
|
info: {}
|
|
513
513
|
};
|
|
514
514
|
const e = t.filterInfo, { conditionType: n, compareType: r } = e;
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
515
|
+
if (n === F.Date)
|
|
516
|
+
if (r === l.Between || r === l.NotBetween) {
|
|
517
|
+
let i;
|
|
518
|
+
return Array.isArray(e.expectedValue) && (i = e.expectedValue.map((a) => typeof a == "string" ? new Date(a) : a)), {
|
|
519
|
+
type: n,
|
|
520
|
+
compare: r,
|
|
521
|
+
info: {
|
|
522
|
+
dateRange: i
|
|
523
|
+
}
|
|
524
|
+
};
|
|
525
|
+
} else {
|
|
526
|
+
if (r === l.Today || r === l.Yesterday || r === l.Tomorrow || r === l.ThisWeek || r === l.LastWeek || r === l.NextWeek || r === l.ThisMonth || r === l.LastMonth || r === l.NextMonth || r === l.ThisYear || r === l.LastYear || r === l.NextYear)
|
|
527
|
+
return {
|
|
528
|
+
type: n,
|
|
529
|
+
compare: r,
|
|
530
|
+
info: {}
|
|
531
|
+
};
|
|
532
|
+
if (xt.has(r)) {
|
|
533
|
+
let i;
|
|
534
|
+
if (typeof e.expectedValue == "string")
|
|
535
|
+
i = new Date(e.expectedValue);
|
|
536
|
+
else if (Array.isArray(e.expectedValue))
|
|
537
|
+
for (let a = 0; a < e.expectedValue.length; a++)
|
|
538
|
+
typeof e.expectedValue[a] == "string" && (e.expectedValue[a] = new Date(e.expectedValue[a]));
|
|
539
|
+
return {
|
|
540
|
+
type: n,
|
|
541
|
+
compare: r,
|
|
542
|
+
info: {
|
|
543
|
+
date: i
|
|
544
|
+
}
|
|
545
|
+
};
|
|
546
|
+
} else
|
|
547
|
+
return (/* @__PURE__ */ new Set([l.Q1, l.Q2, l.Q3, l.Q4])).has(r) ? {
|
|
548
|
+
type: n,
|
|
549
|
+
compare: l.Quarter,
|
|
550
|
+
info: {
|
|
551
|
+
dateSelect: e.compareType
|
|
552
|
+
}
|
|
553
|
+
} : {
|
|
554
|
+
type: n,
|
|
555
|
+
compare: l.Month,
|
|
556
|
+
info: {
|
|
557
|
+
dateSelect: e.compareType
|
|
558
|
+
}
|
|
559
|
+
};
|
|
560
560
|
}
|
|
561
|
-
|
|
562
|
-
|
|
561
|
+
else {
|
|
562
|
+
if (n === F.Number)
|
|
563
|
+
return r === $.Between || r === $.NotBetween ? {
|
|
564
|
+
type: n,
|
|
565
|
+
compare: r,
|
|
566
|
+
info: {
|
|
567
|
+
numberRange: e.expectedValue
|
|
568
|
+
}
|
|
569
|
+
} : {
|
|
570
|
+
type: n,
|
|
571
|
+
compare: r,
|
|
572
|
+
info: {
|
|
573
|
+
number: e.expectedValue
|
|
574
|
+
}
|
|
575
|
+
};
|
|
576
|
+
if (n === F.String)
|
|
577
|
+
return {
|
|
578
|
+
type: n,
|
|
579
|
+
compare: r,
|
|
580
|
+
info: {
|
|
581
|
+
string: e.expectedValue
|
|
582
|
+
}
|
|
583
|
+
};
|
|
584
|
+
}
|
|
585
|
+
return {
|
|
586
|
+
type: F.String,
|
|
563
587
|
compare: j.Equal,
|
|
564
588
|
info: {}
|
|
565
589
|
};
|
|
566
590
|
}
|
|
567
|
-
const
|
|
568
|
-
var
|
|
569
|
-
const { conditionInfo: e, onChange: n } = t, r = M(oe), [i, a] = q(!1), s = M(
|
|
591
|
+
const ci = (t) => {
|
|
592
|
+
var C, _, O, f, E, R, D, I;
|
|
593
|
+
const { conditionInfo: e, onChange: n } = t, r = M(oe), [i, a] = q(!1), s = M(ke), c = ai(s), d = (g, x, y) => {
|
|
570
594
|
n({
|
|
571
|
-
type:
|
|
572
|
-
compare:
|
|
573
|
-
info:
|
|
595
|
+
type: x != null ? x : e.type,
|
|
596
|
+
compare: y != null ? y : e.compare,
|
|
597
|
+
info: g
|
|
574
598
|
});
|
|
575
|
-
}, h = (
|
|
576
|
-
var
|
|
577
|
-
const
|
|
578
|
-
|
|
579
|
-
const
|
|
580
|
-
|
|
581
|
-
}, u =
|
|
582
|
-
let
|
|
583
|
-
e.compare ?
|
|
584
|
-
const
|
|
585
|
-
return /* @__PURE__ */
|
|
599
|
+
}, h = (g) => {
|
|
600
|
+
var B;
|
|
601
|
+
const x = g[0], y = g[1];
|
|
602
|
+
y && a(!1);
|
|
603
|
+
const m = {};
|
|
604
|
+
x === F.Date ? y === l.Quarter ? m.dateSelect = l.Q1 : y === l.Month ? m.dateSelect = l.M1 : xt.has(y) ? m.date = /* @__PURE__ */ new Date() : m.dateRange = [/* @__PURE__ */ new Date(), /* @__PURE__ */ new Date()] : x === F.Number ? m.number = 0 : x === F.String && (m.string = ""), d(m, g[0], (B = g[1]) != null ? B : j.Equal);
|
|
605
|
+
}, u = li(e.type, e.compare);
|
|
606
|
+
let v = "";
|
|
607
|
+
e.compare ? v = `${r.t(`sheets-table.condition.${e.type}`)} - ${r.t(`sheets-table.${e.type}.compare.${e.compare}`)}` : v = r.t(`sheets-table.condition.${e.type}`);
|
|
608
|
+
const S = si(s, e.compare);
|
|
609
|
+
return /* @__PURE__ */ w("div", { children: [
|
|
586
610
|
/* @__PURE__ */ o(
|
|
587
|
-
|
|
611
|
+
Ee,
|
|
588
612
|
{
|
|
589
613
|
align: "start",
|
|
590
614
|
open: i,
|
|
591
615
|
onOpenChange: a,
|
|
592
616
|
overlay: /* @__PURE__ */ o(
|
|
593
|
-
|
|
617
|
+
Ir,
|
|
594
618
|
{
|
|
595
619
|
value: [e.type, e.compare],
|
|
596
620
|
options: c,
|
|
@@ -599,168 +623,162 @@ const ui = (t) => {
|
|
|
599
623
|
wrapperClassName: "!univer-h-[150px]"
|
|
600
624
|
}
|
|
601
625
|
),
|
|
602
|
-
children: /* @__PURE__ */
|
|
626
|
+
children: /* @__PURE__ */ w(
|
|
603
627
|
"div",
|
|
604
628
|
{
|
|
605
|
-
className:
|
|
629
|
+
className: P("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 hover:univer-border-primary-600 focus:univer-border-primary-600 focus:univer-outline-none focus:univer-ring-2 dark:!univer-bg-gray-700 dark:!univer-text-white", H),
|
|
606
630
|
children: [
|
|
607
|
-
/* @__PURE__ */ o("span", { children:
|
|
608
|
-
/* @__PURE__ */ o(
|
|
631
|
+
/* @__PURE__ */ o("span", { children: v }),
|
|
632
|
+
/* @__PURE__ */ o(Mt, {})
|
|
609
633
|
]
|
|
610
634
|
}
|
|
611
635
|
)
|
|
612
636
|
}
|
|
613
637
|
),
|
|
614
|
-
/* @__PURE__ */
|
|
615
|
-
u === Z.Input && /* @__PURE__ */ o(
|
|
616
|
-
|
|
638
|
+
/* @__PURE__ */ w("div", { className: "univer-mt-3 univer-w-full", children: [
|
|
639
|
+
u === Z.Input && /* @__PURE__ */ o(yt, { children: e.type === F.String ? /* @__PURE__ */ o(
|
|
640
|
+
Rt,
|
|
617
641
|
{
|
|
618
642
|
className: "univer-w-full",
|
|
619
643
|
placeholder: "请输入",
|
|
620
644
|
value: e.info.string,
|
|
621
|
-
onChange: (
|
|
645
|
+
onChange: (g) => d({ string: g })
|
|
622
646
|
}
|
|
623
647
|
) : /* @__PURE__ */ o(
|
|
624
|
-
|
|
648
|
+
gt,
|
|
625
649
|
{
|
|
626
650
|
className: "univer-h-7 univer-w-full",
|
|
627
651
|
value: e.info.number,
|
|
628
652
|
controls: !1,
|
|
629
|
-
onChange: (
|
|
630
|
-
|
|
653
|
+
onChange: (g) => {
|
|
654
|
+
g !== null && d({ number: g });
|
|
631
655
|
}
|
|
632
656
|
}
|
|
633
657
|
) }),
|
|
634
658
|
u === Z.DatePicker && /* @__PURE__ */ o("div", { id: "univer-table-date-picker-wrapper", children: /* @__PURE__ */ o(
|
|
635
|
-
|
|
659
|
+
yr,
|
|
636
660
|
{
|
|
637
|
-
value: de(e.info.date),
|
|
638
|
-
defaultPickerValue: de(),
|
|
639
|
-
onChange: (v) => d({ date: v.toDate() }),
|
|
640
|
-
getPopupContainer: () => document.getElementById("univer-table-date-picker-wrapper") || document.body,
|
|
641
661
|
className: "univer-w-full",
|
|
642
|
-
|
|
662
|
+
value: (C = e.info.date) != null ? C : /* @__PURE__ */ new Date(),
|
|
663
|
+
onValueChange: (g) => d({ date: g })
|
|
643
664
|
}
|
|
644
665
|
) }),
|
|
645
666
|
u === Z.DateRange && /* @__PURE__ */ o("div", { id: "univer-table-date-range-wrapper", children: /* @__PURE__ */ o(
|
|
646
|
-
|
|
667
|
+
Rr,
|
|
647
668
|
{
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
d(
|
|
652
|
-
}
|
|
653
|
-
getPopupContainer: () => document.getElementById("univer-table-date-range-wrapper") || document.body,
|
|
654
|
-
classNames: { popup: "univer-w-[400px]" },
|
|
655
|
-
allowClear: !1
|
|
669
|
+
className: "univer-w-full",
|
|
670
|
+
value: [(O = (_ = e.info.dateRange) == null ? void 0 : _[0]) != null ? O : /* @__PURE__ */ new Date(), (E = (f = e.info.dateRange) == null ? void 0 : f[1]) != null ? E : /* @__PURE__ */ new Date()],
|
|
671
|
+
onValueChange: (g) => {
|
|
672
|
+
d(g ? { dateRange: g } : {});
|
|
673
|
+
}
|
|
656
674
|
}
|
|
657
675
|
) }),
|
|
658
|
-
u === Z.Inputs && /* @__PURE__ */
|
|
676
|
+
u === Z.Inputs && /* @__PURE__ */ w("div", { className: "univer-flex univer-items-center univer-gap-2", children: [
|
|
659
677
|
/* @__PURE__ */ o(
|
|
660
|
-
|
|
678
|
+
gt,
|
|
661
679
|
{
|
|
662
680
|
className: "univer-w-full",
|
|
663
|
-
value: (
|
|
664
|
-
onChange: (
|
|
665
|
-
var
|
|
666
|
-
|
|
681
|
+
value: (R = e.info.numberRange) == null ? void 0 : R[0],
|
|
682
|
+
onChange: (g) => {
|
|
683
|
+
var x;
|
|
684
|
+
g !== null && d({ numberRange: [g, (x = e.info.numberRange) == null ? void 0 : x[1]] });
|
|
667
685
|
},
|
|
668
686
|
controls: !1
|
|
669
687
|
}
|
|
670
688
|
),
|
|
671
689
|
/* @__PURE__ */ o("span", { children: " - " }),
|
|
672
690
|
/* @__PURE__ */ o(
|
|
673
|
-
|
|
691
|
+
gt,
|
|
674
692
|
{
|
|
675
693
|
className: "univer-w-full",
|
|
676
|
-
value: (
|
|
694
|
+
value: (D = e.info.numberRange) == null ? void 0 : D[1],
|
|
677
695
|
controls: !1,
|
|
678
|
-
onChange: (
|
|
679
|
-
var
|
|
680
|
-
|
|
696
|
+
onChange: (g) => {
|
|
697
|
+
var x;
|
|
698
|
+
g !== null && d({ numberRange: [(x = e.info.numberRange) == null ? void 0 : x[0], g] });
|
|
681
699
|
}
|
|
682
700
|
}
|
|
683
701
|
)
|
|
684
702
|
] }),
|
|
685
703
|
u === Z.Select && /* @__PURE__ */ o(
|
|
686
|
-
|
|
704
|
+
Mr,
|
|
687
705
|
{
|
|
688
706
|
className: "univer-w-full",
|
|
689
|
-
value: (
|
|
690
|
-
options:
|
|
691
|
-
onChange: (
|
|
707
|
+
value: (I = e.info.dateSelect) != null ? I : S[0].value,
|
|
708
|
+
options: S,
|
|
709
|
+
onChange: (g) => d({ dateSelect: g })
|
|
692
710
|
}
|
|
693
711
|
)
|
|
694
712
|
] })
|
|
695
713
|
] });
|
|
696
|
-
},
|
|
714
|
+
}, ui = (t) => {
|
|
697
715
|
let e = 0;
|
|
698
716
|
return t.forEach((n) => {
|
|
699
717
|
e += n;
|
|
700
718
|
}), e;
|
|
701
719
|
};
|
|
702
|
-
function
|
|
703
|
-
const { unitId: e, tableId: n, subUnitId: r, columnIndex: i, checkedItemSet: a, setCheckedItemSet: s, tableFilter: c } = t, d = M(oe), h = M(
|
|
704
|
-
|
|
705
|
-
a.add(
|
|
706
|
-
}), s(new Set(a)),
|
|
707
|
-
}, [
|
|
708
|
-
|
|
709
|
-
a.add(
|
|
710
|
-
}), f(
|
|
711
|
-
}, []),
|
|
712
|
-
if (
|
|
713
|
-
|
|
714
|
-
const
|
|
715
|
-
for (const { title:
|
|
716
|
-
|
|
717
|
-
f(
|
|
720
|
+
function di(t) {
|
|
721
|
+
const { unitId: e, tableId: n, subUnitId: r, columnIndex: i, checkedItemSet: a, setCheckedItemSet: s, tableFilter: c } = t, d = M(oe), h = M(Le), { data: u, itemsCountMap: v, allItemsCount: S } = h.getTableFilterItems(e, r, n, i), [C, _] = q(c === void 0 ? !0 : a.size === v.size), [O, f] = q(C ? S : ui(v)), E = !C && a.size > 0, [R, D] = q(""), I = un(() => R ? u.filter((m) => String(m.title).toLowerCase().includes(R.toLowerCase())) : u, [R, u]), g = Ht(() => {
|
|
722
|
+
C ? (a.clear(), s(new Set(a)), _(!1)) : (I.forEach((m) => {
|
|
723
|
+
a.add(m.title);
|
|
724
|
+
}), s(new Set(a)), _(!0));
|
|
725
|
+
}, [C]), x = Ht((m) => {
|
|
726
|
+
m === "" ? (_(!0), u.forEach((B) => {
|
|
727
|
+
a.add(B.title);
|
|
728
|
+
}), f(S)) : (a.clear(), _(!1), f(0)), D(m);
|
|
729
|
+
}, []), y = (m) => {
|
|
730
|
+
if (C) {
|
|
731
|
+
_(!1);
|
|
732
|
+
const B = /* @__PURE__ */ new Set();
|
|
733
|
+
for (const { title: L } of u)
|
|
734
|
+
m !== L && B.add(L);
|
|
735
|
+
f(S - v.get(m)), s(B);
|
|
718
736
|
} else
|
|
719
|
-
a.has(
|
|
737
|
+
a.has(m) ? (a.delete(m), f(O - v.get(m))) : (a.add(m), f(O + v.get(m))), s(new Set(a));
|
|
720
738
|
};
|
|
721
|
-
return /* @__PURE__ */
|
|
722
|
-
/* @__PURE__ */ o(
|
|
739
|
+
return /* @__PURE__ */ w("div", { className: "univer-flex univer-h-full univer-flex-col", children: [
|
|
740
|
+
/* @__PURE__ */ o(Rt, { autoFocus: !0, value: R, placeholder: d.t("sheets-filter.panel.search-placeholder"), onChange: x }),
|
|
723
741
|
/* @__PURE__ */ o(
|
|
724
742
|
"div",
|
|
725
743
|
{
|
|
726
|
-
className:
|
|
744
|
+
className: P("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", H),
|
|
727
745
|
children: /* @__PURE__ */ o(
|
|
728
746
|
"div",
|
|
729
747
|
{
|
|
730
|
-
className:
|
|
731
|
-
children: /* @__PURE__ */
|
|
748
|
+
className: P("univer-h-40 univer-overflow-y-auto univer-py-1 univer-pl-2", xr),
|
|
749
|
+
children: /* @__PURE__ */ w("div", { className: "univer-h-full", children: [
|
|
732
750
|
/* @__PURE__ */ o("div", { className: "univer-flex univer-items-center univer-px-2 univer-py-1", children: /* @__PURE__ */ o(
|
|
733
|
-
|
|
751
|
+
Pt,
|
|
734
752
|
{
|
|
735
|
-
indeterminate:
|
|
753
|
+
indeterminate: E,
|
|
736
754
|
disabled: u.length === 0,
|
|
737
|
-
checked:
|
|
738
|
-
onChange:
|
|
739
|
-
children: /* @__PURE__ */
|
|
755
|
+
checked: C,
|
|
756
|
+
onChange: g,
|
|
757
|
+
children: /* @__PURE__ */ w("div", { className: "univer-flex univer-h-5 univer-flex-1 univer-items-center univer-text-sm", children: [
|
|
740
758
|
/* @__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: `(${
|
|
759
|
+
/* @__PURE__ */ o("span", { className: "univer-ml univer-text-gray-400", children: `(${O}/${R ? I.length : S})` })
|
|
742
760
|
] })
|
|
743
761
|
}
|
|
744
762
|
) }),
|
|
745
|
-
|
|
763
|
+
I.map((m) => /* @__PURE__ */ o(
|
|
746
764
|
"div",
|
|
747
765
|
{
|
|
748
766
|
className: "univer-flex univer-items-center univer-px-2 univer-py-1",
|
|
749
767
|
children: /* @__PURE__ */ o(
|
|
750
|
-
|
|
768
|
+
Pt,
|
|
751
769
|
{
|
|
752
|
-
checked:
|
|
770
|
+
checked: C || a.has(m.title),
|
|
753
771
|
onChange: () => {
|
|
754
|
-
|
|
772
|
+
y(m.title);
|
|
755
773
|
},
|
|
756
|
-
children: /* @__PURE__ */
|
|
757
|
-
/* @__PURE__ */ o("span", { className: "univer-inline-block univer-truncate", children:
|
|
758
|
-
/* @__PURE__ */ o("span", { className: "univer-ml-1 univer-text-gray-400", children: `(${
|
|
774
|
+
children: /* @__PURE__ */ w("div", { className: "univer-flex univer-h-5 univer-flex-1 univer-text-sm", children: [
|
|
775
|
+
/* @__PURE__ */ o("span", { className: "univer-inline-block univer-truncate", children: m.title }),
|
|
776
|
+
/* @__PURE__ */ o("span", { className: "univer-ml-1 univer-text-gray-400", children: `(${v.get(m.title) || 0})` })
|
|
759
777
|
] })
|
|
760
778
|
}
|
|
761
779
|
)
|
|
762
780
|
},
|
|
763
|
-
|
|
781
|
+
m.key
|
|
764
782
|
))
|
|
765
783
|
] })
|
|
766
784
|
}
|
|
@@ -769,131 +787,131 @@ function hi(t) {
|
|
|
769
787
|
)
|
|
770
788
|
] });
|
|
771
789
|
}
|
|
772
|
-
function
|
|
790
|
+
function hi() {
|
|
773
791
|
var ue;
|
|
774
|
-
const t = M(oe), e =
|
|
792
|
+
const t = M(oe), e = vi(t), n = M(Le), r = M(ne), i = M(le), a = M(Zt), s = M($e), c = s.getCurrentTableFilterInfo(), d = n.getTableFilterPanelInitProps(c.unitId, c.subUnitId, c.tableId, c.column), { unitId: h, subUnitId: u, tableId: v, tableFilter: S, currentFilterBy: C, columnIndex: _ } = d, { data: O } = n.getTableFilterItems(h, u, v, _), f = n.getTableFilterCheckedItems(h, v, _), [E, R] = q(new Set(f)), [D, I] = q(C || me.Items), [g, x] = q(() => {
|
|
775
793
|
const b = d.tableFilter;
|
|
776
|
-
return
|
|
777
|
-
}),
|
|
778
|
-
if (!
|
|
779
|
-
const
|
|
780
|
-
|
|
781
|
-
const
|
|
794
|
+
return oi(b);
|
|
795
|
+
}), y = r.getTable(h, v);
|
|
796
|
+
if (!y) return null;
|
|
797
|
+
const m = y.getTableFilters(), B = m.getSortState();
|
|
798
|
+
B.columnIndex === _ && (B.sortState, Ge.Asc), B.columnIndex === _ && (B.sortState, Ge.Desc);
|
|
799
|
+
const L = () => {
|
|
782
800
|
s.closeFilterPanel();
|
|
783
801
|
}, Q = () => {
|
|
784
|
-
|
|
802
|
+
L();
|
|
785
803
|
}, U = (b) => {
|
|
786
|
-
const
|
|
787
|
-
i.executeCommand(
|
|
804
|
+
const k = y.getTableFilterRange();
|
|
805
|
+
i.executeCommand(Dr.id, {
|
|
788
806
|
unitId: h,
|
|
789
807
|
subUnitId: u,
|
|
790
|
-
range:
|
|
791
|
-
orderRules: [{ colIndex:
|
|
808
|
+
range: k,
|
|
809
|
+
orderRules: [{ colIndex: _ + k.startColumn, type: b ? Ft.ASC : Ft.DESC }],
|
|
792
810
|
hasTitle: !1
|
|
793
|
-
}),
|
|
811
|
+
}), m.setSortState(_, b ? Ge.Asc : Ge.Desc), L();
|
|
794
812
|
}, ee = () => {
|
|
795
|
-
if (D ===
|
|
813
|
+
if (D === me.Items) {
|
|
796
814
|
const b = [];
|
|
797
|
-
for (const Y of
|
|
798
|
-
|
|
799
|
-
const
|
|
800
|
-
if (
|
|
801
|
-
if (
|
|
802
|
-
|
|
815
|
+
for (const Y of O)
|
|
816
|
+
E.has(Y.title) && b.push(Y.title);
|
|
817
|
+
const k = y.getTableFilterColumn(_);
|
|
818
|
+
if (k) {
|
|
819
|
+
if (k.values.join(",") === b.join(",")) {
|
|
820
|
+
L();
|
|
803
821
|
return;
|
|
804
822
|
}
|
|
805
823
|
} else if (b.length === 0) {
|
|
806
|
-
|
|
824
|
+
L();
|
|
807
825
|
return;
|
|
808
826
|
}
|
|
809
827
|
const V = {
|
|
810
|
-
filterType:
|
|
828
|
+
filterType: $t.manual,
|
|
811
829
|
values: b
|
|
812
830
|
};
|
|
813
|
-
n.setTableFilter(h,
|
|
831
|
+
n.setTableFilter(h, v, _, V);
|
|
814
832
|
} else {
|
|
815
833
|
let b;
|
|
816
|
-
|
|
817
|
-
conditionType:
|
|
818
|
-
compareType: Object.values(
|
|
834
|
+
g.compare === l.Quarter || g.compare === l.Month ? b = {
|
|
835
|
+
conditionType: g.type,
|
|
836
|
+
compareType: Object.values(g.info)[0]
|
|
819
837
|
} : b = {
|
|
820
|
-
conditionType:
|
|
821
|
-
compareType:
|
|
822
|
-
expectedValue: Object.values(
|
|
838
|
+
conditionType: g.type,
|
|
839
|
+
compareType: g.compare,
|
|
840
|
+
expectedValue: Object.values(g.info)[0]
|
|
823
841
|
};
|
|
824
|
-
const
|
|
825
|
-
filterType:
|
|
842
|
+
const k = {
|
|
843
|
+
filterType: $t.condition,
|
|
826
844
|
// @ts-ignore
|
|
827
845
|
filterInfo: b
|
|
828
846
|
};
|
|
829
|
-
n.setTableFilter(h,
|
|
847
|
+
n.setTableFilter(h, v, _, k);
|
|
830
848
|
}
|
|
831
|
-
|
|
832
|
-
},
|
|
833
|
-
n.setTableFilter(h,
|
|
834
|
-
}, ce = new
|
|
835
|
-
return /* @__PURE__ */
|
|
849
|
+
L();
|
|
850
|
+
}, Re = () => {
|
|
851
|
+
n.setTableFilter(h, v, _, void 0), L();
|
|
852
|
+
}, ce = new an(h).id, fe = (ue = a.getPermissionPoint(ce)) == null ? void 0 : ue.value;
|
|
853
|
+
return /* @__PURE__ */ w(
|
|
836
854
|
"div",
|
|
837
855
|
{
|
|
838
856
|
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
857
|
children: [
|
|
840
|
-
|
|
841
|
-
/* @__PURE__ */
|
|
842
|
-
/* @__PURE__ */ o(
|
|
858
|
+
fe && /* @__PURE__ */ o("div", { className: "univer-mb-3 univer-flex", children: /* @__PURE__ */ w(Nr, { className: "univer-mb-3 !univer-flex univer-w-full", children: [
|
|
859
|
+
/* @__PURE__ */ w(_e, { className: "univer-w-1/2", onClick: () => U(!0), children: [
|
|
860
|
+
/* @__PURE__ */ o(bn, { className: "univer-mr-1" }),
|
|
843
861
|
t.t("sheets-sort.general.sort-asc")
|
|
844
862
|
] }),
|
|
845
|
-
/* @__PURE__ */
|
|
846
|
-
/* @__PURE__ */ o(
|
|
863
|
+
/* @__PURE__ */ w(_e, { className: "univer-w-1/2", onClick: () => U(!1), children: [
|
|
864
|
+
/* @__PURE__ */ o(pn, { className: "univer-mr-1" }),
|
|
847
865
|
t.t("sheets-sort.general.sort-desc")
|
|
848
866
|
] })
|
|
849
867
|
] }) }),
|
|
850
868
|
/* @__PURE__ */ o("div", { className: "univer-w-full", children: /* @__PURE__ */ o(
|
|
851
|
-
|
|
869
|
+
Er,
|
|
852
870
|
{
|
|
853
871
|
value: D,
|
|
854
872
|
items: e,
|
|
855
|
-
onChange: (b) =>
|
|
873
|
+
onChange: (b) => I(b)
|
|
856
874
|
}
|
|
857
875
|
) }),
|
|
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 ===
|
|
859
|
-
|
|
876
|
+
/* @__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 === me.Items ? /* @__PURE__ */ o(
|
|
877
|
+
di,
|
|
860
878
|
{
|
|
861
|
-
tableFilter:
|
|
879
|
+
tableFilter: S,
|
|
862
880
|
unitId: h,
|
|
863
881
|
subUnitId: u,
|
|
864
|
-
tableId:
|
|
865
|
-
columnIndex:
|
|
866
|
-
checkedItemSet:
|
|
867
|
-
setCheckedItemSet:
|
|
882
|
+
tableId: v,
|
|
883
|
+
columnIndex: _,
|
|
884
|
+
checkedItemSet: E,
|
|
885
|
+
setCheckedItemSet: R
|
|
868
886
|
}
|
|
869
887
|
) : /* @__PURE__ */ o(
|
|
870
|
-
|
|
888
|
+
ci,
|
|
871
889
|
{
|
|
872
|
-
tableFilter:
|
|
890
|
+
tableFilter: S,
|
|
873
891
|
unitId: h,
|
|
874
892
|
subUnitId: u,
|
|
875
|
-
tableId:
|
|
876
|
-
columnIndex:
|
|
877
|
-
conditionInfo:
|
|
878
|
-
onChange:
|
|
893
|
+
tableId: v,
|
|
894
|
+
columnIndex: _,
|
|
895
|
+
conditionInfo: g,
|
|
896
|
+
onChange: x
|
|
879
897
|
}
|
|
880
898
|
) }) }),
|
|
881
|
-
/* @__PURE__ */
|
|
899
|
+
/* @__PURE__ */ w(
|
|
882
900
|
"div",
|
|
883
901
|
{
|
|
884
902
|
className: "univer-flex-wrap-nowrap univer-mt-4 univer-inline-flex univer-flex-shrink-0 univer-flex-grow-0 univer-justify-between univer-overflow-hidden",
|
|
885
903
|
children: [
|
|
886
904
|
/* @__PURE__ */ o(
|
|
887
|
-
|
|
905
|
+
_e,
|
|
888
906
|
{
|
|
889
|
-
disabled:
|
|
890
|
-
onClick:
|
|
907
|
+
disabled: S === void 0,
|
|
908
|
+
onClick: Re,
|
|
891
909
|
children: t.t("sheets-filter.panel.clear-filter")
|
|
892
910
|
}
|
|
893
911
|
),
|
|
894
|
-
/* @__PURE__ */
|
|
895
|
-
/* @__PURE__ */ o(
|
|
896
|
-
/* @__PURE__ */ o(
|
|
912
|
+
/* @__PURE__ */ w("div", { children: [
|
|
913
|
+
/* @__PURE__ */ o(_e, { className: "univer-mr-2", onClick: Q, children: t.t("sheets-filter.panel.cancel") }),
|
|
914
|
+
/* @__PURE__ */ o(_e, { variant: "primary", onClick: ee, children: t.t("sheets-filter.panel.confirm") })
|
|
897
915
|
] })
|
|
898
916
|
]
|
|
899
917
|
}
|
|
@@ -902,19 +920,19 @@ function vi() {
|
|
|
902
920
|
}
|
|
903
921
|
);
|
|
904
922
|
}
|
|
905
|
-
function
|
|
923
|
+
function vi(t) {
|
|
906
924
|
const e = t.getCurrentLocale();
|
|
907
|
-
return
|
|
908
|
-
{ label: t.t("sheets-filter.panel.by-values"), value:
|
|
909
|
-
{ label: t.t("sheets-filter.panel.by-conditions"), value:
|
|
925
|
+
return un(() => [
|
|
926
|
+
{ label: t.t("sheets-filter.panel.by-values"), value: me.Items },
|
|
927
|
+
{ label: t.t("sheets-filter.panel.by-conditions"), value: me.Condition }
|
|
910
928
|
], [e, t]);
|
|
911
929
|
}
|
|
912
|
-
var
|
|
913
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
930
|
+
var gi = Object.getOwnPropertyDescriptor, bi = (t, e, n, r) => {
|
|
931
|
+
for (var i = r > 1 ? void 0 : r ? gi(e, n) : e, a = t.length - 1, s; a >= 0; a--)
|
|
914
932
|
(s = t[a]) && (i = s(i) || i);
|
|
915
933
|
return i;
|
|
916
|
-
},
|
|
917
|
-
let
|
|
934
|
+
}, Je = (t, e) => (n, r) => e(n, r, t);
|
|
935
|
+
let $e = class extends Oe {
|
|
918
936
|
constructor(e, n, r, i) {
|
|
919
937
|
super();
|
|
920
938
|
A(this, "_popupDisposable");
|
|
@@ -932,18 +950,18 @@ let ke = class extends Pe {
|
|
|
932
950
|
}
|
|
933
951
|
_initComponents() {
|
|
934
952
|
[
|
|
935
|
-
[
|
|
953
|
+
[ve, hi]
|
|
936
954
|
].forEach(([e, n]) => {
|
|
937
955
|
this.disposeWithMe(this._componentManager.register(e, n));
|
|
938
956
|
});
|
|
939
957
|
}
|
|
940
958
|
_initUIPopup() {
|
|
941
|
-
this.disposeWithMe(this._contextService.subscribeContextValue$(
|
|
959
|
+
this.disposeWithMe(this._contextService.subscribeContextValue$(ve).pipe(rn(void 0), fr()).subscribe((e) => {
|
|
942
960
|
e ? this._openFilterPopup() : e === !1 && this._closeFilterPopup();
|
|
943
961
|
}));
|
|
944
962
|
}
|
|
945
963
|
closeFilterPanel() {
|
|
946
|
-
this._contextService.setContextValue(
|
|
964
|
+
this._contextService.setContextValue(ve, !1);
|
|
947
965
|
}
|
|
948
966
|
_openFilterPopup() {
|
|
949
967
|
const e = this._currentTableFilterInfo;
|
|
@@ -951,10 +969,10 @@ let ke = class extends Pe {
|
|
|
951
969
|
throw new Error("[SheetsFilterUIController]: no filter model when opening filter popup!");
|
|
952
970
|
const { row: n, column: r } = e;
|
|
953
971
|
this._popupDisposable = this._sheetCanvasPopupService.attachPopupToCell(n, r, {
|
|
954
|
-
componentKey:
|
|
972
|
+
componentKey: ve,
|
|
955
973
|
direction: "horizontal",
|
|
956
974
|
onClickOutside: () => {
|
|
957
|
-
this._dialogService.close(
|
|
975
|
+
this._dialogService.close(Ar), this._contextService.setContextValue(ve, !1);
|
|
958
976
|
},
|
|
959
977
|
offset: [5, 0],
|
|
960
978
|
portal: !0
|
|
@@ -965,35 +983,35 @@ let ke = class extends Pe {
|
|
|
965
983
|
(e = this._popupDisposable) == null || e.dispose(), this._popupDisposable = null, this.clearCurrentTableFilterInfo();
|
|
966
984
|
}
|
|
967
985
|
};
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
],
|
|
974
|
-
const
|
|
975
|
-
type:
|
|
986
|
+
$e = bi([
|
|
987
|
+
Je(0, N(tn)),
|
|
988
|
+
Je(1, wt),
|
|
989
|
+
Je(2, N(tr)),
|
|
990
|
+
Je(3, N(nn))
|
|
991
|
+
], $e);
|
|
992
|
+
const Ct = {
|
|
993
|
+
type: qt.OPERATION,
|
|
976
994
|
id: "sheet.operation.open-table-filter-panel",
|
|
977
995
|
async handler(t, e) {
|
|
978
996
|
if (!e)
|
|
979
997
|
return !1;
|
|
980
|
-
const { row: n, col: r, unitId: i, subUnitId: a, tableId: s } = e, c = t.get(ne), d = t.get(
|
|
981
|
-
return c.getTable(i, s) ? (d.getContextValue(
|
|
998
|
+
const { row: n, col: r, unitId: i, subUnitId: a, tableId: s } = e, c = t.get(ne), d = t.get(wt), h = t.get($e);
|
|
999
|
+
return c.getTable(i, s) ? (d.getContextValue(ve) || (h.setCurrentTableFilterInfo({ unitId: i, subUnitId: a, row: n, tableId: s, column: r }), d.setContextValue(ve, !0)), !0) : !1;
|
|
982
1000
|
}
|
|
983
|
-
},
|
|
984
|
-
type:
|
|
1001
|
+
}, Nt = {
|
|
1002
|
+
type: qt.OPERATION,
|
|
985
1003
|
id: "sheet.operation.open-table-selector",
|
|
986
1004
|
async handler(t) {
|
|
987
|
-
var
|
|
988
|
-
const e = t.get(
|
|
1005
|
+
var C;
|
|
1006
|
+
const e = t.get(pe), n = t.get(le), r = ct(e);
|
|
989
1007
|
if (!r)
|
|
990
1008
|
return !1;
|
|
991
|
-
const { unitId: i, subUnitId: a, worksheet: s } = r, d = t.get(
|
|
992
|
-
return
|
|
1009
|
+
const { unitId: i, subUnitId: a, worksheet: s } = r, d = t.get(ut).getCurrentLastSelection(), h = (C = d == null ? void 0 : d.range) != null ? C : { startRow: 0, endRow: 0, startColumn: 0, endColumn: 0 }, v = $r(d) ? Or(h, { up: !0, left: !0, right: !0, down: !0 }, s) : h, S = await Tn(t, i, a, v);
|
|
1010
|
+
return S ? (n.executeCommand(Qn.id, { ...S }), !0) : !1;
|
|
993
1011
|
}
|
|
994
1012
|
};
|
|
995
|
-
async function
|
|
996
|
-
const a = t.get(
|
|
1013
|
+
async function Tn(t, e, n, r, i) {
|
|
1014
|
+
const a = t.get(nn), s = t.get(oe);
|
|
997
1015
|
return new Promise((c) => {
|
|
998
1016
|
const d = {
|
|
999
1017
|
unitId: e,
|
|
@@ -1001,14 +1019,14 @@ async function wn(t, e, n, r, i) {
|
|
|
1001
1019
|
range: r,
|
|
1002
1020
|
tableId: i,
|
|
1003
1021
|
onConfirm: (h) => {
|
|
1004
|
-
c(h), a.close(
|
|
1022
|
+
c(h), a.close(Ne);
|
|
1005
1023
|
},
|
|
1006
1024
|
onCancel: () => {
|
|
1007
|
-
c(null), a.close(
|
|
1025
|
+
c(null), a.close(Ne);
|
|
1008
1026
|
}
|
|
1009
1027
|
};
|
|
1010
1028
|
a.open({
|
|
1011
|
-
id:
|
|
1029
|
+
id: Ne,
|
|
1012
1030
|
title: { title: s.t("sheets-table.selectRange") },
|
|
1013
1031
|
draggable: !0,
|
|
1014
1032
|
destroyOnClose: !0,
|
|
@@ -1016,77 +1034,77 @@ async function wn(t, e, n, r, i) {
|
|
|
1016
1034
|
maskClosable: !1,
|
|
1017
1035
|
children: {
|
|
1018
1036
|
label: {
|
|
1019
|
-
name:
|
|
1037
|
+
name: Ne,
|
|
1020
1038
|
props: d
|
|
1021
1039
|
}
|
|
1022
1040
|
},
|
|
1023
1041
|
width: 300,
|
|
1024
1042
|
onClose: () => {
|
|
1025
|
-
c(null), a.close(
|
|
1043
|
+
c(null), a.close(Ne);
|
|
1026
1044
|
}
|
|
1027
1045
|
});
|
|
1028
1046
|
});
|
|
1029
1047
|
}
|
|
1030
|
-
const
|
|
1048
|
+
const wn = "sheets-table-ui.config", At = {
|
|
1031
1049
|
anchorHeight: 24,
|
|
1032
1050
|
anchorBackgroundColor: "rgb(134,139,156)"
|
|
1033
1051
|
};
|
|
1034
|
-
var
|
|
1035
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
1052
|
+
var mi = Object.getOwnPropertyDescriptor, pi = (t, e, n, r) => {
|
|
1053
|
+
for (var i = r > 1 ? void 0 : r ? mi(e, n) : e, a = t.length - 1, s; a >= 0; a--)
|
|
1036
1054
|
(s = t[a]) && (i = s(i) || i);
|
|
1037
1055
|
return i;
|
|
1038
|
-
},
|
|
1039
|
-
let
|
|
1056
|
+
}, fi = (t, e) => (n, r) => e(n, r, t);
|
|
1057
|
+
let Ie = class extends Oe {
|
|
1040
1058
|
constructor(e) {
|
|
1041
1059
|
super();
|
|
1042
|
-
A(this, "_refreshTable", new
|
|
1060
|
+
A(this, "_refreshTable", new Cr());
|
|
1043
1061
|
A(this, "refreshTable$", this._refreshTable.asObservable());
|
|
1044
1062
|
this._commandService = e, this._initListener();
|
|
1045
1063
|
}
|
|
1046
1064
|
_initListener() {
|
|
1047
1065
|
this.disposeWithMe(
|
|
1048
1066
|
this._commandService.onCommandExecuted((e) => {
|
|
1049
|
-
if (e.id ===
|
|
1067
|
+
if (e.id === sn.id) {
|
|
1050
1068
|
const n = e.params, { styleName: r } = n;
|
|
1051
|
-
r.startsWith(
|
|
1069
|
+
r.startsWith(Gn) && this._refreshTable.next(Math.random());
|
|
1052
1070
|
}
|
|
1053
1071
|
})
|
|
1054
1072
|
);
|
|
1055
1073
|
}
|
|
1056
1074
|
};
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
],
|
|
1060
|
-
const
|
|
1061
|
-
var
|
|
1062
|
-
const [t, e] = q(""), [n, r] = q(""), i = M(
|
|
1075
|
+
Ie = pi([
|
|
1076
|
+
fi(0, N(le))
|
|
1077
|
+
], Ie);
|
|
1078
|
+
const Ci = () => {
|
|
1079
|
+
var fe, ue;
|
|
1080
|
+
const [t, e] = q(""), [n, r] = q(""), i = M(cr), [a, s] = q({}), c = M(ke), d = M(it), h = Te(d.anchorPosition$), u = M(le), v = M(pe), S = M(ln), C = Te(S.unitPermissionInitStateChange$, !1), _ = M(ne), O = M(on), f = M(Ie), E = Te(f.refreshTable$), R = M(oe), D = M(ut), I = Te(D.selectionChanged$, [{ range: jt(0, 0), primary: null }]), [, g] = q(Math.random()), y = M(Yt).getConfig(wn), m = (fe = y == null ? void 0 : y.anchorHeight) != null ? fe : 24, B = (ue = y == null ? void 0 : y.anchorBackgroundColor) != null ? ue : "rgb(53,91,183)", L = (b, k) => {
|
|
1063
1081
|
s((V) => ({
|
|
1064
1082
|
...V,
|
|
1065
|
-
[b]:
|
|
1083
|
+
[b]: k
|
|
1066
1084
|
}));
|
|
1067
1085
|
};
|
|
1068
|
-
if (
|
|
1069
|
-
|
|
1070
|
-
}, [
|
|
1086
|
+
if (dn(() => {
|
|
1087
|
+
g(Math.random());
|
|
1088
|
+
}, [E]), !(h != null && h.length))
|
|
1071
1089
|
return null;
|
|
1072
|
-
const Q =
|
|
1090
|
+
const Q = ct(v);
|
|
1073
1091
|
if (!Q) return null;
|
|
1074
|
-
const { unitId: U, subUnitId: ee } = Q,
|
|
1092
|
+
const { unitId: U, subUnitId: ee } = Q, Re = (b, k) => {
|
|
1075
1093
|
var Y;
|
|
1076
|
-
if (((Y =
|
|
1094
|
+
if (((Y = _.getTableById(U, b)) == null ? void 0 : Y.getDisplayName()) === k) {
|
|
1077
1095
|
e(""), r("");
|
|
1078
1096
|
return;
|
|
1079
1097
|
}
|
|
1080
|
-
u.executeCommand(
|
|
1098
|
+
u.executeCommand(ft.id, {
|
|
1081
1099
|
tableId: b,
|
|
1082
1100
|
unitId: U,
|
|
1083
|
-
name:
|
|
1101
|
+
name: k
|
|
1084
1102
|
}), r(""), e("");
|
|
1085
1103
|
}, ce = async (b) => {
|
|
1086
|
-
const
|
|
1087
|
-
if (!
|
|
1088
|
-
const V =
|
|
1089
|
-
Y && u.executeCommand(
|
|
1104
|
+
const k = _.getTableById(U, b);
|
|
1105
|
+
if (!k) return;
|
|
1106
|
+
const V = k.getRange(), Y = await Tn(c, U, ee, V, b);
|
|
1107
|
+
Y && u.executeCommand(ft.id, {
|
|
1090
1108
|
tableId: b,
|
|
1091
1109
|
unitId: U,
|
|
1092
1110
|
updateRange: {
|
|
@@ -1094,50 +1112,50 @@ const Si = () => {
|
|
|
1094
1112
|
}
|
|
1095
1113
|
});
|
|
1096
1114
|
};
|
|
1097
|
-
return
|
|
1098
|
-
var
|
|
1099
|
-
const
|
|
1100
|
-
if (!
|
|
1101
|
-
const V =
|
|
1102
|
-
if (!(
|
|
1115
|
+
return C ? /* @__PURE__ */ o("div", { className: "univer-absolute univer-z-50 univer-h-0 univer-w-0", children: h.map((b) => {
|
|
1116
|
+
var De, Be, p, T, z, K, se;
|
|
1117
|
+
const k = _.getTableById(U, b.tableId);
|
|
1118
|
+
if (!k) return null;
|
|
1119
|
+
const V = O.getRangeThemeStyle(U, k.getTableStyleId()), Y = (p = (Be = (De = V == null ? void 0 : V.getHeaderRowStyle()) == null ? void 0 : De.bg) == null ? void 0 : Be.rgb) != null ? p : B, qe = (K = (z = (T = V == null ? void 0 : V.getHeaderRowStyle()) == null ? void 0 : T.cl) == null ? void 0 : z.rgb) != null ? K : "rgb(255, 255, 255)", Ye = k.getRange();
|
|
1120
|
+
if (!(I != null && I.length))
|
|
1103
1121
|
return null;
|
|
1104
|
-
const
|
|
1105
|
-
return /* @__PURE__ */
|
|
1122
|
+
const Qe = I[I.length - 1].range, Pe = !be.intersects(Ye, Qe) && b.y <= 20;
|
|
1123
|
+
return /* @__PURE__ */ w(
|
|
1106
1124
|
"div",
|
|
1107
1125
|
{
|
|
1108
|
-
className:
|
|
1109
|
-
"univer-flex": !
|
|
1110
|
-
"univer-hidden":
|
|
1126
|
+
className: P("univer-shadow-xs univer-absolute univer-box-border univer-cursor-pointer univer-items-center univer-rounded-xl univer-pl-2 univer-pr-2", H, {
|
|
1127
|
+
"univer-flex": !Pe,
|
|
1128
|
+
"univer-hidden": Pe
|
|
1111
1129
|
}),
|
|
1112
1130
|
style: {
|
|
1113
1131
|
left: b.x,
|
|
1114
1132
|
top: Math.max(b.y, 0),
|
|
1115
1133
|
backgroundColor: Y,
|
|
1116
|
-
color:
|
|
1134
|
+
color: qe,
|
|
1117
1135
|
borderWidth: "0.5px",
|
|
1118
|
-
height:
|
|
1136
|
+
height: m ? `${m}px` : "24px"
|
|
1119
1137
|
},
|
|
1120
1138
|
children: [
|
|
1121
1139
|
/* @__PURE__ */ o("div", { className: "univer-text-nowrap", children: t === b.tableId ? /* @__PURE__ */ o(
|
|
1122
|
-
|
|
1140
|
+
Rt,
|
|
1123
1141
|
{
|
|
1124
1142
|
className: "univer-h-[18px] univer-min-w-16 univer-rounded-none",
|
|
1125
1143
|
inputClass: "univer-h-[18px] univer-w-[80px]",
|
|
1126
1144
|
value: n,
|
|
1127
1145
|
onChange: (W) => r(W),
|
|
1128
|
-
onBlur: () =>
|
|
1146
|
+
onBlur: () => Re(b.tableId, n),
|
|
1129
1147
|
onKeyDown: (W) => {
|
|
1130
|
-
W.key === "Enter" &&
|
|
1148
|
+
W.key === "Enter" && Re(b.tableId, n);
|
|
1131
1149
|
},
|
|
1132
1150
|
autoFocus: t === b.tableId
|
|
1133
1151
|
}
|
|
1134
1152
|
) : /* @__PURE__ */ o("div", { className: "univer-h-[18px] univer-max-w-24 univer-truncate univer-text-sm", children: b.tableName }) }),
|
|
1135
1153
|
/* @__PURE__ */ o(
|
|
1136
|
-
|
|
1154
|
+
Ee,
|
|
1137
1155
|
{
|
|
1138
1156
|
align: "start",
|
|
1139
|
-
overlay: /* @__PURE__ */
|
|
1140
|
-
/* @__PURE__ */
|
|
1157
|
+
overlay: /* @__PURE__ */ w("div", { className: "univer-pb-2 univer-pt-2", children: [
|
|
1158
|
+
/* @__PURE__ */ w(
|
|
1141
1159
|
"div",
|
|
1142
1160
|
{
|
|
1143
1161
|
className: "univer-flex univer-min-w-32 univer-cursor-pointer univer-items-center univer-gap-2 univer-pb-1 univer-pl-2 univer-pr-2 univer-pt-1 univer-text-sm hover:univer-bg-gray-200",
|
|
@@ -1145,8 +1163,8 @@ const Si = () => {
|
|
|
1145
1163
|
e(b.tableId), r(b.tableName);
|
|
1146
1164
|
},
|
|
1147
1165
|
children: [
|
|
1148
|
-
/* @__PURE__ */ o(
|
|
1149
|
-
|
|
1166
|
+
/* @__PURE__ */ o(Sn, {}),
|
|
1167
|
+
R.t("sheets-table.rename")
|
|
1150
1168
|
]
|
|
1151
1169
|
}
|
|
1152
1170
|
),
|
|
@@ -1156,47 +1174,47 @@ const Si = () => {
|
|
|
1156
1174
|
className: "univer-mb-1 univer-mt-1 univer-h-px univer-w-full univer-bg-gray-200"
|
|
1157
1175
|
}
|
|
1158
1176
|
),
|
|
1159
|
-
/* @__PURE__ */
|
|
1177
|
+
/* @__PURE__ */ w(
|
|
1160
1178
|
"div",
|
|
1161
1179
|
{
|
|
1162
1180
|
onClick: () => ce(b.tableId),
|
|
1163
1181
|
className: "univer-flex univer-min-w-32 univer-cursor-pointer univer-items-center univer-gap-2 univer-pb-1 univer-pl-2 univer-pr-2 univer-pt-1 univer-text-sm hover:univer-bg-gray-200",
|
|
1164
1182
|
children: [
|
|
1165
|
-
/* @__PURE__ */ o(
|
|
1166
|
-
|
|
1183
|
+
/* @__PURE__ */ o(fn, {}),
|
|
1184
|
+
R.t("sheets-table.updateRange")
|
|
1167
1185
|
]
|
|
1168
1186
|
}
|
|
1169
1187
|
),
|
|
1170
|
-
/* @__PURE__ */
|
|
1188
|
+
/* @__PURE__ */ w(
|
|
1171
1189
|
"div",
|
|
1172
1190
|
{
|
|
1173
1191
|
className: "univer-flex univer-min-w-32 univer-cursor-pointer univer-items-center univer-gap-2 univer-pb-1 univer-pl-2 univer-pr-2 univer-pt-1 univer-text-sm hover:univer-bg-gray-200",
|
|
1174
1192
|
onClick: () => {
|
|
1175
|
-
|
|
1176
|
-
const W =
|
|
1193
|
+
L(b.tableId, !1);
|
|
1194
|
+
const W = _.getTableById(U, b.tableId);
|
|
1177
1195
|
if (!W) return;
|
|
1178
|
-
const
|
|
1179
|
-
id:
|
|
1180
|
-
header: { title:
|
|
1196
|
+
const Ce = W.getTableConfig(), Se = {
|
|
1197
|
+
id: Ur,
|
|
1198
|
+
header: { title: R.t("sheets-table.tableStyle") },
|
|
1181
1199
|
children: {
|
|
1182
|
-
label:
|
|
1183
|
-
oldConfig:
|
|
1200
|
+
label: vn,
|
|
1201
|
+
oldConfig: Ce,
|
|
1184
1202
|
unitId: U,
|
|
1185
1203
|
subUnitId: ee,
|
|
1186
1204
|
tableId: b.tableId
|
|
1187
1205
|
},
|
|
1188
1206
|
width: 330
|
|
1189
1207
|
};
|
|
1190
|
-
i.open(
|
|
1208
|
+
i.open(Se);
|
|
1191
1209
|
},
|
|
1192
1210
|
children: [
|
|
1193
1211
|
/* @__PURE__ */ o(
|
|
1194
|
-
|
|
1212
|
+
Cn,
|
|
1195
1213
|
{
|
|
1196
1214
|
extend: { colorChannel1: "rgb(53,91,183)" }
|
|
1197
1215
|
}
|
|
1198
1216
|
),
|
|
1199
|
-
|
|
1217
|
+
R.t("sheets-table.setTheme")
|
|
1200
1218
|
]
|
|
1201
1219
|
}
|
|
1202
1220
|
),
|
|
@@ -1206,29 +1224,29 @@ const Si = () => {
|
|
|
1206
1224
|
className: "univer-mb-1 univer-mt-1 univer-h-px univer-w-full univer-bg-gray-200"
|
|
1207
1225
|
}
|
|
1208
1226
|
),
|
|
1209
|
-
/* @__PURE__ */
|
|
1227
|
+
/* @__PURE__ */ w(
|
|
1210
1228
|
"div",
|
|
1211
1229
|
{
|
|
1212
1230
|
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",
|
|
1213
1231
|
onClick: () => {
|
|
1214
|
-
|
|
1232
|
+
L(b.tableId, !1), u.executeCommand(Xn.id, {
|
|
1215
1233
|
tableId: b.tableId,
|
|
1216
1234
|
subUnitId: ee,
|
|
1217
1235
|
unitId: U
|
|
1218
1236
|
});
|
|
1219
1237
|
},
|
|
1220
1238
|
children: [
|
|
1221
|
-
/* @__PURE__ */ o(
|
|
1222
|
-
|
|
1239
|
+
/* @__PURE__ */ o(mn, { className: "univer-mr-2" }),
|
|
1240
|
+
R.t("sheets-table.removeTable")
|
|
1223
1241
|
]
|
|
1224
1242
|
}
|
|
1225
1243
|
)
|
|
1226
1244
|
] }),
|
|
1227
1245
|
open: (se = a[b.tableId]) != null ? se : !1,
|
|
1228
1246
|
onOpenChange: (W) => {
|
|
1229
|
-
|
|
1247
|
+
L(b.tableId, W);
|
|
1230
1248
|
},
|
|
1231
|
-
children: /* @__PURE__ */ o(
|
|
1249
|
+
children: /* @__PURE__ */ o(Mt, {})
|
|
1232
1250
|
},
|
|
1233
1251
|
b.tableId
|
|
1234
1252
|
)
|
|
@@ -1238,29 +1256,29 @@ const Si = () => {
|
|
|
1238
1256
|
);
|
|
1239
1257
|
}) }) : null;
|
|
1240
1258
|
};
|
|
1241
|
-
var
|
|
1242
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
1259
|
+
var Si = Object.getOwnPropertyDescriptor, _i = (t, e, n, r) => {
|
|
1260
|
+
for (var i = r > 1 ? void 0 : r ? Si(e, n) : e, a = t.length - 1, s; a >= 0; a--)
|
|
1243
1261
|
(s = t[a]) && (i = s(i) || i);
|
|
1244
1262
|
return i;
|
|
1245
1263
|
}, te = (t, e) => (n, r) => e(n, r, t);
|
|
1246
|
-
let
|
|
1247
|
-
constructor(e, n, r, i, a, s, c, d, h, u,
|
|
1264
|
+
let it = class extends Oe {
|
|
1265
|
+
constructor(e, n, r, i, a, s, c, d, h, u, v) {
|
|
1248
1266
|
super();
|
|
1249
|
-
A(this, "_anchorVisible$", new
|
|
1267
|
+
A(this, "_anchorVisible$", new kt(!0));
|
|
1250
1268
|
A(this, "_timer");
|
|
1251
|
-
A(this, "_anchorPosition$", new
|
|
1269
|
+
A(this, "_anchorPosition$", new kt([]));
|
|
1252
1270
|
A(this, "anchorPosition$", this._anchorPosition$.asObservable());
|
|
1253
|
-
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 =
|
|
1271
|
+
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 = v, this._initUI(), this._initListener(), this._initTableAnchor();
|
|
1254
1272
|
}
|
|
1255
1273
|
_initUI() {
|
|
1256
1274
|
this.disposeWithMe(
|
|
1257
|
-
this._uiPartsService.registerComponent(
|
|
1275
|
+
this._uiPartsService.registerComponent(dr.CONTENT, () => hr(Ci, this._injector))
|
|
1258
1276
|
);
|
|
1259
1277
|
}
|
|
1260
1278
|
_initListener() {
|
|
1261
1279
|
this.disposeWithMe(
|
|
1262
1280
|
this._commandService.onCommandExecuted((e) => {
|
|
1263
|
-
(e.id ===
|
|
1281
|
+
(e.id === rr.id || e.id === ir.id) && (this._anchorVisible$.next(!1), this._timer && clearTimeout(this._timer), this._timer = setTimeout(() => {
|
|
1264
1282
|
this._anchorVisible$.next(!0);
|
|
1265
1283
|
}, 300));
|
|
1266
1284
|
})
|
|
@@ -1268,7 +1286,7 @@ let at = class extends Pe {
|
|
|
1268
1286
|
}
|
|
1269
1287
|
_initTableAnchor() {
|
|
1270
1288
|
this.disposeWithMe(
|
|
1271
|
-
|
|
1289
|
+
It(
|
|
1272
1290
|
this._context.unit.activeSheet$,
|
|
1273
1291
|
this._sheetSkeletonManagerService.currentSkeleton$,
|
|
1274
1292
|
this._scrollManagerService.validViewportScrollInfo$,
|
|
@@ -1277,8 +1295,8 @@ let at = class extends Pe {
|
|
|
1277
1295
|
this._tableManager.tableNameChanged$,
|
|
1278
1296
|
this._tableManager.tableRangeChanged$,
|
|
1279
1297
|
this._tableManager.tableThemeChanged$,
|
|
1280
|
-
this._workbookPermissionService.unitPermissionInitStateChange$.pipe(
|
|
1281
|
-
this._permissionService.permissionPointUpdate$.pipe(
|
|
1298
|
+
this._workbookPermissionService.unitPermissionInitStateChange$.pipe(Sr((e) => e)),
|
|
1299
|
+
this._permissionService.permissionPointUpdate$.pipe(_r(300)),
|
|
1282
1300
|
this._anchorVisible$
|
|
1283
1301
|
).subscribe(() => {
|
|
1284
1302
|
var h;
|
|
@@ -1291,25 +1309,25 @@ let at = class extends Pe {
|
|
|
1291
1309
|
this._anchorPosition$.next([]);
|
|
1292
1310
|
return;
|
|
1293
1311
|
}
|
|
1294
|
-
if (!((h = this._permissionService.getPermissionPoint(new
|
|
1312
|
+
if (!((h = this._permissionService.getPermissionPoint(new an(n.getUnitId()).id)) == null ? void 0 : h.value)) {
|
|
1295
1313
|
this._anchorPosition$.next([]);
|
|
1296
1314
|
return;
|
|
1297
1315
|
}
|
|
1298
|
-
const d = a.reduce((u,
|
|
1299
|
-
const { startRow:
|
|
1300
|
-
if (!
|
|
1301
|
-
const { scene: f } =
|
|
1302
|
-
if (!
|
|
1303
|
-
const
|
|
1304
|
-
if (!
|
|
1305
|
-
const
|
|
1306
|
-
if (!
|
|
1307
|
-
const
|
|
1308
|
-
return
|
|
1309
|
-
x:
|
|
1310
|
-
y:
|
|
1311
|
-
tableId:
|
|
1312
|
-
tableName:
|
|
1316
|
+
const d = a.reduce((u, v) => {
|
|
1317
|
+
const { startRow: S, startColumn: C } = v.range, _ = s.with(ot), O = ar(this._univerInstanceService, this._renderManagerService);
|
|
1318
|
+
if (!O) return u;
|
|
1319
|
+
const { scene: f } = O, E = f.getViewport(An.VIEW_MAIN);
|
|
1320
|
+
if (!E) return u;
|
|
1321
|
+
const R = f == null ? void 0 : f.scaleX, D = f == null ? void 0 : f.scaleY, I = f == null ? void 0 : f.getViewportScrollXY(E);
|
|
1322
|
+
if (!R || !f || !D || !I) return u;
|
|
1323
|
+
const g = _.getCurrentSkeleton();
|
|
1324
|
+
if (!g) return u;
|
|
1325
|
+
const x = g.getNoMergeCellWithCoordByIndex(S, C), y = Un(x.startX, R, I), m = Wn(x.startY, D, I) - 25 - 4;
|
|
1326
|
+
return m >= -10 && y >= 45 && u.push({
|
|
1327
|
+
x: y,
|
|
1328
|
+
y: m,
|
|
1329
|
+
tableId: v.id,
|
|
1330
|
+
tableName: v.name
|
|
1313
1331
|
}), u;
|
|
1314
1332
|
}, []);
|
|
1315
1333
|
this._anchorPosition$.next(d);
|
|
@@ -1317,34 +1335,34 @@ let at = class extends Pe {
|
|
|
1317
1335
|
);
|
|
1318
1336
|
}
|
|
1319
1337
|
};
|
|
1320
|
-
|
|
1321
|
-
te(1,
|
|
1322
|
-
te(2,
|
|
1323
|
-
te(3,
|
|
1338
|
+
it = _i([
|
|
1339
|
+
te(1, N(ke)),
|
|
1340
|
+
te(2, N(ot)),
|
|
1341
|
+
te(3, Gt),
|
|
1324
1342
|
te(4, le),
|
|
1325
|
-
te(5,
|
|
1326
|
-
te(6,
|
|
1327
|
-
te(7,
|
|
1328
|
-
te(8,
|
|
1329
|
-
te(9,
|
|
1330
|
-
te(10,
|
|
1331
|
-
],
|
|
1332
|
-
const
|
|
1343
|
+
te(5, pe),
|
|
1344
|
+
te(6, ur),
|
|
1345
|
+
te(7, N(ne)),
|
|
1346
|
+
te(8, N(nr)),
|
|
1347
|
+
te(9, N(ln)),
|
|
1348
|
+
te(10, N(Zt))
|
|
1349
|
+
], it);
|
|
1350
|
+
const xe = 16;
|
|
1333
1351
|
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");
|
|
1334
|
-
class
|
|
1352
|
+
class Ut {
|
|
1335
1353
|
static drawNoSetting(e, n, r, i) {
|
|
1336
|
-
e.save(),
|
|
1354
|
+
e.save(), Et.drawWith(e, {
|
|
1337
1355
|
radius: 2,
|
|
1338
|
-
width:
|
|
1339
|
-
height:
|
|
1356
|
+
width: xe,
|
|
1357
|
+
height: xe,
|
|
1340
1358
|
fill: i
|
|
1341
|
-
}), e.lineCap = "square", e.strokeStyle = r, e.scale(n /
|
|
1359
|
+
}), e.lineCap = "square", e.strokeStyle = r, e.scale(n / xe, n / xe), 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();
|
|
1342
1360
|
}
|
|
1343
1361
|
static drawIconByPath(e, n, r, i) {
|
|
1344
|
-
e.save(), e.strokeStyle = r, e.fillStyle = i,
|
|
1362
|
+
e.save(), e.strokeStyle = r, e.fillStyle = i, Et.drawWith(e, {
|
|
1345
1363
|
radius: 2,
|
|
1346
|
-
width:
|
|
1347
|
-
height:
|
|
1364
|
+
width: xe,
|
|
1365
|
+
height: xe,
|
|
1348
1366
|
fill: i
|
|
1349
1367
|
}), n.forEach((a) => {
|
|
1350
1368
|
const s = new Path2D(a);
|
|
@@ -1352,30 +1370,30 @@ class Wt {
|
|
|
1352
1370
|
}), e.restore();
|
|
1353
1371
|
}
|
|
1354
1372
|
}
|
|
1355
|
-
const
|
|
1373
|
+
const Ti = [
|
|
1356
1374
|
"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"
|
|
1357
|
-
],
|
|
1375
|
+
], wi = [
|
|
1358
1376
|
"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",
|
|
1359
1377
|
"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"
|
|
1360
|
-
],
|
|
1378
|
+
], Ii = [
|
|
1361
1379
|
"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",
|
|
1362
1380
|
"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"
|
|
1363
|
-
],
|
|
1381
|
+
], yi = [
|
|
1364
1382
|
"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",
|
|
1365
1383
|
"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",
|
|
1366
1384
|
"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"
|
|
1367
|
-
],
|
|
1385
|
+
], Ri = [
|
|
1368
1386
|
"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",
|
|
1369
1387
|
"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",
|
|
1370
1388
|
"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"
|
|
1371
1389
|
];
|
|
1372
|
-
var
|
|
1373
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
1390
|
+
var Mi = Object.getOwnPropertyDescriptor, xi = (t, e, n, r) => {
|
|
1391
|
+
for (var i = r > 1 ? void 0 : r ? Mi(e, n) : e, a = t.length - 1, s; a >= 0; a--)
|
|
1374
1392
|
(s = t[a]) && (i = s(i) || i);
|
|
1375
1393
|
return i;
|
|
1376
|
-
},
|
|
1377
|
-
const
|
|
1378
|
-
let
|
|
1394
|
+
}, mt = (t, e) => (n, r) => e(n, r, t);
|
|
1395
|
+
const ge = 16, et = 1;
|
|
1396
|
+
let St = class extends jn {
|
|
1379
1397
|
constructor(e, n, r, i, a) {
|
|
1380
1398
|
super(e, n);
|
|
1381
1399
|
A(this, "_cellWidth", 0);
|
|
@@ -1391,38 +1409,38 @@ let _t = class extends Zn {
|
|
|
1391
1409
|
});
|
|
1392
1410
|
}
|
|
1393
1411
|
_draw(e) {
|
|
1394
|
-
const n = this._cellHeight, r = this._cellWidth, i =
|
|
1412
|
+
const n = this._cellHeight, r = this._cellWidth, i = ge - r, a = ge - n;
|
|
1395
1413
|
e.save();
|
|
1396
1414
|
const s = new Path2D();
|
|
1397
1415
|
s.rect(i, a, r, n), e.clip(s);
|
|
1398
1416
|
const { buttonState: c } = this._filterParams, d = this._themeService.getColorFromTheme("primary.600"), h = this._hovered ? this._themeService.getColorFromTheme("gray.50") : "rgba(255, 255, 255, 1.0)";
|
|
1399
1417
|
let u;
|
|
1400
1418
|
switch (c) {
|
|
1401
|
-
case
|
|
1419
|
+
case Me.FilteredSortNone:
|
|
1420
|
+
u = Ti;
|
|
1421
|
+
break;
|
|
1422
|
+
case Me.FilteredSortAsc:
|
|
1402
1423
|
u = wi;
|
|
1403
1424
|
break;
|
|
1404
|
-
case
|
|
1425
|
+
case Me.FilteredSortDesc:
|
|
1405
1426
|
u = Ii;
|
|
1406
1427
|
break;
|
|
1407
|
-
case
|
|
1408
|
-
u = yi;
|
|
1428
|
+
case Me.FilterNoneSortNone:
|
|
1409
1429
|
break;
|
|
1410
|
-
case
|
|
1430
|
+
case Me.FilterNoneSortAsc:
|
|
1431
|
+
u = yi;
|
|
1411
1432
|
break;
|
|
1412
|
-
case
|
|
1433
|
+
case Me.FilterNoneSortDesc:
|
|
1413
1434
|
u = Ri;
|
|
1414
1435
|
break;
|
|
1415
|
-
case xe.FilterNoneSortDesc:
|
|
1416
|
-
u = Mi;
|
|
1417
|
-
break;
|
|
1418
1436
|
}
|
|
1419
|
-
u ?
|
|
1437
|
+
u ? Ut.drawIconByPath(e, u, d, h) : c !== void 0 && Ut.drawNoSetting(e, ge, d, h), e.restore();
|
|
1420
1438
|
}
|
|
1421
1439
|
onPointerDown(e) {
|
|
1422
1440
|
if (e.button === 2)
|
|
1423
1441
|
return;
|
|
1424
1442
|
const { row: n, col: r, unitId: i, subUnitId: a, tableId: s } = this._filterParams;
|
|
1425
|
-
this._contextService.getContextValue(
|
|
1443
|
+
this._contextService.getContextValue(ve) || !this._commandService.hasCommand(Ct.id) || setTimeout(() => {
|
|
1426
1444
|
const d = {
|
|
1427
1445
|
row: n,
|
|
1428
1446
|
col: r,
|
|
@@ -1430,7 +1448,7 @@ let _t = class extends Zn {
|
|
|
1430
1448
|
subUnitId: a,
|
|
1431
1449
|
tableId: s
|
|
1432
1450
|
};
|
|
1433
|
-
this._commandService.executeCommand(
|
|
1451
|
+
this._commandService.executeCommand(Ct.id, d);
|
|
1434
1452
|
}, 200);
|
|
1435
1453
|
}
|
|
1436
1454
|
onPointerEnter() {
|
|
@@ -1440,18 +1458,18 @@ let _t = class extends Zn {
|
|
|
1440
1458
|
this._hovered = !1, this.makeDirty(!0);
|
|
1441
1459
|
}
|
|
1442
1460
|
};
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
],
|
|
1448
|
-
var
|
|
1449
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
1461
|
+
St = xi([
|
|
1462
|
+
mt(2, wt),
|
|
1463
|
+
mt(3, le),
|
|
1464
|
+
mt(4, N(On))
|
|
1465
|
+
], St);
|
|
1466
|
+
var Ni = Object.getOwnPropertyDescriptor, Ei = (t, e, n, r) => {
|
|
1467
|
+
for (var i = r > 1 ? void 0 : r ? Ni(e, n) : e, a = t.length - 1, s; a >= 0; a--)
|
|
1450
1468
|
(s = t[a]) && (i = s(i) || i);
|
|
1451
1469
|
return i;
|
|
1452
|
-
},
|
|
1453
|
-
const
|
|
1454
|
-
let
|
|
1470
|
+
}, tt = (t, e) => (n, r) => e(n, r, t);
|
|
1471
|
+
const Li = 5e3;
|
|
1472
|
+
let _t = class extends Qt {
|
|
1455
1473
|
constructor(e, n, r, i, a) {
|
|
1456
1474
|
super();
|
|
1457
1475
|
A(this, "_buttonRenderDisposable", null);
|
|
@@ -1464,7 +1482,7 @@ let Tt = class extends Gt {
|
|
|
1464
1482
|
_initRenderer() {
|
|
1465
1483
|
const e = this._tableManager;
|
|
1466
1484
|
this._sheetSkeletonManagerService.currentSkeleton$.pipe(
|
|
1467
|
-
|
|
1485
|
+
we((n) => {
|
|
1468
1486
|
var c;
|
|
1469
1487
|
if (!n) return J(null);
|
|
1470
1488
|
const { unit: r, unitId: i } = this._context, a = ((c = r.getActiveSheet()) == null ? void 0 : c.getSheetId()) || "", s = () => ({
|
|
@@ -1473,7 +1491,7 @@ let Tt = class extends Gt {
|
|
|
1473
1491
|
tableFilterRanges: this._tableManager.getSheetFilterRangeWithState(r.getUnitId(), a),
|
|
1474
1492
|
skeleton: n.skeleton
|
|
1475
1493
|
});
|
|
1476
|
-
return
|
|
1494
|
+
return It(
|
|
1477
1495
|
e.tableAdd$,
|
|
1478
1496
|
e.tableNameChanged$,
|
|
1479
1497
|
e.tableRangeChanged$,
|
|
@@ -1481,11 +1499,11 @@ let Tt = class extends Gt {
|
|
|
1481
1499
|
e.tableDelete$,
|
|
1482
1500
|
e.tableFilterChanged$
|
|
1483
1501
|
).pipe(
|
|
1484
|
-
|
|
1485
|
-
|
|
1502
|
+
Tr(() => s()),
|
|
1503
|
+
rn(s())
|
|
1486
1504
|
);
|
|
1487
1505
|
}),
|
|
1488
|
-
|
|
1506
|
+
wr(this.dispose$)
|
|
1489
1507
|
).subscribe((n) => {
|
|
1490
1508
|
this._disposeRendering(), !(!n || !n.tableFilterRanges) && this._renderButtons(n);
|
|
1491
1509
|
});
|
|
@@ -1493,36 +1511,36 @@ let Tt = class extends Gt {
|
|
|
1493
1511
|
_renderButtons(e) {
|
|
1494
1512
|
const { tableFilterRanges: n, unitId: r, skeleton: i, worksheetId: a } = e, { scene: s } = this._context;
|
|
1495
1513
|
for (const { range: c, states: d, tableId: h } of n) {
|
|
1496
|
-
const { startRow: u, startColumn:
|
|
1514
|
+
const { startRow: u, startColumn: v, endColumn: S } = c;
|
|
1497
1515
|
this._interceptCellContent(r, a, c);
|
|
1498
|
-
for (let
|
|
1499
|
-
const
|
|
1500
|
-
if (
|
|
1516
|
+
for (let C = v; C <= S; C++) {
|
|
1517
|
+
const _ = `sheets-table-filter-button-${u}-${C}`, O = sr(u, C, s, i), { startX: f, startY: E, endX: R, endY: D } = O, I = R - f, g = D - E;
|
|
1518
|
+
if (g <= et || I <= et)
|
|
1501
1519
|
continue;
|
|
1502
|
-
const
|
|
1503
|
-
left:
|
|
1504
|
-
top:
|
|
1505
|
-
height:
|
|
1506
|
-
width:
|
|
1507
|
-
zIndex:
|
|
1508
|
-
cellHeight:
|
|
1509
|
-
cellWidth:
|
|
1510
|
-
filterParams: { unitId: r, subUnitId: a, row: u, col:
|
|
1511
|
-
},
|
|
1512
|
-
this._tableFilterButtonShapes.push(
|
|
1520
|
+
const x = d[C - v], y = R - ge - et, m = D - ge - et, B = {
|
|
1521
|
+
left: y,
|
|
1522
|
+
top: m,
|
|
1523
|
+
height: ge,
|
|
1524
|
+
width: ge,
|
|
1525
|
+
zIndex: Li,
|
|
1526
|
+
cellHeight: g,
|
|
1527
|
+
cellWidth: I,
|
|
1528
|
+
filterParams: { unitId: r, subUnitId: a, row: u, col: C, buttonState: x, tableId: h }
|
|
1529
|
+
}, L = this._injector.createInstance(St, _, B);
|
|
1530
|
+
this._tableFilterButtonShapes.push(L);
|
|
1513
1531
|
}
|
|
1514
1532
|
}
|
|
1515
1533
|
s.addObjects(this._tableFilterButtonShapes), s.makeDirty();
|
|
1516
1534
|
}
|
|
1517
1535
|
_interceptCellContent(e, n, r) {
|
|
1518
1536
|
const { startRow: i, startColumn: a, endColumn: s } = r;
|
|
1519
|
-
this._buttonRenderDisposable = this._sheetInterceptorService.intercept(
|
|
1520
|
-
effect:
|
|
1537
|
+
this._buttonRenderDisposable = this._sheetInterceptorService.intercept(kr.CELL_CONTENT, {
|
|
1538
|
+
effect: kn.Style,
|
|
1521
1539
|
handler: (c, d, h) => {
|
|
1522
|
-
const { row: u, col:
|
|
1523
|
-
return
|
|
1540
|
+
const { row: u, col: v, unitId: S, subUnitId: C } = d;
|
|
1541
|
+
return S !== e || C !== n || u !== i || v < a || v > s || ((!c || c === d.rawData) && (c = { ...d.rawData }), c.fontRenderExtension = {
|
|
1524
1542
|
...c == null ? void 0 : c.fontRenderExtension,
|
|
1525
|
-
rightOffset:
|
|
1543
|
+
rightOffset: ge
|
|
1526
1544
|
}), h(c);
|
|
1527
1545
|
},
|
|
1528
1546
|
priority: 10
|
|
@@ -1533,73 +1551,73 @@ let Tt = class extends Gt {
|
|
|
1533
1551
|
this._tableFilterButtonShapes.forEach((n) => n.dispose()), (e = this._buttonRenderDisposable) == null || e.dispose(), this._buttonRenderDisposable = null, this._tableFilterButtonShapes = [];
|
|
1534
1552
|
}
|
|
1535
1553
|
};
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
],
|
|
1542
|
-
const
|
|
1543
|
-
const { unitId: e, subUnitId: n, range: r, onCancel: i, onConfirm: a, tableId: s } = t, c = M(ne), [d, h] = q(r), [u,
|
|
1544
|
-
return /* @__PURE__ */
|
|
1554
|
+
_t = Ei([
|
|
1555
|
+
tt(1, N(ke)),
|
|
1556
|
+
tt(2, N(ot)),
|
|
1557
|
+
tt(3, N(cn)),
|
|
1558
|
+
tt(4, N(ne))
|
|
1559
|
+
], _t);
|
|
1560
|
+
const $i = (t) => {
|
|
1561
|
+
const { unitId: e, subUnitId: n, range: r, onCancel: i, onConfirm: a, tableId: s } = t, c = M(ne), [d, h] = q(r), [u, v] = q(""), S = M(oe), C = M(pe);
|
|
1562
|
+
return /* @__PURE__ */ w(yt, { children: [
|
|
1545
1563
|
/* @__PURE__ */ o(
|
|
1546
|
-
|
|
1564
|
+
Hr,
|
|
1547
1565
|
{
|
|
1548
1566
|
maxRangeCount: 1,
|
|
1549
1567
|
unitId: e,
|
|
1550
1568
|
subUnitId: n,
|
|
1551
|
-
initialValue:
|
|
1552
|
-
onChange: (
|
|
1553
|
-
const f =
|
|
1554
|
-
if (!
|
|
1569
|
+
initialValue: Vt(r),
|
|
1570
|
+
onChange: (_, O) => {
|
|
1571
|
+
const f = Vt(r), E = Fr(O).range, R = ct(C, { unitId: e, subUnitId: n });
|
|
1572
|
+
if (!R)
|
|
1555
1573
|
return;
|
|
1556
|
-
if (
|
|
1557
|
-
|
|
1574
|
+
if (R.worksheet.getMergeData().some((L) => be.intersects(E, L))) {
|
|
1575
|
+
v(S.t("sheets-table.tableRangeWithMergeError"));
|
|
1558
1576
|
return;
|
|
1559
1577
|
}
|
|
1560
|
-
if (c.getTablesBySubunitId(e, n).some((
|
|
1561
|
-
if (
|
|
1578
|
+
if (c.getTablesBySubunitId(e, n).some((L) => {
|
|
1579
|
+
if (L.getId() === s)
|
|
1562
1580
|
return !1;
|
|
1563
|
-
const Q =
|
|
1564
|
-
return
|
|
1581
|
+
const Q = L.getRange();
|
|
1582
|
+
return be.intersects(E, Q);
|
|
1565
1583
|
})) {
|
|
1566
|
-
|
|
1584
|
+
v(S.t("sheets-table.tableRangeWithOtherTableError"));
|
|
1567
1585
|
return;
|
|
1568
1586
|
}
|
|
1569
|
-
const { startRow:
|
|
1570
|
-
if (
|
|
1571
|
-
|
|
1587
|
+
const { startRow: y, endRow: m } = E;
|
|
1588
|
+
if (y === m) {
|
|
1589
|
+
v(S.t("sheets-table.tableRangeSingleRowError"));
|
|
1572
1590
|
return;
|
|
1573
1591
|
}
|
|
1574
|
-
if (f !==
|
|
1592
|
+
if (f !== O) {
|
|
1575
1593
|
if (s) {
|
|
1576
|
-
const
|
|
1577
|
-
if (
|
|
1578
|
-
const Q =
|
|
1579
|
-
if (
|
|
1580
|
-
h(
|
|
1594
|
+
const L = c.getTableById(e, s);
|
|
1595
|
+
if (L) {
|
|
1596
|
+
const Q = L.getRange();
|
|
1597
|
+
if (be.intersects(E, Q) && Q.startRow === E.startRow) {
|
|
1598
|
+
h(E), v(""), a({
|
|
1581
1599
|
unitId: e,
|
|
1582
1600
|
subUnitId: n,
|
|
1583
|
-
range:
|
|
1601
|
+
range: E
|
|
1584
1602
|
});
|
|
1585
1603
|
return;
|
|
1586
1604
|
} else {
|
|
1587
|
-
|
|
1605
|
+
v(S.t("sheets-table.updateError"));
|
|
1588
1606
|
return;
|
|
1589
1607
|
}
|
|
1590
1608
|
}
|
|
1591
1609
|
}
|
|
1592
|
-
h(
|
|
1610
|
+
h(E), v("");
|
|
1593
1611
|
}
|
|
1594
1612
|
},
|
|
1595
1613
|
supportAcrossSheet: !1
|
|
1596
1614
|
}
|
|
1597
1615
|
),
|
|
1598
1616
|
u && /* @__PURE__ */ o("div", { className: "univer-mt-1 univer-text-xs univer-text-red-500", children: u }),
|
|
1599
|
-
/* @__PURE__ */
|
|
1600
|
-
/* @__PURE__ */ o(
|
|
1617
|
+
/* @__PURE__ */ w("div", { className: "univer-mt-4 univer-flex univer-justify-end", children: [
|
|
1618
|
+
/* @__PURE__ */ o(_e, { onClick: i, children: S.t("sheets-table.cancel") }),
|
|
1601
1619
|
/* @__PURE__ */ o(
|
|
1602
|
-
|
|
1620
|
+
_e,
|
|
1603
1621
|
{
|
|
1604
1622
|
variant: "primary",
|
|
1605
1623
|
onClick: () => {
|
|
@@ -1610,72 +1628,72 @@ const ki = (t) => {
|
|
|
1610
1628
|
});
|
|
1611
1629
|
},
|
|
1612
1630
|
className: "univer-ml-2",
|
|
1613
|
-
children:
|
|
1631
|
+
children: S.t("sheets-table.confirm")
|
|
1614
1632
|
}
|
|
1615
1633
|
)
|
|
1616
1634
|
] })
|
|
1617
1635
|
] });
|
|
1618
|
-
},
|
|
1619
|
-
var
|
|
1620
|
-
const { unitId: e, subUnitId: n, tableId: r } = t, i = M(le), a = M(oe), s = M(ne), c = s.getTableById(e, r), d = M(
|
|
1636
|
+
}, Oi = (t) => {
|
|
1637
|
+
var k, V, Y, dt, qe, Ye, ht, Qe, vt, Pe, De, Be;
|
|
1638
|
+
const { unitId: e, subUnitId: n, tableId: r } = t, i = M(le), a = M(oe), s = M(ne), c = s.getTableById(e, r), d = M(on), h = M(Ie), u = Te(d.rangeThemeMapChange$), v = Te(h.refreshTable$), S = M(Pn), [, C] = q(Math.random()), _ = Te(s.tableThemeChanged$, {
|
|
1621
1639
|
theme: c == null ? void 0 : c.getTableStyleId(),
|
|
1622
1640
|
oldTheme: c == null ? void 0 : c.getTableStyleId(),
|
|
1623
1641
|
unitId: e,
|
|
1624
1642
|
subUnitId: n,
|
|
1625
1643
|
tableId: r
|
|
1626
|
-
}),
|
|
1627
|
-
i.executeCommand(
|
|
1644
|
+
}), O = d.getRegisteredRangeThemes().filter((p) => p == null ? void 0 : p.startsWith(Wr)), f = d.getALLRegisteredTheme(e).filter((p) => p == null ? void 0 : p.startsWith(bt)), E = c == null ? void 0 : c.getTableStyleId(), R = f.find((p) => p === E), D = R || f[0], I = d.getCustomRangeThemeStyle(e, D), g = (Y = (V = (k = I == null ? void 0 : I.getHeaderRowStyle()) == null ? void 0 : k.bg) == null ? void 0 : V.rgb) != null ? Y : he, x = (Ye = (qe = (dt = I == null ? void 0 : I.getFirstRowStyle()) == null ? void 0 : dt.bg) == null ? void 0 : qe.rgb) != null ? Ye : he, y = (vt = (Qe = (ht = I == null ? void 0 : I.getSecondRowStyle()) == null ? void 0 : ht.bg) == null ? void 0 : Qe.rgb) != null ? vt : he, m = (Be = (De = (Pe = I == null ? void 0 : I.getLastRowStyle()) == null ? void 0 : Pe.bg) == null ? void 0 : De.rgb) != null ? Be : he, [B, L] = q(null), Q = (p) => {
|
|
1645
|
+
i.executeCommand(ft.id, {
|
|
1628
1646
|
unitId: e,
|
|
1629
1647
|
tableId: r,
|
|
1630
|
-
theme:
|
|
1648
|
+
theme: p
|
|
1631
1649
|
});
|
|
1632
1650
|
}, U = () => {
|
|
1633
1651
|
if (f.length >= 11) {
|
|
1634
|
-
|
|
1652
|
+
S.emit(a.t("sheets-table.customTooMore"));
|
|
1635
1653
|
return;
|
|
1636
1654
|
}
|
|
1637
|
-
const
|
|
1638
|
-
let
|
|
1639
|
-
if (
|
|
1640
|
-
const K = Number(
|
|
1641
|
-
|
|
1655
|
+
const p = f[f.length - 1];
|
|
1656
|
+
let T = `${bt}1`;
|
|
1657
|
+
if (p) {
|
|
1658
|
+
const K = Number(p.split("-")[2]);
|
|
1659
|
+
T = `${bt}${K + 1}`;
|
|
1642
1660
|
}
|
|
1643
|
-
const z = new
|
|
1644
|
-
i.executeCommand(
|
|
1661
|
+
const z = new Pr(T, { ...zn });
|
|
1662
|
+
i.executeCommand(Kn.id, {
|
|
1645
1663
|
unitId: e,
|
|
1646
1664
|
tableId: r,
|
|
1647
1665
|
themeStyle: z
|
|
1648
1666
|
});
|
|
1649
|
-
}, ee = (
|
|
1650
|
-
i.executeCommand(
|
|
1667
|
+
}, ee = (p, T) => {
|
|
1668
|
+
i.executeCommand(sn.id, {
|
|
1651
1669
|
unitId: e,
|
|
1652
1670
|
subUnitId: n,
|
|
1653
|
-
styleName:
|
|
1654
|
-
style:
|
|
1671
|
+
styleName: p,
|
|
1672
|
+
style: T
|
|
1655
1673
|
});
|
|
1656
|
-
},
|
|
1657
|
-
i.executeCommand(
|
|
1674
|
+
}, Re = (p) => {
|
|
1675
|
+
i.executeCommand(Jn.id, {
|
|
1658
1676
|
unitId: e,
|
|
1659
1677
|
tableId: r,
|
|
1660
|
-
themeName:
|
|
1678
|
+
themeName: p
|
|
1661
1679
|
});
|
|
1662
1680
|
};
|
|
1663
|
-
if (
|
|
1664
|
-
|
|
1665
|
-
}, [u,
|
|
1666
|
-
const ce = new
|
|
1667
|
-
return /* @__PURE__ */
|
|
1681
|
+
if (dn(() => {
|
|
1682
|
+
C(Math.random());
|
|
1683
|
+
}, [u, v]), !c) return null;
|
|
1684
|
+
const ce = new de(g).isDark(), fe = new de(x).isDark(), ue = new de(y).isDark(), b = new de(m).isDark();
|
|
1685
|
+
return /* @__PURE__ */ w("div", { children: [
|
|
1668
1686
|
/* @__PURE__ */ o("h5", { children: a.t("sheets-table.defaultStyle") }),
|
|
1669
|
-
/* @__PURE__ */ o("div", { className: "univer-flex univer-gap-2", children:
|
|
1670
|
-
var Se,
|
|
1671
|
-
const
|
|
1672
|
-
return /* @__PURE__ */
|
|
1687
|
+
/* @__PURE__ */ o("div", { className: "univer-flex univer-gap-2", children: O.map((p) => {
|
|
1688
|
+
var Ce, Se, Fe, He, Ve, Ae, Ue, We;
|
|
1689
|
+
const T = d.getDefaultRangeThemeStyle(p), z = ((Se = (Ce = T == null ? void 0 : T.getHeaderRowStyle()) == null ? void 0 : Ce.bg) == null ? void 0 : Se.rgb) || he, K = ((He = (Fe = T == null ? void 0 : T.getFirstRowStyle()) == null ? void 0 : Fe.bg) == null ? void 0 : He.rgb) || he, se = ((Ae = (Ve = T == null ? void 0 : T.getSecondRowStyle()) == null ? void 0 : Ve.bg) == null ? void 0 : Ae.rgb) || he, W = ((We = (Ue = T == null ? void 0 : T.getLastRowStyle()) == null ? void 0 : Ue.bg) == null ? void 0 : We.rgb) || he;
|
|
1690
|
+
return /* @__PURE__ */ w(
|
|
1673
1691
|
"div",
|
|
1674
1692
|
{
|
|
1675
|
-
className:
|
|
1676
|
-
"univer-border-blue-500":
|
|
1693
|
+
className: P("univer-h-10 univer-w-8 univer-cursor-pointer univer-border univer-border-solid univer-border-gray-200 univer-p-px [&>div]:univer-box-border [&>div]:univer-h-2.5", {
|
|
1694
|
+
"univer-border-blue-500": p === _.theme
|
|
1677
1695
|
}),
|
|
1678
|
-
onClick: () => Q(
|
|
1696
|
+
onClick: () => Q(p),
|
|
1679
1697
|
children: [
|
|
1680
1698
|
/* @__PURE__ */ o("div", { style: { background: z, border: `${G}` } }),
|
|
1681
1699
|
/* @__PURE__ */ o("div", { style: { background: K, border: `${G}` } }),
|
|
@@ -1683,268 +1701,268 @@ const ki = (t) => {
|
|
|
1683
1701
|
/* @__PURE__ */ o("div", { style: { background: W, border: `${G}` } })
|
|
1684
1702
|
]
|
|
1685
1703
|
},
|
|
1686
|
-
|
|
1704
|
+
p
|
|
1687
1705
|
);
|
|
1688
1706
|
}) }),
|
|
1689
1707
|
/* @__PURE__ */ o("h5", { children: a.t("sheets-table.customStyle") }),
|
|
1690
|
-
/* @__PURE__ */
|
|
1691
|
-
/* @__PURE__ */
|
|
1708
|
+
/* @__PURE__ */ w("div", { className: P("univer-w-full univer-rounded-sm", H), children: [
|
|
1709
|
+
/* @__PURE__ */ w("div", { className: "univer-flex univer-flex-wrap univer-gap-2 univer-p-2", children: [
|
|
1692
1710
|
/* @__PURE__ */ o(
|
|
1693
1711
|
"div",
|
|
1694
1712
|
{
|
|
1695
|
-
className:
|
|
1713
|
+
className: P("univer-h-10 univer-w-8 univer-cursor-pointer univer-p-px univer-text-center univer-leading-10", H),
|
|
1696
1714
|
onClick: U,
|
|
1697
1715
|
children: "+"
|
|
1698
1716
|
}
|
|
1699
1717
|
),
|
|
1700
|
-
f.map((
|
|
1701
|
-
var Se,
|
|
1702
|
-
const
|
|
1703
|
-
return /* @__PURE__ */
|
|
1718
|
+
f.map((p) => {
|
|
1719
|
+
var Ce, Se, Fe, He, Ve, Ae, Ue, We;
|
|
1720
|
+
const T = d.getCustomRangeThemeStyle(e, p), z = (Se = (Ce = T == null ? void 0 : T.getHeaderRowStyle()) == null ? void 0 : Ce.bg) == null ? void 0 : Se.rgb, K = (He = (Fe = T == null ? void 0 : T.getFirstRowStyle()) == null ? void 0 : Fe.bg) == null ? void 0 : He.rgb, se = (Ae = (Ve = T == null ? void 0 : T.getSecondRowStyle()) == null ? void 0 : Ve.bg) == null ? void 0 : Ae.rgb, W = (We = (Ue = T == null ? void 0 : T.getLastRowStyle()) == null ? void 0 : Ue.bg) == null ? void 0 : We.rgb;
|
|
1721
|
+
return /* @__PURE__ */ w(
|
|
1704
1722
|
"div",
|
|
1705
1723
|
{
|
|
1706
|
-
className:
|
|
1707
|
-
"univer-border-blue-500":
|
|
1724
|
+
className: P("univer-relative univer-h-10 univer-w-8 univer-cursor-pointer univer-border univer-border-solid univer-border-gray-200 univer-p-px", {
|
|
1725
|
+
"univer-border-blue-500": p === _.theme
|
|
1708
1726
|
}),
|
|
1709
|
-
onClick: () => Q(
|
|
1710
|
-
onMouseEnter: () =>
|
|
1711
|
-
onMouseLeave: () =>
|
|
1727
|
+
onClick: () => Q(p),
|
|
1728
|
+
onMouseEnter: () => L(p),
|
|
1729
|
+
onMouseLeave: () => L(null),
|
|
1712
1730
|
children: [
|
|
1713
|
-
/* @__PURE__ */ o("div", { className: "univer-box-border univer-h-2.5", style: { background: z != null ? z : G, border: `${z ? G :
|
|
1714
|
-
/* @__PURE__ */ o("div", { className: "univer-box-border univer-h-2.5", style: { background: K != null ? K : G, border: `${K ? G :
|
|
1715
|
-
/* @__PURE__ */ o("div", { className: "univer-box-border univer-h-2.5", style: { background: se != null ? se : G, border: `${se ? G :
|
|
1716
|
-
/* @__PURE__ */ o("div", { className: "univer-box-border univer-h-2.5", style: { background: W != null ? W : G, border: `${W ? G :
|
|
1731
|
+
/* @__PURE__ */ o("div", { className: "univer-box-border univer-h-2.5", style: { background: z != null ? z : G, border: `${z ? G : ze}` } }),
|
|
1732
|
+
/* @__PURE__ */ o("div", { className: "univer-box-border univer-h-2.5", style: { background: K != null ? K : G, border: `${K ? G : ze}` } }),
|
|
1733
|
+
/* @__PURE__ */ o("div", { className: "univer-box-border univer-h-2.5", style: { background: se != null ? se : G, border: `${se ? G : ze}` } }),
|
|
1734
|
+
/* @__PURE__ */ o("div", { className: "univer-box-border univer-h-2.5", style: { background: W != null ? W : G, border: `${W ? G : ze}` } }),
|
|
1717
1735
|
/* @__PURE__ */ o(
|
|
1718
1736
|
"div",
|
|
1719
1737
|
{
|
|
1720
1738
|
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]",
|
|
1721
|
-
style: { display:
|
|
1722
|
-
onClick: (
|
|
1723
|
-
|
|
1739
|
+
style: { display: B === p ? "block" : "none" },
|
|
1740
|
+
onClick: (Nn) => {
|
|
1741
|
+
Nn.stopPropagation(), Re(p);
|
|
1724
1742
|
},
|
|
1725
1743
|
children: "x"
|
|
1726
1744
|
}
|
|
1727
1745
|
)
|
|
1728
1746
|
]
|
|
1729
1747
|
},
|
|
1730
|
-
|
|
1748
|
+
p
|
|
1731
1749
|
);
|
|
1732
1750
|
})
|
|
1733
1751
|
] }),
|
|
1734
|
-
|
|
1752
|
+
R && /* @__PURE__ */ w(yt, { children: [
|
|
1735
1753
|
/* @__PURE__ */ o("div", { className: "univer-h-px univer-w-full univer-bg-gray-200" }),
|
|
1736
|
-
/* @__PURE__ */
|
|
1737
|
-
/* @__PURE__ */
|
|
1754
|
+
/* @__PURE__ */ w("div", { className: "univer-flex univer-flex-col univer-gap-2 univer-p-2", children: [
|
|
1755
|
+
/* @__PURE__ */ w("div", { className: "univer-flex univer-h-9 univer-gap-2", children: [
|
|
1738
1756
|
/* @__PURE__ */ o(
|
|
1739
1757
|
"div",
|
|
1740
1758
|
{
|
|
1741
|
-
className:
|
|
1759
|
+
className: P("univer-box-border univer-h-full univer-w-52 univer-rounded-sm univer-text-center univer-leading-9", H, {
|
|
1742
1760
|
"univer-text-white": ce,
|
|
1743
1761
|
"univer-text-gray-900": !ce
|
|
1744
1762
|
}),
|
|
1745
1763
|
style: {
|
|
1746
|
-
background:
|
|
1764
|
+
background: g
|
|
1747
1765
|
},
|
|
1748
1766
|
children: a.t("sheets-table.header")
|
|
1749
1767
|
}
|
|
1750
1768
|
),
|
|
1751
1769
|
/* @__PURE__ */ o(
|
|
1752
|
-
|
|
1770
|
+
Ee,
|
|
1753
1771
|
{
|
|
1754
1772
|
overlay: /* @__PURE__ */ o("div", { className: "univer-p-2", children: /* @__PURE__ */ o(
|
|
1755
|
-
|
|
1773
|
+
Xe,
|
|
1756
1774
|
{
|
|
1757
|
-
value:
|
|
1758
|
-
onChange: (
|
|
1759
|
-
const
|
|
1775
|
+
value: g,
|
|
1776
|
+
onChange: (p) => {
|
|
1777
|
+
const T = Ot("headerRowStyle", {
|
|
1760
1778
|
bg: {
|
|
1761
|
-
rgb:
|
|
1779
|
+
rgb: p
|
|
1762
1780
|
},
|
|
1763
1781
|
cl: {
|
|
1764
|
-
rgb: new
|
|
1782
|
+
rgb: new de(p).isDark() ? "#fff" : "#000"
|
|
1765
1783
|
}
|
|
1766
1784
|
});
|
|
1767
|
-
ee(c.getTableStyleId(), { headerRowStyle:
|
|
1785
|
+
ee(c.getTableStyleId(), { headerRowStyle: T });
|
|
1768
1786
|
}
|
|
1769
1787
|
}
|
|
1770
1788
|
) }),
|
|
1771
|
-
children: /* @__PURE__ */
|
|
1789
|
+
children: /* @__PURE__ */ w(
|
|
1772
1790
|
"div",
|
|
1773
1791
|
{
|
|
1774
|
-
className:
|
|
1792
|
+
className: P("univer-flex univer-cursor-pointer univer-items-center univer-gap-2 univer-rounded-sm univer-bg-white univer-p-1", H),
|
|
1775
1793
|
children: [
|
|
1776
1794
|
/* @__PURE__ */ o(
|
|
1777
1795
|
"div",
|
|
1778
1796
|
{
|
|
1779
|
-
className:
|
|
1797
|
+
className: P("univer-h-4 univer-w-4 univer-rounded-lg univer-bg-gray-400", H, {
|
|
1780
1798
|
"univer-text-white": ce,
|
|
1781
1799
|
"univer-text-gray-900": !ce
|
|
1782
1800
|
}),
|
|
1783
1801
|
style: {
|
|
1784
|
-
background:
|
|
1802
|
+
background: g
|
|
1785
1803
|
}
|
|
1786
1804
|
}
|
|
1787
1805
|
),
|
|
1788
|
-
/* @__PURE__ */ o(
|
|
1806
|
+
/* @__PURE__ */ o(je, { className: "univer-h-2 univer-w-2" })
|
|
1789
1807
|
]
|
|
1790
1808
|
}
|
|
1791
1809
|
)
|
|
1792
1810
|
}
|
|
1793
1811
|
)
|
|
1794
1812
|
] }),
|
|
1795
|
-
/* @__PURE__ */
|
|
1813
|
+
/* @__PURE__ */ w("div", { className: "univer-flex univer-h-9 univer-gap-2", children: [
|
|
1796
1814
|
/* @__PURE__ */ o(
|
|
1797
1815
|
"div",
|
|
1798
1816
|
{
|
|
1799
|
-
className:
|
|
1800
|
-
"univer-text-white":
|
|
1801
|
-
"univer-text-gray-900": !
|
|
1817
|
+
className: P("univer-box-border univer-h-full univer-w-52 univer-rounded-sm univer-text-center univer-leading-9", H, {
|
|
1818
|
+
"univer-text-white": fe,
|
|
1819
|
+
"univer-text-gray-900": !fe
|
|
1802
1820
|
}),
|
|
1803
1821
|
style: {
|
|
1804
|
-
background:
|
|
1822
|
+
background: x
|
|
1805
1823
|
},
|
|
1806
1824
|
children: a.t("sheets-table.firstLine")
|
|
1807
1825
|
}
|
|
1808
1826
|
),
|
|
1809
1827
|
/* @__PURE__ */ o(
|
|
1810
|
-
|
|
1828
|
+
Ee,
|
|
1811
1829
|
{
|
|
1812
1830
|
overlay: /* @__PURE__ */ o("div", { className: "univer-p-2", children: /* @__PURE__ */ o(
|
|
1813
|
-
|
|
1831
|
+
Xe,
|
|
1814
1832
|
{
|
|
1815
|
-
value:
|
|
1816
|
-
onChange: (
|
|
1833
|
+
value: x,
|
|
1834
|
+
onChange: (p) => {
|
|
1817
1835
|
ee(c.getTableStyleId(), {
|
|
1818
1836
|
firstRowStyle: {
|
|
1819
1837
|
bg: {
|
|
1820
|
-
rgb:
|
|
1838
|
+
rgb: p
|
|
1821
1839
|
},
|
|
1822
1840
|
cl: {
|
|
1823
|
-
rgb: new
|
|
1841
|
+
rgb: new de(p).isDark() ? "#fff" : "#000"
|
|
1824
1842
|
}
|
|
1825
1843
|
}
|
|
1826
1844
|
});
|
|
1827
1845
|
}
|
|
1828
1846
|
}
|
|
1829
1847
|
) }),
|
|
1830
|
-
children: /* @__PURE__ */
|
|
1848
|
+
children: /* @__PURE__ */ w(
|
|
1831
1849
|
"div",
|
|
1832
1850
|
{
|
|
1833
|
-
className:
|
|
1851
|
+
className: P("univer-flex univer-cursor-pointer univer-items-center univer-gap-2 univer-rounded-sm univer-bg-white univer-p-1", H),
|
|
1834
1852
|
children: [
|
|
1835
1853
|
/* @__PURE__ */ o(
|
|
1836
1854
|
"div",
|
|
1837
1855
|
{
|
|
1838
|
-
className:
|
|
1839
|
-
style: { background:
|
|
1856
|
+
className: P("univer-h-4 univer-w-4 univer-rounded-lg univer-bg-gray-400", H),
|
|
1857
|
+
style: { background: x }
|
|
1840
1858
|
}
|
|
1841
1859
|
),
|
|
1842
|
-
/* @__PURE__ */ o(
|
|
1860
|
+
/* @__PURE__ */ o(je, { className: "univer-h-2 univer-w-2" })
|
|
1843
1861
|
]
|
|
1844
1862
|
}
|
|
1845
1863
|
)
|
|
1846
1864
|
}
|
|
1847
1865
|
)
|
|
1848
1866
|
] }),
|
|
1849
|
-
/* @__PURE__ */
|
|
1867
|
+
/* @__PURE__ */ w("div", { className: "univer-flex univer-h-9 univer-gap-2", children: [
|
|
1850
1868
|
/* @__PURE__ */ o(
|
|
1851
1869
|
"div",
|
|
1852
1870
|
{
|
|
1853
|
-
className:
|
|
1871
|
+
className: P("univer-box-border univer-h-full univer-w-52 univer-rounded-sm univer-text-center univer-leading-9", H, {
|
|
1854
1872
|
"univer-text-white": ue,
|
|
1855
1873
|
"univer-text-gray-900": !ue
|
|
1856
1874
|
}),
|
|
1857
1875
|
style: {
|
|
1858
|
-
background:
|
|
1876
|
+
background: y
|
|
1859
1877
|
},
|
|
1860
1878
|
children: a.t("sheets-table.secondLine")
|
|
1861
1879
|
}
|
|
1862
1880
|
),
|
|
1863
1881
|
/* @__PURE__ */ o(
|
|
1864
|
-
|
|
1882
|
+
Ee,
|
|
1865
1883
|
{
|
|
1866
1884
|
overlay: /* @__PURE__ */ o("div", { className: "univer-p-2", children: /* @__PURE__ */ o(
|
|
1867
|
-
|
|
1885
|
+
Xe,
|
|
1868
1886
|
{
|
|
1869
|
-
value:
|
|
1870
|
-
onChange: (
|
|
1887
|
+
value: y,
|
|
1888
|
+
onChange: (p) => ee(c.getTableStyleId(), {
|
|
1871
1889
|
secondRowStyle: {
|
|
1872
1890
|
bg: {
|
|
1873
|
-
rgb:
|
|
1891
|
+
rgb: p
|
|
1874
1892
|
},
|
|
1875
1893
|
cl: {
|
|
1876
|
-
rgb: new
|
|
1894
|
+
rgb: new de(p).isDark() ? "#fff" : "#000"
|
|
1877
1895
|
}
|
|
1878
1896
|
}
|
|
1879
1897
|
})
|
|
1880
1898
|
}
|
|
1881
1899
|
) }),
|
|
1882
|
-
children: /* @__PURE__ */
|
|
1900
|
+
children: /* @__PURE__ */ w(
|
|
1883
1901
|
"div",
|
|
1884
1902
|
{
|
|
1885
|
-
className:
|
|
1903
|
+
className: P("univer-flex univer-cursor-pointer univer-items-center univer-gap-2 univer-rounded-sm univer-bg-white univer-p-1", H),
|
|
1886
1904
|
children: [
|
|
1887
1905
|
/* @__PURE__ */ o(
|
|
1888
1906
|
"div",
|
|
1889
1907
|
{
|
|
1890
|
-
className:
|
|
1891
|
-
style: { background:
|
|
1908
|
+
className: P("univer-h-4 univer-w-4 univer-rounded-lg univer-bg-gray-400", H),
|
|
1909
|
+
style: { background: y }
|
|
1892
1910
|
}
|
|
1893
1911
|
),
|
|
1894
|
-
/* @__PURE__ */ o(
|
|
1912
|
+
/* @__PURE__ */ o(je, { className: "univer-h-2 univer-w-2" })
|
|
1895
1913
|
]
|
|
1896
1914
|
}
|
|
1897
1915
|
)
|
|
1898
1916
|
}
|
|
1899
1917
|
)
|
|
1900
1918
|
] }),
|
|
1901
|
-
/* @__PURE__ */
|
|
1919
|
+
/* @__PURE__ */ w("div", { className: "univer-flex univer-h-9 univer-gap-2", children: [
|
|
1902
1920
|
/* @__PURE__ */ o(
|
|
1903
1921
|
"div",
|
|
1904
1922
|
{
|
|
1905
|
-
className:
|
|
1923
|
+
className: P("univer-box-border univer-h-full univer-w-52 univer-rounded-sm univer-text-center univer-leading-9", H, {
|
|
1906
1924
|
"univer-text-white": b,
|
|
1907
1925
|
"univer-text-gray-900": !b
|
|
1908
1926
|
}),
|
|
1909
1927
|
style: {
|
|
1910
|
-
background:
|
|
1928
|
+
background: m
|
|
1911
1929
|
},
|
|
1912
1930
|
children: a.t("sheets-table.footer")
|
|
1913
1931
|
}
|
|
1914
1932
|
),
|
|
1915
1933
|
/* @__PURE__ */ o(
|
|
1916
|
-
|
|
1934
|
+
Ee,
|
|
1917
1935
|
{
|
|
1918
1936
|
overlay: /* @__PURE__ */ o("div", { className: "univer-p-2", children: /* @__PURE__ */ o(
|
|
1919
|
-
|
|
1937
|
+
Xe,
|
|
1920
1938
|
{
|
|
1921
|
-
value:
|
|
1922
|
-
onChange: (
|
|
1923
|
-
const
|
|
1939
|
+
value: m,
|
|
1940
|
+
onChange: (p) => {
|
|
1941
|
+
const T = Ot("lastRowStyle", {
|
|
1924
1942
|
bg: {
|
|
1925
|
-
rgb:
|
|
1943
|
+
rgb: p
|
|
1926
1944
|
},
|
|
1927
1945
|
cl: {
|
|
1928
|
-
rgb: new
|
|
1946
|
+
rgb: new de(p).isDark() ? "#fff" : "#000"
|
|
1929
1947
|
}
|
|
1930
1948
|
});
|
|
1931
|
-
ee(c.getTableStyleId(), { lastRowStyle:
|
|
1949
|
+
ee(c.getTableStyleId(), { lastRowStyle: T });
|
|
1932
1950
|
}
|
|
1933
1951
|
}
|
|
1934
1952
|
) }),
|
|
1935
|
-
children: /* @__PURE__ */
|
|
1953
|
+
children: /* @__PURE__ */ w(
|
|
1936
1954
|
"div",
|
|
1937
1955
|
{
|
|
1938
|
-
className:
|
|
1956
|
+
className: P("univer-flex univer-cursor-pointer univer-items-center univer-gap-2 univer-rounded-sm univer-bg-white univer-p-1", H),
|
|
1939
1957
|
children: [
|
|
1940
1958
|
/* @__PURE__ */ o(
|
|
1941
1959
|
"div",
|
|
1942
1960
|
{
|
|
1943
|
-
className:
|
|
1944
|
-
style: { background:
|
|
1961
|
+
className: P("univer-h-4 univer-w-4 univer-rounded-lg univer-bg-gray-400", H),
|
|
1962
|
+
style: { background: m }
|
|
1945
1963
|
}
|
|
1946
1964
|
),
|
|
1947
|
-
/* @__PURE__ */ o(
|
|
1965
|
+
/* @__PURE__ */ o(je, { className: "univer-h-2 univer-w-2" })
|
|
1948
1966
|
]
|
|
1949
1967
|
}
|
|
1950
1968
|
)
|
|
@@ -1955,165 +1973,165 @@ const ki = (t) => {
|
|
|
1955
1973
|
] })
|
|
1956
1974
|
] })
|
|
1957
1975
|
] });
|
|
1958
|
-
},
|
|
1959
|
-
function
|
|
1976
|
+
}, In = "sheet.table.context-insert_menu-id", yn = "sheet.table.context-remove_menu-id";
|
|
1977
|
+
function ki(t) {
|
|
1960
1978
|
return {
|
|
1961
|
-
id:
|
|
1962
|
-
type:
|
|
1963
|
-
icon:
|
|
1979
|
+
id: Nt.id,
|
|
1980
|
+
type: ye.BUTTON,
|
|
1981
|
+
icon: hn,
|
|
1964
1982
|
tooltip: "sheets-table.title",
|
|
1965
1983
|
title: "sheets-table.title",
|
|
1966
|
-
hidden$:
|
|
1967
|
-
disabled$:
|
|
1984
|
+
hidden$: vr(t, Ze.UNIVER_SHEET),
|
|
1985
|
+
disabled$: lr(t, {}, !0)
|
|
1968
1986
|
};
|
|
1969
1987
|
}
|
|
1970
|
-
function
|
|
1988
|
+
function Pi(t) {
|
|
1971
1989
|
return {
|
|
1972
|
-
id:
|
|
1973
|
-
type:
|
|
1990
|
+
id: In,
|
|
1991
|
+
type: ye.SUBITEMS,
|
|
1974
1992
|
icon: "InsertDoubleIcon",
|
|
1975
1993
|
title: "sheets-table.insert.main",
|
|
1976
|
-
hidden$:
|
|
1994
|
+
hidden$: Rn(t)
|
|
1977
1995
|
};
|
|
1978
1996
|
}
|
|
1979
|
-
function
|
|
1997
|
+
function Di(t) {
|
|
1980
1998
|
return {
|
|
1981
|
-
id:
|
|
1982
|
-
type:
|
|
1999
|
+
id: yn,
|
|
2000
|
+
type: ye.SUBITEMS,
|
|
1983
2001
|
icon: "ReduceDoubleIcon",
|
|
1984
2002
|
title: "sheets-table.remove.main",
|
|
1985
|
-
hidden$:
|
|
2003
|
+
hidden$: Rn(t)
|
|
1986
2004
|
};
|
|
1987
2005
|
}
|
|
1988
|
-
function
|
|
2006
|
+
function Bi(t) {
|
|
1989
2007
|
return {
|
|
1990
|
-
id:
|
|
1991
|
-
type:
|
|
2008
|
+
id: Jt.id,
|
|
2009
|
+
type: ye.BUTTON,
|
|
1992
2010
|
title: "sheets-table.insert.row",
|
|
1993
|
-
hidden$:
|
|
2011
|
+
hidden$: Mn(t)
|
|
1994
2012
|
};
|
|
1995
2013
|
}
|
|
1996
|
-
function
|
|
2014
|
+
function Fi(t) {
|
|
1997
2015
|
return {
|
|
1998
|
-
id:
|
|
2016
|
+
id: Kt.id,
|
|
1999
2017
|
title: "sheets-table.insert.col",
|
|
2000
|
-
type:
|
|
2018
|
+
type: ye.BUTTON
|
|
2001
2019
|
};
|
|
2002
2020
|
}
|
|
2003
|
-
function
|
|
2021
|
+
function Hi(t) {
|
|
2004
2022
|
return {
|
|
2005
|
-
id:
|
|
2006
|
-
type:
|
|
2023
|
+
id: zt.id,
|
|
2024
|
+
type: ye.BUTTON,
|
|
2007
2025
|
title: "sheets-table.remove.row",
|
|
2008
|
-
hidden$:
|
|
2026
|
+
hidden$: Mn(t)
|
|
2009
2027
|
};
|
|
2010
2028
|
}
|
|
2011
|
-
function
|
|
2029
|
+
function Vi(t) {
|
|
2012
2030
|
return {
|
|
2013
|
-
id:
|
|
2031
|
+
id: Xt.id,
|
|
2014
2032
|
title: "sheets-table.remove.col",
|
|
2015
|
-
type:
|
|
2033
|
+
type: ye.BUTTON
|
|
2016
2034
|
};
|
|
2017
2035
|
}
|
|
2018
|
-
function
|
|
2019
|
-
const e = t.get(
|
|
2020
|
-
return t.get(
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2036
|
+
function Rn(t) {
|
|
2037
|
+
const e = t.get(ut);
|
|
2038
|
+
return t.get(pe).getCurrentTypeOfUnit$(Ze.UNIVER_SHEET).pipe(
|
|
2039
|
+
we((i) => i ? i.activeSheet$.pipe(
|
|
2040
|
+
we((a) => a ? e.selectionMoveEnd$.pipe(
|
|
2041
|
+
we((s) => {
|
|
2024
2042
|
if (!s.length || s.length > 1) return J(!0);
|
|
2025
|
-
const d = s[0].range, u = t.get(
|
|
2043
|
+
const d = s[0].range, u = t.get(en).getContainerTableWithRange(i.getUnitId(), a.getSheetId(), d);
|
|
2026
2044
|
return J(!u);
|
|
2027
2045
|
})
|
|
2028
2046
|
) : J(!0))
|
|
2029
2047
|
) : J(!0))
|
|
2030
2048
|
);
|
|
2031
2049
|
}
|
|
2032
|
-
function
|
|
2033
|
-
const e = t.get(
|
|
2034
|
-
return t.get(
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2050
|
+
function Mn(t) {
|
|
2051
|
+
const e = t.get(ut);
|
|
2052
|
+
return t.get(pe).getCurrentTypeOfUnit$(Ze.UNIVER_SHEET).pipe(
|
|
2053
|
+
we((i) => i ? i.activeSheet$.pipe(
|
|
2054
|
+
we((a) => a ? e.selectionMoveEnd$.pipe(
|
|
2055
|
+
we((s) => {
|
|
2038
2056
|
if (!s.length || s.length > 1) return J(!0);
|
|
2039
|
-
const d = s[0].range, u = t.get(
|
|
2057
|
+
const d = s[0].range, u = t.get(en).getContainerTableWithRange(i.getUnitId(), a.getSheetId(), d);
|
|
2040
2058
|
if (!u)
|
|
2041
2059
|
return J(!0);
|
|
2042
|
-
const
|
|
2043
|
-
return d.startRow ===
|
|
2060
|
+
const v = u.getRange();
|
|
2061
|
+
return d.startRow === v.startRow ? J(!0) : J(!1);
|
|
2044
2062
|
})
|
|
2045
2063
|
) : J(!0))
|
|
2046
2064
|
) : J(!0))
|
|
2047
2065
|
);
|
|
2048
2066
|
}
|
|
2049
|
-
const
|
|
2050
|
-
[
|
|
2051
|
-
[
|
|
2067
|
+
const Ai = {
|
|
2068
|
+
[mr.ORGANIZATION]: {
|
|
2069
|
+
[Nt.id]: {
|
|
2052
2070
|
order: 0,
|
|
2053
|
-
menuItemFactory:
|
|
2071
|
+
menuItemFactory: ki
|
|
2054
2072
|
}
|
|
2055
2073
|
},
|
|
2056
|
-
[
|
|
2057
|
-
[
|
|
2058
|
-
[
|
|
2074
|
+
[gr.MAIN_AREA]: {
|
|
2075
|
+
[br.LAYOUT]: {
|
|
2076
|
+
[In]: {
|
|
2059
2077
|
order: 5,
|
|
2060
|
-
menuItemFactory:
|
|
2061
|
-
[
|
|
2078
|
+
menuItemFactory: Pi,
|
|
2079
|
+
[Jt.id]: {
|
|
2062
2080
|
order: 1,
|
|
2063
|
-
menuItemFactory:
|
|
2081
|
+
menuItemFactory: Bi
|
|
2064
2082
|
},
|
|
2065
|
-
[
|
|
2083
|
+
[Kt.id]: {
|
|
2066
2084
|
order: 2,
|
|
2067
|
-
menuItemFactory:
|
|
2085
|
+
menuItemFactory: Fi
|
|
2068
2086
|
}
|
|
2069
2087
|
},
|
|
2070
|
-
[
|
|
2088
|
+
[yn]: {
|
|
2071
2089
|
order: 6,
|
|
2072
|
-
menuItemFactory:
|
|
2073
|
-
[
|
|
2090
|
+
menuItemFactory: Di,
|
|
2091
|
+
[zt.id]: {
|
|
2074
2092
|
order: 1,
|
|
2075
|
-
menuItemFactory:
|
|
2093
|
+
menuItemFactory: Hi
|
|
2076
2094
|
},
|
|
2077
|
-
[
|
|
2095
|
+
[Xt.id]: {
|
|
2078
2096
|
order: 2,
|
|
2079
|
-
menuItemFactory:
|
|
2097
|
+
menuItemFactory: Vi
|
|
2080
2098
|
}
|
|
2081
2099
|
}
|
|
2082
2100
|
}
|
|
2083
2101
|
}
|
|
2084
2102
|
};
|
|
2085
|
-
var
|
|
2086
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
2103
|
+
var Ui = Object.getOwnPropertyDescriptor, Wi = (t, e, n, r) => {
|
|
2104
|
+
for (var i = r > 1 ? void 0 : r ? Ui(e, n) : e, a = t.length - 1, s; a >= 0; a--)
|
|
2087
2105
|
(s = t[a]) && (i = s(i) || i);
|
|
2088
2106
|
return i;
|
|
2089
|
-
},
|
|
2090
|
-
let
|
|
2107
|
+
}, Wt = (t, e) => (n, r) => e(n, r, t);
|
|
2108
|
+
let at = class extends Oe {
|
|
2091
2109
|
constructor(t, e) {
|
|
2092
2110
|
super(), this._componentManager = t, this._menuManagerService = e, this._initComponents(), this._initMenu();
|
|
2093
2111
|
}
|
|
2094
2112
|
_initComponents() {
|
|
2095
2113
|
[
|
|
2096
|
-
[
|
|
2097
|
-
[
|
|
2098
|
-
[
|
|
2114
|
+
[hn, _n],
|
|
2115
|
+
[Ne, $i],
|
|
2116
|
+
[vn, Oi]
|
|
2099
2117
|
].forEach(([t, e]) => {
|
|
2100
2118
|
this.disposeWithMe(this._componentManager.register(t, e));
|
|
2101
2119
|
});
|
|
2102
2120
|
}
|
|
2103
2121
|
_initMenu() {
|
|
2104
|
-
this._menuManagerService.mergeMenu(
|
|
2122
|
+
this._menuManagerService.mergeMenu(Ai);
|
|
2105
2123
|
}
|
|
2106
2124
|
};
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
],
|
|
2111
|
-
var
|
|
2112
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
2125
|
+
at = Wi([
|
|
2126
|
+
Wt(0, N(tn)),
|
|
2127
|
+
Wt(1, N(pr))
|
|
2128
|
+
], at);
|
|
2129
|
+
var ji = Object.getOwnPropertyDescriptor, Zi = (t, e, n, r) => {
|
|
2130
|
+
for (var i = r > 1 ? void 0 : r ? ji(e, n) : e, a = t.length - 1, s; a >= 0; a--)
|
|
2113
2131
|
(s = t[a]) && (i = s(i) || i);
|
|
2114
2132
|
return i;
|
|
2115
|
-
},
|
|
2116
|
-
let
|
|
2133
|
+
}, nt = (t, e) => (n, r) => e(n, r, t);
|
|
2134
|
+
let Tt = class extends Qt {
|
|
2117
2135
|
constructor(t, e, n, r, i) {
|
|
2118
2136
|
super(), this._context = t, this._injector = e, this._sheetSkeletonManagerService = n, this._tableManager = r, this._sheetTableThemeUIController = i, this._initListener();
|
|
2119
2137
|
}
|
|
@@ -2129,7 +2147,7 @@ let wt = class extends Gt {
|
|
|
2129
2147
|
_initListener() {
|
|
2130
2148
|
const t = this._tableManager, e = this._dirtySkeleton.bind(this);
|
|
2131
2149
|
this.disposeWithMe(
|
|
2132
|
-
|
|
2150
|
+
It(
|
|
2133
2151
|
t.tableAdd$,
|
|
2134
2152
|
t.tableDelete$,
|
|
2135
2153
|
t.tableNameChanged$,
|
|
@@ -2144,18 +2162,18 @@ let wt = class extends Gt {
|
|
|
2144
2162
|
);
|
|
2145
2163
|
}
|
|
2146
2164
|
};
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
],
|
|
2153
|
-
var
|
|
2154
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
2165
|
+
Tt = Zi([
|
|
2166
|
+
nt(1, N(ke)),
|
|
2167
|
+
nt(2, N(ot)),
|
|
2168
|
+
nt(3, N(ne)),
|
|
2169
|
+
nt(4, N(Ie))
|
|
2170
|
+
], Tt);
|
|
2171
|
+
var qi = Object.getOwnPropertyDescriptor, Yi = (t, e, n, r) => {
|
|
2172
|
+
for (var i = r > 1 ? void 0 : r ? qi(e, n) : e, a = t.length - 1, s; a >= 0; a--)
|
|
2155
2173
|
(s = t[a]) && (i = s(i) || i);
|
|
2156
2174
|
return i;
|
|
2157
|
-
},
|
|
2158
|
-
let
|
|
2175
|
+
}, pt = (t, e) => (n, r) => e(n, r, t);
|
|
2176
|
+
let st = class extends Oe {
|
|
2159
2177
|
constructor(t, e, n) {
|
|
2160
2178
|
super(), this._sheetInterceptorService = t, this._univerInstanceService = e, this._tableManager = n, this._initSelectionChange();
|
|
2161
2179
|
}
|
|
@@ -2163,31 +2181,31 @@ let lt = class extends Pe {
|
|
|
2163
2181
|
this.disposeWithMe(
|
|
2164
2182
|
this._sheetInterceptorService.interceptCommand({
|
|
2165
2183
|
getMutations: (t) => {
|
|
2166
|
-
if (t.id ===
|
|
2167
|
-
const e =
|
|
2184
|
+
if (t.id === or.id) {
|
|
2185
|
+
const e = ct(this._univerInstanceService);
|
|
2168
2186
|
if (!e)
|
|
2169
2187
|
return { redos: [], undos: [] };
|
|
2170
2188
|
const n = t.params, { range: r } = n, { unitId: i, subUnitId: a, worksheet: s } = e, d = this._tableManager.getTablesBySubunitId(i, a).find((h) => {
|
|
2171
2189
|
const u = h.getRange();
|
|
2172
|
-
return
|
|
2190
|
+
return be.contains(u, r);
|
|
2173
2191
|
});
|
|
2174
2192
|
if (d) {
|
|
2175
2193
|
const h = d.getRange(), u = {
|
|
2176
2194
|
...h,
|
|
2177
2195
|
startRow: h.startRow + 1
|
|
2178
2196
|
};
|
|
2179
|
-
return
|
|
2197
|
+
return be.equals(h, r) ? { undos: [], redos: [] } : be.equals(u, r) ? {
|
|
2180
2198
|
undos: [],
|
|
2181
2199
|
redos: [
|
|
2182
2200
|
{
|
|
2183
|
-
id:
|
|
2201
|
+
id: Bt.id,
|
|
2184
2202
|
params: {
|
|
2185
2203
|
unitId: i,
|
|
2186
2204
|
subUnitId: a,
|
|
2187
2205
|
selections: [
|
|
2188
2206
|
{
|
|
2189
2207
|
range: h,
|
|
2190
|
-
primary:
|
|
2208
|
+
primary: Dt(h, s)
|
|
2191
2209
|
}
|
|
2192
2210
|
]
|
|
2193
2211
|
}
|
|
@@ -2197,14 +2215,14 @@ let lt = class extends Pe {
|
|
|
2197
2215
|
undos: [],
|
|
2198
2216
|
redos: [
|
|
2199
2217
|
{
|
|
2200
|
-
id:
|
|
2218
|
+
id: Bt.id,
|
|
2201
2219
|
params: {
|
|
2202
2220
|
unitId: i,
|
|
2203
2221
|
subUnitId: a,
|
|
2204
2222
|
selections: [
|
|
2205
2223
|
{
|
|
2206
2224
|
range: u,
|
|
2207
|
-
primary:
|
|
2225
|
+
primary: Dt(u, s)
|
|
2208
2226
|
}
|
|
2209
2227
|
]
|
|
2210
2228
|
}
|
|
@@ -2219,42 +2237,42 @@ let lt = class extends Pe {
|
|
|
2219
2237
|
);
|
|
2220
2238
|
}
|
|
2221
2239
|
};
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
],
|
|
2227
|
-
var
|
|
2228
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
2240
|
+
st = Yi([
|
|
2241
|
+
pt(0, N(cn)),
|
|
2242
|
+
pt(1, N(pe)),
|
|
2243
|
+
pt(2, N(ne))
|
|
2244
|
+
], st);
|
|
2245
|
+
var Qi = Object.defineProperty, Gi = Object.getOwnPropertyDescriptor, Xi = (t, e, n) => e in t ? Qi(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, zi = (t, e, n, r) => {
|
|
2246
|
+
for (var i = r > 1 ? void 0 : r ? Gi(e, n) : e, a = t.length - 1, s; a >= 0; a--)
|
|
2229
2247
|
(s = t[a]) && (i = s(i) || i);
|
|
2230
2248
|
return i;
|
|
2231
|
-
},
|
|
2232
|
-
let
|
|
2233
|
-
constructor(t =
|
|
2249
|
+
}, rt = (t, e) => (n, r) => e(n, r, t), xn = (t, e, n) => Xi(t, typeof e != "symbol" ? e + "" : e, n);
|
|
2250
|
+
let lt = class extends Bn {
|
|
2251
|
+
constructor(t = At, e, n, r, i) {
|
|
2234
2252
|
super(), this._config = t, this._injector = e, this._commandService = n, this._configService = r, this._renderManagerService = i;
|
|
2235
|
-
const { menu: a, ...s } =
|
|
2253
|
+
const { menu: a, ...s } = Fn(
|
|
2236
2254
|
{},
|
|
2237
|
-
|
|
2255
|
+
At,
|
|
2238
2256
|
this._config
|
|
2239
2257
|
);
|
|
2240
|
-
a && this._configService.setConfig("menu", a, { merge: !0 }), this._configService.setConfig(
|
|
2258
|
+
a && this._configService.setConfig("menu", a, { merge: !0 }), this._configService.setConfig(wn, s), this._initRegisterCommand();
|
|
2241
2259
|
}
|
|
2242
2260
|
onStarting() {
|
|
2243
|
-
|
|
2244
|
-
[ke],
|
|
2261
|
+
Hn(this._injector, [
|
|
2245
2262
|
[$e],
|
|
2246
|
-
[
|
|
2247
|
-
[
|
|
2248
|
-
[
|
|
2263
|
+
[Le],
|
|
2264
|
+
[at],
|
|
2265
|
+
[Ie],
|
|
2266
|
+
[st]
|
|
2249
2267
|
]);
|
|
2250
2268
|
}
|
|
2251
2269
|
onReady() {
|
|
2252
|
-
|
|
2253
|
-
[ke],
|
|
2270
|
+
Vn(this._injector, [
|
|
2254
2271
|
[$e],
|
|
2255
|
-
[
|
|
2256
|
-
[
|
|
2257
|
-
[
|
|
2272
|
+
[Le],
|
|
2273
|
+
[at],
|
|
2274
|
+
[Ie],
|
|
2275
|
+
[st]
|
|
2258
2276
|
]);
|
|
2259
2277
|
}
|
|
2260
2278
|
onRendered() {
|
|
@@ -2262,29 +2280,29 @@ let ot = class extends Fn {
|
|
|
2262
2280
|
}
|
|
2263
2281
|
_registerRenderModules() {
|
|
2264
2282
|
const t = [
|
|
2265
|
-
[
|
|
2266
|
-
[
|
|
2283
|
+
[_t],
|
|
2284
|
+
[Tt]
|
|
2267
2285
|
];
|
|
2268
|
-
this._config.hideAnchor !== !0 && t.push([
|
|
2269
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
2286
|
+
this._config.hideAnchor !== !0 && t.push([it]), t.forEach((e) => {
|
|
2287
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(Ze.UNIVER_SHEET, e));
|
|
2270
2288
|
});
|
|
2271
2289
|
}
|
|
2272
2290
|
_initRegisterCommand() {
|
|
2273
2291
|
[
|
|
2274
|
-
|
|
2275
|
-
|
|
2292
|
+
Ct,
|
|
2293
|
+
Nt
|
|
2276
2294
|
].forEach((t) => this._commandService.registerCommand(t));
|
|
2277
2295
|
}
|
|
2278
2296
|
};
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
],
|
|
2297
|
+
xn(lt, "pluginName", Vr);
|
|
2298
|
+
xn(lt, "type", Ze.UNIVER_SHEET);
|
|
2299
|
+
lt = zi([
|
|
2300
|
+
Dn(er),
|
|
2301
|
+
rt(1, N(ke)),
|
|
2302
|
+
rt(2, N(le)),
|
|
2303
|
+
rt(3, Yt),
|
|
2304
|
+
rt(4, Gt)
|
|
2305
|
+
], lt);
|
|
2288
2306
|
export {
|
|
2289
|
-
|
|
2307
|
+
lt as UniverSheetsTableUIPlugin
|
|
2290
2308
|
};
|