@bravobit/bb-foundation 0.14.3 → 0.15.2

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 (413) 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/bundles/bravobit-bb-foundation-auth.umd.js +1400 -1402
  25. package/bundles/bravobit-bb-foundation-auth.umd.js.map +1 -1
  26. package/bundles/bravobit-bb-foundation-collections.umd.js +868 -0
  27. package/bundles/bravobit-bb-foundation-collections.umd.js.map +1 -0
  28. package/bundles/bravobit-bb-foundation-dashboard.umd.js +817 -819
  29. package/bundles/bravobit-bb-foundation-dashboard.umd.js.map +1 -1
  30. package/bundles/bravobit-bb-foundation-dialog.umd.js +649 -651
  31. package/bundles/bravobit-bb-foundation-dialog.umd.js.map +1 -1
  32. package/bundles/bravobit-bb-foundation-elements.umd.js +2651 -2653
  33. package/bundles/bravobit-bb-foundation-elements.umd.js.map +1 -1
  34. package/bundles/bravobit-bb-foundation-http.umd.js +488 -490
  35. package/bundles/bravobit-bb-foundation-http.umd.js.map +1 -1
  36. package/bundles/bravobit-bb-foundation-localize.umd.js +1208 -1210
  37. package/bundles/bravobit-bb-foundation-localize.umd.js.map +1 -1
  38. package/bundles/bravobit-bb-foundation-notifications.umd.js +743 -745
  39. package/bundles/bravobit-bb-foundation-notifications.umd.js.map +1 -1
  40. package/bundles/bravobit-bb-foundation-recaptcha.umd.js +640 -642
  41. package/bundles/bravobit-bb-foundation-recaptcha.umd.js.map +1 -1
  42. package/bundles/bravobit-bb-foundation-rxjs.umd.js +13 -13
  43. package/bundles/bravobit-bb-foundation-rxjs.umd.js.map +1 -1
  44. package/bundles/bravobit-bb-foundation-storage.umd.js +756 -758
  45. package/bundles/bravobit-bb-foundation-storage.umd.js.map +1 -1
  46. package/bundles/bravobit-bb-foundation-table.umd.js +993 -995
  47. package/bundles/bravobit-bb-foundation-table.umd.js.map +1 -1
  48. package/bundles/bravobit-bb-foundation.umd.js +1332 -1334
  49. package/bundles/bravobit-bb-foundation.umd.js.map +1 -1
  50. package/collections/bravobit-bb-foundation-collections.d.ts +5 -0
  51. package/collections/lib/collection.d.ts +43 -0
  52. package/collections/lib/collections.module.d.ts +10 -0
  53. package/collections/lib/components/collections-pager/collections-pager.component.d.ts +34 -0
  54. package/collections/lib/components/collections-viewer/collections-viewer.component.d.ts +12 -0
  55. package/collections/lib/components/collections.directive.d.ts +17 -0
  56. package/collections/lib/interfaces/collection.interface.d.ts +26 -0
  57. package/collections/lib/providers/api-collection.provider.d.ts +15 -0
  58. package/collections/lib/providers/collection.provider.d.ts +6 -0
  59. package/collections/lib/providers/local-collection.provider.d.ts +8 -0
  60. package/collections/package.json +10 -0
  61. package/collections/public_api.d.ts +9 -0
  62. package/dashboard/bravobit-bb-foundation-dashboard.d.ts +5 -5
  63. package/dashboard/lib/dashboard/dashboard.component.d.ts +19 -19
  64. package/dashboard/lib/dashboard-header/dashboard-header.component.d.ts +11 -11
  65. package/dashboard/lib/dashboard-menu/dashboard-menu.component.d.ts +9 -9
  66. package/dashboard/lib/dashboard-menu-item/dashboard-menu-item.component.d.ts +11 -11
  67. package/dashboard/lib/dashboard-sidebar/dashboard-sidebar.component.d.ts +21 -21
  68. package/dashboard/lib/dashboard-sidebar-group/dashboard-sidebar-group.component.d.ts +27 -27
  69. package/dashboard/lib/dashboard-sidebar-item/dashboard-sidebar-item.component.d.ts +16 -16
  70. package/dashboard/lib/dashboard.module.d.ts +16 -16
  71. package/dashboard/public_api.d.ts +8 -8
  72. package/dialog/bravobit-bb-foundation-dialog.d.ts +5 -5
  73. package/dialog/lib/dialog-actions/dialog-actions.component.d.ts +5 -5
  74. package/dialog/lib/dialog-confirm/dialog-confirm.component.d.ts +16 -16
  75. package/dialog/lib/dialog-container/dialog-container.component.d.ts +24 -24
  76. package/dialog/lib/dialog-header/dialog-header.component.d.ts +9 -9
  77. package/dialog/lib/dialog-link/dialog-link.component.d.ts +5 -5
  78. package/dialog/lib/dialog-modal/dialog-modal.component.d.ts +12 -12
  79. package/dialog/lib/dialog-overlay/dialog-overlay.component.d.ts +22 -22
  80. package/dialog/lib/dialog.injector.d.ts +8 -8
  81. package/dialog/lib/dialog.insertion.d.ts +8 -8
  82. package/dialog/lib/dialog.interfaces.d.ts +3 -3
  83. package/dialog/lib/dialog.module.d.ts +19 -19
  84. package/dialog/lib/dialog.ref.d.ts +8 -8
  85. package/dialog/lib/dialog.service.d.ts +19 -19
  86. package/dialog/public_api.d.ts +9 -9
  87. package/elements/bravobit-bb-foundation-elements.d.ts +5 -5
  88. package/elements/lib/avatar/avatar.component.d.ts +25 -25
  89. package/elements/lib/button/button.component.d.ts +23 -23
  90. package/elements/lib/checkbox/checkbox.component.d.ts +27 -27
  91. package/elements/lib/date-picker/date-picker.component.d.ts +69 -69
  92. package/elements/lib/directives/addon.directive.d.ts +9 -9
  93. package/elements/lib/directives/autosize.directive.d.ts +18 -18
  94. package/elements/lib/directives/focus-trap.directive.d.ts +17 -17
  95. package/elements/lib/directives/focus.directive.d.ts +14 -14
  96. package/elements/lib/directives/form-submit.directive.d.ts +17 -17
  97. package/elements/lib/directives/input.directive.d.ts +38 -38
  98. package/elements/lib/directives/template.directive.d.ts +10 -10
  99. package/elements/lib/dropdown/dropdown.component.d.ts +21 -21
  100. package/elements/lib/elements.interfaces.d.ts +25 -25
  101. package/elements/lib/elements.module.d.ts +116 -116
  102. package/elements/lib/file-picker/file-picker.component.d.ts +49 -49
  103. package/elements/lib/form-control/form-control.component.d.ts +21 -21
  104. package/elements/lib/form-error/form-error.component.d.ts +29 -29
  105. package/elements/lib/form-group/form-group.component.d.ts +10 -10
  106. package/elements/lib/icon/icon.component.d.ts +22 -22
  107. package/elements/lib/image-picker/image-picker.component.d.ts +38 -38
  108. package/elements/lib/pipes/file-image.pipe.d.ts +13 -13
  109. package/elements/lib/pipes/file-size.pipe.d.ts +8 -8
  110. package/elements/lib/pipes/relative-time.pipe.d.ts +19 -19
  111. package/elements/lib/spinner/spinner.component.d.ts +12 -12
  112. package/elements/lib/tag/tag.component.d.ts +7 -7
  113. package/elements/public_api.d.ts +25 -25
  114. package/esm2015/auth/bravobit-bb-foundation-auth.js +4 -4
  115. package/esm2015/auth/lib/auth.interceptor.js +95 -95
  116. package/esm2015/auth/lib/auth.module.js +54 -54
  117. package/esm2015/auth/lib/auth.service.js +299 -299
  118. package/esm2015/auth/lib/auth.session.js +136 -136
  119. package/esm2015/auth/lib/directives/authenticated.directive.js +32 -32
  120. package/esm2015/auth/lib/directives/permission.directive.js +81 -81
  121. package/esm2015/auth/lib/directives/role.directive.js +38 -38
  122. package/esm2015/auth/lib/guards/anonymous.guard.js +35 -35
  123. package/esm2015/auth/lib/guards/authenticated.guard.js +36 -36
  124. package/esm2015/auth/lib/helpers/jwt.helper.js +69 -69
  125. package/esm2015/auth/lib/helpers/mapper.helper.js +35 -35
  126. package/esm2015/auth/lib/interfaces/config.interface.js +3 -3
  127. package/esm2015/auth/lib/interfaces/mapper.interface.js +2 -2
  128. package/esm2015/auth/lib/interfaces/provider.interface.js +2 -2
  129. package/esm2015/auth/lib/interfaces/token.interface.js +2 -2
  130. package/esm2015/auth/lib/permissions.service.js +58 -58
  131. package/esm2015/auth/lib/providers/email.provider.js +26 -26
  132. package/esm2015/auth/lib/providers/verify.provider.js +20 -20
  133. package/esm2015/auth/lib/tokens/use-authorization.token.js +3 -3
  134. package/esm2015/auth/public_api.js +19 -19
  135. package/esm2015/bravobit-bb-foundation.js +4 -4
  136. package/esm2015/collections/bravobit-bb-foundation-collections.js +5 -0
  137. package/esm2015/collections/lib/collection.js +104 -0
  138. package/esm2015/collections/lib/collections.module.js +54 -0
  139. package/esm2015/collections/lib/components/collections-pager/collections-pager.component.js +136 -0
  140. package/esm2015/collections/lib/components/collections-viewer/collections-viewer.component.js +39 -0
  141. package/esm2015/collections/lib/components/collections.directive.js +43 -0
  142. package/esm2015/collections/lib/interfaces/collection.interface.js +2 -0
  143. package/esm2015/collections/lib/providers/api-collection.provider.js +69 -0
  144. package/esm2015/collections/lib/providers/collection.provider.js +14 -0
  145. package/esm2015/collections/lib/providers/local-collection.provider.js +16 -0
  146. package/esm2015/collections/public_api.js +10 -0
  147. package/esm2015/dashboard/bravobit-bb-foundation-dashboard.js +4 -4
  148. package/esm2015/dashboard/lib/dashboard/dashboard.component.js +64 -64
  149. package/esm2015/dashboard/lib/dashboard-header/dashboard-header.component.js +41 -41
  150. package/esm2015/dashboard/lib/dashboard-menu/dashboard-menu.component.js +39 -39
  151. package/esm2015/dashboard/lib/dashboard-menu-item/dashboard-menu-item.component.js +38 -38
  152. package/esm2015/dashboard/lib/dashboard-sidebar/dashboard-sidebar.component.js +83 -83
  153. package/esm2015/dashboard/lib/dashboard-sidebar-group/dashboard-sidebar-group.component.js +110 -110
  154. package/esm2015/dashboard/lib/dashboard-sidebar-item/dashboard-sidebar-item.component.js +71 -71
  155. package/esm2015/dashboard/lib/dashboard.module.js +47 -47
  156. package/esm2015/dashboard/public_api.js +9 -9
  157. package/esm2015/dialog/bravobit-bb-foundation-dialog.js +4 -4
  158. package/esm2015/dialog/lib/dialog-actions/dialog-actions.component.js +20 -20
  159. package/esm2015/dialog/lib/dialog-confirm/dialog-confirm.component.js +45 -45
  160. package/esm2015/dialog/lib/dialog-container/dialog-container.component.js +162 -162
  161. package/esm2015/dialog/lib/dialog-header/dialog-header.component.js +33 -33
  162. package/esm2015/dialog/lib/dialog-link/dialog-link.component.js +19 -19
  163. package/esm2015/dialog/lib/dialog-modal/dialog-modal.component.js +54 -54
  164. package/esm2015/dialog/lib/dialog-overlay/dialog-overlay.component.js +143 -143
  165. package/esm2015/dialog/lib/dialog.injector.js +18 -18
  166. package/esm2015/dialog/lib/dialog.insertion.js +16 -16
  167. package/esm2015/dialog/lib/dialog.interfaces.js +3 -3
  168. package/esm2015/dialog/lib/dialog.module.js +74 -74
  169. package/esm2015/dialog/lib/dialog.ref.js +22 -22
  170. package/esm2015/dialog/lib/dialog.service.js +77 -77
  171. package/esm2015/dialog/public_api.js +10 -10
  172. package/esm2015/elements/bravobit-bb-foundation-elements.js +4 -4
  173. package/esm2015/elements/lib/avatar/avatar.component.js +151 -151
  174. package/esm2015/elements/lib/button/button.component.js +79 -79
  175. package/esm2015/elements/lib/checkbox/checkbox.component.js +83 -83
  176. package/esm2015/elements/lib/date-picker/date-picker.component.js +322 -322
  177. package/esm2015/elements/lib/directives/addon.directive.js +29 -29
  178. package/esm2015/elements/lib/directives/autosize.directive.js +74 -74
  179. package/esm2015/elements/lib/directives/focus-trap.directive.js +77 -77
  180. package/esm2015/elements/lib/directives/focus.directive.js +39 -39
  181. package/esm2015/elements/lib/directives/form-submit.directive.js +53 -53
  182. package/esm2015/elements/lib/directives/input.directive.js +139 -139
  183. package/esm2015/elements/lib/directives/template.directive.js +28 -28
  184. package/esm2015/elements/lib/dropdown/dropdown.component.js +111 -111
  185. package/esm2015/elements/lib/elements.interfaces.js +4 -4
  186. package/esm2015/elements/lib/elements.module.js +177 -177
  187. package/esm2015/elements/lib/file-picker/file-picker.component.js +247 -247
  188. package/esm2015/elements/lib/form-control/form-control.component.js +58 -58
  189. package/esm2015/elements/lib/form-error/form-error.component.js +116 -116
  190. package/esm2015/elements/lib/form-group/form-group.component.js +27 -27
  191. package/esm2015/elements/lib/icon/icon.component.js +110 -110
  192. package/esm2015/elements/lib/image-picker/image-picker.component.js +119 -119
  193. package/esm2015/elements/lib/pipes/file-image.pipe.js +45 -45
  194. package/esm2015/elements/lib/pipes/file-size.pipe.js +28 -28
  195. package/esm2015/elements/lib/pipes/relative-time.pipe.js +96 -96
  196. package/esm2015/elements/lib/spinner/spinner.component.js +34 -34
  197. package/esm2015/elements/lib/tag/tag.component.js +26 -26
  198. package/esm2015/elements/public_api.js +26 -26
  199. package/esm2015/http/bravobit-bb-foundation-http.js +4 -4
  200. package/esm2015/http/lib/classes/http.config.js +31 -31
  201. package/esm2015/http/lib/classes/http.error.js +21 -21
  202. package/esm2015/http/lib/http.interfaces.js +2 -2
  203. package/esm2015/http/lib/http.module.js +43 -43
  204. package/esm2015/http/lib/interceptors/base-url.interceptor.js +52 -52
  205. package/esm2015/http/lib/interceptors/error.interceptor.js +33 -33
  206. package/esm2015/http/public_api.js +7 -7
  207. package/esm2015/lib/core/coercions/boolean-coercion.js +4 -4
  208. package/esm2015/lib/core/miscellaneous/regex.js +5 -5
  209. package/esm2015/lib/core/miscellaneous/validator.js +86 -86
  210. package/esm2015/lib/core/mixins/can-disable.js +16 -16
  211. package/esm2015/lib/core/mixins/can-hide-errors.js +16 -16
  212. package/esm2015/lib/core/mixins/can-load.js +16 -16
  213. package/esm2015/lib/core/mixins/constructor.js +2 -2
  214. package/esm2015/lib/core/mixins/has-error.js +16 -16
  215. package/esm2015/lib/core/mixins/is-focused.js +16 -16
  216. package/esm2015/lib/core/mixins/is-grouped.js +16 -16
  217. package/esm2015/lib/core/mixins/is-readonly.js +16 -16
  218. package/esm2015/lib/core/mixins/is-required.js +16 -16
  219. package/esm2015/lib/core/services/clipboard.service.js +72 -72
  220. package/esm2015/lib/core/services/exif.service.js +168 -168
  221. package/esm2015/lib/core/services/file-loader.service.js +90 -90
  222. package/esm2015/lib/core/services/image-converter.service.js +130 -130
  223. package/esm2015/lib/core/services/languages.service.js +74 -74
  224. package/esm2015/lib/core/services/network.service.js +56 -56
  225. package/esm2015/lib/core/services/patch.service.js +65 -65
  226. package/esm2015/lib/core/services/platform.service.js +42 -42
  227. package/esm2015/lib/core/tokens/accept-language.token.js +3 -3
  228. package/esm2015/lib/core/tokens/base-url.token.js +3 -3
  229. package/esm2015/lib/core/tokens/cookie.token.js +3 -3
  230. package/esm2015/lib/core/tokens/location.token.js +6 -6
  231. package/esm2015/lib/core/tokens/navigator.token.js +6 -6
  232. package/esm2015/lib/core/tokens/window.token.js +12 -12
  233. package/esm2015/localize/bravobit-bb-foundation-localize.js +4 -4
  234. package/esm2015/localize/lib/functions/date.function.js +18 -18
  235. package/esm2015/localize/lib/functions/lowercase.function.js +13 -13
  236. package/esm2015/localize/lib/functions/uppercase.function.js +13 -13
  237. package/esm2015/localize/lib/handlers/missing.handler.js +17 -17
  238. package/esm2015/localize/lib/interfaces/config.interfaces.js +10 -10
  239. package/esm2015/localize/lib/interfaces/dictionary.interfaces.js +8 -8
  240. package/esm2015/localize/lib/interfaces/functions.interfaces.js +8 -8
  241. package/esm2015/localize/lib/interfaces/handlers.interfaces.js +2 -2
  242. package/esm2015/localize/lib/interfaces/options.interfaces.js +6 -6
  243. package/esm2015/localize/lib/localizations/dutch.localization.js +53 -53
  244. package/esm2015/localize/lib/localizations/english.localization.js +53 -53
  245. package/esm2015/localize/lib/localize.dictionary.js +137 -137
  246. package/esm2015/localize/lib/localize.module.js +69 -69
  247. package/esm2015/localize/lib/localize.pipe.js +49 -49
  248. package/esm2015/localize/lib/localize.service.js +282 -282
  249. package/esm2015/localize/lib/views/localize-string/localize-string.component.js +99 -99
  250. package/esm2015/localize/lib/views/localize-template-or-string.directive.js +28 -28
  251. package/esm2015/localize/lib/views/localize-template.directive.js +21 -21
  252. package/esm2015/localize/public_api.js +18 -18
  253. package/esm2015/notifications/bravobit-bb-foundation-notifications.js +4 -4
  254. package/esm2015/notifications/lib/notifications-item/notifications-item.component.js +108 -108
  255. package/esm2015/notifications/lib/notifications-list/notifications-list.component.js +56 -56
  256. package/esm2015/notifications/lib/notifications.animations.js +28 -28
  257. package/esm2015/notifications/lib/notifications.injector.js +18 -18
  258. package/esm2015/notifications/lib/notifications.interfaces.js +20 -20
  259. package/esm2015/notifications/lib/notifications.module.js +31 -31
  260. package/esm2015/notifications/lib/notifications.service.js +145 -145
  261. package/esm2015/notifications/public_api.js +4 -4
  262. package/esm2015/public_api.js +30 -30
  263. package/esm2015/recaptcha/bravobit-bb-foundation-recaptcha.js +4 -4
  264. package/esm2015/recaptcha/lib/recaptcha/recaptcha.component.js +199 -199
  265. package/esm2015/recaptcha/lib/recaptcha-loader.service.js +93 -93
  266. package/esm2015/recaptcha/lib/recaptcha.interface.js +3 -3
  267. package/esm2015/recaptcha/lib/recaptcha.module.js +27 -27
  268. package/esm2015/recaptcha/public_api.js +5 -5
  269. package/esm2015/rxjs/bravobit-bb-foundation-rxjs.js +4 -4
  270. package/esm2015/rxjs/lib/operators/combine-latest-map.operator.js +7 -7
  271. package/esm2015/rxjs/lib/operators/filter-nil.operator.js +5 -5
  272. package/esm2015/rxjs/public_api.js +3 -3
  273. package/esm2015/storage/bravobit-bb-foundation-storage.js +4 -4
  274. package/esm2015/storage/lib/interfaces/attributes.interface.js +2 -2
  275. package/esm2015/storage/lib/interfaces/memory.interface.js +2 -2
  276. package/esm2015/storage/lib/interfaces/strategy.interface.js +2 -2
  277. package/esm2015/storage/lib/storage.service.js +111 -111
  278. package/esm2015/storage/lib/strategies/cookie-storage.strategy.js +143 -143
  279. package/esm2015/storage/lib/strategies/memory-storage.strategy.js +56 -56
  280. package/esm2015/storage/lib/strategies/polyfill-storage.strategy.js +102 -102
  281. package/esm2015/storage/public_api.js +8 -8
  282. package/esm2015/table/bravobit-bb-foundation-table.js +4 -4
  283. package/esm2015/table/lib/components/table/table.component.js +183 -183
  284. package/esm2015/table/lib/components/table-cell/table-cell.component.js +19 -19
  285. package/esm2015/table/lib/components/table-header-cell/table-header-cell.component.js +141 -141
  286. package/esm2015/table/lib/components/table-pager/table-pager.component.js +146 -146
  287. package/esm2015/table/lib/data/datasource.data.js +32 -32
  288. package/esm2015/table/lib/data/generic.data.js +73 -73
  289. package/esm2015/table/lib/interfaces/datasource.interface.js +2 -2
  290. package/esm2015/table/lib/interfaces/table.interfaces.js +2 -2
  291. package/esm2015/table/lib/table.module.js +39 -39
  292. package/esm2015/table/public_api.js +10 -10
  293. package/fesm2015/bravobit-bb-foundation-auth.js +915 -915
  294. package/fesm2015/bravobit-bb-foundation-auth.js.map +1 -1
  295. package/fesm2015/bravobit-bb-foundation-collections.js +463 -0
  296. package/fesm2015/bravobit-bb-foundation-collections.js.map +1 -0
  297. package/fesm2015/bravobit-bb-foundation-dashboard.js +434 -434
  298. package/fesm2015/bravobit-bb-foundation-dashboard.js.map +1 -1
  299. package/fesm2015/bravobit-bb-foundation-dialog.js +603 -603
  300. package/fesm2015/bravobit-bb-foundation-dialog.js.map +1 -1
  301. package/fesm2015/bravobit-bb-foundation-elements.js +2076 -2076
  302. package/fesm2015/bravobit-bb-foundation-elements.js.map +1 -1
  303. package/fesm2015/bravobit-bb-foundation-http.js +154 -154
  304. package/fesm2015/bravobit-bb-foundation-http.js.map +1 -1
  305. package/fesm2015/bravobit-bb-foundation-localize.js +796 -796
  306. package/fesm2015/bravobit-bb-foundation-localize.js.map +1 -1
  307. package/fesm2015/bravobit-bb-foundation-notifications.js +364 -364
  308. package/fesm2015/bravobit-bb-foundation-notifications.js.map +1 -1
  309. package/fesm2015/bravobit-bb-foundation-recaptcha.js +297 -297
  310. package/fesm2015/bravobit-bb-foundation-recaptcha.js.map +1 -1
  311. package/fesm2015/bravobit-bb-foundation-rxjs.js +7 -7
  312. package/fesm2015/bravobit-bb-foundation-rxjs.js.map +1 -1
  313. package/fesm2015/bravobit-bb-foundation-storage.js +399 -399
  314. package/fesm2015/bravobit-bb-foundation-storage.js.map +1 -1
  315. package/fesm2015/bravobit-bb-foundation-table.js +578 -578
  316. package/fesm2015/bravobit-bb-foundation-table.js.map +1 -1
  317. package/fesm2015/bravobit-bb-foundation.js +851 -851
  318. package/fesm2015/bravobit-bb-foundation.js.map +1 -1
  319. package/http/bravobit-bb-foundation-http.d.ts +5 -5
  320. package/http/lib/classes/http.config.d.ts +9 -9
  321. package/http/lib/classes/http.error.d.ts +7 -7
  322. package/http/lib/http.interfaces.d.ts +12 -12
  323. package/http/lib/http.module.d.ts +15 -15
  324. package/http/lib/interceptors/base-url.interceptor.d.ts +15 -15
  325. package/http/lib/interceptors/error.interceptor.d.ts +11 -11
  326. package/http/public_api.d.ts +6 -6
  327. package/lib/core/coercions/boolean-coercion.d.ts +1 -1
  328. package/lib/core/miscellaneous/regex.d.ts +4 -4
  329. package/lib/core/miscellaneous/validator.d.ts +13 -13
  330. package/lib/core/mixins/can-disable.d.ts +6 -6
  331. package/lib/core/mixins/can-hide-errors.d.ts +6 -6
  332. package/lib/core/mixins/can-load.d.ts +6 -6
  333. package/lib/core/mixins/constructor.d.ts +1 -1
  334. package/lib/core/mixins/has-error.d.ts +6 -6
  335. package/lib/core/mixins/is-focused.d.ts +6 -6
  336. package/lib/core/mixins/is-grouped.d.ts +6 -6
  337. package/lib/core/mixins/is-readonly.d.ts +6 -6
  338. package/lib/core/mixins/is-required.d.ts +6 -6
  339. package/lib/core/services/clipboard.service.d.ts +18 -18
  340. package/lib/core/services/exif.service.d.ts +15 -15
  341. package/lib/core/services/file-loader.service.d.ts +13 -13
  342. package/lib/core/services/image-converter.service.d.ts +21 -21
  343. package/lib/core/services/languages.service.d.ts +16 -16
  344. package/lib/core/services/network.service.d.ts +14 -14
  345. package/lib/core/services/patch.service.d.ts +16 -16
  346. package/lib/core/services/platform.service.d.ts +18 -18
  347. package/lib/core/tokens/accept-language.token.d.ts +2 -2
  348. package/lib/core/tokens/base-url.token.d.ts +2 -2
  349. package/lib/core/tokens/cookie.token.d.ts +2 -2
  350. package/lib/core/tokens/location.token.d.ts +2 -2
  351. package/lib/core/tokens/navigator.token.d.ts +2 -2
  352. package/lib/core/tokens/window.token.d.ts +2 -2
  353. package/localize/bravobit-bb-foundation-localize.d.ts +5 -5
  354. package/localize/lib/functions/date.function.d.ts +5 -5
  355. package/localize/lib/functions/lowercase.function.d.ts +5 -5
  356. package/localize/lib/functions/uppercase.function.d.ts +5 -5
  357. package/localize/lib/handlers/missing.handler.d.ts +6 -6
  358. package/localize/lib/interfaces/config.interfaces.d.ts +8 -8
  359. package/localize/lib/interfaces/dictionary.interfaces.d.ts +12 -12
  360. package/localize/lib/interfaces/functions.interfaces.d.ts +9 -9
  361. package/localize/lib/interfaces/handlers.interfaces.d.ts +6 -6
  362. package/localize/lib/interfaces/options.interfaces.d.ts +10 -10
  363. package/localize/lib/localizations/dutch.localization.d.ts +51 -51
  364. package/localize/lib/localizations/english.localization.d.ts +51 -51
  365. package/localize/lib/localize.dictionary.d.ts +24 -24
  366. package/localize/lib/localize.module.d.ts +18 -18
  367. package/localize/lib/localize.pipe.d.ts +12 -12
  368. package/localize/lib/localize.service.d.ts +51 -51
  369. package/localize/lib/views/localize-string/localize-string.component.d.ts +23 -23
  370. package/localize/lib/views/localize-template-or-string.directive.d.ts +10 -10
  371. package/localize/lib/views/localize-template.directive.d.ts +9 -9
  372. package/localize/public_api.d.ts +17 -17
  373. package/notifications/bravobit-bb-foundation-notifications.d.ts +5 -5
  374. package/notifications/lib/notifications-item/notifications-item.component.d.ts +34 -34
  375. package/notifications/lib/notifications-list/notifications-list.component.d.ts +16 -16
  376. package/notifications/lib/notifications.animations.d.ts +1 -1
  377. package/notifications/lib/notifications.injector.d.ts +8 -8
  378. package/notifications/lib/notifications.interfaces.d.ts +49 -49
  379. package/notifications/lib/notifications.module.d.ts +13 -13
  380. package/notifications/lib/notifications.service.d.ts +34 -34
  381. package/notifications/public_api.d.ts +3 -3
  382. package/package.json +5 -5
  383. package/public_api.d.ts +26 -26
  384. package/recaptcha/bravobit-bb-foundation-recaptcha.d.ts +5 -5
  385. package/recaptcha/lib/recaptcha/recaptcha.component.d.ts +47 -47
  386. package/recaptcha/lib/recaptcha-loader.service.d.ts +22 -22
  387. package/recaptcha/lib/recaptcha.interface.d.ts +14 -14
  388. package/recaptcha/lib/recaptcha.module.d.ts +10 -16
  389. package/recaptcha/public_api.d.ts +4 -4
  390. package/rxjs/bravobit-bb-foundation-rxjs.d.ts +5 -5
  391. package/rxjs/lib/operators/combine-latest-map.operator.d.ts +8 -8
  392. package/rxjs/lib/operators/filter-nil.operator.d.ts +1 -1
  393. package/rxjs/public_api.d.ts +2 -2
  394. package/storage/bravobit-bb-foundation-storage.d.ts +5 -5
  395. package/storage/lib/interfaces/attributes.interface.d.ts +13 -13
  396. package/storage/lib/interfaces/memory.interface.d.ts +7 -7
  397. package/storage/lib/interfaces/strategy.interface.d.ts +17 -17
  398. package/storage/lib/storage.service.d.ts +26 -26
  399. package/storage/lib/strategies/cookie-storage.strategy.d.ts +20 -20
  400. package/storage/lib/strategies/memory-storage.strategy.d.ts +11 -11
  401. package/storage/lib/strategies/polyfill-storage.strategy.d.ts +15 -15
  402. package/storage/public_api.d.ts +7 -7
  403. package/table/bravobit-bb-foundation-table.d.ts +5 -5
  404. package/table/lib/components/table/table.component.d.ts +48 -48
  405. package/table/lib/components/table-cell/table-cell.component.d.ts +5 -5
  406. package/table/lib/components/table-header-cell/table-header-cell.component.d.ts +29 -29
  407. package/table/lib/components/table-pager/table-pager.component.d.ts +41 -41
  408. package/table/lib/data/datasource.data.d.ts +14 -14
  409. package/table/lib/data/generic.data.d.ts +23 -23
  410. package/table/lib/interfaces/datasource.interface.d.ts +17 -17
  411. package/table/lib/interfaces/table.interfaces.d.ts +1 -1
  412. package/table/lib/table.module.d.ts +14 -14
  413. package/table/public_api.d.ts +9 -9
