@tmagic/stage 1.3.0-alpha.17 → 1.3.0-alpha.19
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/dist/tmagic-stage.js +13 -10
- package/dist/tmagic-stage.js.map +1 -1
- package/dist/tmagic-stage.umd.cjs +13 -10
- package/dist/tmagic-stage.umd.cjs.map +1 -1
- package/package.json +4 -4
- package/src/ActionManager.ts +7 -3
- package/src/MoveableOptionsManager.ts +2 -3
- package/src/StageCore.ts +0 -1
- package/src/StageMultiDragResize.ts +4 -2
- package/src/types.ts +5 -3
- package/types/types.d.ts +5 -3
package/dist/tmagic-stage.js
CHANGED
|
@@ -756,9 +756,8 @@ class MoveableOptionsManager extends EventEmitter {
|
|
|
756
756
|
elementGuidelines: this.elementGuidelines,
|
|
757
757
|
bounds: {
|
|
758
758
|
top: 0,
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
right: this.container.clientWidth - 1,
|
|
759
|
+
left: 0,
|
|
760
|
+
right: this.container.clientWidth,
|
|
762
761
|
bottom: isSortable ? void 0 : this.container.clientHeight
|
|
763
762
|
}
|
|
764
763
|
};
|
|
@@ -1185,7 +1184,7 @@ class StageMultiDragResize extends MoveableOptionsManager {
|
|
|
1185
1184
|
constructor(config) {
|
|
1186
1185
|
const moveableOptionsManagerConfig = {
|
|
1187
1186
|
container: config.container,
|
|
1188
|
-
moveableOptions: config.
|
|
1187
|
+
moveableOptions: config.moveableOptions,
|
|
1189
1188
|
getRootContainer: config.getRootContainer
|
|
1190
1189
|
};
|
|
1191
1190
|
super(moveableOptionsManagerConfig);
|
|
@@ -1279,10 +1278,11 @@ class StageMultiDragResize extends MoveableOptionsManager {
|
|
|
1279
1278
|
const options = this.getOptions(true, {
|
|
1280
1279
|
target: this.dragResizeHelper.getShadowEls()
|
|
1281
1280
|
});
|
|
1281
|
+
console.log(options);
|
|
1282
1282
|
Object.entries(options).forEach(([key, value]) => {
|
|
1283
1283
|
this.moveableForMulti[key] = value;
|
|
1284
1284
|
});
|
|
1285
|
-
this.moveableForMulti.
|
|
1285
|
+
this.moveableForMulti.updateRect();
|
|
1286
1286
|
}
|
|
1287
1287
|
/**
|
|
1288
1288
|
* 清除多选状态
|
|
@@ -1377,7 +1377,7 @@ class ActionManager extends EventEmitter {
|
|
|
1377
1377
|
this.dr = new StageDragResize({
|
|
1378
1378
|
container: config.container,
|
|
1379
1379
|
disabledDragStart: config.disabledDragStart,
|
|
1380
|
-
moveableOptions: this.changeCallback(config.moveableOptions),
|
|
1380
|
+
moveableOptions: this.changeCallback(config.moveableOptions, false),
|
|
1381
1381
|
dragResizeHelper: createDrHelper(),
|
|
1382
1382
|
getRootContainer: config.getRootContainer,
|
|
1383
1383
|
getRenderDocument: config.getRenderDocument,
|
|
@@ -1386,7 +1386,7 @@ class ActionManager extends EventEmitter {
|
|
|
1386
1386
|
});
|
|
1387
1387
|
this.multiDr = new StageMultiDragResize({
|
|
1388
1388
|
container: config.container,
|
|
1389
|
-
|
|
1389
|
+
moveableOptions: this.changeCallback(config.moveableOptions, true),
|
|
1390
1390
|
dragResizeHelper: createDrHelper(),
|
|
1391
1391
|
getRootContainer: config.getRootContainer,
|
|
1392
1392
|
getRenderDocument: config.getRenderDocument,
|
|
@@ -1587,12 +1587,16 @@ class ActionManager extends EventEmitter {
|
|
|
1587
1587
|
this.multiDr.destroy();
|
|
1588
1588
|
this.highlightLayer.destroy();
|
|
1589
1589
|
}
|
|
1590
|
-
changeCallback(options) {
|
|
1590
|
+
changeCallback(options, isMulti) {
|
|
1591
1591
|
if (typeof options === "function") {
|
|
1592
1592
|
return () => {
|
|
1593
1593
|
if (typeof options === "function") {
|
|
1594
1594
|
const cfg = {
|
|
1595
|
-
|
|
1595
|
+
targetEl: this.selectedEl,
|
|
1596
|
+
targetElId: this.selectedEl?.id,
|
|
1597
|
+
targetEls: this.selectedElList,
|
|
1598
|
+
targetElIds: this.selectedElList?.map((item) => item.id),
|
|
1599
|
+
isMulti
|
|
1596
1600
|
};
|
|
1597
1601
|
return options(cfg);
|
|
1598
1602
|
}
|
|
@@ -2471,7 +2475,6 @@ class StageCore extends EventEmitter$1 {
|
|
|
2471
2475
|
containerHighlightDuration: config.containerHighlightDuration,
|
|
2472
2476
|
containerHighlightType: config.containerHighlightType,
|
|
2473
2477
|
moveableOptions: config.moveableOptions,
|
|
2474
|
-
multiMoveableOptions: config.multiMoveableOptions,
|
|
2475
2478
|
container: this.mask.content,
|
|
2476
2479
|
disabledDragStart: config.disabledDragStart,
|
|
2477
2480
|
canSelect: config.canSelect,
|