devexpress-diagram 2.1.44 → 2.1.45

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.
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * DevExpress Diagram (dx-diagram)
3
- * Version: 2.1.44
4
- * Build date: Wed Jan 12 2022
3
+ * Version: 2.1.45
4
+ * Build date: Thu Jan 13 2022
5
5
  *
6
6
  * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
7
7
  * Read about DevExpress licensing here: https://www.devexpress.com/Support/EULAs
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * DevExpress Diagram (dx-diagram)
3
- * Version: 2.1.44
4
- * Build date: Wed Jan 12 2022
3
+ * Version: 2.1.45
4
+ * Build date: Thu Jan 13 2022
5
5
  *
6
6
  * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
7
7
  * Read about DevExpress licensing here: https://www.devexpress.com/Support/EULAs
@@ -1170,9 +1170,19 @@ var Shape_1 = __webpack_require__(13);
1170
1170
  var ModelUtils = /** @class */ (function () {
1171
1171
  function ModelUtils() {
1172
1172
  }
1173
- ModelUtils.setShapePosition = function (history, model, shape, newPosition) {
1174
- if (!shape.position.equals(newPosition))
1173
+ ModelUtils.setShapePosition = function (history, model, shape, newPosition, includeChildren) {
1174
+ if (includeChildren === void 0) { includeChildren = true; }
1175
+ if (!shape.position.equals(newPosition)) {
1176
+ var delta_1 = newPosition.clone().offset(-shape.position.x, -shape.position.y);
1175
1177
  history.addAndRedo(new MoveShapeHistoryItem_1.MoveShapeHistoryItem(shape.key, newPosition));
1178
+ if (includeChildren)
1179
+ shape.children.forEach(function (child) {
1180
+ if (child instanceof Shape_1.Shape) {
1181
+ var childPosition = child.position.clone().offset(delta_1.x, delta_1.y);
1182
+ ModelUtils.setShapePosition(history, model, child, childPosition);
1183
+ }
1184
+ });
1185
+ }
1176
1186
  };
1177
1187
  ModelUtils.setShapeSize = function (history, model, shape, newPosition, newSize) {
1178
1188
  if (!shape.size.equals(newSize) || !shape.position.equals(newPosition))
@@ -1885,7 +1895,7 @@ var ModelUtils = /** @class */ (function () {
1885
1895
  ModelUtils.applyLayoutToNode = function (history, model, shape, position, connectorsSet) {
1886
1896
  var _this = this;
1887
1897
  var delta = position.clone().offset(-shape.position.x, -shape.position.y);
1888
- ModelUtils.setShapePosition(history, model, shape, position);
1898
+ ModelUtils.setShapePosition(history, model, shape, position, false);
1889
1899
  if (delta.x !== 0 || delta.y !== 0) {
1890
1900
  shape.attachedConnectors
1891
1901
  .filter(function (c) { return !connectorsSet[c.key]; })
@@ -17894,7 +17904,16 @@ var MouseHandlerDragDiagramItemStateBase = /** @class */ (function (_super) {
17894
17904
  var _this = this;
17895
17905
  this.calculateFixedPosition(evt);
17896
17906
  if (this.draggingShapes.length) {
17897
- this.draggingShapes.forEach(function (ds) { return _this.moveShape(ds, evt); });
17907
+ var selectedShapes_1 = this.draggingShapes.map(function (ds) { return ds.shape; });
17908
+ this.draggingShapes.forEach(function (ds) {
17909
+ var shape = ds.shape;
17910
+ while (shape.container) {
17911
+ if (selectedShapes_1.indexOf(shape.container) !== -1)
17912
+ return false;
17913
+ shape = shape.container;
17914
+ }
17915
+ _this.moveShape(ds, evt);
17916
+ });
17898
17917
  var firstDraggingShape = this.draggingShapes[0];
17899
17918
  var offset_1 = vector_1.Vector.fromPoints(firstDraggingShape.startPosition.clone(), firstDraggingShape.shape.position.clone());
17900
17919
  if (offset_1.x || offset_1.y)
@@ -27585,7 +27604,17 @@ var MoveCommand = /** @class */ (function (_super) {
27585
27604
  var _this = this;
27586
27605
  this.control.history.beginTransaction();
27587
27606
  var selection = this.control.selection;
27588
- selection.getSelectedShapes().forEach(function (shape) {
27607
+ var selectedShapes = selection.getSelectedShapes();
27608
+ var selectedShapesWithoutDuplicates = selectedShapes.filter(function (shape) {
27609
+ if (!shape.container)
27610
+ return true;
27611
+ while (shape.container) {
27612
+ if (selectedShapes.indexOf(shape.container) !== -1)
27613
+ return false;
27614
+ shape = shape.container;
27615
+ }
27616
+ });
27617
+ selectedShapesWithoutDuplicates.forEach(function (shape) {
27589
27618
  _this.permissionsProvider.addInteractingItem(shape, __1.DiagramModelOperation.MoveShape);
27590
27619
  var pos = _this.getPosition(shape.position);
27591
27620
  ModelUtils_1.ModelUtils.setShapePosition(_this.control.history, _this.control.model, shape, pos);
@@ -33751,7 +33780,7 @@ var Selection = /** @class */ (function () {
33751
33780
  Selection.prototype.getSelectedItemsCore = function (includeLocked) {
33752
33781
  var _this = this;
33753
33782
  return this.keys.map(function (key) { return _this.model.findItem(key); })
33754
- .filter(function (conn) { return conn && (includeLocked || !conn.isLocked); });
33783
+ .filter(function (item) { return item && (includeLocked || !item.isLocked); });
33755
33784
  };
33756
33785
  Selection.prototype.getSelectedItems = function (includeLocked, includeInsideContainers) {
33757
33786
  if (includeInsideContainers)
@@ -33768,7 +33797,7 @@ var Selection = /** @class */ (function () {
33768
33797
  }
33769
33798
  else
33770
33799
  return this.keys.map(function (key) { return _this.model.findShape(key); })
33771
- .filter(function (conn) { return conn && (includeLocked || !conn.isLocked); });
33800
+ .filter(function (shape) { return shape && (includeLocked || !shape.isLocked); });
33772
33801
  };
33773
33802
  Selection.prototype.getSelectedConnectors = function (includeLocked, includeInsideContainers) {
33774
33803
  var _this = this;
@@ -37524,7 +37553,7 @@ var DataSource = /** @class */ (function () {
37524
37553
  point.x = ModelUtils_1.ModelUtils.getTwipsValue(model.units, node.left);
37525
37554
  if (node.top !== undefined)
37526
37555
  point.y = ModelUtils_1.ModelUtils.getTwipsValue(model.units, node.top);
37527
- ModelUtils_1.ModelUtils.setShapePosition(history, model, shape, point);
37556
+ ModelUtils_1.ModelUtils.setShapePosition(history, model, shape, point, false);
37528
37557
  var size = shape.size.clone();
37529
37558
  if (node.width !== undefined)
37530
37559
  size.width = ModelUtils_1.ModelUtils.getTwipsValue(model.units, node.width);
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * DevExpress Diagram (dx-diagram.min)
3
- * Version: 2.1.44
4
- * Build date: Wed Jan 12 2022
3
+ * Version: 2.1.45
4
+ * Build date: Thu Jan 13 2022
5
5
  *
6
6
  * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
7
7
  * Read about DevExpress licensing here: https://www.devexpress.com/Support/EULAs