@univerjs/sheets-formula-ui 0.10.2 → 0.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +5 -5
- package/lib/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +6 -6
- package/lib/es/index.js +644 -649
- package/lib/es/locale/ca-ES.js +2 -2
- package/lib/es/locale/en-US.js +6 -6
- package/lib/es/locale/es-ES.js +2 -2
- package/lib/es/locale/fa-IR.js +6 -6
- package/lib/es/locale/fr-FR.js +6 -6
- package/lib/es/locale/ko-KR.js +2 -2
- package/lib/es/locale/ru-RU.js +474 -474
- package/lib/index.js +644 -649
- package/lib/locale/ca-ES.js +2 -2
- package/lib/locale/en-US.js +6 -6
- package/lib/locale/es-ES.js +2 -2
- package/lib/locale/fa-IR.js +6 -6
- package/lib/locale/fr-FR.js +6 -6
- package/lib/locale/ko-KR.js +2 -2
- package/lib/locale/ru-RU.js +474 -474
- package/lib/types/locale/function-list/engineering/ru-RU.d.ts +2 -939
- package/lib/types/locale/function-list/information/ru-RU.d.ts +2 -385
- package/lib/types/views/formula-editor/hooks/use-refactor-effect.d.ts +1 -1
- package/lib/umd/index.js +5 -5
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/package.json +12 -12
package/lib/es/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
var Wr = Object.defineProperty;
|
|
2
2
|
var Hr = (e, t, n) => t in e ? Wr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var q = (e, t, n) => Hr(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import { CommandType as Me, ICommandService as ve, createIdentifier as Br, IContextService as
|
|
5
|
-
import { SheetPasteCommand as ao, PREDEFINED_HOOK_NAME as
|
|
6
|
-
import { sequenceNodeType as Q, serializeRange as Ee, FormulaDataModel as bt, LexerTreeBuilder as Ie, ERROR_TYPE_SET as No, ErrorType as le, SetFormulaCalculationResultMutation as xo, SetArrayFormulaDataMutation as Mo, SetFormulaCalculationStopMutation as wo, FunctionType as ko, deserializeRangeWithSheetWithCache as Ao, matchRefDrawToken as Fo, isFormulaLexerToken as Do,
|
|
7
|
-
import { Subject as mt, debounceTime as
|
|
8
|
-
import { IEditorService as
|
|
9
|
-
import { DeviceInputEventType as we, IRenderManagerService as ke, ScrollTimerType as
|
|
10
|
-
import { SheetsSelectionsService as
|
|
11
|
-
import { InsertFunctionCommand as is, TriggerCalculationController as cs, IDescriptionService as
|
|
12
|
-
import { ISidebarService as
|
|
4
|
+
import { CommandType as Me, ICommandService as ve, createIdentifier as Br, IContextService as ln, IUniverInstanceService as ne, Rectangle as Qn, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as un, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Jn, DEFAULT_EMPTY_DOCUMENT_VALUE as er, isRealNum as jr, CellValueType as On, getCellValueType as qr, Inject as j, Disposable as ut, ObjectMatrix as $e, Range as Kr, Tools as dn, isFormulaString as xe, isFormulaId as je, FOCUSING_DOC as Yr, FOCUSING_UNIVER_EDITOR as Gr, LocaleService as dt, isICellData as Zr, generateRandomId as jt, Direction as ue, Injector as Rt, UniverInstanceType as H, ThemeService as Et, ILogService as zr, toDisposable as tr, ColorKit as hn, RxDisposable as Xr, InterceptorEffectEnum as Qr, DisposableCollection as qe, RANGE_TYPE as Re, getBodySlice as Nn, EDITOR_ACTIVATED as xn, createInternalEditorID as Jr, BuildTextUtils as eo, RichTextBuilder as to, DependentOn as no, IConfigService as ro, Plugin as oo, merge as so, registerDependencies as io, touchDependencies as co } from "@univerjs/core";
|
|
5
|
+
import { SheetPasteCommand as ao, PREDEFINED_HOOK_NAME as ct, IEditorBridgeService as fn, SetCellEditVisibleOperation as nr, HoverManagerService as lo, CellAlertManagerService as uo, CellAlertType as ho, IAutoFillService as fo, APPLY_TYPE as go, DATA_TYPE as Mn, ISheetClipboardService as mo, COPY_TYPE as rr, SheetSkeletonManagerService as qt, attachSelectionWithCoord as rn, SelectionControl as or, SELECTION_SHAPE_DEPTH as po, useActiveWorkbook as vo, getCurrentRangeDisable$ as Ye, PASTE_SPECIAL_MENU_ID as So, whenFormulaEditorActivated as It, whenSheetEditorFocused as Co, SheetsUIPart as _o, BaseSelectionRenderService as Ro, getCoordByOffset as wn, checkInHeaderRanges as kn, getAllSelection as Eo, genNormalSelectionStyle as sr, getSheetObject as Io, MoveSelectionCommand as An, JumpOver as Fn, ExpandSelectionCommand as Dn, EMBEDDING_FORMULA_EDITOR as bo, IMarkSelectionService as yo, RANGE_SELECTOR_COMPONENT_KEY as To, EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY as Oo } from "@univerjs/sheets-ui";
|
|
6
|
+
import { sequenceNodeType as Q, serializeRange as Ee, FormulaDataModel as bt, LexerTreeBuilder as Ie, ERROR_TYPE_SET as No, ErrorType as le, SetFormulaCalculationResultMutation as xo, SetArrayFormulaDataMutation as Mo, SetFormulaCalculationStopMutation as wo, FunctionType as ko, matchToken as Ke, deserializeRangeWithSheetWithCache as Ao, matchRefDrawToken as Fo, isFormulaLexerToken as Do, deserializeRangeWithSheet as ht, serializeRangeToRefString as Lo, serializeRangeWithSheet as Ct, serializeRangeWithSpreadsheet as $o, generateStringWithSequence as Po, operatorToken as ir, UniverFormulaEnginePlugin as Uo } from "@univerjs/engine-formula";
|
|
7
|
+
import { Subject as mt, debounceTime as gn, combineLatestWith as Vo, map as cr, switchMap as Wo, of as Ln, Observable as Ho, BehaviorSubject as ar, throttleTime as Bo, filter as lr, distinctUntilChanged as jo, merge as qo } from "rxjs";
|
|
8
|
+
import { IEditorService as Ge, DocSelectionRenderService as ur, ReplaceTextRunsCommand as $n, MoveSelectionOperation as Ko, MoveCursorOperation as Yo, useKeyboardEvent as Go, useResize as Zo, DocBackScrollRenderController as zo, RichTextEditor as Xo } from "@univerjs/docs-ui";
|
|
9
|
+
import { DeviceInputEventType as we, IRenderManagerService as ke, ScrollTimerType as Jt, SHEET_VIEWPORT_KEY as Pn, Vector2 as Un } from "@univerjs/engine-render";
|
|
10
|
+
import { SheetsSelectionsService as mn, getSheetCommandTarget as dr, getCellAtRowCol as Qo, SetSelectionsOperation as pn, SheetInterceptorService as vn, ReorderRangeCommand as Jo, SetRangeValuesMutation as Ft, SetRangeValuesUndoMutationFactory as es, BEFORE_CELL_EDIT as ts, SetWorksheetRowAutoHeightMutation as ns, INTERCEPTOR_POINT as rs, WorksheetSetCellValuePermission as Ze, WorksheetEditPermission as ze, RangeProtectionPermissionEditPoint as Xe, WorkbookEditablePermission as Qe, IRefSelectionsService as Kt, SelectionMoveType as en, convertSelectionDataToRange as os, setEndForRange as ss, REF_SELECTIONS_ENABLED as Vn, SetWorksheetActiveOperation as Wn } from "@univerjs/sheets";
|
|
11
|
+
import { InsertFunctionCommand as is, TriggerCalculationController as cs, IDescriptionService as Yt, QuickSumCommand as as, UniverSheetsFormulaPlugin as ls } from "@univerjs/sheets-formula";
|
|
12
|
+
import { ISidebarService as Sn, IZenZoneService as us, useDependency as T, useObservable as Ce, ProgressBar as ds, MenuItemType as Je, getMenuHiddenObservable as ft, IClipboardInterfaceService as Hn, RibbonFormulasGroup as Bn, KeyCode as L, MetaKeys as P, IMenuManagerService as hs, IShortcutService as Gt, IUIPartsService as hr, ComponentManager as fr, connectInjector as gr, useEvent as te, RectPopup as on, IContextMenuService as fs, useUpdateEffect as gs, BuiltInUIPart as ms } from "@univerjs/ui";
|
|
13
13
|
import { jsx as N, jsxs as W, Fragment as ps } from "react/jsx-runtime";
|
|
14
|
-
import { useCallback as
|
|
15
|
-
import { clsx as re, scrollbarClassName as lt, borderLeftClassName as Ss, Select as Cs, Input as mr, borderClassName as
|
|
14
|
+
import { useCallback as Dt, useState as V, forwardRef as Ae, useRef as z, createElement as et, useEffect as $, useMemo as se, useLayoutEffect as Lt, useImperativeHandle as vs } from "react";
|
|
15
|
+
import { clsx as re, scrollbarClassName as lt, borderLeftClassName as Ss, Select as Cs, Input as mr, borderClassName as Cn, Button as at, borderTopClassName as _s, Tooltip as Rs, Dialog as Es } from "@univerjs/design";
|
|
16
16
|
import { DocSelectionManagerService as pr } from "@univerjs/docs";
|
|
17
17
|
import { debounceTime as Is } from "rxjs/operators";
|
|
18
|
-
const
|
|
18
|
+
const _n = {
|
|
19
19
|
id: "sheet.command.paste-formula",
|
|
20
20
|
type: Me.COMMAND,
|
|
21
21
|
handler: async (e) => e.get(ve).executeCommand(ao.id, {
|
|
22
|
-
value:
|
|
22
|
+
value: ct.SPECIAL_PASTE_FORMULA
|
|
23
23
|
})
|
|
24
24
|
}, gt = {
|
|
25
25
|
id: "formula-ui.operation.select-editor-formula",
|
|
@@ -31,8 +31,8 @@ var bs = Object.getOwnPropertyDescriptor, ys = (e, t, n, o) => {
|
|
|
31
31
|
(c = e[s]) && (r = c(r) || r);
|
|
32
32
|
return r;
|
|
33
33
|
}, Ts = (e, t) => (n, o) => t(n, o, e);
|
|
34
|
-
const Os = "FORMULA_PROMPT_ACTIVATED",
|
|
35
|
-
let
|
|
34
|
+
const Os = "FORMULA_PROMPT_ACTIVATED", Zt = Br("formula-ui.prompt-service");
|
|
35
|
+
let sn = class {
|
|
36
36
|
constructor(e) {
|
|
37
37
|
q(this, "_search$", new mt());
|
|
38
38
|
q(this, "_help$", new mt());
|
|
@@ -125,8 +125,8 @@ let cn = class {
|
|
|
125
125
|
const i = this._sequenceNodes[s];
|
|
126
126
|
if (typeof i == "string")
|
|
127
127
|
continue;
|
|
128
|
-
const
|
|
129
|
-
|
|
128
|
+
const l = { ...i };
|
|
129
|
+
l.startIndex += o, l.endIndex += o, this._sequenceNodes[s] = l;
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
/**
|
|
@@ -164,8 +164,8 @@ let cn = class {
|
|
|
164
164
|
const i = this._sequenceNodes[s];
|
|
165
165
|
if (typeof i == "string")
|
|
166
166
|
continue;
|
|
167
|
-
const
|
|
168
|
-
|
|
167
|
+
const l = { ...i };
|
|
168
|
+
l.startIndex += r, l.endIndex += r, this._sequenceNodes[s] = l;
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
enableLockedSelectionChange() {
|
|
@@ -187,57 +187,57 @@ let cn = class {
|
|
|
187
187
|
return this._isLockedOnSelectionInsertRefString;
|
|
188
188
|
}
|
|
189
189
|
};
|
|
190
|
-
|
|
191
|
-
Ts(0,
|
|
192
|
-
],
|
|
190
|
+
sn = ys([
|
|
191
|
+
Ts(0, ln)
|
|
192
|
+
], sn);
|
|
193
193
|
const Ns = {
|
|
194
194
|
id: "formula-ui.operation.help-function",
|
|
195
195
|
type: Me.OPERATION,
|
|
196
|
-
handler: async (e, t) => (e.get(
|
|
196
|
+
handler: async (e, t) => (e.get(Zt).help(t), !0)
|
|
197
197
|
}, Se = {
|
|
198
198
|
id: "formula-ui.operation.insert-function",
|
|
199
199
|
type: Me.OPERATION,
|
|
200
200
|
// eslint-disable-next-line
|
|
201
201
|
handler: async (e, t) => {
|
|
202
|
-
var C,
|
|
203
|
-
const n = e.get(
|
|
202
|
+
var C, _;
|
|
203
|
+
const n = e.get(mn), o = e.get(Ge), r = n.getCurrentSelections();
|
|
204
204
|
if (!r || !r.length)
|
|
205
205
|
return !1;
|
|
206
206
|
const s = dr(e.get(ne));
|
|
207
207
|
if (!s) return !1;
|
|
208
|
-
const { worksheet: c, unitId: i, subUnitId:
|
|
209
|
-
e.get(
|
|
208
|
+
const { worksheet: c, unitId: i, subUnitId: l } = s, f = c.getCellMatrix(), { value: h } = t, g = e.get(ve);
|
|
209
|
+
e.get(fn);
|
|
210
210
|
const u = [], d = [];
|
|
211
|
-
let
|
|
211
|
+
let a = null, S = 0, p = 0, v = "";
|
|
212
212
|
if (r.length === 1 && (ws(r[0].range) || ks(r[0].range) && qn(f, r[0].range))) {
|
|
213
|
-
const { range:
|
|
214
|
-
|
|
213
|
+
const { range: R, primary: m } = r[0], O = (C = m == null ? void 0 : m.actualRow) != null ? C : R.startRow, x = (_ = m == null ? void 0 : m.actualColumn) != null ? _ : R.startColumn;
|
|
214
|
+
a = R, S = O, p = x;
|
|
215
215
|
const w = jn(f, O, x);
|
|
216
216
|
w && (v = Ee(w));
|
|
217
217
|
} else
|
|
218
|
-
r.some((
|
|
218
|
+
r.some((R) => {
|
|
219
219
|
var x, w;
|
|
220
|
-
const { range: m, primary: O } =
|
|
220
|
+
const { range: m, primary: O } = R;
|
|
221
221
|
if (qn(f, m)) {
|
|
222
|
-
const F = (x = O == null ? void 0 : O.actualRow) != null ? x : m.startRow,
|
|
222
|
+
const F = (x = O == null ? void 0 : O.actualRow) != null ? x : m.startRow, y = (w = O == null ? void 0 : O.actualColumn) != null ? w : m.startColumn, k = jn(f, F, y);
|
|
223
223
|
if (!k)
|
|
224
|
-
return
|
|
224
|
+
return a = m, S = F, p = y, !0;
|
|
225
225
|
const A = Ee(k), I = `=${h}(${A})`;
|
|
226
226
|
u.push({
|
|
227
227
|
range: m,
|
|
228
228
|
primary: {
|
|
229
229
|
row: F,
|
|
230
|
-
column:
|
|
230
|
+
column: y
|
|
231
231
|
},
|
|
232
232
|
formula: I
|
|
233
233
|
});
|
|
234
234
|
} else {
|
|
235
|
-
const { startRow: F, startColumn:
|
|
235
|
+
const { startRow: F, startColumn: y, endRow: k, endColumn: A } = m;
|
|
236
236
|
if (F === k) {
|
|
237
237
|
const I = As(f, F, A, c.getColumnCount() - 1), E = I === A ? A - 1 : A, b = Ee({
|
|
238
238
|
startRow: F,
|
|
239
239
|
endRow: k,
|
|
240
|
-
startColumn:
|
|
240
|
+
startColumn: y,
|
|
241
241
|
endColumn: E
|
|
242
242
|
}), M = `=${h}(${b})`;
|
|
243
243
|
d.push({
|
|
@@ -250,12 +250,12 @@ const Ns = {
|
|
|
250
250
|
});
|
|
251
251
|
} else {
|
|
252
252
|
let I = -1;
|
|
253
|
-
for (let b =
|
|
253
|
+
for (let b = y; b <= A; b++) {
|
|
254
254
|
const M = Fs(f, b, k, c.getRowCount() - 1);
|
|
255
255
|
I = Math.max(I, M);
|
|
256
256
|
}
|
|
257
257
|
const E = I === k ? k - 1 : k;
|
|
258
|
-
for (let b =
|
|
258
|
+
for (let b = y; b <= A; b++) {
|
|
259
259
|
const M = Ee({
|
|
260
260
|
startRow: F,
|
|
261
261
|
endRow: E,
|
|
@@ -275,26 +275,26 @@ const Ns = {
|
|
|
275
275
|
}
|
|
276
276
|
return !1;
|
|
277
277
|
});
|
|
278
|
-
if (
|
|
279
|
-
const
|
|
280
|
-
range: Qn.clone(
|
|
278
|
+
if (a) {
|
|
279
|
+
const R = Qo(S, p, c), m = {
|
|
280
|
+
range: Qn.clone(a),
|
|
281
281
|
primary: {
|
|
282
|
-
startRow:
|
|
283
|
-
startColumn:
|
|
284
|
-
endRow:
|
|
285
|
-
endColumn:
|
|
282
|
+
startRow: R.startRow,
|
|
283
|
+
startColumn: R.startColumn,
|
|
284
|
+
endRow: R.endRow,
|
|
285
|
+
endColumn: R.endColumn,
|
|
286
286
|
actualRow: S,
|
|
287
287
|
actualColumn: p,
|
|
288
|
-
isMerged:
|
|
289
|
-
isMergedMainCell:
|
|
288
|
+
isMerged: R.isMerged,
|
|
289
|
+
isMergedMainCell: R.startRow === S && R.startColumn === p
|
|
290
290
|
}
|
|
291
291
|
}, O = {
|
|
292
292
|
unitId: i,
|
|
293
|
-
subUnitId:
|
|
293
|
+
subUnitId: l,
|
|
294
294
|
selections: [m]
|
|
295
295
|
};
|
|
296
|
-
await g.executeCommand(
|
|
297
|
-
const x = o.getEditor(
|
|
296
|
+
await g.executeCommand(pn.id, O);
|
|
297
|
+
const x = o.getEditor(un), w = o.getEditor(Jn);
|
|
298
298
|
g.syncExecuteCommand(nr.id, {
|
|
299
299
|
visible: !0,
|
|
300
300
|
unitId: i,
|
|
@@ -368,7 +368,7 @@ function _t(e) {
|
|
|
368
368
|
const n = t.dataStream, r = n.substring(n.length - 2, n.length) === er ? n.substring(0, n.length - 2) : n;
|
|
369
369
|
return jr(r);
|
|
370
370
|
}
|
|
371
|
-
return e && (e.t ===
|
|
371
|
+
return e && (e.t === On.NUMBER || qr(e) === On.NUMBER);
|
|
372
372
|
}
|
|
373
373
|
function ws(e) {
|
|
374
374
|
return e.startRow === e.endRow && e.startColumn === e.endColumn;
|
|
@@ -395,10 +395,10 @@ function Fs(e, t, n, o) {
|
|
|
395
395
|
return r;
|
|
396
396
|
return o;
|
|
397
397
|
}
|
|
398
|
-
const vr = "SHEET_FORMULA_UI_PLUGIN", Sr = `${vr}_MORE_FUNCTIONS_COMPONENT`,
|
|
398
|
+
const vr = "SHEET_FORMULA_UI_PLUGIN", Sr = `${vr}_MORE_FUNCTIONS_COMPONENT`, Rn = {
|
|
399
399
|
id: "formula-ui.operation.more-functions",
|
|
400
400
|
type: Me.OPERATION,
|
|
401
|
-
handler: async (e) => (e.get(
|
|
401
|
+
handler: async (e) => (e.get(Sn).open({
|
|
402
402
|
header: { title: "formula.insert.tooltip" },
|
|
403
403
|
children: { label: Sr }
|
|
404
404
|
}), !0)
|
|
@@ -409,14 +409,14 @@ const vr = "SHEET_FORMULA_UI_PLUGIN", Sr = `${vr}_MORE_FUNCTIONS_COMPONENT`, En
|
|
|
409
409
|
}, Ds = {
|
|
410
410
|
id: "formula-ui.operation.search-function",
|
|
411
411
|
type: Me.OPERATION,
|
|
412
|
-
handler: async (e, t) => (e.get(
|
|
412
|
+
handler: async (e, t) => (e.get(Zt).search(t), !0)
|
|
413
413
|
};
|
|
414
414
|
var Ls = Object.getOwnPropertyDescriptor, $s = (e, t, n, o) => {
|
|
415
415
|
for (var r = o > 1 ? void 0 : o ? Ls(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
416
416
|
(c = e[s]) && (r = c(r) || r);
|
|
417
417
|
return r;
|
|
418
|
-
},
|
|
419
|
-
let
|
|
418
|
+
}, wt = (e, t) => (n, o) => t(n, o, e);
|
|
419
|
+
let $t = class extends ut {
|
|
420
420
|
constructor(e, t, n, o) {
|
|
421
421
|
super(), this._sheetInterceptorService = e, this._univerInstanceService = t, this._formulaDataModel = n, this._lexerTreeBuilder = o, this._initialize();
|
|
422
422
|
}
|
|
@@ -429,38 +429,38 @@ let Pt = class extends ut {
|
|
|
429
429
|
}));
|
|
430
430
|
}
|
|
431
431
|
_reorderFormula(e) {
|
|
432
|
-
const t = [], n = [], { unitId: o, subUnitId: r, range: s, order: c } = e, i = this._univerInstanceService.getUniverSheetInstance(o),
|
|
433
|
-
if (!
|
|
432
|
+
const t = [], n = [], { unitId: o, subUnitId: r, range: s, order: c } = e, i = this._univerInstanceService.getUniverSheetInstance(o), l = i == null ? void 0 : i.getSheetBySheetId(r);
|
|
433
|
+
if (!l)
|
|
434
434
|
return {
|
|
435
435
|
redos: t,
|
|
436
436
|
undos: n
|
|
437
437
|
};
|
|
438
|
-
const f =
|
|
438
|
+
const f = l.getCellMatrix(), h = new $e(), g = new $e();
|
|
439
439
|
let u = !1;
|
|
440
|
-
return Kr.foreach(s, (d,
|
|
440
|
+
return Kr.foreach(s, (d, a) => {
|
|
441
441
|
let S = d;
|
|
442
442
|
c.hasOwnProperty(d) && (S = c[d]);
|
|
443
|
-
const p = f.getValue(S,
|
|
443
|
+
const p = f.getValue(S, a);
|
|
444
444
|
if (p != null && p.f || p != null && p.si) {
|
|
445
445
|
u = !0;
|
|
446
|
-
const v = this._formulaDataModel.getFormulaStringByCell(S,
|
|
446
|
+
const v = this._formulaDataModel.getFormulaStringByCell(S, a, r, o), C = this._lexerTreeBuilder.moveFormulaRefOffset(
|
|
447
447
|
v,
|
|
448
448
|
0,
|
|
449
449
|
d - S
|
|
450
|
-
),
|
|
451
|
-
|
|
450
|
+
), _ = dn.deepClone(p);
|
|
451
|
+
_.f = C, _.si = null, h.setValue(d, a, _);
|
|
452
452
|
} else
|
|
453
|
-
h.setValue(d,
|
|
454
|
-
g.setValue(d,
|
|
453
|
+
h.setValue(d, a, p);
|
|
454
|
+
g.setValue(d, a, f.getValue(d, a));
|
|
455
455
|
}), u ? (t.push({
|
|
456
|
-
id:
|
|
456
|
+
id: Ft.id,
|
|
457
457
|
params: {
|
|
458
458
|
unitId: o,
|
|
459
459
|
subUnitId: r,
|
|
460
460
|
cellValue: h.getMatrix()
|
|
461
461
|
}
|
|
462
462
|
}), n.push({
|
|
463
|
-
id:
|
|
463
|
+
id: Ft.id,
|
|
464
464
|
params: {
|
|
465
465
|
unitId: o,
|
|
466
466
|
subUnitId: r,
|
|
@@ -475,12 +475,12 @@ let Pt = class extends ut {
|
|
|
475
475
|
};
|
|
476
476
|
}
|
|
477
477
|
};
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
],
|
|
478
|
+
$t = $s([
|
|
479
|
+
wt(0, j(vn)),
|
|
480
|
+
wt(1, j(ne)),
|
|
481
|
+
wt(2, j(bt)),
|
|
482
|
+
wt(3, j(Ie))
|
|
483
|
+
], $t);
|
|
484
484
|
const Ps = "sheets-formula-ui.base.config", Kn = {};
|
|
485
485
|
function Us(e) {
|
|
486
486
|
return e.getContextValue(Yr) && e.getContextValue(Gr);
|
|
@@ -493,7 +493,7 @@ var Vs = Object.getOwnPropertyDescriptor, Ws = (e, t, n, o) => {
|
|
|
493
493
|
(c = e[s]) && (r = c(r) || r);
|
|
494
494
|
return r;
|
|
495
495
|
}, pt = (e, t) => (n, o) => t(n, o, e);
|
|
496
|
-
const
|
|
496
|
+
const tn = "SHEET_FORMULA_ALERT", Hs = {
|
|
497
497
|
[le.DIV_BY_ZERO]: "divByZero",
|
|
498
498
|
[le.NAME]: "name",
|
|
499
499
|
[le.VALUE]: "value",
|
|
@@ -507,7 +507,7 @@ const nn = "SHEET_FORMULA_ALERT", Hs = {
|
|
|
507
507
|
[le.CONNECT]: "connect",
|
|
508
508
|
[le.NULL]: "null"
|
|
509
509
|
};
|
|
510
|
-
let
|
|
510
|
+
let cn = class extends ut {
|
|
511
511
|
constructor(e, t, n, o, r, s) {
|
|
512
512
|
super(), this._context = e, this._hoverManagerService = t, this._cellAlertManagerService = n, this._localeService = o, this._formulaDataModel = r, this._zenZoneService = s, this._init();
|
|
513
513
|
}
|
|
@@ -515,19 +515,19 @@ let an = class extends ut {
|
|
|
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(gn(100)).subscribe((e) => {
|
|
519
519
|
var t, n, o, r, s;
|
|
520
520
|
if (e) {
|
|
521
521
|
const i = this._context.unit.getActiveSheet();
|
|
522
522
|
if (!i) return;
|
|
523
|
-
const
|
|
524
|
-
if (Zr(
|
|
525
|
-
const h = _r(
|
|
523
|
+
const l = i.getCell(e.location.row, e.location.col), f = (r = (o = (n = (t = this._formulaDataModel.getArrayFormulaCellData()) == null ? void 0 : t[e.location.unitId]) == null ? void 0 : n[e.location.subUnitId]) == null ? void 0 : o[e.location.row]) == null ? void 0 : r[e.location.col];
|
|
524
|
+
if (Zr(l)) {
|
|
525
|
+
const h = _r(l, !!f);
|
|
526
526
|
if (!h) {
|
|
527
527
|
this._hideAlert();
|
|
528
528
|
return;
|
|
529
529
|
}
|
|
530
|
-
const g = this._cellAlertManagerService.currentAlert.get(
|
|
530
|
+
const g = this._cellAlertManagerService.currentAlert.get(tn), u = (s = g == null ? void 0 : g.alert) == null ? void 0 : s.location;
|
|
531
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
|
return;
|
|
533
533
|
this._cellAlertManagerService.showAlert({
|
|
@@ -537,7 +537,7 @@ let an = class extends ut {
|
|
|
537
537
|
location: e.location,
|
|
538
538
|
width: 200,
|
|
539
539
|
height: 74,
|
|
540
|
-
key:
|
|
540
|
+
key: tn
|
|
541
541
|
});
|
|
542
542
|
return;
|
|
543
543
|
}
|
|
@@ -551,22 +551,22 @@ let an = class extends ut {
|
|
|
551
551
|
}));
|
|
552
552
|
}
|
|
553
553
|
_hideAlert() {
|
|
554
|
-
this._cellAlertManagerService.removeAlert(
|
|
554
|
+
this._cellAlertManagerService.removeAlert(tn);
|
|
555
555
|
}
|
|
556
556
|
};
|
|
557
|
-
|
|
557
|
+
cn = Ws([
|
|
558
558
|
pt(1, j(lo)),
|
|
559
559
|
pt(2, j(uo)),
|
|
560
560
|
pt(3, j(dt)),
|
|
561
561
|
pt(4, j(bt)),
|
|
562
562
|
pt(5, us)
|
|
563
|
-
],
|
|
563
|
+
], cn);
|
|
564
564
|
var Bs = Object.getOwnPropertyDescriptor, js = (e, t, n, o) => {
|
|
565
565
|
for (var r = o > 1 ? void 0 : o ? Bs(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
566
566
|
(c = e[s]) && (r = c(r) || r);
|
|
567
567
|
return r;
|
|
568
568
|
}, Yn = (e, t) => (n, o) => t(n, o, e);
|
|
569
|
-
let
|
|
569
|
+
let Pt = class extends ut {
|
|
570
570
|
constructor(e, t) {
|
|
571
571
|
super(), this._autoFillService = e, this._lexerTreeBuilder = t, this._registerAutoFill();
|
|
572
572
|
}
|
|
@@ -587,49 +587,49 @@ let Ut = class extends ut {
|
|
|
587
587
|
}
|
|
588
588
|
_fillCopyFormula(e, t, n, o, r, s) {
|
|
589
589
|
var f, h;
|
|
590
|
-
const c = Ks(r), i = [],
|
|
590
|
+
const c = Ks(r), i = [], l = /* @__PURE__ */ new Map();
|
|
591
591
|
for (let g = 1; g <= t; g++) {
|
|
592
|
-
const u = (g - 1) % e.length, d = o[u],
|
|
593
|
-
if (
|
|
592
|
+
const u = (g - 1) % e.length, d = o[u], a = dn.deepClone(e[u]);
|
|
593
|
+
if (a) {
|
|
594
594
|
const S = ((f = e[u]) == null ? void 0 : f.f) || "", p = ((h = e[u]) == null ? void 0 : h.si) || "", v = xe(S);
|
|
595
595
|
if (je(p))
|
|
596
|
-
|
|
596
|
+
a.si = p, a.f = null, a.v = null, a.p = null, a.t = null, i.push(a);
|
|
597
597
|
else if (v) {
|
|
598
|
-
let
|
|
599
|
-
if (
|
|
600
|
-
|
|
598
|
+
let _ = l.get(u);
|
|
599
|
+
if (_)
|
|
600
|
+
a.si = _, a.f = null, a.v = null, a.p = null, a.t = null;
|
|
601
601
|
else {
|
|
602
|
-
|
|
603
|
-
const { offsetX:
|
|
602
|
+
_ = jt(6), l.set(u, _);
|
|
603
|
+
const { offsetX: R, offsetY: m } = qs(c, t, n, s, d), O = this._lexerTreeBuilder.moveFormulaRefOffset(
|
|
604
604
|
S,
|
|
605
|
-
|
|
605
|
+
R,
|
|
606
606
|
m
|
|
607
607
|
);
|
|
608
|
-
|
|
608
|
+
a.si = _, a.f = O, a.v = null, a.p = null, a.t = null;
|
|
609
609
|
}
|
|
610
|
-
i.push(
|
|
610
|
+
i.push(a);
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
613
|
}
|
|
614
614
|
return i;
|
|
615
615
|
}
|
|
616
616
|
};
|
|
617
|
-
|
|
617
|
+
Pt = js([
|
|
618
618
|
Yn(0, fo),
|
|
619
619
|
Yn(1, j(Ie))
|
|
620
|
-
],
|
|
620
|
+
], Pt);
|
|
621
621
|
function qs(e, t, n, o, r) {
|
|
622
|
-
const { source: s, target: c } = o, { rows: i } = c, { rows:
|
|
622
|
+
const { source: s, target: c } = o, { rows: i } = c, { rows: l } = s;
|
|
623
623
|
let f = 0, h = 0;
|
|
624
624
|
switch (n) {
|
|
625
625
|
case ue.UP:
|
|
626
|
-
h = i[r] -
|
|
626
|
+
h = i[r] - l[r];
|
|
627
627
|
break;
|
|
628
628
|
case ue.RIGHT:
|
|
629
629
|
f = e;
|
|
630
630
|
break;
|
|
631
631
|
case ue.DOWN:
|
|
632
|
-
h = i[r] -
|
|
632
|
+
h = i[r] - l[r];
|
|
633
633
|
break;
|
|
634
634
|
case ue.LEFT:
|
|
635
635
|
f = -e * t;
|
|
@@ -651,7 +651,7 @@ var Ys = Object.getOwnPropertyDescriptor, Gs = (e, t, n, o) => {
|
|
|
651
651
|
return r;
|
|
652
652
|
}, vt = (e, t) => (n, o) => t(n, o, e);
|
|
653
653
|
const Zs = "default-paste-formula";
|
|
654
|
-
let
|
|
654
|
+
let Ut = class extends ut {
|
|
655
655
|
constructor(e, t, n, o, r) {
|
|
656
656
|
super(), this._currentUniverSheet = e, this._lexerTreeBuilder = t, this._sheetClipboardService = n, this._injector = o, this._formulaDataModel = r, this._initialize();
|
|
657
657
|
}
|
|
@@ -663,7 +663,7 @@ let Vt = class extends ut {
|
|
|
663
663
|
}
|
|
664
664
|
_pasteFormulaHook() {
|
|
665
665
|
return {
|
|
666
|
-
id:
|
|
666
|
+
id: ct.SPECIAL_PASTE_FORMULA,
|
|
667
667
|
priority: 10,
|
|
668
668
|
specialPasteInfo: { label: "specialPaste.formula" },
|
|
669
669
|
onPasteCells: (e, t, n, o) => this._onPasteCells(e, t, n, o, !0)
|
|
@@ -679,15 +679,15 @@ let Vt = class extends ut {
|
|
|
679
679
|
_onPasteCells(e, t, n, o, r) {
|
|
680
680
|
var u;
|
|
681
681
|
if ([
|
|
682
|
-
|
|
683
|
-
|
|
682
|
+
ct.SPECIAL_PASTE_FORMAT,
|
|
683
|
+
ct.SPECIAL_PASTE_COL_WIDTH
|
|
684
684
|
].includes(o.pasteType))
|
|
685
685
|
return {
|
|
686
686
|
undos: [],
|
|
687
687
|
redos: []
|
|
688
688
|
};
|
|
689
|
-
const c = this._currentUniverSheet.getCurrentUnitForType(H.UNIVER_SHEET), i = t.unitId || c.getUnitId(),
|
|
690
|
-
if (!i || !
|
|
689
|
+
const c = this._currentUniverSheet.getCurrentUnitForType(H.UNIVER_SHEET), i = t.unitId || c.getUnitId(), l = t.subUnitId || ((u = c.getActiveSheet()) == null ? void 0 : u.getSheetId());
|
|
690
|
+
if (!i || !l)
|
|
691
691
|
return {
|
|
692
692
|
undos: [],
|
|
693
693
|
redos: []
|
|
@@ -699,7 +699,7 @@ let Vt = class extends ut {
|
|
|
699
699
|
};
|
|
700
700
|
return this._injector.invoke((d) => zs(
|
|
701
701
|
i,
|
|
702
|
-
|
|
702
|
+
l,
|
|
703
703
|
f,
|
|
704
704
|
h,
|
|
705
705
|
d,
|
|
@@ -711,14 +711,14 @@ let Vt = class extends ut {
|
|
|
711
711
|
));
|
|
712
712
|
}
|
|
713
713
|
};
|
|
714
|
-
|
|
714
|
+
Ut = Gs([
|
|
715
715
|
vt(0, ne),
|
|
716
716
|
vt(1, j(Ie)),
|
|
717
717
|
vt(2, mo),
|
|
718
718
|
vt(3, j(Rt)),
|
|
719
719
|
vt(4, j(bt))
|
|
720
|
-
],
|
|
721
|
-
function zs(e, t, n, o, r, s, c, i,
|
|
720
|
+
], Ut);
|
|
721
|
+
function zs(e, t, n, o, r, s, c, i, l = !1, f) {
|
|
722
722
|
const h = [], g = [], u = Xs(e, t, n, o, s, c, i, f);
|
|
723
723
|
if (!u.hasValue())
|
|
724
724
|
return {
|
|
@@ -731,44 +731,44 @@ function zs(e, t, n, o, r, s, c, i, a = !1, f) {
|
|
|
731
731
|
cellValue: u.getData()
|
|
732
732
|
};
|
|
733
733
|
h.push({
|
|
734
|
-
id:
|
|
734
|
+
id: Ft.id,
|
|
735
735
|
params: d
|
|
736
736
|
});
|
|
737
|
-
const
|
|
737
|
+
const a = es(
|
|
738
738
|
r,
|
|
739
739
|
d
|
|
740
740
|
);
|
|
741
741
|
return g.push({
|
|
742
|
-
id:
|
|
743
|
-
params:
|
|
742
|
+
id: Ft.id,
|
|
743
|
+
params: a
|
|
744
744
|
}), {
|
|
745
745
|
undos: g,
|
|
746
746
|
redos: h
|
|
747
747
|
};
|
|
748
748
|
}
|
|
749
749
|
function Xs(e, t, n, o, r, s, c, i) {
|
|
750
|
-
return i ? r.pasteType ===
|
|
750
|
+
return i ? r.pasteType === ct.SPECIAL_PASTE_VALUE ? Js(e, t, n, o, c, i) : r.pasteType === ct.SPECIAL_PASTE_FORMULA ? ei(e, t, n, o, s, c, i) : ti(e, t, n, o, r.copyType, s, c, i) : Qs(e, t, n, o, c);
|
|
751
751
|
}
|
|
752
752
|
function Qs(e, t, n, o, r) {
|
|
753
753
|
const s = new $e(), c = r.getSheetFormulaData(e, t);
|
|
754
|
-
return o.forValue((i,
|
|
754
|
+
return o.forValue((i, l, f) => {
|
|
755
755
|
var d;
|
|
756
|
-
const h = n.rows[i], g = n.cols[
|
|
756
|
+
const h = n.rows[i], g = n.cols[l], u = {};
|
|
757
757
|
xe(f.v) ? (u.v = null, u.f = `${f.v}`, u.si = null, u.p = null, s.setValue(h, g, u)) : (d = c == null ? void 0 : c[h]) != null && d[g] && (u.v = f.v, u.f = null, u.si = null, u.p = null, s.setValue(h, g, u));
|
|
758
758
|
}), s;
|
|
759
759
|
}
|
|
760
760
|
function Js(e, t, n, o, r, s) {
|
|
761
761
|
var f, h;
|
|
762
|
-
const c = new $e(), i = (h = (f = r.getArrayFormulaCellData()) == null ? void 0 : f[s.unitId]) == null ? void 0 : h[s.subUnitId],
|
|
762
|
+
const c = new $e(), i = (h = (f = r.getArrayFormulaCellData()) == null ? void 0 : f[s.unitId]) == null ? void 0 : h[s.subUnitId], l = r.getSheetFormulaData(e, t);
|
|
763
763
|
return o.forValue((g, u, d) => {
|
|
764
|
-
var
|
|
765
|
-
const
|
|
764
|
+
var _, R;
|
|
765
|
+
const a = s.range.rows[g % s.range.rows.length], S = s.range.cols[u % s.range.cols.length], p = n.rows[g], v = n.cols[u], C = {};
|
|
766
766
|
if (xe(d.f) || je(d.si))
|
|
767
767
|
C.v = d.v, C.f = null, C.si = null, C.p = null, c.setValue(p, v, C);
|
|
768
|
-
else if ((
|
|
769
|
-
const m = i[
|
|
768
|
+
else if ((_ = i == null ? void 0 : i[a]) != null && _[S]) {
|
|
769
|
+
const m = i[a][S];
|
|
770
770
|
C.v = m.v, C.f = null, C.si = null, C.p = null, c.setValue(p, v, C);
|
|
771
|
-
} else if ((
|
|
771
|
+
} else if ((R = l == null ? void 0 : l[p]) != null && R[v]) {
|
|
772
772
|
if (C.v = d.v, C.f = null, C.si = null, C.p = null, d.p) {
|
|
773
773
|
const m = Rr(d);
|
|
774
774
|
m && (C.v = m);
|
|
@@ -778,9 +778,9 @@ function Js(e, t, n, o, r, s) {
|
|
|
778
778
|
}), c;
|
|
779
779
|
}
|
|
780
780
|
function ei(e, t, n, o, r, s, c) {
|
|
781
|
-
const i = new $e(),
|
|
781
|
+
const i = new $e(), l = /* @__PURE__ */ new Map();
|
|
782
782
|
return o.forValue((f, h, g) => {
|
|
783
|
-
const u = n.rows[f], d = n.cols[h],
|
|
783
|
+
const u = n.rows[f], d = n.cols[h], a = {};
|
|
784
784
|
if (je(g.si)) {
|
|
785
785
|
if (c.unitId !== e || c.subUnitId !== t) {
|
|
786
786
|
const S = s.getFormulaStringByCell(
|
|
@@ -789,39 +789,39 @@ function ei(e, t, n, o, r, s, c) {
|
|
|
789
789
|
c.subUnitId,
|
|
790
790
|
c.unitId
|
|
791
791
|
), p = n.cols[h] - c.range.cols[h % c.range.cols.length], v = n.rows[f] - c.range.rows[f % c.range.rows.length], C = r.moveFormulaRefOffset(S || "", p, v);
|
|
792
|
-
|
|
792
|
+
a.si = null, a.f = C;
|
|
793
793
|
} else
|
|
794
|
-
|
|
795
|
-
|
|
794
|
+
a.si = g.si, a.f = null;
|
|
795
|
+
a.v = null, a.p = null, i.setValue(u, d, a);
|
|
796
796
|
} else if (xe(g.f)) {
|
|
797
797
|
const S = `${f % c.range.rows.length}_${h % c.range.cols.length}`;
|
|
798
|
-
let p =
|
|
798
|
+
let p = l.get(S);
|
|
799
799
|
if (p)
|
|
800
|
-
|
|
800
|
+
a.si = p, a.f = null;
|
|
801
801
|
else {
|
|
802
|
-
p =
|
|
803
|
-
const v = n.cols[h] - c.range.cols[h % c.range.cols.length], C = n.rows[f] - c.range.rows[f % c.range.rows.length],
|
|
804
|
-
|
|
802
|
+
p = jt(6), l.set(S, p);
|
|
803
|
+
const v = n.cols[h] - c.range.cols[h % c.range.cols.length], C = n.rows[f] - c.range.rows[f % c.range.rows.length], _ = r.moveFormulaRefOffset(g.f || "", v, C);
|
|
804
|
+
a.si = p, a.f = _;
|
|
805
805
|
}
|
|
806
|
-
|
|
806
|
+
a.v = null, a.p = null, i.setValue(u, d, a);
|
|
807
807
|
} else {
|
|
808
|
-
if (
|
|
808
|
+
if (a.v = g.v, a.f = null, a.si = null, a.p = null, g.p) {
|
|
809
809
|
const S = Rr(g);
|
|
810
|
-
S && (
|
|
810
|
+
S && (a.v = S);
|
|
811
811
|
}
|
|
812
|
-
i.setValue(u, d,
|
|
812
|
+
i.setValue(u, d, a);
|
|
813
813
|
}
|
|
814
814
|
}), i;
|
|
815
815
|
}
|
|
816
816
|
function ti(e, t, n, o, r, s, c, i) {
|
|
817
|
-
const
|
|
818
|
-
return r === rr.CUT ? o.forValue((u, d,
|
|
817
|
+
const l = new $e(), f = /* @__PURE__ */ new Map(), h = c.getSheetFormulaData(e, t), g = [];
|
|
818
|
+
return r === rr.CUT ? o.forValue((u, d, a) => {
|
|
819
819
|
const S = n.rows[u], p = n.cols[d], v = {};
|
|
820
|
-
if (je(
|
|
821
|
-
if (xe(
|
|
822
|
-
g.push(
|
|
823
|
-
else if (g.includes(
|
|
824
|
-
v.f = null, v.si =
|
|
820
|
+
if (je(a.si)) {
|
|
821
|
+
if (xe(a.f))
|
|
822
|
+
g.push(a.si), v.f = a.f, v.si = a.si;
|
|
823
|
+
else if (g.includes(a.si))
|
|
824
|
+
v.f = null, v.si = a.si;
|
|
825
825
|
else {
|
|
826
826
|
const C = c.getFormulaStringByCell(
|
|
827
827
|
i.range.rows[u % i.range.rows.length],
|
|
@@ -831,51 +831,51 @@ function ti(e, t, n, o, r, s, c, i) {
|
|
|
831
831
|
);
|
|
832
832
|
v.f = C, v.si = null;
|
|
833
833
|
}
|
|
834
|
-
v.v = null, v.p = null,
|
|
835
|
-
} else xe(
|
|
836
|
-
}) : o.forValue((u, d,
|
|
834
|
+
v.v = null, v.p = null, l.setValue(S, p, v);
|
|
835
|
+
} else xe(a.f) && (v.f = a.f, v.si = null, v.v = null, v.p = null, l.setValue(S, p, v));
|
|
836
|
+
}) : o.forValue((u, d, a) => {
|
|
837
837
|
var C;
|
|
838
838
|
const S = n.rows[u], p = n.cols[d], v = {};
|
|
839
|
-
if (je(
|
|
839
|
+
if (je(a.si)) {
|
|
840
840
|
if (i.unitId !== e || i.subUnitId !== t) {
|
|
841
|
-
const
|
|
841
|
+
const _ = c.getFormulaStringByCell(
|
|
842
842
|
i.range.rows[u % i.range.rows.length],
|
|
843
843
|
i.range.cols[d % i.range.cols.length],
|
|
844
844
|
i.subUnitId,
|
|
845
845
|
i.unitId
|
|
846
|
-
),
|
|
846
|
+
), R = n.cols[d] - i.range.cols[d % i.range.cols.length], m = n.rows[u] - i.range.rows[u % i.range.rows.length], O = s.moveFormulaRefOffset(_ || "", R, m);
|
|
847
847
|
v.si = null, v.f = O;
|
|
848
848
|
} else
|
|
849
|
-
v.si =
|
|
850
|
-
v.v = null, v.p = null,
|
|
851
|
-
} else if (xe(
|
|
852
|
-
const
|
|
853
|
-
let
|
|
854
|
-
if (
|
|
855
|
-
v.si =
|
|
849
|
+
v.si = a.si, v.f = null;
|
|
850
|
+
v.v = null, v.p = null, l.setValue(S, p, v);
|
|
851
|
+
} else if (xe(a.f)) {
|
|
852
|
+
const _ = `${u % i.range.rows.length}_${d % i.range.cols.length}`;
|
|
853
|
+
let R = f.get(_);
|
|
854
|
+
if (R)
|
|
855
|
+
v.si = R, v.f = null;
|
|
856
856
|
else {
|
|
857
|
-
|
|
858
|
-
const m = n.cols[d] - i.range.cols[d % i.range.cols.length], O = n.rows[u] - i.range.rows[u % i.range.rows.length], x = s.moveFormulaRefOffset(
|
|
859
|
-
v.si =
|
|
857
|
+
R = jt(6), f.set(_, R);
|
|
858
|
+
const m = n.cols[d] - i.range.cols[d % i.range.cols.length], O = n.rows[u] - i.range.rows[u % i.range.rows.length], x = s.moveFormulaRefOffset(a.f || "", m, O);
|
|
859
|
+
v.si = R, v.f = x;
|
|
860
860
|
}
|
|
861
|
-
v.v = null, v.p = null,
|
|
862
|
-
} else (C = h == null ? void 0 : h[S]) != null && C[p] && (v.v =
|
|
863
|
-
}), g.length > 0 && new $e(h).forValue((u, d,
|
|
864
|
-
if (!(i.range.rows.includes(u) && i.range.cols.includes(d)) && !(n.rows.includes(u) && n.cols.includes(d)) && g.includes(
|
|
861
|
+
v.v = null, v.p = null, l.setValue(S, p, v);
|
|
862
|
+
} else (C = h == null ? void 0 : h[S]) != null && C[p] && (v.v = a.v, v.f = null, v.si = null, v.p = a.p, l.setValue(S, p, v));
|
|
863
|
+
}), g.length > 0 && new $e(h).forValue((u, d, a) => {
|
|
864
|
+
if (!(i.range.rows.includes(u) && i.range.cols.includes(d)) && !(n.rows.includes(u) && n.cols.includes(d)) && g.includes(a == null ? void 0 : a.si)) {
|
|
865
865
|
const S = c.getFormulaStringByCell(
|
|
866
866
|
u,
|
|
867
867
|
d,
|
|
868
868
|
i.subUnitId,
|
|
869
869
|
i.unitId
|
|
870
870
|
);
|
|
871
|
-
|
|
871
|
+
l.setValue(u, d, {
|
|
872
872
|
f: S,
|
|
873
873
|
si: null,
|
|
874
874
|
v: null,
|
|
875
875
|
p: null
|
|
876
876
|
});
|
|
877
877
|
}
|
|
878
|
-
}),
|
|
878
|
+
}), l;
|
|
879
879
|
}
|
|
880
880
|
function Rr(e) {
|
|
881
881
|
if (e != null && e.p) {
|
|
@@ -891,12 +891,12 @@ var ni = Object.getOwnPropertyDescriptor, ri = (e, t, n, o) => {
|
|
|
891
891
|
(c = e[s]) && (r = c(r) || r);
|
|
892
892
|
return r;
|
|
893
893
|
}, He = (e, t) => (n, o) => t(n, o, e);
|
|
894
|
-
let
|
|
895
|
-
constructor(t, n, o, r, s, c, i,
|
|
894
|
+
let Vt = class extends ut {
|
|
895
|
+
constructor(t, n, o, r, s, c, i, l) {
|
|
896
896
|
super();
|
|
897
897
|
q(this, "_previousShape");
|
|
898
898
|
q(this, "_skeleton");
|
|
899
|
-
this._context = t, this._sheetInterceptorService = n, this._formulaDataModel = o, this._themeService = r, this._renderManagerService = s, this._sheetSkeletonManagerService = c, this._commandService = i, this._logService =
|
|
899
|
+
this._context = t, this._sheetInterceptorService = n, this._formulaDataModel = o, this._themeService = r, this._renderManagerService = s, this._sheetSkeletonManagerService = c, this._commandService = i, this._logService = l, this._initSkeletonChangeListener(), this._initInterceptorEditorStart(), this._commandExecutedListener();
|
|
900
900
|
}
|
|
901
901
|
_initSkeletonChangeListener() {
|
|
902
902
|
this.disposeWithMe(
|
|
@@ -924,16 +924,16 @@ let Wt = class extends ut {
|
|
|
924
924
|
tr(
|
|
925
925
|
this._sheetInterceptorService.writeCellInterceptor.intercept(ts, {
|
|
926
926
|
handler: (t, n, o) => {
|
|
927
|
-
var
|
|
928
|
-
const { row: r, col: s, unitId: c, subUnitId: i, worksheet:
|
|
927
|
+
var a, S, p, v;
|
|
928
|
+
const { row: r, col: s, unitId: c, subUnitId: i, worksheet: l } = n, f = this._formulaDataModel.getArrayFormulaRange(), h = this._formulaDataModel.getArrayFormulaCellData();
|
|
929
929
|
if (this._removeArrayFormulaRangeShape(), t == null)
|
|
930
930
|
return o(t);
|
|
931
931
|
let g = null;
|
|
932
932
|
const u = this._formulaDataModel.getFormulaStringByCell(r, s, i, c);
|
|
933
|
-
if (u !== null && (g = { f: u }), t.v != null && t.v !== "" && ((p = (S = (
|
|
933
|
+
if (u !== null && (g = { f: u }), t.v != null && t.v !== "" && ((p = (S = (a = h[c]) == null ? void 0 : a[i]) == null ? void 0 : S[r]) == null ? void 0 : p[s]) == null)
|
|
934
934
|
return g ? { ...t, ...g } : o(t);
|
|
935
935
|
const d = (v = f == null ? void 0 : f[c]) == null ? void 0 : v[i];
|
|
936
|
-
return d != null && (g = this._displayArrayFormulaRangeShape(d, r, s, c, i,
|
|
936
|
+
return d != null && (g = this._displayArrayFormulaRangeShape(d, r, s, c, i, l, g)), g ? { ...t, ...g } : o(t);
|
|
937
937
|
}
|
|
938
938
|
})
|
|
939
939
|
)
|
|
@@ -952,19 +952,19 @@ let Wt = class extends ut {
|
|
|
952
952
|
);
|
|
953
953
|
}
|
|
954
954
|
_displayArrayFormulaRangeShape(t, n, o, r, s, c, i) {
|
|
955
|
-
const
|
|
955
|
+
const l = this._formulaDataModel.getSheetFormulaData(r, s);
|
|
956
956
|
return new $e(t).forValue((f, h, g) => {
|
|
957
957
|
var p;
|
|
958
958
|
if (g == null)
|
|
959
959
|
return !0;
|
|
960
|
-
const { startRow: u, startColumn: d, endRow:
|
|
960
|
+
const { startRow: u, startColumn: d, endRow: a, endColumn: S } = g;
|
|
961
961
|
if (f === n && h === o)
|
|
962
962
|
return this._createArrayFormulaRangeShape(g, r), !1;
|
|
963
|
-
if (n >= u && n <=
|
|
963
|
+
if (n >= u && n <= a && o >= d && o <= S) {
|
|
964
964
|
const v = c.getCell(u, d);
|
|
965
965
|
if ((v == null ? void 0 : v.v) === le.SPILL)
|
|
966
966
|
return;
|
|
967
|
-
const C = (p =
|
|
967
|
+
const C = (p = l == null ? void 0 : l[f]) == null ? void 0 : p[h];
|
|
968
968
|
return C == null || C.f == null ? !0 : (i == null && (i = {
|
|
969
969
|
f: C.f,
|
|
970
970
|
isInArrayFormulaRange: !0
|
|
@@ -983,12 +983,12 @@ let Wt = class extends ut {
|
|
|
983
983
|
style: {
|
|
984
984
|
strokeWidth: 1,
|
|
985
985
|
stroke: this._themeService.getColorFromTheme("primary.600"),
|
|
986
|
-
fill: new
|
|
986
|
+
fill: new hn(this._themeService.getColorFromTheme("white")).setAlpha(0).toString(),
|
|
987
987
|
widgets: {}
|
|
988
988
|
}
|
|
989
|
-
}, i =
|
|
989
|
+
}, i = rn(c, r), { rowHeaderWidth: l, columnHeaderHeight: f } = r, h = new or(s, po.FORMULA_EDITOR_SHOW, this._themeService, {
|
|
990
990
|
highlightHeader: !1,
|
|
991
|
-
rowHeaderWidth:
|
|
991
|
+
rowHeaderWidth: l,
|
|
992
992
|
columnHeaderHeight: f
|
|
993
993
|
});
|
|
994
994
|
h.updateRangeBySelectionWithCoord(i), h.setEvent(!1), this._previousShape = h;
|
|
@@ -1014,8 +1014,8 @@ let Wt = class extends ut {
|
|
|
1014
1014
|
_refreshArrayFormulaRangeShapeByRow(t, n, o) {
|
|
1015
1015
|
if (!this._checkCurrentSheet(t, n) || !this._previousShape) return;
|
|
1016
1016
|
const { startRow: r, endRow: s, startColumn: c, endColumn: i } = this._previousShape.getRange();
|
|
1017
|
-
for (let
|
|
1018
|
-
const { row: f } = o[
|
|
1017
|
+
for (let l = 0; l < o.length; l++) {
|
|
1018
|
+
const { row: f } = o[l];
|
|
1019
1019
|
if (r >= f) {
|
|
1020
1020
|
const h = {
|
|
1021
1021
|
startRow: r,
|
|
@@ -1029,15 +1029,15 @@ let Wt = class extends ut {
|
|
|
1029
1029
|
}
|
|
1030
1030
|
}
|
|
1031
1031
|
};
|
|
1032
|
-
|
|
1033
|
-
He(1, j(
|
|
1032
|
+
Vt = ri([
|
|
1033
|
+
He(1, j(vn)),
|
|
1034
1034
|
He(2, j(bt)),
|
|
1035
1035
|
He(3, j(Et)),
|
|
1036
1036
|
He(4, ke),
|
|
1037
|
-
He(5, j(
|
|
1037
|
+
He(5, j(qt)),
|
|
1038
1038
|
He(6, ve),
|
|
1039
1039
|
He(7, zr)
|
|
1040
|
-
],
|
|
1040
|
+
], Vt);
|
|
1041
1041
|
var oi = Object.getOwnPropertyDescriptor, si = (e, t, n, o) => {
|
|
1042
1042
|
for (var r = o > 1 ? void 0 : o ? oi(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
1043
1043
|
(c = e[s]) && (r = c(r) || r);
|
|
@@ -1049,15 +1049,15 @@ const ii = {
|
|
|
1049
1049
|
color: "#409f11"
|
|
1050
1050
|
}
|
|
1051
1051
|
};
|
|
1052
|
-
let
|
|
1052
|
+
let Wt = class extends Xr {
|
|
1053
1053
|
constructor(e, t) {
|
|
1054
1054
|
super(), this._sheetInterceptorService = e, this._formulaDataModel = t, this.disposeWithMe(this._sheetInterceptorService.intercept(
|
|
1055
1055
|
rs.CELL_CONTENT,
|
|
1056
1056
|
{
|
|
1057
1057
|
effect: Qr.Style,
|
|
1058
1058
|
handler: (n, o, r) => {
|
|
1059
|
-
var i,
|
|
1060
|
-
const s = (h = (f = (
|
|
1059
|
+
var i, l, f, h;
|
|
1060
|
+
const s = (h = (f = (l = (i = this._formulaDataModel.getArrayFormulaCellData()) == null ? void 0 : i[o.unitId]) == null ? void 0 : l[o.subUnitId]) == null ? void 0 : f[o.row]) == null ? void 0 : h[o.col];
|
|
1061
1061
|
return !_r(n, !!s) || !n || (n === o.rawData && (n = { ...o.rawData }), n.markers = {
|
|
1062
1062
|
...n == null ? void 0 : n.markers,
|
|
1063
1063
|
...ii
|
|
@@ -1068,14 +1068,14 @@ let Ht = class extends Xr {
|
|
|
1068
1068
|
));
|
|
1069
1069
|
}
|
|
1070
1070
|
};
|
|
1071
|
-
|
|
1072
|
-
Gn(0, j(
|
|
1071
|
+
Wt = si([
|
|
1072
|
+
Gn(0, j(vn)),
|
|
1073
1073
|
Gn(1, j(bt))
|
|
1074
|
-
],
|
|
1074
|
+
], Wt);
|
|
1075
1075
|
function ci() {
|
|
1076
|
-
const e =
|
|
1076
|
+
const e = T(cs), t = T(ve), n = Ce(e.progress$), o = Dt(() => {
|
|
1077
1077
|
t.executeCommand(wo.id);
|
|
1078
|
-
}, [t]), r =
|
|
1078
|
+
}, [t]), r = Dt(() => {
|
|
1079
1079
|
e.clearProgress();
|
|
1080
1080
|
}, [e]);
|
|
1081
1081
|
return /* @__PURE__ */ N(ds, { progress: n, onTerminate: o, onClearProgress: r });
|
|
@@ -1132,7 +1132,7 @@ function St(e) {
|
|
|
1132
1132
|
function li(e) {
|
|
1133
1133
|
const { functionInfo: t, onChange: n } = e;
|
|
1134
1134
|
if (!t) return null;
|
|
1135
|
-
const [o, r] = V([]), [s, c] = V(t.functionParameter), [i,
|
|
1135
|
+
const [o, r] = V([]), [s, c] = V(t.functionParameter), [i, l] = V(-1);
|
|
1136
1136
|
return /* @__PURE__ */ W("div", { children: [
|
|
1137
1137
|
/* @__PURE__ */ N("div", { className: re("univer-h-[364px] univer-overflow-y-auto", lt), children: s.map((f, h) => /* @__PURE__ */ W("div", { children: [
|
|
1138
1138
|
/* @__PURE__ */ N("div", { className: "univer-text-sm", children: f.name }),
|
|
@@ -1162,12 +1162,12 @@ var pe = function() {
|
|
|
1162
1162
|
for (var r = 0, o = Object.getOwnPropertySymbols(e); r < o.length; r++)
|
|
1163
1163
|
t.indexOf(o[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[r]) && (n[o[r]] = e[o[r]]);
|
|
1164
1164
|
return n;
|
|
1165
|
-
},
|
|
1166
|
-
var n = e.icon, o = e.id, r = e.className, s = e.extend, c = ui(e, ["icon", "id", "className", "extend"]), i = "univerjs-icon univerjs-icon-".concat(o, " ").concat(r || "").trim(),
|
|
1167
|
-
return br(n, "".concat(o), { defIds: n.defIds, idSuffix:
|
|
1165
|
+
}, tt = Ae(function(e, t) {
|
|
1166
|
+
var n = e.icon, o = e.id, r = e.className, s = e.extend, c = ui(e, ["icon", "id", "className", "extend"]), i = "univerjs-icon univerjs-icon-".concat(o, " ").concat(r || "").trim(), l = z("_".concat(fi()));
|
|
1167
|
+
return br(n, "".concat(o), { defIds: n.defIds, idSuffix: l.current }, pe({ ref: t, className: i }, c), s);
|
|
1168
1168
|
});
|
|
1169
1169
|
function br(e, t, n, o, r) {
|
|
1170
|
-
return
|
|
1170
|
+
return et(e.tag, pe(pe({ key: t }, di(e, n, r)), o), (hi(e, n).children || []).map(function(s, c) {
|
|
1171
1171
|
return br(s, "".concat(t, "-").concat(e.tag, "-").concat(c), n, void 0, r);
|
|
1172
1172
|
}));
|
|
1173
1173
|
}
|
|
@@ -1192,9 +1192,9 @@ function hi(e, t) {
|
|
|
1192
1192
|
function fi() {
|
|
1193
1193
|
return Math.random().toString(36).substring(2, 8);
|
|
1194
1194
|
}
|
|
1195
|
-
|
|
1195
|
+
tt.displayName = "UniverIcon";
|
|
1196
1196
|
var gi = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, yr = Ae(function(e, t) {
|
|
1197
|
-
return
|
|
1197
|
+
return et(tt, Object.assign({}, e, {
|
|
1198
1198
|
id: "check-mark-icon",
|
|
1199
1199
|
ref: t,
|
|
1200
1200
|
icon: gi
|
|
@@ -1202,7 +1202,7 @@ var gi = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none
|
|
|
1202
1202
|
});
|
|
1203
1203
|
yr.displayName = "CheckMarkIcon";
|
|
1204
1204
|
var mi = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3.71274 2.86421C3.47843 2.6299 3.09853 2.6299 2.86421 2.86421C2.6299 3.09853 2.6299 3.47843 2.86421 3.71274L7.15154 8.00007L2.86421 12.2874C2.6299 12.5217 2.6299 12.9016 2.86421 13.1359C3.09853 13.3702 3.47843 13.3702 3.71274 13.1359L8.00007 8.84859L12.2874 13.1359C12.5217 13.3702 12.9016 13.3702 13.1359 13.1359C13.3702 12.9016 13.3702 12.5217 13.1359 12.2874L8.84859 8.00007L13.1359 3.71274C13.3702 3.47843 13.3702 3.09853 13.1359 2.86421C12.9016 2.6299 12.5217 2.6299 12.2874 2.86421L8.00007 7.15154L3.71274 2.86421Z" } }] }, Tr = Ae(function(e, t) {
|
|
1205
|
-
return
|
|
1205
|
+
return et(tt, Object.assign({}, e, {
|
|
1206
1206
|
id: "close-icon",
|
|
1207
1207
|
ref: t,
|
|
1208
1208
|
icon: mi
|
|
@@ -1210,7 +1210,7 @@ var mi = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none
|
|
|
1210
1210
|
});
|
|
1211
1211
|
Tr.displayName = "CloseIcon";
|
|
1212
1212
|
var pi = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.3313 1.4667C5.3313 1.13533 5.59993 0.866699 5.9313 0.866699H10.069C10.4004 0.866699 10.669 1.13533 10.669 1.4667C10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443C14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928L9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171C10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778L9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539C9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263L6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539C5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778L6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Or = Ae(function(e, t) {
|
|
1213
|
-
return
|
|
1213
|
+
return et(tt, Object.assign({}, e, {
|
|
1214
1214
|
id: "delete-icon",
|
|
1215
1215
|
ref: t,
|
|
1216
1216
|
icon: pi
|
|
@@ -1218,7 +1218,7 @@ var pi = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none
|
|
|
1218
1218
|
});
|
|
1219
1219
|
Or.displayName = "DeleteIcon";
|
|
1220
1220
|
var vi = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z" } }] }, Nr = Ae(function(e, t) {
|
|
1221
|
-
return
|
|
1221
|
+
return et(tt, Object.assign({}, e, {
|
|
1222
1222
|
id: "increase-icon",
|
|
1223
1223
|
ref: t,
|
|
1224
1224
|
icon: vi
|
|
@@ -1226,7 +1226,7 @@ var vi = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none
|
|
|
1226
1226
|
});
|
|
1227
1227
|
Nr.displayName = "IncreaseIcon";
|
|
1228
1228
|
var Si = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.90913 3.57564C6.14345 3.34132 6.52335 3.34132 6.75766 3.57564L10.7577 7.57564C10.992 7.80995 10.992 8.18985 10.7577 8.42417L6.75766 12.4242C6.52335 12.6585 6.14345 12.6585 5.90913 12.4242C5.67482 12.1899 5.67482 11.81 5.90913 11.5756L9.48487 7.9999L5.90913 4.42417C5.67482 4.18985 5.67482 3.80995 5.90913 3.57564Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, xr = Ae(function(e, t) {
|
|
1229
|
-
return
|
|
1229
|
+
return et(tt, Object.assign({}, e, {
|
|
1230
1230
|
id: "more-icon",
|
|
1231
1231
|
ref: t,
|
|
1232
1232
|
icon: Si
|
|
@@ -1234,7 +1234,7 @@ var Si = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none
|
|
|
1234
1234
|
});
|
|
1235
1235
|
xr.displayName = "MoreIcon";
|
|
1236
1236
|
var Ci = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.6185 12.4423C12.5907 12.2749 12.7773 12.15 12.9343 12.2308L15.4242 13.5126C15.6102 13.6084 15.5544 13.8745 15.3439 13.8955L14.2456 14.184L13.4521 15.1286C13.3495 15.2939 13.085 15.2463 13.0534 15.0568L12.6185 12.4423Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1 3.6C1 2.16406 2.16406 1 3.6 1H12.3C13.7359 1 14.9 2.16406 14.9 3.6V5.81156C14.9003 5.81881 14.9004 5.82609 14.9004 5.8334C14.9004 5.84071 14.9003 5.84799 14.9 5.85524V10.045C14.9003 10.0522 14.9004 10.0595 14.9004 10.0668C14.9004 10.3982 14.6318 10.6668 14.3004 10.6668H11.1668C10.8907 10.6668 10.6668 10.8907 10.6668 11.1668V14.3C10.6668 14.6314 10.3982 14.9 10.0668 14.9L10.05 14.8998L3.6 14.9C2.16406 14.9 1 13.7359 1 12.3V3.6ZM13.2 5.2334C13.4761 5.2334 13.7 5.00954 13.7 4.7334V3.6C13.7 2.8268 13.0732 2.2 12.3 2.2H11.1668C10.8907 2.2 10.6668 2.42386 10.6668 2.7V4.7334C10.6668 5.00954 10.8907 5.2334 11.1668 5.2334H13.2ZM10.6668 6.9334C10.6668 6.65726 10.8907 6.4334 11.1668 6.4334H13.2C13.4761 6.4334 13.7 6.65726 13.7 6.9334V8.9668C13.7 9.24294 13.4761 9.4668 13.2 9.4668H11.1668C10.8907 9.4668 10.6668 9.24294 10.6668 8.9668V6.9334ZM8.9668 5.2334C9.24294 5.2334 9.4668 5.00954 9.4668 4.7334V2.7C9.4668 2.42386 9.24294 2.2 8.9668 2.2H6.9334C6.65726 2.2 6.4334 2.42386 6.4334 2.7V4.7334C6.4334 5.00954 6.65726 5.2334 6.9334 5.2334L8.9668 5.2334ZM6.4334 6.9334C6.4334 6.65726 6.65726 6.4334 6.9334 6.4334L8.9668 6.4334C9.24294 6.4334 9.4668 6.65726 9.4668 6.9334V8.9668C9.4668 9.24294 9.24294 9.4668 8.9668 9.4668L6.9334 9.4668C6.65726 9.4668 6.4334 9.24294 6.4334 8.9668V6.9334ZM4.7334 5.2334C5.00954 5.2334 5.2334 5.00954 5.2334 4.7334V2.7C5.2334 2.42386 5.00954 2.2 4.7334 2.2H3.6C2.8268 2.2 2.2 2.8268 2.2 3.6V4.7334C2.2 5.00954 2.42386 5.2334 2.7 5.2334H4.7334ZM2.2 6.9334C2.2 6.65726 2.42386 6.4334 2.7 6.4334H4.7334C5.00954 6.4334 5.2334 6.65725 5.2334 6.9334V8.9668C5.2334 9.24294 5.00954 9.4668 4.7334 9.4668H2.7C2.42386 9.4668 2.2 9.24294 2.2 8.9668V6.9334ZM5.2334 11.1668C5.2334 10.8907 5.00954 10.6668 4.7334 10.6668H2.7C2.42386 10.6668 2.2 10.8907 2.2 11.1668V12.3C2.2 13.0732 2.8268 13.7 3.6 13.7H4.7334C5.00954 13.7 5.2334 13.4761 5.2334 13.2V11.1668ZM9.4668 11.1668C9.4668 10.8907 9.24294 10.6668 8.9668 10.6668H6.9334C6.65726 10.6668 6.4334 10.8907 6.4334 11.1668V13.2C6.4334 13.4761 6.65726 13.7 6.9334 13.7H8.9668C9.24294 13.7 9.4668 13.4761 9.4668 13.2V11.1668Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Mr = Ae(function(e, t) {
|
|
1237
|
-
return
|
|
1237
|
+
return et(tt, Object.assign({}, e, {
|
|
1238
1238
|
id: "select-range-icon",
|
|
1239
1239
|
ref: t,
|
|
1240
1240
|
icon: Ci
|
|
@@ -1242,18 +1242,18 @@ var Ci = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none
|
|
|
1242
1242
|
});
|
|
1243
1243
|
Mr.displayName = "SelectRangeIcon";
|
|
1244
1244
|
function _i(e) {
|
|
1245
|
-
const { onChange: t } = e, n = "-1", [o, r] = V(""), [s, c] = V([]), [i,
|
|
1246
|
-
|
|
1245
|
+
const { onChange: t } = e, n = "-1", [o, r] = V(""), [s, c] = V([]), [i, l] = V(0), [f, h] = V(n), [g, u] = V(0), [d, a] = V(null), S = T(Yt), p = T(dt), v = T(Sn), C = Ce(v.sidebarOptions$), _ = ai(ko, p);
|
|
1246
|
+
_.unshift({
|
|
1247
1247
|
label: p.t("formula.moreFunctions.allFunctions"),
|
|
1248
1248
|
value: n
|
|
1249
1249
|
});
|
|
1250
|
-
const
|
|
1250
|
+
const R = p.t("formula.prompt.required"), m = p.t("formula.prompt.optional");
|
|
1251
1251
|
$(() => {
|
|
1252
1252
|
w(n);
|
|
1253
1253
|
}, []), $(() => {
|
|
1254
1254
|
x(0);
|
|
1255
1255
|
}, [s]), $(() => {
|
|
1256
|
-
C != null && C.visible && (r(""), c([]),
|
|
1256
|
+
C != null && C.visible && (r(""), c([]), l(0), h(n), u(0), a(null), w(n));
|
|
1257
1257
|
}, [C]);
|
|
1258
1258
|
const O = (I) => {
|
|
1259
1259
|
if (o.trim() === "") return I;
|
|
@@ -1261,16 +1261,16 @@ function _i(e) {
|
|
|
1261
1261
|
return I.split(E).filter(Boolean).map((M, D) => M.match(E) ? /* @__PURE__ */ N("span", { className: "univer-text-red-500", children: M }, D) : M);
|
|
1262
1262
|
}, x = (I) => {
|
|
1263
1263
|
if (s.length === 0) {
|
|
1264
|
-
|
|
1264
|
+
a(null);
|
|
1265
1265
|
return;
|
|
1266
1266
|
}
|
|
1267
1267
|
u(I);
|
|
1268
1268
|
const E = S.getFunctionInfo(s[I].name);
|
|
1269
1269
|
if (!E) {
|
|
1270
|
-
|
|
1270
|
+
a(null);
|
|
1271
1271
|
return;
|
|
1272
1272
|
}
|
|
1273
|
-
|
|
1273
|
+
a(E), t(E);
|
|
1274
1274
|
};
|
|
1275
1275
|
function w(I) {
|
|
1276
1276
|
h(I);
|
|
@@ -1282,28 +1282,28 @@ function _i(e) {
|
|
|
1282
1282
|
const E = S.getSearchListByName(I);
|
|
1283
1283
|
c(E);
|
|
1284
1284
|
}
|
|
1285
|
-
function
|
|
1285
|
+
function y(I) {
|
|
1286
1286
|
if (I.stopPropagation(), I.key === "ArrowDown") {
|
|
1287
1287
|
const E = i + 1;
|
|
1288
|
-
|
|
1288
|
+
l(E === s.length ? 0 : E);
|
|
1289
1289
|
} else if (I.key === "ArrowUp") {
|
|
1290
1290
|
const E = i - 1;
|
|
1291
|
-
|
|
1291
|
+
l(E === -1 ? s.length - 1 : E);
|
|
1292
1292
|
} else I.key === "Enter" && x(i);
|
|
1293
1293
|
}
|
|
1294
1294
|
const k = (I) => {
|
|
1295
|
-
|
|
1295
|
+
l(I);
|
|
1296
1296
|
}, A = () => {
|
|
1297
|
-
|
|
1297
|
+
l(-1);
|
|
1298
1298
|
};
|
|
1299
1299
|
return /* @__PURE__ */ W("div", { children: [
|
|
1300
1300
|
/* @__PURE__ */ W("div", { className: "univer-flex univer-items-center univer-justify-between univer-gap-2", children: [
|
|
1301
|
-
/* @__PURE__ */ N(Cs, { value: f, options:
|
|
1301
|
+
/* @__PURE__ */ N(Cs, { value: f, options: _, onChange: w }),
|
|
1302
1302
|
/* @__PURE__ */ N(
|
|
1303
1303
|
mr,
|
|
1304
1304
|
{
|
|
1305
1305
|
placeholder: p.t("formula.moreFunctions.searchFunctionPlaceholder"),
|
|
1306
|
-
onKeyDown:
|
|
1306
|
+
onKeyDown: y,
|
|
1307
1307
|
value: o,
|
|
1308
1308
|
onChange: F,
|
|
1309
1309
|
size: "small",
|
|
@@ -1314,8 +1314,8 @@ function _i(e) {
|
|
|
1314
1314
|
s.length > 0 && /* @__PURE__ */ N(
|
|
1315
1315
|
"ul",
|
|
1316
1316
|
{
|
|
1317
|
-
className: re("univer-m-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",
|
|
1318
|
-
onKeyDown:
|
|
1317
|
+
className: re("univer-m-0 univer-mt-2 univer-box-border univer-max-h-72 univer-w-full univer-select-none univer-list-none univer-overflow-y-auto univer-rounded univer-p-3 univer-outline-none", Cn, lt),
|
|
1318
|
+
onKeyDown: y,
|
|
1319
1319
|
tabIndex: -1,
|
|
1320
1320
|
children: s.map(({ name: I }, E) => /* @__PURE__ */ W(
|
|
1321
1321
|
"li",
|
|
@@ -1360,7 +1360,7 @@ function _i(e) {
|
|
|
1360
1360
|
St,
|
|
1361
1361
|
{
|
|
1362
1362
|
title: I.name,
|
|
1363
|
-
value: `${I.require ?
|
|
1363
|
+
value: `${I.require ? R : m} ${I.detail}`
|
|
1364
1364
|
},
|
|
1365
1365
|
I.name
|
|
1366
1366
|
))
|
|
@@ -1369,8 +1369,8 @@ function _i(e) {
|
|
|
1369
1369
|
}
|
|
1370
1370
|
function Ri() {
|
|
1371
1371
|
const e = vo(), [t, n] = V(!0), [o, r] = V(!1), [s, c] = V(null);
|
|
1372
|
-
|
|
1373
|
-
const i =
|
|
1372
|
+
T(fn);
|
|
1373
|
+
const i = T(dt), l = T(Ge), f = T(ne), h = T(ve);
|
|
1374
1374
|
function g() {
|
|
1375
1375
|
n(!t), r(!o);
|
|
1376
1376
|
}
|
|
@@ -1382,8 +1382,8 @@ function Ri() {
|
|
|
1382
1382
|
unitId: d.unitId,
|
|
1383
1383
|
eventType: we.Dblclick
|
|
1384
1384
|
});
|
|
1385
|
-
const
|
|
1386
|
-
|
|
1385
|
+
const a = l.getEditor(un), S = l.getEditor(Jn), p = `=${s == null ? void 0 : s.functionName}(`;
|
|
1386
|
+
a == null || a.replaceText(p), S == null || S.replaceText(p, !1);
|
|
1387
1387
|
}
|
|
1388
1388
|
return /* @__PURE__ */ W(
|
|
1389
1389
|
"div",
|
|
@@ -1396,7 +1396,7 @@ function Ri() {
|
|
|
1396
1396
|
} }),
|
|
1397
1397
|
/* @__PURE__ */ W("div", { className: "univer-flex univer-justify-end", children: [
|
|
1398
1398
|
o && /* @__PURE__ */ N(
|
|
1399
|
-
|
|
1399
|
+
at,
|
|
1400
1400
|
{
|
|
1401
1401
|
variant: "primary",
|
|
1402
1402
|
onClick: g,
|
|
@@ -1404,9 +1404,9 @@ function Ri() {
|
|
|
1404
1404
|
children: i.t("formula.moreFunctions.next")
|
|
1405
1405
|
}
|
|
1406
1406
|
),
|
|
1407
|
-
o && /* @__PURE__ */ N(
|
|
1407
|
+
o && /* @__PURE__ */ N(at, { onClick: g, className: "univer-mb-5 univer-ml-4 univer-mr-0 univer-mt-0", children: i.t("formula.moreFunctions.prev") }),
|
|
1408
1408
|
t && !!e && /* @__PURE__ */ N(
|
|
1409
|
-
|
|
1409
|
+
at,
|
|
1410
1410
|
{
|
|
1411
1411
|
variant: "primary",
|
|
1412
1412
|
onClick: u,
|
|
@@ -1424,15 +1424,15 @@ function Ei(e) {
|
|
|
1424
1424
|
id: Se.id,
|
|
1425
1425
|
title: "SUM",
|
|
1426
1426
|
icon: "SumIcon",
|
|
1427
|
-
type:
|
|
1427
|
+
type: Je.BUTTON,
|
|
1428
1428
|
params: {
|
|
1429
1429
|
value: "SUM"
|
|
1430
1430
|
},
|
|
1431
1431
|
hidden$: ft(e, H.UNIVER_SHEET),
|
|
1432
|
-
disabled$:
|
|
1433
|
-
workbookTypes: [
|
|
1434
|
-
worksheetTypes: [
|
|
1435
|
-
rangeTypes: [
|
|
1432
|
+
disabled$: Ye(e, {
|
|
1433
|
+
workbookTypes: [Qe],
|
|
1434
|
+
worksheetTypes: [ze, Ze],
|
|
1435
|
+
rangeTypes: [Xe]
|
|
1436
1436
|
})
|
|
1437
1437
|
};
|
|
1438
1438
|
}
|
|
@@ -1441,15 +1441,15 @@ function Ii(e) {
|
|
|
1441
1441
|
id: Se.id,
|
|
1442
1442
|
title: "COUNT",
|
|
1443
1443
|
icon: "CntIcon",
|
|
1444
|
-
type:
|
|
1444
|
+
type: Je.BUTTON,
|
|
1445
1445
|
params: {
|
|
1446
1446
|
value: "COUNT"
|
|
1447
1447
|
},
|
|
1448
1448
|
hidden$: ft(e, H.UNIVER_SHEET),
|
|
1449
|
-
disabled$:
|
|
1450
|
-
workbookTypes: [
|
|
1451
|
-
worksheetTypes: [
|
|
1452
|
-
rangeTypes: [
|
|
1449
|
+
disabled$: Ye(e, {
|
|
1450
|
+
workbookTypes: [Qe],
|
|
1451
|
+
worksheetTypes: [ze, Ze],
|
|
1452
|
+
rangeTypes: [Xe]
|
|
1453
1453
|
})
|
|
1454
1454
|
};
|
|
1455
1455
|
}
|
|
@@ -1458,15 +1458,15 @@ function bi(e) {
|
|
|
1458
1458
|
id: Se.id,
|
|
1459
1459
|
title: "AVERAGE",
|
|
1460
1460
|
icon: "AvgIcon",
|
|
1461
|
-
type:
|
|
1461
|
+
type: Je.BUTTON,
|
|
1462
1462
|
params: {
|
|
1463
1463
|
value: "AVERAGE"
|
|
1464
1464
|
},
|
|
1465
1465
|
hidden$: ft(e, H.UNIVER_SHEET),
|
|
1466
|
-
disabled$:
|
|
1467
|
-
workbookTypes: [
|
|
1468
|
-
worksheetTypes: [
|
|
1469
|
-
rangeTypes: [
|
|
1466
|
+
disabled$: Ye(e, {
|
|
1467
|
+
workbookTypes: [Qe],
|
|
1468
|
+
worksheetTypes: [ze, Ze],
|
|
1469
|
+
rangeTypes: [Xe]
|
|
1470
1470
|
})
|
|
1471
1471
|
};
|
|
1472
1472
|
}
|
|
@@ -1475,15 +1475,15 @@ function yi(e) {
|
|
|
1475
1475
|
id: Se.id,
|
|
1476
1476
|
title: "MAX",
|
|
1477
1477
|
icon: "MaxIcon",
|
|
1478
|
-
type:
|
|
1478
|
+
type: Je.BUTTON,
|
|
1479
1479
|
params: {
|
|
1480
1480
|
value: "MAX"
|
|
1481
1481
|
},
|
|
1482
1482
|
hidden$: ft(e, H.UNIVER_SHEET),
|
|
1483
|
-
disabled$:
|
|
1484
|
-
workbookTypes: [
|
|
1485
|
-
worksheetTypes: [
|
|
1486
|
-
rangeTypes: [
|
|
1483
|
+
disabled$: Ye(e, {
|
|
1484
|
+
workbookTypes: [Qe],
|
|
1485
|
+
worksheetTypes: [ze, Ze],
|
|
1486
|
+
rangeTypes: [Xe]
|
|
1487
1487
|
})
|
|
1488
1488
|
};
|
|
1489
1489
|
}
|
|
@@ -1492,29 +1492,29 @@ function Ti(e) {
|
|
|
1492
1492
|
id: Se.id,
|
|
1493
1493
|
title: "MIN",
|
|
1494
1494
|
icon: "MinIcon",
|
|
1495
|
-
type:
|
|
1495
|
+
type: Je.BUTTON,
|
|
1496
1496
|
params: {
|
|
1497
1497
|
value: "MIN"
|
|
1498
1498
|
},
|
|
1499
1499
|
hidden$: ft(e, H.UNIVER_SHEET),
|
|
1500
|
-
disabled$:
|
|
1501
|
-
workbookTypes: [
|
|
1502
|
-
worksheetTypes: [
|
|
1503
|
-
rangeTypes: [
|
|
1500
|
+
disabled$: Ye(e, {
|
|
1501
|
+
workbookTypes: [Qe],
|
|
1502
|
+
worksheetTypes: [ze, Ze],
|
|
1503
|
+
rangeTypes: [Xe]
|
|
1504
1504
|
})
|
|
1505
1505
|
};
|
|
1506
1506
|
}
|
|
1507
1507
|
function Oi(e) {
|
|
1508
1508
|
return {
|
|
1509
|
-
id:
|
|
1509
|
+
id: Rn.id,
|
|
1510
1510
|
title: "formula.insert.more",
|
|
1511
1511
|
tooltip: "formula.insert.tooltip",
|
|
1512
|
-
type:
|
|
1512
|
+
type: Je.BUTTON,
|
|
1513
1513
|
hidden$: ft(e, H.UNIVER_SHEET),
|
|
1514
|
-
disabled$:
|
|
1515
|
-
workbookTypes: [
|
|
1516
|
-
worksheetTypes: [
|
|
1517
|
-
rangeTypes: [
|
|
1514
|
+
disabled$: Ye(e, {
|
|
1515
|
+
workbookTypes: [Qe],
|
|
1516
|
+
worksheetTypes: [ze, Ze],
|
|
1517
|
+
rangeTypes: [Xe]
|
|
1518
1518
|
})
|
|
1519
1519
|
};
|
|
1520
1520
|
}
|
|
@@ -1525,14 +1525,14 @@ function Ni(e) {
|
|
|
1525
1525
|
}
|
|
1526
1526
|
function xi(e) {
|
|
1527
1527
|
return {
|
|
1528
|
-
id:
|
|
1529
|
-
type:
|
|
1528
|
+
id: _n.id,
|
|
1529
|
+
type: Je.BUTTON,
|
|
1530
1530
|
title: "formula.operation.pasteFormula",
|
|
1531
1531
|
disabled$: Ni(e).pipe(
|
|
1532
|
-
Vo(
|
|
1533
|
-
workbookTypes: [
|
|
1534
|
-
rangeTypes: [
|
|
1535
|
-
worksheetTypes: [
|
|
1532
|
+
Vo(Ye(e, {
|
|
1533
|
+
workbookTypes: [Qe],
|
|
1534
|
+
rangeTypes: [Xe],
|
|
1535
|
+
worksheetTypes: [Ze, ze]
|
|
1536
1536
|
})),
|
|
1537
1537
|
cr(([t, n]) => t || n)
|
|
1538
1538
|
)
|
|
@@ -1562,23 +1562,23 @@ const Mi = {
|
|
|
1562
1562
|
}
|
|
1563
1563
|
},
|
|
1564
1564
|
[Bn.OTHERS]: {
|
|
1565
|
-
[
|
|
1565
|
+
[Rn.id]: {
|
|
1566
1566
|
order: 0,
|
|
1567
1567
|
menuItemFactory: Oi
|
|
1568
1568
|
}
|
|
1569
1569
|
},
|
|
1570
1570
|
[So]: {
|
|
1571
|
-
[
|
|
1571
|
+
[_n.id]: {
|
|
1572
1572
|
order: 4,
|
|
1573
1573
|
menuItemFactory: xi
|
|
1574
1574
|
}
|
|
1575
1575
|
}
|
|
1576
|
-
}, wi = "meta_key_ctrl_And_Shift",
|
|
1576
|
+
}, wi = "meta_key_ctrl_And_Shift", zt = [
|
|
1577
1577
|
L.ARROW_DOWN,
|
|
1578
1578
|
L.ARROW_UP,
|
|
1579
1579
|
L.ARROW_LEFT,
|
|
1580
1580
|
L.ARROW_RIGHT
|
|
1581
|
-
], ki = [...
|
|
1581
|
+
], ki = [...zt, L.ENTER, L.TAB, L.ESC];
|
|
1582
1582
|
function Ai() {
|
|
1583
1583
|
const e = [];
|
|
1584
1584
|
for (const t of ki)
|
|
@@ -1595,7 +1595,7 @@ function Ai() {
|
|
|
1595
1595
|
}
|
|
1596
1596
|
function Fi() {
|
|
1597
1597
|
const e = [];
|
|
1598
|
-
for (const t of
|
|
1598
|
+
for (const t of zt)
|
|
1599
1599
|
e.push({
|
|
1600
1600
|
id: gt.id,
|
|
1601
1601
|
binding: t | P.SHIFT,
|
|
@@ -1610,7 +1610,7 @@ function Fi() {
|
|
|
1610
1610
|
}
|
|
1611
1611
|
function Di() {
|
|
1612
1612
|
const e = [];
|
|
1613
|
-
for (const t of
|
|
1613
|
+
for (const t of zt)
|
|
1614
1614
|
e.push({
|
|
1615
1615
|
id: gt.id,
|
|
1616
1616
|
binding: t | P.CTRL_COMMAND,
|
|
@@ -1625,7 +1625,7 @@ function Di() {
|
|
|
1625
1625
|
}
|
|
1626
1626
|
function Li() {
|
|
1627
1627
|
const e = [];
|
|
1628
|
-
for (const t of
|
|
1628
|
+
for (const t of zt)
|
|
1629
1629
|
e.push({
|
|
1630
1630
|
id: gt.id,
|
|
1631
1631
|
binding: t | P.SHIFT | P.CTRL_COMMAND,
|
|
@@ -1671,7 +1671,7 @@ var Vi = Object.getOwnPropertyDescriptor, Wi = (e, t, n, o) => {
|
|
|
1671
1671
|
(c = e[s]) && (r = c(r) || r);
|
|
1672
1672
|
return r;
|
|
1673
1673
|
}, Be = (e, t) => (n, o) => t(n, o, e);
|
|
1674
|
-
let
|
|
1674
|
+
let Ht = class extends ut {
|
|
1675
1675
|
constructor(e, t, n, o, r, s, c) {
|
|
1676
1676
|
super(), this._injector = e, this._menuManagerService = t, this._commandService = n, this._shortcutService = o, this._uiPartsService = r, this._renderManagerService = s, this._componentManager = c, this._initialize();
|
|
1677
1677
|
}
|
|
@@ -1683,9 +1683,9 @@ let Bt = class extends ut {
|
|
|
1683
1683
|
}
|
|
1684
1684
|
_registerCommands() {
|
|
1685
1685
|
[
|
|
1686
|
-
|
|
1686
|
+
_n,
|
|
1687
1687
|
Se,
|
|
1688
|
-
|
|
1688
|
+
Rn,
|
|
1689
1689
|
Ds,
|
|
1690
1690
|
Ns,
|
|
1691
1691
|
gt,
|
|
@@ -1709,18 +1709,18 @@ let Bt = class extends ut {
|
|
|
1709
1709
|
this.disposeWithMe(this._uiPartsService.registerComponent(_o.FORMULA_AUX, () => gr(ci, this._injector))), this._componentManager.register(Sr, Ri);
|
|
1710
1710
|
}
|
|
1711
1711
|
_registerRenderModules() {
|
|
1712
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(H.UNIVER_SHEET, [
|
|
1712
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(H.UNIVER_SHEET, [Vt]));
|
|
1713
1713
|
}
|
|
1714
1714
|
};
|
|
1715
|
-
|
|
1715
|
+
Ht = Wi([
|
|
1716
1716
|
Be(0, j(Rt)),
|
|
1717
1717
|
Be(1, hs),
|
|
1718
1718
|
Be(2, ve),
|
|
1719
|
-
Be(3,
|
|
1719
|
+
Be(3, Gt),
|
|
1720
1720
|
Be(4, hr),
|
|
1721
1721
|
Be(5, ke),
|
|
1722
1722
|
Be(6, j(fr))
|
|
1723
|
-
],
|
|
1723
|
+
], Ht);
|
|
1724
1724
|
class wr {
|
|
1725
1725
|
constructor() {
|
|
1726
1726
|
q(this, "_currentSelector$", new ar(null));
|
|
@@ -1739,7 +1739,7 @@ var Hi = Object.getOwnPropertyDescriptor, Bi = (e, t, n, o) => {
|
|
|
1739
1739
|
for (var r = o > 1 ? void 0 : o ? Hi(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
1740
1740
|
(c = e[s]) && (r = c(r) || r);
|
|
1741
1741
|
return r;
|
|
1742
|
-
},
|
|
1742
|
+
}, it = (e, t) => (n, o) => t(n, o, e);
|
|
1743
1743
|
let Pe = class extends Ro {
|
|
1744
1744
|
constructor(t, n, o, r, s, c, i) {
|
|
1745
1745
|
super(
|
|
@@ -1786,26 +1786,26 @@ let Pe = class extends Ro {
|
|
|
1786
1786
|
}
|
|
1787
1787
|
_initCanvasEventListeners() {
|
|
1788
1788
|
const t = this._getSheetObject(), { spreadsheetRowHeader: n, spreadsheetColumnHeader: o, spreadsheet: r, spreadsheetLeftTopPlaceholder: s } = t, { scene: c } = this._context, i = new qe();
|
|
1789
|
-
return i.add(r == null ? void 0 : r.onPointerDown$.subscribeEvent((
|
|
1790
|
-
this.inRefSelectionMode() && (this._onPointerDown(
|
|
1789
|
+
return i.add(r == null ? void 0 : r.onPointerDown$.subscribeEvent((l, f) => {
|
|
1790
|
+
this.inRefSelectionMode() && (this._onPointerDown(l, r.zIndex + 1, Re.NORMAL, this._getActiveViewport(l)), l.button !== 2 && f.stopPropagation());
|
|
1791
1791
|
})), i.add(
|
|
1792
|
-
n == null ? void 0 : n.onPointerDown$.subscribeEvent((
|
|
1792
|
+
n == null ? void 0 : n.onPointerDown$.subscribeEvent((l, f) => {
|
|
1793
1793
|
if (!this.inRefSelectionMode()) return;
|
|
1794
|
-
const h = this._sheetSkeletonManagerService.getCurrent().skeleton, { row: g } = wn(
|
|
1795
|
-
kn(this._workbookSelections.getCurrentSelections(), g, Re.ROW) || (this._onPointerDown(
|
|
1794
|
+
const h = this._sheetSkeletonManagerService.getCurrent().skeleton, { row: g } = wn(l.offsetX, l.offsetY, c, h);
|
|
1795
|
+
kn(this._workbookSelections.getCurrentSelections(), g, Re.ROW) || (this._onPointerDown(l, (r.zIndex || 1) + 1, Re.ROW, this._getActiveViewport(l), Jt.Y), l.button !== 2 && f.stopPropagation());
|
|
1796
1796
|
})
|
|
1797
|
-
), i.add(o == null ? void 0 : o.onPointerDown$.subscribeEvent((
|
|
1797
|
+
), i.add(o == null ? void 0 : o.onPointerDown$.subscribeEvent((l, f) => {
|
|
1798
1798
|
if (!this.inRefSelectionMode()) return;
|
|
1799
|
-
const h = this._sheetSkeletonManagerService.getCurrent().skeleton, { column: g } = wn(
|
|
1800
|
-
kn(this._workbookSelections.getCurrentSelections(), g, Re.COLUMN) || (this._onPointerDown(
|
|
1801
|
-
})), i.add(s == null ? void 0 : s.onPointerDown$.subscribeEvent((
|
|
1799
|
+
const h = this._sheetSkeletonManagerService.getCurrent().skeleton, { column: g } = wn(l.offsetX, l.offsetY, c, h);
|
|
1800
|
+
kn(this._workbookSelections.getCurrentSelections(), g, Re.COLUMN) || (this._onPointerDown(l, (r.zIndex || 1) + 1, Re.COLUMN, this._getActiveViewport(l), Jt.X), l.button !== 2 && f.stopPropagation());
|
|
1801
|
+
})), i.add(s == null ? void 0 : s.onPointerDown$.subscribeEvent((l, f) => {
|
|
1802
1802
|
if (this._reset(), !this.inRefSelectionMode()) return;
|
|
1803
1803
|
const h = this._sheetSkeletonManagerService.getCurrent().skeleton, g = Eo(h);
|
|
1804
1804
|
this._addSelectionControlByModelData(g), this._selectionMoveStart$.next(this.getSelectionDataWithStyle());
|
|
1805
1805
|
const u = c.onPointerUp$.subscribeEvent(() => {
|
|
1806
1806
|
u.unsubscribe(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle());
|
|
1807
1807
|
});
|
|
1808
|
-
|
|
1808
|
+
l.button !== 2 && f.stopPropagation();
|
|
1809
1809
|
})), i;
|
|
1810
1810
|
}
|
|
1811
1811
|
/**
|
|
@@ -1828,11 +1828,11 @@ let Pe = class extends Ro {
|
|
|
1828
1828
|
*/
|
|
1829
1829
|
_initUserActionSyncListener() {
|
|
1830
1830
|
this.disposeWithMe(this.selectionMoveStart$.subscribe((t) => {
|
|
1831
|
-
this._updateSelections(t,
|
|
1831
|
+
this._updateSelections(t, en.MOVE_START);
|
|
1832
1832
|
})), this.disposeWithMe(this.selectionMoving$.subscribe((t) => {
|
|
1833
|
-
this._updateSelections(t,
|
|
1833
|
+
this._updateSelections(t, en.MOVING);
|
|
1834
1834
|
})), this.disposeWithMe(this.selectionMoveEnd$.subscribe((t) => {
|
|
1835
|
-
this._updateSelections(t,
|
|
1835
|
+
this._updateSelections(t, en.MOVE_END);
|
|
1836
1836
|
}));
|
|
1837
1837
|
}
|
|
1838
1838
|
_updateSelections(t, n) {
|
|
@@ -1871,18 +1871,18 @@ let Pe = class extends Ro {
|
|
|
1871
1871
|
* @param scrollTimerType
|
|
1872
1872
|
*/
|
|
1873
1873
|
// eslint-disable-next-line complexity, max-lines-per-function
|
|
1874
|
-
_onPointerDown(t, n = 0, o = Re.NORMAL, r, s =
|
|
1875
|
-
var
|
|
1874
|
+
_onPointerDown(t, n = 0, o = Re.NORMAL, r, s = Jt.ALL) {
|
|
1875
|
+
var y;
|
|
1876
1876
|
this._rangeType = o;
|
|
1877
1877
|
const c = this._skeleton, i = this._scene;
|
|
1878
1878
|
if (!i || !c)
|
|
1879
1879
|
return;
|
|
1880
1880
|
r && (this._activeViewport = r);
|
|
1881
|
-
const { offsetX:
|
|
1881
|
+
const { offsetX: l, offsetY: f } = t, h = i.getViewport(Pn.VIEW_MAIN);
|
|
1882
1882
|
if (!h) return;
|
|
1883
|
-
const g = i.getCoordRelativeToViewport(Un.FromArray([
|
|
1883
|
+
const g = i.getCoordRelativeToViewport(Un.FromArray([l, f])), { x: u, y: d } = g;
|
|
1884
1884
|
this._startViewportPosX = u, this._startViewportPosY = d;
|
|
1885
|
-
const
|
|
1885
|
+
const a = i.getScrollXYInfoByViewport(g), { scaleX: S, scaleY: p } = i.getAncestorScale(), v = this._skeleton.getCellByOffset(u, d, S, p, a);
|
|
1886
1886
|
if (!v) return;
|
|
1887
1887
|
switch (o) {
|
|
1888
1888
|
case Re.NORMAL:
|
|
@@ -1898,17 +1898,17 @@ let Pe = class extends Ro {
|
|
|
1898
1898
|
}
|
|
1899
1899
|
const C = { range: v, primary: v, style: null };
|
|
1900
1900
|
C.range.rangeType = o;
|
|
1901
|
-
const
|
|
1902
|
-
this._startRangeWhenPointerDown = { ...
|
|
1903
|
-
const
|
|
1901
|
+
const _ = rn(C, this._skeleton);
|
|
1902
|
+
this._startRangeWhenPointerDown = { ..._.rangeWithCoord };
|
|
1903
|
+
const R = { ..._.rangeWithCoord, rangeType: o };
|
|
1904
1904
|
let m = this.getActiveSelectionControl();
|
|
1905
1905
|
const O = this.getSelectionControls();
|
|
1906
1906
|
for (const k of O) {
|
|
1907
|
-
if (t.button === 2 && Qn.contains(k.model,
|
|
1907
|
+
if (t.button === 2 && Qn.contains(k.model, R)) {
|
|
1908
1908
|
m = k;
|
|
1909
1909
|
return;
|
|
1910
1910
|
}
|
|
1911
|
-
if (k.model.isEqual(
|
|
1911
|
+
if (k.model.isEqual(R)) {
|
|
1912
1912
|
m = k;
|
|
1913
1913
|
break;
|
|
1914
1914
|
}
|
|
@@ -1917,15 +1917,15 @@ let Pe = class extends Ro {
|
|
|
1917
1917
|
const x = m == null ? void 0 : m.model.currentCell, w = t.shiftKey && x, F = this._remainLastEnabled && !t.ctrlKey && !t.shiftKey && !this._skipLastEnabled && !this._singleSelectionEnabled;
|
|
1918
1918
|
w && x ? this._makeSelectionByTwoCells(
|
|
1919
1919
|
x,
|
|
1920
|
-
|
|
1920
|
+
R,
|
|
1921
1921
|
c,
|
|
1922
1922
|
o,
|
|
1923
1923
|
m
|
|
1924
1924
|
// Get updated in this method
|
|
1925
|
-
) : F && m ? m.updateRangeBySelectionWithCoord(
|
|
1925
|
+
) : F && m ? m.updateRangeBySelectionWithCoord(_) : m = this.newSelectionControl(i, c, C);
|
|
1926
1926
|
for (let k = 0; k < this.getSelectionControls().length - 1; k++)
|
|
1927
1927
|
this.getSelectionControls()[k].clearHighlight();
|
|
1928
|
-
this._selectionMoveStart$.next(this.getSelectionDataWithStyle()), this._clearUpdatingListeners(), this._addEndingListeners(), (
|
|
1928
|
+
this._selectionMoveStart$.next(this.getSelectionDataWithStyle()), i.disableObjectsEvent(), this._clearUpdatingListeners(), this._addEndingListeners(), (y = i.getTransformer()) == null || y.clearSelectedObjects(), this._setupPointerMoveListener(h, m, o, s, u, d), this._escapeShortcutDisposable = this._shortcutService.forceEscape(), this._scenePointerUpSub = i.onPointerUp$.subscribeEvent(() => {
|
|
1929
1929
|
var k;
|
|
1930
1930
|
this._clearUpdatingListeners(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle()), (k = this._escapeShortcutDisposable) == null || k.dispose(), this._escapeShortcutDisposable = null;
|
|
1931
1931
|
});
|
|
@@ -1943,8 +1943,8 @@ let Pe = class extends Ro {
|
|
|
1943
1943
|
enableAutoFill: !1,
|
|
1944
1944
|
rowHeaderWidth: s,
|
|
1945
1945
|
columnHeaderHeight: c
|
|
1946
|
-
}),
|
|
1947
|
-
return i.updateRangeBySelectionWithCoord(
|
|
1946
|
+
}), l = rn(o, n);
|
|
1947
|
+
return i.updateRangeBySelectionWithCoord(l), this._selectionControls.push(i), i.setControlExtension({
|
|
1948
1948
|
skeleton: n,
|
|
1949
1949
|
scene: t,
|
|
1950
1950
|
themeService: this._themeService,
|
|
@@ -1958,18 +1958,18 @@ let Pe = class extends Ro {
|
|
|
1958
1958
|
}
|
|
1959
1959
|
};
|
|
1960
1960
|
Pe = Bi([
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1961
|
+
it(1, j(Rt)),
|
|
1962
|
+
it(2, j(Et)),
|
|
1963
|
+
it(3, Gt),
|
|
1964
|
+
it(4, j(qt)),
|
|
1965
|
+
it(5, ln),
|
|
1966
|
+
it(6, Kt)
|
|
1967
1967
|
], Pe);
|
|
1968
1968
|
function ji(e) {
|
|
1969
1969
|
const t = sr(e);
|
|
1970
1970
|
return t.widgets = { tl: !0, tc: !0, tr: !0, ml: !0, mr: !0, bl: !0, bc: !0, br: !0 }, t;
|
|
1971
1971
|
}
|
|
1972
|
-
const
|
|
1972
|
+
const En = (e, t, n = !0) => {
|
|
1973
1973
|
let o = -1;
|
|
1974
1974
|
return e.reduce((r, s, c) => {
|
|
1975
1975
|
if (r.isFinish)
|
|
@@ -1978,8 +1978,8 @@ const In = (e, t, n = !0) => {
|
|
|
1978
1978
|
if (typeof s != "string")
|
|
1979
1979
|
r.currentIndex += s.token.length;
|
|
1980
1980
|
else {
|
|
1981
|
-
const
|
|
1982
|
-
r.currentIndex +=
|
|
1981
|
+
const l = s.length;
|
|
1982
|
+
r.currentIndex += l;
|
|
1983
1983
|
}
|
|
1984
1984
|
return (n ? r.currentIndex === t : t > i && t <= r.currentIndex) && (o = c, r.isFinish = !0), r;
|
|
1985
1985
|
}, { currentIndex: 0, isFinish: !1 }), o;
|
|
@@ -2006,36 +2006,36 @@ const In = (e, t, n = !0) => {
|
|
|
2006
2006
|
}, [e, t]);
|
|
2007
2007
|
};
|
|
2008
2008
|
function Ar(e, t, n) {
|
|
2009
|
-
const o =
|
|
2010
|
-
var
|
|
2011
|
-
const
|
|
2012
|
-
if (!
|
|
2009
|
+
const o = T(Ge), r = se(() => new ar({ left: -999, top: -999, right: -999, bottom: -999 }), []), s = T(Sn), c = T(ne), i = te(() => {
|
|
2010
|
+
var _;
|
|
2011
|
+
const l = o.getEditor(e);
|
|
2012
|
+
if (!l)
|
|
2013
2013
|
return;
|
|
2014
|
-
const f =
|
|
2014
|
+
const f = l.getBoundingClientRect(), { marginTop: h = 0, marginBottom: g = 0 } = l.getDocumentData().documentStyle, u = l.getSkeleton();
|
|
2015
2015
|
if (!u) return;
|
|
2016
|
-
const d = (
|
|
2017
|
-
let { left:
|
|
2016
|
+
const d = (_ = u.getSkeletonData()) == null ? void 0 : _.pages[0].height;
|
|
2017
|
+
let { left: a, top: S, right: p, bottom: v } = f;
|
|
2018
2018
|
S = S + h, v = d ? S + d : v - g;
|
|
2019
2019
|
const C = r.getValue();
|
|
2020
|
-
if (!(C.left ===
|
|
2021
|
-
return r.next({ left:
|
|
2020
|
+
if (!(C.left === a && C.top === S && C.right === p && C.bottom === v))
|
|
2021
|
+
return r.next({ left: a - 1, right: p + 1, top: S - 1, bottom: v + 1 }), f;
|
|
2022
2022
|
});
|
|
2023
2023
|
return $(() => {
|
|
2024
2024
|
t && i();
|
|
2025
2025
|
}, [e, o, c.unitAdded$, i, t, ...n != null ? n : []]), qi(i), $(() => {
|
|
2026
|
-
const
|
|
2026
|
+
const l = s.scrollEvent$.pipe(Bo(100)).subscribe(i);
|
|
2027
2027
|
return () => {
|
|
2028
|
-
|
|
2028
|
+
l.unsubscribe();
|
|
2029
2029
|
};
|
|
2030
2030
|
}, []), [r, i];
|
|
2031
2031
|
}
|
|
2032
|
-
const
|
|
2032
|
+
const nt = (e) => {
|
|
2033
2033
|
const t = z(e);
|
|
2034
2034
|
return t.current = e, t;
|
|
2035
2035
|
}, Ki = (e, t, n) => {
|
|
2036
|
-
const o =
|
|
2036
|
+
const o = T(Zt), r = T(Yt), s = T(Ie), [c, i] = V(), [l, f] = V(-1), [h, g] = V(!0), u = nt(h), d = z(t);
|
|
2037
2037
|
d.current = t;
|
|
2038
|
-
const
|
|
2038
|
+
const a = () => {
|
|
2039
2039
|
i(void 0), f(-1), g(!1);
|
|
2040
2040
|
};
|
|
2041
2041
|
return $(() => {
|
|
@@ -2043,21 +2043,21 @@ const tt = (e) => {
|
|
|
2043
2043
|
o.setSequenceNodes(S != null ? S : []);
|
|
2044
2044
|
}, [t]), $(() => {
|
|
2045
2045
|
if (n && e) {
|
|
2046
|
-
const S = n.selectionChange$.pipe(
|
|
2046
|
+
const S = n.selectionChange$.pipe(gn(50)).subscribe((v) => {
|
|
2047
2047
|
if (v.textRanges.length === 1) {
|
|
2048
2048
|
const [C] = v.textRanges;
|
|
2049
2049
|
if (C.collapsed && u.current) {
|
|
2050
|
-
const { startOffset:
|
|
2051
|
-
if (
|
|
2052
|
-
if (typeof
|
|
2053
|
-
const
|
|
2054
|
-
i(
|
|
2050
|
+
const { startOffset: _ } = C, R = o.getCurrentSequenceNodeIndex(_ - 2), m = o.getCurrentSequenceNodeByIndex(R), O = o.getCurrentSequenceNodeByIndex(R + 1);
|
|
2051
|
+
if (m)
|
|
2052
|
+
if (typeof m != "string" && m.nodeType === 3 && !r.hasDefinedNameDescription(m.token.trim()) && O === Ke.OPEN_BRACKET) {
|
|
2053
|
+
const x = r.getFunctionInfo(m.token);
|
|
2054
|
+
i(x), f(-1);
|
|
2055
2055
|
return;
|
|
2056
2056
|
} else {
|
|
2057
|
-
const
|
|
2058
|
-
if (
|
|
2059
|
-
const { functionName:
|
|
2060
|
-
i(
|
|
2057
|
+
const x = s.getFunctionAndParameter(`${d.current}A`, _ - 1);
|
|
2058
|
+
if (x) {
|
|
2059
|
+
const { functionName: w, paramIndex: F } = x, y = r.getFunctionInfo(w);
|
|
2060
|
+
i(y), f(F);
|
|
2061
2061
|
return;
|
|
2062
2062
|
}
|
|
2063
2063
|
}
|
|
@@ -2076,11 +2076,11 @@ const tt = (e) => {
|
|
|
2076
2076
|
};
|
|
2077
2077
|
}
|
|
2078
2078
|
}, [n, e]), $(() => {
|
|
2079
|
-
e ||
|
|
2079
|
+
e || a();
|
|
2080
2080
|
}, [e]), {
|
|
2081
2081
|
functionInfo: c,
|
|
2082
|
-
paramIndex:
|
|
2083
|
-
reset:
|
|
2082
|
+
paramIndex: l,
|
|
2083
|
+
reset: a
|
|
2084
2084
|
};
|
|
2085
2085
|
}, Yi = ({ onClick: e }) => /* @__PURE__ */ N(
|
|
2086
2086
|
"div",
|
|
@@ -2089,7 +2089,7 @@ const tt = (e) => {
|
|
|
2089
2089
|
onClick: e,
|
|
2090
2090
|
children: "?"
|
|
2091
2091
|
}
|
|
2092
|
-
),
|
|
2092
|
+
), nn = ({ className: e, title: t, value: n }) => /* @__PURE__ */ W("div", { className: "univer-my-2", children: [
|
|
2093
2093
|
/* @__PURE__ */ N(
|
|
2094
2094
|
"div",
|
|
2095
2095
|
{
|
|
@@ -2127,19 +2127,19 @@ const tt = (e) => {
|
|
|
2127
2127
|
}, Zn = () => {
|
|
2128
2128
|
};
|
|
2129
2129
|
function Zi(e) {
|
|
2130
|
-
const { onParamsSwitch: t = Zn, onClose: n = Zn, isFocus: o, editor: r, formulaText: s } = e, { functionInfo: c, paramIndex: i, reset:
|
|
2130
|
+
const { onParamsSwitch: t = Zn, onClose: n = Zn, isFocus: o, editor: r, formulaText: s } = e, { functionInfo: c, paramIndex: i, reset: l } = Ki(o, s, r), f = T(fn), h = !Ce(f.helpFunctionVisible$), [g, u] = V(!0), d = T(dt), a = d.t("formula.prompt.required"), S = d.t("formula.prompt.optional"), p = r.getEditorId(), [v] = Ar(p, !!c, [c, i]);
|
|
2131
2131
|
function C(m) {
|
|
2132
2132
|
t && t(m);
|
|
2133
2133
|
}
|
|
2134
|
-
const
|
|
2134
|
+
const _ = te((m) => {
|
|
2135
2135
|
f.helpFunctionVisible$.next(!m);
|
|
2136
|
-
}),
|
|
2137
|
-
|
|
2136
|
+
}), R = () => {
|
|
2137
|
+
_(!0), n();
|
|
2138
2138
|
};
|
|
2139
|
-
return c ? h ? /* @__PURE__ */ N(
|
|
2139
|
+
return c ? h ? /* @__PURE__ */ N(on, { portal: !0, anchorRect$: v, direction: "left-center", children: /* @__PURE__ */ N(Yi, { onClick: () => _(!1) }) }, "hidden") : /* @__PURE__ */ N(on, { portal: !0, onClickOutside: () => l(), anchorRect$: v, direction: "vertical", children: /* @__PURE__ */ W(
|
|
2140
2140
|
"div",
|
|
2141
2141
|
{
|
|
2142
|
-
className: re("univer-m-0 univer-box-border univer-w-[250px] univer-select-none univer-list-none univer-rounded-lg univer-bg-white univer-leading-5 univer-shadow-md univer-outline-none dark:!univer-bg-gray-900",
|
|
2142
|
+
className: re("univer-m-0 univer-box-border univer-w-[250px] univer-select-none univer-list-none univer-rounded-lg univer-bg-white univer-leading-5 univer-shadow-md univer-outline-none dark:!univer-bg-gray-900", Cn),
|
|
2143
2143
|
children: [
|
|
2144
2144
|
/* @__PURE__ */ W(
|
|
2145
2145
|
"div",
|
|
@@ -2169,7 +2169,7 @@ function Zi(e) {
|
|
|
2169
2169
|
"div",
|
|
2170
2170
|
{
|
|
2171
2171
|
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",
|
|
2172
|
-
onClick:
|
|
2172
|
+
onClick: R,
|
|
2173
2173
|
children: /* @__PURE__ */ N(Tr, {})
|
|
2174
2174
|
}
|
|
2175
2175
|
)
|
|
@@ -2187,25 +2187,25 @@ function Zi(e) {
|
|
|
2187
2187
|
},
|
|
2188
2188
|
children: /* @__PURE__ */ W("div", { className: "univer-mt-3", children: [
|
|
2189
2189
|
/* @__PURE__ */ N(
|
|
2190
|
-
|
|
2190
|
+
nn,
|
|
2191
2191
|
{
|
|
2192
2192
|
title: d.t("formula.prompt.helpExample"),
|
|
2193
2193
|
value: `${c.functionName}(${c.functionParameter.map((m) => m.example).join(",")})`
|
|
2194
2194
|
}
|
|
2195
2195
|
),
|
|
2196
2196
|
/* @__PURE__ */ N(
|
|
2197
|
-
|
|
2197
|
+
nn,
|
|
2198
2198
|
{
|
|
2199
2199
|
title: d.t("formula.prompt.helpAbstract"),
|
|
2200
2200
|
value: c.description
|
|
2201
2201
|
}
|
|
2202
2202
|
),
|
|
2203
2203
|
c && c.functionParameter && c.functionParameter.map((m, O) => /* @__PURE__ */ N(
|
|
2204
|
-
|
|
2204
|
+
nn,
|
|
2205
2205
|
{
|
|
2206
2206
|
className: i === O ? "univer-text-primary-500" : "",
|
|
2207
2207
|
title: m.name,
|
|
2208
|
-
value: `${m.require ?
|
|
2208
|
+
value: `${m.require ? a : S} ${m.detail}`
|
|
2209
2209
|
},
|
|
2210
2210
|
O
|
|
2211
2211
|
))
|
|
@@ -2217,18 +2217,18 @@ function Zi(e) {
|
|
|
2217
2217
|
) }, "show") : null;
|
|
2218
2218
|
}
|
|
2219
2219
|
const zi = (e) => {
|
|
2220
|
-
const t =
|
|
2220
|
+
const t = T(Ge);
|
|
2221
2221
|
return te((o) => {
|
|
2222
2222
|
var r, s;
|
|
2223
2223
|
if (e) {
|
|
2224
2224
|
t.focus(e.getEditorId());
|
|
2225
2225
|
const c = [...e.getSelectionRanges()];
|
|
2226
|
-
if (
|
|
2226
|
+
if (dn.isDefine(o))
|
|
2227
2227
|
e.setSelectionRanges([{ startOffset: o, endOffset: o }]);
|
|
2228
2228
|
else if (!c.length && !e.docSelectionRenderService.isOnPointerEvent) {
|
|
2229
2229
|
const i = (s = (r = e.getDocumentData().body) == null ? void 0 : r.dataStream) != null ? s : `\r
|
|
2230
|
-
`,
|
|
2231
|
-
e.setSelectionRanges([{ startOffset:
|
|
2230
|
+
`, l = Math.max(i.length - 2, 0);
|
|
2231
|
+
e.setSelectionRanges([{ startOffset: l, endOffset: l }]);
|
|
2232
2232
|
} else
|
|
2233
2233
|
e.setSelectionRanges(c);
|
|
2234
2234
|
}
|
|
@@ -2242,19 +2242,19 @@ function Xi(e) {
|
|
|
2242
2242
|
var Ne = /* @__PURE__ */ ((e) => (e[e.NOT_SELECT = 0] = "NOT_SELECT", e[e.NEED_ADD = 1] = "NEED_ADD", e[e.CAN_EDIT = 2] = "CAN_EDIT", e[e.EDIT_OTHER_SHEET_REFERENCE = 3] = "EDIT_OTHER_SHEET_REFERENCE", e[e.EDIT_OTHER_WORKBOOK_REFERENCE = 4] = "EDIT_OTHER_WORKBOOK_REFERENCE", e))(Ne || {});
|
|
2243
2243
|
function Qi(e) {
|
|
2244
2244
|
var x;
|
|
2245
|
-
const { editorId: t, isFocus: n, disableOnClick: o, unitId: r, subUnitId: s } = e, c =
|
|
2245
|
+
const { editorId: t, isFocus: n, disableOnClick: o, unitId: r, subUnitId: s } = e, c = T(ke), i = T(ne), l = c.getRenderById(r), f = c.getRenderById(t), h = f == null ? void 0 : f.with(ur), g = T(pr), u = T(Rt), [d, a] = V(
|
|
2246
2246
|
0
|
|
2247
2247
|
/* NOT_SELECT */
|
|
2248
|
-
), S =
|
|
2248
|
+
), S = T(Ie), p = z(!0), v = l == null ? void 0 : l.with(Pe), C = nt(d), _ = i.getUnit(r, H.UNIVER_SHEET), R = _ == null ? void 0 : _.getSheetBySheetId(s), m = te((w) => {
|
|
2249
2249
|
v && v.setSkipLastEnabled(
|
|
2250
2250
|
w === 1 || w === 3 || w === 4
|
|
2251
2251
|
/* EDIT_OTHER_WORKBOOK_REFERENCE */
|
|
2252
|
-
), C.current = w,
|
|
2252
|
+
), C.current = w, a(w);
|
|
2253
2253
|
}), O = te(() => {
|
|
2254
2254
|
var ie, ce, de;
|
|
2255
2255
|
const w = i.getCurrentUnitOfType(H.UNIVER_SHEET);
|
|
2256
2256
|
if (!w) return;
|
|
2257
|
-
const F = w.getActiveSheet(),
|
|
2257
|
+
const F = w.getActiveSheet(), y = h == null ? void 0 : h.getActiveTextRange(), k = y != null && y.collapsed ? y.startOffset : -1, A = Xi(u);
|
|
2258
2258
|
if (!A) return;
|
|
2259
2259
|
const I = (ie = A == null ? void 0 : A.dataStream) == null ? void 0 : ie.slice(0, -2), E = ((ce = S.sequenceNodesBuilder(I)) != null ? ce : []).map((K) => typeof K == "object" ? K.nodeType === Q.REFERENCE ? {
|
|
2260
2260
|
...K,
|
|
@@ -2262,16 +2262,16 @@ function Qi(e) {
|
|
|
2262
2262
|
} : {
|
|
2263
2263
|
...K,
|
|
2264
2264
|
range: void 0
|
|
2265
|
-
} : K), b = I[k - 1], M = I[k], D = E.find((K) => typeof K == "object" && K.nodeType === Q.REFERENCE && k === K.endIndex + 2), U = b && Fo(b) && (!M || Do(M) && M !==
|
|
2265
|
+
} : K), b = I[k - 1], M = I[k], D = E.find((K) => typeof K == "object" && K.nodeType === Q.REFERENCE && k === K.endIndex + 2), U = b && Fo(b) && (!M || Do(M) && M !== Ke.OPEN_BRACKET), B = !!D;
|
|
2266
2266
|
if ((I == null ? void 0 : I.substring(0, 1)) === "=" && (U || B))
|
|
2267
2267
|
if (B) {
|
|
2268
2268
|
if (p.current)
|
|
2269
2269
|
return;
|
|
2270
|
-
const { sheetName: K, unitId: J } = D.range,
|
|
2271
|
-
J && J !==
|
|
2270
|
+
const { sheetName: K, unitId: J } = D.range, rt = (de = i.getCurrentUnitOfType(H.UNIVER_SHEET)) == null ? void 0 : de.getUnitId();
|
|
2271
|
+
J && J !== rt ? m(
|
|
2272
2272
|
4
|
|
2273
2273
|
/* EDIT_OTHER_WORKBOOK_REFERENCE */
|
|
2274
|
-
) : !K && F.getSheetId() === (
|
|
2274
|
+
) : !K && F.getSheetId() === (R == null ? void 0 : R.getSheetId()) || K === F.getName() ? m(
|
|
2275
2275
|
2
|
|
2276
2276
|
/* CAN_EDIT */
|
|
2277
2277
|
) : m(
|
|
@@ -2311,7 +2311,7 @@ function Qi(e) {
|
|
|
2311
2311
|
return () => w == null ? void 0 : w.unsubscribe();
|
|
2312
2312
|
}, [o, (x = f == null ? void 0 : f.mainComponent) == null ? void 0 : x.onPointerDown$, m]), $(() => {
|
|
2313
2313
|
if (!n) return;
|
|
2314
|
-
const w =
|
|
2314
|
+
const w = _ == null ? void 0 : _.activeSheet$.subscribe(() => {
|
|
2315
2315
|
O();
|
|
2316
2316
|
}), F = i.getCurrentTypeOfUnit$(H.UNIVER_SHEET).subscribe(() => {
|
|
2317
2317
|
O();
|
|
@@ -2319,14 +2319,14 @@ function Qi(e) {
|
|
|
2319
2319
|
return () => {
|
|
2320
2320
|
w == null || w.unsubscribe(), F == null || F.unsubscribe();
|
|
2321
2321
|
};
|
|
2322
|
-
}, [O, n,
|
|
2322
|
+
}, [O, n, _ == null ? void 0 : _.activeSheet$, i.getCurrentTypeOfUnit$]), { isSelecting: d, isSelectingRef: C };
|
|
2323
2323
|
}
|
|
2324
2324
|
const Ji = () => {
|
|
2325
|
-
const e =
|
|
2326
|
-
return
|
|
2325
|
+
const e = T(Ie);
|
|
2326
|
+
return Dt((n) => e.sequenceNodesBuilder(n) || [], [e]);
|
|
2327
2327
|
};
|
|
2328
2328
|
function ec(e, t, n) {
|
|
2329
|
-
const o = new
|
|
2329
|
+
const o = new hn(t).setAlpha(0.05).toRgbString();
|
|
2330
2330
|
return {
|
|
2331
2331
|
id: n,
|
|
2332
2332
|
strokeWidth: 1,
|
|
@@ -2339,7 +2339,7 @@ function ec(e, t, n) {
|
|
|
2339
2339
|
};
|
|
2340
2340
|
}
|
|
2341
2341
|
function Fr(e) {
|
|
2342
|
-
var
|
|
2342
|
+
var _, R, m;
|
|
2343
2343
|
const {
|
|
2344
2344
|
unitId: t,
|
|
2345
2345
|
subUnitId: n,
|
|
@@ -2348,102 +2348,102 @@ function Fr(e) {
|
|
|
2348
2348
|
editor: s,
|
|
2349
2349
|
refSelectionsService: c,
|
|
2350
2350
|
refSelectionsRenderService: i,
|
|
2351
|
-
sheetSkeletonManagerService:
|
|
2351
|
+
sheetSkeletonManagerService: l,
|
|
2352
2352
|
themeService: f,
|
|
2353
2353
|
univerInstanceService: h
|
|
2354
|
-
} = e, g = o.getUnitId(), u = h.getUnit(t, H.UNIVER_SHEET), d = u == null ? void 0 : u.getActiveSheet(),
|
|
2354
|
+
} = e, g = o.getUnitId(), u = h.getUnit(t, H.UNIVER_SHEET), d = u == null ? void 0 : u.getActiveSheet(), a = [];
|
|
2355
2355
|
if (!u || !d) {
|
|
2356
|
-
c.setSelections(
|
|
2356
|
+
c.setSelections(a);
|
|
2357
2357
|
return;
|
|
2358
2358
|
}
|
|
2359
2359
|
const S = d.getSheetId(), p = (O) => {
|
|
2360
2360
|
var x;
|
|
2361
2361
|
return (x = u == null ? void 0 : u.getSheetBySheetName(O)) == null ? void 0 : x.getSheetId();
|
|
2362
2362
|
};
|
|
2363
|
-
if (!((
|
|
2363
|
+
if (!((_ = l == null ? void 0 : l.getWorksheetSkeleton(S)) == null ? void 0 : _.skeleton)) return;
|
|
2364
2364
|
const C = [];
|
|
2365
2365
|
for (let O = 0, x = r.length; O < x; O++) {
|
|
2366
|
-
const w = r[O], { themeColor: F, token:
|
|
2366
|
+
const w = r[O], { themeColor: F, token: y, refIndex: k, endIndex: A } = w, I = ht(y), { unitId: E, sheetName: b, range: M } = I, D = p(b);
|
|
2367
2367
|
if (!D && b || g !== t && E !== g || E && E !== g || D && D !== S || !D && S !== n)
|
|
2368
2368
|
continue;
|
|
2369
2369
|
const U = ss(M, d.getRowCount(), d.getColumnCount());
|
|
2370
|
-
U.unitId = t, U.sheetId = S,
|
|
2370
|
+
U.unitId = t, U.sheetId = S, a.push({
|
|
2371
2371
|
range: U,
|
|
2372
2372
|
primary: null,
|
|
2373
2373
|
style: ec(f, F, k.toString())
|
|
2374
2374
|
}), C.push(A);
|
|
2375
2375
|
}
|
|
2376
2376
|
if (s) {
|
|
2377
|
-
const O = (m = (
|
|
2377
|
+
const O = (m = (R = s.getSelectionRanges()) == null ? void 0 : R[0]) == null ? void 0 : m.startOffset, x = C.findIndex((w) => w + 2 === O);
|
|
2378
2378
|
x !== -1 ? i == null || i.setActiveSelectionIndex(x) : i == null || i.resetActiveSelectionIndex();
|
|
2379
2379
|
}
|
|
2380
|
-
return
|
|
2380
|
+
return a;
|
|
2381
2381
|
}
|
|
2382
2382
|
function tc(e, t) {
|
|
2383
|
-
const n =
|
|
2383
|
+
const n = T(ne), o = T(Et), r = T(Kt), s = T(ke), c = Ce(se(() => n.getCurrentTypeOfUnit$(H.UNIVER_SHEET), [n])), i = c ? s.getRenderById(c.getUnitId()) : null, l = i == null ? void 0 : i.with(Pe), f = i == null ? void 0 : i.with(qt), h = te((g, u) => {
|
|
2384
2384
|
const d = n.getCurrentUnitOfType(H.UNIVER_SHEET);
|
|
2385
|
-
if (!d ||
|
|
2386
|
-
const
|
|
2385
|
+
if (!d || l != null && l.selectionMoving) return;
|
|
2386
|
+
const a = Fr({
|
|
2387
2387
|
unitId: e,
|
|
2388
2388
|
subUnitId: t,
|
|
2389
2389
|
currentWorkbook: d,
|
|
2390
2390
|
refSelections: g,
|
|
2391
2391
|
editor: u,
|
|
2392
2392
|
refSelectionsService: r,
|
|
2393
|
-
refSelectionsRenderService:
|
|
2393
|
+
refSelectionsRenderService: l,
|
|
2394
2394
|
sheetSkeletonManagerService: f,
|
|
2395
2395
|
themeService: o,
|
|
2396
2396
|
univerInstanceService: n
|
|
2397
2397
|
});
|
|
2398
|
-
if (!
|
|
2399
|
-
((
|
|
2398
|
+
if (!a) return;
|
|
2399
|
+
((l == null ? void 0 : l.getSelectionControls()) || []).length === a.length ? l == null || l.resetSelectionsByModelData(a) : r.setSelections(a);
|
|
2400
2400
|
});
|
|
2401
2401
|
return $(() => () => {
|
|
2402
|
-
|
|
2403
|
-
}, [
|
|
2402
|
+
l == null || l.resetActiveSelectionIndex();
|
|
2403
|
+
}, [l]), h;
|
|
2404
2404
|
}
|
|
2405
2405
|
function Dr(e = "") {
|
|
2406
|
-
const t =
|
|
2407
|
-
return te((c, i,
|
|
2406
|
+
const t = T(Yt), n = nc(), o = T(ve), r = se(() => e.length, [e]);
|
|
2407
|
+
return te((c, i, l = !0, f) => {
|
|
2408
2408
|
const h = c.getDocumentData(), g = c.getEditorId();
|
|
2409
2409
|
if (!h)
|
|
2410
2410
|
return [];
|
|
2411
2411
|
const u = h.body;
|
|
2412
2412
|
if (!u)
|
|
2413
2413
|
return [];
|
|
2414
|
-
const d = u.dataStream.slice(0, u.dataStream.length - 2),
|
|
2414
|
+
const d = u.dataStream.slice(0, u.dataStream.length - 2), a = { dataStream: "", ...h.body };
|
|
2415
2415
|
if (!d.startsWith(e)) return [];
|
|
2416
2416
|
if (i == null || i.length === 0)
|
|
2417
|
-
return
|
|
2417
|
+
return a.textRuns = [], o.syncExecuteCommand($n.id, {
|
|
2418
2418
|
unitId: g,
|
|
2419
|
-
body:
|
|
2419
|
+
body: Nn(a, 0, a.dataStream.length - 2)
|
|
2420
2420
|
}), [];
|
|
2421
2421
|
{
|
|
2422
2422
|
const { textRuns: S, refSelections: p } = rc(t, n, i);
|
|
2423
|
-
r && S.forEach((
|
|
2424
|
-
|
|
2425
|
-
}),
|
|
2426
|
-
const v = i.reduce((
|
|
2427
|
-
|
|
2423
|
+
r && S.forEach((_) => {
|
|
2424
|
+
_.ed = _.ed + r, _.st = _.st + r;
|
|
2425
|
+
}), a.textRuns = [{ st: 0, ed: 1, ts: { fs: 11 } }, ...S];
|
|
2426
|
+
const v = i.reduce((_, R) => typeof R == "string" ? `${_}${R}` : `${_}${R.token}`, "");
|
|
2427
|
+
a.dataStream = `${e}${v}\r
|
|
2428
2428
|
`;
|
|
2429
2429
|
let C;
|
|
2430
|
-
if (
|
|
2430
|
+
if (l) {
|
|
2431
2431
|
C = c.getSelectionRanges();
|
|
2432
|
-
const
|
|
2433
|
-
C.forEach((
|
|
2434
|
-
|
|
2432
|
+
const _ = a.dataStream.length - 2 + r;
|
|
2433
|
+
C.forEach((R) => {
|
|
2434
|
+
R.startOffset = Math.max(0, Math.min(R.startOffset, _)), R.endOffset = Math.max(0, Math.min(R.endOffset, _));
|
|
2435
2435
|
});
|
|
2436
2436
|
}
|
|
2437
2437
|
return o.syncExecuteCommand($n.id, {
|
|
2438
2438
|
unitId: g,
|
|
2439
|
-
body:
|
|
2439
|
+
body: Nn(a, 0, a.dataStream.length - 2),
|
|
2440
2440
|
textRanges: f != null ? f : C
|
|
2441
2441
|
}), p;
|
|
2442
2442
|
}
|
|
2443
2443
|
});
|
|
2444
2444
|
}
|
|
2445
2445
|
function nc() {
|
|
2446
|
-
const e =
|
|
2446
|
+
const e = T(Et), t = e.getCurrentTheme();
|
|
2447
2447
|
return se(() => {
|
|
2448
2448
|
const o = [
|
|
2449
2449
|
e.getColorFromTheme("loop-color.1"),
|
|
@@ -2463,14 +2463,14 @@ function nc() {
|
|
|
2463
2463
|
}, [t]);
|
|
2464
2464
|
}
|
|
2465
2465
|
function rc(e, t, n) {
|
|
2466
|
-
const { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: c } = t, i = [],
|
|
2466
|
+
const { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: c } = t, i = [], l = [], f = /* @__PURE__ */ new Map();
|
|
2467
2467
|
let h = 0;
|
|
2468
2468
|
for (let g = 0, u = n.length; g < u; g++) {
|
|
2469
2469
|
const d = n[g];
|
|
2470
2470
|
if (typeof d == "string") {
|
|
2471
|
-
const
|
|
2471
|
+
const _ = i[i.length - 1], R = _ ? _.ed : 0, m = R + d.length;
|
|
2472
2472
|
i.push({
|
|
2473
|
-
st:
|
|
2473
|
+
st: R,
|
|
2474
2474
|
ed: m,
|
|
2475
2475
|
ts: {
|
|
2476
2476
|
cl: {
|
|
@@ -2494,26 +2494,26 @@ function rc(e, t, n) {
|
|
|
2494
2494
|
});
|
|
2495
2495
|
continue;
|
|
2496
2496
|
}
|
|
2497
|
-
const { startIndex:
|
|
2497
|
+
const { startIndex: a, endIndex: S, nodeType: p, token: v } = d;
|
|
2498
2498
|
let C = "";
|
|
2499
2499
|
if (p === Q.REFERENCE) {
|
|
2500
2500
|
if (f.has(v))
|
|
2501
2501
|
C = f.get(v);
|
|
2502
2502
|
else {
|
|
2503
|
-
const
|
|
2504
|
-
C = o[
|
|
2503
|
+
const _ = h % o.length;
|
|
2504
|
+
C = o[_], f.set(v, C), h++;
|
|
2505
2505
|
}
|
|
2506
|
-
|
|
2506
|
+
l.push({
|
|
2507
2507
|
refIndex: g,
|
|
2508
2508
|
themeColor: C,
|
|
2509
2509
|
token: v,
|
|
2510
2510
|
startIndex: d.startIndex,
|
|
2511
2511
|
endIndex: d.endIndex,
|
|
2512
|
-
index:
|
|
2512
|
+
index: l.length
|
|
2513
2513
|
});
|
|
2514
2514
|
} else p === Q.NUMBER ? C = r : (p === Q.STRING || p === Q.ARRAY) && (C = s);
|
|
2515
2515
|
C && C.length > 0 ? i.push({
|
|
2516
|
-
st:
|
|
2516
|
+
st: a,
|
|
2517
2517
|
ed: S + 1,
|
|
2518
2518
|
ts: {
|
|
2519
2519
|
cl: {
|
|
@@ -2522,7 +2522,7 @@ function rc(e, t, n) {
|
|
|
2522
2522
|
fs: 11
|
|
2523
2523
|
}
|
|
2524
2524
|
}) : i.push({
|
|
2525
|
-
st:
|
|
2525
|
+
st: a,
|
|
2526
2526
|
ed: S + 1,
|
|
2527
2527
|
ts: {
|
|
2528
2528
|
cl: {
|
|
@@ -2532,29 +2532,29 @@ function rc(e, t, n) {
|
|
|
2532
2532
|
}
|
|
2533
2533
|
});
|
|
2534
2534
|
}
|
|
2535
|
-
return { textRuns: i, refSelections:
|
|
2535
|
+
return { textRuns: i, refSelections: l };
|
|
2536
2536
|
}
|
|
2537
2537
|
const oc = (e, t, n, o) => {
|
|
2538
|
-
const r =
|
|
2538
|
+
const r = T(ve), s = T(Gt), c = z(t);
|
|
2539
2539
|
c.current = t;
|
|
2540
2540
|
const i = z(o);
|
|
2541
2541
|
i.current = o, $(() => {
|
|
2542
2542
|
if (!n || !e)
|
|
2543
2543
|
return;
|
|
2544
|
-
const f = `sheet.formula-embedding-editor.${n.getEditorId()}`, h = new qe(), g = (
|
|
2544
|
+
const f = `sheet.formula-embedding-editor.${n.getEditorId()}`, h = new qe(), g = (a, S) => {
|
|
2545
2545
|
if (i.current) {
|
|
2546
|
-
i.current(
|
|
2546
|
+
i.current(a, S);
|
|
2547
2547
|
return;
|
|
2548
2548
|
}
|
|
2549
2549
|
let p = ue.LEFT;
|
|
2550
|
-
|
|
2550
|
+
a === L.ARROW_DOWN ? p = ue.DOWN : a === L.ARROW_UP ? p = ue.UP : a === L.ARROW_RIGHT && (p = ue.RIGHT), S === P.SHIFT ? r.executeCommand(Ko.id, {
|
|
2551
2551
|
direction: p
|
|
2552
2552
|
}) : r.executeCommand(Yo.id, {
|
|
2553
2553
|
direction: p
|
|
2554
2554
|
});
|
|
2555
|
-
}, u = (
|
|
2555
|
+
}, u = (a, S) => {
|
|
2556
2556
|
let p = ue.DOWN;
|
|
2557
|
-
|
|
2557
|
+
a === L.ARROW_DOWN ? p = ue.DOWN : a === L.ARROW_UP ? p = ue.UP : a === L.ARROW_LEFT ? p = ue.LEFT : a === L.ARROW_RIGHT && (p = ue.RIGHT), c.current ? S === P.CTRL_COMMAND ? r.executeCommand(An.id, {
|
|
2558
2558
|
direction: p,
|
|
2559
2559
|
jumpOver: Fn.moveGap,
|
|
2560
2560
|
extra: "formula-editor",
|
|
@@ -2570,12 +2570,12 @@ const oc = (e, t, n, o) => {
|
|
|
2570
2570
|
direction: p,
|
|
2571
2571
|
extra: "formula-editor",
|
|
2572
2572
|
fromCurrentSelection: c.current === Ne.NEED_ADD || c.current === Ne.EDIT_OTHER_SHEET_REFERENCE
|
|
2573
|
-
}) : g(
|
|
2573
|
+
}) : g(a, S);
|
|
2574
2574
|
};
|
|
2575
2575
|
return h.add(r.registerCommand({
|
|
2576
2576
|
id: f,
|
|
2577
2577
|
type: Me.OPERATION,
|
|
2578
|
-
handler(
|
|
2578
|
+
handler(a, S) {
|
|
2579
2579
|
const { keyCode: p, metaKey: v } = S;
|
|
2580
2580
|
u(p, v);
|
|
2581
2581
|
}
|
|
@@ -2596,75 +2596,70 @@ const oc = (e, t, n, o) => {
|
|
|
2596
2596
|
{ keyCode: L.ARROW_LEFT, metaKey: P.CTRL_COMMAND | P.SHIFT },
|
|
2597
2597
|
{ keyCode: L.ARROW_RIGHT, metaKey: P.CTRL_COMMAND | P.SHIFT },
|
|
2598
2598
|
{ keyCode: L.ARROW_UP, metaKey: P.CTRL_COMMAND | P.SHIFT }
|
|
2599
|
-
].map(({ keyCode:
|
|
2599
|
+
].map(({ keyCode: a, metaKey: S }) => ({
|
|
2600
2600
|
id: f,
|
|
2601
|
-
binding: S ?
|
|
2601
|
+
binding: S ? a | S : a,
|
|
2602
2602
|
preconditions: () => !0,
|
|
2603
2603
|
priority: 900,
|
|
2604
2604
|
staticParameters: {
|
|
2605
2605
|
eventType: we.Keyboard,
|
|
2606
|
-
keyCode:
|
|
2606
|
+
keyCode: a,
|
|
2607
2607
|
metaKey: S
|
|
2608
2608
|
}
|
|
2609
|
-
})).forEach((
|
|
2610
|
-
h.add(s.registerShortcut(
|
|
2609
|
+
})).forEach((a) => {
|
|
2610
|
+
h.add(s.registerShortcut(a));
|
|
2611
2611
|
}), () => {
|
|
2612
2612
|
h.dispose();
|
|
2613
2613
|
};
|
|
2614
2614
|
}, [r, n, e, s]);
|
|
2615
|
-
}, sc = (e, t, n, o = !0) => {
|
|
2616
|
-
var
|
|
2617
|
-
const
|
|
2618
|
-
|
|
2615
|
+
}, sc = (e, t, n, o, r = !0) => {
|
|
2616
|
+
var d;
|
|
2617
|
+
const s = T(ke), c = T(ln), i = T(fs), l = T(Kt), f = T(ne), h = Ce(se(() => f.getCurrentTypeOfUnit$(H.UNIVER_SHEET), [f])), g = s.getRenderById((d = h == null ? void 0 : h.getUnitId()) != null ? d : ""), u = g == null ? void 0 : g.with(Pe);
|
|
2618
|
+
Lt(() => {
|
|
2619
2619
|
if (e)
|
|
2620
|
-
return
|
|
2621
|
-
|
|
2620
|
+
return c.setContextValue(xn, !0), r && i.disable(), () => {
|
|
2621
|
+
f.getCurrentUnitOfType(H.UNIVER_DOC).getUnitId() === o && c.setContextValue(xn, !1), r && i.enable(), l.clear();
|
|
2622
2622
|
};
|
|
2623
|
-
}, [
|
|
2623
|
+
}, [c, e, l, r, o]), Lt(() => {
|
|
2624
2624
|
if (e && t) {
|
|
2625
|
-
const
|
|
2626
|
-
return
|
|
2627
|
-
|
|
2625
|
+
const a = u == null ? void 0 : u.enableSelectionChanging();
|
|
2626
|
+
return c.setContextValue(Vn, !0), () => {
|
|
2627
|
+
c.setContextValue(Vn, !1), a == null || a.dispose();
|
|
2628
2628
|
};
|
|
2629
2629
|
}
|
|
2630
|
-
}, [
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
s.setContextValue(wt, !1), o && c.enable();
|
|
2634
|
-
};
|
|
2635
|
-
}, [c, s, e, o]), $(() => {
|
|
2636
|
-
e && (g == null || g.setSkipLastEnabled(!1));
|
|
2637
|
-
}, [e, g]);
|
|
2630
|
+
}, [c, e, u, t]), $(() => {
|
|
2631
|
+
e && (u == null || u.setSkipLastEnabled(!1));
|
|
2632
|
+
}, [e, u]);
|
|
2638
2633
|
}, ic = (e, t, n) => {
|
|
2639
|
-
const o =
|
|
2640
|
-
return
|
|
2634
|
+
const o = T(ne), r = T(mn);
|
|
2635
|
+
return Dt(() => {
|
|
2641
2636
|
if (e) {
|
|
2642
|
-
const c = [...r.getWorkbookSelections(t).getSelectionsOfWorksheet(n)], i = o.getCurrentUnitForType(H.UNIVER_SHEET),
|
|
2643
|
-
(i == null ? void 0 : i.getUnitId()) !== t && o.setCurrentUnitForType(t),
|
|
2637
|
+
const c = [...r.getWorkbookSelections(t).getSelectionsOfWorksheet(n)], i = o.getCurrentUnitForType(H.UNIVER_SHEET), l = i == null ? void 0 : i.getActiveSheet();
|
|
2638
|
+
(i == null ? void 0 : i.getUnitId()) !== t && o.setCurrentUnitForType(t), l && l.getSheetId() === n && r.setSelections(c);
|
|
2644
2639
|
}
|
|
2645
2640
|
}, [e, r, n, t, o]);
|
|
2646
|
-
}, cc = (e) => e.reduce((t, n) => typeof n == "string" ? t + n.length : t + n.token.length, 0),
|
|
2641
|
+
}, cc = (e) => e.reduce((t, n) => typeof n == "string" ? t + n.length : t + n.token.length, 0), an = (e) => e.map((t) => typeof t == "string" ? t : t.token).join(""), kt = (e, t = !1, n = "", o = !1) => !t && !o ? e.map((r) => Ee(r.range)) : e.map((r) => o ? Lo(r) : r.sheetName !== "" && r.sheetName !== n ? Ct(r.sheetName, r.range) : Ee(r.range)), ac = (e) => {
|
|
2647
2642
|
var h, g, u;
|
|
2648
2643
|
const { editor: t, lexerTreeBuilder: n } = e, o = t == null ? void 0 : t.getSelectionRanges();
|
|
2649
2644
|
if ((o == null ? void 0 : o.length) !== 1)
|
|
2650
2645
|
return;
|
|
2651
2646
|
const s = o[0].startOffset - 1, c = ((g = (h = t == null ? void 0 : t.getDocumentData().body) == null ? void 0 : h.dataStream) != null ? g : `\r
|
|
2652
|
-
`).slice(0, -2), i = (u = n.sequenceNodesBuilder(c.slice(1))) != null ? u : [],
|
|
2647
|
+
`).slice(0, -2), i = (u = n.sequenceNodesBuilder(c.slice(1))) != null ? u : [], l = En(i, s, !1), f = kr(i, l);
|
|
2653
2648
|
return {
|
|
2654
|
-
nodeIndex:
|
|
2649
|
+
nodeIndex: l,
|
|
2655
2650
|
updatingRefIndex: f,
|
|
2656
2651
|
sequenceNodes: i,
|
|
2657
2652
|
offset: s
|
|
2658
2653
|
};
|
|
2659
2654
|
}, lc = () => {
|
|
2660
|
-
}, uc = (e, t, n, o, r, s, c, i,
|
|
2655
|
+
}, uc = (e, t, n, o, r, s, c, i, l, f = lc) => {
|
|
2661
2656
|
var k;
|
|
2662
|
-
const h =
|
|
2657
|
+
const h = T(ke), g = T(ne), u = T(ve), d = T(pr), a = T(Et), S = T(Ie), p = g.getUnit(o), v = te((A, I) => {
|
|
2663
2658
|
var E, b, M;
|
|
2664
2659
|
return (M = (b = (E = g.getUnit(A)) == null ? void 0 : E.getSheetBySheetId(I)) == null ? void 0 : b.getName()) != null ? M : "";
|
|
2665
|
-
}), C = se(() => v(o, r), [v, r, o]),
|
|
2666
|
-
var B, ie, ce, de, K, J,
|
|
2667
|
-
const E = ac({ editor:
|
|
2660
|
+
}), C = se(() => v(o, r), [v, r, o]), _ = Ce(p == null ? void 0 : p.activeSheet$), R = nt({ activeSheet: _, sheetName: C }), m = Ce(se(() => g.getCurrentTypeOfUnit$(H.UNIVER_SHEET), [g])), O = h.getRenderById((k = m == null ? void 0 : m.getUnitId()) != null ? k : ""), x = O == null ? void 0 : O.with(Pe), w = O == null ? void 0 : O.with(qt), F = T(Kt), y = te((A, I) => {
|
|
2661
|
+
var B, ie, ce, de, K, J, rt, ot, yt, be;
|
|
2662
|
+
const E = ac({ editor: l, lexerTreeBuilder: S });
|
|
2668
2663
|
if (!E) return;
|
|
2669
2664
|
const { nodeIndex: b, updatingRefIndex: M, sequenceNodes: D, offset: U } = E;
|
|
2670
2665
|
if (n.current === Ne.NEED_ADD)
|
|
@@ -2675,18 +2670,18 @@ const oc = (e, t, n, o) => {
|
|
|
2675
2670
|
range: Y,
|
|
2676
2671
|
unitId: (ie = Y.unitId) != null ? ie : m.getUnitId(),
|
|
2677
2672
|
sheetName: v((ce = Y.unitId) != null ? ce : m.getUnitId(), ye)
|
|
2678
|
-
}, ee = ye !== r, ae = (m == null ? void 0 : m.getUnitId()) !== o, Te =
|
|
2673
|
+
}, ee = ye !== r, ae = (m == null ? void 0 : m.getUnitId()) !== o, Te = kt([he], c && (ee || ae), C, ae);
|
|
2679
2674
|
D.push({ token: Te[0], nodeType: Q.REFERENCE });
|
|
2680
|
-
const Ue = [...D, ...X], Fe =
|
|
2675
|
+
const Ue = [...D, ...X], Fe = an(Ue);
|
|
2681
2676
|
f(Fe, cc(D), I);
|
|
2682
2677
|
} else {
|
|
2683
2678
|
const Y = A[A.length - 1], X = (de = Y.sheetId) != null ? de : r, ye = {
|
|
2684
2679
|
range: Y,
|
|
2685
2680
|
unitId: (K = Y.unitId) != null ? K : m.getUnitId(),
|
|
2686
2681
|
sheetName: v((J = Y.unitId) != null ? J : m.getUnitId(), X)
|
|
2687
|
-
}, he = X !== r, ee = (m == null ? void 0 : m.getUnitId()) !== o, ae =
|
|
2682
|
+
}, he = X !== r, ee = (m == null ? void 0 : m.getUnitId()) !== o, ae = kt([ye], c && (he || ee), C, ee);
|
|
2688
2683
|
D.unshift({ token: ae[0], nodeType: Q.REFERENCE });
|
|
2689
|
-
const Te =
|
|
2684
|
+
const Te = an(D);
|
|
2690
2685
|
f(Te, ae[0].length, I);
|
|
2691
2686
|
}
|
|
2692
2687
|
else if (n.current === Ne.EDIT_OTHER_SHEET_REFERENCE || n.current === Ne.EDIT_OTHER_WORKBOOK_REFERENCE) {
|
|
@@ -2695,7 +2690,7 @@ const oc = (e, t, n, o) => {
|
|
|
2695
2690
|
const X = D[b];
|
|
2696
2691
|
if (typeof X == "object" && X.nodeType === Q.REFERENCE) {
|
|
2697
2692
|
const ye = X.token;
|
|
2698
|
-
(m == null ? void 0 : m.getUnitId()) !== o ? X.token = $o((
|
|
2693
|
+
(m == null ? void 0 : m.getUnitId()) !== o ? X.token = $o((rt = m == null ? void 0 : m.getUnitId()) != null ? rt : "", C, Y) : X.token = C === (_ == null ? void 0 : _.getName()) ? Ee(Y) : Ct(_.getName(), Y);
|
|
2699
2694
|
const ee = U + (X.token.length - ye.length);
|
|
2700
2695
|
f(Po(D), ee, I);
|
|
2701
2696
|
}
|
|
@@ -2707,22 +2702,22 @@ const oc = (e, t, n, o) => {
|
|
|
2707
2702
|
}
|
|
2708
2703
|
let X = 0;
|
|
2709
2704
|
const ye = D.map((G) => {
|
|
2710
|
-
var fe, Ve,
|
|
2705
|
+
var fe, Ve, st, ge;
|
|
2711
2706
|
if (typeof G == "string")
|
|
2712
2707
|
return G;
|
|
2713
2708
|
if (G.nodeType === Q.REFERENCE) {
|
|
2714
2709
|
const me = ht(G.token);
|
|
2715
|
-
if (me.sheetName || (me.sheetName = C), (me.unitId || o) !== (m == null ? void 0 : m.getUnitId()) || c && ((fe =
|
|
2710
|
+
if (me.sheetName || (me.sheetName = C), (me.unitId || o) !== (m == null ? void 0 : m.getUnitId()) || c && ((fe = R.current.activeSheet) == null ? void 0 : fe.getName()) !== me.sheetName)
|
|
2716
2711
|
return G.token;
|
|
2717
2712
|
const _e = Y[X];
|
|
2718
2713
|
if (X++, !_e)
|
|
2719
2714
|
return "";
|
|
2720
|
-
const Tt = (Ve = _e.sheetId) != null ? Ve : r,
|
|
2715
|
+
const Tt = (Ve = _e.sheetId) != null ? Ve : r, Xt = {
|
|
2721
2716
|
range: _e,
|
|
2722
|
-
unitId: (
|
|
2717
|
+
unitId: (st = _e.unitId) != null ? st : m.getUnitId(),
|
|
2723
2718
|
sheetName: v((ge = _e.unitId) != null ? ge : m.getUnitId(), Tt)
|
|
2724
2719
|
}, Ot = (m == null ? void 0 : m.getUnitId()) !== o;
|
|
2725
|
-
return
|
|
2720
|
+
return kt([Xt], c && (Tt !== r || Ot), C, Ot)[0];
|
|
2726
2721
|
}
|
|
2727
2722
|
return G.token;
|
|
2728
2723
|
});
|
|
@@ -2732,11 +2727,11 @@ const oc = (e, t, n, o) => {
|
|
|
2732
2727
|
});
|
|
2733
2728
|
const ae = [];
|
|
2734
2729
|
for (let G = X; G <= A.length - 1; G++) {
|
|
2735
|
-
const fe = A[G], Ve = (
|
|
2730
|
+
const fe = A[G], Ve = (ot = fe.sheetId) != null ? ot : r, st = {
|
|
2736
2731
|
range: fe,
|
|
2737
2732
|
unitId: (yt = fe.unitId) != null ? yt : m.getUnitId(),
|
|
2738
2733
|
sheetName: v((be = fe.unitId) != null ? be : m.getUnitId(), Ve)
|
|
2739
|
-
}, ge = (m == null ? void 0 : m.getUnitId()) !== o, _e =
|
|
2734
|
+
}, ge = (m == null ? void 0 : m.getUnitId()) !== o, _e = kt([st], c && (Ve !== r || ge), C, ge);
|
|
2740
2735
|
ae.push(_e[0]);
|
|
2741
2736
|
}
|
|
2742
2737
|
const Te = D[D.length - 1], Ue = Te && (typeof Te == "string" ? !1 : Te.nodeType === Q.REFERENCE), Fe = `${he}${ae.length && Ue ? "," : ""}${ae.join(",")}`;
|
|
@@ -2751,7 +2746,7 @@ const oc = (e, t, n, o) => {
|
|
|
2751
2746
|
A = !1;
|
|
2752
2747
|
return;
|
|
2753
2748
|
}
|
|
2754
|
-
|
|
2749
|
+
y(b.map((D) => D.rangeWithCoord), M);
|
|
2755
2750
|
}, E = new qe();
|
|
2756
2751
|
return E.add(x.selectionMoving$.subscribe((b) => {
|
|
2757
2752
|
I(b, !1);
|
|
@@ -2761,24 +2756,24 @@ const oc = (e, t, n, o) => {
|
|
|
2761
2756
|
E.dispose();
|
|
2762
2757
|
};
|
|
2763
2758
|
}
|
|
2764
|
-
}, [e,
|
|
2765
|
-
if (t && x &&
|
|
2759
|
+
}, [e, y, x]), $(() => {
|
|
2760
|
+
if (t && x && l) {
|
|
2766
2761
|
const A = new qe(), I = () => {
|
|
2767
2762
|
A.dispose(), x.getSelectionControls().forEach((M, D) => {
|
|
2768
2763
|
A.add(
|
|
2769
2764
|
M.selectionScaling$.subscribe((U) => {
|
|
2770
2765
|
const B = x.getSelectionDataWithStyle().map((ce) => ce.rangeWithCoord), ie = B[D];
|
|
2771
|
-
U.sheetId = ie.sheetId, U.unitId = ie.unitId, B[D] = U,
|
|
2766
|
+
U.sheetId = ie.sheetId, U.unitId = ie.unitId, B[D] = U, y(B, !1);
|
|
2772
2767
|
})
|
|
2773
2768
|
), A.add(
|
|
2774
2769
|
M.selectionMoving$.subscribe((U) => {
|
|
2775
2770
|
const B = x.getSelectionDataWithStyle().map((ce) => ce.rangeWithCoord), ie = B[D];
|
|
2776
|
-
U.sheetId = ie.sheetId, U.unitId = ie.unitId, B[D] = U,
|
|
2771
|
+
U.sheetId = ie.sheetId, U.unitId = ie.unitId, B[D] = U, y(B, !0);
|
|
2777
2772
|
})
|
|
2778
2773
|
);
|
|
2779
2774
|
});
|
|
2780
2775
|
}, E = qo(
|
|
2781
|
-
|
|
2776
|
+
l.input$,
|
|
2782
2777
|
F.selectionSet$,
|
|
2783
2778
|
x.selectionMoveEnd$
|
|
2784
2779
|
).pipe(
|
|
@@ -2790,18 +2785,18 @@ const oc = (e, t, n, o) => {
|
|
|
2790
2785
|
E.unsubscribe(), A.dispose();
|
|
2791
2786
|
};
|
|
2792
2787
|
}
|
|
2793
|
-
}, [
|
|
2788
|
+
}, [l, t, y, x, F.selectionSet$]), x == null || x.getSelectionDataWithStyle(), $(() => {
|
|
2794
2789
|
if (i) {
|
|
2795
2790
|
const A = u.onCommandExecuted((I) => {
|
|
2796
2791
|
var b;
|
|
2797
|
-
if (I.id !==
|
|
2792
|
+
if (I.id !== pn.id)
|
|
2798
2793
|
return;
|
|
2799
2794
|
const E = I.params;
|
|
2800
2795
|
if (E.extra === "formula-editor" && E.selections.length) {
|
|
2801
2796
|
const M = E.selections[E.selections.length - 1];
|
|
2802
2797
|
if (M) {
|
|
2803
2798
|
const D = n.current === Ne.NEED_ADD, U = ((b = x == null ? void 0 : x.getSelectionDataWithStyle()) != null ? b : []).map((B) => B.rangeWithCoord);
|
|
2804
|
-
D ? U.push(M.range) : U[U.length - 1] = M.range,
|
|
2799
|
+
D ? U.push(M.range) : U[U.length - 1] = M.range, y(U, !0);
|
|
2805
2800
|
}
|
|
2806
2801
|
}
|
|
2807
2802
|
});
|
|
@@ -2809,27 +2804,27 @@ const oc = (e, t, n, o) => {
|
|
|
2809
2804
|
A.dispose();
|
|
2810
2805
|
};
|
|
2811
2806
|
}
|
|
2812
|
-
}, [u,
|
|
2813
|
-
if (!
|
|
2807
|
+
}, [u, l, n, S, i, y, x]), $(() => {
|
|
2808
|
+
if (!l)
|
|
2814
2809
|
return;
|
|
2815
2810
|
const A = d.textSelection$.subscribe((I) => {
|
|
2816
|
-
I.unitId ===
|
|
2811
|
+
I.unitId === l.getEditorId() && Fr({
|
|
2817
2812
|
unitId: o,
|
|
2818
2813
|
subUnitId: r,
|
|
2819
2814
|
refSelections: s.current,
|
|
2820
|
-
editor:
|
|
2815
|
+
editor: l,
|
|
2821
2816
|
refSelectionsService: F,
|
|
2822
2817
|
refSelectionsRenderService: x,
|
|
2823
2818
|
sheetSkeletonManagerService: w,
|
|
2824
|
-
themeService:
|
|
2819
|
+
themeService: a,
|
|
2825
2820
|
univerInstanceService: g,
|
|
2826
2821
|
currentWorkbook: m
|
|
2827
2822
|
});
|
|
2828
2823
|
});
|
|
2829
2824
|
return () => A.unsubscribe();
|
|
2830
|
-
}, [d.textSelection$,
|
|
2825
|
+
}, [d.textSelection$, l, s, x, F, w, r, a, o, g]);
|
|
2831
2826
|
}, dc = (e, t, n, o, r, s) => {
|
|
2832
|
-
const c =
|
|
2827
|
+
const c = T(ve), i = T(Ge), f = T(ke).getRenderById(t), h = T(ne), g = f == null ? void 0 : f.with(Pe);
|
|
2833
2828
|
$(() => {
|
|
2834
2829
|
if (e && g)
|
|
2835
2830
|
if (n) {
|
|
@@ -2842,18 +2837,18 @@ const oc = (e, t, n, o) => {
|
|
|
2842
2837
|
}, 30);
|
|
2843
2838
|
}, d = c.onCommandExecuted((S) => {
|
|
2844
2839
|
S.id === Wn.id && u();
|
|
2845
|
-
}),
|
|
2840
|
+
}), a = h.getCurrentTypeOfUnit$(H.UNIVER_SHEET).subscribe((S) => {
|
|
2846
2841
|
u();
|
|
2847
2842
|
});
|
|
2848
2843
|
return () => {
|
|
2849
|
-
d.dispose(),
|
|
2844
|
+
d.dispose(), a.unsubscribe();
|
|
2850
2845
|
};
|
|
2851
2846
|
} else {
|
|
2852
2847
|
const u = c.beforeCommandExecuted((d) => {
|
|
2853
2848
|
if (d.id === Wn.id) {
|
|
2854
2849
|
o(!1), r(), s();
|
|
2855
|
-
const
|
|
2856
|
-
|
|
2850
|
+
const a = i.getEditor(un);
|
|
2851
|
+
a == null || a.focus();
|
|
2857
2852
|
}
|
|
2858
2853
|
});
|
|
2859
2854
|
return () => {
|
|
@@ -2862,7 +2857,7 @@ const oc = (e, t, n, o) => {
|
|
|
2862
2857
|
}
|
|
2863
2858
|
}, [e, g]);
|
|
2864
2859
|
}, hc = (e, t, n) => {
|
|
2865
|
-
const o =
|
|
2860
|
+
const o = T(Ie), r = z(!0);
|
|
2866
2861
|
$(() => {
|
|
2867
2862
|
if (e) {
|
|
2868
2863
|
const s = setTimeout(() => {
|
|
@@ -2879,28 +2874,28 @@ const oc = (e, t, n, o) => {
|
|
|
2879
2874
|
}
|
|
2880
2875
|
}, [n, t]);
|
|
2881
2876
|
}, fc = (e, t = [], n) => {
|
|
2882
|
-
const o =
|
|
2883
|
-
s([]), i(""),
|
|
2877
|
+
const o = T(Yt), [r, s] = V([]), [c, i] = V(""), l = z(-1), f = nt({ nodes: t }), h = () => {
|
|
2878
|
+
s([]), i(""), l.current = -1;
|
|
2884
2879
|
};
|
|
2885
2880
|
return $(() => {
|
|
2886
2881
|
if (n && e) {
|
|
2887
|
-
const u = n.input$.pipe(
|
|
2882
|
+
const u = n.input$.pipe(gn(300)).subscribe(() => {
|
|
2888
2883
|
const d = n.getSelectionRanges();
|
|
2889
2884
|
if (d.length === 1) {
|
|
2890
|
-
const
|
|
2885
|
+
const a = f.current.nodes, S = d[0];
|
|
2891
2886
|
if (S.collapsed) {
|
|
2892
|
-
const p =
|
|
2893
|
-
|
|
2894
|
-
const v =
|
|
2887
|
+
const p = En(a, S.startOffset - 1, !1);
|
|
2888
|
+
l.current = p;
|
|
2889
|
+
const v = a[p];
|
|
2895
2890
|
if (v && typeof v != "string" && v.nodeType === Q.FUNCTION) {
|
|
2896
|
-
|
|
2897
|
-
const C = v.token,
|
|
2898
|
-
s(
|
|
2891
|
+
l.current = p;
|
|
2892
|
+
const C = v.token, _ = o.getSearchListByNameFirstLetter(C);
|
|
2893
|
+
s(_), i(C);
|
|
2899
2894
|
return;
|
|
2900
2895
|
}
|
|
2901
2896
|
}
|
|
2902
2897
|
}
|
|
2903
|
-
|
|
2898
|
+
l.current = -1, i(""), s((a) => a != null && a.length ? [] : a);
|
|
2904
2899
|
});
|
|
2905
2900
|
return () => {
|
|
2906
2901
|
u.unsubscribe();
|
|
@@ -2913,10 +2908,10 @@ const oc = (e, t, n, o) => {
|
|
|
2913
2908
|
searchText: c,
|
|
2914
2909
|
handlerFormulaReplace: (u) => {
|
|
2915
2910
|
const d = [...f.current.nodes];
|
|
2916
|
-
if (
|
|
2917
|
-
const
|
|
2911
|
+
if (l.current !== -1) {
|
|
2912
|
+
const a = d.splice(l.current + 1), S = d.pop() || "";
|
|
2918
2913
|
let p = (typeof S == "string" ? S.length : S.token.length) - u.length;
|
|
2919
|
-
return d.push(u),
|
|
2914
|
+
return d.push(u), a[0] !== Ke.OPEN_BRACKET && (d.push(Ke.OPEN_BRACKET), p--), { text: an([...d, ...a]), offset: p };
|
|
2920
2915
|
}
|
|
2921
2916
|
},
|
|
2922
2917
|
reset: h
|
|
@@ -2924,12 +2919,12 @@ const oc = (e, t, n, o) => {
|
|
|
2924
2919
|
}, gc = () => {
|
|
2925
2920
|
}, mc = Ae(pc);
|
|
2926
2921
|
function pc(e, t) {
|
|
2927
|
-
const { isFocus: n, sequenceNodes: o, onSelect: r, editor: s, onClose: c = gc } = e, i = s.getEditorId(),
|
|
2928
|
-
const k = u(
|
|
2922
|
+
const { isFocus: n, sequenceNodes: o, onSelect: r, editor: s, onClose: c = gc } = e, i = s.getEditorId(), l = T(Gt), f = T(ve), { searchList: h, searchText: g, handlerFormulaReplace: u, reset: d } = fc(n, o, s), a = se(() => !!h.length, [h]), S = z(void 0), [p, v] = V(0), C = z(!1), [_] = Ar(i, a, [g, h]), R = nt({ searchList: h, active: p }), m = (y) => {
|
|
2923
|
+
const k = u(y);
|
|
2929
2924
|
k && (d(), r(k));
|
|
2930
2925
|
};
|
|
2931
|
-
function O(
|
|
2932
|
-
C.current && v(
|
|
2926
|
+
function O(y) {
|
|
2927
|
+
C.current && v(y);
|
|
2933
2928
|
}
|
|
2934
2929
|
function x() {
|
|
2935
2930
|
C.current && v(-1);
|
|
@@ -2937,8 +2932,8 @@ function pc(e, t) {
|
|
|
2937
2932
|
$(() => {
|
|
2938
2933
|
if (!h.length)
|
|
2939
2934
|
return;
|
|
2940
|
-
const
|
|
2941
|
-
const { searchList: E, active: b } =
|
|
2935
|
+
const y = `sheet.formula-embedding-editor.search_function.${i}`, k = new qe(), A = (I) => {
|
|
2936
|
+
const { searchList: E, active: b } = R.current;
|
|
2942
2937
|
switch (I) {
|
|
2943
2938
|
case L.ARROW_UP: {
|
|
2944
2939
|
v((M) => {
|
|
@@ -2967,14 +2962,14 @@ function pc(e, t) {
|
|
|
2967
2962
|
}
|
|
2968
2963
|
};
|
|
2969
2964
|
return k.add(f.registerCommand({
|
|
2970
|
-
id:
|
|
2965
|
+
id: y,
|
|
2971
2966
|
type: Me.OPERATION,
|
|
2972
2967
|
handler(I, E) {
|
|
2973
2968
|
const { keyCode: b } = E;
|
|
2974
2969
|
A(b);
|
|
2975
2970
|
}
|
|
2976
2971
|
})), [L.ARROW_UP, L.ARROW_DOWN, L.ENTER, L.ESC, L.TAB].map((I) => ({
|
|
2977
|
-
id:
|
|
2972
|
+
id: y,
|
|
2978
2973
|
binding: I,
|
|
2979
2974
|
preconditions: () => !0,
|
|
2980
2975
|
priority: 1e3,
|
|
@@ -2983,15 +2978,15 @@ function pc(e, t) {
|
|
|
2983
2978
|
keyCode: I
|
|
2984
2979
|
}
|
|
2985
2980
|
})).forEach((I) => {
|
|
2986
|
-
k.add(
|
|
2981
|
+
k.add(l.registerShortcut(I));
|
|
2987
2982
|
}), () => {
|
|
2988
2983
|
k.dispose();
|
|
2989
2984
|
};
|
|
2990
2985
|
}, [h]);
|
|
2991
|
-
function w(
|
|
2986
|
+
function w(y) {
|
|
2992
2987
|
const k = S.current;
|
|
2993
2988
|
if (!k) return;
|
|
2994
|
-
const A = k.children[
|
|
2989
|
+
const A = k.children[y];
|
|
2995
2990
|
if (!A) return;
|
|
2996
2991
|
const E = k.getBoundingClientRect().top, b = k.offsetHeight, M = A.getBoundingClientRect(), D = M.top, U = M.height;
|
|
2997
2992
|
if (D >= 0 && D > E && D - E + U <= b)
|
|
@@ -3003,22 +2998,22 @@ function pc(e, t) {
|
|
|
3003
2998
|
});
|
|
3004
2999
|
}
|
|
3005
3000
|
const F = se(() => {
|
|
3006
|
-
let
|
|
3001
|
+
let y = "";
|
|
3007
3002
|
return () => {
|
|
3008
|
-
clearTimeout(
|
|
3003
|
+
clearTimeout(y), C.current = !0, y = setTimeout(() => {
|
|
3009
3004
|
C.current = !1;
|
|
3010
3005
|
}, 300);
|
|
3011
3006
|
};
|
|
3012
3007
|
}, []);
|
|
3013
|
-
return h.length > 0 &&
|
|
3008
|
+
return h.length > 0 && a && /* @__PURE__ */ N(on, { portal: !0, anchorRect$: _, direction: "vertical", children: /* @__PURE__ */ N(
|
|
3014
3009
|
"ul",
|
|
3015
3010
|
{
|
|
3016
|
-
ref: (
|
|
3017
|
-
S.current =
|
|
3011
|
+
ref: (y) => {
|
|
3012
|
+
S.current = y, t && (t.current = y);
|
|
3018
3013
|
},
|
|
3019
3014
|
"data-u-comp": "sheets-formula-editor",
|
|
3020
|
-
className: re("univer-m-0 univer-box-border univer-max-h-[400px] univer-w-[250px] univer-list-none univer-overflow-y-auto univer-rounded-lg univer-bg-white univer-p-2 univer-leading-5 univer-shadow-md univer-outline-none dark:!univer-bg-gray-900",
|
|
3021
|
-
children: h.map((
|
|
3015
|
+
className: re("univer-m-0 univer-box-border univer-max-h-[400px] univer-w-[250px] univer-list-none univer-overflow-y-auto univer-rounded-lg univer-bg-white univer-p-2 univer-leading-5 univer-shadow-md univer-outline-none dark:!univer-bg-gray-900", Cn, lt),
|
|
3016
|
+
children: h.map((y, k) => /* @__PURE__ */ W(
|
|
3022
3017
|
"li",
|
|
3023
3018
|
{
|
|
3024
3019
|
className: re("univer-box-border univer-cursor-pointer univer-rounded univer-px-2 univer-py-1 univer-text-gray-900 univer-transition-colors dark:!univer-text-white", {
|
|
@@ -3028,30 +3023,30 @@ function pc(e, t) {
|
|
|
3028
3023
|
onMouseLeave: x,
|
|
3029
3024
|
onMouseMove: F,
|
|
3030
3025
|
onClick: () => {
|
|
3031
|
-
m(
|
|
3026
|
+
m(y.name), s && s.focus();
|
|
3032
3027
|
},
|
|
3033
3028
|
children: [
|
|
3034
3029
|
/* @__PURE__ */ W("span", { className: "univer-text-xs", children: [
|
|
3035
|
-
/* @__PURE__ */ N("span", { className: "univer-text-red-500", children:
|
|
3036
|
-
/* @__PURE__ */ N("span", { children:
|
|
3030
|
+
/* @__PURE__ */ N("span", { className: "univer-text-red-500", children: y.name.substring(0, g.length) }),
|
|
3031
|
+
/* @__PURE__ */ N("span", { children: y.name.slice(g.length) })
|
|
3037
3032
|
] }),
|
|
3038
3033
|
/* @__PURE__ */ N(
|
|
3039
3034
|
"span",
|
|
3040
3035
|
{
|
|
3041
3036
|
className: "univer-block univer-text-xs univer-text-gray-400",
|
|
3042
|
-
children:
|
|
3037
|
+
children: y.desc
|
|
3043
3038
|
}
|
|
3044
3039
|
)
|
|
3045
3040
|
]
|
|
3046
3041
|
},
|
|
3047
|
-
|
|
3042
|
+
y.name
|
|
3048
3043
|
))
|
|
3049
3044
|
}
|
|
3050
3045
|
) });
|
|
3051
3046
|
}
|
|
3052
3047
|
const vc = (e) => e.startsWith(ir.EQUALS) ? e.slice(1) : "", zn = () => {
|
|
3053
3048
|
}, Sc = Ae((e, t) => {
|
|
3054
|
-
var
|
|
3049
|
+
var Qt, bn;
|
|
3055
3050
|
const {
|
|
3056
3051
|
errorText: n,
|
|
3057
3052
|
initValue: o,
|
|
@@ -3059,34 +3054,34 @@ const vc = (e) => e.startsWith(ir.EQUALS) ? e.slice(1) : "", zn = () => {
|
|
|
3059
3054
|
subUnitId: s,
|
|
3060
3055
|
isFocus: c = !0,
|
|
3061
3056
|
isSupportAcrossSheet: i = !1,
|
|
3062
|
-
onFocus:
|
|
3057
|
+
onFocus: l = zn,
|
|
3063
3058
|
onBlur: f = zn,
|
|
3064
3059
|
onChange: h,
|
|
3065
3060
|
onVerify: g,
|
|
3066
3061
|
className: u,
|
|
3067
3062
|
editorId: d,
|
|
3068
|
-
moveCursor:
|
|
3063
|
+
moveCursor: a = !0,
|
|
3069
3064
|
onFormulaSelectingChange: S,
|
|
3070
3065
|
keyboardEventConfig: p,
|
|
3071
3066
|
onMoveInEditor: v,
|
|
3072
3067
|
resetSelectionOnBlur: C = !0,
|
|
3073
|
-
autoScrollbar:
|
|
3074
|
-
isSingle:
|
|
3068
|
+
autoScrollbar: _ = !0,
|
|
3069
|
+
isSingle: R = !0,
|
|
3075
3070
|
disableSelectionOnClick: m = !1,
|
|
3076
3071
|
autofocus: O = !0,
|
|
3077
3072
|
disableContextMenu: x,
|
|
3078
3073
|
style: w
|
|
3079
|
-
} = e, F =
|
|
3074
|
+
} = e, F = T(Ge), y = z(null), k = te(h);
|
|
3080
3075
|
vs(t, () => ({
|
|
3081
|
-
isClickOutSide: (Z) =>
|
|
3076
|
+
isClickOutSide: (Z) => y.current ? !y.current.contains(Z.target) : !1
|
|
3082
3077
|
}));
|
|
3083
|
-
const A = te(S), I = z(null), E = z(void 0), b = E.current, [M, D] = V(c), U = z(null), B = se(() => d != null ? d : Jr(`${bo}-${
|
|
3078
|
+
const A = te(S), I = z(null), E = z(void 0), b = E.current, [M, D] = V(c), U = z(null), B = se(() => d != null ? d : Jr(`${bo}-${jt(4)}`), []), ie = se(() => n !== void 0, [n]), ce = T(ne), de = ce.getUnit(B);
|
|
3084
3079
|
Ce(de == null ? void 0 : de.change$);
|
|
3085
|
-
const K = Ji(), J = eo.transform.getPlainText((
|
|
3080
|
+
const K = Ji(), J = eo.transform.getPlainText((bn = (Qt = de == null ? void 0 : de.getBody()) == null ? void 0 : Qt.dataStream) != null ? bn : ""), rt = nt(J), ot = se(() => vc(J), [J]), yt = se(() => K(ot), [ot, K]), { isSelecting: be, isSelectingRef: Y } = Qi({ unitId: r, subUnitId: s, editorId: B, isFocus: M, disableOnClick: m }), X = z(""), he = T(ke).getRenderById(B), ee = he == null ? void 0 : he.with(ur), ae = ee == null ? void 0 : ee.isFocusing, Te = se(() => ce.getCurrentTypeOfUnit$(H.UNIVER_DOC), [ce]), Ue = Ce(Te), Fe = (Ue == null ? void 0 : Ue.getUnitId()) === B, G = z([]), fe = be;
|
|
3086
3081
|
gs(() => {
|
|
3087
3082
|
k(J);
|
|
3088
3083
|
}, [J, k]);
|
|
3089
|
-
const Ve = Dr("="),
|
|
3084
|
+
const Ve = Dr("="), st = tc(r, s), ge = te((Z, oe = !0, De, Oe) => {
|
|
3090
3085
|
if (!E.current) return;
|
|
3091
3086
|
X.current = Z;
|
|
3092
3087
|
const Nt = Z[0] === "=" ? Z.slice(1) : "", Le = K(Nt), Pr = Le.reduce((We, Mt) => typeof Mt == "object" ? `${We}${Mt.token}` : `${We}${Mt}`, ""), xt = Ve(
|
|
@@ -3099,12 +3094,12 @@ const vc = (e) => e.startsWith(ir.EQUALS) ? e.slice(1) : "", zn = () => {
|
|
|
3099
3094
|
const We = Oe != null ? Oe : b == null ? void 0 : b.getSelectionRanges();
|
|
3100
3095
|
if ((We == null ? void 0 : We.length) !== 1)
|
|
3101
3096
|
return;
|
|
3102
|
-
const Ur = We[0].startOffset - 1, Vr =
|
|
3103
|
-
if (
|
|
3104
|
-
const
|
|
3105
|
-
|
|
3097
|
+
const Ur = We[0].startOffset - 1, Vr = En(Le, Ur, !1), yn = kr(Le, Vr);
|
|
3098
|
+
if (yn >= 0) {
|
|
3099
|
+
const Tn = xt.splice(yn, 1)[0];
|
|
3100
|
+
Tn && xt.push(Tn);
|
|
3106
3101
|
}
|
|
3107
|
-
|
|
3102
|
+
st(M ? xt : [], E.current);
|
|
3108
3103
|
}
|
|
3109
3104
|
});
|
|
3110
3105
|
$(() => {
|
|
@@ -3119,7 +3114,7 @@ const vc = (e) => e.startsWith(ir.EQUALS) ? e.slice(1) : "", zn = () => {
|
|
|
3119
3114
|
$(() => {
|
|
3120
3115
|
var Z;
|
|
3121
3116
|
A(be, (Z = ee == null ? void 0 : ee.isFocusing) != null ? Z : !0);
|
|
3122
|
-
}, [A, be]), Go(M, p, b),
|
|
3117
|
+
}, [A, be]), Go(M, p, b), Lt(() => {
|
|
3123
3118
|
let Z;
|
|
3124
3119
|
if (U.current) {
|
|
3125
3120
|
Z = F.register({
|
|
@@ -3144,12 +3139,12 @@ const vc = (e) => e.startsWith(ir.EQUALS) ? e.slice(1) : "", zn = () => {
|
|
|
3144
3139
|
return () => {
|
|
3145
3140
|
Z == null || Z.dispose();
|
|
3146
3141
|
};
|
|
3147
|
-
}, []),
|
|
3142
|
+
}, []), Lt(() => {
|
|
3148
3143
|
c ? (D(c), me()) : (C && (b == null || b.blur(), _e()), D(c));
|
|
3149
3144
|
}, [c, b, me, _e, C]);
|
|
3150
|
-
const { checkScrollBar: Tt } = Zo(b,
|
|
3151
|
-
sc(M, !!(be && Fe), r, x), oc(!!(M && ae &&
|
|
3152
|
-
const
|
|
3145
|
+
const { checkScrollBar: Tt } = Zo(b, R, _);
|
|
3146
|
+
sc(M, !!(be && Fe), r, B, x), oc(!!(M && ae && a), fe, b, v);
|
|
3147
|
+
const Xt = te((Z, oe, De) => {
|
|
3153
3148
|
if (!ae)
|
|
3154
3149
|
return;
|
|
3155
3150
|
const Oe = oe !== -1 ? [{ startOffset: oe + 1, endOffset: oe + 1, collapsed: !0 }] : void 0;
|
|
@@ -3168,9 +3163,9 @@ const vc = (e) => e.startsWith(ir.EQUALS) ? e.slice(1) : "", zn = () => {
|
|
|
3168
3163
|
i,
|
|
3169
3164
|
!!fe,
|
|
3170
3165
|
b,
|
|
3171
|
-
|
|
3166
|
+
Xt
|
|
3172
3167
|
), dc(M && !!(be && Fe), r, i, D, f, () => {
|
|
3173
|
-
ge(
|
|
3168
|
+
ge(rt.current, !1, !0);
|
|
3174
3169
|
});
|
|
3175
3170
|
const Ot = (Z) => {
|
|
3176
3171
|
if (Z) {
|
|
@@ -3186,14 +3181,14 @@ const vc = (e) => e.startsWith(ir.EQUALS) ? e.slice(1) : "", zn = () => {
|
|
|
3186
3181
|
}
|
|
3187
3182
|
me(), ge(`=${Z.text}`);
|
|
3188
3183
|
}
|
|
3189
|
-
},
|
|
3190
|
-
D(!0),
|
|
3184
|
+
}, In = () => {
|
|
3185
|
+
D(!0), l(), me();
|
|
3191
3186
|
};
|
|
3192
3187
|
return /* @__PURE__ */ W("div", { className: u, children: [
|
|
3193
3188
|
/* @__PURE__ */ N(
|
|
3194
3189
|
"div",
|
|
3195
3190
|
{
|
|
3196
|
-
ref:
|
|
3191
|
+
ref: y,
|
|
3197
3192
|
className: re("univer-relative univer-box-border univer-flex univer-h-full univer-w-full univer-items-center univer-justify-around univer-gap-2 univer-rounded-none univer-p-0 univer-ring-1", {
|
|
3198
3193
|
"univer-ring-primary-500": M,
|
|
3199
3194
|
"univer-ring-red-500": ie
|
|
@@ -3203,13 +3198,13 @@ const vc = (e) => e.startsWith(ir.EQUALS) ? e.slice(1) : "", zn = () => {
|
|
|
3203
3198
|
{
|
|
3204
3199
|
ref: U,
|
|
3205
3200
|
className: "univer-relative univer-h-full univer-w-full",
|
|
3206
|
-
onMouseUp:
|
|
3201
|
+
onMouseUp: In
|
|
3207
3202
|
}
|
|
3208
3203
|
)
|
|
3209
3204
|
}
|
|
3210
3205
|
),
|
|
3211
3206
|
n !== void 0 && /* @__PURE__ */ N("div", { className: "univer-my-1 univer-text-xs univer-text-red-500", children: n }),
|
|
3212
|
-
b &&
|
|
3207
|
+
b && ot !== "" && /* @__PURE__ */ N(
|
|
3213
3208
|
Zi,
|
|
3214
3209
|
{
|
|
3215
3210
|
editor: b,
|
|
@@ -3231,7 +3226,7 @@ const vc = (e) => e.startsWith(ir.EQUALS) ? e.slice(1) : "", zn = () => {
|
|
|
3231
3226
|
] });
|
|
3232
3227
|
});
|
|
3233
3228
|
function Cc(e, t, n, o) {
|
|
3234
|
-
const r =
|
|
3229
|
+
const r = T(Ie), s = Dr(""), c = Ce(e == null ? void 0 : e.getDocumentDataModel().change$), [i, l] = V([]), f = T(yo), h = z(""), g = T(ne);
|
|
3235
3230
|
return $(() => {
|
|
3236
3231
|
if (!e) return;
|
|
3237
3232
|
const u = e.getDocumentDataModel().getPlainText();
|
|
@@ -3239,9 +3234,9 @@ function Cc(e, t, n, o) {
|
|
|
3239
3234
|
return;
|
|
3240
3235
|
h.current = u;
|
|
3241
3236
|
const d = r.sequenceNodesBuilder(u);
|
|
3242
|
-
|
|
3237
|
+
l(d != null ? d : []);
|
|
3243
3238
|
}, [c, e, r]), $(() => {
|
|
3244
|
-
var
|
|
3239
|
+
var a, S;
|
|
3245
3240
|
if (!e) return;
|
|
3246
3241
|
if (!t) {
|
|
3247
3242
|
const p = e.getDocumentData();
|
|
@@ -3249,7 +3244,7 @@ function Cc(e, t, n, o) {
|
|
|
3249
3244
|
...p,
|
|
3250
3245
|
body: {
|
|
3251
3246
|
...p.body,
|
|
3252
|
-
dataStream: (S = (
|
|
3247
|
+
dataStream: (S = (a = p.body) == null ? void 0 : a.dataStream) != null ? S : "",
|
|
3253
3248
|
textRuns: []
|
|
3254
3249
|
}
|
|
3255
3250
|
});
|
|
@@ -3257,14 +3252,14 @@ function Cc(e, t, n, o) {
|
|
|
3257
3252
|
}
|
|
3258
3253
|
const u = s(e, i, !1), d = new qe();
|
|
3259
3254
|
return u.forEach((p) => {
|
|
3260
|
-
const v = ht(p.token), C = g.getCurrentUnitForType(H.UNIVER_SHEET),
|
|
3261
|
-
if (!v.sheetName && o !== (
|
|
3255
|
+
const v = ht(p.token), C = g.getCurrentUnitForType(H.UNIVER_SHEET), _ = C == null ? void 0 : C.getActiveSheet();
|
|
3256
|
+
if (!v.sheetName && o !== (_ == null ? void 0 : _.getSheetId()) || v.sheetName && (_ == null ? void 0 : _.getName()) !== v.sheetName)
|
|
3262
3257
|
return;
|
|
3263
|
-
const
|
|
3258
|
+
const R = new hn(p.themeColor).toRgb(), m = f.addShape({
|
|
3264
3259
|
range: v.range,
|
|
3265
3260
|
style: {
|
|
3266
3261
|
stroke: p.themeColor,
|
|
3267
|
-
fill: `rgba(${
|
|
3262
|
+
fill: `rgba(${R.r}, ${R.g}, ${R.b}, 0.1)`,
|
|
3268
3263
|
strokeDash: 12
|
|
3269
3264
|
},
|
|
3270
3265
|
primary: null
|
|
@@ -3276,15 +3271,15 @@ function Cc(e, t, n, o) {
|
|
|
3276
3271
|
}, [e, t, s, f, i]), { sequenceNodes: i };
|
|
3277
3272
|
}
|
|
3278
3273
|
function _c(e) {
|
|
3279
|
-
const t =
|
|
3274
|
+
const t = T(mn), { supportAcrossSheet: n = !1, unitId: o, subUnitId: r, onChange: s } = e, i = T(ne).getUnit(o, H.UNIVER_SHEET), l = te(s), f = te((h, g) => {
|
|
3280
3275
|
const u = i == null ? void 0 : i.getActiveSheet();
|
|
3281
3276
|
if (!u || !n && u.getSheetId() !== r || !(h != null && h.length)) return;
|
|
3282
|
-
const d = h.map((
|
|
3283
|
-
range:
|
|
3277
|
+
const d = h.map((a) => ({
|
|
3278
|
+
range: a.range,
|
|
3284
3279
|
unitId: o,
|
|
3285
3280
|
sheetName: u.getSheetId() === r ? "" : u.getName()
|
|
3286
3281
|
}));
|
|
3287
|
-
|
|
3282
|
+
l(d, g);
|
|
3288
3283
|
});
|
|
3289
3284
|
$(() => {
|
|
3290
3285
|
const h = new qe();
|
|
@@ -3301,7 +3296,7 @@ function _c(e) {
|
|
|
3301
3296
|
}
|
|
3302
3297
|
const Xn = (e) => !e.some((n) => {
|
|
3303
3298
|
if (typeof n == "string") {
|
|
3304
|
-
if (n !==
|
|
3299
|
+
if (n !== Ke.COMMA)
|
|
3305
3300
|
return !0;
|
|
3306
3301
|
} else if (n.nodeType !== Q.REFERENCE)
|
|
3307
3302
|
return !0;
|
|
@@ -3326,45 +3321,45 @@ function Ec(e) {
|
|
|
3326
3321
|
maxRangeCount: s = 1 / 0,
|
|
3327
3322
|
supportAcrossSheet: c,
|
|
3328
3323
|
onConfirm: i,
|
|
3329
|
-
onClose:
|
|
3324
|
+
onClose: l,
|
|
3330
3325
|
onShowBySelection: f
|
|
3331
|
-
} = e, h =
|
|
3326
|
+
} = e, h = T(dt), g = T(Ie), [u, d] = V([]), [a, S] = V(0), p = z(null);
|
|
3332
3327
|
$(() => {
|
|
3333
3328
|
if (t && n.length) {
|
|
3334
|
-
const
|
|
3335
|
-
d(
|
|
3329
|
+
const R = n.map((m) => m.sheetName ? Ct(m.sheetName, m.range) : Ee(m.range));
|
|
3330
|
+
d(R), S(R.length - 1);
|
|
3336
3331
|
} else
|
|
3337
3332
|
d([""]), S(0);
|
|
3338
3333
|
}, [t]);
|
|
3339
|
-
const v = (
|
|
3334
|
+
const v = (R, m) => {
|
|
3340
3335
|
const O = [...u];
|
|
3341
|
-
O[
|
|
3336
|
+
O[R] = m, d(O);
|
|
3342
3337
|
}, C = () => {
|
|
3343
3338
|
d([...u, ""]), S(u.length);
|
|
3344
|
-
},
|
|
3345
|
-
u.splice(
|
|
3339
|
+
}, _ = (R) => {
|
|
3340
|
+
u.splice(R, 1), d([...u]);
|
|
3346
3341
|
};
|
|
3347
3342
|
return _c({
|
|
3348
3343
|
unitId: o,
|
|
3349
3344
|
subUnitId: r,
|
|
3350
3345
|
supportAcrossSheet: c,
|
|
3351
|
-
onChange: (
|
|
3352
|
-
if (!t && f != null && f(
|
|
3346
|
+
onChange: (R, m) => {
|
|
3347
|
+
if (!t && f != null && f(R))
|
|
3353
3348
|
return;
|
|
3354
|
-
const O = new Set(u), x =
|
|
3349
|
+
const O = new Set(u), x = R.map((y) => y.sheetName ? Ct(y.sheetName, y.range) : Ee(y.range)), w = x.filter((y) => !O.has(y));
|
|
3355
3350
|
if (!w.length) return;
|
|
3356
3351
|
const F = [...u];
|
|
3357
3352
|
if (x.length > 1) {
|
|
3358
|
-
m || F.splice(
|
|
3359
|
-
const
|
|
3360
|
-
d(
|
|
3353
|
+
m || F.splice(a, 1), F.push(...w);
|
|
3354
|
+
const y = F.slice(0, s);
|
|
3355
|
+
d(y), S(y.length - 1), requestAnimationFrame(() => {
|
|
3361
3356
|
var k;
|
|
3362
3357
|
(k = p.current) == null || k.scrollTo({ top: p.current.scrollHeight });
|
|
3363
3358
|
});
|
|
3364
3359
|
} else {
|
|
3365
|
-
F.splice(
|
|
3366
|
-
const
|
|
3367
|
-
d(
|
|
3360
|
+
F.splice(a, 1, ...w);
|
|
3361
|
+
const y = F.slice(0, s);
|
|
3362
|
+
d(y), S(a + w.length - 1);
|
|
3368
3363
|
}
|
|
3369
3364
|
}
|
|
3370
3365
|
}), /* @__PURE__ */ N(
|
|
@@ -3377,31 +3372,31 @@ function Ec(e) {
|
|
|
3377
3372
|
mask: !1,
|
|
3378
3373
|
maskClosable: !1,
|
|
3379
3374
|
footer: /* @__PURE__ */ W("footer", { className: "univer-flex univer-gap-2", children: [
|
|
3380
|
-
/* @__PURE__ */ N(
|
|
3375
|
+
/* @__PURE__ */ N(at, { onClick: l, children: h.t("rangeSelector.cancel") }),
|
|
3381
3376
|
/* @__PURE__ */ N(
|
|
3382
|
-
|
|
3377
|
+
at,
|
|
3383
3378
|
{
|
|
3384
3379
|
variant: "primary",
|
|
3385
3380
|
onClick: () => {
|
|
3386
3381
|
i(
|
|
3387
|
-
u.filter((
|
|
3388
|
-
const m = g.sequenceNodesBuilder(
|
|
3382
|
+
u.filter((R) => {
|
|
3383
|
+
const m = g.sequenceNodesBuilder(R);
|
|
3389
3384
|
return m && m.length === 1 && typeof m[0] != "string" && m[0].nodeType === Q.REFERENCE;
|
|
3390
|
-
}).map((
|
|
3385
|
+
}).map((R) => ht(R)).map((R) => ({ ...R, range: Rc(R.range) }))
|
|
3391
3386
|
);
|
|
3392
3387
|
},
|
|
3393
3388
|
children: h.t("rangeSelector.confirm")
|
|
3394
3389
|
}
|
|
3395
3390
|
)
|
|
3396
3391
|
] }),
|
|
3397
|
-
onClose:
|
|
3392
|
+
onClose: l,
|
|
3398
3393
|
children: /* @__PURE__ */ W(
|
|
3399
3394
|
"div",
|
|
3400
3395
|
{
|
|
3401
3396
|
ref: p,
|
|
3402
3397
|
className: re("-univer-mx-6 univer-max-h-60 univer-overflow-y-auto univer-px-6", lt),
|
|
3403
3398
|
children: [
|
|
3404
|
-
u.map((
|
|
3399
|
+
u.map((R, m) => /* @__PURE__ */ W(
|
|
3405
3400
|
"div",
|
|
3406
3401
|
{
|
|
3407
3402
|
className: "univer-mb-2 univer-flex univer-items-center univer-gap-4",
|
|
@@ -3410,11 +3405,11 @@ function Ec(e) {
|
|
|
3410
3405
|
mr,
|
|
3411
3406
|
{
|
|
3412
3407
|
className: re("univer-w-full", {
|
|
3413
|
-
"univer-border-primary-600":
|
|
3408
|
+
"univer-border-primary-600": a === m
|
|
3414
3409
|
}),
|
|
3415
3410
|
placeholder: h.t("rangeSelector.placeHolder"),
|
|
3416
3411
|
onFocus: () => S(m),
|
|
3417
|
-
value:
|
|
3412
|
+
value: R,
|
|
3418
3413
|
onChange: (O) => v(m, O)
|
|
3419
3414
|
}
|
|
3420
3415
|
),
|
|
@@ -3422,14 +3417,14 @@ function Ec(e) {
|
|
|
3422
3417
|
Or,
|
|
3423
3418
|
{
|
|
3424
3419
|
className: "univer-cursor-pointer",
|
|
3425
|
-
onClick: () =>
|
|
3420
|
+
onClick: () => _(m)
|
|
3426
3421
|
}
|
|
3427
3422
|
)
|
|
3428
3423
|
]
|
|
3429
3424
|
},
|
|
3430
3425
|
m
|
|
3431
3426
|
)),
|
|
3432
|
-
u.length < s && /* @__PURE__ */ N("div", { children: /* @__PURE__ */ W(
|
|
3427
|
+
u.length < s && /* @__PURE__ */ N("div", { children: /* @__PURE__ */ W(at, { variant: "link", onClick: C, children: [
|
|
3433
3428
|
/* @__PURE__ */ N(Nr, {}),
|
|
3434
3429
|
/* @__PURE__ */ N("span", { children: h.t("rangeSelector.addAnotherRange") })
|
|
3435
3430
|
] }) })
|
|
@@ -3440,10 +3435,10 @@ function Ec(e) {
|
|
|
3440
3435
|
);
|
|
3441
3436
|
}
|
|
3442
3437
|
function Ic(e) {
|
|
3443
|
-
return e.split(
|
|
3438
|
+
return e.split(Ke.COMMA).filter((t) => !!t).map((t) => ht(t));
|
|
3444
3439
|
}
|
|
3445
3440
|
function bc(e) {
|
|
3446
|
-
return e.map((t) => t.sheetName ? Ct(t.sheetName, t.range) : Ee(t.range)).join(
|
|
3441
|
+
return e.map((t) => t.sheetName ? Ct(t.sheetName, t.range) : Ee(t.range)).join(Ke.COMMA);
|
|
3447
3442
|
}
|
|
3448
3443
|
function Lr(e) {
|
|
3449
3444
|
const [t, n] = V(null), {
|
|
@@ -3452,20 +3447,20 @@ function Lr(e) {
|
|
|
3452
3447
|
unitId: s,
|
|
3453
3448
|
subUnitId: c,
|
|
3454
3449
|
maxRangeCount: i,
|
|
3455
|
-
supportAcrossSheet:
|
|
3450
|
+
supportAcrossSheet: l,
|
|
3456
3451
|
autoFocus: f,
|
|
3457
3452
|
onChange: h,
|
|
3458
3453
|
onRangeSelectorDialogVisibleChange: g,
|
|
3459
3454
|
onClickOutside: u,
|
|
3460
3455
|
onFocusChange: d,
|
|
3461
|
-
forceShowDialogWhenSelectionChanged:
|
|
3456
|
+
forceShowDialogWhenSelectionChanged: a,
|
|
3462
3457
|
hideEditor: S,
|
|
3463
3458
|
resetRange: p
|
|
3464
|
-
} = e, [v, C] = V(f != null ? f : !1), [
|
|
3459
|
+
} = e, [v, C] = V(f != null ? f : !1), [_, R] = V(!1), [m, O] = V([]), x = T(dt), w = T(Ge), { sequenceNodes: F } = Cc(t, v, s, c), y = nt(F), k = T(ve), A = te(() => {
|
|
3465
3460
|
t == null || t.setSelectionRanges([]), t == null || t.blur(), w.blur();
|
|
3466
3461
|
}), I = te(() => {
|
|
3467
3462
|
var E;
|
|
3468
|
-
A(), O(Ic((E = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? E : "")),
|
|
3463
|
+
A(), O(Ic((E = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? E : "")), R(!0);
|
|
3469
3464
|
});
|
|
3470
3465
|
return $(() => {
|
|
3471
3466
|
r && (r.current = {
|
|
@@ -3476,34 +3471,34 @@ function Lr(e) {
|
|
|
3476
3471
|
w.focus(t.getEditorId());
|
|
3477
3472
|
},
|
|
3478
3473
|
blur: A,
|
|
3479
|
-
verify: () => Xn(
|
|
3474
|
+
verify: () => Xn(y.current),
|
|
3480
3475
|
showDialog: (E) => {
|
|
3481
|
-
A(), O(E),
|
|
3476
|
+
A(), O(E), R(!0);
|
|
3482
3477
|
},
|
|
3483
3478
|
hideDialog: () => {
|
|
3484
|
-
O([]),
|
|
3479
|
+
O([]), R(!1);
|
|
3485
3480
|
},
|
|
3486
3481
|
getValue: () => {
|
|
3487
3482
|
var E;
|
|
3488
3483
|
return (E = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? E : "";
|
|
3489
3484
|
}
|
|
3490
3485
|
});
|
|
3491
|
-
}, [A, t, w, r,
|
|
3486
|
+
}, [A, t, w, r, y]), $(() => {
|
|
3492
3487
|
var E;
|
|
3493
3488
|
o == null || o(Xn(F), (E = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? E : "");
|
|
3494
3489
|
}, [F]), $(() => {
|
|
3495
|
-
g == null || g(
|
|
3496
|
-
}, [
|
|
3497
|
-
if (
|
|
3490
|
+
g == null || g(_);
|
|
3491
|
+
}, [_]), $(() => {
|
|
3492
|
+
if (_ && p)
|
|
3498
3493
|
return () => {
|
|
3499
3494
|
const E = {
|
|
3500
3495
|
unitId: s,
|
|
3501
3496
|
subUnitId: c,
|
|
3502
3497
|
selections: p
|
|
3503
3498
|
};
|
|
3504
|
-
k.executeCommand(
|
|
3499
|
+
k.executeCommand(pn.id, E);
|
|
3505
3500
|
};
|
|
3506
|
-
}, [
|
|
3501
|
+
}, [_]), /* @__PURE__ */ W(ps, { children: [
|
|
3507
3502
|
S ? null : /* @__PURE__ */ N(
|
|
3508
3503
|
Xo,
|
|
3509
3504
|
{
|
|
@@ -3531,26 +3526,26 @@ function Lr(e) {
|
|
|
3531
3526
|
initialValue: m,
|
|
3532
3527
|
unitId: s,
|
|
3533
3528
|
subUnitId: c,
|
|
3534
|
-
visible:
|
|
3529
|
+
visible: _,
|
|
3535
3530
|
maxRangeCount: i,
|
|
3536
3531
|
onConfirm: (E) => {
|
|
3537
3532
|
const b = bc(E), M = to.newEmptyData();
|
|
3538
|
-
M.body.dataStream = b, t == null || t.replaceText(b, !1), h == null || h(M, b),
|
|
3533
|
+
M.body.dataStream = b, t == null || t.replaceText(b, !1), h == null || h(M, b), R(!1), O([]), requestAnimationFrame(() => {
|
|
3539
3534
|
A();
|
|
3540
3535
|
});
|
|
3541
3536
|
},
|
|
3542
3537
|
onClose: () => {
|
|
3543
|
-
|
|
3538
|
+
R(!1), O([]);
|
|
3544
3539
|
},
|
|
3545
|
-
supportAcrossSheet:
|
|
3546
|
-
onShowBySelection: (E) => v ||
|
|
3540
|
+
supportAcrossSheet: l,
|
|
3541
|
+
onShowBySelection: (E) => v || a ? (O(E), R(!0), !1) : !0
|
|
3547
3542
|
}
|
|
3548
3543
|
)
|
|
3549
3544
|
] });
|
|
3550
3545
|
}
|
|
3551
3546
|
const yc = () => {
|
|
3552
3547
|
var o, r;
|
|
3553
|
-
const e =
|
|
3548
|
+
const e = T(wr), t = Ce(e.currentSelector$), n = z(null);
|
|
3554
3549
|
return $(() => {
|
|
3555
3550
|
var s, c;
|
|
3556
3551
|
if (t)
|
|
@@ -3567,7 +3562,7 @@ const yc = () => {
|
|
|
3567
3562
|
selectorRef: n,
|
|
3568
3563
|
onChange: (s, c) => {
|
|
3569
3564
|
var i;
|
|
3570
|
-
t == null || t.callback((i = c == null ? void 0 : c.split(",").map((
|
|
3565
|
+
t == null || t.callback((i = c == null ? void 0 : c.split(",").map((l) => ht(l))) != null ? i : []);
|
|
3571
3566
|
}
|
|
3572
3567
|
}
|
|
3573
3568
|
);
|
|
@@ -3576,8 +3571,8 @@ var Tc = Object.defineProperty, Oc = Object.getOwnPropertyDescriptor, Nc = (e, t
|
|
|
3576
3571
|
for (var r = o > 1 ? void 0 : o ? Oc(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
3577
3572
|
(c = e[s]) && (r = c(r) || r);
|
|
3578
3573
|
return r;
|
|
3579
|
-
},
|
|
3580
|
-
let
|
|
3574
|
+
}, At = (e, t) => (n, o) => t(n, o, e), $r = (e, t, n) => Nc(e, typeof t != "symbol" ? t + "" : t, n);
|
|
3575
|
+
let Bt = class extends oo {
|
|
3581
3576
|
constructor(e = Kn, t, n, o, r) {
|
|
3582
3577
|
super(), this._config = e, this._injector = t, this._renderManagerService = n, this._configService = o, this._uiPartsService = r;
|
|
3583
3578
|
const { menu: s, ...c } = so(
|
|
@@ -3588,14 +3583,14 @@ let jt = class extends oo {
|
|
|
3588
3583
|
}
|
|
3589
3584
|
onStarting() {
|
|
3590
3585
|
io(this._injector, [
|
|
3591
|
-
[
|
|
3586
|
+
[Zt, { useClass: sn }],
|
|
3592
3587
|
[wr],
|
|
3593
|
-
[
|
|
3588
|
+
[Ht],
|
|
3589
|
+
[Pt],
|
|
3594
3590
|
[Ut],
|
|
3595
3591
|
[Vt],
|
|
3596
3592
|
[Wt],
|
|
3597
|
-
[
|
|
3598
|
-
[Pt]
|
|
3593
|
+
[$t]
|
|
3599
3594
|
]), this._initUIPart();
|
|
3600
3595
|
}
|
|
3601
3596
|
onReady() {
|
|
@@ -3607,46 +3602,46 @@ let jt = class extends oo {
|
|
|
3607
3602
|
}
|
|
3608
3603
|
onRendered() {
|
|
3609
3604
|
[
|
|
3610
|
-
[
|
|
3605
|
+
[cn]
|
|
3611
3606
|
].forEach((e) => {
|
|
3612
3607
|
this.disposeWithMe(this._renderManagerService.registerRenderModule(H.UNIVER_SHEET, e));
|
|
3613
3608
|
}), co(this._injector, [
|
|
3614
|
-
[
|
|
3609
|
+
[Ht],
|
|
3615
3610
|
// FormulaProgressBar relies on TriggerCalculationController, but it is necessary to ensure that the formula calculation is done after rendered.
|
|
3616
|
-
[
|
|
3617
|
-
[
|
|
3611
|
+
[Ut],
|
|
3612
|
+
[Wt]
|
|
3618
3613
|
]);
|
|
3619
3614
|
}
|
|
3620
3615
|
onSteady() {
|
|
3621
|
-
this._injector.get(
|
|
3616
|
+
this._injector.get(Pt), this._injector.get($t);
|
|
3622
3617
|
}
|
|
3623
3618
|
_initUIPart() {
|
|
3624
3619
|
const e = this._injector.get(fr);
|
|
3625
3620
|
this.disposeWithMe(e.register(To, Lr)), this.disposeWithMe(e.register(Oo, Sc)), this.disposeWithMe(this._uiPartsService.registerComponent(ms.GLOBAL, () => gr(yc, this._injector)));
|
|
3626
3621
|
}
|
|
3627
3622
|
};
|
|
3628
|
-
$r(
|
|
3629
|
-
$r(
|
|
3630
|
-
|
|
3623
|
+
$r(Bt, "pluginName", vr);
|
|
3624
|
+
$r(Bt, "type", H.UNIVER_SHEET);
|
|
3625
|
+
Bt = xc([
|
|
3631
3626
|
no(Uo, ls),
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
],
|
|
3627
|
+
At(1, j(Rt)),
|
|
3628
|
+
At(2, ke),
|
|
3629
|
+
At(3, ro),
|
|
3630
|
+
At(4, hr)
|
|
3631
|
+
], Bt);
|
|
3637
3632
|
export {
|
|
3638
3633
|
Os as FORMULA_PROMPT_ACTIVATED,
|
|
3639
3634
|
Sc as FormulaEditor,
|
|
3640
|
-
|
|
3635
|
+
$t as FormulaReorderController,
|
|
3641
3636
|
wr as GlobalRangeSelectorService,
|
|
3642
3637
|
Ns as HelpFunctionOperation,
|
|
3643
3638
|
Se as InsertFunctionOperation,
|
|
3644
|
-
|
|
3639
|
+
Rn as MoreFunctionsOperation,
|
|
3645
3640
|
Lr as RangeSelector,
|
|
3646
3641
|
Pe as RefSelectionsRenderService,
|
|
3647
3642
|
Cr as ReferenceAbsoluteOperation,
|
|
3648
3643
|
Ds as SearchFunctionOperation,
|
|
3649
3644
|
gt as SelectEditorFormulaOperation,
|
|
3650
|
-
|
|
3651
|
-
|
|
3645
|
+
_n as SheetOnlyPasteFormulaCommand,
|
|
3646
|
+
Bt as UniverSheetsFormulaUIPlugin
|
|
3652
3647
|
};
|