@sumaris-net/ngx-components 1.6.14 → 1.6.15

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.
@@ -8370,11 +8370,37 @@
8370
8370
  function MatBadgeIconDirective(el) {
8371
8371
  this.el = el;
8372
8372
  }
8373
+ Object.defineProperty(MatBadgeIconDirective.prototype, "matIcon", {
8374
+ set: function (icon) {
8375
+ if (this._matIcon !== icon) {
8376
+ this._matIcon = icon;
8377
+ this.updateView();
8378
+ }
8379
+ },
8380
+ enumerable: false,
8381
+ configurable: true
8382
+ });
8383
+ Object.defineProperty(MatBadgeIconDirective.prototype, "ionIcon", {
8384
+ set: function (icon) {
8385
+ if (this._ionIcon !== icon) {
8386
+ this._ionIcon = icon;
8387
+ this.updateView();
8388
+ }
8389
+ },
8390
+ enumerable: false,
8391
+ configurable: true
8392
+ });
8373
8393
  MatBadgeIconDirective.prototype.ngOnInit = function () {
8394
+ this.updateView();
8395
+ };
8396
+ MatBadgeIconDirective.prototype.updateView = function () {
8374
8397
  this.size = this.size || 'medium';
8375
8398
  this.color = this.color || 'primary';
8376
8399
  if (this.color === 'warn')
8377
8400
  this.color = 'warning';
8401
+ var badge = this.el.nativeElement.querySelector('.mat-badge-content');
8402
+ if (!badge)
8403
+ return;
8378
8404
  var fontSize;
8379
8405
  switch (this.size) {
8380
8406
  case 'large':
@@ -8387,7 +8413,6 @@
8387
8413
  fontSize = '16px';
8388
8414
  break;
8389
8415
  }
8390
- var badge = this.el.nativeElement.querySelector('.mat-badge-content');
8391
8416
  badge.style.display = 'flex';
8392
8417
  badge.style.alignItems = 'center';
8393
8418
  badge.style.justifyContent = 'center';
@@ -8401,11 +8426,11 @@
8401
8426
  badge.style.background = "var(--ion-color-" + this.color + ")";
8402
8427
  badge.style.color = "var(--ion-color-" + this.color + "-contrast)";
8403
8428
  }
