mn-angular-lib 2.0.9 → 2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mn-angular-lib",
3
- "version": "2.0.9",
3
+ "version": "2.0.10",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^22.1.7",
6
6
  "@angular/core": "^22.1.7",
@@ -677,6 +677,10 @@ type BaseModalConfig<TResult = unknown> = {
677
677
  closeMode?: CloseMode;
678
678
  closeGuard?: () => Promise<boolean> | boolean;
679
679
  backdrop?: BackdropMode;
680
+ /**
681
+ * Whether Escape closes the modal. Closes by default (unset or `ENABLED`); `DISABLED` opts out.
682
+ * Only the top modal of a stack reacts, and the close goes through `closeMode`/`closeGuard`.
683
+ */
680
684
  keyboard?: KeyboardMode;
681
685
  intent?: ModalIntent;
682
686
  resultType?: TResult;
@@ -86,7 +86,22 @@ declare class MnModalShellComponent<TResult = unknown> implements OnInit, AfterV
86
86
  */
87
87
  startClosing(): Promise<void>;
88
88
  private prefersReducedMotion;
89
+ /**
90
+ * Closes the modal on Escape, through the same close guard as every other way out, so a
91
+ * modal that may not close (`CloseMode.DISABLED`) stays open and a guarded one asks first.
92
+ * @param event The keydown.
93
+ */
89
94
  onEscapeKey(event: Event): void;
95
+ /**
96
+ * Whether this Escape is this modal's to act on. On unless the modal opted out with
97
+ * `KeyboardMode.DISABLED`; it used to be off unless every builder opted in, which no app did,
98
+ * so no modal anywhere closed on Escape. Every open shell hears the same document keydown, so
99
+ * only the top one acts (one press closes one modal), and an Escape something inside the modal
100
+ * already took, or an open dropdown in it is about to take, is left to that.
101
+ * @param event The keydown.
102
+ * @returns True when the modal should close.
103
+ */
104
+ private closesOnEscape;
90
105
  onBackdropClick(): void;
91
106
  onCloseButtonClick(): void;
92
107
  /**