@net7/components 3.8.4 → 3.8.5

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.
@@ -1780,12 +1780,23 @@ class TagComponent {
1780
1780
  return;
1781
1781
  this.emit('click', payload);
1782
1782
  }
1783
+ getIcon(data) {
1784
+ if (!data.icon)
1785
+ return null;
1786
+ if (typeof data.icon === 'string') {
1787
+ return {
1788
+ id: data.icon,
1789
+ payload: data.payload,
1790
+ };
1791
+ }
1792
+ return data.icon;
1793
+ }
1783
1794
  }
1784
1795
  TagComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: TagComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1785
- TagComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: TagComponent, selector: "n7-tag", inputs: { data: "data", emit: "emit" }, ngImport: i0, template: "<span class=\"n7-tag {{data.classes || ''}}\" *ngIf=\"data\">\n <span class=\"n7-tag__icon {{data.preIcon.id}}\" *ngIf=\"data.preIcon?.id\" (click)=\"onClick(data.preIcon.payload)\"></span>\n <span class=\"n7-tag__label\" *ngIf=\"data.label\">\n {{ data.label }}\n </span>\n <span class=\"n7-tag__text\" *ngIf=\"data.text\">\n {{ data.text }}\n </span>\n <span class=\"n7-tag__icon {{data.icon.id}}\" *ngIf=\"data.icon\" (click)=\"onClick(data.icon.payload)\"></span>\n</span>\n", directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1796
+ TagComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: TagComponent, selector: "n7-tag", inputs: { data: "data", emit: "emit" }, ngImport: i0, template: "<span class=\"n7-tag {{data.classes || ''}}\" *ngIf=\"data\">\n <span class=\"n7-tag__icon {{data.preIcon.id}}\" *ngIf=\"data.preIcon?.id\" (click)=\"onClick(data.preIcon.payload)\"></span>\n <span class=\"n7-tag__label\" *ngIf=\"data.label\">\n {{ data.label }}\n </span>\n <span class=\"n7-tag__text\" *ngIf=\"data.text\">\n {{ data.text }}\n </span>\n <span class=\"n7-tag__icon {{icon.id}}\" *ngIf=\"getIcon(data) as icon\" (click)=\"onClick(icon.payload)\"></span>\n</span>\n", directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1786
1797
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: TagComponent, decorators: [{
1787
1798
  type: Component,
1788
- args: [{ selector: 'n7-tag', template: "<span class=\"n7-tag {{data.classes || ''}}\" *ngIf=\"data\">\n <span class=\"n7-tag__icon {{data.preIcon.id}}\" *ngIf=\"data.preIcon?.id\" (click)=\"onClick(data.preIcon.payload)\"></span>\n <span class=\"n7-tag__label\" *ngIf=\"data.label\">\n {{ data.label }}\n </span>\n <span class=\"n7-tag__text\" *ngIf=\"data.text\">\n {{ data.text }}\n </span>\n <span class=\"n7-tag__icon {{data.icon.id}}\" *ngIf=\"data.icon\" (click)=\"onClick(data.icon.payload)\"></span>\n</span>\n" }]
1799
+ args: [{ selector: 'n7-tag', template: "<span class=\"n7-tag {{data.classes || ''}}\" *ngIf=\"data\">\n <span class=\"n7-tag__icon {{data.preIcon.id}}\" *ngIf=\"data.preIcon?.id\" (click)=\"onClick(data.preIcon.payload)\"></span>\n <span class=\"n7-tag__label\" *ngIf=\"data.label\">\n {{ data.label }}\n </span>\n <span class=\"n7-tag__text\" *ngIf=\"data.text\">\n {{ data.text }}\n </span>\n <span class=\"n7-tag__icon {{icon.id}}\" *ngIf=\"getIcon(data) as icon\" (click)=\"onClick(icon.payload)\"></span>\n</span>\n" }]
1789
1800
  }], propDecorators: { data: [{
1790
1801
  type: Input
1791
1802
  }], emit: [{
@@ -7818,14 +7829,7 @@ const TABLE_MOCK = {
7818
7829
  const TAG_MOCK = {
7819
7830
  label: 'label: ',
7820
7831
  text: 'text',
7821
- icon: {
7822
- id: 'n7-icon-close',
7823
- payload: 'close'
7824
- },
7825
- preIcon: {
7826
- id: 'n7-icon-angle-left',
7827
- payload: 'preicon'
7828
- },
7832
+ icon: 'n7-icon-close',
7829
7833
  payload: 'tag-payload',
7830
7834
  classes: 'tag1-class',
7831
7835
  };