@bravobit/bb-foundation 0.45.0 → 0.45.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/collections/lib/collection.d.ts +0 -2
- package/collections/lib/interfaces/collection.interface.d.ts +4 -0
- package/collections/lib/providers/api-collection.provider.d.ts +3 -2
- package/collections/lib/providers/collection.provider.d.ts +5 -2
- package/dialog/lib/dialog-container/dialog-container.component.d.ts +8 -9
- package/dialog/lib/dialog-overlay/dialog-overlay.component.d.ts +6 -10
- package/dialog/lib/dialog.interfaces.d.ts +1 -2
- package/dialog/lib/dialog.ref.d.ts +2 -2
- package/esm2022/auth/lib/auth.interceptor.mjs +3 -3
- package/esm2022/auth/lib/auth.module.mjs +4 -4
- package/esm2022/auth/lib/auth.service.mjs +3 -3
- package/esm2022/auth/lib/directives/authenticated.directive.mjs +3 -3
- package/esm2022/collections/lib/collection.mjs +3 -13
- package/esm2022/collections/lib/collections.module.mjs +4 -4
- package/esm2022/collections/lib/components/collections-actions/collections-actions.component.mjs +3 -3
- package/esm2022/collections/lib/components/collections-grid/collections-grid.component.mjs +3 -3
- package/esm2022/collections/lib/components/collections-pager/collections-pager.component.mjs +3 -3
- package/esm2022/collections/lib/components/collections-table/collections-table.component.mjs +5 -5
- package/esm2022/collections/lib/components/collections-table-label/collections-table-label.component.mjs +3 -3
- package/esm2022/collections/lib/components/collections-table-sorting/collections-table-sorting.component.mjs +3 -3
- package/esm2022/collections/lib/components/collections-viewer/collections-viewer.component.mjs +3 -3
- package/esm2022/collections/lib/directives/collections-data-row.directive.mjs +3 -3
- package/esm2022/collections/lib/directives/collections-data.directive.mjs +3 -3
- package/esm2022/collections/lib/directives/collections-empty.directive.mjs +3 -3
- package/esm2022/collections/lib/directives/collections-error.directive.mjs +3 -3
- package/esm2022/collections/lib/directives/collections-initial.directive.mjs +3 -3
- package/esm2022/collections/lib/directives/collections-item.directive.mjs +3 -3
- package/esm2022/collections/lib/interfaces/collection.interface.mjs +1 -1
- package/esm2022/collections/lib/providers/api-collection.provider.mjs +16 -7
- package/esm2022/collections/lib/providers/collection.provider.mjs +27 -1
- package/esm2022/combobox/combobox/combobox-container.directive.mjs +3 -3
- package/esm2022/combobox/combobox/combobox.component.mjs +3 -3
- package/esm2022/combobox/combobox-label.directive.mjs +3 -3
- package/esm2022/combobox/combobox-option.directive.mjs +3 -3
- package/esm2022/combobox/combobox-panel/combobox-panel.component.mjs +3 -3
- package/esm2022/dashboard/lib/dashboard/dashboard.component.mjs +3 -3
- package/esm2022/dashboard/lib/dashboard-header/dashboard-header.component.mjs +3 -3
- package/esm2022/dashboard/lib/dashboard-menu/dashboard-menu.component.mjs +3 -3
- package/esm2022/dashboard/lib/dashboard-menu-item/dashboard-menu-item.component.mjs +3 -3
- package/esm2022/dashboard/lib/dashboard-sidebar/dashboard-sidebar.component.mjs +3 -3
- package/esm2022/dashboard/lib/dashboard-sidebar-group/dashboard-sidebar-group.component.mjs +3 -3
- package/esm2022/dashboard/lib/dashboard-sidebar-item/dashboard-sidebar-item.component.mjs +3 -3
- package/esm2022/dashboard/lib/dashboard.module.mjs +4 -4
- package/esm2022/dialog/lib/dialog-actions/dialog-actions.component.mjs +3 -3
- package/esm2022/dialog/lib/dialog-confirm/dialog-confirm.component.mjs +3 -3
- package/esm2022/dialog/lib/dialog-container/dialog-container.component.mjs +28 -56
- package/esm2022/dialog/lib/dialog-header/dialog-header.component.mjs +3 -3
- package/esm2022/dialog/lib/dialog-link/dialog-link.component.mjs +3 -3
- package/esm2022/dialog/lib/dialog-modal/dialog-modal.component.mjs +4 -4
- package/esm2022/dialog/lib/dialog-overlay/dialog-overlay.component.mjs +25 -59
- package/esm2022/dialog/lib/dialog.insertion.mjs +3 -3
- package/esm2022/dialog/lib/dialog.interfaces.mjs +2 -3
- package/esm2022/dialog/lib/dialog.module.mjs +4 -4
- package/esm2022/dialog/lib/dialog.ref.mjs +3 -7
- package/esm2022/dialog/lib/dialog.service.mjs +8 -5
- package/esm2022/dialog/lib/directives/confirm.directive.mjs +3 -3
- package/esm2022/elements/lib/avatar/avatar.component.mjs +3 -3
- package/esm2022/elements/lib/button/button.component.mjs +6 -6
- package/esm2022/elements/lib/checkbox/checkbox.component.mjs +3 -3
- package/esm2022/elements/lib/checkbox-group/checkbox-group.component.mjs +3 -3
- package/esm2022/elements/lib/date-picker/date-picker.component.mjs +3 -3
- package/esm2022/elements/lib/directives/addon.directive.mjs +6 -6
- package/esm2022/elements/lib/directives/extra-error-controls.directive.mjs +3 -3
- package/esm2022/elements/lib/directives/file-drop.directive.mjs +3 -3
- package/esm2022/elements/lib/directives/form-submit.directive.mjs +3 -3
- package/esm2022/elements/lib/directives/form-submitter.directive.mjs +3 -3
- package/esm2022/elements/lib/directives/image-upload.directive.mjs +3 -3
- package/esm2022/elements/lib/directives/input.directive.mjs +3 -3
- package/esm2022/elements/lib/elements.module.mjs +4 -4
- package/esm2022/elements/lib/file-picker/file-picker.component.mjs +3 -3
- package/esm2022/elements/lib/form-control/form-control.component.mjs +3 -3
- package/esm2022/elements/lib/form-error/form-error.component.mjs +3 -3
- package/esm2022/elements/lib/form-group/form-group.component.mjs +3 -3
- package/esm2022/elements/lib/icon/icon.component.mjs +3 -3
- package/esm2022/elements/lib/image-picker/image-picker.component.mjs +3 -3
- package/esm2022/elements/lib/multi-file-control/multi-file-control.component.mjs +3 -3
- package/esm2022/elements/lib/pipes/date.pipe.mjs +3 -3
- package/esm2022/elements/lib/pipes/file-image.pipe.mjs +3 -3
- package/esm2022/elements/lib/pipes/file-size.pipe.mjs +3 -3
- package/esm2022/elements/lib/pipes/relative-time.pipe.mjs +3 -3
- package/esm2022/elements/lib/radio-button/radio-button.component.mjs +3 -3
- package/esm2022/elements/lib/radio-group/radio-group.component.mjs +3 -3
- package/esm2022/elements/lib/spinner/spinner.component.mjs +6 -6
- package/esm2022/http/lib/http.module.mjs +4 -4
- package/esm2022/http/lib/interceptors/base-url.interceptor.mjs +3 -3
- package/esm2022/http/lib/interceptors/error.interceptor.mjs +3 -3
- package/esm2022/lib/core/functions/route-cache.utils.mjs +1 -1
- package/esm2022/lib/core/services/exif.service.mjs +3 -3
- package/esm2022/lib/core/services/file-loader.service.mjs +3 -3
- package/esm2022/lib/core/services/files.service.mjs +3 -3
- package/esm2022/lib/core/services/image-converter.service.mjs +3 -3
- package/esm2022/lib/core/services/languages.service.mjs +3 -3
- package/esm2022/lib/core/services/network.service.mjs +3 -3
- package/esm2022/lib/core/services/patch.service.mjs +3 -3
- package/esm2022/localize/lib/localize.module.mjs +4 -4
- package/esm2022/localize/lib/localize.pipe.mjs +3 -3
- package/esm2022/localize/lib/localize.service.mjs +3 -3
- package/esm2022/localize/lib/views/localize-string/localize-string.component.mjs +3 -3
- package/esm2022/localize/lib/views/localize-template.directive.mjs +3 -3
- package/esm2022/masking/lib/directives/currency-mask.directive.mjs +3 -3
- package/esm2022/masking/lib/directives/date-mask.directive.mjs +3 -3
- package/esm2022/masking/lib/directives/input-mask.directive.mjs +3 -3
- package/esm2022/masking/lib/masking.module.mjs +4 -4
- package/esm2022/masking/lib/masking.service.mjs +3 -3
- package/esm2022/notifications/lib/notifications-item/notifications-item.component.mjs +3 -3
- package/esm2022/notifications/lib/notifications-list/notifications-list.component.mjs +3 -3
- package/esm2022/notifications/lib/notifications.module.mjs +4 -4
- package/esm2022/notifications/lib/notifications.service.mjs +3 -3
- package/esm2022/permissions/lib/directives/permission.directive.mjs +3 -3
- package/esm2022/permissions/lib/permissions.module.mjs +4 -4
- package/esm2022/permissions/lib/permissions.service.mjs +3 -3
- package/esm2022/recaptcha/lib/recaptcha/recaptcha.component.mjs +3 -3
- package/esm2022/recaptcha/lib/recaptcha-loader.service.mjs +3 -3
- package/esm2022/recaptcha/lib/recaptcha.module.mjs +4 -4
- package/esm2022/select/lib/select/select.component.mjs +3 -3
- package/esm2022/select/lib/select-label.directive.mjs +3 -3
- package/esm2022/select/lib/select-multi-label.directive.mjs +3 -3
- package/esm2022/select/lib/select-option-group.directive.mjs +3 -3
- package/esm2022/select/lib/select-option.directive.mjs +3 -3
- package/esm2022/select/lib/select.module.mjs +4 -4
- package/esm2022/storage/lib/storage.service.mjs +3 -3
- package/esm2022/table/lib/components/table/table.component.mjs +9 -9
- package/esm2022/table/lib/components/table-cell/table-cell.component.mjs +3 -3
- package/esm2022/table/lib/components/table-header-cell/table-header-cell.component.mjs +3 -3
- package/esm2022/table/lib/components/table-pager/table-pager.component.mjs +3 -3
- package/esm2022/table/lib/table.module.mjs +4 -4
- package/esm2022/tooltip/lib/tooltip-container/tooltip-container.component.mjs +3 -3
- package/esm2022/tooltip/lib/tooltip.directive.mjs +3 -3
- package/esm2022/tooltip/lib/tooltip.module.mjs +4 -4
- package/esm2022/utils/lib/directives/autosize.directive.mjs +3 -3
- package/esm2022/utils/lib/directives/focus-trap.directive.mjs +3 -3
- package/esm2022/utils/lib/directives/focus.directive.mjs +3 -3
- package/esm2022/utils/lib/directives/template.directive.mjs +3 -3
- package/esm2022/utils/lib/utils.module.mjs +4 -4
- package/fesm2022/bravobit-bb-foundation-auth.mjs +13 -13
- package/fesm2022/bravobit-bb-foundation-collections.mjs +87 -62
- package/fesm2022/bravobit-bb-foundation-collections.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-combobox.mjs +15 -15
- package/fesm2022/bravobit-bb-foundation-dashboard.mjs +25 -25
- package/fesm2022/bravobit-bb-foundation-dialog.mjs +82 -200
- package/fesm2022/bravobit-bb-foundation-dialog.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-elements.mjs +90 -90
- package/fesm2022/bravobit-bb-foundation-elements.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-http.mjs +10 -10
- package/fesm2022/bravobit-bb-foundation-localize.mjs +16 -16
- package/fesm2022/bravobit-bb-foundation-masking.mjs +16 -16
- package/fesm2022/bravobit-bb-foundation-notifications.mjs +13 -13
- package/fesm2022/bravobit-bb-foundation-permissions.mjs +10 -10
- package/fesm2022/bravobit-bb-foundation-recaptcha.mjs +10 -10
- package/fesm2022/bravobit-bb-foundation-select.mjs +19 -19
- package/fesm2022/bravobit-bb-foundation-storage.mjs +3 -3
- package/fesm2022/bravobit-bb-foundation-table.mjs +22 -22
- package/fesm2022/bravobit-bb-foundation-tooltip.mjs +10 -10
- package/fesm2022/bravobit-bb-foundation-utils.mjs +16 -16
- package/fesm2022/bravobit-bb-foundation.mjs +21 -21
- package/fesm2022/bravobit-bb-foundation.mjs.map +1 -1
- package/lib/core/functions/route-cache.utils.d.ts +1 -1
- package/localize/lib/transforms/interpolate.transform.d.ts +1 -1
- package/localize/lib/transforms/plural.transform.d.ts +1 -1
- package/localize/lib/transforms/reference.transform.d.ts +1 -1
- package/package.json +13 -13
- package/styles/theme.scss +5 -0
- package/dialog/lib/dialog-container/dialog-container.animations.d.ts +0 -1
- package/dialog/lib/dialog-overlay/dialog-overlay.animations.d.ts +0 -1
- package/esm2022/dialog/lib/dialog-container/dialog-container.animations.mjs +0 -29
- package/esm2022/dialog/lib/dialog-overlay/dialog-overlay.animations.mjs +0 -26
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { take, switchMap } from 'rxjs/operators';
|
|
2
|
-
import { Subject, Subscription,
|
|
1
|
+
import { take, filter, switchMap } from 'rxjs/operators';
|
|
2
|
+
import { Subject, Subscription, timer, firstValueFrom, fromEvent, takeUntil } from 'rxjs';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { InjectionToken, inject,
|
|
5
|
-
import { trigger, transition, group, query, style, animate } from '@angular/animations';
|
|
4
|
+
import { InjectionToken, inject, Renderer2, ElementRef, EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, Output, HostListener, booleanAttribute, Optional, Inject, HostBinding, Input, Directive, ViewChild, createEnvironmentInjector, createComponent, Injectable, makeEnvironmentProviders, NgModule } from '@angular/core';
|
|
6
5
|
import { DOCUMENT, NgClass } from '@angular/common';
|
|
7
6
|
import * as i1 from '@bravobit/bb-foundation';
|
|
8
7
|
import { BbFormGroup, BbButton } from '@bravobit/bb-foundation/elements';
|
|
@@ -13,12 +12,8 @@ class BbDialogRef {
|
|
|
13
12
|
// Data.
|
|
14
13
|
_afterClosed$ = new Subject();
|
|
15
14
|
_overlayClicked$ = new Subject();
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
get overlayClicked() {
|
|
20
|
-
return this._overlayClicked$.pipe(take(1));
|
|
21
|
-
}
|
|
15
|
+
afterClosed = this._afterClosed$.pipe(take(1));
|
|
16
|
+
overlayClicked = this._overlayClicked$.pipe(take(1));
|
|
22
17
|
onOverlayClicked() {
|
|
23
18
|
this._overlayClicked$.next();
|
|
24
19
|
}
|
|
@@ -31,115 +26,55 @@ class BbDialogConfig {
|
|
|
31
26
|
data;
|
|
32
27
|
}
|
|
33
28
|
class DialogConfig {
|
|
34
|
-
|
|
35
|
-
disableOverlayAnimations;
|
|
29
|
+
animationMs;
|
|
36
30
|
}
|
|
37
31
|
const DIALOG_CONFIG = new InjectionToken('dialog config');
|
|
38
32
|
|
|
39
|
-
const bbDialogOverlayAnimation = trigger('bbDialogOverlayAnimation', [
|
|
40
|
-
transition(':enter, * => open', [
|
|
41
|
-
group([
|
|
42
|
-
query('.bb-dialog-overlay-backdrop', [
|
|
43
|
-
style({ opacity: 0 }),
|
|
44
|
-
animate('240ms cubic-bezier(0, 0, 0.2, 1)', style({ opacity: 1 }))
|
|
45
|
-
]),
|
|
46
|
-
query('.bb-dialog-modal', [
|
|
47
|
-
style({ opacity: 0, transform: 'scale(0.98)' }),
|
|
48
|
-
animate('200ms cubic-bezier(0, 0, 0.2, 1)', style({ opacity: 1, transform: 'none' }))
|
|
49
|
-
])
|
|
50
|
-
])
|
|
51
|
-
]),
|
|
52
|
-
transition(':leave, * => close', [
|
|
53
|
-
group([
|
|
54
|
-
query('.bb-dialog-modal', [
|
|
55
|
-
animate('200ms cubic-bezier(0, 0, 0.2, 1)', style({ opacity: 0, transform: 'scale(0.98)' }))
|
|
56
|
-
]),
|
|
57
|
-
query('.bb-dialog-overlay-backdrop', [
|
|
58
|
-
animate('240ms cubic-bezier(0, 0, 0.2, 1)', style({ opacity: 0 }))
|
|
59
|
-
])
|
|
60
|
-
])
|
|
61
|
-
])
|
|
62
|
-
]);
|
|
63
|
-
|
|
64
33
|
class BbDialogOverlay {
|
|
65
34
|
// Dependencies.
|
|
66
35
|
_config = inject(DIALOG_CONFIG, { optional: true });
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
// Views.
|
|
71
|
-
overlayElementRef;
|
|
36
|
+
_renderer = inject(Renderer2);
|
|
37
|
+
_elementRef = inject(ElementRef);
|
|
38
|
+
_document = inject(DOCUMENT);
|
|
72
39
|
// Outputs.
|
|
73
40
|
closeRequested = new EventEmitter();
|
|
74
|
-
// State.
|
|
75
|
-
state = 'open';
|
|
76
|
-
_closed$ = new Subject();
|
|
77
41
|
// Subscriptions.
|
|
78
42
|
_subscription = new Subscription();
|
|
79
43
|
ngOnInit() {
|
|
80
|
-
this.
|
|
44
|
+
this.handleOverlayClicks();
|
|
81
45
|
}
|
|
82
46
|
ngOnDestroy() {
|
|
83
47
|
this._subscription?.unsubscribe();
|
|
84
48
|
}
|
|
85
49
|
onKeyEvent(event) {
|
|
86
|
-
if (event?.key
|
|
87
|
-
this.closeRequested.emit();
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
onAnimationDone(event) {
|
|
91
|
-
// Check if the dialog is being destroyed.
|
|
92
|
-
if (!['close'].includes(event?.toState)) {
|
|
50
|
+
if (event?.key !== 'Escape') {
|
|
93
51
|
return;
|
|
94
52
|
}
|
|
95
|
-
this.
|
|
96
|
-
this._closed$.complete();
|
|
53
|
+
this.closeRequested.emit();
|
|
97
54
|
}
|
|
98
|
-
close() {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
this._changeDetectorRef.markForCheck();
|
|
103
|
-
// Listen for the closed trigger.
|
|
104
|
-
const observable$ = this._closed$.pipe(take(1));
|
|
105
|
-
return lastValueFrom(observable$);
|
|
55
|
+
async close() {
|
|
56
|
+
this._renderer.addClass(this._elementRef.nativeElement, 'leaving');
|
|
57
|
+
const timer$ = timer(this._config?.animationMs ?? 240);
|
|
58
|
+
return firstValueFrom(timer$);
|
|
106
59
|
}
|
|
107
|
-
|
|
108
|
-
const element = this.
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
const mouseDown$ = fromEvent(element, 'mousedown');
|
|
113
|
-
const touchStart$ = fromEvent(element, 'touchstart');
|
|
114
|
-
const start$ = race([mouseDown$, touchStart$]);
|
|
115
|
-
const mouseUp$ = fromEvent(element, 'mouseup');
|
|
116
|
-
const touchEnd$ = fromEvent(element, 'touchend');
|
|
117
|
-
const end$ = race([mouseUp$, touchEnd$]);
|
|
118
|
-
const clicks$ = start$.pipe(switchMap(() => end$));
|
|
119
|
-
const subscription = clicks$.subscribe(() => this.closeRequested.next());
|
|
60
|
+
handleOverlayClicks() {
|
|
61
|
+
const element = this._elementRef.nativeElement ?? null;
|
|
62
|
+
const subscription = fromEvent(element, 'pointerdown').pipe(filter(event => event?.target === element), switchMap(() => fromEvent(this._document, 'pointerup').pipe(filter((event) => event?.target === element), takeUntil(fromEvent(this._document, 'pointermove'))))).subscribe(() => {
|
|
63
|
+
this.closeRequested.emit();
|
|
64
|
+
});
|
|
120
65
|
this._subscription.add(subscription);
|
|
121
66
|
}
|
|
122
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
123
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.
|
|
67
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogOverlay, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
68
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.12", type: BbDialogOverlay, isStandalone: true, selector: "bb-dialog-overlay", outputs: { closeRequested: "closeRequested" }, host: { listeners: { "window:keyup": "onKeyEvent($event)" }, classAttribute: "bb-dialog-overlay" }, ngImport: i0, template: "<ng-content select=\"[bb-dialog-modal]\"></ng-content>\n", styles: [".bb-dialog-overlay{inset:0;display:flex;z-index:1000;position:fixed;padding:1.5rem;flex-direction:column;will-change:background-color;background-color:#1119;animation:dialogOverlayEntering .24s cubic-bezier(0,0,.2,1) forwards}.bb-dialog-overlay.leaving{animation:dialogOverlayLeaving .24s cubic-bezier(0,0,.2,1) forwards}.bb-dialog-overlay.leaving .bb-dialog-modal{animation:dialogModalLeaving .24s cubic-bezier(0,0,.2,1) forwards}@keyframes dialogOverlayEntering{0%{background-color:transparent}to{background-color:#1119}}@keyframes dialogOverlayLeaving{to{background-color:transparent}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
124
69
|
}
|
|
125
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
70
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogOverlay, decorators: [{
|
|
126
71
|
type: Component,
|
|
127
|
-
args: [{ selector: 'bb-dialog-overlay', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
128
|
-
|
|
129
|
-
'[@bbDialogOverlayAnimation]': 'state',
|
|
130
|
-
'[@.disabled]': 'disableOverlayAnimations'
|
|
131
|
-
}, preserveWhitespaces: false, animations: [bbDialogOverlayAnimation], standalone: true, template: "<div #overlay\n class=\"bb-dialog-overlay-backdrop\"></div>\n\n<ng-content select=\"[bb-dialog-modal]\"></ng-content>\n", styles: [".bb-dialog-overlay,.bb-dialog-overlay-backdrop{inset:0;display:flex;z-index:1000;position:fixed;flex-direction:column}.bb-dialog-overlay{padding:1.5rem}.bb-dialog-overlay-backdrop{will-change:opacity;background-color:#1119}.bb-dialog-overlay-component{z-index:1001;display:block;position:relative}\n"] }]
|
|
132
|
-
}], propDecorators: { overlayElementRef: [{
|
|
133
|
-
type: ViewChild,
|
|
134
|
-
args: ['overlay', { static: true }]
|
|
135
|
-
}], closeRequested: [{
|
|
72
|
+
args: [{ selector: 'bb-dialog-overlay', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: { 'class': 'bb-dialog-overlay' }, preserveWhitespaces: false, standalone: true, template: "<ng-content select=\"[bb-dialog-modal]\"></ng-content>\n", styles: [".bb-dialog-overlay{inset:0;display:flex;z-index:1000;position:fixed;padding:1.5rem;flex-direction:column;will-change:background-color;background-color:#1119;animation:dialogOverlayEntering .24s cubic-bezier(0,0,.2,1) forwards}.bb-dialog-overlay.leaving{animation:dialogOverlayLeaving .24s cubic-bezier(0,0,.2,1) forwards}.bb-dialog-overlay.leaving .bb-dialog-modal{animation:dialogModalLeaving .24s cubic-bezier(0,0,.2,1) forwards}@keyframes dialogOverlayEntering{0%{background-color:transparent}to{background-color:#1119}}@keyframes dialogOverlayLeaving{to{background-color:transparent}}\n"] }]
|
|
73
|
+
}], propDecorators: { closeRequested: [{
|
|
136
74
|
type: Output
|
|
137
75
|
}], onKeyEvent: [{
|
|
138
76
|
type: HostListener,
|
|
139
77
|
args: ['window:keyup', ['$event']]
|
|
140
|
-
}], onAnimationDone: [{
|
|
141
|
-
type: HostListener,
|
|
142
|
-
args: ['@bbDialogOverlayAnimation.done', ['$event']]
|
|
143
78
|
}] } });
|
|
144
79
|
|
|
145
80
|
class BbDialogModal {
|
|
@@ -170,16 +105,16 @@ class BbDialogModal {
|
|
|
170
105
|
? this._renderer.removeStyle(element, 'overflow')
|
|
171
106
|
: this._renderer.setStyle(element, 'overflow', 'hidden');
|
|
172
107
|
}
|
|
173
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
174
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.2.
|
|
108
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogModal, deps: [{ token: i1.Patch }, { token: i0.Renderer2 }, { token: DOCUMENT, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
109
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.2.12", type: BbDialogModal, isStandalone: true, selector: "[bb-dialog-modal]", inputs: { maxWidth: "maxWidth", withoutBodyPadding: ["withoutBodyPadding", "withoutBodyPadding", booleanAttribute] }, host: { attributes: { "role": "dialog" }, properties: { "class.without-body-padding": "withoutBodyPadding", "style.max-width": "this.maxWidth" }, classAttribute: "bb-dialog-modal" }, ngImport: i0, template: "<ng-content select=\"[bb-dialog-header]\"></ng-content>\n\n<div class=\"bb-dialog-modal-body\">\n <ng-content></ng-content>\n</div>\n\n<ng-content select=\"[bb-dialog-actions]\"></ng-content>\n", styles: [".bb-dialog-modal{width:100%;margin:auto;z-index:1001;display:flex;max-width:25rem;position:relative;pointer-events:auto;border-radius:.25rem;flex-direction:column;background-color:#fff;will-change:opacity,transform;max-height:calc(var(--vh, 1vh) * 100 - 3rem);animation:dialogModalEntering .24s cubic-bezier(0,0,.2,1) forwards}.bb-dialog-modal.without-body-padding>.bb-dialog-modal-body{padding:0}.bb-dialog-modal-body{color:#738694;padding:1.5rem;overflow-y:auto;line-height:1.4;font-size:.8125rem;background-color:#f1f3f6}@keyframes dialogModalEntering{0%{opacity:0;transform:scale(.98)}to{opacity:1;transform:none}}@keyframes dialogModalLeaving{0%{opacity:1;transform:none}to{opacity:0;transform:scale(.98)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
175
110
|
}
|
|
176
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
111
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogModal, decorators: [{
|
|
177
112
|
type: Component,
|
|
178
113
|
args: [{ selector: '[bb-dialog-modal]', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
179
114
|
'class': 'bb-dialog-modal',
|
|
180
115
|
'[class.without-body-padding]': 'withoutBodyPadding',
|
|
181
116
|
'role': 'dialog'
|
|
182
|
-
}, preserveWhitespaces: false, standalone: true, template: "<ng-content select=\"[bb-dialog-header]\"></ng-content>\n\n<div class=\"bb-dialog-modal-body\">\n <ng-content></ng-content>\n</div>\n\n<ng-content select=\"[bb-dialog-actions]\"></ng-content>\n", styles: [".bb-dialog-modal{width:100%;margin:auto;z-index:1001;display:flex;max-width:25rem;position:relative;pointer-events:auto;border-radius:.25rem;flex-direction:column;background-color:#fff;will-change:opacity,transform;max-height:calc(var(--vh, 1vh) * 100 - 3rem)}.bb-dialog-modal.without-body-padding>.bb-dialog-modal-body{padding:0}.bb-dialog-modal-body{color:#738694;padding:1.5rem;overflow-y:auto;line-height:1.4;font-size:.8125rem;background-color:#f1f3f6}\n"] }]
|
|
117
|
+
}, preserveWhitespaces: false, standalone: true, template: "<ng-content select=\"[bb-dialog-header]\"></ng-content>\n\n<div class=\"bb-dialog-modal-body\">\n <ng-content></ng-content>\n</div>\n\n<ng-content select=\"[bb-dialog-actions]\"></ng-content>\n", styles: [".bb-dialog-modal{width:100%;margin:auto;z-index:1001;display:flex;max-width:25rem;position:relative;pointer-events:auto;border-radius:.25rem;flex-direction:column;background-color:#fff;will-change:opacity,transform;max-height:calc(var(--vh, 1vh) * 100 - 3rem);animation:dialogModalEntering .24s cubic-bezier(0,0,.2,1) forwards}.bb-dialog-modal.without-body-padding>.bb-dialog-modal-body{padding:0}.bb-dialog-modal-body{color:#738694;padding:1.5rem;overflow-y:auto;line-height:1.4;font-size:.8125rem;background-color:#f1f3f6}@keyframes dialogModalEntering{0%{opacity:0;transform:scale(.98)}to{opacity:1;transform:none}}@keyframes dialogModalLeaving{0%{opacity:1;transform:none}to{opacity:0;transform:scale(.98)}}\n"] }]
|
|
183
118
|
}], ctorParameters: () => [{ type: i1.Patch }, { type: i0.Renderer2 }, { type: Document, decorators: [{
|
|
184
119
|
type: Optional
|
|
185
120
|
}, {
|
|
@@ -198,10 +133,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.10", ngImpo
|
|
|
198
133
|
class BbDialogHeader {
|
|
199
134
|
// Outputs.
|
|
200
135
|
closeRequested = new EventEmitter();
|
|
201
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
202
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.
|
|
136
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogHeader, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
137
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: BbDialogHeader, isStandalone: true, selector: "[bb-dialog-header]", outputs: { closeRequested: "closeRequested" }, host: { classAttribute: "bb-dialog-header" }, ngImport: i0, template: "<div class=\"bb-dialog-header-row\">\n <div class=\"bb-dialog-header-content\">\n <ng-content></ng-content>\n </div>\n\n @if (closeRequested?.observed) {\n <button (click)=\"closeRequested?.emit()\"\n type=\"button\"\n class=\"bb-dialog-header-close\">\n </button>\n }\n</div>\n\n<nav class=\"bb-dialog-header-navigation\">\n <ng-content select=\"[bb-dialog-link]\"></ng-content>\n</nav>\n", styles: [".bb-dialog-header{display:flex;min-height:3.75rem;flex-direction:column;justify-content:center;background-color:#fff;border-top-left-radius:.25rem;border-bottom:1px solid #d8d8d8;border-top-right-radius:.25rem}.bb-dialog-header .bb-dialog-header-content,.bb-dialog-header .bb-dialog-header-content h1{color:#111;max-width:100%;font-weight:500;overflow:hidden;font-size:1.25rem;white-space:nowrap;text-overflow:ellipsis}.bb-dialog-header-row,.bb-dialog-header-navigation{width:100%;display:flex;align-items:center}.bb-dialog-header-row{padding:.75rem 1.5rem}.bb-dialog-header-navigation{width:100%;overflow-x:auto;padding:0 1.5rem;white-space:nowrap}.bb-dialog-header-navigation:empty{margin:0;height:0;padding:0;visibility:hidden}.bb-dialog-header-content{flex:1}.bb-dialog-header-close{width:2rem;height:2rem;border:none;min-width:2rem;min-height:2rem;overflow:hidden;position:relative;margin-left:.75rem;display:inline-block;margin-right:-.75rem;border-radius:.25rem;background-color:transparent}.bb-dialog-header-close:before,.bb-dialog-header-close:after{top:50%;left:20%;width:60%;content:\"\";height:.125rem;margin-top:-1px;position:absolute;background-color:#999}.bb-dialog-header-close:before{transform:rotate(45deg)}.bb-dialog-header-close:after{transform:rotate(-45deg)}.bb-dialog-header-close:hover,.bb-dialog-header-close:focus{background-color:#e6e6e6}.bb-dialog-header-close:active{background-color:#d9d9d9}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
203
138
|
}
|
|
204
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
139
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogHeader, decorators: [{
|
|
205
140
|
type: Component,
|
|
206
141
|
args: [{ selector: '[bb-dialog-header]', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: { 'class': 'bb-dialog-header' }, preserveWhitespaces: false, standalone: true, template: "<div class=\"bb-dialog-header-row\">\n <div class=\"bb-dialog-header-content\">\n <ng-content></ng-content>\n </div>\n\n @if (closeRequested?.observed) {\n <button (click)=\"closeRequested?.emit()\"\n type=\"button\"\n class=\"bb-dialog-header-close\">\n </button>\n }\n</div>\n\n<nav class=\"bb-dialog-header-navigation\">\n <ng-content select=\"[bb-dialog-link]\"></ng-content>\n</nav>\n", styles: [".bb-dialog-header{display:flex;min-height:3.75rem;flex-direction:column;justify-content:center;background-color:#fff;border-top-left-radius:.25rem;border-bottom:1px solid #d8d8d8;border-top-right-radius:.25rem}.bb-dialog-header .bb-dialog-header-content,.bb-dialog-header .bb-dialog-header-content h1{color:#111;max-width:100%;font-weight:500;overflow:hidden;font-size:1.25rem;white-space:nowrap;text-overflow:ellipsis}.bb-dialog-header-row,.bb-dialog-header-navigation{width:100%;display:flex;align-items:center}.bb-dialog-header-row{padding:.75rem 1.5rem}.bb-dialog-header-navigation{width:100%;overflow-x:auto;padding:0 1.5rem;white-space:nowrap}.bb-dialog-header-navigation:empty{margin:0;height:0;padding:0;visibility:hidden}.bb-dialog-header-content{flex:1}.bb-dialog-header-close{width:2rem;height:2rem;border:none;min-width:2rem;min-height:2rem;overflow:hidden;position:relative;margin-left:.75rem;display:inline-block;margin-right:-.75rem;border-radius:.25rem;background-color:transparent}.bb-dialog-header-close:before,.bb-dialog-header-close:after{top:50%;left:20%;width:60%;content:\"\";height:.125rem;margin-top:-1px;position:absolute;background-color:#999}.bb-dialog-header-close:before{transform:rotate(45deg)}.bb-dialog-header-close:after{transform:rotate(-45deg)}.bb-dialog-header-close:hover,.bb-dialog-header-close:focus{background-color:#e6e6e6}.bb-dialog-header-close:active{background-color:#d9d9d9}\n"] }]
|
|
207
142
|
}], propDecorators: { closeRequested: [{
|
|
@@ -209,60 +144,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.10", ngImpo
|
|
|
209
144
|
}] } });
|
|
210
145
|
|
|
211
146
|
class BbDialogLink {
|
|
212
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
213
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.
|
|
147
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogLink, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
148
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.12", type: BbDialogLink, isStandalone: true, selector: "[bb-dialog-link]", host: { classAttribute: "bb-dialog-link" }, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [".bb-dialog-link{border:none;height:2rem;display:flex;font-size:1rem;appearance:none;font-weight:500;white-space:nowrap;align-items:center;color:#6b5c5c!important;background-color:transparent;text-decoration:none!important;border-bottom:2px solid transparent}.bb-dialog-link+.bb-dialog-link{margin-left:.75rem}.bb-dialog-link:hover:not(.disabled){border-bottom:2px solid rgba(117,119,148,.2)}.bb-dialog-link.active,.bb-dialog-link.active:hover{color:#5b53ff!important;border-bottom-color:#5b53ff}.bb-dialog-link.disabled,.bb-dialog-link.disabled:focus,.bb-dialog-link.disabled:hover,.bb-dialog-link.disabled:active{opacity:.4;cursor:default;box-shadow:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
214
149
|
}
|
|
215
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
150
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogLink, decorators: [{
|
|
216
151
|
type: Component,
|
|
217
152
|
args: [{ selector: '[bb-dialog-link]', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: { 'class': 'bb-dialog-link' }, preserveWhitespaces: false, standalone: true, template: "<ng-content></ng-content>\n", styles: [".bb-dialog-link{border:none;height:2rem;display:flex;font-size:1rem;appearance:none;font-weight:500;white-space:nowrap;align-items:center;color:#6b5c5c!important;background-color:transparent;text-decoration:none!important;border-bottom:2px solid transparent}.bb-dialog-link+.bb-dialog-link{margin-left:.75rem}.bb-dialog-link:hover:not(.disabled){border-bottom:2px solid rgba(117,119,148,.2)}.bb-dialog-link.active,.bb-dialog-link.active:hover{color:#5b53ff!important;border-bottom-color:#5b53ff}.bb-dialog-link.disabled,.bb-dialog-link.disabled:focus,.bb-dialog-link.disabled:hover,.bb-dialog-link.disabled:active{opacity:.4;cursor:default;box-shadow:none}\n"] }]
|
|
218
153
|
}] });
|
|
219
154
|
|
|
220
155
|
class BbDialogActions {
|
|
221
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
222
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.
|
|
156
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogActions, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
157
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.12", type: BbDialogActions, isStandalone: true, selector: "[bb-dialog-actions]", host: { classAttribute: "bb-dialog-actions" }, ngImport: i0, template: "<bb-form-group class=\"end\">\n <ng-content></ng-content>\n</bb-form-group>\n", styles: [".bb-dialog-actions{display:block;padding:1.25rem 1.5rem;background-color:#fff;border-top:1px solid #d8d8d8;border-bottom-left-radius:.25rem;border-bottom-right-radius:.25rem}\n"], dependencies: [{ kind: "component", type: BbFormGroup, selector: "bb-form-group", inputs: ["grouped"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
223
158
|
}
|
|
224
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
159
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogActions, decorators: [{
|
|
225
160
|
type: Component,
|
|
226
161
|
args: [{ selector: '[bb-dialog-actions]', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: { 'class': 'bb-dialog-actions' }, preserveWhitespaces: false, standalone: true, imports: [BbFormGroup], template: "<bb-form-group class=\"end\">\n <ng-content></ng-content>\n</bb-form-group>\n", styles: [".bb-dialog-actions{display:block;padding:1.25rem 1.5rem;background-color:#fff;border-top:1px solid #d8d8d8;border-bottom-left-radius:.25rem;border-bottom-right-radius:.25rem}\n"] }]
|
|
227
162
|
}] });
|
|
228
163
|
|
|
229
|
-
const bbDialogContainerAnimation = trigger('bbDialogContainerAnimation', [
|
|
230
|
-
transition(':enter', [
|
|
231
|
-
group([
|
|
232
|
-
query('.bb-dialog-container-backdrop', [
|
|
233
|
-
style({ opacity: 0 }),
|
|
234
|
-
animate('180ms cubic-bezier(0, 0, 0.2, 1)', style({ opacity: 1 }))
|
|
235
|
-
]),
|
|
236
|
-
query('.bb-dialog-container-component', [
|
|
237
|
-
style({ opacity: 0, transform: 'scale(0.96)' }),
|
|
238
|
-
animate('180ms cubic-bezier(0, 0, 0.2, 1)', style({ opacity: 1, transform: 'none' }))
|
|
239
|
-
])
|
|
240
|
-
])
|
|
241
|
-
]),
|
|
242
|
-
transition(':leave', [
|
|
243
|
-
group([
|
|
244
|
-
query('.bb-dialog-container-backdrop', [
|
|
245
|
-
animate('180ms cubic-bezier(0, 0, 0.2, 1)', style({ opacity: 0 }))
|
|
246
|
-
]),
|
|
247
|
-
query('.bb-dialog-container-component', [
|
|
248
|
-
animate('180ms cubic-bezier(0, 0, 0.2, 1)', style({
|
|
249
|
-
opacity: 0,
|
|
250
|
-
transform: 'scale(0.96)'
|
|
251
|
-
}))
|
|
252
|
-
])
|
|
253
|
-
])
|
|
254
|
-
])
|
|
255
|
-
]);
|
|
256
|
-
|
|
257
164
|
class BbDialogInsertion {
|
|
258
165
|
viewContainerRef;
|
|
259
166
|
constructor(viewContainerRef) {
|
|
260
167
|
this.viewContainerRef = viewContainerRef;
|
|
261
168
|
}
|
|
262
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
263
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.
|
|
169
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogInsertion, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
170
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.12", type: BbDialogInsertion, isStandalone: true, selector: "[bbDialogInsertion]", ngImport: i0 });
|
|
264
171
|
}
|
|
265
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
172
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogInsertion, decorators: [{
|
|
266
173
|
type: Directive,
|
|
267
174
|
args: [{
|
|
268
175
|
selector: '[bbDialogInsertion]',
|
|
@@ -273,80 +180,52 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.10", ngImpo
|
|
|
273
180
|
class BbDialogContainer {
|
|
274
181
|
// Dependencies.
|
|
275
182
|
_config = inject(DIALOG_CONFIG, { optional: true });
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
backdropElementRef;
|
|
183
|
+
_renderer = inject(Renderer2);
|
|
184
|
+
_elementRef = inject(ElementRef);
|
|
185
|
+
_document = inject(DOCUMENT);
|
|
280
186
|
// Views.
|
|
281
187
|
insertion;
|
|
282
188
|
// Data.
|
|
283
189
|
componentRef = null;
|
|
284
190
|
childComponentType = null;
|
|
285
191
|
// State.
|
|
286
|
-
|
|
287
|
-
|
|
192
|
+
_overlayClicked$ = new Subject();
|
|
193
|
+
onOverlayClicked = this._overlayClicked$.pipe(take(1));
|
|
194
|
+
// Subscriptions.
|
|
288
195
|
_subscription = new Subscription();
|
|
289
|
-
get onOverlayClicked() {
|
|
290
|
-
return this.overlayClicked$.pipe(take(1));
|
|
291
|
-
}
|
|
292
196
|
ngOnInit() {
|
|
293
|
-
|
|
197
|
+
this.handleOverlayClicks();
|
|
294
198
|
this.loadChildComponent(this.childComponentType);
|
|
295
|
-
// Listen for mouse click on the dialog container.
|
|
296
|
-
this.listenForClicks();
|
|
297
199
|
}
|
|
298
200
|
ngOnDestroy() {
|
|
299
201
|
this._subscription?.unsubscribe();
|
|
300
202
|
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
}
|
|
306
|
-
// Destroy the ref if it exists.
|
|
307
|
-
this.componentRef?.destroy();
|
|
308
|
-
}
|
|
309
|
-
listenForClicks() {
|
|
310
|
-
const element = this.backdropElementRef?.nativeElement ?? null;
|
|
311
|
-
if (!element) {
|
|
312
|
-
return;
|
|
313
|
-
}
|
|
314
|
-
const mouseDown$ = fromEvent(element, 'mousedown');
|
|
315
|
-
const touchStart$ = fromEvent(element, 'touchstart');
|
|
316
|
-
const start$ = race([mouseDown$, touchStart$]);
|
|
317
|
-
const mouseUp$ = fromEvent(element, 'mouseup');
|
|
318
|
-
const touchEnd$ = fromEvent(element, 'touchend');
|
|
319
|
-
const end$ = race([mouseUp$, touchEnd$]);
|
|
320
|
-
const clicks$ = start$.pipe(switchMap(() => end$));
|
|
321
|
-
const subscription = clicks$.subscribe(() => this.overlayClicked$.next());
|
|
322
|
-
this._subscription.add(subscription);
|
|
203
|
+
async close() {
|
|
204
|
+
this._renderer.addClass(this._elementRef.nativeElement, 'leaving');
|
|
205
|
+
const timer$ = timer(this._config?.animationMs ?? 240);
|
|
206
|
+
return firstValueFrom(timer$);
|
|
323
207
|
}
|
|
324
208
|
loadChildComponent(componentType) {
|
|
325
|
-
// Get the view container ref and clear it.
|
|
326
209
|
const viewContainerRef = this.insertion.viewContainerRef;
|
|
327
210
|
viewContainerRef.clear();
|
|
328
|
-
// Create an instance of the component.
|
|
329
211
|
this.componentRef = viewContainerRef.createComponent(componentType);
|
|
330
212
|
}
|
|
331
|
-
|
|
332
|
-
|
|
213
|
+
handleOverlayClicks() {
|
|
214
|
+
const element = this._elementRef.nativeElement ?? null;
|
|
215
|
+
const subscription = fromEvent(element, 'pointerdown').pipe(filter(event => event?.target === element), switchMap(() => fromEvent(this._document, 'pointerup').pipe(filter((event) => event?.target === element), takeUntil(fromEvent(this._document, 'pointermove'))))).subscribe(() => {
|
|
216
|
+
this._overlayClicked$.next();
|
|
217
|
+
});
|
|
218
|
+
this._subscription.add(subscription);
|
|
219
|
+
}
|
|
220
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogContainer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
221
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.12", type: BbDialogContainer, isStandalone: true, selector: "bb-dialog-container", host: { classAttribute: "bb-dialog-container" }, viewQueries: [{ propertyName: "insertion", first: true, predicate: BbDialogInsertion, descendants: true, static: true }], ngImport: i0, template: "<div class=\"bb-dialog-container-component\">\n <ng-container bbDialogInsertion></ng-container>\n</div>\n", styles: [".bb-dialog-container{inset:0;z-index:1000;display:flex;position:fixed;will-change:opacity;background-color:#1119;animation:dialogContainerEntering .24s cubic-bezier(0,0,.2,1) forwards}.bb-dialog-container.leaving{animation:dialogContainerLeaving .24s cubic-bezier(0,0,.2,1) forwards}.bb-dialog-container.leaving .bb-dialog-modal{animation:dialogModalLeaving .24s cubic-bezier(0,0,.2,1) forwards}.bb-dialog-container-component{width:100%;margin:auto;z-index:1001;display:block;padding:1.5rem;pointer-events:none;will-change:opacity,transform}@keyframes dialogContainerEntering{0%{background-color:transparent}to{background-color:#1119}}@keyframes dialogContainerLeaving{to{background-color:transparent}}\n"], dependencies: [{ kind: "directive", type: BbDialogInsertion, selector: "[bbDialogInsertion]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
333
222
|
}
|
|
334
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
223
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogContainer, decorators: [{
|
|
335
224
|
type: Component,
|
|
336
|
-
args: [{ selector: 'bb-dialog-container', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
337
|
-
|
|
338
|
-
'[@bbDialogContainerAnimation]': 'true',
|
|
339
|
-
'[@.disabled]': 'disableContainerAnimations'
|
|
340
|
-
}, preserveWhitespaces: false, animations: [bbDialogContainerAnimation], standalone: true, imports: [BbDialogInsertion], template: "<div #backdrop\n class=\"bb-dialog-container-backdrop\"></div>\n\n<div class=\"bb-dialog-container-component\">\n <ng-container bbDialogInsertion></ng-container>\n</div>\n", styles: [".bb-dialog-container,.bb-dialog-container-backdrop{inset:0;z-index:1000;position:fixed}.bb-dialog-container{display:flex}.bb-dialog-container-backdrop{will-change:opacity;background-color:#1119}.bb-dialog-container-component{width:100%;margin:auto;z-index:1001;display:block;padding:1.5rem;pointer-events:none;will-change:opacity,transform}\n"] }]
|
|
341
|
-
}], propDecorators: { backdropElementRef: [{
|
|
342
|
-
type: ViewChild,
|
|
343
|
-
args: ['backdrop', { static: true }]
|
|
344
|
-
}], insertion: [{
|
|
225
|
+
args: [{ selector: 'bb-dialog-container', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: { 'class': 'bb-dialog-container' }, preserveWhitespaces: false, standalone: true, imports: [BbDialogInsertion], template: "<div class=\"bb-dialog-container-component\">\n <ng-container bbDialogInsertion></ng-container>\n</div>\n", styles: [".bb-dialog-container{inset:0;z-index:1000;display:flex;position:fixed;will-change:opacity;background-color:#1119;animation:dialogContainerEntering .24s cubic-bezier(0,0,.2,1) forwards}.bb-dialog-container.leaving{animation:dialogContainerLeaving .24s cubic-bezier(0,0,.2,1) forwards}.bb-dialog-container.leaving .bb-dialog-modal{animation:dialogModalLeaving .24s cubic-bezier(0,0,.2,1) forwards}.bb-dialog-container-component{width:100%;margin:auto;z-index:1001;display:block;padding:1.5rem;pointer-events:none;will-change:opacity,transform}@keyframes dialogContainerEntering{0%{background-color:transparent}to{background-color:#1119}}@keyframes dialogContainerLeaving{to{background-color:transparent}}\n"] }]
|
|
226
|
+
}], propDecorators: { insertion: [{
|
|
345
227
|
type: ViewChild,
|
|
346
228
|
args: [BbDialogInsertion, { static: true }]
|
|
347
|
-
}], onAnimationDone: [{
|
|
348
|
-
type: HostListener,
|
|
349
|
-
args: ['@bbDialogContainerAnimation.done', ['$event']]
|
|
350
229
|
}] } });
|
|
351
230
|
|
|
352
231
|
let nextUniqueId = 0;
|
|
@@ -372,10 +251,10 @@ class BbDialogConfirm {
|
|
|
372
251
|
onClose(result) {
|
|
373
252
|
this._dialogRef.close(result);
|
|
374
253
|
}
|
|
375
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
376
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.
|
|
254
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogConfirm, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
255
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: BbDialogConfirm, isStandalone: true, selector: "bb-dialog-confirm", host: { classAttribute: "bb-dialog-confirm" }, viewQueries: [{ propertyName: "confirmButton", first: true, predicate: ["confirm"], descendants: true, read: BbButton }], ngImport: i0, template: "<div [attr.aria-labelledby]=\"dialogId\"\n [maxWidth]=\"width\"\n bb-dialog-modal\n bbFocusTrap>\n <header bb-dialog-header>\n @if (title; as titleContent) {\n <h1 [id]=\"dialogId\">\n <ng-template [bbTemplate]=\"titleContent\">\n {{ $any(titleContent) | bbLocalize:{optional: true} }}\n </ng-template>\n </h1>\n }\n </header>\n\n @if (description; as descriptionContent) {\n <p class=\"bb-dialog-confirm-description\">\n <ng-template [bbTemplate]=\"descriptionContent\">\n {{ $any(descriptionContent) | bbLocalize:{optional: true} }}\n </ng-template>\n </p>\n }\n\n <footer class=\"bb-dialog-confirm-footer\">\n @if (cancelButtonText; as cancelButtonTextLabel) {\n <button [ngClass]=\"cancelButtonClass ? cancelButtonClass : 'secondary full'\"\n (click)=\"onClose(false)\"\n bb-button\n type=\"button\">\n {{ cancelButtonTextLabel | bbLocalize:{optional: true} }}\n </button>\n }\n @if (confirmButtonText; as confirmButtonTextLabel) {\n <button #confirm\n [ngClass]=\"confirmButtonClass ? confirmButtonClass : 'destructive full'\"\n (click)=\"onClose(true)\"\n bb-button\n type=\"button\">\n {{ confirmButtonTextLabel | bbLocalize:{optional: true} }}\n </button>\n }\n </footer>\n</div>\n", styles: [".bb-dialog-confirm{display:block}.bb-dialog-confirm>.bb-dialog-modal>.bb-dialog-modal-body{background-color:#fff;border-bottom-left-radius:.25rem;border-bottom-right-radius:.25rem}.bb-dialog-confirm-description{line-height:2;font-size:.875rem}.bb-dialog-confirm-footer{display:flex;margin-top:1.5rem;flex-direction:column}.bb-dialog-confirm-footer>*+*{margin-top:1rem}@media only screen and (min-width: 768px){.bb-dialog-confirm-footer{flex-direction:row}.bb-dialog-confirm-footer>*+*{margin-top:0;margin-left:1rem}}\n"], dependencies: [{ kind: "component", type: BbDialogModal, selector: "[bb-dialog-modal]", inputs: ["maxWidth", "withoutBodyPadding"] }, { kind: "component", type: BbDialogHeader, selector: "[bb-dialog-header]", outputs: ["closeRequested"] }, { kind: "directive", type: BbFocusTrap, selector: "[bbFocusTrap]" }, { kind: "pipe", type: BbLocalize, name: "bbLocalize" }, { kind: "directive", type: BbTemplate, selector: "[bbTemplate]", inputs: ["bbTemplate"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: BbButton, selector: "button[bb-button]", inputs: ["disabled", "loading"], exportAs: ["bbButton"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
377
256
|
}
|
|
378
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
257
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogConfirm, decorators: [{
|
|
379
258
|
type: Component,
|
|
380
259
|
args: [{ selector: 'bb-dialog-confirm', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, host: { 'class': 'bb-dialog-confirm' }, standalone: true, imports: [BbDialogModal, BbDialogHeader, BbFocusTrap, BbLocalize, BbTemplate, NgClass, BbButton], template: "<div [attr.aria-labelledby]=\"dialogId\"\n [maxWidth]=\"width\"\n bb-dialog-modal\n bbFocusTrap>\n <header bb-dialog-header>\n @if (title; as titleContent) {\n <h1 [id]=\"dialogId\">\n <ng-template [bbTemplate]=\"titleContent\">\n {{ $any(titleContent) | bbLocalize:{optional: true} }}\n </ng-template>\n </h1>\n }\n </header>\n\n @if (description; as descriptionContent) {\n <p class=\"bb-dialog-confirm-description\">\n <ng-template [bbTemplate]=\"descriptionContent\">\n {{ $any(descriptionContent) | bbLocalize:{optional: true} }}\n </ng-template>\n </p>\n }\n\n <footer class=\"bb-dialog-confirm-footer\">\n @if (cancelButtonText; as cancelButtonTextLabel) {\n <button [ngClass]=\"cancelButtonClass ? cancelButtonClass : 'secondary full'\"\n (click)=\"onClose(false)\"\n bb-button\n type=\"button\">\n {{ cancelButtonTextLabel | bbLocalize:{optional: true} }}\n </button>\n }\n @if (confirmButtonText; as confirmButtonTextLabel) {\n <button #confirm\n [ngClass]=\"confirmButtonClass ? confirmButtonClass : 'destructive full'\"\n (click)=\"onClose(true)\"\n bb-button\n type=\"button\">\n {{ confirmButtonTextLabel | bbLocalize:{optional: true} }}\n </button>\n }\n </footer>\n</div>\n", styles: [".bb-dialog-confirm{display:block}.bb-dialog-confirm>.bb-dialog-modal>.bb-dialog-modal-body{background-color:#fff;border-bottom-left-radius:.25rem;border-bottom-right-radius:.25rem}.bb-dialog-confirm-description{line-height:2;font-size:.875rem}.bb-dialog-confirm-footer{display:flex;margin-top:1.5rem;flex-direction:column}.bb-dialog-confirm-footer>*+*{margin-top:1rem}@media only screen and (min-width: 768px){.bb-dialog-confirm-footer{flex-direction:row}.bb-dialog-confirm-footer>*+*{margin-top:0;margin-left:1rem}}\n"] }]
|
|
381
260
|
}], propDecorators: { confirmButton: [{
|
|
@@ -423,7 +302,10 @@ class Dialog {
|
|
|
423
302
|
dialogComponentRef.instance.childComponentType = componentType;
|
|
424
303
|
dialogComponentRef.instance.onOverlayClicked.subscribe(() => dialogRef.onOverlayClicked());
|
|
425
304
|
// Listen for close events.
|
|
426
|
-
dialogRef.afterClosed.subscribe(() =>
|
|
305
|
+
dialogRef.afterClosed.subscribe(async () => {
|
|
306
|
+
await dialogComponentRef?.instance?.close();
|
|
307
|
+
return this.deleteDialog(dialogComponentRef);
|
|
308
|
+
});
|
|
427
309
|
// Return the reference.
|
|
428
310
|
return dialogRef;
|
|
429
311
|
}
|
|
@@ -438,10 +320,10 @@ class Dialog {
|
|
|
438
320
|
dialogComponentRef.destroy();
|
|
439
321
|
dialogComponentRef = null;
|
|
440
322
|
}
|
|
441
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
442
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.
|
|
323
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: Dialog, deps: [{ token: i0.ApplicationRef }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
324
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: Dialog, providedIn: 'root' });
|
|
443
325
|
}
|
|
444
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
326
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: Dialog, decorators: [{
|
|
445
327
|
type: Injectable,
|
|
446
328
|
args: [{
|
|
447
329
|
providedIn: 'root'
|
|
@@ -468,10 +350,10 @@ class BbConfirm {
|
|
|
468
350
|
}
|
|
469
351
|
this.confirm.emit(event);
|
|
470
352
|
}
|
|
471
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
472
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.
|
|
353
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbConfirm, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
354
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.12", type: BbConfirm, isStandalone: true, selector: "[bbConfirm]", inputs: { bbConfirmTitle: "bbConfirmTitle", bbConfirmDescription: "bbConfirmDescription", bbConfirmButtonText: "bbConfirmButtonText", bbCancelButtonText: "bbCancelButtonText" }, outputs: { confirm: "bbConfirm" }, host: { listeners: { "click": "onClick($event)" } }, ngImport: i0 });
|
|
473
355
|
}
|
|
474
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
356
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbConfirm, decorators: [{
|
|
475
357
|
type: Directive,
|
|
476
358
|
args: [{
|
|
477
359
|
selector: '[bbConfirm]',
|
|
@@ -508,8 +390,8 @@ class DialogModule {
|
|
|
508
390
|
]
|
|
509
391
|
};
|
|
510
392
|
}
|
|
511
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
512
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.
|
|
393
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: DialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
394
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.12", ngImport: i0, type: DialogModule, imports: [BbDialogContainer,
|
|
513
395
|
BbDialogOverlay,
|
|
514
396
|
BbDialogModal,
|
|
515
397
|
BbDialogHeader,
|
|
@@ -523,10 +405,10 @@ class DialogModule {
|
|
|
523
405
|
BbDialogLink,
|
|
524
406
|
BbDialogActions,
|
|
525
407
|
BbConfirm] });
|
|
526
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.
|
|
408
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: DialogModule, imports: [BbDialogActions,
|
|
527
409
|
BbDialogConfirm] });
|
|
528
410
|
}
|
|
529
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
411
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: DialogModule, decorators: [{
|
|
530
412
|
type: NgModule,
|
|
531
413
|
args: [{
|
|
532
414
|
imports: [
|