@univerjs/sheets-ui 1.0.0-alpha.1 → 1.0.0-alpha.3
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 +51 -40
- package/lib/cjs/index.js +1187 -287
- package/lib/cjs/locale/ar-SA.js +7 -2
- package/lib/cjs/locale/ca-ES.js +7 -2
- package/lib/cjs/locale/de-DE.js +7 -2
- package/lib/cjs/locale/en-US.js +5 -0
- package/lib/cjs/locale/es-ES.js +8 -3
- package/lib/cjs/locale/fa-IR.js +7 -2
- package/lib/cjs/locale/fr-FR.js +7 -2
- package/lib/cjs/locale/id-ID.js +7 -2
- package/lib/cjs/locale/it-IT.js +7 -2
- package/lib/cjs/locale/ja-JP.js +5 -0
- package/lib/cjs/locale/ko-KR.js +5 -0
- package/lib/cjs/locale/pl-PL.js +7 -2
- package/lib/cjs/locale/pt-BR.js +7 -2
- package/lib/cjs/locale/ru-RU.js +7 -2
- package/lib/cjs/locale/sk-SK.js +7 -2
- package/lib/cjs/locale/vi-VN.js +7 -2
- package/lib/cjs/locale/zh-CN.js +5 -0
- package/lib/cjs/locale/zh-HK.js +5 -0
- package/lib/cjs/locale/zh-TW.js +5 -0
- package/lib/es/facade.js +51 -40
- package/lib/es/index.js +1168 -264
- package/lib/es/locale/ar-SA.js +7 -2
- package/lib/es/locale/ca-ES.js +7 -2
- package/lib/es/locale/de-DE.js +7 -2
- package/lib/es/locale/en-US.js +5 -0
- package/lib/es/locale/es-ES.js +8 -3
- package/lib/es/locale/fa-IR.js +7 -2
- package/lib/es/locale/fr-FR.js +7 -2
- package/lib/es/locale/id-ID.js +7 -2
- package/lib/es/locale/it-IT.js +7 -2
- package/lib/es/locale/ja-JP.js +5 -0
- package/lib/es/locale/ko-KR.js +5 -0
- package/lib/es/locale/pl-PL.js +7 -2
- package/lib/es/locale/pt-BR.js +7 -2
- package/lib/es/locale/ru-RU.js +7 -2
- package/lib/es/locale/sk-SK.js +7 -2
- package/lib/es/locale/vi-VN.js +7 -2
- package/lib/es/locale/zh-CN.js +5 -0
- package/lib/es/locale/zh-HK.js +5 -0
- package/lib/es/locale/zh-TW.js +5 -0
- package/lib/facade.js +51 -40
- package/lib/index.css +42 -4
- package/lib/index.js +1168 -264
- package/lib/locale/ar-SA.js +7 -2
- package/lib/locale/ca-ES.js +7 -2
- package/lib/locale/de-DE.js +7 -2
- package/lib/locale/en-US.js +5 -0
- package/lib/locale/es-ES.js +8 -3
- package/lib/locale/fa-IR.js +7 -2
- package/lib/locale/fr-FR.js +7 -2
- package/lib/locale/id-ID.js +7 -2
- package/lib/locale/it-IT.js +7 -2
- package/lib/locale/ja-JP.js +5 -0
- package/lib/locale/ko-KR.js +5 -0
- package/lib/locale/pl-PL.js +7 -2
- package/lib/locale/pt-BR.js +7 -2
- package/lib/locale/ru-RU.js +7 -2
- package/lib/locale/sk-SK.js +7 -2
- package/lib/locale/vi-VN.js +7 -2
- package/lib/locale/zh-CN.js +5 -0
- package/lib/locale/zh-HK.js +5 -0
- package/lib/locale/zh-TW.js +5 -0
- package/lib/types/commands/commands/set-scroll.command.d.ts +3 -0
- package/lib/types/controllers/editor/editing.render-controller.d.ts +1 -0
- package/lib/types/controllers/editor/formula-editor.controller.d.ts +1 -0
- package/lib/types/controllers/render-controllers/contextmenu.render-controller.d.ts +7 -2
- package/lib/types/controllers/render-controllers/editor-bridge.render-controller.d.ts +7 -1
- package/lib/types/controllers/render-controllers/header-unhide.render-controller.d.ts +0 -1
- package/lib/types/embed-tab-anchor.d.ts +23 -0
- package/lib/types/facade/f-range.d.ts +5 -4
- package/lib/types/facade/f-univer.d.ts +1 -0
- package/lib/types/index.d.ts +16 -3
- package/lib/types/locale/en-US.d.ts +5 -0
- package/lib/types/services/canvas-pop-manager.service.d.ts +9 -0
- package/lib/types/services/cell-popup-manager.service.d.ts +1 -0
- package/lib/types/services/editor/cell-editor-resize.service.d.ts +4 -1
- package/lib/types/services/editor-bridge.service.d.ts +2 -0
- package/lib/types/services/print-interceptor.service.d.ts +8 -0
- package/lib/types/services/selection/base-selection-render.service.d.ts +1 -0
- package/lib/types/services/sheet-embed-integration.service.d.ts +126 -0
- package/lib/types/services/sheet-embed-runtime.service.d.ts +26 -0
- package/lib/types/services/sheet-host-chrome-override.service.d.ts +25 -0
- package/lib/types/services/sheet-skeleton-manager.service.d.ts +2 -0
- package/lib/types/views/border-panel/interface.d.ts +63 -2
- package/lib/types/views/editor-container/EditorContainer.d.ts +7 -5
- package/lib/types/{menu/mobile-menu.d.ts → views/editor-container/EditorContainer.spec.d.ts} +1 -1
- package/lib/types/views/editor-container/focus-editor.d.ts +25 -0
- package/lib/types/views/sheet-bar/sheet-bar-tabs/SheetBarItem.d.ts +2 -1
- package/lib/types/views/sheet-bar/sheet-bar-tabs/utils/sheet-tab-drag-sort.d.ts +1 -0
- package/lib/types/views/sheet-bar/sheet-bar-tabs/utils/slide-tab-bar.d.ts +2 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +12 -12
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +16 -16
package/lib/cjs/facade.js
CHANGED
|
@@ -449,7 +449,7 @@ var FUniverSheetsUIMixin = class extends _univerjs_core_facade.FUniver {
|
|
|
449
449
|
if (!workbook) return;
|
|
450
450
|
combined$Disposable.dispose();
|
|
451
451
|
const scrollManagerService = sheetRenderUnit.with(_univerjs_sheets_ui.SheetScrollManagerService);
|
|
452
|
-
const selectionService =
|
|
452
|
+
const selectionService = this._tryGetRenderDependency(sheetRenderUnit, _univerjs_sheets.SheetsSelectionsService);
|
|
453
453
|
combined$Disposable.add(this.registerEventHandler(this.Event.Scroll, () => scrollManagerService.validViewportScrollInfo$.subscribe((params) => {
|
|
454
454
|
if (!params) return;
|
|
455
455
|
const eventParams = {
|
|
@@ -459,46 +459,56 @@ var FUniverSheetsUIMixin = class extends _univerjs_core_facade.FUniver {
|
|
|
459
459
|
};
|
|
460
460
|
this.fireEvent(this.Event.Scroll, eventParams);
|
|
461
461
|
})));
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
462
|
+
if (selectionService) {
|
|
463
|
+
combined$Disposable.add(this.registerEventHandler(this.Event.SelectionMoveStart, () => selectionService.selectionMoveStart$.subscribe((selections) => {
|
|
464
|
+
var _selections$map;
|
|
465
|
+
const eventParams = {
|
|
466
|
+
workbook,
|
|
467
|
+
worksheet: workbook.getActiveSheet(),
|
|
468
|
+
selections: (_selections$map = selections === null || selections === void 0 ? void 0 : selections.map((s) => s.range)) !== null && _selections$map !== void 0 ? _selections$map : []
|
|
469
|
+
};
|
|
470
|
+
this.fireEvent(this.Event.SelectionMoveStart, eventParams);
|
|
471
|
+
})));
|
|
472
|
+
combined$Disposable.add(this.registerEventHandler(this.Event.SelectionMoving, () => selectionService.selectionMoving$.subscribe((selections) => {
|
|
473
|
+
var _selections$map2;
|
|
474
|
+
const eventParams = {
|
|
475
|
+
workbook,
|
|
476
|
+
worksheet: workbook.getActiveSheet(),
|
|
477
|
+
selections: (_selections$map2 = selections === null || selections === void 0 ? void 0 : selections.map((s) => s.range)) !== null && _selections$map2 !== void 0 ? _selections$map2 : []
|
|
478
|
+
};
|
|
479
|
+
this.fireEvent(this.Event.SelectionMoving, eventParams);
|
|
480
|
+
})));
|
|
481
|
+
combined$Disposable.add(this.registerEventHandler(this.Event.SelectionMoveEnd, () => selectionService.selectionMoveEnd$.subscribe((selections) => {
|
|
482
|
+
var _selections$map3;
|
|
483
|
+
const eventParams = {
|
|
484
|
+
workbook,
|
|
485
|
+
worksheet: workbook.getActiveSheet(),
|
|
486
|
+
selections: (_selections$map3 = selections === null || selections === void 0 ? void 0 : selections.map((s) => s.range)) !== null && _selections$map3 !== void 0 ? _selections$map3 : []
|
|
487
|
+
};
|
|
488
|
+
this.fireEvent(this.Event.SelectionMoveEnd, eventParams);
|
|
489
|
+
})));
|
|
490
|
+
combined$Disposable.add(this.registerEventHandler(this.Event.SelectionChanged, () => selectionService.selectionChanged$.subscribe((selections) => {
|
|
491
|
+
var _selections$map4;
|
|
492
|
+
const eventParams = {
|
|
493
|
+
workbook,
|
|
494
|
+
worksheet: workbook.getActiveSheet(),
|
|
495
|
+
selections: (_selections$map4 = selections === null || selections === void 0 ? void 0 : selections.map((s) => s.range)) !== null && _selections$map4 !== void 0 ? _selections$map4 : []
|
|
496
|
+
};
|
|
497
|
+
this.fireEvent(this.Event.SelectionChanged, eventParams);
|
|
498
|
+
})));
|
|
499
|
+
}
|
|
498
500
|
sheetRenderUnit = null;
|
|
499
501
|
this.disposeWithMe(combined$Disposable);
|
|
500
502
|
}));
|
|
501
503
|
}
|
|
504
|
+
_tryGetRenderDependency(render, dependency) {
|
|
505
|
+
try {
|
|
506
|
+
return render.with(dependency);
|
|
507
|
+
} catch (error) {
|
|
508
|
+
if (error instanceof Error && (error.message.includes("DependencyNotFoundError") || error.message.includes("Cannot find"))) return null;
|
|
509
|
+
throw error;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
502
512
|
/**
|
|
503
513
|
* @ignore
|
|
504
514
|
*/
|
|
@@ -1276,13 +1286,14 @@ _univerjs_sheets_facade.FRange.extend(FRangeSheetsUIMixin);
|
|
|
1276
1286
|
* @returns {string} The transformed component key.
|
|
1277
1287
|
*/
|
|
1278
1288
|
function transformComponentKey(component, componentManager) {
|
|
1279
|
-
const { componentKey,
|
|
1289
|
+
const { componentKey, framework } = component;
|
|
1280
1290
|
let key;
|
|
1281
1291
|
const disposableCollection = new _univerjs_core.DisposableCollection();
|
|
1282
1292
|
if (typeof componentKey === "string") key = componentKey;
|
|
1283
1293
|
else {
|
|
1284
|
-
|
|
1285
|
-
|
|
1294
|
+
const resolvedFramework = framework !== null && framework !== void 0 ? framework : "react";
|
|
1295
|
+
key = resolvedFramework === "web-component" ? `external-${(0, _univerjs_core.generateRandomId)(6).toLowerCase()}` : `External_${(0, _univerjs_core.generateRandomId)(6)}`;
|
|
1296
|
+
disposableCollection.add(componentManager.register(key, componentKey, { framework: resolvedFramework }));
|
|
1286
1297
|
}
|
|
1287
1298
|
return {
|
|
1288
1299
|
key,
|