@rlucan/ui 20.0.9 → 20.0.10

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.
@@ -1701,6 +1701,9 @@ class MessageBoxModalComponent {
1701
1701
  this.buttons = data.options.buttons ? data.options.buttons : [{ id: 'close', text: 'Close' }];
1702
1702
  this.title = data.options.title;
1703
1703
  }
1704
+ labelText(b) {
1705
+ return typeof b.text === 'function' ? b.text() : b.text;
1706
+ }
1704
1707
  close(result) {
1705
1708
  this.dialogRef.close(result);
1706
1709
  }
@@ -1733,7 +1736,7 @@ class MessageBoxModalComponent {
1733
1736
  <div mat-dialog-actions>
1734
1737
  <div class="buttons">
1735
1738
  <ui-button *ngFor="let b of buttons" [color]="b.color || 'primary'" [tabIndex]="-1"
1736
- [kind]="b.kind || 'stroked'" [busy]="processing === b" [disabled]="!!processing || (b.disabled && b.disabled())" (click)="buttonClick(b)" [label]="b.text"></ui-button>
1739
+ [kind]="b.kind || 'stroked'" [busy]="processing === b" [disabled]="!!processing || (b.disabled && b.disabled())" (click)="buttonClick(b)" [label]="this.labelText(b)"></ui-button>
1737
1740
  </div>
1738
1741
  </div>
1739
1742
  </ui-dialog>
@@ -1758,7 +1761,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
1758
1761
  <div mat-dialog-actions>
1759
1762
  <div class="buttons">
1760
1763
  <ui-button *ngFor="let b of buttons" [color]="b.color || 'primary'" [tabIndex]="-1"
1761
- [kind]="b.kind || 'stroked'" [busy]="processing === b" [disabled]="!!processing || (b.disabled && b.disabled())" (click)="buttonClick(b)" [label]="b.text"></ui-button>
1764
+ [kind]="b.kind || 'stroked'" [busy]="processing === b" [disabled]="!!processing || (b.disabled && b.disabled())" (click)="buttonClick(b)" [label]="this.labelText(b)"></ui-button>
1762
1765
  </div>
1763
1766
  </div>
1764
1767
  </ui-dialog>
@@ -1777,18 +1780,16 @@ class MessageBoxService {
1777
1780
  confirm(message, options = {}) {
1778
1781
  const config = new MatDialogConfig();
1779
1782
  config.disableClose = false;
1780
- config.minWidth = '340px';
1781
- config.maxWidth = options.maxWidth || '600px';
1782
- config.width = '40vw';
1783
+ config.maxWidth = options.maxWidth || '440px';
1784
+ config.width = 'calc(100vw - 30px)';
1783
1785
  config.data = { message, options };
1784
1786
  return this.dialog.open(MessageBoxModalComponent, config).afterClosed();
1785
1787
  }
1786
1788
  open(options = {}) {
1787
1789
  const config = new MatDialogConfig();
1788
1790
  config.disableClose = true;
1789
- config.minWidth = '340px';
1790
- config.maxWidth = options.maxWidth || '600px';
1791
- config.width = '40vw';
1791
+ config.maxWidth = options.maxWidth || '440px';
1792
+ config.width = 'calc(100vw - 30px)';
1792
1793
  config.data = { message: options.message, options };
1793
1794
  return this.dialog.open(MessageBoxModalComponent, config).afterClosed();
1794
1795
  }