@univerjs/sheets-formula-ui 0.15.0 → 0.15.1-insiders.20260117-8ce4a01
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 +1223 -1226
- package/lib/index.js +1223 -1226
- package/lib/types/services/utils.d.ts +1 -1
- package/lib/types/views/more-functions/select-function/SelectFunction.d.ts +1 -1
- package/lib/umd/index.js +5 -5
- package/package.json +14 -14
- package/LICENSE +0 -176
package/lib/index.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var j = (e, t, n) =>
|
|
4
|
-
import { CommandType as be, ICommandService as pe, createIdentifier as
|
|
5
|
-
import { ISheetClipboardService as
|
|
6
|
-
import { sequenceNodeType as Q, serializeRange as Ee, FormulaDataModel as Tt, LexerTreeBuilder as ye, ErrorType as ue, extractFormulaError as
|
|
7
|
-
import { Subject as pt, debounceTime as
|
|
8
|
-
import { IEditorService as ze, DocSelectionRenderService as
|
|
1
|
+
var Xr = Object.defineProperty;
|
|
2
|
+
var Qr = (e, t, n) => t in e ? Xr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var j = (e, t, n) => Qr(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { CommandType as be, ICommandService as pe, createIdentifier as Jr, IContextService as dn, IUniverInstanceService as ne, Rectangle as hn, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as fn, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as sr, DEFAULT_EMPTY_DOCUMENT_VALUE as ir, isRealNum as eo, CellValueType as Ln, getCellValueType as to, Inject as q, Disposable as Ze, ObjectMatrix as Fe, Range as no, Tools as gn, LocaleService as dt, isICellData as ro, isFormulaString as Ce, isFormulaId as De, generateRandomId as Yt, Direction as de, Injector as It, getEmptyCell as mt, UniverInstanceType as W, ThemeService as Et, ILogService as oo, toDisposable as cr, ColorKit as mn, RxDisposable as so, InterceptorEffectEnum as io, IConfigService as pn, FOCUSING_DOC as co, FOCUSING_UNIVER_EDITOR as lo, DisposableCollection as Ye, RANGE_TYPE as Ie, getBodySlice as $n, EDITOR_ACTIVATED as Pn, createInternalEditorID as ao, BuildTextUtils as uo, RichTextBuilder as ho, DependentOn as fo, Plugin as go, merge as mo, registerDependencies as po, touchDependencies as So } from "@univerjs/core";
|
|
5
|
+
import { ISheetClipboardService as lr, PREDEFINED_HOOK_NAME_COPY as ar, SheetPasteCommand as vo, PREDEFINED_HOOK_NAME_PASTE as lt, IEditorBridgeService as Sn, SetCellEditVisibleOperation as ur, HoverManagerService as Co, CellAlertManagerService as _o, CellAlertType as Ro, IAutoFillService as Io, APPLY_TYPE as Eo, DATA_TYPE as Un, COPY_TYPE as dr, SheetSkeletonManagerService as bt, attachSelectionWithCoord as sn, SelectionControl as hr, SELECTION_SHAPE_DEPTH as bo, useActiveWorkbook as yo, menuClipboardDisabledObservable as To, getCurrentRangeDisable$ as $e, PASTE_SPECIAL_MENU_ID as Oo, COPY_SPECIAL_MENU_ID as No, whenFormulaEditorActivated as yt, whenSheetEditorFocused as Mo, SheetsUIPart as xo, BaseSelectionRenderService as wo, getCoordByOffset as Vn, checkInHeaderRanges as Wn, getAllSelection as ko, genNormalSelectionStyle as fr, getSheetObject as Ao, MoveSelectionCommand as Hn, JumpOver as Bn, ExpandSelectionCommand as qn, EMBEDDING_FORMULA_EDITOR as Fo, IMarkSelectionService as Do, RANGE_SELECTOR_COMPONENT_KEY as Lo, EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY as $o } from "@univerjs/sheets-ui";
|
|
6
|
+
import { sequenceNodeType as Q, serializeRange as Ee, FormulaDataModel as Tt, LexerTreeBuilder as ye, ErrorType as ue, extractFormulaError as gr, SetFormulaCalculationResultMutation as Po, SetArrayFormulaDataMutation as Uo, SetFormulaCalculationStopMutation as Vo, FunctionType as mr, matchToken as Ge, deserializeRangeWithSheetWithCache as Wo, matchRefDrawToken as Ho, isFormulaLexerToken as Bo, deserializeRangeWithSheet as ht, serializeRangeToRefString as qo, serializeRangeWithSheet as _t, serializeRangeWithSpreadsheet as jo, generateStringWithSequence as Ko, operatorToken as pr } from "@univerjs/engine-formula";
|
|
7
|
+
import { Subject as pt, debounceTime as vn, combineLatestWith as Yo, map as Sr, BehaviorSubject as vr, throttleTime as Go, filter as Cr, distinctUntilChanged as Zo, merge as zo } from "rxjs";
|
|
8
|
+
import { IEditorService as ze, DocSelectionRenderService as _r, ReplaceTextRunsCommand as jn, MoveSelectionOperation as Xo, MoveCursorOperation as Qo, useKeyboardEvent as Jo, useResize as es, DocBackScrollRenderController as ts, RichTextEditor as ns } from "@univerjs/docs-ui";
|
|
9
9
|
import { DeviceInputEventType as xe, IRenderManagerService as Te, ScrollTimerType as en, SHEET_VIEWPORT_KEY as Kn, Vector2 as Yn } from "@univerjs/engine-render";
|
|
10
|
-
import { SheetsSelectionsService as
|
|
11
|
-
import { InsertFunctionCommand as
|
|
12
|
-
import { ISidebarService as
|
|
13
|
-
import { jsx as x, jsxs as B, Fragment as
|
|
14
|
-
import { useCallback as $t, useState as H, useRef as
|
|
15
|
-
import { clsx as se, scrollbarClassName as ut, borderLeftClassName as
|
|
16
|
-
import { DocSelectionManagerService as
|
|
17
|
-
import { debounceTime as
|
|
18
|
-
const
|
|
10
|
+
import { SheetsSelectionsService as Cn, getSheetCommandTarget as Rr, getCellAtRowCol as rs, SetSelectionsOperation as _n, SheetInterceptorService as Rn, ReorderRangeCommand as os, SetRangeValuesMutation as Lt, SetRangeValuesUndoMutationFactory as ss, BEFORE_CELL_EDIT as is, SetWorksheetRowAutoHeightMutation as cs, INTERCEPTOR_POINT as ls, WorksheetSetCellValuePermission as Xe, WorksheetEditPermission as Qe, RangeProtectionPermissionEditPoint as Je, WorkbookEditablePermission as et, RangeProtectionPermissionViewPoint as as, WorksheetCopyPermission as us, WorkbookCopyPermission as ds, IRefSelectionsService as Gt, SelectionMoveType as tn, convertSelectionDataToRange as hs, setEndForRange as fs, REF_SELECTIONS_ENABLED as Gn, SetWorksheetActiveOperation as Zn } from "@univerjs/sheets";
|
|
11
|
+
import { InsertFunctionCommand as gs, TriggerCalculationController as ms, PLUGIN_CONFIG_KEY_BASE as ps, IDescriptionService as Zt, QuickSumCommand as Ss, ImageFormulaCellInterceptorController as vs, UniverSheetsFormulaPlugin as Cs } from "@univerjs/sheets-formula";
|
|
12
|
+
import { ISidebarService as In, IZenZoneService as _s, useDependency as y, useObservable as _e, ProgressBar as Rs, getMenuHiddenObservable as Pe, MenuItemType as Ue, RibbonFormulasGroup as zn, KeyCode as L, MetaKeys as V, IMenuManagerService as Is, IShortcutService as zt, IUIPartsService as Ir, ComponentManager as Er, connectInjector as br, useEvent as ee, RectPopup as cn, IContextMenuService as Es, useUpdateEffect as bs, BuiltInUIPart as ys } from "@univerjs/ui";
|
|
13
|
+
import { jsx as x, jsxs as B, Fragment as Ts } from "react/jsx-runtime";
|
|
14
|
+
import { useCallback as $t, useState as H, useRef as X, createElement as tt, forwardRef as Ve, useEffect as P, useMemo as le, useLayoutEffect as Pt, useImperativeHandle as Os } from "react";
|
|
15
|
+
import { clsx as se, scrollbarClassName as ut, borderLeftClassName as Ns, Select as Ms, Input as yr, borderClassName as En, Button as at, borderTopClassName as xs, Tooltip as ws, Dialog as ks } from "@univerjs/design";
|
|
16
|
+
import { DocSelectionManagerService as Tr } from "@univerjs/docs";
|
|
17
|
+
import { debounceTime as As } from "rxjs/operators";
|
|
18
|
+
const bn = {
|
|
19
19
|
id: "sheet.command.copy-formula-only",
|
|
20
20
|
type: be.COMMAND,
|
|
21
|
-
handler: async (e) => e.get(
|
|
22
|
-
copyHookType:
|
|
21
|
+
handler: async (e) => e.get(lr).copy({
|
|
22
|
+
copyHookType: ar.SPECIAL_COPY_FORMULA_ONLY
|
|
23
23
|
})
|
|
24
|
-
},
|
|
24
|
+
}, yn = {
|
|
25
25
|
id: "sheet.command.paste-formula",
|
|
26
26
|
type: be.COMMAND,
|
|
27
|
-
handler: async (e) => e.get(pe).executeCommand(
|
|
27
|
+
handler: async (e) => e.get(pe).executeCommand(vo.id, {
|
|
28
28
|
value: lt.SPECIAL_PASTE_FORMULA
|
|
29
29
|
})
|
|
30
30
|
}, ft = {
|
|
@@ -32,12 +32,12 @@ const En = {
|
|
|
32
32
|
type: be.OPERATION,
|
|
33
33
|
handler: (e, t) => !0
|
|
34
34
|
};
|
|
35
|
-
var
|
|
36
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
35
|
+
var Fs = Object.getOwnPropertyDescriptor, Ds = (e, t, n, o) => {
|
|
36
|
+
for (var r = o > 1 ? void 0 : o ? Fs(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
37
37
|
(i = e[s]) && (r = i(r) || r);
|
|
38
38
|
return r;
|
|
39
|
-
},
|
|
40
|
-
const
|
|
39
|
+
}, Ls = (e, t) => (n, o) => t(n, o, e);
|
|
40
|
+
const $s = "FORMULA_PROMPT_ACTIVATED", Xt = Jr("formula-ui.prompt-service");
|
|
41
41
|
let ln = class {
|
|
42
42
|
constructor(e) {
|
|
43
43
|
j(this, "_search$", new pt());
|
|
@@ -61,7 +61,7 @@ let ln = class {
|
|
|
61
61
|
this._search$.complete(), this._help$.complete(), this._navigate$.complete(), this._accept$.complete(), this._acceptFormulaName$.complete(), this._sequenceNodes = [];
|
|
62
62
|
}
|
|
63
63
|
search(e) {
|
|
64
|
-
this._contextService.setContextValue(
|
|
64
|
+
this._contextService.setContextValue($s, e.visible), this._searching = e.visible, this._search$.next(e);
|
|
65
65
|
}
|
|
66
66
|
isSearching() {
|
|
67
67
|
return this._searching;
|
|
@@ -193,10 +193,10 @@ let ln = class {
|
|
|
193
193
|
return this._isLockedOnSelectionInsertRefString;
|
|
194
194
|
}
|
|
195
195
|
};
|
|
196
|
-
ln =
|
|
197
|
-
|
|
196
|
+
ln = Ds([
|
|
197
|
+
Ls(0, dn)
|
|
198
198
|
], ln);
|
|
199
|
-
const
|
|
199
|
+
const Ps = {
|
|
200
200
|
id: "formula-ui.operation.help-function",
|
|
201
201
|
type: be.OPERATION,
|
|
202
202
|
handler: async (e, t) => (e.get(Xt).help(t), !0)
|
|
@@ -205,76 +205,76 @@ const Vs = {
|
|
|
205
205
|
type: be.OPERATION,
|
|
206
206
|
// eslint-disable-next-line
|
|
207
207
|
handler: async (e, t) => {
|
|
208
|
-
var C,
|
|
209
|
-
const n = e.get(
|
|
208
|
+
var C, R;
|
|
209
|
+
const n = e.get(Cn), o = e.get(ze), r = n.getCurrentSelections();
|
|
210
210
|
if (!r || !r.length)
|
|
211
211
|
return !1;
|
|
212
|
-
const s =
|
|
212
|
+
const s = Rr(e.get(ne));
|
|
213
213
|
if (!s) return !1;
|
|
214
|
-
const { worksheet: i, unitId: c, subUnitId: a } = s,
|
|
215
|
-
e.get(
|
|
216
|
-
const
|
|
217
|
-
let l = null,
|
|
218
|
-
if (r.length === 1 && (
|
|
219
|
-
const { range: E, primary: p } = r[0], b = (C = p == null ? void 0 : p.actualRow) != null ? C : E.startRow,
|
|
220
|
-
l = E,
|
|
221
|
-
const
|
|
222
|
-
|
|
214
|
+
const { worksheet: i, unitId: c, subUnitId: a } = s, d = i.getCellMatrix(), { value: f } = t, m = e.get(pe);
|
|
215
|
+
e.get(Sn);
|
|
216
|
+
const u = [], h = [];
|
|
217
|
+
let l = null, S = 0, v = 0, g = "";
|
|
218
|
+
if (r.length === 1 && (Ws(r[0].range) || Hs(r[0].range) && Qn(d, r[0].range))) {
|
|
219
|
+
const { range: E, primary: p } = r[0], b = (C = p == null ? void 0 : p.actualRow) != null ? C : E.startRow, T = (R = p == null ? void 0 : p.actualColumn) != null ? R : E.startColumn;
|
|
220
|
+
l = E, S = b, v = T;
|
|
221
|
+
const F = Xn(d, b, T);
|
|
222
|
+
F && (g = Ee(F));
|
|
223
223
|
} else
|
|
224
224
|
r.some((E) => {
|
|
225
|
-
var
|
|
225
|
+
var T, F;
|
|
226
226
|
const { range: p, primary: b } = E;
|
|
227
|
-
if (
|
|
228
|
-
const
|
|
227
|
+
if (Qn(d, p)) {
|
|
228
|
+
const A = (T = b == null ? void 0 : b.actualRow) != null ? T : p.startRow, N = (F = b == null ? void 0 : b.actualColumn) != null ? F : p.startColumn, M = Xn(d, A, N);
|
|
229
229
|
if (!M)
|
|
230
|
-
return l = p,
|
|
231
|
-
const
|
|
232
|
-
|
|
230
|
+
return l = p, S = A, v = N, !0;
|
|
231
|
+
const w = Ee(M), k = `=${f}(${w})`;
|
|
232
|
+
u.push({
|
|
233
233
|
range: p,
|
|
234
234
|
primary: {
|
|
235
|
-
row:
|
|
235
|
+
row: A,
|
|
236
236
|
column: N
|
|
237
237
|
},
|
|
238
|
-
formula:
|
|
238
|
+
formula: k
|
|
239
239
|
});
|
|
240
240
|
} else {
|
|
241
|
-
const { startRow:
|
|
242
|
-
if (
|
|
243
|
-
const
|
|
244
|
-
startRow:
|
|
241
|
+
const { startRow: A, startColumn: N, endRow: M, endColumn: w } = p;
|
|
242
|
+
if (A === M) {
|
|
243
|
+
const k = Bs(d, A, w, i.getColumnCount() - 1), $ = k === w ? w - 1 : w, I = Ee({
|
|
244
|
+
startRow: A,
|
|
245
245
|
endRow: M,
|
|
246
246
|
startColumn: N,
|
|
247
|
-
endColumn:
|
|
248
|
-
}),
|
|
249
|
-
|
|
247
|
+
endColumn: $
|
|
248
|
+
}), _ = `=${f}(${I})`;
|
|
249
|
+
h.push({
|
|
250
250
|
range: p,
|
|
251
251
|
primary: {
|
|
252
|
-
row:
|
|
253
|
-
column:
|
|
252
|
+
row: A,
|
|
253
|
+
column: k
|
|
254
254
|
},
|
|
255
|
-
formula:
|
|
255
|
+
formula: _
|
|
256
256
|
});
|
|
257
257
|
} else {
|
|
258
|
-
let
|
|
259
|
-
for (let
|
|
260
|
-
const
|
|
261
|
-
|
|
258
|
+
let k = -1;
|
|
259
|
+
for (let I = N; I <= w; I++) {
|
|
260
|
+
const _ = qs(d, I, M, i.getRowCount() - 1);
|
|
261
|
+
k = Math.max(k, _);
|
|
262
262
|
}
|
|
263
|
-
const
|
|
264
|
-
for (let
|
|
265
|
-
const
|
|
266
|
-
startRow:
|
|
267
|
-
endRow:
|
|
268
|
-
startColumn:
|
|
269
|
-
endColumn:
|
|
270
|
-
}),
|
|
271
|
-
|
|
263
|
+
const $ = k === M ? M - 1 : M;
|
|
264
|
+
for (let I = N; I <= w; I++) {
|
|
265
|
+
const _ = Ee({
|
|
266
|
+
startRow: A,
|
|
267
|
+
endRow: $,
|
|
268
|
+
startColumn: I,
|
|
269
|
+
endColumn: I
|
|
270
|
+
}), O = `=${f}(${_})`;
|
|
271
|
+
h.push({
|
|
272
272
|
range: p,
|
|
273
273
|
primary: {
|
|
274
|
-
row:
|
|
275
|
-
column:
|
|
274
|
+
row: k,
|
|
275
|
+
column: I
|
|
276
276
|
},
|
|
277
|
-
formula:
|
|
277
|
+
formula: O
|
|
278
278
|
});
|
|
279
279
|
}
|
|
280
280
|
}
|
|
@@ -282,41 +282,41 @@ const Vs = {
|
|
|
282
282
|
return !1;
|
|
283
283
|
});
|
|
284
284
|
if (l) {
|
|
285
|
-
const E =
|
|
285
|
+
const E = rs(S, v, i), p = {
|
|
286
286
|
range: hn.clone(l),
|
|
287
287
|
primary: {
|
|
288
288
|
startRow: E.startRow,
|
|
289
289
|
startColumn: E.startColumn,
|
|
290
290
|
endRow: E.endRow,
|
|
291
291
|
endColumn: E.endColumn,
|
|
292
|
-
actualRow:
|
|
293
|
-
actualColumn:
|
|
292
|
+
actualRow: S,
|
|
293
|
+
actualColumn: v,
|
|
294
294
|
isMerged: E.isMerged,
|
|
295
|
-
isMergedMainCell: E.startRow ===
|
|
295
|
+
isMergedMainCell: E.startRow === S && E.startColumn === v
|
|
296
296
|
}
|
|
297
297
|
}, b = {
|
|
298
298
|
unitId: c,
|
|
299
299
|
subUnitId: a,
|
|
300
300
|
selections: [p]
|
|
301
301
|
};
|
|
302
|
-
await m.executeCommand(
|
|
303
|
-
const
|
|
304
|
-
m.syncExecuteCommand(
|
|
302
|
+
await m.executeCommand(_n.id, b);
|
|
303
|
+
const T = o.getEditor(fn), F = o.getEditor(sr);
|
|
304
|
+
m.syncExecuteCommand(ur.id, {
|
|
305
305
|
visible: !0,
|
|
306
306
|
unitId: c,
|
|
307
307
|
eventType: xe.Dblclick
|
|
308
308
|
});
|
|
309
|
-
const
|
|
310
|
-
|
|
309
|
+
const A = `=${f}(${g}`;
|
|
310
|
+
T == null || T.replaceText(A), F == null || F.replaceText(A, !1);
|
|
311
311
|
}
|
|
312
|
-
return
|
|
313
|
-
list:
|
|
314
|
-
listOfRangeHasNumber:
|
|
312
|
+
return u.length === 0 && h.length === 0 ? !1 : m.executeCommand(gs.id, {
|
|
313
|
+
list: u,
|
|
314
|
+
listOfRangeHasNumber: h
|
|
315
315
|
});
|
|
316
316
|
}
|
|
317
317
|
};
|
|
318
|
-
function
|
|
319
|
-
const o =
|
|
318
|
+
function Xn(e, t, n) {
|
|
319
|
+
const o = Us(e, t, n);
|
|
320
320
|
if (o !== t)
|
|
321
321
|
return {
|
|
322
322
|
startRow: o,
|
|
@@ -324,7 +324,7 @@ function Qn(e, t, n) {
|
|
|
324
324
|
startColumn: n,
|
|
325
325
|
endColumn: n
|
|
326
326
|
};
|
|
327
|
-
const r =
|
|
327
|
+
const r = Vs(e, t, n);
|
|
328
328
|
return r !== n ? {
|
|
329
329
|
startRow: t,
|
|
330
330
|
endRow: t,
|
|
@@ -332,7 +332,7 @@ function Qn(e, t, n) {
|
|
|
332
332
|
endColumn: n - 1
|
|
333
333
|
} : null;
|
|
334
334
|
}
|
|
335
|
-
function
|
|
335
|
+
function Us(e, t, n) {
|
|
336
336
|
let o = !1;
|
|
337
337
|
if (t === 0) return t;
|
|
338
338
|
for (let r = t - 1; r >= 0; r--) {
|
|
@@ -349,7 +349,7 @@ function Ws(e, t, n) {
|
|
|
349
349
|
}
|
|
350
350
|
return t;
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function Vs(e, t, n) {
|
|
353
353
|
let o = !1;
|
|
354
354
|
if (n === 0) return n;
|
|
355
355
|
for (let r = n - 1; r >= 0; r--) {
|
|
@@ -371,54 +371,54 @@ function Rt(e) {
|
|
|
371
371
|
const t = e == null ? void 0 : e.p.body;
|
|
372
372
|
if (t == null)
|
|
373
373
|
return !1;
|
|
374
|
-
const n = t.dataStream, r = n.substring(n.length - 2, n.length) ===
|
|
375
|
-
return
|
|
374
|
+
const n = t.dataStream, r = n.substring(n.length - 2, n.length) === ir ? n.substring(0, n.length - 2) : n;
|
|
375
|
+
return eo(r);
|
|
376
376
|
}
|
|
377
|
-
return e && (e.t ===
|
|
377
|
+
return e && (e.t === Ln.NUMBER || to(e) === Ln.NUMBER);
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function Ws(e) {
|
|
380
380
|
return e.startRow === e.endRow && e.startColumn === e.endColumn;
|
|
381
381
|
}
|
|
382
|
-
function
|
|
382
|
+
function Hs(e) {
|
|
383
383
|
return e.startRow !== e.endRow && e.startColumn !== e.endColumn;
|
|
384
384
|
}
|
|
385
|
-
function
|
|
385
|
+
function Qn(e, t) {
|
|
386
386
|
for (let n = t.startRow; n <= t.endRow; n++)
|
|
387
387
|
for (let o = t.startColumn; o <= t.endColumn; o++)
|
|
388
388
|
if (Rt(e.getValue(n, o)))
|
|
389
389
|
return !1;
|
|
390
390
|
return !0;
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function Bs(e, t, n, o) {
|
|
393
393
|
for (let r = n; r <= o; r++)
|
|
394
394
|
if (!e.getValue(t, r))
|
|
395
395
|
return r;
|
|
396
396
|
return o;
|
|
397
397
|
}
|
|
398
|
-
function
|
|
398
|
+
function qs(e, t, n, o) {
|
|
399
399
|
for (let r = n; r <= o; r++)
|
|
400
400
|
if (!e.getValue(r, t))
|
|
401
401
|
return r;
|
|
402
402
|
return o;
|
|
403
403
|
}
|
|
404
|
-
const
|
|
404
|
+
const Or = "SHEET_FORMULA_UI_PLUGIN", Nr = `${Or}_MORE_FUNCTIONS_COMPONENT`, Tn = {
|
|
405
405
|
id: "formula-ui.operation.more-functions",
|
|
406
406
|
type: be.OPERATION,
|
|
407
|
-
handler: async (e) => (e.get(
|
|
407
|
+
handler: async (e) => (e.get(In).open({
|
|
408
408
|
header: { title: "formula.insert.tooltip" },
|
|
409
|
-
children: { label:
|
|
409
|
+
children: { label: Nr }
|
|
410
410
|
}), !0)
|
|
411
|
-
},
|
|
411
|
+
}, Mr = {
|
|
412
412
|
id: "formula-ui.operation.change-ref-to-absolute",
|
|
413
413
|
type: be.OPERATION,
|
|
414
414
|
handler: async (e) => !0
|
|
415
|
-
},
|
|
415
|
+
}, js = {
|
|
416
416
|
id: "formula-ui.operation.search-function",
|
|
417
417
|
type: be.OPERATION,
|
|
418
418
|
handler: async (e, t) => (e.get(Xt).search(t), !0)
|
|
419
419
|
};
|
|
420
|
-
var
|
|
421
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
420
|
+
var Ks = Object.getOwnPropertyDescriptor, Ys = (e, t, n, o) => {
|
|
421
|
+
for (var r = o > 1 ? void 0 : o ? Ks(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
422
422
|
(i = e[s]) && (r = i(r) || r);
|
|
423
423
|
return r;
|
|
424
424
|
}, At = (e, t) => (n, o) => t(n, o, e);
|
|
@@ -428,7 +428,7 @@ let Ut = class extends Ze {
|
|
|
428
428
|
}
|
|
429
429
|
_initialize() {
|
|
430
430
|
this.disposeWithMe(this._sheetInterceptorService.interceptCommand({
|
|
431
|
-
getMutations: (e) => e.id ===
|
|
431
|
+
getMutations: (e) => e.id === os.id ? this._reorderFormula(e.params) : {
|
|
432
432
|
redos: [],
|
|
433
433
|
undos: []
|
|
434
434
|
}
|
|
@@ -441,24 +441,24 @@ let Ut = class extends Ze {
|
|
|
441
441
|
redos: t,
|
|
442
442
|
undos: n
|
|
443
443
|
};
|
|
444
|
-
const
|
|
445
|
-
let
|
|
446
|
-
return
|
|
447
|
-
let
|
|
448
|
-
i.hasOwnProperty(
|
|
449
|
-
const
|
|
450
|
-
if (
|
|
451
|
-
|
|
452
|
-
const g = this._formulaDataModel.getFormulaStringByCell(
|
|
444
|
+
const d = a.getCellMatrix(), f = new Fe(), m = new Fe();
|
|
445
|
+
let u = !1;
|
|
446
|
+
return no.foreach(s, (h, l) => {
|
|
447
|
+
let S = h;
|
|
448
|
+
i.hasOwnProperty(h) && (S = i[h]);
|
|
449
|
+
const v = d.getValue(S, l);
|
|
450
|
+
if (v != null && v.f || v != null && v.si) {
|
|
451
|
+
u = !0;
|
|
452
|
+
const g = this._formulaDataModel.getFormulaStringByCell(S, l, r, o), C = this._lexerTreeBuilder.moveFormulaRefOffset(
|
|
453
453
|
g,
|
|
454
454
|
0,
|
|
455
|
-
|
|
456
|
-
),
|
|
457
|
-
|
|
455
|
+
h - S
|
|
456
|
+
), R = gn.deepClone(v);
|
|
457
|
+
R.f = C, R.si = null, f.setValue(h, l, R);
|
|
458
458
|
} else
|
|
459
|
-
f.setValue(
|
|
460
|
-
m.setValue(
|
|
461
|
-
}),
|
|
459
|
+
f.setValue(h, l, v);
|
|
460
|
+
m.setValue(h, l, d.getValue(h, l));
|
|
461
|
+
}), u ? (t.push({
|
|
462
462
|
id: Lt.id,
|
|
463
463
|
params: {
|
|
464
464
|
unitId: o,
|
|
@@ -481,19 +481,19 @@ let Ut = class extends Ze {
|
|
|
481
481
|
};
|
|
482
482
|
}
|
|
483
483
|
};
|
|
484
|
-
Ut =
|
|
485
|
-
At(0, q(
|
|
486
|
-
At(1, q(
|
|
484
|
+
Ut = Ys([
|
|
485
|
+
At(0, q(Rn)),
|
|
486
|
+
At(1, q(ne)),
|
|
487
487
|
At(2, q(Tt)),
|
|
488
488
|
At(3, q(ye))
|
|
489
489
|
], Ut);
|
|
490
|
-
const
|
|
491
|
-
var
|
|
492
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
490
|
+
const xr = "sheets-formula-ui.base.config", Jn = {};
|
|
491
|
+
var Gs = Object.getOwnPropertyDescriptor, Zs = (e, t, n, o) => {
|
|
492
|
+
for (var r = o > 1 ? void 0 : o ? Gs(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
493
493
|
(i = e[s]) && (r = i(r) || r);
|
|
494
494
|
return r;
|
|
495
495
|
}, St = (e, t) => (n, o) => t(n, o, e);
|
|
496
|
-
const nn = "SHEET_FORMULA_ALERT",
|
|
496
|
+
const nn = "SHEET_FORMULA_ALERT", zs = {
|
|
497
497
|
[ue.DIV_BY_ZERO]: "divByZero",
|
|
498
498
|
[ue.NAME]: "name",
|
|
499
499
|
[ue.VALUE]: "value",
|
|
@@ -515,27 +515,27 @@ let an = class extends Ze {
|
|
|
515
515
|
this._initCellAlertPopup(), this._initZenService();
|
|
516
516
|
}
|
|
517
517
|
_initCellAlertPopup() {
|
|
518
|
-
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(
|
|
518
|
+
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(vn(100)).subscribe((e) => {
|
|
519
519
|
var t, n, o, r, s;
|
|
520
520
|
if (e) {
|
|
521
521
|
const c = this._context.unit.getActiveSheet();
|
|
522
522
|
if (!c) return this._hideAlert();
|
|
523
|
-
const a = c.getCell(e.location.row, e.location.col),
|
|
524
|
-
if (
|
|
525
|
-
const f =
|
|
523
|
+
const a = c.getCell(e.location.row, e.location.col), d = (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];
|
|
524
|
+
if (ro(a)) {
|
|
525
|
+
const f = gr(a, !!d);
|
|
526
526
|
if (!f) {
|
|
527
527
|
this._hideAlert();
|
|
528
528
|
return;
|
|
529
529
|
}
|
|
530
|
-
const m = this._cellAlertManagerService.currentAlert.get(nn),
|
|
531
|
-
if (
|
|
530
|
+
const m = this._cellAlertManagerService.currentAlert.get(nn), u = (s = m == null ? void 0 : m.alert) == null ? void 0 : s.location;
|
|
531
|
+
if (u && u.row === e.location.row && u.col === e.location.col && u.subUnitId === e.location.subUnitId && u.unitId === e.location.unitId) {
|
|
532
532
|
this._hideAlert();
|
|
533
533
|
return;
|
|
534
534
|
}
|
|
535
535
|
this._cellAlertManagerService.showAlert({
|
|
536
|
-
type:
|
|
536
|
+
type: Ro.ERROR,
|
|
537
537
|
title: this._localeService.t("formula.error.title"),
|
|
538
|
-
message: this._localeService.t(`formula.error.${
|
|
538
|
+
message: this._localeService.t(`formula.error.${zs[f]}`),
|
|
539
539
|
location: e.location,
|
|
540
540
|
width: 200,
|
|
541
541
|
height: 74,
|
|
@@ -556,30 +556,30 @@ let an = class extends Ze {
|
|
|
556
556
|
this._cellAlertManagerService.removeAlert(nn);
|
|
557
557
|
}
|
|
558
558
|
};
|
|
559
|
-
an =
|
|
560
|
-
St(1, q(
|
|
561
|
-
St(2, q(
|
|
559
|
+
an = Zs([
|
|
560
|
+
St(1, q(Co)),
|
|
561
|
+
St(2, q(_o)),
|
|
562
562
|
St(3, q(dt)),
|
|
563
563
|
St(4, q(Tt)),
|
|
564
|
-
St(5,
|
|
564
|
+
St(5, _s)
|
|
565
565
|
], an);
|
|
566
|
-
var
|
|
567
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
566
|
+
var Xs = Object.getOwnPropertyDescriptor, Qs = (e, t, n, o) => {
|
|
567
|
+
for (var r = o > 1 ? void 0 : o ? Xs(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
568
568
|
(i = e[s]) && (r = i(r) || r);
|
|
569
569
|
return r;
|
|
570
|
-
},
|
|
570
|
+
}, er = (e, t) => (n, o) => t(n, o, e);
|
|
571
571
|
let Vt = class extends Ze {
|
|
572
572
|
constructor(e, t) {
|
|
573
573
|
super(), this._autoFillService = e, this._lexerTreeBuilder = t, this._registerAutoFill();
|
|
574
574
|
}
|
|
575
575
|
_registerAutoFill() {
|
|
576
576
|
const e = {
|
|
577
|
-
type:
|
|
577
|
+
type: Un.FORMULA,
|
|
578
578
|
priority: 1001,
|
|
579
579
|
match: (t) => Ce(t == null ? void 0 : t.f) || De(t == null ? void 0 : t.si),
|
|
580
|
-
isContinue: (t, n) => t.type ===
|
|
580
|
+
isContinue: (t, n) => t.type === Un.FORMULA,
|
|
581
581
|
applyFunctions: {
|
|
582
|
-
[
|
|
582
|
+
[Eo.COPY]: (t, n, o, r, s) => {
|
|
583
583
|
const { data: i, index: c } = t;
|
|
584
584
|
return this._fillCopyFormula(i, n, o, c, r, s);
|
|
585
585
|
}
|
|
@@ -588,26 +588,26 @@ let Vt = class extends Ze {
|
|
|
588
588
|
this._autoFillService.registerRule(e);
|
|
589
589
|
}
|
|
590
590
|
_fillCopyFormula(e, t, n, o, r, s) {
|
|
591
|
-
var
|
|
592
|
-
const i =
|
|
591
|
+
var d, f;
|
|
592
|
+
const i = ei(r), c = [], a = /* @__PURE__ */ new Map();
|
|
593
593
|
for (let m = 1; m <= t; m++) {
|
|
594
|
-
const
|
|
594
|
+
const u = (m - 1) % e.length, h = o[u], l = gn.deepClone(e[u]);
|
|
595
595
|
if (l) {
|
|
596
|
-
const
|
|
597
|
-
if (De(
|
|
598
|
-
l.si =
|
|
596
|
+
const S = ((d = e[u]) == null ? void 0 : d.f) || "", v = ((f = e[u]) == null ? void 0 : f.si) || "", g = Ce(S);
|
|
597
|
+
if (De(v))
|
|
598
|
+
l.si = v, l.f = null, l.v = null, l.p = null, l.t = null, c.push(l);
|
|
599
599
|
else if (g) {
|
|
600
|
-
let
|
|
601
|
-
if (
|
|
602
|
-
l.si =
|
|
600
|
+
let R = a.get(u);
|
|
601
|
+
if (R)
|
|
602
|
+
l.si = R, l.f = null, l.v = null, l.p = null, l.t = null;
|
|
603
603
|
else {
|
|
604
|
-
|
|
605
|
-
const { offsetX: E, offsetY: p } =
|
|
606
|
-
|
|
604
|
+
R = Yt(6), a.set(u, R);
|
|
605
|
+
const { offsetX: E, offsetY: p } = Js(i, t, n, s, h), b = this._lexerTreeBuilder.moveFormulaRefOffset(
|
|
606
|
+
S,
|
|
607
607
|
E,
|
|
608
608
|
p
|
|
609
609
|
);
|
|
610
|
-
l.si =
|
|
610
|
+
l.si = R, l.f = b, l.v = null, l.p = null, l.t = null;
|
|
611
611
|
}
|
|
612
612
|
c.push(l);
|
|
613
613
|
}
|
|
@@ -616,30 +616,30 @@ let Vt = class extends Ze {
|
|
|
616
616
|
return c;
|
|
617
617
|
}
|
|
618
618
|
};
|
|
619
|
-
Vt =
|
|
620
|
-
|
|
621
|
-
|
|
619
|
+
Vt = Qs([
|
|
620
|
+
er(0, Io),
|
|
621
|
+
er(1, q(ye))
|
|
622
622
|
], Vt);
|
|
623
|
-
function
|
|
623
|
+
function Js(e, t, n, o, r) {
|
|
624
624
|
const { source: s, target: i } = o, { rows: c } = i, { rows: a } = s;
|
|
625
|
-
let
|
|
625
|
+
let d = 0, f = 0;
|
|
626
626
|
switch (n) {
|
|
627
627
|
case de.UP:
|
|
628
628
|
f = c[r] - a[r];
|
|
629
629
|
break;
|
|
630
630
|
case de.RIGHT:
|
|
631
|
-
|
|
631
|
+
d = e;
|
|
632
632
|
break;
|
|
633
633
|
case de.DOWN:
|
|
634
634
|
f = c[r] - a[r];
|
|
635
635
|
break;
|
|
636
636
|
case de.LEFT:
|
|
637
|
-
|
|
637
|
+
d = -e * t;
|
|
638
638
|
break;
|
|
639
639
|
}
|
|
640
|
-
return { offsetX:
|
|
640
|
+
return { offsetX: d, offsetY: f };
|
|
641
641
|
}
|
|
642
|
-
function
|
|
642
|
+
function ei(e) {
|
|
643
643
|
let t = 0;
|
|
644
644
|
for (const n in e)
|
|
645
645
|
e[n].forEach((o) => {
|
|
@@ -647,12 +647,12 @@ function ni(e) {
|
|
|
647
647
|
});
|
|
648
648
|
return t;
|
|
649
649
|
}
|
|
650
|
-
var
|
|
651
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
650
|
+
var ti = Object.getOwnPropertyDescriptor, ni = (e, t, n, o) => {
|
|
651
|
+
for (var r = o > 1 ? void 0 : o ? ti(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
652
652
|
(i = e[s]) && (r = i(r) || r);
|
|
653
653
|
return r;
|
|
654
654
|
}, vt = (e, t) => (n, o) => t(n, o, e);
|
|
655
|
-
const
|
|
655
|
+
const ri = "default-paste-formula";
|
|
656
656
|
let Wt = class extends Ze {
|
|
657
657
|
constructor(e, t, n, o, r) {
|
|
658
658
|
super(), this._univerInstanceService = e, this._lexerTreeBuilder = t, this._sheetClipboardService = n, this._injector = o, this._formulaDataModel = r, this._initialize();
|
|
@@ -667,7 +667,7 @@ let Wt = class extends Ze {
|
|
|
667
667
|
const e = this;
|
|
668
668
|
let t = null;
|
|
669
669
|
return {
|
|
670
|
-
id:
|
|
670
|
+
id: ar.SPECIAL_COPY_FORMULA_ONLY,
|
|
671
671
|
priority: 10,
|
|
672
672
|
onBeforeCopy(n, o) {
|
|
673
673
|
t = e._getWorksheet(n, o);
|
|
@@ -684,14 +684,14 @@ let Wt = class extends Ze {
|
|
|
684
684
|
const s = e._getWorksheet(n, o);
|
|
685
685
|
if (!s) return [];
|
|
686
686
|
const { startRow: i, endRow: c } = r, a = [];
|
|
687
|
-
for (let
|
|
688
|
-
s.getRowFiltered(
|
|
687
|
+
for (let d = i; d <= c; d++)
|
|
688
|
+
s.getRowFiltered(d) && a.push(d);
|
|
689
689
|
return a;
|
|
690
690
|
},
|
|
691
691
|
handleMatrixOnCell(n, o, r, s, i, c, a) {
|
|
692
|
-
const
|
|
693
|
-
if (t &&
|
|
694
|
-
const f = Ce(
|
|
692
|
+
const d = i.getValue(n, o);
|
|
693
|
+
if (t && d && (Ce(d.f) || De(d.si))) {
|
|
694
|
+
const f = Ce(d.f) ? d.f : e._formulaDataModel.getFormulaStringByCell(n, o, t.getSheetId(), t.getUnitId());
|
|
695
695
|
c.setValue(r, s, {
|
|
696
696
|
...mt(),
|
|
697
697
|
f
|
|
@@ -715,20 +715,20 @@ let Wt = class extends Ze {
|
|
|
715
715
|
}
|
|
716
716
|
_pasteWithFormulaHook() {
|
|
717
717
|
return {
|
|
718
|
-
id:
|
|
718
|
+
id: ri,
|
|
719
719
|
priority: 10,
|
|
720
720
|
onPasteCells: (e, t, n, o) => this._onPasteCells(e, t, n, o, !1)
|
|
721
721
|
};
|
|
722
722
|
}
|
|
723
723
|
_getWorkbook(e) {
|
|
724
|
-
return e ? this._univerInstanceService.getUnit(e,
|
|
724
|
+
return e ? this._univerInstanceService.getUnit(e, W.UNIVER_SHEET) : this._univerInstanceService.getCurrentUnitOfType(W.UNIVER_SHEET);
|
|
725
725
|
}
|
|
726
726
|
_getWorksheet(e, t) {
|
|
727
727
|
const n = this._getWorkbook(e);
|
|
728
728
|
return t ? n == null ? void 0 : n.getSheetBySheetId(t) : n == null ? void 0 : n.getActiveSheet();
|
|
729
729
|
}
|
|
730
730
|
_onPasteCells(e, t, n, o, r) {
|
|
731
|
-
var
|
|
731
|
+
var u;
|
|
732
732
|
if ([
|
|
733
733
|
lt.SPECIAL_PASTE_FORMAT,
|
|
734
734
|
lt.SPECIAL_PASTE_COL_WIDTH
|
|
@@ -737,23 +737,23 @@ let Wt = class extends Ze {
|
|
|
737
737
|
undos: [],
|
|
738
738
|
redos: []
|
|
739
739
|
};
|
|
740
|
-
const i = this._getWorkbook(), c = t.unitId || (i == null ? void 0 : i.getUnitId()), a = t.subUnitId || ((
|
|
740
|
+
const i = this._getWorkbook(), c = t.unitId || (i == null ? void 0 : i.getUnitId()), a = t.subUnitId || ((u = i == null ? void 0 : i.getActiveSheet()) == null ? void 0 : u.getSheetId());
|
|
741
741
|
if (!c || !a)
|
|
742
742
|
return {
|
|
743
743
|
undos: [],
|
|
744
744
|
redos: []
|
|
745
745
|
};
|
|
746
|
-
const
|
|
747
|
-
copyType: o.copyType ||
|
|
746
|
+
const d = t.range, f = n, m = {
|
|
747
|
+
copyType: o.copyType || dr.COPY,
|
|
748
748
|
copyRange: e == null ? void 0 : e.range,
|
|
749
749
|
pasteType: o.pasteType
|
|
750
750
|
};
|
|
751
|
-
return this._injector.invoke((
|
|
751
|
+
return this._injector.invoke((h) => oi(
|
|
752
752
|
c,
|
|
753
753
|
a,
|
|
754
|
-
|
|
754
|
+
d,
|
|
755
755
|
f,
|
|
756
|
-
|
|
756
|
+
h,
|
|
757
757
|
m,
|
|
758
758
|
this._lexerTreeBuilder,
|
|
759
759
|
this._formulaDataModel,
|
|
@@ -762,32 +762,32 @@ let Wt = class extends Ze {
|
|
|
762
762
|
));
|
|
763
763
|
}
|
|
764
764
|
};
|
|
765
|
-
Wt =
|
|
766
|
-
vt(0,
|
|
765
|
+
Wt = ni([
|
|
766
|
+
vt(0, ne),
|
|
767
767
|
vt(1, q(ye)),
|
|
768
|
-
vt(2,
|
|
768
|
+
vt(2, lr),
|
|
769
769
|
vt(3, q(It)),
|
|
770
770
|
vt(4, q(Tt))
|
|
771
771
|
], Wt);
|
|
772
|
-
function
|
|
773
|
-
const f = [], m = [],
|
|
774
|
-
if (!
|
|
772
|
+
function oi(e, t, n, o, r, s, i, c, a = !1, d) {
|
|
773
|
+
const f = [], m = [], u = si(e, t, n, o, s, i, c, d);
|
|
774
|
+
if (!u.hasValue())
|
|
775
775
|
return {
|
|
776
776
|
undos: [],
|
|
777
777
|
redos: []
|
|
778
778
|
};
|
|
779
|
-
const
|
|
779
|
+
const h = {
|
|
780
780
|
unitId: e,
|
|
781
781
|
subUnitId: t,
|
|
782
|
-
cellValue:
|
|
782
|
+
cellValue: u.getData()
|
|
783
783
|
};
|
|
784
784
|
f.push({
|
|
785
785
|
id: Lt.id,
|
|
786
|
-
params:
|
|
786
|
+
params: h
|
|
787
787
|
});
|
|
788
|
-
const l =
|
|
788
|
+
const l = ss(
|
|
789
789
|
r,
|
|
790
|
-
|
|
790
|
+
h
|
|
791
791
|
);
|
|
792
792
|
return m.push({
|
|
793
793
|
id: Lt.id,
|
|
@@ -797,77 +797,77 @@ function ii(e, t, n, o, r, s, i, c, a = !1, h) {
|
|
|
797
797
|
redos: f
|
|
798
798
|
};
|
|
799
799
|
}
|
|
800
|
-
function
|
|
801
|
-
return c ? r.pasteType === lt.SPECIAL_PASTE_VALUE ?
|
|
800
|
+
function si(e, t, n, o, r, s, i, c) {
|
|
801
|
+
return c ? r.pasteType === lt.SPECIAL_PASTE_VALUE ? ci(e, t, n, o, i, c) : r.pasteType === lt.SPECIAL_PASTE_FORMULA ? li(e, t, n, o, s, i, c) : ai(e, t, n, o, r.copyType, s, i, c) : ii(e, t, n, o, i);
|
|
802
802
|
}
|
|
803
|
-
function
|
|
803
|
+
function ii(e, t, n, o, r) {
|
|
804
804
|
const s = new Fe(), i = r.getSheetFormulaData(e, t);
|
|
805
|
-
return o.forValue((c, a,
|
|
806
|
-
var
|
|
807
|
-
const f = n.rows[c], m = n.cols[a],
|
|
808
|
-
Ce(
|
|
805
|
+
return o.forValue((c, a, d) => {
|
|
806
|
+
var h;
|
|
807
|
+
const f = n.rows[c], m = n.cols[a], u = {};
|
|
808
|
+
Ce(d.v) ? (u.v = null, u.f = `${d.v}`, u.si = null, u.p = null, s.setValue(f, m, u)) : (h = i == null ? void 0 : i[f]) != null && h[m] && (u.v = d.v, u.f = null, u.si = null, u.p = null, s.setValue(f, m, u));
|
|
809
809
|
}), s;
|
|
810
810
|
}
|
|
811
|
-
function
|
|
812
|
-
var
|
|
813
|
-
const i = new Fe(), c = (f = (
|
|
814
|
-
return o.forValue((m,
|
|
815
|
-
var
|
|
816
|
-
const l = s.range.rows[m % s.range.rows.length],
|
|
817
|
-
if (Ce(
|
|
818
|
-
C.v =
|
|
819
|
-
else if ((
|
|
820
|
-
const p = c[l][
|
|
821
|
-
C.v = p.v, C.f = null, C.si = null, C.p = null, i.setValue(
|
|
822
|
-
} else if ((E = a == null ? void 0 : a[
|
|
823
|
-
if (C.v =
|
|
824
|
-
const p =
|
|
811
|
+
function ci(e, t, n, o, r, s) {
|
|
812
|
+
var d, f;
|
|
813
|
+
const i = new Fe(), c = (f = (d = r.getArrayFormulaCellData()) == null ? void 0 : d[s.unitId]) == null ? void 0 : f[s.subUnitId], a = r.getSheetFormulaData(e, t);
|
|
814
|
+
return o.forValue((m, u, h) => {
|
|
815
|
+
var R, E;
|
|
816
|
+
const l = s.range.rows[m % s.range.rows.length], S = s.range.cols[u % s.range.cols.length], v = n.rows[m], g = n.cols[u], C = {};
|
|
817
|
+
if (Ce(h.f) || De(h.si))
|
|
818
|
+
C.v = h.v, C.f = null, C.si = null, C.p = null, i.setValue(v, g, C);
|
|
819
|
+
else if ((R = c == null ? void 0 : c[l]) != null && R[S]) {
|
|
820
|
+
const p = c[l][S];
|
|
821
|
+
C.v = p.v, C.f = null, C.si = null, C.p = null, i.setValue(v, g, C);
|
|
822
|
+
} else if ((E = a == null ? void 0 : a[v]) != null && E[g]) {
|
|
823
|
+
if (C.v = h.v, C.f = null, C.si = null, C.p = null, h.p) {
|
|
824
|
+
const p = wr(h);
|
|
825
825
|
p && (C.v = p);
|
|
826
826
|
}
|
|
827
|
-
i.setValue(
|
|
827
|
+
i.setValue(v, g, C);
|
|
828
828
|
}
|
|
829
829
|
}), i;
|
|
830
830
|
}
|
|
831
|
-
function
|
|
831
|
+
function li(e, t, n, o, r, s, i) {
|
|
832
832
|
const c = new Fe(), a = /* @__PURE__ */ new Map();
|
|
833
|
-
return o.forValue((
|
|
834
|
-
const
|
|
833
|
+
return o.forValue((d, f, m) => {
|
|
834
|
+
const u = n.rows[d], h = n.cols[f], l = {};
|
|
835
835
|
if (De(m.si)) {
|
|
836
836
|
if (i.unitId !== e || i.subUnitId !== t) {
|
|
837
|
-
const
|
|
838
|
-
i.range.rows[
|
|
837
|
+
const S = s.getFormulaStringByCell(
|
|
838
|
+
i.range.rows[d % i.range.rows.length],
|
|
839
839
|
i.range.cols[f % i.range.cols.length],
|
|
840
840
|
i.subUnitId,
|
|
841
841
|
i.unitId
|
|
842
|
-
),
|
|
842
|
+
), v = n.cols[f] - i.range.cols[f % i.range.cols.length], g = n.rows[d] - i.range.rows[d % i.range.rows.length], C = r.moveFormulaRefOffset(S || "", v, g);
|
|
843
843
|
l.si = null, l.f = C;
|
|
844
844
|
} else
|
|
845
845
|
l.si = m.si, l.f = null;
|
|
846
|
-
l.v = null, l.p = null, c.setValue(
|
|
846
|
+
l.v = null, l.p = null, c.setValue(u, h, l);
|
|
847
847
|
} else if (Ce(m.f)) {
|
|
848
|
-
const
|
|
849
|
-
let
|
|
850
|
-
if (
|
|
851
|
-
l.si =
|
|
848
|
+
const S = `${d % i.range.rows.length}_${f % i.range.cols.length}`;
|
|
849
|
+
let v = a.get(S);
|
|
850
|
+
if (v)
|
|
851
|
+
l.si = v, l.f = null;
|
|
852
852
|
else {
|
|
853
|
-
|
|
854
|
-
const g = n.cols[f] - i.range.cols[f % i.range.cols.length], C = n.rows[
|
|
855
|
-
l.si =
|
|
853
|
+
v = Yt(6), a.set(S, v);
|
|
854
|
+
const g = n.cols[f] - i.range.cols[f % i.range.cols.length], C = n.rows[d] - i.range.rows[d % i.range.rows.length], R = r.moveFormulaRefOffset(m.f || "", g, C);
|
|
855
|
+
l.si = v, l.f = R;
|
|
856
856
|
}
|
|
857
|
-
l.v = null, l.p = null, c.setValue(
|
|
857
|
+
l.v = null, l.p = null, c.setValue(u, h, l);
|
|
858
858
|
} else {
|
|
859
859
|
if (l.v = m.v, l.f = null, l.si = null, l.p = null, m.p) {
|
|
860
|
-
const
|
|
861
|
-
|
|
860
|
+
const S = wr(m);
|
|
861
|
+
S && (l.v = S);
|
|
862
862
|
}
|
|
863
|
-
c.setValue(
|
|
863
|
+
c.setValue(u, h, l);
|
|
864
864
|
}
|
|
865
865
|
}), c;
|
|
866
866
|
}
|
|
867
|
-
function
|
|
868
|
-
const a = new Fe(),
|
|
869
|
-
return r ===
|
|
870
|
-
const
|
|
867
|
+
function ai(e, t, n, o, r, s, i, c) {
|
|
868
|
+
const a = new Fe(), d = /* @__PURE__ */ new Map(), f = i.getSheetFormulaData(e, t), m = [];
|
|
869
|
+
return r === dr.CUT ? o.forValue((u, h, l) => {
|
|
870
|
+
const S = n.rows[u], v = n.cols[h], g = {};
|
|
871
871
|
if (De(l.si)) {
|
|
872
872
|
if (Ce(l.f))
|
|
873
873
|
m.push(l.si), g.f = l.f, g.si = l.si;
|
|
@@ -875,52 +875,52 @@ function di(e, t, n, o, r, s, i, c) {
|
|
|
875
875
|
g.f = null, g.si = l.si;
|
|
876
876
|
else {
|
|
877
877
|
const C = i.getFormulaStringByCell(
|
|
878
|
-
c.range.rows[
|
|
879
|
-
c.range.cols[
|
|
878
|
+
c.range.rows[u % c.range.rows.length],
|
|
879
|
+
c.range.cols[h % c.range.cols.length],
|
|
880
880
|
c.subUnitId,
|
|
881
881
|
c.unitId
|
|
882
882
|
);
|
|
883
883
|
g.f = C, g.si = null;
|
|
884
884
|
}
|
|
885
|
-
g.v = null, g.p = null, a.setValue(
|
|
886
|
-
} else Ce(l.f) && (g.f = l.f, g.si = null, g.v = null, g.p = null, a.setValue(
|
|
887
|
-
}) : o.forValue((
|
|
885
|
+
g.v = null, g.p = null, a.setValue(S, v, g);
|
|
886
|
+
} else Ce(l.f) && (g.f = l.f, g.si = null, g.v = null, g.p = null, a.setValue(S, v, g));
|
|
887
|
+
}) : o.forValue((u, h, l) => {
|
|
888
888
|
var C;
|
|
889
|
-
const
|
|
889
|
+
const S = n.rows[u], v = n.cols[h], g = {};
|
|
890
890
|
if (De(l.si)) {
|
|
891
891
|
if (c.unitId !== e || c.subUnitId !== t) {
|
|
892
|
-
const
|
|
893
|
-
c.range.rows[
|
|
894
|
-
c.range.cols[
|
|
892
|
+
const R = i.getFormulaStringByCell(
|
|
893
|
+
c.range.rows[u % c.range.rows.length],
|
|
894
|
+
c.range.cols[h % c.range.cols.length],
|
|
895
895
|
c.subUnitId,
|
|
896
896
|
c.unitId
|
|
897
|
-
), E = n.cols[
|
|
897
|
+
), E = n.cols[h] - c.range.cols[h % c.range.cols.length], p = n.rows[u] - c.range.rows[u % c.range.rows.length], b = s.moveFormulaRefOffset(R || "", E, p);
|
|
898
898
|
g.si = null, g.f = b;
|
|
899
899
|
} else
|
|
900
900
|
g.si = l.si, g.f = null;
|
|
901
|
-
g.v = null, g.p = null, a.setValue(
|
|
901
|
+
g.v = null, g.p = null, a.setValue(S, v, g);
|
|
902
902
|
} else if (Ce(l.f)) {
|
|
903
|
-
const
|
|
904
|
-
let E =
|
|
903
|
+
const R = `${u % c.range.rows.length}_${h % c.range.cols.length}`;
|
|
904
|
+
let E = d.get(R);
|
|
905
905
|
if (E)
|
|
906
906
|
g.si = E, g.f = null;
|
|
907
907
|
else {
|
|
908
|
-
E = Yt(6),
|
|
909
|
-
const p = n.cols[
|
|
910
|
-
g.si = E, g.f =
|
|
908
|
+
E = Yt(6), d.set(R, E);
|
|
909
|
+
const p = n.cols[h] - c.range.cols[h % c.range.cols.length], b = n.rows[u] - c.range.rows[u % c.range.rows.length], T = s.moveFormulaRefOffset(l.f || "", p, b);
|
|
910
|
+
g.si = E, g.f = T;
|
|
911
911
|
}
|
|
912
|
-
g.v = null, g.p = null, a.setValue(
|
|
913
|
-
} else (C = f == null ? void 0 : f[
|
|
914
|
-
}), m.length > 0 && new Fe(f).forValue((
|
|
915
|
-
if (!(c.range.rows.includes(
|
|
916
|
-
const
|
|
917
|
-
d,
|
|
912
|
+
g.v = null, g.p = null, a.setValue(S, v, g);
|
|
913
|
+
} else (C = f == null ? void 0 : f[S]) != null && C[v] && (g.v = l.v, g.f = null, g.si = null, g.p = l.p, a.setValue(S, v, g));
|
|
914
|
+
}), m.length > 0 && new Fe(f).forValue((u, h, l) => {
|
|
915
|
+
if (!(c.range.rows.includes(u) && c.range.cols.includes(h)) && !(n.rows.includes(u) && n.cols.includes(h)) && m.includes(l == null ? void 0 : l.si)) {
|
|
916
|
+
const S = i.getFormulaStringByCell(
|
|
918
917
|
u,
|
|
918
|
+
h,
|
|
919
919
|
c.subUnitId,
|
|
920
920
|
c.unitId
|
|
921
921
|
);
|
|
922
|
-
a.setValue(
|
|
923
|
-
f:
|
|
922
|
+
a.setValue(u, h, {
|
|
923
|
+
f: S,
|
|
924
924
|
si: null,
|
|
925
925
|
v: null,
|
|
926
926
|
p: null
|
|
@@ -928,17 +928,17 @@ function di(e, t, n, o, r, s, i, c) {
|
|
|
928
928
|
}
|
|
929
929
|
}), a;
|
|
930
930
|
}
|
|
931
|
-
function
|
|
931
|
+
function wr(e) {
|
|
932
932
|
if (e != null && e.p) {
|
|
933
933
|
const t = e == null ? void 0 : e.p.body;
|
|
934
934
|
if (t == null)
|
|
935
935
|
return;
|
|
936
936
|
const n = t.dataStream;
|
|
937
|
-
return n.substring(n.length - 2, n.length) ===
|
|
937
|
+
return n.substring(n.length - 2, n.length) === ir ? n.substring(0, n.length - 2) : n;
|
|
938
938
|
}
|
|
939
939
|
}
|
|
940
|
-
var
|
|
941
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
940
|
+
var ui = Object.getOwnPropertyDescriptor, di = (e, t, n, o) => {
|
|
941
|
+
for (var r = o > 1 ? void 0 : o ? ui(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
942
942
|
(i = e[s]) && (r = i(r) || r);
|
|
943
943
|
return r;
|
|
944
944
|
}, je = (e, t) => (n, o) => t(n, o, e);
|
|
@@ -972,19 +972,19 @@ let Ht = class extends Ze {
|
|
|
972
972
|
}
|
|
973
973
|
_initInterceptorEditorStart() {
|
|
974
974
|
this.disposeWithMe(
|
|
975
|
-
|
|
976
|
-
this._sheetInterceptorService.writeCellInterceptor.intercept(
|
|
975
|
+
cr(
|
|
976
|
+
this._sheetInterceptorService.writeCellInterceptor.intercept(is, {
|
|
977
977
|
handler: (t, n, o) => {
|
|
978
|
-
var l,
|
|
979
|
-
const { row: r, col: s, unitId: i, subUnitId: c, worksheet: a } = n,
|
|
978
|
+
var l, S, v, g;
|
|
979
|
+
const { row: r, col: s, unitId: i, subUnitId: c, worksheet: a } = n, d = this._formulaDataModel.getArrayFormulaRange(), f = this._formulaDataModel.getArrayFormulaCellData();
|
|
980
980
|
if (this._removeArrayFormulaRangeShape(), t == null)
|
|
981
981
|
return o(t);
|
|
982
982
|
let m = null;
|
|
983
|
-
const
|
|
984
|
-
if (
|
|
983
|
+
const u = this._formulaDataModel.getFormulaStringByCell(r, s, c, i);
|
|
984
|
+
if (u !== null && (m = { f: u }), t.v != null && t.v !== "" && ((v = (S = (l = f[i]) == null ? void 0 : l[c]) == null ? void 0 : S[r]) == null ? void 0 : v[s]) == null)
|
|
985
985
|
return m ? { ...t, ...m } : o(t);
|
|
986
|
-
const
|
|
987
|
-
return
|
|
986
|
+
const h = (g = d == null ? void 0 : d[i]) == null ? void 0 : g[c];
|
|
987
|
+
return h != null && (m = this._displayArrayFormulaRangeShape(h, r, s, i, c, a, m)), m ? { ...t, ...m } : o(t);
|
|
988
988
|
}
|
|
989
989
|
})
|
|
990
990
|
)
|
|
@@ -992,10 +992,10 @@ let Ht = class extends Ze {
|
|
|
992
992
|
}
|
|
993
993
|
_commandExecutedListener() {
|
|
994
994
|
this.disposeWithMe(this._commandService.onCommandExecuted((t, n) => {
|
|
995
|
-
(t.id ===
|
|
995
|
+
(t.id === Po.id || t.id === Uo.id && n && n.remove) && this._removeArrayFormulaRangeShape();
|
|
996
996
|
})), this.disposeWithMe(
|
|
997
997
|
this._commandService.beforeCommandExecuted((t) => {
|
|
998
|
-
|
|
998
|
+
cs.id === t.id && requestIdleCallback(() => {
|
|
999
999
|
const n = t.params, { unitId: o, subUnitId: r, rowsAutoHeightInfo: s } = n;
|
|
1000
1000
|
this._refreshArrayFormulaRangeShapeByRow(o, r, s);
|
|
1001
1001
|
});
|
|
@@ -1003,16 +1003,16 @@ let Ht = class extends Ze {
|
|
|
1003
1003
|
);
|
|
1004
1004
|
}
|
|
1005
1005
|
_displayArrayFormulaRangeShape(t, n, o, r, s, i, c) {
|
|
1006
|
-
return new Fe(t).forValue((a,
|
|
1006
|
+
return new Fe(t).forValue((a, d, f) => {
|
|
1007
1007
|
if (f == null)
|
|
1008
1008
|
return !0;
|
|
1009
|
-
const { startRow: m, startColumn:
|
|
1010
|
-
if (a === n &&
|
|
1009
|
+
const { startRow: m, startColumn: u, endRow: h, endColumn: l } = f;
|
|
1010
|
+
if (a === n && d === o)
|
|
1011
1011
|
return this._createArrayFormulaRangeShape(f, r), !1;
|
|
1012
|
-
if (n >= m && n <=
|
|
1013
|
-
const
|
|
1014
|
-
return (
|
|
1015
|
-
f:
|
|
1012
|
+
if (n >= m && n <= h && o >= u && o <= l) {
|
|
1013
|
+
const S = i.getCell(m, u);
|
|
1014
|
+
return (S == null ? void 0 : S.v) === ue.SPILL || (S == null ? void 0 : S.f) == null ? void 0 : (c == null && (c = {
|
|
1015
|
+
f: S.f,
|
|
1016
1016
|
isInArrayFormulaRange: !0
|
|
1017
1017
|
}), this._createArrayFormulaRangeShape(f, r), !1);
|
|
1018
1018
|
}
|
|
@@ -1032,10 +1032,10 @@ let Ht = class extends Ze {
|
|
|
1032
1032
|
fill: new mn(this._themeService.getColorFromTheme("white")).setAlpha(0).toString(),
|
|
1033
1033
|
widgets: {}
|
|
1034
1034
|
}
|
|
1035
|
-
}, c = sn(i, r), { rowHeaderWidth: a, columnHeaderHeight:
|
|
1035
|
+
}, c = sn(i, r), { rowHeaderWidth: a, columnHeaderHeight: d } = r, f = new hr(s, bo.FORMULA_EDITOR_SHOW, this._themeService, {
|
|
1036
1036
|
highlightHeader: !1,
|
|
1037
1037
|
rowHeaderWidth: a,
|
|
1038
|
-
columnHeaderHeight:
|
|
1038
|
+
columnHeaderHeight: d
|
|
1039
1039
|
});
|
|
1040
1040
|
f.updateRangeBySelectionWithCoord(c), f.setEvent(!1), this._previousShape = f;
|
|
1041
1041
|
}
|
|
@@ -1061,8 +1061,8 @@ let Ht = class extends Ze {
|
|
|
1061
1061
|
if (!this._checkCurrentSheet(t, n) || !this._previousShape) return;
|
|
1062
1062
|
const { startRow: r, endRow: s, startColumn: i, endColumn: c } = this._previousShape.getRange();
|
|
1063
1063
|
for (let a = 0; a < o.length; a++) {
|
|
1064
|
-
const { row:
|
|
1065
|
-
if (r >=
|
|
1064
|
+
const { row: d } = o[a];
|
|
1065
|
+
if (r >= d) {
|
|
1066
1066
|
const f = {
|
|
1067
1067
|
startRow: r,
|
|
1068
1068
|
endRow: s,
|
|
@@ -1075,38 +1075,38 @@ let Ht = class extends Ze {
|
|
|
1075
1075
|
}
|
|
1076
1076
|
}
|
|
1077
1077
|
};
|
|
1078
|
-
Ht =
|
|
1079
|
-
je(1, q(
|
|
1078
|
+
Ht = di([
|
|
1079
|
+
je(1, q(Rn)),
|
|
1080
1080
|
je(2, q(Tt)),
|
|
1081
1081
|
je(3, q(Et)),
|
|
1082
1082
|
je(4, Te),
|
|
1083
1083
|
je(5, q(bt)),
|
|
1084
1084
|
je(6, pe),
|
|
1085
|
-
je(7,
|
|
1085
|
+
je(7, oo)
|
|
1086
1086
|
], Ht);
|
|
1087
|
-
var
|
|
1088
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
1087
|
+
var hi = Object.getOwnPropertyDescriptor, fi = (e, t, n, o) => {
|
|
1088
|
+
for (var r = o > 1 ? void 0 : o ? hi(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
1089
1089
|
(i = e[s]) && (r = i(r) || r);
|
|
1090
1090
|
return r;
|
|
1091
|
-
},
|
|
1092
|
-
const
|
|
1091
|
+
}, tr = (e, t) => (n, o) => t(n, o, e);
|
|
1092
|
+
const gi = {
|
|
1093
1093
|
tl: {
|
|
1094
1094
|
size: 6,
|
|
1095
1095
|
color: "#409f11"
|
|
1096
1096
|
}
|
|
1097
1097
|
};
|
|
1098
|
-
let Bt = class extends
|
|
1098
|
+
let Bt = class extends so {
|
|
1099
1099
|
constructor(e, t) {
|
|
1100
1100
|
super(), this._sheetInterceptorService = e, this._formulaDataModel = t, this.disposeWithMe(this._sheetInterceptorService.intercept(
|
|
1101
|
-
|
|
1101
|
+
ls.CELL_CONTENT,
|
|
1102
1102
|
{
|
|
1103
|
-
effect:
|
|
1103
|
+
effect: io.Style,
|
|
1104
1104
|
handler: (n, o, r) => {
|
|
1105
|
-
var c, a,
|
|
1106
|
-
const s = (f = (
|
|
1107
|
-
return !
|
|
1105
|
+
var c, a, d, f;
|
|
1106
|
+
const s = (f = (d = (a = (c = this._formulaDataModel.getArrayFormulaCellData()) == null ? void 0 : c[o.unitId]) == null ? void 0 : a[o.subUnitId]) == null ? void 0 : d[o.row]) == null ? void 0 : f[o.col];
|
|
1107
|
+
return !gr(n, !!s) || !n || (n === o.rawData && (n = { ...o.rawData }), n.markers = {
|
|
1108
1108
|
...n == null ? void 0 : n.markers,
|
|
1109
|
-
...
|
|
1109
|
+
...gi
|
|
1110
1110
|
}), r(n);
|
|
1111
1111
|
},
|
|
1112
1112
|
priority: 10
|
|
@@ -1114,25 +1114,25 @@ let Bt = class extends co {
|
|
|
1114
1114
|
));
|
|
1115
1115
|
}
|
|
1116
1116
|
};
|
|
1117
|
-
Bt =
|
|
1118
|
-
|
|
1119
|
-
|
|
1117
|
+
Bt = fi([
|
|
1118
|
+
tr(0, q(Rn)),
|
|
1119
|
+
tr(1, q(Tt))
|
|
1120
1120
|
], Bt);
|
|
1121
|
-
function
|
|
1122
|
-
const e =
|
|
1123
|
-
t.executeCommand(
|
|
1121
|
+
function mi() {
|
|
1122
|
+
const e = y(ms), t = y(pe), n = _e(e.progress$), o = $t(() => {
|
|
1123
|
+
t.executeCommand(Vo.id);
|
|
1124
1124
|
}, [t]), r = $t(() => {
|
|
1125
1125
|
e.clearProgress();
|
|
1126
1126
|
}, [e]);
|
|
1127
|
-
return /* @__PURE__ */ x(
|
|
1127
|
+
return /* @__PURE__ */ x(Rs, { progress: n, onTerminate: o, onClearProgress: r });
|
|
1128
1128
|
}
|
|
1129
|
-
function
|
|
1130
|
-
return Object.keys(e).filter((
|
|
1131
|
-
label: t.t(`formula.functionType.${
|
|
1132
|
-
value: `${e[
|
|
1129
|
+
function pi(e, t, n) {
|
|
1130
|
+
return Object.keys(e).filter((o) => isNaN(Number(o)) && o !== "DefinedName" && o !== "Table" && (n || o !== "User")).map((o) => ({
|
|
1131
|
+
label: t.t(`formula.functionType.${o.toLocaleLowerCase()}`),
|
|
1132
|
+
value: `${e[o]}`
|
|
1133
1133
|
}));
|
|
1134
1134
|
}
|
|
1135
|
-
function
|
|
1135
|
+
function kr(e) {
|
|
1136
1136
|
if (!e.require && !e.repeat)
|
|
1137
1137
|
return `[${e.name}]`;
|
|
1138
1138
|
if (e.require && !e.repeat)
|
|
@@ -1142,7 +1142,7 @@ function Fr(e) {
|
|
|
1142
1142
|
if (e.require && e.repeat)
|
|
1143
1143
|
return `${e.name},...`;
|
|
1144
1144
|
}
|
|
1145
|
-
function
|
|
1145
|
+
function Ar(e) {
|
|
1146
1146
|
const { prefix: t, value: n } = e;
|
|
1147
1147
|
return /* @__PURE__ */ B("div", { children: [
|
|
1148
1148
|
/* @__PURE__ */ B("span", { children: [
|
|
@@ -1150,7 +1150,7 @@ function Dr(e) {
|
|
|
1150
1150
|
"("
|
|
1151
1151
|
] }),
|
|
1152
1152
|
n && n.map((o, r) => /* @__PURE__ */ B("span", { children: [
|
|
1153
|
-
/* @__PURE__ */ x("span", { children:
|
|
1153
|
+
/* @__PURE__ */ x("span", { children: kr(o) }),
|
|
1154
1154
|
r === n.length - 1 ? "" : ","
|
|
1155
1155
|
] }, r)),
|
|
1156
1156
|
")"
|
|
@@ -1175,27 +1175,27 @@ function Ct(e) {
|
|
|
1175
1175
|
)
|
|
1176
1176
|
] });
|
|
1177
1177
|
}
|
|
1178
|
-
function
|
|
1178
|
+
function Si(e) {
|
|
1179
1179
|
const { functionInfo: t, onChange: n } = e;
|
|
1180
1180
|
if (!t) return null;
|
|
1181
1181
|
const [o, r] = H([]), [s, i] = H(t.functionParameter), [c, a] = H(-1);
|
|
1182
1182
|
return /* @__PURE__ */ B("div", { children: [
|
|
1183
|
-
/* @__PURE__ */ x("div", { className: se("univer-h-[364px] univer-overflow-y-auto", ut), children: s.map((
|
|
1184
|
-
/* @__PURE__ */ x("div", { className: "univer-text-sm", children:
|
|
1183
|
+
/* @__PURE__ */ x("div", { className: se("univer-h-[364px] univer-overflow-y-auto", ut), children: s.map((d, f) => /* @__PURE__ */ B("div", { children: [
|
|
1184
|
+
/* @__PURE__ */ x("div", { className: "univer-text-sm", children: d.name }),
|
|
1185
1185
|
/* @__PURE__ */ x("div", { className: "univer-mb-2 univer-mt-1" })
|
|
1186
1186
|
] }, f)) }),
|
|
1187
|
-
/* @__PURE__ */ x("div", { className: se("univer-flex-1 univer-p-3",
|
|
1187
|
+
/* @__PURE__ */ x("div", { className: se("univer-flex-1 univer-p-3", Ns), children: /* @__PURE__ */ x(
|
|
1188
1188
|
Ct,
|
|
1189
1189
|
{
|
|
1190
|
-
title: c === -1 ? /* @__PURE__ */ x(
|
|
1190
|
+
title: c === -1 ? /* @__PURE__ */ x(Ar, { prefix: t.functionName, value: s }) : s[c].name,
|
|
1191
1191
|
value: c === -1 ? t.description : s[c].detail
|
|
1192
1192
|
}
|
|
1193
1193
|
) })
|
|
1194
1194
|
] });
|
|
1195
1195
|
}
|
|
1196
1196
|
function nt({ ref: e, ...t }) {
|
|
1197
|
-
const { icon: n, id: o, className: r, extend: s, ...i } = t, c = `univerjs-icon univerjs-icon-${o} ${r || ""}`.trim(), a =
|
|
1198
|
-
return
|
|
1197
|
+
const { icon: n, id: o, className: r, extend: s, ...i } = t, c = `univerjs-icon univerjs-icon-${o} ${r || ""}`.trim(), a = X(`_${_i()}`);
|
|
1198
|
+
return Fr(n, `${o}`, {
|
|
1199
1199
|
defIds: n.defIds,
|
|
1200
1200
|
idSuffix: a.current
|
|
1201
1201
|
}, {
|
|
@@ -1204,14 +1204,14 @@ function nt({ ref: e, ...t }) {
|
|
|
1204
1204
|
...i
|
|
1205
1205
|
}, s);
|
|
1206
1206
|
}
|
|
1207
|
-
function
|
|
1207
|
+
function Fr(e, t, n, o, r) {
|
|
1208
1208
|
return tt(e.tag, {
|
|
1209
1209
|
key: t,
|
|
1210
|
-
...
|
|
1210
|
+
...vi(e, n, r),
|
|
1211
1211
|
...o
|
|
1212
|
-
}, (
|
|
1212
|
+
}, (Ci(e, n).children || []).map((s, i) => Fr(s, `${t}-${e.tag}-${i}`, n, void 0, r)));
|
|
1213
1213
|
}
|
|
1214
|
-
function
|
|
1214
|
+
function vi(e, t, n) {
|
|
1215
1215
|
const o = { ...e.attrs };
|
|
1216
1216
|
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]) => {
|
|
1217
1217
|
s === "mask" && typeof i == "string" && (o[s] = i.replace(/url\(#(.*)\)/, `url(#$1${t.idSuffix})`));
|
|
@@ -1221,7 +1221,7 @@ function _i(e, t, n) {
|
|
|
1221
1221
|
typeof i == "string" && (o[s] = i.replace(/url\(#(.*)\)/, `url(#$1${t.idSuffix})`));
|
|
1222
1222
|
})), o;
|
|
1223
1223
|
}
|
|
1224
|
-
function
|
|
1224
|
+
function Ci(e, t) {
|
|
1225
1225
|
var o;
|
|
1226
1226
|
const { defIds: n } = t;
|
|
1227
1227
|
return !n || n.length === 0 ? e : e.tag === "defs" && ((o = e.children) != null && o.length) ? {
|
|
@@ -1235,11 +1235,11 @@ function Ri(e, t) {
|
|
|
1235
1235
|
} : r)
|
|
1236
1236
|
} : e;
|
|
1237
1237
|
}
|
|
1238
|
-
function
|
|
1238
|
+
function _i() {
|
|
1239
1239
|
return Math.random().toString(36).substring(2, 8);
|
|
1240
1240
|
}
|
|
1241
1241
|
nt.displayName = "UniverIcon";
|
|
1242
|
-
const
|
|
1242
|
+
const Ri = {
|
|
1243
1243
|
tag: "svg",
|
|
1244
1244
|
attrs: {
|
|
1245
1245
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1257,15 +1257,15 @@ const Ei = {
|
|
|
1257
1257
|
clipRule: "evenodd"
|
|
1258
1258
|
}
|
|
1259
1259
|
}]
|
|
1260
|
-
},
|
|
1260
|
+
}, Dr = Ve(function(t, n) {
|
|
1261
1261
|
return tt(nt, Object.assign({}, t, {
|
|
1262
1262
|
id: "check-mark-icon",
|
|
1263
1263
|
ref: n,
|
|
1264
|
-
icon:
|
|
1264
|
+
icon: Ri
|
|
1265
1265
|
}));
|
|
1266
1266
|
});
|
|
1267
|
-
|
|
1268
|
-
const
|
|
1267
|
+
Dr.displayName = "CheckMarkIcon";
|
|
1268
|
+
const Ii = {
|
|
1269
1269
|
tag: "svg",
|
|
1270
1270
|
attrs: {
|
|
1271
1271
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1281,15 +1281,15 @@ const bi = {
|
|
|
1281
1281
|
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"
|
|
1282
1282
|
}
|
|
1283
1283
|
}]
|
|
1284
|
-
},
|
|
1284
|
+
}, Lr = Ve(function(t, n) {
|
|
1285
1285
|
return tt(nt, Object.assign({}, t, {
|
|
1286
1286
|
id: "close-icon",
|
|
1287
1287
|
ref: n,
|
|
1288
|
-
icon:
|
|
1288
|
+
icon: Ii
|
|
1289
1289
|
}));
|
|
1290
1290
|
});
|
|
1291
|
-
|
|
1292
|
-
const
|
|
1291
|
+
Lr.displayName = "CloseIcon";
|
|
1292
|
+
const Ei = {
|
|
1293
1293
|
tag: "svg",
|
|
1294
1294
|
attrs: {
|
|
1295
1295
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1330,15 +1330,15 @@ const yi = {
|
|
|
1330
1330
|
}
|
|
1331
1331
|
}
|
|
1332
1332
|
]
|
|
1333
|
-
},
|
|
1333
|
+
}, $r = Ve(function(t, n) {
|
|
1334
1334
|
return tt(nt, Object.assign({}, t, {
|
|
1335
1335
|
id: "delete-icon",
|
|
1336
1336
|
ref: n,
|
|
1337
|
-
icon:
|
|
1337
|
+
icon: Ei
|
|
1338
1338
|
}));
|
|
1339
1339
|
});
|
|
1340
|
-
|
|
1341
|
-
const
|
|
1340
|
+
$r.displayName = "DeleteIcon";
|
|
1341
|
+
const bi = {
|
|
1342
1342
|
tag: "svg",
|
|
1343
1343
|
attrs: {
|
|
1344
1344
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1354,15 +1354,15 @@ const Ti = {
|
|
|
1354
1354
|
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"
|
|
1355
1355
|
}
|
|
1356
1356
|
}]
|
|
1357
|
-
},
|
|
1357
|
+
}, Pr = Ve(function(t, n) {
|
|
1358
1358
|
return tt(nt, Object.assign({}, t, {
|
|
1359
1359
|
id: "increase-icon",
|
|
1360
1360
|
ref: n,
|
|
1361
|
-
icon:
|
|
1361
|
+
icon: bi
|
|
1362
1362
|
}));
|
|
1363
1363
|
});
|
|
1364
|
-
|
|
1365
|
-
const
|
|
1364
|
+
Pr.displayName = "IncreaseIcon";
|
|
1365
|
+
const yi = {
|
|
1366
1366
|
tag: "svg",
|
|
1367
1367
|
attrs: {
|
|
1368
1368
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1380,15 +1380,15 @@ const Oi = {
|
|
|
1380
1380
|
clipRule: "evenodd"
|
|
1381
1381
|
}
|
|
1382
1382
|
}]
|
|
1383
|
-
},
|
|
1383
|
+
}, Ur = Ve(function(t, n) {
|
|
1384
1384
|
return tt(nt, Object.assign({}, t, {
|
|
1385
1385
|
id: "more-icon",
|
|
1386
1386
|
ref: n,
|
|
1387
|
-
icon:
|
|
1387
|
+
icon: yi
|
|
1388
1388
|
}));
|
|
1389
1389
|
});
|
|
1390
|
-
|
|
1391
|
-
const
|
|
1390
|
+
Ur.displayName = "MoreIcon";
|
|
1391
|
+
const Ti = {
|
|
1392
1392
|
tag: "svg",
|
|
1393
1393
|
attrs: {
|
|
1394
1394
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1412,157 +1412,158 @@ const Ni = {
|
|
|
1412
1412
|
clipRule: "evenodd"
|
|
1413
1413
|
}
|
|
1414
1414
|
}]
|
|
1415
|
-
},
|
|
1415
|
+
}, Vr = Ve(function(t, n) {
|
|
1416
1416
|
return tt(nt, Object.assign({}, t, {
|
|
1417
1417
|
id: "select-range-icon",
|
|
1418
1418
|
ref: n,
|
|
1419
|
-
icon:
|
|
1419
|
+
icon: Ti
|
|
1420
1420
|
}));
|
|
1421
1421
|
});
|
|
1422
|
-
|
|
1423
|
-
function
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1422
|
+
Vr.displayName = "SelectRangeIcon";
|
|
1423
|
+
function Oi(e) {
|
|
1424
|
+
var I;
|
|
1425
|
+
const n = (I = y(pn).getConfig(ps)) == null ? void 0 : I.function, { onChange: o } = e, r = "-1", [s, i] = H(""), [c, a] = H([]), [d, f] = H(0), [m, u] = H(r), [h, l] = H(0), [S, v] = H(null), g = y(Zt), C = y(dt), R = y(In), E = _e(R.sidebarOptions$), p = pi(mr, C, !!n);
|
|
1426
|
+
p.unshift({
|
|
1427
|
+
label: C.t("formula.moreFunctions.allFunctions"),
|
|
1428
|
+
value: r
|
|
1428
1429
|
});
|
|
1429
|
-
const
|
|
1430
|
+
const b = C.t("formula.prompt.required"), T = C.t("formula.prompt.optional");
|
|
1430
1431
|
P(() => {
|
|
1431
|
-
|
|
1432
|
+
N(r);
|
|
1432
1433
|
}, []), P(() => {
|
|
1433
|
-
|
|
1434
|
-
}, [
|
|
1435
|
-
|
|
1436
|
-
}, [
|
|
1437
|
-
const
|
|
1438
|
-
if (
|
|
1439
|
-
const
|
|
1440
|
-
return
|
|
1441
|
-
},
|
|
1442
|
-
if (
|
|
1443
|
-
|
|
1434
|
+
A(0);
|
|
1435
|
+
}, [c]), P(() => {
|
|
1436
|
+
E != null && E.visible && (i(""), a([]), f(0), u(r), l(0), v(null), N(r));
|
|
1437
|
+
}, [E]);
|
|
1438
|
+
const F = (_) => {
|
|
1439
|
+
if (s.trim() === "") return _;
|
|
1440
|
+
const O = new RegExp(`(${s.toLocaleUpperCase()})`);
|
|
1441
|
+
return _.split(O).filter(Boolean).map((U, Y) => U.match(O) ? /* @__PURE__ */ x("span", { className: "univer-text-red-500", children: U }, Y) : U);
|
|
1442
|
+
}, A = (_) => {
|
|
1443
|
+
if (c.length === 0) {
|
|
1444
|
+
v(null), o(null);
|
|
1444
1445
|
return;
|
|
1445
1446
|
}
|
|
1446
|
-
|
|
1447
|
-
const
|
|
1448
|
-
if (!
|
|
1449
|
-
|
|
1447
|
+
l(_);
|
|
1448
|
+
const O = g.getFunctionInfo(c[_].name);
|
|
1449
|
+
if (!O) {
|
|
1450
|
+
v(null), o(null);
|
|
1450
1451
|
return;
|
|
1451
1452
|
}
|
|
1452
|
-
|
|
1453
|
+
v(O), o(O);
|
|
1453
1454
|
};
|
|
1454
|
-
function
|
|
1455
|
-
|
|
1456
|
-
const
|
|
1457
|
-
|
|
1458
|
-
}
|
|
1459
|
-
function
|
|
1460
|
-
|
|
1461
|
-
const
|
|
1462
|
-
|
|
1463
|
-
}
|
|
1464
|
-
function
|
|
1465
|
-
if (
|
|
1466
|
-
const
|
|
1467
|
-
|
|
1468
|
-
} else if (
|
|
1469
|
-
const
|
|
1470
|
-
|
|
1471
|
-
} else
|
|
1472
|
-
}
|
|
1473
|
-
const
|
|
1474
|
-
|
|
1475
|
-
},
|
|
1476
|
-
|
|
1455
|
+
function N(_) {
|
|
1456
|
+
u(_);
|
|
1457
|
+
const O = g.getSearchListByType(+_);
|
|
1458
|
+
a(O);
|
|
1459
|
+
}
|
|
1460
|
+
function M(_) {
|
|
1461
|
+
i(_);
|
|
1462
|
+
const O = g.getSearchListByName(_);
|
|
1463
|
+
a(O);
|
|
1464
|
+
}
|
|
1465
|
+
function w(_) {
|
|
1466
|
+
if (_.stopPropagation(), _.key === "ArrowDown") {
|
|
1467
|
+
const O = d + 1;
|
|
1468
|
+
f(O === c.length ? 0 : O);
|
|
1469
|
+
} else if (_.key === "ArrowUp") {
|
|
1470
|
+
const O = d - 1;
|
|
1471
|
+
f(O === -1 ? c.length - 1 : O);
|
|
1472
|
+
} else _.key === "Enter" && A(d);
|
|
1473
|
+
}
|
|
1474
|
+
const k = (_) => {
|
|
1475
|
+
f(_);
|
|
1476
|
+
}, $ = () => {
|
|
1477
|
+
f(-1);
|
|
1477
1478
|
};
|
|
1478
1479
|
return /* @__PURE__ */ B("div", { children: [
|
|
1479
1480
|
/* @__PURE__ */ B("div", { className: "univer-flex univer-items-center univer-justify-between univer-gap-2", children: [
|
|
1480
|
-
/* @__PURE__ */ x(
|
|
1481
|
+
/* @__PURE__ */ x(Ms, { value: m, options: p, onChange: N }),
|
|
1481
1482
|
/* @__PURE__ */ x(
|
|
1482
|
-
|
|
1483
|
+
yr,
|
|
1483
1484
|
{
|
|
1484
|
-
placeholder:
|
|
1485
|
-
onKeyDown:
|
|
1486
|
-
value:
|
|
1487
|
-
onChange:
|
|
1485
|
+
placeholder: C.t("formula.moreFunctions.searchFunctionPlaceholder"),
|
|
1486
|
+
onKeyDown: w,
|
|
1487
|
+
value: s,
|
|
1488
|
+
onChange: M,
|
|
1488
1489
|
size: "small",
|
|
1489
1490
|
allowClear: !0
|
|
1490
1491
|
}
|
|
1491
1492
|
)
|
|
1492
1493
|
] }),
|
|
1493
|
-
|
|
1494
|
+
c.length > 0 && /* @__PURE__ */ x(
|
|
1494
1495
|
"ul",
|
|
1495
1496
|
{
|
|
1496
|
-
className: se("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",
|
|
1497
|
-
onKeyDown:
|
|
1497
|
+
className: se("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", En, ut),
|
|
1498
|
+
onKeyDown: w,
|
|
1498
1499
|
tabIndex: -1,
|
|
1499
|
-
children:
|
|
1500
|
+
children: c.map(({ name: _ }, O) => /* @__PURE__ */ B(
|
|
1500
1501
|
"li",
|
|
1501
1502
|
{
|
|
1502
1503
|
className: se("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", {
|
|
1503
|
-
"univer-bg-gray-200 dark:!univer-bg-gray-600":
|
|
1504
|
+
"univer-bg-gray-200 dark:!univer-bg-gray-600": d === O
|
|
1504
1505
|
}),
|
|
1505
|
-
onMouseEnter: () =>
|
|
1506
|
-
onMouseLeave:
|
|
1507
|
-
onClick: () =>
|
|
1506
|
+
onMouseEnter: () => k(O),
|
|
1507
|
+
onMouseLeave: $,
|
|
1508
|
+
onClick: () => A(O),
|
|
1508
1509
|
children: [
|
|
1509
|
-
|
|
1510
|
-
|
|
1510
|
+
h === O && /* @__PURE__ */ x(
|
|
1511
|
+
Dr,
|
|
1511
1512
|
{
|
|
1512
1513
|
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"
|
|
1513
1514
|
}
|
|
1514
1515
|
),
|
|
1515
|
-
/* @__PURE__ */ x("span", { className: "univer-block", children:
|
|
1516
|
+
/* @__PURE__ */ x("span", { className: "univer-block", children: F(_) })
|
|
1516
1517
|
]
|
|
1517
1518
|
},
|
|
1518
|
-
|
|
1519
|
+
O
|
|
1519
1520
|
))
|
|
1520
1521
|
}
|
|
1521
1522
|
),
|
|
1522
|
-
|
|
1523
|
-
/* @__PURE__ */ x(Ct, { title:
|
|
1523
|
+
S && /* @__PURE__ */ B("div", { className: se("univer-mx-0 univer-my-2 univer-overflow-y-auto", ut), children: [
|
|
1524
|
+
/* @__PURE__ */ x(Ct, { title: S.functionName, value: S.description }),
|
|
1524
1525
|
/* @__PURE__ */ x(
|
|
1525
1526
|
Ct,
|
|
1526
1527
|
{
|
|
1527
|
-
title:
|
|
1528
|
-
value: /* @__PURE__ */ x(
|
|
1528
|
+
title: C.t("formula.moreFunctions.syntax"),
|
|
1529
|
+
value: /* @__PURE__ */ x(Ar, { prefix: S.functionName, value: S.functionParameter })
|
|
1529
1530
|
}
|
|
1530
1531
|
),
|
|
1531
1532
|
/* @__PURE__ */ x(
|
|
1532
1533
|
Ct,
|
|
1533
1534
|
{
|
|
1534
|
-
title:
|
|
1535
|
-
value: `${
|
|
1535
|
+
title: C.t("formula.prompt.helpExample"),
|
|
1536
|
+
value: `${S.functionName}(${S.functionParameter.map((_) => _.example).join(",")})`
|
|
1536
1537
|
}
|
|
1537
1538
|
),
|
|
1538
|
-
|
|
1539
|
+
S.functionParameter && S.functionParameter.map((_) => /* @__PURE__ */ x(
|
|
1539
1540
|
Ct,
|
|
1540
1541
|
{
|
|
1541
|
-
title:
|
|
1542
|
-
value: `${
|
|
1542
|
+
title: _.name,
|
|
1543
|
+
value: `${_.require ? b : T} ${_.detail}`
|
|
1543
1544
|
},
|
|
1544
|
-
|
|
1545
|
+
_.name
|
|
1545
1546
|
))
|
|
1546
1547
|
] })
|
|
1547
1548
|
] });
|
|
1548
1549
|
}
|
|
1549
|
-
function
|
|
1550
|
-
const e =
|
|
1551
|
-
|
|
1552
|
-
const c =
|
|
1550
|
+
function Ni() {
|
|
1551
|
+
const e = yo(), [t, n] = H(!0), [o, r] = H(!1), [s, i] = H(null);
|
|
1552
|
+
y(Sn);
|
|
1553
|
+
const c = y(dt), a = y(ze), d = y(ne), f = y(pe);
|
|
1553
1554
|
function m() {
|
|
1554
1555
|
n(!t), r(!o);
|
|
1555
1556
|
}
|
|
1556
|
-
function
|
|
1557
|
-
const
|
|
1558
|
-
if (!
|
|
1559
|
-
f.executeCommand(
|
|
1557
|
+
function u() {
|
|
1558
|
+
const h = Rr(d);
|
|
1559
|
+
if (!h) return;
|
|
1560
|
+
f.executeCommand(ur.id, {
|
|
1560
1561
|
visible: !0,
|
|
1561
|
-
unitId:
|
|
1562
|
+
unitId: h.unitId,
|
|
1562
1563
|
eventType: xe.Dblclick
|
|
1563
1564
|
});
|
|
1564
|
-
const l = a.getEditor(fn),
|
|
1565
|
-
l == null || l.replaceText(
|
|
1565
|
+
const l = a.getEditor(fn), S = a.getEditor(sr), v = `=${s == null ? void 0 : s.functionName}(`;
|
|
1566
|
+
l == null || l.replaceText(v), S == null || S.replaceText(v, !1);
|
|
1566
1567
|
}
|
|
1567
1568
|
return /* @__PURE__ */ B(
|
|
1568
1569
|
"div",
|
|
@@ -1570,8 +1571,8 @@ function xi() {
|
|
|
1570
1571
|
"data-u-comp": "sheets-formula-functions-panel",
|
|
1571
1572
|
className: "univer-box-border univer-flex univer-h-full univer-flex-col univer-justify-between univer-py-2",
|
|
1572
1573
|
children: [
|
|
1573
|
-
t && /* @__PURE__ */ x(
|
|
1574
|
-
o && /* @__PURE__ */ x(
|
|
1574
|
+
t && /* @__PURE__ */ x(Oi, { onChange: i }),
|
|
1575
|
+
o && /* @__PURE__ */ x(Si, { functionInfo: s, onChange: () => {
|
|
1575
1576
|
} }),
|
|
1576
1577
|
/* @__PURE__ */ B("div", { className: "univer-flex univer-justify-end", children: [
|
|
1577
1578
|
o && /* @__PURE__ */ x(
|
|
@@ -1587,8 +1588,9 @@ function xi() {
|
|
|
1587
1588
|
t && !!e && /* @__PURE__ */ x(
|
|
1588
1589
|
at,
|
|
1589
1590
|
{
|
|
1591
|
+
disabled: !s,
|
|
1590
1592
|
variant: "primary",
|
|
1591
|
-
onClick:
|
|
1593
|
+
onClick: u,
|
|
1592
1594
|
className: "univer-mb-5 univer-ml-4 univer-mr-0 univer-mt-0",
|
|
1593
1595
|
children: c.t("formula.moreFunctions.confirm")
|
|
1594
1596
|
}
|
|
@@ -1598,7 +1600,7 @@ function xi() {
|
|
|
1598
1600
|
}
|
|
1599
1601
|
);
|
|
1600
1602
|
}
|
|
1601
|
-
function
|
|
1603
|
+
function Mi(e) {
|
|
1602
1604
|
return {
|
|
1603
1605
|
id: ve.id,
|
|
1604
1606
|
title: "SUM",
|
|
@@ -1607,7 +1609,7 @@ function wi(e) {
|
|
|
1607
1609
|
params: {
|
|
1608
1610
|
value: "SUM"
|
|
1609
1611
|
},
|
|
1610
|
-
hidden$: Pe(e,
|
|
1612
|
+
hidden$: Pe(e, W.UNIVER_SHEET),
|
|
1611
1613
|
disabled$: $e(e, {
|
|
1612
1614
|
workbookTypes: [et],
|
|
1613
1615
|
worksheetTypes: [Qe, Xe],
|
|
@@ -1615,7 +1617,7 @@ function wi(e) {
|
|
|
1615
1617
|
})
|
|
1616
1618
|
};
|
|
1617
1619
|
}
|
|
1618
|
-
function
|
|
1620
|
+
function xi(e) {
|
|
1619
1621
|
return {
|
|
1620
1622
|
id: ve.id,
|
|
1621
1623
|
title: "COUNT",
|
|
@@ -1624,7 +1626,7 @@ function ki(e) {
|
|
|
1624
1626
|
params: {
|
|
1625
1627
|
value: "COUNT"
|
|
1626
1628
|
},
|
|
1627
|
-
hidden$: Pe(e,
|
|
1629
|
+
hidden$: Pe(e, W.UNIVER_SHEET),
|
|
1628
1630
|
disabled$: $e(e, {
|
|
1629
1631
|
workbookTypes: [et],
|
|
1630
1632
|
worksheetTypes: [Qe, Xe],
|
|
@@ -1632,7 +1634,7 @@ function ki(e) {
|
|
|
1632
1634
|
})
|
|
1633
1635
|
};
|
|
1634
1636
|
}
|
|
1635
|
-
function
|
|
1637
|
+
function wi(e) {
|
|
1636
1638
|
return {
|
|
1637
1639
|
id: ve.id,
|
|
1638
1640
|
title: "AVERAGE",
|
|
@@ -1641,7 +1643,7 @@ function Ai(e) {
|
|
|
1641
1643
|
params: {
|
|
1642
1644
|
value: "AVERAGE"
|
|
1643
1645
|
},
|
|
1644
|
-
hidden$: Pe(e,
|
|
1646
|
+
hidden$: Pe(e, W.UNIVER_SHEET),
|
|
1645
1647
|
disabled$: $e(e, {
|
|
1646
1648
|
workbookTypes: [et],
|
|
1647
1649
|
worksheetTypes: [Qe, Xe],
|
|
@@ -1649,7 +1651,7 @@ function Ai(e) {
|
|
|
1649
1651
|
})
|
|
1650
1652
|
};
|
|
1651
1653
|
}
|
|
1652
|
-
function
|
|
1654
|
+
function ki(e) {
|
|
1653
1655
|
return {
|
|
1654
1656
|
id: ve.id,
|
|
1655
1657
|
title: "MAX",
|
|
@@ -1658,7 +1660,7 @@ function Fi(e) {
|
|
|
1658
1660
|
params: {
|
|
1659
1661
|
value: "MAX"
|
|
1660
1662
|
},
|
|
1661
|
-
hidden$: Pe(e,
|
|
1663
|
+
hidden$: Pe(e, W.UNIVER_SHEET),
|
|
1662
1664
|
disabled$: $e(e, {
|
|
1663
1665
|
workbookTypes: [et],
|
|
1664
1666
|
worksheetTypes: [Qe, Xe],
|
|
@@ -1666,7 +1668,7 @@ function Fi(e) {
|
|
|
1666
1668
|
})
|
|
1667
1669
|
};
|
|
1668
1670
|
}
|
|
1669
|
-
function
|
|
1671
|
+
function Ai(e) {
|
|
1670
1672
|
return {
|
|
1671
1673
|
id: ve.id,
|
|
1672
1674
|
title: "MIN",
|
|
@@ -1675,7 +1677,7 @@ function Di(e) {
|
|
|
1675
1677
|
params: {
|
|
1676
1678
|
value: "MIN"
|
|
1677
1679
|
},
|
|
1678
|
-
hidden$: Pe(e,
|
|
1680
|
+
hidden$: Pe(e, W.UNIVER_SHEET),
|
|
1679
1681
|
disabled$: $e(e, {
|
|
1680
1682
|
workbookTypes: [et],
|
|
1681
1683
|
worksheetTypes: [Qe, Xe],
|
|
@@ -1683,13 +1685,13 @@ function Di(e) {
|
|
|
1683
1685
|
})
|
|
1684
1686
|
};
|
|
1685
1687
|
}
|
|
1686
|
-
function
|
|
1688
|
+
function Fi(e) {
|
|
1687
1689
|
return {
|
|
1688
|
-
id:
|
|
1690
|
+
id: Tn.id,
|
|
1689
1691
|
title: "formula.insert.more",
|
|
1690
1692
|
tooltip: "formula.insert.tooltip",
|
|
1691
1693
|
type: Ue.BUTTON,
|
|
1692
|
-
hidden$: Pe(e,
|
|
1694
|
+
hidden$: Pe(e, W.UNIVER_SHEET),
|
|
1693
1695
|
disabled$: $e(e, {
|
|
1694
1696
|
workbookTypes: [et],
|
|
1695
1697
|
worksheetTypes: [Qe, Xe],
|
|
@@ -1697,94 +1699,89 @@ function Li(e) {
|
|
|
1697
1699
|
})
|
|
1698
1700
|
};
|
|
1699
1701
|
}
|
|
1700
|
-
function
|
|
1701
|
-
return e.get(te).getCurrentTypeOfUnit$(U.UNIVER_SHEET).pipe(
|
|
1702
|
-
Zo((o) => o ? e.get(zn) ? new zo((s) => s.next(!e.get(zn).supportClipboard)) : qn(!0) : qn(!0))
|
|
1703
|
-
);
|
|
1704
|
-
}
|
|
1705
|
-
function Pi(e) {
|
|
1702
|
+
function Di(e) {
|
|
1706
1703
|
return {
|
|
1707
|
-
id:
|
|
1704
|
+
id: bn.id,
|
|
1708
1705
|
type: Ue.BUTTON,
|
|
1709
1706
|
title: "formula.operation.copyFormulaOnly",
|
|
1710
1707
|
disabled$: $e(e, {
|
|
1711
|
-
workbookTypes: [
|
|
1712
|
-
worksheetTypes: [
|
|
1713
|
-
rangeTypes: [
|
|
1708
|
+
workbookTypes: [ds],
|
|
1709
|
+
worksheetTypes: [us],
|
|
1710
|
+
rangeTypes: [as]
|
|
1714
1711
|
}),
|
|
1715
|
-
hidden$: Pe(e,
|
|
1712
|
+
hidden$: Pe(e, W.UNIVER_SHEET)
|
|
1716
1713
|
};
|
|
1717
1714
|
}
|
|
1718
|
-
function
|
|
1715
|
+
function Li(e) {
|
|
1719
1716
|
return {
|
|
1720
|
-
id:
|
|
1717
|
+
id: yn.id,
|
|
1721
1718
|
type: Ue.BUTTON,
|
|
1722
1719
|
title: "formula.operation.pasteFormula",
|
|
1723
|
-
disabled$:
|
|
1724
|
-
|
|
1720
|
+
disabled$: To(e).pipe(
|
|
1721
|
+
Yo($e(e, {
|
|
1725
1722
|
workbookTypes: [et],
|
|
1726
1723
|
rangeTypes: [Je],
|
|
1727
1724
|
worksheetTypes: [Xe, Qe]
|
|
1728
1725
|
})),
|
|
1729
|
-
|
|
1726
|
+
Sr(([t, n]) => t || n)
|
|
1730
1727
|
),
|
|
1731
|
-
hidden$: Pe(e,
|
|
1728
|
+
hidden$: Pe(e, W.UNIVER_SHEET)
|
|
1732
1729
|
};
|
|
1733
1730
|
}
|
|
1734
|
-
const
|
|
1735
|
-
[
|
|
1731
|
+
const $i = {
|
|
1732
|
+
[zn.BASIC]: {
|
|
1736
1733
|
[`${ve.id}.sum`]: {
|
|
1737
1734
|
order: 0,
|
|
1738
|
-
menuItemFactory:
|
|
1735
|
+
menuItemFactory: Mi
|
|
1739
1736
|
},
|
|
1740
1737
|
[`${ve.id}.count`]: {
|
|
1741
1738
|
order: 1,
|
|
1742
|
-
menuItemFactory:
|
|
1739
|
+
menuItemFactory: xi
|
|
1743
1740
|
},
|
|
1744
1741
|
[`${ve.id}.average`]: {
|
|
1745
1742
|
order: 2,
|
|
1746
|
-
menuItemFactory:
|
|
1743
|
+
menuItemFactory: wi
|
|
1747
1744
|
},
|
|
1748
1745
|
[`${ve.id}.max`]: {
|
|
1749
1746
|
order: 3,
|
|
1750
|
-
menuItemFactory:
|
|
1747
|
+
menuItemFactory: ki
|
|
1751
1748
|
},
|
|
1752
1749
|
[`${ve.id}.min`]: {
|
|
1753
1750
|
order: 4,
|
|
1754
|
-
menuItemFactory:
|
|
1751
|
+
menuItemFactory: Ai
|
|
1755
1752
|
}
|
|
1756
1753
|
},
|
|
1757
|
-
[
|
|
1758
|
-
[
|
|
1754
|
+
[zn.OTHERS]: {
|
|
1755
|
+
[Tn.id]: {
|
|
1759
1756
|
order: 0,
|
|
1760
|
-
menuItemFactory:
|
|
1757
|
+
menuItemFactory: Fi
|
|
1761
1758
|
}
|
|
1762
1759
|
},
|
|
1763
|
-
[
|
|
1764
|
-
[
|
|
1760
|
+
[No]: {
|
|
1761
|
+
[bn.id]: {
|
|
1765
1762
|
order: 0,
|
|
1766
|
-
menuItemFactory:
|
|
1763
|
+
menuItemFactory: Di
|
|
1767
1764
|
}
|
|
1768
1765
|
},
|
|
1769
|
-
[
|
|
1770
|
-
[
|
|
1766
|
+
[Oo]: {
|
|
1767
|
+
[yn.id]: {
|
|
1771
1768
|
order: 4,
|
|
1772
|
-
menuItemFactory:
|
|
1769
|
+
menuItemFactory: Li
|
|
1773
1770
|
}
|
|
1774
1771
|
}
|
|
1775
|
-
},
|
|
1776
|
-
function
|
|
1777
|
-
return e.getContextValue(
|
|
1772
|
+
}, Pi = "meta_key_ctrl_And_Shift";
|
|
1773
|
+
function Ui(e) {
|
|
1774
|
+
return e.getContextValue(co) && e.getContextValue(lo);
|
|
1778
1775
|
}
|
|
1779
1776
|
const Qt = [
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
],
|
|
1785
|
-
function
|
|
1777
|
+
L.ARROW_DOWN,
|
|
1778
|
+
L.ARROW_UP,
|
|
1779
|
+
L.ARROW_LEFT,
|
|
1780
|
+
L.ARROW_RIGHT
|
|
1781
|
+
], Vi = [...Qt, L.ENTER, L.TAB, L.ESC];
|
|
1782
|
+
function Wi() {
|
|
1786
1783
|
const e = [];
|
|
1787
|
-
for (const t of
|
|
1784
|
+
for (const t of Vi)
|
|
1788
1785
|
e.push({
|
|
1789
1786
|
id: ft.id,
|
|
1790
1787
|
binding: t,
|
|
@@ -1796,7 +1793,7 @@ function qi() {
|
|
|
1796
1793
|
});
|
|
1797
1794
|
return e;
|
|
1798
1795
|
}
|
|
1799
|
-
function
|
|
1796
|
+
function Hi() {
|
|
1800
1797
|
const e = [];
|
|
1801
1798
|
for (const t of Qt)
|
|
1802
1799
|
e.push({
|
|
@@ -1811,7 +1808,7 @@ function ji() {
|
|
|
1811
1808
|
});
|
|
1812
1809
|
return e;
|
|
1813
1810
|
}
|
|
1814
|
-
function
|
|
1811
|
+
function Bi() {
|
|
1815
1812
|
const e = [];
|
|
1816
1813
|
for (const t of Qt)
|
|
1817
1814
|
e.push({
|
|
@@ -1826,7 +1823,7 @@ function Ki() {
|
|
|
1826
1823
|
});
|
|
1827
1824
|
return e;
|
|
1828
1825
|
}
|
|
1829
|
-
function
|
|
1826
|
+
function qi() {
|
|
1830
1827
|
const e = [];
|
|
1831
1828
|
for (const t of Qt)
|
|
1832
1829
|
e.push({
|
|
@@ -1836,23 +1833,23 @@ function Yi() {
|
|
|
1836
1833
|
staticParameters: {
|
|
1837
1834
|
eventType: xe.Keyboard,
|
|
1838
1835
|
keycode: t,
|
|
1839
|
-
metaKey:
|
|
1836
|
+
metaKey: Pi
|
|
1840
1837
|
}
|
|
1841
1838
|
});
|
|
1842
1839
|
return e;
|
|
1843
1840
|
}
|
|
1844
|
-
const
|
|
1845
|
-
id:
|
|
1846
|
-
binding:
|
|
1841
|
+
const ji = {
|
|
1842
|
+
id: Mr.id,
|
|
1843
|
+
binding: L.F4,
|
|
1847
1844
|
preconditions: (e) => yt(e)
|
|
1848
1845
|
};
|
|
1849
|
-
function
|
|
1846
|
+
function Ki() {
|
|
1850
1847
|
const e = [];
|
|
1851
|
-
for (const t of [
|
|
1848
|
+
for (const t of [L.ENTER, L.TAB, L.ARROW_DOWN, L.ARROW_UP])
|
|
1852
1849
|
e.push({
|
|
1853
1850
|
id: ft.id,
|
|
1854
1851
|
binding: t,
|
|
1855
|
-
preconditions: (n) =>
|
|
1852
|
+
preconditions: (n) => Ui(n),
|
|
1856
1853
|
staticParameters: {
|
|
1857
1854
|
eventType: xe.Keyboard,
|
|
1858
1855
|
keycode: t,
|
|
@@ -1861,16 +1858,16 @@ function Zi() {
|
|
|
1861
1858
|
});
|
|
1862
1859
|
return e;
|
|
1863
1860
|
}
|
|
1864
|
-
const
|
|
1865
|
-
id:
|
|
1866
|
-
binding: V.ALT |
|
|
1867
|
-
preconditions:
|
|
1868
|
-
mac: V.CTRL_COMMAND | V.ALT |
|
|
1861
|
+
const Yi = {
|
|
1862
|
+
id: Ss.id,
|
|
1863
|
+
binding: V.ALT | L.EQUAL,
|
|
1864
|
+
preconditions: Mo,
|
|
1865
|
+
mac: V.CTRL_COMMAND | V.ALT | L.EQUAL,
|
|
1869
1866
|
description: "shortcut.sheets-formula-ui.quick-sum",
|
|
1870
1867
|
group: "4_sheet-edit"
|
|
1871
1868
|
};
|
|
1872
|
-
var
|
|
1873
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
1869
|
+
var Gi = Object.getOwnPropertyDescriptor, Zi = (e, t, n, o) => {
|
|
1870
|
+
for (var r = o > 1 ? void 0 : o ? Gi(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
1874
1871
|
(i = e[s]) && (r = i(r) || r);
|
|
1875
1872
|
return r;
|
|
1876
1873
|
}, Ke = (e, t) => (n, o) => t(n, o, e);
|
|
@@ -1882,58 +1879,58 @@ let qt = class extends Ze {
|
|
|
1882
1879
|
this._registerCommands(), this._registerMenus(), this._registerShortcuts(), this._registerComponents(), this._registerRenderModules();
|
|
1883
1880
|
}
|
|
1884
1881
|
_registerMenus() {
|
|
1885
|
-
this._menuManagerService.mergeMenu(
|
|
1882
|
+
this._menuManagerService.mergeMenu($i);
|
|
1886
1883
|
}
|
|
1887
1884
|
_registerCommands() {
|
|
1888
1885
|
[
|
|
1889
|
-
En,
|
|
1890
1886
|
bn,
|
|
1891
|
-
ve,
|
|
1892
1887
|
yn,
|
|
1893
|
-
|
|
1894
|
-
|
|
1888
|
+
ve,
|
|
1889
|
+
Tn,
|
|
1890
|
+
js,
|
|
1891
|
+
Ps,
|
|
1895
1892
|
ft,
|
|
1896
|
-
|
|
1893
|
+
Mr
|
|
1897
1894
|
].forEach((e) => this.disposeWithMe(this._commandService.registerCommand(e)));
|
|
1898
1895
|
}
|
|
1899
1896
|
_registerShortcuts() {
|
|
1900
1897
|
[
|
|
1898
|
+
...Wi(),
|
|
1899
|
+
...Hi(),
|
|
1900
|
+
...Bi(),
|
|
1901
1901
|
...qi(),
|
|
1902
|
-
...ji(),
|
|
1903
1902
|
...Ki(),
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
zi,
|
|
1907
|
-
Gi
|
|
1903
|
+
Yi,
|
|
1904
|
+
ji
|
|
1908
1905
|
].forEach((e) => {
|
|
1909
1906
|
this.disposeWithMe(this._shortcutService.registerShortcut(e));
|
|
1910
1907
|
});
|
|
1911
1908
|
}
|
|
1912
1909
|
_registerComponents() {
|
|
1913
|
-
this.disposeWithMe(this._uiPartsService.registerComponent(
|
|
1910
|
+
this.disposeWithMe(this._uiPartsService.registerComponent(xo.FORMULA_AUX, () => br(mi, this._injector))), this._componentManager.register(Nr, Ni);
|
|
1914
1911
|
}
|
|
1915
1912
|
_registerRenderModules() {
|
|
1916
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
1913
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(W.UNIVER_SHEET, [Ht]));
|
|
1917
1914
|
}
|
|
1918
1915
|
};
|
|
1919
|
-
qt =
|
|
1916
|
+
qt = Zi([
|
|
1920
1917
|
Ke(0, q(It)),
|
|
1921
|
-
Ke(1,
|
|
1918
|
+
Ke(1, Is),
|
|
1922
1919
|
Ke(2, pe),
|
|
1923
1920
|
Ke(3, zt),
|
|
1924
|
-
Ke(4,
|
|
1921
|
+
Ke(4, Ir),
|
|
1925
1922
|
Ke(5, Te),
|
|
1926
|
-
Ke(6, q(
|
|
1923
|
+
Ke(6, q(Er))
|
|
1927
1924
|
], qt);
|
|
1928
|
-
var
|
|
1929
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
1925
|
+
var zi = Object.getOwnPropertyDescriptor, Xi = (e, t, n, o) => {
|
|
1926
|
+
for (var r = o > 1 ? void 0 : o ? zi(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
1930
1927
|
(i = e[s]) && (r = i(r) || r);
|
|
1931
1928
|
return r;
|
|
1932
1929
|
}, rn = (e, t) => (n, o) => t(n, o, e);
|
|
1933
1930
|
let jt = class extends Ze {
|
|
1934
1931
|
constructor(e, t, n) {
|
|
1935
1932
|
super(), this._imageFormulaCellInterceptorController = e, this._renderManagerService = t, this._univerInstanceService = n, this._imageFormulaCellInterceptorController.registerRefreshRenderFunction(() => {
|
|
1936
|
-
const o = this._univerInstanceService.getCurrentUnitOfType(
|
|
1933
|
+
const o = this._univerInstanceService.getCurrentUnitOfType(W.UNIVER_SHEET);
|
|
1937
1934
|
if (!o) return;
|
|
1938
1935
|
const r = this._renderManagerService.getRenderById(o.getUnitId());
|
|
1939
1936
|
if (!r) return;
|
|
@@ -1943,14 +1940,14 @@ let jt = class extends Ze {
|
|
|
1943
1940
|
});
|
|
1944
1941
|
}
|
|
1945
1942
|
};
|
|
1946
|
-
jt =
|
|
1947
|
-
rn(0, q(
|
|
1943
|
+
jt = Xi([
|
|
1944
|
+
rn(0, q(vs)),
|
|
1948
1945
|
rn(1, Te),
|
|
1949
|
-
rn(2,
|
|
1946
|
+
rn(2, ne)
|
|
1950
1947
|
], jt);
|
|
1951
|
-
class
|
|
1948
|
+
class Wr {
|
|
1952
1949
|
constructor() {
|
|
1953
|
-
j(this, "_currentSelector$", new
|
|
1950
|
+
j(this, "_currentSelector$", new vr(null));
|
|
1954
1951
|
j(this, "currentSelector$", this._currentSelector$.asObservable());
|
|
1955
1952
|
}
|
|
1956
1953
|
showRangeSelectorDialog(t) {
|
|
@@ -1962,12 +1959,12 @@ class Br {
|
|
|
1962
1959
|
return this._currentSelector$.next(t), o;
|
|
1963
1960
|
}
|
|
1964
1961
|
}
|
|
1965
|
-
var
|
|
1966
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
1962
|
+
var Qi = Object.getOwnPropertyDescriptor, Ji = (e, t, n, o) => {
|
|
1963
|
+
for (var r = o > 1 ? void 0 : o ? Qi(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
1967
1964
|
(i = e[s]) && (r = i(r) || r);
|
|
1968
1965
|
return r;
|
|
1969
1966
|
}, ct = (e, t) => (n, o) => t(n, o, e);
|
|
1970
|
-
let Le = class extends
|
|
1967
|
+
let Le = class extends wo {
|
|
1971
1968
|
constructor(t, n, o, r, s, i, c) {
|
|
1972
1969
|
super(
|
|
1973
1970
|
n,
|
|
@@ -1978,7 +1975,7 @@ let Le = class extends ko {
|
|
|
1978
1975
|
);
|
|
1979
1976
|
j(this, "_workbookSelections");
|
|
1980
1977
|
j(this, "_eventDisposables");
|
|
1981
|
-
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(
|
|
1978
|
+
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(ec(this._themeService)), this._remainLastEnabled = !0, this._highlightHeader = !1;
|
|
1982
1979
|
}
|
|
1983
1980
|
getLocation() {
|
|
1984
1981
|
return this._skeleton.getLocation();
|
|
@@ -2002,7 +1999,7 @@ let Le = class extends ko {
|
|
|
2002
1999
|
* Call this method and user will be able to select on the canvas to update selections.
|
|
2003
2000
|
*/
|
|
2004
2001
|
enableSelectionChanging() {
|
|
2005
|
-
return this._disableSelectionChanging(), this._eventDisposables = this._initCanvasEventListeners(),
|
|
2002
|
+
return this._disableSelectionChanging(), this._eventDisposables = this._initCanvasEventListeners(), cr(() => this._disableSelectionChanging());
|
|
2006
2003
|
}
|
|
2007
2004
|
_disableSelectionChanging() {
|
|
2008
2005
|
var t;
|
|
@@ -2013,26 +2010,26 @@ let Le = class extends ko {
|
|
|
2013
2010
|
}
|
|
2014
2011
|
_initCanvasEventListeners() {
|
|
2015
2012
|
const t = this._getSheetObject(), { spreadsheetRowHeader: n, spreadsheetColumnHeader: o, spreadsheet: r, spreadsheetLeftTopPlaceholder: s } = t, { scene: i } = this._context, c = new Ye();
|
|
2016
|
-
return c.add(r == null ? void 0 : r.onPointerDown$.subscribeEvent((a,
|
|
2017
|
-
this.inRefSelectionMode() && (this._onPointerDown(a, r.zIndex + 1, Ie.NORMAL, this._getActiveViewport(a)), a.button !== 2 &&
|
|
2013
|
+
return c.add(r == null ? void 0 : r.onPointerDown$.subscribeEvent((a, d) => {
|
|
2014
|
+
this.inRefSelectionMode() && (this._onPointerDown(a, r.zIndex + 1, Ie.NORMAL, this._getActiveViewport(a)), a.button !== 2 && d.stopPropagation());
|
|
2018
2015
|
})), c.add(
|
|
2019
|
-
n == null ? void 0 : n.onPointerDown$.subscribeEvent((a,
|
|
2016
|
+
n == null ? void 0 : n.onPointerDown$.subscribeEvent((a, d) => {
|
|
2020
2017
|
if (!this.inRefSelectionMode()) return;
|
|
2021
|
-
const f = this._sheetSkeletonManagerService.getCurrent().skeleton, { row: m } =
|
|
2022
|
-
|
|
2018
|
+
const f = this._sheetSkeletonManagerService.getCurrent().skeleton, { row: m } = Vn(a.offsetX, a.offsetY, i, f);
|
|
2019
|
+
Wn(this._workbookSelections.getCurrentSelections(), m, Ie.ROW) || (this._onPointerDown(a, (r.zIndex || 1) + 1, Ie.ROW, this._getActiveViewport(a), en.Y), a.button !== 2 && d.stopPropagation());
|
|
2023
2020
|
})
|
|
2024
|
-
), c.add(o == null ? void 0 : o.onPointerDown$.subscribeEvent((a,
|
|
2021
|
+
), c.add(o == null ? void 0 : o.onPointerDown$.subscribeEvent((a, d) => {
|
|
2025
2022
|
if (!this.inRefSelectionMode()) return;
|
|
2026
|
-
const f = this._sheetSkeletonManagerService.getCurrent().skeleton, { column: m } =
|
|
2027
|
-
|
|
2028
|
-
})), c.add(s == null ? void 0 : s.onPointerDown$.subscribeEvent((a,
|
|
2023
|
+
const f = this._sheetSkeletonManagerService.getCurrent().skeleton, { column: m } = Vn(a.offsetX, a.offsetY, i, f);
|
|
2024
|
+
Wn(this._workbookSelections.getCurrentSelections(), m, Ie.COLUMN) || (this._onPointerDown(a, (r.zIndex || 1) + 1, Ie.COLUMN, this._getActiveViewport(a), en.X), a.button !== 2 && d.stopPropagation());
|
|
2025
|
+
})), c.add(s == null ? void 0 : s.onPointerDown$.subscribeEvent((a, d) => {
|
|
2029
2026
|
if (this._reset(), !this.inRefSelectionMode()) return;
|
|
2030
|
-
const f = this._sheetSkeletonManagerService.getCurrent().skeleton, m =
|
|
2027
|
+
const f = this._sheetSkeletonManagerService.getCurrent().skeleton, m = ko(f);
|
|
2031
2028
|
this._addSelectionControlByModelData(m), this._selectionMoveStart$.next(this.getSelectionDataWithStyle());
|
|
2032
|
-
const
|
|
2033
|
-
|
|
2029
|
+
const u = i.onPointerUp$.subscribeEvent(() => {
|
|
2030
|
+
u.unsubscribe(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle());
|
|
2034
2031
|
});
|
|
2035
|
-
a.button !== 2 &&
|
|
2032
|
+
a.button !== 2 && d.stopPropagation();
|
|
2036
2033
|
})), c;
|
|
2037
2034
|
}
|
|
2038
2035
|
/**
|
|
@@ -2042,7 +2039,7 @@ let Le = class extends ko {
|
|
|
2042
2039
|
*/
|
|
2043
2040
|
_addSelectionControlByModelData(t) {
|
|
2044
2041
|
var i;
|
|
2045
|
-
const n = this._skeleton, o = (i = t.style) != null ? i :
|
|
2042
|
+
const n = this._skeleton, o = (i = t.style) != null ? i : fr(this._themeService), r = this._scene;
|
|
2046
2043
|
return t.style = o, this.newSelectionControl(r, n, t);
|
|
2047
2044
|
}
|
|
2048
2045
|
_initSelectionChangeListener() {
|
|
@@ -2066,7 +2063,7 @@ let Le = class extends ko {
|
|
|
2066
2063
|
const r = this._context.unit.getActiveSheet().getSheetId();
|
|
2067
2064
|
t.length !== 0 && this._workbookSelections.setSelections(
|
|
2068
2065
|
r,
|
|
2069
|
-
t.map((s) =>
|
|
2066
|
+
t.map((s) => hs(s)),
|
|
2070
2067
|
n
|
|
2071
2068
|
);
|
|
2072
2069
|
}
|
|
@@ -2086,7 +2083,7 @@ let Le = class extends ko {
|
|
|
2086
2083
|
return n == null ? void 0 : n.scene.getActiveViewportByCoord(Yn.FromArray([t.offsetX, t.offsetY]));
|
|
2087
2084
|
}
|
|
2088
2085
|
_getSheetObject() {
|
|
2089
|
-
return
|
|
2086
|
+
return Ao(this._context.unit, this._context);
|
|
2090
2087
|
}
|
|
2091
2088
|
/**
|
|
2092
2089
|
* Handle pointer down event, bind pointermove & pointerup handler.
|
|
@@ -2106,11 +2103,11 @@ let Le = class extends ko {
|
|
|
2106
2103
|
if (!c || !i)
|
|
2107
2104
|
return;
|
|
2108
2105
|
r && (this._activeViewport = r);
|
|
2109
|
-
const { offsetX: a, offsetY:
|
|
2106
|
+
const { offsetX: a, offsetY: d } = t, f = c.getViewport(Kn.VIEW_MAIN);
|
|
2110
2107
|
if (!f) return;
|
|
2111
|
-
const m = c.getCoordRelativeToViewport(Yn.FromArray([a,
|
|
2112
|
-
this._startViewportPosX =
|
|
2113
|
-
const l = c.getScrollXYInfoByViewport(m), { scaleX:
|
|
2108
|
+
const m = c.getCoordRelativeToViewport(Yn.FromArray([a, d])), { x: u, y: h } = m;
|
|
2109
|
+
this._startViewportPosX = u, this._startViewportPosY = h;
|
|
2110
|
+
const l = c.getScrollXYInfoByViewport(m), { scaleX: S, scaleY: v } = c.getAncestorScale(), g = this._skeleton.getCellByOffset(u, h, S, v, l);
|
|
2114
2111
|
if (!g) return;
|
|
2115
2112
|
switch (o) {
|
|
2116
2113
|
case Ie.NORMAL:
|
|
@@ -2144,9 +2141,9 @@ let Le = class extends ko {
|
|
|
2144
2141
|
},
|
|
2145
2142
|
style: null
|
|
2146
2143
|
}), C.range.rangeType = o;
|
|
2147
|
-
const
|
|
2148
|
-
this._startRangeWhenPointerDown = { ...
|
|
2149
|
-
const E = { ...
|
|
2144
|
+
const R = sn(C, this._skeleton);
|
|
2145
|
+
this._startRangeWhenPointerDown = { ...R.rangeWithCoord };
|
|
2146
|
+
const E = { ...R.rangeWithCoord, rangeType: o };
|
|
2150
2147
|
let p = this.getActiveSelectionControl();
|
|
2151
2148
|
const b = this.getSelectionControls();
|
|
2152
2149
|
for (const M of b) {
|
|
@@ -2160,18 +2157,18 @@ let Le = class extends ko {
|
|
|
2160
2157
|
}
|
|
2161
2158
|
}
|
|
2162
2159
|
this._checkClearPreviousControls(t);
|
|
2163
|
-
const
|
|
2164
|
-
|
|
2165
|
-
|
|
2160
|
+
const T = p == null ? void 0 : p.model.currentCell, F = t.shiftKey && T, A = this._remainLastEnabled && !t.ctrlKey && !t.shiftKey && !this._skipLastEnabled && !this._singleSelectionEnabled;
|
|
2161
|
+
F && T ? this._makeSelectionByTwoCells(
|
|
2162
|
+
T,
|
|
2166
2163
|
E,
|
|
2167
2164
|
i,
|
|
2168
2165
|
o,
|
|
2169
2166
|
p
|
|
2170
2167
|
// Get updated in this method
|
|
2171
|
-
) :
|
|
2168
|
+
) : A && p ? p.updateRangeBySelectionWithCoord(R) : p = this.newSelectionControl(c, i, C);
|
|
2172
2169
|
for (let M = 0; M < this.getSelectionControls().length - 1; M++)
|
|
2173
2170
|
this.getSelectionControls()[M].clearHighlight();
|
|
2174
|
-
this._selectionMoveStart$.next(this.getSelectionDataWithStyle()), c.disableObjectsEvent(), this._clearUpdatingListeners(), this._addEndingListeners(), (N = c.getTransformer()) == null || N.clearSelectedObjects(), this._setupPointerMoveListener(f, p, o, s,
|
|
2171
|
+
this._selectionMoveStart$.next(this.getSelectionDataWithStyle()), c.disableObjectsEvent(), this._clearUpdatingListeners(), this._addEndingListeners(), (N = c.getTransformer()) == null || N.clearSelectedObjects(), this._setupPointerMoveListener(f, p, o, s, u, h), this._escapeShortcutDisposable = this._shortcutService.forceEscape(), this._scenePointerUpSub = c.onPointerUp$.subscribeEvent(() => {
|
|
2175
2172
|
var M;
|
|
2176
2173
|
this._clearUpdatingListeners(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle()), (M = this._escapeShortcutDisposable) == null || M.dispose(), this._escapeShortcutDisposable = null;
|
|
2177
2174
|
});
|
|
@@ -2184,7 +2181,7 @@ let Le = class extends ko {
|
|
|
2184
2181
|
* @returns {SelectionControl} selectionControl just created
|
|
2185
2182
|
*/
|
|
2186
2183
|
newSelectionControl(t, n, o) {
|
|
2187
|
-
const r = this.getSelectionControls().length, { rowHeaderWidth: s, columnHeaderHeight: i } = n, c = new
|
|
2184
|
+
const r = this.getSelectionControls().length, { rowHeaderWidth: s, columnHeaderHeight: i } = n, c = new hr(t, r, this._themeService, {
|
|
2188
2185
|
highlightHeader: this._highlightHeader,
|
|
2189
2186
|
enableAutoFill: !1,
|
|
2190
2187
|
rowHeaderWidth: s,
|
|
@@ -2203,7 +2200,7 @@ let Le = class extends ko {
|
|
|
2203
2200
|
}), c;
|
|
2204
2201
|
}
|
|
2205
2202
|
};
|
|
2206
|
-
Le =
|
|
2203
|
+
Le = Ji([
|
|
2207
2204
|
ct(1, q(It)),
|
|
2208
2205
|
ct(2, q(Et)),
|
|
2209
2206
|
ct(3, zt),
|
|
@@ -2211,11 +2208,11 @@ Le = nc([
|
|
|
2211
2208
|
ct(5, dn),
|
|
2212
2209
|
ct(6, Gt)
|
|
2213
2210
|
], Le);
|
|
2214
|
-
function
|
|
2215
|
-
const t =
|
|
2211
|
+
function ec(e) {
|
|
2212
|
+
const t = fr(e);
|
|
2216
2213
|
return t.widgets = { tl: !0, tc: !0, tr: !0, ml: !0, mr: !0, bl: !0, bc: !0, br: !0 }, t;
|
|
2217
2214
|
}
|
|
2218
|
-
const
|
|
2215
|
+
const On = (e, t, n = !0) => {
|
|
2219
2216
|
let o = -1;
|
|
2220
2217
|
return e.reduce((r, s, i) => {
|
|
2221
2218
|
if (r.isFinish)
|
|
@@ -2229,7 +2226,7 @@ const Tn = (e, t, n = !0) => {
|
|
|
2229
2226
|
}
|
|
2230
2227
|
return (n ? r.currentIndex === t : t > c && t <= r.currentIndex) && (o = i, r.isFinish = !0), r;
|
|
2231
2228
|
}, { currentIndex: 0, isFinish: !1 }), o;
|
|
2232
|
-
},
|
|
2229
|
+
}, Hr = (e, t) => {
|
|
2233
2230
|
const n = e[t];
|
|
2234
2231
|
let o = -1;
|
|
2235
2232
|
if (!n || typeof n == "string" || n.nodeType !== Q.REFERENCE) return -1;
|
|
@@ -2238,7 +2235,7 @@ const Tn = (e, t, n = !0) => {
|
|
|
2238
2235
|
typeof s != "string" && s.nodeType === Q.REFERENCE && o++;
|
|
2239
2236
|
}
|
|
2240
2237
|
return o;
|
|
2241
|
-
},
|
|
2238
|
+
}, tc = (e, t = 100) => {
|
|
2242
2239
|
P(() => {
|
|
2243
2240
|
let n = null;
|
|
2244
2241
|
const o = () => {
|
|
@@ -2251,74 +2248,74 @@ const Tn = (e, t, n = !0) => {
|
|
|
2251
2248
|
};
|
|
2252
2249
|
}, [e, t]);
|
|
2253
2250
|
};
|
|
2254
|
-
function
|
|
2255
|
-
const o =
|
|
2256
|
-
var
|
|
2251
|
+
function Br(e, t, n) {
|
|
2252
|
+
const o = y(ze), r = le(() => new vr({ left: -999, top: -999, right: -999, bottom: -999 }), []), s = y(In), i = y(ne), c = ee(() => {
|
|
2253
|
+
var R;
|
|
2257
2254
|
const a = o.getEditor(e);
|
|
2258
2255
|
if (!a)
|
|
2259
2256
|
return;
|
|
2260
|
-
const
|
|
2261
|
-
if (!
|
|
2262
|
-
const
|
|
2263
|
-
let { left: l, top:
|
|
2264
|
-
|
|
2257
|
+
const d = a.getBoundingClientRect(), { marginTop: f = 0, marginBottom: m = 0 } = a.getDocumentData().documentStyle, u = a.getSkeleton();
|
|
2258
|
+
if (!u) return;
|
|
2259
|
+
const h = (R = u.getSkeletonData()) == null ? void 0 : R.pages[0].height;
|
|
2260
|
+
let { left: l, top: S, right: v, bottom: g } = d;
|
|
2261
|
+
S = S + f, g = h ? S + h : g - m;
|
|
2265
2262
|
const C = r.getValue();
|
|
2266
|
-
if (!(C.left === l && C.top ===
|
|
2267
|
-
return r.next({ left: l - 1, right:
|
|
2263
|
+
if (!(C.left === l && C.top === S && C.right === v && C.bottom === g))
|
|
2264
|
+
return r.next({ left: l - 1, right: v + 1, top: S - 1, bottom: g + 1 }), d;
|
|
2268
2265
|
});
|
|
2269
2266
|
return P(() => {
|
|
2270
2267
|
t && c();
|
|
2271
|
-
}, [e, o, i.unitAdded$, c, t, ...n != null ? n : []]),
|
|
2272
|
-
const a = s.scrollEvent$.pipe(
|
|
2268
|
+
}, [e, o, i.unitAdded$, c, t, ...n != null ? n : []]), tc(c), P(() => {
|
|
2269
|
+
const a = s.scrollEvent$.pipe(Go(100)).subscribe(c);
|
|
2273
2270
|
return () => {
|
|
2274
2271
|
a.unsubscribe();
|
|
2275
2272
|
};
|
|
2276
2273
|
}, []), [r, c];
|
|
2277
2274
|
}
|
|
2278
2275
|
const rt = (e) => {
|
|
2279
|
-
const t =
|
|
2276
|
+
const t = X(e);
|
|
2280
2277
|
return t.current = e, t;
|
|
2281
|
-
},
|
|
2282
|
-
const o =
|
|
2283
|
-
|
|
2278
|
+
}, nc = (e, t, n) => {
|
|
2279
|
+
const o = y(Xt), r = y(Zt), s = y(ye), [i, c] = H(), [a, d] = H(-1), [f, m] = H(!0), u = rt(f), h = X(t);
|
|
2280
|
+
h.current = t;
|
|
2284
2281
|
const l = () => {
|
|
2285
|
-
c(void 0),
|
|
2282
|
+
c(void 0), d(-1), m(!1);
|
|
2286
2283
|
};
|
|
2287
2284
|
return P(() => {
|
|
2288
|
-
const
|
|
2289
|
-
o.setSequenceNodes(
|
|
2285
|
+
const S = s.sequenceNodesBuilder(t.slice(1));
|
|
2286
|
+
o.setSequenceNodes(S != null ? S : []);
|
|
2290
2287
|
}, [t]), P(() => {
|
|
2291
2288
|
if (n && e) {
|
|
2292
|
-
const
|
|
2289
|
+
const S = n.selectionChange$.pipe(vn(50)).subscribe((g) => {
|
|
2293
2290
|
if (g.textRanges.length === 1) {
|
|
2294
2291
|
const [C] = g.textRanges;
|
|
2295
|
-
if (C.collapsed &&
|
|
2296
|
-
const { startOffset:
|
|
2292
|
+
if (C.collapsed && u.current) {
|
|
2293
|
+
const { startOffset: R } = C, E = o.getCurrentSequenceNodeIndex(R - 2), p = o.getCurrentSequenceNodeByIndex(E), b = o.getCurrentSequenceNodeByIndex(E + 1);
|
|
2297
2294
|
if (p)
|
|
2298
2295
|
if (typeof p != "string" && p.nodeType === 3 && !r.hasDefinedNameDescription(p.token.trim()) && b === Ge.OPEN_BRACKET) {
|
|
2299
|
-
const
|
|
2300
|
-
c(
|
|
2296
|
+
const T = r.getFunctionInfo(p.token);
|
|
2297
|
+
c(T), d(-1);
|
|
2301
2298
|
return;
|
|
2302
2299
|
} else {
|
|
2303
|
-
const
|
|
2304
|
-
if (
|
|
2305
|
-
const { functionName:
|
|
2306
|
-
c(N),
|
|
2300
|
+
const T = s.getFunctionAndParameter(`${h.current}A`, R - 1);
|
|
2301
|
+
if (T) {
|
|
2302
|
+
const { functionName: F, paramIndex: A } = T, N = r.getFunctionInfo(F);
|
|
2303
|
+
c(N), d(A);
|
|
2307
2304
|
return;
|
|
2308
2305
|
}
|
|
2309
2306
|
}
|
|
2310
2307
|
}
|
|
2311
2308
|
}
|
|
2312
|
-
c(void 0),
|
|
2313
|
-
}),
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2309
|
+
c(void 0), d(-1);
|
|
2310
|
+
}), v = n.selectionChange$.pipe(
|
|
2311
|
+
Cr((g) => g.textRanges.length === 1),
|
|
2312
|
+
Sr((g) => g.textRanges[0].startOffset),
|
|
2313
|
+
Zo()
|
|
2317
2314
|
).subscribe(() => {
|
|
2318
2315
|
m(!0);
|
|
2319
2316
|
});
|
|
2320
2317
|
return () => {
|
|
2321
|
-
|
|
2318
|
+
S.unsubscribe(), v.unsubscribe();
|
|
2322
2319
|
};
|
|
2323
2320
|
}
|
|
2324
2321
|
}, [n, e]), P(() => {
|
|
@@ -2328,7 +2325,7 @@ const rt = (e) => {
|
|
|
2328
2325
|
paramIndex: a,
|
|
2329
2326
|
reset: l
|
|
2330
2327
|
};
|
|
2331
|
-
},
|
|
2328
|
+
}, rc = ({ onClick: e }) => /* @__PURE__ */ x(
|
|
2332
2329
|
"div",
|
|
2333
2330
|
{
|
|
2334
2331
|
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",
|
|
@@ -2350,7 +2347,7 @@ const rt = (e) => {
|
|
|
2350
2347
|
children: n
|
|
2351
2348
|
}
|
|
2352
2349
|
)
|
|
2353
|
-
] }),
|
|
2350
|
+
] }), oc = (e) => {
|
|
2354
2351
|
const { prefix: t, value: n, active: o, onClick: r } = e;
|
|
2355
2352
|
return /* @__PURE__ */ B("div", { children: [
|
|
2356
2353
|
/* @__PURE__ */ B("span", { children: [
|
|
@@ -2363,37 +2360,37 @@ const rt = (e) => {
|
|
|
2363
2360
|
{
|
|
2364
2361
|
className: o === i ? "univer-text-primary-500" : "",
|
|
2365
2362
|
onClick: () => r(i),
|
|
2366
|
-
children:
|
|
2363
|
+
children: kr(s)
|
|
2367
2364
|
}
|
|
2368
2365
|
),
|
|
2369
2366
|
i === n.length - 1 ? "" : ","
|
|
2370
2367
|
] }, s.name)),
|
|
2371
2368
|
")"
|
|
2372
2369
|
] });
|
|
2373
|
-
},
|
|
2370
|
+
}, nr = () => {
|
|
2374
2371
|
};
|
|
2375
|
-
function
|
|
2376
|
-
const { onParamsSwitch: t =
|
|
2372
|
+
function sc(e) {
|
|
2373
|
+
const { onParamsSwitch: t = nr, onClose: n = nr, isFocus: o, editor: r, formulaText: s } = e, { functionInfo: i, paramIndex: c, reset: a } = nc(o, s, r), d = y(Sn), f = !_e(d.helpFunctionVisible$), [m, u] = H(!1), h = y(dt), l = h.t("formula.prompt.required"), S = h.t("formula.prompt.optional"), v = r.getEditorId(), [g] = Br(v, !!i, [i, c]);
|
|
2377
2374
|
function C(p) {
|
|
2378
2375
|
t && t(p);
|
|
2379
2376
|
}
|
|
2380
|
-
const
|
|
2381
|
-
|
|
2377
|
+
const R = ee((p) => {
|
|
2378
|
+
d.helpFunctionVisible$.next(!p);
|
|
2382
2379
|
}), E = () => {
|
|
2383
|
-
|
|
2380
|
+
R(!0), n();
|
|
2384
2381
|
};
|
|
2385
|
-
return i ? f ? /* @__PURE__ */ x(cn, { portal: !0, anchorRect$: g, direction: "left-center", children: /* @__PURE__ */ x(
|
|
2382
|
+
return i ? f ? /* @__PURE__ */ x(cn, { portal: !0, anchorRect$: g, direction: "left-center", children: /* @__PURE__ */ x(rc, { onClick: () => R(!1) }) }, "hidden") : /* @__PURE__ */ x(cn, { portal: !0, onClickOutside: () => a(), anchorRect$: g, direction: "vertical", children: /* @__PURE__ */ B(
|
|
2386
2383
|
"div",
|
|
2387
2384
|
{
|
|
2388
|
-
className: se("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",
|
|
2385
|
+
className: se("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", En),
|
|
2389
2386
|
children: [
|
|
2390
2387
|
/* @__PURE__ */ B(
|
|
2391
2388
|
"div",
|
|
2392
2389
|
{
|
|
2393
|
-
className: se("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",
|
|
2390
|
+
className: se("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", xs),
|
|
2394
2391
|
children: [
|
|
2395
2392
|
/* @__PURE__ */ x(
|
|
2396
|
-
|
|
2393
|
+
oc,
|
|
2397
2394
|
{
|
|
2398
2395
|
prefix: i.functionName,
|
|
2399
2396
|
value: i.functionParameter,
|
|
@@ -2407,8 +2404,8 @@ function lc(e) {
|
|
|
2407
2404
|
{
|
|
2408
2405
|
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",
|
|
2409
2406
|
style: { transform: m ? "rotateZ(-90deg)" : "rotateZ(90deg)" },
|
|
2410
|
-
onClick: () =>
|
|
2411
|
-
children: /* @__PURE__ */ x(
|
|
2407
|
+
onClick: () => u(!m),
|
|
2408
|
+
children: /* @__PURE__ */ x(Ur, {})
|
|
2412
2409
|
}
|
|
2413
2410
|
),
|
|
2414
2411
|
/* @__PURE__ */ x(
|
|
@@ -2416,7 +2413,7 @@ function lc(e) {
|
|
|
2416
2413
|
{
|
|
2417
2414
|
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",
|
|
2418
2415
|
onClick: E,
|
|
2419
|
-
children: /* @__PURE__ */ x(
|
|
2416
|
+
children: /* @__PURE__ */ x(Lr, {})
|
|
2420
2417
|
}
|
|
2421
2418
|
)
|
|
2422
2419
|
] })
|
|
@@ -2435,14 +2432,14 @@ function lc(e) {
|
|
|
2435
2432
|
/* @__PURE__ */ x(
|
|
2436
2433
|
on,
|
|
2437
2434
|
{
|
|
2438
|
-
title:
|
|
2435
|
+
title: h.t("formula.prompt.helpExample"),
|
|
2439
2436
|
value: `${i.functionName}(${i.functionParameter.map((p) => p.example).join(",")})`
|
|
2440
2437
|
}
|
|
2441
2438
|
),
|
|
2442
2439
|
/* @__PURE__ */ x(
|
|
2443
2440
|
on,
|
|
2444
2441
|
{
|
|
2445
|
-
title:
|
|
2442
|
+
title: h.t("formula.prompt.helpAbstract"),
|
|
2446
2443
|
value: i.description
|
|
2447
2444
|
}
|
|
2448
2445
|
),
|
|
@@ -2451,7 +2448,7 @@ function lc(e) {
|
|
|
2451
2448
|
{
|
|
2452
2449
|
className: c === b ? "univer-text-primary-500" : "",
|
|
2453
2450
|
title: p.name,
|
|
2454
|
-
value: `${p.require ? l :
|
|
2451
|
+
value: `${p.require ? l : S} ${p.detail}`
|
|
2455
2452
|
},
|
|
2456
2453
|
b
|
|
2457
2454
|
))
|
|
@@ -2462,8 +2459,8 @@ function lc(e) {
|
|
|
2462
2459
|
}
|
|
2463
2460
|
) }, "show") : null;
|
|
2464
2461
|
}
|
|
2465
|
-
const
|
|
2466
|
-
const t =
|
|
2462
|
+
const ic = (e) => {
|
|
2463
|
+
const t = y(ze);
|
|
2467
2464
|
return ee((o) => {
|
|
2468
2465
|
var r, s;
|
|
2469
2466
|
if (e) {
|
|
@@ -2480,44 +2477,44 @@ const ac = (e) => {
|
|
|
2480
2477
|
}
|
|
2481
2478
|
});
|
|
2482
2479
|
};
|
|
2483
|
-
function
|
|
2480
|
+
function cc(e) {
|
|
2484
2481
|
var r, s;
|
|
2485
|
-
const n = e.get(
|
|
2482
|
+
const n = e.get(ne).getCurrentUniverDocInstance();
|
|
2486
2483
|
return n != null && n.getBody() ? { dataStream: (s = (r = n.getBody()) == null ? void 0 : r.dataStream) != null ? s : "", offset: 0 } : void 0;
|
|
2487
2484
|
}
|
|
2488
2485
|
var Me = /* @__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))(Me || {});
|
|
2489
|
-
function
|
|
2490
|
-
var
|
|
2491
|
-
const { editorId: t, isFocus: n, disableOnClick: o, unitId: r, subUnitId: s } = e, i =
|
|
2486
|
+
function lc(e) {
|
|
2487
|
+
var T;
|
|
2488
|
+
const { editorId: t, isFocus: n, disableOnClick: o, unitId: r, subUnitId: s } = e, i = y(Te), c = y(ne), a = i.getRenderById(r), d = i.getRenderById(t), f = d == null ? void 0 : d.with(_r), m = y(Tr), u = y(It), [h, l] = H(
|
|
2492
2489
|
0
|
|
2493
2490
|
/* NOT_SELECT */
|
|
2494
|
-
),
|
|
2491
|
+
), S = y(ye), v = X(!0), g = a == null ? void 0 : a.with(Le), C = rt(h), R = c.getUnit(r, W.UNIVER_SHEET), E = R == null ? void 0 : R.getSheetBySheetId(s), p = ee((F) => {
|
|
2495
2492
|
g && g.setSkipLastEnabled(
|
|
2496
|
-
|
|
2493
|
+
F === 1 || F === 3 || F === 4
|
|
2497
2494
|
/* EDIT_OTHER_WORKBOOK_REFERENCE */
|
|
2498
|
-
), C.current =
|
|
2495
|
+
), C.current = F, l(F);
|
|
2499
2496
|
}), b = ee(() => {
|
|
2500
|
-
var
|
|
2501
|
-
const
|
|
2502
|
-
if (!
|
|
2503
|
-
const
|
|
2504
|
-
if (!
|
|
2505
|
-
const
|
|
2506
|
-
...
|
|
2507
|
-
range:
|
|
2497
|
+
var Y, re, he;
|
|
2498
|
+
const F = c.getCurrentUnitOfType(W.UNIVER_SHEET);
|
|
2499
|
+
if (!F) return;
|
|
2500
|
+
const A = F.getActiveSheet(), N = f == null ? void 0 : f.getActiveTextRange(), M = N != null && N.collapsed ? N.startOffset : -1, w = cc(u);
|
|
2501
|
+
if (!w) return;
|
|
2502
|
+
const k = (Y = w == null ? void 0 : w.dataStream) == null ? void 0 : Y.slice(0, -2), $ = ((re = S.sequenceNodesBuilder(k)) != null ? re : []).map((G) => typeof G == "object" ? G.nodeType === Q.REFERENCE ? {
|
|
2503
|
+
...G,
|
|
2504
|
+
range: Wo(G.token)
|
|
2508
2505
|
} : {
|
|
2509
|
-
...
|
|
2506
|
+
...G,
|
|
2510
2507
|
range: void 0
|
|
2511
|
-
} :
|
|
2512
|
-
if ((
|
|
2513
|
-
if (
|
|
2514
|
-
if (
|
|
2508
|
+
} : G), I = k[M - 1], _ = k[M], O = $.find((G) => typeof G == "object" && G.nodeType === Q.REFERENCE && M === G.endIndex + 2), D = I && Ho(I) && (!_ || Bo(_) && _ !== Ge.OPEN_BRACKET), U = !!O;
|
|
2509
|
+
if ((k == null ? void 0 : k.substring(0, 1)) === "=" && (D || U))
|
|
2510
|
+
if (U) {
|
|
2511
|
+
if (v.current)
|
|
2515
2512
|
return;
|
|
2516
|
-
const { sheetName:
|
|
2513
|
+
const { sheetName: G, unitId: J } = O.range, ot = (he = c.getCurrentUnitOfType(W.UNIVER_SHEET)) == null ? void 0 : he.getUnitId();
|
|
2517
2514
|
J && J !== ot ? p(
|
|
2518
2515
|
4
|
|
2519
2516
|
/* EDIT_OTHER_WORKBOOK_REFERENCE */
|
|
2520
|
-
) : !
|
|
2517
|
+
) : !G && A.getSheetId() === (E == null ? void 0 : E.getSheetId()) || G === A.getName() ? p(
|
|
2521
2518
|
2
|
|
2522
2519
|
/* CAN_EDIT */
|
|
2523
2520
|
) : p(
|
|
@@ -2525,7 +2522,7 @@ function dc(e) {
|
|
|
2525
2522
|
/* EDIT_OTHER_SHEET_REFERENCE */
|
|
2526
2523
|
);
|
|
2527
2524
|
} else
|
|
2528
|
-
|
|
2525
|
+
v.current = !1, p(
|
|
2529
2526
|
1
|
|
2530
2527
|
/* NEED_ADD */
|
|
2531
2528
|
);
|
|
@@ -2536,42 +2533,42 @@ function dc(e) {
|
|
|
2536
2533
|
);
|
|
2537
2534
|
});
|
|
2538
2535
|
return P(() => {
|
|
2539
|
-
const
|
|
2536
|
+
const F = m.textSelection$.pipe(Cr((A) => A.unitId === t)).subscribe(() => {
|
|
2540
2537
|
b();
|
|
2541
2538
|
});
|
|
2542
|
-
return () =>
|
|
2539
|
+
return () => F.unsubscribe();
|
|
2543
2540
|
}, [b, m.textSelection$, t]), P(() => {
|
|
2544
2541
|
n || (p(
|
|
2545
2542
|
0
|
|
2546
2543
|
/* NOT_SELECT */
|
|
2547
|
-
),
|
|
2544
|
+
), v.current = !0);
|
|
2548
2545
|
}, [n, p]), P(() => {
|
|
2549
|
-
var
|
|
2546
|
+
var A;
|
|
2550
2547
|
if (!o) return;
|
|
2551
|
-
const
|
|
2548
|
+
const F = (A = d == null ? void 0 : d.mainComponent) == null ? void 0 : A.onPointerDown$.subscribeEvent(() => {
|
|
2552
2549
|
p(
|
|
2553
2550
|
0
|
|
2554
2551
|
/* NOT_SELECT */
|
|
2555
|
-
),
|
|
2552
|
+
), v.current = !0;
|
|
2556
2553
|
});
|
|
2557
|
-
return () =>
|
|
2558
|
-
}, [o, (
|
|
2554
|
+
return () => F == null ? void 0 : F.unsubscribe();
|
|
2555
|
+
}, [o, (T = d == null ? void 0 : d.mainComponent) == null ? void 0 : T.onPointerDown$, p]), P(() => {
|
|
2559
2556
|
if (!n) return;
|
|
2560
|
-
const
|
|
2557
|
+
const F = R == null ? void 0 : R.activeSheet$.subscribe(() => {
|
|
2561
2558
|
b();
|
|
2562
|
-
}),
|
|
2559
|
+
}), A = c.getCurrentTypeOfUnit$(W.UNIVER_SHEET).subscribe(() => {
|
|
2563
2560
|
b();
|
|
2564
2561
|
});
|
|
2565
2562
|
return () => {
|
|
2566
|
-
|
|
2563
|
+
F == null || F.unsubscribe(), A == null || A.unsubscribe();
|
|
2567
2564
|
};
|
|
2568
|
-
}, [b, n,
|
|
2565
|
+
}, [b, n, R == null ? void 0 : R.activeSheet$, c.getCurrentTypeOfUnit$]), { isSelecting: h, isSelectingRef: C };
|
|
2569
2566
|
}
|
|
2570
|
-
const
|
|
2571
|
-
const e =
|
|
2567
|
+
const ac = () => {
|
|
2568
|
+
const e = y(ye);
|
|
2572
2569
|
return $t((n) => e.sequenceNodesBuilder(n) || [], [e]);
|
|
2573
2570
|
};
|
|
2574
|
-
function
|
|
2571
|
+
function uc(e, t, n) {
|
|
2575
2572
|
const o = new mn(t).setAlpha(0.05).toRgbString();
|
|
2576
2573
|
return {
|
|
2577
2574
|
id: n,
|
|
@@ -2584,8 +2581,8 @@ function fc(e, t, n) {
|
|
|
2584
2581
|
widgetStroke: e.getColorFromTheme("white")
|
|
2585
2582
|
};
|
|
2586
2583
|
}
|
|
2587
|
-
function
|
|
2588
|
-
var
|
|
2584
|
+
function qr(e) {
|
|
2585
|
+
var R, E, p;
|
|
2589
2586
|
const {
|
|
2590
2587
|
unitId: t,
|
|
2591
2588
|
subUnitId: n,
|
|
@@ -2595,49 +2592,49 @@ function Kr(e) {
|
|
|
2595
2592
|
refSelectionsService: i,
|
|
2596
2593
|
refSelectionsRenderService: c,
|
|
2597
2594
|
sheetSkeletonManagerService: a,
|
|
2598
|
-
themeService:
|
|
2595
|
+
themeService: d,
|
|
2599
2596
|
univerInstanceService: f
|
|
2600
|
-
} = e, m = o.getUnitId(),
|
|
2601
|
-
if (!
|
|
2597
|
+
} = e, m = o.getUnitId(), u = f.getUnit(t, W.UNIVER_SHEET), h = u == null ? void 0 : u.getActiveSheet(), l = [];
|
|
2598
|
+
if (!u || !h) {
|
|
2602
2599
|
i.setSelections(l);
|
|
2603
2600
|
return;
|
|
2604
2601
|
}
|
|
2605
|
-
const
|
|
2606
|
-
var
|
|
2607
|
-
return (
|
|
2602
|
+
const S = h.getSheetId(), v = (b) => {
|
|
2603
|
+
var T;
|
|
2604
|
+
return (T = u == null ? void 0 : u.getSheetBySheetName(b)) == null ? void 0 : T.getSheetId();
|
|
2608
2605
|
};
|
|
2609
|
-
if (!((
|
|
2606
|
+
if (!((R = a == null ? void 0 : a.getWorksheetSkeleton(S)) == null ? void 0 : R.skeleton)) return;
|
|
2610
2607
|
const C = [];
|
|
2611
|
-
for (let b = 0,
|
|
2612
|
-
const
|
|
2613
|
-
if (!
|
|
2608
|
+
for (let b = 0, T = r.length; b < T; b++) {
|
|
2609
|
+
const F = r[b], { themeColor: A, token: N, refIndex: M, endIndex: w } = F, k = ht(N), { unitId: $, sheetName: I, range: _ } = k, O = v(I);
|
|
2610
|
+
if (!O && I || m !== t && $ !== m || $ && $ !== m || O && O !== S || !O && S !== n)
|
|
2614
2611
|
continue;
|
|
2615
|
-
const
|
|
2616
|
-
|
|
2617
|
-
range:
|
|
2612
|
+
const D = fs(_, h.getRowCount(), h.getColumnCount());
|
|
2613
|
+
D.unitId = t, D.sheetId = S, l.push({
|
|
2614
|
+
range: D,
|
|
2618
2615
|
primary: null,
|
|
2619
|
-
style:
|
|
2620
|
-
}), C.push(
|
|
2616
|
+
style: uc(d, A, M.toString())
|
|
2617
|
+
}), C.push(w);
|
|
2621
2618
|
}
|
|
2622
2619
|
if (s) {
|
|
2623
|
-
const b = (p = (E = s.getSelectionRanges()) == null ? void 0 : E[0]) == null ? void 0 : p.startOffset,
|
|
2624
|
-
|
|
2620
|
+
const b = (p = (E = s.getSelectionRanges()) == null ? void 0 : E[0]) == null ? void 0 : p.startOffset, T = C.findIndex((F) => F + 2 === b);
|
|
2621
|
+
T !== -1 ? c == null || c.setActiveSelectionIndex(T) : c == null || c.resetActiveSelectionIndex();
|
|
2625
2622
|
}
|
|
2626
2623
|
return l;
|
|
2627
2624
|
}
|
|
2628
|
-
function
|
|
2629
|
-
const n =
|
|
2630
|
-
const
|
|
2631
|
-
if (!
|
|
2632
|
-
const l =
|
|
2625
|
+
function dc(e, t) {
|
|
2626
|
+
const n = y(ne), o = y(Et), r = y(Gt), s = y(Te), i = _e(le(() => n.getCurrentTypeOfUnit$(W.UNIVER_SHEET), [n])), c = i ? s.getRenderById(i.getUnitId()) : null, a = c == null ? void 0 : c.with(Le), d = c == null ? void 0 : c.with(bt), f = ee((m, u) => {
|
|
2627
|
+
const h = n.getCurrentUnitOfType(W.UNIVER_SHEET);
|
|
2628
|
+
if (!h || a != null && a.selectionMoving) return;
|
|
2629
|
+
const l = qr({
|
|
2633
2630
|
unitId: e,
|
|
2634
2631
|
subUnitId: t,
|
|
2635
|
-
currentWorkbook:
|
|
2632
|
+
currentWorkbook: h,
|
|
2636
2633
|
refSelections: m,
|
|
2637
|
-
editor:
|
|
2634
|
+
editor: u,
|
|
2638
2635
|
refSelectionsService: r,
|
|
2639
2636
|
refSelectionsRenderService: a,
|
|
2640
|
-
sheetSkeletonManagerService:
|
|
2637
|
+
sheetSkeletonManagerService: d,
|
|
2641
2638
|
themeService: o,
|
|
2642
2639
|
univerInstanceService: n
|
|
2643
2640
|
});
|
|
@@ -2648,48 +2645,48 @@ function gc(e, t) {
|
|
|
2648
2645
|
a == null || a.resetActiveSelectionIndex();
|
|
2649
2646
|
}, [a]), f;
|
|
2650
2647
|
}
|
|
2651
|
-
function
|
|
2652
|
-
const t =
|
|
2653
|
-
return ee((i, c, a = !0,
|
|
2648
|
+
function jr(e = "") {
|
|
2649
|
+
const t = y(Zt), n = hc(), o = y(pe), r = le(() => e.length, [e]);
|
|
2650
|
+
return ee((i, c, a = !0, d) => {
|
|
2654
2651
|
const f = i.getDocumentData(), m = i.getEditorId();
|
|
2655
2652
|
if (!f)
|
|
2656
2653
|
return [];
|
|
2657
|
-
const
|
|
2658
|
-
if (!
|
|
2654
|
+
const u = f.body;
|
|
2655
|
+
if (!u)
|
|
2659
2656
|
return [];
|
|
2660
|
-
const
|
|
2661
|
-
if (!
|
|
2657
|
+
const h = u.dataStream.slice(0, u.dataStream.length - 2), l = { dataStream: "", ...f.body };
|
|
2658
|
+
if (!h.startsWith(e)) return [];
|
|
2662
2659
|
if (c == null || c.length === 0)
|
|
2663
2660
|
return l.textRuns = [], o.syncExecuteCommand(jn.id, {
|
|
2664
2661
|
unitId: m,
|
|
2665
|
-
body:
|
|
2662
|
+
body: $n(l, 0, l.dataStream.length - 2)
|
|
2666
2663
|
}), [];
|
|
2667
2664
|
{
|
|
2668
|
-
const { textRuns:
|
|
2669
|
-
r &&
|
|
2670
|
-
|
|
2671
|
-
}), l.textRuns = [{ st: 0, ed: 1, ts: { fs: 11 } }, ...
|
|
2672
|
-
const g = c.reduce((
|
|
2665
|
+
const { textRuns: S, refSelections: v } = fc(t, n, c);
|
|
2666
|
+
r && S.forEach((R) => {
|
|
2667
|
+
R.ed = R.ed + r, R.st = R.st + r;
|
|
2668
|
+
}), l.textRuns = [{ st: 0, ed: 1, ts: { fs: 11 } }, ...S];
|
|
2669
|
+
const g = c.reduce((R, E) => typeof E == "string" ? `${R}${E}` : `${R}${E.token}`, "");
|
|
2673
2670
|
l.dataStream = `${e}${g}\r
|
|
2674
2671
|
`;
|
|
2675
2672
|
let C;
|
|
2676
2673
|
if (a) {
|
|
2677
2674
|
C = i.getSelectionRanges();
|
|
2678
|
-
const
|
|
2675
|
+
const R = l.dataStream.length - 2 + r;
|
|
2679
2676
|
C.forEach((E) => {
|
|
2680
|
-
E.startOffset = Math.max(0, Math.min(E.startOffset,
|
|
2677
|
+
E.startOffset = Math.max(0, Math.min(E.startOffset, R)), E.endOffset = Math.max(0, Math.min(E.endOffset, R));
|
|
2681
2678
|
});
|
|
2682
2679
|
}
|
|
2683
2680
|
return o.syncExecuteCommand(jn.id, {
|
|
2684
2681
|
unitId: m,
|
|
2685
|
-
body:
|
|
2686
|
-
textRanges:
|
|
2687
|
-
}),
|
|
2682
|
+
body: $n(l, 0, l.dataStream.length - 2),
|
|
2683
|
+
textRanges: d != null ? d : C
|
|
2684
|
+
}), v;
|
|
2688
2685
|
}
|
|
2689
2686
|
});
|
|
2690
2687
|
}
|
|
2691
|
-
function
|
|
2692
|
-
const e =
|
|
2688
|
+
function hc() {
|
|
2689
|
+
const e = y(Et), t = e.getCurrentTheme();
|
|
2693
2690
|
return le(() => {
|
|
2694
2691
|
const o = [
|
|
2695
2692
|
e.getColorFromTheme("loop-color.1"),
|
|
@@ -2708,13 +2705,13 @@ function mc() {
|
|
|
2708
2705
|
return { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: i };
|
|
2709
2706
|
}, [t]);
|
|
2710
2707
|
}
|
|
2711
|
-
function
|
|
2712
|
-
const { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: i } = t, c = [], a = [],
|
|
2708
|
+
function fc(e, t, n) {
|
|
2709
|
+
const { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: i } = t, c = [], a = [], d = /* @__PURE__ */ new Map();
|
|
2713
2710
|
let f = 0;
|
|
2714
|
-
for (let m = 0,
|
|
2715
|
-
const
|
|
2716
|
-
if (typeof
|
|
2717
|
-
const
|
|
2711
|
+
for (let m = 0, u = n.length; m < u; m++) {
|
|
2712
|
+
const h = n[m];
|
|
2713
|
+
if (typeof h == "string") {
|
|
2714
|
+
const R = c[c.length - 1], E = R ? R.ed : 0, p = E + h.length;
|
|
2718
2715
|
c.push({
|
|
2719
2716
|
st: E,
|
|
2720
2717
|
ed: p,
|
|
@@ -2727,10 +2724,10 @@ function pc(e, t, n) {
|
|
|
2727
2724
|
});
|
|
2728
2725
|
continue;
|
|
2729
2726
|
}
|
|
2730
|
-
if (e.hasDefinedNameDescription(
|
|
2727
|
+
if (e.hasDefinedNameDescription(h.token.trim())) {
|
|
2731
2728
|
c.push({
|
|
2732
|
-
st:
|
|
2733
|
-
ed:
|
|
2729
|
+
st: h.startIndex,
|
|
2730
|
+
ed: h.endIndex + 1,
|
|
2734
2731
|
ts: {
|
|
2735
2732
|
cl: {
|
|
2736
2733
|
rgb: i
|
|
@@ -2740,27 +2737,27 @@ function pc(e, t, n) {
|
|
|
2740
2737
|
});
|
|
2741
2738
|
continue;
|
|
2742
2739
|
}
|
|
2743
|
-
const { startIndex: l, endIndex:
|
|
2740
|
+
const { startIndex: l, endIndex: S, nodeType: v, token: g } = h;
|
|
2744
2741
|
let C = "";
|
|
2745
|
-
if (
|
|
2746
|
-
if (
|
|
2747
|
-
C =
|
|
2742
|
+
if (v === Q.REFERENCE) {
|
|
2743
|
+
if (d.has(g))
|
|
2744
|
+
C = d.get(g);
|
|
2748
2745
|
else {
|
|
2749
|
-
const
|
|
2750
|
-
C = o[
|
|
2746
|
+
const R = f % o.length;
|
|
2747
|
+
C = o[R], d.set(g, C), f++;
|
|
2751
2748
|
}
|
|
2752
2749
|
a.push({
|
|
2753
2750
|
refIndex: m,
|
|
2754
2751
|
themeColor: C,
|
|
2755
2752
|
token: g,
|
|
2756
|
-
startIndex:
|
|
2757
|
-
endIndex:
|
|
2753
|
+
startIndex: h.startIndex,
|
|
2754
|
+
endIndex: h.endIndex,
|
|
2758
2755
|
index: a.length
|
|
2759
2756
|
});
|
|
2760
|
-
} else
|
|
2757
|
+
} else v === Q.NUMBER ? C = r : (v === Q.STRING || v === Q.ARRAY) && (C = s);
|
|
2761
2758
|
C && C.length > 0 ? c.push({
|
|
2762
2759
|
st: l,
|
|
2763
|
-
ed:
|
|
2760
|
+
ed: S + 1,
|
|
2764
2761
|
ts: {
|
|
2765
2762
|
cl: {
|
|
2766
2763
|
rgb: C
|
|
@@ -2769,7 +2766,7 @@ function pc(e, t, n) {
|
|
|
2769
2766
|
}
|
|
2770
2767
|
}) : c.push({
|
|
2771
2768
|
st: l,
|
|
2772
|
-
ed:
|
|
2769
|
+
ed: S + 1,
|
|
2773
2770
|
ts: {
|
|
2774
2771
|
cl: {
|
|
2775
2772
|
rgb: i
|
|
@@ -2780,77 +2777,77 @@ function pc(e, t, n) {
|
|
|
2780
2777
|
}
|
|
2781
2778
|
return { textRuns: c, refSelections: a };
|
|
2782
2779
|
}
|
|
2783
|
-
const
|
|
2784
|
-
const r =
|
|
2780
|
+
const gc = (e, t, n, o) => {
|
|
2781
|
+
const r = y(pe), s = y(zt), i = X(t);
|
|
2785
2782
|
i.current = t;
|
|
2786
|
-
const c =
|
|
2783
|
+
const c = X(o);
|
|
2787
2784
|
c.current = o, P(() => {
|
|
2788
2785
|
if (!n || !e)
|
|
2789
2786
|
return;
|
|
2790
|
-
const
|
|
2787
|
+
const d = `sheet.formula-embedding-editor.${n.getEditorId()}`, f = new Ye(), m = (l, S) => {
|
|
2791
2788
|
if (c.current) {
|
|
2792
|
-
c.current(l,
|
|
2789
|
+
c.current(l, S);
|
|
2793
2790
|
return;
|
|
2794
2791
|
}
|
|
2795
|
-
let
|
|
2796
|
-
l ===
|
|
2797
|
-
direction:
|
|
2798
|
-
}) : r.executeCommand(
|
|
2799
|
-
direction:
|
|
2792
|
+
let v = de.LEFT;
|
|
2793
|
+
l === L.ARROW_DOWN ? v = de.DOWN : l === L.ARROW_UP ? v = de.UP : l === L.ARROW_RIGHT && (v = de.RIGHT), S === V.SHIFT ? r.executeCommand(Xo.id, {
|
|
2794
|
+
direction: v
|
|
2795
|
+
}) : r.executeCommand(Qo.id, {
|
|
2796
|
+
direction: v
|
|
2800
2797
|
});
|
|
2801
|
-
},
|
|
2802
|
-
let
|
|
2803
|
-
l ===
|
|
2804
|
-
direction:
|
|
2805
|
-
jumpOver:
|
|
2798
|
+
}, u = (l, S) => {
|
|
2799
|
+
let v = de.DOWN;
|
|
2800
|
+
l === L.ARROW_DOWN ? v = de.DOWN : l === L.ARROW_UP ? v = de.UP : l === L.ARROW_LEFT ? v = de.LEFT : l === L.ARROW_RIGHT && (v = de.RIGHT), i.current ? S === V.CTRL_COMMAND ? r.executeCommand(Hn.id, {
|
|
2801
|
+
direction: v,
|
|
2802
|
+
jumpOver: Bn.moveGap,
|
|
2806
2803
|
extra: "formula-editor",
|
|
2807
2804
|
fromCurrentSelection: i.current === Me.NEED_ADD || i.current === Me.EDIT_OTHER_SHEET_REFERENCE
|
|
2808
|
-
}) :
|
|
2809
|
-
direction:
|
|
2805
|
+
}) : S === V.SHIFT ? r.executeCommand(qn.id, {
|
|
2806
|
+
direction: v,
|
|
2810
2807
|
extra: "formula-editor"
|
|
2811
|
-
}) :
|
|
2812
|
-
direction:
|
|
2813
|
-
jumpOver:
|
|
2808
|
+
}) : S === (V.CTRL_COMMAND | V.SHIFT) ? r.executeCommand(qn.id, {
|
|
2809
|
+
direction: v,
|
|
2810
|
+
jumpOver: Bn.moveGap,
|
|
2814
2811
|
extra: "formula-editor"
|
|
2815
|
-
}) : r.executeCommand(
|
|
2816
|
-
direction:
|
|
2812
|
+
}) : r.executeCommand(Hn.id, {
|
|
2813
|
+
direction: v,
|
|
2817
2814
|
extra: "formula-editor",
|
|
2818
2815
|
fromCurrentSelection: i.current === Me.NEED_ADD || i.current === Me.EDIT_OTHER_SHEET_REFERENCE
|
|
2819
|
-
}) : m(l,
|
|
2816
|
+
}) : m(l, S);
|
|
2820
2817
|
};
|
|
2821
2818
|
return f.add(r.registerCommand({
|
|
2822
|
-
id:
|
|
2819
|
+
id: d,
|
|
2823
2820
|
type: be.OPERATION,
|
|
2824
|
-
handler(l,
|
|
2825
|
-
const { keyCode:
|
|
2826
|
-
|
|
2821
|
+
handler(l, S) {
|
|
2822
|
+
const { keyCode: v, metaKey: g } = S;
|
|
2823
|
+
u(v, g);
|
|
2827
2824
|
}
|
|
2828
2825
|
})), [
|
|
2829
|
-
{ keyCode:
|
|
2830
|
-
{ keyCode:
|
|
2831
|
-
{ keyCode:
|
|
2832
|
-
{ keyCode:
|
|
2833
|
-
{ keyCode:
|
|
2834
|
-
{ keyCode:
|
|
2835
|
-
{ keyCode:
|
|
2836
|
-
{ keyCode:
|
|
2837
|
-
{ keyCode:
|
|
2838
|
-
{ keyCode:
|
|
2839
|
-
{ keyCode:
|
|
2840
|
-
{ keyCode:
|
|
2841
|
-
{ keyCode:
|
|
2842
|
-
{ keyCode:
|
|
2843
|
-
{ keyCode:
|
|
2844
|
-
{ keyCode:
|
|
2845
|
-
].map(({ keyCode: l, metaKey:
|
|
2846
|
-
id:
|
|
2847
|
-
binding:
|
|
2826
|
+
{ keyCode: L.ARROW_DOWN },
|
|
2827
|
+
{ keyCode: L.ARROW_LEFT },
|
|
2828
|
+
{ keyCode: L.ARROW_RIGHT },
|
|
2829
|
+
{ keyCode: L.ARROW_UP },
|
|
2830
|
+
{ keyCode: L.ARROW_DOWN, metaKey: V.SHIFT },
|
|
2831
|
+
{ keyCode: L.ARROW_LEFT, metaKey: V.SHIFT },
|
|
2832
|
+
{ keyCode: L.ARROW_RIGHT, metaKey: V.SHIFT },
|
|
2833
|
+
{ keyCode: L.ARROW_UP, metaKey: V.SHIFT },
|
|
2834
|
+
{ keyCode: L.ARROW_DOWN, metaKey: V.CTRL_COMMAND },
|
|
2835
|
+
{ keyCode: L.ARROW_LEFT, metaKey: V.CTRL_COMMAND },
|
|
2836
|
+
{ keyCode: L.ARROW_RIGHT, metaKey: V.CTRL_COMMAND },
|
|
2837
|
+
{ keyCode: L.ARROW_UP, metaKey: V.CTRL_COMMAND },
|
|
2838
|
+
{ keyCode: L.ARROW_DOWN, metaKey: V.CTRL_COMMAND | V.SHIFT },
|
|
2839
|
+
{ keyCode: L.ARROW_LEFT, metaKey: V.CTRL_COMMAND | V.SHIFT },
|
|
2840
|
+
{ keyCode: L.ARROW_RIGHT, metaKey: V.CTRL_COMMAND | V.SHIFT },
|
|
2841
|
+
{ keyCode: L.ARROW_UP, metaKey: V.CTRL_COMMAND | V.SHIFT }
|
|
2842
|
+
].map(({ keyCode: l, metaKey: S }) => ({
|
|
2843
|
+
id: d,
|
|
2844
|
+
binding: S ? l | S : l,
|
|
2848
2845
|
preconditions: () => !0,
|
|
2849
2846
|
priority: 900,
|
|
2850
2847
|
staticParameters: {
|
|
2851
2848
|
eventType: xe.Keyboard,
|
|
2852
2849
|
keyCode: l,
|
|
2853
|
-
metaKey:
|
|
2850
|
+
metaKey: S
|
|
2854
2851
|
}
|
|
2855
2852
|
})).forEach((l) => {
|
|
2856
2853
|
f.add(s.registerShortcut(l));
|
|
@@ -2858,106 +2855,106 @@ const Sc = (e, t, n, o) => {
|
|
|
2858
2855
|
f.dispose();
|
|
2859
2856
|
};
|
|
2860
2857
|
}, [r, n, e, s]);
|
|
2861
|
-
},
|
|
2862
|
-
var
|
|
2863
|
-
const s =
|
|
2858
|
+
}, mc = (e, t, n, o, r = !0) => {
|
|
2859
|
+
var h;
|
|
2860
|
+
const s = y(Te), i = y(dn), c = y(Es), a = y(Gt), d = y(ne), f = _e(le(() => d.getCurrentTypeOfUnit$(W.UNIVER_SHEET), [d])), m = s.getRenderById((h = f == null ? void 0 : f.getUnitId()) != null ? h : ""), u = m == null ? void 0 : m.with(Le);
|
|
2864
2861
|
Pt(() => {
|
|
2865
2862
|
if (e)
|
|
2866
|
-
return i.setContextValue(
|
|
2867
|
-
const l =
|
|
2868
|
-
(l == null ? void 0 : l.getUnitId()) === o && i.setContextValue(
|
|
2863
|
+
return i.setContextValue(Pn, !0), r && c.disable(), () => {
|
|
2864
|
+
const l = d.getCurrentUnitOfType(W.UNIVER_DOC);
|
|
2865
|
+
(l == null ? void 0 : l.getUnitId()) === o && i.setContextValue(Pn, !1), r && c.enable(), a.clear();
|
|
2869
2866
|
};
|
|
2870
2867
|
}, [i, e, a, r, o]), Pt(() => {
|
|
2871
2868
|
if (e && t) {
|
|
2872
|
-
const l =
|
|
2869
|
+
const l = u == null ? void 0 : u.enableSelectionChanging();
|
|
2873
2870
|
return i.setContextValue(Gn, !0), () => {
|
|
2874
2871
|
i.setContextValue(Gn, !1), l == null || l.dispose();
|
|
2875
2872
|
};
|
|
2876
2873
|
}
|
|
2877
|
-
}, [i, e,
|
|
2878
|
-
e && (
|
|
2879
|
-
}, [e,
|
|
2880
|
-
},
|
|
2881
|
-
const o =
|
|
2874
|
+
}, [i, e, u, t]), P(() => {
|
|
2875
|
+
e && (u == null || u.setSkipLastEnabled(!1));
|
|
2876
|
+
}, [e, u]);
|
|
2877
|
+
}, pc = (e, t, n) => {
|
|
2878
|
+
const o = y(ne), r = y(Cn);
|
|
2882
2879
|
return $t(() => {
|
|
2883
2880
|
if (e) {
|
|
2884
|
-
const i = [...r.getWorkbookSelections(t).getSelectionsOfWorksheet(n)], c = o.getCurrentUnitForType(
|
|
2881
|
+
const i = [...r.getWorkbookSelections(t).getSelectionsOfWorksheet(n)], c = o.getCurrentUnitForType(W.UNIVER_SHEET), a = c == null ? void 0 : c.getActiveSheet();
|
|
2885
2882
|
(c == null ? void 0 : c.getUnitId()) !== t && o.setCurrentUnitForType(t), a && a.getSheetId() === n && r.setSelections(i);
|
|
2886
2883
|
}
|
|
2887
2884
|
}, [e, r, n, t, o]);
|
|
2888
|
-
},
|
|
2889
|
-
var f, m,
|
|
2885
|
+
}, Sc = (e) => e.reduce((t, n) => typeof n == "string" ? t + n.length : t + n.token.length, 0), un = (e) => e.map((t) => typeof t == "string" ? t : t.token).join(""), Ft = (e, t = !1, n = "", o = !1) => !t && !o ? e.map((r) => Ee(r.range)) : e.map((r) => o ? qo(r) : r.sheetName !== "" && r.sheetName !== n ? _t(r.sheetName, r.range) : Ee(r.range)), vc = (e) => {
|
|
2886
|
+
var f, m, u;
|
|
2890
2887
|
const { editor: t, lexerTreeBuilder: n } = e, o = t == null ? void 0 : t.getSelectionRanges();
|
|
2891
2888
|
if ((o == null ? void 0 : o.length) !== 1)
|
|
2892
2889
|
return;
|
|
2893
2890
|
const s = o[0].startOffset - 1, i = ((m = (f = t == null ? void 0 : t.getDocumentData().body) == null ? void 0 : f.dataStream) != null ? m : `\r
|
|
2894
|
-
`).slice(0, -2), c = (
|
|
2891
|
+
`).slice(0, -2), c = (u = n.sequenceNodesBuilder(i.slice(1))) != null ? u : [], a = On(c, s, !1), d = Hr(c, a);
|
|
2895
2892
|
return {
|
|
2896
2893
|
nodeIndex: a,
|
|
2897
|
-
updatingRefIndex:
|
|
2894
|
+
updatingRefIndex: d,
|
|
2898
2895
|
sequenceNodes: c,
|
|
2899
2896
|
offset: s
|
|
2900
2897
|
};
|
|
2901
|
-
},
|
|
2902
|
-
}),
|
|
2898
|
+
}, Cc = (() => {
|
|
2899
|
+
}), _c = (e, t, n, o, r, s, i, c, a, d = Cc) => {
|
|
2903
2900
|
var M;
|
|
2904
|
-
const f =
|
|
2905
|
-
var
|
|
2906
|
-
return (
|
|
2907
|
-
}), C = le(() => g(o, r), [g, r, o]),
|
|
2908
|
-
var
|
|
2909
|
-
const
|
|
2910
|
-
if (!
|
|
2911
|
-
const { nodeIndex:
|
|
2901
|
+
const f = y(Te), m = y(ne), u = y(pe), h = y(Tr), l = y(Et), S = y(ye), v = m.getUnit(o), g = ee((w, k) => {
|
|
2902
|
+
var $, I, _;
|
|
2903
|
+
return (_ = (I = ($ = m.getUnit(w)) == null ? void 0 : $.getSheetBySheetId(k)) == null ? void 0 : I.getName()) != null ? _ : "";
|
|
2904
|
+
}), C = le(() => g(o, r), [g, r, o]), R = _e(v == null ? void 0 : v.activeSheet$), E = rt({ activeSheet: R, sheetName: C }), p = _e(le(() => m.getCurrentTypeOfUnit$(W.UNIVER_SHEET), [m])), b = f.getRenderById((M = p == null ? void 0 : p.getUnitId()) != null ? M : ""), T = b == null ? void 0 : b.with(Le), F = b == null ? void 0 : b.with(bt), A = y(Gt), N = ee((w, k, $) => {
|
|
2905
|
+
var Y, re, he, G, J, ot, st, Ot, Oe, Nt;
|
|
2906
|
+
const I = vc({ editor: a, lexerTreeBuilder: S });
|
|
2907
|
+
if (!I) return;
|
|
2908
|
+
const { nodeIndex: _, updatingRefIndex: O, sequenceNodes: D, offset: U } = I;
|
|
2912
2909
|
if (n.current === Me.NEED_ADD)
|
|
2913
|
-
if (
|
|
2914
|
-
if (
|
|
2910
|
+
if (U !== 0) {
|
|
2911
|
+
if (_ === -1 && D.length)
|
|
2915
2912
|
return;
|
|
2916
|
-
const K =
|
|
2913
|
+
const K = w[w.length - 1], te = D.splice(_ + 1), fe = (Y = K.sheetId) != null ? Y : r, oe = {
|
|
2917
2914
|
range: K,
|
|
2918
2915
|
unitId: (re = K.unitId) != null ? re : p.getUnitId(),
|
|
2919
2916
|
sheetName: g((he = K.unitId) != null ? he : p.getUnitId(), fe)
|
|
2920
2917
|
}, ae = fe !== r, ge = (p == null ? void 0 : p.getUnitId()) !== o, Se = Ft([oe], i && (ae || ge), C, ge);
|
|
2921
|
-
|
|
2922
|
-
const We = [...
|
|
2923
|
-
|
|
2918
|
+
D.push({ token: Se[0], nodeType: Q.REFERENCE });
|
|
2919
|
+
const We = [...D, ...te], He = un(We);
|
|
2920
|
+
d(He, Sc(D), k);
|
|
2924
2921
|
} else {
|
|
2925
|
-
const K =
|
|
2922
|
+
const K = w[w.length - 1], te = (G = K.sheetId) != null ? G : r, fe = {
|
|
2926
2923
|
range: K,
|
|
2927
2924
|
unitId: (J = K.unitId) != null ? J : p.getUnitId(),
|
|
2928
|
-
sheetName: g((ot = K.unitId) != null ? ot : p.getUnitId(),
|
|
2929
|
-
}, oe =
|
|
2930
|
-
|
|
2931
|
-
const Se = un(
|
|
2932
|
-
|
|
2925
|
+
sheetName: g((ot = K.unitId) != null ? ot : p.getUnitId(), te)
|
|
2926
|
+
}, oe = te !== r, ae = (p == null ? void 0 : p.getUnitId()) !== o, ge = Ft([fe], i && (oe || ae), C, ae);
|
|
2927
|
+
D.unshift({ token: ge[0], nodeType: Q.REFERENCE });
|
|
2928
|
+
const Se = un(D);
|
|
2929
|
+
d(Se, ge[0].length, k);
|
|
2933
2930
|
}
|
|
2934
2931
|
else if (n.current === Me.EDIT_OTHER_SHEET_REFERENCE || n.current === Me.EDIT_OTHER_WORKBOOK_REFERENCE) {
|
|
2935
|
-
const K =
|
|
2932
|
+
const K = w.pop();
|
|
2936
2933
|
if (!K) return;
|
|
2937
|
-
const
|
|
2938
|
-
if (typeof
|
|
2939
|
-
const fe =
|
|
2940
|
-
(p == null ? void 0 : p.getUnitId()) !== o ?
|
|
2941
|
-
const ae =
|
|
2942
|
-
|
|
2934
|
+
const te = D[_];
|
|
2935
|
+
if (typeof te == "object" && te.nodeType === Q.REFERENCE) {
|
|
2936
|
+
const fe = te.token;
|
|
2937
|
+
(p == null ? void 0 : p.getUnitId()) !== o ? te.token = jo((st = p == null ? void 0 : p.getUnitId()) != null ? st : "", C, K) : te.token = C === (R == null ? void 0 : R.getName()) ? Ee(K) : _t(R.getName(), K);
|
|
2938
|
+
const ae = U + (te.token.length - fe.length);
|
|
2939
|
+
d(Ko(D), ae, k);
|
|
2943
2940
|
}
|
|
2944
2941
|
} else {
|
|
2945
|
-
const K = [...
|
|
2946
|
-
if (
|
|
2947
|
-
const
|
|
2948
|
-
|
|
2942
|
+
const K = [...w];
|
|
2943
|
+
if (!$ && O !== -1) {
|
|
2944
|
+
const Z = K.pop();
|
|
2945
|
+
Z && K.splice(O, 0, Z);
|
|
2949
2946
|
}
|
|
2950
|
-
let
|
|
2951
|
-
const fe =
|
|
2947
|
+
let te = 0;
|
|
2948
|
+
const fe = D.map((Z) => {
|
|
2952
2949
|
var Re, we, it, Be;
|
|
2953
|
-
if (typeof
|
|
2954
|
-
return
|
|
2955
|
-
if (
|
|
2956
|
-
const me = ht(
|
|
2950
|
+
if (typeof Z == "string")
|
|
2951
|
+
return Z;
|
|
2952
|
+
if (Z.nodeType === Q.REFERENCE) {
|
|
2953
|
+
const me = ht(Z.token);
|
|
2957
2954
|
if (me.sheetName || (me.sheetName = C), (me.unitId || o) !== (p == null ? void 0 : p.getUnitId()) || i && ((Re = E.current.activeSheet) == null ? void 0 : Re.getName()) !== me.sheetName)
|
|
2958
|
-
return
|
|
2959
|
-
const ie = K[
|
|
2960
|
-
if (
|
|
2955
|
+
return Z.token;
|
|
2956
|
+
const ie = K[te];
|
|
2957
|
+
if (te++, !ie)
|
|
2961
2958
|
return "";
|
|
2962
2959
|
const gt = (we = ie.sheetId) != null ? we : r, Jt = {
|
|
2963
2960
|
range: ie,
|
|
@@ -2966,148 +2963,148 @@ const Sc = (e, t, n, o) => {
|
|
|
2966
2963
|
}, Mt = (p == null ? void 0 : p.getUnitId()) !== o;
|
|
2967
2964
|
return Ft([Jt], i && (gt !== r || Mt), C, Mt)[0];
|
|
2968
2965
|
}
|
|
2969
|
-
return
|
|
2966
|
+
return Z.token;
|
|
2970
2967
|
});
|
|
2971
2968
|
let oe = "", ae;
|
|
2972
|
-
fe.forEach((
|
|
2973
|
-
oe +=
|
|
2969
|
+
fe.forEach((Z, Re) => {
|
|
2970
|
+
oe += Z, Re === _ && (ae = oe.length);
|
|
2974
2971
|
});
|
|
2975
2972
|
const ge = [];
|
|
2976
|
-
for (let
|
|
2977
|
-
const Re =
|
|
2973
|
+
for (let Z = te; Z <= w.length - 1; Z++) {
|
|
2974
|
+
const Re = w[Z], we = (Ot = Re.sheetId) != null ? Ot : r, it = {
|
|
2978
2975
|
range: Re,
|
|
2979
2976
|
unitId: (Oe = Re.unitId) != null ? Oe : p.getUnitId(),
|
|
2980
2977
|
sheetName: g((Nt = Re.unitId) != null ? Nt : p.getUnitId(), we)
|
|
2981
2978
|
}, Be = (p == null ? void 0 : p.getUnitId()) !== o, ie = Ft([it], i && (we !== r || Be), C, Be);
|
|
2982
2979
|
ge.push(ie[0]);
|
|
2983
2980
|
}
|
|
2984
|
-
const Se =
|
|
2985
|
-
|
|
2981
|
+
const Se = D[D.length - 1], We = Se && (typeof Se == "string" ? !1 : Se.nodeType === Q.REFERENCE), He = `${oe}${ge.length && We ? "," : ""}${ge.join(",")}`;
|
|
2982
|
+
d(He, !ge.length && ae ? ae : He.length, k);
|
|
2986
2983
|
}
|
|
2987
2984
|
});
|
|
2988
2985
|
P(() => {
|
|
2989
|
-
if (
|
|
2990
|
-
let
|
|
2991
|
-
const
|
|
2992
|
-
if (
|
|
2993
|
-
|
|
2986
|
+
if (T && e) {
|
|
2987
|
+
let w = !0, k = 0;
|
|
2988
|
+
const $ = (_, O) => {
|
|
2989
|
+
if (w) {
|
|
2990
|
+
w = !1, k = _.length;
|
|
2994
2991
|
return;
|
|
2995
2992
|
}
|
|
2996
|
-
const
|
|
2997
|
-
|
|
2998
|
-
},
|
|
2999
|
-
return
|
|
3000
|
-
|
|
3001
|
-
})),
|
|
3002
|
-
|
|
2993
|
+
const D = _.length > k;
|
|
2994
|
+
O && (k = _.length), N(_.map((U) => U.rangeWithCoord), O, D);
|
|
2995
|
+
}, I = new Ye();
|
|
2996
|
+
return I.add(T.selectionMoving$.subscribe((_) => {
|
|
2997
|
+
$(_, !1);
|
|
2998
|
+
})), I.add(T.selectionMoveEnd$.subscribe((_) => {
|
|
2999
|
+
$(_, !0);
|
|
3003
3000
|
})), () => {
|
|
3004
|
-
|
|
3001
|
+
I.dispose();
|
|
3005
3002
|
};
|
|
3006
3003
|
}
|
|
3007
|
-
}, [e, N,
|
|
3008
|
-
if (t &&
|
|
3009
|
-
const
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
const
|
|
3014
|
-
|
|
3004
|
+
}, [e, N, T]), P(() => {
|
|
3005
|
+
if (t && T && a) {
|
|
3006
|
+
const w = new Ye(), k = () => {
|
|
3007
|
+
w.dispose(), T.getSelectionControls().forEach((_, O) => {
|
|
3008
|
+
w.add(
|
|
3009
|
+
_.selectionScaling$.subscribe((D) => {
|
|
3010
|
+
const U = T.getSelectionDataWithStyle().map((re) => re.rangeWithCoord), Y = U[O];
|
|
3011
|
+
D.sheetId = Y.sheetId, D.unitId = Y.unitId, U[O] = D, N(U, !1);
|
|
3015
3012
|
})
|
|
3016
|
-
),
|
|
3017
|
-
|
|
3018
|
-
const
|
|
3019
|
-
|
|
3013
|
+
), w.add(
|
|
3014
|
+
_.selectionMoving$.subscribe((D) => {
|
|
3015
|
+
const U = T.getSelectionDataWithStyle().map((re) => re.rangeWithCoord), Y = U[O];
|
|
3016
|
+
D.sheetId = Y.sheetId, D.unitId = Y.unitId, U[O] = D, N(U, !0);
|
|
3020
3017
|
})
|
|
3021
3018
|
);
|
|
3022
3019
|
});
|
|
3023
|
-
},
|
|
3020
|
+
}, $ = zo(
|
|
3024
3021
|
a.input$,
|
|
3025
|
-
|
|
3026
|
-
|
|
3022
|
+
A.selectionSet$,
|
|
3023
|
+
T.selectionMoveEnd$
|
|
3027
3024
|
).pipe(
|
|
3028
|
-
|
|
3025
|
+
As(50)
|
|
3029
3026
|
).subscribe(() => {
|
|
3030
|
-
|
|
3027
|
+
k();
|
|
3031
3028
|
});
|
|
3032
3029
|
return () => {
|
|
3033
|
-
|
|
3030
|
+
$.unsubscribe(), w.dispose();
|
|
3034
3031
|
};
|
|
3035
3032
|
}
|
|
3036
|
-
}, [a, t, N,
|
|
3033
|
+
}, [a, t, N, T, A.selectionSet$]), T == null || T.getSelectionDataWithStyle(), P(() => {
|
|
3037
3034
|
if (c) {
|
|
3038
|
-
const
|
|
3039
|
-
var
|
|
3040
|
-
if (
|
|
3035
|
+
const w = u.onCommandExecuted((k) => {
|
|
3036
|
+
var I;
|
|
3037
|
+
if (k.id !== _n.id)
|
|
3041
3038
|
return;
|
|
3042
|
-
const
|
|
3043
|
-
if (
|
|
3044
|
-
const
|
|
3045
|
-
if (
|
|
3046
|
-
const { range:
|
|
3047
|
-
(
|
|
3048
|
-
const
|
|
3049
|
-
|
|
3039
|
+
const $ = k.params;
|
|
3040
|
+
if ($.extra === "formula-editor" && $.selections.length) {
|
|
3041
|
+
const _ = $.selections[$.selections.length - 1];
|
|
3042
|
+
if (_) {
|
|
3043
|
+
const { range: O, primary: D } = _;
|
|
3044
|
+
(D != null && D.isMergedMainCell || D != null && D.isMerged) && hn.contains(D, O) && (O.startRow = D.startRow, O.endRow = D.startRow, O.startColumn = D.startColumn, O.endColumn = D.startColumn), O.unitId = $.unitId, O.sheetId = $.subUnitId;
|
|
3045
|
+
const U = n.current === Me.NEED_ADD, Y = ((I = T == null ? void 0 : T.getSelectionDataWithStyle()) != null ? I : []).map((re) => re.rangeWithCoord);
|
|
3046
|
+
U ? Y.push(O) : Y[Y.length - 1] = O, N(Y, !0);
|
|
3050
3047
|
}
|
|
3051
3048
|
}
|
|
3052
3049
|
});
|
|
3053
3050
|
return () => {
|
|
3054
|
-
|
|
3051
|
+
w.dispose();
|
|
3055
3052
|
};
|
|
3056
3053
|
}
|
|
3057
|
-
}, [
|
|
3054
|
+
}, [u, a, n, S, c, N, T]), P(() => {
|
|
3058
3055
|
if (!a)
|
|
3059
3056
|
return;
|
|
3060
|
-
const
|
|
3061
|
-
|
|
3057
|
+
const w = h.textSelection$.subscribe((k) => {
|
|
3058
|
+
k.unitId === a.getEditorId() && qr({
|
|
3062
3059
|
unitId: o,
|
|
3063
3060
|
subUnitId: r,
|
|
3064
3061
|
refSelections: s.current,
|
|
3065
3062
|
editor: a,
|
|
3066
|
-
refSelectionsService:
|
|
3067
|
-
refSelectionsRenderService:
|
|
3068
|
-
sheetSkeletonManagerService:
|
|
3063
|
+
refSelectionsService: A,
|
|
3064
|
+
refSelectionsRenderService: T,
|
|
3065
|
+
sheetSkeletonManagerService: F,
|
|
3069
3066
|
themeService: l,
|
|
3070
3067
|
univerInstanceService: m,
|
|
3071
3068
|
currentWorkbook: p
|
|
3072
3069
|
});
|
|
3073
3070
|
});
|
|
3074
|
-
return () =>
|
|
3075
|
-
}, [
|
|
3076
|
-
},
|
|
3077
|
-
const i =
|
|
3071
|
+
return () => w.unsubscribe();
|
|
3072
|
+
}, [h.textSelection$, a, s, T, A, F, r, l, o, m]);
|
|
3073
|
+
}, Rc = (e, t, n, o, r, s) => {
|
|
3074
|
+
const i = y(pe), c = y(ze), d = y(Te).getRenderById(t), f = y(ne), m = d == null ? void 0 : d.with(Le);
|
|
3078
3075
|
P(() => {
|
|
3079
3076
|
if (e && m)
|
|
3080
3077
|
if (n) {
|
|
3081
|
-
const
|
|
3082
|
-
const
|
|
3083
|
-
for (let
|
|
3078
|
+
const u = () => {
|
|
3079
|
+
const S = m.getSelectionControls().length;
|
|
3080
|
+
for (let v = 1; v <= S; v++)
|
|
3084
3081
|
m.clearLastSelection();
|
|
3085
3082
|
return setTimeout(() => {
|
|
3086
3083
|
s();
|
|
3087
3084
|
}, 30);
|
|
3088
|
-
},
|
|
3089
|
-
|
|
3090
|
-
}), l = f.getCurrentTypeOfUnit$(
|
|
3091
|
-
|
|
3085
|
+
}, h = i.onCommandExecuted((S) => {
|
|
3086
|
+
S.id === Zn.id && u();
|
|
3087
|
+
}), l = f.getCurrentTypeOfUnit$(W.UNIVER_SHEET).subscribe((S) => {
|
|
3088
|
+
u();
|
|
3092
3089
|
});
|
|
3093
3090
|
return () => {
|
|
3094
|
-
|
|
3091
|
+
h.dispose(), l.unsubscribe();
|
|
3095
3092
|
};
|
|
3096
3093
|
} else {
|
|
3097
|
-
const
|
|
3098
|
-
if (
|
|
3094
|
+
const u = i.beforeCommandExecuted((h) => {
|
|
3095
|
+
if (h.id === Zn.id) {
|
|
3099
3096
|
o(!1), r(), s();
|
|
3100
3097
|
const l = c.getEditor(fn);
|
|
3101
3098
|
l == null || l.focus();
|
|
3102
3099
|
}
|
|
3103
3100
|
});
|
|
3104
3101
|
return () => {
|
|
3105
|
-
|
|
3102
|
+
u.dispose();
|
|
3106
3103
|
};
|
|
3107
3104
|
}
|
|
3108
3105
|
}, [e, m]);
|
|
3109
|
-
},
|
|
3110
|
-
const o =
|
|
3106
|
+
}, Ic = (e, t, n) => {
|
|
3107
|
+
const o = y(ye), r = X(!0);
|
|
3111
3108
|
P(() => {
|
|
3112
3109
|
if (e) {
|
|
3113
3110
|
const s = setTimeout(() => {
|
|
@@ -3120,27 +3117,27 @@ const Sc = (e, t, n, o) => {
|
|
|
3120
3117
|
}, [e]), P(() => {
|
|
3121
3118
|
if (!r.current && t) {
|
|
3122
3119
|
const s = o.checkIfAddBracket(n);
|
|
3123
|
-
t(s === 0 && n.startsWith(
|
|
3120
|
+
t(s === 0 && n.startsWith(pr.EQUALS), `${n}`);
|
|
3124
3121
|
}
|
|
3125
3122
|
}, [n, t]);
|
|
3126
|
-
},
|
|
3127
|
-
const o =
|
|
3123
|
+
}, Ec = (e, t = [], n) => {
|
|
3124
|
+
const o = y(Zt), [r, s] = H([]), [i, c] = H(""), a = X(-1), d = rt({ nodes: t }), f = () => {
|
|
3128
3125
|
s([]), c(""), a.current = -1;
|
|
3129
3126
|
};
|
|
3130
3127
|
return P(() => {
|
|
3131
3128
|
if (n && e) {
|
|
3132
|
-
const
|
|
3133
|
-
const
|
|
3134
|
-
if (
|
|
3135
|
-
const l =
|
|
3136
|
-
if (
|
|
3137
|
-
const
|
|
3138
|
-
a.current =
|
|
3139
|
-
const g = l[
|
|
3129
|
+
const u = n.input$.pipe(vn(300)).subscribe(() => {
|
|
3130
|
+
const h = n.getSelectionRanges();
|
|
3131
|
+
if (h.length === 1) {
|
|
3132
|
+
const l = d.current.nodes, S = h[0];
|
|
3133
|
+
if (S.collapsed) {
|
|
3134
|
+
const v = On(l, S.startOffset - 1, !1);
|
|
3135
|
+
a.current = v;
|
|
3136
|
+
const g = l[v];
|
|
3140
3137
|
if (g && typeof g != "string" && g.nodeType === Q.FUNCTION) {
|
|
3141
|
-
a.current =
|
|
3142
|
-
const C = g.token,
|
|
3143
|
-
s(
|
|
3138
|
+
a.current = v;
|
|
3139
|
+
const C = g.token, R = o.getSearchListByNameFirstLetter(C);
|
|
3140
|
+
s(R), c(C);
|
|
3144
3141
|
return;
|
|
3145
3142
|
}
|
|
3146
3143
|
}
|
|
@@ -3148,7 +3145,7 @@ const Sc = (e, t, n, o) => {
|
|
|
3148
3145
|
a.current = -1, c(""), s((l) => l != null && l.length ? [] : l);
|
|
3149
3146
|
});
|
|
3150
3147
|
return () => {
|
|
3151
|
-
|
|
3148
|
+
u.unsubscribe();
|
|
3152
3149
|
};
|
|
3153
3150
|
}
|
|
3154
3151
|
}, [n, e]), P(() => {
|
|
@@ -3156,98 +3153,98 @@ const Sc = (e, t, n, o) => {
|
|
|
3156
3153
|
}, [e]), {
|
|
3157
3154
|
searchList: r,
|
|
3158
3155
|
searchText: i,
|
|
3159
|
-
handlerFormulaReplace: (
|
|
3160
|
-
const l = [...
|
|
3156
|
+
handlerFormulaReplace: (u, h) => {
|
|
3157
|
+
const l = [...d.current.nodes];
|
|
3161
3158
|
if (a.current !== -1) {
|
|
3162
|
-
const
|
|
3163
|
-
let g = (typeof
|
|
3164
|
-
return l.push(
|
|
3159
|
+
const S = l.splice(a.current + 1), v = l.pop() || "";
|
|
3160
|
+
let g = (typeof v == "string" ? v.length : v.token.length) - u.length;
|
|
3161
|
+
return l.push(u), S[0] !== Ge.OPEN_BRACKET && h !== mr.DefinedName && (l.push(Ge.OPEN_BRACKET), g--), { text: un([...l, ...S]), offset: g };
|
|
3165
3162
|
}
|
|
3166
3163
|
},
|
|
3167
3164
|
reset: f
|
|
3168
3165
|
};
|
|
3169
|
-
},
|
|
3170
|
-
},
|
|
3171
|
-
function
|
|
3172
|
-
const { isFocus: n, sequenceNodes: o, onSelect: r, editor: s, onClose: i =
|
|
3173
|
-
const
|
|
3174
|
-
|
|
3166
|
+
}, bc = () => {
|
|
3167
|
+
}, yc = Ve(Tc);
|
|
3168
|
+
function Tc(e, t) {
|
|
3169
|
+
const { isFocus: n, sequenceNodes: o, onSelect: r, editor: s, onClose: i = bc } = e, c = s.getEditorId(), a = y(zt), d = y(pe), { searchList: f, searchText: m, handlerFormulaReplace: u, reset: h } = Ec(n, o, s), l = le(() => !!f.length, [f]), S = X(void 0), [v, g] = H(0), C = X(!1), [R] = Br(c, l, [m, f]), E = rt({ searchList: f, active: v }), p = (N, M) => {
|
|
3170
|
+
const w = u(N, M);
|
|
3171
|
+
w && (h(), r(w));
|
|
3175
3172
|
};
|
|
3176
3173
|
function b(N) {
|
|
3177
3174
|
C.current && g(N);
|
|
3178
3175
|
}
|
|
3179
|
-
function
|
|
3176
|
+
function T() {
|
|
3180
3177
|
C.current && g(-1);
|
|
3181
3178
|
}
|
|
3182
3179
|
P(() => {
|
|
3183
3180
|
if (!f.length)
|
|
3184
3181
|
return;
|
|
3185
|
-
const N = `sheet.formula-embedding-editor.search_function.${c}`, M = new Ye(),
|
|
3186
|
-
const { searchList:
|
|
3187
|
-
switch (
|
|
3188
|
-
case
|
|
3189
|
-
g((
|
|
3190
|
-
const
|
|
3191
|
-
return
|
|
3182
|
+
const N = `sheet.formula-embedding-editor.search_function.${c}`, M = new Ye(), w = (k) => {
|
|
3183
|
+
const { searchList: $, active: I } = E.current;
|
|
3184
|
+
switch (k) {
|
|
3185
|
+
case L.ARROW_UP: {
|
|
3186
|
+
g((_) => {
|
|
3187
|
+
const O = Math.max(0, _ - 1);
|
|
3188
|
+
return F(O), O;
|
|
3192
3189
|
});
|
|
3193
3190
|
break;
|
|
3194
3191
|
}
|
|
3195
|
-
case
|
|
3196
|
-
g((
|
|
3197
|
-
const
|
|
3198
|
-
return
|
|
3192
|
+
case L.ARROW_DOWN: {
|
|
3193
|
+
g((_) => {
|
|
3194
|
+
const O = Math.min($.length - 1, _ + 1);
|
|
3195
|
+
return F(O), O;
|
|
3199
3196
|
});
|
|
3200
3197
|
break;
|
|
3201
3198
|
}
|
|
3202
|
-
case
|
|
3203
|
-
case
|
|
3204
|
-
const
|
|
3205
|
-
p(
|
|
3199
|
+
case L.TAB:
|
|
3200
|
+
case L.ENTER: {
|
|
3201
|
+
const _ = $[I];
|
|
3202
|
+
p(_.name, _.functionType);
|
|
3206
3203
|
break;
|
|
3207
3204
|
}
|
|
3208
|
-
case
|
|
3209
|
-
|
|
3205
|
+
case L.ESC: {
|
|
3206
|
+
h(), i();
|
|
3210
3207
|
break;
|
|
3211
3208
|
}
|
|
3212
3209
|
}
|
|
3213
3210
|
};
|
|
3214
|
-
return M.add(
|
|
3211
|
+
return M.add(d.registerCommand({
|
|
3215
3212
|
id: N,
|
|
3216
3213
|
type: be.OPERATION,
|
|
3217
|
-
handler(
|
|
3218
|
-
const { keyCode:
|
|
3219
|
-
|
|
3214
|
+
handler(k, $) {
|
|
3215
|
+
const { keyCode: I } = $;
|
|
3216
|
+
w(I);
|
|
3220
3217
|
}
|
|
3221
|
-
})), [
|
|
3218
|
+
})), [L.ARROW_UP, L.ARROW_DOWN, L.ENTER, L.ESC, L.TAB].map((k) => ({
|
|
3222
3219
|
id: N,
|
|
3223
|
-
binding:
|
|
3220
|
+
binding: k,
|
|
3224
3221
|
preconditions: () => !0,
|
|
3225
3222
|
priority: 1e3,
|
|
3226
3223
|
staticParameters: {
|
|
3227
3224
|
eventType: xe.Keyboard,
|
|
3228
|
-
keyCode:
|
|
3225
|
+
keyCode: k
|
|
3229
3226
|
}
|
|
3230
|
-
})).forEach((
|
|
3231
|
-
M.add(a.registerShortcut(
|
|
3227
|
+
})).forEach((k) => {
|
|
3228
|
+
M.add(a.registerShortcut(k));
|
|
3232
3229
|
}), () => {
|
|
3233
3230
|
M.dispose();
|
|
3234
3231
|
};
|
|
3235
3232
|
}, [f]);
|
|
3236
|
-
function
|
|
3237
|
-
const M =
|
|
3233
|
+
function F(N) {
|
|
3234
|
+
const M = S.current;
|
|
3238
3235
|
if (!M) return;
|
|
3239
|
-
const
|
|
3240
|
-
if (!
|
|
3241
|
-
const
|
|
3242
|
-
if (
|
|
3236
|
+
const w = M.children[N];
|
|
3237
|
+
if (!w) return;
|
|
3238
|
+
const $ = M.getBoundingClientRect().top, I = M.offsetHeight, _ = w.getBoundingClientRect(), O = _.top, D = _.height;
|
|
3239
|
+
if (O >= 0 && O > $ && O - $ + D <= I)
|
|
3243
3240
|
return;
|
|
3244
|
-
const
|
|
3241
|
+
const U = w.offsetTop - (I - D) / 2;
|
|
3245
3242
|
M.scrollTo({
|
|
3246
|
-
top:
|
|
3243
|
+
top: U,
|
|
3247
3244
|
behavior: "smooth"
|
|
3248
3245
|
});
|
|
3249
3246
|
}
|
|
3250
|
-
const
|
|
3247
|
+
const A = le(() => {
|
|
3251
3248
|
let N = "";
|
|
3252
3249
|
return () => {
|
|
3253
3250
|
clearTimeout(N), C.current = !0, N = setTimeout(() => {
|
|
@@ -3255,23 +3252,23 @@ function Mc(e, t) {
|
|
|
3255
3252
|
}, 300);
|
|
3256
3253
|
};
|
|
3257
3254
|
}, []);
|
|
3258
|
-
return f.length > 0 && l && /* @__PURE__ */ x(cn, { portal: !0, anchorRect$:
|
|
3255
|
+
return f.length > 0 && l && /* @__PURE__ */ x(cn, { portal: !0, anchorRect$: R, direction: "vertical", children: /* @__PURE__ */ x(
|
|
3259
3256
|
"ul",
|
|
3260
3257
|
{
|
|
3261
3258
|
ref: (N) => {
|
|
3262
|
-
|
|
3259
|
+
S.current = N, t && (t.current = N);
|
|
3263
3260
|
},
|
|
3264
3261
|
"data-u-comp": "sheets-formula-editor",
|
|
3265
|
-
className: se("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",
|
|
3262
|
+
className: se("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", En, ut),
|
|
3266
3263
|
children: f.map((N, M) => /* @__PURE__ */ B(
|
|
3267
3264
|
"li",
|
|
3268
3265
|
{
|
|
3269
3266
|
className: se("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", {
|
|
3270
|
-
"univer-bg-gray-200 dark:!univer-bg-gray-600":
|
|
3267
|
+
"univer-bg-gray-200 dark:!univer-bg-gray-600": v === M
|
|
3271
3268
|
}),
|
|
3272
3269
|
onMouseEnter: () => b(M),
|
|
3273
|
-
onMouseLeave:
|
|
3274
|
-
onMouseMove:
|
|
3270
|
+
onMouseLeave: T,
|
|
3271
|
+
onMouseMove: A,
|
|
3275
3272
|
onClick: () => {
|
|
3276
3273
|
p(N.name, N.functionType), s && s.focus();
|
|
3277
3274
|
},
|
|
@@ -3294,9 +3291,9 @@ function Mc(e, t) {
|
|
|
3294
3291
|
}
|
|
3295
3292
|
) });
|
|
3296
3293
|
}
|
|
3297
|
-
const
|
|
3298
|
-
},
|
|
3299
|
-
var
|
|
3294
|
+
const Oc = (e) => e.startsWith(pr.EQUALS) ? e.slice(1) : "", rr = () => {
|
|
3295
|
+
}, Nc = Ve((e, t) => {
|
|
3296
|
+
var xn, wn, kn, An;
|
|
3300
3297
|
const {
|
|
3301
3298
|
errorText: n,
|
|
3302
3299
|
initValue: o,
|
|
@@ -3304,74 +3301,74 @@ const xc = (e) => e.startsWith(vr.EQUALS) ? e.slice(1) : "", or = () => {
|
|
|
3304
3301
|
subUnitId: s,
|
|
3305
3302
|
isFocus: i = !0,
|
|
3306
3303
|
isSupportAcrossSheet: c = !1,
|
|
3307
|
-
onFocus: a =
|
|
3308
|
-
onBlur:
|
|
3304
|
+
onFocus: a = rr,
|
|
3305
|
+
onBlur: d = rr,
|
|
3309
3306
|
onChange: f,
|
|
3310
3307
|
onVerify: m,
|
|
3311
|
-
className:
|
|
3312
|
-
editorId:
|
|
3308
|
+
className: u,
|
|
3309
|
+
editorId: h,
|
|
3313
3310
|
moveCursor: l = !0,
|
|
3314
|
-
onFormulaSelectingChange:
|
|
3315
|
-
keyboardEventConfig:
|
|
3311
|
+
onFormulaSelectingChange: S,
|
|
3312
|
+
keyboardEventConfig: v,
|
|
3316
3313
|
onMoveInEditor: g,
|
|
3317
3314
|
resetSelectionOnBlur: C = !0,
|
|
3318
|
-
autoScrollbar:
|
|
3315
|
+
autoScrollbar: R = !0,
|
|
3319
3316
|
isSingle: E = !0,
|
|
3320
3317
|
disableSelectionOnClick: p = !1,
|
|
3321
3318
|
autofocus: b = !0,
|
|
3322
|
-
disableContextMenu:
|
|
3323
|
-
style:
|
|
3324
|
-
} = e,
|
|
3325
|
-
|
|
3326
|
-
isClickOutSide: (
|
|
3319
|
+
disableContextMenu: T,
|
|
3320
|
+
style: F
|
|
3321
|
+
} = e, A = y(ze), N = X(null), M = ee(f);
|
|
3322
|
+
Os(t, () => ({
|
|
3323
|
+
isClickOutSide: (z) => N.current ? !N.current.contains(z.target) : !1
|
|
3327
3324
|
}));
|
|
3328
|
-
const
|
|
3325
|
+
const w = ee(S), k = X(null), $ = X(void 0), I = $.current, [_, O] = H(i), D = X(null), U = le(() => h != null ? h : ao(`${Fo}-${Yt(4)}`), []), Y = le(() => n !== void 0, [n]), re = y(ne), he = re.getUnit(U);
|
|
3329
3326
|
_e(he == null ? void 0 : he.change$);
|
|
3330
|
-
const
|
|
3331
|
-
|
|
3327
|
+
const G = ac(), J = uo.transform.getPlainText((wn = (xn = he == null ? void 0 : he.getBody()) == null ? void 0 : xn.dataStream) != null ? wn : ""), ot = rt(J), st = le(() => Oc(J), [J]), Ot = le(() => G(st), [st, G]), { isSelecting: Oe, isSelectingRef: Nt } = lc({ unitId: r, subUnitId: s, editorId: U, isFocus: _, disableOnClick: p }), K = X(""), fe = y(Te).getRenderById(U), oe = fe == null ? void 0 : fe.with(_r), ae = oe == null ? void 0 : oe.isFocusing, ge = le(() => re.getCurrentTypeOfUnit$(W.UNIVER_DOC), [re]), Se = _e(ge), We = (Se == null ? void 0 : Se.getUnitId()) === U, He = X([]), Z = Oe, we = (An = (kn = y(pn).getConfig(xr)) == null ? void 0 : kn.functionScreenTips) != null ? An : !0;
|
|
3328
|
+
bs(() => {
|
|
3332
3329
|
M(J);
|
|
3333
3330
|
}, [J, M]);
|
|
3334
|
-
const it =
|
|
3335
|
-
if (
|
|
3336
|
-
K.current =
|
|
3337
|
-
const xt =
|
|
3338
|
-
|
|
3339
|
-
|
|
3331
|
+
const it = jr("="), Be = dc(r, s), me = ee((z, ce = !0, ke, Ne) => {
|
|
3332
|
+
if (!$.current) return;
|
|
3333
|
+
K.current = z;
|
|
3334
|
+
const xt = z[0] === "=" ? z.slice(1) : "", Ae = G(xt), Gr = Ae.reduce((qe, kt) => typeof kt == "object" ? `${qe}${kt.token}` : `${qe}${kt}`, ""), wt = it(
|
|
3335
|
+
$.current,
|
|
3336
|
+
Gr === xt ? Ae : [],
|
|
3340
3337
|
ce,
|
|
3341
3338
|
Ne
|
|
3342
3339
|
);
|
|
3343
3340
|
if (He.current = wt, ke) {
|
|
3344
|
-
const qe = Ne != null ? Ne :
|
|
3341
|
+
const qe = Ne != null ? Ne : I == null ? void 0 : I.getSelectionRanges();
|
|
3345
3342
|
if ((qe == null ? void 0 : qe.length) !== 1)
|
|
3346
3343
|
return;
|
|
3347
|
-
const
|
|
3348
|
-
if (
|
|
3349
|
-
const
|
|
3350
|
-
|
|
3344
|
+
const Zr = qe[0].startOffset - 1, zr = On(Ae, Zr, !1), Fn = Hr(Ae, zr);
|
|
3345
|
+
if (Fn >= 0) {
|
|
3346
|
+
const Dn = wt.splice(Fn, 1)[0];
|
|
3347
|
+
Dn && wt.push(Dn);
|
|
3351
3348
|
}
|
|
3352
|
-
Be(
|
|
3349
|
+
Be(_ ? wt : [], $.current);
|
|
3353
3350
|
}
|
|
3354
3351
|
});
|
|
3355
3352
|
P(() => {
|
|
3356
|
-
|
|
3357
|
-
}, [
|
|
3358
|
-
if (
|
|
3353
|
+
_ && me(J, !1, !0);
|
|
3354
|
+
}, [_]), P(() => {
|
|
3355
|
+
if (_) {
|
|
3359
3356
|
if (K.current === J) return;
|
|
3360
3357
|
me(J, !1, !0);
|
|
3361
3358
|
}
|
|
3362
|
-
}, [J]),
|
|
3363
|
-
const ie =
|
|
3359
|
+
}, [J]), Ic(_, m, J);
|
|
3360
|
+
const ie = ic(I), gt = pc(_, r, s);
|
|
3364
3361
|
P(() => {
|
|
3365
|
-
var
|
|
3366
|
-
|
|
3367
|
-
}, [
|
|
3368
|
-
let
|
|
3369
|
-
if (
|
|
3370
|
-
|
|
3362
|
+
var z;
|
|
3363
|
+
w(Oe, (z = oe == null ? void 0 : oe.isFocusing) != null ? z : !0);
|
|
3364
|
+
}, [w, Oe]), Jo(_, v, I), Pt(() => {
|
|
3365
|
+
let z;
|
|
3366
|
+
if (D.current) {
|
|
3367
|
+
z = A.register({
|
|
3371
3368
|
autofocus: b,
|
|
3372
|
-
editorUnitId:
|
|
3369
|
+
editorUnitId: U,
|
|
3373
3370
|
initialSnapshot: {
|
|
3374
|
-
id:
|
|
3371
|
+
id: U,
|
|
3375
3372
|
body: {
|
|
3376
3373
|
dataStream: `${o}\r
|
|
3377
3374
|
`,
|
|
@@ -3382,176 +3379,176 @@ const xc = (e) => e.startsWith(vr.EQUALS) ? e.slice(1) : "", or = () => {
|
|
|
3382
3379
|
},
|
|
3383
3380
|
documentStyle: {}
|
|
3384
3381
|
}
|
|
3385
|
-
},
|
|
3386
|
-
const ce =
|
|
3387
|
-
|
|
3382
|
+
}, D.current);
|
|
3383
|
+
const ce = A.getEditor(U);
|
|
3384
|
+
$.current = ce, me(o, !1, !0);
|
|
3388
3385
|
}
|
|
3389
3386
|
return () => {
|
|
3390
|
-
|
|
3387
|
+
z == null || z.dispose();
|
|
3391
3388
|
};
|
|
3392
3389
|
}, []), Pt(() => {
|
|
3393
|
-
i ? (
|
|
3394
|
-
}, [i,
|
|
3395
|
-
const { checkScrollBar: Jt } =
|
|
3396
|
-
|
|
3397
|
-
const Mt = ee((
|
|
3390
|
+
i ? (O(i), ie()) : (C && (I == null || I.blur(), gt()), O(i));
|
|
3391
|
+
}, [i, I, ie, gt, C]);
|
|
3392
|
+
const { checkScrollBar: Jt } = es(I, E, R);
|
|
3393
|
+
mc(_, !!(Oe && We), r, U, T), gc(!!(_ && ae && l), Z, I, g);
|
|
3394
|
+
const Mt = ee((z, ce, ke) => {
|
|
3398
3395
|
if (!ae)
|
|
3399
3396
|
return;
|
|
3400
3397
|
const Ne = ce !== -1 ? [{ startOffset: ce + 1, endOffset: ce + 1, collapsed: !0 }] : void 0;
|
|
3401
|
-
me(`=${
|
|
3402
|
-
const xt = { startOffset: ce + 1, endOffset: ce + 1 }, Ae =
|
|
3398
|
+
me(`=${z}`, !0, ke, Ne), ke && (ie(), ce !== -1 && setTimeout(() => {
|
|
3399
|
+
const xt = { startOffset: ce + 1, endOffset: ce + 1 }, Ae = I == null ? void 0 : I.render.with(ts);
|
|
3403
3400
|
Ae == null || Ae.scrollToRange({ ...xt, collapsed: !0 });
|
|
3404
3401
|
}, 50), Jt());
|
|
3405
3402
|
});
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3403
|
+
_c(
|
|
3404
|
+
_ && !!(Oe && We),
|
|
3405
|
+
_,
|
|
3409
3406
|
Nt,
|
|
3410
3407
|
r,
|
|
3411
3408
|
s,
|
|
3412
3409
|
He,
|
|
3413
3410
|
c,
|
|
3414
|
-
!!
|
|
3415
|
-
|
|
3411
|
+
!!Z,
|
|
3412
|
+
I,
|
|
3416
3413
|
Mt
|
|
3417
|
-
),
|
|
3414
|
+
), Rc(_ && !!(Oe && We), r, c, O, d, () => {
|
|
3418
3415
|
me(ot.current, !1, !0);
|
|
3419
3416
|
});
|
|
3420
|
-
const
|
|
3421
|
-
if (
|
|
3422
|
-
const ce =
|
|
3417
|
+
const Nn = (z) => {
|
|
3418
|
+
if (z) {
|
|
3419
|
+
const ce = I == null ? void 0 : I.getSelectionRanges();
|
|
3423
3420
|
if (ce && ce.length === 1) {
|
|
3424
3421
|
const ke = ce[0];
|
|
3425
3422
|
if (ke.collapsed) {
|
|
3426
|
-
const Ne =
|
|
3423
|
+
const Ne = z.offset;
|
|
3427
3424
|
setTimeout(() => {
|
|
3428
|
-
|
|
3425
|
+
I == null || I.setSelectionRanges([{ startOffset: ke.startOffset - Ne, endOffset: ke.endOffset - Ne }]);
|
|
3429
3426
|
}, 30);
|
|
3430
3427
|
}
|
|
3431
3428
|
}
|
|
3432
|
-
ie(), me(`=${
|
|
3429
|
+
ie(), me(`=${z.text}`);
|
|
3433
3430
|
}
|
|
3434
|
-
},
|
|
3435
|
-
|
|
3431
|
+
}, Mn = () => {
|
|
3432
|
+
O(!0), a(), ie();
|
|
3436
3433
|
};
|
|
3437
|
-
return /* @__PURE__ */ B("div", { className:
|
|
3434
|
+
return /* @__PURE__ */ B("div", { className: u, children: [
|
|
3438
3435
|
/* @__PURE__ */ x(
|
|
3439
3436
|
"div",
|
|
3440
3437
|
{
|
|
3441
3438
|
ref: N,
|
|
3442
3439
|
className: se("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", {
|
|
3443
|
-
"univer-ring-primary-500":
|
|
3444
|
-
"univer-ring-red-500":
|
|
3440
|
+
"univer-ring-primary-500": _,
|
|
3441
|
+
"univer-ring-red-500": Y
|
|
3445
3442
|
}),
|
|
3446
3443
|
children: /* @__PURE__ */ x(
|
|
3447
3444
|
"div",
|
|
3448
3445
|
{
|
|
3449
|
-
ref:
|
|
3446
|
+
ref: D,
|
|
3450
3447
|
className: "univer-relative univer-h-full univer-w-full",
|
|
3451
|
-
onMouseUp:
|
|
3448
|
+
onMouseUp: Mn
|
|
3452
3449
|
}
|
|
3453
3450
|
)
|
|
3454
3451
|
}
|
|
3455
3452
|
),
|
|
3456
3453
|
n !== void 0 && /* @__PURE__ */ x("div", { className: "univer-my-1 univer-text-xs univer-text-red-500", children: n }),
|
|
3457
|
-
we &&
|
|
3458
|
-
|
|
3454
|
+
we && I && st !== "" && /* @__PURE__ */ x(
|
|
3455
|
+
sc,
|
|
3459
3456
|
{
|
|
3460
|
-
editor:
|
|
3461
|
-
isFocus:
|
|
3457
|
+
editor: I,
|
|
3458
|
+
isFocus: _,
|
|
3462
3459
|
formulaText: J,
|
|
3463
3460
|
onClose: () => ie()
|
|
3464
3461
|
}
|
|
3465
3462
|
),
|
|
3466
|
-
we && !!
|
|
3467
|
-
|
|
3463
|
+
we && !!I && /* @__PURE__ */ x(
|
|
3464
|
+
yc,
|
|
3468
3465
|
{
|
|
3469
|
-
isFocus:
|
|
3466
|
+
isFocus: _,
|
|
3470
3467
|
sequenceNodes: Ot,
|
|
3471
|
-
onSelect:
|
|
3472
|
-
ref:
|
|
3473
|
-
editor:
|
|
3468
|
+
onSelect: Nn,
|
|
3469
|
+
ref: k,
|
|
3470
|
+
editor: I
|
|
3474
3471
|
}
|
|
3475
3472
|
)
|
|
3476
3473
|
] });
|
|
3477
3474
|
});
|
|
3478
|
-
function
|
|
3479
|
-
const r =
|
|
3475
|
+
function Mc(e, t, n, o) {
|
|
3476
|
+
const r = y(ye), s = jr(""), i = _e(e == null ? void 0 : e.getDocumentDataModel().change$), [c, a] = H([]), d = y(Do), f = X(""), m = y(ne);
|
|
3480
3477
|
return P(() => {
|
|
3481
3478
|
if (!e) return;
|
|
3482
|
-
const
|
|
3483
|
-
if (f.current ===
|
|
3479
|
+
const u = e.getDocumentDataModel().getPlainText();
|
|
3480
|
+
if (f.current === u)
|
|
3484
3481
|
return;
|
|
3485
|
-
f.current =
|
|
3486
|
-
const
|
|
3487
|
-
a(
|
|
3482
|
+
f.current = u;
|
|
3483
|
+
const h = r.sequenceNodesBuilder(u);
|
|
3484
|
+
a(h != null ? h : []);
|
|
3488
3485
|
}, [i, e, r]), P(() => {
|
|
3489
|
-
var l,
|
|
3486
|
+
var l, S;
|
|
3490
3487
|
if (!e) return;
|
|
3491
3488
|
if (!t) {
|
|
3492
|
-
const
|
|
3489
|
+
const v = e.getDocumentData();
|
|
3493
3490
|
e.setDocumentData({
|
|
3494
|
-
...
|
|
3491
|
+
...v,
|
|
3495
3492
|
body: {
|
|
3496
|
-
...
|
|
3497
|
-
dataStream: (
|
|
3493
|
+
...v.body,
|
|
3494
|
+
dataStream: (S = (l = v.body) == null ? void 0 : l.dataStream) != null ? S : "",
|
|
3498
3495
|
textRuns: []
|
|
3499
3496
|
}
|
|
3500
3497
|
});
|
|
3501
3498
|
return;
|
|
3502
3499
|
}
|
|
3503
|
-
const
|
|
3504
|
-
return
|
|
3505
|
-
const g = ht(
|
|
3506
|
-
if (!g.sheetName && o !== (
|
|
3500
|
+
const u = s(e, c, !1), h = new Ye();
|
|
3501
|
+
return u.forEach((v) => {
|
|
3502
|
+
const g = ht(v.token), C = m.getCurrentUnitForType(W.UNIVER_SHEET), R = C == null ? void 0 : C.getActiveSheet();
|
|
3503
|
+
if (!g.sheetName && o !== (R == null ? void 0 : R.getSheetId()) || g.sheetName && (R == null ? void 0 : R.getName()) !== g.sheetName)
|
|
3507
3504
|
return;
|
|
3508
|
-
const E = new mn(
|
|
3505
|
+
const E = new mn(v.themeColor).toRgb(), p = d.addShape({
|
|
3509
3506
|
range: g.range,
|
|
3510
3507
|
style: {
|
|
3511
|
-
stroke:
|
|
3508
|
+
stroke: v.themeColor,
|
|
3512
3509
|
fill: `rgba(${E.r}, ${E.g}, ${E.b}, 0.1)`,
|
|
3513
3510
|
strokeDash: 12
|
|
3514
3511
|
},
|
|
3515
3512
|
primary: null
|
|
3516
3513
|
});
|
|
3517
|
-
p &&
|
|
3514
|
+
p && h.add(() => d.removeShape(p));
|
|
3518
3515
|
}), () => {
|
|
3519
|
-
|
|
3516
|
+
h.dispose();
|
|
3520
3517
|
};
|
|
3521
|
-
}, [e, t, s,
|
|
3522
|
-
}
|
|
3523
|
-
function
|
|
3524
|
-
const t =
|
|
3525
|
-
const
|
|
3526
|
-
if (!
|
|
3527
|
-
const l = o ?
|
|
3528
|
-
range:
|
|
3518
|
+
}, [e, t, s, d, c]), { sequenceNodes: c };
|
|
3519
|
+
}
|
|
3520
|
+
function xc(e) {
|
|
3521
|
+
const t = y(Cn), { supportAcrossSheet: n = !1, keepSheetReference: o = !1, unitId: r, subUnitId: s, onChange: i } = e, a = y(ne).getUnit(r, W.UNIVER_SHEET), d = ee(i), f = ee((m, u) => {
|
|
3522
|
+
const h = a == null ? void 0 : a.getActiveSheet();
|
|
3523
|
+
if (!h || !n && h.getSheetId() !== s || !(m != null && m.length)) return;
|
|
3524
|
+
const l = o ? h.getName() : h.getSheetId() === s ? "" : h.getName(), S = m.map((v) => ({
|
|
3525
|
+
range: v.range,
|
|
3529
3526
|
unitId: r,
|
|
3530
3527
|
sheetName: l
|
|
3531
3528
|
}));
|
|
3532
|
-
|
|
3529
|
+
d(S, u);
|
|
3533
3530
|
});
|
|
3534
3531
|
P(() => {
|
|
3535
3532
|
const m = new Ye();
|
|
3536
|
-
return m.add(t.selectionMoveStart$.subscribe((
|
|
3537
|
-
f(
|
|
3538
|
-
})), m.add(t.selectionMoving$.subscribe((
|
|
3539
|
-
f(
|
|
3540
|
-
})), m.add(t.selectionMoveEnd$.subscribe((
|
|
3541
|
-
f(
|
|
3533
|
+
return m.add(t.selectionMoveStart$.subscribe((u) => {
|
|
3534
|
+
f(u, !0);
|
|
3535
|
+
})), m.add(t.selectionMoving$.subscribe((u) => {
|
|
3536
|
+
f(u, !1);
|
|
3537
|
+
})), m.add(t.selectionMoveEnd$.subscribe((u) => {
|
|
3538
|
+
f(u, !1);
|
|
3542
3539
|
})), () => {
|
|
3543
3540
|
m.dispose();
|
|
3544
3541
|
};
|
|
3545
3542
|
}, [f, t.selectionMoveEnd$, t.selectionMoveStart$, t.selectionMoving$]);
|
|
3546
3543
|
}
|
|
3547
|
-
const
|
|
3544
|
+
const or = (e) => !e.some((n) => {
|
|
3548
3545
|
if (typeof n == "string") {
|
|
3549
3546
|
if (n !== Ge.COMMA)
|
|
3550
3547
|
return !0;
|
|
3551
3548
|
} else if (n.nodeType !== Q.REFERENCE)
|
|
3552
3549
|
return !0;
|
|
3553
3550
|
return !1;
|
|
3554
|
-
}),
|
|
3551
|
+
}), wc = (e) => {
|
|
3555
3552
|
if (e.endColumn < e.startColumn) {
|
|
3556
3553
|
const t = e.endColumn;
|
|
3557
3554
|
e.endColumn = e.startColumn, e.startColumn = t;
|
|
@@ -3562,7 +3559,7 @@ const sr = (e) => !e.some((n) => {
|
|
|
3562
3559
|
}
|
|
3563
3560
|
return e;
|
|
3564
3561
|
};
|
|
3565
|
-
function
|
|
3562
|
+
function kc(e) {
|
|
3566
3563
|
const {
|
|
3567
3564
|
visible: t,
|
|
3568
3565
|
initialValue: n,
|
|
@@ -3572,25 +3569,25 @@ function Dc(e) {
|
|
|
3572
3569
|
supportAcrossSheet: i,
|
|
3573
3570
|
keepSheetReference: c,
|
|
3574
3571
|
onConfirm: a,
|
|
3575
|
-
onClose:
|
|
3572
|
+
onClose: d,
|
|
3576
3573
|
onShowBySelection: f
|
|
3577
|
-
} = e, m =
|
|
3574
|
+
} = e, m = y(dt), u = y(ye), [h, l] = H([]), [S, v] = H(0), g = X(null);
|
|
3578
3575
|
P(() => {
|
|
3579
3576
|
if (t && n.length) {
|
|
3580
3577
|
const p = n.map((b) => b.sheetName ? _t(b.sheetName, b.range) : Ee(b.range));
|
|
3581
|
-
l(p),
|
|
3578
|
+
l(p), v(p.length - 1);
|
|
3582
3579
|
} else
|
|
3583
|
-
l([""]),
|
|
3580
|
+
l([""]), v(0);
|
|
3584
3581
|
}, [t]);
|
|
3585
3582
|
const C = (p, b) => {
|
|
3586
|
-
const
|
|
3587
|
-
|
|
3588
|
-
},
|
|
3589
|
-
l([...
|
|
3583
|
+
const T = [...h];
|
|
3584
|
+
T[p] = b, l(T);
|
|
3585
|
+
}, R = () => {
|
|
3586
|
+
l([...h, ""]), v(h.length);
|
|
3590
3587
|
}, E = (p) => {
|
|
3591
|
-
|
|
3588
|
+
h.splice(p, 1), l([...h]);
|
|
3592
3589
|
};
|
|
3593
|
-
return
|
|
3590
|
+
return xc({
|
|
3594
3591
|
unitId: o,
|
|
3595
3592
|
subUnitId: r,
|
|
3596
3593
|
supportAcrossSheet: i,
|
|
@@ -3598,24 +3595,24 @@ function Dc(e) {
|
|
|
3598
3595
|
onChange: (p, b) => {
|
|
3599
3596
|
if (!t && f != null && f(p))
|
|
3600
3597
|
return;
|
|
3601
|
-
const
|
|
3602
|
-
if (!
|
|
3603
|
-
const N = [...
|
|
3604
|
-
if (
|
|
3605
|
-
b || N.splice(
|
|
3598
|
+
const T = new Set(h), F = p.map((M) => M.sheetName ? _t(M.sheetName, M.range) : Ee(M.range)), A = F.filter((M) => !T.has(M));
|
|
3599
|
+
if (!A.length) return;
|
|
3600
|
+
const N = [...h];
|
|
3601
|
+
if (F.length > 1) {
|
|
3602
|
+
b || N.splice(S, 1), N.push(...A);
|
|
3606
3603
|
const M = N.slice(0, s);
|
|
3607
|
-
l(M),
|
|
3608
|
-
var
|
|
3609
|
-
(
|
|
3604
|
+
l(M), v(M.length - 1), requestAnimationFrame(() => {
|
|
3605
|
+
var w;
|
|
3606
|
+
(w = g.current) == null || w.scrollTo({ top: g.current.scrollHeight });
|
|
3610
3607
|
});
|
|
3611
3608
|
} else {
|
|
3612
|
-
N.splice(
|
|
3609
|
+
N.splice(S, 1, ...A);
|
|
3613
3610
|
const M = N.slice(0, s);
|
|
3614
|
-
l(M), S
|
|
3611
|
+
l(M), v(S + A.length - 1);
|
|
3615
3612
|
}
|
|
3616
3613
|
}
|
|
3617
3614
|
}), /* @__PURE__ */ x(
|
|
3618
|
-
|
|
3615
|
+
ks,
|
|
3619
3616
|
{
|
|
3620
3617
|
width: "328px",
|
|
3621
3618
|
open: t,
|
|
@@ -3624,49 +3621,49 @@ function Dc(e) {
|
|
|
3624
3621
|
mask: !1,
|
|
3625
3622
|
maskClosable: !1,
|
|
3626
3623
|
footer: /* @__PURE__ */ B("footer", { className: "univer-flex univer-gap-2", children: [
|
|
3627
|
-
/* @__PURE__ */ x(at, { onClick:
|
|
3624
|
+
/* @__PURE__ */ x(at, { onClick: d, children: m.t("rangeSelector.cancel") }),
|
|
3628
3625
|
/* @__PURE__ */ x(
|
|
3629
3626
|
at,
|
|
3630
3627
|
{
|
|
3631
3628
|
variant: "primary",
|
|
3632
3629
|
onClick: () => {
|
|
3633
3630
|
a(
|
|
3634
|
-
|
|
3635
|
-
const b =
|
|
3631
|
+
h.filter((p) => {
|
|
3632
|
+
const b = u.sequenceNodesBuilder(p);
|
|
3636
3633
|
return b && b.length === 1 && typeof b[0] != "string" && b[0].nodeType === Q.REFERENCE;
|
|
3637
|
-
}).map((p) => ht(p)).map((p) => ({ ...p, range:
|
|
3634
|
+
}).map((p) => ht(p)).map((p) => ({ ...p, range: wc(p.range) }))
|
|
3638
3635
|
);
|
|
3639
3636
|
},
|
|
3640
3637
|
children: m.t("rangeSelector.confirm")
|
|
3641
3638
|
}
|
|
3642
3639
|
)
|
|
3643
3640
|
] }),
|
|
3644
|
-
onClose:
|
|
3641
|
+
onClose: d,
|
|
3645
3642
|
children: /* @__PURE__ */ B(
|
|
3646
3643
|
"div",
|
|
3647
3644
|
{
|
|
3648
3645
|
ref: g,
|
|
3649
3646
|
className: se("-univer-mx-6 univer-max-h-60 univer-overflow-y-auto univer-px-6", ut),
|
|
3650
3647
|
children: [
|
|
3651
|
-
|
|
3648
|
+
h.map((p, b) => /* @__PURE__ */ B(
|
|
3652
3649
|
"div",
|
|
3653
3650
|
{
|
|
3654
3651
|
className: "univer-mb-2 univer-flex univer-items-center univer-gap-4",
|
|
3655
3652
|
children: [
|
|
3656
3653
|
/* @__PURE__ */ x(
|
|
3657
|
-
|
|
3654
|
+
yr,
|
|
3658
3655
|
{
|
|
3659
3656
|
className: se("univer-w-full", {
|
|
3660
|
-
"univer-border-primary-600":
|
|
3657
|
+
"univer-border-primary-600": S === b
|
|
3661
3658
|
}),
|
|
3662
3659
|
placeholder: m.t("rangeSelector.placeHolder"),
|
|
3663
|
-
onFocus: () =>
|
|
3660
|
+
onFocus: () => v(b),
|
|
3664
3661
|
value: p,
|
|
3665
|
-
onChange: (
|
|
3662
|
+
onChange: (T) => C(b, T)
|
|
3666
3663
|
}
|
|
3667
3664
|
),
|
|
3668
|
-
|
|
3669
|
-
|
|
3665
|
+
h.length > 1 && /* @__PURE__ */ x(
|
|
3666
|
+
$r,
|
|
3670
3667
|
{
|
|
3671
3668
|
className: "univer-cursor-pointer",
|
|
3672
3669
|
onClick: () => E(b)
|
|
@@ -3676,8 +3673,8 @@ function Dc(e) {
|
|
|
3676
3673
|
},
|
|
3677
3674
|
b
|
|
3678
3675
|
)),
|
|
3679
|
-
|
|
3680
|
-
/* @__PURE__ */ x(
|
|
3676
|
+
h.length < s && /* @__PURE__ */ x("div", { children: /* @__PURE__ */ B(at, { variant: "link", onClick: R, children: [
|
|
3677
|
+
/* @__PURE__ */ x(Pr, {}),
|
|
3681
3678
|
/* @__PURE__ */ x("span", { children: m.t("rangeSelector.addAnotherRange") })
|
|
3682
3679
|
] }) })
|
|
3683
3680
|
]
|
|
@@ -3686,13 +3683,13 @@ function Dc(e) {
|
|
|
3686
3683
|
}
|
|
3687
3684
|
);
|
|
3688
3685
|
}
|
|
3689
|
-
function
|
|
3686
|
+
function Ac(e) {
|
|
3690
3687
|
return e.split(Ge.COMMA).filter((t) => !!t).map((t) => ht(t));
|
|
3691
3688
|
}
|
|
3692
|
-
function
|
|
3689
|
+
function Fc(e) {
|
|
3693
3690
|
return e.map((t) => t.sheetName ? _t(t.sheetName, t.range) : Ee(t.range)).join(Ge.COMMA);
|
|
3694
3691
|
}
|
|
3695
|
-
function
|
|
3692
|
+
function Kr(e) {
|
|
3696
3693
|
const [t, n] = H(null), {
|
|
3697
3694
|
onVerify: o,
|
|
3698
3695
|
selectorRef: r,
|
|
@@ -3700,20 +3697,20 @@ function Gr(e) {
|
|
|
3700
3697
|
subUnitId: i,
|
|
3701
3698
|
maxRangeCount: c,
|
|
3702
3699
|
supportAcrossSheet: a,
|
|
3703
|
-
keepSheetReference:
|
|
3700
|
+
keepSheetReference: d,
|
|
3704
3701
|
autoFocus: f,
|
|
3705
3702
|
onChange: m,
|
|
3706
|
-
onRangeSelectorDialogVisibleChange:
|
|
3707
|
-
onClickOutside:
|
|
3703
|
+
onRangeSelectorDialogVisibleChange: u,
|
|
3704
|
+
onClickOutside: h,
|
|
3708
3705
|
onFocusChange: l,
|
|
3709
|
-
forceShowDialogWhenSelectionChanged:
|
|
3710
|
-
hideEditor:
|
|
3706
|
+
forceShowDialogWhenSelectionChanged: S,
|
|
3707
|
+
hideEditor: v,
|
|
3711
3708
|
resetRange: g
|
|
3712
|
-
} = e, [C,
|
|
3713
|
-
t == null || t.setSelectionRanges([]), t == null || t.blur(),
|
|
3714
|
-
}),
|
|
3715
|
-
var
|
|
3716
|
-
|
|
3709
|
+
} = e, [C, R] = H(f != null ? f : !1), [E, p] = H(!1), [b, T] = H([]), F = y(dt), A = y(ze), { sequenceNodes: N } = Mc(t, C, s, i), M = rt(N), w = y(pe), k = ee(() => {
|
|
3710
|
+
t == null || t.setSelectionRanges([]), t == null || t.blur(), A.blur();
|
|
3711
|
+
}), $ = ee(() => {
|
|
3712
|
+
var I;
|
|
3713
|
+
k(), T(Ac((I = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? I : "")), p(!0);
|
|
3717
3714
|
});
|
|
3718
3715
|
return P(() => {
|
|
3719
3716
|
r && (r.current = {
|
|
@@ -3721,85 +3718,85 @@ function Gr(e) {
|
|
|
3721
3718
|
return t;
|
|
3722
3719
|
},
|
|
3723
3720
|
focus() {
|
|
3724
|
-
|
|
3721
|
+
A.focus(t.getEditorId());
|
|
3725
3722
|
},
|
|
3726
|
-
blur:
|
|
3727
|
-
verify: () =>
|
|
3728
|
-
showDialog: (
|
|
3729
|
-
|
|
3723
|
+
blur: k,
|
|
3724
|
+
verify: () => or(M.current),
|
|
3725
|
+
showDialog: (I) => {
|
|
3726
|
+
k(), T(I), p(!0);
|
|
3730
3727
|
},
|
|
3731
3728
|
hideDialog: () => {
|
|
3732
|
-
|
|
3729
|
+
T([]), p(!1);
|
|
3733
3730
|
},
|
|
3734
3731
|
getValue: () => {
|
|
3735
|
-
var
|
|
3736
|
-
return (
|
|
3732
|
+
var I;
|
|
3733
|
+
return (I = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? I : "";
|
|
3737
3734
|
}
|
|
3738
3735
|
});
|
|
3739
|
-
}, [
|
|
3740
|
-
var
|
|
3741
|
-
o == null || o(
|
|
3736
|
+
}, [k, t, A, r, M]), P(() => {
|
|
3737
|
+
var I;
|
|
3738
|
+
o == null || o(or(N), (I = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? I : "");
|
|
3742
3739
|
}, [N]), P(() => {
|
|
3743
|
-
|
|
3740
|
+
u == null || u(E);
|
|
3744
3741
|
}, [E]), P(() => {
|
|
3745
3742
|
if (E && g)
|
|
3746
3743
|
return () => {
|
|
3747
|
-
const
|
|
3744
|
+
const I = {
|
|
3748
3745
|
unitId: s,
|
|
3749
3746
|
subUnitId: i,
|
|
3750
3747
|
selections: g
|
|
3751
3748
|
};
|
|
3752
|
-
|
|
3749
|
+
w.executeCommand(_n.id, I);
|
|
3753
3750
|
};
|
|
3754
|
-
}, [E]), /* @__PURE__ */ B(
|
|
3755
|
-
|
|
3756
|
-
|
|
3751
|
+
}, [E]), /* @__PURE__ */ B(Ts, { children: [
|
|
3752
|
+
v ? null : /* @__PURE__ */ x(
|
|
3753
|
+
ns,
|
|
3757
3754
|
{
|
|
3758
3755
|
isSingle: !0,
|
|
3759
3756
|
...e,
|
|
3760
|
-
onFocusChange: (
|
|
3761
|
-
|
|
3757
|
+
onFocusChange: (I, _) => {
|
|
3758
|
+
R(I), l == null || l(I, _);
|
|
3762
3759
|
},
|
|
3763
3760
|
editorRef: n,
|
|
3764
3761
|
onClickOutside: () => {
|
|
3765
|
-
|
|
3762
|
+
R(!1), k(), h == null || h();
|
|
3766
3763
|
},
|
|
3767
|
-
icon: /* @__PURE__ */ x(
|
|
3768
|
-
|
|
3764
|
+
icon: /* @__PURE__ */ x(ws, { title: F.t("rangeSelector.buttonTooltip"), placement: "bottom", children: /* @__PURE__ */ x(
|
|
3765
|
+
Vr,
|
|
3769
3766
|
{
|
|
3770
3767
|
className: "univer-cursor-pointer dark:!univer-text-gray-300",
|
|
3771
|
-
onClick:
|
|
3768
|
+
onClick: $
|
|
3772
3769
|
}
|
|
3773
3770
|
) })
|
|
3774
3771
|
}
|
|
3775
3772
|
),
|
|
3776
3773
|
/* @__PURE__ */ x(
|
|
3777
|
-
|
|
3774
|
+
kc,
|
|
3778
3775
|
{
|
|
3779
3776
|
initialValue: b,
|
|
3780
3777
|
unitId: s,
|
|
3781
3778
|
subUnitId: i,
|
|
3782
3779
|
visible: E,
|
|
3783
3780
|
maxRangeCount: c,
|
|
3784
|
-
onConfirm: (
|
|
3785
|
-
const
|
|
3786
|
-
|
|
3787
|
-
|
|
3781
|
+
onConfirm: (I) => {
|
|
3782
|
+
const _ = Fc(I), O = ho.newEmptyData();
|
|
3783
|
+
O.body.dataStream = _, t == null || t.replaceText(_, !1), m == null || m(O, _), p(!1), T([]), requestAnimationFrame(() => {
|
|
3784
|
+
k();
|
|
3788
3785
|
});
|
|
3789
3786
|
},
|
|
3790
3787
|
onClose: () => {
|
|
3791
|
-
p(!1),
|
|
3788
|
+
p(!1), T([]);
|
|
3792
3789
|
},
|
|
3793
3790
|
supportAcrossSheet: a,
|
|
3794
|
-
keepSheetReference:
|
|
3795
|
-
onShowBySelection: (
|
|
3791
|
+
keepSheetReference: d,
|
|
3792
|
+
onShowBySelection: (I) => C || S ? (T(I), p(!0), !1) : !0
|
|
3796
3793
|
}
|
|
3797
3794
|
)
|
|
3798
3795
|
] });
|
|
3799
3796
|
}
|
|
3800
|
-
const
|
|
3797
|
+
const Dc = () => {
|
|
3801
3798
|
var o, r;
|
|
3802
|
-
const e =
|
|
3799
|
+
const e = y(Wr), t = _e(e.currentSelector$), n = X(null);
|
|
3803
3800
|
return P(() => {
|
|
3804
3801
|
var s, i;
|
|
3805
3802
|
if (t)
|
|
@@ -3808,7 +3805,7 @@ const Pc = () => {
|
|
|
3808
3805
|
(c = n.current) == null || c.hideDialog();
|
|
3809
3806
|
};
|
|
3810
3807
|
}, [t]), /* @__PURE__ */ x(
|
|
3811
|
-
|
|
3808
|
+
Kr,
|
|
3812
3809
|
{
|
|
3813
3810
|
unitId: (o = t == null ? void 0 : t.unitId) != null ? o : "",
|
|
3814
3811
|
subUnitId: (r = t == null ? void 0 : t.subUnitId) != null ? r : "",
|
|
@@ -3821,24 +3818,24 @@ const Pc = () => {
|
|
|
3821
3818
|
}
|
|
3822
3819
|
);
|
|
3823
3820
|
};
|
|
3824
|
-
var
|
|
3825
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
3821
|
+
var Lc = Object.defineProperty, $c = Object.getOwnPropertyDescriptor, Pc = (e, t, n) => t in e ? Lc(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Uc = (e, t, n, o) => {
|
|
3822
|
+
for (var r = o > 1 ? void 0 : o ? $c(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
3826
3823
|
(i = e[s]) && (r = i(r) || r);
|
|
3827
3824
|
return r;
|
|
3828
|
-
}, Dt = (e, t) => (n, o) => t(n, o, e),
|
|
3829
|
-
let Kt = class extends
|
|
3830
|
-
constructor(e =
|
|
3825
|
+
}, Dt = (e, t) => (n, o) => t(n, o, e), Yr = (e, t, n) => Pc(e, typeof t != "symbol" ? t + "" : t, n);
|
|
3826
|
+
let Kt = class extends go {
|
|
3827
|
+
constructor(e = Jn, t, n, o, r) {
|
|
3831
3828
|
super(), this._config = e, this._injector = t, this._renderManagerService = n, this._configService = o, this._uiPartsService = r;
|
|
3832
|
-
const { menu: s, ...i } =
|
|
3833
|
-
|
|
3829
|
+
const { menu: s, ...i } = mo(
|
|
3830
|
+
Jn,
|
|
3834
3831
|
this._config
|
|
3835
3832
|
);
|
|
3836
|
-
s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(
|
|
3833
|
+
s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(xr, i, { merge: !0 });
|
|
3837
3834
|
}
|
|
3838
3835
|
onStarting() {
|
|
3839
|
-
|
|
3836
|
+
po(this._injector, [
|
|
3840
3837
|
[Xt, { useClass: ln }],
|
|
3841
|
-
[
|
|
3838
|
+
[Wr],
|
|
3842
3839
|
[qt],
|
|
3843
3840
|
[Vt],
|
|
3844
3841
|
[Wt],
|
|
@@ -3852,15 +3849,15 @@ let Kt = class extends po {
|
|
|
3852
3849
|
[
|
|
3853
3850
|
[Le]
|
|
3854
3851
|
].forEach((e) => {
|
|
3855
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
3852
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(W.UNIVER_SHEET, e));
|
|
3856
3853
|
});
|
|
3857
3854
|
}
|
|
3858
3855
|
onRendered() {
|
|
3859
3856
|
[
|
|
3860
3857
|
[an]
|
|
3861
3858
|
].forEach((e) => {
|
|
3862
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
3863
|
-
}),
|
|
3859
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(W.UNIVER_SHEET, e));
|
|
3860
|
+
}), So(this._injector, [
|
|
3864
3861
|
[qt],
|
|
3865
3862
|
// FormulaProgressBar relies on TriggerCalculationController, but it is necessary to ensure that the formula calculation is done after rendered.
|
|
3866
3863
|
[Wt],
|
|
@@ -3872,33 +3869,33 @@ let Kt = class extends po {
|
|
|
3872
3869
|
this._injector.get(Vt), this._injector.get(Ut);
|
|
3873
3870
|
}
|
|
3874
3871
|
_initUIPart() {
|
|
3875
|
-
const e = this._injector.get(
|
|
3876
|
-
this.disposeWithMe(e.register(
|
|
3872
|
+
const e = this._injector.get(Er);
|
|
3873
|
+
this.disposeWithMe(e.register(Lo, Kr)), this.disposeWithMe(e.register($o, Nc)), this.disposeWithMe(this._uiPartsService.registerComponent(ys.GLOBAL, () => br(Dc, this._injector)));
|
|
3877
3874
|
}
|
|
3878
3875
|
};
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
Kt =
|
|
3882
|
-
|
|
3876
|
+
Yr(Kt, "pluginName", Or);
|
|
3877
|
+
Yr(Kt, "type", W.UNIVER_SHEET);
|
|
3878
|
+
Kt = Uc([
|
|
3879
|
+
fo(Cs),
|
|
3883
3880
|
Dt(1, q(It)),
|
|
3884
3881
|
Dt(2, Te),
|
|
3885
|
-
Dt(3,
|
|
3886
|
-
Dt(4,
|
|
3882
|
+
Dt(3, pn),
|
|
3883
|
+
Dt(4, Ir)
|
|
3887
3884
|
], Kt);
|
|
3888
3885
|
export {
|
|
3889
|
-
|
|
3890
|
-
|
|
3886
|
+
$s as FORMULA_PROMPT_ACTIVATED,
|
|
3887
|
+
Nc as FormulaEditor,
|
|
3891
3888
|
Ut as FormulaReorderController,
|
|
3892
|
-
|
|
3893
|
-
|
|
3889
|
+
Wr as GlobalRangeSelectorService,
|
|
3890
|
+
Ps as HelpFunctionOperation,
|
|
3894
3891
|
ve as InsertFunctionOperation,
|
|
3895
|
-
|
|
3896
|
-
|
|
3892
|
+
Tn as MoreFunctionsOperation,
|
|
3893
|
+
Kr as RangeSelector,
|
|
3897
3894
|
Le as RefSelectionsRenderService,
|
|
3898
|
-
|
|
3899
|
-
|
|
3895
|
+
Mr as ReferenceAbsoluteOperation,
|
|
3896
|
+
js as SearchFunctionOperation,
|
|
3900
3897
|
ft as SelectEditorFormulaOperation,
|
|
3901
|
-
|
|
3902
|
-
|
|
3898
|
+
bn as SheetCopyFormulaOnlyCommand,
|
|
3899
|
+
yn as SheetOnlyPasteFormulaCommand,
|
|
3903
3900
|
Kt as UniverSheetsFormulaUIPlugin
|
|
3904
3901
|
};
|