ng-inail-common 1.0.384 → 1.0.388

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.
@@ -3061,6 +3061,18 @@
3061
3061
  && changes.paginationInfo.currentValue != undefined) {
3062
3062
  this.externalPaginationSorting = true;
3063
3063
  }
3064
+ // Se nella paginazione esterna viene specificata una proprieta di sorting
3065
+ // modifico il componente thLabel associato
3066
+ if (this.externalPaginationSorting && this.paginationInfo && this.paginationInfo.sortProperty) {
3067
+ if (this.thLabelComponents) {
3068
+ /** @type {?} */
3069
+ var thLabel = this.thLabelComponents.find(( /**
3070
+ * @param {?} item
3071
+ * @return {?}
3072
+ */function (item) { return item.property == _this.paginationInfo.sortProperty; }));
3073
+ this.setSortDirection(thLabel, ( /** @type {?} */(this.paginationInfo.sortDirection)));
3074
+ }
3075
+ }
3064
3076
  // Verifico se e' cambiata la lista degli elementi in input.
3065
3077
  // Nel caso in cui si stia effettuando una paginazione interna
3066
3078
  // emetto il sottoinsieme inerente la prima pagina
@@ -3119,6 +3131,22 @@
3119
3131
  // console.warn('thLabelComponents PTR', this.thLabelComponents)
3120
3132
  this.inizializzaTabella(this.thLabelComponents);
3121
3133
  this.lookAtThLabel(this.thLabelComponents);
3134
+ // console.warn('>>>>>', this.paginationInfo, this.thLabelComponents)
3135
+ //
3136
+ // // Se nella paginazione esterna viene specificata una proprieta di sorting
3137
+ // // modifico il componente thLabel associato
3138
+ // if (this.externalPaginationSorting && this.paginationInfo && this.paginationInfo.sortProperty) {
3139
+ //
3140
+ // if (this.thLabelComponents) {
3141
+ //
3142
+ //
3143
+ //
3144
+ // let thLabel: ThLabelComponent = this.thLabelComponents.find(item => item.property == this.paginationInfo.sortProperty);
3145
+ // this.setSortDirection(thLabel, this.paginationInfo.sortDirection as ('asc' | 'desc'));
3146
+ //
3147
+ // console.warn('XXXXXXXXXXXXXXXX', thLabel)
3148
+ // }
3149
+ // }
3122
3150
  };
3123
3151
  /**
3124
3152
  * Effettua varie operazioni di inizializzazione della tabella
@@ -3648,6 +3676,32 @@
3648
3676
  return !this.disabilitaPaginazione
3649
3677
  && (this.elements != undefined || (this.externalPaginationSorting != undefined && this.paginationInfo != undefined));
3650
3678
  };
3679
+ /**
3680
+ * @param {?} thLabel
3681
+ * @param {?} direction
3682
+ * @return {?}
3683
+ */
3684
+ PagedTableRendererComponent.prototype.setSortDirection = /**
3685
+ * @param {?} thLabel
3686
+ * @param {?} direction
3687
+ * @return {?}
3688
+ */
3689
+ function (thLabel, direction) {
3690
+ if (thLabel) {
3691
+ switch (direction) {
3692
+ case "asc":
3693
+ thLabel.direction = ThLabelComponent.ASC;
3694
+ break;
3695
+ case "desc":
3696
+ thLabel.direction = ThLabelComponent.DESC;
3697
+ break;
3698
+ default:
3699
+ thLabel.direction = ThLabelComponent.UNSORTED;
3700
+ break;
3701
+ }
3702
+ this.modificaTh(thLabel);
3703
+ }
3704
+ };
3651
3705
  PagedTableRendererComponent.DEFAULT_TABLE_LENGTH = 10;
3652
3706
  PagedTableRendererComponent.decorators = [
3653
3707
  { type: i0.Component, args: [{
@@ -5337,10 +5391,10 @@
5337
5391
  */function () {
5338
5392
  if (!_this.disabled) {
5339
5393
  if (_this.min != undefined && _this.valueValue < _this.min) {
5340
- _this.value = _this.min;
5394
+ _this.value = _this.previousValue != undefined ? _this.previousValue : _this.min;
5341
5395
  }
5342
5396
  else if (_this.max != undefined && _this.valueValue > _this.max) {
5343
- _this.value = _this.max;
5397
+ _this.value = _this.previousValue != undefined ? _this.previousValue : _this.max;
5344
5398
  }
5345
5399
  }
5346
5400
  }));
@@ -8672,6 +8726,23 @@
8672
8726
  * @return {?}
8673
8727
  */function () { return _this.numeroColonne = $("#" + _this.id + " th").length; }));
