@xiriframework/xiri-ng 0.2.29 → 0.2.31

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.
@@ -2660,19 +2660,13 @@ class XiriDialogComponent {
2660
2660
  this.checkSubject = new Subject();
2661
2661
  this.to = null;
2662
2662
  this.refreshTime = 2000;
2663
+ this.dialogRef.addPanelClass('xiri-dialog-sized');
2664
+ this.effectiveSize = this.initData.size;
2663
2665
  this.breakpointObserver
2664
2666
  .observe([Breakpoints.XSmall, Breakpoints.Small])
2665
2667
  .pipe(takeUntilDestroyed(this.destroyRef))
2666
2668
  .subscribe((state) => {
2667
- if (state.matches) {
2668
- this.dialogRef.updateSize('90vw');
2669
- return;
2670
- }
2671
- const raw = this.initData.size;
2672
- const width = DIALOG_SIZE_MAP[raw] ?? raw ?? '600px';
2673
- this.dialogRef.updateSize(width);
2674
- if (raw === 'full')
2675
- this.dialogRef.addPanelClass('xiri-dialog-full');
2669
+ this.applyDialogSize(state.matches);
2676
2670
  });
2677
2671
  if (this.initData.url)
2678
2672
  this.url = this.initData.url;
@@ -2716,8 +2710,23 @@ class XiriDialogComponent {
2716
2710
  }]);
2717
2711
  }
2718
2712
  }
2713
+ applyDialogSize(isMobile) {
2714
+ if (isMobile) {
2715
+ this.dialogRef.updateSize('90vw');
2716
+ return;
2717
+ }
2718
+ const raw = this.effectiveSize;
2719
+ const width = DIALOG_SIZE_MAP[raw] ?? raw ?? '600px';
2720
+ this.dialogRef.updateSize(width);
2721
+ if (raw === 'full')
2722
+ this.dialogRef.addPanelClass('xiri-dialog-full');
2723
+ }
2719
2724
  loadData(res) {
2720
2725
  if (res.buttons) {
2726
+ if (res.size && res.size !== this.effectiveSize) {
2727
+ this.effectiveSize = res.size;
2728
+ this.applyDialogSize(this.breakpointObserver.isMatched([Breakpoints.XSmall, Breakpoints.Small]));
2729
+ }
2721
2730
  if (res.url)
2722
2731
  this.url = res.url;
2723
2732
  let formData = [];