@almoamendev/ngx-md3 0.2.1 → 0.2.2

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": "@almoamendev/ngx-md3",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "MD3-style Angular components & style library",
5
5
  "author": "Murtadha (Hussain) Almoamen",
6
6
  "license": "MIT",
@@ -998,6 +998,7 @@ declare class DialogRef<T = unknown, R = unknown> {
998
998
  readonly isFullScreen: boolean;
999
999
  private readonly closed;
1000
1000
  private readonly closing;
1001
+ private readonly hiddenChanges;
1001
1002
  private closePromise;
1002
1003
  private closeStarted;
1003
1004
  private closeSettled;
@@ -1013,7 +1014,7 @@ declare class DialogRef<T = unknown, R = unknown> {
1013
1014
  get overlayRef(): OverlayRef;
1014
1015
  /** Whether the dialog started closing. Such a dialog cannot be hidden or shown anymore. */
1015
1016
  get isClosing(): boolean;
1016
- /** Whether the dialog is currently hidden behind another dialog. */
1017
+ /** Whether the dialog is currently hidden, on request or behind another dialog. */
1017
1018
  get isHidden(): boolean;
1018
1019
  constructor(cdkRef: DialogRef$1<R, T>, disableCloseEvents: boolean,
1019
1020
  /** Whether this reference belongs to a full screen dialog. */
@@ -1023,6 +1024,7 @@ declare class DialogRef<T = unknown, R = unknown> {
1023
1024
  /**
1024
1025
  * Hides the dialog with the closing animation while keeping it alive, so
1025
1026
  * its content, form state and subscriptions survive until show() is called.
1027
+ * The page underneath becomes usable again while the dialog waits behind it.
1026
1028
  * The promise resolves once the dialog is out of sight.
1027
1029
  */
1028
1030
  hide(): Promise<void>;
@@ -1034,6 +1036,8 @@ declare class DialogRef<T = unknown, R = unknown> {
1034
1036
  show(): void;
1035
1037
  /** Emits when the dialog starts closing, before the exit animation runs. */
1036
1038
  beforeClosed(): Observable<void>;
1039
+ /** Emits the new value of `isHidden` every time the dialog is hidden or shown. */
1040
+ hiddenChanged(): Observable<boolean>;
1037
1041
  afterClosed(): Observable<R | undefined>;
1038
1042
  private connectCloseEvents;
1039
1043
  private toggleHiddenState;
@@ -1048,10 +1052,16 @@ declare class DialogRef<T = unknown, R = unknown> {
1048
1052
  declare class DialogService {
1049
1053
  private readonly cdkDialog;
1050
1054
  private readonly overlay;
1055
+ private readonly overlayContainer;
1051
1056
  private readonly injector;
1052
1057
  private readonly document;
1053
1058
  /** Open dialogs, from the first one opened to the one currently on top. */
1054
1059
  private readonly refs;
1060
+ /**
1061
+ * Elements the page was made of that the CDK hid from assistive technology,
1062
+ * kept here while the dialogs are hidden and the page is given back.
1063
+ */
1064
+ private readonly pageAriaHidden;
1055
1065
  /**
1056
1066
  * Page scrolling is blocked here instead of per overlay, so stacked dialogs
1057
1067
  * cannot unblock the page while another dialog is still open.
@@ -1059,7 +1069,10 @@ declare class DialogService {
1059
1069
  private readonly scrollBlock;
1060
1070
  /** Element that was focused before the first dialog of the stack opened. */
1061
1071
  private rootTrigger;
1072
+ private pageStateQueued;
1062
1073
  get openDialogs(): readonly DialogRef<any, any>[];
1074
+ /** Open dialogs that are currently on screen, from the bottom one up. */
1075
+ get visibleDialogs(): readonly DialogRef<any, any>[];
1063
1076
  /** The full screen dialog that is open, if there is one. */
1064
1077
  get fullScreenDialog(): DialogRef<any, any> | undefined;
1065
1078
  open<T, D = unknown, R = unknown>(component: Type<T>, config?: DialogConfig<D>): DialogRef<T, R>;
@@ -1071,6 +1084,20 @@ declare class DialogService {
1071
1084
  openFullScreen<T, D = unknown, R = unknown>(component: Type<T>, config?: FullScreenDialogConfig<D>): DialogRef<T, R>;
1072
1085
  /** Wires a freshly created dialog into the stack and starts its animation. */
1073
1086
  private registerDialog;
1087
+ /**
1088
+ * Hides every dialog that is on screen, the full screen one included, with
1089
+ * the closing animation. They stay alive with their content and state, the
1090
+ * page underneath becomes usable, and showAll() puts them back. The promise
1091
+ * resolves once they are all out of sight.
1092
+ */
1093
+ hideAll(): Promise<void>;
1094
+ /**
1095
+ * Brings the dialogs back on screen, whether they were hidden one by one or
1096
+ * all at once: the dialog that was on top returns, along with the full
1097
+ * screen dialog it sits in. Dialogs hidden behind another dialog stay
1098
+ * hidden, since that is where they belong once the stack is back.
1099
+ */
1100
+ showAll(): void;
1074
1101
  /** Closes every open dialog, including the hidden and the full screen ones. */
1075
1102
  closeAll(): Promise<void>;
1076
1103
  /** Closes the regular dialogs and leaves a full screen dialog alone. */
@@ -1105,7 +1132,29 @@ declare class DialogService {
1105
1132
  private topRegularRef;
1106
1133
  private restorePreviousDialog;
1107
1134
  private removeRef;
1108
- private updateScrollBlock;
1135
+ /**
1136
+ * State that belongs to the dialogs as a whole rather than to one of them:
1137
+ * page scrolling, the page being hidden from assistive technology, and
1138
+ * where focus sits. Applied in a task of its own, so a dialog handing the
1139
+ * screen over to another one does not give the page back and take it again
1140
+ * within the same frame.
1141
+ */
1142
+ private syncPageState;
1143
+ private applyPageState;
1144
+ /**
1145
+ * Gives the page back to assistive technology while every dialog is hidden.
1146
+ * The CDK hides it for as long as a dialog is open, which would otherwise
1147
+ * leave nothing to read at all once the dialogs are out of sight.
1148
+ */
1149
+ private exposePageToAssistiveTechnology;
1150
+ /** Hides the page again as soon as a dialog is back on screen. */
1151
+ private hidePageFromAssistiveTechnology;
1152
+ /**
1153
+ * Focus follows the dialogs off the screen: it goes back to whatever opened
1154
+ * the stack, so the page stays usable with the keyboard while the dialogs
1155
+ * wait behind it. Focus that already moved somewhere else is left alone.
1156
+ */
1157
+ private releaseFocus;
1109
1158
  private getFocusedElement;
1110
1159
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DialogService, never>;
1111
1160
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<DialogService>;