@fluxhub/fluxhub-lib 18.0.31 → 18.0.33

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.
@@ -8944,9 +8944,15 @@ class FHGridComponent {
8944
8944
  return;
8945
8945
  setTimeout(() => {
8946
8946
  //get columns size
8947
+ // se nel frattempo si e' lasciata la pagina la griglia e' gia' distrutta:
8948
+ // getColumnState() torna undefined
8947
8949
  let go = this.gridApi;
8948
- if (go.getColumnState()[0].width < 24) {
8950
+ if (!go || go.isDestroyed?.())
8951
+ return;
8952
+ if (go.getColumnState()?.[0]?.width < 24) {
8949
8953
  setTimeout(() => {
8954
+ if (this.gridApi?.isDestroyed?.())
8955
+ return;
8950
8956
  this.autoSizeAll();
8951
8957
  }, 1000);
8952
8958
  }
@@ -9902,6 +9908,9 @@ class FHGridComponent {
9902
9908
  }
9903
9909
  show_pulisci_filtri = false;
9904
9910
  autoSizeAll() {
9911
+ // richiamata anche da setTimeout: la griglia puo' essere gia' distrutta
9912
+ if (!this.gridApi || this.gridApi.isDestroyed?.())
9913
+ return;
9905
9914
  //console.log("🚀 ~ file: fhgrid.ts ~ line 1380 ~ FHGridComponent ~ autoSizeAll ~ autoSizeAll")
9906
9915
  if (this.gridOptions == null)
9907
9916
  return;
@@ -9922,6 +9931,9 @@ class FHGridComponent {
9922
9931
  this.save_cfg();
9923
9932
  }
9924
9933
  fitSizeAll() {
9934
+ // richiamata anche da setTimeout: la griglia puo' essere gia' distrutta
9935
+ if (!this.gridApi || this.gridApi.isDestroyed?.())
9936
+ return;
9925
9937
  console.log("🚀 ~ FHGridInternalComponent ~ fitSizeAll ~ fitSizeAll:", this.gridApi);
9926
9938
  if (this.gridApi)
9927
9939
  this.gridApi.sizeColumnsToFit();
@@ -11666,9 +11678,15 @@ class FHGridComponentN {
11666
11678
  return;
11667
11679
  setTimeout(() => {
11668
11680
  //get columns size
11681
+ // se nel frattempo si e' lasciata la pagina la griglia e' gia' distrutta:
11682
+ // getColumnState() torna undefined
11669
11683
  let go = this.gridApi;
11670
- if (go.getColumnState()[0].width < 24) {
11684
+ if (!go || go.isDestroyed?.())
11685
+ return;
11686
+ if (go.getColumnState()?.[0]?.width < 24) {
11671
11687
  setTimeout(() => {
11688
+ if (this.gridApi?.isDestroyed?.())
11689
+ return;
11672
11690
  this.autoSizeAll();
11673
11691
  }, 1000);
11674
11692
  }
@@ -12528,6 +12546,9 @@ class FHGridComponentN {
12528
12546
  }
12529
12547
  show_pulisci_filtri = false;
12530
12548
  autoSizeAll() {
12549
+ // richiamata anche da setTimeout: la griglia puo' essere gia' distrutta
12550
+ if (!this.gridApi || this.gridApi.isDestroyed?.())
12551
+ return;
12531
12552
  console.log("🚀 ~ file: fhgridn.ts:1121 ~ FHGridComponentN ~ autoSizeAll ~ autoSizeAll:");
12532
12553
  if (this.gridOptions == null)
12533
12554
  return;
@@ -12548,6 +12569,9 @@ class FHGridComponentN {
12548
12569
  this.save_cfg();
12549
12570
  }
12550
12571
  fitSizeAll() {
12572
+ // richiamata anche da setTimeout: la griglia puo' essere gia' distrutta
12573
+ if (!this.gridApi || this.gridApi.isDestroyed?.())
12574
+ return;
12551
12575
  console.log("🚀 ~ FHGridInternalComponent ~ fitSizeAll ~ fitSizeAll:", this.gridApi);
12552
12576
  if (this.gridApi)
12553
12577
  this.gridApi.sizeColumnsToFit();
@@ -19103,7 +19127,17 @@ class FHUploadPanelComponent {
19103
19127
  return;
19104
19128
  if (o.response == null)
19105
19129
  return;
19106
- let obj_r = JSON.parse(o.response);
19130
+ // FHUpload passa il body di HttpClient, gia' deserializzato: il JSON.parse resta solo
19131
+ // per chi emette ancora la risposta come stringa.
19132
+ let obj_r = o.response;
19133
+ if (typeof obj_r === 'string') {
19134
+ try {
19135
+ obj_r = JSON.parse(obj_r);
19136
+ }
19137
+ catch {
19138
+ return;
19139
+ }
19140
+ }
19107
19141
  console.log(obj_r);
19108
19142
  if (obj_r != null)
19109
19143
  if (obj_r.msg != null)
@@ -25103,6 +25137,9 @@ class fh_win_grid_selection {
25103
25137
  }, 100);
25104
25138
  }
25105
25139
  autoSizeAll() {
25140
+ // richiamata anche da setTimeout: la griglia puo' essere gia' distrutta
25141
+ if (!this.gridApi || this.gridApi.isDestroyed?.())
25142
+ return;
25106
25143
  if (this.gridOptions == null)
25107
25144
  return;
25108
25145
  if (this.gridApi == null)
@@ -25121,6 +25158,9 @@ class fh_win_grid_selection {
25121
25158
  }
25122
25159
  }
25123
25160
  fitSizeAll() {
25161
+ // richiamata anche da setTimeout: la griglia puo' essere gia' distrutta
25162
+ if (!this.gridApi || this.gridApi.isDestroyed?.())
25163
+ return;
25124
25164
  // console.log("🚀 ~ FHGridInternalComponent ~ fitSizeAll ~ fitSizeAll:",this.gridApi)
25125
25165
  if (this.gridApi)
25126
25166
  this.gridApi.sizeColumnsToFit();
@@ -26387,9 +26427,15 @@ class FHGridInternalComponent {
26387
26427
  return;
26388
26428
  setTimeout(() => {
26389
26429
  //get columns size
26430
+ // se nel frattempo si e' lasciata la pagina la griglia e' gia' distrutta:
26431
+ // getColumnState() torna undefined
26390
26432
  let go = this.gridApi;
26391
- if (go.getColumnState()[0].width < 24) {
26433
+ if (!go || go.isDestroyed?.())
26434
+ return;
26435
+ if (go.getColumnState()?.[0]?.width < 24) {
26392
26436
  setTimeout(() => {
26437
+ if (this.gridApi?.isDestroyed?.())
26438
+ return;
26393
26439
  this.autoSizeAll();
26394
26440
  }, 1000);
26395
26441
  }
@@ -27341,6 +27387,9 @@ class FHGridInternalComponent {
27341
27387
  }
27342
27388
  show_pulisci_filtri = false;
27343
27389
  autoSizeAll() {
27390
+ // richiamata anche da setTimeout: la griglia puo' essere gia' distrutta
27391
+ if (!this.gridApi || this.gridApi.isDestroyed?.())
27392
+ return;
27344
27393
  //console.log("🚀 ~ file: fhgrid.ts ~ line 1380 ~ FHGridComponent ~ autoSizeAll ~ autoSizeAll")
27345
27394
  if (this.gridOptions == null)
27346
27395
  return;
@@ -27361,6 +27410,9 @@ class FHGridInternalComponent {
27361
27410
  this.save_cfg();
27362
27411
  }
27363
27412
  fitSizeAll() {
27413
+ // richiamata anche da setTimeout: la griglia puo' essere gia' distrutta
27414
+ if (!this.gridApi || this.gridApi.isDestroyed?.())
27415
+ return;
27364
27416
  console.log("🚀 ~ FHGridInternalComponent ~ fitSizeAll ~ fitSizeAll:", this.gridApi);
27365
27417
  if (this.gridApi)
27366
27418
  this.gridApi.sizeColumnsToFit();