@univerjs/sheets-formula-ui 0.6.2 → 0.6.3
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 +2 -2
- package/lib/es/index.js +368 -367
- package/lib/types/facade/f-univer.d.ts +19 -10
- package/lib/types/services/range-selector.service.d.ts +1 -1
- package/lib/umd/index.js +2 -2
- package/package.json +13 -13
package/lib/es/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
var Yo = Object.defineProperty;
|
|
2
2
|
var zo = (t, e, n) => e in t ? Yo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
3
|
var B = (t, e, n) => zo(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
-
import { CommandType as Ie, ICommandService as ae, createIdentifier as Go, IContextService as tn, IUniverInstanceService as oe, Rectangle as Yn, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as nn, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as zn, DEFAULT_EMPTY_DOCUMENT_VALUE as Gn, isRealNum as Zo, CellValueType as Rn, getCellValueType as Xo, LocaleService as qe, Tools as
|
|
5
|
-
import { SheetPasteCommand as dr, PREDEFINED_HOOK_NAME as Qe, IEditorBridgeService as Xn, SetCellEditVisibleOperation as Qn, SheetSkeletonManagerService as wt, BaseSelectionRenderService as mr, getCoordByOffset as En, checkInHeaderRanges as bn, getAllSelection as gr, genNormalSelectionStyle as Jn, getSheetObject as pr, attachSelectionWithCoord as Gt, SelectionControl as eo, MoveSelectionCommand as Nn, JumpOver as yn, ExpandSelectionCommand as Tn, EMBEDDING_FORMULA_EDITOR as Sr, IMarkSelectionService as
|
|
6
|
-
import { sequenceNodeType as z, serializeRange as pe, LexerTreeBuilder as Ee, deserializeRangeWithSheetWithCache as Ar, matchRefDrawToken as Pr, isFormulaLexerToken as xr, matchToken as tt, deserializeRangeWithSheet as
|
|
7
|
-
import { Subject as
|
|
4
|
+
import { CommandType as Ie, ICommandService as ae, createIdentifier as Go, IContextService as tn, IUniverInstanceService as oe, Rectangle as Yn, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as nn, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as zn, DEFAULT_EMPTY_DOCUMENT_VALUE as Gn, isRealNum as Zo, CellValueType as Rn, getCellValueType as Xo, LocaleService as qe, Tools as ft, Inject as K, Injector as mt, ThemeService as gt, toDisposable as Zn, DisposableCollection as We, RANGE_TYPE as ge, UniverInstanceType as ue, ColorKit as on, getBodySlice as In, Direction as ne, EDITOR_ACTIVATED as It, createInternalEditorID as Qo, generateRandomId as Jo, BuildTextUtils as er, RichTextBuilder as tr, isFormulaString as Re, isFormulaId as Ve, FOCUSING_DOC as nr, FOCUSING_UNIVER_EDITOR as or, Disposable as pt, isICellData as rr, ObjectMatrix as et, ILogService as sr, RxDisposable as ir, InterceptorEffectEnum as cr, DependentOn as lr, IConfigService as ar, Plugin as ur, merge as fr, touchDependencies as hr } from "@univerjs/core";
|
|
5
|
+
import { SheetPasteCommand as dr, PREDEFINED_HOOK_NAME as Qe, IEditorBridgeService as Xn, SetCellEditVisibleOperation as Qn, SheetSkeletonManagerService as wt, BaseSelectionRenderService as mr, getCoordByOffset as En, checkInHeaderRanges as bn, getAllSelection as gr, genNormalSelectionStyle as Jn, getSheetObject as pr, attachSelectionWithCoord as Gt, SelectionControl as eo, MoveSelectionCommand as Nn, JumpOver as yn, ExpandSelectionCommand as Tn, EMBEDDING_FORMULA_EDITOR as Sr, IMarkSelectionService as Cr, HoverManagerService as vr, CellAlertManagerService as _r, CellAlertType as Rr, IAutoFillService as Ir, APPLY_TYPE as Er, DATA_TYPE as Fn, ISheetClipboardService as br, COPY_TYPE as to, SELECTION_SHAPE_DEPTH as Nr, useActiveWorkbook as yr, getCurrentRangeDisable$ as no, PASTE_SPECIAL_MENU_ID as Tr, whenFormulaEditorActivated as St, SheetsUIPart as Fr, RANGE_SELECTOR_COMPONENT_KEY as Or, EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY as Mr } from "@univerjs/sheets-ui";
|
|
6
|
+
import { sequenceNodeType as z, serializeRange as pe, LexerTreeBuilder as Ee, deserializeRangeWithSheetWithCache as Ar, matchRefDrawToken as Pr, isFormulaLexerToken as xr, matchToken as tt, deserializeRangeWithSheet as nt, serializeRangeWithSheet as ht, generateStringWithSequence as wr, operatorToken as oo, ERROR_TYPE_SET as Dr, ErrorType as se, FormulaDataModel as Dt, SetFormulaCalculationResultMutation as Lr, SetArrayFormulaDataMutation as kr, SetFormulaCalculationStopMutation as $r, FunctionType as Hr, UniverFormulaEnginePlugin as Ur } from "@univerjs/engine-formula";
|
|
7
|
+
import { Subject as st, BehaviorSubject as ro, throttleTime as so, debounceTime as rn, filter as Zt, map as io, distinctUntilChanged as Wr, merge as Vr, combineLatestWith as Br, switchMap as qr, of as On, Observable as jr } from "rxjs";
|
|
8
8
|
import { IEditorService as be, DocSelectionRenderService as co, ReplaceTextRunsCommand as Mn, MoveSelectionOperation as Kr, MoveCursorOperation as Yr, useKeyboardEvent as zr, useResize as Gr, DocBackScrollRenderController as Zr, RichTextEditor as Xr } from "@univerjs/docs-ui";
|
|
9
9
|
import { DeviceInputEventType as Ne, ScrollTimerType as Bt, SHEET_VIEWPORT_KEY as An, Vector2 as Pn, IRenderManagerService as ye } from "@univerjs/engine-render";
|
|
10
10
|
import { SheetsSelectionsService as sn, getSheetCommandTarget as lo, getCellAtRowCol as Qr, SetSelectionsOperation as cn, IRefSelectionsService as Lt, SelectionMoveType as qt, convertSelectionDataToRange as Jr, setEndForRange as es, REF_SELECTIONS_ENABLED as xn, SetWorksheetActiveOperation as wn, SetRangeValuesMutation as Dn, SetRangeValuesUndoMutationFactory as ts, SheetInterceptorService as ao, BEFORE_CELL_EDIT as ns, SetWorksheetRowAutoHeightMutation as os, INTERCEPTOR_POINT as rs, WorksheetSetCellValuePermission as uo, WorksheetEditPermission as fo, RangeProtectionPermissionEditPoint as ho, WorkbookEditablePermission as mo } from "@univerjs/sheets";
|
|
11
|
-
import { InsertFunctionCommand as ss, IDescriptionService as
|
|
12
|
-
import { ISidebarService as
|
|
13
|
-
import { jsx as b, jsxs as
|
|
14
|
-
import { clsx as
|
|
15
|
-
import { forwardRef as Te, useRef as j, createElement as Le, useEffect as L, useMemo as le, useState as
|
|
11
|
+
import { InsertFunctionCommand as ss, IDescriptionService as kt, TriggerCalculationController as is, UniverSheetsFormulaPlugin as cs } from "@univerjs/sheets-formula";
|
|
12
|
+
import { ISidebarService as $t, useDependency as O, useEvent as ee, RectPopup as go, IShortcutService as Ht, KeyCode as D, MetaKeys as W, IContextMenuService as ls, useObservable as Be, useUpdateEffect as as, IZenZoneService as us, ProgressBar as fs, useInjector as hs, ILayoutService as ds, MenuItemType as ln, getMenuHiddenObservable as ms, IClipboardInterfaceService as Ln, RibbonStartGroup as gs, IMenuManagerService as ps, IUIPartsService as po, ComponentManager as So, BuiltInUIPart as Co, connectInjector as Xt } from "@univerjs/ui";
|
|
13
|
+
import { jsx as b, jsxs as $, Fragment as ut } from "react/jsx-runtime";
|
|
14
|
+
import { clsx as kn, Tooltip as Ss, Dialog as Cs, Input as vo, Button as Je, Popup as _o, Select as vs } from "@univerjs/design";
|
|
15
|
+
import { forwardRef as Te, useRef as j, createElement as Le, useEffect as L, useMemo as le, useState as k, useCallback as yt, useLayoutEffect as Tt } from "react";
|
|
16
16
|
import { DocSelectionManagerService as Ro } from "@univerjs/docs";
|
|
17
17
|
import { debounceTime as _s } from "rxjs/operators";
|
|
18
18
|
const an = {
|
|
@@ -21,7 +21,7 @@ const an = {
|
|
|
21
21
|
handler: async (t) => t.get(ae).executeCommand(dr.id, {
|
|
22
22
|
value: Qe.SPECIAL_PASTE_FORMULA
|
|
23
23
|
})
|
|
24
|
-
},
|
|
24
|
+
}, ot = {
|
|
25
25
|
id: "formula-ui.operation.select-editor-formula",
|
|
26
26
|
type: Ie.OPERATION,
|
|
27
27
|
handler: (t, e) => !0
|
|
@@ -31,14 +31,14 @@ var Rs = Object.getOwnPropertyDescriptor, Is = (t, e, n, o) => {
|
|
|
31
31
|
(i = t[s]) && (r = i(r) || r);
|
|
32
32
|
return r;
|
|
33
33
|
}, Es = (t, e) => (n, o) => e(n, o, t);
|
|
34
|
-
const bs = "FORMULA_PROMPT_ACTIVATED",
|
|
34
|
+
const bs = "FORMULA_PROMPT_ACTIVATED", Ct = Go("formula-ui.prompt-service");
|
|
35
35
|
let Qt = class {
|
|
36
36
|
constructor(t) {
|
|
37
|
-
B(this, "_search$", new
|
|
38
|
-
B(this, "_help$", new
|
|
39
|
-
B(this, "_navigate$", new
|
|
40
|
-
B(this, "_accept$", new
|
|
41
|
-
B(this, "_acceptFormulaName$", new
|
|
37
|
+
B(this, "_search$", new st());
|
|
38
|
+
B(this, "_help$", new st());
|
|
39
|
+
B(this, "_navigate$", new st());
|
|
40
|
+
B(this, "_accept$", new st());
|
|
41
|
+
B(this, "_acceptFormulaName$", new st());
|
|
42
42
|
B(this, "search$", this._search$.asObservable());
|
|
43
43
|
B(this, "help$", this._help$.asObservable());
|
|
44
44
|
B(this, "navigate$", this._navigate$.asObservable());
|
|
@@ -193,13 +193,13 @@ Qt = Is([
|
|
|
193
193
|
const Ns = {
|
|
194
194
|
id: "formula-ui.operation.help-function",
|
|
195
195
|
type: Ie.OPERATION,
|
|
196
|
-
handler: async (t, e) => (t.get(
|
|
196
|
+
handler: async (t, e) => (t.get(Ct).help(e), !0)
|
|
197
197
|
}, un = {
|
|
198
198
|
id: "formula-ui.operation.insert-function",
|
|
199
199
|
type: Ie.OPERATION,
|
|
200
200
|
// eslint-disable-next-line
|
|
201
201
|
handler: async (t, e) => {
|
|
202
|
-
var S,
|
|
202
|
+
var S, C;
|
|
203
203
|
const n = t.get(sn), o = t.get(be), r = n.getCurrentSelections();
|
|
204
204
|
if (!r || !r.length)
|
|
205
205
|
return !1;
|
|
@@ -210,16 +210,16 @@ const Ns = {
|
|
|
210
210
|
const l = [], d = [];
|
|
211
211
|
let f = null, R = 0, g = 0, p = "";
|
|
212
212
|
if (r.length === 1 && (Fs(r[0].range) || Os(r[0].range) && Hn(h, r[0].range))) {
|
|
213
|
-
const { range:
|
|
214
|
-
f =
|
|
215
|
-
const A =
|
|
213
|
+
const { range: v, primary: I } = r[0], T = (S = I == null ? void 0 : I.actualRow) != null ? S : v.startRow, w = (C = I == null ? void 0 : I.actualColumn) != null ? C : v.startColumn;
|
|
214
|
+
f = v, R = T, g = w;
|
|
215
|
+
const A = $n(h, T, w);
|
|
216
216
|
A && (p = pe(A));
|
|
217
217
|
} else
|
|
218
|
-
r.some((
|
|
218
|
+
r.some((v) => {
|
|
219
219
|
var w, A;
|
|
220
|
-
const { range: I, primary: T } =
|
|
220
|
+
const { range: I, primary: T } = v;
|
|
221
221
|
if (Hn(h, I)) {
|
|
222
|
-
const M = (w = T == null ? void 0 : T.actualRow) != null ? w : I.startRow, _ = (A = T == null ? void 0 : T.actualColumn) != null ? A : I.startColumn, N =
|
|
222
|
+
const M = (w = T == null ? void 0 : T.actualRow) != null ? w : I.startRow, _ = (A = T == null ? void 0 : T.actualColumn) != null ? A : I.startColumn, N = $n(h, M, _);
|
|
223
223
|
if (!N)
|
|
224
224
|
return f = I, R = M, g = _, !0;
|
|
225
225
|
const P = pe(N), y = `=${u}(${P})`;
|
|
@@ -276,17 +276,17 @@ const Ns = {
|
|
|
276
276
|
return !1;
|
|
277
277
|
});
|
|
278
278
|
if (f) {
|
|
279
|
-
const
|
|
279
|
+
const v = Qr(R, g, i), I = {
|
|
280
280
|
range: Yn.clone(f),
|
|
281
281
|
primary: {
|
|
282
|
-
startRow:
|
|
283
|
-
startColumn:
|
|
284
|
-
endRow:
|
|
285
|
-
endColumn:
|
|
282
|
+
startRow: v.startRow,
|
|
283
|
+
startColumn: v.startColumn,
|
|
284
|
+
endRow: v.endRow,
|
|
285
|
+
endColumn: v.endColumn,
|
|
286
286
|
actualRow: R,
|
|
287
287
|
actualColumn: g,
|
|
288
|
-
isMerged:
|
|
289
|
-
isMergedMainCell:
|
|
288
|
+
isMerged: v.isMerged,
|
|
289
|
+
isMergedMainCell: v.startRow === R && v.startColumn === g
|
|
290
290
|
}
|
|
291
291
|
}, T = {
|
|
292
292
|
unitId: c,
|
|
@@ -309,7 +309,7 @@ const Ns = {
|
|
|
309
309
|
});
|
|
310
310
|
}
|
|
311
311
|
};
|
|
312
|
-
function
|
|
312
|
+
function $n(t, e, n) {
|
|
313
313
|
const o = ys(t, e, n);
|
|
314
314
|
if (o !== e)
|
|
315
315
|
return {
|
|
@@ -331,11 +331,11 @@ function ys(t, e, n) {
|
|
|
331
331
|
if (e === 0) return e;
|
|
332
332
|
for (let r = e - 1; r >= 0; r--) {
|
|
333
333
|
const s = t.getValue(r, n);
|
|
334
|
-
if (
|
|
334
|
+
if (dt(s) && !o) {
|
|
335
335
|
if (r === 0) return 0;
|
|
336
336
|
o = !0;
|
|
337
337
|
} else {
|
|
338
|
-
if (o && !
|
|
338
|
+
if (o && !dt(s))
|
|
339
339
|
return r + 1;
|
|
340
340
|
if (o && r === 0)
|
|
341
341
|
return 0;
|
|
@@ -348,11 +348,11 @@ function Ts(t, e, n) {
|
|
|
348
348
|
if (n === 0) return n;
|
|
349
349
|
for (let r = n - 1; r >= 0; r--) {
|
|
350
350
|
const s = t.getValue(e, r);
|
|
351
|
-
if (
|
|
351
|
+
if (dt(s) && !o) {
|
|
352
352
|
if (r === 0) return 0;
|
|
353
353
|
o = !0;
|
|
354
354
|
} else {
|
|
355
|
-
if (o && !
|
|
355
|
+
if (o && !dt(s))
|
|
356
356
|
return r + 1;
|
|
357
357
|
if (o && r === 0)
|
|
358
358
|
return 0;
|
|
@@ -360,7 +360,7 @@ function Ts(t, e, n) {
|
|
|
360
360
|
}
|
|
361
361
|
return n;
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function dt(t) {
|
|
364
364
|
if (t != null && t.p) {
|
|
365
365
|
const e = t == null ? void 0 : t.p.body;
|
|
366
366
|
if (e == null)
|
|
@@ -379,7 +379,7 @@ function Os(t) {
|
|
|
379
379
|
function Hn(t, e) {
|
|
380
380
|
for (let n = e.startRow; n <= e.endRow; n++)
|
|
381
381
|
for (let o = e.startColumn; o <= e.endColumn; o++)
|
|
382
|
-
if (
|
|
382
|
+
if (dt(t.getValue(n, o)))
|
|
383
383
|
return !1;
|
|
384
384
|
return !0;
|
|
385
385
|
}
|
|
@@ -398,7 +398,7 @@ function As(t, e, n, o) {
|
|
|
398
398
|
const Io = "SHEET_FORMULA_UI_PLUGIN", Eo = `${Io}_MORE_FUNCTIONS_COMPONENT`, fn = {
|
|
399
399
|
id: "formula-ui.operation.more-functions",
|
|
400
400
|
type: Ie.OPERATION,
|
|
401
|
-
handler: async (t) => (t.get(
|
|
401
|
+
handler: async (t) => (t.get($t).open({
|
|
402
402
|
header: { title: "formula.insert.tooltip" },
|
|
403
403
|
children: { label: Eo }
|
|
404
404
|
}), !0)
|
|
@@ -409,7 +409,7 @@ const Io = "SHEET_FORMULA_UI_PLUGIN", Eo = `${Io}_MORE_FUNCTIONS_COMPONENT`, fn
|
|
|
409
409
|
}, Ps = {
|
|
410
410
|
id: "formula-ui.operation.search-function",
|
|
411
411
|
type: Ie.OPERATION,
|
|
412
|
-
handler: async (t, e) => (t.get(
|
|
412
|
+
handler: async (t, e) => (t.get(Ct).search(e), !0)
|
|
413
413
|
}, hn = (t, e, n = !0) => {
|
|
414
414
|
let o = -1;
|
|
415
415
|
return t.reduce((r, s, i) => {
|
|
@@ -449,7 +449,7 @@ var ce = function() {
|
|
|
449
449
|
for (var r = 0, o = Object.getOwnPropertySymbols(t); r < o.length; r++)
|
|
450
450
|
e.indexOf(o[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, o[r]) && (n[o[r]] = t[o[r]]);
|
|
451
451
|
return n;
|
|
452
|
-
},
|
|
452
|
+
}, ke = Te(function(t, e) {
|
|
453
453
|
var n = t.icon, o = t.id, r = t.className, s = t.extend, i = xs(t, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(o, " ").concat(r || "").trim(), a = j("_".concat(Ls()));
|
|
454
454
|
return yo(n, "".concat(o), { defIds: n.defIds, idSuffix: a.current }, ce({ ref: e, className: c }, i), s);
|
|
455
455
|
});
|
|
@@ -479,25 +479,25 @@ function Ds(t, e) {
|
|
|
479
479
|
function Ls() {
|
|
480
480
|
return Math.random().toString(36).substring(2, 8);
|
|
481
481
|
}
|
|
482
|
-
|
|
483
|
-
var
|
|
484
|
-
return Le(
|
|
482
|
+
ke.displayName = "UniverIcon";
|
|
483
|
+
var ks = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, To = Te(function(t, e) {
|
|
484
|
+
return Le(ke, Object.assign({}, t, {
|
|
485
485
|
id: "check-mark-single",
|
|
486
486
|
ref: e,
|
|
487
|
-
icon:
|
|
487
|
+
icon: ks
|
|
488
488
|
}));
|
|
489
489
|
});
|
|
490
490
|
To.displayName = "CheckMarkSingle";
|
|
491
|
-
var
|
|
492
|
-
return Le(
|
|
491
|
+
var $s = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3.71274 2.86421C3.47843 2.6299 3.09853 2.6299 2.86421 2.86421C2.6299 3.09853 2.6299 3.47843 2.86421 3.71274L7.15154 8.00007L2.86421 12.2874C2.6299 12.5217 2.6299 12.9016 2.86421 13.1359C3.09853 13.3702 3.47843 13.3702 3.71274 13.1359L8.00007 8.84859L12.2874 13.1359C12.5217 13.3702 12.9016 13.3702 13.1359 13.1359C13.3702 12.9016 13.3702 12.5217 13.1359 12.2874L8.84859 8.00007L13.1359 3.71274C13.3702 3.47843 13.3702 3.09853 13.1359 2.86421C12.9016 2.6299 12.5217 2.6299 12.2874 2.86421L8.00007 7.15154L3.71274 2.86421Z" } }] }, Ut = Te(function(t, e) {
|
|
492
|
+
return Le(ke, Object.assign({}, t, {
|
|
493
493
|
id: "close-single",
|
|
494
494
|
ref: e,
|
|
495
|
-
icon:
|
|
495
|
+
icon: $s
|
|
496
496
|
}));
|
|
497
497
|
});
|
|
498
498
|
Ut.displayName = "CloseSingle";
|
|
499
499
|
var Hs = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Fo = Te(function(t, e) {
|
|
500
|
-
return Le(
|
|
500
|
+
return Le(ke, Object.assign({}, t, {
|
|
501
501
|
id: "delete-single",
|
|
502
502
|
ref: e,
|
|
503
503
|
icon: Hs
|
|
@@ -505,7 +505,7 @@ var Hs = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em"
|
|
|
505
505
|
});
|
|
506
506
|
Fo.displayName = "DeleteSingle";
|
|
507
507
|
var Us = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.75 5.32495C8.75 5.73916 8.41421 6.07495 8 6.07495 7.58579 6.07495 7.25 5.73916 7.25 5.32495 7.25 4.91074 7.58579 4.57495 8 4.57495 8.41421 4.57495 8.75 4.91074 8.75 5.32495zM8.5999 7.52505C8.5999 7.19368 8.33127 6.92505 7.9999 6.92505 7.66853 6.92505 7.3999 7.19368 7.3999 7.52505V11.425C7.3999 11.7564 7.66853 12.025 7.9999 12.025 8.33127 12.025 8.5999 11.7564 8.5999 11.425V7.52505z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M0.899902 8.00002C0.899902 4.0788 4.07868 0.900024 7.9999 0.900024C11.9211 0.900024 15.0999 4.0788 15.0999 8.00002C15.0999 11.9212 11.9211 15.1 7.9999 15.1C4.07868 15.1 0.899902 11.9212 0.899902 8.00002ZM7.9999 2.10002C4.74142 2.10002 2.0999 4.74154 2.0999 8.00002C2.0999 11.2585 4.74142 13.9 7.9999 13.9C11.2584 13.9 13.8999 11.2585 13.8999 8.00002C13.8999 4.74154 11.2584 2.10002 7.9999 2.10002Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Oo = Te(function(t, e) {
|
|
508
|
-
return Le(
|
|
508
|
+
return Le(ke, Object.assign({}, t, {
|
|
509
509
|
id: "details-single",
|
|
510
510
|
ref: e,
|
|
511
511
|
icon: Us
|
|
@@ -513,7 +513,7 @@ var Us = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em"
|
|
|
513
513
|
});
|
|
514
514
|
Oo.displayName = "DetailsSingle";
|
|
515
515
|
var Ws = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z" } }] }, Mo = Te(function(t, e) {
|
|
516
|
-
return Le(
|
|
516
|
+
return Le(ke, Object.assign({}, t, {
|
|
517
517
|
id: "increase-single",
|
|
518
518
|
ref: e,
|
|
519
519
|
icon: Ws
|
|
@@ -521,7 +521,7 @@ var Ws = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em"
|
|
|
521
521
|
});
|
|
522
522
|
Mo.displayName = "IncreaseSingle";
|
|
523
523
|
var Vs = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.90913 3.57564C6.14345 3.34132 6.52335 3.34132 6.75766 3.57564L10.7577 7.57564C10.992 7.80995 10.992 8.18985 10.7577 8.42417L6.75766 12.4242C6.52335 12.6585 6.14345 12.6585 5.90913 12.4242C5.67482 12.1899 5.67482 11.81 5.90913 11.5756L9.48487 7.9999L5.90913 4.42417C5.67482 4.18985 5.67482 3.80995 5.90913 3.57564Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, dn = Te(function(t, e) {
|
|
524
|
-
return Le(
|
|
524
|
+
return Le(ke, Object.assign({}, t, {
|
|
525
525
|
id: "more-single",
|
|
526
526
|
ref: e,
|
|
527
527
|
icon: Vs
|
|
@@ -529,7 +529,7 @@ var Vs = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em"
|
|
|
529
529
|
});
|
|
530
530
|
dn.displayName = "MoreSingle";
|
|
531
531
|
var Bs = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.6185 12.4423C12.5907 12.2749 12.7773 12.15 12.9343 12.2308L15.4242 13.5126C15.6102 13.6084 15.5544 13.8745 15.3439 13.8955L14.2456 14.184L13.4521 15.1286C13.3495 15.2939 13.085 15.2463 13.0534 15.0568L12.6185 12.4423Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1 3.6C1 2.16406 2.16406 1 3.6 1H12.3C13.7359 1 14.9 2.16406 14.9 3.6V5.81156C14.9003 5.81881 14.9004 5.82609 14.9004 5.8334C14.9004 5.84071 14.9003 5.84799 14.9 5.85524V10.045C14.9003 10.0522 14.9004 10.0595 14.9004 10.0668C14.9004 10.3982 14.6318 10.6668 14.3004 10.6668H11.1668C10.8907 10.6668 10.6668 10.8907 10.6668 11.1668V14.3C10.6668 14.6314 10.3982 14.9 10.0668 14.9L10.05 14.8998L3.6 14.9C2.16406 14.9 1 13.7359 1 12.3V3.6ZM13.2 5.2334C13.4761 5.2334 13.7 5.00954 13.7 4.7334V3.6C13.7 2.8268 13.0732 2.2 12.3 2.2H11.1668C10.8907 2.2 10.6668 2.42386 10.6668 2.7V4.7334C10.6668 5.00954 10.8907 5.2334 11.1668 5.2334H13.2ZM10.6668 6.9334C10.6668 6.65726 10.8907 6.4334 11.1668 6.4334H13.2C13.4761 6.4334 13.7 6.65726 13.7 6.9334V8.9668C13.7 9.24294 13.4761 9.4668 13.2 9.4668H11.1668C10.8907 9.4668 10.6668 9.24294 10.6668 8.9668V6.9334ZM8.9668 5.2334C9.24294 5.2334 9.4668 5.00954 9.4668 4.7334V2.7C9.4668 2.42386 9.24294 2.2 8.9668 2.2H6.9334C6.65726 2.2 6.4334 2.42386 6.4334 2.7V4.7334C6.4334 5.00954 6.65726 5.2334 6.9334 5.2334L8.9668 5.2334ZM6.4334 6.9334C6.4334 6.65726 6.65726 6.4334 6.9334 6.4334L8.9668 6.4334C9.24294 6.4334 9.4668 6.65726 9.4668 6.9334V8.9668C9.4668 9.24294 9.24294 9.4668 8.9668 9.4668L6.9334 9.4668C6.65726 9.4668 6.4334 9.24294 6.4334 8.9668V6.9334ZM4.7334 5.2334C5.00954 5.2334 5.2334 5.00954 5.2334 4.7334V2.7C5.2334 2.42386 5.00954 2.2 4.7334 2.2H3.6C2.8268 2.2 2.2 2.8268 2.2 3.6V4.7334C2.2 5.00954 2.42386 5.2334 2.7 5.2334H4.7334ZM2.2 6.9334C2.2 6.65726 2.42386 6.4334 2.7 6.4334H4.7334C5.00954 6.4334 5.2334 6.65725 5.2334 6.9334V8.9668C5.2334 9.24294 5.00954 9.4668 4.7334 9.4668H2.7C2.42386 9.4668 2.2 9.24294 2.2 8.9668V6.9334ZM5.2334 11.1668C5.2334 10.8907 5.00954 10.6668 4.7334 10.6668H2.7C2.42386 10.6668 2.2 10.8907 2.2 11.1668V12.3C2.2 13.0732 2.8268 13.7 3.6 13.7H4.7334C5.00954 13.7 5.2334 13.4761 5.2334 13.2V11.1668ZM9.4668 11.1668C9.4668 10.8907 9.24294 10.6668 8.9668 10.6668H6.9334C6.65726 10.6668 6.4334 10.8907 6.4334 11.1668V13.2C6.4334 13.4761 6.65726 13.7 6.9334 13.7H8.9668C9.24294 13.7 9.4668 13.4761 9.4668 13.2V11.1668Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Ao = Te(function(t, e) {
|
|
532
|
-
return Le(
|
|
532
|
+
return Le(ke, Object.assign({}, t, {
|
|
533
533
|
id: "select-range-single",
|
|
534
534
|
ref: e,
|
|
535
535
|
icon: Bs
|
|
@@ -566,7 +566,7 @@ const js = (t, e = 100) => {
|
|
|
566
566
|
}, [t, e]);
|
|
567
567
|
};
|
|
568
568
|
function Po(t, e, n) {
|
|
569
|
-
const o = O(be), r = le(() => new ro({ left: -999, top: -999, right: -999, bottom: -999 }), []), s = O(
|
|
569
|
+
const o = O(be), r = le(() => new ro({ left: -999, top: -999, right: -999, bottom: -999 }), []), s = O($t), i = O(oe), c = ee(() => {
|
|
570
570
|
const a = o.getEditor(t);
|
|
571
571
|
if (!a)
|
|
572
572
|
return;
|
|
@@ -587,7 +587,7 @@ const je = (t) => {
|
|
|
587
587
|
const e = j(t);
|
|
588
588
|
return e.current = t, e;
|
|
589
589
|
}, Ks = (t, e, n) => {
|
|
590
|
-
const o = O(
|
|
590
|
+
const o = O(kt), r = O(Ee), [s, i] = k(), [c, a] = k(-1), [h, u] = k(!0), m = je(h), l = j(e);
|
|
591
591
|
l.current = e;
|
|
592
592
|
const d = () => {
|
|
593
593
|
i(void 0), a(-1), u(!1);
|
|
@@ -600,8 +600,8 @@ const je = (t) => {
|
|
|
600
600
|
if (p.collapsed && m.current) {
|
|
601
601
|
const S = r.getFunctionAndParameter(`${l.current}A`, p.startOffset - 1);
|
|
602
602
|
if (S) {
|
|
603
|
-
const { functionName:
|
|
604
|
-
i(I), a(
|
|
603
|
+
const { functionName: C, paramIndex: v } = S, I = o.getFunctionInfo(C);
|
|
604
|
+
i(I), a(v);
|
|
605
605
|
return;
|
|
606
606
|
}
|
|
607
607
|
}
|
|
@@ -641,7 +641,7 @@ const je = (t) => {
|
|
|
641
641
|
formulaHelpParamPrefix: ri,
|
|
642
642
|
formulaHelpParamItem: si,
|
|
643
643
|
formulaHelpParamActive: ii
|
|
644
|
-
}, jt = ({ className: t, title: e, value: n }) => /* @__PURE__ */
|
|
644
|
+
}, jt = ({ className: t, title: e, value: n }) => /* @__PURE__ */ $("div", { className: J.formulaHelpFunctionContentParams, children: [
|
|
645
645
|
/* @__PURE__ */ b(
|
|
646
646
|
"div",
|
|
647
647
|
{
|
|
@@ -655,12 +655,12 @@ const je = (t) => {
|
|
|
655
655
|
/* @__PURE__ */ b("div", { className: J.formulaHelpFunctionContentParamsDetail, children: n })
|
|
656
656
|
] }), ci = (t) => {
|
|
657
657
|
const { prefix: e, value: n, active: o, onClick: r } = t;
|
|
658
|
-
return /* @__PURE__ */
|
|
659
|
-
/* @__PURE__ */
|
|
658
|
+
return /* @__PURE__ */ $("div", { className: J.formulaHelpParam, children: [
|
|
659
|
+
/* @__PURE__ */ $("span", { className: J.formulaHelpParamPrefix, children: [
|
|
660
660
|
e,
|
|
661
661
|
"("
|
|
662
662
|
] }),
|
|
663
|
-
n && n.map((s, i) => /* @__PURE__ */
|
|
663
|
+
n && n.map((s, i) => /* @__PURE__ */ $("span", { className: J.formulaHelpParamItem, children: [
|
|
664
664
|
/* @__PURE__ */ b(
|
|
665
665
|
"span",
|
|
666
666
|
{
|
|
@@ -676,15 +676,15 @@ const je = (t) => {
|
|
|
676
676
|
}, Un = () => {
|
|
677
677
|
};
|
|
678
678
|
function li(t) {
|
|
679
|
-
const { onParamsSwitch: e = Un, onClose: n = Un, isFocus: o, editor: r, formulaText: s } = t, { functionInfo: i, paramIndex: c, reset: a } = Ks(o, s, r), h = le(() => !!i && c >= 0, [i, c]), [u, m] =
|
|
680
|
-
function p(
|
|
681
|
-
e && e(
|
|
679
|
+
const { onParamsSwitch: e = Un, onClose: n = Un, isFocus: o, editor: r, formulaText: s } = t, { functionInfo: i, paramIndex: c, reset: a } = Ks(o, s, r), h = le(() => !!i && c >= 0, [i, c]), [u, m] = k(!0), l = O(qe), d = l.t("formula.prompt.required"), f = l.t("formula.prompt.optional"), R = r.getEditorId(), [g] = Po(R, h, [i, c]);
|
|
680
|
+
function p(C) {
|
|
681
|
+
e && e(C);
|
|
682
682
|
}
|
|
683
683
|
const S = () => {
|
|
684
684
|
a(), n();
|
|
685
685
|
};
|
|
686
|
-
return h && i ? /* @__PURE__ */ b(go, { portal: !0, onClickOutside: () => a(), anchorRect$: g, direction: "vertical", children: /* @__PURE__ */
|
|
687
|
-
/* @__PURE__ */
|
|
686
|
+
return h && i ? /* @__PURE__ */ b(go, { portal: !0, onClickOutside: () => a(), anchorRect$: g, direction: "vertical", children: /* @__PURE__ */ $("div", { className: J.formulaHelpFunction, children: [
|
|
687
|
+
/* @__PURE__ */ $("div", { className: J.formulaHelpFunctionTitle, children: [
|
|
688
688
|
/* @__PURE__ */ b(
|
|
689
689
|
ci,
|
|
690
690
|
{
|
|
@@ -694,7 +694,7 @@ function li(t) {
|
|
|
694
694
|
onClick: p
|
|
695
695
|
}
|
|
696
696
|
),
|
|
697
|
-
/* @__PURE__ */
|
|
697
|
+
/* @__PURE__ */ $("div", { className: J.formulaHelpFunctionTitleIcons, children: [
|
|
698
698
|
/* @__PURE__ */ b(
|
|
699
699
|
"div",
|
|
700
700
|
{
|
|
@@ -722,12 +722,12 @@ function li(t) {
|
|
|
722
722
|
height: u ? "unset" : 0,
|
|
723
723
|
padding: u ? "revert-layer" : 0
|
|
724
724
|
},
|
|
725
|
-
children: /* @__PURE__ */
|
|
725
|
+
children: /* @__PURE__ */ $("div", { className: J.formulaHelpFunctionContentInner, children: [
|
|
726
726
|
/* @__PURE__ */ b(
|
|
727
727
|
jt,
|
|
728
728
|
{
|
|
729
729
|
title: l.t("formula.prompt.helpExample"),
|
|
730
|
-
value: `${i.functionName}(${i.functionParameter.map((
|
|
730
|
+
value: `${i.functionName}(${i.functionParameter.map((C) => C.example).join(",")})`
|
|
731
731
|
}
|
|
732
732
|
),
|
|
733
733
|
/* @__PURE__ */ b(
|
|
@@ -737,14 +737,14 @@ function li(t) {
|
|
|
737
737
|
value: i.description
|
|
738
738
|
}
|
|
739
739
|
),
|
|
740
|
-
i && i.functionParameter && i.functionParameter.map((
|
|
740
|
+
i && i.functionParameter && i.functionParameter.map((C, v) => /* @__PURE__ */ b(
|
|
741
741
|
jt,
|
|
742
742
|
{
|
|
743
|
-
className: c ===
|
|
744
|
-
title:
|
|
745
|
-
value: `${
|
|
743
|
+
className: c === v ? J.formulaHelpFunctionActive : "",
|
|
744
|
+
title: C.name,
|
|
745
|
+
value: `${C.require ? d : f} ${C.detail}`
|
|
746
746
|
},
|
|
747
|
-
|
|
747
|
+
v
|
|
748
748
|
))
|
|
749
749
|
] })
|
|
750
750
|
}
|
|
@@ -758,7 +758,7 @@ const ai = (t) => {
|
|
|
758
758
|
if (t) {
|
|
759
759
|
e.focus(t.getEditorId());
|
|
760
760
|
const i = [...t.getSelectionRanges()];
|
|
761
|
-
if (
|
|
761
|
+
if (ft.isDefine(o))
|
|
762
762
|
t.setSelectionRanges([{ startOffset: o, endOffset: o }]);
|
|
763
763
|
else if (!i.length && !t.docSelectionRenderService.isOnPointerEvent) {
|
|
764
764
|
const c = (s = (r = t.getDocumentData().body) == null ? void 0 : r.dataStream) != null ? s : `\r
|
|
@@ -931,17 +931,17 @@ let De = class extends mr {
|
|
|
931
931
|
}
|
|
932
932
|
const S = { range: p, primary: p, style: null };
|
|
933
933
|
S.range.rangeType = o;
|
|
934
|
-
const
|
|
935
|
-
this._startRangeWhenPointerDown = { ...
|
|
936
|
-
const
|
|
934
|
+
const C = Gt(S, this._skeleton);
|
|
935
|
+
this._startRangeWhenPointerDown = { ...C.rangeWithCoord };
|
|
936
|
+
const v = { ...C.rangeWithCoord, rangeType: o };
|
|
937
937
|
let I = this.getActiveSelectionControl();
|
|
938
938
|
const T = this.getSelectionControls();
|
|
939
939
|
for (const N of T) {
|
|
940
|
-
if (e.button === 2 && Yn.contains(N.model,
|
|
940
|
+
if (e.button === 2 && Yn.contains(N.model, v)) {
|
|
941
941
|
I = N;
|
|
942
942
|
return;
|
|
943
943
|
}
|
|
944
|
-
if (N.model.isEqual(
|
|
944
|
+
if (N.model.isEqual(v)) {
|
|
945
945
|
I = N;
|
|
946
946
|
break;
|
|
947
947
|
}
|
|
@@ -950,12 +950,12 @@ let De = class extends mr {
|
|
|
950
950
|
const w = I == null ? void 0 : I.model.currentCell, A = e.shiftKey && w, M = this._remainLastEnabled && !e.ctrlKey && !e.shiftKey && !this._skipLastEnabled && !this._singleSelectionEnabled;
|
|
951
951
|
A && w ? this._makeSelectionByTwoCells(
|
|
952
952
|
w,
|
|
953
|
-
|
|
953
|
+
v,
|
|
954
954
|
i,
|
|
955
955
|
o,
|
|
956
956
|
I
|
|
957
957
|
// Get updated in this method
|
|
958
|
-
) : M && I ? I.updateRangeBySelectionWithCoord(
|
|
958
|
+
) : M && I ? I.updateRangeBySelectionWithCoord(C) : I = this.newSelectionControl(c, i, S);
|
|
959
959
|
for (let N = 0; N < this.getSelectionControls().length - 1; N++)
|
|
960
960
|
this.getSelectionControls()[N].clearHighlight();
|
|
961
961
|
this._selectionMoveStart$.next(this.getSelectionDataWithStyle()), c.disableObjectsEvent(), this._clearUpdatingListeners(), this._addEndingListeners(), (_ = c.getTransformer()) == null || _.clearSelectedObjects(), this._setupPointerMoveListener(u, I, o, s, l, d), this._escapeShortcutDisposable = this._shortcutService.forceEscape(), this._scenePointerUpSub = c.onPointerUp$.subscribeEvent(() => {
|
|
@@ -991,8 +991,8 @@ let De = class extends mr {
|
|
|
991
991
|
}
|
|
992
992
|
};
|
|
993
993
|
De = fi([
|
|
994
|
-
Ze(1, K(
|
|
995
|
-
Ze(2, K(
|
|
994
|
+
Ze(1, K(mt)),
|
|
995
|
+
Ze(2, K(gt)),
|
|
996
996
|
Ze(3, Ht),
|
|
997
997
|
Ze(4, K(wt)),
|
|
998
998
|
Ze(5, tn),
|
|
@@ -1010,18 +1010,18 @@ function di(t) {
|
|
|
1010
1010
|
var we = /* @__PURE__ */ ((t) => (t[t.NOT_SELECT = 0] = "NOT_SELECT", t[t.NEED_ADD = 1] = "NEED_ADD", t[t.CAN_EDIT = 2] = "CAN_EDIT", t[t.EDIT_OTHER_SHEET_REFERENCE = 3] = "EDIT_OTHER_SHEET_REFERENCE", t))(we || {});
|
|
1011
1011
|
function mi(t) {
|
|
1012
1012
|
var w;
|
|
1013
|
-
const { editorId: e, isFocus: n, disableOnClick: o, unitId: r, subUnitId: s } = t, i = O(ye), c = O(oe), a = i.getRenderById(r), h = i.getRenderById(e), u = h == null ? void 0 : h.with(co), m = O(Ro), l = O(
|
|
1013
|
+
const { editorId: e, isFocus: n, disableOnClick: o, unitId: r, subUnitId: s } = t, i = O(ye), c = O(oe), a = i.getRenderById(r), h = i.getRenderById(e), u = h == null ? void 0 : h.with(co), m = O(Ro), l = O(mt), [d, f] = k(
|
|
1014
1014
|
0
|
|
1015
1015
|
/* NOT_SELECT */
|
|
1016
|
-
), R = O(Ee), g = j(!0), p = a == null ? void 0 : a.with(De), S = je(d),
|
|
1016
|
+
), R = O(Ee), g = j(!0), p = a == null ? void 0 : a.with(De), S = je(d), C = c.getUnit(r, ue.UNIVER_SHEET), v = C == null ? void 0 : C.getSheetBySheetId(s), I = ee((A) => {
|
|
1017
1017
|
p && p.setSkipLastEnabled(
|
|
1018
1018
|
A === 1 || A === 3
|
|
1019
1019
|
/* EDIT_OTHER_SHEET_REFERENCE */
|
|
1020
1020
|
), S.current = A, f(A);
|
|
1021
1021
|
}), T = ee(() => {
|
|
1022
1022
|
var te, ie;
|
|
1023
|
-
if (!
|
|
1024
|
-
const A =
|
|
1023
|
+
if (!C) return;
|
|
1024
|
+
const A = C.getActiveSheet(), M = u == null ? void 0 : u.getActiveTextRange(), _ = M != null && M.collapsed ? M.startOffset : -1, N = di(l);
|
|
1025
1025
|
if (!N) return;
|
|
1026
1026
|
const P = (te = N == null ? void 0 : N.dataStream) == null ? void 0 : te.slice(0, -2), y = ((ie = R.sequenceNodesBuilder(P)) != null ? ie : []).map((q) => typeof q == "object" ? q.nodeType === z.REFERENCE ? {
|
|
1027
1027
|
...q,
|
|
@@ -1034,7 +1034,7 @@ function mi(t) {
|
|
|
1034
1034
|
if (V) {
|
|
1035
1035
|
if (g.current)
|
|
1036
1036
|
return;
|
|
1037
|
-
!x.range.sheetName && A.getSheetId() === (
|
|
1037
|
+
!x.range.sheetName && A.getSheetId() === (v == null ? void 0 : v.getSheetId()) || x.range.sheetName === A.getName() ? I(
|
|
1038
1038
|
2
|
|
1039
1039
|
/* CAN_EDIT */
|
|
1040
1040
|
) : I(
|
|
@@ -1074,11 +1074,11 @@ function mi(t) {
|
|
|
1074
1074
|
return () => A == null ? void 0 : A.unsubscribe();
|
|
1075
1075
|
}, [o, (w = h == null ? void 0 : h.mainComponent) == null ? void 0 : w.onPointerDown$, I]), L(() => {
|
|
1076
1076
|
if (!n) return;
|
|
1077
|
-
const A =
|
|
1077
|
+
const A = C == null ? void 0 : C.activeSheet$.subscribe(() => {
|
|
1078
1078
|
T();
|
|
1079
1079
|
});
|
|
1080
1080
|
return () => A == null ? void 0 : A.unsubscribe();
|
|
1081
|
-
}, [T, n,
|
|
1081
|
+
}, [T, n, C == null ? void 0 : C.activeSheet$]), { isSelecting: d, isSelectingRef: S };
|
|
1082
1082
|
}
|
|
1083
1083
|
const gi = () => {
|
|
1084
1084
|
const t = O(Ee);
|
|
@@ -1098,7 +1098,7 @@ function pi(t, e, n) {
|
|
|
1098
1098
|
};
|
|
1099
1099
|
}
|
|
1100
1100
|
function xo(t) {
|
|
1101
|
-
var p, S,
|
|
1101
|
+
var p, S, C;
|
|
1102
1102
|
const {
|
|
1103
1103
|
unitId: e,
|
|
1104
1104
|
subUnitId: n,
|
|
@@ -1114,14 +1114,14 @@ function xo(t) {
|
|
|
1114
1114
|
s.setSelections(l);
|
|
1115
1115
|
return;
|
|
1116
1116
|
}
|
|
1117
|
-
const d = m.getSheetId(), f = (
|
|
1117
|
+
const d = m.getSheetId(), f = (v) => {
|
|
1118
1118
|
var I;
|
|
1119
|
-
return (I = u == null ? void 0 : u.getSheetBySheetName(
|
|
1119
|
+
return (I = u == null ? void 0 : u.getSheetBySheetName(v)) == null ? void 0 : I.getSheetId();
|
|
1120
1120
|
};
|
|
1121
1121
|
if (!((p = c == null ? void 0 : c.getWorksheetSkeleton(d)) == null ? void 0 : p.skeleton)) return;
|
|
1122
1122
|
const g = [];
|
|
1123
|
-
for (let
|
|
1124
|
-
const T = o[
|
|
1123
|
+
for (let v = 0, I = o.length; v < I; v++) {
|
|
1124
|
+
const T = o[v], { themeColor: w, token: A, refIndex: M, endIndex: _ } = T, N = nt(A), { unitId: P, sheetName: y, range: E } = N;
|
|
1125
1125
|
if (P && e !== P)
|
|
1126
1126
|
continue;
|
|
1127
1127
|
const F = f(y);
|
|
@@ -1135,13 +1135,13 @@ function xo(t) {
|
|
|
1135
1135
|
}), g.push(_);
|
|
1136
1136
|
}
|
|
1137
1137
|
if (r) {
|
|
1138
|
-
const
|
|
1138
|
+
const v = (C = (S = r.getSelectionRanges()) == null ? void 0 : S[0]) == null ? void 0 : C.startOffset, I = g.findIndex((T) => T + 2 === v);
|
|
1139
1139
|
I !== -1 ? i == null || i.setActiveSelectionIndex(I) : i == null || i.resetActiveSelectionIndex();
|
|
1140
1140
|
}
|
|
1141
1141
|
return l;
|
|
1142
1142
|
}
|
|
1143
1143
|
function Si(t, e) {
|
|
1144
|
-
const n = O(oe), o = O(
|
|
1144
|
+
const n = O(oe), o = O(gt), r = O(Lt), i = O(ye).getRenderById(t), c = i == null ? void 0 : i.with(De), a = i == null ? void 0 : i.with(wt), h = ee((u, m) => {
|
|
1145
1145
|
if (c != null && c.selectionMoving) return;
|
|
1146
1146
|
const l = xo({
|
|
1147
1147
|
unitId: t,
|
|
@@ -1162,7 +1162,7 @@ function Si(t, e) {
|
|
|
1162
1162
|
}, [c]), h;
|
|
1163
1163
|
}
|
|
1164
1164
|
function wo(t = "") {
|
|
1165
|
-
const e = O(
|
|
1165
|
+
const e = O(kt), n = Ci(), o = O(ae), r = le(() => t.length, [t]);
|
|
1166
1166
|
return ee((i, c, a = !0, h) => {
|
|
1167
1167
|
const u = i.getDocumentData(), m = i.getEditorId();
|
|
1168
1168
|
if (!u)
|
|
@@ -1178,19 +1178,19 @@ function wo(t = "") {
|
|
|
1178
1178
|
body: In(f, 0, f.dataStream.length - 2)
|
|
1179
1179
|
}), [];
|
|
1180
1180
|
{
|
|
1181
|
-
const { textRuns: R, refSelections: g } =
|
|
1182
|
-
r && R.forEach((
|
|
1183
|
-
|
|
1181
|
+
const { textRuns: R, refSelections: g } = vi(e, n, c);
|
|
1182
|
+
r && R.forEach((C) => {
|
|
1183
|
+
C.ed = C.ed + r, C.st = C.st + r;
|
|
1184
1184
|
}), f.textRuns = [{ st: 0, ed: 1, ts: { fs: 11 } }, ...R];
|
|
1185
|
-
const p = c.reduce((
|
|
1185
|
+
const p = c.reduce((C, v) => typeof v == "string" ? `${C}${v}` : `${C}${v.token}`, "");
|
|
1186
1186
|
f.dataStream = `${t}${p}\r
|
|
1187
1187
|
`;
|
|
1188
1188
|
let S;
|
|
1189
1189
|
if (a) {
|
|
1190
1190
|
S = i.getSelectionRanges();
|
|
1191
|
-
const
|
|
1192
|
-
S.forEach((
|
|
1193
|
-
|
|
1191
|
+
const C = f.dataStream.length - 2 + r;
|
|
1192
|
+
S.forEach((v) => {
|
|
1193
|
+
v.startOffset = Math.max(0, Math.min(v.startOffset, C)), v.endOffset = Math.max(0, Math.min(v.endOffset, C));
|
|
1194
1194
|
});
|
|
1195
1195
|
}
|
|
1196
1196
|
return o.syncExecuteCommand(Mn.id, {
|
|
@@ -1201,8 +1201,8 @@ function wo(t = "") {
|
|
|
1201
1201
|
}
|
|
1202
1202
|
});
|
|
1203
1203
|
}
|
|
1204
|
-
function
|
|
1205
|
-
const e = O(
|
|
1204
|
+
function Ci() {
|
|
1205
|
+
const e = O(gt).getCurrentTheme();
|
|
1206
1206
|
return le(() => {
|
|
1207
1207
|
const o = [
|
|
1208
1208
|
e.loopColor1,
|
|
@@ -1221,15 +1221,15 @@ function vi() {
|
|
|
1221
1221
|
return { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: i };
|
|
1222
1222
|
}, [e]);
|
|
1223
1223
|
}
|
|
1224
|
-
function
|
|
1224
|
+
function vi(t, e, n) {
|
|
1225
1225
|
const { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: i } = e, c = [], a = [], h = /* @__PURE__ */ new Map();
|
|
1226
1226
|
let u = 0;
|
|
1227
1227
|
for (let m = 0, l = n.length; m < l; m++) {
|
|
1228
1228
|
const d = n[m];
|
|
1229
1229
|
if (typeof d == "string") {
|
|
1230
|
-
const
|
|
1230
|
+
const C = c[c.length - 1], v = C ? C.ed : 0, I = v + d.length;
|
|
1231
1231
|
c.push({
|
|
1232
|
-
st:
|
|
1232
|
+
st: v,
|
|
1233
1233
|
ed: I,
|
|
1234
1234
|
ts: {
|
|
1235
1235
|
cl: {
|
|
@@ -1259,8 +1259,8 @@ function Ci(t, e, n) {
|
|
|
1259
1259
|
if (h.has(p))
|
|
1260
1260
|
S = h.get(p);
|
|
1261
1261
|
else {
|
|
1262
|
-
const
|
|
1263
|
-
S = o[
|
|
1262
|
+
const C = u % o.length;
|
|
1263
|
+
S = o[C], h.set(p, S), u++;
|
|
1264
1264
|
}
|
|
1265
1265
|
a.push({
|
|
1266
1266
|
refIndex: m,
|
|
@@ -1401,7 +1401,7 @@ const _i = (t, e, n, o) => {
|
|
|
1401
1401
|
a && a.getSheetId() === n && r.setSelections(i);
|
|
1402
1402
|
}
|
|
1403
1403
|
}, [t, r, n, e, o]);
|
|
1404
|
-
}, Ei = (t) => t.reduce((e, n) => typeof n == "string" ? e + n.length : e + n.token.length, 0), Jt = (t) => t.map((e) => typeof e == "string" ? e : e.token).join(""), Et = (t, e = !1, n = "") => e ? t.map((o) => o.sheetName !== "" && o.sheetName !== n ?
|
|
1404
|
+
}, Ei = (t) => t.reduce((e, n) => typeof n == "string" ? e + n.length : e + n.token.length, 0), Jt = (t) => t.map((e) => typeof e == "string" ? e : e.token).join(""), Et = (t, e = !1, n = "") => e ? t.map((o) => o.sheetName !== "" && o.sheetName !== n ? ht(o.sheetName, o.range) : pe(o.range)) : t.map((o) => pe(o.range)), bi = (t) => {
|
|
1405
1405
|
var u, m, l;
|
|
1406
1406
|
const { editor: e, lexerTreeBuilder: n } = t, o = e == null ? void 0 : e.getSelectionRanges();
|
|
1407
1407
|
if ((o == null ? void 0 : o.length) !== 1)
|
|
@@ -1416,10 +1416,10 @@ const _i = (t, e, n, o) => {
|
|
|
1416
1416
|
};
|
|
1417
1417
|
}, Ni = () => {
|
|
1418
1418
|
}, yi = (t, e, n, o, r, s, i, c, a, h = Ni) => {
|
|
1419
|
-
const u = O(ye), m = O(oe), l = O(ae), d = O(Ro), f = O(
|
|
1419
|
+
const u = O(ye), m = O(oe), l = O(ae), d = O(Ro), f = O(gt), R = O(Ee), g = m.getUnit(o), p = ee((_) => {
|
|
1420
1420
|
var N, P;
|
|
1421
1421
|
return (P = (N = g == null ? void 0 : g.getSheetBySheetId(_)) == null ? void 0 : N.getName()) != null ? P : "";
|
|
1422
|
-
}), S = le(() => p(r), [p, r]),
|
|
1422
|
+
}), S = le(() => p(r), [p, r]), C = Be(g == null ? void 0 : g.activeSheet$), v = je({ activeSheet: C, sheetName: S }), I = u.getRenderById(o), T = I == null ? void 0 : I.with(De), w = I == null ? void 0 : I.with(wt), A = O(Lt), M = ee((_, N) => {
|
|
1423
1423
|
var H, V, te, ie, q, Ke;
|
|
1424
1424
|
const P = bi({ editor: a, lexerTreeBuilder: R });
|
|
1425
1425
|
if (!P) return;
|
|
@@ -1434,8 +1434,8 @@ const _i = (t, e, n, o) => {
|
|
|
1434
1434
|
sheetName: p(fe)
|
|
1435
1435
|
}, de = Et([he], i && fe !== r, S);
|
|
1436
1436
|
F.push({ token: de[0], nodeType: z.REFERENCE });
|
|
1437
|
-
const Fe = [...F, ...Z],
|
|
1438
|
-
h(
|
|
1437
|
+
const Fe = [...F, ...Z], vt = Jt(Fe);
|
|
1438
|
+
h(vt, Ei(F), N);
|
|
1439
1439
|
} else {
|
|
1440
1440
|
const U = _[_.length - 1], Z = (te = U.sheetId) != null ? te : r, fe = {
|
|
1441
1441
|
range: U,
|
|
@@ -1452,7 +1452,7 @@ const _i = (t, e, n, o) => {
|
|
|
1452
1452
|
const Z = F[y];
|
|
1453
1453
|
if (typeof Z == "object" && Z.nodeType === z.REFERENCE) {
|
|
1454
1454
|
const fe = Z.token;
|
|
1455
|
-
Z.token = S === (
|
|
1455
|
+
Z.token = S === (C == null ? void 0 : C.getName()) ? pe(U) : ht(C.getName(), U);
|
|
1456
1456
|
const he = x + (Z.token.length - fe.length);
|
|
1457
1457
|
h(wr(F), he, N);
|
|
1458
1458
|
}
|
|
@@ -1464,17 +1464,17 @@ const _i = (t, e, n, o) => {
|
|
|
1464
1464
|
}
|
|
1465
1465
|
let Z = 0;
|
|
1466
1466
|
const fe = F.map((Y) => {
|
|
1467
|
-
var me,
|
|
1467
|
+
var me, $e, Oe;
|
|
1468
1468
|
if (typeof Y == "string")
|
|
1469
1469
|
return Y;
|
|
1470
1470
|
if (Y.nodeType === z.REFERENCE) {
|
|
1471
|
-
const Me =
|
|
1472
|
-
if (Me.sheetName || (Me.sheetName = S), i && ((me =
|
|
1471
|
+
const Me = nt(Y.token);
|
|
1472
|
+
if (Me.sheetName || (Me.sheetName = S), i && ((me = v.current.activeSheet) == null ? void 0 : me.getName()) !== Me.sheetName)
|
|
1473
1473
|
return Y.token;
|
|
1474
1474
|
const Se = U[Z];
|
|
1475
1475
|
if (Z++, !Se)
|
|
1476
1476
|
return "";
|
|
1477
|
-
const _t = (
|
|
1477
|
+
const _t = ($e = Se.sheetId) != null ? $e : r, Vt = {
|
|
1478
1478
|
range: Se,
|
|
1479
1479
|
unitId: (Oe = Se.unitId) != null ? Oe : o,
|
|
1480
1480
|
sheetName: p(_t)
|
|
@@ -1489,14 +1489,14 @@ const _i = (t, e, n, o) => {
|
|
|
1489
1489
|
});
|
|
1490
1490
|
const de = [];
|
|
1491
1491
|
for (let Y = Z; Y <= _.length - 1; Y++) {
|
|
1492
|
-
const me = _[Y],
|
|
1492
|
+
const me = _[Y], $e = (q = me.sheetId) != null ? q : r, Oe = {
|
|
1493
1493
|
range: me,
|
|
1494
1494
|
unitId: (Ke = me.unitId) != null ? Ke : o,
|
|
1495
|
-
sheetName: p(
|
|
1496
|
-
}, Se = Et([Oe], i &&
|
|
1495
|
+
sheetName: p($e)
|
|
1496
|
+
}, Se = Et([Oe], i && $e !== r, S);
|
|
1497
1497
|
de.push(Se[0]);
|
|
1498
1498
|
}
|
|
1499
|
-
const Fe = F[F.length - 1],
|
|
1499
|
+
const Fe = F[F.length - 1], vt = Fe && (typeof Fe == "string" ? !1 : Fe.nodeType === z.REFERENCE), Ye = `${he}${de.length && vt ? "," : ""}${de.join(",")}`;
|
|
1500
1500
|
h(Ye, !de.length && re ? re : Ye.length, N);
|
|
1501
1501
|
}
|
|
1502
1502
|
});
|
|
@@ -1640,7 +1640,7 @@ const _i = (t, e, n, o) => {
|
|
|
1640
1640
|
sheetEmbeddingFormulaEditor: xi,
|
|
1641
1641
|
sheetEmbeddingFormulaEditorErrorWrap: wi
|
|
1642
1642
|
}, Di = (t, e = [], n) => {
|
|
1643
|
-
const o = O(
|
|
1643
|
+
const o = O(kt), [r, s] = k([]), [i, c] = k(""), a = j(-1), h = je({ nodes: e }), u = () => {
|
|
1644
1644
|
s([]), c(""), a.current = -1;
|
|
1645
1645
|
};
|
|
1646
1646
|
return L(() => {
|
|
@@ -1655,8 +1655,8 @@ const _i = (t, e, n, o) => {
|
|
|
1655
1655
|
const p = f[g];
|
|
1656
1656
|
if (p && typeof p != "string" && p.nodeType === z.FUNCTION) {
|
|
1657
1657
|
a.current = g;
|
|
1658
|
-
const S = p.token,
|
|
1659
|
-
s(
|
|
1658
|
+
const S = p.token, C = o.getSearchListByNameFirstLetter(S);
|
|
1659
|
+
s(C), c(S);
|
|
1660
1660
|
return;
|
|
1661
1661
|
}
|
|
1662
1662
|
}
|
|
@@ -1682,17 +1682,17 @@ const _i = (t, e, n, o) => {
|
|
|
1682
1682
|
},
|
|
1683
1683
|
reset: u
|
|
1684
1684
|
};
|
|
1685
|
-
}, Li = "univer-formula-search-function",
|
|
1685
|
+
}, Li = "univer-formula-search-function", ki = "univer-formula-search-function-item", $i = "univer-formula-search-function-item-name", Hi = "univer-formula-search-function-item-name-light", Ui = "univer-formula-search-function-item-desc", Wi = "univer-formula-search-function-item-active", Pe = {
|
|
1686
1686
|
formulaSearchFunction: Li,
|
|
1687
|
-
formulaSearchFunctionItem:
|
|
1688
|
-
formulaSearchFunctionItemName:
|
|
1687
|
+
formulaSearchFunctionItem: ki,
|
|
1688
|
+
formulaSearchFunctionItemName: $i,
|
|
1689
1689
|
formulaSearchFunctionItemNameLight: Hi,
|
|
1690
1690
|
formulaSearchFunctionItemDesc: Ui,
|
|
1691
1691
|
formulaSearchFunctionItemActive: Wi
|
|
1692
1692
|
}, Vi = () => {
|
|
1693
1693
|
}, Bi = Te(qi);
|
|
1694
1694
|
function qi(t, e) {
|
|
1695
|
-
const { isFocus: n, sequenceNodes: o, onSelect: r, editor: s, onClose: i = Vi } = t, c = s.getEditorId(), a = O(Ht), h = O(ae), { searchList: u, searchText: m, handlerFormulaReplace: l, reset: d } = Di(n, o, s), f = le(() => !!u.length, [u]), R = j(void 0), [g, p] =
|
|
1695
|
+
const { isFocus: n, sequenceNodes: o, onSelect: r, editor: s, onClose: i = Vi } = t, c = s.getEditorId(), a = O(Ht), h = O(ae), { searchList: u, searchText: m, handlerFormulaReplace: l, reset: d } = Di(n, o, s), f = le(() => !!u.length, [u]), R = j(void 0), [g, p] = k(0), S = j(!1), [C] = Po(c, f, [m, u]), v = je({ searchList: u, active: g }), I = (_) => {
|
|
1696
1696
|
const N = l(_);
|
|
1697
1697
|
N && (d(), r(N));
|
|
1698
1698
|
};
|
|
@@ -1706,7 +1706,7 @@ function qi(t, e) {
|
|
|
1706
1706
|
if (!u.length)
|
|
1707
1707
|
return;
|
|
1708
1708
|
const _ = `sheet.formula-embedding-editor.search_function.${c}`, N = new We(), P = (y) => {
|
|
1709
|
-
const { searchList: E, active: F } =
|
|
1709
|
+
const { searchList: E, active: F } = v.current;
|
|
1710
1710
|
switch (y) {
|
|
1711
1711
|
case D.ARROW_UP: {
|
|
1712
1712
|
p((x) => {
|
|
@@ -1779,14 +1779,14 @@ function qi(t, e) {
|
|
|
1779
1779
|
}, 300);
|
|
1780
1780
|
};
|
|
1781
1781
|
}, []);
|
|
1782
|
-
return u.length > 0 && f && /* @__PURE__ */ b(go, { portal: !0, anchorRect$:
|
|
1782
|
+
return u.length > 0 && f && /* @__PURE__ */ b(go, { portal: !0, anchorRect$: C, direction: "vertical", children: /* @__PURE__ */ b(
|
|
1783
1783
|
"ul",
|
|
1784
1784
|
{
|
|
1785
1785
|
className: Pe.formulaSearchFunction,
|
|
1786
1786
|
ref: (_) => {
|
|
1787
1787
|
R.current = _, e && (e.current = _);
|
|
1788
1788
|
},
|
|
1789
|
-
children: u.map((_, N) => /* @__PURE__ */
|
|
1789
|
+
children: u.map((_, N) => /* @__PURE__ */ $(
|
|
1790
1790
|
"li",
|
|
1791
1791
|
{
|
|
1792
1792
|
className: g === N ? `
|
|
@@ -1800,7 +1800,7 @@ function qi(t, e) {
|
|
|
1800
1800
|
I(_.name), s && s.focus();
|
|
1801
1801
|
},
|
|
1802
1802
|
children: [
|
|
1803
|
-
/* @__PURE__ */
|
|
1803
|
+
/* @__PURE__ */ $("span", { className: Pe.formulaSearchFunctionItemName, children: [
|
|
1804
1804
|
/* @__PURE__ */ b("span", { className: Pe.formulaSearchFunctionItemNameLight, children: _.name.substring(0, m.length) }),
|
|
1805
1805
|
/* @__PURE__ */ b("span", { children: _.name.slice(m.length) })
|
|
1806
1806
|
] }),
|
|
@@ -1815,7 +1815,7 @@ function qi(t, e) {
|
|
|
1815
1815
|
const ji = (t) => t.startsWith(oo.EQUALS) ? t.slice(1) : "", Wn = () => {
|
|
1816
1816
|
};
|
|
1817
1817
|
function Ki(t) {
|
|
1818
|
-
var Sn,
|
|
1818
|
+
var Sn, Cn;
|
|
1819
1819
|
const {
|
|
1820
1820
|
errorText: e,
|
|
1821
1821
|
initValue: n,
|
|
@@ -1835,8 +1835,8 @@ function Ki(t) {
|
|
|
1835
1835
|
keyboradEventConfig: g,
|
|
1836
1836
|
onMoveInEditor: p,
|
|
1837
1837
|
resetSelectionOnBlur: S = !0,
|
|
1838
|
-
autoScrollbar:
|
|
1839
|
-
isSingle:
|
|
1838
|
+
autoScrollbar: C = !0,
|
|
1839
|
+
isSingle: v = !0,
|
|
1840
1840
|
disableSelectionOnClick: I = !1,
|
|
1841
1841
|
disableContextMenu: T,
|
|
1842
1842
|
style: w
|
|
@@ -1844,28 +1844,28 @@ function Ki(t) {
|
|
|
1844
1844
|
m && (m.handleOutClick = (X, Q) => {
|
|
1845
1845
|
M.current && !M.current.contains(X.target) && Q();
|
|
1846
1846
|
});
|
|
1847
|
-
const N = ee(R), P = j(null), y = j(void 0), E = y.current, [F, x] =
|
|
1847
|
+
const N = ee(R), P = j(null), y = j(void 0), E = y.current, [F, x] = k(s), H = j(null), V = le(() => d != null ? d : Qo(`${Sr}-${Jo(4)}`), []), te = le(() => e !== void 0, [e]), ie = O(oe), q = ie.getUnit(V);
|
|
1848
1848
|
Be(q == null ? void 0 : q.change$);
|
|
1849
|
-
const Ke = gi(), U = er.transform.getPlainText((
|
|
1849
|
+
const Ke = gi(), U = er.transform.getPlainText((Cn = (Sn = q == null ? void 0 : q.getBody()) == null ? void 0 : Sn.dataStream) != null ? Cn : ""), Z = je(U), fe = le(() => ji(U), [U]), he = le(() => Ke(fe), [fe, Ke]), { isSelecting: re, isSelectingRef: de } = mi({ unitId: o, subUnitId: r, editorId: V, isFocus: F, disableOnClick: I }), Fe = j(""), Ye = O(ye).getRenderById(V), Y = Ye == null ? void 0 : Ye.with(co), me = Y == null ? void 0 : Y.isFocusing, $e = le(() => ie.getCurrentTypeOfUnit$(ue.UNIVER_DOC), [ie]), Oe = Be($e), Me = (Oe == null ? void 0 : Oe.getUnitId()) === V, Se = j([]), _t = re;
|
|
1850
1850
|
as(() => {
|
|
1851
1851
|
_(U);
|
|
1852
1852
|
}, [U, _]);
|
|
1853
|
-
const Vt = wo("="), gn = Si(o, r), ze = ee((X, Q = !0,
|
|
1853
|
+
const Vt = wo("="), gn = Si(o, r), ze = ee((X, Q = !0, Ce, ve) => {
|
|
1854
1854
|
if (!y.current) return;
|
|
1855
1855
|
Fe.current = X;
|
|
1856
|
-
const
|
|
1856
|
+
const rt = Ke(X[0] === "=" ? X.slice(1) : ""), Ae = Vt(
|
|
1857
1857
|
y.current,
|
|
1858
|
-
|
|
1858
|
+
rt,
|
|
1859
1859
|
Q,
|
|
1860
|
-
|
|
1860
|
+
ve
|
|
1861
1861
|
);
|
|
1862
|
-
if (Se.current = Ae,
|
|
1863
|
-
const Rt =
|
|
1862
|
+
if (Se.current = Ae, Ce) {
|
|
1863
|
+
const Rt = ve != null ? ve : E == null ? void 0 : E.getSelectionRanges();
|
|
1864
1864
|
if ((Rt == null ? void 0 : Rt.length) !== 1)
|
|
1865
1865
|
return;
|
|
1866
|
-
const jo = Rt[0].startOffset - 1, Ko = hn(
|
|
1867
|
-
if (
|
|
1868
|
-
const _n = Ae.splice(
|
|
1866
|
+
const jo = Rt[0].startOffset - 1, Ko = hn(rt, jo, !1), vn = No(rt, Ko);
|
|
1867
|
+
if (vn >= 0) {
|
|
1868
|
+
const _n = Ae.splice(vn, 1)[0];
|
|
1869
1869
|
_n && Ae.push(_n);
|
|
1870
1870
|
}
|
|
1871
1871
|
gn(F ? Ae : [], y.current);
|
|
@@ -1910,15 +1910,15 @@ function Ki(t) {
|
|
|
1910
1910
|
}, []), Tt(() => {
|
|
1911
1911
|
s ? (x(s), Ge()) : (S && (E == null || E.blur(), pn()), x(s));
|
|
1912
1912
|
}, [s, E, Ge, pn, S]);
|
|
1913
|
-
const { checkScrollBar: Wo } = Gr(E,
|
|
1913
|
+
const { checkScrollBar: Wo } = Gr(E, v, C);
|
|
1914
1914
|
Ri(F, !!(re && Me), o, T), _i(F && f, _t, E, p);
|
|
1915
|
-
const Vo = ee((X, Q,
|
|
1915
|
+
const Vo = ee((X, Q, Ce) => {
|
|
1916
1916
|
if (!me)
|
|
1917
1917
|
return;
|
|
1918
|
-
const
|
|
1919
|
-
ze(`=${X}`, !0,
|
|
1920
|
-
const
|
|
1921
|
-
Ae == null || Ae.scrollToRange({ ...
|
|
1918
|
+
const ve = Q !== -1 ? [{ startOffset: Q + 1, endOffset: Q + 1, collapsed: !0 }] : void 0;
|
|
1919
|
+
ze(`=${X}`, !0, Ce, ve), Ce && (Ge(), Q !== -1 && setTimeout(() => {
|
|
1920
|
+
const rt = { startOffset: Q + 1, endOffset: Q + 1 }, Ae = E == null ? void 0 : E.render.with(Zr);
|
|
1921
|
+
Ae == null || Ae.scrollToRange({ ...rt, collapsed: !0 });
|
|
1922
1922
|
}, 50), Wo());
|
|
1923
1923
|
});
|
|
1924
1924
|
yi(
|
|
@@ -1939,11 +1939,11 @@ function Ki(t) {
|
|
|
1939
1939
|
if (X) {
|
|
1940
1940
|
const Q = E == null ? void 0 : E.getSelectionRanges();
|
|
1941
1941
|
if (Q && Q.length === 1) {
|
|
1942
|
-
const
|
|
1943
|
-
if (
|
|
1944
|
-
const
|
|
1942
|
+
const Ce = Q[0];
|
|
1943
|
+
if (Ce.collapsed) {
|
|
1944
|
+
const ve = X.offset;
|
|
1945
1945
|
setTimeout(() => {
|
|
1946
|
-
E == null || E.setSelectionRanges([{ startOffset:
|
|
1946
|
+
E == null || E.setSelectionRanges([{ startOffset: Ce.startOffset - ve, endOffset: Ce.endOffset - ve }]);
|
|
1947
1947
|
}, 30);
|
|
1948
1948
|
}
|
|
1949
1949
|
}
|
|
@@ -1952,11 +1952,11 @@ function Ki(t) {
|
|
|
1952
1952
|
}, qo = () => {
|
|
1953
1953
|
x(!0), c(), Ge();
|
|
1954
1954
|
};
|
|
1955
|
-
return /* @__PURE__ */
|
|
1955
|
+
return /* @__PURE__ */ $("div", { style: w, className: kn(Xe.sheetEmbeddingFormulaEditor, l), children: [
|
|
1956
1956
|
/* @__PURE__ */ b(
|
|
1957
1957
|
"div",
|
|
1958
1958
|
{
|
|
1959
|
-
className:
|
|
1959
|
+
className: kn(Xe.sheetEmbeddingFormulaEditorWrap, {
|
|
1960
1960
|
[Xe.sheetEmbeddingFormulaEditorActive]: F,
|
|
1961
1961
|
[Xe.sheetEmbeddingFormulaEditorError]: te
|
|
1962
1962
|
}),
|
|
@@ -1994,7 +1994,7 @@ function Ki(t) {
|
|
|
1994
1994
|
] });
|
|
1995
1995
|
}
|
|
1996
1996
|
function Yi(t, e, n, o) {
|
|
1997
|
-
const r = O(Ee), s = wo(""), i = Be(t == null ? void 0 : t.getDocumentDataModel().change$), [c, a] =
|
|
1997
|
+
const r = O(Ee), s = wo(""), i = Be(t == null ? void 0 : t.getDocumentDataModel().change$), [c, a] = k([]), h = O(Cr), u = j(""), m = O(oe);
|
|
1998
1998
|
return L(() => {
|
|
1999
1999
|
if (!t) return;
|
|
2000
2000
|
const l = t.getDocumentDataModel().getPlainText();
|
|
@@ -2020,14 +2020,14 @@ function Yi(t, e, n, o) {
|
|
|
2020
2020
|
}
|
|
2021
2021
|
const l = s(t, c, !1), d = new We();
|
|
2022
2022
|
return l.forEach((g) => {
|
|
2023
|
-
const p =
|
|
2024
|
-
if (!p.sheetName && o !== (
|
|
2023
|
+
const p = nt(g.token), S = m.getCurrentUnitForType(ue.UNIVER_SHEET), C = S == null ? void 0 : S.getActiveSheet();
|
|
2024
|
+
if (!p.sheetName && o !== (C == null ? void 0 : C.getSheetId()) || p.sheetName && (C == null ? void 0 : C.getName()) !== p.sheetName)
|
|
2025
2025
|
return;
|
|
2026
|
-
const
|
|
2026
|
+
const v = new on(g.themeColor).toRgb(), I = h.addShape({
|
|
2027
2027
|
range: p.range,
|
|
2028
2028
|
style: {
|
|
2029
2029
|
stroke: g.themeColor,
|
|
2030
|
-
fill: `rgba(${
|
|
2030
|
+
fill: `rgba(${v.r}, ${v.g}, ${v.b}, 0.1)`,
|
|
2031
2031
|
strokeDash: 12
|
|
2032
2032
|
},
|
|
2033
2033
|
primary: null
|
|
@@ -2086,30 +2086,30 @@ const Gi = "univer-sheet-range-selector-icon", Zi = "univer-sheet-range-selector
|
|
|
2086
2086
|
return t;
|
|
2087
2087
|
};
|
|
2088
2088
|
function ec(t) {
|
|
2089
|
-
const { visible: e, initialValue: n, unitId: o, subUnitId: r, maxRangeCount: s = 1 / 0, supportAcrossSheet: i, onConfirm: c, onClose: a, onShowBySelection: h } = t, u = O(qe), m = O(Ee), [l, d] =
|
|
2089
|
+
const { visible: e, initialValue: n, unitId: o, subUnitId: r, maxRangeCount: s = 1 / 0, supportAcrossSheet: i, onConfirm: c, onClose: a, onShowBySelection: h } = t, u = O(qe), m = O(Ee), [l, d] = k([]), [f, R] = k(0), g = j(null);
|
|
2090
2090
|
L(() => {
|
|
2091
2091
|
if (e && n.length) {
|
|
2092
|
-
const
|
|
2093
|
-
d(
|
|
2092
|
+
const v = n.map((I) => I.sheetName ? ht(I.sheetName, I.range) : pe(I.range));
|
|
2093
|
+
d(v), R(v.length - 1);
|
|
2094
2094
|
} else
|
|
2095
2095
|
d([""]), R(0);
|
|
2096
2096
|
}, [e]);
|
|
2097
|
-
const p = (
|
|
2097
|
+
const p = (v, I) => {
|
|
2098
2098
|
const T = [...l];
|
|
2099
|
-
T[
|
|
2099
|
+
T[v] = I, d(T);
|
|
2100
2100
|
}, S = () => {
|
|
2101
2101
|
d([...l, ""]), R(l.length);
|
|
2102
|
-
},
|
|
2103
|
-
l.splice(
|
|
2102
|
+
}, C = (v) => {
|
|
2103
|
+
l.splice(v, 1), d([...l]);
|
|
2104
2104
|
};
|
|
2105
2105
|
return zi({
|
|
2106
2106
|
unitId: o,
|
|
2107
2107
|
subUnitId: r,
|
|
2108
2108
|
supportAcrossSheet: i,
|
|
2109
|
-
onChange: (
|
|
2110
|
-
if (!e && h != null && h(
|
|
2109
|
+
onChange: (v, I) => {
|
|
2110
|
+
if (!e && h != null && h(v))
|
|
2111
2111
|
return;
|
|
2112
|
-
const T = new Set(l), w =
|
|
2112
|
+
const T = new Set(l), w = v.map((_) => _.sheetName ? ht(_.sheetName, _.range) : pe(_.range)), A = w.filter((_) => !T.has(_));
|
|
2113
2113
|
if (!A.length) return;
|
|
2114
2114
|
const M = [...l];
|
|
2115
2115
|
if (w.length > 1) {
|
|
@@ -2126,14 +2126,14 @@ function ec(t) {
|
|
|
2126
2126
|
}
|
|
2127
2127
|
}
|
|
2128
2128
|
}), /* @__PURE__ */ b(
|
|
2129
|
-
|
|
2129
|
+
Cs,
|
|
2130
2130
|
{
|
|
2131
2131
|
width: "328px",
|
|
2132
2132
|
visible: e,
|
|
2133
2133
|
title: u.t("rangeSelector.title"),
|
|
2134
2134
|
draggable: !0,
|
|
2135
2135
|
closeIcon: /* @__PURE__ */ b(Ut, {}),
|
|
2136
|
-
footer: /* @__PURE__ */
|
|
2136
|
+
footer: /* @__PURE__ */ $("footer", { children: [
|
|
2137
2137
|
/* @__PURE__ */ b(Je, { onClick: a, children: u.t("rangeSelector.cancel") }),
|
|
2138
2138
|
/* @__PURE__ */ b(
|
|
2139
2139
|
Je,
|
|
@@ -2141,10 +2141,10 @@ function ec(t) {
|
|
|
2141
2141
|
style: { marginLeft: 10 },
|
|
2142
2142
|
onClick: () => {
|
|
2143
2143
|
c(
|
|
2144
|
-
l.filter((
|
|
2145
|
-
const I = m.sequenceNodesBuilder(
|
|
2144
|
+
l.filter((v) => {
|
|
2145
|
+
const I = m.sequenceNodesBuilder(v);
|
|
2146
2146
|
return I && I.length === 1 && typeof I[0] != "string" && I[0].nodeType === z.REFERENCE;
|
|
2147
|
-
}).map((
|
|
2147
|
+
}).map((v) => nt(v)).map((v) => ({ ...v, range: Ji(v.range) }))
|
|
2148
2148
|
);
|
|
2149
2149
|
},
|
|
2150
2150
|
type: "primary",
|
|
@@ -2153,22 +2153,22 @@ function ec(t) {
|
|
|
2153
2153
|
)
|
|
2154
2154
|
] }),
|
|
2155
2155
|
onClose: a,
|
|
2156
|
-
children: /* @__PURE__ */
|
|
2157
|
-
l.map((
|
|
2156
|
+
children: /* @__PURE__ */ $("div", { ref: g, className: Nt.sheetRangeSelectorDialog, children: [
|
|
2157
|
+
l.map((v, I) => /* @__PURE__ */ $("div", { className: Nt.sheetRangeSelectorDialogItem, children: [
|
|
2158
2158
|
/* @__PURE__ */ b(
|
|
2159
|
-
|
|
2159
|
+
vo,
|
|
2160
2160
|
{
|
|
2161
2161
|
affixWrapperStyle: { width: "100%" },
|
|
2162
2162
|
placeholder: u.t("rangeSelector.placeHolder"),
|
|
2163
2163
|
onFocus: () => R(I),
|
|
2164
|
-
value:
|
|
2164
|
+
value: v,
|
|
2165
2165
|
onChange: (T) => p(I, T),
|
|
2166
2166
|
style: { borderColor: f === I ? "rgb(var(--primary-color))" : void 0 }
|
|
2167
2167
|
}
|
|
2168
2168
|
),
|
|
2169
|
-
l.length > 1 && /* @__PURE__ */ b(Fo, { className: Nt.sheetRangeSelectorDialogItemDelete, onClick: () =>
|
|
2169
|
+
l.length > 1 && /* @__PURE__ */ b(Fo, { className: Nt.sheetRangeSelectorDialogItemDelete, onClick: () => C(I) })
|
|
2170
2170
|
] }, I)),
|
|
2171
|
-
l.length < s && /* @__PURE__ */ b("div", { children: /* @__PURE__ */
|
|
2171
|
+
l.length < s && /* @__PURE__ */ b("div", { children: /* @__PURE__ */ $(Je, { type: "link", size: "small", onClick: S, children: [
|
|
2172
2172
|
/* @__PURE__ */ b(Mo, {}),
|
|
2173
2173
|
/* @__PURE__ */ b("span", { children: u.t("rangeSelector.addAnotherRange") })
|
|
2174
2174
|
] }) })
|
|
@@ -2177,13 +2177,13 @@ function ec(t) {
|
|
|
2177
2177
|
);
|
|
2178
2178
|
}
|
|
2179
2179
|
function tc(t) {
|
|
2180
|
-
return t.split(tt.COMMA).filter((e) => !!e).map((e) =>
|
|
2180
|
+
return t.split(tt.COMMA).filter((e) => !!e).map((e) => nt(e));
|
|
2181
2181
|
}
|
|
2182
2182
|
function nc(t) {
|
|
2183
|
-
return t.map((e) => e.sheetName ?
|
|
2183
|
+
return t.map((e) => e.sheetName ? ht(e.sheetName, e.range) : pe(e.range)).join(tt.COMMA);
|
|
2184
2184
|
}
|
|
2185
2185
|
function Do(t) {
|
|
2186
|
-
const [e, n] =
|
|
2186
|
+
const [e, n] = k(null), {
|
|
2187
2187
|
onVerify: o,
|
|
2188
2188
|
selectorRef: r,
|
|
2189
2189
|
unitId: s,
|
|
@@ -2198,11 +2198,11 @@ function Do(t) {
|
|
|
2198
2198
|
forceShowDialogWhenSelectionChanged: f,
|
|
2199
2199
|
hideEditor: R,
|
|
2200
2200
|
resetRange: g
|
|
2201
|
-
} = t, [p, S] =
|
|
2201
|
+
} = t, [p, S] = k(h != null ? h : !1), [C, v] = k(!1), [I, T] = k([]), w = O(qe), A = O(be), { sequenceNodes: M } = Yi(e, p, s, i), _ = je(M), N = O(ae), P = ee(() => {
|
|
2202
2202
|
e == null || e.setSelectionRanges([]), e == null || e.blur(), A.blur();
|
|
2203
2203
|
}), y = ee(() => {
|
|
2204
2204
|
var E;
|
|
2205
|
-
P(), T(tc((E = e == null ? void 0 : e.getDocumentDataModel().getPlainText()) != null ? E : "")),
|
|
2205
|
+
P(), T(tc((E = e == null ? void 0 : e.getDocumentDataModel().getPlainText()) != null ? E : "")), v(!0);
|
|
2206
2206
|
});
|
|
2207
2207
|
return L(() => {
|
|
2208
2208
|
r && (r.current = {
|
|
@@ -2215,10 +2215,10 @@ function Do(t) {
|
|
|
2215
2215
|
blur: P,
|
|
2216
2216
|
verify: () => Vn(_.current),
|
|
2217
2217
|
showDialog: (E) => {
|
|
2218
|
-
P(), T(E),
|
|
2218
|
+
P(), T(E), v(!0);
|
|
2219
2219
|
},
|
|
2220
2220
|
hideDialog: () => {
|
|
2221
|
-
T([]),
|
|
2221
|
+
T([]), v(!1);
|
|
2222
2222
|
},
|
|
2223
2223
|
getValue: () => {
|
|
2224
2224
|
var E;
|
|
@@ -2229,9 +2229,9 @@ function Do(t) {
|
|
|
2229
2229
|
var E;
|
|
2230
2230
|
o == null || o(Vn(M), (E = e == null ? void 0 : e.getDocumentDataModel().getPlainText()) != null ? E : "");
|
|
2231
2231
|
}, [M]), L(() => {
|
|
2232
|
-
m == null || m(
|
|
2233
|
-
}, [
|
|
2234
|
-
if (
|
|
2232
|
+
m == null || m(C);
|
|
2233
|
+
}, [C]), L(() => {
|
|
2234
|
+
if (C && g)
|
|
2235
2235
|
return () => {
|
|
2236
2236
|
const E = {
|
|
2237
2237
|
unitId: s,
|
|
@@ -2240,7 +2240,7 @@ function Do(t) {
|
|
|
2240
2240
|
};
|
|
2241
2241
|
N.executeCommand(cn.id, E);
|
|
2242
2242
|
};
|
|
2243
|
-
}, [
|
|
2243
|
+
}, [C]), /* @__PURE__ */ $(ut, { children: [
|
|
2244
2244
|
R ? null : /* @__PURE__ */ b(
|
|
2245
2245
|
Xr,
|
|
2246
2246
|
{
|
|
@@ -2262,19 +2262,19 @@ function Do(t) {
|
|
|
2262
2262
|
initialValue: I,
|
|
2263
2263
|
unitId: s,
|
|
2264
2264
|
subUnitId: i,
|
|
2265
|
-
visible:
|
|
2265
|
+
visible: C,
|
|
2266
2266
|
maxRangeCount: c,
|
|
2267
2267
|
onConfirm: (E) => {
|
|
2268
2268
|
const F = nc(E), x = tr.newEmptyData();
|
|
2269
|
-
x.body.dataStream = F, e == null || e.replaceText(F, !1), u == null || u(x, F),
|
|
2269
|
+
x.body.dataStream = F, e == null || e.replaceText(F, !1), u == null || u(x, F), v(!1), T([]), requestAnimationFrame(() => {
|
|
2270
2270
|
P();
|
|
2271
2271
|
});
|
|
2272
2272
|
},
|
|
2273
2273
|
onClose: () => {
|
|
2274
|
-
|
|
2274
|
+
v(!1), T([]);
|
|
2275
2275
|
},
|
|
2276
2276
|
supportAcrossSheet: a,
|
|
2277
|
-
onShowBySelection: (E) => p || f ? (T(E),
|
|
2277
|
+
onShowBySelection: (E) => p || f ? (T(E), v(!0), !1) : !0
|
|
2278
2278
|
}
|
|
2279
2279
|
)
|
|
2280
2280
|
] });
|
|
@@ -2286,8 +2286,8 @@ class Lo {
|
|
|
2286
2286
|
}
|
|
2287
2287
|
showRangeSelectorDialog(e) {
|
|
2288
2288
|
const n = e.callback, o = new Promise((r) => {
|
|
2289
|
-
e.callback = (s
|
|
2290
|
-
r(s), n(s
|
|
2289
|
+
e.callback = (s) => {
|
|
2290
|
+
r(s), n(s);
|
|
2291
2291
|
};
|
|
2292
2292
|
});
|
|
2293
2293
|
return this._currentSelector$.next(e), o;
|
|
@@ -2297,14 +2297,14 @@ const oc = "sheets-formula-ui.base.config", Bn = {};
|
|
|
2297
2297
|
function rc(t) {
|
|
2298
2298
|
return t.getContextValue(nr) && t.getContextValue(or);
|
|
2299
2299
|
}
|
|
2300
|
-
function
|
|
2300
|
+
function ko(t, e = !1) {
|
|
2301
2301
|
return !e && !(Re(t == null ? void 0 : t.f) || Ve(t == null ? void 0 : t.si)) ? null : typeof (t == null ? void 0 : t.v) == "string" && Dr.has(t.v) ? t.v : null;
|
|
2302
2302
|
}
|
|
2303
2303
|
var sc = Object.getOwnPropertyDescriptor, ic = (t, e, n, o) => {
|
|
2304
2304
|
for (var r = o > 1 ? void 0 : o ? sc(e, n) : e, s = t.length - 1, i; s >= 0; s--)
|
|
2305
2305
|
(i = t[s]) && (r = i(r) || r);
|
|
2306
2306
|
return r;
|
|
2307
|
-
},
|
|
2307
|
+
}, it = (t, e) => (n, o) => e(n, o, t);
|
|
2308
2308
|
const Kt = "SHEET_FORMULA_ALERT", cc = {
|
|
2309
2309
|
[se.DIV_BY_ZERO]: "divByZero",
|
|
2310
2310
|
[se.NAME]: "name",
|
|
@@ -2319,7 +2319,7 @@ const Kt = "SHEET_FORMULA_ALERT", cc = {
|
|
|
2319
2319
|
[se.CONNECT]: "connect",
|
|
2320
2320
|
[se.NULL]: "null"
|
|
2321
2321
|
};
|
|
2322
|
-
let en = class extends
|
|
2322
|
+
let en = class extends pt {
|
|
2323
2323
|
constructor(t, e, n, o, r, s) {
|
|
2324
2324
|
super(), this._context = t, this._hoverManagerService = e, this._cellAlertManagerService = n, this._localeService = o, this._formulaDataModel = r, this._zenZoneService = s, this._init();
|
|
2325
2325
|
}
|
|
@@ -2334,7 +2334,7 @@ let en = class extends gt {
|
|
|
2334
2334
|
if (!c) return;
|
|
2335
2335
|
const a = c.getCell(t.location.row, t.location.col), h = (r = (o = (n = (e = this._formulaDataModel.getArrayFormulaCellData()) == null ? void 0 : e[t.location.unitId]) == null ? void 0 : n[t.location.subUnitId]) == null ? void 0 : o[t.location.row]) == null ? void 0 : r[t.location.col];
|
|
2336
2336
|
if (rr(a)) {
|
|
2337
|
-
const u =
|
|
2337
|
+
const u = ko(a, !!h);
|
|
2338
2338
|
if (!u) {
|
|
2339
2339
|
this._hideAlert();
|
|
2340
2340
|
return;
|
|
@@ -2367,18 +2367,18 @@ let en = class extends gt {
|
|
|
2367
2367
|
}
|
|
2368
2368
|
};
|
|
2369
2369
|
en = ic([
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2370
|
+
it(1, K(vr)),
|
|
2371
|
+
it(2, K(_r)),
|
|
2372
|
+
it(3, K(qe)),
|
|
2373
|
+
it(4, K(Dt)),
|
|
2374
|
+
it(5, us)
|
|
2375
2375
|
], en);
|
|
2376
2376
|
var lc = Object.getOwnPropertyDescriptor, ac = (t, e, n, o) => {
|
|
2377
2377
|
for (var r = o > 1 ? void 0 : o ? lc(e, n) : e, s = t.length - 1, i; s >= 0; s--)
|
|
2378
2378
|
(i = t[s]) && (r = i(r) || r);
|
|
2379
2379
|
return r;
|
|
2380
2380
|
}, qn = (t, e) => (n, o) => e(n, o, t);
|
|
2381
|
-
let Ft = class extends
|
|
2381
|
+
let Ft = class extends pt {
|
|
2382
2382
|
constructor(t, e) {
|
|
2383
2383
|
super(), this._autoFillService = t, this._lexerTreeBuilder = e, this._registerAutoFill();
|
|
2384
2384
|
}
|
|
@@ -2401,7 +2401,7 @@ let Ft = class extends gt {
|
|
|
2401
2401
|
var a, h;
|
|
2402
2402
|
const s = fc(r), i = [], c = /* @__PURE__ */ new Map();
|
|
2403
2403
|
for (let u = 1; u <= e; u++) {
|
|
2404
|
-
const m = (u - 1) % t.length, l =
|
|
2404
|
+
const m = (u - 1) % t.length, l = ft.deepClone(t[m]);
|
|
2405
2405
|
if (l) {
|
|
2406
2406
|
const d = ((a = t[m]) == null ? void 0 : a.f) || "", f = ((h = t[m]) == null ? void 0 : h.si) || "", R = Re(d);
|
|
2407
2407
|
if (Ve(f))
|
|
@@ -2411,13 +2411,13 @@ let Ft = class extends gt {
|
|
|
2411
2411
|
if (p)
|
|
2412
2412
|
l.si = p, l.f = null, l.v = null, l.p = null, l.t = null;
|
|
2413
2413
|
else {
|
|
2414
|
-
p =
|
|
2415
|
-
const { offsetX: S, offsetY:
|
|
2414
|
+
p = ft.generateRandomId(6), c.set(m, p);
|
|
2415
|
+
const { offsetX: S, offsetY: C } = uc(s, e, n), v = this._lexerTreeBuilder.moveFormulaRefOffset(
|
|
2416
2416
|
d,
|
|
2417
2417
|
S,
|
|
2418
|
-
|
|
2418
|
+
C
|
|
2419
2419
|
);
|
|
2420
|
-
l.si = p, l.f =
|
|
2420
|
+
l.si = p, l.f = v, l.v = null, l.p = null, l.t = null;
|
|
2421
2421
|
}
|
|
2422
2422
|
i.push(l);
|
|
2423
2423
|
}
|
|
@@ -2460,9 +2460,9 @@ var hc = Object.getOwnPropertyDescriptor, dc = (t, e, n, o) => {
|
|
|
2460
2460
|
for (var r = o > 1 ? void 0 : o ? hc(e, n) : e, s = t.length - 1, i; s >= 0; s--)
|
|
2461
2461
|
(i = t[s]) && (r = i(r) || r);
|
|
2462
2462
|
return r;
|
|
2463
|
-
},
|
|
2463
|
+
}, ct = (t, e) => (n, o) => e(n, o, t);
|
|
2464
2464
|
const mc = "default-paste-formula";
|
|
2465
|
-
let Ot = class extends
|
|
2465
|
+
let Ot = class extends pt {
|
|
2466
2466
|
constructor(t, e, n, o, r) {
|
|
2467
2467
|
super(), this._currentUniverSheet = t, this._lexerTreeBuilder = e, this._sheetClipboardService = n, this._injector = o, this._formulaDataModel = r, this._initialize();
|
|
2468
2468
|
}
|
|
@@ -2523,11 +2523,11 @@ let Ot = class extends gt {
|
|
|
2523
2523
|
}
|
|
2524
2524
|
};
|
|
2525
2525
|
Ot = dc([
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2526
|
+
ct(0, oe),
|
|
2527
|
+
ct(1, K(Ee)),
|
|
2528
|
+
ct(2, br),
|
|
2529
|
+
ct(3, K(mt)),
|
|
2530
|
+
ct(4, K(Dt))
|
|
2531
2531
|
], Ot);
|
|
2532
2532
|
function gc(t, e, n, o, r, s, i, c, a = !1, h) {
|
|
2533
2533
|
const u = [], m = [], l = pc(t, e, n, o, s, i, c, h);
|
|
@@ -2558,7 +2558,7 @@ function gc(t, e, n, o, r, s, i, c, a = !1, h) {
|
|
|
2558
2558
|
};
|
|
2559
2559
|
}
|
|
2560
2560
|
function pc(t, e, n, o, r, s, i, c) {
|
|
2561
|
-
return c ? r.pasteType === Qe.SPECIAL_PASTE_VALUE ?
|
|
2561
|
+
return c ? r.pasteType === Qe.SPECIAL_PASTE_VALUE ? Cc(t, e, n, o, i, c) : r.pasteType === Qe.SPECIAL_PASTE_FORMULA ? vc(t, e, n, o, s, i, c) : _c(t, e, n, o, r.copyType, s, i, c) : Sc(t, e, n, o, i);
|
|
2562
2562
|
}
|
|
2563
2563
|
function Sc(t, e, n, o, r) {
|
|
2564
2564
|
const s = new et(), i = r.getSheetFormulaData(t, e);
|
|
@@ -2568,27 +2568,27 @@ function Sc(t, e, n, o, r) {
|
|
|
2568
2568
|
Re(h.v) ? (l.v = null, l.f = `${h.v}`, l.si = null, l.p = null, s.setValue(u, m, l)) : (d = i == null ? void 0 : i[u]) != null && d[m] && (l.v = h.v, l.f = null, l.si = null, l.p = null, s.setValue(u, m, l));
|
|
2569
2569
|
}), s;
|
|
2570
2570
|
}
|
|
2571
|
-
function
|
|
2571
|
+
function Cc(t, e, n, o, r, s) {
|
|
2572
2572
|
var h, u;
|
|
2573
2573
|
const i = new et(), c = (u = (h = r.getArrayFormulaCellData()) == null ? void 0 : h[s.unitId]) == null ? void 0 : u[s.subUnitId], a = r.getSheetFormulaData(t, e);
|
|
2574
2574
|
return o.forValue((m, l, d) => {
|
|
2575
|
-
var
|
|
2575
|
+
var C, v;
|
|
2576
2576
|
const f = s.range.rows[m % s.range.rows.length], R = s.range.cols[l % s.range.cols.length], g = n.rows[m], p = n.cols[l], S = {};
|
|
2577
2577
|
if (Re(d.f) || Ve(d.si))
|
|
2578
2578
|
S.v = d.v, S.f = null, S.si = null, S.p = null, i.setValue(g, p, S);
|
|
2579
|
-
else if ((
|
|
2579
|
+
else if ((C = c == null ? void 0 : c[f]) != null && C[R]) {
|
|
2580
2580
|
const I = c[f][R];
|
|
2581
2581
|
S.v = I.v, S.f = null, S.si = null, S.p = null, i.setValue(g, p, S);
|
|
2582
|
-
} else if ((
|
|
2582
|
+
} else if ((v = a == null ? void 0 : a[g]) != null && v[p]) {
|
|
2583
2583
|
if (S.v = d.v, S.f = null, S.si = null, S.p = null, d.p) {
|
|
2584
|
-
const I =
|
|
2584
|
+
const I = $o(d);
|
|
2585
2585
|
I && (S.v = I);
|
|
2586
2586
|
}
|
|
2587
2587
|
i.setValue(g, p, S);
|
|
2588
2588
|
}
|
|
2589
2589
|
}), i;
|
|
2590
2590
|
}
|
|
2591
|
-
function
|
|
2591
|
+
function vc(t, e, n, o, r, s, i) {
|
|
2592
2592
|
const c = new et(), a = /* @__PURE__ */ new Map();
|
|
2593
2593
|
return o.forValue((h, u, m) => {
|
|
2594
2594
|
const l = n.rows[h], d = n.cols[u], f = {};
|
|
@@ -2610,14 +2610,14 @@ function Cc(t, e, n, o, r, s, i) {
|
|
|
2610
2610
|
if (g)
|
|
2611
2611
|
f.si = g, f.f = null;
|
|
2612
2612
|
else {
|
|
2613
|
-
g =
|
|
2614
|
-
const p = n.cols[u] - i.range.cols[u % i.range.cols.length], S = n.rows[h] - i.range.rows[h % i.range.rows.length],
|
|
2615
|
-
f.si = g, f.f =
|
|
2613
|
+
g = ft.generateRandomId(6), a.set(R, g);
|
|
2614
|
+
const p = n.cols[u] - i.range.cols[u % i.range.cols.length], S = n.rows[h] - i.range.rows[h % i.range.rows.length], C = r.moveFormulaRefOffset(m.f || "", p, S);
|
|
2615
|
+
f.si = g, f.f = C;
|
|
2616
2616
|
}
|
|
2617
2617
|
f.v = null, f.p = null, c.setValue(l, d, f);
|
|
2618
2618
|
} else {
|
|
2619
2619
|
if (f.v = m.v, f.f = null, f.si = null, f.p = null, m.p) {
|
|
2620
|
-
const R =
|
|
2620
|
+
const R = $o(m);
|
|
2621
2621
|
R && (f.v = R);
|
|
2622
2622
|
}
|
|
2623
2623
|
c.setValue(l, d, f);
|
|
@@ -2649,25 +2649,25 @@ function _c(t, e, n, o, r, s, i, c) {
|
|
|
2649
2649
|
const R = n.rows[l], g = n.cols[d], p = {};
|
|
2650
2650
|
if (Ve(f.si)) {
|
|
2651
2651
|
if (c.unitId !== t || c.subUnitId !== e) {
|
|
2652
|
-
const
|
|
2652
|
+
const C = i.getFormulaStringByCell(
|
|
2653
2653
|
c.range.rows[l % c.range.rows.length],
|
|
2654
2654
|
c.range.cols[d % c.range.cols.length],
|
|
2655
2655
|
c.subUnitId,
|
|
2656
2656
|
c.unitId
|
|
2657
|
-
),
|
|
2657
|
+
), v = n.cols[d] - c.range.cols[d % c.range.cols.length], I = n.rows[l] - c.range.rows[l % c.range.rows.length], T = s.moveFormulaRefOffset(C || "", v, I);
|
|
2658
2658
|
p.si = null, p.f = T;
|
|
2659
2659
|
} else
|
|
2660
2660
|
p.si = f.si, p.f = null;
|
|
2661
2661
|
p.v = null, p.p = null, a.setValue(R, g, p);
|
|
2662
2662
|
} else if (Re(f.f)) {
|
|
2663
|
-
const
|
|
2664
|
-
let
|
|
2665
|
-
if (
|
|
2666
|
-
p.si =
|
|
2663
|
+
const C = `${l % c.range.rows.length}_${d % c.range.cols.length}`;
|
|
2664
|
+
let v = h.get(C);
|
|
2665
|
+
if (v)
|
|
2666
|
+
p.si = v, p.f = null;
|
|
2667
2667
|
else {
|
|
2668
|
-
|
|
2668
|
+
v = ft.generateRandomId(6), h.set(C, v);
|
|
2669
2669
|
const I = n.cols[d] - c.range.cols[d % c.range.cols.length], T = n.rows[l] - c.range.rows[l % c.range.rows.length], w = s.moveFormulaRefOffset(f.f || "", I, T);
|
|
2670
|
-
p.si =
|
|
2670
|
+
p.si = v, p.f = w;
|
|
2671
2671
|
}
|
|
2672
2672
|
p.v = null, p.p = null, a.setValue(R, g, p);
|
|
2673
2673
|
} else (S = u == null ? void 0 : u[R]) != null && S[g] && (p.v = f.v, p.f = null, p.si = null, p.p = f.p, a.setValue(R, g, p));
|
|
@@ -2688,7 +2688,7 @@ function _c(t, e, n, o, r, s, i, c) {
|
|
|
2688
2688
|
}
|
|
2689
2689
|
}), a;
|
|
2690
2690
|
}
|
|
2691
|
-
function
|
|
2691
|
+
function $o(t) {
|
|
2692
2692
|
if (t != null && t.p) {
|
|
2693
2693
|
const e = t == null ? void 0 : t.p.body;
|
|
2694
2694
|
if (e == null)
|
|
@@ -2702,7 +2702,7 @@ var Rc = Object.getOwnPropertyDescriptor, Ic = (t, e, n, o) => {
|
|
|
2702
2702
|
(i = t[s]) && (r = i(r) || r);
|
|
2703
2703
|
return r;
|
|
2704
2704
|
}, He = (t, e) => (n, o) => e(n, o, t);
|
|
2705
|
-
let Mt = class extends
|
|
2705
|
+
let Mt = class extends pt {
|
|
2706
2706
|
constructor(e, n, o, r, s, i, c, a) {
|
|
2707
2707
|
super();
|
|
2708
2708
|
B(this, "_previousShape");
|
|
@@ -2733,29 +2733,26 @@ let Mt = class extends gt {
|
|
|
2733
2733
|
_initInterceptorEditorStart() {
|
|
2734
2734
|
this.disposeWithMe(
|
|
2735
2735
|
Zn(
|
|
2736
|
-
this._sheetInterceptorService.writeCellInterceptor.intercept(
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
const d = (p = h == null ? void 0 : h[i]) == null ? void 0 : p[c];
|
|
2749
|
-
return d != null && (m = this._displayArrayFormulaRangeShape(d, r, s, i, c, a, m)), m ? { ...e, ...m } : o(e);
|
|
2750
|
-
}
|
|
2736
|
+
this._sheetInterceptorService.writeCellInterceptor.intercept(ns, {
|
|
2737
|
+
handler: (e, n, o) => {
|
|
2738
|
+
var f, R, g, p;
|
|
2739
|
+
const { row: r, col: s, unitId: i, subUnitId: c, worksheet: a } = n, h = this._formulaDataModel.getArrayFormulaRange(), u = this._formulaDataModel.getArrayFormulaCellData();
|
|
2740
|
+
if (this._removeArrayFormulaRangeShape(), e == null)
|
|
2741
|
+
return o(e);
|
|
2742
|
+
let m = null;
|
|
2743
|
+
const l = this._formulaDataModel.getFormulaStringByCell(r, s, c, i);
|
|
2744
|
+
if (l !== null && (m = { f: l }), e.v != null && e.v !== "" && ((g = (R = (f = u[i]) == null ? void 0 : f[c]) == null ? void 0 : R[r]) == null ? void 0 : g[s]) == null)
|
|
2745
|
+
return m ? { ...e, ...m } : o(e);
|
|
2746
|
+
const d = (p = h == null ? void 0 : h[i]) == null ? void 0 : p[c];
|
|
2747
|
+
return d != null && (m = this._displayArrayFormulaRangeShape(d, r, s, i, c, a, m)), m ? { ...e, ...m } : o(e);
|
|
2751
2748
|
}
|
|
2752
|
-
)
|
|
2749
|
+
})
|
|
2753
2750
|
)
|
|
2754
2751
|
);
|
|
2755
2752
|
}
|
|
2756
2753
|
_commandExecutedListener() {
|
|
2757
2754
|
this.disposeWithMe(this._commandService.onCommandExecuted((e, n) => {
|
|
2758
|
-
(e.id === Lr.id || e.id ===
|
|
2755
|
+
(e.id === Lr.id || e.id === kr.id && n && n.remove) && this._removeArrayFormulaRangeShape();
|
|
2759
2756
|
})), this.disposeWithMe(
|
|
2760
2757
|
this._commandService.beforeCommandExecuted((e) => {
|
|
2761
2758
|
os.id === e.id && requestIdleCallback(() => {
|
|
@@ -2846,7 +2843,7 @@ let Mt = class extends gt {
|
|
|
2846
2843
|
Mt = Ic([
|
|
2847
2844
|
He(1, K(ao)),
|
|
2848
2845
|
He(2, K(Dt)),
|
|
2849
|
-
He(3, K(
|
|
2846
|
+
He(3, K(gt)),
|
|
2850
2847
|
He(4, ye),
|
|
2851
2848
|
He(5, K(wt)),
|
|
2852
2849
|
He(6, ae),
|
|
@@ -2872,7 +2869,7 @@ let At = class extends ir {
|
|
|
2872
2869
|
handler: (n, o, r) => {
|
|
2873
2870
|
var c, a, h, u;
|
|
2874
2871
|
const s = (u = (h = (a = (c = this._formulaDataModel.getArrayFormulaCellData()) == null ? void 0 : c[o.unitId]) == null ? void 0 : a[o.subUnitId]) == null ? void 0 : h[o.row]) == null ? void 0 : u[o.col];
|
|
2875
|
-
return
|
|
2872
|
+
return ko(n, !!s) ? r({
|
|
2876
2873
|
...n,
|
|
2877
2874
|
markers: {
|
|
2878
2875
|
...n == null ? void 0 : n.markers,
|
|
@@ -2891,7 +2888,7 @@ At = bc([
|
|
|
2891
2888
|
], At);
|
|
2892
2889
|
function yc() {
|
|
2893
2890
|
const t = O(is), e = O(ae), n = Be(t.progress$), o = yt(() => {
|
|
2894
|
-
e.executeCommand(
|
|
2891
|
+
e.executeCommand($r.id);
|
|
2895
2892
|
}, [e]), r = yt(() => {
|
|
2896
2893
|
t.clearProgress();
|
|
2897
2894
|
}, [t]);
|
|
@@ -2909,7 +2906,7 @@ const Tc = (t, e = 100) => {
|
|
|
2909
2906
|
n !== null && clearTimeout(n), window.removeEventListener("scroll", o), window.removeEventListener("resize", o);
|
|
2910
2907
|
};
|
|
2911
2908
|
}, [t, e]);
|
|
2912
|
-
}, Fc = "univer-formula-help-function", Oc = "univer-formula-help-function-title", Mc = "univer-formula-help-function-title-icons", Ac = "univer-formula-help-function-title-icon", Pc = "univer-formula-help-function-content", xc = "univer-formula-help-function-content-inner", wc = "univer-formula-help-function-content-params", Dc = "univer-formula-help-function-content-params-title", Lc = "univer-formula-help-function-content-params-detail",
|
|
2909
|
+
}, Fc = "univer-formula-help-function", Oc = "univer-formula-help-function-title", Mc = "univer-formula-help-function-title-icons", Ac = "univer-formula-help-function-title-icon", Pc = "univer-formula-help-function-content", xc = "univer-formula-help-function-content-inner", wc = "univer-formula-help-function-content-params", Dc = "univer-formula-help-function-content-params-title", Lc = "univer-formula-help-function-content-params-detail", kc = "univer-formula-help-function-active", $c = "univer-formula-help-decorator", Hc = "univer-formula-help-param", Uc = "univer-formula-help-param-prefix", Wc = "univer-formula-help-param-item", Vc = "univer-formula-help-param-active", G = {
|
|
2913
2910
|
formulaHelpFunction: Fc,
|
|
2914
2911
|
formulaHelpFunctionTitle: Oc,
|
|
2915
2912
|
formulaHelpFunctionTitleIcons: Mc,
|
|
@@ -2919,15 +2916,15 @@ const Tc = (t, e = 100) => {
|
|
|
2919
2916
|
formulaHelpFunctionContentParams: wc,
|
|
2920
2917
|
formulaHelpFunctionContentParamsTitle: Dc,
|
|
2921
2918
|
formulaHelpFunctionContentParamsDetail: Lc,
|
|
2922
|
-
formulaHelpFunctionActive:
|
|
2923
|
-
formulaHelpDecorator:
|
|
2919
|
+
formulaHelpFunctionActive: kc,
|
|
2920
|
+
formulaHelpDecorator: $c,
|
|
2924
2921
|
formulaHelpParam: Hc,
|
|
2925
2922
|
formulaHelpParamPrefix: Uc,
|
|
2926
2923
|
formulaHelpParamItem: Wc,
|
|
2927
2924
|
formulaHelpParamActive: Vc
|
|
2928
2925
|
};
|
|
2929
2926
|
function Bc() {
|
|
2930
|
-
const [t, e] =
|
|
2927
|
+
const [t, e] = k(!1), [n, o] = k(!0), [r, s] = k(!0), [i, c] = k(0), [a, h] = k([0, 0]), [u, m] = k({ left: 0, top: 0 }), [l, d] = k(null), f = O(Ct), R = O(qe), g = R.t("formula.prompt.required"), p = R.t("formula.prompt.optional"), S = O(oe), C = O(be), v = O($t), I = hs();
|
|
2931
2928
|
Tc(T), L(() => {
|
|
2932
2929
|
const _ = f.help$.subscribe((P) => {
|
|
2933
2930
|
const { visible: y, paramIndex: E, functionInfo: F } = P;
|
|
@@ -2940,7 +2937,7 @@ function Bc() {
|
|
|
2940
2937
|
return;
|
|
2941
2938
|
const { left: H, top: V, height: te } = x;
|
|
2942
2939
|
F.description === "" && F.functionParameter.length === 0 || (h([H, V + te]), c(E), d(F), m({ left: H, top: V }), e(y));
|
|
2943
|
-
}), N =
|
|
2940
|
+
}), N = v.scrollEvent$.pipe(so(100)).subscribe(T);
|
|
2944
2941
|
return () => {
|
|
2945
2942
|
_ == null || _.unsubscribe(), N.unsubscribe();
|
|
2946
2943
|
};
|
|
@@ -2959,9 +2956,9 @@ function Bc() {
|
|
|
2959
2956
|
if (!_)
|
|
2960
2957
|
return;
|
|
2961
2958
|
const N = _.getUnitId();
|
|
2962
|
-
if (!
|
|
2959
|
+
if (!C.isEditor(N))
|
|
2963
2960
|
return;
|
|
2964
|
-
const P =
|
|
2961
|
+
const P = C.getEditor(N);
|
|
2965
2962
|
return P == null ? void 0 : P.getBoundingClientRect();
|
|
2966
2963
|
}
|
|
2967
2964
|
function A(_) {
|
|
@@ -2970,8 +2967,8 @@ function Bc() {
|
|
|
2970
2967
|
function M() {
|
|
2971
2968
|
s(!r), I.get(ds).focus();
|
|
2972
2969
|
}
|
|
2973
|
-
return /* @__PURE__ */ b(
|
|
2974
|
-
/* @__PURE__ */
|
|
2970
|
+
return /* @__PURE__ */ b(ut, { children: r ? /* @__PURE__ */ b(_o, { visible: t, offset: a, children: l ? /* @__PURE__ */ $("div", { className: G.formulaHelpFunction, children: [
|
|
2971
|
+
/* @__PURE__ */ $("div", { className: G.formulaHelpFunctionTitle, children: [
|
|
2975
2972
|
/* @__PURE__ */ b(
|
|
2976
2973
|
qc,
|
|
2977
2974
|
{
|
|
@@ -2981,7 +2978,7 @@ function Bc() {
|
|
|
2981
2978
|
onClick: A
|
|
2982
2979
|
}
|
|
2983
2980
|
),
|
|
2984
|
-
/* @__PURE__ */
|
|
2981
|
+
/* @__PURE__ */ $("div", { className: G.formulaHelpFunctionTitleIcons, children: [
|
|
2985
2982
|
/* @__PURE__ */ b(
|
|
2986
2983
|
"div",
|
|
2987
2984
|
{
|
|
@@ -3009,7 +3006,7 @@ function Bc() {
|
|
|
3009
3006
|
height: n ? "unset" : 0,
|
|
3010
3007
|
padding: n ? "revert-layer" : 0
|
|
3011
3008
|
},
|
|
3012
|
-
children: /* @__PURE__ */
|
|
3009
|
+
children: /* @__PURE__ */ $("div", { className: G.formulaHelpFunctionContentInner, children: [
|
|
3013
3010
|
/* @__PURE__ */ b(
|
|
3014
3011
|
Yt,
|
|
3015
3012
|
{
|
|
@@ -3036,7 +3033,7 @@ function Bc() {
|
|
|
3036
3033
|
] })
|
|
3037
3034
|
}
|
|
3038
3035
|
)
|
|
3039
|
-
] }) : /* @__PURE__ */ b(
|
|
3036
|
+
] }) : /* @__PURE__ */ b(ut, {}) }) : t ? /* @__PURE__ */ b(
|
|
3040
3037
|
"div",
|
|
3041
3038
|
{
|
|
3042
3039
|
className: G.formulaHelpDecorator,
|
|
@@ -3044,9 +3041,9 @@ function Bc() {
|
|
|
3044
3041
|
style: { left: u.left - 24, top: u.top },
|
|
3045
3042
|
children: /* @__PURE__ */ b(Oo, {})
|
|
3046
3043
|
}
|
|
3047
|
-
) : /* @__PURE__ */ b(
|
|
3044
|
+
) : /* @__PURE__ */ b(ut, {}) });
|
|
3048
3045
|
}
|
|
3049
|
-
const Yt = (t) => /* @__PURE__ */
|
|
3046
|
+
const Yt = (t) => /* @__PURE__ */ $("div", { className: G.formulaHelpFunctionContentParams, children: [
|
|
3050
3047
|
/* @__PURE__ */ b(
|
|
3051
3048
|
"div",
|
|
3052
3049
|
{
|
|
@@ -3060,14 +3057,14 @@ const Yt = (t) => /* @__PURE__ */ k("div", { className: G.formulaHelpFunctionCon
|
|
|
3060
3057
|
/* @__PURE__ */ b("div", { className: G.formulaHelpFunctionContentParamsDetail, children: t.value })
|
|
3061
3058
|
] }), qc = (t) => {
|
|
3062
3059
|
const { prefix: e, value: n, active: o, onClick: r } = t;
|
|
3063
|
-
return /* @__PURE__ */
|
|
3064
|
-
/* @__PURE__ */
|
|
3060
|
+
return /* @__PURE__ */ $("div", { className: G.formulaHelpParam, children: [
|
|
3061
|
+
/* @__PURE__ */ $("span", { className: G.formulaHelpParamPrefix, children: [
|
|
3065
3062
|
e,
|
|
3066
3063
|
"("
|
|
3067
3064
|
] }),
|
|
3068
3065
|
n && n.map((s, i) => (
|
|
3069
3066
|
// TODO@Dushusir: more params needs to be active
|
|
3070
|
-
/* @__PURE__ */
|
|
3067
|
+
/* @__PURE__ */ $("span", { className: G.formulaHelpParamItem, children: [
|
|
3071
3068
|
/* @__PURE__ */ b(
|
|
3072
3069
|
"span",
|
|
3073
3070
|
{
|
|
@@ -3090,10 +3087,10 @@ const Yt = (t) => /* @__PURE__ */ k("div", { className: G.formulaHelpFunctionCon
|
|
|
3090
3087
|
formulaSearchFunctionItemActive: Zc
|
|
3091
3088
|
};
|
|
3092
3089
|
function Xc() {
|
|
3093
|
-
const [t, e] =
|
|
3090
|
+
const [t, e] = k(!1), [n, o] = k(0), [r, s] = k([0, 0]), [i, c] = k([]), [a, h] = k(""), u = j(null), m = O(Ct), l = O(oe), d = O(be);
|
|
3094
3091
|
L(() => {
|
|
3095
|
-
let S = [],
|
|
3096
|
-
const
|
|
3092
|
+
let S = [], C = 0;
|
|
3093
|
+
const v = m.search$.subscribe((w) => {
|
|
3097
3094
|
const { visible: A, searchText: M, searchList: _ } = w;
|
|
3098
3095
|
if (!A) {
|
|
3099
3096
|
e(A);
|
|
@@ -3103,31 +3100,31 @@ function Xc() {
|
|
|
3103
3100
|
if (N == null)
|
|
3104
3101
|
return;
|
|
3105
3102
|
const { left: P, top: y, height: E } = N;
|
|
3106
|
-
h(M), c(_), S = _, s([P, y + E]), e(A), o(0),
|
|
3103
|
+
h(M), c(_), S = _, s([P, y + E]), e(A), o(0), C = 0;
|
|
3107
3104
|
}), I = m.navigate$.subscribe((w) => {
|
|
3108
3105
|
const { direction: A } = w;
|
|
3109
3106
|
if (A === ne.UP) {
|
|
3110
|
-
let M =
|
|
3111
|
-
M = M < 0 ? S.length - 1 : M, o(M),
|
|
3107
|
+
let M = C - 1;
|
|
3108
|
+
M = M < 0 ? S.length - 1 : M, o(M), C = M;
|
|
3112
3109
|
} else if (A === ne.DOWN) {
|
|
3113
|
-
let M =
|
|
3114
|
-
M = M >= S.length ? 0 : M, o(M),
|
|
3110
|
+
let M = C + 1;
|
|
3111
|
+
M = M >= S.length ? 0 : M, o(M), C = M;
|
|
3115
3112
|
}
|
|
3116
|
-
p(
|
|
3113
|
+
p(C);
|
|
3117
3114
|
}), T = m.accept$.subscribe((w) => {
|
|
3118
|
-
const A = S[
|
|
3115
|
+
const A = S[C].name;
|
|
3119
3116
|
m.acceptFormulaName(A);
|
|
3120
3117
|
});
|
|
3121
3118
|
return () => {
|
|
3122
|
-
|
|
3119
|
+
v == null || v.unsubscribe(), I == null || I.unsubscribe(), T == null || T.unsubscribe();
|
|
3123
3120
|
};
|
|
3124
3121
|
}, []);
|
|
3125
3122
|
function f() {
|
|
3126
|
-
const
|
|
3127
|
-
if (!d.isEditor(
|
|
3123
|
+
const C = l.getCurrentUniverDocInstance().getUnitId();
|
|
3124
|
+
if (!d.isEditor(C))
|
|
3128
3125
|
return;
|
|
3129
|
-
const
|
|
3130
|
-
return
|
|
3126
|
+
const v = d.getEditor(C);
|
|
3127
|
+
return v == null ? void 0 : v.getBoundingClientRect();
|
|
3131
3128
|
}
|
|
3132
3129
|
function R(S) {
|
|
3133
3130
|
o(S);
|
|
@@ -3137,42 +3134,42 @@ function Xc() {
|
|
|
3137
3134
|
}
|
|
3138
3135
|
function p(S) {
|
|
3139
3136
|
var P;
|
|
3140
|
-
const
|
|
3141
|
-
if (!v) return;
|
|
3142
|
-
const C = v.parentNode;
|
|
3137
|
+
const C = (P = u.current) == null ? void 0 : P.querySelectorAll(`.${xe.formulaSearchFunctionItem}`)[S];
|
|
3143
3138
|
if (!C) return;
|
|
3144
|
-
const
|
|
3139
|
+
const v = C.parentNode;
|
|
3140
|
+
if (!v) return;
|
|
3141
|
+
const T = v.getBoundingClientRect().top, w = v.offsetHeight, A = C.getBoundingClientRect(), M = A.top, _ = A.height;
|
|
3145
3142
|
if (M >= 0 && M > T && M - T + _ <= w)
|
|
3146
3143
|
return;
|
|
3147
|
-
const N =
|
|
3148
|
-
|
|
3144
|
+
const N = C.offsetTop - (w - _) / 2;
|
|
3145
|
+
v.scrollTo({
|
|
3149
3146
|
top: N,
|
|
3150
3147
|
behavior: "smooth"
|
|
3151
3148
|
});
|
|
3152
3149
|
}
|
|
3153
|
-
return i.length > 0 && /* @__PURE__ */ b(_o, { visible: t, offset: r, children: /* @__PURE__ */ b("ul", { className: xe.formulaSearchFunction, ref: u, children: i.map((S,
|
|
3150
|
+
return i.length > 0 && /* @__PURE__ */ b(_o, { visible: t, offset: r, children: /* @__PURE__ */ b("ul", { className: xe.formulaSearchFunction, ref: u, children: i.map((S, C) => /* @__PURE__ */ $(
|
|
3154
3151
|
"li",
|
|
3155
3152
|
{
|
|
3156
|
-
className: n ===
|
|
3153
|
+
className: n === C ? `
|
|
3157
3154
|
${xe.formulaSearchFunctionItem}
|
|
3158
3155
|
${xe.formulaSearchFunctionItemActive}
|
|
3159
3156
|
` : xe.formulaSearchFunctionItem,
|
|
3160
|
-
onMouseEnter: () => R(
|
|
3157
|
+
onMouseEnter: () => R(C),
|
|
3161
3158
|
onMouseLeave: g,
|
|
3162
3159
|
onClick: () => m.acceptFormulaName(S.name),
|
|
3163
3160
|
children: [
|
|
3164
|
-
/* @__PURE__ */
|
|
3161
|
+
/* @__PURE__ */ $("span", { className: xe.formulaSearchFunctionItemName, children: [
|
|
3165
3162
|
/* @__PURE__ */ b("span", { className: xe.formulaSearchFunctionItemNameLight, children: S.name.substring(0, a.length) }),
|
|
3166
3163
|
/* @__PURE__ */ b("span", { children: S.name.slice(a.length) })
|
|
3167
3164
|
] }),
|
|
3168
3165
|
/* @__PURE__ */ b("span", { className: xe.formulaSearchFunctionItemDesc, children: S.desc })
|
|
3169
3166
|
]
|
|
3170
3167
|
},
|
|
3171
|
-
|
|
3168
|
+
C
|
|
3172
3169
|
)) }) });
|
|
3173
3170
|
}
|
|
3174
3171
|
function Qc() {
|
|
3175
|
-
return /* @__PURE__ */
|
|
3172
|
+
return /* @__PURE__ */ $(ut, { children: [
|
|
3176
3173
|
/* @__PURE__ */ b(Xc, {}),
|
|
3177
3174
|
/* @__PURE__ */ b(Bc, {})
|
|
3178
3175
|
] });
|
|
@@ -3183,12 +3180,12 @@ const Jc = "univer-formula-more-functions", el = "univer-formula-more-functions-
|
|
|
3183
3180
|
};
|
|
3184
3181
|
function Ho(t) {
|
|
3185
3182
|
const { prefix: e, value: n } = t;
|
|
3186
|
-
return /* @__PURE__ */
|
|
3187
|
-
/* @__PURE__ */
|
|
3183
|
+
return /* @__PURE__ */ $("div", { children: [
|
|
3184
|
+
/* @__PURE__ */ $("span", { children: [
|
|
3188
3185
|
e,
|
|
3189
3186
|
"("
|
|
3190
3187
|
] }),
|
|
3191
|
-
n && n.map((o, r) => /* @__PURE__ */
|
|
3188
|
+
n && n.map((o, r) => /* @__PURE__ */ $("span", { children: [
|
|
3192
3189
|
/* @__PURE__ */ b("span", { children: mn(o) }),
|
|
3193
3190
|
r === n.length - 1 ? "" : ","
|
|
3194
3191
|
] }, r)),
|
|
@@ -3200,9 +3197,9 @@ const tl = "univer-formula-function-params", nl = "univer-formula-function-param
|
|
|
3200
3197
|
formulaFunctionParamsTitle: nl,
|
|
3201
3198
|
formulaFunctionParamsDetail: ol
|
|
3202
3199
|
};
|
|
3203
|
-
function
|
|
3200
|
+
function at(t) {
|
|
3204
3201
|
const { className: e, value: n, title: o } = t;
|
|
3205
|
-
return /* @__PURE__ */
|
|
3202
|
+
return /* @__PURE__ */ $("div", { className: zt.formulaFunctionParams, children: [
|
|
3206
3203
|
/* @__PURE__ */ b(
|
|
3207
3204
|
"div",
|
|
3208
3205
|
{
|
|
@@ -3216,7 +3213,7 @@ function lt(t) {
|
|
|
3216
3213
|
/* @__PURE__ */ b("div", { className: zt.formulaFunctionParamsDetail, children: n })
|
|
3217
3214
|
] });
|
|
3218
3215
|
}
|
|
3219
|
-
const rl = "univer-formula-input-params-list", sl = "univer-formula-input-params-list-item-name", il = "univer-formula-input-params-list-item-selector",
|
|
3216
|
+
const rl = "univer-formula-input-params-list", sl = "univer-formula-input-params-list-item-name", il = "univer-formula-input-params-list-item-selector", lt = {
|
|
3220
3217
|
formulaInputParamsList: rl,
|
|
3221
3218
|
formulaInputParamsListItemName: sl,
|
|
3222
3219
|
formulaInputParamsListItemSelector: il
|
|
@@ -3224,14 +3221,14 @@ const rl = "univer-formula-input-params-list", sl = "univer-formula-input-params
|
|
|
3224
3221
|
function cl(t) {
|
|
3225
3222
|
const { functionInfo: e, onChange: n } = t;
|
|
3226
3223
|
if (!e) return null;
|
|
3227
|
-
const [o, r] =
|
|
3228
|
-
return /* @__PURE__ */
|
|
3229
|
-
/* @__PURE__ */ b("div", { className:
|
|
3230
|
-
/* @__PURE__ */ b("div", { className:
|
|
3231
|
-
/* @__PURE__ */ b("div", { className:
|
|
3224
|
+
const [o, r] = k([]), [s, i] = k(e.functionParameter), [c, a] = k(-1);
|
|
3225
|
+
return /* @__PURE__ */ $("div", { className: lt.formulaInputParams, children: [
|
|
3226
|
+
/* @__PURE__ */ b("div", { className: lt.formulaInputParamsList, children: s.map((h, u) => /* @__PURE__ */ $("div", { children: [
|
|
3227
|
+
/* @__PURE__ */ b("div", { className: lt.formulaInputParamsListItemName, children: h.name }),
|
|
3228
|
+
/* @__PURE__ */ b("div", { className: lt.formulaInputParamsListItemSelector })
|
|
3232
3229
|
] }, u)) }),
|
|
3233
|
-
/* @__PURE__ */ b("div", { className:
|
|
3234
|
-
|
|
3230
|
+
/* @__PURE__ */ b("div", { className: lt.formulaInputParamsInfo, children: /* @__PURE__ */ b(
|
|
3231
|
+
at,
|
|
3235
3232
|
{
|
|
3236
3233
|
title: c === -1 ? /* @__PURE__ */ b(Ho, { prefix: e.functionName, value: s }) : s[c].name,
|
|
3237
3234
|
value: c === -1 ? e.description : s[c].detail
|
|
@@ -3249,12 +3246,12 @@ const ll = "univer-formula-select-function-select", al = "univer-formula-select-
|
|
|
3249
3246
|
formulaSelectFunctionContent: ml
|
|
3250
3247
|
};
|
|
3251
3248
|
function gl(t) {
|
|
3252
|
-
const { onChange: e } = t, n = "-1", [o, r] =
|
|
3253
|
-
|
|
3249
|
+
const { onChange: e } = t, n = "-1", [o, r] = k(""), [s, i] = k([]), [c, a] = k(0), [h, u] = k(n), [m, l] = k(0), [d, f] = k(null), R = O(kt), g = O(qe), p = O($t), S = Be(p.sidebarOptions$), C = qs(Hr, g);
|
|
3250
|
+
C.unshift({
|
|
3254
3251
|
label: g.t("formula.moreFunctions.allFunctions"),
|
|
3255
3252
|
value: n
|
|
3256
3253
|
});
|
|
3257
|
-
const
|
|
3254
|
+
const v = g.t("formula.prompt.required"), I = g.t("formula.prompt.optional");
|
|
3258
3255
|
L(() => {
|
|
3259
3256
|
A(n);
|
|
3260
3257
|
}, []), L(() => {
|
|
@@ -3303,11 +3300,11 @@ function gl(t) {
|
|
|
3303
3300
|
}, P = () => {
|
|
3304
3301
|
a(-1);
|
|
3305
3302
|
};
|
|
3306
|
-
return /* @__PURE__ */
|
|
3307
|
-
/* @__PURE__ */
|
|
3308
|
-
/* @__PURE__ */ b(
|
|
3303
|
+
return /* @__PURE__ */ $("div", { children: [
|
|
3304
|
+
/* @__PURE__ */ $("div", { className: _e.formulaSelectFunctionSelect, children: [
|
|
3305
|
+
/* @__PURE__ */ b(vs, { value: h, options: C, onChange: A }),
|
|
3309
3306
|
/* @__PURE__ */ b(
|
|
3310
|
-
|
|
3307
|
+
vo,
|
|
3311
3308
|
{
|
|
3312
3309
|
placeholder: g.t("formula.moreFunctions.searchFunctionPlaceholder"),
|
|
3313
3310
|
onKeyDown: _,
|
|
@@ -3318,7 +3315,7 @@ function gl(t) {
|
|
|
3318
3315
|
}
|
|
3319
3316
|
)
|
|
3320
3317
|
] }),
|
|
3321
|
-
/* @__PURE__ */ b("ul", { className: _e.formulaSelectFunctionResult, onKeyDown: _, tabIndex: -1, children: s.map(({ name: y }, E) => /* @__PURE__ */
|
|
3318
|
+
/* @__PURE__ */ b("ul", { className: _e.formulaSelectFunctionResult, onKeyDown: _, tabIndex: -1, children: s.map(({ name: y }, E) => /* @__PURE__ */ $(
|
|
3322
3319
|
"li",
|
|
3323
3320
|
{
|
|
3324
3321
|
className: c === E ? `
|
|
@@ -3335,27 +3332,27 @@ function gl(t) {
|
|
|
3335
3332
|
},
|
|
3336
3333
|
E
|
|
3337
3334
|
)) }),
|
|
3338
|
-
d && /* @__PURE__ */
|
|
3339
|
-
/* @__PURE__ */ b(
|
|
3335
|
+
d && /* @__PURE__ */ $("div", { className: _e.formulaSelectFunctionContent, children: [
|
|
3336
|
+
/* @__PURE__ */ b(at, { title: d.functionName, value: d.description }),
|
|
3340
3337
|
/* @__PURE__ */ b(
|
|
3341
|
-
|
|
3338
|
+
at,
|
|
3342
3339
|
{
|
|
3343
3340
|
title: g.t("formula.moreFunctions.syntax"),
|
|
3344
3341
|
value: /* @__PURE__ */ b(Ho, { prefix: d.functionName, value: d.functionParameter })
|
|
3345
3342
|
}
|
|
3346
3343
|
),
|
|
3347
3344
|
/* @__PURE__ */ b(
|
|
3348
|
-
|
|
3345
|
+
at,
|
|
3349
3346
|
{
|
|
3350
3347
|
title: g.t("formula.prompt.helpExample"),
|
|
3351
3348
|
value: `${d.functionName}(${d.functionParameter.map((y) => y.example).join(",")})`
|
|
3352
3349
|
}
|
|
3353
3350
|
),
|
|
3354
3351
|
d.functionParameter && d.functionParameter.map((y) => /* @__PURE__ */ b(
|
|
3355
|
-
|
|
3352
|
+
at,
|
|
3356
3353
|
{
|
|
3357
3354
|
title: y.name,
|
|
3358
|
-
value: `${y.require ?
|
|
3355
|
+
value: `${y.require ? v : I} ${y.detail}`
|
|
3359
3356
|
},
|
|
3360
3357
|
y.name
|
|
3361
3358
|
))
|
|
@@ -3363,7 +3360,7 @@ function gl(t) {
|
|
|
3363
3360
|
] });
|
|
3364
3361
|
}
|
|
3365
3362
|
function pl() {
|
|
3366
|
-
const t = yr(), [e, n] =
|
|
3363
|
+
const t = yr(), [e, n] = k(!0), [o, r] = k(!1), [s, i] = k(null);
|
|
3367
3364
|
O(Xn);
|
|
3368
3365
|
const c = O(qe), a = O(be), h = O(oe), u = O(ae);
|
|
3369
3366
|
function m() {
|
|
@@ -3380,11 +3377,11 @@ function pl() {
|
|
|
3380
3377
|
const f = a.getEditor(nn), R = a.getEditor(zn), g = `=${s == null ? void 0 : s.functionName}(`;
|
|
3381
3378
|
f == null || f.replaceText(g), R == null || R.replaceText(g, !1);
|
|
3382
3379
|
}
|
|
3383
|
-
return /* @__PURE__ */
|
|
3380
|
+
return /* @__PURE__ */ $("div", { className: Kn.formulaMoreFunctions, children: [
|
|
3384
3381
|
e && /* @__PURE__ */ b(gl, { onChange: i }),
|
|
3385
3382
|
o && /* @__PURE__ */ b(cl, { functionInfo: s, onChange: () => {
|
|
3386
3383
|
} }),
|
|
3387
|
-
/* @__PURE__ */
|
|
3384
|
+
/* @__PURE__ */ $("div", { className: Kn.formulaMoreFunctionsOperation, children: [
|
|
3388
3385
|
o && /* @__PURE__ */ b(Je, { type: "primary", size: "small", onClick: m, children: c.t("formula.moreFunctions.next") }),
|
|
3389
3386
|
o && /* @__PURE__ */ b(Je, { size: "small", onClick: m, children: c.t("formula.moreFunctions.prev") }),
|
|
3390
3387
|
e && !!t && /* @__PURE__ */ b(Je, { type: "primary", size: "small", onClick: l, children: c.t("formula.moreFunctions.confirm") })
|
|
@@ -3443,14 +3440,14 @@ function Sl(t) {
|
|
|
3443
3440
|
disabled$: no(t, { workbookTypes: [mo], worksheetTypes: [fo, uo], rangeTypes: [ho] })
|
|
3444
3441
|
};
|
|
3445
3442
|
}
|
|
3446
|
-
function
|
|
3443
|
+
function Cl(t) {
|
|
3447
3444
|
return {
|
|
3448
3445
|
id: fn.id,
|
|
3449
3446
|
title: "formula.insert.more",
|
|
3450
3447
|
type: ln.BUTTON
|
|
3451
3448
|
};
|
|
3452
3449
|
}
|
|
3453
|
-
function
|
|
3450
|
+
function vl(t) {
|
|
3454
3451
|
return t.get(oe).getCurrentTypeOfUnit$(ue.UNIVER_SHEET).pipe(
|
|
3455
3452
|
qr((o) => o ? t.get(Ln) ? new jr((s) => s.next(!t.get(Ln).supportClipboard)) : On(!0) : On(!0))
|
|
3456
3453
|
);
|
|
@@ -3460,7 +3457,7 @@ function _l(t) {
|
|
|
3460
3457
|
id: an.id,
|
|
3461
3458
|
type: ln.BUTTON,
|
|
3462
3459
|
title: "formula.operation.pasteFormula",
|
|
3463
|
-
disabled$:
|
|
3460
|
+
disabled$: vl(t).pipe(
|
|
3464
3461
|
Br(no(t, { workbookTypes: [mo], rangeTypes: [ho], worksheetTypes: [uo, fo] })),
|
|
3465
3462
|
io(([e, n]) => e || n)
|
|
3466
3463
|
)
|
|
@@ -3473,7 +3470,7 @@ const Rl = {
|
|
|
3473
3470
|
menuItemFactory: Sl,
|
|
3474
3471
|
[fn.id]: {
|
|
3475
3472
|
order: 1,
|
|
3476
|
-
menuItemFactory:
|
|
3473
|
+
menuItemFactory: Cl
|
|
3477
3474
|
}
|
|
3478
3475
|
}
|
|
3479
3476
|
},
|
|
@@ -3493,9 +3490,9 @@ function bl() {
|
|
|
3493
3490
|
const t = [];
|
|
3494
3491
|
for (const e of El)
|
|
3495
3492
|
t.push({
|
|
3496
|
-
id:
|
|
3493
|
+
id: ot.id,
|
|
3497
3494
|
binding: e,
|
|
3498
|
-
preconditions: (n) =>
|
|
3495
|
+
preconditions: (n) => St(n),
|
|
3499
3496
|
staticParameters: {
|
|
3500
3497
|
eventType: Ne.Keyboard,
|
|
3501
3498
|
keycode: e
|
|
@@ -3507,9 +3504,9 @@ function Nl() {
|
|
|
3507
3504
|
const t = [];
|
|
3508
3505
|
for (const e of Wt)
|
|
3509
3506
|
t.push({
|
|
3510
|
-
id:
|
|
3507
|
+
id: ot.id,
|
|
3511
3508
|
binding: e | W.SHIFT,
|
|
3512
|
-
preconditions: (n) =>
|
|
3509
|
+
preconditions: (n) => St(n),
|
|
3513
3510
|
staticParameters: {
|
|
3514
3511
|
eventType: Ne.Keyboard,
|
|
3515
3512
|
keycode: e,
|
|
@@ -3522,9 +3519,9 @@ function yl() {
|
|
|
3522
3519
|
const t = [];
|
|
3523
3520
|
for (const e of Wt)
|
|
3524
3521
|
t.push({
|
|
3525
|
-
id:
|
|
3522
|
+
id: ot.id,
|
|
3526
3523
|
binding: e | W.CTRL_COMMAND,
|
|
3527
|
-
preconditions: (n) =>
|
|
3524
|
+
preconditions: (n) => St(n),
|
|
3528
3525
|
staticParameters: {
|
|
3529
3526
|
eventType: Ne.Keyboard,
|
|
3530
3527
|
keycode: e,
|
|
@@ -3537,9 +3534,9 @@ function Tl() {
|
|
|
3537
3534
|
const t = [];
|
|
3538
3535
|
for (const e of Wt)
|
|
3539
3536
|
t.push({
|
|
3540
|
-
id:
|
|
3537
|
+
id: ot.id,
|
|
3541
3538
|
binding: e | W.SHIFT | W.CTRL_COMMAND,
|
|
3542
|
-
preconditions: (n) =>
|
|
3539
|
+
preconditions: (n) => St(n),
|
|
3543
3540
|
staticParameters: {
|
|
3544
3541
|
eventType: Ne.Keyboard,
|
|
3545
3542
|
keycode: e,
|
|
@@ -3551,13 +3548,13 @@ function Tl() {
|
|
|
3551
3548
|
const Fl = {
|
|
3552
3549
|
id: bo.id,
|
|
3553
3550
|
binding: D.F4,
|
|
3554
|
-
preconditions: (t) =>
|
|
3551
|
+
preconditions: (t) => St(t)
|
|
3555
3552
|
};
|
|
3556
3553
|
function Ol() {
|
|
3557
3554
|
const t = [];
|
|
3558
3555
|
for (const e of [D.ENTER, D.TAB, D.ARROW_DOWN, D.ARROW_UP])
|
|
3559
3556
|
t.push({
|
|
3560
|
-
id:
|
|
3557
|
+
id: ot.id,
|
|
3561
3558
|
binding: e,
|
|
3562
3559
|
preconditions: (n) => rc(n),
|
|
3563
3560
|
staticParameters: {
|
|
@@ -3573,7 +3570,7 @@ var Ml = Object.getOwnPropertyDescriptor, Al = (t, e, n, o) => {
|
|
|
3573
3570
|
(i = t[s]) && (r = i(r) || r);
|
|
3574
3571
|
return r;
|
|
3575
3572
|
}, Ue = (t, e) => (n, o) => e(n, o, t);
|
|
3576
|
-
let Pt = class extends
|
|
3573
|
+
let Pt = class extends pt {
|
|
3577
3574
|
constructor(t, e, n, o, r, s, i) {
|
|
3578
3575
|
super(), this._injector = t, this._menuManagerService = e, this._commandService = n, this._shortcutService = o, this._uiPartsService = r, this._renderManagerService = s, this._componentManager = i, this._initialize();
|
|
3579
3576
|
}
|
|
@@ -3590,7 +3587,7 @@ let Pt = class extends gt {
|
|
|
3590
3587
|
fn,
|
|
3591
3588
|
Ps,
|
|
3592
3589
|
Ns,
|
|
3593
|
-
|
|
3590
|
+
ot,
|
|
3594
3591
|
bo
|
|
3595
3592
|
].forEach((t) => this.disposeWithMe(this._commandService.registerCommand(t)));
|
|
3596
3593
|
}
|
|
@@ -3607,14 +3604,14 @@ let Pt = class extends gt {
|
|
|
3607
3604
|
});
|
|
3608
3605
|
}
|
|
3609
3606
|
_registerComponents() {
|
|
3610
|
-
this.disposeWithMe(this._uiPartsService.registerComponent(
|
|
3607
|
+
this.disposeWithMe(this._uiPartsService.registerComponent(Co.CONTENT, () => Xt(Qc, this._injector))), this.disposeWithMe(this._uiPartsService.registerComponent(Fr.FORMULA_AUX, () => Xt(yc, this._injector))), this._componentManager.register(Eo, pl);
|
|
3611
3608
|
}
|
|
3612
3609
|
_registerRenderModules() {
|
|
3613
3610
|
this.disposeWithMe(this._renderManagerService.registerRenderModule(ue.UNIVER_SHEET, [Mt]));
|
|
3614
3611
|
}
|
|
3615
3612
|
};
|
|
3616
3613
|
Pt = Al([
|
|
3617
|
-
Ue(0, K(
|
|
3614
|
+
Ue(0, K(mt)),
|
|
3618
3615
|
Ue(1, ps),
|
|
3619
3616
|
Ue(2, ae),
|
|
3620
3617
|
Ue(3, Ht),
|
|
@@ -3638,7 +3635,11 @@ const Pl = () => {
|
|
|
3638
3635
|
unitId: (o = e == null ? void 0 : e.unitId) != null ? o : "",
|
|
3639
3636
|
subUnitId: (r = e == null ? void 0 : e.subUnitId) != null ? r : "",
|
|
3640
3637
|
hideEditor: !0,
|
|
3641
|
-
selectorRef: n
|
|
3638
|
+
selectorRef: n,
|
|
3639
|
+
onChange: (s, i) => {
|
|
3640
|
+
var c;
|
|
3641
|
+
e == null || e.callback((c = i == null ? void 0 : i.split(",").map((a) => nt(a))) != null ? c : []);
|
|
3642
|
+
}
|
|
3642
3643
|
}
|
|
3643
3644
|
);
|
|
3644
3645
|
};
|
|
@@ -3659,7 +3660,7 @@ let xt = class extends ur {
|
|
|
3659
3660
|
onStarting() {
|
|
3660
3661
|
const t = this._injector;
|
|
3661
3662
|
[
|
|
3662
|
-
[
|
|
3663
|
+
[Ct, { useClass: Qt }],
|
|
3663
3664
|
[Lo],
|
|
3664
3665
|
[Pt],
|
|
3665
3666
|
[Ft],
|
|
@@ -3687,14 +3688,14 @@ let xt = class extends ur {
|
|
|
3687
3688
|
this._injector.get(Ft);
|
|
3688
3689
|
}
|
|
3689
3690
|
_initUIPart() {
|
|
3690
|
-
this.disposeWithMe(this._uiPartsService.registerComponent(
|
|
3691
|
+
this.disposeWithMe(this._uiPartsService.registerComponent(Co.GLOBAL, () => Xt(Pl, this._injector)));
|
|
3691
3692
|
}
|
|
3692
3693
|
};
|
|
3693
3694
|
Uo(xt, "pluginName", Io);
|
|
3694
3695
|
Uo(xt, "type", ue.UNIVER_SHEET);
|
|
3695
3696
|
xt = Ll([
|
|
3696
3697
|
lr(Ur, cs),
|
|
3697
|
-
bt(1, K(
|
|
3698
|
+
bt(1, K(mt)),
|
|
3698
3699
|
bt(2, ye),
|
|
3699
3700
|
bt(3, ar),
|
|
3700
3701
|
bt(4, po)
|
|
@@ -3710,7 +3711,7 @@ export {
|
|
|
3710
3711
|
De as RefSelectionsRenderService,
|
|
3711
3712
|
bo as ReferenceAbsoluteOperation,
|
|
3712
3713
|
Ps as SearchFunctionOperation,
|
|
3713
|
-
|
|
3714
|
+
ot as SelectEditorFormulaOperation,
|
|
3714
3715
|
an as SheetOnlyPasteFormulaCommand,
|
|
3715
3716
|
xt as UniverSheetsFormulaUIPlugin
|
|
3716
3717
|
};
|