@bravobit/bb-foundation 0.21.4 → 0.22.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 (268) hide show
  1. package/auth/lib/auth.interceptor.d.ts +1 -1
  2. package/auth/lib/auth.module.d.ts +4 -5
  3. package/auth/lib/auth.service.d.ts +4 -7
  4. package/auth/lib/directives/abstract.directive.d.ts +12 -0
  5. package/auth/lib/directives/authenticated.directive.d.ts +7 -4
  6. package/auth/lib/directives/permission.directive.d.ts +11 -11
  7. package/auth/lib/guards/anonymous.guard.d.ts +8 -5
  8. package/auth/lib/guards/authenticated.guard.d.ts +8 -5
  9. package/auth/lib/guards/permission.guard.d.ts +15 -0
  10. package/auth/lib/interfaces/config.interface.d.ts +14 -8
  11. package/auth/lib/interfaces/permission.interface.d.ts +6 -0
  12. package/auth/lib/interfaces/provider.interface.d.ts +10 -3
  13. package/auth/lib/permissions/permissions.handler.d.ts +9 -0
  14. package/auth/lib/permissions/permissions.service.d.ts +16 -0
  15. package/auth/lib/providers/email.provider.d.ts +2 -8
  16. package/auth/lib/providers/verify.provider.d.ts +2 -6
  17. package/auth/public_api.d.ts +4 -4
  18. package/controls/lib/checkbox/checkbox/checkbox.component.d.ts +5 -1
  19. package/controls/lib/control-error/control-error/control-error.animation.d.ts +1 -0
  20. package/controls/lib/control-error/control-error/control-error.component.d.ts +17 -0
  21. package/controls/lib/control-error/control-error-submit.directive.d.ts +15 -0
  22. package/controls/lib/control-error/control-error.defaults.d.ts +2 -0
  23. package/controls/lib/control-error/control-error.interface.d.ts +12 -0
  24. package/controls/lib/control-error/control-error.module.d.ts +9 -0
  25. package/controls/lib/controls.interfaces.d.ts +4 -0
  26. package/controls/lib/controls.module.d.ts +7 -2
  27. package/controls/lib/form-control/form-control/form-control.component.d.ts +31 -0
  28. package/controls/lib/form-control/form-control-addon/form-control-addon.component.d.ts +6 -0
  29. package/controls/lib/form-control/form-control-input.directive.d.ts +35 -0
  30. package/controls/lib/form-control/form-control.module.d.ts +11 -0
  31. package/controls/public_api.d.ts +9 -0
  32. package/dashboard/lib/dashboard/dashboard.component.d.ts +2 -1
  33. package/dialog/lib/dialog-confirm/dialog-confirm.component.d.ts +10 -5
  34. package/dialog/lib/dialog-container/dialog-container.animations.d.ts +1 -0
  35. package/dialog/lib/dialog-container/dialog-container.component.d.ts +5 -7
  36. package/dialog/lib/dialog-header/dialog-header.component.d.ts +1 -3
  37. package/dialog/lib/dialog-modal/dialog-modal.component.d.ts +7 -3
  38. package/dialog/lib/dialog-overlay/dialog-overlay.animations.d.ts +1 -0
  39. package/dialog/lib/dialog-overlay/dialog-overlay.component.d.ts +5 -7
  40. package/dialog/lib/dialog.service.d.ts +4 -3
  41. package/elements/lib/directives/focus-trap.directive.d.ts +1 -1
  42. package/elements/lib/directives/focus.directive.d.ts +1 -3
  43. package/elements/lib/directives/form-submitter.directive.d.ts +9 -0
  44. package/elements/lib/elements.module.d.ts +25 -24
  45. package/elements/lib/form-error/form-error.component.d.ts +9 -5
  46. package/elements/lib/pipes/file-image.pipe.d.ts +2 -1
  47. package/elements/public_api.d.ts +1 -0
  48. package/esm2020/auth/lib/auth.interceptor.mjs +9 -12
  49. package/esm2020/auth/lib/auth.module.mjs +7 -17
  50. package/esm2020/auth/lib/auth.service.mjs +29 -55
  51. package/esm2020/auth/lib/directives/abstract.directive.mjs +40 -0
  52. package/esm2020/auth/lib/directives/authenticated.directive.mjs +25 -14
  53. package/esm2020/auth/lib/directives/permission.directive.mjs +24 -46
  54. package/esm2020/auth/lib/guards/anonymous.guard.mjs +28 -19
  55. package/esm2020/auth/lib/guards/authenticated.guard.mjs +31 -20
  56. package/esm2020/auth/lib/guards/permission.guard.mjs +53 -0
  57. package/esm2020/auth/lib/helpers/jwt.helper.mjs +7 -7
  58. package/esm2020/auth/lib/interfaces/config.interface.mjs +1 -1
  59. package/esm2020/auth/lib/interfaces/permission.interface.mjs +2 -0
  60. package/esm2020/auth/lib/interfaces/provider.interface.mjs +1 -1
  61. package/esm2020/auth/lib/permissions/permissions.handler.mjs +33 -0
  62. package/esm2020/auth/lib/permissions/permissions.service.mjs +64 -0
  63. package/esm2020/auth/lib/providers/email.provider.mjs +8 -9
  64. package/esm2020/auth/lib/providers/verify.provider.mjs +8 -5
  65. package/esm2020/auth/public_api.mjs +5 -5
  66. package/esm2020/collections/lib/collections.module.mjs +4 -4
  67. package/esm2020/collections/lib/components/collections-pager/collections-pager.component.mjs +3 -3
  68. package/esm2020/collections/lib/components/collections-viewer/collections-viewer.component.mjs +3 -3
  69. package/esm2020/collections/lib/components/collections.directive.mjs +12 -12
  70. package/esm2020/controls/lib/checkbox/checkbox/checkbox.component.mjs +19 -6
  71. package/esm2020/controls/lib/checkbox/checkbox-group/checkbox-group.component.mjs +4 -4
  72. package/esm2020/controls/lib/checkbox/checkbox.module.mjs +4 -4
  73. package/esm2020/controls/lib/control-error/control-error/control-error.animation.mjs +14 -0
  74. package/esm2020/controls/lib/control-error/control-error/control-error.component.mjs +63 -0
  75. package/esm2020/controls/lib/control-error/control-error-submit.directive.mjs +47 -0
  76. package/esm2020/controls/lib/control-error/control-error.defaults.mjs +26 -0
  77. package/esm2020/controls/lib/control-error/control-error.interface.mjs +3 -0
  78. package/esm2020/controls/lib/control-error/control-error.module.mjs +19 -0
  79. package/esm2020/controls/lib/controls.interfaces.mjs +2 -0
  80. package/esm2020/controls/lib/controls.module.mjs +45 -8
  81. package/esm2020/controls/lib/form-control/form-control/form-control.component.mjs +94 -0
  82. package/esm2020/controls/lib/form-control/form-control-addon/form-control-addon.component.mjs +22 -0
  83. package/esm2020/controls/lib/form-control/form-control-input.directive.mjs +124 -0
  84. package/esm2020/controls/lib/form-control/form-control.module.mjs +33 -0
  85. package/esm2020/controls/public_api.mjs +10 -1
  86. package/esm2020/dashboard/lib/dashboard/dashboard.component.mjs +7 -6
  87. package/esm2020/dashboard/lib/dashboard-header/dashboard-header.component.mjs +3 -3
  88. package/esm2020/dashboard/lib/dashboard-menu/dashboard-menu.component.mjs +3 -3
  89. package/esm2020/dashboard/lib/dashboard-menu-item/dashboard-menu-item.component.mjs +3 -3
  90. package/esm2020/dashboard/lib/dashboard-sidebar/dashboard-sidebar.component.mjs +3 -3
  91. package/esm2020/dashboard/lib/dashboard-sidebar-group/dashboard-sidebar-group.component.mjs +3 -3
  92. package/esm2020/dashboard/lib/dashboard-sidebar-item/dashboard-sidebar-item.component.mjs +3 -3
  93. package/esm2020/dashboard/lib/dashboard.module.mjs +4 -4
  94. package/esm2020/dialog/lib/dialog-actions/dialog-actions.component.mjs +3 -3
  95. package/esm2020/dialog/lib/dialog-confirm/dialog-confirm.component.mjs +17 -11
  96. package/esm2020/dialog/lib/dialog-container/dialog-container.animations.mjs +29 -0
  97. package/esm2020/dialog/lib/dialog-container/dialog-container.component.mjs +28 -104
  98. package/esm2020/dialog/lib/dialog-header/dialog-header.component.mjs +7 -14
  99. package/esm2020/dialog/lib/dialog-link/dialog-link.component.mjs +4 -4
  100. package/esm2020/dialog/lib/dialog-modal/dialog-modal.component.mjs +29 -8
  101. package/esm2020/dialog/lib/dialog-overlay/dialog-overlay.animations.mjs +26 -0
  102. package/esm2020/dialog/lib/dialog-overlay/dialog-overlay.component.mjs +29 -84
  103. package/esm2020/dialog/lib/dialog.insertion.mjs +3 -3
  104. package/esm2020/dialog/lib/dialog.module.mjs +4 -4
  105. package/esm2020/dialog/lib/dialog.service.mjs +8 -7
  106. package/esm2020/elements/lib/avatar/avatar.component.mjs +8 -6
  107. package/esm2020/elements/lib/button/button.component.mjs +6 -6
  108. package/esm2020/elements/lib/checkbox/checkbox.component.mjs +3 -3
  109. package/esm2020/elements/lib/date-picker/date-picker.component.mjs +3 -3
  110. package/esm2020/elements/lib/directives/addon.directive.mjs +6 -6
  111. package/esm2020/elements/lib/directives/autosize.directive.mjs +3 -3
  112. package/esm2020/elements/lib/directives/focus-trap.directive.mjs +5 -5
  113. package/esm2020/elements/lib/directives/focus.directive.mjs +7 -9
  114. package/esm2020/elements/lib/directives/form-submit.directive.mjs +3 -3
  115. package/esm2020/elements/lib/directives/form-submitter.directive.mjs +25 -0
  116. package/esm2020/elements/lib/directives/input.directive.mjs +6 -6
  117. package/esm2020/elements/lib/directives/template.directive.mjs +3 -3
  118. package/esm2020/elements/lib/dropdown/dropdown.component.mjs +6 -6
  119. package/esm2020/elements/lib/elements.module.mjs +9 -5
  120. package/esm2020/elements/lib/file-picker/file-picker.component.mjs +3 -3
  121. package/esm2020/elements/lib/form-control/form-control.component.mjs +3 -3
  122. package/esm2020/elements/lib/form-error/form-error.component.mjs +22 -7
  123. package/esm2020/elements/lib/form-group/form-group.component.mjs +3 -3
  124. package/esm2020/elements/lib/icon/icon.component.mjs +3 -3
  125. package/esm2020/elements/lib/image-picker/image-picker.component.mjs +3 -3
  126. package/esm2020/elements/lib/pipes/file-image.pipe.mjs +8 -7
  127. package/esm2020/elements/lib/pipes/file-size.pipe.mjs +3 -3
  128. package/esm2020/elements/lib/pipes/relative-time.pipe.mjs +3 -3
  129. package/esm2020/elements/lib/spinner/spinner.component.mjs +3 -3
  130. package/esm2020/elements/lib/tag/tag.component.mjs +3 -3
  131. package/esm2020/elements/public_api.mjs +2 -1
  132. package/esm2020/http/lib/http.module.mjs +4 -4
  133. package/esm2020/http/lib/interceptors/base-url.interceptor.mjs +3 -3
  134. package/esm2020/http/lib/interceptors/error.interceptor.mjs +3 -3
  135. package/esm2020/lib/core/services/clipboard.service.mjs +5 -5
  136. package/esm2020/lib/core/services/exif.service.mjs +5 -5
  137. package/esm2020/lib/core/services/file-loader.service.mjs +3 -3
  138. package/esm2020/lib/core/services/image-converter.service.mjs +5 -5
  139. package/esm2020/lib/core/services/languages.service.mjs +3 -3
  140. package/esm2020/lib/core/services/network.service.mjs +7 -7
  141. package/esm2020/lib/core/services/patch.service.mjs +7 -7
  142. package/esm2020/localize/lib/localize.module.mjs +4 -4
  143. package/esm2020/localize/lib/localize.pipe.mjs +3 -3
  144. package/esm2020/localize/lib/localize.service.mjs +5 -5
  145. package/esm2020/localize/lib/views/localize-string/localize-string.component.mjs +3 -3
  146. package/esm2020/localize/lib/views/localize-template-or-string.directive.mjs +3 -3
  147. package/esm2020/localize/lib/views/localize-template.directive.mjs +3 -3
  148. package/esm2020/masking/lib/directives/currency-mask.directive.mjs +3 -3
  149. package/esm2020/masking/lib/directives/date-mask.directive.mjs +3 -3
  150. package/esm2020/masking/lib/directives/input-mask.directive.mjs +7 -7
  151. package/esm2020/masking/lib/masking.module.mjs +4 -4
  152. package/esm2020/masking/lib/masking.service.mjs +3 -3
  153. package/esm2020/notifications/lib/notifications-item/notifications-item.component.mjs +5 -5
  154. package/esm2020/notifications/lib/notifications-list/notifications-list.component.mjs +7 -7
  155. package/esm2020/notifications/lib/notifications.module.mjs +4 -4
  156. package/esm2020/notifications/lib/notifications.service.mjs +5 -5
  157. package/esm2020/public_api.mjs +1 -2
  158. package/esm2020/recaptcha/lib/recaptcha/recaptcha.component.mjs +3 -3
  159. package/esm2020/recaptcha/lib/recaptcha-loader.service.mjs +10 -10
  160. package/esm2020/recaptcha/lib/recaptcha.module.mjs +4 -4
  161. package/esm2020/storage/lib/storage.service.mjs +5 -5
  162. package/esm2020/table/lib/components/table/table.component.mjs +9 -9
  163. package/esm2020/table/lib/components/table-cell/table-cell.component.mjs +3 -3
  164. package/esm2020/table/lib/components/table-header-cell/table-header-cell.component.mjs +3 -3
  165. package/esm2020/table/lib/components/table-pager/table-pager.component.mjs +3 -3
  166. package/esm2020/table/lib/table.module.mjs +4 -4
  167. package/esm2020/theming/lib/themes/checkbox-group.theme.mjs +17 -2
  168. package/esm2020/theming/lib/themes/checkbox.theme.mjs +35 -2
  169. package/esm2020/theming/lib/themes/control-error.theme.mjs +11 -0
  170. package/esm2020/theming/lib/themes/form-control-addon.theme.mjs +6 -0
  171. package/esm2020/theming/lib/themes/form-control.theme.mjs +45 -0
  172. package/esm2020/theming/lib/theming.data.mjs +82 -0
  173. package/esm2020/theming/lib/theming.directive.mjs +38 -0
  174. package/esm2020/theming/lib/theming.interface.mjs +2 -3
  175. package/esm2020/theming/lib/theming.module.mjs +12 -34
  176. package/esm2020/theming/lib/utils/theming.variable.mjs +41 -0
  177. package/esm2020/theming/public_api.mjs +6 -3
  178. package/fesm2015/bravobit-bb-foundation-auth.mjs +326 -284
  179. package/fesm2015/bravobit-bb-foundation-auth.mjs.map +1 -1
  180. package/fesm2015/bravobit-bb-foundation-collections.mjs +22 -22
  181. package/fesm2015/bravobit-bb-foundation-controls.mjs +493 -24
  182. package/fesm2015/bravobit-bb-foundation-controls.mjs.map +1 -1
  183. package/fesm2015/bravobit-bb-foundation-dashboard.mjs +29 -28
  184. package/fesm2015/bravobit-bb-foundation-dashboard.mjs.map +1 -1
  185. package/fesm2015/bravobit-bb-foundation-dialog.mjs +185 -233
  186. package/fesm2015/bravobit-bb-foundation-dialog.mjs.map +1 -1
  187. package/fesm2015/bravobit-bb-foundation-elements.mjs +140 -99
  188. package/fesm2015/bravobit-bb-foundation-elements.mjs.map +1 -1
  189. package/fesm2015/bravobit-bb-foundation-http.mjs +10 -10
  190. package/fesm2015/bravobit-bb-foundation-localize.mjs +20 -20
  191. package/fesm2015/bravobit-bb-foundation-localize.mjs.map +1 -1
  192. package/fesm2015/bravobit-bb-foundation-masking.mjs +20 -19
  193. package/fesm2015/bravobit-bb-foundation-masking.mjs.map +1 -1
  194. package/fesm2015/bravobit-bb-foundation-notifications.mjs +18 -17
  195. package/fesm2015/bravobit-bb-foundation-notifications.mjs.map +1 -1
  196. package/fesm2015/bravobit-bb-foundation-recaptcha.mjs +16 -16
  197. package/fesm2015/bravobit-bb-foundation-recaptcha.mjs.map +1 -1
  198. package/fesm2015/bravobit-bb-foundation-storage.mjs +4 -4
  199. package/fesm2015/bravobit-bb-foundation-storage.mjs.map +1 -1
  200. package/fesm2015/bravobit-bb-foundation-table.mjs +22 -22
  201. package/fesm2015/bravobit-bb-foundation-theming.mjs +251 -128
  202. package/fesm2015/bravobit-bb-foundation-theming.mjs.map +1 -1
  203. package/fesm2015/bravobit-bb-foundation.mjs +33 -73
  204. package/fesm2015/bravobit-bb-foundation.mjs.map +1 -1
  205. package/fesm2020/bravobit-bb-foundation-auth.mjs +306 -277
  206. package/fesm2020/bravobit-bb-foundation-auth.mjs.map +1 -1
  207. package/fesm2020/bravobit-bb-foundation-collections.mjs +22 -22
  208. package/fesm2020/bravobit-bb-foundation-controls.mjs +477 -24
  209. package/fesm2020/bravobit-bb-foundation-controls.mjs.map +1 -1
  210. package/fesm2020/bravobit-bb-foundation-dashboard.mjs +29 -28
  211. package/fesm2020/bravobit-bb-foundation-dashboard.mjs.map +1 -1
  212. package/fesm2020/bravobit-bb-foundation-dialog.mjs +175 -233
  213. package/fesm2020/bravobit-bb-foundation-dialog.mjs.map +1 -1
  214. package/fesm2020/bravobit-bb-foundation-elements.mjs +140 -99
  215. package/fesm2020/bravobit-bb-foundation-elements.mjs.map +1 -1
  216. package/fesm2020/bravobit-bb-foundation-http.mjs +10 -10
  217. package/fesm2020/bravobit-bb-foundation-localize.mjs +20 -20
  218. package/fesm2020/bravobit-bb-foundation-localize.mjs.map +1 -1
  219. package/fesm2020/bravobit-bb-foundation-masking.mjs +19 -19
  220. package/fesm2020/bravobit-bb-foundation-masking.mjs.map +1 -1
  221. package/fesm2020/bravobit-bb-foundation-notifications.mjs +17 -17
  222. package/fesm2020/bravobit-bb-foundation-notifications.mjs.map +1 -1
  223. package/fesm2020/bravobit-bb-foundation-recaptcha.mjs +16 -16
  224. package/fesm2020/bravobit-bb-foundation-recaptcha.mjs.map +1 -1
  225. package/fesm2020/bravobit-bb-foundation-storage.mjs +4 -4
  226. package/fesm2020/bravobit-bb-foundation-storage.mjs.map +1 -1
  227. package/fesm2020/bravobit-bb-foundation-table.mjs +22 -22
  228. package/fesm2020/bravobit-bb-foundation-theming.mjs +252 -120
  229. package/fesm2020/bravobit-bb-foundation-theming.mjs.map +1 -1
  230. package/fesm2020/bravobit-bb-foundation.mjs +32 -70
  231. package/fesm2020/bravobit-bb-foundation.mjs.map +1 -1
  232. package/lib/core/services/clipboard.service.d.ts +2 -2
  233. package/lib/core/services/exif.service.d.ts +1 -1
  234. package/lib/core/services/image-converter.service.d.ts +1 -1
  235. package/lib/core/services/network.service.d.ts +4 -4
  236. package/lib/core/services/patch.service.d.ts +4 -4
  237. package/localize/lib/localize.service.d.ts +1 -1
  238. package/notifications/lib/notifications-item/notifications-item.component.d.ts +1 -1
  239. package/notifications/lib/notifications.service.d.ts +1 -1
  240. package/package.json +4 -4
  241. package/public_api.d.ts +0 -1
  242. package/recaptcha/lib/recaptcha-loader.service.d.ts +3 -3
  243. package/storage/lib/storage.service.d.ts +1 -1
  244. package/theming/lib/themes/checkbox-group.theme.d.ts +14 -3
  245. package/theming/lib/themes/checkbox.theme.d.ts +30 -17
  246. package/theming/lib/themes/control-error.theme.d.ts +9 -0
  247. package/theming/lib/themes/form-control-addon.theme.d.ts +5 -0
  248. package/theming/lib/themes/form-control.theme.d.ts +32 -0
  249. package/theming/lib/theming.data.d.ts +17 -0
  250. package/theming/lib/theming.directive.d.ts +13 -0
  251. package/theming/lib/theming.interface.d.ts +19 -8
  252. package/theming/lib/theming.module.d.ts +3 -9
  253. package/theming/lib/utils/theming.variable.d.ts +16 -0
  254. package/theming/public_api.d.ts +5 -2
  255. package/auth/lib/directives/role.directive.d.ts +0 -16
  256. package/auth/lib/helpers/mapper.helper.d.ts +0 -23
  257. package/auth/lib/interfaces/mapper.interface.d.ts +0 -19
  258. package/auth/lib/permissions.service.d.ts +0 -14
  259. package/esm2020/auth/lib/directives/role.directive.mjs +0 -37
  260. package/esm2020/auth/lib/helpers/mapper.helper.mjs +0 -35
  261. package/esm2020/auth/lib/interfaces/mapper.interface.mjs +0 -2
  262. package/esm2020/auth/lib/permissions.service.mjs +0 -56
  263. package/esm2020/lib/core/services/platform.service.mjs +0 -42
  264. package/esm2020/theming/lib/themes/theme.mjs +0 -34
  265. package/esm2020/theming/lib/theming.service.mjs +0 -77
  266. package/lib/core/services/platform.service.d.ts +0 -18
  267. package/theming/lib/themes/theme.d.ts +0 -12
  268. package/theming/lib/theming.service.d.ts +0 -22
