@bravobit/bb-foundation 0.16.3 → 0.20.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 (426) hide show
  1. package/README.md +47 -47
  2. package/auth/bravobit-bb-foundation-auth.d.ts +5 -5
  3. package/auth/lib/auth.interceptor.d.ts +21 -21
  4. package/auth/lib/auth.module.d.ts +15 -15
  5. package/auth/lib/auth.service.d.ts +59 -59
  6. package/auth/lib/auth.session.d.ts +34 -34
  7. package/auth/lib/directives/authenticated.directive.d.ts +14 -14
  8. package/auth/lib/directives/permission.directive.d.ts +24 -24
  9. package/auth/lib/directives/role.directive.d.ts +16 -16
  10. package/auth/lib/guards/anonymous.guard.d.ts +11 -11
  11. package/auth/lib/guards/authenticated.guard.d.ts +11 -11
  12. package/auth/lib/helpers/jwt.helper.d.ts +8 -8
  13. package/auth/lib/helpers/mapper.helper.d.ts +23 -23
  14. package/auth/lib/interfaces/config.interface.d.ts +12 -12
  15. package/auth/lib/interfaces/mapper.interface.d.ts +19 -19
  16. package/auth/lib/interfaces/provider.interface.d.ts +16 -16
  17. package/auth/lib/interfaces/token.interface.d.ts +11 -11
  18. package/auth/lib/permissions.service.d.ts +14 -14
  19. package/auth/lib/providers/email.provider.d.ts +15 -15
  20. package/auth/lib/providers/verify.provider.d.ts +13 -13
  21. package/auth/lib/tokens/use-authorization.token.d.ts +2 -2
  22. package/auth/public_api.d.ts +18 -18
  23. package/bravobit-bb-foundation.d.ts +5 -5
  24. package/collections/bravobit-bb-foundation-collections.d.ts +5 -5
  25. package/collections/lib/collection.d.ts +43 -43
  26. package/collections/lib/collections.module.d.ts +10 -10
  27. package/collections/lib/components/collections-pager/collections-pager.component.d.ts +34 -34
  28. package/collections/lib/components/collections-viewer/collections-viewer.component.d.ts +12 -12
  29. package/collections/lib/components/collections.directive.d.ts +17 -17
  30. package/collections/lib/interfaces/collection.interface.d.ts +26 -26
  31. package/collections/lib/providers/api-collection.provider.d.ts +17 -15
  32. package/collections/lib/providers/collection.provider.d.ts +6 -6
  33. package/collections/lib/providers/local-collection.provider.d.ts +8 -8
  34. package/collections/public_api.d.ts +9 -9
  35. package/controls/bravobit-bb-foundation-controls.d.ts +5 -5
  36. package/controls/lib/checkbox/checkbox/checkbox.component.d.ts +47 -47
  37. package/controls/lib/checkbox/checkbox-group/checkbox-group.component.d.ts +18 -18
  38. package/controls/lib/checkbox/checkbox.module.d.ts +9 -9
  39. package/controls/lib/controls.module.d.ts +7 -7
  40. package/controls/public_api.d.ts +4 -4
  41. package/dashboard/bravobit-bb-foundation-dashboard.d.ts +5 -5
  42. package/dashboard/lib/dashboard/dashboard.component.d.ts +19 -19
  43. package/dashboard/lib/dashboard-header/dashboard-header.component.d.ts +11 -11
  44. package/dashboard/lib/dashboard-menu/dashboard-menu.component.d.ts +9 -9
  45. package/dashboard/lib/dashboard-menu-item/dashboard-menu-item.component.d.ts +11 -11
  46. package/dashboard/lib/dashboard-sidebar/dashboard-sidebar.component.d.ts +21 -21
  47. package/dashboard/lib/dashboard-sidebar-group/dashboard-sidebar-group.component.d.ts +27 -27
  48. package/dashboard/lib/dashboard-sidebar-item/dashboard-sidebar-item.component.d.ts +16 -16
  49. package/dashboard/lib/dashboard.module.d.ts +16 -16
  50. package/dashboard/public_api.d.ts +8 -8
  51. package/dialog/bravobit-bb-foundation-dialog.d.ts +5 -5
  52. package/dialog/lib/dialog-actions/dialog-actions.component.d.ts +5 -5
  53. package/dialog/lib/dialog-confirm/dialog-confirm.component.d.ts +16 -16
  54. package/dialog/lib/dialog-container/dialog-container.component.d.ts +24 -24
  55. package/dialog/lib/dialog-header/dialog-header.component.d.ts +9 -9
  56. package/dialog/lib/dialog-link/dialog-link.component.d.ts +5 -5
  57. package/dialog/lib/dialog-modal/dialog-modal.component.d.ts +12 -12
  58. package/dialog/lib/dialog-overlay/dialog-overlay.component.d.ts +22 -22
  59. package/dialog/lib/dialog.injector.d.ts +8 -8
  60. package/dialog/lib/dialog.insertion.d.ts +8 -8
  61. package/dialog/lib/dialog.interfaces.d.ts +3 -3
  62. package/dialog/lib/dialog.module.d.ts +19 -19
  63. package/dialog/lib/dialog.ref.d.ts +8 -8
  64. package/dialog/lib/dialog.service.d.ts +19 -19
  65. package/dialog/public_api.d.ts +9 -9
  66. package/elements/bravobit-bb-foundation-elements.d.ts +5 -5
  67. package/elements/lib/avatar/avatar.component.d.ts +25 -25
  68. package/elements/lib/button/button.component.d.ts +23 -23
  69. package/elements/lib/checkbox/checkbox.component.d.ts +27 -27
  70. package/elements/lib/date-picker/date-picker.component.d.ts +69 -69
  71. package/elements/lib/directives/addon.directive.d.ts +9 -9
  72. package/elements/lib/directives/autosize.directive.d.ts +18 -18
  73. package/elements/lib/directives/focus-trap.directive.d.ts +17 -17
  74. package/elements/lib/directives/focus.directive.d.ts +14 -14
  75. package/elements/lib/directives/form-submit.directive.d.ts +17 -17
  76. package/elements/lib/directives/input.directive.d.ts +38 -38
  77. package/elements/lib/directives/template.directive.d.ts +10 -10
  78. package/elements/lib/dropdown/dropdown.component.d.ts +21 -21
  79. package/elements/lib/elements.interfaces.d.ts +25 -25
  80. package/elements/lib/elements.module.d.ts +116 -116
  81. package/elements/lib/file-picker/file-picker.component.d.ts +49 -49
  82. package/elements/lib/form-control/form-control.component.d.ts +21 -21
  83. package/elements/lib/form-error/form-error.component.d.ts +29 -29
  84. package/elements/lib/form-group/form-group.component.d.ts +10 -10
  85. package/elements/lib/icon/icon.component.d.ts +22 -22
  86. package/elements/lib/image-picker/image-picker.component.d.ts +38 -38
  87. package/elements/lib/pipes/file-image.pipe.d.ts +13 -13
  88. package/elements/lib/pipes/file-size.pipe.d.ts +8 -8
  89. package/elements/lib/pipes/relative-time.pipe.d.ts +19 -19
  90. package/elements/lib/spinner/spinner.component.d.ts +12 -12
  91. package/elements/lib/tag/tag.component.d.ts +7 -7
  92. package/elements/public_api.d.ts +25 -25
  93. package/esm2020/auth/bravobit-bb-foundation-auth.mjs +4 -4
  94. package/esm2020/auth/lib/auth.interceptor.mjs +93 -94
  95. package/esm2020/auth/lib/auth.module.mjs +54 -54
  96. package/esm2020/auth/lib/auth.service.mjs +281 -276
  97. package/esm2020/auth/lib/auth.session.mjs +131 -131
  98. package/esm2020/auth/lib/directives/authenticated.directive.mjs +31 -31
  99. package/esm2020/auth/lib/directives/permission.directive.mjs +80 -80
  100. package/esm2020/auth/lib/directives/role.directive.mjs +37 -37
  101. package/esm2020/auth/lib/guards/anonymous.guard.mjs +34 -34
  102. package/esm2020/auth/lib/guards/authenticated.guard.mjs +35 -35
  103. package/esm2020/auth/lib/helpers/jwt.helper.mjs +69 -69
  104. package/esm2020/auth/lib/helpers/mapper.helper.mjs +35 -35
  105. package/esm2020/auth/lib/interfaces/config.interface.mjs +3 -3
  106. package/esm2020/auth/lib/interfaces/mapper.interface.mjs +2 -2
  107. package/esm2020/auth/lib/interfaces/provider.interface.mjs +2 -2
  108. package/esm2020/auth/lib/interfaces/token.interface.mjs +2 -2
  109. package/esm2020/auth/lib/permissions.service.mjs +56 -56
  110. package/esm2020/auth/lib/providers/email.provider.mjs +25 -25
  111. package/esm2020/auth/lib/providers/verify.provider.mjs +19 -19
  112. package/esm2020/auth/lib/tokens/use-authorization.token.mjs +3 -3
  113. package/esm2020/auth/public_api.mjs +19 -19
  114. package/esm2020/bravobit-bb-foundation.mjs +4 -4
  115. package/esm2020/collections/bravobit-bb-foundation-collections.mjs +4 -4
  116. package/esm2020/collections/lib/collection.mjs +102 -102
  117. package/esm2020/collections/lib/collections.module.mjs +54 -54
  118. package/esm2020/collections/lib/components/collections-pager/collections-pager.component.mjs +123 -123
  119. package/esm2020/collections/lib/components/collections-viewer/collections-viewer.component.mjs +31 -31
  120. package/esm2020/collections/lib/components/collections.directive.mjs +43 -43
  121. package/esm2020/collections/lib/interfaces/collection.interface.mjs +2 -2
  122. package/esm2020/collections/lib/providers/api-collection.provider.mjs +71 -71
  123. package/esm2020/collections/lib/providers/collection.provider.mjs +13 -13
  124. package/esm2020/collections/lib/providers/local-collection.provider.mjs +16 -16
  125. package/esm2020/collections/public_api.mjs +10 -10
  126. package/esm2020/controls/bravobit-bb-foundation-controls.mjs +4 -4
  127. package/esm2020/controls/lib/checkbox/checkbox/checkbox.component.mjs +153 -153
  128. package/esm2020/controls/lib/checkbox/checkbox-group/checkbox-group.component.mjs +48 -48
  129. package/esm2020/controls/lib/checkbox/checkbox.module.mjs +19 -19
  130. package/esm2020/controls/lib/controls.module.mjs +16 -16
  131. package/esm2020/controls/public_api.mjs +5 -5
  132. package/esm2020/dashboard/bravobit-bb-foundation-dashboard.mjs +4 -4
  133. package/esm2020/dashboard/lib/dashboard/dashboard.component.mjs +56 -56
  134. package/esm2020/dashboard/lib/dashboard-header/dashboard-header.component.mjs +30 -30
  135. package/esm2020/dashboard/lib/dashboard-menu/dashboard-menu.component.mjs +31 -31
  136. package/esm2020/dashboard/lib/dashboard-menu-item/dashboard-menu-item.component.mjs +29 -29
  137. package/esm2020/dashboard/lib/dashboard-sidebar/dashboard-sidebar.component.mjs +75 -75
  138. package/esm2020/dashboard/lib/dashboard-sidebar-group/dashboard-sidebar-group.component.mjs +99 -99
  139. package/esm2020/dashboard/lib/dashboard-sidebar-item/dashboard-sidebar-item.component.mjs +62 -62
  140. package/esm2020/dashboard/lib/dashboard.module.mjs +47 -47
  141. package/esm2020/dashboard/public_api.mjs +9 -9
  142. package/esm2020/dialog/bravobit-bb-foundation-dialog.mjs +4 -4
  143. package/esm2020/dialog/lib/dialog-actions/dialog-actions.component.mjs +12 -12
  144. package/esm2020/dialog/lib/dialog-confirm/dialog-confirm.component.mjs +37 -37
  145. package/esm2020/dialog/lib/dialog-container/dialog-container.component.mjs +153 -153
  146. package/esm2020/dialog/lib/dialog-header/dialog-header.component.mjs +25 -25
  147. package/esm2020/dialog/lib/dialog-link/dialog-link.component.mjs +11 -11
  148. package/esm2020/dialog/lib/dialog-modal/dialog-modal.component.mjs +46 -46
  149. package/esm2020/dialog/lib/dialog-overlay/dialog-overlay.component.mjs +134 -134
  150. package/esm2020/dialog/lib/dialog.injector.mjs +18 -18
  151. package/esm2020/dialog/lib/dialog.insertion.mjs +16 -16
  152. package/esm2020/dialog/lib/dialog.interfaces.mjs +3 -3
  153. package/esm2020/dialog/lib/dialog.module.mjs +70 -70
  154. package/esm2020/dialog/lib/dialog.ref.mjs +22 -22
  155. package/esm2020/dialog/lib/dialog.service.mjs +77 -77
  156. package/esm2020/dialog/public_api.mjs +10 -10
  157. package/esm2020/elements/bravobit-bb-foundation-elements.mjs +4 -4
  158. package/esm2020/elements/lib/avatar/avatar.component.mjs +145 -142
  159. package/esm2020/elements/lib/button/button.component.mjs +61 -61
  160. package/esm2020/elements/lib/checkbox/checkbox.component.mjs +73 -73
  161. package/esm2020/elements/lib/date-picker/date-picker.component.mjs +304 -304
  162. package/esm2020/elements/lib/directives/addon.directive.mjs +29 -29
  163. package/esm2020/elements/lib/directives/autosize.directive.mjs +72 -72
  164. package/esm2020/elements/lib/directives/focus-trap.directive.mjs +77 -77
  165. package/esm2020/elements/lib/directives/focus.directive.mjs +39 -39
  166. package/esm2020/elements/lib/directives/form-submit.directive.mjs +50 -50
  167. package/esm2020/elements/lib/directives/input.directive.mjs +136 -136
  168. package/esm2020/elements/lib/directives/template.directive.mjs +28 -28
  169. package/esm2020/elements/lib/dropdown/dropdown.component.mjs +100 -100
  170. package/esm2020/elements/lib/elements.interfaces.mjs +4 -4
  171. package/esm2020/elements/lib/elements.module.mjs +177 -177
  172. package/esm2020/elements/lib/file-picker/file-picker.component.mjs +236 -236
  173. package/esm2020/elements/lib/form-control/form-control.component.mjs +49 -49
  174. package/esm2020/elements/lib/form-error/form-error.component.mjs +108 -108
  175. package/esm2020/elements/lib/form-group/form-group.component.mjs +18 -18
  176. package/esm2020/elements/lib/icon/icon.component.mjs +102 -102
  177. package/esm2020/elements/lib/image-picker/image-picker.component.mjs +106 -106
  178. package/esm2020/elements/lib/pipes/file-image.pipe.mjs +42 -42
  179. package/esm2020/elements/lib/pipes/file-size.pipe.mjs +28 -28
  180. package/esm2020/elements/lib/pipes/relative-time.pipe.mjs +94 -94
  181. package/esm2020/elements/lib/spinner/spinner.component.mjs +25 -25
  182. package/esm2020/elements/lib/tag/tag.component.mjs +18 -18
  183. package/esm2020/elements/public_api.mjs +26 -26
  184. package/esm2020/http/bravobit-bb-foundation-http.mjs +4 -4
  185. package/esm2020/http/lib/classes/http.config.mjs +29 -29
  186. package/esm2020/http/lib/classes/http.error.mjs +20 -20
  187. package/esm2020/http/lib/http.interfaces.mjs +2 -2
  188. package/esm2020/http/lib/http.module.mjs +43 -43
  189. package/esm2020/http/lib/interceptors/base-url.interceptor.mjs +50 -50
  190. package/esm2020/http/lib/interceptors/error.interceptor.mjs +32 -32
  191. package/esm2020/http/public_api.mjs +7 -7
  192. package/esm2020/lib/core/miscellaneous/regex.mjs +5 -5
  193. package/esm2020/lib/core/miscellaneous/validator.mjs +85 -85
  194. package/esm2020/lib/core/mixins/can-disable.mjs +16 -16
  195. package/esm2020/lib/core/mixins/can-hide-errors.mjs +16 -16
  196. package/esm2020/lib/core/mixins/can-load.mjs +16 -16
  197. package/esm2020/lib/core/mixins/constructor.mjs +2 -2
  198. package/esm2020/lib/core/mixins/has-error.mjs +16 -16
  199. package/esm2020/lib/core/mixins/is-focused.mjs +16 -16
  200. package/esm2020/lib/core/mixins/is-grouped.mjs +16 -16
  201. package/esm2020/lib/core/mixins/is-readonly.mjs +16 -16
  202. package/esm2020/lib/core/mixins/is-required.mjs +16 -16
  203. package/esm2020/lib/core/services/clipboard.service.mjs +70 -70
  204. package/esm2020/lib/core/services/exif.service.mjs +163 -163
  205. package/esm2020/lib/core/services/file-loader.service.mjs +87 -87
  206. package/esm2020/lib/core/services/image-converter.service.mjs +123 -123
  207. package/esm2020/lib/core/services/languages.service.mjs +74 -74
  208. package/esm2020/lib/core/services/network.service.mjs +55 -55
  209. package/esm2020/lib/core/services/patch.service.mjs +63 -63
  210. package/esm2020/lib/core/services/platform.service.mjs +42 -42
  211. package/esm2020/lib/core/tokens/accept-language.token.mjs +3 -3
  212. package/esm2020/lib/core/tokens/base-url.token.mjs +3 -3
  213. package/esm2020/lib/core/tokens/cookie.token.mjs +3 -3
  214. package/esm2020/lib/core/tokens/location.token.mjs +6 -6
  215. package/esm2020/lib/core/tokens/navigator.token.mjs +6 -6
  216. package/esm2020/lib/core/tokens/window.token.mjs +12 -12
  217. package/esm2020/localize/bravobit-bb-foundation-localize.mjs +4 -4
  218. package/esm2020/localize/lib/functions/date.function.mjs +18 -18
  219. package/esm2020/localize/lib/functions/lowercase.function.mjs +13 -13
  220. package/esm2020/localize/lib/functions/uppercase.function.mjs +13 -13
  221. package/esm2020/localize/lib/handlers/missing.handler.mjs +15 -17
  222. package/esm2020/localize/lib/interfaces/config.interfaces.mjs +7 -10
  223. package/esm2020/localize/lib/interfaces/functions.interfaces.mjs +8 -8
  224. package/esm2020/localize/lib/interfaces/handlers.interfaces.mjs +2 -2
  225. package/esm2020/localize/lib/interfaces/options.interfaces.mjs +6 -6
  226. package/esm2020/localize/lib/localizations/dutch.localization.mjs +45 -53
  227. package/esm2020/localize/lib/localizations/english.localization.mjs +45 -53
  228. package/esm2020/localize/lib/localize.dictionary.mjs +26 -135
  229. package/esm2020/localize/lib/localize.module.mjs +71 -69
  230. package/esm2020/localize/lib/localize.pipe.mjs +49 -49
  231. package/esm2020/localize/lib/localize.service.mjs +205 -277
  232. package/esm2020/localize/lib/views/localize-string/localize-string.component.mjs +88 -88
  233. package/esm2020/localize/lib/views/localize-template-or-string.directive.mjs +28 -28
  234. package/esm2020/localize/lib/views/localize-template.directive.mjs +21 -21
  235. package/esm2020/localize/public_api.mjs +17 -18
  236. package/esm2020/notifications/bravobit-bb-foundation-notifications.mjs +4 -4
  237. package/esm2020/notifications/lib/notifications-item/notifications-item.component.mjs +100 -100
  238. package/esm2020/notifications/lib/notifications-list/notifications-list.component.mjs +47 -47
  239. package/esm2020/notifications/lib/notifications.animations.mjs +28 -28
  240. package/esm2020/notifications/lib/notifications.injector.mjs +18 -18
  241. package/esm2020/notifications/lib/notifications.interfaces.mjs +20 -20
  242. package/esm2020/notifications/lib/notifications.module.mjs +30 -30
  243. package/esm2020/notifications/lib/notifications.service.mjs +145 -145
  244. package/esm2020/notifications/public_api.mjs +4 -4
  245. package/esm2020/public_api.mjs +29 -29
  246. package/esm2020/recaptcha/bravobit-bb-foundation-recaptcha.mjs +4 -4
  247. package/esm2020/recaptcha/lib/recaptcha/recaptcha.component.mjs +185 -185
  248. package/esm2020/recaptcha/lib/recaptcha-loader.service.mjs +90 -90
  249. package/esm2020/recaptcha/lib/recaptcha.interface.mjs +3 -3
  250. package/esm2020/recaptcha/lib/recaptcha.module.mjs +27 -27
  251. package/esm2020/recaptcha/public_api.mjs +5 -5
  252. package/esm2020/rxjs/bravobit-bb-foundation-rxjs.mjs +4 -4
  253. package/esm2020/rxjs/lib/operators/combine-latest-map.operator.mjs +10 -10
  254. package/esm2020/rxjs/lib/operators/filter-nil.operator.mjs +5 -5
  255. package/esm2020/rxjs/public_api.mjs +3 -3
  256. package/esm2020/storage/bravobit-bb-foundation-storage.mjs +4 -4
  257. package/esm2020/storage/lib/interfaces/attributes.interface.mjs +2 -2
  258. package/esm2020/storage/lib/interfaces/memory.interface.mjs +2 -2
  259. package/esm2020/storage/lib/interfaces/strategy.interface.mjs +2 -2
  260. package/esm2020/storage/lib/storage.service.mjs +109 -109
  261. package/esm2020/storage/lib/strategies/cookie-storage.strategy.mjs +142 -142
  262. package/esm2020/storage/lib/strategies/memory-storage.strategy.mjs +56 -56
  263. package/esm2020/storage/lib/strategies/polyfill-storage.strategy.mjs +102 -102
  264. package/esm2020/storage/public_api.mjs +8 -8
  265. package/esm2020/table/bravobit-bb-foundation-table.mjs +4 -4
  266. package/esm2020/table/lib/components/table/table.component.mjs +191 -191
  267. package/esm2020/table/lib/components/table-cell/table-cell.component.mjs +11 -11
  268. package/esm2020/table/lib/components/table-header-cell/table-header-cell.component.mjs +131 -131
  269. package/esm2020/table/lib/components/table-pager/table-pager.component.mjs +136 -136
  270. package/esm2020/table/lib/data/datasource.data.mjs +32 -32
  271. package/esm2020/table/lib/data/generic.data.mjs +72 -72
  272. package/esm2020/table/lib/interfaces/datasource.interface.mjs +2 -2
  273. package/esm2020/table/lib/interfaces/table.interfaces.mjs +2 -2
  274. package/esm2020/table/lib/table.module.mjs +42 -42
  275. package/esm2020/table/public_api.mjs +10 -10
  276. package/fesm2015/bravobit-bb-foundation-auth.mjs +930 -926
  277. package/fesm2015/bravobit-bb-foundation-auth.mjs.map +1 -1
  278. package/fesm2015/bravobit-bb-foundation-collections.mjs +423 -423
  279. package/fesm2015/bravobit-bb-foundation-collections.mjs.map +1 -1
  280. package/fesm2015/bravobit-bb-foundation-controls.mjs +216 -216
  281. package/fesm2015/bravobit-bb-foundation-controls.mjs.map +1 -1
  282. package/fesm2015/bravobit-bb-foundation-dashboard.mjs +382 -382
  283. package/fesm2015/bravobit-bb-foundation-dashboard.mjs.map +1 -1
  284. package/fesm2015/bravobit-bb-foundation-dialog.mjs +542 -542
  285. package/fesm2015/bravobit-bb-foundation-dialog.mjs.map +1 -1
  286. package/fesm2015/bravobit-bb-foundation-elements.mjs +1971 -1968
  287. package/fesm2015/bravobit-bb-foundation-elements.mjs.map +1 -1
  288. package/fesm2015/bravobit-bb-foundation-http.mjs +156 -156
  289. package/fesm2015/bravobit-bb-foundation-http.mjs.map +1 -1
  290. package/fesm2015/bravobit-bb-foundation-localize.mjs +611 -805
  291. package/fesm2015/bravobit-bb-foundation-localize.mjs.map +1 -1
  292. package/fesm2015/bravobit-bb-foundation-notifications.mjs +348 -348
  293. package/fesm2015/bravobit-bb-foundation-notifications.mjs.map +1 -1
  294. package/fesm2015/bravobit-bb-foundation-recaptcha.mjs +290 -290
  295. package/fesm2015/bravobit-bb-foundation-recaptcha.mjs.map +1 -1
  296. package/fesm2015/bravobit-bb-foundation-rxjs.mjs +7 -7
  297. package/fesm2015/bravobit-bb-foundation-rxjs.mjs.map +1 -1
  298. package/fesm2015/bravobit-bb-foundation-storage.mjs +401 -401
  299. package/fesm2015/bravobit-bb-foundation-storage.mjs.map +1 -1
  300. package/fesm2015/bravobit-bb-foundation-table.mjs +571 -571
  301. package/fesm2015/bravobit-bb-foundation-table.mjs.map +1 -1
  302. package/fesm2015/bravobit-bb-foundation.mjs +860 -860
  303. package/fesm2015/bravobit-bb-foundation.mjs.map +1 -1
  304. package/fesm2020/bravobit-bb-foundation-auth.mjs +882 -878
  305. package/fesm2020/bravobit-bb-foundation-auth.mjs.map +1 -1
  306. package/fesm2020/bravobit-bb-foundation-collections.mjs +413 -413
  307. package/fesm2020/bravobit-bb-foundation-collections.mjs.map +1 -1
  308. package/fesm2020/bravobit-bb-foundation-controls.mjs +214 -214
  309. package/fesm2020/bravobit-bb-foundation-controls.mjs.map +1 -1
  310. package/fesm2020/bravobit-bb-foundation-dashboard.mjs +370 -370
  311. package/fesm2020/bravobit-bb-foundation-dashboard.mjs.map +1 -1
  312. package/fesm2020/bravobit-bb-foundation-dialog.mjs +541 -541
  313. package/fesm2020/bravobit-bb-foundation-dialog.mjs.map +1 -1
  314. package/fesm2020/bravobit-bb-foundation-elements.mjs +1928 -1925
  315. package/fesm2020/bravobit-bb-foundation-elements.mjs.map +1 -1
  316. package/fesm2020/bravobit-bb-foundation-http.mjs +148 -148
  317. package/fesm2020/bravobit-bb-foundation-http.mjs.map +1 -1
  318. package/fesm2020/bravobit-bb-foundation-localize.mjs +590 -792
  319. package/fesm2020/bravobit-bb-foundation-localize.mjs.map +1 -1
  320. package/fesm2020/bravobit-bb-foundation-notifications.mjs +346 -346
  321. package/fesm2020/bravobit-bb-foundation-notifications.mjs.map +1 -1
  322. package/fesm2020/bravobit-bb-foundation-recaptcha.mjs +280 -280
  323. package/fesm2020/bravobit-bb-foundation-recaptcha.mjs.map +1 -1
  324. package/fesm2020/bravobit-bb-foundation-rxjs.mjs +10 -10
  325. package/fesm2020/bravobit-bb-foundation-rxjs.mjs.map +1 -1
  326. package/fesm2020/bravobit-bb-foundation-storage.mjs +396 -396
  327. package/fesm2020/bravobit-bb-foundation-storage.mjs.map +1 -1
  328. package/fesm2020/bravobit-bb-foundation-table.mjs +560 -560
  329. package/fesm2020/bravobit-bb-foundation-table.mjs.map +1 -1
  330. package/fesm2020/bravobit-bb-foundation.mjs +832 -832
  331. package/fesm2020/bravobit-bb-foundation.mjs.map +1 -1
  332. package/http/bravobit-bb-foundation-http.d.ts +5 -5
  333. package/http/lib/classes/http.config.d.ts +9 -9
  334. package/http/lib/classes/http.error.d.ts +7 -7
  335. package/http/lib/http.interfaces.d.ts +12 -12
  336. package/http/lib/http.module.d.ts +15 -15
  337. package/http/lib/interceptors/base-url.interceptor.d.ts +15 -15
  338. package/http/lib/interceptors/error.interceptor.d.ts +11 -11
  339. package/http/public_api.d.ts +6 -6
  340. package/lib/core/miscellaneous/regex.d.ts +4 -4
  341. package/lib/core/miscellaneous/validator.d.ts +13 -13
  342. package/lib/core/mixins/can-disable.d.ts +6 -6
  343. package/lib/core/mixins/can-hide-errors.d.ts +6 -6
  344. package/lib/core/mixins/can-load.d.ts +6 -6
  345. package/lib/core/mixins/constructor.d.ts +1 -1
  346. package/lib/core/mixins/has-error.d.ts +6 -6
  347. package/lib/core/mixins/is-focused.d.ts +6 -6
  348. package/lib/core/mixins/is-grouped.d.ts +6 -6
  349. package/lib/core/mixins/is-readonly.d.ts +6 -6
  350. package/lib/core/mixins/is-required.d.ts +6 -6
  351. package/lib/core/services/clipboard.service.d.ts +18 -18
  352. package/lib/core/services/exif.service.d.ts +15 -15
  353. package/lib/core/services/file-loader.service.d.ts +13 -13
  354. package/lib/core/services/image-converter.service.d.ts +21 -21
  355. package/lib/core/services/languages.service.d.ts +16 -16
  356. package/lib/core/services/network.service.d.ts +14 -14
  357. package/lib/core/services/patch.service.d.ts +16 -16
  358. package/lib/core/services/platform.service.d.ts +18 -18
  359. package/lib/core/tokens/accept-language.token.d.ts +2 -2
  360. package/lib/core/tokens/base-url.token.d.ts +2 -2
  361. package/lib/core/tokens/cookie.token.d.ts +2 -2
  362. package/lib/core/tokens/location.token.d.ts +2 -2
  363. package/lib/core/tokens/navigator.token.d.ts +2 -2
  364. package/lib/core/tokens/window.token.d.ts +2 -2
  365. package/localize/bravobit-bb-foundation-localize.d.ts +5 -5
  366. package/localize/lib/functions/date.function.d.ts +5 -5
  367. package/localize/lib/functions/lowercase.function.d.ts +5 -5
  368. package/localize/lib/functions/uppercase.function.d.ts +5 -5
  369. package/localize/lib/handlers/missing.handler.d.ts +6 -6
  370. package/localize/lib/interfaces/config.interfaces.d.ts +18 -8
  371. package/localize/lib/interfaces/functions.interfaces.d.ts +9 -9
  372. package/localize/lib/interfaces/handlers.interfaces.d.ts +6 -6
  373. package/localize/lib/interfaces/options.interfaces.d.ts +10 -10
  374. package/localize/lib/localizations/dutch.localization.d.ts +44 -51
  375. package/localize/lib/localizations/english.localization.d.ts +44 -51
  376. package/localize/lib/localize.dictionary.d.ts +7 -24
  377. package/localize/lib/localize.module.d.ts +17 -18
  378. package/localize/lib/localize.pipe.d.ts +12 -12
  379. package/localize/lib/localize.service.d.ts +40 -51
  380. package/localize/lib/views/localize-string/localize-string.component.d.ts +23 -23
  381. package/localize/lib/views/localize-template-or-string.directive.d.ts +10 -10
  382. package/localize/lib/views/localize-template.directive.d.ts +9 -9
  383. package/localize/public_api.d.ts +16 -17
  384. package/notifications/bravobit-bb-foundation-notifications.d.ts +5 -5
  385. package/notifications/lib/notifications-item/notifications-item.component.d.ts +34 -34
  386. package/notifications/lib/notifications-list/notifications-list.component.d.ts +16 -16
  387. package/notifications/lib/notifications.animations.d.ts +1 -1
  388. package/notifications/lib/notifications.injector.d.ts +8 -8
  389. package/notifications/lib/notifications.interfaces.d.ts +49 -49
  390. package/notifications/lib/notifications.module.d.ts +13 -13
  391. package/notifications/lib/notifications.service.d.ts +34 -34
  392. package/notifications/public_api.d.ts +3 -3
  393. package/package.json +6 -6
  394. package/public_api.d.ts +25 -25
  395. package/recaptcha/bravobit-bb-foundation-recaptcha.d.ts +5 -5
  396. package/recaptcha/lib/recaptcha/recaptcha.component.d.ts +47 -47
  397. package/recaptcha/lib/recaptcha-loader.service.d.ts +22 -22
  398. package/recaptcha/lib/recaptcha.interface.d.ts +14 -14
  399. package/recaptcha/lib/recaptcha.module.d.ts +10 -10
  400. package/recaptcha/public_api.d.ts +4 -4
  401. package/rxjs/bravobit-bb-foundation-rxjs.d.ts +5 -5
  402. package/rxjs/lib/operators/combine-latest-map.operator.d.ts +8 -8
  403. package/rxjs/lib/operators/filter-nil.operator.d.ts +1 -1
  404. package/rxjs/public_api.d.ts +2 -2
  405. package/storage/bravobit-bb-foundation-storage.d.ts +5 -5
  406. package/storage/lib/interfaces/attributes.interface.d.ts +13 -13
  407. package/storage/lib/interfaces/memory.interface.d.ts +7 -7
  408. package/storage/lib/interfaces/strategy.interface.d.ts +17 -17
  409. package/storage/lib/storage.service.d.ts +26 -26
  410. package/storage/lib/strategies/cookie-storage.strategy.d.ts +20 -20
  411. package/storage/lib/strategies/memory-storage.strategy.d.ts +11 -11
  412. package/storage/lib/strategies/polyfill-storage.strategy.d.ts +15 -15
  413. package/storage/public_api.d.ts +7 -7
  414. package/table/bravobit-bb-foundation-table.d.ts +5 -5
  415. package/table/lib/components/table/table.component.d.ts +56 -56
  416. package/table/lib/components/table-cell/table-cell.component.d.ts +5 -5
  417. package/table/lib/components/table-header-cell/table-header-cell.component.d.ts +29 -29
  418. package/table/lib/components/table-pager/table-pager.component.d.ts +41 -41
  419. package/table/lib/data/datasource.data.d.ts +14 -14
  420. package/table/lib/data/generic.data.d.ts +23 -23
  421. package/table/lib/interfaces/datasource.interface.d.ts +17 -17
  422. package/table/lib/interfaces/table.interfaces.d.ts +1 -1
  423. package/table/lib/table.module.d.ts +14 -14
  424. package/table/public_api.d.ts +9 -9
  425. package/esm2020/localize/lib/interfaces/dictionary.interfaces.mjs +0 -8
  426. package/localize/lib/interfaces/dictionary.interfaces.d.ts +0 -12
