@univerjs/sheets-table-ui 0.16.1 → 0.17.0
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 +500 -495
- package/lib/index.js +500 -495
- package/lib/types/index.d.ts +1 -1
- package/lib/types/plugin.d.ts +3 -1
- package/lib/umd/index.js +1 -1
- package/package.json +13 -13
- /package/lib/types/{controllers/config.schema.d.ts → config/config.d.ts} +0 -0
- /package/lib/types/{views → menu}/menu.d.ts +0 -0
- /package/lib/types/{controllers/menu.schema.d.ts → menu/schema.d.ts} +0 -0
- /package/lib/types/{controllers → menu}/sheet-table-menu.controller.d.ts +0 -0
package/lib/index.js
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var U = (r, e, t) =>
|
|
4
|
-
import { Inject as N, IUniverInstanceService as pe, ICommandService as te, LocaleService as ne, Disposable as
|
|
5
|
-
import { IRenderManagerService as
|
|
6
|
-
import { TableManager as re, SheetTableService as
|
|
7
|
-
import { SheetCanvasPopManagerService as
|
|
8
|
-
import { useDependency as M, ComponentManager as
|
|
9
|
-
import { startWith as
|
|
10
|
-
import { jsxs as T, jsx as l, Fragment as
|
|
11
|
-
import { Dropdown as Ne, clsx as D, borderClassName as H, CascaderList as
|
|
12
|
-
import { useRef as
|
|
13
|
-
import { SetRangeValuesMutation as
|
|
14
|
-
import { SortRangeCommand as
|
|
15
|
-
import { serializeRange as
|
|
16
|
-
import { RangeSelector as
|
|
17
|
-
const
|
|
1
|
+
var $n = Object.defineProperty;
|
|
2
|
+
var Ln = (r, e, t) => e in r ? $n(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
+
var U = (r, e, t) => Ln(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { Inject as N, IUniverInstanceService as pe, ICommandService as te, LocaleService as ne, Disposable as ke, ObjectMatrix as kn, cellToRange as jt, Rectangle as be, Injector as Pe, IPermissionService as qt, IContextService as It, CommandType as Yt, IConfigService as Qt, ThemeService as Pn, RxDisposable as zt, VerticalAlign as it, InterceptorEffectEnum as On, ErrorService as Dn, ColorKit as he, UniverInstanceType as Qe, DependentOn as Bn, Plugin as Fn, merge as Vn, registerDependencies as Hn, touchDependencies as An } from "@univerjs/core";
|
|
5
|
+
import { IRenderManagerService as Gt, SHEET_VIEWPORT_KEY as Un, convertTransformToOffsetX as Wn, convertTransformToOffsetY as Zn, Rect as $t, Shape as jn } from "@univerjs/engine-render";
|
|
6
|
+
import { TableManager as re, SheetTableService as qn, SetSheetTableFilterCommand as Lt, isConditionFilter as Yn, isManualTableFilter as Qn, TableDateCompareTypeEnum as o, TableStringCompareTypeEnum as Z, TableConditionTypeEnum as F, TableNumberCompareTypeEnum as k, SheetsTableSortStateEnum as Ke, TableColumnFilterTypeEnum as kt, AddSheetTableCommand as zn, SHEET_TABLE_CUSTOM_THEME_PREFIX as Gn, DeleteSheetTableCommand as Xn, SetSheetTableCommand as Ct, SheetsTableButtonStateEnum as Re, processStyleWithBorderStyle as Pt, customEmptyThemeWithBorderStyle as Kn, AddTableThemeCommand as Jn, RemoveTableThemeCommand as er, SheetTableRemoveColCommand as Xt, SheetTableRemoveRowCommand as Kt, SheetTableInsertColCommand as Jt, SheetTableInsertRowCommand as en, SheetsTableController as tn, UniverSheetsTablePlugin as tr } from "@univerjs/sheets-table";
|
|
7
|
+
import { SheetCanvasPopManagerService as nr, SheetSkeletonManagerService as lt, SheetScrollManagerService as rr, SetZoomRatioOperation as ir, SetScrollOperation as ar, getSheetObject as sr, getCoordByCell as or, SelectAllCommand as lr, getCurrentRangeDisable$ as cr } from "@univerjs/sheets-ui";
|
|
8
|
+
import { useDependency as M, ComponentManager as nn, IDialogService as rn, ISidebarService as ur, useObservable as Te, IUIPartsService as dr, BuiltInUIPart as hr, connectInjector as vr, MenuItemType as ye, getMenuHiddenObservable as gr, ContextMenuPosition as br, ContextMenuGroup as mr, RibbonDataGroup as pr, IMenuManagerService as fr } from "@univerjs/ui";
|
|
9
|
+
import { startWith as an, distinctUntilChanged as Cr, Subject as Sr, BehaviorSubject as Ot, merge as yt, filter as _r, debounceTime as Tr, switchMap as we, of as J, map as wr, takeUntil as Ir } from "rxjs";
|
|
10
|
+
import { jsxs as T, jsx as l, Fragment as Rt } from "react/jsx-runtime";
|
|
11
|
+
import { Dropdown as Ne, clsx as D, borderClassName as H, CascaderList as yr, Input as Mt, InputNumber as bt, DatePicker as Rr, DateRangePicker as Mr, Select as xr, Checkbox as Dt, scrollbarClassName as Nr, ButtonGroup as Er, Button as _e, Segmented as $r, ColorPicker as Je } from "@univerjs/design";
|
|
12
|
+
import { useRef as Lr, createElement as ie, forwardRef as le, useState as q, useMemo as sn, useCallback as Bt, useEffect as on } from "react";
|
|
13
|
+
import { SetRangeValuesMutation as kr, WorkbookEditablePermission as ln, getSheetCommandTarget as ct, SheetsSelectionsService as ut, isSingleCellSelection as Pr, expandToContinuousRange as Or, SetRangeThemeMutation as cn, WorkbookPermissionService as un, SheetRangeThemeModel as dn, SheetInterceptorService as hn, SetVerticalTextAlignCommand as Dr, INTERCEPTOR_POINT as Br, getPrimaryForRange as Ft, SetSelectionsOperation as Vt, RangeThemeStyle as Fr } from "@univerjs/sheets";
|
|
14
|
+
import { SortRangeCommand as Vr, SortType as Ht } from "@univerjs/sheets-sort";
|
|
15
|
+
import { serializeRange as At, deserializeRangeWithSheet as Hr } from "@univerjs/engine-formula";
|
|
16
|
+
import { RangeSelector as Ar } from "@univerjs/sheets-formula-ui";
|
|
17
|
+
const Ur = "@univerjs/sheets-table-ui", Wr = "0.17.0", vn = {
|
|
18
|
+
name: Ur,
|
|
19
|
+
version: Wr
|
|
20
|
+
}, Zr = "SHEET_TABLE_UI_PLUGIN", ge = "SHEETS_TABLE_FILTER_PANEL_OPENED_KEY", jr = "UNIVER_SHEET_Table_FILTER_PANEL_ID", gn = "TABLE_TOOLBAR_BUTTON", xe = "TABLE_SELECTOR_DIALOG", qr = "SHEET_TABLE_THEME_PANEL_ID", bn = "SHEET_TABLE_THEME_PANEL", mt = "table-custom-", Yr = "table-default-", ve = "rgb(255, 255, 255)", G = "none", et = "1px solid rgb(var(--grey-200))";
|
|
18
21
|
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 =
|
|
20
|
-
return
|
|
22
|
+
const { icon: t, id: n, className: i, extend: a, ...s } = e, c = `univerjs-icon univerjs-icon-${n} ${i || ""}`.trim(), u = Lr(`_${Gr()}`);
|
|
23
|
+
return mn(t, `${n}`, {
|
|
21
24
|
defIds: t.defIds,
|
|
22
25
|
idSuffix: u.current
|
|
23
26
|
}, {
|
|
@@ -26,14 +29,14 @@ function ae({ ref: r, ...e }) {
|
|
|
26
29
|
...s
|
|
27
30
|
}, a);
|
|
28
31
|
}
|
|
29
|
-
function
|
|
32
|
+
function mn(r, e, t, n, i) {
|
|
30
33
|
return ie(r.tag, {
|
|
31
34
|
key: e,
|
|
32
|
-
...
|
|
35
|
+
...Qr(r, t, i),
|
|
33
36
|
...n
|
|
34
|
-
}, (
|
|
37
|
+
}, (zr(r, t).children || []).map((a, s) => mn(a, `${e}-${r.tag}-${s}`, t, void 0, i)));
|
|
35
38
|
}
|
|
36
|
-
function
|
|
39
|
+
function Qr(r, e, t) {
|
|
37
40
|
const n = { ...r.attrs };
|
|
38
41
|
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
42
|
a === "mask" && typeof s == "string" && (n[a] = s.replace(/url\(#(.*)\)/, `url(#$1${e.idSuffix})`));
|
|
@@ -43,7 +46,7 @@ function jr(r, e, t) {
|
|
|
43
46
|
typeof s == "string" && (n[a] = s.replace(/url\(#(.*)\)/, `url(#$1${e.idSuffix})`));
|
|
44
47
|
})), n;
|
|
45
48
|
}
|
|
46
|
-
function
|
|
49
|
+
function zr(r, e) {
|
|
47
50
|
var n;
|
|
48
51
|
const { defIds: t } = e;
|
|
49
52
|
return !t || t.length === 0 ? r : r.tag === "defs" && ((n = r.children) != null && n.length) ? {
|
|
@@ -57,11 +60,11 @@ function qr(r, e) {
|
|
|
57
60
|
} : i)
|
|
58
61
|
} : r;
|
|
59
62
|
}
|
|
60
|
-
function
|
|
63
|
+
function Gr() {
|
|
61
64
|
return Math.random().toString(36).substring(2, 8);
|
|
62
65
|
}
|
|
63
66
|
ae.displayName = "UniverIcon";
|
|
64
|
-
const
|
|
67
|
+
const Xr = {
|
|
65
68
|
tag: "svg",
|
|
66
69
|
attrs: {
|
|
67
70
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -97,15 +100,15 @@ const Qr = {
|
|
|
97
100
|
}
|
|
98
101
|
}
|
|
99
102
|
]
|
|
100
|
-
},
|
|
103
|
+
}, pn = le(function(e, t) {
|
|
101
104
|
return ie(ae, Object.assign({}, e, {
|
|
102
105
|
id: "ascending-icon",
|
|
103
106
|
ref: t,
|
|
104
|
-
icon:
|
|
107
|
+
icon: Xr
|
|
105
108
|
}));
|
|
106
109
|
});
|
|
107
|
-
|
|
108
|
-
const
|
|
110
|
+
pn.displayName = "AscendingIcon";
|
|
111
|
+
const Kr = {
|
|
109
112
|
tag: "svg",
|
|
110
113
|
attrs: {
|
|
111
114
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -146,15 +149,15 @@ const zr = {
|
|
|
146
149
|
}
|
|
147
150
|
}
|
|
148
151
|
]
|
|
149
|
-
},
|
|
152
|
+
}, fn = le(function(e, t) {
|
|
150
153
|
return ie(ae, Object.assign({}, e, {
|
|
151
154
|
id: "delete-icon",
|
|
152
155
|
ref: t,
|
|
153
|
-
icon:
|
|
156
|
+
icon: Kr
|
|
154
157
|
}));
|
|
155
158
|
});
|
|
156
|
-
|
|
157
|
-
const
|
|
159
|
+
fn.displayName = "DeleteIcon";
|
|
160
|
+
const Jr = {
|
|
158
161
|
tag: "svg",
|
|
159
162
|
attrs: {
|
|
160
163
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -190,15 +193,15 @@ const Gr = {
|
|
|
190
193
|
}
|
|
191
194
|
}
|
|
192
195
|
]
|
|
193
|
-
},
|
|
196
|
+
}, Cn = le(function(e, t) {
|
|
194
197
|
return ie(ae, Object.assign({}, e, {
|
|
195
198
|
id: "descending-icon",
|
|
196
199
|
ref: t,
|
|
197
|
-
icon:
|
|
200
|
+
icon: Jr
|
|
198
201
|
}));
|
|
199
202
|
});
|
|
200
|
-
|
|
201
|
-
const
|
|
203
|
+
Cn.displayName = "DescendingIcon";
|
|
204
|
+
const ei = {
|
|
202
205
|
tag: "svg",
|
|
203
206
|
attrs: {
|
|
204
207
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -214,15 +217,15 @@ const Xr = {
|
|
|
214
217
|
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
218
|
}
|
|
216
219
|
}]
|
|
217
|
-
},
|
|
220
|
+
}, qe = le(function(e, t) {
|
|
218
221
|
return ie(ae, Object.assign({}, e, {
|
|
219
222
|
id: "dropdown-icon",
|
|
220
223
|
ref: t,
|
|
221
|
-
icon:
|
|
224
|
+
icon: ei
|
|
222
225
|
}));
|
|
223
226
|
});
|
|
224
|
-
|
|
225
|
-
const
|
|
227
|
+
qe.displayName = "DropdownIcon";
|
|
228
|
+
const ti = {
|
|
226
229
|
tag: "svg",
|
|
227
230
|
attrs: {
|
|
228
231
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -240,15 +243,15 @@ const Kr = {
|
|
|
240
243
|
clipRule: "evenodd"
|
|
241
244
|
}
|
|
242
245
|
}]
|
|
243
|
-
},
|
|
246
|
+
}, Sn = le(function(e, t) {
|
|
244
247
|
return ie(ae, Object.assign({}, e, {
|
|
245
248
|
id: "grid-outline-icon",
|
|
246
249
|
ref: t,
|
|
247
|
-
icon:
|
|
250
|
+
icon: ti
|
|
248
251
|
}));
|
|
249
252
|
});
|
|
250
|
-
|
|
251
|
-
const
|
|
253
|
+
Sn.displayName = "GridOutlineIcon";
|
|
254
|
+
const ni = {
|
|
252
255
|
tag: "svg",
|
|
253
256
|
attrs: {
|
|
254
257
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -266,15 +269,15 @@ const Jr = {
|
|
|
266
269
|
clipRule: "evenodd"
|
|
267
270
|
}
|
|
268
271
|
}]
|
|
269
|
-
},
|
|
272
|
+
}, xt = le(function(e, t) {
|
|
270
273
|
return ie(ae, Object.assign({}, e, {
|
|
271
274
|
id: "more-down-icon",
|
|
272
275
|
ref: t,
|
|
273
|
-
icon:
|
|
276
|
+
icon: ni
|
|
274
277
|
}));
|
|
275
278
|
});
|
|
276
|
-
|
|
277
|
-
const
|
|
279
|
+
xt.displayName = "MoreDownIcon";
|
|
280
|
+
const ri = {
|
|
278
281
|
tag: "svg",
|
|
279
282
|
attrs: {
|
|
280
283
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -298,15 +301,15 @@ const ei = {
|
|
|
298
301
|
clipRule: "evenodd"
|
|
299
302
|
}
|
|
300
303
|
}]
|
|
301
|
-
},
|
|
304
|
+
}, _n = le(function(e, t) {
|
|
302
305
|
return ie(ae, Object.assign({}, e, {
|
|
303
306
|
id: "rename-icon",
|
|
304
307
|
ref: t,
|
|
305
|
-
icon:
|
|
308
|
+
icon: ri
|
|
306
309
|
}));
|
|
307
310
|
});
|
|
308
|
-
|
|
309
|
-
const
|
|
311
|
+
_n.displayName = "RenameIcon";
|
|
312
|
+
const ii = {
|
|
310
313
|
tag: "svg",
|
|
311
314
|
attrs: {
|
|
312
315
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -324,15 +327,15 @@ const ti = {
|
|
|
324
327
|
clipRule: "evenodd"
|
|
325
328
|
}
|
|
326
329
|
}]
|
|
327
|
-
},
|
|
330
|
+
}, Tn = le(function(e, t) {
|
|
328
331
|
return ie(ae, Object.assign({}, e, {
|
|
329
332
|
id: "table-icon",
|
|
330
333
|
ref: t,
|
|
331
|
-
icon:
|
|
334
|
+
icon: ii
|
|
332
335
|
}));
|
|
333
336
|
});
|
|
334
|
-
|
|
335
|
-
const
|
|
337
|
+
Tn.displayName = "TableIcon";
|
|
338
|
+
const ai = {
|
|
336
339
|
tag: "svg",
|
|
337
340
|
attrs: {
|
|
338
341
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -366,20 +369,20 @@ const ni = {
|
|
|
366
369
|
}
|
|
367
370
|
}
|
|
368
371
|
]
|
|
369
|
-
},
|
|
372
|
+
}, wn = le(function(e, t) {
|
|
370
373
|
return ie(ae, Object.assign({}, e, {
|
|
371
374
|
id: "paint-bucket-double-icon",
|
|
372
375
|
ref: t,
|
|
373
|
-
icon:
|
|
376
|
+
icon: ai
|
|
374
377
|
}));
|
|
375
378
|
});
|
|
376
|
-
|
|
377
|
-
var me = /* @__PURE__ */ ((r) => (r.Items = "items", r.Condition = "condition", r))(me || {}),
|
|
378
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
379
|
+
wn.displayName = "PaintBucketDoubleIcon";
|
|
380
|
+
var me = /* @__PURE__ */ ((r) => (r.Items = "items", r.Condition = "condition", r))(me || {}), si = Object.getOwnPropertyDescriptor, oi = (r, e, t, n) => {
|
|
381
|
+
for (var i = n > 1 ? void 0 : n ? si(e, t) : e, a = r.length - 1, s; a >= 0; a--)
|
|
379
382
|
(s = r[a]) && (i = s(i) || i);
|
|
380
383
|
return i;
|
|
381
|
-
},
|
|
382
|
-
let Ee = class extends
|
|
384
|
+
}, Ze = (r, e) => (t, n) => e(t, n, r);
|
|
385
|
+
let Ee = class extends ke {
|
|
383
386
|
constructor(e, t, n, i, a) {
|
|
384
387
|
super();
|
|
385
388
|
U(this, "_itemsCache", /* @__PURE__ */ new Map());
|
|
@@ -387,12 +390,12 @@ let Ee = class extends Le {
|
|
|
387
390
|
}
|
|
388
391
|
_registerTableFilterChangeEvent() {
|
|
389
392
|
this._commandService.onCommandExecuted((e) => {
|
|
390
|
-
if (e.id ===
|
|
393
|
+
if (e.id === kr.id) {
|
|
391
394
|
const { unitId: t, subUnitId: n, cellValue: i } = e.params, a = this._tableManager.getTablesBySubunitId(t, n);
|
|
392
395
|
if (!a.length)
|
|
393
396
|
return;
|
|
394
|
-
new
|
|
395
|
-
const d =
|
|
397
|
+
new kn(i).forValue((c, u, h) => {
|
|
398
|
+
const d = jt(c, u), v = a.find((f) => {
|
|
396
399
|
const w = f.getTableFilterRange();
|
|
397
400
|
return be.intersects(w, d);
|
|
398
401
|
});
|
|
@@ -401,7 +404,7 @@ let Ee = class extends Le {
|
|
|
401
404
|
this._itemsCache.delete(v.getId() + f);
|
|
402
405
|
}
|
|
403
406
|
});
|
|
404
|
-
} else if (e.id ===
|
|
407
|
+
} else if (e.id === Lt.id) {
|
|
405
408
|
const { unitId: t, tableId: n } = e.params, i = this._tableManager.getTable(t, n);
|
|
406
409
|
if (!i)
|
|
407
410
|
return;
|
|
@@ -420,7 +423,7 @@ let Ee = class extends Le {
|
|
|
420
423
|
unitId: e,
|
|
421
424
|
subUnitId: t,
|
|
422
425
|
tableFilter: c,
|
|
423
|
-
currentFilterBy:
|
|
426
|
+
currentFilterBy: Yn(c) ? me.Condition : me.Items,
|
|
424
427
|
tableId: n,
|
|
425
428
|
columnIndex: i - s.startColumn
|
|
426
429
|
};
|
|
@@ -429,7 +432,7 @@ let Ee = class extends Le {
|
|
|
429
432
|
const i = this._tableManager.getTable(e, t), a = [];
|
|
430
433
|
if (i) {
|
|
431
434
|
const s = i.getTableFilterColumn(n);
|
|
432
|
-
s &&
|
|
435
|
+
s && Qn(s) && a.push(...s.values);
|
|
433
436
|
}
|
|
434
437
|
return a;
|
|
435
438
|
}
|
|
@@ -442,7 +445,7 @@ let Ee = class extends Le {
|
|
|
442
445
|
column: n,
|
|
443
446
|
tableFilter: i
|
|
444
447
|
};
|
|
445
|
-
this._commandService.executeCommand(
|
|
448
|
+
this._commandService.executeCommand(Lt.id, s);
|
|
446
449
|
}
|
|
447
450
|
getTableFilterItems(e, t, n, i) {
|
|
448
451
|
var E;
|
|
@@ -469,15 +472,15 @@ let Ee = class extends Le {
|
|
|
469
472
|
return this._itemsCache.set(n + i, { data: f, itemsCountMap: w, allItemsCount: S }), { data: f, itemsCountMap: w, allItemsCount: S };
|
|
470
473
|
}
|
|
471
474
|
};
|
|
472
|
-
Ee =
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
475
|
+
Ee = oi([
|
|
476
|
+
Ze(0, N(re)),
|
|
477
|
+
Ze(1, N(qn)),
|
|
478
|
+
Ze(2, N(pe)),
|
|
479
|
+
Ze(3, te),
|
|
480
|
+
Ze(4, N(ne))
|
|
478
481
|
], Ee);
|
|
479
482
|
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
|
|
483
|
+
function li(r) {
|
|
481
484
|
const t = r.get(ne).t;
|
|
482
485
|
return [
|
|
483
486
|
{
|
|
@@ -656,7 +659,7 @@ function ai(r) {
|
|
|
656
659
|
}
|
|
657
660
|
];
|
|
658
661
|
}
|
|
659
|
-
function
|
|
662
|
+
function ci(r, e) {
|
|
660
663
|
if (!e)
|
|
661
664
|
return [];
|
|
662
665
|
const n = r.get(ne).t;
|
|
@@ -735,7 +738,7 @@ function si(r, e) {
|
|
|
735
738
|
return [];
|
|
736
739
|
}
|
|
737
740
|
}
|
|
738
|
-
const
|
|
741
|
+
const Nt = /* @__PURE__ */ new Set([
|
|
739
742
|
o.Equal,
|
|
740
743
|
o.NotEqual,
|
|
741
744
|
o.After,
|
|
@@ -743,10 +746,10 @@ const xt = /* @__PURE__ */ new Set([
|
|
|
743
746
|
o.Before,
|
|
744
747
|
o.BeforeOrEqual
|
|
745
748
|
]);
|
|
746
|
-
function
|
|
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 :
|
|
749
|
+
function ui(r, e) {
|
|
750
|
+
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 : Nt.has(e) ? j.DatePicker : j.None : j.None : j.None;
|
|
748
751
|
}
|
|
749
|
-
function
|
|
752
|
+
function di(r) {
|
|
750
753
|
if (!r || r.filterType !== "condition")
|
|
751
754
|
return {
|
|
752
755
|
type: F.String,
|
|
@@ -771,7 +774,7 @@ function li(r) {
|
|
|
771
774
|
compare: n,
|
|
772
775
|
info: {}
|
|
773
776
|
};
|
|
774
|
-
if (
|
|
777
|
+
if (Nt.has(n)) {
|
|
775
778
|
let i;
|
|
776
779
|
if (typeof e.expectedValue == "string")
|
|
777
780
|
i = new Date(e.expectedValue);
|
|
@@ -830,9 +833,9 @@ function li(r) {
|
|
|
830
833
|
info: {}
|
|
831
834
|
};
|
|
832
835
|
}
|
|
833
|
-
const
|
|
836
|
+
const hi = (r) => {
|
|
834
837
|
var w, S, E, C, $, I, B, R;
|
|
835
|
-
const { conditionInfo: e, onChange: t } = r, n = M(ne), [i, a] = q(!1), s = M(
|
|
838
|
+
const { conditionInfo: e, onChange: t } = r, n = M(ne), [i, a] = q(!1), s = M(Pe), c = li(s), u = (g, x, y) => {
|
|
836
839
|
t({
|
|
837
840
|
type: x != null ? x : e.type,
|
|
838
841
|
compare: y != null ? y : e.compare,
|
|
@@ -843,11 +846,11 @@ const ci = (r) => {
|
|
|
843
846
|
const x = g[0], y = g[1];
|
|
844
847
|
y && a(!1);
|
|
845
848
|
const m = {};
|
|
846
|
-
x === F.Date ? y === o.Quarter ? m.dateSelect = o.Q1 : y === o.Month ? m.dateSelect = o.M1 :
|
|
847
|
-
}, d =
|
|
849
|
+
x === F.Date ? y === o.Quarter ? m.dateSelect = o.Q1 : y === o.Month ? m.dateSelect = o.M1 : Nt.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);
|
|
850
|
+
}, d = ui(e.type, e.compare);
|
|
848
851
|
let v = "";
|
|
849
852
|
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 =
|
|
853
|
+
const f = ci(s, e.compare);
|
|
851
854
|
return /* @__PURE__ */ T("div", { children: [
|
|
852
855
|
/* @__PURE__ */ l(
|
|
853
856
|
Ne,
|
|
@@ -856,7 +859,7 @@ const ci = (r) => {
|
|
|
856
859
|
open: i,
|
|
857
860
|
onOpenChange: a,
|
|
858
861
|
overlay: /* @__PURE__ */ l(
|
|
859
|
-
|
|
862
|
+
yr,
|
|
860
863
|
{
|
|
861
864
|
value: [e.type, e.compare],
|
|
862
865
|
options: c,
|
|
@@ -871,15 +874,15 @@ const ci = (r) => {
|
|
|
871
874
|
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),
|
|
872
875
|
children: [
|
|
873
876
|
/* @__PURE__ */ l("span", { children: v }),
|
|
874
|
-
/* @__PURE__ */ l(
|
|
877
|
+
/* @__PURE__ */ l(xt, {})
|
|
875
878
|
]
|
|
876
879
|
}
|
|
877
880
|
)
|
|
878
881
|
}
|
|
879
882
|
),
|
|
880
883
|
/* @__PURE__ */ T("div", { className: "univer-mt-3 univer-w-full", children: [
|
|
881
|
-
d === j.Input && /* @__PURE__ */ l(
|
|
882
|
-
|
|
884
|
+
d === j.Input && /* @__PURE__ */ l(Rt, { children: e.type === F.String ? /* @__PURE__ */ l(
|
|
885
|
+
Mt,
|
|
883
886
|
{
|
|
884
887
|
className: "univer-w-full",
|
|
885
888
|
placeholder: "请输入",
|
|
@@ -887,7 +890,7 @@ const ci = (r) => {
|
|
|
887
890
|
onChange: (g) => u({ string: g })
|
|
888
891
|
}
|
|
889
892
|
) : /* @__PURE__ */ l(
|
|
890
|
-
|
|
893
|
+
bt,
|
|
891
894
|
{
|
|
892
895
|
className: "univer-h-7 univer-w-full",
|
|
893
896
|
value: e.info.number,
|
|
@@ -898,7 +901,7 @@ const ci = (r) => {
|
|
|
898
901
|
}
|
|
899
902
|
) }),
|
|
900
903
|
d === j.DatePicker && /* @__PURE__ */ l("div", { id: "univer-table-date-picker-wrapper", children: /* @__PURE__ */ l(
|
|
901
|
-
|
|
904
|
+
Rr,
|
|
902
905
|
{
|
|
903
906
|
className: "univer-w-full",
|
|
904
907
|
value: (w = e.info.date) != null ? w : /* @__PURE__ */ new Date(),
|
|
@@ -906,7 +909,7 @@ const ci = (r) => {
|
|
|
906
909
|
}
|
|
907
910
|
) }),
|
|
908
911
|
d === j.DateRange && /* @__PURE__ */ l("div", { id: "univer-table-date-range-wrapper", children: /* @__PURE__ */ l(
|
|
909
|
-
|
|
912
|
+
Mr,
|
|
910
913
|
{
|
|
911
914
|
className: "univer-w-full",
|
|
912
915
|
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()],
|
|
@@ -917,7 +920,7 @@ const ci = (r) => {
|
|
|
917
920
|
) }),
|
|
918
921
|
d === j.Inputs && /* @__PURE__ */ T("div", { className: "univer-flex univer-items-center univer-gap-2", children: [
|
|
919
922
|
/* @__PURE__ */ l(
|
|
920
|
-
|
|
923
|
+
bt,
|
|
921
924
|
{
|
|
922
925
|
className: "univer-w-full",
|
|
923
926
|
value: (I = e.info.numberRange) == null ? void 0 : I[0],
|
|
@@ -930,7 +933,7 @@ const ci = (r) => {
|
|
|
930
933
|
),
|
|
931
934
|
/* @__PURE__ */ l("span", { children: " - " }),
|
|
932
935
|
/* @__PURE__ */ l(
|
|
933
|
-
|
|
936
|
+
bt,
|
|
934
937
|
{
|
|
935
938
|
className: "univer-w-full",
|
|
936
939
|
value: (B = e.info.numberRange) == null ? void 0 : B[1],
|
|
@@ -943,7 +946,7 @@ const ci = (r) => {
|
|
|
943
946
|
)
|
|
944
947
|
] }),
|
|
945
948
|
d === j.Select && /* @__PURE__ */ l(
|
|
946
|
-
|
|
949
|
+
xr,
|
|
947
950
|
{
|
|
948
951
|
className: "univer-w-full",
|
|
949
952
|
value: (R = e.info.dateSelect) != null ? R : f[0].value,
|
|
@@ -953,18 +956,18 @@ const ci = (r) => {
|
|
|
953
956
|
)
|
|
954
957
|
] })
|
|
955
958
|
] });
|
|
956
|
-
},
|
|
959
|
+
}, vi = (r) => {
|
|
957
960
|
let e = 0;
|
|
958
961
|
return r.forEach((t) => {
|
|
959
962
|
e += t;
|
|
960
963
|
}), e;
|
|
961
964
|
};
|
|
962
|
-
function
|
|
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 :
|
|
965
|
+
function gi(r) {
|
|
966
|
+
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 : vi(v)), $ = !w && a.size > 0, [I, B] = q(""), R = sn(() => I ? d.filter((m) => String(m.title).toLowerCase().includes(I.toLowerCase())) : d, [I, d]), g = Bt(() => {
|
|
964
967
|
w ? (a.clear(), s(new Set(a)), S(!1)) : (R.forEach((m) => {
|
|
965
968
|
a.add(m.title);
|
|
966
969
|
}), s(new Set(a)), S(!0));
|
|
967
|
-
}, [w]), x =
|
|
970
|
+
}, [w]), x = Bt((m) => {
|
|
968
971
|
m === "" ? (S(!0), d.forEach((O) => {
|
|
969
972
|
a.add(O.title);
|
|
970
973
|
}), C(f)) : (a.clear(), S(!1), C(0)), B(m);
|
|
@@ -979,7 +982,7 @@ function di(r) {
|
|
|
979
982
|
a.has(m) ? (a.delete(m), C(E - v.get(m))) : (a.add(m), C(E + v.get(m))), s(new Set(a));
|
|
980
983
|
};
|
|
981
984
|
return /* @__PURE__ */ T("div", { className: "univer-flex univer-h-full univer-flex-col", children: [
|
|
982
|
-
/* @__PURE__ */ l(
|
|
985
|
+
/* @__PURE__ */ l(Mt, { autoFocus: !0, value: I, placeholder: u.t("sheets-table.filter.search-placeholder"), onChange: x }),
|
|
983
986
|
/* @__PURE__ */ l(
|
|
984
987
|
"div",
|
|
985
988
|
{
|
|
@@ -987,10 +990,10 @@ function di(r) {
|
|
|
987
990
|
children: /* @__PURE__ */ l(
|
|
988
991
|
"div",
|
|
989
992
|
{
|
|
990
|
-
className: D("univer-h-40 univer-overflow-y-auto univer-py-1 univer-pl-2",
|
|
993
|
+
className: D("univer-h-40 univer-overflow-y-auto univer-py-1 univer-pl-2", Nr),
|
|
991
994
|
children: /* @__PURE__ */ T("div", { className: "univer-h-full", children: [
|
|
992
995
|
/* @__PURE__ */ l("div", { className: "univer-flex univer-items-center univer-px-2 univer-py-1", children: /* @__PURE__ */ l(
|
|
993
|
-
|
|
996
|
+
Dt,
|
|
994
997
|
{
|
|
995
998
|
indeterminate: $,
|
|
996
999
|
disabled: d.length === 0,
|
|
@@ -1007,7 +1010,7 @@ function di(r) {
|
|
|
1007
1010
|
{
|
|
1008
1011
|
className: "univer-flex univer-items-center univer-px-2 univer-py-1",
|
|
1009
1012
|
children: /* @__PURE__ */ l(
|
|
1010
|
-
|
|
1013
|
+
Dt,
|
|
1011
1014
|
{
|
|
1012
1015
|
checked: w || a.has(m.title),
|
|
1013
1016
|
onChange: () => {
|
|
@@ -1029,28 +1032,28 @@ function di(r) {
|
|
|
1029
1032
|
)
|
|
1030
1033
|
] });
|
|
1031
1034
|
}
|
|
1032
|
-
function
|
|
1035
|
+
function bi() {
|
|
1033
1036
|
var de;
|
|
1034
|
-
const r = M(ne), e =
|
|
1037
|
+
const r = M(ne), e = mi(r), t = M(Ee), n = M(re), i = M(te), a = M(qt), 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(() => {
|
|
1035
1038
|
const b = u.tableFilter;
|
|
1036
|
-
return
|
|
1039
|
+
return di(b);
|
|
1037
1040
|
}), y = n.getTable(h, v);
|
|
1038
1041
|
if (!y) return null;
|
|
1039
1042
|
const m = y.getTableFilters(), O = m.getSortState();
|
|
1040
|
-
O.columnIndex === S && (O.sortState,
|
|
1043
|
+
O.columnIndex === S && (O.sortState, Ke.Asc), O.columnIndex === S && (O.sortState, Ke.Desc);
|
|
1041
1044
|
const L = () => {
|
|
1042
1045
|
s.closeFilterPanel();
|
|
1043
1046
|
}, Y = () => {
|
|
1044
1047
|
L();
|
|
1045
1048
|
}, V = (b) => {
|
|
1046
1049
|
const P = y.getTableFilterRange();
|
|
1047
|
-
i.executeCommand(
|
|
1050
|
+
i.executeCommand(Vr.id, {
|
|
1048
1051
|
unitId: h,
|
|
1049
1052
|
subUnitId: d,
|
|
1050
1053
|
range: P,
|
|
1051
|
-
orderRules: [{ colIndex: S + P.startColumn, type: b ?
|
|
1054
|
+
orderRules: [{ colIndex: S + P.startColumn, type: b ? Ht.ASC : Ht.DESC }],
|
|
1052
1055
|
hasTitle: !1
|
|
1053
|
-
}), m.setSortState(S, b ?
|
|
1056
|
+
}), m.setSortState(S, b ? Ke.Asc : Ke.Desc), L();
|
|
1054
1057
|
}, z = () => {
|
|
1055
1058
|
if (B === me.Items) {
|
|
1056
1059
|
const b = [];
|
|
@@ -1067,7 +1070,7 @@ function hi() {
|
|
|
1067
1070
|
return;
|
|
1068
1071
|
}
|
|
1069
1072
|
const A = {
|
|
1070
|
-
filterType:
|
|
1073
|
+
filterType: kt.manual,
|
|
1071
1074
|
values: b
|
|
1072
1075
|
};
|
|
1073
1076
|
t.setTableFilter(h, v, S, A);
|
|
@@ -1082,7 +1085,7 @@ function hi() {
|
|
|
1082
1085
|
expectedValue: Object.values(g.info)[0]
|
|
1083
1086
|
};
|
|
1084
1087
|
const P = {
|
|
1085
|
-
filterType:
|
|
1088
|
+
filterType: kt.condition,
|
|
1086
1089
|
// @ts-ignore
|
|
1087
1090
|
filterInfo: b
|
|
1088
1091
|
};
|
|
@@ -1091,24 +1094,24 @@ function hi() {
|
|
|
1091
1094
|
L();
|
|
1092
1095
|
}, ce = () => {
|
|
1093
1096
|
t.setTableFilter(h, v, S, void 0), L();
|
|
1094
|
-
}, ue = new
|
|
1097
|
+
}, ue = new ln(h).id, fe = (de = a.getPermissionPoint(ue)) == null ? void 0 : de.value;
|
|
1095
1098
|
return /* @__PURE__ */ T(
|
|
1096
1099
|
"div",
|
|
1097
1100
|
{
|
|
1098
1101
|
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",
|
|
1099
1102
|
children: [
|
|
1100
|
-
fe && /* @__PURE__ */ l("div", { className: "univer-mb-3 univer-flex", children: /* @__PURE__ */ T(
|
|
1103
|
+
fe && /* @__PURE__ */ l("div", { className: "univer-mb-3 univer-flex", children: /* @__PURE__ */ T(Er, { className: "univer-mb-3 !univer-flex univer-w-full", children: [
|
|
1101
1104
|
/* @__PURE__ */ T(_e, { className: "univer-w-1/2", onClick: () => V(!0), children: [
|
|
1102
|
-
/* @__PURE__ */ l(
|
|
1105
|
+
/* @__PURE__ */ l(pn, { className: "univer-mr-1" }),
|
|
1103
1106
|
r.t("sheets-sort.general.sort-asc")
|
|
1104
1107
|
] }),
|
|
1105
1108
|
/* @__PURE__ */ T(_e, { className: "univer-w-1/2", onClick: () => V(!1), children: [
|
|
1106
|
-
/* @__PURE__ */ l(
|
|
1109
|
+
/* @__PURE__ */ l(Cn, { className: "univer-mr-1" }),
|
|
1107
1110
|
r.t("sheets-sort.general.sort-desc")
|
|
1108
1111
|
] })
|
|
1109
1112
|
] }) }),
|
|
1110
1113
|
/* @__PURE__ */ l("div", { className: "univer-w-full", children: /* @__PURE__ */ l(
|
|
1111
|
-
|
|
1114
|
+
$r,
|
|
1112
1115
|
{
|
|
1113
1116
|
value: B,
|
|
1114
1117
|
items: e,
|
|
@@ -1116,7 +1119,7 @@ function hi() {
|
|
|
1116
1119
|
}
|
|
1117
1120
|
) }),
|
|
1118
1121
|
/* @__PURE__ */ l("div", { className: "univer-z-10 univer-h-60", children: /* @__PURE__ */ l("div", { className: "univer-mt-3 univer-size-full", children: B === me.Items ? /* @__PURE__ */ l(
|
|
1119
|
-
|
|
1122
|
+
gi,
|
|
1120
1123
|
{
|
|
1121
1124
|
tableFilter: f,
|
|
1122
1125
|
unitId: h,
|
|
@@ -1127,7 +1130,7 @@ function hi() {
|
|
|
1127
1130
|
setCheckedItemSet: I
|
|
1128
1131
|
}
|
|
1129
1132
|
) : /* @__PURE__ */ l(
|
|
1130
|
-
|
|
1133
|
+
hi,
|
|
1131
1134
|
{
|
|
1132
1135
|
tableFilter: f,
|
|
1133
1136
|
unitId: h,
|
|
@@ -1162,19 +1165,19 @@ function hi() {
|
|
|
1162
1165
|
}
|
|
1163
1166
|
);
|
|
1164
1167
|
}
|
|
1165
|
-
function
|
|
1168
|
+
function mi(r) {
|
|
1166
1169
|
const e = r.getCurrentLocale();
|
|
1167
|
-
return
|
|
1170
|
+
return sn(() => [
|
|
1168
1171
|
{ label: r.t("sheets-table.filter.by-values"), value: me.Items },
|
|
1169
1172
|
{ label: r.t("sheets-table.filter.by-conditions"), value: me.Condition }
|
|
1170
1173
|
], [e, r]);
|
|
1171
1174
|
}
|
|
1172
|
-
var
|
|
1173
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1175
|
+
var pi = Object.getOwnPropertyDescriptor, fi = (r, e, t, n) => {
|
|
1176
|
+
for (var i = n > 1 ? void 0 : n ? pi(e, t) : e, a = r.length - 1, s; a >= 0; a--)
|
|
1174
1177
|
(s = r[a]) && (i = s(i) || i);
|
|
1175
1178
|
return i;
|
|
1176
|
-
},
|
|
1177
|
-
let $e = class extends
|
|
1179
|
+
}, tt = (r, e) => (t, n) => e(t, n, r);
|
|
1180
|
+
let $e = class extends ke {
|
|
1178
1181
|
constructor(e, t, n, i) {
|
|
1179
1182
|
super();
|
|
1180
1183
|
U(this, "_popupDisposable");
|
|
@@ -1192,13 +1195,13 @@ let $e = class extends Le {
|
|
|
1192
1195
|
}
|
|
1193
1196
|
_initComponents() {
|
|
1194
1197
|
[
|
|
1195
|
-
[ge,
|
|
1198
|
+
[ge, bi]
|
|
1196
1199
|
].forEach(([e, t]) => {
|
|
1197
1200
|
this.disposeWithMe(this._componentManager.register(e, t));
|
|
1198
1201
|
});
|
|
1199
1202
|
}
|
|
1200
1203
|
_initUIPopup() {
|
|
1201
|
-
this.disposeWithMe(this._contextService.subscribeContextValue$(ge).pipe(
|
|
1204
|
+
this.disposeWithMe(this._contextService.subscribeContextValue$(ge).pipe(an(void 0), Cr()).subscribe((e) => {
|
|
1202
1205
|
e ? this._openFilterPopup() : e === !1 && this._closeFilterPopup();
|
|
1203
1206
|
}));
|
|
1204
1207
|
}
|
|
@@ -1214,7 +1217,7 @@ let $e = class extends Le {
|
|
|
1214
1217
|
componentKey: ge,
|
|
1215
1218
|
direction: "horizontal",
|
|
1216
1219
|
onClickOutside: () => {
|
|
1217
|
-
this._dialogService.close(
|
|
1220
|
+
this._dialogService.close(jr), this._contextService.setContextValue(ge, !1);
|
|
1218
1221
|
},
|
|
1219
1222
|
offset: [5, 0],
|
|
1220
1223
|
portal: !0
|
|
@@ -1225,35 +1228,35 @@ let $e = class extends Le {
|
|
|
1225
1228
|
(e = this._popupDisposable) == null || e.dispose(), this._popupDisposable = null, this.clearCurrentTableFilterInfo();
|
|
1226
1229
|
}
|
|
1227
1230
|
};
|
|
1228
|
-
$e =
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1231
|
+
$e = fi([
|
|
1232
|
+
tt(0, N(nn)),
|
|
1233
|
+
tt(1, It),
|
|
1234
|
+
tt(2, N(nr)),
|
|
1235
|
+
tt(3, N(rn))
|
|
1233
1236
|
], $e);
|
|
1234
|
-
const
|
|
1235
|
-
type:
|
|
1237
|
+
const St = {
|
|
1238
|
+
type: Yt.OPERATION,
|
|
1236
1239
|
id: "sheet.operation.open-table-filter-panel",
|
|
1237
1240
|
async handler(r, e) {
|
|
1238
1241
|
if (!e)
|
|
1239
1242
|
return !1;
|
|
1240
|
-
const { row: t, col: n, unitId: i, subUnitId: a, tableId: s } = e, c = r.get(re), u = r.get(
|
|
1243
|
+
const { row: t, col: n, unitId: i, subUnitId: a, tableId: s } = e, c = r.get(re), u = r.get(It), h = r.get($e);
|
|
1241
1244
|
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;
|
|
1242
1245
|
}
|
|
1243
|
-
},
|
|
1244
|
-
type:
|
|
1246
|
+
}, Et = {
|
|
1247
|
+
type: Yt.OPERATION,
|
|
1245
1248
|
id: "sheet.operation.open-table-selector",
|
|
1246
1249
|
async handler(r) {
|
|
1247
1250
|
var w;
|
|
1248
1251
|
const e = r.get(pe), t = r.get(te), n = ct(e);
|
|
1249
1252
|
if (!n)
|
|
1250
1253
|
return !1;
|
|
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 =
|
|
1252
|
-
return f ? (t.executeCommand(
|
|
1254
|
+
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 = Pr(u) ? Or(h, { up: !0, left: !0, right: !0, down: !0 }, s) : h, f = await In(r, i, a, v);
|
|
1255
|
+
return f ? (t.executeCommand(zn.id, { ...f }), !0) : !1;
|
|
1253
1256
|
}
|
|
1254
1257
|
};
|
|
1255
|
-
async function
|
|
1256
|
-
const a = r.get(
|
|
1258
|
+
async function In(r, e, t, n, i) {
|
|
1259
|
+
const a = r.get(rn), s = r.get(ne);
|
|
1257
1260
|
return new Promise((c) => {
|
|
1258
1261
|
const u = {
|
|
1259
1262
|
unitId: e,
|
|
@@ -1287,45 +1290,45 @@ async function Tn(r, e, t, n, i) {
|
|
|
1287
1290
|
});
|
|
1288
1291
|
});
|
|
1289
1292
|
}
|
|
1290
|
-
const
|
|
1293
|
+
const yn = "sheets-table-ui.config", Ut = {
|
|
1291
1294
|
anchorHeight: 24,
|
|
1292
1295
|
anchorBackgroundColor: "rgb(134,139,156)"
|
|
1293
1296
|
};
|
|
1294
|
-
var
|
|
1295
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1297
|
+
var Ci = Object.getOwnPropertyDescriptor, Si = (r, e, t, n) => {
|
|
1298
|
+
for (var i = n > 1 ? void 0 : n ? Ci(e, t) : e, a = r.length - 1, s; a >= 0; a--)
|
|
1296
1299
|
(s = r[a]) && (i = s(i) || i);
|
|
1297
1300
|
return i;
|
|
1298
|
-
},
|
|
1299
|
-
let Ie = class extends
|
|
1301
|
+
}, _i = (r, e) => (t, n) => e(t, n, r);
|
|
1302
|
+
let Ie = class extends ke {
|
|
1300
1303
|
constructor(e) {
|
|
1301
1304
|
super();
|
|
1302
|
-
U(this, "_refreshTable", new
|
|
1305
|
+
U(this, "_refreshTable", new Sr());
|
|
1303
1306
|
U(this, "refreshTable$", this._refreshTable.asObservable());
|
|
1304
1307
|
this._commandService = e, this._initListener();
|
|
1305
1308
|
}
|
|
1306
1309
|
_initListener() {
|
|
1307
1310
|
this.disposeWithMe(
|
|
1308
1311
|
this._commandService.onCommandExecuted((e) => {
|
|
1309
|
-
if (e.id ===
|
|
1312
|
+
if (e.id === cn.id) {
|
|
1310
1313
|
const t = e.params, { styleName: n } = t;
|
|
1311
|
-
n.startsWith(
|
|
1314
|
+
n.startsWith(Gn) && this._refreshTable.next(Math.random());
|
|
1312
1315
|
}
|
|
1313
1316
|
})
|
|
1314
1317
|
);
|
|
1315
1318
|
}
|
|
1316
1319
|
};
|
|
1317
|
-
Ie =
|
|
1318
|
-
|
|
1320
|
+
Ie = Si([
|
|
1321
|
+
_i(0, N(te))
|
|
1319
1322
|
], Ie);
|
|
1320
|
-
const
|
|
1323
|
+
const Ti = () => {
|
|
1321
1324
|
var fe, de;
|
|
1322
|
-
const [r, e] = q(""), [t, n] = q(""), i = M(
|
|
1325
|
+
const [r, e] = q(""), [t, n] = q(""), i = M(ur), [a, s] = q({}), c = M(Pe), u = M(at), h = Te(u.anchorPosition$), d = M(te), v = M(pe), f = M(un), w = Te(f.unitPermissionInitStateChange$, !1), S = M(re), E = M(dn), C = M(Ie), $ = Te(C.refreshTable$), I = M(ne), B = M(ut), R = Te(B.selectionChanged$, [{ range: jt(0, 0), primary: null }]), [, g] = q(Math.random()), y = M(Qt).getConfig(yn), 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) => {
|
|
1323
1326
|
s((A) => ({
|
|
1324
1327
|
...A,
|
|
1325
1328
|
[b]: P
|
|
1326
1329
|
}));
|
|
1327
1330
|
};
|
|
1328
|
-
if (
|
|
1331
|
+
if (on(() => {
|
|
1329
1332
|
g(Math.random());
|
|
1330
1333
|
}, [$]), !(h != null && h.length))
|
|
1331
1334
|
return null;
|
|
@@ -1337,7 +1340,7 @@ const Ci = () => {
|
|
|
1337
1340
|
e(""), n("");
|
|
1338
1341
|
return;
|
|
1339
1342
|
}
|
|
1340
|
-
d.executeCommand(
|
|
1343
|
+
d.executeCommand(Ct.id, {
|
|
1341
1344
|
tableId: b,
|
|
1342
1345
|
unitId: V,
|
|
1343
1346
|
name: P
|
|
@@ -1345,8 +1348,8 @@ const Ci = () => {
|
|
|
1345
1348
|
}, ue = async (b) => {
|
|
1346
1349
|
const P = S.getTableById(V, b);
|
|
1347
1350
|
if (!P) return;
|
|
1348
|
-
const A = P.getRange(), Q = await
|
|
1349
|
-
Q && d.executeCommand(
|
|
1351
|
+
const A = P.getRange(), Q = await In(c, V, z, A, b);
|
|
1352
|
+
Q && d.executeCommand(Ct.id, {
|
|
1350
1353
|
tableId: b,
|
|
1351
1354
|
unitId: V,
|
|
1352
1355
|
updateRange: {
|
|
@@ -1355,31 +1358,31 @@ const Ci = () => {
|
|
|
1355
1358
|
});
|
|
1356
1359
|
};
|
|
1357
1360
|
return w ? /* @__PURE__ */ l("div", { className: "univer-absolute univer-z-50 univer-size-0", children: h.map((b) => {
|
|
1358
|
-
var
|
|
1361
|
+
var De, Be, p, _, X, K, se;
|
|
1359
1362
|
const P = S.getTableById(V, b.tableId);
|
|
1360
1363
|
if (!P) return null;
|
|
1361
|
-
const A = E.getRangeThemeStyle(V, P.getTableStyleId()), Q = (p = (
|
|
1364
|
+
const A = E.getRangeThemeStyle(V, P.getTableStyleId()), Q = (p = (Be = (De = A == null ? void 0 : A.getHeaderRowStyle()) == null ? void 0 : De.bg) == null ? void 0 : Be.rgb) != null ? p : O, ze = (K = (X = (_ = A == null ? void 0 : A.getHeaderRowStyle()) == null ? void 0 : _.cl) == null ? void 0 : X.rgb) != null ? K : "rgb(255, 255, 255)", Ge = P.getRange();
|
|
1362
1365
|
if (!(R != null && R.length))
|
|
1363
1366
|
return null;
|
|
1364
|
-
const
|
|
1367
|
+
const Xe = R[R.length - 1].range, Oe = !be.intersects(Ge, Xe) && b.y <= 20;
|
|
1365
1368
|
return /* @__PURE__ */ T(
|
|
1366
1369
|
"div",
|
|
1367
1370
|
{
|
|
1368
1371
|
className: D("univer-shadow-xs univer-absolute univer-box-border univer-cursor-pointer univer-items-center univer-rounded-xl univer-px-2", H, {
|
|
1369
|
-
"univer-flex": !
|
|
1370
|
-
"univer-hidden":
|
|
1372
|
+
"univer-flex": !Oe,
|
|
1373
|
+
"univer-hidden": Oe
|
|
1371
1374
|
}),
|
|
1372
1375
|
style: {
|
|
1373
1376
|
left: b.x,
|
|
1374
1377
|
top: Math.max(b.y, 0),
|
|
1375
1378
|
backgroundColor: Q,
|
|
1376
|
-
color:
|
|
1379
|
+
color: ze,
|
|
1377
1380
|
borderWidth: "0.5px",
|
|
1378
1381
|
height: m ? `${m}px` : "24px"
|
|
1379
1382
|
},
|
|
1380
1383
|
children: [
|
|
1381
1384
|
/* @__PURE__ */ l("div", { className: "univer-text-nowrap", children: r === b.tableId ? /* @__PURE__ */ l(
|
|
1382
|
-
|
|
1385
|
+
Mt,
|
|
1383
1386
|
{
|
|
1384
1387
|
className: "univer-h-[18px] univer-min-w-16 univer-rounded-none",
|
|
1385
1388
|
inputClass: "univer-h-[18px] univer-w-[80px]",
|
|
@@ -1405,7 +1408,7 @@ const Ci = () => {
|
|
|
1405
1408
|
e(b.tableId), n(b.tableName);
|
|
1406
1409
|
},
|
|
1407
1410
|
children: [
|
|
1408
|
-
/* @__PURE__ */ l(
|
|
1411
|
+
/* @__PURE__ */ l(_n, {}),
|
|
1409
1412
|
I.t("sheets-table.rename")
|
|
1410
1413
|
]
|
|
1411
1414
|
}
|
|
@@ -1422,7 +1425,7 @@ const Ci = () => {
|
|
|
1422
1425
|
onClick: () => ue(b.tableId),
|
|
1423
1426
|
className: "univer-flex univer-min-w-32 univer-cursor-pointer univer-items-center univer-gap-2 univer-px-2 univer-py-1 univer-text-sm hover:univer-bg-gray-200",
|
|
1424
1427
|
children: [
|
|
1425
|
-
/* @__PURE__ */ l(
|
|
1428
|
+
/* @__PURE__ */ l(Sn, {}),
|
|
1426
1429
|
I.t("sheets-table.updateRange")
|
|
1427
1430
|
]
|
|
1428
1431
|
}
|
|
@@ -1436,10 +1439,10 @@ const Ci = () => {
|
|
|
1436
1439
|
const W = S.getTableById(V, b.tableId);
|
|
1437
1440
|
if (!W) return;
|
|
1438
1441
|
const Ce = W.getTableConfig(), Se = {
|
|
1439
|
-
id:
|
|
1442
|
+
id: qr,
|
|
1440
1443
|
header: { title: I.t("sheets-table.tableStyle") },
|
|
1441
1444
|
children: {
|
|
1442
|
-
label:
|
|
1445
|
+
label: bn,
|
|
1443
1446
|
oldConfig: Ce,
|
|
1444
1447
|
unitId: V,
|
|
1445
1448
|
subUnitId: z,
|
|
@@ -1451,7 +1454,7 @@ const Ci = () => {
|
|
|
1451
1454
|
},
|
|
1452
1455
|
children: [
|
|
1453
1456
|
/* @__PURE__ */ l(
|
|
1454
|
-
|
|
1457
|
+
wn,
|
|
1455
1458
|
{
|
|
1456
1459
|
extend: { colorChannel1: "rgb(53,91,183)" }
|
|
1457
1460
|
}
|
|
@@ -1471,14 +1474,14 @@ const Ci = () => {
|
|
|
1471
1474
|
{
|
|
1472
1475
|
className: "univer-flex univer-min-w-32 univer-cursor-pointer univer-items-center univer-px-2 univer-py-1 univer-text-sm hover:univer-bg-gray-200",
|
|
1473
1476
|
onClick: () => {
|
|
1474
|
-
L(b.tableId, !1), d.executeCommand(
|
|
1477
|
+
L(b.tableId, !1), d.executeCommand(Xn.id, {
|
|
1475
1478
|
tableId: b.tableId,
|
|
1476
1479
|
subUnitId: z,
|
|
1477
1480
|
unitId: V
|
|
1478
1481
|
});
|
|
1479
1482
|
},
|
|
1480
1483
|
children: [
|
|
1481
|
-
/* @__PURE__ */ l(
|
|
1484
|
+
/* @__PURE__ */ l(fn, { className: "univer-mr-2" }),
|
|
1482
1485
|
I.t("sheets-table.removeTable")
|
|
1483
1486
|
]
|
|
1484
1487
|
}
|
|
@@ -1488,7 +1491,7 @@ const Ci = () => {
|
|
|
1488
1491
|
onOpenChange: (W) => {
|
|
1489
1492
|
L(b.tableId, W);
|
|
1490
1493
|
},
|
|
1491
|
-
children: /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(
|
|
1494
|
+
children: /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(xt, {}) })
|
|
1492
1495
|
},
|
|
1493
1496
|
b.tableId
|
|
1494
1497
|
)
|
|
@@ -1498,29 +1501,29 @@ const Ci = () => {
|
|
|
1498
1501
|
);
|
|
1499
1502
|
}) }) : null;
|
|
1500
1503
|
};
|
|
1501
|
-
var
|
|
1502
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1504
|
+
var wi = Object.getOwnPropertyDescriptor, Ii = (r, e, t, n) => {
|
|
1505
|
+
for (var i = n > 1 ? void 0 : n ? wi(e, t) : e, a = r.length - 1, s; a >= 0; a--)
|
|
1503
1506
|
(s = r[a]) && (i = s(i) || i);
|
|
1504
1507
|
return i;
|
|
1505
1508
|
}, ee = (r, e) => (t, n) => e(t, n, r);
|
|
1506
|
-
let
|
|
1509
|
+
let at = class extends ke {
|
|
1507
1510
|
constructor(e, t, n, i, a, s, c, u, h, d, v) {
|
|
1508
1511
|
super();
|
|
1509
|
-
U(this, "_anchorVisible$", new
|
|
1512
|
+
U(this, "_anchorVisible$", new Ot(!0));
|
|
1510
1513
|
U(this, "_timer");
|
|
1511
|
-
U(this, "_anchorPosition$", new
|
|
1514
|
+
U(this, "_anchorPosition$", new Ot([]));
|
|
1512
1515
|
U(this, "anchorPosition$", this._anchorPosition$.asObservable());
|
|
1513
1516
|
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();
|
|
1514
1517
|
}
|
|
1515
1518
|
_initUI() {
|
|
1516
1519
|
this.disposeWithMe(
|
|
1517
|
-
this._uiPartsService.registerComponent(
|
|
1520
|
+
this._uiPartsService.registerComponent(hr.CONTENT, () => vr(Ti, this._injector))
|
|
1518
1521
|
);
|
|
1519
1522
|
}
|
|
1520
1523
|
_initListener() {
|
|
1521
1524
|
this.disposeWithMe(
|
|
1522
1525
|
this._commandService.onCommandExecuted((e) => {
|
|
1523
|
-
(e.id ===
|
|
1526
|
+
(e.id === ir.id || e.id === ar.id) && (this._anchorVisible$.next(!1), this._timer && clearTimeout(this._timer), this._timer = setTimeout(() => {
|
|
1524
1527
|
this._anchorVisible$.next(!0);
|
|
1525
1528
|
}, 300));
|
|
1526
1529
|
})
|
|
@@ -1528,7 +1531,7 @@ let it = class extends Le {
|
|
|
1528
1531
|
}
|
|
1529
1532
|
_initTableAnchor() {
|
|
1530
1533
|
this.disposeWithMe(
|
|
1531
|
-
|
|
1534
|
+
yt(
|
|
1532
1535
|
this._context.unit.activeSheet$,
|
|
1533
1536
|
this._sheetSkeletonManagerService.currentSkeleton$,
|
|
1534
1537
|
this._scrollManagerService.validViewportScrollInfo$,
|
|
@@ -1537,8 +1540,8 @@ let it = class extends Le {
|
|
|
1537
1540
|
this._tableManager.tableNameChanged$,
|
|
1538
1541
|
this._tableManager.tableRangeChanged$,
|
|
1539
1542
|
this._tableManager.tableThemeChanged$,
|
|
1540
|
-
this._workbookPermissionService.unitPermissionInitStateChange$.pipe(
|
|
1541
|
-
this._permissionService.permissionPointUpdate$.pipe(
|
|
1543
|
+
this._workbookPermissionService.unitPermissionInitStateChange$.pipe(_r((e) => e)),
|
|
1544
|
+
this._permissionService.permissionPointUpdate$.pipe(Tr(300)),
|
|
1542
1545
|
this._anchorVisible$
|
|
1543
1546
|
).subscribe(() => {
|
|
1544
1547
|
var h;
|
|
@@ -1551,20 +1554,20 @@ let it = class extends Le {
|
|
|
1551
1554
|
this._anchorPosition$.next([]);
|
|
1552
1555
|
return;
|
|
1553
1556
|
}
|
|
1554
|
-
if (!((h = this._permissionService.getPermissionPoint(new
|
|
1557
|
+
if (!((h = this._permissionService.getPermissionPoint(new ln(t.getUnitId()).id)) == null ? void 0 : h.value)) {
|
|
1555
1558
|
this._anchorPosition$.next([]);
|
|
1556
1559
|
return;
|
|
1557
1560
|
}
|
|
1558
1561
|
const u = a.reduce((d, v) => {
|
|
1559
|
-
const { startRow: f, startColumn: w } = v.range, S = s.with(lt), E =
|
|
1562
|
+
const { startRow: f, startColumn: w } = v.range, S = s.with(lt), E = sr(this._univerInstanceService, this._renderManagerService);
|
|
1560
1563
|
if (!E) return d;
|
|
1561
|
-
const { scene: C } = E, $ = C.getViewport(
|
|
1564
|
+
const { scene: C } = E, $ = C.getViewport(Un.VIEW_MAIN);
|
|
1562
1565
|
if (!$) return d;
|
|
1563
1566
|
const I = C == null ? void 0 : C.scaleX, B = C == null ? void 0 : C.scaleY, R = C == null ? void 0 : C.getViewportScrollXY($);
|
|
1564
1567
|
if (!I || !C || !B || !R) return d;
|
|
1565
1568
|
const g = S.getCurrentSkeleton();
|
|
1566
1569
|
if (!g) return d;
|
|
1567
|
-
const x = g.getNoMergeCellWithCoordByIndex(f, w), y =
|
|
1570
|
+
const x = g.getNoMergeCellWithCoordByIndex(f, w), y = Wn(x.startX, I, R), m = Zn(x.startY, B, R) - 25 - 4;
|
|
1568
1571
|
return m >= -10 && y >= 45 && d.push({
|
|
1569
1572
|
x: y,
|
|
1570
1573
|
y: m,
|
|
@@ -1577,23 +1580,23 @@ let it = class extends Le {
|
|
|
1577
1580
|
);
|
|
1578
1581
|
}
|
|
1579
1582
|
};
|
|
1580
|
-
|
|
1581
|
-
ee(1, N(
|
|
1583
|
+
at = Ii([
|
|
1584
|
+
ee(1, N(Pe)),
|
|
1582
1585
|
ee(2, N(lt)),
|
|
1583
|
-
ee(3,
|
|
1586
|
+
ee(3, Gt),
|
|
1584
1587
|
ee(4, te),
|
|
1585
1588
|
ee(5, pe),
|
|
1586
|
-
ee(6,
|
|
1589
|
+
ee(6, dr),
|
|
1587
1590
|
ee(7, N(re)),
|
|
1588
|
-
ee(8, N(
|
|
1589
|
-
ee(9, N(
|
|
1590
|
-
ee(10, N(
|
|
1591
|
-
],
|
|
1591
|
+
ee(8, N(rr)),
|
|
1592
|
+
ee(9, N(un)),
|
|
1593
|
+
ee(10, N(qt))
|
|
1594
|
+
], at);
|
|
1592
1595
|
const Me = 16;
|
|
1593
1596
|
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");
|
|
1594
|
-
class
|
|
1597
|
+
class Wt {
|
|
1595
1598
|
static drawNoSetting(e, t, n, i) {
|
|
1596
|
-
e.save(),
|
|
1599
|
+
e.save(), $t.drawWith(e, {
|
|
1597
1600
|
radius: 2,
|
|
1598
1601
|
width: Me,
|
|
1599
1602
|
height: Me,
|
|
@@ -1601,7 +1604,7 @@ class Ut {
|
|
|
1601
1604
|
}), 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();
|
|
1602
1605
|
}
|
|
1603
1606
|
static drawIconByPath(e, t, n, i) {
|
|
1604
|
-
e.save(), e.strokeStyle = n, e.fillStyle = i,
|
|
1607
|
+
e.save(), e.strokeStyle = n, e.fillStyle = i, $t.drawWith(e, {
|
|
1605
1608
|
radius: 2,
|
|
1606
1609
|
width: Me,
|
|
1607
1610
|
height: Me,
|
|
@@ -1612,30 +1615,30 @@ class Ut {
|
|
|
1612
1615
|
}), e.restore();
|
|
1613
1616
|
}
|
|
1614
1617
|
}
|
|
1615
|
-
const
|
|
1618
|
+
const yi = [
|
|
1616
1619
|
"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"
|
|
1617
|
-
],
|
|
1620
|
+
], Ri = [
|
|
1618
1621
|
"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",
|
|
1619
1622
|
"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"
|
|
1620
|
-
],
|
|
1623
|
+
], Mi = [
|
|
1621
1624
|
"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",
|
|
1622
1625
|
"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"
|
|
1623
|
-
],
|
|
1626
|
+
], xi = [
|
|
1624
1627
|
"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",
|
|
1625
1628
|
"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",
|
|
1626
1629
|
"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"
|
|
1627
|
-
],
|
|
1630
|
+
], Ni = [
|
|
1628
1631
|
"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",
|
|
1629
1632
|
"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",
|
|
1630
1633
|
"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"
|
|
1631
1634
|
];
|
|
1632
|
-
var
|
|
1633
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1635
|
+
var Ei = Object.getOwnPropertyDescriptor, $i = (r, e, t, n) => {
|
|
1636
|
+
for (var i = n > 1 ? void 0 : n ? Ei(e, t) : e, a = r.length - 1, s; a >= 0; a--)
|
|
1634
1637
|
(s = r[a]) && (i = s(i) || i);
|
|
1635
1638
|
return i;
|
|
1636
|
-
},
|
|
1637
|
-
const oe = 16,
|
|
1638
|
-
let
|
|
1639
|
+
}, pt = (r, e) => (t, n) => e(t, n, r);
|
|
1640
|
+
const oe = 16, Ye = 1;
|
|
1641
|
+
let _t = class extends jn {
|
|
1639
1642
|
constructor(e, t, n, i, a) {
|
|
1640
1643
|
super(e, t);
|
|
1641
1644
|
U(this, "_cellWidth", 0);
|
|
@@ -1659,30 +1662,30 @@ let St = class extends Zn {
|
|
|
1659
1662
|
let d;
|
|
1660
1663
|
switch (c) {
|
|
1661
1664
|
case Re.FilteredSortNone:
|
|
1662
|
-
d =
|
|
1665
|
+
d = yi;
|
|
1663
1666
|
break;
|
|
1664
1667
|
case Re.FilteredSortAsc:
|
|
1665
|
-
d =
|
|
1668
|
+
d = Ri;
|
|
1666
1669
|
break;
|
|
1667
1670
|
case Re.FilteredSortDesc:
|
|
1668
|
-
d =
|
|
1671
|
+
d = Mi;
|
|
1669
1672
|
break;
|
|
1670
1673
|
case Re.FilterNoneSortNone:
|
|
1671
1674
|
break;
|
|
1672
1675
|
case Re.FilterNoneSortAsc:
|
|
1673
|
-
d =
|
|
1676
|
+
d = xi;
|
|
1674
1677
|
break;
|
|
1675
1678
|
case Re.FilterNoneSortDesc:
|
|
1676
|
-
d =
|
|
1679
|
+
d = Ni;
|
|
1677
1680
|
break;
|
|
1678
1681
|
}
|
|
1679
|
-
d ?
|
|
1682
|
+
d ? Wt.drawIconByPath(e, d, u, h) : c !== void 0 && Wt.drawNoSetting(e, oe, u, h), e.restore();
|
|
1680
1683
|
}
|
|
1681
1684
|
onPointerDown(e) {
|
|
1682
1685
|
if (e.button === 2)
|
|
1683
1686
|
return;
|
|
1684
1687
|
const { row: t, col: n, unitId: i, subUnitId: a, tableId: s } = this._filterParams;
|
|
1685
|
-
this._contextService.getContextValue(ge) || !this._commandService.hasCommand(
|
|
1688
|
+
this._contextService.getContextValue(ge) || !this._commandService.hasCommand(St.id) || setTimeout(() => {
|
|
1686
1689
|
const u = {
|
|
1687
1690
|
row: t,
|
|
1688
1691
|
col: n,
|
|
@@ -1690,7 +1693,7 @@ let St = class extends Zn {
|
|
|
1690
1693
|
subUnitId: a,
|
|
1691
1694
|
tableId: s
|
|
1692
1695
|
};
|
|
1693
|
-
this._commandService.executeCommand(
|
|
1696
|
+
this._commandService.executeCommand(St.id, u);
|
|
1694
1697
|
}, 200);
|
|
1695
1698
|
}
|
|
1696
1699
|
onPointerEnter() {
|
|
@@ -1700,28 +1703,28 @@ let St = class extends Zn {
|
|
|
1700
1703
|
this._hovered = !1, this.makeDirty(!0);
|
|
1701
1704
|
}
|
|
1702
1705
|
};
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
],
|
|
1708
|
-
var
|
|
1709
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1706
|
+
_t = $i([
|
|
1707
|
+
pt(2, It),
|
|
1708
|
+
pt(3, te),
|
|
1709
|
+
pt(4, N(Pn))
|
|
1710
|
+
], _t);
|
|
1711
|
+
var Li = Object.getOwnPropertyDescriptor, ki = (r, e, t, n) => {
|
|
1712
|
+
for (var i = n > 1 ? void 0 : n ? Li(e, t) : e, a = r.length - 1, s; a >= 0; a--)
|
|
1710
1713
|
(s = r[a]) && (i = s(i) || i);
|
|
1711
1714
|
return i;
|
|
1712
|
-
},
|
|
1713
|
-
const
|
|
1715
|
+
}, je = (r, e) => (t, n) => e(t, n, r);
|
|
1716
|
+
const Pi = 5e3, Oi = (r, e, t, n) => {
|
|
1714
1717
|
switch (n) {
|
|
1715
|
-
case
|
|
1716
|
-
return r +
|
|
1717
|
-
case
|
|
1718
|
+
case it.TOP:
|
|
1719
|
+
return r + Ye;
|
|
1720
|
+
case it.MIDDLE:
|
|
1718
1721
|
return r + Math.max(0, (t - oe) / 2);
|
|
1719
|
-
case
|
|
1722
|
+
case it.BOTTOM:
|
|
1720
1723
|
default:
|
|
1721
|
-
return e - oe -
|
|
1724
|
+
return e - oe - Ye;
|
|
1722
1725
|
}
|
|
1723
1726
|
};
|
|
1724
|
-
let
|
|
1727
|
+
let Tt = class extends zt {
|
|
1725
1728
|
constructor(e, t, n, i, a, s) {
|
|
1726
1729
|
super();
|
|
1727
1730
|
U(this, "_buttonRenderDisposable", null);
|
|
@@ -1743,7 +1746,7 @@ let _t = class extends Qt {
|
|
|
1743
1746
|
tableFilterRanges: this._tableManager.getSheetFilterRangeWithState(n.getUnitId(), a),
|
|
1744
1747
|
skeleton: t.skeleton
|
|
1745
1748
|
});
|
|
1746
|
-
return
|
|
1749
|
+
return yt(
|
|
1747
1750
|
e.tableAdd$,
|
|
1748
1751
|
e.tableNameChanged$,
|
|
1749
1752
|
e.tableRangeChanged$,
|
|
@@ -1751,11 +1754,11 @@ let _t = class extends Qt {
|
|
|
1751
1754
|
e.tableDelete$,
|
|
1752
1755
|
e.tableFilterChanged$
|
|
1753
1756
|
).pipe(
|
|
1754
|
-
|
|
1755
|
-
|
|
1757
|
+
wr(() => s()),
|
|
1758
|
+
an(s())
|
|
1756
1759
|
);
|
|
1757
1760
|
}),
|
|
1758
|
-
|
|
1761
|
+
Ir(this.dispose$)
|
|
1759
1762
|
).subscribe((t) => {
|
|
1760
1763
|
this._disposeRendering(), !(!t || !t.tableFilterRanges) && this._renderButtons(t);
|
|
1761
1764
|
});
|
|
@@ -1764,7 +1767,7 @@ let _t = class extends Qt {
|
|
|
1764
1767
|
this.disposeWithMe(
|
|
1765
1768
|
this._commandService.onCommandExecuted((e) => {
|
|
1766
1769
|
var c;
|
|
1767
|
-
if (e.id !==
|
|
1770
|
+
if (e.id !== Dr.id)
|
|
1768
1771
|
return;
|
|
1769
1772
|
const { unit: t, unitId: n } = this._context, i = ((c = t.getActiveSheet()) == null ? void 0 : c.getSheetId()) || "", a = this._sheetSkeletonManagerService.getCurrentSkeleton();
|
|
1770
1773
|
if (!a)
|
|
@@ -1786,19 +1789,19 @@ let _t = class extends Qt {
|
|
|
1786
1789
|
const { startRow: f, startColumn: w, endColumn: S } = h;
|
|
1787
1790
|
this._interceptCellContent(n, a, h);
|
|
1788
1791
|
for (let E = w; E <= S; E++) {
|
|
1789
|
-
const C = `sheets-table-filter-button-${f}-${E}`, $ =
|
|
1790
|
-
if (O <=
|
|
1792
|
+
const C = `sheets-table-filter-button-${f}-${E}`, $ = or(f, E, c, i), I = u.getCellStyle(f, E), B = (I == null ? void 0 : I.vt) || it.BOTTOM, { startX: R, startY: g, endX: x, endY: y } = $, m = x - R, O = y - g;
|
|
1793
|
+
if (O <= Ye || m <= Ye)
|
|
1791
1794
|
continue;
|
|
1792
|
-
const L = d[E - w], Y = x - oe -
|
|
1795
|
+
const L = d[E - w], Y = x - oe - Ye, V = Oi(g, y, O, B), z = {
|
|
1793
1796
|
left: Y,
|
|
1794
1797
|
top: V,
|
|
1795
1798
|
height: oe,
|
|
1796
1799
|
width: oe,
|
|
1797
|
-
zIndex:
|
|
1800
|
+
zIndex: Pi,
|
|
1798
1801
|
cellHeight: O,
|
|
1799
1802
|
cellWidth: m,
|
|
1800
1803
|
filterParams: { unitId: n, subUnitId: a, row: f, col: E, buttonState: L, tableId: v }
|
|
1801
|
-
}, ce = this._injector.createInstance(
|
|
1804
|
+
}, ce = this._injector.createInstance(_t, C, z);
|
|
1802
1805
|
this._tableFilterButtonShapes.push(ce);
|
|
1803
1806
|
}
|
|
1804
1807
|
}
|
|
@@ -1807,8 +1810,8 @@ let _t = class extends Qt {
|
|
|
1807
1810
|
}
|
|
1808
1811
|
_interceptCellContent(e, t, n) {
|
|
1809
1812
|
const { startRow: i, startColumn: a, endColumn: s } = n;
|
|
1810
|
-
this._buttonRenderDisposable = this._sheetInterceptorService.intercept(
|
|
1811
|
-
effect:
|
|
1813
|
+
this._buttonRenderDisposable = this._sheetInterceptorService.intercept(Br.CELL_CONTENT, {
|
|
1814
|
+
effect: On.Style,
|
|
1812
1815
|
handler: (c, u, h) => {
|
|
1813
1816
|
const { row: d, col: v, unitId: f, subUnitId: w } = u;
|
|
1814
1817
|
return f !== e || w !== t || d !== i || v < a || v > s || ((!c || c === u.rawData) && (c = { ...u.rawData }), c.fontRenderExtension = {
|
|
@@ -1824,25 +1827,141 @@ let _t = class extends Qt {
|
|
|
1824
1827
|
this._tableFilterButtonShapes.forEach((t) => t.dispose()), (e = this._buttonRenderDisposable) == null || e.dispose(), this._buttonRenderDisposable = null, this._tableFilterButtonShapes = [];
|
|
1825
1828
|
}
|
|
1826
1829
|
};
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
],
|
|
1834
|
-
|
|
1830
|
+
Tt = ki([
|
|
1831
|
+
je(1, N(Pe)),
|
|
1832
|
+
je(2, N(lt)),
|
|
1833
|
+
je(3, N(hn)),
|
|
1834
|
+
je(4, N(re)),
|
|
1835
|
+
je(5, te)
|
|
1836
|
+
], Tt);
|
|
1837
|
+
var Di = Object.getOwnPropertyDescriptor, Bi = (r, e, t, n) => {
|
|
1838
|
+
for (var i = n > 1 ? void 0 : n ? Di(e, t) : e, a = r.length - 1, s; a >= 0; a--)
|
|
1839
|
+
(s = r[a]) && (i = s(i) || i);
|
|
1840
|
+
return i;
|
|
1841
|
+
}, nt = (r, e) => (t, n) => e(t, n, r);
|
|
1842
|
+
let wt = class extends zt {
|
|
1843
|
+
constructor(r, e, t, n, i) {
|
|
1844
|
+
super(), this._context = r, this._injector = e, this._sheetSkeletonManagerService = t, this._tableManager = n, this._sheetTableThemeUIController = i, this._initListener();
|
|
1845
|
+
}
|
|
1846
|
+
_dirtySkeleton() {
|
|
1847
|
+
var e;
|
|
1848
|
+
(e = this._context.mainComponent) == null || e.makeDirty();
|
|
1849
|
+
const r = this._sheetSkeletonManagerService.getCurrentParam();
|
|
1850
|
+
if (r) {
|
|
1851
|
+
const t = { ...r, dirty: !0 };
|
|
1852
|
+
this._sheetSkeletonManagerService.reCalculate(t);
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
_initListener() {
|
|
1856
|
+
const r = this._tableManager, e = this._dirtySkeleton.bind(this);
|
|
1857
|
+
this.disposeWithMe(
|
|
1858
|
+
yt(
|
|
1859
|
+
r.tableAdd$,
|
|
1860
|
+
r.tableDelete$,
|
|
1861
|
+
r.tableNameChanged$,
|
|
1862
|
+
r.tableRangeChanged$,
|
|
1863
|
+
r.tableThemeChanged$,
|
|
1864
|
+
r.tableFilterChanged$,
|
|
1865
|
+
r.tableInitStatus$,
|
|
1866
|
+
this._sheetTableThemeUIController.refreshTable$
|
|
1867
|
+
).subscribe(
|
|
1868
|
+
e
|
|
1869
|
+
)
|
|
1870
|
+
);
|
|
1871
|
+
}
|
|
1872
|
+
};
|
|
1873
|
+
wt = Bi([
|
|
1874
|
+
nt(1, N(Pe)),
|
|
1875
|
+
nt(2, N(lt)),
|
|
1876
|
+
nt(3, N(re)),
|
|
1877
|
+
nt(4, N(Ie))
|
|
1878
|
+
], wt);
|
|
1879
|
+
var Fi = Object.getOwnPropertyDescriptor, Vi = (r, e, t, n) => {
|
|
1880
|
+
for (var i = n > 1 ? void 0 : n ? Fi(e, t) : e, a = r.length - 1, s; a >= 0; a--)
|
|
1881
|
+
(s = r[a]) && (i = s(i) || i);
|
|
1882
|
+
return i;
|
|
1883
|
+
}, ft = (r, e) => (t, n) => e(t, n, r);
|
|
1884
|
+
let st = class extends ke {
|
|
1885
|
+
constructor(r, e, t) {
|
|
1886
|
+
super(), this._sheetInterceptorService = r, this._univerInstanceService = e, this._tableManager = t, this._initSelectionChange();
|
|
1887
|
+
}
|
|
1888
|
+
_initSelectionChange() {
|
|
1889
|
+
this.disposeWithMe(
|
|
1890
|
+
this._sheetInterceptorService.interceptCommand({
|
|
1891
|
+
getMutations: (r) => {
|
|
1892
|
+
if (r.id === lr.id) {
|
|
1893
|
+
const e = ct(this._univerInstanceService);
|
|
1894
|
+
if (!e)
|
|
1895
|
+
return { redos: [], undos: [] };
|
|
1896
|
+
const t = r.params, { range: n } = t, { unitId: i, subUnitId: a, worksheet: s } = e, u = this._tableManager.getTablesBySubunitId(i, a).find((h) => {
|
|
1897
|
+
const d = h.getRange();
|
|
1898
|
+
return be.contains(d, n);
|
|
1899
|
+
});
|
|
1900
|
+
if (u) {
|
|
1901
|
+
const h = u.getRange(), d = {
|
|
1902
|
+
...h,
|
|
1903
|
+
startRow: h.startRow + 1
|
|
1904
|
+
};
|
|
1905
|
+
return be.equals(h, n) ? { undos: [], redos: [] } : be.equals(d, n) ? {
|
|
1906
|
+
undos: [],
|
|
1907
|
+
redos: [
|
|
1908
|
+
{
|
|
1909
|
+
id: Vt.id,
|
|
1910
|
+
params: {
|
|
1911
|
+
unitId: i,
|
|
1912
|
+
subUnitId: a,
|
|
1913
|
+
selections: [
|
|
1914
|
+
{
|
|
1915
|
+
range: h,
|
|
1916
|
+
primary: Ft(h, s)
|
|
1917
|
+
}
|
|
1918
|
+
]
|
|
1919
|
+
}
|
|
1920
|
+
}
|
|
1921
|
+
]
|
|
1922
|
+
} : {
|
|
1923
|
+
undos: [],
|
|
1924
|
+
redos: [
|
|
1925
|
+
{
|
|
1926
|
+
id: Vt.id,
|
|
1927
|
+
params: {
|
|
1928
|
+
unitId: i,
|
|
1929
|
+
subUnitId: a,
|
|
1930
|
+
selections: [
|
|
1931
|
+
{
|
|
1932
|
+
range: d,
|
|
1933
|
+
primary: Ft(d, s)
|
|
1934
|
+
}
|
|
1935
|
+
]
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
]
|
|
1939
|
+
};
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
return { redos: [], undos: [] };
|
|
1943
|
+
}
|
|
1944
|
+
})
|
|
1945
|
+
);
|
|
1946
|
+
}
|
|
1947
|
+
};
|
|
1948
|
+
st = Vi([
|
|
1949
|
+
ft(0, N(hn)),
|
|
1950
|
+
ft(1, N(pe)),
|
|
1951
|
+
ft(2, N(re))
|
|
1952
|
+
], st);
|
|
1953
|
+
const Hi = (r) => {
|
|
1835
1954
|
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(
|
|
1955
|
+
return /* @__PURE__ */ T(Rt, { children: [
|
|
1837
1956
|
/* @__PURE__ */ l(
|
|
1838
|
-
|
|
1957
|
+
Ar,
|
|
1839
1958
|
{
|
|
1840
1959
|
maxRangeCount: 1,
|
|
1841
1960
|
unitId: e,
|
|
1842
1961
|
subUnitId: t,
|
|
1843
|
-
initialValue:
|
|
1962
|
+
initialValue: At(n),
|
|
1844
1963
|
onChange: (S, E) => {
|
|
1845
|
-
const C =
|
|
1964
|
+
const C = At(n), $ = Hr(E).range, I = ct(w, { unitId: e, subUnitId: t });
|
|
1846
1965
|
if (!I)
|
|
1847
1966
|
return;
|
|
1848
1967
|
if (I.worksheet.getMergeData().some((L) => be.intersects($, L))) {
|
|
@@ -1907,16 +2026,16 @@ const ki = (r) => {
|
|
|
1907
2026
|
)
|
|
1908
2027
|
] })
|
|
1909
2028
|
] });
|
|
1910
|
-
},
|
|
1911
|
-
var P, A, Q,
|
|
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(
|
|
2029
|
+
}, Ai = (r) => {
|
|
2030
|
+
var P, A, Q, ht, ze, Ge, vt, Xe, gt, Oe, De, Be;
|
|
2031
|
+
const { unitId: e, subUnitId: t, tableId: n } = r, i = M(te), a = M(ne), s = M(re), c = s.getTableById(e, n), u = M(dn), h = M(Ie), d = Te(u.rangeThemeMapChange$), v = Te(h.refreshTable$), f = M(Dn), [, w] = q(Math.random()), S = Te(s.tableThemeChanged$, {
|
|
1913
2032
|
theme: c == null ? void 0 : c.getTableStyleId(),
|
|
1914
2033
|
oldTheme: c == null ? void 0 : c.getTableStyleId(),
|
|
1915
2034
|
unitId: e,
|
|
1916
2035
|
subUnitId: t,
|
|
1917
2036
|
tableId: n
|
|
1918
|
-
}), E = u.getRegisteredRangeThemes().filter((p) => p == null ? void 0 : p.startsWith(
|
|
1919
|
-
i.executeCommand(
|
|
2037
|
+
}), E = u.getRegisteredRangeThemes().filter((p) => p == null ? void 0 : p.startsWith(Yr)), C = u.getALLRegisteredTheme(e).filter((p) => p == null ? void 0 : p.startsWith(mt)), $ = 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 = (ze = (ht = R == null ? void 0 : R.getFirstRowStyle()) == null ? void 0 : ht.bg) == null ? void 0 : ze.rgb) != null ? Ge : ve, y = (gt = (Xe = (vt = R == null ? void 0 : R.getSecondRowStyle()) == null ? void 0 : vt.bg) == null ? void 0 : Xe.rgb) != null ? gt : ve, m = (Be = (De = (Oe = R == null ? void 0 : R.getLastRowStyle()) == null ? void 0 : Oe.bg) == null ? void 0 : De.rgb) != null ? Be : ve, [O, L] = q(null), Y = (p) => {
|
|
2038
|
+
i.executeCommand(Ct.id, {
|
|
1920
2039
|
unitId: e,
|
|
1921
2040
|
tableId: n,
|
|
1922
2041
|
theme: p
|
|
@@ -1927,40 +2046,40 @@ const ki = (r) => {
|
|
|
1927
2046
|
return;
|
|
1928
2047
|
}
|
|
1929
2048
|
const p = C[C.length - 1];
|
|
1930
|
-
let _ = `${
|
|
2049
|
+
let _ = `${mt}1`;
|
|
1931
2050
|
if (p) {
|
|
1932
2051
|
const K = Number(p.split("-")[2]);
|
|
1933
|
-
_ = `${
|
|
2052
|
+
_ = `${mt}${K + 1}`;
|
|
1934
2053
|
}
|
|
1935
|
-
const X = new
|
|
1936
|
-
i.executeCommand(
|
|
2054
|
+
const X = new Fr(_, { ...Kn });
|
|
2055
|
+
i.executeCommand(Jn.id, {
|
|
1937
2056
|
unitId: e,
|
|
1938
2057
|
tableId: n,
|
|
1939
2058
|
themeStyle: X
|
|
1940
2059
|
});
|
|
1941
2060
|
}, z = (p, _) => {
|
|
1942
|
-
i.executeCommand(
|
|
2061
|
+
i.executeCommand(cn.id, {
|
|
1943
2062
|
unitId: e,
|
|
1944
2063
|
subUnitId: t,
|
|
1945
2064
|
styleName: p,
|
|
1946
2065
|
style: _
|
|
1947
2066
|
});
|
|
1948
2067
|
}, ce = (p) => {
|
|
1949
|
-
i.executeCommand(
|
|
2068
|
+
i.executeCommand(er.id, {
|
|
1950
2069
|
unitId: e,
|
|
1951
2070
|
tableId: n,
|
|
1952
2071
|
themeName: p
|
|
1953
2072
|
});
|
|
1954
2073
|
};
|
|
1955
|
-
if (
|
|
2074
|
+
if (on(() => {
|
|
1956
2075
|
w(Math.random());
|
|
1957
2076
|
}, [d, v]), !c) return null;
|
|
1958
2077
|
const ue = new he(g).isDark(), fe = new he(x).isDark(), de = new he(y).isDark(), b = new he(m).isDark();
|
|
1959
2078
|
return /* @__PURE__ */ T("div", { children: [
|
|
1960
2079
|
/* @__PURE__ */ l("h5", { children: a.t("sheets-table.defaultStyle") }),
|
|
1961
2080
|
/* @__PURE__ */ l("div", { className: "univer-flex univer-gap-2", children: E.map((p) => {
|
|
1962
|
-
var Ce, Se,
|
|
1963
|
-
const _ = u.getDefaultRangeThemeStyle(p), X = ((Se = (Ce = _ == null ? void 0 : _.getHeaderRowStyle()) == null ? void 0 : Ce.bg) == null ? void 0 : Se.rgb) || ve, K = ((
|
|
2081
|
+
var Ce, Se, Fe, Ve, He, Ae, Ue, We;
|
|
2082
|
+
const _ = u.getDefaultRangeThemeStyle(p), X = ((Se = (Ce = _ == null ? void 0 : _.getHeaderRowStyle()) == null ? void 0 : Ce.bg) == null ? void 0 : Se.rgb) || ve, K = ((Ve = (Fe = _ == null ? void 0 : _.getFirstRowStyle()) == null ? void 0 : Fe.bg) == null ? void 0 : Ve.rgb) || ve, se = ((Ae = (He = _ == null ? void 0 : _.getSecondRowStyle()) == null ? void 0 : He.bg) == null ? void 0 : Ae.rgb) || ve, W = ((We = (Ue = _ == null ? void 0 : _.getLastRowStyle()) == null ? void 0 : Ue.bg) == null ? void 0 : We.rgb) || ve;
|
|
1964
2083
|
return /* @__PURE__ */ T(
|
|
1965
2084
|
"div",
|
|
1966
2085
|
{
|
|
@@ -1990,8 +2109,8 @@ const ki = (r) => {
|
|
|
1990
2109
|
}
|
|
1991
2110
|
),
|
|
1992
2111
|
C.map((p) => {
|
|
1993
|
-
var Ce, Se,
|
|
1994
|
-
const _ = u.getCustomRangeThemeStyle(e, p), X = (Se = (Ce = _ == null ? void 0 : _.getHeaderRowStyle()) == null ? void 0 : Ce.bg) == null ? void 0 : Se.rgb, K = (
|
|
2112
|
+
var Ce, Se, Fe, Ve, He, Ae, Ue, We;
|
|
2113
|
+
const _ = u.getCustomRangeThemeStyle(e, p), X = (Se = (Ce = _ == null ? void 0 : _.getHeaderRowStyle()) == null ? void 0 : Ce.bg) == null ? void 0 : Se.rgb, K = (Ve = (Fe = _ == null ? void 0 : _.getFirstRowStyle()) == null ? void 0 : Fe.bg) == null ? void 0 : Ve.rgb, se = (Ae = (He = _ == null ? void 0 : _.getSecondRowStyle()) == null ? void 0 : He.bg) == null ? void 0 : Ae.rgb, W = (We = (Ue = _ == null ? void 0 : _.getLastRowStyle()) == null ? void 0 : Ue.bg) == null ? void 0 : We.rgb;
|
|
1995
2114
|
return /* @__PURE__ */ T(
|
|
1996
2115
|
"div",
|
|
1997
2116
|
{
|
|
@@ -2002,17 +2121,17 @@ const ki = (r) => {
|
|
|
2002
2121
|
onMouseEnter: () => L(p),
|
|
2003
2122
|
onMouseLeave: () => L(null),
|
|
2004
2123
|
children: [
|
|
2005
|
-
/* @__PURE__ */ l("div", { className: "univer-box-border univer-h-2.5", style: { background: X != null ? X : G, border: `${X ? G :
|
|
2006
|
-
/* @__PURE__ */ l("div", { className: "univer-box-border univer-h-2.5", style: { background: K != null ? K : G, border: `${K ? G :
|
|
2007
|
-
/* @__PURE__ */ l("div", { className: "univer-box-border univer-h-2.5", style: { background: se != null ? se : G, border: `${se ? G :
|
|
2008
|
-
/* @__PURE__ */ l("div", { className: "univer-box-border univer-h-2.5", style: { background: W != null ? W : G, border: `${W ? G :
|
|
2124
|
+
/* @__PURE__ */ l("div", { className: "univer-box-border univer-h-2.5", style: { background: X != null ? X : G, border: `${X ? G : et}` } }),
|
|
2125
|
+
/* @__PURE__ */ l("div", { className: "univer-box-border univer-h-2.5", style: { background: K != null ? K : G, border: `${K ? G : et}` } }),
|
|
2126
|
+
/* @__PURE__ */ l("div", { className: "univer-box-border univer-h-2.5", style: { background: se != null ? se : G, border: `${se ? G : et}` } }),
|
|
2127
|
+
/* @__PURE__ */ l("div", { className: "univer-box-border univer-h-2.5", style: { background: W != null ? W : G, border: `${W ? G : et}` } }),
|
|
2009
2128
|
/* @__PURE__ */ l(
|
|
2010
2129
|
"div",
|
|
2011
2130
|
{
|
|
2012
2131
|
className: "univer-absolute univer-right-[-3px] univer-top-[-3px] univer-size-3 univer-rounded-md univer-bg-gray-200 univer-text-center univer-text-xs univer-leading-[10px]",
|
|
2013
2132
|
style: { display: O === p ? "block" : "none" },
|
|
2014
|
-
onClick: (
|
|
2015
|
-
|
|
2133
|
+
onClick: (En) => {
|
|
2134
|
+
En.stopPropagation(), ce(p);
|
|
2016
2135
|
},
|
|
2017
2136
|
children: "x"
|
|
2018
2137
|
}
|
|
@@ -2023,7 +2142,7 @@ const ki = (r) => {
|
|
|
2023
2142
|
);
|
|
2024
2143
|
})
|
|
2025
2144
|
] }),
|
|
2026
|
-
I && /* @__PURE__ */ T(
|
|
2145
|
+
I && /* @__PURE__ */ T(Rt, { children: [
|
|
2027
2146
|
/* @__PURE__ */ l("div", { className: "univer-h-px univer-w-full univer-bg-gray-200" }),
|
|
2028
2147
|
/* @__PURE__ */ T("div", { className: "univer-flex univer-flex-col univer-gap-2 univer-p-2", children: [
|
|
2029
2148
|
/* @__PURE__ */ T("div", { className: "univer-flex univer-h-9 univer-gap-2", children: [
|
|
@@ -2044,11 +2163,11 @@ const ki = (r) => {
|
|
|
2044
2163
|
Ne,
|
|
2045
2164
|
{
|
|
2046
2165
|
overlay: /* @__PURE__ */ l("div", { className: "univer-p-2", children: /* @__PURE__ */ l(
|
|
2047
|
-
|
|
2166
|
+
Je,
|
|
2048
2167
|
{
|
|
2049
2168
|
value: g,
|
|
2050
2169
|
onChange: (p) => {
|
|
2051
|
-
const _ =
|
|
2170
|
+
const _ = Pt("headerRowStyle", {
|
|
2052
2171
|
bg: {
|
|
2053
2172
|
rgb: p
|
|
2054
2173
|
},
|
|
@@ -2077,7 +2196,7 @@ const ki = (r) => {
|
|
|
2077
2196
|
}
|
|
2078
2197
|
}
|
|
2079
2198
|
),
|
|
2080
|
-
/* @__PURE__ */ l(
|
|
2199
|
+
/* @__PURE__ */ l(qe, { className: "univer-size-2" })
|
|
2081
2200
|
]
|
|
2082
2201
|
}
|
|
2083
2202
|
)
|
|
@@ -2102,7 +2221,7 @@ const ki = (r) => {
|
|
|
2102
2221
|
Ne,
|
|
2103
2222
|
{
|
|
2104
2223
|
overlay: /* @__PURE__ */ l("div", { className: "univer-p-2", children: /* @__PURE__ */ l(
|
|
2105
|
-
|
|
2224
|
+
Je,
|
|
2106
2225
|
{
|
|
2107
2226
|
value: x,
|
|
2108
2227
|
onChange: (p) => {
|
|
@@ -2131,7 +2250,7 @@ const ki = (r) => {
|
|
|
2131
2250
|
style: { background: x }
|
|
2132
2251
|
}
|
|
2133
2252
|
),
|
|
2134
|
-
/* @__PURE__ */ l(
|
|
2253
|
+
/* @__PURE__ */ l(qe, { className: "univer-size-2" })
|
|
2135
2254
|
]
|
|
2136
2255
|
}
|
|
2137
2256
|
)
|
|
@@ -2156,7 +2275,7 @@ const ki = (r) => {
|
|
|
2156
2275
|
Ne,
|
|
2157
2276
|
{
|
|
2158
2277
|
overlay: /* @__PURE__ */ l("div", { className: "univer-p-2", children: /* @__PURE__ */ l(
|
|
2159
|
-
|
|
2278
|
+
Je,
|
|
2160
2279
|
{
|
|
2161
2280
|
value: y,
|
|
2162
2281
|
onChange: (p) => z(c.getTableStyleId(), {
|
|
@@ -2183,7 +2302,7 @@ const ki = (r) => {
|
|
|
2183
2302
|
style: { background: y }
|
|
2184
2303
|
}
|
|
2185
2304
|
),
|
|
2186
|
-
/* @__PURE__ */ l(
|
|
2305
|
+
/* @__PURE__ */ l(qe, { className: "univer-size-2" })
|
|
2187
2306
|
]
|
|
2188
2307
|
}
|
|
2189
2308
|
)
|
|
@@ -2208,11 +2327,11 @@ const ki = (r) => {
|
|
|
2208
2327
|
Ne,
|
|
2209
2328
|
{
|
|
2210
2329
|
overlay: /* @__PURE__ */ l("div", { className: "univer-p-2", children: /* @__PURE__ */ l(
|
|
2211
|
-
|
|
2330
|
+
Je,
|
|
2212
2331
|
{
|
|
2213
2332
|
value: m,
|
|
2214
2333
|
onChange: (p) => {
|
|
2215
|
-
const _ =
|
|
2334
|
+
const _ = Pt("lastRowStyle", {
|
|
2216
2335
|
bg: {
|
|
2217
2336
|
rgb: p
|
|
2218
2337
|
},
|
|
@@ -2236,7 +2355,7 @@ const ki = (r) => {
|
|
|
2236
2355
|
style: { background: m }
|
|
2237
2356
|
}
|
|
2238
2357
|
),
|
|
2239
|
-
/* @__PURE__ */ l(
|
|
2358
|
+
/* @__PURE__ */ l(qe, { className: "univer-size-2" })
|
|
2240
2359
|
]
|
|
2241
2360
|
}
|
|
2242
2361
|
)
|
|
@@ -2247,88 +2366,88 @@ const ki = (r) => {
|
|
|
2247
2366
|
] })
|
|
2248
2367
|
] })
|
|
2249
2368
|
] });
|
|
2250
|
-
},
|
|
2251
|
-
function
|
|
2369
|
+
}, Rn = "sheet.table.context-insert_menu-id", Mn = "sheet.table.context-remove_menu-id";
|
|
2370
|
+
function Ui(r) {
|
|
2252
2371
|
return {
|
|
2253
|
-
id:
|
|
2372
|
+
id: Et.id,
|
|
2254
2373
|
type: ye.BUTTON,
|
|
2255
|
-
icon:
|
|
2374
|
+
icon: gn,
|
|
2256
2375
|
tooltip: "sheets-table.title",
|
|
2257
2376
|
title: "sheets-table.title",
|
|
2258
|
-
hidden$:
|
|
2259
|
-
disabled$:
|
|
2377
|
+
hidden$: gr(r, Qe.UNIVER_SHEET),
|
|
2378
|
+
disabled$: cr(r, {}, !0)
|
|
2260
2379
|
};
|
|
2261
2380
|
}
|
|
2262
|
-
function
|
|
2381
|
+
function Wi(r) {
|
|
2263
2382
|
return {
|
|
2264
|
-
id:
|
|
2383
|
+
id: Rn,
|
|
2265
2384
|
type: ye.SUBITEMS,
|
|
2266
2385
|
icon: "InsertDoubleIcon",
|
|
2267
2386
|
title: "sheets-table.insert.main",
|
|
2268
|
-
hidden$:
|
|
2387
|
+
hidden$: xn(r)
|
|
2269
2388
|
};
|
|
2270
2389
|
}
|
|
2271
|
-
function
|
|
2390
|
+
function Zi(r) {
|
|
2272
2391
|
return {
|
|
2273
|
-
id:
|
|
2392
|
+
id: Mn,
|
|
2274
2393
|
type: ye.SUBITEMS,
|
|
2275
2394
|
icon: "ReduceDoubleIcon",
|
|
2276
2395
|
title: "sheets-table.remove.main",
|
|
2277
|
-
hidden$:
|
|
2396
|
+
hidden$: xn(r)
|
|
2278
2397
|
};
|
|
2279
2398
|
}
|
|
2280
|
-
function
|
|
2399
|
+
function ji(r) {
|
|
2281
2400
|
return {
|
|
2282
|
-
id:
|
|
2401
|
+
id: en.id,
|
|
2283
2402
|
type: ye.BUTTON,
|
|
2284
2403
|
title: "sheets-table.insert.row",
|
|
2285
|
-
hidden$:
|
|
2404
|
+
hidden$: Nn(r)
|
|
2286
2405
|
};
|
|
2287
2406
|
}
|
|
2288
|
-
function
|
|
2407
|
+
function qi(r) {
|
|
2289
2408
|
return {
|
|
2290
|
-
id:
|
|
2409
|
+
id: Jt.id,
|
|
2291
2410
|
title: "sheets-table.insert.col",
|
|
2292
2411
|
type: ye.BUTTON
|
|
2293
2412
|
};
|
|
2294
2413
|
}
|
|
2295
|
-
function
|
|
2414
|
+
function Yi(r) {
|
|
2296
2415
|
return {
|
|
2297
|
-
id:
|
|
2416
|
+
id: Kt.id,
|
|
2298
2417
|
type: ye.BUTTON,
|
|
2299
2418
|
title: "sheets-table.remove.row",
|
|
2300
|
-
hidden$:
|
|
2419
|
+
hidden$: Nn(r)
|
|
2301
2420
|
};
|
|
2302
2421
|
}
|
|
2303
|
-
function
|
|
2422
|
+
function Qi(r) {
|
|
2304
2423
|
return {
|
|
2305
|
-
id:
|
|
2424
|
+
id: Xt.id,
|
|
2306
2425
|
title: "sheets-table.remove.col",
|
|
2307
2426
|
type: ye.BUTTON
|
|
2308
2427
|
};
|
|
2309
2428
|
}
|
|
2310
|
-
function
|
|
2429
|
+
function xn(r) {
|
|
2311
2430
|
const e = r.get(ut);
|
|
2312
|
-
return r.get(pe).getCurrentTypeOfUnit$(
|
|
2431
|
+
return r.get(pe).getCurrentTypeOfUnit$(Qe.UNIVER_SHEET).pipe(
|
|
2313
2432
|
we((i) => i ? i.activeSheet$.pipe(
|
|
2314
2433
|
we((a) => a ? e.selectionMoveEnd$.pipe(
|
|
2315
2434
|
we((s) => {
|
|
2316
2435
|
if (!s.length || s.length > 1) return J(!0);
|
|
2317
|
-
const u = s[0].range, d = r.get(
|
|
2436
|
+
const u = s[0].range, d = r.get(tn).getContainerTableWithRange(i.getUnitId(), a.getSheetId(), u);
|
|
2318
2437
|
return J(!d);
|
|
2319
2438
|
})
|
|
2320
2439
|
) : J(!0))
|
|
2321
2440
|
) : J(!0))
|
|
2322
2441
|
);
|
|
2323
2442
|
}
|
|
2324
|
-
function
|
|
2443
|
+
function Nn(r) {
|
|
2325
2444
|
const e = r.get(ut);
|
|
2326
|
-
return r.get(pe).getCurrentTypeOfUnit$(
|
|
2445
|
+
return r.get(pe).getCurrentTypeOfUnit$(Qe.UNIVER_SHEET).pipe(
|
|
2327
2446
|
we((i) => i ? i.activeSheet$.pipe(
|
|
2328
2447
|
we((a) => a ? e.selectionMoveEnd$.pipe(
|
|
2329
2448
|
we((s) => {
|
|
2330
2449
|
if (!s.length || s.length > 1) return J(!0);
|
|
2331
|
-
const u = s[0].range, d = r.get(
|
|
2450
|
+
const u = s[0].range, d = r.get(tn).getContainerTableWithRange(i.getUnitId(), a.getSheetId(), u);
|
|
2332
2451
|
if (!d)
|
|
2333
2452
|
return J(!0);
|
|
2334
2453
|
const v = d.getRange();
|
|
@@ -2338,213 +2457,97 @@ function Mn(r) {
|
|
|
2338
2457
|
) : J(!0))
|
|
2339
2458
|
);
|
|
2340
2459
|
}
|
|
2341
|
-
const
|
|
2342
|
-
[
|
|
2343
|
-
[
|
|
2460
|
+
const zi = {
|
|
2461
|
+
[pr.ORGANIZATION]: {
|
|
2462
|
+
[Et.id]: {
|
|
2344
2463
|
order: 0,
|
|
2345
|
-
menuItemFactory:
|
|
2464
|
+
menuItemFactory: Ui
|
|
2346
2465
|
}
|
|
2347
2466
|
},
|
|
2348
|
-
[
|
|
2349
|
-
[
|
|
2350
|
-
[
|
|
2467
|
+
[br.MAIN_AREA]: {
|
|
2468
|
+
[mr.LAYOUT]: {
|
|
2469
|
+
[Rn]: {
|
|
2351
2470
|
order: 5,
|
|
2352
|
-
menuItemFactory:
|
|
2353
|
-
[
|
|
2471
|
+
menuItemFactory: Wi,
|
|
2472
|
+
[en.id]: {
|
|
2354
2473
|
order: 1,
|
|
2355
|
-
menuItemFactory:
|
|
2474
|
+
menuItemFactory: ji
|
|
2356
2475
|
},
|
|
2357
|
-
[
|
|
2476
|
+
[Jt.id]: {
|
|
2358
2477
|
order: 2,
|
|
2359
|
-
menuItemFactory:
|
|
2478
|
+
menuItemFactory: qi
|
|
2360
2479
|
}
|
|
2361
2480
|
},
|
|
2362
|
-
[
|
|
2481
|
+
[Mn]: {
|
|
2363
2482
|
order: 6,
|
|
2364
|
-
menuItemFactory:
|
|
2365
|
-
[
|
|
2483
|
+
menuItemFactory: Zi,
|
|
2484
|
+
[Kt.id]: {
|
|
2366
2485
|
order: 1,
|
|
2367
|
-
menuItemFactory:
|
|
2486
|
+
menuItemFactory: Yi
|
|
2368
2487
|
},
|
|
2369
|
-
[
|
|
2488
|
+
[Xt.id]: {
|
|
2370
2489
|
order: 2,
|
|
2371
|
-
menuItemFactory:
|
|
2490
|
+
menuItemFactory: Qi
|
|
2372
2491
|
}
|
|
2373
2492
|
}
|
|
2374
2493
|
}
|
|
2375
2494
|
}
|
|
2376
2495
|
};
|
|
2377
|
-
var
|
|
2378
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
2496
|
+
var Gi = Object.getOwnPropertyDescriptor, Xi = (r, e, t, n) => {
|
|
2497
|
+
for (var i = n > 1 ? void 0 : n ? Gi(e, t) : e, a = r.length - 1, s; a >= 0; a--)
|
|
2379
2498
|
(s = r[a]) && (i = s(i) || i);
|
|
2380
2499
|
return i;
|
|
2381
|
-
},
|
|
2382
|
-
let
|
|
2500
|
+
}, Zt = (r, e) => (t, n) => e(t, n, r);
|
|
2501
|
+
let ot = class extends ke {
|
|
2383
2502
|
constructor(r, e) {
|
|
2384
2503
|
super(), this._componentManager = r, this._menuManagerService = e, this._initComponents(), this._initMenu();
|
|
2385
2504
|
}
|
|
2386
2505
|
_initComponents() {
|
|
2387
2506
|
[
|
|
2388
|
-
[
|
|
2389
|
-
[xe,
|
|
2390
|
-
[
|
|
2507
|
+
[gn, Tn],
|
|
2508
|
+
[xe, Hi],
|
|
2509
|
+
[bn, Ai]
|
|
2391
2510
|
].forEach(([r, e]) => {
|
|
2392
2511
|
this.disposeWithMe(this._componentManager.register(r, e));
|
|
2393
2512
|
});
|
|
2394
2513
|
}
|
|
2395
2514
|
_initMenu() {
|
|
2396
|
-
this._menuManagerService.mergeMenu(
|
|
2397
|
-
}
|
|
2398
|
-
};
|
|
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);
|
|
2406
|
-
return i;
|
|
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();
|
|
2411
|
-
}
|
|
2412
|
-
_dirtySkeleton() {
|
|
2413
|
-
var e;
|
|
2414
|
-
(e = this._context.mainComponent) == null || e.makeDirty();
|
|
2415
|
-
const r = this._sheetSkeletonManagerService.getCurrentParam();
|
|
2416
|
-
if (r) {
|
|
2417
|
-
const t = { ...r, dirty: !0 };
|
|
2418
|
-
this._sheetSkeletonManagerService.reCalculate(t);
|
|
2419
|
-
}
|
|
2420
|
-
}
|
|
2421
|
-
_initListener() {
|
|
2422
|
-
const r = this._tableManager, e = this._dirtySkeleton.bind(this);
|
|
2423
|
-
this.disposeWithMe(
|
|
2424
|
-
It(
|
|
2425
|
-
r.tableAdd$,
|
|
2426
|
-
r.tableDelete$,
|
|
2427
|
-
r.tableNameChanged$,
|
|
2428
|
-
r.tableRangeChanged$,
|
|
2429
|
-
r.tableThemeChanged$,
|
|
2430
|
-
r.tableFilterChanged$,
|
|
2431
|
-
r.tableInitStatus$,
|
|
2432
|
-
this._sheetTableThemeUIController.refreshTable$
|
|
2433
|
-
).subscribe(
|
|
2434
|
-
e
|
|
2435
|
-
)
|
|
2436
|
-
);
|
|
2437
|
-
}
|
|
2438
|
-
};
|
|
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);
|
|
2448
|
-
return i;
|
|
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();
|
|
2453
|
-
}
|
|
2454
|
-
_initSelectionChange() {
|
|
2455
|
-
this.disposeWithMe(
|
|
2456
|
-
this._sheetInterceptorService.interceptCommand({
|
|
2457
|
-
getMutations: (r) => {
|
|
2458
|
-
if (r.id === lr.id) {
|
|
2459
|
-
const e = ct(this._univerInstanceService);
|
|
2460
|
-
if (!e)
|
|
2461
|
-
return { redos: [], undos: [] };
|
|
2462
|
-
const t = r.params, { range: n } = t, { unitId: i, subUnitId: a, worksheet: s } = e, u = this._tableManager.getTablesBySubunitId(i, a).find((h) => {
|
|
2463
|
-
const d = h.getRange();
|
|
2464
|
-
return be.contains(d, n);
|
|
2465
|
-
});
|
|
2466
|
-
if (u) {
|
|
2467
|
-
const h = u.getRange(), d = {
|
|
2468
|
-
...h,
|
|
2469
|
-
startRow: h.startRow + 1
|
|
2470
|
-
};
|
|
2471
|
-
return be.equals(h, n) ? { undos: [], redos: [] } : be.equals(d, n) ? {
|
|
2472
|
-
undos: [],
|
|
2473
|
-
redos: [
|
|
2474
|
-
{
|
|
2475
|
-
id: Ft.id,
|
|
2476
|
-
params: {
|
|
2477
|
-
unitId: i,
|
|
2478
|
-
subUnitId: a,
|
|
2479
|
-
selections: [
|
|
2480
|
-
{
|
|
2481
|
-
range: h,
|
|
2482
|
-
primary: Bt(h, s)
|
|
2483
|
-
}
|
|
2484
|
-
]
|
|
2485
|
-
}
|
|
2486
|
-
}
|
|
2487
|
-
]
|
|
2488
|
-
} : {
|
|
2489
|
-
undos: [],
|
|
2490
|
-
redos: [
|
|
2491
|
-
{
|
|
2492
|
-
id: Ft.id,
|
|
2493
|
-
params: {
|
|
2494
|
-
unitId: i,
|
|
2495
|
-
subUnitId: a,
|
|
2496
|
-
selections: [
|
|
2497
|
-
{
|
|
2498
|
-
range: d,
|
|
2499
|
-
primary: Bt(d, s)
|
|
2500
|
-
}
|
|
2501
|
-
]
|
|
2502
|
-
}
|
|
2503
|
-
}
|
|
2504
|
-
]
|
|
2505
|
-
};
|
|
2506
|
-
}
|
|
2507
|
-
}
|
|
2508
|
-
return { redos: [], undos: [] };
|
|
2509
|
-
}
|
|
2510
|
-
})
|
|
2511
|
-
);
|
|
2515
|
+
this._menuManagerService.mergeMenu(zi);
|
|
2512
2516
|
}
|
|
2513
2517
|
};
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
],
|
|
2519
|
-
var
|
|
2520
|
-
for (var i = n > 1 ? void 0 : n ? Gi(e, t) : e, a = r.length - 1, s; a >= 0; a--)
|
|
2518
|
+
ot = Xi([
|
|
2519
|
+
Zt(0, N(nn)),
|
|
2520
|
+
Zt(1, N(fr))
|
|
2521
|
+
], ot);
|
|
2522
|
+
var Ki = Object.defineProperty, Ji = Object.getOwnPropertyDescriptor, ea = (r, e, t) => e in r ? Ki(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, ta = (r, e, t, n) => {
|
|
2523
|
+
for (var i = n > 1 ? void 0 : n ? Ji(e, t) : e, a = r.length - 1, s; a >= 0; a--)
|
|
2521
2524
|
(s = r[a]) && (i = s(i) || i);
|
|
2522
2525
|
return i;
|
|
2523
|
-
},
|
|
2524
|
-
let
|
|
2525
|
-
constructor(r =
|
|
2526
|
+
}, rt = (r, e) => (t, n) => e(t, n, r), dt = (r, e, t) => ea(r, typeof e != "symbol" ? e + "" : e, t);
|
|
2527
|
+
let Le = class extends Fn {
|
|
2528
|
+
constructor(r = Ut, e, t, n, i) {
|
|
2526
2529
|
super(), this._config = r, this._injector = e, this._commandService = t, this._configService = n, this._renderManagerService = i;
|
|
2527
|
-
const { menu: a, ...s } =
|
|
2530
|
+
const { menu: a, ...s } = Vn(
|
|
2528
2531
|
{},
|
|
2529
|
-
|
|
2532
|
+
Ut,
|
|
2530
2533
|
this._config
|
|
2531
2534
|
);
|
|
2532
|
-
a && this._configService.setConfig("menu", a, { merge: !0 }), this._configService.setConfig(
|
|
2535
|
+
a && this._configService.setConfig("menu", a, { merge: !0 }), this._configService.setConfig(yn, s), this._initRegisterCommand();
|
|
2533
2536
|
}
|
|
2534
2537
|
onStarting() {
|
|
2535
|
-
|
|
2538
|
+
Hn(this._injector, [
|
|
2536
2539
|
[$e],
|
|
2537
2540
|
[Ee],
|
|
2538
|
-
[
|
|
2541
|
+
[ot],
|
|
2539
2542
|
[Ie],
|
|
2540
2543
|
[st]
|
|
2541
2544
|
]);
|
|
2542
2545
|
}
|
|
2543
2546
|
onReady() {
|
|
2544
|
-
|
|
2547
|
+
An(this._injector, [
|
|
2545
2548
|
[$e],
|
|
2546
2549
|
[Ee],
|
|
2547
|
-
[
|
|
2550
|
+
[ot],
|
|
2548
2551
|
[Ie],
|
|
2549
2552
|
[st]
|
|
2550
2553
|
]);
|
|
@@ -2554,29 +2557,31 @@ let ot = class extends Bn {
|
|
|
2554
2557
|
}
|
|
2555
2558
|
_registerRenderModules() {
|
|
2556
2559
|
const r = [
|
|
2557
|
-
[
|
|
2558
|
-
[
|
|
2560
|
+
[Tt],
|
|
2561
|
+
[wt]
|
|
2559
2562
|
];
|
|
2560
|
-
this._config.hideAnchor !== !0 && r.push([
|
|
2561
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
2563
|
+
this._config.hideAnchor !== !0 && r.push([at]), r.forEach((e) => {
|
|
2564
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(Qe.UNIVER_SHEET, e));
|
|
2562
2565
|
});
|
|
2563
2566
|
}
|
|
2564
2567
|
_initRegisterCommand() {
|
|
2565
2568
|
[
|
|
2566
|
-
|
|
2567
|
-
|
|
2569
|
+
St,
|
|
2570
|
+
Et
|
|
2568
2571
|
].forEach((r) => this._commandService.registerCommand(r));
|
|
2569
2572
|
}
|
|
2570
2573
|
};
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2574
|
+
dt(Le, "pluginName", Zr);
|
|
2575
|
+
dt(Le, "packageName", vn.name);
|
|
2576
|
+
dt(Le, "version", vn.version);
|
|
2577
|
+
dt(Le, "type", Qe.UNIVER_SHEET);
|
|
2578
|
+
Le = ta([
|
|
2579
|
+
Bn(tr),
|
|
2580
|
+
rt(1, N(Pe)),
|
|
2581
|
+
rt(2, N(te)),
|
|
2582
|
+
rt(3, Qt),
|
|
2583
|
+
rt(4, Gt)
|
|
2584
|
+
], Le);
|
|
2580
2585
|
export {
|
|
2581
|
-
|
|
2586
|
+
Le as UniverSheetsTableUIPlugin
|
|
2582
2587
|
};
|