@@ -1,11 +1,11 @@
1
1
  import { take, switchMap } from 'rxjs/operators';
2
- import { Subject, lastValueFrom, fromEvent, race } from 'rxjs';
2
+ import { Subject, Subscription, lastValueFrom, fromEvent, race } from 'rxjs';
3
3
  import * as i0 from '@angular/core';
4
- import { EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, HostListener, HostBinding, Directive, ViewChild, Injectable, NgModule } from '@angular/core';
4
+ import { EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, Output, HostListener, Optional, Inject, HostBinding, Input, Directive, ViewChild, Injectable, NgModule } from '@angular/core';
5
5
  import { trigger, transition, group, query, style, animate } from '@angular/animations';
6
- import * as i1 from '@bravobit/bb-foundation';
7
6
  import * as i1$1 from '@angular/common';
8
- import { CommonModule } from '@angular/common';
7
+ import { DOCUMENT, CommonModule } from '@angular/common';
8
+ import * as i1 from '@bravobit/bb-foundation';
9
9
  import * as i4 from '@bravobit/bb-foundation/elements';
10
10
  import { BbButton, ElementsModule } from '@bravobit/bb-foundation/elements';
11
11
  import * as i8 from '@bravobit/bb-foundation/localize';
@@ -34,37 +34,57 @@ class BbDialogRef {
34
34
  class BbDialogConfig {
35
35
  }
36
36
 
37
+ const bbDialogOverlayAnimation = trigger('bbDialogOverlayAnimation', [
38
+ transition(':enter, * => open', [
39
+ group([
40
+ query('.bb-dialog-overlay-backdrop', [
41
+ style({ opacity: 0 }),
42
+ animate('240ms cubic-bezier(0, 0, 0.2, 1)', style({ opacity: 1 }))
43
+ ]),
44
+ query('.bb-dialog-modal', [
45
+ style({ opacity: 0, transform: 'scale(0.98)' }),
46
+ animate('200ms cubic-bezier(0, 0, 0.2, 1)', style({ opacity: 1, transform: 'none' }))
47
+ ])
48
+ ])
49
+ ]),
50
+ transition(':leave, * => close', [
51
+ group([
52
+ query('.bb-dialog-modal', [
53
+ animate('200ms cubic-bezier(0, 0, 0.2, 1)', style({ opacity: 0, transform: 'scale(0.98)' }))
54
+ ]),
55
+ query('.bb-dialog-overlay-backdrop', [
56
+ animate('240ms cubic-bezier(0, 0, 0.2, 1)', style({ opacity: 0 }))
57
+ ])
58
+ ])
59
+ ])
60
+ ]);
61
+
37
62
  class BbDialogOverlay {
38
63
  constructor(_elementRef, _changeDetection) {
39
64
  this._elementRef = _elementRef;
40
65
  this._changeDetection = _changeDetection;
41
- // Inputs.
42
- this.animations = true;
43
66
  // Outputs.
44
67
  this.closeRequested = new EventEmitter();
45
68
  // State.
46
- this._state = 'open';
69
+ this.state = 'open';
47
70
  this._closed$ = new Subject();
71
+ // Subscriptions.
72
+ this._subscription = new Subscription();
48
73
  }
49
- get state() {
50
- return this.animations
51
- ? this._state
52
- : 'none';
53
- }
54
- ngAfterViewInit() {
74
+ ngOnInit() {
55
75
  this.listenForClicks();
56
76
  }
57
77
  ngOnDestroy() {
58
78
  this._subscription?.unsubscribe();
59
79
  }
60
80
  onKeyEvent(event) {
61
- if (event.key === 'Escape') {
81
+ if (event?.key === 'Escape') {
62
82
  this.closeRequested.emit();
63
83
  }
64
84
  }
65
85
  onAnimationDone(event) {
66
86
  // Check if the dialog is being destroyed.
67
- if (!['close', 'none'].includes(event.toState)) {
87
+ if (!['close'].includes(event?.toState)) {
68
88
  return;
69
89
  }
70
90
  this._closed$.next();
@@ -73,99 +93,51 @@ class BbDialogOverlay {
73
93
  close() {
74
94
  // We need change detection to run
75
95
  // here else it won't close in all scenario's.
76
- this._state = 'close';
96
+ this.state = 'close';
77
97
  this._changeDetection.markForCheck();
78
98
  // Listen for the closed trigger.
79
99
  const observable$ = this._closed$.pipe(take(1));
80
100
  return lastValueFrom(observable$);
81
101
  }
82
102
  listenForClicks() {
83
- if (!this._elementRef || !this._elementRef.nativeElement) {
103
+ const element = this._elementRef?.nativeElement ?? null;
104
+ if (!element) {
84
105
  return;
85
106
  }
86
- const mouseDown$ = fromEvent(this._elementRef.nativeElement, 'mousedown');
87
- const touchStart$ = fromEvent(this._elementRef.nativeElement, 'touchstart');
107
+ const mouseDown$ = fromEvent(element, 'mousedown');
108
+ const touchStart$ = fromEvent(element, 'touchstart');
88
109
  const start$ = race([mouseDown$, touchStart$]);
89
- const mouseUp$ = fromEvent(this._elementRef.nativeElement, 'mouseup');
90
- const touchEnd$ = fromEvent(this._elementRef.nativeElement, 'touchend');
110
+ const mouseUp$ = fromEvent(element, 'mouseup');
111
+ const touchEnd$ = fromEvent(element, 'touchend');
91
112
  const end$ = race([mouseUp$, touchEnd$]);
92
- this._subscription = start$.pipe(switchMap(() => end$)).subscribe(() => {
93
- this.closeRequested.next();
94
- });
113
+ const clicks$ = start$.pipe(switchMap(() => end$));
114
+ const subscription = clicks$.subscribe(() => this.closeRequested.next());
115
+ this._subscription.add(subscription);
95
116
  }
96
117
  }
97
- BbDialogOverlay.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: BbDialogOverlay, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
98
- BbDialogOverlay.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.4", type: BbDialogOverlay, selector: "bb-dialog-overlay", inputs: { animations: "animations" }, outputs: { closeRequested: "closeRequested" }, host: { listeners: { "window:keyup": "onKeyEvent($event)", "@bbDialogAnimation.done": "onAnimationDone($event)" }, properties: { "@bbDialogAnimation": "state" }, classAttribute: "bb-dialog-overlay" }, ngImport: i0, template: "<div class=\"bb-dialog-overlay-backdrop\"></div>\n\n<ng-content select=\"[bb-dialog-modal]\"></ng-content>\n", styles: [".bb-dialog-overlay,.bb-dialog-overlay-backdrop{top:0;left:0;right:0;bottom:0;display:flex;z-index:1000;position:fixed;flex-direction:column}.bb-dialog-overlay{padding:20px}.bb-dialog-overlay-backdrop{background-color:#00000080}.bb-dialog-overlay-component{z-index:1001;display:block;position:relative}\n"], animations: [
99
- trigger('bbDialogAnimation', [
100
- transition('* => none', []),
101
- transition(':enter, * => open', [
102
- group([
103
- query('.bb-dialog-overlay-backdrop', [
104
- style({ opacity: 0 }),
105
- animate('150ms cubic-bezier(0, 0, 0.2, 1)', style({ opacity: 1 }))
106
- ]),
107
- query('.bb-dialog-modal', [
108
- style({ transform: 'scale(0.95)' }),
109
- animate('150ms cubic-bezier(0, 0, 0.2, 1)', style({ transform: 'scale(1)' }))
110
- ])
111
- ])
112
- ]),
113
- transition(':leave, * => close', [
114
- group([
115
- query('.bb-dialog-overlay-backdrop', [
116
- animate('150ms cubic-bezier(0, 0, 0.2, 1)', style({ opacity: 0 }))
117
- ]),
118
- query('.bb-dialog-modal', [
119
- animate('150ms cubic-bezier(0, 0, 0.2, 1)', style({ opacity: 0, transform: 'scale(0.95)' }))
120
- ])
121
- ])
122
- ])
123
- ])
124
- ], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
125
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: BbDialogOverlay, decorators: [{
118
+ BbDialogOverlay.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: BbDialogOverlay, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
119
+ BbDialogOverlay.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.1", type: BbDialogOverlay, selector: "bb-dialog-overlay", outputs: { closeRequested: "closeRequested" }, host: { listeners: { "window:keyup": "onKeyEvent($event)", "@bbDialogOverlayAnimation.done": "onAnimationDone($event)" }, properties: { "@bbDialogOverlayAnimation": "state" }, classAttribute: "bb-dialog-overlay" }, ngImport: i0, template: "<div class=\"bb-dialog-overlay-backdrop\"></div>\n\n<ng-content select=\"[bb-dialog-modal]\"></ng-content>\n", styles: [".bb-dialog-overlay,.bb-dialog-overlay-backdrop{top:0;left:0;right:0;bottom:0;display:flex;z-index:1000;position:fixed;flex-direction:column}.bb-dialog-overlay{padding:20px}.bb-dialog-overlay-backdrop{will-change:opacity;background-color:#1119}.bb-dialog-overlay-component{z-index:1001;display:block;position:relative}\n"], animations: [bbDialogOverlayAnimation], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
120
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: BbDialogOverlay, decorators: [{
126
121
  type: Component,
127
- args: [{ selector: 'bb-dialog-overlay', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, host: { 'class': 'bb-dialog-overlay', '[@bbDialogAnimation]': 'state' }, animations: [
128
- trigger('bbDialogAnimation', [
129
- transition('* => none', []),
130
- transition(':enter, * => open', [
131
- group([
132
- query('.bb-dialog-overlay-backdrop', [
133
- style({ opacity: 0 }),
134
- animate('150ms cubic-bezier(0, 0, 0.2, 1)', style({ opacity: 1 }))
135
- ]),
136
- query('.bb-dialog-modal', [
137
- style({ transform: 'scale(0.95)' }),
138
- animate('150ms cubic-bezier(0, 0, 0.2, 1)', style({ transform: 'scale(1)' }))
139
- ])
140
- ])
141
- ]),
142
- transition(':leave, * => close', [
143
- group([
144
- query('.bb-dialog-overlay-backdrop', [
145
- animate('150ms cubic-bezier(0, 0, 0.2, 1)', style({ opacity: 0 }))
146
- ]),
147
- query('.bb-dialog-modal', [
148
- animate('150ms cubic-bezier(0, 0, 0.2, 1)', style({ opacity: 0, transform: 'scale(0.95)' }))
149
- ])
150
- ])
151
- ])
152
- ])
153
- ], template: "<div class=\"bb-dialog-overlay-backdrop\"></div>\n\n<ng-content select=\"[bb-dialog-modal]\"></ng-content>\n", styles: [".bb-dialog-overlay,.bb-dialog-overlay-backdrop{top:0;left:0;right:0;bottom:0;display:flex;z-index:1000;position:fixed;flex-direction:column}.bb-dialog-overlay{padding:20px}.bb-dialog-overlay-backdrop{background-color:#00000080}.bb-dialog-overlay-component{z-index:1001;display:block;position:relative}\n"] }]
154
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { animations: [{
155
- type: Input
156
- }], closeRequested: [{
122
+ args: [{ selector: 'bb-dialog-overlay', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, host: {
123
+ 'class': 'bb-dialog-overlay',
124
+ '[@bbDialogOverlayAnimation]': 'state'
125
+ }, animations: [bbDialogOverlayAnimation], template: "<div class=\"bb-dialog-overlay-backdrop\"></div>\n\n<ng-content select=\"[bb-dialog-modal]\"></ng-content>\n", styles: [".bb-dialog-overlay,.bb-dialog-overlay-backdrop{top:0;left:0;right:0;bottom:0;display:flex;z-index:1000;position:fixed;flex-direction:column}.bb-dialog-overlay{padding:20px}.bb-dialog-overlay-backdrop{will-change:opacity;background-color:#1119}.bb-dialog-overlay-component{z-index:1001;display:block;position:relative}\n"] }]
126
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { closeRequested: [{
157
127
  type: Output
158
128
  }], onKeyEvent: [{
159
129
  type: HostListener,
160
130
  args: ['window:keyup', ['$event']]
161
131
  }], onAnimationDone: [{
162
132
  type: HostListener,
163
- args: ['@bbDialogAnimation.done', ['$event']]
133
+ args: ['@bbDialogOverlayAnimation.done', ['$event']]
164
134
  }] } });
165
135
 
166
136
  class BbDialogModal {
167
- constructor(_patch) {
137
+ constructor(_patch, _renderer, _document) {
168
138
  this._patch = _patch;
139
+ this._renderer = _renderer;
140
+ this._document = _document;
169
141
  // Styling.
170
142
  this.maxWidth = '420px';
171
143
  }
@@ -174,17 +146,35 @@ class BbDialogModal {
174
146
  }
175
147
  ngOnInit() {
176
148
  this._patch.mobileVerticalHeight();
149
+ this.allowGlobalOverflow(false);
150
+ }
151
+ ngOnDestroy() {
152
+ this.allowGlobalOverflow(true);
153
+ }
154
+ allowGlobalOverflow(allow) {
155
+ const element = this._document?.documentElement ?? null;
156
+ if (!element) {
157
+ return;
158
+ }
159
+ allow
160
+ ? this._renderer.removeStyle(element, 'overflow')
161
+ : this._renderer.setStyle(element, 'overflow', 'hidden');
177
162
  }
178
163
  }
179
- BbDialogModal.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: BbDialogModal, deps: [{ token: i1.Patch }], target: i0.ɵɵFactoryTarget.Component });
180
- BbDialogModal.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.4", type: BbDialogModal, selector: "[bb-dialog-modal]", inputs: { maxWidth: "maxWidth" }, host: { attributes: { "role": "dialog" }, listeners: { "click": "onOverlayClickedEvent($event)", "touchstart": "onOverlayClickedEvent($event)", "touchend": "onOverlayClickedEvent($event)", "mouseup": "onOverlayClickedEvent($event)", "mousedown": "onOverlayClickedEvent($event)" }, properties: { "style.max-width": "this.maxWidth" }, classAttribute: "bb-dialog-modal" }, ngImport: i0, template: "<ng-content select=\"[bb-dialog-header]\">\n\n</ng-content>\n\n<div class=\"bb-dialog-modal-body\">\n <ng-content></ng-content>\n</div>\n\n<ng-content select=\"[bb-dialog-actions]\">\n\n</ng-content>\n", styles: [".bb-dialog-modal{width:100%;margin:auto;z-index:1001;display:flex;max-width:420px;border-radius:4px;position:relative;flex-direction:column;background-color:#fff;max-height:calc(var(--vh, 1vh) * 100 - 40px)}.bb-dialog-modal-body{padding:20px;color:#738694;font-size:13px;overflow-y:auto;line-height:1.4;background-color:#f1f3f6}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
181
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: BbDialogModal, decorators: [{
164
+ BbDialogModal.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: BbDialogModal, deps: [{ token: i1.Patch }, { token: i0.Renderer2 }, { token: DOCUMENT, optional: true }], target: i0.ɵɵFactoryTarget.Component });
165
+ BbDialogModal.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.1", type: BbDialogModal, selector: "[bb-dialog-modal]", inputs: { maxWidth: "maxWidth" }, host: { attributes: { "role": "dialog" }, listeners: { "click": "onOverlayClickedEvent($event)", "touchstart": "onOverlayClickedEvent($event)", "touchend": "onOverlayClickedEvent($event)", "mouseup": "onOverlayClickedEvent($event)", "mousedown": "onOverlayClickedEvent($event)" }, properties: { "style.max-width": "this.maxWidth" }, classAttribute: "bb-dialog-modal" }, ngImport: i0, template: "<ng-content select=\"[bb-dialog-header]\">\n\n</ng-content>\n\n<div class=\"bb-dialog-modal-body\">\n <ng-content></ng-content>\n</div>\n\n<ng-content select=\"[bb-dialog-actions]\">\n\n</ng-content>\n", styles: [".bb-dialog-modal{width:100%;margin:auto;z-index:1001;display:flex;max-width:420px;border-radius:4px;position:relative;flex-direction:column;background-color:#fff;will-change:opacity,transform;max-height:calc(var(--vh, 1vh) * 100 - 40px)}.bb-dialog-modal-body{padding:20px;color:#738694;font-size:13px;overflow-y:auto;line-height:1.4;background-color:#f1f3f6}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
166
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: BbDialogModal, decorators: [{
182
167
  type: Component,
183
168
  args: [{ selector: '[bb-dialog-modal]', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, host: {
184
169
  'class': 'bb-dialog-modal',
185
170
  'role': 'dialog'
186
- }, template: "<ng-content select=\"[bb-dialog-header]\">\n\n</ng-content>\n\n<div class=\"bb-dialog-modal-body\">\n <ng-content></ng-content>\n</div>\n\n<ng-content select=\"[bb-dialog-actions]\">\n\n</ng-content>\n", styles: [".bb-dialog-modal{width:100%;margin:auto;z-index:1001;display:flex;max-width:420px;border-radius:4px;position:relative;flex-direction:column;background-color:#fff;max-height:calc(var(--vh, 1vh) * 100 - 40px)}.bb-dialog-modal-body{padding:20px;color:#738694;font-size:13px;overflow-y:auto;line-height:1.4;background-color:#f1f3f6}\n"] }]
187
- }], ctorParameters: function () { return [{ type: i1.Patch }]; }, propDecorators: { maxWidth: [{
171
+ }, template: "<ng-content select=\"[bb-dialog-header]\">\n\n</ng-content>\n\n<div class=\"bb-dialog-modal-body\">\n <ng-content></ng-content>\n</div>\n\n<ng-content select=\"[bb-dialog-actions]\">\n\n</ng-content>\n", styles: [".bb-dialog-modal{width:100%;margin:auto;z-index:1001;display:flex;max-width:420px;border-radius:4px;position:relative;flex-direction:column;background-color:#fff;will-change:opacity,transform;max-height:calc(var(--vh, 1vh) * 100 - 40px)}.bb-dialog-modal-body{padding:20px;color:#738694;font-size:13px;overflow-y:auto;line-height:1.4;background-color:#f1f3f6}\n"] }]
172
+ }], ctorParameters: function () { return [{ type: i1.Patch }, { type: i0.Renderer2 }, { type: Document, decorators: [{
173
+ type: Optional
174
+ }, {
175
+ type: Inject,
176
+ args: [DOCUMENT]
177
+ }] }]; }, propDecorators: { maxWidth: [{
188
178
  type: HostBinding,
189
179
  args: ['style.max-width']
190
180
  }, {
@@ -208,52 +198,73 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImpor
208
198
 
209
199
  class BbDialogHeader {
210
200
  constructor() {
211
- // Inputs.
212
- this.iconName = null;
213
- this.iconColor = 'black';
214
201
  // Outputs.
215
202
  this.closeRequested = new EventEmitter();
216
203
  }
217
204
  }
218
- BbDialogHeader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: BbDialogHeader, deps: [], target: i0.ɵɵFactoryTarget.Component });
219
- BbDialogHeader.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.4", type: BbDialogHeader, selector: "[bb-dialog-header]", inputs: { iconName: "iconName", iconColor: "iconColor" }, outputs: { closeRequested: "closeRequested" }, host: { classAttribute: "bb-dialog-header" }, ngImport: i0, template: "<div class=\"bb-dialog-header-row\">\n <div *ngIf=\"iconName as icon\"\n [style.color]=\"iconColor\"\n class=\"bb-dialog-header-icon\">\n <i class=\"material-icons\">{{ icon }}</i>\n </div>\n\n <div class=\"bb-dialog-header-content\">\n <ng-content></ng-content>\n </div>\n\n <button *ngIf=\"closeRequested?.observed\"\n (click)=\"closeRequested?.emit()\"\n type=\"button\"\n class=\"bb-dialog-header-close\">\n </button>\n</div>\n\n<nav class=\"bb-dialog-header-navigation\">\n <ng-content select=\"[bb-dialog-link]\"></ng-content>\n</nav>\n", styles: [".bb-dialog-header{display:flex;min-height:60px;flex-direction:column;justify-content:center;background-color:#fff;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom:1px solid #d8d8d8}.bb-dialog-header .bb-dialog-header-content,.bb-dialog-header .bb-dialog-header-content h1{max-width:100%;font-size:20px;font-weight:500;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.bb-dialog-header-row,.bb-dialog-header-navigation{width:100%;display:flex;align-items:center}.bb-dialog-header-row{padding:10px 20px}.bb-dialog-header-navigation{width:100%;padding:0 20px;overflow-x:auto;white-space:nowrap}.bb-dialog-header-navigation:empty{margin:0;height:0;padding:0;visibility:hidden}.bb-dialog-header-content{flex:1}.bb-dialog-header-icon{width:40px;height:40px;display:flex;min-width:40px;overflow:hidden;min-height:40px;margin-right:10px;border-radius:50%;position:relative;align-items:center;justify-content:center}.bb-dialog-header-icon:after{top:0;left:0;right:0;bottom:0;content:\"\";opacity:.14;position:absolute;background-color:currentColor}.bb-dialog-header-close{width:32px;height:32px;border:none;min-width:32px;min-height:32px;overflow:hidden;margin-left:10px;border-radius:4px;position:relative;margin-right:-10px;display:inline-block;background-color:transparent}.bb-dialog-header-close:before,.bb-dialog-header-close:after{top:50%;left:20%;width:60%;height:2px;content:\"\";margin-top:-1px;position:absolute;background-color:#a2a9ba}.bb-dialog-header-close:before{transform:rotate(45deg)}.bb-dialog-header-close:after{transform:rotate(-45deg)}.bb-dialog-header-close:hover{background-color:#00000014}.bb-dialog-header-close:focus{background-color:#0000001f}.bb-dialog-header-close:active{background-color:#00000029}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
220
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: BbDialogHeader, decorators: [{
205
+ BbDialogHeader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: BbDialogHeader, deps: [], target: i0.ɵɵFactoryTarget.Component });
206
+ BbDialogHeader.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.1", type: BbDialogHeader, selector: "[bb-dialog-header]", outputs: { closeRequested: "closeRequested" }, host: { classAttribute: "bb-dialog-header" }, ngImport: i0, template: "<div class=\"bb-dialog-header-row\">\n <div class=\"bb-dialog-header-content\">\n <ng-content></ng-content>\n </div>\n\n <button *ngIf=\"closeRequested?.observed\"\n (click)=\"closeRequested?.emit()\"\n type=\"button\"\n class=\"bb-dialog-header-close\">\n </button>\n</div>\n\n<nav class=\"bb-dialog-header-navigation\">\n <ng-content select=\"[bb-dialog-link]\"></ng-content>\n</nav>\n", styles: [".bb-dialog-header{display:flex;min-height:60px;flex-direction:column;justify-content:center;background-color:#fff;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom:1px solid #d8d8d8}.bb-dialog-header .bb-dialog-header-content,.bb-dialog-header .bb-dialog-header-content h1{max-width:100%;font-size:20px;font-weight:500;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.bb-dialog-header-row,.bb-dialog-header-navigation{width:100%;display:flex;align-items:center}.bb-dialog-header-row{padding:10px 20px}.bb-dialog-header-navigation{width:100%;padding:0 20px;overflow-x:auto;white-space:nowrap}.bb-dialog-header-navigation:empty{margin:0;height:0;padding:0;visibility:hidden}.bb-dialog-header-content{flex:1}.bb-dialog-header-close{width:32px;height:32px;border:none;min-width:32px;min-height:32px;overflow:hidden;margin-left:10px;border-radius:4px;position:relative;margin-right:-10px;display:inline-block;background-color:transparent}.bb-dialog-header-close:before,.bb-dialog-header-close:after{top:50%;left:20%;width:60%;height:2px;content:\"\";margin-top:-1px;position:absolute;background-color:#a2a9ba}.bb-dialog-header-close:before{transform:rotate(45deg)}.bb-dialog-header-close:after{transform:rotate(-45deg)}.bb-dialog-header-close:hover{background-color:#00000014}.bb-dialog-header-close:focus{background-color:#0000001f}.bb-dialog-header-close:active{background-color:#00000029}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
207
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: BbDialogHeader, decorators: [{
221
208
  type: Component,
222
- args: [{ selector: '[bb-dialog-header]', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, host: { 'class': 'bb-dialog-header' }, template: "<div class=\"bb-dialog-header-row\">\n <div *ngIf=\"iconName as icon\"\n [style.color]=\"iconColor\"\n class=\"bb-dialog-header-icon\">\n <i class=\"material-icons\">{{ icon }}</i>\n </div>\n\n <div class=\"bb-dialog-header-content\">\n <ng-content></ng-content>\n </div>\n\n <button *ngIf=\"closeRequested?.observed\"\n (click)=\"closeRequested?.emit()\"\n type=\"button\"\n class=\"bb-dialog-header-close\">\n </button>\n</div>\n\n<nav class=\"bb-dialog-header-navigation\">\n <ng-content select=\"[bb-dialog-link]\"></ng-content>\n</nav>\n", styles: [".bb-dialog-header{display:flex;min-height:60px;flex-direction:column;justify-content:center;background-color:#fff;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom:1px solid #d8d8d8}.bb-dialog-header .bb-dialog-header-content,.bb-dialog-header .bb-dialog-header-content h1{max-width:100%;font-size:20px;font-weight:500;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.bb-dialog-header-row,.bb-dialog-header-navigation{width:100%;display:flex;align-items:center}.bb-dialog-header-row{padding:10px 20px}.bb-dialog-header-navigation{width:100%;padding:0 20px;overflow-x:auto;white-space:nowrap}.bb-dialog-header-navigation:empty{margin:0;height:0;padding:0;visibility:hidden}.bb-dialog-header-content{flex:1}.bb-dialog-header-icon{width:40px;height:40px;display:flex;min-width:40px;overflow:hidden;min-height:40px;margin-right:10px;border-radius:50%;position:relative;align-items:center;justify-content:center}.bb-dialog-header-icon:after{top:0;left:0;right:0;bottom:0;content:\"\";opacity:.14;position:absolute;background-color:currentColor}.bb-dialog-header-close{width:32px;height:32px;border:none;min-width:32px;min-height:32px;overflow:hidden;margin-left:10px;border-radius:4px;position:relative;margin-right:-10px;display:inline-block;background-color:transparent}.bb-dialog-header-close:before,.bb-dialog-header-close:after{top:50%;left:20%;width:60%;height:2px;content:\"\";margin-top:-1px;position:absolute;background-color:#a2a9ba}.bb-dialog-header-close:before{transform:rotate(45deg)}.bb-dialog-header-close:after{transform:rotate(-45deg)}.bb-dialog-header-close:hover{background-color:#00000014}.bb-dialog-header-close:focus{background-color:#0000001f}.bb-dialog-header-close:active{background-color:#00000029}\n"] }]
223
- }], propDecorators: { iconName: [{
224
- type: Input
225
- }], iconColor: [{
226
- type: Input
227
- }], closeRequested: [{
209
+ args: [{ selector: '[bb-dialog-header]', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, host: { 'class': 'bb-dialog-header' }, template: "<div class=\"bb-dialog-header-row\">\n <div class=\"bb-dialog-header-content\">\n <ng-content></ng-content>\n </div>\n\n <button *ngIf=\"closeRequested?.observed\"\n (click)=\"closeRequested?.emit()\"\n type=\"button\"\n class=\"bb-dialog-header-close\">\n </button>\n</div>\n\n<nav class=\"bb-dialog-header-navigation\">\n <ng-content select=\"[bb-dialog-link]\"></ng-content>\n</nav>\n", styles: [".bb-dialog-header{display:flex;min-height:60px;flex-direction:column;justify-content:center;background-color:#fff;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom:1px solid #d8d8d8}.bb-dialog-header .bb-dialog-header-content,.bb-dialog-header .bb-dialog-header-content h1{max-width:100%;font-size:20px;font-weight:500;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.bb-dialog-header-row,.bb-dialog-header-navigation{width:100%;display:flex;align-items:center}.bb-dialog-header-row{padding:10px 20px}.bb-dialog-header-navigation{width:100%;padding:0 20px;overflow-x:auto;white-space:nowrap}.bb-dialog-header-navigation:empty{margin:0;height:0;padding:0;visibility:hidden}.bb-dialog-header-content{flex:1}.bb-dialog-header-close{width:32px;height:32px;border:none;min-width:32px;min-height:32px;overflow:hidden;margin-left:10px;border-radius:4px;position:relative;margin-right:-10px;display:inline-block;background-color:transparent}.bb-dialog-header-close:before,.bb-dialog-header-close:after{top:50%;left:20%;width:60%;height:2px;content:\"\";margin-top:-1px;position:absolute;background-color:#a2a9ba}.bb-dialog-header-close:before{transform:rotate(45deg)}.bb-dialog-header-close:after{transform:rotate(-45deg)}.bb-dialog-header-close:hover{background-color:#00000014}.bb-dialog-header-close:focus{background-color:#0000001f}.bb-dialog-header-close:active{background-color:#00000029}\n"] }]
210
+ }], propDecorators: { closeRequested: [{
228
211
  type: Output
229
212
  }] } });
230
213
 
231
214
  class BbDialogLink {
232
215
  }
233
- BbDialogLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: BbDialogLink, deps: [], target: i0.ɵɵFactoryTarget.Component });
234
- BbDialogLink.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.4", type: BbDialogLink, selector: "[bb-dialog-link]", host: { classAttribute: "bb-dialog-link" }, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [".bb-dialog-link{height:30px;display:flex;font-size:16px;font-weight:500;white-space:nowrap;align-items:center;color:#6b5c5c!important;background-color:transparent;text-decoration:none!important;border-bottom:2px solid transparent}.bb-dialog-link+.bb-dialog-link{margin-left:10px}.bb-dialog-link:hover:not(.disabled){border-bottom:2px solid rgba(117,119,148,.2)}.bb-dialog-link.active,.bb-dialog-link.active:hover{color:#5b53ff!important;border-bottom-color:#5b53ff}.bb-dialog-link.disabled,.bb-dialog-link.disabled:focus,.bb-dialog-link.disabled:hover,.bb-dialog-link.disabled:active{opacity:.4;cursor:default;box-shadow:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
235
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: BbDialogLink, decorators: [{
216
+ BbDialogLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: BbDialogLink, deps: [], target: i0.ɵɵFactoryTarget.Component });
217
+ BbDialogLink.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.1", type: BbDialogLink, selector: "[bb-dialog-link]", host: { classAttribute: "bb-dialog-link" }, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [".bb-dialog-link{border:none;height:30px;display:flex;font-size:16px;-webkit-appearance:none;appearance:none;font-weight:500;white-space:nowrap;align-items:center;color:#6b5c5c!important;background-color:transparent;text-decoration:none!important;border-bottom:2px solid transparent}.bb-dialog-link+.bb-dialog-link{margin-left:10px}.bb-dialog-link:hover:not(.disabled){border-bottom:2px solid rgba(117,119,148,.2)}.bb-dialog-link.active,.bb-dialog-link.active:hover{color:#5b53ff!important;border-bottom-color:#5b53ff}.bb-dialog-link.disabled,.bb-dialog-link.disabled:focus,.bb-dialog-link.disabled:hover,.bb-dialog-link.disabled:active{opacity:.4;cursor:default;box-shadow:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
218
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: BbDialogLink, decorators: [{
236
219
  type: Component,
237
- args: [{ selector: '[bb-dialog-link]', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, host: { 'class': 'bb-dialog-link' }, template: "<ng-content></ng-content>\n", styles: [".bb-dialog-link{height:30px;display:flex;font-size:16px;font-weight:500;white-space:nowrap;align-items:center;color:#6b5c5c!important;background-color:transparent;text-decoration:none!important;border-bottom:2px solid transparent}.bb-dialog-link+.bb-dialog-link{margin-left:10px}.bb-dialog-link:hover:not(.disabled){border-bottom:2px solid rgba(117,119,148,.2)}.bb-dialog-link.active,.bb-dialog-link.active:hover{color:#5b53ff!important;border-bottom-color:#5b53ff}.bb-dialog-link.disabled,.bb-dialog-link.disabled:focus,.bb-dialog-link.disabled:hover,.bb-dialog-link.disabled:active{opacity:.4;cursor:default;box-shadow:none}\n"] }]
220
+ args: [{ selector: '[bb-dialog-link]', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, host: { 'class': 'bb-dialog-link' }, template: "<ng-content></ng-content>\n", styles: [".bb-dialog-link{border:none;height:30px;display:flex;font-size:16px;-webkit-appearance:none;appearance:none;font-weight:500;white-space:nowrap;align-items:center;color:#6b5c5c!important;background-color:transparent;text-decoration:none!important;border-bottom:2px solid transparent}.bb-dialog-link+.bb-dialog-link{margin-left:10px}.bb-dialog-link:hover:not(.disabled){border-bottom:2px solid rgba(117,119,148,.2)}.bb-dialog-link.active,.bb-dialog-link.active:hover{color:#5b53ff!important;border-bottom-color:#5b53ff}.bb-dialog-link.disabled,.bb-dialog-link.disabled:focus,.bb-dialog-link.disabled:hover,.bb-dialog-link.disabled:active{opacity:.4;cursor:default;box-shadow:none}\n"] }]
238
221
  }] });
239
222
 
240
223
  class BbDialogActions {
241
224
  }
242
- BbDialogActions.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: BbDialogActions, deps: [], target: i0.ɵɵFactoryTarget.Component });
243
- BbDialogActions.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.4", type: BbDialogActions, selector: "[bb-dialog-actions]", host: { classAttribute: "bb-dialog-actions" }, ngImport: i0, template: "<bb-form-group class=\"end\">\n <ng-content></ng-content>\n</bb-form-group>\n", styles: [".bb-dialog-actions{padding:20px;display:block;background-color:#fff;border-top:1px solid #d8d8d8;border-bottom-left-radius:4px;border-bottom-right-radius:4px}\n"], dependencies: [{ kind: "component", type: i4.BbFormGroup, selector: "bb-form-group", inputs: ["grouped"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
244
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: BbDialogActions, decorators: [{
225
+ BbDialogActions.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: BbDialogActions, deps: [], target: i0.ɵɵFactoryTarget.Component });
226
+ BbDialogActions.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.1", type: BbDialogActions, selector: "[bb-dialog-actions]", host: { classAttribute: "bb-dialog-actions" }, ngImport: i0, template: "<bb-form-group class=\"end\">\n <ng-content></ng-content>\n</bb-form-group>\n", styles: [".bb-dialog-actions{padding:20px;display:block;background-color:#fff;border-top:1px solid #d8d8d8;border-bottom-left-radius:4px;border-bottom-right-radius:4px}\n"], dependencies: [{ kind: "component", type: i4.BbFormGroup, selector: "bb-form-group", inputs: ["grouped"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
227
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: BbDialogActions, decorators: [{
245
228
  type: Component,
246
229
  args: [{ selector: '[bb-dialog-actions]', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, host: { 'class': 'bb-dialog-actions' }, template: "<bb-form-group class=\"end\">\n <ng-content></ng-content>\n</bb-form-group>\n", styles: [".bb-dialog-actions{padding:20px;display:block;background-color:#fff;border-top:1px solid #d8d8d8;border-bottom-left-radius:4px;border-bottom-right-radius:4px}\n"] }]
247
230
  }] });
248
231
 
232
+ const bbDialogContainerAnimation = trigger('bbDialogContainerAnimation', [
233
+ transition(':enter', [
234
+ group([
235
+ query('.bb-dialog-container-backdrop', [
236
+ style({ opacity: 0 }),
237
+ animate('180ms cubic-bezier(0, 0, 0.2, 1)', style({ opacity: 1 }))
238
+ ]),
239
+ query('.bb-dialog-container-component', [
240
+ style({ opacity: 0, transform: 'scale(0.96)' }),
241
+ animate('180ms cubic-bezier(0, 0, 0.2, 1)', style({ opacity: 1, transform: 'none' }))
242
+ ])
243
+ ])
244
+ ]),
245
+ transition(':leave', [
246
+ group([
247
+ query('.bb-dialog-container-backdrop', [
248
+ animate('180ms cubic-bezier(0, 0, 0.2, 1)', style({ opacity: 0 }))
249
+ ]),
250
+ query('.bb-dialog-container-component', [
251
+ animate('180ms cubic-bezier(0, 0, 0.2, 1)', style({
252
+ opacity: 0,
253
+ transform: 'scale(0.96)'
254
+ }))
255
+ ])
256
+ ])
257
+ ])
258
+ ]);
259
+
249
260
  class BbDialogInsertion {
250
261
  constructor(viewContainerRef) {
251
262
  this.viewContainerRef = viewContainerRef;
252
263
  }
253
264
  }
254
- BbDialogInsertion.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: BbDialogInsertion, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
255
- BbDialogInsertion.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.4", type: BbDialogInsertion, selector: "[bbDialogInsertion]", ngImport: i0 });
256
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: BbDialogInsertion, decorators: [{
265
+ BbDialogInsertion.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: BbDialogInsertion, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
266
+ BbDialogInsertion.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.1", type: BbDialogInsertion, selector: "[bbDialogInsertion]", ngImport: i0 });
267
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: BbDialogInsertion, decorators: [{
257
268
  type: Directive,
258
269
  args: [{
259
270
  selector: '[bbDialogInsertion]'
@@ -261,29 +272,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImpor
261
272
  }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; } });
262
273
 
263
274
  class BbDialogContainer {
264
- constructor(_elementRef, _changeDetection, _componentFactoryResolver) {
275
+ constructor(_elementRef) {
265
276
  this._elementRef = _elementRef;
266
- this._changeDetection = _changeDetection;
267
- this._componentFactoryResolver = _componentFactoryResolver;
268
277
  // Data.
269
278
  this.componentRef = null;
270
279
  this.childComponentType = null;
271
280
  // State.
272
281
  this.overlayClicked$ = new Subject();
282
+ // Subscription.
283
+ this._subscription = new Subscription();
273
284
  }
274
285
  get onOverlayClicked() {
275
286
  return this.overlayClicked$.pipe(take(1));
276
287
  }
277
- ngAfterViewInit() {
288
+ ngOnInit() {
278
289
  // Load the child component.
279
290
  this.loadChildComponent(this.childComponentType);
280
291
  // Listen for mouse click on the dialog container.
281
292
  this.listenForClicks();
282
- // Detect changes to notify change detection.
283
- this._changeDetection.detectChanges();
284
293
  }
285
294
  ngOnDestroy() {
286
- this._subscription && this._subscription.unsubscribe();
295
+ this._subscription?.unsubscribe();
287
296
  }
288
297
  onAnimationDone(event) {
289
298
  // Check if the dialog is being destroyed.
@@ -291,145 +300,77 @@ class BbDialogContainer {
291
300
  return;
292
301
  }
293
302
  // Destroy the ref if it exists.
294
- this.componentRef && this.componentRef.destroy();
303
+ this.componentRef?.destroy();
295
304
  }
296
305
  listenForClicks() {
297
- if (!this._elementRef || !this._elementRef.nativeElement) {
306
+ const element = this._elementRef?.nativeElement ?? null;
307
+ if (!element) {
298
308
  return;
299
309
  }
300
- const mouseDown$ = fromEvent(this._elementRef.nativeElement, 'mousedown');
301
- const touchStart$ = fromEvent(this._elementRef.nativeElement, 'touchstart');
310
+ const mouseDown$ = fromEvent(element, 'mousedown');
311
+ const touchStart$ = fromEvent(element, 'touchstart');
302
312
  const start$ = race([mouseDown$, touchStart$]);
303
- const mouseUp$ = fromEvent(this._elementRef.nativeElement, 'mouseup');
304
- const touchEnd$ = fromEvent(this._elementRef.nativeElement, 'touchend');
313
+ const mouseUp$ = fromEvent(element, 'mouseup');
314
+ const touchEnd$ = fromEvent(element, 'touchend');
305
315
  const end$ = race([mouseUp$, touchEnd$]);
306
- this._subscription = start$.pipe(switchMap(() => end$)).subscribe(() => {
307
- this.overlayClicked$.next();
308
- });
316
+ const clicks$ = start$.pipe(switchMap(() => end$));
317
+ const subscription = clicks$.subscribe(() => this.overlayClicked$.next());
318
+ this._subscription.add(subscription);
309
319
  }
310
320
  loadChildComponent(componentType) {
311
- // Resolve the component.
312
- const componentFactory = this._componentFactoryResolver.resolveComponentFactory(componentType);
313
321
  // Get the view container ref and clear it.
314
322
  const viewContainerRef = this.insertion.viewContainerRef;
315
323
  viewContainerRef.clear();
316
324
  // Create an instance of the component.
317
- this.componentRef = viewContainerRef.createComponent(componentFactory);
325
+ this.componentRef = viewContainerRef.createComponent(componentType);
318
326
  }
319
327
  }
320
- BbDialogContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: BbDialogContainer, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.ComponentFactoryResolver }], target: i0.ɵɵFactoryTarget.Component });
321
- BbDialogContainer.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.4", type: BbDialogContainer, selector: "bb-dialog-container", host: { listeners: { "@bbDialogAnimation.done": "onAnimationDone($event)" }, properties: { "@bbDialogAnimation": "true" }, classAttribute: "bb-dialog-container" }, viewQueries: [{ propertyName: "insertion", first: true, predicate: BbDialogInsertion, descendants: true, static: true }], ngImport: i0, template: "<div class=\"bb-dialog-container-backdrop\">\n</div>\n\n<div class=\"bb-dialog-container-component\">\n <ng-container bbDialogInsertion>\n </ng-container>\n</div>\n", styles: [".bb-dialog-container,.bb-dialog-container-backdrop{top:0;left:0;right:0;bottom:0;z-index:1000;position:fixed}.bb-dialog-container{display:flex}.bb-dialog-container-backdrop{background-color:#00000080}.bb-dialog-container-component{width:100%;margin:auto;padding:20px;z-index:1001;display:block}\n"], dependencies: [{ kind: "directive", type: BbDialogInsertion, selector: "[bbDialogInsertion]" }], animations: [
322
- trigger('bbDialogAnimation', [
323
- transition(':enter', [
324
- group([
325
- query('.bb-dialog-container-backdrop', [
326
- style({
327
- opacity: 0
328
- }),
329
- animate('150ms cubic-bezier(0, 0, 0.2, 1)', style({
330
- opacity: 1
331
- }))
332
- ]),
333
- query('.bb-dialog-container-component', [
334
- style({
335
- transform: 'scale(0.95)'
336
- }),
337
- animate('150ms cubic-bezier(0, 0, 0.2, 1)', style({
338
- transform: 'scale(1)'
339
- }))
340
- ])
341
- ])
342
- ]),
343
- transition(':leave', [
344
- group([
345
- query('.bb-dialog-container-backdrop', [
346
- animate('150ms cubic-bezier(0, 0, 0.2, 1)', style({
347
- opacity: 0
348
- }))
349
- ]),
350
- query('.bb-dialog-container-component', [
351
- animate('150ms cubic-bezier(0, 0, 0.2, 1)', style({
352
- opacity: 0,
353
- transform: 'scale(0.95)'
354
- }))
355
- ])
356
- ])
357
- ])
358
- ])
359
- ], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
360
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: BbDialogContainer, decorators: [{
328
+ BbDialogContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: BbDialogContainer, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
329
+ BbDialogContainer.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.1", type: BbDialogContainer, selector: "bb-dialog-container", host: { listeners: { "@bbDialogContainerAnimation.done": "onAnimationDone($event)" }, properties: { "@bbDialogContainerAnimation": "true" }, classAttribute: "bb-dialog-container" }, viewQueries: [{ propertyName: "insertion", first: true, predicate: BbDialogInsertion, descendants: true, static: true }], ngImport: i0, template: "<div class=\"bb-dialog-container-backdrop\"></div>\n\n<div class=\"bb-dialog-container-component\">\n <ng-container bbDialogInsertion></ng-container>\n</div>\n", styles: [".bb-dialog-container,.bb-dialog-container-backdrop{top:0;left:0;right:0;bottom:0;z-index:1000;position:fixed}.bb-dialog-container{display:flex}.bb-dialog-container-backdrop{will-change:opacity;background-color:#1119}.bb-dialog-container-component{width:100%;margin:auto;padding:20px;z-index:1001;display:block;will-change:opacity,transform}\n"], dependencies: [{ kind: "directive", type: BbDialogInsertion, selector: "[bbDialogInsertion]" }], animations: [bbDialogContainerAnimation], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
330
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: BbDialogContainer, decorators: [{
361
331
  type: Component,
362
- args: [{ selector: 'bb-dialog-container', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: { 'class': 'bb-dialog-container', '[@bbDialogAnimation]': 'true' }, preserveWhitespaces: false, animations: [
363
- trigger('bbDialogAnimation', [
364
- transition(':enter', [
365
- group([
366
- query('.bb-dialog-container-backdrop', [
367
- style({
368
- opacity: 0
369
- }),
370
- animate('150ms cubic-bezier(0, 0, 0.2, 1)', style({
371
- opacity: 1
372
- }))
373
- ]),
374
- query('.bb-dialog-container-component', [
375
- style({
376
- transform: 'scale(0.95)'
377
- }),
378
- animate('150ms cubic-bezier(0, 0, 0.2, 1)', style({
379
- transform: 'scale(1)'
380
- }))
381
- ])
382
- ])
383
- ]),
384
- transition(':leave', [
385
- group([
386
- query('.bb-dialog-container-backdrop', [
387
- animate('150ms cubic-bezier(0, 0, 0.2, 1)', style({
388
- opacity: 0
389
- }))
390
- ]),
391
- query('.bb-dialog-container-component', [
392
- animate('150ms cubic-bezier(0, 0, 0.2, 1)', style({
393
- opacity: 0,
394
- transform: 'scale(0.95)'
395
- }))
396
- ])
397
- ])
398
- ])
399
- ])
400
- ], template: "<div class=\"bb-dialog-container-backdrop\">\n</div>\n\n<div class=\"bb-dialog-container-component\">\n <ng-container bbDialogInsertion>\n </ng-container>\n</div>\n", styles: [".bb-dialog-container,.bb-dialog-container-backdrop{top:0;left:0;right:0;bottom:0;z-index:1000;position:fixed}.bb-dialog-container{display:flex}.bb-dialog-container-backdrop{background-color:#00000080}.bb-dialog-container-component{width:100%;margin:auto;padding:20px;z-index:1001;display:block}\n"] }]
401
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.ComponentFactoryResolver }]; }, propDecorators: { insertion: [{
332
+ args: [{ selector: 'bb-dialog-container', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
333
+ 'class': 'bb-dialog-container',
334
+ '[@bbDialogContainerAnimation]': 'true'
335
+ }, preserveWhitespaces: false, animations: [bbDialogContainerAnimation], template: "<div class=\"bb-dialog-container-backdrop\"></div>\n\n<div class=\"bb-dialog-container-component\">\n <ng-container bbDialogInsertion></ng-container>\n</div>\n", styles: [".bb-dialog-container,.bb-dialog-container-backdrop{top:0;left:0;right:0;bottom:0;z-index:1000;position:fixed}.bb-dialog-container{display:flex}.bb-dialog-container-backdrop{will-change:opacity;background-color:#1119}.bb-dialog-container-component{width:100%;margin:auto;padding:20px;z-index:1001;display:block;will-change:opacity,transform}\n"] }]
336
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { insertion: [{
402
337
  type: ViewChild,
403
338
  args: [BbDialogInsertion, { static: true }]
404
339
  }], onAnimationDone: [{
405
340
  type: HostListener,
406
- args: ['@bbDialogAnimation.done', ['$event']]
341
+ args: ['@bbDialogContainerAnimation.done', ['$event']]
407
342
  }] } });
408
343
 
409
344
  let nextUniqueId = 0;
410
345
  class BbDialogConfirm {
411
- constructor(config, dialogRef) {
412
- this.config = config;
413
- this.dialogRef = dialogRef;
346
+ constructor(_config, _dialogRef) {
347
+ this._config = _config;
348
+ this._dialogRef = _dialogRef;
349
+ // Readonly data.
350
+ this.title = this._config?.data?.title ?? null;
351
+ this.description = this._config?.data?.description ?? null;
352
+ this.cancelButtonText = this._config?.data?.cancelButtonText ?? null;
353
+ this.confirmButtonText = this._config?.data?.confirmButtonText ?? null;
354
+ this.width = this._config?.data?.width ?? null;
414
355
  // Id.
415
356
  this.dialogId = `bb-dialog-confirm-${nextUniqueId++}`;
416
357
  }
417
358
  ngAfterViewInit() {
418
359
  // Initial focus the button.
419
- this.confirmButton.focus();
360
+ this.confirmButton?.focus();
420
361
  }
421
362
  onClose(result) {
422
- this.dialogRef.close(result);
363
+ this._dialogRef.close(result);
423
364
  }
424
365
  }
425
- BbDialogConfirm.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: BbDialogConfirm, deps: [{ token: BbDialogConfig }, { token: BbDialogRef }], target: i0.ɵɵFactoryTarget.Component });
426
- BbDialogConfirm.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.4", type: BbDialogConfirm, selector: "bb-dialog-confirm", host: { classAttribute: "bb-dialog-confirm" }, viewQueries: [{ propertyName: "confirmButton", first: true, predicate: ["confirm"], descendants: true, read: BbButton }], ngImport: i0, template: "<div [attr.aria-labelledby]=\"dialogId\"\n bb-dialog-modal\n bbFocusTrap>\n <header bb-dialog-header>\n <h1 *ngIf=\"config?.data?.title as title\"\n [id]=\"dialogId\">\n {{ title | bbLocalize:{optional: true} }}\n </h1>\n </header>\n\n <p>\n {{ config?.data?.description | bbLocalize:{optional: true} }}\n </p>\n\n <footer bb-dialog-actions>\n <button *ngIf=\"config?.data?.cancelButtonText as cancelButtonText\"\n (click)=\"onClose(false)\"\n bb-button\n type=\"button\">\n {{ cancelButtonText | bbLocalize:{optional: true} }}\n </button>\n <button #confirm\n *ngIf=\"config?.data?.confirmButtonText as confirmButtonText\"\n (click)=\"onClose(true)\"\n bb-button\n type=\"button\"\n class=\"destructive\">\n {{ confirmButtonText | bbLocalize:{optional: true} }}\n </button>\n </footer>\n</div>\n", styles: [".bb-dialog-confirm{display:block}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.BbFocusTrap, selector: "[bbFocusTrap]" }, { kind: "component", type: i4.BbButton, selector: "button[bb-button]", inputs: ["disabled", "loading"], exportAs: ["bbButton"] }, { kind: "component", type: BbDialogModal, selector: "[bb-dialog-modal]", inputs: ["maxWidth"] }, { kind: "component", type: BbDialogHeader, selector: "[bb-dialog-header]", inputs: ["iconName", "iconColor"], outputs: ["closeRequested"] }, { kind: "component", type: BbDialogActions, selector: "[bb-dialog-actions]" }, { kind: "pipe", type: i8.BbLocalize, name: "bbLocalize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
427
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: BbDialogConfirm, decorators: [{
366
+ BbDialogConfirm.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: BbDialogConfirm, deps: [{ token: BbDialogConfig }, { token: BbDialogRef }], target: i0.ɵɵFactoryTarget.Component });
367
+ BbDialogConfirm.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.1", type: BbDialogConfirm, selector: "bb-dialog-confirm", host: { classAttribute: "bb-dialog-confirm" }, viewQueries: [{ propertyName: "confirmButton", first: true, predicate: ["confirm"], descendants: true, read: BbButton }], ngImport: i0, template: "<div [attr.aria-labelledby]=\"dialogId\"\n [maxWidth]=\"width\"\n bb-dialog-modal\n bbFocusTrap>\n <header bb-dialog-header>\n <h1 *ngIf=\"title as titleLabel\"\n [id]=\"dialogId\">\n {{ titleLabel | bbLocalize:{optional: true} }}\n </h1>\n </header>\n\n <p *ngIf=\"description as descriptionContent\"\n class=\"bb-dialog-confirm-description\">\n <ng-template [bbTemplate]=\"descriptionContent\">\n {{ $any(descriptionContent) | bbLocalize:{optional: true} }}\n </ng-template>\n </p>\n\n <footer bb-dialog-actions>\n <button *ngIf=\"cancelButtonText as cancelButtonTextLabel\"\n (click)=\"onClose(false)\"\n bb-button\n type=\"button\">\n {{ cancelButtonTextLabel | bbLocalize:{optional: true} }}\n </button>\n <button #confirm\n *ngIf=\"confirmButtonText as confirmButtonTextLabel\"\n (click)=\"onClose(true)\"\n bb-button\n type=\"button\"\n class=\"destructive\">\n {{ confirmButtonTextLabel | bbLocalize:{optional: true} }}\n </button>\n </footer>\n</div>\n", styles: [".bb-dialog-confirm{display:block}.bb-dialog-confirm-description{line-height:2}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.BbTemplate, selector: "[bbTemplate]", inputs: ["bbTemplate"] }, { kind: "directive", type: i4.BbFocusTrap, selector: "[bbFocusTrap]" }, { kind: "component", type: i4.BbButton, selector: "button[bb-button]", inputs: ["disabled", "loading"], exportAs: ["bbButton"] }, { kind: "component", type: BbDialogModal, selector: "[bb-dialog-modal]", inputs: ["maxWidth"] }, { kind: "component", type: BbDialogHeader, selector: "[bb-dialog-header]", outputs: ["closeRequested"] }, { kind: "component", type: BbDialogActions, selector: "[bb-dialog-actions]" }, { kind: "pipe", type: i8.BbLocalize, name: "bbLocalize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
368
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: BbDialogConfirm, decorators: [{
428
369
  type: Component,
429
- args: [{ selector: 'bb-dialog-confirm', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, host: { 'class': 'bb-dialog-confirm' }, template: "<div [attr.aria-labelledby]=\"dialogId\"\n bb-dialog-modal\n bbFocusTrap>\n <header bb-dialog-header>\n <h1 *ngIf=\"config?.data?.title as title\"\n [id]=\"dialogId\">\n {{ title | bbLocalize:{optional: true} }}\n </h1>\n </header>\n\n <p>\n {{ config?.data?.description | bbLocalize:{optional: true} }}\n </p>\n\n <footer bb-dialog-actions>\n <button *ngIf=\"config?.data?.cancelButtonText as cancelButtonText\"\n (click)=\"onClose(false)\"\n bb-button\n type=\"button\">\n {{ cancelButtonText | bbLocalize:{optional: true} }}\n </button>\n <button #confirm\n *ngIf=\"config?.data?.confirmButtonText as confirmButtonText\"\n (click)=\"onClose(true)\"\n bb-button\n type=\"button\"\n class=\"destructive\">\n {{ confirmButtonText | bbLocalize:{optional: true} }}\n </button>\n </footer>\n</div>\n", styles: [".bb-dialog-confirm{display:block}\n"] }]
370
+ args: [{ selector: 'bb-dialog-confirm', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, host: { 'class': 'bb-dialog-confirm' }, template: "<div [attr.aria-labelledby]=\"dialogId\"\n [maxWidth]=\"width\"\n bb-dialog-modal\n bbFocusTrap>\n <header bb-dialog-header>\n <h1 *ngIf=\"title as titleLabel\"\n [id]=\"dialogId\">\n {{ titleLabel | bbLocalize:{optional: true} }}\n </h1>\n </header>\n\n <p *ngIf=\"description as descriptionContent\"\n class=\"bb-dialog-confirm-description\">\n <ng-template [bbTemplate]=\"descriptionContent\">\n {{ $any(descriptionContent) | bbLocalize:{optional: true} }}\n </ng-template>\n </p>\n\n <footer bb-dialog-actions>\n <button *ngIf=\"cancelButtonText as cancelButtonTextLabel\"\n (click)=\"onClose(false)\"\n bb-button\n type=\"button\">\n {{ cancelButtonTextLabel | bbLocalize:{optional: true} }}\n </button>\n <button #confirm\n *ngIf=\"confirmButtonText as confirmButtonTextLabel\"\n (click)=\"onClose(true)\"\n bb-button\n type=\"button\"\n class=\"destructive\">\n {{ confirmButtonTextLabel | bbLocalize:{optional: true} }}\n </button>\n </footer>\n</div>\n", styles: [".bb-dialog-confirm{display:block}.bb-dialog-confirm-description{line-height:2}\n"] }]
430
371
  }], ctorParameters: function () { return [{ type: BbDialogConfig }, { type: BbDialogRef }]; }, propDecorators: { confirmButton: [{
431
372
  type: ViewChild,
432
- args: ['confirm', { read: BbButton }]
373
+ args: ['confirm', { read: BbButton, static: false }]
433
374
  }] } });
434
375
 
435
376
  class BbDialogInjector {
@@ -464,8 +405,9 @@ class Dialog {
464
405
  data: {
465
406
  title,
466
407
  description,
467
- cancelButtonText: options.cancelButtonText || 'dialog.default_cancel_button',
468
- confirmButtonText: options.confirmButtonText || 'dialog.default_confirm_button'
408
+ width: options?.width ?? '420px',
409
+ cancelButtonText: options.cancelButtonText ?? 'dialog.default_cancel_button',
410
+ confirmButtonText: options.confirmButtonText ?? 'dialog.default_confirm_button'
469
411
  }
470
412
  });
471
413
  }
@@ -474,7 +416,7 @@ class Dialog {
474
416
  const dialogRef = new BbDialogRef();
475
417
  // Create a map with the config.
476
418
  const map = new WeakMap();
477
- map.set(BbDialogConfig, config);
419
+ map.set(BbDialogConfig, config ?? {});
478
420
  map.set(BbDialogRef, dialogRef);
479
421
  // Create a custom injector.
480
422
  const dialogInjector = new BbDialogInjector(this._injector, map);
@@ -514,9 +456,9 @@ class Dialog {
514
456
  dialogComponentRef = null;
515
457
  }
516
458
  }
517
- Dialog.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: Dialog, deps: [{ token: i0.Injector }, { token: i0.ApplicationRef }, { token: i0.ComponentFactoryResolver }], target: i0.ɵɵFactoryTarget.Injectable });
518
- Dialog.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: Dialog });
519
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: Dialog, decorators: [{
459
+ Dialog.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: Dialog, deps: [{ token: i0.Injector }, { token: i0.ApplicationRef }, { token: i0.ComponentFactoryResolver }], target: i0.ɵɵFactoryTarget.Injectable });
460
+ Dialog.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: Dialog });
461
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: Dialog, decorators: [{
520
462
  type: Injectable
521
463
  }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.ApplicationRef }, { type: i0.ComponentFactoryResolver }]; } });
522
464
 
@@ -528,8 +470,8 @@ class DialogModule {
528
470
  };
529
471
  }
530
472
  }
531
- DialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: DialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
532
- DialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.4", ngImport: i0, type: DialogModule, declarations: [BbDialogContainer,
473
+ DialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: DialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
474
+ DialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.1", ngImport: i0, type: DialogModule, declarations: [BbDialogContainer,
533
475
  BbDialogOverlay,
534
476
  BbDialogModal,
535
477
  BbDialogHeader,
@@ -543,10 +485,10 @@ DialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
543
485
  BbDialogHeader,
544
486
  BbDialogLink,
545
487
  BbDialogActions] });
546
- DialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: DialogModule, imports: [CommonModule,
488
+ DialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: DialogModule, imports: [CommonModule,
547
489
  LocalizeModule,
548
490
  ElementsModule] });
549
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: DialogModule, decorators: [{
491
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: DialogModule, decorators: [{
550
492
  type: NgModule,
551
493
  args: [{
552
494
  imports: [