@messaia/cdk 21.1.0-rc.3 → 21.1.0-rc.4

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.
@@ -1248,6 +1248,10 @@ class BaseComponent {
1248
1248
  * Service for displaying snack bar notifications.
1249
1249
  */
1250
1250
  snackBarService;
1251
+ /**
1252
+ * Reference to the currently displayed snack bar, if any.
1253
+ */
1254
+ snackBarRef;
1251
1255
  /**
1252
1256
  * Service for displaying confirmation and prompt dialogs.
1253
1257
  */
@@ -1716,12 +1720,18 @@ class BaseComponent {
1716
1720
  break;
1717
1721
  }
1718
1722
  /* Display the message in the snack bar, with specified duration and CSS class */
1719
- const snackBarRef = this.snackBarService.open(message, actionLabel, {
1723
+ this.snackBarRef = this.snackBarService.open(message, actionLabel, {
1720
1724
  duration: duration,
1721
1725
  panelClass: [snackBarClass]
1722
1726
  });
1723
1727
  /* Emits when the action button is clicked */
1724
- return snackBarRef.onAction().pipe(map(() => { }));
1728
+ return this.snackBarRef.onAction().pipe(map(() => { }));
1729
+ }
1730
+ /**
1731
+ * Closes the currently displayed snack bar message, if any.
1732
+ */
1733
+ closeMessage() {
1734
+ this.snackBarRef?.dismiss();
1725
1735
  }
1726
1736
  /**
1727
1737
  * Initializes the TinyMCE editor with custom configuration.