@bravobit/bb-foundation 0.32.1 → 0.40.0

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