@sumaris-net/ngx-components 1.6.12 → 1.6.16

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.
@@ -7473,14 +7473,68 @@ MaterialChipsModule.decorators = [
7473
7473
  class MatBadgeIconDirective {
7474
7474
  constructor(el) {
7475
7475
  this.el = el;
7476
+ this._subscription = null;
7477
+ this._$update = new Subject();
7478
+ }
7479
+ set size(value) {
7480
+ if (this._size !== value) {
7481
+ this._size = value;
7482
+ this.updateView();
7483
+ }
7484
+ }
7485
+ get size() {
7486
+ return this._size;
7487
+ }
7488
+ set color(value) {
7489
+ if (this._color !== value) {
7490
+ this._color = value;
7491
+ this.updateView();
7492
+ }
7493
+ }
7494
+ get color() {
7495
+ return this._color;
7496
+ }
7497
+ set fill(value) {
7498
+ if (this._fill !== value) {
7499
+ this._fill = value;
7500
+ this.updateView();
7501
+ }
7502
+ }
7503
+ get fill() {
7504
+ return this._fill;
7505
+ }
7506
+ set matIcon(icon) {
7507
+ if (this._matIcon !== icon) {
7508
+ this._matIcon = icon;
7509
+ this.updateView();
7510
+ }
7511
+ }
7512
+ set ionIcon(icon) {
7513
+ if (this._ionIcon !== icon) {
7514
+ this._ionIcon = icon;
7515
+ this.updateView();
7516
+ }
7476
7517
  }
7477
7518
  ngOnInit() {
7478
- this.size = this.size || 'medium';
7479
- this.color = this.color || 'primary';
7480
- if (this.color === 'warn')
7481
- this.color = 'warning';
7519
+ this._size = this._size || 'medium';
7520
+ this._color = this._color || 'primary';
7521
+ if (this._color === 'warn')
7522
+ this._color = 'warning';
7523
+ this.updateView();
7524
+ this._subscription = this._$update
7525
+ //.pipe(debounceTime(10000))
7526
+ .subscribe(() => this.updateView());
7527
+ }
7528
+ ngOnDestroy() {
7529
+ var _a;
7530
+ (_a = this._subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
7531
+ }
7532
+ updateView() {
7533
+ const badge = this.el.nativeElement.querySelector('.mat-badge-content');
7534
+ if (!badge)
7535
+ return;
7482
7536
  let fontSize;
7483
- switch (this.size) {
7537
+ switch (this._size) {
7484
7538
  case 'large':
7485
7539
  fontSize = '24px';
7486
7540
  break;
@@ -7491,26 +7545,31 @@ class MatBadgeIconDirective {
7491
7545
  fontSize = '16px';
7492
7546
  break;
7493
7547
  }
7494
- const badge = this.el.nativeElement.querySelector('.mat-badge-content');
7495
- badge.style.display = 'flex';
7496
- badge.style.alignItems = 'center';
7497
- badge.style.justifyContent = 'center';
7548
+ let html = '';
7549
+ if (this._matIcon) {
7550
+ html = `<i class="material-icons" style="font-size: ${fontSize};">${this._matIcon}</i>`;
7551
+ }
7552
+ else if (this._ionIcon) {
7553
+ html = `<ion-icon style="font-size: ${fontSize}; pointer-events: none;" name="${this._ionIcon}"></ion-icon>`;
7554
+ }
7555
+ if (this._html !== html) {
7556
+ this._html = html;
7557
+ badge.innerHTML = html;
7558
+ }
7559
+ // Update style
7498
7560
  // fill: 'clear'
7499
- if (this.fill === 'clear') {
7500
- badge.style.color = `var(--ion-color-${this.color})`;
7561
+ if (this._fill === 'clear') {
7562
+ badge.style.color = `var(--ion-color-${this._color})`;
7501
7563
  badge.style.background = 'transparent';
7502
7564
  }
7503
7565
  // fill: 'solid' (default value)
7504
7566
  else {
7505
- badge.style.background = `var(--ion-color-${this.color})`;
7506
- badge.style.color = `var(--ion-color-${this.color}-contrast)`;
7507
- }
7508
- if (this.matIcon) {
7509
- badge.innerHTML = `<i class="material-icons" style="font-size: ${fontSize};">${this.matIcon}</i>`;
7510
- }
7511
- else if (this.ionIcon) {
7512
- badge.innerHTML = `<ion-icon style="font-size: ${fontSize}; pointer-events: none;" name="${this.ionIcon}"></ion-icon>`;
7567
+ badge.style.background = `var(--ion-color-${this._color})`;
7568
+ badge.style.color = `var(--ion-color-${this._color}-contrast)`;
7513
7569
  }
7570
+ badge.style.alignItems = 'center';
7571
+ badge.style.justifyContent = 'center';
7572
+ badge.style.display = 'flex';
7514
7573
  }
7515
7574
  }
7516
7575
  MatBadgeIconDirective.decorators = [
@@ -7527,6 +7586,9 @@ MatBadgeIconDirective.ctorParameters = () => [
7527
7586
  { type: ElementRef }
7528
7587
  ];
7529
7588
  MatBadgeIconDirective.propDecorators = {
7589
+ size: [{ type: Input, args: ['matBadgeSize',] }],
7590
+ color: [{ type: Input, args: ['matBadgeColor',] }],
7591
+ fill: [{ type: Input, args: ['matBadgeFill',] }],
7530
7592
  matIcon: [{ type: Input, args: ['matBadgeIcon',] }],
7531
7593
  ionIcon: [{ type: Input, args: ['ionBadgeIcon',] }]
7532
7594
  };
@@ -17061,11 +17123,17 @@ ChipsTestPage.ctorParameters = () => [
17061
17123
  ];
17062
17124
 
17063
17125
  class MatBadgeIconTestPage {
17126
+ constructor() {
17127
+ this.$icon = new BehaviorSubject('alert');
17128
+ this.$size = new BehaviorSubject('small');
17129
+ this.$fill = new BehaviorSubject('solid');
17130
+ this.$color = new BehaviorSubject('danger');
17131
+ }
17064
17132
  }
17065
17133
  MatBadgeIconTestPage.decorators = [
17066
17134
  { type: Component, args: [{
17067
17135
  selector: 'mat-badge-icon-test',
17068
- 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"
17136
+ 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 <mat-icon [style.color]=\"'var(--ion-color-secondary)'\"\n matBadge\n [ionBadgeIcon]=\"$icon|async\"\n [matBadgeColor]=\"$color|async\"\n [matBadgeFill]=\"$fill|async\"\n [matBadgeSize]=\"$size|async\"\n matBadgeOverlap=\"false\">\n <ion-icon slot=\"icon-only\"\n [color]=\"'secondary'\"\n name=\"navigate\"\n ></ion-icon>\n </mat-icon>\n </ion-col>\n\n <ion-col>\n <mat-form-field>\n <mat-select placeholder=\"matBadgeColor\"\n [value]=\"$color.value\"\n (selectionChange)=\"this.$color.next($event.value)\">\n <mat-option [value]=\"'primary'\">primary</mat-option>\n <mat-option [value]=\"'secondary'\">secondary</mat-option>\n <mat-option [value]=\"'tertiary'\">tertiary</mat-option>\n <mat-option [value]=\"'danger'\">danger</mat-option>\n </mat-select>\n </mat-form-field>\n </ion-col>\n\n <ion-col>\n <mat-form-field>\n <mat-select placeholder=\"ionBadgeIcon\"\n [value]=\"$icon.value\"\n (selectionChange)=\"this.$icon.next($event.value)\">\n <mat-option [value]=\"'checkmark-circle'\">checkmark-circle</mat-option>\n <mat-option [value]=\"'alert-circle'\">alert-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 </ion-col>\n\n <ion-col>\n <mat-form-field>\n <mat-select placeholder=\"matBadgeSize\"\n [value]=\"$size.value\"\n (selectionChange)=\"this.$size.next($event.value)\">\n <mat-option [value]=\"'large'\">large</mat-option>\n <mat-option [value]=\"'medium'\">medium</mat-option>\n <mat-option [value]=\"'small'\">small</mat-option>\n </mat-select>\n </mat-form-field>\n </ion-col>\n\n <ion-col>\n <mat-form-field>\n <mat-select placeholder=\"matBadgeFill\"\n [value]=\"$fill.value\"\n (selectionChange)=\"this.$fill.next($event.value)\">\n <mat-option [value]=\"'clear'\">clear</mat-option>\n <mat-option [value]=\"'solid'\">solid</mat-option>\n </mat-select>\n </mat-form-field>\n </ion-col>\n </ion-row>\n\n</ion-content>\n"
17069
17137
  },] }
17070
17138
  ];
17071
17139
 
@@ -21473,7 +21541,7 @@ class AppTable {
21473
21541
  .subscribe(value => this.onDirty.emit(value)));
21474
21542
  // Propagate row dirty state to table
21475
21543
  this.registerSubscription(this.onStartEditingRow
21476
- .pipe(filter(row => row.validator && true), mergeMap(row => row.validator.valueChanges
21544
+ .pipe(filter(row => (row === null || row === void 0 ? void 0 : row.validator) && true), mergeMap(row => row.validator.valueChanges
21477
21545
  .pipe(takeUntil(
21478
21546
  // Stop if next another row, or destroying
21479
21547
  combineLatest([