@bravura/ui 1.23.2 → 1.24.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.
Files changed (73) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/behavior/await.directive.d.ts +5 -1
  3. package/behavior/behavior.module.d.ts +6 -4
  4. package/behavior/observe-content-class.directive.d.ts +29 -0
  5. package/behavior/public-api.d.ts +1 -0
  6. package/behavior/sizing.directive.d.ts +2 -0
  7. package/bundles/bravura-ui-alert.umd.js +1 -1
  8. package/bundles/bravura-ui-behavior.umd.js +117 -17
  9. package/bundles/bravura-ui-behavior.umd.js.map +1 -1
  10. package/bundles/bravura-ui-currency-input.umd.js +0 -3
  11. package/bundles/bravura-ui-currency-input.umd.js.map +1 -1
  12. package/bundles/bravura-ui-decimal-input.umd.js +1 -5
  13. package/bundles/bravura-ui-decimal-input.umd.js.map +1 -1
  14. package/bundles/bravura-ui-file-upload.umd.js +47 -3
  15. package/bundles/bravura-ui-file-upload.umd.js.map +1 -1
  16. package/bundles/bravura-ui-panel.umd.js +266 -0
  17. package/bundles/bravura-ui-panel.umd.js.map +1 -0
  18. package/bundles/bravura-ui-radio-panel.umd.js +2 -2
  19. package/bundles/bravura-ui-radio-panel.umd.js.map +1 -1
  20. package/bundles/bravura-ui-stepper.umd.js +6 -2
  21. package/bundles/bravura-ui-stepper.umd.js.map +1 -1
  22. package/bundles/bravura-ui-tooltip.umd.js +34 -6
  23. package/bundles/bravura-ui-tooltip.umd.js.map +1 -1
  24. package/decimal-input/decimal-input.directive.d.ts +0 -1
  25. package/esm2015/alert/alert-message.component.js +1 -1
  26. package/esm2015/behavior/await.directive.js +15 -6
  27. package/esm2015/behavior/behavior.module.js +18 -6
  28. package/esm2015/behavior/observe-content-class.directive.js +63 -0
  29. package/esm2015/behavior/public-api.js +2 -1
  30. package/esm2015/behavior/sizing.directive.js +13 -4
  31. package/esm2015/currency-input/currency-input.directive.js +1 -4
  32. package/esm2015/decimal-input/decimal-input.directive.js +2 -6
  33. package/esm2015/file-upload/file-upload.component.js +48 -4
  34. package/esm2015/panel/bravura-ui-panel.js +5 -0
  35. package/esm2015/panel/panel-section.component.js +47 -0
  36. package/esm2015/panel/panel.component.js +93 -0
  37. package/esm2015/panel/panel.module.js +23 -0
  38. package/esm2015/panel/public-api.js +2 -0
  39. package/esm2015/panel/tinted.directive.js +60 -0
  40. package/esm2015/radio-panel/radio-panel-item.component.js +2 -2
  41. package/esm2015/radio-panel/radio-panel.component.js +1 -1
  42. package/esm2015/stepper/stepper.component.js +7 -3
  43. package/esm2015/tooltip/public-api.js +2 -1
  44. package/esm2015/tooltip/tooltip.directive.js +30 -4
  45. package/fesm2015/bravura-ui-alert.js +1 -1
  46. package/fesm2015/bravura-ui-behavior.js +104 -14
  47. package/fesm2015/bravura-ui-behavior.js.map +1 -1
  48. package/fesm2015/bravura-ui-currency-input.js +0 -3
  49. package/fesm2015/bravura-ui-currency-input.js.map +1 -1
  50. package/fesm2015/bravura-ui-decimal-input.js +1 -5
  51. package/fesm2015/bravura-ui-decimal-input.js.map +1 -1
  52. package/fesm2015/bravura-ui-file-upload.js +47 -3
  53. package/fesm2015/bravura-ui-file-upload.js.map +1 -1
  54. package/fesm2015/bravura-ui-panel.js +218 -0
  55. package/fesm2015/bravura-ui-panel.js.map +1 -0
  56. package/fesm2015/bravura-ui-radio-panel.js +2 -2
  57. package/fesm2015/bravura-ui-radio-panel.js.map +1 -1
  58. package/fesm2015/bravura-ui-stepper.js +6 -2
  59. package/fesm2015/bravura-ui-stepper.js.map +1 -1
  60. package/fesm2015/bravura-ui-tooltip.js +30 -4
  61. package/fesm2015/bravura-ui-tooltip.js.map +1 -1
  62. package/file-upload/file-upload.component.d.ts +11 -1
  63. package/package.json +1 -1
  64. package/panel/bravura-ui-panel.d.ts +5 -0
  65. package/panel/package.json +10 -0
  66. package/panel/panel-section.component.d.ts +15 -0
  67. package/panel/panel.component.d.ts +60 -0
  68. package/panel/panel.module.d.ts +16 -0
  69. package/panel/public-api.d.ts +1 -0
  70. package/panel/tinted.directive.d.ts +26 -0
  71. package/stepper/stepper.component.d.ts +1 -0
  72. package/tooltip/public-api.d.ts +1 -0
  73. package/tooltip/tooltip.directive.d.ts +8 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # Change history
