@bravura/ui 3.8.1 → 4.0.0
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/CHANGELOG.md +579 -565
- package/LICENSE +6 -6
- package/README.md +56 -54
- package/alert/alert-container.component.d.ts +1 -1
- package/alert/alert-message.component.d.ts +1 -1
- package/behavior/await.directive.d.ts +1 -1
- package/behavior/observe-content-class.directive.d.ts +1 -1
- package/behavior/sizing.directive.d.ts +1 -1
- package/clip-note/clip-note.directive.d.ts +1 -1
- package/currency-input/currency-input.directive.d.ts +1 -1
- package/decimal-input/decimal-input.directive.d.ts +1 -1
- package/discrete-input/discrete-input.component.d.ts +1 -1
- package/esm2022/alert/alert-container.component.mjs +207 -0
- package/esm2022/alert/alert-message.component.mjs +101 -0
- package/esm2022/alert/alert.module.mjs +22 -0
- package/{esm2020 → esm2022}/alert/public-api.mjs +1 -1
- package/esm2022/alert/testing/test-api.mjs +44 -0
- package/{esm2020 → esm2022}/behavior/await.directive.mjs +6 -6
- package/esm2022/behavior/behavior.module.mjs +37 -0
- package/{esm2020 → esm2022}/behavior/observe-content-class.directive.mjs +5 -5
- package/{esm2020 → esm2022}/behavior/public-api.mjs +1 -1
- package/esm2022/behavior/sizing-monitor.directive.mjs +31 -0
- package/esm2022/behavior/sizing.directive.mjs +256 -0
- package/esm2022/clip-note/clip-note.component.mjs +216 -0
- package/esm2022/clip-note/clip-note.directive.mjs +141 -0
- package/esm2022/clip-note/clip-note.module.mjs +32 -0
- package/{esm2020 → esm2022}/clip-note/public-api.mjs +1 -1
- package/{esm2020 → esm2022}/common/common-utils.mjs +1 -1
- package/{esm2020 → esm2022}/common/common.module.mjs +7 -7
- package/{esm2020 → esm2022}/common/public-api.mjs +1 -1
- package/{esm2020 → esm2022}/currency-input/currency-input.directive.mjs +6 -6
- package/esm2022/currency-input/currency-input.module.mjs +19 -0
- package/{esm2020 → esm2022}/currency-input/public-api.mjs +1 -1
- package/{esm2020 → esm2022}/decimal-input/decimal-input.directive.mjs +9 -9
- package/{esm2020 → esm2022}/decimal-input/decimal-input.module.mjs +5 -5
- package/esm2022/discrete-input/discrete-input.component.mjs +337 -0
- package/esm2022/discrete-input/discrete-input.module.mjs +21 -0
- package/{esm2020 → esm2022}/discrete-input/public-api.mjs +1 -1
- package/esm2022/file-upload/file-upload.component.mjs +400 -0
- package/esm2022/file-upload/file-upload.module.mjs +44 -0
- package/esm2022/file-upload/file-upload.service.mjs +29 -0
- package/{esm2020 → esm2022}/file-upload/public-api.mjs +1 -1
- package/esm2022/form-field/form-field.component.mjs +82 -0
- package/esm2022/form-field/form-field.module.mjs +33 -0
- package/{esm2020 → esm2022}/form-field/public-api.mjs +1 -1
- package/esm2022/icon-font/icon-font.module.mjs +22 -0
- package/{esm2020 → esm2022}/icon-font/icon.directive.mjs +5 -5
- package/{esm2020 → esm2022}/icon-font/public-api.mjs +1 -1
- package/{esm2020 → esm2022}/icon-font/utilities.mjs +1 -1
- package/esm2022/panel/panel-section.component.mjs +41 -0
- package/esm2022/panel/panel.component.mjs +87 -0
- package/esm2022/panel/panel.module.mjs +23 -0
- package/{esm2020 → esm2022}/panel/public-api.mjs +1 -1
- package/esm2022/panel/tinted.directive.mjs +60 -0
- package/esm2022/phone-number/phone-number.directive.mjs +188 -0
- package/{esm2020 → esm2022}/phone-number/phone-number.module.mjs +5 -5
- package/{esm2020 → esm2022}/phone-number/phone-number.pipe.mjs +6 -6
- package/esm2022/phone-number/phone-number.validator.mjs +64 -0
- package/{esm2020 → esm2022}/phone-number/public-api.mjs +1 -1
- package/{esm2020 → esm2022}/public-api.mjs +1 -1
- package/esm2022/radio-panel/radio-panel-item.component.mjs +93 -0
- package/esm2022/radio-panel/radio-panel.component.mjs +81 -0
- package/{esm2020 → esm2022}/radio-panel/radio-panel.module.mjs +5 -5
- package/esm2022/radio-panel/testing/test-api.mjs +46 -0
- package/{esm2020 → esm2022}/selection-panel/public-api.mjs +1 -1
- package/esm2022/selection-panel/selection-panel-item.component.mjs +166 -0
- package/esm2022/selection-panel/selection-panel.directive.mjs +119 -0
- package/esm2022/selection-panel/selection-panel.module.mjs +23 -0
- package/{esm2020 → esm2022}/skeletons/public-api.mjs +1 -1
- package/esm2022/skeletons/skeleton-loader-presets.directive.mjs +83 -0
- package/{esm2020 → esm2022}/skeletons/skeleton-loader.component.mjs +5 -5
- package/esm2022/skeletons/skeletons.module.mjs +35 -0
- package/{esm2020 → esm2022}/stepper/public-api.mjs +1 -1
- package/{esm2020 → esm2022}/stepper/stepper-animation.mjs +1 -1
- package/esm2022/stepper/stepper.component.mjs +176 -0
- package/esm2022/stepper/stepper.module.mjs +52 -0
- package/{esm2020 → esm2022}/tooltip/public-api.mjs +1 -1
- package/esm2022/tooltip/tooltip.component.mjs +63 -0
- package/esm2022/tooltip/tooltip.directive.mjs +148 -0
- package/esm2022/tooltip/tooltip.module.mjs +25 -0
- package/{fesm2020 → fesm2022}/bravura-ui-alert-testing.mjs +2 -2
- package/fesm2022/bravura-ui-alert-testing.mjs.map +1 -0
- package/fesm2022/bravura-ui-alert.mjs +327 -0
- package/fesm2022/bravura-ui-alert.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-behavior.mjs +45 -45
- package/fesm2022/bravura-ui-behavior.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-clip-note.mjs +70 -70
- package/fesm2022/bravura-ui-clip-note.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-common.mjs +6 -6
- package/fesm2022/bravura-ui-common.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-currency-input.mjs +11 -11
- package/fesm2022/bravura-ui-currency-input.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-decimal-input.mjs +12 -12
- package/fesm2022/bravura-ui-decimal-input.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-discrete-input.mjs +48 -48
- package/fesm2022/bravura-ui-discrete-input.mjs.map +1 -0
- package/fesm2022/bravura-ui-file-upload.mjs +474 -0
- package/fesm2022/bravura-ui-file-upload.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-form-field.mjs +19 -19
- package/fesm2022/bravura-ui-form-field.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-icon-font.mjs +8 -8
- package/fesm2022/bravura-ui-icon-font.mjs.map +1 -0
- package/fesm2022/bravura-ui-panel.mjs +206 -0
- package/fesm2022/bravura-ui-panel.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-phone-number.mjs +30 -30
- package/fesm2022/bravura-ui-phone-number.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-radio-panel-testing.mjs +5 -6
- package/fesm2022/bravura-ui-radio-panel-testing.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-radio-panel.mjs +31 -31
- package/fesm2022/bravura-ui-radio-panel.mjs.map +1 -0
- package/fesm2022/bravura-ui-selection-panel.mjs +306 -0
- package/fesm2022/bravura-ui-selection-panel.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-skeletons.mjs +43 -43
- package/fesm2022/bravura-ui-skeletons.mjs.map +1 -0
- package/fesm2022/bravura-ui-stepper.mjs +251 -0
- package/fesm2022/bravura-ui-stepper.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-tooltip.mjs +32 -24
- package/fesm2022/bravura-ui-tooltip.mjs.map +1 -0
- package/fesm2022/bravura-ui.mjs.map +1 -0
- package/file-upload/file-upload.component.d.ts +1 -1
- package/form-field/form-field.component.d.ts +1 -1
- package/icon-font/icon.directive.d.ts +1 -1
- package/package.json +76 -120
- package/panel/panel.component.d.ts +1 -1
- package/panel/tinted.directive.d.ts +1 -1
- package/phone-number/phone-number.directive.d.ts +1 -1
- package/phone-number/phone-number.validator.d.ts +2 -2
- package/radio-panel/radio-panel-item.component.d.ts +1 -1
- package/radio-panel/radio-panel.component.d.ts +1 -1
- package/radio-panel/testing/test-api.d.ts +2 -3
- package/selection-panel/selection-panel-item.component.d.ts +1 -1
- package/selection-panel/selection-panel.directive.d.ts +1 -1
- package/skeletons/skeleton-loader-presets.directive.d.ts +3 -3
- package/stepper/stepper.component.d.ts +1 -1
- package/theme/_bui-card.scss +56 -56
- package/theme/_ui-theme.scss +112 -112
- package/theme/global-style-by-bootstrap.scss +3 -3
- package/theme/global-style-by-tailwind.scss +3 -3
- package/theme/scrollbar.scss +40 -40
- package/tooltip/tooltip.component.d.ts +2 -0
- package/tooltip/tooltip.directive.d.ts +3 -5
- package/esm2020/alert/alert-container.component.mjs +0 -207
- package/esm2020/alert/alert-message.component.mjs +0 -102
- package/esm2020/alert/alert.module.mjs +0 -22
- package/esm2020/alert/testing/test-api.mjs +0 -44
- package/esm2020/behavior/behavior.module.mjs +0 -37
- package/esm2020/behavior/sizing-monitor.directive.mjs +0 -31
- package/esm2020/behavior/sizing.directive.mjs +0 -256
- package/esm2020/clip-note/clip-note.component.mjs +0 -216
- package/esm2020/clip-note/clip-note.directive.mjs +0 -141
- package/esm2020/clip-note/clip-note.module.mjs +0 -32
- package/esm2020/currency-input/currency-input.module.mjs +0 -19
- package/esm2020/discrete-input/discrete-input.component.mjs +0 -337
- package/esm2020/discrete-input/discrete-input.module.mjs +0 -21
- package/esm2020/file-upload/file-upload.component.mjs +0 -400
- package/esm2020/file-upload/file-upload.module.mjs +0 -44
- package/esm2020/file-upload/file-upload.service.mjs +0 -29
- package/esm2020/form-field/form-field.component.mjs +0 -82
- package/esm2020/form-field/form-field.module.mjs +0 -33
- package/esm2020/icon-font/icon-font.module.mjs +0 -22
- package/esm2020/panel/panel-section.component.mjs +0 -41
- package/esm2020/panel/panel.component.mjs +0 -87
- package/esm2020/panel/panel.module.mjs +0 -23
- package/esm2020/panel/tinted.directive.mjs +0 -60
- package/esm2020/phone-number/phone-number.directive.mjs +0 -188
- package/esm2020/phone-number/phone-number.validator.mjs +0 -64
- package/esm2020/radio-panel/radio-panel-item.component.mjs +0 -93
- package/esm2020/radio-panel/radio-panel.component.mjs +0 -81
- package/esm2020/radio-panel/testing/test-api.mjs +0 -47
- package/esm2020/selection-panel/selection-panel-item.component.mjs +0 -166
- package/esm2020/selection-panel/selection-panel.directive.mjs +0 -119
- package/esm2020/selection-panel/selection-panel.module.mjs +0 -23
- package/esm2020/skeletons/skeleton-loader-presets.directive.mjs +0 -83
- package/esm2020/skeletons/skeletons.module.mjs +0 -35
- package/esm2020/stepper/stepper.component.mjs +0 -176
- package/esm2020/stepper/stepper.module.mjs +0 -52
- package/esm2020/tooltip/tooltip.component.mjs +0 -54
- package/esm2020/tooltip/tooltip.directive.mjs +0 -149
- package/esm2020/tooltip/tooltip.module.mjs +0 -25
- package/fesm2015/bravura-ui-alert-testing.mjs +0 -64
- package/fesm2015/bravura-ui-alert-testing.mjs.map +0 -1
- package/fesm2015/bravura-ui-alert.mjs +0 -340
- package/fesm2015/bravura-ui-alert.mjs.map +0 -1
- package/fesm2015/bravura-ui-behavior.mjs +0 -515
- package/fesm2015/bravura-ui-behavior.mjs.map +0 -1
- package/fesm2015/bravura-ui-clip-note.mjs +0 -393
- package/fesm2015/bravura-ui-clip-note.mjs.map +0 -1
- package/fesm2015/bravura-ui-common.mjs +0 -96
- package/fesm2015/bravura-ui-common.mjs.map +0 -1
- package/fesm2015/bravura-ui-currency-input.mjs +0 -300
- package/fesm2015/bravura-ui-currency-input.mjs.map +0 -1
- package/fesm2015/bravura-ui-decimal-input.mjs +0 -145
- package/fesm2015/bravura-ui-decimal-input.mjs.map +0 -1
- package/fesm2015/bravura-ui-discrete-input.mjs +0 -365
- package/fesm2015/bravura-ui-discrete-input.mjs.map +0 -1
- package/fesm2015/bravura-ui-file-upload.mjs +0 -478
- package/fesm2015/bravura-ui-file-upload.mjs.map +0 -1
- package/fesm2015/bravura-ui-form-field.mjs +0 -120
- package/fesm2015/bravura-ui-form-field.mjs.map +0 -1
- package/fesm2015/bravura-ui-icon-font.mjs +0 -178
- package/fesm2015/bravura-ui-icon-font.mjs.map +0 -1
- package/fesm2015/bravura-ui-panel.mjs +0 -210
- package/fesm2015/bravura-ui-panel.mjs.map +0 -1
- package/fesm2015/bravura-ui-phone-number.mjs +0 -327
- package/fesm2015/bravura-ui-phone-number.mjs.map +0 -1
- package/fesm2015/bravura-ui-radio-panel-testing.mjs +0 -63
- package/fesm2015/bravura-ui-radio-panel-testing.mjs.map +0 -1
- package/fesm2015/bravura-ui-radio-panel.mjs +0 -200
- package/fesm2015/bravura-ui-radio-panel.mjs.map +0 -1
- package/fesm2015/bravura-ui-selection-panel.mjs +0 -311
- package/fesm2015/bravura-ui-selection-panel.mjs.map +0 -1
- package/fesm2015/bravura-ui-skeletons.mjs +0 -195
- package/fesm2015/bravura-ui-skeletons.mjs.map +0 -1
- package/fesm2015/bravura-ui-stepper.mjs +0 -253
- package/fesm2015/bravura-ui-stepper.mjs.map +0 -1
- package/fesm2015/bravura-ui-tooltip.mjs +0 -229
- package/fesm2015/bravura-ui-tooltip.mjs.map +0 -1
- package/fesm2015/bravura-ui.mjs.map +0 -1
- package/fesm2020/bravura-ui-alert-testing.mjs.map +0 -1
- package/fesm2020/bravura-ui-alert.mjs +0 -328
- package/fesm2020/bravura-ui-alert.mjs.map +0 -1
- package/fesm2020/bravura-ui-behavior.mjs.map +0 -1
- package/fesm2020/bravura-ui-clip-note.mjs.map +0 -1
- package/fesm2020/bravura-ui-common.mjs.map +0 -1
- package/fesm2020/bravura-ui-currency-input.mjs.map +0 -1
- package/fesm2020/bravura-ui-decimal-input.mjs.map +0 -1
- package/fesm2020/bravura-ui-discrete-input.mjs.map +0 -1
- package/fesm2020/bravura-ui-file-upload.mjs +0 -474
- package/fesm2020/bravura-ui-file-upload.mjs.map +0 -1
- package/fesm2020/bravura-ui-form-field.mjs.map +0 -1
- package/fesm2020/bravura-ui-icon-font.mjs.map +0 -1
- package/fesm2020/bravura-ui-panel.mjs +0 -206
- package/fesm2020/bravura-ui-panel.mjs.map +0 -1
- package/fesm2020/bravura-ui-phone-number.mjs.map +0 -1
- package/fesm2020/bravura-ui-radio-panel-testing.mjs.map +0 -1
- package/fesm2020/bravura-ui-radio-panel.mjs.map +0 -1
- package/fesm2020/bravura-ui-selection-panel.mjs +0 -306
- package/fesm2020/bravura-ui-selection-panel.mjs.map +0 -1
- package/fesm2020/bravura-ui-skeletons.mjs.map +0 -1
- package/fesm2020/bravura-ui-stepper.mjs +0 -251
- package/fesm2020/bravura-ui-stepper.mjs.map +0 -1
- package/fesm2020/bravura-ui-tooltip.mjs.map +0 -1
- package/fesm2020/bravura-ui.mjs +0 -8
- package/fesm2020/bravura-ui.mjs.map +0 -1
- /package/{esm2020 → esm2022}/alert/bravura-ui-alert.mjs +0 -0
- /package/{esm2020 → esm2022}/alert/testing/bravura-ui-alert-testing.mjs +0 -0
- /package/{esm2020 → esm2022}/behavior/bravura-ui-behavior.mjs +0 -0
- /package/{esm2020 → esm2022}/bravura-ui.mjs +0 -0
- /package/{esm2020 → esm2022}/clip-note/bravura-ui-clip-note.mjs +0 -0
- /package/{esm2020 → esm2022}/common/bravura-ui-common.mjs +0 -0
- /package/{esm2020 → esm2022}/currency-input/bravura-ui-currency-input.mjs +0 -0
- /package/{esm2020 → esm2022}/decimal-input/bravura-ui-decimal-input.mjs +0 -0
- /package/{esm2020 → esm2022}/decimal-input/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/discrete-input/bravura-ui-discrete-input.mjs +0 -0
- /package/{esm2020 → esm2022}/file-upload/bravura-ui-file-upload.mjs +0 -0
- /package/{esm2020 → esm2022}/form-field/bravura-ui-form-field.mjs +0 -0
- /package/{esm2020 → esm2022}/icon-font/bravura-ui-icon-font.mjs +0 -0
- /package/{esm2020 → esm2022}/panel/bravura-ui-panel.mjs +0 -0
- /package/{esm2020 → esm2022}/phone-number/bravura-ui-phone-number.mjs +0 -0
- /package/{esm2020 → esm2022}/radio-panel/bravura-ui-radio-panel.mjs +0 -0
- /package/{esm2020 → esm2022}/radio-panel/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/radio-panel/testing/bravura-ui-radio-panel-testing.mjs +0 -0
- /package/{esm2020 → esm2022}/selection-panel/bravura-ui-selection-panel.mjs +0 -0
- /package/{esm2020 → esm2022}/skeletons/bravura-ui-skeletons.mjs +0 -0
- /package/{esm2020 → esm2022}/stepper/bravura-ui-stepper.mjs +0 -0
- /package/{esm2020 → esm2022}/tooltip/bravura-ui-tooltip.mjs +0 -0
- /package/{fesm2015 → fesm2022}/bravura-ui.mjs +0 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { DOCUMENT } from '@angular/common';
|
|
2
|
+
import { Directive, HostListener, Inject, Input, Optional, TemplateRef, forwardRef } from '@angular/core';
|
|
3
|
+
import { MAT_TOOLTIP_DEFAULT_OPTIONS, MAT_TOOLTIP_SCROLL_STRATEGY, MatTooltip } from '@angular/material/tooltip';
|
|
4
|
+
import { Observable, Subject } from 'rxjs';
|
|
5
|
+
import { BUI_TOOLTIP_TEMPLATE_REF } from './tooltip.component';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
import * as i1 from "@angular/cdk/overlay";
|
|
8
|
+
import * as i2 from "@angular/cdk/platform";
|
|
9
|
+
import * as i3 from "@angular/cdk/a11y";
|
|
10
|
+
import * as i4 from "@angular/cdk/bidi";
|
|
11
|
+
/**
|
|
12
|
+
* This directive extends [Angular Material tooltip](https://material.angular.io/components/tooltip/overview), with the additional capability of displaying
|
|
13
|
+
* HTML content in the overlay area.
|
|
14
|
+
*
|
|
15
|
+
* All the other features are identical as those in Angular Material tooltip.
|
|
16
|
+
*/
|
|
17
|
+
export class TooltipDirective extends MatTooltip {
|
|
18
|
+
constructor(overlay, elementRef, scrollDispatcher, viewContainerRef, ngZone, platform, ariaDescriber, focusMonitor, scrollStrategy, dir, defaultOptions, _document) {
|
|
19
|
+
super(overlay, elementRef, scrollDispatcher, viewContainerRef, ngZone, platform, ariaDescriber, focusMonitor, scrollStrategy, dir, defaultOptions, _document);
|
|
20
|
+
this._contentSub = new Subject().subscribe();
|
|
21
|
+
this.touchGestures = 'off';
|
|
22
|
+
const element = elementRef.nativeElement;
|
|
23
|
+
element.setAttribute('aria-hidden', 'false');
|
|
24
|
+
if (element.tabIndex === -1) {
|
|
25
|
+
element.tabIndex = 0;
|
|
26
|
+
element.setAttribute('aria-roledescription', 'tooltip');
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/** Allows the user to define the position of the tooltip relative to the parent element */
|
|
30
|
+
get buiTooltipPosition() {
|
|
31
|
+
return this.position;
|
|
32
|
+
}
|
|
33
|
+
set buiTooltipPosition(value) {
|
|
34
|
+
this.position = value;
|
|
35
|
+
}
|
|
36
|
+
/** Disables the display of the tooltip. */
|
|
37
|
+
get buiTooltipDisabled() {
|
|
38
|
+
return this.disabled;
|
|
39
|
+
}
|
|
40
|
+
set buiTooltipDisabled(value) {
|
|
41
|
+
this.disabled = value;
|
|
42
|
+
}
|
|
43
|
+
/** The message to be displayed in the tooltip. */
|
|
44
|
+
get buiTooltip() {
|
|
45
|
+
return this._templateRef || this.message;
|
|
46
|
+
}
|
|
47
|
+
set buiTooltip(value) {
|
|
48
|
+
this._contentSub.unsubscribe();
|
|
49
|
+
this._contentObs = undefined;
|
|
50
|
+
if (typeof value === 'string') {
|
|
51
|
+
this.message = value;
|
|
52
|
+
}
|
|
53
|
+
else if (value instanceof TemplateRef) {
|
|
54
|
+
this._templateRef = value;
|
|
55
|
+
if (value) {
|
|
56
|
+
this.message = '[bui-tooltip-template]';
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
this._templateRef = undefined;
|
|
60
|
+
this.message = '';
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
else if (value instanceof Observable) {
|
|
64
|
+
this.message = '...';
|
|
65
|
+
this._contentObs = value;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/** @ignore */
|
|
69
|
+
get template() {
|
|
70
|
+
return this._templateRef;
|
|
71
|
+
}
|
|
72
|
+
/** Classes to be passed to the tooltip. Supports the same syntax as `ngClass`. */
|
|
73
|
+
get buiTooltipClass() {
|
|
74
|
+
return this.tooltipClass;
|
|
75
|
+
}
|
|
76
|
+
set buiTooltipClass(value) {
|
|
77
|
+
this.tooltipClass = value;
|
|
78
|
+
}
|
|
79
|
+
/** @ignore */
|
|
80
|
+
clicked() {
|
|
81
|
+
this.toggle();
|
|
82
|
+
}
|
|
83
|
+
/** Shows the tooltip after the delay in ms, defaults to tooltip-delay-show or 0ms if no input */
|
|
84
|
+
show(delay = this.showDelay, origin) {
|
|
85
|
+
if (this._contentObs) {
|
|
86
|
+
this._contentSub.unsubscribe();
|
|
87
|
+
this._contentSub = this._contentObs.subscribe(c => {
|
|
88
|
+
this.message = c;
|
|
89
|
+
this._contentSub.unsubscribe();
|
|
90
|
+
super.show(delay, origin);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
super.show(delay, origin);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
ngOnDestroy() {
|
|
98
|
+
this._contentSub.unsubscribe();
|
|
99
|
+
}
|
|
100
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TooltipDirective, deps: [{ token: i1.Overlay }, { token: i0.ElementRef }, { token: i1.ScrollDispatcher }, { token: i0.ViewContainerRef }, { token: i0.NgZone }, { token: i2.Platform }, { token: i3.AriaDescriber }, { token: i3.FocusMonitor }, { token: MAT_TOOLTIP_SCROLL_STRATEGY }, { token: i4.Directionality, optional: true }, { token: MAT_TOOLTIP_DEFAULT_OPTIONS, optional: true }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
101
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.12", type: TooltipDirective, selector: "[buiTooltip]", inputs: { buiTooltipPosition: "buiTooltipPosition", buiTooltipDisabled: "buiTooltipDisabled", buiTooltip: "buiTooltip", buiTooltipClass: "buiTooltipClass" }, host: { listeners: { "click": "clicked()" }, classAttribute: "mat-tooltip-trigger bui-tooltip-trigger" }, providers: [
|
|
102
|
+
{
|
|
103
|
+
provide: BUI_TOOLTIP_TEMPLATE_REF,
|
|
104
|
+
useExisting: forwardRef(() => TooltipDirective)
|
|
105
|
+
}
|
|
106
|
+
], exportAs: ["buiTooltip"], usesInheritance: true, ngImport: i0 }); }
|
|
107
|
+
}
|
|
108
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TooltipDirective, decorators: [{
|
|
109
|
+
type: Directive,
|
|
110
|
+
args: [{
|
|
111
|
+
selector: '[buiTooltip]',
|
|
112
|
+
exportAs: 'buiTooltip',
|
|
113
|
+
host: {
|
|
114
|
+
class: 'mat-tooltip-trigger bui-tooltip-trigger'
|
|
115
|
+
},
|
|
116
|
+
providers: [
|
|
117
|
+
{
|
|
118
|
+
provide: BUI_TOOLTIP_TEMPLATE_REF,
|
|
119
|
+
useExisting: forwardRef(() => TooltipDirective)
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}]
|
|
123
|
+
}], ctorParameters: () => [{ type: i1.Overlay }, { type: i0.ElementRef }, { type: i1.ScrollDispatcher }, { type: i0.ViewContainerRef }, { type: i0.NgZone }, { type: i2.Platform }, { type: i3.AriaDescriber }, { type: i3.FocusMonitor }, { type: undefined, decorators: [{
|
|
124
|
+
type: Inject,
|
|
125
|
+
args: [MAT_TOOLTIP_SCROLL_STRATEGY]
|
|
126
|
+
}] }, { type: i4.Directionality, decorators: [{
|
|
127
|
+
type: Optional
|
|
128
|
+
}] }, { type: undefined, decorators: [{
|
|
129
|
+
type: Optional
|
|
130
|
+
}, {
|
|
131
|
+
type: Inject,
|
|
132
|
+
args: [MAT_TOOLTIP_DEFAULT_OPTIONS]
|
|
133
|
+
}] }, { type: undefined, decorators: [{
|
|
134
|
+
type: Inject,
|
|
135
|
+
args: [DOCUMENT]
|
|
136
|
+
}] }], propDecorators: { buiTooltipPosition: [{
|
|
137
|
+
type: Input
|
|
138
|
+
}], buiTooltipDisabled: [{
|
|
139
|
+
type: Input
|
|
140
|
+
}], buiTooltip: [{
|
|
141
|
+
type: Input
|
|
142
|
+
}], buiTooltipClass: [{
|
|
143
|
+
type: Input
|
|
144
|
+
}], clicked: [{
|
|
145
|
+
type: HostListener,
|
|
146
|
+
args: ['click']
|
|
147
|
+
}] } });
|
|
148
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9vbHRpcC5kaXJlY3RpdmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy91aS90b29sdGlwL3Rvb2x0aXAuZGlyZWN0aXZlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUlBLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUMzQyxPQUFPLEVBQ04sU0FBUyxFQUVULFlBQVksRUFDWixNQUFNLEVBQ04sS0FBSyxFQUVMLFFBQVEsRUFDUixXQUFXLEVBRVgsVUFBVSxFQUNWLE1BQU0sZUFBZSxDQUFDO0FBQ3ZCLE9BQU8sRUFDTiwyQkFBMkIsRUFDM0IsMkJBQTJCLEVBQzNCLFVBQVUsRUFHVixNQUFNLDJCQUEyQixDQUFDO0FBQ25DLE9BQU8sRUFBRSxVQUFVLEVBQUUsT0FBTyxFQUFnQixNQUFNLE1BQU0sQ0FBQztBQUN6RCxPQUFPLEVBQUUsd0JBQXdCLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQzs7Ozs7O0FBRS9EOzs7OztHQUtHO0FBY0gsTUFBTSxPQUFPLGdCQUFpQixTQUFRLFVBQVU7SUFNL0MsWUFDQyxPQUFnQixFQUNoQixVQUFtQyxFQUNuQyxnQkFBa0MsRUFDbEMsZ0JBQWtDLEVBQ2xDLE1BQWMsRUFDZCxRQUFrQixFQUN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aG93KGRlbGF5LCBvcmlnaW4pO1xyXG5cdFx0XHR9KTtcclxuXHRcdH0gZWxzZSB7XHJcblx0XHRcdHN1cGVyLnNob3coZGVsYXksIG9yaWdpbik7XHJcblx0XHR9XHJcblx0fVxyXG5cclxuXHRuZ09uRGVzdHJveSgpIHtcclxuXHRcdHRoaXMuX2NvbnRlbnRTdWIudW5zdWJzY3JpYmUoKTtcclxuXHR9XHJcbn1cclxuIl19
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { A11yModule } from '@angular/cdk/a11y';
|
|
2
|
+
import { OverlayModule } from '@angular/cdk/overlay';
|
|
3
|
+
import { CdkScrollableModule } from '@angular/cdk/scrolling';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { NgModule } from '@angular/core';
|
|
6
|
+
import { MatCommonModule } from '@angular/material/core';
|
|
7
|
+
import { MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY_PROVIDER } from '@angular/material/tooltip';
|
|
8
|
+
import { TooltipComponent } from './tooltip.component';
|
|
9
|
+
import { TooltipDirective } from './tooltip.directive';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
export class TooltipModule {
|
|
12
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TooltipModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
13
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: TooltipModule, declarations: [TooltipDirective, TooltipComponent], imports: [A11yModule, CommonModule, OverlayModule, MatCommonModule], exports: [TooltipDirective, MatCommonModule, CdkScrollableModule] }); }
|
|
14
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TooltipModule, providers: [MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY_PROVIDER], imports: [A11yModule, CommonModule, OverlayModule, MatCommonModule, MatCommonModule, CdkScrollableModule] }); }
|
|
15
|
+
}
|
|
16
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TooltipModule, decorators: [{
|
|
17
|
+
type: NgModule,
|
|
18
|
+
args: [{
|
|
19
|
+
imports: [A11yModule, CommonModule, OverlayModule, MatCommonModule],
|
|
20
|
+
exports: [TooltipDirective, MatCommonModule, CdkScrollableModule],
|
|
21
|
+
declarations: [TooltipDirective, TooltipComponent],
|
|
22
|
+
providers: [MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY_PROVIDER]
|
|
23
|
+
}]
|
|
24
|
+
}] });
|
|
25
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9vbHRpcC5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy91aS90b29sdGlwL3Rvb2x0aXAubW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUMvQyxPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDckQsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFDN0QsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQy9DLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDekMsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBQ3pELE9BQU8sRUFBRSw0Q0FBNEMsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQ3pGLE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQ3ZELE9BQU8s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b3JlJztcclxuaW1wb3J0IHsgTWF0Q29tbW9uTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvbWF0ZXJpYWwvY29yZSc7XHJcbmltcG9ydCB7IE1BVF9UT09MVElQX1NDUk9MTF9TVFJBVEVHWV9GQUNUT1JZX1BST1ZJREVSIH0gZnJvbSAnQGFuZ3VsYXIvbWF0ZXJpYWwvdG9vbHRpcCc7XHJcbmltcG9ydCB7IFRvb2x0aXBDb21wb25lbnQgfSBmcm9tICcuL3Rvb2x0aXAuY29tcG9uZW50JztcclxuaW1wb3J0IHsgVG9vbHRpcERpcmVjdGl2ZSB9IGZyb20gJy4vdG9vbHRpcC5kaXJlY3RpdmUnO1xyXG5cclxuQE5nTW9kdWxlKHtcclxuXHRpbXBvcnRzOiBbQTExeU1vZHVsZSwgQ29tbW9uTW9kdWxlLCBPdmVybGF5TW9kdWxlLCBNYXRDb21tb25Nb2R1bGVdLFxyXG5cdGV4cG9ydHM6IFtUb29sdGlwRGlyZWN0aXZlLCBNYXRDb21tb25Nb2R1bGUsIENka1Njcm9sbGFibGVNb2R1bGVdLFxyXG5cdGRlY2xhcmF0aW9uczogW1Rvb2x0aXBEaXJlY3RpdmUsIFRvb2x0aXBDb21wb25lbnRdLFxyXG5cdHByb3ZpZGVyczogW01BVF9UT09MVElQX1NDUk9MTF9TVFJBVEVHWV9GQUNUT1JZX1BST1ZJREVSXVxyXG59KVxyXG5leHBvcnQgY2xhc3MgVG9vbHRpcE1vZHVsZSB7fVxyXG4iXX0=
|
|
@@ -7,6 +7,7 @@ class AlertMessageHarness extends ComponentHarness {
|
|
|
7
7
|
this._getDeleteButton = this.locatorFor('.bui-alert-button');
|
|
8
8
|
this._getContentDiv = this.locatorFor('.bui-alert-content');
|
|
9
9
|
}
|
|
10
|
+
static { this.hostSelector = '.bui-alert'; }
|
|
10
11
|
static with(options = {}) {
|
|
11
12
|
return new HarnessPredicate(this, options).addOption('content', options.content, AlertMessageHarness.filterByContent);
|
|
12
13
|
}
|
|
@@ -24,13 +25,13 @@ class AlertMessageHarness extends ComponentHarness {
|
|
|
24
25
|
return content.test(contentText);
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
|
-
AlertMessageHarness.hostSelector = '.bui-alert';
|
|
28
28
|
class AlertContainerHarness extends ComponentHarness {
|
|
29
29
|
constructor() {
|
|
30
30
|
super(...arguments);
|
|
31
31
|
this._items = this.locatorForAll(AlertMessageHarness.with({ ancestor: '.bui-alert-fixed-panel' }));
|
|
32
32
|
this._floatingFrame = this.locatorFor('.bui-alert-float-panel-frame');
|
|
33
33
|
}
|
|
34
|
+
static { this.hostSelector = '.bui-alert-container'; }
|
|
34
35
|
getAlertItem(content) {
|
|
35
36
|
return this.locatorForOptional(AlertMessageHarness.with({ ancestor: '.bui-alert-fixed-panel', content }))();
|
|
36
37
|
}
|
|
@@ -41,7 +42,6 @@ class AlertContainerHarness extends ComponentHarness {
|
|
|
41
42
|
return (await (await this._floatingFrame()).getCssValue('display')) !== 'none';
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
|
-
AlertContainerHarness.hostSelector = '.bui-alert-container';
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* Generated bundle index. Do not edit.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bravura-ui-alert-testing.mjs","sources":["../../../projects/ui/alert/testing/test-api.ts","../../../projects/ui/alert/testing/bravura-ui-alert-testing.ts"],"sourcesContent":["import {\r\n\tComponentHarness,\r\n\tTextOptions,\r\n\tBaseHarnessFilters,\r\n\tComponentHarnessConstructor,\r\n\tHarnessPredicate\r\n} from '@angular/cdk/testing';\r\n\r\nexport interface AlertMessageHarnessFilters extends BaseHarnessFilters {\r\n\t/** only select the alert with the content matching this regular expression */\r\n\tcontent?: RegExp;\r\n}\r\n\r\nexport class AlertMessageHarness extends ComponentHarness {\r\n\tstatic hostSelector = '.bui-alert';\r\n\tprivate _getBackdrop = this.locatorFor('.bui-alert-backdrop');\r\n\tprivate _getDeleteButton = this.locatorFor('.bui-alert-button');\r\n\tprivate _getContentDiv = this.locatorFor('.bui-alert-content');\r\n\r\n\tstatic with<T extends AlertMessageHarness>(\r\n\t\tthis: ComponentHarnessConstructor<T>,\r\n\t\toptions: AlertMessageHarnessFilters = {}\r\n\t): HarnessPredicate<T> {\r\n\t\treturn new HarnessPredicate(this, options).addOption(\r\n\t\t\t'content',\r\n\t\t\toptions.content,\r\n\t\t\tAlertMessageHarness.filterByContent\r\n\t\t);\r\n\t}\r\n\r\n\tasync getColor(): Promise<string> {\r\n\t\treturn (await this._getBackdrop()).getCssValue('background-color');\r\n\t}\r\n\r\n\tasync delete(): Promise<void> {\r\n\t\tawait (await this._getDeleteButton()).click();\r\n\t}\r\n\r\n\tasync getContent(options?: TextOptions): Promise<string> {\r\n\t\treturn (await this._getContentDiv()).text(options);\r\n\t}\r\n\r\n\tprivate static async filterByContent(harness: AlertMessageHarness, content: RegExp): Promise<boolean> {\r\n\t\tconst contentText = await harness.getContent();\r\n\t\treturn content.test(contentText);\r\n\t}\r\n}\r\n\r\nexport class AlertContainerHarness extends ComponentHarness {\r\n\tstatic hostSelector = '.bui-alert-container';\r\n\r\n\tprivate _items = this.locatorForAll(AlertMessageHarness.with({ ancestor: '.bui-alert-fixed-panel' }));\r\n\tprivate _floatingFrame = this.locatorFor('.bui-alert-float-panel-frame');\r\n\r\n\tgetAlertItem(content: RegExp): Promise<AlertMessageHarness | null> {\r\n\t\treturn this.locatorForOptional(AlertMessageHarness.with({ ancestor: '.bui-alert-fixed-panel', content }))();\r\n\t}\r\n\r\n\tasync countAlertItems(): Promise<number> {\r\n\t\treturn (await this._items()).length;\r\n\t}\r\n\r\n\tasync isFloated(): Promise<boolean> {\r\n\t\treturn (await (await this._floatingFrame()).getCssValue('display')) !== 'none';\r\n\t}\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './test-api';\n"],"names":[],"mappings":";;AAaM,MAAO,mBAAoB,SAAQ,gBAAgB,CAAA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C,IAAI,CAAC,EAAE,QAAQ,EAAE,wBAAwB,EAAE,CAAC,CAAC,CAAC;AAC9F,QAAA,IAAA,CAAA,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC;KAazE;aAhBO,IAAY,CAAA,YAAA,GAAG,sBAAH,CAA0B,EAAA;AAK7C,IAAA,YAAY,CAAC,OAAe,EAAA;AAC3B,QAAA,OAAO,IAAI,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,wBAAwB,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC;KAC5G;AAED,IAAA,MAAM,eAAe,GAAA;QACpB,OAAO,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,EAAE,MAAM,CAAC;KACpC;AAED,IAAA,MAAM,SAAS,GAAA;AACd,QAAA,OAAO,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,cAAc,EAAE,EAAE,WAAW,CAAC,SAAS,CAAC,MAAM,MAAM,CAAC;KAC/E;;;AChEF;;AAEG;;;;"}
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import * as i2 from '@angular/common';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { EventEmitter, Component, ChangeDetectionStrategy, Input, Output, HostBinding, NgModule } from '@angular/core';
|
|
5
|
+
import * as i4 from '@angular/material/button';
|
|
6
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
7
|
+
import * as i3 from '@bravura/ui/icon-font';
|
|
8
|
+
import { IconFontModule } from '@bravura/ui/icon-font';
|
|
9
|
+
import { trigger, transition, style, animate, state } from '@angular/animations';
|
|
10
|
+
import { generateID, isElementInViewport } from '@bravura/ui/common';
|
|
11
|
+
import { Subject, timer } from 'rxjs';
|
|
12
|
+
import { takeUntil, take, tap, delay } from 'rxjs/operators';
|
|
13
|
+
import * as i1 from '@angular/cdk/scrolling';
|
|
14
|
+
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
15
|
+
import * as i2$1 from '@angular/material/icon';
|
|
16
|
+
|
|
17
|
+
/** @ignore */
|
|
18
|
+
const ICONS = {
|
|
19
|
+
success: 'check_circle',
|
|
20
|
+
info: 'info',
|
|
21
|
+
warn: 'report_problem',
|
|
22
|
+
error: 'cancel'
|
|
23
|
+
};
|
|
24
|
+
/** @ignore */
|
|
25
|
+
const DEFAULT_POLITENESS = {
|
|
26
|
+
success: 'polite',
|
|
27
|
+
info: 'polite',
|
|
28
|
+
warn: 'assertive',
|
|
29
|
+
error: 'assertive'
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* An alert style message usually appears in a global notification area.
|
|
33
|
+
*
|
|
34
|
+
* The base color of the message is determined by the `type` of the message and a list of predefined
|
|
35
|
+
* CSS custom properties.
|
|
36
|
+
*
|
|
37
|
+
* ```scss
|
|
38
|
+
* --bui-color-success: #519602;
|
|
39
|
+
* --bui-color-info: #0dcaf0;
|
|
40
|
+
* --bui-color-warning: #ffc107;
|
|
41
|
+
* --bui-color-error: #dc3545;
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
*
|
|
45
|
+
*/
|
|
46
|
+
class AlertMessageComponent {
|
|
47
|
+
/** Whether to display the button to fire the `dismissed` event. */
|
|
48
|
+
get dismissible() {
|
|
49
|
+
return this._dismissible;
|
|
50
|
+
}
|
|
51
|
+
set dismissible(value) {
|
|
52
|
+
this._dismissible = coerceBooleanProperty(value);
|
|
53
|
+
}
|
|
54
|
+
constructor() {
|
|
55
|
+
/** The type of the message, used to derive the icon and base color. */
|
|
56
|
+
this.type = 'error';
|
|
57
|
+
/** The message to be displayed, HTML supported. */
|
|
58
|
+
this.message = '';
|
|
59
|
+
/** To be emitted when the user choose to dismiss the message. The event object is the ID of the element. */
|
|
60
|
+
this.dismissed = new EventEmitter();
|
|
61
|
+
/** To be emitted when the component finishes initialisation. The event object is the ID of the element. */
|
|
62
|
+
this.initialised = new EventEmitter();
|
|
63
|
+
this._id = `bui-alert-${generateID()}`;
|
|
64
|
+
this._dismissible = false;
|
|
65
|
+
}
|
|
66
|
+
ngOnInit() {
|
|
67
|
+
this.politeness = this.politeness || DEFAULT_POLITENESS[this.type];
|
|
68
|
+
this.initialised.emit(this._id);
|
|
69
|
+
}
|
|
70
|
+
/** @ignore */
|
|
71
|
+
get iconName() {
|
|
72
|
+
return ICONS[this.type];
|
|
73
|
+
}
|
|
74
|
+
/** @ignore */
|
|
75
|
+
_dismiss() {
|
|
76
|
+
this.dismissed.emit(this._id);
|
|
77
|
+
}
|
|
78
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AlertMessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
79
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: AlertMessageComponent, selector: "bui-alert", inputs: { type: "type", message: "message", politeness: "politeness", dismissible: "dismissible", _id: ["id", "_id"] }, outputs: { dismissed: "dismissed", initialised: "initialised" }, host: { properties: { "class": "'bui-alert bui-host bui-alert-' + (type === 'warn' ? 'warning' : type) + (dismissible ? ' bui-alert-dismissible' : '')", "role": "politeness === 'off' ? 'region' : 'alert'", "attr.aria-live": "politeness === 'assertive' ? undefined : politeness", "id": "this._id" } }, ngImport: i0, template: "<div class=\"bui-alert-backdrop\"></div>\r\n<div class=\"bui-alert-frame\"></div>\r\n\r\n<div class=\"bui-alert-wrapper\">\r\n\t<div class=\"bui-alert-icon-area\">\r\n\t\t<mat-icon [buiIcon]=\"iconName\" variant=\"outlined\"></mat-icon>\r\n\t</div>\r\n\t<div class=\"bui-alert-content\">\r\n\t\t<div [innerHTML]=\"message\" *ngIf=\"message\"></div>\r\n\t\t<ng-content></ng-content>\r\n\t</div>\r\n</div>\r\n\r\n<div class=\"bui-alert-button-area\" *ngIf=\"dismissible\">\r\n\t<div class=\"bui-alert-button-backdrop\"></div>\r\n\t<button mat-icon-button class=\"bui-alert-button\" (click)=\"_dismiss()\" aria-label=\"dismiss alert\">\r\n\t\t<mat-icon>cancel</mat-icon>\r\n\t</button>\r\n</div>\r\n", styles: [":host(:not([hidden])){display:block;padding:12px 14px 12px 19px;position:relative;border-radius:5px}:host-context([dir=rtl]) :host(:not([hidden])){padding:12px 19px 12px 14px}:host(:not([hidden])),:host(:not([hidden])) *{box-sizing:border-box}.bui-alert-backdrop,.bui-alert-frame{position:absolute;inset:0}.bui-alert-backdrop{opacity:.1}:host(.bui-alert-dismissible) .bui-alert-backdrop{clip-path:polygon(0 0,calc(100% - 25px) 0,calc(100% - 18.75px) 18.75px,100% 25px,100% 100%,0 100%)}:host-context([dir=rtl]) :host(.bui-alert-dismissible) .bui-alert-backdrop{clip-path:polygon(0 25px,0 100%,100% 100%,100% 0,25px 0,18.75px 18.75px)}.bui-alert-frame{border-radius:5px;border-width:1px 1px 1px 5px;border-style:solid}:host-context([dir=rtl]) .bui-alert-frame{border-width:1px 5px 1px 1px}:host(.bui-alert-dismissible) .bui-alert-frame{clip-path:polygon(0 0,calc(100% - 25px) 0,calc(100% - 25px) 25px,100% 25px,100% 100%,0 100%)}:host-context([dir=rtl]) :host(.bui-alert-dismissible) .bui-alert-frame{clip-path:polygon(0 25px,0 100%,100% 100%,100% 0,25px 0)}.bui-alert-button-area{position:absolute;right:-15px;top:-15px;width:40px;height:40px;border-radius:20px;display:flex;align-items:center;justify-content:center}:host-context([dir=rtl]) .bui-alert-button-area{right:unset;left:-15px}.bui-alert-button-backdrop{position:absolute;border-radius:20px;width:100%;height:100%;clip-path:polygon(0 15px,25px 15px,25px 100%,0% 100%)}:host-context([dir=rtl]) .bui-alert-button-backdrop{clip-path:polygon(15px 15px,15px 100%,100% 100%,100% 15px)}.bui-alert-wrapper{display:flex;align-items:stretch}.bui-alert-icon-area{flex-shrink:0;display:flex;justify-content:center;align-items:center;border-radius:5px;width:30px;height:30px;margin-right:14px;color:var(--bui-bg-card)}:host-context([dir=rtl]) .bui-alert-icon-area{margin-right:unset;margin-left:14px}.bui-alert-content{z-index:1;flex-grow:1;display:flex;flex-direction:column;justify-content:center;gap:1rem}:host(.bui-alert-dismissible) .bui-alert-content{clip-path:polygon(0 0,calc(100% - 11px) 0,100% 13px,100% 100%,0 100%)}:host-context([dir=rtl]) :host(.bui-alert-dismissible) .bui-alert-content{clip-path:polygon(0 13px,0 100%,100% 100%,100% 0,11px 0)}:host(.bui-alert-success) .bui-alert-frame{border-color:var(--bui-color-success)}:host(.bui-alert-success) .bui-alert-backdrop,:host(.bui-alert-success) .bui-alert-icon-area{background-color:var(--bui-color-success)}:host(.bui-alert-success) .bui-alert-button-backdrop{border:1px var(--bui-color-success) solid}:host(.bui-alert-success) .bui-alert-button{color:var(--bui-color-success)}:host(.bui-alert-info) .bui-alert-frame{border-color:var(--bui-color-info)}:host(.bui-alert-info) .bui-alert-backdrop,:host(.bui-alert-info) .bui-alert-icon-area{background-color:var(--bui-color-info)}:host(.bui-alert-info) .bui-alert-button-backdrop{border:1px var(--bui-color-info) solid}:host(.bui-alert-info) .bui-alert-button{color:var(--bui-color-info)}:host(.bui-alert-warning) .bui-alert-frame{border-color:var(--bui-color-warning)}:host(.bui-alert-warning) .bui-alert-backdrop,:host(.bui-alert-warning) .bui-alert-icon-area{background-color:var(--bui-color-warning)}:host(.bui-alert-warning) .bui-alert-button-backdrop{border:1px var(--bui-color-warning) solid}:host(.bui-alert-warning) .bui-alert-button{color:var(--bui-color-warning)}:host(.bui-alert-error) .bui-alert-frame{border-color:var(--bui-color-error)}:host(.bui-alert-error) .bui-alert-backdrop,:host(.bui-alert-error) .bui-alert-icon-area{background-color:var(--bui-color-error)}:host(.bui-alert-error) .bui-alert-button-backdrop{border:1px var(--bui-color-error) solid}:host(.bui-alert-error) .bui-alert-button{color:var(--bui-color-error)}.bui-alert-button{width:40px;height:40px;padding:8px;overflow:hidden}@polyfill-unscoped-rule{content: \".bui-alert .bui-alert-content > div > *:first-child\"; margin-top: 0;}@polyfill-unscoped-rule{content: \".bui-alert .bui-alert-content > div > *:last-child\"; margin-bottom: 0;}@polyfill-unscoped-rule{content: \".bui-alert .bui-alert-content > *:first-child\"; margin-top: 0;}@polyfill-unscoped-rule{content: \".bui-alert .bui-alert-content > *:last-child\"; margin-bottom: 0;}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3.IconDirective, selector: "[buiIcon]", inputs: ["buiIcon", "size", "variant"] }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
80
|
+
}
|
|
81
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AlertMessageComponent, decorators: [{
|
|
82
|
+
type: Component,
|
|
83
|
+
args: [{ selector: 'bui-alert', host: {
|
|
84
|
+
'[class]': `'bui-alert bui-host bui-alert-' + (type === 'warn' ? 'warning' : type) + (dismissible ? ' bui-alert-dismissible' : '')`,
|
|
85
|
+
'[role]': `politeness === 'off' ? 'region' : 'alert'`,
|
|
86
|
+
'[attr.aria-live]': `politeness === 'assertive' ? undefined : politeness`
|
|
87
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"bui-alert-backdrop\"></div>\r\n<div class=\"bui-alert-frame\"></div>\r\n\r\n<div class=\"bui-alert-wrapper\">\r\n\t<div class=\"bui-alert-icon-area\">\r\n\t\t<mat-icon [buiIcon]=\"iconName\" variant=\"outlined\"></mat-icon>\r\n\t</div>\r\n\t<div class=\"bui-alert-content\">\r\n\t\t<div [innerHTML]=\"message\" *ngIf=\"message\"></div>\r\n\t\t<ng-content></ng-content>\r\n\t</div>\r\n</div>\r\n\r\n<div class=\"bui-alert-button-area\" *ngIf=\"dismissible\">\r\n\t<div class=\"bui-alert-button-backdrop\"></div>\r\n\t<button mat-icon-button class=\"bui-alert-button\" (click)=\"_dismiss()\" aria-label=\"dismiss alert\">\r\n\t\t<mat-icon>cancel</mat-icon>\r\n\t</button>\r\n</div>\r\n", styles: [":host(:not([hidden])){display:block;padding:12px 14px 12px 19px;position:relative;border-radius:5px}:host-context([dir=rtl]) :host(:not([hidden])){padding:12px 19px 12px 14px}:host(:not([hidden])),:host(:not([hidden])) *{box-sizing:border-box}.bui-alert-backdrop,.bui-alert-frame{position:absolute;inset:0}.bui-alert-backdrop{opacity:.1}:host(.bui-alert-dismissible) .bui-alert-backdrop{clip-path:polygon(0 0,calc(100% - 25px) 0,calc(100% - 18.75px) 18.75px,100% 25px,100% 100%,0 100%)}:host-context([dir=rtl]) :host(.bui-alert-dismissible) .bui-alert-backdrop{clip-path:polygon(0 25px,0 100%,100% 100%,100% 0,25px 0,18.75px 18.75px)}.bui-alert-frame{border-radius:5px;border-width:1px 1px 1px 5px;border-style:solid}:host-context([dir=rtl]) .bui-alert-frame{border-width:1px 5px 1px 1px}:host(.bui-alert-dismissible) .bui-alert-frame{clip-path:polygon(0 0,calc(100% - 25px) 0,calc(100% - 25px) 25px,100% 25px,100% 100%,0 100%)}:host-context([dir=rtl]) :host(.bui-alert-dismissible) .bui-alert-frame{clip-path:polygon(0 25px,0 100%,100% 100%,100% 0,25px 0)}.bui-alert-button-area{position:absolute;right:-15px;top:-15px;width:40px;height:40px;border-radius:20px;display:flex;align-items:center;justify-content:center}:host-context([dir=rtl]) .bui-alert-button-area{right:unset;left:-15px}.bui-alert-button-backdrop{position:absolute;border-radius:20px;width:100%;height:100%;clip-path:polygon(0 15px,25px 15px,25px 100%,0% 100%)}:host-context([dir=rtl]) .bui-alert-button-backdrop{clip-path:polygon(15px 15px,15px 100%,100% 100%,100% 15px)}.bui-alert-wrapper{display:flex;align-items:stretch}.bui-alert-icon-area{flex-shrink:0;display:flex;justify-content:center;align-items:center;border-radius:5px;width:30px;height:30px;margin-right:14px;color:var(--bui-bg-card)}:host-context([dir=rtl]) .bui-alert-icon-area{margin-right:unset;margin-left:14px}.bui-alert-content{z-index:1;flex-grow:1;display:flex;flex-direction:column;justify-content:center;gap:1rem}:host(.bui-alert-dismissible) .bui-alert-content{clip-path:polygon(0 0,calc(100% - 11px) 0,100% 13px,100% 100%,0 100%)}:host-context([dir=rtl]) :host(.bui-alert-dismissible) .bui-alert-content{clip-path:polygon(0 13px,0 100%,100% 100%,100% 0,11px 0)}:host(.bui-alert-success) .bui-alert-frame{border-color:var(--bui-color-success)}:host(.bui-alert-success) .bui-alert-backdrop,:host(.bui-alert-success) .bui-alert-icon-area{background-color:var(--bui-color-success)}:host(.bui-alert-success) .bui-alert-button-backdrop{border:1px var(--bui-color-success) solid}:host(.bui-alert-success) .bui-alert-button{color:var(--bui-color-success)}:host(.bui-alert-info) .bui-alert-frame{border-color:var(--bui-color-info)}:host(.bui-alert-info) .bui-alert-backdrop,:host(.bui-alert-info) .bui-alert-icon-area{background-color:var(--bui-color-info)}:host(.bui-alert-info) .bui-alert-button-backdrop{border:1px var(--bui-color-info) solid}:host(.bui-alert-info) .bui-alert-button{color:var(--bui-color-info)}:host(.bui-alert-warning) .bui-alert-frame{border-color:var(--bui-color-warning)}:host(.bui-alert-warning) .bui-alert-backdrop,:host(.bui-alert-warning) .bui-alert-icon-area{background-color:var(--bui-color-warning)}:host(.bui-alert-warning) .bui-alert-button-backdrop{border:1px var(--bui-color-warning) solid}:host(.bui-alert-warning) .bui-alert-button{color:var(--bui-color-warning)}:host(.bui-alert-error) .bui-alert-frame{border-color:var(--bui-color-error)}:host(.bui-alert-error) .bui-alert-backdrop,:host(.bui-alert-error) .bui-alert-icon-area{background-color:var(--bui-color-error)}:host(.bui-alert-error) .bui-alert-button-backdrop{border:1px var(--bui-color-error) solid}:host(.bui-alert-error) .bui-alert-button{color:var(--bui-color-error)}.bui-alert-button{width:40px;height:40px;padding:8px;overflow:hidden}@polyfill-unscoped-rule{content: \".bui-alert .bui-alert-content > div > *:first-child\"; margin-top: 0;}@polyfill-unscoped-rule{content: \".bui-alert .bui-alert-content > div > *:last-child\"; margin-bottom: 0;}@polyfill-unscoped-rule{content: \".bui-alert .bui-alert-content > *:first-child\"; margin-top: 0;}@polyfill-unscoped-rule{content: \".bui-alert .bui-alert-content > *:last-child\"; margin-bottom: 0;}\n"] }]
|
|
88
|
+
}], ctorParameters: () => [], propDecorators: { type: [{
|
|
89
|
+
type: Input
|
|
90
|
+
}], message: [{
|
|
91
|
+
type: Input
|
|
92
|
+
}], politeness: [{
|
|
93
|
+
type: Input
|
|
94
|
+
}], dismissible: [{
|
|
95
|
+
type: Input
|
|
96
|
+
}], dismissed: [{
|
|
97
|
+
type: Output
|
|
98
|
+
}], initialised: [{
|
|
99
|
+
type: Output
|
|
100
|
+
}],
|
|
101
|
+
/** @ignore */
|
|
102
|
+
_id: [{
|
|
103
|
+
type: Input,
|
|
104
|
+
args: ['id']
|
|
105
|
+
}, {
|
|
106
|
+
type: HostBinding,
|
|
107
|
+
args: ['id']
|
|
108
|
+
}] } });
|
|
109
|
+
|
|
110
|
+
/**@internal */
|
|
111
|
+
class InternalAlertOject {
|
|
112
|
+
constructor(type, message) {
|
|
113
|
+
this.type = type;
|
|
114
|
+
this.message = message;
|
|
115
|
+
this.deleted = false;
|
|
116
|
+
this.id = `bui-alert-cont-alert-${generateID()}`;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Use this component in a designated area of a page for displaying notification messages
|
|
121
|
+
*
|
|
122
|
+
*/
|
|
123
|
+
class AlertContainerComponent {
|
|
124
|
+
constructor(zone, cdRef, _elementRef, scroll) {
|
|
125
|
+
this.zone = zone;
|
|
126
|
+
this.cdRef = cdRef;
|
|
127
|
+
this._elementRef = _elementRef;
|
|
128
|
+
this.scroll = scroll;
|
|
129
|
+
/** The maximum number of messages displayed in the container area. */
|
|
130
|
+
this.max = 5;
|
|
131
|
+
/**
|
|
132
|
+
* This property determines the behavior for displaying the notifications when the container is outside the viewport.
|
|
133
|
+
*
|
|
134
|
+
* `scroll`: The component will try to scroll to reveal the new notifications.
|
|
135
|
+
* `float`: The component will float the alert panel to the center of the screen for a couple of seconds and move it back to the original position.
|
|
136
|
+
*/
|
|
137
|
+
this.outsideViewportBehavior = 'float';
|
|
138
|
+
/**
|
|
139
|
+
* The number of milliseconds for which the alert container will be floated when new notification arrives.
|
|
140
|
+
*
|
|
141
|
+
* This will only take effect when `outsideViewportBehavior` is set to `float` and the container is outside the viewport.
|
|
142
|
+
*/
|
|
143
|
+
this.floatDuration = 2000;
|
|
144
|
+
/**@internal */
|
|
145
|
+
this._alerts = [];
|
|
146
|
+
/**@internal */
|
|
147
|
+
this._floated = false;
|
|
148
|
+
/**@internal */
|
|
149
|
+
this._floatPanelHidden = true;
|
|
150
|
+
/** @ignore Emits whenever the animation is started. */
|
|
151
|
+
this._animationStarted = new Subject();
|
|
152
|
+
/** @ignore Emits whenever the animation is done. */
|
|
153
|
+
this._animationEnded = new Subject();
|
|
154
|
+
this._destroyed$ = new Subject();
|
|
155
|
+
/** Emits the component instance after initialisation. */
|
|
156
|
+
this.init = new EventEmitter();
|
|
157
|
+
}
|
|
158
|
+
ngOnInit() {
|
|
159
|
+
const checkScroll = () => {
|
|
160
|
+
if (isElementInViewport(this._elementRef.nativeElement)) {
|
|
161
|
+
this._endFloating();
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
this.scroll
|
|
165
|
+
.ancestorScrolled(this._elementRef.nativeElement)
|
|
166
|
+
.pipe(takeUntil(this._destroyed$))
|
|
167
|
+
.subscribe(checkScroll);
|
|
168
|
+
checkScroll();
|
|
169
|
+
this.init.emit(this);
|
|
170
|
+
this.init.complete();
|
|
171
|
+
}
|
|
172
|
+
ngOnDestroy() {
|
|
173
|
+
this._destroyed$.next();
|
|
174
|
+
this._destroyed$.complete();
|
|
175
|
+
this._endFloatingSub?.unsubscribe();
|
|
176
|
+
}
|
|
177
|
+
/**@internal */
|
|
178
|
+
get _remaining() {
|
|
179
|
+
return this._alerts.filter(a => !a.deleted);
|
|
180
|
+
}
|
|
181
|
+
/**@internal */
|
|
182
|
+
get _width() {
|
|
183
|
+
return this._elementRef.nativeElement.clientWidth;
|
|
184
|
+
}
|
|
185
|
+
/** Add a message to the notification area */
|
|
186
|
+
async notify(type, message) {
|
|
187
|
+
this._endFloatingSub?.unsubscribe();
|
|
188
|
+
const duplicate = this._remaining.find(_a => message === _a.message);
|
|
189
|
+
if (duplicate) {
|
|
190
|
+
this._dismiss(duplicate);
|
|
191
|
+
}
|
|
192
|
+
const remaining = this._remaining;
|
|
193
|
+
if (remaining.length >= this.max) {
|
|
194
|
+
this._dismiss(remaining[0]);
|
|
195
|
+
}
|
|
196
|
+
const a = new InternalAlertOject(type, message);
|
|
197
|
+
await this._checkViewport();
|
|
198
|
+
this.zone.run(() => {
|
|
199
|
+
this._alerts.push(a);
|
|
200
|
+
this.cdRef.markForCheck();
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
/**@ignore */
|
|
204
|
+
async _checkViewport() {
|
|
205
|
+
if (!isElementInViewport(this._elementRef.nativeElement)) {
|
|
206
|
+
if (this.outsideViewportBehavior === 'float') {
|
|
207
|
+
const d = this._floated ? 0 : 100;
|
|
208
|
+
this._floated = true;
|
|
209
|
+
this._floatPanelHidden = false;
|
|
210
|
+
this._endFloating(this.floatDuration);
|
|
211
|
+
this.cdRef.markForCheck();
|
|
212
|
+
await timer(d).toPromise();
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
this._elementRef.nativeElement.scrollIntoView({ block: 'start', behavior: 'smooth' });
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
/**@ignore */
|
|
220
|
+
async _dismiss(a) {
|
|
221
|
+
const id = a.id;
|
|
222
|
+
a.deleted = true;
|
|
223
|
+
this.cdRef.markForCheck();
|
|
224
|
+
await this._animationEnded.pipe(take(1)).toPromise();
|
|
225
|
+
this.zone.run(() => {
|
|
226
|
+
this._alerts = this._alerts.filter(_a => _a.id !== id);
|
|
227
|
+
this.cdRef.markForCheck();
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
/** Remove all messages currently displayed. */
|
|
231
|
+
async clear() {
|
|
232
|
+
await Promise.all(this._remaining.map(a => this._dismiss(a)));
|
|
233
|
+
this._endFloating();
|
|
234
|
+
}
|
|
235
|
+
_endFloating(_delay = 0) {
|
|
236
|
+
if (!this._floated) {
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
this._endFloatingSub?.unsubscribe();
|
|
240
|
+
this._endFloatingSub = timer(_delay)
|
|
241
|
+
.pipe(tap(() => {
|
|
242
|
+
this._floated = false;
|
|
243
|
+
this.zone.run(() => this.cdRef.markForCheck());
|
|
244
|
+
}), delay(400))
|
|
245
|
+
.subscribe(() => {
|
|
246
|
+
this._floatPanelHidden = true;
|
|
247
|
+
this.zone.run(() => this.cdRef.markForCheck());
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AlertContainerComponent, deps: [{ token: i0.NgZone }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i1.ScrollDispatcher }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
251
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: AlertContainerComponent, selector: "bui-alert-container", inputs: { max: "max", outsideViewportBehavior: "outsideViewportBehavior", floatDuration: "floatDuration" }, outputs: { init: "init" }, host: { properties: { "class": "'bui-alert-container bui-host bui-alert-container-' + (_remaining.length ? 'not-empty': 'empty')" } }, ngImport: i0, template: "<div\r\n\tclass=\"bui-alert-fixed-panel\"\r\n\t[style.opacity]=\"_floatPanelHidden ? 1 : 0\"\r\n\t[class.bui-alert-fixed-panel-blink]=\"outsideViewportBehavior === 'scroll'\"\r\n>\r\n\t<bui-alert\r\n\t\t*ngFor=\"let a of _alerts\"\r\n\t\t[id]=\"a.id\"\r\n\t\t[type]=\"a.type\"\r\n\t\t[message]=\"a.message\"\r\n\t\tdismissible\r\n\t\t[@alertTransition]=\"a.deleted ? 'hidden' : 'visible'\"\r\n\t\t(@alertTransition.start)=\"_animationStarted.next($event)\"\r\n\t\t(@alertTransition.done)=\"_animationEnded.next($event)\"\r\n\t\t(dismissed)=\"_dismiss(a)\"\r\n\t></bui-alert>\r\n</div>\r\n\r\n<div class=\"bui-alert-float-panel-frame\" [hidden]=\"_floatPanelHidden\" [class.bui-alert-float-panel-shaded]=\"_floated\">\r\n\t<div class=\"bui-alert-float-panel\" [style.max-width]=\"_width + 'px'\" [@floatTransition]=\"'visible'\" *ngIf=\"_floated\">\r\n\t\t<bui-alert\r\n\t\t\t*ngFor=\"let a of _alerts\"\r\n\t\t\t[id]=\"a.id\"\r\n\t\t\t[type]=\"a.type\"\r\n\t\t\t[message]=\"a.message\"\r\n\t\t\t[@alertTransition]=\"a.deleted ? 'hidden' : 'visible'\"\r\n\t\t></bui-alert>\r\n\t</div>\r\n</div>\r\n", styles: [".bui-alert:not(:first-of-type){margin-top:.5rem}:host(:not([hidden])){display:block}.bui-alert-fixed-panel{transition:opacity .2s ease-in}.bui-alert-fixed-panel.bui-alert-fixed-panel-blink .bui-alert:last-of-type{animation:blink 1s ease-in forwards}.bui-alert-float-panel-frame{position:fixed;z-index:1000;inset:0;justify-content:center;align-items:center;flex-direction:column;transition:background-color .4s cubic-bezier(.25,0,.55,.2)}.bui-alert-float-panel-frame:not([hidden]){display:flex}.bui-alert-float-panel-frame.bui-alert-float-panel-shaded{background-color:#00000080}.bui-alert-float-panel-frame .bui-alert{background-color:var(--bui-bg-card)}@keyframes blink{60%{opacity:1}70%{opacity:0}80%{opacity:1}90%{opacity:0}}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AlertMessageComponent, selector: "bui-alert", inputs: ["type", "message", "politeness", "dismissible", "id"], outputs: ["dismissed", "initialised"] }], animations: [
|
|
252
|
+
trigger('floatTransition', [
|
|
253
|
+
transition(':enter', [style({ opacity: '0', transform: 'translateY(-10vh)' }), animate('.3s ease-in')]),
|
|
254
|
+
transition(':leave', [animate('.4s ease-out', style({ transform: 'translateY(-10vh)', opacity: '0' }))])
|
|
255
|
+
]),
|
|
256
|
+
trigger('alertTransition', [
|
|
257
|
+
state('visible', style({})),
|
|
258
|
+
state('hidden', style({
|
|
259
|
+
height: 0,
|
|
260
|
+
overflow: 'hidden',
|
|
261
|
+
transform: 'scaleY(0)',
|
|
262
|
+
opacity: 0,
|
|
263
|
+
'margin-top': '-1rem'
|
|
264
|
+
})),
|
|
265
|
+
transition('void => visible', [
|
|
266
|
+
style({ transform: 'translateY(100%)', height: 0, opacity: '0', overflow: 'hidden' }),
|
|
267
|
+
animate('250ms cubic-bezier(0.42, 0.0, 0.58, 1.0)')
|
|
268
|
+
]),
|
|
269
|
+
transition('visible => hidden', [animate('250ms cubic-bezier(0.25, 0, 0.3, 1.0)')])
|
|
270
|
+
])
|
|
271
|
+
], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
272
|
+
}
|
|
273
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AlertContainerComponent, decorators: [{
|
|
274
|
+
type: Component,
|
|
275
|
+
args: [{ selector: 'bui-alert-container', host: {
|
|
276
|
+
'[class]': `'bui-alert-container bui-host bui-alert-container-' + (_remaining.length ? 'not-empty': 'empty')`
|
|
277
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, animations: [
|
|
278
|
+
trigger('floatTransition', [
|
|
279
|
+
transition(':enter', [style({ opacity: '0', transform: 'translateY(-10vh)' }), animate('.3s ease-in')]),
|
|
280
|
+
transition(':leave', [animate('.4s ease-out', style({ transform: 'translateY(-10vh)', opacity: '0' }))])
|
|
281
|
+
]),
|
|
282
|
+
trigger('alertTransition', [
|
|
283
|
+
state('visible', style({})),
|
|
284
|
+
state('hidden', style({
|
|
285
|
+
height: 0,
|
|
286
|
+
overflow: 'hidden',
|
|
287
|
+
transform: 'scaleY(0)',
|
|
288
|
+
opacity: 0,
|
|
289
|
+
'margin-top': '-1rem'
|
|
290
|
+
})),
|
|
291
|
+
transition('void => visible', [
|
|
292
|
+
style({ transform: 'translateY(100%)', height: 0, opacity: '0', overflow: 'hidden' }),
|
|
293
|
+
animate('250ms cubic-bezier(0.42, 0.0, 0.58, 1.0)')
|
|
294
|
+
]),
|
|
295
|
+
transition('visible => hidden', [animate('250ms cubic-bezier(0.25, 0, 0.3, 1.0)')])
|
|
296
|
+
])
|
|
297
|
+
], template: "<div\r\n\tclass=\"bui-alert-fixed-panel\"\r\n\t[style.opacity]=\"_floatPanelHidden ? 1 : 0\"\r\n\t[class.bui-alert-fixed-panel-blink]=\"outsideViewportBehavior === 'scroll'\"\r\n>\r\n\t<bui-alert\r\n\t\t*ngFor=\"let a of _alerts\"\r\n\t\t[id]=\"a.id\"\r\n\t\t[type]=\"a.type\"\r\n\t\t[message]=\"a.message\"\r\n\t\tdismissible\r\n\t\t[@alertTransition]=\"a.deleted ? 'hidden' : 'visible'\"\r\n\t\t(@alertTransition.start)=\"_animationStarted.next($event)\"\r\n\t\t(@alertTransition.done)=\"_animationEnded.next($event)\"\r\n\t\t(dismissed)=\"_dismiss(a)\"\r\n\t></bui-alert>\r\n</div>\r\n\r\n<div class=\"bui-alert-float-panel-frame\" [hidden]=\"_floatPanelHidden\" [class.bui-alert-float-panel-shaded]=\"_floated\">\r\n\t<div class=\"bui-alert-float-panel\" [style.max-width]=\"_width + 'px'\" [@floatTransition]=\"'visible'\" *ngIf=\"_floated\">\r\n\t\t<bui-alert\r\n\t\t\t*ngFor=\"let a of _alerts\"\r\n\t\t\t[id]=\"a.id\"\r\n\t\t\t[type]=\"a.type\"\r\n\t\t\t[message]=\"a.message\"\r\n\t\t\t[@alertTransition]=\"a.deleted ? 'hidden' : 'visible'\"\r\n\t\t></bui-alert>\r\n\t</div>\r\n</div>\r\n", styles: [".bui-alert:not(:first-of-type){margin-top:.5rem}:host(:not([hidden])){display:block}.bui-alert-fixed-panel{transition:opacity .2s ease-in}.bui-alert-fixed-panel.bui-alert-fixed-panel-blink .bui-alert:last-of-type{animation:blink 1s ease-in forwards}.bui-alert-float-panel-frame{position:fixed;z-index:1000;inset:0;justify-content:center;align-items:center;flex-direction:column;transition:background-color .4s cubic-bezier(.25,0,.55,.2)}.bui-alert-float-panel-frame:not([hidden]){display:flex}.bui-alert-float-panel-frame.bui-alert-float-panel-shaded{background-color:#00000080}.bui-alert-float-panel-frame .bui-alert{background-color:var(--bui-bg-card)}@keyframes blink{60%{opacity:1}70%{opacity:0}80%{opacity:1}90%{opacity:0}}\n"] }]
|
|
298
|
+
}], ctorParameters: () => [{ type: i0.NgZone }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i1.ScrollDispatcher }], propDecorators: { max: [{
|
|
299
|
+
type: Input
|
|
300
|
+
}], outsideViewportBehavior: [{
|
|
301
|
+
type: Input
|
|
302
|
+
}], floatDuration: [{
|
|
303
|
+
type: Input
|
|
304
|
+
}], init: [{
|
|
305
|
+
type: Output
|
|
306
|
+
}] } });
|
|
307
|
+
|
|
308
|
+
class AlertModule {
|
|
309
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AlertModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
310
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: AlertModule, declarations: [AlertMessageComponent, AlertContainerComponent], imports: [CommonModule, IconFontModule, MatButtonModule], exports: [AlertMessageComponent, AlertContainerComponent] }); }
|
|
311
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AlertModule, imports: [CommonModule, IconFontModule, MatButtonModule] }); }
|
|
312
|
+
}
|
|
313
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AlertModule, decorators: [{
|
|
314
|
+
type: NgModule,
|
|
315
|
+
args: [{
|
|
316
|
+
declarations: [AlertMessageComponent, AlertContainerComponent],
|
|
317
|
+
imports: [CommonModule, IconFontModule, MatButtonModule],
|
|
318
|
+
exports: [AlertMessageComponent, AlertContainerComponent]
|
|
319
|
+
}]
|
|
320
|
+
}] });
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Generated bundle index. Do not edit.
|
|
324
|
+
*/
|
|
325
|
+
|
|
326
|
+
export { AlertContainerComponent, AlertMessageComponent, AlertModule };
|
|
327
|
+
//# sourceMappingURL=bravura-ui-alert.mjs.map
|