@esfaenza/forms-and-validations 11.2.138 → 11.2.140

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.
@@ -2650,6 +2650,8 @@
2650
2650
  _this.MinChars = 3;
2651
2651
  /** Indica se i controlli devono essere effettuati tenendo conto del Case o meno. Vale solo qualora la **Source** fosse fornita */
2652
2652
  _this.CaseSensitive = false;
2653
+ /** Opzioni specifiche per il componente che si va a visualizzare. Es. per i tipi date: { JsDates: true } */
2654
+ _this.Options = {};
2653
2655
  /** Variabile interna che gestisce se effettuare il riallineamento dei dati o meno */
2654
2656
  _this.alignValues = false;
2655
2657
  /**
@@ -2659,6 +2661,8 @@
2659
2661
  _this.ignoreNextWriteValue = false;
2660
2662
  /** Cache della sorgente originale POST binding, in modo da poter fare filtri in locale qualora la **SearchFunction** non fosse definita e la **Source** fosse assegnata */
2661
2663
  _this.FilteredBoundSource = [];
2664
+ /** Solo per gli input di tipo "date". Capisce che modalità usare per il validation-date sottostante */
2665
+ _this.useJsDates = null;
2662
2666
  _this.IntPattern = '^[0-9]\\d*$';
2663
2667
  _this.FloatPattern = '^([0-9]*[,])?[0-9]+$';
2664
2668
  //******************** Funzione di throttling per non spammare richieste in caso di animazioni attivate
@@ -2669,7 +2673,30 @@
2669
2673
  _this.UseUserValidators = false;
2670
2674
  return _this;
2671
2675
  }
2676
+ /**
2677
+ * Nvl con un minimo di senso
2678
+ * @param value Valore base
2679
+ * @param ifnod Valore da usare se **value** è nullo o undefined
2680
+ * @returns Il valore preso fra i due disponibili
2681
+ */
2682
+ FormAdaptiveComponent.prototype.nvl = function (value, ifnod) {
2683
+ return value == null || value == undefined ? ifnod : value;
2684
+ };
2672
2685
  FormAdaptiveComponent.prototype.ngOnInit = function () {
2686
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2687
+ // Assegnazione Opzioni da oggetto
2688
+ if (this.Options) {
2689
+ this.useJsDates = this.nvl((_a = this.Options) === null || _a === void 0 ? void 0 : _a.JsDates, this.useJsDates);
2690
+ ;
2691
+ this.CaseSensitive = this.nvl((_b = this.Options) === null || _b === void 0 ? void 0 : _b.CaseSensitive, this.CaseSensitive);
2692
+ this.MinChars = this.nvl((_c = this.Options) === null || _c === void 0 ? void 0 : _c.MinChars, this.MinChars);
2693
+ this.SearchFunction = this.nvl((_d = this.Options) === null || _d === void 0 ? void 0 : _d.SearchFunction, this.SearchFunction);
2694
+ this.Alignment = this.nvl((_e = this.Options) === null || _e === void 0 ? void 0 : _e.Alignment, this.Alignment);
2695
+ this.Precision = this.nvl((_f = this.Options) === null || _f === void 0 ? void 0 : _f.Precision, this.Precision);
2696
+ this.AllowDownload = this.nvl((_g = this.Options) === null || _g === void 0 ? void 0 : _g.AllowDownload, this.AllowDownload);
2697
+ this.AdjustNumber = this.nvl((_h = this.Options) === null || _h === void 0 ? void 0 : _h.AdjustNumber, this.AdjustNumber);
2698
+ this.Pattern = this.nvl((_j = this.Options) === null || _j === void 0 ? void 0 : _j.Pattern, this.Pattern);
2699
+ }
2673
2700
  if (this.ngControl) {
2674
2701
  var validators = this._validators || [];
2675
2702
  var pv = new forms.PatternValidator();
@@ -2701,7 +2728,7 @@
2701
2728
  var _a;
2702
2729
  return __awaiter(this, void 0, void 0, function () {
2703
2730
  var newSource, newType;
2704
- return __generator(this, function (_b) {
2731
+ return __generator(this, function (_k) {
2705
2732
  newSource = changes["Source"];
2706
2733
  newType = changes["Type"];
2707
2734
  if (newSource) {
@@ -2730,7 +2757,7 @@
2730
2757
  this.EvaluatedModel = obj;
2731
2758
  }
2732
2759
  if (this.Type == "date" || this.Type == "datetime") {
2733
- this.useJsDates = Object.prototype.toString.call(obj) === "[object Date]";
2760
+ this.useJsDates = this.useJsDates == null ? Object.prototype.toString.call(obj) === "[object Date]" : this.useJsDates;
2734
2761
  if (this.Type == "date")
2735
2762
  this.EvaluatedModel = this.datesExts.getFormatted(obj, true, false);
2736
2763
  if (this.Type == "datetime")
@@ -2747,7 +2774,7 @@
2747
2774
  this.EvaluatedModel = this.lc.loc(obj ? 'Yes' : 'No');
2748
2775
  }
2749
2776
  else if (this.Type == "time") {
2750
- var _b = __read((obj || "00:00:00").split(":"), 3), hours = _b[0], minutes = _b[1], seconds = _b[2];
2777
+ var _k = __read((obj || "00:00:00").split(":"), 3), hours = _k[0], minutes = _k[1], seconds = _k[2];
2751
2778
  obj = dayjs().hour(parseInt(hours !== null && hours !== void 0 ? hours : 0)).minute(parseInt(minutes !== null && minutes !== void 0 ? minutes : 0)).second(parseInt(seconds !== null && seconds !== void 0 ? seconds : 0));
2752
2779
  this.EvaluatedModel = (hours || '00') + ":" + (minutes || '00') + ":" + (seconds || '00');
2753
2780
  }
@@ -2958,7 +2985,8 @@
2958
2985
  Alignment: [{ type: core.Input }],
2959
2986
  SearchFunction: [{ type: core.Input }],
2960
2987
  MinChars: [{ type: core.Input }],
2961
- CaseSensitive: [{ type: core.Input }]
2988
+ CaseSensitive: [{ type: core.Input }],
2989
+ Options: [{ type: core.Input }]
2962
2990
  };
2963
2991
 
2964
2992
  // Angular
@@ -3156,6 +3184,7 @@
3156
3184
  return _this;
3157
3185
  }
3158
3186
  FormCheckboxComponent.prototype.ngOnInit = function () {
3187
+ _super.prototype.ngOnInit.call(this);
3159
3188
  if (this.SliderMode == null)
3160
3189
  this.SliderMode = this.FAV_SLIDER_MODE;
3161
3190
  };