2
2
 
3
+ ## 1.24.0 (2023-04-24)
4
+
5
+ * test: disable an unstable test ([68ec208](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/68ec208))
6
+ * test: enrich test cases and enforce coverage check ([c9aa73f](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/c9aa73f))
7
+ * test: fix an unstable test ([3bc6244](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/3bc6244))
8
+ * test: fix an unstable test ([6230360](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/6230360))
9
+ * test: fix an unstable test ([7a1adad](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/7a1adad))
10
+ * test: fix test failures ([b52c82e](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/b52c82e))
11
+ * test(panel): fix test failure ([a755179](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/a755179))
12
+ * feat(behavior): add class directive for dom children events ([e55aade](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/e55aade))
13
+ * feat(behavior): add progress support in [buiAwait] ([be199b7](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/be199b7))
14
+ * feat(behavior): add support for other buttons in [buiAwait] ([1b8a128](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/1b8a128))
15
+ * feat(file-upload): limit file size ([36bb507](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/36bb507))
16
+ * feat(panel): add a new panel component based on `mat-card` ([58cf683](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/58cf683))
17
+ * feat(panel): add panel sections ([86b3652](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/86b3652))
18
+ * feat(panel): improve and extract tinted backdrop element ([712c8e7](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/712c8e7))
19
+ * feat(tooltip): automate calculation of default width ([21559d7](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/21559d7))
20
+ * feat(tooltip): support Observable as tooltip message ([540f498](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/540f498))
21
+ * fix: respect attribute hidden on host elements ([63e350c](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/63e350c))
22
+ * fix(behavior): add text content detection to observe content class ([1e7d907](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/1e7d907))
23
+ * fix(behavior): fix the issue with observe content class in prop binding ([52f0a37](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/52f0a37))
24
+ * fix(behavior): fix the issue with resize observer destruction ([d35c3fe](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/d35c3fe))
25
+ * fix(panel): calculate flex basis on panel sections ([d173709](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/d173709))
26
+ * fix(panel): fix compilation errors ([7762297](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/7762297))
27
+ * fix(panel): fix issue with incorrect style classes when resized ([480cc2e](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/480cc2e))
28
+ * fix(tooltip): export an injection token for greater ability to customise ([3a1c231](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/3a1c231))
29
+ * docs(panel): add real world sample story ([a30df78](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/a30df78))
30
+ * docs(storybook): improve tooltip stories ([6f42fb3](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/6f42fb3))
31
+
32
+ ## <small>1.23.2 (2023-03-06)</small>
33
+
34
+ * fix(alert): fix the issue with short messages being clipped off ([81d7e44](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/81d7e44))
35
+
3
36
  ## <small>1.23.1 (2022-10-19)</small>
4
37
 
5
38
  * fix(alert): improve accessibility ([0752162](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/0752162))