@@ -1,832 +1,630 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, Directive, Input, TemplateRef, Component, ChangeDetectionStrategy, ViewEncapsulation, ContentChildren, Injectable, Optional, Inject, Pipe, APP_INITIALIZER, LOCALE_ID, NgModule } from '@angular/core';
2
+ import { InjectionToken, Directive, Input, TemplateRef, Component, ChangeDetectionStrategy, ViewEncapsulation, ContentChildren, isDevMode, Injectable, Optional, Inject, Pipe, APP_INITIALIZER, LOCALE_ID, NgModule } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
4
  import { formatDate, DOCUMENT, CommonModule } from '@angular/common';
5
5
  import { startWith } from 'rxjs/operators';
6
- import { Subscription, firstValueFrom } from 'rxjs';
7
- import * as i4 from '@angular/platform-browser';
8
- import { makeStateKey } from '@angular/platform-browser';
9
- import { USE_AUTHORIZATION } from '@bravobit/bb-foundation/auth';
10
- import * as i1$1 from '@angular/common/http';
11
- import { HttpContext, HttpClientModule } from '@angular/common/http';
12
- import * as i3 from '@bravobit/bb-foundation';
13
- import { LOCATION, BASE_URL } from '@bravobit/bb-foundation';
14
- import * as i2 from '@bravobit/bb-foundation/storage';
6
+ import { Subscription } from 'rxjs';
7
+ import * as i1$1 from '@bravobit/bb-foundation/storage';
8
+ import * as i2 from '@bravobit/bb-foundation';
15
9
 