8404
- if (this.matIcon) {
8405
- badge.innerHTML = "<i class=\"material-icons\" style=\"font-size: " + fontSize + ";\">" + this.matIcon + "</i>";
8429
+ if (this._matIcon) {
8430
+ badge.innerHTML = "<i class=\"material-icons\" style=\"font-size: " + fontSize + ";\">" + this._matIcon + "</i>";
8406
8431
  }
8407
- else if (this.ionIcon) {
8408
- badge.innerHTML = "<ion-icon style=\"font-size: " + fontSize + "; pointer-events: none;\" name=\"" + this.ionIcon + "\"></ion-icon>";
8432
+ else if (this._ionIcon) {
8433
+ badge.innerHTML = "<ion-icon style=\"font-size: " + fontSize + "; pointer-events: none;\" name=\"" + this._ionIcon + "\"></ion-icon>";
8409
8434
  }
8410
8435
  };
8411
8436
  return MatBadgeIconDirective;
@@ -19574,13 +19599,18 @@
19574
19599
 
19575
19600
  var MatBadgeIconTestPage = /** @class */ (function () {
19576
19601
  function MatBadgeIconTestPage() {
19602
+ this.$dynamicIcon = new rxjs.BehaviorSubject('alert');
19577
19603
  }
19604
+ MatBadgeIconTestPage.prototype.changeIcon = function (event) {
19605
+ console.info(event);
19606
+ this.$dynamicIcon.next(event.value);
19607
+ };
19578
19608
  return MatBadgeIconTestPage;
19579
19609
  }());
19580
19610
  MatBadgeIconTestPage.decorators = [
19581
19611
  { type: i0.Component, args: [{
19582
19612
  selector: 'mat-badge-icon-test',
19583
- template: "\n<ion-header>\n <ion-toolbar color=\"primary\">\n\n <ion-buttons slot=\"start\">\n <ion-back-button></ion-back-button>\n </ion-buttons>\n\n <ion-title>matBadgeIcon directive</ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\">\n\n <!-- small badge -->\n <p>\n <ion-text color=\"tertiary\">\n <span matBadge matIcon=\"check\"\n matBadgeSize=\"small\"\n matBadgeColor=\"accent\"\n matBadgeOverlap=\"false\">Small badge</span>\n </ion-text>\n </p>\n\n <!-- medium badge -->\n <p>\n <ion-text matBadge matBadgeIcon=\"check\"\n matBadgeSize=\"medium\"\n matBadgeColor=\"tertiary\"\n matBadgeOverlap=\"false\"\n >Medium badge</ion-text>\n </p>\n\n <!-- small badge -->\n <p>\n <ion-label matBadge matBadgeIcon=\"close\" matBadgeSize=\"large\"\n matBadgeOverlap=\"false\">Large badge</ion-label>\n </p>\n\n <!-- default size badge -->\n <p>\n <ion-label matBadge matBadgeIcon=\"check\" matBadgeColor=\"success\"\n matBadgeOverlap=\"false\">Badge (no size, no color)\n </ion-label>\n </p>\n\n <!-- ion icon -->\n <p>\n <ion-label matBadge\n ionBadgeIcon=\"checkmark\"\n matBadgeColor=\"success\"\n matBadgeOverlap=\"false\">Badge with ion-icon\n </ion-label>\n </p>\n\n <!-- ion icon clear -->\n <p>\n <ion-label matBadge\n ionBadgeIcon=\"checkmark-circle\"\n matBadgeColor=\"tertiary\"\n matBadgeFill=\"clear\"\n matBadgeOverlap=\"false\">Badge with clear icon\n </ion-label>\n </p>\n\n\n</ion-content>\n"
19613
+ template: "\n<ion-header>\n <ion-toolbar color=\"primary\">\n\n <ion-buttons slot=\"start\">\n <ion-back-button></ion-back-button>\n </ion-buttons>\n\n <ion-title>matBadgeIcon directive</ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\">\n\n <!-- small badge -->\n <p>\n <ion-text color=\"tertiary\">\n <span matBadge matIcon=\"check\"\n matBadgeSize=\"small\"\n matBadgeColor=\"accent\"\n matBadgeOverlap=\"false\">Small badge</span>\n </ion-text>\n </p>\n\n <!-- medium badge -->\n <p>\n <ion-text matBadge matBadgeIcon=\"check\"\n matBadgeSize=\"medium\"\n matBadgeColor=\"tertiary\"\n matBadgeOverlap=\"false\"\n >Medium badge</ion-text>\n </p>\n\n <!-- small badge -->\n <p>\n <ion-label matBadge matBadgeIcon=\"close\" matBadgeSize=\"large\"\n matBadgeOverlap=\"false\">Large badge</ion-label>\n </p>\n\n <!-- default size badge -->\n <p>\n <ion-label matBadge matBadgeIcon=\"check\" matBadgeColor=\"success\"\n matBadgeOverlap=\"false\">Badge (no size, no color)\n </ion-label>\n </p>\n\n <!-- ion icon -->\n <p>\n <ion-label matBadge\n ionBadgeIcon=\"checkmark\"\n matBadgeColor=\"success\"\n matBadgeOverlap=\"false\">Badge with ion-icon\n </ion-label>\n </p>\n\n <!-- ion icon clear -->\n <p>\n <ion-label matBadge\n ionBadgeIcon=\"checkmark-circle\"\n matBadgeColor=\"tertiary\"\n matBadgeFill=\"clear\"\n matBadgeOverlap=\"false\">Badge with clear icon\n </ion-label>\n </p>\n\n <ion-row class=\"ion-no-padding\">\n <ion-col>\n <ion-label matBadge\n [ionBadgeIcon]=\"$dynamicIcon|async\"\n matBadgeColor=\"tertiary\"\n matBadgeFill=\"clear\"\n matBadgeOverlap=\"false\">Badge with dynamic icon\n </ion-label>\n </ion-col>\n\n <ion-col>\n <mat-form-field>\n <mat-select\n placeholder=\"Select icon\" (selectionChange)=\"changeIcon($event)\"\n [value]=\"$dynamicIcon.value\">\n <mat-option [value]=\"'checkmark-circle'\">checkmark-circle</mat-option>\n <mat-option [value]=\"'alert'\">alert</mat-option>\n <mat-option [value]=\"'flag'\">flag</mat-option>\n </mat-select>\n </mat-form-field>\n\n </ion-col>\n </ion-row>\n\n</ion-content>\n"
19584
19614
  },] }
19585
19615
  ];
19586
19616