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