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