8674
8728
  }
8729
+ // Se nella paginazione esterna viene specificata una proprieta di sorting
8730
+ // modifico il componente thLabel associato
8731
+ if (this.paginationInfo && this.paginationInfo.sortProperty) {
8732
+ // console.warn('>>>>>>>', this.paginationInfo, this.thLabelComponents)
8733
+ if (this.thLabelComponents) {
8734
+ /** @type {?} */
8735
+ var thLabel = this.thLabelComponents.find(( /**
8736
+ * @param {?} item
8737
+ * @return {?}
8738
+ */function (item) { return item.property == _this.paginationInfo.sortProperty; }));
8739
+ this.pagedTableRendererComponent.setSortDirection(thLabel, ( /** @type {?} */(this.paginationInfo.sortDirection)));
8740
+ }
8741
+ }
8742
+ // In caso di paginazione interna se specificato un ordinamento iniziale
8743
+ if (!this.paginationInfo && this.initialSort) {
8744
+ this.impostaOrdinamentoIniziale();
8745
+ }
8675
8746
  };
8676
8747
  /**
8677
8748
  * @return {?}
@@ -8709,6 +8780,44 @@
8709
8780
  this.pagedTableRendererComponent.inizializzaTabella(this.thLabelComponents);
8710
8781
  this.pagedTableRendererComponent.lookAtThLabel(this.thLabelComponents);
8711
8782
  }
8783
+ // Se nella paginazione esterna viene specificata una proprieta di sorting
8784
+ // modifico il componente thLabel associato
8785
+ if (this.paginationInfo && this.paginationInfo.sortProperty) {
8786
+ if (this.thLabelComponents) {
8787
+ /** @type {?} */
8788
+ var thLabel = this.thLabelComponents.find(( /**
8789
+ * @param {?} item
8790
+ * @return {?}
8791
+ */function (item) { return item.property == _this.paginationInfo.sortProperty; }));
8792
+ this.pagedTableRendererComponent.setSortDirection(thLabel, ( /** @type {?} */(this.paginationInfo.sortDirection)));
8793
+ }
8794
+ }
8795
+ // In caso di paginazione interna se specificato un ordinamento iniziale
8796
+ if (!this.paginationInfo && this.initialSort) {
8797
+ this.impostaOrdinamentoIniziale();
8798
+ }
8799
+ };
8800
+ /**
8801
+ * @return {?}
8802
+ */
8803
+ PagedTableComponent.prototype.impostaOrdinamentoIniziale = /**
8804
+ * @return {?}
8805
+ */
8806
+ function () {
8807
+ var _this = this;
8808
+ if (this.thLabelComponents) {
8809
+ this.thLabelComponents.forEach(( /**
8810
+ * @param {?} thLabel
8811
+ * @return {?}
8812
+ */function (thLabel) {
8813
+ if (thLabel.property == _this.initialSort.sortProperty) {
8814
+ _this.pagedTableRendererComponent.setSortDirection(thLabel, ( /** @type {?} */(_this.initialSort.sortDirection)));
8815
+ }
8816
+ else {
8817
+ _this.pagedTableRendererComponent.setSortDirection(thLabel, undefined);
8818
+ }
8819
+ }));
8820
+ }
8712
8821
  };
8713
8822
  /**
8714
8823
  * @param {?} list
@@ -8750,6 +8859,7 @@
8750
8859
  elements: [{ type: i0.Input }],
8751
8860
  subset: [{ type: i0.Input }],
8752
8861
  subsetChange: [{ type: i0.Output }],
8862
+ initialSort: [{ type: i0.Input }],
8753
8863
  paginationInfo: [{ type: i0.Input }],
8754
8864
  doPagination: [{ type: i0.Input }],
8755
8865
  pageSize: [{ type: i0.Input }],