@univerjs/sheets-formula-ui 0.10.6 → 0.10.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +5 -5
- package/lib/es/index.js +1227 -1225
- package/lib/index.js +1227 -1225
- package/lib/types/controllers/utils/utils.d.ts +0 -7
- package/lib/types/views/formula-editor/hooks/use-formula-search.d.ts +4 -3
- package/lib/types/views/range-selector/hooks/use-selection-change.d.ts +5 -2
- package/lib/types/views/range-selector/index.d.ts +5 -0
- package/lib/umd/index.js +5 -5
- package/package.json +14 -14
package/lib/index.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var q = (e, t, n) =>
|
|
4
|
-
import { CommandType as
|
|
5
|
-
import { SheetPasteCommand as
|
|
6
|
-
import { sequenceNodeType as Q, serializeRange as Ee, FormulaDataModel as bt, LexerTreeBuilder as Ie,
|
|
7
|
-
import { Subject as mt, debounceTime as gn, combineLatestWith as
|
|
8
|
-
import { IEditorService as
|
|
9
|
-
import { DeviceInputEventType as
|
|
10
|
-
import { SheetsSelectionsService as mn, getSheetCommandTarget as
|
|
11
|
-
import { InsertFunctionCommand as
|
|
12
|
-
import { ISidebarService as Sn, IZenZoneService as
|
|
13
|
-
import { jsx as
|
|
14
|
-
import { useCallback as Dt, useState as V, forwardRef as
|
|
15
|
-
import { clsx as re, scrollbarClassName as lt, borderLeftClassName as
|
|
16
|
-
import { DocSelectionManagerService as
|
|
17
|
-
import { debounceTime as
|
|
1
|
+
var Hr = Object.defineProperty;
|
|
2
|
+
var Br = (e, t, n) => t in e ? Hr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var q = (e, t, n) => Br(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { CommandType as xe, ICommandService as ve, createIdentifier as jr, 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 qr, CellValueType as On, getCellValueType as Kr, Inject as j, Disposable as ut, ObjectMatrix as $e, Range as Yr, Tools as dn, LocaleService as dt, isICellData as Gr, isFormulaString as Le, isFormulaId as at, 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 zr, InterceptorEffectEnum as Xr, FOCUSING_DOC as Qr, FOCUSING_UNIVER_EDITOR as Jr, DisposableCollection as je, RANGE_TYPE as Re, getBodySlice as Nn, EDITOR_ACTIVATED as xn, createInternalEditorID as eo, BuildTextUtils as to, RichTextBuilder as no, DependentOn as ro, IConfigService as oo, Plugin as so, merge as io, registerDependencies as co, touchDependencies as ao } from "@univerjs/core";
|
|
5
|
+
import { SheetPasteCommand as lo, PREDEFINED_HOOK_NAME as it, IEditorBridgeService as fn, SetCellEditVisibleOperation as nr, HoverManagerService as uo, CellAlertManagerService as ho, CellAlertType as fo, IAutoFillService as go, APPLY_TYPE as mo, DATA_TYPE as Mn, ISheetClipboardService as po, COPY_TYPE as rr, SheetSkeletonManagerService as qt, attachSelectionWithCoord as rn, SelectionControl as or, SELECTION_SHAPE_DEPTH as vo, useActiveWorkbook as So, getCurrentRangeDisable$ as Ke, PASTE_SPECIAL_MENU_ID as Co, whenFormulaEditorActivated as It, whenSheetEditorFocused as _o, SheetsUIPart as Ro, BaseSelectionRenderService as Eo, getCoordByOffset as wn, checkInHeaderRanges as kn, getAllSelection as Io, genNormalSelectionStyle as sr, getSheetObject as bo, MoveSelectionCommand as An, JumpOver as Fn, ExpandSelectionCommand as Dn, EMBEDDING_FORMULA_EDITOR as yo, IMarkSelectionService as To, RANGE_SELECTOR_COMPONENT_KEY as Oo, EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY as No } from "@univerjs/sheets-ui";
|
|
6
|
+
import { sequenceNodeType as Q, serializeRange as Ee, FormulaDataModel as bt, LexerTreeBuilder as Ie, ErrorType as le, extractFormulaError as ir, SetFormulaCalculationResultMutation as xo, SetArrayFormulaDataMutation as Mo, SetFormulaCalculationStopMutation as wo, FunctionType as cr, matchToken as qe, deserializeRangeWithSheetWithCache as ko, matchRefDrawToken as Ao, isFormulaLexerToken as Fo, deserializeRangeWithSheet as ht, serializeRangeToRefString as Do, serializeRangeWithSheet as Ct, serializeRangeWithSpreadsheet as Lo, generateStringWithSequence as $o, operatorToken as ar, UniverFormulaEnginePlugin as Po } from "@univerjs/engine-formula";
|
|
7
|
+
import { Subject as mt, debounceTime as gn, combineLatestWith as Uo, map as lr, switchMap as Vo, of as Ln, Observable as Wo, BehaviorSubject as ur, throttleTime as Ho, filter as dr, distinctUntilChanged as Bo, merge as jo } from "rxjs";
|
|
8
|
+
import { IEditorService as Ye, DocSelectionRenderService as hr, ReplaceTextRunsCommand as $n, MoveSelectionOperation as qo, MoveCursorOperation as Ko, useKeyboardEvent as Yo, useResize as Go, DocBackScrollRenderController as Zo, RichTextEditor as zo } from "@univerjs/docs-ui";
|
|
9
|
+
import { DeviceInputEventType as Me, IRenderManagerService as we, ScrollTimerType as Jt, SHEET_VIEWPORT_KEY as Pn, Vector2 as Un } from "@univerjs/engine-render";
|
|
10
|
+
import { SheetsSelectionsService as mn, getSheetCommandTarget as fr, getCellAtRowCol as Xo, SetSelectionsOperation as pn, SheetInterceptorService as vn, ReorderRangeCommand as Qo, SetRangeValuesMutation as Ft, SetRangeValuesUndoMutationFactory as Jo, BEFORE_CELL_EDIT as es, SetWorksheetRowAutoHeightMutation as ts, INTERCEPTOR_POINT as ns, WorksheetSetCellValuePermission as Ge, WorksheetEditPermission as Ze, RangeProtectionPermissionEditPoint as ze, WorkbookEditablePermission as Xe, IRefSelectionsService as Kt, SelectionMoveType as en, convertSelectionDataToRange as rs, setEndForRange as os, REF_SELECTIONS_ENABLED as Vn, SetWorksheetActiveOperation as Wn } from "@univerjs/sheets";
|
|
11
|
+
import { InsertFunctionCommand as ss, TriggerCalculationController as is, IDescriptionService as Yt, QuickSumCommand as cs, UniverSheetsFormulaPlugin as as } from "@univerjs/sheets-formula";
|
|
12
|
+
import { ISidebarService as Sn, IZenZoneService as ls, useDependency as T, useObservable as Ce, ProgressBar as us, MenuItemType as Qe, getMenuHiddenObservable as ft, IClipboardInterfaceService as Hn, RibbonFormulasGroup as Bn, KeyCode as L, MetaKeys as P, IMenuManagerService as ds, IShortcutService as Gt, IUIPartsService as gr, ComponentManager as mr, connectInjector as pr, useEvent as te, RectPopup as on, IContextMenuService as hs, useUpdateEffect as fs, BuiltInUIPart as gs } from "@univerjs/ui";
|
|
13
|
+
import { jsx as M, jsxs as W, Fragment as ms } from "react/jsx-runtime";
|
|
14
|
+
import { useCallback as Dt, useState as V, forwardRef as ke, useRef as z, createElement as Je, useEffect as $, useMemo as se, useLayoutEffect as Lt, useImperativeHandle as ps } from "react";
|
|
15
|
+
import { clsx as re, scrollbarClassName as lt, borderLeftClassName as vs, Select as Ss, Input as vr, borderClassName as Cn, Button as ct, borderTopClassName as Cs, Tooltip as _s, Dialog as Rs } from "@univerjs/design";
|
|
16
|
+
import { DocSelectionManagerService as Sr } from "@univerjs/docs";
|
|
17
|
+
import { debounceTime as Es } from "rxjs/operators";
|
|
18
18
|
const _n = {
|
|
19
19
|
id: "sheet.command.paste-formula",
|
|
20
|
-
type:
|
|
21
|
-
handler: async (e) => e.get(ve).executeCommand(
|
|
22
|
-
value:
|
|
20
|
+
type: xe.COMMAND,
|
|
21
|
+
handler: async (e) => e.get(ve).executeCommand(lo.id, {
|
|
22
|
+
value: it.SPECIAL_PASTE_FORMULA
|
|
23
23
|
})
|
|
24
24
|
}, gt = {
|
|
25
25
|
id: "formula-ui.operation.select-editor-formula",
|
|
26
|
-
type:
|
|
26
|
+
type: xe.OPERATION,
|
|
27
27
|
handler: (e, t) => !0
|
|
28
28
|
};
|
|
29
|
-
var
|
|
30
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
29
|
+
var Is = Object.getOwnPropertyDescriptor, bs = (e, t, n, o) => {
|
|
30
|
+
for (var r = o > 1 ? void 0 : o ? Is(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
31
31
|
(c = e[s]) && (r = c(r) || r);
|
|
32
32
|
return r;
|
|
33
|
-
},
|
|
34
|
-
const
|
|
33
|
+
}, ys = (e, t) => (n, o) => t(n, o, e);
|
|
34
|
+
const Ts = "FORMULA_PROMPT_ACTIVATED", Zt = jr("formula-ui.prompt-service");
|
|
35
35
|
let sn = class {
|
|
36
36
|
constructor(e) {
|
|
37
37
|
q(this, "_search$", new mt());
|
|
@@ -55,7 +55,7 @@ let sn = class {
|
|
|
55
55
|
this._search$.complete(), this._help$.complete(), this._navigate$.complete(), this._accept$.complete(), this._acceptFormulaName$.complete(), this._sequenceNodes = [];
|
|
56
56
|
}
|
|
57
57
|
search(e) {
|
|
58
|
-
this._contextService.setContextValue(
|
|
58
|
+
this._contextService.setContextValue(Ts, e.visible), this._searching = e.visible, this._search$.next(e);
|
|
59
59
|
}
|
|
60
60
|
isSearching() {
|
|
61
61
|
return this._searching;
|
|
@@ -187,86 +187,86 @@ let sn = class {
|
|
|
187
187
|
return this._isLockedOnSelectionInsertRefString;
|
|
188
188
|
}
|
|
189
189
|
};
|
|
190
|
-
sn =
|
|
191
|
-
|
|
190
|
+
sn = bs([
|
|
191
|
+
ys(0, ln)
|
|
192
192
|
], sn);
|
|
193
|
-
const
|
|
193
|
+
const Os = {
|
|
194
194
|
id: "formula-ui.operation.help-function",
|
|
195
|
-
type:
|
|
195
|
+
type: xe.OPERATION,
|
|
196
196
|
handler: async (e, t) => (e.get(Zt).help(t), !0)
|
|
197
197
|
}, Se = {
|
|
198
198
|
id: "formula-ui.operation.insert-function",
|
|
199
|
-
type:
|
|
199
|
+
type: xe.OPERATION,
|
|
200
200
|
// eslint-disable-next-line
|
|
201
201
|
handler: async (e, t) => {
|
|
202
202
|
var C, _;
|
|
203
|
-
const n = e.get(mn), o = e.get(
|
|
203
|
+
const n = e.get(mn), o = e.get(Ye), r = n.getCurrentSelections();
|
|
204
204
|
if (!r || !r.length)
|
|
205
205
|
return !1;
|
|
206
|
-
const s =
|
|
206
|
+
const s = fr(e.get(ne));
|
|
207
207
|
if (!s) return !1;
|
|
208
|
-
const { worksheet: c, unitId: i, subUnitId: l } = s,
|
|
208
|
+
const { worksheet: c, unitId: i, subUnitId: l } = s, g = c.getCellMatrix(), { value: m } = t, h = e.get(ve);
|
|
209
209
|
e.get(fn);
|
|
210
|
-
const
|
|
210
|
+
const d = [], u = [];
|
|
211
211
|
let a = null, S = 0, p = 0, v = "";
|
|
212
|
-
if (r.length === 1 && (
|
|
213
|
-
const { range:
|
|
214
|
-
a =
|
|
215
|
-
const
|
|
216
|
-
|
|
212
|
+
if (r.length === 1 && (Ms(r[0].range) || ws(r[0].range) && qn(g, r[0].range))) {
|
|
213
|
+
const { range: I, primary: f } = r[0], b = (C = f == null ? void 0 : f.actualRow) != null ? C : I.startRow, y = (_ = f == null ? void 0 : f.actualColumn) != null ? _ : I.startColumn;
|
|
214
|
+
a = I, S = b, p = y;
|
|
215
|
+
const A = jn(g, b, y);
|
|
216
|
+
A && (v = Ee(A));
|
|
217
217
|
} else
|
|
218
|
-
r.some((
|
|
219
|
-
var
|
|
220
|
-
const { range:
|
|
221
|
-
if (qn(
|
|
222
|
-
const F = (
|
|
223
|
-
if (!
|
|
224
|
-
return a =
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
range:
|
|
218
|
+
r.some((I) => {
|
|
219
|
+
var y, A;
|
|
220
|
+
const { range: f, primary: b } = I;
|
|
221
|
+
if (qn(g, f)) {
|
|
222
|
+
const F = (y = b == null ? void 0 : b.actualRow) != null ? y : f.startRow, O = (A = b == null ? void 0 : b.actualColumn) != null ? A : f.startColumn, N = jn(g, F, O);
|
|
223
|
+
if (!N)
|
|
224
|
+
return a = f, S = F, p = O, !0;
|
|
225
|
+
const k = Ee(N), E = `=${m}(${k})`;
|
|
226
|
+
d.push({
|
|
227
|
+
range: f,
|
|
228
228
|
primary: {
|
|
229
229
|
row: F,
|
|
230
|
-
column:
|
|
230
|
+
column: O
|
|
231
231
|
},
|
|
232
|
-
formula:
|
|
232
|
+
formula: E
|
|
233
233
|
});
|
|
234
234
|
} else {
|
|
235
|
-
const { startRow: F, startColumn:
|
|
236
|
-
if (F ===
|
|
237
|
-
const
|
|
235
|
+
const { startRow: F, startColumn: O, endRow: N, endColumn: k } = f;
|
|
236
|
+
if (F === N) {
|
|
237
|
+
const E = ks(g, F, k, c.getColumnCount() - 1), x = E === k ? k - 1 : k, R = Ee({
|
|
238
238
|
startRow: F,
|
|
239
|
-
endRow:
|
|
240
|
-
startColumn:
|
|
241
|
-
endColumn:
|
|
242
|
-
}),
|
|
243
|
-
|
|
244
|
-
range:
|
|
239
|
+
endRow: N,
|
|
240
|
+
startColumn: O,
|
|
241
|
+
endColumn: x
|
|
242
|
+
}), w = `=${m}(${R})`;
|
|
243
|
+
u.push({
|
|
244
|
+
range: f,
|
|
245
245
|
primary: {
|
|
246
246
|
row: F,
|
|
247
|
-
column:
|
|
247
|
+
column: E
|
|
248
248
|
},
|
|
249
|
-
formula:
|
|
249
|
+
formula: w
|
|
250
250
|
});
|
|
251
251
|
} else {
|
|
252
|
-
let
|
|
253
|
-
for (let
|
|
254
|
-
const
|
|
255
|
-
|
|
252
|
+
let E = -1;
|
|
253
|
+
for (let R = O; R <= k; R++) {
|
|
254
|
+
const w = As(g, R, N, c.getRowCount() - 1);
|
|
255
|
+
E = Math.max(E, w);
|
|
256
256
|
}
|
|
257
|
-
const
|
|
258
|
-
for (let
|
|
259
|
-
const
|
|
257
|
+
const x = E === N ? N - 1 : N;
|
|
258
|
+
for (let R = O; R <= k; R++) {
|
|
259
|
+
const w = Ee({
|
|
260
260
|
startRow: F,
|
|
261
|
-
endRow:
|
|
262
|
-
startColumn:
|
|
263
|
-
endColumn:
|
|
264
|
-
}), D = `=${
|
|
265
|
-
|
|
266
|
-
range:
|
|
261
|
+
endRow: x,
|
|
262
|
+
startColumn: R,
|
|
263
|
+
endColumn: R
|
|
264
|
+
}), D = `=${m}(${w})`;
|
|
265
|
+
u.push({
|
|
266
|
+
range: f,
|
|
267
267
|
primary: {
|
|
268
|
-
row:
|
|
269
|
-
column:
|
|
268
|
+
row: E,
|
|
269
|
+
column: R
|
|
270
270
|
},
|
|
271
271
|
formula: D
|
|
272
272
|
});
|
|
@@ -276,41 +276,41 @@ const Ns = {
|
|
|
276
276
|
return !1;
|
|
277
277
|
});
|
|
278
278
|
if (a) {
|
|
279
|
-
const
|
|
279
|
+
const I = Xo(S, p, c), f = {
|
|
280
280
|
range: Qn.clone(a),
|
|
281
281
|
primary: {
|
|
282
|
-
startRow:
|
|
283
|
-
startColumn:
|
|
284
|
-
endRow:
|
|
285
|
-
endColumn:
|
|
282
|
+
startRow: I.startRow,
|
|
283
|
+
startColumn: I.startColumn,
|
|
284
|
+
endRow: I.endRow,
|
|
285
|
+
endColumn: I.endColumn,
|
|
286
286
|
actualRow: S,
|
|
287
287
|
actualColumn: p,
|
|
288
|
-
isMerged:
|
|
289
|
-
isMergedMainCell:
|
|
288
|
+
isMerged: I.isMerged,
|
|
289
|
+
isMergedMainCell: I.startRow === S && I.startColumn === p
|
|
290
290
|
}
|
|
291
|
-
},
|
|
291
|
+
}, b = {
|
|
292
292
|
unitId: i,
|
|
293
293
|
subUnitId: l,
|
|
294
|
-
selections: [
|
|
294
|
+
selections: [f]
|
|
295
295
|
};
|
|
296
|
-
await
|
|
297
|
-
const
|
|
298
|
-
|
|
296
|
+
await h.executeCommand(pn.id, b);
|
|
297
|
+
const y = o.getEditor(un), A = o.getEditor(Jn);
|
|
298
|
+
h.syncExecuteCommand(nr.id, {
|
|
299
299
|
visible: !0,
|
|
300
300
|
unitId: i,
|
|
301
|
-
eventType:
|
|
301
|
+
eventType: Me.Dblclick
|
|
302
302
|
});
|
|
303
|
-
const F = `=${
|
|
304
|
-
|
|
303
|
+
const F = `=${m}(${v}`;
|
|
304
|
+
y == null || y.replaceText(F), A == null || A.replaceText(F, !1);
|
|
305
305
|
}
|
|
306
|
-
return
|
|
307
|
-
list:
|
|
308
|
-
listOfRangeHasNumber:
|
|
306
|
+
return d.length === 0 && u.length === 0 ? !1 : h.executeCommand(ss.id, {
|
|
307
|
+
list: d,
|
|
308
|
+
listOfRangeHasNumber: u
|
|
309
309
|
});
|
|
310
310
|
}
|
|
311
311
|
};
|
|
312
312
|
function jn(e, t, n) {
|
|
313
|
-
const o =
|
|
313
|
+
const o = Ns(e, t, n);
|
|
314
314
|
if (o !== t)
|
|
315
315
|
return {
|
|
316
316
|
startRow: o,
|
|
@@ -318,7 +318,7 @@ function jn(e, t, n) {
|
|
|
318
318
|
startColumn: n,
|
|
319
319
|
endColumn: n
|
|
320
320
|
};
|
|
321
|
-
const r =
|
|
321
|
+
const r = xs(e, t, n);
|
|
322
322
|
return r !== n ? {
|
|
323
323
|
startRow: t,
|
|
324
324
|
endRow: t,
|
|
@@ -326,7 +326,7 @@ function jn(e, t, n) {
|
|
|
326
326
|
endColumn: n - 1
|
|
327
327
|
} : null;
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function Ns(e, t, n) {
|
|
330
330
|
let o = !1;
|
|
331
331
|
if (t === 0) return t;
|
|
332
332
|
for (let r = t - 1; r >= 0; r--) {
|
|
@@ -343,7 +343,7 @@ function xs(e, t, n) {
|
|
|
343
343
|
}
|
|
344
344
|
return t;
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function xs(e, t, n) {
|
|
347
347
|
let o = !1;
|
|
348
348
|
if (n === 0) return n;
|
|
349
349
|
for (let r = n - 1; r >= 0; r--) {
|
|
@@ -366,14 +366,14 @@ function _t(e) {
|
|
|
366
366
|
if (t == null)
|
|
367
367
|
return !1;
|
|
368
368
|
const n = t.dataStream, r = n.substring(n.length - 2, n.length) === er ? n.substring(0, n.length - 2) : n;
|
|
369
|
-
return
|
|
369
|
+
return qr(r);
|
|
370
370
|
}
|
|
371
|
-
return e && (e.t === On.NUMBER ||
|
|
371
|
+
return e && (e.t === On.NUMBER || Kr(e) === On.NUMBER);
|
|
372
372
|
}
|
|
373
|
-
function
|
|
373
|
+
function Ms(e) {
|
|
374
374
|
return e.startRow === e.endRow && e.startColumn === e.endColumn;
|
|
375
375
|
}
|
|
376
|
-
function
|
|
376
|
+
function ws(e) {
|
|
377
377
|
return e.startRow !== e.endRow && e.startColumn !== e.endColumn;
|
|
378
378
|
}
|
|
379
379
|
function qn(e, t) {
|
|
@@ -383,36 +383,36 @@ function qn(e, t) {
|
|
|
383
383
|
return !1;
|
|
384
384
|
return !0;
|
|
385
385
|
}
|
|
386
|
-
function
|
|
386
|
+
function ks(e, t, n, o) {
|
|
387
387
|
for (let r = n; r <= o; r++)
|
|
388
388
|
if (!e.getValue(t, r))
|
|
389
389
|
return r;
|
|
390
390
|
return o;
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function As(e, t, n, o) {
|
|
393
393
|
for (let r = n; r <= o; r++)
|
|
394
394
|
if (!e.getValue(r, t))
|
|
395
395
|
return r;
|
|
396
396
|
return o;
|
|
397
397
|
}
|
|
398
|
-
const
|
|
398
|
+
const Cr = "SHEET_FORMULA_UI_PLUGIN", _r = `${Cr}_MORE_FUNCTIONS_COMPONENT`, Rn = {
|
|
399
399
|
id: "formula-ui.operation.more-functions",
|
|
400
|
-
type:
|
|
400
|
+
type: xe.OPERATION,
|
|
401
401
|
handler: async (e) => (e.get(Sn).open({
|
|
402
402
|
header: { title: "formula.insert.tooltip" },
|
|
403
|
-
children: { label:
|
|
403
|
+
children: { label: _r }
|
|
404
404
|
}), !0)
|
|
405
|
-
},
|
|
405
|
+
}, Rr = {
|
|
406
406
|
id: "formula-ui.operation.change-ref-to-absolute",
|
|
407
|
-
type:
|
|
407
|
+
type: xe.OPERATION,
|
|
408
408
|
handler: async (e) => !0
|
|
409
|
-
},
|
|
409
|
+
}, Fs = {
|
|
410
410
|
id: "formula-ui.operation.search-function",
|
|
411
|
-
type:
|
|
411
|
+
type: xe.OPERATION,
|
|
412
412
|
handler: async (e, t) => (e.get(Zt).search(t), !0)
|
|
413
413
|
};
|
|
414
|
-
var
|
|
415
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
414
|
+
var Ds = Object.getOwnPropertyDescriptor, Ls = (e, t, n, o) => {
|
|
415
|
+
for (var r = o > 1 ? void 0 : o ? Ds(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
418
|
}, wt = (e, t) => (n, o) => t(n, o, e);
|
|
@@ -422,7 +422,7 @@ let $t = class extends ut {
|
|
|
422
422
|
}
|
|
423
423
|
_initialize() {
|
|
424
424
|
this.disposeWithMe(this._sheetInterceptorService.interceptCommand({
|
|
425
|
-
getMutations: (e) => e.id ===
|
|
425
|
+
getMutations: (e) => e.id === Qo.id ? this._reorderFormula(e.params) : {
|
|
426
426
|
redos: [],
|
|
427
427
|
undos: []
|
|
428
428
|
}
|
|
@@ -435,36 +435,36 @@ let $t = class extends ut {
|
|
|
435
435
|
redos: t,
|
|
436
436
|
undos: n
|
|
437
437
|
};
|
|
438
|
-
const
|
|
439
|
-
let
|
|
440
|
-
return
|
|
441
|
-
let S =
|
|
442
|
-
c.hasOwnProperty(
|
|
443
|
-
const p =
|
|
438
|
+
const g = l.getCellMatrix(), m = new $e(), h = new $e();
|
|
439
|
+
let d = !1;
|
|
440
|
+
return Yr.foreach(s, (u, a) => {
|
|
441
|
+
let S = u;
|
|
442
|
+
c.hasOwnProperty(u) && (S = c[u]);
|
|
443
|
+
const p = g.getValue(S, a);
|
|
444
444
|
if (p != null && p.f || p != null && p.si) {
|
|
445
|
-
|
|
445
|
+
d = !0;
|
|
446
446
|
const v = this._formulaDataModel.getFormulaStringByCell(S, a, r, o), C = this._lexerTreeBuilder.moveFormulaRefOffset(
|
|
447
447
|
v,
|
|
448
448
|
0,
|
|
449
|
-
|
|
449
|
+
u - S
|
|
450
450
|
), _ = dn.deepClone(p);
|
|
451
|
-
_.f = C, _.si = null,
|
|
451
|
+
_.f = C, _.si = null, m.setValue(u, a, _);
|
|
452
452
|
} else
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
}),
|
|
453
|
+
m.setValue(u, a, p);
|
|
454
|
+
h.setValue(u, a, g.getValue(u, a));
|
|
455
|
+
}), d ? (t.push({
|
|
456
456
|
id: Ft.id,
|
|
457
457
|
params: {
|
|
458
458
|
unitId: o,
|
|
459
459
|
subUnitId: r,
|
|
460
|
-
cellValue:
|
|
460
|
+
cellValue: m.getMatrix()
|
|
461
461
|
}
|
|
462
462
|
}), n.push({
|
|
463
463
|
id: Ft.id,
|
|
464
464
|
params: {
|
|
465
465
|
unitId: o,
|
|
466
466
|
subUnitId: r,
|
|
467
|
-
cellValue:
|
|
467
|
+
cellValue: h.getMatrix()
|
|
468
468
|
}
|
|
469
469
|
}), {
|
|
470
470
|
redos: t,
|
|
@@ -475,25 +475,19 @@ let $t = class extends ut {
|
|
|
475
475
|
};
|
|
476
476
|
}
|
|
477
477
|
};
|
|
478
|
-
$t =
|
|
478
|
+
$t = Ls([
|
|
479
479
|
wt(0, j(vn)),
|
|
480
480
|
wt(1, j(ne)),
|
|
481
481
|
wt(2, j(bt)),
|
|
482
482
|
wt(3, j(Ie))
|
|
483
483
|
], $t);
|
|
484
|
-
const
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
}
|
|
488
|
-
function _r(e, t = !1) {
|
|
489
|
-
return !t && !(xe(e == null ? void 0 : e.f) || je(e == null ? void 0 : e.si)) ? null : typeof (e == null ? void 0 : e.v) == "string" && No.has(e.v) ? e.v : null;
|
|
490
|
-
}
|
|
491
|
-
var Vs = Object.getOwnPropertyDescriptor, Ws = (e, t, n, o) => {
|
|
492
|
-
for (var r = o > 1 ? void 0 : o ? Vs(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
484
|
+
const $s = "sheets-formula-ui.base.config", Kn = {};
|
|
485
|
+
var Ps = Object.getOwnPropertyDescriptor, Us = (e, t, n, o) => {
|
|
486
|
+
for (var r = o > 1 ? void 0 : o ? Ps(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
493
487
|
(c = e[s]) && (r = c(r) || r);
|
|
494
488
|
return r;
|
|
495
489
|
}, pt = (e, t) => (n, o) => t(n, o, e);
|
|
496
|
-
const tn = "SHEET_FORMULA_ALERT",
|
|
490
|
+
const tn = "SHEET_FORMULA_ALERT", Vs = {
|
|
497
491
|
[le.DIV_BY_ZERO]: "divByZero",
|
|
498
492
|
[le.NAME]: "name",
|
|
499
493
|
[le.VALUE]: "value",
|
|
@@ -520,20 +514,20 @@ let cn = class extends ut {
|
|
|
520
514
|
if (e) {
|
|
521
515
|
const i = this._context.unit.getActiveSheet();
|
|
522
516
|
if (!i) return;
|
|
523
|
-
const l = i.getCell(e.location.row, e.location.col),
|
|
524
|
-
if (
|
|
525
|
-
const
|
|
526
|
-
if (!
|
|
517
|
+
const l = i.getCell(e.location.row, e.location.col), g = (r = (o = (n = (t = this._formulaDataModel.getArrayFormulaCellData()) == null ? void 0 : t[e.location.unitId]) == null ? void 0 : n[e.location.subUnitId]) == null ? void 0 : o[e.location.row]) == null ? void 0 : r[e.location.col];
|
|
518
|
+
if (Gr(l)) {
|
|
519
|
+
const m = ir(l, !!g);
|
|
520
|
+
if (!m) {
|
|
527
521
|
this._hideAlert();
|
|
528
522
|
return;
|
|
529
523
|
}
|
|
530
|
-
const
|
|
531
|
-
if (
|
|
524
|
+
const h = this._cellAlertManagerService.currentAlert.get(tn), d = (s = h == null ? void 0 : h.alert) == null ? void 0 : s.location;
|
|
525
|
+
if (d && d.row === e.location.row && d.col === e.location.col && d.subUnitId === e.location.subUnitId && d.unitId === e.location.unitId)
|
|
532
526
|
return;
|
|
533
527
|
this._cellAlertManagerService.showAlert({
|
|
534
|
-
type:
|
|
528
|
+
type: fo.ERROR,
|
|
535
529
|
title: this._localeService.t("formula.error.title"),
|
|
536
|
-
message: this._localeService.t(`formula.error.${
|
|
530
|
+
message: this._localeService.t(`formula.error.${Vs[m]}`),
|
|
537
531
|
location: e.location,
|
|
538
532
|
width: 200,
|
|
539
533
|
height: 74,
|
|
@@ -554,15 +548,15 @@ let cn = class extends ut {
|
|
|
554
548
|
this._cellAlertManagerService.removeAlert(tn);
|
|
555
549
|
}
|
|
556
550
|
};
|
|
557
|
-
cn =
|
|
558
|
-
pt(1, j(
|
|
559
|
-
pt(2, j(
|
|
551
|
+
cn = Us([
|
|
552
|
+
pt(1, j(uo)),
|
|
553
|
+
pt(2, j(ho)),
|
|
560
554
|
pt(3, j(dt)),
|
|
561
555
|
pt(4, j(bt)),
|
|
562
|
-
pt(5,
|
|
556
|
+
pt(5, ls)
|
|
563
557
|
], cn);
|
|
564
|
-
var
|
|
565
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
558
|
+
var Ws = Object.getOwnPropertyDescriptor, Hs = (e, t, n, o) => {
|
|
559
|
+
for (var r = o > 1 ? void 0 : o ? Ws(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
566
560
|
(c = e[s]) && (r = c(r) || r);
|
|
567
561
|
return r;
|
|
568
562
|
}, Yn = (e, t) => (n, o) => t(n, o, e);
|
|
@@ -574,10 +568,10 @@ let Pt = class extends ut {
|
|
|
574
568
|
const e = {
|
|
575
569
|
type: Mn.FORMULA,
|
|
576
570
|
priority: 1001,
|
|
577
|
-
match: (t) =>
|
|
571
|
+
match: (t) => Le(t == null ? void 0 : t.f) || at(t == null ? void 0 : t.si),
|
|
578
572
|
isContinue: (t, n) => t.type === Mn.FORMULA,
|
|
579
573
|
applyFunctions: {
|
|
580
|
-
[
|
|
574
|
+
[mo.COPY]: (t, n, o, r, s) => {
|
|
581
575
|
const { data: c, index: i } = t;
|
|
582
576
|
return this._fillCopyFormula(c, n, o, i, r, s);
|
|
583
577
|
}
|
|
@@ -586,26 +580,26 @@ let Pt = class extends ut {
|
|
|
586
580
|
this._autoFillService.registerRule(e);
|
|
587
581
|
}
|
|
588
582
|
_fillCopyFormula(e, t, n, o, r, s) {
|
|
589
|
-
var
|
|
590
|
-
const c =
|
|
591
|
-
for (let
|
|
592
|
-
const
|
|
583
|
+
var g, m;
|
|
584
|
+
const c = js(r), i = [], l = /* @__PURE__ */ new Map();
|
|
585
|
+
for (let h = 1; h <= t; h++) {
|
|
586
|
+
const d = (h - 1) % e.length, u = o[d], a = dn.deepClone(e[d]);
|
|
593
587
|
if (a) {
|
|
594
|
-
const S = ((
|
|
595
|
-
if (
|
|
588
|
+
const S = ((g = e[d]) == null ? void 0 : g.f) || "", p = ((m = e[d]) == null ? void 0 : m.si) || "", v = Le(S);
|
|
589
|
+
if (at(p))
|
|
596
590
|
a.si = p, a.f = null, a.v = null, a.p = null, a.t = null, i.push(a);
|
|
597
591
|
else if (v) {
|
|
598
|
-
let _ = l.get(
|
|
592
|
+
let _ = l.get(d);
|
|
599
593
|
if (_)
|
|
600
594
|
a.si = _, a.f = null, a.v = null, a.p = null, a.t = null;
|
|
601
595
|
else {
|
|
602
|
-
_ = jt(6), l.set(
|
|
603
|
-
const { offsetX:
|
|
596
|
+
_ = jt(6), l.set(d, _);
|
|
597
|
+
const { offsetX: I, offsetY: f } = Bs(c, t, n, s, u), b = this._lexerTreeBuilder.moveFormulaRefOffset(
|
|
604
598
|
S,
|
|
605
|
-
|
|
606
|
-
|
|
599
|
+
I,
|
|
600
|
+
f
|
|
607
601
|
);
|
|
608
|
-
a.si = _, a.f =
|
|
602
|
+
a.si = _, a.f = b, a.v = null, a.p = null, a.t = null;
|
|
609
603
|
}
|
|
610
604
|
i.push(a);
|
|
611
605
|
}
|
|
@@ -614,30 +608,30 @@ let Pt = class extends ut {
|
|
|
614
608
|
return i;
|
|
615
609
|
}
|
|
616
610
|
};
|
|
617
|
-
Pt =
|
|
618
|
-
Yn(0,
|
|
611
|
+
Pt = Hs([
|
|
612
|
+
Yn(0, go),
|
|
619
613
|
Yn(1, j(Ie))
|
|
620
614
|
], Pt);
|
|
621
|
-
function
|
|
615
|
+
function Bs(e, t, n, o, r) {
|
|
622
616
|
const { source: s, target: c } = o, { rows: i } = c, { rows: l } = s;
|
|
623
|
-
let
|
|
617
|
+
let g = 0, m = 0;
|
|
624
618
|
switch (n) {
|
|
625
619
|
case ue.UP:
|
|
626
|
-
|
|
620
|
+
m = i[r] - l[r];
|
|
627
621
|
break;
|
|
628
622
|
case ue.RIGHT:
|
|
629
|
-
|
|
623
|
+
g = e;
|
|
630
624
|
break;
|
|
631
625
|
case ue.DOWN:
|
|
632
|
-
|
|
626
|
+
m = i[r] - l[r];
|
|
633
627
|
break;
|
|
634
628
|
case ue.LEFT:
|
|
635
|
-
|
|
629
|
+
g = -e * t;
|
|
636
630
|
break;
|
|
637
631
|
}
|
|
638
|
-
return { offsetX:
|
|
632
|
+
return { offsetX: g, offsetY: m };
|
|
639
633
|
}
|
|
640
|
-
function
|
|
634
|
+
function js(e) {
|
|
641
635
|
let t = 0;
|
|
642
636
|
for (const n in e)
|
|
643
637
|
e[n].forEach((o) => {
|
|
@@ -645,12 +639,12 @@ function Ks(e) {
|
|
|
645
639
|
});
|
|
646
640
|
return t;
|
|
647
641
|
}
|
|
648
|
-
var
|
|
649
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
642
|
+
var qs = Object.getOwnPropertyDescriptor, Ks = (e, t, n, o) => {
|
|
643
|
+
for (var r = o > 1 ? void 0 : o ? qs(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
650
644
|
(c = e[s]) && (r = c(r) || r);
|
|
651
645
|
return r;
|
|
652
646
|
}, vt = (e, t) => (n, o) => t(n, o, e);
|
|
653
|
-
const
|
|
647
|
+
const Ys = "default-paste-formula";
|
|
654
648
|
let Ut = class extends ut {
|
|
655
649
|
constructor(e, t, n, o, r) {
|
|
656
650
|
super(), this._currentUniverSheet = e, this._lexerTreeBuilder = t, this._sheetClipboardService = n, this._injector = o, this._formulaDataModel = r, this._initialize();
|
|
@@ -663,7 +657,7 @@ let Ut = class extends ut {
|
|
|
663
657
|
}
|
|
664
658
|
_pasteFormulaHook() {
|
|
665
659
|
return {
|
|
666
|
-
id:
|
|
660
|
+
id: it.SPECIAL_PASTE_FORMULA,
|
|
667
661
|
priority: 10,
|
|
668
662
|
specialPasteInfo: { label: "specialPaste.formula" },
|
|
669
663
|
onPasteCells: (e, t, n, o) => this._onPasteCells(e, t, n, o, !0)
|
|
@@ -671,39 +665,39 @@ let Ut = class extends ut {
|
|
|
671
665
|
}
|
|
672
666
|
_pasteWithFormulaHook() {
|
|
673
667
|
return {
|
|
674
|
-
id:
|
|
668
|
+
id: Ys,
|
|
675
669
|
priority: 10,
|
|
676
670
|
onPasteCells: (e, t, n, o) => this._onPasteCells(e, t, n, o, !1)
|
|
677
671
|
};
|
|
678
672
|
}
|
|
679
673
|
_onPasteCells(e, t, n, o, r) {
|
|
680
|
-
var
|
|
674
|
+
var d;
|
|
681
675
|
if ([
|
|
682
|
-
|
|
683
|
-
|
|
676
|
+
it.SPECIAL_PASTE_FORMAT,
|
|
677
|
+
it.SPECIAL_PASTE_COL_WIDTH
|
|
684
678
|
].includes(o.pasteType))
|
|
685
679
|
return {
|
|
686
680
|
undos: [],
|
|
687
681
|
redos: []
|
|
688
682
|
};
|
|
689
|
-
const c = this._currentUniverSheet.getCurrentUnitForType(H.UNIVER_SHEET), i = t.unitId || c.getUnitId(), l = t.subUnitId || ((
|
|
683
|
+
const c = this._currentUniverSheet.getCurrentUnitForType(H.UNIVER_SHEET), i = t.unitId || c.getUnitId(), l = t.subUnitId || ((d = c.getActiveSheet()) == null ? void 0 : d.getSheetId());
|
|
690
684
|
if (!i || !l)
|
|
691
685
|
return {
|
|
692
686
|
undos: [],
|
|
693
687
|
redos: []
|
|
694
688
|
};
|
|
695
|
-
const
|
|
689
|
+
const g = t.range, m = n, h = {
|
|
696
690
|
copyType: o.copyType || rr.COPY,
|
|
697
691
|
copyRange: e == null ? void 0 : e.range,
|
|
698
692
|
pasteType: o.pasteType
|
|
699
693
|
};
|
|
700
|
-
return this._injector.invoke((
|
|
694
|
+
return this._injector.invoke((u) => Gs(
|
|
701
695
|
i,
|
|
702
696
|
l,
|
|
703
|
-
f,
|
|
704
|
-
h,
|
|
705
|
-
d,
|
|
706
697
|
g,
|
|
698
|
+
m,
|
|
699
|
+
u,
|
|
700
|
+
h,
|
|
707
701
|
this._lexerTreeBuilder,
|
|
708
702
|
this._formulaDataModel,
|
|
709
703
|
r,
|
|
@@ -711,164 +705,164 @@ let Ut = class extends ut {
|
|
|
711
705
|
));
|
|
712
706
|
}
|
|
713
707
|
};
|
|
714
|
-
Ut =
|
|
708
|
+
Ut = Ks([
|
|
715
709
|
vt(0, ne),
|
|
716
710
|
vt(1, j(Ie)),
|
|
717
|
-
vt(2,
|
|
711
|
+
vt(2, po),
|
|
718
712
|
vt(3, j(Rt)),
|
|
719
713
|
vt(4, j(bt))
|
|
720
714
|
], Ut);
|
|
721
|
-
function
|
|
722
|
-
const
|
|
723
|
-
if (!
|
|
715
|
+
function Gs(e, t, n, o, r, s, c, i, l = !1, g) {
|
|
716
|
+
const m = [], h = [], d = Zs(e, t, n, o, s, c, i, g);
|
|
717
|
+
if (!d.hasValue())
|
|
724
718
|
return {
|
|
725
719
|
undos: [],
|
|
726
720
|
redos: []
|
|
727
721
|
};
|
|
728
|
-
const
|
|
722
|
+
const u = {
|
|
729
723
|
unitId: e,
|
|
730
724
|
subUnitId: t,
|
|
731
|
-
cellValue:
|
|
725
|
+
cellValue: d.getData()
|
|
732
726
|
};
|
|
733
|
-
|
|
727
|
+
m.push({
|
|
734
728
|
id: Ft.id,
|
|
735
|
-
params:
|
|
729
|
+
params: u
|
|
736
730
|
});
|
|
737
|
-
const a =
|
|
731
|
+
const a = Jo(
|
|
738
732
|
r,
|
|
739
|
-
|
|
733
|
+
u
|
|
740
734
|
);
|
|
741
|
-
return
|
|
735
|
+
return h.push({
|
|
742
736
|
id: Ft.id,
|
|
743
737
|
params: a
|
|
744
738
|
}), {
|
|
745
|
-
undos:
|
|
746
|
-
redos:
|
|
739
|
+
undos: h,
|
|
740
|
+
redos: m
|
|
747
741
|
};
|
|
748
742
|
}
|
|
749
|
-
function
|
|
750
|
-
return i ? r.pasteType ===
|
|
743
|
+
function Zs(e, t, n, o, r, s, c, i) {
|
|
744
|
+
return i ? r.pasteType === it.SPECIAL_PASTE_VALUE ? Xs(e, t, n, o, c, i) : r.pasteType === it.SPECIAL_PASTE_FORMULA ? Qs(e, t, n, o, s, c, i) : Js(e, t, n, o, r.copyType, s, c, i) : zs(e, t, n, o, c);
|
|
751
745
|
}
|
|
752
|
-
function
|
|
746
|
+
function zs(e, t, n, o, r) {
|
|
753
747
|
const s = new $e(), c = r.getSheetFormulaData(e, t);
|
|
754
|
-
return o.forValue((i, l,
|
|
755
|
-
var
|
|
756
|
-
const
|
|
757
|
-
|
|
748
|
+
return o.forValue((i, l, g) => {
|
|
749
|
+
var u;
|
|
750
|
+
const m = n.rows[i], h = n.cols[l], d = {};
|
|
751
|
+
Le(g.v) ? (d.v = null, d.f = `${g.v}`, d.si = null, d.p = null, s.setValue(m, h, d)) : (u = c == null ? void 0 : c[m]) != null && u[h] && (d.v = g.v, d.f = null, d.si = null, d.p = null, s.setValue(m, h, d));
|
|
758
752
|
}), s;
|
|
759
753
|
}
|
|
760
|
-
function
|
|
761
|
-
var
|
|
762
|
-
const c = new $e(), i = (
|
|
763
|
-
return o.forValue((
|
|
764
|
-
var _,
|
|
765
|
-
const a = s.range.rows[
|
|
766
|
-
if (
|
|
767
|
-
C.v =
|
|
754
|
+
function Xs(e, t, n, o, r, s) {
|
|
755
|
+
var g, m;
|
|
756
|
+
const c = new $e(), i = (m = (g = r.getArrayFormulaCellData()) == null ? void 0 : g[s.unitId]) == null ? void 0 : m[s.subUnitId], l = r.getSheetFormulaData(e, t);
|
|
757
|
+
return o.forValue((h, d, u) => {
|
|
758
|
+
var _, I;
|
|
759
|
+
const a = s.range.rows[h % s.range.rows.length], S = s.range.cols[d % s.range.cols.length], p = n.rows[h], v = n.cols[d], C = {};
|
|
760
|
+
if (Le(u.f) || at(u.si))
|
|
761
|
+
C.v = u.v, C.f = null, C.si = null, C.p = null, c.setValue(p, v, C);
|
|
768
762
|
else if ((_ = i == null ? void 0 : i[a]) != null && _[S]) {
|
|
769
|
-
const
|
|
770
|
-
C.v =
|
|
771
|
-
} else if ((
|
|
772
|
-
if (C.v =
|
|
773
|
-
const
|
|
774
|
-
|
|
763
|
+
const f = i[a][S];
|
|
764
|
+
C.v = f.v, C.f = null, C.si = null, C.p = null, c.setValue(p, v, C);
|
|
765
|
+
} else if ((I = l == null ? void 0 : l[p]) != null && I[v]) {
|
|
766
|
+
if (C.v = u.v, C.f = null, C.si = null, C.p = null, u.p) {
|
|
767
|
+
const f = Er(u);
|
|
768
|
+
f && (C.v = f);
|
|
775
769
|
}
|
|
776
770
|
c.setValue(p, v, C);
|
|
777
771
|
}
|
|
778
772
|
}), c;
|
|
779
773
|
}
|
|
780
|
-
function
|
|
774
|
+
function Qs(e, t, n, o, r, s, c) {
|
|
781
775
|
const i = new $e(), l = /* @__PURE__ */ new Map();
|
|
782
|
-
return o.forValue((
|
|
783
|
-
const
|
|
784
|
-
if (
|
|
776
|
+
return o.forValue((g, m, h) => {
|
|
777
|
+
const d = n.rows[g], u = n.cols[m], a = {};
|
|
778
|
+
if (at(h.si)) {
|
|
785
779
|
if (c.unitId !== e || c.subUnitId !== t) {
|
|
786
780
|
const S = s.getFormulaStringByCell(
|
|
787
|
-
c.range.rows[
|
|
788
|
-
c.range.cols[
|
|
781
|
+
c.range.rows[g % c.range.rows.length],
|
|
782
|
+
c.range.cols[m % c.range.cols.length],
|
|
789
783
|
c.subUnitId,
|
|
790
784
|
c.unitId
|
|
791
|
-
), p = n.cols[
|
|
785
|
+
), p = n.cols[m] - c.range.cols[m % c.range.cols.length], v = n.rows[g] - c.range.rows[g % c.range.rows.length], C = r.moveFormulaRefOffset(S || "", p, v);
|
|
792
786
|
a.si = null, a.f = C;
|
|
793
787
|
} else
|
|
794
|
-
a.si =
|
|
795
|
-
a.v = null, a.p = null, i.setValue(
|
|
796
|
-
} else if (
|
|
797
|
-
const S = `${
|
|
788
|
+
a.si = h.si, a.f = null;
|
|
789
|
+
a.v = null, a.p = null, i.setValue(d, u, a);
|
|
790
|
+
} else if (Le(h.f)) {
|
|
791
|
+
const S = `${g % c.range.rows.length}_${m % c.range.cols.length}`;
|
|
798
792
|
let p = l.get(S);
|
|
799
793
|
if (p)
|
|
800
794
|
a.si = p, a.f = null;
|
|
801
795
|
else {
|
|
802
796
|
p = jt(6), l.set(S, p);
|
|
803
|
-
const v = n.cols[
|
|
797
|
+
const v = n.cols[m] - c.range.cols[m % c.range.cols.length], C = n.rows[g] - c.range.rows[g % c.range.rows.length], _ = r.moveFormulaRefOffset(h.f || "", v, C);
|
|
804
798
|
a.si = p, a.f = _;
|
|
805
799
|
}
|
|
806
|
-
a.v = null, a.p = null, i.setValue(
|
|
800
|
+
a.v = null, a.p = null, i.setValue(d, u, a);
|
|
807
801
|
} else {
|
|
808
|
-
if (a.v =
|
|
809
|
-
const S =
|
|
802
|
+
if (a.v = h.v, a.f = null, a.si = null, a.p = null, h.p) {
|
|
803
|
+
const S = Er(h);
|
|
810
804
|
S && (a.v = S);
|
|
811
805
|
}
|
|
812
|
-
i.setValue(
|
|
806
|
+
i.setValue(d, u, a);
|
|
813
807
|
}
|
|
814
808
|
}), i;
|
|
815
809
|
}
|
|
816
|
-
function
|
|
817
|
-
const l = new $e(),
|
|
818
|
-
return r === rr.CUT ? o.forValue((
|
|
819
|
-
const S = n.rows[
|
|
820
|
-
if (
|
|
821
|
-
if (
|
|
822
|
-
|
|
823
|
-
else if (
|
|
810
|
+
function Js(e, t, n, o, r, s, c, i) {
|
|
811
|
+
const l = new $e(), g = /* @__PURE__ */ new Map(), m = c.getSheetFormulaData(e, t), h = [];
|
|
812
|
+
return r === rr.CUT ? o.forValue((d, u, a) => {
|
|
813
|
+
const S = n.rows[d], p = n.cols[u], v = {};
|
|
814
|
+
if (at(a.si)) {
|
|
815
|
+
if (Le(a.f))
|
|
816
|
+
h.push(a.si), v.f = a.f, v.si = a.si;
|
|
817
|
+
else if (h.includes(a.si))
|
|
824
818
|
v.f = null, v.si = a.si;
|
|
825
819
|
else {
|
|
826
820
|
const C = c.getFormulaStringByCell(
|
|
827
|
-
i.range.rows[
|
|
828
|
-
i.range.cols[
|
|
821
|
+
i.range.rows[d % i.range.rows.length],
|
|
822
|
+
i.range.cols[u % i.range.cols.length],
|
|
829
823
|
i.subUnitId,
|
|
830
824
|
i.unitId
|
|
831
825
|
);
|
|
832
826
|
v.f = C, v.si = null;
|
|
833
827
|
}
|
|
834
828
|
v.v = null, v.p = null, l.setValue(S, p, v);
|
|
835
|
-
} else
|
|
836
|
-
}) : o.forValue((
|
|
829
|
+
} else Le(a.f) && (v.f = a.f, v.si = null, v.v = null, v.p = null, l.setValue(S, p, v));
|
|
830
|
+
}) : o.forValue((d, u, a) => {
|
|
837
831
|
var C;
|
|
838
|
-
const S = n.rows[
|
|
839
|
-
if (
|
|
832
|
+
const S = n.rows[d], p = n.cols[u], v = {};
|
|
833
|
+
if (at(a.si)) {
|
|
840
834
|
if (i.unitId !== e || i.subUnitId !== t) {
|
|
841
835
|
const _ = c.getFormulaStringByCell(
|
|
842
|
-
i.range.rows[
|
|
843
|
-
i.range.cols[
|
|
836
|
+
i.range.rows[d % i.range.rows.length],
|
|
837
|
+
i.range.cols[u % i.range.cols.length],
|
|
844
838
|
i.subUnitId,
|
|
845
839
|
i.unitId
|
|
846
|
-
),
|
|
847
|
-
v.si = null, v.f =
|
|
840
|
+
), I = n.cols[u] - i.range.cols[u % i.range.cols.length], f = n.rows[d] - i.range.rows[d % i.range.rows.length], b = s.moveFormulaRefOffset(_ || "", I, f);
|
|
841
|
+
v.si = null, v.f = b;
|
|
848
842
|
} else
|
|
849
843
|
v.si = a.si, v.f = null;
|
|
850
844
|
v.v = null, v.p = null, l.setValue(S, p, v);
|
|
851
|
-
} else if (
|
|
852
|
-
const _ = `${
|
|
853
|
-
let
|
|
854
|
-
if (
|
|
855
|
-
v.si =
|
|
845
|
+
} else if (Le(a.f)) {
|
|
846
|
+
const _ = `${d % i.range.rows.length}_${u % i.range.cols.length}`;
|
|
847
|
+
let I = g.get(_);
|
|
848
|
+
if (I)
|
|
849
|
+
v.si = I, v.f = null;
|
|
856
850
|
else {
|
|
857
|
-
|
|
858
|
-
const
|
|
859
|
-
v.si =
|
|
851
|
+
I = jt(6), g.set(_, I);
|
|
852
|
+
const f = n.cols[u] - i.range.cols[u % i.range.cols.length], b = n.rows[d] - i.range.rows[d % i.range.rows.length], y = s.moveFormulaRefOffset(a.f || "", f, b);
|
|
853
|
+
v.si = I, v.f = y;
|
|
860
854
|
}
|
|
861
855
|
v.v = null, v.p = null, l.setValue(S, p, v);
|
|
862
|
-
} else (C =
|
|
863
|
-
}),
|
|
864
|
-
if (!(i.range.rows.includes(
|
|
856
|
+
} else (C = m == null ? void 0 : m[S]) != null && C[p] && (v.v = a.v, v.f = null, v.si = null, v.p = a.p, l.setValue(S, p, v));
|
|
857
|
+
}), h.length > 0 && new $e(m).forValue((d, u, a) => {
|
|
858
|
+
if (!(i.range.rows.includes(d) && i.range.cols.includes(u)) && !(n.rows.includes(d) && n.cols.includes(u)) && h.includes(a == null ? void 0 : a.si)) {
|
|
865
859
|
const S = c.getFormulaStringByCell(
|
|
866
|
-
u,
|
|
867
860
|
d,
|
|
861
|
+
u,
|
|
868
862
|
i.subUnitId,
|
|
869
863
|
i.unitId
|
|
870
864
|
);
|
|
871
|
-
l.setValue(
|
|
865
|
+
l.setValue(d, u, {
|
|
872
866
|
f: S,
|
|
873
867
|
si: null,
|
|
874
868
|
v: null,
|
|
@@ -877,7 +871,7 @@ function ti(e, t, n, o, r, s, c, i) {
|
|
|
877
871
|
}
|
|
878
872
|
}), l;
|
|
879
873
|
}
|
|
880
|
-
function
|
|
874
|
+
function Er(e) {
|
|
881
875
|
if (e != null && e.p) {
|
|
882
876
|
const t = e == null ? void 0 : e.p.body;
|
|
883
877
|
if (t == null)
|
|
@@ -886,8 +880,8 @@ function Rr(e) {
|
|
|
886
880
|
return n.substring(n.length - 2, n.length) === er ? n.substring(0, n.length - 2) : n;
|
|
887
881
|
}
|
|
888
882
|
}
|
|
889
|
-
var
|
|
890
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
883
|
+
var ei = Object.getOwnPropertyDescriptor, ti = (e, t, n, o) => {
|
|
884
|
+
for (var r = o > 1 ? void 0 : o ? ei(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
891
885
|
(c = e[s]) && (r = c(r) || r);
|
|
892
886
|
return r;
|
|
893
887
|
}, He = (e, t) => (n, o) => t(n, o, e);
|
|
@@ -922,18 +916,18 @@ let Vt = class extends ut {
|
|
|
922
916
|
_initInterceptorEditorStart() {
|
|
923
917
|
this.disposeWithMe(
|
|
924
918
|
tr(
|
|
925
|
-
this._sheetInterceptorService.writeCellInterceptor.intercept(
|
|
919
|
+
this._sheetInterceptorService.writeCellInterceptor.intercept(es, {
|
|
926
920
|
handler: (t, n, o) => {
|
|
927
921
|
var a, S, p, v;
|
|
928
|
-
const { row: r, col: s, unitId: c, subUnitId: i, worksheet: l } = n,
|
|
922
|
+
const { row: r, col: s, unitId: c, subUnitId: i, worksheet: l } = n, g = this._formulaDataModel.getArrayFormulaRange(), m = this._formulaDataModel.getArrayFormulaCellData();
|
|
929
923
|
if (this._removeArrayFormulaRangeShape(), t == null)
|
|
930
924
|
return o(t);
|
|
931
|
-
let
|
|
932
|
-
const
|
|
933
|
-
if (
|
|
934
|
-
return
|
|
935
|
-
const
|
|
936
|
-
return
|
|
925
|
+
let h = null;
|
|
926
|
+
const d = this._formulaDataModel.getFormulaStringByCell(r, s, i, c);
|
|
927
|
+
if (d !== null && (h = { f: d }), t.v != null && t.v !== "" && ((p = (S = (a = m[c]) == null ? void 0 : a[i]) == null ? void 0 : S[r]) == null ? void 0 : p[s]) == null)
|
|
928
|
+
return h ? { ...t, ...h } : o(t);
|
|
929
|
+
const u = (v = g == null ? void 0 : g[c]) == null ? void 0 : v[i];
|
|
930
|
+
return u != null && (h = this._displayArrayFormulaRangeShape(u, r, s, c, i, l, h)), h ? { ...t, ...h } : o(t);
|
|
937
931
|
}
|
|
938
932
|
})
|
|
939
933
|
)
|
|
@@ -944,7 +938,7 @@ let Vt = class extends ut {
|
|
|
944
938
|
(t.id === xo.id || t.id === Mo.id && n && n.remove) && this._removeArrayFormulaRangeShape();
|
|
945
939
|
})), this.disposeWithMe(
|
|
946
940
|
this._commandService.beforeCommandExecuted((t) => {
|
|
947
|
-
|
|
941
|
+
ts.id === t.id && requestIdleCallback(() => {
|
|
948
942
|
const n = t.params, { unitId: o, subUnitId: r, rowsAutoHeightInfo: s } = n;
|
|
949
943
|
this._refreshArrayFormulaRangeShapeByRow(o, r, s);
|
|
950
944
|
});
|
|
@@ -953,22 +947,22 @@ let Vt = class extends ut {
|
|
|
953
947
|
}
|
|
954
948
|
_displayArrayFormulaRangeShape(t, n, o, r, s, c, i) {
|
|
955
949
|
const l = this._formulaDataModel.getSheetFormulaData(r, s);
|
|
956
|
-
return new $e(t).forValue((
|
|
950
|
+
return new $e(t).forValue((g, m, h) => {
|
|
957
951
|
var p;
|
|
958
|
-
if (
|
|
952
|
+
if (h == null)
|
|
959
953
|
return !0;
|
|
960
|
-
const { startRow:
|
|
961
|
-
if (
|
|
962
|
-
return this._createArrayFormulaRangeShape(
|
|
963
|
-
if (n >=
|
|
964
|
-
const v = c.getCell(
|
|
954
|
+
const { startRow: d, startColumn: u, endRow: a, endColumn: S } = h;
|
|
955
|
+
if (g === n && m === o)
|
|
956
|
+
return this._createArrayFormulaRangeShape(h, r), !1;
|
|
957
|
+
if (n >= d && n <= a && o >= u && o <= S) {
|
|
958
|
+
const v = c.getCell(d, u);
|
|
965
959
|
if ((v == null ? void 0 : v.v) === le.SPILL)
|
|
966
960
|
return;
|
|
967
|
-
const C = (p = l == null ? void 0 : l[
|
|
961
|
+
const C = (p = l == null ? void 0 : l[g]) == null ? void 0 : p[m];
|
|
968
962
|
return C == null || C.f == null ? !0 : (i == null && (i = {
|
|
969
963
|
f: C.f,
|
|
970
964
|
isInArrayFormulaRange: !0
|
|
971
|
-
}), this._createArrayFormulaRangeShape(
|
|
965
|
+
}), this._createArrayFormulaRangeShape(h, r), !1);
|
|
972
966
|
}
|
|
973
967
|
}), i;
|
|
974
968
|
}
|
|
@@ -986,12 +980,12 @@ let Vt = class extends ut {
|
|
|
986
980
|
fill: new hn(this._themeService.getColorFromTheme("white")).setAlpha(0).toString(),
|
|
987
981
|
widgets: {}
|
|
988
982
|
}
|
|
989
|
-
}, i = rn(c, r), { rowHeaderWidth: l, columnHeaderHeight:
|
|
983
|
+
}, i = rn(c, r), { rowHeaderWidth: l, columnHeaderHeight: g } = r, m = new or(s, vo.FORMULA_EDITOR_SHOW, this._themeService, {
|
|
990
984
|
highlightHeader: !1,
|
|
991
985
|
rowHeaderWidth: l,
|
|
992
|
-
columnHeaderHeight:
|
|
986
|
+
columnHeaderHeight: g
|
|
993
987
|
});
|
|
994
|
-
|
|
988
|
+
m.updateRangeBySelectionWithCoord(i), m.setEvent(!1), this._previousShape = m;
|
|
995
989
|
}
|
|
996
990
|
_removeArrayFormulaRangeShape() {
|
|
997
991
|
this._previousShape != null && (this._previousShape.dispose(), this._previousShape = null);
|
|
@@ -1015,52 +1009,52 @@ let Vt = class extends ut {
|
|
|
1015
1009
|
if (!this._checkCurrentSheet(t, n) || !this._previousShape) return;
|
|
1016
1010
|
const { startRow: r, endRow: s, startColumn: c, endColumn: i } = this._previousShape.getRange();
|
|
1017
1011
|
for (let l = 0; l < o.length; l++) {
|
|
1018
|
-
const { row:
|
|
1019
|
-
if (r >=
|
|
1020
|
-
const
|
|
1012
|
+
const { row: g } = o[l];
|
|
1013
|
+
if (r >= g) {
|
|
1014
|
+
const m = {
|
|
1021
1015
|
startRow: r,
|
|
1022
1016
|
endRow: s,
|
|
1023
1017
|
startColumn: c,
|
|
1024
1018
|
endColumn: i
|
|
1025
1019
|
};
|
|
1026
|
-
this._refreshArrayFormulaRangeShape(t,
|
|
1020
|
+
this._refreshArrayFormulaRangeShape(t, m);
|
|
1027
1021
|
break;
|
|
1028
1022
|
}
|
|
1029
1023
|
}
|
|
1030
1024
|
}
|
|
1031
1025
|
};
|
|
1032
|
-
Vt =
|
|
1026
|
+
Vt = ti([
|
|
1033
1027
|
He(1, j(vn)),
|
|
1034
1028
|
He(2, j(bt)),
|
|
1035
1029
|
He(3, j(Et)),
|
|
1036
|
-
He(4,
|
|
1030
|
+
He(4, we),
|
|
1037
1031
|
He(5, j(qt)),
|
|
1038
1032
|
He(6, ve),
|
|
1039
|
-
He(7,
|
|
1033
|
+
He(7, Zr)
|
|
1040
1034
|
], Vt);
|
|
1041
|
-
var
|
|
1042
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
1035
|
+
var ni = Object.getOwnPropertyDescriptor, ri = (e, t, n, o) => {
|
|
1036
|
+
for (var r = o > 1 ? void 0 : o ? ni(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
1043
1037
|
(c = e[s]) && (r = c(r) || r);
|
|
1044
1038
|
return r;
|
|
1045
1039
|
}, Gn = (e, t) => (n, o) => t(n, o, e);
|
|
1046
|
-
const
|
|
1040
|
+
const oi = {
|
|
1047
1041
|
tl: {
|
|
1048
1042
|
size: 6,
|
|
1049
1043
|
color: "#409f11"
|
|
1050
1044
|
}
|
|
1051
1045
|
};
|
|
1052
|
-
let Wt = class extends
|
|
1046
|
+
let Wt = class extends zr {
|
|
1053
1047
|
constructor(e, t) {
|
|
1054
1048
|
super(), this._sheetInterceptorService = e, this._formulaDataModel = t, this.disposeWithMe(this._sheetInterceptorService.intercept(
|
|
1055
|
-
|
|
1049
|
+
ns.CELL_CONTENT,
|
|
1056
1050
|
{
|
|
1057
|
-
effect:
|
|
1051
|
+
effect: Xr.Style,
|
|
1058
1052
|
handler: (n, o, r) => {
|
|
1059
|
-
var i, l,
|
|
1060
|
-
const s = (
|
|
1061
|
-
return !
|
|
1053
|
+
var i, l, g, m;
|
|
1054
|
+
const s = (m = (g = (l = (i = this._formulaDataModel.getArrayFormulaCellData()) == null ? void 0 : i[o.unitId]) == null ? void 0 : l[o.subUnitId]) == null ? void 0 : g[o.row]) == null ? void 0 : m[o.col];
|
|
1055
|
+
return !ir(n, !!s) || !n || (n === o.rawData && (n = { ...o.rawData }), n.markers = {
|
|
1062
1056
|
...n == null ? void 0 : n.markers,
|
|
1063
|
-
...
|
|
1057
|
+
...oi
|
|
1064
1058
|
}), r(n);
|
|
1065
1059
|
},
|
|
1066
1060
|
priority: 10
|
|
@@ -1068,25 +1062,25 @@ let Wt = class extends Xr {
|
|
|
1068
1062
|
));
|
|
1069
1063
|
}
|
|
1070
1064
|
};
|
|
1071
|
-
Wt =
|
|
1065
|
+
Wt = ri([
|
|
1072
1066
|
Gn(0, j(vn)),
|
|
1073
1067
|
Gn(1, j(bt))
|
|
1074
1068
|
], Wt);
|
|
1075
|
-
function
|
|
1076
|
-
const e = T(
|
|
1069
|
+
function si() {
|
|
1070
|
+
const e = T(is), t = T(ve), n = Ce(e.progress$), o = Dt(() => {
|
|
1077
1071
|
t.executeCommand(wo.id);
|
|
1078
1072
|
}, [t]), r = Dt(() => {
|
|
1079
1073
|
e.clearProgress();
|
|
1080
1074
|
}, [e]);
|
|
1081
|
-
return /* @__PURE__ */
|
|
1075
|
+
return /* @__PURE__ */ M(us, { progress: n, onTerminate: o, onClearProgress: r });
|
|
1082
1076
|
}
|
|
1083
|
-
function
|
|
1077
|
+
function ii(e, t) {
|
|
1084
1078
|
return Object.keys(e).filter((n) => isNaN(Number(n)) && n !== "DefinedName").map((n) => ({
|
|
1085
1079
|
label: t.t(`formula.functionType.${n.toLocaleLowerCase()}`),
|
|
1086
1080
|
value: `${e[n]}`
|
|
1087
1081
|
}));
|
|
1088
1082
|
}
|
|
1089
|
-
function
|
|
1083
|
+
function Ir(e) {
|
|
1090
1084
|
if (!e.require && !e.repeat)
|
|
1091
1085
|
return `[${e.name}]`;
|
|
1092
1086
|
if (e.require && !e.repeat)
|
|
@@ -1096,7 +1090,7 @@ function Er(e) {
|
|
|
1096
1090
|
if (e.require && e.repeat)
|
|
1097
1091
|
return `${e.name},...`;
|
|
1098
1092
|
}
|
|
1099
|
-
function
|
|
1093
|
+
function br(e) {
|
|
1100
1094
|
const { prefix: t, value: n } = e;
|
|
1101
1095
|
return /* @__PURE__ */ W("div", { children: [
|
|
1102
1096
|
/* @__PURE__ */ W("span", { children: [
|
|
@@ -1104,7 +1098,7 @@ function Ir(e) {
|
|
|
1104
1098
|
"("
|
|
1105
1099
|
] }),
|
|
1106
1100
|
n && n.map((o, r) => /* @__PURE__ */ W("span", { children: [
|
|
1107
|
-
/* @__PURE__ */
|
|
1101
|
+
/* @__PURE__ */ M("span", { children: Ir(o) }),
|
|
1108
1102
|
r === n.length - 1 ? "" : ","
|
|
1109
1103
|
] }, r)),
|
|
1110
1104
|
")"
|
|
@@ -1113,14 +1107,14 @@ function Ir(e) {
|
|
|
1113
1107
|
function St(e) {
|
|
1114
1108
|
const { className: t, value: n, title: o } = e;
|
|
1115
1109
|
return /* @__PURE__ */ W("div", { className: "univer-mb-2 univer-text-xs", children: [
|
|
1116
|
-
/* @__PURE__ */
|
|
1110
|
+
/* @__PURE__ */ M(
|
|
1117
1111
|
"div",
|
|
1118
1112
|
{
|
|
1119
1113
|
className: re("univer-mb-2 univer-font-medium univer-text-gray-500 dark:!univer-text-gray-300", t),
|
|
1120
1114
|
children: o
|
|
1121
1115
|
}
|
|
1122
1116
|
),
|
|
1123
|
-
/* @__PURE__ */
|
|
1117
|
+
/* @__PURE__ */ M(
|
|
1124
1118
|
"div",
|
|
1125
1119
|
{
|
|
1126
1120
|
className: "univer-break-all univer-text-gray-900 dark:!univer-text-white",
|
|
@@ -1129,19 +1123,19 @@ function St(e) {
|
|
|
1129
1123
|
)
|
|
1130
1124
|
] });
|
|
1131
1125
|
}
|
|
1132
|
-
function
|
|
1126
|
+
function ci(e) {
|
|
1133
1127
|
const { functionInfo: t, onChange: n } = e;
|
|
1134
1128
|
if (!t) return null;
|
|
1135
1129
|
const [o, r] = V([]), [s, c] = V(t.functionParameter), [i, l] = V(-1);
|
|
1136
1130
|
return /* @__PURE__ */ W("div", { children: [
|
|
1137
|
-
/* @__PURE__ */
|
|
1138
|
-
/* @__PURE__ */
|
|
1139
|
-
/* @__PURE__ */
|
|
1140
|
-
] },
|
|
1141
|
-
/* @__PURE__ */
|
|
1131
|
+
/* @__PURE__ */ M("div", { className: re("univer-h-[364px] univer-overflow-y-auto", lt), children: s.map((g, m) => /* @__PURE__ */ W("div", { children: [
|
|
1132
|
+
/* @__PURE__ */ M("div", { className: "univer-text-sm", children: g.name }),
|
|
1133
|
+
/* @__PURE__ */ M("div", { className: "univer-mb-2 univer-mt-1" })
|
|
1134
|
+
] }, m)) }),
|
|
1135
|
+
/* @__PURE__ */ M("div", { className: re("univer-flex-1 univer-p-3", vs), children: /* @__PURE__ */ M(
|
|
1142
1136
|
St,
|
|
1143
1137
|
{
|
|
1144
|
-
title: i === -1 ? /* @__PURE__ */
|
|
1138
|
+
title: i === -1 ? /* @__PURE__ */ M(br, { prefix: t.functionName, value: s }) : s[i].name,
|
|
1145
1139
|
value: i === -1 ? t.description : s[i].detail
|
|
1146
1140
|
}
|
|
1147
1141
|
) })
|
|
@@ -1155,23 +1149,23 @@ var pe = function() {
|
|
|
1155
1149
|
}
|
|
1156
1150
|
return e;
|
|
1157
1151
|
}, pe.apply(this, arguments);
|
|
1158
|
-
},
|
|
1152
|
+
}, ai = function(e, t) {
|
|
1159
1153
|
var n = {};
|
|
1160
1154
|
for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && t.indexOf(o) < 0 && (n[o] = e[o]);
|
|
1161
1155
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
1162
1156
|
for (var r = 0, o = Object.getOwnPropertySymbols(e); r < o.length; r++)
|
|
1163
1157
|
t.indexOf(o[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[r]) && (n[o[r]] = e[o[r]]);
|
|
1164
1158
|
return n;
|
|
1165
|
-
},
|
|
1166
|
-
var n = e.icon, o = e.id, r = e.className, s = e.extend, c =
|
|
1167
|
-
return
|
|
1159
|
+
}, et = ke(function(e, t) {
|
|
1160
|
+
var n = e.icon, o = e.id, r = e.className, s = e.extend, c = ai(e, ["icon", "id", "className", "extend"]), i = "univerjs-icon univerjs-icon-".concat(o, " ").concat(r || "").trim(), l = z("_".concat(di()));
|
|
1161
|
+
return yr(n, "".concat(o), { defIds: n.defIds, idSuffix: l.current }, pe({ ref: t, className: i }, c), s);
|
|
1168
1162
|
});
|
|
1169
|
-
function
|
|
1170
|
-
return
|
|
1171
|
-
return
|
|
1163
|
+
function yr(e, t, n, o, r) {
|
|
1164
|
+
return Je(e.tag, pe(pe({ key: t }, li(e, n, r)), o), (ui(e, n).children || []).map(function(s, c) {
|
|
1165
|
+
return yr(s, "".concat(t, "-").concat(e.tag, "-").concat(c), n, void 0, r);
|
|
1172
1166
|
}));
|
|
1173
1167
|
}
|
|
1174
|
-
function
|
|
1168
|
+
function li(e, t, n) {
|
|
1175
1169
|
var o = pe({}, e.attrs);
|
|
1176
1170
|
n != null && n.colorChannel1 && o.fill === "colorChannel1" && (o.fill = n.colorChannel1), e.tag === "mask" && o.id && (o.id = o.id + t.idSuffix), Object.entries(o).forEach(function(s) {
|
|
1177
1171
|
var c = s[0], i = s[1];
|
|
@@ -1183,127 +1177,127 @@ function di(e, t, n) {
|
|
|
1183
1177
|
typeof i == "string" && (o[c] = i.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
|
|
1184
1178
|
})), o;
|
|
1185
1179
|
}
|
|
1186
|
-
function
|
|
1180
|
+
function ui(e, t) {
|
|
1187
1181
|
var n, o = t.defIds;
|
|
1188
1182
|
return !o || o.length === 0 ? e : e.tag === "defs" && (!((n = e.children) === null || n === void 0) && n.length) ? pe(pe({}, e), { children: e.children.map(function(r) {
|
|
1189
1183
|
return typeof r.attrs.id == "string" && o && o.includes(r.attrs.id) ? pe(pe({}, r), { attrs: pe(pe({}, r.attrs), { id: r.attrs.id + t.idSuffix }) }) : r;
|
|
1190
1184
|
}) }) : e;
|
|
1191
1185
|
}
|
|
1192
|
-
function
|
|
1186
|
+
function di() {
|
|
1193
1187
|
return Math.random().toString(36).substring(2, 8);
|
|
1194
1188
|
}
|
|
1195
|
-
|
|
1196
|
-
var
|
|
1197
|
-
return et
|
|
1189
|
+
et.displayName = "UniverIcon";
|
|
1190
|
+
var hi = { 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" } }] }, Tr = ke(function(e, t) {
|
|
1191
|
+
return Je(et, Object.assign({}, e, {
|
|
1198
1192
|
id: "check-mark-icon",
|
|
1199
1193
|
ref: t,
|
|
1200
|
-
icon:
|
|
1194
|
+
icon: hi
|
|
1201
1195
|
}));
|
|
1202
1196
|
});
|
|
1203
|
-
|
|
1204
|
-
var
|
|
1205
|
-
return et
|
|
1197
|
+
Tr.displayName = "CheckMarkIcon";
|
|
1198
|
+
var fi = { 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" } }] }, Or = ke(function(e, t) {
|
|
1199
|
+
return Je(et, Object.assign({}, e, {
|
|
1206
1200
|
id: "close-icon",
|
|
1207
1201
|
ref: t,
|
|
1208
|
-
icon:
|
|
1202
|
+
icon: fi
|
|
1209
1203
|
}));
|
|
1210
1204
|
});
|
|
1211
|
-
|
|
1212
|
-
var
|
|
1213
|
-
return et
|
|
1205
|
+
Or.displayName = "CloseIcon";
|
|
1206
|
+
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: "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" } }] }, Nr = ke(function(e, t) {
|
|
1207
|
+
return Je(et, Object.assign({}, e, {
|
|
1214
1208
|
id: "delete-icon",
|
|
1215
1209
|
ref: t,
|
|
1216
|
-
icon:
|
|
1210
|
+
icon: gi
|
|
1217
1211
|
}));
|
|
1218
1212
|
});
|
|
1219
|
-
|
|
1220
|
-
var
|
|
1221
|
-
return et
|
|
1213
|
+
Nr.displayName = "DeleteIcon";
|
|
1214
|
+
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: "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" } }] }, xr = ke(function(e, t) {
|
|
1215
|
+
return Je(et, Object.assign({}, e, {
|
|
1222
1216
|
id: "increase-icon",
|
|
1223
1217
|
ref: t,
|
|
1224
|
-
icon:
|
|
1218
|
+
icon: mi
|
|
1225
1219
|
}));
|
|
1226
1220
|
});
|
|
1227
|
-
|
|
1228
|
-
var
|
|
1229
|
-
return et
|
|
1221
|
+
xr.displayName = "IncreaseIcon";
|
|
1222
|
+
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.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" } }] }, Mr = ke(function(e, t) {
|
|
1223
|
+
return Je(et, Object.assign({}, e, {
|
|
1230
1224
|
id: "more-icon",
|
|
1231
1225
|
ref: t,
|
|
1232
|
-
icon:
|
|
1226
|
+
icon: pi
|
|
1233
1227
|
}));
|
|
1234
1228
|
});
|
|
1235
|
-
|
|
1236
|
-
var
|
|
1237
|
-
return et
|
|
1229
|
+
Mr.displayName = "MoreIcon";
|
|
1230
|
+
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: "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" } }] }, wr = ke(function(e, t) {
|
|
1231
|
+
return Je(et, Object.assign({}, e, {
|
|
1238
1232
|
id: "select-range-icon",
|
|
1239
1233
|
ref: t,
|
|
1240
|
-
icon:
|
|
1234
|
+
icon: vi
|
|
1241
1235
|
}));
|
|
1242
1236
|
});
|
|
1243
|
-
|
|
1244
|
-
function
|
|
1245
|
-
const { onChange: t } = e, n = "-1", [o, r] = V(""), [s, c] = V([]), [i, l] = V(0), [
|
|
1237
|
+
wr.displayName = "SelectRangeIcon";
|
|
1238
|
+
function Si(e) {
|
|
1239
|
+
const { onChange: t } = e, n = "-1", [o, r] = V(""), [s, c] = V([]), [i, l] = V(0), [g, m] = V(n), [h, d] = V(0), [u, a] = V(null), S = T(Yt), p = T(dt), v = T(Sn), C = Ce(v.sidebarOptions$), _ = ii(cr, p);
|
|
1246
1240
|
_.unshift({
|
|
1247
1241
|
label: p.t("formula.moreFunctions.allFunctions"),
|
|
1248
1242
|
value: n
|
|
1249
1243
|
});
|
|
1250
|
-
const
|
|
1244
|
+
const I = p.t("formula.prompt.required"), f = p.t("formula.prompt.optional");
|
|
1251
1245
|
$(() => {
|
|
1252
|
-
|
|
1246
|
+
A(n);
|
|
1253
1247
|
}, []), $(() => {
|
|
1254
|
-
|
|
1248
|
+
y(0);
|
|
1255
1249
|
}, [s]), $(() => {
|
|
1256
|
-
C != null && C.visible && (r(""), c([]), l(0),
|
|
1250
|
+
C != null && C.visible && (r(""), c([]), l(0), m(n), d(0), a(null), A(n));
|
|
1257
1251
|
}, [C]);
|
|
1258
|
-
const
|
|
1259
|
-
if (o.trim() === "") return
|
|
1260
|
-
const
|
|
1261
|
-
return
|
|
1262
|
-
},
|
|
1252
|
+
const b = (E) => {
|
|
1253
|
+
if (o.trim() === "") return E;
|
|
1254
|
+
const x = new RegExp(`(${o.toLocaleUpperCase()})`);
|
|
1255
|
+
return E.split(x).filter(Boolean).map((w, D) => w.match(x) ? /* @__PURE__ */ M("span", { className: "univer-text-red-500", children: w }, D) : w);
|
|
1256
|
+
}, y = (E) => {
|
|
1263
1257
|
if (s.length === 0) {
|
|
1264
1258
|
a(null);
|
|
1265
1259
|
return;
|
|
1266
1260
|
}
|
|
1267
|
-
|
|
1268
|
-
const
|
|
1269
|
-
if (!
|
|
1261
|
+
d(E);
|
|
1262
|
+
const x = S.getFunctionInfo(s[E].name);
|
|
1263
|
+
if (!x) {
|
|
1270
1264
|
a(null);
|
|
1271
1265
|
return;
|
|
1272
1266
|
}
|
|
1273
|
-
a(
|
|
1267
|
+
a(x), t(x);
|
|
1274
1268
|
};
|
|
1275
|
-
function
|
|
1276
|
-
|
|
1277
|
-
const
|
|
1278
|
-
c(
|
|
1279
|
-
}
|
|
1280
|
-
function F(
|
|
1281
|
-
r(
|
|
1282
|
-
const
|
|
1283
|
-
c(
|
|
1284
|
-
}
|
|
1285
|
-
function
|
|
1286
|
-
if (
|
|
1287
|
-
const
|
|
1288
|
-
l(
|
|
1289
|
-
} else if (
|
|
1290
|
-
const
|
|
1291
|
-
l(
|
|
1292
|
-
} else
|
|
1293
|
-
}
|
|
1294
|
-
const
|
|
1295
|
-
l(
|
|
1296
|
-
},
|
|
1269
|
+
function A(E) {
|
|
1270
|
+
m(E);
|
|
1271
|
+
const x = S.getSearchListByType(+E);
|
|
1272
|
+
c(x);
|
|
1273
|
+
}
|
|
1274
|
+
function F(E) {
|
|
1275
|
+
r(E);
|
|
1276
|
+
const x = S.getSearchListByName(E);
|
|
1277
|
+
c(x);
|
|
1278
|
+
}
|
|
1279
|
+
function O(E) {
|
|
1280
|
+
if (E.stopPropagation(), E.key === "ArrowDown") {
|
|
1281
|
+
const x = i + 1;
|
|
1282
|
+
l(x === s.length ? 0 : x);
|
|
1283
|
+
} else if (E.key === "ArrowUp") {
|
|
1284
|
+
const x = i - 1;
|
|
1285
|
+
l(x === -1 ? s.length - 1 : x);
|
|
1286
|
+
} else E.key === "Enter" && y(i);
|
|
1287
|
+
}
|
|
1288
|
+
const N = (E) => {
|
|
1289
|
+
l(E);
|
|
1290
|
+
}, k = () => {
|
|
1297
1291
|
l(-1);
|
|
1298
1292
|
};
|
|
1299
1293
|
return /* @__PURE__ */ W("div", { children: [
|
|
1300
1294
|
/* @__PURE__ */ W("div", { className: "univer-flex univer-items-center univer-justify-between univer-gap-2", children: [
|
|
1301
|
-
/* @__PURE__ */
|
|
1302
|
-
/* @__PURE__ */
|
|
1303
|
-
|
|
1295
|
+
/* @__PURE__ */ M(Ss, { value: g, options: _, onChange: A }),
|
|
1296
|
+
/* @__PURE__ */ M(
|
|
1297
|
+
vr,
|
|
1304
1298
|
{
|
|
1305
1299
|
placeholder: p.t("formula.moreFunctions.searchFunctionPlaceholder"),
|
|
1306
|
-
onKeyDown:
|
|
1300
|
+
onKeyDown: O,
|
|
1307
1301
|
value: o,
|
|
1308
1302
|
onChange: F,
|
|
1309
1303
|
size: "small",
|
|
@@ -1311,76 +1305,76 @@ function _i(e) {
|
|
|
1311
1305
|
}
|
|
1312
1306
|
)
|
|
1313
1307
|
] }),
|
|
1314
|
-
s.length > 0 && /* @__PURE__ */
|
|
1308
|
+
s.length > 0 && /* @__PURE__ */ M(
|
|
1315
1309
|
"ul",
|
|
1316
1310
|
{
|
|
1317
1311
|
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:
|
|
1312
|
+
onKeyDown: O,
|
|
1319
1313
|
tabIndex: -1,
|
|
1320
|
-
children: s.map(({ name:
|
|
1314
|
+
children: s.map(({ name: E }, x) => /* @__PURE__ */ W(
|
|
1321
1315
|
"li",
|
|
1322
1316
|
{
|
|
1323
1317
|
className: re("univer-relative univer-box-border univer-cursor-pointer univer-rounded univer-px-7 univer-py-1 univer-text-sm univer-text-gray-900 univer-transition-colors dark:!univer-text-white", {
|
|
1324
|
-
"univer-bg-gray-200 dark:!univer-bg-gray-600": i ===
|
|
1318
|
+
"univer-bg-gray-200 dark:!univer-bg-gray-600": i === x
|
|
1325
1319
|
}),
|
|
1326
|
-
onMouseEnter: () =>
|
|
1327
|
-
onMouseLeave:
|
|
1328
|
-
onClick: () => x
|
|
1320
|
+
onMouseEnter: () => N(x),
|
|
1321
|
+
onMouseLeave: k,
|
|
1322
|
+
onClick: () => y(x),
|
|
1329
1323
|
children: [
|
|
1330
|
-
|
|
1331
|
-
|
|
1324
|
+
h === x && /* @__PURE__ */ M(
|
|
1325
|
+
Tr,
|
|
1332
1326
|
{
|
|
1333
1327
|
className: "univer-absolute univer-left-1.5 univer-top-1/2 univer-inline-flex -univer-translate-y-1/2 univer-text-base univer-text-primary-600"
|
|
1334
1328
|
}
|
|
1335
1329
|
),
|
|
1336
|
-
/* @__PURE__ */
|
|
1330
|
+
/* @__PURE__ */ M("span", { className: "univer-block", children: b(E) })
|
|
1337
1331
|
]
|
|
1338
1332
|
},
|
|
1339
|
-
|
|
1333
|
+
x
|
|
1340
1334
|
))
|
|
1341
1335
|
}
|
|
1342
1336
|
),
|
|
1343
|
-
|
|
1344
|
-
/* @__PURE__ */
|
|
1345
|
-
/* @__PURE__ */
|
|
1337
|
+
u && /* @__PURE__ */ W("div", { className: re("univer-mx-0 univer-my-2 univer-overflow-y-auto", lt), children: [
|
|
1338
|
+
/* @__PURE__ */ M(St, { title: u.functionName, value: u.description }),
|
|
1339
|
+
/* @__PURE__ */ M(
|
|
1346
1340
|
St,
|
|
1347
1341
|
{
|
|
1348
1342
|
title: p.t("formula.moreFunctions.syntax"),
|
|
1349
|
-
value: /* @__PURE__ */
|
|
1343
|
+
value: /* @__PURE__ */ M(br, { prefix: u.functionName, value: u.functionParameter })
|
|
1350
1344
|
}
|
|
1351
1345
|
),
|
|
1352
|
-
/* @__PURE__ */
|
|
1346
|
+
/* @__PURE__ */ M(
|
|
1353
1347
|
St,
|
|
1354
1348
|
{
|
|
1355
1349
|
title: p.t("formula.prompt.helpExample"),
|
|
1356
|
-
value: `${
|
|
1350
|
+
value: `${u.functionName}(${u.functionParameter.map((E) => E.example).join(",")})`
|
|
1357
1351
|
}
|
|
1358
1352
|
),
|
|
1359
|
-
|
|
1353
|
+
u.functionParameter && u.functionParameter.map((E) => /* @__PURE__ */ M(
|
|
1360
1354
|
St,
|
|
1361
1355
|
{
|
|
1362
|
-
title:
|
|
1363
|
-
value: `${
|
|
1356
|
+
title: E.name,
|
|
1357
|
+
value: `${E.require ? I : f} ${E.detail}`
|
|
1364
1358
|
},
|
|
1365
|
-
|
|
1359
|
+
E.name
|
|
1366
1360
|
))
|
|
1367
1361
|
] })
|
|
1368
1362
|
] });
|
|
1369
1363
|
}
|
|
1370
|
-
function
|
|
1371
|
-
const e =
|
|
1364
|
+
function Ci() {
|
|
1365
|
+
const e = So(), [t, n] = V(!0), [o, r] = V(!1), [s, c] = V(null);
|
|
1372
1366
|
T(fn);
|
|
1373
|
-
const i = T(dt), l = T(
|
|
1374
|
-
function
|
|
1367
|
+
const i = T(dt), l = T(Ye), g = T(ne), m = T(ve);
|
|
1368
|
+
function h() {
|
|
1375
1369
|
n(!t), r(!o);
|
|
1376
1370
|
}
|
|
1377
|
-
function
|
|
1378
|
-
const
|
|
1379
|
-
if (!
|
|
1380
|
-
|
|
1371
|
+
function d() {
|
|
1372
|
+
const u = fr(g);
|
|
1373
|
+
if (!u) return;
|
|
1374
|
+
m.executeCommand(nr.id, {
|
|
1381
1375
|
visible: !0,
|
|
1382
|
-
unitId:
|
|
1383
|
-
eventType:
|
|
1376
|
+
unitId: u.unitId,
|
|
1377
|
+
eventType: Me.Dblclick
|
|
1384
1378
|
});
|
|
1385
1379
|
const a = l.getEditor(un), S = l.getEditor(Jn), p = `=${s == null ? void 0 : s.functionName}(`;
|
|
1386
1380
|
a == null || a.replaceText(p), S == null || S.replaceText(p, !1);
|
|
@@ -1391,25 +1385,25 @@ function Ri() {
|
|
|
1391
1385
|
"data-u-comp": "sheets-formula-functions-panel",
|
|
1392
1386
|
className: "univer-box-border univer-flex univer-h-full univer-flex-col univer-justify-between univer-py-2",
|
|
1393
1387
|
children: [
|
|
1394
|
-
t && /* @__PURE__ */
|
|
1395
|
-
o && /* @__PURE__ */
|
|
1388
|
+
t && /* @__PURE__ */ M(Si, { onChange: c }),
|
|
1389
|
+
o && /* @__PURE__ */ M(ci, { functionInfo: s, onChange: () => {
|
|
1396
1390
|
} }),
|
|
1397
1391
|
/* @__PURE__ */ W("div", { className: "univer-flex univer-justify-end", children: [
|
|
1398
|
-
o && /* @__PURE__ */
|
|
1399
|
-
|
|
1392
|
+
o && /* @__PURE__ */ M(
|
|
1393
|
+
ct,
|
|
1400
1394
|
{
|
|
1401
1395
|
variant: "primary",
|
|
1402
|
-
onClick:
|
|
1396
|
+
onClick: h,
|
|
1403
1397
|
className: "univer-mb-5 univer-ml-4 univer-mr-0 univer-mt-0",
|
|
1404
1398
|
children: i.t("formula.moreFunctions.next")
|
|
1405
1399
|
}
|
|
1406
1400
|
),
|
|
1407
|
-
o && /* @__PURE__ */
|
|
1408
|
-
t && !!e && /* @__PURE__ */
|
|
1409
|
-
|
|
1401
|
+
o && /* @__PURE__ */ M(ct, { onClick: h, className: "univer-mb-5 univer-ml-4 univer-mr-0 univer-mt-0", children: i.t("formula.moreFunctions.prev") }),
|
|
1402
|
+
t && !!e && /* @__PURE__ */ M(
|
|
1403
|
+
ct,
|
|
1410
1404
|
{
|
|
1411
1405
|
variant: "primary",
|
|
1412
|
-
onClick:
|
|
1406
|
+
onClick: d,
|
|
1413
1407
|
className: "univer-mb-5 univer-ml-4 univer-mr-0 univer-mt-0",
|
|
1414
1408
|
children: i.t("formula.moreFunctions.confirm")
|
|
1415
1409
|
}
|
|
@@ -1419,181 +1413,185 @@ function Ri() {
|
|
|
1419
1413
|
}
|
|
1420
1414
|
);
|
|
1421
1415
|
}
|
|
1422
|
-
function
|
|
1416
|
+
function _i(e) {
|
|
1423
1417
|
return {
|
|
1424
1418
|
id: Se.id,
|
|
1425
1419
|
title: "SUM",
|
|
1426
1420
|
icon: "SumIcon",
|
|
1427
|
-
type:
|
|
1421
|
+
type: Qe.BUTTON,
|
|
1428
1422
|
params: {
|
|
1429
1423
|
value: "SUM"
|
|
1430
1424
|
},
|
|
1431
1425
|
hidden$: ft(e, H.UNIVER_SHEET),
|
|
1432
|
-
disabled$:
|
|
1433
|
-
workbookTypes: [
|
|
1434
|
-
worksheetTypes: [
|
|
1435
|
-
rangeTypes: [
|
|
1426
|
+
disabled$: Ke(e, {
|
|
1427
|
+
workbookTypes: [Xe],
|
|
1428
|
+
worksheetTypes: [Ze, Ge],
|
|
1429
|
+
rangeTypes: [ze]
|
|
1436
1430
|
})
|
|
1437
1431
|
};
|
|
1438
1432
|
}
|
|
1439
|
-
function
|
|
1433
|
+
function Ri(e) {
|
|
1440
1434
|
return {
|
|
1441
1435
|
id: Se.id,
|
|
1442
1436
|
title: "COUNT",
|
|
1443
1437
|
icon: "CntIcon",
|
|
1444
|
-
type:
|
|
1438
|
+
type: Qe.BUTTON,
|
|
1445
1439
|
params: {
|
|
1446
1440
|
value: "COUNT"
|
|
1447
1441
|
},
|
|
1448
1442
|
hidden$: ft(e, H.UNIVER_SHEET),
|
|
1449
|
-
disabled$:
|
|
1450
|
-
workbookTypes: [
|
|
1451
|
-
worksheetTypes: [
|
|
1452
|
-
rangeTypes: [
|
|
1443
|
+
disabled$: Ke(e, {
|
|
1444
|
+
workbookTypes: [Xe],
|
|
1445
|
+
worksheetTypes: [Ze, Ge],
|
|
1446
|
+
rangeTypes: [ze]
|
|
1453
1447
|
})
|
|
1454
1448
|
};
|
|
1455
1449
|
}
|
|
1456
|
-
function
|
|
1450
|
+
function Ei(e) {
|
|
1457
1451
|
return {
|
|
1458
1452
|
id: Se.id,
|
|
1459
1453
|
title: "AVERAGE",
|
|
1460
1454
|
icon: "AvgIcon",
|
|
1461
|
-
type:
|
|
1455
|
+
type: Qe.BUTTON,
|
|
1462
1456
|
params: {
|
|
1463
1457
|
value: "AVERAGE"
|
|
1464
1458
|
},
|
|
1465
1459
|
hidden$: ft(e, H.UNIVER_SHEET),
|
|
1466
|
-
disabled$:
|
|
1467
|
-
workbookTypes: [
|
|
1468
|
-
worksheetTypes: [
|
|
1469
|
-
rangeTypes: [
|
|
1460
|
+
disabled$: Ke(e, {
|
|
1461
|
+
workbookTypes: [Xe],
|
|
1462
|
+
worksheetTypes: [Ze, Ge],
|
|
1463
|
+
rangeTypes: [ze]
|
|
1470
1464
|
})
|
|
1471
1465
|
};
|
|
1472
1466
|
}
|
|
1473
|
-
function
|
|
1467
|
+
function Ii(e) {
|
|
1474
1468
|
return {
|
|
1475
1469
|
id: Se.id,
|
|
1476
1470
|
title: "MAX",
|
|
1477
1471
|
icon: "MaxIcon",
|
|
1478
|
-
type:
|
|
1472
|
+
type: Qe.BUTTON,
|
|
1479
1473
|
params: {
|
|
1480
1474
|
value: "MAX"
|
|
1481
1475
|
},
|
|
1482
1476
|
hidden$: ft(e, H.UNIVER_SHEET),
|
|
1483
|
-
disabled$:
|
|
1484
|
-
workbookTypes: [
|
|
1485
|
-
worksheetTypes: [
|
|
1486
|
-
rangeTypes: [
|
|
1477
|
+
disabled$: Ke(e, {
|
|
1478
|
+
workbookTypes: [Xe],
|
|
1479
|
+
worksheetTypes: [Ze, Ge],
|
|
1480
|
+
rangeTypes: [ze]
|
|
1487
1481
|
})
|
|
1488
1482
|
};
|
|
1489
1483
|
}
|
|
1490
|
-
function
|
|
1484
|
+
function bi(e) {
|
|
1491
1485
|
return {
|
|
1492
1486
|
id: Se.id,
|
|
1493
1487
|
title: "MIN",
|
|
1494
1488
|
icon: "MinIcon",
|
|
1495
|
-
type:
|
|
1489
|
+
type: Qe.BUTTON,
|
|
1496
1490
|
params: {
|
|
1497
1491
|
value: "MIN"
|
|
1498
1492
|
},
|
|
1499
1493
|
hidden$: ft(e, H.UNIVER_SHEET),
|
|
1500
|
-
disabled$:
|
|
1501
|
-
workbookTypes: [
|
|
1502
|
-
worksheetTypes: [
|
|
1503
|
-
rangeTypes: [
|
|
1494
|
+
disabled$: Ke(e, {
|
|
1495
|
+
workbookTypes: [Xe],
|
|
1496
|
+
worksheetTypes: [Ze, Ge],
|
|
1497
|
+
rangeTypes: [ze]
|
|
1504
1498
|
})
|
|
1505
1499
|
};
|
|
1506
1500
|
}
|
|
1507
|
-
function
|
|
1501
|
+
function yi(e) {
|
|
1508
1502
|
return {
|
|
1509
1503
|
id: Rn.id,
|
|
1510
1504
|
title: "formula.insert.more",
|
|
1511
1505
|
tooltip: "formula.insert.tooltip",
|
|
1512
|
-
type:
|
|
1506
|
+
type: Qe.BUTTON,
|
|
1513
1507
|
hidden$: ft(e, H.UNIVER_SHEET),
|
|
1514
|
-
disabled$:
|
|
1515
|
-
workbookTypes: [
|
|
1516
|
-
worksheetTypes: [
|
|
1517
|
-
rangeTypes: [
|
|
1508
|
+
disabled$: Ke(e, {
|
|
1509
|
+
workbookTypes: [Xe],
|
|
1510
|
+
worksheetTypes: [Ze, Ge],
|
|
1511
|
+
rangeTypes: [ze]
|
|
1518
1512
|
})
|
|
1519
1513
|
};
|
|
1520
1514
|
}
|
|
1521
|
-
function
|
|
1515
|
+
function Ti(e) {
|
|
1522
1516
|
return e.get(ne).getCurrentTypeOfUnit$(H.UNIVER_SHEET).pipe(
|
|
1523
|
-
|
|
1517
|
+
Vo((o) => o ? e.get(Hn) ? new Wo((s) => s.next(!e.get(Hn).supportClipboard)) : Ln(!0) : Ln(!0))
|
|
1524
1518
|
);
|
|
1525
1519
|
}
|
|
1526
|
-
function
|
|
1520
|
+
function Oi(e) {
|
|
1527
1521
|
return {
|
|
1528
1522
|
id: _n.id,
|
|
1529
|
-
type:
|
|
1523
|
+
type: Qe.BUTTON,
|
|
1530
1524
|
title: "formula.operation.pasteFormula",
|
|
1531
|
-
disabled$:
|
|
1532
|
-
|
|
1533
|
-
workbookTypes: [
|
|
1534
|
-
rangeTypes: [
|
|
1535
|
-
worksheetTypes: [
|
|
1525
|
+
disabled$: Ti(e).pipe(
|
|
1526
|
+
Uo(Ke(e, {
|
|
1527
|
+
workbookTypes: [Xe],
|
|
1528
|
+
rangeTypes: [ze],
|
|
1529
|
+
worksheetTypes: [Ge, Ze]
|
|
1536
1530
|
})),
|
|
1537
|
-
|
|
1531
|
+
lr(([t, n]) => t || n)
|
|
1538
1532
|
)
|
|
1539
1533
|
};
|
|
1540
1534
|
}
|
|
1541
|
-
const
|
|
1535
|
+
const Ni = {
|
|
1542
1536
|
[Bn.BASIC]: {
|
|
1543
1537
|
[`${Se.id}.sum`]: {
|
|
1544
1538
|
order: 0,
|
|
1545
|
-
menuItemFactory:
|
|
1539
|
+
menuItemFactory: _i
|
|
1546
1540
|
},
|
|
1547
1541
|
[`${Se.id}.count`]: {
|
|
1548
1542
|
order: 1,
|
|
1549
|
-
menuItemFactory:
|
|
1543
|
+
menuItemFactory: Ri
|
|
1550
1544
|
},
|
|
1551
1545
|
[`${Se.id}.average`]: {
|
|
1552
1546
|
order: 2,
|
|
1553
|
-
menuItemFactory:
|
|
1547
|
+
menuItemFactory: Ei
|
|
1554
1548
|
},
|
|
1555
1549
|
[`${Se.id}.max`]: {
|
|
1556
1550
|
order: 3,
|
|
1557
|
-
menuItemFactory:
|
|
1551
|
+
menuItemFactory: Ii
|
|
1558
1552
|
},
|
|
1559
1553
|
[`${Se.id}.min`]: {
|
|
1560
1554
|
order: 4,
|
|
1561
|
-
menuItemFactory:
|
|
1555
|
+
menuItemFactory: bi
|
|
1562
1556
|
}
|
|
1563
1557
|
},
|
|
1564
1558
|
[Bn.OTHERS]: {
|
|
1565
1559
|
[Rn.id]: {
|
|
1566
1560
|
order: 0,
|
|
1567
|
-
menuItemFactory:
|
|
1561
|
+
menuItemFactory: yi
|
|
1568
1562
|
}
|
|
1569
1563
|
},
|
|
1570
|
-
[
|
|
1564
|
+
[Co]: {
|
|
1571
1565
|
[_n.id]: {
|
|
1572
1566
|
order: 4,
|
|
1573
|
-
menuItemFactory:
|
|
1567
|
+
menuItemFactory: Oi
|
|
1574
1568
|
}
|
|
1575
1569
|
}
|
|
1576
|
-
},
|
|
1570
|
+
}, xi = "meta_key_ctrl_And_Shift";
|
|
1571
|
+
function Mi(e) {
|
|
1572
|
+
return e.getContextValue(Qr) && e.getContextValue(Jr);
|
|
1573
|
+
}
|
|
1574
|
+
const zt = [
|
|
1577
1575
|
L.ARROW_DOWN,
|
|
1578
1576
|
L.ARROW_UP,
|
|
1579
1577
|
L.ARROW_LEFT,
|
|
1580
1578
|
L.ARROW_RIGHT
|
|
1581
|
-
],
|
|
1582
|
-
function
|
|
1579
|
+
], wi = [...zt, L.ENTER, L.TAB, L.ESC];
|
|
1580
|
+
function ki() {
|
|
1583
1581
|
const e = [];
|
|
1584
|
-
for (const t of
|
|
1582
|
+
for (const t of wi)
|
|
1585
1583
|
e.push({
|
|
1586
1584
|
id: gt.id,
|
|
1587
1585
|
binding: t,
|
|
1588
1586
|
preconditions: (n) => It(n),
|
|
1589
1587
|
staticParameters: {
|
|
1590
|
-
eventType:
|
|
1588
|
+
eventType: Me.Keyboard,
|
|
1591
1589
|
keycode: t
|
|
1592
1590
|
}
|
|
1593
1591
|
});
|
|
1594
1592
|
return e;
|
|
1595
1593
|
}
|
|
1596
|
-
function
|
|
1594
|
+
function Ai() {
|
|
1597
1595
|
const e = [];
|
|
1598
1596
|
for (const t of zt)
|
|
1599
1597
|
e.push({
|
|
@@ -1601,14 +1599,14 @@ function Fi() {
|
|
|
1601
1599
|
binding: t | P.SHIFT,
|
|
1602
1600
|
preconditions: (n) => It(n),
|
|
1603
1601
|
staticParameters: {
|
|
1604
|
-
eventType:
|
|
1602
|
+
eventType: Me.Keyboard,
|
|
1605
1603
|
keycode: t,
|
|
1606
1604
|
metaKey: P.SHIFT
|
|
1607
1605
|
}
|
|
1608
1606
|
});
|
|
1609
1607
|
return e;
|
|
1610
1608
|
}
|
|
1611
|
-
function
|
|
1609
|
+
function Fi() {
|
|
1612
1610
|
const e = [];
|
|
1613
1611
|
for (const t of zt)
|
|
1614
1612
|
e.push({
|
|
@@ -1616,14 +1614,14 @@ function Di() {
|
|
|
1616
1614
|
binding: t | P.CTRL_COMMAND,
|
|
1617
1615
|
preconditions: (n) => It(n),
|
|
1618
1616
|
staticParameters: {
|
|
1619
|
-
eventType:
|
|
1617
|
+
eventType: Me.Keyboard,
|
|
1620
1618
|
keycode: t,
|
|
1621
1619
|
metaKey: P.CTRL_COMMAND
|
|
1622
1620
|
}
|
|
1623
1621
|
});
|
|
1624
1622
|
return e;
|
|
1625
1623
|
}
|
|
1626
|
-
function
|
|
1624
|
+
function Di() {
|
|
1627
1625
|
const e = [];
|
|
1628
1626
|
for (const t of zt)
|
|
1629
1627
|
e.push({
|
|
@@ -1631,43 +1629,43 @@ function Li() {
|
|
|
1631
1629
|
binding: t | P.SHIFT | P.CTRL_COMMAND,
|
|
1632
1630
|
preconditions: (n) => It(n),
|
|
1633
1631
|
staticParameters: {
|
|
1634
|
-
eventType:
|
|
1632
|
+
eventType: Me.Keyboard,
|
|
1635
1633
|
keycode: t,
|
|
1636
|
-
metaKey:
|
|
1634
|
+
metaKey: xi
|
|
1637
1635
|
}
|
|
1638
1636
|
});
|
|
1639
1637
|
return e;
|
|
1640
1638
|
}
|
|
1641
|
-
const
|
|
1642
|
-
id:
|
|
1639
|
+
const Li = {
|
|
1640
|
+
id: Rr.id,
|
|
1643
1641
|
binding: L.F4,
|
|
1644
1642
|
preconditions: (e) => It(e)
|
|
1645
1643
|
};
|
|
1646
|
-
function
|
|
1644
|
+
function $i() {
|
|
1647
1645
|
const e = [];
|
|
1648
1646
|
for (const t of [L.ENTER, L.TAB, L.ARROW_DOWN, L.ARROW_UP])
|
|
1649
1647
|
e.push({
|
|
1650
1648
|
id: gt.id,
|
|
1651
1649
|
binding: t,
|
|
1652
|
-
preconditions: (n) =>
|
|
1650
|
+
preconditions: (n) => Mi(n),
|
|
1653
1651
|
staticParameters: {
|
|
1654
|
-
eventType:
|
|
1652
|
+
eventType: Me.Keyboard,
|
|
1655
1653
|
keycode: t,
|
|
1656
1654
|
isSingleEditor: !0
|
|
1657
1655
|
}
|
|
1658
1656
|
});
|
|
1659
1657
|
return e;
|
|
1660
1658
|
}
|
|
1661
|
-
const
|
|
1662
|
-
id:
|
|
1659
|
+
const Pi = {
|
|
1660
|
+
id: cs.id,
|
|
1663
1661
|
binding: P.ALT | L.EQUAL,
|
|
1664
|
-
preconditions:
|
|
1662
|
+
preconditions: _o,
|
|
1665
1663
|
mac: P.CTRL_COMMAND | P.ALT | L.EQUAL,
|
|
1666
1664
|
description: "shortcut.sheets-formula-ui.quick-sum",
|
|
1667
1665
|
group: "4_sheet-edit"
|
|
1668
1666
|
};
|
|
1669
|
-
var
|
|
1670
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
1667
|
+
var Ui = Object.getOwnPropertyDescriptor, Vi = (e, t, n, o) => {
|
|
1668
|
+
for (var r = o > 1 ? void 0 : o ? Ui(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
1671
1669
|
(c = e[s]) && (r = c(r) || r);
|
|
1672
1670
|
return r;
|
|
1673
1671
|
}, Be = (e, t) => (n, o) => t(n, o, e);
|
|
@@ -1679,51 +1677,51 @@ let Ht = class extends ut {
|
|
|
1679
1677
|
this._registerCommands(), this._registerMenus(), this._registerShortcuts(), this._registerComponents(), this._registerRenderModules();
|
|
1680
1678
|
}
|
|
1681
1679
|
_registerMenus() {
|
|
1682
|
-
this._menuManagerService.mergeMenu(
|
|
1680
|
+
this._menuManagerService.mergeMenu(Ni);
|
|
1683
1681
|
}
|
|
1684
1682
|
_registerCommands() {
|
|
1685
1683
|
[
|
|
1686
1684
|
_n,
|
|
1687
1685
|
Se,
|
|
1688
1686
|
Rn,
|
|
1689
|
-
|
|
1690
|
-
|
|
1687
|
+
Fs,
|
|
1688
|
+
Os,
|
|
1691
1689
|
gt,
|
|
1692
|
-
|
|
1690
|
+
Rr
|
|
1693
1691
|
].forEach((e) => this.disposeWithMe(this._commandService.registerCommand(e)));
|
|
1694
1692
|
}
|
|
1695
1693
|
_registerShortcuts() {
|
|
1696
1694
|
[
|
|
1695
|
+
...ki(),
|
|
1697
1696
|
...Ai(),
|
|
1698
1697
|
...Fi(),
|
|
1699
1698
|
...Di(),
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
$i
|
|
1699
|
+
...$i(),
|
|
1700
|
+
Pi,
|
|
1701
|
+
Li
|
|
1704
1702
|
].forEach((e) => {
|
|
1705
1703
|
this.disposeWithMe(this._shortcutService.registerShortcut(e));
|
|
1706
1704
|
});
|
|
1707
1705
|
}
|
|
1708
1706
|
_registerComponents() {
|
|
1709
|
-
this.disposeWithMe(this._uiPartsService.registerComponent(
|
|
1707
|
+
this.disposeWithMe(this._uiPartsService.registerComponent(Ro.FORMULA_AUX, () => pr(si, this._injector))), this._componentManager.register(_r, Ci);
|
|
1710
1708
|
}
|
|
1711
1709
|
_registerRenderModules() {
|
|
1712
1710
|
this.disposeWithMe(this._renderManagerService.registerRenderModule(H.UNIVER_SHEET, [Vt]));
|
|
1713
1711
|
}
|
|
1714
1712
|
};
|
|
1715
|
-
Ht =
|
|
1713
|
+
Ht = Vi([
|
|
1716
1714
|
Be(0, j(Rt)),
|
|
1717
|
-
Be(1,
|
|
1715
|
+
Be(1, ds),
|
|
1718
1716
|
Be(2, ve),
|
|
1719
1717
|
Be(3, Gt),
|
|
1720
|
-
Be(4,
|
|
1721
|
-
Be(5,
|
|
1722
|
-
Be(6, j(
|
|
1718
|
+
Be(4, gr),
|
|
1719
|
+
Be(5, we),
|
|
1720
|
+
Be(6, j(mr))
|
|
1723
1721
|
], Ht);
|
|
1724
|
-
class
|
|
1722
|
+
class kr {
|
|
1725
1723
|
constructor() {
|
|
1726
|
-
q(this, "_currentSelector$", new
|
|
1724
|
+
q(this, "_currentSelector$", new ur(null));
|
|
1727
1725
|
q(this, "currentSelector$", this._currentSelector$.asObservable());
|
|
1728
1726
|
}
|
|
1729
1727
|
showRangeSelectorDialog(t) {
|
|
@@ -1735,12 +1733,12 @@ class wr {
|
|
|
1735
1733
|
return this._currentSelector$.next(t), o;
|
|
1736
1734
|
}
|
|
1737
1735
|
}
|
|
1738
|
-
var
|
|
1739
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
1736
|
+
var Wi = Object.getOwnPropertyDescriptor, Hi = (e, t, n, o) => {
|
|
1737
|
+
for (var r = o > 1 ? void 0 : o ? Wi(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
1740
1738
|
(c = e[s]) && (r = c(r) || r);
|
|
1741
1739
|
return r;
|
|
1742
|
-
},
|
|
1743
|
-
let Pe = class extends
|
|
1740
|
+
}, st = (e, t) => (n, o) => t(n, o, e);
|
|
1741
|
+
let Pe = class extends Eo {
|
|
1744
1742
|
constructor(t, n, o, r, s, c, i) {
|
|
1745
1743
|
super(
|
|
1746
1744
|
n,
|
|
@@ -1751,7 +1749,7 @@ let Pe = class extends Ro {
|
|
|
1751
1749
|
);
|
|
1752
1750
|
q(this, "_workbookSelections");
|
|
1753
1751
|
q(this, "_eventDisposables");
|
|
1754
|
-
this._context = t, this._contextService = c, this._refSelectionsService = i, this._workbookSelections = this._refSelectionsService.getWorkbookSelections(this._context.unitId), this._initSelectionChangeListener(), this._initSkeletonChangeListener(), this._initUserActionSyncListener(), this._setSelectionStyle(
|
|
1752
|
+
this._context = t, this._contextService = c, this._refSelectionsService = i, this._workbookSelections = this._refSelectionsService.getWorkbookSelections(this._context.unitId), this._initSelectionChangeListener(), this._initSkeletonChangeListener(), this._initUserActionSyncListener(), this._setSelectionStyle(Bi(this._themeService)), this._remainLastEnabled = !0, this._highlightHeader = !1;
|
|
1755
1753
|
}
|
|
1756
1754
|
getLocation() {
|
|
1757
1755
|
return this._skeleton.getLocation();
|
|
@@ -1785,27 +1783,27 @@ let Pe = class extends Ro {
|
|
|
1785
1783
|
this._disableSelectionChanging();
|
|
1786
1784
|
}
|
|
1787
1785
|
_initCanvasEventListeners() {
|
|
1788
|
-
const t = this._getSheetObject(), { spreadsheetRowHeader: n, spreadsheetColumnHeader: o, spreadsheet: r, spreadsheetLeftTopPlaceholder: s } = t, { scene: c } = this._context, i = new
|
|
1789
|
-
return i.add(r == null ? void 0 : r.onPointerDown$.subscribeEvent((l,
|
|
1790
|
-
this.inRefSelectionMode() && (this._onPointerDown(l, r.zIndex + 1, Re.NORMAL, this._getActiveViewport(l)), l.button !== 2 &&
|
|
1786
|
+
const t = this._getSheetObject(), { spreadsheetRowHeader: n, spreadsheetColumnHeader: o, spreadsheet: r, spreadsheetLeftTopPlaceholder: s } = t, { scene: c } = this._context, i = new je();
|
|
1787
|
+
return i.add(r == null ? void 0 : r.onPointerDown$.subscribeEvent((l, g) => {
|
|
1788
|
+
this.inRefSelectionMode() && (this._onPointerDown(l, r.zIndex + 1, Re.NORMAL, this._getActiveViewport(l)), l.button !== 2 && g.stopPropagation());
|
|
1791
1789
|
})), i.add(
|
|
1792
|
-
n == null ? void 0 : n.onPointerDown$.subscribeEvent((l,
|
|
1790
|
+
n == null ? void 0 : n.onPointerDown$.subscribeEvent((l, g) => {
|
|
1793
1791
|
if (!this.inRefSelectionMode()) return;
|
|
1794
|
-
const
|
|
1795
|
-
kn(this._workbookSelections.getCurrentSelections(),
|
|
1792
|
+
const m = this._sheetSkeletonManagerService.getCurrent().skeleton, { row: h } = wn(l.offsetX, l.offsetY, c, m);
|
|
1793
|
+
kn(this._workbookSelections.getCurrentSelections(), h, Re.ROW) || (this._onPointerDown(l, (r.zIndex || 1) + 1, Re.ROW, this._getActiveViewport(l), Jt.Y), l.button !== 2 && g.stopPropagation());
|
|
1796
1794
|
})
|
|
1797
|
-
), i.add(o == null ? void 0 : o.onPointerDown$.subscribeEvent((l,
|
|
1795
|
+
), i.add(o == null ? void 0 : o.onPointerDown$.subscribeEvent((l, g) => {
|
|
1798
1796
|
if (!this.inRefSelectionMode()) return;
|
|
1799
|
-
const
|
|
1800
|
-
kn(this._workbookSelections.getCurrentSelections(),
|
|
1801
|
-
})), i.add(s == null ? void 0 : s.onPointerDown$.subscribeEvent((l,
|
|
1797
|
+
const m = this._sheetSkeletonManagerService.getCurrent().skeleton, { column: h } = wn(l.offsetX, l.offsetY, c, m);
|
|
1798
|
+
kn(this._workbookSelections.getCurrentSelections(), h, Re.COLUMN) || (this._onPointerDown(l, (r.zIndex || 1) + 1, Re.COLUMN, this._getActiveViewport(l), Jt.X), l.button !== 2 && g.stopPropagation());
|
|
1799
|
+
})), i.add(s == null ? void 0 : s.onPointerDown$.subscribeEvent((l, g) => {
|
|
1802
1800
|
if (this._reset(), !this.inRefSelectionMode()) return;
|
|
1803
|
-
const
|
|
1804
|
-
this._addSelectionControlByModelData(
|
|
1805
|
-
const
|
|
1806
|
-
|
|
1801
|
+
const m = this._sheetSkeletonManagerService.getCurrent().skeleton, h = Io(m);
|
|
1802
|
+
this._addSelectionControlByModelData(h), this._selectionMoveStart$.next(this.getSelectionDataWithStyle());
|
|
1803
|
+
const d = c.onPointerUp$.subscribeEvent(() => {
|
|
1804
|
+
d.unsubscribe(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle());
|
|
1807
1805
|
});
|
|
1808
|
-
l.button !== 2 &&
|
|
1806
|
+
l.button !== 2 && g.stopPropagation();
|
|
1809
1807
|
})), i;
|
|
1810
1808
|
}
|
|
1811
1809
|
/**
|
|
@@ -1839,7 +1837,7 @@ let Pe = class extends Ro {
|
|
|
1839
1837
|
const r = this._context.unit.getActiveSheet().getSheetId();
|
|
1840
1838
|
t.length !== 0 && this._workbookSelections.setSelections(
|
|
1841
1839
|
r,
|
|
1842
|
-
t.map((s) =>
|
|
1840
|
+
t.map((s) => rs(s)),
|
|
1843
1841
|
n
|
|
1844
1842
|
);
|
|
1845
1843
|
}
|
|
@@ -1858,7 +1856,7 @@ let Pe = class extends Ro {
|
|
|
1858
1856
|
return n == null ? void 0 : n.scene.getActiveViewportByCoord(Un.FromArray([t.offsetX, t.offsetY]));
|
|
1859
1857
|
}
|
|
1860
1858
|
_getSheetObject() {
|
|
1861
|
-
return
|
|
1859
|
+
return bo(this._context.unit, this._context);
|
|
1862
1860
|
}
|
|
1863
1861
|
/**
|
|
1864
1862
|
* Handle pointer down event, bind pointermove & pointerup handler.
|
|
@@ -1872,17 +1870,17 @@ let Pe = class extends Ro {
|
|
|
1872
1870
|
*/
|
|
1873
1871
|
// eslint-disable-next-line complexity, max-lines-per-function
|
|
1874
1872
|
_onPointerDown(t, n = 0, o = Re.NORMAL, r, s = Jt.ALL) {
|
|
1875
|
-
var
|
|
1873
|
+
var O;
|
|
1876
1874
|
this._rangeType = o;
|
|
1877
1875
|
const c = this._skeleton, i = this._scene;
|
|
1878
1876
|
if (!i || !c)
|
|
1879
1877
|
return;
|
|
1880
1878
|
r && (this._activeViewport = r);
|
|
1881
|
-
const { offsetX: l, offsetY:
|
|
1882
|
-
if (!
|
|
1883
|
-
const
|
|
1884
|
-
this._startViewportPosX =
|
|
1885
|
-
const a = i.getScrollXYInfoByViewport(
|
|
1879
|
+
const { offsetX: l, offsetY: g } = t, m = i.getViewport(Pn.VIEW_MAIN);
|
|
1880
|
+
if (!m) return;
|
|
1881
|
+
const h = i.getCoordRelativeToViewport(Un.FromArray([l, g])), { x: d, y: u } = h;
|
|
1882
|
+
this._startViewportPosX = d, this._startViewportPosY = u;
|
|
1883
|
+
const a = i.getScrollXYInfoByViewport(h), { scaleX: S, scaleY: p } = i.getAncestorScale(), v = this._skeleton.getCellByOffset(d, u, S, p, a);
|
|
1886
1884
|
if (!v) return;
|
|
1887
1885
|
switch (o) {
|
|
1888
1886
|
case Re.NORMAL:
|
|
@@ -1900,34 +1898,34 @@ let Pe = class extends Ro {
|
|
|
1900
1898
|
C.range.rangeType = o;
|
|
1901
1899
|
const _ = rn(C, this._skeleton);
|
|
1902
1900
|
this._startRangeWhenPointerDown = { ..._.rangeWithCoord };
|
|
1903
|
-
const
|
|
1904
|
-
let
|
|
1905
|
-
const
|
|
1906
|
-
for (const
|
|
1907
|
-
if (t.button === 2 && Qn.contains(
|
|
1908
|
-
|
|
1901
|
+
const I = { ..._.rangeWithCoord, rangeType: o };
|
|
1902
|
+
let f = this.getActiveSelectionControl();
|
|
1903
|
+
const b = this.getSelectionControls();
|
|
1904
|
+
for (const N of b) {
|
|
1905
|
+
if (t.button === 2 && Qn.contains(N.model, I)) {
|
|
1906
|
+
f = N;
|
|
1909
1907
|
return;
|
|
1910
1908
|
}
|
|
1911
|
-
if (
|
|
1912
|
-
|
|
1909
|
+
if (N.model.isEqual(I)) {
|
|
1910
|
+
f = N;
|
|
1913
1911
|
break;
|
|
1914
1912
|
}
|
|
1915
1913
|
}
|
|
1916
1914
|
this._checkClearPreviousControls(t);
|
|
1917
|
-
const
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1915
|
+
const y = f == null ? void 0 : f.model.currentCell, A = t.shiftKey && y, F = this._remainLastEnabled && !t.ctrlKey && !t.shiftKey && !this._skipLastEnabled && !this._singleSelectionEnabled;
|
|
1916
|
+
A && y ? this._makeSelectionByTwoCells(
|
|
1917
|
+
y,
|
|
1918
|
+
I,
|
|
1921
1919
|
c,
|
|
1922
1920
|
o,
|
|
1923
|
-
|
|
1921
|
+
f
|
|
1924
1922
|
// Get updated in this method
|
|
1925
|
-
) : F &&
|
|
1926
|
-
for (let
|
|
1927
|
-
this.getSelectionControls()[
|
|
1928
|
-
this._selectionMoveStart$.next(this.getSelectionDataWithStyle()), i.disableObjectsEvent(), this._clearUpdatingListeners(), this._addEndingListeners(), (
|
|
1929
|
-
var
|
|
1930
|
-
this._clearUpdatingListeners(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle()), (
|
|
1923
|
+
) : F && f ? f.updateRangeBySelectionWithCoord(_) : f = this.newSelectionControl(i, c, C);
|
|
1924
|
+
for (let N = 0; N < this.getSelectionControls().length - 1; N++)
|
|
1925
|
+
this.getSelectionControls()[N].clearHighlight();
|
|
1926
|
+
this._selectionMoveStart$.next(this.getSelectionDataWithStyle()), i.disableObjectsEvent(), this._clearUpdatingListeners(), this._addEndingListeners(), (O = i.getTransformer()) == null || O.clearSelectedObjects(), this._setupPointerMoveListener(m, f, o, s, d, u), this._escapeShortcutDisposable = this._shortcutService.forceEscape(), this._scenePointerUpSub = i.onPointerUp$.subscribeEvent(() => {
|
|
1927
|
+
var N;
|
|
1928
|
+
this._clearUpdatingListeners(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle()), (N = this._escapeShortcutDisposable) == null || N.dispose(), this._escapeShortcutDisposable = null;
|
|
1931
1929
|
});
|
|
1932
1930
|
}
|
|
1933
1931
|
/**
|
|
@@ -1957,15 +1955,15 @@ let Pe = class extends Ro {
|
|
|
1957
1955
|
}), i;
|
|
1958
1956
|
}
|
|
1959
1957
|
};
|
|
1960
|
-
Pe =
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1958
|
+
Pe = Hi([
|
|
1959
|
+
st(1, j(Rt)),
|
|
1960
|
+
st(2, j(Et)),
|
|
1961
|
+
st(3, Gt),
|
|
1962
|
+
st(4, j(qt)),
|
|
1963
|
+
st(5, ln),
|
|
1964
|
+
st(6, Kt)
|
|
1967
1965
|
], Pe);
|
|
1968
|
-
function
|
|
1966
|
+
function Bi(e) {
|
|
1969
1967
|
const t = sr(e);
|
|
1970
1968
|
return t.widgets = { tl: !0, tc: !0, tr: !0, ml: !0, mr: !0, bl: !0, bc: !0, br: !0 }, t;
|
|
1971
1969
|
}
|
|
@@ -1983,7 +1981,7 @@ const En = (e, t, n = !0) => {
|
|
|
1983
1981
|
}
|
|
1984
1982
|
return (n ? r.currentIndex === t : t > i && t <= r.currentIndex) && (o = c, r.isFinish = !0), r;
|
|
1985
1983
|
}, { currentIndex: 0, isFinish: !1 }), o;
|
|
1986
|
-
},
|
|
1984
|
+
}, Ar = (e, t) => {
|
|
1987
1985
|
const n = e[t];
|
|
1988
1986
|
let o = -1;
|
|
1989
1987
|
if (!n || typeof n == "string" || n.nodeType !== Q.REFERENCE) return -1;
|
|
@@ -1992,7 +1990,7 @@ const En = (e, t, n = !0) => {
|
|
|
1992
1990
|
typeof s != "string" && s.nodeType === Q.REFERENCE && o++;
|
|
1993
1991
|
}
|
|
1994
1992
|
return o;
|
|
1995
|
-
},
|
|
1993
|
+
}, ji = (e, t = 100) => {
|
|
1996
1994
|
$(() => {
|
|
1997
1995
|
let n = null;
|
|
1998
1996
|
const o = () => {
|
|
@@ -2005,38 +2003,38 @@ const En = (e, t, n = !0) => {
|
|
|
2005
2003
|
};
|
|
2006
2004
|
}, [e, t]);
|
|
2007
2005
|
};
|
|
2008
|
-
function
|
|
2009
|
-
const o = T(
|
|
2006
|
+
function Fr(e, t, n) {
|
|
2007
|
+
const o = T(Ye), r = se(() => new ur({ left: -999, top: -999, right: -999, bottom: -999 }), []), s = T(Sn), c = T(ne), i = te(() => {
|
|
2010
2008
|
var _;
|
|
2011
2009
|
const l = o.getEditor(e);
|
|
2012
2010
|
if (!l)
|
|
2013
2011
|
return;
|
|
2014
|
-
const
|
|
2015
|
-
if (!
|
|
2016
|
-
const
|
|
2017
|
-
let { left: a, top: S, right: p, bottom: v } =
|
|
2018
|
-
S = S +
|
|
2012
|
+
const g = l.getBoundingClientRect(), { marginTop: m = 0, marginBottom: h = 0 } = l.getDocumentData().documentStyle, d = l.getSkeleton();
|
|
2013
|
+
if (!d) return;
|
|
2014
|
+
const u = (_ = d.getSkeletonData()) == null ? void 0 : _.pages[0].height;
|
|
2015
|
+
let { left: a, top: S, right: p, bottom: v } = g;
|
|
2016
|
+
S = S + m, v = u ? S + u : v - h;
|
|
2019
2017
|
const C = r.getValue();
|
|
2020
2018
|
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 }),
|
|
2019
|
+
return r.next({ left: a - 1, right: p + 1, top: S - 1, bottom: v + 1 }), g;
|
|
2022
2020
|
});
|
|
2023
2021
|
return $(() => {
|
|
2024
2022
|
t && i();
|
|
2025
|
-
}, [e, o, c.unitAdded$, i, t, ...n != null ? n : []]),
|
|
2026
|
-
const l = s.scrollEvent$.pipe(
|
|
2023
|
+
}, [e, o, c.unitAdded$, i, t, ...n != null ? n : []]), ji(i), $(() => {
|
|
2024
|
+
const l = s.scrollEvent$.pipe(Ho(100)).subscribe(i);
|
|
2027
2025
|
return () => {
|
|
2028
2026
|
l.unsubscribe();
|
|
2029
2027
|
};
|
|
2030
2028
|
}, []), [r, i];
|
|
2031
2029
|
}
|
|
2032
|
-
const
|
|
2030
|
+
const tt = (e) => {
|
|
2033
2031
|
const t = z(e);
|
|
2034
2032
|
return t.current = e, t;
|
|
2035
|
-
},
|
|
2036
|
-
const o = T(Zt), r = T(Yt), s = T(Ie), [c, i] = V(), [l,
|
|
2037
|
-
|
|
2033
|
+
}, qi = (e, t, n) => {
|
|
2034
|
+
const o = T(Zt), r = T(Yt), s = T(Ie), [c, i] = V(), [l, g] = V(-1), [m, h] = V(!0), d = tt(m), u = z(t);
|
|
2035
|
+
u.current = t;
|
|
2038
2036
|
const a = () => {
|
|
2039
|
-
i(void 0),
|
|
2037
|
+
i(void 0), g(-1), h(!1);
|
|
2040
2038
|
};
|
|
2041
2039
|
return $(() => {
|
|
2042
2040
|
const S = s.sequenceNodesBuilder(t.slice(1));
|
|
@@ -2046,30 +2044,30 @@ const nt = (e) => {
|
|
|
2046
2044
|
const S = n.selectionChange$.pipe(gn(50)).subscribe((v) => {
|
|
2047
2045
|
if (v.textRanges.length === 1) {
|
|
2048
2046
|
const [C] = v.textRanges;
|
|
2049
|
-
if (C.collapsed &&
|
|
2050
|
-
const { startOffset: _ } = C,
|
|
2051
|
-
if (
|
|
2052
|
-
if (typeof
|
|
2053
|
-
const
|
|
2054
|
-
i(
|
|
2047
|
+
if (C.collapsed && d.current) {
|
|
2048
|
+
const { startOffset: _ } = C, I = o.getCurrentSequenceNodeIndex(_ - 2), f = o.getCurrentSequenceNodeByIndex(I), b = o.getCurrentSequenceNodeByIndex(I + 1);
|
|
2049
|
+
if (f)
|
|
2050
|
+
if (typeof f != "string" && f.nodeType === 3 && !r.hasDefinedNameDescription(f.token.trim()) && b === qe.OPEN_BRACKET) {
|
|
2051
|
+
const y = r.getFunctionInfo(f.token);
|
|
2052
|
+
i(y), g(-1);
|
|
2055
2053
|
return;
|
|
2056
2054
|
} else {
|
|
2057
|
-
const
|
|
2058
|
-
if (
|
|
2059
|
-
const { functionName:
|
|
2060
|
-
i(
|
|
2055
|
+
const y = s.getFunctionAndParameter(`${u.current}A`, _ - 1);
|
|
2056
|
+
if (y) {
|
|
2057
|
+
const { functionName: A, paramIndex: F } = y, O = r.getFunctionInfo(A);
|
|
2058
|
+
i(O), g(F);
|
|
2061
2059
|
return;
|
|
2062
2060
|
}
|
|
2063
2061
|
}
|
|
2064
2062
|
}
|
|
2065
2063
|
}
|
|
2066
|
-
i(void 0),
|
|
2064
|
+
i(void 0), g(-1);
|
|
2067
2065
|
}), p = n.selectionChange$.pipe(
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2066
|
+
dr((v) => v.textRanges.length === 1),
|
|
2067
|
+
lr((v) => v.textRanges[0].startOffset),
|
|
2068
|
+
Bo()
|
|
2071
2069
|
).subscribe(() => {
|
|
2072
|
-
|
|
2070
|
+
h(!0);
|
|
2073
2071
|
});
|
|
2074
2072
|
return () => {
|
|
2075
2073
|
S.unsubscribe(), p.unsubscribe();
|
|
@@ -2082,7 +2080,7 @@ const nt = (e) => {
|
|
|
2082
2080
|
paramIndex: l,
|
|
2083
2081
|
reset: a
|
|
2084
2082
|
};
|
|
2085
|
-
},
|
|
2083
|
+
}, Ki = ({ onClick: e }) => /* @__PURE__ */ M(
|
|
2086
2084
|
"div",
|
|
2087
2085
|
{
|
|
2088
2086
|
className: "univer-z-[15] univer-box-border univer-h-[18px] univer-cursor-pointer univer-overflow-visible univer-whitespace-nowrap univer-rounded-l univer-border univer-border-r-0 univer-border-gray-600 univer-bg-primary-600 univer-p-0.5 univer-text-xs univer-font-bold univer-leading-[13px] univer-text-white",
|
|
@@ -2090,21 +2088,21 @@ const nt = (e) => {
|
|
|
2090
2088
|
children: "?"
|
|
2091
2089
|
}
|
|
2092
2090
|
), nn = ({ className: e, title: t, value: n }) => /* @__PURE__ */ W("div", { className: "univer-my-2", children: [
|
|
2093
|
-
/* @__PURE__ */
|
|
2091
|
+
/* @__PURE__ */ M(
|
|
2094
2092
|
"div",
|
|
2095
2093
|
{
|
|
2096
2094
|
className: re("univer-mb-2 univer-text-sm univer-font-medium univer-text-gray-900 dark:!univer-text-white", e),
|
|
2097
2095
|
children: t
|
|
2098
2096
|
}
|
|
2099
2097
|
),
|
|
2100
|
-
/* @__PURE__ */
|
|
2098
|
+
/* @__PURE__ */ M(
|
|
2101
2099
|
"div",
|
|
2102
2100
|
{
|
|
2103
2101
|
className: "univer-whitespace-pre-wrap univer-break-words univer-text-xs univer-text-gray-500",
|
|
2104
2102
|
children: n
|
|
2105
2103
|
}
|
|
2106
2104
|
)
|
|
2107
|
-
] }),
|
|
2105
|
+
] }), Yi = (e) => {
|
|
2108
2106
|
const { prefix: t, value: n, active: o, onClick: r } = e;
|
|
2109
2107
|
return /* @__PURE__ */ W("div", { children: [
|
|
2110
2108
|
/* @__PURE__ */ W("span", { children: [
|
|
@@ -2112,12 +2110,12 @@ const nt = (e) => {
|
|
|
2112
2110
|
"("
|
|
2113
2111
|
] }),
|
|
2114
2112
|
n && n.map((s, c) => /* @__PURE__ */ W("span", { children: [
|
|
2115
|
-
/* @__PURE__ */
|
|
2113
|
+
/* @__PURE__ */ M(
|
|
2116
2114
|
"span",
|
|
2117
2115
|
{
|
|
2118
2116
|
className: o === c ? "univer-text-primary-500" : "",
|
|
2119
2117
|
onClick: () => r(c),
|
|
2120
|
-
children:
|
|
2118
|
+
children: Ir(s)
|
|
2121
2119
|
}
|
|
2122
2120
|
),
|
|
2123
2121
|
c === n.length - 1 ? "" : ","
|
|
@@ -2126,17 +2124,17 @@ const nt = (e) => {
|
|
|
2126
2124
|
] });
|
|
2127
2125
|
}, Zn = () => {
|
|
2128
2126
|
};
|
|
2129
|
-
function
|
|
2130
|
-
const { onParamsSwitch: t = Zn, onClose: n = Zn, isFocus: o, editor: r, formulaText: s } = e, { functionInfo: c, paramIndex: i, reset: l } =
|
|
2131
|
-
function C(
|
|
2132
|
-
t && t(
|
|
2133
|
-
}
|
|
2134
|
-
const _ = te((
|
|
2135
|
-
|
|
2136
|
-
}),
|
|
2127
|
+
function Gi(e) {
|
|
2128
|
+
const { onParamsSwitch: t = Zn, onClose: n = Zn, isFocus: o, editor: r, formulaText: s } = e, { functionInfo: c, paramIndex: i, reset: l } = qi(o, s, r), g = T(fn), m = !Ce(g.helpFunctionVisible$), [h, d] = V(!0), u = T(dt), a = u.t("formula.prompt.required"), S = u.t("formula.prompt.optional"), p = r.getEditorId(), [v] = Fr(p, !!c, [c, i]);
|
|
2129
|
+
function C(f) {
|
|
2130
|
+
t && t(f);
|
|
2131
|
+
}
|
|
2132
|
+
const _ = te((f) => {
|
|
2133
|
+
g.helpFunctionVisible$.next(!f);
|
|
2134
|
+
}), I = () => {
|
|
2137
2135
|
_(!0), n();
|
|
2138
2136
|
};
|
|
2139
|
-
return c ?
|
|
2137
|
+
return c ? m ? /* @__PURE__ */ M(on, { portal: !0, anchorRect$: v, direction: "left-center", children: /* @__PURE__ */ M(Ki, { onClick: () => _(!1) }) }, "hidden") : /* @__PURE__ */ M(on, { portal: !0, onClickOutside: () => l(), anchorRect$: v, direction: "vertical", children: /* @__PURE__ */ W(
|
|
2140
2138
|
"div",
|
|
2141
2139
|
{
|
|
2142
2140
|
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),
|
|
@@ -2144,10 +2142,10 @@ function Zi(e) {
|
|
|
2144
2142
|
/* @__PURE__ */ W(
|
|
2145
2143
|
"div",
|
|
2146
2144
|
{
|
|
2147
|
-
className: re("univer-wrap-anywhere univer-box-border univer-flex univer-items-center univer-justify-between univer-px-4 univer-py-3 univer-text-xs univer-font-medium univer-text-gray-900 dark:!univer-text-white",
|
|
2145
|
+
className: re("univer-wrap-anywhere univer-box-border univer-flex univer-items-center univer-justify-between univer-px-4 univer-py-3 univer-text-xs univer-font-medium univer-text-gray-900 dark:!univer-text-white", Cs),
|
|
2148
2146
|
children: [
|
|
2149
|
-
/* @__PURE__ */
|
|
2150
|
-
|
|
2147
|
+
/* @__PURE__ */ M(
|
|
2148
|
+
Yi,
|
|
2151
2149
|
{
|
|
2152
2150
|
prefix: c.functionName,
|
|
2153
2151
|
value: c.functionParameter,
|
|
@@ -2156,58 +2154,58 @@ function Zi(e) {
|
|
|
2156
2154
|
}
|
|
2157
2155
|
),
|
|
2158
2156
|
/* @__PURE__ */ W("div", { className: "univer-flex", children: [
|
|
2159
|
-
/* @__PURE__ */
|
|
2157
|
+
/* @__PURE__ */ M(
|
|
2160
2158
|
"div",
|
|
2161
2159
|
{
|
|
2162
2160
|
className: "univer-ml-2 univer-flex univer-h-6 univer-w-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-bg-transparent univer-p-0 univer-text-xs univer-text-gray-500 univer-outline-none univer-transition-colors hover:univer-bg-gray-200 dark:hover:!univer-bg-gray-600",
|
|
2163
|
-
style: { transform:
|
|
2164
|
-
onClick: () =>
|
|
2165
|
-
children: /* @__PURE__ */
|
|
2161
|
+
style: { transform: h ? "rotateZ(-90deg)" : "rotateZ(90deg)" },
|
|
2162
|
+
onClick: () => d(!h),
|
|
2163
|
+
children: /* @__PURE__ */ M(Mr, {})
|
|
2166
2164
|
}
|
|
2167
2165
|
),
|
|
2168
|
-
/* @__PURE__ */
|
|
2166
|
+
/* @__PURE__ */ M(
|
|
2169
2167
|
"div",
|
|
2170
2168
|
{
|
|
2171
2169
|
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:
|
|
2173
|
-
children: /* @__PURE__ */
|
|
2170
|
+
onClick: I,
|
|
2171
|
+
children: /* @__PURE__ */ M(Or, {})
|
|
2174
2172
|
}
|
|
2175
2173
|
)
|
|
2176
2174
|
] })
|
|
2177
2175
|
]
|
|
2178
2176
|
}
|
|
2179
2177
|
),
|
|
2180
|
-
/* @__PURE__ */
|
|
2178
|
+
/* @__PURE__ */ M(
|
|
2181
2179
|
"div",
|
|
2182
2180
|
{
|
|
2183
2181
|
className: re("univer-box-border univer-max-h-[350px] univer-overflow-y-auto univer-px-4 univer-pb-3 univer-pt-0", lt),
|
|
2184
2182
|
style: {
|
|
2185
|
-
height:
|
|
2186
|
-
padding:
|
|
2183
|
+
height: h ? "unset" : 0,
|
|
2184
|
+
padding: h ? "revert-layer" : 0
|
|
2187
2185
|
},
|
|
2188
2186
|
children: /* @__PURE__ */ W("div", { className: "univer-mt-3", children: [
|
|
2189
|
-
/* @__PURE__ */
|
|
2187
|
+
/* @__PURE__ */ M(
|
|
2190
2188
|
nn,
|
|
2191
2189
|
{
|
|
2192
|
-
title:
|
|
2193
|
-
value: `${c.functionName}(${c.functionParameter.map((
|
|
2190
|
+
title: u.t("formula.prompt.helpExample"),
|
|
2191
|
+
value: `${c.functionName}(${c.functionParameter.map((f) => f.example).join(",")})`
|
|
2194
2192
|
}
|
|
2195
2193
|
),
|
|
2196
|
-
/* @__PURE__ */
|
|
2194
|
+
/* @__PURE__ */ M(
|
|
2197
2195
|
nn,
|
|
2198
2196
|
{
|
|
2199
|
-
title:
|
|
2197
|
+
title: u.t("formula.prompt.helpAbstract"),
|
|
2200
2198
|
value: c.description
|
|
2201
2199
|
}
|
|
2202
2200
|
),
|
|
2203
|
-
c && c.functionParameter && c.functionParameter.map((
|
|
2201
|
+
c && c.functionParameter && c.functionParameter.map((f, b) => /* @__PURE__ */ M(
|
|
2204
2202
|
nn,
|
|
2205
2203
|
{
|
|
2206
|
-
className: i ===
|
|
2207
|
-
title:
|
|
2208
|
-
value: `${
|
|
2204
|
+
className: i === b ? "univer-text-primary-500" : "",
|
|
2205
|
+
title: f.name,
|
|
2206
|
+
value: `${f.require ? a : S} ${f.detail}`
|
|
2209
2207
|
},
|
|
2210
|
-
|
|
2208
|
+
b
|
|
2211
2209
|
))
|
|
2212
2210
|
] })
|
|
2213
2211
|
}
|
|
@@ -2216,8 +2214,8 @@ function Zi(e) {
|
|
|
2216
2214
|
}
|
|
2217
2215
|
) }, "show") : null;
|
|
2218
2216
|
}
|
|
2219
|
-
const
|
|
2220
|
-
const t = T(
|
|
2217
|
+
const Zi = (e) => {
|
|
2218
|
+
const t = T(Ye);
|
|
2221
2219
|
return te((o) => {
|
|
2222
2220
|
var r, s;
|
|
2223
2221
|
if (e) {
|
|
@@ -2234,98 +2232,98 @@ const zi = (e) => {
|
|
|
2234
2232
|
}
|
|
2235
2233
|
});
|
|
2236
2234
|
};
|
|
2237
|
-
function
|
|
2235
|
+
function zi(e) {
|
|
2238
2236
|
var r, s;
|
|
2239
2237
|
const n = e.get(ne).getCurrentUniverDocInstance();
|
|
2240
2238
|
return n != null && n.getBody() ? { dataStream: (s = (r = n.getBody()) == null ? void 0 : r.dataStream) != null ? s : "", offset: 0 } : void 0;
|
|
2241
2239
|
}
|
|
2242
2240
|
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
|
-
function
|
|
2244
|
-
var
|
|
2245
|
-
const { editorId: t, isFocus: n, disableOnClick: o, unitId: r, subUnitId: s } = e, c = T(
|
|
2241
|
+
function Xi(e) {
|
|
2242
|
+
var y;
|
|
2243
|
+
const { editorId: t, isFocus: n, disableOnClick: o, unitId: r, subUnitId: s } = e, c = T(we), i = T(ne), l = c.getRenderById(r), g = c.getRenderById(t), m = g == null ? void 0 : g.with(hr), h = T(Sr), d = T(Rt), [u, a] = V(
|
|
2246
2244
|
0
|
|
2247
2245
|
/* NOT_SELECT */
|
|
2248
|
-
), S = T(Ie), p = z(!0), v = l == null ? void 0 : l.with(Pe), C =
|
|
2246
|
+
), S = T(Ie), p = z(!0), v = l == null ? void 0 : l.with(Pe), C = tt(u), _ = i.getUnit(r, H.UNIVER_SHEET), I = _ == null ? void 0 : _.getSheetBySheetId(s), f = te((A) => {
|
|
2249
2247
|
v && v.setSkipLastEnabled(
|
|
2250
|
-
|
|
2248
|
+
A === 1 || A === 3 || A === 4
|
|
2251
2249
|
/* EDIT_OTHER_WORKBOOK_REFERENCE */
|
|
2252
|
-
), C.current =
|
|
2253
|
-
}),
|
|
2250
|
+
), C.current = A, a(A);
|
|
2251
|
+
}), b = te(() => {
|
|
2254
2252
|
var ie, ce, de;
|
|
2255
|
-
const
|
|
2256
|
-
if (!w) return;
|
|
2257
|
-
const F = w.getActiveSheet(), y = h == null ? void 0 : h.getActiveTextRange(), k = y != null && y.collapsed ? y.startOffset : -1, A = Xi(u);
|
|
2253
|
+
const A = i.getCurrentUnitOfType(H.UNIVER_SHEET);
|
|
2258
2254
|
if (!A) return;
|
|
2259
|
-
const
|
|
2255
|
+
const F = A.getActiveSheet(), O = m == null ? void 0 : m.getActiveTextRange(), N = O != null && O.collapsed ? O.startOffset : -1, k = zi(d);
|
|
2256
|
+
if (!k) return;
|
|
2257
|
+
const E = (ie = k == null ? void 0 : k.dataStream) == null ? void 0 : ie.slice(0, -2), x = ((ce = S.sequenceNodesBuilder(E)) != null ? ce : []).map((K) => typeof K == "object" ? K.nodeType === Q.REFERENCE ? {
|
|
2260
2258
|
...K,
|
|
2261
|
-
range:
|
|
2259
|
+
range: ko(K.token)
|
|
2262
2260
|
} : {
|
|
2263
2261
|
...K,
|
|
2264
2262
|
range: void 0
|
|
2265
|
-
} : K),
|
|
2266
|
-
if ((
|
|
2263
|
+
} : K), R = E[N - 1], w = E[N], D = x.find((K) => typeof K == "object" && K.nodeType === Q.REFERENCE && N === K.endIndex + 2), U = R && Ao(R) && (!w || Fo(w) && w !== qe.OPEN_BRACKET), B = !!D;
|
|
2264
|
+
if ((E == null ? void 0 : E.substring(0, 1)) === "=" && (U || B))
|
|
2267
2265
|
if (B) {
|
|
2268
2266
|
if (p.current)
|
|
2269
2267
|
return;
|
|
2270
|
-
const { sheetName: K, unitId: J } = D.range,
|
|
2271
|
-
J && J !==
|
|
2268
|
+
const { sheetName: K, unitId: J } = D.range, nt = (de = i.getCurrentUnitOfType(H.UNIVER_SHEET)) == null ? void 0 : de.getUnitId();
|
|
2269
|
+
J && J !== nt ? f(
|
|
2272
2270
|
4
|
|
2273
2271
|
/* EDIT_OTHER_WORKBOOK_REFERENCE */
|
|
2274
|
-
) : !K && F.getSheetId() === (
|
|
2272
|
+
) : !K && F.getSheetId() === (I == null ? void 0 : I.getSheetId()) || K === F.getName() ? f(
|
|
2275
2273
|
2
|
|
2276
2274
|
/* CAN_EDIT */
|
|
2277
|
-
) :
|
|
2275
|
+
) : f(
|
|
2278
2276
|
3
|
|
2279
2277
|
/* EDIT_OTHER_SHEET_REFERENCE */
|
|
2280
2278
|
);
|
|
2281
2279
|
} else
|
|
2282
|
-
p.current = !1,
|
|
2280
|
+
p.current = !1, f(
|
|
2283
2281
|
1
|
|
2284
2282
|
/* NEED_ADD */
|
|
2285
2283
|
);
|
|
2286
2284
|
else
|
|
2287
|
-
|
|
2285
|
+
f(
|
|
2288
2286
|
0
|
|
2289
2287
|
/* NOT_SELECT */
|
|
2290
2288
|
);
|
|
2291
2289
|
});
|
|
2292
2290
|
return $(() => {
|
|
2293
|
-
const
|
|
2294
|
-
|
|
2291
|
+
const A = h.textSelection$.pipe(dr((F) => F.unitId === t)).subscribe(() => {
|
|
2292
|
+
b();
|
|
2295
2293
|
});
|
|
2296
|
-
return () =>
|
|
2297
|
-
}, [
|
|
2298
|
-
n || (
|
|
2294
|
+
return () => A.unsubscribe();
|
|
2295
|
+
}, [b, h.textSelection$, t]), $(() => {
|
|
2296
|
+
n || (f(
|
|
2299
2297
|
0
|
|
2300
2298
|
/* NOT_SELECT */
|
|
2301
2299
|
), p.current = !0);
|
|
2302
|
-
}, [n,
|
|
2300
|
+
}, [n, f]), $(() => {
|
|
2303
2301
|
var F;
|
|
2304
2302
|
if (!o) return;
|
|
2305
|
-
const
|
|
2306
|
-
|
|
2303
|
+
const A = (F = g == null ? void 0 : g.mainComponent) == null ? void 0 : F.onPointerDown$.subscribeEvent(() => {
|
|
2304
|
+
f(
|
|
2307
2305
|
0
|
|
2308
2306
|
/* NOT_SELECT */
|
|
2309
2307
|
), p.current = !0;
|
|
2310
2308
|
});
|
|
2311
|
-
return () =>
|
|
2312
|
-
}, [o, (
|
|
2309
|
+
return () => A == null ? void 0 : A.unsubscribe();
|
|
2310
|
+
}, [o, (y = g == null ? void 0 : g.mainComponent) == null ? void 0 : y.onPointerDown$, f]), $(() => {
|
|
2313
2311
|
if (!n) return;
|
|
2314
|
-
const
|
|
2315
|
-
|
|
2312
|
+
const A = _ == null ? void 0 : _.activeSheet$.subscribe(() => {
|
|
2313
|
+
b();
|
|
2316
2314
|
}), F = i.getCurrentTypeOfUnit$(H.UNIVER_SHEET).subscribe(() => {
|
|
2317
|
-
|
|
2315
|
+
b();
|
|
2318
2316
|
});
|
|
2319
2317
|
return () => {
|
|
2320
|
-
|
|
2318
|
+
A == null || A.unsubscribe(), F == null || F.unsubscribe();
|
|
2321
2319
|
};
|
|
2322
|
-
}, [
|
|
2320
|
+
}, [b, n, _ == null ? void 0 : _.activeSheet$, i.getCurrentTypeOfUnit$]), { isSelecting: u, isSelectingRef: C };
|
|
2323
2321
|
}
|
|
2324
|
-
const
|
|
2322
|
+
const Qi = () => {
|
|
2325
2323
|
const e = T(Ie);
|
|
2326
2324
|
return Dt((n) => e.sequenceNodesBuilder(n) || [], [e]);
|
|
2327
2325
|
};
|
|
2328
|
-
function
|
|
2326
|
+
function Ji(e, t, n) {
|
|
2329
2327
|
const o = new hn(t).setAlpha(0.05).toRgbString();
|
|
2330
2328
|
return {
|
|
2331
2329
|
id: n,
|
|
@@ -2338,8 +2336,8 @@ function ec(e, t, n) {
|
|
|
2338
2336
|
widgetStroke: e.getColorFromTheme("white")
|
|
2339
2337
|
};
|
|
2340
2338
|
}
|
|
2341
|
-
function
|
|
2342
|
-
var _,
|
|
2339
|
+
function Dr(e) {
|
|
2340
|
+
var _, I, f;
|
|
2343
2341
|
const {
|
|
2344
2342
|
unitId: t,
|
|
2345
2343
|
subUnitId: n,
|
|
@@ -2349,49 +2347,49 @@ function Fr(e) {
|
|
|
2349
2347
|
refSelectionsService: c,
|
|
2350
2348
|
refSelectionsRenderService: i,
|
|
2351
2349
|
sheetSkeletonManagerService: l,
|
|
2352
|
-
themeService:
|
|
2353
|
-
univerInstanceService:
|
|
2354
|
-
} = e,
|
|
2355
|
-
if (!
|
|
2350
|
+
themeService: g,
|
|
2351
|
+
univerInstanceService: m
|
|
2352
|
+
} = e, h = o.getUnitId(), d = m.getUnit(t, H.UNIVER_SHEET), u = d == null ? void 0 : d.getActiveSheet(), a = [];
|
|
2353
|
+
if (!d || !u) {
|
|
2356
2354
|
c.setSelections(a);
|
|
2357
2355
|
return;
|
|
2358
2356
|
}
|
|
2359
|
-
const S =
|
|
2360
|
-
var
|
|
2361
|
-
return (
|
|
2357
|
+
const S = u.getSheetId(), p = (b) => {
|
|
2358
|
+
var y;
|
|
2359
|
+
return (y = d == null ? void 0 : d.getSheetBySheetName(b)) == null ? void 0 : y.getSheetId();
|
|
2362
2360
|
};
|
|
2363
2361
|
if (!((_ = l == null ? void 0 : l.getWorksheetSkeleton(S)) == null ? void 0 : _.skeleton)) return;
|
|
2364
2362
|
const C = [];
|
|
2365
|
-
for (let
|
|
2366
|
-
const
|
|
2367
|
-
if (!D &&
|
|
2363
|
+
for (let b = 0, y = r.length; b < y; b++) {
|
|
2364
|
+
const A = r[b], { themeColor: F, token: O, refIndex: N, endIndex: k } = A, E = ht(O), { unitId: x, sheetName: R, range: w } = E, D = p(R);
|
|
2365
|
+
if (!D && R || h !== t && x !== h || x && x !== h || D && D !== S || !D && S !== n)
|
|
2368
2366
|
continue;
|
|
2369
|
-
const U =
|
|
2367
|
+
const U = os(w, u.getRowCount(), u.getColumnCount());
|
|
2370
2368
|
U.unitId = t, U.sheetId = S, a.push({
|
|
2371
2369
|
range: U,
|
|
2372
2370
|
primary: null,
|
|
2373
|
-
style:
|
|
2374
|
-
}), C.push(
|
|
2371
|
+
style: Ji(g, F, N.toString())
|
|
2372
|
+
}), C.push(k);
|
|
2375
2373
|
}
|
|
2376
2374
|
if (s) {
|
|
2377
|
-
const
|
|
2378
|
-
|
|
2375
|
+
const b = (f = (I = s.getSelectionRanges()) == null ? void 0 : I[0]) == null ? void 0 : f.startOffset, y = C.findIndex((A) => A + 2 === b);
|
|
2376
|
+
y !== -1 ? i == null || i.setActiveSelectionIndex(y) : i == null || i.resetActiveSelectionIndex();
|
|
2379
2377
|
}
|
|
2380
2378
|
return a;
|
|
2381
2379
|
}
|
|
2382
|
-
function
|
|
2383
|
-
const n = T(ne), o = T(Et), r = T(Kt), s = T(
|
|
2384
|
-
const
|
|
2385
|
-
if (!
|
|
2386
|
-
const a =
|
|
2380
|
+
function ec(e, t) {
|
|
2381
|
+
const n = T(ne), o = T(Et), r = T(Kt), s = T(we), c = Ce(se(() => n.getCurrentTypeOfUnit$(H.UNIVER_SHEET), [n])), i = c ? s.getRenderById(c.getUnitId()) : null, l = i == null ? void 0 : i.with(Pe), g = i == null ? void 0 : i.with(qt), m = te((h, d) => {
|
|
2382
|
+
const u = n.getCurrentUnitOfType(H.UNIVER_SHEET);
|
|
2383
|
+
if (!u || l != null && l.selectionMoving) return;
|
|
2384
|
+
const a = Dr({
|
|
2387
2385
|
unitId: e,
|
|
2388
2386
|
subUnitId: t,
|
|
2389
|
-
currentWorkbook:
|
|
2390
|
-
refSelections:
|
|
2391
|
-
editor:
|
|
2387
|
+
currentWorkbook: u,
|
|
2388
|
+
refSelections: h,
|
|
2389
|
+
editor: d,
|
|
2392
2390
|
refSelectionsService: r,
|
|
2393
2391
|
refSelectionsRenderService: l,
|
|
2394
|
-
sheetSkeletonManagerService:
|
|
2392
|
+
sheetSkeletonManagerService: g,
|
|
2395
2393
|
themeService: o,
|
|
2396
2394
|
univerInstanceService: n
|
|
2397
2395
|
});
|
|
@@ -2400,49 +2398,49 @@ function tc(e, t) {
|
|
|
2400
2398
|
});
|
|
2401
2399
|
return $(() => () => {
|
|
2402
2400
|
l == null || l.resetActiveSelectionIndex();
|
|
2403
|
-
}, [l]),
|
|
2401
|
+
}, [l]), m;
|
|
2404
2402
|
}
|
|
2405
|
-
function
|
|
2406
|
-
const t = T(Yt), n =
|
|
2407
|
-
return te((c, i, l = !0,
|
|
2408
|
-
const
|
|
2409
|
-
if (!
|
|
2403
|
+
function Lr(e = "") {
|
|
2404
|
+
const t = T(Yt), n = tc(), o = T(ve), r = se(() => e.length, [e]);
|
|
2405
|
+
return te((c, i, l = !0, g) => {
|
|
2406
|
+
const m = c.getDocumentData(), h = c.getEditorId();
|
|
2407
|
+
if (!m)
|
|
2410
2408
|
return [];
|
|
2411
|
-
const
|
|
2412
|
-
if (!
|
|
2409
|
+
const d = m.body;
|
|
2410
|
+
if (!d)
|
|
2413
2411
|
return [];
|
|
2414
|
-
const
|
|
2415
|
-
if (!
|
|
2412
|
+
const u = d.dataStream.slice(0, d.dataStream.length - 2), a = { dataStream: "", ...m.body };
|
|
2413
|
+
if (!u.startsWith(e)) return [];
|
|
2416
2414
|
if (i == null || i.length === 0)
|
|
2417
2415
|
return a.textRuns = [], o.syncExecuteCommand($n.id, {
|
|
2418
|
-
unitId:
|
|
2416
|
+
unitId: h,
|
|
2419
2417
|
body: Nn(a, 0, a.dataStream.length - 2)
|
|
2420
2418
|
}), [];
|
|
2421
2419
|
{
|
|
2422
|
-
const { textRuns: S, refSelections: p } =
|
|
2420
|
+
const { textRuns: S, refSelections: p } = nc(t, n, i);
|
|
2423
2421
|
r && S.forEach((_) => {
|
|
2424
2422
|
_.ed = _.ed + r, _.st = _.st + r;
|
|
2425
2423
|
}), a.textRuns = [{ st: 0, ed: 1, ts: { fs: 11 } }, ...S];
|
|
2426
|
-
const v = i.reduce((_,
|
|
2424
|
+
const v = i.reduce((_, I) => typeof I == "string" ? `${_}${I}` : `${_}${I.token}`, "");
|
|
2427
2425
|
a.dataStream = `${e}${v}\r
|
|
2428
2426
|
`;
|
|
2429
2427
|
let C;
|
|
2430
2428
|
if (l) {
|
|
2431
2429
|
C = c.getSelectionRanges();
|
|
2432
2430
|
const _ = a.dataStream.length - 2 + r;
|
|
2433
|
-
C.forEach((
|
|
2434
|
-
|
|
2431
|
+
C.forEach((I) => {
|
|
2432
|
+
I.startOffset = Math.max(0, Math.min(I.startOffset, _)), I.endOffset = Math.max(0, Math.min(I.endOffset, _));
|
|
2435
2433
|
});
|
|
2436
2434
|
}
|
|
2437
2435
|
return o.syncExecuteCommand($n.id, {
|
|
2438
|
-
unitId:
|
|
2436
|
+
unitId: h,
|
|
2439
2437
|
body: Nn(a, 0, a.dataStream.length - 2),
|
|
2440
|
-
textRanges:
|
|
2438
|
+
textRanges: g != null ? g : C
|
|
2441
2439
|
}), p;
|
|
2442
2440
|
}
|
|
2443
2441
|
});
|
|
2444
2442
|
}
|
|
2445
|
-
function
|
|
2443
|
+
function tc() {
|
|
2446
2444
|
const e = T(Et), t = e.getCurrentTheme();
|
|
2447
2445
|
return se(() => {
|
|
2448
2446
|
const o = [
|
|
@@ -2462,16 +2460,16 @@ function nc() {
|
|
|
2462
2460
|
return { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: c };
|
|
2463
2461
|
}, [t]);
|
|
2464
2462
|
}
|
|
2465
|
-
function
|
|
2466
|
-
const { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: c } = t, i = [], l = [],
|
|
2467
|
-
let
|
|
2468
|
-
for (let
|
|
2469
|
-
const
|
|
2470
|
-
if (typeof
|
|
2471
|
-
const _ = i[i.length - 1],
|
|
2463
|
+
function nc(e, t, n) {
|
|
2464
|
+
const { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: c } = t, i = [], l = [], g = /* @__PURE__ */ new Map();
|
|
2465
|
+
let m = 0;
|
|
2466
|
+
for (let h = 0, d = n.length; h < d; h++) {
|
|
2467
|
+
const u = n[h];
|
|
2468
|
+
if (typeof u == "string") {
|
|
2469
|
+
const _ = i[i.length - 1], I = _ ? _.ed : 0, f = I + u.length;
|
|
2472
2470
|
i.push({
|
|
2473
|
-
st:
|
|
2474
|
-
ed:
|
|
2471
|
+
st: I,
|
|
2472
|
+
ed: f,
|
|
2475
2473
|
ts: {
|
|
2476
2474
|
cl: {
|
|
2477
2475
|
rgb: c
|
|
@@ -2481,10 +2479,10 @@ function rc(e, t, n) {
|
|
|
2481
2479
|
});
|
|
2482
2480
|
continue;
|
|
2483
2481
|
}
|
|
2484
|
-
if (e.hasDefinedNameDescription(
|
|
2482
|
+
if (e.hasDefinedNameDescription(u.token.trim())) {
|
|
2485
2483
|
i.push({
|
|
2486
|
-
st:
|
|
2487
|
-
ed:
|
|
2484
|
+
st: u.startIndex,
|
|
2485
|
+
ed: u.endIndex + 1,
|
|
2488
2486
|
ts: {
|
|
2489
2487
|
cl: {
|
|
2490
2488
|
rgb: c
|
|
@@ -2494,21 +2492,21 @@ function rc(e, t, n) {
|
|
|
2494
2492
|
});
|
|
2495
2493
|
continue;
|
|
2496
2494
|
}
|
|
2497
|
-
const { startIndex: a, endIndex: S, nodeType: p, token: v } =
|
|
2495
|
+
const { startIndex: a, endIndex: S, nodeType: p, token: v } = u;
|
|
2498
2496
|
let C = "";
|
|
2499
2497
|
if (p === Q.REFERENCE) {
|
|
2500
|
-
if (
|
|
2501
|
-
C =
|
|
2498
|
+
if (g.has(v))
|
|
2499
|
+
C = g.get(v);
|
|
2502
2500
|
else {
|
|
2503
|
-
const _ =
|
|
2504
|
-
C = o[_],
|
|
2501
|
+
const _ = m % o.length;
|
|
2502
|
+
C = o[_], g.set(v, C), m++;
|
|
2505
2503
|
}
|
|
2506
2504
|
l.push({
|
|
2507
|
-
refIndex:
|
|
2505
|
+
refIndex: h,
|
|
2508
2506
|
themeColor: C,
|
|
2509
2507
|
token: v,
|
|
2510
|
-
startIndex:
|
|
2511
|
-
endIndex:
|
|
2508
|
+
startIndex: u.startIndex,
|
|
2509
|
+
endIndex: u.endIndex,
|
|
2512
2510
|
index: l.length
|
|
2513
2511
|
});
|
|
2514
2512
|
} else p === Q.NUMBER ? C = r : (p === Q.STRING || p === Q.ARRAY) && (C = s);
|
|
@@ -2534,25 +2532,25 @@ function rc(e, t, n) {
|
|
|
2534
2532
|
}
|
|
2535
2533
|
return { textRuns: i, refSelections: l };
|
|
2536
2534
|
}
|
|
2537
|
-
const
|
|
2535
|
+
const rc = (e, t, n, o) => {
|
|
2538
2536
|
const r = T(ve), s = T(Gt), c = z(t);
|
|
2539
2537
|
c.current = t;
|
|
2540
2538
|
const i = z(o);
|
|
2541
2539
|
i.current = o, $(() => {
|
|
2542
2540
|
if (!n || !e)
|
|
2543
2541
|
return;
|
|
2544
|
-
const
|
|
2542
|
+
const g = `sheet.formula-embedding-editor.${n.getEditorId()}`, m = new je(), h = (a, S) => {
|
|
2545
2543
|
if (i.current) {
|
|
2546
2544
|
i.current(a, S);
|
|
2547
2545
|
return;
|
|
2548
2546
|
}
|
|
2549
2547
|
let p = ue.LEFT;
|
|
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(
|
|
2548
|
+
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(qo.id, {
|
|
2551
2549
|
direction: p
|
|
2552
|
-
}) : r.executeCommand(
|
|
2550
|
+
}) : r.executeCommand(Ko.id, {
|
|
2553
2551
|
direction: p
|
|
2554
2552
|
});
|
|
2555
|
-
},
|
|
2553
|
+
}, d = (a, S) => {
|
|
2556
2554
|
let p = ue.DOWN;
|
|
2557
2555
|
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
2556
|
direction: p,
|
|
@@ -2570,14 +2568,14 @@ const oc = (e, t, n, o) => {
|
|
|
2570
2568
|
direction: p,
|
|
2571
2569
|
extra: "formula-editor",
|
|
2572
2570
|
fromCurrentSelection: c.current === Ne.NEED_ADD || c.current === Ne.EDIT_OTHER_SHEET_REFERENCE
|
|
2573
|
-
}) :
|
|
2571
|
+
}) : h(a, S);
|
|
2574
2572
|
};
|
|
2575
|
-
return
|
|
2576
|
-
id:
|
|
2577
|
-
type:
|
|
2573
|
+
return m.add(r.registerCommand({
|
|
2574
|
+
id: g,
|
|
2575
|
+
type: xe.OPERATION,
|
|
2578
2576
|
handler(a, S) {
|
|
2579
2577
|
const { keyCode: p, metaKey: v } = S;
|
|
2580
|
-
|
|
2578
|
+
d(p, v);
|
|
2581
2579
|
}
|
|
2582
2580
|
})), [
|
|
2583
2581
|
{ keyCode: L.ARROW_DOWN },
|
|
@@ -2597,40 +2595,40 @@ const oc = (e, t, n, o) => {
|
|
|
2597
2595
|
{ keyCode: L.ARROW_RIGHT, metaKey: P.CTRL_COMMAND | P.SHIFT },
|
|
2598
2596
|
{ keyCode: L.ARROW_UP, metaKey: P.CTRL_COMMAND | P.SHIFT }
|
|
2599
2597
|
].map(({ keyCode: a, metaKey: S }) => ({
|
|
2600
|
-
id:
|
|
2598
|
+
id: g,
|
|
2601
2599
|
binding: S ? a | S : a,
|
|
2602
2600
|
preconditions: () => !0,
|
|
2603
2601
|
priority: 900,
|
|
2604
2602
|
staticParameters: {
|
|
2605
|
-
eventType:
|
|
2603
|
+
eventType: Me.Keyboard,
|
|
2606
2604
|
keyCode: a,
|
|
2607
2605
|
metaKey: S
|
|
2608
2606
|
}
|
|
2609
2607
|
})).forEach((a) => {
|
|
2610
|
-
|
|
2608
|
+
m.add(s.registerShortcut(a));
|
|
2611
2609
|
}), () => {
|
|
2612
|
-
|
|
2610
|
+
m.dispose();
|
|
2613
2611
|
};
|
|
2614
2612
|
}, [r, n, e, s]);
|
|
2615
|
-
},
|
|
2616
|
-
var
|
|
2617
|
-
const s = T(
|
|
2613
|
+
}, oc = (e, t, n, o, r = !0) => {
|
|
2614
|
+
var u;
|
|
2615
|
+
const s = T(we), c = T(ln), i = T(hs), l = T(Kt), g = T(ne), m = Ce(se(() => g.getCurrentTypeOfUnit$(H.UNIVER_SHEET), [g])), h = s.getRenderById((u = m == null ? void 0 : m.getUnitId()) != null ? u : ""), d = h == null ? void 0 : h.with(Pe);
|
|
2618
2616
|
Lt(() => {
|
|
2619
2617
|
if (e)
|
|
2620
2618
|
return c.setContextValue(xn, !0), r && i.disable(), () => {
|
|
2621
|
-
|
|
2619
|
+
g.getCurrentUnitOfType(H.UNIVER_DOC).getUnitId() === o && c.setContextValue(xn, !1), r && i.enable(), l.clear();
|
|
2622
2620
|
};
|
|
2623
2621
|
}, [c, e, l, r, o]), Lt(() => {
|
|
2624
2622
|
if (e && t) {
|
|
2625
|
-
const a =
|
|
2623
|
+
const a = d == null ? void 0 : d.enableSelectionChanging();
|
|
2626
2624
|
return c.setContextValue(Vn, !0), () => {
|
|
2627
2625
|
c.setContextValue(Vn, !1), a == null || a.dispose();
|
|
2628
2626
|
};
|
|
2629
2627
|
}
|
|
2630
|
-
}, [c, e,
|
|
2631
|
-
e && (
|
|
2632
|
-
}, [e,
|
|
2633
|
-
},
|
|
2628
|
+
}, [c, e, d, t]), $(() => {
|
|
2629
|
+
e && (d == null || d.setSkipLastEnabled(!1));
|
|
2630
|
+
}, [e, d]);
|
|
2631
|
+
}, sc = (e, t, n) => {
|
|
2634
2632
|
const o = T(ne), r = T(mn);
|
|
2635
2633
|
return Dt(() => {
|
|
2636
2634
|
if (e) {
|
|
@@ -2638,225 +2636,225 @@ const oc = (e, t, n, o) => {
|
|
|
2638
2636
|
(i == null ? void 0 : i.getUnitId()) !== t && o.setCurrentUnitForType(t), l && l.getSheetId() === n && r.setSelections(c);
|
|
2639
2637
|
}
|
|
2640
2638
|
}, [e, r, n, t, o]);
|
|
2641
|
-
},
|
|
2642
|
-
var
|
|
2639
|
+
}, ic = (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 ? Do(r) : r.sheetName !== "" && r.sheetName !== n ? Ct(r.sheetName, r.range) : Ee(r.range)), cc = (e) => {
|
|
2640
|
+
var m, h, d;
|
|
2643
2641
|
const { editor: t, lexerTreeBuilder: n } = e, o = t == null ? void 0 : t.getSelectionRanges();
|
|
2644
2642
|
if ((o == null ? void 0 : o.length) !== 1)
|
|
2645
2643
|
return;
|
|
2646
|
-
const s = o[0].startOffset - 1, c = ((
|
|
2647
|
-
`).slice(0, -2), i = (
|
|
2644
|
+
const s = o[0].startOffset - 1, c = ((h = (m = t == null ? void 0 : t.getDocumentData().body) == null ? void 0 : m.dataStream) != null ? h : `\r
|
|
2645
|
+
`).slice(0, -2), i = (d = n.sequenceNodesBuilder(c.slice(1))) != null ? d : [], l = En(i, s, !1), g = Ar(i, l);
|
|
2648
2646
|
return {
|
|
2649
2647
|
nodeIndex: l,
|
|
2650
|
-
updatingRefIndex:
|
|
2648
|
+
updatingRefIndex: g,
|
|
2651
2649
|
sequenceNodes: i,
|
|
2652
2650
|
offset: s
|
|
2653
2651
|
};
|
|
2654
|
-
},
|
|
2655
|
-
}),
|
|
2656
|
-
var
|
|
2657
|
-
const
|
|
2658
|
-
var
|
|
2659
|
-
return (
|
|
2660
|
-
}), C = se(() => v(o, r), [v, r, o]), _ = Ce(p == null ? void 0 : p.activeSheet$),
|
|
2661
|
-
var B, ie, ce, de, K, J,
|
|
2662
|
-
const
|
|
2663
|
-
if (!
|
|
2664
|
-
const { nodeIndex:
|
|
2652
|
+
}, ac = (() => {
|
|
2653
|
+
}), lc = (e, t, n, o, r, s, c, i, l, g = ac) => {
|
|
2654
|
+
var N;
|
|
2655
|
+
const m = T(we), h = T(ne), d = T(ve), u = T(Sr), a = T(Et), S = T(Ie), p = h.getUnit(o), v = te((k, E) => {
|
|
2656
|
+
var x, R, w;
|
|
2657
|
+
return (w = (R = (x = h.getUnit(k)) == null ? void 0 : x.getSheetBySheetId(E)) == null ? void 0 : R.getName()) != null ? w : "";
|
|
2658
|
+
}), C = se(() => v(o, r), [v, r, o]), _ = Ce(p == null ? void 0 : p.activeSheet$), I = tt({ activeSheet: _, sheetName: C }), f = Ce(se(() => h.getCurrentTypeOfUnit$(H.UNIVER_SHEET), [h])), b = m.getRenderById((N = f == null ? void 0 : f.getUnitId()) != null ? N : ""), y = b == null ? void 0 : b.with(Pe), A = b == null ? void 0 : b.with(qt), F = T(Kt), O = te((k, E) => {
|
|
2659
|
+
var B, ie, ce, de, K, J, nt, rt, yt, be;
|
|
2660
|
+
const x = cc({ editor: l, lexerTreeBuilder: S });
|
|
2661
|
+
if (!x) return;
|
|
2662
|
+
const { nodeIndex: R, updatingRefIndex: w, sequenceNodes: D, offset: U } = x;
|
|
2665
2663
|
if (n.current === Ne.NEED_ADD)
|
|
2666
2664
|
if (U !== 0) {
|
|
2667
|
-
if (
|
|
2665
|
+
if (R === -1 && D.length)
|
|
2668
2666
|
return;
|
|
2669
|
-
const Y =
|
|
2667
|
+
const Y = k[k.length - 1], X = D.splice(R + 1), ye = (B = Y.sheetId) != null ? B : r, he = {
|
|
2670
2668
|
range: Y,
|
|
2671
|
-
unitId: (ie = Y.unitId) != null ? ie :
|
|
2672
|
-
sheetName: v((ce = Y.unitId) != null ? ce :
|
|
2673
|
-
}, ee = ye !== r, ae = (
|
|
2669
|
+
unitId: (ie = Y.unitId) != null ? ie : f.getUnitId(),
|
|
2670
|
+
sheetName: v((ce = Y.unitId) != null ? ce : f.getUnitId(), ye)
|
|
2671
|
+
}, ee = ye !== r, ae = (f == null ? void 0 : f.getUnitId()) !== o, Te = kt([he], c && (ee || ae), C, ae);
|
|
2674
2672
|
D.push({ token: Te[0], nodeType: Q.REFERENCE });
|
|
2675
|
-
const Ue = [...D, ...X],
|
|
2676
|
-
|
|
2673
|
+
const Ue = [...D, ...X], Ae = an(Ue);
|
|
2674
|
+
g(Ae, ic(D), E);
|
|
2677
2675
|
} else {
|
|
2678
|
-
const Y =
|
|
2676
|
+
const Y = k[k.length - 1], X = (de = Y.sheetId) != null ? de : r, ye = {
|
|
2679
2677
|
range: Y,
|
|
2680
|
-
unitId: (K = Y.unitId) != null ? K :
|
|
2681
|
-
sheetName: v((J = Y.unitId) != null ? J :
|
|
2682
|
-
}, he = X !== r, ee = (
|
|
2678
|
+
unitId: (K = Y.unitId) != null ? K : f.getUnitId(),
|
|
2679
|
+
sheetName: v((J = Y.unitId) != null ? J : f.getUnitId(), X)
|
|
2680
|
+
}, he = X !== r, ee = (f == null ? void 0 : f.getUnitId()) !== o, ae = kt([ye], c && (he || ee), C, ee);
|
|
2683
2681
|
D.unshift({ token: ae[0], nodeType: Q.REFERENCE });
|
|
2684
2682
|
const Te = an(D);
|
|
2685
|
-
|
|
2683
|
+
g(Te, ae[0].length, E);
|
|
2686
2684
|
}
|
|
2687
2685
|
else if (n.current === Ne.EDIT_OTHER_SHEET_REFERENCE || n.current === Ne.EDIT_OTHER_WORKBOOK_REFERENCE) {
|
|
2688
|
-
const Y =
|
|
2686
|
+
const Y = k.pop();
|
|
2689
2687
|
if (!Y) return;
|
|
2690
|
-
const X = D[
|
|
2688
|
+
const X = D[R];
|
|
2691
2689
|
if (typeof X == "object" && X.nodeType === Q.REFERENCE) {
|
|
2692
2690
|
const ye = X.token;
|
|
2693
|
-
(
|
|
2691
|
+
(f == null ? void 0 : f.getUnitId()) !== o ? X.token = Lo((nt = f == null ? void 0 : f.getUnitId()) != null ? nt : "", C, Y) : X.token = C === (_ == null ? void 0 : _.getName()) ? Ee(Y) : Ct(_.getName(), Y);
|
|
2694
2692
|
const ee = U + (X.token.length - ye.length);
|
|
2695
|
-
|
|
2693
|
+
g($o(D), ee, E);
|
|
2696
2694
|
}
|
|
2697
2695
|
} else {
|
|
2698
|
-
const Y = [...
|
|
2699
|
-
if (
|
|
2696
|
+
const Y = [...k];
|
|
2697
|
+
if (w !== -1) {
|
|
2700
2698
|
const G = Y.pop();
|
|
2701
|
-
G && Y.splice(
|
|
2699
|
+
G && Y.splice(w, 0, G);
|
|
2702
2700
|
}
|
|
2703
2701
|
let X = 0;
|
|
2704
2702
|
const ye = D.map((G) => {
|
|
2705
|
-
var fe, Ve,
|
|
2703
|
+
var fe, Ve, ot, ge;
|
|
2706
2704
|
if (typeof G == "string")
|
|
2707
2705
|
return G;
|
|
2708
2706
|
if (G.nodeType === Q.REFERENCE) {
|
|
2709
2707
|
const me = ht(G.token);
|
|
2710
|
-
if (me.sheetName || (me.sheetName = C), (me.unitId || o) !== (
|
|
2708
|
+
if (me.sheetName || (me.sheetName = C), (me.unitId || o) !== (f == null ? void 0 : f.getUnitId()) || c && ((fe = I.current.activeSheet) == null ? void 0 : fe.getName()) !== me.sheetName)
|
|
2711
2709
|
return G.token;
|
|
2712
2710
|
const _e = Y[X];
|
|
2713
2711
|
if (X++, !_e)
|
|
2714
2712
|
return "";
|
|
2715
2713
|
const Tt = (Ve = _e.sheetId) != null ? Ve : r, Xt = {
|
|
2716
2714
|
range: _e,
|
|
2717
|
-
unitId: (
|
|
2718
|
-
sheetName: v((ge = _e.unitId) != null ? ge :
|
|
2719
|
-
}, Ot = (
|
|
2715
|
+
unitId: (ot = _e.unitId) != null ? ot : f.getUnitId(),
|
|
2716
|
+
sheetName: v((ge = _e.unitId) != null ? ge : f.getUnitId(), Tt)
|
|
2717
|
+
}, Ot = (f == null ? void 0 : f.getUnitId()) !== o;
|
|
2720
2718
|
return kt([Xt], c && (Tt !== r || Ot), C, Ot)[0];
|
|
2721
2719
|
}
|
|
2722
2720
|
return G.token;
|
|
2723
2721
|
});
|
|
2724
2722
|
let he = "", ee;
|
|
2725
2723
|
ye.forEach((G, fe) => {
|
|
2726
|
-
he += G, fe ===
|
|
2724
|
+
he += G, fe === R && (ee = he.length);
|
|
2727
2725
|
});
|
|
2728
2726
|
const ae = [];
|
|
2729
|
-
for (let G = X; G <=
|
|
2730
|
-
const fe =
|
|
2727
|
+
for (let G = X; G <= k.length - 1; G++) {
|
|
2728
|
+
const fe = k[G], Ve = (rt = fe.sheetId) != null ? rt : r, ot = {
|
|
2731
2729
|
range: fe,
|
|
2732
|
-
unitId: (yt = fe.unitId) != null ? yt :
|
|
2733
|
-
sheetName: v((be = fe.unitId) != null ? be :
|
|
2734
|
-
}, ge = (
|
|
2730
|
+
unitId: (yt = fe.unitId) != null ? yt : f.getUnitId(),
|
|
2731
|
+
sheetName: v((be = fe.unitId) != null ? be : f.getUnitId(), Ve)
|
|
2732
|
+
}, ge = (f == null ? void 0 : f.getUnitId()) !== o, _e = kt([ot], c && (Ve !== r || ge), C, ge);
|
|
2735
2733
|
ae.push(_e[0]);
|
|
2736
2734
|
}
|
|
2737
|
-
const Te = D[D.length - 1], Ue = Te && (typeof Te == "string" ? !1 : Te.nodeType === Q.REFERENCE),
|
|
2738
|
-
|
|
2735
|
+
const Te = D[D.length - 1], Ue = Te && (typeof Te == "string" ? !1 : Te.nodeType === Q.REFERENCE), Ae = `${he}${ae.length && Ue ? "," : ""}${ae.join(",")}`;
|
|
2736
|
+
g(Ae, !ae.length && ee ? ee : Ae.length, E);
|
|
2739
2737
|
}
|
|
2740
2738
|
});
|
|
2741
2739
|
$(() => {
|
|
2742
|
-
if (
|
|
2743
|
-
let
|
|
2744
|
-
const
|
|
2745
|
-
if (
|
|
2746
|
-
|
|
2740
|
+
if (y && e) {
|
|
2741
|
+
let k = !0;
|
|
2742
|
+
const E = (R, w) => {
|
|
2743
|
+
if (k) {
|
|
2744
|
+
k = !1;
|
|
2747
2745
|
return;
|
|
2748
2746
|
}
|
|
2749
|
-
|
|
2750
|
-
},
|
|
2751
|
-
return
|
|
2752
|
-
|
|
2753
|
-
})),
|
|
2754
|
-
|
|
2747
|
+
O(R.map((D) => D.rangeWithCoord), w);
|
|
2748
|
+
}, x = new je();
|
|
2749
|
+
return x.add(y.selectionMoving$.subscribe((R) => {
|
|
2750
|
+
E(R, !1);
|
|
2751
|
+
})), x.add(y.selectionMoveEnd$.subscribe((R) => {
|
|
2752
|
+
E(R, !0);
|
|
2755
2753
|
})), () => {
|
|
2756
|
-
|
|
2754
|
+
x.dispose();
|
|
2757
2755
|
};
|
|
2758
2756
|
}
|
|
2759
|
-
}, [e,
|
|
2760
|
-
if (t &&
|
|
2761
|
-
const
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
const B =
|
|
2766
|
-
U.sheetId = ie.sheetId, U.unitId = ie.unitId, B[D] = U,
|
|
2757
|
+
}, [e, O, y]), $(() => {
|
|
2758
|
+
if (t && y && l) {
|
|
2759
|
+
const k = new je(), E = () => {
|
|
2760
|
+
k.dispose(), y.getSelectionControls().forEach((w, D) => {
|
|
2761
|
+
k.add(
|
|
2762
|
+
w.selectionScaling$.subscribe((U) => {
|
|
2763
|
+
const B = y.getSelectionDataWithStyle().map((ce) => ce.rangeWithCoord), ie = B[D];
|
|
2764
|
+
U.sheetId = ie.sheetId, U.unitId = ie.unitId, B[D] = U, O(B, !1);
|
|
2767
2765
|
})
|
|
2768
|
-
),
|
|
2769
|
-
|
|
2770
|
-
const B =
|
|
2771
|
-
U.sheetId = ie.sheetId, U.unitId = ie.unitId, B[D] = U,
|
|
2766
|
+
), k.add(
|
|
2767
|
+
w.selectionMoving$.subscribe((U) => {
|
|
2768
|
+
const B = y.getSelectionDataWithStyle().map((ce) => ce.rangeWithCoord), ie = B[D];
|
|
2769
|
+
U.sheetId = ie.sheetId, U.unitId = ie.unitId, B[D] = U, O(B, !0);
|
|
2772
2770
|
})
|
|
2773
2771
|
);
|
|
2774
2772
|
});
|
|
2775
|
-
},
|
|
2773
|
+
}, x = jo(
|
|
2776
2774
|
l.input$,
|
|
2777
2775
|
F.selectionSet$,
|
|
2778
|
-
|
|
2776
|
+
y.selectionMoveEnd$
|
|
2779
2777
|
).pipe(
|
|
2780
|
-
|
|
2778
|
+
Es(50)
|
|
2781
2779
|
).subscribe(() => {
|
|
2782
|
-
|
|
2780
|
+
E();
|
|
2783
2781
|
});
|
|
2784
2782
|
return () => {
|
|
2785
|
-
|
|
2783
|
+
x.unsubscribe(), k.dispose();
|
|
2786
2784
|
};
|
|
2787
2785
|
}
|
|
2788
|
-
}, [l, t,
|
|
2786
|
+
}, [l, t, O, y, F.selectionSet$]), y == null || y.getSelectionDataWithStyle(), $(() => {
|
|
2789
2787
|
if (i) {
|
|
2790
|
-
const
|
|
2791
|
-
var
|
|
2792
|
-
if (
|
|
2788
|
+
const k = d.onCommandExecuted((E) => {
|
|
2789
|
+
var R;
|
|
2790
|
+
if (E.id !== pn.id)
|
|
2793
2791
|
return;
|
|
2794
|
-
const
|
|
2795
|
-
if (
|
|
2796
|
-
const
|
|
2797
|
-
if (
|
|
2798
|
-
const D = n.current === Ne.NEED_ADD, U = ((
|
|
2799
|
-
D ? U.push(
|
|
2792
|
+
const x = E.params;
|
|
2793
|
+
if (x.extra === "formula-editor" && x.selections.length) {
|
|
2794
|
+
const w = x.selections[x.selections.length - 1];
|
|
2795
|
+
if (w) {
|
|
2796
|
+
const D = n.current === Ne.NEED_ADD, U = ((R = y == null ? void 0 : y.getSelectionDataWithStyle()) != null ? R : []).map((B) => B.rangeWithCoord);
|
|
2797
|
+
D ? U.push(w.range) : U[U.length - 1] = w.range, O(U, !0);
|
|
2800
2798
|
}
|
|
2801
2799
|
}
|
|
2802
2800
|
});
|
|
2803
2801
|
return () => {
|
|
2804
|
-
|
|
2802
|
+
k.dispose();
|
|
2805
2803
|
};
|
|
2806
2804
|
}
|
|
2807
|
-
}, [
|
|
2805
|
+
}, [d, l, n, S, i, O, y]), $(() => {
|
|
2808
2806
|
if (!l)
|
|
2809
2807
|
return;
|
|
2810
|
-
const
|
|
2811
|
-
|
|
2808
|
+
const k = u.textSelection$.subscribe((E) => {
|
|
2809
|
+
E.unitId === l.getEditorId() && Dr({
|
|
2812
2810
|
unitId: o,
|
|
2813
2811
|
subUnitId: r,
|
|
2814
2812
|
refSelections: s.current,
|
|
2815
2813
|
editor: l,
|
|
2816
2814
|
refSelectionsService: F,
|
|
2817
|
-
refSelectionsRenderService:
|
|
2818
|
-
sheetSkeletonManagerService:
|
|
2815
|
+
refSelectionsRenderService: y,
|
|
2816
|
+
sheetSkeletonManagerService: A,
|
|
2819
2817
|
themeService: a,
|
|
2820
|
-
univerInstanceService:
|
|
2821
|
-
currentWorkbook:
|
|
2818
|
+
univerInstanceService: h,
|
|
2819
|
+
currentWorkbook: f
|
|
2822
2820
|
});
|
|
2823
2821
|
});
|
|
2824
|
-
return () =>
|
|
2825
|
-
}, [
|
|
2826
|
-
},
|
|
2827
|
-
const c = T(ve), i = T(
|
|
2822
|
+
return () => k.unsubscribe();
|
|
2823
|
+
}, [u.textSelection$, l, s, y, F, A, r, a, o, h]);
|
|
2824
|
+
}, uc = (e, t, n, o, r, s) => {
|
|
2825
|
+
const c = T(ve), i = T(Ye), g = T(we).getRenderById(t), m = T(ne), h = g == null ? void 0 : g.with(Pe);
|
|
2828
2826
|
$(() => {
|
|
2829
|
-
if (e &&
|
|
2827
|
+
if (e && h)
|
|
2830
2828
|
if (n) {
|
|
2831
|
-
const
|
|
2832
|
-
const S =
|
|
2829
|
+
const d = () => {
|
|
2830
|
+
const S = h.getSelectionControls().length;
|
|
2833
2831
|
for (let p = 1; p <= S; p++)
|
|
2834
|
-
|
|
2832
|
+
h.clearLastSelection();
|
|
2835
2833
|
return setTimeout(() => {
|
|
2836
2834
|
s();
|
|
2837
2835
|
}, 30);
|
|
2838
|
-
},
|
|
2839
|
-
S.id === Wn.id &&
|
|
2840
|
-
}), a =
|
|
2841
|
-
|
|
2836
|
+
}, u = c.onCommandExecuted((S) => {
|
|
2837
|
+
S.id === Wn.id && d();
|
|
2838
|
+
}), a = m.getCurrentTypeOfUnit$(H.UNIVER_SHEET).subscribe((S) => {
|
|
2839
|
+
d();
|
|
2842
2840
|
});
|
|
2843
2841
|
return () => {
|
|
2844
|
-
|
|
2842
|
+
u.dispose(), a.unsubscribe();
|
|
2845
2843
|
};
|
|
2846
2844
|
} else {
|
|
2847
|
-
const
|
|
2848
|
-
if (
|
|
2845
|
+
const d = c.beforeCommandExecuted((u) => {
|
|
2846
|
+
if (u.id === Wn.id) {
|
|
2849
2847
|
o(!1), r(), s();
|
|
2850
2848
|
const a = i.getEditor(un);
|
|
2851
2849
|
a == null || a.focus();
|
|
2852
2850
|
}
|
|
2853
2851
|
});
|
|
2854
2852
|
return () => {
|
|
2855
|
-
|
|
2853
|
+
d.dispose();
|
|
2856
2854
|
};
|
|
2857
2855
|
}
|
|
2858
|
-
}, [e,
|
|
2859
|
-
},
|
|
2856
|
+
}, [e, h]);
|
|
2857
|
+
}, dc = (e, t, n) => {
|
|
2860
2858
|
const o = T(Ie), r = z(!0);
|
|
2861
2859
|
$(() => {
|
|
2862
2860
|
if (e) {
|
|
@@ -2870,19 +2868,19 @@ const oc = (e, t, n, o) => {
|
|
|
2870
2868
|
}, [e]), $(() => {
|
|
2871
2869
|
if (!r.current && t) {
|
|
2872
2870
|
const s = o.checkIfAddBracket(n);
|
|
2873
|
-
t(s === 0 && n.startsWith(
|
|
2871
|
+
t(s === 0 && n.startsWith(ar.EQUALS), `${n}`);
|
|
2874
2872
|
}
|
|
2875
2873
|
}, [n, t]);
|
|
2876
|
-
},
|
|
2877
|
-
const o = T(Yt), [r, s] = V([]), [c, i] = V(""), l = z(-1),
|
|
2874
|
+
}, hc = (e, t = [], n) => {
|
|
2875
|
+
const o = T(Yt), [r, s] = V([]), [c, i] = V(""), l = z(-1), g = tt({ nodes: t }), m = () => {
|
|
2878
2876
|
s([]), i(""), l.current = -1;
|
|
2879
2877
|
};
|
|
2880
2878
|
return $(() => {
|
|
2881
2879
|
if (n && e) {
|
|
2882
|
-
const
|
|
2883
|
-
const
|
|
2884
|
-
if (
|
|
2885
|
-
const a =
|
|
2880
|
+
const d = n.input$.pipe(gn(300)).subscribe(() => {
|
|
2881
|
+
const u = n.getSelectionRanges();
|
|
2882
|
+
if (u.length === 1) {
|
|
2883
|
+
const a = g.current.nodes, S = u[0];
|
|
2886
2884
|
if (S.collapsed) {
|
|
2887
2885
|
const p = En(a, S.startOffset - 1, !1);
|
|
2888
2886
|
l.current = p;
|
|
@@ -2898,154 +2896,154 @@ const oc = (e, t, n, o) => {
|
|
|
2898
2896
|
l.current = -1, i(""), s((a) => a != null && a.length ? [] : a);
|
|
2899
2897
|
});
|
|
2900
2898
|
return () => {
|
|
2901
|
-
|
|
2899
|
+
d.unsubscribe();
|
|
2902
2900
|
};
|
|
2903
2901
|
}
|
|
2904
2902
|
}, [n, e]), $(() => {
|
|
2905
|
-
e ||
|
|
2903
|
+
e || m();
|
|
2906
2904
|
}, [e]), {
|
|
2907
2905
|
searchList: r,
|
|
2908
2906
|
searchText: c,
|
|
2909
|
-
handlerFormulaReplace: (u) => {
|
|
2910
|
-
const
|
|
2907
|
+
handlerFormulaReplace: (d, u) => {
|
|
2908
|
+
const a = [...g.current.nodes];
|
|
2911
2909
|
if (l.current !== -1) {
|
|
2912
|
-
const
|
|
2913
|
-
let
|
|
2914
|
-
return
|
|
2910
|
+
const S = a.splice(l.current + 1), p = a.pop() || "";
|
|
2911
|
+
let v = (typeof p == "string" ? p.length : p.token.length) - d.length;
|
|
2912
|
+
return a.push(d), S[0] !== qe.OPEN_BRACKET && u !== cr.DefinedName && (a.push(qe.OPEN_BRACKET), v--), { text: an([...a, ...S]), offset: v };
|
|
2915
2913
|
}
|
|
2916
2914
|
},
|
|
2917
|
-
reset:
|
|
2915
|
+
reset: m
|
|
2918
2916
|
};
|
|
2919
|
-
},
|
|
2920
|
-
},
|
|
2921
|
-
function
|
|
2922
|
-
const { isFocus: n, sequenceNodes: o, onSelect: r, editor: s, onClose: c =
|
|
2923
|
-
const k =
|
|
2924
|
-
k && (
|
|
2917
|
+
}, fc = () => {
|
|
2918
|
+
}, gc = ke(mc);
|
|
2919
|
+
function mc(e, t) {
|
|
2920
|
+
const { isFocus: n, sequenceNodes: o, onSelect: r, editor: s, onClose: c = fc } = e, i = s.getEditorId(), l = T(Gt), g = T(ve), { searchList: m, searchText: h, handlerFormulaReplace: d, reset: u } = hc(n, o, s), a = se(() => !!m.length, [m]), S = z(void 0), [p, v] = V(0), C = z(!1), [_] = Fr(i, a, [h, m]), I = tt({ searchList: m, active: p }), f = (O, N) => {
|
|
2921
|
+
const k = d(O, N);
|
|
2922
|
+
k && (u(), r(k));
|
|
2925
2923
|
};
|
|
2926
|
-
function O
|
|
2927
|
-
C.current && v(
|
|
2924
|
+
function b(O) {
|
|
2925
|
+
C.current && v(O);
|
|
2928
2926
|
}
|
|
2929
|
-
function
|
|
2927
|
+
function y() {
|
|
2930
2928
|
C.current && v(-1);
|
|
2931
2929
|
}
|
|
2932
2930
|
$(() => {
|
|
2933
|
-
if (!
|
|
2931
|
+
if (!m.length)
|
|
2934
2932
|
return;
|
|
2935
|
-
const
|
|
2936
|
-
const { searchList:
|
|
2937
|
-
switch (
|
|
2933
|
+
const O = `sheet.formula-embedding-editor.search_function.${i}`, N = new je(), k = (E) => {
|
|
2934
|
+
const { searchList: x, active: R } = I.current;
|
|
2935
|
+
switch (E) {
|
|
2938
2936
|
case L.ARROW_UP: {
|
|
2939
|
-
v((
|
|
2940
|
-
const D = Math.max(0,
|
|
2941
|
-
return
|
|
2937
|
+
v((w) => {
|
|
2938
|
+
const D = Math.max(0, w - 1);
|
|
2939
|
+
return A(D), D;
|
|
2942
2940
|
});
|
|
2943
2941
|
break;
|
|
2944
2942
|
}
|
|
2945
2943
|
case L.ARROW_DOWN: {
|
|
2946
|
-
v((
|
|
2947
|
-
const D = Math.min(
|
|
2948
|
-
return
|
|
2944
|
+
v((w) => {
|
|
2945
|
+
const D = Math.min(x.length - 1, w + 1);
|
|
2946
|
+
return A(D), D;
|
|
2949
2947
|
});
|
|
2950
2948
|
break;
|
|
2951
2949
|
}
|
|
2952
2950
|
case L.TAB:
|
|
2953
2951
|
case L.ENTER: {
|
|
2954
|
-
const
|
|
2955
|
-
|
|
2952
|
+
const w = x[R];
|
|
2953
|
+
f(w.name, w.functionType);
|
|
2956
2954
|
break;
|
|
2957
2955
|
}
|
|
2958
2956
|
case L.ESC: {
|
|
2959
|
-
|
|
2957
|
+
u(), c();
|
|
2960
2958
|
break;
|
|
2961
2959
|
}
|
|
2962
2960
|
}
|
|
2963
2961
|
};
|
|
2964
|
-
return
|
|
2965
|
-
id:
|
|
2966
|
-
type:
|
|
2967
|
-
handler(
|
|
2968
|
-
const { keyCode:
|
|
2969
|
-
|
|
2962
|
+
return N.add(g.registerCommand({
|
|
2963
|
+
id: O,
|
|
2964
|
+
type: xe.OPERATION,
|
|
2965
|
+
handler(E, x) {
|
|
2966
|
+
const { keyCode: R } = x;
|
|
2967
|
+
k(R);
|
|
2970
2968
|
}
|
|
2971
|
-
})), [L.ARROW_UP, L.ARROW_DOWN, L.ENTER, L.ESC, L.TAB].map((
|
|
2972
|
-
id:
|
|
2973
|
-
binding:
|
|
2969
|
+
})), [L.ARROW_UP, L.ARROW_DOWN, L.ENTER, L.ESC, L.TAB].map((E) => ({
|
|
2970
|
+
id: O,
|
|
2971
|
+
binding: E,
|
|
2974
2972
|
preconditions: () => !0,
|
|
2975
2973
|
priority: 1e3,
|
|
2976
2974
|
staticParameters: {
|
|
2977
|
-
eventType:
|
|
2978
|
-
keyCode:
|
|
2975
|
+
eventType: Me.Keyboard,
|
|
2976
|
+
keyCode: E
|
|
2979
2977
|
}
|
|
2980
|
-
})).forEach((
|
|
2981
|
-
|
|
2978
|
+
})).forEach((E) => {
|
|
2979
|
+
N.add(l.registerShortcut(E));
|
|
2982
2980
|
}), () => {
|
|
2983
|
-
|
|
2981
|
+
N.dispose();
|
|
2984
2982
|
};
|
|
2985
|
-
}, [
|
|
2986
|
-
function
|
|
2987
|
-
const
|
|
2983
|
+
}, [m]);
|
|
2984
|
+
function A(O) {
|
|
2985
|
+
const N = S.current;
|
|
2986
|
+
if (!N) return;
|
|
2987
|
+
const k = N.children[O];
|
|
2988
2988
|
if (!k) return;
|
|
2989
|
-
const
|
|
2990
|
-
if (
|
|
2991
|
-
const E = k.getBoundingClientRect().top, b = k.offsetHeight, M = A.getBoundingClientRect(), D = M.top, U = M.height;
|
|
2992
|
-
if (D >= 0 && D > E && D - E + U <= b)
|
|
2989
|
+
const x = N.getBoundingClientRect().top, R = N.offsetHeight, w = k.getBoundingClientRect(), D = w.top, U = w.height;
|
|
2990
|
+
if (D >= 0 && D > x && D - x + U <= R)
|
|
2993
2991
|
return;
|
|
2994
|
-
const B =
|
|
2995
|
-
|
|
2992
|
+
const B = k.offsetTop - (R - U) / 2;
|
|
2993
|
+
N.scrollTo({
|
|
2996
2994
|
top: B,
|
|
2997
2995
|
behavior: "smooth"
|
|
2998
2996
|
});
|
|
2999
2997
|
}
|
|
3000
2998
|
const F = se(() => {
|
|
3001
|
-
let
|
|
2999
|
+
let O = "";
|
|
3002
3000
|
return () => {
|
|
3003
|
-
clearTimeout(
|
|
3001
|
+
clearTimeout(O), C.current = !0, O = setTimeout(() => {
|
|
3004
3002
|
C.current = !1;
|
|
3005
3003
|
}, 300);
|
|
3006
3004
|
};
|
|
3007
3005
|
}, []);
|
|
3008
|
-
return
|
|
3006
|
+
return m.length > 0 && a && /* @__PURE__ */ M(on, { portal: !0, anchorRect$: _, direction: "vertical", children: /* @__PURE__ */ M(
|
|
3009
3007
|
"ul",
|
|
3010
3008
|
{
|
|
3011
|
-
ref: (
|
|
3012
|
-
S.current =
|
|
3009
|
+
ref: (O) => {
|
|
3010
|
+
S.current = O, t && (t.current = O);
|
|
3013
3011
|
},
|
|
3014
3012
|
"data-u-comp": "sheets-formula-editor",
|
|
3015
3013
|
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:
|
|
3014
|
+
children: m.map((O, N) => /* @__PURE__ */ W(
|
|
3017
3015
|
"li",
|
|
3018
3016
|
{
|
|
3019
3017
|
className: re("univer-box-border univer-cursor-pointer univer-rounded univer-px-2 univer-py-1 univer-text-gray-900 univer-transition-colors dark:!univer-text-white", {
|
|
3020
|
-
"univer-bg-gray-200 dark:!univer-bg-gray-600": p ===
|
|
3018
|
+
"univer-bg-gray-200 dark:!univer-bg-gray-600": p === N
|
|
3021
3019
|
}),
|
|
3022
|
-
onMouseEnter: () =>
|
|
3023
|
-
onMouseLeave:
|
|
3020
|
+
onMouseEnter: () => b(N),
|
|
3021
|
+
onMouseLeave: y,
|
|
3024
3022
|
onMouseMove: F,
|
|
3025
3023
|
onClick: () => {
|
|
3026
|
-
|
|
3024
|
+
f(O.name, O.functionType), s && s.focus();
|
|
3027
3025
|
},
|
|
3028
3026
|
children: [
|
|
3029
3027
|
/* @__PURE__ */ W("span", { className: "univer-text-xs", children: [
|
|
3030
|
-
/* @__PURE__ */
|
|
3031
|
-
/* @__PURE__ */
|
|
3028
|
+
/* @__PURE__ */ M("span", { className: "univer-text-red-500", children: O.name.substring(0, h.length) }),
|
|
3029
|
+
/* @__PURE__ */ M("span", { children: O.name.slice(h.length) })
|
|
3032
3030
|
] }),
|
|
3033
|
-
/* @__PURE__ */
|
|
3031
|
+
/* @__PURE__ */ M(
|
|
3034
3032
|
"span",
|
|
3035
3033
|
{
|
|
3036
3034
|
className: "univer-block univer-text-xs univer-text-gray-400",
|
|
3037
|
-
children:
|
|
3035
|
+
children: O.desc
|
|
3038
3036
|
}
|
|
3039
3037
|
)
|
|
3040
3038
|
]
|
|
3041
3039
|
},
|
|
3042
|
-
|
|
3040
|
+
O.name
|
|
3043
3041
|
))
|
|
3044
3042
|
}
|
|
3045
3043
|
) });
|
|
3046
3044
|
}
|
|
3047
|
-
const
|
|
3048
|
-
},
|
|
3045
|
+
const pc = (e) => e.startsWith(ar.EQUALS) ? e.slice(1) : "", zn = () => {
|
|
3046
|
+
}, vc = ke((e, t) => {
|
|
3049
3047
|
var Qt, bn;
|
|
3050
3048
|
const {
|
|
3051
3049
|
errorText: n,
|
|
@@ -3055,70 +3053,70 @@ const vc = (e) => e.startsWith(ir.EQUALS) ? e.slice(1) : "", zn = () => {
|
|
|
3055
3053
|
isFocus: c = !0,
|
|
3056
3054
|
isSupportAcrossSheet: i = !1,
|
|
3057
3055
|
onFocus: l = zn,
|
|
3058
|
-
onBlur:
|
|
3059
|
-
onChange:
|
|
3060
|
-
onVerify:
|
|
3061
|
-
className:
|
|
3062
|
-
editorId:
|
|
3056
|
+
onBlur: g = zn,
|
|
3057
|
+
onChange: m,
|
|
3058
|
+
onVerify: h,
|
|
3059
|
+
className: d,
|
|
3060
|
+
editorId: u,
|
|
3063
3061
|
moveCursor: a = !0,
|
|
3064
3062
|
onFormulaSelectingChange: S,
|
|
3065
3063
|
keyboardEventConfig: p,
|
|
3066
3064
|
onMoveInEditor: v,
|
|
3067
3065
|
resetSelectionOnBlur: C = !0,
|
|
3068
3066
|
autoScrollbar: _ = !0,
|
|
3069
|
-
isSingle:
|
|
3070
|
-
disableSelectionOnClick:
|
|
3071
|
-
autofocus:
|
|
3072
|
-
disableContextMenu:
|
|
3073
|
-
style:
|
|
3074
|
-
} = e, F = T(
|
|
3075
|
-
|
|
3076
|
-
isClickOutSide: (Z) =>
|
|
3067
|
+
isSingle: I = !0,
|
|
3068
|
+
disableSelectionOnClick: f = !1,
|
|
3069
|
+
autofocus: b = !0,
|
|
3070
|
+
disableContextMenu: y,
|
|
3071
|
+
style: A
|
|
3072
|
+
} = e, F = T(Ye), O = z(null), N = te(m);
|
|
3073
|
+
ps(t, () => ({
|
|
3074
|
+
isClickOutSide: (Z) => O.current ? !O.current.contains(Z.target) : !1
|
|
3077
3075
|
}));
|
|
3078
|
-
const
|
|
3076
|
+
const k = te(S), E = z(null), x = z(void 0), R = x.current, [w, D] = V(c), U = z(null), B = se(() => u != null ? u : eo(`${yo}-${jt(4)}`), []), ie = se(() => n !== void 0, [n]), ce = T(ne), de = ce.getUnit(B);
|
|
3079
3077
|
Ce(de == null ? void 0 : de.change$);
|
|
3080
|
-
const K =
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
}, [J,
|
|
3084
|
-
const Ve =
|
|
3085
|
-
if (!
|
|
3078
|
+
const K = Qi(), J = to.transform.getPlainText((bn = (Qt = de == null ? void 0 : de.getBody()) == null ? void 0 : Qt.dataStream) != null ? bn : ""), nt = tt(J), rt = se(() => pc(J), [J]), yt = se(() => K(rt), [rt, K]), { isSelecting: be, isSelectingRef: Y } = Xi({ unitId: r, subUnitId: s, editorId: B, isFocus: w, disableOnClick: f }), X = z(""), he = T(we).getRenderById(B), ee = he == null ? void 0 : he.with(hr), ae = ee == null ? void 0 : ee.isFocusing, Te = se(() => ce.getCurrentTypeOfUnit$(H.UNIVER_DOC), [ce]), Ue = Ce(Te), Ae = (Ue == null ? void 0 : Ue.getUnitId()) === B, G = z([]), fe = be;
|
|
3079
|
+
fs(() => {
|
|
3080
|
+
N(J);
|
|
3081
|
+
}, [J, N]);
|
|
3082
|
+
const Ve = Lr("="), ot = ec(r, s), ge = te((Z, oe = !0, Fe, Oe) => {
|
|
3083
|
+
if (!x.current) return;
|
|
3086
3084
|
X.current = Z;
|
|
3087
|
-
const Nt = Z[0] === "=" ? Z.slice(1) : "",
|
|
3088
|
-
|
|
3089
|
-
|
|
3085
|
+
const Nt = Z[0] === "=" ? Z.slice(1) : "", De = K(Nt), Ur = De.reduce((We, Mt) => typeof Mt == "object" ? `${We}${Mt.token}` : `${We}${Mt}`, ""), xt = Ve(
|
|
3086
|
+
x.current,
|
|
3087
|
+
Ur === Nt ? De : [],
|
|
3090
3088
|
oe,
|
|
3091
3089
|
Oe
|
|
3092
3090
|
);
|
|
3093
|
-
if (G.current = xt,
|
|
3094
|
-
const We = Oe != null ? Oe :
|
|
3091
|
+
if (G.current = xt, Fe) {
|
|
3092
|
+
const We = Oe != null ? Oe : R == null ? void 0 : R.getSelectionRanges();
|
|
3095
3093
|
if ((We == null ? void 0 : We.length) !== 1)
|
|
3096
3094
|
return;
|
|
3097
|
-
const
|
|
3095
|
+
const Vr = We[0].startOffset - 1, Wr = En(De, Vr, !1), yn = Ar(De, Wr);
|
|
3098
3096
|
if (yn >= 0) {
|
|
3099
3097
|
const Tn = xt.splice(yn, 1)[0];
|
|
3100
3098
|
Tn && xt.push(Tn);
|
|
3101
3099
|
}
|
|
3102
|
-
|
|
3100
|
+
ot(w ? xt : [], x.current);
|
|
3103
3101
|
}
|
|
3104
3102
|
});
|
|
3105
3103
|
$(() => {
|
|
3106
|
-
|
|
3107
|
-
}, [
|
|
3108
|
-
if (
|
|
3104
|
+
w && ge(J, !1, !0);
|
|
3105
|
+
}, [w]), $(() => {
|
|
3106
|
+
if (w) {
|
|
3109
3107
|
if (X.current === J) return;
|
|
3110
3108
|
ge(J, !1, !0);
|
|
3111
3109
|
}
|
|
3112
|
-
}, [J]),
|
|
3113
|
-
const me =
|
|
3110
|
+
}, [J]), dc(w, h, J);
|
|
3111
|
+
const me = Zi(R), _e = sc(w, r, s);
|
|
3114
3112
|
$(() => {
|
|
3115
3113
|
var Z;
|
|
3116
|
-
|
|
3117
|
-
}, [
|
|
3114
|
+
k(be, (Z = ee == null ? void 0 : ee.isFocusing) != null ? Z : !0);
|
|
3115
|
+
}, [k, be]), Yo(w, p, R), Lt(() => {
|
|
3118
3116
|
let Z;
|
|
3119
3117
|
if (U.current) {
|
|
3120
3118
|
Z = F.register({
|
|
3121
|
-
autofocus:
|
|
3119
|
+
autofocus: b,
|
|
3122
3120
|
editorUnitId: B,
|
|
3123
3121
|
initialSnapshot: {
|
|
3124
3122
|
id: B,
|
|
@@ -3134,48 +3132,48 @@ const vc = (e) => e.startsWith(ir.EQUALS) ? e.slice(1) : "", zn = () => {
|
|
|
3134
3132
|
}
|
|
3135
3133
|
}, U.current);
|
|
3136
3134
|
const oe = F.getEditor(B);
|
|
3137
|
-
|
|
3135
|
+
x.current = oe, ge(o, !1, !0);
|
|
3138
3136
|
}
|
|
3139
3137
|
return () => {
|
|
3140
3138
|
Z == null || Z.dispose();
|
|
3141
3139
|
};
|
|
3142
3140
|
}, []), Lt(() => {
|
|
3143
|
-
c ? (D(c), me()) : (C && (
|
|
3144
|
-
}, [c,
|
|
3145
|
-
const { checkScrollBar: Tt } =
|
|
3146
|
-
|
|
3147
|
-
const Xt = te((Z, oe,
|
|
3141
|
+
c ? (D(c), me()) : (C && (R == null || R.blur(), _e()), D(c));
|
|
3142
|
+
}, [c, R, me, _e, C]);
|
|
3143
|
+
const { checkScrollBar: Tt } = Go(R, I, _);
|
|
3144
|
+
oc(w, !!(be && Ae), r, B, y), rc(!!(w && ae && a), fe, R, v);
|
|
3145
|
+
const Xt = te((Z, oe, Fe) => {
|
|
3148
3146
|
if (!ae)
|
|
3149
3147
|
return;
|
|
3150
3148
|
const Oe = oe !== -1 ? [{ startOffset: oe + 1, endOffset: oe + 1, collapsed: !0 }] : void 0;
|
|
3151
|
-
ge(`=${Z}`, !0,
|
|
3152
|
-
const Nt = { startOffset: oe + 1, endOffset: oe + 1 },
|
|
3153
|
-
|
|
3149
|
+
ge(`=${Z}`, !0, Fe, Oe), Fe && (me(), oe !== -1 && setTimeout(() => {
|
|
3150
|
+
const Nt = { startOffset: oe + 1, endOffset: oe + 1 }, De = R == null ? void 0 : R.render.with(Zo);
|
|
3151
|
+
De == null || De.scrollToRange({ ...Nt, collapsed: !0 });
|
|
3154
3152
|
}, 50), Tt());
|
|
3155
3153
|
});
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3154
|
+
lc(
|
|
3155
|
+
w && !!(be && Ae),
|
|
3156
|
+
w,
|
|
3159
3157
|
Y,
|
|
3160
3158
|
r,
|
|
3161
3159
|
s,
|
|
3162
3160
|
G,
|
|
3163
3161
|
i,
|
|
3164
3162
|
!!fe,
|
|
3165
|
-
|
|
3163
|
+
R,
|
|
3166
3164
|
Xt
|
|
3167
|
-
),
|
|
3168
|
-
ge(
|
|
3165
|
+
), uc(w && !!(be && Ae), r, i, D, g, () => {
|
|
3166
|
+
ge(nt.current, !1, !0);
|
|
3169
3167
|
});
|
|
3170
3168
|
const Ot = (Z) => {
|
|
3171
3169
|
if (Z) {
|
|
3172
|
-
const oe =
|
|
3170
|
+
const oe = R == null ? void 0 : R.getSelectionRanges();
|
|
3173
3171
|
if (oe && oe.length === 1) {
|
|
3174
|
-
const
|
|
3175
|
-
if (
|
|
3172
|
+
const Fe = oe[0];
|
|
3173
|
+
if (Fe.collapsed) {
|
|
3176
3174
|
const Oe = Z.offset;
|
|
3177
3175
|
setTimeout(() => {
|
|
3178
|
-
|
|
3176
|
+
R == null || R.setSelectionRanges([{ startOffset: Fe.startOffset - Oe, endOffset: Fe.endOffset - Oe }]);
|
|
3179
3177
|
}, 30);
|
|
3180
3178
|
}
|
|
3181
3179
|
}
|
|
@@ -3184,16 +3182,16 @@ const vc = (e) => e.startsWith(ir.EQUALS) ? e.slice(1) : "", zn = () => {
|
|
|
3184
3182
|
}, In = () => {
|
|
3185
3183
|
D(!0), l(), me();
|
|
3186
3184
|
};
|
|
3187
|
-
return /* @__PURE__ */ W("div", { className:
|
|
3188
|
-
/* @__PURE__ */
|
|
3185
|
+
return /* @__PURE__ */ W("div", { className: d, children: [
|
|
3186
|
+
/* @__PURE__ */ M(
|
|
3189
3187
|
"div",
|
|
3190
3188
|
{
|
|
3191
|
-
ref:
|
|
3189
|
+
ref: O,
|
|
3192
3190
|
className: re("univer-relative univer-box-border univer-flex univer-h-full univer-w-full univer-items-center univer-justify-around univer-gap-2 univer-rounded-none univer-p-0 univer-ring-1", {
|
|
3193
|
-
"univer-ring-primary-500":
|
|
3191
|
+
"univer-ring-primary-500": w,
|
|
3194
3192
|
"univer-ring-red-500": ie
|
|
3195
3193
|
}),
|
|
3196
|
-
children: /* @__PURE__ */
|
|
3194
|
+
children: /* @__PURE__ */ M(
|
|
3197
3195
|
"div",
|
|
3198
3196
|
{
|
|
3199
3197
|
ref: U,
|
|
@@ -3203,38 +3201,38 @@ const vc = (e) => e.startsWith(ir.EQUALS) ? e.slice(1) : "", zn = () => {
|
|
|
3203
3201
|
)
|
|
3204
3202
|
}
|
|
3205
3203
|
),
|
|
3206
|
-
n !== void 0 && /* @__PURE__ */
|
|
3207
|
-
|
|
3208
|
-
|
|
3204
|
+
n !== void 0 && /* @__PURE__ */ M("div", { className: "univer-my-1 univer-text-xs univer-text-red-500", children: n }),
|
|
3205
|
+
R && rt !== "" && /* @__PURE__ */ M(
|
|
3206
|
+
Gi,
|
|
3209
3207
|
{
|
|
3210
|
-
editor:
|
|
3211
|
-
isFocus:
|
|
3208
|
+
editor: R,
|
|
3209
|
+
isFocus: w,
|
|
3212
3210
|
formulaText: J,
|
|
3213
3211
|
onClose: () => me()
|
|
3214
3212
|
}
|
|
3215
3213
|
),
|
|
3216
|
-
!!
|
|
3217
|
-
|
|
3214
|
+
!!R && /* @__PURE__ */ M(
|
|
3215
|
+
gc,
|
|
3218
3216
|
{
|
|
3219
|
-
isFocus:
|
|
3217
|
+
isFocus: w,
|
|
3220
3218
|
sequenceNodes: yt,
|
|
3221
3219
|
onSelect: Ot,
|
|
3222
|
-
ref:
|
|
3223
|
-
editor:
|
|
3220
|
+
ref: E,
|
|
3221
|
+
editor: R
|
|
3224
3222
|
}
|
|
3225
3223
|
)
|
|
3226
3224
|
] });
|
|
3227
3225
|
});
|
|
3228
|
-
function
|
|
3229
|
-
const r = T(Ie), s =
|
|
3226
|
+
function Sc(e, t, n, o) {
|
|
3227
|
+
const r = T(Ie), s = Lr(""), c = Ce(e == null ? void 0 : e.getDocumentDataModel().change$), [i, l] = V([]), g = T(To), m = z(""), h = T(ne);
|
|
3230
3228
|
return $(() => {
|
|
3231
3229
|
if (!e) return;
|
|
3232
|
-
const
|
|
3233
|
-
if (
|
|
3230
|
+
const d = e.getDocumentDataModel().getPlainText();
|
|
3231
|
+
if (m.current === d)
|
|
3234
3232
|
return;
|
|
3235
|
-
|
|
3236
|
-
const
|
|
3237
|
-
l(
|
|
3233
|
+
m.current = d;
|
|
3234
|
+
const u = r.sequenceNodesBuilder(d);
|
|
3235
|
+
l(u != null ? u : []);
|
|
3238
3236
|
}, [c, e, r]), $(() => {
|
|
3239
3237
|
var a, S;
|
|
3240
3238
|
if (!e) return;
|
|
@@ -3250,58 +3248,58 @@ function Cc(e, t, n, o) {
|
|
|
3250
3248
|
});
|
|
3251
3249
|
return;
|
|
3252
3250
|
}
|
|
3253
|
-
const
|
|
3254
|
-
return
|
|
3255
|
-
const v = ht(p.token), C =
|
|
3251
|
+
const d = s(e, i, !1), u = new je();
|
|
3252
|
+
return d.forEach((p) => {
|
|
3253
|
+
const v = ht(p.token), C = h.getCurrentUnitForType(H.UNIVER_SHEET), _ = C == null ? void 0 : C.getActiveSheet();
|
|
3256
3254
|
if (!v.sheetName && o !== (_ == null ? void 0 : _.getSheetId()) || v.sheetName && (_ == null ? void 0 : _.getName()) !== v.sheetName)
|
|
3257
3255
|
return;
|
|
3258
|
-
const
|
|
3256
|
+
const I = new hn(p.themeColor).toRgb(), f = g.addShape({
|
|
3259
3257
|
range: v.range,
|
|
3260
3258
|
style: {
|
|
3261
3259
|
stroke: p.themeColor,
|
|
3262
|
-
fill: `rgba(${
|
|
3260
|
+
fill: `rgba(${I.r}, ${I.g}, ${I.b}, 0.1)`,
|
|
3263
3261
|
strokeDash: 12
|
|
3264
3262
|
},
|
|
3265
3263
|
primary: null
|
|
3266
3264
|
});
|
|
3267
|
-
|
|
3265
|
+
f && u.add(() => g.removeShape(f));
|
|
3268
3266
|
}), () => {
|
|
3269
|
-
|
|
3267
|
+
u.dispose();
|
|
3270
3268
|
};
|
|
3271
|
-
}, [e, t, s,
|
|
3272
|
-
}
|
|
3273
|
-
function
|
|
3274
|
-
const t = T(mn), { supportAcrossSheet: n = !1,
|
|
3275
|
-
const u =
|
|
3276
|
-
if (!u || !n && u.getSheetId() !==
|
|
3277
|
-
const
|
|
3278
|
-
range:
|
|
3279
|
-
unitId:
|
|
3280
|
-
sheetName:
|
|
3269
|
+
}, [e, t, s, g, i]), { sequenceNodes: i };
|
|
3270
|
+
}
|
|
3271
|
+
function Cc(e) {
|
|
3272
|
+
const t = T(mn), { supportAcrossSheet: n = !1, keepSheetReference: o = !1, unitId: r, subUnitId: s, onChange: c } = e, l = T(ne).getUnit(r, H.UNIVER_SHEET), g = te(c), m = te((h, d) => {
|
|
3273
|
+
const u = l == null ? void 0 : l.getActiveSheet();
|
|
3274
|
+
if (!u || !n && u.getSheetId() !== s || !(h != null && h.length)) return;
|
|
3275
|
+
const a = o ? u.getName() : u.getSheetId() === s ? "" : u.getName(), S = h.map((p) => ({
|
|
3276
|
+
range: p.range,
|
|
3277
|
+
unitId: r,
|
|
3278
|
+
sheetName: a
|
|
3281
3279
|
}));
|
|
3282
|
-
|
|
3280
|
+
g(S, d);
|
|
3283
3281
|
});
|
|
3284
3282
|
$(() => {
|
|
3285
|
-
const h = new
|
|
3286
|
-
return h.add(t.selectionMoveStart$.subscribe((
|
|
3287
|
-
|
|
3288
|
-
})), h.add(t.selectionMoving$.subscribe((
|
|
3289
|
-
|
|
3290
|
-
})), h.add(t.selectionMoveEnd$.subscribe((
|
|
3291
|
-
|
|
3283
|
+
const h = new je();
|
|
3284
|
+
return h.add(t.selectionMoveStart$.subscribe((d) => {
|
|
3285
|
+
m(d, !0);
|
|
3286
|
+
})), h.add(t.selectionMoving$.subscribe((d) => {
|
|
3287
|
+
m(d, !1);
|
|
3288
|
+
})), h.add(t.selectionMoveEnd$.subscribe((d) => {
|
|
3289
|
+
m(d, !1);
|
|
3292
3290
|
})), () => {
|
|
3293
3291
|
h.dispose();
|
|
3294
3292
|
};
|
|
3295
|
-
}, [
|
|
3293
|
+
}, [m, t.selectionMoveEnd$, t.selectionMoveStart$, t.selectionMoving$]);
|
|
3296
3294
|
}
|
|
3297
3295
|
const Xn = (e) => !e.some((n) => {
|
|
3298
3296
|
if (typeof n == "string") {
|
|
3299
|
-
if (n !==
|
|
3297
|
+
if (n !== qe.COMMA)
|
|
3300
3298
|
return !0;
|
|
3301
3299
|
} else if (n.nodeType !== Q.REFERENCE)
|
|
3302
3300
|
return !0;
|
|
3303
3301
|
return !1;
|
|
3304
|
-
}),
|
|
3302
|
+
}), _c = (e) => {
|
|
3305
3303
|
if (e.endColumn < e.startColumn) {
|
|
3306
3304
|
const t = e.endColumn;
|
|
3307
3305
|
e.endColumn = e.startColumn, e.startColumn = t;
|
|
@@ -3312,7 +3310,7 @@ const Xn = (e) => !e.some((n) => {
|
|
|
3312
3310
|
}
|
|
3313
3311
|
return e;
|
|
3314
3312
|
};
|
|
3315
|
-
function
|
|
3313
|
+
function Rc(e) {
|
|
3316
3314
|
const {
|
|
3317
3315
|
visible: t,
|
|
3318
3316
|
initialValue: n,
|
|
@@ -3320,50 +3318,52 @@ function Ec(e) {
|
|
|
3320
3318
|
subUnitId: r,
|
|
3321
3319
|
maxRangeCount: s = 1 / 0,
|
|
3322
3320
|
supportAcrossSheet: c,
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3321
|
+
keepSheetReference: i,
|
|
3322
|
+
onConfirm: l,
|
|
3323
|
+
onClose: g,
|
|
3324
|
+
onShowBySelection: m
|
|
3325
|
+
} = e, h = T(dt), d = T(Ie), [u, a] = V([]), [S, p] = V(0), v = z(null);
|
|
3327
3326
|
$(() => {
|
|
3328
3327
|
if (t && n.length) {
|
|
3329
|
-
const
|
|
3330
|
-
|
|
3328
|
+
const f = n.map((b) => b.sheetName ? Ct(b.sheetName, b.range) : Ee(b.range));
|
|
3329
|
+
a(f), p(f.length - 1);
|
|
3331
3330
|
} else
|
|
3332
|
-
|
|
3331
|
+
a([""]), p(0);
|
|
3333
3332
|
}, [t]);
|
|
3334
|
-
const
|
|
3335
|
-
const
|
|
3336
|
-
|
|
3337
|
-
},
|
|
3338
|
-
|
|
3339
|
-
},
|
|
3340
|
-
u.splice(
|
|
3333
|
+
const C = (f, b) => {
|
|
3334
|
+
const y = [...u];
|
|
3335
|
+
y[f] = b, a(y);
|
|
3336
|
+
}, _ = () => {
|
|
3337
|
+
a([...u, ""]), p(u.length);
|
|
3338
|
+
}, I = (f) => {
|
|
3339
|
+
u.splice(f, 1), a([...u]);
|
|
3341
3340
|
};
|
|
3342
|
-
return
|
|
3341
|
+
return Cc({
|
|
3343
3342
|
unitId: o,
|
|
3344
3343
|
subUnitId: r,
|
|
3345
3344
|
supportAcrossSheet: c,
|
|
3346
|
-
|
|
3347
|
-
|
|
3345
|
+
keepSheetReference: i,
|
|
3346
|
+
onChange: (f, b) => {
|
|
3347
|
+
if (!t && m != null && m(f))
|
|
3348
3348
|
return;
|
|
3349
|
-
const
|
|
3350
|
-
if (!
|
|
3351
|
-
const
|
|
3352
|
-
if (
|
|
3353
|
-
|
|
3354
|
-
const
|
|
3355
|
-
|
|
3349
|
+
const y = new Set(u), A = f.map((N) => N.sheetName ? Ct(N.sheetName, N.range) : Ee(N.range)), F = A.filter((N) => !y.has(N));
|
|
3350
|
+
if (!F.length) return;
|
|
3351
|
+
const O = [...u];
|
|
3352
|
+
if (A.length > 1) {
|
|
3353
|
+
b || O.splice(S, 1), O.push(...F);
|
|
3354
|
+
const N = O.slice(0, s);
|
|
3355
|
+
a(N), p(N.length - 1), requestAnimationFrame(() => {
|
|
3356
3356
|
var k;
|
|
3357
|
-
(k =
|
|
3357
|
+
(k = v.current) == null || k.scrollTo({ top: v.current.scrollHeight });
|
|
3358
3358
|
});
|
|
3359
3359
|
} else {
|
|
3360
|
-
|
|
3361
|
-
const
|
|
3362
|
-
|
|
3360
|
+
O.splice(S, 1, ...F);
|
|
3361
|
+
const N = O.slice(0, s);
|
|
3362
|
+
a(N), p(S + F.length - 1);
|
|
3363
3363
|
}
|
|
3364
3364
|
}
|
|
3365
|
-
}), /* @__PURE__ */
|
|
3366
|
-
|
|
3365
|
+
}), /* @__PURE__ */ M(
|
|
3366
|
+
Rs,
|
|
3367
3367
|
{
|
|
3368
3368
|
width: "328px",
|
|
3369
3369
|
open: t,
|
|
@@ -3372,61 +3372,61 @@ function Ec(e) {
|
|
|
3372
3372
|
mask: !1,
|
|
3373
3373
|
maskClosable: !1,
|
|
3374
3374
|
footer: /* @__PURE__ */ W("footer", { className: "univer-flex univer-gap-2", children: [
|
|
3375
|
-
/* @__PURE__ */
|
|
3376
|
-
/* @__PURE__ */
|
|
3377
|
-
|
|
3375
|
+
/* @__PURE__ */ M(ct, { onClick: g, children: h.t("rangeSelector.cancel") }),
|
|
3376
|
+
/* @__PURE__ */ M(
|
|
3377
|
+
ct,
|
|
3378
3378
|
{
|
|
3379
3379
|
variant: "primary",
|
|
3380
3380
|
onClick: () => {
|
|
3381
|
-
|
|
3382
|
-
u.filter((
|
|
3383
|
-
const
|
|
3384
|
-
return
|
|
3385
|
-
}).map((
|
|
3381
|
+
l(
|
|
3382
|
+
u.filter((f) => {
|
|
3383
|
+
const b = d.sequenceNodesBuilder(f);
|
|
3384
|
+
return b && b.length === 1 && typeof b[0] != "string" && b[0].nodeType === Q.REFERENCE;
|
|
3385
|
+
}).map((f) => ht(f)).map((f) => ({ ...f, range: _c(f.range) }))
|
|
3386
3386
|
);
|
|
3387
3387
|
},
|
|
3388
3388
|
children: h.t("rangeSelector.confirm")
|
|
3389
3389
|
}
|
|
3390
3390
|
)
|
|
3391
3391
|
] }),
|
|
3392
|
-
onClose:
|
|
3392
|
+
onClose: g,
|
|
3393
3393
|
children: /* @__PURE__ */ W(
|
|
3394
3394
|
"div",
|
|
3395
3395
|
{
|
|
3396
|
-
ref:
|
|
3396
|
+
ref: v,
|
|
3397
3397
|
className: re("-univer-mx-6 univer-max-h-60 univer-overflow-y-auto univer-px-6", lt),
|
|
3398
3398
|
children: [
|
|
3399
|
-
u.map((
|
|
3399
|
+
u.map((f, b) => /* @__PURE__ */ W(
|
|
3400
3400
|
"div",
|
|
3401
3401
|
{
|
|
3402
3402
|
className: "univer-mb-2 univer-flex univer-items-center univer-gap-4",
|
|
3403
3403
|
children: [
|
|
3404
|
-
/* @__PURE__ */
|
|
3405
|
-
|
|
3404
|
+
/* @__PURE__ */ M(
|
|
3405
|
+
vr,
|
|
3406
3406
|
{
|
|
3407
3407
|
className: re("univer-w-full", {
|
|
3408
|
-
"univer-border-primary-600":
|
|
3408
|
+
"univer-border-primary-600": S === b
|
|
3409
3409
|
}),
|
|
3410
3410
|
placeholder: h.t("rangeSelector.placeHolder"),
|
|
3411
|
-
onFocus: () =>
|
|
3412
|
-
value:
|
|
3413
|
-
onChange: (
|
|
3411
|
+
onFocus: () => p(b),
|
|
3412
|
+
value: f,
|
|
3413
|
+
onChange: (y) => C(b, y)
|
|
3414
3414
|
}
|
|
3415
3415
|
),
|
|
3416
|
-
u.length > 1 && /* @__PURE__ */
|
|
3417
|
-
|
|
3416
|
+
u.length > 1 && /* @__PURE__ */ M(
|
|
3417
|
+
Nr,
|
|
3418
3418
|
{
|
|
3419
3419
|
className: "univer-cursor-pointer",
|
|
3420
|
-
onClick: () =>
|
|
3420
|
+
onClick: () => I(b)
|
|
3421
3421
|
}
|
|
3422
3422
|
)
|
|
3423
3423
|
]
|
|
3424
3424
|
},
|
|
3425
|
-
|
|
3425
|
+
b
|
|
3426
3426
|
)),
|
|
3427
|
-
u.length < s && /* @__PURE__ */
|
|
3428
|
-
/* @__PURE__ */
|
|
3429
|
-
/* @__PURE__ */
|
|
3427
|
+
u.length < s && /* @__PURE__ */ M("div", { children: /* @__PURE__ */ W(ct, { variant: "link", onClick: _, children: [
|
|
3428
|
+
/* @__PURE__ */ M(xr, {}),
|
|
3429
|
+
/* @__PURE__ */ M("span", { children: h.t("rangeSelector.addAnotherRange") })
|
|
3430
3430
|
] }) })
|
|
3431
3431
|
]
|
|
3432
3432
|
}
|
|
@@ -3434,13 +3434,13 @@ function Ec(e) {
|
|
|
3434
3434
|
}
|
|
3435
3435
|
);
|
|
3436
3436
|
}
|
|
3437
|
-
function
|
|
3438
|
-
return e.split(
|
|
3437
|
+
function Ec(e) {
|
|
3438
|
+
return e.split(qe.COMMA).filter((t) => !!t).map((t) => ht(t));
|
|
3439
3439
|
}
|
|
3440
|
-
function
|
|
3441
|
-
return e.map((t) => t.sheetName ? Ct(t.sheetName, t.range) : Ee(t.range)).join(
|
|
3440
|
+
function Ic(e) {
|
|
3441
|
+
return e.map((t) => t.sheetName ? Ct(t.sheetName, t.range) : Ee(t.range)).join(qe.COMMA);
|
|
3442
3442
|
}
|
|
3443
|
-
function
|
|
3443
|
+
function $r(e) {
|
|
3444
3444
|
const [t, n] = V(null), {
|
|
3445
3445
|
onVerify: o,
|
|
3446
3446
|
selectorRef: r,
|
|
@@ -3448,19 +3448,20 @@ function Lr(e) {
|
|
|
3448
3448
|
subUnitId: c,
|
|
3449
3449
|
maxRangeCount: i,
|
|
3450
3450
|
supportAcrossSheet: l,
|
|
3451
|
-
|
|
3451
|
+
keepSheetReference: g,
|
|
3452
|
+
autoFocus: m,
|
|
3452
3453
|
onChange: h,
|
|
3453
|
-
onRangeSelectorDialogVisibleChange:
|
|
3454
|
+
onRangeSelectorDialogVisibleChange: d,
|
|
3454
3455
|
onClickOutside: u,
|
|
3455
|
-
onFocusChange:
|
|
3456
|
-
forceShowDialogWhenSelectionChanged:
|
|
3457
|
-
hideEditor:
|
|
3458
|
-
resetRange:
|
|
3459
|
-
} = e, [
|
|
3460
|
-
t == null || t.setSelectionRanges([]), t == null || t.blur(),
|
|
3461
|
-
}),
|
|
3462
|
-
var
|
|
3463
|
-
|
|
3456
|
+
onFocusChange: a,
|
|
3457
|
+
forceShowDialogWhenSelectionChanged: S,
|
|
3458
|
+
hideEditor: p,
|
|
3459
|
+
resetRange: v
|
|
3460
|
+
} = e, [C, _] = V(m != null ? m : !1), [I, f] = V(!1), [b, y] = V([]), A = T(dt), F = T(Ye), { sequenceNodes: O } = Sc(t, C, s, c), N = tt(O), k = T(ve), E = te(() => {
|
|
3461
|
+
t == null || t.setSelectionRanges([]), t == null || t.blur(), F.blur();
|
|
3462
|
+
}), x = te(() => {
|
|
3463
|
+
var R;
|
|
3464
|
+
E(), y(Ec((R = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? R : "")), f(!0);
|
|
3464
3465
|
});
|
|
3465
3466
|
return $(() => {
|
|
3466
3467
|
r && (r.current = {
|
|
@@ -3468,84 +3469,85 @@ function Lr(e) {
|
|
|
3468
3469
|
return t;
|
|
3469
3470
|
},
|
|
3470
3471
|
focus() {
|
|
3471
|
-
|
|
3472
|
+
F.focus(t.getEditorId());
|
|
3472
3473
|
},
|
|
3473
|
-
blur:
|
|
3474
|
-
verify: () => Xn(
|
|
3475
|
-
showDialog: (
|
|
3476
|
-
|
|
3474
|
+
blur: E,
|
|
3475
|
+
verify: () => Xn(N.current),
|
|
3476
|
+
showDialog: (R) => {
|
|
3477
|
+
E(), y(R), f(!0);
|
|
3477
3478
|
},
|
|
3478
3479
|
hideDialog: () => {
|
|
3479
|
-
|
|
3480
|
+
y([]), f(!1);
|
|
3480
3481
|
},
|
|
3481
3482
|
getValue: () => {
|
|
3482
|
-
var
|
|
3483
|
-
return (
|
|
3483
|
+
var R;
|
|
3484
|
+
return (R = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? R : "";
|
|
3484
3485
|
}
|
|
3485
3486
|
});
|
|
3486
|
-
}, [
|
|
3487
|
-
var
|
|
3488
|
-
o == null || o(Xn(
|
|
3489
|
-
}, [
|
|
3490
|
-
|
|
3491
|
-
}, [
|
|
3492
|
-
if (
|
|
3487
|
+
}, [E, t, F, r, N]), $(() => {
|
|
3488
|
+
var R;
|
|
3489
|
+
o == null || o(Xn(O), (R = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? R : "");
|
|
3490
|
+
}, [O]), $(() => {
|
|
3491
|
+
d == null || d(I);
|
|
3492
|
+
}, [I]), $(() => {
|
|
3493
|
+
if (I && v)
|
|
3493
3494
|
return () => {
|
|
3494
|
-
const
|
|
3495
|
+
const R = {
|
|
3495
3496
|
unitId: s,
|
|
3496
3497
|
subUnitId: c,
|
|
3497
|
-
selections:
|
|
3498
|
+
selections: v
|
|
3498
3499
|
};
|
|
3499
|
-
k.executeCommand(pn.id,
|
|
3500
|
+
k.executeCommand(pn.id, R);
|
|
3500
3501
|
};
|
|
3501
|
-
}, [
|
|
3502
|
-
|
|
3503
|
-
|
|
3502
|
+
}, [I]), /* @__PURE__ */ W(ms, { children: [
|
|
3503
|
+
p ? null : /* @__PURE__ */ M(
|
|
3504
|
+
zo,
|
|
3504
3505
|
{
|
|
3505
3506
|
isSingle: !0,
|
|
3506
3507
|
...e,
|
|
3507
|
-
onFocusChange: (
|
|
3508
|
-
|
|
3508
|
+
onFocusChange: (R, w) => {
|
|
3509
|
+
_(R), a == null || a(R, w);
|
|
3509
3510
|
},
|
|
3510
3511
|
editorRef: n,
|
|
3511
3512
|
onClickOutside: () => {
|
|
3512
|
-
|
|
3513
|
+
_(!1), E(), u == null || u();
|
|
3513
3514
|
},
|
|
3514
|
-
icon: /* @__PURE__ */
|
|
3515
|
-
|
|
3515
|
+
icon: /* @__PURE__ */ M(_s, { title: A.t("rangeSelector.buttonTooltip"), placement: "bottom", children: /* @__PURE__ */ M(
|
|
3516
|
+
wr,
|
|
3516
3517
|
{
|
|
3517
3518
|
className: "univer-cursor-pointer dark:!univer-text-gray-300",
|
|
3518
|
-
onClick:
|
|
3519
|
+
onClick: x
|
|
3519
3520
|
}
|
|
3520
3521
|
) })
|
|
3521
3522
|
}
|
|
3522
3523
|
),
|
|
3523
|
-
/* @__PURE__ */
|
|
3524
|
-
|
|
3524
|
+
/* @__PURE__ */ M(
|
|
3525
|
+
Rc,
|
|
3525
3526
|
{
|
|
3526
|
-
initialValue:
|
|
3527
|
+
initialValue: b,
|
|
3527
3528
|
unitId: s,
|
|
3528
3529
|
subUnitId: c,
|
|
3529
|
-
visible:
|
|
3530
|
+
visible: I,
|
|
3530
3531
|
maxRangeCount: i,
|
|
3531
|
-
onConfirm: (
|
|
3532
|
-
const
|
|
3533
|
-
|
|
3534
|
-
|
|
3532
|
+
onConfirm: (R) => {
|
|
3533
|
+
const w = Ic(R), D = no.newEmptyData();
|
|
3534
|
+
D.body.dataStream = w, t == null || t.replaceText(w, !1), h == null || h(D, w), f(!1), y([]), requestAnimationFrame(() => {
|
|
3535
|
+
E();
|
|
3535
3536
|
});
|
|
3536
3537
|
},
|
|
3537
3538
|
onClose: () => {
|
|
3538
|
-
|
|
3539
|
+
f(!1), y([]);
|
|
3539
3540
|
},
|
|
3540
3541
|
supportAcrossSheet: l,
|
|
3541
|
-
|
|
3542
|
+
keepSheetReference: g,
|
|
3543
|
+
onShowBySelection: (R) => C || S ? (y(R), f(!0), !1) : !0
|
|
3542
3544
|
}
|
|
3543
3545
|
)
|
|
3544
3546
|
] });
|
|
3545
3547
|
}
|
|
3546
|
-
const
|
|
3548
|
+
const bc = () => {
|
|
3547
3549
|
var o, r;
|
|
3548
|
-
const e = T(
|
|
3550
|
+
const e = T(kr), t = Ce(e.currentSelector$), n = z(null);
|
|
3549
3551
|
return $(() => {
|
|
3550
3552
|
var s, c;
|
|
3551
3553
|
if (t)
|
|
@@ -3553,8 +3555,8 @@ const yc = () => {
|
|
|
3553
3555
|
var i;
|
|
3554
3556
|
(i = n.current) == null || i.hideDialog();
|
|
3555
3557
|
};
|
|
3556
|
-
}, [t]), /* @__PURE__ */
|
|
3557
|
-
|
|
3558
|
+
}, [t]), /* @__PURE__ */ M(
|
|
3559
|
+
$r,
|
|
3558
3560
|
{
|
|
3559
3561
|
unitId: (o = t == null ? void 0 : t.unitId) != null ? o : "",
|
|
3560
3562
|
subUnitId: (r = t == null ? void 0 : t.subUnitId) != null ? r : "",
|
|
@@ -3567,24 +3569,24 @@ const yc = () => {
|
|
|
3567
3569
|
}
|
|
3568
3570
|
);
|
|
3569
3571
|
};
|
|
3570
|
-
var
|
|
3571
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
3572
|
+
var yc = Object.defineProperty, Tc = Object.getOwnPropertyDescriptor, Oc = (e, t, n) => t in e ? yc(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Nc = (e, t, n, o) => {
|
|
3573
|
+
for (var r = o > 1 ? void 0 : o ? Tc(t, n) : t, s = e.length - 1, c; s >= 0; s--)
|
|
3572
3574
|
(c = e[s]) && (r = c(r) || r);
|
|
3573
3575
|
return r;
|
|
3574
|
-
}, At = (e, t) => (n, o) => t(n, o, e),
|
|
3575
|
-
let Bt = class extends
|
|
3576
|
+
}, At = (e, t) => (n, o) => t(n, o, e), Pr = (e, t, n) => Oc(e, typeof t != "symbol" ? t + "" : t, n);
|
|
3577
|
+
let Bt = class extends so {
|
|
3576
3578
|
constructor(e = Kn, t, n, o, r) {
|
|
3577
3579
|
super(), this._config = e, this._injector = t, this._renderManagerService = n, this._configService = o, this._uiPartsService = r;
|
|
3578
|
-
const { menu: s, ...c } =
|
|
3580
|
+
const { menu: s, ...c } = io(
|
|
3579
3581
|
Kn,
|
|
3580
3582
|
this._config
|
|
3581
3583
|
);
|
|
3582
|
-
s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(
|
|
3584
|
+
s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig($s, c, { merge: !0 });
|
|
3583
3585
|
}
|
|
3584
3586
|
onStarting() {
|
|
3585
|
-
|
|
3587
|
+
co(this._injector, [
|
|
3586
3588
|
[Zt, { useClass: sn }],
|
|
3587
|
-
[
|
|
3589
|
+
[kr],
|
|
3588
3590
|
[Ht],
|
|
3589
3591
|
[Pt],
|
|
3590
3592
|
[Ut],
|
|
@@ -3605,7 +3607,7 @@ let Bt = class extends oo {
|
|
|
3605
3607
|
[cn]
|
|
3606
3608
|
].forEach((e) => {
|
|
3607
3609
|
this.disposeWithMe(this._renderManagerService.registerRenderModule(H.UNIVER_SHEET, e));
|
|
3608
|
-
}),
|
|
3610
|
+
}), ao(this._injector, [
|
|
3609
3611
|
[Ht],
|
|
3610
3612
|
// FormulaProgressBar relies on TriggerCalculationController, but it is necessary to ensure that the formula calculation is done after rendered.
|
|
3611
3613
|
[Ut],
|
|
@@ -3616,31 +3618,31 @@ let Bt = class extends oo {
|
|
|
3616
3618
|
this._injector.get(Pt), this._injector.get($t);
|
|
3617
3619
|
}
|
|
3618
3620
|
_initUIPart() {
|
|
3619
|
-
const e = this._injector.get(
|
|
3620
|
-
this.disposeWithMe(e.register(
|
|
3621
|
+
const e = this._injector.get(mr);
|
|
3622
|
+
this.disposeWithMe(e.register(Oo, $r)), this.disposeWithMe(e.register(No, vc)), this.disposeWithMe(this._uiPartsService.registerComponent(gs.GLOBAL, () => pr(bc, this._injector)));
|
|
3621
3623
|
}
|
|
3622
3624
|
};
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
Bt =
|
|
3626
|
-
|
|
3625
|
+
Pr(Bt, "pluginName", Cr);
|
|
3626
|
+
Pr(Bt, "type", H.UNIVER_SHEET);
|
|
3627
|
+
Bt = Nc([
|
|
3628
|
+
ro(Po, as),
|
|
3627
3629
|
At(1, j(Rt)),
|
|
3628
|
-
At(2,
|
|
3629
|
-
At(3,
|
|
3630
|
-
At(4,
|
|
3630
|
+
At(2, we),
|
|
3631
|
+
At(3, oo),
|
|
3632
|
+
At(4, gr)
|
|
3631
3633
|
], Bt);
|
|
3632
3634
|
export {
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
+
Ts as FORMULA_PROMPT_ACTIVATED,
|
|
3636
|
+
vc as FormulaEditor,
|
|
3635
3637
|
$t as FormulaReorderController,
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
+
kr as GlobalRangeSelectorService,
|
|
3639
|
+
Os as HelpFunctionOperation,
|
|
3638
3640
|
Se as InsertFunctionOperation,
|
|
3639
3641
|
Rn as MoreFunctionsOperation,
|
|
3640
|
-
|
|
3642
|
+
$r as RangeSelector,
|
|
3641
3643
|
Pe as RefSelectionsRenderService,
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
+
Rr as ReferenceAbsoluteOperation,
|
|
3645
|
+
Fs as SearchFunctionOperation,
|
|
3644
3646
|
gt as SelectEditorFormulaOperation,
|
|
3645
3647
|
_n as SheetOnlyPasteFormulaCommand,
|
|
3646
3648
|
Bt as UniverSheetsFormulaUIPlugin
|