@quadrel-enterprise-ui/framework 21.5.0 → 21.5.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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Directive, InjectionToken, inject, ElementRef, HostBinding, Input, ViewEncapsulation, Component, Injectable, Injector, HostListener, ChangeDetectionStrategy, ChangeDetectorRef, ViewChild, NgModule, EventEmitter, Output, Renderer2, Pipe, ViewContainerRef, NO_ERRORS_SCHEMA, DestroyRef, SecurityContext, NgZone, ViewChildren, afterNextRender, forwardRef, QueryList, ContentChildren, ContentChild, afterEveryRender, isDevMode, TemplateRef, CUSTOM_ELEMENTS_SCHEMA, provideAppInitializer } from '@angular/core';
|
|
3
3
|
import { Dialog, DialogRef, DIALOG_DATA, DialogModule } from '@angular/cdk/dialog';
|
|
4
|
-
import { BehaviorSubject, pairwise, fromEvent, combineLatest, concat, map as map$1, Subject, throwError, of, ReplaySubject, merge, isObservable, NEVER, Observable, EMPTY, shareReplay, Subscription, distinctUntilChanged as distinctUntilChanged$1, debounce, timer, switchMap, asyncScheduler, startWith as startWith$1,
|
|
4
|
+
import { BehaviorSubject, pairwise, fromEvent, combineLatest, concat, map as map$1, Subject, throwError, of, ReplaySubject, merge, isObservable, NEVER, Observable, EMPTY, shareReplay, Subscription, distinctUntilChanged as distinctUntilChanged$1, debounce, timer, switchMap, asyncScheduler, startWith as startWith$1, filter as filter$1, takeUntil as takeUntil$1, debounceTime as debounceTime$1, firstValueFrom, take as take$1, tap as tap$1, from, delay, defer, queueScheduler, concatMap as concatMap$1, exhaustMap, finalize, forkJoin, delayWhen, combineLatestWith, withLatestFrom as withLatestFrom$1, async } from 'rxjs';
|
|
5
5
|
import { map, startWith, take, debounceTime, takeUntil, filter, catchError, distinctUntilChanged, concatMap, skip, throttleTime, tap, auditTime, withLatestFrom, observeOn, switchMap as switchMap$1, pairwise as pairwise$1, mergeMap } from 'rxjs/operators';
|
|
6
6
|
import { v4 } from 'uuid';
|
|
7
7
|
import * as i2 from '@ngx-translate/core';
|
|
@@ -17896,6 +17896,7 @@ const MARGIN_PX = 10;
|
|
|
17896
17896
|
* #### **Behavior**
|
|
17897
17897
|
* - Appears in the bottom-right corner.
|
|
17898
17898
|
* - Adapts to the QLS (e.g., stays above a PageFooter).
|
|
17899
|
+
* - Re-enters the top layer whenever a notification arrives, so it stays above dialogs opened before.
|
|
17899
17900
|
* - Behavior is configurable via `snackbarOptions` (e.g., lifetime, close button, handlers).
|
|
17900
17901
|
*
|
|
17901
17902
|
* #### **Usage**
|
|
@@ -17945,6 +17946,32 @@ class QdNotificationsSnackbarListenerDirective {
|
|
|
17945
17946
|
snackbarRef.instance.notifications$ = this.snackbarService.notifications$;
|
|
17946
17947
|
this.snackbarService.overlayRef = this._overlayRef;
|
|
17947
17948
|
this.observeSafeBottomOffset(positionStrategy);
|
|
17949
|
+
this.observeNotificationsToStayOnTop(this._overlayRef.hostElement);
|
|
17950
|
+
}
|
|
17951
|
+
/**
|
|
17952
|
+
* Raises the snackbar back above every other overlay whenever a notification arrives.
|
|
17953
|
+
*
|
|
17954
|
+
* The CDK renders overlays into the browser top layer, where the paint order follows the order
|
|
17955
|
+
* in which the overlays entered that layer and `z-index` has no effect. The snackbar overlay is
|
|
17956
|
+
* created once with this listener, so overlays opened later - a dialog and its backdrop above
|
|
17957
|
+
* all - would cover it. Re-entering the top layer with every arriving notification puts the
|
|
17958
|
+
* snackbar back on top.
|
|
17959
|
+
*
|
|
17960
|
+
* The re-entry is bound to arriving notifications, so a snackbar that is already visible - a
|
|
17961
|
+
* sticky one with `lifeTime: 0` above all - stays covered by a dialog opened afterwards until
|
|
17962
|
+
* the next notification arrives. Closing a notification leaves the top layer untouched.
|
|
17963
|
+
*/
|
|
17964
|
+
observeNotificationsToStayOnTop(host) {
|
|
17965
|
+
this.snackbarService.notifications$
|
|
17966
|
+
.pipe(startWith$1([]), pairwise(), filter$1(([before, after]) => after.length > before.length), takeUntil$1(this._destroyed$))
|
|
17967
|
+
.subscribe(() => this.raiseToTopLayer(host));
|
|
17968
|
+
}
|
|
17969
|
+
raiseToTopLayer(host) {
|
|
17970
|
+
if (!host.hasAttribute('popover'))
|
|
17971
|
+
return;
|
|
17972
|
+
if (host.matches(':popover-open'))
|
|
17973
|
+
host.hidePopover();
|
|
17974
|
+
host.showPopover();
|
|
17948
17975
|
}
|
|
17949
17976
|
observeSafeBottomOffset(strategy) {
|
|
17950
17977
|
this.safeBottomOffset$
|