@fluxhub/fluxhub-lib 19.0.253 → 19.0.255

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.
@@ -10874,14 +10874,18 @@ class FHGridComponent {
10874
10874
  var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent);
10875
10875
  if (iOS) {
10876
10876
  this.columndclicked.emit($event);
10877
- this.dclicked.emit($event.data);
10877
+ // riga di caricamento / senza dati: niente dclicked (il chiamante legge i campi della riga)
10878
+ if ($event.data != null)
10879
+ this.dclicked.emit($event.data);
10878
10880
  }
10879
10881
  }
10880
10882
  sRow;
10881
10883
  onRowDClicked($event) {
10882
10884
  if (!this.b_init)
10883
10885
  return;
10884
- this.dclicked.emit($event.data);
10886
+ // riga di caricamento / senza dati: niente dclicked (il chiamante legge i campi della riga)
10887
+ if ($event.data != null)
10888
+ this.dclicked.emit($event.data);
10885
10889
  var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent);
10886
10890
  if (iOS) {
10887
10891
  this.columndclicked.emit($event);
@@ -13252,7 +13256,8 @@ class FHViewerComponent {
13252
13256
  notfullScreenEvent = new EventEmitter();
13253
13257
  fullScreenEvent = new EventEmitter();
13254
13258
  nextImage($event) {
13255
- if (this.index < this.src.length - 1) {
13259
+ // listener su window: con src non ancora valorizzato una freccia premuta altrove non deve rompere
13260
+ if (this.src && this.index < this.src.length - 1) {
13256
13261
  this.loading = true;
13257
13262
  this.index++;
13258
13263
  this.triggerIndexBinding();
@@ -13260,7 +13265,7 @@ class FHViewerComponent {
13260
13265
  }
13261
13266
  }
13262
13267
  prevImage($event) {
13263
- if (this.index > 0) {
13268
+ if (this.src && this.index > 0) {
13264
13269
  this.loading = true;
13265
13270
  this.index--;
13266
13271
  this.triggerIndexBinding();
@@ -14251,10 +14256,26 @@ class FHNumericFieldComponent {
14251
14256
  constructor(uti_s) {
14252
14257
  this.uti_s = uti_s;
14253
14258
  this.modelChangeSubject.pipe(debounceTime(300)).subscribe(value => {
14254
- this.onChange(value.split(this.suffixSymbol).join(""));
14259
+ // Al modello va sempre un numero (come in chg()), non la stringa formattata ("10.624,66"):
14260
+ // il testo nel campo non viene toccato. Se nel frattempo c'e' stato blur/invio/writeValue
14261
+ // il valore e' gia' stato propagato e questa emissione e' superata. (change) resta invariato.
14262
+ if (this.typingPending) {
14263
+ this.typingPending = false;
14264
+ const num = this.parseFormatted(value);
14265
+ if (num != null)
14266
+ this.onChange(num);
14267
+ }
14255
14268
  this.change.emit(value.split(this.suffixSymbol).join(""));
14256
14269
  });
14257
14270
  }
14271
+ typingPending = false;
14272
+ // Stesso parsing di chg(); null se il testo non e' (ancora) un numero, es. solo "-"
14273
+ parseFormatted(text) {
14274
+ if (text == null || text == "")
14275
+ return this.uti_s.round(0, this.decimal);
14276
+ const num = this.uti_s.round(parseFloat(text.split(".").join("").split(",").join(".").split(this.suffixSymbol).join("")), this.decimal);
14277
+ return isNaN(num) ? null : num;
14278
+ }
14258
14279
  keyDownFunctioncl(event) {
14259
14280
  if (event.keyCode == 13) {
14260
14281
  this.chg();
@@ -14262,6 +14283,7 @@ class FHNumericFieldComponent {
14262
14283
  }
14263
14284
  }
14264
14285
  modelch() {
14286
+ this.typingPending = true;
14265
14287
  setTimeout(() => {
14266
14288
  this.modelChangeSubject.next(this.formattedAmount);
14267
14289
  });
@@ -14290,11 +14312,13 @@ class FHNumericFieldComponent {
14290
14312
  this.formattedAmount = this.transform(this.value, this.decimal) + this.suffixSymbol;
14291
14313
  }
14292
14314
  this.chgf = true;
14315
+ this.typingPending = false;
14293
14316
  this.onChange(this.value);
14294
14317
  }
14295
14318
  writeValue(value) {
14296
14319
  if (value == null)
14297
14320
  value = 0.0;
14321
+ this.typingPending = false;
14298
14322
  this.innerValue = value;
14299
14323
  this.value = value;
14300
14324
  this.formattedAmount = this.transform(this.value, this.decimal) + this.suffixSymbol;