@bravura/ui 1.6.0 → 1.8.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.
Files changed (116) hide show
  1. package/CHANGELOG.md +36 -11
  2. package/LICENSE +6 -6
  3. package/behavior/behavior.module.d.ts +12 -12
  4. package/behavior/bravura-ui-behavior.d.ts +5 -5
  5. package/behavior/public-api.d.ts +3 -3
  6. package/behavior/sizing-monitor.directive.d.ts +23 -23
  7. package/behavior/sizing.directive.d.ts +94 -88
  8. package/bravura-ui.d.ts +5 -5
  9. package/bundles/bravura-ui-behavior.umd.js +631 -601
  10. package/bundles/bravura-ui-behavior.umd.js.map +1 -1
  11. package/bundles/bravura-ui-discrete-input.umd.js +695 -697
  12. package/bundles/bravura-ui-discrete-input.umd.js.map +1 -1
  13. package/bundles/bravura-ui-form-field.umd.js +440 -434
  14. package/bundles/bravura-ui-form-field.umd.js.map +1 -1
  15. package/bundles/bravura-ui-icon-font.umd.js +488 -490
  16. package/bundles/bravura-ui-icon-font.umd.js.map +1 -1
  17. package/bundles/bravura-ui-phone-number.umd.js +634 -636
  18. package/bundles/bravura-ui-phone-number.umd.js.map +1 -1
  19. package/bundles/bravura-ui-radio-panel.umd.js +466 -468
  20. package/bundles/bravura-ui-radio-panel.umd.js.map +1 -1
  21. package/bundles/bravura-ui-selection-panel.umd.js +613 -615
  22. package/bundles/bravura-ui-selection-panel.umd.js.map +1 -1
  23. package/bundles/bravura-ui-tooltip.umd.js +518 -479
  24. package/bundles/bravura-ui-tooltip.umd.js.map +1 -1
  25. package/bundles/bravura-ui.umd.js +4 -4
  26. package/bundles/bravura-ui.umd.js.map +1 -1
  27. package/discrete-input/bravura-ui-discrete-input.d.ts +5 -5
  28. package/discrete-input/discrete-input.component.d.ts +138 -138
  29. package/discrete-input/discrete-input.module.d.ts +11 -11
  30. package/discrete-input/public-api.d.ts +2 -2
  31. package/esm2015/behavior/behavior.module.js +21 -21
  32. package/esm2015/behavior/bravura-ui-behavior.js +4 -4
  33. package/esm2015/behavior/public-api.js +3 -3
  34. package/esm2015/behavior/sizing-monitor.directive.js +30 -30
  35. package/esm2015/behavior/sizing.directive.js +245 -217
  36. package/esm2015/bravura-ui.js +4 -4
  37. package/esm2015/discrete-input/bravura-ui-discrete-input.js +4 -4
  38. package/esm2015/discrete-input/discrete-input.component.js +332 -332
  39. package/esm2015/discrete-input/discrete-input.module.js +19 -19
  40. package/esm2015/discrete-input/public-api.js +2 -2
  41. package/esm2015/form-field/bravura-ui-form-field.js +4 -4
  42. package/esm2015/form-field/form-field.component.js +104 -96
  43. package/esm2015/form-field/form-field.module.js +19 -19
  44. package/esm2015/form-field/public-api.js +2 -2
  45. package/esm2015/icon-font/bravura-ui-icon-font.js +4 -4
  46. package/esm2015/icon-font/icon-font.module.js +21 -21
  47. package/esm2015/icon-font/icon.directive.js +101 -101
  48. package/esm2015/icon-font/public-api.js +3 -3
  49. package/esm2015/icon-font/utilities.js +50 -50
  50. package/esm2015/phone-number/bravura-ui-phone-number.js +4 -4
  51. package/esm2015/phone-number/phone-number.directive.js +191 -191
  52. package/esm2015/phone-number/phone-number.module.js +23 -23
  53. package/esm2015/phone-number/phone-number.pipe.js +46 -46
  54. package/esm2015/phone-number/phone-number.validator.js +63 -63
  55. package/esm2015/phone-number/public-api.js +1 -1
  56. package/esm2015/public-api.js +2 -2
  57. package/esm2015/radio-panel/bravura-ui-radio-panel.js +4 -4
  58. package/esm2015/radio-panel/public-api.js +4 -4
  59. package/esm2015/radio-panel/radio-panel-item.component.js +76 -76
  60. package/esm2015/radio-panel/radio-panel.directive.js +59 -59
  61. package/esm2015/radio-panel/radio-panel.module.js +24 -24
  62. package/esm2015/selection-panel/bravura-ui-selection-panel.js +4 -4
  63. package/esm2015/selection-panel/public-api.js +3 -3
  64. package/esm2015/selection-panel/selection-panel-item.component.js +143 -143
  65. package/esm2015/selection-panel/selection-panel.directive.js +116 -116
  66. package/esm2015/selection-panel/selection-panel.module.js +20 -20
  67. package/esm2015/tooltip/bravura-ui-tooltip.js +4 -4
  68. package/esm2015/tooltip/public-api.js +2 -2
  69. package/esm2015/tooltip/tooltip.component.js +52 -44
  70. package/esm2015/tooltip/tooltip.directive.js +110 -83
  71. package/esm2015/tooltip/tooltip.module.js +25 -25
  72. package/fesm2015/bravura-ui-behavior.js +281 -253
  73. package/fesm2015/bravura-ui-behavior.js.map +1 -1
  74. package/fesm2015/bravura-ui-discrete-input.js +332 -332
  75. package/fesm2015/bravura-ui-form-field.js +111 -103
  76. package/fesm2015/bravura-ui-form-field.js.map +1 -1
  77. package/fesm2015/bravura-ui-icon-font.js +162 -162
  78. package/fesm2015/bravura-ui-phone-number.js +300 -300
  79. package/fesm2015/bravura-ui-radio-panel.js +135 -135
  80. package/fesm2015/bravura-ui-selection-panel.js +258 -258
  81. package/fesm2015/bravura-ui-tooltip.js +163 -128
  82. package/fesm2015/bravura-ui-tooltip.js.map +1 -1
  83. package/fesm2015/bravura-ui.js +2 -2
  84. package/fesm2015/bravura-ui.js.map +1 -1
  85. package/form-field/bravura-ui-form-field.d.ts +5 -5
  86. package/form-field/form-field.component.d.ts +27 -27
  87. package/form-field/form-field.module.d.ts +10 -10
  88. package/form-field/public-api.d.ts +2 -2
  89. package/icon-font/bravura-ui-icon-font.d.ts +5 -5
  90. package/icon-font/icon-font.module.d.ts +12 -12
  91. package/icon-font/icon.directive.d.ts +46 -46
  92. package/icon-font/public-api.d.ts +3 -3
  93. package/icon-font/utilities.d.ts +20 -20
  94. package/package.json +1 -1
  95. package/phone-number/bravura-ui-phone-number.d.ts +5 -5
  96. package/phone-number/phone-number.directive.d.ts +66 -66
  97. package/phone-number/phone-number.module.d.ts +17 -17
  98. package/phone-number/phone-number.pipe.d.ts +13 -13
  99. package/phone-number/phone-number.validator.d.ts +31 -31
  100. package/phone-number/public-api.d.ts +1 -1
  101. package/public-api.d.ts +1 -1
  102. package/radio-panel/bravura-ui-radio-panel.d.ts +5 -5
  103. package/radio-panel/public-api.d.ts +3 -3
  104. package/radio-panel/radio-panel-item.component.d.ts +17 -17
  105. package/radio-panel/radio-panel.directive.d.ts +26 -26
  106. package/radio-panel/radio-panel.module.d.ts +15 -15
  107. package/selection-panel/bravura-ui-selection-panel.d.ts +5 -5
  108. package/selection-panel/public-api.d.ts +3 -3
  109. package/selection-panel/selection-panel-item.component.d.ts +63 -63
  110. package/selection-panel/selection-panel.directive.d.ts +67 -67
  111. package/selection-panel/selection-panel.module.d.ts +12 -12
  112. package/tooltip/bravura-ui-tooltip.d.ts +5 -5
  113. package/tooltip/public-api.d.ts +2 -2
  114. package/tooltip/tooltip.component.d.ts +24 -14
  115. package/tooltip/tooltip.directive.d.ts +39 -36
  116. package/tooltip/tooltip.module.d.ts +13 -13
