@univerjs/sheets-ui 1.0.0-alpha.6 → 1.0.0-alpha.8
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/facade.js +2 -22
- package/lib/cjs/index.js +736 -640
- package/lib/cjs/locale/ar-SA.js +0 -2
- package/lib/cjs/locale/ca-ES.js +1 -3
- package/lib/cjs/locale/de-DE.js +0 -2
- package/lib/cjs/locale/en-US.js +0 -2
- package/lib/cjs/locale/es-ES.js +1 -3
- package/lib/cjs/locale/fa-IR.js +0 -2
- package/lib/cjs/locale/fr-FR.js +0 -2
- package/lib/cjs/locale/id-ID.js +1 -3
- package/lib/cjs/locale/it-IT.js +0 -2
- package/lib/cjs/locale/ja-JP.js +0 -2
- package/lib/cjs/locale/ko-KR.js +9 -11
- package/lib/cjs/locale/pl-PL.js +0 -2
- package/lib/cjs/locale/pt-BR.js +1 -3
- package/lib/cjs/locale/ru-RU.js +0 -2
- package/lib/cjs/locale/sk-SK.js +0 -2
- package/lib/cjs/locale/vi-VN.js +0 -2
- package/lib/cjs/locale/zh-CN.js +0 -2
- package/lib/cjs/locale/zh-HK.js +0 -2
- package/lib/cjs/locale/zh-TW.js +0 -2
- package/lib/es/facade.js +3 -23
- package/lib/es/index.js +741 -645
- package/lib/es/locale/ar-SA.js +0 -2
- package/lib/es/locale/ca-ES.js +1 -3
- package/lib/es/locale/de-DE.js +0 -2
- package/lib/es/locale/en-US.js +0 -2
- package/lib/es/locale/es-ES.js +1 -3
- package/lib/es/locale/fa-IR.js +0 -2
- package/lib/es/locale/fr-FR.js +0 -2
- package/lib/es/locale/id-ID.js +1 -3
- package/lib/es/locale/it-IT.js +0 -2
- package/lib/es/locale/ja-JP.js +0 -2
- package/lib/es/locale/ko-KR.js +9 -11
- package/lib/es/locale/pl-PL.js +0 -2
- package/lib/es/locale/pt-BR.js +1 -3
- package/lib/es/locale/ru-RU.js +0 -2
- package/lib/es/locale/sk-SK.js +0 -2
- package/lib/es/locale/vi-VN.js +0 -2
- package/lib/es/locale/zh-CN.js +0 -2
- package/lib/es/locale/zh-HK.js +0 -2
- package/lib/es/locale/zh-TW.js +0 -2
- package/lib/facade.js +3 -23
- package/lib/index.css +4 -0
- package/lib/index.js +741 -645
- package/lib/locale/ar-SA.js +0 -2
- package/lib/locale/ca-ES.js +1 -3
- package/lib/locale/de-DE.js +0 -2
- package/lib/locale/en-US.js +0 -2
- package/lib/locale/es-ES.js +1 -3
- package/lib/locale/fa-IR.js +0 -2
- package/lib/locale/fr-FR.js +0 -2
- package/lib/locale/id-ID.js +1 -3
- package/lib/locale/it-IT.js +0 -2
- package/lib/locale/ja-JP.js +0 -2
- package/lib/locale/ko-KR.js +9 -11
- package/lib/locale/pl-PL.js +0 -2
- package/lib/locale/pt-BR.js +1 -3
- package/lib/locale/ru-RU.js +0 -2
- package/lib/locale/sk-SK.js +0 -2
- package/lib/locale/vi-VN.js +0 -2
- package/lib/locale/zh-CN.js +0 -2
- package/lib/locale/zh-HK.js +0 -2
- package/lib/locale/zh-TW.js +0 -2
- package/lib/types/commands/operations/cell-edit.operation.d.ts +0 -2
- package/lib/types/config/config.d.ts +0 -4
- package/lib/types/controllers/auto-fill-ui.controller.d.ts +18 -6
- package/lib/types/controllers/permission/sheet-permission-check-ui.controller.d.ts +2 -4
- package/lib/types/controllers/render-controllers/editor-bridge.render-controller.d.ts +1 -0
- package/lib/types/facade/f-workbook.d.ts +1 -63
- package/lib/types/facade/f-worksheet.d.ts +6 -35
- package/lib/types/locale/en-US.d.ts +0 -2
- package/lib/types/services/clipboard/type.d.ts +0 -1
- package/lib/types/services/editor-bridge.service.d.ts +1 -1
- package/lib/types/services/selection/base-selection-render.service.d.ts +0 -17
- package/lib/types/services/selection/selection-control.d.ts +0 -12
- package/lib/types/services/selection/selection-render-model.d.ts +1 -1
- package/lib/types/views/sheet-container/SheetContainer.d.ts +1 -1
- package/lib/types/views/sheet-slider/SheetZoomInput.d.ts +1 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +11 -11
- 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 +15 -15
- package/lib/types/views/editor-container/EditorContainer.spec.d.ts +0 -16
package/lib/cjs/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
let _univerjs_docs_ui = require("@univerjs/docs-ui");
|
|
3
3
|
let _univerjs_core = require("@univerjs/core");
|
|
4
|
+
let _univerjs_sheets = require("@univerjs/sheets");
|
|
4
5
|
let _univerjs_ui = require("@univerjs/ui");
|
|
5
6
|
let _univerjs_engine_render = require("@univerjs/engine-render");
|
|
6
|
-
let _univerjs_sheets = require("@univerjs/sheets");
|
|
7
7
|
let rxjs = require("rxjs");
|
|
8
8
|
let _univerjs_docs = require("@univerjs/docs");
|
|
9
9
|
let _univerjs_protocol = require("@univerjs/protocol");
|
|
@@ -18,7 +18,7 @@ let rxjs_operators = require("rxjs/operators");
|
|
|
18
18
|
//#region src/basics/editor/get-editor-object.ts
|
|
19
19
|
function getEditorObject(unitId, renderManagerService) {
|
|
20
20
|
if (unitId == null) return;
|
|
21
|
-
const currentRender = renderManagerService.
|
|
21
|
+
const currentRender = renderManagerService.getRenderUnitById(unitId);
|
|
22
22
|
if (currentRender == null) return;
|
|
23
23
|
const { mainComponent, scene, engine, components } = currentRender;
|
|
24
24
|
return {
|
|
@@ -186,7 +186,7 @@ let SHEET_VIEW_KEY = /* @__PURE__ */ function(SHEET_VIEW_KEY) {
|
|
|
186
186
|
}({});
|
|
187
187
|
|
|
188
188
|
//#endregion
|
|
189
|
-
//#region \0@oxc-project+runtime@0.
|
|
189
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/typeof.js
|
|
190
190
|
function _typeof(o) {
|
|
191
191
|
"@babel/helpers - typeof";
|
|
192
192
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -197,7 +197,7 @@ function _typeof(o) {
|
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
//#endregion
|
|
200
|
-
//#region \0@oxc-project+runtime@0.
|
|
200
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPrimitive.js
|
|
201
201
|
function toPrimitive(t, r) {
|
|
202
202
|
if ("object" != _typeof(t) || !t) return t;
|
|
203
203
|
var e = t[Symbol.toPrimitive];
|
|
@@ -210,14 +210,14 @@ function toPrimitive(t, r) {
|
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
//#endregion
|
|
213
|
-
//#region \0@oxc-project+runtime@0.
|
|
213
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPropertyKey.js
|
|
214
214
|
function toPropertyKey(t) {
|
|
215
215
|
var i = toPrimitive(t, "string");
|
|
216
216
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
//#endregion
|
|
220
|
-
//#region \0@oxc-project+runtime@0.
|
|
220
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/defineProperty.js
|
|
221
221
|
function _defineProperty(e, r, t) {
|
|
222
222
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
223
223
|
value: t,
|
|
@@ -277,7 +277,7 @@ var SelectionRenderModel = class {
|
|
|
277
277
|
return this._rangeType;
|
|
278
278
|
}
|
|
279
279
|
/**
|
|
280
|
-
*
|
|
280
|
+
* Compares row and column bounds only.
|
|
281
281
|
*/
|
|
282
282
|
isEqual(rangeWithCoord) {
|
|
283
283
|
const { startColumn, startRow, endColumn, endRow } = this;
|
|
@@ -354,9 +354,9 @@ const SetRowHeaderWidthCommand = {
|
|
|
354
354
|
const renderManagerSrv = accessor.get(_univerjs_engine_render.IRenderManagerService);
|
|
355
355
|
if (!renderManagerSrv) return false;
|
|
356
356
|
const { unitId, subUnitId, size } = params;
|
|
357
|
-
const render = renderManagerSrv.
|
|
357
|
+
const render = renderManagerSrv.getRenderUnitById(unitId);
|
|
358
358
|
if (render) {
|
|
359
|
-
renderManagerSrv.
|
|
359
|
+
renderManagerSrv.getRenderUnitById(unitId).with(SheetSkeletonManagerService).setRowHeaderSize(render, subUnitId, size);
|
|
360
360
|
const { components } = render;
|
|
361
361
|
const renderComponent = components.get("__SpreadsheetRowHeader__");
|
|
362
362
|
if (renderComponent) renderComponent.setCustomHeader({ headerStyle: { size } }, subUnitId);
|
|
@@ -372,9 +372,9 @@ const SetColumnHeaderHeightCommand = {
|
|
|
372
372
|
const renderManagerSrv = accessor.get(_univerjs_engine_render.IRenderManagerService);
|
|
373
373
|
if (!renderManagerSrv) return false;
|
|
374
374
|
const { unitId, subUnitId, size } = params;
|
|
375
|
-
const render = renderManagerSrv.
|
|
375
|
+
const render = renderManagerSrv.getRenderUnitById(unitId);
|
|
376
376
|
if (render) {
|
|
377
|
-
renderManagerSrv.
|
|
377
|
+
renderManagerSrv.getRenderUnitById(unitId).with(SheetSkeletonManagerService).setColumnHeaderSize(render, subUnitId, size);
|
|
378
378
|
const { components } = render;
|
|
379
379
|
const renderComponent = components.get("__SpreadsheetColumnHeader__");
|
|
380
380
|
if (renderComponent) renderComponent.setCustomHeader({ headerStyle: { size } }, subUnitId);
|
|
@@ -494,10 +494,6 @@ var BaseSelectionRenderService = class extends _univerjs_core.Disposable {
|
|
|
494
494
|
/**
|
|
495
495
|
* Reset this._selectionStyle to default normal selection style
|
|
496
496
|
*/
|
|
497
|
-
/** @deprecated This should not be provided by the selection render service. */
|
|
498
|
-
getViewPort() {
|
|
499
|
-
return this._activeViewport;
|
|
500
|
-
}
|
|
501
497
|
setSingleSelectionEnabled(enabled = false) {
|
|
502
498
|
this._singleSelectionEnabled = enabled;
|
|
503
499
|
}
|
|
@@ -608,7 +604,7 @@ var BaseSelectionRenderService = class extends _univerjs_core.Disposable {
|
|
|
608
604
|
}
|
|
609
605
|
_getFreeze() {
|
|
610
606
|
var _this$_sheetSkeletonM;
|
|
611
|
-
return (_this$_sheetSkeletonM = this._sheetSkeletonManagerService.getCurrentParam()) === null || _this$_sheetSkeletonM === void 0 ? void 0 : _this$_sheetSkeletonM.skeleton.
|
|
607
|
+
return (_this$_sheetSkeletonM = this._sheetSkeletonManagerService.getCurrentParam()) === null || _this$_sheetSkeletonM === void 0 ? void 0 : _this$_sheetSkeletonM.skeleton.worksheet.getFreeze();
|
|
612
608
|
}
|
|
613
609
|
_getViewportByCell(row, column) {
|
|
614
610
|
if (row === void 0 || column === void 0) return null;
|
|
@@ -687,6 +683,10 @@ var BaseSelectionRenderService = class extends _univerjs_core.Disposable {
|
|
|
687
683
|
const startViewport = scene.getActiveViewportByCoord(_univerjs_engine_render.Vector2.FromArray([moveStartPosX, moveStartPosY]));
|
|
688
684
|
this._scenePointerMoveSub = scene.onPointerMove$.subscribeEvent((moveEvt) => {
|
|
689
685
|
var _scene$getActiveViewp;
|
|
686
|
+
if (moveEvt.buttons === 0) {
|
|
687
|
+
this.endSelection();
|
|
688
|
+
return;
|
|
689
|
+
}
|
|
690
690
|
const { offsetX: moveOffsetX, offsetY: moveOffsetY } = moveEvt;
|
|
691
691
|
const { x: newMoveOffsetX, y: newMoveOffsetY } = scene.getCoordRelativeToViewport(_univerjs_engine_render.Vector2.FromArray([moveOffsetX, moveOffsetY]));
|
|
692
692
|
this._movingHandler(newMoveOffsetX, newMoveOffsetY, activeSelectionControl, rangeType);
|
|
@@ -765,12 +765,6 @@ var BaseSelectionRenderService = class extends _univerjs_core.Disposable {
|
|
|
765
765
|
});
|
|
766
766
|
});
|
|
767
767
|
}
|
|
768
|
-
/**
|
|
769
|
-
* @deprecated Please use `getCellWithCoordByOffset` instead.
|
|
770
|
-
*/
|
|
771
|
-
getSelectionCellByPosition(x, y) {
|
|
772
|
-
return this.getCellWithCoordByOffset(x, y);
|
|
773
|
-
}
|
|
774
768
|
getCellWithCoordByOffset(x, y, skeletonParam) {
|
|
775
769
|
const scene = this._scene;
|
|
776
770
|
const skeleton = skeletonParam !== null && skeletonParam !== void 0 ? skeletonParam : this._skeleton;
|
|
@@ -980,7 +974,7 @@ function genSelectionByRange(skeleton, range) {
|
|
|
980
974
|
}
|
|
981
975
|
|
|
982
976
|
//#endregion
|
|
983
|
-
//#region \0@oxc-project+runtime@0.
|
|
977
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorateParam.js
|
|
984
978
|
function __decorateParam(paramIndex, decorator) {
|
|
985
979
|
return function(target, key) {
|
|
986
980
|
decorator(target, key, paramIndex);
|
|
@@ -988,7 +982,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
988
982
|
}
|
|
989
983
|
|
|
990
984
|
//#endregion
|
|
991
|
-
//#region \0@oxc-project+runtime@0.
|
|
985
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorate.js
|
|
992
986
|
function __decorate(decorators, target, key, desc) {
|
|
993
987
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
994
988
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1214,7 +1208,7 @@ var SelectionShapeExtension = class {
|
|
|
1214
1208
|
}
|
|
1215
1209
|
_getFreeze() {
|
|
1216
1210
|
var _withCurrentTypeOfRen;
|
|
1217
|
-
return (_withCurrentTypeOfRen = (0, _univerjs_engine_render.withCurrentTypeOfRenderer)(_univerjs_core.UniverInstanceType.UNIVER_SHEET, SheetSkeletonManagerService, this._injector.get(_univerjs_core.IUniverInstanceService), this._injector.get(_univerjs_engine_render.IRenderManagerService))) === null || _withCurrentTypeOfRen === void 0 || (_withCurrentTypeOfRen = _withCurrentTypeOfRen.getCurrentParam()) === null || _withCurrentTypeOfRen === void 0 ? void 0 : _withCurrentTypeOfRen.skeleton.
|
|
1211
|
+
return (_withCurrentTypeOfRen = (0, _univerjs_engine_render.withCurrentTypeOfRenderer)(_univerjs_core.UniverInstanceType.UNIVER_SHEET, SheetSkeletonManagerService, this._injector.get(_univerjs_core.IUniverInstanceService), this._injector.get(_univerjs_engine_render.IRenderManagerService))) === null || _withCurrentTypeOfRen === void 0 || (_withCurrentTypeOfRen = _withCurrentTypeOfRen.getCurrentParam()) === null || _withCurrentTypeOfRen === void 0 ? void 0 : _withCurrentTypeOfRen.skeleton.worksheet.getFreeze();
|
|
1218
1212
|
}
|
|
1219
1213
|
_isSelectionInViewport(selection, viewport) {
|
|
1220
1214
|
const freeze = this._getFreeze() || {
|
|
@@ -2237,29 +2231,6 @@ var SelectionControl = class extends _univerjs_core.Disposable {
|
|
|
2237
2231
|
this._updateControlCoord();
|
|
2238
2232
|
}
|
|
2239
2233
|
/**
|
|
2240
|
-
* Update selection model with new range & primary cell(aka: highlight/current), also update row/col selection size & style.
|
|
2241
|
-
*
|
|
2242
|
-
* @deprecated use `updateRangeBySelectionWithCoord` and `updateStyle` to do same thing.
|
|
2243
|
-
*
|
|
2244
|
-
* @param newSelectionRange
|
|
2245
|
-
* @param rowHeaderWidth
|
|
2246
|
-
* @param columnHeaderHeight
|
|
2247
|
-
* @param style
|
|
2248
|
-
* @param primaryCell primary cell
|
|
2249
|
-
*/
|
|
2250
|
-
update(newSelectionRange, rowHeaderWidth = 0, columnHeaderHeight = 0, style, primaryCell) {
|
|
2251
|
-
this._rowHeaderWidth = rowHeaderWidth;
|
|
2252
|
-
this._columnHeaderHeight = columnHeaderHeight;
|
|
2253
|
-
this._rowHeaderOffsetX = 0;
|
|
2254
|
-
this._columnHeaderOffsetY = 0;
|
|
2255
|
-
this.updateRangeBySelectionWithCoord({
|
|
2256
|
-
rangeWithCoord: newSelectionRange,
|
|
2257
|
-
primaryWithCoord: primaryCell,
|
|
2258
|
-
style
|
|
2259
|
-
});
|
|
2260
|
-
if (style) this.updateStyle(style);
|
|
2261
|
-
}
|
|
2262
|
-
/**
|
|
2263
2234
|
* Update primary range.
|
|
2264
2235
|
* highlight cell would update if primary cell has value.
|
|
2265
2236
|
* highlight cell would be cleared if primary cell is null.
|
|
@@ -2656,7 +2627,7 @@ let MarkSelectionService = class MarkSelectionService extends _univerjs_core.Dis
|
|
|
2656
2627
|
const { unitId, subUnitId, selection, control: oldControl, zIndex } = shape;
|
|
2657
2628
|
oldControl === null || oldControl === void 0 || oldControl.dispose();
|
|
2658
2629
|
if (unitId !== currentUnitId || subUnitId !== currentSubUnitId) return;
|
|
2659
|
-
const renderUnit = this._renderManagerService.
|
|
2630
|
+
const renderUnit = this._renderManagerService.getRenderUnitById(unitId);
|
|
2660
2631
|
if (!renderUnit) return;
|
|
2661
2632
|
const skeleton = this._sheetSkeletonService.getSkeleton(unitId, subUnitId);
|
|
2662
2633
|
if (!skeleton) return;
|
|
@@ -2941,7 +2912,6 @@ function convertToCellStyle(cell, dataStream, textRuns) {
|
|
|
2941
2912
|
s: textRuns[0].ts
|
|
2942
2913
|
};
|
|
2943
2914
|
else return cell;
|
|
2944
|
-
return cell;
|
|
2945
2915
|
}
|
|
2946
2916
|
|
|
2947
2917
|
//#endregion
|
|
@@ -3401,13 +3371,12 @@ var HtmlToUSMService = class HtmlToUSMService {
|
|
|
3401
3371
|
let cellText = "";
|
|
3402
3372
|
let cellRichStyle;
|
|
3403
3373
|
if (/<[^>]+>/.test(cellHtml) && skeleton) {
|
|
3404
|
-
var _skeleton$getBlankCel;
|
|
3405
3374
|
const newDocBody = {
|
|
3406
3375
|
dataStream: "",
|
|
3407
3376
|
textRuns: []
|
|
3408
3377
|
};
|
|
3409
3378
|
this._parseCellHtml(null, cell.childNodes, newDocBody, void 0, styleStr);
|
|
3410
|
-
const documentModel = (
|
|
3379
|
+
const documentModel = (0, _univerjs_core.createDocumentModelWithStyle)("", {});
|
|
3411
3380
|
const p = documentModel === null || documentModel === void 0 ? void 0 : documentModel.getSnapshot();
|
|
3412
3381
|
const singleDataStream = `${newDocBody.dataStream}\r\n`;
|
|
3413
3382
|
const documentData = {
|
|
@@ -3428,11 +3397,8 @@ var HtmlToUSMService = class HtmlToUSMService {
|
|
|
3428
3397
|
};
|
|
3429
3398
|
}
|
|
3430
3399
|
_generateDocumentDataModelSnapshot(snapshot) {
|
|
3431
|
-
|
|
3432
|
-
const
|
|
3433
|
-
if (currentSkeleton == null) return null;
|
|
3434
|
-
const { skeleton } = currentSkeleton;
|
|
3435
|
-
const documentModel = (_skeleton$getBlankCel2 = skeleton.getBlankCellDocumentModel()) === null || _skeleton$getBlankCel2 === void 0 ? void 0 : _skeleton$getBlankCel2.documentModel;
|
|
3400
|
+
if (this._getCurrentSkeleton() == null) return null;
|
|
3401
|
+
const documentModel = (0, _univerjs_core.createDocumentModelWithStyle)("", {});
|
|
3436
3402
|
const documentData = {
|
|
3437
3403
|
...documentModel === null || documentModel === void 0 ? void 0 : documentModel.getSnapshot(),
|
|
3438
3404
|
...snapshot
|
|
@@ -4246,7 +4212,7 @@ let SheetClipboardService = class SheetClipboardService extends _univerjs_core.D
|
|
|
4246
4212
|
return this._clipboardHooks;
|
|
4247
4213
|
}
|
|
4248
4214
|
_generateCopyContent(unitId, subUnitId, range, hooks, copyHookType = PREDEFINED_HOOK_NAME_COPY.DEFAULT_COPY) {
|
|
4249
|
-
const workbook = this._univerInstanceService.
|
|
4215
|
+
const workbook = this._univerInstanceService.getUnit(unitId, _univerjs_core.UniverInstanceType.UNIVER_SHEET);
|
|
4250
4216
|
const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getSheetBySheetId(subUnitId);
|
|
4251
4217
|
if (!workbook || !worksheet) return null;
|
|
4252
4218
|
const filteredRows = hooks.reduce((acc, cur) => {
|
|
@@ -4451,7 +4417,7 @@ let SheetClipboardService = class SheetClipboardService extends _univerjs_core.D
|
|
|
4451
4417
|
if (!cellMatrix) return false;
|
|
4452
4418
|
const pasteTarget = this._getPastedRange(cellMatrix);
|
|
4453
4419
|
if (!pasteTarget) return false;
|
|
4454
|
-
const worksheet = (_this$_univerInstance = this._univerInstanceService.
|
|
4420
|
+
const worksheet = (_this$_univerInstance = this._univerInstanceService.getUnit(pasteTarget.unitId, _univerjs_core.UniverInstanceType.UNIVER_SHEET)) === null || _this$_univerInstance === void 0 ? void 0 : _this$_univerInstance.getSheetBySheetId(pasteTarget.subUnitId);
|
|
4455
4421
|
if (!worksheet) return false;
|
|
4456
4422
|
const mergeData = worksheet === null || worksheet === void 0 ? void 0 : worksheet.getMergeData();
|
|
4457
4423
|
if (mergeData.length) {
|
|
@@ -4481,7 +4447,7 @@ let SheetClipboardService = class SheetClipboardService extends _univerjs_core.D
|
|
|
4481
4447
|
const { range, matrix: cachedMatrix, unitId: copyUnitId, subUnitId: copySubUnitId } = cachedData || {};
|
|
4482
4448
|
if (!cachedMatrix || !cachedData || !range || !copyUnitId || !copySubUnitId) return false;
|
|
4483
4449
|
const { mapFunc } = virtualizeDiscreteRanges([range]);
|
|
4484
|
-
const worksheet = (_this$_univerInstance2 = this._univerInstanceService.
|
|
4450
|
+
const worksheet = (_this$_univerInstance2 = this._univerInstanceService.getUnit(copyUnitId, _univerjs_core.UniverInstanceType.UNIVER_SHEET)) === null || _this$_univerInstance2 === void 0 ? void 0 : _this$_univerInstance2.getSheetBySheetId(copySubUnitId);
|
|
4485
4451
|
const cellMatrix = new _univerjs_core.ObjectMatrix();
|
|
4486
4452
|
cachedMatrix.forValue((row, col, value) => {
|
|
4487
4453
|
const { row: actualRow, col: actualColumn } = mapFunc(row, col);
|
|
@@ -4504,7 +4470,7 @@ let SheetClipboardService = class SheetClipboardService extends _univerjs_core.D
|
|
|
4504
4470
|
});
|
|
4505
4471
|
const pasteTarget = this._getPastedRange(cellMatrix);
|
|
4506
4472
|
if (!pasteTarget) return false;
|
|
4507
|
-
const pasteToWorksheet = (_this$_univerInstance3 = this._univerInstanceService.
|
|
4473
|
+
const pasteToWorksheet = (_this$_univerInstance3 = this._univerInstanceService.getUnit(pasteTarget.unitId, _univerjs_core.UniverInstanceType.UNIVER_SHEET)) === null || _this$_univerInstance3 === void 0 ? void 0 : _this$_univerInstance3.getSheetBySheetId(pasteTarget.subUnitId);
|
|
4508
4474
|
if (!pasteToWorksheet) return false;
|
|
4509
4475
|
const mergeData = pasteToWorksheet === null || pasteToWorksheet === void 0 ? void 0 : pasteToWorksheet.getMergeData();
|
|
4510
4476
|
if (mergeData) {
|
|
@@ -4680,7 +4646,7 @@ let SheetClipboardService = class SheetClipboardService extends _univerjs_core.D
|
|
|
4680
4646
|
var _this$_univerInstance4, _this$_renderManagerS;
|
|
4681
4647
|
const worksheet = (_this$_univerInstance4 = this._univerInstanceService.getUnit(unitId, _univerjs_core.UniverInstanceType.UNIVER_SHEET)) === null || _this$_univerInstance4 === void 0 ? void 0 : _this$_univerInstance4.getSheetBySheetId(subUnitId);
|
|
4682
4648
|
if (!worksheet) return null;
|
|
4683
|
-
const skeleton = (_this$_renderManagerS = this._renderManagerService.
|
|
4649
|
+
const skeleton = (_this$_renderManagerS = this._renderManagerService.getRenderUnitById(unitId)) === null || _this$_renderManagerS === void 0 ? void 0 : _this$_renderManagerS.with(SheetSkeletonManagerService).ensureSkeleton(subUnitId);
|
|
4684
4650
|
if (!skeleton) return null;
|
|
4685
4651
|
const rowManager = worksheet.getRowManager();
|
|
4686
4652
|
const defaultRowHeight = worksheet.getConfig().defaultRowHeight;
|
|
@@ -4720,7 +4686,7 @@ let SheetClipboardService = class SheetClipboardService extends _univerjs_core.D
|
|
|
4720
4686
|
}
|
|
4721
4687
|
_getSetSelectionOperation(unitId, subUnitId, range, cellMatrix, pasteType) {
|
|
4722
4688
|
var _this$_univerInstance5;
|
|
4723
|
-
const worksheet = (_this$_univerInstance5 = this._univerInstanceService.
|
|
4689
|
+
const worksheet = (_this$_univerInstance5 = this._univerInstanceService.getUnit(unitId, _univerjs_core.UniverInstanceType.UNIVER_SHEET)) === null || _this$_univerInstance5 === void 0 ? void 0 : _this$_univerInstance5.getSheetBySheetId(subUnitId);
|
|
4724
4690
|
if (!worksheet) return null;
|
|
4725
4691
|
const { rows, cols } = range;
|
|
4726
4692
|
const startRow = rows[0];
|
|
@@ -4912,7 +4878,7 @@ let SheetClipboardService = class SheetClipboardService extends _univerjs_core.D
|
|
|
4912
4878
|
if (rowCount <= 0 || colCount <= 0) return null;
|
|
4913
4879
|
const pasteSelectionRangeRowLen = discreteRange.rows.length;
|
|
4914
4880
|
const pasteSelectionRangeColLen = discreteRange.cols.length;
|
|
4915
|
-
const worksheet = (_this$_univerInstance6 = this._univerInstanceService.
|
|
4881
|
+
const worksheet = (_this$_univerInstance6 = this._univerInstanceService.getUnit(unitId, _univerjs_core.UniverInstanceType.UNIVER_SHEET)) === null || _this$_univerInstance6 === void 0 ? void 0 : _this$_univerInstance6.getSheetBySheetId(subUnitId);
|
|
4916
4882
|
if (!worksheet) return null;
|
|
4917
4883
|
const mergeData = worksheet === null || worksheet === void 0 ? void 0 : worksheet.getMergeData();
|
|
4918
4884
|
if (pasteSelectionRangeRowLen % rowCount === 0 && pasteSelectionRangeColLen % colCount === 0) {
|
|
@@ -4939,7 +4905,7 @@ let SheetClipboardService = class SheetClipboardService extends _univerjs_core.D
|
|
|
4939
4905
|
}
|
|
4940
4906
|
_expandOrShrinkRowsCols(unitId, subUnitId, range, colCount, rowCount) {
|
|
4941
4907
|
const { rows, cols } = range;
|
|
4942
|
-
const workbook = this._univerInstanceService.
|
|
4908
|
+
const workbook = this._univerInstanceService.getUnit(unitId, _univerjs_core.UniverInstanceType.UNIVER_SHEET);
|
|
4943
4909
|
const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getSheetBySheetId(subUnitId);
|
|
4944
4910
|
let newRows;
|
|
4945
4911
|
let newCols;
|
|
@@ -5064,6 +5030,7 @@ const SheetCopyCommand = {
|
|
|
5064
5030
|
priority: SHEET_CLIPBOARD_PRIORITY,
|
|
5065
5031
|
preconditions: whenSheetFocused,
|
|
5066
5032
|
handler: async (accessor) => {
|
|
5033
|
+
checkSheetClipboardPermission(accessor, _univerjs_ui.CopyCommand.id);
|
|
5067
5034
|
return accessor.get(ISheetClipboardService).copy();
|
|
5068
5035
|
}
|
|
5069
5036
|
};
|
|
@@ -5075,6 +5042,7 @@ const SheetCutCommand = {
|
|
|
5075
5042
|
priority: SHEET_CLIPBOARD_PRIORITY,
|
|
5076
5043
|
preconditions: whenSheetFocused,
|
|
5077
5044
|
handler: async (accessor) => {
|
|
5045
|
+
checkSheetClipboardPermission(accessor, _univerjs_ui.CutCommand.id);
|
|
5078
5046
|
return accessor.get(ISheetClipboardService).cut();
|
|
5079
5047
|
}
|
|
5080
5048
|
};
|
|
@@ -5086,6 +5054,7 @@ const SheetPasteCommand = {
|
|
|
5086
5054
|
priority: SHEET_CLIPBOARD_PRIORITY,
|
|
5087
5055
|
preconditions: whenSheetFocused,
|
|
5088
5056
|
handler: async (accessor, params) => {
|
|
5057
|
+
checkSheetClipboardPermission(accessor, _univerjs_ui.PasteCommand.id, params);
|
|
5089
5058
|
const sheetClipboardService = accessor.get(ISheetClipboardService);
|
|
5090
5059
|
const clipboardInterfaceService = accessor.get(_univerjs_ui.IClipboardInterfaceService);
|
|
5091
5060
|
if (clipboardInterfaceService.supportClipboard) {
|
|
@@ -5104,12 +5073,76 @@ const SheetPasteShortKeyCommand = {
|
|
|
5104
5073
|
id: _univerjs_ui.SheetPasteShortKeyCommandName,
|
|
5105
5074
|
type: _univerjs_core.CommandType.COMMAND,
|
|
5106
5075
|
handler: async (accessor, params) => {
|
|
5076
|
+
checkSheetClipboardPermission(accessor, _univerjs_ui.PasteCommand.id);
|
|
5107
5077
|
const clipboardService = accessor.get(ISheetClipboardService);
|
|
5108
5078
|
const { htmlContent, textContent, files, formulaClipboardPayload } = params;
|
|
5109
5079
|
clipboardService.legacyPaste(htmlContent, textContent, files, formulaClipboardPayload);
|
|
5110
5080
|
return true;
|
|
5111
5081
|
}
|
|
5112
5082
|
};
|
|
5083
|
+
function checkSheetClipboardPermission(accessor, commandId, params) {
|
|
5084
|
+
const permissionCheckController = accessor.get(_univerjs_sheets.SheetPermissionCheckController);
|
|
5085
|
+
let permission = true;
|
|
5086
|
+
let errorKey = "sheets-ui.permission.dialog.commonErr";
|
|
5087
|
+
switch (commandId) {
|
|
5088
|
+
case _univerjs_ui.CopyCommand.id:
|
|
5089
|
+
permission = permissionCheckController.permissionCheckWithRanges({
|
|
5090
|
+
workbookTypes: [_univerjs_sheets.WorkbookCopyPermission],
|
|
5091
|
+
worksheetTypes: [_univerjs_sheets.WorksheetCopyPermission],
|
|
5092
|
+
rangeTypes: [_univerjs_sheets.RangeProtectionPermissionViewPoint]
|
|
5093
|
+
});
|
|
5094
|
+
errorKey = "sheets-ui.permission.dialog.copyErr";
|
|
5095
|
+
break;
|
|
5096
|
+
case _univerjs_ui.CutCommand.id:
|
|
5097
|
+
permission = permissionCheckController.permissionCheckWithRanges({
|
|
5098
|
+
workbookTypes: [_univerjs_sheets.WorkbookCopyPermission, _univerjs_sheets.WorkbookEditablePermission],
|
|
5099
|
+
worksheetTypes: [_univerjs_sheets.WorksheetCopyPermission, _univerjs_sheets.WorksheetEditPermission],
|
|
5100
|
+
rangeTypes: [_univerjs_sheets.RangeProtectionPermissionViewPoint, _univerjs_sheets.RangeProtectionPermissionEditPoint]
|
|
5101
|
+
});
|
|
5102
|
+
errorKey = "sheets-ui.permission.dialog.copyErr";
|
|
5103
|
+
break;
|
|
5104
|
+
case _univerjs_ui.PasteCommand.id:
|
|
5105
|
+
permission = checkSheetPastePermission(permissionCheckController, params);
|
|
5106
|
+
errorKey = "sheets-ui.permission.dialog.pasteErr";
|
|
5107
|
+
break;
|
|
5108
|
+
}
|
|
5109
|
+
if (permission) return;
|
|
5110
|
+
const localeService = accessor.get(_univerjs_core.LocaleService);
|
|
5111
|
+
let errorMsg = localeService.t(errorKey);
|
|
5112
|
+
if (commandId === _univerjs_ui.CopyCommand.id || commandId === _univerjs_ui.CutCommand.id) {
|
|
5113
|
+
var _permissionService$ge;
|
|
5114
|
+
const target = (0, _univerjs_sheets.getSheetCommandTarget)(accessor.get(_univerjs_core.IUniverInstanceService));
|
|
5115
|
+
const permissionService = accessor.get(_univerjs_core.IPermissionService);
|
|
5116
|
+
if (target && !((_permissionService$ge = permissionService.getPermissionPoint(new _univerjs_sheets.WorkbookCopyPermission(target.unitId).id)) === null || _permissionService$ge === void 0 ? void 0 : _permissionService$ge.value)) errorMsg = localeService.t("sheets-ui.permission.dialog.workbookCopyErr");
|
|
5117
|
+
}
|
|
5118
|
+
permissionCheckController.blockExecuteWithoutPermission(errorMsg);
|
|
5119
|
+
}
|
|
5120
|
+
function checkSheetPastePermission(permissionCheckController, params) {
|
|
5121
|
+
if ((params === null || params === void 0 ? void 0 : params.value) === PREDEFINED_HOOK_NAME_PASTE.SPECIAL_PASTE_VALUE || (params === null || params === void 0 ? void 0 : params.value) === PREDEFINED_HOOK_NAME_PASTE.SPECIAL_PASTE_FORMULA || (params === null || params === void 0 ? void 0 : params.value) === PREDEFINED_HOOK_NAME_PASTE.SPECIAL_PASTE_FORMAT) return permissionCheckController.permissionCheckWithRanges({
|
|
5122
|
+
workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
|
|
5123
|
+
worksheetTypes: [_univerjs_sheets.WorksheetSetCellStylePermission, _univerjs_sheets.WorksheetEditPermission],
|
|
5124
|
+
rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
|
|
5125
|
+
});
|
|
5126
|
+
if ((params === null || params === void 0 ? void 0 : params.value) === PREDEFINED_HOOK_NAME_PASTE.SPECIAL_PASTE_COL_WIDTH) return permissionCheckController.permissionCheckWithRanges({
|
|
5127
|
+
workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
|
|
5128
|
+
worksheetTypes: [
|
|
5129
|
+
_univerjs_sheets.WorksheetEditPermission,
|
|
5130
|
+
_univerjs_sheets.WorksheetSetCellValuePermission,
|
|
5131
|
+
_univerjs_sheets.WorksheetSetCellStylePermission,
|
|
5132
|
+
_univerjs_sheets.WorksheetSetColumnStylePermission
|
|
5133
|
+
],
|
|
5134
|
+
rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
|
|
5135
|
+
});
|
|
5136
|
+
return permissionCheckController.permissionCheckWithRanges({
|
|
5137
|
+
workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
|
|
5138
|
+
worksheetTypes: [
|
|
5139
|
+
_univerjs_sheets.WorksheetSetCellValuePermission,
|
|
5140
|
+
_univerjs_sheets.WorksheetSetCellStylePermission,
|
|
5141
|
+
_univerjs_sheets.WorksheetEditPermission
|
|
5142
|
+
],
|
|
5143
|
+
rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
|
|
5144
|
+
});
|
|
5145
|
+
}
|
|
5113
5146
|
const SheetPasteValueCommand = {
|
|
5114
5147
|
id: "sheet.command.paste-value",
|
|
5115
5148
|
type: _univerjs_core.CommandType.COMMAND,
|
|
@@ -5170,7 +5203,7 @@ const DeleteRangeMoveLeftConfirmCommand = {
|
|
|
5170
5203
|
};
|
|
5171
5204
|
const getRowLength = (range) => range.endRow - range.startRow;
|
|
5172
5205
|
if (!worksheet.getMergeData().find((mergeRange) => {
|
|
5173
|
-
const interSectedRange = _univerjs_core.
|
|
5206
|
+
const interSectedRange = (0, _univerjs_core.getIntersectRange)(mergeRange, range);
|
|
5174
5207
|
return interSectedRange ? getRowLength(mergeRange) > getRowLength(interSectedRange) : false;
|
|
5175
5208
|
})) return commandService.executeCommand(_univerjs_sheets.DeleteRangeMoveLeftCommand.id);
|
|
5176
5209
|
if (await confirmService.confirm({
|
|
@@ -5216,7 +5249,7 @@ const DeleteRangeMoveUpConfirmCommand = {
|
|
|
5216
5249
|
}
|
|
5217
5250
|
const getColLength = (range) => range.endColumn - range.startColumn;
|
|
5218
5251
|
if (!worksheet.getMergeData().find((mergeRange) => {
|
|
5219
|
-
const interSectedRange = _univerjs_core.
|
|
5252
|
+
const interSectedRange = (0, _univerjs_core.getIntersectRange)(mergeRange, range);
|
|
5220
5253
|
return interSectedRange ? getColLength(mergeRange) > getColLength(interSectedRange) : false;
|
|
5221
5254
|
})) return commandService.executeCommand(_univerjs_sheets.DeleteRangeMoveUpCommand.id);
|
|
5222
5255
|
if (await confirmService.confirm({
|
|
@@ -5906,7 +5939,7 @@ const InsertRangeMoveDownConfirmCommand = {
|
|
|
5906
5939
|
}
|
|
5907
5940
|
const getColLength = (range) => range.endColumn - range.startColumn;
|
|
5908
5941
|
if (!worksheet.getMergeData().find((mergeRange) => {
|
|
5909
|
-
const interSectedRange = _univerjs_core.
|
|
5942
|
+
const interSectedRange = (0, _univerjs_core.getIntersectRange)(mergeRange, range);
|
|
5910
5943
|
return interSectedRange ? getColLength(mergeRange) > getColLength(interSectedRange) : false;
|
|
5911
5944
|
})) return commandService.executeCommand(_univerjs_sheets.InsertRangeMoveDownCommand.id);
|
|
5912
5945
|
if (await confirmService.confirm({
|
|
@@ -5944,7 +5977,7 @@ const InsertRangeMoveRightConfirmCommand = {
|
|
|
5944
5977
|
};
|
|
5945
5978
|
const getRowLength = (range) => range.endRow - range.startRow;
|
|
5946
5979
|
if (!worksheet.getMergeData().find((mergeRange) => {
|
|
5947
|
-
const interSectedRange = _univerjs_core.
|
|
5980
|
+
const interSectedRange = (0, _univerjs_core.getIntersectRange)(mergeRange, range);
|
|
5948
5981
|
return interSectedRange ? getRowLength(mergeRange) > getRowLength(interSectedRange) : false;
|
|
5949
5982
|
})) return commandService.executeCommand(_univerjs_sheets.InsertRangeMoveRightCommand.id);
|
|
5950
5983
|
if (await confirmService.confirm({
|
|
@@ -6661,7 +6694,7 @@ const SetSelectionFrozenCommand = {
|
|
|
6661
6694
|
const commandService = accessor.get(_univerjs_core.ICommandService);
|
|
6662
6695
|
const selections = accessor.get(_univerjs_sheets.SheetsSelectionsService).getCurrentSelections();
|
|
6663
6696
|
if (!selections) return false;
|
|
6664
|
-
const { sheetViewStartRow = 0, sheetViewStartColumn = 0 } = accessor.get(_univerjs_engine_render.IRenderManagerService).
|
|
6697
|
+
const { sheetViewStartRow = 0, sheetViewStartColumn = 0 } = accessor.get(_univerjs_engine_render.IRenderManagerService).getRenderUnitById(unitId).with(SheetScrollManagerService).getCurrentScrollState() || {};
|
|
6665
6698
|
let startRow;
|
|
6666
6699
|
let startColumn;
|
|
6667
6700
|
let freezedRowCount;
|
|
@@ -7012,7 +7045,7 @@ const MoveSelectionEnterAndTabCommand = {
|
|
|
7012
7045
|
reveal: true,
|
|
7013
7046
|
extra: params.extra
|
|
7014
7047
|
});
|
|
7015
|
-
const selectionService = (_renderManagerService = accessor.get(_univerjs_engine_render.IRenderManagerService).
|
|
7048
|
+
const selectionService = (_renderManagerService = accessor.get(_univerjs_engine_render.IRenderManagerService).getRenderUnitById(unitId)) === null || _renderManagerService === void 0 ? void 0 : _renderManagerService.with(ISheetSelectionRenderService);
|
|
7016
7049
|
selectionService === null || selectionService === void 0 || selectionService.refreshSelectionMoveEnd();
|
|
7017
7050
|
return rs;
|
|
7018
7051
|
}
|
|
@@ -7146,7 +7179,7 @@ function getSheetObject(univerInstanceService, renderManagerService) {
|
|
|
7146
7179
|
const unitId = workbook.getUnitId();
|
|
7147
7180
|
let components, mainComponent, scene, engine;
|
|
7148
7181
|
if (isRenderManagerService(renderManagerService)) {
|
|
7149
|
-
const currentRender = renderManagerService.
|
|
7182
|
+
const currentRender = renderManagerService.getRenderUnitById(unitId);
|
|
7150
7183
|
if (currentRender == null) return null;
|
|
7151
7184
|
components = currentRender.components;
|
|
7152
7185
|
components = currentRender.components;
|
|
@@ -7483,9 +7516,7 @@ let SheetsScrollRenderController = class SheetsScrollRenderController extends _u
|
|
|
7483
7516
|
}
|
|
7484
7517
|
_getFreeze() {
|
|
7485
7518
|
var _this$_sheetSkeletonM4;
|
|
7486
|
-
|
|
7487
|
-
if (snapshot == null) return;
|
|
7488
|
-
return snapshot.freeze;
|
|
7519
|
+
return (_this$_sheetSkeletonM4 = this._sheetSkeletonManagerService.getCurrentParam()) === null || _this$_sheetSkeletonM4 === void 0 ? void 0 : _this$_sheetSkeletonM4.skeleton.worksheet.getFreeze();
|
|
7489
7520
|
}
|
|
7490
7521
|
_getSheetObject() {
|
|
7491
7522
|
return getSheetObject(this._context.unit, this._context);
|
|
@@ -7622,8 +7653,8 @@ const SetScrollOperation = {
|
|
|
7622
7653
|
if (!params) return false;
|
|
7623
7654
|
const { unitId, sheetId, offsetX = 0, offsetY = 0, sheetViewStartColumn, sheetViewStartRow, duration, screenRatioX, screenRatioY } = params;
|
|
7624
7655
|
const renderManagerService = accessor.get(_univerjs_engine_render.IRenderManagerService);
|
|
7625
|
-
const scrollManagerService = renderManagerService.
|
|
7626
|
-
const renderUnit = renderManagerService.
|
|
7656
|
+
const scrollManagerService = renderManagerService.getRenderUnitById(unitId).with(SheetScrollManagerService);
|
|
7657
|
+
const renderUnit = renderManagerService.getRenderUnitById(unitId);
|
|
7627
7658
|
if (!renderUnit) return false;
|
|
7628
7659
|
const engine = renderUnit.engine;
|
|
7629
7660
|
const canvasWidth = engine.width;
|
|
@@ -7660,7 +7691,7 @@ const SetScrollRelativeCommand = {
|
|
|
7660
7691
|
const target = (0, _univerjs_sheets.getSheetCommandTarget)(univerInstanceService);
|
|
7661
7692
|
if (!target) return false;
|
|
7662
7693
|
const { unitId, subUnitId } = target;
|
|
7663
|
-
const currentScroll = renderManagerSrv.
|
|
7694
|
+
const currentScroll = renderManagerSrv.getRenderUnitById(unitId).with(SheetScrollManagerService).getCurrentScrollState();
|
|
7664
7695
|
const { offsetX = 0, offsetY = 0 } = params || {};
|
|
7665
7696
|
const { sheetViewStartRow = 0, sheetViewStartColumn = 0, offsetX: currentOffsetX = 0, offsetY: currentOffsetY = 0 } = currentScroll || {};
|
|
7666
7697
|
return commandService.executeCommand(SetScrollOperation.id, {
|
|
@@ -7688,7 +7719,7 @@ const ScrollCommand = {
|
|
|
7688
7719
|
const target = params.unitId ? getScrollCommandTargetByParams(univerInstanceService, params) : (0, _univerjs_sheets.getSheetCommandTarget)(univerInstanceService);
|
|
7689
7720
|
if (!target) return false;
|
|
7690
7721
|
const { workbook, worksheet, unitId } = target;
|
|
7691
|
-
const renderUnit = renderManagerSrv.
|
|
7722
|
+
const renderUnit = renderManagerSrv.getRenderUnitById(unitId);
|
|
7692
7723
|
if (!renderUnit) return false;
|
|
7693
7724
|
const currentScroll = renderUnit.with(SheetScrollManagerService).getCurrentScrollState();
|
|
7694
7725
|
if (!worksheet) return false;
|
|
@@ -7726,7 +7757,7 @@ const ScrollToCellCommand = {
|
|
|
7726
7757
|
type: _univerjs_core.CommandType.COMMAND,
|
|
7727
7758
|
handler: (accessor, params) => {
|
|
7728
7759
|
const instanceService = accessor.get(_univerjs_core.IUniverInstanceService);
|
|
7729
|
-
return accessor.get(_univerjs_engine_render.IRenderManagerService).
|
|
7760
|
+
return accessor.get(_univerjs_engine_render.IRenderManagerService).getRenderUnitById(instanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET).getUnitId()).with(SheetsScrollRenderController).scrollToRange(params.range, params.forceTop, params.forceLeft);
|
|
7730
7761
|
}
|
|
7731
7762
|
};
|
|
7732
7763
|
/**
|
|
@@ -7780,7 +7811,7 @@ let AutoWidthController = class AutoWidthController extends _univerjs_core.Dispo
|
|
|
7780
7811
|
const target = (0, _univerjs_sheets.getSheetCommandTarget)(univerInstanceService, params);
|
|
7781
7812
|
if (!target) return defaultValue;
|
|
7782
7813
|
const { unitId, subUnitId, worksheet } = target;
|
|
7783
|
-
const sheetSkeletonService = this._renderManagerService.
|
|
7814
|
+
const sheetSkeletonService = this._renderManagerService.getRenderUnitById(unitId).with(SheetSkeletonManagerService);
|
|
7784
7815
|
if (!sheetSkeletonService.getCurrentParam()) return defaultValue;
|
|
7785
7816
|
const { skeleton } = sheetSkeletonService.getCurrentParam();
|
|
7786
7817
|
const colsAutoWidthInfo = skeleton.calculateAutoWidthInRange(params.ranges);
|
|
@@ -7844,6 +7875,162 @@ const SetWorksheetColAutoWidthCommand = {
|
|
|
7844
7875
|
}
|
|
7845
7876
|
};
|
|
7846
7877
|
|
|
7878
|
+
//#endregion
|
|
7879
|
+
//#region src/common/utils.ts
|
|
7880
|
+
function getUserListEqual(userList1, userList2) {
|
|
7881
|
+
if (userList1.length !== userList2.length) return false;
|
|
7882
|
+
const sorted1 = userList1.sort((a, b) => a.id.localeCompare(b.id));
|
|
7883
|
+
const sorted2 = userList2.sort((a, b) => a.id.localeCompare(b.id));
|
|
7884
|
+
return sorted1.every((user, index) => {
|
|
7885
|
+
var _user$subject, _sorted2$index$subjec;
|
|
7886
|
+
return ((_user$subject = user.subject) === null || _user$subject === void 0 ? void 0 : _user$subject.userID) === ((_sorted2$index$subjec = sorted2[index].subject) === null || _sorted2$index$subjec === void 0 ? void 0 : _sorted2$index$subjec.userID) && user.role === sorted2[index].role;
|
|
7887
|
+
});
|
|
7888
|
+
}
|
|
7889
|
+
function checkCellContentInRanges(worksheet, ranges) {
|
|
7890
|
+
return ranges.some((range) => checkCellContentInRange(worksheet, range));
|
|
7891
|
+
}
|
|
7892
|
+
function checkCellContentInRange(worksheet, range) {
|
|
7893
|
+
const { startRow, startColumn, endColumn, endRow } = range;
|
|
7894
|
+
const cellMatrix = worksheet.getMatrixWithMergedCells(startRow, startColumn, endRow, endColumn);
|
|
7895
|
+
let someCellGoingToBeRemoved = false;
|
|
7896
|
+
cellMatrix.forValue((row, col, cellData) => {
|
|
7897
|
+
if (cellData && (row !== startRow || col !== startColumn) && worksheet.cellHasValue(cellData)) {
|
|
7898
|
+
someCellGoingToBeRemoved = true;
|
|
7899
|
+
return false;
|
|
7900
|
+
}
|
|
7901
|
+
});
|
|
7902
|
+
return someCellGoingToBeRemoved;
|
|
7903
|
+
}
|
|
7904
|
+
function getCellIndexByOffsetWithMerge(offsetX, offsetY, scene, skeleton) {
|
|
7905
|
+
const activeViewport = scene.getActiveViewportByCoord(_univerjs_engine_render.Vector2.FromArray([offsetX, offsetY]));
|
|
7906
|
+
if (!activeViewport) return;
|
|
7907
|
+
const { scaleX, scaleY } = scene.getAncestorScale();
|
|
7908
|
+
const scrollXY = {
|
|
7909
|
+
x: activeViewport.viewportScrollX,
|
|
7910
|
+
y: activeViewport.viewportScrollY
|
|
7911
|
+
};
|
|
7912
|
+
const cellIndex = skeleton.getCellIndexByOffset(offsetX, offsetY, scaleX, scaleY, scrollXY);
|
|
7913
|
+
const mergeCell = skeleton.worksheet.getMergedCell(cellIndex.row, cellIndex.column);
|
|
7914
|
+
return {
|
|
7915
|
+
actualRow: mergeCell ? mergeCell.startRow : cellIndex.row,
|
|
7916
|
+
actualCol: mergeCell ? mergeCell.startColumn : cellIndex.column,
|
|
7917
|
+
mergeCell,
|
|
7918
|
+
row: cellIndex.row,
|
|
7919
|
+
col: cellIndex.column
|
|
7920
|
+
};
|
|
7921
|
+
}
|
|
7922
|
+
function getViewportByCell(row, column, scene, worksheet) {
|
|
7923
|
+
const freeze = worksheet.getFreeze();
|
|
7924
|
+
if (!freeze || freeze.startRow <= 0 && freeze.startColumn <= 0) return scene.getViewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_MAIN);
|
|
7925
|
+
if (row >= freeze.startRow && column >= freeze.startColumn) return scene.getViewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_MAIN);
|
|
7926
|
+
if (row < freeze.startRow && column < freeze.startColumn) return scene.getViewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT_TOP);
|
|
7927
|
+
if (row < freeze.startRow && column >= freeze.startColumn) return scene.getViewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_MAIN_TOP);
|
|
7928
|
+
if (row >= freeze.startRow && column < freeze.startColumn) return scene.getViewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT);
|
|
7929
|
+
}
|
|
7930
|
+
function transformBound2OffsetBound(originBound, scene, skeleton, worksheet) {
|
|
7931
|
+
const topLeft = transformPosition2Offset(originBound.left, originBound.top, scene, skeleton, worksheet);
|
|
7932
|
+
const bottomRight = transformPosition2Offset(originBound.right, originBound.bottom, scene, skeleton, worksheet);
|
|
7933
|
+
return {
|
|
7934
|
+
left: topLeft.x,
|
|
7935
|
+
top: topLeft.y,
|
|
7936
|
+
right: bottomRight.x,
|
|
7937
|
+
bottom: bottomRight.y
|
|
7938
|
+
};
|
|
7939
|
+
}
|
|
7940
|
+
function transformPosition2Offset(x, y, scene, skeleton, worksheet) {
|
|
7941
|
+
const { scaleX, scaleY } = scene.getAncestorScale();
|
|
7942
|
+
const viewMain = scene.getViewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_MAIN);
|
|
7943
|
+
if (!viewMain) return {
|
|
7944
|
+
x,
|
|
7945
|
+
y
|
|
7946
|
+
};
|
|
7947
|
+
const { startColumn, startRow, xSplit, ySplit } = worksheet.getFreeze();
|
|
7948
|
+
const startSheetView = skeleton.getNoMergeCellWithCoordByIndex(startRow - ySplit, startColumn - xSplit, false);
|
|
7949
|
+
const endSheetView = skeleton.getNoMergeCellWithCoordByIndex(startRow, startColumn, false);
|
|
7950
|
+
const { rowHeaderWidth, columnHeaderHeight } = skeleton;
|
|
7951
|
+
const freezeWidth = endSheetView.startX - startSheetView.startX;
|
|
7952
|
+
const freezeHeight = endSheetView.startY - startSheetView.startY;
|
|
7953
|
+
const { top, left, viewportScrollX, viewportScrollY } = viewMain;
|
|
7954
|
+
let offsetX;
|
|
7955
|
+
if (x > left) offsetX = (x - viewportScrollX) * scaleX;
|
|
7956
|
+
else offsetX = (freezeWidth + rowHeaderWidth - (left - x)) * scaleX;
|
|
7957
|
+
let offsetY;
|
|
7958
|
+
if (y > top) offsetY = (y - viewportScrollY) * scaleY;
|
|
7959
|
+
else offsetY = (freezeHeight + columnHeaderHeight - (top - y)) * scaleX;
|
|
7960
|
+
return {
|
|
7961
|
+
x: offsetX,
|
|
7962
|
+
y: offsetY
|
|
7963
|
+
};
|
|
7964
|
+
}
|
|
7965
|
+
function getCellRealRange(workbook, worksheet, skeleton, row, col) {
|
|
7966
|
+
let actualRow = row;
|
|
7967
|
+
let actualCol = col;
|
|
7968
|
+
skeleton.overflowCache.forValue((r, c, range) => {
|
|
7969
|
+
if (range.startRow <= actualRow && range.endRow >= actualRow && range.startColumn <= actualCol && range.endColumn >= actualCol) {
|
|
7970
|
+
actualCol = c;
|
|
7971
|
+
actualRow = r;
|
|
7972
|
+
}
|
|
7973
|
+
});
|
|
7974
|
+
const actualCell = skeleton.getCellWithCoordByIndex(actualRow, actualCol);
|
|
7975
|
+
return {
|
|
7976
|
+
unitId: workbook.getUnitId(),
|
|
7977
|
+
subUnitId: worksheet.getSheetId(),
|
|
7978
|
+
workbook,
|
|
7979
|
+
worksheet,
|
|
7980
|
+
row: actualCell.actualRow,
|
|
7981
|
+
col: actualCell.actualColumn
|
|
7982
|
+
};
|
|
7983
|
+
}
|
|
7984
|
+
function getHoverCellPosition(currentRender, workbook, worksheet, skeletonParam, offsetX, offsetY) {
|
|
7985
|
+
const { scene } = currentRender;
|
|
7986
|
+
const unitId = workbook.getUnitId();
|
|
7987
|
+
const { skeleton, sheetId } = skeletonParam;
|
|
7988
|
+
const cellIndex = getCellIndexByOffsetWithMerge(offsetX, offsetY, scene, skeleton);
|
|
7989
|
+
if (!cellIndex) return null;
|
|
7990
|
+
let { actualCol, actualRow } = cellIndex;
|
|
7991
|
+
const originLocation = {
|
|
7992
|
+
unitId,
|
|
7993
|
+
subUnitId: sheetId,
|
|
7994
|
+
workbook,
|
|
7995
|
+
worksheet,
|
|
7996
|
+
row: actualRow,
|
|
7997
|
+
col: actualCol
|
|
7998
|
+
};
|
|
7999
|
+
skeleton.overflowCache.forValue((r, c, range) => {
|
|
8000
|
+
if (range.startRow <= actualRow && range.endRow >= actualRow && range.startColumn <= actualCol && range.endColumn >= actualCol) {
|
|
8001
|
+
actualCol = c;
|
|
8002
|
+
actualRow = r;
|
|
8003
|
+
}
|
|
8004
|
+
});
|
|
8005
|
+
const actualCell = skeleton.getCellWithCoordByIndex(actualRow, actualCol);
|
|
8006
|
+
const location = getCellRealRange(workbook, worksheet, skeleton, actualRow, actualCol);
|
|
8007
|
+
let anchorCell;
|
|
8008
|
+
if (actualCell.mergeInfo) anchorCell = actualCell.mergeInfo;
|
|
8009
|
+
else anchorCell = {
|
|
8010
|
+
startRow: location.row,
|
|
8011
|
+
endRow: location.row,
|
|
8012
|
+
startColumn: location.col,
|
|
8013
|
+
endColumn: location.col
|
|
8014
|
+
};
|
|
8015
|
+
const activeViewport = scene.getActiveViewportByCoord(_univerjs_engine_render.Vector2.FromArray([offsetX, offsetY]));
|
|
8016
|
+
if (!activeViewport) return;
|
|
8017
|
+
const { scaleX, scaleY } = scene.getAncestorScale();
|
|
8018
|
+
const scrollXY = {
|
|
8019
|
+
x: activeViewport.viewportScrollX,
|
|
8020
|
+
y: activeViewport.viewportScrollY
|
|
8021
|
+
};
|
|
8022
|
+
return {
|
|
8023
|
+
position: {
|
|
8024
|
+
startX: (skeleton.getOffsetByColumn(anchorCell.startColumn - 1) - scrollXY.x) * scaleX,
|
|
8025
|
+
endX: (skeleton.getOffsetByColumn(anchorCell.endColumn) - scrollXY.x) * scaleX,
|
|
8026
|
+
startY: (skeleton.getOffsetByRow(anchorCell.startRow - 1) - scrollXY.y) * scaleY,
|
|
8027
|
+
endY: (skeleton.getOffsetByRow(anchorCell.endRow) - scrollXY.y) * scaleY
|
|
8028
|
+
},
|
|
8029
|
+
location: originLocation,
|
|
8030
|
+
overflowLocation: location
|
|
8031
|
+
};
|
|
8032
|
+
}
|
|
8033
|
+
|
|
7847
8034
|
//#endregion
|
|
7848
8035
|
//#region src/services/editor-bridge.service.ts
|
|
7849
8036
|
let EditorBridgeService = class EditorBridgeService extends _univerjs_core.Disposable {
|
|
@@ -7917,15 +8104,16 @@ let EditorBridgeService = class EditorBridgeService extends _univerjs_core.Dispo
|
|
|
7917
8104
|
if (!workbook || workbook.getUnitId() !== unitId) return;
|
|
7918
8105
|
const worksheet = workbook.getActiveSheet();
|
|
7919
8106
|
if (!worksheet || worksheet.getSheetId() !== sheetId) return;
|
|
7920
|
-
|
|
7921
|
-
if (!renderUnit) return;
|
|
8107
|
+
if (!this._renderManagerService.getRenderUnitById(unitId)) return;
|
|
7922
8108
|
const skeleton = this._sheetSkeletonService.getSkeleton(unitId, sheetId);
|
|
7923
8109
|
if (!skeleton) return;
|
|
7924
8110
|
const actualRangeWithCoord = (0, _univerjs_core.convertCellToRange)((0, _univerjs_sheets.attachPrimaryWithCoord)(skeleton, primary));
|
|
7925
8111
|
const canvasOffset = (0, _univerjs_docs_ui.getCanvasOffsetByEngine)(engine);
|
|
7926
8112
|
let { startX, startY, endX, endY } = actualRangeWithCoord;
|
|
7927
8113
|
const { scaleX, scaleY } = scene.getAncestorScale();
|
|
7928
|
-
const
|
|
8114
|
+
const viewport = getViewportByCell(primary.startRow, primary.startColumn, scene, worksheet);
|
|
8115
|
+
if (!viewport) return;
|
|
8116
|
+
const scrollXY = scene.getViewportScrollXY(viewport);
|
|
7929
8117
|
startX = (0, _univerjs_engine_render.convertTransformToOffsetX)(startX, scaleX, scrollXY);
|
|
7930
8118
|
startY = (0, _univerjs_engine_render.convertTransformToOffsetY)(startY, scaleY, scrollXY);
|
|
7931
8119
|
endX = (0, _univerjs_engine_render.convertTransformToOffsetX)(endX, scaleX, scrollXY);
|
|
@@ -8016,8 +8204,7 @@ let EditorBridgeService = class EditorBridgeService extends _univerjs_core.Dispo
|
|
|
8016
8204
|
if (!workbook || workbook.getUnitId() !== unitId) return;
|
|
8017
8205
|
const worksheet = workbook.getActiveSheet();
|
|
8018
8206
|
if (!worksheet || worksheet.getSheetId() !== sheetId) return;
|
|
8019
|
-
|
|
8020
|
-
if (!renderUnit) return;
|
|
8207
|
+
if (!this._renderManagerService.getRenderUnitById(unitId)) return;
|
|
8021
8208
|
const skeleton = this._sheetSkeletonService.getSkeleton(unitId, sheetId);
|
|
8022
8209
|
if (!skeleton) return;
|
|
8023
8210
|
const { startRow, startColumn } = primary;
|
|
@@ -8025,7 +8212,9 @@ let EditorBridgeService = class EditorBridgeService extends _univerjs_core.Dispo
|
|
|
8025
8212
|
const canvasOffset = (0, _univerjs_docs_ui.getCanvasOffsetByEngine)(engine);
|
|
8026
8213
|
let { startX, startY, endX, endY } = actualRangeWithCoord;
|
|
8027
8214
|
const { scaleX, scaleY } = scene.getAncestorScale();
|
|
8028
|
-
const
|
|
8215
|
+
const viewport = getViewportByCell(startRow, startColumn, scene, worksheet);
|
|
8216
|
+
if (!viewport) return;
|
|
8217
|
+
const scrollXY = scene.getViewportScrollXY(viewport);
|
|
8029
8218
|
startX = (0, _univerjs_engine_render.convertTransformToOffsetX)(startX, scaleX, scrollXY);
|
|
8030
8219
|
startY = (0, _univerjs_engine_render.convertTransformToOffsetY)(startY, scaleY, scrollXY);
|
|
8031
8220
|
endX = (0, _univerjs_engine_render.convertTransformToOffsetX)(endX, scaleX, scrollXY);
|
|
@@ -8207,7 +8396,7 @@ const SetZoomRatioOperation = {
|
|
|
8207
8396
|
id: "sheet.operation.set-zoom-ratio",
|
|
8208
8397
|
type: _univerjs_core.CommandType.OPERATION,
|
|
8209
8398
|
handler: (accessor, params) => {
|
|
8210
|
-
const renderUnit = accessor.get(_univerjs_engine_render.IRenderManagerService).
|
|
8399
|
+
const renderUnit = accessor.get(_univerjs_engine_render.IRenderManagerService).getRenderUnitById(params.unitId);
|
|
8211
8400
|
if (!renderUnit) return false;
|
|
8212
8401
|
return renderUnit.with(SheetsZoomRenderController).updateZoom(params.subUnitId, params.zoomRatio);
|
|
8213
8402
|
}
|
|
@@ -8392,7 +8581,6 @@ const SHEETS_UI_PLUGIN_CONFIG_KEY = "sheets-ui.config";
|
|
|
8392
8581
|
const configSymbol = Symbol(SHEETS_UI_PLUGIN_CONFIG_KEY);
|
|
8393
8582
|
const defaultPluginConfig = {
|
|
8394
8583
|
formulaBar: true,
|
|
8395
|
-
statusBarStatistic: true,
|
|
8396
8584
|
protectedRangeShadow: true,
|
|
8397
8585
|
maxAutoHeightCount: 1e3
|
|
8398
8586
|
};
|
|
@@ -8445,8 +8633,6 @@ const SetCellEditVisibleWithF2Operation = {
|
|
|
8445
8633
|
/**
|
|
8446
8634
|
* When the editor is not clicked to change the cursor,
|
|
8447
8635
|
* the arrow keys will exit editing and move the cell.
|
|
8448
|
-
*
|
|
8449
|
-
* @deprecated Should not use operation as an event.
|
|
8450
8636
|
*/
|
|
8451
8637
|
const SetCellEditVisibleArrowOperation = {
|
|
8452
8638
|
id: "sheet.operation.set-cell-edit-visible-arrow",
|
|
@@ -8478,7 +8664,7 @@ const ScrollToRangeOperation = {
|
|
|
8478
8664
|
const renderManagerService = accessor.get(_univerjs_engine_render.IRenderManagerService);
|
|
8479
8665
|
const unitId = (_params$unitId = params.unitId) !== null && _params$unitId !== void 0 ? _params$unitId : (_instanceService$getC = instanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET)) === null || _instanceService$getC === void 0 ? void 0 : _instanceService$getC.getUnitId();
|
|
8480
8666
|
if (!unitId) return false;
|
|
8481
|
-
const renderUnit = renderManagerService.
|
|
8667
|
+
const renderUnit = renderManagerService.getRenderUnitById(unitId);
|
|
8482
8668
|
if (!renderUnit) return false;
|
|
8483
8669
|
return renderUnit.with(SheetsScrollRenderController).scrollToRange(params.range, params.forceTop, params.forceLeft);
|
|
8484
8670
|
}
|
|
@@ -8494,224 +8680,63 @@ const SheetPermissionOpenDialogOperation = {
|
|
|
8494
8680
|
dialogService.close("DESKTOP_FIND_REPLACE_DIALOG");
|
|
8495
8681
|
dialogService.open({
|
|
8496
8682
|
id: UNIVER_SHEET_PERMISSION_DIALOG_ID,
|
|
8497
|
-
title: { title: "sheets-ui.permission.dialog.allowedPermissionType" },
|
|
8498
|
-
children: { label: UNIVER_SHEET_PERMISSION_DIALOG },
|
|
8499
|
-
width: 393,
|
|
8500
|
-
|
|
8501
|
-
|
|
8502
|
-
|
|
8503
|
-
|
|
8504
|
-
|
|
8505
|
-
|
|
8506
|
-
|
|
8507
|
-
//#
|
|
8508
|
-
|
|
8509
|
-
|
|
8510
|
-
*
|
|
8511
|
-
*
|
|
8512
|
-
*
|
|
8513
|
-
*
|
|
8514
|
-
*
|
|
8515
|
-
*
|
|
8516
|
-
*
|
|
8517
|
-
*
|
|
8518
|
-
*
|
|
8519
|
-
*
|
|
8520
|
-
*
|
|
8521
|
-
*
|
|
8522
|
-
|
|
8523
|
-
|
|
8524
|
-
|
|
8525
|
-
|
|
8526
|
-
//#
|
|
8527
|
-
|
|
8528
|
-
|
|
8529
|
-
|
|
8530
|
-
|
|
8531
|
-
|
|
8532
|
-
|
|
8533
|
-
accessor.get(
|
|
8534
|
-
const
|
|
8535
|
-
|
|
8536
|
-
|
|
8537
|
-
|
|
8538
|
-
|
|
8539
|
-
|
|
8540
|
-
|
|
8541
|
-
|
|
8542
|
-
|
|
8543
|
-
|
|
8544
|
-
|
|
8545
|
-
|
|
8546
|
-
|
|
8547
|
-
|
|
8548
|
-
|
|
8549
|
-
|
|
8550
|
-
});
|
|
8551
|
-
break;
|
|
8552
|
-
default:
|
|
8553
|
-
sidebarService.close();
|
|
8554
|
-
break;
|
|
8555
|
-
}
|
|
8556
|
-
return true;
|
|
8557
|
-
}
|
|
8558
|
-
};
|
|
8559
|
-
|
|
8560
|
-
//#endregion
|
|
8561
|
-
//#region src/common/utils.ts
|
|
8562
|
-
function getUserListEqual(userList1, userList2) {
|
|
8563
|
-
if (userList1.length !== userList2.length) return false;
|
|
8564
|
-
const sorted1 = userList1.sort((a, b) => a.id.localeCompare(b.id));
|
|
8565
|
-
const sorted2 = userList2.sort((a, b) => a.id.localeCompare(b.id));
|
|
8566
|
-
return sorted1.every((user, index) => {
|
|
8567
|
-
var _user$subject, _sorted2$index$subjec;
|
|
8568
|
-
return ((_user$subject = user.subject) === null || _user$subject === void 0 ? void 0 : _user$subject.userID) === ((_sorted2$index$subjec = sorted2[index].subject) === null || _sorted2$index$subjec === void 0 ? void 0 : _sorted2$index$subjec.userID) && user.role === sorted2[index].role;
|
|
8569
|
-
});
|
|
8570
|
-
}
|
|
8571
|
-
function checkCellContentInRanges(worksheet, ranges) {
|
|
8572
|
-
return ranges.some((range) => checkCellContentInRange(worksheet, range));
|
|
8573
|
-
}
|
|
8574
|
-
function checkCellContentInRange(worksheet, range) {
|
|
8575
|
-
const { startRow, startColumn, endColumn, endRow } = range;
|
|
8576
|
-
const cellMatrix = worksheet.getMatrixWithMergedCells(startRow, startColumn, endRow, endColumn);
|
|
8577
|
-
let someCellGoingToBeRemoved = false;
|
|
8578
|
-
cellMatrix.forValue((row, col, cellData) => {
|
|
8579
|
-
if (cellData && (row !== startRow || col !== startColumn) && worksheet.cellHasValue(cellData)) {
|
|
8580
|
-
someCellGoingToBeRemoved = true;
|
|
8581
|
-
return false;
|
|
8582
|
-
}
|
|
8583
|
-
});
|
|
8584
|
-
return someCellGoingToBeRemoved;
|
|
8585
|
-
}
|
|
8586
|
-
function getCellIndexByOffsetWithMerge(offsetX, offsetY, scene, skeleton) {
|
|
8587
|
-
const activeViewport = scene.getActiveViewportByCoord(_univerjs_engine_render.Vector2.FromArray([offsetX, offsetY]));
|
|
8588
|
-
if (!activeViewport) return;
|
|
8589
|
-
const { scaleX, scaleY } = scene.getAncestorScale();
|
|
8590
|
-
const scrollXY = {
|
|
8591
|
-
x: activeViewport.viewportScrollX,
|
|
8592
|
-
y: activeViewport.viewportScrollY
|
|
8593
|
-
};
|
|
8594
|
-
const cellIndex = skeleton.getCellIndexByOffset(offsetX, offsetY, scaleX, scaleY, scrollXY);
|
|
8595
|
-
const mergeCell = skeleton.worksheet.getMergedCell(cellIndex.row, cellIndex.column);
|
|
8596
|
-
return {
|
|
8597
|
-
actualRow: mergeCell ? mergeCell.startRow : cellIndex.row,
|
|
8598
|
-
actualCol: mergeCell ? mergeCell.startColumn : cellIndex.column,
|
|
8599
|
-
mergeCell,
|
|
8600
|
-
row: cellIndex.row,
|
|
8601
|
-
col: cellIndex.column
|
|
8602
|
-
};
|
|
8603
|
-
}
|
|
8604
|
-
function getViewportByCell(row, column, scene, worksheet) {
|
|
8605
|
-
const freeze = worksheet.getFreeze();
|
|
8606
|
-
if (!freeze || freeze.startRow <= 0 && freeze.startColumn <= 0) return scene.getViewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_MAIN);
|
|
8607
|
-
if (row >= freeze.startRow && column >= freeze.startColumn) return scene.getViewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_MAIN);
|
|
8608
|
-
if (row < freeze.startRow && column < freeze.startColumn) return scene.getViewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT_TOP);
|
|
8609
|
-
if (row < freeze.startRow && column >= freeze.startColumn) return scene.getViewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_MAIN_TOP);
|
|
8610
|
-
if (row >= freeze.startRow && column < freeze.startColumn) return scene.getViewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT);
|
|
8611
|
-
}
|
|
8612
|
-
function transformBound2OffsetBound(originBound, scene, skeleton, worksheet) {
|
|
8613
|
-
const topLeft = transformPosition2Offset(originBound.left, originBound.top, scene, skeleton, worksheet);
|
|
8614
|
-
const bottomRight = transformPosition2Offset(originBound.right, originBound.bottom, scene, skeleton, worksheet);
|
|
8615
|
-
return {
|
|
8616
|
-
left: topLeft.x,
|
|
8617
|
-
top: topLeft.y,
|
|
8618
|
-
right: bottomRight.x,
|
|
8619
|
-
bottom: bottomRight.y
|
|
8620
|
-
};
|
|
8621
|
-
}
|
|
8622
|
-
function transformPosition2Offset(x, y, scene, skeleton, worksheet) {
|
|
8623
|
-
const { scaleX, scaleY } = scene.getAncestorScale();
|
|
8624
|
-
const viewMain = scene.getViewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_MAIN);
|
|
8625
|
-
if (!viewMain) return {
|
|
8626
|
-
x,
|
|
8627
|
-
y
|
|
8628
|
-
};
|
|
8629
|
-
const { startColumn, startRow, xSplit, ySplit } = worksheet.getFreeze();
|
|
8630
|
-
const startSheetView = skeleton.getNoMergeCellWithCoordByIndex(startRow - ySplit, startColumn - xSplit, false);
|
|
8631
|
-
const endSheetView = skeleton.getNoMergeCellWithCoordByIndex(startRow, startColumn, false);
|
|
8632
|
-
const { rowHeaderWidth, columnHeaderHeight } = skeleton;
|
|
8633
|
-
const freezeWidth = endSheetView.startX - startSheetView.startX;
|
|
8634
|
-
const freezeHeight = endSheetView.startY - startSheetView.startY;
|
|
8635
|
-
const { top, left, viewportScrollX, viewportScrollY } = viewMain;
|
|
8636
|
-
let offsetX;
|
|
8637
|
-
if (x > left) offsetX = (x - viewportScrollX) * scaleX;
|
|
8638
|
-
else offsetX = (freezeWidth + rowHeaderWidth - (left - x)) * scaleX;
|
|
8639
|
-
let offsetY;
|
|
8640
|
-
if (y > top) offsetY = (y - viewportScrollY) * scaleY;
|
|
8641
|
-
else offsetY = (freezeHeight + columnHeaderHeight - (top - y)) * scaleX;
|
|
8642
|
-
return {
|
|
8643
|
-
x: offsetX,
|
|
8644
|
-
y: offsetY
|
|
8645
|
-
};
|
|
8646
|
-
}
|
|
8647
|
-
function getCellRealRange(workbook, worksheet, skeleton, row, col) {
|
|
8648
|
-
let actualRow = row;
|
|
8649
|
-
let actualCol = col;
|
|
8650
|
-
skeleton.overflowCache.forValue((r, c, range) => {
|
|
8651
|
-
if (range.startRow <= actualRow && range.endRow >= actualRow && range.startColumn <= actualCol && range.endColumn >= actualCol) {
|
|
8652
|
-
actualCol = c;
|
|
8653
|
-
actualRow = r;
|
|
8654
|
-
}
|
|
8655
|
-
});
|
|
8656
|
-
const actualCell = skeleton.getCellWithCoordByIndex(actualRow, actualCol);
|
|
8657
|
-
return {
|
|
8658
|
-
unitId: workbook.getUnitId(),
|
|
8659
|
-
subUnitId: worksheet.getSheetId(),
|
|
8660
|
-
workbook,
|
|
8661
|
-
worksheet,
|
|
8662
|
-
row: actualCell.actualRow,
|
|
8663
|
-
col: actualCell.actualColumn
|
|
8664
|
-
};
|
|
8665
|
-
}
|
|
8666
|
-
function getHoverCellPosition(currentRender, workbook, worksheet, skeletonParam, offsetX, offsetY) {
|
|
8667
|
-
const { scene } = currentRender;
|
|
8668
|
-
const unitId = workbook.getUnitId();
|
|
8669
|
-
const { skeleton, sheetId } = skeletonParam;
|
|
8670
|
-
const cellIndex = getCellIndexByOffsetWithMerge(offsetX, offsetY, scene, skeleton);
|
|
8671
|
-
if (!cellIndex) return null;
|
|
8672
|
-
let { actualCol, actualRow } = cellIndex;
|
|
8673
|
-
const originLocation = {
|
|
8674
|
-
unitId,
|
|
8675
|
-
subUnitId: sheetId,
|
|
8676
|
-
workbook,
|
|
8677
|
-
worksheet,
|
|
8678
|
-
row: actualRow,
|
|
8679
|
-
col: actualCol
|
|
8680
|
-
};
|
|
8681
|
-
skeleton.overflowCache.forValue((r, c, range) => {
|
|
8682
|
-
if (range.startRow <= actualRow && range.endRow >= actualRow && range.startColumn <= actualCol && range.endColumn >= actualCol) {
|
|
8683
|
-
actualCol = c;
|
|
8684
|
-
actualRow = r;
|
|
8683
|
+
title: { title: "sheets-ui.permission.dialog.allowedPermissionType" },
|
|
8684
|
+
children: { label: UNIVER_SHEET_PERMISSION_DIALOG },
|
|
8685
|
+
width: 393,
|
|
8686
|
+
onClose: () => dialogService.close(UNIVER_SHEET_PERMISSION_DIALOG_ID)
|
|
8687
|
+
});
|
|
8688
|
+
return true;
|
|
8689
|
+
}
|
|
8690
|
+
};
|
|
8691
|
+
|
|
8692
|
+
//#endregion
|
|
8693
|
+
//#region src/views/defined-name/component-name.ts
|
|
8694
|
+
/**
|
|
8695
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
8696
|
+
*
|
|
8697
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8698
|
+
* you may not use this file except in compliance with the License.
|
|
8699
|
+
* You may obtain a copy of the License at
|
|
8700
|
+
*
|
|
8701
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8702
|
+
*
|
|
8703
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
8704
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
8705
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8706
|
+
* See the License for the specific language governing permissions and
|
|
8707
|
+
* limitations under the License.
|
|
8708
|
+
*/
|
|
8709
|
+
const DEFINED_NAME_CONTAINER = "DefinedNameContainer";
|
|
8710
|
+
|
|
8711
|
+
//#endregion
|
|
8712
|
+
//#region src/commands/operations/sidebar-defined-name.operation.ts
|
|
8713
|
+
const SidebarDefinedNameOperation = {
|
|
8714
|
+
id: "sidebar.operation.defined-name",
|
|
8715
|
+
type: _univerjs_core.CommandType.COMMAND,
|
|
8716
|
+
handler: async (accessor, params) => {
|
|
8717
|
+
const sidebarService = accessor.get(_univerjs_ui.ISidebarService);
|
|
8718
|
+
accessor.get(_univerjs_docs_ui.IEditorService);
|
|
8719
|
+
const localeService = accessor.get(_univerjs_core.LocaleService);
|
|
8720
|
+
const target = (0, _univerjs_sheets.getSheetCommandTarget)(accessor.get(_univerjs_core.IUniverInstanceService));
|
|
8721
|
+
if (!target) return false;
|
|
8722
|
+
const { unitId } = target;
|
|
8723
|
+
switch (params.value) {
|
|
8724
|
+
case "open":
|
|
8725
|
+
sidebarService.open({
|
|
8726
|
+
id: DEFINED_NAME_CONTAINER,
|
|
8727
|
+
header: { title: localeService.t("sheets-ui.definedName.featureTitle") },
|
|
8728
|
+
children: { label: DEFINED_NAME_CONTAINER },
|
|
8729
|
+
onClose: () => {},
|
|
8730
|
+
width: 333
|
|
8731
|
+
});
|
|
8732
|
+
break;
|
|
8733
|
+
default:
|
|
8734
|
+
sidebarService.close();
|
|
8735
|
+
break;
|
|
8685
8736
|
}
|
|
8686
|
-
|
|
8687
|
-
|
|
8688
|
-
|
|
8689
|
-
let anchorCell;
|
|
8690
|
-
if (actualCell.mergeInfo) anchorCell = actualCell.mergeInfo;
|
|
8691
|
-
else anchorCell = {
|
|
8692
|
-
startRow: location.row,
|
|
8693
|
-
endRow: location.row,
|
|
8694
|
-
startColumn: location.col,
|
|
8695
|
-
endColumn: location.col
|
|
8696
|
-
};
|
|
8697
|
-
const activeViewport = scene.getActiveViewportByCoord(_univerjs_engine_render.Vector2.FromArray([offsetX, offsetY]));
|
|
8698
|
-
if (!activeViewport) return;
|
|
8699
|
-
const { scaleX, scaleY } = scene.getAncestorScale();
|
|
8700
|
-
const scrollXY = {
|
|
8701
|
-
x: activeViewport.viewportScrollX,
|
|
8702
|
-
y: activeViewport.viewportScrollY
|
|
8703
|
-
};
|
|
8704
|
-
return {
|
|
8705
|
-
position: {
|
|
8706
|
-
startX: (skeleton.getOffsetByColumn(anchorCell.startColumn - 1) - scrollXY.x) * scaleX,
|
|
8707
|
-
endX: (skeleton.getOffsetByColumn(anchorCell.endColumn) - scrollXY.x) * scaleX,
|
|
8708
|
-
startY: (skeleton.getOffsetByRow(anchorCell.startRow - 1) - scrollXY.y) * scaleY,
|
|
8709
|
-
endY: (skeleton.getOffsetByRow(anchorCell.endRow) - scrollXY.y) * scaleY
|
|
8710
|
-
},
|
|
8711
|
-
location: originLocation,
|
|
8712
|
-
overflowLocation: location
|
|
8713
|
-
};
|
|
8714
|
-
}
|
|
8737
|
+
return true;
|
|
8738
|
+
}
|
|
8739
|
+
};
|
|
8715
8740
|
|
|
8716
8741
|
//#endregion
|
|
8717
8742
|
//#region src/consts/plugin-name.ts
|
|
@@ -8828,21 +8853,18 @@ SheetsRenderService = __decorate([
|
|
|
8828
8853
|
//#endregion
|
|
8829
8854
|
//#region src/controllers/auto-fill-ui.controller.ts
|
|
8830
8855
|
let AutoFillUIController = class AutoFillUIController extends _univerjs_core.Disposable {
|
|
8831
|
-
constructor(_univerInstanceService, _commandService, _autoFillService, _autoFillController,
|
|
8856
|
+
constructor(_univerInstanceService, _commandService, _autoFillService, _autoFillController, _sheetsRenderService) {
|
|
8832
8857
|
super();
|
|
8833
8858
|
this._univerInstanceService = _univerInstanceService;
|
|
8834
8859
|
this._commandService = _commandService;
|
|
8835
8860
|
this._autoFillService = _autoFillService;
|
|
8836
8861
|
this._autoFillController = _autoFillController;
|
|
8837
|
-
this._editorBridgeService = _editorBridgeService;
|
|
8838
|
-
this._renderManagerService = _renderManagerService;
|
|
8839
8862
|
this._sheetsRenderService = _sheetsRenderService;
|
|
8840
8863
|
_defineProperty(this, "_currentLocation", null);
|
|
8841
8864
|
this._init();
|
|
8842
8865
|
}
|
|
8843
8866
|
_init() {
|
|
8844
8867
|
this._initDefaultHook();
|
|
8845
|
-
this._initSelectionControlFillChanged();
|
|
8846
8868
|
this._initQuitListener();
|
|
8847
8869
|
this._initSkeletonChange();
|
|
8848
8870
|
}
|
|
@@ -8897,127 +8919,120 @@ let AutoFillUIController = class AutoFillUIController extends _univerjs_core.Dis
|
|
|
8897
8919
|
this._autoFillController.quit();
|
|
8898
8920
|
this._autoFillService.setShowMenu(false);
|
|
8899
8921
|
}
|
|
8922
|
+
};
|
|
8923
|
+
AutoFillUIController = __decorate([
|
|
8924
|
+
__decorateParam(0, _univerjs_core.IUniverInstanceService),
|
|
8925
|
+
__decorateParam(1, _univerjs_core.ICommandService),
|
|
8926
|
+
__decorateParam(2, _univerjs_sheets.IAutoFillService),
|
|
8927
|
+
__decorateParam(3, (0, _univerjs_core.Inject)(_univerjs_sheets.AutoFillController)),
|
|
8928
|
+
__decorateParam(4, (0, _univerjs_core.Inject)(SheetsRenderService))
|
|
8929
|
+
], AutoFillUIController);
|
|
8930
|
+
let AutoFillRenderController = class AutoFillRenderController extends _univerjs_core.Disposable {
|
|
8931
|
+
constructor(_context, _selectionRenderService, _selectionManagerService, _commandService, _editorBridgeService) {
|
|
8932
|
+
super();
|
|
8933
|
+
this._context = _context;
|
|
8934
|
+
this._selectionRenderService = _selectionRenderService;
|
|
8935
|
+
this._selectionManagerService = _selectionManagerService;
|
|
8936
|
+
this._commandService = _commandService;
|
|
8937
|
+
this._editorBridgeService = _editorBridgeService;
|
|
8938
|
+
_defineProperty(this, "_selectionControlDisposables", new _univerjs_core.DisposableCollection());
|
|
8939
|
+
this._initSelectionControlFillChanged();
|
|
8940
|
+
}
|
|
8941
|
+
dispose() {
|
|
8942
|
+
this._selectionControlDisposables.dispose();
|
|
8943
|
+
super.dispose();
|
|
8944
|
+
}
|
|
8900
8945
|
_initSelectionControlFillChanged() {
|
|
8901
|
-
|
|
8902
|
-
|
|
8903
|
-
|
|
8904
|
-
const scheduleUpdateListener = (listener) => {
|
|
8905
|
-
if (pendingRetry) return;
|
|
8906
|
-
pendingRetry = true;
|
|
8907
|
-
setTimeout(() => {
|
|
8908
|
-
pendingRetry = false;
|
|
8909
|
-
listener();
|
|
8910
|
-
}, 0);
|
|
8911
|
-
};
|
|
8912
|
-
const updateListener = () => {
|
|
8913
|
-
disposableCollection.dispose();
|
|
8914
|
-
const currentRenderer = (0, _univerjs_engine_render.getCurrentTypeOfRenderer)(_univerjs_core.UniverInstanceType.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService);
|
|
8915
|
-
if (!currentRenderer) return;
|
|
8916
|
-
const selectionRenderService = getResolvedSelectionRenderService(currentRenderer);
|
|
8917
|
-
if (!selectionRenderService) {
|
|
8918
|
-
retryCount += 1;
|
|
8919
|
-
if (retryCount <= 3) scheduleUpdateListener(updateListener);
|
|
8920
|
-
return;
|
|
8921
|
-
}
|
|
8922
|
-
retryCount = 0;
|
|
8923
|
-
selectionRenderService.getSelectionControls().forEach((controlSelection) => {
|
|
8924
|
-
disposableCollection.add(controlSelection.selectionFilled$.subscribe((filled) => {
|
|
8925
|
-
if (filled == null || filled.startColumn === -1 || filled.startRow === -1 || filled.endColumn === -1 || filled.endRow === -1) return;
|
|
8926
|
-
const source = {
|
|
8927
|
-
startColumn: controlSelection.model.startColumn,
|
|
8928
|
-
endColumn: controlSelection.model.endColumn,
|
|
8929
|
-
startRow: controlSelection.model.startRow,
|
|
8930
|
-
endRow: controlSelection.model.endRow
|
|
8931
|
-
};
|
|
8932
|
-
const selection = {
|
|
8933
|
-
startColumn: filled.startColumn,
|
|
8934
|
-
endColumn: filled.endColumn,
|
|
8935
|
-
startRow: filled.startRow,
|
|
8936
|
-
endRow: filled.endRow
|
|
8937
|
-
};
|
|
8938
|
-
this._commandService.executeCommand(_univerjs_sheets.AutoFillCommand.id, {
|
|
8939
|
-
sourceRange: source,
|
|
8940
|
-
targetRange: selection
|
|
8941
|
-
});
|
|
8942
|
-
}));
|
|
8943
|
-
disposableCollection.add(controlSelection.fillControl.onDblclick$.subscribeEvent(() => {
|
|
8944
|
-
const source = {
|
|
8945
|
-
startColumn: controlSelection.model.startColumn,
|
|
8946
|
-
endColumn: controlSelection.model.endColumn,
|
|
8947
|
-
startRow: controlSelection.model.startRow,
|
|
8948
|
-
endRow: controlSelection.model.endRow
|
|
8949
|
-
};
|
|
8950
|
-
this._handleDbClickFill(source);
|
|
8951
|
-
}));
|
|
8952
|
-
disposableCollection.add(controlSelection.fillControl.onPointerDown$.subscribeEvent(() => {
|
|
8953
|
-
if (this._editorBridgeService.isVisible().visible) this._commandService.syncExecuteCommand(SetCellEditVisibleOperation.id, {
|
|
8954
|
-
visible: false,
|
|
8955
|
-
eventType: _univerjs_engine_render.DeviceInputEventType.PointerDown,
|
|
8956
|
-
unitId: currentRenderer.unitId
|
|
8957
|
-
});
|
|
8958
|
-
}));
|
|
8959
|
-
});
|
|
8960
|
-
};
|
|
8961
|
-
scheduleUpdateListener(updateListener);
|
|
8962
|
-
this.disposeWithMe(this._commandService.onCommandExecuted((command) => {
|
|
8963
|
-
if (command.id === _univerjs_sheets.SetSelectionsOperation.id) scheduleUpdateListener(updateListener);
|
|
8946
|
+
this._updateSelectionControlListeners();
|
|
8947
|
+
this.disposeWithMe(this._selectionManagerService.selectionChanged$.subscribe(() => {
|
|
8948
|
+
this._updateSelectionControlListeners();
|
|
8964
8949
|
}));
|
|
8965
|
-
this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(_univerjs_core.UniverInstanceType.UNIVER_SHEET).subscribe(() => scheduleUpdateListener(updateListener)));
|
|
8966
8950
|
}
|
|
8967
|
-
|
|
8968
|
-
|
|
8969
|
-
|
|
8951
|
+
_updateSelectionControlListeners() {
|
|
8952
|
+
this._selectionControlDisposables.dispose();
|
|
8953
|
+
this._selectionRenderService.getSelectionControls().forEach((controlSelection) => {
|
|
8954
|
+
this._selectionControlDisposables.add(controlSelection.selectionFilled$.subscribe((filled) => {
|
|
8955
|
+
if (filled == null || filled.startColumn === -1 || filled.startRow === -1 || filled.endColumn === -1 || filled.endRow === -1) return;
|
|
8956
|
+
const sourceRange = {
|
|
8957
|
+
startColumn: controlSelection.model.startColumn,
|
|
8958
|
+
endColumn: controlSelection.model.endColumn,
|
|
8959
|
+
startRow: controlSelection.model.startRow,
|
|
8960
|
+
endRow: controlSelection.model.endRow
|
|
8961
|
+
};
|
|
8962
|
+
const targetRange = {
|
|
8963
|
+
startColumn: filled.startColumn,
|
|
8964
|
+
endColumn: filled.endColumn,
|
|
8965
|
+
startRow: filled.startRow,
|
|
8966
|
+
endRow: filled.endRow
|
|
8967
|
+
};
|
|
8968
|
+
this._executeAutoFill(sourceRange, targetRange);
|
|
8969
|
+
}));
|
|
8970
|
+
this._selectionControlDisposables.add(controlSelection.fillControl.onDblclick$.subscribeEvent(() => {
|
|
8971
|
+
const sourceRange = {
|
|
8972
|
+
startColumn: controlSelection.model.startColumn,
|
|
8973
|
+
endColumn: controlSelection.model.endColumn,
|
|
8974
|
+
startRow: controlSelection.model.startRow,
|
|
8975
|
+
endRow: controlSelection.model.endRow
|
|
8976
|
+
};
|
|
8977
|
+
this._handleDbClickFill(sourceRange);
|
|
8978
|
+
}));
|
|
8979
|
+
this._selectionControlDisposables.add(controlSelection.fillControl.onPointerDown$.subscribeEvent(() => {
|
|
8980
|
+
if (this._editorBridgeService.isVisible().visible) this._commandService.syncExecuteCommand(SetCellEditVisibleOperation.id, {
|
|
8981
|
+
visible: false,
|
|
8982
|
+
eventType: _univerjs_engine_render.DeviceInputEventType.PointerDown,
|
|
8983
|
+
unitId: this._context.unitId
|
|
8984
|
+
});
|
|
8985
|
+
}));
|
|
8986
|
+
});
|
|
8987
|
+
}
|
|
8988
|
+
_executeAutoFill(sourceRange, targetRange) {
|
|
8989
|
+
const subUnitId = this._context.unit.getActiveSheet().getSheetId();
|
|
8970
8990
|
this._commandService.executeCommand(_univerjs_sheets.AutoFillCommand.id, {
|
|
8971
|
-
sourceRange
|
|
8972
|
-
targetRange
|
|
8991
|
+
sourceRange,
|
|
8992
|
+
targetRange,
|
|
8993
|
+
unitId: this._context.unitId,
|
|
8994
|
+
subUnitId
|
|
8973
8995
|
});
|
|
8974
8996
|
}
|
|
8975
|
-
|
|
8976
|
-
|
|
8977
|
-
|
|
8978
|
-
|
|
8979
|
-
if (!worksheet) return source;
|
|
8980
|
-
const matrix = worksheet.getCellMatrix();
|
|
8981
|
-
const maxRow = worksheet.getMaxRows();
|
|
8982
|
-
const maxColumn = worksheet.getMaxColumns();
|
|
8983
|
-
let detectEndRow = endRow + 1;
|
|
8984
|
-
if (startColumn > 0 && ((_matrix$getValue = matrix.getValue(detectEndRow, startColumn - 1)) === null || _matrix$getValue === void 0 ? void 0 : _matrix$getValue.v) != null) {
|
|
8985
|
-
var _matrix$getValue2;
|
|
8986
|
-
while (((_matrix$getValue2 = matrix.getValue(detectEndRow + 1, startColumn - 1)) === null || _matrix$getValue2 === void 0 ? void 0 : _matrix$getValue2.v) != null && detectEndRow < maxRow) detectEndRow += 1;
|
|
8987
|
-
} else if (endColumn < maxColumn - 1 && ((_matrix$getValue3 = matrix.getValue(detectEndRow, endColumn + 1)) === null || _matrix$getValue3 === void 0 ? void 0 : _matrix$getValue3.v) != null) {
|
|
8988
|
-
var _matrix$getValue4;
|
|
8989
|
-
while (((_matrix$getValue4 = matrix.getValue(detectEndRow + 1, endColumn + 1)) === null || _matrix$getValue4 === void 0 ? void 0 : _matrix$getValue4.v) != null && detectEndRow < maxRow) detectEndRow += 1;
|
|
8990
|
-
} else detectEndRow = endRow;
|
|
8991
|
-
for (let i = endRow + 1; i <= detectEndRow; i++) for (let j = startColumn; j <= endColumn; j++) {
|
|
8992
|
-
var _matrix$getValue5;
|
|
8993
|
-
if (((_matrix$getValue5 = matrix.getValue(i, j)) === null || _matrix$getValue5 === void 0 ? void 0 : _matrix$getValue5.v) != null) {
|
|
8994
|
-
detectEndRow = i - 1;
|
|
8995
|
-
break;
|
|
8996
|
-
}
|
|
8997
|
-
}
|
|
8998
|
-
return {
|
|
8999
|
-
startColumn,
|
|
9000
|
-
endColumn,
|
|
9001
|
-
startRow,
|
|
9002
|
-
endRow: detectEndRow
|
|
9003
|
-
};
|
|
8997
|
+
_handleDbClickFill(source) {
|
|
8998
|
+
const selection = detectAutoFillRange(source, this._context.unit.getActiveSheet());
|
|
8999
|
+
if (selection.endRow <= source.endRow) return;
|
|
9000
|
+
this._executeAutoFill(source, selection);
|
|
9004
9001
|
}
|
|
9005
9002
|
};
|
|
9006
|
-
|
|
9007
|
-
__decorateParam(0, _univerjs_core.
|
|
9008
|
-
__decorateParam(
|
|
9009
|
-
__decorateParam(
|
|
9010
|
-
__decorateParam(
|
|
9011
|
-
|
|
9012
|
-
|
|
9013
|
-
|
|
9014
|
-
|
|
9015
|
-
|
|
9016
|
-
|
|
9017
|
-
const
|
|
9018
|
-
|
|
9019
|
-
if (
|
|
9020
|
-
|
|
9003
|
+
AutoFillRenderController = __decorate([
|
|
9004
|
+
__decorateParam(1, (0, _univerjs_core.Inject)(ISheetSelectionRenderService)),
|
|
9005
|
+
__decorateParam(2, (0, _univerjs_core.Inject)(_univerjs_sheets.SheetsSelectionsService)),
|
|
9006
|
+
__decorateParam(3, _univerjs_core.ICommandService),
|
|
9007
|
+
__decorateParam(4, IEditorBridgeService)
|
|
9008
|
+
], AutoFillRenderController);
|
|
9009
|
+
function detectAutoFillRange(source, worksheet) {
|
|
9010
|
+
var _matrix$getValue, _matrix$getValue3;
|
|
9011
|
+
const { startRow, endRow, startColumn, endColumn } = source;
|
|
9012
|
+
const matrix = worksheet.getCellMatrix();
|
|
9013
|
+
const maxRow = worksheet.getMaxRows();
|
|
9014
|
+
const maxColumn = worksheet.getMaxColumns();
|
|
9015
|
+
let detectEndRow = endRow + 1;
|
|
9016
|
+
if (startColumn > 0 && ((_matrix$getValue = matrix.getValue(detectEndRow, startColumn - 1)) === null || _matrix$getValue === void 0 ? void 0 : _matrix$getValue.v) != null) {
|
|
9017
|
+
var _matrix$getValue2;
|
|
9018
|
+
while (((_matrix$getValue2 = matrix.getValue(detectEndRow + 1, startColumn - 1)) === null || _matrix$getValue2 === void 0 ? void 0 : _matrix$getValue2.v) != null && detectEndRow < maxRow) detectEndRow += 1;
|
|
9019
|
+
} else if (endColumn < maxColumn - 1 && ((_matrix$getValue3 = matrix.getValue(detectEndRow, endColumn + 1)) === null || _matrix$getValue3 === void 0 ? void 0 : _matrix$getValue3.v) != null) {
|
|
9020
|
+
var _matrix$getValue4;
|
|
9021
|
+
while (((_matrix$getValue4 = matrix.getValue(detectEndRow + 1, endColumn + 1)) === null || _matrix$getValue4 === void 0 ? void 0 : _matrix$getValue4.v) != null && detectEndRow < maxRow) detectEndRow += 1;
|
|
9022
|
+
} else detectEndRow = endRow;
|
|
9023
|
+
for (let i = endRow + 1; i <= detectEndRow; i++) for (let j = startColumn; j <= endColumn; j++) {
|
|
9024
|
+
var _matrix$getValue5;
|
|
9025
|
+
if (((_matrix$getValue5 = matrix.getValue(i, j)) === null || _matrix$getValue5 === void 0 ? void 0 : _matrix$getValue5.v) != null) {
|
|
9026
|
+
detectEndRow = i - 1;
|
|
9027
|
+
break;
|
|
9028
|
+
}
|
|
9029
|
+
}
|
|
9030
|
+
return {
|
|
9031
|
+
startColumn,
|
|
9032
|
+
endColumn,
|
|
9033
|
+
startRow,
|
|
9034
|
+
endRow: detectEndRow
|
|
9035
|
+
};
|
|
9021
9036
|
}
|
|
9022
9037
|
|
|
9023
9038
|
//#endregion
|
|
@@ -9074,7 +9089,7 @@ let AutoHeightController = class AutoHeightController extends _univerjs_core.Dis
|
|
|
9074
9089
|
subUnitId = worksheet.getSheetId();
|
|
9075
9090
|
}
|
|
9076
9091
|
}
|
|
9077
|
-
const skeleton = this._renderManagerService.
|
|
9092
|
+
const skeleton = this._renderManagerService.getRenderUnitById(unitId).with(SheetSkeletonManagerService).ensureSkeleton(subUnitId);
|
|
9078
9093
|
if (!skeleton) return {
|
|
9079
9094
|
redos: [],
|
|
9080
9095
|
undos: []
|
|
@@ -9140,7 +9155,7 @@ let CellCustomRenderController = class CellCustomRenderController extends _unive
|
|
|
9140
9155
|
if (!skeletonParam) return;
|
|
9141
9156
|
const unitId = this._context.unitId;
|
|
9142
9157
|
const { skeleton } = skeletonParam;
|
|
9143
|
-
const currentRender = this._renderManagerService.
|
|
9158
|
+
const currentRender = this._renderManagerService.getRenderUnitById(unitId);
|
|
9144
9159
|
if (currentRender && currentRender.mainComponent) {
|
|
9145
9160
|
const spreadsheet = currentRender.mainComponent;
|
|
9146
9161
|
const getActiveRender = (evt) => {
|
|
@@ -9175,7 +9190,7 @@ let CellCustomRenderController = class CellCustomRenderController extends _unive
|
|
|
9175
9190
|
const subUnitId = worksheet.getSheetId();
|
|
9176
9191
|
const info = {
|
|
9177
9192
|
data: cellData,
|
|
9178
|
-
style:
|
|
9193
|
+
style: worksheet.getComposedCellStyleByCellData(row, col, cellData),
|
|
9179
9194
|
primaryWithCoord: skeleton.getCellWithCoordByIndex(cellIndex.actualRow, cellIndex.actualCol),
|
|
9180
9195
|
unitId,
|
|
9181
9196
|
subUnitId,
|
|
@@ -9660,7 +9675,7 @@ let SheetSkeletonRenderController = class SheetSkeletonRenderController extends
|
|
|
9660
9675
|
if (param == null) return;
|
|
9661
9676
|
const { unitId } = this._context;
|
|
9662
9677
|
const { skeleton } = param;
|
|
9663
|
-
const scene = (_this$_renderManagerS = this._renderManagerService.
|
|
9678
|
+
const scene = (_this$_renderManagerS = this._renderManagerService.getRenderUnitById(unitId)) === null || _this$_renderManagerS === void 0 ? void 0 : _this$_renderManagerS.scene;
|
|
9664
9679
|
if (skeleton == null || scene == null) return;
|
|
9665
9680
|
const { rowTotalHeight, columnTotalWidth, rowHeaderWidthAndMarginLeft, columnHeaderHeightAndMarginTop } = skeleton;
|
|
9666
9681
|
if (!this._context.unit.getActiveSheet()) return;
|
|
@@ -9718,7 +9733,9 @@ let SheetLoadingRenderService = class SheetLoadingRenderService extends _univerj
|
|
|
9718
9733
|
if (!loadingRender) return;
|
|
9719
9734
|
let shouldRender = false;
|
|
9720
9735
|
if (!loadingRender.render) {
|
|
9721
|
-
|
|
9736
|
+
const contentElement = this._layoutService.getContentElement();
|
|
9737
|
+
if (!contentElement) return;
|
|
9738
|
+
loadingRender.render = this._createLoadingRender(loadingRender.workbook, loadingRender.sourceUnitId, contentElement);
|
|
9722
9739
|
shouldRender = true;
|
|
9723
9740
|
}
|
|
9724
9741
|
const worksheet = loadingRender.workbook.getSheetBySheetId(activeSheetId);
|
|
@@ -9757,6 +9774,10 @@ let SheetLoadingRenderService = class SheetLoadingRenderService extends _univerj
|
|
|
9757
9774
|
async handoff(sourceUnitId, timeoutMs) {
|
|
9758
9775
|
var _this$_loadingRender2, _this$_finalCanvasGua;
|
|
9759
9776
|
if (((_this$_loadingRender2 = this._loadingRender) === null || _this$_loadingRender2 === void 0 ? void 0 : _this$_loadingRender2.sourceUnitId) !== sourceUnitId) return true;
|
|
9777
|
+
if (!this._loadingRender.render) {
|
|
9778
|
+
this.hide(sourceUnitId);
|
|
9779
|
+
return true;
|
|
9780
|
+
}
|
|
9760
9781
|
(_this$_finalCanvasGua = this._finalCanvasGuard) === null || _this$_finalCanvasGua === void 0 || _this$_finalCanvasGua.unsubscribe();
|
|
9761
9782
|
this._finalCanvasGuard = null;
|
|
9762
9783
|
try {
|
|
@@ -9792,9 +9813,8 @@ let SheetLoadingRenderService = class SheetLoadingRenderService extends _univerj
|
|
|
9792
9813
|
if (activeSheet) workbook.setActiveSheet(activeSheet);
|
|
9793
9814
|
return workbook;
|
|
9794
9815
|
}
|
|
9795
|
-
_createLoadingRender(workbook, sourceUnitId) {
|
|
9816
|
+
_createLoadingRender(workbook, sourceUnitId, contentElement) {
|
|
9796
9817
|
const previewUnitId = workbook.getUnitId();
|
|
9797
|
-
const contentElement = this._layoutService.getContentElement();
|
|
9798
9818
|
const { width, height } = contentElement.getBoundingClientRect();
|
|
9799
9819
|
const engine = this._injector.createInstance(_univerjs_engine_render.Engine, previewUnitId, void 0);
|
|
9800
9820
|
const scene = new _univerjs_engine_render.Scene(`${PREVIEW_SCENE_PREFIX}${previewUnitId}`, engine, {
|
|
@@ -9829,10 +9849,10 @@ let SheetLoadingRenderService = class SheetLoadingRenderService extends _univerj
|
|
|
9829
9849
|
_waitForFinalCanvas(render) {
|
|
9830
9850
|
return new rxjs.Observable((subscriber) => {
|
|
9831
9851
|
let frameId;
|
|
9832
|
-
const contentElement = this._layoutService.getContentElement();
|
|
9833
9852
|
const canvasElement = render.engine.getCanvasElement();
|
|
9834
9853
|
const checkMounted = () => {
|
|
9835
|
-
|
|
9854
|
+
const contentElement = this._layoutService.getContentElement();
|
|
9855
|
+
if (contentElement && canvasElement.parentElement === contentElement && canvasElement.width > 0 && canvasElement.height > 0) {
|
|
9836
9856
|
subscriber.next();
|
|
9837
9857
|
subscriber.complete();
|
|
9838
9858
|
return;
|
|
@@ -9846,7 +9866,7 @@ let SheetLoadingRenderService = class SheetLoadingRenderService extends _univerj
|
|
|
9846
9866
|
});
|
|
9847
9867
|
}
|
|
9848
9868
|
_getFinalRender$(sourceUnitId) {
|
|
9849
|
-
const existingRender = this._renderManagerService.
|
|
9869
|
+
const existingRender = this._renderManagerService.getRenderUnitById(sourceUnitId);
|
|
9850
9870
|
return existingRender ? (0, rxjs.of)(existingRender) : this._renderManagerService.created$.pipe((0, rxjs.filter)((render) => render.unitId === sourceUnitId));
|
|
9851
9871
|
}
|
|
9852
9872
|
_guardFinalCanvas(sourceUnitId) {
|
|
@@ -9986,14 +10006,14 @@ const useMenuPosition = (range) => {
|
|
|
9986
10006
|
endCol: range.cols[range.cols.length - 1]
|
|
9987
10007
|
};
|
|
9988
10008
|
if (anchor.endRow < 0 || anchor.endCol < 0) return null;
|
|
9989
|
-
const ru = renderManagerService.
|
|
10009
|
+
const ru = renderManagerService.getRenderUnitById(workbook.getUnitId());
|
|
9990
10010
|
const sheetSkeletonManagerService = ru === null || ru === void 0 ? void 0 : ru.with(SheetSkeletonManagerService);
|
|
9991
|
-
const selectionRenderService = ru === null || ru === void 0 ? void 0 : ru.with(ISheetSelectionRenderService);
|
|
9992
10011
|
const sheetObject = getSheetObject(univerInstanceService, renderManagerService);
|
|
9993
|
-
if (!sheetObject
|
|
10012
|
+
if (!sheetObject) return null;
|
|
9994
10013
|
const { scene } = sheetObject;
|
|
9995
10014
|
const skeleton = sheetSkeletonManagerService === null || sheetSkeletonManagerService === void 0 ? void 0 : sheetSkeletonManagerService.getCurrentSkeleton();
|
|
9996
|
-
const viewport =
|
|
10015
|
+
const viewport = getViewportByCell(anchor.endRow, anchor.endCol, scene, workbook.getActiveSheet());
|
|
10016
|
+
if (!viewport) return null;
|
|
9997
10017
|
const scaleX = scene === null || scene === void 0 ? void 0 : scene.scaleX;
|
|
9998
10018
|
const scaleY = scene === null || scene === void 0 ? void 0 : scene.scaleY;
|
|
9999
10019
|
const scrollXY = scene === null || scene === void 0 ? void 0 : scene.getViewportScrollXY(viewport);
|
|
@@ -10026,7 +10046,8 @@ const ClipboardPopupMenu = () => {
|
|
|
10026
10046
|
const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
|
|
10027
10047
|
const [menuHovered, setMenuHovered] = (0, react.useState)(false);
|
|
10028
10048
|
const [visible, setVisible] = (0, react.useState)(false);
|
|
10029
|
-
const
|
|
10049
|
+
const range = pasteOptionsCache === null || pasteOptionsCache === void 0 ? void 0 : pasteOptionsCache.target.pastedRange;
|
|
10050
|
+
const relativePosition = useMenuPosition(range);
|
|
10030
10051
|
if (!relativePosition || !showMenu) return null;
|
|
10031
10052
|
if (relativePosition.positionX < 50 || relativePosition.positionY < 30) return null;
|
|
10032
10053
|
const showMore = menuHovered || visible;
|
|
@@ -10216,7 +10237,7 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends _u
|
|
|
10216
10237
|
return (_this$_editorBridgeSe = (_this$_editorBridgeSe2 = this._editorBridgeService.getEditCellState()) === null || _this$_editorBridgeSe2 === void 0 ? void 0 : _this$_editorBridgeSe2.unitId) !== null && _this$_editorBridgeSe !== void 0 ? _this$_editorBridgeSe : "";
|
|
10217
10238
|
}
|
|
10218
10239
|
get _editingRenderer() {
|
|
10219
|
-
return this._renderManagerService.
|
|
10240
|
+
return this._renderManagerService.getRenderUnitById(this._editingUnitId);
|
|
10220
10241
|
}
|
|
10221
10242
|
get _renderer() {
|
|
10222
10243
|
var _this$_editingRendere;
|
|
@@ -10311,21 +10332,28 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends _u
|
|
|
10311
10332
|
}
|
|
10312
10333
|
_getEditorMaxSize(position, canvasOffset, horizontalAlign) {
|
|
10313
10334
|
if (this._getEditorObject() == null) return;
|
|
10314
|
-
function pxToNum(
|
|
10315
|
-
|
|
10335
|
+
function pxToNum(size) {
|
|
10336
|
+
var _size$replace;
|
|
10337
|
+
return Number.parseFloat((_size$replace = size === null || size === void 0 ? void 0 : size.replace("px", "")) !== null && _size$replace !== void 0 ? _size$replace : "");
|
|
10316
10338
|
}
|
|
10317
10339
|
const engine = this.engine;
|
|
10318
10340
|
if (!engine) return;
|
|
10319
10341
|
const canvasElement = engine.getCanvasElement();
|
|
10320
10342
|
const canvasClientRect = canvasElement.getBoundingClientRect();
|
|
10321
10343
|
const widthOfCanvas = pxToNum(canvasElement.style.width);
|
|
10344
|
+
const heightOfCanvas = pxToNum(canvasElement.style.height);
|
|
10322
10345
|
const { width, height } = canvasClientRect;
|
|
10323
|
-
const
|
|
10346
|
+
const contentElement = this._getEditorContentElement();
|
|
10347
|
+
const contentBoundingRect = contentElement.getBoundingClientRect();
|
|
10348
|
+
const contentScaleX = resolveElementScale(contentBoundingRect.width, contentElement.offsetWidth);
|
|
10349
|
+
const contentScaleY = resolveElementScale(contentBoundingRect.height, contentElement.offsetHeight, contentScaleX);
|
|
10350
|
+
const scaleAdjustX = width / widthOfCanvas / contentScaleX;
|
|
10351
|
+
const scaleAdjustY = Number.isFinite(heightOfCanvas) && heightOfCanvas > 0 ? height / heightOfCanvas / contentScaleY : scaleAdjustX;
|
|
10324
10352
|
const { startX, startY, endX } = position;
|
|
10325
10353
|
const enginWidth = engine.width;
|
|
10326
|
-
const maxHeight = height - startY - EDITOR_BORDER_SIZE * 2;
|
|
10354
|
+
const maxHeight = height / contentScaleY - startY - EDITOR_BORDER_SIZE * 2;
|
|
10327
10355
|
const cellWidth = endX - startX;
|
|
10328
|
-
let maxWidth = width - startX;
|
|
10356
|
+
let maxWidth = width / contentScaleX - startX;
|
|
10329
10357
|
if (horizontalAlign === _univerjs_core.HorizontalAlign.CENTER) {
|
|
10330
10358
|
const rightGap = enginWidth - endX;
|
|
10331
10359
|
maxWidth = cellWidth + Math.min(startX, rightGap) * 2;
|
|
@@ -10335,7 +10363,10 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends _u
|
|
|
10335
10363
|
return {
|
|
10336
10364
|
height: maxHeight,
|
|
10337
10365
|
width: maxWidth,
|
|
10338
|
-
|
|
10366
|
+
contentScaleX,
|
|
10367
|
+
contentScaleY,
|
|
10368
|
+
scaleAdjustX,
|
|
10369
|
+
scaleAdjustY
|
|
10339
10370
|
};
|
|
10340
10371
|
}
|
|
10341
10372
|
/**
|
|
@@ -10352,7 +10383,7 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends _u
|
|
|
10352
10383
|
let { startX, startY } = actualRangeWithCoord;
|
|
10353
10384
|
const { document: documentComponent, scene: editorScene, engine: docEngine } = editorObject;
|
|
10354
10385
|
const viewportMain = editorScene.getViewport(_univerjs_docs_ui.VIEWPORT_KEY.VIEW_MAIN);
|
|
10355
|
-
const { height: clientHeight, width: clientWidth,
|
|
10386
|
+
const { height: clientHeight, width: clientWidth, contentScaleX, contentScaleY, scaleAdjustX, scaleAdjustY } = this._getEditorMaxSize(actualRangeWithCoord, canvasOffset, horizontalAlign);
|
|
10356
10387
|
let physicHeight = editorHeight;
|
|
10357
10388
|
let scrollBar = viewportMain === null || viewportMain === void 0 ? void 0 : viewportMain.getScrollBar();
|
|
10358
10389
|
if (physicHeight > clientHeight) {
|
|
@@ -10373,12 +10404,12 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends _u
|
|
|
10373
10404
|
this._addBackground(editorScene, editorWidth / scaleX, editorHeight / scaleY, fill);
|
|
10374
10405
|
const { scaleX: precisionScaleX, scaleY: precisionScaleY } = editorScene.getPrecisionScale();
|
|
10375
10406
|
editorScene.transformByState({
|
|
10376
|
-
width: editorWidth *
|
|
10377
|
-
height: editorHeight *
|
|
10378
|
-
scaleX: scaleX *
|
|
10379
|
-
scaleY: scaleY *
|
|
10407
|
+
width: editorWidth * scaleAdjustX / scaleX,
|
|
10408
|
+
height: editorHeight * scaleAdjustY / scaleY,
|
|
10409
|
+
scaleX: scaleX * scaleAdjustX,
|
|
10410
|
+
scaleY: scaleY * scaleAdjustY
|
|
10380
10411
|
});
|
|
10381
|
-
documentComponent.resize(editorWidth *
|
|
10412
|
+
documentComponent.resize(editorWidth * scaleAdjustX / scaleX, editorHeight * scaleAdjustY / scaleY);
|
|
10382
10413
|
/**
|
|
10383
10414
|
* sometimes requestIdleCallback is invalid, so use setTimeout to ensure the successful execution of the resizeBySize method.
|
|
10384
10415
|
* resize canvas
|
|
@@ -10390,16 +10421,16 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends _u
|
|
|
10390
10421
|
}, 0);
|
|
10391
10422
|
const contentBoundingRect = this._getEditorContentElement().getBoundingClientRect();
|
|
10392
10423
|
const canvasBoundingRect = canvasElement.getBoundingClientRect();
|
|
10393
|
-
startX = startX *
|
|
10394
|
-
startY = startY *
|
|
10424
|
+
startX = startX * scaleAdjustX + (canvasBoundingRect.left - contentBoundingRect.left) / contentScaleX;
|
|
10425
|
+
startY = startY * scaleAdjustY + (canvasBoundingRect.top - contentBoundingRect.top) / contentScaleY;
|
|
10395
10426
|
const cellWidth = actualRangeWithCoord.endX - actualRangeWithCoord.startX;
|
|
10396
|
-
if (horizontalAlign === _univerjs_core.HorizontalAlign.RIGHT) startX += (cellWidth - editorWidth) *
|
|
10397
|
-
else if (horizontalAlign === _univerjs_core.HorizontalAlign.CENTER) startX += (cellWidth - editorWidth *
|
|
10427
|
+
if (horizontalAlign === _univerjs_core.HorizontalAlign.RIGHT) startX += (cellWidth - editorWidth) * scaleAdjustX;
|
|
10428
|
+
else if (horizontalAlign === _univerjs_core.HorizontalAlign.CENTER) startX += (cellWidth - editorWidth * scaleAdjustX) / 2;
|
|
10398
10429
|
this._cellEditorManagerService.setState({
|
|
10399
10430
|
startX,
|
|
10400
10431
|
startY,
|
|
10401
|
-
endX: editorWidth *
|
|
10402
|
-
endY: physicHeight *
|
|
10432
|
+
endX: editorWidth * scaleAdjustX + startX,
|
|
10433
|
+
endY: physicHeight * scaleAdjustY + startY,
|
|
10403
10434
|
show: true
|
|
10404
10435
|
});
|
|
10405
10436
|
}
|
|
@@ -10443,10 +10474,10 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends _u
|
|
|
10443
10474
|
const { horizontalAlign } = documentLayoutObject;
|
|
10444
10475
|
const maxSize = this._getEditorMaxSize(position, canvasOffset, horizontalAlign);
|
|
10445
10476
|
if (!maxSize) return;
|
|
10446
|
-
const { height: clientHeight, width: clientWidth,
|
|
10477
|
+
const { height: clientHeight, width: clientWidth, scaleAdjustX, scaleAdjustY } = maxSize;
|
|
10447
10478
|
const cell = skeleton.getCellWithCoordByIndex(row, column);
|
|
10448
|
-
const height = Math.min((cell.mergeInfo.endY - cell.mergeInfo.startY) * scaleY, clientHeight) *
|
|
10449
|
-
const width = Math.min((cell.mergeInfo.endX - cell.mergeInfo.startX) * scaleX, clientWidth) *
|
|
10479
|
+
const height = Math.min((cell.mergeInfo.endY - cell.mergeInfo.startY) * scaleY, clientHeight) * scaleAdjustY;
|
|
10480
|
+
const width = Math.min((cell.mergeInfo.endX - cell.mergeInfo.startX) * scaleX, clientWidth) * scaleAdjustX;
|
|
10450
10481
|
const currentHeight = state.endY - state.startY;
|
|
10451
10482
|
const currentWidth = state.endX - state.startX;
|
|
10452
10483
|
if (currentHeight !== height || currentWidth !== width) {
|
|
@@ -10460,7 +10491,7 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends _u
|
|
|
10460
10491
|
}
|
|
10461
10492
|
_getEditorSkeleton() {
|
|
10462
10493
|
var _this$_renderManagerS;
|
|
10463
|
-
return (_this$_renderManagerS = this._renderManagerService.
|
|
10494
|
+
return (_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.DocSkeletonManagerService).getSkeleton();
|
|
10464
10495
|
}
|
|
10465
10496
|
};
|
|
10466
10497
|
SheetCellEditorResizeService = __decorate([
|
|
@@ -10472,6 +10503,10 @@ SheetCellEditorResizeService = __decorate([
|
|
|
10472
10503
|
__decorateParam(5, _univerjs_core.IConfigService),
|
|
10473
10504
|
__decorateParam(6, (0, _univerjs_core.Optional)(ISheetEmbedFloatingGeometryService))
|
|
10474
10505
|
], SheetCellEditorResizeService);
|
|
10506
|
+
function resolveElementScale(renderedSize, layoutSize, fallback = 1) {
|
|
10507
|
+
if (!Number.isFinite(renderedSize) || !Number.isFinite(layoutSize) || renderedSize <= 0 || layoutSize <= 0) return fallback;
|
|
10508
|
+
return renderedSize / layoutSize;
|
|
10509
|
+
}
|
|
10475
10510
|
|
|
10476
10511
|
//#endregion
|
|
10477
10512
|
//#region src/controllers/render-controllers/editor-bridge.render-controller.ts
|
|
@@ -10510,12 +10545,17 @@ let EditorBridgeRenderController = class EditorBridgeRenderController extends _u
|
|
|
10510
10545
|
this._d = null;
|
|
10511
10546
|
}
|
|
10512
10547
|
_initSelectionChangeListener(d) {
|
|
10513
|
-
d.add((0, rxjs.merge)(this._selectionManagerService.
|
|
10548
|
+
d.add((0, rxjs.merge)(this._selectionManagerService.selectionSet$, this._selectionManagerService.selectionMoveStart$).subscribe((params) => this._updateEditorPosition(params)));
|
|
10549
|
+
d.add(this._selectionManagerService.selectionMoveEnd$.subscribe((params) => {
|
|
10550
|
+
var _params;
|
|
10551
|
+
this._updateEditorPosition(params);
|
|
10552
|
+
if (params === null || params === void 0 || (_params = params[params.length - 1]) === null || _params === void 0 ? void 0 : _params.primary) this._updateInputPosition();
|
|
10553
|
+
}));
|
|
10514
10554
|
}
|
|
10515
10555
|
_updateEditorPosition(params) {
|
|
10516
|
-
var
|
|
10556
|
+
var _params2;
|
|
10517
10557
|
if (this._editorBridgeService.isVisible().visible) return;
|
|
10518
|
-
const primary = params === null || params === void 0 || (
|
|
10558
|
+
const primary = params === null || params === void 0 || (_params2 = params[params.length - 1]) === null || _params2 === void 0 ? void 0 : _params2.primary;
|
|
10519
10559
|
if (primary) {
|
|
10520
10560
|
var _this$_context$unit$g, _this$_sheetSkeletonM;
|
|
10521
10561
|
const sheetObject = this._getSheetObject();
|
|
@@ -10545,6 +10585,15 @@ let EditorBridgeRenderController = class EditorBridgeRenderController extends _u
|
|
|
10545
10585
|
});
|
|
10546
10586
|
}
|
|
10547
10587
|
}
|
|
10588
|
+
_updateInputPosition() {
|
|
10589
|
+
var _this$_renderManagerS;
|
|
10590
|
+
if (this._editorBridgeService.isVisible().visible) return;
|
|
10591
|
+
const layout = this._editorBridgeService.getEditCellLayout();
|
|
10592
|
+
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);
|
|
10593
|
+
if (!layout || !docSelectionRenderService) return;
|
|
10594
|
+
const { position, canvasOffset } = layout;
|
|
10595
|
+
docSelectionRenderService.setInputPosition(canvasOffset.left + position.startX, canvasOffset.top + position.startY);
|
|
10596
|
+
}
|
|
10548
10597
|
refreshEditorPosition() {
|
|
10549
10598
|
const workbookSelections = this._selectionManagerService.getWorkbookSelections(this._context.unitId);
|
|
10550
10599
|
if (workbookSelections) {
|
|
@@ -10602,7 +10651,7 @@ let EditorBridgeRenderController = class EditorBridgeRenderController extends _u
|
|
|
10602
10651
|
d.add(disposable);
|
|
10603
10652
|
}
|
|
10604
10653
|
};
|
|
10605
|
-
const render = this._renderManagerService.
|
|
10654
|
+
const render = this._renderManagerService.getRenderUnitById(_univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY);
|
|
10606
10655
|
if (render) addEvent(render);
|
|
10607
10656
|
else this.disposeWithMe(this._renderManagerService.created$.pipe((0, rxjs.filter)((render) => render.unitId === _univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY)).subscribe((render) => {
|
|
10608
10657
|
disposable === null || disposable === void 0 || disposable.dispose();
|
|
@@ -10616,7 +10665,7 @@ let EditorBridgeRenderController = class EditorBridgeRenderController extends _u
|
|
|
10616
10665
|
}));
|
|
10617
10666
|
}
|
|
10618
10667
|
_focusCellEditorInput() {
|
|
10619
|
-
const render = this._renderManagerService.
|
|
10668
|
+
const render = this._renderManagerService.getRenderUnitById(_univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY);
|
|
10620
10669
|
const docSelectionRenderService = render === null || render === void 0 ? void 0 : render.with(_univerjs_docs_ui.DocSelectionRenderService);
|
|
10621
10670
|
if (!(docSelectionRenderService === null || docSelectionRenderService === void 0 ? void 0 : docSelectionRenderService.isFocusing)) docSelectionRenderService === null || docSelectionRenderService === void 0 || docSelectionRenderService.focus();
|
|
10622
10671
|
}
|
|
@@ -11414,7 +11463,7 @@ let EditingRenderController = class EditingRenderController extends _univerjs_co
|
|
|
11414
11463
|
unitId: this._editingUnit
|
|
11415
11464
|
});
|
|
11416
11465
|
if (!unit) return;
|
|
11417
|
-
const editorBridgeRenderController = (_this$_renderManagerS = this._renderManagerService.
|
|
11466
|
+
const editorBridgeRenderController = (_this$_renderManagerS = this._renderManagerService.getRenderUnitById(unit.getUnitId())) === null || _this$_renderManagerS === void 0 ? void 0 : _this$_renderManagerS.with(EditorBridgeRenderController);
|
|
11418
11467
|
if (editorBridgeRenderController) editorBridgeRenderController.refreshEditorPosition();
|
|
11419
11468
|
}
|
|
11420
11469
|
}));
|
|
@@ -11447,7 +11496,7 @@ let EditingRenderController = class EditingRenderController extends _univerjs_co
|
|
|
11447
11496
|
const editorId = this._contextService.getContextValue(_univerjs_core.FOCUSING_FX_BAR_EDITOR) ? _univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY : this._editorBridgeService.getCurrentEditorId();
|
|
11448
11497
|
const docUnitId = editorId !== null && editorId !== void 0 ? editorId : (_this$_univerInstance = this._univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_DOC)) === null || _this$_univerInstance === void 0 ? void 0 : _this$_univerInstance.getUnitId();
|
|
11449
11498
|
if (!docUnitId) return;
|
|
11450
|
-
const docSelectionRenderManager = (_this$_renderManagerS2 = this._renderManagerService.
|
|
11499
|
+
const docSelectionRenderManager = (_this$_renderManagerS2 = this._renderManagerService.getRenderUnitById(docUnitId)) === null || _this$_renderManagerS2 === void 0 ? void 0 : _this$_renderManagerS2.with(_univerjs_docs_ui.DocSelectionRenderService);
|
|
11451
11500
|
if (!docSelectionRenderManager) return;
|
|
11452
11501
|
docSelectionRenderManager.sync();
|
|
11453
11502
|
}));
|
|
@@ -11511,7 +11560,6 @@ let EditingRenderController = class EditingRenderController extends _univerjs_co
|
|
|
11511
11560
|
unitId: editorUnitId,
|
|
11512
11561
|
snapshot: documentModel.getSnapshot()
|
|
11513
11562
|
});
|
|
11514
|
-
this._contextService.setContextValue(_univerjs_core.FOCUSING_EDITOR_BUT_HIDDEN, true);
|
|
11515
11563
|
this._textSelectionManagerService.replaceDocRanges([{
|
|
11516
11564
|
startOffset: 0,
|
|
11517
11565
|
endOffset: 0
|
|
@@ -11519,8 +11567,8 @@ let EditingRenderController = class EditingRenderController extends _univerjs_co
|
|
|
11519
11567
|
unitId: _univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY,
|
|
11520
11568
|
subUnitId: _univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY
|
|
11521
11569
|
});
|
|
11522
|
-
const cellSelectionRenderManager = (_this$_renderManagerS3 = this._renderManagerService.
|
|
11523
|
-
const formulaSelectionRenderManager = (_this$_renderManagerS4 = this._renderManagerService.
|
|
11570
|
+
const cellSelectionRenderManager = (_this$_renderManagerS3 = this._renderManagerService.getRenderUnitById(_univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY)) === null || _this$_renderManagerS3 === void 0 ? void 0 : _this$_renderManagerS3.with(_univerjs_docs_ui.DocSelectionRenderService);
|
|
11571
|
+
const formulaSelectionRenderManager = (_this$_renderManagerS4 = this._renderManagerService.getRenderUnitById(_univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY)) === null || _this$_renderManagerS4 === void 0 ? void 0 : _this$_renderManagerS4.with(_univerjs_docs_ui.DocSelectionRenderService);
|
|
11524
11572
|
if ((cellSelectionRenderManager === null || cellSelectionRenderManager === void 0 ? void 0 : cellSelectionRenderManager.canFocusing) || (formulaSelectionRenderManager === null || formulaSelectionRenderManager === void 0 ? void 0 : formulaSelectionRenderManager.canFocusing)) {
|
|
11525
11573
|
this._univerInstanceService.setCurrentUnitForType(_univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY);
|
|
11526
11574
|
cellSelectionRenderManager === null || cellSelectionRenderManager === void 0 || cellSelectionRenderManager.activate(HIDDEN_EDITOR_POSITION$1, HIDDEN_EDITOR_POSITION$1, true);
|
|
@@ -11635,7 +11683,7 @@ let EditingRenderController = class EditingRenderController extends _univerjs_co
|
|
|
11635
11683
|
endOffset: cursor
|
|
11636
11684
|
}]);
|
|
11637
11685
|
}
|
|
11638
|
-
(_this$_renderManagerS5 = this._renderManagerService.
|
|
11686
|
+
(_this$_renderManagerS5 = this._renderManagerService.getRenderUnitById(unitId)) === null || _this$_renderManagerS5 === void 0 || _this$_renderManagerS5.scene.resetCursor();
|
|
11639
11687
|
}
|
|
11640
11688
|
_refreshCurrentSelections(sheetId) {
|
|
11641
11689
|
const selections = this._workbookSelections.getSelectionsOfWorksheet(sheetId);
|
|
@@ -11748,7 +11796,6 @@ let EditingRenderController = class EditingRenderController extends _univerjs_co
|
|
|
11748
11796
|
var _editorObject$scene$g;
|
|
11749
11797
|
this._contextService.setContextValue(_univerjs_core.FOCUSING_EDITOR_INPUT_FORMULA, false);
|
|
11750
11798
|
this._contextService.setContextValue(_univerjs_core.EDITOR_ACTIVATED, false);
|
|
11751
|
-
this._contextService.setContextValue(_univerjs_core.FOCUSING_EDITOR_BUT_HIDDEN, false);
|
|
11752
11799
|
this._contextService.setContextValue(_univerjs_core.FOCUSING_FX_BAR_EDITOR, false);
|
|
11753
11800
|
this._cellEditorManagerService.setState({ show: param.visible });
|
|
11754
11801
|
const formulaBarEditor = this._editorService.getEditor(_univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY);
|
|
@@ -11827,11 +11874,11 @@ let EditingRenderController = class EditingRenderController extends _univerjs_co
|
|
|
11827
11874
|
}
|
|
11828
11875
|
_getEditorSkeleton(editorId) {
|
|
11829
11876
|
var _this$_renderManagerS6;
|
|
11830
|
-
return (_this$_renderManagerS6 = this._renderManagerService.
|
|
11877
|
+
return (_this$_renderManagerS6 = this._renderManagerService.getRenderUnitById(editorId)) === null || _this$_renderManagerS6 === void 0 ? void 0 : _this$_renderManagerS6.with(_univerjs_docs.DocSkeletonManagerService).getSkeleton();
|
|
11831
11878
|
}
|
|
11832
11879
|
_getEditorViewModel(editorId) {
|
|
11833
11880
|
var _this$_renderManagerS7;
|
|
11834
|
-
return (_this$_renderManagerS7 = this._renderManagerService.
|
|
11881
|
+
return (_this$_renderManagerS7 = this._renderManagerService.getRenderUnitById(editorId)) === null || _this$_renderManagerS7 === void 0 ? void 0 : _this$_renderManagerS7.with(_univerjs_docs.DocSkeletonManagerService).getViewModel();
|
|
11835
11882
|
}
|
|
11836
11883
|
_getEditingUnit() {
|
|
11837
11884
|
return this._editingUnit ? this._univerInstanceService.getUnit(this._editingUnit, _univerjs_core.UniverInstanceType.UNIVER_SHEET) : null;
|
|
@@ -12402,12 +12449,12 @@ let SheetClipboardController = class SheetClipboardController extends _univerjs_
|
|
|
12402
12449
|
if (event.event.key === "Escape") this._sheetClipboardService.removeMarkSelection();
|
|
12403
12450
|
});
|
|
12404
12451
|
};
|
|
12405
|
-
let docSelectionRenderService = (_this$_renderManagerS = this._renderManagerService.
|
|
12452
|
+
let 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);
|
|
12406
12453
|
if (docSelectionRenderService) sheetPasteShortKeyFn(docSelectionRenderService);
|
|
12407
12454
|
this._renderManagerService.created$.subscribe((renderer) => {
|
|
12408
12455
|
if (renderer.unitId === _univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY) {
|
|
12409
12456
|
var _this$_renderManagerS2;
|
|
12410
|
-
docSelectionRenderService = (_this$_renderManagerS2 = this._renderManagerService.
|
|
12457
|
+
docSelectionRenderService = (_this$_renderManagerS2 = this._renderManagerService.getRenderUnitById(_univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY)) === null || _this$_renderManagerS2 === void 0 ? void 0 : _this$_renderManagerS2.with(_univerjs_docs_ui.DocSelectionRenderService);
|
|
12411
12458
|
if (docSelectionRenderService) sheetPasteShortKeyFn(docSelectionRenderService);
|
|
12412
12459
|
}
|
|
12413
12460
|
});
|
|
@@ -12632,11 +12679,9 @@ let SheetClipboardController = class SheetClipboardController extends _univerjs_
|
|
|
12632
12679
|
};
|
|
12633
12680
|
}
|
|
12634
12681
|
_generateDocumentDataModelSnapshot(snapshot) {
|
|
12635
|
-
var _withCurrentTypeOfRen
|
|
12636
|
-
|
|
12637
|
-
|
|
12638
|
-
const { skeleton } = currentSkeleton;
|
|
12639
|
-
const documentModel = (_skeleton$getBlankCel = skeleton.getBlankCellDocumentModel()) === null || _skeleton$getBlankCel === void 0 ? void 0 : _skeleton$getBlankCel.documentModel;
|
|
12682
|
+
var _withCurrentTypeOfRen;
|
|
12683
|
+
if (((_withCurrentTypeOfRen = (0, _univerjs_engine_render.withCurrentTypeOfRenderer)(_univerjs_core.UniverInstanceType.UNIVER_SHEET, SheetSkeletonManagerService, this._instanceService, this._renderManagerService)) === null || _withCurrentTypeOfRen === void 0 ? void 0 : _withCurrentTypeOfRen.getCurrentParam()) == null) return null;
|
|
12684
|
+
const documentModel = (0, _univerjs_core.createDocumentModelWithStyle)("", {});
|
|
12640
12685
|
const documentData = {
|
|
12641
12686
|
...documentModel === null || documentModel === void 0 ? void 0 : documentModel.getSnapshot(),
|
|
12642
12687
|
...snapshot
|
|
@@ -12816,7 +12861,7 @@ let SheetClipboardController = class SheetClipboardController extends _univerjs_
|
|
|
12816
12861
|
const setValuesMutation = {
|
|
12817
12862
|
unitId,
|
|
12818
12863
|
subUnitId,
|
|
12819
|
-
cellValue: valueMatrix.
|
|
12864
|
+
cellValue: valueMatrix.clone()
|
|
12820
12865
|
};
|
|
12821
12866
|
redoMutationsInfo.push({
|
|
12822
12867
|
id: _univerjs_sheets.SetRangeValuesMutation.id,
|
|
@@ -12842,7 +12887,7 @@ let SheetClipboardController = class SheetClipboardController extends _univerjs_
|
|
|
12842
12887
|
}
|
|
12843
12888
|
_getWorksheet(unitId, subUnitId) {
|
|
12844
12889
|
var _this$_instanceServic;
|
|
12845
|
-
const worksheet = (_this$_instanceServic = this._instanceService.
|
|
12890
|
+
const worksheet = (_this$_instanceServic = this._instanceService.getUnit(unitId, _univerjs_core.UniverInstanceType.UNIVER_SHEET)) === null || _this$_instanceServic === void 0 ? void 0 : _this$_instanceServic.getSheetBySheetId(subUnitId);
|
|
12846
12891
|
if (!worksheet) throw new Error(`[SheetClipboardController]: cannot find a worksheet with unitId ${unitId} and subUnitId ${subUnitId}.`);
|
|
12847
12892
|
return worksheet;
|
|
12848
12893
|
}
|
|
@@ -12921,7 +12966,7 @@ let DragManagerService = class DragManagerService extends _univerjs_core.Disposa
|
|
|
12921
12966
|
if (!workbook) return null;
|
|
12922
12967
|
const worksheet = workbook.getActiveSheet();
|
|
12923
12968
|
if (!worksheet) return;
|
|
12924
|
-
const currentRender = this._renderManagerService.
|
|
12969
|
+
const currentRender = this._renderManagerService.getRenderUnitById(workbook.getUnitId());
|
|
12925
12970
|
if (!currentRender) return;
|
|
12926
12971
|
const skeletonParam = currentRender.with(SheetSkeletonManagerService).getCurrentParam();
|
|
12927
12972
|
const scrollInfo = currentRender.with(SheetScrollManagerService).getCurrentScrollState();
|
|
@@ -13094,7 +13139,7 @@ let FormulaEditorController = class FormulaEditorController extends _univerjs_co
|
|
|
13094
13139
|
}
|
|
13095
13140
|
_create(unitId) {
|
|
13096
13141
|
if (unitId !== _univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY) return;
|
|
13097
|
-
const formulaEditorDocObject = this._renderManagerService.
|
|
13142
|
+
const formulaEditorDocObject = this._renderManagerService.getRenderUnitById(unitId);
|
|
13098
13143
|
if (formulaEditorDocObject == null) return;
|
|
13099
13144
|
const { mainComponent: documentComponent } = formulaEditorDocObject;
|
|
13100
13145
|
if (documentComponent == null) return;
|
|
@@ -13102,7 +13147,7 @@ let FormulaEditorController = class FormulaEditorController extends _univerjs_co
|
|
|
13102
13147
|
}
|
|
13103
13148
|
_listenFxBtnClick() {
|
|
13104
13149
|
this._formulaEditorManagerService.fxBtnClick$.pipe((0, rxjs.takeUntil)(this.dispose$)).subscribe(() => {
|
|
13105
|
-
if (this._contextService.getContextValue(_univerjs_core.
|
|
13150
|
+
if (this._contextService.getContextValue(_univerjs_core.FOCUSING_UNIVER_EDITOR) && !this._contextService.getContextValue(_univerjs_core.EDITOR_ACTIVATED)) {
|
|
13106
13151
|
var _formulaEditorDataMod;
|
|
13107
13152
|
this._univerInstanceService.setCurrentUnitForType(_univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY);
|
|
13108
13153
|
const formulaEditorDataModel = this._univerInstanceService.getUnit(_univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, _univerjs_core.UniverInstanceType.UNIVER_DOC);
|
|
@@ -13162,8 +13207,8 @@ let FormulaEditorController = class FormulaEditorController extends _univerjs_co
|
|
|
13162
13207
|
autoScroll() {
|
|
13163
13208
|
var _this$_renderManagerS;
|
|
13164
13209
|
const position = this._formulaEditorManagerService.getPosition();
|
|
13165
|
-
const skeleton = (_this$_renderManagerS = this._renderManagerService.
|
|
13166
|
-
const editorObject = this._renderManagerService.
|
|
13210
|
+
const skeleton = (_this$_renderManagerS = this._renderManagerService.getRenderUnitById(_univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY)) === null || _this$_renderManagerS === void 0 ? void 0 : _this$_renderManagerS.with(_univerjs_docs.DocSkeletonManagerService).getSkeleton();
|
|
13211
|
+
const editorObject = this._renderManagerService.getRenderUnitById(_univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY);
|
|
13167
13212
|
const formulaEditorDataModel = this._univerInstanceService.getUnit(_univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, _univerjs_core.UniverInstanceType.UNIVER_DOC);
|
|
13168
13213
|
if (skeleton == null || position == null || editorObject == null || formulaEditorDataModel == null) return;
|
|
13169
13214
|
const { marginTop = 0, marginBottom = 0 } = formulaEditorDataModel.getSnapshot().documentStyle;
|
|
@@ -13384,7 +13429,7 @@ const getCustomRangePosition = (injector, unitId, subUnitId, row, col, rangeId)
|
|
|
13384
13429
|
if (!workbook) return null;
|
|
13385
13430
|
const worksheet = workbook.getSheetBySheetId(subUnitId);
|
|
13386
13431
|
if (!worksheet) return null;
|
|
13387
|
-
const currentRender = renderManagerService.
|
|
13432
|
+
const currentRender = renderManagerService.getRenderUnitById(workbook.getUnitId());
|
|
13388
13433
|
const skeletonParam = currentRender === null || currentRender === void 0 ? void 0 : currentRender.with(SheetSkeletonManagerService).getSkeletonParam(worksheet.getSheetId());
|
|
13389
13434
|
const skeleton = skeletonParam === null || skeletonParam === void 0 ? void 0 : skeletonParam.skeleton;
|
|
13390
13435
|
if (!skeleton || !currentRender) return;
|
|
@@ -13430,8 +13475,8 @@ const getEditingCustomRangePosition = (injector, unitId, subUnitId, row, col, ra
|
|
|
13430
13475
|
const { editorUnitId, unitId: editingUnitId, sheetId, row: editRow, column: editCol } = state;
|
|
13431
13476
|
if (unitId !== editingUnitId || subUnitId !== sheetId || editRow !== row || editCol !== col) return null;
|
|
13432
13477
|
const renderManagerService = injector.get(_univerjs_engine_render.IRenderManagerService);
|
|
13433
|
-
const renderer = renderManagerService.
|
|
13434
|
-
const sheetRenderer = renderManagerService.
|
|
13478
|
+
const renderer = renderManagerService.getRenderUnitById(editorUnitId);
|
|
13479
|
+
const sheetRenderer = renderManagerService.getRenderUnitById(unitId);
|
|
13435
13480
|
if (!renderer || !sheetRenderer) return null;
|
|
13436
13481
|
const docSkeleton = renderer.with(_univerjs_docs.DocSkeletonManagerService).getSkeleton();
|
|
13437
13482
|
const sheetSkeleton = (_sheetRenderer$with$g = sheetRenderer.with(SheetSkeletonManagerService).getSkeletonParam(sheetId)) === null || _sheetRenderer$with$g === void 0 ? void 0 : _sheetRenderer$with$g.skeleton;
|
|
@@ -13583,7 +13628,7 @@ let HoverManagerService = class HoverManagerService extends _univerjs_core.Dispo
|
|
|
13583
13628
|
if (!workbook) return null;
|
|
13584
13629
|
const worksheet = workbook.getActiveSheet();
|
|
13585
13630
|
if (!worksheet) return null;
|
|
13586
|
-
const currentRender = this._renderManagerService.
|
|
13631
|
+
const currentRender = this._renderManagerService.getRenderUnitById(workbook.getUnitId());
|
|
13587
13632
|
if (!currentRender) return null;
|
|
13588
13633
|
const skeletonParam = currentRender.with(SheetSkeletonManagerService).getSkeletonParam(worksheet.getSheetId());
|
|
13589
13634
|
if (!skeletonParam) return null;
|
|
@@ -13913,10 +13958,9 @@ const UNIVER_SHEET_PERMISSION_ALERT_DIALOG = "UNIVER_SHEET_PERMISSION_ALERT_DIAL
|
|
|
13913
13958
|
//#endregion
|
|
13914
13959
|
//#region src/controllers/permission/sheet-permission-check-ui.controller.ts
|
|
13915
13960
|
let SheetPermissionCheckUIController = class SheetPermissionCheckUIController extends _univerjs_core.Disposable {
|
|
13916
|
-
constructor(_commandService,
|
|
13961
|
+
constructor(_commandService, _permissionService, _dialogService, _rangeProtectionRuleModel, _localeService, _contextService, _sheetPermissionCheckController) {
|
|
13917
13962
|
super();
|
|
13918
13963
|
this._commandService = _commandService;
|
|
13919
|
-
this._univerInstanceService = _univerInstanceService;
|
|
13920
13964
|
this._permissionService = _permissionService;
|
|
13921
13965
|
this._dialogService = _dialogService;
|
|
13922
13966
|
this._rangeProtectionRuleModel = _rangeProtectionRuleModel;
|
|
@@ -13941,7 +13985,6 @@ let SheetPermissionCheckUIController = class SheetPermissionCheckUIController ex
|
|
|
13941
13985
|
errorMsg
|
|
13942
13986
|
},
|
|
13943
13987
|
width: 320,
|
|
13944
|
-
destroyOnClose: true,
|
|
13945
13988
|
showOk: true,
|
|
13946
13989
|
onClose: () => {
|
|
13947
13990
|
this._dialogService.close(UNIVER_SHEET_PERMISSION_ALERT_DIALOG_ID);
|
|
@@ -13958,7 +14001,6 @@ let SheetPermissionCheckUIController = class SheetPermissionCheckUIController ex
|
|
|
13958
14001
|
let permission = true;
|
|
13959
14002
|
let errorMsg = "";
|
|
13960
14003
|
let params;
|
|
13961
|
-
let target;
|
|
13962
14004
|
switch (id) {
|
|
13963
14005
|
case _univerjs_docs.InsertTextCommand.id:
|
|
13964
14006
|
case _univerjs_docs_ui.IMEInputCommand.id:
|
|
@@ -13982,20 +14024,6 @@ let SheetPermissionCheckUIController = class SheetPermissionCheckUIController ex
|
|
|
13982
14024
|
});
|
|
13983
14025
|
errorMsg = this._localeService.t("sheets-ui.permission.dialog.editErr");
|
|
13984
14026
|
break;
|
|
13985
|
-
case SheetPasteColWidthCommand.id:
|
|
13986
|
-
permission = this._sheetPermissionCheckController.permissionCheckWithoutRange({
|
|
13987
|
-
workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
|
|
13988
|
-
worksheetTypes: [_univerjs_sheets.WorksheetEditPermission, _univerjs_sheets.WorksheetSetColumnStylePermission],
|
|
13989
|
-
rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
|
|
13990
|
-
});
|
|
13991
|
-
errorMsg = this._localeService.t("sheets-ui.permission.dialog.pasteErr");
|
|
13992
|
-
break;
|
|
13993
|
-
case SheetPasteShortKeyCommand.id:
|
|
13994
|
-
case SheetPasteCommand.id:
|
|
13995
|
-
params = commandInfo.params;
|
|
13996
|
-
permission = this._permissionCheckByPaste(params);
|
|
13997
|
-
errorMsg = this._localeService.t("sheets-ui.permission.dialog.pasteErr");
|
|
13998
|
-
break;
|
|
13999
14027
|
case ApplyFormatPainterCommand.id:
|
|
14000
14028
|
permission = this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
14001
14029
|
workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
|
|
@@ -14008,28 +14036,6 @@ let SheetPermissionCheckUIController = class SheetPermissionCheckUIController ex
|
|
|
14008
14036
|
});
|
|
14009
14037
|
errorMsg = this._localeService.t("sheets-ui.permission.dialog.commonErr");
|
|
14010
14038
|
break;
|
|
14011
|
-
case SheetCopyCommand.id:
|
|
14012
|
-
var _this$_permissionServ;
|
|
14013
|
-
permission = this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
14014
|
-
workbookTypes: [_univerjs_sheets.WorkbookCopyPermission],
|
|
14015
|
-
worksheetTypes: [_univerjs_sheets.WorksheetCopyPermission],
|
|
14016
|
-
rangeTypes: [_univerjs_sheets.RangeProtectionPermissionViewPoint]
|
|
14017
|
-
});
|
|
14018
|
-
errorMsg = this._localeService.t("sheets-ui.permission.dialog.copyErr");
|
|
14019
|
-
target = (0, _univerjs_sheets.getSheetCommandTarget)(this._univerInstanceService);
|
|
14020
|
-
if (!permission && target && !((_this$_permissionServ = this._permissionService.getPermissionPoint(new _univerjs_sheets.WorkbookCopyPermission(target.unitId).id)) === null || _this$_permissionServ === void 0 ? void 0 : _this$_permissionServ.value)) errorMsg = this._localeService.t("sheets-ui.permission.dialog.workbookCopyErr");
|
|
14021
|
-
break;
|
|
14022
|
-
case SheetCutCommand.id:
|
|
14023
|
-
var _this$_permissionServ2;
|
|
14024
|
-
permission = this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
14025
|
-
workbookTypes: [_univerjs_sheets.WorkbookCopyPermission, _univerjs_sheets.WorkbookEditablePermission],
|
|
14026
|
-
worksheetTypes: [_univerjs_sheets.WorksheetCopyPermission, _univerjs_sheets.WorksheetEditPermission],
|
|
14027
|
-
rangeTypes: [_univerjs_sheets.RangeProtectionPermissionViewPoint, _univerjs_sheets.RangeProtectionPermissionEditPoint]
|
|
14028
|
-
});
|
|
14029
|
-
errorMsg = this._localeService.t("sheets-ui.permission.dialog.copyErr");
|
|
14030
|
-
target = (0, _univerjs_sheets.getSheetCommandTarget)(this._univerInstanceService);
|
|
14031
|
-
if (!permission && target && !((_this$_permissionServ2 = this._permissionService.getPermissionPoint(new _univerjs_sheets.WorkbookCopyPermission(target.unitId).id)) === null || _this$_permissionServ2 === void 0 ? void 0 : _this$_permissionServ2.value)) errorMsg = this._localeService.t("sheets-ui.permission.dialog.workbookCopyErr");
|
|
14032
|
-
break;
|
|
14033
14039
|
default: break;
|
|
14034
14040
|
}
|
|
14035
14041
|
if (!permission) this._sheetPermissionCheckController.blockExecuteWithoutPermission(errorMsg);
|
|
@@ -14042,37 +14048,15 @@ let SheetPermissionCheckUIController = class SheetPermissionCheckUIController ex
|
|
|
14042
14048
|
this._getPermissionCheck(commandInfo);
|
|
14043
14049
|
}));
|
|
14044
14050
|
}
|
|
14045
|
-
_permissionCheckByPaste(params) {
|
|
14046
|
-
if (params.value === PREDEFINED_HOOK_NAME_PASTE.SPECIAL_PASTE_VALUE || params.value === PREDEFINED_HOOK_NAME_PASTE.SPECIAL_PASTE_FORMULA) return this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
14047
|
-
workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
|
|
14048
|
-
worksheetTypes: [_univerjs_sheets.WorksheetSetCellStylePermission, _univerjs_sheets.WorksheetEditPermission],
|
|
14049
|
-
rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
|
|
14050
|
-
});
|
|
14051
|
-
else if (params.value === PREDEFINED_HOOK_NAME_PASTE.SPECIAL_PASTE_FORMAT) return this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
14052
|
-
workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
|
|
14053
|
-
worksheetTypes: [_univerjs_sheets.WorksheetSetCellStylePermission, _univerjs_sheets.WorksheetEditPermission],
|
|
14054
|
-
rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
|
|
14055
|
-
});
|
|
14056
|
-
else return this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
14057
|
-
workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
|
|
14058
|
-
worksheetTypes: [
|
|
14059
|
-
_univerjs_sheets.WorksheetSetCellValuePermission,
|
|
14060
|
-
_univerjs_sheets.WorksheetSetCellStylePermission,
|
|
14061
|
-
_univerjs_sheets.WorksheetEditPermission
|
|
14062
|
-
],
|
|
14063
|
-
rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
|
|
14064
|
-
});
|
|
14065
|
-
}
|
|
14066
14051
|
};
|
|
14067
14052
|
SheetPermissionCheckUIController = __decorate([
|
|
14068
14053
|
__decorateParam(0, _univerjs_core.ICommandService),
|
|
14069
|
-
__decorateParam(1, _univerjs_core.
|
|
14070
|
-
__decorateParam(2,
|
|
14071
|
-
__decorateParam(3,
|
|
14072
|
-
__decorateParam(4, (0, _univerjs_core.Inject)(
|
|
14073
|
-
__decorateParam(5,
|
|
14074
|
-
__decorateParam(6, _univerjs_core.
|
|
14075
|
-
__decorateParam(7, (0, _univerjs_core.Inject)(_univerjs_sheets.SheetPermissionCheckController))
|
|
14054
|
+
__decorateParam(1, _univerjs_core.IPermissionService),
|
|
14055
|
+
__decorateParam(2, _univerjs_ui.IDialogService),
|
|
14056
|
+
__decorateParam(3, (0, _univerjs_core.Inject)(_univerjs_sheets.RangeProtectionRuleModel)),
|
|
14057
|
+
__decorateParam(4, (0, _univerjs_core.Inject)(_univerjs_core.LocaleService)),
|
|
14058
|
+
__decorateParam(5, _univerjs_core.IContextService),
|
|
14059
|
+
__decorateParam(6, (0, _univerjs_core.Inject)(_univerjs_sheets.SheetPermissionCheckController))
|
|
14076
14060
|
], SheetPermissionCheckUIController);
|
|
14077
14061
|
|
|
14078
14062
|
//#endregion
|
|
@@ -14998,9 +14982,7 @@ let HeaderFreezeRenderController = class HeaderFreezeRenderController extends _u
|
|
|
14998
14982
|
}
|
|
14999
14983
|
_getFreeze() {
|
|
15000
14984
|
var _this$_sheetSkeletonM6;
|
|
15001
|
-
|
|
15002
|
-
if (config == null) return;
|
|
15003
|
-
return config.freeze;
|
|
14985
|
+
return (_this$_sheetSkeletonM6 = this._sheetSkeletonManagerService.getCurrentParam()) === null || _this$_sheetSkeletonM6 === void 0 ? void 0 : _this$_sheetSkeletonM6.skeleton.worksheet.getFreeze();
|
|
15004
14986
|
}
|
|
15005
14987
|
_getSheetObject() {
|
|
15006
14988
|
return getSheetObject(this._context.unit, this._context);
|
|
@@ -19480,11 +19462,11 @@ function Text2NumberContextMenuItemFactory(accessor) {
|
|
|
19480
19462
|
//#endregion
|
|
19481
19463
|
//#region src/views/sheet-slider/SheetZoomInput.tsx
|
|
19482
19464
|
const SHEET_ZOOM_INPUT_COMPONENT = "SHEET_ZOOM_INPUT_COMPONENT";
|
|
19483
|
-
function SheetZoomInput(props) {
|
|
19465
|
+
function SheetZoomInput({ className, ...props }) {
|
|
19484
19466
|
const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
|
|
19485
19467
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_ui.ZoomInput, {
|
|
19486
19468
|
...props,
|
|
19487
|
-
className: "!univer-bg-transparent dark:!univer-bg-transparent",
|
|
19469
|
+
className: (0, _univerjs_design.clsx)("!univer-bg-transparent dark:!univer-bg-transparent", className),
|
|
19488
19470
|
onChange: (value) => commandService.executeCommand(SetZoomRatioFromToolbarCommand.id, { value })
|
|
19489
19471
|
});
|
|
19490
19472
|
}
|
|
@@ -19538,48 +19520,97 @@ const menuSchema = {
|
|
|
19538
19520
|
[_univerjs_ui.RibbonStartGroup.HISTORY]: {
|
|
19539
19521
|
[SetOnceFormatPainterCommand.id]: {
|
|
19540
19522
|
order: 2,
|
|
19523
|
+
gridLayout: {
|
|
19524
|
+
row: 1,
|
|
19525
|
+
column: 2,
|
|
19526
|
+
showLabel: true
|
|
19527
|
+
},
|
|
19541
19528
|
menuItemFactory: FormatPainterMenuItemFactory
|
|
19542
19529
|
},
|
|
19543
19530
|
[_univerjs_sheets.ClearSelectionAllCommand.id]: {
|
|
19544
19531
|
order: 3,
|
|
19532
|
+
gridLayout: {
|
|
19533
|
+
row: 2,
|
|
19534
|
+
column: 2,
|
|
19535
|
+
showLabel: true
|
|
19536
|
+
},
|
|
19545
19537
|
menuItemFactory: ClearSelectionAllToolbarMenuItemFactory
|
|
19546
19538
|
}
|
|
19547
19539
|
},
|
|
19548
19540
|
[_univerjs_ui.RibbonStartGroup.FORMAT]: {
|
|
19549
19541
|
[SetRangeFontFamilyCommand.id]: {
|
|
19550
19542
|
order: 1,
|
|
19543
|
+
gridLayout: {
|
|
19544
|
+
row: 1,
|
|
19545
|
+
column: 1,
|
|
19546
|
+
columnSpan: 4,
|
|
19547
|
+
width: 240
|
|
19548
|
+
},
|
|
19551
19549
|
menuItemFactory: FontFamilySelectorMenuItemFactory
|
|
19552
19550
|
},
|
|
19553
19551
|
[SetRangeFontSizeCommand.id]: {
|
|
19554
19552
|
order: 2,
|
|
19553
|
+
gridLayout: {
|
|
19554
|
+
row: 1,
|
|
19555
|
+
column: 5,
|
|
19556
|
+
width: 72
|
|
19557
|
+
},
|
|
19555
19558
|
menuItemFactory: FontSizeSelectorMenuItemFactory
|
|
19556
19559
|
},
|
|
19557
19560
|
[SetRangeFontIncreaseCommand.id]: {
|
|
19558
19561
|
order: 2.1,
|
|
19562
|
+
gridLayout: {
|
|
19563
|
+
row: 1,
|
|
19564
|
+
column: 6
|
|
19565
|
+
},
|
|
19559
19566
|
menuItemFactory: FontSizeIncreaseMenuItemFactory
|
|
19560
19567
|
},
|
|
19561
19568
|
[SetRangeFontDecreaseCommand.id]: {
|
|
19562
19569
|
order: 2.2,
|
|
19570
|
+
gridLayout: {
|
|
19571
|
+
row: 1,
|
|
19572
|
+
column: 7
|
|
19573
|
+
},
|
|
19563
19574
|
menuItemFactory: FontSizeDecreaseMenuItemFactory
|
|
19564
19575
|
},
|
|
19565
19576
|
[SetRangeBoldCommand.id]: {
|
|
19566
19577
|
order: 5,
|
|
19578
|
+
gridLayout: {
|
|
19579
|
+
row: 2,
|
|
19580
|
+
column: 1
|
|
19581
|
+
},
|
|
19567
19582
|
menuItemFactory: BoldMenuItemFactory
|
|
19568
19583
|
},
|
|
19569
19584
|
[SetRangeItalicCommand.id]: {
|
|
19570
19585
|
order: 6,
|
|
19586
|
+
gridLayout: {
|
|
19587
|
+
row: 2,
|
|
19588
|
+
column: 2
|
|
19589
|
+
},
|
|
19571
19590
|
menuItemFactory: ItalicMenuItemFactory
|
|
19572
19591
|
},
|
|
19573
19592
|
[SetRangeUnderlineCommand.id]: {
|
|
19574
19593
|
order: 7,
|
|
19594
|
+
gridLayout: {
|
|
19595
|
+
row: 2,
|
|
19596
|
+
column: 3
|
|
19597
|
+
},
|
|
19575
19598
|
menuItemFactory: UnderlineMenuItemFactory
|
|
19576
19599
|
},
|
|
19577
19600
|
[SetRangeStrickThroughCommand.id]: {
|
|
19578
19601
|
order: 8,
|
|
19602
|
+
gridLayout: {
|
|
19603
|
+
row: 2,
|
|
19604
|
+
column: 4
|
|
19605
|
+
},
|
|
19579
19606
|
menuItemFactory: StrikeThroughMenuItemFactory
|
|
19580
19607
|
},
|
|
19581
19608
|
[SetRangeTextColorCommand.id]: {
|
|
19582
19609
|
order: 9,
|
|
19610
|
+
gridLayout: {
|
|
19611
|
+
row: 2,
|
|
19612
|
+
column: 7
|
|
19613
|
+
},
|
|
19583
19614
|
menuItemFactory: TextColorSelectorMenuItemFactory,
|
|
19584
19615
|
[_univerjs_sheets.ResetTextColorCommand.id]: {
|
|
19585
19616
|
order: 0,
|
|
@@ -19588,6 +19619,10 @@ const menuSchema = {
|
|
|
19588
19619
|
},
|
|
19589
19620
|
[_univerjs_sheets.SetBackgroundColorCommand.id]: {
|
|
19590
19621
|
order: 10,
|
|
19622
|
+
gridLayout: {
|
|
19623
|
+
row: 2,
|
|
19624
|
+
column: 6
|
|
19625
|
+
},
|
|
19591
19626
|
menuItemFactory: BackgroundColorSelectorMenuItemFactory,
|
|
19592
19627
|
[_univerjs_sheets.ResetBackgroundColorCommand.id]: {
|
|
19593
19628
|
order: 0,
|
|
@@ -19596,32 +19631,60 @@ const menuSchema = {
|
|
|
19596
19631
|
},
|
|
19597
19632
|
[_univerjs_sheets.SetBorderBasicCommand.id]: {
|
|
19598
19633
|
order: 11,
|
|
19634
|
+
gridLayout: {
|
|
19635
|
+
row: 2,
|
|
19636
|
+
column: 5
|
|
19637
|
+
},
|
|
19599
19638
|
menuItemFactory: CellBorderSelectorMenuItemFactory
|
|
19600
19639
|
}
|
|
19601
19640
|
},
|
|
19602
19641
|
[_univerjs_ui.RibbonStartGroup.LAYOUT]: {
|
|
19603
19642
|
[_univerjs_sheets.SetHorizontalTextAlignCommand.id]: {
|
|
19604
19643
|
order: 0,
|
|
19644
|
+
gridLayout: {
|
|
19645
|
+
row: 1,
|
|
19646
|
+
column: 1
|
|
19647
|
+
},
|
|
19605
19648
|
menuItemFactory: HorizontalAlignMenuItemFactory
|
|
19606
19649
|
},
|
|
19607
19650
|
[_univerjs_sheets.SetVerticalTextAlignCommand.id]: {
|
|
19608
19651
|
order: 3,
|
|
19652
|
+
gridLayout: {
|
|
19653
|
+
row: 2,
|
|
19654
|
+
column: 1
|
|
19655
|
+
},
|
|
19609
19656
|
menuItemFactory: VerticalAlignMenuItemFactory
|
|
19610
19657
|
},
|
|
19611
19658
|
[_univerjs_sheets.SetTextWrapCommand.id]: {
|
|
19612
19659
|
order: 6,
|
|
19660
|
+
gridLayout: {
|
|
19661
|
+
row: 1,
|
|
19662
|
+
column: 2
|
|
19663
|
+
},
|
|
19613
19664
|
menuItemFactory: WrapTextMenuItemFactory
|
|
19614
19665
|
},
|
|
19615
19666
|
[_univerjs_sheets.SetShrinkToFitCommand.id]: {
|
|
19616
19667
|
order: 7,
|
|
19668
|
+
gridLayout: {
|
|
19669
|
+
row: 2,
|
|
19670
|
+
column: 2
|
|
19671
|
+
},
|
|
19617
19672
|
menuItemFactory: ShrinkToFitMenuItemFactory
|
|
19618
19673
|
},
|
|
19619
19674
|
[_univerjs_sheets.SetTextRotationCommand.id]: {
|
|
19620
19675
|
order: 8,
|
|
19676
|
+
gridLayout: {
|
|
19677
|
+
row: 1,
|
|
19678
|
+
column: 3
|
|
19679
|
+
},
|
|
19621
19680
|
menuItemFactory: TextRotateMenuItemFactory
|
|
19622
19681
|
},
|
|
19623
19682
|
[_univerjs_sheets.AddWorksheetMergeCommand.id]: {
|
|
19624
19683
|
order: 9,
|
|
19684
|
+
gridLayout: {
|
|
19685
|
+
row: 2,
|
|
19686
|
+
column: 3
|
|
19687
|
+
},
|
|
19625
19688
|
menuItemFactory: CellMergeMenuItemFactory,
|
|
19626
19689
|
[_univerjs_sheets.AddWorksheetMergeAllCommand.id]: {
|
|
19627
19690
|
order: 0,
|
|
@@ -19643,6 +19706,12 @@ const menuSchema = {
|
|
|
19643
19706
|
},
|
|
19644
19707
|
[_univerjs_ui.RibbonStartGroup.OTHERS]: { [AddRangeProtectionFromToolbarCommand.id]: {
|
|
19645
19708
|
order: 0,
|
|
19709
|
+
gridLayout: {
|
|
19710
|
+
row: 1,
|
|
19711
|
+
column: 1,
|
|
19712
|
+
rowSpan: 2,
|
|
19713
|
+
showLabel: true
|
|
19714
|
+
},
|
|
19646
19715
|
menuItemFactory: sheetPermissionToolbarMenuFactory
|
|
19647
19716
|
} }
|
|
19648
19717
|
},
|
|
@@ -19650,19 +19719,41 @@ const menuSchema = {
|
|
|
19650
19719
|
[_univerjs_ui.RibbonViewGroup.DISPLAY]: {
|
|
19651
19720
|
[SHEET_FROZEN_TOOLBAR_MENU_ID]: {
|
|
19652
19721
|
order: 0,
|
|
19722
|
+
gridLayout: {
|
|
19723
|
+
row: 1,
|
|
19724
|
+
column: 1,
|
|
19725
|
+
rowSpan: 2,
|
|
19726
|
+
showLabel: true
|
|
19727
|
+
},
|
|
19653
19728
|
menuItemFactory: SheetFrozenToolbarMenuItemFactory
|
|
19654
19729
|
},
|
|
19655
19730
|
[ZOOM_RATIO_MENU_ID]: {
|
|
19656
19731
|
order: 1,
|
|
19732
|
+
gridLayout: {
|
|
19733
|
+
row: 1,
|
|
19734
|
+
column: 2,
|
|
19735
|
+
width: 112
|
|
19736
|
+
},
|
|
19657
19737
|
menuItemFactory: ZoomRatioMenuItemFactory
|
|
19658
19738
|
},
|
|
19659
19739
|
[_univerjs_ui.ToggleFullscreenOperation.id]: {
|
|
19660
19740
|
order: 2,
|
|
19741
|
+
gridLayout: {
|
|
19742
|
+
row: 2,
|
|
19743
|
+
column: 2,
|
|
19744
|
+
showLabel: true,
|
|
19745
|
+
width: 112
|
|
19746
|
+
},
|
|
19661
19747
|
menuItemFactory: FullscreenMenuItemFactory
|
|
19662
19748
|
}
|
|
19663
19749
|
},
|
|
19664
19750
|
[_univerjs_ui.RibbonViewGroup.VISIBILITY]: { [_univerjs_sheets.ToggleGridlinesCommand.id]: {
|
|
19665
19751
|
order: 0,
|
|
19752
|
+
gridLayout: {
|
|
19753
|
+
row: 1,
|
|
19754
|
+
column: 1,
|
|
19755
|
+
showLabel: true
|
|
19756
|
+
},
|
|
19666
19757
|
menuItemFactory: ToggleGridlinesMenuFactory
|
|
19667
19758
|
} }
|
|
19668
19759
|
},
|
|
@@ -20191,18 +20282,12 @@ function AutoFillPopupMenu() {
|
|
|
20191
20282
|
const selected = (0, _univerjs_ui.useObservable)(autoFillService.applyType$, _univerjs_sheets.AUTO_FILL_APPLY_TYPE.SERIES);
|
|
20192
20283
|
const [isHovered, setHovered] = (0, react.useState)(false);
|
|
20193
20284
|
const workbook = useActiveWorkbook();
|
|
20194
|
-
const
|
|
20285
|
+
const sheetSkeletonManagerService = (0, react.useMemo)(() => {
|
|
20195
20286
|
if (workbook) {
|
|
20196
|
-
const ru = renderManagerService.
|
|
20197
|
-
return
|
|
20198
|
-
sheetSkeletonManagerService: ru === null || ru === void 0 ? void 0 : ru.with(SheetSkeletonManagerService),
|
|
20199
|
-
selectionRenderService: ru === null || ru === void 0 ? void 0 : ru.with(ISheetSelectionRenderService)
|
|
20200
|
-
};
|
|
20287
|
+
const ru = renderManagerService.getRenderUnitById(workbook.getUnitId());
|
|
20288
|
+
return ru === null || ru === void 0 ? void 0 : ru.with(SheetSkeletonManagerService);
|
|
20201
20289
|
}
|
|
20202
|
-
return
|
|
20203
|
-
sheetSkeletonManagerService: null,
|
|
20204
|
-
selectionRenderService: null
|
|
20205
|
-
};
|
|
20290
|
+
return null;
|
|
20206
20291
|
}, [workbook, renderManagerService]);
|
|
20207
20292
|
const handleMouseEnter = () => {
|
|
20208
20293
|
setHovered(true);
|
|
@@ -20233,10 +20318,11 @@ function AutoFillPopupMenu() {
|
|
|
20233
20318
|
}, [visible]);
|
|
20234
20319
|
if (anchor.col < 0 || anchor.row < 0) return null;
|
|
20235
20320
|
const sheetObject = getSheetObject(univerInstanceService, renderManagerService);
|
|
20236
|
-
if (!sheetObject || !
|
|
20321
|
+
if (!sheetObject || !workbook) return null;
|
|
20237
20322
|
const { scene } = sheetObject;
|
|
20238
20323
|
const skeleton = sheetSkeletonManagerService === null || sheetSkeletonManagerService === void 0 ? void 0 : sheetSkeletonManagerService.getCurrentSkeleton();
|
|
20239
|
-
const viewport =
|
|
20324
|
+
const viewport = getViewportByCell(anchor.row, anchor.col, scene, workbook.getActiveSheet());
|
|
20325
|
+
if (!viewport) return null;
|
|
20240
20326
|
const scaleX = scene === null || scene === void 0 ? void 0 : scene.scaleX;
|
|
20241
20327
|
const scaleY = scene === null || scene === void 0 ? void 0 : scene.scaleY;
|
|
20242
20328
|
const scrollXY = scene === null || scene === void 0 ? void 0 : scene.getViewportScrollXY(viewport);
|
|
@@ -21025,7 +21111,8 @@ function DefinedName({ disable }) {
|
|
|
21025
21111
|
const definedNames = (0, _univerjs_ui.useObservable)(() => definedNamesService.update$.pipe((0, rxjs.map)(getDefinedNameMap), (0, rxjs.startWith)(getDefinedNameMap())), getDefinedNameMap(), false, [definedNamesService, unitId]);
|
|
21026
21112
|
(0, react.useEffect)(() => {
|
|
21027
21113
|
const subscription = definedNamesService.currentRange$.subscribe(() => {
|
|
21028
|
-
const
|
|
21114
|
+
const selections = selectionManagerService.getCurrentSelections();
|
|
21115
|
+
const absoluteRef = getAbsoluteRefStringFromSelection(workbook, selections, lexerTreeBuilder);
|
|
21029
21116
|
const definedName = definedNamesService.getDefinedNameByRefString(unitId, absoluteRef);
|
|
21030
21117
|
if (definedName) {
|
|
21031
21118
|
setRangeString(definedName.name);
|
|
@@ -21459,7 +21546,7 @@ function SheetBarMenu() {
|
|
|
21459
21546
|
if (!workbook) return;
|
|
21460
21547
|
const sheets = workbook.getSheets();
|
|
21461
21548
|
const activeSheet = workbook.getActiveSheet();
|
|
21462
|
-
|
|
21549
|
+
const worksheetMenuItems = sheets.map((sheet, index) => {
|
|
21463
21550
|
return {
|
|
21464
21551
|
label: sheet.getName(),
|
|
21465
21552
|
index: `${index}`,
|
|
@@ -21467,7 +21554,8 @@ function SheetBarMenu() {
|
|
|
21467
21554
|
hidden: sheet.isSheetHidden() === _univerjs_core.BooleanNumber.TRUE,
|
|
21468
21555
|
selected: activeSheet === sheet
|
|
21469
21556
|
};
|
|
21470
|
-
})
|
|
21557
|
+
});
|
|
21558
|
+
setMenu(worksheetMenuItems);
|
|
21471
21559
|
}, [workbook, worksheetProtectionRuleModel]);
|
|
21472
21560
|
const setupStatusUpdate = (0, react.useCallback)(() => commandService.onCommandExecuted((commandInfo) => {
|
|
21473
21561
|
switch (commandInfo.id) {
|
|
@@ -22622,7 +22710,7 @@ function SheetBarTabs() {
|
|
|
22622
22710
|
var _activeSheet$getSheet;
|
|
22623
22711
|
const activeSheet = workbook.getActiveSheet();
|
|
22624
22712
|
const currentSubUnitId = (_activeSheet$getSheet = activeSheet === null || activeSheet === void 0 ? void 0 : activeSheet.getSheetId()) !== null && _activeSheet$getSheet !== void 0 ? _activeSheet$getSheet : "";
|
|
22625
|
-
|
|
22713
|
+
const sheetListItems = workbook.getSheets().filter((sheet) => !sheet.isSheetHidden()).map((sheet, index) => {
|
|
22626
22714
|
var _sheet$getTabColor;
|
|
22627
22715
|
const worksheetRule = worksheetProtectionRuleModel.getRule(workbook.getUnitId(), sheet.getSheetId());
|
|
22628
22716
|
const hasSelectionRule = rangeProtectionRuleModel.getSubunitRuleList(workbook.getUnitId(), sheet.getSheetId()).length > 0;
|
|
@@ -22640,7 +22728,8 @@ function SheetBarTabs() {
|
|
|
22640
22728
|
selected: activeSheet === sheet,
|
|
22641
22729
|
color: (_sheet$getTabColor = sheet.getTabColor()) !== null && _sheet$getTabColor !== void 0 ? _sheet$getTabColor : void 0
|
|
22642
22730
|
};
|
|
22643
|
-
})
|
|
22731
|
+
});
|
|
22732
|
+
setSheetList(sheetListItems);
|
|
22644
22733
|
setActiveSheetId(currentSubUnitId);
|
|
22645
22734
|
}, [
|
|
22646
22735
|
rangeProtectionRuleModel,
|
|
@@ -22672,7 +22761,7 @@ function SheetBarTabs() {
|
|
|
22672
22761
|
workbookRef.current = workbook;
|
|
22673
22762
|
}, [workbook]);
|
|
22674
22763
|
const syncActiveSheetRender = (0, react.useCallback)((subUnitId) => {
|
|
22675
|
-
const render = renderManagerService.
|
|
22764
|
+
const render = renderManagerService.getRenderUnitById(workbookRef.current.getUnitId());
|
|
22676
22765
|
try {
|
|
22677
22766
|
render === null || render === void 0 || render.with(SheetSkeletonManagerService).setCurrent({ sheetId: subUnitId });
|
|
22678
22767
|
render === null || render === void 0 || render.scene.makeDirty(true);
|
|
@@ -23043,7 +23132,10 @@ function ZoomSlider() {
|
|
|
23043
23132
|
(0, react.useEffect)(() => {
|
|
23044
23133
|
setZoom(getCurrentZoom());
|
|
23045
23134
|
return commandService.onCommandExecuted((commandInfo) => {
|
|
23046
|
-
if (commandInfo.id === SetZoomRatioOperation.id || commandInfo.id === _univerjs_sheets.SetWorksheetActiveOperation.id)
|
|
23135
|
+
if (commandInfo.id === SetZoomRatioOperation.id || commandInfo.id === _univerjs_sheets.SetWorksheetActiveOperation.id) {
|
|
23136
|
+
const currentZoom = getCurrentZoom();
|
|
23137
|
+
setZoom(currentZoom);
|
|
23138
|
+
}
|
|
23047
23139
|
}).dispose;
|
|
23048
23140
|
}, [commandService, getCurrentZoom]);
|
|
23049
23141
|
function handleChange(value) {
|
|
@@ -23143,8 +23235,6 @@ function formatNumber(item) {
|
|
|
23143
23235
|
const SINGLE_MODE_WIDTH = 800;
|
|
23144
23236
|
const ROW_COUNT_THRESHOLD = 3;
|
|
23145
23237
|
const StatusBar = () => {
|
|
23146
|
-
var _useConfigValue$statu, _useConfigValue;
|
|
23147
|
-
const showStatistic = (_useConfigValue$statu = (_useConfigValue = (0, _univerjs_ui.useConfigValue)("sheets-ui.config")) === null || _useConfigValue === void 0 ? void 0 : _useConfigValue.statusBarStatistic) !== null && _useConfigValue$statu !== void 0 ? _useConfigValue$statu : true;
|
|
23148
23238
|
const [isSingle, setIsSingle] = (0, react.useState)(window.innerWidth < SINGLE_MODE_WIDTH);
|
|
23149
23239
|
const statusBarService = (0, _univerjs_ui.useDependency)(IStatusBarService);
|
|
23150
23240
|
const items = statusBarService.getFunctions().map((item, index) => ({
|
|
@@ -23154,7 +23244,7 @@ const StatusBar = () => {
|
|
|
23154
23244
|
disable: false,
|
|
23155
23245
|
pattern: null
|
|
23156
23246
|
}));
|
|
23157
|
-
const useStatistics = (initialItems, statusBarService, isSingle
|
|
23247
|
+
const useStatistics = (initialItems, statusBarService, isSingle) => {
|
|
23158
23248
|
const [statistics, setStatistics] = (0, react.useState)(initialItems);
|
|
23159
23249
|
const [show, setShow] = (0, react.useState)(true);
|
|
23160
23250
|
const filteredStatistics = (0, react.useMemo)(() => statistics.filter((item) => item.show && !item.disable), [statistics]);
|
|
@@ -23182,21 +23272,16 @@ const StatusBar = () => {
|
|
|
23182
23272
|
}));
|
|
23183
23273
|
}, []);
|
|
23184
23274
|
(0, react.useEffect)(() => {
|
|
23185
|
-
if (!showStatistic) return;
|
|
23186
23275
|
const subscription = statusBarService.state$.subscribe(updateStatistics);
|
|
23187
23276
|
return () => subscription.unsubscribe();
|
|
23188
|
-
}, [
|
|
23189
|
-
showStatistic,
|
|
23190
|
-
statusBarService,
|
|
23191
|
-
updateStatistics
|
|
23192
|
-
]);
|
|
23277
|
+
}, [statusBarService, updateStatistics]);
|
|
23193
23278
|
return {
|
|
23194
23279
|
statistics,
|
|
23195
23280
|
showList,
|
|
23196
23281
|
show
|
|
23197
23282
|
};
|
|
23198
23283
|
};
|
|
23199
|
-
const { showList, show } = useStatistics(items, statusBarService, isSingle
|
|
23284
|
+
const { showList, show } = useStatistics(items, statusBarService, isSingle);
|
|
23200
23285
|
const handleResize = (0, _univerjs_core.debounce)(() => {
|
|
23201
23286
|
const newSingleState = window.innerWidth < SINGLE_MODE_WIDTH;
|
|
23202
23287
|
if (isSingle !== newSingleState) setIsSingle(newSingleState);
|
|
@@ -23208,7 +23293,6 @@ const StatusBar = () => {
|
|
|
23208
23293
|
};
|
|
23209
23294
|
}, [isSingle]);
|
|
23210
23295
|
const getStatisticLayout = (showList, rowCountThreshold, CopyableStatisticItem) => {
|
|
23211
|
-
if (!showStatistic) return null;
|
|
23212
23296
|
if (showList.length > rowCountThreshold) return showList.reduce((acc, _, index) => {
|
|
23213
23297
|
if (index % 2 === 0) acc.push(showList.slice(index, index + 2));
|
|
23214
23298
|
return acc;
|
|
@@ -23309,7 +23393,7 @@ function RenderSheetHeader() {
|
|
|
23309
23393
|
return null;
|
|
23310
23394
|
}
|
|
23311
23395
|
/**
|
|
23312
|
-
*
|
|
23396
|
+
* We should not write into this component anymore.
|
|
23313
23397
|
*/
|
|
23314
23398
|
function RenderSheetContent() {
|
|
23315
23399
|
var _componentManager$get;
|
|
@@ -24021,7 +24105,7 @@ let SheetUIController = class SheetUIController extends _univerjs_core.Disposabl
|
|
|
24021
24105
|
}
|
|
24022
24106
|
_initFocusHandler() {
|
|
24023
24107
|
this.disposeWithMe(this._layoutService.registerFocusHandler(_univerjs_core.UniverInstanceType.UNIVER_SHEET, (_unitId) => {
|
|
24024
|
-
const cellEditorRender = this._injector.get(_univerjs_engine_render.IRenderManagerService).
|
|
24108
|
+
const cellEditorRender = this._injector.get(_univerjs_engine_render.IRenderManagerService).getRenderUnitById(_univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY);
|
|
24025
24109
|
const docSelectionRenderService = cellEditorRender === null || cellEditorRender === void 0 ? void 0 : cellEditorRender.with(_univerjs_docs_ui.DocSelectionRenderService);
|
|
24026
24110
|
docSelectionRenderService === null || docSelectionRenderService === void 0 || docSelectionRenderService.focus();
|
|
24027
24111
|
}));
|
|
@@ -24063,7 +24147,7 @@ const useHighlightRange = (ranges = []) => {
|
|
|
24063
24147
|
//#endregion
|
|
24064
24148
|
//#region package.json
|
|
24065
24149
|
var name = "@univerjs/sheets-ui";
|
|
24066
|
-
var version = "1.0.0-alpha.
|
|
24150
|
+
var version = "1.0.0-alpha.8";
|
|
24067
24151
|
|
|
24068
24152
|
//#endregion
|
|
24069
24153
|
//#region src/views/cell-popup/config.ts
|
|
@@ -24256,8 +24340,8 @@ let SheetCanvasPopManagerService = class SheetCanvasPopManagerService extends _u
|
|
|
24256
24340
|
};
|
|
24257
24341
|
const unitId = workbook.getUnitId();
|
|
24258
24342
|
const subUnitId = worksheet.getSheetId();
|
|
24259
|
-
const skeleton = (_this$_renderManagerS = this._renderManagerService.
|
|
24260
|
-
const currentRender = this._renderManagerService.
|
|
24343
|
+
const skeleton = (_this$_renderManagerS = this._renderManagerService.getRenderUnitById(unitId)) === null || _this$_renderManagerS === void 0 ? void 0 : _this$_renderManagerS.with(SheetSkeletonManagerService).ensureSkeleton(subUnitId);
|
|
24344
|
+
const currentRender = this._renderManagerService.getRenderUnitById(unitId);
|
|
24261
24345
|
if (!currentRender || !skeleton) return {
|
|
24262
24346
|
dispose: () => {},
|
|
24263
24347
|
canDispose: () => true
|
|
@@ -24310,8 +24394,8 @@ let SheetCanvasPopManagerService = class SheetCanvasPopManagerService extends _u
|
|
|
24310
24394
|
const subUnitId = worksheet.getSheetId();
|
|
24311
24395
|
if (unitId !== location.unitId || location.subUnitId !== subUnitId) return null;
|
|
24312
24396
|
if (this._isSelectionMoving && !popup.showOnSelectionMoving) return;
|
|
24313
|
-
const skeleton = (_this$_renderManagerS2 = this._renderManagerService.
|
|
24314
|
-
const currentRender = this._renderManagerService.
|
|
24397
|
+
const skeleton = (_this$_renderManagerS2 = this._renderManagerService.getRenderUnitById(unitId)) === null || _this$_renderManagerS2 === void 0 ? void 0 : _this$_renderManagerS2.with(SheetSkeletonManagerService).ensureSkeleton(subUnitId);
|
|
24398
|
+
const currentRender = this._renderManagerService.getRenderUnitById(unitId);
|
|
24315
24399
|
if (!currentRender || !skeleton) return null;
|
|
24316
24400
|
const { position, position$, disposable } = this._createPositionObserver(bound, currentRender, skeleton, worksheet);
|
|
24317
24401
|
const { rects$, disposable: rectsObserverDisposable } = this._createHiddenRectObserver({
|
|
@@ -24364,8 +24448,8 @@ let SheetCanvasPopManagerService = class SheetCanvasPopManagerService extends _u
|
|
|
24364
24448
|
const unitId = workbook.getUnitId();
|
|
24365
24449
|
const subUnitId = worksheet.getSheetId();
|
|
24366
24450
|
if (_unitId && unitId !== _unitId || _subUnitId && _subUnitId !== subUnitId) return null;
|
|
24367
|
-
const skeleton = (_this$_renderManagerS3 = this._renderManagerService.
|
|
24368
|
-
const currentRender = this._renderManagerService.
|
|
24451
|
+
const skeleton = (_this$_renderManagerS3 = this._renderManagerService.getRenderUnitById(unitId)) === null || _this$_renderManagerS3 === void 0 ? void 0 : _this$_renderManagerS3.with(SheetSkeletonManagerService).ensureSkeleton(subUnitId);
|
|
24452
|
+
const currentRender = this._renderManagerService.getRenderUnitById(unitId);
|
|
24369
24453
|
if (!currentRender || !skeleton) return null;
|
|
24370
24454
|
if (this._isSelectionMoving && !popup.showOnSelectionMoving) return;
|
|
24371
24455
|
const popupInjector = this._resolveEmbeddedPopupInjector(unitId, currentRender);
|
|
@@ -24407,7 +24491,7 @@ let SheetCanvasPopManagerService = class SheetCanvasPopManagerService extends _u
|
|
|
24407
24491
|
if (!worksheet) return null;
|
|
24408
24492
|
const unitId = workbook.getUnitId();
|
|
24409
24493
|
const subUnitId = worksheet.getSheetId();
|
|
24410
|
-
const currentRender = this._renderManagerService.
|
|
24494
|
+
const currentRender = this._renderManagerService.getRenderUnitById(unitId);
|
|
24411
24495
|
const skeleton = currentRender === null || currentRender === void 0 ? void 0 : currentRender.with(SheetSkeletonManagerService).ensureSkeleton(subUnitId);
|
|
24412
24496
|
const sheetSelectionRenderService = currentRender === null || currentRender === void 0 ? void 0 : currentRender.with(ISheetSelectionRenderService);
|
|
24413
24497
|
if (!currentRender || !skeleton || !sheetSelectionRenderService) return null;
|
|
@@ -24476,7 +24560,7 @@ let SheetCanvasPopManagerService = class SheetCanvasPopManagerService extends _u
|
|
|
24476
24560
|
const unitId = workbook.getUnitId();
|
|
24477
24561
|
const subUnitId = worksheet.getSheetId();
|
|
24478
24562
|
if (_unitId && unitId !== _unitId || _subUnitId && subUnitId !== _subUnitId) return null;
|
|
24479
|
-
const currentRender = this._renderManagerService.
|
|
24563
|
+
const currentRender = this._renderManagerService.getRenderUnitById(unitId);
|
|
24480
24564
|
const skeleton = currentRender === null || currentRender === void 0 ? void 0 : currentRender.with(SheetSkeletonManagerService).ensureSkeleton(subUnitId);
|
|
24481
24565
|
const sheetSelectionRenderService = currentRender === null || currentRender === void 0 ? void 0 : currentRender.with(ISheetSelectionRenderService);
|
|
24482
24566
|
if (!currentRender || !skeleton || !sheetSelectionRenderService) return null;
|
|
@@ -25599,7 +25683,7 @@ let CellAlertManagerService = class CellAlertManagerService extends _univerjs_co
|
|
|
25599
25683
|
}
|
|
25600
25684
|
const { location } = alert;
|
|
25601
25685
|
const { row, col, unitId, subUnitId } = location;
|
|
25602
|
-
if (!this._renderManagerService.
|
|
25686
|
+
if (!this._renderManagerService.getRenderUnitById(unitId)) return;
|
|
25603
25687
|
const disposable = this._cellPopupManagerService.showPopup({
|
|
25604
25688
|
unitId,
|
|
25605
25689
|
subUnitId,
|
|
@@ -25796,7 +25880,7 @@ function DefinedNameInputContent(props) {
|
|
|
25796
25880
|
const [isFocusFormulaEditor, setIsFocusFormulaEditor] = (0, react.useState)(false);
|
|
25797
25881
|
(0, _univerjs_ui.useSidebarClick)((e) => {
|
|
25798
25882
|
var _formulaEditorRef$cur;
|
|
25799
|
-
|
|
25883
|
+
(_formulaEditorRef$cur = formulaEditorRef.current) !== null && _formulaEditorRef$cur !== void 0 && _formulaEditorRef$cur.isClickOutSide(e) && setIsFocusFormulaEditor(false);
|
|
25800
25884
|
});
|
|
25801
25885
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
25802
25886
|
className: (0, _univerjs_design.clsx)("univer-grid univer-space-y-2 univer-pb-1", _univerjs_design.borderBottomClassName, { "univer-hidden": !state }),
|
|
@@ -26031,7 +26115,7 @@ const DefinedNameContainer = () => {
|
|
|
26031
26115
|
};
|
|
26032
26116
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
26033
26117
|
"data-u-comp": "defined-name-container",
|
|
26034
|
-
className: "univer-relative univer-box-border univer-flex univer-h-full univer-w-full univer-flex-col",
|
|
26118
|
+
className: "univer-relative univer-box-border univer-flex univer-h-full univer-w-full univer-flex-col univer-overflow-hidden",
|
|
26035
26119
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
26036
26120
|
className: "univer-mb-4",
|
|
26037
26121
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_univerjs_design.Button, {
|
|
@@ -26352,7 +26436,8 @@ function ListDropDown(props) {
|
|
|
26352
26436
|
multiple,
|
|
26353
26437
|
onChange: async (newValue) => {
|
|
26354
26438
|
var _newValue$;
|
|
26355
|
-
|
|
26439
|
+
const str = multiple ? (0, _univerjs_sheets.serializeListOptions)(newValue) : (_newValue$ = newValue[0]) !== null && _newValue$ !== void 0 ? _newValue$ : "";
|
|
26440
|
+
setLocalValue(str);
|
|
26356
26441
|
if (!(await (onChange === null || onChange === void 0 ? void 0 : onChange(newValue)) === false)) hideFn();
|
|
26357
26442
|
},
|
|
26358
26443
|
options,
|
|
@@ -26439,13 +26524,14 @@ const SheetPermissionDialog = () => {
|
|
|
26439
26524
|
actions: defaultWorksheetUnitActionList
|
|
26440
26525
|
}).then((result) => {
|
|
26441
26526
|
if (cancelled) return;
|
|
26442
|
-
|
|
26527
|
+
const actions = result[0].strategies.reduce((p, c) => {
|
|
26443
26528
|
if (subUnitPermissionTypeMap[c.action]) p[c.action] = {
|
|
26444
26529
|
text: localeService.t(`sheets-ui.permission.panel.${subUnitPermissionTypeMap[c.action]}`),
|
|
26445
26530
|
allowed: c.role !== _univerjs_protocol.UnitRole.Owner
|
|
26446
26531
|
};
|
|
26447
26532
|
return p;
|
|
26448
|
-
}, {})
|
|
26533
|
+
}, {});
|
|
26534
|
+
setPermissionMap(actions);
|
|
26449
26535
|
loadingTimer = setTimeout(() => {
|
|
26450
26536
|
setLoading(false);
|
|
26451
26537
|
}, 100);
|
|
@@ -26840,7 +26926,8 @@ const PermissionDetailMainPart = (props) => {
|
|
|
26840
26926
|
(0, _univerjs_sheets.setEndForRange)(range, worksheet.getRowCount(), worksheet.getColumnCount());
|
|
26841
26927
|
return range;
|
|
26842
26928
|
});
|
|
26843
|
-
|
|
26929
|
+
const rangeErrorString = checkRangeValid(injector, transformedRange, permissionId, unitId, subUnitId);
|
|
26930
|
+
onRangesChange(transformedRange, rangeErrorString);
|
|
26844
26931
|
};
|
|
26845
26932
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.FormLayout, {
|
|
26846
26933
|
className: "univer-font-medium",
|
|
@@ -26913,7 +27000,6 @@ const PermissionDetailUserPart = (props) => {
|
|
|
26913
27000
|
title: { title: "" },
|
|
26914
27001
|
children: { label: UNIVER_SHEET_PERMISSION_USER_DIALOG },
|
|
26915
27002
|
width: "auto",
|
|
26916
|
-
destroyOnClose: true,
|
|
26917
27003
|
closable: false,
|
|
26918
27004
|
onClose: () => dialogService.close(UNIVER_SHEET_PERMISSION_USER_DIALOG_ID),
|
|
26919
27005
|
className: "sheet-permission-user-dialog"
|
|
@@ -27462,10 +27548,13 @@ const SheetPermissionUserDialog = () => {
|
|
|
27462
27548
|
})) === -1) {
|
|
27463
27549
|
const select = { ...item };
|
|
27464
27550
|
setSelectUserInfo([...selectUserInfo, select]);
|
|
27465
|
-
} else
|
|
27466
|
-
|
|
27467
|
-
|
|
27468
|
-
|
|
27551
|
+
} else {
|
|
27552
|
+
const newSelectUserInfo = selectUserInfo.filter((v) => {
|
|
27553
|
+
var _v$subject2, _item$subject3;
|
|
27554
|
+
return ((_v$subject2 = v.subject) === null || _v$subject2 === void 0 ? void 0 : _v$subject2.userID) !== ((_item$subject3 = item.subject) === null || _item$subject3 === void 0 ? void 0 : _item$subject3.userID);
|
|
27555
|
+
});
|
|
27556
|
+
setSelectUserInfo(newSelectUserInfo);
|
|
27557
|
+
}
|
|
27469
27558
|
};
|
|
27470
27559
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
|
|
27471
27560
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Input, {
|
|
@@ -27830,7 +27919,7 @@ let EditorDataSyncController = class EditorDataSyncController extends _univerjs_
|
|
|
27830
27919
|
}
|
|
27831
27920
|
_getEditorViewModel(unitId) {
|
|
27832
27921
|
var _this$_renderManagerS;
|
|
27833
|
-
return (_this$_renderManagerS = this._renderManagerService.
|
|
27922
|
+
return (_this$_renderManagerS = this._renderManagerService.getRenderUnitById(unitId)) === null || _this$_renderManagerS === void 0 ? void 0 : _this$_renderManagerS.with(_univerjs_docs.DocSkeletonManagerService).getViewModel();
|
|
27834
27923
|
}
|
|
27835
27924
|
_syncFormulaEditorContent() {
|
|
27836
27925
|
this.disposeWithMe(this._editorBridgeService.currentEditCellState$.subscribe((editCellState) => {
|
|
@@ -27899,7 +27988,7 @@ let EditorDataSyncController = class EditorDataSyncController extends _univerjs_
|
|
|
27899
27988
|
}
|
|
27900
27989
|
_syncActionsAndRender(unitId, parmas) {
|
|
27901
27990
|
const INCLUDE_LIST = [_univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY, _univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY];
|
|
27902
|
-
const currentRender = this._renderManagerService.
|
|
27991
|
+
const currentRender = this._renderManagerService.getRenderUnitById(unitId);
|
|
27903
27992
|
if (currentRender == null) return;
|
|
27904
27993
|
const skeleton = currentRender.with(_univerjs_docs.DocSkeletonManagerService).getSkeleton();
|
|
27905
27994
|
const docDataModel = this._univerInstanceService.getUnit(unitId, _univerjs_core.UniverInstanceType.UNIVER_DOC);
|
|
@@ -27926,7 +28015,7 @@ let EditorDataSyncController = class EditorDataSyncController extends _univerjs_
|
|
|
27926
28015
|
if (body.paragraphs) body.paragraphs = this._clearParagraph(body.paragraphs);
|
|
27927
28016
|
}
|
|
27928
28017
|
const INCLUDE_LIST = [_univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY, _univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY];
|
|
27929
|
-
const skeleton = (_this$_renderManagerS2 = this._renderManagerService.
|
|
28018
|
+
const skeleton = (_this$_renderManagerS2 = this._renderManagerService.getRenderUnitById(unitId)) === null || _this$_renderManagerS2 === void 0 ? void 0 : _this$_renderManagerS2.with(_univerjs_docs.DocSkeletonManagerService).getSkeleton();
|
|
27930
28019
|
const docDataModel = this._univerInstanceService.getUnit(unitId, _univerjs_core.UniverInstanceType.UNIVER_DOC);
|
|
27931
28020
|
const docViewModel = this._getEditorViewModel(unitId);
|
|
27932
28021
|
if (docDataModel == null || docViewModel == null || skeleton == null) return;
|
|
@@ -27935,7 +28024,7 @@ let EditorDataSyncController = class EditorDataSyncController extends _univerjs_
|
|
|
27935
28024
|
docDataModel.getSnapshot().drawingsOrder = drawingsOrder !== null && drawingsOrder !== void 0 ? drawingsOrder : [];
|
|
27936
28025
|
this._checkAndSetRenderStyleConfig(docDataModel);
|
|
27937
28026
|
docViewModel.reset(docDataModel);
|
|
27938
|
-
const currentRender = this._renderManagerService.
|
|
28027
|
+
const currentRender = this._renderManagerService.getRenderUnitById(unitId);
|
|
27939
28028
|
if (currentRender == null) return;
|
|
27940
28029
|
skeleton.calculate();
|
|
27941
28030
|
if (INCLUDE_LIST.includes(unitId)) {
|
|
@@ -27952,7 +28041,7 @@ let EditorDataSyncController = class EditorDataSyncController extends _univerjs_
|
|
|
27952
28041
|
}
|
|
27953
28042
|
_refreshRenderStyleConfig(unitId) {
|
|
27954
28043
|
var _currentRender$mainCo3;
|
|
27955
|
-
const currentRender = this._renderManagerService.
|
|
28044
|
+
const currentRender = this._renderManagerService.getRenderUnitById(unitId);
|
|
27956
28045
|
const skeleton = currentRender === null || currentRender === void 0 ? void 0 : currentRender.with(_univerjs_docs.DocSkeletonManagerService).getSkeleton();
|
|
27957
28046
|
const docDataModel = this._univerInstanceService.getUnit(unitId, _univerjs_core.UniverInstanceType.UNIVER_DOC);
|
|
27958
28047
|
const docViewModel = this._getEditorViewModel(unitId);
|
|
@@ -28455,7 +28544,7 @@ function MobileSheetBarImpl(props) {
|
|
|
28455
28544
|
const currentSubUnitId = workbook.getActiveSheet().getSheetId();
|
|
28456
28545
|
const sheets = workbook.getSheets();
|
|
28457
28546
|
const activeSheet = workbook.getActiveSheet();
|
|
28458
|
-
|
|
28547
|
+
const sheetListItems = sheets.filter((sheet) => !sheet.isSheetHidden()).map((sheet, index) => {
|
|
28459
28548
|
var _sheet$getTabColor;
|
|
28460
28549
|
return {
|
|
28461
28550
|
sheetId: sheet.getSheetId(),
|
|
@@ -28464,7 +28553,8 @@ function MobileSheetBarImpl(props) {
|
|
|
28464
28553
|
selected: activeSheet === sheet,
|
|
28465
28554
|
color: (_sheet$getTabColor = sheet.getTabColor()) !== null && _sheet$getTabColor !== void 0 ? _sheet$getTabColor : void 0
|
|
28466
28555
|
};
|
|
28467
|
-
})
|
|
28556
|
+
});
|
|
28557
|
+
setSheetList(sheetListItems);
|
|
28468
28558
|
setActiveKey(currentSubUnitId);
|
|
28469
28559
|
if (tabMapRef.current.has(currentSubUnitId)) {
|
|
28470
28560
|
const element = tabMapRef.current.get(currentSubUnitId);
|
|
@@ -29229,7 +29319,7 @@ let WorksheetProtectionRenderController = class WorksheetProtectionRenderControl
|
|
|
29229
29319
|
}
|
|
29230
29320
|
_initRender() {
|
|
29231
29321
|
const renderId = this._context.unitId;
|
|
29232
|
-
const render = renderId && this._renderManagerService.
|
|
29322
|
+
const render = renderId && this._renderManagerService.getRenderUnitById(renderId);
|
|
29233
29323
|
const spreadsheetRender = render && render.mainComponent;
|
|
29234
29324
|
if (spreadsheetRender) {
|
|
29235
29325
|
if (!spreadsheetRender.getExtensionByKey("worksheet-protection")) spreadsheetRender.register(this._worksheetProtectionRenderExtension);
|
|
@@ -29649,7 +29739,7 @@ let SheetContextMenuMobileRenderController = class SheetContextMenuMobileRenderC
|
|
|
29649
29739
|
}
|
|
29650
29740
|
_getCurrentRenderSelections() {
|
|
29651
29741
|
var _selectionRenderServi;
|
|
29652
|
-
const currentRender = this._renderManagerService.
|
|
29742
|
+
const currentRender = this._renderManagerService.getRenderUnitById(this._context.unitId);
|
|
29653
29743
|
const selectionRenderService = currentRender === null || currentRender === void 0 ? void 0 : currentRender.with(ISheetSelectionRenderService);
|
|
29654
29744
|
return (_selectionRenderServi = selectionRenderService === null || selectionRenderService === void 0 ? void 0 : selectionRenderService.getSelectionControls().map((control) => (0, _univerjs_sheets.convertSelectionDataToRange)(control.getValue()))) !== null && _selectionRenderServi !== void 0 ? _selectionRenderServi : [];
|
|
29655
29745
|
}
|
|
@@ -30133,9 +30223,7 @@ let MobileSheetsScrollRenderController = class MobileSheetsScrollRenderControlle
|
|
|
30133
30223
|
}
|
|
30134
30224
|
_getFreeze() {
|
|
30135
30225
|
var _this$_sheetSkeletonM;
|
|
30136
|
-
|
|
30137
|
-
if (snapshot == null) return;
|
|
30138
|
-
return snapshot.freeze;
|
|
30226
|
+
return (_this$_sheetSkeletonM = this._sheetSkeletonManagerService.getCurrentParam()) === null || _this$_sheetSkeletonM === void 0 ? void 0 : _this$_sheetSkeletonM.skeleton.worksheet.getFreeze();
|
|
30139
30227
|
}
|
|
30140
30228
|
_initScrollEventListener() {
|
|
30141
30229
|
const { scene } = this._context;
|
|
@@ -30301,7 +30389,10 @@ let MobileSheetsScrollRenderController = class MobileSheetsScrollRenderControlle
|
|
|
30301
30389
|
const speedFactor = Math.min(swipeSpeed / 2, 1);
|
|
30302
30390
|
multiplier = MIN_VELOCITY_MULTIPLIER + (MAX_VELOCITY_MULTIPLIER - MIN_VELOCITY_MULTIPLIER) * speedFactor;
|
|
30303
30391
|
if (swipeDuration < 150 && Math.abs(instantVelocity) > 3) multiplier *= 1.3;
|
|
30304
|
-
} else
|
|
30392
|
+
} else {
|
|
30393
|
+
const velocityFactor = Math.min(Math.abs(instantVelocity) / 5, 1);
|
|
30394
|
+
multiplier = MIN_VELOCITY_MULTIPLIER * (.5 + velocityFactor * .5);
|
|
30395
|
+
}
|
|
30305
30396
|
return Math.max(MIN_VELOCITY_MULTIPLIER * .5, Math.min(MAX_VELOCITY_MULTIPLIER * 1.5, multiplier));
|
|
30306
30397
|
};
|
|
30307
30398
|
/**
|
|
@@ -30627,7 +30718,10 @@ let MobileSheetsScrollRenderController = class MobileSheetsScrollRenderControlle
|
|
|
30627
30718
|
if (!_touchScrolling) return;
|
|
30628
30719
|
_touchScrolling = false;
|
|
30629
30720
|
const avgVelocity = calculateAverageVelocity();
|
|
30630
|
-
const
|
|
30721
|
+
const swipeDuration = performance.now() - swipeStartTime;
|
|
30722
|
+
const totalDistance = Math.sqrt(swipeTotalDisplacement.x * swipeTotalDisplacement.x + swipeTotalDisplacement.y * swipeTotalDisplacement.y);
|
|
30723
|
+
const instantVelocity = Math.sqrt(avgVelocity.x * avgVelocity.x + avgVelocity.y * avgVelocity.y);
|
|
30724
|
+
const dynamicMultiplier = calculateDynamicVelocityMultiplier(swipeDuration, totalDistance, instantVelocity);
|
|
30631
30725
|
const { maxVelocity, minVelocityThreshold } = getZoomAdjustedParams();
|
|
30632
30726
|
const cappedVelX = Math.max(-maxVelocity, Math.min(maxVelocity, avgVelocity.x * dynamicMultiplier));
|
|
30633
30727
|
const cappedVelY = Math.max(-maxVelocity, Math.min(maxVelocity, avgVelocity.y * dynamicMultiplier));
|
|
@@ -30720,7 +30814,7 @@ let MobileSheetsScrollRenderController = class MobileSheetsScrollRenderControlle
|
|
|
30720
30814
|
if (param == null) return;
|
|
30721
30815
|
const { unitId } = this._context;
|
|
30722
30816
|
const { skeleton } = param;
|
|
30723
|
-
const scene = (_this$_renderManagerS = this._renderManagerService.
|
|
30817
|
+
const scene = (_this$_renderManagerS = this._renderManagerService.getRenderUnitById(unitId)) === null || _this$_renderManagerS === void 0 ? void 0 : _this$_renderManagerS.scene;
|
|
30724
30818
|
if (skeleton == null || scene == null) return;
|
|
30725
30819
|
const { rowTotalHeight, columnTotalWidth, rowHeaderWidthAndMarginLeft, columnHeaderHeightAndMarginTop } = skeleton;
|
|
30726
30820
|
scene === null || scene === void 0 || scene.transformByState({
|
|
@@ -30957,7 +31051,7 @@ let SheetCellDropdownManagerService = class SheetCellDropdownManagerService exte
|
|
|
30957
31051
|
const { location, onHide, closeOnOutSide = true } = param;
|
|
30958
31052
|
const { row, col, unitId, subUnitId } = location;
|
|
30959
31053
|
const component = dropdownMap[param.type];
|
|
30960
|
-
const currentRender = this._renderManagerService.
|
|
31054
|
+
const currentRender = this._renderManagerService.getRenderUnitById(_univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY);
|
|
30961
31055
|
const disposable = new _univerjs_core.DisposableCollection();
|
|
30962
31056
|
const popupDisposable = this._canvasPopupManagerService.attachPopupToCell(row, col, {
|
|
30963
31057
|
componentKey: component.componentKey,
|
|
@@ -31797,6 +31891,7 @@ let UniverSheetsMobileUIPlugin = class UniverSheetsMobileUIPlugin extends _unive
|
|
|
31797
31891
|
[SheetContextMenuMobileRenderController],
|
|
31798
31892
|
[MobileHeaderResizeRenderController],
|
|
31799
31893
|
[MoveRangeRenderController],
|
|
31894
|
+
[AutoFillRenderController],
|
|
31800
31895
|
[EditorBridgeRenderController],
|
|
31801
31896
|
[SheetPermissionInterceptorCanvasRenderController],
|
|
31802
31897
|
[SheetPermissionInterceptorFormulaRenderController],
|
|
@@ -31824,7 +31919,7 @@ _defineProperty(UniverSheetsMobileUIPlugin, "packageName", name);
|
|
|
31824
31919
|
_defineProperty(UniverSheetsMobileUIPlugin, "version", version);
|
|
31825
31920
|
_defineProperty(UniverSheetsMobileUIPlugin, "type", _univerjs_core.UniverInstanceType.UNIVER_SHEET);
|
|
31826
31921
|
UniverSheetsMobileUIPlugin = __decorate([
|
|
31827
|
-
(0, _univerjs_core.DependentOn)(_univerjs_sheets.UniverSheetsPlugin, _univerjs_ui.UniverMobileUIPlugin),
|
|
31922
|
+
(0, _univerjs_core.DependentOn)(_univerjs_docs.UniverDocsPlugin, _univerjs_engine_formula.UniverFormulaEnginePlugin, _univerjs_engine_render.UniverRenderEnginePlugin, _univerjs_sheets.UniverSheetsPlugin, _univerjs_ui.UniverMobileUIPlugin, _univerjs_docs_ui.UniverDocsUIPlugin),
|
|
31828
31923
|
__decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_core.Injector)),
|
|
31829
31924
|
__decorateParam(2, _univerjs_engine_render.IRenderManagerService),
|
|
31830
31925
|
__decorateParam(3, _univerjs_core.IConfigService),
|
|
@@ -32417,6 +32512,7 @@ let UniverSheetsUIPlugin = class UniverSheetsUIPlugin extends _univerjs_core.Plu
|
|
|
32417
32512
|
[CellCustomRenderController],
|
|
32418
32513
|
[SheetContextMenuRenderController],
|
|
32419
32514
|
[MoveRangeRenderController],
|
|
32515
|
+
[AutoFillRenderController],
|
|
32420
32516
|
[EditorBridgeRenderController],
|
|
32421
32517
|
[SheetPermissionInterceptorCanvasRenderController],
|
|
32422
32518
|
[SheetPermissionInterceptorFormulaRenderController],
|
|
@@ -32444,7 +32540,7 @@ _defineProperty(UniverSheetsUIPlugin, "packageName", name);
|
|
|
32444
32540
|
_defineProperty(UniverSheetsUIPlugin, "version", version);
|
|
32445
32541
|
_defineProperty(UniverSheetsUIPlugin, "type", _univerjs_core.UniverInstanceType.UNIVER_SHEET);
|
|
32446
32542
|
UniverSheetsUIPlugin = __decorate([
|
|
32447
|
-
(0, _univerjs_core.DependentOn)(_univerjs_sheets.UniverSheetsPlugin),
|
|
32543
|
+
(0, _univerjs_core.DependentOn)(_univerjs_docs.UniverDocsPlugin, _univerjs_engine_formula.UniverFormulaEnginePlugin, _univerjs_engine_render.UniverRenderEnginePlugin, _univerjs_sheets.UniverSheetsPlugin, _univerjs_ui.UniverUIPlugin, _univerjs_docs_ui.UniverDocsUIPlugin),
|
|
32448
32544
|
__decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_core.Injector)),
|
|
32449
32545
|
__decorateParam(2, _univerjs_engine_render.IRenderManagerService),
|
|
32450
32546
|
__decorateParam(3, _univerjs_core.IConfigService),
|