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