@bravobit/bb-foundation 0.45.0 → 0.45.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.
- package/dialog/lib/dialog-container/dialog-container.component.d.ts +8 -12
- package/dialog/lib/dialog-overlay/dialog-overlay.component.d.ts +6 -14
- 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/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 +3 -3
- 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/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 +22 -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 +24 -67
- 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 +3 -3
- 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 +43 -43
- 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 +78 -208
- package/fesm2022/bravobit-bb-foundation-dialog.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-elements.mjs +88 -88
- 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/package.json +23 -23
- 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
|
|
2
|
-
import { Subject,
|
|
1
|
+
import { take } from 'rxjs/operators';
|
|
2
|
+
import { Subject, timer, firstValueFrom } 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,48 @@ 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
|
-
disableOverlayAnimations = this._config?.disableOverlayAnimations ?? false;
|
|
70
|
-
// Views.
|
|
71
|
-
overlayElementRef;
|
|
36
|
+
_renderer = inject(Renderer2);
|
|
37
|
+
_elementRef = inject(ElementRef);
|
|
72
38
|
// Outputs.
|
|
73
39
|
closeRequested = new EventEmitter();
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
_closed$ = new Subject();
|
|
77
|
-
// Subscriptions.
|
|
78
|
-
_subscription = new Subscription();
|
|
79
|
-
ngOnInit() {
|
|
80
|
-
this.listenForClicks();
|
|
81
|
-
}
|
|
82
|
-
ngOnDestroy() {
|
|
83
|
-
this._subscription?.unsubscribe();
|
|
84
|
-
}
|
|
85
|
-
onKeyEvent(event) {
|
|
86
|
-
if (event?.key === 'Escape') {
|
|
87
|
-
this.closeRequested.emit();
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
onAnimationDone(event) {
|
|
91
|
-
// Check if the dialog is being destroyed.
|
|
92
|
-
if (!['close'].includes(event?.toState)) {
|
|
40
|
+
onClick(event) {
|
|
41
|
+
if (event?.target !== event?.currentTarget) {
|
|
93
42
|
return;
|
|
94
43
|
}
|
|
95
|
-
this.
|
|
96
|
-
this._closed$.complete();
|
|
44
|
+
this.closeRequested.emit();
|
|
97
45
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
// here else it won't close in all scenario's.
|
|
101
|
-
this.state = 'close';
|
|
102
|
-
this._changeDetectorRef.markForCheck();
|
|
103
|
-
// Listen for the closed trigger.
|
|
104
|
-
const observable$ = this._closed$.pipe(take(1));
|
|
105
|
-
return lastValueFrom(observable$);
|
|
106
|
-
}
|
|
107
|
-
listenForClicks() {
|
|
108
|
-
const element = this.overlayElementRef?.nativeElement ?? null;
|
|
109
|
-
if (!element) {
|
|
46
|
+
onKeyEvent(event) {
|
|
47
|
+
if (event?.key !== 'Escape') {
|
|
110
48
|
return;
|
|
111
49
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
const clicks$ = start$.pipe(switchMap(() => end$));
|
|
119
|
-
const subscription = clicks$.subscribe(() => this.closeRequested.next());
|
|
120
|
-
this._subscription.add(subscription);
|
|
50
|
+
this.closeRequested.emit();
|
|
51
|
+
}
|
|
52
|
+
async close() {
|
|
53
|
+
this._renderer.addClass(this._elementRef.nativeElement, 'leaving');
|
|
54
|
+
const timer$ = timer(this._config?.animationMs ?? 240);
|
|
55
|
+
return firstValueFrom(timer$);
|
|
121
56
|
}
|
|
122
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
123
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.
|
|
57
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogOverlay, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
58
|
+
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: { "click": "onClick($event)", "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
59
|
}
|
|
125
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
60
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogOverlay, decorators: [{
|
|
126
61
|
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: [{
|
|
62
|
+
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"] }]
|
|
63
|
+
}], propDecorators: { closeRequested: [{
|
|
136
64
|
type: Output
|
|
65
|
+
}], onClick: [{
|
|
66
|
+
type: HostListener,
|
|
67
|
+
args: ['click', ['$event']]
|
|
137
68
|
}], onKeyEvent: [{
|
|
138
69
|
type: HostListener,
|
|
139
70
|
args: ['window:keyup', ['$event']]
|
|
140
|
-
}], onAnimationDone: [{
|
|
141
|
-
type: HostListener,
|
|
142
|
-
args: ['@bbDialogOverlayAnimation.done', ['$event']]
|
|
143
71
|
}] } });
|
|
144
72
|
|
|
145
73
|
class BbDialogModal {
|
|
@@ -170,16 +98,16 @@ class BbDialogModal {
|
|
|
170
98
|
? this._renderer.removeStyle(element, 'overflow')
|
|
171
99
|
: this._renderer.setStyle(element, 'overflow', 'hidden');
|
|
172
100
|
}
|
|
173
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
174
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.2.
|
|
101
|
+
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 });
|
|
102
|
+
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
103
|
}
|
|
176
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
104
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogModal, decorators: [{
|
|
177
105
|
type: Component,
|
|
178
106
|
args: [{ selector: '[bb-dialog-modal]', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
179
107
|
'class': 'bb-dialog-modal',
|
|
180
108
|
'[class.without-body-padding]': 'withoutBodyPadding',
|
|
181
109
|
'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"] }]
|
|
110
|
+
}, 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
111
|
}], ctorParameters: () => [{ type: i1.Patch }, { type: i0.Renderer2 }, { type: Document, decorators: [{
|
|
184
112
|
type: Optional
|
|
185
113
|
}, {
|
|
@@ -198,10 +126,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.10", ngImpo
|
|
|
198
126
|
class BbDialogHeader {
|
|
199
127
|
// Outputs.
|
|
200
128
|
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.
|
|
129
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogHeader, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
130
|
+
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
131
|
}
|
|
204
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
132
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogHeader, decorators: [{
|
|
205
133
|
type: Component,
|
|
206
134
|
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
135
|
}], propDecorators: { closeRequested: [{
|
|
@@ -209,60 +137,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.10", ngImpo
|
|
|
209
137
|
}] } });
|
|
210
138
|
|
|
211
139
|
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.
|
|
140
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogLink, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
141
|
+
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
142
|
}
|
|
215
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
143
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogLink, decorators: [{
|
|
216
144
|
type: Component,
|
|
217
145
|
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
146
|
}] });
|
|
219
147
|
|
|
220
148
|
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.
|
|
149
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogActions, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
150
|
+
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
151
|
}
|
|
224
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
152
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogActions, decorators: [{
|
|
225
153
|
type: Component,
|
|
226
154
|
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
155
|
}] });
|
|
228
156
|
|
|
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
157
|
class BbDialogInsertion {
|
|
258
158
|
viewContainerRef;
|
|
259
159
|
constructor(viewContainerRef) {
|
|
260
160
|
this.viewContainerRef = viewContainerRef;
|
|
261
161
|
}
|
|
262
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
263
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.
|
|
162
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogInsertion, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
163
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.12", type: BbDialogInsertion, isStandalone: true, selector: "[bbDialogInsertion]", ngImport: i0 });
|
|
264
164
|
}
|
|
265
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
165
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogInsertion, decorators: [{
|
|
266
166
|
type: Directive,
|
|
267
167
|
args: [{
|
|
268
168
|
selector: '[bbDialogInsertion]',
|
|
@@ -273,80 +173,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.10", ngImpo
|
|
|
273
173
|
class BbDialogContainer {
|
|
274
174
|
// Dependencies.
|
|
275
175
|
_config = inject(DIALOG_CONFIG, { optional: true });
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
// Views.
|
|
279
|
-
backdropElementRef;
|
|
176
|
+
_renderer = inject(Renderer2);
|
|
177
|
+
_elementRef = inject(ElementRef);
|
|
280
178
|
// Views.
|
|
281
179
|
insertion;
|
|
282
180
|
// Data.
|
|
283
181
|
componentRef = null;
|
|
284
182
|
childComponentType = null;
|
|
285
183
|
// State.
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
_subscription = new Subscription();
|
|
289
|
-
get onOverlayClicked() {
|
|
290
|
-
return this.overlayClicked$.pipe(take(1));
|
|
291
|
-
}
|
|
184
|
+
_overlayClicked$ = new Subject();
|
|
185
|
+
onOverlayClicked = this._overlayClicked$.pipe(take(1));
|
|
292
186
|
ngOnInit() {
|
|
293
|
-
// Load the child component.
|
|
294
187
|
this.loadChildComponent(this.childComponentType);
|
|
295
|
-
// Listen for mouse click on the dialog container.
|
|
296
|
-
this.listenForClicks();
|
|
297
188
|
}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
}
|
|
301
|
-
onAnimationDone(event) {
|
|
302
|
-
// Check if the dialog is being destroyed.
|
|
303
|
-
if (event?.toState !== 'void') {
|
|
189
|
+
onClick(event) {
|
|
190
|
+
if (event?.target !== event?.currentTarget) {
|
|
304
191
|
return;
|
|
305
192
|
}
|
|
306
|
-
|
|
307
|
-
this.componentRef?.destroy();
|
|
193
|
+
this._overlayClicked$.next();
|
|
308
194
|
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
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);
|
|
195
|
+
async close() {
|
|
196
|
+
this._renderer.addClass(this._elementRef.nativeElement, 'leaving');
|
|
197
|
+
const timer$ = timer(this._config?.animationMs ?? 240);
|
|
198
|
+
return firstValueFrom(timer$);
|
|
323
199
|
}
|
|
324
200
|
loadChildComponent(componentType) {
|
|
325
|
-
// Get the view container ref and clear it.
|
|
326
201
|
const viewContainerRef = this.insertion.viewContainerRef;
|
|
327
202
|
viewContainerRef.clear();
|
|
328
|
-
// Create an instance of the component.
|
|
329
203
|
this.componentRef = viewContainerRef.createComponent(componentType);
|
|
330
204
|
}
|
|
331
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
332
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.
|
|
205
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogContainer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
206
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.12", type: BbDialogContainer, isStandalone: true, selector: "bb-dialog-container", host: { listeners: { "click": "onClick($event)" }, 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
207
|
}
|
|
334
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
208
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogContainer, decorators: [{
|
|
335
209
|
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: [{
|
|
210
|
+
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"] }]
|
|
211
|
+
}], propDecorators: { insertion: [{
|
|
345
212
|
type: ViewChild,
|
|
346
213
|
args: [BbDialogInsertion, { static: true }]
|
|
347
|
-
}],
|
|
214
|
+
}], onClick: [{
|
|
348
215
|
type: HostListener,
|
|
349
|
-
args: ['
|
|
216
|
+
args: ['click', ['$event']]
|
|
350
217
|
}] } });
|
|
351
218
|
|
|
352
219
|
let nextUniqueId = 0;
|
|
@@ -372,10 +239,10 @@ class BbDialogConfirm {
|
|
|
372
239
|
onClose(result) {
|
|
373
240
|
this._dialogRef.close(result);
|
|
374
241
|
}
|
|
375
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
376
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.
|
|
242
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogConfirm, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
243
|
+
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
244
|
}
|
|
378
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
245
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbDialogConfirm, decorators: [{
|
|
379
246
|
type: Component,
|
|
380
247
|
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
248
|
}], propDecorators: { confirmButton: [{
|
|
@@ -423,7 +290,10 @@ class Dialog {
|
|
|
423
290
|
dialogComponentRef.instance.childComponentType = componentType;
|
|
424
291
|
dialogComponentRef.instance.onOverlayClicked.subscribe(() => dialogRef.onOverlayClicked());
|
|
425
292
|
// Listen for close events.
|
|
426
|
-
dialogRef.afterClosed.subscribe(() =>
|
|
293
|
+
dialogRef.afterClosed.subscribe(async () => {
|
|
294
|
+
await dialogComponentRef?.instance?.close();
|
|
295
|
+
return this.deleteDialog(dialogComponentRef);
|
|
296
|
+
});
|
|
427
297
|
// Return the reference.
|
|
428
298
|
return dialogRef;
|
|
429
299
|
}
|
|
@@ -438,10 +308,10 @@ class Dialog {
|
|
|
438
308
|
dialogComponentRef.destroy();
|
|
439
309
|
dialogComponentRef = null;
|
|
440
310
|
}
|
|
441
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
442
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.
|
|
311
|
+
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 });
|
|
312
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: Dialog, providedIn: 'root' });
|
|
443
313
|
}
|
|
444
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
314
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: Dialog, decorators: [{
|
|
445
315
|
type: Injectable,
|
|
446
316
|
args: [{
|
|
447
317
|
providedIn: 'root'
|
|
@@ -468,10 +338,10 @@ class BbConfirm {
|
|
|
468
338
|
}
|
|
469
339
|
this.confirm.emit(event);
|
|
470
340
|
}
|
|
471
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
472
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.
|
|
341
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbConfirm, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
342
|
+
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
343
|
}
|
|
474
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
344
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: BbConfirm, decorators: [{
|
|
475
345
|
type: Directive,
|
|
476
346
|
args: [{
|
|
477
347
|
selector: '[bbConfirm]',
|
|
@@ -508,8 +378,8 @@ class DialogModule {
|
|
|
508
378
|
]
|
|
509
379
|
};
|
|
510
380
|
}
|
|
511
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
512
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.
|
|
381
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: DialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
382
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.12", ngImport: i0, type: DialogModule, imports: [BbDialogContainer,
|
|
513
383
|
BbDialogOverlay,
|
|
514
384
|
BbDialogModal,
|
|
515
385
|
BbDialogHeader,
|
|
@@ -523,10 +393,10 @@ class DialogModule {
|
|
|
523
393
|
BbDialogLink,
|
|
524
394
|
BbDialogActions,
|
|
525
395
|
BbConfirm] });
|
|
526
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.
|
|
396
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: DialogModule, imports: [BbDialogActions,
|
|
527
397
|
BbDialogConfirm] });
|
|
528
398
|
}
|
|
529
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
399
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: DialogModule, decorators: [{
|
|
530
400
|
type: NgModule,
|
|
531
401
|
args: [{
|
|
532
402
|
imports: [
|