@univerjs/sheets-ui 0.6.5 → 0.6.6-nightly.202503141606
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 +9 -9
- package/lib/es/index.js +231 -230
- package/lib/umd/index.js +5 -5
- package/package.json +12 -12
- package/LICENSE +0 -176
package/lib/es/index.js
CHANGED
|
@@ -2,12 +2,12 @@ var bp = Object.defineProperty;
|
|
|
2
2
|
var _p = (r, e, t) => e in r ? bp(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var _ = (r, e, t) => _p(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import { DOCS_VIEW_KEY as wp, IEditorService as kr, getCanvasOffsetByEngine as cu, VIEWPORT_KEY as Ms, DOCS_COMPONENT_MAIN_LAYER_INDEX as Rp, BreakLineCommand as Ip, DeleteLeftCommand as yp, DocSelectionRenderService as _r, ReplaceSnapshotCommand as Vh, MoveSelectionOperation as Mp, MoveCursorOperation as Ep, SetInlineFormatBoldCommand as Pp, SetInlineFormatItalicCommand as Tp, SetInlineFormatUnderlineCommand as Op, SetInlineFormatStrikethroughCommand as xp, SetInlineFormatSubscriptCommand as Ap, SetInlineFormatSuperscriptCommand as kp, SetInlineFormatFontSizeCommand as Hp, SetInlineFormatFontFamilyCommand as Vp, SetInlineFormatTextColorCommand as Nh, SetInlineFormatCommand as ko, NodePositionConvertToCursor as Dh, getLineBounding as Lh, DOC_VERTICAL_PADDING as Np, IMEInputCommand as Dp, InsertCommand as Lp, CoverContentCommand as Wp, IRangeSelectorService as Bp } from "@univerjs/docs-ui";
|
|
5
|
-
import { CommandType as Q, createInterceptorKey as cr, ColorKit as Hn, RANGE_TYPE as X, convertCellToRange as Es, UniverInstanceType as x, IUniverInstanceService as N, Quantity as dc, Disposable as de, toDisposable as We, Tools as
|
|
5
|
+
import { CommandType as Q, createInterceptorKey as cr, ColorKit as Hn, RANGE_TYPE as X, convertCellToRange as Es, UniverInstanceType as x, IUniverInstanceService as N, Quantity as dc, Disposable as de, toDisposable as We, Tools as oe, createIdentifier as vn, InterceptorManager as yi, ThemeService as Lt, Inject as V, Injector as It, IConfigService as Fn, ObjectMatrix as Je, Direction as W, isFormulaString as od, isFormulaId as Fp, CellValueType as jt, numfmt as Vn, ICommandService as D, IUndoRedoService as qt, Rectangle as he, sequenceExecute as yl, IContextService as He, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Le, EDITOR_ACTIVATED as $e, FOCUSING_EDITOR_STANDALONE as Ml, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as De, Workbook as Up, Optional as sd, FOCUSING_SHEET as kt, RxDisposable as Un, DisposableCollection as bt, IPermissionService as ot, fromEventSubject as Wh, sortRules as zp, LocaleService as Ae, getReverseDirection as Bh, FOCUSING_FX_BAR_EDITOR as At, BooleanNumber as Ke, nameCharacterCheck as Xp, debounce as uc, VerticalAlign as dn, HorizontalAlign as yt, WrapStrategy as wr, FOCUSING_UNIVER_EDITOR as Hr, FOCUSING_COMMON_DRAWINGS as El, FOCUSING_EDITOR_INPUT_FORMULA as Ps, LocaleType as du, FOCUSING_EDITOR_BUT_HIDDEN as hc, generateRandomId as ld, DEFAULT_EMPTY_DOCUMENT_VALUE as Fh, LRUMap as jp, BaselineOffset as uu, DataStreamTreeTokenType as Yp, skipParseTagNames as Zp, CustomRangeType as ad, DEFAULT_WORKSHEET_ROW_HEIGHT as gc, ILogService as Pl, ErrorService as Gp, CellModeEnum as Uh, isNotNullOrUndefined as qp, extractPureTextFromCell as zh, UserManagerService as Wt, DEFAULT_STYLES as cd, FontWeight as ts, FontItalic as ns, Dimension as Xh, BorderStyleTypes as Oe, AbsoluteRefType as hu, NilCommand as dd, UndoCommandId as Qp, Range as Ss, cellToRange as Kp, handleStyleToString as gu, convertBodyToHtml as Jp, DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY as mu, DEFAULT_WORKSHEET_COLUMN_WIDTH as fu, PresetListType as $p, isRealNum as jh, InterceptorEffectEnum as eS, splitIntoGrid as tS, IAuthzIoService as Tl, isValidRange as nS, DependentOn as Yh, Plugin as Zh, DocumentFlavor as rS, merge as iS, registerDependencies as pu, mergeOverrideWithDependencies as oS, touchDependencies as Sa } from "@univerjs/core";
|
|
6
6
|
import { IRenderManagerService as be, withCurrentTypeOfRenderer as ud, SHEET_VIEWPORT_KEY as U, CURSOR_TYPE as ye, Vector2 as ke, Rect as Ce, ScrollTimer as ri, ScrollTimerType as Pt, DashedRect as sS, Group as va, TRANSFORM_CHANGE_OBSERVABLE_TYPE as mc, cancelRequestFrame as lS, requestNewFrame as aS, FIX_ONE_PIXEL_BLUR_OFFSET as cS, Layer as dS, SpreadsheetSkeleton as uS, DeviceInputEventType as Ye, convertTransformToOffsetX as Kr, convertTransformToOffsetY as Jr, convertTextRotation as hd, RENDER_RAW_FORMULA_KEY as hS, Spreadsheet as Gh, getCurrentTypeOfRenderer as gd, RENDER_CLASS_TYPE as gS, ScrollBar as md, fixLineWidthByScale as Su, ptToPixel as vu, Shape as fd, SHEET_EXTENSION_PREFIX as Cu, SpreadsheetRowHeader as mS, SpreadsheetColumnHeader as fS, Viewport as _n, hasCJKText as pS, DEFAULT_PADDING_DATA as SS, SheetExtension as qh, RegularPolygon as Yi, precisionTo as tr } from "@univerjs/engine-render";
|
|
7
7
|
import { useDependency as L, useObservable as gt, KeyCode as Z, Slider as vS, ComponentManager as zn, DISABLE_AUTO_FOCUS_KEY as bu, useEvent as _u, useSidebarClick as Qh, MetaKeys as Te, ISidebarService as Mi, useComponentsOfPart as Kh, ComponentContainer as Jh, IConfirmService as rn, UI_PLUGIN_CONFIG_KEY as $h, UIMenu as CS, ContextMenuPosition as Rt, IMessageService as eg, IClipboardInterfaceService as Ol, IMenuManagerService as pd, ToolbarItem as bS, ILayoutService as xl, DEFAULT_BACKGROUND_COLOR_RGB as _S, DEFAULT_BACKGROUND_COLOR_RGBA as wS, handleStringToStyle as RS, textTrim as wu, INotificationService as IS, IPlatformService as yS, PLAIN_TEXT_CLIPBOARD_MIME_TYPE as Ru, HTML_CLIPBOARD_MIME_TYPE as Iu, imageMimeTypeSet as MS, FILE__BMP_CLIPBOARD_MIME_TYPE as ES, FILE__WEBP_CLIPBOARD_MIME_TYPE as PS, FILE__JPEG_CLIPBOARD_MIME_TYPE as TS, FILE_PNG_CLIPBOARD_MIME_TYPE as OS, CopyCommand as xS, CutCommand as AS, PasteCommand as kS, SheetPasteShortKeyCommandName as HS, IContextMenuService as Al, getMenuHiddenObservable as ue, MenuItemType as K, FONT_SIZE_LIST as VS, FONT_FAMILY_LIST as NS, IDialogService as Ei, ContextMenuGroup as Qe, RibbonStartGroup as Ca, IShortcutService as kl, IUIPartsService as Hl, FontFamily as tg, FontFamilyItem as ng, FontSize as rg, BuiltInUIPart as Ki, connectInjector as ii, ICanvasPopupService as DS, IZenZoneService as LS, UniverMobileUIPlugin as WS } from "@univerjs/ui";
|
|
8
8
|
import BS, { forwardRef as ft, useRef as An, createElement as ht, useState as ne, useMemo as Dt, useEffect as Pe, useCallback as Nn, useLayoutEffect as FS } from "react";
|
|
9
9
|
import { BehaviorSubject as Me, Subject as xe, of as Re, merge as _t, map as Be, startWith as Gt, switchMap as ct, takeUntil as gi, distinctUntilChanged as un, throttleTime as ig, EMPTY as yu, filter as Vl, combineLatest as dt, combineLatestWith as dr, Observable as ze, Subscription as rr, withLatestFrom as US } from "rxjs";
|
|
10
|
-
import { SELECTION_CONTROL_BORDER_BUFFER_WIDTH as Ts, SELECTION_CONTROL_BORDER_BUFFER_COLOR as rs, SELECTIONS_ENABLED as $r, REF_SELECTIONS_ENABLED as oo, SheetSkeletonService as zS, SheetsSelectionsService as $, SheetInterceptorService as Xn, SetWorksheetRowAutoHeightMutationFactory as og, SetWorksheetRowAutoHeightMutation as yr, SetRangeValuesCommand as Ho, SetWorksheetRowIsAutoHeightCommand as Nl, SetStyleCommand as XS, MoveRangeCommand as Sd, ReorderRangeCommand as jS, rangeToDiscreteRange as Ji, SetSelectionsOperation as Ee, SetRangeValuesMutation as we, getSheetCommandTarget as Ue, generateNullCellValue as YS, SetRangeValuesUndoMutationFactory as nn, IRefSelectionsService as Dl, BEFORE_CELL_EDIT as ZS, SetWorksheetActiveOperation as rt, MoveRangeMutation as sr, RemoveRowMutation as Vo, RemoveColMutation as No, InsertRowMutation as Do, InsertColMutation as Lo, MoveRowsMutation as Ll, MoveColsMutation as Wl, SetWorksheetColWidthMutation as an, SetWorksheetRowHeightMutation as so, RemoveSheetMutation as Dn, RemoveMergeUndoMutationFactory as Bl, RemoveWorksheetMergeMutation as $t, AddWorksheetMergeMutation as en, getAddMergeMutationRangeByType as Fl, AddMergeUndoMutationFactory as Ul, WorkbookEditablePermission as J, WorksheetEditPermission as te, UnitAction as lo, alignToMergedCellsBorders as xn, getSelectionsService as Wo, SelectionMoveType as Yt, getCellAtRowCol as vs, expandToContinuousRange as GS, ScrollToCellOperation as vd, SetWorksheetShowCommand as Cd, WorksheetProtectionRuleModel as pt, RangeProtectionRuleModel as et, RangeProtectionCache as Bo, WorksheetViewPermission as sg, SetWorksheetOrderMutation as bd, InsertSheetMutation as Vr, SetWorksheetNameMutation as _d, SetWorksheetHideMutation as lr, SetWorksheetActivateCommand as wd, WorkbookManageCollaboratorPermission as lg, WorkbookRenameSheetPermission as ag, SetWorksheetOrderCommand as qS, SetWorksheetNameCommand as QS, SetTabColorMutation as KS, WorkbookCreateSheetPermission as cg, InsertSheetCommand as JS, COMMAND_LISTENER_SKELETON_CHANGE as Os, adjustRangeOnMutation as $S, getPrimaryForRange as dg, SetRowHiddenCommand as ug, SetColHiddenCommand as hg, SetBoldCommand as Rd, SetItalicCommand as Id, SetUnderlineCommand as yd, SetStrikeThroughCommand as Md, SetFontSizeCommand as Ed, SetFontFamilyCommand as Pd, SetTextColorCommand as gg, SetFrozenMutationFactory as mg, SetFrozenMutation as Rr, RangeProtectionPermissionEditPoint as
|
|
10
|
+
import { SELECTION_CONTROL_BORDER_BUFFER_WIDTH as Ts, SELECTION_CONTROL_BORDER_BUFFER_COLOR as rs, SELECTIONS_ENABLED as $r, REF_SELECTIONS_ENABLED as oo, SheetSkeletonService as zS, SheetsSelectionsService as $, SheetInterceptorService as Xn, SetWorksheetRowAutoHeightMutationFactory as og, SetWorksheetRowAutoHeightMutation as yr, SetRangeValuesCommand as Ho, SetWorksheetRowIsAutoHeightCommand as Nl, SetStyleCommand as XS, MoveRangeCommand as Sd, ReorderRangeCommand as jS, rangeToDiscreteRange as Ji, SetSelectionsOperation as Ee, SetRangeValuesMutation as we, getSheetCommandTarget as Ue, generateNullCellValue as YS, SetRangeValuesUndoMutationFactory as nn, IRefSelectionsService as Dl, BEFORE_CELL_EDIT as ZS, SetWorksheetActiveOperation as rt, MoveRangeMutation as sr, RemoveRowMutation as Vo, RemoveColMutation as No, InsertRowMutation as Do, InsertColMutation as Lo, MoveRowsMutation as Ll, MoveColsMutation as Wl, SetWorksheetColWidthMutation as an, SetWorksheetRowHeightMutation as so, RemoveSheetMutation as Dn, RemoveMergeUndoMutationFactory as Bl, RemoveWorksheetMergeMutation as $t, AddWorksheetMergeMutation as en, getAddMergeMutationRangeByType as Fl, AddMergeUndoMutationFactory as Ul, WorkbookEditablePermission as J, WorksheetEditPermission as te, UnitAction as lo, alignToMergedCellsBorders as xn, getSelectionsService as Wo, SelectionMoveType as Yt, getCellAtRowCol as vs, expandToContinuousRange as GS, ScrollToCellOperation as vd, SetWorksheetShowCommand as Cd, WorksheetProtectionRuleModel as pt, RangeProtectionRuleModel as et, RangeProtectionCache as Bo, WorksheetViewPermission as sg, SetWorksheetOrderMutation as bd, InsertSheetMutation as Vr, SetWorksheetNameMutation as _d, SetWorksheetHideMutation as lr, SetWorksheetActivateCommand as wd, WorkbookManageCollaboratorPermission as lg, WorkbookRenameSheetPermission as ag, SetWorksheetOrderCommand as qS, SetWorksheetNameCommand as QS, SetTabColorMutation as KS, WorkbookCreateSheetPermission as cg, InsertSheetCommand as JS, COMMAND_LISTENER_SKELETON_CHANGE as Os, adjustRangeOnMutation as $S, getPrimaryForRange as dg, SetRowHiddenCommand as ug, SetColHiddenCommand as hg, SetBoldCommand as Rd, SetItalicCommand as Id, SetUnderlineCommand as yd, SetStrikeThroughCommand as Md, SetFontSizeCommand as Ed, SetFontFamilyCommand as Pd, SetTextColorCommand as gg, SetFrozenMutationFactory as mg, SetFrozenMutation as Rr, RangeProtectionPermissionEditPoint as ie, IExclusiveRangeService as ev, CancelFrozenCommand as Cs, WorksheetSetRowStylePermission as Nr, SetRowHeightCommand as fg, SetRowHiddenMutation as pg, SetRowVisibleMutation as Sg, SetSelectedRowsVisibleCommand as vg, WorksheetSetCellStylePermission as Ge, WorksheetSetCellValuePermission as Jt, WorksheetSetColumnStylePermission as Dr, SetColWidthCommand as Cg, SetColHiddenMutation as bg, SetColVisibleMutation as _g, SetSelectedColsVisibleCommand as wg, SetTextRotationCommand as fc, SetTextWrapCommand as pc, SetVerticalTextAlignCommand as Sc, SetHorizontalTextAlignCommand as vc, ResetBackgroundColorCommand as Rg, SetBackgroundColorCommand as xs, WorksheetCopyPermission as As, RangeProtectionPermissionViewPoint as Cc, WorkbookCopyPermission as Zi, SetWorksheetRowIsAutoHeightMutation as tv, SetFrozenCommand as nv, InsertRangeMoveDownCommand as bc, InsertRangeMoveRightCommand as _c, InsertRowCommand as rv, InsertColCommand as iv, MoveColsCommand as Ig, MoveRowsCommand as yg, RemoveColCommand as Mg, RemoveRowCommand as Eg, MergeCellController as ov, MERGE_CELL_INTERCEPTOR_CHECK as sv, DeltaRowHeightCommand as lv, DeltaColumnWidthCommand as av, COMMAND_LISTENER_VALUE_CHANGE as cv, AddMergeRedoSelectionsOperationFactory as dv, AddMergeUndoSelectionsOperationFactory as uv, DeleteRangeMoveLeftCommand as Mu, DeleteRangeMoveUpCommand as Eu, EditStateEnum as cn, ViewStateEnum as mi, UnitObject as Vt, DeleteWorksheetProtectionCommand as ks, DeleteRangeProtectionMutation as Pu, AddRangeProtectionMutation as hv, RemoveSheetCommand as gv, AddWorksheetProtectionCommand as Pg, BorderStyleManagerService as wc, SCOPE_WORKBOOK_VALUE_DEFINED_NAME as Rc, InsertDefinedNameCommand as mv, SetDefinedNameCommand as fv, RemoveDefinedNameCommand as pv, SetBorderBasicCommand as Ic, ClearSelectionAllCommand as bs, ClearSelectionFormatCommand as $i, ClearSelectionContentCommand as oi, WorksheetDeleteRowPermission as Sv, WorksheetDeleteColumnPermission as vv, ToggleGridlinesCommand as Tg, ToggleGridlinesMutation as Cv, InsertMultiRowsAfterCommand as Og, WorksheetInsertRowPermission as Fo, InsertMultiRowsAboveCommand as Td, InsertMultiColsLeftCommand as xg, InsertColBeforeCommand as Ag, WorksheetInsertColumnPermission as kg, InsertRowBeforeCommand as Hg, RemoveWorksheetMergeCommand as Vg, WorkbookCreateProtectPermission as zl, WorksheetDeleteProtectionPermission as Ng, WorksheetManageCollaboratorPermission as bv, SetWorksheetHideCommand as Dg, SetTabColorCommand as Lg, CopySheetCommand as Wg, WorkbookDeleteSheetPermission as _v, WorkbookHideSheetPermission as Bg, InsertMultiColsRightCommand as wv, AddWorksheetMergeCommand as Rv, AddWorksheetMergeHorizontalCommand as Iv, AddWorksheetMergeVerticalCommand as yv, AddWorksheetMergeAllCommand as Mv, ResetTextColorCommand as Ev, RefRangeService as Pv, MAX_CELL_PER_SHEET_KEY as Tv, INTERCEPTOR_POINT as Ov, SheetPermissionCheckController as Fg, INumfmtService as xv, SetProtectionCommand as Av, AddRangeProtectionCommand as kv, setEndForRange as Hv, baseProtectionActions as Vv, DeleteRangeProtectionCommand as Nv, WorksheetProtectionPointModel as Dv, SetWorksheetPermissionPointsCommand as Lv, getAllWorksheetPermissionPoint as Wv, convertSelectionDataToRange as Ug, UniverSheetsPlugin as zg, RefSelectionsService as Xg, ToggleCellCheckboxCommand as Bv, SheetPermissionInitController as Fv, SetSpecificRowsVisibleCommand as Uv, SetSpecificColsVisibleCommand as zv } from "@univerjs/sheets";
|
|
11
11
|
import { DocSkeletonManagerService as ir, DocSelectionManagerService as Od, RichTextEditingMutation as Hs, SetTextSelectionsOperation as Uo } from "@univerjs/docs";
|
|
12
12
|
import { IDefinedNamesService as zo, FUNCTION_NAMES_STATISTICAL as Fe, FUNCTION_NAMES_MATH as Xl, FUNCTION_NAMES_TEXT as Xv, sequenceNodeType as ba, matchToken as jg, LexerTreeBuilder as Yg, IFunctionService as Zg, SetFormulaCalculationNotificationMutation as jv, operatorToken as Qr, isReferenceStrings as Gg, isReferenceStringWithEffectiveColumn as Yv, serializeRangeWithSheet as qg, NullValueObject as Tu, serializeRange as Qg, deserializeRangeWithSheet as Kg } from "@univerjs/engine-formula";
|
|
13
13
|
import { isTextFormat as Zv } from "@univerjs/engine-numfmt";
|
|
@@ -1343,11 +1343,11 @@ class Dd extends de {
|
|
|
1343
1343
|
}
|
|
1344
1344
|
class sC extends dS {
|
|
1345
1345
|
render(e, t = !1) {
|
|
1346
|
-
const n =
|
|
1346
|
+
const n = oe.now();
|
|
1347
1347
|
return super.render(e, t), this._afterRender(n), this;
|
|
1348
1348
|
}
|
|
1349
1349
|
_afterRender(e) {
|
|
1350
|
-
this.scene.getEngine().renderFrameTimeMetric$.next(["selectionLayer",
|
|
1350
|
+
this.scene.getEngine().renderFrameTimeMetric$.next(["selectionLayer", oe.now() - e]);
|
|
1351
1351
|
}
|
|
1352
1352
|
}
|
|
1353
1353
|
const lt = vn("univer.sheet.selection-render-service");
|
|
@@ -1632,18 +1632,18 @@ class im extends de {
|
|
|
1632
1632
|
return !1;
|
|
1633
1633
|
const le = d < t.left && C > t.left || d > t.left && C < t.left, me = u < t.top && w > t.top || u > t.top && w < t.top;
|
|
1634
1634
|
le && (a += 1), me && (c += 1);
|
|
1635
|
-
const
|
|
1636
|
-
if (
|
|
1635
|
+
const se = g.viewportKey, _e = P.viewportKey;
|
|
1636
|
+
if (se === U.VIEW_ROW_TOP)
|
|
1637
1637
|
v < t.top && ((k = E == null ? void 0 : E.endRow) != null ? k : 0) < ((O = M == null ? void 0 : M.startRow) != null ? O : 0) ? I = t.top : me && c % 2 === 1 && t.scrollToViewportPos({
|
|
1638
1638
|
viewportScrollY: 0
|
|
1639
1639
|
});
|
|
1640
|
-
else if (
|
|
1640
|
+
else if (se === U.VIEW_COLUMN_LEFT)
|
|
1641
1641
|
S < t.left && ((H = E == null ? void 0 : E.endColumn) != null ? H : 0) < ((F = M == null ? void 0 : M.startColumn) != null ? F : 0) ? R = t.left : le && a % 2 === 1 && t.scrollToViewportPos({
|
|
1642
1642
|
viewportScrollX: 0
|
|
1643
1643
|
});
|
|
1644
|
-
else if (
|
|
1644
|
+
else if (se === _e) {
|
|
1645
1645
|
let Ie = !1, G = !1;
|
|
1646
|
-
|
|
1646
|
+
se === U.VIEW_MAIN_LEFT_TOP ? (Ie = !0, G = !0) : se === U.VIEW_MAIN_TOP ? G = !0 : se === U.VIEW_MAIN_LEFT && (Ie = !0), ((z = E == null ? void 0 : E.endRow) != null ? z : 0) > ((B = M == null ? void 0 : M.startRow) != null ? B : 0) && (G = !1), ((j = E == null ? void 0 : E.endColumn) != null ? j : 0) > ((Y = M == null ? void 0 : M.startColumn) != null ? Y : 0) && (Ie = !1), Ie && (R = t.left), G && (I = t.top);
|
|
1647
1647
|
} else {
|
|
1648
1648
|
const Ie = {
|
|
1649
1649
|
x: g.scrollX,
|
|
@@ -1655,7 +1655,7 @@ class im extends de {
|
|
|
1655
1655
|
(ee || ae) && (t.scrollToBarPos({
|
|
1656
1656
|
x: ee ? Ie.x : void 0,
|
|
1657
1657
|
y: ae ? Ie.y : void 0
|
|
1658
|
-
}), ee || (R = t.left), ae || (I = t.top)), (
|
|
1658
|
+
}), ee || (R = t.left), ae || (I = t.top)), (se === U.VIEW_MAIN_LEFT_TOP && _e === U.VIEW_MAIN_LEFT || _e === U.VIEW_MAIN_LEFT_TOP && se === U.VIEW_MAIN_LEFT) && (R = t.left), (se === U.VIEW_MAIN_LEFT_TOP && _e === U.VIEW_MAIN_TOP || _e === U.VIEW_MAIN_LEFT_TOP && se === U.VIEW_MAIN_TOP) && (I = t.top);
|
|
1659
1659
|
}
|
|
1660
1660
|
d = C, u = w;
|
|
1661
1661
|
}
|
|
@@ -2371,7 +2371,7 @@ function bC(r, e, t) {
|
|
|
2371
2371
|
function Tr(r, e) {
|
|
2372
2372
|
const t = [];
|
|
2373
2373
|
for (let n = 1; n <= e; n++) {
|
|
2374
|
-
const i = (n - 1) % r.length, o =
|
|
2374
|
+
const i = (n - 1) % r.length, o = oe.deepClone(r[i]);
|
|
2375
2375
|
Or(o), t.push({
|
|
2376
2376
|
v: null,
|
|
2377
2377
|
s: null,
|
|
@@ -2416,7 +2416,7 @@ function Fs(r, e, t) {
|
|
|
2416
2416
|
i.push(Number((o = r[c]) == null ? void 0 : o.v));
|
|
2417
2417
|
if (r.length > 2 && wC(i))
|
|
2418
2418
|
for (let c = 1; c <= e; c++) {
|
|
2419
|
-
const d = (c - 1) % r.length, u =
|
|
2419
|
+
const d = (c - 1) % r.length, u = oe.deepClone(r[d]);
|
|
2420
2420
|
Or(u);
|
|
2421
2421
|
const h = Number((s = r[r.length - 1]) == null ? void 0 : s.v) * (Number((l = r[1]) == null ? void 0 : l.v) / Number((a = r[0]) == null ? void 0 : a.v)) ** c;
|
|
2422
2422
|
u && (Wu(u) && (u.v = h), n.push(u));
|
|
@@ -2424,7 +2424,7 @@ function Fs(r, e, t) {
|
|
|
2424
2424
|
else {
|
|
2425
2425
|
const c = RC(r.length);
|
|
2426
2426
|
for (let d = 1; d <= e; d++) {
|
|
2427
|
-
const u = (d - 1) % r.length, h =
|
|
2427
|
+
const u = (d - 1) % r.length, h = oe.deepClone(r[u]);
|
|
2428
2428
|
Or(h);
|
|
2429
2429
|
const g = t === W.DOWN || t === W.RIGHT, m = IC(r.length + d, i, c, g);
|
|
2430
2430
|
h && (Wu(h) && (h.v = m), n.push(h));
|
|
@@ -2452,7 +2452,7 @@ function Nu(r, e, t) {
|
|
|
2452
2452
|
var o;
|
|
2453
2453
|
const n = [], i = /0|([1-9]+[0-9]*)/g;
|
|
2454
2454
|
for (let s = 1; s <= e; s++) {
|
|
2455
|
-
const l = (s - 1) % r.length, a =
|
|
2455
|
+
const l = (s - 1) % r.length, a = oe.deepClone(r[l]);
|
|
2456
2456
|
Or(a);
|
|
2457
2457
|
const c = `${(o = r[r.length - 1]) == null ? void 0 : o.v}`, d = c == null ? void 0 : c.match(i), u = d == null ? void 0 : d[d.length - 1], h = Math.abs(Number(u) + t * s);
|
|
2458
2458
|
if (!c || !u) continue;
|
|
@@ -2471,7 +2471,7 @@ function fi(r, e, t, n = 0) {
|
|
|
2471
2471
|
if (n >= i.length) return [];
|
|
2472
2472
|
const o = i[n], s = [];
|
|
2473
2473
|
for (let c = 1; c <= e; c++) {
|
|
2474
|
-
const d = (c - 1) % r.length, u =
|
|
2474
|
+
const d = (c - 1) % r.length, u = oe.deepClone(r[d]);
|
|
2475
2475
|
Or(u);
|
|
2476
2476
|
let h = 0;
|
|
2477
2477
|
if (((l = r[r.length - 1]) == null ? void 0 : l.v) === o[0])
|
|
@@ -2493,7 +2493,7 @@ function Du(r, e, t) {
|
|
|
2493
2493
|
var i;
|
|
2494
2494
|
const n = [];
|
|
2495
2495
|
for (let o = 1; o <= e; o++) {
|
|
2496
|
-
const s = (o - 1) % r.length, l =
|
|
2496
|
+
const s = (o - 1) % r.length, l = oe.deepClone(r[s]);
|
|
2497
2497
|
Or(l);
|
|
2498
2498
|
const a = `${(i = r[r.length - 1]) == null ? void 0 : i.v}`, c = On(a) + t * o;
|
|
2499
2499
|
let d;
|
|
@@ -2544,7 +2544,7 @@ function Lu(r, e, t, n) {
|
|
|
2544
2544
|
var s;
|
|
2545
2545
|
const i = n.length, o = [];
|
|
2546
2546
|
for (let l = 1; l <= e; l++) {
|
|
2547
|
-
const a = (l - 1) % r.length, c =
|
|
2547
|
+
const a = (l - 1) % r.length, c = oe.deepClone(r[a]);
|
|
2548
2548
|
Or(c);
|
|
2549
2549
|
const d = `${(s = r[r.length - 1]) == null ? void 0 : s.v}`;
|
|
2550
2550
|
let u = n.indexOf(d) + t * l;
|
|
@@ -3214,7 +3214,7 @@ var VC = Object.getOwnPropertyDescriptor, NC = (r, e, t, n) => {
|
|
|
3214
3214
|
let Ac = class extends de {
|
|
3215
3215
|
constructor(e, t, n, i, o, s, l) {
|
|
3216
3216
|
super();
|
|
3217
|
-
_(this, "_editorUnitId",
|
|
3217
|
+
_(this, "_editorUnitId", Le);
|
|
3218
3218
|
_(this, "_editorIsDirty", !1);
|
|
3219
3219
|
_(this, "_isDisabled", !1);
|
|
3220
3220
|
_(this, "_visible", {
|
|
@@ -3285,7 +3285,7 @@ let Ac = class extends de {
|
|
|
3285
3285
|
}, this._currentEditCellLayout$.next(this._currentEditCellLayout);
|
|
3286
3286
|
}
|
|
3287
3287
|
setEditCell(e) {
|
|
3288
|
-
this._currentEditCell = e, this._editorService.getFocusEditor() || (this._editorService.focus(
|
|
3288
|
+
this._currentEditCell = e, this._editorService.getFocusEditor() || (this._editorService.focus(Le), this._contextService.setContextValue($e, !1), this._contextService.setContextValue(Ml, !1));
|
|
3289
3289
|
const t = this.getLatestEditCellState();
|
|
3290
3290
|
if (!t) {
|
|
3291
3291
|
this._currentEditCellState = t, this._currentEditCellLayout = t, this._currentEditCellState$.next(t), this._currentEditCellLayout$.next(t);
|
|
@@ -3469,7 +3469,7 @@ const it = vn("univer.sheet-editor-bridge.service"), at = {
|
|
|
3469
3469
|
let c = a ? 100 : Math.round((i.getConfig().zoomRatio + l) * 100);
|
|
3470
3470
|
c = Math.max(Mc[0], c), c = Math.min(Mc[1], c);
|
|
3471
3471
|
const d = c / 100, h = r.get(it).isVisible();
|
|
3472
|
-
return (h.unitId === s || h.unitId ===
|
|
3472
|
+
return (h.unitId === s || h.unitId === De) && h.visible ? !1 : r.get(D).executeCommand(tn.id, {
|
|
3473
3473
|
unitId: s,
|
|
3474
3474
|
subUnitId: o,
|
|
3475
3475
|
zoomRatio: d
|
|
@@ -3482,7 +3482,7 @@ const it = vn("univer.sheet-editor-bridge.service"), at = {
|
|
|
3482
3482
|
if (!e)
|
|
3483
3483
|
return !1;
|
|
3484
3484
|
const { unitId: t, subUnitId: n, zoomRatio: i } = e, s = r.get(it).isVisible();
|
|
3485
|
-
return (s.unitId === t || s.unitId ===
|
|
3485
|
+
return (s.unitId === t || s.unitId === De) && s.visible ? !1 : r.get(D).executeCommand(tn.id, {
|
|
3486
3486
|
unitId: t,
|
|
3487
3487
|
subUnitId: n,
|
|
3488
3488
|
zoomRatio: i
|
|
@@ -3564,7 +3564,7 @@ let ho = class extends de {
|
|
|
3564
3564
|
return;
|
|
3565
3565
|
if (this._editorBridgeService) {
|
|
3566
3566
|
const c = this._editorBridgeService.isVisible();
|
|
3567
|
-
if ((c.unitId === this._context.unitId || c.unitId ===
|
|
3567
|
+
if ((c.unitId === this._context.unitId || c.unitId === De) && c.visible)
|
|
3568
3568
|
return;
|
|
3569
3569
|
}
|
|
3570
3570
|
const n = Math.abs(t.deltaX);
|
|
@@ -3957,7 +3957,7 @@ let zs = class extends de {
|
|
|
3957
3957
|
return i.rows.forEach((a) => {
|
|
3958
3958
|
const c = [];
|
|
3959
3959
|
i.cols.forEach((d) => {
|
|
3960
|
-
c.push(
|
|
3960
|
+
c.push(oe.deepClone(s.getValue(a, d)));
|
|
3961
3961
|
}), l.push(c);
|
|
3962
3962
|
}), this._beforeApplyData = l, this._copyData = this._getCopyData(n, t), this._currentLocation = e, this._shouldDisableSeries(this._copyData) ? (this._autoFillService.setDisableApplyType(Ne.SERIES, !0), Ne.COPY) : (this._autoFillService.setDisableApplyType(Ne.SERIES, !1), this._getPreferredApplyType(this._copyData));
|
|
3963
3963
|
}
|
|
@@ -4744,7 +4744,7 @@ const Bt = {
|
|
|
4744
4744
|
sheetId: p,
|
|
4745
4745
|
keycode: Z.TAB
|
|
4746
4746
|
});
|
|
4747
|
-
const F =
|
|
4747
|
+
const F = oe.deepClone(v), z = T ? g.range : nr(
|
|
4748
4748
|
{
|
|
4749
4749
|
startRow: F.startRow,
|
|
4750
4750
|
startColumn: F.startColumn,
|
|
@@ -5351,7 +5351,7 @@ let fo = class extends de {
|
|
|
5351
5351
|
if (a == null) return !1;
|
|
5352
5352
|
const c = this._context.unit.getActiveSheet();
|
|
5353
5353
|
if (!c) return !1;
|
|
5354
|
-
r =
|
|
5354
|
+
r = oe.clamp(r, 0, i.length - 1), e = oe.clamp(e, 0, o.length - 1);
|
|
5355
5355
|
const {
|
|
5356
5356
|
startColumn: d,
|
|
5357
5357
|
startRow: u,
|
|
@@ -5687,9 +5687,9 @@ const O1 = () => {
|
|
|
5687
5687
|
})
|
|
5688
5688
|
).dispose, [n]), Pe(() => We(
|
|
5689
5689
|
n.showMenu$.subscribe((le) => {
|
|
5690
|
-
const { source: me, target:
|
|
5691
|
-
if (le && me &&
|
|
5692
|
-
const _e = Math.max(me.rows[me.rows.length - 1],
|
|
5690
|
+
const { source: me, target: se } = n.autoFillLocation || { source: null, target: null };
|
|
5691
|
+
if (le && me && se) {
|
|
5692
|
+
const _e = Math.max(me.rows[me.rows.length - 1], se.rows[se.rows.length - 1]), Ie = Math.max(me.cols[me.cols.length - 1], se.cols[se.cols.length - 1]);
|
|
5693
5693
|
d({ row: _e, col: Ie });
|
|
5694
5694
|
} else
|
|
5695
5695
|
d({ row: -1, col: -1 });
|
|
@@ -5790,7 +5790,7 @@ function V1() {
|
|
|
5790
5790
|
zoomRatio: g
|
|
5791
5791
|
});
|
|
5792
5792
|
}
|
|
5793
|
-
const c = (i == null ? void 0 : i.visible) && (i.unitId === (t == null ? void 0 : t.getUnitId()) || i.unitId ===
|
|
5793
|
+
const c = (i == null ? void 0 : i.visible) && (i.unitId === (t == null ? void 0 : t.getUnitId()) || i.unitId === De);
|
|
5794
5794
|
return /* @__PURE__ */ b(
|
|
5795
5795
|
vS,
|
|
5796
5796
|
{
|
|
@@ -5862,7 +5862,7 @@ const D1 = "univer-editor-container", L1 = "univer-editor-input", Xu = {
|
|
|
5862
5862
|
left: v,
|
|
5863
5863
|
top: C
|
|
5864
5864
|
});
|
|
5865
|
-
const y = n.getEditor(
|
|
5865
|
+
const y = n.getEditor(Le);
|
|
5866
5866
|
if (y == null)
|
|
5867
5867
|
return;
|
|
5868
5868
|
const { left: M, top: E, width: P, height: T } = y.getBoundingClientRect();
|
|
@@ -5905,7 +5905,7 @@ const D1 = "univer-editor-container", L1 = "univer-editor-input", Xu = {
|
|
|
5905
5905
|
children: u && /* @__PURE__ */ b(
|
|
5906
5906
|
u,
|
|
5907
5907
|
{
|
|
5908
|
-
editorId:
|
|
5908
|
+
editorId: Le,
|
|
5909
5909
|
className: Xu.editorInput,
|
|
5910
5910
|
initValue: "",
|
|
5911
5911
|
onChange: () => {
|
|
@@ -6204,7 +6204,7 @@ function Cb(r) {
|
|
|
6204
6204
|
const A = T.getContextValue(At), k = An(null), O = L(kr);
|
|
6205
6205
|
FS(() => {
|
|
6206
6206
|
const ce = R.activeSheet$.pipe(
|
|
6207
|
-
ct((
|
|
6207
|
+
ct((re) => re ? _t(
|
|
6208
6208
|
a.ruleChange$,
|
|
6209
6209
|
c.ruleChange$,
|
|
6210
6210
|
u.selectionMoveEnd$,
|
|
@@ -6212,7 +6212,7 @@ function Cb(r) {
|
|
|
6212
6212
|
).pipe(
|
|
6213
6213
|
ct(() => {
|
|
6214
6214
|
var Kt, Gn;
|
|
6215
|
-
const Xe = R.getUnitId(), tt =
|
|
6215
|
+
const Xe = R.getUnitId(), tt = re.getSheetId();
|
|
6216
6216
|
if (!((Kt = u.getCurrentLastSelection()) == null ? void 0 : Kt.range)) return yu;
|
|
6217
6217
|
const Ct = (Gn = u.getCurrentLastSelection()) == null ? void 0 : Gn.primary;
|
|
6218
6218
|
return Ct ? Re({
|
|
@@ -6222,10 +6222,10 @@ function Cb(r) {
|
|
|
6222
6222
|
}) : Re(null);
|
|
6223
6223
|
})
|
|
6224
6224
|
) : yu)
|
|
6225
|
-
).subscribe((
|
|
6225
|
+
).subscribe((re) => {
|
|
6226
6226
|
var Xe, tt, wt, Ct, Kt, Gn;
|
|
6227
|
-
if (
|
|
6228
|
-
const { unitId: $o, subUnitId: es, primary: fp } =
|
|
6227
|
+
if (re) {
|
|
6228
|
+
const { unitId: $o, subUnitId: es, primary: fp } = re;
|
|
6229
6229
|
if (a.getRule($o, es)) {
|
|
6230
6230
|
const vp = !((tt = (Xe = h.getPermissionPoint(new te($o, es).id)) == null ? void 0 : Xe.value) == null || tt), Cp = !((Ct = (wt = h.getPermissionPoint(new sg($o, es).id)) == null ? void 0 : wt.value) == null || Ct);
|
|
6231
6231
|
p({
|
|
@@ -6249,26 +6249,26 @@ function Cb(r) {
|
|
|
6249
6249
|
ce.unsubscribe();
|
|
6250
6250
|
};
|
|
6251
6251
|
}, [R]), Pe(() => {
|
|
6252
|
-
const ce = l.visible$.subscribe((
|
|
6253
|
-
n(
|
|
6252
|
+
const ce = l.visible$.subscribe((re) => {
|
|
6253
|
+
n(re.visible ? ut.formulaActive : ut.formulaGrey);
|
|
6254
6254
|
});
|
|
6255
6255
|
return () => ce.unsubscribe();
|
|
6256
6256
|
}, [l.visible$]), Pe(() => {
|
|
6257
|
-
const ce = l.currentEditCellState$.subscribe((
|
|
6257
|
+
const ce = l.currentEditCellState$.subscribe((re) => {
|
|
6258
6258
|
var Xe, tt, wt;
|
|
6259
|
-
(wt = (tt = (Xe =
|
|
6259
|
+
(wt = (tt = (Xe = re == null ? void 0 : re.documentLayoutObject.documentModel) == null ? void 0 : Xe.getBody()) == null ? void 0 : tt.customBlocks) != null && wt.length ? v(!0) : v(!1);
|
|
6260
6260
|
});
|
|
6261
6261
|
return () => ce.unsubscribe();
|
|
6262
6262
|
}, [l.currentEditCellState$]), Pe(() => {
|
|
6263
6263
|
const ce = () => {
|
|
6264
6264
|
if (!k.current) return;
|
|
6265
|
-
const
|
|
6266
|
-
s.setPosition(
|
|
6265
|
+
const re = k.current.getBoundingClientRect();
|
|
6266
|
+
s.setPosition(re);
|
|
6267
6267
|
};
|
|
6268
6268
|
if (k.current) {
|
|
6269
6269
|
ce();
|
|
6270
|
-
const
|
|
6271
|
-
return
|
|
6270
|
+
const re = new ResizeObserver(ce);
|
|
6271
|
+
return re.observe(k.current), () => re.disconnect();
|
|
6272
6272
|
}
|
|
6273
6273
|
}, [s]);
|
|
6274
6274
|
function H() {
|
|
@@ -6283,37 +6283,38 @@ function Cb(r) {
|
|
|
6283
6283
|
}, 150);
|
|
6284
6284
|
}
|
|
6285
6285
|
function F() {
|
|
6286
|
-
var
|
|
6286
|
+
var re;
|
|
6287
6287
|
l.isVisible().visible && m.executeCommand(at.id, {
|
|
6288
6288
|
visible: !1,
|
|
6289
6289
|
eventType: Ye.Keyboard,
|
|
6290
6290
|
keycode: Z.ESC,
|
|
6291
|
-
unitId: (
|
|
6291
|
+
unitId: (re = C == null ? void 0 : C.getUnitId()) != null ? re : ""
|
|
6292
6292
|
});
|
|
6293
6293
|
}
|
|
6294
6294
|
function z() {
|
|
6295
|
-
var
|
|
6295
|
+
var re;
|
|
6296
6296
|
l.isVisible().visible && m.executeCommand(at.id, {
|
|
6297
6297
|
visible: !1,
|
|
6298
6298
|
eventType: Ye.PointerDown,
|
|
6299
|
-
unitId: (
|
|
6299
|
+
unitId: (re = C == null ? void 0 : C.getUnitId()) != null ? re : ""
|
|
6300
6300
|
});
|
|
6301
6301
|
}
|
|
6302
6302
|
function B() {
|
|
6303
6303
|
s.handleFxBtnClick(!0);
|
|
6304
6304
|
}
|
|
6305
|
-
const { viewDisable: j, editDisable: Y } = f, le = Y || S, me = An(!1),
|
|
6305
|
+
const { viewDisable: j, editDisable: Y } = f, le = Y || S, me = An(!1), se = () => {
|
|
6306
|
+
var ce;
|
|
6306
6307
|
try {
|
|
6307
6308
|
l.isVisible().visible === !1 && m.syncExecuteCommand(
|
|
6308
6309
|
at.id,
|
|
6309
6310
|
{
|
|
6310
6311
|
visible: !0,
|
|
6311
6312
|
eventType: Ye.PointerDown,
|
|
6312
|
-
unitId:
|
|
6313
|
+
unitId: (ce = C == null ? void 0 : C.getUnitId()) != null ? ce : ""
|
|
6313
6314
|
}
|
|
6314
6315
|
), T.setContextValue(At, !0);
|
|
6315
|
-
} catch (
|
|
6316
|
-
throw me.current = !0,
|
|
6316
|
+
} catch (re) {
|
|
6317
|
+
throw me.current = !0, re;
|
|
6317
6318
|
}
|
|
6318
6319
|
}, _e = (ce) => {
|
|
6319
6320
|
me.current && setTimeout(() => {
|
|
@@ -6355,7 +6356,7 @@ function Cb(r) {
|
|
|
6355
6356
|
"div",
|
|
6356
6357
|
{
|
|
6357
6358
|
className: ut.formulaInput,
|
|
6358
|
-
onPointerDown:
|
|
6359
|
+
onPointerDown: se,
|
|
6359
6360
|
onPointerUp: _e,
|
|
6360
6361
|
ref: k,
|
|
6361
6362
|
style: { pointerEvents: G ? "none" : "auto" },
|
|
@@ -6364,7 +6365,7 @@ function Cb(r) {
|
|
|
6364
6365
|
E,
|
|
6365
6366
|
{
|
|
6366
6367
|
disableSelectionOnClick: !0,
|
|
6367
|
-
editorId:
|
|
6368
|
+
editorId: De,
|
|
6368
6369
|
initValue: "",
|
|
6369
6370
|
onChange: () => {
|
|
6370
6371
|
},
|
|
@@ -7149,7 +7150,7 @@ function Lb() {
|
|
|
7149
7150
|
var ve;
|
|
7150
7151
|
const G = ((ve = R.getActiveSheet()) == null ? void 0 : ve.getSheetId()) || "";
|
|
7151
7152
|
n(G);
|
|
7152
|
-
const ee = R.getSheets(), ae = R.getActiveSheet(), Se = ee.filter((ce) => !ce.isSheetHidden()).map((ce,
|
|
7153
|
+
const ee = R.getSheets(), ae = R.getActiveSheet(), Se = ee.filter((ce) => !ce.isSheetHidden()).map((ce, re) => {
|
|
7153
7154
|
var Kt;
|
|
7154
7155
|
const Xe = v.getRule(R.getUnitId(), ce.getSheetId()), tt = C.getSubunitRuleList(R.getUnitId(), ce.getSheetId()).length > 0, Ct = (Xe == null ? void 0 : Xe.permissionId) || tt ? /* @__PURE__ */ q(Mr, { children: [
|
|
7155
7156
|
/* @__PURE__ */ b(jd, {}),
|
|
@@ -7158,7 +7159,7 @@ function Lb() {
|
|
|
7158
7159
|
return {
|
|
7159
7160
|
sheetId: ce.getSheetId(),
|
|
7160
7161
|
label: Ct,
|
|
7161
|
-
index:
|
|
7162
|
+
index: re,
|
|
7162
7163
|
selected: ae === ce,
|
|
7163
7164
|
color: (Kt = ce.getTabColor()) != null ? Kt : void 0
|
|
7164
7165
|
};
|
|
@@ -7224,12 +7225,12 @@ function Lb() {
|
|
|
7224
7225
|
const ae = R.getUnitId(), Se = R == null ? void 0 : R.getActiveSheet();
|
|
7225
7226
|
if (!Se)
|
|
7226
7227
|
throw new Error("No active sheet found");
|
|
7227
|
-
const ve = Se.getSheetId(), ce = v.getRule(ae, ve),
|
|
7228
|
-
return ce ||
|
|
7228
|
+
const ve = Se.getSheetId(), ce = v.getRule(ae, ve), re = C.getSubunitRuleList(ae, ve).length > 0;
|
|
7229
|
+
return ce || re ? (tt = (Xe = I.getPermissionPoint(new lg(ae).id)) == null ? void 0 : Xe.value) != null ? tt : !1 : (Ct = (wt = I.getPermissionPoint(new ag(ae).id)) == null ? void 0 : wt.value) != null ? Ct : !1;
|
|
7229
7230
|
}
|
|
7230
7231
|
});
|
|
7231
7232
|
d.current.slideTabBar = G;
|
|
7232
|
-
const ee =
|
|
7233
|
+
const ee = se(G);
|
|
7233
7234
|
return { slideTabBar: G, disconnectResizeObserver: ee };
|
|
7234
7235
|
}, E = p.getConfig($h), P = (Ie = E == null ? void 0 : E.contextMenu) != null ? Ie : !0, T = (G) => {
|
|
7235
7236
|
if (G.trim() === "") {
|
|
@@ -7334,7 +7335,7 @@ function Lb() {
|
|
|
7334
7335
|
leftEnd: G.isLeftEnd(),
|
|
7335
7336
|
rightEnd: G.isRightEnd()
|
|
7336
7337
|
});
|
|
7337
|
-
},
|
|
7338
|
+
}, se = (G) => {
|
|
7338
7339
|
var Se;
|
|
7339
7340
|
const ee = (Se = u.current) == null ? void 0 : Se.querySelector(`.${Ft.slideTabBar}`);
|
|
7340
7341
|
if (!ee) return;
|
|
@@ -7346,8 +7347,8 @@ function Lb() {
|
|
|
7346
7347
|
var ee, ae, Se, ve, ce;
|
|
7347
7348
|
if (P && !(S != null && S.isForceKeepVisible())) {
|
|
7348
7349
|
if (G) {
|
|
7349
|
-
const { left:
|
|
7350
|
-
|
|
7350
|
+
const { left: re } = (ae = (ee = u.current) == null ? void 0 : ee.getBoundingClientRect()) != null ? ae : {}, { left: Xe } = (ce = (ve = (Se = d.current.slideTabBar) == null ? void 0 : Se.getActiveItem()) == null ? void 0 : ve.getSlideTabItem().getBoundingClientRect()) != null ? ce : {};
|
|
7351
|
+
re !== void 0 && Xe !== void 0 && c([Xe - re, 0]);
|
|
7351
7352
|
}
|
|
7352
7353
|
l(G);
|
|
7353
7354
|
}
|
|
@@ -7695,7 +7696,7 @@ let Ys = class extends de {
|
|
|
7695
7696
|
var M, E, P, T;
|
|
7696
7697
|
const e = this._editorBridgeService.getEditCellState();
|
|
7697
7698
|
if (!e) return;
|
|
7698
|
-
const { position: t, documentLayoutObject: n, canvasOffset: i, scaleX: o, scaleY: s } = e, { startX: l, startY: a, endX: c, endY: d } = t, u = this._univerInstanceService.getUnit(
|
|
7699
|
+
const { position: t, documentLayoutObject: n, canvasOffset: i, scaleX: o, scaleY: s } = e, { startX: l, startY: a, endX: c, endY: d } = t, u = this._univerInstanceService.getUnit(Le, x.UNIVER_DOC);
|
|
7699
7700
|
if (u == null)
|
|
7700
7701
|
return;
|
|
7701
7702
|
const h = this._getEditorSkeleton();
|
|
@@ -7737,7 +7738,7 @@ let Ys = class extends de {
|
|
|
7737
7738
|
* to determine whether it needs to be automatically widened.
|
|
7738
7739
|
*/
|
|
7739
7740
|
_predictingSize(r, e, t, n, i = 1, o = 1) {
|
|
7740
|
-
const { startX: s, endX: l } = r, { textRotation: a, wrapStrategy: c, paddingData: d } = n, u = this._univerInstanceService.getUnit(
|
|
7741
|
+
const { startX: s, endX: l } = r, { textRotation: a, wrapStrategy: c, paddingData: d } = n, u = this._univerInstanceService.getUnit(Le, x.UNIVER_DOC), { vertexAngle: h } = hd(a);
|
|
7741
7742
|
if (c === wr.WRAP && h === 0) {
|
|
7742
7743
|
u == null || u.updateDocumentDataPageSize(l - s), u == null || u.updateDocumentDataMargin({ l: d.l, t: d.t }), t.calculate();
|
|
7743
7744
|
const { actualWidth: p, actualHeight: S } = t.getActualSize();
|
|
@@ -7863,7 +7864,7 @@ let Ys = class extends de {
|
|
|
7863
7864
|
}
|
|
7864
7865
|
_getEditorSkeleton() {
|
|
7865
7866
|
var r;
|
|
7866
|
-
return (r = this._renderManagerService.getRenderById(
|
|
7867
|
+
return (r = this._renderManagerService.getRenderById(Le)) == null ? void 0 : r.with(ir).getSkeleton();
|
|
7867
7868
|
}
|
|
7868
7869
|
};
|
|
7869
7870
|
Ys = t_([
|
|
@@ -8217,7 +8218,7 @@ let Lc = class extends de {
|
|
|
8217
8218
|
_initEditorVisibilityListener() {
|
|
8218
8219
|
this.disposeWithMe(
|
|
8219
8220
|
this._editorBridgeService.visible$.pipe(un((e, t) => e.visible === t.visible)).subscribe((e) => {
|
|
8220
|
-
(e.unitId ===
|
|
8221
|
+
(e.unitId === De || e.unitId === this._context.unitId) && e.visible ? (this._isUnitEditing = !0, this._handleEditorVisible(e)) : this._isUnitEditing && (this._handleEditorInvisible(e), this._isUnitEditing = !1);
|
|
8221
8222
|
})
|
|
8222
8223
|
);
|
|
8223
8224
|
}
|
|
@@ -8268,8 +8269,8 @@ let Lc = class extends de {
|
|
|
8268
8269
|
}
|
|
8269
8270
|
this._sheetCellEditorResizeService.resizeCellEditor(() => {
|
|
8270
8271
|
this._textSelectionManagerService.refreshSelection({
|
|
8271
|
-
unitId:
|
|
8272
|
-
subUnitId:
|
|
8272
|
+
unitId: Le,
|
|
8273
|
+
subUnitId: Le
|
|
8273
8274
|
});
|
|
8274
8275
|
});
|
|
8275
8276
|
}
|
|
@@ -8302,12 +8303,12 @@ let Lc = class extends de {
|
|
|
8302
8303
|
endOffset: 0
|
|
8303
8304
|
}],
|
|
8304
8305
|
{
|
|
8305
|
-
unitId:
|
|
8306
|
-
subUnitId:
|
|
8306
|
+
unitId: Le,
|
|
8307
|
+
subUnitId: Le
|
|
8307
8308
|
}
|
|
8308
8309
|
);
|
|
8309
|
-
const f = (S = this._renderManagerService.getRenderById(
|
|
8310
|
-
(f != null && f.canFocusing || p != null && p.canFocusing) && (this._univerInstanceService.setCurrentUnitForType(
|
|
8310
|
+
const f = (S = this._renderManagerService.getRenderById(Le)) == null ? void 0 : S.with(_r), p = (v = this._renderManagerService.getRenderById(De)) == null ? void 0 : v.with(_r);
|
|
8311
|
+
(f != null && f.canFocusing || p != null && p.canFocusing) && (this._univerInstanceService.setCurrentUnitForType(Le), f == null || f.activate(
|
|
8311
8312
|
qu,
|
|
8312
8313
|
qu,
|
|
8313
8314
|
!0
|
|
@@ -8323,7 +8324,7 @@ let Lc = class extends de {
|
|
|
8323
8324
|
const i = n.params, { unitId: o } = i;
|
|
8324
8325
|
if (!this._isCurrentSheetFocused() || S_(o) || (this._editorBridgeService.changeEditorDirty(!0), !this._editorBridgeService.isVisible().visible))
|
|
8325
8326
|
return;
|
|
8326
|
-
o ===
|
|
8327
|
+
o === Le && this._sheetCellEditorResizeService.fitTextSize();
|
|
8327
8328
|
}
|
|
8328
8329
|
}));
|
|
8329
8330
|
const t = [pi.id];
|
|
@@ -8361,7 +8362,7 @@ let Lc = class extends de {
|
|
|
8361
8362
|
return;
|
|
8362
8363
|
const { document: a, scene: c } = l;
|
|
8363
8364
|
this._contextService.setContextValue($e, !0);
|
|
8364
|
-
const d = this._getDocumentDataModel(), u = this._getEditorSkeleton(
|
|
8365
|
+
const d = this._getDocumentDataModel(), u = this._getEditorSkeleton(Le);
|
|
8365
8366
|
if (!(!u || !d)) {
|
|
8366
8367
|
if (this._sheetCellEditorResizeService.fitTextSize(() => {
|
|
8367
8368
|
const f = c.getViewport(Ms.VIEW_MAIN);
|
|
@@ -8383,8 +8384,8 @@ let Lc = class extends de {
|
|
|
8383
8384
|
endOffset: f
|
|
8384
8385
|
}],
|
|
8385
8386
|
{
|
|
8386
|
-
unitId:
|
|
8387
|
-
subUnitId:
|
|
8387
|
+
unitId: Le,
|
|
8388
|
+
subUnitId: Le
|
|
8388
8389
|
}
|
|
8389
8390
|
);
|
|
8390
8391
|
} else if (
|
|
@@ -8397,8 +8398,8 @@ let Lc = class extends de {
|
|
|
8397
8398
|
endOffset: 0
|
|
8398
8399
|
}],
|
|
8399
8400
|
{
|
|
8400
|
-
unitId:
|
|
8401
|
-
subUnitId:
|
|
8401
|
+
unitId: Le,
|
|
8402
|
+
subUnitId: Le
|
|
8402
8403
|
}
|
|
8403
8404
|
);
|
|
8404
8405
|
else if (t === Ye.Dblclick) {
|
|
@@ -8416,7 +8417,7 @@ let Lc = class extends de {
|
|
|
8416
8417
|
}
|
|
8417
8418
|
}
|
|
8418
8419
|
async _handleEditorInvisible(e) {
|
|
8419
|
-
const t = this._editorBridgeService.getEditCellState(), n = this._univerInstanceService.getUnit(
|
|
8420
|
+
const t = this._editorBridgeService.getEditCellState(), n = this._univerInstanceService.getUnit(Le), i = oe.deepClone(n == null ? void 0 : n.getSnapshot());
|
|
8420
8421
|
let { keycode: o } = e;
|
|
8421
8422
|
if (this._cursorChange = 0, this._exitInput(e), t == null)
|
|
8422
8423
|
return;
|
|
@@ -8487,7 +8488,7 @@ let Lc = class extends de {
|
|
|
8487
8488
|
viewportScrollY: 0
|
|
8488
8489
|
});
|
|
8489
8490
|
const n = this._editorBridgeService.getCurrentEditorId();
|
|
8490
|
-
n == null || !this._editorService.isSheetEditor(n) || (this._undoRedoService.clearUndoRedo(n), this._undoRedoService.clearUndoRedo(
|
|
8491
|
+
n == null || !this._editorService.isSheetEditor(n) || (this._undoRedoService.clearUndoRedo(n), this._undoRedoService.clearUndoRedo(De));
|
|
8491
8492
|
}
|
|
8492
8493
|
_moveSelection(e) {
|
|
8493
8494
|
if (e == null || !i_.includes(e))
|
|
@@ -8542,7 +8543,7 @@ let Lc = class extends de {
|
|
|
8542
8543
|
});
|
|
8543
8544
|
}
|
|
8544
8545
|
_getDocumentDataModel() {
|
|
8545
|
-
return this._univerInstanceService.getUnit(
|
|
8546
|
+
return this._univerInstanceService.getUnit(Le, x.UNIVER_DOC);
|
|
8546
8547
|
}
|
|
8547
8548
|
// WTF: this is should not exist at all. It is because all editor instances reuse the singleton
|
|
8548
8549
|
// "DocSelectionManagerService" and other modules. Which will be refactored soon in August, 2024.
|
|
@@ -8560,11 +8561,11 @@ let Lc = class extends de {
|
|
|
8560
8561
|
}
|
|
8561
8562
|
_emptyDocumentDataModel(e, t) {
|
|
8562
8563
|
const n = (s, l) => {
|
|
8563
|
-
const a =
|
|
8564
|
+
const a = oe.deepClone(s.getSnapshot()), c = this._getEditorViewModel(s.getUnitId());
|
|
8564
8565
|
c != null && (__(a.body, t), l && (a.documentStyle = e), a.drawings = {}, a.drawingsOrder = [], s.reset(a), c.reset(s));
|
|
8565
8566
|
}, i = this._getDocumentDataModel();
|
|
8566
8567
|
i && n(i, !0);
|
|
8567
|
-
const o = this._univerInstanceService.getUnit(
|
|
8568
|
+
const o = this._univerInstanceService.getUnit(De, x.UNIVER_DOC);
|
|
8568
8569
|
o && n(o);
|
|
8569
8570
|
}
|
|
8570
8571
|
};
|
|
@@ -8668,7 +8669,7 @@ let Zs = class extends de {
|
|
|
8668
8669
|
var a;
|
|
8669
8670
|
const i = this._currentService.getCurrentUnitForType(x.UNIVER_SHEET), o = (a = i.getActiveSheet()) == null ? void 0 : a.getSheetId();
|
|
8670
8671
|
if (!o) return null;
|
|
8671
|
-
const s =
|
|
8672
|
+
const s = oe.generateRandomId(), l = {
|
|
8672
8673
|
selection: e,
|
|
8673
8674
|
subUnitId: o,
|
|
8674
8675
|
unitId: i.getUnitId(),
|
|
@@ -8682,7 +8683,7 @@ let Zs = class extends de {
|
|
|
8682
8683
|
var l;
|
|
8683
8684
|
const i = this._currentService.getCurrentUnitForType(x.UNIVER_SHEET), o = (l = i.getActiveSheet()) == null ? void 0 : l.getSheetId();
|
|
8684
8685
|
if (!o) return null;
|
|
8685
|
-
const s =
|
|
8686
|
+
const s = oe.generateRandomId();
|
|
8686
8687
|
return this._shapeMap.set(s, {
|
|
8687
8688
|
selection: e,
|
|
8688
8689
|
subUnitId: o,
|
|
@@ -8747,7 +8748,7 @@ function Fm(r) {
|
|
|
8747
8748
|
}
|
|
8748
8749
|
const I_ = 10, y_ = 6;
|
|
8749
8750
|
function M_() {
|
|
8750
|
-
return
|
|
8751
|
+
return oe.generateRandomId(y_);
|
|
8751
8752
|
}
|
|
8752
8753
|
function E_(r) {
|
|
8753
8754
|
const e = r.match(/data-copy-id="([^\s]+)"/);
|
|
@@ -9082,9 +9083,9 @@ const Il = class Il {
|
|
|
9082
9083
|
let h = RS(void 0, u.style);
|
|
9083
9084
|
if ((S = (p = (f = (m = u == null ? void 0 : u.richTextParma) == null ? void 0 : m.p) == null ? void 0 : f.body) == null ? void 0 : p.textRuns) != null && S.length) {
|
|
9084
9085
|
const me = (C = (v = u == null ? void 0 : u.richTextParma) == null ? void 0 : v.v) == null ? void 0 : C.length;
|
|
9085
|
-
for (let
|
|
9086
|
-
const _e = (P = (E = (M = u == null ? void 0 : u.richTextParma) == null ? void 0 : M.p) == null ? void 0 : E.body) == null ? void 0 : P.textRuns[
|
|
9087
|
-
_e.st === 0 && _e.ed === me && (h = { ..._e.ts, ...h }, (k = (A = (T = u == null ? void 0 : u.richTextParma) == null ? void 0 : T.p) == null ? void 0 : A.body) == null || k.textRuns.splice(
|
|
9086
|
+
for (let se = 0; se < ((y = (I = (R = (w = u == null ? void 0 : u.richTextParma) == null ? void 0 : w.p) == null ? void 0 : R.body) == null ? void 0 : I.textRuns) == null ? void 0 : y.length); se++) {
|
|
9087
|
+
const _e = (P = (E = (M = u == null ? void 0 : u.richTextParma) == null ? void 0 : M.p) == null ? void 0 : E.body) == null ? void 0 : P.textRuns[se];
|
|
9088
|
+
_e.st === 0 && _e.ed === me && (h = { ..._e.ts, ...h }, (k = (A = (T = u == null ? void 0 : u.richTextParma) == null ? void 0 : T.p) == null ? void 0 : A.body) == null || k.textRuns.splice(se, 1), se--);
|
|
9088
9089
|
}
|
|
9089
9090
|
((z = (F = (H = (O = u == null ? void 0 : u.richTextParma) == null ? void 0 : O.p) == null ? void 0 : H.body) == null ? void 0 : F.textRuns) == null ? void 0 : z.length) === 0 && (u.content = (B = u == null ? void 0 : u.richTextParma) == null ? void 0 : B.v, delete u.richTextParma);
|
|
9090
9091
|
}
|
|
@@ -9797,7 +9798,7 @@ let qs = class extends de {
|
|
|
9797
9798
|
for (let R = a; R <= d; R++) {
|
|
9798
9799
|
const I = h.getValue(w, R);
|
|
9799
9800
|
if (I) {
|
|
9800
|
-
const y =
|
|
9801
|
+
const y = oe.deepClone(I);
|
|
9801
9802
|
f.setValue(m - c, R - a, {
|
|
9802
9803
|
...Bi(),
|
|
9803
9804
|
...y
|
|
@@ -9906,13 +9907,13 @@ let qs = class extends de {
|
|
|
9906
9907
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
9907
9908
|
async _pasteInternal(e, t) {
|
|
9908
9909
|
var R, I;
|
|
9909
|
-
const n =
|
|
9910
|
+
const n = oe.deepClone(this._copyContentCache.get(e)), { range: i, matrix: o, unitId: s, subUnitId: l } = n || {};
|
|
9910
9911
|
if (!o || !n || !i || !s || !l || !o || !n)
|
|
9911
9912
|
return !1;
|
|
9912
9913
|
const a = (R = this._univerInstanceService.getUniverSheetInstance(s)) == null ? void 0 : R.getStyles();
|
|
9913
9914
|
o.forValue((y, M, E) => {
|
|
9914
9915
|
if (typeof E.s == "string") {
|
|
9915
|
-
const P =
|
|
9916
|
+
const P = oe.deepClone(E);
|
|
9916
9917
|
P.s = a == null ? void 0 : a.getStyleByCell(E), o.setValue(y, M, P);
|
|
9917
9918
|
}
|
|
9918
9919
|
if (E.colSpan || E.rowSpan)
|
|
@@ -10899,7 +10900,7 @@ function Ni(r) {
|
|
|
10899
10900
|
return !0;
|
|
10900
10901
|
const a = s.getUnitId(), c = l.getSheetId(), d = [new J(a).id, new te(a, c).id];
|
|
10901
10902
|
return n.getSubunitRuleList(a, c).filter((h) => h.ranges.some((g) => he.intersects(o, g))).forEach((h) => {
|
|
10902
|
-
d.push(new
|
|
10903
|
+
d.push(new ie(a, c, h.permissionId).id);
|
|
10903
10904
|
}), i.composePermission(d).some((h) => h.value === !1);
|
|
10904
10905
|
})
|
|
10905
10906
|
);
|
|
@@ -10916,7 +10917,7 @@ function Qm(r, e) {
|
|
|
10916
10917
|
return !0;
|
|
10917
10918
|
const c = l.getUnitId(), d = a.getSheetId(), u = [new J(c).id, new te(c, d).id];
|
|
10918
10919
|
return i.getSubunitRuleList(c, d).filter((g) => e === "row" ? g.ranges.some((m) => s.startRow > m.startRow && s.startRow <= m.endRow) : g.ranges.some((m) => s.startColumn > m.startColumn && s.startColumn <= m.endColumn)).forEach((g) => {
|
|
10919
|
-
u.push(new
|
|
10920
|
+
u.push(new ie(c, d, g.permissionId).id);
|
|
10920
10921
|
}), o.composePermission(u).some((g) => g.value === !1);
|
|
10921
10922
|
})
|
|
10922
10923
|
);
|
|
@@ -10931,9 +10932,9 @@ function Km(r, e) {
|
|
|
10931
10932
|
const l = t.getCurrentUnitForType(x.UNIVER_SHEET), a = l == null ? void 0 : l.getActiveSheet();
|
|
10932
10933
|
if (!l || !a)
|
|
10933
10934
|
return !0;
|
|
10934
|
-
const c = l.getUnitId(), d = a.getSheetId(), u = [new J(c).id, new te(c, d).id], h =
|
|
10935
|
+
const c = l.getUnitId(), d = a.getSheetId(), u = [new J(c).id, new te(c, d).id], h = oe.deepClone(s);
|
|
10935
10936
|
return e === "row" ? (h.startColumn = 0, h.endColumn = a.getColumnCount() - 1) : (h.startRow = 0, h.endRow = a.getRowCount() - 1), i.getSubunitRuleList(c, d).filter((m) => m.ranges.some((f) => he.intersects(h, f))).forEach((m) => {
|
|
10936
|
-
u.push(new
|
|
10937
|
+
u.push(new ie(c, d, m.permissionId).id);
|
|
10937
10938
|
}), o.composePermission(u).some((m) => m.value === !1);
|
|
10938
10939
|
})
|
|
10939
10940
|
);
|
|
@@ -10948,9 +10949,9 @@ function aa(r, e) {
|
|
|
10948
10949
|
const l = t.getCurrentUnitForType(x.UNIVER_SHEET), a = l == null ? void 0 : l.getActiveSheet();
|
|
10949
10950
|
if (!l || !a)
|
|
10950
10951
|
return !0;
|
|
10951
|
-
const c = l.getUnitId(), d = a.getSheetId(), u = [new J(c).id, new te(c, d).id], h =
|
|
10952
|
+
const c = l.getUnitId(), d = a.getSheetId(), u = [new J(c).id, new te(c, d).id], h = oe.deepClone(s);
|
|
10952
10953
|
return e === "row" ? h.endRow = a.getRowCount() - 1 : h.endColumn = a.getColumnCount() - 1, i.getSubunitRuleList(c, d).filter((m) => m.ranges.some((f) => he.intersects(h, f))).forEach((m) => {
|
|
10953
|
-
u.push(new
|
|
10954
|
+
u.push(new ie(c, d, m.permissionId).id);
|
|
10954
10955
|
}), o.composePermission(u).some((m) => m.value === !1);
|
|
10955
10956
|
})
|
|
10956
10957
|
);
|
|
@@ -10995,7 +10996,7 @@ function uw(r) {
|
|
|
10995
10996
|
};
|
|
10996
10997
|
}),
|
|
10997
10998
|
hidden$: ue(r, x.UNIVER_SHEET),
|
|
10998
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [As, te], rangeTypes: [
|
|
10999
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [As, te], rangeTypes: [ie] }, !0)
|
|
10999
11000
|
};
|
|
11000
11001
|
}
|
|
11001
11002
|
function hw(r) {
|
|
@@ -11006,7 +11007,7 @@ function hw(r) {
|
|
|
11006
11007
|
icon: "BoldSingle",
|
|
11007
11008
|
title: "Set bold",
|
|
11008
11009
|
tooltip: "toolbar.bold",
|
|
11009
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
11010
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] }, !0),
|
|
11010
11011
|
activated$: vt(t, !1, ({ worksheet: o }) => new ze((s) => {
|
|
11011
11012
|
var d;
|
|
11012
11013
|
const l = e.onCommandExecuted((u) => {
|
|
@@ -11056,7 +11057,7 @@ function gw(r) {
|
|
|
11056
11057
|
{
|
|
11057
11058
|
workbookTypes: [J],
|
|
11058
11059
|
worksheetTypes: [te, Ge],
|
|
11059
|
-
rangeTypes: [
|
|
11060
|
+
rangeTypes: [ie]
|
|
11060
11061
|
},
|
|
11061
11062
|
!0
|
|
11062
11063
|
),
|
|
@@ -11127,7 +11128,7 @@ function mw(r) {
|
|
|
11127
11128
|
}
|
|
11128
11129
|
return s.next(!!(c && c.s)), l.dispose;
|
|
11129
11130
|
})),
|
|
11130
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
11131
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] }, !0),
|
|
11131
11132
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
11132
11133
|
};
|
|
11133
11134
|
}
|
|
@@ -11139,7 +11140,7 @@ function fw(r) {
|
|
|
11139
11140
|
icon: "StrikethroughSingle",
|
|
11140
11141
|
title: "Set strike through",
|
|
11141
11142
|
tooltip: "toolbar.strikethrough",
|
|
11142
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
11143
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] }, !0),
|
|
11143
11144
|
activated$: vt(t, !1, ({ worksheet: o }) => new ze((s) => {
|
|
11144
11145
|
var d;
|
|
11145
11146
|
const l = e.onCommandExecuted((u) => {
|
|
@@ -11185,7 +11186,7 @@ function pw(r) {
|
|
|
11185
11186
|
},
|
|
11186
11187
|
value: o.value
|
|
11187
11188
|
})),
|
|
11188
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
11189
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] }, !0),
|
|
11189
11190
|
value$: vt(t, i, ({ worksheet: o }) => new ze((s) => {
|
|
11190
11191
|
var d;
|
|
11191
11192
|
const l = e.onCommandExecuted((u) => {
|
|
@@ -11212,7 +11213,7 @@ function pw(r) {
|
|
|
11212
11213
|
};
|
|
11213
11214
|
}
|
|
11214
11215
|
function Sw(r) {
|
|
11215
|
-
const e = r.get(D), t = r.get(N), n = r.get($), i = r.get(He), o = cd.fs, s = pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
11216
|
+
const e = r.get(D), t = r.get(N), n = r.get($), i = r.get(He), o = cd.fs, s = pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] }, !0);
|
|
11216
11217
|
return {
|
|
11217
11218
|
id: ta.id,
|
|
11218
11219
|
type: K.SELECTOR,
|
|
@@ -11265,7 +11266,7 @@ function vw(r) {
|
|
|
11265
11266
|
type: K.BUTTON,
|
|
11266
11267
|
title: "toolbar.resetColor",
|
|
11267
11268
|
icon: "NoColor",
|
|
11268
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
11269
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] }, !0),
|
|
11269
11270
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
11270
11271
|
};
|
|
11271
11272
|
}
|
|
@@ -11295,7 +11296,7 @@ function Cw(r) {
|
|
|
11295
11296
|
return n.next(i), o.dispose;
|
|
11296
11297
|
}),
|
|
11297
11298
|
hidden$: ue(r, x.UNIVER_SHEET),
|
|
11298
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
11299
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] }, !0)
|
|
11299
11300
|
};
|
|
11300
11301
|
}
|
|
11301
11302
|
function bw(r) {
|
|
@@ -11304,7 +11305,7 @@ function bw(r) {
|
|
|
11304
11305
|
type: K.BUTTON,
|
|
11305
11306
|
title: "toolbar.resetColor",
|
|
11306
11307
|
icon: "NoColor",
|
|
11307
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
11308
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] })
|
|
11308
11309
|
};
|
|
11309
11310
|
}
|
|
11310
11311
|
function _w(r) {
|
|
@@ -11333,7 +11334,7 @@ function _w(r) {
|
|
|
11333
11334
|
return n.next(i), o.dispose;
|
|
11334
11335
|
}),
|
|
11335
11336
|
hidden$: ue(r, x.UNIVER_SHEET),
|
|
11336
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
11337
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] })
|
|
11337
11338
|
};
|
|
11338
11339
|
}
|
|
11339
11340
|
const ah = [
|
|
@@ -11384,7 +11385,7 @@ function ww(r) {
|
|
|
11384
11385
|
return o.next(a != null ? a : n), s.dispose;
|
|
11385
11386
|
})),
|
|
11386
11387
|
hidden$: ue(r, x.UNIVER_SHEET),
|
|
11387
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
11388
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] })
|
|
11388
11389
|
};
|
|
11389
11390
|
}
|
|
11390
11391
|
const ch = [
|
|
@@ -11435,7 +11436,7 @@ function Rw(r) {
|
|
|
11435
11436
|
return o.next(a != null ? a : n), s.dispose;
|
|
11436
11437
|
})),
|
|
11437
11438
|
hidden$: ue(r, x.UNIVER_SHEET),
|
|
11438
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
11439
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] })
|
|
11439
11440
|
};
|
|
11440
11441
|
}
|
|
11441
11442
|
const dh = [
|
|
@@ -11486,7 +11487,7 @@ function Iw(r) {
|
|
|
11486
11487
|
return o.next(a != null ? a : n), s.dispose;
|
|
11487
11488
|
})),
|
|
11488
11489
|
hidden$: ue(r, x.UNIVER_SHEET),
|
|
11489
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
11490
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] })
|
|
11490
11491
|
};
|
|
11491
11492
|
}
|
|
11492
11493
|
const uh = [
|
|
@@ -11552,7 +11553,7 @@ function yw(r) {
|
|
|
11552
11553
|
return (a == null ? void 0 : a.v) === Ke.TRUE ? o.next("v") : o.next((d = a && a.a) != null ? d : n), s.dispose;
|
|
11553
11554
|
})),
|
|
11554
11555
|
hidden$: ue(r, x.UNIVER_SHEET),
|
|
11555
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
11556
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] })
|
|
11556
11557
|
};
|
|
11557
11558
|
}
|
|
11558
11559
|
function qo(r) {
|
|
@@ -11577,7 +11578,7 @@ function Ta(r) {
|
|
|
11577
11578
|
title: "rightClick.paste",
|
|
11578
11579
|
icon: "PasteSpecial",
|
|
11579
11580
|
disabled$: qo(r).pipe(
|
|
11580
|
-
dr(pe(r, { rangeTypes: [
|
|
11581
|
+
dr(pe(r, { rangeTypes: [ie], worksheetTypes: [te, Ge, Jt], workbookTypes: [J] })),
|
|
11581
11582
|
Be(([e, t]) => e || t)
|
|
11582
11583
|
),
|
|
11583
11584
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
@@ -11599,7 +11600,7 @@ function xa(r) {
|
|
|
11599
11600
|
type: K.BUTTON,
|
|
11600
11601
|
title: "rightClick.pasteValue",
|
|
11601
11602
|
disabled$: qo(r).pipe(
|
|
11602
|
-
dr(pe(r, { rangeTypes: [
|
|
11603
|
+
dr(pe(r, { rangeTypes: [ie], worksheetTypes: [Jt, te], workbookTypes: [J] })),
|
|
11603
11604
|
Be(([e, t]) => e || t)
|
|
11604
11605
|
),
|
|
11605
11606
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
@@ -11611,7 +11612,7 @@ function Aa(r) {
|
|
|
11611
11612
|
type: K.BUTTON,
|
|
11612
11613
|
title: "rightClick.pasteFormat",
|
|
11613
11614
|
disabled$: qo(r).pipe(
|
|
11614
|
-
dr(pe(r, { rangeTypes: [
|
|
11615
|
+
dr(pe(r, { rangeTypes: [ie], worksheetTypes: [Ge, te], workbookTypes: [J] })),
|
|
11615
11616
|
Be(([e, t]) => e || t)
|
|
11616
11617
|
),
|
|
11617
11618
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
@@ -11623,7 +11624,7 @@ function ka(r) {
|
|
|
11623
11624
|
type: K.BUTTON,
|
|
11624
11625
|
title: "rightClick.pasteColWidth",
|
|
11625
11626
|
disabled$: qo(r).pipe(
|
|
11626
|
-
dr(pe(r, { rangeTypes: [
|
|
11627
|
+
dr(pe(r, { rangeTypes: [ie], worksheetTypes: [Dr, te], workbookTypes: [J] })),
|
|
11627
11628
|
Be(([e, t]) => e || t)
|
|
11628
11629
|
)
|
|
11629
11630
|
};
|
|
@@ -11634,7 +11635,7 @@ function Ha(r) {
|
|
|
11634
11635
|
type: K.BUTTON,
|
|
11635
11636
|
title: "rightClick.pasteBesidesBorder",
|
|
11636
11637
|
disabled$: qo(r).pipe(
|
|
11637
|
-
dr(pe(r, { rangeTypes: [
|
|
11638
|
+
dr(pe(r, { rangeTypes: [ie], worksheetTypes: [te, Ge, Jt, Nr, Dr], workbookTypes: [J] })),
|
|
11638
11639
|
Be(([e, t]) => e || t)
|
|
11639
11640
|
),
|
|
11640
11641
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
@@ -11646,7 +11647,7 @@ function Mw(r) {
|
|
|
11646
11647
|
type: K.BUTTON,
|
|
11647
11648
|
icon: "AutoHeight",
|
|
11648
11649
|
title: "rightClick.fitContent",
|
|
11649
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Nr, te], rangeTypes: [
|
|
11650
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Nr, te], rangeTypes: [ie] }),
|
|
11650
11651
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
11651
11652
|
};
|
|
11652
11653
|
}
|
|
@@ -11656,7 +11657,7 @@ function Ew(r) {
|
|
|
11656
11657
|
type: K.BUTTON,
|
|
11657
11658
|
icon: "AutoWidth",
|
|
11658
11659
|
title: "rightClick.fitContent",
|
|
11659
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Nr, te], rangeTypes: [
|
|
11660
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Nr, te], rangeTypes: [ie] }),
|
|
11660
11661
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
11661
11662
|
};
|
|
11662
11663
|
}
|
|
@@ -11726,7 +11727,7 @@ function xw(r) {
|
|
|
11726
11727
|
type: K.BUTTON,
|
|
11727
11728
|
icon: "Hide",
|
|
11728
11729
|
title: "rightClick.hideSelectedRow",
|
|
11729
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Nr, te], rangeTypes: [
|
|
11730
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Nr, te], rangeTypes: [ie] }),
|
|
11730
11731
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
11731
11732
|
};
|
|
11732
11733
|
}
|
|
@@ -11736,7 +11737,7 @@ function Aw(r) {
|
|
|
11736
11737
|
type: K.BUTTON,
|
|
11737
11738
|
icon: "Hide",
|
|
11738
11739
|
title: "rightClick.hideSelectedColumn",
|
|
11739
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Dr], rangeTypes: [
|
|
11740
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Dr], rangeTypes: [ie] }),
|
|
11740
11741
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
11741
11742
|
};
|
|
11742
11743
|
}
|
|
@@ -11761,7 +11762,7 @@ function kw(r) {
|
|
|
11761
11762
|
});
|
|
11762
11763
|
return s.next(!l()), () => a.dispose();
|
|
11763
11764
|
})),
|
|
11764
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Nr], rangeTypes: [
|
|
11765
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Nr], rangeTypes: [ie] })
|
|
11765
11766
|
};
|
|
11766
11767
|
}
|
|
11767
11768
|
function Hw(r) {
|
|
@@ -11785,7 +11786,7 @@ function Hw(r) {
|
|
|
11785
11786
|
});
|
|
11786
11787
|
return s.next(!l()), () => a.dispose();
|
|
11787
11788
|
})),
|
|
11788
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Dr, te], rangeTypes: [
|
|
11789
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Dr, te], rangeTypes: [ie] })
|
|
11789
11790
|
};
|
|
11790
11791
|
}
|
|
11791
11792
|
function Vw(r) {
|
|
@@ -11816,7 +11817,7 @@ function Vw(r) {
|
|
|
11816
11817
|
});
|
|
11817
11818
|
return l(), a.dispose;
|
|
11818
11819
|
})),
|
|
11819
|
-
hidden$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Nr], rangeTypes: [
|
|
11820
|
+
hidden$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Nr], rangeTypes: [ie] })
|
|
11820
11821
|
};
|
|
11821
11822
|
}
|
|
11822
11823
|
function Nw(r) {
|
|
@@ -11848,12 +11849,12 @@ function Nw(r) {
|
|
|
11848
11849
|
});
|
|
11849
11850
|
return l(), a.dispose;
|
|
11850
11851
|
})),
|
|
11851
|
-
hidden$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Dr], rangeTypes: [
|
|
11852
|
+
hidden$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Dr], rangeTypes: [ie] })
|
|
11852
11853
|
};
|
|
11853
11854
|
}
|
|
11854
11855
|
function Qo(r) {
|
|
11855
11856
|
var a;
|
|
11856
|
-
const e = r.get(N), t = r.get(Od), n = e.getUniverDocInstance(
|
|
11857
|
+
const e = r.get(N), t = r.get(Od), n = e.getUniverDocInstance(Le), i = t.getActiveTextRange();
|
|
11857
11858
|
if (n == null || i == null) return null;
|
|
11858
11859
|
const o = (a = n.getBody()) == null ? void 0 : a.textRuns;
|
|
11859
11860
|
if (o == null) return;
|
|
@@ -12913,7 +12914,7 @@ let _o = class extends de {
|
|
|
12913
12914
|
}
|
|
12914
12915
|
// eslint-disable-next-line max-lines-per-function
|
|
12915
12916
|
_rowColumnMoving(e, t, n, i, o) {
|
|
12916
|
-
var B, j, Y, le, me,
|
|
12917
|
+
var B, j, Y, le, me, se, _e;
|
|
12917
12918
|
const s = this._context.scene, l = (B = this._sheetSkeletonManagerService.getCurrentParam()) == null ? void 0 : B.skeleton;
|
|
12918
12919
|
if (l == null)
|
|
12919
12920
|
return;
|
|
@@ -12970,7 +12971,7 @@ let _o = class extends de {
|
|
|
12970
12971
|
Ie = R - z / 2, this._changeToColumn = S + 1;
|
|
12971
12972
|
else
|
|
12972
12973
|
return;
|
|
12973
|
-
(
|
|
12974
|
+
(se = this._moveHelperLineShape) == null || se.transformByState({
|
|
12974
12975
|
height: d,
|
|
12975
12976
|
width: z,
|
|
12976
12977
|
left: Ie,
|
|
@@ -13208,21 +13209,21 @@ let Js = class extends de {
|
|
|
13208
13209
|
top: 0
|
|
13209
13210
|
});
|
|
13210
13211
|
const O = ((le = this._columnResizeRect) == null ? void 0 : le.left) || 0, H = ((me = this._rowResizeRect) == null ? void 0 : me.top) || 0;
|
|
13211
|
-
s.addObject(this._resizeHelperShape, ar), s.disableObjectsEvent(), this._scenePointerMoveSub = s.onPointerMove$.subscribeEvent((
|
|
13212
|
+
s.addObject(this._resizeHelperShape, ar), s.disableObjectsEvent(), this._scenePointerMoveSub = s.onPointerMove$.subscribeEvent((se) => {
|
|
13212
13213
|
var Xe, tt, wt, Ct, Kt, Gn;
|
|
13213
13214
|
const _e = s.getCoordRelativeToViewport(
|
|
13214
13215
|
ke.FromArray([this._startOffsetX, this._startOffsetY])
|
|
13215
|
-
), Ie = s.getScrollXYInfoByViewport(_e, d), G = _s(
|
|
13216
|
-
w = ee - this._startOffsetX -
|
|
13216
|
+
), Ie = s.getScrollXYInfoByViewport(_e, d), G = _s(se.offsetX, se.offsetY, s), { x: ee, y: ae } = G, { scaleX: Se, scaleY: ve } = s.getAncestorScale(), ce = Math.max(Se, ve), re = zc / ce;
|
|
13217
|
+
w = ee - this._startOffsetX - re / 2, R = ae - this._startOffsetY - re / 2, Math.abs(e === 0 ? R : w) >= i0 && (C = !0), e === 0 ? (R > a - u + Ie.y - v.startY && (R = a - u + Ie.y - v.startY), R < -(v.endY - v.startY) + 2 && (R = -(v.endY - v.startY) + 2), C && ((Xe = this._resizeHelperShape) == null || Xe.transformByState({
|
|
13217
13218
|
top: S + R
|
|
13218
13219
|
}), (tt = this._rowResizeRect) == null || tt.transformByState({
|
|
13219
|
-
top: H + R +
|
|
13220
|
+
top: H + R + re / 2
|
|
13220
13221
|
}), (wt = this._rowResizeRect) == null || wt.show(), s.setCursor(ye.ROW_RESIZE))) : (w > c - h + Ie.x - v.startX && (w = c - h + Ie.x - v.startX), w < -(v.endX - v.startX) + 2 && (w = -(v.endX - v.startX) + 2), C && ((Ct = this._resizeHelperShape) == null || Ct.transformByState({
|
|
13221
13222
|
left: p + w
|
|
13222
13223
|
}), (Kt = this._columnResizeRect) == null || Kt.transformByState({
|
|
13223
|
-
left: O + w +
|
|
13224
|
+
left: O + w + re / 2
|
|
13224
13225
|
}), (Gn = this._columnResizeRect) == null || Gn.show(), s.setCursor(ye.COLUMN_RESIZE)));
|
|
13225
|
-
}), this._scenePointerUpSub = s.onPointerUp$.subscribeEvent((
|
|
13226
|
+
}), this._scenePointerUpSub = s.onPointerUp$.subscribeEvent((se) => {
|
|
13226
13227
|
var Ie, G, ee;
|
|
13227
13228
|
const _e = this._context.scene;
|
|
13228
13229
|
this._clearObserverEvent(), (Ie = this._resizeHelperShape) == null || Ie.dispose(), this._resizeHelperShape = null, _e.enableObjectsEvent(), C && (_e.resetCursor(), (G = this._rowResizeRect) == null || G.hide(), (ee = this._columnResizeRect) == null || ee.hide(), e === 0 ? this._commandService.executeCommand(lv.id, {
|
|
@@ -13736,11 +13737,11 @@ const hr = {
|
|
|
13736
13737
|
const f = {
|
|
13737
13738
|
unitId: l,
|
|
13738
13739
|
subUnitId: a,
|
|
13739
|
-
ranges:
|
|
13740
|
+
ranges: oe.deepClone(d)
|
|
13740
13741
|
}, p = {
|
|
13741
13742
|
unitId: l,
|
|
13742
13743
|
subUnitId: a,
|
|
13743
|
-
ranges:
|
|
13744
|
+
ranges: oe.deepClone(d)
|
|
13744
13745
|
}, S = Bl(r, f), v = Ul(r, p);
|
|
13745
13746
|
if (S.ranges.length > 0 && h.push({ id: $t.id, params: S }), h.push({ id: en.id, params: p }), g.push({ id: $t.id, params: v }), S.ranges.length > 0 && g.push({ id: en.id, params: S }), m) {
|
|
13746
13747
|
const M = nf(r, l, u, d);
|
|
@@ -14120,7 +14121,7 @@ const Bn = {
|
|
|
14120
14121
|
subUnitId: a,
|
|
14121
14122
|
ranges: []
|
|
14122
14123
|
};
|
|
14123
|
-
return await e.executeCommand(Bn.id, { showDetail: !0, rule:
|
|
14124
|
+
return await e.executeCommand(Bn.id, { showDetail: !0, rule: oe.deepClone(u), oldRule: oe.deepClone(u) }), !0;
|
|
14124
14125
|
} else {
|
|
14125
14126
|
const u = (d = n.getCurrentLastSelection()) == null ? void 0 : d.range;
|
|
14126
14127
|
if (!u)
|
|
@@ -14135,7 +14136,7 @@ const Bn = {
|
|
|
14135
14136
|
unitId: l,
|
|
14136
14137
|
subUnitId: a
|
|
14137
14138
|
};
|
|
14138
|
-
return await e.executeCommand(Bn.id, { showDetail: !0, rule:
|
|
14139
|
+
return await e.executeCommand(Bn.id, { showDetail: !0, rule: oe.deepClone(f), oldRule: oe.deepClone(f) }), !0;
|
|
14139
14140
|
} else
|
|
14140
14141
|
return !1;
|
|
14141
14142
|
}
|
|
@@ -14755,7 +14756,7 @@ const za = {
|
|
|
14755
14756
|
value: ve
|
|
14756
14757
|
});
|
|
14757
14758
|
});
|
|
14758
|
-
const
|
|
14759
|
+
const se = (ve) => {
|
|
14759
14760
|
P(ve);
|
|
14760
14761
|
}, _e = (ve) => {
|
|
14761
14762
|
P(ve || "");
|
|
@@ -14768,13 +14769,13 @@ const za = {
|
|
|
14768
14769
|
F(m.t("definedName.nameDuplicate"));
|
|
14769
14770
|
return;
|
|
14770
14771
|
}
|
|
14771
|
-
if (!
|
|
14772
|
+
if (!oe.isValidParameter(y) || Yv(y) || !oe.isStartValidPosition(y) && !pS(y.substring(0, 1))) {
|
|
14772
14773
|
F(m.t("definedName.nameInvalid"));
|
|
14773
14774
|
return;
|
|
14774
14775
|
}
|
|
14775
|
-
if (g.getSheetOrders().map((
|
|
14776
|
+
if (g.getSheetOrders().map((re) => {
|
|
14776
14777
|
var Xe;
|
|
14777
|
-
return ((Xe = g.getSheetBySheetId(
|
|
14778
|
+
return ((Xe = g.getSheetBySheetId(re)) == null ? void 0 : Xe.getName()) || "";
|
|
14778
14779
|
}).includes(y)) {
|
|
14779
14780
|
F(m.t("definedName.nameSheetConflict"));
|
|
14780
14781
|
return;
|
|
@@ -14804,8 +14805,8 @@ const za = {
|
|
|
14804
14805
|
ce === "formula" ? l[0] === Qr.EQUALS ? P(l) : P(`${Qr.EQUALS}`) : l[0] === Qr.EQUALS ? P("") : P(l), B(ce);
|
|
14805
14806
|
}, ee = An({}), [ae, Se] = ne(!1);
|
|
14806
14807
|
return Qh((ve) => {
|
|
14807
|
-
var
|
|
14808
|
-
const ce = (
|
|
14808
|
+
var re;
|
|
14809
|
+
const ce = (re = ee.current) == null ? void 0 : re.handleOutClick;
|
|
14809
14810
|
ce && ce(ve, () => Se(!1));
|
|
14810
14811
|
}), /* @__PURE__ */ q("div", { className: Et.definedNameInput, style: { display: t ? "block" : "none" }, children: [
|
|
14811
14812
|
/* @__PURE__ */ b("div", { children: /* @__PURE__ */ b(Ns, { placeholder: m.t("definedName.inputNamePlaceholder"), value: y, allowClear: !0, onChange: M, affixWrapperStyle: za }) }),
|
|
@@ -14819,7 +14820,7 @@ const za = {
|
|
|
14819
14820
|
unitId: R,
|
|
14820
14821
|
subUnitId: I,
|
|
14821
14822
|
initialValue: E,
|
|
14822
|
-
onChange: (ve, ce) =>
|
|
14823
|
+
onChange: (ve, ce) => se(ce),
|
|
14823
14824
|
supportAcrossSheet: !0
|
|
14824
14825
|
}
|
|
14825
14826
|
) : w && /* @__PURE__ */ b(
|
|
@@ -14887,7 +14888,7 @@ const za = {
|
|
|
14887
14888
|
const { name: A, formulaOrRefString: k, comment: O, localSheetId: H, hidden: F } = T;
|
|
14888
14889
|
let z = T.id;
|
|
14889
14890
|
if (z == null || z.length === 0)
|
|
14890
|
-
z =
|
|
14891
|
+
z = oe.generateRandomId(10), r.executeCommand(mv.id, { id: z, unitId: s, name: A, formulaOrRefString: k, comment: O, localSheetId: H, hidden: F });
|
|
14891
14892
|
else {
|
|
14892
14893
|
const B = { id: z, unitId: s, name: A, formulaOrRefString: k, comment: O, localSheetId: H, hidden: F };
|
|
14893
14894
|
r.executeCommand(fv.id, B);
|
|
@@ -14991,7 +14992,7 @@ const za = {
|
|
|
14991
14992
|
] }) });
|
|
14992
14993
|
};
|
|
14993
14994
|
function T0(r) {
|
|
14994
|
-
const e = r.get(wc), t = pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
14995
|
+
const e = r.get(wc), t = pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] });
|
|
14995
14996
|
return {
|
|
14996
14997
|
id: Ic.id,
|
|
14997
14998
|
icon: new ze((n) => {
|
|
@@ -15037,7 +15038,7 @@ function ja(r) {
|
|
|
15037
15038
|
id: oi.id,
|
|
15038
15039
|
type: K.BUTTON,
|
|
15039
15040
|
title: "rightClick.clearContent",
|
|
15040
|
-
disabled$: Vi(r, pe(r, { workbookTypes: [J], worksheetTypes: [te, Jt], rangeTypes: [
|
|
15041
|
+
disabled$: Vi(r, pe(r, { workbookTypes: [J], worksheetTypes: [te, Jt], rangeTypes: [ie] })),
|
|
15041
15042
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
15042
15043
|
};
|
|
15043
15044
|
}
|
|
@@ -15046,7 +15047,7 @@ function Ya(r) {
|
|
|
15046
15047
|
id: $i.id,
|
|
15047
15048
|
type: K.BUTTON,
|
|
15048
15049
|
title: "rightClick.clearFormat",
|
|
15049
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
15050
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] }),
|
|
15050
15051
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
15051
15052
|
};
|
|
15052
15053
|
}
|
|
@@ -15055,7 +15056,7 @@ function Za(r) {
|
|
|
15055
15056
|
id: bs.id,
|
|
15056
15057
|
type: K.BUTTON,
|
|
15057
15058
|
title: "rightClick.clearAll",
|
|
15058
|
-
disabled$: Vi(r, pe(r, { workbookTypes: [J], worksheetTypes: [te, Jt, Ge], rangeTypes: [
|
|
15059
|
+
disabled$: Vi(r, pe(r, { workbookTypes: [J], worksheetTypes: [te, Jt, Ge], rangeTypes: [ie] })),
|
|
15059
15060
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
15060
15061
|
};
|
|
15061
15062
|
}
|
|
@@ -15096,7 +15097,7 @@ function x0(r) {
|
|
|
15096
15097
|
type: K.BUTTON,
|
|
15097
15098
|
title: "rightClick.moveLeft",
|
|
15098
15099
|
icon: "DeleteCellShiftLeft",
|
|
15099
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te], rangeTypes: [
|
|
15100
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te], rangeTypes: [ie] }),
|
|
15100
15101
|
hidden$: aa(r, "col")
|
|
15101
15102
|
};
|
|
15102
15103
|
}
|
|
@@ -15106,7 +15107,7 @@ function A0(r) {
|
|
|
15106
15107
|
type: K.BUTTON,
|
|
15107
15108
|
title: "rightClick.moveUp",
|
|
15108
15109
|
icon: "DeleteCellShiftUp",
|
|
15109
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te], rangeTypes: [
|
|
15110
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te], rangeTypes: [ie] }),
|
|
15110
15111
|
hidden$: aa(r, "row")
|
|
15111
15112
|
};
|
|
15112
15113
|
}
|
|
@@ -15139,7 +15140,7 @@ function H0(r) {
|
|
|
15139
15140
|
title: "rightClick.insert",
|
|
15140
15141
|
icon: "Insert",
|
|
15141
15142
|
hidden$: Vi(r, Ni(r)),
|
|
15142
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [kg, te], rangeTypes: [
|
|
15143
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [kg, te], rangeTypes: [ie] })
|
|
15143
15144
|
};
|
|
15144
15145
|
}
|
|
15145
15146
|
function V0(r) {
|
|
@@ -15170,7 +15171,7 @@ function V0(r) {
|
|
|
15170
15171
|
});
|
|
15171
15172
|
return s(), l.dispose;
|
|
15172
15173
|
})),
|
|
15173
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Fo, te], rangeTypes: [
|
|
15174
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Fo, te], rangeTypes: [ie] }),
|
|
15174
15175
|
hidden$: Qm(r, "row")
|
|
15175
15176
|
};
|
|
15176
15177
|
}
|
|
@@ -15202,7 +15203,7 @@ function N0(r) {
|
|
|
15202
15203
|
});
|
|
15203
15204
|
return s(), l.dispose;
|
|
15204
15205
|
})),
|
|
15205
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [kg, te], rangeTypes: [
|
|
15206
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [kg, te], rangeTypes: [ie] }),
|
|
15206
15207
|
hidden$: Qm(r, "col")
|
|
15207
15208
|
};
|
|
15208
15209
|
}
|
|
@@ -15212,7 +15213,7 @@ function D0(r) {
|
|
|
15212
15213
|
type: K.BUTTON,
|
|
15213
15214
|
title: "rightClick.moveRight",
|
|
15214
15215
|
icon: "InsertCellShiftRight",
|
|
15215
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te], rangeTypes: [
|
|
15216
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te], rangeTypes: [ie] }),
|
|
15216
15217
|
hidden$: aa(r, "col")
|
|
15217
15218
|
};
|
|
15218
15219
|
}
|
|
@@ -15222,7 +15223,7 @@ function L0(r) {
|
|
|
15222
15223
|
type: K.BUTTON,
|
|
15223
15224
|
title: "rightClick.moveDown",
|
|
15224
15225
|
icon: "InsertCellDown",
|
|
15225
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te], rangeTypes: [
|
|
15226
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te], rangeTypes: [ie] }),
|
|
15226
15227
|
hidden$: aa(r, "row")
|
|
15227
15228
|
};
|
|
15228
15229
|
}
|
|
@@ -15254,7 +15255,7 @@ function W0(r) {
|
|
|
15254
15255
|
});
|
|
15255
15256
|
return s(), l.dispose;
|
|
15256
15257
|
})),
|
|
15257
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Fo, te], rangeTypes: [
|
|
15258
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Fo, te], rangeTypes: [ie] }),
|
|
15258
15259
|
hidden$: Ni(r)
|
|
15259
15260
|
};
|
|
15260
15261
|
}
|
|
@@ -15286,7 +15287,7 @@ function B0(r) {
|
|
|
15286
15287
|
});
|
|
15287
15288
|
return s(), l.dispose;
|
|
15288
15289
|
})),
|
|
15289
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Fo, te], rangeTypes: [
|
|
15290
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Fo, te], rangeTypes: [ie] }),
|
|
15290
15291
|
hidden$: Ni(r)
|
|
15291
15292
|
};
|
|
15292
15293
|
}
|
|
@@ -15318,7 +15319,7 @@ function F0(r) {
|
|
|
15318
15319
|
});
|
|
15319
15320
|
return s(), l.dispose;
|
|
15320
15321
|
})),
|
|
15321
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Fo, te], rangeTypes: [
|
|
15322
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Fo, te], rangeTypes: [ie] }),
|
|
15322
15323
|
hidden$: Ni(r)
|
|
15323
15324
|
};
|
|
15324
15325
|
}
|
|
@@ -15350,12 +15351,12 @@ function U0(r) {
|
|
|
15350
15351
|
});
|
|
15351
15352
|
return s(), l.dispose;
|
|
15352
15353
|
})),
|
|
15353
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Fo, te], rangeTypes: [
|
|
15354
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Fo, te], rangeTypes: [ie] }),
|
|
15354
15355
|
hidden$: Ni(r)
|
|
15355
15356
|
};
|
|
15356
15357
|
}
|
|
15357
15358
|
function z0(r) {
|
|
15358
|
-
const e = pe(r, { workbookTypes: [J], worksheetTypes: [te, Jt, Ge], rangeTypes: [
|
|
15359
|
+
const e = pe(r, { workbookTypes: [J], worksheetTypes: [te, Jt, Ge], rangeTypes: [ie] }), t = Xw(r);
|
|
15359
15360
|
return {
|
|
15360
15361
|
id: hr.id,
|
|
15361
15362
|
icon: "MergeAllSingle",
|
|
@@ -17662,11 +17663,11 @@ function jR(r, e, t) {
|
|
|
17662
17663
|
if (f && p) {
|
|
17663
17664
|
const S = new Je(), v = new Je(), C = f.getCellMatrix(), w = p.getCellMatrix();
|
|
17664
17665
|
Ss.foreach(u, (B, j) => {
|
|
17665
|
-
S.setValue(B, j,
|
|
17666
|
+
S.setValue(B, j, oe.deepClone(C.getValue(B, j))), v.setValue(B, j, null);
|
|
17666
17667
|
});
|
|
17667
17668
|
const R = new Je();
|
|
17668
17669
|
Ss.foreach(d, (B, j) => {
|
|
17669
|
-
R.setValue(B, j,
|
|
17670
|
+
R.setValue(B, j, oe.deepClone(w.getValue(B, j)));
|
|
17670
17671
|
});
|
|
17671
17672
|
const I = new Je();
|
|
17672
17673
|
Ss.foreach(u, (B, j) => {
|
|
@@ -17796,15 +17797,15 @@ function ep(r, e, t, n) {
|
|
|
17796
17797
|
}
|
|
17797
17798
|
const { row: S, col: v } = c(g, m);
|
|
17798
17799
|
if ((C = f.p) != null && C.body && Wc(f.p.body)) {
|
|
17799
|
-
const w =
|
|
17800
|
+
const w = oe.deepClone({ p: f.p, v: p != null ? p : f.v });
|
|
17800
17801
|
d.setValue(S, v, w);
|
|
17801
17802
|
} else
|
|
17802
|
-
d.setValue(S, v,
|
|
17803
|
+
d.setValue(S, v, oe.deepClone({ v: p != null ? p : f.v, t: f.t }));
|
|
17803
17804
|
});
|
|
17804
17805
|
const u = {
|
|
17805
17806
|
unitId: i,
|
|
17806
17807
|
subUnitId: o,
|
|
17807
|
-
cellValue:
|
|
17808
|
+
cellValue: oe.deepClone(d.getMatrix())
|
|
17808
17809
|
};
|
|
17809
17810
|
l.push({
|
|
17810
17811
|
id: we.id,
|
|
@@ -17848,7 +17849,7 @@ function tp(r, e, t, n = !1) {
|
|
|
17848
17849
|
const u = {
|
|
17849
17850
|
unitId: s,
|
|
17850
17851
|
subUnitId: l,
|
|
17851
|
-
cellValue:
|
|
17852
|
+
cellValue: oe.deepClone(c.getMatrix())
|
|
17852
17853
|
};
|
|
17853
17854
|
i.push({
|
|
17854
17855
|
id: we.id,
|
|
@@ -17877,7 +17878,7 @@ function np(r, e, t) {
|
|
|
17877
17878
|
const d = {
|
|
17878
17879
|
subUnitId: l,
|
|
17879
17880
|
unitId: s,
|
|
17880
|
-
cellValue:
|
|
17881
|
+
cellValue: oe.deepClone(o.getMatrix())
|
|
17881
17882
|
};
|
|
17882
17883
|
n.push({
|
|
17883
17884
|
id: we.id,
|
|
@@ -17903,7 +17904,7 @@ function YR(r, e, t) {
|
|
|
17903
17904
|
const d = {
|
|
17904
17905
|
subUnitId: l,
|
|
17905
17906
|
unitId: s,
|
|
17906
|
-
cellValue:
|
|
17907
|
+
cellValue: oe.deepClone(o.getMatrix())
|
|
17907
17908
|
};
|
|
17908
17909
|
n.push({
|
|
17909
17910
|
id: we.id,
|
|
@@ -17982,7 +17983,7 @@ function jc(r, e, t) {
|
|
|
17982
17983
|
}), { undos: i, redos: n };
|
|
17983
17984
|
}
|
|
17984
17985
|
function ZR(r) {
|
|
17985
|
-
if (!r.includes("\r") &&
|
|
17986
|
+
if (!r.includes("\r") && oe.isLegalUrl(r)) {
|
|
17986
17987
|
const n = ld(), i = `${r}`, o = {
|
|
17987
17988
|
startIndex: 0,
|
|
17988
17989
|
endIndex: i.length - 1,
|
|
@@ -18051,10 +18052,10 @@ let Ri = class extends Un {
|
|
|
18051
18052
|
this._commandService.executeCommand(Bc.id, { htmlContent: l, textContent: a, files: c });
|
|
18052
18053
|
});
|
|
18053
18054
|
};
|
|
18054
|
-
let t = (n = this._renderManagerService.getRenderById(
|
|
18055
|
+
let t = (n = this._renderManagerService.getRenderById(Le)) == null ? void 0 : n.with(_r);
|
|
18055
18056
|
t && e(t), this._renderManagerService.created$.subscribe((i) => {
|
|
18056
18057
|
var o;
|
|
18057
|
-
i.unitId ===
|
|
18058
|
+
i.unitId === Le && (t = (o = this._renderManagerService.getRenderById(Le)) == null ? void 0 : o.with(_r), t && e(t));
|
|
18058
18059
|
});
|
|
18059
18060
|
}
|
|
18060
18061
|
_resolveClipboardFiles(e) {
|
|
@@ -18317,7 +18318,7 @@ let Ri = class extends Un {
|
|
|
18317
18318
|
_onPastePlainText(e, t, n) {
|
|
18318
18319
|
const { range: i, unitId: o, subUnitId: s } = e;
|
|
18319
18320
|
let l;
|
|
18320
|
-
if (/\r|\n/.test(t) ||
|
|
18321
|
+
if (/\r|\n/.test(t) || oe.isLegalUrl(t)) {
|
|
18321
18322
|
const c = ZR(t), d = this._generateDocumentDataModelSnapshot({ body: c });
|
|
18322
18323
|
l = {
|
|
18323
18324
|
[i.rows[0]]: {
|
|
@@ -18460,7 +18461,7 @@ let Ri = class extends Un {
|
|
|
18460
18461
|
a.forValue((w, R, I) => {
|
|
18461
18462
|
const y = I.s;
|
|
18462
18463
|
if (typeof y == "object") {
|
|
18463
|
-
const M =
|
|
18464
|
+
const M = oe.deepClone(I);
|
|
18464
18465
|
M.s && (M.s = {
|
|
18465
18466
|
...y,
|
|
18466
18467
|
bd: null
|
|
@@ -19648,7 +19649,7 @@ let To = class extends de {
|
|
|
19648
19649
|
break;
|
|
19649
19650
|
n = this._sheetPermissionCheckController.permissionCheckWithoutRange({
|
|
19650
19651
|
workbookTypes: [J],
|
|
19651
|
-
rangeTypes: [
|
|
19652
|
+
rangeTypes: [ie],
|
|
19652
19653
|
worksheetTypes: [Jt, te]
|
|
19653
19654
|
}), i = this._localeService.t("permission.dialog.editErr");
|
|
19654
19655
|
break;
|
|
@@ -19657,14 +19658,14 @@ let To = class extends de {
|
|
|
19657
19658
|
break;
|
|
19658
19659
|
n = this._sheetPermissionCheckController.permissionCheckWithoutRange({
|
|
19659
19660
|
workbookTypes: [J],
|
|
19660
|
-
rangeTypes: [
|
|
19661
|
+
rangeTypes: [ie],
|
|
19661
19662
|
worksheetTypes: [Jt, te]
|
|
19662
19663
|
}), i = this._localeService.t("permission.dialog.editErr");
|
|
19663
19664
|
break;
|
|
19664
19665
|
case li.id:
|
|
19665
19666
|
n = this._sheetPermissionCheckController.permissionCheckWithoutRange({
|
|
19666
19667
|
workbookTypes: [J],
|
|
19667
|
-
rangeTypes: [
|
|
19668
|
+
rangeTypes: [ie],
|
|
19668
19669
|
worksheetTypes: [te, Dr]
|
|
19669
19670
|
}), i = this._localeService.t("permission.dialog.pasteErr");
|
|
19670
19671
|
break;
|
|
@@ -19674,7 +19675,7 @@ let To = class extends de {
|
|
|
19674
19675
|
case ia.id:
|
|
19675
19676
|
n = this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
19676
19677
|
workbookTypes: [J],
|
|
19677
|
-
rangeTypes: [
|
|
19678
|
+
rangeTypes: [ie],
|
|
19678
19679
|
worksheetTypes: [te, Jt, Ge]
|
|
19679
19680
|
}), i = this._localeService.t("permission.dialog.commonErr");
|
|
19680
19681
|
break;
|
|
@@ -19685,7 +19686,7 @@ let To = class extends de {
|
|
|
19685
19686
|
case ki.id:
|
|
19686
19687
|
n = this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
19687
19688
|
workbookTypes: [J],
|
|
19688
|
-
rangeTypes: [
|
|
19689
|
+
rangeTypes: [ie],
|
|
19689
19690
|
worksheetTypes: [Ge, te]
|
|
19690
19691
|
}), i = this._localeService.t("permission.dialog.setStyleErr");
|
|
19691
19692
|
break;
|
|
@@ -19699,7 +19700,7 @@ let To = class extends de {
|
|
|
19699
19700
|
case Xm.id:
|
|
19700
19701
|
n = this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
19701
19702
|
workbookTypes: [Zi, J],
|
|
19702
|
-
rangeTypes: [Cc,
|
|
19703
|
+
rangeTypes: [Cc, ie],
|
|
19703
19704
|
worksheetTypes: [As, te]
|
|
19704
19705
|
}), i = this._localeService.t("permission.dialog.copyErr"), (s = this._permissionService.getPermissionPoint(new Zi(this._univerInstanceService.getCurrentUnitForType(x.UNIVER_SHEET).getUnitId()).id)) != null && s.value || (i = this._localeService.t("permission.dialog.workbookCopyErr"));
|
|
19705
19706
|
break;
|
|
@@ -19722,15 +19723,15 @@ let To = class extends de {
|
|
|
19722
19723
|
_permissionCheckByPaste(e) {
|
|
19723
19724
|
return e.value === nt.SPECIAL_PASTE_VALUE || e.value === nt.SPECIAL_PASTE_FORMULA ? this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
19724
19725
|
workbookTypes: [J],
|
|
19725
|
-
rangeTypes: [
|
|
19726
|
+
rangeTypes: [ie],
|
|
19726
19727
|
worksheetTypes: [Ge, te]
|
|
19727
19728
|
}) : e.value === nt.SPECIAL_PASTE_FORMAT ? this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
19728
19729
|
workbookTypes: [J],
|
|
19729
|
-
rangeTypes: [
|
|
19730
|
+
rangeTypes: [ie],
|
|
19730
19731
|
worksheetTypes: [Ge, te]
|
|
19731
19732
|
}) : this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
19732
19733
|
workbookTypes: [J],
|
|
19733
|
-
rangeTypes: [
|
|
19734
|
+
rangeTypes: [ie],
|
|
19734
19735
|
worksheetTypes: [Jt, Ge, te]
|
|
19735
19736
|
});
|
|
19736
19737
|
}
|
|
@@ -20565,8 +20566,8 @@ const op = (r, e, t, n, i) => {
|
|
|
20565
20566
|
objectIDs: Y,
|
|
20566
20567
|
unitID: F,
|
|
20567
20568
|
actions: Vv
|
|
20568
|
-
}), me = o.getSubunitRuleList(F, z).map((G) => G.permissionId),
|
|
20569
|
-
|
|
20569
|
+
}), me = o.getSubunitRuleList(F, z).map((G) => G.permissionId), se = (Ie = s.getRule(F, z)) == null ? void 0 : Ie.permissionId;
|
|
20570
|
+
se && me.push(se);
|
|
20570
20571
|
const _e = le.filter((G) => {
|
|
20571
20572
|
var ee;
|
|
20572
20573
|
return me.includes(G.objectID) || G.objectID === ((ee = s.getRule(F, z)) == null ? void 0 : ee.permissionId);
|
|
@@ -20629,8 +20630,8 @@ const op = (r, e, t, n, i) => {
|
|
|
20629
20630
|
children: {
|
|
20630
20631
|
label: wo,
|
|
20631
20632
|
showDetail: !0,
|
|
20632
|
-
rule:
|
|
20633
|
-
oldRule:
|
|
20633
|
+
rule: oe.deepClone(O),
|
|
20634
|
+
oldRule: oe.deepClone(O)
|
|
20634
20635
|
},
|
|
20635
20636
|
width: 330
|
|
20636
20637
|
};
|
|
@@ -20654,11 +20655,11 @@ const op = (r, e, t, n, i) => {
|
|
|
20654
20655
|
const H = E.get(O.objectID);
|
|
20655
20656
|
if (!H)
|
|
20656
20657
|
return null;
|
|
20657
|
-
const F = O.actions.find((
|
|
20658
|
+
const F = O.actions.find((re) => re.action === fe.Edit), z = F == null ? void 0 : F.allowed, B = O.actions.find((re) => re.action === fe.View), j = B == null ? void 0 : B.allowed, Y = O.actions.find((re) => re.action === fe.ManageCollaborator), le = O.actions.find((re) => re.action === fe.Delete), me = (Y == null ? void 0 : Y.allowed) || g.userID === ((ee = O.creator) == null ? void 0 : ee.userID), se = (le == null ? void 0 : le.allowed) || g.userID === ((ae = O.creator) == null ? void 0 : ae.userID);
|
|
20658
20659
|
let _e = "";
|
|
20659
20660
|
const Ie = C.getSheetBySheetId(H.subUnitId), G = Ie == null ? void 0 : Ie.getName();
|
|
20660
20661
|
if (H.unitType === Tn.SelectRange) {
|
|
20661
|
-
const
|
|
20662
|
+
const re = H.ranges, Xe = re != null && re.length ? re.map((tt) => {
|
|
20662
20663
|
const wt = Qg(tt);
|
|
20663
20664
|
return wt === "NaN" ? "" : wt;
|
|
20664
20665
|
}).filter((tt) => !!tt).join(",") : "";
|
|
@@ -20669,11 +20670,11 @@ const op = (r, e, t, n, i) => {
|
|
|
20669
20670
|
{
|
|
20670
20671
|
className: je.sheetPermissionListItem,
|
|
20671
20672
|
onMouseMove: () => {
|
|
20672
|
-
const { subUnitId:
|
|
20673
|
+
const { subUnitId: re, unitType: Xe } = H, tt = C.getActiveSheet();
|
|
20673
20674
|
if (!tt)
|
|
20674
20675
|
return !1;
|
|
20675
20676
|
const wt = tt.getSheetId();
|
|
20676
|
-
if (
|
|
20677
|
+
if (re !== wt)
|
|
20677
20678
|
return !1;
|
|
20678
20679
|
if (Xe === Tn.SelectRange) {
|
|
20679
20680
|
const Ct = H.ranges || [];
|
|
@@ -20687,9 +20688,9 @@ const op = (r, e, t, n, i) => {
|
|
|
20687
20688
|
children: [
|
|
20688
20689
|
/* @__PURE__ */ q("div", { className: je.sheetPermissionListItemHeader, children: [
|
|
20689
20690
|
/* @__PURE__ */ b(er, { title: _e, children: /* @__PURE__ */ b("div", { className: je.sheetPermissionListItemHeaderName, children: _e }) }),
|
|
20690
|
-
(me ||
|
|
20691
|
+
(me || se) && /* @__PURE__ */ q("div", { className: je.sheetPermissionListItemHeaderOperator, children: [
|
|
20691
20692
|
me && /* @__PURE__ */ b(er, { title: i.t("permission.panel.edit"), children: /* @__PURE__ */ b("div", { className: je.sheetPermissionListItemHeaderIcon, onClick: () => P(H), children: /* @__PURE__ */ b(Yd, {}) }) }),
|
|
20692
|
-
|
|
20693
|
+
se && /* @__PURE__ */ b(er, { title: i.t("permission.panel.delete"), children: /* @__PURE__ */ b("div", { className: je.sheetPermissionListItemHeaderIcon, onClick: () => M(H), children: /* @__PURE__ */ b(Ql, {}) }) })
|
|
20693
20694
|
] })
|
|
20694
20695
|
] }),
|
|
20695
20696
|
/* @__PURE__ */ b("div", { className: je.sheetPermissionListItemSplit }),
|
|
@@ -21348,7 +21349,7 @@ let Zc = class extends de {
|
|
|
21348
21349
|
d = i.rangeWithCoord.startX + g.left - a, u = i.rangeWithCoord.endY + g.top - c;
|
|
21349
21350
|
break;
|
|
21350
21351
|
}
|
|
21351
|
-
d =
|
|
21352
|
+
d = oe.clamp(d, h, g.width), u = oe.clamp(u, g.top, g.height), this._contextMenuService.triggerContextMenu({
|
|
21352
21353
|
clientX: d,
|
|
21353
21354
|
clientY: u,
|
|
21354
21355
|
preventDefault: () => {
|
|
@@ -22418,9 +22419,9 @@ let Ao = class extends Un {
|
|
|
22418
22419
|
_initialize() {
|
|
22419
22420
|
this._syncEditorSize(), this._listenFxBtnClick(), this._handleContentChange(), this._univerInstanceService.focused$.pipe(gi(this.dispose$)).subscribe((e) => {
|
|
22420
22421
|
this._create(e);
|
|
22421
|
-
}), this._create(
|
|
22422
|
+
}), this._create(De), this.disposeWithMe(this._editorService.focus$.subscribe(() => {
|
|
22422
22423
|
var t;
|
|
22423
|
-
((t = this._editorService.getFocusEditor()) == null ? void 0 : t.getEditorId()) !==
|
|
22424
|
+
((t = this._editorService.getFocusEditor()) == null ? void 0 : t.getEditorId()) !== De ? this._contextService.setContextValue(At, !1) : this._contextService.setContextValue(At, !0);
|
|
22424
22425
|
}));
|
|
22425
22426
|
}
|
|
22426
22427
|
_handleContentChange() {
|
|
@@ -22428,13 +22429,13 @@ let Ao = class extends Un {
|
|
|
22428
22429
|
this._commandService.onCommandExecuted((e) => {
|
|
22429
22430
|
if (e.id === Hs.id) {
|
|
22430
22431
|
const t = e.params, { unitId: n } = t;
|
|
22431
|
-
n ===
|
|
22432
|
+
n === De && this.autoScroll();
|
|
22432
22433
|
}
|
|
22433
22434
|
})
|
|
22434
22435
|
);
|
|
22435
22436
|
}
|
|
22436
22437
|
_create(e) {
|
|
22437
|
-
if (e !==
|
|
22438
|
+
if (e !== De)
|
|
22438
22439
|
return;
|
|
22439
22440
|
const t = this._renderManagerService.getRenderById(e);
|
|
22440
22441
|
if (t == null)
|
|
@@ -22446,9 +22447,9 @@ let Ao = class extends Un {
|
|
|
22446
22447
|
this._formulaEditorManagerService.fxBtnClick$.pipe(gi(this.dispose$)).subscribe(() => {
|
|
22447
22448
|
var t, n;
|
|
22448
22449
|
if (this._contextService.getContextValue(hc) && !this._contextService.getContextValue($e)) {
|
|
22449
|
-
this._univerInstanceService.setCurrentUnitForType(
|
|
22450
|
+
this._univerInstanceService.setCurrentUnitForType(De), this._contextService.setContextValue(At, !0);
|
|
22450
22451
|
const i = this._univerInstanceService.getCurrentUnitForType(x.UNIVER_SHEET), o = this._univerInstanceService.getUniverDocInstance(
|
|
22451
|
-
|
|
22452
|
+
De
|
|
22452
22453
|
);
|
|
22453
22454
|
this._editorBridgeService.isVisible().visible === !1 && this._commandService.syncExecuteCommand(
|
|
22454
22455
|
at.id,
|
|
@@ -22469,7 +22470,7 @@ let Ao = class extends Un {
|
|
|
22469
22470
|
endOffset: a.length
|
|
22470
22471
|
}
|
|
22471
22472
|
], d = {
|
|
22472
|
-
unitId:
|
|
22473
|
+
unitId: De,
|
|
22473
22474
|
body: {
|
|
22474
22475
|
dataStream: a
|
|
22475
22476
|
},
|
|
@@ -22480,11 +22481,11 @@ let Ao = class extends Un {
|
|
|
22480
22481
|
});
|
|
22481
22482
|
}
|
|
22482
22483
|
_syncEditorSize() {
|
|
22483
|
-
const e = this._univerInstanceService.unitAdded$.pipe(Vl((t) => t.getUnitId() ===
|
|
22484
|
+
const e = this._univerInstanceService.unitAdded$.pipe(Vl((t) => t.getUnitId() === De));
|
|
22484
22485
|
this.disposeWithMe(dt([this._formulaEditorManagerService.position$, e]).subscribe(([t]) => {
|
|
22485
22486
|
if (!t) return this._clearScheduledCallback();
|
|
22486
|
-
const n = kd(
|
|
22487
|
-
|
|
22487
|
+
const n = kd(De, this._renderManagerService), i = this._univerInstanceService.getUniverDocInstance(
|
|
22488
|
+
De
|
|
22488
22489
|
);
|
|
22489
22490
|
if (n == null || i == null) return this._clearScheduledCallback();
|
|
22490
22491
|
const { width: o, height: s } = t;
|
|
@@ -22498,8 +22499,8 @@ let Ao = class extends Un {
|
|
|
22498
22499
|
}
|
|
22499
22500
|
autoScroll() {
|
|
22500
22501
|
var m, f;
|
|
22501
|
-
const e = this._formulaEditorManagerService.getPosition(), t = (m = this._renderManagerService.getRenderById(
|
|
22502
|
-
|
|
22502
|
+
const e = this._formulaEditorManagerService.getPosition(), t = (m = this._renderManagerService.getRenderById(De)) == null ? void 0 : m.with(ir).getSkeleton(), n = this._renderManagerService.getRenderById(De), i = this._univerInstanceService.getUniverDocInstance(
|
|
22503
|
+
De
|
|
22503
22504
|
);
|
|
22504
22505
|
if (t == null || e == null || n == null || i == null)
|
|
22505
22506
|
return;
|
|
@@ -22570,8 +22571,8 @@ let bl = class extends de {
|
|
|
22570
22571
|
// Sync cell content to formula editor bar when sheet selection changed or visible changed.
|
|
22571
22572
|
_editorSyncHandler(r) {
|
|
22572
22573
|
var i, o, s;
|
|
22573
|
-
let e =
|
|
22574
|
-
const t =
|
|
22574
|
+
let e = oe.deepClone((i = r.documentLayoutObject.documentModel) == null ? void 0 : i.getBody());
|
|
22575
|
+
const t = oe.deepClone((o = r.documentLayoutObject.documentModel) == null ? void 0 : o.drawings), n = oe.deepClone((s = r.documentLayoutObject.documentModel) == null ? void 0 : s.getDrawingsOrder());
|
|
22575
22576
|
(!e || r.isInArrayFormulaRange === !0 && this._editorBridgeService.isVisible().eventType === Ye.Dblclick) && (e = {
|
|
22576
22577
|
dataStream: `\r
|
|
22577
22578
|
`,
|
|
@@ -22581,10 +22582,10 @@ let bl = class extends de {
|
|
|
22581
22582
|
}
|
|
22582
22583
|
],
|
|
22583
22584
|
textRuns: []
|
|
22584
|
-
}), this._syncContentAndRender(
|
|
22585
|
+
}), this._syncContentAndRender(De, e, t, n);
|
|
22585
22586
|
}
|
|
22586
22587
|
_commandExecutedListener() {
|
|
22587
|
-
const r = [
|
|
22588
|
+
const r = [Le, De];
|
|
22588
22589
|
this.disposeWithMe(
|
|
22589
22590
|
this._commandService.onCommandExecuted((t) => {
|
|
22590
22591
|
if (t.id === Hs.id) {
|
|
@@ -22592,7 +22593,7 @@ let bl = class extends de {
|
|
|
22592
22593
|
if (s || o === Vh.id)
|
|
22593
22594
|
return;
|
|
22594
22595
|
if (r.includes(i)) {
|
|
22595
|
-
const l = this._univerInstanceService.getUnit(i, x.UNIVER_DOC), a = i ===
|
|
22596
|
+
const l = this._univerInstanceService.getUnit(i, x.UNIVER_DOC), a = i === De ? Le : De;
|
|
22596
22597
|
this._checkAndSetRenderStyleConfig(l), this._syncActionsAndRender(a, n);
|
|
22597
22598
|
}
|
|
22598
22599
|
}
|
|
@@ -22609,10 +22610,10 @@ let bl = class extends de {
|
|
|
22609
22610
|
let u = !1;
|
|
22610
22611
|
const { row: h, column: g } = d;
|
|
22611
22612
|
if (t.id === we.id && t.params ? (i = (n = t.params.cellValue) == null ? void 0 : n[h]) != null && i[g] && (u = !0) : t.id === sr.id && t.params && (s = (o = t.params.to.value) == null ? void 0 : o[h]) != null && s[g] && (u = !0), u) {
|
|
22612
|
-
const m =
|
|
22613
|
+
const m = oe.deepClone((l = d.documentLayoutObject.documentModel) == null ? void 0 : l.getBody()), f = oe.deepClone((a = d.documentLayoutObject.documentModel) == null ? void 0 : a.drawings), p = oe.deepClone((c = d.documentLayoutObject.documentModel) == null ? void 0 : c.getDrawingsOrder());
|
|
22613
22614
|
if (m == null)
|
|
22614
22615
|
return;
|
|
22615
|
-
this._syncContentAndRender(
|
|
22616
|
+
this._syncContentAndRender(De, m, f, p);
|
|
22616
22617
|
}
|
|
22617
22618
|
}
|
|
22618
22619
|
})
|
|
@@ -22621,7 +22622,7 @@ let bl = class extends de {
|
|
|
22621
22622
|
// Sync actions between cell editor and formula editor, and make `dataStream` and `paragraph` is the same.
|
|
22622
22623
|
_syncActionsAndRender(r, e) {
|
|
22623
22624
|
var l;
|
|
22624
|
-
const t = [
|
|
22625
|
+
const t = [Le, De], n = this._renderManagerService.getRenderById(r);
|
|
22625
22626
|
if (n == null)
|
|
22626
22627
|
return;
|
|
22627
22628
|
const i = n.with(ir).getSkeleton(), o = this._univerInstanceService.getUnit(r, x.UNIVER_DOC), s = this._getEditorViewModel(r);
|
|
@@ -22635,18 +22636,18 @@ let bl = class extends de {
|
|
|
22635
22636
|
}
|
|
22636
22637
|
_syncContentAndRender(r, e, t, n) {
|
|
22637
22638
|
var c, d;
|
|
22638
|
-
r ===
|
|
22639
|
-
const i = [
|
|
22639
|
+
r === De && e.paragraphs && (e.paragraphs = this._clearParagraph(e.paragraphs));
|
|
22640
|
+
const i = [Le, De], o = (c = this._renderManagerService.getRenderById(r)) == null ? void 0 : c.with(ir).getSkeleton(), s = this._univerInstanceService.getUnit(r, x.UNIVER_DOC), l = this._getEditorViewModel(r);
|
|
22640
22641
|
if (s == null || l == null || o == null)
|
|
22641
22642
|
return;
|
|
22642
22643
|
s.getSnapshot().body = e, s.getSnapshot().drawings = t != null ? t : {}, s.getSnapshot().drawingsOrder = n != null ? n : [], this._checkAndSetRenderStyleConfig(s), l.reset(s);
|
|
22643
22644
|
const a = this._renderManagerService.getRenderById(r);
|
|
22644
|
-
a != null && (o.calculate(), i.includes(r) && ((d = a.mainComponent) == null || d.makeDirty()), r ===
|
|
22645
|
+
a != null && (o.calculate(), i.includes(r) && ((d = a.mainComponent) == null || d.makeDirty()), r === De && this._formulaEditorController.autoScroll());
|
|
22645
22646
|
}
|
|
22646
22647
|
_checkAndSetRenderStyleConfig(r) {
|
|
22647
22648
|
var o;
|
|
22648
22649
|
const e = r.getSnapshot(), { body: t } = e;
|
|
22649
|
-
if (e.id !==
|
|
22650
|
+
if (e.id !== De)
|
|
22650
22651
|
return;
|
|
22651
22652
|
e.documentStyle = kM;
|
|
22652
22653
|
let n = e.documentStyle.renderConfig;
|
|
@@ -22662,7 +22663,7 @@ let bl = class extends de {
|
|
|
22662
22663
|
((o = t == null ? void 0 : t.dataStream) != null ? o : "").startsWith("=") ? n.isRenderStyle = Ke.TRUE : n.isRenderStyle = Ke.FALSE;
|
|
22663
22664
|
}
|
|
22664
22665
|
_clearParagraph(r) {
|
|
22665
|
-
const e =
|
|
22666
|
+
const e = oe.deepClone(r);
|
|
22666
22667
|
for (const t of e)
|
|
22667
22668
|
t.paragraphStyle && (t.paragraphStyle.horizontalAlign = yt.UNSPECIFIED);
|
|
22668
22669
|
return e;
|
|
@@ -22739,7 +22740,7 @@ let _l = class extends de {
|
|
|
22739
22740
|
} : t, f = Array.from({ length: m.endRow - m.startRow + 1 }, () => Array.from({ length: m.endColumn - m.startColumn + 1 }, () => ({}))), p = [];
|
|
22740
22741
|
f.forEach((B, j) => {
|
|
22741
22742
|
B.forEach((Y, le) => {
|
|
22742
|
-
const me = j % h + a,
|
|
22743
|
+
const me = j % h + a, se = le % g + c, _e = l.getValue(me, se);
|
|
22743
22744
|
_e && (f[j][le].s = Object.keys(_e).length > 0 ? _e : null);
|
|
22744
22745
|
});
|
|
22745
22746
|
}), s.forEach((B) => {
|
|
@@ -22750,21 +22751,21 @@ let _l = class extends de {
|
|
|
22750
22751
|
endColumn: B.endColumn - c
|
|
22751
22752
|
}, Y = Math.max(1, Math.floor((m.endRow - m.startRow + 1) / h)), le = Math.max(1, Math.floor((m.endColumn - m.startColumn + 1) / g));
|
|
22752
22753
|
for (let me = 0; me < Y; me++)
|
|
22753
|
-
for (let
|
|
22754
|
+
for (let se = 0; se < le; se++)
|
|
22754
22755
|
p.push({
|
|
22755
22756
|
startRow: j.startRow + me * h + m.startRow,
|
|
22756
|
-
startColumn: j.startColumn +
|
|
22757
|
+
startColumn: j.startColumn + se * g + m.startColumn,
|
|
22757
22758
|
endRow: j.endRow + me * h + m.startRow,
|
|
22758
|
-
endColumn: j.endColumn +
|
|
22759
|
+
endColumn: j.endColumn + se * g + m.startColumn
|
|
22759
22760
|
});
|
|
22760
22761
|
});
|
|
22761
22762
|
const S = [m], v = new Je(), C = new Je();
|
|
22762
|
-
if (
|
|
22763
|
+
if (oe.isArray(f))
|
|
22763
22764
|
for (let B = 0; B < S.length; B++) {
|
|
22764
22765
|
const { startRow: j, startColumn: Y, endRow: le, endColumn: me } = S[B];
|
|
22765
|
-
for (let
|
|
22766
|
+
for (let se = 0; se <= le - j; se++)
|
|
22766
22767
|
for (let _e = 0; _e <= me - Y; _e++)
|
|
22767
|
-
v.setValue(
|
|
22768
|
+
v.setValue(se + j, _e + Y, { s: null }), C.setValue(se + j, _e + Y, f[se][_e]);
|
|
22768
22769
|
}
|
|
22769
22770
|
const w = {
|
|
22770
22771
|
subUnitId: e,
|
|
@@ -23061,8 +23062,8 @@ let Jc = class extends Un {
|
|
|
23061
23062
|
const a = this._contextService.getContextValue(At), c = this._contextService.getContextValue(kt), d = o.unitId;
|
|
23062
23063
|
this._editorBridgeService.isVisible().visible || d && c && !a && this._showEditorByKeyboard(l);
|
|
23063
23064
|
})), e.add(t));
|
|
23064
|
-
}, i = this._renderManagerService.getRenderById(
|
|
23065
|
-
i ? n(i) : this.disposeWithMe(this._renderManagerService.created$.pipe(Vl((o) => o.unitId ===
|
|
23065
|
+
}, i = this._renderManagerService.getRenderById(Le);
|
|
23066
|
+
i ? n(i) : this.disposeWithMe(this._renderManagerService.created$.pipe(Vl((o) => o.unitId === Le)).subscribe((o) => {
|
|
23066
23067
|
t == null || t.dispose(), n(o);
|
|
23067
23068
|
}));
|
|
23068
23069
|
}
|