@bravobit/bb-foundation 0.15.4 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (377) hide show
  1. package/auth/lib/auth.interceptor.d.ts +1 -1
  2. package/auth/lib/auth.service.d.ts +1 -1
  3. package/auth/package.json +5 -5
  4. package/collections/package.json +5 -5
  5. package/controls/bravobit-bb-foundation-controls.d.ts +5 -0
  6. package/controls/lib/checkbox/checkbox.component.d.ts +27 -0
  7. package/controls/lib/checkbox/checkbox.module.d.ts +9 -0
  8. package/controls/lib/controls.module.d.ts +7 -0
  9. package/controls/package.json +10 -0
  10. package/controls/public_api.d.ts +3 -0
  11. package/dashboard/package.json +5 -5
  12. package/dialog/package.json +5 -5
  13. package/elements/package.json +5 -5
  14. package/{esm2015/auth/bravobit-bb-foundation-auth.js → esm2020/auth/bravobit-bb-foundation-auth.mjs} +0 -0
  15. package/esm2020/auth/lib/auth.interceptor.mjs +94 -0
  16. package/{esm2015/auth/lib/auth.module.js → esm2020/auth/lib/auth.module.mjs} +5 -5
  17. package/esm2020/auth/lib/auth.service.mjs +276 -0
  18. package/esm2020/auth/lib/auth.session.mjs +131 -0
  19. package/{esm2015/auth/lib/directives/authenticated.directive.js → esm2020/auth/lib/directives/authenticated.directive.mjs} +5 -6
  20. package/esm2020/auth/lib/directives/permission.directive.mjs +80 -0
  21. package/esm2020/auth/lib/directives/role.directive.mjs +37 -0
  22. package/esm2020/auth/lib/guards/anonymous.guard.mjs +34 -0
  23. package/esm2020/auth/lib/guards/authenticated.guard.mjs +35 -0
  24. package/{esm2015/auth/lib/helpers/jwt.helper.js → esm2020/auth/lib/helpers/jwt.helper.mjs} +3 -3
  25. package/{esm2015/auth/lib/helpers/mapper.helper.js → esm2020/auth/lib/helpers/mapper.helper.mjs} +4 -4
  26. package/{esm2015/auth/lib/interfaces/config.interface.js → esm2020/auth/lib/interfaces/config.interface.mjs} +0 -0
  27. package/{esm2015/auth/lib/interfaces/mapper.interface.js → esm2020/auth/lib/interfaces/mapper.interface.mjs} +0 -0
  28. package/{esm2015/auth/lib/interfaces/provider.interface.js → esm2020/auth/lib/interfaces/provider.interface.mjs} +0 -0
  29. package/{esm2015/auth/lib/interfaces/token.interface.js → esm2020/auth/lib/interfaces/token.interface.mjs} +0 -0
  30. package/esm2020/auth/lib/permissions.service.mjs +56 -0
  31. package/esm2020/auth/lib/providers/email.provider.mjs +25 -0
  32. package/esm2020/auth/lib/providers/verify.provider.mjs +19 -0
  33. package/{esm2015/auth/lib/tokens/use-authorization.token.js → esm2020/auth/lib/tokens/use-authorization.token.mjs} +0 -0
  34. package/{esm2015/auth/public_api.js → esm2020/auth/public_api.mjs} +0 -0
  35. package/{esm2015/bravobit-bb-foundation.js → esm2020/bravobit-bb-foundation.mjs} +0 -0
  36. package/{esm2015/collections/bravobit-bb-foundation-collections.js → esm2020/collections/bravobit-bb-foundation-collections.mjs} +0 -0
  37. package/esm2020/collections/lib/collection.mjs +98 -0
  38. package/{esm2015/collections/lib/collections.module.js → esm2020/collections/lib/collections.module.mjs} +5 -5
  39. package/esm2020/collections/lib/components/collections-pager/collections-pager.component.mjs +123 -0
  40. package/esm2020/collections/lib/components/collections-viewer/collections-viewer.component.mjs +31 -0
  41. package/{esm2015/collections/lib/components/collections.directive.js → esm2020/collections/lib/components/collections.directive.mjs} +13 -13
  42. package/{esm2015/collections/lib/interfaces/collection.interface.js → esm2020/collections/lib/interfaces/collection.interface.mjs} +0 -0
  43. package/esm2020/collections/lib/providers/api-collection.provider.mjs +68 -0
  44. package/esm2020/collections/lib/providers/collection.provider.mjs +13 -0
  45. package/{esm2015/collections/lib/providers/local-collection.provider.js → esm2020/collections/lib/providers/local-collection.provider.mjs} +0 -0
  46. package/{esm2015/collections/public_api.js → esm2020/collections/public_api.mjs} +0 -0
  47. package/esm2020/controls/bravobit-bb-foundation-controls.mjs +5 -0
  48. package/esm2020/controls/lib/checkbox/checkbox.component.mjs +86 -0
  49. package/esm2020/controls/lib/checkbox/checkbox.module.mjs +19 -0
  50. package/esm2020/controls/lib/controls.module.mjs +16 -0
  51. package/esm2020/controls/public_api.mjs +4 -0
  52. package/{esm2015/dashboard/bravobit-bb-foundation-dashboard.js → esm2020/dashboard/bravobit-bb-foundation-dashboard.mjs} +0 -0
  53. package/esm2020/dashboard/lib/dashboard/dashboard.component.mjs +56 -0
  54. package/esm2020/dashboard/lib/dashboard-header/dashboard-header.component.mjs +30 -0
  55. package/esm2020/dashboard/lib/dashboard-menu/dashboard-menu.component.mjs +31 -0
  56. package/esm2020/dashboard/lib/dashboard-menu-item/dashboard-menu-item.component.mjs +29 -0
  57. package/esm2020/dashboard/lib/dashboard-sidebar/dashboard-sidebar.component.mjs +75 -0
  58. package/esm2020/dashboard/lib/dashboard-sidebar-group/dashboard-sidebar-group.component.mjs +99 -0
  59. package/esm2020/dashboard/lib/dashboard-sidebar-item/dashboard-sidebar-item.component.mjs +62 -0
  60. package/{esm2015/dashboard/lib/dashboard.module.js → esm2020/dashboard/lib/dashboard.module.mjs} +5 -5
  61. package/{esm2015/dashboard/public_api.js → esm2020/dashboard/public_api.mjs} +0 -0
  62. package/{esm2015/dialog/bravobit-bb-foundation-dialog.js → esm2020/dialog/bravobit-bb-foundation-dialog.mjs} +0 -0
  63. package/esm2020/dialog/lib/dialog-actions/dialog-actions.component.mjs +12 -0
  64. package/esm2020/dialog/lib/dialog-confirm/dialog-confirm.component.mjs +37 -0
  65. package/{esm2015/dialog/lib/dialog-container/dialog-container.component.js → esm2020/dialog/lib/dialog-container/dialog-container.component.mjs} +6 -15
  66. package/esm2020/dialog/lib/dialog-header/dialog-header.component.mjs +25 -0
  67. package/esm2020/dialog/lib/dialog-link/dialog-link.component.mjs +11 -0
  68. package/esm2020/dialog/lib/dialog-modal/dialog-modal.component.mjs +46 -0
  69. package/esm2020/dialog/lib/dialog-overlay/dialog-overlay.component.mjs +134 -0
  70. package/{esm2015/dialog/lib/dialog.injector.js → esm2020/dialog/lib/dialog.injector.mjs} +0 -0
  71. package/{esm2015/dialog/lib/dialog.insertion.js → esm2020/dialog/lib/dialog.insertion.mjs} +4 -4
  72. package/{esm2015/dialog/lib/dialog.interfaces.js → esm2020/dialog/lib/dialog.interfaces.mjs} +0 -0
  73. package/{esm2015/dialog/lib/dialog.module.js → esm2020/dialog/lib/dialog.module.mjs} +5 -9
  74. package/{esm2015/dialog/lib/dialog.ref.js → esm2020/dialog/lib/dialog.ref.mjs} +0 -0
  75. package/{esm2015/dialog/lib/dialog.service.js → esm2020/dialog/lib/dialog.service.mjs} +5 -5
  76. package/{esm2015/dialog/public_api.js → esm2020/dialog/public_api.mjs} +0 -0
  77. package/{esm2015/elements/bravobit-bb-foundation-elements.js → esm2020/elements/bravobit-bb-foundation-elements.mjs} +0 -0
  78. package/esm2020/elements/lib/avatar/avatar.component.mjs +142 -0
  79. package/esm2020/elements/lib/button/button.component.mjs +61 -0
  80. package/esm2020/elements/lib/checkbox/checkbox.component.mjs +73 -0
  81. package/esm2020/elements/lib/date-picker/date-picker.component.mjs +304 -0
  82. package/{esm2015/elements/lib/directives/addon.directive.js → esm2020/elements/lib/directives/addon.directive.mjs} +7 -7
  83. package/esm2020/elements/lib/directives/autosize.directive.mjs +72 -0
  84. package/{esm2015/elements/lib/directives/focus-trap.directive.js → esm2020/elements/lib/directives/focus-trap.directive.mjs} +4 -4
  85. package/{esm2015/elements/lib/directives/focus.directive.js → esm2020/elements/lib/directives/focus.directive.mjs} +4 -4
  86. package/esm2020/elements/lib/directives/form-submit.directive.mjs +50 -0
  87. package/esm2020/elements/lib/directives/input.directive.mjs +136 -0
  88. package/{esm2015/elements/lib/directives/template.directive.js → esm2020/elements/lib/directives/template.directive.mjs} +4 -4
  89. package/esm2020/elements/lib/dropdown/dropdown.component.mjs +100 -0
  90. package/{esm2015/elements/lib/elements.interfaces.js → esm2020/elements/lib/elements.interfaces.mjs} +0 -0
  91. package/{esm2015/elements/lib/elements.module.js → esm2020/elements/lib/elements.module.mjs} +5 -5
  92. package/esm2020/elements/lib/file-picker/file-picker.component.mjs +236 -0
  93. package/esm2020/elements/lib/form-control/form-control.component.mjs +49 -0
  94. package/esm2020/elements/lib/form-error/form-error.component.mjs +108 -0
  95. package/esm2020/elements/lib/form-group/form-group.component.mjs +18 -0
  96. package/esm2020/elements/lib/icon/icon.component.mjs +102 -0
  97. package/esm2020/elements/lib/image-picker/image-picker.component.mjs +106 -0
  98. package/esm2020/elements/lib/pipes/file-image.pipe.mjs +42 -0
  99. package/{esm2015/elements/lib/pipes/file-size.pipe.js → esm2020/elements/lib/pipes/file-size.pipe.mjs} +4 -4
  100. package/esm2020/elements/lib/pipes/relative-time.pipe.mjs +94 -0
  101. package/esm2020/elements/lib/spinner/spinner.component.mjs +25 -0
  102. package/esm2020/elements/lib/tag/tag.component.mjs +18 -0
  103. package/{esm2015/elements/public_api.js → esm2020/elements/public_api.mjs} +0 -0
  104. package/{esm2015/http/bravobit-bb-foundation-http.js → esm2020/http/bravobit-bb-foundation-http.mjs} +0 -0
  105. package/esm2020/http/lib/classes/http.config.mjs +29 -0
  106. package/esm2020/http/lib/classes/http.error.mjs +20 -0
  107. package/{esm2015/http/lib/http.interfaces.js → esm2020/http/lib/http.interfaces.mjs} +0 -0
  108. package/{esm2015/http/lib/http.module.js → esm2020/http/lib/http.module.mjs} +5 -5
  109. package/esm2020/http/lib/interceptors/base-url.interceptor.mjs +50 -0
  110. package/esm2020/http/lib/interceptors/error.interceptor.mjs +32 -0
  111. package/{esm2015/http/public_api.js → esm2020/http/public_api.mjs} +0 -0
  112. package/{esm2015/lib/core/coercions/boolean-coercion.js → esm2020/lib/core/coercions/boolean-coercion.mjs} +0 -0
  113. package/{esm2015/lib/core/miscellaneous/regex.js → esm2020/lib/core/miscellaneous/regex.mjs} +0 -0
  114. package/esm2020/lib/core/miscellaneous/validator.mjs +85 -0
  115. package/{esm2015/lib/core/mixins/can-disable.js → esm2020/lib/core/mixins/can-disable.mjs} +0 -0
  116. package/{esm2015/lib/core/mixins/can-hide-errors.js → esm2020/lib/core/mixins/can-hide-errors.mjs} +0 -0
  117. package/{esm2015/lib/core/mixins/can-load.js → esm2020/lib/core/mixins/can-load.mjs} +0 -0
  118. package/{esm2015/lib/core/mixins/constructor.js → esm2020/lib/core/mixins/constructor.mjs} +0 -0
  119. package/{esm2015/lib/core/mixins/has-error.js → esm2020/lib/core/mixins/has-error.mjs} +0 -0
  120. package/{esm2015/lib/core/mixins/is-focused.js → esm2020/lib/core/mixins/is-focused.mjs} +0 -0
  121. package/{esm2015/lib/core/mixins/is-grouped.js → esm2020/lib/core/mixins/is-grouped.mjs} +0 -0
  122. package/{esm2015/lib/core/mixins/is-readonly.js → esm2020/lib/core/mixins/is-readonly.mjs} +0 -0
  123. package/{esm2015/lib/core/mixins/is-required.js → esm2020/lib/core/mixins/is-required.mjs} +0 -0
  124. package/esm2020/lib/core/services/clipboard.service.mjs +70 -0
  125. package/esm2020/lib/core/services/exif.service.mjs +163 -0
  126. package/esm2020/lib/core/services/file-loader.service.mjs +87 -0
  127. package/esm2020/lib/core/services/image-converter.service.mjs +123 -0
  128. package/{esm2015/lib/core/services/languages.service.js → esm2020/lib/core/services/languages.service.mjs} +4 -4
  129. package/{esm2015/lib/core/services/network.service.js → esm2020/lib/core/services/network.service.mjs} +5 -6
  130. package/esm2020/lib/core/services/patch.service.mjs +63 -0
  131. package/{esm2015/lib/core/services/platform.service.js → esm2020/lib/core/services/platform.service.mjs} +5 -5
  132. package/{esm2015/lib/core/tokens/accept-language.token.js → esm2020/lib/core/tokens/accept-language.token.mjs} +0 -0
  133. package/{esm2015/lib/core/tokens/base-url.token.js → esm2020/lib/core/tokens/base-url.token.mjs} +0 -0
  134. package/{esm2015/lib/core/tokens/cookie.token.js → esm2020/lib/core/tokens/cookie.token.mjs} +0 -0
  135. package/{esm2015/lib/core/tokens/location.token.js → esm2020/lib/core/tokens/location.token.mjs} +0 -0
  136. package/{esm2015/lib/core/tokens/navigator.token.js → esm2020/lib/core/tokens/navigator.token.mjs} +0 -0
  137. package/{esm2015/lib/core/tokens/window.token.js → esm2020/lib/core/tokens/window.token.mjs} +0 -0
  138. package/{esm2015/localize/bravobit-bb-foundation-localize.js → esm2020/localize/bravobit-bb-foundation-localize.mjs} +0 -0
  139. package/{esm2015/localize/lib/functions/date.function.js → esm2020/localize/lib/functions/date.function.mjs} +0 -0
  140. package/{esm2015/localize/lib/functions/lowercase.function.js → esm2020/localize/lib/functions/lowercase.function.mjs} +0 -0
  141. package/{esm2015/localize/lib/functions/uppercase.function.js → esm2020/localize/lib/functions/uppercase.function.mjs} +0 -0
  142. package/{esm2015/localize/lib/handlers/missing.handler.js → esm2020/localize/lib/handlers/missing.handler.mjs} +0 -0
  143. package/{esm2015/localize/lib/interfaces/config.interfaces.js → esm2020/localize/lib/interfaces/config.interfaces.mjs} +0 -0
  144. package/{esm2015/localize/lib/interfaces/dictionary.interfaces.js → esm2020/localize/lib/interfaces/dictionary.interfaces.mjs} +0 -0
  145. package/{esm2015/localize/lib/interfaces/functions.interfaces.js → esm2020/localize/lib/interfaces/functions.interfaces.mjs} +0 -0
  146. package/{esm2015/localize/lib/interfaces/handlers.interfaces.js → esm2020/localize/lib/interfaces/handlers.interfaces.mjs} +0 -0
  147. package/{esm2015/localize/lib/interfaces/options.interfaces.js → esm2020/localize/lib/interfaces/options.interfaces.mjs} +0 -0
  148. package/{esm2015/localize/lib/localizations/dutch.localization.js → esm2020/localize/lib/localizations/dutch.localization.mjs} +0 -0
  149. package/{esm2015/localize/lib/localizations/english.localization.js → esm2020/localize/lib/localizations/english.localization.mjs} +0 -0
  150. package/esm2020/localize/lib/localize.dictionary.mjs +135 -0
  151. package/{esm2015/localize/lib/localize.module.js → esm2020/localize/lib/localize.module.mjs} +5 -5
  152. package/{esm2015/localize/lib/localize.pipe.js → esm2020/localize/lib/localize.pipe.mjs} +5 -5
  153. package/esm2020/localize/lib/localize.service.mjs +277 -0
  154. package/esm2020/localize/lib/views/localize-string/localize-string.component.mjs +88 -0
  155. package/{esm2015/localize/lib/views/localize-template-or-string.directive.js → esm2020/localize/lib/views/localize-template-or-string.directive.mjs} +4 -4
  156. package/{esm2015/localize/lib/views/localize-template.directive.js → esm2020/localize/lib/views/localize-template.directive.mjs} +4 -4
  157. package/{esm2015/localize/public_api.js → esm2020/localize/public_api.mjs} +0 -0
  158. package/{esm2015/notifications/bravobit-bb-foundation-notifications.js → esm2020/notifications/bravobit-bb-foundation-notifications.mjs} +0 -0
  159. package/esm2020/notifications/lib/notifications-item/notifications-item.component.mjs +100 -0
  160. package/esm2020/notifications/lib/notifications-list/notifications-list.component.mjs +47 -0
  161. package/{esm2015/notifications/lib/notifications.animations.js → esm2020/notifications/lib/notifications.animations.mjs} +0 -0
  162. package/{esm2015/notifications/lib/notifications.injector.js → esm2020/notifications/lib/notifications.injector.mjs} +0 -0
  163. package/{esm2015/notifications/lib/notifications.interfaces.js → esm2020/notifications/lib/notifications.interfaces.mjs} +0 -0
  164. package/{esm2015/notifications/lib/notifications.module.js → esm2020/notifications/lib/notifications.module.mjs} +6 -7
  165. package/{esm2015/notifications/lib/notifications.service.js → esm2020/notifications/lib/notifications.service.mjs} +5 -5
  166. package/{esm2015/notifications/public_api.js → esm2020/notifications/public_api.mjs} +0 -0
  167. package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
  168. package/{esm2015/recaptcha/bravobit-bb-foundation-recaptcha.js → esm2020/recaptcha/bravobit-bb-foundation-recaptcha.mjs} +0 -0
  169. package/esm2020/recaptcha/lib/recaptcha/recaptcha.component.mjs +185 -0
  170. package/esm2020/recaptcha/lib/recaptcha-loader.service.mjs +90 -0
  171. package/{esm2015/recaptcha/lib/recaptcha.interface.js → esm2020/recaptcha/lib/recaptcha.interface.mjs} +0 -0
  172. package/{esm2015/recaptcha/lib/recaptcha.module.js → esm2020/recaptcha/lib/recaptcha.module.mjs} +5 -5
  173. package/{esm2015/recaptcha/public_api.js → esm2020/recaptcha/public_api.mjs} +0 -0
  174. package/{esm2015/rxjs/bravobit-bb-foundation-rxjs.js → esm2020/rxjs/bravobit-bb-foundation-rxjs.mjs} +0 -0
  175. package/esm2020/rxjs/lib/operators/combine-latest-map.operator.mjs +10 -0
  176. package/{esm2015/rxjs/lib/operators/filter-nil.operator.js → esm2020/rxjs/lib/operators/filter-nil.operator.mjs} +0 -0
  177. package/{esm2015/rxjs/public_api.js → esm2020/rxjs/public_api.mjs} +0 -0
  178. package/{esm2015/storage/bravobit-bb-foundation-storage.js → esm2020/storage/bravobit-bb-foundation-storage.mjs} +0 -0
  179. package/{esm2015/storage/lib/interfaces/attributes.interface.js → esm2020/storage/lib/interfaces/attributes.interface.mjs} +0 -0
  180. package/{esm2015/storage/lib/interfaces/memory.interface.js → esm2020/storage/lib/interfaces/memory.interface.mjs} +0 -0
  181. package/{esm2015/storage/lib/interfaces/strategy.interface.js → esm2020/storage/lib/interfaces/strategy.interface.mjs} +0 -0
  182. package/esm2020/storage/lib/storage.service.mjs +109 -0
  183. package/esm2020/storage/lib/strategies/cookie-storage.strategy.mjs +142 -0
  184. package/{esm2015/storage/lib/strategies/memory-storage.strategy.js → esm2020/storage/lib/strategies/memory-storage.strategy.mjs} +2 -2
  185. package/esm2020/storage/lib/strategies/polyfill-storage.strategy.mjs +102 -0
  186. package/{esm2015/storage/public_api.js → esm2020/storage/public_api.mjs} +0 -0
  187. package/{esm2015/table/bravobit-bb-foundation-table.js → esm2020/table/bravobit-bb-foundation-table.mjs} +0 -0
  188. package/esm2020/table/lib/components/table/table.component.mjs +191 -0
  189. package/esm2020/table/lib/components/table-cell/table-cell.component.mjs +11 -0
  190. package/esm2020/table/lib/components/table-header-cell/table-header-cell.component.mjs +131 -0
  191. package/esm2020/table/lib/components/table-pager/table-pager.component.mjs +136 -0
  192. package/esm2020/table/lib/data/datasource.data.mjs +32 -0
  193. package/esm2020/table/lib/data/generic.data.mjs +72 -0
  194. package/{esm2015/table/lib/interfaces/datasource.interface.js → esm2020/table/lib/interfaces/datasource.interface.mjs} +0 -0
  195. package/{esm2015/table/lib/interfaces/table.interfaces.js → esm2020/table/lib/interfaces/table.interfaces.mjs} +0 -0
  196. package/{esm2015/table/lib/table.module.js → esm2020/table/lib/table.module.mjs} +5 -5
  197. package/{esm2015/table/public_api.js → esm2020/table/public_api.mjs} +0 -0
  198. package/fesm2015/{bravobit-bb-foundation-auth.js → bravobit-bb-foundation-auth.mjs} +79 -68
  199. package/fesm2015/bravobit-bb-foundation-auth.mjs.map +1 -0
  200. package/fesm2015/{bravobit-bb-foundation-collections.js → bravobit-bb-foundation-collections.mjs} +33 -47
  201. package/fesm2015/bravobit-bb-foundation-collections.mjs.map +1 -0
  202. package/fesm2015/bravobit-bb-foundation-controls.mjs +123 -0
  203. package/fesm2015/bravobit-bb-foundation-controls.mjs.map +1 -0
  204. package/fesm2015/bravobit-bb-foundation-dashboard.mjs +416 -0
  205. package/fesm2015/bravobit-bb-foundation-dashboard.mjs.map +1 -0
  206. package/fesm2015/{bravobit-bb-foundation-dialog.js → bravobit-bb-foundation-dialog.mjs} +45 -106
  207. package/fesm2015/bravobit-bb-foundation-dialog.mjs.map +1 -0
  208. package/fesm2015/{bravobit-bb-foundation-elements.js → bravobit-bb-foundation-elements.mjs} +193 -302
  209. package/fesm2015/bravobit-bb-foundation-elements.mjs.map +1 -0
  210. package/fesm2015/{bravobit-bb-foundation-http.js → bravobit-bb-foundation-http.mjs} +18 -16
  211. package/fesm2015/bravobit-bb-foundation-http.mjs.map +1 -0
  212. package/fesm2015/{bravobit-bb-foundation-localize.js → bravobit-bb-foundation-localize.mjs} +63 -69
  213. package/fesm2015/bravobit-bb-foundation-localize.mjs.map +1 -0
  214. package/fesm2015/bravobit-bb-foundation-notifications.mjs +377 -0
  215. package/fesm2015/bravobit-bb-foundation-notifications.mjs.map +1 -0
  216. package/fesm2015/{bravobit-bb-foundation-recaptcha.js → bravobit-bb-foundation-recaptcha.mjs} +40 -47
  217. package/fesm2015/bravobit-bb-foundation-recaptcha.mjs.map +1 -0
  218. package/fesm2015/{bravobit-bb-foundation-rxjs.js → bravobit-bb-foundation-rxjs.mjs} +1 -1
  219. package/fesm2015/bravobit-bb-foundation-rxjs.mjs.map +1 -0
  220. package/fesm2015/{bravobit-bb-foundation-storage.js → bravobit-bb-foundation-storage.mjs} +12 -10
  221. package/fesm2015/bravobit-bb-foundation-storage.mjs.map +1 -0
  222. package/fesm2015/bravobit-bb-foundation-table.mjs +603 -0
  223. package/fesm2015/bravobit-bb-foundation-table.mjs.map +1 -0
  224. package/fesm2015/{bravobit-bb-foundation.js → bravobit-bb-foundation.mjs} +74 -64
  225. package/fesm2015/bravobit-bb-foundation.mjs.map +1 -0
  226. package/fesm2020/bravobit-bb-foundation-auth.mjs +928 -0
  227. package/fesm2020/bravobit-bb-foundation-auth.mjs.map +1 -0
  228. package/fesm2020/bravobit-bb-foundation-collections.mjs +434 -0
  229. package/fesm2020/bravobit-bb-foundation-collections.mjs.map +1 -0
  230. package/fesm2020/bravobit-bb-foundation-controls.mjs +121 -0
  231. package/fesm2020/bravobit-bb-foundation-controls.mjs.map +1 -0
  232. package/fesm2020/bravobit-bb-foundation-dashboard.mjs +404 -0
  233. package/fesm2020/bravobit-bb-foundation-dashboard.mjs.map +1 -0
  234. package/fesm2020/bravobit-bb-foundation-dialog.mjs +584 -0
  235. package/fesm2020/bravobit-bb-foundation-dialog.mjs.map +1 -0
  236. package/fesm2020/bravobit-bb-foundation-elements.mjs +1993 -0
  237. package/fesm2020/bravobit-bb-foundation-elements.mjs.map +1 -0
  238. package/fesm2020/bravobit-bb-foundation-http.mjs +168 -0
  239. package/fesm2020/bravobit-bb-foundation-http.mjs.map +1 -0
  240. package/fesm2020/bravobit-bb-foundation-localize.mjs +832 -0
  241. package/fesm2020/bravobit-bb-foundation-localize.mjs.map +1 -0
  242. package/fesm2020/bravobit-bb-foundation-notifications.mjs +375 -0
  243. package/fesm2020/bravobit-bb-foundation-notifications.mjs.map +1 -0
  244. package/fesm2020/bravobit-bb-foundation-recaptcha.mjs +300 -0
  245. package/fesm2020/bravobit-bb-foundation-recaptcha.mjs.map +1 -0
  246. package/fesm2020/bravobit-bb-foundation-rxjs.mjs +21 -0
  247. package/fesm2020/bravobit-bb-foundation-rxjs.mjs.map +1 -0
  248. package/fesm2020/bravobit-bb-foundation-storage.mjs +413 -0
  249. package/fesm2020/bravobit-bb-foundation-storage.mjs.map +1 -0
  250. package/fesm2020/bravobit-bb-foundation-table.mjs +592 -0
  251. package/fesm2020/bravobit-bb-foundation-table.mjs.map +1 -0
  252. package/fesm2020/bravobit-bb-foundation.mjs +895 -0
  253. package/fesm2020/bravobit-bb-foundation.mjs.map +1 -0
  254. package/http/package.json +5 -5
  255. package/localize/package.json +5 -5
  256. package/notifications/package.json +5 -5
  257. package/package.json +125 -8
  258. package/recaptcha/package.json +5 -5
  259. package/rxjs/package.json +5 -5
  260. package/storage/package.json +5 -5
  261. package/table/lib/components/table/table.component.d.ts +3 -0
  262. package/table/package.json +5 -5
  263. package/bundles/bravobit-bb-foundation-auth.umd.js +0 -1483
  264. package/bundles/bravobit-bb-foundation-auth.umd.js.map +0 -1
  265. package/bundles/bravobit-bb-foundation-collections.umd.js +0 -868
  266. package/bundles/bravobit-bb-foundation-collections.umd.js.map +0 -1
  267. package/bundles/bravobit-bb-foundation-dashboard.umd.js +0 -876
  268. package/bundles/bravobit-bb-foundation-dashboard.umd.js.map +0 -1
  269. package/bundles/bravobit-bb-foundation-dialog.umd.js +0 -716
  270. package/bundles/bravobit-bb-foundation-dialog.umd.js.map +0 -1
  271. package/bundles/bravobit-bb-foundation-elements.umd.js +0 -2768
  272. package/bundles/bravobit-bb-foundation-elements.umd.js.map +0 -1
  273. package/bundles/bravobit-bb-foundation-http.umd.js +0 -535
  274. package/bundles/bravobit-bb-foundation-http.umd.js.map +0 -1
  275. package/bundles/bravobit-bb-foundation-localize.umd.js +0 -1292
  276. package/bundles/bravobit-bb-foundation-localize.umd.js.map +0 -1
  277. package/bundles/bravobit-bb-foundation-notifications.umd.js +0 -794
  278. package/bundles/bravobit-bb-foundation-notifications.umd.js.map +0 -1
  279. package/bundles/bravobit-bb-foundation-recaptcha.umd.js +0 -683
  280. package/bundles/bravobit-bb-foundation-recaptcha.umd.js.map +0 -1
  281. package/bundles/bravobit-bb-foundation-rxjs.umd.js +0 -29
  282. package/bundles/bravobit-bb-foundation-rxjs.umd.js.map +0 -1
  283. package/bundles/bravobit-bb-foundation-storage.umd.js +0 -799
  284. package/bundles/bravobit-bb-foundation-storage.umd.js.map +0 -1
  285. package/bundles/bravobit-bb-foundation-table.umd.js +0 -1070
  286. package/bundles/bravobit-bb-foundation-table.umd.js.map +0 -1
  287. package/bundles/bravobit-bb-foundation.umd.js +0 -1440
  288. package/bundles/bravobit-bb-foundation.umd.js.map +0 -1
  289. package/esm2015/auth/lib/auth.interceptor.js +0 -95
  290. package/esm2015/auth/lib/auth.service.js +0 -299
  291. package/esm2015/auth/lib/auth.session.js +0 -136
  292. package/esm2015/auth/lib/directives/permission.directive.js +0 -81
  293. package/esm2015/auth/lib/directives/role.directive.js +0 -38
  294. package/esm2015/auth/lib/guards/anonymous.guard.js +0 -35
  295. package/esm2015/auth/lib/guards/authenticated.guard.js +0 -36
  296. package/esm2015/auth/lib/permissions.service.js +0 -58
  297. package/esm2015/auth/lib/providers/email.provider.js +0 -26
  298. package/esm2015/auth/lib/providers/verify.provider.js +0 -20
  299. package/esm2015/collections/lib/collection.js +0 -104
  300. package/esm2015/collections/lib/components/collections-pager/collections-pager.component.js +0 -136
  301. package/esm2015/collections/lib/components/collections-viewer/collections-viewer.component.js +0 -39
  302. package/esm2015/collections/lib/providers/api-collection.provider.js +0 -69
  303. package/esm2015/collections/lib/providers/collection.provider.js +0 -14
  304. package/esm2015/dashboard/lib/dashboard/dashboard.component.js +0 -64
  305. package/esm2015/dashboard/lib/dashboard-header/dashboard-header.component.js +0 -41
  306. package/esm2015/dashboard/lib/dashboard-menu/dashboard-menu.component.js +0 -39
  307. package/esm2015/dashboard/lib/dashboard-menu-item/dashboard-menu-item.component.js +0 -38
  308. package/esm2015/dashboard/lib/dashboard-sidebar/dashboard-sidebar.component.js +0 -83
  309. package/esm2015/dashboard/lib/dashboard-sidebar-group/dashboard-sidebar-group.component.js +0 -110
  310. package/esm2015/dashboard/lib/dashboard-sidebar-item/dashboard-sidebar-item.component.js +0 -71
  311. package/esm2015/dialog/lib/dialog-actions/dialog-actions.component.js +0 -20
  312. package/esm2015/dialog/lib/dialog-confirm/dialog-confirm.component.js +0 -45
  313. package/esm2015/dialog/lib/dialog-header/dialog-header.component.js +0 -33
  314. package/esm2015/dialog/lib/dialog-link/dialog-link.component.js +0 -19
  315. package/esm2015/dialog/lib/dialog-modal/dialog-modal.component.js +0 -54
  316. package/esm2015/dialog/lib/dialog-overlay/dialog-overlay.component.js +0 -143
  317. package/esm2015/elements/lib/avatar/avatar.component.js +0 -151
  318. package/esm2015/elements/lib/button/button.component.js +0 -79
  319. package/esm2015/elements/lib/checkbox/checkbox.component.js +0 -83
  320. package/esm2015/elements/lib/date-picker/date-picker.component.js +0 -322
  321. package/esm2015/elements/lib/directives/autosize.directive.js +0 -74
  322. package/esm2015/elements/lib/directives/form-submit.directive.js +0 -53
  323. package/esm2015/elements/lib/directives/input.directive.js +0 -139
  324. package/esm2015/elements/lib/dropdown/dropdown.component.js +0 -111
  325. package/esm2015/elements/lib/file-picker/file-picker.component.js +0 -247
  326. package/esm2015/elements/lib/form-control/form-control.component.js +0 -58
  327. package/esm2015/elements/lib/form-error/form-error.component.js +0 -116
  328. package/esm2015/elements/lib/form-group/form-group.component.js +0 -27
  329. package/esm2015/elements/lib/icon/icon.component.js +0 -110
  330. package/esm2015/elements/lib/image-picker/image-picker.component.js +0 -119
  331. package/esm2015/elements/lib/pipes/file-image.pipe.js +0 -45
  332. package/esm2015/elements/lib/pipes/relative-time.pipe.js +0 -96
  333. package/esm2015/elements/lib/spinner/spinner.component.js +0 -34
  334. package/esm2015/elements/lib/tag/tag.component.js +0 -26
  335. package/esm2015/http/lib/classes/http.config.js +0 -31
  336. package/esm2015/http/lib/classes/http.error.js +0 -21
  337. package/esm2015/http/lib/interceptors/base-url.interceptor.js +0 -52
  338. package/esm2015/http/lib/interceptors/error.interceptor.js +0 -33
  339. package/esm2015/lib/core/miscellaneous/validator.js +0 -86
  340. package/esm2015/lib/core/services/clipboard.service.js +0 -72
  341. package/esm2015/lib/core/services/exif.service.js +0 -168
  342. package/esm2015/lib/core/services/file-loader.service.js +0 -90
  343. package/esm2015/lib/core/services/image-converter.service.js +0 -130
  344. package/esm2015/lib/core/services/patch.service.js +0 -65
  345. package/esm2015/localize/lib/localize.dictionary.js +0 -137
  346. package/esm2015/localize/lib/localize.service.js +0 -282
  347. package/esm2015/localize/lib/views/localize-string/localize-string.component.js +0 -99
  348. package/esm2015/notifications/lib/notifications-item/notifications-item.component.js +0 -108
  349. package/esm2015/notifications/lib/notifications-list/notifications-list.component.js +0 -56
  350. package/esm2015/recaptcha/lib/recaptcha/recaptcha.component.js +0 -199
  351. package/esm2015/recaptcha/lib/recaptcha-loader.service.js +0 -93
  352. package/esm2015/rxjs/lib/operators/combine-latest-map.operator.js +0 -7
  353. package/esm2015/storage/lib/storage.service.js +0 -111
  354. package/esm2015/storage/lib/strategies/cookie-storage.strategy.js +0 -143
  355. package/esm2015/storage/lib/strategies/polyfill-storage.strategy.js +0 -102
  356. package/esm2015/table/lib/components/table/table.component.js +0 -196
  357. package/esm2015/table/lib/components/table-cell/table-cell.component.js +0 -19
  358. package/esm2015/table/lib/components/table-header-cell/table-header-cell.component.js +0 -141
  359. package/esm2015/table/lib/components/table-pager/table-pager.component.js +0 -146
  360. package/esm2015/table/lib/data/datasource.data.js +0 -32
  361. package/esm2015/table/lib/data/generic.data.js +0 -73
  362. package/fesm2015/bravobit-bb-foundation-auth.js.map +0 -1
  363. package/fesm2015/bravobit-bb-foundation-collections.js.map +0 -1
  364. package/fesm2015/bravobit-bb-foundation-dashboard.js +0 -468
  365. package/fesm2015/bravobit-bb-foundation-dashboard.js.map +0 -1
  366. package/fesm2015/bravobit-bb-foundation-dialog.js.map +0 -1
  367. package/fesm2015/bravobit-bb-foundation-elements.js.map +0 -1
  368. package/fesm2015/bravobit-bb-foundation-http.js.map +0 -1
  369. package/fesm2015/bravobit-bb-foundation-localize.js.map +0 -1
  370. package/fesm2015/bravobit-bb-foundation-notifications.js +0 -393
  371. package/fesm2015/bravobit-bb-foundation-notifications.js.map +0 -1
  372. package/fesm2015/bravobit-bb-foundation-recaptcha.js.map +0 -1
  373. package/fesm2015/bravobit-bb-foundation-rxjs.js.map +0 -1
  374. package/fesm2015/bravobit-bb-foundation-storage.js.map +0 -1
  375. package/fesm2015/bravobit-bb-foundation-table.js +0 -626
  376. package/fesm2015/bravobit-bb-foundation-table.js.map +0 -1
  377. package/fesm2015/bravobit-bb-foundation.js.map +0 -1
