@univerjs/sheets-ui 0.6.5 → 0.6.6-nightly.202503151606
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 +27 -27
- package/lib/es/index.js +340 -333
- package/lib/types/controllers/auto-height.controller.d.ts +4 -10
- package/lib/umd/index.js +6 -6
- package/package.json +13 -13
- package/LICENSE +0 -176
package/lib/es/index.js
CHANGED
|
@@ -2,14 +2,14 @@ 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
|
-
import { BehaviorSubject as Me, Subject as xe, of as Re, merge as _t, map 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,
|
|
9
|
+
import { BehaviorSubject as Me, Subject as xe, of as Re, merge as _t, map as Fe, 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, getSheetCommandTarget as Be, 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, 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
|
-
import { IDefinedNamesService as zo, FUNCTION_NAMES_STATISTICAL as
|
|
12
|
+
import { IDefinedNamesService as zo, FUNCTION_NAMES_STATISTICAL as Ue, 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";
|
|
14
14
|
import { jsx as b, jsxs as q, Fragment as Mr } from "react/jsx-runtime";
|
|
15
15
|
import { DropdownMenu as Jg, clsx as qe, Dropdown as Vs, DropdownLegacy as Gv, Tooltip as er, MessageType as $g, InputNumber as qv, Separator as Qv, ColorPicker as xd, Input as Ns, RadioGroup as yc, Radio as ei, Select as em, Button as pn, Confirm as Kv, FormLayout as Ds, Avatar as Ad, Switch as Jv } from "@univerjs/design";
|
|
@@ -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
|
}
|
|
@@ -2074,7 +2074,7 @@ function PE() {
|
|
|
2074
2074
|
r.getTypeOfUnitAdded$(x.UNIVER_SHEET),
|
|
2075
2075
|
r.getTypeOfUnitDisposed$(x.UNIVER_SHEET)
|
|
2076
2076
|
]).pipe(
|
|
2077
|
-
|
|
2077
|
+
Fe(() => r.getAllUnitsForType(x.UNIVER_SHEET)),
|
|
2078
2078
|
Gt(r.getAllUnitsForType(x.UNIVER_SHEET))
|
|
2079
2079
|
), [], void 0, [r]);
|
|
2080
2080
|
}
|
|
@@ -2101,39 +2101,45 @@ let co = class extends de {
|
|
|
2101
2101
|
e = e === void 0 ? n : Math.min(e, n), t = t === void 0 ? i : Math.max(t, i);
|
|
2102
2102
|
return t - e + 1;
|
|
2103
2103
|
}
|
|
2104
|
-
getUndoRedoParamsOfAutoHeight(r) {
|
|
2105
|
-
var
|
|
2106
|
-
const { _univerInstanceService:
|
|
2107
|
-
|
|
2104
|
+
getUndoRedoParamsOfAutoHeight(r, e) {
|
|
2105
|
+
var S;
|
|
2106
|
+
const { _univerInstanceService: t, _configService: n } = this, i = t.getCurrentUnitForType(x.UNIVER_SHEET), o = i.getUnitId();
|
|
2107
|
+
let s = i.getActiveSheet(), l = s.getSheetId();
|
|
2108
|
+
if (e) {
|
|
2109
|
+
const v = Be(t, { unitId: o, subUnitId: e });
|
|
2110
|
+
v && (s = v.worksheet, l = s.getSheetId());
|
|
2111
|
+
}
|
|
2112
|
+
const c = this._renderManagerService.getRenderById(o).with(ge).ensureSkeleton(l);
|
|
2113
|
+
if (!c)
|
|
2108
2114
|
return {
|
|
2109
2115
|
redos: [],
|
|
2110
2116
|
undos: []
|
|
2111
2117
|
};
|
|
2112
|
-
const
|
|
2113
|
-
let
|
|
2114
|
-
Array.isArray(r) || (r && r.startRow !== void 0 && r.startRow !== void 0 ?
|
|
2115
|
-
const
|
|
2116
|
-
if (((
|
|
2118
|
+
const d = n.getConfig(Ln);
|
|
2119
|
+
let u = r;
|
|
2120
|
+
Array.isArray(r) || (r && r.startRow !== void 0 && r.startRow !== void 0 ? u = [r] : u = []);
|
|
2121
|
+
const h = this._getRangesScope(u);
|
|
2122
|
+
if (((S = d == null ? void 0 : d.maxAutoHeightCount) != null ? S : 1e3) < h)
|
|
2117
2123
|
return {
|
|
2118
2124
|
redos: [],
|
|
2119
2125
|
undos: []
|
|
2120
2126
|
};
|
|
2121
|
-
const
|
|
2122
|
-
subUnitId:
|
|
2127
|
+
const m = c.calculateAutoHeightInRange(r), f = {
|
|
2128
|
+
subUnitId: l,
|
|
2123
2129
|
unitId: o,
|
|
2124
|
-
rowsAutoHeightInfo:
|
|
2125
|
-
},
|
|
2130
|
+
rowsAutoHeightInfo: m
|
|
2131
|
+
}, p = og(f, s);
|
|
2126
2132
|
return {
|
|
2127
2133
|
undos: [
|
|
2128
2134
|
{
|
|
2129
2135
|
id: yr.id,
|
|
2130
|
-
params:
|
|
2136
|
+
params: p
|
|
2131
2137
|
}
|
|
2132
2138
|
],
|
|
2133
2139
|
redos: [
|
|
2134
2140
|
{
|
|
2135
2141
|
id: yr.id,
|
|
2136
|
-
params:
|
|
2142
|
+
params: f
|
|
2137
2143
|
}
|
|
2138
2144
|
]
|
|
2139
2145
|
};
|
|
@@ -2145,7 +2151,7 @@ let co = class extends de {
|
|
|
2145
2151
|
getMutations: (t) => {
|
|
2146
2152
|
if (t.id === Ho.id) {
|
|
2147
2153
|
const n = t.params;
|
|
2148
|
-
return this.getUndoRedoParamsOfAutoHeight(n.range);
|
|
2154
|
+
return this.getUndoRedoParamsOfAutoHeight(n.range, n.subUnitId);
|
|
2149
2155
|
}
|
|
2150
2156
|
return {
|
|
2151
2157
|
redos: [],
|
|
@@ -2156,7 +2162,7 @@ let co = class extends de {
|
|
|
2156
2162
|
getMutations: (t) => t.id !== Nl.id ? {
|
|
2157
2163
|
redos: [],
|
|
2158
2164
|
undos: []
|
|
2159
|
-
} : this.getUndoRedoParamsOfAutoHeight(t.params.ranges)
|
|
2165
|
+
} : this.getUndoRedoParamsOfAutoHeight(t.params.ranges, t.params.subUnitId)
|
|
2160
2166
|
})), this.disposeWithMe(r.interceptCommand({
|
|
2161
2167
|
getMutations: (t) => {
|
|
2162
2168
|
var i, o;
|
|
@@ -2171,7 +2177,7 @@ let co = class extends de {
|
|
|
2171
2177
|
undos: []
|
|
2172
2178
|
};
|
|
2173
2179
|
const n = (o = e.getCurrentSelections()) == null ? void 0 : o.map((s) => s.range);
|
|
2174
|
-
return n != null && n.length ? this.getUndoRedoParamsOfAutoHeight(n) : {
|
|
2180
|
+
return n != null && n.length ? this.getUndoRedoParamsOfAutoHeight(n, t.params.subUnitId) : {
|
|
2175
2181
|
redos: [],
|
|
2176
2182
|
undos: []
|
|
2177
2183
|
};
|
|
@@ -2371,7 +2377,7 @@ function bC(r, e, t) {
|
|
|
2371
2377
|
function Tr(r, e) {
|
|
2372
2378
|
const t = [];
|
|
2373
2379
|
for (let n = 1; n <= e; n++) {
|
|
2374
|
-
const i = (n - 1) % r.length, o =
|
|
2380
|
+
const i = (n - 1) % r.length, o = oe.deepClone(r[i]);
|
|
2375
2381
|
Or(o), t.push({
|
|
2376
2382
|
v: null,
|
|
2377
2383
|
s: null,
|
|
@@ -2416,7 +2422,7 @@ function Fs(r, e, t) {
|
|
|
2416
2422
|
i.push(Number((o = r[c]) == null ? void 0 : o.v));
|
|
2417
2423
|
if (r.length > 2 && wC(i))
|
|
2418
2424
|
for (let c = 1; c <= e; c++) {
|
|
2419
|
-
const d = (c - 1) % r.length, u =
|
|
2425
|
+
const d = (c - 1) % r.length, u = oe.deepClone(r[d]);
|
|
2420
2426
|
Or(u);
|
|
2421
2427
|
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
2428
|
u && (Wu(u) && (u.v = h), n.push(u));
|
|
@@ -2424,7 +2430,7 @@ function Fs(r, e, t) {
|
|
|
2424
2430
|
else {
|
|
2425
2431
|
const c = RC(r.length);
|
|
2426
2432
|
for (let d = 1; d <= e; d++) {
|
|
2427
|
-
const u = (d - 1) % r.length, h =
|
|
2433
|
+
const u = (d - 1) % r.length, h = oe.deepClone(r[u]);
|
|
2428
2434
|
Or(h);
|
|
2429
2435
|
const g = t === W.DOWN || t === W.RIGHT, m = IC(r.length + d, i, c, g);
|
|
2430
2436
|
h && (Wu(h) && (h.v = m), n.push(h));
|
|
@@ -2452,7 +2458,7 @@ function Nu(r, e, t) {
|
|
|
2452
2458
|
var o;
|
|
2453
2459
|
const n = [], i = /0|([1-9]+[0-9]*)/g;
|
|
2454
2460
|
for (let s = 1; s <= e; s++) {
|
|
2455
|
-
const l = (s - 1) % r.length, a =
|
|
2461
|
+
const l = (s - 1) % r.length, a = oe.deepClone(r[l]);
|
|
2456
2462
|
Or(a);
|
|
2457
2463
|
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
2464
|
if (!c || !u) continue;
|
|
@@ -2471,7 +2477,7 @@ function fi(r, e, t, n = 0) {
|
|
|
2471
2477
|
if (n >= i.length) return [];
|
|
2472
2478
|
const o = i[n], s = [];
|
|
2473
2479
|
for (let c = 1; c <= e; c++) {
|
|
2474
|
-
const d = (c - 1) % r.length, u =
|
|
2480
|
+
const d = (c - 1) % r.length, u = oe.deepClone(r[d]);
|
|
2475
2481
|
Or(u);
|
|
2476
2482
|
let h = 0;
|
|
2477
2483
|
if (((l = r[r.length - 1]) == null ? void 0 : l.v) === o[0])
|
|
@@ -2493,7 +2499,7 @@ function Du(r, e, t) {
|
|
|
2493
2499
|
var i;
|
|
2494
2500
|
const n = [];
|
|
2495
2501
|
for (let o = 1; o <= e; o++) {
|
|
2496
|
-
const s = (o - 1) % r.length, l =
|
|
2502
|
+
const s = (o - 1) % r.length, l = oe.deepClone(r[s]);
|
|
2497
2503
|
Or(l);
|
|
2498
2504
|
const a = `${(i = r[r.length - 1]) == null ? void 0 : i.v}`, c = On(a) + t * o;
|
|
2499
2505
|
let d;
|
|
@@ -2544,7 +2550,7 @@ function Lu(r, e, t, n) {
|
|
|
2544
2550
|
var s;
|
|
2545
2551
|
const i = n.length, o = [];
|
|
2546
2552
|
for (let l = 1; l <= e; l++) {
|
|
2547
|
-
const a = (l - 1) % r.length, c =
|
|
2553
|
+
const a = (l - 1) % r.length, c = oe.deepClone(r[a]);
|
|
2548
2554
|
Or(c);
|
|
2549
2555
|
const d = `${(s = r[r.length - 1]) == null ? void 0 : s.v}`;
|
|
2550
2556
|
let u = n.indexOf(d) + t * l;
|
|
@@ -3147,7 +3153,7 @@ const Lr = vn("univer.auto-fill-service"), br = {
|
|
|
3147
3153
|
type: Q.COMMAND,
|
|
3148
3154
|
id: "sheet.command.auto-fill",
|
|
3149
3155
|
handler: async (r, e) => {
|
|
3150
|
-
const t = r.get(Lr), n = r.get(N), { sourceRange: i, targetRange: o } = e, s =
|
|
3156
|
+
const t = r.get(Lr), n = r.get(N), { sourceRange: i, targetRange: o } = e, s = Be(n);
|
|
3151
3157
|
if (!s) return !1;
|
|
3152
3158
|
const { subUnitId: l, unitId: a } = s;
|
|
3153
3159
|
return t.triggerAutoFill(a, l, i, o);
|
|
@@ -3156,7 +3162,7 @@ const Lr = vn("univer.auto-fill-service"), br = {
|
|
|
3156
3162
|
id: "sheet.command.auto-clear-content",
|
|
3157
3163
|
type: Q.COMMAND,
|
|
3158
3164
|
handler: async (r, e) => {
|
|
3159
|
-
const t = r.get(N), n = r.get(D), i = r.get(qt), o = r.get(Xn), s =
|
|
3165
|
+
const t = r.get(N), n = r.get(D), i = r.get(qt), o = r.get(Xn), s = Be(t);
|
|
3160
3166
|
if (!s) return !1;
|
|
3161
3167
|
const { unitId: l, subUnitId: a } = s, { clearRange: c, selectionRange: d } = e, u = {
|
|
3162
3168
|
subUnitId: a,
|
|
@@ -3214,7 +3220,7 @@ var VC = Object.getOwnPropertyDescriptor, NC = (r, e, t, n) => {
|
|
|
3214
3220
|
let Ac = class extends de {
|
|
3215
3221
|
constructor(e, t, n, i, o, s, l) {
|
|
3216
3222
|
super();
|
|
3217
|
-
_(this, "_editorUnitId",
|
|
3223
|
+
_(this, "_editorUnitId", Le);
|
|
3218
3224
|
_(this, "_editorIsDirty", !1);
|
|
3219
3225
|
_(this, "_isDisabled", !1);
|
|
3220
3226
|
_(this, "_visible", {
|
|
@@ -3231,7 +3237,7 @@ let Ac = class extends de {
|
|
|
3231
3237
|
_(this, "_currentEditCellLayout$", new Me(null));
|
|
3232
3238
|
_(this, "currentEditCellLayout$", this._currentEditCellLayout$.asObservable());
|
|
3233
3239
|
_(this, "currentEditCell$", this._currentEditCellState$.pipe(
|
|
3234
|
-
ct((e) => this._currentEditCellLayout$.pipe(
|
|
3240
|
+
ct((e) => this._currentEditCellLayout$.pipe(Fe((t) => e && t ? { ...e, ...t } : null)))
|
|
3235
3241
|
));
|
|
3236
3242
|
_(this, "_visible$", new Me(this._visible));
|
|
3237
3243
|
_(this, "visible$", this._visible$.asObservable());
|
|
@@ -3285,7 +3291,7 @@ let Ac = class extends de {
|
|
|
3285
3291
|
}, this._currentEditCellLayout$.next(this._currentEditCellLayout);
|
|
3286
3292
|
}
|
|
3287
3293
|
setEditCell(e) {
|
|
3288
|
-
this._currentEditCell = e, this._editorService.getFocusEditor() || (this._editorService.focus(
|
|
3294
|
+
this._currentEditCell = e, this._editorService.getFocusEditor() || (this._editorService.focus(Le), this._contextService.setContextValue($e, !1), this._contextService.setContextValue(Ml, !1));
|
|
3289
3295
|
const t = this.getLatestEditCellState();
|
|
3290
3296
|
if (!t) {
|
|
3291
3297
|
this._currentEditCellState = t, this._currentEditCellLayout = t, this._currentEditCellState$.next(t), this._currentEditCellLayout$.next(t);
|
|
@@ -3463,13 +3469,13 @@ const it = vn("univer.sheet-editor-bridge.service"), at = {
|
|
|
3463
3469
|
handler: (r, e) => {
|
|
3464
3470
|
if (!e)
|
|
3465
3471
|
return !1;
|
|
3466
|
-
const t = r.get(N), n =
|
|
3472
|
+
const t = r.get(N), n = Be(t);
|
|
3467
3473
|
if (!n) return !1;
|
|
3468
3474
|
const { worksheet: i, subUnitId: o, unitId: s } = n, { delta: l, reset: a } = e;
|
|
3469
3475
|
let c = a ? 100 : Math.round((i.getConfig().zoomRatio + l) * 100);
|
|
3470
3476
|
c = Math.max(Mc[0], c), c = Math.min(Mc[1], c);
|
|
3471
3477
|
const d = c / 100, h = r.get(it).isVisible();
|
|
3472
|
-
return (h.unitId === s || h.unitId ===
|
|
3478
|
+
return (h.unitId === s || h.unitId === De) && h.visible ? !1 : r.get(D).executeCommand(tn.id, {
|
|
3473
3479
|
unitId: s,
|
|
3474
3480
|
subUnitId: o,
|
|
3475
3481
|
zoomRatio: d
|
|
@@ -3482,7 +3488,7 @@ const it = vn("univer.sheet-editor-bridge.service"), at = {
|
|
|
3482
3488
|
if (!e)
|
|
3483
3489
|
return !1;
|
|
3484
3490
|
const { unitId: t, subUnitId: n, zoomRatio: i } = e, s = r.get(it).isVisible();
|
|
3485
|
-
return (s.unitId === t || s.unitId ===
|
|
3491
|
+
return (s.unitId === t || s.unitId === De) && s.visible ? !1 : r.get(D).executeCommand(tn.id, {
|
|
3486
3492
|
unitId: t,
|
|
3487
3493
|
subUnitId: n,
|
|
3488
3494
|
zoomRatio: i
|
|
@@ -3564,7 +3570,7 @@ let ho = class extends de {
|
|
|
3564
3570
|
return;
|
|
3565
3571
|
if (this._editorBridgeService) {
|
|
3566
3572
|
const c = this._editorBridgeService.isVisible();
|
|
3567
|
-
if ((c.unitId === this._context.unitId || c.unitId ===
|
|
3573
|
+
if ((c.unitId === this._context.unitId || c.unitId === De) && c.visible)
|
|
3568
3574
|
return;
|
|
3569
3575
|
}
|
|
3570
3576
|
const n = Math.abs(t.deltaX);
|
|
@@ -3957,7 +3963,7 @@ let zs = class extends de {
|
|
|
3957
3963
|
return i.rows.forEach((a) => {
|
|
3958
3964
|
const c = [];
|
|
3959
3965
|
i.cols.forEach((d) => {
|
|
3960
|
-
c.push(
|
|
3966
|
+
c.push(oe.deepClone(s.getValue(a, d)));
|
|
3961
3967
|
}), l.push(c);
|
|
3962
3968
|
}), 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
3969
|
}
|
|
@@ -4639,7 +4645,7 @@ const Bt = {
|
|
|
4639
4645
|
handler: (r, e) => {
|
|
4640
4646
|
if (!e)
|
|
4641
4647
|
return !1;
|
|
4642
|
-
const t =
|
|
4648
|
+
const t = Be(r.get(N));
|
|
4643
4649
|
if (!t) return !1;
|
|
4644
4650
|
const { workbook: n, worksheet: i } = t, o = Wo(r, e.fromCurrentSelection).getCurrentLastSelection();
|
|
4645
4651
|
if (!o)
|
|
@@ -4685,7 +4691,7 @@ const Bt = {
|
|
|
4685
4691
|
var H;
|
|
4686
4692
|
if (!e)
|
|
4687
4693
|
return !1;
|
|
4688
|
-
const t =
|
|
4694
|
+
const t = Be(r.get(N));
|
|
4689
4695
|
if (!t) return !1;
|
|
4690
4696
|
const { workbook: n, worksheet: i } = t, o = Wo(r), { direction: s, keycode: l } = e, a = s === W.LEFT || s === W.UP, c = o.getCurrentSelections().concat(), d = c.findIndex((F) => F.primary), u = c[d];
|
|
4691
4697
|
if (!u)
|
|
@@ -4744,7 +4750,7 @@ const Bt = {
|
|
|
4744
4750
|
sheetId: p,
|
|
4745
4751
|
keycode: Z.TAB
|
|
4746
4752
|
});
|
|
4747
|
-
const F =
|
|
4753
|
+
const F = oe.deepClone(v), z = T ? g.range : nr(
|
|
4748
4754
|
{
|
|
4749
4755
|
startRow: F.startRow,
|
|
4750
4756
|
startColumn: F.startColumn,
|
|
@@ -4791,7 +4797,7 @@ const Bt = {
|
|
|
4791
4797
|
type: Q.COMMAND,
|
|
4792
4798
|
handler: (r, e) => {
|
|
4793
4799
|
if (!e) return !1;
|
|
4794
|
-
const t =
|
|
4800
|
+
const t = Be(r.get(N));
|
|
4795
4801
|
if (!t) return !1;
|
|
4796
4802
|
const { worksheet: n, unitId: i, subUnitId: o } = t, s = Wo(r).getCurrentLastSelection();
|
|
4797
4803
|
if (!s) return !1;
|
|
@@ -4820,7 +4826,7 @@ const Bt = {
|
|
|
4820
4826
|
id: "sheet.command.select-all",
|
|
4821
4827
|
type: Q.COMMAND,
|
|
4822
4828
|
handler: async (r, e = { expandToGapFirst: !0, loop: !1 }) => {
|
|
4823
|
-
const t =
|
|
4829
|
+
const t = Be(r.get(N));
|
|
4824
4830
|
if (!t) return !1;
|
|
4825
4831
|
const n = Wo(r).getCurrentLastSelection();
|
|
4826
4832
|
if (!n) return !1;
|
|
@@ -5009,7 +5015,7 @@ const hn = {
|
|
|
5009
5015
|
// offsetXY derived from mouse wheel event
|
|
5010
5016
|
// this._commandService.executeCommand(SetScrollRelativeCommand.id, { offsetY });
|
|
5011
5017
|
handler: async (r, e) => {
|
|
5012
|
-
const t = r.get(D), n = r.get(N), i = r.get(be), o =
|
|
5018
|
+
const t = r.get(D), n = r.get(N), i = r.get(be), o = Be(n);
|
|
5013
5019
|
if (!o) return !1;
|
|
5014
5020
|
const { unitId: s, subUnitId: l } = o, c = i.getRenderById(s).with(Tt).getCurrentScrollState(), { offsetX: d = 0, offsetY: u = 0 } = e || {}, {
|
|
5015
5021
|
sheetViewStartRow: h = 0,
|
|
@@ -5036,7 +5042,7 @@ const hn = {
|
|
|
5036
5042
|
handler: (r, e) => {
|
|
5037
5043
|
if (!e)
|
|
5038
5044
|
return !1;
|
|
5039
|
-
const t = r.get(N), n = r.get(be), i =
|
|
5045
|
+
const t = r.get(N), n = r.get(be), i = Be(t);
|
|
5040
5046
|
if (!i) return !1;
|
|
5041
5047
|
const { workbook: o, worksheet: s, unitId: l } = i, c = n.getRenderById(l).with(Tt).getCurrentScrollState();
|
|
5042
5048
|
if (!s)
|
|
@@ -5070,7 +5076,7 @@ const hn = {
|
|
|
5070
5076
|
id: "sheet.command.scroll-view-reset",
|
|
5071
5077
|
type: Q.COMMAND,
|
|
5072
5078
|
handler: async (r) => {
|
|
5073
|
-
const e = r.get(N), t =
|
|
5079
|
+
const e = r.get(N), t = Be(e);
|
|
5074
5080
|
if (!t) return !1;
|
|
5075
5081
|
const { subUnitId: n, unitId: i } = t;
|
|
5076
5082
|
return r.get(D).executeCommand(hn.id, {
|
|
@@ -5351,7 +5357,7 @@ let fo = class extends de {
|
|
|
5351
5357
|
if (a == null) return !1;
|
|
5352
5358
|
const c = this._context.unit.getActiveSheet();
|
|
5353
5359
|
if (!c) return !1;
|
|
5354
|
-
r =
|
|
5360
|
+
r = oe.clamp(r, 0, i.length - 1), e = oe.clamp(e, 0, o.length - 1);
|
|
5355
5361
|
const {
|
|
5356
5362
|
startColumn: d,
|
|
5357
5363
|
startRow: u,
|
|
@@ -5687,9 +5693,9 @@ const O1 = () => {
|
|
|
5687
5693
|
})
|
|
5688
5694
|
).dispose, [n]), Pe(() => We(
|
|
5689
5695
|
n.showMenu$.subscribe((le) => {
|
|
5690
|
-
const { source: me, target:
|
|
5691
|
-
if (le && me &&
|
|
5692
|
-
const _e = Math.max(me.rows[me.rows.length - 1],
|
|
5696
|
+
const { source: me, target: se } = n.autoFillLocation || { source: null, target: null };
|
|
5697
|
+
if (le && me && se) {
|
|
5698
|
+
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
5699
|
d({ row: _e, col: Ie });
|
|
5694
5700
|
} else
|
|
5695
5701
|
d({ row: -1, col: -1 });
|
|
@@ -5790,7 +5796,7 @@ function V1() {
|
|
|
5790
5796
|
zoomRatio: g
|
|
5791
5797
|
});
|
|
5792
5798
|
}
|
|
5793
|
-
const c = (i == null ? void 0 : i.visible) && (i.unitId === (t == null ? void 0 : t.getUnitId()) || i.unitId ===
|
|
5799
|
+
const c = (i == null ? void 0 : i.visible) && (i.unitId === (t == null ? void 0 : t.getUnitId()) || i.unitId === De);
|
|
5794
5800
|
return /* @__PURE__ */ b(
|
|
5795
5801
|
vS,
|
|
5796
5802
|
{
|
|
@@ -5862,7 +5868,7 @@ const D1 = "univer-editor-container", L1 = "univer-editor-input", Xu = {
|
|
|
5862
5868
|
left: v,
|
|
5863
5869
|
top: C
|
|
5864
5870
|
});
|
|
5865
|
-
const y = n.getEditor(
|
|
5871
|
+
const y = n.getEditor(Le);
|
|
5866
5872
|
if (y == null)
|
|
5867
5873
|
return;
|
|
5868
5874
|
const { left: M, top: E, width: P, height: T } = y.getBoundingClientRect();
|
|
@@ -5905,7 +5911,7 @@ const D1 = "univer-editor-container", L1 = "univer-editor-input", Xu = {
|
|
|
5905
5911
|
children: u && /* @__PURE__ */ b(
|
|
5906
5912
|
u,
|
|
5907
5913
|
{
|
|
5908
|
-
editorId:
|
|
5914
|
+
editorId: Le,
|
|
5909
5915
|
className: Xu.editorInput,
|
|
5910
5916
|
initValue: "",
|
|
5911
5917
|
onChange: () => {
|
|
@@ -5972,7 +5978,7 @@ const Kl = vn(
|
|
|
5972
5978
|
handler: async (r, e) => {
|
|
5973
5979
|
const t = r.get(Mi);
|
|
5974
5980
|
r.get(kr);
|
|
5975
|
-
const n = r.get(Ae), i = r.get(N), o =
|
|
5981
|
+
const n = r.get(Ae), i = r.get(N), o = Be(i);
|
|
5976
5982
|
if (!o) return !1;
|
|
5977
5983
|
const { unitId: s } = o;
|
|
5978
5984
|
switch (e.value) {
|
|
@@ -6204,7 +6210,7 @@ function Cb(r) {
|
|
|
6204
6210
|
const A = T.getContextValue(At), k = An(null), O = L(kr);
|
|
6205
6211
|
FS(() => {
|
|
6206
6212
|
const ce = R.activeSheet$.pipe(
|
|
6207
|
-
ct((
|
|
6213
|
+
ct((re) => re ? _t(
|
|
6208
6214
|
a.ruleChange$,
|
|
6209
6215
|
c.ruleChange$,
|
|
6210
6216
|
u.selectionMoveEnd$,
|
|
@@ -6212,7 +6218,7 @@ function Cb(r) {
|
|
|
6212
6218
|
).pipe(
|
|
6213
6219
|
ct(() => {
|
|
6214
6220
|
var Kt, Gn;
|
|
6215
|
-
const Xe = R.getUnitId(), tt =
|
|
6221
|
+
const Xe = R.getUnitId(), tt = re.getSheetId();
|
|
6216
6222
|
if (!((Kt = u.getCurrentLastSelection()) == null ? void 0 : Kt.range)) return yu;
|
|
6217
6223
|
const Ct = (Gn = u.getCurrentLastSelection()) == null ? void 0 : Gn.primary;
|
|
6218
6224
|
return Ct ? Re({
|
|
@@ -6222,10 +6228,10 @@ function Cb(r) {
|
|
|
6222
6228
|
}) : Re(null);
|
|
6223
6229
|
})
|
|
6224
6230
|
) : yu)
|
|
6225
|
-
).subscribe((
|
|
6231
|
+
).subscribe((re) => {
|
|
6226
6232
|
var Xe, tt, wt, Ct, Kt, Gn;
|
|
6227
|
-
if (
|
|
6228
|
-
const { unitId: $o, subUnitId: es, primary: fp } =
|
|
6233
|
+
if (re) {
|
|
6234
|
+
const { unitId: $o, subUnitId: es, primary: fp } = re;
|
|
6229
6235
|
if (a.getRule($o, es)) {
|
|
6230
6236
|
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
6237
|
p({
|
|
@@ -6249,26 +6255,26 @@ function Cb(r) {
|
|
|
6249
6255
|
ce.unsubscribe();
|
|
6250
6256
|
};
|
|
6251
6257
|
}, [R]), Pe(() => {
|
|
6252
|
-
const ce = l.visible$.subscribe((
|
|
6253
|
-
n(
|
|
6258
|
+
const ce = l.visible$.subscribe((re) => {
|
|
6259
|
+
n(re.visible ? ut.formulaActive : ut.formulaGrey);
|
|
6254
6260
|
});
|
|
6255
6261
|
return () => ce.unsubscribe();
|
|
6256
6262
|
}, [l.visible$]), Pe(() => {
|
|
6257
|
-
const ce = l.currentEditCellState$.subscribe((
|
|
6263
|
+
const ce = l.currentEditCellState$.subscribe((re) => {
|
|
6258
6264
|
var Xe, tt, wt;
|
|
6259
|
-
(wt = (tt = (Xe =
|
|
6265
|
+
(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
6266
|
});
|
|
6261
6267
|
return () => ce.unsubscribe();
|
|
6262
6268
|
}, [l.currentEditCellState$]), Pe(() => {
|
|
6263
6269
|
const ce = () => {
|
|
6264
6270
|
if (!k.current) return;
|
|
6265
|
-
const
|
|
6266
|
-
s.setPosition(
|
|
6271
|
+
const re = k.current.getBoundingClientRect();
|
|
6272
|
+
s.setPosition(re);
|
|
6267
6273
|
};
|
|
6268
6274
|
if (k.current) {
|
|
6269
6275
|
ce();
|
|
6270
|
-
const
|
|
6271
|
-
return
|
|
6276
|
+
const re = new ResizeObserver(ce);
|
|
6277
|
+
return re.observe(k.current), () => re.disconnect();
|
|
6272
6278
|
}
|
|
6273
6279
|
}, [s]);
|
|
6274
6280
|
function H() {
|
|
@@ -6283,37 +6289,38 @@ function Cb(r) {
|
|
|
6283
6289
|
}, 150);
|
|
6284
6290
|
}
|
|
6285
6291
|
function F() {
|
|
6286
|
-
var
|
|
6292
|
+
var re;
|
|
6287
6293
|
l.isVisible().visible && m.executeCommand(at.id, {
|
|
6288
6294
|
visible: !1,
|
|
6289
6295
|
eventType: Ye.Keyboard,
|
|
6290
6296
|
keycode: Z.ESC,
|
|
6291
|
-
unitId: (
|
|
6297
|
+
unitId: (re = C == null ? void 0 : C.getUnitId()) != null ? re : ""
|
|
6292
6298
|
});
|
|
6293
6299
|
}
|
|
6294
6300
|
function z() {
|
|
6295
|
-
var
|
|
6301
|
+
var re;
|
|
6296
6302
|
l.isVisible().visible && m.executeCommand(at.id, {
|
|
6297
6303
|
visible: !1,
|
|
6298
6304
|
eventType: Ye.PointerDown,
|
|
6299
|
-
unitId: (
|
|
6305
|
+
unitId: (re = C == null ? void 0 : C.getUnitId()) != null ? re : ""
|
|
6300
6306
|
});
|
|
6301
6307
|
}
|
|
6302
6308
|
function B() {
|
|
6303
6309
|
s.handleFxBtnClick(!0);
|
|
6304
6310
|
}
|
|
6305
|
-
const { viewDisable: j, editDisable: Y } = f, le = Y || S, me = An(!1),
|
|
6311
|
+
const { viewDisable: j, editDisable: Y } = f, le = Y || S, me = An(!1), se = () => {
|
|
6312
|
+
var ce;
|
|
6306
6313
|
try {
|
|
6307
6314
|
l.isVisible().visible === !1 && m.syncExecuteCommand(
|
|
6308
6315
|
at.id,
|
|
6309
6316
|
{
|
|
6310
6317
|
visible: !0,
|
|
6311
6318
|
eventType: Ye.PointerDown,
|
|
6312
|
-
unitId:
|
|
6319
|
+
unitId: (ce = C == null ? void 0 : C.getUnitId()) != null ? ce : ""
|
|
6313
6320
|
}
|
|
6314
6321
|
), T.setContextValue(At, !0);
|
|
6315
|
-
} catch (
|
|
6316
|
-
throw me.current = !0,
|
|
6322
|
+
} catch (re) {
|
|
6323
|
+
throw me.current = !0, re;
|
|
6317
6324
|
}
|
|
6318
6325
|
}, _e = (ce) => {
|
|
6319
6326
|
me.current && setTimeout(() => {
|
|
@@ -6355,7 +6362,7 @@ function Cb(r) {
|
|
|
6355
6362
|
"div",
|
|
6356
6363
|
{
|
|
6357
6364
|
className: ut.formulaInput,
|
|
6358
|
-
onPointerDown:
|
|
6365
|
+
onPointerDown: se,
|
|
6359
6366
|
onPointerUp: _e,
|
|
6360
6367
|
ref: k,
|
|
6361
6368
|
style: { pointerEvents: G ? "none" : "auto" },
|
|
@@ -6364,7 +6371,7 @@ function Cb(r) {
|
|
|
6364
6371
|
E,
|
|
6365
6372
|
{
|
|
6366
6373
|
disableSelectionOnClick: !0,
|
|
6367
|
-
editorId:
|
|
6374
|
+
editorId: De,
|
|
6368
6375
|
initValue: "",
|
|
6369
6376
|
onChange: () => {
|
|
6370
6377
|
},
|
|
@@ -7149,7 +7156,7 @@ function Lb() {
|
|
|
7149
7156
|
var ve;
|
|
7150
7157
|
const G = ((ve = R.getActiveSheet()) == null ? void 0 : ve.getSheetId()) || "";
|
|
7151
7158
|
n(G);
|
|
7152
|
-
const ee = R.getSheets(), ae = R.getActiveSheet(), Se = ee.filter((ce) => !ce.isSheetHidden()).map((ce,
|
|
7159
|
+
const ee = R.getSheets(), ae = R.getActiveSheet(), Se = ee.filter((ce) => !ce.isSheetHidden()).map((ce, re) => {
|
|
7153
7160
|
var Kt;
|
|
7154
7161
|
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
7162
|
/* @__PURE__ */ b(jd, {}),
|
|
@@ -7158,7 +7165,7 @@ function Lb() {
|
|
|
7158
7165
|
return {
|
|
7159
7166
|
sheetId: ce.getSheetId(),
|
|
7160
7167
|
label: Ct,
|
|
7161
|
-
index:
|
|
7168
|
+
index: re,
|
|
7162
7169
|
selected: ae === ce,
|
|
7163
7170
|
color: (Kt = ce.getTabColor()) != null ? Kt : void 0
|
|
7164
7171
|
};
|
|
@@ -7224,12 +7231,12 @@ function Lb() {
|
|
|
7224
7231
|
const ae = R.getUnitId(), Se = R == null ? void 0 : R.getActiveSheet();
|
|
7225
7232
|
if (!Se)
|
|
7226
7233
|
throw new Error("No active sheet found");
|
|
7227
|
-
const ve = Se.getSheetId(), ce = v.getRule(ae, ve),
|
|
7228
|
-
return ce ||
|
|
7234
|
+
const ve = Se.getSheetId(), ce = v.getRule(ae, ve), re = C.getSubunitRuleList(ae, ve).length > 0;
|
|
7235
|
+
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
7236
|
}
|
|
7230
7237
|
});
|
|
7231
7238
|
d.current.slideTabBar = G;
|
|
7232
|
-
const ee =
|
|
7239
|
+
const ee = se(G);
|
|
7233
7240
|
return { slideTabBar: G, disconnectResizeObserver: ee };
|
|
7234
7241
|
}, E = p.getConfig($h), P = (Ie = E == null ? void 0 : E.contextMenu) != null ? Ie : !0, T = (G) => {
|
|
7235
7242
|
if (G.trim() === "") {
|
|
@@ -7334,7 +7341,7 @@ function Lb() {
|
|
|
7334
7341
|
leftEnd: G.isLeftEnd(),
|
|
7335
7342
|
rightEnd: G.isRightEnd()
|
|
7336
7343
|
});
|
|
7337
|
-
},
|
|
7344
|
+
}, se = (G) => {
|
|
7338
7345
|
var Se;
|
|
7339
7346
|
const ee = (Se = u.current) == null ? void 0 : Se.querySelector(`.${Ft.slideTabBar}`);
|
|
7340
7347
|
if (!ee) return;
|
|
@@ -7346,8 +7353,8 @@ function Lb() {
|
|
|
7346
7353
|
var ee, ae, Se, ve, ce;
|
|
7347
7354
|
if (P && !(S != null && S.isForceKeepVisible())) {
|
|
7348
7355
|
if (G) {
|
|
7349
|
-
const { left:
|
|
7350
|
-
|
|
7356
|
+
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 : {};
|
|
7357
|
+
re !== void 0 && Xe !== void 0 && c([Xe - re, 0]);
|
|
7351
7358
|
}
|
|
7352
7359
|
l(G);
|
|
7353
7360
|
}
|
|
@@ -7431,45 +7438,45 @@ class Em {
|
|
|
7431
7438
|
constructor() {
|
|
7432
7439
|
_(this, "_functions", [
|
|
7433
7440
|
{
|
|
7434
|
-
func:
|
|
7441
|
+
func: Ue.MAX,
|
|
7435
7442
|
filter: (e) => {
|
|
7436
7443
|
var t, n, i, o;
|
|
7437
|
-
return ((n = (t = e.values.find((s) => s.func ===
|
|
7444
|
+
return ((n = (t = e.values.find((s) => s.func === Ue.COUNTA)) == null ? void 0 : t.value) != null ? n : 0) > 1 && ((o = (i = e.values.find((s) => s.func === Ue.COUNT)) == null ? void 0 : i.value) != null ? o : 0) > 0;
|
|
7438
7445
|
}
|
|
7439
7446
|
},
|
|
7440
7447
|
{
|
|
7441
|
-
func:
|
|
7448
|
+
func: Ue.MIN,
|
|
7442
7449
|
filter: (e) => {
|
|
7443
7450
|
var t, n, i, o;
|
|
7444
|
-
return ((n = (t = e.values.find((s) => s.func ===
|
|
7451
|
+
return ((n = (t = e.values.find((s) => s.func === Ue.COUNTA)) == null ? void 0 : t.value) != null ? n : 0) > 1 && ((o = (i = e.values.find((s) => s.func === Ue.COUNT)) == null ? void 0 : i.value) != null ? o : 0) > 0;
|
|
7445
7452
|
}
|
|
7446
7453
|
},
|
|
7447
7454
|
{
|
|
7448
7455
|
func: Xl.SUM,
|
|
7449
7456
|
filter: (e) => {
|
|
7450
7457
|
var t, n, i, o;
|
|
7451
|
-
return ((n = (t = e.values.find((s) => s.func ===
|
|
7458
|
+
return ((n = (t = e.values.find((s) => s.func === Ue.COUNTA)) == null ? void 0 : t.value) != null ? n : 0) > 1 && ((o = (i = e.values.find((s) => s.func === Ue.COUNT)) == null ? void 0 : i.value) != null ? o : 0) > 0;
|
|
7452
7459
|
}
|
|
7453
7460
|
},
|
|
7454
7461
|
{
|
|
7455
|
-
func:
|
|
7462
|
+
func: Ue.COUNTA,
|
|
7456
7463
|
filter: (e) => {
|
|
7457
7464
|
var t, n;
|
|
7458
|
-
return ((n = (t = e.values.find((i) => i.func ===
|
|
7465
|
+
return ((n = (t = e.values.find((i) => i.func === Ue.COUNTA)) == null ? void 0 : t.value) != null ? n : 0) > 1;
|
|
7459
7466
|
}
|
|
7460
7467
|
},
|
|
7461
7468
|
{
|
|
7462
|
-
func:
|
|
7469
|
+
func: Ue.COUNT,
|
|
7463
7470
|
filter: (e) => {
|
|
7464
7471
|
var t, n, i, o;
|
|
7465
|
-
return ((n = (t = e.values.find((s) => s.func ===
|
|
7472
|
+
return ((n = (t = e.values.find((s) => s.func === Ue.COUNTA)) == null ? void 0 : t.value) != null ? n : 0) > 1 && ((o = (i = e.values.find((s) => s.func === Ue.COUNT)) == null ? void 0 : i.value) != null ? o : 0) > 0;
|
|
7466
7473
|
}
|
|
7467
7474
|
},
|
|
7468
7475
|
{
|
|
7469
|
-
func:
|
|
7476
|
+
func: Ue.AVERAGE,
|
|
7470
7477
|
filter: (e) => {
|
|
7471
7478
|
var t, n, i, o;
|
|
7472
|
-
return ((n = (t = e.values.find((s) => s.func ===
|
|
7479
|
+
return ((n = (t = e.values.find((s) => s.func === Ue.COUNTA)) == null ? void 0 : t.value) != null ? n : 0) > 1 && ((o = (i = e.values.find((s) => s.func === Ue.COUNT)) == null ? void 0 : i.value) != null ? o : 0) > 0;
|
|
7473
7480
|
}
|
|
7474
7481
|
}
|
|
7475
7482
|
]);
|
|
@@ -7508,16 +7515,16 @@ const Jl = vn("univer.sheet-status-bar.service"), Fb = "univer-status-bar", Ub =
|
|
|
7508
7515
|
statisticItem: jb
|
|
7509
7516
|
}, Yb = [
|
|
7510
7517
|
Xl.SUM,
|
|
7511
|
-
|
|
7512
|
-
|
|
7513
|
-
|
|
7518
|
+
Ue.AVERAGE,
|
|
7519
|
+
Ue.MIN,
|
|
7520
|
+
Ue.MAX
|
|
7514
7521
|
], Ia = {
|
|
7515
7522
|
[Xl.SUM]: "statusbar.sum",
|
|
7516
|
-
[
|
|
7517
|
-
[
|
|
7518
|
-
[
|
|
7519
|
-
[
|
|
7520
|
-
[
|
|
7523
|
+
[Ue.AVERAGE]: "statusbar.average",
|
|
7524
|
+
[Ue.MIN]: "statusbar.min",
|
|
7525
|
+
[Ue.MAX]: "statusbar.max",
|
|
7526
|
+
[Ue.COUNT]: "statusbar.count",
|
|
7527
|
+
[Ue.COUNTA]: "statusbar.countA",
|
|
7521
7528
|
[Xv.CONCATENATE]: "concatenate"
|
|
7522
7529
|
}, Zb = (r) => {
|
|
7523
7530
|
const e = L(Ae), t = L(eg), n = L(Ol), i = Gb(r), o = async () => {
|
|
@@ -7695,7 +7702,7 @@ let Ys = class extends de {
|
|
|
7695
7702
|
var M, E, P, T;
|
|
7696
7703
|
const e = this._editorBridgeService.getEditCellState();
|
|
7697
7704
|
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(
|
|
7705
|
+
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
7706
|
if (u == null)
|
|
7700
7707
|
return;
|
|
7701
7708
|
const h = this._getEditorSkeleton();
|
|
@@ -7737,7 +7744,7 @@ let Ys = class extends de {
|
|
|
7737
7744
|
* to determine whether it needs to be automatically widened.
|
|
7738
7745
|
*/
|
|
7739
7746
|
_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(
|
|
7747
|
+
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
7748
|
if (c === wr.WRAP && h === 0) {
|
|
7742
7749
|
u == null || u.updateDocumentDataPageSize(l - s), u == null || u.updateDocumentDataMargin({ l: d.l, t: d.t }), t.calculate();
|
|
7743
7750
|
const { actualWidth: p, actualHeight: S } = t.getActualSize();
|
|
@@ -7863,7 +7870,7 @@ let Ys = class extends de {
|
|
|
7863
7870
|
}
|
|
7864
7871
|
_getEditorSkeleton() {
|
|
7865
7872
|
var r;
|
|
7866
|
-
return (r = this._renderManagerService.getRenderById(
|
|
7873
|
+
return (r = this._renderManagerService.getRenderById(Le)) == null ? void 0 : r.with(ir).getSkeleton();
|
|
7867
7874
|
}
|
|
7868
7875
|
};
|
|
7869
7876
|
Ys = t_([
|
|
@@ -8217,7 +8224,7 @@ let Lc = class extends de {
|
|
|
8217
8224
|
_initEditorVisibilityListener() {
|
|
8218
8225
|
this.disposeWithMe(
|
|
8219
8226
|
this._editorBridgeService.visible$.pipe(un((e, t) => e.visible === t.visible)).subscribe((e) => {
|
|
8220
|
-
(e.unitId ===
|
|
8227
|
+
(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
8228
|
})
|
|
8222
8229
|
);
|
|
8223
8230
|
}
|
|
@@ -8268,8 +8275,8 @@ let Lc = class extends de {
|
|
|
8268
8275
|
}
|
|
8269
8276
|
this._sheetCellEditorResizeService.resizeCellEditor(() => {
|
|
8270
8277
|
this._textSelectionManagerService.refreshSelection({
|
|
8271
|
-
unitId:
|
|
8272
|
-
subUnitId:
|
|
8278
|
+
unitId: Le,
|
|
8279
|
+
subUnitId: Le
|
|
8273
8280
|
});
|
|
8274
8281
|
});
|
|
8275
8282
|
}
|
|
@@ -8302,12 +8309,12 @@ let Lc = class extends de {
|
|
|
8302
8309
|
endOffset: 0
|
|
8303
8310
|
}],
|
|
8304
8311
|
{
|
|
8305
|
-
unitId:
|
|
8306
|
-
subUnitId:
|
|
8312
|
+
unitId: Le,
|
|
8313
|
+
subUnitId: Le
|
|
8307
8314
|
}
|
|
8308
8315
|
);
|
|
8309
|
-
const f = (S = this._renderManagerService.getRenderById(
|
|
8310
|
-
(f != null && f.canFocusing || p != null && p.canFocusing) && (this._univerInstanceService.setCurrentUnitForType(
|
|
8316
|
+
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);
|
|
8317
|
+
(f != null && f.canFocusing || p != null && p.canFocusing) && (this._univerInstanceService.setCurrentUnitForType(Le), f == null || f.activate(
|
|
8311
8318
|
qu,
|
|
8312
8319
|
qu,
|
|
8313
8320
|
!0
|
|
@@ -8323,7 +8330,7 @@ let Lc = class extends de {
|
|
|
8323
8330
|
const i = n.params, { unitId: o } = i;
|
|
8324
8331
|
if (!this._isCurrentSheetFocused() || S_(o) || (this._editorBridgeService.changeEditorDirty(!0), !this._editorBridgeService.isVisible().visible))
|
|
8325
8332
|
return;
|
|
8326
|
-
o ===
|
|
8333
|
+
o === Le && this._sheetCellEditorResizeService.fitTextSize();
|
|
8327
8334
|
}
|
|
8328
8335
|
}));
|
|
8329
8336
|
const t = [pi.id];
|
|
@@ -8361,7 +8368,7 @@ let Lc = class extends de {
|
|
|
8361
8368
|
return;
|
|
8362
8369
|
const { document: a, scene: c } = l;
|
|
8363
8370
|
this._contextService.setContextValue($e, !0);
|
|
8364
|
-
const d = this._getDocumentDataModel(), u = this._getEditorSkeleton(
|
|
8371
|
+
const d = this._getDocumentDataModel(), u = this._getEditorSkeleton(Le);
|
|
8365
8372
|
if (!(!u || !d)) {
|
|
8366
8373
|
if (this._sheetCellEditorResizeService.fitTextSize(() => {
|
|
8367
8374
|
const f = c.getViewport(Ms.VIEW_MAIN);
|
|
@@ -8383,8 +8390,8 @@ let Lc = class extends de {
|
|
|
8383
8390
|
endOffset: f
|
|
8384
8391
|
}],
|
|
8385
8392
|
{
|
|
8386
|
-
unitId:
|
|
8387
|
-
subUnitId:
|
|
8393
|
+
unitId: Le,
|
|
8394
|
+
subUnitId: Le
|
|
8388
8395
|
}
|
|
8389
8396
|
);
|
|
8390
8397
|
} else if (
|
|
@@ -8397,8 +8404,8 @@ let Lc = class extends de {
|
|
|
8397
8404
|
endOffset: 0
|
|
8398
8405
|
}],
|
|
8399
8406
|
{
|
|
8400
|
-
unitId:
|
|
8401
|
-
subUnitId:
|
|
8407
|
+
unitId: Le,
|
|
8408
|
+
subUnitId: Le
|
|
8402
8409
|
}
|
|
8403
8410
|
);
|
|
8404
8411
|
else if (t === Ye.Dblclick) {
|
|
@@ -8416,7 +8423,7 @@ let Lc = class extends de {
|
|
|
8416
8423
|
}
|
|
8417
8424
|
}
|
|
8418
8425
|
async _handleEditorInvisible(e) {
|
|
8419
|
-
const t = this._editorBridgeService.getEditCellState(), n = this._univerInstanceService.getUnit(
|
|
8426
|
+
const t = this._editorBridgeService.getEditCellState(), n = this._univerInstanceService.getUnit(Le), i = oe.deepClone(n == null ? void 0 : n.getSnapshot());
|
|
8420
8427
|
let { keycode: o } = e;
|
|
8421
8428
|
if (this._cursorChange = 0, this._exitInput(e), t == null)
|
|
8422
8429
|
return;
|
|
@@ -8487,7 +8494,7 @@ let Lc = class extends de {
|
|
|
8487
8494
|
viewportScrollY: 0
|
|
8488
8495
|
});
|
|
8489
8496
|
const n = this._editorBridgeService.getCurrentEditorId();
|
|
8490
|
-
n == null || !this._editorService.isSheetEditor(n) || (this._undoRedoService.clearUndoRedo(n), this._undoRedoService.clearUndoRedo(
|
|
8497
|
+
n == null || !this._editorService.isSheetEditor(n) || (this._undoRedoService.clearUndoRedo(n), this._undoRedoService.clearUndoRedo(De));
|
|
8491
8498
|
}
|
|
8492
8499
|
_moveSelection(e) {
|
|
8493
8500
|
if (e == null || !i_.includes(e))
|
|
@@ -8542,7 +8549,7 @@ let Lc = class extends de {
|
|
|
8542
8549
|
});
|
|
8543
8550
|
}
|
|
8544
8551
|
_getDocumentDataModel() {
|
|
8545
|
-
return this._univerInstanceService.getUnit(
|
|
8552
|
+
return this._univerInstanceService.getUnit(Le, x.UNIVER_DOC);
|
|
8546
8553
|
}
|
|
8547
8554
|
// WTF: this is should not exist at all. It is because all editor instances reuse the singleton
|
|
8548
8555
|
// "DocSelectionManagerService" and other modules. Which will be refactored soon in August, 2024.
|
|
@@ -8560,11 +8567,11 @@ let Lc = class extends de {
|
|
|
8560
8567
|
}
|
|
8561
8568
|
_emptyDocumentDataModel(e, t) {
|
|
8562
8569
|
const n = (s, l) => {
|
|
8563
|
-
const a =
|
|
8570
|
+
const a = oe.deepClone(s.getSnapshot()), c = this._getEditorViewModel(s.getUnitId());
|
|
8564
8571
|
c != null && (__(a.body, t), l && (a.documentStyle = e), a.drawings = {}, a.drawingsOrder = [], s.reset(a), c.reset(s));
|
|
8565
8572
|
}, i = this._getDocumentDataModel();
|
|
8566
8573
|
i && n(i, !0);
|
|
8567
|
-
const o = this._univerInstanceService.getUnit(
|
|
8574
|
+
const o = this._univerInstanceService.getUnit(De, x.UNIVER_DOC);
|
|
8568
8575
|
o && n(o);
|
|
8569
8576
|
}
|
|
8570
8577
|
};
|
|
@@ -8668,7 +8675,7 @@ let Zs = class extends de {
|
|
|
8668
8675
|
var a;
|
|
8669
8676
|
const i = this._currentService.getCurrentUnitForType(x.UNIVER_SHEET), o = (a = i.getActiveSheet()) == null ? void 0 : a.getSheetId();
|
|
8670
8677
|
if (!o) return null;
|
|
8671
|
-
const s =
|
|
8678
|
+
const s = oe.generateRandomId(), l = {
|
|
8672
8679
|
selection: e,
|
|
8673
8680
|
subUnitId: o,
|
|
8674
8681
|
unitId: i.getUnitId(),
|
|
@@ -8682,7 +8689,7 @@ let Zs = class extends de {
|
|
|
8682
8689
|
var l;
|
|
8683
8690
|
const i = this._currentService.getCurrentUnitForType(x.UNIVER_SHEET), o = (l = i.getActiveSheet()) == null ? void 0 : l.getSheetId();
|
|
8684
8691
|
if (!o) return null;
|
|
8685
|
-
const s =
|
|
8692
|
+
const s = oe.generateRandomId();
|
|
8686
8693
|
return this._shapeMap.set(s, {
|
|
8687
8694
|
selection: e,
|
|
8688
8695
|
subUnitId: o,
|
|
@@ -8747,7 +8754,7 @@ function Fm(r) {
|
|
|
8747
8754
|
}
|
|
8748
8755
|
const I_ = 10, y_ = 6;
|
|
8749
8756
|
function M_() {
|
|
8750
|
-
return
|
|
8757
|
+
return oe.generateRandomId(y_);
|
|
8751
8758
|
}
|
|
8752
8759
|
function E_(r) {
|
|
8753
8760
|
const e = r.match(/data-copy-id="([^\s]+)"/);
|
|
@@ -9082,9 +9089,9 @@ const Il = class Il {
|
|
|
9082
9089
|
let h = RS(void 0, u.style);
|
|
9083
9090
|
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
9091
|
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(
|
|
9092
|
+
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++) {
|
|
9093
|
+
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];
|
|
9094
|
+
_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
9095
|
}
|
|
9089
9096
|
((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
9097
|
}
|
|
@@ -9797,7 +9804,7 @@ let qs = class extends de {
|
|
|
9797
9804
|
for (let R = a; R <= d; R++) {
|
|
9798
9805
|
const I = h.getValue(w, R);
|
|
9799
9806
|
if (I) {
|
|
9800
|
-
const y =
|
|
9807
|
+
const y = oe.deepClone(I);
|
|
9801
9808
|
f.setValue(m - c, R - a, {
|
|
9802
9809
|
...Bi(),
|
|
9803
9810
|
...y
|
|
@@ -9906,13 +9913,13 @@ let qs = class extends de {
|
|
|
9906
9913
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
9907
9914
|
async _pasteInternal(e, t) {
|
|
9908
9915
|
var R, I;
|
|
9909
|
-
const n =
|
|
9916
|
+
const n = oe.deepClone(this._copyContentCache.get(e)), { range: i, matrix: o, unitId: s, subUnitId: l } = n || {};
|
|
9910
9917
|
if (!o || !n || !i || !s || !l || !o || !n)
|
|
9911
9918
|
return !1;
|
|
9912
9919
|
const a = (R = this._univerInstanceService.getUniverSheetInstance(s)) == null ? void 0 : R.getStyles();
|
|
9913
9920
|
o.forValue((y, M, E) => {
|
|
9914
9921
|
if (typeof E.s == "string") {
|
|
9915
|
-
const P =
|
|
9922
|
+
const P = oe.deepClone(E);
|
|
9916
9923
|
P.s = a == null ? void 0 : a.getStyleByCell(E), o.setValue(y, M, P);
|
|
9917
9924
|
}
|
|
9918
9925
|
if (E.colSpan || E.rowSpan)
|
|
@@ -10418,7 +10425,7 @@ const Kd = 998, mn = {
|
|
|
10418
10425
|
var a;
|
|
10419
10426
|
const t = (a = r.get($).getCurrentSelections()) == null ? void 0 : a.map((c) => c.range);
|
|
10420
10427
|
if (!(t != null && t.length)) return !1;
|
|
10421
|
-
const n = r.get(D), i = r.get(N), o =
|
|
10428
|
+
const n = r.get(D), i = r.get(N), o = Be(i);
|
|
10422
10429
|
if (!o) return !1;
|
|
10423
10430
|
const { worksheet: s } = o, l = s.getVisibleRows();
|
|
10424
10431
|
if (um(l, t)) {
|
|
@@ -10443,7 +10450,7 @@ const Kd = 998, mn = {
|
|
|
10443
10450
|
const t = (a = r.get($).getCurrentSelections()) == null ? void 0 : a.map((c) => c.range);
|
|
10444
10451
|
if (!(t != null && t.length))
|
|
10445
10452
|
return !1;
|
|
10446
|
-
const n = r.get(D), i = r.get(N), o =
|
|
10453
|
+
const n = r.get(D), i = r.get(N), o = Be(i);
|
|
10447
10454
|
if (!o) return !1;
|
|
10448
10455
|
const { worksheet: s } = o, l = s.getVisibleCols();
|
|
10449
10456
|
if (hm(l, t)) {
|
|
@@ -10654,7 +10661,7 @@ const ra = {
|
|
|
10654
10661
|
type: Q.COMMAND,
|
|
10655
10662
|
id: "sheet.command.set-selection-frozen",
|
|
10656
10663
|
handler: async (r, e) => {
|
|
10657
|
-
const { type: t } = e || {}, n = r.get(N), i = r.get(qt), o =
|
|
10664
|
+
const { type: t } = e || {}, n = r.get(N), i = r.get(qt), o = Be(n);
|
|
10658
10665
|
if (!o) return !1;
|
|
10659
10666
|
const { unitId: s, subUnitId: l } = o, a = r.get(D), d = r.get($).getCurrentSelections();
|
|
10660
10667
|
if (!d)
|
|
@@ -10725,7 +10732,7 @@ let Co = class extends de {
|
|
|
10725
10732
|
super(), this._renderManagerService = r, this._univerInstanceService = e;
|
|
10726
10733
|
}
|
|
10727
10734
|
getUndoRedoParamsOfColWidth(r) {
|
|
10728
|
-
const e = { redos: [], undos: [] }, { _univerInstanceService: t } = this, n =
|
|
10735
|
+
const e = { redos: [], undos: [] }, { _univerInstanceService: t } = this, n = Be(t);
|
|
10729
10736
|
if (!n) return e;
|
|
10730
10737
|
const { unitId: i, subUnitId: o, worksheet: s } = n, l = this._renderManagerService.getRenderById(i).with(ge);
|
|
10731
10738
|
if (!l.getCurrentParam()) return e;
|
|
@@ -10762,7 +10769,7 @@ const la = {
|
|
|
10762
10769
|
type: Q.COMMAND,
|
|
10763
10770
|
id: "sheet.command.set-col-auto-width",
|
|
10764
10771
|
handler: (r, e) => {
|
|
10765
|
-
const t = r.get(D), n = r.get(qt), i = r.get($), o = r.get(N), s =
|
|
10772
|
+
const t = r.get(D), n = r.get(qt), i = r.get($), o = r.get(N), s = Be(o, e);
|
|
10766
10773
|
if (!s) return !1;
|
|
10767
10774
|
const { unitId: l, subUnitId: a } = s;
|
|
10768
10775
|
let c = [];
|
|
@@ -10899,7 +10906,7 @@ function Ni(r) {
|
|
|
10899
10906
|
return !0;
|
|
10900
10907
|
const a = s.getUnitId(), c = l.getSheetId(), d = [new J(a).id, new te(a, c).id];
|
|
10901
10908
|
return n.getSubunitRuleList(a, c).filter((h) => h.ranges.some((g) => he.intersects(o, g))).forEach((h) => {
|
|
10902
|
-
d.push(new
|
|
10909
|
+
d.push(new ie(a, c, h.permissionId).id);
|
|
10903
10910
|
}), i.composePermission(d).some((h) => h.value === !1);
|
|
10904
10911
|
})
|
|
10905
10912
|
);
|
|
@@ -10916,7 +10923,7 @@ function Qm(r, e) {
|
|
|
10916
10923
|
return !0;
|
|
10917
10924
|
const c = l.getUnitId(), d = a.getSheetId(), u = [new J(c).id, new te(c, d).id];
|
|
10918
10925
|
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
|
|
10926
|
+
u.push(new ie(c, d, g.permissionId).id);
|
|
10920
10927
|
}), o.composePermission(u).some((g) => g.value === !1);
|
|
10921
10928
|
})
|
|
10922
10929
|
);
|
|
@@ -10931,9 +10938,9 @@ function Km(r, e) {
|
|
|
10931
10938
|
const l = t.getCurrentUnitForType(x.UNIVER_SHEET), a = l == null ? void 0 : l.getActiveSheet();
|
|
10932
10939
|
if (!l || !a)
|
|
10933
10940
|
return !0;
|
|
10934
|
-
const c = l.getUnitId(), d = a.getSheetId(), u = [new J(c).id, new te(c, d).id], h =
|
|
10941
|
+
const c = l.getUnitId(), d = a.getSheetId(), u = [new J(c).id, new te(c, d).id], h = oe.deepClone(s);
|
|
10935
10942
|
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
|
|
10943
|
+
u.push(new ie(c, d, m.permissionId).id);
|
|
10937
10944
|
}), o.composePermission(u).some((m) => m.value === !1);
|
|
10938
10945
|
})
|
|
10939
10946
|
);
|
|
@@ -10948,9 +10955,9 @@ function aa(r, e) {
|
|
|
10948
10955
|
const l = t.getCurrentUnitForType(x.UNIVER_SHEET), a = l == null ? void 0 : l.getActiveSheet();
|
|
10949
10956
|
if (!l || !a)
|
|
10950
10957
|
return !0;
|
|
10951
|
-
const c = l.getUnitId(), d = a.getSheetId(), u = [new J(c).id, new te(c, d).id], h =
|
|
10958
|
+
const c = l.getUnitId(), d = a.getSheetId(), u = [new J(c).id, new te(c, d).id], h = oe.deepClone(s);
|
|
10952
10959
|
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
|
|
10960
|
+
u.push(new ie(c, d, m.permissionId).id);
|
|
10954
10961
|
}), o.composePermission(u).some((m) => m.value === !1);
|
|
10955
10962
|
})
|
|
10956
10963
|
);
|
|
@@ -10995,7 +11002,7 @@ function uw(r) {
|
|
|
10995
11002
|
};
|
|
10996
11003
|
}),
|
|
10997
11004
|
hidden$: ue(r, x.UNIVER_SHEET),
|
|
10998
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [As, te], rangeTypes: [
|
|
11005
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [As, te], rangeTypes: [ie] }, !0)
|
|
10999
11006
|
};
|
|
11000
11007
|
}
|
|
11001
11008
|
function hw(r) {
|
|
@@ -11006,7 +11013,7 @@ function hw(r) {
|
|
|
11006
11013
|
icon: "BoldSingle",
|
|
11007
11014
|
title: "Set bold",
|
|
11008
11015
|
tooltip: "toolbar.bold",
|
|
11009
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
11016
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] }, !0),
|
|
11010
11017
|
activated$: vt(t, !1, ({ worksheet: o }) => new ze((s) => {
|
|
11011
11018
|
var d;
|
|
11012
11019
|
const l = e.onCommandExecuted((u) => {
|
|
@@ -11056,7 +11063,7 @@ function gw(r) {
|
|
|
11056
11063
|
{
|
|
11057
11064
|
workbookTypes: [J],
|
|
11058
11065
|
worksheetTypes: [te, Ge],
|
|
11059
|
-
rangeTypes: [
|
|
11066
|
+
rangeTypes: [ie]
|
|
11060
11067
|
},
|
|
11061
11068
|
!0
|
|
11062
11069
|
),
|
|
@@ -11127,7 +11134,7 @@ function mw(r) {
|
|
|
11127
11134
|
}
|
|
11128
11135
|
return s.next(!!(c && c.s)), l.dispose;
|
|
11129
11136
|
})),
|
|
11130
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
11137
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] }, !0),
|
|
11131
11138
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
11132
11139
|
};
|
|
11133
11140
|
}
|
|
@@ -11139,7 +11146,7 @@ function fw(r) {
|
|
|
11139
11146
|
icon: "StrikethroughSingle",
|
|
11140
11147
|
title: "Set strike through",
|
|
11141
11148
|
tooltip: "toolbar.strikethrough",
|
|
11142
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
11149
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] }, !0),
|
|
11143
11150
|
activated$: vt(t, !1, ({ worksheet: o }) => new ze((s) => {
|
|
11144
11151
|
var d;
|
|
11145
11152
|
const l = e.onCommandExecuted((u) => {
|
|
@@ -11185,7 +11192,7 @@ function pw(r) {
|
|
|
11185
11192
|
},
|
|
11186
11193
|
value: o.value
|
|
11187
11194
|
})),
|
|
11188
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
11195
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] }, !0),
|
|
11189
11196
|
value$: vt(t, i, ({ worksheet: o }) => new ze((s) => {
|
|
11190
11197
|
var d;
|
|
11191
11198
|
const l = e.onCommandExecuted((u) => {
|
|
@@ -11212,7 +11219,7 @@ function pw(r) {
|
|
|
11212
11219
|
};
|
|
11213
11220
|
}
|
|
11214
11221
|
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: [
|
|
11222
|
+
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
11223
|
return {
|
|
11217
11224
|
id: ta.id,
|
|
11218
11225
|
type: K.SELECTOR,
|
|
@@ -11265,7 +11272,7 @@ function vw(r) {
|
|
|
11265
11272
|
type: K.BUTTON,
|
|
11266
11273
|
title: "toolbar.resetColor",
|
|
11267
11274
|
icon: "NoColor",
|
|
11268
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
11275
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] }, !0),
|
|
11269
11276
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
11270
11277
|
};
|
|
11271
11278
|
}
|
|
@@ -11295,7 +11302,7 @@ function Cw(r) {
|
|
|
11295
11302
|
return n.next(i), o.dispose;
|
|
11296
11303
|
}),
|
|
11297
11304
|
hidden$: ue(r, x.UNIVER_SHEET),
|
|
11298
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
11305
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] }, !0)
|
|
11299
11306
|
};
|
|
11300
11307
|
}
|
|
11301
11308
|
function bw(r) {
|
|
@@ -11304,7 +11311,7 @@ function bw(r) {
|
|
|
11304
11311
|
type: K.BUTTON,
|
|
11305
11312
|
title: "toolbar.resetColor",
|
|
11306
11313
|
icon: "NoColor",
|
|
11307
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
11314
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] })
|
|
11308
11315
|
};
|
|
11309
11316
|
}
|
|
11310
11317
|
function _w(r) {
|
|
@@ -11333,7 +11340,7 @@ function _w(r) {
|
|
|
11333
11340
|
return n.next(i), o.dispose;
|
|
11334
11341
|
}),
|
|
11335
11342
|
hidden$: ue(r, x.UNIVER_SHEET),
|
|
11336
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
11343
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] })
|
|
11337
11344
|
};
|
|
11338
11345
|
}
|
|
11339
11346
|
const ah = [
|
|
@@ -11384,7 +11391,7 @@ function ww(r) {
|
|
|
11384
11391
|
return o.next(a != null ? a : n), s.dispose;
|
|
11385
11392
|
})),
|
|
11386
11393
|
hidden$: ue(r, x.UNIVER_SHEET),
|
|
11387
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
11394
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] })
|
|
11388
11395
|
};
|
|
11389
11396
|
}
|
|
11390
11397
|
const ch = [
|
|
@@ -11435,7 +11442,7 @@ function Rw(r) {
|
|
|
11435
11442
|
return o.next(a != null ? a : n), s.dispose;
|
|
11436
11443
|
})),
|
|
11437
11444
|
hidden$: ue(r, x.UNIVER_SHEET),
|
|
11438
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
11445
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] })
|
|
11439
11446
|
};
|
|
11440
11447
|
}
|
|
11441
11448
|
const dh = [
|
|
@@ -11486,7 +11493,7 @@ function Iw(r) {
|
|
|
11486
11493
|
return o.next(a != null ? a : n), s.dispose;
|
|
11487
11494
|
})),
|
|
11488
11495
|
hidden$: ue(r, x.UNIVER_SHEET),
|
|
11489
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
11496
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] })
|
|
11490
11497
|
};
|
|
11491
11498
|
}
|
|
11492
11499
|
const uh = [
|
|
@@ -11552,7 +11559,7 @@ function yw(r) {
|
|
|
11552
11559
|
return (a == null ? void 0 : a.v) === Ke.TRUE ? o.next("v") : o.next((d = a && a.a) != null ? d : n), s.dispose;
|
|
11553
11560
|
})),
|
|
11554
11561
|
hidden$: ue(r, x.UNIVER_SHEET),
|
|
11555
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
11562
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] })
|
|
11556
11563
|
};
|
|
11557
11564
|
}
|
|
11558
11565
|
function qo(r) {
|
|
@@ -11577,8 +11584,8 @@ function Ta(r) {
|
|
|
11577
11584
|
title: "rightClick.paste",
|
|
11578
11585
|
icon: "PasteSpecial",
|
|
11579
11586
|
disabled$: qo(r).pipe(
|
|
11580
|
-
dr(pe(r, { rangeTypes: [
|
|
11581
|
-
|
|
11587
|
+
dr(pe(r, { rangeTypes: [ie], worksheetTypes: [te, Ge, Jt], workbookTypes: [J] })),
|
|
11588
|
+
Fe(([e, t]) => e || t)
|
|
11582
11589
|
),
|
|
11583
11590
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
11584
11591
|
};
|
|
@@ -11599,8 +11606,8 @@ function xa(r) {
|
|
|
11599
11606
|
type: K.BUTTON,
|
|
11600
11607
|
title: "rightClick.pasteValue",
|
|
11601
11608
|
disabled$: qo(r).pipe(
|
|
11602
|
-
dr(pe(r, { rangeTypes: [
|
|
11603
|
-
|
|
11609
|
+
dr(pe(r, { rangeTypes: [ie], worksheetTypes: [Jt, te], workbookTypes: [J] })),
|
|
11610
|
+
Fe(([e, t]) => e || t)
|
|
11604
11611
|
),
|
|
11605
11612
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
11606
11613
|
};
|
|
@@ -11611,8 +11618,8 @@ function Aa(r) {
|
|
|
11611
11618
|
type: K.BUTTON,
|
|
11612
11619
|
title: "rightClick.pasteFormat",
|
|
11613
11620
|
disabled$: qo(r).pipe(
|
|
11614
|
-
dr(pe(r, { rangeTypes: [
|
|
11615
|
-
|
|
11621
|
+
dr(pe(r, { rangeTypes: [ie], worksheetTypes: [Ge, te], workbookTypes: [J] })),
|
|
11622
|
+
Fe(([e, t]) => e || t)
|
|
11616
11623
|
),
|
|
11617
11624
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
11618
11625
|
};
|
|
@@ -11623,8 +11630,8 @@ function ka(r) {
|
|
|
11623
11630
|
type: K.BUTTON,
|
|
11624
11631
|
title: "rightClick.pasteColWidth",
|
|
11625
11632
|
disabled$: qo(r).pipe(
|
|
11626
|
-
dr(pe(r, { rangeTypes: [
|
|
11627
|
-
|
|
11633
|
+
dr(pe(r, { rangeTypes: [ie], worksheetTypes: [Dr, te], workbookTypes: [J] })),
|
|
11634
|
+
Fe(([e, t]) => e || t)
|
|
11628
11635
|
)
|
|
11629
11636
|
};
|
|
11630
11637
|
}
|
|
@@ -11634,8 +11641,8 @@ function Ha(r) {
|
|
|
11634
11641
|
type: K.BUTTON,
|
|
11635
11642
|
title: "rightClick.pasteBesidesBorder",
|
|
11636
11643
|
disabled$: qo(r).pipe(
|
|
11637
|
-
dr(pe(r, { rangeTypes: [
|
|
11638
|
-
|
|
11644
|
+
dr(pe(r, { rangeTypes: [ie], worksheetTypes: [te, Ge, Jt, Nr, Dr], workbookTypes: [J] })),
|
|
11645
|
+
Fe(([e, t]) => e || t)
|
|
11639
11646
|
),
|
|
11640
11647
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
11641
11648
|
};
|
|
@@ -11646,7 +11653,7 @@ function Mw(r) {
|
|
|
11646
11653
|
type: K.BUTTON,
|
|
11647
11654
|
icon: "AutoHeight",
|
|
11648
11655
|
title: "rightClick.fitContent",
|
|
11649
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Nr, te], rangeTypes: [
|
|
11656
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Nr, te], rangeTypes: [ie] }),
|
|
11650
11657
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
11651
11658
|
};
|
|
11652
11659
|
}
|
|
@@ -11656,7 +11663,7 @@ function Ew(r) {
|
|
|
11656
11663
|
type: K.BUTTON,
|
|
11657
11664
|
icon: "AutoWidth",
|
|
11658
11665
|
title: "rightClick.fitContent",
|
|
11659
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Nr, te], rangeTypes: [
|
|
11666
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Nr, te], rangeTypes: [ie] }),
|
|
11660
11667
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
11661
11668
|
};
|
|
11662
11669
|
}
|
|
@@ -11726,7 +11733,7 @@ function xw(r) {
|
|
|
11726
11733
|
type: K.BUTTON,
|
|
11727
11734
|
icon: "Hide",
|
|
11728
11735
|
title: "rightClick.hideSelectedRow",
|
|
11729
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Nr, te], rangeTypes: [
|
|
11736
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Nr, te], rangeTypes: [ie] }),
|
|
11730
11737
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
11731
11738
|
};
|
|
11732
11739
|
}
|
|
@@ -11736,7 +11743,7 @@ function Aw(r) {
|
|
|
11736
11743
|
type: K.BUTTON,
|
|
11737
11744
|
icon: "Hide",
|
|
11738
11745
|
title: "rightClick.hideSelectedColumn",
|
|
11739
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Dr], rangeTypes: [
|
|
11746
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Dr], rangeTypes: [ie] }),
|
|
11740
11747
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
11741
11748
|
};
|
|
11742
11749
|
}
|
|
@@ -11761,7 +11768,7 @@ function kw(r) {
|
|
|
11761
11768
|
});
|
|
11762
11769
|
return s.next(!l()), () => a.dispose();
|
|
11763
11770
|
})),
|
|
11764
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Nr], rangeTypes: [
|
|
11771
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Nr], rangeTypes: [ie] })
|
|
11765
11772
|
};
|
|
11766
11773
|
}
|
|
11767
11774
|
function Hw(r) {
|
|
@@ -11785,7 +11792,7 @@ function Hw(r) {
|
|
|
11785
11792
|
});
|
|
11786
11793
|
return s.next(!l()), () => a.dispose();
|
|
11787
11794
|
})),
|
|
11788
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Dr, te], rangeTypes: [
|
|
11795
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Dr, te], rangeTypes: [ie] })
|
|
11789
11796
|
};
|
|
11790
11797
|
}
|
|
11791
11798
|
function Vw(r) {
|
|
@@ -11816,7 +11823,7 @@ function Vw(r) {
|
|
|
11816
11823
|
});
|
|
11817
11824
|
return l(), a.dispose;
|
|
11818
11825
|
})),
|
|
11819
|
-
hidden$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Nr], rangeTypes: [
|
|
11826
|
+
hidden$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Nr], rangeTypes: [ie] })
|
|
11820
11827
|
};
|
|
11821
11828
|
}
|
|
11822
11829
|
function Nw(r) {
|
|
@@ -11848,12 +11855,12 @@ function Nw(r) {
|
|
|
11848
11855
|
});
|
|
11849
11856
|
return l(), a.dispose;
|
|
11850
11857
|
})),
|
|
11851
|
-
hidden$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Dr], rangeTypes: [
|
|
11858
|
+
hidden$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Dr], rangeTypes: [ie] })
|
|
11852
11859
|
};
|
|
11853
11860
|
}
|
|
11854
11861
|
function Qo(r) {
|
|
11855
11862
|
var a;
|
|
11856
|
-
const e = r.get(N), t = r.get(Od), n = e.getUniverDocInstance(
|
|
11863
|
+
const e = r.get(N), t = r.get(Od), n = e.getUniverDocInstance(Le), i = t.getActiveTextRange();
|
|
11857
11864
|
if (n == null || i == null) return null;
|
|
11858
11865
|
const o = (a = n.getBody()) == null ? void 0 : a.textRuns;
|
|
11859
11866
|
if (o == null) return;
|
|
@@ -12723,7 +12730,7 @@ function Xw(r) {
|
|
|
12723
12730
|
const e = r.get($), t = r.get(et), n = r.get(N), i = r.get(ov), o = n.getCurrentTypeOfUnit$(x.UNIVER_SHEET);
|
|
12724
12731
|
return dt([
|
|
12725
12732
|
e.selectionMoveEnd$,
|
|
12726
|
-
o.pipe(
|
|
12733
|
+
o.pipe(Fe((s) => {
|
|
12727
12734
|
var l;
|
|
12728
12735
|
return (l = s == null ? void 0 : s.getUnitId()) != null ? l : "";
|
|
12729
12736
|
})),
|
|
@@ -12732,7 +12739,7 @@ function Xw(r) {
|
|
|
12732
12739
|
return (l = s == null ? void 0 : s.activeSheet$) != null ? l : Re(null);
|
|
12733
12740
|
}))
|
|
12734
12741
|
]).pipe(
|
|
12735
|
-
|
|
12742
|
+
Fe(([s, l, a]) => {
|
|
12736
12743
|
if (!a || !s || s.length === 0) return !1;
|
|
12737
12744
|
const c = a.getSheetId(), d = s.map((g) => g.range);
|
|
12738
12745
|
if (i.interceptor.fetchThroughInterceptors(sv)(!1, d))
|
|
@@ -12913,7 +12920,7 @@ let _o = class extends de {
|
|
|
12913
12920
|
}
|
|
12914
12921
|
// eslint-disable-next-line max-lines-per-function
|
|
12915
12922
|
_rowColumnMoving(e, t, n, i, o) {
|
|
12916
|
-
var B, j, Y, le, me,
|
|
12923
|
+
var B, j, Y, le, me, se, _e;
|
|
12917
12924
|
const s = this._context.scene, l = (B = this._sheetSkeletonManagerService.getCurrentParam()) == null ? void 0 : B.skeleton;
|
|
12918
12925
|
if (l == null)
|
|
12919
12926
|
return;
|
|
@@ -12970,7 +12977,7 @@ let _o = class extends de {
|
|
|
12970
12977
|
Ie = R - z / 2, this._changeToColumn = S + 1;
|
|
12971
12978
|
else
|
|
12972
12979
|
return;
|
|
12973
|
-
(
|
|
12980
|
+
(se = this._moveHelperLineShape) == null || se.transformByState({
|
|
12974
12981
|
height: d,
|
|
12975
12982
|
width: z,
|
|
12976
12983
|
left: Ie,
|
|
@@ -13208,21 +13215,21 @@ let Js = class extends de {
|
|
|
13208
13215
|
top: 0
|
|
13209
13216
|
});
|
|
13210
13217
|
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((
|
|
13218
|
+
s.addObject(this._resizeHelperShape, ar), s.disableObjectsEvent(), this._scenePointerMoveSub = s.onPointerMove$.subscribeEvent((se) => {
|
|
13212
13219
|
var Xe, tt, wt, Ct, Kt, Gn;
|
|
13213
13220
|
const _e = s.getCoordRelativeToViewport(
|
|
13214
13221
|
ke.FromArray([this._startOffsetX, this._startOffsetY])
|
|
13215
|
-
), Ie = s.getScrollXYInfoByViewport(_e, d), G = _s(
|
|
13216
|
-
w = ee - this._startOffsetX -
|
|
13222
|
+
), 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;
|
|
13223
|
+
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
13224
|
top: S + R
|
|
13218
13225
|
}), (tt = this._rowResizeRect) == null || tt.transformByState({
|
|
13219
|
-
top: H + R +
|
|
13226
|
+
top: H + R + re / 2
|
|
13220
13227
|
}), (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
13228
|
left: p + w
|
|
13222
13229
|
}), (Kt = this._columnResizeRect) == null || Kt.transformByState({
|
|
13223
|
-
left: O + w +
|
|
13230
|
+
left: O + w + re / 2
|
|
13224
13231
|
}), (Gn = this._columnResizeRect) == null || Gn.show(), s.setCursor(ye.COLUMN_RESIZE)));
|
|
13225
|
-
}), this._scenePointerUpSub = s.onPointerUp$.subscribeEvent((
|
|
13232
|
+
}), this._scenePointerUpSub = s.onPointerUp$.subscribeEvent((se) => {
|
|
13226
13233
|
var Ie, G, ee;
|
|
13227
13234
|
const _e = this._context.scene;
|
|
13228
13235
|
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 +13743,11 @@ const hr = {
|
|
|
13736
13743
|
const f = {
|
|
13737
13744
|
unitId: l,
|
|
13738
13745
|
subUnitId: a,
|
|
13739
|
-
ranges:
|
|
13746
|
+
ranges: oe.deepClone(d)
|
|
13740
13747
|
}, p = {
|
|
13741
13748
|
unitId: l,
|
|
13742
13749
|
subUnitId: a,
|
|
13743
|
-
ranges:
|
|
13750
|
+
ranges: oe.deepClone(d)
|
|
13744
13751
|
}, S = Bl(r, f), v = Ul(r, p);
|
|
13745
13752
|
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
13753
|
const M = nf(r, l, u, d);
|
|
@@ -13826,7 +13833,7 @@ const hr = {
|
|
|
13826
13833
|
const e = r.get(rn), t = r.get(D), n = r.get(Ae), i = r.get($), o = r.get(N), s = i.getCurrentSelections();
|
|
13827
13834
|
if (!s)
|
|
13828
13835
|
return !1;
|
|
13829
|
-
const l =
|
|
13836
|
+
const l = Be(o);
|
|
13830
13837
|
if (!l) return !1;
|
|
13831
13838
|
const { worksheet: a } = l;
|
|
13832
13839
|
let c = s[0].range;
|
|
@@ -13851,7 +13858,7 @@ const hr = {
|
|
|
13851
13858
|
handler: async (r) => {
|
|
13852
13859
|
const e = r.get(rn), t = r.get(D), n = r.get(Ae), i = r.get($), o = r.get(N), s = i.getCurrentSelections();
|
|
13853
13860
|
if (!s) return !1;
|
|
13854
|
-
const l =
|
|
13861
|
+
const l = Be(o);
|
|
13855
13862
|
if (!l) return !1;
|
|
13856
13863
|
const { worksheet: a } = l;
|
|
13857
13864
|
let c = s[0].range;
|
|
@@ -13884,7 +13891,7 @@ const hr = {
|
|
|
13884
13891
|
const e = r.get(rn), t = r.get(D), n = r.get(Ae), i = r.get($), o = r.get(N), s = i.getCurrentSelections();
|
|
13885
13892
|
if (!s)
|
|
13886
13893
|
return !1;
|
|
13887
|
-
const l =
|
|
13894
|
+
const l = Be(o);
|
|
13888
13895
|
if (!l) return !1;
|
|
13889
13896
|
const { worksheet: a } = l;
|
|
13890
13897
|
let c = s[0].range;
|
|
@@ -13918,7 +13925,7 @@ const hr = {
|
|
|
13918
13925
|
const e = r.get(rn), t = r.get(D), n = r.get(Ae), i = r.get($), o = r.get(N), s = i.getCurrentSelections();
|
|
13919
13926
|
if (!s)
|
|
13920
13927
|
return !1;
|
|
13921
|
-
const l =
|
|
13928
|
+
const l = Be(o);
|
|
13922
13929
|
if (!l) return !1;
|
|
13923
13930
|
const { worksheet: a } = l;
|
|
13924
13931
|
let c = s[0].range;
|
|
@@ -14120,7 +14127,7 @@ const Bn = {
|
|
|
14120
14127
|
subUnitId: a,
|
|
14121
14128
|
ranges: []
|
|
14122
14129
|
};
|
|
14123
|
-
return await e.executeCommand(Bn.id, { showDetail: !0, rule:
|
|
14130
|
+
return await e.executeCommand(Bn.id, { showDetail: !0, rule: oe.deepClone(u), oldRule: oe.deepClone(u) }), !0;
|
|
14124
14131
|
} else {
|
|
14125
14132
|
const u = (d = n.getCurrentLastSelection()) == null ? void 0 : d.range;
|
|
14126
14133
|
if (!u)
|
|
@@ -14135,7 +14142,7 @@ const Bn = {
|
|
|
14135
14142
|
unitId: l,
|
|
14136
14143
|
subUnitId: a
|
|
14137
14144
|
};
|
|
14138
|
-
return await e.executeCommand(Bn.id, { showDetail: !0, rule:
|
|
14145
|
+
return await e.executeCommand(Bn.id, { showDetail: !0, rule: oe.deepClone(f), oldRule: oe.deepClone(f) }), !0;
|
|
14139
14146
|
} else
|
|
14140
14147
|
return !1;
|
|
14141
14148
|
}
|
|
@@ -14149,7 +14156,7 @@ const Bn = {
|
|
|
14149
14156
|
let n = e == null ? void 0 : e.range;
|
|
14150
14157
|
if (n || (n = (c = t.getCurrentLastSelection()) == null ? void 0 : c.range), !n)
|
|
14151
14158
|
return !1;
|
|
14152
|
-
const i = r.get(D), o = r.get(N), s =
|
|
14159
|
+
const i = r.get(D), o = r.get(N), s = Be(o);
|
|
14153
14160
|
if (!s) return !1;
|
|
14154
14161
|
const { worksheet: l } = s, a = l.getVisibleRows();
|
|
14155
14162
|
if (um(a, [n])) {
|
|
@@ -14175,7 +14182,7 @@ const Bn = {
|
|
|
14175
14182
|
let n = e == null ? void 0 : e.range;
|
|
14176
14183
|
if (n || (n = (c = t.getCurrentLastSelection()) == null ? void 0 : c.range), !n)
|
|
14177
14184
|
return !1;
|
|
14178
|
-
const i = r.get(D), o = r.get(N), s =
|
|
14185
|
+
const i = r.get(D), o = r.get(N), s = Be(o);
|
|
14179
14186
|
if (!s) return !1;
|
|
14180
14187
|
const { worksheet: l } = s, a = l.getVisibleCols();
|
|
14181
14188
|
if (hm(a, [n])) {
|
|
@@ -14755,7 +14762,7 @@ const za = {
|
|
|
14755
14762
|
value: ve
|
|
14756
14763
|
});
|
|
14757
14764
|
});
|
|
14758
|
-
const
|
|
14765
|
+
const se = (ve) => {
|
|
14759
14766
|
P(ve);
|
|
14760
14767
|
}, _e = (ve) => {
|
|
14761
14768
|
P(ve || "");
|
|
@@ -14768,13 +14775,13 @@ const za = {
|
|
|
14768
14775
|
F(m.t("definedName.nameDuplicate"));
|
|
14769
14776
|
return;
|
|
14770
14777
|
}
|
|
14771
|
-
if (!
|
|
14778
|
+
if (!oe.isValidParameter(y) || Yv(y) || !oe.isStartValidPosition(y) && !pS(y.substring(0, 1))) {
|
|
14772
14779
|
F(m.t("definedName.nameInvalid"));
|
|
14773
14780
|
return;
|
|
14774
14781
|
}
|
|
14775
|
-
if (g.getSheetOrders().map((
|
|
14782
|
+
if (g.getSheetOrders().map((re) => {
|
|
14776
14783
|
var Xe;
|
|
14777
|
-
return ((Xe = g.getSheetBySheetId(
|
|
14784
|
+
return ((Xe = g.getSheetBySheetId(re)) == null ? void 0 : Xe.getName()) || "";
|
|
14778
14785
|
}).includes(y)) {
|
|
14779
14786
|
F(m.t("definedName.nameSheetConflict"));
|
|
14780
14787
|
return;
|
|
@@ -14804,8 +14811,8 @@ const za = {
|
|
|
14804
14811
|
ce === "formula" ? l[0] === Qr.EQUALS ? P(l) : P(`${Qr.EQUALS}`) : l[0] === Qr.EQUALS ? P("") : P(l), B(ce);
|
|
14805
14812
|
}, ee = An({}), [ae, Se] = ne(!1);
|
|
14806
14813
|
return Qh((ve) => {
|
|
14807
|
-
var
|
|
14808
|
-
const ce = (
|
|
14814
|
+
var re;
|
|
14815
|
+
const ce = (re = ee.current) == null ? void 0 : re.handleOutClick;
|
|
14809
14816
|
ce && ce(ve, () => Se(!1));
|
|
14810
14817
|
}), /* @__PURE__ */ q("div", { className: Et.definedNameInput, style: { display: t ? "block" : "none" }, children: [
|
|
14811
14818
|
/* @__PURE__ */ b("div", { children: /* @__PURE__ */ b(Ns, { placeholder: m.t("definedName.inputNamePlaceholder"), value: y, allowClear: !0, onChange: M, affixWrapperStyle: za }) }),
|
|
@@ -14819,7 +14826,7 @@ const za = {
|
|
|
14819
14826
|
unitId: R,
|
|
14820
14827
|
subUnitId: I,
|
|
14821
14828
|
initialValue: E,
|
|
14822
|
-
onChange: (ve, ce) =>
|
|
14829
|
+
onChange: (ve, ce) => se(ce),
|
|
14823
14830
|
supportAcrossSheet: !0
|
|
14824
14831
|
}
|
|
14825
14832
|
) : w && /* @__PURE__ */ b(
|
|
@@ -14887,7 +14894,7 @@ const za = {
|
|
|
14887
14894
|
const { name: A, formulaOrRefString: k, comment: O, localSheetId: H, hidden: F } = T;
|
|
14888
14895
|
let z = T.id;
|
|
14889
14896
|
if (z == null || z.length === 0)
|
|
14890
|
-
z =
|
|
14897
|
+
z = oe.generateRandomId(10), r.executeCommand(mv.id, { id: z, unitId: s, name: A, formulaOrRefString: k, comment: O, localSheetId: H, hidden: F });
|
|
14891
14898
|
else {
|
|
14892
14899
|
const B = { id: z, unitId: s, name: A, formulaOrRefString: k, comment: O, localSheetId: H, hidden: F };
|
|
14893
14900
|
r.executeCommand(fv.id, B);
|
|
@@ -14991,7 +14998,7 @@ const za = {
|
|
|
14991
14998
|
] }) });
|
|
14992
14999
|
};
|
|
14993
15000
|
function T0(r) {
|
|
14994
|
-
const e = r.get(wc), t = pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
15001
|
+
const e = r.get(wc), t = pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] });
|
|
14995
15002
|
return {
|
|
14996
15003
|
id: Ic.id,
|
|
14997
15004
|
icon: new ze((n) => {
|
|
@@ -15037,7 +15044,7 @@ function ja(r) {
|
|
|
15037
15044
|
id: oi.id,
|
|
15038
15045
|
type: K.BUTTON,
|
|
15039
15046
|
title: "rightClick.clearContent",
|
|
15040
|
-
disabled$: Vi(r, pe(r, { workbookTypes: [J], worksheetTypes: [te, Jt], rangeTypes: [
|
|
15047
|
+
disabled$: Vi(r, pe(r, { workbookTypes: [J], worksheetTypes: [te, Jt], rangeTypes: [ie] })),
|
|
15041
15048
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
15042
15049
|
};
|
|
15043
15050
|
}
|
|
@@ -15046,7 +15053,7 @@ function Ya(r) {
|
|
|
15046
15053
|
id: $i.id,
|
|
15047
15054
|
type: K.BUTTON,
|
|
15048
15055
|
title: "rightClick.clearFormat",
|
|
15049
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [
|
|
15056
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te, Ge], rangeTypes: [ie] }),
|
|
15050
15057
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
15051
15058
|
};
|
|
15052
15059
|
}
|
|
@@ -15055,7 +15062,7 @@ function Za(r) {
|
|
|
15055
15062
|
id: bs.id,
|
|
15056
15063
|
type: K.BUTTON,
|
|
15057
15064
|
title: "rightClick.clearAll",
|
|
15058
|
-
disabled$: Vi(r, pe(r, { workbookTypes: [J], worksheetTypes: [te, Jt, Ge], rangeTypes: [
|
|
15065
|
+
disabled$: Vi(r, pe(r, { workbookTypes: [J], worksheetTypes: [te, Jt, Ge], rangeTypes: [ie] })),
|
|
15059
15066
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
15060
15067
|
};
|
|
15061
15068
|
}
|
|
@@ -15096,7 +15103,7 @@ function x0(r) {
|
|
|
15096
15103
|
type: K.BUTTON,
|
|
15097
15104
|
title: "rightClick.moveLeft",
|
|
15098
15105
|
icon: "DeleteCellShiftLeft",
|
|
15099
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te], rangeTypes: [
|
|
15106
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te], rangeTypes: [ie] }),
|
|
15100
15107
|
hidden$: aa(r, "col")
|
|
15101
15108
|
};
|
|
15102
15109
|
}
|
|
@@ -15106,7 +15113,7 @@ function A0(r) {
|
|
|
15106
15113
|
type: K.BUTTON,
|
|
15107
15114
|
title: "rightClick.moveUp",
|
|
15108
15115
|
icon: "DeleteCellShiftUp",
|
|
15109
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te], rangeTypes: [
|
|
15116
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te], rangeTypes: [ie] }),
|
|
15110
15117
|
hidden$: aa(r, "row")
|
|
15111
15118
|
};
|
|
15112
15119
|
}
|
|
@@ -15139,7 +15146,7 @@ function H0(r) {
|
|
|
15139
15146
|
title: "rightClick.insert",
|
|
15140
15147
|
icon: "Insert",
|
|
15141
15148
|
hidden$: Vi(r, Ni(r)),
|
|
15142
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [kg, te], rangeTypes: [
|
|
15149
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [kg, te], rangeTypes: [ie] })
|
|
15143
15150
|
};
|
|
15144
15151
|
}
|
|
15145
15152
|
function V0(r) {
|
|
@@ -15170,7 +15177,7 @@ function V0(r) {
|
|
|
15170
15177
|
});
|
|
15171
15178
|
return s(), l.dispose;
|
|
15172
15179
|
})),
|
|
15173
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Fo, te], rangeTypes: [
|
|
15180
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Fo, te], rangeTypes: [ie] }),
|
|
15174
15181
|
hidden$: Qm(r, "row")
|
|
15175
15182
|
};
|
|
15176
15183
|
}
|
|
@@ -15202,7 +15209,7 @@ function N0(r) {
|
|
|
15202
15209
|
});
|
|
15203
15210
|
return s(), l.dispose;
|
|
15204
15211
|
})),
|
|
15205
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [kg, te], rangeTypes: [
|
|
15212
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [kg, te], rangeTypes: [ie] }),
|
|
15206
15213
|
hidden$: Qm(r, "col")
|
|
15207
15214
|
};
|
|
15208
15215
|
}
|
|
@@ -15212,7 +15219,7 @@ function D0(r) {
|
|
|
15212
15219
|
type: K.BUTTON,
|
|
15213
15220
|
title: "rightClick.moveRight",
|
|
15214
15221
|
icon: "InsertCellShiftRight",
|
|
15215
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te], rangeTypes: [
|
|
15222
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te], rangeTypes: [ie] }),
|
|
15216
15223
|
hidden$: aa(r, "col")
|
|
15217
15224
|
};
|
|
15218
15225
|
}
|
|
@@ -15222,7 +15229,7 @@ function L0(r) {
|
|
|
15222
15229
|
type: K.BUTTON,
|
|
15223
15230
|
title: "rightClick.moveDown",
|
|
15224
15231
|
icon: "InsertCellDown",
|
|
15225
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te], rangeTypes: [
|
|
15232
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [te], rangeTypes: [ie] }),
|
|
15226
15233
|
hidden$: aa(r, "row")
|
|
15227
15234
|
};
|
|
15228
15235
|
}
|
|
@@ -15254,7 +15261,7 @@ function W0(r) {
|
|
|
15254
15261
|
});
|
|
15255
15262
|
return s(), l.dispose;
|
|
15256
15263
|
})),
|
|
15257
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Fo, te], rangeTypes: [
|
|
15264
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Fo, te], rangeTypes: [ie] }),
|
|
15258
15265
|
hidden$: Ni(r)
|
|
15259
15266
|
};
|
|
15260
15267
|
}
|
|
@@ -15286,7 +15293,7 @@ function B0(r) {
|
|
|
15286
15293
|
});
|
|
15287
15294
|
return s(), l.dispose;
|
|
15288
15295
|
})),
|
|
15289
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Fo, te], rangeTypes: [
|
|
15296
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Fo, te], rangeTypes: [ie] }),
|
|
15290
15297
|
hidden$: Ni(r)
|
|
15291
15298
|
};
|
|
15292
15299
|
}
|
|
@@ -15318,7 +15325,7 @@ function F0(r) {
|
|
|
15318
15325
|
});
|
|
15319
15326
|
return s(), l.dispose;
|
|
15320
15327
|
})),
|
|
15321
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Fo, te], rangeTypes: [
|
|
15328
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Fo, te], rangeTypes: [ie] }),
|
|
15322
15329
|
hidden$: Ni(r)
|
|
15323
15330
|
};
|
|
15324
15331
|
}
|
|
@@ -15350,12 +15357,12 @@ function U0(r) {
|
|
|
15350
15357
|
});
|
|
15351
15358
|
return s(), l.dispose;
|
|
15352
15359
|
})),
|
|
15353
|
-
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Fo, te], rangeTypes: [
|
|
15360
|
+
disabled$: pe(r, { workbookTypes: [J], worksheetTypes: [Fo, te], rangeTypes: [ie] }),
|
|
15354
15361
|
hidden$: Ni(r)
|
|
15355
15362
|
};
|
|
15356
15363
|
}
|
|
15357
15364
|
function z0(r) {
|
|
15358
|
-
const e = pe(r, { workbookTypes: [J], worksheetTypes: [te, Jt, Ge], rangeTypes: [
|
|
15365
|
+
const e = pe(r, { workbookTypes: [J], worksheetTypes: [te, Jt, Ge], rangeTypes: [ie] }), t = Xw(r);
|
|
15359
15366
|
return {
|
|
15360
15367
|
id: hr.id,
|
|
15361
15368
|
icon: "MergeAllSingle",
|
|
@@ -15365,7 +15372,7 @@ function z0(r) {
|
|
|
15365
15372
|
hidden$: ue(r, x.UNIVER_SHEET),
|
|
15366
15373
|
disabled$: e.pipe(
|
|
15367
15374
|
dr(t),
|
|
15368
|
-
|
|
15375
|
+
Fe(([n, i]) => n || i)
|
|
15369
15376
|
)
|
|
15370
15377
|
};
|
|
15371
15378
|
}
|
|
@@ -15418,7 +15425,7 @@ function G0(r) {
|
|
|
15418
15425
|
l.ruleChange$,
|
|
15419
15426
|
a.ruleChange$
|
|
15420
15427
|
).pipe(
|
|
15421
|
-
|
|
15428
|
+
Fe(() => {
|
|
15422
15429
|
const d = i.getUnitId(), u = s.getSheetId(), h = l.getSubunitRuleList(d, u), g = c.getCurrentSelections(), m = g == null ? void 0 : g.map((S) => S.range), f = h.map((S) => S.ranges).flat();
|
|
15423
15430
|
if (!m)
|
|
15424
15431
|
return !1;
|
|
@@ -15443,7 +15450,7 @@ function q0(r) {
|
|
|
15443
15450
|
a.ruleChange$,
|
|
15444
15451
|
c.ruleChange$
|
|
15445
15452
|
).pipe(
|
|
15446
|
-
|
|
15453
|
+
Fe(() => {
|
|
15447
15454
|
var M, E;
|
|
15448
15455
|
const h = o.getUnitId(), g = l.getSheetId(), m = t.getSubunitRuleList(h, g), f = (M = u.getCurrentSelections()) == null ? void 0 : M.map((P) => P.range);
|
|
15449
15456
|
if (m.map((P) => P.ranges).flat(), !(f != null && f.length) || f.length > 1)
|
|
@@ -15478,14 +15485,14 @@ function Q0(r) {
|
|
|
15478
15485
|
var m;
|
|
15479
15486
|
if (!l)
|
|
15480
15487
|
return Re(!0);
|
|
15481
|
-
const a = o.getUnitId(), c = r.get($), d = r.get(et), u = r.get(pt), h = (m = t.composePermission$([new J(a).id]).pipe(
|
|
15488
|
+
const a = o.getUnitId(), c = r.get($), d = r.get(et), u = r.get(pt), h = (m = t.composePermission$([new J(a).id]).pipe(Fe((f) => f.every((p) => p.value)))) != null ? m : Re(!1), g = _t(
|
|
15482
15489
|
d.ruleChange$,
|
|
15483
15490
|
u.ruleChange$
|
|
15484
15491
|
).pipe(
|
|
15485
15492
|
Gt(null)
|
|
15486
15493
|
);
|
|
15487
15494
|
return dt([h, g, c.selectionMoveEnd$]).pipe(
|
|
15488
|
-
|
|
15495
|
+
Fe(([f, p, S]) => {
|
|
15489
15496
|
if (!f)
|
|
15490
15497
|
return !0;
|
|
15491
15498
|
const v = c.getCurrentSelections(), C = v == null ? void 0 : v.map((w) => w.range);
|
|
@@ -15505,14 +15512,14 @@ function Sf(r) {
|
|
|
15505
15512
|
var M;
|
|
15506
15513
|
if (!m)
|
|
15507
15514
|
return Re(!0);
|
|
15508
|
-
const p = r.get(He).subscribeContextValue$(El).pipe(Gt(!1)), S = d.getUnitId(), v = m.getSheetId(), C = r.get(et), w = r.get(pt), R = r.get($), I = (M = t.composePermission$([new zl(S).id]).pipe(
|
|
15515
|
+
const p = r.get(He).subscribeContextValue$(El).pipe(Gt(!1)), S = d.getUnitId(), v = m.getSheetId(), C = r.get(et), w = r.get(pt), R = r.get($), I = (M = t.composePermission$([new zl(S).id]).pipe(Fe((E) => E.every((P) => P.value)))) != null ? M : Re(!1), y = _t(
|
|
15509
15516
|
C.ruleChange$,
|
|
15510
15517
|
w.ruleChange$
|
|
15511
15518
|
).pipe(
|
|
15512
15519
|
Gt(null)
|
|
15513
15520
|
);
|
|
15514
15521
|
return dt([I, y, R.selectionMoveEnd$, p]).pipe(
|
|
15515
|
-
|
|
15522
|
+
Fe(([E, P, T, A]) => {
|
|
15516
15523
|
if (!E || A)
|
|
15517
15524
|
return !0;
|
|
15518
15525
|
const k = R.getCurrentSelections(), O = k == null ? void 0 : k.map((B) => B.range);
|
|
@@ -15537,14 +15544,14 @@ function K0(r) {
|
|
|
15537
15544
|
var m;
|
|
15538
15545
|
if (!l)
|
|
15539
15546
|
return Re(!0);
|
|
15540
|
-
const a = o.getUnitId(), c = l.getSheetId(), d = r.get(et), u = r.get(pt), h = (m = t.composePermission$([new zl(a).id]).pipe(
|
|
15547
|
+
const a = o.getUnitId(), c = l.getSheetId(), d = r.get(et), u = r.get(pt), h = (m = t.composePermission$([new zl(a).id]).pipe(Fe((f) => f.every((p) => p.value)))) != null ? m : Re(!1), g = _t(
|
|
15541
15548
|
d.ruleChange$,
|
|
15542
15549
|
u.ruleChange$
|
|
15543
15550
|
).pipe(
|
|
15544
15551
|
Gt(null)
|
|
15545
15552
|
);
|
|
15546
15553
|
return dt([h, g]).pipe(
|
|
15547
|
-
|
|
15554
|
+
Fe(([f, p]) => {
|
|
15548
15555
|
var C;
|
|
15549
15556
|
if (!f) return !0;
|
|
15550
15557
|
const S = u.getRule(a, c);
|
|
@@ -15564,7 +15571,7 @@ function J0(r) {
|
|
|
15564
15571
|
return Re(!0);
|
|
15565
15572
|
const a = o.getUnitId(), c = l.getSheetId(), d = r.get(pt);
|
|
15566
15573
|
return d.ruleChange$.pipe(Gt(null)).pipe(
|
|
15567
|
-
|
|
15574
|
+
Fe(() => {
|
|
15568
15575
|
var h;
|
|
15569
15576
|
return d.getRule(a, c) ? ((h = t.getPermissionPoint(new Ng(a, c).id)) == null ? void 0 : h.value) === !1 : !0;
|
|
15570
15577
|
})
|
|
@@ -15581,9 +15588,9 @@ function $0(r) {
|
|
|
15581
15588
|
var m;
|
|
15582
15589
|
if (!l)
|
|
15583
15590
|
return Re(!0);
|
|
15584
|
-
const a = o.getUnitId(), c = r.get(et), d = r.get(pt), u = (m = t.composePermission$([new zl(a).id, new lg(a).id]).pipe(
|
|
15591
|
+
const a = o.getUnitId(), c = r.get(et), d = r.get(pt), u = (m = t.composePermission$([new zl(a).id, new lg(a).id]).pipe(Fe((f) => f.every((p) => p.value)))) != null ? m : Re(!1), h = d.ruleChange$.pipe(Gt(null)), g = c.ruleChange$.pipe(Gt(null));
|
|
15585
15592
|
return dt([u, h, g]).pipe(
|
|
15586
|
-
|
|
15593
|
+
Fe(([f, p, S]) => {
|
|
15587
15594
|
if (!f)
|
|
15588
15595
|
return !0;
|
|
15589
15596
|
const v = l.getSheetId(), C = d.getRule(a, v), w = c.getSubunitRuleList(a, v);
|
|
@@ -15607,7 +15614,7 @@ function eR(r) {
|
|
|
15607
15614
|
d.selectionMoveEnd$
|
|
15608
15615
|
).pipe(Gt(null));
|
|
15609
15616
|
return dt([g]).pipe(
|
|
15610
|
-
|
|
15617
|
+
Fe(([m]) => {
|
|
15611
15618
|
var E;
|
|
15612
15619
|
const f = r.get($).getCurrentSelections(), p = f == null ? void 0 : f.map((P) => P.range);
|
|
15613
15620
|
if (!(p != null && p.length) || p.length > 1)
|
|
@@ -15644,8 +15651,8 @@ function vf(r) {
|
|
|
15644
15651
|
if (!m)
|
|
15645
15652
|
return Re(!0);
|
|
15646
15653
|
const f = d.getUnitId();
|
|
15647
|
-
return ((v = (S = t.getPermissionPoint$(new J(f).id)) == null ? void 0 : S.pipe(
|
|
15648
|
-
|
|
15654
|
+
return ((v = (S = t.getPermissionPoint$(new J(f).id)) == null ? void 0 : S.pipe(Fe((C) => !!C.value))) != null ? v : Re(!1)).pipe(
|
|
15655
|
+
Fe((C) => !C)
|
|
15649
15656
|
);
|
|
15650
15657
|
})
|
|
15651
15658
|
))
|
|
@@ -15756,7 +15763,7 @@ function sR(r) {
|
|
|
15756
15763
|
type: K.BUTTON,
|
|
15757
15764
|
title: "sheetConfig.delete",
|
|
15758
15765
|
disabled$: dt([n, i]).pipe(
|
|
15759
|
-
|
|
15766
|
+
Fe(([o, s]) => o || s)
|
|
15760
15767
|
),
|
|
15761
15768
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
15762
15769
|
};
|
|
@@ -15809,7 +15816,7 @@ function dR(r) {
|
|
|
15809
15816
|
return nl(e, n), i.dispose;
|
|
15810
15817
|
}).pipe(
|
|
15811
15818
|
dr(Di(r, [J, Bg])),
|
|
15812
|
-
|
|
15819
|
+
Fe(([n, i]) => n || i)
|
|
15813
15820
|
),
|
|
15814
15821
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
15815
15822
|
};
|
|
@@ -15832,7 +15839,7 @@ function uR(r) {
|
|
|
15832
15839
|
return i(), o.dispose;
|
|
15833
15840
|
}).pipe(
|
|
15834
15841
|
dr(Di(r, [J, Bg])),
|
|
15835
|
-
|
|
15842
|
+
Fe(([n, i]) => n || i)
|
|
15836
15843
|
),
|
|
15837
15844
|
hidden$: ue(r, x.UNIVER_SHEET)
|
|
15838
15845
|
};
|
|
@@ -17364,7 +17371,7 @@ let Mo = class extends de {
|
|
|
17364
17371
|
const g = (p, S) => {
|
|
17365
17372
|
o = p, s = S, u();
|
|
17366
17373
|
}, m = a.pipe(
|
|
17367
|
-
|
|
17374
|
+
Fe((p) => {
|
|
17368
17375
|
const S = this._calcCellPositionByCell(e.endRow, e.endColumn, t, n, i);
|
|
17369
17376
|
return {
|
|
17370
17377
|
top: p.top,
|
|
@@ -17662,11 +17669,11 @@ function jR(r, e, t) {
|
|
|
17662
17669
|
if (f && p) {
|
|
17663
17670
|
const S = new Je(), v = new Je(), C = f.getCellMatrix(), w = p.getCellMatrix();
|
|
17664
17671
|
Ss.foreach(u, (B, j) => {
|
|
17665
|
-
S.setValue(B, j,
|
|
17672
|
+
S.setValue(B, j, oe.deepClone(C.getValue(B, j))), v.setValue(B, j, null);
|
|
17666
17673
|
});
|
|
17667
17674
|
const R = new Je();
|
|
17668
17675
|
Ss.foreach(d, (B, j) => {
|
|
17669
|
-
R.setValue(B, j,
|
|
17676
|
+
R.setValue(B, j, oe.deepClone(w.getValue(B, j)));
|
|
17670
17677
|
});
|
|
17671
17678
|
const I = new Je();
|
|
17672
17679
|
Ss.foreach(u, (B, j) => {
|
|
@@ -17796,15 +17803,15 @@ function ep(r, e, t, n) {
|
|
|
17796
17803
|
}
|
|
17797
17804
|
const { row: S, col: v } = c(g, m);
|
|
17798
17805
|
if ((C = f.p) != null && C.body && Wc(f.p.body)) {
|
|
17799
|
-
const w =
|
|
17806
|
+
const w = oe.deepClone({ p: f.p, v: p != null ? p : f.v });
|
|
17800
17807
|
d.setValue(S, v, w);
|
|
17801
17808
|
} else
|
|
17802
|
-
d.setValue(S, v,
|
|
17809
|
+
d.setValue(S, v, oe.deepClone({ v: p != null ? p : f.v, t: f.t }));
|
|
17803
17810
|
});
|
|
17804
17811
|
const u = {
|
|
17805
17812
|
unitId: i,
|
|
17806
17813
|
subUnitId: o,
|
|
17807
|
-
cellValue:
|
|
17814
|
+
cellValue: oe.deepClone(d.getMatrix())
|
|
17808
17815
|
};
|
|
17809
17816
|
l.push({
|
|
17810
17817
|
id: we.id,
|
|
@@ -17848,7 +17855,7 @@ function tp(r, e, t, n = !1) {
|
|
|
17848
17855
|
const u = {
|
|
17849
17856
|
unitId: s,
|
|
17850
17857
|
subUnitId: l,
|
|
17851
|
-
cellValue:
|
|
17858
|
+
cellValue: oe.deepClone(c.getMatrix())
|
|
17852
17859
|
};
|
|
17853
17860
|
i.push({
|
|
17854
17861
|
id: we.id,
|
|
@@ -17877,7 +17884,7 @@ function np(r, e, t) {
|
|
|
17877
17884
|
const d = {
|
|
17878
17885
|
subUnitId: l,
|
|
17879
17886
|
unitId: s,
|
|
17880
|
-
cellValue:
|
|
17887
|
+
cellValue: oe.deepClone(o.getMatrix())
|
|
17881
17888
|
};
|
|
17882
17889
|
n.push({
|
|
17883
17890
|
id: we.id,
|
|
@@ -17903,7 +17910,7 @@ function YR(r, e, t) {
|
|
|
17903
17910
|
const d = {
|
|
17904
17911
|
subUnitId: l,
|
|
17905
17912
|
unitId: s,
|
|
17906
|
-
cellValue:
|
|
17913
|
+
cellValue: oe.deepClone(o.getMatrix())
|
|
17907
17914
|
};
|
|
17908
17915
|
n.push({
|
|
17909
17916
|
id: we.id,
|
|
@@ -17982,7 +17989,7 @@ function jc(r, e, t) {
|
|
|
17982
17989
|
}), { undos: i, redos: n };
|
|
17983
17990
|
}
|
|
17984
17991
|
function ZR(r) {
|
|
17985
|
-
if (!r.includes("\r") &&
|
|
17992
|
+
if (!r.includes("\r") && oe.isLegalUrl(r)) {
|
|
17986
17993
|
const n = ld(), i = `${r}`, o = {
|
|
17987
17994
|
startIndex: 0,
|
|
17988
17995
|
endIndex: i.length - 1,
|
|
@@ -18051,10 +18058,10 @@ let Ri = class extends Un {
|
|
|
18051
18058
|
this._commandService.executeCommand(Bc.id, { htmlContent: l, textContent: a, files: c });
|
|
18052
18059
|
});
|
|
18053
18060
|
};
|
|
18054
|
-
let t = (n = this._renderManagerService.getRenderById(
|
|
18061
|
+
let t = (n = this._renderManagerService.getRenderById(Le)) == null ? void 0 : n.with(_r);
|
|
18055
18062
|
t && e(t), this._renderManagerService.created$.subscribe((i) => {
|
|
18056
18063
|
var o;
|
|
18057
|
-
i.unitId ===
|
|
18064
|
+
i.unitId === Le && (t = (o = this._renderManagerService.getRenderById(Le)) == null ? void 0 : o.with(_r), t && e(t));
|
|
18058
18065
|
});
|
|
18059
18066
|
}
|
|
18060
18067
|
_resolveClipboardFiles(e) {
|
|
@@ -18317,7 +18324,7 @@ let Ri = class extends Un {
|
|
|
18317
18324
|
_onPastePlainText(e, t, n) {
|
|
18318
18325
|
const { range: i, unitId: o, subUnitId: s } = e;
|
|
18319
18326
|
let l;
|
|
18320
|
-
if (/\r|\n/.test(t) ||
|
|
18327
|
+
if (/\r|\n/.test(t) || oe.isLegalUrl(t)) {
|
|
18321
18328
|
const c = ZR(t), d = this._generateDocumentDataModelSnapshot({ body: c });
|
|
18322
18329
|
l = {
|
|
18323
18330
|
[i.rows[0]]: {
|
|
@@ -18460,7 +18467,7 @@ let Ri = class extends Un {
|
|
|
18460
18467
|
a.forValue((w, R, I) => {
|
|
18461
18468
|
const y = I.s;
|
|
18462
18469
|
if (typeof y == "object") {
|
|
18463
|
-
const M =
|
|
18470
|
+
const M = oe.deepClone(I);
|
|
18464
18471
|
M.s && (M.s = {
|
|
18465
18472
|
...y,
|
|
18466
18473
|
bd: null
|
|
@@ -18877,7 +18884,7 @@ let Ar = class extends de {
|
|
|
18877
18884
|
return ((n = e == null ? void 0 : e.location) == null ? void 0 : n.unitId) === ((i = t == null ? void 0 : t.location) == null ? void 0 : i.unitId) && ((o = e == null ? void 0 : e.location) == null ? void 0 : o.subUnitId) === ((s = t == null ? void 0 : t.location) == null ? void 0 : s.subUnitId) && ((l = e == null ? void 0 : e.location) == null ? void 0 : l.row) === ((a = t == null ? void 0 : t.location) == null ? void 0 : a.row) && ((c = e == null ? void 0 : e.location) == null ? void 0 : c.col) === ((d = t == null ? void 0 : t.location) == null ? void 0 : d.col) && ((u = e == null ? void 0 : e.customRange) == null ? void 0 : u.rangeId) === ((h = t == null ? void 0 : t.customRange) == null ? void 0 : h.rangeId) && ((g = e == null ? void 0 : e.bullet) == null ? void 0 : g.startIndex) === ((m = t == null ? void 0 : t.bullet) == null ? void 0 : m.startIndex) && ((f = e == null ? void 0 : e.customRange) == null ? void 0 : f.startIndex) === ((p = t == null ? void 0 : t.customRange) == null ? void 0 : p.startIndex) && ((S = e == null ? void 0 : e.customRange) == null ? void 0 : S.endIndex) === ((v = t == null ? void 0 : t.customRange) == null ? void 0 : v.endIndex) && (e == null ? void 0 : e.drawing) === (t == null ? void 0 : t.drawing);
|
|
18878
18885
|
}
|
|
18879
18886
|
),
|
|
18880
|
-
|
|
18887
|
+
Fe((e) => e && {
|
|
18881
18888
|
unitId: e.location.unitId,
|
|
18882
18889
|
subUnitId: e.location.subUnitId,
|
|
18883
18890
|
row: e.location.row,
|
|
@@ -18898,7 +18905,7 @@ let Ar = class extends de {
|
|
|
18898
18905
|
return ((n = e == null ? void 0 : e.location) == null ? void 0 : n.unitId) === ((i = t == null ? void 0 : t.location) == null ? void 0 : i.unitId) && ((o = e == null ? void 0 : e.location) == null ? void 0 : o.subUnitId) === ((s = t == null ? void 0 : t.location) == null ? void 0 : s.subUnitId) && ((l = e == null ? void 0 : e.location) == null ? void 0 : l.row) === ((a = t == null ? void 0 : t.location) == null ? void 0 : a.row) && ((c = e == null ? void 0 : e.location) == null ? void 0 : c.col) === ((d = t == null ? void 0 : t.location) == null ? void 0 : d.col);
|
|
18899
18906
|
}
|
|
18900
18907
|
),
|
|
18901
|
-
|
|
18908
|
+
Fe((e) => e && {
|
|
18902
18909
|
unitId: e.location.unitId,
|
|
18903
18910
|
subUnitId: e.location.subUnitId,
|
|
18904
18911
|
row: e.location.row,
|
|
@@ -19648,7 +19655,7 @@ let To = class extends de {
|
|
|
19648
19655
|
break;
|
|
19649
19656
|
n = this._sheetPermissionCheckController.permissionCheckWithoutRange({
|
|
19650
19657
|
workbookTypes: [J],
|
|
19651
|
-
rangeTypes: [
|
|
19658
|
+
rangeTypes: [ie],
|
|
19652
19659
|
worksheetTypes: [Jt, te]
|
|
19653
19660
|
}), i = this._localeService.t("permission.dialog.editErr");
|
|
19654
19661
|
break;
|
|
@@ -19657,14 +19664,14 @@ let To = class extends de {
|
|
|
19657
19664
|
break;
|
|
19658
19665
|
n = this._sheetPermissionCheckController.permissionCheckWithoutRange({
|
|
19659
19666
|
workbookTypes: [J],
|
|
19660
|
-
rangeTypes: [
|
|
19667
|
+
rangeTypes: [ie],
|
|
19661
19668
|
worksheetTypes: [Jt, te]
|
|
19662
19669
|
}), i = this._localeService.t("permission.dialog.editErr");
|
|
19663
19670
|
break;
|
|
19664
19671
|
case li.id:
|
|
19665
19672
|
n = this._sheetPermissionCheckController.permissionCheckWithoutRange({
|
|
19666
19673
|
workbookTypes: [J],
|
|
19667
|
-
rangeTypes: [
|
|
19674
|
+
rangeTypes: [ie],
|
|
19668
19675
|
worksheetTypes: [te, Dr]
|
|
19669
19676
|
}), i = this._localeService.t("permission.dialog.pasteErr");
|
|
19670
19677
|
break;
|
|
@@ -19674,7 +19681,7 @@ let To = class extends de {
|
|
|
19674
19681
|
case ia.id:
|
|
19675
19682
|
n = this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
19676
19683
|
workbookTypes: [J],
|
|
19677
|
-
rangeTypes: [
|
|
19684
|
+
rangeTypes: [ie],
|
|
19678
19685
|
worksheetTypes: [te, Jt, Ge]
|
|
19679
19686
|
}), i = this._localeService.t("permission.dialog.commonErr");
|
|
19680
19687
|
break;
|
|
@@ -19685,7 +19692,7 @@ let To = class extends de {
|
|
|
19685
19692
|
case ki.id:
|
|
19686
19693
|
n = this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
19687
19694
|
workbookTypes: [J],
|
|
19688
|
-
rangeTypes: [
|
|
19695
|
+
rangeTypes: [ie],
|
|
19689
19696
|
worksheetTypes: [Ge, te]
|
|
19690
19697
|
}), i = this._localeService.t("permission.dialog.setStyleErr");
|
|
19691
19698
|
break;
|
|
@@ -19699,7 +19706,7 @@ let To = class extends de {
|
|
|
19699
19706
|
case Xm.id:
|
|
19700
19707
|
n = this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
19701
19708
|
workbookTypes: [Zi, J],
|
|
19702
|
-
rangeTypes: [Cc,
|
|
19709
|
+
rangeTypes: [Cc, ie],
|
|
19703
19710
|
worksheetTypes: [As, te]
|
|
19704
19711
|
}), 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
19712
|
break;
|
|
@@ -19722,22 +19729,22 @@ let To = class extends de {
|
|
|
19722
19729
|
_permissionCheckByPaste(e) {
|
|
19723
19730
|
return e.value === nt.SPECIAL_PASTE_VALUE || e.value === nt.SPECIAL_PASTE_FORMULA ? this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
19724
19731
|
workbookTypes: [J],
|
|
19725
|
-
rangeTypes: [
|
|
19732
|
+
rangeTypes: [ie],
|
|
19726
19733
|
worksheetTypes: [Ge, te]
|
|
19727
19734
|
}) : e.value === nt.SPECIAL_PASTE_FORMAT ? this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
19728
19735
|
workbookTypes: [J],
|
|
19729
|
-
rangeTypes: [
|
|
19736
|
+
rangeTypes: [ie],
|
|
19730
19737
|
worksheetTypes: [Ge, te]
|
|
19731
19738
|
}) : this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
19732
19739
|
workbookTypes: [J],
|
|
19733
|
-
rangeTypes: [
|
|
19740
|
+
rangeTypes: [ie],
|
|
19734
19741
|
worksheetTypes: [Jt, Ge, te]
|
|
19735
19742
|
});
|
|
19736
19743
|
}
|
|
19737
19744
|
_permissionCheckByAutoFillCommand(e) {
|
|
19738
19745
|
if (!e)
|
|
19739
19746
|
return !1;
|
|
19740
|
-
const { targetRange: t } = e, n =
|
|
19747
|
+
const { targetRange: t } = e, n = Be(this._univerInstanceService);
|
|
19741
19748
|
if (!n)
|
|
19742
19749
|
return !1;
|
|
19743
19750
|
const { worksheet: i, unitId: o, subUnitId: s } = n;
|
|
@@ -19780,7 +19787,7 @@ let ul = class extends Un {
|
|
|
19780
19787
|
this.disposeWithMe(
|
|
19781
19788
|
this._headerMoveRenderController.interceptor.intercept(e, {
|
|
19782
19789
|
handler: (t, n) => {
|
|
19783
|
-
const i =
|
|
19790
|
+
const i = Be(this._univerInstanceService);
|
|
19784
19791
|
if (!i)
|
|
19785
19792
|
return !1;
|
|
19786
19793
|
const { unitId: o, subUnitId: s } = i;
|
|
@@ -19808,7 +19815,7 @@ let ul = class extends Un {
|
|
|
19808
19815
|
this._headerResizeRenderController.interceptor.intercept(this._headerResizeRenderController.interceptor.getInterceptPoints().HEADER_RESIZE_PERMISSION_CHECK, {
|
|
19809
19816
|
handler: (e, t) => {
|
|
19810
19817
|
var s, l, a, c;
|
|
19811
|
-
const n =
|
|
19818
|
+
const n = Be(this._univerInstanceService);
|
|
19812
19819
|
if (!n)
|
|
19813
19820
|
return !1;
|
|
19814
19821
|
const { unitId: i, subUnitId: o } = n;
|
|
@@ -19827,7 +19834,7 @@ let ul = class extends Un {
|
|
|
19827
19834
|
this._selectionRenderService.interceptor.intercept(this._selectionRenderService.interceptor.getInterceptPoints().RANGE_FILL_PERMISSION_CHECK, {
|
|
19828
19835
|
handler: (e, t) => {
|
|
19829
19836
|
var m, f, p;
|
|
19830
|
-
const n =
|
|
19837
|
+
const n = Be(this._univerInstanceService);
|
|
19831
19838
|
if (!n)
|
|
19832
19839
|
return !1;
|
|
19833
19840
|
const { worksheet: i, unitId: o, subUnitId: s } = n;
|
|
@@ -19861,7 +19868,7 @@ let ul = class extends Un {
|
|
|
19861
19868
|
this._selectionRenderService.interceptor.intercept(this._selectionRenderService.interceptor.getInterceptPoints().RANGE_MOVE_PERMISSION_CHECK, {
|
|
19862
19869
|
handler: (e, t) => {
|
|
19863
19870
|
var h;
|
|
19864
|
-
const n =
|
|
19871
|
+
const n = Be(this._univerInstanceService);
|
|
19865
19872
|
if (!n)
|
|
19866
19873
|
return !1;
|
|
19867
19874
|
const { worksheet: i, unitId: o, subUnitId: s } = n;
|
|
@@ -20013,11 +20020,11 @@ function VI(r) {
|
|
|
20013
20020
|
const { sum: e, count: t, countA: n, min: i, max: o } = r.getResults();
|
|
20014
20021
|
return [
|
|
20015
20022
|
{
|
|
20016
|
-
func:
|
|
20023
|
+
func: Ue.MAX,
|
|
20017
20024
|
value: o
|
|
20018
20025
|
},
|
|
20019
20026
|
{
|
|
20020
|
-
func:
|
|
20027
|
+
func: Ue.MIN,
|
|
20021
20028
|
value: i
|
|
20022
20029
|
},
|
|
20023
20030
|
{
|
|
@@ -20025,15 +20032,15 @@ function VI(r) {
|
|
|
20025
20032
|
value: e
|
|
20026
20033
|
},
|
|
20027
20034
|
{
|
|
20028
|
-
func:
|
|
20035
|
+
func: Ue.COUNTA,
|
|
20029
20036
|
value: n
|
|
20030
20037
|
},
|
|
20031
20038
|
{
|
|
20032
|
-
func:
|
|
20039
|
+
func: Ue.COUNT,
|
|
20033
20040
|
value: t
|
|
20034
20041
|
},
|
|
20035
20042
|
{
|
|
20036
|
-
func:
|
|
20043
|
+
func: Ue.AVERAGE,
|
|
20037
20044
|
value: e / t
|
|
20038
20045
|
}
|
|
20039
20046
|
];
|
|
@@ -20188,7 +20195,7 @@ let hl = class extends Un {
|
|
|
20188
20195
|
priority: 100,
|
|
20189
20196
|
handler: (e, t) => {
|
|
20190
20197
|
var a;
|
|
20191
|
-
const n =
|
|
20198
|
+
const n = Be(this._univerInstanceService);
|
|
20192
20199
|
if (!n)
|
|
20193
20200
|
return e != null ? e : [];
|
|
20194
20201
|
const { worksheet: i, unitId: o, subUnitId: s } = n;
|
|
@@ -20565,8 +20572,8 @@ const op = (r, e, t, n, i) => {
|
|
|
20565
20572
|
objectIDs: Y,
|
|
20566
20573
|
unitID: F,
|
|
20567
20574
|
actions: Vv
|
|
20568
|
-
}), me = o.getSubunitRuleList(F, z).map((G) => G.permissionId),
|
|
20569
|
-
|
|
20575
|
+
}), me = o.getSubunitRuleList(F, z).map((G) => G.permissionId), se = (Ie = s.getRule(F, z)) == null ? void 0 : Ie.permissionId;
|
|
20576
|
+
se && me.push(se);
|
|
20570
20577
|
const _e = le.filter((G) => {
|
|
20571
20578
|
var ee;
|
|
20572
20579
|
return me.includes(G.objectID) || G.objectID === ((ee = s.getRule(F, z)) == null ? void 0 : ee.permissionId);
|
|
@@ -20629,8 +20636,8 @@ const op = (r, e, t, n, i) => {
|
|
|
20629
20636
|
children: {
|
|
20630
20637
|
label: wo,
|
|
20631
20638
|
showDetail: !0,
|
|
20632
|
-
rule:
|
|
20633
|
-
oldRule:
|
|
20639
|
+
rule: oe.deepClone(O),
|
|
20640
|
+
oldRule: oe.deepClone(O)
|
|
20634
20641
|
},
|
|
20635
20642
|
width: 330
|
|
20636
20643
|
};
|
|
@@ -20654,11 +20661,11 @@ const op = (r, e, t, n, i) => {
|
|
|
20654
20661
|
const H = E.get(O.objectID);
|
|
20655
20662
|
if (!H)
|
|
20656
20663
|
return null;
|
|
20657
|
-
const F = O.actions.find((
|
|
20664
|
+
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
20665
|
let _e = "";
|
|
20659
20666
|
const Ie = C.getSheetBySheetId(H.subUnitId), G = Ie == null ? void 0 : Ie.getName();
|
|
20660
20667
|
if (H.unitType === Tn.SelectRange) {
|
|
20661
|
-
const
|
|
20668
|
+
const re = H.ranges, Xe = re != null && re.length ? re.map((tt) => {
|
|
20662
20669
|
const wt = Qg(tt);
|
|
20663
20670
|
return wt === "NaN" ? "" : wt;
|
|
20664
20671
|
}).filter((tt) => !!tt).join(",") : "";
|
|
@@ -20669,11 +20676,11 @@ const op = (r, e, t, n, i) => {
|
|
|
20669
20676
|
{
|
|
20670
20677
|
className: je.sheetPermissionListItem,
|
|
20671
20678
|
onMouseMove: () => {
|
|
20672
|
-
const { subUnitId:
|
|
20679
|
+
const { subUnitId: re, unitType: Xe } = H, tt = C.getActiveSheet();
|
|
20673
20680
|
if (!tt)
|
|
20674
20681
|
return !1;
|
|
20675
20682
|
const wt = tt.getSheetId();
|
|
20676
|
-
if (
|
|
20683
|
+
if (re !== wt)
|
|
20677
20684
|
return !1;
|
|
20678
20685
|
if (Xe === Tn.SelectRange) {
|
|
20679
20686
|
const Ct = H.ranges || [];
|
|
@@ -20687,9 +20694,9 @@ const op = (r, e, t, n, i) => {
|
|
|
20687
20694
|
children: [
|
|
20688
20695
|
/* @__PURE__ */ q("div", { className: je.sheetPermissionListItemHeader, children: [
|
|
20689
20696
|
/* @__PURE__ */ b(er, { title: _e, children: /* @__PURE__ */ b("div", { className: je.sheetPermissionListItemHeaderName, children: _e }) }),
|
|
20690
|
-
(me ||
|
|
20697
|
+
(me || se) && /* @__PURE__ */ q("div", { className: je.sheetPermissionListItemHeaderOperator, children: [
|
|
20691
20698
|
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
|
-
|
|
20699
|
+
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
20700
|
] })
|
|
20694
20701
|
] }),
|
|
20695
20702
|
/* @__PURE__ */ b("div", { className: je.sheetPermissionListItemSplit }),
|
|
@@ -20740,7 +20747,7 @@ const op = (r, e, t, n, i) => {
|
|
|
20740
20747
|
var u;
|
|
20741
20748
|
const i = L(N), o = L($);
|
|
20742
20749
|
if (!L(wi).getVisible()) return null;
|
|
20743
|
-
const l =
|
|
20750
|
+
const l = Be(i);
|
|
20744
20751
|
if (!l) return null;
|
|
20745
20752
|
const { worksheet: a } = l, d = ((u = o.getCurrentSelections()) == null ? void 0 : u.map((h) => h.range)).reduce((h, g) => h + qg(a.getName(), g), "");
|
|
20746
20753
|
return r ? /* @__PURE__ */ b(
|
|
@@ -21348,7 +21355,7 @@ let Zc = class extends de {
|
|
|
21348
21355
|
d = i.rangeWithCoord.startX + g.left - a, u = i.rangeWithCoord.endY + g.top - c;
|
|
21349
21356
|
break;
|
|
21350
21357
|
}
|
|
21351
|
-
d =
|
|
21358
|
+
d = oe.clamp(d, h, g.width), u = oe.clamp(u, g.top, g.height), this._contextMenuService.triggerContextMenu({
|
|
21352
21359
|
clientX: d,
|
|
21353
21360
|
clientY: u,
|
|
21354
21361
|
preventDefault: () => {
|
|
@@ -22418,9 +22425,9 @@ let Ao = class extends Un {
|
|
|
22418
22425
|
_initialize() {
|
|
22419
22426
|
this._syncEditorSize(), this._listenFxBtnClick(), this._handleContentChange(), this._univerInstanceService.focused$.pipe(gi(this.dispose$)).subscribe((e) => {
|
|
22420
22427
|
this._create(e);
|
|
22421
|
-
}), this._create(
|
|
22428
|
+
}), this._create(De), this.disposeWithMe(this._editorService.focus$.subscribe(() => {
|
|
22422
22429
|
var t;
|
|
22423
|
-
((t = this._editorService.getFocusEditor()) == null ? void 0 : t.getEditorId()) !==
|
|
22430
|
+
((t = this._editorService.getFocusEditor()) == null ? void 0 : t.getEditorId()) !== De ? this._contextService.setContextValue(At, !1) : this._contextService.setContextValue(At, !0);
|
|
22424
22431
|
}));
|
|
22425
22432
|
}
|
|
22426
22433
|
_handleContentChange() {
|
|
@@ -22428,13 +22435,13 @@ let Ao = class extends Un {
|
|
|
22428
22435
|
this._commandService.onCommandExecuted((e) => {
|
|
22429
22436
|
if (e.id === Hs.id) {
|
|
22430
22437
|
const t = e.params, { unitId: n } = t;
|
|
22431
|
-
n ===
|
|
22438
|
+
n === De && this.autoScroll();
|
|
22432
22439
|
}
|
|
22433
22440
|
})
|
|
22434
22441
|
);
|
|
22435
22442
|
}
|
|
22436
22443
|
_create(e) {
|
|
22437
|
-
if (e !==
|
|
22444
|
+
if (e !== De)
|
|
22438
22445
|
return;
|
|
22439
22446
|
const t = this._renderManagerService.getRenderById(e);
|
|
22440
22447
|
if (t == null)
|
|
@@ -22446,9 +22453,9 @@ let Ao = class extends Un {
|
|
|
22446
22453
|
this._formulaEditorManagerService.fxBtnClick$.pipe(gi(this.dispose$)).subscribe(() => {
|
|
22447
22454
|
var t, n;
|
|
22448
22455
|
if (this._contextService.getContextValue(hc) && !this._contextService.getContextValue($e)) {
|
|
22449
|
-
this._univerInstanceService.setCurrentUnitForType(
|
|
22456
|
+
this._univerInstanceService.setCurrentUnitForType(De), this._contextService.setContextValue(At, !0);
|
|
22450
22457
|
const i = this._univerInstanceService.getCurrentUnitForType(x.UNIVER_SHEET), o = this._univerInstanceService.getUniverDocInstance(
|
|
22451
|
-
|
|
22458
|
+
De
|
|
22452
22459
|
);
|
|
22453
22460
|
this._editorBridgeService.isVisible().visible === !1 && this._commandService.syncExecuteCommand(
|
|
22454
22461
|
at.id,
|
|
@@ -22469,7 +22476,7 @@ let Ao = class extends Un {
|
|
|
22469
22476
|
endOffset: a.length
|
|
22470
22477
|
}
|
|
22471
22478
|
], d = {
|
|
22472
|
-
unitId:
|
|
22479
|
+
unitId: De,
|
|
22473
22480
|
body: {
|
|
22474
22481
|
dataStream: a
|
|
22475
22482
|
},
|
|
@@ -22480,11 +22487,11 @@ let Ao = class extends Un {
|
|
|
22480
22487
|
});
|
|
22481
22488
|
}
|
|
22482
22489
|
_syncEditorSize() {
|
|
22483
|
-
const e = this._univerInstanceService.unitAdded$.pipe(Vl((t) => t.getUnitId() ===
|
|
22490
|
+
const e = this._univerInstanceService.unitAdded$.pipe(Vl((t) => t.getUnitId() === De));
|
|
22484
22491
|
this.disposeWithMe(dt([this._formulaEditorManagerService.position$, e]).subscribe(([t]) => {
|
|
22485
22492
|
if (!t) return this._clearScheduledCallback();
|
|
22486
|
-
const n = kd(
|
|
22487
|
-
|
|
22493
|
+
const n = kd(De, this._renderManagerService), i = this._univerInstanceService.getUniverDocInstance(
|
|
22494
|
+
De
|
|
22488
22495
|
);
|
|
22489
22496
|
if (n == null || i == null) return this._clearScheduledCallback();
|
|
22490
22497
|
const { width: o, height: s } = t;
|
|
@@ -22498,8 +22505,8 @@ let Ao = class extends Un {
|
|
|
22498
22505
|
}
|
|
22499
22506
|
autoScroll() {
|
|
22500
22507
|
var m, f;
|
|
22501
|
-
const e = this._formulaEditorManagerService.getPosition(), t = (m = this._renderManagerService.getRenderById(
|
|
22502
|
-
|
|
22508
|
+
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(
|
|
22509
|
+
De
|
|
22503
22510
|
);
|
|
22504
22511
|
if (t == null || e == null || n == null || i == null)
|
|
22505
22512
|
return;
|
|
@@ -22570,8 +22577,8 @@ let bl = class extends de {
|
|
|
22570
22577
|
// Sync cell content to formula editor bar when sheet selection changed or visible changed.
|
|
22571
22578
|
_editorSyncHandler(r) {
|
|
22572
22579
|
var i, o, s;
|
|
22573
|
-
let e =
|
|
22574
|
-
const t =
|
|
22580
|
+
let e = oe.deepClone((i = r.documentLayoutObject.documentModel) == null ? void 0 : i.getBody());
|
|
22581
|
+
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
22582
|
(!e || r.isInArrayFormulaRange === !0 && this._editorBridgeService.isVisible().eventType === Ye.Dblclick) && (e = {
|
|
22576
22583
|
dataStream: `\r
|
|
22577
22584
|
`,
|
|
@@ -22581,10 +22588,10 @@ let bl = class extends de {
|
|
|
22581
22588
|
}
|
|
22582
22589
|
],
|
|
22583
22590
|
textRuns: []
|
|
22584
|
-
}), this._syncContentAndRender(
|
|
22591
|
+
}), this._syncContentAndRender(De, e, t, n);
|
|
22585
22592
|
}
|
|
22586
22593
|
_commandExecutedListener() {
|
|
22587
|
-
const r = [
|
|
22594
|
+
const r = [Le, De];
|
|
22588
22595
|
this.disposeWithMe(
|
|
22589
22596
|
this._commandService.onCommandExecuted((t) => {
|
|
22590
22597
|
if (t.id === Hs.id) {
|
|
@@ -22592,7 +22599,7 @@ let bl = class extends de {
|
|
|
22592
22599
|
if (s || o === Vh.id)
|
|
22593
22600
|
return;
|
|
22594
22601
|
if (r.includes(i)) {
|
|
22595
|
-
const l = this._univerInstanceService.getUnit(i, x.UNIVER_DOC), a = i ===
|
|
22602
|
+
const l = this._univerInstanceService.getUnit(i, x.UNIVER_DOC), a = i === De ? Le : De;
|
|
22596
22603
|
this._checkAndSetRenderStyleConfig(l), this._syncActionsAndRender(a, n);
|
|
22597
22604
|
}
|
|
22598
22605
|
}
|
|
@@ -22609,10 +22616,10 @@ let bl = class extends de {
|
|
|
22609
22616
|
let u = !1;
|
|
22610
22617
|
const { row: h, column: g } = d;
|
|
22611
22618
|
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 =
|
|
22619
|
+
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
22620
|
if (m == null)
|
|
22614
22621
|
return;
|
|
22615
|
-
this._syncContentAndRender(
|
|
22622
|
+
this._syncContentAndRender(De, m, f, p);
|
|
22616
22623
|
}
|
|
22617
22624
|
}
|
|
22618
22625
|
})
|
|
@@ -22621,7 +22628,7 @@ let bl = class extends de {
|
|
|
22621
22628
|
// Sync actions between cell editor and formula editor, and make `dataStream` and `paragraph` is the same.
|
|
22622
22629
|
_syncActionsAndRender(r, e) {
|
|
22623
22630
|
var l;
|
|
22624
|
-
const t = [
|
|
22631
|
+
const t = [Le, De], n = this._renderManagerService.getRenderById(r);
|
|
22625
22632
|
if (n == null)
|
|
22626
22633
|
return;
|
|
22627
22634
|
const i = n.with(ir).getSkeleton(), o = this._univerInstanceService.getUnit(r, x.UNIVER_DOC), s = this._getEditorViewModel(r);
|
|
@@ -22635,18 +22642,18 @@ let bl = class extends de {
|
|
|
22635
22642
|
}
|
|
22636
22643
|
_syncContentAndRender(r, e, t, n) {
|
|
22637
22644
|
var c, d;
|
|
22638
|
-
r ===
|
|
22639
|
-
const i = [
|
|
22645
|
+
r === De && e.paragraphs && (e.paragraphs = this._clearParagraph(e.paragraphs));
|
|
22646
|
+
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
22647
|
if (s == null || l == null || o == null)
|
|
22641
22648
|
return;
|
|
22642
22649
|
s.getSnapshot().body = e, s.getSnapshot().drawings = t != null ? t : {}, s.getSnapshot().drawingsOrder = n != null ? n : [], this._checkAndSetRenderStyleConfig(s), l.reset(s);
|
|
22643
22650
|
const a = this._renderManagerService.getRenderById(r);
|
|
22644
|
-
a != null && (o.calculate(), i.includes(r) && ((d = a.mainComponent) == null || d.makeDirty()), r ===
|
|
22651
|
+
a != null && (o.calculate(), i.includes(r) && ((d = a.mainComponent) == null || d.makeDirty()), r === De && this._formulaEditorController.autoScroll());
|
|
22645
22652
|
}
|
|
22646
22653
|
_checkAndSetRenderStyleConfig(r) {
|
|
22647
22654
|
var o;
|
|
22648
22655
|
const e = r.getSnapshot(), { body: t } = e;
|
|
22649
|
-
if (e.id !==
|
|
22656
|
+
if (e.id !== De)
|
|
22650
22657
|
return;
|
|
22651
22658
|
e.documentStyle = kM;
|
|
22652
22659
|
let n = e.documentStyle.renderConfig;
|
|
@@ -22662,7 +22669,7 @@ let bl = class extends de {
|
|
|
22662
22669
|
((o = t == null ? void 0 : t.dataStream) != null ? o : "").startsWith("=") ? n.isRenderStyle = Ke.TRUE : n.isRenderStyle = Ke.FALSE;
|
|
22663
22670
|
}
|
|
22664
22671
|
_clearParagraph(r) {
|
|
22665
|
-
const e =
|
|
22672
|
+
const e = oe.deepClone(r);
|
|
22666
22673
|
for (const t of e)
|
|
22667
22674
|
t.paragraphStyle && (t.paragraphStyle.horizontalAlign = yt.UNSPECIFIED);
|
|
22668
22675
|
return e;
|
|
@@ -22739,7 +22746,7 @@ let _l = class extends de {
|
|
|
22739
22746
|
} : t, f = Array.from({ length: m.endRow - m.startRow + 1 }, () => Array.from({ length: m.endColumn - m.startColumn + 1 }, () => ({}))), p = [];
|
|
22740
22747
|
f.forEach((B, j) => {
|
|
22741
22748
|
B.forEach((Y, le) => {
|
|
22742
|
-
const me = j % h + a,
|
|
22749
|
+
const me = j % h + a, se = le % g + c, _e = l.getValue(me, se);
|
|
22743
22750
|
_e && (f[j][le].s = Object.keys(_e).length > 0 ? _e : null);
|
|
22744
22751
|
});
|
|
22745
22752
|
}), s.forEach((B) => {
|
|
@@ -22750,21 +22757,21 @@ let _l = class extends de {
|
|
|
22750
22757
|
endColumn: B.endColumn - c
|
|
22751
22758
|
}, 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
22759
|
for (let me = 0; me < Y; me++)
|
|
22753
|
-
for (let
|
|
22760
|
+
for (let se = 0; se < le; se++)
|
|
22754
22761
|
p.push({
|
|
22755
22762
|
startRow: j.startRow + me * h + m.startRow,
|
|
22756
|
-
startColumn: j.startColumn +
|
|
22763
|
+
startColumn: j.startColumn + se * g + m.startColumn,
|
|
22757
22764
|
endRow: j.endRow + me * h + m.startRow,
|
|
22758
|
-
endColumn: j.endColumn +
|
|
22765
|
+
endColumn: j.endColumn + se * g + m.startColumn
|
|
22759
22766
|
});
|
|
22760
22767
|
});
|
|
22761
22768
|
const S = [m], v = new Je(), C = new Je();
|
|
22762
|
-
if (
|
|
22769
|
+
if (oe.isArray(f))
|
|
22763
22770
|
for (let B = 0; B < S.length; B++) {
|
|
22764
22771
|
const { startRow: j, startColumn: Y, endRow: le, endColumn: me } = S[B];
|
|
22765
|
-
for (let
|
|
22772
|
+
for (let se = 0; se <= le - j; se++)
|
|
22766
22773
|
for (let _e = 0; _e <= me - Y; _e++)
|
|
22767
|
-
v.setValue(
|
|
22774
|
+
v.setValue(se + j, _e + Y, { s: null }), C.setValue(se + j, _e + Y, f[se][_e]);
|
|
22768
22775
|
}
|
|
22769
22776
|
const w = {
|
|
22770
22777
|
subUnitId: e,
|
|
@@ -23061,8 +23068,8 @@ let Jc = class extends Un {
|
|
|
23061
23068
|
const a = this._contextService.getContextValue(At), c = this._contextService.getContextValue(kt), d = o.unitId;
|
|
23062
23069
|
this._editorBridgeService.isVisible().visible || d && c && !a && this._showEditorByKeyboard(l);
|
|
23063
23070
|
})), e.add(t));
|
|
23064
|
-
}, i = this._renderManagerService.getRenderById(
|
|
23065
|
-
i ? n(i) : this.disposeWithMe(this._renderManagerService.created$.pipe(Vl((o) => o.unitId ===
|
|
23071
|
+
}, i = this._renderManagerService.getRenderById(Le);
|
|
23072
|
+
i ? n(i) : this.disposeWithMe(this._renderManagerService.created$.pipe(Vl((o) => o.unitId === Le)).subscribe((o) => {
|
|
23066
23073
|
t == null || t.dispose(), n(o);
|
|
23067
23074
|
}));
|
|
23068
23075
|
}
|