@@ -36,10 +36,12 @@ export declare class AwaitDirective implements AfterViewInit, DoCheck {
36
36
  * The operation is considered 'in progress' when the property evaluates to
37
37
  *
38
38
  * - `true`; or
39
+ * - a `number` within 0 - 100; or
39
40
  * - an instance of `rxjs/Subscription` and `buiAwait.closed` is falsy
40
41
  *
42
+ * When it is a number, it represets the progress in percentage term.
41
43
  */
42
- buiAwait: null | undefined | boolean | Subscription;
44
+ buiAwait: null | undefined | boolean | Subscription | number;
43
45
  /** The ARIA label to be put on the spinner. The default value is `"In progress"`. */
44
46
  buiAwaitAriaLabel: string;
45
47
  /** The diameter of the in-progress spinner. The default value is `20`. */
@@ -54,6 +56,8 @@ export declare class AwaitDirective implements AfterViewInit, DoCheck {
54
56
  ngAfterViewInit(): void;
55
57
  /** @ignore */
56
58
  ngDoCheck(): void;
59
+ /** @ignore */
60
+ private get _isDeterminate();
57
61
  private _statusChanged;
58
62
  static ɵfac: i0.ɵɵFactoryDeclaration<AwaitDirective, [null, { optional: true; }, null, null, null]>;
59
63
  static ɵdir: i0.ɵɵDirectiveDeclaration<AwaitDirective, "[buiAwait]", never, { "buiAwait": "buiAwait"; "buiAwaitAriaLabel": "buiAwaitAriaLabel"; "buiAwaitDiameter": "buiAwaitDiameter"; }, {}, never>;
@@ -2,14 +2,16 @@ import * as i0 from "@angular/core";
2
2
  import * as i1 from "./sizing.directive";
3
3
  import * as i2 from "./sizing-monitor.directive";
4
4
  import * as i3 from "./await.directive";
5
- import * as i4 from "@angular/common";
6
- import * as i5 from "@angular/material/button";
7
- import * as i6 from "@angular/material/progress-spinner";
5
+ import * as i4 from "./observe-content-class.directive";
6
+ import * as i5 from "@angular/common";
7
+ import * as i6 from "@angular/material/button";
8
+ import * as i7 from "@angular/material/progress-spinner";
9
+ import * as i8 from "@angular/cdk/observers";
8
10
  /**
9
11
  * For functionality that cannot be easily achieved via CSS.
10
12
  */
11
13
  export declare class BehaviorModule {
12
14
  static ɵfac: i0.ɵɵFactoryDeclaration<BehaviorModule, never>;
13
- static ɵmod: i0.ɵɵNgModuleDeclaration<BehaviorModule, [typeof i1.SizingDirective, typeof i2.SizingMonitorDirective, typeof i3.AwaitDirective], [typeof i4.CommonModule, typeof i5.MatButtonModule, typeof i6.MatProgressSpinnerModule], [typeof i1.SizingDirective, typeof i2.SizingMonitorDirective, typeof i3.AwaitDirective, typeof i6.MatProgressSpinnerModule]>;
15
+ static ɵmod: i0.ɵɵNgModuleDeclaration<BehaviorModule, [typeof i1.SizingDirective, typeof i2.SizingMonitorDirective, typeof i3.AwaitDirective, typeof i4.ObserveContentClassDirective], [typeof i5.CommonModule, typeof i6.MatButtonModule, typeof i7.MatProgressSpinnerModule, typeof i8.ObserversModule], [typeof i1.SizingDirective, typeof i2.SizingMonitorDirective, typeof i3.AwaitDirective, typeof i7.MatProgressSpinnerModule, typeof i4.ObserveContentClassDirective]>;
14
16
  static ɵinj: i0.ɵɵInjectorDeclaration<BehaviorModule>;
15
17
  }
@@ -0,0 +1,29 @@
1
+ import { ContentObserver } from '@angular/cdk/observers';
2
+ import { ElementRef, OnDestroy, OnInit } from '@angular/core';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Use `[bui-class.not-empty]` to specify a style class activated only when the host element has DOM children;
6
+ *
7
+ * use `[bui-class.empty]` for a style class activated when it has no DOM children.
8
+ *
9
+ * Use `[bui-class.no-text]` to specify a style class activated only when the host element has text content;
10
+ *
11
+ * use `[bui-class.has-text]` for a style class activated when it has no text content.
12
+ */
13
+ export declare class ObserveContentClassDirective implements OnDestroy, OnInit {
14
+ private readonly subscription;
15
+ private readonly element;
16
+ private classToRemove;
17
+ private classEmpty?;
18
+ private classNotEmpty?;
19
+ private classNoText?;
20
+ private classHasText?;
21
+ constructor(observer: ContentObserver, elementRef: ElementRef<HTMLElement>);
22
+ ngOnInit(): void;
23
+ ngOnDestroy(): void;
24
+ private checkClass;
25
+ private checkClassWith;
26
+ private addClass;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<ObserveContentClassDirective, never>;
28
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ObserveContentClassDirective, "[bui-class.empty],[bui-class.not-empty],[bui-class.no-text],[bui-class.has-text]", never, { "classEmpty": "bui-class.empty"; "classNotEmpty": "bui-class.not-empty"; "classNoText": "bui-class.no-text"; "classHasText": "bui-class.has-text"; }, {}, never>;
29
+ }
@@ -2,3 +2,4 @@ export * from './sizing.directive';
2
2
  export * from './sizing-monitor.directive';
3
3
  export * from './behavior.module';
4
4
  export * from './await.directive';
5
+ export * from './observe-content-class.directive';
@@ -80,12 +80,14 @@ export declare class SizingDirective implements OnChanges, OnDestroy {
80
80
  private _height;
81
81
  private _reflowFrameCount;
82
82
  private _element;
83
+ private _frameHandlerId;
83
84
  constructor(_doc: Document, _defaultTarget: SizingMonitorDirective, elemRef: ElementRef<HTMLElement>, _zone: NgZone);
84
85
  ngOnChanges(_: SimpleChanges): void;
85
86
  ngOnDestroy(): void;
86
87
  private _initOrReset;
87
88
  private _setUpNodeMonitor;
88
89
  private _tearDownNodeMonitor;
90
+ private _runWithObserver;
89
91
  private _calculateSize;
90
92
  private _applyClassesOrStyles;
91
93
  private _removeClassesOrStyles;
@@ -430,7 +430,7 @@
430
430
  return AlertMessageComponent;
431
431
  }());
432
432
  AlertMessageComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: AlertMessageComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
433
- AlertMessageComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", 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__namespace, template: "<div class=\"bui-alert-backdrop\"></div>\n<div class=\"bui-alert-frame\"></div>\n\n<div class=\"bui-alert-wrapper\">\n\t<div class=\"bui-alert-icon-area\">\n\t\t<mat-icon [buiIcon]=\"iconName\" variant=\"outlined\"></mat-icon>\n\t</div>\n\t<div class=\"bui-alert-content\"><div [innerHTML]=\"message\"></div></div>\n</div>\n\n<div class=\"bui-alert-button-area\" *ngIf=\"dismissible\">\n\t<div class=\"bui-alert-button-backdrop\"></div>\n\t<button mat-icon-button class=\"bui-alert-button\" (click)=\"_dismiss()\" aria-label=\"dismiss alert\">\n\t\t<mat-icon>cancel</mat-icon>\n\t</button>\n</div>\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;top:0;right:0;bottom:0;left: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{display:flex;align-items:center;z-index:1;flex-grow:1}: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)}\n"], components: [{ type: i1__namespace.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i2__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i3__namespace.IconDirective, selector: "[buiIcon]", inputs: ["buiIcon", "size", "variant"] }, { type: i3__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
433
+ AlertMessageComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", 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__namespace, template: "<div class=\"bui-alert-backdrop\"></div>\n<div class=\"bui-alert-frame\"></div>\n\n<div class=\"bui-alert-wrapper\">\n\t<div class=\"bui-alert-icon-area\">\n\t\t<mat-icon [buiIcon]=\"iconName\" variant=\"outlined\"></mat-icon>\n\t</div>\n\t<div class=\"bui-alert-content\"><div [innerHTML]=\"message\"></div></div>\n</div>\n\n<div class=\"bui-alert-button-area\" *ngIf=\"dismissible\">\n\t<div class=\"bui-alert-button-backdrop\"></div>\n\t<button mat-icon-button class=\"bui-alert-button\" (click)=\"_dismiss()\" aria-label=\"dismiss alert\">\n\t\t<mat-icon>cancel</mat-icon>\n\t</button>\n</div>\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;top:0;right:0;bottom:0;left: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{display:flex;align-items:center;z-index:1;flex-grow:1}: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)}@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;}\n"], components: [{ type: i1__namespace.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i2__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i3__namespace.IconDirective, selector: "[buiIcon]", inputs: ["buiIcon", "size", "variant"] }, { type: i3__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
434
434
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: AlertMessageComponent, decorators: [{
435
435
  type: i0.Component,
436
436
  args: [{
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/coercion'), require('@angular/common'), require('@angular/core'), require('rxjs/operators'), require('@angular/material/progress-spinner'), require('@angular/material/button')) :
3
- typeof define === 'function' && define.amd ? define('@bravura/ui/behavior', ['exports', '@angular/cdk/coercion', '@angular/common', '@angular/core', 'rxjs/operators', '@angular/material/progress-spinner', '@angular/material/button'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.bravura = global.bravura || {}, global.bravura.ui = global.bravura.ui || {}, global.bravura.ui.behavior = {}), global.ng.cdk.coercion, global.ng.common, global.ng.core, global.rxjs.operators, global.ng.material.progressSpinner, global.ng.material.button));
5
- })(this, (function (exports, coercion, common, i0, operators, progressSpinner, i1) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/coercion'), require('@angular/common'), require('@angular/core'), require('rxjs/operators'), require('@angular/material/progress-spinner'), require('@angular/material/button'), require('@angular/cdk/observers')) :
3
+ typeof define === 'function' && define.amd ? define('@bravura/ui/behavior', ['exports', '@angular/cdk/coercion', '@angular/common', '@angular/core', 'rxjs/operators', '@angular/material/progress-spinner', '@angular/material/button', '@angular/cdk/observers'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.bravura = global.bravura || {}, global.bravura.ui = global.bravura.ui || {}, global.bravura.ui.behavior = {}), global.ng.cdk.coercion, global.ng.common, global.ng.core, global.rxjs.operators, global.ng.material.progressSpinner, global.ng.material.button, global.ng.cdk.observers));
5
+ })(this, (function (exports, coercion, common, i0, operators, progressSpinner, i1, i1$1) { 'use strict';
6
6
 
7
7
  function _interopNamespace(e) {
8
8
  if (e && e.__esModule) return e;
@@ -24,6 +24,7 @@
24
24
 
25
25
  var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
26
26
  var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
27
+ var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
27
28
 
28
29
  /******************************************************************************
29
30
  Copyright (c) Microsoft Corporation.
@@ -439,6 +440,7 @@
439
440
  this._width = 0;
440
441
  this._height = 0;
441
442
  this._reflowFrameCount = 0;
443
+ this._frameHandlerId = 0;
442
444
  this._element = elemRef.nativeElement;
443
445
  this._monitorTarget = this._element;
444
446
  }
@@ -519,15 +521,23 @@
519
521
  var _this = this;
520
522
  this._tearDownNodeMonitor();
521
523
  if (this._monitorTarget) {
522
- this._observer = new ResizeObserver(function () { return _this._calculateSize(); });
524
+ this._observer = new ResizeObserver(function () { return _this._runWithObserver(_this._calculateSize.bind(_this)); });
523
525
  this._observer.observe(this._monitorTarget, { box: 'border-box' });
524
526
  }
525
527
  };
526
528
  SizingDirective.prototype._tearDownNodeMonitor = function () {
529
+ var _this = this;
530
+ cancelAnimationFrame(this._frameHandlerId);
531
+ this._runWithObserver(function () {
532
+ _this._observer.disconnect();
533
+ _this._observer = undefined;
534
+ });
535
+ };
536
+ SizingDirective.prototype._runWithObserver = function (func) {
527
537
  if (this._observer) {
528
- this._observer.disconnect();
529
- this._observer = undefined;
538
+ return func();
530
539
  }
540
+ return undefined;
531
541
  };
532
542
  SizingDirective.prototype._calculateSize = function () {
533
543
  var e_1, _a;
@@ -602,7 +612,8 @@
602
612
  SizingDirective.prototype._reflowHeight = function () {
603
613
  var cnt = this._reflowFrameCount;
604
614
  if (cnt < 15) {
605
- requestAnimationFrame(this._reflowHeight.bind(this));
615
+ cancelAnimationFrame(this._frameHandlerId);
616
+ this._frameHandlerId = requestAnimationFrame(this._reflowHeight.bind(this));
606
617
  if (cnt === 0) {
607
618
  this._element.style.height = '0';
608
619
  }
@@ -702,20 +713,32 @@
702
713
  };
703
714
  /** @ignore */
704
715
  AwaitDirective.prototype.ngDoCheck = function () {
705
- var inProgress = this.buiAwait === true || (typeof this.buiAwait === 'object' && !this.buiAwait.closed);
716
+ var inProgress = this.buiAwait === true || (typeof this.buiAwait === 'object' && !this.buiAwait.closed) || this._isDeterminate;
706
717
  if (inProgress !== this._processing) {
707
718
  this._processing = inProgress;
708
- this._statusChanged();
719
+ this._statusChanged(this._isDeterminate ? 'determinate' : 'indeterminate');
720
+ }
721
+ if (this._isDeterminate && this._spinnerRef && this._spinnerRef.instance.value !== this.buiAwait) {
722
+ this._spinnerRef.instance.value = this.buiAwait;
723
+ i0["ɵmarkDirty"](this._spinnerRef.instance);
709
724
  }
710
725
  };
711
- AwaitDirective.prototype._statusChanged = function () {
726
+ Object.defineProperty(AwaitDirective.prototype, "_isDeterminate", {
727
+ /** @ignore */
728
+ get: function () {
729
+ return typeof this.buiAwait === 'number' && this.buiAwait >= 0 && this.buiAwait < 100;
730
+ },
731
+ enumerable: false,
732
+ configurable: true
733
+ });
734
+ AwaitDirective.prototype._statusChanged = function (mode) {
712
735
  if (this.button) {
713
736
  this.button.disabled = this._processing;
714
737
  if (this._processing) {
715
738
  this._spinnerRef = this._viewCont.createComponent(this._factory);
716
739
  var c = this._spinnerRef.instance;
717
740
  c.diameter = this.buiAwaitDiameter;
718
- c.mode = 'indeterminate';
741
+ c.mode = mode;
719
742
  c.color = this.button.color;
720
743
  var e = this._spinnerRef.location.nativeElement;
721
744
  e.setAttribute('aria-label', this.buiAwaitAriaLabel);
@@ -725,6 +748,7 @@
725
748
  else {
726
749
  this._captionWrapper.style.visibility = '';
727
750
  this._spinnerRef.destroy();
751
+ this._spinnerRef = undefined;
728
752
  this._overlayEl.innerHTML = '';
729
753
  }
730
754
  }
@@ -753,6 +777,71 @@
753
777
  type: i0.Input
754
778
  }] } });
755
779
 
780
+ /**
781
+ * Use `[bui-class.not-empty]` to specify a style class activated only when the host element has DOM children;
782
+ *
783
+ * use `[bui-class.empty]` for a style class activated when it has no DOM children.
784
+ *
785
+ * Use `[bui-class.no-text]` to specify a style class activated only when the host element has text content;
786
+ *
787
+ * use `[bui-class.has-text]` for a style class activated when it has no text content.
788
+ */
789
+ var ObserveContentClassDirective = /** @class */ (function () {
790
+ function ObserveContentClassDirective(observer, elementRef) {
791
+ var _this = this;
792
+ this.classToRemove = [];
793
+ this.element = elementRef.nativeElement;
794
+ this.subscription = observer.observe(elementRef).subscribe(function () { return _this.checkClass(); });
795
+ }
796
+ ObserveContentClassDirective.prototype.ngOnInit = function () {
797
+ this.checkClass.bind(this);
798
+ };
799
+ ObserveContentClassDirective.prototype.ngOnDestroy = function () {
800
+ this.subscription.unsubscribe();
801
+ };
802
+ ObserveContentClassDirective.prototype.checkClass = function () {
803
+ var _b;
804
+ var _this = this;
805
+ (_b = this.element.classList).remove.apply(_b, __spreadArray([], __read(this.classToRemove)));
806
+ this.classToRemove = [];
807
+ this.checkClassWith(this.classEmpty, this.classNotEmpty, function () { var _a; return _this.element.childElementCount === 0 && !((_a = _this.element.textContent) === null || _a === void 0 ? void 0 : _a.trim()); });
808
+ this.checkClassWith(this.classNoText, this.classHasText, function () { var _a; return !((_a = _this.element.textContent) === null || _a === void 0 ? void 0 : _a.trim()); });
809
+ };
810
+ ObserveContentClassDirective.prototype.checkClassWith = function (withoutClass, withClass, isWithout) {
811
+ var without = isWithout();
812
+ this.addClass(without ? withoutClass : withClass);
813
+ };
814
+ ObserveContentClassDirective.prototype.addClass = function (cls) {
815
+ var _b, _c;
816
+ if (cls === null || cls === void 0 ? void 0 : cls.trim()) {
817
+ var classes = cls.trim().split(/\s+/);
818
+ (_b = this.element.classList).add.apply(_b, __spreadArray([], __read(classes)));
819
+ (_c = this.classToRemove).push.apply(_c, __spreadArray([], __read(classes)));
820
+ }
821
+ };
822
+ return ObserveContentClassDirective;
823
+ }());
824
+ ObserveContentClassDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ObserveContentClassDirective, deps: [{ token: i1__namespace$1.ContentObserver }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
825
+ ObserveContentClassDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ObserveContentClassDirective, selector: "[bui-class.empty],[bui-class.not-empty],[bui-class.no-text],[bui-class.has-text]", inputs: { classEmpty: ["bui-class.empty", "classEmpty"], classNotEmpty: ["bui-class.not-empty", "classNotEmpty"], classNoText: ["bui-class.no-text", "classNoText"], classHasText: ["bui-class.has-text", "classHasText"] }, ngImport: i0__namespace });
826
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ObserveContentClassDirective, decorators: [{
827
+ type: i0.Directive,
828
+ args: [{
829
+ selector: '[bui-class.empty],[bui-class.not-empty],[bui-class.no-text],[bui-class.has-text]'
830
+ }]
831
+ }], ctorParameters: function () { return [{ type: i1__namespace$1.ContentObserver }, { type: i0__namespace.ElementRef }]; }, propDecorators: { classEmpty: [{
832
+ type: i0.Input,
833
+ args: ['bui-class.empty']
834
+ }], classNotEmpty: [{
835
+ type: i0.Input,
836
+ args: ['bui-class.not-empty']
837
+ }], classNoText: [{
838
+ type: i0.Input,
839
+ args: ['bui-class.no-text']
840
+ }], classHasText: [{
841
+ type: i0.Input,
842
+ args: ['bui-class.has-text']
843
+ }] } });
844
+
756
845
  /**
757
846
  * For functionality that cannot be easily achieved via CSS.
758
847
  */
@@ -762,14 +851,24 @@
762
851
  return BehaviorModule;
763
852
  }());
