@univerjs/sheets-formula-ui 0.12.0 → 0.12.1
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 +5 -5
- package/lib/cjs/locale/ca-ES.js +2 -2
- package/lib/cjs/locale/en-US.js +2 -2
- package/lib/cjs/locale/es-ES.js +2 -2
- package/lib/cjs/locale/fa-IR.js +2 -2
- package/lib/cjs/locale/fr-FR.js +2 -2
- package/lib/cjs/locale/ja-JP.js +2 -2
- package/lib/cjs/locale/ko-KR.js +2 -2
- package/lib/cjs/locale/ru-RU.js +2 -2
- package/lib/cjs/locale/vi-VN.js +2 -2
- package/lib/cjs/locale/zh-CN.js +2 -2
- package/lib/cjs/locale/zh-TW.js +2 -2
- package/lib/es/index.js +829 -804
- package/lib/es/locale/ca-ES.js +9 -4
- package/lib/es/locale/en-US.js +9 -4
- package/lib/es/locale/es-ES.js +9 -4
- package/lib/es/locale/fa-IR.js +9 -4
- package/lib/es/locale/fr-FR.js +9 -4
- package/lib/es/locale/ja-JP.js +9 -4
- package/lib/es/locale/ko-KR.js +9 -4
- package/lib/es/locale/ru-RU.js +9 -4
- package/lib/es/locale/vi-VN.js +17 -12
- package/lib/es/locale/zh-CN.js +9 -4
- package/lib/es/locale/zh-TW.js +9 -4
- package/lib/index.js +829 -804
- package/lib/locale/ca-ES.js +9 -4
- package/lib/locale/en-US.js +9 -4
- package/lib/locale/es-ES.js +9 -4
- package/lib/locale/fa-IR.js +9 -4
- package/lib/locale/fr-FR.js +9 -4
- package/lib/locale/ja-JP.js +9 -4
- package/lib/locale/ko-KR.js +9 -4
- package/lib/locale/ru-RU.js +9 -4
- package/lib/locale/vi-VN.js +17 -12
- package/lib/locale/zh-CN.js +9 -4
- package/lib/locale/zh-TW.js +9 -4
- package/lib/types/controllers/image-formula-render.controller.d.ts +9 -0
- package/lib/types/locale/en-US.d.ts +24 -4
- package/lib/types/locale/function-list/lookup/en-US.d.ts +14 -2
- package/lib/types/locale/function-list/math/en-US.d.ts +10 -2
- package/lib/umd/index.js +5 -5
- package/lib/umd/locale/ca-ES.js +2 -2
- package/lib/umd/locale/en-US.js +2 -2
- package/lib/umd/locale/es-ES.js +2 -2
- package/lib/umd/locale/fa-IR.js +2 -2
- package/lib/umd/locale/fr-FR.js +2 -2
- package/lib/umd/locale/ja-JP.js +2 -2
- package/lib/umd/locale/ko-KR.js +2 -2
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/vi-VN.js +2 -2
- package/lib/umd/locale/zh-CN.js +2 -2
- package/lib/umd/locale/zh-TW.js +2 -2
- package/package.json +12 -12
package/lib/es/index.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var j = (e, t, n) =>
|
|
4
|
-
import { CommandType as
|
|
5
|
-
import { SheetPasteCommand as
|
|
6
|
-
import { sequenceNodeType as Q, serializeRange as Ce, FormulaDataModel as
|
|
7
|
-
import { Subject as mt, debounceTime as
|
|
8
|
-
import { IEditorService as
|
|
9
|
-
import { DeviceInputEventType as
|
|
10
|
-
import { SheetsSelectionsService as
|
|
11
|
-
import { InsertFunctionCommand as
|
|
12
|
-
import { ISidebarService as
|
|
13
|
-
import { jsx as M, jsxs as
|
|
14
|
-
import { useCallback as
|
|
15
|
-
import { clsx as re, scrollbarClassName as
|
|
16
|
-
import { DocSelectionManagerService as
|
|
17
|
-
import { debounceTime as
|
|
18
|
-
const
|
|
1
|
+
var Zr = Object.defineProperty;
|
|
2
|
+
var zr = (e, t, n) => t in e ? Zr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var j = (e, t, n) => zr(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { CommandType as Oe, ICommandService as me, createIdentifier as Xr, IContextService as ln, IUniverInstanceService as ne, Rectangle as nr, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as un, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as rr, DEFAULT_EMPTY_DOCUMENT_VALUE as or, isRealNum as Qr, CellValueType as wn, getCellValueType as Jr, Inject as q, Disposable as Ke, ObjectMatrix as Fe, Range as eo, Tools as dn, LocaleService as dt, isICellData as to, isFormulaString as Ae, isFormulaId as lt, generateRandomId as Kt, Direction as de, Injector as Rt, UniverInstanceType as W, ThemeService as It, ILogService as no, toDisposable as sr, ColorKit as hn, RxDisposable as ro, InterceptorEffectEnum as oo, FOCUSING_DOC as so, FOCUSING_UNIVER_EDITOR as io, DisposableCollection as qe, RANGE_TYPE as ve, getBodySlice as kn, EDITOR_ACTIVATED as An, createInternalEditorID as co, BuildTextUtils as ao, IConfigService as ir, RichTextBuilder as lo, DependentOn as uo, Plugin as ho, merge as fo, registerDependencies as go, touchDependencies as mo } from "@univerjs/core";
|
|
5
|
+
import { SheetPasteCommand as po, PREDEFINED_HOOK_NAME as ct, IEditorBridgeService as fn, SetCellEditVisibleOperation as cr, HoverManagerService as So, CellAlertManagerService as vo, CellAlertType as Co, IAutoFillService as _o, APPLY_TYPE as Ro, DATA_TYPE as Fn, ISheetClipboardService as Io, COPY_TYPE as ar, SheetSkeletonManagerService as Et, attachSelectionWithCoord as rn, SelectionControl as lr, SELECTION_SHAPE_DEPTH as Eo, useActiveWorkbook as bo, getCurrentRangeDisable$ as Ye, PASTE_SPECIAL_MENU_ID as yo, whenFormulaEditorActivated as bt, whenSheetEditorFocused as To, SheetsUIPart as No, BaseSelectionRenderService as Oo, getCoordByOffset as Dn, checkInHeaderRanges as $n, getAllSelection as xo, genNormalSelectionStyle as ur, getSheetObject as Mo, MoveSelectionCommand as Ln, JumpOver as Pn, ExpandSelectionCommand as Un, EMBEDDING_FORMULA_EDITOR as wo, IMarkSelectionService as ko, RANGE_SELECTOR_COMPONENT_KEY as Ao, EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY as Fo } from "@univerjs/sheets-ui";
|
|
6
|
+
import { sequenceNodeType as Q, serializeRange as Ce, FormulaDataModel as yt, LexerTreeBuilder as _e, ErrorType as ue, extractFormulaError as dr, SetFormulaCalculationResultMutation as Do, SetArrayFormulaDataMutation as $o, SetFormulaCalculationStopMutation as Lo, FunctionType as hr, matchToken as je, deserializeRangeWithSheetWithCache as Po, matchRefDrawToken as Uo, isFormulaLexerToken as Vo, deserializeRangeWithSheet as ht, serializeRangeToRefString as Wo, serializeRangeWithSheet as Ct, serializeRangeWithSpreadsheet as Ho, generateStringWithSequence as Bo, operatorToken as fr, UniverFormulaEnginePlugin as qo } from "@univerjs/engine-formula";
|
|
7
|
+
import { Subject as mt, debounceTime as gn, combineLatestWith as jo, map as gr, switchMap as Ko, of as Vn, Observable as Yo, BehaviorSubject as mr, throttleTime as Go, filter as pr, distinctUntilChanged as Zo, merge as zo } from "rxjs";
|
|
8
|
+
import { IEditorService as Ge, DocSelectionRenderService as Sr, ReplaceTextRunsCommand as Wn, MoveSelectionOperation as Xo, MoveCursorOperation as Qo, useKeyboardEvent as Jo, useResize as es, DocBackScrollRenderController as ts, RichTextEditor as ns } from "@univerjs/docs-ui";
|
|
9
|
+
import { DeviceInputEventType as xe, IRenderManagerService as Re, ScrollTimerType as Qt, SHEET_VIEWPORT_KEY as Hn, Vector2 as Bn } from "@univerjs/engine-render";
|
|
10
|
+
import { SheetsSelectionsService as mn, getSheetCommandTarget as vr, getCellAtRowCol as rs, SetSelectionsOperation as pn, SheetInterceptorService as Sn, ReorderRangeCommand as os, SetRangeValuesMutation as Dt, SetRangeValuesUndoMutationFactory as ss, BEFORE_CELL_EDIT as is, SetWorksheetRowAutoHeightMutation as cs, INTERCEPTOR_POINT as as, WorksheetSetCellValuePermission as Ze, WorksheetEditPermission as ze, RangeProtectionPermissionEditPoint as Xe, WorkbookEditablePermission as Qe, IRefSelectionsService as Yt, SelectionMoveType as Jt, convertSelectionDataToRange as ls, setEndForRange as us, REF_SELECTIONS_ENABLED as qn, SetWorksheetActiveOperation as jn } from "@univerjs/sheets";
|
|
11
|
+
import { InsertFunctionCommand as ds, TriggerCalculationController as hs, IDescriptionService as Gt, QuickSumCommand as fs, ImageFormulaCellInterceptorController as gs, UniverSheetsFormulaPlugin as ms } from "@univerjs/sheets-formula";
|
|
12
|
+
import { ISidebarService as vn, IZenZoneService as ps, useDependency as T, useObservable as Se, ProgressBar as Ss, MenuItemType as Je, getMenuHiddenObservable as ft, IClipboardInterfaceService as Kn, RibbonFormulasGroup as Yn, KeyCode as $, MetaKeys as P, IMenuManagerService as vs, IShortcutService as Zt, IUIPartsService as Cr, ComponentManager as _r, connectInjector as Rr, useEvent as te, RectPopup as on, IContextMenuService as Cs, useUpdateEffect as _s, BuiltInUIPart as Rs } from "@univerjs/ui";
|
|
13
|
+
import { jsx as M, jsxs as H, Fragment as Is } from "react/jsx-runtime";
|
|
14
|
+
import { useCallback as $t, useState as V, useRef as z, createElement as et, forwardRef as $e, useEffect as L, useMemo as ie, useLayoutEffect as Lt, useImperativeHandle as Es } from "react";
|
|
15
|
+
import { clsx as re, scrollbarClassName as ut, borderLeftClassName as bs, Select as ys, Input as Ir, borderClassName as Cn, Button as at, borderTopClassName as Ts, Tooltip as Ns, Dialog as Os } from "@univerjs/design";
|
|
16
|
+
import { DocSelectionManagerService as Er } from "@univerjs/docs";
|
|
17
|
+
import { debounceTime as xs } from "rxjs/operators";
|
|
18
|
+
const _n = {
|
|
19
19
|
id: "sheet.command.paste-formula",
|
|
20
|
-
type:
|
|
21
|
-
handler: async (e) => e.get(me).executeCommand(
|
|
22
|
-
value:
|
|
20
|
+
type: Oe.COMMAND,
|
|
21
|
+
handler: async (e) => e.get(me).executeCommand(po.id, {
|
|
22
|
+
value: ct.SPECIAL_PASTE_FORMULA
|
|
23
23
|
})
|
|
24
24
|
}, gt = {
|
|
25
25
|
id: "formula-ui.operation.select-editor-formula",
|
|
26
|
-
type:
|
|
26
|
+
type: Oe.OPERATION,
|
|
27
27
|
handler: (e, t) => !0
|
|
28
28
|
};
|
|
29
|
-
var
|
|
30
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
29
|
+
var Ms = Object.getOwnPropertyDescriptor, ws = (e, t, n, o) => {
|
|
30
|
+
for (var r = o > 1 ? void 0 : o ? Ms(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
31
31
|
(i = e[s]) && (r = i(r) || r);
|
|
32
32
|
return r;
|
|
33
|
-
},
|
|
34
|
-
const
|
|
35
|
-
let
|
|
33
|
+
}, ks = (e, t) => (n, o) => t(n, o, e);
|
|
34
|
+
const As = "FORMULA_PROMPT_ACTIVATED", zt = Xr("formula-ui.prompt-service");
|
|
35
|
+
let sn = class {
|
|
36
36
|
constructor(e) {
|
|
37
37
|
j(this, "_search$", new mt());
|
|
38
38
|
j(this, "_help$", new mt());
|
|
@@ -55,7 +55,7 @@ let rn = class {
|
|
|
55
55
|
this._search$.complete(), this._help$.complete(), this._navigate$.complete(), this._accept$.complete(), this._acceptFormulaName$.complete(), this._sequenceNodes = [];
|
|
56
56
|
}
|
|
57
57
|
search(e) {
|
|
58
|
-
this._contextService.setContextValue(
|
|
58
|
+
this._contextService.setContextValue(As, e.visible), this._searching = e.visible, this._search$.next(e);
|
|
59
59
|
}
|
|
60
60
|
isSearching() {
|
|
61
61
|
return this._searching;
|
|
@@ -187,39 +187,39 @@ let rn = class {
|
|
|
187
187
|
return this._isLockedOnSelectionInsertRefString;
|
|
188
188
|
}
|
|
189
189
|
};
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
],
|
|
193
|
-
const
|
|
190
|
+
sn = ws([
|
|
191
|
+
ks(0, ln)
|
|
192
|
+
], sn);
|
|
193
|
+
const Fs = {
|
|
194
194
|
id: "formula-ui.operation.help-function",
|
|
195
|
-
type:
|
|
196
|
-
handler: async (e, t) => (e.get(
|
|
195
|
+
type: Oe.OPERATION,
|
|
196
|
+
handler: async (e, t) => (e.get(zt).help(t), !0)
|
|
197
197
|
}, pe = {
|
|
198
198
|
id: "formula-ui.operation.insert-function",
|
|
199
|
-
type:
|
|
199
|
+
type: Oe.OPERATION,
|
|
200
200
|
// eslint-disable-next-line
|
|
201
201
|
handler: async (e, t) => {
|
|
202
202
|
var C, _;
|
|
203
|
-
const n = e.get(
|
|
203
|
+
const n = e.get(mn), o = e.get(Ge), r = n.getCurrentSelections();
|
|
204
204
|
if (!r || !r.length)
|
|
205
205
|
return !1;
|
|
206
|
-
const s =
|
|
206
|
+
const s = vr(e.get(ne));
|
|
207
207
|
if (!s) return !1;
|
|
208
208
|
const { worksheet: i, unitId: c, subUnitId: l } = s, g = i.getCellMatrix(), { value: m } = t, h = e.get(me);
|
|
209
|
-
e.get(
|
|
209
|
+
e.get(fn);
|
|
210
210
|
const d = [], u = [];
|
|
211
211
|
let a = null, v = 0, p = 0, S = "";
|
|
212
|
-
if (r.length === 1 && (
|
|
212
|
+
if (r.length === 1 && (Ls(r[0].range) || Ps(r[0].range) && Zn(g, r[0].range))) {
|
|
213
213
|
const { range: E, primary: f } = r[0], b = (C = f == null ? void 0 : f.actualRow) != null ? C : E.startRow, y = (_ = f == null ? void 0 : f.actualColumn) != null ? _ : E.startColumn;
|
|
214
214
|
a = E, v = b, p = y;
|
|
215
|
-
const A =
|
|
215
|
+
const A = Gn(g, b, y);
|
|
216
216
|
A && (S = Ce(A));
|
|
217
217
|
} else
|
|
218
218
|
r.some((E) => {
|
|
219
219
|
var y, A;
|
|
220
220
|
const { range: f, primary: b } = E;
|
|
221
|
-
if (
|
|
222
|
-
const F = (y = b == null ? void 0 : b.actualRow) != null ? y : f.startRow, N = (A = b == null ? void 0 : b.actualColumn) != null ? A : f.startColumn, O =
|
|
221
|
+
if (Zn(g, f)) {
|
|
222
|
+
const F = (y = b == null ? void 0 : b.actualRow) != null ? y : f.startRow, N = (A = b == null ? void 0 : b.actualColumn) != null ? A : f.startColumn, O = Gn(g, F, N);
|
|
223
223
|
if (!O)
|
|
224
224
|
return a = f, v = F, p = N, !0;
|
|
225
225
|
const k = Ce(O), I = `=${m}(${k})`;
|
|
@@ -234,7 +234,7 @@ const ws = {
|
|
|
234
234
|
} else {
|
|
235
235
|
const { startRow: F, startColumn: N, endRow: O, endColumn: k } = f;
|
|
236
236
|
if (F === O) {
|
|
237
|
-
const I =
|
|
237
|
+
const I = Us(g, F, k, i.getColumnCount() - 1), x = I === k ? k - 1 : k, R = Ce({
|
|
238
238
|
startRow: F,
|
|
239
239
|
endRow: O,
|
|
240
240
|
startColumn: N,
|
|
@@ -251,7 +251,7 @@ const ws = {
|
|
|
251
251
|
} else {
|
|
252
252
|
let I = -1;
|
|
253
253
|
for (let R = N; R <= k; R++) {
|
|
254
|
-
const w =
|
|
254
|
+
const w = Vs(g, R, O, i.getRowCount() - 1);
|
|
255
255
|
I = Math.max(I, w);
|
|
256
256
|
}
|
|
257
257
|
const x = I === O ? O - 1 : O;
|
|
@@ -276,8 +276,8 @@ const ws = {
|
|
|
276
276
|
return !1;
|
|
277
277
|
});
|
|
278
278
|
if (a) {
|
|
279
|
-
const E =
|
|
280
|
-
range:
|
|
279
|
+
const E = rs(v, p, i), f = {
|
|
280
|
+
range: nr.clone(a),
|
|
281
281
|
primary: {
|
|
282
282
|
startRow: E.startRow,
|
|
283
283
|
startColumn: E.startColumn,
|
|
@@ -293,24 +293,24 @@ const ws = {
|
|
|
293
293
|
subUnitId: l,
|
|
294
294
|
selections: [f]
|
|
295
295
|
};
|
|
296
|
-
await h.executeCommand(
|
|
297
|
-
const y = o.getEditor(
|
|
298
|
-
h.syncExecuteCommand(
|
|
296
|
+
await h.executeCommand(pn.id, b);
|
|
297
|
+
const y = o.getEditor(un), A = o.getEditor(rr);
|
|
298
|
+
h.syncExecuteCommand(cr.id, {
|
|
299
299
|
visible: !0,
|
|
300
300
|
unitId: c,
|
|
301
|
-
eventType:
|
|
301
|
+
eventType: xe.Dblclick
|
|
302
302
|
});
|
|
303
303
|
const F = `=${m}(${S}`;
|
|
304
304
|
y == null || y.replaceText(F), A == null || A.replaceText(F, !1);
|
|
305
305
|
}
|
|
306
|
-
return d.length === 0 && u.length === 0 ? !1 : h.executeCommand(
|
|
306
|
+
return d.length === 0 && u.length === 0 ? !1 : h.executeCommand(ds.id, {
|
|
307
307
|
list: d,
|
|
308
308
|
listOfRangeHasNumber: u
|
|
309
309
|
});
|
|
310
310
|
}
|
|
311
311
|
};
|
|
312
|
-
function
|
|
313
|
-
const o =
|
|
312
|
+
function Gn(e, t, n) {
|
|
313
|
+
const o = Ds(e, t, n);
|
|
314
314
|
if (o !== t)
|
|
315
315
|
return {
|
|
316
316
|
startRow: o,
|
|
@@ -318,7 +318,7 @@ function Kn(e, t, n) {
|
|
|
318
318
|
startColumn: n,
|
|
319
319
|
endColumn: n
|
|
320
320
|
};
|
|
321
|
-
const r =
|
|
321
|
+
const r = $s(e, t, n);
|
|
322
322
|
return r !== n ? {
|
|
323
323
|
startRow: t,
|
|
324
324
|
endRow: t,
|
|
@@ -326,7 +326,7 @@ function Kn(e, t, n) {
|
|
|
326
326
|
endColumn: n - 1
|
|
327
327
|
} : null;
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function Ds(e, t, n) {
|
|
330
330
|
let o = !1;
|
|
331
331
|
if (t === 0) return t;
|
|
332
332
|
for (let r = t - 1; r >= 0; r--) {
|
|
@@ -343,7 +343,7 @@ function ks(e, t, n) {
|
|
|
343
343
|
}
|
|
344
344
|
return t;
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function $s(e, t, n) {
|
|
347
347
|
let o = !1;
|
|
348
348
|
if (n === 0) return n;
|
|
349
349
|
for (let r = n - 1; r >= 0; r--) {
|
|
@@ -365,64 +365,64 @@ function _t(e) {
|
|
|
365
365
|
const t = e == null ? void 0 : e.p.body;
|
|
366
366
|
if (t == null)
|
|
367
367
|
return !1;
|
|
368
|
-
const n = t.dataStream, r = n.substring(n.length - 2, n.length) ===
|
|
369
|
-
return
|
|
368
|
+
const n = t.dataStream, r = n.substring(n.length - 2, n.length) === or ? n.substring(0, n.length - 2) : n;
|
|
369
|
+
return Qr(r);
|
|
370
370
|
}
|
|
371
|
-
return e && (e.t ===
|
|
371
|
+
return e && (e.t === wn.NUMBER || Jr(e) === wn.NUMBER);
|
|
372
372
|
}
|
|
373
|
-
function
|
|
373
|
+
function Ls(e) {
|
|
374
374
|
return e.startRow === e.endRow && e.startColumn === e.endColumn;
|
|
375
375
|
}
|
|
376
|
-
function
|
|
376
|
+
function Ps(e) {
|
|
377
377
|
return e.startRow !== e.endRow && e.startColumn !== e.endColumn;
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function Zn(e, t) {
|
|
380
380
|
for (let n = t.startRow; n <= t.endRow; n++)
|
|
381
381
|
for (let o = t.startColumn; o <= t.endColumn; o++)
|
|
382
382
|
if (_t(e.getValue(n, o)))
|
|
383
383
|
return !1;
|
|
384
384
|
return !0;
|
|
385
385
|
}
|
|
386
|
-
function
|
|
386
|
+
function Us(e, t, n, o) {
|
|
387
387
|
for (let r = n; r <= o; r++)
|
|
388
388
|
if (!e.getValue(t, r))
|
|
389
389
|
return r;
|
|
390
390
|
return o;
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function Vs(e, t, n, o) {
|
|
393
393
|
for (let r = n; r <= o; r++)
|
|
394
394
|
if (!e.getValue(r, t))
|
|
395
395
|
return r;
|
|
396
396
|
return o;
|
|
397
397
|
}
|
|
398
|
-
const
|
|
398
|
+
const br = "SHEET_FORMULA_UI_PLUGIN", yr = `${br}_MORE_FUNCTIONS_COMPONENT`, Rn = {
|
|
399
399
|
id: "formula-ui.operation.more-functions",
|
|
400
|
-
type:
|
|
401
|
-
handler: async (e) => (e.get(
|
|
400
|
+
type: Oe.OPERATION,
|
|
401
|
+
handler: async (e) => (e.get(vn).open({
|
|
402
402
|
header: { title: "formula.insert.tooltip" },
|
|
403
|
-
children: { label:
|
|
403
|
+
children: { label: yr }
|
|
404
404
|
}), !0)
|
|
405
|
-
},
|
|
405
|
+
}, Tr = {
|
|
406
406
|
id: "formula-ui.operation.change-ref-to-absolute",
|
|
407
|
-
type:
|
|
407
|
+
type: Oe.OPERATION,
|
|
408
408
|
handler: async (e) => !0
|
|
409
|
-
},
|
|
409
|
+
}, Ws = {
|
|
410
410
|
id: "formula-ui.operation.search-function",
|
|
411
|
-
type:
|
|
412
|
-
handler: async (e, t) => (e.get(
|
|
411
|
+
type: Oe.OPERATION,
|
|
412
|
+
handler: async (e, t) => (e.get(zt).search(t), !0)
|
|
413
413
|
};
|
|
414
|
-
var
|
|
415
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
414
|
+
var Hs = Object.getOwnPropertyDescriptor, Bs = (e, t, n, o) => {
|
|
415
|
+
for (var r = o > 1 ? void 0 : o ? Hs(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
416
416
|
(i = e[s]) && (r = i(r) || r);
|
|
417
417
|
return r;
|
|
418
|
-
},
|
|
419
|
-
let
|
|
418
|
+
}, kt = (e, t) => (n, o) => t(n, o, e);
|
|
419
|
+
let Pt = class extends Ke {
|
|
420
420
|
constructor(e, t, n, o) {
|
|
421
421
|
super(), this._sheetInterceptorService = e, this._univerInstanceService = t, this._formulaDataModel = n, this._lexerTreeBuilder = o, this._initialize();
|
|
422
422
|
}
|
|
423
423
|
_initialize() {
|
|
424
424
|
this.disposeWithMe(this._sheetInterceptorService.interceptCommand({
|
|
425
|
-
getMutations: (e) => e.id ===
|
|
425
|
+
getMutations: (e) => e.id === os.id ? this._reorderFormula(e.params) : {
|
|
426
426
|
redos: [],
|
|
427
427
|
undos: []
|
|
428
428
|
}
|
|
@@ -437,7 +437,7 @@ let $t = class extends ut {
|
|
|
437
437
|
};
|
|
438
438
|
const g = l.getCellMatrix(), m = new Fe(), h = new Fe();
|
|
439
439
|
let d = !1;
|
|
440
|
-
return
|
|
440
|
+
return eo.foreach(s, (u, a) => {
|
|
441
441
|
let v = u;
|
|
442
442
|
i.hasOwnProperty(u) && (v = i[u]);
|
|
443
443
|
const p = g.getValue(v, a);
|
|
@@ -447,20 +447,20 @@ let $t = class extends ut {
|
|
|
447
447
|
S,
|
|
448
448
|
0,
|
|
449
449
|
u - v
|
|
450
|
-
), _ =
|
|
450
|
+
), _ = dn.deepClone(p);
|
|
451
451
|
_.f = C, _.si = null, m.setValue(u, a, _);
|
|
452
452
|
} else
|
|
453
453
|
m.setValue(u, a, p);
|
|
454
454
|
h.setValue(u, a, g.getValue(u, a));
|
|
455
455
|
}), d ? (t.push({
|
|
456
|
-
id:
|
|
456
|
+
id: Dt.id,
|
|
457
457
|
params: {
|
|
458
458
|
unitId: o,
|
|
459
459
|
subUnitId: r,
|
|
460
460
|
cellValue: m.getMatrix()
|
|
461
461
|
}
|
|
462
462
|
}), n.push({
|
|
463
|
-
id:
|
|
463
|
+
id: Dt.id,
|
|
464
464
|
params: {
|
|
465
465
|
unitId: o,
|
|
466
466
|
subUnitId: r,
|
|
@@ -475,19 +475,19 @@ let $t = class extends ut {
|
|
|
475
475
|
};
|
|
476
476
|
}
|
|
477
477
|
};
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
],
|
|
484
|
-
const
|
|
485
|
-
var
|
|
486
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
478
|
+
Pt = Bs([
|
|
479
|
+
kt(0, q(Sn)),
|
|
480
|
+
kt(1, q(ne)),
|
|
481
|
+
kt(2, q(yt)),
|
|
482
|
+
kt(3, q(_e))
|
|
483
|
+
], Pt);
|
|
484
|
+
const Nr = "sheets-formula-ui.base.config", zn = {};
|
|
485
|
+
var qs = Object.getOwnPropertyDescriptor, js = (e, t, n, o) => {
|
|
486
|
+
for (var r = o > 1 ? void 0 : o ? qs(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
487
487
|
(i = e[s]) && (r = i(r) || r);
|
|
488
488
|
return r;
|
|
489
489
|
}, pt = (e, t) => (n, o) => t(n, o, e);
|
|
490
|
-
const
|
|
490
|
+
const en = "SHEET_FORMULA_ALERT", Ks = {
|
|
491
491
|
[ue.DIV_BY_ZERO]: "divByZero",
|
|
492
492
|
[ue.NAME]: "name",
|
|
493
493
|
[ue.VALUE]: "value",
|
|
@@ -501,7 +501,7 @@ const Jt = "SHEET_FORMULA_ALERT", Bs = {
|
|
|
501
501
|
[ue.CONNECT]: "connect",
|
|
502
502
|
[ue.NULL]: "null"
|
|
503
503
|
};
|
|
504
|
-
let
|
|
504
|
+
let cn = class extends Ke {
|
|
505
505
|
constructor(e, t, n, o, r, s) {
|
|
506
506
|
super(), this._context = e, this._hoverManagerService = t, this._cellAlertManagerService = n, this._localeService = o, this._formulaDataModel = r, this._zenZoneService = s, this._init();
|
|
507
507
|
}
|
|
@@ -509,31 +509,31 @@ let on = class extends ut {
|
|
|
509
509
|
this._initCellAlertPopup(), this._initZenService();
|
|
510
510
|
}
|
|
511
511
|
_initCellAlertPopup() {
|
|
512
|
-
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(
|
|
512
|
+
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(gn(100)).subscribe((e) => {
|
|
513
513
|
var t, n, o, r, s;
|
|
514
514
|
if (e) {
|
|
515
515
|
const c = this._context.unit.getActiveSheet();
|
|
516
516
|
if (!c) return this._hideAlert();
|
|
517
517
|
const l = c.getCell(e.location.row, e.location.col), g = (r = (o = (n = (t = this._formulaDataModel.getArrayFormulaCellData()) == null ? void 0 : t[e.location.unitId]) == null ? void 0 : n[e.location.subUnitId]) == null ? void 0 : o[e.location.row]) == null ? void 0 : r[e.location.col];
|
|
518
|
-
if (
|
|
519
|
-
const m =
|
|
518
|
+
if (to(l)) {
|
|
519
|
+
const m = dr(l, !!g);
|
|
520
520
|
if (!m) {
|
|
521
521
|
this._hideAlert();
|
|
522
522
|
return;
|
|
523
523
|
}
|
|
524
|
-
const h = this._cellAlertManagerService.currentAlert.get(
|
|
524
|
+
const h = this._cellAlertManagerService.currentAlert.get(en), d = (s = h == null ? void 0 : h.alert) == null ? void 0 : s.location;
|
|
525
525
|
if (d && d.row === e.location.row && d.col === e.location.col && d.subUnitId === e.location.subUnitId && d.unitId === e.location.unitId) {
|
|
526
526
|
this._hideAlert();
|
|
527
527
|
return;
|
|
528
528
|
}
|
|
529
529
|
this._cellAlertManagerService.showAlert({
|
|
530
|
-
type:
|
|
530
|
+
type: Co.ERROR,
|
|
531
531
|
title: this._localeService.t("formula.error.title"),
|
|
532
|
-
message: this._localeService.t(`formula.error.${
|
|
532
|
+
message: this._localeService.t(`formula.error.${Ks[m]}`),
|
|
533
533
|
location: e.location,
|
|
534
534
|
width: 200,
|
|
535
535
|
height: 74,
|
|
536
|
-
key:
|
|
536
|
+
key: en
|
|
537
537
|
});
|
|
538
538
|
return;
|
|
539
539
|
}
|
|
@@ -547,33 +547,33 @@ let on = class extends ut {
|
|
|
547
547
|
}));
|
|
548
548
|
}
|
|
549
549
|
_hideAlert() {
|
|
550
|
-
this._cellAlertManagerService.removeAlert(
|
|
550
|
+
this._cellAlertManagerService.removeAlert(en);
|
|
551
551
|
}
|
|
552
552
|
};
|
|
553
|
-
|
|
554
|
-
pt(1, q(
|
|
555
|
-
pt(2, q(
|
|
553
|
+
cn = js([
|
|
554
|
+
pt(1, q(So)),
|
|
555
|
+
pt(2, q(vo)),
|
|
556
556
|
pt(3, q(dt)),
|
|
557
|
-
pt(4, q(
|
|
558
|
-
pt(5,
|
|
559
|
-
],
|
|
560
|
-
var
|
|
561
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
557
|
+
pt(4, q(yt)),
|
|
558
|
+
pt(5, ps)
|
|
559
|
+
], cn);
|
|
560
|
+
var Ys = Object.getOwnPropertyDescriptor, Gs = (e, t, n, o) => {
|
|
561
|
+
for (var r = o > 1 ? void 0 : o ? Ys(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
562
562
|
(i = e[s]) && (r = i(r) || r);
|
|
563
563
|
return r;
|
|
564
|
-
},
|
|
565
|
-
let
|
|
564
|
+
}, Xn = (e, t) => (n, o) => t(n, o, e);
|
|
565
|
+
let Ut = class extends Ke {
|
|
566
566
|
constructor(e, t) {
|
|
567
567
|
super(), this._autoFillService = e, this._lexerTreeBuilder = t, this._registerAutoFill();
|
|
568
568
|
}
|
|
569
569
|
_registerAutoFill() {
|
|
570
570
|
const e = {
|
|
571
|
-
type:
|
|
571
|
+
type: Fn.FORMULA,
|
|
572
572
|
priority: 1001,
|
|
573
|
-
match: (t) => Ae(t == null ? void 0 : t.f) ||
|
|
574
|
-
isContinue: (t, n) => t.type ===
|
|
573
|
+
match: (t) => Ae(t == null ? void 0 : t.f) || lt(t == null ? void 0 : t.si),
|
|
574
|
+
isContinue: (t, n) => t.type === Fn.FORMULA,
|
|
575
575
|
applyFunctions: {
|
|
576
|
-
[
|
|
576
|
+
[Ro.COPY]: (t, n, o, r, s) => {
|
|
577
577
|
const { data: i, index: c } = t;
|
|
578
578
|
return this._fillCopyFormula(i, n, o, c, r, s);
|
|
579
579
|
}
|
|
@@ -583,20 +583,20 @@ let Pt = class extends ut {
|
|
|
583
583
|
}
|
|
584
584
|
_fillCopyFormula(e, t, n, o, r, s) {
|
|
585
585
|
var g, m;
|
|
586
|
-
const i =
|
|
586
|
+
const i = zs(r), c = [], l = /* @__PURE__ */ new Map();
|
|
587
587
|
for (let h = 1; h <= t; h++) {
|
|
588
|
-
const d = (h - 1) % e.length, u = o[d], a =
|
|
588
|
+
const d = (h - 1) % e.length, u = o[d], a = dn.deepClone(e[d]);
|
|
589
589
|
if (a) {
|
|
590
590
|
const v = ((g = e[d]) == null ? void 0 : g.f) || "", p = ((m = e[d]) == null ? void 0 : m.si) || "", S = Ae(v);
|
|
591
|
-
if (
|
|
591
|
+
if (lt(p))
|
|
592
592
|
a.si = p, a.f = null, a.v = null, a.p = null, a.t = null, c.push(a);
|
|
593
593
|
else if (S) {
|
|
594
594
|
let _ = l.get(d);
|
|
595
595
|
if (_)
|
|
596
596
|
a.si = _, a.f = null, a.v = null, a.p = null, a.t = null;
|
|
597
597
|
else {
|
|
598
|
-
_ =
|
|
599
|
-
const { offsetX: E, offsetY: f } =
|
|
598
|
+
_ = Kt(6), l.set(d, _);
|
|
599
|
+
const { offsetX: E, offsetY: f } = Zs(i, t, n, s, u), b = this._lexerTreeBuilder.moveFormulaRefOffset(
|
|
600
600
|
v,
|
|
601
601
|
E,
|
|
602
602
|
f
|
|
@@ -610,11 +610,11 @@ let Pt = class extends ut {
|
|
|
610
610
|
return c;
|
|
611
611
|
}
|
|
612
612
|
};
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
],
|
|
617
|
-
function
|
|
613
|
+
Ut = Gs([
|
|
614
|
+
Xn(0, _o),
|
|
615
|
+
Xn(1, q(_e))
|
|
616
|
+
], Ut);
|
|
617
|
+
function Zs(e, t, n, o, r) {
|
|
618
618
|
const { source: s, target: i } = o, { rows: c } = i, { rows: l } = s;
|
|
619
619
|
let g = 0, m = 0;
|
|
620
620
|
switch (n) {
|
|
@@ -633,7 +633,7 @@ function Ks(e, t, n, o, r) {
|
|
|
633
633
|
}
|
|
634
634
|
return { offsetX: g, offsetY: m };
|
|
635
635
|
}
|
|
636
|
-
function
|
|
636
|
+
function zs(e) {
|
|
637
637
|
let t = 0;
|
|
638
638
|
for (const n in e)
|
|
639
639
|
e[n].forEach((o) => {
|
|
@@ -641,13 +641,13 @@ function Ys(e) {
|
|
|
641
641
|
});
|
|
642
642
|
return t;
|
|
643
643
|
}
|
|
644
|
-
var
|
|
645
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
644
|
+
var Xs = Object.getOwnPropertyDescriptor, Qs = (e, t, n, o) => {
|
|
645
|
+
for (var r = o > 1 ? void 0 : o ? Xs(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
646
646
|
(i = e[s]) && (r = i(r) || r);
|
|
647
647
|
return r;
|
|
648
648
|
}, St = (e, t) => (n, o) => t(n, o, e);
|
|
649
|
-
const
|
|
650
|
-
let
|
|
649
|
+
const Js = "default-paste-formula";
|
|
650
|
+
let Vt = class extends Ke {
|
|
651
651
|
constructor(e, t, n, o, r) {
|
|
652
652
|
super(), this._currentUniverSheet = e, this._lexerTreeBuilder = t, this._sheetClipboardService = n, this._injector = o, this._formulaDataModel = r, this._initialize();
|
|
653
653
|
}
|
|
@@ -659,7 +659,7 @@ let Ut = class extends ut {
|
|
|
659
659
|
}
|
|
660
660
|
_pasteFormulaHook() {
|
|
661
661
|
return {
|
|
662
|
-
id:
|
|
662
|
+
id: ct.SPECIAL_PASTE_FORMULA,
|
|
663
663
|
priority: 10,
|
|
664
664
|
specialPasteInfo: { label: "specialPaste.formula" },
|
|
665
665
|
onPasteCells: (e, t, n, o) => this._onPasteCells(e, t, n, o, !0)
|
|
@@ -667,7 +667,7 @@ let Ut = class extends ut {
|
|
|
667
667
|
}
|
|
668
668
|
_pasteWithFormulaHook() {
|
|
669
669
|
return {
|
|
670
|
-
id:
|
|
670
|
+
id: Js,
|
|
671
671
|
priority: 10,
|
|
672
672
|
onPasteCells: (e, t, n, o) => this._onPasteCells(e, t, n, o, !1)
|
|
673
673
|
};
|
|
@@ -675,25 +675,25 @@ let Ut = class extends ut {
|
|
|
675
675
|
_onPasteCells(e, t, n, o, r) {
|
|
676
676
|
var d;
|
|
677
677
|
if ([
|
|
678
|
-
|
|
679
|
-
|
|
678
|
+
ct.SPECIAL_PASTE_FORMAT,
|
|
679
|
+
ct.SPECIAL_PASTE_COL_WIDTH
|
|
680
680
|
].includes(o.pasteType))
|
|
681
681
|
return {
|
|
682
682
|
undos: [],
|
|
683
683
|
redos: []
|
|
684
684
|
};
|
|
685
|
-
const i = this._currentUniverSheet.getCurrentUnitForType(
|
|
685
|
+
const i = this._currentUniverSheet.getCurrentUnitForType(W.UNIVER_SHEET), c = t.unitId || i.getUnitId(), l = t.subUnitId || ((d = i.getActiveSheet()) == null ? void 0 : d.getSheetId());
|
|
686
686
|
if (!c || !l)
|
|
687
687
|
return {
|
|
688
688
|
undos: [],
|
|
689
689
|
redos: []
|
|
690
690
|
};
|
|
691
691
|
const g = t.range, m = n, h = {
|
|
692
|
-
copyType: o.copyType ||
|
|
692
|
+
copyType: o.copyType || ar.COPY,
|
|
693
693
|
copyRange: e == null ? void 0 : e.range,
|
|
694
694
|
pasteType: o.pasteType
|
|
695
695
|
};
|
|
696
|
-
return this._injector.invoke((u) =>
|
|
696
|
+
return this._injector.invoke((u) => ei(
|
|
697
697
|
c,
|
|
698
698
|
l,
|
|
699
699
|
g,
|
|
@@ -707,15 +707,15 @@ let Ut = class extends ut {
|
|
|
707
707
|
));
|
|
708
708
|
}
|
|
709
709
|
};
|
|
710
|
-
|
|
710
|
+
Vt = Qs([
|
|
711
711
|
St(0, ne),
|
|
712
712
|
St(1, q(_e)),
|
|
713
|
-
St(2,
|
|
713
|
+
St(2, Io),
|
|
714
714
|
St(3, q(Rt)),
|
|
715
|
-
St(4, q(
|
|
716
|
-
],
|
|
717
|
-
function
|
|
718
|
-
const m = [], h = [], d =
|
|
715
|
+
St(4, q(yt))
|
|
716
|
+
], Vt);
|
|
717
|
+
function ei(e, t, n, o, r, s, i, c, l = !1, g) {
|
|
718
|
+
const m = [], h = [], d = ti(e, t, n, o, s, i, c, g);
|
|
719
719
|
if (!d.hasValue())
|
|
720
720
|
return {
|
|
721
721
|
undos: [],
|
|
@@ -727,25 +727,25 @@ function Xs(e, t, n, o, r, s, i, c, l = !1, g) {
|
|
|
727
727
|
cellValue: d.getData()
|
|
728
728
|
};
|
|
729
729
|
m.push({
|
|
730
|
-
id:
|
|
730
|
+
id: Dt.id,
|
|
731
731
|
params: u
|
|
732
732
|
});
|
|
733
|
-
const a =
|
|
733
|
+
const a = ss(
|
|
734
734
|
r,
|
|
735
735
|
u
|
|
736
736
|
);
|
|
737
737
|
return h.push({
|
|
738
|
-
id:
|
|
738
|
+
id: Dt.id,
|
|
739
739
|
params: a
|
|
740
740
|
}), {
|
|
741
741
|
undos: h,
|
|
742
742
|
redos: m
|
|
743
743
|
};
|
|
744
744
|
}
|
|
745
|
-
function
|
|
746
|
-
return c ? r.pasteType ===
|
|
745
|
+
function ti(e, t, n, o, r, s, i, c) {
|
|
746
|
+
return c ? r.pasteType === ct.SPECIAL_PASTE_VALUE ? ri(e, t, n, o, i, c) : r.pasteType === ct.SPECIAL_PASTE_FORMULA ? oi(e, t, n, o, s, i, c) : si(e, t, n, o, r.copyType, s, i, c) : ni(e, t, n, o, i);
|
|
747
747
|
}
|
|
748
|
-
function
|
|
748
|
+
function ni(e, t, n, o, r) {
|
|
749
749
|
const s = new Fe(), i = r.getSheetFormulaData(e, t);
|
|
750
750
|
return o.forValue((c, l, g) => {
|
|
751
751
|
var u;
|
|
@@ -753,31 +753,31 @@ function Js(e, t, n, o, r) {
|
|
|
753
753
|
Ae(g.v) ? (d.v = null, d.f = `${g.v}`, d.si = null, d.p = null, s.setValue(m, h, d)) : (u = i == null ? void 0 : i[m]) != null && u[h] && (d.v = g.v, d.f = null, d.si = null, d.p = null, s.setValue(m, h, d));
|
|
754
754
|
}), s;
|
|
755
755
|
}
|
|
756
|
-
function
|
|
756
|
+
function ri(e, t, n, o, r, s) {
|
|
757
757
|
var g, m;
|
|
758
758
|
const i = new Fe(), c = (m = (g = r.getArrayFormulaCellData()) == null ? void 0 : g[s.unitId]) == null ? void 0 : m[s.subUnitId], l = r.getSheetFormulaData(e, t);
|
|
759
759
|
return o.forValue((h, d, u) => {
|
|
760
760
|
var _, E;
|
|
761
761
|
const a = s.range.rows[h % s.range.rows.length], v = s.range.cols[d % s.range.cols.length], p = n.rows[h], S = n.cols[d], C = {};
|
|
762
|
-
if (Ae(u.f) ||
|
|
762
|
+
if (Ae(u.f) || lt(u.si))
|
|
763
763
|
C.v = u.v, C.f = null, C.si = null, C.p = null, i.setValue(p, S, C);
|
|
764
764
|
else if ((_ = c == null ? void 0 : c[a]) != null && _[v]) {
|
|
765
765
|
const f = c[a][v];
|
|
766
766
|
C.v = f.v, C.f = null, C.si = null, C.p = null, i.setValue(p, S, C);
|
|
767
767
|
} else if ((E = l == null ? void 0 : l[p]) != null && E[S]) {
|
|
768
768
|
if (C.v = u.v, C.f = null, C.si = null, C.p = null, u.p) {
|
|
769
|
-
const f =
|
|
769
|
+
const f = Or(u);
|
|
770
770
|
f && (C.v = f);
|
|
771
771
|
}
|
|
772
772
|
i.setValue(p, S, C);
|
|
773
773
|
}
|
|
774
774
|
}), i;
|
|
775
775
|
}
|
|
776
|
-
function
|
|
776
|
+
function oi(e, t, n, o, r, s, i) {
|
|
777
777
|
const c = new Fe(), l = /* @__PURE__ */ new Map();
|
|
778
778
|
return o.forValue((g, m, h) => {
|
|
779
779
|
const d = n.rows[g], u = n.cols[m], a = {};
|
|
780
|
-
if (
|
|
780
|
+
if (lt(h.si)) {
|
|
781
781
|
if (i.unitId !== e || i.subUnitId !== t) {
|
|
782
782
|
const v = s.getFormulaStringByCell(
|
|
783
783
|
i.range.rows[g % i.range.rows.length],
|
|
@@ -795,25 +795,25 @@ function ti(e, t, n, o, r, s, i) {
|
|
|
795
795
|
if (p)
|
|
796
796
|
a.si = p, a.f = null;
|
|
797
797
|
else {
|
|
798
|
-
p =
|
|
798
|
+
p = Kt(6), l.set(v, p);
|
|
799
799
|
const S = n.cols[m] - i.range.cols[m % i.range.cols.length], C = n.rows[g] - i.range.rows[g % i.range.rows.length], _ = r.moveFormulaRefOffset(h.f || "", S, C);
|
|
800
800
|
a.si = p, a.f = _;
|
|
801
801
|
}
|
|
802
802
|
a.v = null, a.p = null, c.setValue(d, u, a);
|
|
803
803
|
} else {
|
|
804
804
|
if (a.v = h.v, a.f = null, a.si = null, a.p = null, h.p) {
|
|
805
|
-
const v =
|
|
805
|
+
const v = Or(h);
|
|
806
806
|
v && (a.v = v);
|
|
807
807
|
}
|
|
808
808
|
c.setValue(d, u, a);
|
|
809
809
|
}
|
|
810
810
|
}), c;
|
|
811
811
|
}
|
|
812
|
-
function
|
|
812
|
+
function si(e, t, n, o, r, s, i, c) {
|
|
813
813
|
const l = new Fe(), g = /* @__PURE__ */ new Map(), m = i.getSheetFormulaData(e, t), h = [];
|
|
814
|
-
return r ===
|
|
814
|
+
return r === ar.CUT ? o.forValue((d, u, a) => {
|
|
815
815
|
const v = n.rows[d], p = n.cols[u], S = {};
|
|
816
|
-
if (
|
|
816
|
+
if (lt(a.si)) {
|
|
817
817
|
if (Ae(a.f))
|
|
818
818
|
h.push(a.si), S.f = a.f, S.si = a.si;
|
|
819
819
|
else if (h.includes(a.si))
|
|
@@ -832,7 +832,7 @@ function ni(e, t, n, o, r, s, i, c) {
|
|
|
832
832
|
}) : o.forValue((d, u, a) => {
|
|
833
833
|
var C;
|
|
834
834
|
const v = n.rows[d], p = n.cols[u], S = {};
|
|
835
|
-
if (
|
|
835
|
+
if (lt(a.si)) {
|
|
836
836
|
if (c.unitId !== e || c.subUnitId !== t) {
|
|
837
837
|
const _ = i.getFormulaStringByCell(
|
|
838
838
|
c.range.rows[d % c.range.rows.length],
|
|
@@ -850,7 +850,7 @@ function ni(e, t, n, o, r, s, i, c) {
|
|
|
850
850
|
if (E)
|
|
851
851
|
S.si = E, S.f = null;
|
|
852
852
|
else {
|
|
853
|
-
E =
|
|
853
|
+
E = Kt(6), g.set(_, E);
|
|
854
854
|
const f = n.cols[u] - c.range.cols[u % c.range.cols.length], b = n.rows[d] - c.range.rows[d % c.range.rows.length], y = s.moveFormulaRefOffset(a.f || "", f, b);
|
|
855
855
|
S.si = E, S.f = y;
|
|
856
856
|
}
|
|
@@ -873,21 +873,21 @@ function ni(e, t, n, o, r, s, i, c) {
|
|
|
873
873
|
}
|
|
874
874
|
}), l;
|
|
875
875
|
}
|
|
876
|
-
function
|
|
876
|
+
function Or(e) {
|
|
877
877
|
if (e != null && e.p) {
|
|
878
878
|
const t = e == null ? void 0 : e.p.body;
|
|
879
879
|
if (t == null)
|
|
880
880
|
return;
|
|
881
881
|
const n = t.dataStream;
|
|
882
|
-
return n.substring(n.length - 2, n.length) ===
|
|
882
|
+
return n.substring(n.length - 2, n.length) === or ? n.substring(0, n.length - 2) : n;
|
|
883
883
|
}
|
|
884
884
|
}
|
|
885
|
-
var
|
|
886
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
885
|
+
var ii = Object.getOwnPropertyDescriptor, ci = (e, t, n, o) => {
|
|
886
|
+
for (var r = o > 1 ? void 0 : o ? ii(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
887
887
|
(i = e[s]) && (r = i(r) || r);
|
|
888
888
|
return r;
|
|
889
889
|
}, He = (e, t) => (n, o) => t(n, o, e);
|
|
890
|
-
let
|
|
890
|
+
let Wt = class extends Ke {
|
|
891
891
|
constructor(t, n, o, r, s, i, c, l) {
|
|
892
892
|
super();
|
|
893
893
|
j(this, "_previousShape");
|
|
@@ -917,8 +917,8 @@ let Vt = class extends ut {
|
|
|
917
917
|
}
|
|
918
918
|
_initInterceptorEditorStart() {
|
|
919
919
|
this.disposeWithMe(
|
|
920
|
-
|
|
921
|
-
this._sheetInterceptorService.writeCellInterceptor.intercept(
|
|
920
|
+
sr(
|
|
921
|
+
this._sheetInterceptorService.writeCellInterceptor.intercept(is, {
|
|
922
922
|
handler: (t, n, o) => {
|
|
923
923
|
var a, v, p, S;
|
|
924
924
|
const { row: r, col: s, unitId: i, subUnitId: c, worksheet: l } = n, g = this._formulaDataModel.getArrayFormulaRange(), m = this._formulaDataModel.getArrayFormulaCellData();
|
|
@@ -937,10 +937,10 @@ let Vt = class extends ut {
|
|
|
937
937
|
}
|
|
938
938
|
_commandExecutedListener() {
|
|
939
939
|
this.disposeWithMe(this._commandService.onCommandExecuted((t, n) => {
|
|
940
|
-
(t.id ===
|
|
940
|
+
(t.id === Do.id || t.id === $o.id && n && n.remove) && this._removeArrayFormulaRangeShape();
|
|
941
941
|
})), this.disposeWithMe(
|
|
942
942
|
this._commandService.beforeCommandExecuted((t) => {
|
|
943
|
-
|
|
943
|
+
cs.id === t.id && requestIdleCallback(() => {
|
|
944
944
|
const n = t.params, { unitId: o, subUnitId: r, rowsAutoHeightInfo: s } = n;
|
|
945
945
|
this._refreshArrayFormulaRangeShapeByRow(o, r, s);
|
|
946
946
|
});
|
|
@@ -979,10 +979,10 @@ let Vt = class extends ut {
|
|
|
979
979
|
style: {
|
|
980
980
|
strokeWidth: 1,
|
|
981
981
|
stroke: this._themeService.getColorFromTheme("primary.600"),
|
|
982
|
-
fill: new
|
|
982
|
+
fill: new hn(this._themeService.getColorFromTheme("white")).setAlpha(0).toString(),
|
|
983
983
|
widgets: {}
|
|
984
984
|
}
|
|
985
|
-
}, c =
|
|
985
|
+
}, c = rn(i, r), { rowHeaderWidth: l, columnHeaderHeight: g } = r, m = new lr(s, Eo.FORMULA_EDITOR_SHOW, this._themeService, {
|
|
986
986
|
highlightHeader: !1,
|
|
987
987
|
rowHeaderWidth: l,
|
|
988
988
|
columnHeaderHeight: g
|
|
@@ -1025,38 +1025,38 @@ let Vt = class extends ut {
|
|
|
1025
1025
|
}
|
|
1026
1026
|
}
|
|
1027
1027
|
};
|
|
1028
|
-
|
|
1029
|
-
He(1, q(
|
|
1030
|
-
He(2, q(
|
|
1028
|
+
Wt = ci([
|
|
1029
|
+
He(1, q(Sn)),
|
|
1030
|
+
He(2, q(yt)),
|
|
1031
1031
|
He(3, q(It)),
|
|
1032
|
-
He(4,
|
|
1033
|
-
He(5, q(
|
|
1032
|
+
He(4, Re),
|
|
1033
|
+
He(5, q(Et)),
|
|
1034
1034
|
He(6, me),
|
|
1035
|
-
He(7,
|
|
1036
|
-
],
|
|
1037
|
-
var
|
|
1038
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
1035
|
+
He(7, no)
|
|
1036
|
+
], Wt);
|
|
1037
|
+
var ai = Object.getOwnPropertyDescriptor, li = (e, t, n, o) => {
|
|
1038
|
+
for (var r = o > 1 ? void 0 : o ? ai(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
1039
1039
|
(i = e[s]) && (r = i(r) || r);
|
|
1040
1040
|
return r;
|
|
1041
|
-
},
|
|
1042
|
-
const
|
|
1041
|
+
}, Qn = (e, t) => (n, o) => t(n, o, e);
|
|
1042
|
+
const ui = {
|
|
1043
1043
|
tl: {
|
|
1044
1044
|
size: 6,
|
|
1045
1045
|
color: "#409f11"
|
|
1046
1046
|
}
|
|
1047
1047
|
};
|
|
1048
|
-
let
|
|
1048
|
+
let Ht = class extends ro {
|
|
1049
1049
|
constructor(e, t) {
|
|
1050
1050
|
super(), this._sheetInterceptorService = e, this._formulaDataModel = t, this.disposeWithMe(this._sheetInterceptorService.intercept(
|
|
1051
|
-
|
|
1051
|
+
as.CELL_CONTENT,
|
|
1052
1052
|
{
|
|
1053
|
-
effect:
|
|
1053
|
+
effect: oo.Style,
|
|
1054
1054
|
handler: (n, o, r) => {
|
|
1055
1055
|
var c, l, g, m;
|
|
1056
1056
|
const s = (m = (g = (l = (c = this._formulaDataModel.getArrayFormulaCellData()) == null ? void 0 : c[o.unitId]) == null ? void 0 : l[o.subUnitId]) == null ? void 0 : g[o.row]) == null ? void 0 : m[o.col];
|
|
1057
|
-
return !
|
|
1057
|
+
return !dr(n, !!s) || !n || (n === o.rawData && (n = { ...o.rawData }), n.markers = {
|
|
1058
1058
|
...n == null ? void 0 : n.markers,
|
|
1059
|
-
...
|
|
1059
|
+
...ui
|
|
1060
1060
|
}), r(n);
|
|
1061
1061
|
},
|
|
1062
1062
|
priority: 10
|
|
@@ -1064,25 +1064,25 @@ let Wt = class extends to {
|
|
|
1064
1064
|
));
|
|
1065
1065
|
}
|
|
1066
1066
|
};
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
],
|
|
1071
|
-
function
|
|
1072
|
-
const e = T(
|
|
1073
|
-
t.executeCommand(
|
|
1074
|
-
}, [t]), r =
|
|
1067
|
+
Ht = li([
|
|
1068
|
+
Qn(0, q(Sn)),
|
|
1069
|
+
Qn(1, q(yt))
|
|
1070
|
+
], Ht);
|
|
1071
|
+
function di() {
|
|
1072
|
+
const e = T(hs), t = T(me), n = Se(e.progress$), o = $t(() => {
|
|
1073
|
+
t.executeCommand(Lo.id);
|
|
1074
|
+
}, [t]), r = $t(() => {
|
|
1075
1075
|
e.clearProgress();
|
|
1076
1076
|
}, [e]);
|
|
1077
|
-
return /* @__PURE__ */ M(
|
|
1077
|
+
return /* @__PURE__ */ M(Ss, { progress: n, onTerminate: o, onClearProgress: r });
|
|
1078
1078
|
}
|
|
1079
|
-
function
|
|
1079
|
+
function hi(e, t) {
|
|
1080
1080
|
return Object.keys(e).filter((n) => isNaN(Number(n)) && n !== "DefinedName").map((n) => ({
|
|
1081
1081
|
label: t.t(`formula.functionType.${n.toLocaleLowerCase()}`),
|
|
1082
1082
|
value: `${e[n]}`
|
|
1083
1083
|
}));
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1085
|
+
function xr(e) {
|
|
1086
1086
|
if (!e.require && !e.repeat)
|
|
1087
1087
|
return `[${e.name}]`;
|
|
1088
1088
|
if (e.require && !e.repeat)
|
|
@@ -1092,15 +1092,15 @@ function Nr(e) {
|
|
|
1092
1092
|
if (e.require && e.repeat)
|
|
1093
1093
|
return `${e.name},...`;
|
|
1094
1094
|
}
|
|
1095
|
-
function
|
|
1095
|
+
function Mr(e) {
|
|
1096
1096
|
const { prefix: t, value: n } = e;
|
|
1097
|
-
return /* @__PURE__ */
|
|
1098
|
-
/* @__PURE__ */
|
|
1097
|
+
return /* @__PURE__ */ H("div", { children: [
|
|
1098
|
+
/* @__PURE__ */ H("span", { children: [
|
|
1099
1099
|
t,
|
|
1100
1100
|
"("
|
|
1101
1101
|
] }),
|
|
1102
|
-
n && n.map((o, r) => /* @__PURE__ */
|
|
1103
|
-
/* @__PURE__ */ M("span", { children:
|
|
1102
|
+
n && n.map((o, r) => /* @__PURE__ */ H("span", { children: [
|
|
1103
|
+
/* @__PURE__ */ M("span", { children: xr(o) }),
|
|
1104
1104
|
r === n.length - 1 ? "" : ","
|
|
1105
1105
|
] }, r)),
|
|
1106
1106
|
")"
|
|
@@ -1108,7 +1108,7 @@ function Or(e) {
|
|
|
1108
1108
|
}
|
|
1109
1109
|
function vt(e) {
|
|
1110
1110
|
const { className: t, value: n, title: o } = e;
|
|
1111
|
-
return /* @__PURE__ */
|
|
1111
|
+
return /* @__PURE__ */ H("div", { className: "univer-mb-2 univer-text-xs", children: [
|
|
1112
1112
|
/* @__PURE__ */ M(
|
|
1113
1113
|
"div",
|
|
1114
1114
|
{
|
|
@@ -1125,27 +1125,27 @@ function vt(e) {
|
|
|
1125
1125
|
)
|
|
1126
1126
|
] });
|
|
1127
1127
|
}
|
|
1128
|
-
function
|
|
1128
|
+
function fi(e) {
|
|
1129
1129
|
const { functionInfo: t, onChange: n } = e;
|
|
1130
1130
|
if (!t) return null;
|
|
1131
1131
|
const [o, r] = V([]), [s, i] = V(t.functionParameter), [c, l] = V(-1);
|
|
1132
|
-
return /* @__PURE__ */
|
|
1133
|
-
/* @__PURE__ */ M("div", { className: re("univer-h-[364px] univer-overflow-y-auto",
|
|
1132
|
+
return /* @__PURE__ */ H("div", { children: [
|
|
1133
|
+
/* @__PURE__ */ M("div", { className: re("univer-h-[364px] univer-overflow-y-auto", ut), children: s.map((g, m) => /* @__PURE__ */ H("div", { children: [
|
|
1134
1134
|
/* @__PURE__ */ M("div", { className: "univer-text-sm", children: g.name }),
|
|
1135
1135
|
/* @__PURE__ */ M("div", { className: "univer-mb-2 univer-mt-1" })
|
|
1136
1136
|
] }, m)) }),
|
|
1137
|
-
/* @__PURE__ */ M("div", { className: re("univer-flex-1 univer-p-3",
|
|
1137
|
+
/* @__PURE__ */ M("div", { className: re("univer-flex-1 univer-p-3", bs), children: /* @__PURE__ */ M(
|
|
1138
1138
|
vt,
|
|
1139
1139
|
{
|
|
1140
|
-
title: c === -1 ? /* @__PURE__ */ M(
|
|
1140
|
+
title: c === -1 ? /* @__PURE__ */ M(Mr, { prefix: t.functionName, value: s }) : s[c].name,
|
|
1141
1141
|
value: c === -1 ? t.description : s[c].detail
|
|
1142
1142
|
}
|
|
1143
1143
|
) })
|
|
1144
1144
|
] });
|
|
1145
1145
|
}
|
|
1146
|
-
function
|
|
1147
|
-
const { icon: n, id: o, className: r, extend: s, ...i } = t, c = `univerjs-icon univerjs-icon-${o} ${r || ""}`.trim(), l = z(`_${
|
|
1148
|
-
return
|
|
1146
|
+
function tt({ ref: e, ...t }) {
|
|
1147
|
+
const { icon: n, id: o, className: r, extend: s, ...i } = t, c = `univerjs-icon univerjs-icon-${o} ${r || ""}`.trim(), l = z(`_${pi()}`);
|
|
1148
|
+
return wr(n, `${o}`, {
|
|
1149
1149
|
defIds: n.defIds,
|
|
1150
1150
|
idSuffix: l.current
|
|
1151
1151
|
}, {
|
|
@@ -1154,14 +1154,14 @@ function et({ ref: e, ...t }) {
|
|
|
1154
1154
|
...i
|
|
1155
1155
|
}, s);
|
|
1156
1156
|
}
|
|
1157
|
-
function
|
|
1158
|
-
return
|
|
1157
|
+
function wr(e, t, n, o, r) {
|
|
1158
|
+
return et(e.tag, {
|
|
1159
1159
|
key: t,
|
|
1160
|
-
...
|
|
1160
|
+
...gi(e, n, r),
|
|
1161
1161
|
...o
|
|
1162
|
-
}, (
|
|
1162
|
+
}, (mi(e, n).children || []).map((s, i) => wr(s, `${t}-${e.tag}-${i}`, n, void 0, r)));
|
|
1163
1163
|
}
|
|
1164
|
-
function
|
|
1164
|
+
function gi(e, t, n) {
|
|
1165
1165
|
const o = { ...e.attrs };
|
|
1166
1166
|
n != null && n.colorChannel1 && o.fill === "colorChannel1" && (o.fill = n.colorChannel1), e.tag === "mask" && o.id && (o.id = o.id + t.idSuffix), Object.entries(o).forEach(([s, i]) => {
|
|
1167
1167
|
s === "mask" && typeof i == "string" && (o[s] = i.replace(/url\(#(.*)\)/, `url(#$1${t.idSuffix})`));
|
|
@@ -1171,7 +1171,7 @@ function di(e, t, n) {
|
|
|
1171
1171
|
typeof i == "string" && (o[s] = i.replace(/url\(#(.*)\)/, `url(#$1${t.idSuffix})`));
|
|
1172
1172
|
})), o;
|
|
1173
1173
|
}
|
|
1174
|
-
function
|
|
1174
|
+
function mi(e, t) {
|
|
1175
1175
|
var o;
|
|
1176
1176
|
const { defIds: n } = t;
|
|
1177
1177
|
return !n || n.length === 0 ? e : e.tag === "defs" && ((o = e.children) != null && o.length) ? {
|
|
@@ -1185,11 +1185,11 @@ function hi(e, t) {
|
|
|
1185
1185
|
} : r)
|
|
1186
1186
|
} : e;
|
|
1187
1187
|
}
|
|
1188
|
-
function
|
|
1188
|
+
function pi() {
|
|
1189
1189
|
return Math.random().toString(36).substring(2, 8);
|
|
1190
1190
|
}
|
|
1191
|
-
|
|
1192
|
-
const
|
|
1191
|
+
tt.displayName = "UniverIcon";
|
|
1192
|
+
const Si = {
|
|
1193
1193
|
tag: "svg",
|
|
1194
1194
|
attrs: {
|
|
1195
1195
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1207,15 +1207,15 @@ const gi = {
|
|
|
1207
1207
|
clipRule: "evenodd"
|
|
1208
1208
|
}
|
|
1209
1209
|
}]
|
|
1210
|
-
},
|
|
1211
|
-
return
|
|
1210
|
+
}, kr = $e(function(t, n) {
|
|
1211
|
+
return et(tt, Object.assign({}, t, {
|
|
1212
1212
|
id: "check-mark-icon",
|
|
1213
1213
|
ref: n,
|
|
1214
|
-
icon:
|
|
1214
|
+
icon: Si
|
|
1215
1215
|
}));
|
|
1216
1216
|
});
|
|
1217
|
-
|
|
1218
|
-
const
|
|
1217
|
+
kr.displayName = "CheckMarkIcon";
|
|
1218
|
+
const vi = {
|
|
1219
1219
|
tag: "svg",
|
|
1220
1220
|
attrs: {
|
|
1221
1221
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1231,15 +1231,15 @@ const mi = {
|
|
|
1231
1231
|
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"
|
|
1232
1232
|
}
|
|
1233
1233
|
}]
|
|
1234
|
-
},
|
|
1235
|
-
return
|
|
1234
|
+
}, Ar = $e(function(t, n) {
|
|
1235
|
+
return et(tt, Object.assign({}, t, {
|
|
1236
1236
|
id: "close-icon",
|
|
1237
1237
|
ref: n,
|
|
1238
|
-
icon:
|
|
1238
|
+
icon: vi
|
|
1239
1239
|
}));
|
|
1240
1240
|
});
|
|
1241
|
-
|
|
1242
|
-
const
|
|
1241
|
+
Ar.displayName = "CloseIcon";
|
|
1242
|
+
const Ci = {
|
|
1243
1243
|
tag: "svg",
|
|
1244
1244
|
attrs: {
|
|
1245
1245
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1280,15 +1280,15 @@ const pi = {
|
|
|
1280
1280
|
}
|
|
1281
1281
|
}
|
|
1282
1282
|
]
|
|
1283
|
-
},
|
|
1284
|
-
return
|
|
1283
|
+
}, Fr = $e(function(t, n) {
|
|
1284
|
+
return et(tt, Object.assign({}, t, {
|
|
1285
1285
|
id: "delete-icon",
|
|
1286
1286
|
ref: n,
|
|
1287
|
-
icon:
|
|
1287
|
+
icon: Ci
|
|
1288
1288
|
}));
|
|
1289
1289
|
});
|
|
1290
|
-
|
|
1291
|
-
const
|
|
1290
|
+
Fr.displayName = "DeleteIcon";
|
|
1291
|
+
const _i = {
|
|
1292
1292
|
tag: "svg",
|
|
1293
1293
|
attrs: {
|
|
1294
1294
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1304,15 +1304,15 @@ const Si = {
|
|
|
1304
1304
|
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"
|
|
1305
1305
|
}
|
|
1306
1306
|
}]
|
|
1307
|
-
},
|
|
1308
|
-
return
|
|
1307
|
+
}, Dr = $e(function(t, n) {
|
|
1308
|
+
return et(tt, Object.assign({}, t, {
|
|
1309
1309
|
id: "increase-icon",
|
|
1310
1310
|
ref: n,
|
|
1311
|
-
icon:
|
|
1311
|
+
icon: _i
|
|
1312
1312
|
}));
|
|
1313
1313
|
});
|
|
1314
|
-
|
|
1315
|
-
const
|
|
1314
|
+
Dr.displayName = "IncreaseIcon";
|
|
1315
|
+
const Ri = {
|
|
1316
1316
|
tag: "svg",
|
|
1317
1317
|
attrs: {
|
|
1318
1318
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1330,15 +1330,15 @@ const vi = {
|
|
|
1330
1330
|
clipRule: "evenodd"
|
|
1331
1331
|
}
|
|
1332
1332
|
}]
|
|
1333
|
-
},
|
|
1334
|
-
return
|
|
1333
|
+
}, $r = $e(function(t, n) {
|
|
1334
|
+
return et(tt, Object.assign({}, t, {
|
|
1335
1335
|
id: "more-icon",
|
|
1336
1336
|
ref: n,
|
|
1337
|
-
icon:
|
|
1337
|
+
icon: Ri
|
|
1338
1338
|
}));
|
|
1339
1339
|
});
|
|
1340
|
-
|
|
1341
|
-
const
|
|
1340
|
+
$r.displayName = "MoreIcon";
|
|
1341
|
+
const Ii = {
|
|
1342
1342
|
tag: "svg",
|
|
1343
1343
|
attrs: {
|
|
1344
1344
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1362,26 +1362,26 @@ const Ci = {
|
|
|
1362
1362
|
clipRule: "evenodd"
|
|
1363
1363
|
}
|
|
1364
1364
|
}]
|
|
1365
|
-
},
|
|
1366
|
-
return
|
|
1365
|
+
}, Lr = $e(function(t, n) {
|
|
1366
|
+
return et(tt, Object.assign({}, t, {
|
|
1367
1367
|
id: "select-range-icon",
|
|
1368
1368
|
ref: n,
|
|
1369
|
-
icon:
|
|
1369
|
+
icon: Ii
|
|
1370
1370
|
}));
|
|
1371
1371
|
});
|
|
1372
|
-
|
|
1373
|
-
function
|
|
1374
|
-
const { onChange: t } = e, n = "-1", [o, r] = V(""), [s, i] = V([]), [c, l] = V(0), [g, m] = V(n), [h, d] = V(0), [u, a] = V(null), v = T(
|
|
1372
|
+
Lr.displayName = "SelectRangeIcon";
|
|
1373
|
+
function Ei(e) {
|
|
1374
|
+
const { onChange: t } = e, n = "-1", [o, r] = V(""), [s, i] = V([]), [c, l] = V(0), [g, m] = V(n), [h, d] = V(0), [u, a] = V(null), v = T(Gt), p = T(dt), S = T(vn), C = Se(S.sidebarOptions$), _ = hi(hr, p);
|
|
1375
1375
|
_.unshift({
|
|
1376
1376
|
label: p.t("formula.moreFunctions.allFunctions"),
|
|
1377
1377
|
value: n
|
|
1378
1378
|
});
|
|
1379
1379
|
const E = p.t("formula.prompt.required"), f = p.t("formula.prompt.optional");
|
|
1380
|
-
|
|
1380
|
+
L(() => {
|
|
1381
1381
|
A(n);
|
|
1382
|
-
}, []),
|
|
1382
|
+
}, []), L(() => {
|
|
1383
1383
|
y(0);
|
|
1384
|
-
}, [s]),
|
|
1384
|
+
}, [s]), L(() => {
|
|
1385
1385
|
C != null && C.visible && (r(""), i([]), l(0), m(n), d(0), a(null), A(n));
|
|
1386
1386
|
}, [C]);
|
|
1387
1387
|
const b = (I) => {
|
|
@@ -1425,11 +1425,11 @@ function _i(e) {
|
|
|
1425
1425
|
}, k = () => {
|
|
1426
1426
|
l(-1);
|
|
1427
1427
|
};
|
|
1428
|
-
return /* @__PURE__ */
|
|
1429
|
-
/* @__PURE__ */
|
|
1430
|
-
/* @__PURE__ */ M(
|
|
1428
|
+
return /* @__PURE__ */ H("div", { children: [
|
|
1429
|
+
/* @__PURE__ */ H("div", { className: "univer-flex univer-items-center univer-justify-between univer-gap-2", children: [
|
|
1430
|
+
/* @__PURE__ */ M(ys, { value: g, options: _, onChange: A }),
|
|
1431
1431
|
/* @__PURE__ */ M(
|
|
1432
|
-
|
|
1432
|
+
Ir,
|
|
1433
1433
|
{
|
|
1434
1434
|
placeholder: p.t("formula.moreFunctions.searchFunctionPlaceholder"),
|
|
1435
1435
|
onKeyDown: N,
|
|
@@ -1443,10 +1443,10 @@ function _i(e) {
|
|
|
1443
1443
|
s.length > 0 && /* @__PURE__ */ M(
|
|
1444
1444
|
"ul",
|
|
1445
1445
|
{
|
|
1446
|
-
className: re("univer-mb-0 univer-mt-2 univer-box-border univer-max-h-72 univer-w-full univer-select-none univer-list-none univer-overflow-y-auto univer-rounded univer-p-3 univer-outline-none",
|
|
1446
|
+
className: re("univer-mb-0 univer-mt-2 univer-box-border univer-max-h-72 univer-w-full univer-select-none univer-list-none univer-overflow-y-auto univer-rounded univer-p-3 univer-outline-none", Cn, ut),
|
|
1447
1447
|
onKeyDown: N,
|
|
1448
1448
|
tabIndex: -1,
|
|
1449
|
-
children: s.map(({ name: I }, x) => /* @__PURE__ */
|
|
1449
|
+
children: s.map(({ name: I }, x) => /* @__PURE__ */ H(
|
|
1450
1450
|
"li",
|
|
1451
1451
|
{
|
|
1452
1452
|
className: re("univer-relative univer-box-border univer-cursor-pointer univer-rounded univer-px-7 univer-py-1 univer-text-sm univer-text-gray-900 univer-transition-colors dark:!univer-text-white", {
|
|
@@ -1457,7 +1457,7 @@ function _i(e) {
|
|
|
1457
1457
|
onClick: () => y(x),
|
|
1458
1458
|
children: [
|
|
1459
1459
|
h === x && /* @__PURE__ */ M(
|
|
1460
|
-
|
|
1460
|
+
kr,
|
|
1461
1461
|
{
|
|
1462
1462
|
className: "univer-absolute univer-left-1.5 univer-top-1/2 univer-inline-flex -univer-translate-y-1/2 univer-text-base univer-text-primary-600"
|
|
1463
1463
|
}
|
|
@@ -1469,13 +1469,13 @@ function _i(e) {
|
|
|
1469
1469
|
))
|
|
1470
1470
|
}
|
|
1471
1471
|
),
|
|
1472
|
-
u && /* @__PURE__ */
|
|
1472
|
+
u && /* @__PURE__ */ H("div", { className: re("univer-mx-0 univer-my-2 univer-overflow-y-auto", ut), children: [
|
|
1473
1473
|
/* @__PURE__ */ M(vt, { title: u.functionName, value: u.description }),
|
|
1474
1474
|
/* @__PURE__ */ M(
|
|
1475
1475
|
vt,
|
|
1476
1476
|
{
|
|
1477
1477
|
title: p.t("formula.moreFunctions.syntax"),
|
|
1478
|
-
value: /* @__PURE__ */ M(
|
|
1478
|
+
value: /* @__PURE__ */ M(Mr, { prefix: u.functionName, value: u.functionParameter })
|
|
1479
1479
|
}
|
|
1480
1480
|
),
|
|
1481
1481
|
/* @__PURE__ */ M(
|
|
@@ -1496,36 +1496,36 @@ function _i(e) {
|
|
|
1496
1496
|
] })
|
|
1497
1497
|
] });
|
|
1498
1498
|
}
|
|
1499
|
-
function
|
|
1500
|
-
const e =
|
|
1501
|
-
T(
|
|
1502
|
-
const c = T(dt), l = T(
|
|
1499
|
+
function bi() {
|
|
1500
|
+
const e = bo(), [t, n] = V(!0), [o, r] = V(!1), [s, i] = V(null);
|
|
1501
|
+
T(fn);
|
|
1502
|
+
const c = T(dt), l = T(Ge), g = T(ne), m = T(me);
|
|
1503
1503
|
function h() {
|
|
1504
1504
|
n(!t), r(!o);
|
|
1505
1505
|
}
|
|
1506
1506
|
function d() {
|
|
1507
|
-
const u =
|
|
1507
|
+
const u = vr(g);
|
|
1508
1508
|
if (!u) return;
|
|
1509
|
-
m.executeCommand(
|
|
1509
|
+
m.executeCommand(cr.id, {
|
|
1510
1510
|
visible: !0,
|
|
1511
1511
|
unitId: u.unitId,
|
|
1512
|
-
eventType:
|
|
1512
|
+
eventType: xe.Dblclick
|
|
1513
1513
|
});
|
|
1514
|
-
const a = l.getEditor(
|
|
1514
|
+
const a = l.getEditor(un), v = l.getEditor(rr), p = `=${s == null ? void 0 : s.functionName}(`;
|
|
1515
1515
|
a == null || a.replaceText(p), v == null || v.replaceText(p, !1);
|
|
1516
1516
|
}
|
|
1517
|
-
return /* @__PURE__ */
|
|
1517
|
+
return /* @__PURE__ */ H(
|
|
1518
1518
|
"div",
|
|
1519
1519
|
{
|
|
1520
1520
|
"data-u-comp": "sheets-formula-functions-panel",
|
|
1521
1521
|
className: "univer-box-border univer-flex univer-h-full univer-flex-col univer-justify-between univer-py-2",
|
|
1522
1522
|
children: [
|
|
1523
|
-
t && /* @__PURE__ */ M(
|
|
1524
|
-
o && /* @__PURE__ */ M(
|
|
1523
|
+
t && /* @__PURE__ */ M(Ei, { onChange: i }),
|
|
1524
|
+
o && /* @__PURE__ */ M(fi, { functionInfo: s, onChange: () => {
|
|
1525
1525
|
} }),
|
|
1526
|
-
/* @__PURE__ */
|
|
1526
|
+
/* @__PURE__ */ H("div", { className: "univer-flex univer-justify-end", children: [
|
|
1527
1527
|
o && /* @__PURE__ */ M(
|
|
1528
|
-
|
|
1528
|
+
at,
|
|
1529
1529
|
{
|
|
1530
1530
|
variant: "primary",
|
|
1531
1531
|
onClick: h,
|
|
@@ -1533,9 +1533,9 @@ function Ri() {
|
|
|
1533
1533
|
children: c.t("formula.moreFunctions.next")
|
|
1534
1534
|
}
|
|
1535
1535
|
),
|
|
1536
|
-
o && /* @__PURE__ */ M(
|
|
1536
|
+
o && /* @__PURE__ */ M(at, { onClick: h, className: "univer-mb-5 univer-ml-4 univer-mr-0 univer-mt-0", children: c.t("formula.moreFunctions.prev") }),
|
|
1537
1537
|
t && !!e && /* @__PURE__ */ M(
|
|
1538
|
-
|
|
1538
|
+
at,
|
|
1539
1539
|
{
|
|
1540
1540
|
variant: "primary",
|
|
1541
1541
|
onClick: d,
|
|
@@ -1548,263 +1548,263 @@ function Ri() {
|
|
|
1548
1548
|
}
|
|
1549
1549
|
);
|
|
1550
1550
|
}
|
|
1551
|
-
function
|
|
1551
|
+
function yi(e) {
|
|
1552
1552
|
return {
|
|
1553
1553
|
id: pe.id,
|
|
1554
1554
|
title: "SUM",
|
|
1555
1555
|
icon: "SumIcon",
|
|
1556
|
-
type:
|
|
1556
|
+
type: Je.BUTTON,
|
|
1557
1557
|
params: {
|
|
1558
1558
|
value: "SUM"
|
|
1559
1559
|
},
|
|
1560
|
-
hidden$: ft(e,
|
|
1561
|
-
disabled$:
|
|
1562
|
-
workbookTypes: [
|
|
1563
|
-
worksheetTypes: [
|
|
1564
|
-
rangeTypes: [
|
|
1560
|
+
hidden$: ft(e, W.UNIVER_SHEET),
|
|
1561
|
+
disabled$: Ye(e, {
|
|
1562
|
+
workbookTypes: [Qe],
|
|
1563
|
+
worksheetTypes: [ze, Ze],
|
|
1564
|
+
rangeTypes: [Xe]
|
|
1565
1565
|
})
|
|
1566
1566
|
};
|
|
1567
1567
|
}
|
|
1568
|
-
function
|
|
1568
|
+
function Ti(e) {
|
|
1569
1569
|
return {
|
|
1570
1570
|
id: pe.id,
|
|
1571
1571
|
title: "COUNT",
|
|
1572
1572
|
icon: "CntIcon",
|
|
1573
|
-
type:
|
|
1573
|
+
type: Je.BUTTON,
|
|
1574
1574
|
params: {
|
|
1575
1575
|
value: "COUNT"
|
|
1576
1576
|
},
|
|
1577
|
-
hidden$: ft(e,
|
|
1578
|
-
disabled$:
|
|
1579
|
-
workbookTypes: [
|
|
1580
|
-
worksheetTypes: [
|
|
1581
|
-
rangeTypes: [
|
|
1577
|
+
hidden$: ft(e, W.UNIVER_SHEET),
|
|
1578
|
+
disabled$: Ye(e, {
|
|
1579
|
+
workbookTypes: [Qe],
|
|
1580
|
+
worksheetTypes: [ze, Ze],
|
|
1581
|
+
rangeTypes: [Xe]
|
|
1582
1582
|
})
|
|
1583
1583
|
};
|
|
1584
1584
|
}
|
|
1585
|
-
function
|
|
1585
|
+
function Ni(e) {
|
|
1586
1586
|
return {
|
|
1587
1587
|
id: pe.id,
|
|
1588
1588
|
title: "AVERAGE",
|
|
1589
1589
|
icon: "AvgIcon",
|
|
1590
|
-
type:
|
|
1590
|
+
type: Je.BUTTON,
|
|
1591
1591
|
params: {
|
|
1592
1592
|
value: "AVERAGE"
|
|
1593
1593
|
},
|
|
1594
|
-
hidden$: ft(e,
|
|
1595
|
-
disabled$:
|
|
1596
|
-
workbookTypes: [
|
|
1597
|
-
worksheetTypes: [
|
|
1598
|
-
rangeTypes: [
|
|
1594
|
+
hidden$: ft(e, W.UNIVER_SHEET),
|
|
1595
|
+
disabled$: Ye(e, {
|
|
1596
|
+
workbookTypes: [Qe],
|
|
1597
|
+
worksheetTypes: [ze, Ze],
|
|
1598
|
+
rangeTypes: [Xe]
|
|
1599
1599
|
})
|
|
1600
1600
|
};
|
|
1601
1601
|
}
|
|
1602
|
-
function
|
|
1602
|
+
function Oi(e) {
|
|
1603
1603
|
return {
|
|
1604
1604
|
id: pe.id,
|
|
1605
1605
|
title: "MAX",
|
|
1606
1606
|
icon: "MaxIcon",
|
|
1607
|
-
type:
|
|
1607
|
+
type: Je.BUTTON,
|
|
1608
1608
|
params: {
|
|
1609
1609
|
value: "MAX"
|
|
1610
1610
|
},
|
|
1611
|
-
hidden$: ft(e,
|
|
1612
|
-
disabled$:
|
|
1613
|
-
workbookTypes: [
|
|
1614
|
-
worksheetTypes: [
|
|
1615
|
-
rangeTypes: [
|
|
1611
|
+
hidden$: ft(e, W.UNIVER_SHEET),
|
|
1612
|
+
disabled$: Ye(e, {
|
|
1613
|
+
workbookTypes: [Qe],
|
|
1614
|
+
worksheetTypes: [ze, Ze],
|
|
1615
|
+
rangeTypes: [Xe]
|
|
1616
1616
|
})
|
|
1617
1617
|
};
|
|
1618
1618
|
}
|
|
1619
|
-
function
|
|
1619
|
+
function xi(e) {
|
|
1620
1620
|
return {
|
|
1621
1621
|
id: pe.id,
|
|
1622
1622
|
title: "MIN",
|
|
1623
1623
|
icon: "MinIcon",
|
|
1624
|
-
type:
|
|
1624
|
+
type: Je.BUTTON,
|
|
1625
1625
|
params: {
|
|
1626
1626
|
value: "MIN"
|
|
1627
1627
|
},
|
|
1628
|
-
hidden$: ft(e,
|
|
1629
|
-
disabled$:
|
|
1630
|
-
workbookTypes: [
|
|
1631
|
-
worksheetTypes: [
|
|
1632
|
-
rangeTypes: [
|
|
1628
|
+
hidden$: ft(e, W.UNIVER_SHEET),
|
|
1629
|
+
disabled$: Ye(e, {
|
|
1630
|
+
workbookTypes: [Qe],
|
|
1631
|
+
worksheetTypes: [ze, Ze],
|
|
1632
|
+
rangeTypes: [Xe]
|
|
1633
1633
|
})
|
|
1634
1634
|
};
|
|
1635
1635
|
}
|
|
1636
|
-
function
|
|
1636
|
+
function Mi(e) {
|
|
1637
1637
|
return {
|
|
1638
|
-
id:
|
|
1638
|
+
id: Rn.id,
|
|
1639
1639
|
title: "formula.insert.more",
|
|
1640
1640
|
tooltip: "formula.insert.tooltip",
|
|
1641
|
-
type:
|
|
1642
|
-
hidden$: ft(e,
|
|
1643
|
-
disabled$:
|
|
1644
|
-
workbookTypes: [
|
|
1645
|
-
worksheetTypes: [
|
|
1646
|
-
rangeTypes: [
|
|
1641
|
+
type: Je.BUTTON,
|
|
1642
|
+
hidden$: ft(e, W.UNIVER_SHEET),
|
|
1643
|
+
disabled$: Ye(e, {
|
|
1644
|
+
workbookTypes: [Qe],
|
|
1645
|
+
worksheetTypes: [ze, Ze],
|
|
1646
|
+
rangeTypes: [Xe]
|
|
1647
1647
|
})
|
|
1648
1648
|
};
|
|
1649
1649
|
}
|
|
1650
|
-
function
|
|
1651
|
-
return e.get(ne).getCurrentTypeOfUnit$(
|
|
1652
|
-
|
|
1650
|
+
function wi(e) {
|
|
1651
|
+
return e.get(ne).getCurrentTypeOfUnit$(W.UNIVER_SHEET).pipe(
|
|
1652
|
+
Ko((o) => o ? e.get(Kn) ? new Yo((s) => s.next(!e.get(Kn).supportClipboard)) : Vn(!0) : Vn(!0))
|
|
1653
1653
|
);
|
|
1654
1654
|
}
|
|
1655
|
-
function
|
|
1655
|
+
function ki(e) {
|
|
1656
1656
|
return {
|
|
1657
|
-
id:
|
|
1658
|
-
type:
|
|
1657
|
+
id: _n.id,
|
|
1658
|
+
type: Je.BUTTON,
|
|
1659
1659
|
title: "formula.operation.pasteFormula",
|
|
1660
|
-
disabled$:
|
|
1661
|
-
|
|
1662
|
-
workbookTypes: [
|
|
1663
|
-
rangeTypes: [
|
|
1664
|
-
worksheetTypes: [
|
|
1660
|
+
disabled$: wi(e).pipe(
|
|
1661
|
+
jo(Ye(e, {
|
|
1662
|
+
workbookTypes: [Qe],
|
|
1663
|
+
rangeTypes: [Xe],
|
|
1664
|
+
worksheetTypes: [Ze, ze]
|
|
1665
1665
|
})),
|
|
1666
|
-
|
|
1666
|
+
gr(([t, n]) => t || n)
|
|
1667
1667
|
)
|
|
1668
1668
|
};
|
|
1669
1669
|
}
|
|
1670
|
-
const
|
|
1671
|
-
[
|
|
1670
|
+
const Ai = {
|
|
1671
|
+
[Yn.BASIC]: {
|
|
1672
1672
|
[`${pe.id}.sum`]: {
|
|
1673
1673
|
order: 0,
|
|
1674
|
-
menuItemFactory:
|
|
1674
|
+
menuItemFactory: yi
|
|
1675
1675
|
},
|
|
1676
1676
|
[`${pe.id}.count`]: {
|
|
1677
1677
|
order: 1,
|
|
1678
|
-
menuItemFactory:
|
|
1678
|
+
menuItemFactory: Ti
|
|
1679
1679
|
},
|
|
1680
1680
|
[`${pe.id}.average`]: {
|
|
1681
1681
|
order: 2,
|
|
1682
|
-
menuItemFactory:
|
|
1682
|
+
menuItemFactory: Ni
|
|
1683
1683
|
},
|
|
1684
1684
|
[`${pe.id}.max`]: {
|
|
1685
1685
|
order: 3,
|
|
1686
|
-
menuItemFactory:
|
|
1686
|
+
menuItemFactory: Oi
|
|
1687
1687
|
},
|
|
1688
1688
|
[`${pe.id}.min`]: {
|
|
1689
1689
|
order: 4,
|
|
1690
|
-
menuItemFactory:
|
|
1690
|
+
menuItemFactory: xi
|
|
1691
1691
|
}
|
|
1692
1692
|
},
|
|
1693
|
-
[
|
|
1694
|
-
[
|
|
1693
|
+
[Yn.OTHERS]: {
|
|
1694
|
+
[Rn.id]: {
|
|
1695
1695
|
order: 0,
|
|
1696
|
-
menuItemFactory:
|
|
1696
|
+
menuItemFactory: Mi
|
|
1697
1697
|
}
|
|
1698
1698
|
},
|
|
1699
|
-
[
|
|
1700
|
-
[
|
|
1699
|
+
[yo]: {
|
|
1700
|
+
[_n.id]: {
|
|
1701
1701
|
order: 4,
|
|
1702
|
-
menuItemFactory:
|
|
1702
|
+
menuItemFactory: ki
|
|
1703
1703
|
}
|
|
1704
1704
|
}
|
|
1705
|
-
},
|
|
1706
|
-
function
|
|
1707
|
-
return e.getContextValue(
|
|
1708
|
-
}
|
|
1709
|
-
const
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
],
|
|
1715
|
-
function
|
|
1705
|
+
}, Fi = "meta_key_ctrl_And_Shift";
|
|
1706
|
+
function Di(e) {
|
|
1707
|
+
return e.getContextValue(so) && e.getContextValue(io);
|
|
1708
|
+
}
|
|
1709
|
+
const Xt = [
|
|
1710
|
+
$.ARROW_DOWN,
|
|
1711
|
+
$.ARROW_UP,
|
|
1712
|
+
$.ARROW_LEFT,
|
|
1713
|
+
$.ARROW_RIGHT
|
|
1714
|
+
], $i = [...Xt, $.ENTER, $.TAB, $.ESC];
|
|
1715
|
+
function Li() {
|
|
1716
1716
|
const e = [];
|
|
1717
|
-
for (const t of
|
|
1717
|
+
for (const t of $i)
|
|
1718
1718
|
e.push({
|
|
1719
1719
|
id: gt.id,
|
|
1720
1720
|
binding: t,
|
|
1721
|
-
preconditions: (n) =>
|
|
1721
|
+
preconditions: (n) => bt(n),
|
|
1722
1722
|
staticParameters: {
|
|
1723
|
-
eventType:
|
|
1723
|
+
eventType: xe.Keyboard,
|
|
1724
1724
|
keycode: t
|
|
1725
1725
|
}
|
|
1726
1726
|
});
|
|
1727
1727
|
return e;
|
|
1728
1728
|
}
|
|
1729
|
-
function
|
|
1729
|
+
function Pi() {
|
|
1730
1730
|
const e = [];
|
|
1731
|
-
for (const t of
|
|
1731
|
+
for (const t of Xt)
|
|
1732
1732
|
e.push({
|
|
1733
1733
|
id: gt.id,
|
|
1734
1734
|
binding: t | P.SHIFT,
|
|
1735
|
-
preconditions: (n) =>
|
|
1735
|
+
preconditions: (n) => bt(n),
|
|
1736
1736
|
staticParameters: {
|
|
1737
|
-
eventType:
|
|
1737
|
+
eventType: xe.Keyboard,
|
|
1738
1738
|
keycode: t,
|
|
1739
1739
|
metaKey: P.SHIFT
|
|
1740
1740
|
}
|
|
1741
1741
|
});
|
|
1742
1742
|
return e;
|
|
1743
1743
|
}
|
|
1744
|
-
function
|
|
1744
|
+
function Ui() {
|
|
1745
1745
|
const e = [];
|
|
1746
|
-
for (const t of
|
|
1746
|
+
for (const t of Xt)
|
|
1747
1747
|
e.push({
|
|
1748
1748
|
id: gt.id,
|
|
1749
1749
|
binding: t | P.CTRL_COMMAND,
|
|
1750
|
-
preconditions: (n) =>
|
|
1750
|
+
preconditions: (n) => bt(n),
|
|
1751
1751
|
staticParameters: {
|
|
1752
|
-
eventType:
|
|
1752
|
+
eventType: xe.Keyboard,
|
|
1753
1753
|
keycode: t,
|
|
1754
1754
|
metaKey: P.CTRL_COMMAND
|
|
1755
1755
|
}
|
|
1756
1756
|
});
|
|
1757
1757
|
return e;
|
|
1758
1758
|
}
|
|
1759
|
-
function
|
|
1759
|
+
function Vi() {
|
|
1760
1760
|
const e = [];
|
|
1761
|
-
for (const t of
|
|
1761
|
+
for (const t of Xt)
|
|
1762
1762
|
e.push({
|
|
1763
1763
|
id: gt.id,
|
|
1764
1764
|
binding: t | P.SHIFT | P.CTRL_COMMAND,
|
|
1765
|
-
preconditions: (n) =>
|
|
1765
|
+
preconditions: (n) => bt(n),
|
|
1766
1766
|
staticParameters: {
|
|
1767
|
-
eventType:
|
|
1767
|
+
eventType: xe.Keyboard,
|
|
1768
1768
|
keycode: t,
|
|
1769
|
-
metaKey:
|
|
1769
|
+
metaKey: Fi
|
|
1770
1770
|
}
|
|
1771
1771
|
});
|
|
1772
1772
|
return e;
|
|
1773
1773
|
}
|
|
1774
|
-
const
|
|
1775
|
-
id:
|
|
1776
|
-
binding:
|
|
1777
|
-
preconditions: (e) =>
|
|
1774
|
+
const Wi = {
|
|
1775
|
+
id: Tr.id,
|
|
1776
|
+
binding: $.F4,
|
|
1777
|
+
preconditions: (e) => bt(e)
|
|
1778
1778
|
};
|
|
1779
|
-
function
|
|
1779
|
+
function Hi() {
|
|
1780
1780
|
const e = [];
|
|
1781
|
-
for (const t of [
|
|
1781
|
+
for (const t of [$.ENTER, $.TAB, $.ARROW_DOWN, $.ARROW_UP])
|
|
1782
1782
|
e.push({
|
|
1783
1783
|
id: gt.id,
|
|
1784
1784
|
binding: t,
|
|
1785
|
-
preconditions: (n) =>
|
|
1785
|
+
preconditions: (n) => Di(n),
|
|
1786
1786
|
staticParameters: {
|
|
1787
|
-
eventType:
|
|
1787
|
+
eventType: xe.Keyboard,
|
|
1788
1788
|
keycode: t,
|
|
1789
1789
|
isSingleEditor: !0
|
|
1790
1790
|
}
|
|
1791
1791
|
});
|
|
1792
1792
|
return e;
|
|
1793
1793
|
}
|
|
1794
|
-
const
|
|
1795
|
-
id:
|
|
1796
|
-
binding: P.ALT |
|
|
1797
|
-
preconditions:
|
|
1798
|
-
mac: P.CTRL_COMMAND | P.ALT |
|
|
1794
|
+
const Bi = {
|
|
1795
|
+
id: fs.id,
|
|
1796
|
+
binding: P.ALT | $.EQUAL,
|
|
1797
|
+
preconditions: To,
|
|
1798
|
+
mac: P.CTRL_COMMAND | P.ALT | $.EQUAL,
|
|
1799
1799
|
description: "shortcut.sheets-formula-ui.quick-sum",
|
|
1800
1800
|
group: "4_sheet-edit"
|
|
1801
1801
|
};
|
|
1802
|
-
var
|
|
1803
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
1802
|
+
var qi = Object.getOwnPropertyDescriptor, ji = (e, t, n, o) => {
|
|
1803
|
+
for (var r = o > 1 ? void 0 : o ? qi(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
1804
1804
|
(i = e[s]) && (r = i(r) || r);
|
|
1805
1805
|
return r;
|
|
1806
1806
|
}, Be = (e, t) => (n, o) => t(n, o, e);
|
|
1807
|
-
let
|
|
1807
|
+
let Bt = class extends Ke {
|
|
1808
1808
|
constructor(e, t, n, o, r, s, i) {
|
|
1809
1809
|
super(), this._injector = e, this._menuManagerService = t, this._commandService = n, this._shortcutService = o, this._uiPartsService = r, this._renderManagerService = s, this._componentManager = i, this._initialize();
|
|
1810
1810
|
}
|
|
@@ -1812,51 +1812,74 @@ let Ht = class extends ut {
|
|
|
1812
1812
|
this._registerCommands(), this._registerMenus(), this._registerShortcuts(), this._registerComponents(), this._registerRenderModules();
|
|
1813
1813
|
}
|
|
1814
1814
|
_registerMenus() {
|
|
1815
|
-
this._menuManagerService.mergeMenu(
|
|
1815
|
+
this._menuManagerService.mergeMenu(Ai);
|
|
1816
1816
|
}
|
|
1817
1817
|
_registerCommands() {
|
|
1818
1818
|
[
|
|
1819
|
-
|
|
1819
|
+
_n,
|
|
1820
1820
|
pe,
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1821
|
+
Rn,
|
|
1822
|
+
Ws,
|
|
1823
|
+
Fs,
|
|
1824
1824
|
gt,
|
|
1825
|
-
|
|
1825
|
+
Tr
|
|
1826
1826
|
].forEach((e) => this.disposeWithMe(this._commandService.registerCommand(e)));
|
|
1827
1827
|
}
|
|
1828
1828
|
_registerShortcuts() {
|
|
1829
1829
|
[
|
|
1830
|
-
...Fi(),
|
|
1831
|
-
...Di(),
|
|
1832
1830
|
...Li(),
|
|
1833
|
-
|
|
1831
|
+
...Pi(),
|
|
1834
1832
|
...Ui(),
|
|
1835
|
-
Vi,
|
|
1836
|
-
|
|
1833
|
+
...Vi(),
|
|
1834
|
+
...Hi(),
|
|
1835
|
+
Bi,
|
|
1836
|
+
Wi
|
|
1837
1837
|
].forEach((e) => {
|
|
1838
1838
|
this.disposeWithMe(this._shortcutService.registerShortcut(e));
|
|
1839
1839
|
});
|
|
1840
1840
|
}
|
|
1841
1841
|
_registerComponents() {
|
|
1842
|
-
this.disposeWithMe(this._uiPartsService.registerComponent(
|
|
1842
|
+
this.disposeWithMe(this._uiPartsService.registerComponent(No.FORMULA_AUX, () => Rr(di, this._injector))), this._componentManager.register(yr, bi);
|
|
1843
1843
|
}
|
|
1844
1844
|
_registerRenderModules() {
|
|
1845
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
1845
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(W.UNIVER_SHEET, [Wt]));
|
|
1846
1846
|
}
|
|
1847
1847
|
};
|
|
1848
|
-
|
|
1848
|
+
Bt = ji([
|
|
1849
1849
|
Be(0, q(Rt)),
|
|
1850
|
-
Be(1,
|
|
1850
|
+
Be(1, vs),
|
|
1851
1851
|
Be(2, me),
|
|
1852
|
-
Be(3,
|
|
1853
|
-
Be(4,
|
|
1854
|
-
Be(5,
|
|
1855
|
-
Be(6, q(
|
|
1856
|
-
],
|
|
1857
|
-
|
|
1852
|
+
Be(3, Zt),
|
|
1853
|
+
Be(4, Cr),
|
|
1854
|
+
Be(5, Re),
|
|
1855
|
+
Be(6, q(_r))
|
|
1856
|
+
], Bt);
|
|
1857
|
+
var Ki = Object.getOwnPropertyDescriptor, Yi = (e, t, n, o) => {
|
|
1858
|
+
for (var r = o > 1 ? void 0 : o ? Ki(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
1859
|
+
(i = e[s]) && (r = i(r) || r);
|
|
1860
|
+
return r;
|
|
1861
|
+
}, tn = (e, t) => (n, o) => t(n, o, e);
|
|
1862
|
+
let qt = class extends Ke {
|
|
1863
|
+
constructor(e, t, n) {
|
|
1864
|
+
super(), this._imageFormulaCellInterceptorController = e, this._renderManagerService = t, this._univerInstanceService = n, this._imageFormulaCellInterceptorController.registerRefreshRenderFunction(() => {
|
|
1865
|
+
const o = this._univerInstanceService.getCurrentUnitOfType(W.UNIVER_SHEET);
|
|
1866
|
+
if (!o) return;
|
|
1867
|
+
const r = this._renderManagerService.getRenderById(o.getUnitId());
|
|
1868
|
+
if (!r) return;
|
|
1869
|
+
r.with(Et).reCalculate();
|
|
1870
|
+
const s = r.mainComponent;
|
|
1871
|
+
s && s.makeDirty();
|
|
1872
|
+
});
|
|
1873
|
+
}
|
|
1874
|
+
};
|
|
1875
|
+
qt = Yi([
|
|
1876
|
+
tn(0, q(gs)),
|
|
1877
|
+
tn(1, Re),
|
|
1878
|
+
tn(2, ne)
|
|
1879
|
+
], qt);
|
|
1880
|
+
class Pr {
|
|
1858
1881
|
constructor() {
|
|
1859
|
-
j(this, "_currentSelector$", new
|
|
1882
|
+
j(this, "_currentSelector$", new mr(null));
|
|
1860
1883
|
j(this, "currentSelector$", this._currentSelector$.asObservable());
|
|
1861
1884
|
}
|
|
1862
1885
|
showRangeSelectorDialog(t) {
|
|
@@ -1868,12 +1891,12 @@ class Lr {
|
|
|
1868
1891
|
return this._currentSelector$.next(t), o;
|
|
1869
1892
|
}
|
|
1870
1893
|
}
|
|
1871
|
-
var
|
|
1872
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
1894
|
+
var Gi = Object.getOwnPropertyDescriptor, Zi = (e, t, n, o) => {
|
|
1895
|
+
for (var r = o > 1 ? void 0 : o ? Gi(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
1873
1896
|
(i = e[s]) && (r = i(r) || r);
|
|
1874
1897
|
return r;
|
|
1875
|
-
},
|
|
1876
|
-
let De = class extends
|
|
1898
|
+
}, it = (e, t) => (n, o) => t(n, o, e);
|
|
1899
|
+
let De = class extends Oo {
|
|
1877
1900
|
constructor(t, n, o, r, s, i, c) {
|
|
1878
1901
|
super(
|
|
1879
1902
|
n,
|
|
@@ -1884,7 +1907,7 @@ let De = class extends To {
|
|
|
1884
1907
|
);
|
|
1885
1908
|
j(this, "_workbookSelections");
|
|
1886
1909
|
j(this, "_eventDisposables");
|
|
1887
|
-
this._context = t, this._contextService = i, this._refSelectionsService = c, this._workbookSelections = this._refSelectionsService.getWorkbookSelections(this._context.unitId), this._initSelectionChangeListener(), this._initSkeletonChangeListener(), this._initUserActionSyncListener(), this._setSelectionStyle(
|
|
1910
|
+
this._context = t, this._contextService = i, this._refSelectionsService = c, this._workbookSelections = this._refSelectionsService.getWorkbookSelections(this._context.unitId), this._initSelectionChangeListener(), this._initSkeletonChangeListener(), this._initUserActionSyncListener(), this._setSelectionStyle(zi(this._themeService)), this._remainLastEnabled = !0, this._highlightHeader = !1;
|
|
1888
1911
|
}
|
|
1889
1912
|
getLocation() {
|
|
1890
1913
|
return this._skeleton.getLocation();
|
|
@@ -1908,7 +1931,7 @@ let De = class extends To {
|
|
|
1908
1931
|
* Call this method and user will be able to select on the canvas to update selections.
|
|
1909
1932
|
*/
|
|
1910
1933
|
enableSelectionChanging() {
|
|
1911
|
-
return this._disableSelectionChanging(), this._eventDisposables = this._initCanvasEventListeners(),
|
|
1934
|
+
return this._disableSelectionChanging(), this._eventDisposables = this._initCanvasEventListeners(), sr(() => this._disableSelectionChanging());
|
|
1912
1935
|
}
|
|
1913
1936
|
_disableSelectionChanging() {
|
|
1914
1937
|
var t;
|
|
@@ -1924,16 +1947,16 @@ let De = class extends To {
|
|
|
1924
1947
|
})), c.add(
|
|
1925
1948
|
n == null ? void 0 : n.onPointerDown$.subscribeEvent((l, g) => {
|
|
1926
1949
|
if (!this.inRefSelectionMode()) return;
|
|
1927
|
-
const m = this._sheetSkeletonManagerService.getCurrent().skeleton, { row: h } =
|
|
1928
|
-
|
|
1950
|
+
const m = this._sheetSkeletonManagerService.getCurrent().skeleton, { row: h } = Dn(l.offsetX, l.offsetY, i, m);
|
|
1951
|
+
$n(this._workbookSelections.getCurrentSelections(), h, ve.ROW) || (this._onPointerDown(l, (r.zIndex || 1) + 1, ve.ROW, this._getActiveViewport(l), Qt.Y), l.button !== 2 && g.stopPropagation());
|
|
1929
1952
|
})
|
|
1930
1953
|
), c.add(o == null ? void 0 : o.onPointerDown$.subscribeEvent((l, g) => {
|
|
1931
1954
|
if (!this.inRefSelectionMode()) return;
|
|
1932
|
-
const m = this._sheetSkeletonManagerService.getCurrent().skeleton, { column: h } =
|
|
1933
|
-
|
|
1955
|
+
const m = this._sheetSkeletonManagerService.getCurrent().skeleton, { column: h } = Dn(l.offsetX, l.offsetY, i, m);
|
|
1956
|
+
$n(this._workbookSelections.getCurrentSelections(), h, ve.COLUMN) || (this._onPointerDown(l, (r.zIndex || 1) + 1, ve.COLUMN, this._getActiveViewport(l), Qt.X), l.button !== 2 && g.stopPropagation());
|
|
1934
1957
|
})), c.add(s == null ? void 0 : s.onPointerDown$.subscribeEvent((l, g) => {
|
|
1935
1958
|
if (this._reset(), !this.inRefSelectionMode()) return;
|
|
1936
|
-
const m = this._sheetSkeletonManagerService.getCurrent().skeleton, h =
|
|
1959
|
+
const m = this._sheetSkeletonManagerService.getCurrent().skeleton, h = xo(m);
|
|
1937
1960
|
this._addSelectionControlByModelData(h), this._selectionMoveStart$.next(this.getSelectionDataWithStyle());
|
|
1938
1961
|
const d = i.onPointerUp$.subscribeEvent(() => {
|
|
1939
1962
|
d.unsubscribe(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle());
|
|
@@ -1948,7 +1971,7 @@ let De = class extends To {
|
|
|
1948
1971
|
*/
|
|
1949
1972
|
_addSelectionControlByModelData(t) {
|
|
1950
1973
|
var i;
|
|
1951
|
-
const n = this._skeleton, o = (i = t.style) != null ? i :
|
|
1974
|
+
const n = this._skeleton, o = (i = t.style) != null ? i : ur(this._themeService), r = this._scene;
|
|
1952
1975
|
return t.style = o, this.newSelectionControl(r, n, t);
|
|
1953
1976
|
}
|
|
1954
1977
|
_initSelectionChangeListener() {
|
|
@@ -1961,18 +1984,18 @@ let De = class extends To {
|
|
|
1961
1984
|
*/
|
|
1962
1985
|
_initUserActionSyncListener() {
|
|
1963
1986
|
this.disposeWithMe(this.selectionMoveStart$.subscribe((t) => {
|
|
1964
|
-
this._updateSelections(t,
|
|
1987
|
+
this._updateSelections(t, Jt.MOVE_START);
|
|
1965
1988
|
})), this.disposeWithMe(this.selectionMoving$.subscribe((t) => {
|
|
1966
|
-
this._updateSelections(t,
|
|
1989
|
+
this._updateSelections(t, Jt.MOVING);
|
|
1967
1990
|
})), this.disposeWithMe(this.selectionMoveEnd$.subscribe((t) => {
|
|
1968
|
-
this._updateSelections(t,
|
|
1991
|
+
this._updateSelections(t, Jt.MOVE_END);
|
|
1969
1992
|
}));
|
|
1970
1993
|
}
|
|
1971
1994
|
_updateSelections(t, n) {
|
|
1972
1995
|
const r = this._context.unit.getActiveSheet().getSheetId();
|
|
1973
1996
|
t.length !== 0 && this._workbookSelections.setSelections(
|
|
1974
1997
|
r,
|
|
1975
|
-
t.map((s) =>
|
|
1998
|
+
t.map((s) => ls(s)),
|
|
1976
1999
|
n
|
|
1977
2000
|
);
|
|
1978
2001
|
}
|
|
@@ -1981,7 +2004,7 @@ let De = class extends To {
|
|
|
1981
2004
|
var i;
|
|
1982
2005
|
if (!t)
|
|
1983
2006
|
return;
|
|
1984
|
-
const { skeleton: n } = t, { scene: o } = this._context, r = o.getViewport(
|
|
2007
|
+
const { skeleton: n } = t, { scene: o } = this._context, r = o.getViewport(Hn.VIEW_MAIN);
|
|
1985
2008
|
this._skeleton && ((i = this._skeleton.worksheet) == null ? void 0 : i.getSheetId()) !== n.worksheet.getSheetId() && this._reset(), this._changeRuntime(n, o, r);
|
|
1986
2009
|
const s = this._workbookSelections.getCurrentSelections();
|
|
1987
2010
|
this.resetSelectionsByModelData(s);
|
|
@@ -1989,10 +2012,10 @@ let De = class extends To {
|
|
|
1989
2012
|
}
|
|
1990
2013
|
_getActiveViewport(t) {
|
|
1991
2014
|
const n = this._getSheetObject();
|
|
1992
|
-
return n == null ? void 0 : n.scene.getActiveViewportByCoord(
|
|
2015
|
+
return n == null ? void 0 : n.scene.getActiveViewportByCoord(Bn.FromArray([t.offsetX, t.offsetY]));
|
|
1993
2016
|
}
|
|
1994
2017
|
_getSheetObject() {
|
|
1995
|
-
return
|
|
2018
|
+
return Mo(this._context.unit, this._context);
|
|
1996
2019
|
}
|
|
1997
2020
|
/**
|
|
1998
2021
|
* Handle pointer down event, bind pointermove & pointerup handler.
|
|
@@ -2005,16 +2028,16 @@ let De = class extends To {
|
|
|
2005
2028
|
* @param scrollTimerType
|
|
2006
2029
|
*/
|
|
2007
2030
|
// eslint-disable-next-line complexity, max-lines-per-function
|
|
2008
|
-
_onPointerDown(t, n = 0, o = ve.NORMAL, r, s =
|
|
2031
|
+
_onPointerDown(t, n = 0, o = ve.NORMAL, r, s = Qt.ALL) {
|
|
2009
2032
|
var N;
|
|
2010
2033
|
this._rangeType = o;
|
|
2011
2034
|
const i = this._skeleton, c = this._scene;
|
|
2012
2035
|
if (!c || !i)
|
|
2013
2036
|
return;
|
|
2014
2037
|
r && (this._activeViewport = r);
|
|
2015
|
-
const { offsetX: l, offsetY: g } = t, m = c.getViewport(
|
|
2038
|
+
const { offsetX: l, offsetY: g } = t, m = c.getViewport(Hn.VIEW_MAIN);
|
|
2016
2039
|
if (!m) return;
|
|
2017
|
-
const h = c.getCoordRelativeToViewport(
|
|
2040
|
+
const h = c.getCoordRelativeToViewport(Bn.FromArray([l, g])), { x: d, y: u } = h;
|
|
2018
2041
|
this._startViewportPosX = d, this._startViewportPosY = u;
|
|
2019
2042
|
const a = c.getScrollXYInfoByViewport(h), { scaleX: v, scaleY: p } = c.getAncestorScale(), S = this._skeleton.getCellByOffset(d, u, v, p, a);
|
|
2020
2043
|
if (!S) return;
|
|
@@ -2032,13 +2055,13 @@ let De = class extends To {
|
|
|
2032
2055
|
}
|
|
2033
2056
|
const C = { range: S, primary: S, style: null };
|
|
2034
2057
|
C.range.rangeType = o;
|
|
2035
|
-
const _ =
|
|
2058
|
+
const _ = rn(C, this._skeleton);
|
|
2036
2059
|
this._startRangeWhenPointerDown = { ..._.rangeWithCoord };
|
|
2037
2060
|
const E = { ..._.rangeWithCoord, rangeType: o };
|
|
2038
2061
|
let f = this.getActiveSelectionControl();
|
|
2039
2062
|
const b = this.getSelectionControls();
|
|
2040
2063
|
for (const O of b) {
|
|
2041
|
-
if (t.button === 2 &&
|
|
2064
|
+
if (t.button === 2 && nr.contains(O.model, E)) {
|
|
2042
2065
|
f = O;
|
|
2043
2066
|
return;
|
|
2044
2067
|
}
|
|
@@ -2072,12 +2095,12 @@ let De = class extends To {
|
|
|
2072
2095
|
* @returns {SelectionControl} selectionControl just created
|
|
2073
2096
|
*/
|
|
2074
2097
|
newSelectionControl(t, n, o) {
|
|
2075
|
-
const r = this.getSelectionControls().length, { rowHeaderWidth: s, columnHeaderHeight: i } = n, c = new
|
|
2098
|
+
const r = this.getSelectionControls().length, { rowHeaderWidth: s, columnHeaderHeight: i } = n, c = new lr(t, r, this._themeService, {
|
|
2076
2099
|
highlightHeader: this._highlightHeader,
|
|
2077
2100
|
enableAutoFill: !1,
|
|
2078
2101
|
rowHeaderWidth: s,
|
|
2079
2102
|
columnHeaderHeight: i
|
|
2080
|
-
}), l =
|
|
2103
|
+
}), l = rn(o, n);
|
|
2081
2104
|
return c.updateRangeBySelectionWithCoord(l), this._selectionControls.push(c), c.setControlExtension({
|
|
2082
2105
|
skeleton: n,
|
|
2083
2106
|
scene: t,
|
|
@@ -2091,19 +2114,19 @@ let De = class extends To {
|
|
|
2091
2114
|
}), c;
|
|
2092
2115
|
}
|
|
2093
2116
|
};
|
|
2094
|
-
De =
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2117
|
+
De = Zi([
|
|
2118
|
+
it(1, q(Rt)),
|
|
2119
|
+
it(2, q(It)),
|
|
2120
|
+
it(3, Zt),
|
|
2121
|
+
it(4, q(Et)),
|
|
2122
|
+
it(5, ln),
|
|
2123
|
+
it(6, Yt)
|
|
2101
2124
|
], De);
|
|
2102
|
-
function
|
|
2103
|
-
const t =
|
|
2125
|
+
function zi(e) {
|
|
2126
|
+
const t = ur(e);
|
|
2104
2127
|
return t.widgets = { tl: !0, tc: !0, tr: !0, ml: !0, mr: !0, bl: !0, bc: !0, br: !0 }, t;
|
|
2105
2128
|
}
|
|
2106
|
-
const
|
|
2129
|
+
const In = (e, t, n = !0) => {
|
|
2107
2130
|
let o = -1;
|
|
2108
2131
|
return e.reduce((r, s, i) => {
|
|
2109
2132
|
if (r.isFinish)
|
|
@@ -2117,7 +2140,7 @@ const _n = (e, t, n = !0) => {
|
|
|
2117
2140
|
}
|
|
2118
2141
|
return (n ? r.currentIndex === t : t > c && t <= r.currentIndex) && (o = i, r.isFinish = !0), r;
|
|
2119
2142
|
}, { currentIndex: 0, isFinish: !1 }), o;
|
|
2120
|
-
},
|
|
2143
|
+
}, Ur = (e, t) => {
|
|
2121
2144
|
const n = e[t];
|
|
2122
2145
|
let o = -1;
|
|
2123
2146
|
if (!n || typeof n == "string" || n.nodeType !== Q.REFERENCE) return -1;
|
|
@@ -2126,8 +2149,8 @@ const _n = (e, t, n = !0) => {
|
|
|
2126
2149
|
typeof s != "string" && s.nodeType === Q.REFERENCE && o++;
|
|
2127
2150
|
}
|
|
2128
2151
|
return o;
|
|
2129
|
-
},
|
|
2130
|
-
|
|
2152
|
+
}, Xi = (e, t = 100) => {
|
|
2153
|
+
L(() => {
|
|
2131
2154
|
let n = null;
|
|
2132
2155
|
const o = () => {
|
|
2133
2156
|
n === null && (n = window.setTimeout(() => {
|
|
@@ -2139,8 +2162,8 @@ const _n = (e, t, n = !0) => {
|
|
|
2139
2162
|
};
|
|
2140
2163
|
}, [e, t]);
|
|
2141
2164
|
};
|
|
2142
|
-
function
|
|
2143
|
-
const o = T(
|
|
2165
|
+
function Vr(e, t, n) {
|
|
2166
|
+
const o = T(Ge), r = ie(() => new mr({ left: -999, top: -999, right: -999, bottom: -999 }), []), s = T(vn), i = T(ne), c = te(() => {
|
|
2144
2167
|
var _;
|
|
2145
2168
|
const l = o.getEditor(e);
|
|
2146
2169
|
if (!l)
|
|
@@ -2154,30 +2177,30 @@ function Pr(e, t, n) {
|
|
|
2154
2177
|
if (!(C.left === a && C.top === v && C.right === p && C.bottom === S))
|
|
2155
2178
|
return r.next({ left: a - 1, right: p + 1, top: v - 1, bottom: S + 1 }), g;
|
|
2156
2179
|
});
|
|
2157
|
-
return
|
|
2180
|
+
return L(() => {
|
|
2158
2181
|
t && c();
|
|
2159
|
-
}, [e, o, i.unitAdded$, c, t, ...n != null ? n : []]),
|
|
2160
|
-
const l = s.scrollEvent$.pipe(
|
|
2182
|
+
}, [e, o, i.unitAdded$, c, t, ...n != null ? n : []]), Xi(c), L(() => {
|
|
2183
|
+
const l = s.scrollEvent$.pipe(Go(100)).subscribe(c);
|
|
2161
2184
|
return () => {
|
|
2162
2185
|
l.unsubscribe();
|
|
2163
2186
|
};
|
|
2164
2187
|
}, []), [r, c];
|
|
2165
2188
|
}
|
|
2166
|
-
const
|
|
2189
|
+
const nt = (e) => {
|
|
2167
2190
|
const t = z(e);
|
|
2168
2191
|
return t.current = e, t;
|
|
2169
|
-
},
|
|
2170
|
-
const o = T(
|
|
2192
|
+
}, Qi = (e, t, n) => {
|
|
2193
|
+
const o = T(zt), r = T(Gt), s = T(_e), [i, c] = V(), [l, g] = V(-1), [m, h] = V(!0), d = nt(m), u = z(t);
|
|
2171
2194
|
u.current = t;
|
|
2172
2195
|
const a = () => {
|
|
2173
2196
|
c(void 0), g(-1), h(!1);
|
|
2174
2197
|
};
|
|
2175
|
-
return
|
|
2198
|
+
return L(() => {
|
|
2176
2199
|
const v = s.sequenceNodesBuilder(t.slice(1));
|
|
2177
2200
|
o.setSequenceNodes(v != null ? v : []);
|
|
2178
|
-
}, [t]),
|
|
2201
|
+
}, [t]), L(() => {
|
|
2179
2202
|
if (n && e) {
|
|
2180
|
-
const v = n.selectionChange$.pipe(
|
|
2203
|
+
const v = n.selectionChange$.pipe(gn(50)).subscribe((S) => {
|
|
2181
2204
|
if (S.textRanges.length === 1) {
|
|
2182
2205
|
const [C] = S.textRanges;
|
|
2183
2206
|
if (C.collapsed && d.current) {
|
|
@@ -2199,9 +2222,9 @@ const tt = (e) => {
|
|
|
2199
2222
|
}
|
|
2200
2223
|
c(void 0), g(-1);
|
|
2201
2224
|
}), p = n.selectionChange$.pipe(
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2225
|
+
pr((S) => S.textRanges.length === 1),
|
|
2226
|
+
gr((S) => S.textRanges[0].startOffset),
|
|
2227
|
+
Zo()
|
|
2205
2228
|
).subscribe(() => {
|
|
2206
2229
|
h(!0);
|
|
2207
2230
|
});
|
|
@@ -2209,21 +2232,21 @@ const tt = (e) => {
|
|
|
2209
2232
|
v.unsubscribe(), p.unsubscribe();
|
|
2210
2233
|
};
|
|
2211
2234
|
}
|
|
2212
|
-
}, [n, e]),
|
|
2235
|
+
}, [n, e]), L(() => {
|
|
2213
2236
|
e || a();
|
|
2214
2237
|
}, [e]), {
|
|
2215
2238
|
functionInfo: i,
|
|
2216
2239
|
paramIndex: l,
|
|
2217
2240
|
reset: a
|
|
2218
2241
|
};
|
|
2219
|
-
},
|
|
2242
|
+
}, Ji = ({ onClick: e }) => /* @__PURE__ */ M(
|
|
2220
2243
|
"div",
|
|
2221
2244
|
{
|
|
2222
2245
|
className: "univer-z-[15] univer-box-border univer-h-[18px] univer-cursor-pointer univer-overflow-visible univer-whitespace-nowrap univer-rounded-l univer-border univer-border-r-0 univer-border-gray-600 univer-bg-primary-600 univer-p-0.5 univer-text-xs univer-font-bold univer-leading-[13px] univer-text-white",
|
|
2223
2246
|
onClick: e,
|
|
2224
2247
|
children: "?"
|
|
2225
2248
|
}
|
|
2226
|
-
),
|
|
2249
|
+
), nn = ({ className: e, title: t, value: n }) => /* @__PURE__ */ H("div", { className: "univer-my-2", children: [
|
|
2227
2250
|
/* @__PURE__ */ M(
|
|
2228
2251
|
"div",
|
|
2229
2252
|
{
|
|
@@ -2238,30 +2261,30 @@ const tt = (e) => {
|
|
|
2238
2261
|
children: n
|
|
2239
2262
|
}
|
|
2240
2263
|
)
|
|
2241
|
-
] }),
|
|
2264
|
+
] }), ec = (e) => {
|
|
2242
2265
|
const { prefix: t, value: n, active: o, onClick: r } = e;
|
|
2243
|
-
return /* @__PURE__ */
|
|
2244
|
-
/* @__PURE__ */
|
|
2266
|
+
return /* @__PURE__ */ H("div", { children: [
|
|
2267
|
+
/* @__PURE__ */ H("span", { children: [
|
|
2245
2268
|
t,
|
|
2246
2269
|
"("
|
|
2247
2270
|
] }),
|
|
2248
|
-
n && n.map((s, i) => /* @__PURE__ */
|
|
2271
|
+
n && n.map((s, i) => /* @__PURE__ */ H("span", { children: [
|
|
2249
2272
|
/* @__PURE__ */ M(
|
|
2250
2273
|
"span",
|
|
2251
2274
|
{
|
|
2252
2275
|
className: o === i ? "univer-text-primary-500" : "",
|
|
2253
2276
|
onClick: () => r(i),
|
|
2254
|
-
children:
|
|
2277
|
+
children: xr(s)
|
|
2255
2278
|
}
|
|
2256
2279
|
),
|
|
2257
2280
|
i === n.length - 1 ? "" : ","
|
|
2258
2281
|
] }, s.name)),
|
|
2259
2282
|
")"
|
|
2260
2283
|
] });
|
|
2261
|
-
},
|
|
2284
|
+
}, Jn = () => {
|
|
2262
2285
|
};
|
|
2263
|
-
function
|
|
2264
|
-
const { onParamsSwitch: t =
|
|
2286
|
+
function tc(e) {
|
|
2287
|
+
const { onParamsSwitch: t = Jn, onClose: n = Jn, isFocus: o, editor: r, formulaText: s } = e, { functionInfo: i, paramIndex: c, reset: l } = Qi(o, s, r), g = T(fn), m = !Se(g.helpFunctionVisible$), [h, d] = V(!0), u = T(dt), a = u.t("formula.prompt.required"), v = u.t("formula.prompt.optional"), p = r.getEditorId(), [S] = Vr(p, !!i, [i, c]);
|
|
2265
2288
|
function C(f) {
|
|
2266
2289
|
t && t(f);
|
|
2267
2290
|
}
|
|
@@ -2270,18 +2293,18 @@ function zi(e) {
|
|
|
2270
2293
|
}), E = () => {
|
|
2271
2294
|
_(!0), n();
|
|
2272
2295
|
};
|
|
2273
|
-
return i ? m ? /* @__PURE__ */ M(
|
|
2296
|
+
return i ? m ? /* @__PURE__ */ M(on, { portal: !0, anchorRect$: S, direction: "left-center", children: /* @__PURE__ */ M(Ji, { onClick: () => _(!1) }) }, "hidden") : /* @__PURE__ */ M(on, { portal: !0, onClickOutside: () => l(), anchorRect$: S, direction: "vertical", children: /* @__PURE__ */ H(
|
|
2274
2297
|
"div",
|
|
2275
2298
|
{
|
|
2276
|
-
className: re("univer-m-0 univer-box-border univer-w-[250px] univer-select-none univer-list-none univer-rounded-lg univer-bg-white univer-leading-5 univer-shadow-md univer-outline-none dark:!univer-bg-gray-900",
|
|
2299
|
+
className: re("univer-m-0 univer-box-border univer-w-[250px] univer-select-none univer-list-none univer-rounded-lg univer-bg-white univer-leading-5 univer-shadow-md univer-outline-none dark:!univer-bg-gray-900", Cn),
|
|
2277
2300
|
children: [
|
|
2278
|
-
/* @__PURE__ */
|
|
2301
|
+
/* @__PURE__ */ H(
|
|
2279
2302
|
"div",
|
|
2280
2303
|
{
|
|
2281
|
-
className: re("univer-wrap-anywhere univer-box-border univer-flex univer-items-center univer-justify-between univer-px-4 univer-py-3 univer-text-xs univer-font-medium univer-text-gray-900 dark:!univer-text-white",
|
|
2304
|
+
className: re("univer-wrap-anywhere univer-box-border univer-flex univer-items-center univer-justify-between univer-px-4 univer-py-3 univer-text-xs univer-font-medium univer-text-gray-900 dark:!univer-text-white", Ts),
|
|
2282
2305
|
children: [
|
|
2283
2306
|
/* @__PURE__ */ M(
|
|
2284
|
-
|
|
2307
|
+
ec,
|
|
2285
2308
|
{
|
|
2286
2309
|
prefix: i.functionName,
|
|
2287
2310
|
value: i.functionParameter,
|
|
@@ -2289,14 +2312,14 @@ function zi(e) {
|
|
|
2289
2312
|
onClick: C
|
|
2290
2313
|
}
|
|
2291
2314
|
),
|
|
2292
|
-
/* @__PURE__ */
|
|
2315
|
+
/* @__PURE__ */ H("div", { className: "univer-flex", children: [
|
|
2293
2316
|
/* @__PURE__ */ M(
|
|
2294
2317
|
"div",
|
|
2295
2318
|
{
|
|
2296
2319
|
className: "univer-ml-2 univer-flex univer-h-6 univer-w-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-bg-transparent univer-p-0 univer-text-xs univer-text-gray-500 univer-outline-none univer-transition-colors hover:univer-bg-gray-200 dark:hover:!univer-bg-gray-600",
|
|
2297
2320
|
style: { transform: h ? "rotateZ(-90deg)" : "rotateZ(90deg)" },
|
|
2298
2321
|
onClick: () => d(!h),
|
|
2299
|
-
children: /* @__PURE__ */ M(
|
|
2322
|
+
children: /* @__PURE__ */ M($r, {})
|
|
2300
2323
|
}
|
|
2301
2324
|
),
|
|
2302
2325
|
/* @__PURE__ */ M(
|
|
@@ -2304,7 +2327,7 @@ function zi(e) {
|
|
|
2304
2327
|
{
|
|
2305
2328
|
className: "univer-ml-2 univer-flex univer-h-6 univer-w-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-bg-transparent univer-p-0 univer-text-xs univer-text-gray-600 univer-outline-none univer-transition-colors hover:univer-bg-gray-300 dark:!univer-text-gray-200 dark:hover:!univer-bg-gray-600",
|
|
2306
2329
|
onClick: E,
|
|
2307
|
-
children: /* @__PURE__ */ M(
|
|
2330
|
+
children: /* @__PURE__ */ M(Ar, {})
|
|
2308
2331
|
}
|
|
2309
2332
|
)
|
|
2310
2333
|
] })
|
|
@@ -2314,28 +2337,28 @@ function zi(e) {
|
|
|
2314
2337
|
/* @__PURE__ */ M(
|
|
2315
2338
|
"div",
|
|
2316
2339
|
{
|
|
2317
|
-
className: re("univer-box-border univer-max-h-[350px] univer-overflow-y-auto univer-px-4 univer-pb-3 univer-pt-0",
|
|
2340
|
+
className: re("univer-box-border univer-max-h-[350px] univer-overflow-y-auto univer-px-4 univer-pb-3 univer-pt-0", ut),
|
|
2318
2341
|
style: {
|
|
2319
2342
|
height: h ? "unset" : 0,
|
|
2320
2343
|
padding: h ? "revert-layer" : 0
|
|
2321
2344
|
},
|
|
2322
|
-
children: /* @__PURE__ */
|
|
2345
|
+
children: /* @__PURE__ */ H("div", { className: "univer-mt-3", children: [
|
|
2323
2346
|
/* @__PURE__ */ M(
|
|
2324
|
-
|
|
2347
|
+
nn,
|
|
2325
2348
|
{
|
|
2326
2349
|
title: u.t("formula.prompt.helpExample"),
|
|
2327
2350
|
value: `${i.functionName}(${i.functionParameter.map((f) => f.example).join(",")})`
|
|
2328
2351
|
}
|
|
2329
2352
|
),
|
|
2330
2353
|
/* @__PURE__ */ M(
|
|
2331
|
-
|
|
2354
|
+
nn,
|
|
2332
2355
|
{
|
|
2333
2356
|
title: u.t("formula.prompt.helpAbstract"),
|
|
2334
2357
|
value: i.description
|
|
2335
2358
|
}
|
|
2336
2359
|
),
|
|
2337
2360
|
i && i.functionParameter && i.functionParameter.map((f, b) => /* @__PURE__ */ M(
|
|
2338
|
-
|
|
2361
|
+
nn,
|
|
2339
2362
|
{
|
|
2340
2363
|
className: c === b ? "univer-text-primary-500" : "",
|
|
2341
2364
|
title: f.name,
|
|
@@ -2350,14 +2373,14 @@ function zi(e) {
|
|
|
2350
2373
|
}
|
|
2351
2374
|
) }, "show") : null;
|
|
2352
2375
|
}
|
|
2353
|
-
const
|
|
2354
|
-
const t = T(
|
|
2376
|
+
const nc = (e) => {
|
|
2377
|
+
const t = T(Ge);
|
|
2355
2378
|
return te((o) => {
|
|
2356
2379
|
var r, s;
|
|
2357
2380
|
if (e) {
|
|
2358
2381
|
t.focus(e.getEditorId());
|
|
2359
2382
|
const i = [...e.getSelectionRanges()];
|
|
2360
|
-
if (
|
|
2383
|
+
if (dn.isDefine(o))
|
|
2361
2384
|
e.setSelectionRanges([{ startOffset: o, endOffset: o }]);
|
|
2362
2385
|
else if (!i.length && !e.docSelectionRenderService.isOnPointerEvent) {
|
|
2363
2386
|
const c = (s = (r = e.getDocumentData().body) == null ? void 0 : r.dataStream) != null ? s : `\r
|
|
@@ -2368,41 +2391,41 @@ const Xi = (e) => {
|
|
|
2368
2391
|
}
|
|
2369
2392
|
});
|
|
2370
2393
|
};
|
|
2371
|
-
function
|
|
2394
|
+
function rc(e) {
|
|
2372
2395
|
var r, s;
|
|
2373
2396
|
const n = e.get(ne).getCurrentUniverDocInstance();
|
|
2374
2397
|
return n != null && n.getBody() ? { dataStream: (s = (r = n.getBody()) == null ? void 0 : r.dataStream) != null ? s : "", offset: 0 } : void 0;
|
|
2375
2398
|
}
|
|
2376
|
-
var
|
|
2377
|
-
function
|
|
2399
|
+
var Ne = /* @__PURE__ */ ((e) => (e[e.NOT_SELECT = 0] = "NOT_SELECT", e[e.NEED_ADD = 1] = "NEED_ADD", e[e.CAN_EDIT = 2] = "CAN_EDIT", e[e.EDIT_OTHER_SHEET_REFERENCE = 3] = "EDIT_OTHER_SHEET_REFERENCE", e[e.EDIT_OTHER_WORKBOOK_REFERENCE = 4] = "EDIT_OTHER_WORKBOOK_REFERENCE", e))(Ne || {});
|
|
2400
|
+
function oc(e) {
|
|
2378
2401
|
var y;
|
|
2379
|
-
const { editorId: t, isFocus: n, disableOnClick: o, unitId: r, subUnitId: s } = e, i = T(
|
|
2402
|
+
const { editorId: t, isFocus: n, disableOnClick: o, unitId: r, subUnitId: s } = e, i = T(Re), c = T(ne), l = i.getRenderById(r), g = i.getRenderById(t), m = g == null ? void 0 : g.with(Sr), h = T(Er), d = T(Rt), [u, a] = V(
|
|
2380
2403
|
0
|
|
2381
2404
|
/* NOT_SELECT */
|
|
2382
|
-
), v = T(_e), p = z(!0), S = l == null ? void 0 : l.with(De), C =
|
|
2405
|
+
), v = T(_e), p = z(!0), S = l == null ? void 0 : l.with(De), C = nt(u), _ = c.getUnit(r, W.UNIVER_SHEET), E = _ == null ? void 0 : _.getSheetBySheetId(s), f = te((A) => {
|
|
2383
2406
|
S && S.setSkipLastEnabled(
|
|
2384
2407
|
A === 1 || A === 3 || A === 4
|
|
2385
2408
|
/* EDIT_OTHER_WORKBOOK_REFERENCE */
|
|
2386
2409
|
), C.current = A, a(A);
|
|
2387
2410
|
}), b = te(() => {
|
|
2388
2411
|
var ce, ae, he;
|
|
2389
|
-
const A = c.getCurrentUnitOfType(
|
|
2412
|
+
const A = c.getCurrentUnitOfType(W.UNIVER_SHEET);
|
|
2390
2413
|
if (!A) return;
|
|
2391
|
-
const F = A.getActiveSheet(), N = m == null ? void 0 : m.getActiveTextRange(), O = N != null && N.collapsed ? N.startOffset : -1, k =
|
|
2414
|
+
const F = A.getActiveSheet(), N = m == null ? void 0 : m.getActiveTextRange(), O = N != null && N.collapsed ? N.startOffset : -1, k = rc(d);
|
|
2392
2415
|
if (!k) return;
|
|
2393
2416
|
const I = (ce = k == null ? void 0 : k.dataStream) == null ? void 0 : ce.slice(0, -2), x = ((ae = v.sequenceNodesBuilder(I)) != null ? ae : []).map((K) => typeof K == "object" ? K.nodeType === Q.REFERENCE ? {
|
|
2394
2417
|
...K,
|
|
2395
|
-
range:
|
|
2418
|
+
range: Po(K.token)
|
|
2396
2419
|
} : {
|
|
2397
2420
|
...K,
|
|
2398
2421
|
range: void 0
|
|
2399
|
-
} : K), R = I[O - 1], w = I[O], D = x.find((K) => typeof K == "object" && K.nodeType === Q.REFERENCE && O === K.endIndex + 2), U = R &&
|
|
2422
|
+
} : K), R = I[O - 1], w = I[O], D = x.find((K) => typeof K == "object" && K.nodeType === Q.REFERENCE && O === K.endIndex + 2), U = R && Uo(R) && (!w || Vo(w) && w !== je.OPEN_BRACKET), B = !!D;
|
|
2400
2423
|
if ((I == null ? void 0 : I.substring(0, 1)) === "=" && (U || B))
|
|
2401
2424
|
if (B) {
|
|
2402
2425
|
if (p.current)
|
|
2403
2426
|
return;
|
|
2404
|
-
const { sheetName: K, unitId: J } = D.range,
|
|
2405
|
-
J && J !==
|
|
2427
|
+
const { sheetName: K, unitId: J } = D.range, rt = (he = c.getCurrentUnitOfType(W.UNIVER_SHEET)) == null ? void 0 : he.getUnitId();
|
|
2428
|
+
J && J !== rt ? f(
|
|
2406
2429
|
4
|
|
2407
2430
|
/* EDIT_OTHER_WORKBOOK_REFERENCE */
|
|
2408
2431
|
) : !K && F.getSheetId() === (E == null ? void 0 : E.getSheetId()) || K === F.getName() ? f(
|
|
@@ -2423,17 +2446,17 @@ function Ji(e) {
|
|
|
2423
2446
|
/* NOT_SELECT */
|
|
2424
2447
|
);
|
|
2425
2448
|
});
|
|
2426
|
-
return
|
|
2427
|
-
const A = h.textSelection$.pipe(
|
|
2449
|
+
return L(() => {
|
|
2450
|
+
const A = h.textSelection$.pipe(pr((F) => F.unitId === t)).subscribe(() => {
|
|
2428
2451
|
b();
|
|
2429
2452
|
});
|
|
2430
2453
|
return () => A.unsubscribe();
|
|
2431
|
-
}, [b, h.textSelection$, t]),
|
|
2454
|
+
}, [b, h.textSelection$, t]), L(() => {
|
|
2432
2455
|
n || (f(
|
|
2433
2456
|
0
|
|
2434
2457
|
/* NOT_SELECT */
|
|
2435
2458
|
), p.current = !0);
|
|
2436
|
-
}, [n, f]),
|
|
2459
|
+
}, [n, f]), L(() => {
|
|
2437
2460
|
var F;
|
|
2438
2461
|
if (!o) return;
|
|
2439
2462
|
const A = (F = g == null ? void 0 : g.mainComponent) == null ? void 0 : F.onPointerDown$.subscribeEvent(() => {
|
|
@@ -2443,11 +2466,11 @@ function Ji(e) {
|
|
|
2443
2466
|
), p.current = !0;
|
|
2444
2467
|
});
|
|
2445
2468
|
return () => A == null ? void 0 : A.unsubscribe();
|
|
2446
|
-
}, [o, (y = g == null ? void 0 : g.mainComponent) == null ? void 0 : y.onPointerDown$, f]),
|
|
2469
|
+
}, [o, (y = g == null ? void 0 : g.mainComponent) == null ? void 0 : y.onPointerDown$, f]), L(() => {
|
|
2447
2470
|
if (!n) return;
|
|
2448
2471
|
const A = _ == null ? void 0 : _.activeSheet$.subscribe(() => {
|
|
2449
2472
|
b();
|
|
2450
|
-
}), F = c.getCurrentTypeOfUnit$(
|
|
2473
|
+
}), F = c.getCurrentTypeOfUnit$(W.UNIVER_SHEET).subscribe(() => {
|
|
2451
2474
|
b();
|
|
2452
2475
|
});
|
|
2453
2476
|
return () => {
|
|
@@ -2455,12 +2478,12 @@ function Ji(e) {
|
|
|
2455
2478
|
};
|
|
2456
2479
|
}, [b, n, _ == null ? void 0 : _.activeSheet$, c.getCurrentTypeOfUnit$]), { isSelecting: u, isSelectingRef: C };
|
|
2457
2480
|
}
|
|
2458
|
-
const
|
|
2481
|
+
const sc = () => {
|
|
2459
2482
|
const e = T(_e);
|
|
2460
|
-
return
|
|
2483
|
+
return $t((n) => e.sequenceNodesBuilder(n) || [], [e]);
|
|
2461
2484
|
};
|
|
2462
|
-
function
|
|
2463
|
-
const o = new
|
|
2485
|
+
function ic(e, t, n) {
|
|
2486
|
+
const o = new hn(t).setAlpha(0.05).toRgbString();
|
|
2464
2487
|
return {
|
|
2465
2488
|
id: n,
|
|
2466
2489
|
strokeWidth: 1,
|
|
@@ -2472,7 +2495,7 @@ function tc(e, t, n) {
|
|
|
2472
2495
|
widgetStroke: e.getColorFromTheme("white")
|
|
2473
2496
|
};
|
|
2474
2497
|
}
|
|
2475
|
-
function
|
|
2498
|
+
function Wr(e) {
|
|
2476
2499
|
var _, E, f;
|
|
2477
2500
|
const {
|
|
2478
2501
|
unitId: t,
|
|
@@ -2485,7 +2508,7 @@ function Ur(e) {
|
|
|
2485
2508
|
sheetSkeletonManagerService: l,
|
|
2486
2509
|
themeService: g,
|
|
2487
2510
|
univerInstanceService: m
|
|
2488
|
-
} = e, h = o.getUnitId(), d = m.getUnit(t,
|
|
2511
|
+
} = e, h = o.getUnitId(), d = m.getUnit(t, W.UNIVER_SHEET), u = d == null ? void 0 : d.getActiveSheet(), a = [];
|
|
2489
2512
|
if (!d || !u) {
|
|
2490
2513
|
i.setSelections(a);
|
|
2491
2514
|
return;
|
|
@@ -2500,11 +2523,11 @@ function Ur(e) {
|
|
|
2500
2523
|
const A = r[b], { themeColor: F, token: N, refIndex: O, endIndex: k } = A, I = ht(N), { unitId: x, sheetName: R, range: w } = I, D = p(R);
|
|
2501
2524
|
if (!D && R || h !== t && x !== h || x && x !== h || D && D !== v || !D && v !== n)
|
|
2502
2525
|
continue;
|
|
2503
|
-
const U =
|
|
2526
|
+
const U = us(w, u.getRowCount(), u.getColumnCount());
|
|
2504
2527
|
U.unitId = t, U.sheetId = v, a.push({
|
|
2505
2528
|
range: U,
|
|
2506
2529
|
primary: null,
|
|
2507
|
-
style:
|
|
2530
|
+
style: ic(g, F, O.toString())
|
|
2508
2531
|
}), C.push(k);
|
|
2509
2532
|
}
|
|
2510
2533
|
if (s) {
|
|
@@ -2513,11 +2536,11 @@ function Ur(e) {
|
|
|
2513
2536
|
}
|
|
2514
2537
|
return a;
|
|
2515
2538
|
}
|
|
2516
|
-
function
|
|
2517
|
-
const n = T(ne), o = T(It), r = T(
|
|
2518
|
-
const u = n.getCurrentUnitOfType(
|
|
2539
|
+
function cc(e, t) {
|
|
2540
|
+
const n = T(ne), o = T(It), r = T(Yt), s = T(Re), i = Se(ie(() => n.getCurrentTypeOfUnit$(W.UNIVER_SHEET), [n])), c = i ? s.getRenderById(i.getUnitId()) : null, l = c == null ? void 0 : c.with(De), g = c == null ? void 0 : c.with(Et), m = te((h, d) => {
|
|
2541
|
+
const u = n.getCurrentUnitOfType(W.UNIVER_SHEET);
|
|
2519
2542
|
if (!u || l != null && l.selectionMoving) return;
|
|
2520
|
-
const a =
|
|
2543
|
+
const a = Wr({
|
|
2521
2544
|
unitId: e,
|
|
2522
2545
|
subUnitId: t,
|
|
2523
2546
|
currentWorkbook: u,
|
|
@@ -2532,12 +2555,12 @@ function nc(e, t) {
|
|
|
2532
2555
|
if (!a) return;
|
|
2533
2556
|
((l == null ? void 0 : l.getSelectionControls()) || []).length === a.length ? l == null || l.resetSelectionsByModelData(a) : r.setSelections(a);
|
|
2534
2557
|
});
|
|
2535
|
-
return
|
|
2558
|
+
return L(() => () => {
|
|
2536
2559
|
l == null || l.resetActiveSelectionIndex();
|
|
2537
2560
|
}, [l]), m;
|
|
2538
2561
|
}
|
|
2539
|
-
function
|
|
2540
|
-
const t = T(
|
|
2562
|
+
function Hr(e = "") {
|
|
2563
|
+
const t = T(Gt), n = ac(), o = T(me), r = ie(() => e.length, [e]);
|
|
2541
2564
|
return te((i, c, l = !0, g) => {
|
|
2542
2565
|
const m = i.getDocumentData(), h = i.getEditorId();
|
|
2543
2566
|
if (!m)
|
|
@@ -2548,12 +2571,12 @@ function Vr(e = "") {
|
|
|
2548
2571
|
const u = d.dataStream.slice(0, d.dataStream.length - 2), a = { dataStream: "", ...m.body };
|
|
2549
2572
|
if (!u.startsWith(e)) return [];
|
|
2550
2573
|
if (c == null || c.length === 0)
|
|
2551
|
-
return a.textRuns = [], o.syncExecuteCommand(
|
|
2574
|
+
return a.textRuns = [], o.syncExecuteCommand(Wn.id, {
|
|
2552
2575
|
unitId: h,
|
|
2553
|
-
body:
|
|
2576
|
+
body: kn(a, 0, a.dataStream.length - 2)
|
|
2554
2577
|
}), [];
|
|
2555
2578
|
{
|
|
2556
|
-
const { textRuns: v, refSelections: p } =
|
|
2579
|
+
const { textRuns: v, refSelections: p } = lc(t, n, c);
|
|
2557
2580
|
r && v.forEach((_) => {
|
|
2558
2581
|
_.ed = _.ed + r, _.st = _.st + r;
|
|
2559
2582
|
}), a.textRuns = [{ st: 0, ed: 1, ts: { fs: 11 } }, ...v];
|
|
@@ -2568,15 +2591,15 @@ function Vr(e = "") {
|
|
|
2568
2591
|
E.startOffset = Math.max(0, Math.min(E.startOffset, _)), E.endOffset = Math.max(0, Math.min(E.endOffset, _));
|
|
2569
2592
|
});
|
|
2570
2593
|
}
|
|
2571
|
-
return o.syncExecuteCommand(
|
|
2594
|
+
return o.syncExecuteCommand(Wn.id, {
|
|
2572
2595
|
unitId: h,
|
|
2573
|
-
body:
|
|
2596
|
+
body: kn(a, 0, a.dataStream.length - 2),
|
|
2574
2597
|
textRanges: g != null ? g : C
|
|
2575
2598
|
}), p;
|
|
2576
2599
|
}
|
|
2577
2600
|
});
|
|
2578
2601
|
}
|
|
2579
|
-
function
|
|
2602
|
+
function ac() {
|
|
2580
2603
|
const e = T(It), t = e.getCurrentTheme();
|
|
2581
2604
|
return ie(() => {
|
|
2582
2605
|
const o = [
|
|
@@ -2596,7 +2619,7 @@ function rc() {
|
|
|
2596
2619
|
return { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: i };
|
|
2597
2620
|
}, [t]);
|
|
2598
2621
|
}
|
|
2599
|
-
function
|
|
2622
|
+
function lc(e, t, n) {
|
|
2600
2623
|
const { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: i } = t, c = [], l = [], g = /* @__PURE__ */ new Map();
|
|
2601
2624
|
let m = 0;
|
|
2602
2625
|
for (let h = 0, d = n.length; h < d; h++) {
|
|
@@ -2668,11 +2691,11 @@ function oc(e, t, n) {
|
|
|
2668
2691
|
}
|
|
2669
2692
|
return { textRuns: c, refSelections: l };
|
|
2670
2693
|
}
|
|
2671
|
-
const
|
|
2672
|
-
const r = T(me), s = T(
|
|
2694
|
+
const uc = (e, t, n, o) => {
|
|
2695
|
+
const r = T(me), s = T(Zt), i = z(t);
|
|
2673
2696
|
i.current = t;
|
|
2674
2697
|
const c = z(o);
|
|
2675
|
-
c.current = o,
|
|
2698
|
+
c.current = o, L(() => {
|
|
2676
2699
|
if (!n || !e)
|
|
2677
2700
|
return;
|
|
2678
2701
|
const g = `sheet.formula-embedding-editor.${n.getEditorId()}`, m = new qe(), h = (a, v) => {
|
|
@@ -2681,62 +2704,62 @@ const sc = (e, t, n, o) => {
|
|
|
2681
2704
|
return;
|
|
2682
2705
|
}
|
|
2683
2706
|
let p = de.LEFT;
|
|
2684
|
-
a ===
|
|
2707
|
+
a === $.ARROW_DOWN ? p = de.DOWN : a === $.ARROW_UP ? p = de.UP : a === $.ARROW_RIGHT && (p = de.RIGHT), v === P.SHIFT ? r.executeCommand(Xo.id, {
|
|
2685
2708
|
direction: p
|
|
2686
|
-
}) : r.executeCommand(
|
|
2709
|
+
}) : r.executeCommand(Qo.id, {
|
|
2687
2710
|
direction: p
|
|
2688
2711
|
});
|
|
2689
2712
|
}, d = (a, v) => {
|
|
2690
2713
|
let p = de.DOWN;
|
|
2691
|
-
a ===
|
|
2714
|
+
a === $.ARROW_DOWN ? p = de.DOWN : a === $.ARROW_UP ? p = de.UP : a === $.ARROW_LEFT ? p = de.LEFT : a === $.ARROW_RIGHT && (p = de.RIGHT), i.current ? v === P.CTRL_COMMAND ? r.executeCommand(Ln.id, {
|
|
2692
2715
|
direction: p,
|
|
2693
|
-
jumpOver:
|
|
2716
|
+
jumpOver: Pn.moveGap,
|
|
2694
2717
|
extra: "formula-editor",
|
|
2695
|
-
fromCurrentSelection: i.current ===
|
|
2696
|
-
}) : v === P.SHIFT ? r.executeCommand(
|
|
2718
|
+
fromCurrentSelection: i.current === Ne.NEED_ADD || i.current === Ne.EDIT_OTHER_SHEET_REFERENCE
|
|
2719
|
+
}) : v === P.SHIFT ? r.executeCommand(Un.id, {
|
|
2697
2720
|
direction: p,
|
|
2698
2721
|
extra: "formula-editor"
|
|
2699
|
-
}) : v === (P.CTRL_COMMAND | P.SHIFT) ? r.executeCommand(
|
|
2722
|
+
}) : v === (P.CTRL_COMMAND | P.SHIFT) ? r.executeCommand(Un.id, {
|
|
2700
2723
|
direction: p,
|
|
2701
|
-
jumpOver:
|
|
2724
|
+
jumpOver: Pn.moveGap,
|
|
2702
2725
|
extra: "formula-editor"
|
|
2703
|
-
}) : r.executeCommand(
|
|
2726
|
+
}) : r.executeCommand(Ln.id, {
|
|
2704
2727
|
direction: p,
|
|
2705
2728
|
extra: "formula-editor",
|
|
2706
|
-
fromCurrentSelection: i.current ===
|
|
2729
|
+
fromCurrentSelection: i.current === Ne.NEED_ADD || i.current === Ne.EDIT_OTHER_SHEET_REFERENCE
|
|
2707
2730
|
}) : h(a, v);
|
|
2708
2731
|
};
|
|
2709
2732
|
return m.add(r.registerCommand({
|
|
2710
2733
|
id: g,
|
|
2711
|
-
type:
|
|
2734
|
+
type: Oe.OPERATION,
|
|
2712
2735
|
handler(a, v) {
|
|
2713
2736
|
const { keyCode: p, metaKey: S } = v;
|
|
2714
2737
|
d(p, S);
|
|
2715
2738
|
}
|
|
2716
2739
|
})), [
|
|
2717
|
-
{ keyCode:
|
|
2718
|
-
{ keyCode:
|
|
2719
|
-
{ keyCode:
|
|
2720
|
-
{ keyCode:
|
|
2721
|
-
{ keyCode:
|
|
2722
|
-
{ keyCode:
|
|
2723
|
-
{ keyCode:
|
|
2724
|
-
{ keyCode:
|
|
2725
|
-
{ keyCode:
|
|
2726
|
-
{ keyCode:
|
|
2727
|
-
{ keyCode:
|
|
2728
|
-
{ keyCode:
|
|
2729
|
-
{ keyCode:
|
|
2730
|
-
{ keyCode:
|
|
2731
|
-
{ keyCode:
|
|
2732
|
-
{ keyCode:
|
|
2740
|
+
{ keyCode: $.ARROW_DOWN },
|
|
2741
|
+
{ keyCode: $.ARROW_LEFT },
|
|
2742
|
+
{ keyCode: $.ARROW_RIGHT },
|
|
2743
|
+
{ keyCode: $.ARROW_UP },
|
|
2744
|
+
{ keyCode: $.ARROW_DOWN, metaKey: P.SHIFT },
|
|
2745
|
+
{ keyCode: $.ARROW_LEFT, metaKey: P.SHIFT },
|
|
2746
|
+
{ keyCode: $.ARROW_RIGHT, metaKey: P.SHIFT },
|
|
2747
|
+
{ keyCode: $.ARROW_UP, metaKey: P.SHIFT },
|
|
2748
|
+
{ keyCode: $.ARROW_DOWN, metaKey: P.CTRL_COMMAND },
|
|
2749
|
+
{ keyCode: $.ARROW_LEFT, metaKey: P.CTRL_COMMAND },
|
|
2750
|
+
{ keyCode: $.ARROW_RIGHT, metaKey: P.CTRL_COMMAND },
|
|
2751
|
+
{ keyCode: $.ARROW_UP, metaKey: P.CTRL_COMMAND },
|
|
2752
|
+
{ keyCode: $.ARROW_DOWN, metaKey: P.CTRL_COMMAND | P.SHIFT },
|
|
2753
|
+
{ keyCode: $.ARROW_LEFT, metaKey: P.CTRL_COMMAND | P.SHIFT },
|
|
2754
|
+
{ keyCode: $.ARROW_RIGHT, metaKey: P.CTRL_COMMAND | P.SHIFT },
|
|
2755
|
+
{ keyCode: $.ARROW_UP, metaKey: P.CTRL_COMMAND | P.SHIFT }
|
|
2733
2756
|
].map(({ keyCode: a, metaKey: v }) => ({
|
|
2734
2757
|
id: g,
|
|
2735
2758
|
binding: v ? a | v : a,
|
|
2736
2759
|
preconditions: () => !0,
|
|
2737
2760
|
priority: 900,
|
|
2738
2761
|
staticParameters: {
|
|
2739
|
-
eventType:
|
|
2762
|
+
eventType: xe.Keyboard,
|
|
2740
2763
|
keyCode: a,
|
|
2741
2764
|
metaKey: v
|
|
2742
2765
|
}
|
|
@@ -2746,88 +2769,88 @@ const sc = (e, t, n, o) => {
|
|
|
2746
2769
|
m.dispose();
|
|
2747
2770
|
};
|
|
2748
2771
|
}, [r, n, e, s]);
|
|
2749
|
-
},
|
|
2772
|
+
}, dc = (e, t, n, o, r = !0) => {
|
|
2750
2773
|
var u;
|
|
2751
|
-
const s = T(
|
|
2774
|
+
const s = T(Re), i = T(ln), c = T(Cs), l = T(Yt), g = T(ne), m = Se(ie(() => g.getCurrentTypeOfUnit$(W.UNIVER_SHEET), [g])), h = s.getRenderById((u = m == null ? void 0 : m.getUnitId()) != null ? u : ""), d = h == null ? void 0 : h.with(De);
|
|
2752
2775
|
Lt(() => {
|
|
2753
2776
|
if (e)
|
|
2754
|
-
return i.setContextValue(
|
|
2755
|
-
const a = g.getCurrentUnitOfType(
|
|
2756
|
-
(a == null ? void 0 : a.getUnitId()) === o && i.setContextValue(
|
|
2777
|
+
return i.setContextValue(An, !0), r && c.disable(), () => {
|
|
2778
|
+
const a = g.getCurrentUnitOfType(W.UNIVER_DOC);
|
|
2779
|
+
(a == null ? void 0 : a.getUnitId()) === o && i.setContextValue(An, !1), r && c.enable(), l.clear();
|
|
2757
2780
|
};
|
|
2758
2781
|
}, [i, e, l, r, o]), Lt(() => {
|
|
2759
2782
|
if (e && t) {
|
|
2760
2783
|
const a = d == null ? void 0 : d.enableSelectionChanging();
|
|
2761
|
-
return i.setContextValue(
|
|
2762
|
-
i.setContextValue(
|
|
2784
|
+
return i.setContextValue(qn, !0), () => {
|
|
2785
|
+
i.setContextValue(qn, !1), a == null || a.dispose();
|
|
2763
2786
|
};
|
|
2764
2787
|
}
|
|
2765
|
-
}, [i, e, d, t]),
|
|
2788
|
+
}, [i, e, d, t]), L(() => {
|
|
2766
2789
|
e && (d == null || d.setSkipLastEnabled(!1));
|
|
2767
2790
|
}, [e, d]);
|
|
2768
|
-
},
|
|
2769
|
-
const o = T(ne), r = T(
|
|
2770
|
-
return
|
|
2791
|
+
}, hc = (e, t, n) => {
|
|
2792
|
+
const o = T(ne), r = T(mn);
|
|
2793
|
+
return $t(() => {
|
|
2771
2794
|
if (e) {
|
|
2772
|
-
const i = [...r.getWorkbookSelections(t).getSelectionsOfWorksheet(n)], c = o.getCurrentUnitForType(
|
|
2795
|
+
const i = [...r.getWorkbookSelections(t).getSelectionsOfWorksheet(n)], c = o.getCurrentUnitForType(W.UNIVER_SHEET), l = c == null ? void 0 : c.getActiveSheet();
|
|
2773
2796
|
(c == null ? void 0 : c.getUnitId()) !== t && o.setCurrentUnitForType(t), l && l.getSheetId() === n && r.setSelections(i);
|
|
2774
2797
|
}
|
|
2775
2798
|
}, [e, r, n, t, o]);
|
|
2776
|
-
},
|
|
2799
|
+
}, fc = (e) => e.reduce((t, n) => typeof n == "string" ? t + n.length : t + n.token.length, 0), an = (e) => e.map((t) => typeof t == "string" ? t : t.token).join(""), At = (e, t = !1, n = "", o = !1) => !t && !o ? e.map((r) => Ce(r.range)) : e.map((r) => o ? Wo(r) : r.sheetName !== "" && r.sheetName !== n ? Ct(r.sheetName, r.range) : Ce(r.range)), gc = (e) => {
|
|
2777
2800
|
var m, h, d;
|
|
2778
2801
|
const { editor: t, lexerTreeBuilder: n } = e, o = t == null ? void 0 : t.getSelectionRanges();
|
|
2779
2802
|
if ((o == null ? void 0 : o.length) !== 1)
|
|
2780
2803
|
return;
|
|
2781
2804
|
const s = o[0].startOffset - 1, i = ((h = (m = t == null ? void 0 : t.getDocumentData().body) == null ? void 0 : m.dataStream) != null ? h : `\r
|
|
2782
|
-
`).slice(0, -2), c = (d = n.sequenceNodesBuilder(i.slice(1))) != null ? d : [], l =
|
|
2805
|
+
`).slice(0, -2), c = (d = n.sequenceNodesBuilder(i.slice(1))) != null ? d : [], l = In(c, s, !1), g = Ur(c, l);
|
|
2783
2806
|
return {
|
|
2784
2807
|
nodeIndex: l,
|
|
2785
2808
|
updatingRefIndex: g,
|
|
2786
2809
|
sequenceNodes: c,
|
|
2787
2810
|
offset: s
|
|
2788
2811
|
};
|
|
2789
|
-
},
|
|
2790
|
-
}),
|
|
2812
|
+
}, mc = (() => {
|
|
2813
|
+
}), pc = (e, t, n, o, r, s, i, c, l, g = mc) => {
|
|
2791
2814
|
var O;
|
|
2792
|
-
const m = T(
|
|
2815
|
+
const m = T(Re), h = T(ne), d = T(me), u = T(Er), a = T(It), v = T(_e), p = h.getUnit(o), S = te((k, I) => {
|
|
2793
2816
|
var x, R, w;
|
|
2794
2817
|
return (w = (R = (x = h.getUnit(k)) == null ? void 0 : x.getSheetBySheetId(I)) == null ? void 0 : R.getName()) != null ? w : "";
|
|
2795
|
-
}), C = ie(() => S(o, r), [S, r, o]), _ = Se(p == null ? void 0 : p.activeSheet$), E =
|
|
2796
|
-
var B, ce, ae, he, K, J,
|
|
2797
|
-
const x =
|
|
2818
|
+
}), C = ie(() => S(o, r), [S, r, o]), _ = Se(p == null ? void 0 : p.activeSheet$), E = nt({ activeSheet: _, sheetName: C }), f = Se(ie(() => h.getCurrentTypeOfUnit$(W.UNIVER_SHEET), [h])), b = m.getRenderById((O = f == null ? void 0 : f.getUnitId()) != null ? O : ""), y = b == null ? void 0 : b.with(De), A = b == null ? void 0 : b.with(Et), F = T(Yt), N = te((k, I) => {
|
|
2819
|
+
var B, ce, ae, he, K, J, rt, ot, Tt, Ie;
|
|
2820
|
+
const x = gc({ editor: l, lexerTreeBuilder: v });
|
|
2798
2821
|
if (!x) return;
|
|
2799
2822
|
const { nodeIndex: R, updatingRefIndex: w, sequenceNodes: D, offset: U } = x;
|
|
2800
|
-
if (n.current ===
|
|
2823
|
+
if (n.current === Ne.NEED_ADD)
|
|
2801
2824
|
if (U !== 0) {
|
|
2802
2825
|
if (R === -1 && D.length)
|
|
2803
2826
|
return;
|
|
2804
|
-
const Y = k[k.length - 1], X = D.splice(R + 1),
|
|
2827
|
+
const Y = k[k.length - 1], X = D.splice(R + 1), Ee = (B = Y.sheetId) != null ? B : r, fe = {
|
|
2805
2828
|
range: Y,
|
|
2806
2829
|
unitId: (ce = Y.unitId) != null ? ce : f.getUnitId(),
|
|
2807
|
-
sheetName: S((ae = Y.unitId) != null ? ae : f.getUnitId(),
|
|
2808
|
-
}, ee =
|
|
2809
|
-
D.push({ token:
|
|
2810
|
-
const
|
|
2811
|
-
g(Me,
|
|
2830
|
+
sheetName: S((ae = Y.unitId) != null ? ae : f.getUnitId(), Ee)
|
|
2831
|
+
}, ee = Ee !== r, le = (f == null ? void 0 : f.getUnitId()) !== o, be = At([fe], i && (ee || le), C, le);
|
|
2832
|
+
D.push({ token: be[0], nodeType: Q.REFERENCE });
|
|
2833
|
+
const Le = [...D, ...X], Me = an(Le);
|
|
2834
|
+
g(Me, fc(D), I);
|
|
2812
2835
|
} else {
|
|
2813
|
-
const Y = k[k.length - 1], X = (he = Y.sheetId) != null ? he : r,
|
|
2836
|
+
const Y = k[k.length - 1], X = (he = Y.sheetId) != null ? he : r, Ee = {
|
|
2814
2837
|
range: Y,
|
|
2815
2838
|
unitId: (K = Y.unitId) != null ? K : f.getUnitId(),
|
|
2816
2839
|
sheetName: S((J = Y.unitId) != null ? J : f.getUnitId(), X)
|
|
2817
|
-
}, fe = X !== r, ee = (f == null ? void 0 : f.getUnitId()) !== o, le =
|
|
2840
|
+
}, fe = X !== r, ee = (f == null ? void 0 : f.getUnitId()) !== o, le = At([Ee], i && (fe || ee), C, ee);
|
|
2818
2841
|
D.unshift({ token: le[0], nodeType: Q.REFERENCE });
|
|
2819
|
-
const
|
|
2820
|
-
g(
|
|
2842
|
+
const be = an(D);
|
|
2843
|
+
g(be, le[0].length, I);
|
|
2821
2844
|
}
|
|
2822
|
-
else if (n.current ===
|
|
2845
|
+
else if (n.current === Ne.EDIT_OTHER_SHEET_REFERENCE || n.current === Ne.EDIT_OTHER_WORKBOOK_REFERENCE) {
|
|
2823
2846
|
const Y = k.pop();
|
|
2824
2847
|
if (!Y) return;
|
|
2825
2848
|
const X = D[R];
|
|
2826
2849
|
if (typeof X == "object" && X.nodeType === Q.REFERENCE) {
|
|
2827
|
-
const
|
|
2828
|
-
(f == null ? void 0 : f.getUnitId()) !== o ? X.token =
|
|
2829
|
-
const ee = U + (X.token.length -
|
|
2830
|
-
g(
|
|
2850
|
+
const Ee = X.token;
|
|
2851
|
+
(f == null ? void 0 : f.getUnitId()) !== o ? X.token = Ho((rt = f == null ? void 0 : f.getUnitId()) != null ? rt : "", C, Y) : X.token = C === (_ == null ? void 0 : _.getName()) ? Ce(Y) : Ct(_.getName(), Y);
|
|
2852
|
+
const ee = U + (X.token.length - Ee.length);
|
|
2853
|
+
g(Bo(D), ee, I);
|
|
2831
2854
|
}
|
|
2832
2855
|
} else {
|
|
2833
2856
|
const Y = [...k];
|
|
@@ -2836,8 +2859,8 @@ const sc = (e, t, n, o) => {
|
|
|
2836
2859
|
G && Y.splice(w, 0, G);
|
|
2837
2860
|
}
|
|
2838
2861
|
let X = 0;
|
|
2839
|
-
const
|
|
2840
|
-
var ge,
|
|
2862
|
+
const Ee = D.map((G) => {
|
|
2863
|
+
var ge, st, Pe, Ue;
|
|
2841
2864
|
if (typeof G == "string")
|
|
2842
2865
|
return G;
|
|
2843
2866
|
if (G.nodeType === Q.REFERENCE) {
|
|
@@ -2847,33 +2870,33 @@ const sc = (e, t, n, o) => {
|
|
|
2847
2870
|
const oe = Y[X];
|
|
2848
2871
|
if (X++, !oe)
|
|
2849
2872
|
return "";
|
|
2850
|
-
const
|
|
2873
|
+
const ye = (st = oe.sheetId) != null ? st : r, Nt = {
|
|
2851
2874
|
range: oe,
|
|
2852
2875
|
unitId: (Pe = oe.unitId) != null ? Pe : f.getUnitId(),
|
|
2853
|
-
sheetName: S((Ue = oe.unitId) != null ? Ue : f.getUnitId(),
|
|
2854
|
-
},
|
|
2855
|
-
return
|
|
2876
|
+
sheetName: S((Ue = oe.unitId) != null ? Ue : f.getUnitId(), ye)
|
|
2877
|
+
}, Ot = (f == null ? void 0 : f.getUnitId()) !== o;
|
|
2878
|
+
return At([Nt], i && (ye !== r || Ot), C, Ot)[0];
|
|
2856
2879
|
}
|
|
2857
2880
|
return G.token;
|
|
2858
2881
|
});
|
|
2859
2882
|
let fe = "", ee;
|
|
2860
|
-
|
|
2883
|
+
Ee.forEach((G, ge) => {
|
|
2861
2884
|
fe += G, ge === R && (ee = fe.length);
|
|
2862
2885
|
});
|
|
2863
2886
|
const le = [];
|
|
2864
2887
|
for (let G = X; G <= k.length - 1; G++) {
|
|
2865
|
-
const ge = k[G],
|
|
2888
|
+
const ge = k[G], st = (ot = ge.sheetId) != null ? ot : r, Pe = {
|
|
2866
2889
|
range: ge,
|
|
2867
|
-
unitId: (
|
|
2868
|
-
sheetName: S((
|
|
2869
|
-
}, Ue = (f == null ? void 0 : f.getUnitId()) !== o, oe =
|
|
2890
|
+
unitId: (Tt = ge.unitId) != null ? Tt : f.getUnitId(),
|
|
2891
|
+
sheetName: S((Ie = ge.unitId) != null ? Ie : f.getUnitId(), st)
|
|
2892
|
+
}, Ue = (f == null ? void 0 : f.getUnitId()) !== o, oe = At([Pe], i && (st !== r || Ue), C, Ue);
|
|
2870
2893
|
le.push(oe[0]);
|
|
2871
2894
|
}
|
|
2872
|
-
const
|
|
2895
|
+
const be = D[D.length - 1], Le = be && (typeof be == "string" ? !1 : be.nodeType === Q.REFERENCE), Me = `${fe}${le.length && Le ? "," : ""}${le.join(",")}`;
|
|
2873
2896
|
g(Me, !le.length && ee ? ee : Me.length, I);
|
|
2874
2897
|
}
|
|
2875
2898
|
});
|
|
2876
|
-
|
|
2899
|
+
L(() => {
|
|
2877
2900
|
if (y && e) {
|
|
2878
2901
|
let k = !0;
|
|
2879
2902
|
const I = (R, w) => {
|
|
@@ -2891,7 +2914,7 @@ const sc = (e, t, n, o) => {
|
|
|
2891
2914
|
x.dispose();
|
|
2892
2915
|
};
|
|
2893
2916
|
}
|
|
2894
|
-
}, [e, N, y]),
|
|
2917
|
+
}, [e, N, y]), L(() => {
|
|
2895
2918
|
if (t && y && l) {
|
|
2896
2919
|
const k = new qe(), I = () => {
|
|
2897
2920
|
k.dispose(), y.getSelectionControls().forEach((w, D) => {
|
|
@@ -2907,12 +2930,12 @@ const sc = (e, t, n, o) => {
|
|
|
2907
2930
|
})
|
|
2908
2931
|
);
|
|
2909
2932
|
});
|
|
2910
|
-
}, x =
|
|
2933
|
+
}, x = zo(
|
|
2911
2934
|
l.input$,
|
|
2912
2935
|
F.selectionSet$,
|
|
2913
2936
|
y.selectionMoveEnd$
|
|
2914
2937
|
).pipe(
|
|
2915
|
-
|
|
2938
|
+
xs(50)
|
|
2916
2939
|
).subscribe(() => {
|
|
2917
2940
|
I();
|
|
2918
2941
|
});
|
|
@@ -2920,17 +2943,17 @@ const sc = (e, t, n, o) => {
|
|
|
2920
2943
|
x.unsubscribe(), k.dispose();
|
|
2921
2944
|
};
|
|
2922
2945
|
}
|
|
2923
|
-
}, [l, t, N, y, F.selectionSet$]), y == null || y.getSelectionDataWithStyle(),
|
|
2946
|
+
}, [l, t, N, y, F.selectionSet$]), y == null || y.getSelectionDataWithStyle(), L(() => {
|
|
2924
2947
|
if (c) {
|
|
2925
2948
|
const k = d.onCommandExecuted((I) => {
|
|
2926
2949
|
var R;
|
|
2927
|
-
if (I.id !==
|
|
2950
|
+
if (I.id !== pn.id)
|
|
2928
2951
|
return;
|
|
2929
2952
|
const x = I.params;
|
|
2930
2953
|
if (x.extra === "formula-editor" && x.selections.length) {
|
|
2931
2954
|
const w = x.selections[x.selections.length - 1];
|
|
2932
2955
|
if (w) {
|
|
2933
|
-
const D = n.current ===
|
|
2956
|
+
const D = n.current === Ne.NEED_ADD, U = ((R = y == null ? void 0 : y.getSelectionDataWithStyle()) != null ? R : []).map((B) => B.rangeWithCoord);
|
|
2934
2957
|
D ? U.push(w.range) : U[U.length - 1] = w.range, N(U, !0);
|
|
2935
2958
|
}
|
|
2936
2959
|
}
|
|
@@ -2939,11 +2962,11 @@ const sc = (e, t, n, o) => {
|
|
|
2939
2962
|
k.dispose();
|
|
2940
2963
|
};
|
|
2941
2964
|
}
|
|
2942
|
-
}, [d, l, n, v, c, N, y]),
|
|
2965
|
+
}, [d, l, n, v, c, N, y]), L(() => {
|
|
2943
2966
|
if (!l)
|
|
2944
2967
|
return;
|
|
2945
2968
|
const k = u.textSelection$.subscribe((I) => {
|
|
2946
|
-
I.unitId === l.getEditorId() &&
|
|
2969
|
+
I.unitId === l.getEditorId() && Wr({
|
|
2947
2970
|
unitId: o,
|
|
2948
2971
|
subUnitId: r,
|
|
2949
2972
|
refSelections: s.current,
|
|
@@ -2958,9 +2981,9 @@ const sc = (e, t, n, o) => {
|
|
|
2958
2981
|
});
|
|
2959
2982
|
return () => k.unsubscribe();
|
|
2960
2983
|
}, [u.textSelection$, l, s, y, F, A, r, a, o, h]);
|
|
2961
|
-
},
|
|
2962
|
-
const i = T(me), c = T(
|
|
2963
|
-
|
|
2984
|
+
}, Sc = (e, t, n, o, r, s) => {
|
|
2985
|
+
const i = T(me), c = T(Ge), g = T(Re).getRenderById(t), m = T(ne), h = g == null ? void 0 : g.with(De);
|
|
2986
|
+
L(() => {
|
|
2964
2987
|
if (e && h)
|
|
2965
2988
|
if (n) {
|
|
2966
2989
|
const d = () => {
|
|
@@ -2971,8 +2994,8 @@ const sc = (e, t, n, o) => {
|
|
|
2971
2994
|
s();
|
|
2972
2995
|
}, 30);
|
|
2973
2996
|
}, u = i.onCommandExecuted((v) => {
|
|
2974
|
-
v.id ===
|
|
2975
|
-
}), a = m.getCurrentTypeOfUnit$(
|
|
2997
|
+
v.id === jn.id && d();
|
|
2998
|
+
}), a = m.getCurrentTypeOfUnit$(W.UNIVER_SHEET).subscribe((v) => {
|
|
2976
2999
|
d();
|
|
2977
3000
|
});
|
|
2978
3001
|
return () => {
|
|
@@ -2980,9 +3003,9 @@ const sc = (e, t, n, o) => {
|
|
|
2980
3003
|
};
|
|
2981
3004
|
} else {
|
|
2982
3005
|
const d = i.beforeCommandExecuted((u) => {
|
|
2983
|
-
if (u.id ===
|
|
3006
|
+
if (u.id === jn.id) {
|
|
2984
3007
|
o(!1), r(), s();
|
|
2985
|
-
const a = c.getEditor(
|
|
3008
|
+
const a = c.getEditor(un);
|
|
2986
3009
|
a == null || a.focus();
|
|
2987
3010
|
}
|
|
2988
3011
|
});
|
|
@@ -2991,9 +3014,9 @@ const sc = (e, t, n, o) => {
|
|
|
2991
3014
|
};
|
|
2992
3015
|
}
|
|
2993
3016
|
}, [e, h]);
|
|
2994
|
-
},
|
|
3017
|
+
}, vc = (e, t, n) => {
|
|
2995
3018
|
const o = T(_e), r = z(!0);
|
|
2996
|
-
|
|
3019
|
+
L(() => {
|
|
2997
3020
|
if (e) {
|
|
2998
3021
|
const s = setTimeout(() => {
|
|
2999
3022
|
r.current = !1;
|
|
@@ -3002,24 +3025,24 @@ const sc = (e, t, n, o) => {
|
|
|
3002
3025
|
clearTimeout(s);
|
|
3003
3026
|
};
|
|
3004
3027
|
}
|
|
3005
|
-
}, [e]),
|
|
3028
|
+
}, [e]), L(() => {
|
|
3006
3029
|
if (!r.current && t) {
|
|
3007
3030
|
const s = o.checkIfAddBracket(n);
|
|
3008
|
-
t(s === 0 && n.startsWith(
|
|
3031
|
+
t(s === 0 && n.startsWith(fr.EQUALS), `${n}`);
|
|
3009
3032
|
}
|
|
3010
3033
|
}, [n, t]);
|
|
3011
|
-
},
|
|
3012
|
-
const o = T(
|
|
3034
|
+
}, Cc = (e, t = [], n) => {
|
|
3035
|
+
const o = T(Gt), [r, s] = V([]), [i, c] = V(""), l = z(-1), g = nt({ nodes: t }), m = () => {
|
|
3013
3036
|
s([]), c(""), l.current = -1;
|
|
3014
3037
|
};
|
|
3015
|
-
return
|
|
3038
|
+
return L(() => {
|
|
3016
3039
|
if (n && e) {
|
|
3017
|
-
const d = n.input$.pipe(
|
|
3040
|
+
const d = n.input$.pipe(gn(300)).subscribe(() => {
|
|
3018
3041
|
const u = n.getSelectionRanges();
|
|
3019
3042
|
if (u.length === 1) {
|
|
3020
3043
|
const a = g.current.nodes, v = u[0];
|
|
3021
3044
|
if (v.collapsed) {
|
|
3022
|
-
const p =
|
|
3045
|
+
const p = In(a, v.startOffset - 1, !1);
|
|
3023
3046
|
l.current = p;
|
|
3024
3047
|
const S = a[p];
|
|
3025
3048
|
if (S && typeof S != "string" && S.nodeType === Q.FUNCTION) {
|
|
@@ -3036,7 +3059,7 @@ const sc = (e, t, n, o) => {
|
|
|
3036
3059
|
d.unsubscribe();
|
|
3037
3060
|
};
|
|
3038
3061
|
}
|
|
3039
|
-
}, [n, e]),
|
|
3062
|
+
}, [n, e]), L(() => {
|
|
3040
3063
|
e || m();
|
|
3041
3064
|
}, [e]), {
|
|
3042
3065
|
searchList: r,
|
|
@@ -3046,15 +3069,15 @@ const sc = (e, t, n, o) => {
|
|
|
3046
3069
|
if (l.current !== -1) {
|
|
3047
3070
|
const v = a.splice(l.current + 1), p = a.pop() || "";
|
|
3048
3071
|
let S = (typeof p == "string" ? p.length : p.token.length) - d.length;
|
|
3049
|
-
return a.push(d), v[0] !== je.OPEN_BRACKET && u !==
|
|
3072
|
+
return a.push(d), v[0] !== je.OPEN_BRACKET && u !== hr.DefinedName && (a.push(je.OPEN_BRACKET), S--), { text: an([...a, ...v]), offset: S };
|
|
3050
3073
|
}
|
|
3051
3074
|
},
|
|
3052
3075
|
reset: m
|
|
3053
3076
|
};
|
|
3054
|
-
},
|
|
3055
|
-
},
|
|
3056
|
-
function
|
|
3057
|
-
const { isFocus: n, sequenceNodes: o, onSelect: r, editor: s, onClose: i =
|
|
3077
|
+
}, _c = () => {
|
|
3078
|
+
}, Rc = $e(Ic);
|
|
3079
|
+
function Ic(e, t) {
|
|
3080
|
+
const { isFocus: n, sequenceNodes: o, onSelect: r, editor: s, onClose: i = _c } = e, c = s.getEditorId(), l = T(Zt), g = T(me), { searchList: m, searchText: h, handlerFormulaReplace: d, reset: u } = Cc(n, o, s), a = ie(() => !!m.length, [m]), v = z(void 0), [p, S] = V(0), C = z(!1), [_] = Vr(c, a, [h, m]), E = nt({ searchList: m, active: p }), f = (N, O) => {
|
|
3058
3081
|
const k = d(N, O);
|
|
3059
3082
|
k && (u(), r(k));
|
|
3060
3083
|
};
|
|
@@ -3064,33 +3087,33 @@ function Sc(e, t) {
|
|
|
3064
3087
|
function y() {
|
|
3065
3088
|
C.current && S(-1);
|
|
3066
3089
|
}
|
|
3067
|
-
|
|
3090
|
+
L(() => {
|
|
3068
3091
|
if (!m.length)
|
|
3069
3092
|
return;
|
|
3070
3093
|
const N = `sheet.formula-embedding-editor.search_function.${c}`, O = new qe(), k = (I) => {
|
|
3071
3094
|
const { searchList: x, active: R } = E.current;
|
|
3072
3095
|
switch (I) {
|
|
3073
|
-
case
|
|
3096
|
+
case $.ARROW_UP: {
|
|
3074
3097
|
S((w) => {
|
|
3075
3098
|
const D = Math.max(0, w - 1);
|
|
3076
3099
|
return A(D), D;
|
|
3077
3100
|
});
|
|
3078
3101
|
break;
|
|
3079
3102
|
}
|
|
3080
|
-
case
|
|
3103
|
+
case $.ARROW_DOWN: {
|
|
3081
3104
|
S((w) => {
|
|
3082
3105
|
const D = Math.min(x.length - 1, w + 1);
|
|
3083
3106
|
return A(D), D;
|
|
3084
3107
|
});
|
|
3085
3108
|
break;
|
|
3086
3109
|
}
|
|
3087
|
-
case
|
|
3088
|
-
case
|
|
3110
|
+
case $.TAB:
|
|
3111
|
+
case $.ENTER: {
|
|
3089
3112
|
const w = x[R];
|
|
3090
3113
|
f(w.name, w.functionType);
|
|
3091
3114
|
break;
|
|
3092
3115
|
}
|
|
3093
|
-
case
|
|
3116
|
+
case $.ESC: {
|
|
3094
3117
|
u(), i();
|
|
3095
3118
|
break;
|
|
3096
3119
|
}
|
|
@@ -3098,18 +3121,18 @@ function Sc(e, t) {
|
|
|
3098
3121
|
};
|
|
3099
3122
|
return O.add(g.registerCommand({
|
|
3100
3123
|
id: N,
|
|
3101
|
-
type:
|
|
3124
|
+
type: Oe.OPERATION,
|
|
3102
3125
|
handler(I, x) {
|
|
3103
3126
|
const { keyCode: R } = x;
|
|
3104
3127
|
k(R);
|
|
3105
3128
|
}
|
|
3106
|
-
})), [
|
|
3129
|
+
})), [$.ARROW_UP, $.ARROW_DOWN, $.ENTER, $.ESC, $.TAB].map((I) => ({
|
|
3107
3130
|
id: N,
|
|
3108
3131
|
binding: I,
|
|
3109
3132
|
preconditions: () => !0,
|
|
3110
3133
|
priority: 1e3,
|
|
3111
3134
|
staticParameters: {
|
|
3112
|
-
eventType:
|
|
3135
|
+
eventType: xe.Keyboard,
|
|
3113
3136
|
keyCode: I
|
|
3114
3137
|
}
|
|
3115
3138
|
})).forEach((I) => {
|
|
@@ -3140,15 +3163,15 @@ function Sc(e, t) {
|
|
|
3140
3163
|
}, 300);
|
|
3141
3164
|
};
|
|
3142
3165
|
}, []);
|
|
3143
|
-
return m.length > 0 && a && /* @__PURE__ */ M(
|
|
3166
|
+
return m.length > 0 && a && /* @__PURE__ */ M(on, { portal: !0, anchorRect$: _, direction: "vertical", children: /* @__PURE__ */ M(
|
|
3144
3167
|
"ul",
|
|
3145
3168
|
{
|
|
3146
3169
|
ref: (N) => {
|
|
3147
3170
|
v.current = N, t && (t.current = N);
|
|
3148
3171
|
},
|
|
3149
3172
|
"data-u-comp": "sheets-formula-editor",
|
|
3150
|
-
className: re("univer-m-0 univer-box-border univer-max-h-[400px] univer-w-[250px] univer-list-none univer-overflow-y-auto univer-rounded-lg univer-bg-white univer-p-2 univer-leading-5 univer-shadow-md univer-outline-none dark:!univer-bg-gray-900",
|
|
3151
|
-
children: m.map((N, O) => /* @__PURE__ */
|
|
3173
|
+
className: re("univer-m-0 univer-box-border univer-max-h-[400px] univer-w-[250px] univer-list-none univer-overflow-y-auto univer-rounded-lg univer-bg-white univer-p-2 univer-leading-5 univer-shadow-md univer-outline-none dark:!univer-bg-gray-900", Cn, ut),
|
|
3174
|
+
children: m.map((N, O) => /* @__PURE__ */ H(
|
|
3152
3175
|
"li",
|
|
3153
3176
|
{
|
|
3154
3177
|
className: re("univer-box-border univer-cursor-pointer univer-rounded univer-px-2 univer-py-1 univer-text-gray-900 univer-transition-colors dark:!univer-text-white", {
|
|
@@ -3161,7 +3184,7 @@ function Sc(e, t) {
|
|
|
3161
3184
|
f(N.name, N.functionType), s && s.focus();
|
|
3162
3185
|
},
|
|
3163
3186
|
children: [
|
|
3164
|
-
/* @__PURE__ */
|
|
3187
|
+
/* @__PURE__ */ H("span", { className: "univer-block univer-truncate univer-text-xs", children: [
|
|
3165
3188
|
/* @__PURE__ */ M("span", { className: "univer-text-red-500", children: N.name.substring(0, h.length) }),
|
|
3166
3189
|
/* @__PURE__ */ M("span", { children: N.name.slice(h.length) })
|
|
3167
3190
|
] }),
|
|
@@ -3179,9 +3202,9 @@ function Sc(e, t) {
|
|
|
3179
3202
|
}
|
|
3180
3203
|
) });
|
|
3181
3204
|
}
|
|
3182
|
-
const
|
|
3183
|
-
},
|
|
3184
|
-
var
|
|
3205
|
+
const Ec = (e) => e.startsWith(fr.EQUALS) ? e.slice(1) : "", er = () => {
|
|
3206
|
+
}, bc = $e((e, t) => {
|
|
3207
|
+
var yn, Tn, Nn, On;
|
|
3185
3208
|
const {
|
|
3186
3209
|
errorText: n,
|
|
3187
3210
|
initValue: o,
|
|
@@ -3189,8 +3212,8 @@ const vc = (e) => e.startsWith(dr.EQUALS) ? e.slice(1) : "", Qn = () => {
|
|
|
3189
3212
|
subUnitId: s,
|
|
3190
3213
|
isFocus: i = !0,
|
|
3191
3214
|
isSupportAcrossSheet: c = !1,
|
|
3192
|
-
onFocus: l =
|
|
3193
|
-
onBlur: g =
|
|
3215
|
+
onFocus: l = er,
|
|
3216
|
+
onBlur: g = er,
|
|
3194
3217
|
onChange: m,
|
|
3195
3218
|
onVerify: h,
|
|
3196
3219
|
className: d,
|
|
@@ -3206,50 +3229,50 @@ const vc = (e) => e.startsWith(dr.EQUALS) ? e.slice(1) : "", Qn = () => {
|
|
|
3206
3229
|
autofocus: b = !0,
|
|
3207
3230
|
disableContextMenu: y,
|
|
3208
3231
|
style: A
|
|
3209
|
-
} = e, F = T(
|
|
3210
|
-
|
|
3232
|
+
} = e, F = T(Ge), N = z(null), O = te(m);
|
|
3233
|
+
Es(t, () => ({
|
|
3211
3234
|
isClickOutSide: (Z) => N.current ? !N.current.contains(Z.target) : !1
|
|
3212
3235
|
}));
|
|
3213
|
-
const k = te(v), I = z(null), x = z(void 0), R = x.current, [w, D] = V(i), U = z(null), B = ie(() => u != null ? u :
|
|
3236
|
+
const k = te(v), I = z(null), x = z(void 0), R = x.current, [w, D] = V(i), U = z(null), B = ie(() => u != null ? u : co(`${wo}-${Kt(4)}`), []), ce = ie(() => n !== void 0, [n]), ae = T(ne), he = ae.getUnit(B);
|
|
3214
3237
|
Se(he == null ? void 0 : he.change$);
|
|
3215
|
-
const K =
|
|
3216
|
-
|
|
3238
|
+
const K = sc(), J = ao.transform.getPlainText((Tn = (yn = he == null ? void 0 : he.getBody()) == null ? void 0 : yn.dataStream) != null ? Tn : ""), rt = nt(J), ot = ie(() => Ec(J), [J]), Tt = ie(() => K(ot), [ot, K]), { isSelecting: Ie, isSelectingRef: Y } = oc({ unitId: r, subUnitId: s, editorId: B, isFocus: w, disableOnClick: f }), X = z(""), fe = T(Re).getRenderById(B), ee = fe == null ? void 0 : fe.with(Sr), le = ee == null ? void 0 : ee.isFocusing, be = ie(() => ae.getCurrentTypeOfUnit$(W.UNIVER_DOC), [ae]), Le = Se(be), Me = (Le == null ? void 0 : Le.getUnitId()) === B, G = z([]), ge = Ie, Pe = (On = (Nn = T(ir).getConfig(Nr)) == null ? void 0 : Nn.functionScreenTips) != null ? On : !0;
|
|
3239
|
+
_s(() => {
|
|
3217
3240
|
O(J);
|
|
3218
3241
|
}, [J, O]);
|
|
3219
|
-
const Ue =
|
|
3242
|
+
const Ue = Hr("="), Ve = cc(r, s), oe = te((Z, se = !0, we, Te) => {
|
|
3220
3243
|
if (!x.current) return;
|
|
3221
3244
|
X.current = Z;
|
|
3222
|
-
const
|
|
3245
|
+
const xt = Z[0] === "=" ? Z.slice(1) : "", ke = K(xt), Kr = ke.reduce((We, wt) => typeof wt == "object" ? `${We}${wt.token}` : `${We}${wt}`, ""), Mt = Ue(
|
|
3223
3246
|
x.current,
|
|
3224
|
-
|
|
3247
|
+
Kr === xt ? ke : [],
|
|
3225
3248
|
se,
|
|
3226
|
-
|
|
3249
|
+
Te
|
|
3227
3250
|
);
|
|
3228
|
-
if (G.current =
|
|
3229
|
-
const We =
|
|
3251
|
+
if (G.current = Mt, we) {
|
|
3252
|
+
const We = Te != null ? Te : R == null ? void 0 : R.getSelectionRanges();
|
|
3230
3253
|
if ((We == null ? void 0 : We.length) !== 1)
|
|
3231
3254
|
return;
|
|
3232
|
-
const
|
|
3233
|
-
if (
|
|
3234
|
-
const
|
|
3235
|
-
|
|
3255
|
+
const Yr = We[0].startOffset - 1, Gr = In(ke, Yr, !1), xn = Ur(ke, Gr);
|
|
3256
|
+
if (xn >= 0) {
|
|
3257
|
+
const Mn = Mt.splice(xn, 1)[0];
|
|
3258
|
+
Mn && Mt.push(Mn);
|
|
3236
3259
|
}
|
|
3237
|
-
Ve(w ?
|
|
3260
|
+
Ve(w ? Mt : [], x.current);
|
|
3238
3261
|
}
|
|
3239
3262
|
});
|
|
3240
|
-
|
|
3263
|
+
L(() => {
|
|
3241
3264
|
w && oe(J, !1, !0);
|
|
3242
|
-
}, [w]),
|
|
3265
|
+
}, [w]), L(() => {
|
|
3243
3266
|
if (w) {
|
|
3244
3267
|
if (X.current === J) return;
|
|
3245
3268
|
oe(J, !1, !0);
|
|
3246
3269
|
}
|
|
3247
|
-
}, [J]),
|
|
3248
|
-
const
|
|
3249
|
-
|
|
3270
|
+
}, [J]), vc(w, h, J);
|
|
3271
|
+
const ye = nc(R), Nt = hc(w, r, s);
|
|
3272
|
+
L(() => {
|
|
3250
3273
|
var Z;
|
|
3251
|
-
k(
|
|
3252
|
-
}, [k,
|
|
3274
|
+
k(Ie, (Z = ee == null ? void 0 : ee.isFocusing) != null ? Z : !0);
|
|
3275
|
+
}, [k, Ie]), Jo(w, p, R), Lt(() => {
|
|
3253
3276
|
let Z;
|
|
3254
3277
|
if (U.current) {
|
|
3255
3278
|
Z = F.register({
|
|
@@ -3275,21 +3298,21 @@ const vc = (e) => e.startsWith(dr.EQUALS) ? e.slice(1) : "", Qn = () => {
|
|
|
3275
3298
|
Z == null || Z.dispose();
|
|
3276
3299
|
};
|
|
3277
3300
|
}, []), Lt(() => {
|
|
3278
|
-
i ? (D(i),
|
|
3279
|
-
}, [i, R,
|
|
3280
|
-
const { checkScrollBar:
|
|
3281
|
-
|
|
3282
|
-
const
|
|
3301
|
+
i ? (D(i), ye()) : (C && (R == null || R.blur(), Nt()), D(i));
|
|
3302
|
+
}, [i, R, ye, Nt, C]);
|
|
3303
|
+
const { checkScrollBar: Ot } = es(R, E, _);
|
|
3304
|
+
dc(w, !!(Ie && Me), r, B, y), uc(!!(w && le && a), ge, R, S);
|
|
3305
|
+
const En = te((Z, se, we) => {
|
|
3283
3306
|
if (!le)
|
|
3284
3307
|
return;
|
|
3285
|
-
const
|
|
3286
|
-
oe(`=${Z}`, !0, we,
|
|
3287
|
-
const
|
|
3288
|
-
ke == null || ke.scrollToRange({ ...
|
|
3289
|
-
}, 50),
|
|
3308
|
+
const Te = se !== -1 ? [{ startOffset: se + 1, endOffset: se + 1, collapsed: !0 }] : void 0;
|
|
3309
|
+
oe(`=${Z}`, !0, we, Te), we && (ye(), se !== -1 && setTimeout(() => {
|
|
3310
|
+
const xt = { startOffset: se + 1, endOffset: se + 1 }, ke = R == null ? void 0 : R.render.with(ts);
|
|
3311
|
+
ke == null || ke.scrollToRange({ ...xt, collapsed: !0 });
|
|
3312
|
+
}, 50), Ot());
|
|
3290
3313
|
});
|
|
3291
|
-
|
|
3292
|
-
w && !!(
|
|
3314
|
+
pc(
|
|
3315
|
+
w && !!(Ie && Me),
|
|
3293
3316
|
w,
|
|
3294
3317
|
Y,
|
|
3295
3318
|
r,
|
|
@@ -3298,28 +3321,28 @@ const vc = (e) => e.startsWith(dr.EQUALS) ? e.slice(1) : "", Qn = () => {
|
|
|
3298
3321
|
c,
|
|
3299
3322
|
!!ge,
|
|
3300
3323
|
R,
|
|
3301
|
-
|
|
3302
|
-
),
|
|
3303
|
-
oe(
|
|
3324
|
+
En
|
|
3325
|
+
), Sc(w && !!(Ie && Me), r, c, D, g, () => {
|
|
3326
|
+
oe(rt.current, !1, !0);
|
|
3304
3327
|
});
|
|
3305
|
-
const
|
|
3328
|
+
const bn = (Z) => {
|
|
3306
3329
|
if (Z) {
|
|
3307
3330
|
const se = R == null ? void 0 : R.getSelectionRanges();
|
|
3308
3331
|
if (se && se.length === 1) {
|
|
3309
3332
|
const we = se[0];
|
|
3310
3333
|
if (we.collapsed) {
|
|
3311
|
-
const
|
|
3334
|
+
const Te = Z.offset;
|
|
3312
3335
|
setTimeout(() => {
|
|
3313
|
-
R == null || R.setSelectionRanges([{ startOffset: we.startOffset -
|
|
3336
|
+
R == null || R.setSelectionRanges([{ startOffset: we.startOffset - Te, endOffset: we.endOffset - Te }]);
|
|
3314
3337
|
}, 30);
|
|
3315
3338
|
}
|
|
3316
3339
|
}
|
|
3317
|
-
|
|
3340
|
+
ye(), oe(`=${Z.text}`);
|
|
3318
3341
|
}
|
|
3319
|
-
},
|
|
3320
|
-
D(!0), l(),
|
|
3342
|
+
}, jr = () => {
|
|
3343
|
+
D(!0), l(), ye();
|
|
3321
3344
|
};
|
|
3322
|
-
return /* @__PURE__ */
|
|
3345
|
+
return /* @__PURE__ */ H("div", { className: d, children: [
|
|
3323
3346
|
/* @__PURE__ */ M(
|
|
3324
3347
|
"div",
|
|
3325
3348
|
{
|
|
@@ -3333,36 +3356,36 @@ const vc = (e) => e.startsWith(dr.EQUALS) ? e.slice(1) : "", Qn = () => {
|
|
|
3333
3356
|
{
|
|
3334
3357
|
ref: U,
|
|
3335
3358
|
className: "univer-relative univer-h-full univer-w-full",
|
|
3336
|
-
onMouseUp:
|
|
3359
|
+
onMouseUp: jr
|
|
3337
3360
|
}
|
|
3338
3361
|
)
|
|
3339
3362
|
}
|
|
3340
3363
|
),
|
|
3341
3364
|
n !== void 0 && /* @__PURE__ */ M("div", { className: "univer-my-1 univer-text-xs univer-text-red-500", children: n }),
|
|
3342
|
-
Pe && R &&
|
|
3343
|
-
|
|
3365
|
+
Pe && R && ot !== "" && /* @__PURE__ */ M(
|
|
3366
|
+
tc,
|
|
3344
3367
|
{
|
|
3345
3368
|
editor: R,
|
|
3346
3369
|
isFocus: w,
|
|
3347
3370
|
formulaText: J,
|
|
3348
|
-
onClose: () =>
|
|
3371
|
+
onClose: () => ye()
|
|
3349
3372
|
}
|
|
3350
3373
|
),
|
|
3351
3374
|
Pe && !!R && /* @__PURE__ */ M(
|
|
3352
|
-
|
|
3375
|
+
Rc,
|
|
3353
3376
|
{
|
|
3354
3377
|
isFocus: w,
|
|
3355
|
-
sequenceNodes:
|
|
3356
|
-
onSelect:
|
|
3378
|
+
sequenceNodes: Tt,
|
|
3379
|
+
onSelect: bn,
|
|
3357
3380
|
ref: I,
|
|
3358
3381
|
editor: R
|
|
3359
3382
|
}
|
|
3360
3383
|
)
|
|
3361
3384
|
] });
|
|
3362
3385
|
});
|
|
3363
|
-
function
|
|
3364
|
-
const r = T(_e), s =
|
|
3365
|
-
return
|
|
3386
|
+
function yc(e, t, n, o) {
|
|
3387
|
+
const r = T(_e), s = Hr(""), i = Se(e == null ? void 0 : e.getDocumentDataModel().change$), [c, l] = V([]), g = T(ko), m = z(""), h = T(ne);
|
|
3388
|
+
return L(() => {
|
|
3366
3389
|
if (!e) return;
|
|
3367
3390
|
const d = e.getDocumentDataModel().getPlainText();
|
|
3368
3391
|
if (m.current === d)
|
|
@@ -3370,7 +3393,7 @@ function _c(e, t, n, o) {
|
|
|
3370
3393
|
m.current = d;
|
|
3371
3394
|
const u = r.sequenceNodesBuilder(d);
|
|
3372
3395
|
l(u != null ? u : []);
|
|
3373
|
-
}, [i, e, r]),
|
|
3396
|
+
}, [i, e, r]), L(() => {
|
|
3374
3397
|
var a, v;
|
|
3375
3398
|
if (!e) return;
|
|
3376
3399
|
if (!t) {
|
|
@@ -3387,10 +3410,10 @@ function _c(e, t, n, o) {
|
|
|
3387
3410
|
}
|
|
3388
3411
|
const d = s(e, c, !1), u = new qe();
|
|
3389
3412
|
return d.forEach((p) => {
|
|
3390
|
-
const S = ht(p.token), C = h.getCurrentUnitForType(
|
|
3413
|
+
const S = ht(p.token), C = h.getCurrentUnitForType(W.UNIVER_SHEET), _ = C == null ? void 0 : C.getActiveSheet();
|
|
3391
3414
|
if (!S.sheetName && o !== (_ == null ? void 0 : _.getSheetId()) || S.sheetName && (_ == null ? void 0 : _.getName()) !== S.sheetName)
|
|
3392
3415
|
return;
|
|
3393
|
-
const E = new
|
|
3416
|
+
const E = new hn(p.themeColor).toRgb(), f = g.addShape({
|
|
3394
3417
|
range: S.range,
|
|
3395
3418
|
style: {
|
|
3396
3419
|
stroke: p.themeColor,
|
|
@@ -3405,8 +3428,8 @@ function _c(e, t, n, o) {
|
|
|
3405
3428
|
};
|
|
3406
3429
|
}, [e, t, s, g, c]), { sequenceNodes: c };
|
|
3407
3430
|
}
|
|
3408
|
-
function
|
|
3409
|
-
const t = T(
|
|
3431
|
+
function Tc(e) {
|
|
3432
|
+
const t = T(mn), { supportAcrossSheet: n = !1, keepSheetReference: o = !1, unitId: r, subUnitId: s, onChange: i } = e, l = T(ne).getUnit(r, W.UNIVER_SHEET), g = te(i), m = te((h, d) => {
|
|
3410
3433
|
const u = l == null ? void 0 : l.getActiveSheet();
|
|
3411
3434
|
if (!u || !n && u.getSheetId() !== s || !(h != null && h.length)) return;
|
|
3412
3435
|
const a = o ? u.getName() : u.getSheetId() === s ? "" : u.getName(), v = h.map((p) => ({
|
|
@@ -3416,7 +3439,7 @@ function Rc(e) {
|
|
|
3416
3439
|
}));
|
|
3417
3440
|
g(v, d);
|
|
3418
3441
|
});
|
|
3419
|
-
|
|
3442
|
+
L(() => {
|
|
3420
3443
|
const h = new qe();
|
|
3421
3444
|
return h.add(t.selectionMoveStart$.subscribe((d) => {
|
|
3422
3445
|
m(d, !0);
|
|
@@ -3429,14 +3452,14 @@ function Rc(e) {
|
|
|
3429
3452
|
};
|
|
3430
3453
|
}, [m, t.selectionMoveEnd$, t.selectionMoveStart$, t.selectionMoving$]);
|
|
3431
3454
|
}
|
|
3432
|
-
const
|
|
3455
|
+
const tr = (e) => !e.some((n) => {
|
|
3433
3456
|
if (typeof n == "string") {
|
|
3434
3457
|
if (n !== je.COMMA)
|
|
3435
3458
|
return !0;
|
|
3436
3459
|
} else if (n.nodeType !== Q.REFERENCE)
|
|
3437
3460
|
return !0;
|
|
3438
3461
|
return !1;
|
|
3439
|
-
}),
|
|
3462
|
+
}), Nc = (e) => {
|
|
3440
3463
|
if (e.endColumn < e.startColumn) {
|
|
3441
3464
|
const t = e.endColumn;
|
|
3442
3465
|
e.endColumn = e.startColumn, e.startColumn = t;
|
|
@@ -3447,7 +3470,7 @@ const Jn = (e) => !e.some((n) => {
|
|
|
3447
3470
|
}
|
|
3448
3471
|
return e;
|
|
3449
3472
|
};
|
|
3450
|
-
function
|
|
3473
|
+
function Oc(e) {
|
|
3451
3474
|
const {
|
|
3452
3475
|
visible: t,
|
|
3453
3476
|
initialValue: n,
|
|
@@ -3460,7 +3483,7 @@ function Ec(e) {
|
|
|
3460
3483
|
onClose: g,
|
|
3461
3484
|
onShowBySelection: m
|
|
3462
3485
|
} = e, h = T(dt), d = T(_e), [u, a] = V([]), [v, p] = V(0), S = z(null);
|
|
3463
|
-
|
|
3486
|
+
L(() => {
|
|
3464
3487
|
if (t && n.length) {
|
|
3465
3488
|
const f = n.map((b) => b.sheetName ? Ct(b.sheetName, b.range) : Ce(b.range));
|
|
3466
3489
|
a(f), p(f.length - 1);
|
|
@@ -3475,7 +3498,7 @@ function Ec(e) {
|
|
|
3475
3498
|
}, E = (f) => {
|
|
3476
3499
|
u.splice(f, 1), a([...u]);
|
|
3477
3500
|
};
|
|
3478
|
-
return
|
|
3501
|
+
return Tc({
|
|
3479
3502
|
unitId: o,
|
|
3480
3503
|
subUnitId: r,
|
|
3481
3504
|
supportAcrossSheet: i,
|
|
@@ -3500,7 +3523,7 @@ function Ec(e) {
|
|
|
3500
3523
|
}
|
|
3501
3524
|
}
|
|
3502
3525
|
}), /* @__PURE__ */ M(
|
|
3503
|
-
|
|
3526
|
+
Os,
|
|
3504
3527
|
{
|
|
3505
3528
|
width: "328px",
|
|
3506
3529
|
open: t,
|
|
@@ -3508,10 +3531,10 @@ function Ec(e) {
|
|
|
3508
3531
|
draggable: !0,
|
|
3509
3532
|
mask: !1,
|
|
3510
3533
|
maskClosable: !1,
|
|
3511
|
-
footer: /* @__PURE__ */
|
|
3512
|
-
/* @__PURE__ */ M(
|
|
3534
|
+
footer: /* @__PURE__ */ H("footer", { className: "univer-flex univer-gap-2", children: [
|
|
3535
|
+
/* @__PURE__ */ M(at, { onClick: g, children: h.t("rangeSelector.cancel") }),
|
|
3513
3536
|
/* @__PURE__ */ M(
|
|
3514
|
-
|
|
3537
|
+
at,
|
|
3515
3538
|
{
|
|
3516
3539
|
variant: "primary",
|
|
3517
3540
|
onClick: () => {
|
|
@@ -3519,7 +3542,7 @@ function Ec(e) {
|
|
|
3519
3542
|
u.filter((f) => {
|
|
3520
3543
|
const b = d.sequenceNodesBuilder(f);
|
|
3521
3544
|
return b && b.length === 1 && typeof b[0] != "string" && b[0].nodeType === Q.REFERENCE;
|
|
3522
|
-
}).map((f) => ht(f)).map((f) => ({ ...f, range:
|
|
3545
|
+
}).map((f) => ht(f)).map((f) => ({ ...f, range: Nc(f.range) }))
|
|
3523
3546
|
);
|
|
3524
3547
|
},
|
|
3525
3548
|
children: h.t("rangeSelector.confirm")
|
|
@@ -3527,19 +3550,19 @@ function Ec(e) {
|
|
|
3527
3550
|
)
|
|
3528
3551
|
] }),
|
|
3529
3552
|
onClose: g,
|
|
3530
|
-
children: /* @__PURE__ */
|
|
3553
|
+
children: /* @__PURE__ */ H(
|
|
3531
3554
|
"div",
|
|
3532
3555
|
{
|
|
3533
3556
|
ref: S,
|
|
3534
|
-
className: re("-univer-mx-6 univer-max-h-60 univer-overflow-y-auto univer-px-6",
|
|
3557
|
+
className: re("-univer-mx-6 univer-max-h-60 univer-overflow-y-auto univer-px-6", ut),
|
|
3535
3558
|
children: [
|
|
3536
|
-
u.map((f, b) => /* @__PURE__ */
|
|
3559
|
+
u.map((f, b) => /* @__PURE__ */ H(
|
|
3537
3560
|
"div",
|
|
3538
3561
|
{
|
|
3539
3562
|
className: "univer-mb-2 univer-flex univer-items-center univer-gap-4",
|
|
3540
3563
|
children: [
|
|
3541
3564
|
/* @__PURE__ */ M(
|
|
3542
|
-
|
|
3565
|
+
Ir,
|
|
3543
3566
|
{
|
|
3544
3567
|
className: re("univer-w-full", {
|
|
3545
3568
|
"univer-border-primary-600": v === b
|
|
@@ -3551,7 +3574,7 @@ function Ec(e) {
|
|
|
3551
3574
|
}
|
|
3552
3575
|
),
|
|
3553
3576
|
u.length > 1 && /* @__PURE__ */ M(
|
|
3554
|
-
|
|
3577
|
+
Fr,
|
|
3555
3578
|
{
|
|
3556
3579
|
className: "univer-cursor-pointer",
|
|
3557
3580
|
onClick: () => E(b)
|
|
@@ -3561,8 +3584,8 @@ function Ec(e) {
|
|
|
3561
3584
|
},
|
|
3562
3585
|
b
|
|
3563
3586
|
)),
|
|
3564
|
-
u.length < s && /* @__PURE__ */ M("div", { children: /* @__PURE__ */
|
|
3565
|
-
/* @__PURE__ */ M(
|
|
3587
|
+
u.length < s && /* @__PURE__ */ M("div", { children: /* @__PURE__ */ H(at, { variant: "link", onClick: _, children: [
|
|
3588
|
+
/* @__PURE__ */ M(Dr, {}),
|
|
3566
3589
|
/* @__PURE__ */ M("span", { children: h.t("rangeSelector.addAnotherRange") })
|
|
3567
3590
|
] }) })
|
|
3568
3591
|
]
|
|
@@ -3571,13 +3594,13 @@ function Ec(e) {
|
|
|
3571
3594
|
}
|
|
3572
3595
|
);
|
|
3573
3596
|
}
|
|
3574
|
-
function
|
|
3597
|
+
function xc(e) {
|
|
3575
3598
|
return e.split(je.COMMA).filter((t) => !!t).map((t) => ht(t));
|
|
3576
3599
|
}
|
|
3577
|
-
function
|
|
3600
|
+
function Mc(e) {
|
|
3578
3601
|
return e.map((t) => t.sheetName ? Ct(t.sheetName, t.range) : Ce(t.range)).join(je.COMMA);
|
|
3579
3602
|
}
|
|
3580
|
-
function
|
|
3603
|
+
function Br(e) {
|
|
3581
3604
|
const [t, n] = V(null), {
|
|
3582
3605
|
onVerify: o,
|
|
3583
3606
|
selectorRef: r,
|
|
@@ -3594,13 +3617,13 @@ function Wr(e) {
|
|
|
3594
3617
|
forceShowDialogWhenSelectionChanged: v,
|
|
3595
3618
|
hideEditor: p,
|
|
3596
3619
|
resetRange: S
|
|
3597
|
-
} = e, [C, _] = V(m != null ? m : !1), [E, f] = V(!1), [b, y] = V([]), A = T(dt), F = T(
|
|
3620
|
+
} = e, [C, _] = V(m != null ? m : !1), [E, f] = V(!1), [b, y] = V([]), A = T(dt), F = T(Ge), { sequenceNodes: N } = yc(t, C, s, i), O = nt(N), k = T(me), I = te(() => {
|
|
3598
3621
|
t == null || t.setSelectionRanges([]), t == null || t.blur(), F.blur();
|
|
3599
3622
|
}), x = te(() => {
|
|
3600
3623
|
var R;
|
|
3601
|
-
I(), y(
|
|
3624
|
+
I(), y(xc((R = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? R : "")), f(!0);
|
|
3602
3625
|
});
|
|
3603
|
-
return
|
|
3626
|
+
return L(() => {
|
|
3604
3627
|
r && (r.current = {
|
|
3605
3628
|
get editor() {
|
|
3606
3629
|
return t;
|
|
@@ -3609,7 +3632,7 @@ function Wr(e) {
|
|
|
3609
3632
|
F.focus(t.getEditorId());
|
|
3610
3633
|
},
|
|
3611
3634
|
blur: I,
|
|
3612
|
-
verify: () =>
|
|
3635
|
+
verify: () => tr(O.current),
|
|
3613
3636
|
showDialog: (R) => {
|
|
3614
3637
|
I(), y(R), f(!0);
|
|
3615
3638
|
},
|
|
@@ -3621,12 +3644,12 @@ function Wr(e) {
|
|
|
3621
3644
|
return (R = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? R : "";
|
|
3622
3645
|
}
|
|
3623
3646
|
});
|
|
3624
|
-
}, [I, t, F, r, O]),
|
|
3647
|
+
}, [I, t, F, r, O]), L(() => {
|
|
3625
3648
|
var R;
|
|
3626
|
-
o == null || o(
|
|
3627
|
-
}, [N]),
|
|
3649
|
+
o == null || o(tr(N), (R = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? R : "");
|
|
3650
|
+
}, [N]), L(() => {
|
|
3628
3651
|
d == null || d(E);
|
|
3629
|
-
}, [E]),
|
|
3652
|
+
}, [E]), L(() => {
|
|
3630
3653
|
if (E && S)
|
|
3631
3654
|
return () => {
|
|
3632
3655
|
const R = {
|
|
@@ -3634,11 +3657,11 @@ function Wr(e) {
|
|
|
3634
3657
|
subUnitId: i,
|
|
3635
3658
|
selections: S
|
|
3636
3659
|
};
|
|
3637
|
-
k.executeCommand(
|
|
3660
|
+
k.executeCommand(pn.id, R);
|
|
3638
3661
|
};
|
|
3639
|
-
}, [E]), /* @__PURE__ */
|
|
3662
|
+
}, [E]), /* @__PURE__ */ H(Is, { children: [
|
|
3640
3663
|
p ? null : /* @__PURE__ */ M(
|
|
3641
|
-
|
|
3664
|
+
ns,
|
|
3642
3665
|
{
|
|
3643
3666
|
isSingle: !0,
|
|
3644
3667
|
...e,
|
|
@@ -3649,8 +3672,8 @@ function Wr(e) {
|
|
|
3649
3672
|
onClickOutside: () => {
|
|
3650
3673
|
_(!1), I(), u == null || u();
|
|
3651
3674
|
},
|
|
3652
|
-
icon: /* @__PURE__ */ M(
|
|
3653
|
-
|
|
3675
|
+
icon: /* @__PURE__ */ M(Ns, { title: A.t("rangeSelector.buttonTooltip"), placement: "bottom", children: /* @__PURE__ */ M(
|
|
3676
|
+
Lr,
|
|
3654
3677
|
{
|
|
3655
3678
|
className: "univer-cursor-pointer dark:!univer-text-gray-300",
|
|
3656
3679
|
onClick: x
|
|
@@ -3659,7 +3682,7 @@ function Wr(e) {
|
|
|
3659
3682
|
}
|
|
3660
3683
|
),
|
|
3661
3684
|
/* @__PURE__ */ M(
|
|
3662
|
-
|
|
3685
|
+
Oc,
|
|
3663
3686
|
{
|
|
3664
3687
|
initialValue: b,
|
|
3665
3688
|
unitId: s,
|
|
@@ -3667,7 +3690,7 @@ function Wr(e) {
|
|
|
3667
3690
|
visible: E,
|
|
3668
3691
|
maxRangeCount: c,
|
|
3669
3692
|
onConfirm: (R) => {
|
|
3670
|
-
const w =
|
|
3693
|
+
const w = Mc(R), D = lo.newEmptyData();
|
|
3671
3694
|
D.body.dataStream = w, t == null || t.replaceText(w, !1), h == null || h(D, w), f(!1), y([]), requestAnimationFrame(() => {
|
|
3672
3695
|
I();
|
|
3673
3696
|
});
|
|
@@ -3682,10 +3705,10 @@ function Wr(e) {
|
|
|
3682
3705
|
)
|
|
3683
3706
|
] });
|
|
3684
3707
|
}
|
|
3685
|
-
const
|
|
3708
|
+
const wc = () => {
|
|
3686
3709
|
var o, r;
|
|
3687
|
-
const e = T(
|
|
3688
|
-
return
|
|
3710
|
+
const e = T(Pr), t = Se(e.currentSelector$), n = z(null);
|
|
3711
|
+
return L(() => {
|
|
3689
3712
|
var s, i;
|
|
3690
3713
|
if (t)
|
|
3691
3714
|
return (i = n.current) == null || i.showDialog((s = t.initialValue) != null ? s : []), () => {
|
|
@@ -3693,7 +3716,7 @@ const Tc = () => {
|
|
|
3693
3716
|
(c = n.current) == null || c.hideDialog();
|
|
3694
3717
|
};
|
|
3695
3718
|
}, [t]), /* @__PURE__ */ M(
|
|
3696
|
-
|
|
3719
|
+
Br,
|
|
3697
3720
|
{
|
|
3698
3721
|
unitId: (o = t == null ? void 0 : t.unitId) != null ? o : "",
|
|
3699
3722
|
subUnitId: (r = t == null ? void 0 : t.subUnitId) != null ? r : "",
|
|
@@ -3706,81 +3729,83 @@ const Tc = () => {
|
|
|
3706
3729
|
}
|
|
3707
3730
|
);
|
|
3708
3731
|
};
|
|
3709
|
-
var
|
|
3710
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
3732
|
+
var kc = Object.defineProperty, Ac = Object.getOwnPropertyDescriptor, Fc = (e, t, n) => t in e ? kc(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Dc = (e, t, n, o) => {
|
|
3733
|
+
for (var r = o > 1 ? void 0 : o ? Ac(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
3711
3734
|
(i = e[s]) && (r = i(r) || r);
|
|
3712
3735
|
return r;
|
|
3713
|
-
},
|
|
3714
|
-
let
|
|
3715
|
-
constructor(e =
|
|
3736
|
+
}, Ft = (e, t) => (n, o) => t(n, o, e), qr = (e, t, n) => Fc(e, typeof t != "symbol" ? t + "" : t, n);
|
|
3737
|
+
let jt = class extends ho {
|
|
3738
|
+
constructor(e = zn, t, n, o, r) {
|
|
3716
3739
|
super(), this._config = e, this._injector = t, this._renderManagerService = n, this._configService = o, this._uiPartsService = r;
|
|
3717
|
-
const { menu: s, ...i } =
|
|
3718
|
-
|
|
3740
|
+
const { menu: s, ...i } = fo(
|
|
3741
|
+
zn,
|
|
3719
3742
|
this._config
|
|
3720
3743
|
);
|
|
3721
|
-
s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(
|
|
3744
|
+
s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(Nr, i, { merge: !0 });
|
|
3722
3745
|
}
|
|
3723
3746
|
onStarting() {
|
|
3724
|
-
|
|
3725
|
-
[
|
|
3726
|
-
[
|
|
3727
|
-
[
|
|
3728
|
-
[Pt],
|
|
3747
|
+
go(this._injector, [
|
|
3748
|
+
[zt, { useClass: sn }],
|
|
3749
|
+
[Pr],
|
|
3750
|
+
[Bt],
|
|
3729
3751
|
[Ut],
|
|
3730
3752
|
[Vt],
|
|
3731
3753
|
[Wt],
|
|
3732
|
-
[
|
|
3754
|
+
[Ht],
|
|
3755
|
+
[Pt],
|
|
3756
|
+
[qt]
|
|
3733
3757
|
]), this._initUIPart();
|
|
3734
3758
|
}
|
|
3735
3759
|
onReady() {
|
|
3736
3760
|
[
|
|
3737
3761
|
[De]
|
|
3738
3762
|
].forEach((e) => {
|
|
3739
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
3763
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(W.UNIVER_SHEET, e));
|
|
3740
3764
|
});
|
|
3741
3765
|
}
|
|
3742
3766
|
onRendered() {
|
|
3743
3767
|
[
|
|
3744
|
-
[
|
|
3768
|
+
[cn]
|
|
3745
3769
|
].forEach((e) => {
|
|
3746
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
3747
|
-
}),
|
|
3748
|
-
[
|
|
3770
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(W.UNIVER_SHEET, e));
|
|
3771
|
+
}), mo(this._injector, [
|
|
3772
|
+
[Bt],
|
|
3749
3773
|
// FormulaProgressBar relies on TriggerCalculationController, but it is necessary to ensure that the formula calculation is done after rendered.
|
|
3750
|
-
[
|
|
3751
|
-
[
|
|
3774
|
+
[Vt],
|
|
3775
|
+
[Ht],
|
|
3776
|
+
[qt]
|
|
3752
3777
|
]);
|
|
3753
3778
|
}
|
|
3754
3779
|
onSteady() {
|
|
3755
|
-
this._injector.get(
|
|
3780
|
+
this._injector.get(Ut), this._injector.get(Pt);
|
|
3756
3781
|
}
|
|
3757
3782
|
_initUIPart() {
|
|
3758
|
-
const e = this._injector.get(
|
|
3759
|
-
this.disposeWithMe(e.register(
|
|
3783
|
+
const e = this._injector.get(_r);
|
|
3784
|
+
this.disposeWithMe(e.register(Ao, Br)), this.disposeWithMe(e.register(Fo, bc)), this.disposeWithMe(this._uiPartsService.registerComponent(Rs.GLOBAL, () => Rr(wc, this._injector)));
|
|
3760
3785
|
}
|
|
3761
3786
|
};
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
],
|
|
3787
|
+
qr(jt, "pluginName", br);
|
|
3788
|
+
qr(jt, "type", W.UNIVER_SHEET);
|
|
3789
|
+
jt = Dc([
|
|
3790
|
+
uo(qo, ms),
|
|
3791
|
+
Ft(1, q(Rt)),
|
|
3792
|
+
Ft(2, Re),
|
|
3793
|
+
Ft(3, ir),
|
|
3794
|
+
Ft(4, Cr)
|
|
3795
|
+
], jt);
|
|
3771
3796
|
export {
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3797
|
+
As as FORMULA_PROMPT_ACTIVATED,
|
|
3798
|
+
bc as FormulaEditor,
|
|
3799
|
+
Pt as FormulaReorderController,
|
|
3800
|
+
Pr as GlobalRangeSelectorService,
|
|
3801
|
+
Fs as HelpFunctionOperation,
|
|
3777
3802
|
pe as InsertFunctionOperation,
|
|
3778
|
-
|
|
3779
|
-
|
|
3803
|
+
Rn as MoreFunctionsOperation,
|
|
3804
|
+
Br as RangeSelector,
|
|
3780
3805
|
De as RefSelectionsRenderService,
|
|
3781
|
-
|
|
3782
|
-
|
|
3806
|
+
Tr as ReferenceAbsoluteOperation,
|
|
3807
|
+
Ws as SearchFunctionOperation,
|
|
3783
3808
|
gt as SelectEditorFormulaOperation,
|
|
3784
|
-
|
|
3785
|
-
|
|
3809
|
+
_n as SheetOnlyPasteFormulaCommand,
|
|
3810
|
+
jt as UniverSheetsFormulaUIPlugin
|
|
3786
3811
|
};
|