@@ -0,0 +1,1993 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, ChangeDetectionStrategy, ViewEncapsulation, HostListener, Directive, Optional, Host, Input, InjectionToken, EventEmitter, forwardRef, ViewChild, Output, Self, Inject, TemplateRef, ContentChild, Pipe, HostBinding, LOCALE_ID, NgModule } from '@angular/core';
3
+ import { trigger, transition, style, animate } from '@angular/animations';
4
+ import { BehaviorSubject, fromEvent, merge, EMPTY, combineLatest, of, Subscription } from 'rxjs';
5
+ import * as i1 from '@angular/common';
6
+ import { formatDate, DatePipe, CommonModule } from '@angular/common';
7
+ import * as i1$1 from '@bravobit/bb-foundation';
8
+ import { mixinDisabled, mixinLoad, mixinGrouped, mixinFocused, mixinReadonly, mixinRequired, mixinError, mixinHideErrors, coerceBooleanProperty } from '@bravobit/bb-foundation';
9
+ import * as i5 from '@angular/forms';
10
+ import { NG_VALUE_ACCESSOR, NgControl, NG_VALIDATORS, Validators, FormGroup, FormControl, ReactiveFormsModule } from '@angular/forms';
11
+ import { map, mapTo, startWith, distinctUntilChanged, shareReplay, tap, delay } from 'rxjs/operators';
12
+ import * as i4 from '@bravobit/bb-foundation/localize';
13
+ import { LocalizeModule } from '@bravobit/bb-foundation/localize';
14
+ import * as i2 from '@angular/platform-browser';
15
+
16
+ class BbDropdown {
17
+ constructor(_elementRef) {
18
+ this._elementRef = _elementRef;
19
+ // State.
20
+ this.visible$ = new BehaviorSubject(false);
21
+ }
22
+ toggle() {
23
+ return this.visible$.next(!this.visible$.getValue());
24
+ }
25
+ close() {
26
+ return this.visible$.next(false);
27
+ }
28
+ onDocumentClick(target) {
29
+ if (!target) {
30
+ return;
31
+ }
32
+ if (this._elementRef?.nativeElement?.contains(target)) {
33
+ return;
34
+ }
35
+ return this.close();
36
+ }
37
+ }
38
+ BbDropdown.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbDropdown, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
39
+ BbDropdown.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.0", type: BbDropdown, selector: "bb-dropdown", host: { listeners: { "document:click": "onDocumentClick($event.target)" }, classAttribute: "bb-dropdown" }, ngImport: i0, template: "<button (click)=\"toggle()\"\n [class.opened]=\"visible$ | async\"\n type=\"button\">\n <ng-content></ng-content>\n</button>\n\n<div *ngIf=\"visible$ | async\"\n [@dropdownMenuAnimation]=\"true\"\n class=\"bb-dropdown-menu\"\n role=\"list\">\n <ng-content select=\"[bbDropdownItem], hr\"></ng-content>\n</div>\n", styles: [".bb-dropdown{position:relative;display:inline-block}.bb-dropdown.right>.bb-dropdown-menu{right:0;left:auto;transform-origin:top right}.bb-dropdown-menu{left:0;top:100%;padding:0;z-index:10;display:block;margin:10px 0 0;border-radius:4px;position:absolute;list-style-type:none;background-color:#fff;border:1px solid #cccccc;transform-origin:top left;box-shadow:0 0 6px #0000001a}.bb-dropdown-menu:after{width:0;top:-5px;height:0;right:5px;content:\"\";position:absolute;border-style:solid;border-width:0 10px 5px 10px;border-color:transparent transparent #d9d9d9 transparent}.bb-dropdown-menu>hr{margin:0;height:1px;border:none;background-color:#ccc}.bb-dropdown-item{width:100%;border:none;line-height:1;display:block;cursor:pointer;text-align:left;font-weight:500;-webkit-user-select:none;user-select:none;padding:12px 20px;white-space:nowrap;text-decoration:none;color:#676767!important;background-color:transparent;transition:background-color .25s cubic-bezier(0,0,.2,1)}.bb-dropdown-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.bb-dropdown-item:hover{background-color:#f6f6f6}.bb-dropdown-item:focus{box-shadow:0 0 0 3px #dce0e980}.bb-dropdown-item:active{background-color:#f0f0f0}\n"], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i1.AsyncPipe }, animations: [
40
+ trigger('dropdownMenuAnimation', [
41
+ transition(':enter', [
42
+ // 1. Set the initial state.
43
+ style({ opacity: 0, transform: 'scale(0.9)' }),
44
+ // 2. Start the animation to show the item.
45
+ animate('80ms cubic-bezier(0, 0, .2, 1)', style({ opacity: 1, transform: 'scale(1)' }))
46
+ ]),
47
+ transition(':leave', [
48
+ // 1. Set the initial state.
49
+ style({ opacity: 1, transform: 'scale(1)' }),
50
+ // 2. Start the animation to hide the item.
51
+ animate('80ms cubic-bezier(0, 0, .2, 1)', style({ opacity: 0, transform: 'scale(0.9)' }))
52
+ ])
53
+ ])
54
+ ], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
55
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbDropdown, decorators: [{
56
+ type: Component,
57
+ args: [{ selector: 'bb-dropdown', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: { 'class': 'bb-dropdown' }, preserveWhitespaces: false, animations: [
58
+ trigger('dropdownMenuAnimation', [
59
+ transition(':enter', [
60
+ // 1. Set the initial state.
61
+ style({ opacity: 0, transform: 'scale(0.9)' }),
62
+ // 2. Start the animation to show the item.
63
+ animate('80ms cubic-bezier(0, 0, .2, 1)', style({ opacity: 1, transform: 'scale(1)' }))
64
+ ]),
65
+ transition(':leave', [
66
+ // 1. Set the initial state.
67
+ style({ opacity: 1, transform: 'scale(1)' }),
68
+ // 2. Start the animation to hide the item.
69
+ animate('80ms cubic-bezier(0, 0, .2, 1)', style({ opacity: 0, transform: 'scale(0.9)' }))
70
+ ])
71
+ ])
72
+ ], template: "<button (click)=\"toggle()\"\n [class.opened]=\"visible$ | async\"\n type=\"button\">\n <ng-content></ng-content>\n</button>\n\n<div *ngIf=\"visible$ | async\"\n [@dropdownMenuAnimation]=\"true\"\n class=\"bb-dropdown-menu\"\n role=\"list\">\n <ng-content select=\"[bbDropdownItem], hr\"></ng-content>\n</div>\n", styles: [".bb-dropdown{position:relative;display:inline-block}.bb-dropdown.right>.bb-dropdown-menu{right:0;left:auto;transform-origin:top right}.bb-dropdown-menu{left:0;top:100%;padding:0;z-index:10;display:block;margin:10px 0 0;border-radius:4px;position:absolute;list-style-type:none;background-color:#fff;border:1px solid #cccccc;transform-origin:top left;box-shadow:0 0 6px #0000001a}.bb-dropdown-menu:after{width:0;top:-5px;height:0;right:5px;content:\"\";position:absolute;border-style:solid;border-width:0 10px 5px 10px;border-color:transparent transparent #d9d9d9 transparent}.bb-dropdown-menu>hr{margin:0;height:1px;border:none;background-color:#ccc}.bb-dropdown-item{width:100%;border:none;line-height:1;display:block;cursor:pointer;text-align:left;font-weight:500;-webkit-user-select:none;user-select:none;padding:12px 20px;white-space:nowrap;text-decoration:none;color:#676767!important;background-color:transparent;transition:background-color .25s cubic-bezier(0,0,.2,1)}.bb-dropdown-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.bb-dropdown-item:hover{background-color:#f6f6f6}.bb-dropdown-item:focus{box-shadow:0 0 0 3px #dce0e980}.bb-dropdown-item:active{background-color:#f0f0f0}\n"] }]
73
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { onDocumentClick: [{
74
+ type: HostListener,
75
+ args: ['document:click', ['$event.target']]
76
+ }] } });
77
+ class BbDropdownItem {
78
+ constructor(_parent) {
79
+ this._parent = _parent;
80
+ // Inputs.
81
+ this.closeOnClick = true;
82
+ }
83
+ onClick() {
84
+ if (!this.closeOnClick) {
85
+ return;
86
+ }
87
+ this._parent?.close();
88
+ }
89
+ }
90
+ BbDropdownItem.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbDropdownItem, deps: [{ token: BbDropdown, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
91
+ BbDropdownItem.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.0", type: BbDropdownItem, selector: "[bbDropdownItem]", inputs: { closeOnClick: "closeOnClick" }, host: { listeners: { "click": "onClick()" }, classAttribute: "bb-dropdown-item" }, ngImport: i0 });
92
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbDropdownItem, decorators: [{
93
+ type: Directive,
94
+ args: [{
95
+ selector: '[bbDropdownItem]',
96
+ host: {
97
+ 'class': 'bb-dropdown-item'
98
+ }
99
+ }]
100
+ }], ctorParameters: function () { return [{ type: BbDropdown, decorators: [{
101
+ type: Optional
102
+ }, {
103
+ type: Host
104
+ }] }]; }, propDecorators: { closeOnClick: [{
105
+ type: Input
106
+ }], onClick: [{
107
+ type: HostListener,
108
+ args: ['click']
109
+ }] } });
110
+
111
+ const ELEMENTS_ICONS = new InjectionToken('elements_icons');
112
+ const ELEMENTS_ERRORS = new InjectionToken('elements_errors');
113
+
114
+ class BbSpinnerBase {
115
+ }
116
+ const BbSpinnerMixinBase = mixinDisabled(BbSpinnerBase);
117
+ class BbSpinner extends BbSpinnerMixinBase {
118
+ constructor() {
119
+ super(...arguments);
120
+ // Inputs.
121
+ this.color = '#303f9f';
122
+ this.alt = 'Loading...';
123
+ }
124
+ }
125
+ BbSpinner.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbSpinner, deps: null, target: i0.ɵɵFactoryTarget.Component });
126
+ BbSpinner.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.0", type: BbSpinner, selector: "bb-spinner", inputs: { color: "color", alt: "alt", disabled: "disabled" }, host: { classAttribute: "bb-spinner" }, usesInheritance: true, ngImport: i0, template: "<!--\n The spinner element.\n\n This element contains a circle with a 25% bar that spins\n indefinitely. The border color can be set via the \"color\"\n property.\n-->\n<div class=\"bb-spinner-container\">\n <div [style.border-left-color]=\"color\"\n [class.disabled]=\"disabled\"\n class=\"bb-spinner-loader\"\n aria-live=\"assertive\"\n role=\"alert\">\n {{ alt }}\n </div>\n <ng-content select=\"img\"></ng-content>\n</div>\n\n<!--\n The content of the spinner.\n\n This element contains the content of the spinner. The user\n can set the content inside the tag.\n-->\n<span class=\"bb-spinner-content\">\n <ng-content></ng-content>\n</span>\n", styles: [".bb-spinner{color:#565656;padding:20px 0;text-align:center;align-items:center;display:inline-flex;flex-direction:column;justify-content:center}.bb-spinner.block{display:flex}.bb-spinner.inverse .bb-spinner-loader{border-color:#ffffff26}.bb-spinner.inverse .bb-spinner-content{color:#ffffff80}.bb-spinner.small .bb-spinner-loader,.bb-spinner.small .bb-spinner-loader:after{width:20px;height:20px;min-width:20px;min-height:20px}.bb-spinner.small .bb-spinner-loader{border-width:2px}.bb-spinner.small .bb-spinner-content{font-size:12px}.bb-spinner.medium .bb-spinner-loader,.bb-spinner.medium .bb-spinner-loader:after{width:60px;height:60px;min-width:60px;min-height:60px}.bb-spinner.medium .bb-spinner-loader{border-width:4px}.bb-spinner.medium .bb-spinner-content{font-size:16px}.bb-spinner.large .bb-spinner-loader,.bb-spinner.large .bb-spinner-loader:after{width:100px;height:100px;min-width:100px;min-height:100px}.bb-spinner.large .bb-spinner-loader{border-width:6px}.bb-spinner.large .bb-spinner-content{font-size:20px}.bb-spinner.horizontal{text-align:left;flex-direction:row}.bb-spinner.horizontal .bb-spinner-content:not(:empty){margin-left:10px;margin-top:0}.bb-spinner.vertical{text-align:center;flex-direction:column}.bb-spinner.vertical .bb-spinner-content:not(:empty){margin-left:0;margin-top:10px}.bb-spinner-container{display:flex;position:relative}.bb-spinner-container>img{top:20%;left:20%;width:60%;height:60%;position:absolute}.bb-spinner-loader{margin:0;padding:0;overflow:hidden;text-indent:100%;color:transparent;position:relative;display:inline-block;vertical-align:middle;border:4px solid #f2f4f6;animation:1s linear infinite spin}.bb-spinner-loader,.bb-spinner-loader:after{width:60px;height:60px;min-width:60px;min-height:60px;border-radius:50%}.bb-spinner-loader.disabled{cursor:default;-webkit-user-select:none;user-select:none;pointer-events:none;animation-play-state:paused}.bb-spinner-content:not(:empty){font-size:16px;margin-top:10px;font-weight:500}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
127
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbSpinner, decorators: [{
128
+ type: Component,
129
+ args: [{ selector: 'bb-spinner', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: { 'class': 'bb-spinner' }, inputs: ['color', 'alt', 'disabled'], preserveWhitespaces: false, template: "<!--\n The spinner element.\n\n This element contains a circle with a 25% bar that spins\n indefinitely. The border color can be set via the \"color\"\n property.\n-->\n<div class=\"bb-spinner-container\">\n <div [style.border-left-color]=\"color\"\n [class.disabled]=\"disabled\"\n class=\"bb-spinner-loader\"\n aria-live=\"assertive\"\n role=\"alert\">\n {{ alt }}\n </div>\n <ng-content select=\"img\"></ng-content>\n</div>\n\n<!--\n The content of the spinner.\n\n This element contains the content of the spinner. The user\n can set the content inside the tag.\n-->\n<span class=\"bb-spinner-content\">\n <ng-content></ng-content>\n</span>\n", styles: [".bb-spinner{color:#565656;padding:20px 0;text-align:center;align-items:center;display:inline-flex;flex-direction:column;justify-content:center}.bb-spinner.block{display:flex}.bb-spinner.inverse .bb-spinner-loader{border-color:#ffffff26}.bb-spinner.inverse .bb-spinner-content{color:#ffffff80}.bb-spinner.small .bb-spinner-loader,.bb-spinner.small .bb-spinner-loader:after{width:20px;height:20px;min-width:20px;min-height:20px}.bb-spinner.small .bb-spinner-loader{border-width:2px}.bb-spinner.small .bb-spinner-content{font-size:12px}.bb-spinner.medium .bb-spinner-loader,.bb-spinner.medium .bb-spinner-loader:after{width:60px;height:60px;min-width:60px;min-height:60px}.bb-spinner.medium .bb-spinner-loader{border-width:4px}.bb-spinner.medium .bb-spinner-content{font-size:16px}.bb-spinner.large .bb-spinner-loader,.bb-spinner.large .bb-spinner-loader:after{width:100px;height:100px;min-width:100px;min-height:100px}.bb-spinner.large .bb-spinner-loader{border-width:6px}.bb-spinner.large .bb-spinner-content{font-size:20px}.bb-spinner.horizontal{text-align:left;flex-direction:row}.bb-spinner.horizontal .bb-spinner-content:not(:empty){margin-left:10px;margin-top:0}.bb-spinner.vertical{text-align:center;flex-direction:column}.bb-spinner.vertical .bb-spinner-content:not(:empty){margin-left:0;margin-top:10px}.bb-spinner-container{display:flex;position:relative}.bb-spinner-container>img{top:20%;left:20%;width:60%;height:60%;position:absolute}.bb-spinner-loader{margin:0;padding:0;overflow:hidden;text-indent:100%;color:transparent;position:relative;display:inline-block;vertical-align:middle;border:4px solid #f2f4f6;animation:1s linear infinite spin}.bb-spinner-loader,.bb-spinner-loader:after{width:60px;height:60px;min-width:60px;min-height:60px;border-radius:50%}.bb-spinner-loader.disabled{cursor:default;-webkit-user-select:none;user-select:none;pointer-events:none;animation-play-state:paused}.bb-spinner-content:not(:empty){font-size:16px;margin-top:10px;font-weight:500}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
130
+ }], propDecorators: { color: [{
131
+ type: Input
132
+ }], alt: [{
133
+ type: Input
134
+ }] } });
135
+
136
+ class BbButtonBase {
137
+ constructor(_elementRef) {
138
+ this._elementRef = _elementRef;
139
+ }
140
+ }
141
+ const BbButtonMixinBase = mixinDisabled(mixinLoad(BbButtonBase));
142
+ class BbButton extends BbButtonMixinBase {
143
+ constructor(_elementRef) {
144
+ super(_elementRef);
145
+ }
146
+ get nativeElement() {
147
+ return this._elementRef.nativeElement;
148
+ }
149
+ focus() {
150
+ this.nativeElement && this.nativeElement.focus();
151
+ }
152
+ }
153
+ BbButton.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbButton, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
154
+ BbButton.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.0", type: BbButton, selector: "button[bb-button]", inputs: { disabled: "disabled", loading: "loading" }, host: { properties: { "class.loading": "loading", "attr.disabled": "disabled || loading || null" }, classAttribute: "bb-button" }, exportAs: ["bbButton"], usesInheritance: true, ngImport: i0, template: "<bb-spinner [class.visible]=\"loading\"\n class=\"bb-button-spinner small\">\n</bb-spinner>\n\n<ng-content></ng-content>\n", styles: [".bb-button{height:38px;padding:0 8px;cursor:pointer;font-size:16px;font-weight:500;-webkit-user-select:none;user-select:none;position:relative;font-style:normal;border-radius:4px;text-align:center;align-items:center;display:inline-flex;text-decoration:none;justify-content:center;background-color:#fff;color:#2d3c4d!important;border:1px solid #d4d8e1;transition-duration:.2s;box-shadow:0 6px 6px -6px #0000001a;transition-timing-function:cubic-bezier(0,0,.2,1);transition-property:padding-left,background-color,box-shadow}.bb-button:hover{background-color:#fcfcfb}.bb-button:focus,.bb-button:active{box-shadow:0 6px 6px -6px #0000001a,0 0 0 3px #dce0e980}.bb-button.full{width:100%}.bb-button.full.loading{padding-left:42px}.bb-button.primary{border-color:#2f2b85;color:#fff!important;background-color:#5b53ff}.bb-button.primary:hover{background-color:#564ee6}.bb-button.primary:focus,.bb-button.primary:active{box-shadow:0 6px 6px -6px #0000001a,0 0 0 3px #5b53ff80}.bb-button.destructive{border-color:#8f2020;color:#fff!important;background-color:#d32f2f}.bb-button.destructive:hover{background-color:#c32929}.bb-button.destructive:focus,.bb-button.destructive:active{box-shadow:0 6px 6px -6px #0000001a,0 0 0 3px #d32f2f80}.bb-button:disabled,.bb-button:disabled:focus,.bb-button:disabled:hover,.bb-button:disabled:active,.bb-button[disabled],.bb-button[disabled]:focus,.bb-button[disabled]:hover,.bb-button[disabled]:active,.bb-button.loading,.bb-button.loading:focus,.bb-button.loading:hover,.bb-button.loading:active{opacity:.4;cursor:default;box-shadow:none}.bb-button-spinner{width:0;opacity:0;overflow:hidden;visibility:hidden;padding:0!important;transition:width .2s cubic-bezier(0,0,.2,1),opacity .1s cubic-bezier(0,0,.2,1)}.bb-button-spinner.visible{opacity:1;width:20px;margin-right:8px;visibility:visible}.bb-button.loading.full>.bb-button-spinner{left:8px;margin-right:0;position:absolute}\n"], components: [{ type: BbSpinner, selector: "bb-spinner", inputs: ["color", "alt", "disabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
155
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbButton, decorators: [{
156
+ type: Component,
157
+ args: [{ selector: 'button[bb-button]', exportAs: 'bbButton', host: {
158
+ 'class': 'bb-button',
159
+ '[class.loading]': 'loading',
160
+ '[attr.disabled]': 'disabled || loading || null'
161
+ }, inputs: ['disabled', 'loading'], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<bb-spinner [class.visible]=\"loading\"\n class=\"bb-button-spinner small\">\n</bb-spinner>\n\n<ng-content></ng-content>\n", styles: [".bb-button{height:38px;padding:0 8px;cursor:pointer;font-size:16px;font-weight:500;-webkit-user-select:none;user-select:none;position:relative;font-style:normal;border-radius:4px;text-align:center;align-items:center;display:inline-flex;text-decoration:none;justify-content:center;background-color:#fff;color:#2d3c4d!important;border:1px solid #d4d8e1;transition-duration:.2s;box-shadow:0 6px 6px -6px #0000001a;transition-timing-function:cubic-bezier(0,0,.2,1);transition-property:padding-left,background-color,box-shadow}.bb-button:hover{background-color:#fcfcfb}.bb-button:focus,.bb-button:active{box-shadow:0 6px 6px -6px #0000001a,0 0 0 3px #dce0e980}.bb-button.full{width:100%}.bb-button.full.loading{padding-left:42px}.bb-button.primary{border-color:#2f2b85;color:#fff!important;background-color:#5b53ff}.bb-button.primary:hover{background-color:#564ee6}.bb-button.primary:focus,.bb-button.primary:active{box-shadow:0 6px 6px -6px #0000001a,0 0 0 3px #5b53ff80}.bb-button.destructive{border-color:#8f2020;color:#fff!important;background-color:#d32f2f}.bb-button.destructive:hover{background-color:#c32929}.bb-button.destructive:focus,.bb-button.destructive:active{box-shadow:0 6px 6px -6px #0000001a,0 0 0 3px #d32f2f80}.bb-button:disabled,.bb-button:disabled:focus,.bb-button:disabled:hover,.bb-button:disabled:active,.bb-button[disabled],.bb-button[disabled]:focus,.bb-button[disabled]:hover,.bb-button[disabled]:active,.bb-button.loading,.bb-button.loading:focus,.bb-button.loading:hover,.bb-button.loading:active{opacity:.4;cursor:default;box-shadow:none}.bb-button-spinner{width:0;opacity:0;overflow:hidden;visibility:hidden;padding:0!important;transition:width .2s cubic-bezier(0,0,.2,1),opacity .1s cubic-bezier(0,0,.2,1)}.bb-button-spinner.visible{opacity:1;width:20px;margin-right:8px;visibility:visible}.bb-button.loading.full>.bb-button-spinner{left:8px;margin-right:0;position:absolute}\n"] }]
162
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
163
+ class BbAnchor extends BbButton {
164
+ constructor(_elementRef) {
165
+ super(_elementRef);
166
+ }
167
+ stopDisabledEvents(event) {
168
+ // If the button is not disabled (and not loading) let all events pass.
169
+ if (!this.disabled && !this.loading) {
170
+ return;
171
+ }
172
+ // If the button is disabled and/or loading stop
173
+ // the event from bubbling up.
174
+ event.preventDefault();
175
+ event.stopImmediatePropagation();
176
+ }
177
+ }
178
+ BbAnchor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbAnchor, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
179
+ BbAnchor.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.0", type: BbAnchor, selector: "a[bb-button]", inputs: { disabled: "disabled", loading: "loading", tabIndex: "tabIndex" }, host: { listeners: { "click": "stopDisabledEvents($event)" }, properties: { "attr.tabindex": "(disabled || loading) ? -1 : (tabIndex || 0)", "attr.disabled": "disabled || loading || null", "attr.aria-disabled": "(disabled || loading).toString()" }, classAttribute: "bb-button" }, exportAs: ["bbButton", "bbAnchor"], usesInheritance: true, ngImport: i0, template: "<bb-spinner [class.visible]=\"loading\"\n class=\"bb-button-spinner small\">\n</bb-spinner>\n\n<ng-content></ng-content>\n", styles: [".bb-button{height:38px;padding:0 8px;cursor:pointer;font-size:16px;font-weight:500;-webkit-user-select:none;user-select:none;position:relative;font-style:normal;border-radius:4px;text-align:center;align-items:center;display:inline-flex;text-decoration:none;justify-content:center;background-color:#fff;color:#2d3c4d!important;border:1px solid #d4d8e1;transition-duration:.2s;box-shadow:0 6px 6px -6px #0000001a;transition-timing-function:cubic-bezier(0,0,.2,1);transition-property:padding-left,background-color,box-shadow}.bb-button:hover{background-color:#fcfcfb}.bb-button:focus,.bb-button:active{box-shadow:0 6px 6px -6px #0000001a,0 0 0 3px #dce0e980}.bb-button.full{width:100%}.bb-button.full.loading{padding-left:42px}.bb-button.primary{border-color:#2f2b85;color:#fff!important;background-color:#5b53ff}.bb-button.primary:hover{background-color:#564ee6}.bb-button.primary:focus,.bb-button.primary:active{box-shadow:0 6px 6px -6px #0000001a,0 0 0 3px #5b53ff80}.bb-button.destructive{border-color:#8f2020;color:#fff!important;background-color:#d32f2f}.bb-button.destructive:hover{background-color:#c32929}.bb-button.destructive:focus,.bb-button.destructive:active{box-shadow:0 6px 6px -6px #0000001a,0 0 0 3px #d32f2f80}.bb-button:disabled,.bb-button:disabled:focus,.bb-button:disabled:hover,.bb-button:disabled:active,.bb-button[disabled],.bb-button[disabled]:focus,.bb-button[disabled]:hover,.bb-button[disabled]:active,.bb-button.loading,.bb-button.loading:focus,.bb-button.loading:hover,.bb-button.loading:active{opacity:.4;cursor:default;box-shadow:none}.bb-button-spinner{width:0;opacity:0;overflow:hidden;visibility:hidden;padding:0!important;transition:width .2s cubic-bezier(0,0,.2,1),opacity .1s cubic-bezier(0,0,.2,1)}.bb-button-spinner.visible{opacity:1;width:20px;margin-right:8px;visibility:visible}.bb-button.loading.full>.bb-button-spinner{left:8px;margin-right:0;position:absolute}\n"], components: [{ type: BbSpinner, selector: "bb-spinner", inputs: ["color", "alt", "disabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
180
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbAnchor, decorators: [{
181
+ type: Component,
182
+ args: [{ selector: 'a[bb-button]', exportAs: 'bbButton, bbAnchor', host: {
183
+ 'class': 'bb-button',
184
+ '[attr.tabindex]': '(disabled || loading) ? -1 : (tabIndex || 0)',
185
+ '[attr.disabled]': 'disabled || loading || null',
186
+ '[attr.aria-disabled]': '(disabled || loading).toString()',
187
+ '(click)': 'stopDisabledEvents($event)'
188
+ }, inputs: ['disabled', 'loading'], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<bb-spinner [class.visible]=\"loading\"\n class=\"bb-button-spinner small\">\n</bb-spinner>\n\n<ng-content></ng-content>\n", styles: [".bb-button{height:38px;padding:0 8px;cursor:pointer;font-size:16px;font-weight:500;-webkit-user-select:none;user-select:none;position:relative;font-style:normal;border-radius:4px;text-align:center;align-items:center;display:inline-flex;text-decoration:none;justify-content:center;background-color:#fff;color:#2d3c4d!important;border:1px solid #d4d8e1;transition-duration:.2s;box-shadow:0 6px 6px -6px #0000001a;transition-timing-function:cubic-bezier(0,0,.2,1);transition-property:padding-left,background-color,box-shadow}.bb-button:hover{background-color:#fcfcfb}.bb-button:focus,.bb-button:active{box-shadow:0 6px 6px -6px #0000001a,0 0 0 3px #dce0e980}.bb-button.full{width:100%}.bb-button.full.loading{padding-left:42px}.bb-button.primary{border-color:#2f2b85;color:#fff!important;background-color:#5b53ff}.bb-button.primary:hover{background-color:#564ee6}.bb-button.primary:focus,.bb-button.primary:active{box-shadow:0 6px 6px -6px #0000001a,0 0 0 3px #5b53ff80}.bb-button.destructive{border-color:#8f2020;color:#fff!important;background-color:#d32f2f}.bb-button.destructive:hover{background-color:#c32929}.bb-button.destructive:focus,.bb-button.destructive:active{box-shadow:0 6px 6px -6px #0000001a,0 0 0 3px #d32f2f80}.bb-button:disabled,.bb-button:disabled:focus,.bb-button:disabled:hover,.bb-button:disabled:active,.bb-button[disabled],.bb-button[disabled]:focus,.bb-button[disabled]:hover,.bb-button[disabled]:active,.bb-button.loading,.bb-button.loading:focus,.bb-button.loading:hover,.bb-button.loading:active{opacity:.4;cursor:default;box-shadow:none}.bb-button-spinner{width:0;opacity:0;overflow:hidden;visibility:hidden;padding:0!important;transition:width .2s cubic-bezier(0,0,.2,1),opacity .1s cubic-bezier(0,0,.2,1)}.bb-button-spinner.visible{opacity:1;width:20px;margin-right:8px;visibility:visible}.bb-button.loading.full>.bb-button-spinner{left:8px;margin-right:0;position:absolute}\n"] }]
189
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { tabIndex: [{
190
+ type: Input
191
+ }] } });
192
+
193
+ class BbImagePickerBase {
194
+ }
195
+ const BbImagePickerMixinBase = mixinDisabled(mixinGrouped(BbImagePickerBase));
196
+ class BbImagePicker extends BbImagePickerMixinBase {
197
+ constructor(_converter) {
198
+ super();
199
+ this._converter = _converter;
200
+ // Inputs.
201
+ this.label = null;
202
+ this.placeholder = null;
203
+ this.styleDimensions = null;
204
+ this.cropDimensions = null;
205
+ // Form.
206
+ this._value$ = new BehaviorSubject(null);
207
+ this.valueChange = new EventEmitter();
208
+ this.onTouchedCallback = () => {
209
+ };
210
+ this.onChangeCallback = () => {
211
+ };
212
+ }
213
+ get value() {
214
+ return this._value$.getValue();
215
+ }
216
+ set value(value) {
217
+ this._value$.next(value);
218
+ this.valueChange.emit(value);
219
+ }
220
+ get image() {
221
+ return this._value$.pipe(map(value => value || this.placeholder), map(value => value ? `url(${value})` : null));
222
+ }
223
+ async onFileChange(event) {
224
+ // Grab the file from the event.
225
+ const file = event.target.files[0];
226
+ // Check if the file exists.
227
+ if (!file || this.disabled) {
228
+ return;
229
+ }
230
+ try {
231
+ this.value = await this._converter.toDataUri(file, this.cropDimensions);
232
+ }
233
+ catch (error) {
234
+ this.value = null;
235
+ }
236
+ this.onChangeCallback(this.value);
237
+ if (this.fileInput && this.fileInput.nativeElement) {
238
+ this.fileInput.nativeElement.value = '';
239
+ }
240
+ }
241
+ openFilePicker() {
242
+ if (this.disabled) {
243
+ return;
244
+ }
245
+ // Execute a click on the file input.
246
+ this.fileInput
247
+ && this.fileInput.nativeElement
248
+ && this.fileInput.nativeElement.click
249
+ && this.fileInput.nativeElement.click();
250
+ }
251
+ writeValue(value) {
252
+ this.value = value;
253
+ }
254
+ registerOnChange(method) {
255
+ this.onChangeCallback = method;
256
+ }
257
+ registerOnTouched(method) {
258
+ this.onTouchedCallback = method;
259
+ }
260
+ setDisabledState(isDisabled) {
261
+ this.disabled = isDisabled;
262
+ }
263
+ }
264
+ BbImagePicker.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbImagePicker, deps: [{ token: i1$1.ImageConverter }], target: i0.ɵɵFactoryTarget.Component });
265
+ BbImagePicker.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.0", type: BbImagePicker, selector: "bb-image-picker", inputs: { grouped: "grouped", disabled: "disabled", label: "label", placeholder: "placeholder", styleDimensions: "styleDimensions", cropDimensions: "cropDimensions", value: "value" }, outputs: { valueChange: "valueChange" }, host: { properties: { "class.disabled": "disabled", "class.grouped": "grouped" }, classAttribute: "bb-image-picker" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BbImagePicker), multi: true }], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<!-- The input that can open the file picker. -->\n<input #fileInput\n (change)=\"onFileChange($event)\"\n class=\"bb-image-picker-input\"\n type=\"file\"\n tabindex=\"-1\"\n accept=\"image/*\">\n\n<span [style.width]=\"styleDimensions?.width || '100%'\"\n [style.height]=\"styleDimensions?.height || '215px'\"\n [style.background-image]=\"image | async\"\n class=\"bb-image-input-image\">\n </span>\n\n<button *ngIf=\"label as labelText\"\n (click)=\"openFilePicker()\"\n bb-button\n class=\"bb-image-input-button\"\n type=\"button\">\n {{ labelText }}\n</button>\n", styles: [".bb-image-picker{display:flex;align-items:center;flex-direction:column}.bb-image-picker.circle>.bb-image-input-image{border-radius:50%}.bb-image-picker.grouped{margin-bottom:20px}.bb-image-picker.disabled{opacity:.5;cursor:default;-webkit-user-select:none;user-select:none;pointer-events:none}.bb-image-picker-input{opacity:0;z-index:-1;width:.1px;height:.1px;overflow:hidden;position:absolute}.bb-image-input-image{display:flex;cursor:default;position:relative;border-radius:4px;align-items:center;justify-content:center;background:rgba(0,0,0,.2) url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7) center center/cover no-repeat}.bb-image-input-button{margin-top:10px}\n"], components: [{ type: BbButton, selector: "button[bb-button]", inputs: ["disabled", "loading"], exportAs: ["bbButton"] }], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
266
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbImagePicker, decorators: [{
267
+ type: Component,
268
+ args: [{ selector: 'bb-image-picker', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
269
+ 'class': 'bb-image-picker',
270
+ '[class.disabled]': 'disabled',
271
+ '[class.grouped]': 'grouped'
272
+ }, inputs: ['grouped', 'disabled'], providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BbImagePicker), multi: true }], preserveWhitespaces: false, template: "<!-- The input that can open the file picker. -->\n<input #fileInput\n (change)=\"onFileChange($event)\"\n class=\"bb-image-picker-input\"\n type=\"file\"\n tabindex=\"-1\"\n accept=\"image/*\">\n\n<span [style.width]=\"styleDimensions?.width || '100%'\"\n [style.height]=\"styleDimensions?.height || '215px'\"\n [style.background-image]=\"image | async\"\n class=\"bb-image-input-image\">\n </span>\n\n<button *ngIf=\"label as labelText\"\n (click)=\"openFilePicker()\"\n bb-button\n class=\"bb-image-input-button\"\n type=\"button\">\n {{ labelText }}\n</button>\n", styles: [".bb-image-picker{display:flex;align-items:center;flex-direction:column}.bb-image-picker.circle>.bb-image-input-image{border-radius:50%}.bb-image-picker.grouped{margin-bottom:20px}.bb-image-picker.disabled{opacity:.5;cursor:default;-webkit-user-select:none;user-select:none;pointer-events:none}.bb-image-picker-input{opacity:0;z-index:-1;width:.1px;height:.1px;overflow:hidden;position:absolute}.bb-image-input-image{display:flex;cursor:default;position:relative;border-radius:4px;align-items:center;justify-content:center;background:rgba(0,0,0,.2) url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7) center center/cover no-repeat}.bb-image-input-button{margin-top:10px}\n"] }]
273
+ }], ctorParameters: function () { return [{ type: i1$1.ImageConverter }]; }, propDecorators: { fileInput: [{
274
+ type: ViewChild,
275
+ args: ['fileInput', { static: true }]
276
+ }], label: [{
277
+ type: Input
278
+ }], placeholder: [{
279
+ type: Input
280
+ }], styleDimensions: [{
281
+ type: Input
282
+ }], cropDimensions: [{
283
+ type: Input
284
+ }], value: [{
285
+ type: Input
286
+ }], valueChange: [{
287
+ type: Output
288
+ }] } });
289
+
290
+ class BbFormSubmit {
291
+ constructor(_host, _formDirective) {
292
+ this._host = _host;
293
+ this._formDirective = _formDirective;
294
+ }
295
+ ngOnInit() {
296
+ // Submit changes.
297
+ const regularSubmitChanges$ = fromEvent(this.nativeElement, 'submit').pipe(mapTo(true));
298
+ // Reactive form submit changes.
299
+ const reactiveSubmitChanges$ = this.reactiveSubmitChanges();
300
+ // Reset changes.
301
+ const resetChanges$ = fromEvent(this.nativeElement, 'reset').pipe(mapTo(false));
302
+ // Listen to the submit status.
303
+ this.submitStatus$ = merge(regularSubmitChanges$, reactiveSubmitChanges$, resetChanges$).pipe(startWith(false), distinctUntilChanged(), shareReplay(1));
304
+ }
305
+ submit() {
306
+ this._formDirective?.ngSubmit?.emit();
307
+ }
308
+ reset() {
309
+ return this.nativeElement?.reset();
310
+ }
311
+ get nativeElement() {
312
+ return this._host?.nativeElement;
313
+ }
314
+ reactiveSubmitChanges() {
315
+ if (!this._formDirective) {
316
+ return EMPTY;
317
+ }
318
+ return this._formDirective.ngSubmit.pipe(mapTo(true));
319
+ }
320
+ }
321
+ BbFormSubmit.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbFormSubmit, deps: [{ token: i0.ElementRef }, { token: i5.FormGroupDirective, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive });
322
+ BbFormSubmit.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.0", type: BbFormSubmit, selector: "form", exportAs: ["bbForm"], ngImport: i0 });
323
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbFormSubmit, decorators: [{
324
+ type: Directive,
325
+ args: [{
326
+ selector: 'form',
327
+ exportAs: 'bbForm'
328
+ }]
329
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i5.FormGroupDirective, decorators: [{
330
+ type: Optional
331
+ }, {
332
+ type: Self
333
+ }] }]; } });
334
+
335
+ class BbFormError {
336
+ constructor(_form, _control, _errors) {
337
+ this._form = _form;
338
+ this._control = _control;
339
+ this._errors = _errors;
340
+ // Outputs.
341
+ this.errorChange = new EventEmitter();
342
+ // Subscriptions.
343
+ this._ngControl = null;
344
+ }
345
+ // Inputs.
346
+ set control(value) {
347
+ this._ngControl = value;
348
+ }
349
+ get control() {
350
+ return this._ngControl;
351
+ }
352
+ ngOnInit() {
353
+ // Set the control if it was not set before.
354
+ if (!this.control) {
355
+ this.control = this._control;
356
+ }
357
+ // Listen for the submit changes
358
+ const submitStatus$ = this.submitStatusChanges();
359
+ // An observable that emits error changes.
360
+ const errorChanges$ = this.statusChanges().pipe(map(() => this.getError(this.control.errors)), distinctUntilChanged(), map(error => typeof error === 'string' ? { token: error } : error));
361
+ // Whenever the user submitted the form we want to
362
+ // listen for any error changes.
363
+ this.error$ = combineLatest([submitStatus$, errorChanges$]).pipe(map(([submitted, error]) => {
364
+ // If not submitted return null.
365
+ if (!submitted) {
366
+ return null;
367
+ }
368
+ // Return the error if submitted.
369
+ return error;
370
+ }), tap(value => this.errorChange.emit(value)));
371
+ }
372
+ getError(errors) {
373
+ // Validate the errors exist.
374
+ if (!errors) {
375
+ return null;
376
+ }
377
+ // Get the first error in the errors.
378
+ const [errorName] = Object.keys(errors);
379
+ const error = errors[errorName];
380
+ // Validate the error exists.
381
+ if (!error) {
382
+ return null;
383
+ }
384
+ // Map the arrays into a object so we can
385
+ // access the functions by a key-lookup.
386
+ const errorFunctions = this._errors.reduce((previous, current) => ({ ...previous, ...current }), {});
387
+ // Get the error function.
388
+ const errorFunction = errorFunctions[errorName] || errorFunctions['unknown'];
389
+ // Validate the error function exists.
390
+ if (!errorFunction) {
391
+ return null;
392
+ }
393
+ // Return the parsed error.
394
+ return errorFunction(error);
395
+ }
396
+ submitStatusChanges() {
397
+ if (!this._form) {
398
+ return of(true);
399
+ }
400
+ return this._form.submitStatus$;
401
+ }
402
+ statusChanges() {
403
+ if (!this.control) {
404
+ return EMPTY;
405
+ }
406
+ if (!this.control.statusChanges) {
407
+ return EMPTY;
408
+ }
409
+ return this.control.statusChanges.pipe(startWith(this.control.status), delay(0));
410
+ }
411
+ }
412
+ BbFormError.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbFormError, deps: [{ token: BbFormSubmit, optional: true }, { token: i5.NgControl, optional: true }, { token: ELEMENTS_ERRORS, optional: true }], target: i0.ɵɵFactoryTarget.Component });
413
+ BbFormError.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.0", type: BbFormError, selector: "bb-form-error", inputs: { control: "control" }, outputs: { errorChange: "errorChange" }, host: { classAttribute: "bb-form-error" }, ngImport: i0, template: "<ng-container *ngIf=\"error$ | async as error\">\n <p *ngIf=\"error?.token | bbLocalize:{optional: true, data: error?.data} as message\"\n class=\"bb-form-error-message\">\n {{ message }}\n </p>\n</ng-container>", styles: [".bb-form-error{display:block}.bb-form-error-message{color:#c23934;display:block;font-size:13px;margin-top:4px}\n"], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i1.AsyncPipe, "bbLocalize": i4.BbLocalize }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
414
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbFormError, decorators: [{
415
+ type: Component,
416
+ args: [{ selector: 'bb-form-error', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
417
+ 'class': 'bb-form-error'
418
+ }, preserveWhitespaces: false, template: "<ng-container *ngIf=\"error$ | async as error\">\n <p *ngIf=\"error?.token | bbLocalize:{optional: true, data: error?.data} as message\"\n class=\"bb-form-error-message\">\n {{ message }}\n </p>\n</ng-container>", styles: [".bb-form-error{display:block}.bb-form-error-message{color:#c23934;display:block;font-size:13px;margin-top:4px}\n"] }]
419
+ }], ctorParameters: function () { return [{ type: BbFormSubmit, decorators: [{
420
+ type: Optional
421
+ }] }, { type: i5.NgControl, decorators: [{
422
+ type: Optional
423
+ }] }, { type: undefined, decorators: [{
424
+ type: Optional
425
+ }, {
426
+ type: Inject,
427
+ args: [ELEMENTS_ERRORS]
428
+ }] }]; }, propDecorators: { control: [{
429
+ type: Input
430
+ }], errorChange: [{
431
+ type: Output
432
+ }] } });
433
+
434
+ class BbTemplate {
435
+ constructor(_templateRef, _viewContainerRef) {
436
+ this._templateRef = _templateRef;
437
+ this._viewContainerRef = _viewContainerRef;
438
+ }
439
+ set bbTemplate(content) {
440
+ // Get the template.
441
+ const template = content instanceof TemplateRef
442
+ ? content
443
+ : this._templateRef;
444
+ // Clear the view container ref and create the view.
445
+ this._viewContainerRef.clear();
446
+ this._viewContainerRef.createEmbeddedView(template);
447
+ }
448
+ }
449
+ BbTemplate.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbTemplate, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
450
+ BbTemplate.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.0", type: BbTemplate, selector: "[bbTemplate]", inputs: { bbTemplate: "bbTemplate" }, ngImport: i0 });
451
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbTemplate, decorators: [{
452
+ type: Directive,
453
+ args: [{
454
+ selector: '[bbTemplate]'
455
+ }]
456
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; }, propDecorators: { bbTemplate: [{
457
+ type: Input
458
+ }] } });
459
+
460
+ let nextUniqueId$2 = 0;
461
+ class BbFormControlBase {
462
+ }
463
+ const BbFormControlMixinBase = mixinDisabled(mixinFocused(mixinReadonly(mixinGrouped(mixinRequired(mixinError(mixinHideErrors(BbFormControlBase)))))));
464
+ class BbFormControl extends BbFormControlMixinBase {
465
+ constructor() {
466
+ super(...arguments);
467
+ // Inputs.
468
+ this.label = null;
469
+ this.hint = null;
470
+ // Data.
471
+ this.arrow = false;
472
+ // Data.
473
+ this.labelId = `bb-form-control-${nextUniqueId$2++}`;
474
+ }
475
+ onErrorChange(error) {
476
+ this.error = !!error;
477
+ }
478
+ }
479
+ BbFormControl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbFormControl, deps: null, target: i0.ɵɵFactoryTarget.Component });
480
+ BbFormControl.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.0", type: BbFormControl, selector: "bb-form-control", inputs: { grouped: "grouped", hideErrors: "hideErrors", label: "label", hint: "hint" }, host: { properties: { "class.readonly": "readonly", "class.required": "required", "class.disabled": "disabled", "class.focused": "focused", "class.grouped": "grouped", "class.arrow": "arrow", "class.error": "error" }, classAttribute: "bb-form-control" }, queries: [{ propertyName: "ngControl", first: true, predicate: NgControl, descendants: true }], usesInheritance: true, ngImport: i0, template: "<!-- Label of the form control. -->\n<label *ngIf=\"label as labelContent\"\n [attr.for]=\"labelId\"\n class=\"bb-form-control-label\">\n <ng-template [bbTemplate]=\"labelContent\">\n {{ labelContent }}\n </ng-template>\n</label>\n\n<!-- The input with the addons. -->\n<div class=\"bb-form-control-container\">\n <ng-content select=\"[bbPrefix]\"></ng-content>\n <ng-content select=\"[bbInput]\"></ng-content>\n <ng-content select=\"[bbSuffix]\"></ng-content>\n</div>\n\n<!-- The error component. -->\n<bb-form-error *ngIf=\"!hideErrors\"\n [control]=\"ngControl\"\n (errorChange)=\"onErrorChange($event)\">\n</bb-form-error>\n\n<!-- The form control hint. -->\n<p *ngIf=\"hint as hintContent\"\n class=\"bb-form-control-hint\">\n <ng-template [bbTemplate]=\"hintContent\">\n {{ hintContent }}\n </ng-template>\n</p>\n", styles: [".bb-form-control{color:#2d3c4d;display:block}.bb-form-control>.bb-form-control-container>*.bb-prefix,.bb-form-control>.bb-form-control-container>*.bb-suffix{margin:0 8px;color:#b4b4b4;transition:color .3s cubic-bezier(0,0,.2,1)}.bb-form-control.grouped{margin-bottom:20px}.bb-form-control.small{max-width:240px}.bb-form-control.medium{max-width:480px}.bb-form-control.large{max-width:720px}.bb-form-control.required>.bb-form-control-label:after{content:\"*\";color:#c23934;font-size:12px;line-height:1.5}.bb-form-control.disabled>.bb-form-control-container{cursor:default;pointer-events:none;background-color:#cccccca3}.bb-form-control.disabled>.bb-form-control-container>input,.bb-form-control.disabled>.bb-form-control-container>textarea,.bb-form-control.disabled>.bb-form-control-container>select{color:#aaa}.bb-form-control.readonly>.bb-form-control-container{cursor:default;border:1px dotted #bdc4c9}.bb-form-control:not(.disabled):not(.readonly).focused>.bb-form-control-container{background-color:#fff;box-shadow:inset 0 3px #b7bcc233,0 6px 6px -6px #0000001a,0 0 0 3px #007bff33}.bb-form-control:not(.disabled):not(.readonly).focused>.bb-form-control-container>input::placeholder,.bb-form-control:not(.disabled):not(.readonly).focused>.bb-form-control-container>textarea::placeholder{color:#b4b4b4;transition:color .3s cubic-bezier(0,0,.2,1)}.bb-form-control.error>.bb-form-control-label{color:#c23934}.bb-form-control.error>.bb-form-control-hint{display:none}.bb-form-control.error>.bb-form-control-container{border:1px solid #962b26;background-color:#c2393440!important;box-shadow:inset 0 3px #b7bcc233,0 6px 6px -6px #0000001a,0 0 0 3px #c2393466!important}.bb-form-control.error>.bb-form-control-container>*.bb-prefix,.bb-form-control.error>.bb-form-control-container>.bb-suffix{color:#c23934}.bb-form-control.error>.bb-form-control-container>input::placeholder,.bb-form-control.error>.bb-form-control-container>textarea::placeholder{color:#c2393466!important}.bb-form-control.arrow>.bb-form-control-container:after{top:0;right:0;bottom:0;width:20px;content:\"\";height:36px;display:flex;min-width:20px;position:absolute;pointer-events:none;background-repeat:no-repeat;background-position:calc(100% - 8px) center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAGCAYAAAAYLBS/AAAACXBIWXMAAAsSAAALEgHS3X78AAAAWUlEQVQYlY3QsQ2DMAAEwMMTsAkrZInvWY3WXiIjJJtkA1OBRCIRf/nSffFTrXXGE4uxbCXJBw+8R0CStcAg3JKsUI7mDzzBBd3AC4Cp9/4z21o7znl9A9gBAf4fpjLTwkUAAAAASUVORK5CYII=)}.bb-form-control-container{width:100%;display:flex;overflow:hidden;position:relative;border-radius:3px;align-items:center;border:1px solid #b6bbc1;background-color:#fff8ff;transition-duration:.25s;transition-property:background-color,box-shadow;transition-timing-function:cubic-bezier(0,0,.2,1);box-shadow:inset 0 3px #b7bcc233,0 6px 6px -6px #0000001a}.bb-form-control-container>input::placeholder,.bb-form-control-container>textarea::placeholder{color:#d2d2d2;transition:color .3s cubic-bezier(0,0,.2,1)}.bb-form-control-container>input,.bb-form-control-container>textarea,.bb-form-control-container>select{margin:0;width:100%;border:none;color:#3d464d;font-size:16px;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent}.bb-form-control-container>input,.bb-form-control-container>select{height:36px;padding:0 8px}.bb-form-control-container>select{padding-right:28px}.bb-form-control-container>select>::-ms-expand{display:none}.bb-form-control-container>input::-ms-clear,.bb-form-control-container>input::-ms-reveal{width:0;height:0;display:none}.bb-form-control-container>input::-webkit-search-decoration,.bb-form-control-container>input::-webkit-search-cancel-button,.bb-form-control-container>input::-webkit-search-results-button,.bb-form-control-container>input::-webkit-search-results-decoration{display:none}.bb-form-control-container>textarea{resize:none;padding:8px}.bb-form-control-label{color:#000;display:block;position:relative;margin-bottom:4px;transition:color 30ms cubic-bezier(0,0,.2,1)}.bb-form-control-error,.bb-form-control-hint{display:block;font-size:13px;margin-top:4px}.bb-form-control-error{color:#c23934}.bb-form-control-hint{color:#738694}\n"], components: [{ type: BbFormError, selector: "bb-form-error", inputs: ["control"], outputs: ["errorChange"] }], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: BbTemplate, selector: "[bbTemplate]", inputs: ["bbTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
481
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbFormControl, decorators: [{
482
+ type: Component,
483
+ args: [{ selector: 'bb-form-control', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
484
+ 'class': 'bb-form-control',
485
+ '[class.readonly]': 'readonly',
486
+ '[class.required]': 'required',
487
+ '[class.disabled]': 'disabled',
488
+ '[class.focused]': 'focused',
489
+ '[class.grouped]': 'grouped',
490
+ '[class.arrow]': 'arrow',
491
+ '[class.error]': 'error'
492
+ }, inputs: ['grouped', 'hideErrors'], preserveWhitespaces: false, template: "<!-- Label of the form control. -->\n<label *ngIf=\"label as labelContent\"\n [attr.for]=\"labelId\"\n class=\"bb-form-control-label\">\n <ng-template [bbTemplate]=\"labelContent\">\n {{ labelContent }}\n </ng-template>\n</label>\n\n<!-- The input with the addons. -->\n<div class=\"bb-form-control-container\">\n <ng-content select=\"[bbPrefix]\"></ng-content>\n <ng-content select=\"[bbInput]\"></ng-content>\n <ng-content select=\"[bbSuffix]\"></ng-content>\n</div>\n\n<!-- The error component. -->\n<bb-form-error *ngIf=\"!hideErrors\"\n [control]=\"ngControl\"\n (errorChange)=\"onErrorChange($event)\">\n</bb-form-error>\n\n<!-- The form control hint. -->\n<p *ngIf=\"hint as hintContent\"\n class=\"bb-form-control-hint\">\n <ng-template [bbTemplate]=\"hintContent\">\n {{ hintContent }}\n </ng-template>\n</p>\n", styles: [".bb-form-control{color:#2d3c4d;display:block}.bb-form-control>.bb-form-control-container>*.bb-prefix,.bb-form-control>.bb-form-control-container>*.bb-suffix{margin:0 8px;color:#b4b4b4;transition:color .3s cubic-bezier(0,0,.2,1)}.bb-form-control.grouped{margin-bottom:20px}.bb-form-control.small{max-width:240px}.bb-form-control.medium{max-width:480px}.bb-form-control.large{max-width:720px}.bb-form-control.required>.bb-form-control-label:after{content:\"*\";color:#c23934;font-size:12px;line-height:1.5}.bb-form-control.disabled>.bb-form-control-container{cursor:default;pointer-events:none;background-color:#cccccca3}.bb-form-control.disabled>.bb-form-control-container>input,.bb-form-control.disabled>.bb-form-control-container>textarea,.bb-form-control.disabled>.bb-form-control-container>select{color:#aaa}.bb-form-control.readonly>.bb-form-control-container{cursor:default;border:1px dotted #bdc4c9}.bb-form-control:not(.disabled):not(.readonly).focused>.bb-form-control-container{background-color:#fff;box-shadow:inset 0 3px #b7bcc233,0 6px 6px -6px #0000001a,0 0 0 3px #007bff33}.bb-form-control:not(.disabled):not(.readonly).focused>.bb-form-control-container>input::placeholder,.bb-form-control:not(.disabled):not(.readonly).focused>.bb-form-control-container>textarea::placeholder{color:#b4b4b4;transition:color .3s cubic-bezier(0,0,.2,1)}.bb-form-control.error>.bb-form-control-label{color:#c23934}.bb-form-control.error>.bb-form-control-hint{display:none}.bb-form-control.error>.bb-form-control-container{border:1px solid #962b26;background-color:#c2393440!important;box-shadow:inset 0 3px #b7bcc233,0 6px 6px -6px #0000001a,0 0 0 3px #c2393466!important}.bb-form-control.error>.bb-form-control-container>*.bb-prefix,.bb-form-control.error>.bb-form-control-container>.bb-suffix{color:#c23934}.bb-form-control.error>.bb-form-control-container>input::placeholder,.bb-form-control.error>.bb-form-control-container>textarea::placeholder{color:#c2393466!important}.bb-form-control.arrow>.bb-form-control-container:after{top:0;right:0;bottom:0;width:20px;content:\"\";height:36px;display:flex;min-width:20px;position:absolute;pointer-events:none;background-repeat:no-repeat;background-position:calc(100% - 8px) center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAGCAYAAAAYLBS/AAAACXBIWXMAAAsSAAALEgHS3X78AAAAWUlEQVQYlY3QsQ2DMAAEwMMTsAkrZInvWY3WXiIjJJtkA1OBRCIRf/nSffFTrXXGE4uxbCXJBw+8R0CStcAg3JKsUI7mDzzBBd3AC4Cp9/4z21o7znl9A9gBAf4fpjLTwkUAAAAASUVORK5CYII=)}.bb-form-control-container{width:100%;display:flex;overflow:hidden;position:relative;border-radius:3px;align-items:center;border:1px solid #b6bbc1;background-color:#fff8ff;transition-duration:.25s;transition-property:background-color,box-shadow;transition-timing-function:cubic-bezier(0,0,.2,1);box-shadow:inset 0 3px #b7bcc233,0 6px 6px -6px #0000001a}.bb-form-control-container>input::placeholder,.bb-form-control-container>textarea::placeholder{color:#d2d2d2;transition:color .3s cubic-bezier(0,0,.2,1)}.bb-form-control-container>input,.bb-form-control-container>textarea,.bb-form-control-container>select{margin:0;width:100%;border:none;color:#3d464d;font-size:16px;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent}.bb-form-control-container>input,.bb-form-control-container>select{height:36px;padding:0 8px}.bb-form-control-container>select{padding-right:28px}.bb-form-control-container>select>::-ms-expand{display:none}.bb-form-control-container>input::-ms-clear,.bb-form-control-container>input::-ms-reveal{width:0;height:0;display:none}.bb-form-control-container>input::-webkit-search-decoration,.bb-form-control-container>input::-webkit-search-cancel-button,.bb-form-control-container>input::-webkit-search-results-button,.bb-form-control-container>input::-webkit-search-results-decoration{display:none}.bb-form-control-container>textarea{resize:none;padding:8px}.bb-form-control-label{color:#000;display:block;position:relative;margin-bottom:4px;transition:color 30ms cubic-bezier(0,0,.2,1)}.bb-form-control-error,.bb-form-control-hint{display:block;font-size:13px;margin-top:4px}.bb-form-control-error{color:#c23934}.bb-form-control-hint{color:#738694}\n"] }]
493
+ }], propDecorators: { ngControl: [{
494
+ type: ContentChild,
495
+ args: [NgControl]
496
+ }], label: [{
497
+ type: Input
498
+ }], hint: [{
499
+ type: Input
500
+ }] } });
501
+
502
+ class BbFileImage {
503
+ constructor(_platform, _image, _sanitizer) {
504
+ this._platform = _platform;
505
+ this._image = _image;
506
+ this._sanitizer = _sanitizer;
507
+ }
508
+ async transform(file) {
509
+ // If the file is not a file return.
510
+ if (!this._platform.isBrowser || !(file instanceof File)) {
511
+ return null;
512
+ }
513
+ return this._image.fileToImage(file, [
514
+ 'image/png',
515
+ 'image/jpeg',
516
+ 'image/gif',
517
+ 'image/svg+xml'
518
+ ]).then(image => {
519
+ if (!image) {
520
+ return null;
521
+ }
522
+ return {
523
+ background: this._sanitizer.bypassSecurityTrustStyle(`url(${image.src})`),
524
+ aspectRatio: image.height / image.width
525
+ };
526
+ }).catch(() => {
527
+ return null;
528
+ });
529
+ }
530
+ }
531
+ BbFileImage.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbFileImage, deps: [{ token: i1$1.Platform }, { token: i1$1.ImageConverter }, { token: i2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
532
+ BbFileImage.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbFileImage, name: "bbFileImage" });
533
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbFileImage, decorators: [{
534
+ type: Pipe,
535
+ args: [{
536
+ name: 'bbFileImage'
537
+ }]
538
+ }], ctorParameters: function () { return [{ type: i1$1.Platform }, { type: i1$1.ImageConverter }, { type: i2.DomSanitizer }]; } });
539
+
540
+ class BbFileSize {
541
+ constructor() {
542
+ this.format = (value, decimals = 2) => {
543
+ if (value === 0) {
544
+ return '0 Bytes';
545
+ }
546
+ const k = 1024;
547
+ const dm = decimals < 0 ? 0 : decimals;
548
+ const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
549
+ const index = Math.floor(Math.log(value) / Math.log(k));
550
+ return parseFloat((value / Math.pow(k, index)).toFixed(dm)) + ' ' + sizes[index];
551
+ };
552
+ }
553
+ transform(value) {
554
+ return this.format(value);
555
+ }
556
+ }
557
+ BbFileSize.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbFileSize, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
558
+ BbFileSize.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbFileSize, name: "bbFileSize" });
559
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbFileSize, decorators: [{
560
+ type: Pipe,
561
+ args: [{
562
+ name: 'bbFileSize'
563
+ }]
564
+ }] });
565
+
566
+ let nextUniqueId$1 = 0;
567
+ class BbFilePickerBase {
568
+ }
569
+ const BbFilePickerMixinBase$1 = mixinRequired(mixinDisabled(mixinGrouped(mixinError(mixinHideErrors(BbFilePickerBase)))));
570
+ class BbFilePicker extends BbFilePickerMixinBase$1 {
571
+ constructor() {
572
+ super(...arguments);
573
+ // Inputs.
574
+ this.label = null;
575
+ this.hint = null;
576
+ this.accept = null;
577
+ this.showImages = true;
578
+ this.allowDragging = true;
579
+ // State.
580
+ this.labelId = `bb-file-picker-${nextUniqueId$1++}`;
581
+ this.hovered = false;
582
+ this.value$ = new BehaviorSubject({});
583
+ this.valueChange = new EventEmitter();
584
+ this.onTouchedCallback = () => {
585
+ };
586
+ this.onChangeCallback = () => {
587
+ };
588
+ this.saveFile = (files) => {
589
+ // Validate the files exist.
590
+ if (!files) {
591
+ return;
592
+ }
593
+ // Retrieve the first file.
594
+ const file = files[0];
595
+ // Validate the first file exists.
596
+ if (!file) {
597
+ return;
598
+ }
599
+ // Save the file.
600
+ this.value = file;
601
+ };
602
+ this.getFileListFromEvent = (event) => {
603
+ const element = event.target;
604
+ if (!element) {
605
+ return null;
606
+ }
607
+ return element.files;
608
+ };
609
+ this.preventDefault = (event) => {
610
+ event.preventDefault();
611
+ event.stopPropagation();
612
+ };
613
+ }
614
+ get value() {
615
+ const { file } = this.value$.getValue();
616
+ return file;
617
+ }
618
+ set value(value) {
619
+ this.value$.next({ file: value });
620
+ this.valueChange.emit(value);
621
+ }
622
+ onDrag(event, isHovered) {
623
+ // Validate the input can support drag.
624
+ if (!this.allowDragging || this.disabled) {
625
+ return;
626
+ }
627
+ // Prevent the default event action
628
+ // and start the hovering.
629
+ this.preventDefault(event);
630
+ this.hovered = isHovered;
631
+ }
632
+ onDrop(event) {
633
+ // Validate the input can support drag.
634
+ if (!this.allowDragging || this.disabled) {
635
+ return;
636
+ }
637
+ // Prevent the default event action
638
+ // and stop the hovering.
639
+ this.preventDefault(event);
640
+ this.hovered = false;
641
+ // Save the file.
642
+ this.saveFile(event['dataTransfer'].files);
643
+ // Run the on change callback.
644
+ this.onChangeCallback(this.value);
645
+ }
646
+ onButtonPressed(file) {
647
+ if (file) {
648
+ this.value = null;
649
+ this.onChangeCallback(this.value);
650
+ return;
651
+ }
652
+ return this.openFilePicker();
653
+ }
654
+ openFilePicker() {
655
+ return this.fileInput
656
+ && this.fileInput.nativeElement
657
+ && this.fileInput.nativeElement.click
658
+ && this.fileInput.nativeElement.click();
659
+ }
660
+ onFileChange(event) {
661
+ // Validate the input is not disabled.
662
+ if (this.disabled) {
663
+ return;
664
+ }
665
+ // Extract the file from the event.
666
+ const fileList = this.getFileListFromEvent(event);
667
+ // Save the file.
668
+ this.saveFile(fileList);
669
+ // Run the on change callback.
670
+ this.onChangeCallback(this.value);
671
+ // Clear the file input.
672
+ if (this.fileInput && this.fileInput.nativeElement) {
673
+ this.fileInput.nativeElement.value = '';
674
+ }
675
+ }
676
+ writeValue(value) {
677
+ this.value = value;
678
+ }
679
+ registerOnChange(method) {
680
+ this.onChangeCallback = method;
681
+ }
682
+ registerOnTouched(method) {
683
+ this.onTouchedCallback = method;
684
+ }
685
+ setDisabledState(isDisabled) {
686
+ this.disabled = isDisabled;
687
+ }
688
+ onErrorChange(error) {
689
+ this.error = !!error;
690
+ }
691
+ validate({ value }) {
692
+ if (value === null || value === undefined) {
693
+ return null;
694
+ }
695
+ const regexString = (this.accept || '*')
696
+ .replace(/\*/g, '.\*')
697
+ .replace(/,/g, '|');
698
+ const mimeTypeRegex = new RegExp(regexString);
699
+ const isNotValid = (typeof File === 'undefined') || !(value instanceof File) || !mimeTypeRegex.test(value?.type);
700
+ return isNotValid && {
701
+ invalidFileType: true
702
+ };
703
+ }
704
+ }
705
+ BbFilePicker.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbFilePicker, deps: null, target: i0.ɵɵFactoryTarget.Component });
706
+ BbFilePicker.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.0", type: BbFilePicker, selector: "bb-file-picker", inputs: { disabled: "disabled", hideErrors: "hideErrors", grouped: "grouped", required: "required", label: "label", hint: "hint", accept: "accept", showImages: "showImages", allowDragging: "allowDragging", value: "value" }, outputs: { valueChange: "valueChange" }, host: { listeners: { "dragover": "onDrag($event,true)", "dragleave": "onDrag($event,false)", "drop": "onDrop($event)" }, properties: { "class.required": "required", "class.disabled": "disabled", "class.grouped": "grouped", "class.hovered": "hovered", "class.error": "error" }, classAttribute: "bb-file-picker" }, providers: [
707
+ {
708
+ provide: NG_VALUE_ACCESSOR,
709
+ useExisting: forwardRef(() => BbFilePicker),
710
+ multi: true
711
+ },
712
+ {
713
+ provide: NG_VALIDATORS,
714
+ useExisting: BbFilePicker,
715
+ multi: true
716
+ }
717
+ ], queries: [{ propertyName: "extraTemplate", first: true, predicate: ["extra"], descendants: true }], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<!-- The label of the input. -->\n<label *ngIf=\"label as labelContent\"\n [for]=\"labelId\"\n class=\"bb-file-picker-label\">\n <ng-template [bbTemplate]=\"labelContent\">\n {{ labelContent }}\n </ng-template>\n</label>\n\n<!-- The input that can open the file picker. -->\n<input #fileInput\n [accept]=\"accept\"\n [disabled]=\"disabled\"\n (change)=\"onFileChange($event)\"\n class=\"bb-file-picker-input\"\n type=\"file\"\n tabindex=\"-1\">\n\n<div *ngIf=\"value$ | async as data\"\n class=\"bb-file-picker-wrapper\">\n <!-- The button that accepts files. -->\n <div class=\"bb-file-picker-container\">\n <button [class.destructive]=\"!!data?.file\"\n [class.standalone]=\"!allowDragging\"\n [disabled]=\"disabled\"\n [id]=\"labelId\"\n (click)=\"onButtonPressed(data?.file)\"\n type=\"button\"\n class=\"bb-file-picker-button\">\n <ng-container *ngTemplateOutlet=\"data?.file ? closeIcon : uploadIcon\"></ng-container>\n {{ (data?.file ? 'file-picker.remove' : 'file-picker.choose') | bbLocalize }}\n </button>\n <div *ngIf=\"allowDragging\"\n class=\"bb-file-picker-zone\">\n {{ 'file-picker.drop' | bbLocalize }}\n </div>\n </div>\n\n <ng-container *ngIf=\"!!extraTemplate\">\n <ng-container *ngTemplateOutlet=\"extraTemplate; context: {$implicit: data?.file}\"></ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"showImages\">\n <div *ngIf=\"data?.file | bbFileImage | async as image\"\n class=\"bb-file-picker-image-container\">\n <div class=\"bb-file-picker-image-wrapper\">\n <div [@bbFilePickerImageAnimation]=\"true\"\n [style.padding-top.%]=\"image?.aspectRatio * 100\"\n [style.background-image]=\"image?.background\"\n class=\"bb-file-picker-image\">\n </div>\n </div>\n </div>\n </ng-container>\n\n <!-- Extra information of the file. -->\n <div [class.visible]=\"!!data?.file\"\n class=\"bb-file-picker-info\">\n <span *ngIf=\"data?.file?.name as name\">{{ name }}</span>\n <span *ngIf=\"data?.file?.size as size\">{{ size | bbFileSize }}</span>\n </div>\n</div>\n\n<bb-form-error *ngIf=\"!hideErrors\"\n (errorChange)=\"onErrorChange($event)\">\n</bb-form-error>\n\n<!-- The file picker hint. -->\n<p *ngIf=\"hint as hintContent\"\n class=\"bb-file-picker-hint\">\n <ng-template [bbTemplate]=\"hintContent\">\n {{ hintContent }}\n </ng-template>\n</p>\n\n<!-- Upload icon. -->\n<ng-template #uploadIcon>\n <svg xmlns=\"http://www.w3.org/2000/svg\"\n class=\"bb-file-picker-icon\"\n width=\"24\"\n height=\"24\">\n <path fill=\"currentColor\"\n d=\"M2 12.5C2 9.46 4.46 7 7.5 7H18c2.21 0 4 1.79 4 4s-1.79 4-4 4H9.5a2.5 2.5 0 010-5H17v2H9.41c-.55 0-.55 1 0 1H18c1.1 0 2-.9 2-2s-.9-2-2-2H7.5C5.57 9 4 10.57 4 12.5S5.57 16 7.5 16H17v2H7.5C4.46 18 2 15.54 2 12.5z\"></path>\n <path fill=\"none\" d=\"M0 0h24v24H0V0z\"></path>\n </svg>\n</ng-template>\n\n<!-- Close icon. -->\n<ng-template #closeIcon>\n <svg xmlns=\"http://www.w3.org/2000/svg\"\n class=\"bb-file-picker-icon\"\n width=\"24\"\n height=\"24\">\n <path fill=\"currentColor\"\n d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"></path>\n <path d=\"M0 0h24v24H0z\" fill=\"none\"></path>\n </svg>\n</ng-template>\n", styles: [".bb-file-picker{display:block}.bb-file-picker.disabled>.bb-file-picker-wrapper{cursor:default;background-color:#cccccca3}.bb-file-picker.grouped{margin-bottom:20px}.bb-file-picker.full>.bb-file-picker-wrapper{width:100%}.bb-file-picker:not(.disabled) .bb-file-picker-button{background-color:#fff}.bb-file-picker:not(.disabled):focus>.bb-file-picker-wrapper,.bb-file-picker:not(.disabled).hovered>.bb-file-picker-wrapper{box-shadow:inset 0 3px #b7bcc233,0 6px 6px -6px #0000001a,0 0 0 3px #007bff33}.bb-file-picker.required>.bb-file-picker-label:after{content:\"*\";color:#c23934;font-size:12px;line-height:1.5}.bb-file-picker.error>.bb-file-picker-label{color:#c23934}.bb-file-picker.error>.bb-file-picker-hint{display:none}.bb-file-picker.error>.bb-file-picker-wrapper{border:1px solid #962b26;background-color:#c2393440!important;box-shadow:inset 0 3px #b7bcc233,0 6px 6px -6px #0000001a,0 0 0 3px #c2393466!important}.bb-file-picker.error .bb-file-picker-button{background-color:transparent}.bb-file-picker-wrapper{max-width:100%;-webkit-user-select:none;user-select:none;border-radius:3px;display:inline-flex;flex-direction:column;border:1px solid #b6bbc1;background-color:#fff8ff;transition:box-shadow .2s cubic-bezier(0,0,.2,1);box-shadow:inset 0 3px #b7bcc233,0 6px 6px -6px #0000001a}.bb-file-picker-label{color:#000;display:block;position:relative;margin-bottom:4px}.bb-file-picker-input{opacity:0;z-index:-1;width:.1px;height:.1px;overflow:hidden;position:absolute}.bb-file-picker-container{min-height:38px;display:inline-flex}.bb-file-picker-button{margin:0;z-index:1;border:none;color:#2196f3;line-height:1;cursor:pointer;padding:0 12px;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-weight:500;align-items:center;white-space:nowrap;display:inline-flex;border-top-left-radius:3px;border-bottom-left-radius:3px;border-right:1px solid #b6bbc1;background-color:#ffffff80;transition:box-shadow .2s cubic-bezier(0,0,.2,1)}.bb-file-picker-button:focus{box-shadow:0 0 0 3px #007bff33}.bb-file-picker-button:disabled{cursor:default}.bb-file-picker-button.destructive{color:#f55656}.bb-file-picker-button.standalone{width:100%;border-right:none;border-top-right-radius:3px;border-bottom-right-radius:3px}.bb-file-picker-icon{margin-right:4px}.bb-file-picker-zone{flex:1;color:#848f99;font-size:14px;padding:8px 12px;line-height:18px;align-items:center;display:inline-flex;justify-content:center}.bb-file-picker-info{height:0;color:#848f99;padding:0 12px;overflow:hidden;line-height:36px;align-items:center;display:inline-flex;background-color:#fff8ff;border-top:0 solid #b6bbc1;transition:height .2s cubic-bezier(0,0,.2,1)}.bb-file-picker-info.visible{height:38px;border-top-width:1px}.bb-file-picker-info>span{opacity:.4;max-width:100%;font-size:14px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.bb-file-picker-info>span:first-child{flex:1}.bb-file-picker-info>span:last-child{margin-left:12px}.bb-file-picker-image-container{overflow:hidden;border-top:1px solid #b6bbc1}.bb-file-picker-image-wrapper{width:100%;max-width:40%;margin:20px auto}.bb-file-picker-image{width:100%;display:flex;overflow:hidden;position:relative;border-radius:4px;will-change:opacity;background-size:cover;background-position:center;background-repeat:no-repeat}.bb-file-picker-hint{display:block;color:#738694;font-size:13px;margin-top:4px}\n"], components: [{ type: BbFormError, selector: "bb-form-error", inputs: ["control"], outputs: ["errorChange"] }], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: BbTemplate, selector: "[bbTemplate]", inputs: ["bbTemplate"] }, { type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i1.AsyncPipe, "bbLocalize": i4.BbLocalize, "bbFileImage": BbFileImage, "bbFileSize": BbFileSize }, animations: [
718
+ trigger('bbFilePickerImageAnimation', [
719
+ transition(':enter', [
720
+ style({ opacity: 0 }),
721
+ animate('200ms', style({ opacity: 1 }))
722
+ ]),
723
+ transition(':leave', [
724
+ animate('200ms', style({ opacity: 0 }))
725
+ ])
726
+ ])
727
+ ], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
728
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbFilePicker, decorators: [{
729
+ type: Component,
730
+ args: [{ selector: 'bb-file-picker', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
731
+ {
732
+ provide: NG_VALUE_ACCESSOR,
733
+ useExisting: forwardRef(() => BbFilePicker),
734
+ multi: true
735
+ },
736
+ {
737
+ provide: NG_VALIDATORS,
738
+ useExisting: BbFilePicker,
739
+ multi: true
740
+ }
741
+ ], host: {
742
+ 'class': 'bb-file-picker',
743
+ '[class.required]': 'required',
744
+ '[class.disabled]': 'disabled',
745
+ '[class.grouped]': 'grouped',
746
+ '[class.hovered]': 'hovered',
747
+ '[class.error]': 'error'
748
+ }, animations: [
749
+ trigger('bbFilePickerImageAnimation', [
750
+ transition(':enter', [
751
+ style({ opacity: 0 }),
752
+ animate('200ms', style({ opacity: 1 }))
753
+ ]),
754
+ transition(':leave', [
755
+ animate('200ms', style({ opacity: 0 }))
756
+ ])
757
+ ])
758
+ ], inputs: ['disabled', 'hideErrors', 'grouped', 'required'], preserveWhitespaces: false, template: "<!-- The label of the input. -->\n<label *ngIf=\"label as labelContent\"\n [for]=\"labelId\"\n class=\"bb-file-picker-label\">\n <ng-template [bbTemplate]=\"labelContent\">\n {{ labelContent }}\n </ng-template>\n</label>\n\n<!-- The input that can open the file picker. -->\n<input #fileInput\n [accept]=\"accept\"\n [disabled]=\"disabled\"\n (change)=\"onFileChange($event)\"\n class=\"bb-file-picker-input\"\n type=\"file\"\n tabindex=\"-1\">\n\n<div *ngIf=\"value$ | async as data\"\n class=\"bb-file-picker-wrapper\">\n <!-- The button that accepts files. -->\n <div class=\"bb-file-picker-container\">\n <button [class.destructive]=\"!!data?.file\"\n [class.standalone]=\"!allowDragging\"\n [disabled]=\"disabled\"\n [id]=\"labelId\"\n (click)=\"onButtonPressed(data?.file)\"\n type=\"button\"\n class=\"bb-file-picker-button\">\n <ng-container *ngTemplateOutlet=\"data?.file ? closeIcon : uploadIcon\"></ng-container>\n {{ (data?.file ? 'file-picker.remove' : 'file-picker.choose') | bbLocalize }}\n </button>\n <div *ngIf=\"allowDragging\"\n class=\"bb-file-picker-zone\">\n {{ 'file-picker.drop' | bbLocalize }}\n </div>\n </div>\n\n <ng-container *ngIf=\"!!extraTemplate\">\n <ng-container *ngTemplateOutlet=\"extraTemplate; context: {$implicit: data?.file}\"></ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"showImages\">\n <div *ngIf=\"data?.file | bbFileImage | async as image\"\n class=\"bb-file-picker-image-container\">\n <div class=\"bb-file-picker-image-wrapper\">\n <div [@bbFilePickerImageAnimation]=\"true\"\n [style.padding-top.%]=\"image?.aspectRatio * 100\"\n [style.background-image]=\"image?.background\"\n class=\"bb-file-picker-image\">\n </div>\n </div>\n </div>\n </ng-container>\n\n <!-- Extra information of the file. -->\n <div [class.visible]=\"!!data?.file\"\n class=\"bb-file-picker-info\">\n <span *ngIf=\"data?.file?.name as name\">{{ name }}</span>\n <span *ngIf=\"data?.file?.size as size\">{{ size | bbFileSize }}</span>\n </div>\n</div>\n\n<bb-form-error *ngIf=\"!hideErrors\"\n (errorChange)=\"onErrorChange($event)\">\n</bb-form-error>\n\n<!-- The file picker hint. -->\n<p *ngIf=\"hint as hintContent\"\n class=\"bb-file-picker-hint\">\n <ng-template [bbTemplate]=\"hintContent\">\n {{ hintContent }}\n </ng-template>\n</p>\n\n<!-- Upload icon. -->\n<ng-template #uploadIcon>\n <svg xmlns=\"http://www.w3.org/2000/svg\"\n class=\"bb-file-picker-icon\"\n width=\"24\"\n height=\"24\">\n <path fill=\"currentColor\"\n d=\"M2 12.5C2 9.46 4.46 7 7.5 7H18c2.21 0 4 1.79 4 4s-1.79 4-4 4H9.5a2.5 2.5 0 010-5H17v2H9.41c-.55 0-.55 1 0 1H18c1.1 0 2-.9 2-2s-.9-2-2-2H7.5C5.57 9 4 10.57 4 12.5S5.57 16 7.5 16H17v2H7.5C4.46 18 2 15.54 2 12.5z\"></path>\n <path fill=\"none\" d=\"M0 0h24v24H0V0z\"></path>\n </svg>\n</ng-template>\n\n<!-- Close icon. -->\n<ng-template #closeIcon>\n <svg xmlns=\"http://www.w3.org/2000/svg\"\n class=\"bb-file-picker-icon\"\n width=\"24\"\n height=\"24\">\n <path fill=\"currentColor\"\n d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"></path>\n <path d=\"M0 0h24v24H0z\" fill=\"none\"></path>\n </svg>\n</ng-template>\n", styles: [".bb-file-picker{display:block}.bb-file-picker.disabled>.bb-file-picker-wrapper{cursor:default;background-color:#cccccca3}.bb-file-picker.grouped{margin-bottom:20px}.bb-file-picker.full>.bb-file-picker-wrapper{width:100%}.bb-file-picker:not(.disabled) .bb-file-picker-button{background-color:#fff}.bb-file-picker:not(.disabled):focus>.bb-file-picker-wrapper,.bb-file-picker:not(.disabled).hovered>.bb-file-picker-wrapper{box-shadow:inset 0 3px #b7bcc233,0 6px 6px -6px #0000001a,0 0 0 3px #007bff33}.bb-file-picker.required>.bb-file-picker-label:after{content:\"*\";color:#c23934;font-size:12px;line-height:1.5}.bb-file-picker.error>.bb-file-picker-label{color:#c23934}.bb-file-picker.error>.bb-file-picker-hint{display:none}.bb-file-picker.error>.bb-file-picker-wrapper{border:1px solid #962b26;background-color:#c2393440!important;box-shadow:inset 0 3px #b7bcc233,0 6px 6px -6px #0000001a,0 0 0 3px #c2393466!important}.bb-file-picker.error .bb-file-picker-button{background-color:transparent}.bb-file-picker-wrapper{max-width:100%;-webkit-user-select:none;user-select:none;border-radius:3px;display:inline-flex;flex-direction:column;border:1px solid #b6bbc1;background-color:#fff8ff;transition:box-shadow .2s cubic-bezier(0,0,.2,1);box-shadow:inset 0 3px #b7bcc233,0 6px 6px -6px #0000001a}.bb-file-picker-label{color:#000;display:block;position:relative;margin-bottom:4px}.bb-file-picker-input{opacity:0;z-index:-1;width:.1px;height:.1px;overflow:hidden;position:absolute}.bb-file-picker-container{min-height:38px;display:inline-flex}.bb-file-picker-button{margin:0;z-index:1;border:none;color:#2196f3;line-height:1;cursor:pointer;padding:0 12px;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-weight:500;align-items:center;white-space:nowrap;display:inline-flex;border-top-left-radius:3px;border-bottom-left-radius:3px;border-right:1px solid #b6bbc1;background-color:#ffffff80;transition:box-shadow .2s cubic-bezier(0,0,.2,1)}.bb-file-picker-button:focus{box-shadow:0 0 0 3px #007bff33}.bb-file-picker-button:disabled{cursor:default}.bb-file-picker-button.destructive{color:#f55656}.bb-file-picker-button.standalone{width:100%;border-right:none;border-top-right-radius:3px;border-bottom-right-radius:3px}.bb-file-picker-icon{margin-right:4px}.bb-file-picker-zone{flex:1;color:#848f99;font-size:14px;padding:8px 12px;line-height:18px;align-items:center;display:inline-flex;justify-content:center}.bb-file-picker-info{height:0;color:#848f99;padding:0 12px;overflow:hidden;line-height:36px;align-items:center;display:inline-flex;background-color:#fff8ff;border-top:0 solid #b6bbc1;transition:height .2s cubic-bezier(0,0,.2,1)}.bb-file-picker-info.visible{height:38px;border-top-width:1px}.bb-file-picker-info>span{opacity:.4;max-width:100%;font-size:14px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.bb-file-picker-info>span:first-child{flex:1}.bb-file-picker-info>span:last-child{margin-left:12px}.bb-file-picker-image-container{overflow:hidden;border-top:1px solid #b6bbc1}.bb-file-picker-image-wrapper{width:100%;max-width:40%;margin:20px auto}.bb-file-picker-image{width:100%;display:flex;overflow:hidden;position:relative;border-radius:4px;will-change:opacity;background-size:cover;background-position:center;background-repeat:no-repeat}.bb-file-picker-hint{display:block;color:#738694;font-size:13px;margin-top:4px}\n"] }]
759
+ }], propDecorators: { fileInput: [{
760
+ type: ViewChild,
761
+ args: ['fileInput', { static: true }]
762
+ }], extraTemplate: [{
763
+ type: ContentChild,
764
+ args: ['extra']
765
+ }], label: [{
766
+ type: Input
767
+ }], hint: [{
768
+ type: Input
769
+ }], accept: [{
770
+ type: Input
771
+ }], showImages: [{
772
+ type: Input
773
+ }], allowDragging: [{
774
+ type: Input
775
+ }], value: [{
776
+ type: Input
777
+ }], valueChange: [{
778
+ type: Output
779
+ }], onDrag: [{
780
+ type: HostListener,
781
+ args: ['dragover', ['$event', 'true']]
782
+ }, {
783
+ type: HostListener,
784
+ args: ['dragleave', ['$event', 'false']]
785
+ }], onDrop: [{
786
+ type: HostListener,
787
+ args: ['drop', ['$event']]
788
+ }] } });
789
+
790
+ class BbSelect {
791
+ constructor(_elementRef, _ngControl, _formControl) {
792
+ this._elementRef = _elementRef;
793
+ this._ngControl = _ngControl;
794
+ this._formControl = _formControl;
795
+ this.hasArrow = true;
796
+ this._disabled = false;
797
+ this._required = false;
798
+ }
799
+ ngOnInit() {
800
+ // Set an arrow on the form control if
801
+ // it requires one.
802
+ this._formControl.arrow = this.hasArrow;
803
+ }
804
+ ngDoCheck() {
805
+ if (this._ngControl) {
806
+ this.disabled = this._ngControl.disabled;
807
+ }
808
+ }
809
+ ngOnDestroy() {
810
+ this._subscription?.unsubscribe();
811
+ }
812
+ focus() {
813
+ return this._elementRef?.nativeElement?.focus();
814
+ }
815
+ setFocus(hasFocus) {
816
+ if (!this._formControl) {
817
+ return;
818
+ }
819
+ this._formControl.focused = hasFocus;
820
+ }
821
+ get id() {
822
+ return this._formControl?.labelId ?? null;
823
+ }
824
+ get disabled() {
825
+ if (this._ngControl && this._ngControl.disabled !== null) {
826
+ return this._ngControl.disabled;
827
+ }
828
+ return this._disabled;
829
+ }
830
+ set disabled(newValue) {
831
+ this._disabled = coerceBooleanProperty(newValue);
832
+ if (!this._formControl) {
833
+ return;
834
+ }
835
+ this._formControl.disabled = this._disabled;
836
+ }
837
+ get required() {
838
+ return this._required;
839
+ }
840
+ set required(newValue) {
841
+ this._required = coerceBooleanProperty(newValue);
842
+ if (!this._formControl) {
843
+ return;
844
+ }
845
+ this._formControl.required = this._required;
846
+ }
847
+ }
848
+ BbSelect.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbSelect, deps: [{ token: i0.ElementRef }, { token: i5.NgControl, optional: true, self: true }, { token: BbFormControl, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
849
+ BbSelect.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.0", type: BbSelect, selector: "select[bbInput]", inputs: { disabled: "disabled", required: "required" }, host: { listeners: { "focus": "setFocus(true)", "blur": "setFocus(false)" }, properties: { "disabled": "disabled", "attr.id": "this.id" } }, ngImport: i0 });
850
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbSelect, decorators: [{
851
+ type: Directive,
852
+ args: [{
853
+ selector: 'select[bbInput]',
854
+ host: {
855
+ '[disabled]': 'disabled',
856
+ '(focus)': 'setFocus(true)',
857
+ '(blur)': 'setFocus(false)'
858
+ }
859
+ }]
860
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i5.NgControl, decorators: [{
861
+ type: Optional
862
+ }, {
863
+ type: Self
864
+ }] }, { type: BbFormControl, decorators: [{
865
+ type: Optional
866
+ }, {
867
+ type: Host
868
+ }] }]; }, propDecorators: { id: [{
869
+ type: HostBinding,
870
+ args: ['attr.id']
871
+ }], disabled: [{
872
+ type: Input
873
+ }], required: [{
874
+ type: Input
875
+ }] } });
876
+ class BbInput extends BbSelect {
877
+ constructor(_elementRef, _ngControl, _formControl) {
878
+ super(_elementRef, _ngControl, _formControl);
879
+ this._elementRef = _elementRef;
880
+ this._ngControl = _ngControl;
881
+ this._formControl = _formControl;
882
+ this.hasArrow = false;
883
+ this._readonly = false;
884
+ }
885
+ get readonly() {
886
+ return this._readonly;
887
+ }
888
+ set readonly(newValue) {
889
+ this._readonly = coerceBooleanProperty(newValue);
890
+ if (!this._formControl) {
891
+ return;
892
+ }
893
+ this._formControl.readonly = this._readonly;
894
+ }
895
+ }
896
+ BbInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbInput, deps: [{ token: i0.ElementRef }, { token: i5.NgControl, optional: true, self: true }, { token: BbFormControl, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
897
+ BbInput.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.0", type: BbInput, selector: "input[bbInput], textarea[bbInput]", inputs: { readonly: "readonly" }, host: { listeners: { "focus": "setFocus(true)", "blur": "setFocus(false)" }, properties: { "disabled": "disabled", "readonly": "readonly" } }, usesInheritance: true, ngImport: i0 });
898
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbInput, decorators: [{
899
+ type: Directive,
900
+ args: [{
901
+ selector: 'input[bbInput], textarea[bbInput]',
902
+ host: {
903
+ '[disabled]': 'disabled',
904
+ '[readonly]': 'readonly',
905
+ '(focus)': 'setFocus(true)',
906
+ '(blur)': 'setFocus(false)'
907
+ }
908
+ }]
909
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i5.NgControl, decorators: [{
910
+ type: Optional
911
+ }, {
912
+ type: Self
913
+ }] }, { type: BbFormControl, decorators: [{
914
+ type: Optional
915
+ }, {
916
+ type: Host
917
+ }] }]; }, propDecorators: { readonly: [{
918
+ type: Input
919
+ }] } });
920
+
921
+ class BbDatePickerBase {
922
+ }
923
+ const BbFilePickerMixinBase = mixinRequired(mixinReadonly(mixinDisabled(mixinGrouped(mixinError(mixinHideErrors(BbDatePickerBase))))));
924
+ class BbDatePicker extends BbFilePickerMixinBase {
925
+ constructor(_localeId) {
926
+ super();
927
+ this._localeId = _localeId;
928
+ // Readonly data.
929
+ this._yearRegex = /^(10|[1-9][0-9])\d{2}$/; // Note: 1000 - 9999
930
+ // Inputs.
931
+ this.label = null;
932
+ this.hint = null;
933
+ this.dayPlaceholder = 'dd';
934
+ this.monthPlaceholder = 'mm';
935
+ this.yearPlaceholder = 'yyyy';
936
+ this.trackByValue = (_, item) => item?.value;
937
+ this.years$ = new BehaviorSubject(null);
938
+ this.valueChange = new EventEmitter();
939
+ // Subscriptions.
940
+ this._subscription = new Subscription();
941
+ this.onTouchedCallback = () => {
942
+ };
943
+ this.onChangeCallback = () => {
944
+ };
945
+ this.formToDateString = ({ year, month, day }) => {
946
+ if (this.form?.invalid) {
947
+ return null;
948
+ }
949
+ const prefixedMonth = this.padString(`${month}`, 2, '0');
950
+ const prefixedDay = this.padString(`${day}`, 2, '0');
951
+ return [year, prefixedMonth, prefixedDay].join('-');
952
+ };
953
+ this.parseYearFormat = (value) => {
954
+ // Transform the value to a definitive string.
955
+ const yearString = `${value}`;
956
+ const currentFullYear = new Date().getFullYear();
957
+ // Handle default "current" syntax.
958
+ if (yearString === 'current') {
959
+ return currentFullYear;
960
+ }
961
+ // Handle "current + {amount}" syntax.
962
+ if (/^current\s?\+\s?\d+$/.test(yearString)) {
963
+ const amount = Number(yearString?.split('+')?.[1]?.trim()) ?? 0;
964
+ return currentFullYear + amount;
965
+ }
966
+ // Handle "current - {amount}" syntax.
967
+ if (/^current\s?-\s?\d+$/.test(yearString)) {
968
+ const amount = Number(yearString?.split('-')?.[1]?.trim()) ?? 0;
969
+ return currentFullYear - amount;
970
+ }
971
+ // Handling the default number case.
972
+ if (/^[0-9]{4}$/.test(yearString)) {
973
+ return Number(yearString);
974
+ }
975
+ // We could not parse it.
976
+ return null;
977
+ };
978
+ this.getDaysInMonth = (month = null, year = null) => {
979
+ if (this.form?.invalid || month === null || year === null) {
980
+ return 31;
981
+ }
982
+ const parsedYear = parseInt(year, 10);
983
+ return new Date(parsedYear, month, 0).getDate();
984
+ };
985
+ this.isValidDateString = (value) => {
986
+ return typeof value === 'string' && /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/.test(value);
987
+ };
988
+ this.padString = (value, maxLength, fillString = '0') => {
989
+ const count = maxLength - value.length;
990
+ for (let index = 0; index < count; index++) {
991
+ value = `${fillString}${value}`;
992
+ }
993
+ return value;
994
+ };
995
+ }
996
+ set years(value) {
997
+ this.parseYears(value);
998
+ }
999
+ get value() {
1000
+ return this.formToDateString(this.form?.value);
1001
+ }
1002
+ set value(value) {
1003
+ this.parseDateStringInForm(value);
1004
+ this.valueChange.emit(this.value);
1005
+ }
1006
+ ngOnInit() {
1007
+ this.composeForm();
1008
+ this.getData();
1009
+ this.handleChanges();
1010
+ }
1011
+ ngOnDestroy() {
1012
+ this._subscription?.unsubscribe();
1013
+ }
1014
+ writeValue(value) {
1015
+ this.parseDateStringInForm(value);
1016
+ }
1017
+ registerOnChange(method) {
1018
+ this.onChangeCallback = method;
1019
+ }
1020
+ registerOnTouched(method) {
1021
+ this.onTouchedCallback = method;
1022
+ }
1023
+ setDisabledState(isDisabled) {
1024
+ this.disabled = isDisabled;
1025
+ if (this.disabled) {
1026
+ this.form?.disable();
1027
+ }
1028
+ else {
1029
+ this.form?.enable();
1030
+ }
1031
+ }
1032
+ onErrorChange(error) {
1033
+ this.error = !!error;
1034
+ }
1035
+ validate({ value }) {
1036
+ if (value === null || value === undefined) {
1037
+ return null;
1038
+ }
1039
+ const data = this.parseDateString(value);
1040
+ const date = new Date(data?.year, data?.month - 1, data?.day);
1041
+ const maxDays = this.getDaysInMonth(data?.month, `${data?.year}`);
1042
+ const isInvalidDate = date.toString() === 'Invalid Date';
1043
+ const exceededMaxDays = data?.day > maxDays;
1044
+ return (isInvalidDate || exceededMaxDays) && {
1045
+ invalidDate: true
1046
+ };
1047
+ }
1048
+ handleChanges() {
1049
+ const dateOrNull$ = this.form.valueChanges.pipe(map(value => this.formToDateString(value)), distinctUntilChanged());
1050
+ const subscription = dateOrNull$.subscribe(() => {
1051
+ this.valueChange.emit(this.value);
1052
+ this.onChangeCallback(this.value);
1053
+ });
1054
+ this._subscription.add(subscription);
1055
+ }
1056
+ getData() {
1057
+ const years$ = this.years$.asObservable();
1058
+ const months$ = this.getMonthData();
1059
+ const days$ = this.getDayData();
1060
+ this.data$ = combineLatest([years$, months$, days$]).pipe(map(([years, months, days]) => ({ years, months, days })), tap(data => this.verifyListData(data?.days?.length, data?.years)));
1061
+ }
1062
+ verifyListData(maxDays, years) {
1063
+ const dayControl = this.form.get('day');
1064
+ if (dayControl?.value !== null && dayControl?.value > maxDays) {
1065
+ dayControl.patchValue(maxDays);
1066
+ }
1067
+ const yearControl = this.form.get('year');
1068
+ if (years !== null && yearControl?.value !== null && this._yearRegex.test(yearControl?.value)) {
1069
+ const selectedYear = Number(yearControl?.value);
1070
+ const firstYear = Math.min(...years);
1071
+ const lastYear = Math.max(...years);
1072
+ if (selectedYear < firstYear || selectedYear > lastYear) {
1073
+ Promise.resolve().then(() => yearControl.patchValue(null));
1074
+ }
1075
+ }
1076
+ }
1077
+ getDayData() {
1078
+ const count$ = this.form.valueChanges.pipe(startWith(this.form?.value), map(({ month, year }) => this.getDaysInMonth(month, year)), distinctUntilChanged());
1079
+ return count$.pipe(map(count => Array(count).fill(0).map((_, index) => ({
1080
+ label: `${index + 1}`,
1081
+ value: index + 1
1082
+ }))));
1083
+ }
1084
+ getMonthData() {
1085
+ const array = Array(12).fill(0).map((_, month) => {
1086
+ const date = new Date(2000, month, 1);
1087
+ const label = formatDate(date, 'LLLL', this._localeId);
1088
+ return { label, value: month + 1 };
1089
+ });
1090
+ return of(array);
1091
+ }
1092
+ composeForm() {
1093
+ const { required, pattern, minLength, maxLength } = Validators;
1094
+ const yearPattern = pattern(this._yearRegex);
1095
+ const yearValidators = [required, yearPattern, minLength(4), maxLength(4)];
1096
+ this.form = new FormGroup({
1097
+ day: new FormControl(null, required),
1098
+ month: new FormControl(null, required),
1099
+ year: new FormControl(null, yearValidators)
1100
+ });
1101
+ }
1102
+ parseDateStringInForm(value) {
1103
+ // If the date string was not a valid format, reset the form.
1104
+ if (!this.isValidDateString(value)) {
1105
+ if (value !== null) {
1106
+ this.form?.reset({ year: null, month: null, day: null }, { emitEvent: false });
1107
+ }
1108
+ return;
1109
+ }
1110
+ // Parse the date string and save in the form.
1111
+ const data = this.parseDateString(value);
1112
+ const year = data?.year !== null && data?.year !== undefined
1113
+ ? this.padString(`${data?.year}`, 4, '0')
1114
+ : null;
1115
+ const formData = { ...(data ?? {}), year };
1116
+ this.form?.patchValue(formData, { emitEvent: false });
1117
+ }
1118
+ parseDateString(value) {
1119
+ if (!this.isValidDateString(value)) {
1120
+ return null;
1121
+ }
1122
+ // Parse the date string.
1123
+ const [year, month, day] = value?.split('-');
1124
+ return {
1125
+ day: day ? parseInt(day, 10) : null,
1126
+ month: month ? parseInt(month, 10) : null,
1127
+ year: year ? parseInt(year, 10) : null
1128
+ };
1129
+ }
1130
+ parseYears(values) {
1131
+ if (!values) {
1132
+ return this.years$.next(null);
1133
+ }
1134
+ // Parse the values to years (in numbers).
1135
+ const [first, last] = values;
1136
+ const firstYear = this.parseYearFormat(first);
1137
+ const lastYear = this.parseYearFormat(last);
1138
+ // Check cases in where we cannot parse.
1139
+ if (firstYear === null || lastYear === null) {
1140
+ return this.years$.next(null);
1141
+ }
1142
+ const difference = firstYear - lastYear;
1143
+ const absoluteDifference = Math.abs(difference) + 1;
1144
+ // Create an array with years.
1145
+ const years = Array(absoluteDifference)
1146
+ .fill(0)
1147
+ .map((_, index) => difference < 0 ? (firstYear + index) : (firstYear - index));
1148
+ // Validate we have one or more years.
1149
+ if (years?.length <= 0) {
1150
+ return this.years$.next(null);
1151
+ }
1152
+ // Push the years.
1153
+ return this.years$.next(years);
1154
+ }
1155
+ }
1156
+ BbDatePicker.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbDatePicker, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Component });
1157
+ BbDatePicker.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.0", type: BbDatePicker, selector: "bb-date-picker", inputs: { required: "required", readonly: "readonly", disabled: "disabled", grouped: "grouped", hideErrors: "hideErrors", label: "label", hint: "hint", dayPlaceholder: "dayPlaceholder", monthPlaceholder: "monthPlaceholder", yearPlaceholder: "yearPlaceholder", years: "years", value: "value" }, outputs: { valueChange: "valueChange" }, host: { properties: { "class.required": "required", "class.readonly": "readonly", "class.disabled": "disabled", "class.grouped": "grouped", "class.error": "error" }, classAttribute: "bb-date-picker" }, providers: [
1158
+ {
1159
+ provide: NG_VALUE_ACCESSOR,
1160
+ useExisting: forwardRef(() => BbDatePicker),
1161
+ multi: true
1162
+ },
1163
+ {
1164
+ provide: NG_VALIDATORS,
1165
+ useExisting: BbDatePicker,
1166
+ multi: true
1167
+ }
1168
+ ], usesInheritance: true, ngImport: i0, template: "<!-- Label of the date picker. -->\n<label *ngIf=\"label as labelContent\"\n class=\"bb-date-picker-label\">\n <ng-template [bbTemplate]=\"labelContent\">\n {{ labelContent }}\n </ng-template>\n</label>\n\n<!-- The form containing the year/month/day fields. -->\n<form *ngIf=\"data$ | async as data\"\n [formGroup]=\"form\"\n class=\"bb-date-picker-container\"\n novalidate>\n <div class=\"bb-date-picker-item\">\n <bb-form-control hideErrors>\n <select [class.has-value]=\"!!form?.get('day')?.value\"\n bbInput\n autocomplete=\"off\"\n formControlName=\"day\">\n <option [ngValue]=\"null\">{{ dayPlaceholder }}</option>\n <option *ngFor=\"let day of data?.days; trackBy: trackByValue\"\n [ngValue]=\"day?.value\">\n {{ day?.label }}\n </option>\n </select>\n </bb-form-control>\n </div>\n <div class=\"bb-date-picker-item\">\n <bb-form-control hideErrors>\n <select [class.has-value]=\"!!form?.get('month')?.value\"\n bbInput\n autocomplete=\"off\"\n formControlName=\"month\">\n <option [ngValue]=\"null\">{{ monthPlaceholder }}</option>\n <option *ngFor=\"let month of data?.months; trackBy: trackByValue\"\n [ngValue]=\"month?.value\">\n {{ month?.label }}\n </option>\n </select>\n </bb-form-control>\n </div>\n <div class=\"bb-date-picker-item\">\n <bb-form-control hideErrors>\n <select *ngIf=\"data?.years?.length > 0; else defaultYearInputTemplate\"\n [class.has-value]=\"!!form?.get('year')?.value\"\n bbInput\n autocomplete=\"off\"\n formControlName=\"year\">\n <option [ngValue]=\"null\">{{ yearPlaceholder }}</option>\n <option *ngFor=\"let year of data?.years\"\n [value]=\"year\">\n {{ year }}\n </option>\n </select>\n\n <ng-template #defaultYearInputTemplate>\n <input [placeholder]=\"yearPlaceholder\"\n bbInput\n type=\"text\"\n inputmode=\"numeric\"\n minlength=\"4\"\n maxlength=\"4\"\n pattern=\"^[0-9]{4}$\"\n formControlName=\"year\"\n autocomplete=\"off\">\n </ng-template>\n </bb-form-control>\n </div>\n</form>\n\n<!-- The date picker error. -->\n<bb-form-error *ngIf=\"!hideErrors\"\n (errorChange)=\"onErrorChange($event)\">\n</bb-form-error>\n\n<!-- The date picker hint. -->\n<p *ngIf=\"hint as hintContent\"\n class=\"bb-date-picker-hint\">\n <ng-template [bbTemplate]=\"hintContent\">\n {{ hintContent }}\n </ng-template>\n</p>\n", styles: [".bb-date-picker{display:block}.bb-date-picker.required>.bb-date-picker-label:after{content:\"*\";color:#c23934;font-size:12px;line-height:1.5}.bb-date-picker.readonly{pointer-events:none}.bb-date-picker.readonly .bb-form-control-container{cursor:default;border:1px dotted #bdc4c9;background-color:#f9f9f9!important}.bb-date-picker.readonly .bb-form-control-container>select:disabled{opacity:1}.bb-date-picker.grouped{margin-bottom:20px}.bb-date-picker.error>.bb-date-picker-label{color:#c23934}.bb-date-picker.error .bb-form-control-container{border:1px solid #962b26;background-color:#c2393440!important;box-shadow:inset 0 3px #b7bcc233,0 6px 6px -6px #0000001a,0 0 0 3px #c2393466!important}.bb-date-picker-label{color:#000;display:block;font-size:16px;font-weight:500;margin-bottom:4px}.bb-date-picker-container{display:flex}.bb-date-picker-item{flex:1}.bb-date-picker-item>bb-form-control.focused{z-index:1;position:relative}.bb-date-picker-item>.bb-form-control>.bb-form-control-container>select>option:first-child{color:#d2d2d2}.bb-date-picker-item>.bb-form-control>.bb-form-control-container>select:not(.has-value){color:#d2d2d2}.bb-date-picker-item>.bb-form-control>.bb-form-control-container>select:not(.has-value)>option:not(:first-child){color:#000}.bb-date-picker-item:not(:first-child):not(:last-child) .bb-form-control-container{border-radius:0!important}.bb-date-picker-item:first-child .bb-form-control-container{border-right:none!important;border-top-right-radius:0!important;border-bottom-right-radius:0!important}.bb-date-picker-item:last-child .bb-form-control-container{border-left:none!important;border-top-left-radius:0!important;border-bottom-left-radius:0!important}.bb-date-picker-hint{display:block;color:#738694;font-size:13px;margin-top:4px;pointer-events:all}\n"], components: [{ type: BbFormControl, selector: "bb-form-control", inputs: ["grouped", "hideErrors", "label", "hint"] }, { type: BbFormError, selector: "bb-form-error", inputs: ["control"], outputs: ["errorChange"] }], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: BbTemplate, selector: "[bbTemplate]", inputs: ["bbTemplate"] }, { type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: BbFormSubmit, selector: "form", exportAs: ["bbForm"] }, { type: i5.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: BbSelect, selector: "select[bbInput]", inputs: ["disabled", "required"] }, { type: i5.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i5.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i5.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: BbInput, selector: "input[bbInput], textarea[bbInput]", inputs: ["readonly"] }, { type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { type: i5.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { type: i5.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }], pipes: { "async": i1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1169
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbDatePicker, decorators: [{
1170
+ type: Component,
1171
+ args: [{ selector: 'bb-date-picker', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
1172
+ {
1173
+ provide: NG_VALUE_ACCESSOR,
1174
+ useExisting: forwardRef(() => BbDatePicker),
1175
+ multi: true
1176
+ },
1177
+ {
1178
+ provide: NG_VALIDATORS,
1179
+ useExisting: BbDatePicker,
1180
+ multi: true
1181
+ }
1182
+ ], host: {
1183
+ 'class': 'bb-date-picker',
1184
+ '[class.required]': 'required',
1185
+ '[class.readonly]': 'readonly',
1186
+ '[class.disabled]': 'disabled',
1187
+ '[class.grouped]': 'grouped',
1188
+ '[class.error]': 'error'
1189
+ }, inputs: ['required', 'readonly', 'disabled', 'grouped', 'hideErrors'], preserveWhitespaces: false, template: "<!-- Label of the date picker. -->\n<label *ngIf=\"label as labelContent\"\n class=\"bb-date-picker-label\">\n <ng-template [bbTemplate]=\"labelContent\">\n {{ labelContent }}\n </ng-template>\n</label>\n\n<!-- The form containing the year/month/day fields. -->\n<form *ngIf=\"data$ | async as data\"\n [formGroup]=\"form\"\n class=\"bb-date-picker-container\"\n novalidate>\n <div class=\"bb-date-picker-item\">\n <bb-form-control hideErrors>\n <select [class.has-value]=\"!!form?.get('day')?.value\"\n bbInput\n autocomplete=\"off\"\n formControlName=\"day\">\n <option [ngValue]=\"null\">{{ dayPlaceholder }}</option>\n <option *ngFor=\"let day of data?.days; trackBy: trackByValue\"\n [ngValue]=\"day?.value\">\n {{ day?.label }}\n </option>\n </select>\n </bb-form-control>\n </div>\n <div class=\"bb-date-picker-item\">\n <bb-form-control hideErrors>\n <select [class.has-value]=\"!!form?.get('month')?.value\"\n bbInput\n autocomplete=\"off\"\n formControlName=\"month\">\n <option [ngValue]=\"null\">{{ monthPlaceholder }}</option>\n <option *ngFor=\"let month of data?.months; trackBy: trackByValue\"\n [ngValue]=\"month?.value\">\n {{ month?.label }}\n </option>\n </select>\n </bb-form-control>\n </div>\n <div class=\"bb-date-picker-item\">\n <bb-form-control hideErrors>\n <select *ngIf=\"data?.years?.length > 0; else defaultYearInputTemplate\"\n [class.has-value]=\"!!form?.get('year')?.value\"\n bbInput\n autocomplete=\"off\"\n formControlName=\"year\">\n <option [ngValue]=\"null\">{{ yearPlaceholder }}</option>\n <option *ngFor=\"let year of data?.years\"\n [value]=\"year\">\n {{ year }}\n </option>\n </select>\n\n <ng-template #defaultYearInputTemplate>\n <input [placeholder]=\"yearPlaceholder\"\n bbInput\n type=\"text\"\n inputmode=\"numeric\"\n minlength=\"4\"\n maxlength=\"4\"\n pattern=\"^[0-9]{4}$\"\n formControlName=\"year\"\n autocomplete=\"off\">\n </ng-template>\n </bb-form-control>\n </div>\n</form>\n\n<!-- The date picker error. -->\n<bb-form-error *ngIf=\"!hideErrors\"\n (errorChange)=\"onErrorChange($event)\">\n</bb-form-error>\n\n<!-- The date picker hint. -->\n<p *ngIf=\"hint as hintContent\"\n class=\"bb-date-picker-hint\">\n <ng-template [bbTemplate]=\"hintContent\">\n {{ hintContent }}\n </ng-template>\n</p>\n", styles: [".bb-date-picker{display:block}.bb-date-picker.required>.bb-date-picker-label:after{content:\"*\";color:#c23934;font-size:12px;line-height:1.5}.bb-date-picker.readonly{pointer-events:none}.bb-date-picker.readonly .bb-form-control-container{cursor:default;border:1px dotted #bdc4c9;background-color:#f9f9f9!important}.bb-date-picker.readonly .bb-form-control-container>select:disabled{opacity:1}.bb-date-picker.grouped{margin-bottom:20px}.bb-date-picker.error>.bb-date-picker-label{color:#c23934}.bb-date-picker.error .bb-form-control-container{border:1px solid #962b26;background-color:#c2393440!important;box-shadow:inset 0 3px #b7bcc233,0 6px 6px -6px #0000001a,0 0 0 3px #c2393466!important}.bb-date-picker-label{color:#000;display:block;font-size:16px;font-weight:500;margin-bottom:4px}.bb-date-picker-container{display:flex}.bb-date-picker-item{flex:1}.bb-date-picker-item>bb-form-control.focused{z-index:1;position:relative}.bb-date-picker-item>.bb-form-control>.bb-form-control-container>select>option:first-child{color:#d2d2d2}.bb-date-picker-item>.bb-form-control>.bb-form-control-container>select:not(.has-value){color:#d2d2d2}.bb-date-picker-item>.bb-form-control>.bb-form-control-container>select:not(.has-value)>option:not(:first-child){color:#000}.bb-date-picker-item:not(:first-child):not(:last-child) .bb-form-control-container{border-radius:0!important}.bb-date-picker-item:first-child .bb-form-control-container{border-right:none!important;border-top-right-radius:0!important;border-bottom-right-radius:0!important}.bb-date-picker-item:last-child .bb-form-control-container{border-left:none!important;border-top-left-radius:0!important;border-bottom-left-radius:0!important}.bb-date-picker-hint{display:block;color:#738694;font-size:13px;margin-top:4px;pointer-events:all}\n"] }]
1190
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1191
+ type: Inject,
1192
+ args: [LOCALE_ID]
1193
+ }] }]; }, propDecorators: { label: [{
1194
+ type: Input
1195
+ }], hint: [{
1196
+ type: Input
1197
+ }], dayPlaceholder: [{
1198
+ type: Input
1199
+ }], monthPlaceholder: [{
1200
+ type: Input
1201
+ }], yearPlaceholder: [{
1202
+ type: Input
1203
+ }], years: [{
1204
+ type: Input
1205
+ }], value: [{
1206
+ type: Input
1207
+ }], valueChange: [{
1208
+ type: Output
1209
+ }] } });
1210
+
1211
+ class BbSuffix {
1212
+ }
1213
+ BbSuffix.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbSuffix, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1214
+ BbSuffix.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.0", type: BbSuffix, selector: "[bbSuffix]", host: { classAttribute: "bb-suffix" }, ngImport: i0 });
1215
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbSuffix, decorators: [{
1216
+ type: Directive,
1217
+ args: [{
1218
+ selector: '[bbSuffix]',
1219
+ host: {
1220
+ 'class': 'bb-suffix'
1221
+ }
1222
+ }]
1223
+ }] });
1224
+ class BbPrefix {
1225
+ }
1226
+ BbPrefix.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbPrefix, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1227
+ BbPrefix.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.0", type: BbPrefix, selector: "[bbPrefix]", host: { classAttribute: "bb-prefix" }, ngImport: i0 });
1228
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbPrefix, decorators: [{
1229
+ type: Directive,
1230
+ args: [{
1231
+ selector: '[bbPrefix]',
1232
+ host: {
1233
+ 'class': 'bb-prefix'
1234
+ }
1235
+ }]
1236
+ }] });
1237
+
1238
+ class BbFormGroupBase {
1239
+ }
1240
+ const BbFormGroupMixinBase = mixinGrouped(BbFormGroupBase);
1241
+ class BbFormGroup extends BbFormGroupMixinBase {
1242
+ }
1243
+ BbFormGroup.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbFormGroup, deps: null, target: i0.ɵɵFactoryTarget.Component });
1244
+ BbFormGroup.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.0", type: BbFormGroup, selector: "bb-form-group", inputs: { grouped: "grouped" }, host: { properties: { "class.grouped": "grouped" }, classAttribute: "bb-form-group" }, usesInheritance: true, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [".bb-form-group{width:100%;display:flex;flex-wrap:wrap;margin-top:-10px}.bb-form-group>*{margin-top:10px}.bb-form-group>*:not(:first-child){margin-left:10px}.bb-form-group.start{justify-content:flex-start}.bb-form-group.end{justify-content:flex-end}.bb-form-group.vertical{flex-direction:column;justify-content:normal}.bb-form-group.vertical>*{margin-left:0}.bb-form-group.vertical.start{align-items:flex-start}.bb-form-group.vertical.end{align-items:flex-end}.bb-form-group.grouped{margin-bottom:20px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1245
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbFormGroup, decorators: [{
1246
+ type: Component,
1247
+ args: [{ selector: 'bb-form-group', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
1248
+ 'class': 'bb-form-group',
1249
+ '[class.grouped]': 'grouped'
1250
+ }, inputs: ['grouped'], preserveWhitespaces: false, template: "<ng-content></ng-content>\n", styles: [".bb-form-group{width:100%;display:flex;flex-wrap:wrap;margin-top:-10px}.bb-form-group>*{margin-top:10px}.bb-form-group>*:not(:first-child){margin-left:10px}.bb-form-group.start{justify-content:flex-start}.bb-form-group.end{justify-content:flex-end}.bb-form-group.vertical{flex-direction:column;justify-content:normal}.bb-form-group.vertical>*{margin-left:0}.bb-form-group.vertical.start{align-items:flex-start}.bb-form-group.vertical.end{align-items:flex-end}.bb-form-group.grouped{margin-bottom:20px}\n"] }]
1251
+ }] });
1252
+
1253
+ class BbFocusTrap {
1254
+ constructor(_platform, _elementRef) {
1255
+ this._platform = _platform;
1256
+ this._elementRef = _elementRef;
1257
+ this._focusableElements = [
1258
+ 'a[href]',
1259
+ 'area[href]',
1260
+ 'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',
1261
+ 'select:not([disabled]):not([aria-hidden])',
1262
+ 'textarea:not([disabled]):not([aria-hidden])',
1263
+ 'button:not([disabled]):not([aria-hidden])',
1264
+ 'iframe',
1265
+ 'object',
1266
+ 'embed',
1267
+ '[contenteditable]',
1268
+ '[tabindex]:not([tabindex^="-"])'
1269
+ ];
1270
+ this.focus = (element) => {
1271
+ return element && element.focus && element.focus();
1272
+ };
1273
+ this.isTabEvent = (event) => {
1274
+ return event.key === 'Tab' || event.keyCode === 9;
1275
+ };
1276
+ }
1277
+ onKeydown(event) {
1278
+ // Validate it is a tab event.
1279
+ if (!this.isTabEvent(event)) {
1280
+ return;
1281
+ }
1282
+ // Trap the focus inside the element.
1283
+ return this.trapFocus(event);
1284
+ }
1285
+ trapFocus(event) {
1286
+ // Validate that the DOM is available.
1287
+ if (!this._platform.isBrowser) {
1288
+ return;
1289
+ }
1290
+ // Get all focusable nodes.
1291
+ const focusableNodes = this.getFocusableNodes();
1292
+ // Focus the first available element if the focus
1293
+ // is not in the modal.
1294
+ if (!this.element.contains(document.activeElement)) {
1295
+ return this.focus(focusableNodes[0]);
1296
+ }
1297
+ const focusedItemIndex = focusableNodes.indexOf(document.activeElement);
1298
+ if (event.shiftKey && focusedItemIndex === 0) {
1299
+ this.focus(focusableNodes[focusableNodes.length - 1]);
1300
+ return event.preventDefault();
1301
+ }
1302
+ if (!event.shiftKey && focusedItemIndex === focusableNodes.length - 1) {
1303
+ this.focus(focusableNodes[0]);
1304
+ return event.preventDefault();
1305
+ }
1306
+ }
1307
+ get element() {
1308
+ return this._elementRef.nativeElement;
1309
+ }
1310
+ getFocusableNodes() {
1311
+ const nodes = this.element.querySelectorAll(this._focusableElements);
1312
+ return Array(...nodes);
1313
+ }
1314
+ }
1315
+ BbFocusTrap.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbFocusTrap, deps: [{ token: i1$1.Platform }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
1316
+ BbFocusTrap.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.0", type: BbFocusTrap, selector: "[bbFocusTrap]", host: { listeners: { "keydown": "onKeydown($event)" } }, ngImport: i0 });
1317
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbFocusTrap, decorators: [{
1318
+ type: Directive,
1319
+ args: [{
1320
+ selector: '[bbFocusTrap]'
1321
+ }]
1322
+ }], ctorParameters: function () { return [{ type: i1$1.Platform }, { type: i0.ElementRef }]; }, propDecorators: { onKeydown: [{
1323
+ type: HostListener,
1324
+ args: ['keydown', ['$event']]
1325
+ }] } });
1326
+
1327
+ class BbAutosize {
1328
+ constructor(_renderer, _elementRef) {
1329
+ this._renderer = _renderer;
1330
+ this._elementRef = _elementRef;
1331
+ // Min/max heights for the textarea.
1332
+ this.minHeight = null;
1333
+ this.maxHeight = null;
1334
+ this.rows = 1;
1335
+ }
1336
+ get element() {
1337
+ return this._elementRef?.nativeElement;
1338
+ }
1339
+ ngAfterViewInit() {
1340
+ // Update the styles after the DOM has loaded.
1341
+ this.updateStyles();
1342
+ }
1343
+ onWindowResize() {
1344
+ // Update the styles when the window is resized.
1345
+ this.updateStyles();
1346
+ }
1347
+ onInputReceived() {
1348
+ // Update the styles after the textarea received input.
1349
+ this.updateStyles();
1350
+ }
1351
+ updateStyles() {
1352
+ // Validate the element exists.
1353
+ if (!this.element) {
1354
+ return;
1355
+ }
1356
+ // Calculate border height which is not included in the scroll height.
1357
+ const borderHeight = this.element?.offsetHeight - this.element?.clientHeight;
1358
+ // Reset textarea height to auto that correctly calculate the new height.
1359
+ this.setHeight('auto');
1360
+ // Set new height.
1361
+ this.setHeight(`${this.element?.scrollHeight + borderHeight}px`);
1362
+ }
1363
+ setHeight(value) {
1364
+ this._renderer.setStyle(this.element, 'height', value);
1365
+ }
1366
+ }
1367
+ BbAutosize.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbAutosize, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
1368
+ BbAutosize.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.0", type: BbAutosize, selector: "textarea[bbAutosize]", inputs: { minHeight: "minHeight", maxHeight: "maxHeight", rows: "rows" }, host: { listeners: { "window:resize": "onWindowResize()", "input": "onInputReceived()" }, properties: { "style.min-height": "this.minHeight", "style.max-height": "this.maxHeight", "rows": "this.rows" } }, ngImport: i0 });
1369
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbAutosize, decorators: [{
1370
+ type: Directive,
1371
+ args: [{
1372
+ selector: 'textarea[bbAutosize]'
1373
+ }]
1374
+ }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }]; }, propDecorators: { minHeight: [{
1375
+ type: Input
1376
+ }, {
1377
+ type: HostBinding,
1378
+ args: ['style.min-height']
1379
+ }], maxHeight: [{
1380
+ type: Input
1381
+ }, {
1382
+ type: HostBinding,
1383
+ args: ['style.max-height']
1384
+ }], rows: [{
1385
+ type: Input
1386
+ }, {
1387
+ type: HostBinding,
1388
+ args: ['rows']
1389
+ }], onWindowResize: [{
1390
+ type: HostListener,
1391
+ args: ['window:resize']
1392
+ }], onInputReceived: [{
1393
+ type: HostListener,
1394
+ args: ['input']
1395
+ }] } });
1396
+
1397
+ class BbRelativeTime {
1398
+ constructor(_localize, _localeId) {
1399
+ this._localize = _localize;
1400
+ this._localeId = _localeId;
1401
+ this.isValidDate = (date) => {
1402
+ return typeof date === 'object' &&
1403
+ typeof date.getTime === 'function' &&
1404
+ !isNaN(date.getTime());
1405
+ };
1406
+ this.parseAsDate = (value) => {
1407
+ // Add a Z after the date so
1408
+ // it is treated as a UTC date.
1409
+ if (typeof value === 'string' && /^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}$/.test(value)) {
1410
+ return new Date(`${value}Z`);
1411
+ }
1412
+ // Return the regular parsed date.
1413
+ return new Date(value);
1414
+ };
1415
+ this.isToday = (date) => {
1416
+ const today = new Date();
1417
+ return date?.getDate() === today?.getDate() &&
1418
+ date?.getMonth() === today?.getMonth() &&
1419
+ date?.getFullYear() === today?.getFullYear();
1420
+ };
1421
+ this.isYesterday = (date) => {
1422
+ const yesterday = new Date(new Date()?.setDate(new Date()?.getDate() - 1));
1423
+ return date?.getDate() === yesterday?.getDate() &&
1424
+ date?.getMonth() === yesterday?.getMonth() &&
1425
+ date?.getFullYear() === yesterday?.getFullYear();
1426
+ };
1427
+ this.isTomorrow = (date) => {
1428
+ const tomorrow = new Date(new Date()?.setDate(new Date()?.getDate() + 1));
1429
+ return date?.getDate() === tomorrow?.getDate() &&
1430
+ date?.getMonth() === tomorrow?.getMonth() &&
1431
+ date?.getFullYear() === tomorrow?.getFullYear();
1432
+ };
1433
+ this._datePipe = new DatePipe(this._localeId);
1434
+ }
1435
+ transform(value) {
1436
+ // Parse the value to a date object.
1437
+ const date = this.parseAsDate(value);
1438
+ // Check if the date is valid.
1439
+ if (!this.isValidDate(date)) {
1440
+ return value;
1441
+ }
1442
+ // Return the formatted date.
1443
+ return this.format(date);
1444
+ }
1445
+ format(date) {
1446
+ // It happens tomorrow.
1447
+ if (this.isTomorrow(date)) {
1448
+ return this.formatString(date, 'times.tomorrow_at', 'shortTime');
1449
+ }
1450
+ // It happened today.
1451
+ if (this.isToday(date)) {
1452
+ return this.formatString(date, 'times.today_at', 'shortTime');
1453
+ }
1454
+ // It happened yesterday.
1455
+ if (this.isYesterday(date)) {
1456
+ return this.formatString(date, 'times.yesterday_at', 'shortTime');
1457
+ }
1458
+ // Just return the date.
1459
+ return this.formatString(date);
1460
+ }
1461
+ formatString(date, token, format) {
1462
+ // Just return the parsed date.
1463
+ if (!this._localize || !token || !format) {
1464
+ return this._datePipe.transform(date, 'mediumDate');
1465
+ }
1466
+ // Return the translated formatting.
1467
+ return this._localize.translate({
1468
+ token: token,
1469
+ data: { date: this._datePipe.transform(date, format) }
1470
+ });
1471
+ }
1472
+ }
1473
+ BbRelativeTime.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbRelativeTime, deps: [{ token: i4.Localize, optional: true }, { token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe });
1474
+ BbRelativeTime.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbRelativeTime, name: "bbRelativeTime" });
1475
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbRelativeTime, decorators: [{
1476
+ type: Pipe,
1477
+ args: [{
1478
+ name: 'bbRelativeTime'
1479
+ }]
1480
+ }], ctorParameters: function () { return [{ type: i4.Localize, decorators: [{
1481
+ type: Optional
1482
+ }] }, { type: undefined, decorators: [{
1483
+ type: Inject,
1484
+ args: [LOCALE_ID]
1485
+ }] }]; } });
1486
+
1487
+ let nextUniqueId = 0;
1488
+ class BbCheckboxBase {
1489
+ }
1490
+ const BbCheckboxMixinBase = mixinDisabled(mixinGrouped(BbCheckboxBase));
1491
+ class BbCheckbox extends BbCheckboxMixinBase {
1492
+ constructor(_changeDetection) {
1493
+ super();
1494
+ this._changeDetection = _changeDetection;
1495
+ // Data.
1496
+ this.labelId = `bb-checkbox-${nextUniqueId++}`;
1497
+ this._checked = false;
1498
+ // Methods.
1499
+ this.onChange = () => {
1500
+ };
1501
+ this.onTouched = () => {
1502
+ };
1503
+ }
1504
+ get checked() {
1505
+ return this._checked;
1506
+ }
1507
+ set checked(value) {
1508
+ this._checked = coerceBooleanProperty(value);
1509
+ this._changeDetection.markForCheck();
1510
+ }
1511
+ registerOnChange(fn) {
1512
+ this.onChange = fn;
1513
+ }
1514
+ registerOnTouched(fn) {
1515
+ this.onTouched = fn;
1516
+ }
1517
+ setDisabledState(isDisabled) {
1518
+ this.disabled = isDisabled;
1519
+ this._changeDetection.markForCheck();
1520
+ }
1521
+ writeValue(newValue) {
1522
+ this.checked = newValue;
1523
+ }
1524
+ onInteractionEvent(event) {
1525
+ // Stop the propagation to prevent it from bubbling up.
1526
+ event.stopPropagation();
1527
+ }
1528
+ onInputClick(event) {
1529
+ // Stop the propagation to prevent it from bubbling up.
1530
+ event.stopPropagation();
1531
+ // Toggle the value.
1532
+ this.checked = !this.checked;
1533
+ // Emit the change event.
1534
+ this.onChange && this.onChange(this.checked);
1535
+ }
1536
+ }
1537
+ BbCheckbox.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbCheckbox, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1538
+ BbCheckbox.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.0", type: BbCheckbox, selector: "bb-checkbox", inputs: { grouped: "grouped", disabled: "disabled", tabIndex: "tabIndex", checked: "checked" }, host: { properties: { "class.grouped": "grouped" }, classAttribute: "bb-checkbox" }, providers: [
1539
+ { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BbCheckbox), multi: true }
1540
+ ], usesInheritance: true, ngImport: i0, template: "<input [id]=\"labelId\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n (change)=\"onInteractionEvent($event)\"\n (click)=\"onInputClick($event)\"\n class=\"bb-checkbox-input\"\n tabindex=\"-1\"\n type=\"checkbox\">\n\n<label [for]=\"labelId\"\n [attr.tabindex]=\"disabled ? -1 : (tabIndex || 0)\"\n (keyup.space)=\"onInputClick($event)\"\n class=\"bb-checkbox-label\">\n <span>\n <svg width=\"12px\"\n height=\"10px\"\n viewbox=\"0 0 12 10\">\n <polyline points=\"1.5 6 4.5 9 10.5 1\"></polyline>\n </svg>\n </span>\n <span>\n <ng-content></ng-content>\n </span>\n</label>\n", styles: [".bb-checkbox{display:block}.bb-checkbox+.bb-checkbox{margin-top:5px}.bb-checkbox.grouped{margin-bottom:20px}.bb-checkbox-input{display:none}.bb-checkbox-label{margin:0;display:flex;cursor:pointer;-webkit-user-select:none;user-select:none}.bb-checkbox-label>span{display:inline-block;vertical-align:middle;transform:translate(0)}.bb-checkbox-label>span:first-child{width:18px;height:18px;min-width:18px;min-height:18px;position:relative;border-radius:3px;vertical-align:middle;border:1px solid #bdc4c9;transition:all .2s ease}.bb-checkbox-label>span:last-child{padding-left:8px}.bb-checkbox-label>span:first-child>svg{top:3px;left:2px;fill:none;stroke:#fff;stroke-width:2;position:absolute;stroke-linecap:round;transition-delay:.1s;stroke-linejoin:round;stroke-dasharray:16px;stroke-dashoffset:16px;transition:all .3s ease;transform:translate(0)}.bb-checkbox-input:not(:disabled):not(:checked)+.bb-checkbox-label:focus>span:first-child{box-shadow:0 0 0 3px #decdcd80}.bb-checkbox-input:not(:disabled):checked+.bb-checkbox-label:focus>span:first-child{box-shadow:0 0 0 3px #5b53ff80}.bb-checkbox-input:checked+.bb-checkbox-label>span:first-child{border-color:#5b53ff;background-color:#5b53ff}.bb-checkbox-input:checked+.bb-checkbox-label>span:first-child>svg{stroke-dashoffset:0}.bb-checkbox-input:disabled+.bb-checkbox-label{cursor:default;pointer-events:none}.bb-checkbox-input:disabled:checked+.bb-checkbox-label>span:first-child{border-color:#cccccca3;background-color:#cccccca3}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1541
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbCheckbox, decorators: [{
1542
+ type: Component,
1543
+ args: [{ selector: 'bb-checkbox', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
1544
+ { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BbCheckbox), multi: true }
1545
+ ], host: {
1546
+ 'class': 'bb-checkbox',
1547
+ '[class.grouped]': 'grouped'
1548
+ }, inputs: ['grouped', 'disabled'], preserveWhitespaces: false, template: "<input [id]=\"labelId\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n (change)=\"onInteractionEvent($event)\"\n (click)=\"onInputClick($event)\"\n class=\"bb-checkbox-input\"\n tabindex=\"-1\"\n type=\"checkbox\">\n\n<label [for]=\"labelId\"\n [attr.tabindex]=\"disabled ? -1 : (tabIndex || 0)\"\n (keyup.space)=\"onInputClick($event)\"\n class=\"bb-checkbox-label\">\n <span>\n <svg width=\"12px\"\n height=\"10px\"\n viewbox=\"0 0 12 10\">\n <polyline points=\"1.5 6 4.5 9 10.5 1\"></polyline>\n </svg>\n </span>\n <span>\n <ng-content></ng-content>\n </span>\n</label>\n", styles: [".bb-checkbox{display:block}.bb-checkbox+.bb-checkbox{margin-top:5px}.bb-checkbox.grouped{margin-bottom:20px}.bb-checkbox-input{display:none}.bb-checkbox-label{margin:0;display:flex;cursor:pointer;-webkit-user-select:none;user-select:none}.bb-checkbox-label>span{display:inline-block;vertical-align:middle;transform:translate(0)}.bb-checkbox-label>span:first-child{width:18px;height:18px;min-width:18px;min-height:18px;position:relative;border-radius:3px;vertical-align:middle;border:1px solid #bdc4c9;transition:all .2s ease}.bb-checkbox-label>span:last-child{padding-left:8px}.bb-checkbox-label>span:first-child>svg{top:3px;left:2px;fill:none;stroke:#fff;stroke-width:2;position:absolute;stroke-linecap:round;transition-delay:.1s;stroke-linejoin:round;stroke-dasharray:16px;stroke-dashoffset:16px;transition:all .3s ease;transform:translate(0)}.bb-checkbox-input:not(:disabled):not(:checked)+.bb-checkbox-label:focus>span:first-child{box-shadow:0 0 0 3px #decdcd80}.bb-checkbox-input:not(:disabled):checked+.bb-checkbox-label:focus>span:first-child{box-shadow:0 0 0 3px #5b53ff80}.bb-checkbox-input:checked+.bb-checkbox-label>span:first-child{border-color:#5b53ff;background-color:#5b53ff}.bb-checkbox-input:checked+.bb-checkbox-label>span:first-child>svg{stroke-dashoffset:0}.bb-checkbox-input:disabled+.bb-checkbox-label{cursor:default;pointer-events:none}.bb-checkbox-input:disabled:checked+.bb-checkbox-label>span:first-child{border-color:#cccccca3;background-color:#cccccca3}\n"] }]
1549
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { tabIndex: [{
1550
+ type: Input
1551
+ }], checked: [{
1552
+ type: Input
1553
+ }] } });
1554
+
1555
+ class BbFocus {
1556
+ constructor(_zone, _platform, _elementRef) {
1557
+ this._zone = _zone;
1558
+ this._platform = _platform;
1559
+ this._elementRef = _elementRef;
1560
+ }
1561
+ get nativeElement() {
1562
+ return this._elementRef.nativeElement;
1563
+ }
1564
+ ngAfterViewInit() {
1565
+ // Run the method outside the Angular zone.
1566
+ this._zone.runOutsideAngular(() => this.focus());
1567
+ }
1568
+ focus() {
1569
+ // Check if set timeout exists and the user is
1570
+ // using the site on desktop devices.
1571
+ if (!this._platform.isDesktop || !setTimeout) {
1572
+ return;
1573
+ }
1574
+ // Check if the element and the focus method exist, if so focus the element.
1575
+ if (!this.nativeElement || !this.nativeElement.focus) {
1576
+ return;
1577
+ }
1578
+ // Execute the focus method in a timeout.
1579
+ setTimeout(() => this.nativeElement.focus(), 0);
1580
+ }
1581
+ }
1582
+ BbFocus.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbFocus, deps: [{ token: i0.NgZone }, { token: i1$1.Platform }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
1583
+ BbFocus.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.0", type: BbFocus, selector: "[bbFocus]", ngImport: i0 });
1584
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbFocus, decorators: [{
1585
+ type: Directive,
1586
+ args: [{
1587
+ selector: '[bbFocus]'
1588
+ }]
1589
+ }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i1$1.Platform }, { type: i0.ElementRef }]; } });
1590
+
1591
+ class BbAvatar {
1592
+ constructor() {
1593
+ // Inputs.
1594
+ this.size = 40;
1595
+ // State.
1596
+ this.state$ = new BehaviorSubject('initials');
1597
+ // Data.
1598
+ this._src = null;
1599
+ this._title = null;
1600
+ this._initials = '!';
1601
+ this._color = 'rgb(255, 255, 255)';
1602
+ this._backgroundColor = 'rgb(66, 66, 66)';
1603
+ this.toRGb = (value) => {
1604
+ const baseRed = 128;
1605
+ const baseGreen = 128;
1606
+ const baseBlue = 128;
1607
+ let seed = value.charCodeAt(0) ^ value.charCodeAt(1);
1608
+ const rand_1 = Math.abs((Math.sin(seed++) * 10000)) % 256;
1609
+ const rand_2 = Math.abs((Math.sin(seed++) * 10000)) % 256;
1610
+ const rand_3 = Math.abs((Math.sin(seed++) * 10000)) % 256;
1611
+ const r = Math.round((rand_1 + baseRed) / 2);
1612
+ const g = Math.round((rand_2 + baseGreen) / 2);
1613
+ const b = Math.round((rand_3 + baseBlue) / 2);
1614
+ return { r, g, b };
1615
+ };
1616
+ this.getInitials = (name) => {
1617
+ // Get all the initials.
1618
+ const names = (name || '').split(' ');
1619
+ const initials = names.map(name => name.charAt(0).toUpperCase());
1620
+ // Check if there are any initials.
1621
+ if (initials.length <= 0) {
1622
+ return null;
1623
+ }
1624
+ // Get the first and last initials.
1625
+ if (initials.length > 1) {
1626
+ return `${initials[0]}${initials[initials.length - 1]}`;
1627
+ }
1628
+ // Get only the first initial.
1629
+ return initials[0];
1630
+ };
1631
+ this.parseColorFormat = (value) => {
1632
+ // Hex 3 values.
1633
+ let match = value.match(/^#([0-9a-f]{3})$/i);
1634
+ if (match && match[1]) {
1635
+ const r = parseInt(match[1].charAt(0), 16) * 0x11;
1636
+ const g = parseInt(match[1].charAt(1), 16) * 0x11;
1637
+ const b = parseInt(match[1].charAt(2), 16) * 0x11;
1638
+ return { r, g, b };
1639
+ }
1640
+ // Hex 6 values.
1641
+ match = value.match(/^#([0-9a-f]{6})$/i);
1642
+ if (match && match[1]) {
1643
+ const r = parseInt(match[1].substr(0, 2), 16);
1644
+ const g = parseInt(match[1].substr(2, 2), 16);
1645
+ const b = parseInt(match[1].substr(4, 2), 16);
1646
+ return { r, g, b };
1647
+ }
1648
+ // Rgb values.
1649
+ match = value.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);
1650
+ if (match) {
1651
+ const r = parseInt(match[1], 10);
1652
+ const g = parseInt(match[2], 10);
1653
+ const b = parseInt(match[3], 10);
1654
+ return { r, g, b };
1655
+ }
1656
+ // Not a supported color format.
1657
+ console?.warn?.(`BbAvatar: Unsupported tintColor "${value}" was used.`);
1658
+ return null;
1659
+ };
1660
+ }
1661
+ set src(value) {
1662
+ this._src = value;
1663
+ if (this._src) {
1664
+ this.state$.next('image');
1665
+ }
1666
+ }
1667
+ set title(value) {
1668
+ // Set the title and the initials.
1669
+ this._title = value || '!';
1670
+ this._initials = this.getInitials(this._title);
1671
+ // Generate the colors based on the name.
1672
+ const { r, g, b } = this.toRGb(this._title);
1673
+ this.setColors(r, g, b);
1674
+ }
1675
+ set tintColor(value) {
1676
+ const result = this.parseColorFormat(value);
1677
+ if (!result) {
1678
+ return;
1679
+ }
1680
+ const { r, g, b } = result;
1681
+ this.setColors(r, g, b);
1682
+ }
1683
+ get src() {
1684
+ return this._src;
1685
+ }
1686
+ get color() {
1687
+ return this._color;
1688
+ }
1689
+ get backgroundColor() {
1690
+ return this._backgroundColor;
1691
+ }
1692
+ get title() {
1693
+ return this._title;
1694
+ }
1695
+ get initials() {
1696
+ return this._initials;
1697
+ }
1698
+ setColors(red, green, blue) {
1699
+ this._color = `rgb(${red},${green},${blue})`;
1700
+ this._backgroundColor = `rgba(${red},${green},${blue}, 0.25)`;
1701
+ }
1702
+ }
1703
+ BbAvatar.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbAvatar, deps: [], target: i0.ɵɵFactoryTarget.Component });
1704
+ BbAvatar.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.0", type: BbAvatar, selector: "bb-avatar", inputs: { size: "size", src: "src", title: "title", tintColor: "tintColor" }, host: { attributes: { "role": "img" }, properties: { "style.width.px": "size", "style.height.px": "size", "style.font-size.px": "size / 2", "style.color": "color", "style.background-color": "backgroundColor", "attr.title": "this.title" }, classAttribute: "bb-avatar" }, ngImport: i0, template: "<ng-container [ngSwitch]=\"state$ | async\">\n <!-- Image. -->\n <ng-container *ngSwitchCase=\"'image'\">\n <img [src]=\"src\"\n [alt]=\"initials\"\n (error)=\"state$?.next('initials')\"\n class=\"bb-avatar-image\">\n </ng-container>\n\n <!-- Default initials fallback. -->\n <ng-container *ngSwitchDefault>\n {{ initials }}\n </ng-container>\n</ng-container>\n", styles: [".bb-avatar{line-height:1;font-size:18px;overflow:hidden;font-weight:500;-webkit-user-select:none;user-select:none;position:relative;border-radius:50%;align-items:center;display:inline-flex;justify-content:center}.bb-avatar.rounded{border-radius:4px}.bb-avatar.square{border-radius:0}.bb-avatar-image{width:100%;height:100%;object-fit:cover;position:absolute}\n"], directives: [{ type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }], pipes: { "async": i1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1705
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbAvatar, decorators: [{
1706
+ type: Component,
1707
+ args: [{ selector: 'bb-avatar', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, host: {
1708
+ 'class': 'bb-avatar',
1709
+ 'role': 'img',
1710
+ '[style.width.px]': 'size',
1711
+ '[style.height.px]': 'size',
1712
+ '[style.font-size.px]': 'size / 2',
1713
+ '[style.color]': 'color',
1714
+ '[style.background-color]': 'backgroundColor'
1715
+ }, template: "<ng-container [ngSwitch]=\"state$ | async\">\n <!-- Image. -->\n <ng-container *ngSwitchCase=\"'image'\">\n <img [src]=\"src\"\n [alt]=\"initials\"\n (error)=\"state$?.next('initials')\"\n class=\"bb-avatar-image\">\n </ng-container>\n\n <!-- Default initials fallback. -->\n <ng-container *ngSwitchDefault>\n {{ initials }}\n </ng-container>\n</ng-container>\n", styles: [".bb-avatar{line-height:1;font-size:18px;overflow:hidden;font-weight:500;-webkit-user-select:none;user-select:none;position:relative;border-radius:50%;align-items:center;display:inline-flex;justify-content:center}.bb-avatar.rounded{border-radius:4px}.bb-avatar.square{border-radius:0}.bb-avatar-image{width:100%;height:100%;object-fit:cover;position:absolute}\n"] }]
1716
+ }], propDecorators: { size: [{
1717
+ type: Input
1718
+ }], src: [{
1719
+ type: Input
1720
+ }], title: [{
1721
+ type: Input
1722
+ }, {
1723
+ type: HostBinding,
1724
+ args: ['attr.title']
1725
+ }], tintColor: [{
1726
+ type: Input
1727
+ }] } });
1728
+
1729
+ class BbIcon {
1730
+ constructor(_registry) {
1731
+ this._registry = _registry;
1732
+ // Data.
1733
+ this._src = null;
1734
+ // State.
1735
+ this.state$ = new BehaviorSubject(null);
1736
+ this.alt = null;
1737
+ this.size = 24;
1738
+ this._ariaHidden = true;
1739
+ this.warn = (content) => {
1740
+ return console && console.warn && console.warn(content);
1741
+ };
1742
+ }
1743
+ set src(newValue) {
1744
+ this.state$.next(this.convert(newValue));
1745
+ this._src = newValue;
1746
+ }
1747
+ get src() {
1748
+ return this._src;
1749
+ }
1750
+ set ariaHidden(newValue) {
1751
+ this._ariaHidden = coerceBooleanProperty(newValue);
1752
+ }
1753
+ get ariaHidden() {
1754
+ return this._ariaHidden;
1755
+ }
1756
+ convert(src) {
1757
+ const [namespace, value] = (src || '').split(':');
1758
+ const onError = () => {
1759
+ this.warn(`ElementsModule: The icon with src "${src}" could not be rendered correctly; Did you put a correct src attribute?`);
1760
+ return { type: 'unknown' };
1761
+ };
1762
+ if (!namespace || !value || !this._registry) {
1763
+ return onError();
1764
+ }
1765
+ // Try to find a image icon.
1766
+ const imageIcon = this.findImageIcon(namespace, value);
1767
+ if (imageIcon) {
1768
+ return imageIcon;
1769
+ }
1770
+ // Try to find a font icon.
1771
+ const fontIcon = this.findFontIcon(namespace, value);
1772
+ if (fontIcon) {
1773
+ return fontIcon;
1774
+ }
1775
+ // Return the on error function.
1776
+ return onError();
1777
+ }
1778
+ findImageIcon(namespace, value) {
1779
+ const data = this._registry.find(item => item['namespace'] === namespace && item['name'] === value);
1780
+ if (!data) {
1781
+ return null;
1782
+ }
1783
+ return { type: data['type'], src: data['src'] };
1784
+ }
1785
+ findFontIcon(namespace, content) {
1786
+ const data = this._registry.find(item => item['namespace'] === namespace);
1787
+ if (!data) {
1788
+ return null;
1789
+ }
1790
+ const uses = data['uses'];
1791
+ if (uses === 'data-attribute') {
1792
+ return { type: data['type'], className: data['className'], attribute: content };
1793
+ }
1794
+ return { type: data['type'], className: data['className'], content };
1795
+ }
1796
+ }
1797
+ BbIcon.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbIcon, deps: [{ token: ELEMENTS_ICONS, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1798
+ BbIcon.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.0", type: BbIcon, selector: "bb-icon", inputs: { alt: "alt", size: "size", src: "src", ariaHidden: "ariaHidden" }, host: { properties: { "attr.aria-hidden": "ariaHidden", "style.width.px": "size", "style.height.px": "size", "style.min-width.px": "size", "style.min-height.px": "size", "style.font-size.px": "size" }, classAttribute: "bb-icon" }, ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as data\"\n [ngSwitch]=\"data?.type\">\n <i *ngSwitchCase=\"'font'\"\n [attr.data-icon]=\"data?.attribute\"\n [class]=\"data?.className\">\n {{ data?.content }}\n </i>\n <img *ngSwitchCase=\"'image'\"\n [src]=\"data?.src\"\n [alt]=\"alt\">\n <svg *ngSwitchCase=\"'unknown'\"\n viewBox=\"0 0 1 1\">\n <rect x=\"0\" y=\"0\" width=\"1\" height=\"1\" fill=\"#c5c5c5\"></rect>\n </svg>\n</ng-container>\n", styles: [".bb-icon{display:flex;-webkit-user-select:none;user-select:none;align-items:center;justify-content:center}.bb-icon>i{font-size:inherit}.bb-icon>img,.bb-icon>svg{width:100%;height:100%;display:flex}\n"], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], pipes: { "async": i1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1799
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbIcon, decorators: [{
1800
+ type: Component,
1801
+ args: [{ selector: 'bb-icon', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
1802
+ 'class': 'bb-icon',
1803
+ '[attr.aria-hidden]': 'ariaHidden',
1804
+ '[style.width.px]': 'size',
1805
+ '[style.height.px]': 'size',
1806
+ '[style.min-width.px]': 'size',
1807
+ '[style.min-height.px]': 'size',
1808
+ '[style.font-size.px]': 'size'
1809
+ }, preserveWhitespaces: false, template: "<ng-container *ngIf=\"state$ | async as data\"\n [ngSwitch]=\"data?.type\">\n <i *ngSwitchCase=\"'font'\"\n [attr.data-icon]=\"data?.attribute\"\n [class]=\"data?.className\">\n {{ data?.content }}\n </i>\n <img *ngSwitchCase=\"'image'\"\n [src]=\"data?.src\"\n [alt]=\"alt\">\n <svg *ngSwitchCase=\"'unknown'\"\n viewBox=\"0 0 1 1\">\n <rect x=\"0\" y=\"0\" width=\"1\" height=\"1\" fill=\"#c5c5c5\"></rect>\n </svg>\n</ng-container>\n", styles: [".bb-icon{display:flex;-webkit-user-select:none;user-select:none;align-items:center;justify-content:center}.bb-icon>i{font-size:inherit}.bb-icon>img,.bb-icon>svg{width:100%;height:100%;display:flex}\n"] }]
1810
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1811
+ type: Optional
1812
+ }, {
1813
+ type: Inject,
1814
+ args: [ELEMENTS_ICONS]
1815
+ }] }]; }, propDecorators: { alt: [{
1816
+ type: Input
1817
+ }], size: [{
1818
+ type: Input
1819
+ }], src: [{
1820
+ type: Input
1821
+ }], ariaHidden: [{
1822
+ type: Input
1823
+ }] } });
1824
+
1825
+ class BbTag {
1826
+ constructor() {
1827
+ // Outputs.
1828
+ this.onClose = new EventEmitter();
1829
+ }
1830
+ }
1831
+ BbTag.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbTag, deps: [], target: i0.ɵɵFactoryTarget.Component });
1832
+ BbTag.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.0", type: BbTag, selector: "bb-tag", outputs: { onClose: "onClose" }, host: { classAttribute: "bb-tag" }, ngImport: i0, template: "<ng-content></ng-content>\n\n<button *ngIf=\"onClose?.observers?.length > 0\"\n (click)=\"onClose.emit()\"\n type=\"button\">\n Close\n</button>", styles: [".bb-tag{cursor:default;padding:0 7px;font-size:12px;list-style:none;line-height:20px;border-radius:4px;white-space:nowrap;display:inline-block;color:#000000a6;border:1px solid #d9d9d9;background-color:#fafafa;font-variant:tabular-nums;font-feature-settings:\"tnum\"}.bb-tag:not(:last-child){margin-right:8px}\n"], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1833
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbTag, decorators: [{
1834
+ type: Component,
1835
+ args: [{ selector: 'bb-tag', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, host: { 'class': 'bb-tag' }, template: "<ng-content></ng-content>\n\n<button *ngIf=\"onClose?.observers?.length > 0\"\n (click)=\"onClose.emit()\"\n type=\"button\">\n Close\n</button>", styles: [".bb-tag{cursor:default;padding:0 7px;font-size:12px;list-style:none;line-height:20px;border-radius:4px;white-space:nowrap;display:inline-block;color:#000000a6;border:1px solid #d9d9d9;background-color:#fafafa;font-variant:tabular-nums;font-feature-settings:\"tnum\"}.bb-tag:not(:last-child){margin-right:8px}\n"] }]
1836
+ }], propDecorators: { onClose: [{
1837
+ type: Output
1838
+ }] } });
1839
+
1840
+ const DECLARATIONS_EXPORTS = [
1841
+ // Directives.
1842
+ BbTemplate,
1843
+ BbFormError,
1844
+ BbFormSubmit,
1845
+ BbInput,
1846
+ BbSelect,
1847
+ BbFocus,
1848
+ BbFocusTrap,
1849
+ BbAutosize,
1850
+ BbPrefix,
1851
+ BbSuffix,
1852
+ // Pipes.
1853
+ BbFileSize,
1854
+ BbFileImage,
1855
+ BbRelativeTime,
1856
+ // Components.
1857
+ BbButton,
1858
+ BbAnchor,
1859
+ BbSpinner,
1860
+ BbIcon,
1861
+ BbFormControl,
1862
+ BbFormGroup,
1863
+ BbCheckbox,
1864
+ BbDropdown,
1865
+ BbDropdownItem,
1866
+ BbTag,
1867
+ BbAvatar,
1868
+ BbFilePicker,
1869
+ BbImagePicker,
1870
+ BbDatePicker
1871
+ ];
1872
+ class ElementsModule {
1873
+ static forRoot() {
1874
+ return {
1875
+ ngModule: ElementsModule,
1876
+ providers: [
1877
+ { provide: ELEMENTS_ERRORS, useFactory: getErrors, multi: true },
1878
+ ELEMENTS_MATERIAL_ICON
1879
+ ]
1880
+ };
1881
+ }
1882
+ }
1883
+ ElementsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: ElementsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1884
+ ElementsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: ElementsModule, declarations: [
1885
+ // Directives.
1886
+ BbTemplate,
1887
+ BbFormError,
1888
+ BbFormSubmit,
1889
+ BbInput,
1890
+ BbSelect,
1891
+ BbFocus,
1892
+ BbFocusTrap,
1893
+ BbAutosize,
1894
+ BbPrefix,
1895
+ BbSuffix,
1896
+ // Pipes.
1897
+ BbFileSize,
1898
+ BbFileImage,
1899
+ BbRelativeTime,
1900
+ // Components.
1901
+ BbButton,
1902
+ BbAnchor,
1903
+ BbSpinner,
1904
+ BbIcon,
1905
+ BbFormControl,
1906
+ BbFormGroup,
1907
+ BbCheckbox,
1908
+ BbDropdown,
1909
+ BbDropdownItem,
1910
+ BbTag,
1911
+ BbAvatar,
1912
+ BbFilePicker,
1913
+ BbImagePicker,
1914
+ BbDatePicker], imports: [CommonModule, ReactiveFormsModule, LocalizeModule], exports: [
1915
+ // Directives.
1916
+ BbTemplate,
1917
+ BbFormError,
1918
+ BbFormSubmit,
1919
+ BbInput,
1920
+ BbSelect,
1921
+ BbFocus,
1922
+ BbFocusTrap,
1923
+ BbAutosize,
1924
+ BbPrefix,
1925
+ BbSuffix,
1926
+ // Pipes.
1927
+ BbFileSize,
1928
+ BbFileImage,
1929
+ BbRelativeTime,
1930
+ // Components.
1931
+ BbButton,
1932
+ BbAnchor,
1933
+ BbSpinner,
1934
+ BbIcon,
1935
+ BbFormControl,
1936
+ BbFormGroup,
1937
+ BbCheckbox,
1938
+ BbDropdown,
1939
+ BbDropdownItem,
1940
+ BbTag,
1941
+ BbAvatar,
1942
+ BbFilePicker,
1943
+ BbImagePicker,
1944
+ BbDatePicker] });
1945
+ ElementsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: ElementsModule, imports: [[CommonModule, ReactiveFormsModule, LocalizeModule]] });
1946
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: ElementsModule, decorators: [{
1947
+ type: NgModule,
1948
+ args: [{
1949
+ imports: [CommonModule, ReactiveFormsModule, LocalizeModule],
1950
+ declarations: [...DECLARATIONS_EXPORTS],
1951
+ exports: [...DECLARATIONS_EXPORTS]
1952
+ }]
1953
+ }] });
1954
+ const ELEMENTS_MATERIAL_ICON = {
1955
+ provide: ELEMENTS_ICONS,
1956
+ useValue: { namespace: 'material', className: 'material-icons', uses: 'content', type: 'font' },
1957
+ multi: true
1958
+ };
1959
+ function getErrors() {
1960
+ const data = {
1961
+ unknown: () => 'form-control-errors.unknown',
1962
+ required: () => 'form-control-errors.required',
1963
+ pattern: () => 'form-control-errors.pattern',
1964
+ email: () => 'form-control-errors.email',
1965
+ emailTaken: () => 'form-control-errors.emailTaken',
1966
+ passwordMatch: () => 'form-control-errors.passwordMatch',
1967
+ confirm: () => 'form-control-errors.confirm',
1968
+ fullNumber: () => 'form-control-errors.fullNumber',
1969
+ min: ({ min }) => ({ token: 'form-control-errors.min', data: { min } }),
1970
+ max: ({ max }) => ({ token: 'form-control-errors.max', data: { max } }),
1971
+ maxFileSize: ({ maxSize }) => ({ token: 'form-control-errors.maxFileSize', data: { maxSize } }),
1972
+ minDate: ({ date }) => ({ token: 'form-control-errors.minDate', data: { date } }),
1973
+ maxDate: ({ date }) => ({ token: 'form-control-errors.maxDate', data: { date } }),
1974
+ invalidDate: () => 'form-control-errors.invalidDate',
1975
+ invalidFileType: () => 'form-control-errors.invalidFileType',
1976
+ minlength: ({ requiredLength, actualLength }) => ({
1977
+ token: 'form-control-errors.minlength',
1978
+ data: { requiredLength, actualLength }
1979
+ }),
1980
+ maxlength: ({ requiredLength, actualLength }) => ({
1981
+ token: 'form-control-errors.maxlength',
1982
+ data: { requiredLength, actualLength }
1983
+ })
1984
+ };
1985
+ return data;
1986
+ }
1987
+
1988
+ /**
1989
+ * Generated bundle index. Do not edit.
1990
+ */
1991
+
1992
+ export { BbAnchor, BbAutosize, BbAvatar, BbButton, BbCheckbox, BbDatePicker, BbDropdown, BbDropdownItem, BbFileImage, BbFilePicker, BbFileSize, BbFocus, BbFocusTrap, BbFormControl, BbFormError, BbFormGroup, BbFormSubmit, BbIcon, BbImagePicker, BbInput, BbPrefix, BbRelativeTime, BbSelect, BbSpinner, BbSuffix, BbTag, BbTemplate, ELEMENTS_ERRORS, ELEMENTS_ICONS, ELEMENTS_MATERIAL_ICON, ElementsModule, getErrors };
1993
+ //# sourceMappingURL=bravobit-bb-foundation-elements.mjs.map