package/CHANGELOG.md CHANGED
@@ -1,18 +1,43 @@
1
1
  # Change history
2
2
 
3
+ ## 1.8.0 (2021-12-09)
4
+
5
+ * feat(behavior): enhance sizing directive to support inline styles ([3a27a84](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/3a27a84))
6
+
7
+ ## <small>1.7.2 (2021-11-17)</small>
8
+
9
+ * fix(tooltip): fix tooltip content not being reset when given falsy ([b17da82](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/b17da82))
10
+ * fix(tooltip): template ref not rendered due to message prop being empty ([7b05f24](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/7b05f24))
11
+ * build: attempt to specify build name from package.json ([67202e0](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/67202e0))
12
+ * build: evaluate build name post release ([f1a6b2e](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/f1a6b2e))
13
+ * build: fix build script syntax ([2d1bf55](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/2d1bf55))
14
+ * test(form-field): fix code coverage failure ([1a3ea19](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/1a3ea19))
15
+
16
+ ## <small>1.7.1 (2021-11-16)</small>
17
+
18
+ * fix(tooltip): fix issue with string content overriding template ref ([082ce8a](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/082ce8a))
19
+
20
+ ## 1.7.0 (2021-11-12)
21
+
22
+ * test: fix test failures due to different browser environments ([8b0da8b](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/8b0da8b))
23
+ * feat(tooltip): add support for template reference ([db5da52](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/db5da52))
24
+ * fix(form-field): override MatFormField provider to view/content children ([12dea10](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/12dea10))
25
+ * refactor: minor packages upgrade ([64f3e34](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/64f3e34))
26
+ * docs(storybook): upgrade storybook packages ([b04d0d7](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/b04d0d7))
27
+
3
28
  ## 1.6.0 (2021-09-28)
