@univerjs/sheets-ui 1.0.4 → 1.2.0
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 +352 -230
- package/lib/cjs/locale/ar-SA.js +15 -0
- package/lib/cjs/locale/ca-ES.js +15 -0
- package/lib/cjs/locale/de-DE.js +15 -0
- package/lib/cjs/locale/en-US.js +15 -0
- package/lib/cjs/locale/es-ES.js +15 -0
- package/lib/cjs/locale/fa-IR.js +15 -0
- package/lib/cjs/locale/fr-FR.js +15 -0
- package/lib/cjs/locale/id-ID.js +15 -0
- package/lib/cjs/locale/it-IT.js +15 -0
- package/lib/cjs/locale/ja-JP.js +15 -0
- package/lib/cjs/locale/ko-KR.js +15 -0
- package/lib/cjs/locale/pl-PL.js +15 -0
- package/lib/cjs/locale/pt-BR.js +15 -0
- package/lib/cjs/locale/ru-RU.js +15 -0
- package/lib/cjs/locale/sk-SK.js +15 -0
- package/lib/cjs/locale/vi-VN.js +15 -0
- package/lib/cjs/locale/zh-CN.js +15 -0
- package/lib/cjs/locale/zh-HK.js +15 -0
- package/lib/cjs/locale/zh-TW.js +15 -0
- package/lib/es/index.js +318 -196
- package/lib/es/locale/ar-SA.js +15 -0
- package/lib/es/locale/ca-ES.js +15 -0
- package/lib/es/locale/de-DE.js +15 -0
- package/lib/es/locale/en-US.js +15 -0
- package/lib/es/locale/es-ES.js +15 -0
- package/lib/es/locale/fa-IR.js +15 -0
- package/lib/es/locale/fr-FR.js +15 -0
- package/lib/es/locale/id-ID.js +15 -0
- package/lib/es/locale/it-IT.js +15 -0
- package/lib/es/locale/ja-JP.js +15 -0
- package/lib/es/locale/ko-KR.js +15 -0
- package/lib/es/locale/pl-PL.js +15 -0
- package/lib/es/locale/pt-BR.js +15 -0
- package/lib/es/locale/ru-RU.js +15 -0
- package/lib/es/locale/sk-SK.js +15 -0
- package/lib/es/locale/vi-VN.js +15 -0
- package/lib/es/locale/zh-CN.js +15 -0
- package/lib/es/locale/zh-HK.js +15 -0
- package/lib/es/locale/zh-TW.js +15 -0
- package/lib/index.css +0 -20
- package/lib/index.js +318 -196
- package/lib/locale/ar-SA.js +15 -0
- package/lib/locale/ca-ES.js +15 -0
- package/lib/locale/de-DE.js +15 -0
- package/lib/locale/en-US.js +15 -0
- package/lib/locale/es-ES.js +15 -0
- package/lib/locale/fa-IR.js +15 -0
- package/lib/locale/fr-FR.js +15 -0
- package/lib/locale/id-ID.js +15 -0
- package/lib/locale/it-IT.js +15 -0
- package/lib/locale/ja-JP.js +15 -0
- package/lib/locale/ko-KR.js +15 -0
- package/lib/locale/pl-PL.js +15 -0
- package/lib/locale/pt-BR.js +15 -0
- package/lib/locale/ru-RU.js +15 -0
- package/lib/locale/sk-SK.js +15 -0
- package/lib/locale/vi-VN.js +15 -0
- package/lib/locale/zh-CN.js +15 -0
- package/lib/locale/zh-HK.js +15 -0
- package/lib/locale/zh-TW.js +15 -0
- package/lib/types/controllers/editor/utils/get-edit-cell-input-position.d.ts +31 -0
- package/lib/types/locale/en-US.d.ts +15 -0
- package/lib/types/menu/zoom.menu.d.ts +2 -2
- package/lib/types/services/cell-alert-manager.service.d.ts +1 -0
- package/lib/types/services/editor/cell-editor-resize.service.d.ts +6 -0
- package/lib/types/views/border-panel/interface.d.ts +37 -4
- package/lib/umd/facade.js +3 -1
- package/lib/umd/index.js +10 -12
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +17 -17
- package/lib/types/views/sheet-slider/SheetZoomInput.d.ts +0 -18
package/lib/cjs/index.js
CHANGED
|
@@ -241,7 +241,7 @@ let SHEET_VIEW_KEY = /* @__PURE__ */ function(SHEET_VIEW_KEY) {
|
|
|
241
241
|
}({});
|
|
242
242
|
|
|
243
243
|
//#endregion
|
|
244
|
-
//#region \0@oxc-project+runtime@0.
|
|
244
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
|
|
245
245
|
function _typeof(o) {
|
|
246
246
|
"@babel/helpers - typeof";
|
|
247
247
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -252,7 +252,7 @@ function _typeof(o) {
|
|
|
252
252
|
}
|
|
253
253
|
|
|
254
254
|
//#endregion
|
|
255
|
-
//#region \0@oxc-project+runtime@0.
|
|
255
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
|
|
256
256
|
function toPrimitive(t, r) {
|
|
257
257
|
if ("object" != _typeof(t) || !t) return t;
|
|
258
258
|
var e = t[Symbol.toPrimitive];
|
|
@@ -265,14 +265,14 @@ function toPrimitive(t, r) {
|
|
|
265
265
|
}
|
|
266
266
|
|
|
267
267
|
//#endregion
|
|
268
|
-
//#region \0@oxc-project+runtime@0.
|
|
268
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
|
|
269
269
|
function toPropertyKey(t) {
|
|
270
270
|
var i = toPrimitive(t, "string");
|
|
271
271
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
272
272
|
}
|
|
273
273
|
|
|
274
274
|
//#endregion
|
|
275
|
-
//#region \0@oxc-project+runtime@0.
|
|
275
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
|
|
276
276
|
function _defineProperty(e, r, t) {
|
|
277
277
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
278
278
|
value: t,
|
|
@@ -1045,7 +1045,7 @@ function genSelectionByRange(skeleton, range) {
|
|
|
1045
1045
|
}
|
|
1046
1046
|
|
|
1047
1047
|
//#endregion
|
|
1048
|
-
//#region \0@oxc-project+runtime@0.
|
|
1048
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateParam.js
|
|
1049
1049
|
function __decorateParam(paramIndex, decorator) {
|
|
1050
1050
|
return function(target, key) {
|
|
1051
1051
|
decorator(target, key, paramIndex);
|
|
@@ -1053,7 +1053,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
1053
1053
|
}
|
|
1054
1054
|
|
|
1055
1055
|
//#endregion
|
|
1056
|
-
//#region \0@oxc-project+runtime@0.
|
|
1056
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
|
|
1057
1057
|
function __decorate(decorators, target, key, desc) {
|
|
1058
1058
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1059
1059
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3106,9 +3106,10 @@ var HtmlToUSMService = class HtmlToUSMService {
|
|
|
3106
3106
|
cellDataStream = `${dataStream.substring(starts[i])}\r\n`;
|
|
3107
3107
|
if (cellDataStream === "\r\n") continue;
|
|
3108
3108
|
} else cellDataStream = `${dataStream.substring(starts[i], starts[i + 1] - 1)}\r\n`;
|
|
3109
|
+
const end = starts[i + 1] ?? dataStream.length;
|
|
3109
3110
|
const cellTextRuns = [];
|
|
3110
3111
|
textRuns === null || textRuns === void 0 || textRuns.forEach((t) => {
|
|
3111
|
-
if (t.st >= starts[i] && t.ed <=
|
|
3112
|
+
if (t.st >= starts[i] && t.ed <= end) cellTextRuns.push({
|
|
3112
3113
|
st: t.st - starts[i],
|
|
3113
3114
|
ed: t.ed - starts[i],
|
|
3114
3115
|
ts: t.ts
|
|
@@ -3116,7 +3117,7 @@ var HtmlToUSMService = class HtmlToUSMService {
|
|
|
3116
3117
|
});
|
|
3117
3118
|
const cellCustomRanges = [];
|
|
3118
3119
|
customRanges === null || customRanges === void 0 || customRanges.forEach((c) => {
|
|
3119
|
-
if (c.startIndex >= starts[i] && c.endIndex <=
|
|
3120
|
+
if (c.startIndex >= starts[i] && c.endIndex <= end) cellCustomRanges.push({
|
|
3120
3121
|
...c,
|
|
3121
3122
|
startIndex: c.startIndex - starts[i],
|
|
3122
3123
|
endIndex: c.endIndex - starts[i]
|
|
@@ -3144,14 +3145,9 @@ var HtmlToUSMService = class HtmlToUSMService {
|
|
|
3144
3145
|
payloads,
|
|
3145
3146
|
customRanges
|
|
3146
3147
|
};
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
valueMatrix.setValue(0, 0, convertToCellStyle({
|
|
3151
|
-
v: dataStream,
|
|
3152
|
-
p
|
|
3153
|
-
}, dataStream, textRuns));
|
|
3154
|
-
}
|
|
3148
|
+
const cell = { v: dataStream };
|
|
3149
|
+
if ((textRuns === null || textRuns === void 0 ? void 0 : textRuns.length) || (customRanges === null || customRanges === void 0 ? void 0 : customRanges.length)) cell.p = this._generateDocumentDataModelSnapshot({ body: singleDocBody });
|
|
3150
|
+
valueMatrix.setValue(0, 0, convertToCellStyle(cell, dataStream, textRuns));
|
|
3155
3151
|
rowProperties.push({});
|
|
3156
3152
|
}
|
|
3157
3153
|
if (tableStrings) tableStrings.forEach((t, index) => {
|
|
@@ -3768,7 +3764,7 @@ const LarkPastePlugin = {
|
|
|
3768
3764
|
const UniverPastePlugin = {
|
|
3769
3765
|
name: "univer-sheet-paste-plugin-univer",
|
|
3770
3766
|
checkPasteType(html) {
|
|
3771
|
-
return
|
|
3767
|
+
return /<p\b[^>]*\sclass\s*=\s*["'](?:[^"']*\s)?UniverNormal(?:\s[^"']*)?["']/i.test(html);
|
|
3772
3768
|
},
|
|
3773
3769
|
stylesRules: [],
|
|
3774
3770
|
afterProcessRules: [{
|
|
@@ -4145,9 +4141,9 @@ function wrapHtmlForExcel(html) {
|
|
|
4145
4141
|
/**
|
|
4146
4142
|
* This service provide hooks for sheet features to supplement content or modify behavior of clipboard.
|
|
4147
4143
|
*/
|
|
4144
|
+
HtmlToUSMService.use(UniverPastePlugin);
|
|
4148
4145
|
HtmlToUSMService.use(WordPastePlugin);
|
|
4149
4146
|
HtmlToUSMService.use(LarkPastePlugin);
|
|
4150
|
-
HtmlToUSMService.use(UniverPastePlugin);
|
|
4151
4147
|
const ISheetClipboardService = (0, _univerjs_core.createIdentifier)("sheet.clipboard-service");
|
|
4152
4148
|
let SheetClipboardService = class SheetClipboardService extends _univerjs_core.Disposable {
|
|
4153
4149
|
constructor(_logService, _univerInstanceService, _selectionManagerService, _clipboardInterfaceService, _undoRedoService, _commandService, _markSelectionService, _notificationService, _platformService, _renderManagerService, _themeService, _localeService, _errorService, _injector) {
|
|
@@ -6942,7 +6938,7 @@ const SetSelectionFrozenCommand = {
|
|
|
6942
6938
|
if (selectRow === 0) selectRow = 1;
|
|
6943
6939
|
let selectColumn = (primary === null || primary === void 0 ? void 0 : primary.startColumn) ?? range.startColumn;
|
|
6944
6940
|
if (selectColumn === 0) selectColumn = 1;
|
|
6945
|
-
const rangeType = range.rangeType;
|
|
6941
|
+
const rangeType = range.rangeType ?? _univerjs_core.RANGE_TYPE.NORMAL;
|
|
6946
6942
|
if (rangeType === _univerjs_core.RANGE_TYPE.ROW || type === 1) {
|
|
6947
6943
|
startRow = selectRow;
|
|
6948
6944
|
freezedRowCount = selectRow - sheetViewStartRow;
|
|
@@ -8241,14 +8237,17 @@ function transformPosition2Offset(x, y, scene, skeleton, worksheet) {
|
|
|
8241
8237
|
const endSheetView = skeleton.getNoMergeCellWithCoordByIndex(startRow, startColumn, false);
|
|
8242
8238
|
const { rowHeaderWidth, columnHeaderHeight } = skeleton;
|
|
8243
8239
|
const freezeWidth = endSheetView.startX - startSheetView.startX;
|
|
8244
|
-
const
|
|
8240
|
+
const freezeStartY = ySplit > 0 && startRow === ySplit ? 0 : startSheetView.startY;
|
|
8241
|
+
const freezeHeight = endSheetView.startY - freezeStartY;
|
|
8245
8242
|
const { top, left, viewportScrollX, viewportScrollY } = viewMain;
|
|
8243
|
+
const viewportLeft = left / scaleX;
|
|
8244
|
+
const viewportTop = top / scaleY;
|
|
8246
8245
|
let offsetX;
|
|
8247
|
-
if (x >
|
|
8248
|
-
else offsetX = (freezeWidth + rowHeaderWidth - (
|
|
8246
|
+
if (x > viewportLeft) offsetX = (x - viewportScrollX) * scaleX;
|
|
8247
|
+
else offsetX = (freezeWidth + rowHeaderWidth - (viewportLeft - x)) * scaleX;
|
|
8249
8248
|
let offsetY;
|
|
8250
|
-
if (y >
|
|
8251
|
-
else offsetY = (freezeHeight + columnHeaderHeight - (
|
|
8249
|
+
if (y > viewportTop) offsetY = (y - viewportScrollY) * scaleY;
|
|
8250
|
+
else offsetY = (freezeHeight + columnHeaderHeight - (viewportTop - y)) * scaleY;
|
|
8252
8251
|
return {
|
|
8253
8252
|
x: offsetX,
|
|
8254
8253
|
y: offsetY
|
|
@@ -10394,6 +10393,18 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends _u
|
|
|
10394
10393
|
this._univerInstanceService = _univerInstanceService;
|
|
10395
10394
|
this._configService = _configService;
|
|
10396
10395
|
this._embedFloatingGeometryService = _embedFloatingGeometryService;
|
|
10396
|
+
_defineProperty(this, "_editorWidth", 0);
|
|
10397
|
+
_defineProperty(this, "_editorHeight", 0);
|
|
10398
|
+
_defineProperty(this, "_initialEditorSize", null);
|
|
10399
|
+
_defineProperty(this, "_cellSize", null);
|
|
10400
|
+
this.disposeWithMe(this._editorBridgeService.visible$.subscribe(({ visible }) => {
|
|
10401
|
+
if (!visible) {
|
|
10402
|
+
this._editorWidth = 0;
|
|
10403
|
+
this._editorHeight = 0;
|
|
10404
|
+
this._initialEditorSize = null;
|
|
10405
|
+
this._cellSize = null;
|
|
10406
|
+
}
|
|
10407
|
+
}));
|
|
10397
10408
|
}
|
|
10398
10409
|
get _currentRenderer() {
|
|
10399
10410
|
return (0, _univerjs_engine_render.getCurrentTypeOfRenderer)(_univerjs_core.UniverInstanceType.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService);
|
|
@@ -10421,10 +10432,13 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends _u
|
|
|
10421
10432
|
if (!param) return;
|
|
10422
10433
|
const { position, documentLayoutObject, canvasOffset, scaleX, scaleY } = param;
|
|
10423
10434
|
const { startX, startY, endX, endY } = position;
|
|
10435
|
+
const cellWidth = endX - startX;
|
|
10436
|
+
const cellHeight = endY - startY;
|
|
10424
10437
|
const documentDataModel = this._univerInstanceService.getUnit(_univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY, _univerjs_core.UniverInstanceType.UNIVER_DOC);
|
|
10425
10438
|
if (documentDataModel == null) return;
|
|
10426
10439
|
const documentSkeleton = this._getEditorSkeleton();
|
|
10427
10440
|
if (!documentSkeleton) return;
|
|
10441
|
+
this._syncCellSize(cellWidth / scaleX, cellHeight / scaleY);
|
|
10428
10442
|
documentSkeleton.resetInitialWidth();
|
|
10429
10443
|
const info = this._predictingSize(position, canvasOffset, documentSkeleton, documentLayoutObject, scaleX, scaleY);
|
|
10430
10444
|
if (!info || info.actualWidth <= 0) return;
|
|
@@ -10432,17 +10446,17 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends _u
|
|
|
10432
10446
|
const { verticalAlign, horizontalAlign, paddingData, fill } = documentLayoutObject;
|
|
10433
10447
|
actualWidth = actualWidth + (paddingData.l ?? 0) * scaleX + (paddingData.r ?? 0) * scaleX;
|
|
10434
10448
|
actualHeight = actualHeight + (paddingData.t ?? 0) * scaleY + (paddingData.b ?? 0) * scaleY;
|
|
10435
|
-
|
|
10436
|
-
|
|
10437
|
-
|
|
10438
|
-
|
|
10449
|
+
const contentWidth = cellWidth < actualWidth ? Math.ceil(actualWidth) : cellWidth;
|
|
10450
|
+
const contentHeight = cellHeight < actualHeight ? Math.ceil(actualHeight) : cellHeight;
|
|
10451
|
+
const editorWidth = Math.max(contentWidth, Math.min(this._editorWidth * scaleX, info.maxSize.width));
|
|
10452
|
+
const editorHeight = Math.max(contentHeight, Math.min(this._editorHeight * scaleY, info.maxSize.height));
|
|
10439
10453
|
let offsetTop = 0;
|
|
10440
10454
|
if (verticalAlign === _univerjs_core.VerticalAlign.MIDDLE) offsetTop = (editorHeight - actualHeight) / 2 / scaleY;
|
|
10441
10455
|
else if (verticalAlign === _univerjs_core.VerticalAlign.TOP) offsetTop = paddingData.t || 0;
|
|
10442
10456
|
else offsetTop = (editorHeight - actualHeight) / scaleY;
|
|
10443
10457
|
let offsetLeft = 0;
|
|
10444
|
-
if (horizontalAlign === _univerjs_core.HorizontalAlign.
|
|
10445
|
-
else offsetLeft = paddingData.l || 0;
|
|
10458
|
+
if (horizontalAlign === _univerjs_core.HorizontalAlign.RIGHT) offsetLeft = (editorWidth - actualWidth) / scaleX;
|
|
10459
|
+
else if (horizontalAlign !== _univerjs_core.HorizontalAlign.CENTER) offsetLeft = paddingData.l || 0;
|
|
10446
10460
|
offsetTop = Math.max(offsetTop, paddingData.t || 0);
|
|
10447
10461
|
offsetLeft = Math.max(offsetLeft, paddingData.l || 0);
|
|
10448
10462
|
documentDataModel.updateDocumentDataMargin({
|
|
@@ -10450,7 +10464,22 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends _u
|
|
|
10450
10464
|
l: offsetLeft
|
|
10451
10465
|
});
|
|
10452
10466
|
documentSkeleton.calculate();
|
|
10453
|
-
this._editAreaProcessing(
|
|
10467
|
+
this._editAreaProcessing({
|
|
10468
|
+
width: editorWidth,
|
|
10469
|
+
height: editorHeight,
|
|
10470
|
+
contentWidth
|
|
10471
|
+
}, position, canvasOffset, fill, scaleX, scaleY, horizontalAlign, callback);
|
|
10472
|
+
}
|
|
10473
|
+
_syncCellSize(width, height) {
|
|
10474
|
+
if (this._cellSize && (Math.abs(this._cellSize.width - width) > 1e-6 || Math.abs(this._cellSize.height - height) > 1e-6)) {
|
|
10475
|
+
var _this$_initialEditorS, _this$_initialEditorS2;
|
|
10476
|
+
this._editorWidth = ((_this$_initialEditorS = this._initialEditorSize) === null || _this$_initialEditorS === void 0 ? void 0 : _this$_initialEditorS.width) ?? 0;
|
|
10477
|
+
this._editorHeight = ((_this$_initialEditorS2 = this._initialEditorSize) === null || _this$_initialEditorS2 === void 0 ? void 0 : _this$_initialEditorS2.height) ?? 0;
|
|
10478
|
+
}
|
|
10479
|
+
this._cellSize = {
|
|
10480
|
+
width,
|
|
10481
|
+
height
|
|
10482
|
+
};
|
|
10454
10483
|
}
|
|
10455
10484
|
/**
|
|
10456
10485
|
* Mainly used to pre-calculate the width of the editor,
|
|
@@ -10461,25 +10490,26 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends _u
|
|
|
10461
10490
|
const { textRotation, wrapStrategy, paddingData } = documentLayoutObject;
|
|
10462
10491
|
const documentDataModel = this._univerInstanceService.getUnit(_univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY, _univerjs_core.UniverInstanceType.UNIVER_DOC);
|
|
10463
10492
|
const { vertexAngle: angle } = (0, _univerjs_engine_render.convertTextRotation)(textRotation);
|
|
10493
|
+
const maxSize = this._getEditorMaxSize(actualRangeWithCoord, canvasOffset, documentLayoutObject.horizontalAlign);
|
|
10494
|
+
if (!maxSize) return;
|
|
10495
|
+
documentDataModel === null || documentDataModel === void 0 || documentDataModel.updateDocumentDataMargin({
|
|
10496
|
+
l: paddingData.l,
|
|
10497
|
+
t: paddingData.t
|
|
10498
|
+
});
|
|
10464
10499
|
if (wrapStrategy === _univerjs_core.WrapStrategy.WRAP && angle === 0) {
|
|
10465
10500
|
documentDataModel === null || documentDataModel === void 0 || documentDataModel.updateDocumentDataPageSize((endX - startX) / scaleX);
|
|
10466
|
-
documentDataModel === null || documentDataModel === void 0 || documentDataModel.updateDocumentDataMargin({
|
|
10467
|
-
l: paddingData.l,
|
|
10468
|
-
t: paddingData.t
|
|
10469
|
-
});
|
|
10470
10501
|
documentSkeleton.calculate();
|
|
10471
10502
|
const { actualWidth, actualHeight } = documentSkeleton.getActualSize();
|
|
10472
10503
|
return {
|
|
10473
10504
|
actualWidth: actualWidth * scaleX,
|
|
10474
|
-
actualHeight: actualHeight * scaleY
|
|
10505
|
+
actualHeight: actualHeight * scaleY,
|
|
10506
|
+
maxSize
|
|
10475
10507
|
};
|
|
10476
10508
|
}
|
|
10477
|
-
const maxSize = this._getEditorMaxSize(actualRangeWithCoord, canvasOffset, documentLayoutObject.horizontalAlign);
|
|
10478
|
-
if (!maxSize) return;
|
|
10479
10509
|
documentDataModel === null || documentDataModel === void 0 || documentDataModel.updateDocumentDataPageSize(maxSize.width / scaleX);
|
|
10480
10510
|
documentSkeleton.calculate();
|
|
10481
10511
|
const size = documentSkeleton.getActualSize();
|
|
10482
|
-
let editorWidth = endX - startX;
|
|
10512
|
+
let editorWidth = Math.max(endX - startX, Math.min(this._editorWidth * scaleX, maxSize.width));
|
|
10483
10513
|
if (editorWidth < size.actualWidth * scaleX + EDITOR_INPUT_SELF_EXTEND_GAP * scaleX) editorWidth = size.actualWidth * scaleX + EDITOR_INPUT_SELF_EXTEND_GAP * scaleX;
|
|
10484
10514
|
documentDataModel === null || documentDataModel === void 0 || documentDataModel.updateDocumentDataPageSize(editorWidth / scaleX);
|
|
10485
10515
|
/**
|
|
@@ -10491,7 +10521,8 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends _u
|
|
|
10491
10521
|
});
|
|
10492
10522
|
return {
|
|
10493
10523
|
actualWidth: size.actualWidth * scaleX,
|
|
10494
|
-
actualHeight: size.actualHeight * scaleY
|
|
10524
|
+
actualHeight: size.actualHeight * scaleY,
|
|
10525
|
+
maxSize
|
|
10495
10526
|
};
|
|
10496
10527
|
}
|
|
10497
10528
|
_getEditorMaxSize(position, canvasOffset, horizontalAlign) {
|
|
@@ -10537,7 +10568,7 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends _u
|
|
|
10537
10568
|
* determine whether a scrollbar appears,
|
|
10538
10569
|
* and calculate the editor's boundaries relative to the browser.
|
|
10539
10570
|
*/
|
|
10540
|
-
_editAreaProcessing(
|
|
10571
|
+
_editAreaProcessing(size, actualRangeWithCoord, canvasOffset, fill, scaleX = 1, scaleY = 1, horizontalAlign, callback) {
|
|
10541
10572
|
const editorObject = this._getEditorObject();
|
|
10542
10573
|
if (editorObject == null) return;
|
|
10543
10574
|
const engine = this.engine;
|
|
@@ -10545,25 +10576,16 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends _u
|
|
|
10545
10576
|
const canvasElement = engine.getCanvasElement();
|
|
10546
10577
|
let { startX, startY } = actualRangeWithCoord;
|
|
10547
10578
|
const { document: documentComponent, scene: editorScene, engine: docEngine } = editorObject;
|
|
10548
|
-
const viewportMain = editorScene.getViewport(_univerjs_docs_ui.VIEWPORT_KEY.VIEW_MAIN);
|
|
10549
10579
|
const { height: clientHeight, width: clientWidth, contentScaleX, contentScaleY, scaleAdjustX, scaleAdjustY } = this._getEditorMaxSize(actualRangeWithCoord, canvasOffset, horizontalAlign);
|
|
10550
|
-
|
|
10551
|
-
|
|
10552
|
-
|
|
10553
|
-
|
|
10554
|
-
|
|
10555
|
-
|
|
10556
|
-
|
|
10557
|
-
|
|
10558
|
-
|
|
10559
|
-
physicHeight = clientHeight;
|
|
10560
|
-
} else {
|
|
10561
|
-
var _viewportMain$getScro;
|
|
10562
|
-
scrollBar = null;
|
|
10563
|
-
viewportMain === null || viewportMain === void 0 || (_viewportMain$getScro = viewportMain.getScrollBar()) === null || _viewportMain$getScro === void 0 || _viewportMain$getScro.dispose();
|
|
10564
|
-
}
|
|
10565
|
-
editorWidth += (scrollBar === null || scrollBar === void 0 ? void 0 : scrollBar.barSize) || 0;
|
|
10566
|
-
if (editorWidth > clientWidth) editorWidth = clientWidth;
|
|
10580
|
+
const { physicHeight, scrollBarWidth } = this._fitEditorViewport(editorScene, size.height, clientHeight);
|
|
10581
|
+
const editorWidth = Math.min(Math.max(size.width, size.contentWidth + scrollBarWidth), clientWidth);
|
|
10582
|
+
const editorHeight = size.height;
|
|
10583
|
+
this._editorWidth = Math.max(this._editorWidth, editorWidth / scaleX);
|
|
10584
|
+
this._editorHeight = Math.max(this._editorHeight, physicHeight / scaleY);
|
|
10585
|
+
if (!this._initialEditorSize && this._editorBridgeService.isVisible().visible) this._initialEditorSize = {
|
|
10586
|
+
width: editorWidth / scaleX,
|
|
10587
|
+
height: physicHeight / scaleY
|
|
10588
|
+
};
|
|
10567
10589
|
this._addBackground(editorScene, editorWidth / scaleX, editorHeight / scaleY, fill);
|
|
10568
10590
|
const { scaleX: precisionScaleX, scaleY: precisionScaleY } = editorScene.getPrecisionScale();
|
|
10569
10591
|
editorScene.transformByState({
|
|
@@ -10573,11 +10595,6 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends _u
|
|
|
10573
10595
|
scaleY: scaleY * scaleAdjustY
|
|
10574
10596
|
});
|
|
10575
10597
|
documentComponent.resize(editorWidth * scaleAdjustX / scaleX, editorHeight * scaleAdjustY / scaleY);
|
|
10576
|
-
/**
|
|
10577
|
-
* sometimes requestIdleCallback is invalid, so use setTimeout to ensure the successful execution of the resizeBySize method.
|
|
10578
|
-
* resize canvas
|
|
10579
|
-
* When modifying the selection area for a formula, it is necessary to add a setTimeout to ensure successful updating.
|
|
10580
|
-
*/
|
|
10581
10598
|
setTimeout(() => {
|
|
10582
10599
|
docEngine.resizeBySize((0, _univerjs_engine_render.fixLineWidthByScale)(editorWidth, precisionScaleX), (0, _univerjs_engine_render.fixLineWidthByScale)(physicHeight, precisionScaleY));
|
|
10583
10600
|
callback === null || callback === void 0 || callback();
|
|
@@ -10597,6 +10614,26 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends _u
|
|
|
10597
10614
|
show: true
|
|
10598
10615
|
});
|
|
10599
10616
|
}
|
|
10617
|
+
_fitEditorViewport(editorScene, editorHeight, clientHeight) {
|
|
10618
|
+
const viewportMain = editorScene.getViewport(_univerjs_docs_ui.VIEWPORT_KEY.VIEW_MAIN);
|
|
10619
|
+
let scrollBar = viewportMain === null || viewportMain === void 0 ? void 0 : viewportMain.getScrollBar();
|
|
10620
|
+
if (editorHeight > clientHeight) {
|
|
10621
|
+
if (scrollBar == null) viewportMain && new _univerjs_engine_render.ScrollBar(viewportMain, {
|
|
10622
|
+
enableHorizontal: false,
|
|
10623
|
+
barSize: 8
|
|
10624
|
+
});
|
|
10625
|
+
else viewportMain === null || viewportMain === void 0 || viewportMain.resetCanvasSizeAndUpdateScroll();
|
|
10626
|
+
viewportMain === null || viewportMain === void 0 || viewportMain.scrollToViewportPos({ viewportScrollY: editorHeight - clientHeight });
|
|
10627
|
+
} else {
|
|
10628
|
+
var _viewportMain$getScro;
|
|
10629
|
+
scrollBar = null;
|
|
10630
|
+
viewportMain === null || viewportMain === void 0 || (_viewportMain$getScro = viewportMain.getScrollBar()) === null || _viewportMain$getScro === void 0 || _viewportMain$getScro.dispose();
|
|
10631
|
+
}
|
|
10632
|
+
return {
|
|
10633
|
+
physicHeight: Math.min(editorHeight, clientHeight),
|
|
10634
|
+
scrollBarWidth: (scrollBar === null || scrollBar === void 0 ? void 0 : scrollBar.barSize) ?? 0
|
|
10635
|
+
};
|
|
10636
|
+
}
|
|
10600
10637
|
_getEditorContentElement() {
|
|
10601
10638
|
var _this$_embedFloatingG;
|
|
10602
10639
|
return ((_this$_embedFloatingG = this._embedFloatingGeometryService) === null || _this$_embedFloatingG === void 0 || (_this$_embedFloatingG = _this$_embedFloatingG.getRegistrationByChildUnitId(this._editingUnitId)) === null || _this$_embedFloatingG === void 0 ? void 0 : _this$_embedFloatingG.contentRoot) ?? this._layoutService.getContentElement();
|
|
@@ -11423,6 +11460,29 @@ function processNumberStringWithSpaces(token, numStr) {
|
|
|
11423
11460
|
};
|
|
11424
11461
|
}
|
|
11425
11462
|
|
|
11463
|
+
//#endregion
|
|
11464
|
+
//#region src/controllers/editor/utils/get-edit-cell-input-position.ts
|
|
11465
|
+
/**
|
|
11466
|
+
* Get the position of the hidden editor input for the current edit cell.
|
|
11467
|
+
*
|
|
11468
|
+
* The OS anchors the IME candidate window to the focused input, so the input should stay on the
|
|
11469
|
+
* selected cell even before the cell editor opens. The position is kept inside the sheet canvas,
|
|
11470
|
+
* so a cell scrolled out of view never moves the input outside the sheet.
|
|
11471
|
+
*/
|
|
11472
|
+
function getEditCellInputPosition(layout, canvasSize) {
|
|
11473
|
+
const { position, canvasOffset } = layout;
|
|
11474
|
+
const x = canvasOffset.left + position.startX;
|
|
11475
|
+
const y = canvasOffset.top + position.startY;
|
|
11476
|
+
if (!canvasSize) return {
|
|
11477
|
+
x,
|
|
11478
|
+
y
|
|
11479
|
+
};
|
|
11480
|
+
return {
|
|
11481
|
+
x: Math.min(Math.max(x, canvasOffset.left), canvasOffset.left + canvasSize.width),
|
|
11482
|
+
y: Math.min(Math.max(y, canvasOffset.top), canvasOffset.top + canvasSize.height)
|
|
11483
|
+
};
|
|
11484
|
+
}
|
|
11485
|
+
|
|
11426
11486
|
//#endregion
|
|
11427
11487
|
//#region src/controllers/editor/utils/is-range-selector.ts
|
|
11428
11488
|
/**
|
|
@@ -11639,7 +11699,11 @@ let EditingRenderController = class EditingRenderController extends _univerjs_co
|
|
|
11639
11699
|
if ((cellSelectionRenderManager === null || cellSelectionRenderManager === void 0 ? void 0 : cellSelectionRenderManager.canFocusing) || (formulaSelectionRenderManager === null || formulaSelectionRenderManager === void 0 ? void 0 : formulaSelectionRenderManager.canFocusing)) {
|
|
11640
11700
|
this._univerInstanceService.setCurrentUnitForType(_univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY);
|
|
11641
11701
|
if (this._contextService.getContextValue(_univerjs_ui.DISABLE_AUTO_FOCUS_KEY)) cellSelectionRenderManager === null || cellSelectionRenderManager === void 0 || cellSelectionRenderManager.setInputPosition(HIDDEN_EDITOR_POSITION$1, HIDDEN_EDITOR_POSITION$1);
|
|
11642
|
-
else
|
|
11702
|
+
else {
|
|
11703
|
+
var _this$_renderManagerS5;
|
|
11704
|
+
const { x, y } = getEditCellInputPosition(state, (_this$_renderManagerS5 = this._renderManagerService.getRenderUnitById(state.unitId)) === null || _this$_renderManagerS5 === void 0 ? void 0 : _this$_renderManagerS5.engine);
|
|
11705
|
+
cellSelectionRenderManager === null || cellSelectionRenderManager === void 0 || cellSelectionRenderManager.activate(x, y, true);
|
|
11706
|
+
}
|
|
11643
11707
|
}
|
|
11644
11708
|
}));
|
|
11645
11709
|
}
|
|
@@ -11713,7 +11777,7 @@ let EditingRenderController = class EditingRenderController extends _univerjs_co
|
|
|
11713
11777
|
}));
|
|
11714
11778
|
}
|
|
11715
11779
|
_handleEditorVisible(param) {
|
|
11716
|
-
var _documentDataModel$ge, _this$
|
|
11780
|
+
var _documentDataModel$ge, _this$_renderManagerS7;
|
|
11717
11781
|
const { eventType, keycode } = param;
|
|
11718
11782
|
this._cursorChange = eventType === _univerjs_engine_render.DeviceInputEventType.PointerDown || eventType === _univerjs_engine_render.DeviceInputEventType.Dblclick ? 2 : 1;
|
|
11719
11783
|
const editCellState = this._editorBridgeService.getEditLocation();
|
|
@@ -11742,8 +11806,8 @@ let EditingRenderController = class EditingRenderController extends _univerjs_co
|
|
|
11742
11806
|
const resetPointerSelection = isInArrayFormulaRange && eventType === _univerjs_engine_render.DeviceInputEventType.PointerDown;
|
|
11743
11807
|
const editorId = this._contextService.getContextValue(_univerjs_core.FOCUSING_FX_BAR_EDITOR) ? _univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY : this._editorBridgeService.getCurrentEditorId();
|
|
11744
11808
|
if (resetPointerSelection) {
|
|
11745
|
-
var _this$
|
|
11746
|
-
(_this$
|
|
11809
|
+
var _this$_renderManagerS6;
|
|
11810
|
+
(_this$_renderManagerS6 = this._renderManagerService.getRenderUnitById(editorId)) === null || _this$_renderManagerS6 === void 0 || _this$_renderManagerS6.with(_univerjs_docs_ui.DocSelectionRenderService).cancelPointerSelection();
|
|
11747
11811
|
}
|
|
11748
11812
|
this._emptyDocumentDataModel(documentDataModel.getSnapshot().documentStyle, !!isInArrayFormulaRange);
|
|
11749
11813
|
document.makeDirty();
|
|
@@ -11821,7 +11885,7 @@ let EditingRenderController = class EditingRenderController extends _univerjs_co
|
|
|
11821
11885
|
collapsed: true
|
|
11822
11886
|
});
|
|
11823
11887
|
}
|
|
11824
|
-
(_this$
|
|
11888
|
+
(_this$_renderManagerS7 = this._renderManagerService.getRenderUnitById(unitId)) === null || _this$_renderManagerS7 === void 0 || _this$_renderManagerS7.scene.resetCursor();
|
|
11825
11889
|
}
|
|
11826
11890
|
_resizeEditorOnOpen(param, editorObject, isInArrayFormulaRange) {
|
|
11827
11891
|
var _this$_sheetCellEdito4;
|
|
@@ -11837,8 +11901,8 @@ let EditingRenderController = class EditingRenderController extends _univerjs_co
|
|
|
11837
11901
|
if (!pointerPosition || isInArrayFormulaRange) return;
|
|
11838
11902
|
const rect = engine.getCanvasElement().getBoundingClientRect();
|
|
11839
11903
|
if (rect.width > 0 && rect.height > 0) {
|
|
11840
|
-
var _this$
|
|
11841
|
-
(_this$
|
|
11904
|
+
var _this$_renderManagerS8;
|
|
11905
|
+
(_this$_renderManagerS8 = this._renderManagerService.getRenderUnitById(_univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY)) === null || _this$_renderManagerS8 === void 0 || _this$_renderManagerS8.with(_univerjs_docs_ui.DocSelectionRenderService).setCursorManually((pointerPosition.x - rect.left) * engine.width / rect.width, (pointerPosition.y - rect.top) * engine.height / rect.height, true, true, { strict: false });
|
|
11842
11906
|
}
|
|
11843
11907
|
});
|
|
11844
11908
|
}
|
|
@@ -12040,12 +12104,12 @@ let EditingRenderController = class EditingRenderController extends _univerjs_co
|
|
|
12040
12104
|
return this._univerInstanceService.getUnit(_univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY, _univerjs_core.UniverInstanceType.UNIVER_DOC);
|
|
12041
12105
|
}
|
|
12042
12106
|
_getEditorSkeleton(editorId) {
|
|
12043
|
-
var _this$
|
|
12044
|
-
return (_this$
|
|
12107
|
+
var _this$_renderManagerS9;
|
|
12108
|
+
return (_this$_renderManagerS9 = this._renderManagerService.getRenderUnitById(editorId)) === null || _this$_renderManagerS9 === void 0 ? void 0 : _this$_renderManagerS9.with(_univerjs_docs.DocSkeletonManagerService).getSkeleton();
|
|
12045
12109
|
}
|
|
12046
12110
|
_getEditorViewModel(editorId) {
|
|
12047
|
-
var _this$
|
|
12048
|
-
return (_this$
|
|
12111
|
+
var _this$_renderManagerS10;
|
|
12112
|
+
return (_this$_renderManagerS10 = this._renderManagerService.getRenderUnitById(editorId)) === null || _this$_renderManagerS10 === void 0 ? void 0 : _this$_renderManagerS10.with(_univerjs_docs.DocSkeletonManagerService).getViewModel();
|
|
12049
12113
|
}
|
|
12050
12114
|
_getEditingUnit() {
|
|
12051
12115
|
return this._editingUnit ? this._univerInstanceService.getUnit(this._editingUnit, _univerjs_core.UniverInstanceType.UNIVER_SHEET) : null;
|
|
@@ -12103,13 +12167,13 @@ function getCellDataByInput(cellData, snapshot, lexerTreeBuilder, localeService,
|
|
|
12103
12167
|
cellData.si = null;
|
|
12104
12168
|
cellData.p = snapshot;
|
|
12105
12169
|
cellData.t = _univerjs_core.CellValueType.STRING;
|
|
12106
|
-
} else if (cellData.s && (0, _univerjs_core.isTextFormat)(styles === null || styles === void 0 || (_styles$get = styles.get(cellData.s)) === null || _styles$get === void 0 || (_styles$get = _styles$get.n) === null || _styles$get === void 0 ? void 0 : _styles$get.pattern)) {
|
|
12170
|
+
} else if (newDataStream !== "" && cellData.s && (0, _univerjs_core.isTextFormat)(styles === null || styles === void 0 || (_styles$get = styles.get(cellData.s)) === null || _styles$get === void 0 || (_styles$get = _styles$get.n) === null || _styles$get === void 0 ? void 0 : _styles$get.pattern)) {
|
|
12107
12171
|
cellData.v = newDataStream;
|
|
12108
12172
|
cellData.f = null;
|
|
12109
12173
|
cellData.si = null;
|
|
12110
12174
|
cellData.p = null;
|
|
12111
12175
|
cellData.t = _univerjs_core.CellValueType.STRING;
|
|
12112
|
-
if (isRichText(body)
|
|
12176
|
+
if (isRichText(body)) cellData.p = snapshot;
|
|
12113
12177
|
const style = getCellStyleBySnapshot(snapshot);
|
|
12114
12178
|
if (style) cellData.s = style;
|
|
12115
12179
|
} else if ((0, _univerjs_core.isFormulaString)(newDataStream)) {
|
|
@@ -12126,21 +12190,14 @@ function getCellDataByInput(cellData, snapshot, lexerTreeBuilder, localeService,
|
|
|
12126
12190
|
cellData.si = null;
|
|
12127
12191
|
cellData.p = null;
|
|
12128
12192
|
cellData.t = _univerjs_core.CellValueType.FORCE_STRING;
|
|
12129
|
-
} else if (isRichText(body)) {
|
|
12130
|
-
|
|
12131
|
-
|
|
12132
|
-
|
|
12133
|
-
|
|
12134
|
-
cellData.p = null;
|
|
12135
|
-
} else {
|
|
12136
|
-
cellData.p = snapshot;
|
|
12137
|
-
cellData.v = null;
|
|
12138
|
-
cellData.f = null;
|
|
12139
|
-
cellData.si = null;
|
|
12140
|
-
}
|
|
12193
|
+
} else if (newDataStream !== "" && isRichText(body)) {
|
|
12194
|
+
cellData.p = snapshot;
|
|
12195
|
+
cellData.v = null;
|
|
12196
|
+
cellData.f = null;
|
|
12197
|
+
cellData.si = null;
|
|
12141
12198
|
} else {
|
|
12142
|
-
if (newDataStream === "" && cellData.v == null && cellData.p == null) return null;
|
|
12143
|
-
cellData.v = newDataStream;
|
|
12199
|
+
if (newDataStream === "" && cellData.v == null && cellData.p == null && cellData.f == null && cellData.si == null) return null;
|
|
12200
|
+
cellData.v = newDataStream === "" ? null : newDataStream;
|
|
12144
12201
|
cellData.f = null;
|
|
12145
12202
|
cellData.si = null;
|
|
12146
12203
|
cellData.p = null;
|
|
@@ -14685,6 +14742,7 @@ let HeaderFreezeRenderController = class HeaderFreezeRenderController extends _u
|
|
|
14685
14742
|
if (row === -1 || row === 0) isTopView = false;
|
|
14686
14743
|
if (column === -1 || column === 0) isLeftView = false;
|
|
14687
14744
|
const startSheetView = skeleton.getNoMergeCellWithCoordByIndex(row - ySplit, column - xSplit, false);
|
|
14745
|
+
if (isTopView && row === ySplit) startSheetView.startY = 0;
|
|
14688
14746
|
const endSheetView = skeleton.getNoMergeCellWithCoordByIndex(row, column, false);
|
|
14689
14747
|
viewMainLeftTop.disable();
|
|
14690
14748
|
viewMainTop.disable();
|
|
@@ -14917,6 +14975,10 @@ let HeaderFreezeRenderController = class HeaderFreezeRenderController extends _u
|
|
|
14917
14975
|
* When switching sheet tabs, it is necessary to update the frozen state of the current view.
|
|
14918
14976
|
*/
|
|
14919
14977
|
_skeletonListener() {
|
|
14978
|
+
this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.pipe((0, rxjs.switchMap)((param) => {
|
|
14979
|
+
var _param$skeleton;
|
|
14980
|
+
return (param === null || param === void 0 || (_param$skeleton = param.skeleton) === null || _param$skeleton === void 0 ? void 0 : _param$skeleton.gapConfigChanged$) ?? rxjs.EMPTY;
|
|
14981
|
+
})).subscribe(() => this._refreshCurrent()));
|
|
14920
14982
|
this.disposeWithMe((0, _univerjs_core.toDisposable)(this._sheetSkeletonManagerService.currentSkeleton$.subscribe((param) => {
|
|
14921
14983
|
if ([
|
|
14922
14984
|
_univerjs_sheets.SetWorksheetActiveOperation.id,
|
|
@@ -17452,51 +17514,51 @@ const BORDER_LINE_CHILDREN = [
|
|
|
17452
17514
|
];
|
|
17453
17515
|
const BORDER_SIZE_CHILDREN = [
|
|
17454
17516
|
{
|
|
17455
|
-
label:
|
|
17517
|
+
label: "sheets-ui.borderStyle.thin",
|
|
17456
17518
|
value: _univerjs_core.BorderStyleTypes.THIN
|
|
17457
17519
|
},
|
|
17458
17520
|
{
|
|
17459
|
-
label:
|
|
17521
|
+
label: "sheets-ui.borderStyle.hair",
|
|
17460
17522
|
value: _univerjs_core.BorderStyleTypes.HAIR
|
|
17461
17523
|
},
|
|
17462
17524
|
{
|
|
17463
|
-
label:
|
|
17525
|
+
label: "sheets-ui.borderStyle.dotted",
|
|
17464
17526
|
value: _univerjs_core.BorderStyleTypes.DOTTED
|
|
17465
17527
|
},
|
|
17466
17528
|
{
|
|
17467
|
-
label:
|
|
17529
|
+
label: "sheets-ui.borderStyle.dashed",
|
|
17468
17530
|
value: _univerjs_core.BorderStyleTypes.DASHED
|
|
17469
17531
|
},
|
|
17470
17532
|
{
|
|
17471
|
-
label:
|
|
17533
|
+
label: "sheets-ui.borderStyle.dashDot",
|
|
17472
17534
|
value: _univerjs_core.BorderStyleTypes.DASH_DOT
|
|
17473
17535
|
},
|
|
17474
17536
|
{
|
|
17475
|
-
label:
|
|
17537
|
+
label: "sheets-ui.borderStyle.dashDotDot",
|
|
17476
17538
|
value: _univerjs_core.BorderStyleTypes.DASH_DOT_DOT
|
|
17477
17539
|
},
|
|
17478
17540
|
{
|
|
17479
|
-
label:
|
|
17541
|
+
label: "sheets-ui.borderStyle.medium",
|
|
17480
17542
|
value: _univerjs_core.BorderStyleTypes.MEDIUM
|
|
17481
17543
|
},
|
|
17482
17544
|
{
|
|
17483
|
-
label:
|
|
17545
|
+
label: "sheets-ui.borderStyle.mediumDashed",
|
|
17484
17546
|
value: _univerjs_core.BorderStyleTypes.MEDIUM_DASHED
|
|
17485
17547
|
},
|
|
17486
17548
|
{
|
|
17487
|
-
label:
|
|
17549
|
+
label: "sheets-ui.borderStyle.mediumDashDot",
|
|
17488
17550
|
value: _univerjs_core.BorderStyleTypes.MEDIUM_DASH_DOT
|
|
17489
17551
|
},
|
|
17490
17552
|
{
|
|
17491
|
-
label:
|
|
17553
|
+
label: "sheets-ui.borderStyle.mediumDashDotDot",
|
|
17492
17554
|
value: _univerjs_core.BorderStyleTypes.MEDIUM_DASH_DOT_DOT
|
|
17493
17555
|
},
|
|
17494
17556
|
{
|
|
17495
|
-
label:
|
|
17557
|
+
label: "sheets-ui.borderStyle.thick",
|
|
17496
17558
|
value: _univerjs_core.BorderStyleTypes.THICK
|
|
17497
17559
|
},
|
|
17498
17560
|
{
|
|
17499
|
-
label:
|
|
17561
|
+
label: "sheets-ui.borderStyle.double",
|
|
17500
17562
|
value: _univerjs_core.BorderStyleTypes.DOUBLE
|
|
17501
17563
|
}
|
|
17502
17564
|
];
|
|
@@ -19526,6 +19588,7 @@ function PasteRibbonMenuItemFactory(accessor) {
|
|
|
19526
19588
|
return {
|
|
19527
19589
|
...PasteSpacialMenuItemFactory(accessor),
|
|
19528
19590
|
id: PASTE_RIBBON_MENU_ID,
|
|
19591
|
+
icon: "DocPasteOptionsIcon",
|
|
19529
19592
|
title: "sheets-ui.rightClick.paste",
|
|
19530
19593
|
hidden$: (0, rxjs.combineLatest)([getObservableWithExclusiveRange$(accessor, (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)), accessor.get(_univerjs_core.IContextService).subscribeContextValue$(_univerjs_core.FOCUSING_SHAPE_TEXT_EDITOR).pipe((0, rxjs.startWith)(false))]).pipe((0, rxjs.map)(([hidden, editing]) => hidden || editing))
|
|
19531
19594
|
};
|
|
@@ -19798,6 +19861,9 @@ function SetColWidthMenuItemFactory(accessor) {
|
|
|
19798
19861
|
//#endregion
|
|
19799
19862
|
//#region src/menu/merge.menu.ts
|
|
19800
19863
|
function CellMergeMenuItemFactory(accessor) {
|
|
19864
|
+
const commandService = accessor.get(_univerjs_core.ICommandService);
|
|
19865
|
+
const instanceService = accessor.get(_univerjs_core.IUniverInstanceService);
|
|
19866
|
+
const selectionService = accessor.get(_univerjs_sheets.SheetsSelectionsService);
|
|
19801
19867
|
const editDisabled$ = getObservableWithExclusiveRange$(accessor, getCurrentRangeDisable$(accessor, {
|
|
19802
19868
|
workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
|
|
19803
19869
|
worksheetTypes: [
|
|
@@ -19813,6 +19879,22 @@ function CellMergeMenuItemFactory(accessor) {
|
|
|
19813
19879
|
icon: "MergeAllIcon",
|
|
19814
19880
|
tooltip: "sheets-ui.toolbar.mergeCell.main",
|
|
19815
19881
|
type: _univerjs_ui.MenuItemType.SUBITEMS,
|
|
19882
|
+
activated$: deriveStateFromActiveSheet$(instanceService, false, ({ worksheet }) => new rxjs.Observable((subscriber) => {
|
|
19883
|
+
const update = () => {
|
|
19884
|
+
var _selectionService$get;
|
|
19885
|
+
const primary = (_selectionService$get = selectionService.getCurrentLastSelection()) === null || _selectionService$get === void 0 ? void 0 : _selectionService$get.primary;
|
|
19886
|
+
subscriber.next(!!primary && !!worksheet.getMergedCell(primary.actualRow, primary.actualColumn));
|
|
19887
|
+
};
|
|
19888
|
+
const selectionSubscription = selectionService.selectionChanged$.subscribe(update);
|
|
19889
|
+
const commandDisposable = commandService.onCommandExecuted((command) => {
|
|
19890
|
+
if (command.id === _univerjs_sheets.AddWorksheetMergeMutation.id || command.id === _univerjs_sheets.RemoveWorksheetMergeMutation.id) update();
|
|
19891
|
+
});
|
|
19892
|
+
update();
|
|
19893
|
+
return () => {
|
|
19894
|
+
selectionSubscription.unsubscribe();
|
|
19895
|
+
commandDisposable.dispose();
|
|
19896
|
+
};
|
|
19897
|
+
})).pipe((0, rxjs.distinctUntilChanged)()),
|
|
19816
19898
|
hidden$: (0, rxjs.combineLatest)([(0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET), accessor.get(_univerjs_core.IContextService).subscribeContextValue$(_univerjs_core.FOCUSING_COMMON_DRAWINGS).pipe((0, rxjs.startWith)(false))]).pipe((0, rxjs.map)(([hidden, focusingDrawing]) => hidden || focusingDrawing)),
|
|
19817
19899
|
disabled$: editDisabled$.pipe((0, rxjs.combineLatestWith)(selectionsHasCross$), (0, rxjs.map)(([disable, hasCross]) => disable || hasCross))
|
|
19818
19900
|
};
|
|
@@ -20396,18 +20478,6 @@ function Text2NumberContextMenuItemFactory(accessor) {
|
|
|
20396
20478
|
};
|
|
20397
20479
|
}
|
|
20398
20480
|
|
|
20399
|
-
//#endregion
|
|
20400
|
-
//#region src/views/sheet-slider/SheetZoomInput.tsx
|
|
20401
|
-
const SHEET_ZOOM_INPUT_COMPONENT = "SHEET_ZOOM_INPUT_COMPONENT";
|
|
20402
|
-
function SheetZoomInput({ className, ...props }) {
|
|
20403
|
-
const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
|
|
20404
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_ui.ZoomInput, {
|
|
20405
|
-
...props,
|
|
20406
|
-
className: (0, _univerjs_design.clsx)("!univer-bg-transparent dark:!univer-bg-transparent", className),
|
|
20407
|
-
onChange: (value) => commandService.executeCommand(SetZoomRatioFromToolbarCommand.id, { value })
|
|
20408
|
-
});
|
|
20409
|
-
}
|
|
20410
|
-
|
|
20411
20481
|
//#endregion
|
|
20412
20482
|
//#region src/menu/zoom.menu.ts
|
|
20413
20483
|
const ZOOM_RATIO_MENU_ID = "sheet.menu.zoom-ratio";
|
|
@@ -20436,16 +20506,14 @@ function getZoomRatioValue$(accessor) {
|
|
|
20436
20506
|
function ZoomRatioMenuItemFactory(accessor) {
|
|
20437
20507
|
return {
|
|
20438
20508
|
id: ZOOM_RATIO_MENU_ID,
|
|
20439
|
-
|
|
20440
|
-
type: _univerjs_ui.MenuItemType.
|
|
20441
|
-
|
|
20442
|
-
|
|
20443
|
-
|
|
20444
|
-
|
|
20445
|
-
|
|
20446
|
-
|
|
20447
|
-
}
|
|
20448
|
-
},
|
|
20509
|
+
selectionsCommandId: SetZoomRatioFromToolbarCommand.id,
|
|
20510
|
+
type: _univerjs_ui.MenuItemType.SELECTOR,
|
|
20511
|
+
icon: "ZoomInIcon",
|
|
20512
|
+
tooltip: "sheets-ui.toolbar.zoom",
|
|
20513
|
+
selections: ZOOM_RATIO_LIST.map((value) => ({
|
|
20514
|
+
value,
|
|
20515
|
+
label: `${value}%`
|
|
20516
|
+
})),
|
|
20449
20517
|
value$: getZoomRatioValue$(accessor),
|
|
20450
20518
|
hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)
|
|
20451
20519
|
};
|
|
@@ -20682,31 +20750,29 @@ const menuSchema = {
|
|
|
20682
20750
|
order: 1,
|
|
20683
20751
|
gridLayout: {
|
|
20684
20752
|
row: 1,
|
|
20685
|
-
column: 2
|
|
20686
|
-
width: 112
|
|
20753
|
+
column: 2
|
|
20687
20754
|
},
|
|
20688
20755
|
menuItemFactory: ZoomRatioMenuItemFactory
|
|
20756
|
+
}
|
|
20757
|
+
},
|
|
20758
|
+
[_univerjs_ui.RibbonViewGroup.VISIBILITY]: {
|
|
20759
|
+
[_univerjs_sheets.ToggleGridlinesCommand.id]: {
|
|
20760
|
+
order: 0,
|
|
20761
|
+
gridLayout: {
|
|
20762
|
+
row: 1,
|
|
20763
|
+
column: 1
|
|
20764
|
+
},
|
|
20765
|
+
menuItemFactory: ToggleGridlinesMenuFactory
|
|
20689
20766
|
},
|
|
20690
20767
|
[_univerjs_ui.ToggleFullscreenOperation.id]: {
|
|
20691
|
-
order:
|
|
20768
|
+
order: 1,
|
|
20692
20769
|
gridLayout: {
|
|
20693
20770
|
row: 2,
|
|
20694
|
-
column:
|
|
20695
|
-
showLabel: true,
|
|
20696
|
-
width: 112
|
|
20771
|
+
column: 1
|
|
20697
20772
|
},
|
|
20698
20773
|
menuItemFactory: FullscreenMenuItemFactory
|
|
20699
20774
|
}
|
|
20700
|
-
}
|
|
20701
|
-
[_univerjs_ui.RibbonViewGroup.VISIBILITY]: { [_univerjs_sheets.ToggleGridlinesCommand.id]: {
|
|
20702
|
-
order: 0,
|
|
20703
|
-
gridLayout: {
|
|
20704
|
-
row: 1,
|
|
20705
|
-
column: 1,
|
|
20706
|
-
showLabel: true
|
|
20707
|
-
},
|
|
20708
|
-
menuItemFactory: ToggleGridlinesMenuFactory
|
|
20709
|
-
} }
|
|
20775
|
+
}
|
|
20710
20776
|
},
|
|
20711
20777
|
[_univerjs_ui.ContextMenuPosition.MAIN_AREA]: {
|
|
20712
20778
|
[_univerjs_ui.ContextMenuGroup.QUICK]: {
|
|
@@ -22121,11 +22187,15 @@ function DefinedName({ disable }) {
|
|
|
22121
22187
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
22122
22188
|
ref: nameBoxRef,
|
|
22123
22189
|
"data-u-comp": "defined-name",
|
|
22190
|
+
onMouseDown: (e) => {
|
|
22191
|
+
if (disable) e.preventDefault();
|
|
22192
|
+
},
|
|
22124
22193
|
className: "univer-relative univer-box-border univer-flex univer-h-full univer-w-24 univer-border-r-gray-200 univer-py-1.5 univer-transition-all",
|
|
22125
22194
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
22126
22195
|
ref: inputRef,
|
|
22127
22196
|
className: (0, _univerjs_design.clsx)("univer-box-border univer-size-full univer-appearance-none univer-bg-transparent univer-pl-1.5 univer-pr-5 univer-text-gray-900 focus:univer-outline-none dark:!univer-border-r-gray-700 dark:!univer-text-gray-0", _univerjs_design.borderRightClassName, { "univer-cursor-not-allowed": disable }),
|
|
22128
22197
|
type: "text",
|
|
22198
|
+
disabled: disable,
|
|
22129
22199
|
value: inputValue,
|
|
22130
22200
|
onChange: handleChangeSelection,
|
|
22131
22201
|
onKeyDown: handleKeyDown,
|
|
@@ -22142,7 +22212,7 @@ function DefinedName({ disable }) {
|
|
|
22142
22212
|
})
|
|
22143
22213
|
}),
|
|
22144
22214
|
disabled: disable,
|
|
22145
|
-
open,
|
|
22215
|
+
open: !disable && open,
|
|
22146
22216
|
onOpenChange: setOpen,
|
|
22147
22217
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
22148
22218
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
@@ -22323,7 +22393,7 @@ function FormulaBar(props) {
|
|
|
22323
22393
|
children: [
|
|
22324
22394
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
22325
22395
|
className: "univer-relative univer-box-border univer-h-full univer-w-[100px]",
|
|
22326
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DefinedName, { disable: disableDefinedName ?? editDisable })
|
|
22396
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DefinedName, { disable: iconActivated || (disableDefinedName ?? editDisable) })
|
|
22327
22397
|
}),
|
|
22328
22398
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
22329
22399
|
className: "univer-flex univer-size-full",
|
|
@@ -23514,6 +23584,7 @@ function SheetBarTabs() {
|
|
|
23514
23584
|
const slideTabBarContainerRef = (0, react.useRef)(null);
|
|
23515
23585
|
const activeSheetIdRef = (0, react.useRef)(activeSheetId);
|
|
23516
23586
|
const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
|
|
23587
|
+
const layoutService = (0, _univerjs_ui.useDependency)(_univerjs_ui.ILayoutService);
|
|
23517
23588
|
const renderManagerService = (0, _univerjs_ui.useDependency)(_univerjs_engine_render.IRenderManagerService);
|
|
23518
23589
|
const sheetBarService = (0, _univerjs_ui.useDependency)(ISheetBarService);
|
|
23519
23590
|
const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
|
|
@@ -23699,6 +23770,7 @@ function SheetBarTabs() {
|
|
|
23699
23770
|
subUnitId,
|
|
23700
23771
|
unitId: workbookRef.current.getUnitId()
|
|
23701
23772
|
}).then((result) => {
|
|
23773
|
+
requestAnimationFrame(() => layoutService.focus(workbookRef.current.getUnitId()));
|
|
23702
23774
|
if (result !== false) return;
|
|
23703
23775
|
const worksheet = workbookRef.current.getSheetBySheetId(subUnitId);
|
|
23704
23776
|
if (worksheet) {
|
|
@@ -23706,7 +23778,11 @@ function SheetBarTabs() {
|
|
|
23706
23778
|
syncActiveSheetRender(subUnitId);
|
|
23707
23779
|
}
|
|
23708
23780
|
});
|
|
23709
|
-
}, [
|
|
23781
|
+
}, [
|
|
23782
|
+
commandService,
|
|
23783
|
+
layoutService,
|
|
23784
|
+
syncActiveSheetRender
|
|
23785
|
+
]);
|
|
23710
23786
|
const observeResize = (0, react.useCallback)((slideTabBar) => {
|
|
23711
23787
|
var _slideTabBarContainer;
|
|
23712
23788
|
const slideTabBarContainer = (_slideTabBarContainer = slideTabBarContainerRef.current) === null || _slideTabBarContainer === void 0 ? void 0 : _slideTabBarContainer.querySelector("[data-u-comp=slide-tab-bar]");
|
|
@@ -25016,7 +25092,7 @@ const useHighlightRange = (ranges = []) => {
|
|
|
25016
25092
|
//#endregion
|
|
25017
25093
|
//#region package.json
|
|
25018
25094
|
var name = "@univerjs/sheets-ui";
|
|
25019
|
-
var version = "1.0
|
|
25095
|
+
var version = "1.2.0";
|
|
25020
25096
|
|
|
25021
25097
|
//#endregion
|
|
25022
25098
|
//#region src/views/cell-popup/config.ts
|
|
@@ -25349,7 +25425,7 @@ function CellAlert({ popup, DropdownMenuComponent = _univerjs_design.DropdownMen
|
|
|
25349
25425
|
const [isHovered, setIsHovered] = (0, react.useState)(false);
|
|
25350
25426
|
const alert = (_popup$extraProps = popup.extraProps) === null || _popup$extraProps === void 0 ? void 0 : _popup$extraProps.alert;
|
|
25351
25427
|
if (!alert) return null;
|
|
25352
|
-
const { type, title, message, menu } = alert;
|
|
25428
|
+
const { type, title, message, menu, action, width } = alert;
|
|
25353
25429
|
if (menu === null || menu === void 0 ? void 0 : menu.length) {
|
|
25354
25430
|
const accessibleLabel = [title, message].filter((value) => typeof value === "string").join(": ");
|
|
25355
25431
|
const showMore = visible || isHovered;
|
|
@@ -25389,14 +25465,24 @@ function CellAlert({ popup, DropdownMenuComponent = _univerjs_design.DropdownMen
|
|
|
25389
25465
|
[1]: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.WarningIcon, { className: "univer-text-yellow-500" })
|
|
25390
25466
|
};
|
|
25391
25467
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
25392
|
-
|
|
25393
|
-
|
|
25394
|
-
|
|
25395
|
-
|
|
25396
|
-
|
|
25397
|
-
|
|
25398
|
-
|
|
25399
|
-
|
|
25468
|
+
style: { width },
|
|
25469
|
+
className: "univer-z-[100] univer-box-border univer-rounded-lg univer-bg-gray-0 univer-px-2 univer-py-1 univer-text-gray-900 univer-shadow dark:!univer-bg-gray-1000 dark:!univer-text-gray-0",
|
|
25470
|
+
children: [
|
|
25471
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
25472
|
+
className: "univer-mb-1.5 univer-flex univer-h-5 univer-flex-row univer-items-center univer-gap-x-1.5 univer-text-sm univer-font-medium",
|
|
25473
|
+
children: [type ? iconMap[type] : null, title]
|
|
25474
|
+
}),
|
|
25475
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
25476
|
+
className: "univer-text-sm",
|
|
25477
|
+
children: message
|
|
25478
|
+
}),
|
|
25479
|
+
action && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Button, {
|
|
25480
|
+
className: "univer-mt-2",
|
|
25481
|
+
disabled: action.disabled,
|
|
25482
|
+
onClick: action.onSelect,
|
|
25483
|
+
children: action.label
|
|
25484
|
+
})
|
|
25485
|
+
]
|
|
25400
25486
|
});
|
|
25401
25487
|
}
|
|
25402
25488
|
|
|
@@ -25424,15 +25510,17 @@ let CellAlertManagerService = class CellAlertManagerService extends _univerjs_co
|
|
|
25424
25510
|
_defineProperty(this, "_currentAlert", /* @__PURE__ */ new Map());
|
|
25425
25511
|
_defineProperty(this, "currentAlert$", this._currentAlert$.asObservable());
|
|
25426
25512
|
this.disposeWithMe(() => {
|
|
25513
|
+
this.clearAlert();
|
|
25427
25514
|
this._currentAlert$.complete();
|
|
25428
25515
|
});
|
|
25429
25516
|
}
|
|
25430
25517
|
showAlert(alert) {
|
|
25431
25518
|
var _alert$menu, _alert$menu2, _alert$menu3;
|
|
25432
25519
|
let lastPopup = this._currentAlert.get(alert.key);
|
|
25433
|
-
if (lastPopup)
|
|
25434
|
-
|
|
25435
|
-
|
|
25520
|
+
if (lastPopup) {
|
|
25521
|
+
lastPopup.dispose.dispose();
|
|
25522
|
+
lastPopup.alert = alert;
|
|
25523
|
+
} else {
|
|
25436
25524
|
lastPopup = {
|
|
25437
25525
|
alert,
|
|
25438
25526
|
dispose: { dispose() {} }
|
|
@@ -25455,13 +25543,7 @@ let CellAlertManagerService = class CellAlertManagerService extends _univerjs_co
|
|
|
25455
25543
|
extraProps: { alert },
|
|
25456
25544
|
priority: 1
|
|
25457
25545
|
});
|
|
25458
|
-
if (disposable)
|
|
25459
|
-
if (lastPopup) {
|
|
25460
|
-
var _lastPopup$dispose;
|
|
25461
|
-
(_lastPopup$dispose = lastPopup.dispose) === null || _lastPopup$dispose === void 0 || _lastPopup$dispose.dispose();
|
|
25462
|
-
}
|
|
25463
|
-
lastPopup.dispose = disposable;
|
|
25464
|
-
}
|
|
25546
|
+
if (disposable) lastPopup.dispose = disposable;
|
|
25465
25547
|
this._currentAlert$.next(Array.from(this._currentAlert.entries()));
|
|
25466
25548
|
}
|
|
25467
25549
|
removeAlert(key) {
|
|
@@ -26313,8 +26395,8 @@ function SelectList(props) {
|
|
|
26313
26395
|
const filteredOptions = (0, react.useMemo)(() => {
|
|
26314
26396
|
return options.filter((item) => lowerFilter ? item.label.toLowerCase().includes(lowerFilter) : true);
|
|
26315
26397
|
}, [options, lowerFilter]);
|
|
26316
|
-
const handleSearchChange = (
|
|
26317
|
-
setLowerFilter(
|
|
26398
|
+
const handleSearchChange = (value) => {
|
|
26399
|
+
setLowerFilter(value.toLowerCase());
|
|
26318
26400
|
};
|
|
26319
26401
|
const sheetPermissionCheckController = (0, _univerjs_ui.useDependency)(_univerjs_sheets.SheetPermissionCheckController);
|
|
26320
26402
|
const hasPermission = (0, react.useMemo)(() => sheetPermissionCheckController.permissionCheckWithRanges({
|
|
@@ -26340,9 +26422,8 @@ function SelectList(props) {
|
|
|
26340
26422
|
children: [
|
|
26341
26423
|
showSearchOnDropdown && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
26342
26424
|
className: "univer-box-border univer-flex univer-w-full univer-px-2",
|
|
26343
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
26425
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Input, {
|
|
26344
26426
|
ref: searchRef,
|
|
26345
|
-
className: (0, _univerjs_design.clsx)("univer-w-full univer-rounded-md univer-bg-gray-0 univer-px-2 univer-py-1 univer-text-sm univer-text-gray-900 focus:univer-border-primary-500 focus:univer-outline-none dark:!univer-bg-gray-1000 dark:!univer-text-gray-0", _univerjs_design.borderClassName),
|
|
26346
26427
|
type: "text",
|
|
26347
26428
|
value: lowerFilter,
|
|
26348
26429
|
autoFocus: true,
|
|
@@ -26371,14 +26452,16 @@ function SelectList(props) {
|
|
|
26371
26452
|
const index = item.label.toLocaleLowerCase().indexOf(lowerFilter);
|
|
26372
26453
|
const isThemeColor = Boolean(((_item$color = item.color) === null || _item$color === void 0 ? void 0 : _item$color.includes(".")) && themeService.isValidThemeColor(item.color));
|
|
26373
26454
|
const backgroundColor = isThemeColor ? themeService.getColorFromTheme(item.color) : item.color;
|
|
26374
|
-
const
|
|
26455
|
+
const color = new _univerjs_core.ColorKit(backgroundColor);
|
|
26456
|
+
const hasBackground = Boolean(backgroundColor) && backgroundColor !== "transparent" && color.getAlpha() > 0;
|
|
26457
|
+
const isDark = color.isDark();
|
|
26375
26458
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
26376
26459
|
className: "univer-flex univer-cursor-pointer univer-flex-row univer-items-center univer-justify-between univer-rounded-md univer-px-1.5 univer-py-1 hover:univer-bg-gray-50 dark:hover:!univer-bg-gray-700",
|
|
26377
26460
|
onClick: handleClick,
|
|
26378
26461
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
26379
26462
|
className: (0, _univerjs_design.clsx)("univer-inline-flex univer-h-4 univer-w-fit univer-items-center univer-truncate univer-rounded-full univer-px-1.5 univer-text-xs", {
|
|
26380
|
-
"univer-text-gray-900": isThemeColor || !isDark,
|
|
26381
|
-
"univer-text-gray-0": !isThemeColor && isDark
|
|
26463
|
+
"univer-text-gray-900": hasBackground && (isThemeColor || !isDark),
|
|
26464
|
+
"univer-text-gray-0": hasBackground && !isThemeColor && isDark
|
|
26382
26465
|
}),
|
|
26383
26466
|
style: { background: backgroundColor },
|
|
26384
26467
|
children: lowerFilter && item.label.toLowerCase().includes(lowerFilter) ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
@@ -27043,6 +27126,7 @@ function BorderLine(props) {
|
|
|
27043
27126
|
//#endregion
|
|
27044
27127
|
//#region src/views/border-panel/BorderPanel.tsx
|
|
27045
27128
|
function BorderPanel(props) {
|
|
27129
|
+
const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
|
|
27046
27130
|
const iconManager = (0, _univerjs_ui.useDependency)(_univerjs_ui.IconManager);
|
|
27047
27131
|
const selectionManagerService = (0, _univerjs_ui.useDependency)(_univerjs_sheets.SheetsSelectionsService);
|
|
27048
27132
|
const { direction } = (0, react.useContext)(_univerjs_design.ConfigContext);
|
|
@@ -27108,7 +27192,7 @@ function BorderPanel(props) {
|
|
|
27108
27192
|
className: "univer-m-0 univer-grid univer-list-none univer-gap-1 univer-p-0",
|
|
27109
27193
|
children: BORDER_SIZE_CHILDREN.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
27110
27194
|
type: "button",
|
|
27111
|
-
"aria-label":
|
|
27195
|
+
"aria-label": localeService.t(item.label),
|
|
27112
27196
|
"aria-pressed": item.value === value.style,
|
|
27113
27197
|
className: (0, _univerjs_design.clsx)("univer-flex univer-w-full univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-border-none univer-bg-transparent univer-px-1 univer-py-3 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700", { "univer-bg-gray-200 dark:!univer-bg-gray-600": item.value === value.style }),
|
|
27114
27198
|
onClick: () => handleClick(item.value, "style"),
|
|
@@ -27525,7 +27609,7 @@ const DefinedNameContainer = ({ ConfirmComponent = _univerjs_design.Confirm, Def
|
|
|
27525
27609
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
27526
27610
|
className: "univer-my-1 univer-max-h-[100px] univer-max-w-[190px] univer-truncate univer-text-sm univer-font-medium univer-text-gray-900 dark:!univer-text-gray-0",
|
|
27527
27611
|
children: [definedName.name, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
27528
|
-
className: "univer-
|
|
27612
|
+
className: "univer-ml-1 univer-text-xs univer-text-gray-400",
|
|
27529
27613
|
children: definedName.localSheetId === _univerjs_sheets.SCOPE_WORKBOOK_VALUE_DEFINED_NAME || definedName.localSheetId == null ? "" : getSheetNameBySheetId(definedName.localSheetId)
|
|
27530
27614
|
})]
|
|
27531
27615
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -27656,16 +27740,35 @@ function MobileMenuItemInput(props) {
|
|
|
27656
27740
|
const { prefix, suffix, value, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER, disabled$, onChange } = props;
|
|
27657
27741
|
const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
|
|
27658
27742
|
const disabled = (0, _univerjs_ui.useObservable)(disabled$ ?? null, false);
|
|
27659
|
-
const
|
|
27743
|
+
const [draft, setDraft] = (0, react.useState)(null);
|
|
27744
|
+
const inputValue = draft !== null && draft.source === value ? draft.value : Math.min(max, Math.max(min, Number(value)));
|
|
27745
|
+
if (draft !== null && draft.source !== value) setDraft(null);
|
|
27660
27746
|
function handleChange(nextValue) {
|
|
27661
|
-
|
|
27747
|
+
setDraft({
|
|
27748
|
+
source: value,
|
|
27749
|
+
value: nextValue
|
|
27750
|
+
});
|
|
27751
|
+
}
|
|
27752
|
+
function handleConfirm() {
|
|
27753
|
+
if (disabled || inputValue == null || !Number.isFinite(inputValue)) return;
|
|
27754
|
+
const nextValue = Math.min(max, Math.max(min, inputValue));
|
|
27755
|
+
setDraft({
|
|
27756
|
+
source: value,
|
|
27757
|
+
value: nextValue
|
|
27758
|
+
});
|
|
27662
27759
|
onChange(nextValue.toString());
|
|
27663
27760
|
}
|
|
27664
27761
|
function handleKeyDown(event) {
|
|
27762
|
+
if (event.key === "Escape" && !event.nativeEvent.isComposing) return;
|
|
27665
27763
|
event.stopPropagation();
|
|
27764
|
+
if (event.key === "Enter" && !event.nativeEvent.isComposing) {
|
|
27765
|
+
event.preventDefault();
|
|
27766
|
+
handleConfirm();
|
|
27767
|
+
}
|
|
27666
27768
|
}
|
|
27667
27769
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
27668
|
-
className: "univer-flex univer-min-w-0 univer-flex-1 univer-items-center univer-gap-2",
|
|
27770
|
+
className: "univer-flex univer-min-w-0 univer-flex-1 univer-flex-wrap univer-items-center univer-gap-2",
|
|
27771
|
+
onClick: (event) => event.stopPropagation(),
|
|
27669
27772
|
children: [
|
|
27670
27773
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
27671
27774
|
className: "univer-shrink-0 univer-text-base univer-font-medium",
|
|
@@ -27673,13 +27776,11 @@ function MobileMenuItemInput(props) {
|
|
|
27673
27776
|
}),
|
|
27674
27777
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
27675
27778
|
className: "univer-w-20 univer-shrink-0",
|
|
27676
|
-
onClick: (event) => event.stopPropagation(),
|
|
27677
27779
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.InputNumber, {
|
|
27678
27780
|
value: inputValue,
|
|
27679
27781
|
size: "small",
|
|
27680
27782
|
precision: 0,
|
|
27681
|
-
|
|
27682
|
-
max,
|
|
27783
|
+
allowEmpty: true,
|
|
27683
27784
|
disabled,
|
|
27684
27785
|
onKeyDown: handleKeyDown,
|
|
27685
27786
|
onChange: handleChange
|
|
@@ -27688,6 +27789,15 @@ function MobileMenuItemInput(props) {
|
|
|
27688
27789
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
27689
27790
|
className: "univer-min-w-0 univer-truncate univer-text-base univer-font-medium",
|
|
27690
27791
|
children: localeService.t(suffix)
|
|
27792
|
+
}),
|
|
27793
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Button, {
|
|
27794
|
+
type: "button",
|
|
27795
|
+
variant: "primary",
|
|
27796
|
+
size: "large",
|
|
27797
|
+
className: "univer-shrink-0",
|
|
27798
|
+
disabled: disabled || inputValue == null || !Number.isFinite(inputValue),
|
|
27799
|
+
onClick: handleConfirm,
|
|
27800
|
+
children: localeService.t("sheets-ui.button.confirm")
|
|
27691
27801
|
})
|
|
27692
27802
|
]
|
|
27693
27803
|
});
|
|
@@ -28711,7 +28821,7 @@ function SheetPermissionPanelListContent({ ActionRowComponent }) {
|
|
|
28711
28821
|
rule.description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Tooltip, {
|
|
28712
28822
|
title: rule.description,
|
|
28713
28823
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
28714
|
-
className: "univer-
|
|
28824
|
+
className: "univer-mt-2 univer-max-w-64 univer-truncate univer-text-sm univer-text-gray-400",
|
|
28715
28825
|
children: rule.description
|
|
28716
28826
|
})
|
|
28717
28827
|
})
|
|
@@ -28982,6 +29092,7 @@ const sheetsUIIcons = {
|
|
|
28982
29092
|
DeleteColumnDoubleIcon: _univerjs_icons.DeleteColumnDoubleIcon,
|
|
28983
29093
|
DeleteIcon: _univerjs_icons.DeleteIcon,
|
|
28984
29094
|
DeleteRowDoubleIcon: _univerjs_icons.DeleteRowDoubleIcon,
|
|
29095
|
+
DocPasteOptionsIcon: _univerjs_icons.DocPasteOptionsIcon,
|
|
28985
29096
|
DownBorderDoubleIcon: _univerjs_icons.DownBorderDoubleIcon,
|
|
28986
29097
|
DownloadImageIcon: _univerjs_icons.DownloadImageIcon,
|
|
28987
29098
|
EyeIcon: _univerjs_icons.EyeIcon,
|
|
@@ -29039,7 +29150,8 @@ const sheetsUIIcons = {
|
|
|
29039
29150
|
VerticalCenterIcon: _univerjs_icons.VerticalCenterIcon,
|
|
29040
29151
|
VerticalIntegrationIcon: _univerjs_icons.VerticalIntegrationIcon,
|
|
29041
29152
|
VerticalTextIcon: _univerjs_icons.VerticalTextIcon,
|
|
29042
|
-
WriteIcon: _univerjs_icons.WriteIcon
|
|
29153
|
+
WriteIcon: _univerjs_icons.WriteIcon,
|
|
29154
|
+
ZoomInIcon: _univerjs_icons.ZoomInIcon
|
|
29043
29155
|
};
|
|
29044
29156
|
|
|
29045
29157
|
//#endregion
|
|
@@ -29055,7 +29167,6 @@ let MobileComponentsController = class MobileComponentsController extends _unive
|
|
|
29055
29167
|
this.disposeWithMe(componentManager.register(CascaderDropdown.componentKey, CascaderDropdown));
|
|
29056
29168
|
this.disposeWithMe(componentManager.register(MENU_ITEM_INPUT_COMPONENT, MobileMenuItemInput));
|
|
29057
29169
|
this.disposeWithMe(componentManager.register(MENU_ITEM_FROZEN_COMPONENT, MenuItemFrozen));
|
|
29058
|
-
this.disposeWithMe(componentManager.register(SHEET_ZOOM_INPUT_COMPONENT, SheetZoomInput));
|
|
29059
29170
|
this.disposeWithMe(componentManager.register(BORDER_PANEL_COMPONENT, MobileBorderPanel));
|
|
29060
29171
|
this.disposeWithMe(componentManager.register(DEFINED_NAME_CONTAINER, MobileDefinedNameContainer));
|
|
29061
29172
|
this.disposeWithMe(componentManager.register(CELL_POPUP_COMPONENT_KEY, CellPopup));
|
|
@@ -30719,6 +30830,7 @@ function MobileBorderColorView(props) {
|
|
|
30719
30830
|
}
|
|
30720
30831
|
function MobileBorderStyleView(props) {
|
|
30721
30832
|
const { value, onExecute } = props;
|
|
30833
|
+
const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
|
|
30722
30834
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
30723
30835
|
className: "univer-overflow-hidden univer-rounded-xl univer-bg-gray-0 dark:!univer-bg-gray-800",
|
|
30724
30836
|
children: BORDER_SIZE_CHILDREN.map((option, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
@@ -30738,7 +30850,7 @@ function MobileBorderStyleView(props) {
|
|
|
30738
30850
|
}),
|
|
30739
30851
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
30740
30852
|
className: "univer-flex-1 univer-text-left univer-text-sm",
|
|
30741
|
-
children: option.
|
|
30853
|
+
children: localeService.t(option.label)
|
|
30742
30854
|
}),
|
|
30743
30855
|
value.style === option.value && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.CheckMarkIcon, { className: "univer-text-primary-600 dark:!univer-text-primary-400" })
|
|
30744
30856
|
]
|
|
@@ -31283,7 +31395,11 @@ function MobileFormulaBar() {
|
|
|
31283
31395
|
let cursorFrame;
|
|
31284
31396
|
const contentFrame = requestAnimationFrame(() => {
|
|
31285
31397
|
editorBridgeService.refreshEditCellState();
|
|
31286
|
-
editorService.focus(_univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY);
|
|
31398
|
+
if (editorService.getFocusId() !== _univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY) editorService.focus(_univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY);
|
|
31399
|
+
else {
|
|
31400
|
+
var _editorService$getEdi;
|
|
31401
|
+
(_editorService$getEdi = editorService.getEditor(_univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY)) === null || _editorService$getEdi === void 0 || _editorService$getEdi.focus();
|
|
31402
|
+
}
|
|
31287
31403
|
cursorFrame = requestAnimationFrame(() => {
|
|
31288
31404
|
var _editor$getDocumentDa;
|
|
31289
31405
|
const editor = editorService.getEditor(_univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY);
|
|
@@ -31845,7 +31961,7 @@ const MobileFormulaBarSubmitCommand = {
|
|
|
31845
31961
|
id: MOBILE_FORMULA_BAR_SUBMIT_COMMAND_ID,
|
|
31846
31962
|
type: _univerjs_core.CommandType.COMMAND,
|
|
31847
31963
|
async handler(accessor) {
|
|
31848
|
-
var _accessor$get$getCurr, _workbook$getActiveSh, _formulaModel$getBody
|
|
31964
|
+
var _accessor$get$getCurr, _workbook$getActiveSh, _formulaModel$getBody;
|
|
31849
31965
|
const instanceService = accessor.get(_univerjs_core.IUniverInstanceService);
|
|
31850
31966
|
const workbook = instanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
|
|
31851
31967
|
const formulaModel = instanceService.getUnit(_univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, _univerjs_core.UniverInstanceType.UNIVER_DOC);
|
|
@@ -31877,8 +31993,12 @@ const MobileFormulaBarSubmitCommand = {
|
|
|
31877
31993
|
});
|
|
31878
31994
|
editorBridgeService.refreshEditCellState();
|
|
31879
31995
|
editorBridgeService.changeEditorDirty(false);
|
|
31996
|
+
const editorService = accessor.get(_univerjs_docs_ui.IEditorService);
|
|
31997
|
+
const formulaEditor = editorService.getEditor(_univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY);
|
|
31998
|
+
if (editorService.getFocusId() !== _univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY) editorService.focus(_univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY);
|
|
31999
|
+
else formulaEditor === null || formulaEditor === void 0 || formulaEditor.focus();
|
|
31880
32000
|
const endOffset = Math.max(0, (((_formulaModel$getBody = formulaModel.getBody()) === null || _formulaModel$getBody === void 0 ? void 0 : _formulaModel$getBody.dataStream.length) ?? 2) - 2);
|
|
31881
|
-
|
|
32001
|
+
formulaEditor === null || formulaEditor === void 0 || formulaEditor.setSelectionRanges([{
|
|
31882
32002
|
startOffset: endOffset,
|
|
31883
32003
|
endOffset
|
|
31884
32004
|
}], false);
|
|
@@ -31961,6 +32081,7 @@ let SheetUIMobileController = class SheetUIMobileController extends _univerjs_co
|
|
|
31961
32081
|
ScrollToRangeOperation,
|
|
31962
32082
|
_univerjs_sheets.SetUnderlineCommand,
|
|
31963
32083
|
SetZoomRatioCommand,
|
|
32084
|
+
SetZoomRatioFromToolbarCommand,
|
|
31964
32085
|
SetZoomRatioOperation,
|
|
31965
32086
|
ShowMenuListCommand,
|
|
31966
32087
|
InsertRangeMoveDownConfirmCommand,
|
|
@@ -32971,11 +33092,7 @@ let MobileCellEditRenderController = class MobileCellEditRenderController extend
|
|
|
32971
33092
|
this._commandService.syncExecuteCommand(SetCellEditVisibleOperation.id, {
|
|
32972
33093
|
visible: true,
|
|
32973
33094
|
eventType: _univerjs_engine_render.DeviceInputEventType.Dblclick,
|
|
32974
|
-
unitId: this._context.unitId
|
|
32975
|
-
pointerPosition: {
|
|
32976
|
-
x: cell.event.clientX,
|
|
32977
|
-
y: cell.event.clientY
|
|
32978
|
-
}
|
|
33095
|
+
unitId: this._context.unitId
|
|
32979
33096
|
});
|
|
32980
33097
|
}));
|
|
32981
33098
|
this.disposeWithMe(hoverManagerService.currentPointerDownCell$.subscribe((cell) => {
|
|
@@ -35466,7 +35583,6 @@ let ComponentsController = class ComponentsController extends _univerjs_core.Dis
|
|
|
35466
35583
|
const componentManager = this._componentManager;
|
|
35467
35584
|
this.disposeWithMe(componentManager.register(MENU_ITEM_INPUT_COMPONENT, MenuItemInput));
|
|
35468
35585
|
this.disposeWithMe(componentManager.register(MENU_ITEM_FROZEN_COMPONENT, MenuItemFrozen));
|
|
35469
|
-
this.disposeWithMe(componentManager.register(SHEET_ZOOM_INPUT_COMPONENT, SheetZoomInput));
|
|
35470
35586
|
this.disposeWithMe(componentManager.register(BORDER_PANEL_COMPONENT, BorderPanel));
|
|
35471
35587
|
this.disposeWithMe(componentManager.register(DEFINED_NAME_CONTAINER, DefinedNameContainer));
|
|
35472
35588
|
this.disposeWithMe(componentManager.register(CELL_POPUP_COMPONENT_KEY, CellPopup));
|
|
@@ -35695,6 +35811,12 @@ let DesktopCellEditRenderController = class DesktopCellEditRenderController exte
|
|
|
35695
35811
|
var _params;
|
|
35696
35812
|
if (params === null || params === void 0 || (_params = params[params.length - 1]) === null || _params === void 0 ? void 0 : _params.primary) this._updateInputPosition();
|
|
35697
35813
|
}));
|
|
35814
|
+
const viewportMain = this._context.scene.getViewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_MAIN);
|
|
35815
|
+
if (viewportMain) d.add(viewportMain.onScrollEnd$.subscribeEvent(() => {
|
|
35816
|
+
if (this._editorBridgeService.isVisible().visible) return;
|
|
35817
|
+
this._editorBridgeService.refreshEditCellPosition(false);
|
|
35818
|
+
this._updateInputPosition();
|
|
35819
|
+
}));
|
|
35698
35820
|
}
|
|
35699
35821
|
_updateInputPosition() {
|
|
35700
35822
|
var _this$_renderManagerS;
|
|
@@ -35702,8 +35824,8 @@ let DesktopCellEditRenderController = class DesktopCellEditRenderController exte
|
|
|
35702
35824
|
const layout = this._editorBridgeService.getEditCellLayout();
|
|
35703
35825
|
const docSelectionRenderService = (_this$_renderManagerS = this._renderManagerService.getRenderUnitById(_univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY)) === null || _this$_renderManagerS === void 0 ? void 0 : _this$_renderManagerS.with(_univerjs_docs_ui.DocSelectionRenderService);
|
|
35704
35826
|
if (!layout || !docSelectionRenderService) return;
|
|
35705
|
-
const {
|
|
35706
|
-
docSelectionRenderService.setInputPosition(
|
|
35827
|
+
const { x, y } = getEditCellInputPosition(layout, this._context.engine);
|
|
35828
|
+
docSelectionRenderService.setInputPosition(x, y);
|
|
35707
35829
|
}
|
|
35708
35830
|
_focusCellEditorInput() {
|
|
35709
35831
|
const focusedChildUnitId = (0, _univerjs_ui.getEmbedChildUnitId)(typeof document === "undefined" ? null : document.activeElement);
|
|
@@ -36370,19 +36492,19 @@ exports.AddRangeProtectionFromSheetBarCommand = AddRangeProtectionFromSheetBarCo
|
|
|
36370
36492
|
exports.AddRangeProtectionFromToolbarCommand = AddRangeProtectionFromToolbarCommand;
|
|
36371
36493
|
exports.ApplyFormatPainterCommand = ApplyFormatPainterCommand;
|
|
36372
36494
|
exports.AutoFillPopupMenu = AutoFillPopupMenu;
|
|
36373
|
-
Object.defineProperty(exports,
|
|
36495
|
+
Object.defineProperty(exports, "AutoFillUIController", {
|
|
36374
36496
|
enumerable: true,
|
|
36375
36497
|
get: function () {
|
|
36376
36498
|
return AutoFillUIController;
|
|
36377
36499
|
}
|
|
36378
36500
|
});
|
|
36379
|
-
Object.defineProperty(exports,
|
|
36501
|
+
Object.defineProperty(exports, "AutoHeightController", {
|
|
36380
36502
|
enumerable: true,
|
|
36381
36503
|
get: function () {
|
|
36382
36504
|
return AutoHeightController;
|
|
36383
36505
|
}
|
|
36384
36506
|
});
|
|
36385
|
-
Object.defineProperty(exports,
|
|
36507
|
+
Object.defineProperty(exports, "AutoWidthController", {
|
|
36386
36508
|
enumerable: true,
|
|
36387
36509
|
get: function () {
|
|
36388
36510
|
return AutoWidthController;
|
|
@@ -36394,21 +36516,21 @@ exports.BaseSelectionRenderService = BaseSelectionRenderService;
|
|
|
36394
36516
|
exports.BorderLine = BorderLine;
|
|
36395
36517
|
exports.COPY_SPECIAL_MENU_ID = COPY_SPECIAL_MENU_ID;
|
|
36396
36518
|
exports.COPY_TYPE = COPY_TYPE;
|
|
36397
|
-
Object.defineProperty(exports,
|
|
36519
|
+
Object.defineProperty(exports, "CellAlertManagerService", {
|
|
36398
36520
|
enumerable: true,
|
|
36399
36521
|
get: function () {
|
|
36400
36522
|
return CellAlertManagerService;
|
|
36401
36523
|
}
|
|
36402
36524
|
});
|
|
36403
36525
|
exports.CellAlertType = CellAlertType;
|
|
36404
|
-
Object.defineProperty(exports,
|
|
36526
|
+
Object.defineProperty(exports, "CellCustomRenderController", {
|
|
36405
36527
|
enumerable: true,
|
|
36406
36528
|
get: function () {
|
|
36407
36529
|
return CellCustomRenderController;
|
|
36408
36530
|
}
|
|
36409
36531
|
});
|
|
36410
36532
|
exports.CellEditorManagerService = CellEditorManagerService;
|
|
36411
|
-
Object.defineProperty(exports,
|
|
36533
|
+
Object.defineProperty(exports, "CellPopupManagerService", {
|
|
36412
36534
|
enumerable: true,
|
|
36413
36535
|
get: function () {
|
|
36414
36536
|
return CellPopupManagerService;
|
|
@@ -36421,13 +36543,13 @@ exports.DeleteRangeMoveLeftConfirmCommand = DeleteRangeMoveLeftConfirmCommand;
|
|
|
36421
36543
|
exports.DeleteRangeMoveUpConfirmCommand = DeleteRangeMoveUpConfirmCommand;
|
|
36422
36544
|
exports.DeleteRangeProtectionFromContextMenuCommand = DeleteRangeProtectionFromContextMenuCommand;
|
|
36423
36545
|
exports.DeleteWorksheetProtectionFormSheetBarCommand = DeleteWorksheetProtectionFormSheetBarCommand;
|
|
36424
|
-
Object.defineProperty(exports,
|
|
36546
|
+
Object.defineProperty(exports, "DragManagerService", {
|
|
36425
36547
|
enumerable: true,
|
|
36426
36548
|
get: function () {
|
|
36427
36549
|
return DragManagerService;
|
|
36428
36550
|
}
|
|
36429
36551
|
});
|
|
36430
|
-
Object.defineProperty(exports,
|
|
36552
|
+
Object.defineProperty(exports, "DragRenderController", {
|
|
36431
36553
|
enumerable: true,
|
|
36432
36554
|
get: function () {
|
|
36433
36555
|
return DragRenderController;
|
|
@@ -36435,13 +36557,13 @@ Object.defineProperty(exports, 'DragRenderController', {
|
|
|
36435
36557
|
});
|
|
36436
36558
|
exports.EMBEDDING_FORMULA_EDITOR = EMBEDDING_FORMULA_EDITOR;
|
|
36437
36559
|
exports.EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY = EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY;
|
|
36438
|
-
Object.defineProperty(exports,
|
|
36560
|
+
Object.defineProperty(exports, "EditingRenderController", {
|
|
36439
36561
|
enumerable: true,
|
|
36440
36562
|
get: function () {
|
|
36441
36563
|
return EditingRenderController;
|
|
36442
36564
|
}
|
|
36443
36565
|
});
|
|
36444
|
-
Object.defineProperty(exports,
|
|
36566
|
+
Object.defineProperty(exports, "EditorBridgeService", {
|
|
36445
36567
|
enumerable: true,
|
|
36446
36568
|
get: function () {
|
|
36447
36569
|
return EditorBridgeService;
|
|
@@ -36452,26 +36574,26 @@ exports.ExpandSelectionCommand = ExpandSelectionCommand;
|
|
|
36452
36574
|
exports.FORMULA_CLIPBOARD_MIME_TYPE = FORMULA_CLIPBOARD_MIME_TYPE;
|
|
36453
36575
|
exports.FormatPainterStatus = FormatPainterStatus;
|
|
36454
36576
|
exports.FormulaBar = FormulaBar;
|
|
36455
|
-
Object.defineProperty(exports,
|
|
36577
|
+
Object.defineProperty(exports, "FormulaEditorController", {
|
|
36456
36578
|
enumerable: true,
|
|
36457
36579
|
get: function () {
|
|
36458
36580
|
return FormulaEditorController;
|
|
36459
36581
|
}
|
|
36460
36582
|
});
|
|
36461
36583
|
exports.HEADER_UNHIDE_RANGE_VISIBLE_CHECK = HEADER_UNHIDE_RANGE_VISIBLE_CHECK;
|
|
36462
|
-
Object.defineProperty(exports,
|
|
36584
|
+
Object.defineProperty(exports, "HeaderFreezeRenderController", {
|
|
36463
36585
|
enumerable: true,
|
|
36464
36586
|
get: function () {
|
|
36465
36587
|
return HeaderFreezeRenderController;
|
|
36466
36588
|
}
|
|
36467
36589
|
});
|
|
36468
|
-
Object.defineProperty(exports,
|
|
36590
|
+
Object.defineProperty(exports, "HeaderMoveRenderController", {
|
|
36469
36591
|
enumerable: true,
|
|
36470
36592
|
get: function () {
|
|
36471
36593
|
return HeaderMoveRenderController;
|
|
36472
36594
|
}
|
|
36473
36595
|
});
|
|
36474
|
-
Object.defineProperty(exports,
|
|
36596
|
+
Object.defineProperty(exports, "HeaderResizeRenderController", {
|
|
36475
36597
|
enumerable: true,
|
|
36476
36598
|
get: function () {
|
|
36477
36599
|
return HeaderResizeRenderController;
|
|
@@ -36479,7 +36601,7 @@ Object.defineProperty(exports, 'HeaderResizeRenderController', {
|
|
|
36479
36601
|
});
|
|
36480
36602
|
exports.HeaderUnhideRangeAxis = HeaderUnhideRangeAxis;
|
|
36481
36603
|
exports.HeaderUnhideRangeService = HeaderUnhideRangeService;
|
|
36482
|
-
Object.defineProperty(exports,
|
|
36604
|
+
Object.defineProperty(exports, "HeaderUnhideRenderController", {
|
|
36483
36605
|
enumerable: true,
|
|
36484
36606
|
get: function () {
|
|
36485
36607
|
return HeaderUnhideRenderController;
|
|
@@ -36487,13 +36609,13 @@ Object.defineProperty(exports, 'HeaderUnhideRenderController', {
|
|
|
36487
36609
|
});
|
|
36488
36610
|
exports.HideColConfirmCommand = HideColConfirmCommand;
|
|
36489
36611
|
exports.HideRowConfirmCommand = HideRowConfirmCommand;
|
|
36490
|
-
Object.defineProperty(exports,
|
|
36612
|
+
Object.defineProperty(exports, "HoverManagerService", {
|
|
36491
36613
|
enumerable: true,
|
|
36492
36614
|
get: function () {
|
|
36493
36615
|
return HoverManagerService;
|
|
36494
36616
|
}
|
|
36495
36617
|
});
|
|
36496
|
-
Object.defineProperty(exports,
|
|
36618
|
+
Object.defineProperty(exports, "HoverRenderController", {
|
|
36497
36619
|
enumerable: true,
|
|
36498
36620
|
get: function () {
|
|
36499
36621
|
return HoverRenderController;
|
|
@@ -36522,7 +36644,7 @@ exports.MOBILE_CONTEXT_MENU = MOBILE_CONTEXT_MENU;
|
|
|
36522
36644
|
exports.MOBILE_EXPANDING_SELECTION = MOBILE_EXPANDING_SELECTION;
|
|
36523
36645
|
exports.MOBILE_FORMULA_FUNCTION_PANEL_OPEN = MOBILE_FORMULA_FUNCTION_PANEL_OPEN;
|
|
36524
36646
|
exports.MOBILE_PINCH_ZOOMING = MOBILE_PINCH_ZOOMING;
|
|
36525
|
-
Object.defineProperty(exports,
|
|
36647
|
+
Object.defineProperty(exports, "MarkSelectionService", {
|
|
36526
36648
|
enumerable: true,
|
|
36527
36649
|
get: function () {
|
|
36528
36650
|
return MarkSelectionService;
|
|
@@ -36596,37 +36718,37 @@ exports.SetZoomRatioCommand = SetZoomRatioCommand;
|
|
|
36596
36718
|
exports.SetZoomRatioOperation = SetZoomRatioOperation;
|
|
36597
36719
|
exports.SheetBar = SheetBar;
|
|
36598
36720
|
exports.SheetBarService = SheetBarService;
|
|
36599
|
-
Object.defineProperty(exports,
|
|
36721
|
+
Object.defineProperty(exports, "SheetCanvasPopManagerService", {
|
|
36600
36722
|
enumerable: true,
|
|
36601
36723
|
get: function () {
|
|
36602
36724
|
return SheetCanvasPopManagerService;
|
|
36603
36725
|
}
|
|
36604
36726
|
});
|
|
36605
|
-
Object.defineProperty(exports,
|
|
36727
|
+
Object.defineProperty(exports, "SheetCellDropdownManagerService", {
|
|
36606
36728
|
enumerable: true,
|
|
36607
36729
|
get: function () {
|
|
36608
36730
|
return SheetCellDropdownManagerService;
|
|
36609
36731
|
}
|
|
36610
36732
|
});
|
|
36611
|
-
Object.defineProperty(exports,
|
|
36733
|
+
Object.defineProperty(exports, "SheetCellEditorResizeService", {
|
|
36612
36734
|
enumerable: true,
|
|
36613
36735
|
get: function () {
|
|
36614
36736
|
return SheetCellEditorResizeService;
|
|
36615
36737
|
}
|
|
36616
36738
|
});
|
|
36617
|
-
Object.defineProperty(exports,
|
|
36739
|
+
Object.defineProperty(exports, "SheetClipboardController", {
|
|
36618
36740
|
enumerable: true,
|
|
36619
36741
|
get: function () {
|
|
36620
36742
|
return SheetClipboardController;
|
|
36621
36743
|
}
|
|
36622
36744
|
});
|
|
36623
|
-
Object.defineProperty(exports,
|
|
36745
|
+
Object.defineProperty(exports, "SheetClipboardService", {
|
|
36624
36746
|
enumerable: true,
|
|
36625
36747
|
get: function () {
|
|
36626
36748
|
return SheetClipboardService;
|
|
36627
36749
|
}
|
|
36628
36750
|
});
|
|
36629
|
-
Object.defineProperty(exports,
|
|
36751
|
+
Object.defineProperty(exports, "SheetContextMenuMobileRenderController", {
|
|
36630
36752
|
enumerable: true,
|
|
36631
36753
|
get: function () {
|
|
36632
36754
|
return SheetContextMenuMobileRenderController;
|
|
@@ -36641,7 +36763,7 @@ exports.SheetPasteCommand = SheetPasteCommand;
|
|
|
36641
36763
|
exports.SheetPasteFormatCommand = SheetPasteFormatCommand;
|
|
36642
36764
|
exports.SheetPasteShortKeyCommand = SheetPasteShortKeyCommand;
|
|
36643
36765
|
exports.SheetPasteValueCommand = SheetPasteValueCommand;
|
|
36644
|
-
Object.defineProperty(exports,
|
|
36766
|
+
Object.defineProperty(exports, "SheetPermissionCheckUIController", {
|
|
36645
36767
|
enumerable: true,
|
|
36646
36768
|
get: function () {
|
|
36647
36769
|
return SheetPermissionCheckUIController;
|
|
@@ -36649,7 +36771,7 @@ Object.defineProperty(exports, 'SheetPermissionCheckUIController', {
|
|
|
36649
36771
|
});
|
|
36650
36772
|
exports.SheetPermissionOpenDialogOperation = SheetPermissionOpenDialogOperation;
|
|
36651
36773
|
exports.SheetPermissionOpenPanelOperation = SheetPermissionOpenPanelOperation;
|
|
36652
|
-
Object.defineProperty(exports,
|
|
36774
|
+
Object.defineProperty(exports, "SheetPermissionRenderManagerService", {
|
|
36653
36775
|
enumerable: true,
|
|
36654
36776
|
get: function () {
|
|
36655
36777
|
return SheetPermissionRenderManagerService;
|
|
@@ -36658,43 +36780,43 @@ Object.defineProperty(exports, 'SheetPermissionRenderManagerService', {
|
|
|
36658
36780
|
exports.SheetPermissionUserManagerService = SheetPermissionUserManagerService;
|
|
36659
36781
|
exports.SheetPrintInterceptorService = SheetPrintInterceptorService;
|
|
36660
36782
|
exports.SheetPrintingResourceCollector = SheetPrintingResourceCollector;
|
|
36661
|
-
Object.defineProperty(exports,
|
|
36783
|
+
Object.defineProperty(exports, "SheetRenderController", {
|
|
36662
36784
|
enumerable: true,
|
|
36663
36785
|
get: function () {
|
|
36664
36786
|
return SheetRenderController;
|
|
36665
36787
|
}
|
|
36666
36788
|
});
|
|
36667
|
-
Object.defineProperty(exports,
|
|
36789
|
+
Object.defineProperty(exports, "SheetScrollManagerService", {
|
|
36668
36790
|
enumerable: true,
|
|
36669
36791
|
get: function () {
|
|
36670
36792
|
return SheetScrollManagerService;
|
|
36671
36793
|
}
|
|
36672
36794
|
});
|
|
36673
|
-
Object.defineProperty(exports,
|
|
36795
|
+
Object.defineProperty(exports, "SheetSelectionRenderService", {
|
|
36674
36796
|
enumerable: true,
|
|
36675
36797
|
get: function () {
|
|
36676
36798
|
return SheetSelectionRenderService;
|
|
36677
36799
|
}
|
|
36678
36800
|
});
|
|
36679
|
-
Object.defineProperty(exports,
|
|
36801
|
+
Object.defineProperty(exports, "SheetSkeletonManagerService", {
|
|
36680
36802
|
enumerable: true,
|
|
36681
36803
|
get: function () {
|
|
36682
36804
|
return SheetSkeletonManagerService;
|
|
36683
36805
|
}
|
|
36684
36806
|
});
|
|
36685
|
-
Object.defineProperty(exports,
|
|
36807
|
+
Object.defineProperty(exports, "SheetUIController", {
|
|
36686
36808
|
enumerable: true,
|
|
36687
36809
|
get: function () {
|
|
36688
36810
|
return SheetUIController;
|
|
36689
36811
|
}
|
|
36690
36812
|
});
|
|
36691
|
-
Object.defineProperty(exports,
|
|
36813
|
+
Object.defineProperty(exports, "SheetsRenderService", {
|
|
36692
36814
|
enumerable: true,
|
|
36693
36815
|
get: function () {
|
|
36694
36816
|
return SheetsRenderService;
|
|
36695
36817
|
}
|
|
36696
36818
|
});
|
|
36697
|
-
Object.defineProperty(exports,
|
|
36819
|
+
Object.defineProperty(exports, "SheetsScrollRenderController", {
|
|
36698
36820
|
enumerable: true,
|
|
36699
36821
|
get: function () {
|
|
36700
36822
|
return SheetsScrollRenderController;
|
|
@@ -36704,7 +36826,7 @@ exports.SheetsUIMenuSchema = menuSchema;
|
|
|
36704
36826
|
exports.SheetsUIPart = SheetsUIPart;
|
|
36705
36827
|
exports.ShowMenuListCommand = ShowMenuListCommand;
|
|
36706
36828
|
exports.SidebarDefinedNameOperation = SidebarDefinedNameOperation;
|
|
36707
|
-
Object.defineProperty(exports,
|
|
36829
|
+
Object.defineProperty(exports, "StatusBarController", {
|
|
36708
36830
|
enumerable: true,
|
|
36709
36831
|
get: function () {
|
|
36710
36832
|
return StatusBarController;
|
|
@@ -36712,13 +36834,13 @@ Object.defineProperty(exports, 'StatusBarController', {
|
|
|
36712
36834
|
});
|
|
36713
36835
|
exports.StatusBarService = StatusBarService;
|
|
36714
36836
|
exports.UNIVER_SHEET_PERMISSION_USER_PART = UNIVER_SHEET_PERMISSION_USER_PART;
|
|
36715
|
-
Object.defineProperty(exports,
|
|
36837
|
+
Object.defineProperty(exports, "UniverSheetsMobileUIPlugin", {
|
|
36716
36838
|
enumerable: true,
|
|
36717
36839
|
get: function () {
|
|
36718
36840
|
return UniverSheetsMobileUIPlugin;
|
|
36719
36841
|
}
|
|
36720
36842
|
});
|
|
36721
|
-
Object.defineProperty(exports,
|
|
36843
|
+
Object.defineProperty(exports, "UniverSheetsUIPlugin", {
|
|
36722
36844
|
enumerable: true,
|
|
36723
36845
|
get: function () {
|
|
36724
36846
|
return UniverSheetsUIPlugin;
|