@bravobit/bb-foundation 0.15.4 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (377) hide show
  1. package/auth/lib/auth.interceptor.d.ts +1 -1
  2. package/auth/lib/auth.service.d.ts +1 -1
  3. package/auth/package.json +5 -5
  4. package/collections/package.json +5 -5
  5. package/controls/bravobit-bb-foundation-controls.d.ts +5 -0
  6. package/controls/lib/checkbox/checkbox.component.d.ts +27 -0
  7. package/controls/lib/checkbox/checkbox.module.d.ts +9 -0
  8. package/controls/lib/controls.module.d.ts +7 -0
  9. package/controls/package.json +10 -0
  10. package/controls/public_api.d.ts +3 -0
  11. package/dashboard/package.json +5 -5
  12. package/dialog/package.json +5 -5
  13. package/elements/package.json +5 -5
  14. package/{esm2015/auth/bravobit-bb-foundation-auth.js → esm2020/auth/bravobit-bb-foundation-auth.mjs} +0 -0
  15. package/esm2020/auth/lib/auth.interceptor.mjs +94 -0
  16. package/{esm2015/auth/lib/auth.module.js → esm2020/auth/lib/auth.module.mjs} +5 -5
  17. package/esm2020/auth/lib/auth.service.mjs +276 -0
  18. package/esm2020/auth/lib/auth.session.mjs +131 -0
  19. package/{esm2015/auth/lib/directives/authenticated.directive.js → esm2020/auth/lib/directives/authenticated.directive.mjs} +5 -6
  20. package/esm2020/auth/lib/directives/permission.directive.mjs +80 -0
  21. package/esm2020/auth/lib/directives/role.directive.mjs +37 -0
  22. package/esm2020/auth/lib/guards/anonymous.guard.mjs +34 -0
  23. package/esm2020/auth/lib/guards/authenticated.guard.mjs +35 -0
  24. package/{esm2015/auth/lib/helpers/jwt.helper.js → esm2020/auth/lib/helpers/jwt.helper.mjs} +3 -3
  25. package/{esm2015/auth/lib/helpers/mapper.helper.js → esm2020/auth/lib/helpers/mapper.helper.mjs} +4 -4
  26. package/{esm2015/auth/lib/interfaces/config.interface.js → esm2020/auth/lib/interfaces/config.interface.mjs} +0 -0
  27. package/{esm2015/auth/lib/interfaces/mapper.interface.js → esm2020/auth/lib/interfaces/mapper.interface.mjs} +0 -0
  28. package/{esm2015/auth/lib/interfaces/provider.interface.js → esm2020/auth/lib/interfaces/provider.interface.mjs} +0 -0
  29. package/{esm2015/auth/lib/interfaces/token.interface.js → esm2020/auth/lib/interfaces/token.interface.mjs} +0 -0
  30. package/esm2020/auth/lib/permissions.service.mjs +56 -0
  31. package/esm2020/auth/lib/providers/email.provider.mjs +25 -0
  32. package/esm2020/auth/lib/providers/verify.provider.mjs +19 -0
  33. package/{esm2015/auth/lib/tokens/use-authorization.token.js → esm2020/auth/lib/tokens/use-authorization.token.mjs} +0 -0
  34. package/{esm2015/auth/public_api.js → esm2020/auth/public_api.mjs} +0 -0
  35. package/{esm2015/bravobit-bb-foundation.js → esm2020/bravobit-bb-foundation.mjs} +0 -0
  36. package/{esm2015/collections/bravobit-bb-foundation-collections.js → esm2020/collections/bravobit-bb-foundation-collections.mjs} +0 -0
  37. package/esm2020/collections/lib/collection.mjs +98 -0
  38. package/{esm2015/collections/lib/collections.module.js → esm2020/collections/lib/collections.module.mjs} +5 -5
  39. package/esm2020/collections/lib/components/collections-pager/collections-pager.component.mjs +123 -0
  40. package/esm2020/collections/lib/components/collections-viewer/collections-viewer.component.mjs +31 -0
  41. package/{esm2015/collections/lib/components/collections.directive.js → esm2020/collections/lib/components/collections.directive.mjs} +13 -13
  42. package/{esm2015/collections/lib/interfaces/collection.interface.js → esm2020/collections/lib/interfaces/collection.interface.mjs} +0 -0
  43. package/esm2020/collections/lib/providers/api-collection.provider.mjs +68 -0
  44. package/esm2020/collections/lib/providers/collection.provider.mjs +13 -0
  45. package/{esm2015/collections/lib/providers/local-collection.provider.js → esm2020/collections/lib/providers/local-collection.provider.mjs} +0 -0
  46. package/{esm2015/collections/public_api.js → esm2020/collections/public_api.mjs} +0 -0
  47. package/esm2020/controls/bravobit-bb-foundation-controls.mjs +5 -0
  48. package/esm2020/controls/lib/checkbox/checkbox.component.mjs +86 -0
  49. package/esm2020/controls/lib/checkbox/checkbox.module.mjs +19 -0
  50. package/esm2020/controls/lib/controls.module.mjs +16 -0
  51. package/esm2020/controls/public_api.mjs +4 -0
  52. package/{esm2015/dashboard/bravobit-bb-foundation-dashboard.js → esm2020/dashboard/bravobit-bb-foundation-dashboard.mjs} +0 -0
  53. package/esm2020/dashboard/lib/dashboard/dashboard.component.mjs +56 -0
  54. package/esm2020/dashboard/lib/dashboard-header/dashboard-header.component.mjs +30 -0
  55. package/esm2020/dashboard/lib/dashboard-menu/dashboard-menu.component.mjs +31 -0
  56. package/esm2020/dashboard/lib/dashboard-menu-item/dashboard-menu-item.component.mjs +29 -0
  57. package/esm2020/dashboard/lib/dashboard-sidebar/dashboard-sidebar.component.mjs +75 -0
  58. package/esm2020/dashboard/lib/dashboard-sidebar-group/dashboard-sidebar-group.component.mjs +99 -0
  59. package/esm2020/dashboard/lib/dashboard-sidebar-item/dashboard-sidebar-item.component.mjs +62 -0
  60. package/{esm2015/dashboard/lib/dashboard.module.js → esm2020/dashboard/lib/dashboard.module.mjs} +5 -5
  61. package/{esm2015/dashboard/public_api.js → esm2020/dashboard/public_api.mjs} +0 -0
  62. package/{esm2015/dialog/bravobit-bb-foundation-dialog.js → esm2020/dialog/bravobit-bb-foundation-dialog.mjs} +0 -0
  63. package/esm2020/dialog/lib/dialog-actions/dialog-actions.component.mjs +12 -0
  64. package/esm2020/dialog/lib/dialog-confirm/dialog-confirm.component.mjs +37 -0
  65. package/{esm2015/dialog/lib/dialog-container/dialog-container.component.js → esm2020/dialog/lib/dialog-container/dialog-container.component.mjs} +6 -15
  66. package/esm2020/dialog/lib/dialog-header/dialog-header.component.mjs +25 -0
  67. package/esm2020/dialog/lib/dialog-link/dialog-link.component.mjs +11 -0
  68. package/esm2020/dialog/lib/dialog-modal/dialog-modal.component.mjs +46 -0
  69. package/esm2020/dialog/lib/dialog-overlay/dialog-overlay.component.mjs +134 -0
  70. package/{esm2015/dialog/lib/dialog.injector.js → esm2020/dialog/lib/dialog.injector.mjs} +0 -0
  71. package/{esm2015/dialog/lib/dialog.insertion.js → esm2020/dialog/lib/dialog.insertion.mjs} +4 -4
  72. package/{esm2015/dialog/lib/dialog.interfaces.js → esm2020/dialog/lib/dialog.interfaces.mjs} +0 -0
  73. package/{esm2015/dialog/lib/dialog.module.js → esm2020/dialog/lib/dialog.module.mjs} +5 -9
  74. package/{esm2015/dialog/lib/dialog.ref.js → esm2020/dialog/lib/dialog.ref.mjs} +0 -0
  75. package/{esm2015/dialog/lib/dialog.service.js → esm2020/dialog/lib/dialog.service.mjs} +5 -5
  76. package/{esm2015/dialog/public_api.js → esm2020/dialog/public_api.mjs} +0 -0
  77. package/{esm2015/elements/bravobit-bb-foundation-elements.js → esm2020/elements/bravobit-bb-foundation-elements.mjs} +0 -0
  78. package/esm2020/elements/lib/avatar/avatar.component.mjs +142 -0
  79. package/esm2020/elements/lib/button/button.component.mjs +61 -0
  80. package/esm2020/elements/lib/checkbox/checkbox.component.mjs +73 -0
  81. package/esm2020/elements/lib/date-picker/date-picker.component.mjs +304 -0
  82. package/{esm2015/elements/lib/directives/addon.directive.js → esm2020/elements/lib/directives/addon.directive.mjs} +7 -7
  83. package/esm2020/elements/lib/directives/autosize.directive.mjs +72 -0
  84. package/{esm2015/elements/lib/directives/focus-trap.directive.js → esm2020/elements/lib/directives/focus-trap.directive.mjs} +4 -4
  85. package/{esm2015/elements/lib/directives/focus.directive.js → esm2020/elements/lib/directives/focus.directive.mjs} +4 -4
  86. package/esm2020/elements/lib/directives/form-submit.directive.mjs +50 -0
  87. package/esm2020/elements/lib/directives/input.directive.mjs +136 -0
  88. package/{esm2015/elements/lib/directives/template.directive.js → esm2020/elements/lib/directives/template.directive.mjs} +4 -4
  89. package/esm2020/elements/lib/dropdown/dropdown.component.mjs +100 -0
  90. package/{esm2015/elements/lib/elements.interfaces.js → esm2020/elements/lib/elements.interfaces.mjs} +0 -0
  91. package/{esm2015/elements/lib/elements.module.js → esm2020/elements/lib/elements.module.mjs} +5 -5
  92. package/esm2020/elements/lib/file-picker/file-picker.component.mjs +236 -0
  93. package/esm2020/elements/lib/form-control/form-control.component.mjs +49 -0
  94. package/esm2020/elements/lib/form-error/form-error.component.mjs +108 -0
  95. package/esm2020/elements/lib/form-group/form-group.component.mjs +18 -0
  96. package/esm2020/elements/lib/icon/icon.component.mjs +102 -0
  97. package/esm2020/elements/lib/image-picker/image-picker.component.mjs +106 -0
  98. package/esm2020/elements/lib/pipes/file-image.pipe.mjs +42 -0
  99. package/{esm2015/elements/lib/pipes/file-size.pipe.js → esm2020/elements/lib/pipes/file-size.pipe.mjs} +4 -4
  100. package/esm2020/elements/lib/pipes/relative-time.pipe.mjs +94 -0
  101. package/esm2020/elements/lib/spinner/spinner.component.mjs +25 -0
  102. package/esm2020/elements/lib/tag/tag.component.mjs +18 -0
  103. package/{esm2015/elements/public_api.js → esm2020/elements/public_api.mjs} +0 -0
  104. package/{esm2015/http/bravobit-bb-foundation-http.js → esm2020/http/bravobit-bb-foundation-http.mjs} +0 -0
  105. package/esm2020/http/lib/classes/http.config.mjs +29 -0
  106. package/esm2020/http/lib/classes/http.error.mjs +20 -0
  107. package/{esm2015/http/lib/http.interfaces.js → esm2020/http/lib/http.interfaces.mjs} +0 -0
  108. package/{esm2015/http/lib/http.module.js → esm2020/http/lib/http.module.mjs} +5 -5
  109. package/esm2020/http/lib/interceptors/base-url.interceptor.mjs +50 -0
  110. package/esm2020/http/lib/interceptors/error.interceptor.mjs +32 -0
  111. package/{esm2015/http/public_api.js → esm2020/http/public_api.mjs} +0 -0
  112. package/{esm2015/lib/core/coercions/boolean-coercion.js → esm2020/lib/core/coercions/boolean-coercion.mjs} +0 -0
  113. package/{esm2015/lib/core/miscellaneous/regex.js → esm2020/lib/core/miscellaneous/regex.mjs} +0 -0
  114. package/esm2020/lib/core/miscellaneous/validator.mjs +85 -0
  115. package/{esm2015/lib/core/mixins/can-disable.js → esm2020/lib/core/mixins/can-disable.mjs} +0 -0
  116. package/{esm2015/lib/core/mixins/can-hide-errors.js → esm2020/lib/core/mixins/can-hide-errors.mjs} +0 -0
  117. package/{esm2015/lib/core/mixins/can-load.js → esm2020/lib/core/mixins/can-load.mjs} +0 -0
  118. package/{esm2015/lib/core/mixins/constructor.js → esm2020/lib/core/mixins/constructor.mjs} +0 -0
  119. package/{esm2015/lib/core/mixins/has-error.js → esm2020/lib/core/mixins/has-error.mjs} +0 -0
  120. package/{esm2015/lib/core/mixins/is-focused.js → esm2020/lib/core/mixins/is-focused.mjs} +0 -0
  121. package/{esm2015/lib/core/mixins/is-grouped.js → esm2020/lib/core/mixins/is-grouped.mjs} +0 -0
  122. package/{esm2015/lib/core/mixins/is-readonly.js → esm2020/lib/core/mixins/is-readonly.mjs} +0 -0
  123. package/{esm2015/lib/core/mixins/is-required.js → esm2020/lib/core/mixins/is-required.mjs} +0 -0
  124. package/esm2020/lib/core/services/clipboard.service.mjs +70 -0
  125. package/esm2020/lib/core/services/exif.service.mjs +163 -0
  126. package/esm2020/lib/core/services/file-loader.service.mjs +87 -0
  127. package/esm2020/lib/core/services/image-converter.service.mjs +123 -0
  128. package/{esm2015/lib/core/services/languages.service.js → esm2020/lib/core/services/languages.service.mjs} +4 -4
  129. package/{esm2015/lib/core/services/network.service.js → esm2020/lib/core/services/network.service.mjs} +5 -6
  130. package/esm2020/lib/core/services/patch.service.mjs +63 -0
  131. package/{esm2015/lib/core/services/platform.service.js → esm2020/lib/core/services/platform.service.mjs} +5 -5
  132. package/{esm2015/lib/core/tokens/accept-language.token.js → esm2020/lib/core/tokens/accept-language.token.mjs} +0 -0
  133. package/{esm2015/lib/core/tokens/base-url.token.js → esm2020/lib/core/tokens/base-url.token.mjs} +0 -0
  134. package/{esm2015/lib/core/tokens/cookie.token.js → esm2020/lib/core/tokens/cookie.token.mjs} +0 -0
  135. package/{esm2015/lib/core/tokens/location.token.js → esm2020/lib/core/tokens/location.token.mjs} +0 -0
  136. package/{esm2015/lib/core/tokens/navigator.token.js → esm2020/lib/core/tokens/navigator.token.mjs} +0 -0
  137. package/{esm2015/lib/core/tokens/window.token.js → esm2020/lib/core/tokens/window.token.mjs} +0 -0
  138. package/{esm2015/localize/bravobit-bb-foundation-localize.js → esm2020/localize/bravobit-bb-foundation-localize.mjs} +0 -0
  139. package/{esm2015/localize/lib/functions/date.function.js → esm2020/localize/lib/functions/date.function.mjs} +0 -0
  140. package/{esm2015/localize/lib/functions/lowercase.function.js → esm2020/localize/lib/functions/lowercase.function.mjs} +0 -0
  141. package/{esm2015/localize/lib/functions/uppercase.function.js → esm2020/localize/lib/functions/uppercase.function.mjs} +0 -0
  142. package/{esm2015/localize/lib/handlers/missing.handler.js → esm2020/localize/lib/handlers/missing.handler.mjs} +0 -0
  143. package/{esm2015/localize/lib/interfaces/config.interfaces.js → esm2020/localize/lib/interfaces/config.interfaces.mjs} +0 -0
  144. package/{esm2015/localize/lib/interfaces/dictionary.interfaces.js → esm2020/localize/lib/interfaces/dictionary.interfaces.mjs} +0 -0
  145. package/{esm2015/localize/lib/interfaces/functions.interfaces.js → esm2020/localize/lib/interfaces/functions.interfaces.mjs} +0 -0
  146. package/{esm2015/localize/lib/interfaces/handlers.interfaces.js → esm2020/localize/lib/interfaces/handlers.interfaces.mjs} +0 -0
  147. package/{esm2015/localize/lib/interfaces/options.interfaces.js → esm2020/localize/lib/interfaces/options.interfaces.mjs} +0 -0
  148. package/{esm2015/localize/lib/localizations/dutch.localization.js → esm2020/localize/lib/localizations/dutch.localization.mjs} +0 -0
  149. package/{esm2015/localize/lib/localizations/english.localization.js → esm2020/localize/lib/localizations/english.localization.mjs} +0 -0
  150. package/esm2020/localize/lib/localize.dictionary.mjs +135 -0
  151. package/{esm2015/localize/lib/localize.module.js → esm2020/localize/lib/localize.module.mjs} +5 -5
  152. package/{esm2015/localize/lib/localize.pipe.js → esm2020/localize/lib/localize.pipe.mjs} +5 -5
  153. package/esm2020/localize/lib/localize.service.mjs +277 -0
  154. package/esm2020/localize/lib/views/localize-string/localize-string.component.mjs +88 -0
  155. package/{esm2015/localize/lib/views/localize-template-or-string.directive.js → esm2020/localize/lib/views/localize-template-or-string.directive.mjs} +4 -4
  156. package/{esm2015/localize/lib/views/localize-template.directive.js → esm2020/localize/lib/views/localize-template.directive.mjs} +4 -4
  157. package/{esm2015/localize/public_api.js → esm2020/localize/public_api.mjs} +0 -0
  158. package/{esm2015/notifications/bravobit-bb-foundation-notifications.js → esm2020/notifications/bravobit-bb-foundation-notifications.mjs} +0 -0
  159. package/esm2020/notifications/lib/notifications-item/notifications-item.component.mjs +100 -0
  160. package/esm2020/notifications/lib/notifications-list/notifications-list.component.mjs +47 -0
  161. package/{esm2015/notifications/lib/notifications.animations.js → esm2020/notifications/lib/notifications.animations.mjs} +0 -0
  162. package/{esm2015/notifications/lib/notifications.injector.js → esm2020/notifications/lib/notifications.injector.mjs} +0 -0
  163. package/{esm2015/notifications/lib/notifications.interfaces.js → esm2020/notifications/lib/notifications.interfaces.mjs} +0 -0
  164. package/{esm2015/notifications/lib/notifications.module.js → esm2020/notifications/lib/notifications.module.mjs} +6 -7
  165. package/{esm2015/notifications/lib/notifications.service.js → esm2020/notifications/lib/notifications.service.mjs} +5 -5
  166. package/{esm2015/notifications/public_api.js → esm2020/notifications/public_api.mjs} +0 -0
  167. package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
  168. package/{esm2015/recaptcha/bravobit-bb-foundation-recaptcha.js → esm2020/recaptcha/bravobit-bb-foundation-recaptcha.mjs} +0 -0
  169. package/esm2020/recaptcha/lib/recaptcha/recaptcha.component.mjs +185 -0
  170. package/esm2020/recaptcha/lib/recaptcha-loader.service.mjs +90 -0
  171. package/{esm2015/recaptcha/lib/recaptcha.interface.js → esm2020/recaptcha/lib/recaptcha.interface.mjs} +0 -0
  172. package/{esm2015/recaptcha/lib/recaptcha.module.js → esm2020/recaptcha/lib/recaptcha.module.mjs} +5 -5
  173. package/{esm2015/recaptcha/public_api.js → esm2020/recaptcha/public_api.mjs} +0 -0
  174. package/{esm2015/rxjs/bravobit-bb-foundation-rxjs.js → esm2020/rxjs/bravobit-bb-foundation-rxjs.mjs} +0 -0
  175. package/esm2020/rxjs/lib/operators/combine-latest-map.operator.mjs +10 -0
  176. package/{esm2015/rxjs/lib/operators/filter-nil.operator.js → esm2020/rxjs/lib/operators/filter-nil.operator.mjs} +0 -0
  177. package/{esm2015/rxjs/public_api.js → esm2020/rxjs/public_api.mjs} +0 -0
  178. package/{esm2015/storage/bravobit-bb-foundation-storage.js → esm2020/storage/bravobit-bb-foundation-storage.mjs} +0 -0
  179. package/{esm2015/storage/lib/interfaces/attributes.interface.js → esm2020/storage/lib/interfaces/attributes.interface.mjs} +0 -0
  180. package/{esm2015/storage/lib/interfaces/memory.interface.js → esm2020/storage/lib/interfaces/memory.interface.mjs} +0 -0
  181. package/{esm2015/storage/lib/interfaces/strategy.interface.js → esm2020/storage/lib/interfaces/strategy.interface.mjs} +0 -0
  182. package/esm2020/storage/lib/storage.service.mjs +109 -0
  183. package/esm2020/storage/lib/strategies/cookie-storage.strategy.mjs +142 -0
  184. package/{esm2015/storage/lib/strategies/memory-storage.strategy.js → esm2020/storage/lib/strategies/memory-storage.strategy.mjs} +2 -2
  185. package/esm2020/storage/lib/strategies/polyfill-storage.strategy.mjs +102 -0
  186. package/{esm2015/storage/public_api.js → esm2020/storage/public_api.mjs} +0 -0
  187. package/{esm2015/table/bravobit-bb-foundation-table.js → esm2020/table/bravobit-bb-foundation-table.mjs} +0 -0
  188. package/esm2020/table/lib/components/table/table.component.mjs +191 -0
  189. package/esm2020/table/lib/components/table-cell/table-cell.component.mjs +11 -0
  190. package/esm2020/table/lib/components/table-header-cell/table-header-cell.component.mjs +131 -0
  191. package/esm2020/table/lib/components/table-pager/table-pager.component.mjs +136 -0
  192. package/esm2020/table/lib/data/datasource.data.mjs +32 -0
  193. package/esm2020/table/lib/data/generic.data.mjs +72 -0
  194. package/{esm2015/table/lib/interfaces/datasource.interface.js → esm2020/table/lib/interfaces/datasource.interface.mjs} +0 -0
  195. package/{esm2015/table/lib/interfaces/table.interfaces.js → esm2020/table/lib/interfaces/table.interfaces.mjs} +0 -0
  196. package/{esm2015/table/lib/table.module.js → esm2020/table/lib/table.module.mjs} +5 -5
  197. package/{esm2015/table/public_api.js → esm2020/table/public_api.mjs} +0 -0
  198. package/fesm2015/{bravobit-bb-foundation-auth.js → bravobit-bb-foundation-auth.mjs} +79 -68
  199. package/fesm2015/bravobit-bb-foundation-auth.mjs.map +1 -0
  200. package/fesm2015/{bravobit-bb-foundation-collections.js → bravobit-bb-foundation-collections.mjs} +33 -47
  201. package/fesm2015/bravobit-bb-foundation-collections.mjs.map +1 -0
  202. package/fesm2015/bravobit-bb-foundation-controls.mjs +123 -0
  203. package/fesm2015/bravobit-bb-foundation-controls.mjs.map +1 -0
  204. package/fesm2015/bravobit-bb-foundation-dashboard.mjs +416 -0
  205. package/fesm2015/bravobit-bb-foundation-dashboard.mjs.map +1 -0
  206. package/fesm2015/{bravobit-bb-foundation-dialog.js → bravobit-bb-foundation-dialog.mjs} +45 -106
  207. package/fesm2015/bravobit-bb-foundation-dialog.mjs.map +1 -0
  208. package/fesm2015/{bravobit-bb-foundation-elements.js → bravobit-bb-foundation-elements.mjs} +193 -302
  209. package/fesm2015/bravobit-bb-foundation-elements.mjs.map +1 -0
  210. package/fesm2015/{bravobit-bb-foundation-http.js → bravobit-bb-foundation-http.mjs} +18 -16
  211. package/fesm2015/bravobit-bb-foundation-http.mjs.map +1 -0
  212. package/fesm2015/{bravobit-bb-foundation-localize.js → bravobit-bb-foundation-localize.mjs} +63 -69
  213. package/fesm2015/bravobit-bb-foundation-localize.mjs.map +1 -0
  214. package/fesm2015/bravobit-bb-foundation-notifications.mjs +377 -0
  215. package/fesm2015/bravobit-bb-foundation-notifications.mjs.map +1 -0
  216. package/fesm2015/{bravobit-bb-foundation-recaptcha.js → bravobit-bb-foundation-recaptcha.mjs} +40 -47
  217. package/fesm2015/bravobit-bb-foundation-recaptcha.mjs.map +1 -0
  218. package/fesm2015/{bravobit-bb-foundation-rxjs.js → bravobit-bb-foundation-rxjs.mjs} +1 -1
  219. package/fesm2015/bravobit-bb-foundation-rxjs.mjs.map +1 -0
  220. package/fesm2015/{bravobit-bb-foundation-storage.js → bravobit-bb-foundation-storage.mjs} +12 -10
  221. package/fesm2015/bravobit-bb-foundation-storage.mjs.map +1 -0
  222. package/fesm2015/bravobit-bb-foundation-table.mjs +603 -0
  223. package/fesm2015/bravobit-bb-foundation-table.mjs.map +1 -0
  224. package/fesm2015/{bravobit-bb-foundation.js → bravobit-bb-foundation.mjs} +74 -64
  225. package/fesm2015/bravobit-bb-foundation.mjs.map +1 -0
  226. package/fesm2020/bravobit-bb-foundation-auth.mjs +928 -0
  227. package/fesm2020/bravobit-bb-foundation-auth.mjs.map +1 -0
  228. package/fesm2020/bravobit-bb-foundation-collections.mjs +434 -0
  229. package/fesm2020/bravobit-bb-foundation-collections.mjs.map +1 -0
  230. package/fesm2020/bravobit-bb-foundation-controls.mjs +121 -0
  231. package/fesm2020/bravobit-bb-foundation-controls.mjs.map +1 -0
  232. package/fesm2020/bravobit-bb-foundation-dashboard.mjs +404 -0
  233. package/fesm2020/bravobit-bb-foundation-dashboard.mjs.map +1 -0
  234. package/fesm2020/bravobit-bb-foundation-dialog.mjs +584 -0
  235. package/fesm2020/bravobit-bb-foundation-dialog.mjs.map +1 -0
  236. package/fesm2020/bravobit-bb-foundation-elements.mjs +1993 -0
  237. package/fesm2020/bravobit-bb-foundation-elements.mjs.map +1 -0
  238. package/fesm2020/bravobit-bb-foundation-http.mjs +168 -0
  239. package/fesm2020/bravobit-bb-foundation-http.mjs.map +1 -0
  240. package/fesm2020/bravobit-bb-foundation-localize.mjs +832 -0
  241. package/fesm2020/bravobit-bb-foundation-localize.mjs.map +1 -0
  242. package/fesm2020/bravobit-bb-foundation-notifications.mjs +375 -0
  243. package/fesm2020/bravobit-bb-foundation-notifications.mjs.map +1 -0
  244. package/fesm2020/bravobit-bb-foundation-recaptcha.mjs +300 -0
  245. package/fesm2020/bravobit-bb-foundation-recaptcha.mjs.map +1 -0
  246. package/fesm2020/bravobit-bb-foundation-rxjs.mjs +21 -0
  247. package/fesm2020/bravobit-bb-foundation-rxjs.mjs.map +1 -0
  248. package/fesm2020/bravobit-bb-foundation-storage.mjs +413 -0
  249. package/fesm2020/bravobit-bb-foundation-storage.mjs.map +1 -0
  250. package/fesm2020/bravobit-bb-foundation-table.mjs +592 -0
  251. package/fesm2020/bravobit-bb-foundation-table.mjs.map +1 -0
  252. package/fesm2020/bravobit-bb-foundation.mjs +895 -0
  253. package/fesm2020/bravobit-bb-foundation.mjs.map +1 -0
  254. package/http/package.json +5 -5
  255. package/localize/package.json +5 -5
  256. package/notifications/package.json +5 -5
  257. package/package.json +125 -8
  258. package/recaptcha/package.json +5 -5
  259. package/rxjs/package.json +5 -5
  260. package/storage/package.json +5 -5
  261. package/table/lib/components/table/table.component.d.ts +3 -0
  262. package/table/package.json +5 -5
  263. package/bundles/bravobit-bb-foundation-auth.umd.js +0 -1483
  264. package/bundles/bravobit-bb-foundation-auth.umd.js.map +0 -1
  265. package/bundles/bravobit-bb-foundation-collections.umd.js +0 -868
  266. package/bundles/bravobit-bb-foundation-collections.umd.js.map +0 -1
  267. package/bundles/bravobit-bb-foundation-dashboard.umd.js +0 -876
  268. package/bundles/bravobit-bb-foundation-dashboard.umd.js.map +0 -1
  269. package/bundles/bravobit-bb-foundation-dialog.umd.js +0 -716
  270. package/bundles/bravobit-bb-foundation-dialog.umd.js.map +0 -1
  271. package/bundles/bravobit-bb-foundation-elements.umd.js +0 -2768
  272. package/bundles/bravobit-bb-foundation-elements.umd.js.map +0 -1
  273. package/bundles/bravobit-bb-foundation-http.umd.js +0 -535
  274. package/bundles/bravobit-bb-foundation-http.umd.js.map +0 -1
  275. package/bundles/bravobit-bb-foundation-localize.umd.js +0 -1292
  276. package/bundles/bravobit-bb-foundation-localize.umd.js.map +0 -1
  277. package/bundles/bravobit-bb-foundation-notifications.umd.js +0 -794
  278. package/bundles/bravobit-bb-foundation-notifications.umd.js.map +0 -1
  279. package/bundles/bravobit-bb-foundation-recaptcha.umd.js +0 -683
  280. package/bundles/bravobit-bb-foundation-recaptcha.umd.js.map +0 -1
  281. package/bundles/bravobit-bb-foundation-rxjs.umd.js +0 -29
  282. package/bundles/bravobit-bb-foundation-rxjs.umd.js.map +0 -1
  283. package/bundles/bravobit-bb-foundation-storage.umd.js +0 -799
  284. package/bundles/bravobit-bb-foundation-storage.umd.js.map +0 -1
  285. package/bundles/bravobit-bb-foundation-table.umd.js +0 -1070
  286. package/bundles/bravobit-bb-foundation-table.umd.js.map +0 -1
  287. package/bundles/bravobit-bb-foundation.umd.js +0 -1440
  288. package/bundles/bravobit-bb-foundation.umd.js.map +0 -1
  289. package/esm2015/auth/lib/auth.interceptor.js +0 -95
  290. package/esm2015/auth/lib/auth.service.js +0 -299
  291. package/esm2015/auth/lib/auth.session.js +0 -136
  292. package/esm2015/auth/lib/directives/permission.directive.js +0 -81
  293. package/esm2015/auth/lib/directives/role.directive.js +0 -38
  294. package/esm2015/auth/lib/guards/anonymous.guard.js +0 -35
  295. package/esm2015/auth/lib/guards/authenticated.guard.js +0 -36
  296. package/esm2015/auth/lib/permissions.service.js +0 -58
  297. package/esm2015/auth/lib/providers/email.provider.js +0 -26
  298. package/esm2015/auth/lib/providers/verify.provider.js +0 -20
  299. package/esm2015/collections/lib/collection.js +0 -104
  300. package/esm2015/collections/lib/components/collections-pager/collections-pager.component.js +0 -136
  301. package/esm2015/collections/lib/components/collections-viewer/collections-viewer.component.js +0 -39
  302. package/esm2015/collections/lib/providers/api-collection.provider.js +0 -69
  303. package/esm2015/collections/lib/providers/collection.provider.js +0 -14
  304. package/esm2015/dashboard/lib/dashboard/dashboard.component.js +0 -64
  305. package/esm2015/dashboard/lib/dashboard-header/dashboard-header.component.js +0 -41
  306. package/esm2015/dashboard/lib/dashboard-menu/dashboard-menu.component.js +0 -39
  307. package/esm2015/dashboard/lib/dashboard-menu-item/dashboard-menu-item.component.js +0 -38
  308. package/esm2015/dashboard/lib/dashboard-sidebar/dashboard-sidebar.component.js +0 -83
  309. package/esm2015/dashboard/lib/dashboard-sidebar-group/dashboard-sidebar-group.component.js +0 -110
  310. package/esm2015/dashboard/lib/dashboard-sidebar-item/dashboard-sidebar-item.component.js +0 -71
  311. package/esm2015/dialog/lib/dialog-actions/dialog-actions.component.js +0 -20
  312. package/esm2015/dialog/lib/dialog-confirm/dialog-confirm.component.js +0 -45
  313. package/esm2015/dialog/lib/dialog-header/dialog-header.component.js +0 -33
  314. package/esm2015/dialog/lib/dialog-link/dialog-link.component.js +0 -19
  315. package/esm2015/dialog/lib/dialog-modal/dialog-modal.component.js +0 -54
  316. package/esm2015/dialog/lib/dialog-overlay/dialog-overlay.component.js +0 -143
  317. package/esm2015/elements/lib/avatar/avatar.component.js +0 -151
  318. package/esm2015/elements/lib/button/button.component.js +0 -79
  319. package/esm2015/elements/lib/checkbox/checkbox.component.js +0 -83
  320. package/esm2015/elements/lib/date-picker/date-picker.component.js +0 -322
  321. package/esm2015/elements/lib/directives/autosize.directive.js +0 -74
  322. package/esm2015/elements/lib/directives/form-submit.directive.js +0 -53
  323. package/esm2015/elements/lib/directives/input.directive.js +0 -139
  324. package/esm2015/elements/lib/dropdown/dropdown.component.js +0 -111
  325. package/esm2015/elements/lib/file-picker/file-picker.component.js +0 -247
  326. package/esm2015/elements/lib/form-control/form-control.component.js +0 -58
  327. package/esm2015/elements/lib/form-error/form-error.component.js +0 -116
  328. package/esm2015/elements/lib/form-group/form-group.component.js +0 -27
  329. package/esm2015/elements/lib/icon/icon.component.js +0 -110
  330. package/esm2015/elements/lib/image-picker/image-picker.component.js +0 -119
  331. package/esm2015/elements/lib/pipes/file-image.pipe.js +0 -45
  332. package/esm2015/elements/lib/pipes/relative-time.pipe.js +0 -96
  333. package/esm2015/elements/lib/spinner/spinner.component.js +0 -34
  334. package/esm2015/elements/lib/tag/tag.component.js +0 -26
  335. package/esm2015/http/lib/classes/http.config.js +0 -31
  336. package/esm2015/http/lib/classes/http.error.js +0 -21
  337. package/esm2015/http/lib/interceptors/base-url.interceptor.js +0 -52
  338. package/esm2015/http/lib/interceptors/error.interceptor.js +0 -33
  339. package/esm2015/lib/core/miscellaneous/validator.js +0 -86
  340. package/esm2015/lib/core/services/clipboard.service.js +0 -72
  341. package/esm2015/lib/core/services/exif.service.js +0 -168
  342. package/esm2015/lib/core/services/file-loader.service.js +0 -90
  343. package/esm2015/lib/core/services/image-converter.service.js +0 -130
  344. package/esm2015/lib/core/services/patch.service.js +0 -65
  345. package/esm2015/localize/lib/localize.dictionary.js +0 -137
  346. package/esm2015/localize/lib/localize.service.js +0 -282
  347. package/esm2015/localize/lib/views/localize-string/localize-string.component.js +0 -99
  348. package/esm2015/notifications/lib/notifications-item/notifications-item.component.js +0 -108
  349. package/esm2015/notifications/lib/notifications-list/notifications-list.component.js +0 -56
  350. package/esm2015/recaptcha/lib/recaptcha/recaptcha.component.js +0 -199
  351. package/esm2015/recaptcha/lib/recaptcha-loader.service.js +0 -93
  352. package/esm2015/rxjs/lib/operators/combine-latest-map.operator.js +0 -7
  353. package/esm2015/storage/lib/storage.service.js +0 -111
  354. package/esm2015/storage/lib/strategies/cookie-storage.strategy.js +0 -143
  355. package/esm2015/storage/lib/strategies/polyfill-storage.strategy.js +0 -102
  356. package/esm2015/table/lib/components/table/table.component.js +0 -196
  357. package/esm2015/table/lib/components/table-cell/table-cell.component.js +0 -19
  358. package/esm2015/table/lib/components/table-header-cell/table-header-cell.component.js +0 -141
  359. package/esm2015/table/lib/components/table-pager/table-pager.component.js +0 -146
  360. package/esm2015/table/lib/data/datasource.data.js +0 -32
  361. package/esm2015/table/lib/data/generic.data.js +0 -73
  362. package/fesm2015/bravobit-bb-foundation-auth.js.map +0 -1
  363. package/fesm2015/bravobit-bb-foundation-collections.js.map +0 -1
  364. package/fesm2015/bravobit-bb-foundation-dashboard.js +0 -468
  365. package/fesm2015/bravobit-bb-foundation-dashboard.js.map +0 -1
  366. package/fesm2015/bravobit-bb-foundation-dialog.js.map +0 -1
  367. package/fesm2015/bravobit-bb-foundation-elements.js.map +0 -1
  368. package/fesm2015/bravobit-bb-foundation-http.js.map +0 -1
  369. package/fesm2015/bravobit-bb-foundation-localize.js.map +0 -1
  370. package/fesm2015/bravobit-bb-foundation-notifications.js +0 -393
  371. package/fesm2015/bravobit-bb-foundation-notifications.js.map +0 -1
  372. package/fesm2015/bravobit-bb-foundation-recaptcha.js.map +0 -1
  373. package/fesm2015/bravobit-bb-foundation-rxjs.js.map +0 -1
  374. package/fesm2015/bravobit-bb-foundation-storage.js.map +0 -1
  375. package/fesm2015/bravobit-bb-foundation-table.js +0 -626
  376. package/fesm2015/bravobit-bb-foundation-table.js.map +0 -1
  377. package/fesm2015/bravobit-bb-foundation.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bravobit-bb-foundation-notifications.mjs","sources":["../../../projects/bb-foundation/notifications/src/lib/notifications.interfaces.ts","../../../projects/bb-foundation/notifications/src/lib/notifications.animations.ts","../../../projects/bb-foundation/notifications/src/lib/notifications-item/notifications-item.component.ts","../../../projects/bb-foundation/notifications/src/lib/notifications-item/notifications-item.component.html","../../../projects/bb-foundation/notifications/src/lib/notifications-list/notifications-list.component.ts","../../../projects/bb-foundation/notifications/src/lib/notifications-list/notifications-list.component.html","../../../projects/bb-foundation/notifications/src/lib/notifications.injector.ts","../../../projects/bb-foundation/notifications/src/lib/notifications.service.ts","../../../projects/bb-foundation/notifications/src/lib/notifications.module.ts","../../../projects/bb-foundation/notifications/src/bravobit-bb-foundation-notifications.ts"],"sourcesContent":["import {TemplateRef} from '@angular/core';\nimport {Observable} from 'rxjs';\n\nexport interface Notification {\n content: string | TemplateRef<any>;\n\n id?: string;\n\n timeout?: number;\n localize?: boolean;\n dismiss?: boolean;\n dismissText?: string;\n data?: { [key: string]: any };\n type?: NotificationType;\n actions?: NotificationAction[];\n\n color?: string;\n backgroundColor?: string;\n\n destroy?: () => void;\n}\n\nexport interface NotificationAction {\n title: string;\n callback?: () => any;\n type?: 'default' | 'cancel';\n}\n\nexport enum NotificationType {\n Success = 'success',\n Error = 'error',\n Warning = 'warning',\n Info = 'info',\n Custom = 'custom'\n}\n\nexport class NotificationsConfig {\n mode?: 'append' | 'prepend';\n position?: NotificationsPosition;\n timeout?: number;\n dismiss?: boolean;\n localize?: boolean;\n dismissText?: string;\n}\n\nexport enum NotificationsPosition {\n TopRight = 'flex-start|flex-end',\n BottomRight = 'flex-end|flex-end',\n TopLeft = 'flex-start|flex-start',\n BottomLeft = 'flex-end|flex-start'\n}\n\nexport class NotificationsData {\n data: Observable<Notification[]>;\n dismissText: string;\n position: NotificationsPosition;\n}\n","import {animate, group, query, stagger, style, transition, trigger} from '@angular/animations';\n\nconst s = '250ms cubic-bezier(0, 0, .2, 1)';\nconst l = '400ms cubic-bezier(0, 0, .2, 1)';\n\nexport const notificationAnimation = trigger('notificationListAnimation', [\n transition('* => *', [\n query(':enter', group([\n // 1. Set the initial state.\n style({height: 0, opacity: 0, transform: 'translateX({{ to }}%) scale(0.95)'}),\n // 2. Start the animation to show the item.\n stagger(0, [\n animate(s, style({height: '*'})),\n animate(l, style({opacity: 1, transform: 'translateX(0) scale(0.95)'})),\n animate(s, style({transform: 'translateX(0) scale(1)'}))\n ])\n ]), {optional: true}),\n\n query(':leave', group([\n // 1. Set the initial state.\n style({height: '*', opacity: 1, transform: 'translateX(0) scale(1)'}),\n // 2. Start the animation to hide the item.\n stagger(0, [\n animate(s, style({transform: 'translateX(0) scale(0.95)'})),\n animate(l, style({opacity: 0, transform: 'translateX({{ to }}%) scale(0.95)'})),\n animate(s, style({height: 0}))\n ])\n ]), {optional: true})\n ])\n]);\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n HostBinding,\n Input,\n NgZone,\n OnDestroy,\n OnInit,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport {Notification, NotificationAction} from '../notifications.interfaces';\nimport {Platform} from '@bravobit/bb-foundation';\n\n@Component({\n selector: 'bb-notifications-item',\n templateUrl: './notifications-item.component.html',\n styleUrls: ['./notifications-item.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n preserveWhitespaces: false,\n host: {\n 'role': 'alert'\n }\n})\nexport class BbNotificationsItem implements OnInit, OnDestroy {\n\n // Inputs.\n @Input() notification: Notification;\n @Input() dismissButtonText: string | null;\n\n // Elements.\n @ViewChild('progress') progressElementRef: ElementRef;\n\n // Data.\n private _progress = 0;\n private _count = 0;\n\n // Helper variables.\n private _steps: number;\n private _speed: number;\n private _timer: number;\n private _startTime: number;\n private _difference: number;\n\n // Data.\n private readonly _radius = 19;\n private readonly _circumference = this._radius * 2 * Math.PI;\n\n @HostBinding('class') get getClass() {\n return `bb-notifications-item ${this.notification.type}`;\n }\n\n constructor(private _zone: NgZone,\n private _platform: Platform,\n private _changeDetection: ChangeDetectorRef) {\n }\n\n get progressStrokeArray() {\n const value = Math.floor(this._circumference);\n return `${value}, ${value}`;\n }\n\n get progressStrokeOffset() {\n return Math.floor(this._circumference - this._progress / 100 * this._circumference);\n }\n\n get isContentString() {\n return typeof this.notification.content === 'string';\n }\n\n ngOnInit() {\n // Check if the notification timeout is not 0 and the platform is a browser.\n if (this.notification.timeout <= 0 || !this._platform.isBrowser) {\n this.notification.dismiss = true;\n return;\n }\n\n // Start the timeout.\n this.startTimeout();\n }\n\n ngOnDestroy() {\n // Clear the timeout if it was set.\n this._timer && window && window.clearTimeout && window.clearTimeout(this._timer);\n }\n\n callActionAndDestroy = (notification: Notification, action: NotificationAction) => {\n // Perform the callback (if it exists).\n action && action.callback && action.callback();\n\n // Call the destroy method (if it exists).\n notification && notification.destroy && notification.destroy();\n };\n\n private startTimeout() {\n // Calculate the steps of the timeout.\n this._steps = this.notification.timeout / 10;\n\n // Calculate the speed of the timeout.\n this._speed = this.notification.timeout / this._steps;\n\n // Get the start time.\n this._startTime = Date.now();\n\n // Set a new timer outside of Angular.\n this._zone.runOutsideAngular(() => this._timer = this.setTimeout(this.instance, this._speed));\n }\n\n private instance = () => {\n // Calculate the difference.\n this._difference = (Date.now() - this._startTime) - (this._count * this._speed);\n\n // Add up the count.\n if (this._count++ === this._steps) {\n this.notification.destroy();\n }\n\n // Add the steps to the progress.\n this._progress += 100 / this._steps;\n\n // Set a new timer.\n this._timer = this.setTimeout(this.instance, this._speed - this._difference);\n\n // Run a new change detection cycle.\n this._zone.run(() => this._changeDetection.detectChanges());\n };\n\n private setTimeout = (method: () => void, timeout: number) => {\n // Check if the window and method exist.\n if (!window || !window.setTimeout) {\n return null;\n }\n\n return window.setTimeout(method, timeout);\n };\n\n}\n","<div class=\"notification-content-wrapper\">\n <!--\n The icon for the notification.\n\n The icon is reflected by the type of the\n notification. Same goes for the color and\n background-color.\n -->\n <div [style.color]=\"notification?.color\"\n [style.background-color]=\"notification?.backgroundColor\"\n class=\"notification-icon-wrapper\">\n <svg xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 19.5\"\n class=\"notification-icon\">\n <path\n d=\"M8 19.5c1.1 0 2-.9 2-2H6c0 1.1.9 2 2 2zM14 13.5v-5c0-3.1-1.6-5.6-4.5-6.3v-.7C9.5.7 8.8 0 8 0S6.5.7 6.5 1.5v.7C3.6 2.9 2 5.4 2 8.5v5l-2 2v1h16v-1l-2-2z\">\n </path>\n </svg>\n\n <!--\n The circular progress for the notification.\n\n The progress is only visible when a timeout is\n set. The progress adapts to the time remaining\n for the notification.\n -->\n <svg *ngIf=\"notification?.timeout > 0\"\n class=\"notification-progress-ring\"\n viewBox=\"0 0 40 40\"\n role=\"progressbar\">\n <circle #progress\n [attr.stroke-dasharray]=\"progressStrokeArray\"\n [attr.stroke-dashoffset]=\"progressStrokeOffset\"\n [style.stroke]=\"notification?.color\"\n class=\"notification-progress-circle\"\n stroke-width=\"2\"\n fill=\"transparent\"\n r=\"19\"\n cx=\"20\"\n cy=\"20\">\n </circle>\n </svg>\n </div>\n\n <!--\n The content for the notification.\n\n This displays a string or a template based\n on the given parameter by the user.\n -->\n <div class=\"notification-content\">\n <ng-container *ngIf=\"isContentString; else templateContent\"\n [ngSwitch]=\"notification?.localize\">\n <ng-container *ngSwitchCase=\"true\">\n {{ $any(notification?.content) | bbLocalize:{data: notification?.data} }}\n </ng-container>\n <ng-container *ngSwitchDefault>\n {{ notification?.content }}\n </ng-container>\n </ng-container>\n </div>\n</div>\n\n<!--\n The actions of the notification.\n\n All actions are displayed here and are\n based on the actions array the user provided.\n-->\n<div *ngIf=\"notification?.actions?.length > 0 || notification?.dismiss\"\n class=\"notification-actions\">\n <button *ngFor=\"let action of notification?.actions\"\n (click)=\"callActionAndDestroy(notification, action)\"\n type=\"button\"\n [class.destructive]=\"action?.type === 'cancel'\"\n class=\"notification-actions-button\">\n <span [ngSwitch]=\"notification?.localize\"\n class=\"notification-actions-button-highlight\">\n <ng-container *ngSwitchCase=\"true\">\n {{ action?.title | bbLocalize:{data: notification?.data} }}\n </ng-container>\n <ng-container *ngSwitchDefault>\n {{ action?.title }}\n </ng-container>\n </span>\n </button>\n <button *ngIf=\"notification?.dismiss\"\n (click)=\"notification?.destroy()\"\n class=\"notification-actions-button destructive\"\n type=\"button\">\n <span class=\"notification-actions-button-highlight\">\n {{ notification?.dismissText || dismissButtonText }}\n </span>\n </button>\n</div>\n\n<!--\n The outlet for the notification content template ref.\n-->\n<ng-template #templateContent>\n <ng-container *ngTemplateOutlet=\"$any(notification?.content)\"></ng-container>\n</ng-template>\n","import {Notification, NotificationsData, NotificationsPosition} from '../notifications.interfaces';\nimport {ChangeDetectionStrategy, Component, HostBinding, ViewEncapsulation} from '@angular/core';\nimport {notificationAnimation} from '../notifications.animations';\n\n@Component({\n selector: 'bb-notifications-list',\n templateUrl: './notifications-list.component.html',\n styleUrls: ['./notifications-list.component.scss'],\n animations: [notificationAnimation],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n preserveWhitespaces: false,\n host: {\n 'class': 'bb-notifications-list',\n 'role': 'list'\n }\n})\nexport class BbNotificationsList {\n\n // Data.\n position: NotificationsPosition | null = null;\n\n // Track by function.\n trackByFn = (_, item: Notification) => item.id;\n\n constructor(public data: NotificationsData) {\n }\n\n @HostBinding('style.justify-content')\n get horizontalPosition() {\n return this.location.horizontal;\n }\n\n @HostBinding('style.align-items')\n get verticalPosition() {\n return this.location.vertical;\n }\n\n get animation() {\n const to = this.horizontalPosition === 'flex-start'\n ? -50\n : 50;\n\n return {to};\n }\n\n private get location() {\n const [y, x] = (this.data.position || '').split('|');\n\n return {vertical: y || null, horizontal: x || null};\n }\n\n}\n","<!--\n The notifications list.\n\n The list provides the animation effect for the\n incoming notifications.\n-->\n<div *ngIf=\"data?.data | async as notifications\"\n [@notificationListAnimation]=\"{value: notifications?.length, params: animation}\"\n class=\"notifications-list-wrapper\">\n <!--\n The loop for the notifications.\n\n All notifications will be displayed here. They\n are wrapped within a wrapper which separates them.\n -->\n <div *ngFor=\"let notification of notifications; trackBy: trackByFn\"\n class=\"notifications-item-wrapper\">\n <bb-notifications-item [notification]=\"notification\"\n [dismissButtonText]=\"data?.dismissText\">\n </bb-notifications-item>\n </div>\n</div>\n","import {InjectionToken, Injector, Type} from '@angular/core';\n\nexport class NotificationsInjector implements Injector {\n\n constructor(private _parentInjector: Injector,\n private _additionalTokens: WeakMap<any, any>) {\n }\n\n get<T>(token: Type<T> | InjectionToken<T>, notFoundValue?: T): T;\n get(token: any, notFoundValue?: any);\n get(token: any, notFoundValue?: any) {\n // First check if the additional token\n // contains the token.\n const value = this._additionalTokens.get(token);\n\n // If that value exists return it.\n if (value) {\n return value;\n }\n\n // Else query the parent injector.\n return this._parentInjector.get<any>(token, notFoundValue);\n }\n\n}\n","import {\n ApplicationRef,\n ComponentFactoryResolver,\n ComponentRef,\n Injectable,\n Injector,\n Optional,\n TemplateRef\n} from '@angular/core';\nimport {\n Notification,\n NotificationAction,\n NotificationsPosition,\n NotificationsConfig,\n NotificationType,\n NotificationsData\n} from './notifications.interfaces';\nimport {BbNotificationsList} from './notifications-list/notifications-list.component';\nimport {NotificationsInjector} from './notifications.injector';\nimport {Localize} from '@bravobit/bb-foundation/localize';\nimport {Platform} from '@bravobit/bb-foundation';\nimport {BehaviorSubject} from 'rxjs';\nimport {share} from 'rxjs/operators';\n\n@Injectable()\nexport class Notifications {\n\n // Reference to the list.\n private _ref: ComponentRef<BbNotificationsList>;\n\n // The default settings for the notifications.\n private readonly _defaultMode: 'prepend' | 'append';\n private readonly _defaultTimeout: number;\n private readonly _defaultLocalize: boolean;\n private readonly _defaultDismiss: boolean;\n private readonly _defaultDismissText: string;\n private readonly _defaultPosition: NotificationsPosition;\n\n // The data containing the notifications.\n private _notifications$ = new BehaviorSubject<Notification[]>([]);\n\n constructor(private _injector: Injector,\n private _platform: Platform,\n private _applicationRef: ApplicationRef,\n @Optional() private _localize: Localize,\n @Optional() private _config: NotificationsConfig,\n private _componentFactoryResolver: ComponentFactoryResolver) {\n // Get the config.\n const config = this._config || {};\n\n // Set the config.\n this._defaultMode = this.getProperty(config.mode, 'prepend');\n this._defaultTimeout = this.getProperty(config.timeout, 8000);\n this._defaultLocalize = this.getProperty(config.localize, false);\n this._defaultDismiss = this.getProperty(config.dismiss, true);\n this._defaultDismissText = this.getProperty(config.dismissText, 'Dismiss');\n this._defaultPosition = this.getProperty(config.position, NotificationsPosition.TopRight);\n\n // Create the element that holds all notifications.\n this.createElement();\n }\n\n success(content: string | TemplateRef<any>, actions: NotificationAction[] = [], timeout = this._defaultTimeout) {\n return this.create({content, timeout, actions, type: NotificationType.Success});\n }\n\n error(content: string | TemplateRef<any>, actions: NotificationAction[] = [], timeout = this._defaultTimeout) {\n return this.create({content, timeout, actions, type: NotificationType.Error});\n }\n\n warn(content: string | TemplateRef<any>, actions: NotificationAction[] = [], timeout = this._defaultTimeout) {\n return this.create({content, timeout, actions, type: NotificationType.Warning});\n }\n\n info(content: string | TemplateRef<any>, actions: NotificationAction[] = [], timeout = this._defaultTimeout) {\n return this.create({content, timeout, actions, type: NotificationType.Info});\n }\n\n create(notification: Notification) {\n // Compose a new notification item.\n const item = this.compose(notification);\n\n // Add the destroy function to the notification.\n item.destroy = () => this.pull(item);\n\n // Add the notification to the list\n // and return the item.\n return this.push(item);\n }\n\n private push(notification: Notification) {\n // Get the current list.\n const oldList = this._notifications$.getValue();\n\n // Check which mode is activated.\n let newList: Notification[];\n switch (this._defaultMode) {\n case 'append':\n newList = [...oldList, notification];\n break;\n case 'prepend':\n default:\n newList = [notification, ...oldList];\n }\n\n // Push the new notifications.\n this._notifications$.next(newList);\n\n // Return the notification for further use.\n return notification;\n }\n\n private pull(notification: Notification) {\n // Get the current list.\n const newList = this._notifications$\n .getValue()\n .filter(item => item.id !== notification.id);\n\n // Push a new list.\n this._notifications$.next(newList);\n }\n\n private compose(notification: Notification) {\n // Attach a random id to the notification.\n notification.id = Math.random().toString(36).substr(2, 10);\n\n // Set all properties.\n notification.type = this.getProperty(notification.type, NotificationType.Custom);\n notification.content = this.getProperty(notification.content, null);\n notification.data = this.getProperty(notification.data, {});\n notification.timeout = this.getProperty(notification.timeout, this._defaultTimeout);\n notification.localize = this.getProperty(notification.localize, this._defaultLocalize);\n notification.dismiss = this.getProperty(notification.dismiss, this._defaultDismiss);\n\n // Dismiss text localization.\n const dismissText = this.getProperty(notification.dismissText, this._defaultDismissText);\n notification.dismissText = this._defaultLocalize && this._localize\n ? this._localize.translate(dismissText)\n : dismissText;\n\n // Return the composed notification.\n return notification;\n }\n\n private createElement() {\n // Create a map with the config.\n const map = new WeakMap();\n map.set(NotificationsData, {\n data: this._notifications$.pipe(share()),\n dismissText: this._defaultDismissText,\n position: this._defaultPosition\n });\n\n // Create a custom injector.\n const notificationsInjector = new NotificationsInjector(this._injector, map);\n\n // Create the notification list and\n // get a reference to the component.\n this._ref = this._componentFactoryResolver\n .resolveComponentFactory(BbNotificationsList)\n .create(notificationsInjector);\n\n // Detect the changes.\n this._ref.changeDetectorRef.detectChanges();\n\n // Attach the component's view to the application\n // so that the change detection will run properly.\n this._applicationRef.attachView(this._ref.hostView);\n\n // If the platform is not a browser return.\n if (!this._platform.isBrowser) {\n return;\n }\n\n try {\n // Append the element to the DOM.\n document.body.appendChild(this._ref.location.nativeElement);\n } catch {\n // Don't do anything, because it must've failed.\n }\n }\n\n private getProperty = (property: any, defaultValue: any) => {\n return typeof property === 'undefined'\n ? defaultValue\n : property;\n };\n\n}\n","import {BbNotificationsList} from './notifications-list/notifications-list.component';\nimport {BbNotificationsItem} from './notifications-item/notifications-item.component';\nimport {LocalizeModule} from '@bravobit/bb-foundation/localize';\nimport {NotificationsConfig} from './notifications.interfaces';\nimport {ModuleWithProviders, NgModule} from '@angular/core';\nimport {Notifications} from './notifications.service';\nimport {CommonModule} from '@angular/common';\n\n@NgModule({\n imports: [CommonModule, LocalizeModule],\n declarations: [BbNotificationsList, BbNotificationsItem]\n})\nexport class NotificationsModule {\n\n static forRoot(config?: NotificationsConfig): ModuleWithProviders<NotificationsModule> {\n return {\n ngModule: NotificationsModule,\n providers: [\n {provide: NotificationsConfig, useValue: config},\n Notifications\n ]\n };\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;IA4BY;AAAZ,WAAY,gBAAgB;IACxB,uCAAmB,CAAA;IACnB,mCAAe,CAAA;IACf,uCAAmB,CAAA;IACnB,iCAAa,CAAA;IACb,qCAAiB,CAAA;AACrB,CAAC,EANW,gBAAgB,KAAhB,gBAAgB,QAM3B;MAEY,mBAAmB;CAO/B;IAEW;AAAZ,WAAY,qBAAqB;IAC7B,yDAAgC,CAAA;IAChC,0DAAiC,CAAA;IACjC,0DAAiC,CAAA;IACjC,2DAAkC,CAAA;AACtC,CAAC,EALW,qBAAqB,KAArB,qBAAqB,QAKhC;MAEY,iBAAiB;;;AClD9B,MAAM,CAAC,GAAG,iCAAiC,CAAC;AAC5C,MAAM,CAAC,GAAG,iC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mBAAmB;kBAJ/B,QAAQ;mBAAC;oBACN,OAAO,EAAE,CAAC,YAAY,EAAE,cAAc,CAAC;oBACvC,YAAY,EAAE,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;iBAC3D;;;ACXD;;;;;;"}
@@ -0,0 +1,300 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, LOCALE_ID, Injectable, Optional, Inject, EventEmitter, forwardRef, Component, ChangeDetectionStrategy, ViewEncapsulation, HostBinding, Input, Output, NgModule } from '@angular/core';
3
+ import { DOCUMENT } from '@angular/common';
4
+ import { BehaviorSubject, Subscription } from 'rxjs';
5
+ import * as i1 from '@bravobit/bb-foundation';
6
+ import { mixinGrouped } from '@bravobit/bb-foundation';
7
+ import { NG_VALUE_ACCESSOR } from '@angular/forms';
8
+
9
+ const RECAPTCHA_CONFIG = new InjectionToken('bb-recaptcha-config');
10
+
11
+ class RecaptchaLoader {
12
+ constructor(_platform, _renderFactory, _document, _localeId, _config) {
13
+ this._platform = _platform;
14
+ this._renderFactory = _renderFactory;
15
+ this._document = _document;
16
+ this._localeId = _localeId;
17
+ this._config = _config;
18
+ // Ready state.
19
+ this.ready$ = null;
20
+ // Data.
21
+ this._windowLoadFn = 'bbRecaptchaLoad';
22
+ this._renderer = null;
23
+ // Create a renderer.
24
+ this._renderer = this._renderFactory.createRenderer(null, null);
25
+ // Set the ready subject if not exists.
26
+ if (this.ready$) {
27
+ return;
28
+ }
29
+ this.ready$ = new BehaviorSubject(null);
30
+ // Create the script.
31
+ this.createScript(captcha => this.ready$.next(captcha));
32
+ }
33
+ createScript(callback) {
34
+ // Validate we are on a browser.
35
+ if (!this._platform.isBrowser) {
36
+ return;
37
+ }
38
+ // Create the script.
39
+ const script = this._renderer.createElement('script');
40
+ // Set properties on the script.
41
+ this._renderer.setProperty(script, 'src', this.getUrl());
42
+ this._renderer.setProperty(script, 'async', true);
43
+ this._renderer.setProperty(script, 'defer', true);
44
+ // Set the nonce.
45
+ if (this._config.nonce) {
46
+ this._renderer.setAttribute(script, 'nonce', this._config.nonce);
47
+ }
48
+ // Set the loading function.
49
+ if (this._platform.isBrowser) {
50
+ window[this._windowLoadFn] = () => callback(grecaptcha);
51
+ }
52
+ // Append the script tag.
53
+ this._renderer.appendChild(this._document?.body, script);
54
+ }
55
+ getUrl() {
56
+ const baseUrl = this._config?.baseUrl ?? 'https://www.google.com/recaptcha/api.js';
57
+ return [baseUrl, this.getQueryParams()]
58
+ .filter(item => !!item)
59
+ .join('?');
60
+ }
61
+ getQueryParams() {
62
+ const params = {
63
+ render: 'explicit',
64
+ onload: this._windowLoadFn ?? null,
65
+ hl: this._localeId ?? null
66
+ };
67
+ return Object.keys(params)
68
+ .map(key => ({ key, value: params[key] }))
69
+ .filter(item => !!item.value)
70
+ .map(item => `${item?.key}=${item?.value}`)
71
+ .join('&');
72
+ }
73
+ }
74
+ RecaptchaLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: RecaptchaLoader, deps: [{ token: i1.Platform }, { token: i0.RendererFactory2 }, { token: DOCUMENT, optional: true }, { token: LOCALE_ID, optional: true }, { token: RECAPTCHA_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
75
+ RecaptchaLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: RecaptchaLoader });
76
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: RecaptchaLoader, decorators: [{
77
+ type: Injectable
78
+ }], ctorParameters: function () { return [{ type: i1.Platform }, { type: i0.RendererFactory2 }, { type: undefined, decorators: [{
79
+ type: Optional
80
+ }, {
81
+ type: Inject,
82
+ args: [DOCUMENT]
83
+ }] }, { type: undefined, decorators: [{
84
+ type: Optional
85
+ }, {
86
+ type: Inject,
87
+ args: [LOCALE_ID]
88
+ }] }, { type: undefined, decorators: [{
89
+ type: Optional
90
+ }, {
91
+ type: Inject,
92
+ args: [RECAPTCHA_CONFIG]
93
+ }] }]; } });
94
+
95
+ let nextUniqueId = 0;
96
+ class BbRecaptchaBase {
97
+ }
98
+ const BbRecaptchaMixinBase = mixinGrouped(BbRecaptchaBase);
99
+ class RecaptchaComponent extends BbRecaptchaMixinBase {
100
+ constructor(_zone, _elementRef, _loader, _config) {
101
+ super();
102
+ this._zone = _zone;
103
+ this._elementRef = _elementRef;
104
+ this._loader = _loader;
105
+ this._config = _config;
106
+ // Host bindings.
107
+ this.id = `bb-recaptcha-${nextUniqueId++}`;
108
+ // Inputs.
109
+ this.siteKey = null;
110
+ this.tabIndex = null;
111
+ this.type = null;
112
+ this.size = null;
113
+ this.theme = null;
114
+ this.badge = null;
115
+ this.errorMode = 'default';
116
+ // Outputs.
117
+ this.resolved = new EventEmitter();
118
+ this.error = new EventEmitter();
119
+ // Data.
120
+ this._widgetId = null;
121
+ this._grecaptcha = null;
122
+ this._executeRequested = false;
123
+ // Form methods.
124
+ this._onChange = null;
125
+ this._onTouched = null;
126
+ // Subscriptions.
127
+ this._subscriptions = new Subscription();
128
+ this.initializeProperties();
129
+ }
130
+ ngAfterViewInit() {
131
+ const subscription = this._loader.ready$.subscribe((grecaptcha) => {
132
+ if (grecaptcha == null || !(grecaptcha.render instanceof Function)) {
133
+ return;
134
+ }
135
+ this._grecaptcha = grecaptcha;
136
+ this.renderCaptchaElement();
137
+ });
138
+ this._subscriptions.add(subscription);
139
+ }
140
+ ngOnDestroy() {
141
+ // Reset the captcha.
142
+ this.resetCaptchaElement();
143
+ // Unsubscribe of ready data.
144
+ this._subscriptions?.unsubscribe();
145
+ }
146
+ execute() {
147
+ // Check if the captcha is invisible.
148
+ if (this.size !== 'invisible') {
149
+ return;
150
+ }
151
+ // Check if the widget exists else return.
152
+ if (this._widgetId == null) {
153
+ this._executeRequested = true;
154
+ return;
155
+ }
156
+ // Execute the captcha.
157
+ this._grecaptcha.execute(this._widgetId);
158
+ }
159
+ reset() {
160
+ if (this._widgetId == null) {
161
+ return;
162
+ }
163
+ if (this._grecaptcha.getResponse(this._widgetId)) {
164
+ this.resolved.emit(null);
165
+ }
166
+ this.resetCaptchaElement();
167
+ }
168
+ writeValue(value) {
169
+ if (value) {
170
+ return;
171
+ }
172
+ this.reset();
173
+ }
174
+ registerOnChange(fn) {
175
+ this._onChange = fn;
176
+ }
177
+ registerOnTouched(fn) {
178
+ this._onTouched = fn;
179
+ }
180
+ onResolve(event) {
181
+ // Emit the value.
182
+ this.resolved.emit(event);
183
+ // Call the form functions.
184
+ this._onChange?.(event);
185
+ this._onTouched?.();
186
+ }
187
+ renderCaptchaElement() {
188
+ const parameters = {
189
+ badge: this.badge,
190
+ sitekey: this.siteKey,
191
+ size: this.size,
192
+ tabindex: this.tabIndex,
193
+ theme: this.theme,
194
+ type: this.type,
195
+ 'callback': (response) => this._zone.run(() => this.onResolve(response)),
196
+ 'expired-callback': () => this._zone.run(() => this.onResolve(null))
197
+ };
198
+ if (this.errorMode === 'handled') {
199
+ parameters['error-callback'] = (...args) => {
200
+ return this._zone.run(() => this.error.emit(args));
201
+ };
202
+ }
203
+ this._widgetId = this._grecaptcha.render(this._elementRef.nativeElement, parameters);
204
+ if (this._executeRequested) {
205
+ this._executeRequested = false;
206
+ this.execute();
207
+ }
208
+ }
209
+ resetCaptchaElement() {
210
+ if (this._widgetId == null) {
211
+ return;
212
+ }
213
+ this._zone.runOutsideAngular(() => this._grecaptcha.reset(this._widgetId));
214
+ }
215
+ initializeProperties() {
216
+ this.siteKey = this.siteKey ?? this._config?.siteKey;
217
+ this.theme = this.theme ?? this._config?.theme;
218
+ this.size = this.size ?? this._config?.size;
219
+ this.type = this.type ?? this._config?.type;
220
+ this.badge = this.badge ?? this._config?.badge;
221
+ }
222
+ }
223
+ RecaptchaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: RecaptchaComponent, deps: [{ token: i0.NgZone }, { token: i0.ElementRef }, { token: RecaptchaLoader }, { token: RECAPTCHA_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Component });
224
+ RecaptchaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.0", type: RecaptchaComponent, selector: "bb-recaptcha", inputs: { grouped: "grouped", id: "id", siteKey: "siteKey", tabIndex: "tabIndex", type: "type", size: "size", theme: "theme", badge: "badge", errorMode: "errorMode" }, outputs: { resolved: "resolved", error: "error" }, host: { properties: { "class.grouped": "grouped", "attr.id": "this.id" }, classAttribute: "bb-recaptcha" }, providers: [
225
+ {
226
+ provide: NG_VALUE_ACCESSOR,
227
+ useExisting: forwardRef(() => RecaptchaComponent),
228
+ multi: true
229
+ }
230
+ ], exportAs: ["bbRecaptcha"], usesInheritance: true, ngImport: i0, template: "", styles: [".bb-recaptcha{display:block}.bb-recaptcha.grouped{margin-bottom:20px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
231
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: RecaptchaComponent, decorators: [{
232
+ type: Component,
233
+ args: [{ selector: 'bb-recaptcha', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'bbRecaptcha', providers: [
234
+ {
235
+ provide: NG_VALUE_ACCESSOR,
236
+ useExisting: forwardRef(() => RecaptchaComponent),
237
+ multi: true
238
+ }
239
+ ], host: {
240
+ 'class': 'bb-recaptcha',
241
+ '[class.grouped]': 'grouped'
242
+ }, inputs: ['grouped'], preserveWhitespaces: false, template: "", styles: [".bb-recaptcha{display:block}.bb-recaptcha.grouped{margin-bottom:20px}\n"] }]
243
+ }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.ElementRef }, { type: RecaptchaLoader }, { type: undefined, decorators: [{
244
+ type: Optional
245
+ }, {
246
+ type: Inject,
247
+ args: [RECAPTCHA_CONFIG]
248
+ }] }]; }, propDecorators: { id: [{
249
+ type: HostBinding,
250
+ args: ['attr.id']
251
+ }, {
252
+ type: Input
253
+ }], siteKey: [{
254
+ type: Input
255
+ }], tabIndex: [{
256
+ type: Input
257
+ }], type: [{
258
+ type: Input
259
+ }], size: [{
260
+ type: Input
261
+ }], theme: [{
262
+ type: Input
263
+ }], badge: [{
264
+ type: Input
265
+ }], errorMode: [{
266
+ type: Input
267
+ }], resolved: [{
268
+ type: Output
269
+ }], error: [{
270
+ type: Output
271
+ }] } });
272
+
273
+ class RecaptchaModule {
274
+ static forRoot(config) {
275
+ return {
276
+ ngModule: RecaptchaModule,
277
+ providers: [
278
+ { provide: RECAPTCHA_CONFIG, useValue: config },
279
+ RecaptchaLoader
280
+ ]
281
+ };
282
+ }
283
+ }
284
+ RecaptchaModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: RecaptchaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
285
+ RecaptchaModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: RecaptchaModule, declarations: [RecaptchaComponent], exports: [RecaptchaComponent] });
286
+ RecaptchaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: RecaptchaModule });
287
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: RecaptchaModule, decorators: [{
288
+ type: NgModule,
289
+ args: [{
290
+ declarations: [RecaptchaComponent],
291
+ exports: [RecaptchaComponent]
292
+ }]
293
+ }] });
294
+
295
+ /**
296
+ * Generated bundle index. Do not edit.
297
+ */
298
+
299
+ export { RECAPTCHA_CONFIG, RecaptchaComponent, RecaptchaLoader, RecaptchaModule };
300
+ //# sourceMappingURL=bravobit-bb-foundation-recaptcha.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bravobit-bb-foundation-recaptcha.mjs","sources":["../../../projects/bb-foundation/recaptcha/src/lib/recaptcha.interface.ts","../../../projects/bb-foundation/recaptcha/src/lib/recaptcha-loader.service.ts","../../../projects/bb-foundation/recaptcha/src/lib/recaptcha/recaptcha.component.ts","../../../projects/bb-foundation/recaptcha/src/lib/recaptcha/recaptcha.component.html","../../../projects/bb-foundation/recaptcha/src/lib/recaptcha.module.ts","../../../projects/bb-foundation/recaptcha/src/bravobit-bb-foundation-recaptcha.ts"],"sourcesContent":["import {InjectionToken} from '@angular/core';\n\nexport const RECAPTCHA_CONFIG = new InjectionToken<RecaptchaConfig>('bb-recaptcha-config');\n\nexport interface RecaptchaConfig {\n baseUrl?: string;\n nonce?: string;\n siteKey?: string;\n theme?: ReCaptchaV2.Theme;\n type?: ReCaptchaV2.Type;\n size?: ReCaptchaV2.Size;\n badge?: ReCaptchaV2.Badge;\n}\n\nexport type NeverUndefined<T> = T extends undefined ? never : T;\nexport type RecaptchaErrorParameters = Parameters<NeverUndefined<ReCaptchaV2.Parameters['error-callback']>>;\n","import {Inject, Injectable, LOCALE_ID, Optional, Renderer2, RendererFactory2} from '@angular/core';\nimport {RECAPTCHA_CONFIG, RecaptchaConfig} from './recaptcha.interface';\nimport {Platform} from '@bravobit/bb-foundation';\nimport {DOCUMENT} from '@angular/common';\nimport {BehaviorSubject} from 'rxjs';\n\n@Injectable()\nexport class RecaptchaLoader {\n\n // Ready state.\n readonly ready$: BehaviorSubject<ReCaptchaV2.ReCaptcha | null> | null = null;\n\n // Data.\n private readonly _windowLoadFn: string = 'bbRecaptchaLoad';\n private readonly _renderer: Renderer2 | null = null;\n\n constructor(private _platform: Platform,\n private _renderFactory: RendererFactory2,\n @Optional() @Inject(DOCUMENT) private _document?: any,\n @Optional() @Inject(LOCALE_ID) private _localeId?: string,\n @Optional() @Inject(RECAPTCHA_CONFIG) private _config?: RecaptchaConfig) {\n // Create a renderer.\n this._renderer = this._renderFactory.createRenderer(null, null);\n\n // Set the ready subject if not exists.\n if (this.ready$) {\n return;\n }\n this.ready$ = new BehaviorSubject<ReCaptchaV2.ReCaptcha | null>(null);\n\n // Create the script.\n this.createScript(captcha => this.ready$.next(captcha));\n }\n\n private createScript(callback: (grecaptcha: ReCaptchaV2.ReCaptcha) => void) {\n // Validate we are on a browser.\n if (!this._platform.isBrowser) {\n return;\n }\n\n // Create the script.\n const script = this._renderer.createElement('script');\n\n // Set properties on the script.\n this._renderer.setProperty(script, 'src', this.getUrl());\n this._renderer.setProperty(script, 'async', true);\n this._renderer.setProperty(script, 'defer', true);\n\n // Set the nonce.\n if (this._config.nonce) {\n this._renderer.setAttribute(script, 'nonce', this._config.nonce);\n }\n\n // Set the loading function.\n if (this._platform.isBrowser) {\n window[this._windowLoadFn] = () => callback(grecaptcha);\n }\n\n // Append the script tag.\n this._renderer.appendChild(this._document?.body, script);\n }\n\n private getUrl() {\n const baseUrl = this._config?.baseUrl ?? 'https://www.google.com/recaptcha/api.js';\n return [baseUrl, this.getQueryParams()]\n .filter(item => !!item)\n .join('?');\n }\n\n private getQueryParams() {\n const params = {\n render: 'explicit',\n onload: this._windowLoadFn ?? null,\n hl: this._localeId ?? null\n };\n\n return Object.keys(params)\n .map(key => ({key, value: params[key]}))\n .filter(item => !!item.value)\n .map(item => `${item?.key}=${item?.value}`)\n .join('&');\n }\n\n}\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n forwardRef,\n HostBinding,\n Inject,\n Input,\n NgZone,\n OnDestroy,\n Optional,\n Output,\n ViewEncapsulation\n} from '@angular/core';\nimport {RECAPTCHA_CONFIG, RecaptchaConfig, RecaptchaErrorParameters} from '../recaptcha.interface';\nimport {IsGroupedConstructor, mixinGrouped} from '@bravobit/bb-foundation';\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {RecaptchaLoader} from '../recaptcha-loader.service';\nimport {Subscription} from 'rxjs';\n\nlet nextUniqueId = 0;\n\nclass BbRecaptchaBase {\n}\n\nconst BbRecaptchaMixinBase: IsGroupedConstructor\n & typeof BbRecaptchaBase\n = mixinGrouped(BbRecaptchaBase);\n\n@Component({\n selector: 'bb-recaptcha',\n templateUrl: './recaptcha.component.html',\n styleUrls: ['./recaptcha.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n exportAs: 'bbRecaptcha',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => RecaptchaComponent),\n multi: true\n }\n ],\n host: {\n 'class': 'bb-recaptcha',\n '[class.grouped]': 'grouped'\n },\n inputs: ['grouped'],\n preserveWhitespaces: false\n})\nexport class RecaptchaComponent extends BbRecaptchaMixinBase implements ControlValueAccessor, AfterViewInit, OnDestroy {\n\n // Host bindings.\n @HostBinding('attr.id') @Input() id: string = `bb-recaptcha-${nextUniqueId++}`;\n\n // Inputs.\n @Input() siteKey: string | null = null;\n @Input() tabIndex: number | null = null;\n @Input() type: ReCaptchaV2.Type | null = null;\n @Input() size: ReCaptchaV2.Size | null = null;\n @Input() theme: ReCaptchaV2.Theme | null = null;\n @Input() badge: ReCaptchaV2.Badge | null = null;\n @Input() errorMode: 'handled' | 'default' = 'default';\n\n // Outputs.\n @Output() resolved = new EventEmitter<string>();\n @Output() error = new EventEmitter<RecaptchaErrorParameters>();\n\n // Data.\n private _widgetId: number | null = null;\n private _grecaptcha: ReCaptchaV2.ReCaptcha | null = null;\n private _executeRequested: boolean = false;\n\n // Form methods.\n private _onChange: (value: string) => void | null = null;\n private _onTouched: () => void | null = null;\n\n // Subscriptions.\n private _subscriptions = new Subscription();\n\n constructor(private _zone: NgZone,\n private _elementRef: ElementRef,\n private _loader: RecaptchaLoader,\n @Optional() @Inject(RECAPTCHA_CONFIG) private _config?: RecaptchaConfig) {\n super();\n this.initializeProperties();\n }\n\n ngAfterViewInit() {\n const subscription = this._loader.ready$.subscribe((grecaptcha: ReCaptchaV2.ReCaptcha) => {\n if (grecaptcha == null || !(grecaptcha.render instanceof Function)) {\n return;\n }\n\n this._grecaptcha = grecaptcha;\n this.renderCaptchaElement();\n });\n\n this._subscriptions.add(subscription);\n }\n\n ngOnDestroy() {\n // Reset the captcha.\n this.resetCaptchaElement();\n\n // Unsubscribe of ready data.\n this._subscriptions?.unsubscribe();\n }\n\n execute() {\n // Check if the captcha is invisible.\n if (this.size !== 'invisible') {\n return;\n }\n\n // Check if the widget exists else return.\n if (this._widgetId == null) {\n this._executeRequested = true;\n return;\n }\n\n // Execute the captcha.\n this._grecaptcha.execute(this._widgetId);\n }\n\n reset() {\n if (this._widgetId == null) {\n return;\n }\n\n if (this._grecaptcha.getResponse(this._widgetId)) {\n this.resolved.emit(null);\n }\n\n this.resetCaptchaElement();\n }\n\n writeValue(value: string) {\n if (value) {\n return;\n }\n\n this.reset();\n }\n\n registerOnChange(fn: (value: string) => void) {\n this._onChange = fn;\n }\n\n registerOnTouched(fn: () => void) {\n this._onTouched = fn;\n }\n\n onResolve(event: string) {\n // Emit the value.\n this.resolved.emit(event);\n\n // Call the form functions.\n this._onChange?.(event);\n this._onTouched?.();\n }\n\n private renderCaptchaElement() {\n const parameters: ReCaptchaV2.Parameters = {\n badge: this.badge,\n sitekey: this.siteKey,\n size: this.size,\n tabindex: this.tabIndex,\n theme: this.theme,\n type: this.type,\n 'callback': (response: string) => this._zone.run(() => this.onResolve(response)),\n 'expired-callback': () => this._zone.run(() => this.onResolve(null))\n };\n\n if (this.errorMode === 'handled') {\n parameters['error-callback'] = (...args: RecaptchaErrorParameters) => {\n return this._zone.run(() => this.error.emit(args));\n };\n }\n\n this._widgetId = this._grecaptcha.render(this._elementRef.nativeElement, parameters);\n\n if (this._executeRequested) {\n this._executeRequested = false;\n this.execute();\n }\n }\n\n private resetCaptchaElement() {\n if (this._widgetId == null) {\n return;\n }\n\n this._zone.runOutsideAngular(() => this._grecaptcha.reset(this._widgetId));\n }\n\n private initializeProperties() {\n this.siteKey = this.siteKey ?? this._config?.siteKey;\n this.theme = this.theme ?? this._config?.theme;\n this.size = this.size ?? this._config?.size;\n this.type = this.type ?? this._config?.type;\n this.badge = this.badge ?? this._config?.badge;\n }\n\n}\n","","import {RECAPTCHA_CONFIG, RecaptchaConfig} from './recaptcha.interface';\nimport {RecaptchaComponent} from './recaptcha/recaptcha.component';\nimport {ModuleWithProviders, NgModule} from '@angular/core';\nimport {RecaptchaLoader} from './recaptcha-loader.service';\n\n@NgModule({\n declarations: [RecaptchaComponent],\n exports: [RecaptchaComponent]\n})\nexport class RecaptchaModule {\n\n static forRoot(config?: RecaptchaConfig): ModuleWithProviders<RecaptchaModule> {\n return {\n ngModule: RecaptchaModule,\n providers: [\n {provide: RECAPTCHA_CONFIG, useValue: config},\n RecaptchaLoader\n ]\n };\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;MAEa,gBAAgB,GAAG,IAAI,cAAc,CAAkB,qBAAqB;;MCK5E,eAAe;IASxB,YAAoB,SAAmB,EACnB,cAAgC,EACF,SAAe,EACd,SAAkB,EACX,OAAyB;QAJ/D,cAAS,GAAT,SAAS,CAAU;QACnB,mBAAc,GAAd,cAAc,CAAkB;QACF,cAAS,GAAT,SAAS,CAAM;QACd,cAAS,GAAT,SAAS,CAAS;QACX,YAAO,GAAP,OAAO,CAAkB;;QAV1E,WAAM,GAAyD,IAAI,CAAC;;QAG5D,kBAAa,GAAW,iBAAiB,CAAC;QAC1C,cAAS,GAAqB,IAAI,CAAC;;QAQhD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;;QAGhE,IAAI,IAAI,CAAC,MAAM,EAAE;YACb,OAAO;SACV;QACD,IAAI,CAAC,MAAM,GAAG,IAAI,eAAe,CAA+B,IAAI,CAAC,CAAC;;QAGtE,IAAI,CAAC,YAAY,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;KAC3D;IAEO,YAAY,CA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kB;kBArB9B,SAAS;+BACI,cAAc,mBAGP,uBAAuB,CAAC,MAAM,iBAChC,iBAAiB,CAAC,IAAI,YAC3B,aAAa,aACZ;wBACP;4BACI,OAAO,EAAE,iBAAiB;4BAC1B,WAAW,EAAE,UAAU,CAAC,wBAAwB,CAAC;4BACjD,KAAK,EAAE,IAAI;yBACd;qBACJ,QACK;wBACF,OAAO,EAAE,cAAc;wBACvB,iBAAiB,EAAE,SAAS;qBAC/B,UACO,CAAC,SAAS,CAAC,uBACE,KAAK;;0BAmCb,QAAQ;;0BAAI,MAAM;2BAAC,gBAAgB;4CA9Bf,EAAE;sBAAlC,WAAW;uBAAC,SAAS;;sBAAG,KAAK;gBAGrB,OAAO;sBAAf,KAAK;gBACG,QAAQ;sBAAhB,KAAK;gBACG,IAAI;sBAAZ,KAAK;gBACG,IAAI;sBAAZ,KAAK;gBACG,KAAK;sBAAb,KAAK;gBACG,KAAK;sBAAb,KAAK;gBACG,SAAS;sBAAjB,KAAK;gBAGI,QAAQ;sBAAjB,MAAM;gBACG,KAAK;sBAAd,MAAM;;;ME3DE,eAAe;IAExB,OAAO,OAAO,CAAC,MAAwB;QACnC,OAAO;YACH,QAAQ,EAAE,eAAe;YACzB,SAAS,EAAE;gBACP,EAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,EAAC;gBAC7C,eAAe;aAClB;SACJ,CAAC;KACL;;4GAVQ,eAAe;6GAAf,eAAe,iBAHT,kBAAkB,aACvB,kBAAkB;6GAEnB,eAAe;2FAAf,eAAe;kBAJ3B,QAAQ;mBAAC;oBACN,YAAY,EAAE,CAAC,kBAAkB,CAAC;oBAClC,OAAO,EAAE,CAAC,kBAAkB,CAAC;iBAChC;;;ACRD;;;;;;"}
@@ -0,0 +1,21 @@
1
+ import { combineLatest } from 'rxjs';
2
+ import { map, filter } from 'rxjs/operators';
3
+
4
+ function combineLatestMap(observables) {
5
+ const keys = Object.keys(observables);
6
+ return combineLatest(keys.map(k => observables[k])).pipe(map(b => b.reduce((previous, value, index) => ({
7
+ ...previous,
8
+ [keys[index]]: value
9
+ }), {})));
10
+ }
11
+
12
+ function filterNil() {
13
+ return filter(value => value !== undefined && value !== null);
14
+ }
15
+
16
+ /**
17
+ * Generated bundle index. Do not edit.
18
+ */
19
+
20
+ export { combineLatestMap, filterNil };
21
+ //# sourceMappingURL=bravobit-bb-foundation-rxjs.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bravobit-bb-foundation-rxjs.mjs","sources":["../../../projects/bb-foundation/rxjs/src/lib/operators/combine-latest-map.operator.ts","../../../projects/bb-foundation/rxjs/src/lib/operators/filter-nil.operator.ts","../../../projects/bb-foundation/rxjs/src/bravobit-bb-foundation-rxjs.ts"],"sourcesContent":["import {combineLatest, Observable} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\ntype ExtractObservableType<A> = A extends Observable<infer B> ? B : never;\n\nexport function combineLatestMap<TIn extends { [key: string]: Observable<any> },\n TOut extends { [K in keyof TIn]: ExtractObservableType<TIn[K]> }>(\n observables: TIn): Observable<TOut> {\n const keys = Object.keys(observables);\n\n return combineLatest(\n keys.map(k => observables[k])\n ).pipe(\n map(b => b.reduce((previous, value, index) => ({\n ...previous,\n [keys[index]]: value\n }), {})\n )\n );\n}\n","import {filter} from 'rxjs/operators';\n\nexport function filterNil<T>() {\n return filter<T>(value => value !== undefined && value !== null);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;SAKgB,gBAAgB,CAE5B,WAAgB;IAChB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAEtC,OAAO,aAAa,CAChB,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,CAChC,CAAC,IAAI,CACF,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,MAAM;QACvC,GAAG,QAAQ;QACX,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,KAAK;KACvB,CAAC,EAAE,EAAE,CAAC,CACV,CACJ,CAAC;AACN;;SCjBgB,SAAS;IACrB,OAAO,MAAM,CAAI,KAAK,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC;AACrE;;ACJA;;;;;;"}