16
- //
17
- // The configuration that can be passed when
18
- // the user initializes the localize module.
19
- //
20
- class LocalizeConfig {
21
- constructor() {
22
- this.dictionary = [];
23
- }
10
+ //
11
+ // The configuration that can be passed when
12
+ // the user initializes the localize module.
13
+ //
14
+ class LocalizeConfig {
24
15
  }
25
16
 
26
17
  //
27
18
 
28
- //
29
- // This is the injection token that will be injected
30
- // into the service so that the all localize functions
31
- // can retrieved and used.
32
- //
19
+ //
20
+ // This is the injection token that will be injected
21
+ // into the service so that the all localize functions
22
+ // can retrieved and used.
23
+ //
33
24
  const LOCALIZE_FUNCTION = new InjectionToken('localize_function');
34
25
 
35
- //
36
- // This is the injection token that will be injected
37
- // into the service so that the all extra dictionaries
38
- // can retrieved and used.
39
- //
40
- const LOCALIZE_EXTRA_DICTIONARY = new InjectionToken('localize_extra_dictionary');
41
-
42
- //
43
- // This function transform the value
44
- // to a lowercase variant of the value.
45
- //
46
- class LocalizeLowercaseFunction {
47
- keyword() {
48
- return 'lowercase';
49
- }
50
- transform(value) {
51
- return (value || '').toLowerCase();
52
- }
26
+ //
27
+ // This function transform the value
28
+ // to a lowercase variant of the value.
29
+ //
30
+ class LocalizeLowercaseFunction {
31
+ keyword() {
32
+ return 'lowercase';
33
+ }
34
+ transform(value) {
35
+ return (value || '').toLowerCase();
36
+ }
53
37
  }
54
38
 
55
- //
56
- // This function transform the value
57
- // to a uppercase variant of the value.
58
- //
59
- class LocalizeUppercaseFunction {
60
- keyword() {
61
- return 'uppercase';
62
- }
63
- transform(value) {
64
- return (value || '').toUpperCase();
65
- }
39
+ //
40
+ // This function transform the value
41
+ // to a uppercase variant of the value.
42
+ //
43
+ class LocalizeUppercaseFunction {
44
+ keyword() {
45
+ return 'uppercase';
46
+ }
47
+ transform(value) {
48
+ return (value || '').toUpperCase();
49
+ }
66
50
  }
67
51
 
68
- //
69
- // This function transform the value
70
- // to a localized date.
71
- //
72
- class LocalizeDateFunction {
73
- keyword() {
74
- return 'date';
75
- }
76
- transform(value, locale) {
77
- const date = new Date(value);
78
- if (date.toString() === 'Invalid Date') {
79
- return '?';
80
- }
81
- return formatDate(date, 'longDate', locale);
82
- }
52
+ //
53
+ // This function transform the value
54
+ // to a localized date.
55
+ //
56
+ class LocalizeDateFunction {
57
+ keyword() {
58
+ return 'date';
59
+ }
60
+ transform(value, locale) {
61
+ const date = new Date(value);
62
+ if (date.toString() === 'Invalid Date') {
63
+ return '?';
64
+ }
65
+ return formatDate(date, 'longDate', locale);
66
+ }
83
67
  }
84
68
 
85
- const LOCALIZATION_EXTRA_ENGLISH = {
86
- provide: LOCALIZE_EXTRA_DICTIONARY,
87
- useValue: {
88
- locale: 'en-US',
89
- data: {
90
- 'form-control-errors': {
91
- 'unknown': 'The field has an unknown error.',
92
- 'required': 'This field is required.',
93
- 'pattern': 'Invalid format.',
94
- 'email': 'The field does not match a valid email address.',
95
- 'emailTaken': 'The e-mail is already taken.',
96
- 'passwordMatch': 'The passwords don\'t match.',
97
- 'confirm': 'The field does not match.',
98
- 'fullNumber': 'The field should be a full number.',
99
- 'min': 'Minimum amount should be {{min}}.',
100
- 'max': 'Maximum amount should be {{max}}.',
101
- 'invalidFileType': 'The file type is not allowed.',
102
- 'maxFileSize': 'The file has exceed the maximum amount of {{maxSize}}.',
103
- 'minDate': 'The first accepted date is {{date|date}}.',
104
- 'maxDate': 'The last accepted date is {{date|date}}.',
105
- 'invalidDate': 'The field contains an invalid date.',
106
- 'minlength': 'Expected a minimum of {{requiredLength}} characters but got {{actualLength}} characters.',
107
- 'maxlength': 'Expected a maximum of {{requiredLength}} characters but got {{actualLength}} characters.'
108
- },
109
- 'tables': {
110
- 'search': 'Search...',
111
- 'loading': 'Loading...',
112
- 'empty': 'There is nothing to find here.',
113
- 'page': 'page',
114
- 'error_datasource': 'No data source was provided.',
115
- 'error_unauthorized': 'You need to be authenticated to view this data.',
116
- 'error_forbidden': 'You do not have access to view this data.',
117
- 'error_not_found': 'The data was not found.',
118
- 'error_server': 'A server error occurred while fetching data from the server.',
119
- 'error_down': 'It looks like the server is down.',
120
- 'error_unknown': 'A unknown error occurred.'
121
- },
122
- 'file-picker': {
123
- 'choose': 'Choose file',
124
- 'remove': 'Remove file',
125
- 'drop': 'or drag and drop file here'
126
- },
127
- 'times': {
128
- 'tomorrow_at': 'Tomorrow at {{date}}',
129
- 'today_at': 'Today at {{date}}',
130
- 'yesterday_at': 'Yesterday at {{date}}'
131
- }
132
- }
133
- },
134
- multi: true
69
+ const extraEnglishDictionary = {
70
+ 'form-control-errors': {
71
+ 'unknown': 'The field has an unknown error.',
72
+ 'required': 'This field is required.',
73
+ 'pattern': 'Invalid format.',
74
+ 'email': 'The field does not match a valid email address.',
75
+ 'emailTaken': 'The e-mail is already taken.',
76
+ 'passwordMatch': 'The passwords don\'t match.',
77
+ 'confirm': 'The field does not match.',
78
+ 'fullNumber': 'The field should be a full number.',
79
+ 'min': 'Minimum amount should be {{min}}.',
80
+ 'max': 'Maximum amount should be {{max}}.',
81
+ 'invalidFileType': 'The file type is not allowed.',
82
+ 'maxFileSize': 'The file has exceed the maximum amount of {{maxSize}}.',
83
+ 'minDate': 'The first accepted date is {{date|date}}.',
84
+ 'maxDate': 'The last accepted date is {{date|date}}.',
85
+ 'invalidDate': 'The field contains an invalid date.',
86
+ 'minlength': 'Expected a minimum of {{requiredLength}} characters but got {{actualLength}} characters.',
87
+ 'maxlength': 'Expected a maximum of {{requiredLength}} characters but got {{actualLength}} characters.'
88
+ },
89
+ 'tables': {
90
+ 'search': 'Search...',
91
+ 'loading': 'Loading...',
92
+ 'empty': 'There is nothing to find here.',
93
+ 'page': 'page',
94
+ 'error_datasource': 'No data source was provided.',
95
+ 'error_unauthorized': 'You need to be authenticated to view this data.',
96
+ 'error_forbidden': 'You do not have access to view this data.',
97
+ 'error_not_found': 'The data was not found.',
98
+ 'error_server': 'A server error occurred while fetching data from the server.',
99
+ 'error_down': 'It looks like the server is down.',
100
+ 'error_unknown': 'A unknown error occurred.'
101
+ },
102
+ 'file-picker': {
103
+ 'choose': 'Choose file',
104
+ 'remove': 'Remove file',
105
+ 'drop': 'or drag and drop file here'
106
+ },
107
+ 'times': {
108
+ 'tomorrow_at': 'Tomorrow at {{date}}',
109
+ 'today_at': 'Today at {{date}}',
110
+ 'yesterday_at': 'Yesterday at {{date}}'
111
+ }
135
112
  };
136
113
 
137
- const LOCALIZATION_EXTRA_DUTCH = {
138
- provide: LOCALIZE_EXTRA_DICTIONARY,
139
- useValue: {
140
- locale: 'nl-NL',
141
- data: {
142
- 'form-control-errors': {
143
- 'unknown': 'Het veld heeft een onbekende fout.',
144
- 'required': 'Dit veld is verplicht.',
145
- 'pattern': 'Ongeldig formaat.',
146
- 'email': 'Het veld komt niet overeen met een geldig e-mailadres.',
147
- 'emailTaken': 'Het e-mailadres is al bezet.',
148
- 'passwordMatch': 'De wachtwoorden komen niet overeen.',
149
- 'confirm': 'Het veld komt niet overeen.',
150
- 'fullNumber': 'Het veld moet een volledig getal zijn.',
151
- 'min': 'Minimum hoeveelheid moet {{min}} zijn.',
152
- 'max': 'Maximum hoeveelheid moet {{max}} zijn.',
153
- 'invalidFileType': 'Het type bestand is niet toegestaan.',
154
- 'maxFileSize': 'Het bestand heeft de maximum hoeveelheid van {{maxSize}} overschreden.',
155
- 'minDate': 'De eerst mogelijke datum is {{date|date}}.',
156
- 'maxDate': 'De laatst mogelijke datum is {{date|date}}.',
157
- 'invalidDate': 'Het veld bevat een ongeldige datum.',
158
- 'minlength': 'Verwachtte minimaal {{requiredLength}} tekens, maar kreeg {{actualLength}} tekens.',
159
- 'maxlength': 'Verwachtte maximaal {{requiredLength}} tekens, maar kreeg {{actualLength}} tekens.'
160
- },
161
- 'tables': {
162
- 'search': 'Zoeken...',
163
- 'loading': 'Aan het laden...',
164
- 'empty': 'Er is hier niets te vinden.',
165
- 'page': 'pagina',
166
- 'error_datasource': 'Er is geen gegevensbron verstrekt.',
167
- 'error_unauthorized': 'U moet ingelogd zijn om deze gegevens te bekijken.',
168
- 'error_forbidden': 'U hebt geen toegang om deze gegevens te bekijken.',
169
- 'error_not_found': 'De gegevens zijn niet gevonden.',
170
- 'error_server': 'Er is een serverfout opgetreden bij het ophalen van gegevens van de server.',
171
- 'error_down': 'Het lijkt erop dat de server down is.',
172
- 'error_unknown': 'Er is een onbekende fout opgetreden bij het ophalen van gegevens van de server.'
173
- },
174
- 'file-picker': {
175
- 'choose': 'Kies bestand',
176
- 'remove': 'Verwijder bestand',
177
- 'drop': 'of sleep het bestand hiernaartoe'
178
- },
179
- 'times': {
180
- 'tomorrow_at': 'Morgen om {{date}}',
181
- 'today_at': 'Vandaag om {{date}}',
182
- 'yesterday_at': 'Gisteren om {{date}}'
183
- }
184
- }
185
- },
186
- multi: true
114
+ const extraDutchDictionary = {
115
+ 'form-control-errors': {
116
+ 'unknown': 'Het veld heeft een onbekende fout.',
117
+ 'required': 'Dit veld is verplicht.',
118
+ 'pattern': 'Ongeldig formaat.',
119
+ 'email': 'Het veld komt niet overeen met een geldig e-mailadres.',
120
+ 'emailTaken': 'Het e-mailadres is al bezet.',
121
+ 'passwordMatch': 'De wachtwoorden komen niet overeen.',
122
+ 'confirm': 'Het veld komt niet overeen.',
123
+ 'fullNumber': 'Het veld moet een volledig getal zijn.',
124
+ 'min': 'Minimum hoeveelheid moet {{min}} zijn.',
125
+ 'max': 'Maximum hoeveelheid moet {{max}} zijn.',
126
+ 'invalidFileType': 'Het type bestand is niet toegestaan.',
127
+ 'maxFileSize': 'Het bestand heeft de maximum hoeveelheid van {{maxSize}} overschreden.',
128
+ 'minDate': 'De eerst mogelijke datum is {{date|date}}.',
129
+ 'maxDate': 'De laatst mogelijke datum is {{date|date}}.',
130
+ 'invalidDate': 'Het veld bevat een ongeldige datum.',
131
+ 'minlength': 'Verwachtte minimaal {{requiredLength}} tekens, maar kreeg {{actualLength}} tekens.',
132
+ 'maxlength': 'Verwachtte maximaal {{requiredLength}} tekens, maar kreeg {{actualLength}} tekens.'
133
+ },
134
+ 'tables': {
135
+ 'search': 'Zoeken...',
136
+ 'loading': 'Aan het laden...',
137
+ 'empty': 'Er is hier niets te vinden.',
138
+ 'page': 'pagina',
139
+ 'error_datasource': 'Er is geen gegevensbron verstrekt.',
140
+ 'error_unauthorized': 'U moet ingelogd zijn om deze gegevens te bekijken.',
141
+ 'error_forbidden': 'U hebt geen toegang om deze gegevens te bekijken.',
142
+ 'error_not_found': 'De gegevens zijn niet gevonden.',
143
+ 'error_server': 'Er is een serverfout opgetreden bij het ophalen van gegevens van de server.',
144
+ 'error_down': 'Het lijkt erop dat de server down is.',
145
+ 'error_unknown': 'Er is een onbekende fout opgetreden bij het ophalen van gegevens van de server.'
146
+ },
147
+ 'file-picker': {
148
+ 'choose': 'Kies bestand',
149
+ 'remove': 'Verwijder bestand',
150
+ 'drop': 'of sleep het bestand hiernaartoe'
151
+ },
152
+ 'times': {
153
+ 'tomorrow_at': 'Morgen om {{date}}',
154
+ 'today_at': 'Vandaag om {{date}}',
155
+ 'yesterday_at': 'Gisteren om {{date}}'
156
+ }
187
157
  };
188
158
 
189
- class LocalizeMissingHandler {
190
- constructor() {
191
- this.log = (message) => {
192
- console && console.warn && console.warn(message);
193
- };
194
- }
195
- handle(params) {
196
- // Log to the console when the token was not found
197
- // if the user did not mark it as optional.
198
- if (!params.optional) {
199
- this.log(`Localize: The token with name: "${params.token}" was not found.`);
200
- }
201
- // Return the default token back.
202
- return params.token;
203
- }
159
+ class LocalizeMissingHandler {
160
+ constructor() {
161
+ this.log = (message) => console?.warn?.(message);
162
+ }
163
+ handle(params) {
164
+ // Log to the console when the token was not found
165
+ // if the user did not mark it as optional.
166
+ if (!params?.optional) {
167
+ this.log(`Localize: The token with name: "${params?.token}" was not found.`);
168
+ }
169
+ // Return the default token back.
170
+ return params?.token ?? null;
171
+ }
204
172
  }
205
173
 
206
- class BbLocalizeTemplate {
207
- constructor(templateRef) {
208
- this.templateRef = templateRef;
209
- // Inputs.
210
- this.name = null;
211
- }
212
- }
213
- BbLocalizeTemplate.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbLocalizeTemplate, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
214
- BbLocalizeTemplate.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.0", type: BbLocalizeTemplate, selector: "[bbLocalizeTemplate]", inputs: { name: ["bbLocalizeTemplate", "name"] }, ngImport: i0 });
215
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbLocalizeTemplate, decorators: [{
216
- type: Directive,
217
- args: [{
218
- selector: '[bbLocalizeTemplate]'
219
- }]
220
- }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; }, propDecorators: { name: [{
221
- type: Input,
222
- args: ['bbLocalizeTemplate']
174
+ class BbLocalizeTemplate {
175
+ constructor(templateRef) {
176
+ this.templateRef = templateRef;
177
+ // Inputs.
178
+ this.name = null;
179
+ }
180
+ }
181
+ BbLocalizeTemplate.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: BbLocalizeTemplate, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
182
+ BbLocalizeTemplate.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.6", type: BbLocalizeTemplate, selector: "[bbLocalizeTemplate]", inputs: { name: ["bbLocalizeTemplate", "name"] }, ngImport: i0 });
183
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: BbLocalizeTemplate, decorators: [{
184
+ type: Directive,
185
+ args: [{
186
+ selector: '[bbLocalizeTemplate]'
187
+ }]
188
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; }, propDecorators: { name: [{
189
+ type: Input,
190
+ args: ['bbLocalizeTemplate']
223
191
  }] } });
224
192
 
225
- class BbLocalizeTemplateOrString {
226
- constructor(_templateRef, _viewContainerRef) {
227
- this._templateRef = _templateRef;
228
- this._viewContainerRef = _viewContainerRef;
229
- }
230
- set bbLocalizeTemplateOrString(content) {
231
- // Get the template.
232
- const template = content instanceof TemplateRef
233
- ? content
234
- : this._templateRef;
235
- // Clear the view container ref and create the view.
236
- this._viewContainerRef.clear();
237
- this._viewContainerRef.createEmbeddedView(template);
238
- }
239
- }
240
- BbLocalizeTemplateOrString.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbLocalizeTemplateOrString, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
241
- BbLocalizeTemplateOrString.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.0", type: BbLocalizeTemplateOrString, selector: "[bbLocalizeTemplateOrString]", inputs: { bbLocalizeTemplateOrString: "bbLocalizeTemplateOrString" }, ngImport: i0 });
242
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbLocalizeTemplateOrString, decorators: [{
243
- type: Directive,
244
- args: [{
245
- selector: '[bbLocalizeTemplateOrString]'
246
- }]
247
- }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; }, propDecorators: { bbLocalizeTemplateOrString: [{
248
- type: Input
193
+ class BbLocalizeTemplateOrString {
194
+ constructor(_templateRef, _viewContainerRef) {
195
+ this._templateRef = _templateRef;
196
+ this._viewContainerRef = _viewContainerRef;
197
+ }
198
+ set bbLocalizeTemplateOrString(content) {
199
+ // Get the template.
200
+ const template = content instanceof TemplateRef
201
+ ? content
202
+ : this._templateRef;
203
+ // Clear the view container ref and create the view.
204
+ this._viewContainerRef.clear();
205
+ this._viewContainerRef.createEmbeddedView(template);
206
+ }
207
+ }
208
+ BbLocalizeTemplateOrString.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: BbLocalizeTemplateOrString, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
209
+ BbLocalizeTemplateOrString.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.6", type: BbLocalizeTemplateOrString, selector: "[bbLocalizeTemplateOrString]", inputs: { bbLocalizeTemplateOrString: "bbLocalizeTemplateOrString" }, ngImport: i0 });
210
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: BbLocalizeTemplateOrString, decorators: [{
211
+ type: Directive,
212
+ args: [{
213
+ selector: '[bbLocalizeTemplateOrString]'
214
+ }]
215
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; }, propDecorators: { bbLocalizeTemplateOrString: [{
216
+ type: Input
249
217
  }] } });
250
218
 
251
- class BbLocalizeString {
252
- constructor(_changeDetection) {
253
- this._changeDetection = _changeDetection;
254
- // Inputs.
255
- this.substitutions = ['[', ']'];
256
- // Data.
257
- this.components = [];
258
- // Subscriptions.
259
- this._subscription = new Subscription();
260
- // State.
261
- this._value = null;
262
- }
263
- set value(value) {
264
- this._value = value;
265
- this.revalidate();
266
- }
267
- get value() {
268
- return this._value;
269
- }
270
- ngAfterViewInit() {
271
- this.observeItemChanges();
272
- }
273
- ngOnDestroy() {
274
- this._subscription?.unsubscribe();
275
- }
276
- observeItemChanges() {
277
- const subscription = this.items.changes.pipe(startWith(0)).subscribe(() => this.revalidate());
278
- this._subscription.add(subscription);
279
- }
280
- revalidate() {
281
- const items = this.items?.toArray() ?? [];
282
- if (items.length <= 0) {
283
- return;
284
- }
285
- this.setComponents(items);
286
- }
287
- setComponents(items) {
288
- const [start, end] = this.substitutions;
289
- const templates = items.reduce((previous, current) => {
290
- const template = current?.templateRef ?? null;
291
- const name = current?.name ?? null;
292
- if (!template || !name) {
293
- return previous;
294
- }
295
- return { ...previous, [`${start}${name}${end}`]: template };
296
- }, {});
297
- this.components = this.getStringComponents(this._value)
298
- .map(component => templates?.[component] ?? component ?? null)
299
- .filter(item => !!item);
300
- this._changeDetection.detectChanges();
301
- }
302
- getStringComponents(value) {
303
- const [start, end] = this.getSubstitutions();
304
- const regex = new RegExp(`(${start}[a-zA-Z]+${end})`, 'g');
305
- return value.split(regex);
306
- }
307
- getSubstitutions() {
308
- const [start, end] = this.substitutions;
309
- const escape = /[.*+?^${}()|[\]\\]/g;
310
- return [
311
- start.replace(escape, '\\$&'),
312
- end.replace(escape, '\\$&')
313
- ];
314
- }
315
- }
316
- BbLocalizeString.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbLocalizeString, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
317
- BbLocalizeString.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.0", type: BbLocalizeString, selector: "bb-localize-string", inputs: { substitutions: "substitutions", value: "value" }, host: { classAttribute: "bb-localize-string" }, queries: [{ propertyName: "items", predicate: BbLocalizeTemplate }], ngImport: i0, template: "<ng-container *ngFor=\"let component of components\">\n <ng-template [bbLocalizeTemplateOrString]=\"component\">{{ component }}</ng-template>\n</ng-container>\n", styles: [".bb-localize-string{display:inline}\n"], directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: BbLocalizeTemplateOrString, selector: "[bbLocalizeTemplateOrString]", inputs: ["bbLocalizeTemplateOrString"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
318
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbLocalizeString, decorators: [{
319
- type: Component,
320
- args: [{ selector: 'bb-localize-string', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, host: {
321
- 'class': 'bb-localize-string'
322
- }, template: "<ng-container *ngFor=\"let component of components\">\n <ng-template [bbLocalizeTemplateOrString]=\"component\">{{ component }}</ng-template>\n</ng-container>\n", styles: [".bb-localize-string{display:inline}\n"] }]
323
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { items: [{
324
- type: ContentChildren,
325
- args: [BbLocalizeTemplate]
326
- }], substitutions: [{
327
- type: Input
328
- }], value: [{
329
- type: Input
219
+ class BbLocalizeString {
220
+ constructor(_changeDetection) {
221
+ this._changeDetection = _changeDetection;
222
+ // Inputs.
223
+ this.substitutions = ['[', ']'];
224
+ // Data.
225
+ this.components = [];
226
+ // Subscriptions.
227
+ this._subscription = new Subscription();
228
+ // State.
229
+ this._value = null;
230
+ }
231
+ set value(value) {
232
+ this._value = value;
233
+ this.revalidate();
234
+ }
235
+ get value() {
236
+ return this._value;
237
+ }
238
+ ngAfterViewInit() {
239
+ this.observeItemChanges();
240
+ }
241
+ ngOnDestroy() {
242
+ this._subscription?.unsubscribe();
243
+ }
244
+ observeItemChanges() {
245
+ const subscription = this.items.changes.pipe(startWith(0)).subscribe(() => this.revalidate());
246
+ this._subscription.add(subscription);
247
+ }
248
+ revalidate() {
249
+ const items = this.items?.toArray() ?? [];
250
+ if (items.length <= 0) {
251
+ return;
252
+ }
253
+ this.setComponents(items);
254
+ }
255
+ setComponents(items) {
256
+ const [start, end] = this.substitutions;
257
+ const templates = items.reduce((previous, current) => {
258
+ const template = current?.templateRef ?? null;
259
+ const name = current?.name ?? null;
260
+ if (!template || !name) {
261
+ return previous;
262
+ }
263
+ return { ...previous, [`${start}${name}${end}`]: template };
264
+ }, {});
265
+ this.components = this.getStringComponents(this._value)
266
+ .map(component => templates?.[component] ?? component ?? null)
267
+ .filter(item => !!item);
268
+ this._changeDetection.detectChanges();
269
+ }
270
+ getStringComponents(value) {
271
+ const [start, end] = this.getSubstitutions();
272
+ const regex = new RegExp(`(${start}[a-zA-Z]+${end})`, 'g');
273
+ return value.split(regex);
274
+ }
275
+ getSubstitutions() {
276
+ const [start, end] = this.substitutions;
277
+ const escape = /[.*+?^${}()|[\]\\]/g;
278
+ return [
279
+ start.replace(escape, '\\$&'),
280
+ end.replace(escape, '\\$&')
281
+ ];
282
+ }
283
+ }
284
+ BbLocalizeString.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: BbLocalizeString, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
285
+ BbLocalizeString.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.6", type: BbLocalizeString, selector: "bb-localize-string, [bb-localize-string]", inputs: { substitutions: "substitutions", value: "value" }, host: { classAttribute: "bb-localize-string" }, queries: [{ propertyName: "items", predicate: BbLocalizeTemplate }], ngImport: i0, template: "<ng-container *ngFor=\"let component of components\">\r\n <ng-template [bbLocalizeTemplateOrString]=\"component\">{{ component }}</ng-template>\r\n</ng-container>\r\n", styles: [".bb-localize-string{display:inline}\n"], directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: BbLocalizeTemplateOrString, selector: "[bbLocalizeTemplateOrString]", inputs: ["bbLocalizeTemplateOrString"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
286
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: BbLocalizeString, decorators: [{
287
+ type: Component,
288
+ args: [{ selector: 'bb-localize-string, [bb-localize-string]', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, host: {
289
+ 'class': 'bb-localize-string'
290
+ }, template: "<ng-container *ngFor=\"let component of components\">\r\n <ng-template [bbLocalizeTemplateOrString]=\"component\">{{ component }}</ng-template>\r\n</ng-container>\r\n", styles: [".bb-localize-string{display:inline}\n"] }]
291
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { items: [{
292
+ type: ContentChildren,
293
+ args: [BbLocalizeTemplate]
294
+ }], substitutions: [{
295
+ type: Input
296
+ }], value: [{
297
+ type: Input
330
298
  }] } });
331
299
 
332
- class LocalizeDictionary {
333
- constructor({ id, data, locale, supportedLanguages }, baseUrl, http) {
334
- // Dictionary data.
335
- this._data = {};
336
- this._url = null;
337
- this.isAbsoluteUrl = (url) => {
338
- if (url.indexOf('//') === 0) {
339
- return true;
340
- }
341
- if (url.indexOf('://') === -1) {
342
- return false;
343
- }
344
- if (url.indexOf('.') === -1) {
345
- return false;
346
- }
347
- if (url.indexOf('/') === -1) {
348
- return false;
349
- }
350
- if (url.indexOf(':') > url.indexOf('/')) {
351
- return false;
352
- }
353
- return url.indexOf('://') < url.indexOf('.');
354
- };
355
- this.recursiveSearchValue = (data, value) => {
356
- if (typeof data === 'undefined' || typeof data === 'string') {
357
- return undefined;
358
- }
359
- return data[value];
360
- };
361
- this._id = id;
362
- this._locale = locale || 'en-US';
363
- this._supportedLanguages = supportedLanguages || [];
364
- this._http = http;
365
- this.stateKey = makeStateKey(`locale:${this._id}`);
366
- // Set the correct variable to the url or data.
367
- if (typeof data === 'string') {
368
- this._url = this.getUrl(data, baseUrl);
369
- }
370
- else {
371
- this._data = data;
372
- }
373
- }
374
- get id() {
375
- return this._id;
376
- }
377
- get locale() {
378
- return this._locale;
379
- }
380
- get supportedLanguages() {
381
- return this._supportedLanguages;
382
- }
383
- get data() {
384
- return this._data;
385
- }
386
- async load(data) {
387
- // Check if data was passed.
388
- if (data) {
389
- this.setData(data);
390
- return true;
391
- }
392
- // If the url was not set the data was already loaded
393
- // return true because it was successful.
394
- if (!this._url) {
395
- return true;
396
- }
397
- try {
398
- // Try to load the data via a HTTP request.
399
- const context = new HttpContext().set(USE_AUTHORIZATION, false);
400
- const result$ = this._http.get(this._url, { context });
401
- const result = await firstValueFrom(result$);
402
- // Set the data.
403
- this.setData(result);
404
- // Return true because it succeeded.
405
- return true;
406
- }
407
- catch {
408
- // Return false because it failed.
409
- return false;
410
- }
411
- }
412
- combine(extraDictionary, mode = 'prepend') {
413
- // Validate that the locale matches.
414
- if (extraDictionary.locale !== this._locale) {
415
- return;
416
- }
417
- // Extract the extra data.
418
- const extraData = extraDictionary.data || {};
419
- // If the selected mode is prepend
420
- // add the data in front.
421
- if (mode === 'prepend') {
422
- this._data = { ...extraData, ...this._data };
423
- return;
424
- }
425
- // If the selected mode is append
426
- // add the data in the back.
427
- this._data = { ...this._data, ...extraData };
428
- }
429
- search(token) {
430
- // Check if the token is present in the
431
- // data, if so return it.
432
- if (this._data[token]) {
433
- return this._data[token];
434
- }
435
- // Values might be nested in objects this means we need
436
- // to split them on the dot and search them recursively
437
- // in the data.
438
- const value = (token || '')
439
- .split('.')
440
- .filter(value => !!value)
441
- .reduce(this.recursiveSearchValue, this._data);
442
- // Check if the value is a string
443
- // if this is true it can be returned.
444
- if (typeof value === 'string') {
445
- return value;
446
- }
447
- // This means the translation was incorrect.
448
- return null;
449
- }
450
- setData(data) {
451
- this._data = data ?? {};
452
- this._url = null;
453
- }
454
- getUrl(value, baseUrl) {
455
- const isAbsolute = this.isAbsoluteUrl(value);
456
- if (isAbsolute || !baseUrl) {
457
- return value;
458
- }
459
- return [baseUrl, value].join('/');
460
- }
300
+ class LocalizeDictionary {
301
+ constructor(data) {
302
+ this._data = this.formatData(data);
303
+ }
304
+ get(token) {
305
+ const key = Array.isArray(token) ? token.join('.') : token;
306
+ return this._data?.[key] ?? null;
307
+ }
308
+ formatData(data, scope = null) {
309
+ const devMode = isDevMode();
310
+ return Object.keys(data).reduce((previous, current) => {
311
+ const value = data?.[current];
312
+ if (typeof value === 'object' && value !== null) {
313
+ const reformatted = this.formatData(value, current);
314
+ return { ...previous, ...reformatted };
315
+ }
316
+ const token = [scope, current].filter(item => !!item).join('.');
317
+ if (previous[token] && devMode) {
318
+ console?.warn?.(`Localize: Duplicate key "${token}" was found, please verify your translation files.`);
319
+ }
320
+ return { ...previous, [token]: value };
321
+ }, {});
322
+ }
461
323
  }
462
324
 
463
- class Localize {
464
- constructor(_http, _storage, _platform, _languages, _state, _config, _missingHandler, _document, _location, _baseUrl, _functions, _extras) {
465
- this._http = _http;
466
- this._storage = _storage;
467
- this._platform = _platform;
468
- this._languages = _languages;
469
- this._state = _state;
470
- this._config = _config;
471
- this._missingHandler = _missingHandler;
472
- this._document = _document;
473
- this._location = _location;
474
- this._baseUrl = _baseUrl;
475
- this._functions = _functions;
476
- this._extras = _extras;
477
- this._storageToken = 'bb-language-dictionary-id';
478
- this.convertToParams = (tokenOrParams) => {
479
- if (typeof tokenOrParams !== 'string') {
480
- // Destruct the params from the object.
481
- const { token, optional, data } = tokenOrParams;
482
- // Make sure all parameters are valid
483
- // by type safe adding them.
484
- return { token: token, optional: optional || false, data: data || {} };
485
- }
486
- // If the parameter is a string fill in the blanks.
487
- return { token: tokenOrParams, optional: false, data: {} };
488
- };
489
- this.getMatches = (value, substitutions) => {
490
- // Get the matching substitutions.
491
- const { start, end } = substitutions;
492
- // Compose a regex that will find the matches.
493
- const regex = new RegExp(`${start}([^${end}]+)${end}`, 'g');
494
- // Execute the regex to find matches.
495
- let match = regex.exec(value);
496
- const matches = [];
497
- while (match !== null) {
498
- // Push a new match.
499
- matches.push({
500
- match: match[0],
501
- token: match[1]
502
- });
503
- // Try to find more matches.
504
- match = regex.exec(value);
505
- }
506
- // Return the processed value.
507
- return matches.filter(item => !!item);
508
- };
509
- this.reload = () => this._location?.reload();
510
- // Check if at least one language was passed in the config.
511
- if (this._config.dictionary.length < 1) {
512
- throw new Error('Localize: one or more languages should be supplied.');
513
- }
514
- // Gather the dictionaries.
515
- this._dictionaries = this._config.dictionary.map(item => {
516
- return new LocalizeDictionary(item, this._baseUrl, this._http);
517
- });
518
- // Save the best matching current dictionary.
519
- this._currentDictionary = this.retrieveBestMatchingDictionary();
520
- // Gather all the localize functions.
521
- this._functionMiddleware = this._functions.reduce((previous, current) => {
522
- previous[current.keyword()] = current;
523
- return previous;
524
- }, {});
525
- this.renderDocumentLanguage();
526
- }
527
- get dictionaries() {
528
- return this._dictionaries;
529
- }
530
- get current() {
531
- return this._currentDictionary;
532
- }
533
- get locale() {
534
- return this._currentDictionary.locale;
535
- }
536
- initialize() {
537
- return async () => this.load(this._currentDictionary);
538
- }
539
- change(id, reload = true) {
540
- // Try to fetch the dictionary.
541
- const dictionary = this._dictionaries.find(item => item.id === id);
542
- // Validate the dictionary exists.
543
- if (!dictionary) {
544
- throw new Error(`Localize: Could not find dictionary with id: "${id}"`);
545
- }
546
- // Save the language in the storage.
547
- this._storage.cookie.set(this._storageToken, dictionary.id, {});
548
- // Just quit if we don't need to reload.
549
- if (!reload) {
550
- return;
551
- }
552
- // We need to reload the application for the translations.
553
- return this.reload();
554
- }
555
- clear(reload = true) {
556
- // Remove the language in the local storage.
557
- this._storage.cookie.remove(this._storageToken);
558
- // Just quit if we don't need to reload.
559
- if (!reload) {
560
- return;
561
- }
562
- // We need to reload the application for the translations.
563
- return this.reload();
564
- }
565
- translate(tokenOrParams) {
566
- // 1. Convert to the params.
567
- const params = this.convertToParams(tokenOrParams);
568
- // 2. Try to find the translation in the dictionary.
569
- const searchResult = this._currentDictionary.search(params.token);
570
- // 3. Verify the translation was found.
571
- if (!searchResult) {
572
- return this._missingHandler.handle(params);
573
- }
574
- // 4. Find references in the translation that need to be translated as well.
575
- const processResult = this.findReferencesInTranslation(searchResult);
576
- // 5. Parse the interpolation data.
577
- return this.parseInterpolationData(processResult, params.data);
578
- }
579
- parseInterpolationData(value, data) {
580
- // Get the interpolation substitutions.
581
- const substitutions = this.getSubstitutions('interpolation', ['{{', '}}']);
582
- // Get all matches in the value.
583
- const matches = this.getMatches(value, substitutions);
584
- // Replace all matches with the parsed value.
585
- return matches.reduce((previous, current) => {
586
- // Try to parse the token.
587
- const interpolatedToken = this.interpolateFunctionData(current.token, data);
588
- // Replace the match with the parsed token.
589
- return previous.replace(current.match, interpolatedToken);
590
- }, `${value}`);
591
- }
592
- interpolateFunctionData(value, interpolationData) {
593
- // Get the token and the methods by splitting
594
- // on the pipe symbol.
595
- const [token, ...methods] = value.split('|').map(item => item.trim());
596
- // Get the value for the token from
597
- // the interpolation data.
598
- const interpolationValue = interpolationData[token] || token;
599
- // Loop through all the middleware methods and try to
600
- // conform the string to the given parameters.
601
- return methods.reduce((string, middlewareName) => {
602
- // Try to retrieve the middleware from the collection.
603
- const middleware = this._functionMiddleware[middlewareName];
604
- // If the middleware is missing return an error
605
- // so that the user knows it was not found.
606
- if (!middleware) {
607
- return string;
608
- }
609
- // Execute the middleware function with the string.
610
- return middleware.transform(string, this.locale);
611
- }, `${interpolationValue}`);
612
- }
613
- findReferencesInTranslation(value) {
614
- // Get the reference substitutions.
615
- const substitutions = this.getSubstitutions('references', ['#(', ')']);
616
- // Get all matches in the value.
617
- const matches = this.getMatches(value, substitutions);
618
- // Replace all matches with the translated value.
619
- return matches.reduce((previous, current) => {
620
- // Try to translate the token.
621
- const translatedToken = this.translate(current.token);
622
- // Replace the match with the translated token.
623
- return previous.replace(current.match, translatedToken);
624
- }, value);
625
- }
626
- getSubstitutions(type, defaultValue) {
627
- const substitutions = (this._config
628
- && this._config.substitutions
629
- && this._config.substitutions[type]);
630
- // Get the substitutions.
631
- const value = (!substitutions || substitutions.length !== 2)
632
- ? defaultValue
633
- : substitutions;
634
- // Escape both substitutions so that they
635
- // can be used.
636
- const escape = /[.*+?^${}()|[\]\\]/g;
637
- const start = value[0].replace(escape, '\\$&');
638
- const end = value[1].replace(escape, '\\$&');
639
- // Return the substitutions.
640
- return { start, end };
641
- }
642
- retrieveBestMatchingDictionary() {
643
- // Get the dictionary based on storage.
644
- const storageDictionary = this.getDictionaryFromStorage();
645
- // Get the dictionary based on the supported language.
646
- const browserDictionary = this.getBestBrowserMatchDictionary();
647
- // Get the dictionary based on the first index.
648
- const firstDictionary = this._dictionaries[0];
649
- // Return the best matching dictionary.
650
- return storageDictionary || browserDictionary || firstDictionary;
651
- }
652
- getDictionaryFromStorage() {
653
- // Get dictionary id from the storage..
654
- const dictionaryId = this._storage.cookie.get(this._storageToken);
655
- // Return the dictionary based on the storage dictionary id.
656
- return this._dictionaries.find(item => item.id === dictionaryId);
657
- }
658
- getBestBrowserMatchDictionary() {
659
- // Loop through all browser languages and return the
660
- // best matching dictionary.
661
- return this._languages.all.map(({ code, region }) => {
662
- const languageCode = [code, region].filter(data => !!data).join('-');
663
- return this._dictionaries.find(item => item.supportedLanguages.includes(languageCode));
664
- }).filter(item => !!item).find((_, index) => index === 0);
665
- }
666
- async load(dictionary) {
667
- const data = this._state?.hasKey(dictionary.stateKey)
668
- ? this._state?.get(dictionary.stateKey, {})
669
- : null;
670
- // Try to load the dictionary data.
671
- const loaded = await dictionary.load(data);
672
- // Verify the data was loaded.
673
- if (!loaded) {
674
- throw new Error(`Localize: Could not correctly fetch the data from: "${dictionary.id}"`);
675
- }
676
- if (!this._platform.isBrowser && this._state) {
677
- this._state?.set(dictionary?.stateKey, dictionary?.data ?? {});
678
- }
679
- // Combine the extra dictionary data.
680
- (this._extras || []).forEach(extraDictionary => dictionary.combine(extraDictionary));
681
- // Return the dictionary.
682
- return dictionary;
683
- }
684
- renderDocumentLanguage() {
685
- const element = this._document?.documentElement;
686
- if (!element) {
687
- return;
688
- }
689
- element.lang = this._currentDictionary?.supportedLanguages?.[0] ?? this._currentDictionary?.locale;
690
- }
691
- }
692
- Localize.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: Localize, deps: [{ token: i1$1.HttpClient }, { token: i2.Storage }, { token: i3.Platform }, { token: i3.Languages }, { token: i4.TransferState, optional: true }, { token: LocalizeConfig, optional: true }, { token: LocalizeMissingHandler }, { token: DOCUMENT, optional: true }, { token: LOCATION, optional: true }, { token: BASE_URL, optional: true }, { token: LOCALIZE_FUNCTION, optional: true }, { token: LOCALIZE_EXTRA_DICTIONARY, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
693
- Localize.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: Localize });
694
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: Localize, decorators: [{
695
- type: Injectable
696
- }], ctorParameters: function () { return [{ type: i1$1.HttpClient }, { type: i2.Storage }, { type: i3.Platform }, { type: i3.Languages }, { type: i4.TransferState, decorators: [{
697
- type: Optional
698
- }] }, { type: LocalizeConfig, decorators: [{
699
- type: Optional
700
- }] }, { type: LocalizeMissingHandler }, { type: undefined, decorators: [{
701
- type: Optional
702
- }, {
703
- type: Inject,
704
- args: [DOCUMENT]
705
- }] }, { type: undefined, decorators: [{
706
- type: Optional
707
- }, {
708
- type: Inject,
709
- args: [LOCATION]
710
- }] }, { type: undefined, decorators: [{
711
- type: Optional
712
- }, {
713
- type: Inject,
714
- args: [BASE_URL]
715
- }] }, { type: undefined, decorators: [{
716
- type: Optional
717
- }, {
718
- type: Inject,
719
- args: [LOCALIZE_FUNCTION]
720
- }] }, { type: undefined, decorators: [{
721
- type: Optional
722
- }, {
723
- type: Inject,
724
- args: [LOCALIZE_EXTRA_DICTIONARY]
325
+ class Localize {
326
+ constructor(_storage, _languages, _config, _missingHandler, _document, _functions) {
327
+ this._storage = _storage;
328
+ this._languages = _languages;
329
+ this._config = _config;
330
+ this._missingHandler = _missingHandler;
331
+ this._document = _document;
332
+ this._functions = _functions;
333
+ this._storageToken = 'bb-language-dictionary-id';
334
+ // Current language dictionary.
335
+ this._currentLanguage = null;
336
+ this._currentDictionary = null;
337
+ this.convertToParams = (tokenOrParams) => {
338
+ if (typeof tokenOrParams !== 'string') {
339
+ // Destruct the params from the object.
340
+ const { token, optional, data } = tokenOrParams;
341
+ // Make sure all parameters are valid
342
+ // by type safe adding them.
343
+ return { token: token, optional: optional ?? false, data: data ?? {} };
344
+ }
345
+ // If the parameter is a string fill in the blanks.
346
+ return { token: tokenOrParams, optional: false, data: {} };
347
+ };
348
+ this.getMatches = (value, substitutions) => {
349
+ // Get the matching substitutions.
350
+ const { start, end } = substitutions;
351
+ // Compose a regex that will find the matches.
352
+ const regex = new RegExp(`${start}([^${end}]+)${end}`, 'g');
353
+ // Execute the regex to find matches.
354
+ let match = regex.exec(value);
355
+ const matches = [];
356
+ while (match !== null) {
357
+ matches.push({ match: match[0], token: match[1] });
358
+ match = regex.exec(value);
359
+ }
360
+ // Return the processed value.
361
+ return matches.filter(item => !!item);
362
+ };
363
+ // Check if at least one language was passed in the config.
364
+ this._availableLanguages = this._config.languages;
365
+ if (this._availableLanguages.length < 1) {
366
+ throw new Error('Localize: one or more languages should be supplied.');
367
+ }
368
+ // Gather all the localize functions.
369
+ this._functionMiddleware = this._functions.reduce((previous, current) => {
370
+ previous[current.keyword()] = current;
371
+ return previous;
372
+ }, {});
373
+ // Save the best matching current dictionary.
374
+ this._bestMatchingLanguage = this.retrieveBestMatchingLanguage();
375
+ this.renderDocumentLanguage();
376
+ }
377
+ get languages() {
378
+ return this._availableLanguages ?? [];
379
+ }
380
+ get current() {
381
+ return this._currentLanguage;
382
+ }
383
+ async set(language, cache = true) {
384
+ // Await the language data and set the current
385
+ // dictionary to the loaded data.
386
+ this._currentLanguage = language;
387
+ this._currentDictionary = await language.data();
388
+ // Save the selected language in the storage.
389
+ if (cache) {
390
+ this._storage.cookie.set(this._storageToken, this._currentLanguage?.id, {});
391
+ }
392
+ }
393
+ initialize() {
394
+ return async () => this.set(this._bestMatchingLanguage, false);
395
+ }
396
+ clear() {
397
+ this._storage.cookie.remove(this._storageToken);
398
+ }
399
+ translate(tokenOrParams) {
400
+ // 1. Convert to the params.
401
+ const params = this.convertToParams(tokenOrParams);
402
+ // 2. Try to find the translation in the dictionary.
403
+ const searchResult = this._currentDictionary.get(params?.token);
404
+ // 3. Verify the translation was found.
405
+ if (!searchResult) {
406
+ return this._missingHandler.handle(params);
407
+ }
408
+ // 4. Find references in the translation that need to be translated as well.
409
+ const processResult = this.findReferencesInTranslation(searchResult);
410
+ // 5. Parse the interpolation data.
411
+ return this.parseInterpolationData(processResult, params?.data);
412
+ }
413
+ parseInterpolationData(value, data) {
414
+ // Get the interpolation substitutions.
415
+ const substitutions = this.getSubstitutions('interpolation', ['{{', '}}']);
416
+ // Get all matches in the value.
417
+ const matches = this.getMatches(value, substitutions);
418
+ // Replace all matches with the parsed value.
419
+ return matches.reduce((previous, current) => {
420
+ // Try to parse the token.
421
+ const interpolatedToken = this.interpolateFunctionData(current?.token, data);
422
+ // Replace the match with the parsed token.
423
+ return previous.replace(current?.match, interpolatedToken);
424
+ }, `${value}`);
425
+ }
426
+ interpolateFunctionData(value, interpolationData) {
427
+ // Get the token and the methods by splitting
428
+ // on the pipe symbol.
429
+ const [token, ...methods] = value.split('|').map(item => item.trim());
430
+ // Get the value for the token from
431
+ // the interpolation data.
432
+ const interpolationValue = interpolationData?.[token] ?? token;
433
+ // Loop through all the middleware methods and try to
434
+ // conform the string to the given parameters.
435
+ return methods.reduce((string, middlewareName) => {
436
+ // Try to retrieve the middleware from the collection.
437
+ const middleware = this._functionMiddleware[middlewareName];
438
+ // If the middleware is missing return an error
439
+ // so that the user knows it was not found.
440
+ if (!middleware) {
441
+ return string;
442
+ }
443
+ // Execute the middleware function with the string.
444
+ return middleware.transform(string, this.current?.locale);
445
+ }, `${interpolationValue}`);
446
+ }
447
+ findReferencesInTranslation(value) {
448
+ // Get the reference substitutions.
449
+ const substitutions = this.getSubstitutions('references', ['#(', ')']);
450
+ // Get all matches in the value.
451
+ const matches = this.getMatches(value, substitutions);
452
+ // Replace all matches with the translated value.
453
+ return matches.reduce((previous, current) => {
454
+ // Try to translate the token.
455
+ const translatedToken = this.translate(current?.token);
456
+ // Replace the match with the translated token.
457
+ return previous.replace(current?.match, translatedToken);
458
+ }, value);
459
+ }
460
+ getSubstitutions(type, defaultValue) {
461
+ // Get the substitutions.
462
+ const substitutions = this._config?.substitutions?.[type] ?? null;
463
+ const value = (!substitutions || substitutions.length !== 2)
464
+ ? defaultValue
465
+ : substitutions;
466
+ // Escape both substitutions so that they
467
+ // can be used.
468
+ const escape = /[.*+?^${}()|[\]\\]/g;
469
+ const start = value[0].replace(escape, '\\$&');
470
+ const end = value[1].replace(escape, '\\$&');
471
+ // Return the substitutions.
472
+ return { start, end };
473
+ }
474
+ retrieveBestMatchingLanguage() {
475
+ // Get the language based on storage.
476
+ const storageLanguage = this.getLanguageFromStorage();
477
+ // Get the language based on the supported languages of the browser.
478
+ const browserLanguage = this.getBestBrowserMatchLanguage();
479
+ // Return the best matching language.
480
+ return storageLanguage ?? browserLanguage ?? this._languages?.[0];
481
+ }
482
+ getLanguageFromStorage() {
483
+ // Get id from the storage.
484
+ const id = this._storage.cookie.get(this._storageToken);
485
+ // Return the language based on the storage id.
486
+ return this._availableLanguages.find(item => item?.id === id);
487
+ }
488
+ getBestBrowserMatchLanguage() {
489
+ // Loop through all browser languages and return the
490
+ // best matching language.
491
+ return this._languages.all.map(({ code, region }) => {
492
+ const languageCode = [code, region].filter(data => !!data).join('-');
493
+ return this._availableLanguages.find(item => item?.supported?.includes(languageCode));
494
+ }).filter(item => !!item).find((_, index) => index === 0);
495
+ }
496
+ renderDocumentLanguage() {
497
+ const element = this._document?.documentElement;
498
+ if (!element) {
499
+ return;
500
+ }
501
+ element.lang = this._bestMatchingLanguage?.supported?.[0] ?? this._bestMatchingLanguage?.locale;
502
+ }
503
+ }
504
+ Localize.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: Localize, deps: [{ token: i1$1.Storage }, { token: i2.Languages }, { token: LocalizeConfig, optional: true }, { token: LocalizeMissingHandler }, { token: DOCUMENT, optional: true }, { token: LOCALIZE_FUNCTION, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
505
+ Localize.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: Localize });
506
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: Localize, decorators: [{
507
+ type: Injectable
508
+ }], ctorParameters: function () { return [{ type: i1$1.Storage }, { type: i2.Languages }, { type: LocalizeConfig, decorators: [{
509
+ type: Optional
510
+ }] }, { type: LocalizeMissingHandler }, { type: undefined, decorators: [{
511
+ type: Optional
512
+ }, {
513
+ type: Inject,
514
+ args: [DOCUMENT]
515
+ }] }, { type: undefined, decorators: [{
516
+ type: Optional
517
+ }, {
518
+ type: Inject,
519
+ args: [LOCALIZE_FUNCTION]
725
520
  }] }]; } });
726
521
 
727
- class BbLocalize {
728
- constructor(_localize) {
729
- this._localize = _localize;
730
- }
731
- transform(tokenOrParams, args) {
732
- // Validate that the localize service
733
- // exists in the pipe.
734
- if (!this._localize) {
735
- return tokenOrParams;
736
- }
737
- // Combine the params with the options
738
- // to form the localize params.
739
- const params = this.combineParamsWithOptions(tokenOrParams, args);
740
- // Try to localize the value.
741
- return this._localize.translate(params);
742
- }
743
- combineParamsWithOptions(tokenOrParams, args) {
744
- // Gather the extras.
745
- const extras = args || {};
746
- // Loop through all the keys to find the set options.
747
- const options = Object.keys(extras).reduce((previous, current) => {
748
- if (typeof extras[current] === 'undefined') {
749
- return previous;
750
- }
751
- previous[current] = extras[current];
752
- return previous;
753
- }, {});
754
- // Convert the string token to a params object.
755
- const params = typeof tokenOrParams === 'string'
756
- ? { token: tokenOrParams, optional: false, data: {} }
757
- : tokenOrParams;
758
- // Return the combined params and options.
759
- return { ...params, ...options };
760
- }
761
- }
762
- BbLocalize.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbLocalize, deps: [{ token: Localize, optional: true }], target: i0.ɵɵFactoryTarget.Pipe });
763
- BbLocalize.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbLocalize, name: "bbLocalize" });
764
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbLocalize, decorators: [{
765
- type: Pipe,
766
- args: [{
767
- name: 'bbLocalize'
768
- }]
769
- }], ctorParameters: function () { return [{ type: Localize, decorators: [{
770
- type: Optional
522
+ class BbLocalize {
523
+ constructor(_localize) {
524
+ this._localize = _localize;
525
+ }
526
+ transform(tokenOrParams, args) {
527
+ // Validate that the localize service
528
+ // exists in the pipe.
529
+ if (!this._localize) {
530
+ return tokenOrParams;
531
+ }
532
+ // Combine the params with the options
533
+ // to form the localize params.
534
+ const params = this.combineParamsWithOptions(tokenOrParams, args);
535
+ // Try to localize the value.
536
+ return this._localize.translate(params);
537
+ }
538
+ combineParamsWithOptions(tokenOrParams, args) {
539
+ // Gather the extras.
540
+ const extras = args || {};
541
+ // Loop through all the keys to find the set options.
542
+ const options = Object.keys(extras).reduce((previous, current) => {
543
+ if (typeof extras[current] === 'undefined') {
544
+ return previous;
545
+ }
546
+ previous[current] = extras[current];
547
+ return previous;
548
+ }, {});
549
+ // Convert the string token to a params object.
550
+ const params = typeof tokenOrParams === 'string'
551
+ ? { token: tokenOrParams, optional: false, data: {} }
552
+ : tokenOrParams;
553
+ // Return the combined params and options.
554
+ return { ...params, ...options };
555
+ }
556
+ }
557
+ BbLocalize.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: BbLocalize, deps: [{ token: Localize, optional: true }], target: i0.ɵɵFactoryTarget.Pipe });
558
+ BbLocalize.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: BbLocalize, name: "bbLocalize" });
559
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: BbLocalize, decorators: [{
560
+ type: Pipe,
561
+ args: [{
562
+ name: 'bbLocalize'
563
+ }]
564
+ }], ctorParameters: function () { return [{ type: Localize, decorators: [{
565
+ type: Optional
771
566
  }] }]; } });
772
567
 
773
- class LocalizeModule {
774
- static forRoot(config) {
775
- return {
776
- ngModule: LocalizeModule,
777
- providers: [
778
- // Angular providers.
779
- { provide: APP_INITIALIZER, deps: [Localize], useFactory: initializeLocale, multi: true },
780
- { provide: LOCALE_ID, deps: [Localize], useFactory: getLocale },
781
- // Config provider.
782
- { provide: LocalizeConfig, useValue: config },
783
- // Function providers.
784
- { provide: LOCALIZE_FUNCTION, useClass: LocalizeLowercaseFunction, multi: true },
785
- { provide: LOCALIZE_FUNCTION, useClass: LocalizeUppercaseFunction, multi: true },
786
- { provide: LOCALIZE_FUNCTION, useClass: LocalizeDateFunction, multi: true },
787
- // Handler providers.
788
- { provide: LocalizeMissingHandler, useClass: LocalizeMissingHandler },
789
- // Service providers.
790
- Localize
791
- ]
792
- };
793
- }
794
- }
795
- LocalizeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: LocalizeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
796
- LocalizeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: LocalizeModule, declarations: [BbLocalize,
797
- BbLocalizeString,
798
- BbLocalizeTemplate,
799
- BbLocalizeTemplateOrString], imports: [CommonModule, HttpClientModule], exports: [BbLocalize,
800
- BbLocalizeString,
801
- BbLocalizeTemplate] });
802
- LocalizeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: LocalizeModule, imports: [[CommonModule, HttpClientModule]] });
803
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: LocalizeModule, decorators: [{
804
- type: NgModule,
805
- args: [{
806
- imports: [CommonModule, HttpClientModule],
807
- declarations: [
808
- BbLocalize,
809
- BbLocalizeString,
810
- BbLocalizeTemplate,
811
- BbLocalizeTemplateOrString
812
- ],
813
- exports: [
814
- BbLocalize,
815
- BbLocalizeString,
816
- BbLocalizeTemplate
817
- ]
818
- }]
819
- }] });
820
- function initializeLocale(localize) {
821
- return localize.initialize();
822
- }
823
- function getLocale(localize) {
824
- return localize.locale;
568
+ class LocalizeModule {
569
+ static forRoot(config) {
570
+ const automatic = config?.automatic ?? true;
571
+ return {
572
+ ngModule: LocalizeModule,
573
+ providers: [
574
+ // Angular providers.
575
+ ...(automatic ? [
576
+ { provide: APP_INITIALIZER, deps: [Localize], useFactory: initializeLocale, multi: true },
577
+ { provide: LOCALE_ID, deps: [Localize], useFactory: getLocale }
578
+ ] : []),
579
+ // Config provider.
580
+ { provide: LocalizeConfig, useValue: config },
581
+ // Function providers.
582
+ { provide: LOCALIZE_FUNCTION, useClass: LocalizeLowercaseFunction, multi: true },
583
+ { provide: LOCALIZE_FUNCTION, useClass: LocalizeUppercaseFunction, multi: true },
584
+ { provide: LOCALIZE_FUNCTION, useClass: LocalizeDateFunction, multi: true },
585
+ // Handler providers.
586
+ { provide: LocalizeMissingHandler, useClass: LocalizeMissingHandler },
587
+ // Service providers.
588
+ Localize
589
+ ]
590
+ };
591
+ }
592
+ }
593
+ LocalizeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: LocalizeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
594
+ LocalizeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: LocalizeModule, declarations: [BbLocalize,
595
+ BbLocalizeString,
596
+ BbLocalizeTemplate,
597
+ BbLocalizeTemplateOrString], imports: [CommonModule], exports: [BbLocalize,
598
+ BbLocalizeString,
599
+ BbLocalizeTemplate] });
600
+ LocalizeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: LocalizeModule, imports: [[CommonModule]] });
601
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: LocalizeModule, decorators: [{
602
+ type: NgModule,
603
+ args: [{
604
+ imports: [CommonModule],
605
+ declarations: [
606
+ BbLocalize,
607
+ BbLocalizeString,
608
+ BbLocalizeTemplate,
609
+ BbLocalizeTemplateOrString
610
+ ],
611
+ exports: [
612
+ BbLocalize,
613
+ BbLocalizeString,
614
+ BbLocalizeTemplate
615
+ ]
616
+ }]
617
+ }] });
618
+ function initializeLocale(localize) {
619
+ return localize.initialize();
620
+ }
621
+ function getLocale(localize) {
622
+ return localize?.current?.locale ?? null;
825
623
  }
826
624
 
827
- /**
828
- * Generated bundle index. Do not edit.
625
+ /**
626
+ * Generated bundle index. Do not edit.
829
627
  */
830
628
 
831
- export { BbLocalize, BbLocalizeString, BbLocalizeTemplate, LOCALIZATION_EXTRA_DUTCH, LOCALIZATION_EXTRA_ENGLISH, LOCALIZE_EXTRA_DICTIONARY, LOCALIZE_FUNCTION, Localize, LocalizeConfig, LocalizeDateFunction, LocalizeDictionary, LocalizeLowercaseFunction, LocalizeMissingHandler, LocalizeModule, LocalizeUppercaseFunction, getLocale, initializeLocale };
629
+ export { BbLocalize, BbLocalizeString, BbLocalizeTemplate, LOCALIZE_FUNCTION, Localize, LocalizeConfig, LocalizeDateFunction, LocalizeDictionary, LocalizeLowercaseFunction, LocalizeMissingHandler, LocalizeModule, LocalizeUppercaseFunction, extraDutchDictionary, extraEnglishDictionary, getLocale, initializeLocale };
832
630
  //# sourceMappingURL=bravobit-bb-foundation-localize.mjs.map