ato-water-lib 0.0.53 → 0.0.56

Sign up to get free protection for your applications and to get access to all the features.
@@ -3359,12 +3359,14 @@ class AtoDefaultGojsEditor {
3359
3359
  });
3360
3360
  // Remove Node and Node Group
3361
3361
  _.forEach(this.myDiagram.nodeTemplateMap?.Hb, (temp) => {
3362
- if (temp?.key && !this.editor.data?.nodeDataArray?.some((node) => node?.type === temp?.key)) {
3362
+ if (temp?.key &&
3363
+ !this.editor.data?.nodeDataArray?.some((node) => node?.type === temp?.key)) {
3363
3364
  this.myDiagram.nodeTemplateMap.remove(temp?.key);
3364
3365
  }
3365
3366
  });
3366
3367
  _.forEach(this.myDiagram.groupTemplateMap?.Hb, (temp) => {
3367
- if (temp?.key && !this.editor.data?.nodeDataArray?.some((node) => node?.type === temp?.key)) {
3368
+ if (temp?.key &&
3369
+ !this.editor.data?.nodeDataArray?.some((node) => node?.type === temp?.key)) {
3368
3370
  this.myDiagram.groupTemplateMap.remove(temp?.key);
3369
3371
  }
3370
3372
  });
@@ -3394,7 +3396,8 @@ class AtoDefaultGojsEditor {
3394
3396
  this.makeGroupZoneTemplate();
3395
3397
  return;
3396
3398
  }
3397
- if (node?.type === AtoGojsEditorModel.ENUM_TEMPLATES.PLANT_CELL && node?.isGroup) {
3399
+ if (node?.type === AtoGojsEditorModel.ENUM_TEMPLATES.PLANT_CELL &&
3400
+ node?.isGroup) {
3398
3401
  this.groupPlantCellTemplate(AtoGojsEditorModel.NODE_TEMPLATES[node?.type].icon, AtoGojsEditorModel.NODE_TEMPLATES[node?.type].name);
3399
3402
  return;
3400
3403
  }
@@ -3418,11 +3421,13 @@ class AtoDefaultGojsEditor {
3418
3421
  }
3419
3422
  // Not Group
3420
3423
  // Component Water Normal
3421
- if (AtoGojsEditorModel.TYPE_TEMPLATE_WATER_NORMAL?.includes(node?.type) && !node?.isGroup) {
3424
+ if (AtoGojsEditorModel.TYPE_TEMPLATE_WATER_NORMAL?.includes(node?.type) &&
3425
+ !node?.isGroup) {
3422
3426
  this.makeEntityTemplate(AtoGojsEditorModel.NODE_TEMPLATES[node?.type].icon ?? '', AtoGojsEditorModel.NODE_TEMPLATES[node?.type].name ?? '');
3423
3427
  }
3424
3428
  // Component Water Withdraw Or Discharge
3425
- if (AtoGojsEditorModel.TYPE_TEMPLATE_WATER_WITHDRAW_OR_DISCHARGE?.includes(node?.type) && !node?.isGroup) {
3429
+ if (AtoGojsEditorModel.TYPE_TEMPLATE_WATER_WITHDRAW_OR_DISCHARGE?.includes(node?.type) &&
3430
+ !node?.isGroup) {
3426
3431
  this.makeEntityWithdrawOrDischarge(AtoGojsEditorModel.NODE_TEMPLATES[node?.type].icon ?? '', AtoGojsEditorModel.NODE_TEMPLATES[node?.type].name ?? '');
3427
3432
  }
3428
3433
  // Component Energy Normal
@@ -3475,7 +3480,8 @@ class AtoDefaultGojsEditor {
3475
3480
  this.makeSpecialTemplate(AtoGojsEditorModel.NODE_TEMPLATES[node?.type].icon, AtoGojsEditorModel.NODE_TEMPLATES[node?.type].name);
3476
3481
  }
3477
3482
  // Plant Cell
3478
- if (node?.type === AtoGojsEditorModel.ENUM_TEMPLATES.PLANT_CELL && !node?.isGroup) {
3483
+ if (node?.type === AtoGojsEditorModel.ENUM_TEMPLATES.PLANT_CELL &&
3484
+ !node?.isGroup) {
3479
3485
  this.plantCellTemplate(AtoGojsEditorModel.NODE_TEMPLATES[node?.type].icon, AtoGojsEditorModel.NODE_TEMPLATES[node?.type].name);
3480
3486
  }
3481
3487
  }
@@ -3503,7 +3509,8 @@ class AtoDefaultGojsEditor {
3503
3509
  this.myDiagram.dragSelectingTool = this.initialOptions?.dragSelectingTool;
3504
3510
  this.myDiagram.toolManager.draggingTool.isGridSnapEnabled =
3505
3511
  this.initialOptions?.['draggingTool.isGridSnapEnabled'] ?? false;
3506
- if (this.myDiagram.toolManager && this.myDiagram.toolManager.draggingTool) {
3512
+ if (this.myDiagram.toolManager &&
3513
+ this.myDiagram.toolManager.draggingTool) {
3507
3514
  if (this.initialOptions?.['draggingTool.gridSnapCellSize']) {
3508
3515
  this.myDiagram.toolManager.draggingTool.gridSnapCellSize =
3509
3516
  this.initialOptions?.['draggingTool.gridSnapCellSize'];
@@ -3521,7 +3528,8 @@ class AtoDefaultGojsEditor {
3521
3528
  this.initialOptions?.['linkingTool.linkValidation'];
3522
3529
  }
3523
3530
  }
3524
- this.myDiagram.contentAlignment = this.initialOptions?.contentAlignment ?? go.Spot.Center;
3531
+ this.myDiagram.contentAlignment =
3532
+ this.initialOptions?.contentAlignment ?? go.Spot.Center;
3525
3533
  this.myDiagram.layout = this.initialOptions?.layout;
3526
3534
  // this.myDiagram.minViewportBounds = new go.Rect(0, 0, 1200, 1200);
3527
3535
  if (!!this.editor?.data) {
@@ -3545,7 +3553,8 @@ class AtoDefaultGojsEditor {
3545
3553
  // if (!this.isAddedModelChangedListeners) {
3546
3554
  this.isAddedModelChangedListeners = true;
3547
3555
  this.myDiagram.addModelChangedListener(function (e) {
3548
- if (e.change === go.ChangedEvent.Remove && e.propertyName === 'nodeDataArray') {
3556
+ if (e.change === go.ChangedEvent.Remove &&
3557
+ e.propertyName === 'nodeDataArray') {
3549
3558
  const data = e.oldValue;
3550
3559
  self.onDeleteNode.emit(data);
3551
3560
  }
@@ -3772,7 +3781,12 @@ class AtoDefaultGojsEditor {
3772
3781
  }
3773
3782
  initSolarDiagram() {
3774
3783
  const { SOLAR_POWER, POWER_CONDITIONING_UNIT, BATTERIES: BATTERY, INVERTERS: INVERTER, } = AtoGojsEditorModel.ENUM_TEMPLATES;
3775
- const ListItemsCreateEntityTemplate = [SOLAR_POWER, POWER_CONDITIONING_UNIT, BATTERY, INVERTER];
3784
+ const ListItemsCreateEntityTemplate = [
3785
+ SOLAR_POWER,
3786
+ POWER_CONDITIONING_UNIT,
3787
+ BATTERY,
3788
+ INVERTER,
3789
+ ];
3776
3790
  ListItemsCreateEntityTemplate.map((e) => {
3777
3791
  if (!!AtoGojsEditorModel.NODE_TEMPLATES[e]) {
3778
3792
  this.makeEntityTemplateEnergy(AtoGojsEditorModel.NODE_TEMPLATES[e].icon, AtoGojsEditorModel.NODE_TEMPLATES[e].name);
@@ -3853,10 +3867,16 @@ class AtoDefaultGojsEditor {
3853
3867
  toolTip: this.$('ToolTip', this.$(go.TextBlock, {
3854
3868
  margin: 4,
3855
3869
  }, new go.Binding('text', 'textComponent'))),
3856
- }, new go.Binding('text', 'textComponent'), new go.Binding('background', 'textComponent', (x) => (x ? 'white' : 'transparent')))));
3870
+ }, new go.Binding('text', 'textComponent'), new go.Binding('background', 'textComponent', (x) => x ? 'white' : 'transparent')
3871
+ // new go.Binding('margin', 'isFormat', (x) =>
3872
+ // x ? new go.Margin(5, 0, 5, 5) : new go.Margin(5, 5, 5, 5),
3873
+ // ),
3874
+ )));
3857
3875
  // arrow
3858
3876
  elements.push(this.$(go.Shape, // the "from" arrowhead
3859
- { ...AtoGojsEditorModel.LINK_TEMPLATES[AtoGojsEditorModel.ENUM_LINK_TYPES.SIMPLE]?.arrow }, new go.Binding('visible', 'type', (x) => ![
3877
+ {
3878
+ ...AtoGojsEditorModel.LINK_TEMPLATES[AtoGojsEditorModel.ENUM_LINK_TYPES.SIMPLE]?.arrow,
3879
+ }, new go.Binding('visible', 'type', (x) => ![
3860
3880
  AtoGojsEditorModel.ENUM_LINK_TYPES.PIPE_ANIMATION,
3861
3881
  AtoGojsEditorModel.ENUM_LINK_TYPES.PIPE,
3862
3882
  AtoGojsEditorModel.ENUM_LINK_TYPES.PIPE_HIDDEN,
@@ -3875,7 +3895,7 @@ class AtoDefaultGojsEditor {
3875
3895
  toShortLength: AtoGojsEditorModel.LINK_TEMPLATES[AtoGojsEditorModel.ENUM_LINK_TYPES.SIMPLE].toShortLength, // assume arrowhead at "to" end, need to avoid bad appearance when path is thick
3876
3896
  }, new go.Binding('layerName', '', (data) => {
3877
3897
  return data?.textComponent ? 'Background' : '';
3878
- }), new go.Binding('zOrder', 'type', (x) => (x === AtoGojsEditorModel.ENUM_LINK_TYPES.PIPE_ANIMATION ? 11 : 10)), new go.Binding('toShortLength', 'type', (x) => AtoGojsEditorModel.LINK_TEMPLATES[x].toShortLength || 0), new go.Binding('selectable', 'selectable'), new go.Binding('visible', 'visible'),
3898
+ }), new go.Binding('zOrder', 'type', (x) => x === AtoGojsEditorModel.ENUM_LINK_TYPES.PIPE_ANIMATION ? 11 : 10), new go.Binding('toShortLength', 'type', (x) => AtoGojsEditorModel.LINK_TEMPLATES[x].toShortLength || 0), new go.Binding('selectable', 'selectable'), new go.Binding('visible', 'visible'),
3879
3899
  // make sure links come in from the proper direction and go out appropriately
3880
3900
  ...elements);
3881
3901
  }
@@ -3955,7 +3975,10 @@ class AtoDefaultGojsEditor {
3955
3975
  }, new go.Binding('stroke', 'color'), new go.Binding('text', 'name'), new go.Binding('visible', 'visible')))));
3956
3976
  this.myDiagram.nodeTemplateMap.set(AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_LABEL, node);
3957
3977
  }
3958
- makeTextTemplate(size = { w: AtoGojsEditorModel.GRID_SIZE * 5, h: AtoGojsEditorModel.GRID_SIZE * 2 }) {
3978
+ makeTextTemplate(size = {
3979
+ w: AtoGojsEditorModel.GRID_SIZE * 5,
3980
+ h: AtoGojsEditorModel.GRID_SIZE * 2,
3981
+ }) {
3959
3982
  const self = this;
3960
3983
  const contextMenu = this.$(go.Adornment, 'Vertical', this.$('ContextMenuButton', this.$(go.TextBlock, 'Option 1'), {
3961
3984
  click: function (e, obj) {
@@ -3965,7 +3988,9 @@ class AtoDefaultGojsEditor {
3965
3988
  click: function (e, obj) {
3966
3989
  alert('Option 2 clicked!');
3967
3990
  },
3968
- }));
3991
+ })
3992
+ // ... add more options as needed ...
3993
+ );
3969
3994
  const node = this.$(go.Node, 'Spot', {
3970
3995
  // fromSpot: go.Spot.RightSide,
3971
3996
  // toSpot: go.Spot.LeftSide,
@@ -4016,7 +4041,8 @@ class AtoDefaultGojsEditor {
4016
4041
  },
4017
4042
  doubleClick: (e, obj) => {
4018
4043
  const node = obj.part;
4019
- if (node?.ob?.isTypeInflowOfPlantCell && !this._initialOptions?.isReadOnly) {
4044
+ if (node?.ob?.isTypeInflowOfPlantCell &&
4045
+ !this._initialOptions?.isReadOnly) {
4020
4046
  // obj?.data?.onSelected(node?.ob?.nodePlantCellParent);
4021
4047
  // this.isShowNodeInfo
4022
4048
  // ? self.onDoubleClickNode.emit({
@@ -4041,7 +4067,11 @@ class AtoDefaultGojsEditor {
4041
4067
  },
4042
4068
  selectionAdornmentTemplate: this.$(go.Adornment, 'Spot', this.$(go.Panel, 'Auto',
4043
4069
  // { height: 62 },
4044
- this.$(go.Shape, { fill: null, stroke: 'dodgerblue', strokeWidth: 4 }), this.$(go.Placeholder,
4070
+ this.$(go.Shape, {
4071
+ fill: null,
4072
+ stroke: 'dodgerblue',
4073
+ strokeWidth: 4,
4074
+ }), this.$(go.Placeholder,
4045
4075
  // { padding: new go.Margin(8, 3, 0, 3) },
4046
4076
  new go.Binding('padding', '', (x) => {
4047
4077
  return x?.isTypeInflowOfPlantCell
@@ -4177,7 +4207,10 @@ class AtoDefaultGojsEditor {
4177
4207
  }
4178
4208
  return `${data?.shortenedNumber}${data?.unitPrefixes ? ' ' + data?.unitPrefixes : ''}`;
4179
4209
  }
4180
- makeDataBoxTemplate(size = { w: AtoGojsEditorModel.GRID_SIZE * 5, h: AtoGojsEditorModel.GRID_SIZE * 5 }) {
4210
+ makeDataBoxTemplate(size = {
4211
+ w: AtoGojsEditorModel.GRID_SIZE * 5,
4212
+ h: AtoGojsEditorModel.GRID_SIZE * 5,
4213
+ }) {
4181
4214
  const self = this;
4182
4215
  let node = this.$(go.Node, 'Spot', {
4183
4216
  locationSpot: go.Spot.Center,
@@ -4270,7 +4303,10 @@ class AtoDefaultGojsEditor {
4270
4303
  showPoint(loc) {
4271
4304
  const docLoc = this.myDiagram.transformDocToView(loc);
4272
4305
  }
4273
- makeEntityTemplate(icon, title, size = { w: AtoGojsEditorModel.GRID_SIZE * 5, h: AtoGojsEditorModel.GRID_SIZE * 5 }) {
4306
+ makeEntityTemplate(icon, title, size = {
4307
+ w: AtoGojsEditorModel.GRID_SIZE * 5,
4308
+ h: AtoGojsEditorModel.GRID_SIZE * 5,
4309
+ }) {
4274
4310
  const self = this;
4275
4311
  let node = this.$(go.Node, 'Spot', {
4276
4312
  locationSpot: go.Spot.Center,
@@ -4300,7 +4336,11 @@ class AtoDefaultGojsEditor {
4300
4336
  shadowBlur: 6,
4301
4337
  shadowOffset: new go.Point(0, 2),
4302
4338
  shadowColor: '#00000029',
4303
- }, this.$(go.Panel, 'Auto', this.$(go.Shape, { fill: null, stroke: 'dodgerblue', strokeWidth: 4 }), this.$(go.Placeholder, { padding: 3 })), this.$(go.Panel, 'Horizontal', {
4339
+ }, this.$(go.Panel, 'Auto', this.$(go.Shape, {
4340
+ fill: null,
4341
+ stroke: 'dodgerblue',
4342
+ strokeWidth: 4,
4343
+ }), this.$(go.Placeholder, { padding: 3 })), this.$(go.Panel, 'Horizontal', {
4304
4344
  alignment: go.Spot.TopRight,
4305
4345
  alignmentFocus: go.Spot.Bottom,
4306
4346
  background: 'white',
@@ -4309,8 +4349,8 @@ class AtoDefaultGojsEditor {
4309
4349
  !this._initialOptions.isReadOnly
4310
4350
  ? this.generateActionGroup([
4311
4351
  AtoGojsEditorModel.NODE_TEMPLATES[AtoGojsEditorModel.ENUM_TEMPLATES.RO_WATER_TREATMENT].name,
4312
- AtoGojsEditorModel.NODE_TEMPLATES[AtoGojsEditorModel.ENUM_TEMPLATES.COOLING_TOWER]
4313
- .name,
4352
+ AtoGojsEditorModel.NODE_TEMPLATES[AtoGojsEditorModel.ENUM_TEMPLATES.COOLING_TOWER].name,
4353
+ AtoGojsEditorModel.NODE_TEMPLATES[AtoGojsEditorModel.ENUM_TEMPLATES.BOILER].name,
4314
4354
  ].includes(title)
4315
4355
  ? [
4316
4356
  AtoDefaultGojsEditor.ENUM_ACTIONS.RENAME,
@@ -4357,7 +4397,8 @@ class AtoDefaultGojsEditor {
4357
4397
  }, new go.Binding('text', 'name').makeTwoWay(), new go.Binding('editable', '', (data) => {
4358
4398
  return !(AtoGojsEditorModel.TYPE_COMPONENT_WATER?.includes(data?.systemType) &&
4359
4399
  data?.topologyType !== ATO_ECOMPONENT_PLANT_TYPE.WATER &&
4360
- data?.topologyType !== ATO_ECOMPONENT_PLANT_TYPE.WATER_PLANT_CELL);
4400
+ data?.topologyType !==
4401
+ ATO_ECOMPONENT_PLANT_TYPE.WATER_PLANT_CELL);
4361
4402
  })))), this.$(go.Panel, 'Vertical', {
4362
4403
  alignment: go.Spot.Left,
4363
4404
  alignmentFocus: new go.Spot(0, 0.5, 8, 0),
@@ -4367,7 +4408,10 @@ class AtoDefaultGojsEditor {
4367
4408
  }), 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));
4368
4409
  this.myDiagram.nodeTemplateMap.set(title, node);
4369
4410
  }
4370
- makeEntityTemplateEnergy(icon, title, size = { w: AtoGojsEditorModel.GRID_SIZE * 5, h: AtoGojsEditorModel.GRID_SIZE * 5 }) {
4411
+ makeEntityTemplateEnergy(icon, title, size = {
4412
+ w: AtoGojsEditorModel.GRID_SIZE * 5,
4413
+ h: AtoGojsEditorModel.GRID_SIZE * 5,
4414
+ }) {
4371
4415
  const self = this;
4372
4416
  let node = this.$(go.Node, 'Spot', {
4373
4417
  locationSpot: go.Spot.Center,
@@ -4391,7 +4435,11 @@ class AtoDefaultGojsEditor {
4391
4435
  shadowBlur: 6,
4392
4436
  shadowOffset: new go.Point(0, 2),
4393
4437
  shadowColor: '#00000029',
4394
- }, this.$(go.Panel, 'Auto', this.$(go.Shape, { fill: null, stroke: 'dodgerblue', strokeWidth: 4 }), this.$(go.Placeholder, { padding: 3 })), this.$(go.Panel, 'Horizontal', {
4438
+ }, this.$(go.Panel, 'Auto', this.$(go.Shape, {
4439
+ fill: null,
4440
+ stroke: 'dodgerblue',
4441
+ strokeWidth: 4,
4442
+ }), this.$(go.Placeholder, { padding: 3 })), this.$(go.Panel, 'Horizontal', {
4395
4443
  alignment: go.Spot.TopRight,
4396
4444
  alignmentFocus: go.Spot.Bottom,
4397
4445
  background: 'white',
@@ -4448,7 +4496,10 @@ class AtoDefaultGojsEditor {
4448
4496
  this.myDiagram.nodeTemplateMap.set(title, node);
4449
4497
  }
4450
4498
  // Plant Cell
4451
- plantCellTemplate(icon, title, size = { w: 260, h: AtoGojsEditorModel.PLANT_CELL_HEIGHT }) {
4499
+ plantCellTemplate(icon, title, size = {
4500
+ w: 260,
4501
+ h: AtoGojsEditorModel.PLANT_CELL_HEIGHT,
4502
+ }) {
4452
4503
  const self = this;
4453
4504
  let node = this.$(go.Group, 'Spot', {
4454
4505
  locationSpot: go.Spot.Center,
@@ -4513,7 +4564,11 @@ class AtoDefaultGojsEditor {
4513
4564
  shadowBlur: 6,
4514
4565
  shadowOffset: new go.Point(0, 2),
4515
4566
  shadowColor: '#00000029',
4516
- }, this.$(go.Panel, 'Auto', { width: 170 }, this.$(go.Shape, { fill: null, stroke: 'dodgerblue', strokeWidth: 4 }), this.$(go.Placeholder, { padding: 3 })), this.$(go.Panel, 'Horizontal', { alignment: go.Spot.TopRight, alignmentFocus: go.Spot.Bottom },
4567
+ }, this.$(go.Panel, 'Auto', { width: 170 }, this.$(go.Shape, {
4568
+ fill: null,
4569
+ stroke: 'dodgerblue',
4570
+ strokeWidth: 4,
4571
+ }), this.$(go.Placeholder, { padding: 3 })), this.$(go.Panel, 'Horizontal', { alignment: go.Spot.TopRight, alignmentFocus: go.Spot.Bottom },
4517
4572
  // more
4518
4573
  this.generateActionGroup([
4519
4574
  AtoDefaultGojsEditor.ENUM_ACTIONS.RENAME,
@@ -4521,7 +4576,19 @@ class AtoDefaultGojsEditor {
4521
4576
  AtoDefaultGojsEditor.ENUM_ACTIONS.ONLY_DETAILS,
4522
4577
  // DefaultGojsEditor.ENUM_ACTIONS.OUTFLOW,
4523
4578
  AtoDefaultGojsEditor.ENUM_ACTIONS.DELETE,
4524
- ]))),
4579
+ ])
4580
+ // new go.Binding('visible', 'isNotAction', (x) => !x),
4581
+ )
4582
+ // this.$(
4583
+ // go.Panel,
4584
+ // 'Horizontal',
4585
+ // { alignment: go.Spot.TopRight, alignmentFocus: go.Spot.Bottom },
4586
+ // this.generateActionGroup([DefaultGojsEditor.ENUM_ACTIONS.ONLY_DETAILS]),
4587
+ // new go.Binding('visible', '', (x) => {
4588
+ // return x?.isOnlyDetails && !x?.isNotAction ? true : false;
4589
+ // }),
4590
+ // ),
4591
+ ),
4525
4592
  }, new go.Binding('location', 'loc', go.Point.parse).makeTwoWay(go.Point.stringify), this.$(go.Panel, 'Auto', { width: size.w, height: size.h },
4526
4593
  // this.$(go.Shape, 'RoundedRectangle', {
4527
4594
  // fill: 'white',
@@ -4552,7 +4619,8 @@ class AtoDefaultGojsEditor {
4552
4619
  alignment: go.Spot.Center,
4553
4620
  desiredSize: new go.Size(size.w - 20, size.h - 65),
4554
4621
  imageStretch: go.GraphObject.Uniform,
4555
- }, new go.Binding('source', 'pathImage', (x) => x ?? AtoGojsEditorModel.NODE_TEMPLATES[AtoGojsEditorModel.ENUM_TEMPLATES.PLANT_CELL].icon)), this.$(go.TextBlock, {
4622
+ }, new go.Binding('source', 'pathImage', (x) => x ??
4623
+ AtoGojsEditorModel.NODE_TEMPLATES[AtoGojsEditorModel.ENUM_TEMPLATES.PLANT_CELL].icon)), this.$(go.TextBlock, {
4556
4624
  row: 2,
4557
4625
  margin: new go.Margin(10, 0, 3, 0),
4558
4626
  editable: true,
@@ -4571,10 +4639,18 @@ class AtoDefaultGojsEditor {
4571
4639
  }), this.$(go.Panel, 'Vertical', {
4572
4640
  alignment: go.Spot.Right,
4573
4641
  alignmentFocus: new go.Spot(1, 0.5, -8, 0),
4574
- }));
4642
+ })
4643
+ // this.makePort('T', go.Spot.Top, go.Spot.TopSide, false, true),
4644
+ // this.makePort('L', go.Spot.Left, go.Spot.LeftSide, false, true),
4645
+ // this.makePort('R', go.Spot.Right, go.Spot.RightSide, true, false),
4646
+ // this.makePort('B', go.Spot.Bottom, go.Spot.BottomSide, true, false),
4647
+ );
4575
4648
  this.myDiagram.nodeTemplateMap.set(title, node);
4576
4649
  }
4577
- makeEntityWithdrawOrDischarge(icon, title, size = { w: AtoGojsEditorModel.GRID_SIZE * 5, h: AtoGojsEditorModel.GRID_SIZE * 5 }) {
4650
+ makeEntityWithdrawOrDischarge(icon, title, size = {
4651
+ w: AtoGojsEditorModel.GRID_SIZE * 5,
4652
+ h: AtoGojsEditorModel.GRID_SIZE * 5,
4653
+ }) {
4578
4654
  const self = this;
4579
4655
  let node = this.$(go.Node, 'Spot', {
4580
4656
  locationSpot: go.Spot.Center,
@@ -4593,7 +4669,11 @@ class AtoDefaultGojsEditor {
4593
4669
  },
4594
4670
  selectionAdornmentTemplate: this._initialOptions.isReadOnly
4595
4671
  ? null
4596
- : this.$(go.Adornment, 'Spot', this.$(go.Panel, 'Auto', this.$(go.Shape, { fill: null, stroke: 'dodgerblue', strokeWidth: 4 }), this.$(go.Placeholder, { padding: 3 })), this.$(go.Panel, 'Horizontal', { alignment: go.Spot.TopRight, alignmentFocus: go.Spot.Bottom }, this.generateActionGroup([
4672
+ : this.$(go.Adornment, 'Spot', this.$(go.Panel, 'Auto', this.$(go.Shape, {
4673
+ fill: null,
4674
+ stroke: 'dodgerblue',
4675
+ strokeWidth: 4,
4676
+ }), this.$(go.Placeholder, { padding: 3 })), this.$(go.Panel, 'Horizontal', { alignment: go.Spot.TopRight, alignmentFocus: go.Spot.Bottom }, this.generateActionGroup([
4597
4677
  AtoDefaultGojsEditor.ENUM_ACTIONS.RENAME,
4598
4678
  AtoDefaultGojsEditor.ENUM_ACTIONS.DETAILS,
4599
4679
  AtoDefaultGojsEditor.ENUM_ACTIONS.OUTFLOW,
@@ -4632,7 +4712,15 @@ class AtoDefaultGojsEditor {
4632
4712
  toolTip: this.$('ToolTip', this.$(go.TextBlock, {
4633
4713
  margin: 4,
4634
4714
  }, new go.Binding('text', 'name').makeTwoWay())),
4635
- }, new go.Binding('text', 'name').makeTwoWay()))), this.$(go.Panel, 'Vertical', {
4715
+ }, new go.Binding('text', 'name').makeTwoWay()
4716
+ // {
4717
+ // // define a tooltip for each node that displays the color as text
4718
+ // toolTip: this.$(
4719
+ // 'ToolTip',
4720
+ // this.$(go.TextBlock, { margin: 4 }, new go.Binding('text', 'name')),
4721
+ // ), // end of Adornment
4722
+ // },
4723
+ ))), this.$(go.Panel, 'Vertical', {
4636
4724
  alignment: go.Spot.Left,
4637
4725
  alignmentFocus: new go.Spot(0, 0.5, 8, 0),
4638
4726
  }), this.$(go.Panel, 'Vertical', {
@@ -4662,7 +4750,10 @@ class AtoDefaultGojsEditor {
4662
4750
  const fromnode = button.part.adornedPart;
4663
4751
  const diagram = fromnode.diagram;
4664
4752
  const model = diagram.model;
4665
- const nodedata = { ...model.copyNodeData(data), key: UtilsService.generateUUID() };
4753
+ const nodedata = {
4754
+ ...model.copyNodeData(data),
4755
+ key: UtilsService.generateUUID(),
4756
+ };
4666
4757
  model.addNodeData(nodedata);
4667
4758
  const newnode = diagram.findNodeForData(nodedata);
4668
4759
  const linkdata = model.copyLinkData({});
@@ -4717,25 +4808,31 @@ class AtoDefaultGojsEditor {
4717
4808
  return !!obj.part?.['ob']?.id;
4718
4809
  }
4719
4810
  if (action === AtoDefaultGojsEditor.ENUM_ACTIONS.RENAME &&
4720
- obj.part?.['ob']?.type !== AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_NODE &&
4811
+ obj.part?.['ob']?.type !==
4812
+ AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_NODE &&
4721
4813
  AtoGojsEditorModel.TYPE_COMPONENT_WATER?.includes(obj.part?.['ob']?.systemType) &&
4722
- obj.part?.['ob']?.topologyType !== ATO_ECOMPONENT_PLANT_TYPE.WATER &&
4723
- obj.part?.['ob']?.topologyType !== ATO_ECOMPONENT_PLANT_TYPE.WATER_PLANT_CELL) {
4814
+ obj.part?.['ob']?.topologyType !==
4815
+ ATO_ECOMPONENT_PLANT_TYPE.WATER &&
4816
+ obj.part?.['ob']?.topologyType !==
4817
+ ATO_ECOMPONENT_PLANT_TYPE.WATER_PLANT_CELL) {
4724
4818
  return false;
4725
4819
  }
4726
4820
  if (action === AtoDefaultGojsEditor.ENUM_ACTIONS.OUTFLOW &&
4727
4821
  self.plantSatus === ATO_EPlantType.BASIC_PLANT &&
4728
- obj.part?.data?.type === AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_NODE) {
4822
+ obj.part?.data?.type ===
4823
+ AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_NODE) {
4729
4824
  return false;
4730
4825
  }
4731
4826
  return true;
4732
4827
  }).map((e) => {
4733
- if (ATO_ECOMPONENT_PLANT_TYPE.STEAM === obj.part?.['ob']?.topologyType &&
4828
+ if (ATO_ECOMPONENT_PLANT_TYPE.STEAM ===
4829
+ obj.part?.['ob']?.topologyType &&
4734
4830
  e === AtoDefaultGojsEditor.ENUM_ACTIONS.INSIGHT) {
4735
4831
  return AtoDefaultGojsEditor.ENUM_ACTIONS.DATA_MAPPING;
4736
4832
  }
4737
4833
  if (e === AtoDefaultGojsEditor.ENUM_ACTIONS.FLOW_DETAILS &&
4738
- obj?.part?.['ob']?.systemType === AtoGojsEditorModel.ENUM_TYPES.COOLING_TOWER) {
4834
+ obj?.part?.['ob']?.systemType ===
4835
+ AtoGojsEditorModel.ENUM_TYPES.COOLING_TOWER) {
4739
4836
  return AtoDefaultGojsEditor.ENUM_ACTIONS.FLOW_DETAILS_AND_WIZARD;
4740
4837
  }
4741
4838
  return e;
@@ -4776,7 +4873,8 @@ class AtoDefaultGojsEditor {
4776
4873
  break;
4777
4874
  case AtoDefaultGojsEditor.ENUM_ACTIONS.RENAME:
4778
4875
  onClickFn = () => {
4779
- if (obj.part?.data?.type === AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_NODE) {
4876
+ if (obj.part?.data?.type ===
4877
+ AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_NODE) {
4780
4878
  self.onRename.emit({
4781
4879
  left: e?.['Wr']?.x - 50,
4782
4880
  top: e?.['Wr']?.y,
@@ -4806,7 +4904,7 @@ class AtoDefaultGojsEditor {
4806
4904
  name: `${AtoGojsEditorModel.ACTION_RIGHT_MENU_GROUP.DATA_BOX}_${moment().valueOf()}`,
4807
4905
  color: AtoGojsEditorModel.ENUM_COLORS.BLUE,
4808
4906
  },
4809
- ...self.setProFOrNewNode(self)
4907
+ ...self.setProFOrNewNode(self),
4810
4908
  },
4811
4909
  }));
4812
4910
  };
@@ -4863,7 +4961,10 @@ class AtoDefaultGojsEditor {
4863
4961
  const dragData = button._dragData;
4864
4962
  const diagram = fromnode.diagram;
4865
4963
  const model = diagram.model;
4866
- const nodedata = { ...model.copyNodeData(dragData), key: UtilsService.generateUUID() };
4964
+ const nodedata = {
4965
+ ...model.copyNodeData(dragData),
4966
+ key: UtilsService.generateUUID(),
4967
+ };
4867
4968
  model.addNodeData({
4868
4969
  ...nodedata,
4869
4970
  isEditable: true,
@@ -4883,7 +4984,8 @@ class AtoDefaultGojsEditor {
4883
4984
  if (nodedata?.movable !== undefined && nodedata?.movable !== null) {
4884
4985
  newnode.movable = nodedata?.movable;
4885
4986
  }
4886
- newnode.location = new go.Point(fromnode.location.x + 160, fromnode.location.y + this.findLocYFromnode(fromnode) * AtoDefaultGojsEditor.DISTANCE_2_OUTPUT);
4987
+ newnode.location = new go.Point(fromnode.location.x + 160, fromnode.location.y +
4988
+ this.findLocYFromnode(fromnode) * AtoDefaultGojsEditor.DISTANCE_2_OUTPUT);
4887
4989
  e.diagram.commitTransaction('Create Node and Link');
4888
4990
  }
4889
4991
  findLocYFromnode(fromnode) {
@@ -4903,12 +5005,20 @@ class AtoDefaultGojsEditor {
4903
5005
  return this.isEmptyYLoc(locYAlreadyExist, i);
4904
5006
  }
4905
5007
  isEmptyYLoc(locYAlreadyExist, i) {
4906
- if (!_.some(locYAlreadyExist, (x) => x < i * AtoDefaultGojsEditor.DISTANCE_2_OUTPUT + AtoDefaultGojsEditor.DISTANCE_2_OUTPUT / 2 &&
4907
- x > i * AtoDefaultGojsEditor.DISTANCE_2_OUTPUT - AtoDefaultGojsEditor.DISTANCE_2_OUTPUT / 2)) {
5008
+ if (!_.some(locYAlreadyExist, (x) => x <
5009
+ i * AtoDefaultGojsEditor.DISTANCE_2_OUTPUT +
5010
+ AtoDefaultGojsEditor.DISTANCE_2_OUTPUT / 2 &&
5011
+ x >
5012
+ i * AtoDefaultGojsEditor.DISTANCE_2_OUTPUT -
5013
+ AtoDefaultGojsEditor.DISTANCE_2_OUTPUT / 2)) {
4908
5014
  return i;
4909
5015
  }
4910
- if (!_.some(locYAlreadyExist, (x) => x < -i * AtoDefaultGojsEditor.DISTANCE_2_OUTPUT + AtoDefaultGojsEditor.DISTANCE_2_OUTPUT / 2 &&
4911
- x > -i * AtoDefaultGojsEditor.DISTANCE_2_OUTPUT - AtoDefaultGojsEditor.DISTANCE_2_OUTPUT / 2)) {
5016
+ if (!_.some(locYAlreadyExist, (x) => x <
5017
+ -i * AtoDefaultGojsEditor.DISTANCE_2_OUTPUT +
5018
+ AtoDefaultGojsEditor.DISTANCE_2_OUTPUT / 2 &&
5019
+ x >
5020
+ -i * AtoDefaultGojsEditor.DISTANCE_2_OUTPUT -
5021
+ AtoDefaultGojsEditor.DISTANCE_2_OUTPUT / 2)) {
4912
5022
  return -i;
4913
5023
  }
4914
5024
  return null;
@@ -4944,7 +5054,9 @@ class AtoDefaultGojsEditor {
4944
5054
  width: 40,
4945
5055
  height: 40,
4946
5056
  alignment: align,
4947
- stretch: horizontal ? go.GraphObject.Horizontal : go.GraphObject.Vertical,
5057
+ stretch: horizontal
5058
+ ? go.GraphObject.Horizontal
5059
+ : go.GraphObject.Vertical,
4948
5060
  portId: name,
4949
5061
  fromSpot: spot,
4950
5062
  fromLinkable: output,
@@ -4991,7 +5103,35 @@ class AtoDefaultGojsEditor {
4991
5103
  stroke: '#919CA5',
4992
5104
  width: 40,
4993
5105
  height: 40, // Match the panel's height
4994
- }));
5106
+ })
5107
+ // this.$(
5108
+ // go.TextBlock,
5109
+ // {
5110
+ // name: 'textBlock',
5111
+ // margin: 4,
5112
+ // text: '\uf0da', // Mã Unicode tương ứng với fa-caret-left
5113
+ // font: '900 12px "Font Awesome 6 Pro"',
5114
+ // stroke: 'white', // Đặt màu chữ thành màu trắng
5115
+ // cursor: 'pointer',
5116
+ // visible: false,
5117
+ // },
5118
+ // new go.Binding('text', 'name', (_) => {
5119
+ // switch (name) {
5120
+ // case 'T':
5121
+ // case 'B': {
5122
+ // return '\uf0d7';
5123
+ // }
5124
+ // case 'L':
5125
+ // case 'R': {
5126
+ // return '\uf0da';
5127
+ // }
5128
+ // default: {
5129
+ // return '\uf0d7';
5130
+ // }
5131
+ // }
5132
+ // }),
5133
+ // ),
5134
+ );
4995
5135
  }
4996
5136
  makePort(name, align, spot, output, input) {
4997
5137
  // if (this._initialOptions.isReadOnly) {
@@ -5006,7 +5146,9 @@ class AtoDefaultGojsEditor {
5006
5146
  width: horizontal ? NaN : 8,
5007
5147
  height: !horizontal ? NaN : 8,
5008
5148
  alignment: align,
5009
- stretch: horizontal ? go.GraphObject.Horizontal : go.GraphObject.Vertical,
5149
+ stretch: horizontal
5150
+ ? go.GraphObject.Horizontal
5151
+ : go.GraphObject.Vertical,
5010
5152
  portId: name,
5011
5153
  fromSpot: spot,
5012
5154
  fromLinkable: output,
@@ -5055,10 +5197,12 @@ class AtoDefaultGojsEditor {
5055
5197
  return false;
5056
5198
  }
5057
5199
  if (data?.flowOfPlantCell) {
5058
- if (data?.flowOfPlantCell === ATO_ENUM_FLOW_DIRECTION.INFLOW && name === 'L') {
5200
+ if (data?.flowOfPlantCell === ATO_ENUM_FLOW_DIRECTION.INFLOW &&
5201
+ name === 'L') {
5059
5202
  return true;
5060
5203
  }
5061
- if (data?.flowOfPlantCell === ATO_ENUM_FLOW_DIRECTION.OUTFLOW && name === 'R') {
5204
+ if (data?.flowOfPlantCell === ATO_ENUM_FLOW_DIRECTION.OUTFLOW &&
5205
+ name === 'R') {
5062
5206
  return true;
5063
5207
  }
5064
5208
  return false;
@@ -5152,7 +5296,84 @@ class AtoDefaultGojsEditor {
5152
5296
  // stroke: AtoGojsEditorModel.ENUM_COLORS.RESOLUTION_BLUE,
5153
5297
  strokeWidth: 2,
5154
5298
  // strokeDashArray: [5, 5],
5155
- })));
5299
+ })
5300
+ // this.$(go.Placeholder),
5301
+ // this.$(go.Placeholder, { padding: new go.Margin(0, 0, 0, 0) }),
5302
+ )
5303
+ // this.$(go.TextBlock, title, {
5304
+ // row: 0,
5305
+ // margin: new go.Margin(0, 0, 0, 0),
5306
+ // stroke: '#444444',
5307
+ // font: 'normal 10pt Arial',
5308
+ // textAlign: 'center',
5309
+ // alignment: go.Spot.Left,
5310
+ // },
5311
+ // new go.Binding('text', 'key').makeTwoWay(),),
5312
+ // this.$(
5313
+ // go.Panel,
5314
+ // 'Table',
5315
+ // {
5316
+ // alignment: go.Spot.TopLeft,
5317
+ // alignmentFocus: new go.Spot(0, 0, -10, -10),
5318
+ // // padding: new go.Margin(0, 0, 50, 0),
5319
+ // },
5320
+ // this.$(
5321
+ // go.Panel,
5322
+ // 'Horizontal',
5323
+ // {
5324
+ // row: 0,
5325
+ // alignment: go.Spot.Left,
5326
+ // },
5327
+ // this.$(go.Picture, icon, {
5328
+ // row: 0,
5329
+ // // alignment: go.Spot.Center,
5330
+ // alignment: go.Spot.Left,
5331
+ // maxSize: new go.Size(40, 40),
5332
+ // imageStretch: go.GraphObject.Uniform,
5333
+ // }),
5334
+ // this.$(
5335
+ // go.Panel,
5336
+ // 'Table',
5337
+ // {
5338
+ // column: 1,
5339
+ // defaultAlignment: go.Spot.Left,
5340
+ // alignmentFocus: new go.Spot(0, 0, 0, 20),
5341
+ // },
5342
+ // this.$(go.TextBlock, title, {
5343
+ // row: 0,
5344
+ // margin: new go.Margin(3, 3, 5, 10),
5345
+ // // maxSize: new go.Size(size.w - 20, NaN),
5346
+ // stroke: '#444444',
5347
+ // font: 'normal 10pt Arial',
5348
+ // textAlign: 'center',
5349
+ // alignment: go.Spot.Left,
5350
+ // }),
5351
+ // this.$(
5352
+ // go.TextBlock,
5353
+ // {
5354
+ // row: 1,
5355
+ // margin: new go.Margin(0, 3, 3, 10),
5356
+ // editable: true,
5357
+ // // maxSize: new go.Size(size.w - 20, 40),
5358
+ // stroke: '#000D42',
5359
+ // font: 'bold 10pt Arial',
5360
+ // textAlign: 'center',
5361
+ // wrap: go.TextBlock.None,
5362
+ // overflow: go.TextBlock.OverflowEllipsis,
5363
+ // },
5364
+ // new go.Binding('text', 'name').makeTwoWay(),
5365
+ // {
5366
+ // // define a tooltip for each node that displays the color as text
5367
+ // toolTip: this.$(
5368
+ // 'ToolTip',
5369
+ // this.$(go.TextBlock, { margin: 4 }, new go.Binding('text', 'name')),
5370
+ // ), // end of Adornment
5371
+ // },
5372
+ // ),
5373
+ // ),
5374
+ // ),
5375
+ // ),
5376
+ );
5156
5377
  this.myDiagram.groupTemplateMap.set(title, node);
5157
5378
  }
5158
5379
  makeGroupTemplate(icon, title, size = { w: 80, h: 80 }) {
@@ -5287,7 +5508,9 @@ class AtoDefaultGojsEditor {
5287
5508
  // imageStretch: go.GraphObject.Uniform,
5288
5509
  // margin: new go.Margin(130, 0, 0, 0),
5289
5510
  }, new go.Binding('margin', 'margin'), new go.Binding('width', 'width'), new go.Binding('height', 'height'), new go.Binding('source', '', (data) => {
5290
- return data?.source ? data?.source : AtoGojsEditorModel.IMAGE_RO_WATER_TREATMENT_PATH;
5511
+ return data?.source
5512
+ ? data?.source
5513
+ : AtoGojsEditorModel.IMAGE_RO_WATER_TREATMENT_PATH;
5291
5514
  }))));
5292
5515
  this.myDiagram.nodeTemplateMap.set(AtoGojsEditorModel.ENUM_TEMPLATES.IMAGE_TEMPLATE, node);
5293
5516
  }
@@ -5371,7 +5594,8 @@ class AtoDefaultGojsEditor {
5371
5594
  itemTemplate: this.$(go.Panel, 'TableRow', {
5372
5595
  cursor: 'pointer',
5373
5596
  click: (e, obj) => {
5374
- if (obj.panel.part.data?.dataTable[obj.row]?.isEditable === false) {
5597
+ if (obj.panel.part.data?.dataTable[obj.row]?.isEditable ===
5598
+ false) {
5375
5599
  return;
5376
5600
  }
5377
5601
  self.onClikParamOfTable.emit({
@@ -5379,7 +5603,12 @@ class AtoDefaultGojsEditor {
5379
5603
  });
5380
5604
  },
5381
5605
  background: 'transparent',
5382
- }, this.$(go.TextBlock, '', { column: 0, margin: 2, textAlign: 'left', alignment: go.Spot.Left }, new go.Binding('text', '', (data, panel) => {
5606
+ }, this.$(go.TextBlock, '', {
5607
+ column: 0,
5608
+ margin: 2,
5609
+ textAlign: 'left',
5610
+ alignment: go.Spot.Left,
5611
+ }, new go.Binding('text', '', (data, panel) => {
5383
5612
  return data?.name;
5384
5613
  })), this.$(go.Panel, 'Table', {
5385
5614
  column: 1,
@@ -5403,7 +5632,8 @@ class AtoDefaultGojsEditor {
5403
5632
  ? `${data?.tagName || ''} `
5404
5633
  : ''}${data?.value}`;
5405
5634
  }), new go.Binding('visible', '', (data) => {
5406
- if (!!this._initialOptions.isReadOnly && data?.tagName) {
5635
+ if (!!this._initialOptions.isReadOnly &&
5636
+ data?.tagName) {
5407
5637
  return true;
5408
5638
  }
5409
5639
  return !!data?.value;
@@ -5421,7 +5651,7 @@ class AtoDefaultGojsEditor {
5421
5651
  alignment: go.Spot.Right,
5422
5652
  column: 1,
5423
5653
  margin: new go.Margin(0, 0, 0, 5),
5424
- source: ICONS_BASE64["uf044"],
5654
+ source: ICONS_BASE64['uf044'],
5425
5655
  cursor: 'pointer',
5426
5656
  visible: false,
5427
5657
  toolTip: this.$('ToolTip', this.$(go.TextBlock, {
@@ -5436,7 +5666,9 @@ class AtoDefaultGojsEditor {
5436
5666
  }), new go.Binding('opacity', '', (data, panel) => {
5437
5667
  return data?.isEditable === false ? 0.6 : 1;
5438
5668
  })))),
5439
- })));
5669
+ }
5670
+ // new go.Binding('text', 'name')
5671
+ )));
5440
5672
  this.myDiagram.nodeTemplateMap.set(AtoGojsEditorModel.ENUM_TEMPLATES.PARAM_TABLE, node);
5441
5673
  }
5442
5674
  makeMassBalance() {
@@ -5700,7 +5932,8 @@ class AtoDefaultGojsEditor {
5700
5932
  // : node?.layout;
5701
5933
  if (data?.layoutValue !== data?.layoutValueClone) {
5702
5934
  data.layoutValueClone = data?.layoutValue;
5703
- return data?.layoutValue === AtoGojsEditorModel.ENUM_LAYOUT_EDITOR.AUTO
5935
+ return data?.layoutValue ===
5936
+ AtoGojsEditorModel.ENUM_LAYOUT_EDITOR.AUTO
5704
5937
  ? self.$(go.LayeredDigraphLayout, { direction: 0 })
5705
5938
  : self.$(go.Layout);
5706
5939
  }
@@ -5799,10 +6032,16 @@ class AtoDefaultGojsEditor {
5799
6032
  })));
5800
6033
  this.myDiagram.groupTemplateMap.set(title, node);
5801
6034
  }
5802
- makeGroupZoneTemplate(size = { w: AtoGojsEditorModel.GRID_SIZE * 14, h: AtoGojsEditorModel.GRID_SIZE * 5 }) {
6035
+ makeGroupZoneTemplate(size = {
6036
+ w: AtoGojsEditorModel.GRID_SIZE * 14,
6037
+ h: AtoGojsEditorModel.GRID_SIZE * 5,
6038
+ }) {
5803
6039
  const self = this;
5804
6040
  let node = this.$(go.Group, 'Vertical', {
5805
- layout: this.$(go.GridLayout, { wrappingColumn: 1, spacing: new go.Size(0, 0) }),
6041
+ layout: this.$(go.GridLayout, {
6042
+ wrappingColumn: 1,
6043
+ spacing: new go.Size(0, 0),
6044
+ }),
5806
6045
  }, {
5807
6046
  locationSpot: go.Spot.Center,
5808
6047
  mouseOver: function (e, obj) {
@@ -5825,7 +6064,11 @@ class AtoDefaultGojsEditor {
5825
6064
  shadowBlur: 6,
5826
6065
  shadowOffset: new go.Point(0, 2),
5827
6066
  shadowColor: '#00000029',
5828
- }, this.$(go.Panel, 'Auto', this.$(go.Shape, { fill: null, stroke: 'dodgerblue', strokeWidth: 4 }), this.$(go.Placeholder, { padding: 3 })), this.$(go.Panel, 'Horizontal', {
6067
+ }, this.$(go.Panel, 'Auto', this.$(go.Shape, {
6068
+ fill: null,
6069
+ stroke: 'dodgerblue',
6070
+ strokeWidth: 4,
6071
+ }), this.$(go.Placeholder, { padding: 3 })), this.$(go.Panel, 'Horizontal', {
5829
6072
  alignment: go.Spot.TopRight,
5830
6073
  alignmentFocus: go.Spot.Bottom,
5831
6074
  background: 'white',
@@ -5851,7 +6094,82 @@ class AtoDefaultGojsEditor {
5851
6094
  AtoDefaultGojsEditor.ENUM_ACTIONS.DETAILS,
5852
6095
  AtoDefaultGojsEditor.ENUM_ACTIONS.OUTFLOW,
5853
6096
  AtoDefaultGojsEditor.ENUM_ACTIONS.DELETE,
5854
- ]))),
6097
+ ])
6098
+ // this.$(
6099
+ // // Edit Text
6100
+ // 'Button',
6101
+ // {
6102
+ // click: self.editTextGroupZone,
6103
+ // 'ButtonBorder.strokeWidth': 0,
6104
+ // 'ButtonBorder.fill': 'white',
6105
+ // },
6106
+ // this.$(go.TextBlock, {
6107
+ // margin: 4,
6108
+ // text: '\ue1bf',
6109
+ // font: '20px "Font Awesome 6 Pro"',
6110
+ // cursor: 'pointer',
6111
+ // stroke: '#2c2c2c',
6112
+ // }),
6113
+ // ),
6114
+ // this.$(
6115
+ // // Open Detail
6116
+ // 'Button',
6117
+ // {
6118
+ // click: (e, obj: any) => {
6119
+ // const node = obj.part;
6120
+ // self.onOpenDetail.emit({
6121
+ // node,
6122
+ // });
6123
+ // },
6124
+ // 'ButtonBorder.strokeWidth': 0,
6125
+ // 'ButtonBorder.fill': 'white',
6126
+ // },
6127
+ //
6128
+ // this.$(go.TextBlock, {
6129
+ // margin: 4,
6130
+ // text: '\ue49a',
6131
+ // font: '20px "Font Awesome 6 Pro"',
6132
+ // cursor: 'pointer',
6133
+ // }),
6134
+ // ),
6135
+ // !this._initialOptions.isReadOnly
6136
+ // ? this.$(
6137
+ // 'Button',
6138
+ // {
6139
+ // actionMove: self.dragNewNode, // defined below, to support dragging from the button
6140
+ // _dragData: {
6141
+ // type: AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_NODE,
6142
+ // name: 0,
6143
+ // color: AtoGojsEditorModel.ENUM_COLORS.BLUE,
6144
+ // },
6145
+ // click: self.clickNewNode, // defined below, to support a click on the button
6146
+ // 'ButtonBorder.strokeWidth': 0,
6147
+ // 'ButtonBorder.fill': 'white',
6148
+ // },
6149
+ // this.$(go.TextBlock, {
6150
+ // margin: 4,
6151
+ // text: '\ue157',
6152
+ // font: '20px "Font Awesome 6 Pro"',
6153
+ // cursor: 'pointer',
6154
+ // stroke: '#2c2c2c',
6155
+ // }),
6156
+ // )
6157
+ // : {},
6158
+ // this.$(
6159
+ // 'Button',
6160
+ // {
6161
+ // click: self.deleteNode,
6162
+ // 'ButtonBorder.strokeWidth': 0,
6163
+ // 'ButtonBorder.fill': 'white',
6164
+ // },
6165
+ // this.$(go.TextBlock, {
6166
+ // margin: 4,
6167
+ // text: '\uf2ed',
6168
+ // font: '20px "Font Awesome 6 Pro"',
6169
+ // cursor: 'pointer',
6170
+ // }),
6171
+ // ),
6172
+ )),
5855
6173
  }, this.$(go.Panel, 'Auto', this.$(go.Shape, 'RoundedRectangle', {
5856
6174
  fill: 'transparent',
5857
6175
  stroke: AtoGojsEditorModel.ENUM_COLORS.RESOLUTION_BLUE,
@@ -5879,7 +6197,10 @@ class AtoDefaultGojsEditor {
5879
6197
  })), this.makePort('T', go.Spot.Top, go.Spot.TopSide, false, true), this.makePort('L', go.Spot.Left, go.Spot.LeftSide, true, true), this.makePort('R', go.Spot.Right, go.Spot.RightSide, true, true), this.makePort('B', go.Spot.Bottom, go.Spot.BottomSide, true, false)), new go.Binding('location', 'loc', go.Point.parse).makeTwoWay(go.Point.stringify));
5880
6198
  this.myDiagram.groupTemplateMap.set(AtoGojsEditorModel.ENUM_TEMPLATES.ZONE, node);
5881
6199
  }
5882
- makeZoneItemTemplate(size = { w: AtoGojsEditorModel.GRID_SIZE * 12, h: AtoGojsEditorModel.GRID_SIZE * 2 }) {
6200
+ makeZoneItemTemplate(size = {
6201
+ w: AtoGojsEditorModel.GRID_SIZE * 12,
6202
+ h: AtoGojsEditorModel.GRID_SIZE * 2,
6203
+ }) {
5883
6204
  const self = this;
5884
6205
  const node = this.$(go.Node, 'Auto',
5885
6206
  // {
@@ -5962,7 +6283,10 @@ class AtoDefaultGojsEditor {
5962
6283
  value: x?.quantity,
5963
6284
  unit: x?.unit,
5964
6285
  });
5965
- return formatted.shortenedNumber + ' ' + formatted.unitPrefixes + x?.unit ?? '';
6286
+ return (formatted.shortenedNumber +
6287
+ ' ' +
6288
+ formatted.unitPrefixes +
6289
+ x?.unit ?? '');
5966
6290
  }), new go.Binding('visible', 'data', (x) => typeof x?.quantity === 'number')), this.$(go.TextBlock, {
5967
6291
  margin: new go.Margin(0, 5, 10, 0),
5968
6292
  textAlign: 'center',
@@ -5973,7 +6297,10 @@ class AtoDefaultGojsEditor {
5973
6297
  }, new go.Binding('visible', 'data', (x) => typeof x?.quantity === 'number'))))));
5974
6298
  this.myDiagram.nodeTemplateMap.set(AtoGojsEditorModel.ENUM_TEMPLATES.ZONE_ENERGY_ITEM, node);
5975
6299
  }
5976
- makeSpecialTemplate(icon, title, size = { w: AtoGojsEditorModel.GRID_SIZE * 5, h: AtoGojsEditorModel.GRID_SIZE * 5 }) {
6300
+ makeSpecialTemplate(icon, title, size = {
6301
+ w: AtoGojsEditorModel.GRID_SIZE * 5,
6302
+ h: AtoGojsEditorModel.GRID_SIZE * 5,
6303
+ }) {
5977
6304
  let node = null;
5978
6305
  switch (title) {
5979
6306
  case AtoGojsEditorModel.ENUM_TEMPLATES.SPECIAL_PROCESS:
@@ -6214,7 +6541,8 @@ class AtoDefaultGojsEditor {
6214
6541
  // return;
6215
6542
  // }
6216
6543
  // const newDocument = newWindow?.document;
6217
- if (!this.myDiagram?.model?.nodeDataArray?.length && !this.myDiagram?.model?.linkDataArray?.length) {
6544
+ if (!this.myDiagram?.model?.nodeDataArray?.length &&
6545
+ !this.myDiagram?.model?.linkDataArray?.length) {
6218
6546
  return;
6219
6547
  }
6220
6548
  const svg = this.myDiagram.makeSvg({
@@ -6235,7 +6563,8 @@ class AtoDefaultGojsEditor {
6235
6563
  svgElement.setAttribute('stroke', 'rgba(64, 181, 206, 0.6)');
6236
6564
  }
6237
6565
  // Empty Value
6238
- if (graphObject?.name === 'textBlockValue' || graphObject?.name === 'textBlockUnitPrefixes') {
6566
+ if (graphObject?.name === 'textBlockValue' ||
6567
+ graphObject?.name === 'textBlockUnitPrefixes') {
6239
6568
  svgElement.textContent = '';
6240
6569
  }
6241
6570
  if (svgElement.clipPath) {
@@ -6584,7 +6913,7 @@ var ENUM_ASSET_PARAMETERS;
6584
6913
  ENUM_ASSET_PARAMETERS["TOTAL_IRON"] = "Total Iron";
6585
6914
  // Steam
6586
6915
  ENUM_ASSET_PARAMETERS["PHOSPHATE"] = "Phosphate";
6587
- ENUM_ASSET_PARAMETERS["M_AKALINITY"] = "M-Akalinity";
6916
+ ENUM_ASSET_PARAMETERS["M_ALKALINITY"] = "M-Alkalinity";
6588
6917
  // For Boiler - view Flow
6589
6918
  ENUM_ASSET_PARAMETERS["FLOW"] = "Flow";
6590
6919
  ENUM_ASSET_PARAMETERS["FLOW_RATE"] = "Flow Rate";
@@ -6807,9 +7136,9 @@ const DATA_ASSET_PARAMETER_FIELDS = {
6807
7136
  name: ENUM_ASSET_PARAMETERS.PHOSPHATE,
6808
7137
  key: ENUM_ASSET_PARAMETERS.PHOSPHATE,
6809
7138
  },
6810
- [ENUM_ASSET_PARAMETERS.M_AKALINITY]: {
6811
- name: ENUM_ASSET_PARAMETERS.M_AKALINITY,
6812
- key: ENUM_ASSET_PARAMETERS.M_AKALINITY,
7139
+ [ENUM_ASSET_PARAMETERS.M_ALKALINITY]: {
7140
+ name: ENUM_ASSET_PARAMETERS.M_ALKALINITY,
7141
+ key: ENUM_ASSET_PARAMETERS.M_ALKALINITY,
6813
7142
  },
6814
7143
  // Boiler for view Flow
6815
7144
  [ENUM_ASSET_PARAMETERS.FLOW]: {
@@ -6983,7 +7312,7 @@ const ASSET_CATEGORY_PARAMS__BOILER = {
6983
7312
  DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.PH],
6984
7313
  DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.PHOSPHATE],
6985
7314
  DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.SILICA],
6986
- DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.M_AKALINITY],
7315
+ DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.M_ALKALINITY],
6987
7316
  ],
6988
7317
  // For View Flow
6989
7318
  [WATER_SYSTEMS_NAME.MAKEUP_WATER__FLOW]: [
@@ -8377,6 +8706,76 @@ const ATO_COMPONENTS_GROUP_DATA = {
8377
8706
  visible: false,
8378
8707
  }
8379
8708
  },
8709
+ {
8710
+ type: AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_LABEL,
8711
+ group: 100,
8712
+ loc: '80 280',
8713
+ name: WATER_SYSTEMS_NAME.MAKEUP_WATER,
8714
+ color: AtoGojsEditorModel.ENUM_COLORS.CERULEAN,
8715
+ assetLayers: ATO_ASSET_LAYERS.FLOW,
8716
+ extendedData: {
8717
+ visible: false,
8718
+ },
8719
+ extendedDataResponsive: {
8720
+ visible: true,
8721
+ }
8722
+ },
8723
+ {
8724
+ type: AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_LABEL,
8725
+ group: 100,
8726
+ loc: '300 17',
8727
+ name: WATER_SYSTEMS_NAME.CONDENSATE_RETURN,
8728
+ color: AtoGojsEditorModel.ENUM_COLORS.FOUNTAIN_BLUE,
8729
+ assetLayers: ATO_ASSET_LAYERS.FLOW,
8730
+ extendedData: {
8731
+ visible: false,
8732
+ },
8733
+ extendedDataResponsive: {
8734
+ visible: true,
8735
+ }
8736
+ },
8737
+ {
8738
+ type: AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_LABEL,
8739
+ group: 100,
8740
+ loc: '760 17',
8741
+ name: WATER_SYSTEMS_NAME.STEAM,
8742
+ color: AtoGojsEditorModel.ENUM_COLORS.FLAMINGO,
8743
+ assetLayers: ATO_ASSET_LAYERS.FLOW,
8744
+ extendedData: {
8745
+ visible: false,
8746
+ },
8747
+ extendedDataResponsive: {
8748
+ visible: true,
8749
+ }
8750
+ },
8751
+ {
8752
+ type: AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_LABEL,
8753
+ group: 100,
8754
+ loc: '460 400',
8755
+ name: WATER_SYSTEMS_NAME.BOILER_FEED_WATER,
8756
+ color: AtoGojsEditorModel.ENUM_COLORS.LIGHT_SKY_BLUE_2,
8757
+ assetLayers: ATO_ASSET_LAYERS.FLOW,
8758
+ extendedData: {
8759
+ visible: false,
8760
+ },
8761
+ extendedDataResponsive: {
8762
+ visible: true,
8763
+ }
8764
+ },
8765
+ {
8766
+ type: AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_LABEL,
8767
+ group: 100,
8768
+ loc: '325 190',
8769
+ name: WATER_SYSTEMS_NAME.STEAM_LOSS,
8770
+ color: AtoGojsEditorModel.ENUM_COLORS.FLAMINGO,
8771
+ assetLayers: ATO_ASSET_LAYERS.FLOW,
8772
+ extendedData: {
8773
+ visible: false,
8774
+ },
8775
+ extendedDataResponsive: {
8776
+ visible: true,
8777
+ }
8778
+ },
8380
8779
  { key: 100, type: AtoGojsEditorModel.ENUM_TEMPLATES.BOILER, isGroup: true, name: 'Group' },
8381
8780
  ],
8382
8781
  linkDataArray: [],