@univerjs/sheets-formula-ui 0.10.12 → 0.10.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +5 -5
- package/lib/es/index.js +1222 -1089
- package/lib/index.css +1 -1
- package/lib/index.js +1222 -1089
- package/lib/umd/index.js +5 -5
- package/package.json +13 -13
package/lib/index.js
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { CommandType as Ne, ICommandService as
|
|
5
|
-
import { SheetPasteCommand as
|
|
6
|
-
import { sequenceNodeType as Q, serializeRange as
|
|
7
|
-
import { Subject 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 W, Fragment as
|
|
14
|
-
import { useCallback as
|
|
15
|
-
import { clsx as re, scrollbarClassName as
|
|
16
|
-
import { DocSelectionManagerService as
|
|
17
|
-
import { debounceTime as
|
|
18
|
-
const
|
|
1
|
+
var Yr = Object.defineProperty;
|
|
2
|
+
var Gr = (e, t, n) => t in e ? Yr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var j = (e, t, n) => Gr(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { CommandType as Ne, ICommandService as me, createIdentifier as Zr, IContextService as cn, IUniverInstanceService as ne, Rectangle as er, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as an, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as tr, DEFAULT_EMPTY_DOCUMENT_VALUE as nr, isRealNum as zr, CellValueType as xn, getCellValueType as Xr, Inject as q, Disposable as ut, ObjectMatrix as Fe, Range as Qr, Tools as ln, LocaleService as dt, isICellData as Jr, isFormulaString as Ae, isFormulaId as at, generateRandomId as qt, Direction as de, Injector as Rt, UniverInstanceType as H, ThemeService as It, ILogService as eo, toDisposable as rr, ColorKit as un, RxDisposable as to, InterceptorEffectEnum as no, FOCUSING_DOC as ro, FOCUSING_UNIVER_EDITOR as oo, DisposableCollection as qe, RANGE_TYPE as ve, getBodySlice as Mn, EDITOR_ACTIVATED as wn, createInternalEditorID as so, BuildTextUtils as io, IConfigService as or, RichTextBuilder as co, DependentOn as ao, Plugin as lo, merge as uo, registerDependencies as ho, touchDependencies as fo } from "@univerjs/core";
|
|
5
|
+
import { SheetPasteCommand as go, PREDEFINED_HOOK_NAME as it, IEditorBridgeService as dn, SetCellEditVisibleOperation as sr, HoverManagerService as mo, CellAlertManagerService as po, CellAlertType as So, IAutoFillService as vo, APPLY_TYPE as Co, DATA_TYPE as kn, ISheetClipboardService as _o, COPY_TYPE as ir, SheetSkeletonManagerService as jt, attachSelectionWithCoord as tn, SelectionControl as cr, SELECTION_SHAPE_DEPTH as Ro, useActiveWorkbook as Io, getCurrentRangeDisable$ as Ke, PASTE_SPECIAL_MENU_ID as Eo, whenFormulaEditorActivated as Et, whenSheetEditorFocused as bo, SheetsUIPart as yo, BaseSelectionRenderService as To, getCoordByOffset as An, checkInHeaderRanges as Fn, getAllSelection as No, genNormalSelectionStyle as ar, getSheetObject as Oo, MoveSelectionCommand as Dn, JumpOver as Ln, ExpandSelectionCommand as $n, EMBEDDING_FORMULA_EDITOR as xo, IMarkSelectionService as Mo, RANGE_SELECTOR_COMPONENT_KEY as wo, EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY as ko } from "@univerjs/sheets-ui";
|
|
6
|
+
import { sequenceNodeType as Q, serializeRange as Ce, FormulaDataModel as bt, LexerTreeBuilder as _e, ErrorType as ue, extractFormulaError as lr, SetFormulaCalculationResultMutation as Ao, SetArrayFormulaDataMutation as Fo, SetFormulaCalculationStopMutation as Do, FunctionType as ur, matchToken as je, deserializeRangeWithSheetWithCache as Lo, matchRefDrawToken as $o, isFormulaLexerToken as Po, deserializeRangeWithSheet as ht, serializeRangeToRefString as Uo, serializeRangeWithSheet as Ct, serializeRangeWithSpreadsheet as Vo, generateStringWithSequence as Wo, operatorToken as dr, UniverFormulaEnginePlugin as Ho } from "@univerjs/engine-formula";
|
|
7
|
+
import { Subject as mt, debounceTime as hn, combineLatestWith as Bo, map as hr, switchMap as qo, of as Pn, Observable as jo, BehaviorSubject as fr, throttleTime as Ko, filter as gr, distinctUntilChanged as Yo, merge as Go } from "rxjs";
|
|
8
|
+
import { IEditorService as Ye, DocSelectionRenderService as mr, ReplaceTextRunsCommand as Un, MoveSelectionOperation as Zo, MoveCursorOperation as zo, useKeyboardEvent as Xo, useResize as Qo, DocBackScrollRenderController as Jo, RichTextEditor as es } from "@univerjs/docs-ui";
|
|
9
|
+
import { DeviceInputEventType as Oe, IRenderManagerService as xe, ScrollTimerType as Xt, SHEET_VIEWPORT_KEY as Vn, Vector2 as Wn } from "@univerjs/engine-render";
|
|
10
|
+
import { SheetsSelectionsService as fn, getSheetCommandTarget as pr, getCellAtRowCol as ts, SetSelectionsOperation as gn, SheetInterceptorService as mn, ReorderRangeCommand as ns, SetRangeValuesMutation as Ft, SetRangeValuesUndoMutationFactory as rs, BEFORE_CELL_EDIT as os, SetWorksheetRowAutoHeightMutation as ss, INTERCEPTOR_POINT as is, WorksheetSetCellValuePermission as Ge, WorksheetEditPermission as Ze, RangeProtectionPermissionEditPoint as ze, WorkbookEditablePermission as Xe, IRefSelectionsService as Kt, SelectionMoveType as Qt, convertSelectionDataToRange as cs, setEndForRange as as, REF_SELECTIONS_ENABLED as Hn, SetWorksheetActiveOperation as Bn } from "@univerjs/sheets";
|
|
11
|
+
import { InsertFunctionCommand as ls, TriggerCalculationController as us, IDescriptionService as Yt, QuickSumCommand as ds, UniverSheetsFormulaPlugin as hs } from "@univerjs/sheets-formula";
|
|
12
|
+
import { ISidebarService as pn, IZenZoneService as fs, useDependency as T, useObservable as Se, ProgressBar as gs, MenuItemType as Qe, getMenuHiddenObservable as ft, IClipboardInterfaceService as qn, RibbonFormulasGroup as jn, KeyCode as L, MetaKeys as P, IMenuManagerService as ms, IShortcutService as Gt, IUIPartsService as Sr, ComponentManager as vr, connectInjector as Cr, useEvent as te, RectPopup as nn, IContextMenuService as ps, useUpdateEffect as Ss, BuiltInUIPart as vs } from "@univerjs/ui";
|
|
13
|
+
import { jsx as M, jsxs as W, Fragment as Cs } from "react/jsx-runtime";
|
|
14
|
+
import { useCallback as Dt, useState as V, useRef as z, createElement as Je, forwardRef as Le, useEffect as $, useMemo as ie, useLayoutEffect as Lt, useImperativeHandle as _s } from "react";
|
|
15
|
+
import { clsx as re, scrollbarClassName as lt, borderLeftClassName as Rs, Select as Is, Input as _r, borderClassName as Sn, Button as ct, borderTopClassName as Es, Tooltip as bs, Dialog as ys } from "@univerjs/design";
|
|
16
|
+
import { DocSelectionManagerService as Rr } from "@univerjs/docs";
|
|
17
|
+
import { debounceTime as Ts } from "rxjs/operators";
|
|
18
|
+
const vn = {
|
|
19
19
|
id: "sheet.command.paste-formula",
|
|
20
20
|
type: Ne.COMMAND,
|
|
21
|
-
handler: async (e) => e.get(
|
|
22
|
-
value:
|
|
21
|
+
handler: async (e) => e.get(me).executeCommand(go.id, {
|
|
22
|
+
value: it.SPECIAL_PASTE_FORMULA
|
|
23
23
|
})
|
|
24
|
-
},
|
|
24
|
+
}, gt = {
|
|
25
25
|
id: "formula-ui.operation.select-editor-formula",
|
|
26
26
|
type: Ne.OPERATION,
|
|
27
27
|
handler: (e, t) => !0
|
|
28
28
|
};
|
|
29
|
-
var Ns = Object.getOwnPropertyDescriptor,
|
|
29
|
+
var Ns = Object.getOwnPropertyDescriptor, Os = (e, t, n, o) => {
|
|
30
30
|
for (var r = o > 1 ? void 0 : o ? Ns(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
|
+
}, xs = (e, t) => (n, o) => t(n, o, e);
|
|
34
|
+
const Ms = "FORMULA_PROMPT_ACTIVATED", Zt = Zr("formula-ui.prompt-service");
|
|
35
|
+
let rn = class {
|
|
36
36
|
constructor(e) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
37
|
+
j(this, "_search$", new mt());
|
|
38
|
+
j(this, "_help$", new mt());
|
|
39
|
+
j(this, "_navigate$", new mt());
|
|
40
|
+
j(this, "_accept$", new mt());
|
|
41
|
+
j(this, "_acceptFormulaName$", new mt());
|
|
42
|
+
j(this, "search$", this._search$.asObservable());
|
|
43
|
+
j(this, "help$", this._help$.asObservable());
|
|
44
|
+
j(this, "navigate$", this._navigate$.asObservable());
|
|
45
|
+
j(this, "accept$", this._accept$.asObservable());
|
|
46
|
+
j(this, "acceptFormulaName$", this._acceptFormulaName$.asObservable());
|
|
47
|
+
j(this, "_searching", !1);
|
|
48
|
+
j(this, "_helping", !1);
|
|
49
|
+
j(this, "_sequenceNodes", []);
|
|
50
|
+
j(this, "_isLockedOnSelectionChangeRefString", !1);
|
|
51
|
+
j(this, "_isLockedOnSelectionInsertRefString", !1);
|
|
52
52
|
this._contextService = e;
|
|
53
53
|
}
|
|
54
54
|
dispose() {
|
|
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(Ms, e.visible), this._searching = e.visible, this._search$.next(e);
|
|
59
59
|
}
|
|
60
60
|
isSearching() {
|
|
61
61
|
return this._searching;
|
|
@@ -187,76 +187,76 @@ let on = class {
|
|
|
187
187
|
return this._isLockedOnSelectionInsertRefString;
|
|
188
188
|
}
|
|
189
189
|
};
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
],
|
|
193
|
-
const
|
|
190
|
+
rn = Os([
|
|
191
|
+
xs(0, cn)
|
|
192
|
+
], rn);
|
|
193
|
+
const ws = {
|
|
194
194
|
id: "formula-ui.operation.help-function",
|
|
195
195
|
type: Ne.OPERATION,
|
|
196
|
-
handler: async (e, t) => (e.get(
|
|
197
|
-
},
|
|
196
|
+
handler: async (e, t) => (e.get(Zt).help(t), !0)
|
|
197
|
+
}, pe = {
|
|
198
198
|
id: "formula-ui.operation.insert-function",
|
|
199
199
|
type: Ne.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(fn), o = e.get(Ye), r = n.getCurrentSelections();
|
|
204
204
|
if (!r || !r.length)
|
|
205
205
|
return !1;
|
|
206
|
-
const s =
|
|
206
|
+
const s = pr(e.get(ne));
|
|
207
207
|
if (!s) return !1;
|
|
208
|
-
const { worksheet: i, unitId: c, subUnitId: l } = s, g = i.getCellMatrix(), { value: m } = t, h = e.get(
|
|
209
|
-
e.get(
|
|
208
|
+
const { worksheet: i, unitId: c, subUnitId: l } = s, g = i.getCellMatrix(), { value: m } = t, h = e.get(me);
|
|
209
|
+
e.get(dn);
|
|
210
210
|
const d = [], u = [];
|
|
211
|
-
let a = null,
|
|
212
|
-
if (r.length === 1 && (
|
|
213
|
-
const { range:
|
|
214
|
-
a =
|
|
215
|
-
const A =
|
|
216
|
-
A && (
|
|
211
|
+
let a = null, v = 0, p = 0, S = "";
|
|
212
|
+
if (r.length === 1 && (Fs(r[0].range) || Ds(r[0].range) && Yn(g, r[0].range))) {
|
|
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
|
+
a = E, v = b, p = y;
|
|
215
|
+
const A = Kn(g, b, y);
|
|
216
|
+
A && (S = Ce(A));
|
|
217
217
|
} else
|
|
218
|
-
r.some((
|
|
218
|
+
r.some((E) => {
|
|
219
219
|
var y, A;
|
|
220
|
-
const { range: f, primary: b } =
|
|
221
|
-
if (
|
|
222
|
-
const F = (y = b == null ? void 0 : b.actualRow) != null ? y : f.startRow,
|
|
223
|
-
if (!
|
|
224
|
-
return a = f,
|
|
225
|
-
const k =
|
|
220
|
+
const { range: f, primary: b } = E;
|
|
221
|
+
if (Yn(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 = Kn(g, F, N);
|
|
223
|
+
if (!O)
|
|
224
|
+
return a = f, v = F, p = N, !0;
|
|
225
|
+
const k = Ce(O), I = `=${m}(${k})`;
|
|
226
226
|
d.push({
|
|
227
227
|
range: f,
|
|
228
228
|
primary: {
|
|
229
229
|
row: F,
|
|
230
|
-
column:
|
|
230
|
+
column: N
|
|
231
231
|
},
|
|
232
|
-
formula:
|
|
232
|
+
formula: I
|
|
233
233
|
});
|
|
234
234
|
} else {
|
|
235
|
-
const { startRow: F, startColumn:
|
|
236
|
-
if (F ===
|
|
237
|
-
const
|
|
235
|
+
const { startRow: F, startColumn: N, endRow: O, endColumn: k } = f;
|
|
236
|
+
if (F === O) {
|
|
237
|
+
const I = Ls(g, F, k, i.getColumnCount() - 1), x = I === k ? k - 1 : k, R = Ce({
|
|
238
238
|
startRow: F,
|
|
239
|
-
endRow:
|
|
240
|
-
startColumn:
|
|
239
|
+
endRow: O,
|
|
240
|
+
startColumn: N,
|
|
241
241
|
endColumn: x
|
|
242
242
|
}), w = `=${m}(${R})`;
|
|
243
243
|
u.push({
|
|
244
244
|
range: f,
|
|
245
245
|
primary: {
|
|
246
246
|
row: F,
|
|
247
|
-
column:
|
|
247
|
+
column: I
|
|
248
248
|
},
|
|
249
249
|
formula: w
|
|
250
250
|
});
|
|
251
251
|
} else {
|
|
252
|
-
let
|
|
253
|
-
for (let R =
|
|
254
|
-
const w =
|
|
255
|
-
|
|
252
|
+
let I = -1;
|
|
253
|
+
for (let R = N; R <= k; R++) {
|
|
254
|
+
const w = $s(g, R, O, i.getRowCount() - 1);
|
|
255
|
+
I = Math.max(I, w);
|
|
256
256
|
}
|
|
257
|
-
const x =
|
|
258
|
-
for (let R =
|
|
259
|
-
const w =
|
|
257
|
+
const x = I === O ? O - 1 : O;
|
|
258
|
+
for (let R = N; R <= k; R++) {
|
|
259
|
+
const w = Ce({
|
|
260
260
|
startRow: F,
|
|
261
261
|
endRow: x,
|
|
262
262
|
startColumn: R,
|
|
@@ -265,7 +265,7 @@ const ks = {
|
|
|
265
265
|
u.push({
|
|
266
266
|
range: f,
|
|
267
267
|
primary: {
|
|
268
|
-
row:
|
|
268
|
+
row: I,
|
|
269
269
|
column: R
|
|
270
270
|
},
|
|
271
271
|
formula: D
|
|
@@ -276,41 +276,41 @@ const ks = {
|
|
|
276
276
|
return !1;
|
|
277
277
|
});
|
|
278
278
|
if (a) {
|
|
279
|
-
const
|
|
280
|
-
range:
|
|
279
|
+
const E = ts(v, p, i), f = {
|
|
280
|
+
range: er.clone(a),
|
|
281
281
|
primary: {
|
|
282
|
-
startRow:
|
|
283
|
-
startColumn:
|
|
284
|
-
endRow:
|
|
285
|
-
endColumn:
|
|
286
|
-
actualRow:
|
|
282
|
+
startRow: E.startRow,
|
|
283
|
+
startColumn: E.startColumn,
|
|
284
|
+
endRow: E.endRow,
|
|
285
|
+
endColumn: E.endColumn,
|
|
286
|
+
actualRow: v,
|
|
287
287
|
actualColumn: p,
|
|
288
|
-
isMerged:
|
|
289
|
-
isMergedMainCell:
|
|
288
|
+
isMerged: E.isMerged,
|
|
289
|
+
isMergedMainCell: E.startRow === v && E.startColumn === p
|
|
290
290
|
}
|
|
291
291
|
}, b = {
|
|
292
292
|
unitId: c,
|
|
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(gn.id, b);
|
|
297
|
+
const y = o.getEditor(an), A = o.getEditor(tr);
|
|
298
|
+
h.syncExecuteCommand(sr.id, {
|
|
299
299
|
visible: !0,
|
|
300
300
|
unitId: c,
|
|
301
|
-
eventType:
|
|
301
|
+
eventType: Oe.Dblclick
|
|
302
302
|
});
|
|
303
|
-
const F = `=${m}(${
|
|
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(ls.id, {
|
|
307
307
|
list: d,
|
|
308
308
|
listOfRangeHasNumber: u
|
|
309
309
|
});
|
|
310
310
|
}
|
|
311
311
|
};
|
|
312
|
-
function
|
|
313
|
-
const o =
|
|
312
|
+
function Kn(e, t, n) {
|
|
313
|
+
const o = ks(e, t, n);
|
|
314
314
|
if (o !== t)
|
|
315
315
|
return {
|
|
316
316
|
startRow: o,
|
|
@@ -318,7 +318,7 @@ function Yn(e, t, n) {
|
|
|
318
318
|
startColumn: n,
|
|
319
319
|
endColumn: n
|
|
320
320
|
};
|
|
321
|
-
const r =
|
|
321
|
+
const r = As(e, t, n);
|
|
322
322
|
return r !== n ? {
|
|
323
323
|
startRow: t,
|
|
324
324
|
endRow: t,
|
|
@@ -326,16 +326,16 @@ function Yn(e, t, n) {
|
|
|
326
326
|
endColumn: n - 1
|
|
327
327
|
} : null;
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function ks(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--) {
|
|
333
333
|
const s = e.getValue(r, n);
|
|
334
|
-
if (
|
|
334
|
+
if (_t(s) && !o) {
|
|
335
335
|
if (r === 0) return 0;
|
|
336
336
|
o = !0;
|
|
337
337
|
} else {
|
|
338
|
-
if (o && !
|
|
338
|
+
if (o && !_t(s))
|
|
339
339
|
return r + 1;
|
|
340
340
|
if (o && r === 0)
|
|
341
341
|
return 0;
|
|
@@ -343,16 +343,16 @@ function As(e, t, n) {
|
|
|
343
343
|
}
|
|
344
344
|
return t;
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function As(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--) {
|
|
350
350
|
const s = e.getValue(t, r);
|
|
351
|
-
if (
|
|
351
|
+
if (_t(s) && !o) {
|
|
352
352
|
if (r === 0) return 0;
|
|
353
353
|
o = !0;
|
|
354
354
|
} else {
|
|
355
|
-
if (o && !
|
|
355
|
+
if (o && !_t(s))
|
|
356
356
|
return r + 1;
|
|
357
357
|
if (o && r === 0)
|
|
358
358
|
return 0;
|
|
@@ -360,69 +360,69 @@ function Fs(e, t, n) {
|
|
|
360
360
|
}
|
|
361
361
|
return n;
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function _t(e) {
|
|
364
364
|
if (e != null && e.p) {
|
|
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) === nr ? n.substring(0, n.length - 2) : n;
|
|
369
|
+
return zr(r);
|
|
370
370
|
}
|
|
371
|
-
return e && (e.t ===
|
|
371
|
+
return e && (e.t === xn.NUMBER || Xr(e) === xn.NUMBER);
|
|
372
372
|
}
|
|
373
|
-
function
|
|
373
|
+
function Fs(e) {
|
|
374
374
|
return e.startRow === e.endRow && e.startColumn === e.endColumn;
|
|
375
375
|
}
|
|
376
|
-
function
|
|
376
|
+
function Ds(e) {
|
|
377
377
|
return e.startRow !== e.endRow && e.startColumn !== e.endColumn;
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function Yn(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
|
-
if (
|
|
382
|
+
if (_t(e.getValue(n, o)))
|
|
383
383
|
return !1;
|
|
384
384
|
return !0;
|
|
385
385
|
}
|
|
386
|
-
function
|
|
386
|
+
function Ls(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 $s(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 Ir = "SHEET_FORMULA_UI_PLUGIN",
|
|
398
|
+
const Ir = "SHEET_FORMULA_UI_PLUGIN", Er = `${Ir}_MORE_FUNCTIONS_COMPONENT`, Cn = {
|
|
399
399
|
id: "formula-ui.operation.more-functions",
|
|
400
400
|
type: Ne.OPERATION,
|
|
401
|
-
handler: async (e) => (e.get(
|
|
401
|
+
handler: async (e) => (e.get(pn).open({
|
|
402
402
|
header: { title: "formula.insert.tooltip" },
|
|
403
|
-
children: { label:
|
|
403
|
+
children: { label: Er }
|
|
404
404
|
}), !0)
|
|
405
|
-
},
|
|
405
|
+
}, br = {
|
|
406
406
|
id: "formula-ui.operation.change-ref-to-absolute",
|
|
407
407
|
type: Ne.OPERATION,
|
|
408
408
|
handler: async (e) => !0
|
|
409
|
-
},
|
|
409
|
+
}, Ps = {
|
|
410
410
|
id: "formula-ui.operation.search-function",
|
|
411
411
|
type: Ne.OPERATION,
|
|
412
|
-
handler: async (e, t) => (e.get(
|
|
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 Us = Object.getOwnPropertyDescriptor, Vs = (e, t, n, o) => {
|
|
415
|
+
for (var r = o > 1 ? void 0 : o ? Us(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
|
+
}, wt = (e, t) => (n, o) => t(n, o, e);
|
|
419
|
+
let $t = class extends ut {
|
|
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 === ns.id ? this._reorderFormula(e.params) : {
|
|
426
426
|
redos: [],
|
|
427
427
|
undos: []
|
|
428
428
|
}
|
|
@@ -435,32 +435,32 @@ let Pt = class extends dt {
|
|
|
435
435
|
redos: t,
|
|
436
436
|
undos: n
|
|
437
437
|
};
|
|
438
|
-
const g = l.getCellMatrix(), m = new
|
|
438
|
+
const g = l.getCellMatrix(), m = new Fe(), h = new Fe();
|
|
439
439
|
let d = !1;
|
|
440
|
-
return
|
|
441
|
-
let
|
|
442
|
-
i.hasOwnProperty(u) && (
|
|
443
|
-
const p = g.getValue(
|
|
440
|
+
return Qr.foreach(s, (u, a) => {
|
|
441
|
+
let v = u;
|
|
442
|
+
i.hasOwnProperty(u) && (v = i[u]);
|
|
443
|
+
const p = g.getValue(v, a);
|
|
444
444
|
if (p != null && p.f || p != null && p.si) {
|
|
445
445
|
d = !0;
|
|
446
|
-
const
|
|
447
|
-
|
|
446
|
+
const S = this._formulaDataModel.getFormulaStringByCell(v, a, r, o), C = this._lexerTreeBuilder.moveFormulaRefOffset(
|
|
447
|
+
S,
|
|
448
448
|
0,
|
|
449
|
-
u -
|
|
450
|
-
), _ =
|
|
449
|
+
u - v
|
|
450
|
+
), _ = ln.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: Ft.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: Ft.id,
|
|
464
464
|
params: {
|
|
465
465
|
unitId: o,
|
|
466
466
|
subUnitId: r,
|
|
@@ -475,19 +475,19 @@ let Pt = class extends dt {
|
|
|
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
|
+
$t = Vs([
|
|
479
|
+
wt(0, q(mn)),
|
|
480
|
+
wt(1, q(ne)),
|
|
481
|
+
wt(2, q(bt)),
|
|
482
|
+
wt(3, q(_e))
|
|
483
|
+
], $t);
|
|
484
|
+
const yr = "sheets-formula-ui.base.config", Gn = {};
|
|
485
|
+
var Ws = Object.getOwnPropertyDescriptor, Hs = (e, t, n, o) => {
|
|
486
|
+
for (var r = o > 1 ? void 0 : o ? Ws(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
|
-
},
|
|
490
|
-
const
|
|
489
|
+
}, pt = (e, t) => (n, o) => t(n, o, e);
|
|
490
|
+
const Jt = "SHEET_FORMULA_ALERT", Bs = {
|
|
491
491
|
[ue.DIV_BY_ZERO]: "divByZero",
|
|
492
492
|
[ue.NAME]: "name",
|
|
493
493
|
[ue.VALUE]: "value",
|
|
@@ -501,7 +501,7 @@ const en = "SHEET_FORMULA_ALERT", js = {
|
|
|
501
501
|
[ue.CONNECT]: "connect",
|
|
502
502
|
[ue.NULL]: "null"
|
|
503
503
|
};
|
|
504
|
-
let
|
|
504
|
+
let on = class extends ut {
|
|
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,29 +509,29 @@ let sn = class extends dt {
|
|
|
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(hn(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;
|
|
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 (Jr(l)) {
|
|
519
|
+
const m = lr(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(Jt), 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
|
return;
|
|
527
527
|
this._cellAlertManagerService.showAlert({
|
|
528
528
|
type: So.ERROR,
|
|
529
529
|
title: this._localeService.t("formula.error.title"),
|
|
530
|
-
message: this._localeService.t(`formula.error.${
|
|
530
|
+
message: this._localeService.t(`formula.error.${Bs[m]}`),
|
|
531
531
|
location: e.location,
|
|
532
532
|
width: 200,
|
|
533
533
|
height: 74,
|
|
534
|
-
key:
|
|
534
|
+
key: Jt
|
|
535
535
|
});
|
|
536
536
|
return;
|
|
537
537
|
}
|
|
@@ -545,33 +545,33 @@ let sn = class extends dt {
|
|
|
545
545
|
}));
|
|
546
546
|
}
|
|
547
547
|
_hideAlert() {
|
|
548
|
-
this._cellAlertManagerService.removeAlert(
|
|
548
|
+
this._cellAlertManagerService.removeAlert(Jt);
|
|
549
549
|
}
|
|
550
550
|
};
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
],
|
|
558
|
-
var qs = Object.getOwnPropertyDescriptor,
|
|
551
|
+
on = Hs([
|
|
552
|
+
pt(1, q(mo)),
|
|
553
|
+
pt(2, q(po)),
|
|
554
|
+
pt(3, q(dt)),
|
|
555
|
+
pt(4, q(bt)),
|
|
556
|
+
pt(5, fs)
|
|
557
|
+
], on);
|
|
558
|
+
var qs = Object.getOwnPropertyDescriptor, js = (e, t, n, o) => {
|
|
559
559
|
for (var r = o > 1 ? void 0 : o ? qs(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
560
560
|
(i = e[s]) && (r = i(r) || r);
|
|
561
561
|
return r;
|
|
562
|
-
},
|
|
563
|
-
let
|
|
562
|
+
}, Zn = (e, t) => (n, o) => t(n, o, e);
|
|
563
|
+
let Pt = class extends ut {
|
|
564
564
|
constructor(e, t) {
|
|
565
565
|
super(), this._autoFillService = e, this._lexerTreeBuilder = t, this._registerAutoFill();
|
|
566
566
|
}
|
|
567
567
|
_registerAutoFill() {
|
|
568
568
|
const e = {
|
|
569
|
-
type:
|
|
569
|
+
type: kn.FORMULA,
|
|
570
570
|
priority: 1001,
|
|
571
|
-
match: (t) =>
|
|
572
|
-
isContinue: (t, n) => t.type ===
|
|
571
|
+
match: (t) => Ae(t == null ? void 0 : t.f) || at(t == null ? void 0 : t.si),
|
|
572
|
+
isContinue: (t, n) => t.type === kn.FORMULA,
|
|
573
573
|
applyFunctions: {
|
|
574
|
-
[
|
|
574
|
+
[Co.COPY]: (t, n, o, r, s) => {
|
|
575
575
|
const { data: i, index: c } = t;
|
|
576
576
|
return this._fillCopyFormula(i, n, o, c, r, s);
|
|
577
577
|
}
|
|
@@ -581,22 +581,22 @@ let Ut = class extends dt {
|
|
|
581
581
|
}
|
|
582
582
|
_fillCopyFormula(e, t, n, o, r, s) {
|
|
583
583
|
var g, m;
|
|
584
|
-
const i =
|
|
584
|
+
const i = Ys(r), c = [], l = /* @__PURE__ */ new Map();
|
|
585
585
|
for (let h = 1; h <= t; h++) {
|
|
586
|
-
const d = (h - 1) % e.length, u = o[d], a =
|
|
586
|
+
const d = (h - 1) % e.length, u = o[d], a = ln.deepClone(e[d]);
|
|
587
587
|
if (a) {
|
|
588
|
-
const
|
|
589
|
-
if (
|
|
588
|
+
const v = ((g = e[d]) == null ? void 0 : g.f) || "", p = ((m = e[d]) == null ? void 0 : m.si) || "", S = Ae(v);
|
|
589
|
+
if (at(p))
|
|
590
590
|
a.si = p, a.f = null, a.v = null, a.p = null, a.t = null, c.push(a);
|
|
591
|
-
else if (
|
|
591
|
+
else if (S) {
|
|
592
592
|
let _ = l.get(d);
|
|
593
593
|
if (_)
|
|
594
594
|
a.si = _, a.f = null, a.v = null, a.p = null, a.t = null;
|
|
595
595
|
else {
|
|
596
596
|
_ = qt(6), l.set(d, _);
|
|
597
|
-
const { offsetX:
|
|
598
|
-
|
|
599
|
-
|
|
597
|
+
const { offsetX: E, offsetY: f } = Ks(i, t, n, s, u), b = this._lexerTreeBuilder.moveFormulaRefOffset(
|
|
598
|
+
v,
|
|
599
|
+
E,
|
|
600
600
|
f
|
|
601
601
|
);
|
|
602
602
|
a.si = _, a.f = b, a.v = null, a.p = null, a.t = null;
|
|
@@ -608,11 +608,11 @@ let Ut = class extends dt {
|
|
|
608
608
|
return c;
|
|
609
609
|
}
|
|
610
610
|
};
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
],
|
|
615
|
-
function
|
|
611
|
+
Pt = js([
|
|
612
|
+
Zn(0, vo),
|
|
613
|
+
Zn(1, q(_e))
|
|
614
|
+
], Pt);
|
|
615
|
+
function Ks(e, t, n, o, r) {
|
|
616
616
|
const { source: s, target: i } = o, { rows: c } = i, { rows: l } = s;
|
|
617
617
|
let g = 0, m = 0;
|
|
618
618
|
switch (n) {
|
|
@@ -631,7 +631,7 @@ function Ys(e, t, n, o, r) {
|
|
|
631
631
|
}
|
|
632
632
|
return { offsetX: g, offsetY: m };
|
|
633
633
|
}
|
|
634
|
-
function
|
|
634
|
+
function Ys(e) {
|
|
635
635
|
let t = 0;
|
|
636
636
|
for (const n in e)
|
|
637
637
|
e[n].forEach((o) => {
|
|
@@ -639,13 +639,13 @@ function Gs(e) {
|
|
|
639
639
|
});
|
|
640
640
|
return t;
|
|
641
641
|
}
|
|
642
|
-
var
|
|
643
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
642
|
+
var Gs = Object.getOwnPropertyDescriptor, Zs = (e, t, n, o) => {
|
|
643
|
+
for (var r = o > 1 ? void 0 : o ? Gs(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
644
644
|
(i = e[s]) && (r = i(r) || r);
|
|
645
645
|
return r;
|
|
646
646
|
}, St = (e, t) => (n, o) => t(n, o, e);
|
|
647
|
-
const
|
|
648
|
-
let
|
|
647
|
+
const zs = "default-paste-formula";
|
|
648
|
+
let Ut = class extends ut {
|
|
649
649
|
constructor(e, t, n, o, r) {
|
|
650
650
|
super(), this._currentUniverSheet = e, this._lexerTreeBuilder = t, this._sheetClipboardService = n, this._injector = o, this._formulaDataModel = r, this._initialize();
|
|
651
651
|
}
|
|
@@ -657,7 +657,7 @@ let Vt = class extends dt {
|
|
|
657
657
|
}
|
|
658
658
|
_pasteFormulaHook() {
|
|
659
659
|
return {
|
|
660
|
-
id:
|
|
660
|
+
id: it.SPECIAL_PASTE_FORMULA,
|
|
661
661
|
priority: 10,
|
|
662
662
|
specialPasteInfo: { label: "specialPaste.formula" },
|
|
663
663
|
onPasteCells: (e, t, n, o) => this._onPasteCells(e, t, n, o, !0)
|
|
@@ -665,7 +665,7 @@ let Vt = class extends dt {
|
|
|
665
665
|
}
|
|
666
666
|
_pasteWithFormulaHook() {
|
|
667
667
|
return {
|
|
668
|
-
id:
|
|
668
|
+
id: zs,
|
|
669
669
|
priority: 10,
|
|
670
670
|
onPasteCells: (e, t, n, o) => this._onPasteCells(e, t, n, o, !1)
|
|
671
671
|
};
|
|
@@ -673,8 +673,8 @@ let Vt = class extends dt {
|
|
|
673
673
|
_onPasteCells(e, t, n, o, r) {
|
|
674
674
|
var d;
|
|
675
675
|
if ([
|
|
676
|
-
|
|
677
|
-
|
|
676
|
+
it.SPECIAL_PASTE_FORMAT,
|
|
677
|
+
it.SPECIAL_PASTE_COL_WIDTH
|
|
678
678
|
].includes(o.pasteType))
|
|
679
679
|
return {
|
|
680
680
|
undos: [],
|
|
@@ -687,11 +687,11 @@ let Vt = class extends dt {
|
|
|
687
687
|
redos: []
|
|
688
688
|
};
|
|
689
689
|
const g = t.range, m = n, h = {
|
|
690
|
-
copyType: o.copyType ||
|
|
690
|
+
copyType: o.copyType || ir.COPY,
|
|
691
691
|
copyRange: e == null ? void 0 : e.range,
|
|
692
692
|
pasteType: o.pasteType
|
|
693
693
|
};
|
|
694
|
-
return this._injector.invoke((u) =>
|
|
694
|
+
return this._injector.invoke((u) => Xs(
|
|
695
695
|
c,
|
|
696
696
|
l,
|
|
697
697
|
g,
|
|
@@ -705,15 +705,15 @@ let Vt = class extends dt {
|
|
|
705
705
|
));
|
|
706
706
|
}
|
|
707
707
|
};
|
|
708
|
-
|
|
708
|
+
Ut = Zs([
|
|
709
709
|
St(0, ne),
|
|
710
|
-
St(1,
|
|
711
|
-
St(2,
|
|
712
|
-
St(3,
|
|
713
|
-
St(4,
|
|
714
|
-
],
|
|
715
|
-
function
|
|
716
|
-
const m = [], h = [], d =
|
|
710
|
+
St(1, q(_e)),
|
|
711
|
+
St(2, _o),
|
|
712
|
+
St(3, q(Rt)),
|
|
713
|
+
St(4, q(bt))
|
|
714
|
+
], Ut);
|
|
715
|
+
function Xs(e, t, n, o, r, s, i, c, l = !1, g) {
|
|
716
|
+
const m = [], h = [], d = Qs(e, t, n, o, s, i, c, g);
|
|
717
717
|
if (!d.hasValue())
|
|
718
718
|
return {
|
|
719
719
|
undos: [],
|
|
@@ -725,97 +725,97 @@ function Qs(e, t, n, o, r, s, i, c, l = !1, g) {
|
|
|
725
725
|
cellValue: d.getData()
|
|
726
726
|
};
|
|
727
727
|
m.push({
|
|
728
|
-
id:
|
|
728
|
+
id: Ft.id,
|
|
729
729
|
params: u
|
|
730
730
|
});
|
|
731
|
-
const a =
|
|
731
|
+
const a = rs(
|
|
732
732
|
r,
|
|
733
733
|
u
|
|
734
734
|
);
|
|
735
735
|
return h.push({
|
|
736
|
-
id:
|
|
736
|
+
id: Ft.id,
|
|
737
737
|
params: a
|
|
738
738
|
}), {
|
|
739
739
|
undos: h,
|
|
740
740
|
redos: m
|
|
741
741
|
};
|
|
742
742
|
}
|
|
743
|
-
function
|
|
744
|
-
return c ? r.pasteType ===
|
|
743
|
+
function Qs(e, t, n, o, r, s, i, c) {
|
|
744
|
+
return c ? r.pasteType === it.SPECIAL_PASTE_VALUE ? ei(e, t, n, o, i, c) : r.pasteType === it.SPECIAL_PASTE_FORMULA ? ti(e, t, n, o, s, i, c) : ni(e, t, n, o, r.copyType, s, i, c) : Js(e, t, n, o, i);
|
|
745
745
|
}
|
|
746
|
-
function
|
|
747
|
-
const s = new
|
|
746
|
+
function Js(e, t, n, o, r) {
|
|
747
|
+
const s = new Fe(), i = r.getSheetFormulaData(e, t);
|
|
748
748
|
return o.forValue((c, l, g) => {
|
|
749
749
|
var u;
|
|
750
750
|
const m = n.rows[c], h = n.cols[l], d = {};
|
|
751
|
-
|
|
751
|
+
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));
|
|
752
752
|
}), s;
|
|
753
753
|
}
|
|
754
|
-
function
|
|
754
|
+
function ei(e, t, n, o, r, s) {
|
|
755
755
|
var g, m;
|
|
756
|
-
const i = new
|
|
756
|
+
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);
|
|
757
757
|
return o.forValue((h, d, u) => {
|
|
758
|
-
var _,
|
|
759
|
-
const a = s.range.rows[h % s.range.rows.length],
|
|
760
|
-
if (
|
|
761
|
-
C.v = u.v, C.f = null, C.si = null, C.p = null, i.setValue(p,
|
|
762
|
-
else if ((_ = c == null ? void 0 : c[a]) != null && _[
|
|
763
|
-
const f = c[a][
|
|
764
|
-
C.v = f.v, C.f = null, C.si = null, C.p = null, i.setValue(p,
|
|
765
|
-
} else if ((
|
|
758
|
+
var _, E;
|
|
759
|
+
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 = {};
|
|
760
|
+
if (Ae(u.f) || at(u.si))
|
|
761
|
+
C.v = u.v, C.f = null, C.si = null, C.p = null, i.setValue(p, S, C);
|
|
762
|
+
else if ((_ = c == null ? void 0 : c[a]) != null && _[v]) {
|
|
763
|
+
const f = c[a][v];
|
|
764
|
+
C.v = f.v, C.f = null, C.si = null, C.p = null, i.setValue(p, S, C);
|
|
765
|
+
} else if ((E = l == null ? void 0 : l[p]) != null && E[S]) {
|
|
766
766
|
if (C.v = u.v, C.f = null, C.si = null, C.p = null, u.p) {
|
|
767
|
-
const f =
|
|
767
|
+
const f = Tr(u);
|
|
768
768
|
f && (C.v = f);
|
|
769
769
|
}
|
|
770
|
-
i.setValue(p,
|
|
770
|
+
i.setValue(p, S, C);
|
|
771
771
|
}
|
|
772
772
|
}), i;
|
|
773
773
|
}
|
|
774
|
-
function
|
|
775
|
-
const c = new
|
|
774
|
+
function ti(e, t, n, o, r, s, i) {
|
|
775
|
+
const c = new Fe(), l = /* @__PURE__ */ new Map();
|
|
776
776
|
return o.forValue((g, m, h) => {
|
|
777
777
|
const d = n.rows[g], u = n.cols[m], a = {};
|
|
778
|
-
if (
|
|
778
|
+
if (at(h.si)) {
|
|
779
779
|
if (i.unitId !== e || i.subUnitId !== t) {
|
|
780
|
-
const
|
|
780
|
+
const v = s.getFormulaStringByCell(
|
|
781
781
|
i.range.rows[g % i.range.rows.length],
|
|
782
782
|
i.range.cols[m % i.range.cols.length],
|
|
783
783
|
i.subUnitId,
|
|
784
784
|
i.unitId
|
|
785
|
-
), p = n.cols[m] - i.range.cols[m % i.range.cols.length],
|
|
785
|
+
), p = n.cols[m] - i.range.cols[m % i.range.cols.length], S = n.rows[g] - i.range.rows[g % i.range.rows.length], C = r.moveFormulaRefOffset(v || "", p, S);
|
|
786
786
|
a.si = null, a.f = C;
|
|
787
787
|
} else
|
|
788
788
|
a.si = h.si, a.f = null;
|
|
789
789
|
a.v = null, a.p = null, c.setValue(d, u, a);
|
|
790
|
-
} else if (
|
|
791
|
-
const
|
|
792
|
-
let p = l.get(
|
|
790
|
+
} else if (Ae(h.f)) {
|
|
791
|
+
const v = `${g % i.range.rows.length}_${m % i.range.cols.length}`;
|
|
792
|
+
let p = l.get(v);
|
|
793
793
|
if (p)
|
|
794
794
|
a.si = p, a.f = null;
|
|
795
795
|
else {
|
|
796
|
-
p = qt(6), l.set(
|
|
797
|
-
const
|
|
796
|
+
p = qt(6), l.set(v, p);
|
|
797
|
+
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);
|
|
798
798
|
a.si = p, a.f = _;
|
|
799
799
|
}
|
|
800
800
|
a.v = null, a.p = null, c.setValue(d, u, a);
|
|
801
801
|
} else {
|
|
802
802
|
if (a.v = h.v, a.f = null, a.si = null, a.p = null, h.p) {
|
|
803
|
-
const
|
|
804
|
-
|
|
803
|
+
const v = Tr(h);
|
|
804
|
+
v && (a.v = v);
|
|
805
805
|
}
|
|
806
806
|
c.setValue(d, u, a);
|
|
807
807
|
}
|
|
808
808
|
}), c;
|
|
809
809
|
}
|
|
810
|
-
function
|
|
811
|
-
const l = new
|
|
812
|
-
return r ===
|
|
813
|
-
const
|
|
814
|
-
if (
|
|
815
|
-
if (
|
|
816
|
-
h.push(a.si),
|
|
810
|
+
function ni(e, t, n, o, r, s, i, c) {
|
|
811
|
+
const l = new Fe(), g = /* @__PURE__ */ new Map(), m = i.getSheetFormulaData(e, t), h = [];
|
|
812
|
+
return r === ir.CUT ? o.forValue((d, u, a) => {
|
|
813
|
+
const v = n.rows[d], p = n.cols[u], S = {};
|
|
814
|
+
if (at(a.si)) {
|
|
815
|
+
if (Ae(a.f))
|
|
816
|
+
h.push(a.si), S.f = a.f, S.si = a.si;
|
|
817
817
|
else if (h.includes(a.si))
|
|
818
|
-
|
|
818
|
+
S.f = null, S.si = a.si;
|
|
819
819
|
else {
|
|
820
820
|
const C = i.getFormulaStringByCell(
|
|
821
821
|
c.range.rows[d % c.range.rows.length],
|
|
@@ -823,47 +823,47 @@ function ri(e, t, n, o, r, s, i, c) {
|
|
|
823
823
|
c.subUnitId,
|
|
824
824
|
c.unitId
|
|
825
825
|
);
|
|
826
|
-
|
|
826
|
+
S.f = C, S.si = null;
|
|
827
827
|
}
|
|
828
|
-
|
|
829
|
-
} else
|
|
828
|
+
S.v = null, S.p = null, l.setValue(v, p, S);
|
|
829
|
+
} else Ae(a.f) && (S.f = a.f, S.si = null, S.v = null, S.p = null, l.setValue(v, p, S));
|
|
830
830
|
}) : o.forValue((d, u, a) => {
|
|
831
831
|
var C;
|
|
832
|
-
const
|
|
833
|
-
if (
|
|
832
|
+
const v = n.rows[d], p = n.cols[u], S = {};
|
|
833
|
+
if (at(a.si)) {
|
|
834
834
|
if (c.unitId !== e || c.subUnitId !== t) {
|
|
835
835
|
const _ = i.getFormulaStringByCell(
|
|
836
836
|
c.range.rows[d % c.range.rows.length],
|
|
837
837
|
c.range.cols[u % c.range.cols.length],
|
|
838
838
|
c.subUnitId,
|
|
839
839
|
c.unitId
|
|
840
|
-
),
|
|
841
|
-
|
|
840
|
+
), E = n.cols[u] - c.range.cols[u % c.range.cols.length], f = n.rows[d] - c.range.rows[d % c.range.rows.length], b = s.moveFormulaRefOffset(_ || "", E, f);
|
|
841
|
+
S.si = null, S.f = b;
|
|
842
842
|
} else
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
} else if (
|
|
843
|
+
S.si = a.si, S.f = null;
|
|
844
|
+
S.v = null, S.p = null, l.setValue(v, p, S);
|
|
845
|
+
} else if (Ae(a.f)) {
|
|
846
846
|
const _ = `${d % c.range.rows.length}_${u % c.range.cols.length}`;
|
|
847
|
-
let
|
|
848
|
-
if (
|
|
849
|
-
|
|
847
|
+
let E = g.get(_);
|
|
848
|
+
if (E)
|
|
849
|
+
S.si = E, S.f = null;
|
|
850
850
|
else {
|
|
851
|
-
|
|
851
|
+
E = qt(6), g.set(_, E);
|
|
852
852
|
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);
|
|
853
|
-
|
|
853
|
+
S.si = E, S.f = y;
|
|
854
854
|
}
|
|
855
|
-
|
|
856
|
-
} else (C = m == null ? void 0 : m[
|
|
857
|
-
}), h.length > 0 && new
|
|
855
|
+
S.v = null, S.p = null, l.setValue(v, p, S);
|
|
856
|
+
} else (C = m == null ? void 0 : m[v]) != null && C[p] && (S.v = a.v, S.f = null, S.si = null, S.p = a.p, l.setValue(v, p, S));
|
|
857
|
+
}), h.length > 0 && new Fe(m).forValue((d, u, a) => {
|
|
858
858
|
if (!(c.range.rows.includes(d) && c.range.cols.includes(u)) && !(n.rows.includes(d) && n.cols.includes(u)) && h.includes(a == null ? void 0 : a.si)) {
|
|
859
|
-
const
|
|
859
|
+
const v = i.getFormulaStringByCell(
|
|
860
860
|
d,
|
|
861
861
|
u,
|
|
862
862
|
c.subUnitId,
|
|
863
863
|
c.unitId
|
|
864
864
|
);
|
|
865
865
|
l.setValue(d, u, {
|
|
866
|
-
f:
|
|
866
|
+
f: v,
|
|
867
867
|
si: null,
|
|
868
868
|
v: null,
|
|
869
869
|
p: null
|
|
@@ -871,25 +871,25 @@ function ri(e, t, n, o, r, s, i, c) {
|
|
|
871
871
|
}
|
|
872
872
|
}), l;
|
|
873
873
|
}
|
|
874
|
-
function
|
|
874
|
+
function Tr(e) {
|
|
875
875
|
if (e != null && e.p) {
|
|
876
876
|
const t = e == null ? void 0 : e.p.body;
|
|
877
877
|
if (t == null)
|
|
878
878
|
return;
|
|
879
879
|
const n = t.dataStream;
|
|
880
|
-
return n.substring(n.length - 2, n.length) ===
|
|
880
|
+
return n.substring(n.length - 2, n.length) === nr ? n.substring(0, n.length - 2) : n;
|
|
881
881
|
}
|
|
882
882
|
}
|
|
883
|
-
var
|
|
884
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
883
|
+
var ri = Object.getOwnPropertyDescriptor, oi = (e, t, n, o) => {
|
|
884
|
+
for (var r = o > 1 ? void 0 : o ? ri(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
885
885
|
(i = e[s]) && (r = i(r) || r);
|
|
886
886
|
return r;
|
|
887
|
-
},
|
|
888
|
-
let
|
|
887
|
+
}, He = (e, t) => (n, o) => t(n, o, e);
|
|
888
|
+
let Vt = class extends ut {
|
|
889
889
|
constructor(t, n, o, r, s, i, c, l) {
|
|
890
890
|
super();
|
|
891
|
-
|
|
892
|
-
|
|
891
|
+
j(this, "_previousShape");
|
|
892
|
+
j(this, "_skeleton");
|
|
893
893
|
this._context = t, this._sheetInterceptorService = n, this._formulaDataModel = o, this._themeService = r, this._renderManagerService = s, this._sheetSkeletonManagerService = i, this._commandService = c, this._logService = l, this._initSkeletonChangeListener(), this._initInterceptorEditorStart(), this._commandExecutedListener();
|
|
894
894
|
}
|
|
895
895
|
_initSkeletonChangeListener() {
|
|
@@ -915,18 +915,18 @@ let Wt = class extends dt {
|
|
|
915
915
|
}
|
|
916
916
|
_initInterceptorEditorStart() {
|
|
917
917
|
this.disposeWithMe(
|
|
918
|
-
|
|
919
|
-
this._sheetInterceptorService.writeCellInterceptor.intercept(
|
|
918
|
+
rr(
|
|
919
|
+
this._sheetInterceptorService.writeCellInterceptor.intercept(os, {
|
|
920
920
|
handler: (t, n, o) => {
|
|
921
|
-
var a,
|
|
921
|
+
var a, v, p, S;
|
|
922
922
|
const { row: r, col: s, unitId: i, subUnitId: c, worksheet: l } = n, g = this._formulaDataModel.getArrayFormulaRange(), m = this._formulaDataModel.getArrayFormulaCellData();
|
|
923
923
|
if (this._removeArrayFormulaRangeShape(), t == null)
|
|
924
924
|
return o(t);
|
|
925
925
|
let h = null;
|
|
926
926
|
const d = this._formulaDataModel.getFormulaStringByCell(r, s, c, i);
|
|
927
|
-
if (d !== null && (h = { f: d }), t.v != null && t.v !== "" && ((p = (
|
|
927
|
+
if (d !== null && (h = { f: d }), t.v != null && t.v !== "" && ((p = (v = (a = m[i]) == null ? void 0 : a[c]) == null ? void 0 : v[r]) == null ? void 0 : p[s]) == null)
|
|
928
928
|
return h ? { ...t, ...h } : o(t);
|
|
929
|
-
const u = (
|
|
929
|
+
const u = (S = g == null ? void 0 : g[i]) == null ? void 0 : S[c];
|
|
930
930
|
return u != null && (h = this._displayArrayFormulaRangeShape(u, r, s, i, c, l, h)), h ? { ...t, ...h } : o(t);
|
|
931
931
|
}
|
|
932
932
|
})
|
|
@@ -935,10 +935,10 @@ let Wt = class extends dt {
|
|
|
935
935
|
}
|
|
936
936
|
_commandExecutedListener() {
|
|
937
937
|
this.disposeWithMe(this._commandService.onCommandExecuted((t, n) => {
|
|
938
|
-
(t.id ===
|
|
938
|
+
(t.id === Ao.id || t.id === Fo.id && n && n.remove) && this._removeArrayFormulaRangeShape();
|
|
939
939
|
})), this.disposeWithMe(
|
|
940
940
|
this._commandService.beforeCommandExecuted((t) => {
|
|
941
|
-
|
|
941
|
+
ss.id === t.id && requestIdleCallback(() => {
|
|
942
942
|
const n = t.params, { unitId: o, subUnitId: r, rowsAutoHeightInfo: s } = n;
|
|
943
943
|
this._refreshArrayFormulaRangeShapeByRow(o, r, s);
|
|
944
944
|
});
|
|
@@ -947,16 +947,16 @@ let Wt = class extends dt {
|
|
|
947
947
|
}
|
|
948
948
|
_displayArrayFormulaRangeShape(t, n, o, r, s, i, c) {
|
|
949
949
|
const l = this._formulaDataModel.getSheetFormulaData(r, s);
|
|
950
|
-
return new
|
|
950
|
+
return new Fe(t).forValue((g, m, h) => {
|
|
951
951
|
var p;
|
|
952
952
|
if (h == null)
|
|
953
953
|
return !0;
|
|
954
|
-
const { startRow: d, startColumn: u, endRow: a, endColumn:
|
|
954
|
+
const { startRow: d, startColumn: u, endRow: a, endColumn: v } = h;
|
|
955
955
|
if (g === n && m === o)
|
|
956
956
|
return this._createArrayFormulaRangeShape(h, r), !1;
|
|
957
|
-
if (n >= d && n <= a && o >= u && o <=
|
|
958
|
-
const
|
|
959
|
-
if ((
|
|
957
|
+
if (n >= d && n <= a && o >= u && o <= v) {
|
|
958
|
+
const S = i.getCell(d, u);
|
|
959
|
+
if ((S == null ? void 0 : S.v) === ue.SPILL)
|
|
960
960
|
return;
|
|
961
961
|
const C = (p = l == null ? void 0 : l[g]) == null ? void 0 : p[m];
|
|
962
962
|
return C == null || C.f == null ? !0 : (c == null && (c = {
|
|
@@ -977,10 +977,10 @@ let Wt = class extends dt {
|
|
|
977
977
|
style: {
|
|
978
978
|
strokeWidth: 1,
|
|
979
979
|
stroke: this._themeService.getColorFromTheme("primary.600"),
|
|
980
|
-
fill: new
|
|
980
|
+
fill: new un(this._themeService.getColorFromTheme("white")).setAlpha(0).toString(),
|
|
981
981
|
widgets: {}
|
|
982
982
|
}
|
|
983
|
-
}, c =
|
|
983
|
+
}, c = tn(i, r), { rowHeaderWidth: l, columnHeaderHeight: g } = r, m = new cr(s, Ro.FORMULA_EDITOR_SHOW, this._themeService, {
|
|
984
984
|
highlightHeader: !1,
|
|
985
985
|
rowHeaderWidth: l,
|
|
986
986
|
columnHeaderHeight: g
|
|
@@ -1023,38 +1023,38 @@ let Wt = class extends dt {
|
|
|
1023
1023
|
}
|
|
1024
1024
|
}
|
|
1025
1025
|
};
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
],
|
|
1035
|
-
var
|
|
1036
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
1026
|
+
Vt = oi([
|
|
1027
|
+
He(1, q(mn)),
|
|
1028
|
+
He(2, q(bt)),
|
|
1029
|
+
He(3, q(It)),
|
|
1030
|
+
He(4, xe),
|
|
1031
|
+
He(5, q(jt)),
|
|
1032
|
+
He(6, me),
|
|
1033
|
+
He(7, eo)
|
|
1034
|
+
], Vt);
|
|
1035
|
+
var si = Object.getOwnPropertyDescriptor, ii = (e, t, n, o) => {
|
|
1036
|
+
for (var r = o > 1 ? void 0 : o ? si(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
1037
1037
|
(i = e[s]) && (r = i(r) || r);
|
|
1038
1038
|
return r;
|
|
1039
|
-
},
|
|
1040
|
-
const
|
|
1039
|
+
}, zn = (e, t) => (n, o) => t(n, o, e);
|
|
1040
|
+
const ci = {
|
|
1041
1041
|
tl: {
|
|
1042
1042
|
size: 6,
|
|
1043
1043
|
color: "#409f11"
|
|
1044
1044
|
}
|
|
1045
1045
|
};
|
|
1046
|
-
let
|
|
1046
|
+
let Wt = class extends to {
|
|
1047
1047
|
constructor(e, t) {
|
|
1048
1048
|
super(), this._sheetInterceptorService = e, this._formulaDataModel = t, this.disposeWithMe(this._sheetInterceptorService.intercept(
|
|
1049
|
-
|
|
1049
|
+
is.CELL_CONTENT,
|
|
1050
1050
|
{
|
|
1051
|
-
effect:
|
|
1051
|
+
effect: no.Style,
|
|
1052
1052
|
handler: (n, o, r) => {
|
|
1053
1053
|
var c, l, g, m;
|
|
1054
1054
|
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];
|
|
1055
|
-
return !
|
|
1055
|
+
return !lr(n, !!s) || !n || (n === o.rawData && (n = { ...o.rawData }), n.markers = {
|
|
1056
1056
|
...n == null ? void 0 : n.markers,
|
|
1057
|
-
...
|
|
1057
|
+
...ci
|
|
1058
1058
|
}), r(n);
|
|
1059
1059
|
},
|
|
1060
1060
|
priority: 10
|
|
@@ -1062,19 +1062,19 @@ let Ht = class extends no {
|
|
|
1062
1062
|
));
|
|
1063
1063
|
}
|
|
1064
1064
|
};
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
],
|
|
1069
|
-
function
|
|
1070
|
-
const e = T(
|
|
1071
|
-
t.executeCommand(
|
|
1072
|
-
}, [t]), r =
|
|
1065
|
+
Wt = ii([
|
|
1066
|
+
zn(0, q(mn)),
|
|
1067
|
+
zn(1, q(bt))
|
|
1068
|
+
], Wt);
|
|
1069
|
+
function ai() {
|
|
1070
|
+
const e = T(us), t = T(me), n = Se(e.progress$), o = Dt(() => {
|
|
1071
|
+
t.executeCommand(Do.id);
|
|
1072
|
+
}, [t]), r = Dt(() => {
|
|
1073
1073
|
e.clearProgress();
|
|
1074
1074
|
}, [e]);
|
|
1075
|
-
return /* @__PURE__ */ M(
|
|
1075
|
+
return /* @__PURE__ */ M(gs, { progress: n, onTerminate: o, onClearProgress: r });
|
|
1076
1076
|
}
|
|
1077
|
-
function
|
|
1077
|
+
function li(e, t) {
|
|
1078
1078
|
return Object.keys(e).filter((n) => isNaN(Number(n)) && n !== "DefinedName").map((n) => ({
|
|
1079
1079
|
label: t.t(`formula.functionType.${n.toLocaleLowerCase()}`),
|
|
1080
1080
|
value: `${e[n]}`
|
|
@@ -1090,7 +1090,7 @@ function Nr(e) {
|
|
|
1090
1090
|
if (e.require && e.repeat)
|
|
1091
1091
|
return `${e.name},...`;
|
|
1092
1092
|
}
|
|
1093
|
-
function
|
|
1093
|
+
function Or(e) {
|
|
1094
1094
|
const { prefix: t, value: n } = e;
|
|
1095
1095
|
return /* @__PURE__ */ W("div", { children: [
|
|
1096
1096
|
/* @__PURE__ */ W("span", { children: [
|
|
@@ -1104,7 +1104,7 @@ function xr(e) {
|
|
|
1104
1104
|
")"
|
|
1105
1105
|
] });
|
|
1106
1106
|
}
|
|
1107
|
-
function
|
|
1107
|
+
function vt(e) {
|
|
1108
1108
|
const { className: t, value: n, title: o } = e;
|
|
1109
1109
|
return /* @__PURE__ */ W("div", { className: "univer-mb-2 univer-text-xs", children: [
|
|
1110
1110
|
/* @__PURE__ */ M(
|
|
@@ -1123,125 +1123,258 @@ function Ct(e) {
|
|
|
1123
1123
|
)
|
|
1124
1124
|
] });
|
|
1125
1125
|
}
|
|
1126
|
-
function
|
|
1126
|
+
function ui(e) {
|
|
1127
1127
|
const { functionInfo: t, onChange: n } = e;
|
|
1128
1128
|
if (!t) return null;
|
|
1129
1129
|
const [o, r] = V([]), [s, i] = V(t.functionParameter), [c, l] = V(-1);
|
|
1130
1130
|
return /* @__PURE__ */ W("div", { children: [
|
|
1131
|
-
/* @__PURE__ */ M("div", { className: re("univer-h-[364px] univer-overflow-y-auto",
|
|
1131
|
+
/* @__PURE__ */ M("div", { className: re("univer-h-[364px] univer-overflow-y-auto", lt), children: s.map((g, m) => /* @__PURE__ */ W("div", { children: [
|
|
1132
1132
|
/* @__PURE__ */ M("div", { className: "univer-text-sm", children: g.name }),
|
|
1133
1133
|
/* @__PURE__ */ M("div", { className: "univer-mb-2 univer-mt-1" })
|
|
1134
1134
|
] }, m)) }),
|
|
1135
|
-
/* @__PURE__ */ M("div", { className: re("univer-flex-1 univer-p-3",
|
|
1136
|
-
|
|
1135
|
+
/* @__PURE__ */ M("div", { className: re("univer-flex-1 univer-p-3", Rs), children: /* @__PURE__ */ M(
|
|
1136
|
+
vt,
|
|
1137
1137
|
{
|
|
1138
|
-
title: c === -1 ? /* @__PURE__ */ M(
|
|
1138
|
+
title: c === -1 ? /* @__PURE__ */ M(Or, { prefix: t.functionName, value: s }) : s[c].name,
|
|
1139
1139
|
value: c === -1 ? t.description : s[c].detail
|
|
1140
1140
|
}
|
|
1141
1141
|
) })
|
|
1142
1142
|
] });
|
|
1143
1143
|
}
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
return Mr(n, "".concat(o), { defIds: n.defIds, idSuffix: l.current }, me({ ref: t, className: c }, i), s);
|
|
1162
|
-
});
|
|
1163
|
-
function Mr(e, t, n, o, r) {
|
|
1164
|
-
return et(e.tag, me(me({ key: t }, fi(e, n, r)), o), (gi(e, n).children || []).map(function(s, i) {
|
|
1165
|
-
return Mr(s, "".concat(t, "-").concat(e.tag, "-").concat(i), n, void 0, r);
|
|
1166
|
-
}));
|
|
1144
|
+
function et({ ref: e, ...t }) {
|
|
1145
|
+
const { icon: n, id: o, className: r, extend: s, ...i } = t, c = `univerjs-icon univerjs-icon-${o} ${r || ""}`.trim(), l = z(`_${fi()}`);
|
|
1146
|
+
return xr(n, `${o}`, {
|
|
1147
|
+
defIds: n.defIds,
|
|
1148
|
+
idSuffix: l.current
|
|
1149
|
+
}, {
|
|
1150
|
+
ref: e,
|
|
1151
|
+
className: c,
|
|
1152
|
+
...i
|
|
1153
|
+
}, s);
|
|
1154
|
+
}
|
|
1155
|
+
function xr(e, t, n, o, r) {
|
|
1156
|
+
return Je(e.tag, {
|
|
1157
|
+
key: t,
|
|
1158
|
+
...di(e, n, r),
|
|
1159
|
+
...o
|
|
1160
|
+
}, (hi(e, n).children || []).map((s, i) => xr(s, `${t}-${e.tag}-${i}`, n, void 0, r)));
|
|
1167
1161
|
}
|
|
1168
|
-
function
|
|
1169
|
-
|
|
1170
|
-
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(
|
|
1171
|
-
|
|
1172
|
-
i === "mask" && typeof c == "string" && (o[i] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
|
|
1162
|
+
function di(e, t, n) {
|
|
1163
|
+
const o = { ...e.attrs };
|
|
1164
|
+
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]) => {
|
|
1165
|
+
s === "mask" && typeof i == "string" && (o[s] = i.replace(/url\(#(.*)\)/, `url(#$1${t.idSuffix})`));
|
|
1173
1166
|
});
|
|
1174
|
-
|
|
1175
|
-
return !r || r.length === 0 || (e.tag === "use" && o["xlink:href"] && (o["xlink:href"] = o["xlink:href"] + t.idSuffix), Object.entries(o).forEach(
|
|
1176
|
-
|
|
1177
|
-
typeof c == "string" && (o[i] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
|
|
1167
|
+
const { defIds: r } = t;
|
|
1168
|
+
return !r || r.length === 0 || (e.tag === "use" && o["xlink:href"] && (o["xlink:href"] = o["xlink:href"] + t.idSuffix), Object.entries(o).forEach(([s, i]) => {
|
|
1169
|
+
typeof i == "string" && (o[s] = i.replace(/url\(#(.*)\)/, `url(#$1${t.idSuffix})`));
|
|
1178
1170
|
})), o;
|
|
1179
1171
|
}
|
|
1180
|
-
function
|
|
1181
|
-
var
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1172
|
+
function hi(e, t) {
|
|
1173
|
+
var o;
|
|
1174
|
+
const { defIds: n } = t;
|
|
1175
|
+
return !n || n.length === 0 ? e : e.tag === "defs" && ((o = e.children) != null && o.length) ? {
|
|
1176
|
+
...e,
|
|
1177
|
+
children: e.children.map((r) => typeof r.attrs.id == "string" && n && n.includes(r.attrs.id) ? {
|
|
1178
|
+
...r,
|
|
1179
|
+
attrs: {
|
|
1180
|
+
...r.attrs,
|
|
1181
|
+
id: r.attrs.id + t.idSuffix
|
|
1182
|
+
}
|
|
1183
|
+
} : r)
|
|
1184
|
+
} : e;
|
|
1185
1185
|
}
|
|
1186
|
-
function
|
|
1186
|
+
function fi() {
|
|
1187
1187
|
return Math.random().toString(36).substring(2, 8);
|
|
1188
1188
|
}
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1189
|
+
et.displayName = "UniverIcon";
|
|
1190
|
+
const gi = {
|
|
1191
|
+
tag: "svg",
|
|
1192
|
+
attrs: {
|
|
1193
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1194
|
+
fill: "none",
|
|
1195
|
+
viewBox: "0 0 16 16",
|
|
1196
|
+
width: "1em",
|
|
1197
|
+
height: "1em"
|
|
1198
|
+
},
|
|
1199
|
+
children: [{
|
|
1200
|
+
tag: "path",
|
|
1201
|
+
attrs: {
|
|
1202
|
+
fill: "currentColor",
|
|
1203
|
+
d: "M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z",
|
|
1204
|
+
fillRule: "evenodd",
|
|
1205
|
+
clipRule: "evenodd"
|
|
1206
|
+
}
|
|
1207
|
+
}]
|
|
1208
|
+
}, Mr = Le(function(t, n) {
|
|
1209
|
+
return Je(et, Object.assign({}, t, {
|
|
1192
1210
|
id: "check-mark-icon",
|
|
1193
|
-
ref:
|
|
1194
|
-
icon:
|
|
1211
|
+
ref: n,
|
|
1212
|
+
icon: gi
|
|
1195
1213
|
}));
|
|
1196
1214
|
});
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1215
|
+
Mr.displayName = "CheckMarkIcon";
|
|
1216
|
+
const mi = {
|
|
1217
|
+
tag: "svg",
|
|
1218
|
+
attrs: {
|
|
1219
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1220
|
+
fill: "none",
|
|
1221
|
+
viewBox: "0 0 16 16",
|
|
1222
|
+
width: "1em",
|
|
1223
|
+
height: "1em"
|
|
1224
|
+
},
|
|
1225
|
+
children: [{
|
|
1226
|
+
tag: "path",
|
|
1227
|
+
attrs: {
|
|
1228
|
+
fill: "currentColor",
|
|
1229
|
+
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"
|
|
1230
|
+
}
|
|
1231
|
+
}]
|
|
1232
|
+
}, wr = Le(function(t, n) {
|
|
1233
|
+
return Je(et, Object.assign({}, t, {
|
|
1200
1234
|
id: "close-icon",
|
|
1201
|
-
ref:
|
|
1202
|
-
icon:
|
|
1235
|
+
ref: n,
|
|
1236
|
+
icon: mi
|
|
1203
1237
|
}));
|
|
1204
1238
|
});
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1239
|
+
wr.displayName = "CloseIcon";
|
|
1240
|
+
const pi = {
|
|
1241
|
+
tag: "svg",
|
|
1242
|
+
attrs: {
|
|
1243
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1244
|
+
fill: "none",
|
|
1245
|
+
viewBox: "0 0 16 16",
|
|
1246
|
+
width: "1em",
|
|
1247
|
+
height: "1em"
|
|
1248
|
+
},
|
|
1249
|
+
children: [
|
|
1250
|
+
{
|
|
1251
|
+
tag: "path",
|
|
1252
|
+
attrs: {
|
|
1253
|
+
fill: "currentColor",
|
|
1254
|
+
d: "M5.3313 1.4667C5.3313 1.13533 5.59993 0.866699 5.9313 0.866699H10.069C10.4004 0.866699 10.669 1.13533 10.669 1.4667C10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667Z"
|
|
1255
|
+
}
|
|
1256
|
+
},
|
|
1257
|
+
{
|
|
1258
|
+
tag: "path",
|
|
1259
|
+
attrs: {
|
|
1260
|
+
fill: "currentColor",
|
|
1261
|
+
d: "M1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443C14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443Z"
|
|
1262
|
+
}
|
|
1263
|
+
},
|
|
1264
|
+
{
|
|
1265
|
+
tag: "path",
|
|
1266
|
+
attrs: {
|
|
1267
|
+
fill: "currentColor",
|
|
1268
|
+
d: "M6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928L9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171C10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778L9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539C9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263L6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539C5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778L6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171Z"
|
|
1269
|
+
}
|
|
1270
|
+
},
|
|
1271
|
+
{
|
|
1272
|
+
tag: "path",
|
|
1273
|
+
attrs: {
|
|
1274
|
+
fill: "currentColor",
|
|
1275
|
+
d: "M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",
|
|
1276
|
+
fillRule: "evenodd",
|
|
1277
|
+
clipRule: "evenodd"
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
]
|
|
1281
|
+
}, kr = Le(function(t, n) {
|
|
1282
|
+
return Je(et, Object.assign({}, t, {
|
|
1208
1283
|
id: "delete-icon",
|
|
1209
|
-
ref:
|
|
1210
|
-
icon:
|
|
1284
|
+
ref: n,
|
|
1285
|
+
icon: pi
|
|
1211
1286
|
}));
|
|
1212
1287
|
});
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1288
|
+
kr.displayName = "DeleteIcon";
|
|
1289
|
+
const Si = {
|
|
1290
|
+
tag: "svg",
|
|
1291
|
+
attrs: {
|
|
1292
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1293
|
+
fill: "none",
|
|
1294
|
+
viewBox: "0 0 16 16",
|
|
1295
|
+
width: "1em",
|
|
1296
|
+
height: "1em"
|
|
1297
|
+
},
|
|
1298
|
+
children: [{
|
|
1299
|
+
tag: "path",
|
|
1300
|
+
attrs: {
|
|
1301
|
+
fill: "currentColor",
|
|
1302
|
+
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"
|
|
1303
|
+
}
|
|
1304
|
+
}]
|
|
1305
|
+
}, Ar = Le(function(t, n) {
|
|
1306
|
+
return Je(et, Object.assign({}, t, {
|
|
1216
1307
|
id: "increase-icon",
|
|
1217
|
-
ref:
|
|
1218
|
-
icon:
|
|
1308
|
+
ref: n,
|
|
1309
|
+
icon: Si
|
|
1219
1310
|
}));
|
|
1220
1311
|
});
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1312
|
+
Ar.displayName = "IncreaseIcon";
|
|
1313
|
+
const vi = {
|
|
1314
|
+
tag: "svg",
|
|
1315
|
+
attrs: {
|
|
1316
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1317
|
+
fill: "none",
|
|
1318
|
+
viewBox: "0 0 16 16",
|
|
1319
|
+
width: "1em",
|
|
1320
|
+
height: "1em"
|
|
1321
|
+
},
|
|
1322
|
+
children: [{
|
|
1323
|
+
tag: "path",
|
|
1324
|
+
attrs: {
|
|
1325
|
+
fill: "currentColor",
|
|
1326
|
+
d: "M5.90913 3.57564C6.14345 3.34132 6.52335 3.34132 6.75766 3.57564L10.7577 7.57564C10.992 7.80995 10.992 8.18985 10.7577 8.42417L6.75766 12.4242C6.52335 12.6585 6.14345 12.6585 5.90913 12.4242C5.67482 12.1899 5.67482 11.81 5.90913 11.5756L9.48487 7.9999L5.90913 4.42417C5.67482 4.18985 5.67482 3.80995 5.90913 3.57564Z",
|
|
1327
|
+
fillRule: "evenodd",
|
|
1328
|
+
clipRule: "evenodd"
|
|
1329
|
+
}
|
|
1330
|
+
}]
|
|
1331
|
+
}, Fr = Le(function(t, n) {
|
|
1332
|
+
return Je(et, Object.assign({}, t, {
|
|
1224
1333
|
id: "more-icon",
|
|
1225
|
-
ref:
|
|
1226
|
-
icon:
|
|
1334
|
+
ref: n,
|
|
1335
|
+
icon: vi
|
|
1227
1336
|
}));
|
|
1228
1337
|
});
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1338
|
+
Fr.displayName = "MoreIcon";
|
|
1339
|
+
const Ci = {
|
|
1340
|
+
tag: "svg",
|
|
1341
|
+
attrs: {
|
|
1342
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1343
|
+
fill: "none",
|
|
1344
|
+
viewBox: "0 0 16 16",
|
|
1345
|
+
width: "1em",
|
|
1346
|
+
height: "1em"
|
|
1347
|
+
},
|
|
1348
|
+
children: [{
|
|
1349
|
+
tag: "path",
|
|
1350
|
+
attrs: {
|
|
1351
|
+
fill: "currentColor",
|
|
1352
|
+
d: "M12.6185 12.4423C12.5907 12.2749 12.7773 12.15 12.9343 12.2308L15.4242 13.5126C15.6102 13.6084 15.5544 13.8745 15.3439 13.8955L14.2456 14.184L13.4521 15.1286C13.3495 15.2939 13.085 15.2463 13.0534 15.0568L12.6185 12.4423Z"
|
|
1353
|
+
}
|
|
1354
|
+
}, {
|
|
1355
|
+
tag: "path",
|
|
1356
|
+
attrs: {
|
|
1357
|
+
fill: "currentColor",
|
|
1358
|
+
d: "M1 3.6C1 2.16406 2.16406 1 3.6 1H12.3C13.7359 1 14.9 2.16406 14.9 3.6V5.81156C14.9003 5.81881 14.9004 5.82609 14.9004 5.8334C14.9004 5.84071 14.9003 5.84799 14.9 5.85524V10.045C14.9003 10.0522 14.9004 10.0595 14.9004 10.0668C14.9004 10.3982 14.6318 10.6668 14.3004 10.6668H11.1668C10.8907 10.6668 10.6668 10.8907 10.6668 11.1668V14.3C10.6668 14.6314 10.3982 14.9 10.0668 14.9L10.05 14.8998L3.6 14.9C2.16406 14.9 1 13.7359 1 12.3V3.6ZM13.2 5.2334C13.4761 5.2334 13.7 5.00954 13.7 4.7334V3.6C13.7 2.8268 13.0732 2.2 12.3 2.2H11.1668C10.8907 2.2 10.6668 2.42386 10.6668 2.7V4.7334C10.6668 5.00954 10.8907 5.2334 11.1668 5.2334H13.2ZM10.6668 6.9334C10.6668 6.65726 10.8907 6.4334 11.1668 6.4334H13.2C13.4761 6.4334 13.7 6.65726 13.7 6.9334V8.9668C13.7 9.24294 13.4761 9.4668 13.2 9.4668H11.1668C10.8907 9.4668 10.6668 9.24294 10.6668 8.9668V6.9334ZM8.9668 5.2334C9.24294 5.2334 9.4668 5.00954 9.4668 4.7334V2.7C9.4668 2.42386 9.24294 2.2 8.9668 2.2H6.9334C6.65726 2.2 6.4334 2.42386 6.4334 2.7V4.7334C6.4334 5.00954 6.65726 5.2334 6.9334 5.2334L8.9668 5.2334ZM6.4334 6.9334C6.4334 6.65726 6.65726 6.4334 6.9334 6.4334L8.9668 6.4334C9.24294 6.4334 9.4668 6.65726 9.4668 6.9334V8.9668C9.4668 9.24294 9.24294 9.4668 8.9668 9.4668L6.9334 9.4668C6.65726 9.4668 6.4334 9.24294 6.4334 8.9668V6.9334ZM4.7334 5.2334C5.00954 5.2334 5.2334 5.00954 5.2334 4.7334V2.7C5.2334 2.42386 5.00954 2.2 4.7334 2.2H3.6C2.8268 2.2 2.2 2.8268 2.2 3.6V4.7334C2.2 5.00954 2.42386 5.2334 2.7 5.2334H4.7334ZM2.2 6.9334C2.2 6.65726 2.42386 6.4334 2.7 6.4334H4.7334C5.00954 6.4334 5.2334 6.65725 5.2334 6.9334V8.9668C5.2334 9.24294 5.00954 9.4668 4.7334 9.4668H2.7C2.42386 9.4668 2.2 9.24294 2.2 8.9668V6.9334ZM5.2334 11.1668C5.2334 10.8907 5.00954 10.6668 4.7334 10.6668H2.7C2.42386 10.6668 2.2 10.8907 2.2 11.1668V12.3C2.2 13.0732 2.8268 13.7 3.6 13.7H4.7334C5.00954 13.7 5.2334 13.4761 5.2334 13.2V11.1668ZM9.4668 11.1668C9.4668 10.8907 9.24294 10.6668 8.9668 10.6668H6.9334C6.65726 10.6668 6.4334 10.8907 6.4334 11.1668V13.2C6.4334 13.4761 6.65726 13.7 6.9334 13.7H8.9668C9.24294 13.7 9.4668 13.4761 9.4668 13.2V11.1668Z",
|
|
1359
|
+
fillRule: "evenodd",
|
|
1360
|
+
clipRule: "evenodd"
|
|
1361
|
+
}
|
|
1362
|
+
}]
|
|
1363
|
+
}, Dr = Le(function(t, n) {
|
|
1364
|
+
return Je(et, Object.assign({}, t, {
|
|
1232
1365
|
id: "select-range-icon",
|
|
1233
|
-
ref:
|
|
1234
|
-
icon:
|
|
1366
|
+
ref: n,
|
|
1367
|
+
icon: Ci
|
|
1235
1368
|
}));
|
|
1236
1369
|
});
|
|
1237
|
-
|
|
1238
|
-
function
|
|
1239
|
-
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),
|
|
1370
|
+
Dr.displayName = "SelectRangeIcon";
|
|
1371
|
+
function _i(e) {
|
|
1372
|
+
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(Yt), p = T(dt), S = T(pn), C = Se(S.sidebarOptions$), _ = li(ur, p);
|
|
1240
1373
|
_.unshift({
|
|
1241
1374
|
label: p.t("formula.moreFunctions.allFunctions"),
|
|
1242
1375
|
value: n
|
|
1243
1376
|
});
|
|
1244
|
-
const
|
|
1377
|
+
const E = p.t("formula.prompt.required"), f = p.t("formula.prompt.optional");
|
|
1245
1378
|
$(() => {
|
|
1246
1379
|
A(n);
|
|
1247
1380
|
}, []), $(() => {
|
|
@@ -1249,44 +1382,44 @@ function Ei(e) {
|
|
|
1249
1382
|
}, [s]), $(() => {
|
|
1250
1383
|
C != null && C.visible && (r(""), i([]), l(0), m(n), d(0), a(null), A(n));
|
|
1251
1384
|
}, [C]);
|
|
1252
|
-
const b = (
|
|
1253
|
-
if (o.trim() === "") return
|
|
1385
|
+
const b = (I) => {
|
|
1386
|
+
if (o.trim() === "") return I;
|
|
1254
1387
|
const x = new RegExp(`(${o.toLocaleUpperCase()})`);
|
|
1255
|
-
return
|
|
1256
|
-
}, y = (
|
|
1388
|
+
return I.split(x).filter(Boolean).map((w, D) => w.match(x) ? /* @__PURE__ */ M("span", { className: "univer-text-red-500", children: w }, D) : w);
|
|
1389
|
+
}, y = (I) => {
|
|
1257
1390
|
if (s.length === 0) {
|
|
1258
1391
|
a(null);
|
|
1259
1392
|
return;
|
|
1260
1393
|
}
|
|
1261
|
-
d(
|
|
1262
|
-
const x =
|
|
1394
|
+
d(I);
|
|
1395
|
+
const x = v.getFunctionInfo(s[I].name);
|
|
1263
1396
|
if (!x) {
|
|
1264
1397
|
a(null);
|
|
1265
1398
|
return;
|
|
1266
1399
|
}
|
|
1267
1400
|
a(x), t(x);
|
|
1268
1401
|
};
|
|
1269
|
-
function A(
|
|
1270
|
-
m(
|
|
1271
|
-
const x =
|
|
1402
|
+
function A(I) {
|
|
1403
|
+
m(I);
|
|
1404
|
+
const x = v.getSearchListByType(+I);
|
|
1272
1405
|
i(x);
|
|
1273
1406
|
}
|
|
1274
|
-
function F(
|
|
1275
|
-
r(
|
|
1276
|
-
const x =
|
|
1407
|
+
function F(I) {
|
|
1408
|
+
r(I);
|
|
1409
|
+
const x = v.getSearchListByName(I);
|
|
1277
1410
|
i(x);
|
|
1278
1411
|
}
|
|
1279
|
-
function
|
|
1280
|
-
if (
|
|
1412
|
+
function N(I) {
|
|
1413
|
+
if (I.stopPropagation(), I.key === "ArrowDown") {
|
|
1281
1414
|
const x = c + 1;
|
|
1282
1415
|
l(x === s.length ? 0 : x);
|
|
1283
|
-
} else if (
|
|
1416
|
+
} else if (I.key === "ArrowUp") {
|
|
1284
1417
|
const x = c - 1;
|
|
1285
1418
|
l(x === -1 ? s.length - 1 : x);
|
|
1286
|
-
} else
|
|
1419
|
+
} else I.key === "Enter" && y(c);
|
|
1287
1420
|
}
|
|
1288
|
-
const
|
|
1289
|
-
l(
|
|
1421
|
+
const O = (I) => {
|
|
1422
|
+
l(I);
|
|
1290
1423
|
}, k = () => {
|
|
1291
1424
|
l(-1);
|
|
1292
1425
|
};
|
|
@@ -1294,10 +1427,10 @@ function Ei(e) {
|
|
|
1294
1427
|
/* @__PURE__ */ W("div", { className: "univer-flex univer-items-center univer-justify-between univer-gap-2", children: [
|
|
1295
1428
|
/* @__PURE__ */ M(Is, { value: g, options: _, onChange: A }),
|
|
1296
1429
|
/* @__PURE__ */ M(
|
|
1297
|
-
|
|
1430
|
+
_r,
|
|
1298
1431
|
{
|
|
1299
1432
|
placeholder: p.t("formula.moreFunctions.searchFunctionPlaceholder"),
|
|
1300
|
-
onKeyDown:
|
|
1433
|
+
onKeyDown: N,
|
|
1301
1434
|
value: o,
|
|
1302
1435
|
onChange: F,
|
|
1303
1436
|
size: "small",
|
|
@@ -1308,76 +1441,76 @@ function Ei(e) {
|
|
|
1308
1441
|
s.length > 0 && /* @__PURE__ */ M(
|
|
1309
1442
|
"ul",
|
|
1310
1443
|
{
|
|
1311
|
-
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", Sn,
|
|
1312
|
-
onKeyDown:
|
|
1444
|
+
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", Sn, lt),
|
|
1445
|
+
onKeyDown: N,
|
|
1313
1446
|
tabIndex: -1,
|
|
1314
|
-
children: s.map(({ name:
|
|
1447
|
+
children: s.map(({ name: I }, x) => /* @__PURE__ */ W(
|
|
1315
1448
|
"li",
|
|
1316
1449
|
{
|
|
1317
1450
|
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", {
|
|
1318
1451
|
"univer-bg-gray-200 dark:!univer-bg-gray-600": c === x
|
|
1319
1452
|
}),
|
|
1320
|
-
onMouseEnter: () =>
|
|
1453
|
+
onMouseEnter: () => O(x),
|
|
1321
1454
|
onMouseLeave: k,
|
|
1322
1455
|
onClick: () => y(x),
|
|
1323
1456
|
children: [
|
|
1324
1457
|
h === x && /* @__PURE__ */ M(
|
|
1325
|
-
|
|
1458
|
+
Mr,
|
|
1326
1459
|
{
|
|
1327
1460
|
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"
|
|
1328
1461
|
}
|
|
1329
1462
|
),
|
|
1330
|
-
/* @__PURE__ */ M("span", { className: "univer-block", children: b(
|
|
1463
|
+
/* @__PURE__ */ M("span", { className: "univer-block", children: b(I) })
|
|
1331
1464
|
]
|
|
1332
1465
|
},
|
|
1333
1466
|
x
|
|
1334
1467
|
))
|
|
1335
1468
|
}
|
|
1336
1469
|
),
|
|
1337
|
-
u && /* @__PURE__ */ W("div", { className: re("univer-mx-0 univer-my-2 univer-overflow-y-auto",
|
|
1338
|
-
/* @__PURE__ */ M(
|
|
1470
|
+
u && /* @__PURE__ */ W("div", { className: re("univer-mx-0 univer-my-2 univer-overflow-y-auto", lt), children: [
|
|
1471
|
+
/* @__PURE__ */ M(vt, { title: u.functionName, value: u.description }),
|
|
1339
1472
|
/* @__PURE__ */ M(
|
|
1340
|
-
|
|
1473
|
+
vt,
|
|
1341
1474
|
{
|
|
1342
1475
|
title: p.t("formula.moreFunctions.syntax"),
|
|
1343
|
-
value: /* @__PURE__ */ M(
|
|
1476
|
+
value: /* @__PURE__ */ M(Or, { prefix: u.functionName, value: u.functionParameter })
|
|
1344
1477
|
}
|
|
1345
1478
|
),
|
|
1346
1479
|
/* @__PURE__ */ M(
|
|
1347
|
-
|
|
1480
|
+
vt,
|
|
1348
1481
|
{
|
|
1349
1482
|
title: p.t("formula.prompt.helpExample"),
|
|
1350
|
-
value: `${u.functionName}(${u.functionParameter.map((
|
|
1483
|
+
value: `${u.functionName}(${u.functionParameter.map((I) => I.example).join(",")})`
|
|
1351
1484
|
}
|
|
1352
1485
|
),
|
|
1353
|
-
u.functionParameter && u.functionParameter.map((
|
|
1354
|
-
|
|
1486
|
+
u.functionParameter && u.functionParameter.map((I) => /* @__PURE__ */ M(
|
|
1487
|
+
vt,
|
|
1355
1488
|
{
|
|
1356
|
-
title:
|
|
1357
|
-
value: `${
|
|
1489
|
+
title: I.name,
|
|
1490
|
+
value: `${I.require ? E : f} ${I.detail}`
|
|
1358
1491
|
},
|
|
1359
|
-
|
|
1492
|
+
I.name
|
|
1360
1493
|
))
|
|
1361
1494
|
] })
|
|
1362
1495
|
] });
|
|
1363
1496
|
}
|
|
1364
|
-
function
|
|
1497
|
+
function Ri() {
|
|
1365
1498
|
const e = Io(), [t, n] = V(!0), [o, r] = V(!1), [s, i] = V(null);
|
|
1366
|
-
T(
|
|
1367
|
-
const c = T(
|
|
1499
|
+
T(dn);
|
|
1500
|
+
const c = T(dt), l = T(Ye), g = T(ne), m = T(me);
|
|
1368
1501
|
function h() {
|
|
1369
1502
|
n(!t), r(!o);
|
|
1370
1503
|
}
|
|
1371
1504
|
function d() {
|
|
1372
|
-
const u =
|
|
1505
|
+
const u = pr(g);
|
|
1373
1506
|
if (!u) return;
|
|
1374
|
-
m.executeCommand(
|
|
1507
|
+
m.executeCommand(sr.id, {
|
|
1375
1508
|
visible: !0,
|
|
1376
1509
|
unitId: u.unitId,
|
|
1377
|
-
eventType:
|
|
1510
|
+
eventType: Oe.Dblclick
|
|
1378
1511
|
});
|
|
1379
|
-
const a = l.getEditor(
|
|
1380
|
-
a == null || a.replaceText(p),
|
|
1512
|
+
const a = l.getEditor(an), v = l.getEditor(tr), p = `=${s == null ? void 0 : s.functionName}(`;
|
|
1513
|
+
a == null || a.replaceText(p), v == null || v.replaceText(p, !1);
|
|
1381
1514
|
}
|
|
1382
1515
|
return /* @__PURE__ */ W(
|
|
1383
1516
|
"div",
|
|
@@ -1385,12 +1518,12 @@ function Ii() {
|
|
|
1385
1518
|
"data-u-comp": "sheets-formula-functions-panel",
|
|
1386
1519
|
className: "univer-box-border univer-flex univer-h-full univer-flex-col univer-justify-between univer-py-2",
|
|
1387
1520
|
children: [
|
|
1388
|
-
t && /* @__PURE__ */ M(
|
|
1389
|
-
o && /* @__PURE__ */ M(
|
|
1521
|
+
t && /* @__PURE__ */ M(_i, { onChange: i }),
|
|
1522
|
+
o && /* @__PURE__ */ M(ui, { functionInfo: s, onChange: () => {
|
|
1390
1523
|
} }),
|
|
1391
1524
|
/* @__PURE__ */ W("div", { className: "univer-flex univer-justify-end", children: [
|
|
1392
1525
|
o && /* @__PURE__ */ M(
|
|
1393
|
-
|
|
1526
|
+
ct,
|
|
1394
1527
|
{
|
|
1395
1528
|
variant: "primary",
|
|
1396
1529
|
onClick: h,
|
|
@@ -1398,9 +1531,9 @@ function Ii() {
|
|
|
1398
1531
|
children: c.t("formula.moreFunctions.next")
|
|
1399
1532
|
}
|
|
1400
1533
|
),
|
|
1401
|
-
o && /* @__PURE__ */ M(
|
|
1534
|
+
o && /* @__PURE__ */ M(ct, { onClick: h, className: "univer-mb-5 univer-ml-4 univer-mr-0 univer-mt-0", children: c.t("formula.moreFunctions.prev") }),
|
|
1402
1535
|
t && !!e && /* @__PURE__ */ M(
|
|
1403
|
-
|
|
1536
|
+
ct,
|
|
1404
1537
|
{
|
|
1405
1538
|
variant: "primary",
|
|
1406
1539
|
onClick: d,
|
|
@@ -1413,263 +1546,263 @@ function Ii() {
|
|
|
1413
1546
|
}
|
|
1414
1547
|
);
|
|
1415
1548
|
}
|
|
1416
|
-
function
|
|
1549
|
+
function Ii(e) {
|
|
1417
1550
|
return {
|
|
1418
|
-
id:
|
|
1551
|
+
id: pe.id,
|
|
1419
1552
|
title: "SUM",
|
|
1420
1553
|
icon: "SumIcon",
|
|
1421
|
-
type:
|
|
1554
|
+
type: Qe.BUTTON,
|
|
1422
1555
|
params: {
|
|
1423
1556
|
value: "SUM"
|
|
1424
1557
|
},
|
|
1425
|
-
hidden$:
|
|
1426
|
-
disabled$:
|
|
1427
|
-
workbookTypes: [
|
|
1428
|
-
worksheetTypes: [
|
|
1429
|
-
rangeTypes: [
|
|
1558
|
+
hidden$: ft(e, H.UNIVER_SHEET),
|
|
1559
|
+
disabled$: Ke(e, {
|
|
1560
|
+
workbookTypes: [Xe],
|
|
1561
|
+
worksheetTypes: [Ze, Ge],
|
|
1562
|
+
rangeTypes: [ze]
|
|
1430
1563
|
})
|
|
1431
1564
|
};
|
|
1432
1565
|
}
|
|
1433
|
-
function
|
|
1566
|
+
function Ei(e) {
|
|
1434
1567
|
return {
|
|
1435
|
-
id:
|
|
1568
|
+
id: pe.id,
|
|
1436
1569
|
title: "COUNT",
|
|
1437
1570
|
icon: "CntIcon",
|
|
1438
|
-
type:
|
|
1571
|
+
type: Qe.BUTTON,
|
|
1439
1572
|
params: {
|
|
1440
1573
|
value: "COUNT"
|
|
1441
1574
|
},
|
|
1442
|
-
hidden$:
|
|
1443
|
-
disabled$:
|
|
1444
|
-
workbookTypes: [
|
|
1445
|
-
worksheetTypes: [
|
|
1446
|
-
rangeTypes: [
|
|
1575
|
+
hidden$: ft(e, H.UNIVER_SHEET),
|
|
1576
|
+
disabled$: Ke(e, {
|
|
1577
|
+
workbookTypes: [Xe],
|
|
1578
|
+
worksheetTypes: [Ze, Ge],
|
|
1579
|
+
rangeTypes: [ze]
|
|
1447
1580
|
})
|
|
1448
1581
|
};
|
|
1449
1582
|
}
|
|
1450
|
-
function
|
|
1583
|
+
function bi(e) {
|
|
1451
1584
|
return {
|
|
1452
|
-
id:
|
|
1585
|
+
id: pe.id,
|
|
1453
1586
|
title: "AVERAGE",
|
|
1454
1587
|
icon: "AvgIcon",
|
|
1455
|
-
type:
|
|
1588
|
+
type: Qe.BUTTON,
|
|
1456
1589
|
params: {
|
|
1457
1590
|
value: "AVERAGE"
|
|
1458
1591
|
},
|
|
1459
|
-
hidden$:
|
|
1460
|
-
disabled$:
|
|
1461
|
-
workbookTypes: [
|
|
1462
|
-
worksheetTypes: [
|
|
1463
|
-
rangeTypes: [
|
|
1592
|
+
hidden$: ft(e, H.UNIVER_SHEET),
|
|
1593
|
+
disabled$: Ke(e, {
|
|
1594
|
+
workbookTypes: [Xe],
|
|
1595
|
+
worksheetTypes: [Ze, Ge],
|
|
1596
|
+
rangeTypes: [ze]
|
|
1464
1597
|
})
|
|
1465
1598
|
};
|
|
1466
1599
|
}
|
|
1467
|
-
function
|
|
1600
|
+
function yi(e) {
|
|
1468
1601
|
return {
|
|
1469
|
-
id:
|
|
1602
|
+
id: pe.id,
|
|
1470
1603
|
title: "MAX",
|
|
1471
1604
|
icon: "MaxIcon",
|
|
1472
|
-
type:
|
|
1605
|
+
type: Qe.BUTTON,
|
|
1473
1606
|
params: {
|
|
1474
1607
|
value: "MAX"
|
|
1475
1608
|
},
|
|
1476
|
-
hidden$:
|
|
1477
|
-
disabled$:
|
|
1478
|
-
workbookTypes: [
|
|
1479
|
-
worksheetTypes: [
|
|
1480
|
-
rangeTypes: [
|
|
1609
|
+
hidden$: ft(e, H.UNIVER_SHEET),
|
|
1610
|
+
disabled$: Ke(e, {
|
|
1611
|
+
workbookTypes: [Xe],
|
|
1612
|
+
worksheetTypes: [Ze, Ge],
|
|
1613
|
+
rangeTypes: [ze]
|
|
1481
1614
|
})
|
|
1482
1615
|
};
|
|
1483
1616
|
}
|
|
1484
|
-
function
|
|
1617
|
+
function Ti(e) {
|
|
1485
1618
|
return {
|
|
1486
|
-
id:
|
|
1619
|
+
id: pe.id,
|
|
1487
1620
|
title: "MIN",
|
|
1488
1621
|
icon: "MinIcon",
|
|
1489
|
-
type:
|
|
1622
|
+
type: Qe.BUTTON,
|
|
1490
1623
|
params: {
|
|
1491
1624
|
value: "MIN"
|
|
1492
1625
|
},
|
|
1493
|
-
hidden$:
|
|
1494
|
-
disabled$:
|
|
1495
|
-
workbookTypes: [
|
|
1496
|
-
worksheetTypes: [
|
|
1497
|
-
rangeTypes: [
|
|
1626
|
+
hidden$: ft(e, H.UNIVER_SHEET),
|
|
1627
|
+
disabled$: Ke(e, {
|
|
1628
|
+
workbookTypes: [Xe],
|
|
1629
|
+
worksheetTypes: [Ze, Ge],
|
|
1630
|
+
rangeTypes: [ze]
|
|
1498
1631
|
})
|
|
1499
1632
|
};
|
|
1500
1633
|
}
|
|
1501
|
-
function
|
|
1634
|
+
function Ni(e) {
|
|
1502
1635
|
return {
|
|
1503
|
-
id:
|
|
1636
|
+
id: Cn.id,
|
|
1504
1637
|
title: "formula.insert.more",
|
|
1505
1638
|
tooltip: "formula.insert.tooltip",
|
|
1506
|
-
type:
|
|
1507
|
-
hidden$:
|
|
1508
|
-
disabled$:
|
|
1509
|
-
workbookTypes: [
|
|
1510
|
-
worksheetTypes: [
|
|
1511
|
-
rangeTypes: [
|
|
1639
|
+
type: Qe.BUTTON,
|
|
1640
|
+
hidden$: ft(e, H.UNIVER_SHEET),
|
|
1641
|
+
disabled$: Ke(e, {
|
|
1642
|
+
workbookTypes: [Xe],
|
|
1643
|
+
worksheetTypes: [Ze, Ge],
|
|
1644
|
+
rangeTypes: [ze]
|
|
1512
1645
|
})
|
|
1513
1646
|
};
|
|
1514
1647
|
}
|
|
1515
|
-
function
|
|
1648
|
+
function Oi(e) {
|
|
1516
1649
|
return e.get(ne).getCurrentTypeOfUnit$(H.UNIVER_SHEET).pipe(
|
|
1517
|
-
qo((o) => o ? e.get(qn) ? new
|
|
1650
|
+
qo((o) => o ? e.get(qn) ? new jo((s) => s.next(!e.get(qn).supportClipboard)) : Pn(!0) : Pn(!0))
|
|
1518
1651
|
);
|
|
1519
1652
|
}
|
|
1520
|
-
function
|
|
1653
|
+
function xi(e) {
|
|
1521
1654
|
return {
|
|
1522
|
-
id:
|
|
1523
|
-
type:
|
|
1655
|
+
id: vn.id,
|
|
1656
|
+
type: Qe.BUTTON,
|
|
1524
1657
|
title: "formula.operation.pasteFormula",
|
|
1525
|
-
disabled$:
|
|
1526
|
-
|
|
1527
|
-
workbookTypes: [
|
|
1528
|
-
rangeTypes: [
|
|
1529
|
-
worksheetTypes: [
|
|
1658
|
+
disabled$: Oi(e).pipe(
|
|
1659
|
+
Bo(Ke(e, {
|
|
1660
|
+
workbookTypes: [Xe],
|
|
1661
|
+
rangeTypes: [ze],
|
|
1662
|
+
worksheetTypes: [Ge, Ze]
|
|
1530
1663
|
})),
|
|
1531
|
-
|
|
1664
|
+
hr(([t, n]) => t || n)
|
|
1532
1665
|
)
|
|
1533
1666
|
};
|
|
1534
1667
|
}
|
|
1535
|
-
const
|
|
1536
|
-
[
|
|
1537
|
-
[`${
|
|
1668
|
+
const Mi = {
|
|
1669
|
+
[jn.BASIC]: {
|
|
1670
|
+
[`${pe.id}.sum`]: {
|
|
1538
1671
|
order: 0,
|
|
1539
|
-
menuItemFactory:
|
|
1672
|
+
menuItemFactory: Ii
|
|
1540
1673
|
},
|
|
1541
|
-
[`${
|
|
1674
|
+
[`${pe.id}.count`]: {
|
|
1542
1675
|
order: 1,
|
|
1543
|
-
menuItemFactory:
|
|
1676
|
+
menuItemFactory: Ei
|
|
1544
1677
|
},
|
|
1545
|
-
[`${
|
|
1678
|
+
[`${pe.id}.average`]: {
|
|
1546
1679
|
order: 2,
|
|
1547
|
-
menuItemFactory:
|
|
1680
|
+
menuItemFactory: bi
|
|
1548
1681
|
},
|
|
1549
|
-
[`${
|
|
1682
|
+
[`${pe.id}.max`]: {
|
|
1550
1683
|
order: 3,
|
|
1551
|
-
menuItemFactory:
|
|
1684
|
+
menuItemFactory: yi
|
|
1552
1685
|
},
|
|
1553
|
-
[`${
|
|
1686
|
+
[`${pe.id}.min`]: {
|
|
1554
1687
|
order: 4,
|
|
1555
|
-
menuItemFactory:
|
|
1688
|
+
menuItemFactory: Ti
|
|
1556
1689
|
}
|
|
1557
1690
|
},
|
|
1558
|
-
[
|
|
1559
|
-
[
|
|
1691
|
+
[jn.OTHERS]: {
|
|
1692
|
+
[Cn.id]: {
|
|
1560
1693
|
order: 0,
|
|
1561
|
-
menuItemFactory:
|
|
1694
|
+
menuItemFactory: Ni
|
|
1562
1695
|
}
|
|
1563
1696
|
},
|
|
1564
|
-
[
|
|
1565
|
-
[
|
|
1697
|
+
[Eo]: {
|
|
1698
|
+
[vn.id]: {
|
|
1566
1699
|
order: 4,
|
|
1567
|
-
menuItemFactory:
|
|
1700
|
+
menuItemFactory: xi
|
|
1568
1701
|
}
|
|
1569
1702
|
}
|
|
1570
|
-
},
|
|
1571
|
-
function
|
|
1572
|
-
return e.getContextValue(
|
|
1703
|
+
}, wi = "meta_key_ctrl_And_Shift";
|
|
1704
|
+
function ki(e) {
|
|
1705
|
+
return e.getContextValue(ro) && e.getContextValue(oo);
|
|
1573
1706
|
}
|
|
1574
|
-
const
|
|
1707
|
+
const zt = [
|
|
1575
1708
|
L.ARROW_DOWN,
|
|
1576
1709
|
L.ARROW_UP,
|
|
1577
1710
|
L.ARROW_LEFT,
|
|
1578
1711
|
L.ARROW_RIGHT
|
|
1579
|
-
],
|
|
1580
|
-
function
|
|
1712
|
+
], Ai = [...zt, L.ENTER, L.TAB, L.ESC];
|
|
1713
|
+
function Fi() {
|
|
1581
1714
|
const e = [];
|
|
1582
|
-
for (const t of
|
|
1715
|
+
for (const t of Ai)
|
|
1583
1716
|
e.push({
|
|
1584
|
-
id:
|
|
1717
|
+
id: gt.id,
|
|
1585
1718
|
binding: t,
|
|
1586
|
-
preconditions: (n) =>
|
|
1719
|
+
preconditions: (n) => Et(n),
|
|
1587
1720
|
staticParameters: {
|
|
1588
|
-
eventType:
|
|
1721
|
+
eventType: Oe.Keyboard,
|
|
1589
1722
|
keycode: t
|
|
1590
1723
|
}
|
|
1591
1724
|
});
|
|
1592
1725
|
return e;
|
|
1593
1726
|
}
|
|
1594
|
-
function
|
|
1727
|
+
function Di() {
|
|
1595
1728
|
const e = [];
|
|
1596
|
-
for (const t of
|
|
1729
|
+
for (const t of zt)
|
|
1597
1730
|
e.push({
|
|
1598
|
-
id:
|
|
1731
|
+
id: gt.id,
|
|
1599
1732
|
binding: t | P.SHIFT,
|
|
1600
|
-
preconditions: (n) =>
|
|
1733
|
+
preconditions: (n) => Et(n),
|
|
1601
1734
|
staticParameters: {
|
|
1602
|
-
eventType:
|
|
1735
|
+
eventType: Oe.Keyboard,
|
|
1603
1736
|
keycode: t,
|
|
1604
1737
|
metaKey: P.SHIFT
|
|
1605
1738
|
}
|
|
1606
1739
|
});
|
|
1607
1740
|
return e;
|
|
1608
1741
|
}
|
|
1609
|
-
function
|
|
1742
|
+
function Li() {
|
|
1610
1743
|
const e = [];
|
|
1611
|
-
for (const t of
|
|
1744
|
+
for (const t of zt)
|
|
1612
1745
|
e.push({
|
|
1613
|
-
id:
|
|
1746
|
+
id: gt.id,
|
|
1614
1747
|
binding: t | P.CTRL_COMMAND,
|
|
1615
|
-
preconditions: (n) =>
|
|
1748
|
+
preconditions: (n) => Et(n),
|
|
1616
1749
|
staticParameters: {
|
|
1617
|
-
eventType:
|
|
1750
|
+
eventType: Oe.Keyboard,
|
|
1618
1751
|
keycode: t,
|
|
1619
1752
|
metaKey: P.CTRL_COMMAND
|
|
1620
1753
|
}
|
|
1621
1754
|
});
|
|
1622
1755
|
return e;
|
|
1623
1756
|
}
|
|
1624
|
-
function
|
|
1757
|
+
function $i() {
|
|
1625
1758
|
const e = [];
|
|
1626
|
-
for (const t of
|
|
1759
|
+
for (const t of zt)
|
|
1627
1760
|
e.push({
|
|
1628
|
-
id:
|
|
1761
|
+
id: gt.id,
|
|
1629
1762
|
binding: t | P.SHIFT | P.CTRL_COMMAND,
|
|
1630
|
-
preconditions: (n) =>
|
|
1763
|
+
preconditions: (n) => Et(n),
|
|
1631
1764
|
staticParameters: {
|
|
1632
|
-
eventType:
|
|
1765
|
+
eventType: Oe.Keyboard,
|
|
1633
1766
|
keycode: t,
|
|
1634
|
-
metaKey:
|
|
1767
|
+
metaKey: wi
|
|
1635
1768
|
}
|
|
1636
1769
|
});
|
|
1637
1770
|
return e;
|
|
1638
1771
|
}
|
|
1639
|
-
const
|
|
1640
|
-
id:
|
|
1772
|
+
const Pi = {
|
|
1773
|
+
id: br.id,
|
|
1641
1774
|
binding: L.F4,
|
|
1642
|
-
preconditions: (e) =>
|
|
1775
|
+
preconditions: (e) => Et(e)
|
|
1643
1776
|
};
|
|
1644
|
-
function
|
|
1777
|
+
function Ui() {
|
|
1645
1778
|
const e = [];
|
|
1646
1779
|
for (const t of [L.ENTER, L.TAB, L.ARROW_DOWN, L.ARROW_UP])
|
|
1647
1780
|
e.push({
|
|
1648
|
-
id:
|
|
1781
|
+
id: gt.id,
|
|
1649
1782
|
binding: t,
|
|
1650
|
-
preconditions: (n) =>
|
|
1783
|
+
preconditions: (n) => ki(n),
|
|
1651
1784
|
staticParameters: {
|
|
1652
|
-
eventType:
|
|
1785
|
+
eventType: Oe.Keyboard,
|
|
1653
1786
|
keycode: t,
|
|
1654
1787
|
isSingleEditor: !0
|
|
1655
1788
|
}
|
|
1656
1789
|
});
|
|
1657
1790
|
return e;
|
|
1658
1791
|
}
|
|
1659
|
-
const
|
|
1660
|
-
id:
|
|
1792
|
+
const Vi = {
|
|
1793
|
+
id: ds.id,
|
|
1661
1794
|
binding: P.ALT | L.EQUAL,
|
|
1662
|
-
preconditions:
|
|
1795
|
+
preconditions: bo,
|
|
1663
1796
|
mac: P.CTRL_COMMAND | P.ALT | L.EQUAL,
|
|
1664
1797
|
description: "shortcut.sheets-formula-ui.quick-sum",
|
|
1665
1798
|
group: "4_sheet-edit"
|
|
1666
1799
|
};
|
|
1667
|
-
var
|
|
1668
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
1800
|
+
var Wi = Object.getOwnPropertyDescriptor, Hi = (e, t, n, o) => {
|
|
1801
|
+
for (var r = o > 1 ? void 0 : o ? Wi(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
1669
1802
|
(i = e[s]) && (r = i(r) || r);
|
|
1670
1803
|
return r;
|
|
1671
|
-
},
|
|
1672
|
-
let
|
|
1804
|
+
}, Be = (e, t) => (n, o) => t(n, o, e);
|
|
1805
|
+
let Ht = class extends ut {
|
|
1673
1806
|
constructor(e, t, n, o, r, s, i) {
|
|
1674
1807
|
super(), this._injector = e, this._menuManagerService = t, this._commandService = n, this._shortcutService = o, this._uiPartsService = r, this._renderManagerService = s, this._componentManager = i, this._initialize();
|
|
1675
1808
|
}
|
|
@@ -1677,52 +1810,52 @@ let Bt = class extends dt {
|
|
|
1677
1810
|
this._registerCommands(), this._registerMenus(), this._registerShortcuts(), this._registerComponents(), this._registerRenderModules();
|
|
1678
1811
|
}
|
|
1679
1812
|
_registerMenus() {
|
|
1680
|
-
this._menuManagerService.mergeMenu(
|
|
1813
|
+
this._menuManagerService.mergeMenu(Mi);
|
|
1681
1814
|
}
|
|
1682
1815
|
_registerCommands() {
|
|
1683
1816
|
[
|
|
1817
|
+
vn,
|
|
1818
|
+
pe,
|
|
1684
1819
|
Cn,
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
mt,
|
|
1690
|
-
yr
|
|
1820
|
+
Ps,
|
|
1821
|
+
ws,
|
|
1822
|
+
gt,
|
|
1823
|
+
br
|
|
1691
1824
|
].forEach((e) => this.disposeWithMe(this._commandService.registerCommand(e)));
|
|
1692
1825
|
}
|
|
1693
1826
|
_registerShortcuts() {
|
|
1694
1827
|
[
|
|
1828
|
+
...Fi(),
|
|
1829
|
+
...Di(),
|
|
1695
1830
|
...Li(),
|
|
1696
1831
|
...$i(),
|
|
1697
|
-
...Pi(),
|
|
1698
1832
|
...Ui(),
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
Vi
|
|
1833
|
+
Vi,
|
|
1834
|
+
Pi
|
|
1702
1835
|
].forEach((e) => {
|
|
1703
1836
|
this.disposeWithMe(this._shortcutService.registerShortcut(e));
|
|
1704
1837
|
});
|
|
1705
1838
|
}
|
|
1706
1839
|
_registerComponents() {
|
|
1707
|
-
this.disposeWithMe(this._uiPartsService.registerComponent(
|
|
1840
|
+
this.disposeWithMe(this._uiPartsService.registerComponent(yo.FORMULA_AUX, () => Cr(ai, this._injector))), this._componentManager.register(Er, Ri);
|
|
1708
1841
|
}
|
|
1709
1842
|
_registerRenderModules() {
|
|
1710
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(H.UNIVER_SHEET, [
|
|
1843
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(H.UNIVER_SHEET, [Vt]));
|
|
1711
1844
|
}
|
|
1712
1845
|
};
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
],
|
|
1722
|
-
class
|
|
1846
|
+
Ht = Hi([
|
|
1847
|
+
Be(0, q(Rt)),
|
|
1848
|
+
Be(1, ms),
|
|
1849
|
+
Be(2, me),
|
|
1850
|
+
Be(3, Gt),
|
|
1851
|
+
Be(4, Sr),
|
|
1852
|
+
Be(5, xe),
|
|
1853
|
+
Be(6, q(vr))
|
|
1854
|
+
], Ht);
|
|
1855
|
+
class Lr {
|
|
1723
1856
|
constructor() {
|
|
1724
|
-
|
|
1725
|
-
|
|
1857
|
+
j(this, "_currentSelector$", new fr(null));
|
|
1858
|
+
j(this, "currentSelector$", this._currentSelector$.asObservable());
|
|
1726
1859
|
}
|
|
1727
1860
|
showRangeSelectorDialog(t) {
|
|
1728
1861
|
const n = t.callback, o = new Promise((r) => {
|
|
@@ -1733,12 +1866,12 @@ class $r {
|
|
|
1733
1866
|
return this._currentSelector$.next(t), o;
|
|
1734
1867
|
}
|
|
1735
1868
|
}
|
|
1736
|
-
var
|
|
1737
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
1869
|
+
var Bi = Object.getOwnPropertyDescriptor, qi = (e, t, n, o) => {
|
|
1870
|
+
for (var r = o > 1 ? void 0 : o ? Bi(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
1738
1871
|
(i = e[s]) && (r = i(r) || r);
|
|
1739
1872
|
return r;
|
|
1740
|
-
},
|
|
1741
|
-
let
|
|
1873
|
+
}, st = (e, t) => (n, o) => t(n, o, e);
|
|
1874
|
+
let De = class extends To {
|
|
1742
1875
|
constructor(t, n, o, r, s, i, c) {
|
|
1743
1876
|
super(
|
|
1744
1877
|
n,
|
|
@@ -1747,9 +1880,9 @@ let $e = class extends Oo {
|
|
|
1747
1880
|
s,
|
|
1748
1881
|
i
|
|
1749
1882
|
);
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
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(
|
|
1883
|
+
j(this, "_workbookSelections");
|
|
1884
|
+
j(this, "_eventDisposables");
|
|
1885
|
+
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(ji(this._themeService)), this._remainLastEnabled = !0, this._highlightHeader = !1;
|
|
1753
1886
|
}
|
|
1754
1887
|
getLocation() {
|
|
1755
1888
|
return this._skeleton.getLocation();
|
|
@@ -1773,7 +1906,7 @@ let $e = class extends Oo {
|
|
|
1773
1906
|
* Call this method and user will be able to select on the canvas to update selections.
|
|
1774
1907
|
*/
|
|
1775
1908
|
enableSelectionChanging() {
|
|
1776
|
-
return this._disableSelectionChanging(), this._eventDisposables = this._initCanvasEventListeners(),
|
|
1909
|
+
return this._disableSelectionChanging(), this._eventDisposables = this._initCanvasEventListeners(), rr(() => this._disableSelectionChanging());
|
|
1777
1910
|
}
|
|
1778
1911
|
_disableSelectionChanging() {
|
|
1779
1912
|
var t;
|
|
@@ -1785,17 +1918,17 @@ let $e = class extends Oo {
|
|
|
1785
1918
|
_initCanvasEventListeners() {
|
|
1786
1919
|
const t = this._getSheetObject(), { spreadsheetRowHeader: n, spreadsheetColumnHeader: o, spreadsheet: r, spreadsheetLeftTopPlaceholder: s } = t, { scene: i } = this._context, c = new qe();
|
|
1787
1920
|
return c.add(r == null ? void 0 : r.onPointerDown$.subscribeEvent((l, g) => {
|
|
1788
|
-
this.inRefSelectionMode() && (this._onPointerDown(l, r.zIndex + 1,
|
|
1921
|
+
this.inRefSelectionMode() && (this._onPointerDown(l, r.zIndex + 1, ve.NORMAL, this._getActiveViewport(l)), l.button !== 2 && g.stopPropagation());
|
|
1789
1922
|
})), c.add(
|
|
1790
1923
|
n == null ? void 0 : n.onPointerDown$.subscribeEvent((l, g) => {
|
|
1791
1924
|
if (!this.inRefSelectionMode()) return;
|
|
1792
|
-
const m = this._sheetSkeletonManagerService.getCurrent().skeleton, { row: h } =
|
|
1793
|
-
|
|
1925
|
+
const m = this._sheetSkeletonManagerService.getCurrent().skeleton, { row: h } = An(l.offsetX, l.offsetY, i, m);
|
|
1926
|
+
Fn(this._workbookSelections.getCurrentSelections(), h, ve.ROW) || (this._onPointerDown(l, (r.zIndex || 1) + 1, ve.ROW, this._getActiveViewport(l), Xt.Y), l.button !== 2 && g.stopPropagation());
|
|
1794
1927
|
})
|
|
1795
1928
|
), c.add(o == null ? void 0 : o.onPointerDown$.subscribeEvent((l, g) => {
|
|
1796
1929
|
if (!this.inRefSelectionMode()) return;
|
|
1797
|
-
const m = this._sheetSkeletonManagerService.getCurrent().skeleton, { column: h } =
|
|
1798
|
-
|
|
1930
|
+
const m = this._sheetSkeletonManagerService.getCurrent().skeleton, { column: h } = An(l.offsetX, l.offsetY, i, m);
|
|
1931
|
+
Fn(this._workbookSelections.getCurrentSelections(), h, ve.COLUMN) || (this._onPointerDown(l, (r.zIndex || 1) + 1, ve.COLUMN, this._getActiveViewport(l), Xt.X), l.button !== 2 && g.stopPropagation());
|
|
1799
1932
|
})), c.add(s == null ? void 0 : s.onPointerDown$.subscribeEvent((l, g) => {
|
|
1800
1933
|
if (this._reset(), !this.inRefSelectionMode()) return;
|
|
1801
1934
|
const m = this._sheetSkeletonManagerService.getCurrent().skeleton, h = No(m);
|
|
@@ -1813,7 +1946,7 @@ let $e = class extends Oo {
|
|
|
1813
1946
|
*/
|
|
1814
1947
|
_addSelectionControlByModelData(t) {
|
|
1815
1948
|
var i;
|
|
1816
|
-
const n = this._skeleton, o = (i = t.style) != null ? i :
|
|
1949
|
+
const n = this._skeleton, o = (i = t.style) != null ? i : ar(this._themeService), r = this._scene;
|
|
1817
1950
|
return t.style = o, this.newSelectionControl(r, n, t);
|
|
1818
1951
|
}
|
|
1819
1952
|
_initSelectionChangeListener() {
|
|
@@ -1826,18 +1959,18 @@ let $e = class extends Oo {
|
|
|
1826
1959
|
*/
|
|
1827
1960
|
_initUserActionSyncListener() {
|
|
1828
1961
|
this.disposeWithMe(this.selectionMoveStart$.subscribe((t) => {
|
|
1829
|
-
this._updateSelections(t,
|
|
1962
|
+
this._updateSelections(t, Qt.MOVE_START);
|
|
1830
1963
|
})), this.disposeWithMe(this.selectionMoving$.subscribe((t) => {
|
|
1831
|
-
this._updateSelections(t,
|
|
1964
|
+
this._updateSelections(t, Qt.MOVING);
|
|
1832
1965
|
})), this.disposeWithMe(this.selectionMoveEnd$.subscribe((t) => {
|
|
1833
|
-
this._updateSelections(t,
|
|
1966
|
+
this._updateSelections(t, Qt.MOVE_END);
|
|
1834
1967
|
}));
|
|
1835
1968
|
}
|
|
1836
1969
|
_updateSelections(t, n) {
|
|
1837
1970
|
const r = this._context.unit.getActiveSheet().getSheetId();
|
|
1838
1971
|
t.length !== 0 && this._workbookSelections.setSelections(
|
|
1839
1972
|
r,
|
|
1840
|
-
t.map((s) =>
|
|
1973
|
+
t.map((s) => cs(s)),
|
|
1841
1974
|
n
|
|
1842
1975
|
);
|
|
1843
1976
|
}
|
|
@@ -1846,7 +1979,7 @@ let $e = class extends Oo {
|
|
|
1846
1979
|
var i;
|
|
1847
1980
|
if (!t)
|
|
1848
1981
|
return;
|
|
1849
|
-
const { skeleton: n } = t, { scene: o } = this._context, r = o.getViewport(
|
|
1982
|
+
const { skeleton: n } = t, { scene: o } = this._context, r = o.getViewport(Vn.VIEW_MAIN);
|
|
1850
1983
|
this._skeleton && ((i = this._skeleton.worksheet) == null ? void 0 : i.getSheetId()) !== n.worksheet.getSheetId() && this._reset(), this._changeRuntime(n, o, r);
|
|
1851
1984
|
const s = this._workbookSelections.getCurrentSelections();
|
|
1852
1985
|
this.resetSelectionsByModelData(s);
|
|
@@ -1854,10 +1987,10 @@ let $e = class extends Oo {
|
|
|
1854
1987
|
}
|
|
1855
1988
|
_getActiveViewport(t) {
|
|
1856
1989
|
const n = this._getSheetObject();
|
|
1857
|
-
return n == null ? void 0 : n.scene.getActiveViewportByCoord(
|
|
1990
|
+
return n == null ? void 0 : n.scene.getActiveViewportByCoord(Wn.FromArray([t.offsetX, t.offsetY]));
|
|
1858
1991
|
}
|
|
1859
1992
|
_getSheetObject() {
|
|
1860
|
-
return
|
|
1993
|
+
return Oo(this._context.unit, this._context);
|
|
1861
1994
|
}
|
|
1862
1995
|
/**
|
|
1863
1996
|
* Handle pointer down event, bind pointermove & pointerup handler.
|
|
@@ -1870,45 +2003,45 @@ let $e = class extends Oo {
|
|
|
1870
2003
|
* @param scrollTimerType
|
|
1871
2004
|
*/
|
|
1872
2005
|
// eslint-disable-next-line complexity, max-lines-per-function
|
|
1873
|
-
_onPointerDown(t, n = 0, o =
|
|
1874
|
-
var
|
|
2006
|
+
_onPointerDown(t, n = 0, o = ve.NORMAL, r, s = Xt.ALL) {
|
|
2007
|
+
var N;
|
|
1875
2008
|
this._rangeType = o;
|
|
1876
2009
|
const i = this._skeleton, c = this._scene;
|
|
1877
2010
|
if (!c || !i)
|
|
1878
2011
|
return;
|
|
1879
2012
|
r && (this._activeViewport = r);
|
|
1880
|
-
const { offsetX: l, offsetY: g } = t, m = c.getViewport(
|
|
2013
|
+
const { offsetX: l, offsetY: g } = t, m = c.getViewport(Vn.VIEW_MAIN);
|
|
1881
2014
|
if (!m) return;
|
|
1882
|
-
const h = c.getCoordRelativeToViewport(
|
|
2015
|
+
const h = c.getCoordRelativeToViewport(Wn.FromArray([l, g])), { x: d, y: u } = h;
|
|
1883
2016
|
this._startViewportPosX = d, this._startViewportPosY = u;
|
|
1884
|
-
const a = c.getScrollXYInfoByViewport(h), { scaleX:
|
|
1885
|
-
if (!
|
|
2017
|
+
const a = c.getScrollXYInfoByViewport(h), { scaleX: v, scaleY: p } = c.getAncestorScale(), S = this._skeleton.getCellByOffset(d, u, v, p, a);
|
|
2018
|
+
if (!S) return;
|
|
1886
2019
|
switch (o) {
|
|
1887
|
-
case
|
|
2020
|
+
case ve.NORMAL:
|
|
1888
2021
|
break;
|
|
1889
|
-
case
|
|
1890
|
-
|
|
2022
|
+
case ve.ROW:
|
|
2023
|
+
S.startColumn = 0, S.endColumn = this._skeleton.getColumnCount() - 1;
|
|
1891
2024
|
break;
|
|
1892
|
-
case
|
|
1893
|
-
|
|
2025
|
+
case ve.COLUMN:
|
|
2026
|
+
S.startRow = 0, S.endRow = this._skeleton.getRowCount() - 1;
|
|
1894
2027
|
break;
|
|
1895
|
-
case
|
|
1896
|
-
|
|
2028
|
+
case ve.ALL:
|
|
2029
|
+
S.startRow = 0, S.startColumn = 0, S.endRow = this._skeleton.getRowCount() - 1, S.endColumn = this._skeleton.getColumnCount() - 1;
|
|
1897
2030
|
}
|
|
1898
|
-
const C = { range:
|
|
2031
|
+
const C = { range: S, primary: S, style: null };
|
|
1899
2032
|
C.range.rangeType = o;
|
|
1900
|
-
const _ =
|
|
2033
|
+
const _ = tn(C, this._skeleton);
|
|
1901
2034
|
this._startRangeWhenPointerDown = { ..._.rangeWithCoord };
|
|
1902
|
-
const
|
|
2035
|
+
const E = { ..._.rangeWithCoord, rangeType: o };
|
|
1903
2036
|
let f = this.getActiveSelectionControl();
|
|
1904
2037
|
const b = this.getSelectionControls();
|
|
1905
|
-
for (const
|
|
1906
|
-
if (t.button === 2 &&
|
|
1907
|
-
f =
|
|
2038
|
+
for (const O of b) {
|
|
2039
|
+
if (t.button === 2 && er.contains(O.model, E)) {
|
|
2040
|
+
f = O;
|
|
1908
2041
|
return;
|
|
1909
2042
|
}
|
|
1910
|
-
if (
|
|
1911
|
-
f =
|
|
2043
|
+
if (O.model.isEqual(E)) {
|
|
2044
|
+
f = O;
|
|
1912
2045
|
break;
|
|
1913
2046
|
}
|
|
1914
2047
|
}
|
|
@@ -1916,17 +2049,17 @@ let $e = class extends Oo {
|
|
|
1916
2049
|
const y = f == null ? void 0 : f.model.currentCell, A = t.shiftKey && y, F = this._remainLastEnabled && !t.ctrlKey && !t.shiftKey && !this._skipLastEnabled && !this._singleSelectionEnabled;
|
|
1917
2050
|
A && y ? this._makeSelectionByTwoCells(
|
|
1918
2051
|
y,
|
|
1919
|
-
|
|
2052
|
+
E,
|
|
1920
2053
|
i,
|
|
1921
2054
|
o,
|
|
1922
2055
|
f
|
|
1923
2056
|
// Get updated in this method
|
|
1924
2057
|
) : F && f ? f.updateRangeBySelectionWithCoord(_) : f = this.newSelectionControl(c, i, C);
|
|
1925
|
-
for (let
|
|
1926
|
-
this.getSelectionControls()[
|
|
1927
|
-
this._selectionMoveStart$.next(this.getSelectionDataWithStyle()), c.disableObjectsEvent(), this._clearUpdatingListeners(), this._addEndingListeners(), (
|
|
1928
|
-
var
|
|
1929
|
-
this._clearUpdatingListeners(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle()), (
|
|
2058
|
+
for (let O = 0; O < this.getSelectionControls().length - 1; O++)
|
|
2059
|
+
this.getSelectionControls()[O].clearHighlight();
|
|
2060
|
+
this._selectionMoveStart$.next(this.getSelectionDataWithStyle()), c.disableObjectsEvent(), this._clearUpdatingListeners(), this._addEndingListeners(), (N = c.getTransformer()) == null || N.clearSelectedObjects(), this._setupPointerMoveListener(m, f, o, s, d, u), this._escapeShortcutDisposable = this._shortcutService.forceEscape(), this._scenePointerUpSub = c.onPointerUp$.subscribeEvent(() => {
|
|
2061
|
+
var O;
|
|
2062
|
+
this._clearUpdatingListeners(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle()), (O = this._escapeShortcutDisposable) == null || O.dispose(), this._escapeShortcutDisposable = null;
|
|
1930
2063
|
});
|
|
1931
2064
|
}
|
|
1932
2065
|
/**
|
|
@@ -1937,12 +2070,12 @@ let $e = class extends Oo {
|
|
|
1937
2070
|
* @returns {SelectionControl} selectionControl just created
|
|
1938
2071
|
*/
|
|
1939
2072
|
newSelectionControl(t, n, o) {
|
|
1940
|
-
const r = this.getSelectionControls().length, { rowHeaderWidth: s, columnHeaderHeight: i } = n, c = new
|
|
2073
|
+
const r = this.getSelectionControls().length, { rowHeaderWidth: s, columnHeaderHeight: i } = n, c = new cr(t, r, this._themeService, {
|
|
1941
2074
|
highlightHeader: this._highlightHeader,
|
|
1942
2075
|
enableAutoFill: !1,
|
|
1943
2076
|
rowHeaderWidth: s,
|
|
1944
2077
|
columnHeaderHeight: i
|
|
1945
|
-
}), l =
|
|
2078
|
+
}), l = tn(o, n);
|
|
1946
2079
|
return c.updateRangeBySelectionWithCoord(l), this._selectionControls.push(c), c.setControlExtension({
|
|
1947
2080
|
skeleton: n,
|
|
1948
2081
|
scene: t,
|
|
@@ -1956,19 +2089,19 @@ let $e = class extends Oo {
|
|
|
1956
2089
|
}), c;
|
|
1957
2090
|
}
|
|
1958
2091
|
};
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
],
|
|
1967
|
-
function
|
|
1968
|
-
const t =
|
|
2092
|
+
De = qi([
|
|
2093
|
+
st(1, q(Rt)),
|
|
2094
|
+
st(2, q(It)),
|
|
2095
|
+
st(3, Gt),
|
|
2096
|
+
st(4, q(jt)),
|
|
2097
|
+
st(5, cn),
|
|
2098
|
+
st(6, Kt)
|
|
2099
|
+
], De);
|
|
2100
|
+
function ji(e) {
|
|
2101
|
+
const t = ar(e);
|
|
1969
2102
|
return t.widgets = { tl: !0, tc: !0, tr: !0, ml: !0, mr: !0, bl: !0, bc: !0, br: !0 }, t;
|
|
1970
2103
|
}
|
|
1971
|
-
const
|
|
2104
|
+
const _n = (e, t, n = !0) => {
|
|
1972
2105
|
let o = -1;
|
|
1973
2106
|
return e.reduce((r, s, i) => {
|
|
1974
2107
|
if (r.isFinish)
|
|
@@ -1982,7 +2115,7 @@ const Rn = (e, t, n = !0) => {
|
|
|
1982
2115
|
}
|
|
1983
2116
|
return (n ? r.currentIndex === t : t > c && t <= r.currentIndex) && (o = i, r.isFinish = !0), r;
|
|
1984
2117
|
}, { currentIndex: 0, isFinish: !1 }), o;
|
|
1985
|
-
},
|
|
2118
|
+
}, $r = (e, t) => {
|
|
1986
2119
|
const n = e[t];
|
|
1987
2120
|
let o = -1;
|
|
1988
2121
|
if (!n || typeof n == "string" || n.nodeType !== Q.REFERENCE) return -1;
|
|
@@ -1991,7 +2124,7 @@ const Rn = (e, t, n = !0) => {
|
|
|
1991
2124
|
typeof s != "string" && s.nodeType === Q.REFERENCE && o++;
|
|
1992
2125
|
}
|
|
1993
2126
|
return o;
|
|
1994
|
-
},
|
|
2127
|
+
}, Ki = (e, t = 100) => {
|
|
1995
2128
|
$(() => {
|
|
1996
2129
|
let n = null;
|
|
1997
2130
|
const o = () => {
|
|
@@ -2004,8 +2137,8 @@ const Rn = (e, t, n = !0) => {
|
|
|
2004
2137
|
};
|
|
2005
2138
|
}, [e, t]);
|
|
2006
2139
|
};
|
|
2007
|
-
function
|
|
2008
|
-
const o = T(
|
|
2140
|
+
function Pr(e, t, n) {
|
|
2141
|
+
const o = T(Ye), r = ie(() => new fr({ left: -999, top: -999, right: -999, bottom: -999 }), []), s = T(pn), i = T(ne), c = te(() => {
|
|
2009
2142
|
var _;
|
|
2010
2143
|
const l = o.getEditor(e);
|
|
2011
2144
|
if (!l)
|
|
@@ -2013,50 +2146,50 @@ function Ur(e, t, n) {
|
|
|
2013
2146
|
const g = l.getBoundingClientRect(), { marginTop: m = 0, marginBottom: h = 0 } = l.getDocumentData().documentStyle, d = l.getSkeleton();
|
|
2014
2147
|
if (!d) return;
|
|
2015
2148
|
const u = (_ = d.getSkeletonData()) == null ? void 0 : _.pages[0].height;
|
|
2016
|
-
let { left: a, top:
|
|
2017
|
-
|
|
2149
|
+
let { left: a, top: v, right: p, bottom: S } = g;
|
|
2150
|
+
v = v + m, S = u ? v + u : S - h;
|
|
2018
2151
|
const C = r.getValue();
|
|
2019
|
-
if (!(C.left === a && C.top ===
|
|
2020
|
-
return r.next({ left: a - 1, right: p + 1, top:
|
|
2152
|
+
if (!(C.left === a && C.top === v && C.right === p && C.bottom === S))
|
|
2153
|
+
return r.next({ left: a - 1, right: p + 1, top: v - 1, bottom: S + 1 }), g;
|
|
2021
2154
|
});
|
|
2022
2155
|
return $(() => {
|
|
2023
2156
|
t && c();
|
|
2024
|
-
}, [e, o, i.unitAdded$, c, t, ...n != null ? n : []]),
|
|
2025
|
-
const l = s.scrollEvent$.pipe(
|
|
2157
|
+
}, [e, o, i.unitAdded$, c, t, ...n != null ? n : []]), Ki(c), $(() => {
|
|
2158
|
+
const l = s.scrollEvent$.pipe(Ko(100)).subscribe(c);
|
|
2026
2159
|
return () => {
|
|
2027
2160
|
l.unsubscribe();
|
|
2028
2161
|
};
|
|
2029
2162
|
}, []), [r, c];
|
|
2030
2163
|
}
|
|
2031
|
-
const
|
|
2164
|
+
const tt = (e) => {
|
|
2032
2165
|
const t = z(e);
|
|
2033
2166
|
return t.current = e, t;
|
|
2034
|
-
},
|
|
2035
|
-
const o = T(
|
|
2167
|
+
}, Yi = (e, t, n) => {
|
|
2168
|
+
const o = T(Zt), r = T(Yt), s = T(_e), [i, c] = V(), [l, g] = V(-1), [m, h] = V(!0), d = tt(m), u = z(t);
|
|
2036
2169
|
u.current = t;
|
|
2037
2170
|
const a = () => {
|
|
2038
2171
|
c(void 0), g(-1), h(!1);
|
|
2039
2172
|
};
|
|
2040
2173
|
return $(() => {
|
|
2041
|
-
const
|
|
2042
|
-
o.setSequenceNodes(
|
|
2174
|
+
const v = s.sequenceNodesBuilder(t.slice(1));
|
|
2175
|
+
o.setSequenceNodes(v != null ? v : []);
|
|
2043
2176
|
}, [t]), $(() => {
|
|
2044
2177
|
if (n && e) {
|
|
2045
|
-
const
|
|
2046
|
-
if (
|
|
2047
|
-
const [C] =
|
|
2178
|
+
const v = n.selectionChange$.pipe(hn(50)).subscribe((S) => {
|
|
2179
|
+
if (S.textRanges.length === 1) {
|
|
2180
|
+
const [C] = S.textRanges;
|
|
2048
2181
|
if (C.collapsed && d.current) {
|
|
2049
|
-
const { startOffset: _ } = C,
|
|
2182
|
+
const { startOffset: _ } = C, E = o.getCurrentSequenceNodeIndex(_ - 2), f = o.getCurrentSequenceNodeByIndex(E), b = o.getCurrentSequenceNodeByIndex(E + 1);
|
|
2050
2183
|
if (f)
|
|
2051
|
-
if (typeof f != "string" && f.nodeType === 3 && !r.hasDefinedNameDescription(f.token.trim()) && b ===
|
|
2184
|
+
if (typeof f != "string" && f.nodeType === 3 && !r.hasDefinedNameDescription(f.token.trim()) && b === je.OPEN_BRACKET) {
|
|
2052
2185
|
const y = r.getFunctionInfo(f.token);
|
|
2053
2186
|
c(y), g(-1);
|
|
2054
2187
|
return;
|
|
2055
2188
|
} else {
|
|
2056
2189
|
const y = s.getFunctionAndParameter(`${u.current}A`, _ - 1);
|
|
2057
2190
|
if (y) {
|
|
2058
|
-
const { functionName: A, paramIndex: F } = y,
|
|
2059
|
-
c(
|
|
2191
|
+
const { functionName: A, paramIndex: F } = y, N = r.getFunctionInfo(A);
|
|
2192
|
+
c(N), g(F);
|
|
2060
2193
|
return;
|
|
2061
2194
|
}
|
|
2062
2195
|
}
|
|
@@ -2064,14 +2197,14 @@ const nt = (e) => {
|
|
|
2064
2197
|
}
|
|
2065
2198
|
c(void 0), g(-1);
|
|
2066
2199
|
}), p = n.selectionChange$.pipe(
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2200
|
+
gr((S) => S.textRanges.length === 1),
|
|
2201
|
+
hr((S) => S.textRanges[0].startOffset),
|
|
2202
|
+
Yo()
|
|
2070
2203
|
).subscribe(() => {
|
|
2071
2204
|
h(!0);
|
|
2072
2205
|
});
|
|
2073
2206
|
return () => {
|
|
2074
|
-
|
|
2207
|
+
v.unsubscribe(), p.unsubscribe();
|
|
2075
2208
|
};
|
|
2076
2209
|
}
|
|
2077
2210
|
}, [n, e]), $(() => {
|
|
@@ -2081,14 +2214,14 @@ const nt = (e) => {
|
|
|
2081
2214
|
paramIndex: l,
|
|
2082
2215
|
reset: a
|
|
2083
2216
|
};
|
|
2084
|
-
},
|
|
2217
|
+
}, Gi = ({ onClick: e }) => /* @__PURE__ */ M(
|
|
2085
2218
|
"div",
|
|
2086
2219
|
{
|
|
2087
2220
|
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",
|
|
2088
2221
|
onClick: e,
|
|
2089
2222
|
children: "?"
|
|
2090
2223
|
}
|
|
2091
|
-
),
|
|
2224
|
+
), en = ({ className: e, title: t, value: n }) => /* @__PURE__ */ W("div", { className: "univer-my-2", children: [
|
|
2092
2225
|
/* @__PURE__ */ M(
|
|
2093
2226
|
"div",
|
|
2094
2227
|
{
|
|
@@ -2103,7 +2236,7 @@ const nt = (e) => {
|
|
|
2103
2236
|
children: n
|
|
2104
2237
|
}
|
|
2105
2238
|
)
|
|
2106
|
-
] }),
|
|
2239
|
+
] }), Zi = (e) => {
|
|
2107
2240
|
const { prefix: t, value: n, active: o, onClick: r } = e;
|
|
2108
2241
|
return /* @__PURE__ */ W("div", { children: [
|
|
2109
2242
|
/* @__PURE__ */ W("span", { children: [
|
|
@@ -2123,19 +2256,19 @@ const nt = (e) => {
|
|
|
2123
2256
|
] }, s.name)),
|
|
2124
2257
|
")"
|
|
2125
2258
|
] });
|
|
2126
|
-
},
|
|
2259
|
+
}, Xn = () => {
|
|
2127
2260
|
};
|
|
2128
|
-
function
|
|
2129
|
-
const { onParamsSwitch: t =
|
|
2261
|
+
function zi(e) {
|
|
2262
|
+
const { onParamsSwitch: t = Xn, onClose: n = Xn, isFocus: o, editor: r, formulaText: s } = e, { functionInfo: i, paramIndex: c, reset: l } = Yi(o, s, r), g = T(dn), 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] = Pr(p, !!i, [i, c]);
|
|
2130
2263
|
function C(f) {
|
|
2131
2264
|
t && t(f);
|
|
2132
2265
|
}
|
|
2133
2266
|
const _ = te((f) => {
|
|
2134
2267
|
g.helpFunctionVisible$.next(!f);
|
|
2135
|
-
}),
|
|
2268
|
+
}), E = () => {
|
|
2136
2269
|
_(!0), n();
|
|
2137
2270
|
};
|
|
2138
|
-
return i ? m ? /* @__PURE__ */ M(
|
|
2271
|
+
return i ? m ? /* @__PURE__ */ M(nn, { portal: !0, anchorRect$: S, direction: "left-center", children: /* @__PURE__ */ M(Gi, { onClick: () => _(!1) }) }, "hidden") : /* @__PURE__ */ M(nn, { portal: !0, onClickOutside: () => l(), anchorRect$: S, direction: "vertical", children: /* @__PURE__ */ W(
|
|
2139
2272
|
"div",
|
|
2140
2273
|
{
|
|
2141
2274
|
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", Sn),
|
|
@@ -2143,10 +2276,10 @@ function Qi(e) {
|
|
|
2143
2276
|
/* @__PURE__ */ W(
|
|
2144
2277
|
"div",
|
|
2145
2278
|
{
|
|
2146
|
-
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",
|
|
2279
|
+
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", Es),
|
|
2147
2280
|
children: [
|
|
2148
2281
|
/* @__PURE__ */ M(
|
|
2149
|
-
|
|
2282
|
+
Zi,
|
|
2150
2283
|
{
|
|
2151
2284
|
prefix: i.functionName,
|
|
2152
2285
|
value: i.functionParameter,
|
|
@@ -2161,15 +2294,15 @@ function Qi(e) {
|
|
|
2161
2294
|
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",
|
|
2162
2295
|
style: { transform: h ? "rotateZ(-90deg)" : "rotateZ(90deg)" },
|
|
2163
2296
|
onClick: () => d(!h),
|
|
2164
|
-
children: /* @__PURE__ */ M(
|
|
2297
|
+
children: /* @__PURE__ */ M(Fr, {})
|
|
2165
2298
|
}
|
|
2166
2299
|
),
|
|
2167
2300
|
/* @__PURE__ */ M(
|
|
2168
2301
|
"div",
|
|
2169
2302
|
{
|
|
2170
2303
|
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",
|
|
2171
|
-
onClick:
|
|
2172
|
-
children: /* @__PURE__ */ M(
|
|
2304
|
+
onClick: E,
|
|
2305
|
+
children: /* @__PURE__ */ M(wr, {})
|
|
2173
2306
|
}
|
|
2174
2307
|
)
|
|
2175
2308
|
] })
|
|
@@ -2179,32 +2312,32 @@ function Qi(e) {
|
|
|
2179
2312
|
/* @__PURE__ */ M(
|
|
2180
2313
|
"div",
|
|
2181
2314
|
{
|
|
2182
|
-
className: re("univer-box-border univer-max-h-[350px] univer-overflow-y-auto univer-px-4 univer-pb-3 univer-pt-0",
|
|
2315
|
+
className: re("univer-box-border univer-max-h-[350px] univer-overflow-y-auto univer-px-4 univer-pb-3 univer-pt-0", lt),
|
|
2183
2316
|
style: {
|
|
2184
2317
|
height: h ? "unset" : 0,
|
|
2185
2318
|
padding: h ? "revert-layer" : 0
|
|
2186
2319
|
},
|
|
2187
2320
|
children: /* @__PURE__ */ W("div", { className: "univer-mt-3", children: [
|
|
2188
2321
|
/* @__PURE__ */ M(
|
|
2189
|
-
|
|
2322
|
+
en,
|
|
2190
2323
|
{
|
|
2191
2324
|
title: u.t("formula.prompt.helpExample"),
|
|
2192
2325
|
value: `${i.functionName}(${i.functionParameter.map((f) => f.example).join(",")})`
|
|
2193
2326
|
}
|
|
2194
2327
|
),
|
|
2195
2328
|
/* @__PURE__ */ M(
|
|
2196
|
-
|
|
2329
|
+
en,
|
|
2197
2330
|
{
|
|
2198
2331
|
title: u.t("formula.prompt.helpAbstract"),
|
|
2199
2332
|
value: i.description
|
|
2200
2333
|
}
|
|
2201
2334
|
),
|
|
2202
2335
|
i && i.functionParameter && i.functionParameter.map((f, b) => /* @__PURE__ */ M(
|
|
2203
|
-
|
|
2336
|
+
en,
|
|
2204
2337
|
{
|
|
2205
2338
|
className: c === b ? "univer-text-primary-500" : "",
|
|
2206
2339
|
title: f.name,
|
|
2207
|
-
value: `${f.require ? a :
|
|
2340
|
+
value: `${f.require ? a : v} ${f.detail}`
|
|
2208
2341
|
},
|
|
2209
2342
|
b
|
|
2210
2343
|
))
|
|
@@ -2215,14 +2348,14 @@ function Qi(e) {
|
|
|
2215
2348
|
}
|
|
2216
2349
|
) }, "show") : null;
|
|
2217
2350
|
}
|
|
2218
|
-
const
|
|
2219
|
-
const t = T(
|
|
2351
|
+
const Xi = (e) => {
|
|
2352
|
+
const t = T(Ye);
|
|
2220
2353
|
return te((o) => {
|
|
2221
2354
|
var r, s;
|
|
2222
2355
|
if (e) {
|
|
2223
2356
|
t.focus(e.getEditorId());
|
|
2224
2357
|
const i = [...e.getSelectionRanges()];
|
|
2225
|
-
if (
|
|
2358
|
+
if (ln.isDefine(o))
|
|
2226
2359
|
e.setSelectionRanges([{ startOffset: o, endOffset: o }]);
|
|
2227
2360
|
else if (!i.length && !e.docSelectionRenderService.isOnPointerEvent) {
|
|
2228
2361
|
const c = (s = (r = e.getDocumentData().body) == null ? void 0 : r.dataStream) != null ? s : `\r
|
|
@@ -2233,19 +2366,19 @@ const Ji = (e) => {
|
|
|
2233
2366
|
}
|
|
2234
2367
|
});
|
|
2235
2368
|
};
|
|
2236
|
-
function
|
|
2369
|
+
function Qi(e) {
|
|
2237
2370
|
var r, s;
|
|
2238
2371
|
const n = e.get(ne).getCurrentUniverDocInstance();
|
|
2239
2372
|
return n != null && n.getBody() ? { dataStream: (s = (r = n.getBody()) == null ? void 0 : r.dataStream) != null ? s : "", offset: 0 } : void 0;
|
|
2240
2373
|
}
|
|
2241
|
-
var
|
|
2242
|
-
function
|
|
2374
|
+
var Te = /* @__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))(Te || {});
|
|
2375
|
+
function Ji(e) {
|
|
2243
2376
|
var y;
|
|
2244
|
-
const { editorId: t, isFocus: n, disableOnClick: o, unitId: r, subUnitId: s } = e, i = T(
|
|
2377
|
+
const { editorId: t, isFocus: n, disableOnClick: o, unitId: r, subUnitId: s } = e, i = T(xe), c = T(ne), l = i.getRenderById(r), g = i.getRenderById(t), m = g == null ? void 0 : g.with(mr), h = T(Rr), d = T(Rt), [u, a] = V(
|
|
2245
2378
|
0
|
|
2246
2379
|
/* NOT_SELECT */
|
|
2247
|
-
),
|
|
2248
|
-
|
|
2380
|
+
), v = T(_e), p = z(!0), S = l == null ? void 0 : l.with(De), C = tt(u), _ = c.getUnit(r, H.UNIVER_SHEET), E = _ == null ? void 0 : _.getSheetBySheetId(s), f = te((A) => {
|
|
2381
|
+
S && S.setSkipLastEnabled(
|
|
2249
2382
|
A === 1 || A === 3 || A === 4
|
|
2250
2383
|
/* EDIT_OTHER_WORKBOOK_REFERENCE */
|
|
2251
2384
|
), C.current = A, a(A);
|
|
@@ -2253,24 +2386,24 @@ function tc(e) {
|
|
|
2253
2386
|
var ce, ae, he;
|
|
2254
2387
|
const A = c.getCurrentUnitOfType(H.UNIVER_SHEET);
|
|
2255
2388
|
if (!A) return;
|
|
2256
|
-
const F = A.getActiveSheet(),
|
|
2389
|
+
const F = A.getActiveSheet(), N = m == null ? void 0 : m.getActiveTextRange(), O = N != null && N.collapsed ? N.startOffset : -1, k = Qi(d);
|
|
2257
2390
|
if (!k) return;
|
|
2258
|
-
const
|
|
2391
|
+
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 ? {
|
|
2259
2392
|
...K,
|
|
2260
|
-
range:
|
|
2393
|
+
range: Lo(K.token)
|
|
2261
2394
|
} : {
|
|
2262
2395
|
...K,
|
|
2263
2396
|
range: void 0
|
|
2264
|
-
} : K), R =
|
|
2265
|
-
if ((
|
|
2397
|
+
} : 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 && $o(R) && (!w || Po(w) && w !== je.OPEN_BRACKET), B = !!D;
|
|
2398
|
+
if ((I == null ? void 0 : I.substring(0, 1)) === "=" && (U || B))
|
|
2266
2399
|
if (B) {
|
|
2267
2400
|
if (p.current)
|
|
2268
2401
|
return;
|
|
2269
|
-
const { sheetName: K, unitId: J } = D.range,
|
|
2270
|
-
J && J !==
|
|
2402
|
+
const { sheetName: K, unitId: J } = D.range, nt = (he = c.getCurrentUnitOfType(H.UNIVER_SHEET)) == null ? void 0 : he.getUnitId();
|
|
2403
|
+
J && J !== nt ? f(
|
|
2271
2404
|
4
|
|
2272
2405
|
/* EDIT_OTHER_WORKBOOK_REFERENCE */
|
|
2273
|
-
) : !K && F.getSheetId() === (
|
|
2406
|
+
) : !K && F.getSheetId() === (E == null ? void 0 : E.getSheetId()) || K === F.getName() ? f(
|
|
2274
2407
|
2
|
|
2275
2408
|
/* CAN_EDIT */
|
|
2276
2409
|
) : f(
|
|
@@ -2289,7 +2422,7 @@ function tc(e) {
|
|
|
2289
2422
|
);
|
|
2290
2423
|
});
|
|
2291
2424
|
return $(() => {
|
|
2292
|
-
const A = h.textSelection$.pipe(
|
|
2425
|
+
const A = h.textSelection$.pipe(gr((F) => F.unitId === t)).subscribe(() => {
|
|
2293
2426
|
b();
|
|
2294
2427
|
});
|
|
2295
2428
|
return () => A.unsubscribe();
|
|
@@ -2320,12 +2453,12 @@ function tc(e) {
|
|
|
2320
2453
|
};
|
|
2321
2454
|
}, [b, n, _ == null ? void 0 : _.activeSheet$, c.getCurrentTypeOfUnit$]), { isSelecting: u, isSelectingRef: C };
|
|
2322
2455
|
}
|
|
2323
|
-
const
|
|
2324
|
-
const e = T(
|
|
2325
|
-
return
|
|
2456
|
+
const ec = () => {
|
|
2457
|
+
const e = T(_e);
|
|
2458
|
+
return Dt((n) => e.sequenceNodesBuilder(n) || [], [e]);
|
|
2326
2459
|
};
|
|
2327
|
-
function
|
|
2328
|
-
const o = new
|
|
2460
|
+
function tc(e, t, n) {
|
|
2461
|
+
const o = new un(t).setAlpha(0.05).toRgbString();
|
|
2329
2462
|
return {
|
|
2330
2463
|
id: n,
|
|
2331
2464
|
strokeWidth: 1,
|
|
@@ -2337,8 +2470,8 @@ function rc(e, t, n) {
|
|
|
2337
2470
|
widgetStroke: e.getColorFromTheme("white")
|
|
2338
2471
|
};
|
|
2339
2472
|
}
|
|
2340
|
-
function
|
|
2341
|
-
var _,
|
|
2473
|
+
function Ur(e) {
|
|
2474
|
+
var _, E, f;
|
|
2342
2475
|
const {
|
|
2343
2476
|
unitId: t,
|
|
2344
2477
|
subUnitId: n,
|
|
@@ -2355,34 +2488,34 @@ function Vr(e) {
|
|
|
2355
2488
|
i.setSelections(a);
|
|
2356
2489
|
return;
|
|
2357
2490
|
}
|
|
2358
|
-
const
|
|
2491
|
+
const v = u.getSheetId(), p = (b) => {
|
|
2359
2492
|
var y;
|
|
2360
2493
|
return (y = d == null ? void 0 : d.getSheetBySheetName(b)) == null ? void 0 : y.getSheetId();
|
|
2361
2494
|
};
|
|
2362
|
-
if (!((_ = l == null ? void 0 : l.getWorksheetSkeleton(
|
|
2495
|
+
if (!((_ = l == null ? void 0 : l.getWorksheetSkeleton(v)) == null ? void 0 : _.skeleton)) return;
|
|
2363
2496
|
const C = [];
|
|
2364
2497
|
for (let b = 0, y = r.length; b < y; b++) {
|
|
2365
|
-
const A = r[b], { themeColor: F, token:
|
|
2366
|
-
if (!D && R || h !== t && x !== h || x && x !== h || D && D !==
|
|
2498
|
+
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);
|
|
2499
|
+
if (!D && R || h !== t && x !== h || x && x !== h || D && D !== v || !D && v !== n)
|
|
2367
2500
|
continue;
|
|
2368
|
-
const U =
|
|
2369
|
-
U.unitId = t, U.sheetId =
|
|
2501
|
+
const U = as(w, u.getRowCount(), u.getColumnCount());
|
|
2502
|
+
U.unitId = t, U.sheetId = v, a.push({
|
|
2370
2503
|
range: U,
|
|
2371
2504
|
primary: null,
|
|
2372
|
-
style:
|
|
2505
|
+
style: tc(g, F, O.toString())
|
|
2373
2506
|
}), C.push(k);
|
|
2374
2507
|
}
|
|
2375
2508
|
if (s) {
|
|
2376
|
-
const b = (f = (
|
|
2509
|
+
const b = (f = (E = s.getSelectionRanges()) == null ? void 0 : E[0]) == null ? void 0 : f.startOffset, y = C.findIndex((A) => A + 2 === b);
|
|
2377
2510
|
y !== -1 ? c == null || c.setActiveSelectionIndex(y) : c == null || c.resetActiveSelectionIndex();
|
|
2378
2511
|
}
|
|
2379
2512
|
return a;
|
|
2380
2513
|
}
|
|
2381
|
-
function
|
|
2382
|
-
const n = T(ne), o = T(It), r = T(
|
|
2514
|
+
function nc(e, t) {
|
|
2515
|
+
const n = T(ne), o = T(It), r = T(Kt), s = T(xe), i = Se(ie(() => n.getCurrentTypeOfUnit$(H.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(jt), m = te((h, d) => {
|
|
2383
2516
|
const u = n.getCurrentUnitOfType(H.UNIVER_SHEET);
|
|
2384
2517
|
if (!u || l != null && l.selectionMoving) return;
|
|
2385
|
-
const a =
|
|
2518
|
+
const a = Ur({
|
|
2386
2519
|
unitId: e,
|
|
2387
2520
|
subUnitId: t,
|
|
2388
2521
|
currentWorkbook: u,
|
|
@@ -2401,8 +2534,8 @@ function oc(e, t) {
|
|
|
2401
2534
|
l == null || l.resetActiveSelectionIndex();
|
|
2402
2535
|
}, [l]), m;
|
|
2403
2536
|
}
|
|
2404
|
-
function
|
|
2405
|
-
const t = T(
|
|
2537
|
+
function Vr(e = "") {
|
|
2538
|
+
const t = T(Yt), n = rc(), o = T(me), r = ie(() => e.length, [e]);
|
|
2406
2539
|
return te((i, c, l = !0, g) => {
|
|
2407
2540
|
const m = i.getDocumentData(), h = i.getEditorId();
|
|
2408
2541
|
if (!m)
|
|
@@ -2413,35 +2546,35 @@ function Wr(e = "") {
|
|
|
2413
2546
|
const u = d.dataStream.slice(0, d.dataStream.length - 2), a = { dataStream: "", ...m.body };
|
|
2414
2547
|
if (!u.startsWith(e)) return [];
|
|
2415
2548
|
if (c == null || c.length === 0)
|
|
2416
|
-
return a.textRuns = [], o.syncExecuteCommand(
|
|
2549
|
+
return a.textRuns = [], o.syncExecuteCommand(Un.id, {
|
|
2417
2550
|
unitId: h,
|
|
2418
|
-
body:
|
|
2551
|
+
body: Mn(a, 0, a.dataStream.length - 2)
|
|
2419
2552
|
}), [];
|
|
2420
2553
|
{
|
|
2421
|
-
const { textRuns:
|
|
2422
|
-
r &&
|
|
2554
|
+
const { textRuns: v, refSelections: p } = oc(t, n, c);
|
|
2555
|
+
r && v.forEach((_) => {
|
|
2423
2556
|
_.ed = _.ed + r, _.st = _.st + r;
|
|
2424
|
-
}), a.textRuns = [{ st: 0, ed: 1, ts: { fs: 11 } }, ...
|
|
2425
|
-
const
|
|
2426
|
-
a.dataStream = `${e}${
|
|
2557
|
+
}), a.textRuns = [{ st: 0, ed: 1, ts: { fs: 11 } }, ...v];
|
|
2558
|
+
const S = c.reduce((_, E) => typeof E == "string" ? `${_}${E}` : `${_}${E.token}`, "");
|
|
2559
|
+
a.dataStream = `${e}${S}\r
|
|
2427
2560
|
`;
|
|
2428
2561
|
let C;
|
|
2429
2562
|
if (l) {
|
|
2430
2563
|
C = i.getSelectionRanges();
|
|
2431
2564
|
const _ = a.dataStream.length - 2 + r;
|
|
2432
|
-
C.forEach((
|
|
2433
|
-
|
|
2565
|
+
C.forEach((E) => {
|
|
2566
|
+
E.startOffset = Math.max(0, Math.min(E.startOffset, _)), E.endOffset = Math.max(0, Math.min(E.endOffset, _));
|
|
2434
2567
|
});
|
|
2435
2568
|
}
|
|
2436
|
-
return o.syncExecuteCommand(
|
|
2569
|
+
return o.syncExecuteCommand(Un.id, {
|
|
2437
2570
|
unitId: h,
|
|
2438
|
-
body:
|
|
2571
|
+
body: Mn(a, 0, a.dataStream.length - 2),
|
|
2439
2572
|
textRanges: g != null ? g : C
|
|
2440
2573
|
}), p;
|
|
2441
2574
|
}
|
|
2442
2575
|
});
|
|
2443
2576
|
}
|
|
2444
|
-
function
|
|
2577
|
+
function rc() {
|
|
2445
2578
|
const e = T(It), t = e.getCurrentTheme();
|
|
2446
2579
|
return ie(() => {
|
|
2447
2580
|
const o = [
|
|
@@ -2461,15 +2594,15 @@ function sc() {
|
|
|
2461
2594
|
return { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: i };
|
|
2462
2595
|
}, [t]);
|
|
2463
2596
|
}
|
|
2464
|
-
function
|
|
2597
|
+
function oc(e, t, n) {
|
|
2465
2598
|
const { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: i } = t, c = [], l = [], g = /* @__PURE__ */ new Map();
|
|
2466
2599
|
let m = 0;
|
|
2467
2600
|
for (let h = 0, d = n.length; h < d; h++) {
|
|
2468
2601
|
const u = n[h];
|
|
2469
2602
|
if (typeof u == "string") {
|
|
2470
|
-
const _ = c[c.length - 1],
|
|
2603
|
+
const _ = c[c.length - 1], E = _ ? _.ed : 0, f = E + u.length;
|
|
2471
2604
|
c.push({
|
|
2472
|
-
st:
|
|
2605
|
+
st: E,
|
|
2473
2606
|
ed: f,
|
|
2474
2607
|
ts: {
|
|
2475
2608
|
cl: {
|
|
@@ -2493,19 +2626,19 @@ function ic(e, t, n) {
|
|
|
2493
2626
|
});
|
|
2494
2627
|
continue;
|
|
2495
2628
|
}
|
|
2496
|
-
const { startIndex: a, endIndex:
|
|
2629
|
+
const { startIndex: a, endIndex: v, nodeType: p, token: S } = u;
|
|
2497
2630
|
let C = "";
|
|
2498
2631
|
if (p === Q.REFERENCE) {
|
|
2499
|
-
if (g.has(
|
|
2500
|
-
C = g.get(
|
|
2632
|
+
if (g.has(S))
|
|
2633
|
+
C = g.get(S);
|
|
2501
2634
|
else {
|
|
2502
2635
|
const _ = m % o.length;
|
|
2503
|
-
C = o[_], g.set(
|
|
2636
|
+
C = o[_], g.set(S, C), m++;
|
|
2504
2637
|
}
|
|
2505
2638
|
l.push({
|
|
2506
2639
|
refIndex: h,
|
|
2507
2640
|
themeColor: C,
|
|
2508
|
-
token:
|
|
2641
|
+
token: S,
|
|
2509
2642
|
startIndex: u.startIndex,
|
|
2510
2643
|
endIndex: u.endIndex,
|
|
2511
2644
|
index: l.length
|
|
@@ -2513,7 +2646,7 @@ function ic(e, t, n) {
|
|
|
2513
2646
|
} else p === Q.NUMBER ? C = r : (p === Q.STRING || p === Q.ARRAY) && (C = s);
|
|
2514
2647
|
C && C.length > 0 ? c.push({
|
|
2515
2648
|
st: a,
|
|
2516
|
-
ed:
|
|
2649
|
+
ed: v + 1,
|
|
2517
2650
|
ts: {
|
|
2518
2651
|
cl: {
|
|
2519
2652
|
rgb: C
|
|
@@ -2522,7 +2655,7 @@ function ic(e, t, n) {
|
|
|
2522
2655
|
}
|
|
2523
2656
|
}) : c.push({
|
|
2524
2657
|
st: a,
|
|
2525
|
-
ed:
|
|
2658
|
+
ed: v + 1,
|
|
2526
2659
|
ts: {
|
|
2527
2660
|
cl: {
|
|
2528
2661
|
rgb: i
|
|
@@ -2533,50 +2666,50 @@ function ic(e, t, n) {
|
|
|
2533
2666
|
}
|
|
2534
2667
|
return { textRuns: c, refSelections: l };
|
|
2535
2668
|
}
|
|
2536
|
-
const
|
|
2537
|
-
const r = T(
|
|
2669
|
+
const sc = (e, t, n, o) => {
|
|
2670
|
+
const r = T(me), s = T(Gt), i = z(t);
|
|
2538
2671
|
i.current = t;
|
|
2539
2672
|
const c = z(o);
|
|
2540
2673
|
c.current = o, $(() => {
|
|
2541
2674
|
if (!n || !e)
|
|
2542
2675
|
return;
|
|
2543
|
-
const g = `sheet.formula-embedding-editor.${n.getEditorId()}`, m = new qe(), h = (a,
|
|
2676
|
+
const g = `sheet.formula-embedding-editor.${n.getEditorId()}`, m = new qe(), h = (a, v) => {
|
|
2544
2677
|
if (c.current) {
|
|
2545
|
-
c.current(a,
|
|
2678
|
+
c.current(a, v);
|
|
2546
2679
|
return;
|
|
2547
2680
|
}
|
|
2548
2681
|
let p = de.LEFT;
|
|
2549
|
-
a === L.ARROW_DOWN ? p = de.DOWN : a === L.ARROW_UP ? p = de.UP : a === L.ARROW_RIGHT && (p = de.RIGHT),
|
|
2682
|
+
a === L.ARROW_DOWN ? p = de.DOWN : a === L.ARROW_UP ? p = de.UP : a === L.ARROW_RIGHT && (p = de.RIGHT), v === P.SHIFT ? r.executeCommand(Zo.id, {
|
|
2550
2683
|
direction: p
|
|
2551
|
-
}) : r.executeCommand(
|
|
2684
|
+
}) : r.executeCommand(zo.id, {
|
|
2552
2685
|
direction: p
|
|
2553
2686
|
});
|
|
2554
|
-
}, d = (a,
|
|
2687
|
+
}, d = (a, v) => {
|
|
2555
2688
|
let p = de.DOWN;
|
|
2556
|
-
a === L.ARROW_DOWN ? p = de.DOWN : a === L.ARROW_UP ? p = de.UP : a === L.ARROW_LEFT ? p = de.LEFT : a === L.ARROW_RIGHT && (p = de.RIGHT), i.current ?
|
|
2689
|
+
a === L.ARROW_DOWN ? p = de.DOWN : a === L.ARROW_UP ? p = de.UP : a === L.ARROW_LEFT ? p = de.LEFT : a === L.ARROW_RIGHT && (p = de.RIGHT), i.current ? v === P.CTRL_COMMAND ? r.executeCommand(Dn.id, {
|
|
2557
2690
|
direction: p,
|
|
2558
|
-
jumpOver:
|
|
2691
|
+
jumpOver: Ln.moveGap,
|
|
2559
2692
|
extra: "formula-editor",
|
|
2560
|
-
fromCurrentSelection: i.current ===
|
|
2561
|
-
}) :
|
|
2693
|
+
fromCurrentSelection: i.current === Te.NEED_ADD || i.current === Te.EDIT_OTHER_SHEET_REFERENCE
|
|
2694
|
+
}) : v === P.SHIFT ? r.executeCommand($n.id, {
|
|
2562
2695
|
direction: p,
|
|
2563
2696
|
extra: "formula-editor"
|
|
2564
|
-
}) :
|
|
2697
|
+
}) : v === (P.CTRL_COMMAND | P.SHIFT) ? r.executeCommand($n.id, {
|
|
2565
2698
|
direction: p,
|
|
2566
|
-
jumpOver:
|
|
2699
|
+
jumpOver: Ln.moveGap,
|
|
2567
2700
|
extra: "formula-editor"
|
|
2568
|
-
}) : r.executeCommand(
|
|
2701
|
+
}) : r.executeCommand(Dn.id, {
|
|
2569
2702
|
direction: p,
|
|
2570
2703
|
extra: "formula-editor",
|
|
2571
|
-
fromCurrentSelection: i.current ===
|
|
2572
|
-
}) : h(a,
|
|
2704
|
+
fromCurrentSelection: i.current === Te.NEED_ADD || i.current === Te.EDIT_OTHER_SHEET_REFERENCE
|
|
2705
|
+
}) : h(a, v);
|
|
2573
2706
|
};
|
|
2574
2707
|
return m.add(r.registerCommand({
|
|
2575
2708
|
id: g,
|
|
2576
2709
|
type: Ne.OPERATION,
|
|
2577
|
-
handler(a,
|
|
2578
|
-
const { keyCode: p, metaKey:
|
|
2579
|
-
d(p,
|
|
2710
|
+
handler(a, v) {
|
|
2711
|
+
const { keyCode: p, metaKey: S } = v;
|
|
2712
|
+
d(p, S);
|
|
2580
2713
|
}
|
|
2581
2714
|
})), [
|
|
2582
2715
|
{ keyCode: L.ARROW_DOWN },
|
|
@@ -2595,15 +2728,15 @@ const cc = (e, t, n, o) => {
|
|
|
2595
2728
|
{ keyCode: L.ARROW_LEFT, metaKey: P.CTRL_COMMAND | P.SHIFT },
|
|
2596
2729
|
{ keyCode: L.ARROW_RIGHT, metaKey: P.CTRL_COMMAND | P.SHIFT },
|
|
2597
2730
|
{ keyCode: L.ARROW_UP, metaKey: P.CTRL_COMMAND | P.SHIFT }
|
|
2598
|
-
].map(({ keyCode: a, metaKey:
|
|
2731
|
+
].map(({ keyCode: a, metaKey: v }) => ({
|
|
2599
2732
|
id: g,
|
|
2600
|
-
binding:
|
|
2733
|
+
binding: v ? a | v : a,
|
|
2601
2734
|
preconditions: () => !0,
|
|
2602
2735
|
priority: 900,
|
|
2603
2736
|
staticParameters: {
|
|
2604
|
-
eventType:
|
|
2737
|
+
eventType: Oe.Keyboard,
|
|
2605
2738
|
keyCode: a,
|
|
2606
|
-
metaKey:
|
|
2739
|
+
metaKey: v
|
|
2607
2740
|
}
|
|
2608
2741
|
})).forEach((a) => {
|
|
2609
2742
|
m.add(s.registerShortcut(a));
|
|
@@ -2611,88 +2744,88 @@ const cc = (e, t, n, o) => {
|
|
|
2611
2744
|
m.dispose();
|
|
2612
2745
|
};
|
|
2613
2746
|
}, [r, n, e, s]);
|
|
2614
|
-
},
|
|
2747
|
+
}, ic = (e, t, n, o, r = !0) => {
|
|
2615
2748
|
var u;
|
|
2616
|
-
const s = T(
|
|
2617
|
-
|
|
2749
|
+
const s = T(xe), i = T(cn), c = T(ps), l = T(Kt), g = T(ne), m = Se(ie(() => g.getCurrentTypeOfUnit$(H.UNIVER_SHEET), [g])), h = s.getRenderById((u = m == null ? void 0 : m.getUnitId()) != null ? u : ""), d = h == null ? void 0 : h.with(De);
|
|
2750
|
+
Lt(() => {
|
|
2618
2751
|
if (e)
|
|
2619
|
-
return i.setContextValue(
|
|
2752
|
+
return i.setContextValue(wn, !0), r && c.disable(), () => {
|
|
2620
2753
|
const a = g.getCurrentUnitOfType(H.UNIVER_DOC);
|
|
2621
|
-
(a == null ? void 0 : a.getUnitId()) === o && i.setContextValue(
|
|
2754
|
+
(a == null ? void 0 : a.getUnitId()) === o && i.setContextValue(wn, !1), r && c.enable(), l.clear();
|
|
2622
2755
|
};
|
|
2623
|
-
}, [i, e, l, r, o]),
|
|
2756
|
+
}, [i, e, l, r, o]), Lt(() => {
|
|
2624
2757
|
if (e && t) {
|
|
2625
2758
|
const a = d == null ? void 0 : d.enableSelectionChanging();
|
|
2626
|
-
return i.setContextValue(
|
|
2627
|
-
i.setContextValue(
|
|
2759
|
+
return i.setContextValue(Hn, !0), () => {
|
|
2760
|
+
i.setContextValue(Hn, !1), a == null || a.dispose();
|
|
2628
2761
|
};
|
|
2629
2762
|
}
|
|
2630
2763
|
}, [i, e, d, t]), $(() => {
|
|
2631
2764
|
e && (d == null || d.setSkipLastEnabled(!1));
|
|
2632
2765
|
}, [e, d]);
|
|
2633
|
-
},
|
|
2634
|
-
const o = T(ne), r = T(
|
|
2635
|
-
return
|
|
2766
|
+
}, cc = (e, t, n) => {
|
|
2767
|
+
const o = T(ne), r = T(fn);
|
|
2768
|
+
return Dt(() => {
|
|
2636
2769
|
if (e) {
|
|
2637
2770
|
const i = [...r.getWorkbookSelections(t).getSelectionsOfWorksheet(n)], c = o.getCurrentUnitForType(H.UNIVER_SHEET), l = c == null ? void 0 : c.getActiveSheet();
|
|
2638
2771
|
(c == null ? void 0 : c.getUnitId()) !== t && o.setCurrentUnitForType(t), l && l.getSheetId() === n && r.setSelections(i);
|
|
2639
2772
|
}
|
|
2640
2773
|
}, [e, r, n, t, o]);
|
|
2641
|
-
},
|
|
2774
|
+
}, ac = (e) => e.reduce((t, n) => typeof n == "string" ? t + n.length : t + n.token.length, 0), sn = (e) => e.map((t) => typeof t == "string" ? t : t.token).join(""), kt = (e, t = !1, n = "", o = !1) => !t && !o ? e.map((r) => Ce(r.range)) : e.map((r) => o ? Uo(r) : r.sheetName !== "" && r.sheetName !== n ? Ct(r.sheetName, r.range) : Ce(r.range)), lc = (e) => {
|
|
2642
2775
|
var m, h, d;
|
|
2643
2776
|
const { editor: t, lexerTreeBuilder: n } = e, o = t == null ? void 0 : t.getSelectionRanges();
|
|
2644
2777
|
if ((o == null ? void 0 : o.length) !== 1)
|
|
2645
2778
|
return;
|
|
2646
2779
|
const s = o[0].startOffset - 1, i = ((h = (m = t == null ? void 0 : t.getDocumentData().body) == null ? void 0 : m.dataStream) != null ? h : `\r
|
|
2647
|
-
`).slice(0, -2), c = (d = n.sequenceNodesBuilder(i.slice(1))) != null ? d : [], l =
|
|
2780
|
+
`).slice(0, -2), c = (d = n.sequenceNodesBuilder(i.slice(1))) != null ? d : [], l = _n(c, s, !1), g = $r(c, l);
|
|
2648
2781
|
return {
|
|
2649
2782
|
nodeIndex: l,
|
|
2650
2783
|
updatingRefIndex: g,
|
|
2651
2784
|
sequenceNodes: c,
|
|
2652
2785
|
offset: s
|
|
2653
2786
|
};
|
|
2654
|
-
},
|
|
2655
|
-
}),
|
|
2656
|
-
var
|
|
2657
|
-
const m = T(
|
|
2787
|
+
}, uc = (() => {
|
|
2788
|
+
}), dc = (e, t, n, o, r, s, i, c, l, g = uc) => {
|
|
2789
|
+
var O;
|
|
2790
|
+
const m = T(xe), h = T(ne), d = T(me), u = T(Rr), a = T(It), v = T(_e), p = h.getUnit(o), S = te((k, I) => {
|
|
2658
2791
|
var x, R, w;
|
|
2659
|
-
return (w = (R = (x = h.getUnit(k)) == null ? void 0 : x.getSheetBySheetId(
|
|
2660
|
-
}), C = ie(() =>
|
|
2661
|
-
var B, ce, ae, he, K, J,
|
|
2662
|
-
const x =
|
|
2792
|
+
return (w = (R = (x = h.getUnit(k)) == null ? void 0 : x.getSheetBySheetId(I)) == null ? void 0 : R.getName()) != null ? w : "";
|
|
2793
|
+
}), C = ie(() => S(o, r), [S, r, o]), _ = Se(p == null ? void 0 : p.activeSheet$), E = tt({ activeSheet: _, sheetName: C }), f = Se(ie(() => h.getCurrentTypeOfUnit$(H.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(jt), F = T(Kt), N = te((k, I) => {
|
|
2794
|
+
var B, ce, ae, he, K, J, nt, rt, yt, Re;
|
|
2795
|
+
const x = lc({ editor: l, lexerTreeBuilder: v });
|
|
2663
2796
|
if (!x) return;
|
|
2664
2797
|
const { nodeIndex: R, updatingRefIndex: w, sequenceNodes: D, offset: U } = x;
|
|
2665
|
-
if (n.current ===
|
|
2798
|
+
if (n.current === Te.NEED_ADD)
|
|
2666
2799
|
if (U !== 0) {
|
|
2667
2800
|
if (R === -1 && D.length)
|
|
2668
2801
|
return;
|
|
2669
2802
|
const Y = k[k.length - 1], X = D.splice(R + 1), Ie = (B = Y.sheetId) != null ? B : r, fe = {
|
|
2670
2803
|
range: Y,
|
|
2671
2804
|
unitId: (ce = Y.unitId) != null ? ce : f.getUnitId(),
|
|
2672
|
-
sheetName:
|
|
2673
|
-
}, ee = Ie !== r, le = (f == null ? void 0 : f.getUnitId()) !== o,
|
|
2674
|
-
D.push({ token:
|
|
2675
|
-
const
|
|
2676
|
-
g(
|
|
2805
|
+
sheetName: S((ae = Y.unitId) != null ? ae : f.getUnitId(), Ie)
|
|
2806
|
+
}, ee = Ie !== r, le = (f == null ? void 0 : f.getUnitId()) !== o, Ee = kt([fe], i && (ee || le), C, le);
|
|
2807
|
+
D.push({ token: Ee[0], nodeType: Q.REFERENCE });
|
|
2808
|
+
const $e = [...D, ...X], Me = sn($e);
|
|
2809
|
+
g(Me, ac(D), I);
|
|
2677
2810
|
} else {
|
|
2678
2811
|
const Y = k[k.length - 1], X = (he = Y.sheetId) != null ? he : r, Ie = {
|
|
2679
2812
|
range: Y,
|
|
2680
2813
|
unitId: (K = Y.unitId) != null ? K : f.getUnitId(),
|
|
2681
|
-
sheetName:
|
|
2682
|
-
}, fe = X !== r, ee = (f == null ? void 0 : f.getUnitId()) !== o, le =
|
|
2814
|
+
sheetName: S((J = Y.unitId) != null ? J : f.getUnitId(), X)
|
|
2815
|
+
}, fe = X !== r, ee = (f == null ? void 0 : f.getUnitId()) !== o, le = kt([Ie], i && (fe || ee), C, ee);
|
|
2683
2816
|
D.unshift({ token: le[0], nodeType: Q.REFERENCE });
|
|
2684
|
-
const
|
|
2685
|
-
g(
|
|
2817
|
+
const Ee = sn(D);
|
|
2818
|
+
g(Ee, le[0].length, I);
|
|
2686
2819
|
}
|
|
2687
|
-
else if (n.current ===
|
|
2820
|
+
else if (n.current === Te.EDIT_OTHER_SHEET_REFERENCE || n.current === Te.EDIT_OTHER_WORKBOOK_REFERENCE) {
|
|
2688
2821
|
const Y = k.pop();
|
|
2689
2822
|
if (!Y) return;
|
|
2690
2823
|
const X = D[R];
|
|
2691
2824
|
if (typeof X == "object" && X.nodeType === Q.REFERENCE) {
|
|
2692
2825
|
const Ie = X.token;
|
|
2693
|
-
(f == null ? void 0 : f.getUnitId()) !== o ? X.token =
|
|
2826
|
+
(f == null ? void 0 : f.getUnitId()) !== o ? X.token = Vo((nt = f == null ? void 0 : f.getUnitId()) != null ? nt : "", C, Y) : X.token = C === (_ == null ? void 0 : _.getName()) ? Ce(Y) : Ct(_.getName(), Y);
|
|
2694
2827
|
const ee = U + (X.token.length - Ie.length);
|
|
2695
|
-
g(
|
|
2828
|
+
g(Wo(D), ee, I);
|
|
2696
2829
|
}
|
|
2697
2830
|
} else {
|
|
2698
2831
|
const Y = [...k];
|
|
@@ -2702,22 +2835,22 @@ const cc = (e, t, n, o) => {
|
|
|
2702
2835
|
}
|
|
2703
2836
|
let X = 0;
|
|
2704
2837
|
const Ie = D.map((G) => {
|
|
2705
|
-
var ge,
|
|
2838
|
+
var ge, ot, Pe, Ue;
|
|
2706
2839
|
if (typeof G == "string")
|
|
2707
2840
|
return G;
|
|
2708
2841
|
if (G.nodeType === Q.REFERENCE) {
|
|
2709
|
-
const
|
|
2710
|
-
if (
|
|
2842
|
+
const Ve = ht(G.token);
|
|
2843
|
+
if (Ve.sheetName || (Ve.sheetName = C), (Ve.unitId || o) !== (f == null ? void 0 : f.getUnitId()) || i && ((ge = E.current.activeSheet) == null ? void 0 : ge.getName()) !== Ve.sheetName)
|
|
2711
2844
|
return G.token;
|
|
2712
2845
|
const oe = Y[X];
|
|
2713
2846
|
if (X++, !oe)
|
|
2714
2847
|
return "";
|
|
2715
|
-
const
|
|
2848
|
+
const be = (ot = oe.sheetId) != null ? ot : r, Tt = {
|
|
2716
2849
|
range: oe,
|
|
2717
|
-
unitId: (
|
|
2718
|
-
sheetName:
|
|
2850
|
+
unitId: (Pe = oe.unitId) != null ? Pe : f.getUnitId(),
|
|
2851
|
+
sheetName: S((Ue = oe.unitId) != null ? Ue : f.getUnitId(), be)
|
|
2719
2852
|
}, Nt = (f == null ? void 0 : f.getUnitId()) !== o;
|
|
2720
|
-
return
|
|
2853
|
+
return kt([Tt], i && (be !== r || Nt), C, Nt)[0];
|
|
2721
2854
|
}
|
|
2722
2855
|
return G.token;
|
|
2723
2856
|
});
|
|
@@ -2727,76 +2860,76 @@ const cc = (e, t, n, o) => {
|
|
|
2727
2860
|
});
|
|
2728
2861
|
const le = [];
|
|
2729
2862
|
for (let G = X; G <= k.length - 1; G++) {
|
|
2730
|
-
const ge = k[G],
|
|
2863
|
+
const ge = k[G], ot = (rt = ge.sheetId) != null ? rt : r, Pe = {
|
|
2731
2864
|
range: ge,
|
|
2732
|
-
unitId: (
|
|
2733
|
-
sheetName:
|
|
2734
|
-
},
|
|
2865
|
+
unitId: (yt = ge.unitId) != null ? yt : f.getUnitId(),
|
|
2866
|
+
sheetName: S((Re = ge.unitId) != null ? Re : f.getUnitId(), ot)
|
|
2867
|
+
}, Ue = (f == null ? void 0 : f.getUnitId()) !== o, oe = kt([Pe], i && (ot !== r || Ue), C, Ue);
|
|
2735
2868
|
le.push(oe[0]);
|
|
2736
2869
|
}
|
|
2737
|
-
const
|
|
2738
|
-
g(
|
|
2870
|
+
const Ee = D[D.length - 1], $e = Ee && (typeof Ee == "string" ? !1 : Ee.nodeType === Q.REFERENCE), Me = `${fe}${le.length && $e ? "," : ""}${le.join(",")}`;
|
|
2871
|
+
g(Me, !le.length && ee ? ee : Me.length, I);
|
|
2739
2872
|
}
|
|
2740
2873
|
});
|
|
2741
2874
|
$(() => {
|
|
2742
2875
|
if (y && e) {
|
|
2743
2876
|
let k = !0;
|
|
2744
|
-
const
|
|
2877
|
+
const I = (R, w) => {
|
|
2745
2878
|
if (k) {
|
|
2746
2879
|
k = !1;
|
|
2747
2880
|
return;
|
|
2748
2881
|
}
|
|
2749
|
-
|
|
2882
|
+
N(R.map((D) => D.rangeWithCoord), w);
|
|
2750
2883
|
}, x = new qe();
|
|
2751
2884
|
return x.add(y.selectionMoving$.subscribe((R) => {
|
|
2752
|
-
|
|
2885
|
+
I(R, !1);
|
|
2753
2886
|
})), x.add(y.selectionMoveEnd$.subscribe((R) => {
|
|
2754
|
-
|
|
2887
|
+
I(R, !0);
|
|
2755
2888
|
})), () => {
|
|
2756
2889
|
x.dispose();
|
|
2757
2890
|
};
|
|
2758
2891
|
}
|
|
2759
|
-
}, [e,
|
|
2892
|
+
}, [e, N, y]), $(() => {
|
|
2760
2893
|
if (t && y && l) {
|
|
2761
|
-
const k = new qe(),
|
|
2894
|
+
const k = new qe(), I = () => {
|
|
2762
2895
|
k.dispose(), y.getSelectionControls().forEach((w, D) => {
|
|
2763
2896
|
k.add(
|
|
2764
2897
|
w.selectionScaling$.subscribe((U) => {
|
|
2765
2898
|
const B = y.getSelectionDataWithStyle().map((ae) => ae.rangeWithCoord), ce = B[D];
|
|
2766
|
-
U.sheetId = ce.sheetId, U.unitId = ce.unitId, B[D] = U,
|
|
2899
|
+
U.sheetId = ce.sheetId, U.unitId = ce.unitId, B[D] = U, N(B, !1);
|
|
2767
2900
|
})
|
|
2768
2901
|
), k.add(
|
|
2769
2902
|
w.selectionMoving$.subscribe((U) => {
|
|
2770
2903
|
const B = y.getSelectionDataWithStyle().map((ae) => ae.rangeWithCoord), ce = B[D];
|
|
2771
|
-
U.sheetId = ce.sheetId, U.unitId = ce.unitId, B[D] = U,
|
|
2904
|
+
U.sheetId = ce.sheetId, U.unitId = ce.unitId, B[D] = U, N(B, !0);
|
|
2772
2905
|
})
|
|
2773
2906
|
);
|
|
2774
2907
|
});
|
|
2775
|
-
}, x =
|
|
2908
|
+
}, x = Go(
|
|
2776
2909
|
l.input$,
|
|
2777
2910
|
F.selectionSet$,
|
|
2778
2911
|
y.selectionMoveEnd$
|
|
2779
2912
|
).pipe(
|
|
2780
|
-
|
|
2913
|
+
Ts(50)
|
|
2781
2914
|
).subscribe(() => {
|
|
2782
|
-
|
|
2915
|
+
I();
|
|
2783
2916
|
});
|
|
2784
2917
|
return () => {
|
|
2785
2918
|
x.unsubscribe(), k.dispose();
|
|
2786
2919
|
};
|
|
2787
2920
|
}
|
|
2788
|
-
}, [l, t,
|
|
2921
|
+
}, [l, t, N, y, F.selectionSet$]), y == null || y.getSelectionDataWithStyle(), $(() => {
|
|
2789
2922
|
if (c) {
|
|
2790
|
-
const k = d.onCommandExecuted((
|
|
2923
|
+
const k = d.onCommandExecuted((I) => {
|
|
2791
2924
|
var R;
|
|
2792
|
-
if (
|
|
2925
|
+
if (I.id !== gn.id)
|
|
2793
2926
|
return;
|
|
2794
|
-
const x =
|
|
2927
|
+
const x = I.params;
|
|
2795
2928
|
if (x.extra === "formula-editor" && x.selections.length) {
|
|
2796
2929
|
const w = x.selections[x.selections.length - 1];
|
|
2797
2930
|
if (w) {
|
|
2798
|
-
const D = n.current ===
|
|
2799
|
-
D ? U.push(w.range) : U[U.length - 1] = w.range,
|
|
2931
|
+
const D = n.current === Te.NEED_ADD, U = ((R = y == null ? void 0 : y.getSelectionDataWithStyle()) != null ? R : []).map((B) => B.rangeWithCoord);
|
|
2932
|
+
D ? U.push(w.range) : U[U.length - 1] = w.range, N(U, !0);
|
|
2800
2933
|
}
|
|
2801
2934
|
}
|
|
2802
2935
|
});
|
|
@@ -2804,11 +2937,11 @@ const cc = (e, t, n, o) => {
|
|
|
2804
2937
|
k.dispose();
|
|
2805
2938
|
};
|
|
2806
2939
|
}
|
|
2807
|
-
}, [d, l, n,
|
|
2940
|
+
}, [d, l, n, v, c, N, y]), $(() => {
|
|
2808
2941
|
if (!l)
|
|
2809
2942
|
return;
|
|
2810
|
-
const k = u.textSelection$.subscribe((
|
|
2811
|
-
|
|
2943
|
+
const k = u.textSelection$.subscribe((I) => {
|
|
2944
|
+
I.unitId === l.getEditorId() && Ur({
|
|
2812
2945
|
unitId: o,
|
|
2813
2946
|
subUnitId: r,
|
|
2814
2947
|
refSelections: s.current,
|
|
@@ -2823,21 +2956,21 @@ const cc = (e, t, n, o) => {
|
|
|
2823
2956
|
});
|
|
2824
2957
|
return () => k.unsubscribe();
|
|
2825
2958
|
}, [u.textSelection$, l, s, y, F, A, r, a, o, h]);
|
|
2826
|
-
},
|
|
2827
|
-
const i = T(
|
|
2959
|
+
}, hc = (e, t, n, o, r, s) => {
|
|
2960
|
+
const i = T(me), c = T(Ye), g = T(xe).getRenderById(t), m = T(ne), h = g == null ? void 0 : g.with(De);
|
|
2828
2961
|
$(() => {
|
|
2829
2962
|
if (e && h)
|
|
2830
2963
|
if (n) {
|
|
2831
2964
|
const d = () => {
|
|
2832
|
-
const
|
|
2833
|
-
for (let p = 1; p <=
|
|
2965
|
+
const v = h.getSelectionControls().length;
|
|
2966
|
+
for (let p = 1; p <= v; p++)
|
|
2834
2967
|
h.clearLastSelection();
|
|
2835
2968
|
return setTimeout(() => {
|
|
2836
2969
|
s();
|
|
2837
2970
|
}, 30);
|
|
2838
|
-
}, u = i.onCommandExecuted((
|
|
2839
|
-
|
|
2840
|
-
}), a = m.getCurrentTypeOfUnit$(H.UNIVER_SHEET).subscribe((
|
|
2971
|
+
}, u = i.onCommandExecuted((v) => {
|
|
2972
|
+
v.id === Bn.id && d();
|
|
2973
|
+
}), a = m.getCurrentTypeOfUnit$(H.UNIVER_SHEET).subscribe((v) => {
|
|
2841
2974
|
d();
|
|
2842
2975
|
});
|
|
2843
2976
|
return () => {
|
|
@@ -2845,9 +2978,9 @@ const cc = (e, t, n, o) => {
|
|
|
2845
2978
|
};
|
|
2846
2979
|
} else {
|
|
2847
2980
|
const d = i.beforeCommandExecuted((u) => {
|
|
2848
|
-
if (u.id ===
|
|
2981
|
+
if (u.id === Bn.id) {
|
|
2849
2982
|
o(!1), r(), s();
|
|
2850
|
-
const a = c.getEditor(
|
|
2983
|
+
const a = c.getEditor(an);
|
|
2851
2984
|
a == null || a.focus();
|
|
2852
2985
|
}
|
|
2853
2986
|
});
|
|
@@ -2856,8 +2989,8 @@ const cc = (e, t, n, o) => {
|
|
|
2856
2989
|
};
|
|
2857
2990
|
}
|
|
2858
2991
|
}, [e, h]);
|
|
2859
|
-
},
|
|
2860
|
-
const o = T(
|
|
2992
|
+
}, fc = (e, t, n) => {
|
|
2993
|
+
const o = T(_e), r = z(!0);
|
|
2861
2994
|
$(() => {
|
|
2862
2995
|
if (e) {
|
|
2863
2996
|
const s = setTimeout(() => {
|
|
@@ -2870,26 +3003,26 @@ const cc = (e, t, n, o) => {
|
|
|
2870
3003
|
}, [e]), $(() => {
|
|
2871
3004
|
if (!r.current && t) {
|
|
2872
3005
|
const s = o.checkIfAddBracket(n);
|
|
2873
|
-
t(s === 0 && n.startsWith(
|
|
3006
|
+
t(s === 0 && n.startsWith(dr.EQUALS), `${n}`);
|
|
2874
3007
|
}
|
|
2875
3008
|
}, [n, t]);
|
|
2876
|
-
},
|
|
2877
|
-
const o = T(
|
|
3009
|
+
}, gc = (e, t = [], n) => {
|
|
3010
|
+
const o = T(Yt), [r, s] = V([]), [i, c] = V(""), l = z(-1), g = tt({ nodes: t }), m = () => {
|
|
2878
3011
|
s([]), c(""), l.current = -1;
|
|
2879
3012
|
};
|
|
2880
3013
|
return $(() => {
|
|
2881
3014
|
if (n && e) {
|
|
2882
|
-
const d = n.input$.pipe(
|
|
3015
|
+
const d = n.input$.pipe(hn(300)).subscribe(() => {
|
|
2883
3016
|
const u = n.getSelectionRanges();
|
|
2884
3017
|
if (u.length === 1) {
|
|
2885
|
-
const a = g.current.nodes,
|
|
2886
|
-
if (
|
|
2887
|
-
const p =
|
|
3018
|
+
const a = g.current.nodes, v = u[0];
|
|
3019
|
+
if (v.collapsed) {
|
|
3020
|
+
const p = _n(a, v.startOffset - 1, !1);
|
|
2888
3021
|
l.current = p;
|
|
2889
|
-
const
|
|
2890
|
-
if (
|
|
3022
|
+
const S = a[p];
|
|
3023
|
+
if (S && typeof S != "string" && S.nodeType === Q.FUNCTION) {
|
|
2891
3024
|
l.current = p;
|
|
2892
|
-
const C =
|
|
3025
|
+
const C = S.token, _ = o.getSearchListByNameFirstLetter(C);
|
|
2893
3026
|
s(_), c(C);
|
|
2894
3027
|
return;
|
|
2895
3028
|
}
|
|
@@ -2909,41 +3042,41 @@ const cc = (e, t, n, o) => {
|
|
|
2909
3042
|
handlerFormulaReplace: (d, u) => {
|
|
2910
3043
|
const a = [...g.current.nodes];
|
|
2911
3044
|
if (l.current !== -1) {
|
|
2912
|
-
const
|
|
2913
|
-
let
|
|
2914
|
-
return a.push(d),
|
|
3045
|
+
const v = a.splice(l.current + 1), p = a.pop() || "";
|
|
3046
|
+
let S = (typeof p == "string" ? p.length : p.token.length) - d.length;
|
|
3047
|
+
return a.push(d), v[0] !== je.OPEN_BRACKET && u !== ur.DefinedName && (a.push(je.OPEN_BRACKET), S--), { text: sn([...a, ...v]), offset: S };
|
|
2915
3048
|
}
|
|
2916
3049
|
},
|
|
2917
3050
|
reset: m
|
|
2918
3051
|
};
|
|
2919
|
-
},
|
|
2920
|
-
},
|
|
2921
|
-
function
|
|
2922
|
-
const { isFocus: n, sequenceNodes: o, onSelect: r, editor: s, onClose: i =
|
|
2923
|
-
const k = d(
|
|
3052
|
+
}, mc = () => {
|
|
3053
|
+
}, pc = Le(Sc);
|
|
3054
|
+
function Sc(e, t) {
|
|
3055
|
+
const { isFocus: n, sequenceNodes: o, onSelect: r, editor: s, onClose: i = mc } = e, c = s.getEditorId(), l = T(Gt), g = T(me), { searchList: m, searchText: h, handlerFormulaReplace: d, reset: u } = gc(n, o, s), a = ie(() => !!m.length, [m]), v = z(void 0), [p, S] = V(0), C = z(!1), [_] = Pr(c, a, [h, m]), E = tt({ searchList: m, active: p }), f = (N, O) => {
|
|
3056
|
+
const k = d(N, O);
|
|
2924
3057
|
k && (u(), r(k));
|
|
2925
3058
|
};
|
|
2926
|
-
function b(
|
|
2927
|
-
C.current &&
|
|
3059
|
+
function b(N) {
|
|
3060
|
+
C.current && S(N);
|
|
2928
3061
|
}
|
|
2929
3062
|
function y() {
|
|
2930
|
-
C.current &&
|
|
3063
|
+
C.current && S(-1);
|
|
2931
3064
|
}
|
|
2932
3065
|
$(() => {
|
|
2933
3066
|
if (!m.length)
|
|
2934
3067
|
return;
|
|
2935
|
-
const
|
|
2936
|
-
const { searchList: x, active: R } =
|
|
2937
|
-
switch (
|
|
3068
|
+
const N = `sheet.formula-embedding-editor.search_function.${c}`, O = new qe(), k = (I) => {
|
|
3069
|
+
const { searchList: x, active: R } = E.current;
|
|
3070
|
+
switch (I) {
|
|
2938
3071
|
case L.ARROW_UP: {
|
|
2939
|
-
|
|
3072
|
+
S((w) => {
|
|
2940
3073
|
const D = Math.max(0, w - 1);
|
|
2941
3074
|
return A(D), D;
|
|
2942
3075
|
});
|
|
2943
3076
|
break;
|
|
2944
3077
|
}
|
|
2945
3078
|
case L.ARROW_DOWN: {
|
|
2946
|
-
|
|
3079
|
+
S((w) => {
|
|
2947
3080
|
const D = Math.min(x.length - 1, w + 1);
|
|
2948
3081
|
return A(D), D;
|
|
2949
3082
|
});
|
|
@@ -2961,92 +3094,92 @@ function Cc(e, t) {
|
|
|
2961
3094
|
}
|
|
2962
3095
|
}
|
|
2963
3096
|
};
|
|
2964
|
-
return
|
|
2965
|
-
id:
|
|
3097
|
+
return O.add(g.registerCommand({
|
|
3098
|
+
id: N,
|
|
2966
3099
|
type: Ne.OPERATION,
|
|
2967
|
-
handler(
|
|
3100
|
+
handler(I, x) {
|
|
2968
3101
|
const { keyCode: R } = x;
|
|
2969
3102
|
k(R);
|
|
2970
3103
|
}
|
|
2971
|
-
})), [L.ARROW_UP, L.ARROW_DOWN, L.ENTER, L.ESC, L.TAB].map((
|
|
2972
|
-
id:
|
|
2973
|
-
binding:
|
|
3104
|
+
})), [L.ARROW_UP, L.ARROW_DOWN, L.ENTER, L.ESC, L.TAB].map((I) => ({
|
|
3105
|
+
id: N,
|
|
3106
|
+
binding: I,
|
|
2974
3107
|
preconditions: () => !0,
|
|
2975
3108
|
priority: 1e3,
|
|
2976
3109
|
staticParameters: {
|
|
2977
|
-
eventType:
|
|
2978
|
-
keyCode:
|
|
3110
|
+
eventType: Oe.Keyboard,
|
|
3111
|
+
keyCode: I
|
|
2979
3112
|
}
|
|
2980
|
-
})).forEach((
|
|
2981
|
-
|
|
3113
|
+
})).forEach((I) => {
|
|
3114
|
+
O.add(l.registerShortcut(I));
|
|
2982
3115
|
}), () => {
|
|
2983
|
-
|
|
3116
|
+
O.dispose();
|
|
2984
3117
|
};
|
|
2985
3118
|
}, [m]);
|
|
2986
|
-
function A(
|
|
2987
|
-
const
|
|
2988
|
-
if (!
|
|
2989
|
-
const k =
|
|
3119
|
+
function A(N) {
|
|
3120
|
+
const O = v.current;
|
|
3121
|
+
if (!O) return;
|
|
3122
|
+
const k = O.children[N];
|
|
2990
3123
|
if (!k) return;
|
|
2991
|
-
const x =
|
|
3124
|
+
const x = O.getBoundingClientRect().top, R = O.offsetHeight, w = k.getBoundingClientRect(), D = w.top, U = w.height;
|
|
2992
3125
|
if (D >= 0 && D > x && D - x + U <= R)
|
|
2993
3126
|
return;
|
|
2994
3127
|
const B = k.offsetTop - (R - U) / 2;
|
|
2995
|
-
|
|
3128
|
+
O.scrollTo({
|
|
2996
3129
|
top: B,
|
|
2997
3130
|
behavior: "smooth"
|
|
2998
3131
|
});
|
|
2999
3132
|
}
|
|
3000
3133
|
const F = ie(() => {
|
|
3001
|
-
let
|
|
3134
|
+
let N = "";
|
|
3002
3135
|
return () => {
|
|
3003
|
-
clearTimeout(
|
|
3136
|
+
clearTimeout(N), C.current = !0, N = setTimeout(() => {
|
|
3004
3137
|
C.current = !1;
|
|
3005
3138
|
}, 300);
|
|
3006
3139
|
};
|
|
3007
3140
|
}, []);
|
|
3008
|
-
return m.length > 0 && a && /* @__PURE__ */ M(
|
|
3141
|
+
return m.length > 0 && a && /* @__PURE__ */ M(nn, { portal: !0, anchorRect$: _, direction: "vertical", children: /* @__PURE__ */ M(
|
|
3009
3142
|
"ul",
|
|
3010
3143
|
{
|
|
3011
|
-
ref: (
|
|
3012
|
-
|
|
3144
|
+
ref: (N) => {
|
|
3145
|
+
v.current = N, t && (t.current = N);
|
|
3013
3146
|
},
|
|
3014
3147
|
"data-u-comp": "sheets-formula-editor",
|
|
3015
|
-
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", Sn,
|
|
3016
|
-
children: m.map((
|
|
3148
|
+
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", Sn, lt),
|
|
3149
|
+
children: m.map((N, O) => /* @__PURE__ */ W(
|
|
3017
3150
|
"li",
|
|
3018
3151
|
{
|
|
3019
3152
|
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", {
|
|
3020
|
-
"univer-bg-gray-200 dark:!univer-bg-gray-600": p ===
|
|
3153
|
+
"univer-bg-gray-200 dark:!univer-bg-gray-600": p === O
|
|
3021
3154
|
}),
|
|
3022
|
-
onMouseEnter: () => b(
|
|
3155
|
+
onMouseEnter: () => b(O),
|
|
3023
3156
|
onMouseLeave: y,
|
|
3024
3157
|
onMouseMove: F,
|
|
3025
3158
|
onClick: () => {
|
|
3026
|
-
f(
|
|
3159
|
+
f(N.name, N.functionType), s && s.focus();
|
|
3027
3160
|
},
|
|
3028
3161
|
children: [
|
|
3029
|
-
/* @__PURE__ */ W("span", { className: "univer-text-xs", children: [
|
|
3030
|
-
/* @__PURE__ */ M("span", { className: "univer-text-red-500", children:
|
|
3031
|
-
/* @__PURE__ */ M("span", { children:
|
|
3162
|
+
/* @__PURE__ */ W("span", { className: "univer-block univer-overflow-x-hidden univer-text-ellipsis univer-text-xs", children: [
|
|
3163
|
+
/* @__PURE__ */ M("span", { className: "univer-text-red-500", children: N.name.substring(0, h.length) }),
|
|
3164
|
+
/* @__PURE__ */ M("span", { children: N.name.slice(h.length) })
|
|
3032
3165
|
] }),
|
|
3033
3166
|
/* @__PURE__ */ M(
|
|
3034
3167
|
"span",
|
|
3035
3168
|
{
|
|
3036
3169
|
className: "univer-block univer-text-xs univer-text-gray-400",
|
|
3037
|
-
children:
|
|
3170
|
+
children: N.desc
|
|
3038
3171
|
}
|
|
3039
3172
|
)
|
|
3040
3173
|
]
|
|
3041
3174
|
},
|
|
3042
|
-
|
|
3175
|
+
N.name
|
|
3043
3176
|
))
|
|
3044
3177
|
}
|
|
3045
3178
|
) });
|
|
3046
3179
|
}
|
|
3047
|
-
const
|
|
3048
|
-
},
|
|
3049
|
-
var bn, yn, Tn
|
|
3180
|
+
const vc = (e) => e.startsWith(dr.EQUALS) ? e.slice(1) : "", Qn = () => {
|
|
3181
|
+
}, Cc = Le((e, t) => {
|
|
3182
|
+
var En, bn, yn, Tn;
|
|
3050
3183
|
const {
|
|
3051
3184
|
errorText: n,
|
|
3052
3185
|
initValue: o,
|
|
@@ -3054,52 +3187,52 @@ const _c = (e) => e.startsWith(hr.EQUALS) ? e.slice(1) : "", Jn = () => {
|
|
|
3054
3187
|
subUnitId: s,
|
|
3055
3188
|
isFocus: i = !0,
|
|
3056
3189
|
isSupportAcrossSheet: c = !1,
|
|
3057
|
-
onFocus: l =
|
|
3058
|
-
onBlur: g =
|
|
3190
|
+
onFocus: l = Qn,
|
|
3191
|
+
onBlur: g = Qn,
|
|
3059
3192
|
onChange: m,
|
|
3060
3193
|
onVerify: h,
|
|
3061
3194
|
className: d,
|
|
3062
3195
|
editorId: u,
|
|
3063
3196
|
moveCursor: a = !0,
|
|
3064
|
-
onFormulaSelectingChange:
|
|
3197
|
+
onFormulaSelectingChange: v,
|
|
3065
3198
|
keyboardEventConfig: p,
|
|
3066
|
-
onMoveInEditor:
|
|
3199
|
+
onMoveInEditor: S,
|
|
3067
3200
|
resetSelectionOnBlur: C = !0,
|
|
3068
3201
|
autoScrollbar: _ = !0,
|
|
3069
|
-
isSingle:
|
|
3202
|
+
isSingle: E = !0,
|
|
3070
3203
|
disableSelectionOnClick: f = !1,
|
|
3071
3204
|
autofocus: b = !0,
|
|
3072
3205
|
disableContextMenu: y,
|
|
3073
3206
|
style: A
|
|
3074
|
-
} = e, F = T(
|
|
3075
|
-
|
|
3076
|
-
isClickOutSide: (Z) =>
|
|
3207
|
+
} = e, F = T(Ye), N = z(null), O = te(m);
|
|
3208
|
+
_s(t, () => ({
|
|
3209
|
+
isClickOutSide: (Z) => N.current ? !N.current.contains(Z.target) : !1
|
|
3077
3210
|
}));
|
|
3078
|
-
const k = te(
|
|
3211
|
+
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 : so(`${xo}-${qt(4)}`), []), ce = ie(() => n !== void 0, [n]), ae = T(ne), he = ae.getUnit(B);
|
|
3079
3212
|
Se(he == null ? void 0 : he.change$);
|
|
3080
|
-
const K =
|
|
3213
|
+
const K = ec(), J = io.transform.getPlainText((bn = (En = he == null ? void 0 : he.getBody()) == null ? void 0 : En.dataStream) != null ? bn : ""), nt = tt(J), rt = ie(() => vc(J), [J]), yt = ie(() => K(rt), [rt, K]), { isSelecting: Re, isSelectingRef: Y } = Ji({ unitId: r, subUnitId: s, editorId: B, isFocus: w, disableOnClick: f }), X = z(""), fe = T(xe).getRenderById(B), ee = fe == null ? void 0 : fe.with(mr), le = ee == null ? void 0 : ee.isFocusing, Ee = ie(() => ae.getCurrentTypeOfUnit$(H.UNIVER_DOC), [ae]), $e = Se(Ee), Me = ($e == null ? void 0 : $e.getUnitId()) === B, G = z([]), ge = Re, Pe = (Tn = (yn = T(or).getConfig(yr)) == null ? void 0 : yn.functionScreenTips) != null ? Tn : !0;
|
|
3081
3214
|
Ss(() => {
|
|
3082
|
-
|
|
3083
|
-
}, [J,
|
|
3084
|
-
const
|
|
3215
|
+
O(J);
|
|
3216
|
+
}, [J, O]);
|
|
3217
|
+
const Ue = Vr("="), Ve = nc(r, s), oe = te((Z, se = !0, we, ye) => {
|
|
3085
3218
|
if (!x.current) return;
|
|
3086
3219
|
X.current = Z;
|
|
3087
|
-
const
|
|
3220
|
+
const Ot = Z[0] === "=" ? Z.slice(1) : "", ke = K(Ot), qr = ke.reduce((We, Mt) => typeof Mt == "object" ? `${We}${Mt.token}` : `${We}${Mt}`, ""), xt = Ue(
|
|
3088
3221
|
x.current,
|
|
3089
|
-
qr ===
|
|
3222
|
+
qr === Ot ? ke : [],
|
|
3090
3223
|
se,
|
|
3091
|
-
|
|
3224
|
+
ye
|
|
3092
3225
|
);
|
|
3093
|
-
if (G.current =
|
|
3094
|
-
const
|
|
3095
|
-
if ((
|
|
3226
|
+
if (G.current = xt, we) {
|
|
3227
|
+
const We = ye != null ? ye : R == null ? void 0 : R.getSelectionRanges();
|
|
3228
|
+
if ((We == null ? void 0 : We.length) !== 1)
|
|
3096
3229
|
return;
|
|
3097
|
-
const
|
|
3230
|
+
const jr = We[0].startOffset - 1, Kr = _n(ke, jr, !1), Nn = $r(ke, Kr);
|
|
3098
3231
|
if (Nn >= 0) {
|
|
3099
|
-
const
|
|
3100
|
-
|
|
3232
|
+
const On = xt.splice(Nn, 1)[0];
|
|
3233
|
+
On && xt.push(On);
|
|
3101
3234
|
}
|
|
3102
|
-
|
|
3235
|
+
Ve(w ? xt : [], x.current);
|
|
3103
3236
|
}
|
|
3104
3237
|
});
|
|
3105
3238
|
$(() => {
|
|
@@ -3109,12 +3242,12 @@ const _c = (e) => e.startsWith(hr.EQUALS) ? e.slice(1) : "", Jn = () => {
|
|
|
3109
3242
|
if (X.current === J) return;
|
|
3110
3243
|
oe(J, !1, !0);
|
|
3111
3244
|
}
|
|
3112
|
-
}, [J]),
|
|
3113
|
-
const
|
|
3245
|
+
}, [J]), fc(w, h, J);
|
|
3246
|
+
const be = Xi(R), Tt = cc(w, r, s);
|
|
3114
3247
|
$(() => {
|
|
3115
3248
|
var Z;
|
|
3116
|
-
k(
|
|
3117
|
-
}, [k,
|
|
3249
|
+
k(Re, (Z = ee == null ? void 0 : ee.isFocusing) != null ? Z : !0);
|
|
3250
|
+
}, [k, Re]), Xo(w, p, R), Lt(() => {
|
|
3118
3251
|
let Z;
|
|
3119
3252
|
if (U.current) {
|
|
3120
3253
|
Z = F.register({
|
|
@@ -3139,22 +3272,22 @@ const _c = (e) => e.startsWith(hr.EQUALS) ? e.slice(1) : "", Jn = () => {
|
|
|
3139
3272
|
return () => {
|
|
3140
3273
|
Z == null || Z.dispose();
|
|
3141
3274
|
};
|
|
3142
|
-
}, []),
|
|
3143
|
-
i ? (D(i),
|
|
3144
|
-
}, [i, R,
|
|
3145
|
-
const { checkScrollBar: Nt } =
|
|
3146
|
-
|
|
3147
|
-
const
|
|
3275
|
+
}, []), Lt(() => {
|
|
3276
|
+
i ? (D(i), be()) : (C && (R == null || R.blur(), Tt()), D(i));
|
|
3277
|
+
}, [i, R, be, Tt, C]);
|
|
3278
|
+
const { checkScrollBar: Nt } = Qo(R, E, _);
|
|
3279
|
+
ic(w, !!(Re && Me), r, B, y), sc(!!(w && le && a), ge, R, S);
|
|
3280
|
+
const Rn = te((Z, se, we) => {
|
|
3148
3281
|
if (!le)
|
|
3149
3282
|
return;
|
|
3150
|
-
const
|
|
3151
|
-
oe(`=${Z}`, !0,
|
|
3152
|
-
const
|
|
3153
|
-
|
|
3283
|
+
const ye = se !== -1 ? [{ startOffset: se + 1, endOffset: se + 1, collapsed: !0 }] : void 0;
|
|
3284
|
+
oe(`=${Z}`, !0, we, ye), we && (be(), se !== -1 && setTimeout(() => {
|
|
3285
|
+
const Ot = { startOffset: se + 1, endOffset: se + 1 }, ke = R == null ? void 0 : R.render.with(Jo);
|
|
3286
|
+
ke == null || ke.scrollToRange({ ...Ot, collapsed: !0 });
|
|
3154
3287
|
}, 50), Nt());
|
|
3155
3288
|
});
|
|
3156
|
-
|
|
3157
|
-
w && !!(
|
|
3289
|
+
dc(
|
|
3290
|
+
w && !!(Re && Me),
|
|
3158
3291
|
w,
|
|
3159
3292
|
Y,
|
|
3160
3293
|
r,
|
|
@@ -3163,32 +3296,32 @@ const _c = (e) => e.startsWith(hr.EQUALS) ? e.slice(1) : "", Jn = () => {
|
|
|
3163
3296
|
c,
|
|
3164
3297
|
!!ge,
|
|
3165
3298
|
R,
|
|
3166
|
-
|
|
3167
|
-
),
|
|
3168
|
-
oe(
|
|
3299
|
+
Rn
|
|
3300
|
+
), hc(w && !!(Re && Me), r, c, D, g, () => {
|
|
3301
|
+
oe(nt.current, !1, !0);
|
|
3169
3302
|
});
|
|
3170
3303
|
const In = (Z) => {
|
|
3171
3304
|
if (Z) {
|
|
3172
3305
|
const se = R == null ? void 0 : R.getSelectionRanges();
|
|
3173
3306
|
if (se && se.length === 1) {
|
|
3174
|
-
const
|
|
3175
|
-
if (
|
|
3176
|
-
const
|
|
3307
|
+
const we = se[0];
|
|
3308
|
+
if (we.collapsed) {
|
|
3309
|
+
const ye = Z.offset;
|
|
3177
3310
|
setTimeout(() => {
|
|
3178
|
-
R == null || R.setSelectionRanges([{ startOffset:
|
|
3311
|
+
R == null || R.setSelectionRanges([{ startOffset: we.startOffset - ye, endOffset: we.endOffset - ye }]);
|
|
3179
3312
|
}, 30);
|
|
3180
3313
|
}
|
|
3181
3314
|
}
|
|
3182
|
-
|
|
3315
|
+
be(), oe(`=${Z.text}`);
|
|
3183
3316
|
}
|
|
3184
|
-
},
|
|
3185
|
-
D(!0), l(),
|
|
3317
|
+
}, Br = () => {
|
|
3318
|
+
D(!0), l(), be();
|
|
3186
3319
|
};
|
|
3187
3320
|
return /* @__PURE__ */ W("div", { className: d, children: [
|
|
3188
3321
|
/* @__PURE__ */ M(
|
|
3189
3322
|
"div",
|
|
3190
3323
|
{
|
|
3191
|
-
ref:
|
|
3324
|
+
ref: N,
|
|
3192
3325
|
className: re("univer-relative univer-box-border univer-flex univer-h-full univer-w-full univer-items-center univer-justify-around univer-gap-2 univer-rounded-none univer-p-0 univer-ring-1", {
|
|
3193
3326
|
"univer-ring-primary-500": w,
|
|
3194
3327
|
"univer-ring-red-500": ce
|
|
@@ -3198,35 +3331,35 @@ const _c = (e) => e.startsWith(hr.EQUALS) ? e.slice(1) : "", Jn = () => {
|
|
|
3198
3331
|
{
|
|
3199
3332
|
ref: U,
|
|
3200
3333
|
className: "univer-relative univer-h-full univer-w-full",
|
|
3201
|
-
onMouseUp:
|
|
3334
|
+
onMouseUp: Br
|
|
3202
3335
|
}
|
|
3203
3336
|
)
|
|
3204
3337
|
}
|
|
3205
3338
|
),
|
|
3206
3339
|
n !== void 0 && /* @__PURE__ */ M("div", { className: "univer-my-1 univer-text-xs univer-text-red-500", children: n }),
|
|
3207
|
-
|
|
3208
|
-
|
|
3340
|
+
Pe && R && rt !== "" && /* @__PURE__ */ M(
|
|
3341
|
+
zi,
|
|
3209
3342
|
{
|
|
3210
3343
|
editor: R,
|
|
3211
3344
|
isFocus: w,
|
|
3212
3345
|
formulaText: J,
|
|
3213
|
-
onClose: () =>
|
|
3346
|
+
onClose: () => be()
|
|
3214
3347
|
}
|
|
3215
3348
|
),
|
|
3216
|
-
|
|
3217
|
-
|
|
3349
|
+
Pe && !!R && /* @__PURE__ */ M(
|
|
3350
|
+
pc,
|
|
3218
3351
|
{
|
|
3219
3352
|
isFocus: w,
|
|
3220
|
-
sequenceNodes:
|
|
3353
|
+
sequenceNodes: yt,
|
|
3221
3354
|
onSelect: In,
|
|
3222
|
-
ref:
|
|
3355
|
+
ref: I,
|
|
3223
3356
|
editor: R
|
|
3224
3357
|
}
|
|
3225
3358
|
)
|
|
3226
3359
|
] });
|
|
3227
3360
|
});
|
|
3228
|
-
function
|
|
3229
|
-
const r = T(
|
|
3361
|
+
function _c(e, t, n, o) {
|
|
3362
|
+
const r = T(_e), s = Vr(""), i = Se(e == null ? void 0 : e.getDocumentDataModel().change$), [c, l] = V([]), g = T(Mo), m = z(""), h = T(ne);
|
|
3230
3363
|
return $(() => {
|
|
3231
3364
|
if (!e) return;
|
|
3232
3365
|
const d = e.getDocumentDataModel().getPlainText();
|
|
@@ -3236,7 +3369,7 @@ function Ec(e, t, n, o) {
|
|
|
3236
3369
|
const u = r.sequenceNodesBuilder(d);
|
|
3237
3370
|
l(u != null ? u : []);
|
|
3238
3371
|
}, [i, e, r]), $(() => {
|
|
3239
|
-
var a,
|
|
3372
|
+
var a, v;
|
|
3240
3373
|
if (!e) return;
|
|
3241
3374
|
if (!t) {
|
|
3242
3375
|
const p = e.getDocumentData();
|
|
@@ -3244,7 +3377,7 @@ function Ec(e, t, n, o) {
|
|
|
3244
3377
|
...p,
|
|
3245
3378
|
body: {
|
|
3246
3379
|
...p.body,
|
|
3247
|
-
dataStream: (
|
|
3380
|
+
dataStream: (v = (a = p.body) == null ? void 0 : a.dataStream) != null ? v : "",
|
|
3248
3381
|
textRuns: []
|
|
3249
3382
|
}
|
|
3250
3383
|
});
|
|
@@ -3252,14 +3385,14 @@ function Ec(e, t, n, o) {
|
|
|
3252
3385
|
}
|
|
3253
3386
|
const d = s(e, c, !1), u = new qe();
|
|
3254
3387
|
return d.forEach((p) => {
|
|
3255
|
-
const
|
|
3256
|
-
if (!
|
|
3388
|
+
const S = ht(p.token), C = h.getCurrentUnitForType(H.UNIVER_SHEET), _ = C == null ? void 0 : C.getActiveSheet();
|
|
3389
|
+
if (!S.sheetName && o !== (_ == null ? void 0 : _.getSheetId()) || S.sheetName && (_ == null ? void 0 : _.getName()) !== S.sheetName)
|
|
3257
3390
|
return;
|
|
3258
|
-
const
|
|
3259
|
-
range:
|
|
3391
|
+
const E = new un(p.themeColor).toRgb(), f = g.addShape({
|
|
3392
|
+
range: S.range,
|
|
3260
3393
|
style: {
|
|
3261
3394
|
stroke: p.themeColor,
|
|
3262
|
-
fill: `rgba(${
|
|
3395
|
+
fill: `rgba(${E.r}, ${E.g}, ${E.b}, 0.1)`,
|
|
3263
3396
|
strokeDash: 12
|
|
3264
3397
|
},
|
|
3265
3398
|
primary: null
|
|
@@ -3270,16 +3403,16 @@ function Ec(e, t, n, o) {
|
|
|
3270
3403
|
};
|
|
3271
3404
|
}, [e, t, s, g, c]), { sequenceNodes: c };
|
|
3272
3405
|
}
|
|
3273
|
-
function
|
|
3274
|
-
const t = T(
|
|
3406
|
+
function Rc(e) {
|
|
3407
|
+
const t = T(fn), { supportAcrossSheet: n = !1, keepSheetReference: o = !1, unitId: r, subUnitId: s, onChange: i } = e, l = T(ne).getUnit(r, H.UNIVER_SHEET), g = te(i), m = te((h, d) => {
|
|
3275
3408
|
const u = l == null ? void 0 : l.getActiveSheet();
|
|
3276
3409
|
if (!u || !n && u.getSheetId() !== s || !(h != null && h.length)) return;
|
|
3277
|
-
const a = o ? u.getName() : u.getSheetId() === s ? "" : u.getName(),
|
|
3410
|
+
const a = o ? u.getName() : u.getSheetId() === s ? "" : u.getName(), v = h.map((p) => ({
|
|
3278
3411
|
range: p.range,
|
|
3279
3412
|
unitId: r,
|
|
3280
3413
|
sheetName: a
|
|
3281
3414
|
}));
|
|
3282
|
-
g(
|
|
3415
|
+
g(v, d);
|
|
3283
3416
|
});
|
|
3284
3417
|
$(() => {
|
|
3285
3418
|
const h = new qe();
|
|
@@ -3294,14 +3427,14 @@ function Ic(e) {
|
|
|
3294
3427
|
};
|
|
3295
3428
|
}, [m, t.selectionMoveEnd$, t.selectionMoveStart$, t.selectionMoving$]);
|
|
3296
3429
|
}
|
|
3297
|
-
const
|
|
3430
|
+
const Jn = (e) => !e.some((n) => {
|
|
3298
3431
|
if (typeof n == "string") {
|
|
3299
|
-
if (n !==
|
|
3432
|
+
if (n !== je.COMMA)
|
|
3300
3433
|
return !0;
|
|
3301
3434
|
} else if (n.nodeType !== Q.REFERENCE)
|
|
3302
3435
|
return !0;
|
|
3303
3436
|
return !1;
|
|
3304
|
-
}),
|
|
3437
|
+
}), Ic = (e) => {
|
|
3305
3438
|
if (e.endColumn < e.startColumn) {
|
|
3306
3439
|
const t = e.endColumn;
|
|
3307
3440
|
e.endColumn = e.startColumn, e.startColumn = t;
|
|
@@ -3312,7 +3445,7 @@ const er = (e) => !e.some((n) => {
|
|
|
3312
3445
|
}
|
|
3313
3446
|
return e;
|
|
3314
3447
|
};
|
|
3315
|
-
function
|
|
3448
|
+
function Ec(e) {
|
|
3316
3449
|
const {
|
|
3317
3450
|
visible: t,
|
|
3318
3451
|
initialValue: n,
|
|
@@ -3324,10 +3457,10 @@ function yc(e) {
|
|
|
3324
3457
|
onConfirm: l,
|
|
3325
3458
|
onClose: g,
|
|
3326
3459
|
onShowBySelection: m
|
|
3327
|
-
} = e, h = T(
|
|
3460
|
+
} = e, h = T(dt), d = T(_e), [u, a] = V([]), [v, p] = V(0), S = z(null);
|
|
3328
3461
|
$(() => {
|
|
3329
3462
|
if (t && n.length) {
|
|
3330
|
-
const f = n.map((b) => b.sheetName ?
|
|
3463
|
+
const f = n.map((b) => b.sheetName ? Ct(b.sheetName, b.range) : Ce(b.range));
|
|
3331
3464
|
a(f), p(f.length - 1);
|
|
3332
3465
|
} else
|
|
3333
3466
|
a([""]), p(0);
|
|
@@ -3337,10 +3470,10 @@ function yc(e) {
|
|
|
3337
3470
|
y[f] = b, a(y);
|
|
3338
3471
|
}, _ = () => {
|
|
3339
3472
|
a([...u, ""]), p(u.length);
|
|
3340
|
-
},
|
|
3473
|
+
}, E = (f) => {
|
|
3341
3474
|
u.splice(f, 1), a([...u]);
|
|
3342
3475
|
};
|
|
3343
|
-
return
|
|
3476
|
+
return Rc({
|
|
3344
3477
|
unitId: o,
|
|
3345
3478
|
subUnitId: r,
|
|
3346
3479
|
supportAcrossSheet: i,
|
|
@@ -3348,24 +3481,24 @@ function yc(e) {
|
|
|
3348
3481
|
onChange: (f, b) => {
|
|
3349
3482
|
if (!t && m != null && m(f))
|
|
3350
3483
|
return;
|
|
3351
|
-
const y = new Set(u), A = f.map((
|
|
3484
|
+
const y = new Set(u), A = f.map((O) => O.sheetName ? Ct(O.sheetName, O.range) : Ce(O.range)), F = A.filter((O) => !y.has(O));
|
|
3352
3485
|
if (!F.length) return;
|
|
3353
|
-
const
|
|
3486
|
+
const N = [...u];
|
|
3354
3487
|
if (A.length > 1) {
|
|
3355
|
-
b ||
|
|
3356
|
-
const
|
|
3357
|
-
a(
|
|
3488
|
+
b || N.splice(v, 1), N.push(...F);
|
|
3489
|
+
const O = N.slice(0, s);
|
|
3490
|
+
a(O), p(O.length - 1), requestAnimationFrame(() => {
|
|
3358
3491
|
var k;
|
|
3359
|
-
(k =
|
|
3492
|
+
(k = S.current) == null || k.scrollTo({ top: S.current.scrollHeight });
|
|
3360
3493
|
});
|
|
3361
3494
|
} else {
|
|
3362
|
-
|
|
3363
|
-
const
|
|
3364
|
-
a(
|
|
3495
|
+
N.splice(v, 1, ...F);
|
|
3496
|
+
const O = N.slice(0, s);
|
|
3497
|
+
a(O), p(v + F.length - 1);
|
|
3365
3498
|
}
|
|
3366
3499
|
}
|
|
3367
3500
|
}), /* @__PURE__ */ M(
|
|
3368
|
-
|
|
3501
|
+
ys,
|
|
3369
3502
|
{
|
|
3370
3503
|
width: "328px",
|
|
3371
3504
|
open: t,
|
|
@@ -3374,9 +3507,9 @@ function yc(e) {
|
|
|
3374
3507
|
mask: !1,
|
|
3375
3508
|
maskClosable: !1,
|
|
3376
3509
|
footer: /* @__PURE__ */ W("footer", { className: "univer-flex univer-gap-2", children: [
|
|
3377
|
-
/* @__PURE__ */ M(
|
|
3510
|
+
/* @__PURE__ */ M(ct, { onClick: g, children: h.t("rangeSelector.cancel") }),
|
|
3378
3511
|
/* @__PURE__ */ M(
|
|
3379
|
-
|
|
3512
|
+
ct,
|
|
3380
3513
|
{
|
|
3381
3514
|
variant: "primary",
|
|
3382
3515
|
onClick: () => {
|
|
@@ -3384,7 +3517,7 @@ function yc(e) {
|
|
|
3384
3517
|
u.filter((f) => {
|
|
3385
3518
|
const b = d.sequenceNodesBuilder(f);
|
|
3386
3519
|
return b && b.length === 1 && typeof b[0] != "string" && b[0].nodeType === Q.REFERENCE;
|
|
3387
|
-
}).map((f) =>
|
|
3520
|
+
}).map((f) => ht(f)).map((f) => ({ ...f, range: Ic(f.range) }))
|
|
3388
3521
|
);
|
|
3389
3522
|
},
|
|
3390
3523
|
children: h.t("rangeSelector.confirm")
|
|
@@ -3395,8 +3528,8 @@ function yc(e) {
|
|
|
3395
3528
|
children: /* @__PURE__ */ W(
|
|
3396
3529
|
"div",
|
|
3397
3530
|
{
|
|
3398
|
-
ref:
|
|
3399
|
-
className: re("-univer-mx-6 univer-max-h-60 univer-overflow-y-auto univer-px-6",
|
|
3531
|
+
ref: S,
|
|
3532
|
+
className: re("-univer-mx-6 univer-max-h-60 univer-overflow-y-auto univer-px-6", lt),
|
|
3400
3533
|
children: [
|
|
3401
3534
|
u.map((f, b) => /* @__PURE__ */ W(
|
|
3402
3535
|
"div",
|
|
@@ -3404,10 +3537,10 @@ function yc(e) {
|
|
|
3404
3537
|
className: "univer-mb-2 univer-flex univer-items-center univer-gap-4",
|
|
3405
3538
|
children: [
|
|
3406
3539
|
/* @__PURE__ */ M(
|
|
3407
|
-
|
|
3540
|
+
_r,
|
|
3408
3541
|
{
|
|
3409
3542
|
className: re("univer-w-full", {
|
|
3410
|
-
"univer-border-primary-600":
|
|
3543
|
+
"univer-border-primary-600": v === b
|
|
3411
3544
|
}),
|
|
3412
3545
|
placeholder: h.t("rangeSelector.placeHolder"),
|
|
3413
3546
|
onFocus: () => p(b),
|
|
@@ -3416,18 +3549,18 @@ function yc(e) {
|
|
|
3416
3549
|
}
|
|
3417
3550
|
),
|
|
3418
3551
|
u.length > 1 && /* @__PURE__ */ M(
|
|
3419
|
-
|
|
3552
|
+
kr,
|
|
3420
3553
|
{
|
|
3421
3554
|
className: "univer-cursor-pointer",
|
|
3422
|
-
onClick: () =>
|
|
3555
|
+
onClick: () => E(b)
|
|
3423
3556
|
}
|
|
3424
3557
|
)
|
|
3425
3558
|
]
|
|
3426
3559
|
},
|
|
3427
3560
|
b
|
|
3428
3561
|
)),
|
|
3429
|
-
u.length < s && /* @__PURE__ */ M("div", { children: /* @__PURE__ */ W(
|
|
3430
|
-
/* @__PURE__ */ M(
|
|
3562
|
+
u.length < s && /* @__PURE__ */ M("div", { children: /* @__PURE__ */ W(ct, { variant: "link", onClick: _, children: [
|
|
3563
|
+
/* @__PURE__ */ M(Ar, {}),
|
|
3431
3564
|
/* @__PURE__ */ M("span", { children: h.t("rangeSelector.addAnotherRange") })
|
|
3432
3565
|
] }) })
|
|
3433
3566
|
]
|
|
@@ -3436,13 +3569,13 @@ function yc(e) {
|
|
|
3436
3569
|
}
|
|
3437
3570
|
);
|
|
3438
3571
|
}
|
|
3439
|
-
function
|
|
3440
|
-
return e.split(
|
|
3572
|
+
function bc(e) {
|
|
3573
|
+
return e.split(je.COMMA).filter((t) => !!t).map((t) => ht(t));
|
|
3441
3574
|
}
|
|
3442
|
-
function
|
|
3443
|
-
return e.map((t) => t.sheetName ?
|
|
3575
|
+
function yc(e) {
|
|
3576
|
+
return e.map((t) => t.sheetName ? Ct(t.sheetName, t.range) : Ce(t.range)).join(je.COMMA);
|
|
3444
3577
|
}
|
|
3445
|
-
function
|
|
3578
|
+
function Wr(e) {
|
|
3446
3579
|
const [t, n] = V(null), {
|
|
3447
3580
|
onVerify: o,
|
|
3448
3581
|
selectorRef: r,
|
|
@@ -3456,14 +3589,14 @@ function Hr(e) {
|
|
|
3456
3589
|
onRangeSelectorDialogVisibleChange: d,
|
|
3457
3590
|
onClickOutside: u,
|
|
3458
3591
|
onFocusChange: a,
|
|
3459
|
-
forceShowDialogWhenSelectionChanged:
|
|
3592
|
+
forceShowDialogWhenSelectionChanged: v,
|
|
3460
3593
|
hideEditor: p,
|
|
3461
|
-
resetRange:
|
|
3462
|
-
} = e, [C, _] = V(m != null ? m : !1), [
|
|
3594
|
+
resetRange: S
|
|
3595
|
+
} = e, [C, _] = V(m != null ? m : !1), [E, f] = V(!1), [b, y] = V([]), A = T(dt), F = T(Ye), { sequenceNodes: N } = _c(t, C, s, i), O = tt(N), k = T(me), I = te(() => {
|
|
3463
3596
|
t == null || t.setSelectionRanges([]), t == null || t.blur(), F.blur();
|
|
3464
3597
|
}), x = te(() => {
|
|
3465
3598
|
var R;
|
|
3466
|
-
|
|
3599
|
+
I(), y(bc((R = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? R : "")), f(!0);
|
|
3467
3600
|
});
|
|
3468
3601
|
return $(() => {
|
|
3469
3602
|
r && (r.current = {
|
|
@@ -3473,10 +3606,10 @@ function Hr(e) {
|
|
|
3473
3606
|
focus() {
|
|
3474
3607
|
F.focus(t.getEditorId());
|
|
3475
3608
|
},
|
|
3476
|
-
blur:
|
|
3477
|
-
verify: () =>
|
|
3609
|
+
blur: I,
|
|
3610
|
+
verify: () => Jn(O.current),
|
|
3478
3611
|
showDialog: (R) => {
|
|
3479
|
-
|
|
3612
|
+
I(), y(R), f(!0);
|
|
3480
3613
|
},
|
|
3481
3614
|
hideDialog: () => {
|
|
3482
3615
|
y([]), f(!1);
|
|
@@ -3486,24 +3619,24 @@ function Hr(e) {
|
|
|
3486
3619
|
return (R = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? R : "";
|
|
3487
3620
|
}
|
|
3488
3621
|
});
|
|
3489
|
-
}, [
|
|
3622
|
+
}, [I, t, F, r, O]), $(() => {
|
|
3490
3623
|
var R;
|
|
3491
|
-
o == null || o(
|
|
3492
|
-
}, [
|
|
3493
|
-
d == null || d(
|
|
3494
|
-
}, [
|
|
3495
|
-
if (
|
|
3624
|
+
o == null || o(Jn(N), (R = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? R : "");
|
|
3625
|
+
}, [N]), $(() => {
|
|
3626
|
+
d == null || d(E);
|
|
3627
|
+
}, [E]), $(() => {
|
|
3628
|
+
if (E && S)
|
|
3496
3629
|
return () => {
|
|
3497
3630
|
const R = {
|
|
3498
3631
|
unitId: s,
|
|
3499
3632
|
subUnitId: i,
|
|
3500
|
-
selections:
|
|
3633
|
+
selections: S
|
|
3501
3634
|
};
|
|
3502
|
-
k.executeCommand(
|
|
3635
|
+
k.executeCommand(gn.id, R);
|
|
3503
3636
|
};
|
|
3504
|
-
}, [
|
|
3637
|
+
}, [E]), /* @__PURE__ */ W(Cs, { children: [
|
|
3505
3638
|
p ? null : /* @__PURE__ */ M(
|
|
3506
|
-
|
|
3639
|
+
es,
|
|
3507
3640
|
{
|
|
3508
3641
|
isSingle: !0,
|
|
3509
3642
|
...e,
|
|
@@ -3512,10 +3645,10 @@ function Hr(e) {
|
|
|
3512
3645
|
},
|
|
3513
3646
|
editorRef: n,
|
|
3514
3647
|
onClickOutside: () => {
|
|
3515
|
-
_(!1),
|
|
3648
|
+
_(!1), I(), u == null || u();
|
|
3516
3649
|
},
|
|
3517
|
-
icon: /* @__PURE__ */ M(
|
|
3518
|
-
|
|
3650
|
+
icon: /* @__PURE__ */ M(bs, { title: A.t("rangeSelector.buttonTooltip"), placement: "bottom", children: /* @__PURE__ */ M(
|
|
3651
|
+
Dr,
|
|
3519
3652
|
{
|
|
3520
3653
|
className: "univer-cursor-pointer dark:!univer-text-gray-300",
|
|
3521
3654
|
onClick: x
|
|
@@ -3524,17 +3657,17 @@ function Hr(e) {
|
|
|
3524
3657
|
}
|
|
3525
3658
|
),
|
|
3526
3659
|
/* @__PURE__ */ M(
|
|
3527
|
-
|
|
3660
|
+
Ec,
|
|
3528
3661
|
{
|
|
3529
3662
|
initialValue: b,
|
|
3530
3663
|
unitId: s,
|
|
3531
3664
|
subUnitId: i,
|
|
3532
|
-
visible:
|
|
3665
|
+
visible: E,
|
|
3533
3666
|
maxRangeCount: c,
|
|
3534
3667
|
onConfirm: (R) => {
|
|
3535
|
-
const w =
|
|
3668
|
+
const w = yc(R), D = co.newEmptyData();
|
|
3536
3669
|
D.body.dataStream = w, t == null || t.replaceText(w, !1), h == null || h(D, w), f(!1), y([]), requestAnimationFrame(() => {
|
|
3537
|
-
|
|
3670
|
+
I();
|
|
3538
3671
|
});
|
|
3539
3672
|
},
|
|
3540
3673
|
onClose: () => {
|
|
@@ -3542,14 +3675,14 @@ function Hr(e) {
|
|
|
3542
3675
|
},
|
|
3543
3676
|
supportAcrossSheet: l,
|
|
3544
3677
|
keepSheetReference: g,
|
|
3545
|
-
onShowBySelection: (R) => C ||
|
|
3678
|
+
onShowBySelection: (R) => C || v ? (y(R), f(!0), !1) : !0
|
|
3546
3679
|
}
|
|
3547
3680
|
)
|
|
3548
3681
|
] });
|
|
3549
3682
|
}
|
|
3550
|
-
const
|
|
3683
|
+
const Tc = () => {
|
|
3551
3684
|
var o, r;
|
|
3552
|
-
const e = T(
|
|
3685
|
+
const e = T(Lr), t = Se(e.currentSelector$), n = z(null);
|
|
3553
3686
|
return $(() => {
|
|
3554
3687
|
var s, i;
|
|
3555
3688
|
if (t)
|
|
@@ -3558,7 +3691,7 @@ const Nc = () => {
|
|
|
3558
3691
|
(c = n.current) == null || c.hideDialog();
|
|
3559
3692
|
};
|
|
3560
3693
|
}, [t]), /* @__PURE__ */ M(
|
|
3561
|
-
|
|
3694
|
+
Wr,
|
|
3562
3695
|
{
|
|
3563
3696
|
unitId: (o = t == null ? void 0 : t.unitId) != null ? o : "",
|
|
3564
3697
|
subUnitId: (r = t == null ? void 0 : t.subUnitId) != null ? r : "",
|
|
@@ -3566,86 +3699,86 @@ const Nc = () => {
|
|
|
3566
3699
|
selectorRef: n,
|
|
3567
3700
|
onChange: (s, i) => {
|
|
3568
3701
|
var c;
|
|
3569
|
-
t == null || t.callback((c = i == null ? void 0 : i.split(",").map((l) =>
|
|
3702
|
+
t == null || t.callback((c = i == null ? void 0 : i.split(",").map((l) => ht(l))) != null ? c : []);
|
|
3570
3703
|
}
|
|
3571
3704
|
}
|
|
3572
3705
|
);
|
|
3573
3706
|
};
|
|
3574
|
-
var
|
|
3575
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
3707
|
+
var Nc = Object.defineProperty, Oc = Object.getOwnPropertyDescriptor, xc = (e, t, n) => t in e ? Nc(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Mc = (e, t, n, o) => {
|
|
3708
|
+
for (var r = o > 1 ? void 0 : o ? Oc(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
3576
3709
|
(i = e[s]) && (r = i(r) || r);
|
|
3577
3710
|
return r;
|
|
3578
|
-
},
|
|
3579
|
-
let
|
|
3580
|
-
constructor(e =
|
|
3711
|
+
}, At = (e, t) => (n, o) => t(n, o, e), Hr = (e, t, n) => xc(e, typeof t != "symbol" ? t + "" : t, n);
|
|
3712
|
+
let Bt = class extends lo {
|
|
3713
|
+
constructor(e = Gn, t, n, o, r) {
|
|
3581
3714
|
super(), this._config = e, this._injector = t, this._renderManagerService = n, this._configService = o, this._uiPartsService = r;
|
|
3582
|
-
const { menu: s, ...i } =
|
|
3583
|
-
|
|
3715
|
+
const { menu: s, ...i } = uo(
|
|
3716
|
+
Gn,
|
|
3584
3717
|
this._config
|
|
3585
3718
|
);
|
|
3586
|
-
s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(
|
|
3719
|
+
s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(yr, i, { merge: !0 });
|
|
3587
3720
|
}
|
|
3588
3721
|
onStarting() {
|
|
3589
|
-
|
|
3590
|
-
[
|
|
3591
|
-
[
|
|
3592
|
-
[
|
|
3722
|
+
ho(this._injector, [
|
|
3723
|
+
[Zt, { useClass: rn }],
|
|
3724
|
+
[Lr],
|
|
3725
|
+
[Ht],
|
|
3726
|
+
[Pt],
|
|
3593
3727
|
[Ut],
|
|
3594
3728
|
[Vt],
|
|
3595
3729
|
[Wt],
|
|
3596
|
-
[
|
|
3597
|
-
[Pt]
|
|
3730
|
+
[$t]
|
|
3598
3731
|
]), this._initUIPart();
|
|
3599
3732
|
}
|
|
3600
3733
|
onReady() {
|
|
3601
3734
|
[
|
|
3602
|
-
[
|
|
3735
|
+
[De]
|
|
3603
3736
|
].forEach((e) => {
|
|
3604
3737
|
this.disposeWithMe(this._renderManagerService.registerRenderModule(H.UNIVER_SHEET, e));
|
|
3605
3738
|
});
|
|
3606
3739
|
}
|
|
3607
3740
|
onRendered() {
|
|
3608
3741
|
[
|
|
3609
|
-
[
|
|
3742
|
+
[on]
|
|
3610
3743
|
].forEach((e) => {
|
|
3611
3744
|
this.disposeWithMe(this._renderManagerService.registerRenderModule(H.UNIVER_SHEET, e));
|
|
3612
|
-
}),
|
|
3613
|
-
[
|
|
3745
|
+
}), fo(this._injector, [
|
|
3746
|
+
[Ht],
|
|
3614
3747
|
// FormulaProgressBar relies on TriggerCalculationController, but it is necessary to ensure that the formula calculation is done after rendered.
|
|
3615
|
-
[
|
|
3616
|
-
[
|
|
3748
|
+
[Ut],
|
|
3749
|
+
[Wt]
|
|
3617
3750
|
]);
|
|
3618
3751
|
}
|
|
3619
3752
|
onSteady() {
|
|
3620
|
-
this._injector.get(
|
|
3753
|
+
this._injector.get(Pt), this._injector.get($t);
|
|
3621
3754
|
}
|
|
3622
3755
|
_initUIPart() {
|
|
3623
|
-
const e = this._injector.get(
|
|
3624
|
-
this.disposeWithMe(e.register(
|
|
3756
|
+
const e = this._injector.get(vr);
|
|
3757
|
+
this.disposeWithMe(e.register(wo, Wr)), this.disposeWithMe(e.register(ko, Cc)), this.disposeWithMe(this._uiPartsService.registerComponent(vs.GLOBAL, () => Cr(Tc, this._injector)));
|
|
3625
3758
|
}
|
|
3626
3759
|
};
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
],
|
|
3760
|
+
Hr(Bt, "pluginName", Ir);
|
|
3761
|
+
Hr(Bt, "type", H.UNIVER_SHEET);
|
|
3762
|
+
Bt = Mc([
|
|
3763
|
+
ao(Ho, hs),
|
|
3764
|
+
At(1, q(Rt)),
|
|
3765
|
+
At(2, xe),
|
|
3766
|
+
At(3, or),
|
|
3767
|
+
At(4, Sr)
|
|
3768
|
+
], Bt);
|
|
3636
3769
|
export {
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3770
|
+
Ms as FORMULA_PROMPT_ACTIVATED,
|
|
3771
|
+
Cc as FormulaEditor,
|
|
3772
|
+
$t as FormulaReorderController,
|
|
3773
|
+
Lr as GlobalRangeSelectorService,
|
|
3774
|
+
ws as HelpFunctionOperation,
|
|
3775
|
+
pe as InsertFunctionOperation,
|
|
3776
|
+
Cn as MoreFunctionsOperation,
|
|
3777
|
+
Wr as RangeSelector,
|
|
3778
|
+
De as RefSelectionsRenderService,
|
|
3779
|
+
br as ReferenceAbsoluteOperation,
|
|
3780
|
+
Ps as SearchFunctionOperation,
|
|
3781
|
+
gt as SelectEditorFormulaOperation,
|
|
3782
|
+
vn as SheetOnlyPasteFormulaCommand,
|
|
3783
|
+
Bt as UniverSheetsFormulaUIPlugin
|
|
3651
3784
|
};
|