764
853
  BehaviorModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BehaviorModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
765
- BehaviorModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BehaviorModule, declarations: [SizingDirective, SizingMonitorDirective, AwaitDirective], imports: [common.CommonModule, i1.MatButtonModule, progressSpinner.MatProgressSpinnerModule], exports: [SizingDirective, SizingMonitorDirective, AwaitDirective, progressSpinner.MatProgressSpinnerModule] });
766
- BehaviorModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BehaviorModule, imports: [[common.CommonModule, i1.MatButtonModule, progressSpinner.MatProgressSpinnerModule], progressSpinner.MatProgressSpinnerModule] });
854
+ BehaviorModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BehaviorModule, declarations: [SizingDirective, SizingMonitorDirective, AwaitDirective, ObserveContentClassDirective], imports: [common.CommonModule, i1.MatButtonModule, progressSpinner.MatProgressSpinnerModule, i1$1.ObserversModule], exports: [SizingDirective,
855
+ SizingMonitorDirective,
856
+ AwaitDirective,
857
+ progressSpinner.MatProgressSpinnerModule,
858
+ ObserveContentClassDirective] });
859
+ BehaviorModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BehaviorModule, imports: [[common.CommonModule, i1.MatButtonModule, progressSpinner.MatProgressSpinnerModule, i1$1.ObserversModule], progressSpinner.MatProgressSpinnerModule] });
767
860
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: BehaviorModule, decorators: [{
768
861
  type: i0.NgModule,
769
862
  args: [{
770
- declarations: [SizingDirective, SizingMonitorDirective, AwaitDirective],
771
- imports: [common.CommonModule, i1.MatButtonModule, progressSpinner.MatProgressSpinnerModule],
772
- exports: [SizingDirective, SizingMonitorDirective, AwaitDirective, progressSpinner.MatProgressSpinnerModule]
863
+ declarations: [SizingDirective, SizingMonitorDirective, AwaitDirective, ObserveContentClassDirective],
864
+ imports: [common.CommonModule, i1.MatButtonModule, progressSpinner.MatProgressSpinnerModule, i1$1.ObserversModule],
865
+ exports: [
866
+ SizingDirective,
867
+ SizingMonitorDirective,
868
+ AwaitDirective,
869
+ progressSpinner.MatProgressSpinnerModule,
870
+ ObserveContentClassDirective
871
+ ]
773
872
  }]
774
873
  }] });
775
874
 
@@ -779,6 +878,7 @@
779
878
 
780
879
  exports.AwaitDirective = AwaitDirective;
781
880
  exports.BehaviorModule = BehaviorModule;
881
+ exports.ObserveContentClassDirective = ObserveContentClassDirective;
782
882
  exports.SizingDirective = SizingDirective;
783
883
  exports.SizingMonitorDirective = SizingMonitorDirective;
784
884