@univerjs/sheets-formula-ui 0.15.0-insiders.20260110-48b77c8 → 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 +1147 -1145
- package/lib/index.js +1147 -1145
- 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 +12 -12
package/lib/index.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
var Xr = Object.defineProperty;
|
|
2
2
|
var Qr = (e, t, n) => t in e ? Xr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
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
|
|
5
|
-
import { ISheetClipboardService as lr, PREDEFINED_HOOK_NAME_COPY as ar, SheetPasteCommand as vo, PREDEFINED_HOOK_NAME_PASTE as lt, IEditorBridgeService as
|
|
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
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
|
|
8
|
-
import { IEditorService as ze, DocSelectionRenderService as _r, ReplaceTextRunsCommand as
|
|
9
|
-
import { DeviceInputEventType as xe, IRenderManagerService as Te, ScrollTimerType as en, SHEET_VIEWPORT_KEY as
|
|
10
|
-
import { SheetsSelectionsService as
|
|
11
|
-
import { InsertFunctionCommand as gs, TriggerCalculationController as ms, IDescriptionService as Zt, QuickSumCommand as
|
|
12
|
-
import { ISidebarService as
|
|
13
|
-
import { jsx as
|
|
14
|
-
import { useCallback as $t, useState as H, useRef as
|
|
15
|
-
import { clsx as se, scrollbarClassName as ut, borderLeftClassName as
|
|
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
|
+
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 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
16
|
import { DocSelectionManagerService as Tr } from "@univerjs/docs";
|
|
17
|
-
import { debounceTime as
|
|
18
|
-
const
|
|
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
21
|
handler: async (e) => e.get(lr).copy({
|
|
22
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
27
|
handler: async (e) => e.get(pe).executeCommand(vo.id, {
|
|
@@ -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 $s = {
|
|
|
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
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 $s = {
|
|
|
282
282
|
return !1;
|
|
283
283
|
});
|
|
284
284
|
if (l) {
|
|
285
|
-
const E = rs(
|
|
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
|
|
302
|
+
await m.executeCommand(_n.id, b);
|
|
303
|
+
const T = o.getEditor(fn), F = o.getEditor(sr);
|
|
304
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 zn(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 zn(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 Ps(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,40 +371,40 @@ 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) ===
|
|
374
|
+
const n = t.dataStream, r = n.substring(n.length - 2, n.length) === ir ? n.substring(0, n.length - 2) : n;
|
|
375
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 Or = "SHEET_FORMULA_UI_PLUGIN", Nr = `${Or}_MORE_FUNCTIONS_COMPONENT`,
|
|
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
409
|
children: { label: Nr }
|
|
410
410
|
}), !0)
|
|
@@ -412,13 +412,13 @@ const Or = "SHEET_FORMULA_UI_PLUGIN", Nr = `${Or}_MORE_FUNCTIONS_COMPONENT`, yn
|
|
|
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);
|
|
@@ -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 no.foreach(s, (
|
|
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(
|
|
484
|
+
Ut = Ys([
|
|
485
|
+
At(0, q(Rn)),
|
|
486
486
|
At(1, q(ne)),
|
|
487
487
|
At(2, q(Tt)),
|
|
488
488
|
At(3, q(ye))
|
|
489
489
|
], Ut);
|
|
490
|
-
const xr = "sheets-formula-ui.base.config",
|
|
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),
|
|
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
524
|
if (ro(a)) {
|
|
525
|
-
const f = gr(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
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,28 +556,28 @@ let an = class extends Ze {
|
|
|
556
556
|
this._cellAlertManagerService.removeAlert(nn);
|
|
557
557
|
}
|
|
558
558
|
};
|
|
559
|
-
an =
|
|
559
|
+
an = Zs([
|
|
560
560
|
St(1, q(Co)),
|
|
561
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;
|
|
@@ -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 Js(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();
|
|
@@ -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
|
|
746
|
+
const d = t.range, f = n, m = {
|
|
747
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 =
|
|
765
|
+
Wt = ni([
|
|
766
766
|
vt(0, ne),
|
|
767
767
|
vt(1, q(ye)),
|
|
768
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
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 ri(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 = wr(
|
|
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 === dr.CUT ? o.forValue((
|
|
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 li(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
|
|
@@ -934,11 +934,11 @@ function wr(e) {
|
|
|
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
|
-
|
|
975
|
+
cr(
|
|
976
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
|
)
|
|
@@ -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,8 +1075,8 @@ 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),
|
|
@@ -1084,12 +1084,12 @@ Ht = ui([
|
|
|
1084
1084
|
je(6, pe),
|
|
1085
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"
|
|
@@ -1102,11 +1102,11 @@ let Bt = class extends so {
|
|
|
1102
1102
|
{
|
|
1103
1103
|
effect: io.Style,
|
|
1104
1104
|
handler: (n, o, r) => {
|
|
1105
|
-
var c, a,
|
|
1106
|
-
const s = (f = (
|
|
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
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,22 +1114,22 @@ let Bt = class extends so {
|
|
|
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 =
|
|
1121
|
+
function mi() {
|
|
1122
|
+
const e = y(ms), t = y(pe), n = _e(e.progress$), o = $t(() => {
|
|
1123
1123
|
t.executeCommand(Vo.id);
|
|
1124
1124
|
}, [t]), r = $t(() => {
|
|
1125
1125
|
e.clearProgress();
|
|
1126
1126
|
}, [e]);
|
|
1127
|
-
return /* @__PURE__ */
|
|
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
1135
|
function kr(e) {
|
|
@@ -1150,7 +1150,7 @@ function Ar(e) {
|
|
|
1150
1150
|
"("
|
|
1151
1151
|
] }),
|
|
1152
1152
|
n && n.map((o, r) => /* @__PURE__ */ B("span", { children: [
|
|
1153
|
-
/* @__PURE__ */
|
|
1153
|
+
/* @__PURE__ */ x("span", { children: kr(o) }),
|
|
1154
1154
|
r === n.length - 1 ? "" : ","
|
|
1155
1155
|
] }, r)),
|
|
1156
1156
|
")"
|
|
@@ -1159,14 +1159,14 @@ function Ar(e) {
|
|
|
1159
1159
|
function Ct(e) {
|
|
1160
1160
|
const { className: t, value: n, title: o } = e;
|
|
1161
1161
|
return /* @__PURE__ */ B("div", { className: "univer-mb-2 univer-text-xs", children: [
|
|
1162
|
-
/* @__PURE__ */
|
|
1162
|
+
/* @__PURE__ */ x(
|
|
1163
1163
|
"div",
|
|
1164
1164
|
{
|
|
1165
1165
|
className: se("univer-mb-2 univer-font-medium univer-text-gray-500 dark:!univer-text-gray-300", t),
|
|
1166
1166
|
children: o
|
|
1167
1167
|
}
|
|
1168
1168
|
),
|
|
1169
|
-
/* @__PURE__ */
|
|
1169
|
+
/* @__PURE__ */ x(
|
|
1170
1170
|
"div",
|
|
1171
1171
|
{
|
|
1172
1172
|
className: "univer-break-all univer-text-gray-900 dark:!univer-text-white",
|
|
@@ -1175,26 +1175,26 @@ 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__ */
|
|
1184
|
-
/* @__PURE__ */
|
|
1185
|
-
/* @__PURE__ */
|
|
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
|
+
/* @__PURE__ */ x("div", { className: "univer-mb-2 univer-mt-1" })
|
|
1186
1186
|
] }, f)) }),
|
|
1187
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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 =
|
|
1197
|
+
const { icon: n, id: o, className: r, extend: s, ...i } = t, c = `univerjs-icon univerjs-icon-${o} ${r || ""}`.trim(), a = X(`_${_i()}`);
|
|
1198
1198
|
return Fr(n, `${o}`, {
|
|
1199
1199
|
defIds: n.defIds,
|
|
1200
1200
|
idSuffix: a.current
|
|
@@ -1207,11 +1207,11 @@ function nt({ ref: e, ...t }) {
|
|
|
1207
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 Si(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 vi(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",
|
|
@@ -1261,11 +1261,11 @@ const _i = {
|
|
|
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
1267
|
Dr.displayName = "CheckMarkIcon";
|
|
1268
|
-
const
|
|
1268
|
+
const Ii = {
|
|
1269
1269
|
tag: "svg",
|
|
1270
1270
|
attrs: {
|
|
1271
1271
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1285,11 +1285,11 @@ const Ri = {
|
|
|
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
1291
|
Lr.displayName = "CloseIcon";
|
|
1292
|
-
const
|
|
1292
|
+
const Ei = {
|
|
1293
1293
|
tag: "svg",
|
|
1294
1294
|
attrs: {
|
|
1295
1295
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1334,11 +1334,11 @@ const Ii = {
|
|
|
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
1340
|
$r.displayName = "DeleteIcon";
|
|
1341
|
-
const
|
|
1341
|
+
const bi = {
|
|
1342
1342
|
tag: "svg",
|
|
1343
1343
|
attrs: {
|
|
1344
1344
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1358,11 +1358,11 @@ const Ei = {
|
|
|
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
1364
|
Pr.displayName = "IncreaseIcon";
|
|
1365
|
-
const
|
|
1365
|
+
const yi = {
|
|
1366
1366
|
tag: "svg",
|
|
1367
1367
|
attrs: {
|
|
1368
1368
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1384,11 +1384,11 @@ const bi = {
|
|
|
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
1390
|
Ur.displayName = "MoreIcon";
|
|
1391
|
-
const
|
|
1391
|
+
const Ti = {
|
|
1392
1392
|
tag: "svg",
|
|
1393
1393
|
attrs: {
|
|
1394
1394
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1416,153 +1416,154 @@ const yi = {
|
|
|
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
1422
|
Vr.displayName = "SelectRangeIcon";
|
|
1423
|
-
function
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
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__ */
|
|
1481
|
-
/* @__PURE__ */
|
|
1481
|
+
/* @__PURE__ */ x(Ms, { value: m, options: p, onChange: N }),
|
|
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
|
+
h === O && /* @__PURE__ */ x(
|
|
1510
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__ */
|
|
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__ */
|
|
1524
|
-
/* @__PURE__ */
|
|
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 }),
|
|
1525
|
+
/* @__PURE__ */ x(
|
|
1525
1526
|
Ct,
|
|
1526
1527
|
{
|
|
1527
|
-
title:
|
|
1528
|
-
value: /* @__PURE__ */
|
|
1528
|
+
title: C.t("formula.moreFunctions.syntax"),
|
|
1529
|
+
value: /* @__PURE__ */ x(Ar, { prefix: S.functionName, value: S.functionParameter })
|
|
1529
1530
|
}
|
|
1530
1531
|
),
|
|
1531
|
-
/* @__PURE__ */
|
|
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
|
+
function Ni() {
|
|
1550
1551
|
const e = yo(), [t, n] = H(!0), [o, r] = H(!1), [s, i] = H(null);
|
|
1551
|
-
|
|
1552
|
-
const c =
|
|
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 (!
|
|
1557
|
+
function u() {
|
|
1558
|
+
const h = Rr(d);
|
|
1559
|
+
if (!h) return;
|
|
1559
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,11 +1571,11 @@ function Oi() {
|
|
|
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__ */
|
|
1574
|
-
o && /* @__PURE__ */
|
|
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
|
-
o && /* @__PURE__ */
|
|
1578
|
+
o && /* @__PURE__ */ x(
|
|
1578
1579
|
at,
|
|
1579
1580
|
{
|
|
1580
1581
|
variant: "primary",
|
|
@@ -1583,12 +1584,13 @@ function Oi() {
|
|
|
1583
1584
|
children: c.t("formula.moreFunctions.next")
|
|
1584
1585
|
}
|
|
1585
1586
|
),
|
|
1586
|
-
o && /* @__PURE__ */
|
|
1587
|
-
t && !!e && /* @__PURE__ */
|
|
1587
|
+
o && /* @__PURE__ */ x(at, { onClick: m, className: "univer-mb-5 univer-ml-4 univer-mr-0 univer-mt-0", children: c.t("formula.moreFunctions.prev") }),
|
|
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 Oi() {
|
|
|
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 Ni(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 Ni(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 Mi(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 Mi(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 xi(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 xi(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 wi(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 wi(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 ki(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 ki(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,9 +1699,9 @@ function Ai(e) {
|
|
|
1697
1699
|
})
|
|
1698
1700
|
};
|
|
1699
1701
|
}
|
|
1700
|
-
function
|
|
1702
|
+
function Di(e) {
|
|
1701
1703
|
return {
|
|
1702
|
-
id:
|
|
1704
|
+
id: bn.id,
|
|
1703
1705
|
type: Ue.BUTTON,
|
|
1704
1706
|
title: "formula.operation.copyFormulaOnly",
|
|
1705
1707
|
disabled$: $e(e, {
|
|
@@ -1707,12 +1709,12 @@ function Fi(e) {
|
|
|
1707
1709
|
worksheetTypes: [us],
|
|
1708
1710
|
rangeTypes: [as]
|
|
1709
1711
|
}),
|
|
1710
|
-
hidden$: Pe(e,
|
|
1712
|
+
hidden$: Pe(e, W.UNIVER_SHEET)
|
|
1711
1713
|
};
|
|
1712
1714
|
}
|
|
1713
|
-
function
|
|
1715
|
+
function Li(e) {
|
|
1714
1716
|
return {
|
|
1715
|
-
id:
|
|
1717
|
+
id: yn.id,
|
|
1716
1718
|
type: Ue.BUTTON,
|
|
1717
1719
|
title: "formula.operation.pasteFormula",
|
|
1718
1720
|
disabled$: To(e).pipe(
|
|
@@ -1723,63 +1725,63 @@ function Di(e) {
|
|
|
1723
1725
|
})),
|
|
1724
1726
|
Sr(([t, n]) => t || n)
|
|
1725
1727
|
),
|
|
1726
|
-
hidden$: Pe(e,
|
|
1728
|
+
hidden$: Pe(e, W.UNIVER_SHEET)
|
|
1727
1729
|
};
|
|
1728
1730
|
}
|
|
1729
|
-
const
|
|
1730
|
-
[
|
|
1731
|
+
const $i = {
|
|
1732
|
+
[zn.BASIC]: {
|
|
1731
1733
|
[`${ve.id}.sum`]: {
|
|
1732
1734
|
order: 0,
|
|
1733
|
-
menuItemFactory:
|
|
1735
|
+
menuItemFactory: Mi
|
|
1734
1736
|
},
|
|
1735
1737
|
[`${ve.id}.count`]: {
|
|
1736
1738
|
order: 1,
|
|
1737
|
-
menuItemFactory:
|
|
1739
|
+
menuItemFactory: xi
|
|
1738
1740
|
},
|
|
1739
1741
|
[`${ve.id}.average`]: {
|
|
1740
1742
|
order: 2,
|
|
1741
|
-
menuItemFactory:
|
|
1743
|
+
menuItemFactory: wi
|
|
1742
1744
|
},
|
|
1743
1745
|
[`${ve.id}.max`]: {
|
|
1744
1746
|
order: 3,
|
|
1745
|
-
menuItemFactory:
|
|
1747
|
+
menuItemFactory: ki
|
|
1746
1748
|
},
|
|
1747
1749
|
[`${ve.id}.min`]: {
|
|
1748
1750
|
order: 4,
|
|
1749
|
-
menuItemFactory:
|
|
1751
|
+
menuItemFactory: Ai
|
|
1750
1752
|
}
|
|
1751
1753
|
},
|
|
1752
|
-
[
|
|
1753
|
-
[
|
|
1754
|
+
[zn.OTHERS]: {
|
|
1755
|
+
[Tn.id]: {
|
|
1754
1756
|
order: 0,
|
|
1755
|
-
menuItemFactory:
|
|
1757
|
+
menuItemFactory: Fi
|
|
1756
1758
|
}
|
|
1757
1759
|
},
|
|
1758
1760
|
[No]: {
|
|
1759
|
-
[
|
|
1761
|
+
[bn.id]: {
|
|
1760
1762
|
order: 0,
|
|
1761
|
-
menuItemFactory:
|
|
1763
|
+
menuItemFactory: Di
|
|
1762
1764
|
}
|
|
1763
1765
|
},
|
|
1764
1766
|
[Oo]: {
|
|
1765
|
-
[
|
|
1767
|
+
[yn.id]: {
|
|
1766
1768
|
order: 4,
|
|
1767
|
-
menuItemFactory:
|
|
1769
|
+
menuItemFactory: Li
|
|
1768
1770
|
}
|
|
1769
1771
|
}
|
|
1770
|
-
},
|
|
1771
|
-
function
|
|
1772
|
+
}, Pi = "meta_key_ctrl_And_Shift";
|
|
1773
|
+
function Ui(e) {
|
|
1772
1774
|
return e.getContextValue(co) && e.getContextValue(lo);
|
|
1773
1775
|
}
|
|
1774
1776
|
const Qt = [
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
],
|
|
1780
|
-
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() {
|
|
1781
1783
|
const e = [];
|
|
1782
|
-
for (const t of
|
|
1784
|
+
for (const t of Vi)
|
|
1783
1785
|
e.push({
|
|
1784
1786
|
id: ft.id,
|
|
1785
1787
|
binding: t,
|
|
@@ -1791,63 +1793,63 @@ function Vi() {
|
|
|
1791
1793
|
});
|
|
1792
1794
|
return e;
|
|
1793
1795
|
}
|
|
1794
|
-
function
|
|
1796
|
+
function Hi() {
|
|
1795
1797
|
const e = [];
|
|
1796
1798
|
for (const t of Qt)
|
|
1797
1799
|
e.push({
|
|
1798
1800
|
id: ft.id,
|
|
1799
|
-
binding: t |
|
|
1801
|
+
binding: t | V.SHIFT,
|
|
1800
1802
|
preconditions: (n) => yt(n),
|
|
1801
1803
|
staticParameters: {
|
|
1802
1804
|
eventType: xe.Keyboard,
|
|
1803
1805
|
keycode: t,
|
|
1804
|
-
metaKey:
|
|
1806
|
+
metaKey: V.SHIFT
|
|
1805
1807
|
}
|
|
1806
1808
|
});
|
|
1807
1809
|
return e;
|
|
1808
1810
|
}
|
|
1809
|
-
function
|
|
1811
|
+
function Bi() {
|
|
1810
1812
|
const e = [];
|
|
1811
1813
|
for (const t of Qt)
|
|
1812
1814
|
e.push({
|
|
1813
1815
|
id: ft.id,
|
|
1814
|
-
binding: t |
|
|
1816
|
+
binding: t | V.CTRL_COMMAND,
|
|
1815
1817
|
preconditions: (n) => yt(n),
|
|
1816
1818
|
staticParameters: {
|
|
1817
1819
|
eventType: xe.Keyboard,
|
|
1818
1820
|
keycode: t,
|
|
1819
|
-
metaKey:
|
|
1821
|
+
metaKey: V.CTRL_COMMAND
|
|
1820
1822
|
}
|
|
1821
1823
|
});
|
|
1822
1824
|
return e;
|
|
1823
1825
|
}
|
|
1824
|
-
function
|
|
1826
|
+
function qi() {
|
|
1825
1827
|
const e = [];
|
|
1826
1828
|
for (const t of Qt)
|
|
1827
1829
|
e.push({
|
|
1828
1830
|
id: ft.id,
|
|
1829
|
-
binding: t |
|
|
1831
|
+
binding: t | V.SHIFT | V.CTRL_COMMAND,
|
|
1830
1832
|
preconditions: (n) => yt(n),
|
|
1831
1833
|
staticParameters: {
|
|
1832
1834
|
eventType: xe.Keyboard,
|
|
1833
1835
|
keycode: t,
|
|
1834
|
-
metaKey:
|
|
1836
|
+
metaKey: Pi
|
|
1835
1837
|
}
|
|
1836
1838
|
});
|
|
1837
1839
|
return e;
|
|
1838
1840
|
}
|
|
1839
|
-
const
|
|
1841
|
+
const ji = {
|
|
1840
1842
|
id: Mr.id,
|
|
1841
|
-
binding:
|
|
1843
|
+
binding: L.F4,
|
|
1842
1844
|
preconditions: (e) => yt(e)
|
|
1843
1845
|
};
|
|
1844
|
-
function
|
|
1846
|
+
function Ki() {
|
|
1845
1847
|
const e = [];
|
|
1846
|
-
for (const t of [
|
|
1848
|
+
for (const t of [L.ENTER, L.TAB, L.ARROW_DOWN, L.ARROW_UP])
|
|
1847
1849
|
e.push({
|
|
1848
1850
|
id: ft.id,
|
|
1849
1851
|
binding: t,
|
|
1850
|
-
preconditions: (n) =>
|
|
1852
|
+
preconditions: (n) => Ui(n),
|
|
1851
1853
|
staticParameters: {
|
|
1852
1854
|
eventType: xe.Keyboard,
|
|
1853
1855
|
keycode: t,
|
|
@@ -1856,16 +1858,16 @@ function ji() {
|
|
|
1856
1858
|
});
|
|
1857
1859
|
return e;
|
|
1858
1860
|
}
|
|
1859
|
-
const
|
|
1860
|
-
id:
|
|
1861
|
-
binding:
|
|
1861
|
+
const Yi = {
|
|
1862
|
+
id: Ss.id,
|
|
1863
|
+
binding: V.ALT | L.EQUAL,
|
|
1862
1864
|
preconditions: Mo,
|
|
1863
|
-
mac:
|
|
1865
|
+
mac: V.CTRL_COMMAND | V.ALT | L.EQUAL,
|
|
1864
1866
|
description: "shortcut.sheets-formula-ui.quick-sum",
|
|
1865
1867
|
group: "4_sheet-edit"
|
|
1866
1868
|
};
|
|
1867
|
-
var
|
|
1868
|
-
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--)
|
|
1869
1871
|
(i = e[s]) && (r = i(r) || r);
|
|
1870
1872
|
return r;
|
|
1871
1873
|
}, Ke = (e, t) => (n, o) => t(n, o, e);
|
|
@@ -1877,58 +1879,58 @@ let qt = class extends Ze {
|
|
|
1877
1879
|
this._registerCommands(), this._registerMenus(), this._registerShortcuts(), this._registerComponents(), this._registerRenderModules();
|
|
1878
1880
|
}
|
|
1879
1881
|
_registerMenus() {
|
|
1880
|
-
this._menuManagerService.mergeMenu(
|
|
1882
|
+
this._menuManagerService.mergeMenu($i);
|
|
1881
1883
|
}
|
|
1882
1884
|
_registerCommands() {
|
|
1883
1885
|
[
|
|
1884
|
-
En,
|
|
1885
1886
|
bn,
|
|
1886
|
-
ve,
|
|
1887
1887
|
yn,
|
|
1888
|
-
|
|
1889
|
-
|
|
1888
|
+
ve,
|
|
1889
|
+
Tn,
|
|
1890
|
+
js,
|
|
1891
|
+
Ps,
|
|
1890
1892
|
ft,
|
|
1891
1893
|
Mr
|
|
1892
1894
|
].forEach((e) => this.disposeWithMe(this._commandService.registerCommand(e)));
|
|
1893
1895
|
}
|
|
1894
1896
|
_registerShortcuts() {
|
|
1895
1897
|
[
|
|
1896
|
-
...Vi(),
|
|
1897
1898
|
...Wi(),
|
|
1898
1899
|
...Hi(),
|
|
1899
1900
|
...Bi(),
|
|
1900
|
-
...
|
|
1901
|
-
Ki,
|
|
1902
|
-
|
|
1901
|
+
...qi(),
|
|
1902
|
+
...Ki(),
|
|
1903
|
+
Yi,
|
|
1904
|
+
ji
|
|
1903
1905
|
].forEach((e) => {
|
|
1904
1906
|
this.disposeWithMe(this._shortcutService.registerShortcut(e));
|
|
1905
1907
|
});
|
|
1906
1908
|
}
|
|
1907
1909
|
_registerComponents() {
|
|
1908
|
-
this.disposeWithMe(this._uiPartsService.registerComponent(xo.FORMULA_AUX, () => br(
|
|
1910
|
+
this.disposeWithMe(this._uiPartsService.registerComponent(xo.FORMULA_AUX, () => br(mi, this._injector))), this._componentManager.register(Nr, Ni);
|
|
1909
1911
|
}
|
|
1910
1912
|
_registerRenderModules() {
|
|
1911
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
1913
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(W.UNIVER_SHEET, [Ht]));
|
|
1912
1914
|
}
|
|
1913
1915
|
};
|
|
1914
|
-
qt =
|
|
1916
|
+
qt = Zi([
|
|
1915
1917
|
Ke(0, q(It)),
|
|
1916
|
-
Ke(1,
|
|
1918
|
+
Ke(1, Is),
|
|
1917
1919
|
Ke(2, pe),
|
|
1918
1920
|
Ke(3, zt),
|
|
1919
1921
|
Ke(4, Ir),
|
|
1920
1922
|
Ke(5, Te),
|
|
1921
1923
|
Ke(6, q(Er))
|
|
1922
1924
|
], qt);
|
|
1923
|
-
var
|
|
1924
|
-
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--)
|
|
1925
1927
|
(i = e[s]) && (r = i(r) || r);
|
|
1926
1928
|
return r;
|
|
1927
1929
|
}, rn = (e, t) => (n, o) => t(n, o, e);
|
|
1928
1930
|
let jt = class extends Ze {
|
|
1929
1931
|
constructor(e, t, n) {
|
|
1930
1932
|
super(), this._imageFormulaCellInterceptorController = e, this._renderManagerService = t, this._univerInstanceService = n, this._imageFormulaCellInterceptorController.registerRefreshRenderFunction(() => {
|
|
1931
|
-
const o = this._univerInstanceService.getCurrentUnitOfType(
|
|
1933
|
+
const o = this._univerInstanceService.getCurrentUnitOfType(W.UNIVER_SHEET);
|
|
1932
1934
|
if (!o) return;
|
|
1933
1935
|
const r = this._renderManagerService.getRenderById(o.getUnitId());
|
|
1934
1936
|
if (!r) return;
|
|
@@ -1938,8 +1940,8 @@ let jt = class extends Ze {
|
|
|
1938
1940
|
});
|
|
1939
1941
|
}
|
|
1940
1942
|
};
|
|
1941
|
-
jt =
|
|
1942
|
-
rn(0, q(
|
|
1943
|
+
jt = Xi([
|
|
1944
|
+
rn(0, q(vs)),
|
|
1943
1945
|
rn(1, Te),
|
|
1944
1946
|
rn(2, ne)
|
|
1945
1947
|
], jt);
|
|
@@ -1957,8 +1959,8 @@ class Wr {
|
|
|
1957
1959
|
return this._currentSelector$.next(t), o;
|
|
1958
1960
|
}
|
|
1959
1961
|
}
|
|
1960
|
-
var
|
|
1961
|
-
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--)
|
|
1962
1964
|
(i = e[s]) && (r = i(r) || r);
|
|
1963
1965
|
return r;
|
|
1964
1966
|
}, ct = (e, t) => (n, o) => t(n, o, e);
|
|
@@ -1973,7 +1975,7 @@ let Le = class extends wo {
|
|
|
1973
1975
|
);
|
|
1974
1976
|
j(this, "_workbookSelections");
|
|
1975
1977
|
j(this, "_eventDisposables");
|
|
1976
|
-
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;
|
|
1977
1979
|
}
|
|
1978
1980
|
getLocation() {
|
|
1979
1981
|
return this._skeleton.getLocation();
|
|
@@ -1997,7 +1999,7 @@ let Le = class extends wo {
|
|
|
1997
1999
|
* Call this method and user will be able to select on the canvas to update selections.
|
|
1998
2000
|
*/
|
|
1999
2001
|
enableSelectionChanging() {
|
|
2000
|
-
return this._disableSelectionChanging(), this._eventDisposables = this._initCanvasEventListeners(),
|
|
2002
|
+
return this._disableSelectionChanging(), this._eventDisposables = this._initCanvasEventListeners(), cr(() => this._disableSelectionChanging());
|
|
2001
2003
|
}
|
|
2002
2004
|
_disableSelectionChanging() {
|
|
2003
2005
|
var t;
|
|
@@ -2008,26 +2010,26 @@ let Le = class extends wo {
|
|
|
2008
2010
|
}
|
|
2009
2011
|
_initCanvasEventListeners() {
|
|
2010
2012
|
const t = this._getSheetObject(), { spreadsheetRowHeader: n, spreadsheetColumnHeader: o, spreadsheet: r, spreadsheetLeftTopPlaceholder: s } = t, { scene: i } = this._context, c = new Ye();
|
|
2011
|
-
return c.add(r == null ? void 0 : r.onPointerDown$.subscribeEvent((a,
|
|
2012
|
-
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());
|
|
2013
2015
|
})), c.add(
|
|
2014
|
-
n == null ? void 0 : n.onPointerDown$.subscribeEvent((a,
|
|
2016
|
+
n == null ? void 0 : n.onPointerDown$.subscribeEvent((a, d) => {
|
|
2015
2017
|
if (!this.inRefSelectionMode()) return;
|
|
2016
|
-
const f = this._sheetSkeletonManagerService.getCurrent().skeleton, { row: m } =
|
|
2017
|
-
|
|
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());
|
|
2018
2020
|
})
|
|
2019
|
-
), c.add(o == null ? void 0 : o.onPointerDown$.subscribeEvent((a,
|
|
2021
|
+
), c.add(o == null ? void 0 : o.onPointerDown$.subscribeEvent((a, d) => {
|
|
2020
2022
|
if (!this.inRefSelectionMode()) return;
|
|
2021
|
-
const f = this._sheetSkeletonManagerService.getCurrent().skeleton, { column: m } =
|
|
2022
|
-
|
|
2023
|
-
})), 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) => {
|
|
2024
2026
|
if (this._reset(), !this.inRefSelectionMode()) return;
|
|
2025
2027
|
const f = this._sheetSkeletonManagerService.getCurrent().skeleton, m = ko(f);
|
|
2026
2028
|
this._addSelectionControlByModelData(m), this._selectionMoveStart$.next(this.getSelectionDataWithStyle());
|
|
2027
|
-
const
|
|
2028
|
-
|
|
2029
|
+
const u = i.onPointerUp$.subscribeEvent(() => {
|
|
2030
|
+
u.unsubscribe(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle());
|
|
2029
2031
|
});
|
|
2030
|
-
a.button !== 2 &&
|
|
2032
|
+
a.button !== 2 && d.stopPropagation();
|
|
2031
2033
|
})), c;
|
|
2032
2034
|
}
|
|
2033
2035
|
/**
|
|
@@ -2070,7 +2072,7 @@ let Le = class extends wo {
|
|
|
2070
2072
|
var i;
|
|
2071
2073
|
if (!t)
|
|
2072
2074
|
return;
|
|
2073
|
-
const { skeleton: n } = t, { scene: o } = this._context, r = o.getViewport(
|
|
2075
|
+
const { skeleton: n } = t, { scene: o } = this._context, r = o.getViewport(Kn.VIEW_MAIN);
|
|
2074
2076
|
this._skeleton && ((i = this._skeleton.worksheet) == null ? void 0 : i.getSheetId()) !== n.worksheet.getSheetId() && this._reset(), this._changeRuntime(n, o, r);
|
|
2075
2077
|
const s = this._workbookSelections.getCurrentSelections();
|
|
2076
2078
|
this.resetSelectionsByModelData(s);
|
|
@@ -2078,7 +2080,7 @@ let Le = class extends wo {
|
|
|
2078
2080
|
}
|
|
2079
2081
|
_getActiveViewport(t) {
|
|
2080
2082
|
const n = this._getSheetObject();
|
|
2081
|
-
return n == null ? void 0 : n.scene.getActiveViewportByCoord(
|
|
2083
|
+
return n == null ? void 0 : n.scene.getActiveViewportByCoord(Yn.FromArray([t.offsetX, t.offsetY]));
|
|
2082
2084
|
}
|
|
2083
2085
|
_getSheetObject() {
|
|
2084
2086
|
return Ao(this._context.unit, this._context);
|
|
@@ -2101,11 +2103,11 @@ let Le = class extends wo {
|
|
|
2101
2103
|
if (!c || !i)
|
|
2102
2104
|
return;
|
|
2103
2105
|
r && (this._activeViewport = r);
|
|
2104
|
-
const { offsetX: a, offsetY:
|
|
2106
|
+
const { offsetX: a, offsetY: d } = t, f = c.getViewport(Kn.VIEW_MAIN);
|
|
2105
2107
|
if (!f) return;
|
|
2106
|
-
const m = c.getCoordRelativeToViewport(
|
|
2107
|
-
this._startViewportPosX =
|
|
2108
|
-
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);
|
|
2109
2111
|
if (!g) return;
|
|
2110
2112
|
switch (o) {
|
|
2111
2113
|
case Ie.NORMAL:
|
|
@@ -2139,9 +2141,9 @@ let Le = class extends wo {
|
|
|
2139
2141
|
},
|
|
2140
2142
|
style: null
|
|
2141
2143
|
}), C.range.rangeType = o;
|
|
2142
|
-
const
|
|
2143
|
-
this._startRangeWhenPointerDown = { ...
|
|
2144
|
-
const E = { ...
|
|
2144
|
+
const R = sn(C, this._skeleton);
|
|
2145
|
+
this._startRangeWhenPointerDown = { ...R.rangeWithCoord };
|
|
2146
|
+
const E = { ...R.rangeWithCoord, rangeType: o };
|
|
2145
2147
|
let p = this.getActiveSelectionControl();
|
|
2146
2148
|
const b = this.getSelectionControls();
|
|
2147
2149
|
for (const M of b) {
|
|
@@ -2155,18 +2157,18 @@ let Le = class extends wo {
|
|
|
2155
2157
|
}
|
|
2156
2158
|
}
|
|
2157
2159
|
this._checkClearPreviousControls(t);
|
|
2158
|
-
const
|
|
2159
|
-
|
|
2160
|
-
|
|
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,
|
|
2161
2163
|
E,
|
|
2162
2164
|
i,
|
|
2163
2165
|
o,
|
|
2164
2166
|
p
|
|
2165
2167
|
// Get updated in this method
|
|
2166
|
-
) :
|
|
2168
|
+
) : A && p ? p.updateRangeBySelectionWithCoord(R) : p = this.newSelectionControl(c, i, C);
|
|
2167
2169
|
for (let M = 0; M < this.getSelectionControls().length - 1; M++)
|
|
2168
2170
|
this.getSelectionControls()[M].clearHighlight();
|
|
2169
|
-
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(() => {
|
|
2170
2172
|
var M;
|
|
2171
2173
|
this._clearUpdatingListeners(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle()), (M = this._escapeShortcutDisposable) == null || M.dispose(), this._escapeShortcutDisposable = null;
|
|
2172
2174
|
});
|
|
@@ -2198,7 +2200,7 @@ let Le = class extends wo {
|
|
|
2198
2200
|
}), c;
|
|
2199
2201
|
}
|
|
2200
2202
|
};
|
|
2201
|
-
Le =
|
|
2203
|
+
Le = Ji([
|
|
2202
2204
|
ct(1, q(It)),
|
|
2203
2205
|
ct(2, q(Et)),
|
|
2204
2206
|
ct(3, zt),
|
|
@@ -2206,11 +2208,11 @@ Le = Qi([
|
|
|
2206
2208
|
ct(5, dn),
|
|
2207
2209
|
ct(6, Gt)
|
|
2208
2210
|
], Le);
|
|
2209
|
-
function
|
|
2211
|
+
function ec(e) {
|
|
2210
2212
|
const t = fr(e);
|
|
2211
2213
|
return t.widgets = { tl: !0, tc: !0, tr: !0, ml: !0, mr: !0, bl: !0, bc: !0, br: !0 }, t;
|
|
2212
2214
|
}
|
|
2213
|
-
const
|
|
2215
|
+
const On = (e, t, n = !0) => {
|
|
2214
2216
|
let o = -1;
|
|
2215
2217
|
return e.reduce((r, s, i) => {
|
|
2216
2218
|
if (r.isFinish)
|
|
@@ -2233,7 +2235,7 @@ const Tn = (e, t, n = !0) => {
|
|
|
2233
2235
|
typeof s != "string" && s.nodeType === Q.REFERENCE && o++;
|
|
2234
2236
|
}
|
|
2235
2237
|
return o;
|
|
2236
|
-
},
|
|
2238
|
+
}, tc = (e, t = 100) => {
|
|
2237
2239
|
P(() => {
|
|
2238
2240
|
let n = null;
|
|
2239
2241
|
const o = () => {
|
|
@@ -2247,23 +2249,23 @@ const Tn = (e, t, n = !0) => {
|
|
|
2247
2249
|
}, [e, t]);
|
|
2248
2250
|
};
|
|
2249
2251
|
function Br(e, t, n) {
|
|
2250
|
-
const o =
|
|
2251
|
-
var
|
|
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;
|
|
2252
2254
|
const a = o.getEditor(e);
|
|
2253
2255
|
if (!a)
|
|
2254
2256
|
return;
|
|
2255
|
-
const
|
|
2256
|
-
if (!
|
|
2257
|
-
const
|
|
2258
|
-
let { left: l, top:
|
|
2259
|
-
|
|
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;
|
|
2260
2262
|
const C = r.getValue();
|
|
2261
|
-
if (!(C.left === l && C.top ===
|
|
2262
|
-
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;
|
|
2263
2265
|
});
|
|
2264
2266
|
return P(() => {
|
|
2265
2267
|
t && c();
|
|
2266
|
-
}, [e, o, i.unitAdded$, c, t, ...n != null ? n : []]),
|
|
2268
|
+
}, [e, o, i.unitAdded$, c, t, ...n != null ? n : []]), tc(c), P(() => {
|
|
2267
2269
|
const a = s.scrollEvent$.pipe(Go(100)).subscribe(c);
|
|
2268
2270
|
return () => {
|
|
2269
2271
|
a.unsubscribe();
|
|
@@ -2271,41 +2273,41 @@ function Br(e, t, n) {
|
|
|
2271
2273
|
}, []), [r, c];
|
|
2272
2274
|
}
|
|
2273
2275
|
const rt = (e) => {
|
|
2274
|
-
const t =
|
|
2276
|
+
const t = X(e);
|
|
2275
2277
|
return t.current = e, t;
|
|
2276
|
-
},
|
|
2277
|
-
const o =
|
|
2278
|
-
|
|
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;
|
|
2279
2281
|
const l = () => {
|
|
2280
|
-
c(void 0),
|
|
2282
|
+
c(void 0), d(-1), m(!1);
|
|
2281
2283
|
};
|
|
2282
2284
|
return P(() => {
|
|
2283
|
-
const
|
|
2284
|
-
o.setSequenceNodes(
|
|
2285
|
+
const S = s.sequenceNodesBuilder(t.slice(1));
|
|
2286
|
+
o.setSequenceNodes(S != null ? S : []);
|
|
2285
2287
|
}, [t]), P(() => {
|
|
2286
2288
|
if (n && e) {
|
|
2287
|
-
const
|
|
2289
|
+
const S = n.selectionChange$.pipe(vn(50)).subscribe((g) => {
|
|
2288
2290
|
if (g.textRanges.length === 1) {
|
|
2289
2291
|
const [C] = g.textRanges;
|
|
2290
|
-
if (C.collapsed &&
|
|
2291
|
-
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);
|
|
2292
2294
|
if (p)
|
|
2293
2295
|
if (typeof p != "string" && p.nodeType === 3 && !r.hasDefinedNameDescription(p.token.trim()) && b === Ge.OPEN_BRACKET) {
|
|
2294
|
-
const
|
|
2295
|
-
c(
|
|
2296
|
+
const T = r.getFunctionInfo(p.token);
|
|
2297
|
+
c(T), d(-1);
|
|
2296
2298
|
return;
|
|
2297
2299
|
} else {
|
|
2298
|
-
const
|
|
2299
|
-
if (
|
|
2300
|
-
const { functionName:
|
|
2301
|
-
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);
|
|
2302
2304
|
return;
|
|
2303
2305
|
}
|
|
2304
2306
|
}
|
|
2305
2307
|
}
|
|
2306
2308
|
}
|
|
2307
|
-
c(void 0),
|
|
2308
|
-
}),
|
|
2309
|
+
c(void 0), d(-1);
|
|
2310
|
+
}), v = n.selectionChange$.pipe(
|
|
2309
2311
|
Cr((g) => g.textRanges.length === 1),
|
|
2310
2312
|
Sr((g) => g.textRanges[0].startOffset),
|
|
2311
2313
|
Zo()
|
|
@@ -2313,7 +2315,7 @@ const rt = (e) => {
|
|
|
2313
2315
|
m(!0);
|
|
2314
2316
|
});
|
|
2315
2317
|
return () => {
|
|
2316
|
-
|
|
2318
|
+
S.unsubscribe(), v.unsubscribe();
|
|
2317
2319
|
};
|
|
2318
2320
|
}
|
|
2319
2321
|
}, [n, e]), P(() => {
|
|
@@ -2323,7 +2325,7 @@ const rt = (e) => {
|
|
|
2323
2325
|
paramIndex: a,
|
|
2324
2326
|
reset: l
|
|
2325
2327
|
};
|
|
2326
|
-
},
|
|
2328
|
+
}, rc = ({ onClick: e }) => /* @__PURE__ */ x(
|
|
2327
2329
|
"div",
|
|
2328
2330
|
{
|
|
2329
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",
|
|
@@ -2331,21 +2333,21 @@ const rt = (e) => {
|
|
|
2331
2333
|
children: "?"
|
|
2332
2334
|
}
|
|
2333
2335
|
), on = ({ className: e, title: t, value: n }) => /* @__PURE__ */ B("div", { className: "univer-my-2", children: [
|
|
2334
|
-
/* @__PURE__ */
|
|
2336
|
+
/* @__PURE__ */ x(
|
|
2335
2337
|
"div",
|
|
2336
2338
|
{
|
|
2337
2339
|
className: se("univer-mb-2 univer-text-sm univer-font-medium univer-text-gray-900 dark:!univer-text-white", e),
|
|
2338
2340
|
children: t
|
|
2339
2341
|
}
|
|
2340
2342
|
),
|
|
2341
|
-
/* @__PURE__ */
|
|
2343
|
+
/* @__PURE__ */ x(
|
|
2342
2344
|
"div",
|
|
2343
2345
|
{
|
|
2344
2346
|
className: "univer-whitespace-pre-wrap univer-break-words univer-text-xs univer-text-gray-500",
|
|
2345
2347
|
children: n
|
|
2346
2348
|
}
|
|
2347
2349
|
)
|
|
2348
|
-
] }),
|
|
2350
|
+
] }), oc = (e) => {
|
|
2349
2351
|
const { prefix: t, value: n, active: o, onClick: r } = e;
|
|
2350
2352
|
return /* @__PURE__ */ B("div", { children: [
|
|
2351
2353
|
/* @__PURE__ */ B("span", { children: [
|
|
@@ -2353,7 +2355,7 @@ const rt = (e) => {
|
|
|
2353
2355
|
"("
|
|
2354
2356
|
] }),
|
|
2355
2357
|
n && n.map((s, i) => /* @__PURE__ */ B("span", { children: [
|
|
2356
|
-
/* @__PURE__ */
|
|
2358
|
+
/* @__PURE__ */ x(
|
|
2357
2359
|
"span",
|
|
2358
2360
|
{
|
|
2359
2361
|
className: o === i ? "univer-text-primary-500" : "",
|
|
@@ -2365,30 +2367,30 @@ const rt = (e) => {
|
|
|
2365
2367
|
] }, s.name)),
|
|
2366
2368
|
")"
|
|
2367
2369
|
] });
|
|
2368
|
-
},
|
|
2370
|
+
}, nr = () => {
|
|
2369
2371
|
};
|
|
2370
|
-
function
|
|
2371
|
-
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]);
|
|
2372
2374
|
function C(p) {
|
|
2373
2375
|
t && t(p);
|
|
2374
2376
|
}
|
|
2375
|
-
const
|
|
2376
|
-
|
|
2377
|
+
const R = ee((p) => {
|
|
2378
|
+
d.helpFunctionVisible$.next(!p);
|
|
2377
2379
|
}), E = () => {
|
|
2378
|
-
|
|
2380
|
+
R(!0), n();
|
|
2379
2381
|
};
|
|
2380
|
-
return i ? f ? /* @__PURE__ */
|
|
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(
|
|
2381
2383
|
"div",
|
|
2382
2384
|
{
|
|
2383
|
-
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),
|
|
2384
2386
|
children: [
|
|
2385
2387
|
/* @__PURE__ */ B(
|
|
2386
2388
|
"div",
|
|
2387
2389
|
{
|
|
2388
|
-
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),
|
|
2389
2391
|
children: [
|
|
2390
|
-
/* @__PURE__ */
|
|
2391
|
-
|
|
2392
|
+
/* @__PURE__ */ x(
|
|
2393
|
+
oc,
|
|
2392
2394
|
{
|
|
2393
2395
|
prefix: i.functionName,
|
|
2394
2396
|
value: i.functionParameter,
|
|
@@ -2397,28 +2399,28 @@ function oc(e) {
|
|
|
2397
2399
|
}
|
|
2398
2400
|
),
|
|
2399
2401
|
/* @__PURE__ */ B("div", { className: "univer-flex", children: [
|
|
2400
|
-
/* @__PURE__ */
|
|
2402
|
+
/* @__PURE__ */ x(
|
|
2401
2403
|
"div",
|
|
2402
2404
|
{
|
|
2403
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",
|
|
2404
2406
|
style: { transform: m ? "rotateZ(-90deg)" : "rotateZ(90deg)" },
|
|
2405
|
-
onClick: () =>
|
|
2406
|
-
children: /* @__PURE__ */
|
|
2407
|
+
onClick: () => u(!m),
|
|
2408
|
+
children: /* @__PURE__ */ x(Ur, {})
|
|
2407
2409
|
}
|
|
2408
2410
|
),
|
|
2409
|
-
/* @__PURE__ */
|
|
2411
|
+
/* @__PURE__ */ x(
|
|
2410
2412
|
"div",
|
|
2411
2413
|
{
|
|
2412
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",
|
|
2413
2415
|
onClick: E,
|
|
2414
|
-
children: /* @__PURE__ */
|
|
2416
|
+
children: /* @__PURE__ */ x(Lr, {})
|
|
2415
2417
|
}
|
|
2416
2418
|
)
|
|
2417
2419
|
] })
|
|
2418
2420
|
]
|
|
2419
2421
|
}
|
|
2420
2422
|
),
|
|
2421
|
-
/* @__PURE__ */
|
|
2423
|
+
/* @__PURE__ */ x(
|
|
2422
2424
|
"div",
|
|
2423
2425
|
{
|
|
2424
2426
|
className: se("univer-box-border univer-max-h-[350px] univer-overflow-y-auto univer-px-4 univer-pb-3 univer-pt-0", ut),
|
|
@@ -2427,26 +2429,26 @@ function oc(e) {
|
|
|
2427
2429
|
padding: m ? "revert-layer" : 0
|
|
2428
2430
|
},
|
|
2429
2431
|
children: /* @__PURE__ */ B("div", { className: "univer-mt-3", children: [
|
|
2430
|
-
/* @__PURE__ */
|
|
2432
|
+
/* @__PURE__ */ x(
|
|
2431
2433
|
on,
|
|
2432
2434
|
{
|
|
2433
|
-
title:
|
|
2435
|
+
title: h.t("formula.prompt.helpExample"),
|
|
2434
2436
|
value: `${i.functionName}(${i.functionParameter.map((p) => p.example).join(",")})`
|
|
2435
2437
|
}
|
|
2436
2438
|
),
|
|
2437
|
-
/* @__PURE__ */
|
|
2439
|
+
/* @__PURE__ */ x(
|
|
2438
2440
|
on,
|
|
2439
2441
|
{
|
|
2440
|
-
title:
|
|
2442
|
+
title: h.t("formula.prompt.helpAbstract"),
|
|
2441
2443
|
value: i.description
|
|
2442
2444
|
}
|
|
2443
2445
|
),
|
|
2444
|
-
i && i.functionParameter && i.functionParameter.map((p, b) => /* @__PURE__ */
|
|
2446
|
+
i && i.functionParameter && i.functionParameter.map((p, b) => /* @__PURE__ */ x(
|
|
2445
2447
|
on,
|
|
2446
2448
|
{
|
|
2447
2449
|
className: c === b ? "univer-text-primary-500" : "",
|
|
2448
2450
|
title: p.name,
|
|
2449
|
-
value: `${p.require ? l :
|
|
2451
|
+
value: `${p.require ? l : S} ${p.detail}`
|
|
2450
2452
|
},
|
|
2451
2453
|
b
|
|
2452
2454
|
))
|
|
@@ -2457,8 +2459,8 @@ function oc(e) {
|
|
|
2457
2459
|
}
|
|
2458
2460
|
) }, "show") : null;
|
|
2459
2461
|
}
|
|
2460
|
-
const
|
|
2461
|
-
const t =
|
|
2462
|
+
const ic = (e) => {
|
|
2463
|
+
const t = y(ze);
|
|
2462
2464
|
return ee((o) => {
|
|
2463
2465
|
var r, s;
|
|
2464
2466
|
if (e) {
|
|
@@ -2475,44 +2477,44 @@ const sc = (e) => {
|
|
|
2475
2477
|
}
|
|
2476
2478
|
});
|
|
2477
2479
|
};
|
|
2478
|
-
function
|
|
2480
|
+
function cc(e) {
|
|
2479
2481
|
var r, s;
|
|
2480
2482
|
const n = e.get(ne).getCurrentUniverDocInstance();
|
|
2481
2483
|
return n != null && n.getBody() ? { dataStream: (s = (r = n.getBody()) == null ? void 0 : r.dataStream) != null ? s : "", offset: 0 } : void 0;
|
|
2482
2484
|
}
|
|
2483
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 || {});
|
|
2484
|
-
function
|
|
2485
|
-
var
|
|
2486
|
-
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(
|
|
2487
2489
|
0
|
|
2488
2490
|
/* NOT_SELECT */
|
|
2489
|
-
),
|
|
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) => {
|
|
2490
2492
|
g && g.setSkipLastEnabled(
|
|
2491
|
-
|
|
2493
|
+
F === 1 || F === 3 || F === 4
|
|
2492
2494
|
/* EDIT_OTHER_WORKBOOK_REFERENCE */
|
|
2493
|
-
), C.current =
|
|
2495
|
+
), C.current = F, l(F);
|
|
2494
2496
|
}), b = ee(() => {
|
|
2495
|
-
var
|
|
2496
|
-
const
|
|
2497
|
-
if (!
|
|
2498
|
-
const
|
|
2499
|
-
if (!
|
|
2500
|
-
const
|
|
2501
|
-
...
|
|
2502
|
-
range: Wo(
|
|
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)
|
|
2503
2505
|
} : {
|
|
2504
|
-
...
|
|
2506
|
+
...G,
|
|
2505
2507
|
range: void 0
|
|
2506
|
-
} :
|
|
2507
|
-
if ((
|
|
2508
|
-
if (
|
|
2509
|
-
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)
|
|
2510
2512
|
return;
|
|
2511
|
-
const { sheetName:
|
|
2513
|
+
const { sheetName: G, unitId: J } = O.range, ot = (he = c.getCurrentUnitOfType(W.UNIVER_SHEET)) == null ? void 0 : he.getUnitId();
|
|
2512
2514
|
J && J !== ot ? p(
|
|
2513
2515
|
4
|
|
2514
2516
|
/* EDIT_OTHER_WORKBOOK_REFERENCE */
|
|
2515
|
-
) : !
|
|
2517
|
+
) : !G && A.getSheetId() === (E == null ? void 0 : E.getSheetId()) || G === A.getName() ? p(
|
|
2516
2518
|
2
|
|
2517
2519
|
/* CAN_EDIT */
|
|
2518
2520
|
) : p(
|
|
@@ -2520,7 +2522,7 @@ function cc(e) {
|
|
|
2520
2522
|
/* EDIT_OTHER_SHEET_REFERENCE */
|
|
2521
2523
|
);
|
|
2522
2524
|
} else
|
|
2523
|
-
|
|
2525
|
+
v.current = !1, p(
|
|
2524
2526
|
1
|
|
2525
2527
|
/* NEED_ADD */
|
|
2526
2528
|
);
|
|
@@ -2531,42 +2533,42 @@ function cc(e) {
|
|
|
2531
2533
|
);
|
|
2532
2534
|
});
|
|
2533
2535
|
return P(() => {
|
|
2534
|
-
const
|
|
2536
|
+
const F = m.textSelection$.pipe(Cr((A) => A.unitId === t)).subscribe(() => {
|
|
2535
2537
|
b();
|
|
2536
2538
|
});
|
|
2537
|
-
return () =>
|
|
2539
|
+
return () => F.unsubscribe();
|
|
2538
2540
|
}, [b, m.textSelection$, t]), P(() => {
|
|
2539
2541
|
n || (p(
|
|
2540
2542
|
0
|
|
2541
2543
|
/* NOT_SELECT */
|
|
2542
|
-
),
|
|
2544
|
+
), v.current = !0);
|
|
2543
2545
|
}, [n, p]), P(() => {
|
|
2544
|
-
var
|
|
2546
|
+
var A;
|
|
2545
2547
|
if (!o) return;
|
|
2546
|
-
const
|
|
2548
|
+
const F = (A = d == null ? void 0 : d.mainComponent) == null ? void 0 : A.onPointerDown$.subscribeEvent(() => {
|
|
2547
2549
|
p(
|
|
2548
2550
|
0
|
|
2549
2551
|
/* NOT_SELECT */
|
|
2550
|
-
),
|
|
2552
|
+
), v.current = !0;
|
|
2551
2553
|
});
|
|
2552
|
-
return () =>
|
|
2553
|
-
}, [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(() => {
|
|
2554
2556
|
if (!n) return;
|
|
2555
|
-
const
|
|
2557
|
+
const F = R == null ? void 0 : R.activeSheet$.subscribe(() => {
|
|
2556
2558
|
b();
|
|
2557
|
-
}),
|
|
2559
|
+
}), A = c.getCurrentTypeOfUnit$(W.UNIVER_SHEET).subscribe(() => {
|
|
2558
2560
|
b();
|
|
2559
2561
|
});
|
|
2560
2562
|
return () => {
|
|
2561
|
-
|
|
2563
|
+
F == null || F.unsubscribe(), A == null || A.unsubscribe();
|
|
2562
2564
|
};
|
|
2563
|
-
}, [b, n,
|
|
2565
|
+
}, [b, n, R == null ? void 0 : R.activeSheet$, c.getCurrentTypeOfUnit$]), { isSelecting: h, isSelectingRef: C };
|
|
2564
2566
|
}
|
|
2565
|
-
const
|
|
2566
|
-
const e =
|
|
2567
|
+
const ac = () => {
|
|
2568
|
+
const e = y(ye);
|
|
2567
2569
|
return $t((n) => e.sequenceNodesBuilder(n) || [], [e]);
|
|
2568
2570
|
};
|
|
2569
|
-
function
|
|
2571
|
+
function uc(e, t, n) {
|
|
2570
2572
|
const o = new mn(t).setAlpha(0.05).toRgbString();
|
|
2571
2573
|
return {
|
|
2572
2574
|
id: n,
|
|
@@ -2580,7 +2582,7 @@ function ac(e, t, n) {
|
|
|
2580
2582
|
};
|
|
2581
2583
|
}
|
|
2582
2584
|
function qr(e) {
|
|
2583
|
-
var
|
|
2585
|
+
var R, E, p;
|
|
2584
2586
|
const {
|
|
2585
2587
|
unitId: t,
|
|
2586
2588
|
subUnitId: n,
|
|
@@ -2590,49 +2592,49 @@ function qr(e) {
|
|
|
2590
2592
|
refSelectionsService: i,
|
|
2591
2593
|
refSelectionsRenderService: c,
|
|
2592
2594
|
sheetSkeletonManagerService: a,
|
|
2593
|
-
themeService:
|
|
2595
|
+
themeService: d,
|
|
2594
2596
|
univerInstanceService: f
|
|
2595
|
-
} = e, m = o.getUnitId(),
|
|
2596
|
-
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) {
|
|
2597
2599
|
i.setSelections(l);
|
|
2598
2600
|
return;
|
|
2599
2601
|
}
|
|
2600
|
-
const
|
|
2601
|
-
var
|
|
2602
|
-
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();
|
|
2603
2605
|
};
|
|
2604
|
-
if (!((
|
|
2606
|
+
if (!((R = a == null ? void 0 : a.getWorksheetSkeleton(S)) == null ? void 0 : R.skeleton)) return;
|
|
2605
2607
|
const C = [];
|
|
2606
|
-
for (let b = 0,
|
|
2607
|
-
const
|
|
2608
|
-
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)
|
|
2609
2611
|
continue;
|
|
2610
|
-
const
|
|
2611
|
-
|
|
2612
|
-
range:
|
|
2612
|
+
const D = fs(_, h.getRowCount(), h.getColumnCount());
|
|
2613
|
+
D.unitId = t, D.sheetId = S, l.push({
|
|
2614
|
+
range: D,
|
|
2613
2615
|
primary: null,
|
|
2614
|
-
style:
|
|
2615
|
-
}), C.push(
|
|
2616
|
+
style: uc(d, A, M.toString())
|
|
2617
|
+
}), C.push(w);
|
|
2616
2618
|
}
|
|
2617
2619
|
if (s) {
|
|
2618
|
-
const b = (p = (E = s.getSelectionRanges()) == null ? void 0 : E[0]) == null ? void 0 : p.startOffset,
|
|
2619
|
-
|
|
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();
|
|
2620
2622
|
}
|
|
2621
2623
|
return l;
|
|
2622
2624
|
}
|
|
2623
|
-
function
|
|
2624
|
-
const n =
|
|
2625
|
-
const
|
|
2626
|
-
if (!
|
|
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;
|
|
2627
2629
|
const l = qr({
|
|
2628
2630
|
unitId: e,
|
|
2629
2631
|
subUnitId: t,
|
|
2630
|
-
currentWorkbook:
|
|
2632
|
+
currentWorkbook: h,
|
|
2631
2633
|
refSelections: m,
|
|
2632
|
-
editor:
|
|
2634
|
+
editor: u,
|
|
2633
2635
|
refSelectionsService: r,
|
|
2634
2636
|
refSelectionsRenderService: a,
|
|
2635
|
-
sheetSkeletonManagerService:
|
|
2637
|
+
sheetSkeletonManagerService: d,
|
|
2636
2638
|
themeService: o,
|
|
2637
2639
|
univerInstanceService: n
|
|
2638
2640
|
});
|
|
@@ -2644,47 +2646,47 @@ function uc(e, t) {
|
|
|
2644
2646
|
}, [a]), f;
|
|
2645
2647
|
}
|
|
2646
2648
|
function jr(e = "") {
|
|
2647
|
-
const t =
|
|
2648
|
-
return ee((i, c, a = !0,
|
|
2649
|
+
const t = y(Zt), n = hc(), o = y(pe), r = le(() => e.length, [e]);
|
|
2650
|
+
return ee((i, c, a = !0, d) => {
|
|
2649
2651
|
const f = i.getDocumentData(), m = i.getEditorId();
|
|
2650
2652
|
if (!f)
|
|
2651
2653
|
return [];
|
|
2652
|
-
const
|
|
2653
|
-
if (!
|
|
2654
|
+
const u = f.body;
|
|
2655
|
+
if (!u)
|
|
2654
2656
|
return [];
|
|
2655
|
-
const
|
|
2656
|
-
if (!
|
|
2657
|
+
const h = u.dataStream.slice(0, u.dataStream.length - 2), l = { dataStream: "", ...f.body };
|
|
2658
|
+
if (!h.startsWith(e)) return [];
|
|
2657
2659
|
if (c == null || c.length === 0)
|
|
2658
|
-
return l.textRuns = [], o.syncExecuteCommand(
|
|
2660
|
+
return l.textRuns = [], o.syncExecuteCommand(jn.id, {
|
|
2659
2661
|
unitId: m,
|
|
2660
|
-
body:
|
|
2662
|
+
body: $n(l, 0, l.dataStream.length - 2)
|
|
2661
2663
|
}), [];
|
|
2662
2664
|
{
|
|
2663
|
-
const { textRuns:
|
|
2664
|
-
r &&
|
|
2665
|
-
|
|
2666
|
-
}), l.textRuns = [{ st: 0, ed: 1, ts: { fs: 11 } }, ...
|
|
2667
|
-
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}`, "");
|
|
2668
2670
|
l.dataStream = `${e}${g}\r
|
|
2669
2671
|
`;
|
|
2670
2672
|
let C;
|
|
2671
2673
|
if (a) {
|
|
2672
2674
|
C = i.getSelectionRanges();
|
|
2673
|
-
const
|
|
2675
|
+
const R = l.dataStream.length - 2 + r;
|
|
2674
2676
|
C.forEach((E) => {
|
|
2675
|
-
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));
|
|
2676
2678
|
});
|
|
2677
2679
|
}
|
|
2678
|
-
return o.syncExecuteCommand(
|
|
2680
|
+
return o.syncExecuteCommand(jn.id, {
|
|
2679
2681
|
unitId: m,
|
|
2680
|
-
body:
|
|
2681
|
-
textRanges:
|
|
2682
|
-
}),
|
|
2682
|
+
body: $n(l, 0, l.dataStream.length - 2),
|
|
2683
|
+
textRanges: d != null ? d : C
|
|
2684
|
+
}), v;
|
|
2683
2685
|
}
|
|
2684
2686
|
});
|
|
2685
2687
|
}
|
|
2686
|
-
function
|
|
2687
|
-
const e =
|
|
2688
|
+
function hc() {
|
|
2689
|
+
const e = y(Et), t = e.getCurrentTheme();
|
|
2688
2690
|
return le(() => {
|
|
2689
2691
|
const o = [
|
|
2690
2692
|
e.getColorFromTheme("loop-color.1"),
|
|
@@ -2703,13 +2705,13 @@ function dc() {
|
|
|
2703
2705
|
return { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: i };
|
|
2704
2706
|
}, [t]);
|
|
2705
2707
|
}
|
|
2706
|
-
function
|
|
2707
|
-
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();
|
|
2708
2710
|
let f = 0;
|
|
2709
|
-
for (let m = 0,
|
|
2710
|
-
const
|
|
2711
|
-
if (typeof
|
|
2712
|
-
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;
|
|
2713
2715
|
c.push({
|
|
2714
2716
|
st: E,
|
|
2715
2717
|
ed: p,
|
|
@@ -2722,10 +2724,10 @@ function hc(e, t, n) {
|
|
|
2722
2724
|
});
|
|
2723
2725
|
continue;
|
|
2724
2726
|
}
|
|
2725
|
-
if (e.hasDefinedNameDescription(
|
|
2727
|
+
if (e.hasDefinedNameDescription(h.token.trim())) {
|
|
2726
2728
|
c.push({
|
|
2727
|
-
st:
|
|
2728
|
-
ed:
|
|
2729
|
+
st: h.startIndex,
|
|
2730
|
+
ed: h.endIndex + 1,
|
|
2729
2731
|
ts: {
|
|
2730
2732
|
cl: {
|
|
2731
2733
|
rgb: i
|
|
@@ -2735,27 +2737,27 @@ function hc(e, t, n) {
|
|
|
2735
2737
|
});
|
|
2736
2738
|
continue;
|
|
2737
2739
|
}
|
|
2738
|
-
const { startIndex: l, endIndex:
|
|
2740
|
+
const { startIndex: l, endIndex: S, nodeType: v, token: g } = h;
|
|
2739
2741
|
let C = "";
|
|
2740
|
-
if (
|
|
2741
|
-
if (
|
|
2742
|
-
C =
|
|
2742
|
+
if (v === Q.REFERENCE) {
|
|
2743
|
+
if (d.has(g))
|
|
2744
|
+
C = d.get(g);
|
|
2743
2745
|
else {
|
|
2744
|
-
const
|
|
2745
|
-
C = o[
|
|
2746
|
+
const R = f % o.length;
|
|
2747
|
+
C = o[R], d.set(g, C), f++;
|
|
2746
2748
|
}
|
|
2747
2749
|
a.push({
|
|
2748
2750
|
refIndex: m,
|
|
2749
2751
|
themeColor: C,
|
|
2750
2752
|
token: g,
|
|
2751
|
-
startIndex:
|
|
2752
|
-
endIndex:
|
|
2753
|
+
startIndex: h.startIndex,
|
|
2754
|
+
endIndex: h.endIndex,
|
|
2753
2755
|
index: a.length
|
|
2754
2756
|
});
|
|
2755
|
-
} else
|
|
2757
|
+
} else v === Q.NUMBER ? C = r : (v === Q.STRING || v === Q.ARRAY) && (C = s);
|
|
2756
2758
|
C && C.length > 0 ? c.push({
|
|
2757
2759
|
st: l,
|
|
2758
|
-
ed:
|
|
2760
|
+
ed: S + 1,
|
|
2759
2761
|
ts: {
|
|
2760
2762
|
cl: {
|
|
2761
2763
|
rgb: C
|
|
@@ -2764,7 +2766,7 @@ function hc(e, t, n) {
|
|
|
2764
2766
|
}
|
|
2765
2767
|
}) : c.push({
|
|
2766
2768
|
st: l,
|
|
2767
|
-
ed:
|
|
2769
|
+
ed: S + 1,
|
|
2768
2770
|
ts: {
|
|
2769
2771
|
cl: {
|
|
2770
2772
|
rgb: i
|
|
@@ -2775,77 +2777,77 @@ function hc(e, t, n) {
|
|
|
2775
2777
|
}
|
|
2776
2778
|
return { textRuns: c, refSelections: a };
|
|
2777
2779
|
}
|
|
2778
|
-
const
|
|
2779
|
-
const r =
|
|
2780
|
+
const gc = (e, t, n, o) => {
|
|
2781
|
+
const r = y(pe), s = y(zt), i = X(t);
|
|
2780
2782
|
i.current = t;
|
|
2781
|
-
const c =
|
|
2783
|
+
const c = X(o);
|
|
2782
2784
|
c.current = o, P(() => {
|
|
2783
2785
|
if (!n || !e)
|
|
2784
2786
|
return;
|
|
2785
|
-
const
|
|
2787
|
+
const d = `sheet.formula-embedding-editor.${n.getEditorId()}`, f = new Ye(), m = (l, S) => {
|
|
2786
2788
|
if (c.current) {
|
|
2787
|
-
c.current(l,
|
|
2789
|
+
c.current(l, S);
|
|
2788
2790
|
return;
|
|
2789
2791
|
}
|
|
2790
|
-
let
|
|
2791
|
-
l ===
|
|
2792
|
-
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
|
|
2793
2795
|
}) : r.executeCommand(Qo.id, {
|
|
2794
|
-
direction:
|
|
2796
|
+
direction: v
|
|
2795
2797
|
});
|
|
2796
|
-
},
|
|
2797
|
-
let
|
|
2798
|
-
l ===
|
|
2799
|
-
direction:
|
|
2800
|
-
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,
|
|
2801
2803
|
extra: "formula-editor",
|
|
2802
2804
|
fromCurrentSelection: i.current === Me.NEED_ADD || i.current === Me.EDIT_OTHER_SHEET_REFERENCE
|
|
2803
|
-
}) :
|
|
2804
|
-
direction:
|
|
2805
|
+
}) : S === V.SHIFT ? r.executeCommand(qn.id, {
|
|
2806
|
+
direction: v,
|
|
2805
2807
|
extra: "formula-editor"
|
|
2806
|
-
}) :
|
|
2807
|
-
direction:
|
|
2808
|
-
jumpOver:
|
|
2808
|
+
}) : S === (V.CTRL_COMMAND | V.SHIFT) ? r.executeCommand(qn.id, {
|
|
2809
|
+
direction: v,
|
|
2810
|
+
jumpOver: Bn.moveGap,
|
|
2809
2811
|
extra: "formula-editor"
|
|
2810
|
-
}) : r.executeCommand(
|
|
2811
|
-
direction:
|
|
2812
|
+
}) : r.executeCommand(Hn.id, {
|
|
2813
|
+
direction: v,
|
|
2812
2814
|
extra: "formula-editor",
|
|
2813
2815
|
fromCurrentSelection: i.current === Me.NEED_ADD || i.current === Me.EDIT_OTHER_SHEET_REFERENCE
|
|
2814
|
-
}) : m(l,
|
|
2816
|
+
}) : m(l, S);
|
|
2815
2817
|
};
|
|
2816
2818
|
return f.add(r.registerCommand({
|
|
2817
|
-
id:
|
|
2819
|
+
id: d,
|
|
2818
2820
|
type: be.OPERATION,
|
|
2819
|
-
handler(l,
|
|
2820
|
-
const { keyCode:
|
|
2821
|
-
|
|
2821
|
+
handler(l, S) {
|
|
2822
|
+
const { keyCode: v, metaKey: g } = S;
|
|
2823
|
+
u(v, g);
|
|
2822
2824
|
}
|
|
2823
2825
|
})), [
|
|
2824
|
-
{ keyCode:
|
|
2825
|
-
{ keyCode:
|
|
2826
|
-
{ keyCode:
|
|
2827
|
-
{ keyCode:
|
|
2828
|
-
{ keyCode:
|
|
2829
|
-
{ keyCode:
|
|
2830
|
-
{ keyCode:
|
|
2831
|
-
{ keyCode:
|
|
2832
|
-
{ keyCode:
|
|
2833
|
-
{ keyCode:
|
|
2834
|
-
{ keyCode:
|
|
2835
|
-
{ keyCode:
|
|
2836
|
-
{ keyCode:
|
|
2837
|
-
{ keyCode:
|
|
2838
|
-
{ keyCode:
|
|
2839
|
-
{ keyCode:
|
|
2840
|
-
].map(({ keyCode: l, metaKey:
|
|
2841
|
-
id:
|
|
2842
|
-
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,
|
|
2843
2845
|
preconditions: () => !0,
|
|
2844
2846
|
priority: 900,
|
|
2845
2847
|
staticParameters: {
|
|
2846
2848
|
eventType: xe.Keyboard,
|
|
2847
2849
|
keyCode: l,
|
|
2848
|
-
metaKey:
|
|
2850
|
+
metaKey: S
|
|
2849
2851
|
}
|
|
2850
2852
|
})).forEach((l) => {
|
|
2851
2853
|
f.add(s.registerShortcut(l));
|
|
@@ -2853,104 +2855,104 @@ const fc = (e, t, n, o) => {
|
|
|
2853
2855
|
f.dispose();
|
|
2854
2856
|
};
|
|
2855
2857
|
}, [r, n, e, s]);
|
|
2856
|
-
},
|
|
2857
|
-
var
|
|
2858
|
-
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);
|
|
2859
2861
|
Pt(() => {
|
|
2860
2862
|
if (e)
|
|
2861
|
-
return i.setContextValue(
|
|
2862
|
-
const l =
|
|
2863
|
-
(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();
|
|
2864
2866
|
};
|
|
2865
2867
|
}, [i, e, a, r, o]), Pt(() => {
|
|
2866
2868
|
if (e && t) {
|
|
2867
|
-
const l =
|
|
2868
|
-
return i.setContextValue(
|
|
2869
|
-
i.setContextValue(
|
|
2869
|
+
const l = u == null ? void 0 : u.enableSelectionChanging();
|
|
2870
|
+
return i.setContextValue(Gn, !0), () => {
|
|
2871
|
+
i.setContextValue(Gn, !1), l == null || l.dispose();
|
|
2870
2872
|
};
|
|
2871
2873
|
}
|
|
2872
|
-
}, [i, e,
|
|
2873
|
-
e && (
|
|
2874
|
-
}, [e,
|
|
2875
|
-
},
|
|
2876
|
-
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);
|
|
2877
2879
|
return $t(() => {
|
|
2878
2880
|
if (e) {
|
|
2879
|
-
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();
|
|
2880
2882
|
(c == null ? void 0 : c.getUnitId()) !== t && o.setCurrentUnitForType(t), a && a.getSheetId() === n && r.setSelections(i);
|
|
2881
2883
|
}
|
|
2882
2884
|
}, [e, r, n, t, o]);
|
|
2883
|
-
},
|
|
2884
|
-
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;
|
|
2885
2887
|
const { editor: t, lexerTreeBuilder: n } = e, o = t == null ? void 0 : t.getSelectionRanges();
|
|
2886
2888
|
if ((o == null ? void 0 : o.length) !== 1)
|
|
2887
2889
|
return;
|
|
2888
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
|
|
2889
|
-
`).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);
|
|
2890
2892
|
return {
|
|
2891
2893
|
nodeIndex: a,
|
|
2892
|
-
updatingRefIndex:
|
|
2894
|
+
updatingRefIndex: d,
|
|
2893
2895
|
sequenceNodes: c,
|
|
2894
2896
|
offset: s
|
|
2895
2897
|
};
|
|
2896
|
-
},
|
|
2897
|
-
}),
|
|
2898
|
+
}, Cc = (() => {
|
|
2899
|
+
}), _c = (e, t, n, o, r, s, i, c, a, d = Cc) => {
|
|
2898
2900
|
var M;
|
|
2899
|
-
const f =
|
|
2900
|
-
var
|
|
2901
|
-
return (
|
|
2902
|
-
}), C = le(() => g(o, r), [g, r, o]),
|
|
2903
|
-
var
|
|
2904
|
-
const
|
|
2905
|
-
if (!
|
|
2906
|
-
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;
|
|
2907
2909
|
if (n.current === Me.NEED_ADD)
|
|
2908
|
-
if (
|
|
2909
|
-
if (
|
|
2910
|
+
if (U !== 0) {
|
|
2911
|
+
if (_ === -1 && D.length)
|
|
2910
2912
|
return;
|
|
2911
|
-
const K =
|
|
2913
|
+
const K = w[w.length - 1], te = D.splice(_ + 1), fe = (Y = K.sheetId) != null ? Y : r, oe = {
|
|
2912
2914
|
range: K,
|
|
2913
2915
|
unitId: (re = K.unitId) != null ? re : p.getUnitId(),
|
|
2914
2916
|
sheetName: g((he = K.unitId) != null ? he : p.getUnitId(), fe)
|
|
2915
2917
|
}, ae = fe !== r, ge = (p == null ? void 0 : p.getUnitId()) !== o, Se = Ft([oe], i && (ae || ge), C, ge);
|
|
2916
|
-
|
|
2917
|
-
const We = [...
|
|
2918
|
-
|
|
2918
|
+
D.push({ token: Se[0], nodeType: Q.REFERENCE });
|
|
2919
|
+
const We = [...D, ...te], He = un(We);
|
|
2920
|
+
d(He, Sc(D), k);
|
|
2919
2921
|
} else {
|
|
2920
|
-
const K =
|
|
2922
|
+
const K = w[w.length - 1], te = (G = K.sheetId) != null ? G : r, fe = {
|
|
2921
2923
|
range: K,
|
|
2922
2924
|
unitId: (J = K.unitId) != null ? J : p.getUnitId(),
|
|
2923
2925
|
sheetName: g((ot = K.unitId) != null ? ot : p.getUnitId(), te)
|
|
2924
2926
|
}, oe = te !== r, ae = (p == null ? void 0 : p.getUnitId()) !== o, ge = Ft([fe], i && (oe || ae), C, ae);
|
|
2925
|
-
|
|
2926
|
-
const Se = un(
|
|
2927
|
-
|
|
2927
|
+
D.unshift({ token: ge[0], nodeType: Q.REFERENCE });
|
|
2928
|
+
const Se = un(D);
|
|
2929
|
+
d(Se, ge[0].length, k);
|
|
2928
2930
|
}
|
|
2929
2931
|
else if (n.current === Me.EDIT_OTHER_SHEET_REFERENCE || n.current === Me.EDIT_OTHER_WORKBOOK_REFERENCE) {
|
|
2930
|
-
const K =
|
|
2932
|
+
const K = w.pop();
|
|
2931
2933
|
if (!K) return;
|
|
2932
|
-
const te =
|
|
2934
|
+
const te = D[_];
|
|
2933
2935
|
if (typeof te == "object" && te.nodeType === Q.REFERENCE) {
|
|
2934
2936
|
const fe = te.token;
|
|
2935
|
-
(p == null ? void 0 : p.getUnitId()) !== o ? te.token = jo((st = p == null ? void 0 : p.getUnitId()) != null ? st : "", C, K) : te.token = C === (
|
|
2936
|
-
const ae =
|
|
2937
|
-
|
|
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);
|
|
2938
2940
|
}
|
|
2939
2941
|
} else {
|
|
2940
|
-
const K = [...
|
|
2941
|
-
if (
|
|
2942
|
-
const
|
|
2943
|
-
|
|
2942
|
+
const K = [...w];
|
|
2943
|
+
if (!$ && O !== -1) {
|
|
2944
|
+
const Z = K.pop();
|
|
2945
|
+
Z && K.splice(O, 0, Z);
|
|
2944
2946
|
}
|
|
2945
2947
|
let te = 0;
|
|
2946
|
-
const fe =
|
|
2948
|
+
const fe = D.map((Z) => {
|
|
2947
2949
|
var Re, we, it, Be;
|
|
2948
|
-
if (typeof
|
|
2949
|
-
return
|
|
2950
|
-
if (
|
|
2951
|
-
const me = ht(
|
|
2950
|
+
if (typeof Z == "string")
|
|
2951
|
+
return Z;
|
|
2952
|
+
if (Z.nodeType === Q.REFERENCE) {
|
|
2953
|
+
const me = ht(Z.token);
|
|
2952
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)
|
|
2953
|
-
return
|
|
2955
|
+
return Z.token;
|
|
2954
2956
|
const ie = K[te];
|
|
2955
2957
|
if (te++, !ie)
|
|
2956
2958
|
return "";
|
|
@@ -2961,148 +2963,148 @@ const fc = (e, t, n, o) => {
|
|
|
2961
2963
|
}, Mt = (p == null ? void 0 : p.getUnitId()) !== o;
|
|
2962
2964
|
return Ft([Jt], i && (gt !== r || Mt), C, Mt)[0];
|
|
2963
2965
|
}
|
|
2964
|
-
return
|
|
2966
|
+
return Z.token;
|
|
2965
2967
|
});
|
|
2966
2968
|
let oe = "", ae;
|
|
2967
|
-
fe.forEach((
|
|
2968
|
-
oe +=
|
|
2969
|
+
fe.forEach((Z, Re) => {
|
|
2970
|
+
oe += Z, Re === _ && (ae = oe.length);
|
|
2969
2971
|
});
|
|
2970
2972
|
const ge = [];
|
|
2971
|
-
for (let
|
|
2972
|
-
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 = {
|
|
2973
2975
|
range: Re,
|
|
2974
2976
|
unitId: (Oe = Re.unitId) != null ? Oe : p.getUnitId(),
|
|
2975
2977
|
sheetName: g((Nt = Re.unitId) != null ? Nt : p.getUnitId(), we)
|
|
2976
2978
|
}, Be = (p == null ? void 0 : p.getUnitId()) !== o, ie = Ft([it], i && (we !== r || Be), C, Be);
|
|
2977
2979
|
ge.push(ie[0]);
|
|
2978
2980
|
}
|
|
2979
|
-
const Se =
|
|
2980
|
-
|
|
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);
|
|
2981
2983
|
}
|
|
2982
2984
|
});
|
|
2983
2985
|
P(() => {
|
|
2984
|
-
if (
|
|
2985
|
-
let
|
|
2986
|
-
const
|
|
2987
|
-
if (
|
|
2988
|
-
|
|
2986
|
+
if (T && e) {
|
|
2987
|
+
let w = !0, k = 0;
|
|
2988
|
+
const $ = (_, O) => {
|
|
2989
|
+
if (w) {
|
|
2990
|
+
w = !1, k = _.length;
|
|
2989
2991
|
return;
|
|
2990
2992
|
}
|
|
2991
|
-
const
|
|
2992
|
-
|
|
2993
|
-
},
|
|
2994
|
-
return
|
|
2995
|
-
|
|
2996
|
-
})),
|
|
2997
|
-
|
|
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);
|
|
2998
3000
|
})), () => {
|
|
2999
|
-
|
|
3001
|
+
I.dispose();
|
|
3000
3002
|
};
|
|
3001
3003
|
}
|
|
3002
|
-
}, [e, N,
|
|
3003
|
-
if (t &&
|
|
3004
|
-
const
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
const
|
|
3009
|
-
|
|
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);
|
|
3010
3012
|
})
|
|
3011
|
-
),
|
|
3012
|
-
|
|
3013
|
-
const
|
|
3014
|
-
|
|
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);
|
|
3015
3017
|
})
|
|
3016
3018
|
);
|
|
3017
3019
|
});
|
|
3018
|
-
},
|
|
3020
|
+
}, $ = zo(
|
|
3019
3021
|
a.input$,
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
+
A.selectionSet$,
|
|
3023
|
+
T.selectionMoveEnd$
|
|
3022
3024
|
).pipe(
|
|
3023
|
-
|
|
3025
|
+
As(50)
|
|
3024
3026
|
).subscribe(() => {
|
|
3025
|
-
|
|
3027
|
+
k();
|
|
3026
3028
|
});
|
|
3027
3029
|
return () => {
|
|
3028
|
-
|
|
3030
|
+
$.unsubscribe(), w.dispose();
|
|
3029
3031
|
};
|
|
3030
3032
|
}
|
|
3031
|
-
}, [a, t, N,
|
|
3033
|
+
}, [a, t, N, T, A.selectionSet$]), T == null || T.getSelectionDataWithStyle(), P(() => {
|
|
3032
3034
|
if (c) {
|
|
3033
|
-
const
|
|
3034
|
-
var
|
|
3035
|
-
if (
|
|
3035
|
+
const w = u.onCommandExecuted((k) => {
|
|
3036
|
+
var I;
|
|
3037
|
+
if (k.id !== _n.id)
|
|
3036
3038
|
return;
|
|
3037
|
-
const
|
|
3038
|
-
if (
|
|
3039
|
-
const
|
|
3040
|
-
if (
|
|
3041
|
-
const { range:
|
|
3042
|
-
(
|
|
3043
|
-
const
|
|
3044
|
-
|
|
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);
|
|
3045
3047
|
}
|
|
3046
3048
|
}
|
|
3047
3049
|
});
|
|
3048
3050
|
return () => {
|
|
3049
|
-
|
|
3051
|
+
w.dispose();
|
|
3050
3052
|
};
|
|
3051
3053
|
}
|
|
3052
|
-
}, [
|
|
3054
|
+
}, [u, a, n, S, c, N, T]), P(() => {
|
|
3053
3055
|
if (!a)
|
|
3054
3056
|
return;
|
|
3055
|
-
const
|
|
3056
|
-
|
|
3057
|
+
const w = h.textSelection$.subscribe((k) => {
|
|
3058
|
+
k.unitId === a.getEditorId() && qr({
|
|
3057
3059
|
unitId: o,
|
|
3058
3060
|
subUnitId: r,
|
|
3059
3061
|
refSelections: s.current,
|
|
3060
3062
|
editor: a,
|
|
3061
|
-
refSelectionsService:
|
|
3062
|
-
refSelectionsRenderService:
|
|
3063
|
-
sheetSkeletonManagerService:
|
|
3063
|
+
refSelectionsService: A,
|
|
3064
|
+
refSelectionsRenderService: T,
|
|
3065
|
+
sheetSkeletonManagerService: F,
|
|
3064
3066
|
themeService: l,
|
|
3065
3067
|
univerInstanceService: m,
|
|
3066
3068
|
currentWorkbook: p
|
|
3067
3069
|
});
|
|
3068
3070
|
});
|
|
3069
|
-
return () =>
|
|
3070
|
-
}, [
|
|
3071
|
-
},
|
|
3072
|
-
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);
|
|
3073
3075
|
P(() => {
|
|
3074
3076
|
if (e && m)
|
|
3075
3077
|
if (n) {
|
|
3076
|
-
const
|
|
3077
|
-
const
|
|
3078
|
-
for (let
|
|
3078
|
+
const u = () => {
|
|
3079
|
+
const S = m.getSelectionControls().length;
|
|
3080
|
+
for (let v = 1; v <= S; v++)
|
|
3079
3081
|
m.clearLastSelection();
|
|
3080
3082
|
return setTimeout(() => {
|
|
3081
3083
|
s();
|
|
3082
3084
|
}, 30);
|
|
3083
|
-
},
|
|
3084
|
-
|
|
3085
|
-
}), l = f.getCurrentTypeOfUnit$(
|
|
3086
|
-
|
|
3085
|
+
}, h = i.onCommandExecuted((S) => {
|
|
3086
|
+
S.id === Zn.id && u();
|
|
3087
|
+
}), l = f.getCurrentTypeOfUnit$(W.UNIVER_SHEET).subscribe((S) => {
|
|
3088
|
+
u();
|
|
3087
3089
|
});
|
|
3088
3090
|
return () => {
|
|
3089
|
-
|
|
3091
|
+
h.dispose(), l.unsubscribe();
|
|
3090
3092
|
};
|
|
3091
3093
|
} else {
|
|
3092
|
-
const
|
|
3093
|
-
if (
|
|
3094
|
+
const u = i.beforeCommandExecuted((h) => {
|
|
3095
|
+
if (h.id === Zn.id) {
|
|
3094
3096
|
o(!1), r(), s();
|
|
3095
3097
|
const l = c.getEditor(fn);
|
|
3096
3098
|
l == null || l.focus();
|
|
3097
3099
|
}
|
|
3098
3100
|
});
|
|
3099
3101
|
return () => {
|
|
3100
|
-
|
|
3102
|
+
u.dispose();
|
|
3101
3103
|
};
|
|
3102
3104
|
}
|
|
3103
3105
|
}, [e, m]);
|
|
3104
|
-
},
|
|
3105
|
-
const o =
|
|
3106
|
+
}, Ic = (e, t, n) => {
|
|
3107
|
+
const o = y(ye), r = X(!0);
|
|
3106
3108
|
P(() => {
|
|
3107
3109
|
if (e) {
|
|
3108
3110
|
const s = setTimeout(() => {
|
|
@@ -3118,24 +3120,24 @@ const fc = (e, t, n, o) => {
|
|
|
3118
3120
|
t(s === 0 && n.startsWith(pr.EQUALS), `${n}`);
|
|
3119
3121
|
}
|
|
3120
3122
|
}, [n, t]);
|
|
3121
|
-
},
|
|
3122
|
-
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 = () => {
|
|
3123
3125
|
s([]), c(""), a.current = -1;
|
|
3124
3126
|
};
|
|
3125
3127
|
return P(() => {
|
|
3126
3128
|
if (n && e) {
|
|
3127
|
-
const
|
|
3128
|
-
const
|
|
3129
|
-
if (
|
|
3130
|
-
const l =
|
|
3131
|
-
if (
|
|
3132
|
-
const
|
|
3133
|
-
a.current =
|
|
3134
|
-
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];
|
|
3135
3137
|
if (g && typeof g != "string" && g.nodeType === Q.FUNCTION) {
|
|
3136
|
-
a.current =
|
|
3137
|
-
const C = g.token,
|
|
3138
|
-
s(
|
|
3138
|
+
a.current = v;
|
|
3139
|
+
const C = g.token, R = o.getSearchListByNameFirstLetter(C);
|
|
3140
|
+
s(R), c(C);
|
|
3139
3141
|
return;
|
|
3140
3142
|
}
|
|
3141
3143
|
}
|
|
@@ -3143,7 +3145,7 @@ const fc = (e, t, n, o) => {
|
|
|
3143
3145
|
a.current = -1, c(""), s((l) => l != null && l.length ? [] : l);
|
|
3144
3146
|
});
|
|
3145
3147
|
return () => {
|
|
3146
|
-
|
|
3148
|
+
u.unsubscribe();
|
|
3147
3149
|
};
|
|
3148
3150
|
}
|
|
3149
3151
|
}, [n, e]), P(() => {
|
|
@@ -3151,98 +3153,98 @@ const fc = (e, t, n, o) => {
|
|
|
3151
3153
|
}, [e]), {
|
|
3152
3154
|
searchList: r,
|
|
3153
3155
|
searchText: i,
|
|
3154
|
-
handlerFormulaReplace: (
|
|
3155
|
-
const l = [...
|
|
3156
|
+
handlerFormulaReplace: (u, h) => {
|
|
3157
|
+
const l = [...d.current.nodes];
|
|
3156
3158
|
if (a.current !== -1) {
|
|
3157
|
-
const
|
|
3158
|
-
let g = (typeof
|
|
3159
|
-
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 };
|
|
3160
3162
|
}
|
|
3161
3163
|
},
|
|
3162
3164
|
reset: f
|
|
3163
3165
|
};
|
|
3164
|
-
},
|
|
3165
|
-
},
|
|
3166
|
-
function
|
|
3167
|
-
const { isFocus: n, sequenceNodes: o, onSelect: r, editor: s, onClose: i =
|
|
3168
|
-
const
|
|
3169
|
-
|
|
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));
|
|
3170
3172
|
};
|
|
3171
3173
|
function b(N) {
|
|
3172
3174
|
C.current && g(N);
|
|
3173
3175
|
}
|
|
3174
|
-
function
|
|
3176
|
+
function T() {
|
|
3175
3177
|
C.current && g(-1);
|
|
3176
3178
|
}
|
|
3177
3179
|
P(() => {
|
|
3178
3180
|
if (!f.length)
|
|
3179
3181
|
return;
|
|
3180
|
-
const N = `sheet.formula-embedding-editor.search_function.${c}`, M = new Ye(),
|
|
3181
|
-
const { searchList:
|
|
3182
|
-
switch (
|
|
3183
|
-
case
|
|
3184
|
-
g((
|
|
3185
|
-
const
|
|
3186
|
-
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;
|
|
3187
3189
|
});
|
|
3188
3190
|
break;
|
|
3189
3191
|
}
|
|
3190
|
-
case
|
|
3191
|
-
g((
|
|
3192
|
-
const
|
|
3193
|
-
return
|
|
3192
|
+
case L.ARROW_DOWN: {
|
|
3193
|
+
g((_) => {
|
|
3194
|
+
const O = Math.min($.length - 1, _ + 1);
|
|
3195
|
+
return F(O), O;
|
|
3194
3196
|
});
|
|
3195
3197
|
break;
|
|
3196
3198
|
}
|
|
3197
|
-
case
|
|
3198
|
-
case
|
|
3199
|
-
const
|
|
3200
|
-
p(
|
|
3199
|
+
case L.TAB:
|
|
3200
|
+
case L.ENTER: {
|
|
3201
|
+
const _ = $[I];
|
|
3202
|
+
p(_.name, _.functionType);
|
|
3201
3203
|
break;
|
|
3202
3204
|
}
|
|
3203
|
-
case
|
|
3204
|
-
|
|
3205
|
+
case L.ESC: {
|
|
3206
|
+
h(), i();
|
|
3205
3207
|
break;
|
|
3206
3208
|
}
|
|
3207
3209
|
}
|
|
3208
3210
|
};
|
|
3209
|
-
return M.add(
|
|
3211
|
+
return M.add(d.registerCommand({
|
|
3210
3212
|
id: N,
|
|
3211
3213
|
type: be.OPERATION,
|
|
3212
|
-
handler(
|
|
3213
|
-
const { keyCode:
|
|
3214
|
-
|
|
3214
|
+
handler(k, $) {
|
|
3215
|
+
const { keyCode: I } = $;
|
|
3216
|
+
w(I);
|
|
3215
3217
|
}
|
|
3216
|
-
})), [
|
|
3218
|
+
})), [L.ARROW_UP, L.ARROW_DOWN, L.ENTER, L.ESC, L.TAB].map((k) => ({
|
|
3217
3219
|
id: N,
|
|
3218
|
-
binding:
|
|
3220
|
+
binding: k,
|
|
3219
3221
|
preconditions: () => !0,
|
|
3220
3222
|
priority: 1e3,
|
|
3221
3223
|
staticParameters: {
|
|
3222
3224
|
eventType: xe.Keyboard,
|
|
3223
|
-
keyCode:
|
|
3225
|
+
keyCode: k
|
|
3224
3226
|
}
|
|
3225
|
-
})).forEach((
|
|
3226
|
-
M.add(a.registerShortcut(
|
|
3227
|
+
})).forEach((k) => {
|
|
3228
|
+
M.add(a.registerShortcut(k));
|
|
3227
3229
|
}), () => {
|
|
3228
3230
|
M.dispose();
|
|
3229
3231
|
};
|
|
3230
3232
|
}, [f]);
|
|
3231
|
-
function
|
|
3232
|
-
const M =
|
|
3233
|
+
function F(N) {
|
|
3234
|
+
const M = S.current;
|
|
3233
3235
|
if (!M) return;
|
|
3234
|
-
const
|
|
3235
|
-
if (!
|
|
3236
|
-
const
|
|
3237
|
-
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)
|
|
3238
3240
|
return;
|
|
3239
|
-
const
|
|
3241
|
+
const U = w.offsetTop - (I - D) / 2;
|
|
3240
3242
|
M.scrollTo({
|
|
3241
|
-
top:
|
|
3243
|
+
top: U,
|
|
3242
3244
|
behavior: "smooth"
|
|
3243
3245
|
});
|
|
3244
3246
|
}
|
|
3245
|
-
const
|
|
3247
|
+
const A = le(() => {
|
|
3246
3248
|
let N = "";
|
|
3247
3249
|
return () => {
|
|
3248
3250
|
clearTimeout(N), C.current = !0, N = setTimeout(() => {
|
|
@@ -3250,32 +3252,32 @@ function yc(e, t) {
|
|
|
3250
3252
|
}, 300);
|
|
3251
3253
|
};
|
|
3252
3254
|
}, []);
|
|
3253
|
-
return f.length > 0 && l && /* @__PURE__ */
|
|
3255
|
+
return f.length > 0 && l && /* @__PURE__ */ x(cn, { portal: !0, anchorRect$: R, direction: "vertical", children: /* @__PURE__ */ x(
|
|
3254
3256
|
"ul",
|
|
3255
3257
|
{
|
|
3256
3258
|
ref: (N) => {
|
|
3257
|
-
|
|
3259
|
+
S.current = N, t && (t.current = N);
|
|
3258
3260
|
},
|
|
3259
3261
|
"data-u-comp": "sheets-formula-editor",
|
|
3260
|
-
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),
|
|
3261
3263
|
children: f.map((N, M) => /* @__PURE__ */ B(
|
|
3262
3264
|
"li",
|
|
3263
3265
|
{
|
|
3264
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", {
|
|
3265
|
-
"univer-bg-gray-200 dark:!univer-bg-gray-600":
|
|
3267
|
+
"univer-bg-gray-200 dark:!univer-bg-gray-600": v === M
|
|
3266
3268
|
}),
|
|
3267
3269
|
onMouseEnter: () => b(M),
|
|
3268
|
-
onMouseLeave:
|
|
3269
|
-
onMouseMove:
|
|
3270
|
+
onMouseLeave: T,
|
|
3271
|
+
onMouseMove: A,
|
|
3270
3272
|
onClick: () => {
|
|
3271
3273
|
p(N.name, N.functionType), s && s.focus();
|
|
3272
3274
|
},
|
|
3273
3275
|
children: [
|
|
3274
3276
|
/* @__PURE__ */ B("span", { className: "univer-block univer-truncate univer-text-xs", children: [
|
|
3275
|
-
/* @__PURE__ */
|
|
3276
|
-
/* @__PURE__ */
|
|
3277
|
+
/* @__PURE__ */ x("span", { className: "univer-text-red-500", children: N.name.substring(0, m.length) }),
|
|
3278
|
+
/* @__PURE__ */ x("span", { children: N.name.slice(m.length) })
|
|
3277
3279
|
] }),
|
|
3278
|
-
/* @__PURE__ */
|
|
3280
|
+
/* @__PURE__ */ x(
|
|
3279
3281
|
"span",
|
|
3280
3282
|
{
|
|
3281
3283
|
className: "univer-block univer-text-xs univer-text-gray-400",
|
|
@@ -3289,9 +3291,9 @@ function yc(e, t) {
|
|
|
3289
3291
|
}
|
|
3290
3292
|
) });
|
|
3291
3293
|
}
|
|
3292
|
-
const
|
|
3293
|
-
},
|
|
3294
|
-
var
|
|
3294
|
+
const Oc = (e) => e.startsWith(pr.EQUALS) ? e.slice(1) : "", rr = () => {
|
|
3295
|
+
}, Nc = Ve((e, t) => {
|
|
3296
|
+
var xn, wn, kn, An;
|
|
3295
3297
|
const {
|
|
3296
3298
|
errorText: n,
|
|
3297
3299
|
initValue: o,
|
|
@@ -3299,74 +3301,74 @@ const Tc = (e) => e.startsWith(pr.EQUALS) ? e.slice(1) : "", nr = () => {
|
|
|
3299
3301
|
subUnitId: s,
|
|
3300
3302
|
isFocus: i = !0,
|
|
3301
3303
|
isSupportAcrossSheet: c = !1,
|
|
3302
|
-
onFocus: a =
|
|
3303
|
-
onBlur:
|
|
3304
|
+
onFocus: a = rr,
|
|
3305
|
+
onBlur: d = rr,
|
|
3304
3306
|
onChange: f,
|
|
3305
3307
|
onVerify: m,
|
|
3306
|
-
className:
|
|
3307
|
-
editorId:
|
|
3308
|
+
className: u,
|
|
3309
|
+
editorId: h,
|
|
3308
3310
|
moveCursor: l = !0,
|
|
3309
|
-
onFormulaSelectingChange:
|
|
3310
|
-
keyboardEventConfig:
|
|
3311
|
+
onFormulaSelectingChange: S,
|
|
3312
|
+
keyboardEventConfig: v,
|
|
3311
3313
|
onMoveInEditor: g,
|
|
3312
3314
|
resetSelectionOnBlur: C = !0,
|
|
3313
|
-
autoScrollbar:
|
|
3315
|
+
autoScrollbar: R = !0,
|
|
3314
3316
|
isSingle: E = !0,
|
|
3315
3317
|
disableSelectionOnClick: p = !1,
|
|
3316
3318
|
autofocus: b = !0,
|
|
3317
|
-
disableContextMenu:
|
|
3318
|
-
style:
|
|
3319
|
-
} = e,
|
|
3320
|
-
|
|
3321
|
-
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
|
|
3322
3324
|
}));
|
|
3323
|
-
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);
|
|
3324
3326
|
_e(he == null ? void 0 : he.change$);
|
|
3325
|
-
const
|
|
3326
|
-
|
|
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(() => {
|
|
3327
3329
|
M(J);
|
|
3328
3330
|
}, [J, M]);
|
|
3329
|
-
const it = jr("="), Be =
|
|
3330
|
-
if (
|
|
3331
|
-
K.current =
|
|
3332
|
-
const xt =
|
|
3333
|
-
|
|
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,
|
|
3334
3336
|
Gr === xt ? Ae : [],
|
|
3335
3337
|
ce,
|
|
3336
3338
|
Ne
|
|
3337
3339
|
);
|
|
3338
3340
|
if (He.current = wt, ke) {
|
|
3339
|
-
const qe = Ne != null ? Ne :
|
|
3341
|
+
const qe = Ne != null ? Ne : I == null ? void 0 : I.getSelectionRanges();
|
|
3340
3342
|
if ((qe == null ? void 0 : qe.length) !== 1)
|
|
3341
3343
|
return;
|
|
3342
|
-
const Zr = qe[0].startOffset - 1, zr =
|
|
3343
|
-
if (
|
|
3344
|
-
const
|
|
3345
|
-
|
|
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);
|
|
3346
3348
|
}
|
|
3347
|
-
Be(
|
|
3349
|
+
Be(_ ? wt : [], $.current);
|
|
3348
3350
|
}
|
|
3349
3351
|
});
|
|
3350
3352
|
P(() => {
|
|
3351
|
-
|
|
3352
|
-
}, [
|
|
3353
|
-
if (
|
|
3353
|
+
_ && me(J, !1, !0);
|
|
3354
|
+
}, [_]), P(() => {
|
|
3355
|
+
if (_) {
|
|
3354
3356
|
if (K.current === J) return;
|
|
3355
3357
|
me(J, !1, !0);
|
|
3356
3358
|
}
|
|
3357
|
-
}, [J]),
|
|
3358
|
-
const ie =
|
|
3359
|
+
}, [J]), Ic(_, m, J);
|
|
3360
|
+
const ie = ic(I), gt = pc(_, r, s);
|
|
3359
3361
|
P(() => {
|
|
3360
|
-
var
|
|
3361
|
-
|
|
3362
|
-
}, [
|
|
3363
|
-
let
|
|
3364
|
-
if (
|
|
3365
|
-
|
|
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({
|
|
3366
3368
|
autofocus: b,
|
|
3367
|
-
editorUnitId:
|
|
3369
|
+
editorUnitId: U,
|
|
3368
3370
|
initialSnapshot: {
|
|
3369
|
-
id:
|
|
3371
|
+
id: U,
|
|
3370
3372
|
body: {
|
|
3371
3373
|
dataStream: `${o}\r
|
|
3372
3374
|
`,
|
|
@@ -3377,176 +3379,176 @@ const Tc = (e) => e.startsWith(pr.EQUALS) ? e.slice(1) : "", nr = () => {
|
|
|
3377
3379
|
},
|
|
3378
3380
|
documentStyle: {}
|
|
3379
3381
|
}
|
|
3380
|
-
},
|
|
3381
|
-
const ce =
|
|
3382
|
-
|
|
3382
|
+
}, D.current);
|
|
3383
|
+
const ce = A.getEditor(U);
|
|
3384
|
+
$.current = ce, me(o, !1, !0);
|
|
3383
3385
|
}
|
|
3384
3386
|
return () => {
|
|
3385
|
-
|
|
3387
|
+
z == null || z.dispose();
|
|
3386
3388
|
};
|
|
3387
3389
|
}, []), Pt(() => {
|
|
3388
|
-
i ? (
|
|
3389
|
-
}, [i,
|
|
3390
|
-
const { checkScrollBar: Jt } = es(
|
|
3391
|
-
|
|
3392
|
-
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) => {
|
|
3393
3395
|
if (!ae)
|
|
3394
3396
|
return;
|
|
3395
3397
|
const Ne = ce !== -1 ? [{ startOffset: ce + 1, endOffset: ce + 1, collapsed: !0 }] : void 0;
|
|
3396
|
-
me(`=${
|
|
3397
|
-
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);
|
|
3398
3400
|
Ae == null || Ae.scrollToRange({ ...xt, collapsed: !0 });
|
|
3399
3401
|
}, 50), Jt());
|
|
3400
3402
|
});
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3403
|
+
_c(
|
|
3404
|
+
_ && !!(Oe && We),
|
|
3405
|
+
_,
|
|
3404
3406
|
Nt,
|
|
3405
3407
|
r,
|
|
3406
3408
|
s,
|
|
3407
3409
|
He,
|
|
3408
3410
|
c,
|
|
3409
|
-
!!
|
|
3410
|
-
|
|
3411
|
+
!!Z,
|
|
3412
|
+
I,
|
|
3411
3413
|
Mt
|
|
3412
|
-
),
|
|
3414
|
+
), Rc(_ && !!(Oe && We), r, c, O, d, () => {
|
|
3413
3415
|
me(ot.current, !1, !0);
|
|
3414
3416
|
});
|
|
3415
|
-
const
|
|
3416
|
-
if (
|
|
3417
|
-
const ce =
|
|
3417
|
+
const Nn = (z) => {
|
|
3418
|
+
if (z) {
|
|
3419
|
+
const ce = I == null ? void 0 : I.getSelectionRanges();
|
|
3418
3420
|
if (ce && ce.length === 1) {
|
|
3419
3421
|
const ke = ce[0];
|
|
3420
3422
|
if (ke.collapsed) {
|
|
3421
|
-
const Ne =
|
|
3423
|
+
const Ne = z.offset;
|
|
3422
3424
|
setTimeout(() => {
|
|
3423
|
-
|
|
3425
|
+
I == null || I.setSelectionRanges([{ startOffset: ke.startOffset - Ne, endOffset: ke.endOffset - Ne }]);
|
|
3424
3426
|
}, 30);
|
|
3425
3427
|
}
|
|
3426
3428
|
}
|
|
3427
|
-
ie(), me(`=${
|
|
3429
|
+
ie(), me(`=${z.text}`);
|
|
3428
3430
|
}
|
|
3429
|
-
},
|
|
3430
|
-
|
|
3431
|
+
}, Mn = () => {
|
|
3432
|
+
O(!0), a(), ie();
|
|
3431
3433
|
};
|
|
3432
|
-
return /* @__PURE__ */ B("div", { className:
|
|
3433
|
-
/* @__PURE__ */
|
|
3434
|
+
return /* @__PURE__ */ B("div", { className: u, children: [
|
|
3435
|
+
/* @__PURE__ */ x(
|
|
3434
3436
|
"div",
|
|
3435
3437
|
{
|
|
3436
3438
|
ref: N,
|
|
3437
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", {
|
|
3438
|
-
"univer-ring-primary-500":
|
|
3439
|
-
"univer-ring-red-500":
|
|
3440
|
+
"univer-ring-primary-500": _,
|
|
3441
|
+
"univer-ring-red-500": Y
|
|
3440
3442
|
}),
|
|
3441
|
-
children: /* @__PURE__ */
|
|
3443
|
+
children: /* @__PURE__ */ x(
|
|
3442
3444
|
"div",
|
|
3443
3445
|
{
|
|
3444
|
-
ref:
|
|
3446
|
+
ref: D,
|
|
3445
3447
|
className: "univer-relative univer-h-full univer-w-full",
|
|
3446
|
-
onMouseUp:
|
|
3448
|
+
onMouseUp: Mn
|
|
3447
3449
|
}
|
|
3448
3450
|
)
|
|
3449
3451
|
}
|
|
3450
3452
|
),
|
|
3451
|
-
n !== void 0 && /* @__PURE__ */
|
|
3452
|
-
we &&
|
|
3453
|
-
|
|
3453
|
+
n !== void 0 && /* @__PURE__ */ x("div", { className: "univer-my-1 univer-text-xs univer-text-red-500", children: n }),
|
|
3454
|
+
we && I && st !== "" && /* @__PURE__ */ x(
|
|
3455
|
+
sc,
|
|
3454
3456
|
{
|
|
3455
|
-
editor:
|
|
3456
|
-
isFocus:
|
|
3457
|
+
editor: I,
|
|
3458
|
+
isFocus: _,
|
|
3457
3459
|
formulaText: J,
|
|
3458
3460
|
onClose: () => ie()
|
|
3459
3461
|
}
|
|
3460
3462
|
),
|
|
3461
|
-
we && !!
|
|
3462
|
-
|
|
3463
|
+
we && !!I && /* @__PURE__ */ x(
|
|
3464
|
+
yc,
|
|
3463
3465
|
{
|
|
3464
|
-
isFocus:
|
|
3466
|
+
isFocus: _,
|
|
3465
3467
|
sequenceNodes: Ot,
|
|
3466
|
-
onSelect:
|
|
3467
|
-
ref:
|
|
3468
|
-
editor:
|
|
3468
|
+
onSelect: Nn,
|
|
3469
|
+
ref: k,
|
|
3470
|
+
editor: I
|
|
3469
3471
|
}
|
|
3470
3472
|
)
|
|
3471
3473
|
] });
|
|
3472
3474
|
});
|
|
3473
|
-
function
|
|
3474
|
-
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);
|
|
3475
3477
|
return P(() => {
|
|
3476
3478
|
if (!e) return;
|
|
3477
|
-
const
|
|
3478
|
-
if (f.current ===
|
|
3479
|
+
const u = e.getDocumentDataModel().getPlainText();
|
|
3480
|
+
if (f.current === u)
|
|
3479
3481
|
return;
|
|
3480
|
-
f.current =
|
|
3481
|
-
const
|
|
3482
|
-
a(
|
|
3482
|
+
f.current = u;
|
|
3483
|
+
const h = r.sequenceNodesBuilder(u);
|
|
3484
|
+
a(h != null ? h : []);
|
|
3483
3485
|
}, [i, e, r]), P(() => {
|
|
3484
|
-
var l,
|
|
3486
|
+
var l, S;
|
|
3485
3487
|
if (!e) return;
|
|
3486
3488
|
if (!t) {
|
|
3487
|
-
const
|
|
3489
|
+
const v = e.getDocumentData();
|
|
3488
3490
|
e.setDocumentData({
|
|
3489
|
-
...
|
|
3491
|
+
...v,
|
|
3490
3492
|
body: {
|
|
3491
|
-
...
|
|
3492
|
-
dataStream: (
|
|
3493
|
+
...v.body,
|
|
3494
|
+
dataStream: (S = (l = v.body) == null ? void 0 : l.dataStream) != null ? S : "",
|
|
3493
3495
|
textRuns: []
|
|
3494
3496
|
}
|
|
3495
3497
|
});
|
|
3496
3498
|
return;
|
|
3497
3499
|
}
|
|
3498
|
-
const
|
|
3499
|
-
return
|
|
3500
|
-
const g = ht(
|
|
3501
|
-
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)
|
|
3502
3504
|
return;
|
|
3503
|
-
const E = new mn(
|
|
3505
|
+
const E = new mn(v.themeColor).toRgb(), p = d.addShape({
|
|
3504
3506
|
range: g.range,
|
|
3505
3507
|
style: {
|
|
3506
|
-
stroke:
|
|
3508
|
+
stroke: v.themeColor,
|
|
3507
3509
|
fill: `rgba(${E.r}, ${E.g}, ${E.b}, 0.1)`,
|
|
3508
3510
|
strokeDash: 12
|
|
3509
3511
|
},
|
|
3510
3512
|
primary: null
|
|
3511
3513
|
});
|
|
3512
|
-
p &&
|
|
3514
|
+
p && h.add(() => d.removeShape(p));
|
|
3513
3515
|
}), () => {
|
|
3514
|
-
|
|
3516
|
+
h.dispose();
|
|
3515
3517
|
};
|
|
3516
|
-
}, [e, t, s,
|
|
3517
|
-
}
|
|
3518
|
-
function
|
|
3519
|
-
const t =
|
|
3520
|
-
const
|
|
3521
|
-
if (!
|
|
3522
|
-
const l = o ?
|
|
3523
|
-
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,
|
|
3524
3526
|
unitId: r,
|
|
3525
3527
|
sheetName: l
|
|
3526
3528
|
}));
|
|
3527
|
-
|
|
3529
|
+
d(S, u);
|
|
3528
3530
|
});
|
|
3529
3531
|
P(() => {
|
|
3530
3532
|
const m = new Ye();
|
|
3531
|
-
return m.add(t.selectionMoveStart$.subscribe((
|
|
3532
|
-
f(
|
|
3533
|
-
})), m.add(t.selectionMoving$.subscribe((
|
|
3534
|
-
f(
|
|
3535
|
-
})), m.add(t.selectionMoveEnd$.subscribe((
|
|
3536
|
-
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);
|
|
3537
3539
|
})), () => {
|
|
3538
3540
|
m.dispose();
|
|
3539
3541
|
};
|
|
3540
3542
|
}, [f, t.selectionMoveEnd$, t.selectionMoveStart$, t.selectionMoving$]);
|
|
3541
3543
|
}
|
|
3542
|
-
const
|
|
3544
|
+
const or = (e) => !e.some((n) => {
|
|
3543
3545
|
if (typeof n == "string") {
|
|
3544
3546
|
if (n !== Ge.COMMA)
|
|
3545
3547
|
return !0;
|
|
3546
3548
|
} else if (n.nodeType !== Q.REFERENCE)
|
|
3547
3549
|
return !0;
|
|
3548
3550
|
return !1;
|
|
3549
|
-
}),
|
|
3551
|
+
}), wc = (e) => {
|
|
3550
3552
|
if (e.endColumn < e.startColumn) {
|
|
3551
3553
|
const t = e.endColumn;
|
|
3552
3554
|
e.endColumn = e.startColumn, e.startColumn = t;
|
|
@@ -3557,7 +3559,7 @@ const rr = (e) => !e.some((n) => {
|
|
|
3557
3559
|
}
|
|
3558
3560
|
return e;
|
|
3559
3561
|
};
|
|
3560
|
-
function
|
|
3562
|
+
function kc(e) {
|
|
3561
3563
|
const {
|
|
3562
3564
|
visible: t,
|
|
3563
3565
|
initialValue: n,
|
|
@@ -3567,25 +3569,25 @@ function wc(e) {
|
|
|
3567
3569
|
supportAcrossSheet: i,
|
|
3568
3570
|
keepSheetReference: c,
|
|
3569
3571
|
onConfirm: a,
|
|
3570
|
-
onClose:
|
|
3572
|
+
onClose: d,
|
|
3571
3573
|
onShowBySelection: f
|
|
3572
|
-
} = e, m =
|
|
3574
|
+
} = e, m = y(dt), u = y(ye), [h, l] = H([]), [S, v] = H(0), g = X(null);
|
|
3573
3575
|
P(() => {
|
|
3574
3576
|
if (t && n.length) {
|
|
3575
3577
|
const p = n.map((b) => b.sheetName ? _t(b.sheetName, b.range) : Ee(b.range));
|
|
3576
|
-
l(p),
|
|
3578
|
+
l(p), v(p.length - 1);
|
|
3577
3579
|
} else
|
|
3578
|
-
l([""]),
|
|
3580
|
+
l([""]), v(0);
|
|
3579
3581
|
}, [t]);
|
|
3580
3582
|
const C = (p, b) => {
|
|
3581
|
-
const
|
|
3582
|
-
|
|
3583
|
-
},
|
|
3584
|
-
l([...
|
|
3583
|
+
const T = [...h];
|
|
3584
|
+
T[p] = b, l(T);
|
|
3585
|
+
}, R = () => {
|
|
3586
|
+
l([...h, ""]), v(h.length);
|
|
3585
3587
|
}, E = (p) => {
|
|
3586
|
-
|
|
3588
|
+
h.splice(p, 1), l([...h]);
|
|
3587
3589
|
};
|
|
3588
|
-
return
|
|
3590
|
+
return xc({
|
|
3589
3591
|
unitId: o,
|
|
3590
3592
|
subUnitId: r,
|
|
3591
3593
|
supportAcrossSheet: i,
|
|
@@ -3593,24 +3595,24 @@ function wc(e) {
|
|
|
3593
3595
|
onChange: (p, b) => {
|
|
3594
3596
|
if (!t && f != null && f(p))
|
|
3595
3597
|
return;
|
|
3596
|
-
const
|
|
3597
|
-
if (!
|
|
3598
|
-
const N = [...
|
|
3599
|
-
if (
|
|
3600
|
-
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);
|
|
3601
3603
|
const M = N.slice(0, s);
|
|
3602
|
-
l(M),
|
|
3603
|
-
var
|
|
3604
|
-
(
|
|
3604
|
+
l(M), v(M.length - 1), requestAnimationFrame(() => {
|
|
3605
|
+
var w;
|
|
3606
|
+
(w = g.current) == null || w.scrollTo({ top: g.current.scrollHeight });
|
|
3605
3607
|
});
|
|
3606
3608
|
} else {
|
|
3607
|
-
N.splice(
|
|
3609
|
+
N.splice(S, 1, ...A);
|
|
3608
3610
|
const M = N.slice(0, s);
|
|
3609
|
-
l(M), S
|
|
3611
|
+
l(M), v(S + A.length - 1);
|
|
3610
3612
|
}
|
|
3611
3613
|
}
|
|
3612
|
-
}), /* @__PURE__ */
|
|
3613
|
-
|
|
3614
|
+
}), /* @__PURE__ */ x(
|
|
3615
|
+
ks,
|
|
3614
3616
|
{
|
|
3615
3617
|
width: "328px",
|
|
3616
3618
|
open: t,
|
|
@@ -3619,48 +3621,48 @@ function wc(e) {
|
|
|
3619
3621
|
mask: !1,
|
|
3620
3622
|
maskClosable: !1,
|
|
3621
3623
|
footer: /* @__PURE__ */ B("footer", { className: "univer-flex univer-gap-2", children: [
|
|
3622
|
-
/* @__PURE__ */
|
|
3623
|
-
/* @__PURE__ */
|
|
3624
|
+
/* @__PURE__ */ x(at, { onClick: d, children: m.t("rangeSelector.cancel") }),
|
|
3625
|
+
/* @__PURE__ */ x(
|
|
3624
3626
|
at,
|
|
3625
3627
|
{
|
|
3626
3628
|
variant: "primary",
|
|
3627
3629
|
onClick: () => {
|
|
3628
3630
|
a(
|
|
3629
|
-
|
|
3630
|
-
const b =
|
|
3631
|
+
h.filter((p) => {
|
|
3632
|
+
const b = u.sequenceNodesBuilder(p);
|
|
3631
3633
|
return b && b.length === 1 && typeof b[0] != "string" && b[0].nodeType === Q.REFERENCE;
|
|
3632
|
-
}).map((p) => ht(p)).map((p) => ({ ...p, range:
|
|
3634
|
+
}).map((p) => ht(p)).map((p) => ({ ...p, range: wc(p.range) }))
|
|
3633
3635
|
);
|
|
3634
3636
|
},
|
|
3635
3637
|
children: m.t("rangeSelector.confirm")
|
|
3636
3638
|
}
|
|
3637
3639
|
)
|
|
3638
3640
|
] }),
|
|
3639
|
-
onClose:
|
|
3641
|
+
onClose: d,
|
|
3640
3642
|
children: /* @__PURE__ */ B(
|
|
3641
3643
|
"div",
|
|
3642
3644
|
{
|
|
3643
3645
|
ref: g,
|
|
3644
3646
|
className: se("-univer-mx-6 univer-max-h-60 univer-overflow-y-auto univer-px-6", ut),
|
|
3645
3647
|
children: [
|
|
3646
|
-
|
|
3648
|
+
h.map((p, b) => /* @__PURE__ */ B(
|
|
3647
3649
|
"div",
|
|
3648
3650
|
{
|
|
3649
3651
|
className: "univer-mb-2 univer-flex univer-items-center univer-gap-4",
|
|
3650
3652
|
children: [
|
|
3651
|
-
/* @__PURE__ */
|
|
3653
|
+
/* @__PURE__ */ x(
|
|
3652
3654
|
yr,
|
|
3653
3655
|
{
|
|
3654
3656
|
className: se("univer-w-full", {
|
|
3655
|
-
"univer-border-primary-600":
|
|
3657
|
+
"univer-border-primary-600": S === b
|
|
3656
3658
|
}),
|
|
3657
3659
|
placeholder: m.t("rangeSelector.placeHolder"),
|
|
3658
|
-
onFocus: () =>
|
|
3660
|
+
onFocus: () => v(b),
|
|
3659
3661
|
value: p,
|
|
3660
|
-
onChange: (
|
|
3662
|
+
onChange: (T) => C(b, T)
|
|
3661
3663
|
}
|
|
3662
3664
|
),
|
|
3663
|
-
|
|
3665
|
+
h.length > 1 && /* @__PURE__ */ x(
|
|
3664
3666
|
$r,
|
|
3665
3667
|
{
|
|
3666
3668
|
className: "univer-cursor-pointer",
|
|
@@ -3671,9 +3673,9 @@ function wc(e) {
|
|
|
3671
3673
|
},
|
|
3672
3674
|
b
|
|
3673
3675
|
)),
|
|
3674
|
-
|
|
3675
|
-
/* @__PURE__ */
|
|
3676
|
-
/* @__PURE__ */
|
|
3676
|
+
h.length < s && /* @__PURE__ */ x("div", { children: /* @__PURE__ */ B(at, { variant: "link", onClick: R, children: [
|
|
3677
|
+
/* @__PURE__ */ x(Pr, {}),
|
|
3678
|
+
/* @__PURE__ */ x("span", { children: m.t("rangeSelector.addAnotherRange") })
|
|
3677
3679
|
] }) })
|
|
3678
3680
|
]
|
|
3679
3681
|
}
|
|
@@ -3681,10 +3683,10 @@ function wc(e) {
|
|
|
3681
3683
|
}
|
|
3682
3684
|
);
|
|
3683
3685
|
}
|
|
3684
|
-
function
|
|
3686
|
+
function Ac(e) {
|
|
3685
3687
|
return e.split(Ge.COMMA).filter((t) => !!t).map((t) => ht(t));
|
|
3686
3688
|
}
|
|
3687
|
-
function
|
|
3689
|
+
function Fc(e) {
|
|
3688
3690
|
return e.map((t) => t.sheetName ? _t(t.sheetName, t.range) : Ee(t.range)).join(Ge.COMMA);
|
|
3689
3691
|
}
|
|
3690
3692
|
function Kr(e) {
|
|
@@ -3695,20 +3697,20 @@ function Kr(e) {
|
|
|
3695
3697
|
subUnitId: i,
|
|
3696
3698
|
maxRangeCount: c,
|
|
3697
3699
|
supportAcrossSheet: a,
|
|
3698
|
-
keepSheetReference:
|
|
3700
|
+
keepSheetReference: d,
|
|
3699
3701
|
autoFocus: f,
|
|
3700
3702
|
onChange: m,
|
|
3701
|
-
onRangeSelectorDialogVisibleChange:
|
|
3702
|
-
onClickOutside:
|
|
3703
|
+
onRangeSelectorDialogVisibleChange: u,
|
|
3704
|
+
onClickOutside: h,
|
|
3703
3705
|
onFocusChange: l,
|
|
3704
|
-
forceShowDialogWhenSelectionChanged:
|
|
3705
|
-
hideEditor:
|
|
3706
|
+
forceShowDialogWhenSelectionChanged: S,
|
|
3707
|
+
hideEditor: v,
|
|
3706
3708
|
resetRange: g
|
|
3707
|
-
} = e, [C,
|
|
3708
|
-
t == null || t.setSelectionRanges([]), t == null || t.blur(),
|
|
3709
|
-
}),
|
|
3710
|
-
var
|
|
3711
|
-
|
|
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);
|
|
3712
3714
|
});
|
|
3713
3715
|
return P(() => {
|
|
3714
3716
|
r && (r.current = {
|
|
@@ -3716,85 +3718,85 @@ function Kr(e) {
|
|
|
3716
3718
|
return t;
|
|
3717
3719
|
},
|
|
3718
3720
|
focus() {
|
|
3719
|
-
|
|
3721
|
+
A.focus(t.getEditorId());
|
|
3720
3722
|
},
|
|
3721
|
-
blur:
|
|
3722
|
-
verify: () =>
|
|
3723
|
-
showDialog: (
|
|
3724
|
-
|
|
3723
|
+
blur: k,
|
|
3724
|
+
verify: () => or(M.current),
|
|
3725
|
+
showDialog: (I) => {
|
|
3726
|
+
k(), T(I), p(!0);
|
|
3725
3727
|
},
|
|
3726
3728
|
hideDialog: () => {
|
|
3727
|
-
|
|
3729
|
+
T([]), p(!1);
|
|
3728
3730
|
},
|
|
3729
3731
|
getValue: () => {
|
|
3730
|
-
var
|
|
3731
|
-
return (
|
|
3732
|
+
var I;
|
|
3733
|
+
return (I = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? I : "";
|
|
3732
3734
|
}
|
|
3733
3735
|
});
|
|
3734
|
-
}, [
|
|
3735
|
-
var
|
|
3736
|
-
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 : "");
|
|
3737
3739
|
}, [N]), P(() => {
|
|
3738
|
-
|
|
3740
|
+
u == null || u(E);
|
|
3739
3741
|
}, [E]), P(() => {
|
|
3740
3742
|
if (E && g)
|
|
3741
3743
|
return () => {
|
|
3742
|
-
const
|
|
3744
|
+
const I = {
|
|
3743
3745
|
unitId: s,
|
|
3744
3746
|
subUnitId: i,
|
|
3745
3747
|
selections: g
|
|
3746
3748
|
};
|
|
3747
|
-
|
|
3749
|
+
w.executeCommand(_n.id, I);
|
|
3748
3750
|
};
|
|
3749
|
-
}, [E]), /* @__PURE__ */ B(
|
|
3750
|
-
|
|
3751
|
+
}, [E]), /* @__PURE__ */ B(Ts, { children: [
|
|
3752
|
+
v ? null : /* @__PURE__ */ x(
|
|
3751
3753
|
ns,
|
|
3752
3754
|
{
|
|
3753
3755
|
isSingle: !0,
|
|
3754
3756
|
...e,
|
|
3755
|
-
onFocusChange: (
|
|
3756
|
-
|
|
3757
|
+
onFocusChange: (I, _) => {
|
|
3758
|
+
R(I), l == null || l(I, _);
|
|
3757
3759
|
},
|
|
3758
3760
|
editorRef: n,
|
|
3759
3761
|
onClickOutside: () => {
|
|
3760
|
-
|
|
3762
|
+
R(!1), k(), h == null || h();
|
|
3761
3763
|
},
|
|
3762
|
-
icon: /* @__PURE__ */
|
|
3764
|
+
icon: /* @__PURE__ */ x(ws, { title: F.t("rangeSelector.buttonTooltip"), placement: "bottom", children: /* @__PURE__ */ x(
|
|
3763
3765
|
Vr,
|
|
3764
3766
|
{
|
|
3765
3767
|
className: "univer-cursor-pointer dark:!univer-text-gray-300",
|
|
3766
|
-
onClick:
|
|
3768
|
+
onClick: $
|
|
3767
3769
|
}
|
|
3768
3770
|
) })
|
|
3769
3771
|
}
|
|
3770
3772
|
),
|
|
3771
|
-
/* @__PURE__ */
|
|
3772
|
-
|
|
3773
|
+
/* @__PURE__ */ x(
|
|
3774
|
+
kc,
|
|
3773
3775
|
{
|
|
3774
3776
|
initialValue: b,
|
|
3775
3777
|
unitId: s,
|
|
3776
3778
|
subUnitId: i,
|
|
3777
3779
|
visible: E,
|
|
3778
3780
|
maxRangeCount: c,
|
|
3779
|
-
onConfirm: (
|
|
3780
|
-
const
|
|
3781
|
-
|
|
3782
|
-
|
|
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();
|
|
3783
3785
|
});
|
|
3784
3786
|
},
|
|
3785
3787
|
onClose: () => {
|
|
3786
|
-
p(!1),
|
|
3788
|
+
p(!1), T([]);
|
|
3787
3789
|
},
|
|
3788
3790
|
supportAcrossSheet: a,
|
|
3789
|
-
keepSheetReference:
|
|
3790
|
-
onShowBySelection: (
|
|
3791
|
+
keepSheetReference: d,
|
|
3792
|
+
onShowBySelection: (I) => C || S ? (T(I), p(!0), !1) : !0
|
|
3791
3793
|
}
|
|
3792
3794
|
)
|
|
3793
3795
|
] });
|
|
3794
3796
|
}
|
|
3795
|
-
const
|
|
3797
|
+
const Dc = () => {
|
|
3796
3798
|
var o, r;
|
|
3797
|
-
const e =
|
|
3799
|
+
const e = y(Wr), t = _e(e.currentSelector$), n = X(null);
|
|
3798
3800
|
return P(() => {
|
|
3799
3801
|
var s, i;
|
|
3800
3802
|
if (t)
|
|
@@ -3802,7 +3804,7 @@ const Fc = () => {
|
|
|
3802
3804
|
var c;
|
|
3803
3805
|
(c = n.current) == null || c.hideDialog();
|
|
3804
3806
|
};
|
|
3805
|
-
}, [t]), /* @__PURE__ */
|
|
3807
|
+
}, [t]), /* @__PURE__ */ x(
|
|
3806
3808
|
Kr,
|
|
3807
3809
|
{
|
|
3808
3810
|
unitId: (o = t == null ? void 0 : t.unitId) != null ? o : "",
|
|
@@ -3816,16 +3818,16 @@ const Fc = () => {
|
|
|
3816
3818
|
}
|
|
3817
3819
|
);
|
|
3818
3820
|
};
|
|
3819
|
-
var
|
|
3820
|
-
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--)
|
|
3821
3823
|
(i = e[s]) && (r = i(r) || r);
|
|
3822
3824
|
return r;
|
|
3823
|
-
}, Dt = (e, t) => (n, o) => t(n, o, e), Yr = (e, t, n) =>
|
|
3825
|
+
}, Dt = (e, t) => (n, o) => t(n, o, e), Yr = (e, t, n) => Pc(e, typeof t != "symbol" ? t + "" : t, n);
|
|
3824
3826
|
let Kt = class extends go {
|
|
3825
|
-
constructor(e =
|
|
3827
|
+
constructor(e = Jn, t, n, o, r) {
|
|
3826
3828
|
super(), this._config = e, this._injector = t, this._renderManagerService = n, this._configService = o, this._uiPartsService = r;
|
|
3827
3829
|
const { menu: s, ...i } = mo(
|
|
3828
|
-
|
|
3830
|
+
Jn,
|
|
3829
3831
|
this._config
|
|
3830
3832
|
);
|
|
3831
3833
|
s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(xr, i, { merge: !0 });
|
|
@@ -3847,14 +3849,14 @@ let Kt = class extends go {
|
|
|
3847
3849
|
[
|
|
3848
3850
|
[Le]
|
|
3849
3851
|
].forEach((e) => {
|
|
3850
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
3852
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(W.UNIVER_SHEET, e));
|
|
3851
3853
|
});
|
|
3852
3854
|
}
|
|
3853
3855
|
onRendered() {
|
|
3854
3856
|
[
|
|
3855
3857
|
[an]
|
|
3856
3858
|
].forEach((e) => {
|
|
3857
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
3859
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(W.UNIVER_SHEET, e));
|
|
3858
3860
|
}), So(this._injector, [
|
|
3859
3861
|
[qt],
|
|
3860
3862
|
// FormulaProgressBar relies on TriggerCalculationController, but it is necessary to ensure that the formula calculation is done after rendered.
|
|
@@ -3868,32 +3870,32 @@ let Kt = class extends go {
|
|
|
3868
3870
|
}
|
|
3869
3871
|
_initUIPart() {
|
|
3870
3872
|
const e = this._injector.get(Er);
|
|
3871
|
-
this.disposeWithMe(e.register(Lo, Kr)), this.disposeWithMe(e.register($o,
|
|
3873
|
+
this.disposeWithMe(e.register(Lo, Kr)), this.disposeWithMe(e.register($o, Nc)), this.disposeWithMe(this._uiPartsService.registerComponent(ys.GLOBAL, () => br(Dc, this._injector)));
|
|
3872
3874
|
}
|
|
3873
3875
|
};
|
|
3874
3876
|
Yr(Kt, "pluginName", Or);
|
|
3875
|
-
Yr(Kt, "type",
|
|
3876
|
-
Kt =
|
|
3877
|
-
fo(
|
|
3877
|
+
Yr(Kt, "type", W.UNIVER_SHEET);
|
|
3878
|
+
Kt = Uc([
|
|
3879
|
+
fo(Cs),
|
|
3878
3880
|
Dt(1, q(It)),
|
|
3879
3881
|
Dt(2, Te),
|
|
3880
|
-
Dt(3,
|
|
3882
|
+
Dt(3, pn),
|
|
3881
3883
|
Dt(4, Ir)
|
|
3882
3884
|
], Kt);
|
|
3883
3885
|
export {
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
+
$s as FORMULA_PROMPT_ACTIVATED,
|
|
3887
|
+
Nc as FormulaEditor,
|
|
3886
3888
|
Ut as FormulaReorderController,
|
|
3887
3889
|
Wr as GlobalRangeSelectorService,
|
|
3888
|
-
|
|
3890
|
+
Ps as HelpFunctionOperation,
|
|
3889
3891
|
ve as InsertFunctionOperation,
|
|
3890
|
-
|
|
3892
|
+
Tn as MoreFunctionsOperation,
|
|
3891
3893
|
Kr as RangeSelector,
|
|
3892
3894
|
Le as RefSelectionsRenderService,
|
|
3893
3895
|
Mr as ReferenceAbsoluteOperation,
|
|
3894
|
-
|
|
3896
|
+
js as SearchFunctionOperation,
|
|
3895
3897
|
ft as SelectEditorFormulaOperation,
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
+
bn as SheetCopyFormulaOnlyCommand,
|
|
3899
|
+
yn as SheetOnlyPasteFormulaCommand,
|
|
3898
3900
|
Kt as UniverSheetsFormulaUIPlugin
|
|
3899
3901
|
};
|