@univerjs/sheets-ui 1.0.0-alpha.8 → 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 +12 -19
- package/lib/cjs/index.js +406 -470
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-HK.js +3 -3
- package/lib/cjs/locale/zh-TW.js +3 -3
- package/lib/es/facade.js +12 -19
- package/lib/es/index.js +411 -475
- package/lib/es/locale/zh-CN.js +1 -1
- package/lib/es/locale/zh-HK.js +3 -3
- package/lib/es/locale/zh-TW.js +3 -3
- package/lib/facade.js +12 -19
- package/lib/index.css +6 -5
- package/lib/index.js +411 -475
- package/lib/locale/zh-CN.js +1 -1
- package/lib/locale/zh-HK.js +3 -3
- package/lib/locale/zh-TW.js +3 -3
- package/lib/types/controllers/editor/editing.render-controller.d.ts +0 -1
- package/lib/types/views/sheet-bar/sheet-bar-tabs/utils/slide-tab-bar.d.ts +0 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +11 -11
- 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/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
|
})));
|
|
@@ -1170,15 +1166,13 @@ var FRangeSheetsUIMixin = class extends _univerjs_sheets_facade.FRange {
|
|
|
1170
1166
|
};
|
|
1171
1167
|
}
|
|
1172
1168
|
generateHTML() {
|
|
1173
|
-
var _copyContent$html;
|
|
1174
1169
|
const copyContent = this._injector.get(_univerjs_sheets_ui.ISheetClipboardService).generateCopyContent(this._workbook.getUnitId(), this._worksheet.getSheetId(), this._range);
|
|
1175
|
-
return (
|
|
1170
|
+
return (copyContent === null || copyContent === void 0 ? void 0 : copyContent.html) ?? "";
|
|
1176
1171
|
}
|
|
1177
1172
|
attachPopup(popup) {
|
|
1178
|
-
|
|
1179
|
-
popup.
|
|
1180
|
-
popup.
|
|
1181
|
-
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];
|
|
1182
1176
|
const { key, disposableCollection } = transformComponentKey(popup, this._injector.get(_univerjs_ui.ComponentManager));
|
|
1183
1177
|
const disposePopup = this._injector.get(_univerjs_sheets_ui.SheetCanvasPopManagerService).attachPopupToCell(this._range.startRow, this._range.startColumn, {
|
|
1184
1178
|
...popup,
|
|
@@ -1226,10 +1220,9 @@ var FRangeSheetsUIMixin = class extends _univerjs_sheets_facade.FRange {
|
|
|
1226
1220
|
* ```
|
|
1227
1221
|
*/
|
|
1228
1222
|
attachRangePopup(popup) {
|
|
1229
|
-
|
|
1230
|
-
popup.
|
|
1231
|
-
popup.
|
|
1232
|
-
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];
|
|
1233
1226
|
const { key, disposableCollection } = transformComponentKey(popup, this._injector.get(_univerjs_ui.ComponentManager));
|
|
1234
1227
|
const disposePopup = this._injector.get(_univerjs_sheets_ui.SheetCanvasPopManagerService).attachRangePopup(this._range, {
|
|
1235
1228
|
...popup,
|
|
@@ -1271,7 +1264,7 @@ function transformComponentKey(component, componentManager) {
|
|
|
1271
1264
|
const disposableCollection = new _univerjs_core.DisposableCollection();
|
|
1272
1265
|
if (typeof componentKey === "string") key = componentKey;
|
|
1273
1266
|
else {
|
|
1274
|
-
const resolvedFramework = framework
|
|
1267
|
+
const resolvedFramework = framework ?? "react";
|
|
1275
1268
|
key = resolvedFramework === "web-component" ? `external-${(0, _univerjs_core.generateRandomId)(6).toLowerCase()}` : `External_${(0, _univerjs_core.generateRandomId)(6)}`;
|
|
1276
1269
|
disposableCollection.add(componentManager.register(key, componentKey, { framework: resolvedFramework }));
|
|
1277
1270
|
}
|