ng-inail-common 1.0.443 → 1.0.445

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.
@@ -2747,9 +2747,6 @@
2747
2747
  this.ASC = ThLabelComponent.ASC;
2748
2748
  this.DESC = ThLabelComponent.DESC;
2749
2749
  this.UNSORTED = ThLabelComponent.UNSORTED;
2750
- // Deprecato!
2751
- // Obbligatorio se paginazione interna: Da usare in 2-way-data-binding
2752
- this.elementsChange = new i0.EventEmitter();
2753
2750
  this.click = new i0.EventEmitter();
2754
2751
  this.direction = ThLabelComponent.UNSORTED;
2755
2752
  this.elementRef = element;
@@ -2766,6 +2763,30 @@
2766
2763
  * @return {?}
2767
2764
  */
2768
2765
  ThLabelComponent.prototype.ngAfterViewInit = /**
2766
+ * @return {?}
2767
+ */
2768
+ function () {
2769
+ var _this = this;
2770
+ this.thParent = this.elementRef.nativeElement.parentNode;
2771
+ if (this.thParent != undefined) {
2772
+ this.thParent.onclick = ( /**
2773
+ * @param {?} ev
2774
+ * @return {?}
2775
+ */function (ev) { return _this.onClick(ev); });
2776
+ this.thParent.onkeyup = ( /**
2777
+ * @param {?} ev
2778
+ * @return {?}
2779
+ */function (ev) {
2780
+ if (ev.key === 'Enter' || ev.keyCode === 13) {
2781
+ _this.onClick(ev);
2782
+ }
2783
+ });
2784
+ }
2785
+ };
2786
+ /**
2787
+ * @return {?}
2788
+ */
2789
+ ThLabelComponent.prototype.ngOnDestroy = /**
2769
2790
  * @return {?}
2770
2791
  */