4
29
 
5
- * feat(discrete-input): add new material form control - discrete input ([b9feadf](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/b9feadf))
6
- * feat(selection-panel): add input property selectByHeader, defaul true ([631b8e9](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/631b8e9))
7
- * fix(form-field): fix incorrect spacing in 'detach' appearance ([8035a66](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/8035a66))
8
- * fix(form-field): fix issue with click event handling on 'detach' fields ([2ede5f8](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/2ede5f8))
9
- * fix(radio-panel): changes to color not reflected to items immediately ([d75814d](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/d75814d))
10
- * fix(theme): fix incorrect use of colours from theme config ([d3a15cd](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/d3a15cd))
11
- * ci: add release and publish step ([e48e82e](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/e48e82e))
12
- * ci: enable jenkins pipeline [wip] ([250569e](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/250569e))
13
- * ci: enable maintenance releases on defined branch patterns ([044a589](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/044a589))
14
- * ci: move chromatic to semantic release script ([14982b8](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/14982b8))
15
- * ci: simplify jenkin pipeline stages [wip] ([aa074e1](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/aa074e1))
30
+ - feat(discrete-input): add new material form control - discrete input ([b9feadf](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/b9feadf))
31
+ - feat(selection-panel): add input property selectByHeader, defaul true ([631b8e9](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/631b8e9))
32
+ - fix(form-field): fix incorrect spacing in 'detach' appearance ([8035a66](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/8035a66))
33
+ - fix(form-field): fix issue with click event handling on 'detach' fields ([2ede5f8](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/2ede5f8))
34
+ - fix(radio-panel): changes to color not reflected to items immediately ([d75814d](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/d75814d))
35
+ - fix(theme): fix incorrect use of colours from theme config ([d3a15cd](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/d3a15cd))
36
+ - ci: add release and publish step ([e48e82e](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/e48e82e))
37
+ - ci: enable jenkins pipeline [wip] ([250569e](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/250569e))
38
+ - ci: enable maintenance releases on defined branch patterns ([044a589](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/044a589))
39
+ - ci: move chromatic to semantic release script ([14982b8](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/14982b8))
40
+ - ci: simplify jenkin pipeline stages [wip] ([aa074e1](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/aa074e1))
16
41
 
17
42
  ## 1.5.0 (2021-09-18)
18
43
 
package/LICENSE CHANGED
@@ -1,7 +1,7 @@
1
- ISC License
2
-
3
- Copyright 2021 Bravura Solutions
4
-
5
- Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
6
-
1
+ ISC License
2
+
3
+ Copyright 2021 Bravura Solutions
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
6
+
7
7
  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -1,12 +1,12 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "./sizing.directive";
