ato-water-lib 0.0.139 → 0.0.141
Sign up to get free protection for your applications and to get access to all the features.
@@ -8205,6 +8205,13 @@ class AtoDefaultGojsEditor {
|
|
8205
8205
|
})
|
8206
8206
|
: null;
|
8207
8207
|
}
|
8208
|
+
if (this.isSelectBox) {
|
8209
|
+
self.onClickInfoButton.emit({
|
8210
|
+
left: e?.['Wr']?.x,
|
8211
|
+
top: e?.['Wr']?.y,
|
8212
|
+
node: node,
|
8213
|
+
});
|
8214
|
+
}
|
8208
8215
|
},
|
8209
8216
|
selectionAdorned: false,
|
8210
8217
|
selectionAdornmentTemplate: this._initialOptions.isReadOnly || this.isSelectBox
|
@@ -8267,6 +8274,9 @@ class AtoDefaultGojsEditor {
|
|
8267
8274
|
toolTip: this.$('ToolTip', this.$(go.TextBlock, {
|
8268
8275
|
margin: 2,
|
8269
8276
|
}, new go.Binding('text', '', function (data) {
|
8277
|
+
if (self.isSelectBox) {
|
8278
|
+
return data?.name;
|
8279
|
+
}
|
8270
8280
|
if (!self._initialOptions.isReadOnly) {
|
8271
8281
|
return data?.name ?? VALUE_NA;
|
8272
8282
|
}
|
@@ -8631,6 +8641,9 @@ class AtoDefaultGojsEditor {
|
|
8631
8641
|
overflow: go.TextBlock.OverflowEllipsis,
|
8632
8642
|
toolTip: this.$('ToolTip', this.$(go.TextBlock, { margin: 4 }, new go.Binding('text', 'name'))),
|
8633
8643
|
}, new go.Binding('text', 'name').makeTwoWay(), new go.Binding('editable', '', (data) => {
|
8644
|
+
if (data?.editable !== undefined) {
|
8645
|
+
return data?.editable;
|
8646
|
+
}
|
8634
8647
|
return !(AtoGojsEditorModel.TYPE_COMPONENT_WATER?.includes(data?.systemType) &&
|
8635
8648
|
data?.topologyType !== ATO_ECOMPONENT_PLANT_TYPE.WATER &&
|
8636
8649
|
data?.topologyType !== ATO_ECOMPONENT_PLANT_TYPE.WATER_PLANT_CELL);
|
@@ -8640,37 +8653,19 @@ class AtoDefaultGojsEditor {
|
|
8640
8653
|
source: ICONS_BASE64['uf14a'],
|
8641
8654
|
height: 14,
|
8642
8655
|
width: 14,
|
8643
|
-
}, new go.Binding('visible', '', (x) => x?.isSelectBox ?? false)), this.$(go.
|
8644
|
-
alignment: go.Spot.TopLeft,
|
8645
|
-
margin: new go.Margin(2, 0, 0, 2),
|
8646
|
-
stroke: '#DC8FA9',
|
8647
|
-
font: 'bold 9pt Arial',
|
8648
|
-
textAlign: 'left',
|
8649
|
-
}, new go.Binding('text', '', (x) => x?.group_text), new go.Binding('stroke', '', (x) => x?.group_text_stroke)))),
|
8650
|
-
// Select box
|
8651
|
-
// this.$(
|
8652
|
-
// go.Panel,
|
8653
|
-
// 'Auto',
|
8654
|
-
// {
|
8655
|
-
// alignment: go.Spot.TopRight,
|
8656
|
-
// alignmentFocus: go.Spot.TopRight,
|
8657
|
-
// },
|
8658
|
-
// // new go.Binding('visible', '', (x) => x?.isSelectBox ?? false),
|
8659
|
-
// this.$(go.Picture, {
|
8660
|
-
// alignment: go.Spot.Right,
|
8661
|
-
// margin: new go.Margin(2, 0, 0, 0),
|
8662
|
-
// source: ICONS_BASE64['uf14a'],
|
8663
|
-
// height: 17,
|
8664
|
-
// width: 14,
|
8665
|
-
// }),
|
8666
|
-
// ),
|
8667
|
-
this.$(go.Panel, 'Vertical', {
|
8656
|
+
}, new go.Binding('visible', '', (x) => x?.isSelectBox ?? false)), this.$(go.Panel, 'Vertical', {
|
8668
8657
|
alignment: go.Spot.Left,
|
8669
8658
|
alignmentFocus: new go.Spot(0, 0.5, 8, 0),
|
8670
8659
|
}), this.$(go.Panel, 'Vertical', {
|
8671
8660
|
alignment: go.Spot.Right,
|
8672
8661
|
alignmentFocus: new go.Spot(1, 0.5, -8, 0),
|
8673
|
-
}), this.makePort('T', go.Spot.Top, go.Spot.TopSide, false, true), this.makePort('L', go.Spot.Left, go.Spot.LeftSide, false, true), this.makePort('R', go.Spot.Right, go.Spot.RightSide, true, false), this.makePort('B', go.Spot.Bottom, go.Spot.BottomSide, true, false)
|
8662
|
+
}), this.makePort('T', go.Spot.Top, go.Spot.TopSide, false, true), this.makePort('L', go.Spot.Left, go.Spot.LeftSide, false, true), this.makePort('R', go.Spot.Right, go.Spot.RightSide, true, false), this.makePort('B', go.Spot.Bottom, go.Spot.BottomSide, true, false), this.$(go.TextBlock, '', {
|
8663
|
+
alignment: go.Spot.TopLeft,
|
8664
|
+
margin: new go.Margin(2, 0, 0, 2),
|
8665
|
+
stroke: '#DC8FA9',
|
8666
|
+
font: 'bold 9pt Arial',
|
8667
|
+
textAlign: 'left',
|
8668
|
+
}, new go.Binding('text', '', (x) => x?.group_text), new go.Binding('stroke', '', (x) => x?.group_text_stroke)))));
|
8674
8669
|
this.myDiagram.nodeTemplateMap.set(title, node);
|
8675
8670
|
}
|
8676
8671
|
makeEntityTemplateEnergy(icon, title, size = {
|
@@ -9027,7 +9022,7 @@ class AtoDefaultGojsEditor {
|
|
9027
9022
|
toolTip: this.$('ToolTip', this.$(go.TextBlock, {
|
9028
9023
|
margin: 4,
|
9029
9024
|
}, new go.Binding('text', 'name').makeTwoWay())),
|
9030
|
-
}, new go.Binding('text', 'name').makeTwoWay())),
|
9025
|
+
}, new go.Binding('text', 'name').makeTwoWay(), new go.Binding('editable', 'editable'))),
|
9031
9026
|
// this.$('CheckBox', '', {
|
9032
9027
|
// alignment: go.Spot.TopLeft,
|
9033
9028
|
// margin: new go.Margin(2, 0, 0, 2),
|
@@ -9357,8 +9352,14 @@ class AtoDefaultGojsEditor {
|
|
9357
9352
|
this.myDiagram.commitTransaction('add group node');
|
9358
9353
|
}
|
9359
9354
|
deleteNode(e) {
|
9355
|
+
// e.diagram.startTransaction('Delete group node');
|
9356
|
+
// e.diagram.removeParts(e.diagram.selection);
|
9357
|
+
// e.diagram.commitTransaction('Delete group node');
|
9360
9358
|
e.diagram.startTransaction('Delete group node');
|
9361
|
-
e.diagram.
|
9359
|
+
const deletableParts = e.diagram.selection.filter((part) => {
|
9360
|
+
return part.data.deletable !== false;
|
9361
|
+
});
|
9362
|
+
e.diagram.removeParts(deletableParts);
|
9362
9363
|
e.diagram.commitTransaction('Delete group node');
|
9363
9364
|
}
|
9364
9365
|
deleteNodeOnDiagram(e) {
|