@fluxhub/fluxhub-lib 22.0.15 → 22.0.17

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.
@@ -11967,14 +11967,18 @@ class FHGridComponent {
11967
11967
  var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent);
11968
11968
  if (iOS) {
11969
11969
  this.columndclicked.emit($event);
11970
- this.dclicked.emit($event.data);
11970
+ // riga di caricamento / senza dati: niente dclicked (il chiamante legge i campi della riga)
11971
+ if ($event.data != null)
11972
+ this.dclicked.emit($event.data);
11971
11973
  }
11972
11974
  }
11973
11975
  sRow;
11974
11976
  onRowDClicked($event) {
11975
11977
  if (!this.b_init)
11976
11978
  return;
11977
- this.dclicked.emit($event.data);
11979
+ // riga di caricamento / senza dati: niente dclicked (il chiamante legge i campi della riga)
11980
+ if ($event.data != null)
11981
+ this.dclicked.emit($event.data);
11978
11982
  var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent);
11979
11983
  if (iOS) {
11980
11984
  this.columndclicked.emit($event);
@@ -14308,7 +14312,8 @@ class FHViewerComponent {
14308
14312
  notfullScreenEvent = new EventEmitter();
14309
14313
  fullScreenEvent = new EventEmitter();
14310
14314
  nextImage($event) {
14311
- if (this.index < this.src.length - 1) {
14315
+ // listener su window: con src non ancora valorizzato una freccia premuta altrove non deve rompere
14316
+ if (this.src && this.index < this.src.length - 1) {
14312
14317
  this.loading = true;
14313
14318
  this.index++;
14314
14319
  this.triggerIndexBinding();
@@ -14316,7 +14321,7 @@ class FHViewerComponent {
14316
14321
  }
14317
14322
  }
14318
14323
  prevImage($event) {
14319
- if (this.index > 0) {
14324
+ if (this.src && this.index > 0) {
14320
14325
  this.loading = true;
14321
14326
  this.index--;
14322
14327
  this.triggerIndexBinding();
@@ -15339,10 +15344,32 @@ class FHNumericFieldComponent {
15339
15344
  constructor(uti_s) {
15340
15345
  this.uti_s = uti_s;
15341
15346
  this.modelChangeSubject.pipe(debounceTime(300)).subscribe((value) => {
15342
- this.onChange(value.split(this.suffixSymbol).join(''));
15347
+ // Al modello va sempre un numero (come in chg()), non la stringa formattata ("10.624,66"):
15348
+ // il testo nel campo non viene toccato. Se nel frattempo c'e' stato blur/invio/writeValue
15349
+ // il valore e' gia' stato propagato e questa emissione e' superata. (change) resta invariato.
15350
+ if (this.typingPending) {
15351
+ this.typingPending = false;
15352
+ const num = this.parseFormatted(value);
15353
+ if (num != null)
15354
+ this.onChange(num);
15355
+ }
15343
15356
  this.change.emit(value.split(this.suffixSymbol).join(''));
15344
15357
  });
15345
15358
  }
15359
+ typingPending = false;
15360
+ // Stesso parsing di chg(); null se il testo non e' (ancora) un numero, es. solo "-"
15361
+ parseFormatted(text) {
15362
+ if (text == null || text == '')
15363
+ return this.uti_s.round(0, this.decimal);
15364
+ const num = this.uti_s.round(parseFloat(text
15365
+ .split('.')
15366
+ .join('')
15367
+ .split(',')
15368
+ .join('.')
15369
+ .split(this.suffixSymbol)
15370
+ .join('')), this.decimal);
15371
+ return isNaN(num) ? null : num;
15372
+ }
15346
15373
  keyDownFunctioncl(event) {
15347
15374
  if (event.keyCode == 13) {
15348
15375
  this.chg();
@@ -15350,6 +15377,7 @@ class FHNumericFieldComponent {
15350
15377
  }
15351
15378
  }
15352
15379
  modelch() {
15380
+ this.typingPending = true;
15353
15381
  setTimeout(() => {
15354
15382
  this.modelChangeSubject.next(this.formattedAmount);
15355
15383
  });
@@ -15386,11 +15414,13 @@ class FHNumericFieldComponent {
15386
15414
  this.transform(this.value, this.decimal) + this.suffixSymbol;
15387
15415
  }
15388
15416
  this.chgf = true;
15417
+ this.typingPending = false;
15389
15418
  this.onChange(this.value);
15390
15419
  }
15391
15420
  writeValue(value) {
15392
15421
  if (value == null)
15393
15422
  value = 0.0;
15423
+ this.typingPending = false;
15394
15424
  this.innerValue = value;
15395
15425
  this.value = value;
15396
15426
  this.formattedAmount =