3
- import * as i2 from "./sizing-monitor.directive";
4
- import * as i3 from "@angular/common";
5
- /**
6
- * For functionality that cannot be easily achieved via CSS.
7
- */
8
- export declare class BehaviorModule {
9
- static ɵfac: i0.ɵɵFactoryDeclaration<BehaviorModule, never>;
10
- static ɵmod: i0.ɵɵNgModuleDeclaration<BehaviorModule, [typeof i1.SizingDirective, typeof i2.SizingMonitorDirective], [typeof i3.CommonModule], [typeof i1.SizingDirective, typeof i2.SizingMonitorDirective]>;
11
- static ɵinj: i0.ɵɵInjectorDeclaration<BehaviorModule>;
12
- }
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./sizing.directive";
3
+ import * as i2 from "./sizing-monitor.directive";
4
+ import * as i3 from "@angular/common";
5
+ /**
6
+ * For functionality that cannot be easily achieved via CSS.
7
+ */
8
+ export declare class BehaviorModule {
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<BehaviorModule, never>;
10
+ static ɵmod: i0.ɵɵNgModuleDeclaration<BehaviorModule, [typeof i1.SizingDirective, typeof i2.SizingMonitorDirective], [typeof i3.CommonModule], [typeof i1.SizingDirective, typeof i2.SizingMonitorDirective]>;
11
+ static ɵinj: i0.ɵɵInjectorDeclaration<BehaviorModule>;
12
+ }
@@ -1,5 +1,5 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@bravura/ui/behavior" />
5
- export * from './public-api';
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@bravura/ui/behavior" />
5
+ export * from './public-api';
@@ -1,3 +1,3 @@
1
- export * from './sizing.directive';
2
- export * from './sizing-monitor.directive';
3
- export * from './behavior.module';
1
+ export * from './sizing.directive';
2
+ export * from './sizing-monitor.directive';
3
+ export * from './behavior.module';
@@ -1,23 +1,23 @@
1
- import { ElementRef } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- /**
4
- * Use this directive to designate a target HTML element, based on which the child elements'
5
- * `[buiSizing]` directives will calculate the sizes.
6
- *
7
- * ```html
8
- * <div [buiSizingMonitor]>
9
- * <div [buiSizing]="...">
10
- * </div>
11
- * <div>
12
- * <div [buiSizing]="...">
13
- * </div>
14
- * </div>
15
- * <div>
16
- * ```
17
- */
18
- export declare class SizingMonitorDirective {
19
- readonly element: ElementRef<HTMLElement>;
20
- constructor(element: ElementRef<HTMLElement>);
21
- static ɵfac: i0.ɵɵFactoryDeclaration<SizingMonitorDirective, never>;
22
- static ɵdir: i0.ɵɵDirectiveDeclaration<SizingMonitorDirective, "[buiSizingMonitor]", never, {}, {}, never>;
23
- }
1
+ import { ElementRef } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Use this directive to designate a target HTML element, based on which the child elements'
5
+ * `[buiSizing]` directives will calculate the sizes.
6
+ *
7
+ * ```html
8
+ * <div [buiSizingMonitor]>
9
+ * <div [buiSizing]="...">
10
+ * </div>
11
+ * <div>
12
+ * <div [buiSizing]="...">
13
+ * </div>
14
+ * </div>
15
+ * <div>
16
+ * ```
17
+ */
18
+ export declare class SizingMonitorDirective {
19
+ readonly element: ElementRef<HTMLElement>;
20
+ constructor(element: ElementRef<HTMLElement>);
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<SizingMonitorDirective, never>;
22
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SizingMonitorDirective, "[buiSizingMonitor]", never, {}, {}, never>;
23
+ }
@@ -1,88 +1,94 @@
1
- import { ElementRef, EventEmitter, NgZone, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
2
- import { SizingMonitorDirective } from './sizing-monitor.directive';
3
- import * as i0 from "@angular/core";
4
- /**
5
- * This directive monitors the changes in width of the `sizingBy` target, and apply specified style
6
- * classes to the current element dynamically.
7
- *
8
- * In order for the layout engine to efficiently calculate and stabilize the dimensions, the effective style property
9
- * `box-sizing` of the `sizingBy` target element must be set to `border-box`.
10
- *
11
- * The directive uses [ResizeObserver API](https://developer.mozilla.org/en-US/docs/Web/API/Resize_Observer_API)
12
- * to capture the events of element resizing. Please use a polyfill if you want to support older browsers
13
- * that do not implement ResizeObserver API.
14
- *
15
- * Examples:
16
- *
17
- * ```html
18
- * <div #parentElement>
19
- * <div [buiSizing]="{'400': 'small', '800': 'medium', '~': 'large'}" [sizingBy]="parentElement"></div>
20
- * <div [buiSizing]="['small', 'medium', 'large']" [sizingBy]="'root'"></div>
21
- * </div>
22
- * ```
23
- */
24
- export declare class SizingDirective implements OnChanges, OnDestroy {
25
- private _doc;
26
- private _defaultTarget;
27
- private _zone;
28
- /**
29
- * @ignore
30
- */
31
- static defaultSizingBreakpoints: string[];
32
- /**
33
- * Specifies the breakpoint widths and the style classes.
34
- *
35
- * The sizing spec `{"400": "small", "800": "medium", "~": "large"}` tells the directive to apply
36
- * a style class `small` when the width of the monitored target is smaller than 400 pixels,
37
- * `medium` when the width is between 400 and 800 pixels, and `large` when above.
38
- *
39
- * @example {'400': 'small', '800': 'medium', '~': 'large'}
40
- */
41
- buiSizing: string | Array<string> | {
42
- [key: string]: string;
43
- };
44
- /**
45
- * The alias of `buiSizingBy`.
46
- */
47
- sizingBy: 'root' | 'parent' | HTMLElement;
48
- /**
49
- * Designate an element to be monitored for recalculating the style classes of the current element.
50
- *
51
- * `root` specifies the document root or the enclosing shadow host.
52
- * `parent` specifies the parent element.
53
- * @alias sizingBy
54
- */
55
- get buiSizingBy(): 'root' | 'parent' | HTMLElement;
56
- set buiSizingBy(target: 'root' | 'parent' | HTMLElement);
57
- /**
58
- * Emits `{width, height}` when the monitor target element resizes.
59
- *
60
- * Note that the dimensions emitted are of the [sizingBy] target, but not the current element.
61
- */
62
- buiResized: EventEmitter<{
63
- width: number;
64
- height: number;
65
- }>;
66
- /**
67
- * Recalculate the height of this element according to the height of the monitored target.
68
- */
69
- buiFixedHeight: boolean;
70
- private _monitorTarget;
71
- private _observer;
72
- private _sizingSpec;
73
- private _width;
74
- private _height;
75
- private _reflowFrameCount;
76
- private _element;
77
- constructor(_doc: Document, _defaultTarget: SizingMonitorDirective, elemRef: ElementRef<HTMLElement>, _zone: NgZone);
78
- ngOnChanges(_: SimpleChanges): void;
79
- ngOnDestroy(): void;
80
- private _initOrReset;
81
- private _setUpNodeMonitor;
82
- private _tearDownNodeMonitor;
83
- private _calculateSize;
84
- private _reflowHeight;
85
- private _toNumber;
86
- static ɵfac: i0.ɵɵFactoryDeclaration<SizingDirective, [null, { optional: true; }, null, null]>;
87
- static ɵdir: i0.ɵɵDirectiveDeclaration<SizingDirective, "[buiSizing],[buiResized],[buiSizingBy],[buiFixedHeight]", never, { "buiSizing": "buiSizing"; "sizingBy": "sizingBy"; "buiSizingBy": "buiSizingBy"; "buiFixedHeight": "buiFixedHeight"; }, { "buiResized": "buiResized"; }, never>;
88
- }
1
+ import { ElementRef, EventEmitter, NgZone, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
2
+ import { SizingMonitorDirective } from './sizing-monitor.directive';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * This directive monitors the changes in the width of the `sizingBy` target, and apply specified style
6
+ * classes and/or inline styles to the current element dynamically.
7
+ *
8
+ * In order for the layout engine to efficiently calculate and stabilize the dimensions, the effective style property
9
+ * `box-sizing` of the `sizingBy` target element must be set to `border-box`.
10
+ *
11
+ * The directive uses [ResizeObserver API](https://developer.mozilla.org/en-US/docs/Web/API/Resize_Observer_API)
12
+ * to capture the events of element resizing. Please use a polyfill if you want to support older browsers
13
+ * that do not implement ResizeObserver API.
14
+ *
15
+ * Examples:
16
+ *
17
+ * ```html
18
+ * <div #parentElement>
19
+ * <div [buiSizing]="{'400': 'small', '800': 'medium', '~': 'large'}" [buiSizingBy]="parentElement"></div>
20
+ * <div [buiSizing]="['small', 'medium', 'large']" [buiSizingBy]="'root'"></div>
21
+ * <div [buiSizing]="{'650': 'border-color: #28569', '~': 'bg-muted; border-style: dotted'}" [buiSizingBy]="parentElement"></div>
22
+ * </div>
23
+ * ```
24
+ */
25
+ export declare class SizingDirective implements OnChanges, OnDestroy {
26
+ private _doc;
27
+ private _defaultTarget;
28
+ private _zone;
29
+ /**
30
+ * @ignore
31
+ */
32
+ static defaultSizingBreakpoints: string[];
33
+ /**
34
+ * Specifies the breakpoint widths and the style classes.
35
+ *
36
+ * The sizing spec `{"400": "small", "800": "medium", "~": "large"}` tells the directive to apply
37
+ * a style class `small` when the width of the monitored target is smaller than 400 pixels,
38
+ * `medium` when the width is between 400 and 800 pixels, and `large` when above.
39
+ *
40
+ * @example {'400': 'small', '800': 'medium', '~': 'large'}
41
+ */
42
+ buiSizing: string | Array<string> | {
43
+ [key: string]: string;
44
+ };
45
+ /**
46
+ * The alias of `buiSizingBy`.
47
+ * @default 'root'
48
+ */
49
+ sizingBy: 'root' | 'parent' | HTMLElement;
50
+ /**
51
+ * Designate an element to be monitored for recalculating the style classes of the current element.
52
+ *
53
+ * - `root` specifies the document root or the enclosing shadow host. This is the default value.
54
+ * - `parent` specifies the parent element.
55
+ *
56
+ * @default 'root'
57
+ * @alias sizingBy
58
+ */
59
+ get buiSizingBy(): 'root' | 'parent' | HTMLElement;
60
+ set buiSizingBy(target: 'root' | 'parent' | HTMLElement);
61
+ /**
62
+ * Emits `{width, height}` when the monitor target element resizes.
63
+ *
64
+ * Note that the dimensions emitted are of the [sizingBy] target, but not the current element.
65
+ */
66
+ buiResized: EventEmitter<{
67
+ width: number;
68
+ height: number;
69
+ }>;
70
+ /**
71
+ * Recalculate the height of this element according to the height of the monitored target.
72
+ */
73
+ buiFixedHeight: boolean;
74
+ private _monitorTarget;
75
+ private _observer;
76
+ private _sizingSpec;
77
+ private _width;
78
+ private _height;
79
+ private _reflowFrameCount;
80
+ private _element;
81
+ constructor(_doc: Document, _defaultTarget: SizingMonitorDirective, elemRef: ElementRef<HTMLElement>, _zone: NgZone);
82
+ ngOnChanges(_: SimpleChanges): void;
83
+ ngOnDestroy(): void;
84
+ private _initOrReset;
85
+ private _setUpNodeMonitor;
86
+ private _tearDownNodeMonitor;
87
+ private _calculateSize;
88
+ private _applyClassesOrStyles;
89
+ private _removeClassesOrStyles;
90
+ private _reflowHeight;
91
+ private _toNumber;
92
+ static ɵfac: i0.ɵɵFactoryDeclaration<SizingDirective, [null, { optional: true; }, null, null]>;
93
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SizingDirective, "[buiSizing],[buiResized],[buiSizingBy],[buiFixedHeight]", never, { "buiSizing": "buiSizing"; "sizingBy": "sizingBy"; "buiSizingBy": "buiSizingBy"; "buiFixedHeight": "buiFixedHeight"; }, { "buiResized": "buiResized"; }, never>;
94
+ }
package/bravura-ui.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@bravura/ui" />
5
- export * from './public-api';
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@bravura/ui" />
5
+ export * from './public-api';