2771
2792
  function () {
@@ -2803,8 +2824,6 @@
2803
2824
  * @return {?}
2804
2825
  */
2805
2826
  function (event) {
2806
- // todo
2807
- // console.warn('th-label-click')
2808
2827
  event.stopPropagation();
2809
2828
  this.emettiEventoOrdinamento();
2810
2829
  };
@@ -2817,8 +2836,6 @@
2817
2836
  * @return {?}
2818
2837
  */
2819
2838
  function () {
2820
- // todo
2821
- // console.warn('th-label emettiEventoOrdinamento', this.sortable, this.property)
2822
2839
  if (this.sortable && this.property) {
2823
2840
  this.direction = this.direction * -1;
2824
2841
  if (this.direction == ThLabelComponent.UNSORTED) {
@@ -2829,8 +2846,6 @@
2829
2846
  direction: this.direction,
2830
2847
  property: this.property
2831
2848
  };
2832
- // todo
2833
- // console.warn('th-label emettiEventoOrdinamento', info)
2834
2849
  this.click.emit(info);
2835
2850
  }
2836
2851
  };
@@ -2849,7 +2864,7 @@
2849
2864
  ThLabelComponent.decorators = [
2850
2865
  { type: i0.Component, args: [{
2851
2866
  selector: 'inail-th-label',
2852
- template: "<a *ngIf=\"sortable\"\n href=\"javascript:void(0)\"\n role=\"button\"\n class=\"inail-th-label-view-encapsulation\"\n [attr.aria-label]=\"sortable ? label + ': attiva per ordinare la colonna in ordine ' + (direction == ASC ? 'decrescente' : 'crescente') : undefined\"\n (click)=\"onClick($event)\">\n<span class=\"sortable thLabel\" [innerHTML]=\"label\" [attr.title]=\"title\">\n <!-- <span *ngIf=\"sortable\" class=\"fa {{direction==0 ? 'fa-sort' : direction==1 ? 'fa-sort-asc' : 'fa-sort-desc'}}\"></span>-->\n</span>\n</a>\n<span *ngIf=\"!sortable\"\n (click)=\"onClick($event)\" [innerHTML]=\"label\" [attr.title]=\"title\">\n <!-- <span *ngIf=\"sortable\" class=\"fa {{direction==0 ? 'fa-sort' : direction==1 ? 'fa-sort-asc' : 'fa-sort-desc'}}\"></span>-->\n</span>\n<div *comment>\n <!-- con aria sort (problema con W3C) -->\n <a *ngIf=\"sortable\"\n href=\"javascript:void(0)\"\n role=\"button\"\n class=\"inail-th-label-view-encapsulation\"\n [attr.aria-label]=\"sortable ? label + ': attiva per ordinare la colonna in ordine ' + (direction == ASC ? 'decrescente' : 'crescente') : undefined\"\n [attr.aria-sort]=\"sortable ? getAriaSortValue(direction) : undefined\"\n (click)=\"onClick($event)\">\n <span class=\"sortable thLabel\" [innerHTML]=\"label\" [attr.title]=\"title\">\n <!-- <span *ngIf=\"sortable\" class=\"fa {{direction==0 ? 'fa-sort' : direction==1 ? 'fa-sort-asc' : 'fa-sort-desc'}}\"></span>-->\n </span>\n </a>\n</div>\n",
2867
+ template: "<!--<a *ngIf=\"sortable\"\n href=\"javascript:void(0)\"\n role=\"button\"\n class=\"inail-th-label-view-encapsulation\"\n [attr.aria-label]=\"sortable ? label + ': attiva per ordinare la colonna in ordine ' + (direction == ASC ? 'decrescente' : 'crescente') : undefined\"\n (click)=\"onClick($event)\">\n<span class=\"sortable thLabel\" [innerHTML]=\"label\" [attr.title]=\"title\">\n &lt;!&ndash; <span *ngIf=\"sortable\" class=\"fa {{direction==0 ? 'fa-sort' : direction==1 ? 'fa-sort-asc' : 'fa-sort-desc'}}\"></span>&ndash;&gt;\n</span>\n</a>\n<span *ngIf=\"!sortable\"\n (click)=\"onClick($event)\" [innerHTML]=\"label\" [attr.title]=\"title\">\n &lt;!&ndash; <span *ngIf=\"sortable\" class=\"fa {{direction==0 ? 'fa-sort' : direction==1 ? 'fa-sort-asc' : 'fa-sort-desc'}}\"></span>&ndash;&gt;\n</span>\n<div *comment>\n &lt;!&ndash; con aria sort (problema con W3C) &ndash;&gt;\n <a *ngIf=\"sortable\"\n href=\"javascript:void(0)\"\n role=\"button\"\n class=\"inail-th-label-view-encapsulation\"\n [attr.aria-label]=\"sortable ? label + ': attiva per ordinare la colonna in ordine ' + (direction == ASC ? 'decrescente' : 'crescente') : undefined\"\n [attr.aria-sort]=\"sortable ? getAriaSortValue(direction) : undefined\"\n (click)=\"onClick($event)\">\n <span class=\"sortable thLabel\" [innerHTML]=\"label\" [attr.title]=\"title\">\n &lt;!&ndash; <span *ngIf=\"sortable\" class=\"fa {{direction==0 ? 'fa-sort' : direction==1 ? 'fa-sort-asc' : 'fa-sort-desc'}}\"></span>&ndash;&gt;\n </span>\n </a>\n</div>-->\n\n<span [innerHTML]=\"label\"\n [attr.title]=\"title\">\n</span>\n",
2853
2868
  encapsulation: i0.ViewEncapsulation.None,
2854
2869
  styles: [".inail-th-label-view-encapsulation .sortable{cursor:pointer}.inail-th-label-view-encapsulation .fa{padding:0 10px}a.inail-th-label-view-encapsulation{background:0 0;color:#000;text-decoration:none}"]
2855
2870
  }] }
@@ -2862,8 +2877,6 @@
2862
2877
  };
2863
2878
  ThLabelComponent.propDecorators = {
2864
2879
  label: [{ type: i0.Input }],
2865
- elements: [{ type: i0.Input }],
2866
- elementsChange: [{ type: i0.Output }],
2867
2880
  property: [{ type: i0.Input }],
2868
2881
  title: [{ type: i0.Input }],
2869
2882
  sortable: [{ type: i0.Input }],
@@ -3484,16 +3497,34 @@
3484
3497
  */
3485
3498
  function (thLabelComponent) {
3486
3499
  if (thLabelComponent && thLabelComponent.sortable === true) {
3500
+ // let th: HTMLElement = thLabelComponent.elementRef.nativeElement.parentNode;
3487
3501
  /** @type {?} */
3488
- var th = thLabelComponent.elementRef.nativeElement.parentNode;
3502
+ var th = thLabelComponent.thParent;
3503
+ // if (th) {
3504
+ //
3505
+ // this.removeSortClass(th);
3506
+ // this.renderer.addClass(th, this.getThSortClass(thLabelComponent.direction));
3507
+ //
3508
+ // // Spostato in th-label
3509
+ // // th.setAttribute('aria-label', thLabelComponent.label + ": attiva per ordinare la colonna in ordine " + (thLabelComponent.direction == ThLabelComponent.ASC ? 'decrescente' : 'crescente'));
3510
+ //
3511
+ // th.setAttribute('aria-sort', this.getAriaSortValue(thLabelComponent.direction));
3512
+ //
3513
+ // if (thLabelComponent.direction == ThLabelComponent.UNSORTED) {
3514
+ //
3515
+ // th.removeAttribute('aria-sort');
3516
+ // }
3517
+ // }
3489
3518
  if (th) {
3490
3519
  this.removeSortClass(th);
3491
3520
  this.renderer.addClass(th, this.getThSortClass(thLabelComponent.direction));
3492
- // Spostato in th-label
3493
- // th.setAttribute('aria-label', thLabelComponent.label + ": attiva per ordinare la colonna in ordine " + (thLabelComponent.direction == ThLabelComponent.ASC ? 'decrescente' : 'crescente'));
3494
- th.setAttribute('aria-sort', this.getAriaSortValue(thLabelComponent.direction));
3495
3521
  if (thLabelComponent.direction == ThLabelComponent.UNSORTED) {
3496
- th.removeAttribute('aria-sort');
3522
+ this.renderer.removeAttribute(th, 'aria-sort');
3523
+ this.renderer.setAttribute(th, 'aria-label', "Colonna " + thLabelComponent.label + " non ordinata, attiva per ordinare in ordine crescente");
3524
+ }
3525
+ else {
3526
+ this.renderer.setAttribute(th, 'aria-sort', this.getAriaSortValue(thLabelComponent.direction));
3527
+ this.renderer.setAttribute(th, 'aria-label', "Colonna " + thLabelComponent.label + " ordinata in ordine " + (thLabelComponent.direction == ThLabelComponent.ASC ? 'crescente' : 'decrescente') + ", attiva per ordinare in ordine " + (thLabelComponent.direction == ThLabelComponent.ASC ? 'decrescente' : 'crescente'));
3497
3528
  }
3498
3529
  }
3499
3530
  }