@@ -0,0 +1,868 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('rxjs'), require('rxjs/operators'), require('@angular/core'), require('@angular/common'), require('@angular/forms')) :
3
+ typeof define === 'function' && define.amd ? define('@bravobit/bb-foundation/collections', ['exports', 'rxjs', 'rxjs/operators', '@angular/core', '@angular/common', '@angular/forms'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.bravobit = global.bravobit || {}, global.bravobit["bb-foundation"] = global.bravobit["bb-foundation"] || {}, global.bravobit["bb-foundation"].collections = {}), global.rxjs, global.rxjs.operators, global.ng.core, global.ng.common, global.ng.forms));
5
+ })(this, (function (exports, rxjs, operators, i0, i1, forms) { 'use strict';
6
+
7
+ function _interopNamespace(e) {
8
+ if (e && e.__esModule) return e;
9
+ var n = Object.create(null);
10
+ if (e) {
11
+ Object.keys(e).forEach(function (k) {
12
+ if (k !== 'default') {
13
+ var d = Object.getOwnPropertyDescriptor(e, k);
14
+ Object.defineProperty(n, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: function () { return e[k]; }
17
+ });
18
+ }
19
+ });
20
+ }
21
+ n["default"] = e;
22
+ return Object.freeze(n);
23
+ }
24
+
25
+ var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
26
+ var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
27
+
28
+ var CollectionProvider = /** @class */ (function () {
29
+ function CollectionProvider() {
30
+ }
31
+ CollectionProvider.prototype.formatArrayToCollectionData = function (items) {
32
+ var _a;
33
+ var count = (_a = items === null || items === void 0 ? void 0 : items.length) !== null && _a !== void 0 ? _a : 1;
34
+ return {
35
+ pageSize: count,
36
+ totalEntries: count,
37
+ pageNumber: 1,
38
+ totalPages: 1,
39
+ data: items
40
+ };
41
+ };
42
+ return CollectionProvider;
43
+ }());
44
+
45
+ /*! *****************************************************************************
46
+ Copyright (c) Microsoft Corporation.
47
+
48
+ Permission to use, copy, modify, and/or distribute this software for any
49
+ purpose with or without fee is hereby granted.
50
+
51
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
52
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
53
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
54
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
55
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
56
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
57
+ PERFORMANCE OF THIS SOFTWARE.
58
+ ***************************************************************************** */
59
+ /* global Reflect, Promise */
60
+ var extendStatics = function (d, b) {
61
+ extendStatics = Object.setPrototypeOf ||
62
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
63
+ function (d, b) { for (var p in b)
64
+ if (Object.prototype.hasOwnProperty.call(b, p))
65
+ d[p] = b[p]; };
66
+ return extendStatics(d, b);
67
+ };
68
+ function __extends(d, b) {
69
+ if (typeof b !== "function" && b !== null)
70
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
71
+ extendStatics(d, b);
72
+ function __() { this.constructor = d; }
73
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
74
+ }
75
+ var __assign = function () {
76
+ __assign = Object.assign || function __assign(t) {
77
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
78
+ s = arguments[i];
79
+ for (var p in s)
80
+ if (Object.prototype.hasOwnProperty.call(s, p))
81
+ t[p] = s[p];
82
+ }
83
+ return t;
84
+ };
85
+ return __assign.apply(this, arguments);
86
+ };
87
+ function __rest(s, e) {
88
+ var t = {};
89
+ for (var p in s)
90
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
91
+ t[p] = s[p];
92
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
93
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
94
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
95
+ t[p[i]] = s[p[i]];
96
+ }
97
+ return t;
98
+ }
99
+ function __decorate(decorators, target, key, desc) {
100
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
101
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
102
+ r = Reflect.decorate(decorators, target, key, desc);
103
+ else
104
+ for (var i = decorators.length - 1; i >= 0; i--)
105
+ if (d = decorators[i])
106
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
107
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
108
+ }
109
+ function __param(paramIndex, decorator) {
110
+ return function (target, key) { decorator(target, key, paramIndex); };
111
+ }
112
+ function __metadata(metadataKey, metadataValue) {
113
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
114
+ return Reflect.metadata(metadataKey, metadataValue);
115
+ }
116
+ function __awaiter(thisArg, _arguments, P, generator) {
117
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
118
+ return new (P || (P = Promise))(function (resolve, reject) {
119
+ function fulfilled(value) { try {
120
+ step(generator.next(value));
121
+ }
122
+ catch (e) {
123
+ reject(e);
124
+ } }
125
+ function rejected(value) { try {
126
+ step(generator["throw"](value));
127
+ }
128
+ catch (e) {
129
+ reject(e);
130
+ } }
131
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
132
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
133
+ });
134
+ }
135
+ function __generator(thisArg, body) {
136
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
137
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
138
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
139
+ function verb(n) { return function (v) { return step([n, v]); }; }
140
+ function step(op) {
141
+ if (f)
142
+ throw new TypeError("Generator is already executing.");
143
+ while (_)
144
+ try {
145
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
146
+ return t;
147
+ if (y = 0, t)
148
+ op = [op[0] & 2, t.value];
149
+ switch (op[0]) {
150
+ case 0:
151
+ case 1:
152
+ t = op;
153
+ break;
154
+ case 4:
155
+ _.label++;
156
+ return { value: op[1], done: false };
157
+ case 5:
158
+ _.label++;
159
+ y = op[1];
160
+ op = [0];
161
+ continue;
162
+ case 7:
163
+ op = _.ops.pop();
164
+ _.trys.pop();
165
+ continue;
166
+ default:
167
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
168
+ _ = 0;
169
+ continue;
170
+ }
171
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
172
+ _.label = op[1];
173
+ break;
174
+ }
175
+ if (op[0] === 6 && _.label < t[1]) {
176
+ _.label = t[1];
177
+ t = op;
178
+ break;
179
+ }
180
+ if (t && _.label < t[2]) {
181
+ _.label = t[2];
182
+ _.ops.push(op);
183
+ break;
184
+ }
185
+ if (t[2])
186
+ _.ops.pop();
187
+ _.trys.pop();
188
+ continue;
189
+ }
190
+ op = body.call(thisArg, _);
191
+ }
192
+ catch (e) {
193
+ op = [6, e];
194
+ y = 0;
195
+ }
196
+ finally {
197
+ f = t = 0;
198
+ }
199
+ if (op[0] & 5)
200
+ throw op[1];
201
+ return { value: op[0] ? op[1] : void 0, done: true };
202
+ }
203
+ }
204
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
205
+ if (k2 === undefined)
206
+ k2 = k;
207
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
208
+ }) : (function (o, m, k, k2) {
209
+ if (k2 === undefined)
210
+ k2 = k;
211
+ o[k2] = m[k];
212
+ });
213
+ function __exportStar(m, o) {
214
+ for (var p in m)
215
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
216
+ __createBinding(o, m, p);
217
+ }
218
+ function __values(o) {
219
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
220
+ if (m)
221
+ return m.call(o);
222
+ if (o && typeof o.length === "number")
223
+ return {
224
+ next: function () {
225
+ if (o && i >= o.length)
226
+ o = void 0;
227
+ return { value: o && o[i++], done: !o };
228
+ }
229
+ };
230
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
231
+ }
232
+ function __read(o, n) {
233
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
234
+ if (!m)
235
+ return o;
236
+ var i = m.call(o), r, ar = [], e;
237
+ try {
238
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
239
+ ar.push(r.value);
240
+ }
241
+ catch (error) {
242
+ e = { error: error };
243
+ }
244
+ finally {
245
+ try {
246
+ if (r && !r.done && (m = i["return"]))
247
+ m.call(i);
248
+ }
249
+ finally {
250
+ if (e)
251
+ throw e.error;
252
+ }
253
+ }
254
+ return ar;
255
+ }
256
+ /** @deprecated */
257
+ function __spread() {
258
+ for (var ar = [], i = 0; i < arguments.length; i++)
259
+ ar = ar.concat(__read(arguments[i]));
260
+ return ar;
261
+ }
262
+ /** @deprecated */
263
+ function __spreadArrays() {
264
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
265
+ s += arguments[i].length;
266
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
267
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
268
+ r[k] = a[j];
269
+ return r;
270
+ }
271
+ function __spreadArray(to, from, pack) {
272
+ if (pack || arguments.length === 2)
273
+ for (var i = 0, l = from.length, ar; i < l; i++) {
274
+ if (ar || !(i in from)) {
275
+ if (!ar)
276
+ ar = Array.prototype.slice.call(from, 0, i);
277
+ ar[i] = from[i];
278
+ }
279
+ }
280
+ return to.concat(ar || Array.prototype.slice.call(from));
281
+ }
282
+ function __await(v) {
283
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
284
+ }
285
+ function __asyncGenerator(thisArg, _arguments, generator) {
286
+ if (!Symbol.asyncIterator)
287
+ throw new TypeError("Symbol.asyncIterator is not defined.");
288
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
289
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
290
+ function verb(n) { if (g[n])
291
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
292
+ function resume(n, v) { try {
293
+ step(g[n](v));
294
+ }
295
+ catch (e) {
296
+ settle(q[0][3], e);
297
+ } }
298
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
299
+ function fulfill(value) { resume("next", value); }
300
+ function reject(value) { resume("throw", value); }
301
+ function settle(f, v) { if (f(v), q.shift(), q.length)
302
+ resume(q[0][0], q[0][1]); }
303
+ }
304
+ function __asyncDelegator(o) {
305
+ var i, p;
306
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
307
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
308
+ }
309
+ function __asyncValues(o) {
310
+ if (!Symbol.asyncIterator)
311
+ throw new TypeError("Symbol.asyncIterator is not defined.");
312
+ var m = o[Symbol.asyncIterator], i;
313
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
314
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
315
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
316
+ }
317
+ function __makeTemplateObject(cooked, raw) {
318
+ if (Object.defineProperty) {
319
+ Object.defineProperty(cooked, "raw", { value: raw });
320
+ }
321
+ else {
322
+ cooked.raw = raw;
323
+ }
324
+ return cooked;
325
+ }
326
+ ;
327
+ var __setModuleDefault = Object.create ? (function (o, v) {
328
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
329
+ }) : function (o, v) {
330
+ o["default"] = v;
331
+ };
332
+ function __importStar(mod) {
333
+ if (mod && mod.__esModule)
334
+ return mod;
335
+ var result = {};
336
+ if (mod != null)
337
+ for (var k in mod)
338
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
339
+ __createBinding(result, mod, k);
340
+ __setModuleDefault(result, mod);
341
+ return result;
342
+ }
343
+ function __importDefault(mod) {
344
+ return (mod && mod.__esModule) ? mod : { default: mod };
345
+ }
346
+ function __classPrivateFieldGet(receiver, state, kind, f) {
347
+ if (kind === "a" && !f)
348
+ throw new TypeError("Private accessor was defined without a getter");
349
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
350
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
351
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
352
+ }
353
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
354
+ if (kind === "m")
355
+ throw new TypeError("Private method is not writable");
356
+ if (kind === "a" && !f)
357
+ throw new TypeError("Private accessor was defined without a setter");
358
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
359
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
360
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
361
+ }
362
+
363
+ var ApiCollectionProvider = /** @class */ (function (_super) {
364
+ __extends(ApiCollectionProvider, _super);
365
+ function ApiCollectionProvider(_endpoint, _httpClient) {
366
+ var _this = _super.call(this) || this;
367
+ _this._endpoint = _endpoint;
368
+ _this._httpClient = _httpClient;
369
+ // State.
370
+ _this._extraParams = {};
371
+ _this.getBackendFormat = function (request) {
372
+ var _a, _b, _c, _d, _e, _f, _g;
373
+ var params = {};
374
+ params['page'] = (_a = request === null || request === void 0 ? void 0 : request.pageNumber) !== null && _a !== void 0 ? _a : 1;
375
+ params['page_size'] = (_b = request === null || request === void 0 ? void 0 : request.pageSize) !== null && _b !== void 0 ? _b : 25;
376
+ if (request === null || request === void 0 ? void 0 : request.sort) {
377
+ var sort = Array.isArray(request === null || request === void 0 ? void 0 : request.sort) ? request === null || request === void 0 ? void 0 : request.sort : [request === null || request === void 0 ? void 0 : request.sort];
378
+ var filteredSort = sort === null || sort === void 0 ? void 0 : sort.filter(function (item) { return !!(item === null || item === void 0 ? void 0 : item.name) && !!(item === null || item === void 0 ? void 0 : item.direction); });
379
+ params['sort'] = (_c = filteredSort === null || filteredSort === void 0 ? void 0 : filteredSort.map(function (item) { return item === null || item === void 0 ? void 0 : item.name; })) === null || _c === void 0 ? void 0 : _c.join(',');
380
+ params['sort_direction'] = (_d = filteredSort === null || filteredSort === void 0 ? void 0 : filteredSort.map(function (item) { return item === null || item === void 0 ? void 0 : item.direction; })) === null || _d === void 0 ? void 0 : _d.join(',');
381
+ }
382
+ if ((request === null || request === void 0 ? void 0 : request.query) && ((_e = request === null || request === void 0 ? void 0 : request.query) === null || _e === void 0 ? void 0 : _e.length) > 0 && (request === null || request === void 0 ? void 0 : request.queryFields) && ((_f = request === null || request === void 0 ? void 0 : request.queryFields) === null || _f === void 0 ? void 0 : _f.length) > 0) {
383
+ params['query'] = request === null || request === void 0 ? void 0 : request.query;
384
+ params['query_fields'] = (_g = request === null || request === void 0 ? void 0 : request.queryFields) === null || _g === void 0 ? void 0 : _g.join(',');
385
+ }
386
+ return params;
387
+ };
388
+ return _this;
389
+ }
390
+ ApiCollectionProvider.prototype.append = function (name, value) {
391
+ this._extraParams[name] = rxjs.isObservable(value) ? value : rxjs.of(value);
392
+ return this;
393
+ };
394
+ ApiCollectionProvider.prototype.transform = function (request) {
395
+ var _this = this;
396
+ var endpoint$ = rxjs.isObservable(this._endpoint) ? this._endpoint : rxjs.of(this._endpoint);
397
+ var params = this.getBackendFormat(request);
398
+ var extraParams$ = this.getExtraParams(this._extraParams);
399
+ return rxjs.combineLatest([endpoint$, extraParams$]).pipe(operators.switchMap(function (_h) {
400
+ var _j = __read(_h, 2), endpoint = _j[0], extraParams = _j[1];
401
+ return _this._httpClient.get(endpoint, {
402
+ params: Object.assign(Object.assign({}, params), extraParams)
403
+ });
404
+ }), operators.map(function (response) { return _this.formatToCollectionData(response); }));
405
+ };
406
+ ApiCollectionProvider.prototype.getExtraParams = function (params) {
407
+ var keys = Object.keys(params !== null && params !== void 0 ? params : {});
408
+ if (keys.length <= 0) {
409
+ return rxjs.of({});
410
+ }
411
+ var observables$ = keys.map(function (key) { return params === null || params === void 0 ? void 0 : params[key]; });
412
+ return rxjs.combineLatest(observables$).pipe(operators.map(function (data) {
413
+ return data.reduce(function (previous, current, index) {
414
+ var _h;
415
+ var key = keys === null || keys === void 0 ? void 0 : keys[index];
416
+ return Object.assign(Object.assign({}, previous), (_h = {}, _h[key] = current, _h));
417
+ }, {});
418
+ }));
419
+ };
420
+ ApiCollectionProvider.prototype.formatToCollectionData = function (response) {
421
+ if (Array.isArray(response)) {
422
+ return this.formatArrayToCollectionData(response);
423
+ }
424
+ return {
425
+ pageSize: response === null || response === void 0 ? void 0 : response['page_size'],
426
+ pageNumber: response === null || response === void 0 ? void 0 : response['page_number'],
427
+ totalPages: response === null || response === void 0 ? void 0 : response['total_pages'],
428
+ totalEntries: response === null || response === void 0 ? void 0 : response['total_entries'],
429
+ data: response === null || response === void 0 ? void 0 : response['data']
430
+ };
431
+ };
432
+ return ApiCollectionProvider;
433
+ }(CollectionProvider));
434
+
435
+ var LocalCollectionProvider = /** @class */ (function (_super) {
436
+ __extends(LocalCollectionProvider, _super);
437
+ function LocalCollectionProvider(_items) {
438
+ var _this = _super.call(this) || this;
439
+ _this._items = _items;
440
+ return _this;
441
+ }
442
+ LocalCollectionProvider.prototype.transform = function (request) {
443
+ var _this = this;
444
+ var items$ = Array.isArray(this._items)
445
+ ? rxjs.of(this._items)
446
+ : this._items;
447
+ return items$.pipe(operators.map(function (items) { return _this.formatArrayToCollectionData(items); }));
448
+ };
449
+ return LocalCollectionProvider;
450
+ }(CollectionProvider));
451
+
452
+ var BbCollectionsData = /** @class */ (function () {
453
+ function BbCollectionsData() {
454
+ }
455
+ return BbCollectionsData;
456
+ }());
457
+ BbCollectionsData.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: BbCollectionsData, deps: [], target: i0__namespace.ɵɵFactoryTarget.Directive });
458
+ BbCollectionsData.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.10", type: BbCollectionsData, selector: "[bbCollectionsData]", ngImport: i0__namespace });
459
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: BbCollectionsData, decorators: [{
460
+ type: i0.Directive,
461
+ args: [{
462
+ selector: '[bbCollectionsData]'
463
+ }]
464
+ }] });
465
+ var BbCollectionsEmpty = /** @class */ (function () {
466
+ function BbCollectionsEmpty() {
467
+ }
468
+ return BbCollectionsEmpty;
469
+ }());
470
+ BbCollectionsEmpty.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: BbCollectionsEmpty, deps: [], target: i0__namespace.ɵɵFactoryTarget.Directive });
471
+ BbCollectionsEmpty.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.10", type: BbCollectionsEmpty, selector: "[bbCollectionsEmpty]", ngImport: i0__namespace });
472
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: BbCollectionsEmpty, decorators: [{
473
+ type: i0.Directive,
474
+ args: [{
475
+ selector: '[bbCollectionsEmpty]'
476
+ }]
477
+ }] });
478
+ var BbCollectionsError = /** @class */ (function () {
479
+ function BbCollectionsError() {
480
+ }
481
+ return BbCollectionsError;
482
+ }());
483
+ BbCollectionsError.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: BbCollectionsError, deps: [], target: i0__namespace.ɵɵFactoryTarget.Directive });
484
+ BbCollectionsError.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.10", type: BbCollectionsError, selector: "[bbCollectionsError]", ngImport: i0__namespace });
485
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: BbCollectionsError, decorators: [{
486
+ type: i0.Directive,
487
+ args: [{
488
+ selector: '[bbCollectionsError]'
489
+ }]
490
+ }] });
491
+ var BbCollectionsInitial = /** @class */ (function () {
492
+ function BbCollectionsInitial() {
493
+ }
494
+ return BbCollectionsInitial;
495
+ }());
496
+ BbCollectionsInitial.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: BbCollectionsInitial, deps: [], target: i0__namespace.ɵɵFactoryTarget.Directive });
497
+ BbCollectionsInitial.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.10", type: BbCollectionsInitial, selector: "[bbCollectionsInitial]", ngImport: i0__namespace });
498
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: BbCollectionsInitial, decorators: [{
499
+ type: i0.Directive,
500
+ args: [{
501
+ selector: '[bbCollectionsInitial]'
502
+ }]
503
+ }] });
504
+
505
+ var BbCollectionsViewer = /** @class */ (function () {
506
+ function BbCollectionsViewer() {
507
+ // Inputs.
508
+ this.collection = null;
509
+ }
510
+ return BbCollectionsViewer;
511
+ }());
512
+ BbCollectionsViewer.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: BbCollectionsViewer, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
513
+ BbCollectionsViewer.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.10", type: BbCollectionsViewer, selector: "[bb-collections-viewer]", inputs: { collection: "collection" }, host: { classAttribute: "bb-collections-viewer" }, queries: [{ propertyName: "dataTemplate", first: true, predicate: BbCollectionsData, descendants: true, read: i0.TemplateRef }, { propertyName: "emptyTemplate", first: true, predicate: BbCollectionsEmpty, descendants: true, read: i0.TemplateRef }, { propertyName: "errorTemplate", first: true, predicate: BbCollectionsError, descendants: true, read: i0.TemplateRef }, { propertyName: "initialTemplate", first: true, predicate: BbCollectionsInitial, descendants: true, read: i0.TemplateRef }], ngImport: i0__namespace, template: "<ng-container *ngIf=\"collection?.data$ | async as data\"\n [ngSwitch]=\"data?.state\">\n <ng-container *ngSwitchDefault>\n <ng-container *ngTemplateOutlet=\"dataTemplate; context: {items: data?.response?.data}\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'initial'\">\n <ng-container *ngTemplateOutlet=\"initialTemplate\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'empty'\">\n <ng-container *ngTemplateOutlet=\"emptyTemplate; context: {query: data?.request?.query}\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'error'\">\n <ng-container *ngTemplateOutlet=\"errorTemplate; context: {error: data?.error}\"></ng-container>\n </ng-container>\n</ng-container>\n", styles: [".bb-collections-viewer{display:block}\n"], directives: [{ type: i1__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i1__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i1__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], pipes: { "async": i1__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
514
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: BbCollectionsViewer, decorators: [{
515
+ type: i0.Component,
516
+ args: [{
517
+ selector: '[bb-collections-viewer]',
518
+ templateUrl: './collections-viewer.component.html',
519
+ styleUrls: ['./collections-viewer.component.scss'],
520
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
521
+ encapsulation: i0.ViewEncapsulation.None,
522
+ host: { 'class': 'bb-collections-viewer' },
523
+ preserveWhitespaces: false
524
+ }]
525
+ }], propDecorators: { dataTemplate: [{
526
+ type: i0.ContentChild,
527
+ args: [BbCollectionsData, { read: i0.TemplateRef, static: false }]
528
+ }], emptyTemplate: [{
529
+ type: i0.ContentChild,
530
+ args: [BbCollectionsEmpty, { read: i0.TemplateRef, static: false }]
531
+ }], errorTemplate: [{
532
+ type: i0.ContentChild,
533
+ args: [BbCollectionsError, { read: i0.TemplateRef, static: false }]
534
+ }], initialTemplate: [{
535
+ type: i0.ContentChild,
536
+ args: [BbCollectionsInitial, { read: i0.TemplateRef, static: false }]
537
+ }], collection: [{
538
+ type: i0.Input
539
+ }] } });
540
+
541
+ var BbCollectionsPager = /** @class */ (function () {
542
+ function BbCollectionsPager() {
543
+ // Readonly data.
544
+ this.maxAmountOfButtons = 5;
545
+ this.cache$ = new rxjs.BehaviorSubject({});
546
+ // State and subscriptions.
547
+ this._label = null;
548
+ this._collection = null;
549
+ this._subscription = null;
550
+ }
551
+ Object.defineProperty(BbCollectionsPager.prototype, "label", {
552
+ // Inputs.
553
+ set: function (value) {
554
+ this._label = value;
555
+ this.cache$.next(this.cache$.getValue());
556
+ },
557
+ enumerable: false,
558
+ configurable: true
559
+ });
560
+ Object.defineProperty(BbCollectionsPager.prototype, "collection", {
561
+ set: function (collection) {
562
+ this._collection = collection;
563
+ this.observeCollectionChanges();
564
+ },
565
+ enumerable: false,
566
+ configurable: true
567
+ });
568
+ BbCollectionsPager.prototype.ngOnInit = function () {
569
+ var _this = this;
570
+ this.data$ = this.cache$.pipe(operators.map(function (cache) {
571
+ var _a, _b, _c, _d;
572
+ var pageSize = (_a = cache === null || cache === void 0 ? void 0 : cache.pageSize) !== null && _a !== void 0 ? _a : 1;
573
+ var pageNumber = (_b = cache === null || cache === void 0 ? void 0 : cache.pageNumber) !== null && _b !== void 0 ? _b : 1;
574
+ var totalPages = (_c = cache === null || cache === void 0 ? void 0 : cache.totalPages) !== null && _c !== void 0 ? _c : 1;
575
+ var totalEntries = (_d = cache === null || cache === void 0 ? void 0 : cache.totalEntries) !== null && _d !== void 0 ? _d : 0;
576
+ var fromStart = Math.min((pageSize * (pageNumber - 1)) + 1, totalEntries);
577
+ var fromEnd = Math.min((fromStart - 1) + pageSize, totalEntries);
578
+ var pages = _this.filterActivePages(pageNumber, totalPages);
579
+ var allowNext = pageNumber < totalPages;
580
+ var allowPrevious = pageNumber > 1;
581
+ return {
582
+ totalPages: totalPages,
583
+ pages: pages,
584
+ pageNumber: pageNumber,
585
+ allowNext: allowNext,
586
+ allowPrevious: allowPrevious,
587
+ label: _this.calculateLabel(fromStart, fromEnd, totalEntries)
588
+ };
589
+ }));
590
+ };
591
+ BbCollectionsPager.prototype.ngOnDestroy = function () {
592
+ var _a;
593
+ (_a = this._subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
594
+ };
595
+ BbCollectionsPager.prototype.setPage = function (pageNumber, totalPages) {
596
+ var _a, _b, _c, _d;
597
+ // Calculate the new value.
598
+ var newValue = Math.min(totalPages, Math.max(1, pageNumber));
599
+ // Validate the value is actually different.
600
+ var currentValue = (_b = (_a = this._collection) === null || _a === void 0 ? void 0 : _a.pageNumberControl) === null || _b === void 0 ? void 0 : _b.value;
601
+ if (currentValue === newValue) {
602
+ return;
603
+ }
604
+ (_d = (_c = this._collection) === null || _c === void 0 ? void 0 : _c.pageNumberControl) === null || _d === void 0 ? void 0 : _d.setValue(pageNumber);
605
+ };
606
+ BbCollectionsPager.prototype.observeCollectionChanges = function () {
607
+ var _this = this;
608
+ var _a, _b, _c, _d, _e;
609
+ if (!this._collection) {
610
+ return;
611
+ }
612
+ if (this._subscription) {
613
+ (_a = this._subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
614
+ }
615
+ var pageNumber = (_c = (_b = this._collection) === null || _b === void 0 ? void 0 : _b.pageNumberControl) === null || _c === void 0 ? void 0 : _c.value;
616
+ var pageSize = (_e = (_d = this._collection) === null || _d === void 0 ? void 0 : _d.pageSizeControl) === null || _e === void 0 ? void 0 : _e.value;
617
+ this.cache$.next({ pageNumber: pageNumber, pageSize: pageSize });
618
+ this._subscription = this._collection.raw$.subscribe(function (data) {
619
+ if (data) {
620
+ _this.cache$.next(data);
621
+ }
622
+ });
623
+ };
624
+ BbCollectionsPager.prototype.calculateLabel = function (start, end, total) {
625
+ var _a;
626
+ var startPoint = '[start]';
627
+ var endPoint = '[end]';
628
+ var totalPoint = '[total]';
629
+ var label = (_a = this._label) !== null && _a !== void 0 ? _a : "Showing " + startPoint + " to " + endPoint + " of " + totalPoint + " results";
630
+ return label
631
+ .replace(startPoint, "<strong>" + start + "</strong>")
632
+ .replace(endPoint, "<strong>" + end + "</strong>")
633
+ .replace(totalPoint, "<strong>" + total + "</strong>");
634
+ };
635
+ BbCollectionsPager.prototype.calculatePages = function (pageNumber, totalPages) {
636
+ var min = 1;
637
+ var max = totalPages;
638
+ var amount = Math.max(1, this.maxAmountOfButtons);
639
+ var data = Array(amount)
640
+ .fill(0)
641
+ .map(function (_, index) { return pageNumber + (index - 1); });
642
+ // Validate if the minimum value less than
643
+ // the first value.
644
+ if (data[0] < min) {
645
+ return data.map(function (item) { return item + 1; });
646
+ }
647
+ // Calculate the difference with the max
648
+ // if this value is higher than 0 we should minus it.
649
+ var lastValueInArray = data[data.length - 1];
650
+ var differenceWithMax = lastValueInArray - max;
651
+ if (differenceWithMax > 0) {
652
+ return data.map(function (item) { return item - differenceWithMax; });
653
+ }
654
+ // Just return the default data.
655
+ return data;
656
+ };
657
+ BbCollectionsPager.prototype.filterActivePages = function (pageNumber, totalPages) {
658
+ return this.calculatePages(pageNumber, totalPages)
659
+ .filter(function (page) { return page > 0 && page <= totalPages; })
660
+ .map(function (page) { return ({ page: page, active: pageNumber === page }); });
661
+ };
662
+ return BbCollectionsPager;
663
+ }());
664
+ BbCollectionsPager.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: BbCollectionsPager, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
665
+ BbCollectionsPager.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.10", type: BbCollectionsPager, selector: "bb-collections-pager", inputs: { label: "label", collection: "collection" }, host: { classAttribute: "bb-collections-pager" }, ngImport: i0__namespace, template: "<ng-container *ngIf=\"data$ | async as data\">\n <div [innerHTML]=\"data?.label\"\n class=\"bb-collections-pager-text\">\n </div>\n\n <div class=\"bb-collections-pager-container\">\n <ul class=\"bb-collections-pager-list\">\n <li class=\"bb-collections-pager-item\"\n title=\"Previous page\">\n <button [disabled]=\"!data?.allowPrevious\"\n (click)=\"setPage(data?.pageNumber - 1, data?.totalPages)\"\n class=\"bb-collections-pager-button arrow first\"\n type=\"button\">\n &#8592;\n </button>\n </li>\n <li *ngFor=\"let item of data?.pages\"\n [title]=\"'Page ' + item?.page\"\n class=\"bb-collections-pager-item\">\n <button [class.active]=\"item?.active\"\n (click)=\"setPage(item?.page, data?.totalPages)\"\n class=\"bb-collections-pager-button\"\n type=\"button\">\n {{ item?.page }}\n </button>\n </li>\n <li class=\"bb-collections-pager-item\"\n title=\"Next page\">\n <button [disabled]=\"!data?.allowNext\"\n (click)=\"setPage(data?.pageNumber + 1, data?.totalPages)\"\n class=\"bb-collections-pager-button arrow last\"\n type=\"button\">\n &#8594;\n </button>\n </li>\n </ul>\n </div>\n</ng-container>\n", styles: [".bb-collections-pager{display:flex;align-items:center;flex-direction:column-reverse}.bb-collections-pager-text{display:block;margin-top:10px}.bb-collections-pager-text>strong{font-weight:500}.bb-collections-pager-container{width:100%;display:flex;overflow-x:auto;align-items:center;justify-content:center}.bb-collections-pager-list{display:flex;border-radius:6px;align-items:center;background-color:#fff;border:1px solid rgba(67,90,111,.3);box-shadow:#435a6f24 0 1px 2px inset}.bb-collections-pager-item:not(:last-child){border-right:1px solid #cccccc}.bb-collections-pager-button{height:34px;border:none;display:flex;padding:0 4px;min-width:40px;-webkit-appearance:none;-moz-appearance:none;appearance:none;min-height:34px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;align-items:center;justify-content:center;background-color:transparent}.bb-collections-pager-button:hover,.bb-collections-pager-button:focus,.bb-collections-pager-button:active,.bb-collections-pager-button.active{color:#1565c0;font-weight:500}.bb-collections-pager-button:hover,.bb-collections-pager-button:focus{background-color:#1565c00d}.bb-collections-pager-button:active,.bb-collections-pager-button.active{background-color:#1565c033}.bb-collections-pager-button:not(.arrow):hover,.bb-collections-pager-button:not(.arrow):focus{outline:1px solid rgba(21,101,192,.5)}.bb-collections-pager-button:not(.arrow):focus,.bb-collections-pager-button:not(.arrow):active{outline:1px solid #1565c0;box-shadow:#1565c066 0 0 0 3px}.bb-collections-pager-button:not(.arrow).active{outline:1px solid #1565c0}.bb-collections-pager-button.arrow{font-weight:500}.bb-collections-pager-button.arrow.first{border-top-left-radius:2px;border-bottom-left-radius:2px}.bb-collections-pager-button.arrow.last{border-top-right-radius:2px;border-bottom-right-radius:2px}.bb-collections-pager-button:disabled{color:#000;outline:none;opacity:.25;cursor:default;pointer-events:none;background-color:transparent}@media only screen and (min-width: 768px){.bb-collections-pager{flex-wrap:wrap;align-items:center;flex-direction:row;justify-content:space-between}.bb-collections-pager-text{margin-top:0}.bb-collections-pager-container{width:auto;overflow-x:unset}}\n"], directives: [{ type: i1__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i1__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
666
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: BbCollectionsPager, decorators: [{
667
+ type: i0.Component,
668
+ args: [{
669
+ selector: 'bb-collections-pager',
670
+ templateUrl: './collections-pager.component.html',
671
+ styleUrls: ['./collections-pager.component.scss'],
672
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
673
+ encapsulation: i0.ViewEncapsulation.None,
674
+ host: { 'class': 'bb-collections-pager' },
675
+ preserveWhitespaces: false
676
+ }]
677
+ }], propDecorators: { label: [{
678
+ type: i0.Input
679
+ }], collection: [{
680
+ type: i0.Input
681
+ }] } });
682
+
683
+ var Collection = /** @class */ (function () {
684
+ function Collection(_provider, _initialValues) {
685
+ if (_initialValues === void 0) { _initialValues = {}; }
686
+ var _a, _b, _c, _d, _e;
687
+ this._provider = _provider;
688
+ this._initialValues = _initialValues;
689
+ this.raw$ = new rxjs.BehaviorSubject(null);
690
+ this.loading$ = new rxjs.BehaviorSubject(true);
691
+ // State.
692
+ this._formatter = null;
693
+ this._refresh$ = new rxjs.BehaviorSubject(0);
694
+ this._requestCache = null;
695
+ this.controlToObservable = function (control) {
696
+ return control.valueChanges.pipe(operators.distinctUntilChanged(), operators.startWith(control === null || control === void 0 ? void 0 : control.value));
697
+ };
698
+ this.queryControl = new forms.FormControl((_a = _initialValues === null || _initialValues === void 0 ? void 0 : _initialValues.query) !== null && _a !== void 0 ? _a : null);
699
+ this.queryFieldsControl = new forms.FormControl((_b = _initialValues === null || _initialValues === void 0 ? void 0 : _initialValues.queryFields) !== null && _b !== void 0 ? _b : []);
700
+ this.pageNumberControl = new forms.FormControl((_c = _initialValues === null || _initialValues === void 0 ? void 0 : _initialValues.pageNumber) !== null && _c !== void 0 ? _c : 1);
701
+ this.pageSizeControl = new forms.FormControl((_d = _initialValues === null || _initialValues === void 0 ? void 0 : _initialValues.pageSize) !== null && _d !== void 0 ? _d : 25);
702
+ this.sortControl = new forms.FormControl((_e = _initialValues === null || _initialValues === void 0 ? void 0 : _initialValues.sort) !== null && _e !== void 0 ? _e : null);
703
+ this.data$ = this.getData();
704
+ }
705
+ Collection.prototype.refresh = function () {
706
+ this._refresh$.next(0);
707
+ };
708
+ Collection.prototype.setFormatter = function (callback) {
709
+ this._formatter = callback;
710
+ return this;
711
+ };
712
+ Collection.prototype.getData = function () {
713
+ var _this = this;
714
+ var data$ = this.request.pipe(operators.tap(function () { return _this.loading$.next(true); }), operators.map(function (request) { return _this.validateRequest(request); }), operators.switchMap(function (request) {
715
+ return _this._provider.transform(request).pipe(operators.tap(function (response) { return _this.cacheCollectionData(response); }), operators.map(function (response) { return ({ response: response, request: request, initial: false }); }), operators.catchError(function (error) { return rxjs.of({
716
+ error: error,
717
+ request: request,
718
+ response: null,
719
+ initial: false
720
+ }); }));
721
+ }), operators.startWith({ initial: true, response: null }));
722
+ return rxjs.combineLatest([data$, this.loading$.asObservable()]).pipe(operators.map(function (_f) {
723
+ var _g = __read(_f, 2), data = _g[0], loading = _g[1];
724
+ var combined = Object.assign(Object.assign({}, data), { loading: loading });
725
+ return Object.assign(Object.assign({}, combined), { response: _this.formatResponse(data === null || data === void 0 ? void 0 : data.response), state: _this.getState(combined) });
726
+ }));
727
+ };
728
+ Collection.prototype.formatResponse = function (response) {
729
+ var _this = this;
730
+ var _a;
731
+ if (!response) {
732
+ return response;
733
+ }
734
+ var data = ((_a = response === null || response === void 0 ? void 0 : response.data) !== null && _a !== void 0 ? _a : []).map(function (item) {
735
+ var _a;
736
+ return !!_this._formatter ? (_a = _this._formatter) === null || _a === void 0 ? void 0 : _a.call(_this, item) : item;
737
+ });
738
+ return Object.assign(Object.assign({}, response), { data: data });
739
+ };
740
+ Collection.prototype.validateRequest = function (request) {
741
+ var _a, _b, _c, _d;
742
+ // We should reset the page number whenever we change the query or the page size.
743
+ if (this._requestCache && request && (((_a = this._requestCache) === null || _a === void 0 ? void 0 : _a.query) !== (request === null || request === void 0 ? void 0 : request.query) || ((_b = this._requestCache) === null || _b === void 0 ? void 0 : _b.pageSize) !== (request === null || request === void 0 ? void 0 : request.pageSize))) {
744
+ (_c = this.pageNumberControl) === null || _c === void 0 ? void 0 : _c.setValue(1, { emitEvent: false });
745
+ request.pageNumber = (_d = this.pageNumberControl) === null || _d === void 0 ? void 0 : _d.value;
746
+ }
747
+ this._requestCache = Object.assign({}, request);
748
+ return request;
749
+ };
750
+ Collection.prototype.getState = function (data) {
751
+ var _a, _b, _c;
752
+ if (!!(data === null || data === void 0 ? void 0 : data.error)) {
753
+ return "error" /* Error */;
754
+ }
755
+ if (!!(data === null || data === void 0 ? void 0 : data.initial)) {
756
+ return "initial" /* Initial */;
757
+ }
758
+ var count = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0;
759
+ if (count <= 0) {
760
+ return "empty" /* Empty */;
761
+ }
762
+ return "data" /* Data */;
763
+ };
764
+ Collection.prototype.cacheCollectionData = function (data) {
765
+ this.raw$.next(data);
766
+ this.loading$.next(false);
767
+ };
768
+ Object.defineProperty(Collection.prototype, "request", {
769
+ get: function () {
770
+ var pageNumber$ = this.controlToObservable(this.pageNumberControl);
771
+ var pageSize$ = this.controlToObservable(this.pageSizeControl);
772
+ var query$ = this.getQueryObservable();
773
+ var queryFields$ = this.controlToObservable(this.queryFieldsControl);
774
+ var sort$ = this.controlToObservable(this.sortControl);
775
+ return rxjs.combineLatest([pageNumber$, pageSize$, query$, queryFields$, sort$, this._refresh$.asObservable()]).pipe(operators.map(function (_f) {
776
+ var _g = __read(_f, 5), pageNumber = _g[0], pageSize = _g[1], query = _g[2], queryFields = _g[3], sort = _g[4];
777
+ return ({
778
+ pageNumber: pageNumber,
779
+ pageSize: pageSize,
780
+ query: query,
781
+ queryFields: queryFields,
782
+ sort: sort
783
+ });
784
+ }));
785
+ },
786
+ enumerable: false,
787
+ configurable: true
788
+ });
789
+ Collection.prototype.getQueryObservable = function () {
790
+ var _a;
791
+ return this.queryControl.valueChanges.pipe(operators.debounceTime(400), operators.distinctUntilChanged(), operators.startWith((_a = this.queryControl) === null || _a === void 0 ? void 0 : _a.value));
792
+ };
793
+ return Collection;
794
+ }());
795
+
796
+ var CollectionsModule = /** @class */ (function () {
797
+ function CollectionsModule() {
798
+ }
799
+ return CollectionsModule;
800
+ }());
801
+ CollectionsModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: CollectionsModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
802
+ CollectionsModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: CollectionsModule, declarations: [
803
+ // Components.
804
+ BbCollectionsViewer,
805
+ BbCollectionsPager,
806
+ // Directives.
807
+ BbCollectionsData,
808
+ BbCollectionsEmpty,
809
+ BbCollectionsError,
810
+ BbCollectionsInitial
811
+ ], imports: [i1.CommonModule], exports: [
812
+ // Components.
813
+ BbCollectionsViewer,
814
+ BbCollectionsPager,
815
+ // Directives.
816
+ BbCollectionsData,
817
+ BbCollectionsEmpty,
818
+ BbCollectionsError,
819
+ BbCollectionsInitial
820
+ ] });
821
+ CollectionsModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: CollectionsModule, imports: [[i1.CommonModule]] });
822
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: CollectionsModule, decorators: [{
823
+ type: i0.NgModule,
824
+ args: [{
825
+ imports: [i1.CommonModule],
826
+ declarations: [
827
+ // Components.
828
+ BbCollectionsViewer,
829
+ BbCollectionsPager,
830
+ // Directives.
831
+ BbCollectionsData,
832
+ BbCollectionsEmpty,
833
+ BbCollectionsError,
834
+ BbCollectionsInitial
835
+ ],
836
+ exports: [
837
+ // Components.
838
+ BbCollectionsViewer,
839
+ BbCollectionsPager,
840
+ // Directives.
841
+ BbCollectionsData,
842
+ BbCollectionsEmpty,
843
+ BbCollectionsError,
844
+ BbCollectionsInitial
845
+ ]
846
+ }]
847
+ }] });
848
+
849
+ /**
850
+ * Generated bundle index. Do not edit.
851
+ */
852
+
853
+ exports.ApiCollectionProvider = ApiCollectionProvider;
854
+ exports.BbCollectionsData = BbCollectionsData;
855
+ exports.BbCollectionsEmpty = BbCollectionsEmpty;
856
+ exports.BbCollectionsError = BbCollectionsError;
857
+ exports.BbCollectionsInitial = BbCollectionsInitial;
858
+ exports.BbCollectionsPager = BbCollectionsPager;
859
+ exports.BbCollectionsViewer = BbCollectionsViewer;
860
+ exports.Collection = Collection;
861
+ exports.CollectionProvider = CollectionProvider;
862
+ exports.CollectionsModule = CollectionsModule;
863
+ exports.LocalCollectionProvider = LocalCollectionProvider;
864
+
865
+ Object.defineProperty(exports, '__esModule', { value: true });
866
+
867
+ }));
868
+ //# sourceMappingURL=bravobit-bb-foundation-collections.umd.js.map