@tmagic/stage 1.3.0-alpha.17 → 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 +4 -4
- 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
|
@@ -1182,7 +1182,7 @@
|
|
|
1182
1182
|
constructor(config) {
|
|
1183
1183
|
const moveableOptionsManagerConfig = {
|
|
1184
1184
|
container: config.container,
|
|
1185
|
-
moveableOptions: config.
|
|
1185
|
+
moveableOptions: config.moveableOptions,
|
|
1186
1186
|
getRootContainer: config.getRootContainer
|
|
1187
1187
|
};
|
|
1188
1188
|
super(moveableOptionsManagerConfig);
|
|
@@ -1276,10 +1276,11 @@
|
|
|
1276
1276
|
const options = this.getOptions(true, {
|
|
1277
1277
|
target: this.dragResizeHelper.getShadowEls()
|
|
1278
1278
|
});
|
|
1279
|
+
console.log(options);
|
|
1279
1280
|
Object.entries(options).forEach(([key, value]) => {
|
|
1280
1281
|
this.moveableForMulti[key] = value;
|
|
1281
1282
|
});
|
|
1282
|
-
this.moveableForMulti.
|
|
1283
|
+
this.moveableForMulti.updateRect();
|
|
1283
1284
|
}
|
|
1284
1285
|
/**
|
|
1285
1286
|
* 清除多选状态
|
|
@@ -1374,7 +1375,7 @@
|
|
|
1374
1375
|
this.dr = new StageDragResize({
|
|
1375
1376
|
container: config.container,
|
|
1376
1377
|
disabledDragStart: config.disabledDragStart,
|
|
1377
|
-
moveableOptions: this.changeCallback(config.moveableOptions),
|
|
1378
|
+
moveableOptions: this.changeCallback(config.moveableOptions, false),
|
|
1378
1379
|
dragResizeHelper: createDrHelper(),
|
|
1379
1380
|
getRootContainer: config.getRootContainer,
|
|
1380
1381
|
getRenderDocument: config.getRenderDocument,
|
|
@@ -1383,7 +1384,7 @@
|
|
|
1383
1384
|
});
|
|
1384
1385
|
this.multiDr = new StageMultiDragResize({
|
|
1385
1386
|
container: config.container,
|
|
1386
|
-
|
|
1387
|
+
moveableOptions: this.changeCallback(config.moveableOptions, true),
|
|
1387
1388
|
dragResizeHelper: createDrHelper(),
|
|
1388
1389
|
getRootContainer: config.getRootContainer,
|
|
1389
1390
|
getRenderDocument: config.getRenderDocument,
|
|
@@ -1584,12 +1585,16 @@
|
|
|
1584
1585
|
this.multiDr.destroy();
|
|
1585
1586
|
this.highlightLayer.destroy();
|
|
1586
1587
|
}
|
|
1587
|
-
changeCallback(options) {
|
|
1588
|
+
changeCallback(options, isMulti) {
|
|
1588
1589
|
if (typeof options === "function") {
|
|
1589
1590
|
return () => {
|
|
1590
1591
|
if (typeof options === "function") {
|
|
1591
1592
|
const cfg = {
|
|
1592
|
-
|
|
1593
|
+
targetEl: this.selectedEl,
|
|
1594
|
+
targetElId: this.selectedEl?.id,
|
|
1595
|
+
targetEls: this.selectedElList,
|
|
1596
|
+
targetElIds: this.selectedElList?.map((item) => item.id),
|
|
1597
|
+
isMulti
|
|
1593
1598
|
};
|
|
1594
1599
|
return options(cfg);
|
|
1595
1600
|
}
|
|
@@ -2468,7 +2473,6 @@
|
|
|
2468
2473
|
containerHighlightDuration: config.containerHighlightDuration,
|
|
2469
2474
|
containerHighlightType: config.containerHighlightType,
|
|
2470
2475
|
moveableOptions: config.moveableOptions,
|
|
2471
|
-
multiMoveableOptions: config.multiMoveableOptions,
|
|
2472
2476
|
container: this.mask.content,
|
|
2473
2477
|
disabledDragStart: config.disabledDragStart,
|
|
2474
2478
|
canSelect: config.canSelect,
|