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