@fluxhub/fluxhub-lib 21.0.9 → 21.0.11

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.
@@ -10390,14 +10390,18 @@ class FHGridComponent {
10390
10390
  var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent);
10391
10391
  if (iOS) {
10392
10392
  this.columndclicked.emit($event);
10393
- this.dclicked.emit($event.data);
10393
+ // riga di caricamento / senza dati: niente dclicked (il chiamante legge i campi della riga)
10394
+ if ($event.data != null)
10395
+ this.dclicked.emit($event.data);
10394
10396
  }
10395
10397
  }
10396
10398
  sRow;
10397
10399
  onRowDClicked($event) {
10398
10400
  if (!this.b_init)
10399
10401
  return;
10400
- this.dclicked.emit($event.data);
10402
+ // riga di caricamento / senza dati: niente dclicked (il chiamante legge i campi della riga)
10403
+ if ($event.data != null)
10404
+ this.dclicked.emit($event.data);
10401
10405
  var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent);
10402
10406
  if (iOS) {
10403
10407
  this.columndclicked.emit($event);
@@ -12772,7 +12776,8 @@ class FHViewerComponent {
12772
12776
  notfullScreenEvent = new EventEmitter();
12773
12777
  fullScreenEvent = new EventEmitter();
12774
12778
  nextImage($event) {
12775
- if (this.index < this.src.length - 1) {
12779
+ // listener su window: con src non ancora valorizzato una freccia premuta altrove non deve rompere
12780
+ if (this.src && this.index < this.src.length - 1) {
12776
12781
  this.loading = true;
12777
12782
  this.index++;
12778
12783
  this.triggerIndexBinding();
@@ -12780,7 +12785,7 @@ class FHViewerComponent {
12780
12785
  }
12781
12786
  }
12782
12787
  prevImage($event) {
12783
- if (this.index > 0) {
12788
+ if (this.src && this.index > 0) {
12784
12789
  this.loading = true;
12785
12790
  this.index--;
12786
12791
  this.triggerIndexBinding();
@@ -13763,10 +13768,26 @@ class FHNumericFieldComponent {
13763
13768
  constructor(uti_s) {
13764
13769
  this.uti_s = uti_s;
13765
13770
  this.modelChangeSubject.pipe(debounceTime(300)).subscribe(value => {
13766
- this.onChange(value.split(this.suffixSymbol).join(""));
13771
+ // Al modello va sempre un numero (come in chg()), non la stringa formattata ("10.624,66"):
13772
+ // il testo nel campo non viene toccato. Se nel frattempo c'e' stato blur/invio/writeValue
13773
+ // il valore e' gia' stato propagato e questa emissione e' superata. (change) resta invariato.
13774
+ if (this.typingPending) {
13775
+ this.typingPending = false;
13776
+ const num = this.parseFormatted(value);
13777
+ if (num != null)
13778
+ this.onChange(num);
13779
+ }
13767
13780
  this.change.emit(value.split(this.suffixSymbol).join(""));
13768
13781
  });
13769
13782
  }
13783
+ typingPending = false;
13784
+ // Stesso parsing di chg(); null se il testo non e' (ancora) un numero, es. solo "-"
13785
+ parseFormatted(text) {
13786
+ if (text == null || text == "")
13787
+ return this.uti_s.round(0, this.decimal);
13788
+ const num = this.uti_s.round(parseFloat(text.split(".").join("").split(",").join(".").split(this.suffixSymbol).join("")), this.decimal);
13789
+ return isNaN(num) ? null : num;
13790
+ }
13770
13791
  keyDownFunctioncl(event) {
13771
13792
  if (event.keyCode == 13) {
13772
13793
  this.chg();
@@ -13774,6 +13795,7 @@ class FHNumericFieldComponent {
13774
13795
  }
13775
13796
  }
13776
13797
  modelch() {
13798
+ this.typingPending = true;
13777
13799
  setTimeout(() => {
13778
13800
  this.modelChangeSubject.next(this.formattedAmount);
13779
13801
  });
@@ -13802,11 +13824,13 @@ class FHNumericFieldComponent {
13802
13824
  this.formattedAmount = this.transform(this.value, this.decimal) + this.suffixSymbol;
13803
13825
  }
13804
13826
  this.chgf = true;
13827
+ this.typingPending = false;
13805
13828
  this.onChange(this.value);
13806
13829
  }
13807
13830
  writeValue(value) {
13808
13831
  if (value == null)
13809
13832
  value = 0.0;
13833
+ this.typingPending = false;
13810
13834
  this.innerValue = value;
13811
13835
  this.value = value;
13812
13836
  this.formattedAmount = this.transform(this.value, this.decimal) + this.suffixSymbol;