@esfaenza/forms-and-validations 11.2.73 → 11.2.76

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.
@@ -1941,7 +1941,7 @@
1941
1941
  });
1942
1942
  // Post trybind se c'è un modello associato ricalcolo l'**EvaluatedModel**
1943
1943
  if (this.Model)
1944
- this.EvaluatedModel = (_a = this.BoundSource.find(function (t) { return t.id == _this.Model; })) === null || _a === void 0 ? void 0 : _a.description;
1944
+ (_a = this.BoundSource.find(function (t) { return t.id == _this.Model; })) === null || _a === void 0 ? void 0 : _a.description;
1945
1945
  }
1946
1946
  };
1947
1947
  /** Valuta il contenuto della variabile BindCheckingGroups */
@@ -2030,7 +2030,7 @@
2030
2030
  * un altro con lo stesso "name" ma magari resettato, Angular lo re-idraterebbe con i valori precedenti nonostante il modello fosse vuoto
2031
2031
  */
2032
2032
  BaseFormControl.prototype.ngOnDestroy = function () {
2033
- if (this.detatchedFromform && this.Form)
2033
+ if (this.Form && !!this.Form.getControl(this.validationControl))
2034
2034
  this.Form.removeControl(this.validationControl);
2035
2035
  };
2036
2036
  /** Elabora i validatori iniettati e capisce se il valore è obbligatorio o meno */
@@ -2265,6 +2265,8 @@
2265
2265
  if (clear) {
2266
2266
  model.filename = "";
2267
2267
  ne.value = "";
2268
+ model.fileb64 = "";
2269
+ model.nativefiles = [];
2268
2270
  }
2269
2271
  else {
2270
2272
  for (var i = 0; i < ne.files.length; i++)
@@ -2537,6 +2539,7 @@
2537
2539
  _this.tryBindSourceDisplay();
2538
2540
  // In questo caso è già filtrata dalla SearchFunction
2539
2541
  _this.FilteredBoundSource = _this.BoundSource;
2542
+ _this.removeFilteredSourceOnDescriptionSelection();
2540
2543
  _this.cdr.markForCheck();
2541
2544
  });
2542
2545
  }, 400);
@@ -2545,10 +2548,19 @@
2545
2548
  this.throttla("filtersource", function () {
2546
2549
  // In questo caso devo filtrare io in memoria
2547
2550
  _this.FilteredBoundSource = _this.BoundSource.filter(function (t) { return (_this.CaseSensitive && t.description.includes(event)) || (!_this.CaseSensitive && t.description.toLowerCase().includes(event.toLowerCase())); });
2551
+ _this.removeFilteredSourceOnDescriptionSelection();
2548
2552
  _this.cdr.markForCheck();
2549
2553
  }, 100);
2550
2554
  }
2551
2555
  };
2556
+ /** @ignore */
2557
+ FormAdaptiveComponent.prototype.removeFilteredSourceOnDescriptionSelection = function () {
2558
+ if (this.FilteredBoundSource.length == 1 && (this.FilteredBoundSource[0].description === this.Model)) {
2559
+ this.Model = this.BoundSource[0].id;
2560
+ this.EvaluatedModel = this.BoundSource[0].description;
2561
+ this.FilteredBoundSource = [];
2562
+ }
2563
+ };
2552
2564
  /** Metodo richiamato quando viene modificato il modello del campo di input */
2553
2565
  FormAdaptiveComponent.prototype.changed = function () {
2554
2566
  var toEmit = this.getModelToEmit();
@@ -3427,6 +3439,7 @@
3427
3439
  _this.tryBindSourceDisplay();
3428
3440
  // In questo caso è già filtrata dalla SearchFunction
3429
3441
  _this.FilteredBoundSource = _this.BoundSource;
3442
+ _this.removeFilteredSourceOnDescriptionSelection();
3430
3443
  _this.cdr.markForCheck();
3431
3444
  });
3432
3445
  }, 400);
@@ -3435,11 +3448,20 @@
3435
3448
  this.throttla("filtersource", function () {
3436
3449
  // In questo caso devo filtrare io in memoria
3437
3450
  _this.FilteredBoundSource = _this.BoundSource.filter(function (t) { return (_this.CaseSensitive && t.description.includes(event)) || (!_this.CaseSensitive && t.description.toLowerCase().includes(event.toLowerCase())); });
3451
+ _this.removeFilteredSourceOnDescriptionSelection();
3438
3452
  _this.cdr.markForCheck();
3439
3453
  }, 100);
3440
3454
  }
3441
3455
  };
3442
3456
  /** @ignore */
3457
+ FormAutocompleteComponent.prototype.removeFilteredSourceOnDescriptionSelection = function () {
3458
+ if (this.FilteredBoundSource.length == 1 && (this.FilteredBoundSource[0].description === this.Model)) {
3459
+ this.Model = this.BoundSource[0].id;
3460
+ this.EvaluatedModel = this.BoundSource[0].description;
3461
+ this.FilteredBoundSource = [];
3462
+ }
3463
+ };
3464
+ /** @ignore */
3443
3465
  FormAutocompleteComponent.prototype.ngOnChanges = function (changes) {
3444
3466
  var _a;
3445
3467
  var newSource = changes["Source"];