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