@univerjs/sheets-ui 1.0.0-alpha.7 → 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/facade.js +14 -41
- package/lib/cjs/index.js +736 -838
- 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 +1 -3
- package/lib/cjs/locale/zh-HK.js +3 -5
- package/lib/cjs/locale/zh-TW.js +3 -5
- package/lib/es/facade.js +15 -42
- package/lib/es/index.js +743 -845
- 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 +1 -3
- package/lib/es/locale/zh-HK.js +3 -5
- package/lib/es/locale/zh-TW.js +3 -5
- package/lib/facade.js +15 -42
- package/lib/index.css +6 -5
- package/lib/index.js +743 -845
- 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 +1 -3
- package/lib/locale/zh-HK.js +3 -5
- package/lib/locale/zh-TW.js +3 -5
- 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/editor/editing.render-controller.d.ts +0 -1
- 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-bar/sheet-bar-tabs/utils/slide-tab-bar.d.ts +0 -1
- package/lib/types/views/sheet-container/SheetContainer.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/facade.js
CHANGED
|
@@ -461,38 +461,34 @@ var FUniverSheetsUIMixin = class extends _univerjs_core_facade.FUniver {
|
|
|
461
461
|
})));
|
|
462
462
|
if (selectionService) {
|
|
463
463
|
combined$Disposable.add(this.registerEventHandler(this.Event.SelectionMoveStart, () => selectionService.selectionMoveStart$.subscribe((selections) => {
|
|
464
|
-
var _selections$map;
|
|
465
464
|
const eventParams = {
|
|
466
465
|
workbook,
|
|
467
466
|
worksheet: workbook.getActiveSheet(),
|
|
468
|
-
selections: (
|
|
467
|
+
selections: (selections === null || selections === void 0 ? void 0 : selections.map((s) => s.range)) ?? []
|
|
469
468
|
};
|
|
470
469
|
this.fireEvent(this.Event.SelectionMoveStart, eventParams);
|
|
471
470
|
})));
|
|
472
471
|
combined$Disposable.add(this.registerEventHandler(this.Event.SelectionMoving, () => selectionService.selectionMoving$.subscribe((selections) => {
|
|
473
|
-
var _selections$map2;
|
|
474
472
|
const eventParams = {
|
|
475
473
|
workbook,
|
|
476
474
|
worksheet: workbook.getActiveSheet(),
|
|
477
|
-
selections: (
|
|
475
|
+
selections: (selections === null || selections === void 0 ? void 0 : selections.map((s) => s.range)) ?? []
|
|
478
476
|
};
|
|
479
477
|
this.fireEvent(this.Event.SelectionMoving, eventParams);
|
|
480
478
|
})));
|
|
481
479
|
combined$Disposable.add(this.registerEventHandler(this.Event.SelectionMoveEnd, () => selectionService.selectionMoveEnd$.subscribe((selections) => {
|
|
482
|
-
var _selections$map3;
|
|
483
480
|
const eventParams = {
|
|
484
481
|
workbook,
|
|
485
482
|
worksheet: workbook.getActiveSheet(),
|
|
486
|
-
selections: (
|
|
483
|
+
selections: (selections === null || selections === void 0 ? void 0 : selections.map((s) => s.range)) ?? []
|
|
487
484
|
};
|
|
488
485
|
this.fireEvent(this.Event.SelectionMoveEnd, eventParams);
|
|
489
486
|
})));
|
|
490
487
|
combined$Disposable.add(this.registerEventHandler(this.Event.SelectionChanged, () => selectionService.selectionChanged$.subscribe((selections) => {
|
|
491
|
-
var _selections$map4;
|
|
492
488
|
const eventParams = {
|
|
493
489
|
workbook,
|
|
494
490
|
worksheet: workbook.getActiveSheet(),
|
|
495
|
-
selections: (
|
|
491
|
+
selections: (selections === null || selections === void 0 ? void 0 : selections.map((s) => s.range)) ?? []
|
|
496
492
|
};
|
|
497
493
|
this.fireEvent(this.Event.SelectionChanged, eventParams);
|
|
498
494
|
})));
|
|
@@ -737,20 +733,6 @@ _univerjs_core_facade.FUniver.extend(FUniverSheetsUIMixin);
|
|
|
737
733
|
//#endregion
|
|
738
734
|
//#region src/facade/f-workbook.ts
|
|
739
735
|
var FWorkbookSheetsUIMixin = class extends _univerjs_sheets_facade.FWorkbook {
|
|
740
|
-
openSiderbar(params) {
|
|
741
|
-
this._logDeprecation("openSiderbar");
|
|
742
|
-
return this._injector.get(_univerjs_ui.ISidebarService).open(params);
|
|
743
|
-
}
|
|
744
|
-
openDialog(dialog) {
|
|
745
|
-
this._logDeprecation("openDialog");
|
|
746
|
-
const disposable = this._injector.get(_univerjs_ui.IDialogService).open({
|
|
747
|
-
...dialog,
|
|
748
|
-
onClose: () => {
|
|
749
|
-
disposable.dispose();
|
|
750
|
-
}
|
|
751
|
-
});
|
|
752
|
-
return disposable;
|
|
753
|
-
}
|
|
754
736
|
customizeColumnHeader(cfg) {
|
|
755
737
|
const unitId = this._workbook.getUnitId();
|
|
756
738
|
this._getSheetRenderComponent(unitId, _univerjs_sheets_ui.SHEET_VIEW_KEY.COLUMN).setCustomHeader(cfg);
|
|
@@ -931,10 +913,7 @@ var FWorksheetUIMixin = class extends _univerjs_sheets_facade.FWorksheet {
|
|
|
931
913
|
const service = (_this$_injector$get$g = this._injector.get(_univerjs_engine_render.IRenderManagerService).getRenderUnitById(this._workbook.getUnitId())) === null || _this$_injector$get$g === void 0 ? void 0 : _this$_injector$get$g.with(_univerjs_sheets_ui.SheetSkeletonManagerService);
|
|
932
914
|
return service === null || service === void 0 ? void 0 : service.getSkeleton(this._worksheet.getSheetId());
|
|
933
915
|
}
|
|
934
|
-
|
|
935
|
-
return this.autoResizeColumns(columnPosition, 1);
|
|
936
|
-
}
|
|
937
|
-
autoResizeColumns(startColumn, numColumns) {
|
|
916
|
+
autoResizeColumns(startColumn, numColumns = 1) {
|
|
938
917
|
const unitId = this._workbook.getUnitId();
|
|
939
918
|
const subUnitId = this._worksheet.getSheetId();
|
|
940
919
|
const ranges = [{
|
|
@@ -950,10 +929,7 @@ var FWorksheetUIMixin = class extends _univerjs_sheets_facade.FWorksheet {
|
|
|
950
929
|
});
|
|
951
930
|
return this;
|
|
952
931
|
}
|
|
953
|
-
|
|
954
|
-
return this.autoResizeColumns(columnPosition, numColumn);
|
|
955
|
-
}
|
|
956
|
-
autoResizeRows(startRow, numRows) {
|
|
932
|
+
autoResizeRows(startRow, numRows = 1) {
|
|
957
933
|
const unitId = this._workbook.getUnitId();
|
|
958
934
|
const subUnitId = this._worksheet.getSheetId();
|
|
959
935
|
const ranges = [{
|
|
@@ -1190,15 +1166,13 @@ var FRangeSheetsUIMixin = class extends _univerjs_sheets_facade.FRange {
|
|
|
1190
1166
|
};
|
|
1191
1167
|
}
|
|
1192
1168
|
generateHTML() {
|
|
1193
|
-
var _copyContent$html;
|
|
1194
1169
|
const copyContent = this._injector.get(_univerjs_sheets_ui.ISheetClipboardService).generateCopyContent(this._workbook.getUnitId(), this._worksheet.getSheetId(), this._range);
|
|
1195
|
-
return (
|
|
1170
|
+
return (copyContent === null || copyContent === void 0 ? void 0 : copyContent.html) ?? "";
|
|
1196
1171
|
}
|
|
1197
1172
|
attachPopup(popup) {
|
|
1198
|
-
|
|
1199
|
-
popup.
|
|
1200
|
-
popup.
|
|
1201
|
-
popup.offset = (_popup$offset = popup.offset) !== null && _popup$offset !== void 0 ? _popup$offset : [0, 0];
|
|
1173
|
+
popup.direction = popup.direction ?? "horizontal";
|
|
1174
|
+
popup.extraProps = popup.extraProps ?? {};
|
|
1175
|
+
popup.offset = popup.offset ?? [0, 0];
|
|
1202
1176
|
const { key, disposableCollection } = transformComponentKey(popup, this._injector.get(_univerjs_ui.ComponentManager));
|
|
1203
1177
|
const disposePopup = this._injector.get(_univerjs_sheets_ui.SheetCanvasPopManagerService).attachPopupToCell(this._range.startRow, this._range.startColumn, {
|
|
1204
1178
|
...popup,
|
|
@@ -1246,10 +1220,9 @@ var FRangeSheetsUIMixin = class extends _univerjs_sheets_facade.FRange {
|
|
|
1246
1220
|
* ```
|
|
1247
1221
|
*/
|
|
1248
1222
|
attachRangePopup(popup) {
|
|
1249
|
-
|
|
1250
|
-
popup.
|
|
1251
|
-
popup.
|
|
1252
|
-
popup.offset = (_popup$offset2 = popup.offset) !== null && _popup$offset2 !== void 0 ? _popup$offset2 : [0, 0];
|
|
1223
|
+
popup.direction = popup.direction ?? "top-center";
|
|
1224
|
+
popup.extraProps = popup.extraProps ?? {};
|
|
1225
|
+
popup.offset = popup.offset ?? [0, 0];
|
|
1253
1226
|
const { key, disposableCollection } = transformComponentKey(popup, this._injector.get(_univerjs_ui.ComponentManager));
|
|
1254
1227
|
const disposePopup = this._injector.get(_univerjs_sheets_ui.SheetCanvasPopManagerService).attachRangePopup(this._range, {
|
|
1255
1228
|
...popup,
|
|
@@ -1291,7 +1264,7 @@ function transformComponentKey(component, componentManager) {
|
|
|
1291
1264
|
const disposableCollection = new _univerjs_core.DisposableCollection();
|
|
1292
1265
|
if (typeof componentKey === "string") key = componentKey;
|
|
1293
1266
|
else {
|
|
1294
|
-
const resolvedFramework = framework
|
|
1267
|
+
const resolvedFramework = framework ?? "react";
|
|
1295
1268
|
key = resolvedFramework === "web-component" ? `external-${(0, _univerjs_core.generateRandomId)(6).toLowerCase()}` : `External_${(0, _univerjs_core.generateRandomId)(6)}`;
|
|
1296
1269
|
disposableCollection.add(componentManager.register(key, componentKey, { framework: resolvedFramework }));
|
|
1297
1270
|
}
|