@flywheel-io/vision 21.2.0-beta.0 → 21.2.1-beta.1

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.
@@ -3417,6 +3417,7 @@ class FwDialogService extends Dialog {
3417
3417
  topOffset,
3418
3418
  });
3419
3419
  const dialogRef = super.open(component, parsedConfig);
3420
+ this.registerCloseListeners(dialogRef, config);
3420
3421
  return dialogRef;
3421
3422
  }
3422
3423
  openModalDialog(component, config, topOffset) {
@@ -3426,27 +3427,9 @@ class FwDialogService extends Dialog {
3426
3427
  disableClose: true, // Disable default backdrop close to handle it manually
3427
3428
  ariaModal: true, // CDK defaults this to false; the dialog panel is genuinely modal
3428
3429
  };
3429
- const parsedConfig = { ...config, ...defaultSettings };
3430
+ const parsedConfig = this.parseFwDialogConfig({ ...config, ...defaultSettings });
3430
3431
  const dialogRef = super.open(component, parsedConfig);
3431
- // Handle backdrop clicks with animation
3432
- if (dialogRef.overlayRef.backdropElement) {
3433
- dialogRef.overlayRef.backdropElement.addEventListener('click', evt => {
3434
- const isBackdropCloseEnabled = !config?.canCloseCheck || config.canCloseCheck();
3435
- if (isBackdropCloseEnabled) {
3436
- evt.stopPropagation();
3437
- this.closeWithAnimation(dialogRef);
3438
- }
3439
- });
3440
- }
3441
- // Handle ESC key with animation
3442
- dialogRef.overlayRef.keydownEvents().subscribe(event => {
3443
- if (event.key === 'Escape') {
3444
- const isBackdropCloseEnabled = !config?.canCloseCheck || config.canCloseCheck();
3445
- if (isBackdropCloseEnabled) {
3446
- this.closeWithAnimation(dialogRef);
3447
- }
3448
- }
3449
- });
3432
+ this.registerCloseListeners(dialogRef, config);
3450
3433
  return dialogRef;
3451
3434
  }
3452
3435
  closeWithAnimation(dialogRef) {
@@ -3467,6 +3450,27 @@ class FwDialogService extends Dialog {
3467
3450
  }, 300);
3468
3451
  }
3469
3452
  }
3453
+ registerCloseListeners(dialogRef, config) {
3454
+ // Handle backdrop clicks with animation
3455
+ if (dialogRef.overlayRef.backdropElement) {
3456
+ dialogRef.overlayRef.backdropElement.addEventListener('click', evt => {
3457
+ const isBackdropCloseEnabled = !config?.canCloseCheck || config.canCloseCheck();
3458
+ if (isBackdropCloseEnabled) {
3459
+ evt.stopPropagation();
3460
+ this.closeWithAnimation(dialogRef);
3461
+ }
3462
+ });
3463
+ }
3464
+ // Handle ESC key with animation
3465
+ dialogRef.overlayRef.keydownEvents().subscribe(event => {
3466
+ if (event.key === 'Escape') {
3467
+ const isBackdropCloseEnabled = !config?.canCloseCheck || config.canCloseCheck();
3468
+ if (isBackdropCloseEnabled) {
3469
+ this.closeWithAnimation(dialogRef);
3470
+ }
3471
+ }
3472
+ });
3473
+ }
3470
3474
  parseFwDialogConfig(config) {
3471
3475
  const responsivePosition = this.overlay.position()
3472
3476
  .global()