@bravobit/bb-foundation 0.42.0 → 0.42.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/auth/lib/auth.interceptor.d.ts +3 -6
- package/dialog/lib/dialog-confirm/dialog-confirm.component.d.ts +2 -5
- package/dialog/lib/dialog-container/dialog-container.component.d.ts +4 -6
- package/dialog/lib/dialog-overlay/dialog-overlay.component.d.ts +5 -7
- package/esm2022/auth/lib/auth.interceptor.mjs +36 -42
- package/esm2022/auth/lib/auth.module.mjs +4 -4
- package/esm2022/auth/lib/auth.service.mjs +18 -7
- package/esm2022/auth/lib/auth.session.mjs +26 -22
- package/esm2022/auth/lib/directives/authenticated.directive.mjs +16 -12
- package/esm2022/auth/lib/helpers/jwt.helper.mjs +29 -31
- package/esm2022/auth/lib/providers/email.provider.mjs +4 -1
- package/esm2022/auth/lib/providers/verify.provider.mjs +4 -1
- package/esm2022/collections/lib/collection.mjs +17 -7
- package/esm2022/collections/lib/collections.module.mjs +6 -6
- package/esm2022/collections/lib/components/collections-actions/collections-actions.component.mjs +7 -9
- package/esm2022/collections/lib/components/collections-grid/collections-grid.component.mjs +11 -11
- package/esm2022/collections/lib/components/collections-pager/collections-pager.component.mjs +10 -10
- package/esm2022/collections/lib/components/collections-table/collections-table.component.mjs +16 -16
- package/esm2022/collections/lib/components/collections-table-label/collections-table-label.component.mjs +9 -11
- package/esm2022/collections/lib/components/collections-table-sorting/collections-table-sorting.component.mjs +12 -9
- package/esm2022/collections/lib/components/collections-viewer/collections-viewer.component.mjs +10 -7
- package/esm2022/collections/lib/directives/collections-data-row.directive.mjs +6 -3
- package/esm2022/collections/lib/directives/collections-data.directive.mjs +6 -3
- package/esm2022/collections/lib/directives/collections-empty.directive.mjs +6 -3
- package/esm2022/collections/lib/directives/collections-error.directive.mjs +6 -3
- package/esm2022/collections/lib/directives/collections-initial.directive.mjs +4 -3
- package/esm2022/collections/lib/directives/collections-item.directive.mjs +6 -3
- package/esm2022/collections/lib/providers/api-collection.provider.mjs +6 -4
- package/esm2022/collections/lib/providers/local-collection.provider.mjs +2 -2
- package/esm2022/combobox/combobox/combobox-container.directive.mjs +12 -7
- package/esm2022/combobox/combobox/combobox.component.mjs +23 -20
- 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 +10 -6
- package/esm2022/dashboard/lib/dashboard/dashboard.component.mjs +13 -13
- package/esm2022/dashboard/lib/dashboard-header/dashboard-header.component.mjs +5 -7
- package/esm2022/dashboard/lib/dashboard-menu/dashboard-menu.component.mjs +8 -10
- package/esm2022/dashboard/lib/dashboard-menu-item/dashboard-menu-item.component.mjs +5 -7
- package/esm2022/dashboard/lib/dashboard-sidebar/dashboard-sidebar.component.mjs +12 -13
- package/esm2022/dashboard/lib/dashboard-sidebar-group/dashboard-sidebar-group.component.mjs +13 -12
- package/esm2022/dashboard/lib/dashboard-sidebar-item/dashboard-sidebar-item.component.mjs +7 -5
- package/esm2022/dashboard/lib/dashboard.module.mjs +5 -5
- package/esm2022/dialog/lib/dialog-actions/dialog-actions.component.mjs +3 -3
- package/esm2022/dialog/lib/dialog-confirm/dialog-confirm.component.mjs +21 -20
- package/esm2022/dialog/lib/dialog-container/dialog-container.component.mjs +19 -24
- package/esm2022/dialog/lib/dialog-header/dialog-header.component.mjs +5 -7
- package/esm2022/dialog/lib/dialog-link/dialog-link.component.mjs +3 -3
- package/esm2022/dialog/lib/dialog-modal/dialog-modal.component.mjs +9 -6
- package/esm2022/dialog/lib/dialog-overlay/dialog-overlay.component.mjs +19 -26
- package/esm2022/dialog/lib/dialog.insertion.mjs +4 -3
- package/esm2022/dialog/lib/dialog.interfaces.mjs +4 -1
- package/esm2022/dialog/lib/dialog.module.mjs +6 -6
- package/esm2022/dialog/lib/dialog.ref.mjs +4 -6
- package/esm2022/dialog/lib/dialog.service.mjs +5 -3
- package/esm2022/dialog/lib/directives/confirm.directive.mjs +12 -14
- package/esm2022/elements/lib/avatar/avatar.component.mjs +75 -77
- package/esm2022/elements/lib/button/button.component.mjs +12 -10
- package/esm2022/elements/lib/checkbox/checkbox.component.mjs +21 -17
- package/esm2022/elements/lib/checkbox-group/checkbox-group.component.mjs +8 -10
- package/esm2022/elements/lib/date-picker/date-picker.component.mjs +82 -76
- package/esm2022/elements/lib/directives/addon.directive.mjs +5 -5
- package/esm2022/elements/lib/directives/extra-error-controls.directive.mjs +7 -9
- package/esm2022/elements/lib/directives/form-submit.directive.mjs +6 -3
- package/esm2022/elements/lib/directives/form-submitter.directive.mjs +5 -7
- package/esm2022/elements/lib/directives/image-upload.directive.mjs +14 -11
- package/esm2022/elements/lib/directives/input.directive.mjs +6 -4
- package/esm2022/elements/lib/elements.module.mjs +6 -6
- package/esm2022/elements/lib/file-picker/file-picker.component.mjs +52 -51
- package/esm2022/elements/lib/form-control/form-control.component.mjs +14 -14
- package/esm2022/elements/lib/form-error/form-error.component.mjs +16 -8
- package/esm2022/elements/lib/form-group/form-group.component.mjs +5 -7
- package/esm2022/elements/lib/icon/icon.component.mjs +14 -13
- package/esm2022/elements/lib/image-picker/image-picker.component.mjs +20 -17
- package/esm2022/elements/lib/multi-file-control/multi-file-control.component.mjs +28 -24
- package/esm2022/elements/lib/pipes/date.pipe.mjs +6 -8
- package/esm2022/elements/lib/pipes/file-image.pipe.mjs +6 -3
- package/esm2022/elements/lib/pipes/file-size.pipe.mjs +13 -15
- package/esm2022/elements/lib/pipes/relative-time.pipe.mjs +37 -35
- package/esm2022/elements/lib/radio-button/radio-button.component.mjs +8 -7
- package/esm2022/elements/lib/radio-group/radio-group.component.mjs +21 -20
- package/esm2022/elements/lib/spinner/spinner.component.mjs +7 -9
- package/esm2022/http/lib/classes/http.config.mjs +19 -15
- package/esm2022/http/lib/http.interfaces.mjs +1 -1
- package/esm2022/http/lib/http.module.mjs +5 -4
- package/esm2022/http/lib/interceptors/base-url.interceptor.mjs +12 -20
- package/esm2022/http/lib/interceptors/error.interceptor.mjs +9 -14
- package/esm2022/lib/core/services/exif.service.mjs +102 -100
- package/esm2022/lib/core/services/file-loader.service.mjs +15 -17
- package/esm2022/lib/core/services/files.service.mjs +7 -3
- package/esm2022/lib/core/services/image-converter.service.mjs +33 -30
- package/esm2022/lib/core/services/languages.service.mjs +25 -24
- package/esm2022/lib/core/services/network.service.mjs +8 -5
- package/esm2022/lib/core/services/patch.service.mjs +9 -6
- package/esm2022/localize/lib/dictionary/dictionary.class.mjs +7 -1
- package/esm2022/localize/lib/dictionary/dictionary.context.mjs +2 -4
- package/esm2022/localize/lib/dictionary/dictionary.data.mjs +2 -1
- package/esm2022/localize/lib/handlers/missing.handler.mjs +2 -4
- package/esm2022/localize/lib/localize.module.mjs +5 -5
- package/esm2022/localize/lib/localize.pipe.mjs +4 -3
- package/esm2022/localize/lib/localize.service.mjs +30 -21
- package/esm2022/localize/lib/transforms/interpolate.transform.mjs +5 -1
- package/esm2022/localize/lib/transforms/plural.transform.mjs +6 -4
- package/esm2022/localize/lib/transforms/reference.transform.mjs +3 -1
- package/esm2022/localize/lib/views/localize-string/localize-string.component.mjs +14 -11
- package/esm2022/localize/lib/views/localize-template.directive.mjs +6 -5
- package/esm2022/masking/lib/directives/currency-mask.directive.mjs +11 -6
- package/esm2022/masking/lib/directives/date-mask.directive.mjs +11 -6
- package/esm2022/masking/lib/directives/input-mask.directive.mjs +21 -14
- package/esm2022/masking/lib/masking.module.mjs +5 -5
- package/esm2022/masking/lib/masking.service.mjs +4 -3
- package/esm2022/notifications/lib/notifications-item/notifications-item.component.mjs +50 -36
- package/esm2022/notifications/lib/notifications-list/notifications-list.component.mjs +8 -7
- package/esm2022/notifications/lib/notifications.interfaces.mjs +10 -1
- package/esm2022/notifications/lib/notifications.module.mjs +4 -4
- package/esm2022/notifications/lib/notifications.service.mjs +24 -10
- package/esm2022/permissions/lib/directives/permission.directive.mjs +20 -14
- package/esm2022/permissions/lib/handlers/local.handler.mjs +3 -1
- package/esm2022/permissions/lib/permissions.interface.mjs +4 -1
- package/esm2022/permissions/lib/permissions.module.mjs +4 -4
- package/esm2022/permissions/lib/permissions.service.mjs +8 -7
- package/esm2022/recaptcha/lib/recaptcha/recaptcha.component.mjs +34 -27
- package/esm2022/recaptcha/lib/recaptcha-loader.service.mjs +15 -15
- package/esm2022/recaptcha/lib/recaptcha.module.mjs +4 -4
- package/esm2022/select/lib/select/select.component.mjs +52 -47
- package/esm2022/select/lib/select-label.directive.mjs +4 -3
- package/esm2022/select/lib/select-multi-label.directive.mjs +4 -3
- package/esm2022/select/lib/select-option-group.directive.mjs +4 -3
- package/esm2022/select/lib/select-option.directive.mjs +4 -3
- package/esm2022/select/lib/select.module.mjs +5 -5
- package/esm2022/storage/lib/storage.service.mjs +25 -21
- package/esm2022/storage/lib/strategies/cookie-storage.strategy.mjs +66 -64
- package/esm2022/storage/lib/strategies/memory-storage.strategy.mjs +16 -18
- package/esm2022/storage/lib/strategies/polyfill-storage.strategy.mjs +31 -30
- package/esm2022/table/lib/components/table/table.component.mjs +30 -20
- 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 +15 -11
- package/esm2022/table/lib/components/table-pager/table-pager.component.mjs +18 -16
- package/esm2022/table/lib/data/datasource.data.mjs +4 -6
- package/esm2022/table/lib/data/generic.data.mjs +38 -36
- package/esm2022/table/lib/table.module.mjs +6 -6
- package/esm2022/tooltip/lib/tooltip-container/tooltip-container.component.mjs +5 -7
- package/esm2022/tooltip/lib/tooltip.directive.mjs +15 -15
- package/esm2022/tooltip/lib/tooltip.module.mjs +4 -4
- package/esm2022/utils/lib/directives/autosize.directive.mjs +9 -7
- package/esm2022/utils/lib/directives/focus-trap.directive.mjs +24 -22
- package/esm2022/utils/lib/directives/focus.directive.mjs +8 -5
- package/esm2022/utils/lib/directives/template.directive.mjs +7 -3
- package/esm2022/utils/lib/utils.module.mjs +5 -5
- package/fesm2022/bravobit-bb-foundation-auth.mjs +127 -110
- package/fesm2022/bravobit-bb-foundation-auth.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-collections.mjs +123 -93
- package/fesm2022/bravobit-bb-foundation-collections.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-combobox.mjs +46 -34
- package/fesm2022/bravobit-bb-foundation-combobox.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-dashboard.mjs +60 -64
- package/fesm2022/bravobit-bb-foundation-dashboard.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-dialog.mjs +97 -103
- package/fesm2022/bravobit-bb-foundation-dialog.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-elements.mjs +468 -440
- package/fesm2022/bravobit-bb-foundation-elements.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-http.mjs +40 -46
- package/fesm2022/bravobit-bb-foundation-http.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-localize.mjs +74 -49
- package/fesm2022/bravobit-bb-foundation-localize.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-masking.mjs +47 -29
- package/fesm2022/bravobit-bb-foundation-masking.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-notifications.mjs +91 -53
- package/fesm2022/bravobit-bb-foundation-notifications.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-permissions.mjs +34 -22
- package/fesm2022/bravobit-bb-foundation-permissions.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-recaptcha.mjs +50 -43
- package/fesm2022/bravobit-bb-foundation-recaptcha.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-select.mjs +67 -58
- package/fesm2022/bravobit-bb-foundation-select.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-storage.mjs +134 -129
- package/fesm2022/bravobit-bb-foundation-storage.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-table.mjs +107 -91
- package/fesm2022/bravobit-bb-foundation-table.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-tooltip.mjs +21 -23
- package/fesm2022/bravobit-bb-foundation-tooltip.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-utils.mjs +48 -37
- package/fesm2022/bravobit-bb-foundation-utils.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation.mjs +192 -178
- package/fesm2022/bravobit-bb-foundation.mjs.map +1 -1
- package/http/lib/http.interfaces.d.ts +2 -1
- package/http/lib/interceptors/base-url.interceptor.d.ts +2 -4
- package/http/lib/interceptors/error.interceptor.d.ts +1 -3
- package/package.json +13 -13
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { take, switchMap } from 'rxjs/operators';
|
|
2
2
|
import { Subject, Subscription, lastValueFrom, fromEvent, race, firstValueFrom } from 'rxjs';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { InjectionToken, EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation,
|
|
4
|
+
import { InjectionToken, inject, ElementRef, ChangeDetectorRef, EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, Output, HostListener, booleanAttribute, Optional, Inject, HostBinding, Input, Directive, ViewChild, createEnvironmentInjector, createComponent, Injectable, makeEnvironmentProviders, NgModule } from '@angular/core';
|
|
5
5
|
import { trigger, transition, group, query, style, animate } from '@angular/animations';
|
|
6
6
|
import { DOCUMENT, NgClass } from '@angular/common';
|
|
7
7
|
import * as i1 from '@bravobit/bb-foundation';
|
|
@@ -10,11 +10,9 @@ import { BbFocusTrap, BbTemplate } from '@bravobit/bb-foundation/utils';
|
|
|
10
10
|
import { BbLocalize } from '@bravobit/bb-foundation/localize';
|
|
11
11
|
|
|
12
12
|
class BbDialogRef {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
this._overlayClicked$ = new Subject();
|
|
17
|
-
}
|
|
13
|
+
// Data.
|
|
14
|
+
_afterClosed$ = new Subject();
|
|
15
|
+
_overlayClicked$ = new Subject();
|
|
18
16
|
get afterClosed() {
|
|
19
17
|
return this._afterClosed$.pipe(take(1));
|
|
20
18
|
}
|
|
@@ -30,8 +28,11 @@ class BbDialogRef {
|
|
|
30
28
|
}
|
|
31
29
|
|
|
32
30
|
class BbDialogConfig {
|
|
31
|
+
data;
|
|
33
32
|
}
|
|
34
33
|
class DialogConfig {
|
|
34
|
+
disableContainerAnimations;
|
|
35
|
+
disableOverlayAnimations;
|
|
35
36
|
}
|
|
36
37
|
const DIALOG_CONFIG = new InjectionToken('dialog config');
|
|
37
38
|
|
|
@@ -61,20 +62,19 @@ const bbDialogOverlayAnimation = trigger('bbDialogOverlayAnimation', [
|
|
|
61
62
|
]);
|
|
62
63
|
|
|
63
64
|
class BbDialogOverlay {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
65
|
+
// Dependencies.
|
|
66
|
+
_config = inject(DIALOG_CONFIG, { optional: true });
|
|
67
|
+
_elementRef = inject(ElementRef);
|
|
68
|
+
_changeDetectorRef = inject(ChangeDetectorRef);
|
|
69
|
+
// Readonly data.
|
|
70
|
+
disableOverlayAnimations = this._config?.disableOverlayAnimations ?? false;
|
|
71
|
+
// Outputs.
|
|
72
|
+
closeRequested = new EventEmitter();
|
|
73
|
+
// State.
|
|
74
|
+
state = 'open';
|
|
75
|
+
_closed$ = new Subject();
|
|
76
|
+
// Subscriptions.
|
|
77
|
+
_subscription = new Subscription();
|
|
78
78
|
ngOnInit() {
|
|
79
79
|
this.listenForClicks();
|
|
80
80
|
}
|
|
@@ -98,7 +98,7 @@ class BbDialogOverlay {
|
|
|
98
98
|
// We need change detection to run
|
|
99
99
|
// here else it won't close in all scenario's.
|
|
100
100
|
this.state = 'close';
|
|
101
|
-
this.
|
|
101
|
+
this._changeDetectorRef.markForCheck();
|
|
102
102
|
// Listen for the closed trigger.
|
|
103
103
|
const observable$ = this._closed$.pipe(take(1));
|
|
104
104
|
return lastValueFrom(observable$);
|
|
@@ -118,8 +118,8 @@ class BbDialogOverlay {
|
|
|
118
118
|
const subscription = clicks$.subscribe(() => this.closeRequested.next());
|
|
119
119
|
this._subscription.add(subscription);
|
|
120
120
|
}
|
|
121
|
-
static
|
|
122
|
-
static
|
|
121
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbDialogOverlay, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
122
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.0", type: BbDialogOverlay, isStandalone: true, selector: "bb-dialog-overlay", outputs: { closeRequested: "closeRequested" }, host: { listeners: { "window:keyup": "onKeyEvent($event)", "@bbDialogOverlayAnimation.done": "onAnimationDone($event)" }, properties: { "@bbDialogOverlayAnimation": "state", "@.disabled": "disableOverlayAnimations" }, classAttribute: "bb-dialog-overlay" }, ngImport: i0, template: "<div 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"], animations: [bbDialogOverlayAnimation], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
123
123
|
}
|
|
124
124
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbDialogOverlay, decorators: [{
|
|
125
125
|
type: Component,
|
|
@@ -128,12 +128,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
128
128
|
'[@bbDialogOverlayAnimation]': 'state',
|
|
129
129
|
'[@.disabled]': 'disableOverlayAnimations'
|
|
130
130
|
}, preserveWhitespaces: false, animations: [bbDialogOverlayAnimation], standalone: true, template: "<div 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"] }]
|
|
131
|
-
}],
|
|
132
|
-
type: Optional
|
|
133
|
-
}, {
|
|
134
|
-
type: Inject,
|
|
135
|
-
args: [DIALOG_CONFIG]
|
|
136
|
-
}] }], propDecorators: { closeRequested: [{
|
|
131
|
+
}], propDecorators: { closeRequested: [{
|
|
137
132
|
type: Output
|
|
138
133
|
}], onKeyEvent: [{
|
|
139
134
|
type: HostListener,
|
|
@@ -144,16 +139,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
144
139
|
}] } });
|
|
145
140
|
|
|
146
141
|
class BbDialogModal {
|
|
142
|
+
_patch;
|
|
143
|
+
_renderer;
|
|
144
|
+
_document;
|
|
145
|
+
// Styling.
|
|
146
|
+
maxWidth = '30rem';
|
|
147
147
|
onOverlayClickedEvent(event) {
|
|
148
148
|
event.stopPropagation();
|
|
149
149
|
}
|
|
150
|
+
withoutBodyPadding = false;
|
|
150
151
|
constructor(_patch, _renderer, _document) {
|
|
151
152
|
this._patch = _patch;
|
|
152
153
|
this._renderer = _renderer;
|
|
153
154
|
this._document = _document;
|
|
154
|
-
// Styling.
|
|
155
|
-
this.maxWidth = '30rem';
|
|
156
|
-
this.withoutBodyPadding = false;
|
|
157
155
|
}
|
|
158
156
|
ngOnInit() {
|
|
159
157
|
this._patch.mobileVerticalHeight();
|
|
@@ -171,8 +169,8 @@ class BbDialogModal {
|
|
|
171
169
|
? this._renderer.removeStyle(element, 'overflow')
|
|
172
170
|
: this._renderer.setStyle(element, 'overflow', 'hidden');
|
|
173
171
|
}
|
|
174
|
-
static
|
|
175
|
-
static
|
|
172
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbDialogModal, deps: [{ token: i1.Patch }, { token: i0.Renderer2 }, { token: DOCUMENT, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
173
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.1.0", type: BbDialogModal, isStandalone: true, selector: "[bb-dialog-modal]", inputs: { maxWidth: "maxWidth", withoutBodyPadding: ["withoutBodyPadding", "withoutBodyPadding", booleanAttribute] }, host: { attributes: { "role": "dialog" }, listeners: { "click": "onOverlayClickedEvent($event)", "touchstart": "onOverlayClickedEvent($event)", "touchend": "onOverlayClickedEvent($event)", "mouseup": "onOverlayClickedEvent($event)", "mousedown": "onOverlayClickedEvent($event)" }, 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;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"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
176
174
|
}
|
|
177
175
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbDialogModal, decorators: [{
|
|
178
176
|
type: Component,
|
|
@@ -212,12 +210,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
212
210
|
}] } });
|
|
213
211
|
|
|
214
212
|
class BbDialogHeader {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}
|
|
219
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbDialogHeader, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
220
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.0", 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 }); }
|
|
213
|
+
// Outputs.
|
|
214
|
+
closeRequested = new EventEmitter();
|
|
215
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbDialogHeader, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
216
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.0", 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 });
|
|
221
217
|
}
|
|
222
218
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbDialogHeader, decorators: [{
|
|
223
219
|
type: Component,
|
|
@@ -227,8 +223,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
227
223
|
}] } });
|
|
228
224
|
|
|
229
225
|
class BbDialogLink {
|
|
230
|
-
static
|
|
231
|
-
static
|
|
226
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbDialogLink, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
227
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.0", 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 });
|
|
232
228
|
}
|
|
233
229
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbDialogLink, decorators: [{
|
|
234
230
|
type: Component,
|
|
@@ -236,8 +232,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
236
232
|
}] });
|
|
237
233
|
|
|
238
234
|
class BbDialogActions {
|
|
239
|
-
static
|
|
240
|
-
static
|
|
235
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbDialogActions, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
236
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.0", 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 });
|
|
241
237
|
}
|
|
242
238
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbDialogActions, decorators: [{
|
|
243
239
|
type: Component,
|
|
@@ -273,11 +269,12 @@ const bbDialogContainerAnimation = trigger('bbDialogContainerAnimation', [
|
|
|
273
269
|
]);
|
|
274
270
|
|
|
275
271
|
class BbDialogInsertion {
|
|
272
|
+
viewContainerRef;
|
|
276
273
|
constructor(viewContainerRef) {
|
|
277
274
|
this.viewContainerRef = viewContainerRef;
|
|
278
275
|
}
|
|
279
|
-
static
|
|
280
|
-
static
|
|
276
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbDialogInsertion, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
277
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.1.0", type: BbDialogInsertion, isStandalone: true, selector: "[bbDialogInsertion]", ngImport: i0 });
|
|
281
278
|
}
|
|
282
279
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbDialogInsertion, decorators: [{
|
|
283
280
|
type: Directive,
|
|
@@ -288,22 +285,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
288
285
|
}], ctorParameters: () => [{ type: i0.ViewContainerRef }] });
|
|
289
286
|
|
|
290
287
|
class BbDialogContainer {
|
|
288
|
+
// Dependencies.
|
|
289
|
+
_config = inject(DIALOG_CONFIG, { optional: true });
|
|
290
|
+
_elementRef = inject(ElementRef);
|
|
291
|
+
// Readonly data.
|
|
292
|
+
disableContainerAnimations = this._config?.disableContainerAnimations ?? false;
|
|
293
|
+
// Views.
|
|
294
|
+
insertion;
|
|
295
|
+
// Data.
|
|
296
|
+
componentRef = null;
|
|
297
|
+
childComponentType = null;
|
|
298
|
+
// State.
|
|
299
|
+
overlayClicked$ = new Subject();
|
|
300
|
+
// Subscription.
|
|
301
|
+
_subscription = new Subscription();
|
|
291
302
|
get onOverlayClicked() {
|
|
292
303
|
return this.overlayClicked$.pipe(take(1));
|
|
293
304
|
}
|
|
294
|
-
constructor(_elementRef, _config) {
|
|
295
|
-
this._elementRef = _elementRef;
|
|
296
|
-
this._config = _config;
|
|
297
|
-
// Readonly data.
|
|
298
|
-
this.disableContainerAnimations = this._config?.disableContainerAnimations ?? false;
|
|
299
|
-
// Data.
|
|
300
|
-
this.componentRef = null;
|
|
301
|
-
this.childComponentType = null;
|
|
302
|
-
// State.
|
|
303
|
-
this.overlayClicked$ = new Subject();
|
|
304
|
-
// Subscription.
|
|
305
|
-
this._subscription = new Subscription();
|
|
306
|
-
}
|
|
307
305
|
ngOnInit() {
|
|
308
306
|
// Load the child component.
|
|
309
307
|
this.loadChildComponent(this.childComponentType);
|
|
@@ -343,8 +341,8 @@ class BbDialogContainer {
|
|
|
343
341
|
// Create an instance of the component.
|
|
344
342
|
this.componentRef = viewContainerRef.createComponent(componentType);
|
|
345
343
|
}
|
|
346
|
-
static
|
|
347
|
-
static
|
|
344
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbDialogContainer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
345
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.0", type: BbDialogContainer, isStandalone: true, selector: "bb-dialog-container", host: { listeners: { "@bbDialogContainerAnimation.done": "onAnimationDone($event)" }, properties: { "@bbDialogContainerAnimation": "true", "@.disabled": "disableContainerAnimations" }, classAttribute: "bb-dialog-container" }, viewQueries: [{ propertyName: "insertion", first: true, predicate: BbDialogInsertion, descendants: true, static: true }], ngImport: i0, template: "<div 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;will-change:opacity,transform}\n"], dependencies: [{ kind: "directive", type: BbDialogInsertion, selector: "[bbDialogInsertion]" }], animations: [bbDialogContainerAnimation], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
348
346
|
}
|
|
349
347
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbDialogContainer, decorators: [{
|
|
350
348
|
type: Component,
|
|
@@ -353,12 +351,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
353
351
|
'[@bbDialogContainerAnimation]': 'true',
|
|
354
352
|
'[@.disabled]': 'disableContainerAnimations'
|
|
355
353
|
}, preserveWhitespaces: false, animations: [bbDialogContainerAnimation], standalone: true, imports: [BbDialogInsertion], template: "<div 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;will-change:opacity,transform}\n"] }]
|
|
356
|
-
}],
|
|
357
|
-
type: Optional
|
|
358
|
-
}, {
|
|
359
|
-
type: Inject,
|
|
360
|
-
args: [DIALOG_CONFIG]
|
|
361
|
-
}] }], propDecorators: { insertion: [{
|
|
354
|
+
}], propDecorators: { insertion: [{
|
|
362
355
|
type: ViewChild,
|
|
363
356
|
args: [BbDialogInsertion, { static: true }]
|
|
364
357
|
}], onAnimationDone: [{
|
|
@@ -368,19 +361,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
368
361
|
|
|
369
362
|
let nextUniqueId = 0;
|
|
370
363
|
class BbDialogConfirm {
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
364
|
+
// Dependencies.
|
|
365
|
+
_config = inject(BbDialogConfig);
|
|
366
|
+
_dialogRef = inject(BbDialogRef);
|
|
367
|
+
// Readonly data.
|
|
368
|
+
dialogId = `bb-dialog-confirm-${nextUniqueId++}`;
|
|
369
|
+
title = this._config?.data?.title ?? null;
|
|
370
|
+
description = this._config?.data?.description ?? null;
|
|
371
|
+
confirmButtonText = this._config?.data?.confirmButtonText ?? 'dialog.default_confirm_button';
|
|
372
|
+
cancelButtonText = this._config?.data?.cancelButtonText ?? 'dialog.default_cancel_button';
|
|
373
|
+
confirmButtonClass = this._config?.data?.confirmButtonClass ?? null;
|
|
374
|
+
cancelButtonClass = this._config?.data?.cancelButtonClass ?? null;
|
|
375
|
+
width = this._config?.data?.width ?? '30rem';
|
|
376
|
+
// Views.
|
|
377
|
+
confirmButton;
|
|
384
378
|
ngAfterViewInit() {
|
|
385
379
|
// Initial focus the button.
|
|
386
380
|
this.confirmButton?.focus();
|
|
@@ -388,18 +382,20 @@ class BbDialogConfirm {
|
|
|
388
382
|
onClose(result) {
|
|
389
383
|
this._dialogRef.close(result);
|
|
390
384
|
}
|
|
391
|
-
static
|
|
392
|
-
static
|
|
385
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbDialogConfirm, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
386
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.0", 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 });
|
|
393
387
|
}
|
|
394
388
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbDialogConfirm, decorators: [{
|
|
395
389
|
type: Component,
|
|
396
390
|
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"] }]
|
|
397
|
-
}],
|
|
391
|
+
}], propDecorators: { confirmButton: [{
|
|
398
392
|
type: ViewChild,
|
|
399
393
|
args: ['confirm', { read: BbButton, static: false }]
|
|
400
394
|
}] } });
|
|
401
395
|
|
|
402
396
|
class Dialog {
|
|
397
|
+
_applicationRef;
|
|
398
|
+
_environmentInjector;
|
|
403
399
|
constructor(_applicationRef, _environmentInjector) {
|
|
404
400
|
this._applicationRef = _applicationRef;
|
|
405
401
|
this._environmentInjector = _environmentInjector;
|
|
@@ -452,8 +448,8 @@ class Dialog {
|
|
|
452
448
|
dialogComponentRef.destroy();
|
|
453
449
|
dialogComponentRef = null;
|
|
454
450
|
}
|
|
455
|
-
static
|
|
456
|
-
static
|
|
451
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: Dialog, deps: [{ token: i0.ApplicationRef }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
452
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: Dialog, providedIn: 'root' });
|
|
457
453
|
}
|
|
458
454
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: Dialog, decorators: [{
|
|
459
455
|
type: Injectable,
|
|
@@ -463,17 +459,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
463
459
|
}], ctorParameters: () => [{ type: i0.ApplicationRef }, { type: i0.EnvironmentInjector }] });
|
|
464
460
|
|
|
465
461
|
class BbConfirm {
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
this.confirm = new EventEmitter();
|
|
476
|
-
}
|
|
462
|
+
// Dependencies.
|
|
463
|
+
_dialog = inject(Dialog);
|
|
464
|
+
// Inputs.
|
|
465
|
+
bbConfirmTitle = 'dialog.default_title';
|
|
466
|
+
bbConfirmDescription = 'dialog.default_description';
|
|
467
|
+
bbConfirmButtonText = null;
|
|
468
|
+
bbCancelButtonText = null;
|
|
469
|
+
// Outputs.
|
|
470
|
+
confirm = new EventEmitter();
|
|
477
471
|
async onClick(event) {
|
|
478
472
|
const confirmed = await this._dialog.confirm(this.bbConfirmTitle, this.bbConfirmDescription, {
|
|
479
473
|
confirmButtonText: this.bbConfirmButtonText,
|
|
@@ -484,8 +478,8 @@ class BbConfirm {
|
|
|
484
478
|
}
|
|
485
479
|
this.confirm.emit(event);
|
|
486
480
|
}
|
|
487
|
-
static
|
|
488
|
-
static
|
|
481
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbConfirm, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
482
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.1.0", 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 });
|
|
489
483
|
}
|
|
490
484
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbConfirm, decorators: [{
|
|
491
485
|
type: Directive,
|
|
@@ -524,8 +518,8 @@ class DialogModule {
|
|
|
524
518
|
]
|
|
525
519
|
};
|
|
526
520
|
}
|
|
527
|
-
static
|
|
528
|
-
static
|
|
521
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: DialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
522
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.0", ngImport: i0, type: DialogModule, imports: [BbDialogContainer,
|
|
529
523
|
BbDialogOverlay,
|
|
530
524
|
BbDialogModal,
|
|
531
525
|
BbDialogHeader,
|
|
@@ -538,9 +532,9 @@ class DialogModule {
|
|
|
538
532
|
BbDialogHeader,
|
|
539
533
|
BbDialogLink,
|
|
540
534
|
BbDialogActions,
|
|
541
|
-
BbConfirm] });
|
|
542
|
-
static
|
|
543
|
-
BbDialogConfirm] });
|
|
535
|
+
BbConfirm] });
|
|
536
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: DialogModule, imports: [BbDialogActions,
|
|
537
|
+
BbDialogConfirm] });
|
|
544
538
|
}
|
|
545
539
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: DialogModule, decorators: [{
|
|
546
540
|
type: NgModule,
|