ato-water-lib 0.0.38 → 0.0.40

Sign up to get free protection for your applications and to get access to all the features.
@@ -8179,9 +8179,15 @@ class AssetFlowComponent {
8179
8179
  }),
8180
8180
  // isReadOnly: true,
8181
8181
  };
8182
- this.flowData = {};
8183
8182
  this.isResponsiveView = false;
8184
8183
  }
8184
+ set flowData(v) {
8185
+ this._flowData = v;
8186
+ this.updateDataTableAssetParams({ ...v, assetLayer: this.assetLayer });
8187
+ }
8188
+ get flowData() {
8189
+ return this._flowData;
8190
+ }
8185
8191
  onResize(event) {
8186
8192
  // Now only Support Cooling Tower Responsive
8187
8193
  if (this.timeoutResizeWindow) {
@@ -8223,10 +8229,15 @@ class AssetFlowComponent {
8223
8229
  }
8224
8230
  static getDefaultFlowData(defaultData) {
8225
8231
  const flowData = {
8232
+ ...defaultData,
8226
8233
  ..._.cloneDeep(ATO_COMPONENTS_GROUP_DATA)[defaultData?.systemType],
8227
8234
  linkFromPortIdProperty: 'fromPort',
8228
8235
  linkToPortIdProperty: 'toPort',
8229
8236
  };
8237
+ // Reponsive
8238
+ _.forEach(flowData?.nodeDataArray, (node) => {
8239
+ node = _.merge(node, node[`extendedData${window.innerWidth < 1024 ? 'Responsive' : ''}`]);
8240
+ });
8230
8241
  // assetLayer
8231
8242
  flowData.nodeDataArray = _.filter(flowData.nodeDataArray, x => !x?.assetLayers || (x?.assetLayers && x?.assetLayers === (defaultData?.assetLayer ?? ATO_ASSET_LAYERS.FLOW)));
8232
8243
  if (defaultData?.isUseBase64) {
@@ -8238,12 +8249,20 @@ class AssetFlowComponent {
8238
8249
  return flowData;
8239
8250
  }
8240
8251
  setFlowData(data) {
8241
- const layer = data?.assetLayer ?? this?.assetLayer ?? ATO_ASSET_LAYERS.FLOW;
8252
+ // const layer = data?.assetLayer ?? this?.assetLayer ?? ATO_ASSET_LAYERS.FLOW;
8253
+ _.forEach(data.nodeDataArray, node => {
8254
+ if (node?.assetLayers) {
8255
+ node.visible = node?.assetLayers === this.assetLayer;
8256
+ }
8257
+ });
8242
8258
  this.flowData = {
8243
8259
  ...data,
8244
- nodeDataArray: _.filter(data.nodeDataArray, x => !x?.assetLayers || (x?.assetLayers && x?.assetLayers === layer))
8260
+ // nodeDataArray: _.filter(data.nodeDataArray, x => !x?.assetLayers || (x?.assetLayers && x?.assetLayers === data?.assetLayer))
8245
8261
  };
8246
- this.dataTableAssetParams = _.forEach(this.flowData?.nodeDataArray?.filter((e) => e?.type === AtoGojsEditorModel.ENUM_TEMPLATES.PARAM_TABLE && e?.assetLayers === layer), x => {
8262
+ this.updateDataTableAssetParams(data);
8263
+ }
8264
+ updateDataTableAssetParams(data) {
8265
+ this.dataTableAssetParams = _.forEach(this.flowData?.nodeDataArray?.filter((e) => e?.type === AtoGojsEditorModel.ENUM_TEMPLATES.PARAM_TABLE && e?.assetLayers === data?.assetLayer), x => {
8247
8266
  if (!data?.isRefresh) {
8248
8267
  x.isCollapsed = this.assetParamsViewTemp?.data?.find(y => y?.key === x?.key)?.isCollapsed;
8249
8268
  }
@@ -8359,5 +8378,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
8359
8378
  * Generated bundle index. Do not edit.
8360
8379
  */
8361
8380
 
8362
- export { ASSET_CATEGORY_PARAMS, ATO_ASSET_LAYERS, ATO_COMPONENTS_GROUP_DATA, AssetFlowComponent, AtoAssetParamsViewComponent, AtoFlowDiagramLibComponent, AtoLoadingDirective, AtoNgVarDirective, AtoWaterLibComponent, AtoWaterLibModule, AtoWaterLibService, COMPONENTS_GROUP_TYPE, DATA_ASSET_PARAMETER_FIELDS, DATA_WATER_SYSTEMS, ENUM_ASSET_PARAMETERS, WATER_SYSTEMS_NAME };
8381
+ export { ASSET_CATEGORY_PARAMS, ATO_ASSET_LAYERS, ATO_COMPONENTS_GROUP_DATA, AssetFlowComponent, AtoAssetParamsViewComponent, AtoFlowDiagramLibComponent, AtoGojsEditorModel, AtoLoadingDirective, AtoNgVarDirective, AtoWaterLibComponent, AtoWaterLibModule, AtoWaterLibService, COMPONENTS_GROUP_TYPE, DATA_ASSET_PARAMETER_FIELDS, DATA_WATER_SYSTEMS, ENUM_ASSET_PARAMETERS, WATER_SYSTEMS_NAME };
8363
8382
  //# sourceMappingURL=ato-water-lib.mjs.map