@bravobit/bb-foundation 0.54.4 → 0.55.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 (302) hide show
  1. package/auth/index.d.ts +267 -5
  2. package/collections/index.d.ts +350 -5
  3. package/combobox/index.d.ts +58 -5
  4. package/dashboard/index.d.ts +104 -5
  5. package/dialog/index.d.ts +168 -5
  6. package/elements/index.d.ts +838 -5
  7. package/fesm2022/bravobit-bb-foundation-auth.mjs +22 -22
  8. package/fesm2022/bravobit-bb-foundation-auth.mjs.map +1 -1
  9. package/fesm2022/bravobit-bb-foundation-collections.mjs +44 -44
  10. package/fesm2022/bravobit-bb-foundation-collections.mjs.map +1 -1
  11. package/fesm2022/bravobit-bb-foundation-combobox.mjs +15 -15
  12. package/fesm2022/bravobit-bb-foundation-combobox.mjs.map +1 -1
  13. package/fesm2022/bravobit-bb-foundation-dashboard.mjs +25 -25
  14. package/fesm2022/bravobit-bb-foundation-dashboard.mjs.map +1 -1
  15. package/fesm2022/bravobit-bb-foundation-dialog.mjs +33 -33
  16. package/fesm2022/bravobit-bb-foundation-dialog.mjs.map +1 -1
  17. package/fesm2022/bravobit-bb-foundation-elements.mjs +105 -105
  18. package/fesm2022/bravobit-bb-foundation-elements.mjs.map +1 -1
  19. package/fesm2022/bravobit-bb-foundation-http.mjs +10 -10
  20. package/fesm2022/bravobit-bb-foundation-http.mjs.map +1 -1
  21. package/fesm2022/bravobit-bb-foundation-localize.mjs +18 -18
  22. package/fesm2022/bravobit-bb-foundation-localize.mjs.map +1 -1
  23. package/fesm2022/bravobit-bb-foundation-masking.mjs +16 -16
  24. package/fesm2022/bravobit-bb-foundation-masking.mjs.map +1 -1
  25. package/fesm2022/bravobit-bb-foundation-notifications.mjs +15 -15
  26. package/fesm2022/bravobit-bb-foundation-notifications.mjs.map +1 -1
  27. package/fesm2022/bravobit-bb-foundation-permissions.mjs +10 -10
  28. package/fesm2022/bravobit-bb-foundation-permissions.mjs.map +1 -1
  29. package/fesm2022/bravobit-bb-foundation-recaptcha.mjs +11 -12
  30. package/fesm2022/bravobit-bb-foundation-recaptcha.mjs.map +1 -1
  31. package/fesm2022/bravobit-bb-foundation-select.mjs +21 -21
  32. package/fesm2022/bravobit-bb-foundation-select.mjs.map +1 -1
  33. package/fesm2022/bravobit-bb-foundation-storage.mjs +3 -3
  34. package/fesm2022/bravobit-bb-foundation-storage.mjs.map +1 -1
  35. package/fesm2022/bravobit-bb-foundation-table.mjs +22 -22
  36. package/fesm2022/bravobit-bb-foundation-table.mjs.map +1 -1
  37. package/fesm2022/bravobit-bb-foundation-tooltip.mjs +10 -10
  38. package/fesm2022/bravobit-bb-foundation-tooltip.mjs.map +1 -1
  39. package/fesm2022/bravobit-bb-foundation-utils.mjs +16 -16
  40. package/fesm2022/bravobit-bb-foundation-utils.mjs.map +1 -1
  41. package/fesm2022/bravobit-bb-foundation.mjs +25 -25
  42. package/fesm2022/bravobit-bb-foundation.mjs.map +1 -1
  43. package/http/index.d.ts +78 -5
  44. package/index.d.ts +215 -5
  45. package/localize/index.d.ts +546 -5
  46. package/masking/index.d.ts +104 -5
  47. package/notifications/index.d.ts +78 -5
  48. package/package.json +26 -26
  49. package/permissions/index.d.ts +89 -5
  50. package/recaptcha/index.d.ts +92 -5
  51. package/rxjs/index.d.ts +19 -5
  52. package/select/index.d.ts +129 -5
  53. package/storage/index.d.ts +109 -5
  54. package/table/index.d.ts +197 -5
  55. package/tooltip/index.d.ts +45 -5
  56. package/utils/index.d.ts +66 -5
  57. package/auth/lib/acting.interceptor.d.ts +0 -9
  58. package/auth/lib/acting.service.d.ts +0 -17
  59. package/auth/lib/auth.config.d.ts +0 -3
  60. package/auth/lib/auth.interceptor.d.ts +0 -20
  61. package/auth/lib/auth.module.d.ts +0 -10
  62. package/auth/lib/auth.service.d.ts +0 -51
  63. package/auth/lib/auth.session.d.ts +0 -50
  64. package/auth/lib/directives/anonymous.directive.d.ts +0 -20
  65. package/auth/lib/directives/authenticated.directive.d.ts +0 -20
  66. package/auth/lib/guards/anonymous.guard.d.ts +0 -2
  67. package/auth/lib/guards/authenticated.guard.d.ts +0 -2
  68. package/auth/lib/helpers/jwt.helper.d.ts +0 -8
  69. package/auth/lib/interfaces/config.interface.d.ts +0 -27
  70. package/auth/lib/interfaces/provider.interface.d.ts +0 -23
  71. package/auth/lib/interfaces/token.interface.d.ts +0 -11
  72. package/auth/lib/providers/email.provider.d.ts +0 -9
  73. package/auth/lib/providers/verify.provider.d.ts +0 -9
  74. package/auth/lib/tokens/use-authorization.token.d.ts +0 -2
  75. package/auth/public_api.d.ts +0 -17
  76. package/collections/lib/classes/array.collection.d.ts +0 -17
  77. package/collections/lib/collection.d.ts +0 -40
  78. package/collections/lib/collections.config.d.ts +0 -3
  79. package/collections/lib/collections.interfaces.d.ts +0 -10
  80. package/collections/lib/collections.module.d.ts +0 -19
  81. package/collections/lib/components/collections-actions/collections-actions.component.d.ts +0 -13
  82. package/collections/lib/components/collections-grid/collections-grid.component.d.ts +0 -18
  83. package/collections/lib/components/collections-pager/collections-pager.component.d.ts +0 -38
  84. package/collections/lib/components/collections-table/collections-table.component.d.ts +0 -26
  85. package/collections/lib/components/collections-table-label/collections-table-label.component.d.ts +0 -11
  86. package/collections/lib/components/collections-table-sorting/collections-table-sorting.component.d.ts +0 -18
  87. package/collections/lib/components/collections-viewer/collections-viewer.component.d.ts +0 -16
  88. package/collections/lib/directives/collections-data-row.directive.d.ts +0 -14
  89. package/collections/lib/directives/collections-data.directive.d.ts +0 -14
  90. package/collections/lib/directives/collections-empty.directive.d.ts +0 -14
  91. package/collections/lib/directives/collections-error.directive.d.ts +0 -14
  92. package/collections/lib/directives/collections-initial.directive.d.ts +0 -11
  93. package/collections/lib/directives/collections-item.directive.d.ts +0 -14
  94. package/collections/lib/interfaces/array-collection.interface.d.ts +0 -6
  95. package/collections/lib/interfaces/collection.interface.d.ts +0 -32
  96. package/collections/lib/providers/api-collection.provider.d.ts +0 -19
  97. package/collections/lib/providers/collection.provider.d.ts +0 -9
  98. package/collections/lib/providers/local-collection.provider.d.ts +0 -16
  99. package/collections/public_api.d.ts +0 -23
  100. package/combobox/combobox/combobox-container.directive.d.ts +0 -28
  101. package/combobox/combobox/combobox.component.d.ts +0 -37
  102. package/combobox/combobox-label.directive.d.ts +0 -5
  103. package/combobox/combobox-option.directive.d.ts +0 -7
  104. package/combobox/combobox-panel/combobox-panel.animation.d.ts +0 -1
  105. package/combobox/combobox-panel/combobox-panel.component.d.ts +0 -18
  106. package/combobox/combobox.interface.d.ts +0 -8
  107. package/combobox/public_api.d.ts +0 -3
  108. package/dashboard/lib/dashboard/dashboard.component.d.ts +0 -17
  109. package/dashboard/lib/dashboard-header/dashboard-header.component.d.ts +0 -9
  110. package/dashboard/lib/dashboard-menu/dashboard-menu.component.d.ts +0 -9
  111. package/dashboard/lib/dashboard-menu-item/dashboard-menu-item.component.d.ts +0 -8
  112. package/dashboard/lib/dashboard-sidebar/dashboard-sidebar.component.d.ts +0 -19
  113. package/dashboard/lib/dashboard-sidebar-group/dashboard-sidebar-group.component.d.ts +0 -22
  114. package/dashboard/lib/dashboard-sidebar-item/dashboard-sidebar-item.component.d.ts +0 -16
  115. package/dashboard/lib/dashboard.module.d.ts +0 -13
  116. package/dashboard/public_api.d.ts +0 -8
  117. package/dialog/lib/dialog-actions/dialog-actions.component.d.ts +0 -5
  118. package/dialog/lib/dialog-confirm/dialog-confirm.component.d.ts +0 -22
  119. package/dialog/lib/dialog-container/dialog-container.component.d.ts +0 -23
  120. package/dialog/lib/dialog-header/dialog-header.component.d.ts +0 -13
  121. package/dialog/lib/dialog-modal/dialog-modal.component.d.ts +0 -16
  122. package/dialog/lib/dialog-overlay/dialog-overlay.component.d.ts +0 -19
  123. package/dialog/lib/dialog.config.d.ts +0 -3
  124. package/dialog/lib/dialog.insertion.d.ts +0 -7
  125. package/dialog/lib/dialog.interfaces.d.ts +0 -21
  126. package/dialog/lib/dialog.module.d.ts +0 -17
  127. package/dialog/lib/dialog.ref.d.ts +0 -8
  128. package/dialog/lib/dialog.service.d.ts +0 -15
  129. package/dialog/lib/directives/confirm.directive.d.ts +0 -14
  130. package/dialog/public_api.d.ts +0 -10
  131. package/elements/lib/avatar/avatar.component.d.ts +0 -31
  132. package/elements/lib/button/button.component.d.ts +0 -21
  133. package/elements/lib/checkbox/checkbox.component.d.ts +0 -36
  134. package/elements/lib/checkbox-group/checkbox-group.component.d.ts +0 -13
  135. package/elements/lib/color-picker/color-picker.component.d.ts +0 -18
  136. package/elements/lib/color-slider/color-slider.component.d.ts +0 -24
  137. package/elements/lib/date-picker/date-picker.component.d.ts +0 -77
  138. package/elements/lib/directives/color-picker.directive.d.ts +0 -27
  139. package/elements/lib/directives/extra-error-controls.directive.d.ts +0 -13
  140. package/elements/lib/directives/file-drop.directive.d.ts +0 -13
  141. package/elements/lib/directives/form-submit.directive.d.ts +0 -17
  142. package/elements/lib/directives/form-submitter.directive.d.ts +0 -9
  143. package/elements/lib/directives/image-upload.directive.d.ts +0 -25
  144. package/elements/lib/directives/input.directive.d.ts +0 -16
  145. package/elements/lib/elements.config.d.ts +0 -3
  146. package/elements/lib/elements.inject.d.ts +0 -3
  147. package/elements/lib/elements.interfaces.d.ts +0 -41
  148. package/elements/lib/elements.module.d.ts +0 -39
  149. package/elements/lib/file-picker/file-picker.component.d.ts +0 -57
  150. package/elements/lib/form-control/form-control.component.d.ts +0 -20
  151. package/elements/lib/form-error/form-error.component.d.ts +0 -36
  152. package/elements/lib/form-group/form-group.component.d.ts +0 -7
  153. package/elements/lib/icon/icon.component.d.ts +0 -26
  154. package/elements/lib/image-control/image-control.component.d.ts +0 -44
  155. package/elements/lib/image-picker/image-picker.component.d.ts +0 -39
  156. package/elements/lib/multi-file-control/multi-file-control.component.d.ts +0 -72
  157. package/elements/lib/pincode-control/pincode-control.component.d.ts +0 -65
  158. package/elements/lib/pipes/date.pipe.d.ts +0 -9
  159. package/elements/lib/pipes/file-data-url.pipe.d.ts +0 -12
  160. package/elements/lib/pipes/file-image.pipe.d.ts +0 -14
  161. package/elements/lib/pipes/file-size.pipe.d.ts +0 -7
  162. package/elements/lib/pipes/relative-time.pipe.d.ts +0 -19
  163. package/elements/lib/radio-button/radio-button.component.d.ts +0 -16
  164. package/elements/lib/radio-group/radio-group.component.d.ts +0 -38
  165. package/elements/lib/spinner/spinner.component.d.ts +0 -9
  166. package/elements/public_api.d.ts +0 -35
  167. package/http/lib/classes/http.config.d.ts +0 -9
  168. package/http/lib/classes/http.error.d.ts +0 -7
  169. package/http/lib/http.config.d.ts +0 -5
  170. package/http/lib/http.interfaces.d.ts +0 -21
  171. package/http/lib/http.module.d.ts +0 -11
  172. package/http/lib/interceptors/base-url.interceptor.d.ts +0 -15
  173. package/http/lib/interceptors/error.interceptor.d.ts +0 -9
  174. package/http/public_api.d.ts +0 -7
  175. package/lib/core/colors/hex.d.ts +0 -18
  176. package/lib/core/colors/hsl.d.ts +0 -7
  177. package/lib/core/colors/hsv.d.ts +0 -13
  178. package/lib/core/colors/rgb.d.ts +0 -7
  179. package/lib/core/functions/array.utils.d.ts +0 -1
  180. package/lib/core/functions/date.utils.d.ts +0 -4
  181. package/lib/core/functions/file.utils.d.ts +0 -3
  182. package/lib/core/functions/format.utils.d.ts +0 -1
  183. package/lib/core/functions/password.utils.d.ts +0 -1
  184. package/lib/core/functions/route-cache.utils.d.ts +0 -10
  185. package/lib/core/functions/utils.d.ts +0 -1
  186. package/lib/core/miscellaneous/coercion.d.ts +0 -2
  187. package/lib/core/miscellaneous/regex.d.ts +0 -5
  188. package/lib/core/miscellaneous/validator.d.ts +0 -13
  189. package/lib/core/services/exif.service.d.ts +0 -12
  190. package/lib/core/services/file-loader.service.d.ts +0 -13
  191. package/lib/core/services/files.service.d.ts +0 -15
  192. package/lib/core/services/image-converter.service.d.ts +0 -17
  193. package/lib/core/services/languages.service.d.ts +0 -15
  194. package/lib/core/services/network.service.d.ts +0 -13
  195. package/lib/core/services/patch.service.d.ts +0 -14
  196. package/lib/core/tokens/accept-language.token.d.ts +0 -2
  197. package/lib/core/tokens/cookie.token.d.ts +0 -2
  198. package/lib/core/tokens/global-focus-mode.token.d.ts +0 -4
  199. package/lib/core/tokens/location.token.d.ts +0 -2
  200. package/lib/core/tokens/navigator.token.d.ts +0 -2
  201. package/lib/core/tokens/window.token.d.ts +0 -2
  202. package/localize/lib/dictionary/dictionary.class.d.ts +0 -28
  203. package/localize/lib/dictionary/dictionary.context.d.ts +0 -7
  204. package/localize/lib/dictionary/dictionary.data.d.ts +0 -7
  205. package/localize/lib/functions/date.function.d.ts +0 -5
  206. package/localize/lib/functions/lowercase.function.d.ts +0 -5
  207. package/localize/lib/functions/uppercase.function.d.ts +0 -5
  208. package/localize/lib/handlers/missing.handler.d.ts +0 -6
  209. package/localize/lib/interfaces/config.interfaces.d.ts +0 -18
  210. package/localize/lib/interfaces/functions.interfaces.d.ts +0 -7
  211. package/localize/lib/interfaces/handlers.interfaces.d.ts +0 -6
  212. package/localize/lib/interfaces/options.interfaces.d.ts +0 -11
  213. package/localize/lib/localizations/dutch.localization.d.ts +0 -74
  214. package/localize/lib/localizations/english.localization.d.ts +0 -74
  215. package/localize/lib/localizations/papiamento.localization.d.ts +0 -74
  216. package/localize/lib/localizations/spanish.localization.d.ts +0 -74
  217. package/localize/lib/localize.config.d.ts +0 -5
  218. package/localize/lib/localize.module.d.ts +0 -12
  219. package/localize/lib/localize.pipe.d.ts +0 -12
  220. package/localize/lib/localize.service.d.ts +0 -43
  221. package/localize/lib/localize.tokens.d.ts +0 -11
  222. package/localize/lib/transforms/abstract.transform.d.ts +0 -13
  223. package/localize/lib/transforms/interpolate.transform.d.ts +0 -13
  224. package/localize/lib/transforms/plural.transform.d.ts +0 -16
  225. package/localize/lib/transforms/reference.transform.d.ts +0 -9
  226. package/localize/lib/views/localize-string/localize-string.component.d.ts +0 -23
  227. package/localize/lib/views/localize-template.directive.d.ts +0 -9
  228. package/localize/public_api.d.ts +0 -26
  229. package/masking/lib/directives/currency-mask.directive.d.ts +0 -17
  230. package/masking/lib/directives/date-mask.directive.d.ts +0 -17
  231. package/masking/lib/directives/input-mask.directive.d.ts +0 -38
  232. package/masking/lib/input-mask.interface.d.ts +0 -19
  233. package/masking/lib/masking.module.d.ts +0 -9
  234. package/masking/lib/masking.service.d.ts +0 -12
  235. package/masking/public_api.d.ts +0 -6
  236. package/notifications/lib/notifications-item/notifications-item.component.d.ts +0 -33
  237. package/notifications/lib/notifications-list/notifications-list.component.d.ts +0 -18
  238. package/notifications/lib/notifications.animations.d.ts +0 -1
  239. package/notifications/lib/notifications.config.d.ts +0 -3
  240. package/notifications/lib/notifications.interfaces.d.ts +0 -36
  241. package/notifications/lib/notifications.module.d.ts +0 -9
  242. package/notifications/lib/notifications.service.d.ts +0 -30
  243. package/notifications/public_api.d.ts +0 -4
  244. package/permissions/lib/directives/permission.directive.d.ts +0 -27
  245. package/permissions/lib/guards/permission.guard.d.ts +0 -3
  246. package/permissions/lib/handlers/abstract.handler.d.ts +0 -4
  247. package/permissions/lib/handlers/local.handler.d.ts +0 -10
  248. package/permissions/lib/permissions.config.d.ts +0 -3
  249. package/permissions/lib/permissions.interface.d.ts +0 -13
  250. package/permissions/lib/permissions.module.d.ts +0 -10
  251. package/permissions/lib/permissions.service.d.ts +0 -23
  252. package/permissions/public_api.d.ts +0 -8
  253. package/public_api.d.ts +0 -27
  254. package/recaptcha/lib/recaptcha/recaptcha.component.d.ts +0 -47
  255. package/recaptcha/lib/recaptcha-loader.service.d.ts +0 -19
  256. package/recaptcha/lib/recaptcha.config.d.ts +0 -3
  257. package/recaptcha/lib/recaptcha.interface.d.ts +0 -13
  258. package/recaptcha/lib/recaptcha.module.d.ts +0 -10
  259. package/recaptcha/public_api.d.ts +0 -5
  260. package/rxjs/lib/observables/get-control-value.observable.d.ts +0 -3
  261. package/rxjs/lib/observables/get-route-param.observable.d.ts +0 -3
  262. package/rxjs/lib/operators/combine-latest-map.operator.d.ts +0 -8
  263. package/rxjs/lib/operators/filter-nil.operator.d.ts +0 -1
  264. package/rxjs/public_api.d.ts +0 -4
  265. package/select/lib/select/select.component.d.ts +0 -94
  266. package/select/lib/select-label.directive.d.ts +0 -7
  267. package/select/lib/select-multi-label.directive.d.ts +0 -7
  268. package/select/lib/select-option-group.directive.d.ts +0 -7
  269. package/select/lib/select-option.directive.d.ts +0 -7
  270. package/select/lib/select.config.d.ts +0 -2
  271. package/select/lib/select.module.d.ts +0 -11
  272. package/select/public_api.d.ts +0 -7
  273. package/storage/lib/interfaces/attributes.interface.d.ts +0 -13
  274. package/storage/lib/interfaces/memory.interface.d.ts +0 -7
  275. package/storage/lib/interfaces/strategy.interface.d.ts +0 -17
  276. package/storage/lib/storage.service.d.ts +0 -25
  277. package/storage/lib/strategies/cookie-storage.strategy.d.ts +0 -20
  278. package/storage/lib/strategies/memory-storage.strategy.d.ts +0 -11
  279. package/storage/lib/strategies/polyfill-storage.strategy.d.ts +0 -15
  280. package/storage/public_api.d.ts +0 -7
  281. package/table/lib/components/table/table.component.d.ts +0 -57
  282. package/table/lib/components/table-cell/table-cell.component.d.ts +0 -5
  283. package/table/lib/components/table-header-cell/table-header-cell.component.d.ts +0 -26
  284. package/table/lib/components/table-pager/table-pager.component.d.ts +0 -40
  285. package/table/lib/data/datasource.data.d.ts +0 -14
  286. package/table/lib/data/generic.data.d.ts +0 -25
  287. package/table/lib/interfaces/datasource.interface.d.ts +0 -17
  288. package/table/lib/interfaces/table.interfaces.d.ts +0 -11
  289. package/table/lib/table.config.d.ts +0 -3
  290. package/table/lib/table.module.d.ts +0 -10
  291. package/table/public_api.d.ts +0 -10
  292. package/tooltip/lib/tooltip-container/tooltip-container.component.d.ts +0 -9
  293. package/tooltip/lib/tooltip.directive.d.ts +0 -23
  294. package/tooltip/lib/tooltip.interfaces.d.ts +0 -4
  295. package/tooltip/lib/tooltip.module.d.ts +0 -7
  296. package/tooltip/public_api.d.ts +0 -4
  297. package/utils/lib/directives/autosize.directive.d.ts +0 -19
  298. package/utils/lib/directives/focus-trap.directive.d.ts +0 -14
  299. package/utils/lib/directives/focus.directive.d.ts +0 -16
  300. package/utils/lib/directives/template.directive.d.ts +0 -10
  301. package/utils/lib/utils.module.d.ts +0 -10
  302. package/utils/public_api.d.ts +0 -5
@@ -1 +1 @@
1
- {"version":3,"file":"bravobit-bb-foundation-masking.mjs","sources":["../../../projects/bb-foundation/masking/src/lib/input-mask.interface.ts","../../../projects/bb-foundation/masking/src/lib/directives/input-mask.directive.ts","../../../projects/bb-foundation/masking/src/lib/masking.service.ts","../../../projects/bb-foundation/masking/src/lib/directives/currency-mask.directive.ts","../../../projects/bb-foundation/masking/src/lib/directives/date-mask.directive.ts","../../../projects/bb-foundation/masking/src/lib/masking.module.ts","../../../projects/bb-foundation/masking/src/bravobit-bb-foundation-masking.ts"],"sourcesContent":["import type Inputmask from 'inputmask';\n\nexport type InputMaskOptions<T> = Inputmask.Options & {\n parser?: (value: any) => T;\n};\n\nexport type CurrencyMaskOptions = {\n symbol: string;\n symbolFormat: 'wide' | 'narrow';\n spacer: string;\n digits: number;\n digitsOptional: boolean;\n decimalCharacter: string;\n groupCharacter: string;\n min: number;\n max: number;\n allowMinus: boolean;\n nullable: boolean;\n}\n\nexport type DateMaskFormat =\n 'day-month-year' |\n 'month-day-year' |\n 'year-month-day' |\n 'year-day-month';\n\nexport const createMask = <T>(options: string | InputMaskOptions<T>) => typeof options === 'string' ? {mask: options} : options;\n","import {Directive, ElementRef, HostListener, Input, NgZone, OnDestroy, OnInit, Optional, Renderer2, Self} from '@angular/core';\nimport {AbstractControl, ControlValueAccessor, NgControl, Validator} from '@angular/forms';\nimport {InputMaskOptions} from '../input-mask.interface';\nimport {fromEvent, merge, Subscription} from 'rxjs';\nimport {Platform} from '@angular/cdk/platform';\nimport type Inputmask from 'inputmask';\nimport _Inputmask from 'inputmask';\n\nconst InputmaskConstructor = (_Inputmask as unknown as { default?: Inputmask.Static }).default || _Inputmask;\n\n@Directive({\n selector: 'input[bbInputMask],input[bbCurrencyMask],input[bbDateMask]'\n})\nexport class BbInputMask<T = any> implements OnInit, OnDestroy, ControlValueAccessor, Validator {\n\n @Input('bbInputMask')\n set mask(mask: InputMaskOptions<T> | string | null | undefined) {\n if (!mask || typeof mask === 'string') {\n return;\n }\n\n this._inputMaskOptions = mask;\n this.updateMask();\n }\n\n // State.\n inputMaskPlugin: Inputmask.Instance | null = null;\n nativeInputElement: HTMLInputElement | null = null;\n eventsSubscription: Subscription | null = null;\n\n private _inputMaskOptions: InputMaskOptions<T> | null = null;\n private _onChange: (value: T | null) => void = () => ({});\n\n constructor(private _ngZone: NgZone,\n private _platform: Platform,\n private _renderer: Renderer2,\n private _elementRef: ElementRef<HTMLInputElement>,\n @Optional() @Self() private _control?: NgControl) {\n this.nativeInputElement = this._elementRef.nativeElement;\n if (this._control != null) {\n this._control.valueAccessor = this;\n }\n }\n\n @HostListener('input', ['$event.target.value'])\n onInput: (value: any) => void = (_: any) => ({});\n\n @HostListener('blur', ['$event.target.value'])\n onTouched: () => void = () => ({});\n\n ngOnInit() {\n const control = this._control?.control;\n if (!control) {\n return;\n }\n\n control?.setValidators(control.validator ? [control.validator, this.validate] : [this.validate]);\n control?.updateValueAndValidity();\n }\n\n ngOnDestroy() {\n this.destroyMask();\n }\n\n writeValue(value: string) {\n if (!this.nativeInputElement) {\n return;\n }\n this._renderer.setProperty(this.nativeInputElement, 'value', value ?? '');\n }\n\n registerOnChange(fn: (value: T | null) => void) {\n this._onChange = fn;\n const parser = this._inputMaskOptions?.parser;\n this.onInput = value => this._onChange(parser ? parser(value) : value);\n }\n\n registerOnTouched(fn: () => void) {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean) {\n if (!this.nativeInputElement) {\n return;\n }\n this._renderer.setProperty(this.nativeInputElement, 'disabled', isDisabled);\n }\n\n validate = (control: AbstractControl) => !control.value || !this.inputMaskPlugin || this.inputMaskPlugin?.isValid()\n ? null\n : {inputMask: true};\n\n private updateMask() {\n this.destroyMask();\n this.createMask();\n this.registerOnChange(this._onChange);\n }\n\n private createMask() {\n if (!this._platform.isBrowser || !this.nativeInputElement || this._inputMaskOptions === null || Object.keys(this._inputMaskOptions).length === 0) {\n return;\n }\n\n const {parser, ...options} = this._inputMaskOptions;\n this.inputMaskPlugin = this._ngZone.runOutsideAngular(() => new InputmaskConstructor(options).mask(this.nativeInputElement));\n\n const setValue$ = fromEvent(this.nativeInputElement, 'setvalue');\n const cleared$ = fromEvent(this.nativeInputElement, 'cleared');\n\n this.eventsSubscription = merge(setValue$, cleared$)\n .subscribe(event => this.onInput(event?.target?.['value']));\n\n const control = this._control?.control;\n if (!control) {\n return;\n }\n setTimeout(() => control?.updateValueAndValidity());\n }\n\n private destroyMask() {\n this.eventsSubscription?.unsubscribe();\n this.eventsSubscription = null;\n this.inputMaskPlugin?.remove();\n this.inputMaskPlugin = null;\n }\n\n // Required so that the template type checker can infer the type of the coerced inputs.\n static ngAcceptInputType_bbInputMask: InputMaskOptions<any> | string | null | undefined;\n\n}\n","import {formatDate, getCurrencySymbol, getLocaleNumberSymbol, getNumberOfCurrencyDigits, NumberSymbol} from '@angular/common';\nimport {createMask, CurrencyMaskOptions, DateMaskFormat} from './input-mask.interface';\nimport {Localize} from '@bravobit/bb-foundation/localize';\nimport {Injectable, Optional} from '@angular/core';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class Masking {\n\n constructor(@Optional() private _localize?: Localize) {\n }\n\n date(format: DateMaskFormat, separator: string = '-') {\n const dateParts = this.getDateParts(format);\n const inputFormat = dateParts.join(separator);\n const outputFormat = 'yyyy-MM-dd';\n\n const escape = /[.*+?^${}()\\/|[\\]\\\\]/g;\n const escapedSeparator = separator.replace(escape, '\\\\$&');\n\n const inputFormatRegexString = dateParts\n .map(item => `(?<${item}>[0-9]{${item?.length}})`)\n .join(escapedSeparator);\n const inputFormatRegex = new RegExp(`^${inputFormatRegexString}$`);\n\n return createMask({\n alias: 'datetime',\n inputFormat: inputFormat.toLowerCase(),\n outputFormat: outputFormat.toLowerCase(),\n nullable: false,\n inputmode: 'numeric',\n onBeforeMask: (initialValue: string) => {\n return initialValue ? formatDate(initialValue, inputFormat, 'en-US') : null;\n },\n onBeforePaste: (value: string) => {\n return value;\n },\n parser: (value: string) => {\n if (!value || typeof value !== 'string' || !inputFormatRegex.test(value)) {\n return null;\n }\n const matches = value.match(inputFormatRegex);\n const year = +matches?.groups?.['yyyy'];\n const month = +matches?.groups?.['MM'] - 1;\n const day = +matches?.groups?.['dd'];\n const date = new Date(year, month, day);\n\n return date instanceof Date && !isNaN(<any>date)\n ? formatDate(date, outputFormat, 'en-US')\n : null;\n }\n });\n }\n\n currency(code: string, options?: Partial<CurrencyMaskOptions>) {\n const locale = this._localize?.current?.locale ?? 'en';\n const symbol = options?.symbol ?? getCurrencySymbol(code, options?.symbolFormat ?? 'narrow', locale);\n\n const decimal = options?.decimalCharacter ?? getLocaleNumberSymbol(locale, NumberSymbol.CurrencyDecimal);\n const group = options?.groupCharacter ?? getLocaleNumberSymbol(locale, NumberSymbol.CurrencyGroup);\n const digits = options?.digits ?? getNumberOfCurrencyDigits(code);\n const spacer = options?.spacer ?? ' ';\n\n return createMask({\n alias: 'numeric',\n inputType: 'number',\n digits: digits,\n allowMinus: options?.allowMinus ?? false,\n min: options?.min ?? 0,\n max: options?.max ?? Number.MAX_SAFE_INTEGER,\n prefix: `${symbol}${spacer}`,\n radixPoint: decimal ?? '.',\n groupSeparator: group ?? ',',\n digitsOptional: options?.digitsOptional ?? false,\n nullable: options?.nullable ?? true,\n autoUnmask: true,\n unmaskAsNumber: true,\n rightAlign: false,\n showMaskOnHover: false,\n showMaskOnFocus: false,\n inputmode: digits > 0 ? 'decimal' : 'numeric',\n parser: (value: string | number) => {\n if (value === '') {\n return null;\n }\n return value;\n }\n });\n }\n\n private getDateParts(format: DateMaskFormat) {\n switch (format) {\n case 'day-month-year':\n return ['dd', 'MM', 'yyyy'];\n case 'month-day-year':\n return ['MM', 'dd', 'yyyy'];\n case 'year-day-month':\n return ['yyyy', 'dd', 'MM'];\n case 'year-month-day':\n default:\n return ['yyyy', 'MM', 'dd'];\n }\n }\n\n}\n","import {Directive, Input, OnChanges, Self, SimpleChanges} from '@angular/core';\nimport {CurrencyMaskOptions} from '../input-mask.interface';\nimport {BbInputMask} from './input-mask.directive';\nimport {Masking} from '../masking.service';\n\n@Directive({\n selector: 'input[bbCurrencyMask]'\n})\nexport class BbCurrencyMask implements OnChanges {\n\n // Inputs.\n @Input('bbCurrencyMask') currencyCode: string | null = null;\n @Input('bbCurrencyMaskOptions') options: Partial<CurrencyMaskOptions> | null = null;\n\n constructor(private _masking: Masking,\n @Self() private _inputMask: BbInputMask) {\n }\n\n ngOnChanges(changes: SimpleChanges) {\n const currencyCode = changes?.['currencyCode']?.currentValue ?? this.currencyCode ?? 'USD';\n const options = changes?.['options']?.currentValue ?? this.options ?? {};\n\n this._inputMask.mask = this._masking.currency(currencyCode, options);\n }\n\n // Required so that the template type checker can infer the type of the coerced inputs.\n static ngAcceptInputType_bbCurrencyMask: string | null | undefined;\n static ngAcceptInputType_bbCurrencyMaskOptions: Partial<CurrencyMaskOptions> | null | undefined;\n\n}\n","import {Directive, Input, OnChanges, Self, SimpleChanges} from '@angular/core';\nimport {DateMaskFormat} from '../input-mask.interface';\nimport {BbInputMask} from './input-mask.directive';\nimport {Masking} from '../masking.service';\n\n@Directive({\n selector: 'input[bbDateMask]'\n})\nexport class BbDateMask implements OnChanges {\n\n // Inputs.\n @Input('bbDateMask') format: DateMaskFormat | null = null;\n @Input('bbDateMaskSeparator') separator: string | null = null;\n\n constructor(private _masking: Masking,\n @Self() private _inputMask: BbInputMask) {\n }\n\n ngOnChanges(changes: SimpleChanges) {\n const format = changes?.['format']?.currentValue ?? this.format ?? null;\n const separator = changes?.['separator']?.currentValue ?? this.separator ?? '-';\n this._inputMask.mask = this._masking.date(format, separator);\n }\n\n // Required so that the template type checker can infer the type of the coerced inputs.\n static ngAcceptInputType_bbDateMask: DateMaskFormat | null | undefined;\n static ngAcceptInputType_bbDateMaskSeparator: string | null | undefined;\n\n}\n","import {BbCurrencyMask} from './directives/currency-mask.directive';\nimport {BbInputMask} from './directives/input-mask.directive';\nimport {BbDateMask} from './directives/date-mask.directive';\nimport {NgModule} from '@angular/core';\n\n@NgModule({\n imports: [\n BbInputMask,\n BbCurrencyMask,\n BbDateMask\n ],\n exports: [\n BbInputMask,\n BbCurrencyMask,\n BbDateMask\n ]\n})\nexport class MaskingModule {\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1","i1.Masking","i2.BbInputMask"],"mappings":";;;;;;;;;AA0Ba,MAAA,UAAU,GAAG,CAAI,OAAqC,KAAK,OAAO,OAAO,KAAK,QAAQ,GAAG,EAAC,IAAI,EAAE,OAAO,EAAC,GAAG;;AClBxH,MAAM,oBAAoB,GAAI,UAAwD,CAAC,OAAO,IAAI,UAAU;MAK/F,WAAW,CAAA;AAoBA,IAAA,OAAA;AACA,IAAA,SAAA;AACA,IAAA,SAAA;AACA,IAAA,WAAA;AACoB,IAAA,QAAA;IAtBxC,IACI,IAAI,CAAC,IAAqD,EAAA;QAC1D,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;YACnC;;AAGJ,QAAA,IAAI,CAAC,iBAAiB,GAAG,IAAI;QAC7B,IAAI,CAAC,UAAU,EAAE;;;IAIrB,eAAe,GAA8B,IAAI;IACjD,kBAAkB,GAA4B,IAAI;IAClD,kBAAkB,GAAwB,IAAI;IAEtC,iBAAiB,GAA+B,IAAI;AACpD,IAAA,SAAS,GAA8B,OAAO,EAAE,CAAC;IAEzD,WAAoB,CAAA,OAAe,EACf,SAAmB,EACnB,SAAoB,EACpB,WAAyC,EACrB,QAAoB,EAAA;QAJxC,IAAO,CAAA,OAAA,GAAP,OAAO;QACP,IAAS,CAAA,SAAA,GAAT,SAAS;QACT,IAAS,CAAA,SAAA,GAAT,SAAS;QACT,IAAW,CAAA,WAAA,GAAX,WAAW;QACS,IAA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,IAAA,EAAA,aAAa,YAVlB,WAAW;YACX,cAAc;AACd,YAAA,UAAU,aAGV,WAAW;YACX,cAAc;YACd,UAAU,CAAA,EAAA,CAAA;yGAGL,aAAa,EAAA,CAAA;;4FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBAZzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE;wBACL,WAAW;wBACX,cAAc;wBACd;AACH,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACL,WAAW;wBACX,cAAc;wBACd;AACH;AACJ,iBAAA;;;AChBD;;AAEG;;;;"}
1
+ {"version":3,"file":"bravobit-bb-foundation-masking.mjs","sources":["../../../projects/bb-foundation/masking/src/lib/input-mask.interface.ts","../../../projects/bb-foundation/masking/src/lib/directives/input-mask.directive.ts","../../../projects/bb-foundation/masking/src/lib/masking.service.ts","../../../projects/bb-foundation/masking/src/lib/directives/currency-mask.directive.ts","../../../projects/bb-foundation/masking/src/lib/directives/date-mask.directive.ts","../../../projects/bb-foundation/masking/src/lib/masking.module.ts","../../../projects/bb-foundation/masking/src/bravobit-bb-foundation-masking.ts"],"sourcesContent":["import type Inputmask from 'inputmask';\n\nexport type InputMaskOptions<T> = Inputmask.Options & {\n parser?: (value: any) => T;\n};\n\nexport type CurrencyMaskOptions = {\n symbol: string;\n symbolFormat: 'wide' | 'narrow';\n spacer: string;\n digits: number;\n digitsOptional: boolean;\n decimalCharacter: string;\n groupCharacter: string;\n min: number;\n max: number;\n allowMinus: boolean;\n nullable: boolean;\n}\n\nexport type DateMaskFormat =\n 'day-month-year' |\n 'month-day-year' |\n 'year-month-day' |\n 'year-day-month';\n\nexport const createMask = <T>(options: string | InputMaskOptions<T>) => typeof options === 'string' ? {mask: options} : options;\n","import {Directive, ElementRef, HostListener, Input, NgZone, OnDestroy, OnInit, Optional, Renderer2, Self} from '@angular/core';\nimport {AbstractControl, ControlValueAccessor, NgControl, Validator} from '@angular/forms';\nimport {InputMaskOptions} from '../input-mask.interface';\nimport {fromEvent, merge, Subscription} from 'rxjs';\nimport {Platform} from '@angular/cdk/platform';\nimport type Inputmask from 'inputmask';\nimport _Inputmask from 'inputmask';\n\nconst InputmaskConstructor = (_Inputmask as unknown as { default?: Inputmask.Static }).default || _Inputmask;\n\n@Directive({\n selector: 'input[bbInputMask],input[bbCurrencyMask],input[bbDateMask]'\n})\nexport class BbInputMask<T = any> implements OnInit, OnDestroy, ControlValueAccessor, Validator {\n\n @Input('bbInputMask')\n set mask(mask: InputMaskOptions<T> | string | null | undefined) {\n if (!mask || typeof mask === 'string') {\n return;\n }\n\n this._inputMaskOptions = mask;\n this.updateMask();\n }\n\n // State.\n inputMaskPlugin: Inputmask.Instance | null = null;\n nativeInputElement: HTMLInputElement | null = null;\n eventsSubscription: Subscription | null = null;\n\n private _inputMaskOptions: InputMaskOptions<T> | null = null;\n private _onChange: (value: T | null) => void = () => ({});\n\n constructor(private _ngZone: NgZone,\n private _platform: Platform,\n private _renderer: Renderer2,\n private _elementRef: ElementRef<HTMLInputElement>,\n @Optional() @Self() private _control?: NgControl) {\n this.nativeInputElement = this._elementRef.nativeElement;\n if (this._control != null) {\n this._control.valueAccessor = this;\n }\n }\n\n @HostListener('input', ['$event.target.value'])\n onInput: (value: any) => void = (_: any) => ({});\n\n @HostListener('blur', ['$event.target.value'])\n onTouched: () => void = () => ({});\n\n ngOnInit() {\n const control = this._control?.control;\n if (!control) {\n return;\n }\n\n control?.setValidators(control.validator ? [control.validator, this.validate] : [this.validate]);\n control?.updateValueAndValidity();\n }\n\n ngOnDestroy() {\n this.destroyMask();\n }\n\n writeValue(value: string) {\n if (!this.nativeInputElement) {\n return;\n }\n this._renderer.setProperty(this.nativeInputElement, 'value', value ?? '');\n }\n\n registerOnChange(fn: (value: T | null) => void) {\n this._onChange = fn;\n const parser = this._inputMaskOptions?.parser;\n this.onInput = value => this._onChange(parser ? parser(value) : value);\n }\n\n registerOnTouched(fn: () => void) {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean) {\n if (!this.nativeInputElement) {\n return;\n }\n this._renderer.setProperty(this.nativeInputElement, 'disabled', isDisabled);\n }\n\n validate = (control: AbstractControl) => !control.value || !this.inputMaskPlugin || this.inputMaskPlugin?.isValid()\n ? null\n : {inputMask: true};\n\n private updateMask() {\n this.destroyMask();\n this.createMask();\n this.registerOnChange(this._onChange);\n }\n\n private createMask() {\n if (!this._platform.isBrowser || !this.nativeInputElement || this._inputMaskOptions === null || Object.keys(this._inputMaskOptions).length === 0) {\n return;\n }\n\n const {parser, ...options} = this._inputMaskOptions;\n this.inputMaskPlugin = this._ngZone.runOutsideAngular(() => new InputmaskConstructor(options).mask(this.nativeInputElement));\n\n const setValue$ = fromEvent(this.nativeInputElement, 'setvalue');\n const cleared$ = fromEvent(this.nativeInputElement, 'cleared');\n\n this.eventsSubscription = merge(setValue$, cleared$)\n .subscribe(event => this.onInput(event?.target?.['value']));\n\n const control = this._control?.control;\n if (!control) {\n return;\n }\n setTimeout(() => control?.updateValueAndValidity());\n }\n\n private destroyMask() {\n this.eventsSubscription?.unsubscribe();\n this.eventsSubscription = null;\n this.inputMaskPlugin?.remove();\n this.inputMaskPlugin = null;\n }\n\n // Required so that the template type checker can infer the type of the coerced inputs.\n static ngAcceptInputType_bbInputMask: InputMaskOptions<any> | string | null | undefined;\n\n}\n","import {formatDate, getCurrencySymbol, getLocaleNumberSymbol, getNumberOfCurrencyDigits, NumberSymbol} from '@angular/common';\nimport {createMask, CurrencyMaskOptions, DateMaskFormat} from './input-mask.interface';\nimport {Localize} from '@bravobit/bb-foundation/localize';\nimport {Injectable, Optional} from '@angular/core';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class Masking {\n\n constructor(@Optional() private _localize?: Localize) {\n }\n\n date(format: DateMaskFormat, separator: string = '-') {\n const dateParts = this.getDateParts(format);\n const inputFormat = dateParts.join(separator);\n const outputFormat = 'yyyy-MM-dd';\n\n const escape = /[.*+?^${}()\\/|[\\]\\\\]/g;\n const escapedSeparator = separator.replace(escape, '\\\\$&');\n\n const inputFormatRegexString = dateParts\n .map(item => `(?<${item}>[0-9]{${item?.length}})`)\n .join(escapedSeparator);\n const inputFormatRegex = new RegExp(`^${inputFormatRegexString}$`);\n\n return createMask({\n alias: 'datetime',\n inputFormat: inputFormat.toLowerCase(),\n outputFormat: outputFormat.toLowerCase(),\n nullable: false,\n inputmode: 'numeric',\n onBeforeMask: (initialValue: string) => {\n return initialValue ? formatDate(initialValue, inputFormat, 'en-US') : null;\n },\n onBeforePaste: (value: string) => {\n return value;\n },\n parser: (value: string) => {\n if (!value || typeof value !== 'string' || !inputFormatRegex.test(value)) {\n return null;\n }\n const matches = value.match(inputFormatRegex);\n const year = +matches?.groups?.['yyyy'];\n const month = +matches?.groups?.['MM'] - 1;\n const day = +matches?.groups?.['dd'];\n const date = new Date(year, month, day);\n\n return date instanceof Date && !isNaN(<any>date)\n ? formatDate(date, outputFormat, 'en-US')\n : null;\n }\n });\n }\n\n currency(code: string, options?: Partial<CurrencyMaskOptions>) {\n const locale = this._localize?.current?.locale ?? 'en';\n const symbol = options?.symbol ?? getCurrencySymbol(code, options?.symbolFormat ?? 'narrow', locale);\n\n const decimal = options?.decimalCharacter ?? getLocaleNumberSymbol(locale, NumberSymbol.CurrencyDecimal);\n const group = options?.groupCharacter ?? getLocaleNumberSymbol(locale, NumberSymbol.CurrencyGroup);\n const digits = options?.digits ?? getNumberOfCurrencyDigits(code);\n const spacer = options?.spacer ?? ' ';\n\n return createMask({\n alias: 'numeric',\n inputType: 'number',\n digits: digits,\n allowMinus: options?.allowMinus ?? false,\n min: options?.min ?? 0,\n max: options?.max ?? Number.MAX_SAFE_INTEGER,\n prefix: `${symbol}${spacer}`,\n radixPoint: decimal ?? '.',\n groupSeparator: group ?? ',',\n digitsOptional: options?.digitsOptional ?? false,\n nullable: options?.nullable ?? true,\n autoUnmask: true,\n unmaskAsNumber: true,\n rightAlign: false,\n showMaskOnHover: false,\n showMaskOnFocus: false,\n inputmode: digits > 0 ? 'decimal' : 'numeric',\n parser: (value: string | number) => {\n if (value === '') {\n return null;\n }\n return value;\n }\n });\n }\n\n private getDateParts(format: DateMaskFormat) {\n switch (format) {\n case 'day-month-year':\n return ['dd', 'MM', 'yyyy'];\n case 'month-day-year':\n return ['MM', 'dd', 'yyyy'];\n case 'year-day-month':\n return ['yyyy', 'dd', 'MM'];\n case 'year-month-day':\n default:\n return ['yyyy', 'MM', 'dd'];\n }\n }\n\n}\n","import {Directive, Input, OnChanges, Self, SimpleChanges} from '@angular/core';\nimport {CurrencyMaskOptions} from '../input-mask.interface';\nimport {BbInputMask} from './input-mask.directive';\nimport {Masking} from '../masking.service';\n\n@Directive({\n selector: 'input[bbCurrencyMask]'\n})\nexport class BbCurrencyMask implements OnChanges {\n\n // Inputs.\n @Input('bbCurrencyMask') currencyCode: string | null = null;\n @Input('bbCurrencyMaskOptions') options: Partial<CurrencyMaskOptions> | null = null;\n\n constructor(private _masking: Masking,\n @Self() private _inputMask: BbInputMask) {\n }\n\n ngOnChanges(changes: SimpleChanges) {\n const currencyCode = changes?.['currencyCode']?.currentValue ?? this.currencyCode ?? 'USD';\n const options = changes?.['options']?.currentValue ?? this.options ?? {};\n\n this._inputMask.mask = this._masking.currency(currencyCode, options);\n }\n\n // Required so that the template type checker can infer the type of the coerced inputs.\n static ngAcceptInputType_bbCurrencyMask: string | null | undefined;\n static ngAcceptInputType_bbCurrencyMaskOptions: Partial<CurrencyMaskOptions> | null | undefined;\n\n}\n","import {Directive, Input, OnChanges, Self, SimpleChanges} from '@angular/core';\nimport {DateMaskFormat} from '../input-mask.interface';\nimport {BbInputMask} from './input-mask.directive';\nimport {Masking} from '../masking.service';\n\n@Directive({\n selector: 'input[bbDateMask]'\n})\nexport class BbDateMask implements OnChanges {\n\n // Inputs.\n @Input('bbDateMask') format: DateMaskFormat | null = null;\n @Input('bbDateMaskSeparator') separator: string | null = null;\n\n constructor(private _masking: Masking,\n @Self() private _inputMask: BbInputMask) {\n }\n\n ngOnChanges(changes: SimpleChanges) {\n const format = changes?.['format']?.currentValue ?? this.format ?? null;\n const separator = changes?.['separator']?.currentValue ?? this.separator ?? '-';\n this._inputMask.mask = this._masking.date(format, separator);\n }\n\n // Required so that the template type checker can infer the type of the coerced inputs.\n static ngAcceptInputType_bbDateMask: DateMaskFormat | null | undefined;\n static ngAcceptInputType_bbDateMaskSeparator: string | null | undefined;\n\n}\n","import {BbCurrencyMask} from './directives/currency-mask.directive';\nimport {BbInputMask} from './directives/input-mask.directive';\nimport {BbDateMask} from './directives/date-mask.directive';\nimport {NgModule} from '@angular/core';\n\n@NgModule({\n imports: [\n BbInputMask,\n BbCurrencyMask,\n BbDateMask\n ],\n exports: [\n BbInputMask,\n BbCurrencyMask,\n BbDateMask\n ]\n})\nexport class MaskingModule {\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1","i1.Masking","i2.BbInputMask"],"mappings":";;;;;;;;;AA0Ba,MAAA,UAAU,GAAG,CAAI,OAAqC,KAAK,OAAO,OAAO,KAAK,QAAQ,GAAG,EAAC,IAAI,EAAE,OAAO,EAAC,GAAG;;AClBxH,MAAM,oBAAoB,GAAI,UAAwD,CAAC,OAAO,IAAI,UAAU;MAK/F,WAAW,CAAA;AAoBA,IAAA,OAAA;AACA,IAAA,SAAA;AACA,IAAA,SAAA;AACA,IAAA,WAAA;AACoB,IAAA,QAAA;IAtBxC,IACI,IAAI,CAAC,IAAqD,EAAA;QAC1D,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;YACnC;;AAGJ,QAAA,IAAI,CAAC,iBAAiB,GAAG,IAAI;QAC7B,IAAI,CAAC,UAAU,EAAE;;;IAIrB,eAAe,GAA8B,IAAI;IACjD,kBAAkB,GAA4B,IAAI;IAClD,kBAAkB,GAAwB,IAAI;IAEtC,iBAAiB,GAA+B,IAAI;AACpD,IAAA,SAAS,GAA8B,OAAO,EAAE,CAAC;IAEzD,WAAoB,CAA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EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAAb,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,YAVlB,WAAW;YACX,cAAc;AACd,YAAA,UAAU,aAGV,WAAW;YACX,cAAc;YACd,UAAU,CAAA,EAAA,CAAA;wGAGL,aAAa,EAAA,CAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBAZzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE;wBACL,WAAW;wBACX,cAAc;wBACd;AACH,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACL,WAAW;wBACX,cAAc;wBACd;AACH;AACJ,iBAAA;;;AChBD;;AAEG;;;;"}
@@ -1,11 +1,11 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, NgZone, ChangeDetectorRef, HostBinding, ViewChild, Input, ViewEncapsulation, ChangeDetectionStrategy, Component, ApplicationRef, EnvironmentInjector, createEnvironmentInjector, createComponent, Injectable, makeEnvironmentProviders, NgModule } from '@angular/core';
2
+ import { InjectionToken, inject, NgZone, ChangeDetectorRef, HostBinding, ViewChild, Input, ViewEncapsulation, ChangeDetectionStrategy, Component, ApplicationRef, EnvironmentInjector, DOCUMENT, createEnvironmentInjector, createComponent, Injectable, makeEnvironmentProviders, NgModule } from '@angular/core';
3
3
  import { BbLocalize, Localize } from '@bravobit/bb-foundation/localize';
4
4
  import { BbTemplate } from '@bravobit/bb-foundation/utils';
5
5
  import { Platform } from '@angular/cdk/platform';
6
6
  import { WINDOW } from '@bravobit/bb-foundation';
7
7
  import { trigger, transition, query, style, animate } from '@angular/animations';
8
- import { AsyncPipe, DOCUMENT } from '@angular/common';
8
+ import { AsyncPipe } from '@angular/common';
9
9
  import { map } from 'rxjs/operators';
10
10
  import { BehaviorSubject } from 'rxjs';
11
11
 
@@ -100,10 +100,10 @@ class BbNotificationsItem {
100
100
  }
101
101
  return this._window.setTimeout(method, timeout);
102
102
  }
103
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: BbNotificationsItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
104
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.11", type: BbNotificationsItem, isStandalone: true, selector: "bb-notifications-item", inputs: { notification: "notification" }, host: { attributes: { "role": "alert" }, properties: { "class": "this.getClass" } }, viewQueries: [{ propertyName: "progressElementRef", first: true, predicate: ["progress"], descendants: true }], ngImport: i0, template: "<div class=\"notification-content-wrapper\">\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 20\"\n class=\"notification-icon\">\n <path\n d=\"M8 20c1.1 0 2-.923 2-2.051H6C6 19.077 6.9 20 8 20Zm6-6.154V8.718c0-3.18-1.6-5.744-4.5-6.462v-.718C9.5.718 8.8 0 8 0S6.5.718 6.5 1.538v.718C3.6 2.974 2 5.538 2 8.718v5.128l-2 2.051v1.026h16v-1.026l-2-2.05Z\">\n </path>\n </svg>\n\n @if (notification?.timeout > 0) {\n <svg 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 }\n </div>\n\n <div class=\"notification-content\">\n <ng-template [bbTemplate]=\"notification?.content\">\n @if (notification?.localize) {\n {{ $any(notification?.content) | bbLocalize }}\n } @else {\n {{ notification?.content }}\n }\n </ng-template>\n </div>\n</div>\n\n@if (notification?.actions?.length > 0 || notification?.dismiss) {\n <div class=\"notification-actions\">\n @for (action of notification?.actions; track $index) {\n <button [class.destructive]=\"action?.type === 'cancel'\"\n (click)=\"callActionAndDestroy(notification, action)\"\n type=\"button\"\n class=\"notification-actions-button\">\n <span class=\"notification-actions-button-highlight\">\n @if (notification?.localize) {\n {{ action?.title | bbLocalize }}\n } @else {\n {{ action?.title }}\n }\n </span>\n </button>\n }\n @if (notification?.dismiss) {\n <button (click)=\"notification?.destroy()\"\n class=\"notification-actions-button destructive\"\n type=\"button\">\n <span\n class=\"notification-actions-button-highlight\">{{ notification?.dismissText ?? dismissText }}</span>\n </button>\n }\n </div>\n}\n", styles: [".bb-notifications-item{top:0;left:0;width:100%;display:flex;position:absolute;pointer-events:all;border-radius:.5rem;flex-direction:column;background-color:#fff;box-shadow:0 .375rem .375rem -.375rem #00000026;border:1px solid rgb(214.3982142857,218.6677857143,224.1017857143);transition:margin-top .2s cubic-bezier(0,0,.2,1),transform .2s cubic-bezier(0,0,.2,1)}.bb-notifications-item.success .notification-icon-wrapper{color:#2dc05d;background-color:#ebfaf0}.bb-notifications-item.success .notification-progress-circle{stroke:#36d068}.bb-notifications-item.error .notification-icon-wrapper{color:#f43e3e;background-color:#feeeee}.bb-notifications-item.error .notification-progress-circle{stroke:#f55656}.bb-notifications-item.warning .notification-icon-wrapper{color:#f1ae00;background-color:#fff8e7}.bb-notifications-item.warning .notification-progress-circle{stroke:#ffbc0b}.bb-notifications-item.info .notification-icon-wrapper{color:#099bf6;background-color:#e9f6fe}.bb-notifications-item.info .notification-progress-circle{stroke:#22a5f7}.bb-notifications-item.custom .notification-icon-wrapper{color:#657385;background-color:#f3f5f6}.bb-notifications-item.custom .notification-progress-circle{stroke:#657385}.notification-content-wrapper{gap:.75rem;display:flex;padding:.75rem;align-items:center}.notification-icon-wrapper{width:2rem;height:2rem;display:flex;-webkit-user-select:none;user-select:none;position:relative;border-radius:50%;align-items:center;justify-content:center;color:#657385;background-color:#f3f5f6}.notification-icon{width:100%;height:100%;padding:.5rem;fill:currentColor}.notification-content{flex:1;font-weight:400;line-height:1.8;font-size:.875rem;color:#121212}.notification-content,.notification-actions-button{font-family:inherit}.notification-actions{display:flex;margin:0 1.5rem;-webkit-user-select:none;user-select:none;border-top:1px solid rgb(243.3589285714,244.5830714286,246.1410714286)}.notification-actions-button{flex:1;border:none;color:#22a5f7;cursor:pointer;font-weight:500;text-align:center;font-size:.875rem;padding:.75rem .125rem;background-color:transparent}.notification-actions-button:hover>.notification-actions-button-highlight,.notification-actions-button:focus>.notification-actions-button-highlight{background-color:#22a5f71a}.notification-actions-button:active>.notification-actions-button-highlight{background-color:#22a5f733}.notification-actions-button.destructive{color:#f55656}.notification-actions-button.destructive:hover>.notification-actions-button-highlight,.notification-actions-button.destructive:focus>.notification-actions-button-highlight{background-color:#f556561a}.notification-actions-button.destructive:active>.notification-actions-button-highlight{background-color:#f5565633}.notification-actions-button-highlight{display:inline-flex;border-radius:.75rem;padding:.25rem .75rem;transition:background-color .2s cubic-bezier(0,0,.2,1)}.notification-progress-ring{inset:0;width:100%;height:100%;position:absolute}.notification-progress-circle{transform:rotate(-90deg);transform-origin:50% 50%;stroke:#657385}\n"], dependencies: [{ kind: "pipe", type: BbLocalize, name: "bbLocalize" }, { kind: "directive", type: BbTemplate, selector: "[bbTemplate]", inputs: ["bbTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
103
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: BbNotificationsItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
104
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.3", type: BbNotificationsItem, isStandalone: true, selector: "bb-notifications-item", inputs: { notification: "notification" }, host: { attributes: { "role": "alert" }, properties: { "class": "this.getClass" } }, viewQueries: [{ propertyName: "progressElementRef", first: true, predicate: ["progress"], descendants: true }], ngImport: i0, template: "<div class=\"notification-content-wrapper\">\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 20\"\n class=\"notification-icon\">\n <path\n d=\"M8 20c1.1 0 2-.923 2-2.051H6C6 19.077 6.9 20 8 20Zm6-6.154V8.718c0-3.18-1.6-5.744-4.5-6.462v-.718C9.5.718 8.8 0 8 0S6.5.718 6.5 1.538v.718C3.6 2.974 2 5.538 2 8.718v5.128l-2 2.051v1.026h16v-1.026l-2-2.05Z\">\n </path>\n </svg>\n\n @if (notification?.timeout > 0) {\n <svg 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 }\n </div>\n\n <div class=\"notification-content\">\n <ng-template [bbTemplate]=\"notification?.content\">\n @if (notification?.localize) {\n {{ $any(notification?.content) | bbLocalize }}\n } @else {\n {{ notification?.content }}\n }\n </ng-template>\n </div>\n</div>\n\n@if (notification?.actions?.length > 0 || notification?.dismiss) {\n <div class=\"notification-actions\">\n @for (action of notification?.actions; track $index) {\n <button [class.destructive]=\"action?.type === 'cancel'\"\n (click)=\"callActionAndDestroy(notification, action)\"\n type=\"button\"\n class=\"notification-actions-button\">\n <span class=\"notification-actions-button-highlight\">\n @if (notification?.localize) {\n {{ action?.title | bbLocalize }}\n } @else {\n {{ action?.title }}\n }\n </span>\n </button>\n }\n @if (notification?.dismiss) {\n <button (click)=\"notification?.destroy()\"\n class=\"notification-actions-button destructive\"\n type=\"button\">\n <span\n class=\"notification-actions-button-highlight\">{{ notification?.dismissText ?? dismissText }}</span>\n </button>\n }\n </div>\n}\n", styles: [".bb-notifications-item{top:0;left:0;width:100%;display:flex;position:absolute;pointer-events:all;border-radius:.5rem;flex-direction:column;background-color:#fff;box-shadow:0 .375rem .375rem -.375rem #00000026;border:1px solid rgb(214.3982142857,218.6677857143,224.1017857143);transition:margin-top .2s cubic-bezier(0,0,.2,1),transform .2s cubic-bezier(0,0,.2,1)}.bb-notifications-item.success .notification-icon-wrapper{color:#2dc05d;background-color:#ebfaf0}.bb-notifications-item.success .notification-progress-circle{stroke:#36d068}.bb-notifications-item.error .notification-icon-wrapper{color:#f43e3e;background-color:#feeeee}.bb-notifications-item.error .notification-progress-circle{stroke:#f55656}.bb-notifications-item.warning .notification-icon-wrapper{color:#f1ae00;background-color:#fff8e7}.bb-notifications-item.warning .notification-progress-circle{stroke:#ffbc0b}.bb-notifications-item.info .notification-icon-wrapper{color:#099bf6;background-color:#e9f6fe}.bb-notifications-item.info .notification-progress-circle{stroke:#22a5f7}.bb-notifications-item.custom .notification-icon-wrapper{color:#657385;background-color:#f3f5f6}.bb-notifications-item.custom .notification-progress-circle{stroke:#657385}.notification-content-wrapper{gap:.75rem;display:flex;padding:.75rem;align-items:center}.notification-icon-wrapper{width:2rem;height:2rem;display:flex;-webkit-user-select:none;user-select:none;position:relative;border-radius:50%;align-items:center;justify-content:center;color:#657385;background-color:#f3f5f6}.notification-icon{width:100%;height:100%;padding:.5rem;fill:currentColor}.notification-content{flex:1;font-weight:400;line-height:1.8;font-size:.875rem;color:#121212}.notification-content,.notification-actions-button{font-family:inherit}.notification-actions{display:flex;margin:0 1.5rem;-webkit-user-select:none;user-select:none;border-top:1px solid rgb(243.3589285714,244.5830714286,246.1410714286)}.notification-actions-button{flex:1;border:none;color:#22a5f7;cursor:pointer;font-weight:500;text-align:center;font-size:.875rem;padding:.75rem .125rem;background-color:transparent}.notification-actions-button:hover>.notification-actions-button-highlight,.notification-actions-button:focus>.notification-actions-button-highlight{background-color:#22a5f71a}.notification-actions-button:active>.notification-actions-button-highlight{background-color:#22a5f733}.notification-actions-button.destructive{color:#f55656}.notification-actions-button.destructive:hover>.notification-actions-button-highlight,.notification-actions-button.destructive:focus>.notification-actions-button-highlight{background-color:#f556561a}.notification-actions-button.destructive:active>.notification-actions-button-highlight{background-color:#f5565633}.notification-actions-button-highlight{display:inline-flex;border-radius:.75rem;padding:.25rem .75rem;transition:background-color .2s cubic-bezier(0,0,.2,1)}.notification-progress-ring{inset:0;width:100%;height:100%;position:absolute}.notification-progress-circle{transform:rotate(-90deg);transform-origin:50% 50%;stroke:#657385}\n"], dependencies: [{ kind: "pipe", type: BbLocalize, name: "bbLocalize" }, { kind: "directive", type: BbTemplate, selector: "[bbTemplate]", inputs: ["bbTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
105
105
  }
106
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: BbNotificationsItem, decorators: [{
106
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: BbNotificationsItem, decorators: [{
107
107
  type: Component,
108
108
  args: [{ selector: 'bb-notifications-item', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: { 'role': 'alert' }, imports: [BbLocalize, BbTemplate], template: "<div class=\"notification-content-wrapper\">\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 20\"\n class=\"notification-icon\">\n <path\n d=\"M8 20c1.1 0 2-.923 2-2.051H6C6 19.077 6.9 20 8 20Zm6-6.154V8.718c0-3.18-1.6-5.744-4.5-6.462v-.718C9.5.718 8.8 0 8 0S6.5.718 6.5 1.538v.718C3.6 2.974 2 5.538 2 8.718v5.128l-2 2.051v1.026h16v-1.026l-2-2.05Z\">\n </path>\n </svg>\n\n @if (notification?.timeout > 0) {\n <svg 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 }\n </div>\n\n <div class=\"notification-content\">\n <ng-template [bbTemplate]=\"notification?.content\">\n @if (notification?.localize) {\n {{ $any(notification?.content) | bbLocalize }}\n } @else {\n {{ notification?.content }}\n }\n </ng-template>\n </div>\n</div>\n\n@if (notification?.actions?.length > 0 || notification?.dismiss) {\n <div class=\"notification-actions\">\n @for (action of notification?.actions; track $index) {\n <button [class.destructive]=\"action?.type === 'cancel'\"\n (click)=\"callActionAndDestroy(notification, action)\"\n type=\"button\"\n class=\"notification-actions-button\">\n <span class=\"notification-actions-button-highlight\">\n @if (notification?.localize) {\n {{ action?.title | bbLocalize }}\n } @else {\n {{ action?.title }}\n }\n </span>\n </button>\n }\n @if (notification?.dismiss) {\n <button (click)=\"notification?.destroy()\"\n class=\"notification-actions-button destructive\"\n type=\"button\">\n <span\n class=\"notification-actions-button-highlight\">{{ notification?.dismissText ?? dismissText }}</span>\n </button>\n }\n </div>\n}\n", styles: [".bb-notifications-item{top:0;left:0;width:100%;display:flex;position:absolute;pointer-events:all;border-radius:.5rem;flex-direction:column;background-color:#fff;box-shadow:0 .375rem .375rem -.375rem #00000026;border:1px solid rgb(214.3982142857,218.6677857143,224.1017857143);transition:margin-top .2s cubic-bezier(0,0,.2,1),transform .2s cubic-bezier(0,0,.2,1)}.bb-notifications-item.success .notification-icon-wrapper{color:#2dc05d;background-color:#ebfaf0}.bb-notifications-item.success .notification-progress-circle{stroke:#36d068}.bb-notifications-item.error .notification-icon-wrapper{color:#f43e3e;background-color:#feeeee}.bb-notifications-item.error .notification-progress-circle{stroke:#f55656}.bb-notifications-item.warning .notification-icon-wrapper{color:#f1ae00;background-color:#fff8e7}.bb-notifications-item.warning .notification-progress-circle{stroke:#ffbc0b}.bb-notifications-item.info .notification-icon-wrapper{color:#099bf6;background-color:#e9f6fe}.bb-notifications-item.info .notification-progress-circle{stroke:#22a5f7}.bb-notifications-item.custom .notification-icon-wrapper{color:#657385;background-color:#f3f5f6}.bb-notifications-item.custom .notification-progress-circle{stroke:#657385}.notification-content-wrapper{gap:.75rem;display:flex;padding:.75rem;align-items:center}.notification-icon-wrapper{width:2rem;height:2rem;display:flex;-webkit-user-select:none;user-select:none;position:relative;border-radius:50%;align-items:center;justify-content:center;color:#657385;background-color:#f3f5f6}.notification-icon{width:100%;height:100%;padding:.5rem;fill:currentColor}.notification-content{flex:1;font-weight:400;line-height:1.8;font-size:.875rem;color:#121212}.notification-content,.notification-actions-button{font-family:inherit}.notification-actions{display:flex;margin:0 1.5rem;-webkit-user-select:none;user-select:none;border-top:1px solid rgb(243.3589285714,244.5830714286,246.1410714286)}.notification-actions-button{flex:1;border:none;color:#22a5f7;cursor:pointer;font-weight:500;text-align:center;font-size:.875rem;padding:.75rem .125rem;background-color:transparent}.notification-actions-button:hover>.notification-actions-button-highlight,.notification-actions-button:focus>.notification-actions-button-highlight{background-color:#22a5f71a}.notification-actions-button:active>.notification-actions-button-highlight{background-color:#22a5f733}.notification-actions-button.destructive{color:#f55656}.notification-actions-button.destructive:hover>.notification-actions-button-highlight,.notification-actions-button.destructive:focus>.notification-actions-button-highlight{background-color:#f556561a}.notification-actions-button.destructive:active>.notification-actions-button-highlight{background-color:#f5565633}.notification-actions-button-highlight{display:inline-flex;border-radius:.75rem;padding:.25rem .75rem;transition:background-color .2s cubic-bezier(0,0,.2,1)}.notification-progress-ring{inset:0;width:100%;height:100%;position:absolute}.notification-progress-circle{transform:rotate(-90deg);transform-origin:50% 50%;stroke:#657385}\n"] }]
109
109
  }], propDecorators: { notification: [{
@@ -150,10 +150,10 @@ class BbNotificationsList {
150
150
  });
151
151
  }));
152
152
  }
153
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: BbNotificationsList, deps: [], target: i0.ɵɵFactoryTarget.Component });
154
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.11", type: BbNotificationsList, isStandalone: true, selector: "bb-notifications-list", host: { attributes: { "role": "list" }, classAttribute: "bb-notifications-list" }, ngImport: i0, template: "@if (data$ | async; as data) {\n <div [@notificationListAnimation]=\"data?.length\"\n class=\"notifications-list-wrapper\">\n @for (item of data; track item?.notification?.id) {\n <bb-notifications-item [notification]=\"item?.notification\"\n [style.z-index]=\"item?.notification?.id\"\n [style.margin-top.rem]=\"item?.styles?.offset\"\n [style.transform]=\"item?.styles?.scale\">\n </bb-notifications-item>\n }\n </div>\n}\n", styles: [".bb-notifications-list{inset:0;z-index:1100;display:flex;position:fixed;padding:.75rem;pointer-events:none;align-items:flex-start;justify-content:flex-end}.notifications-list-wrapper{width:100%;gap:.75rem;display:flex;max-width:24rem;position:relative;flex-direction:column}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: BbNotificationsItem, selector: "bb-notifications-item", inputs: ["notification"] }], animations: [notificationListAnimation], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
153
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: BbNotificationsList, deps: [], target: i0.ɵɵFactoryTarget.Component });
154
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.3", type: BbNotificationsList, isStandalone: true, selector: "bb-notifications-list", host: { attributes: { "role": "list" }, classAttribute: "bb-notifications-list" }, ngImport: i0, template: "@if (data$ | async; as data) {\n <div [@notificationListAnimation]=\"data?.length\"\n class=\"notifications-list-wrapper\">\n @for (item of data; track item?.notification?.id) {\n <bb-notifications-item [notification]=\"item?.notification\"\n [style.z-index]=\"item?.notification?.id\"\n [style.margin-top.rem]=\"item?.styles?.offset\"\n [style.transform]=\"item?.styles?.scale\">\n </bb-notifications-item>\n }\n </div>\n}\n", styles: [".bb-notifications-list{inset:0;z-index:1100;display:flex;position:fixed;padding:.75rem;pointer-events:none;align-items:flex-start;justify-content:flex-end}.notifications-list-wrapper{width:100%;gap:.75rem;display:flex;max-width:24rem;position:relative;flex-direction:column}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: BbNotificationsItem, selector: "bb-notifications-item", inputs: ["notification"] }], animations: [notificationListAnimation], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
155
155
  }
156
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: BbNotificationsList, decorators: [{
156
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: BbNotificationsList, decorators: [{
157
157
  type: Component,
158
158
  args: [{ selector: 'bb-notifications-list', animations: [notificationListAnimation], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
159
159
  'class': 'bb-notifications-list',
@@ -259,10 +259,10 @@ class Notifications {
259
259
  // Don't do anything, because it must've failed.
260
260
  }
261
261
  }
262
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: Notifications, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
263
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: Notifications, providedIn: 'root' });
262
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: Notifications, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
263
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: Notifications, providedIn: 'root' });
264
264
  }
265
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: Notifications, decorators: [{
265
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: Notifications, decorators: [{
266
266
  type: Injectable,
267
267
  args: [{
268
268
  providedIn: 'root'
@@ -284,11 +284,11 @@ class NotificationsModule {
284
284
  ]
285
285
  };
286
286
  }
287
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NotificationsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
288
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.11", ngImport: i0, type: NotificationsModule });
289
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NotificationsModule });
287
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: NotificationsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
288
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.3", ngImport: i0, type: NotificationsModule });
289
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: NotificationsModule });
290
290
  }
291
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NotificationsModule, decorators: [{
291
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: NotificationsModule, decorators: [{
292
292
  type: NgModule
293
293
  }] });
294
294
 
@@ -1 +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-item/notifications-item.component.ts","../../../projects/bb-foundation/notifications/src/lib/notifications-item/notifications-item.component.html","../../../projects/bb-foundation/notifications/src/lib/notifications.animations.ts","../../../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.service.ts","../../../projects/bb-foundation/notifications/src/lib/notifications.config.ts","../../../projects/bb-foundation/notifications/src/lib/notifications.module.ts","../../../projects/bb-foundation/notifications/src/bravobit-bb-foundation-notifications.ts"],"sourcesContent":["import {InjectionToken, TemplateRef} from '@angular/core';\nimport {Observable} from 'rxjs';\n\nexport interface Notification {\n content: string | TemplateRef<any>;\n type: NotificationType;\n\n id?: number;\n\n timeout?: number;\n localize?: boolean;\n dismiss?: boolean;\n dismissText?: string;\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 timeout?: number;\n dismiss?: boolean;\n localize?: boolean;\n dismissText?: string;\n}\n\nexport const NOTIFICATIONS_DATA: InjectionToken<Observable<Notification[]>> = new InjectionToken('notifications data');\n\nexport const NOTIFICATIONS_CONFIG: InjectionToken<NotificationsConfig> = new InjectionToken('notifications config');\n","import {ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, HostBinding, inject, Input, NgZone, OnDestroy, OnInit, ViewChild, ViewEncapsulation} from '@angular/core';\nimport {Notification, NotificationAction, NotificationsConfig} from '../notifications.interfaces';\nimport {BbLocalize} from '@bravobit/bb-foundation/localize';\nimport {BbTemplate} from '@bravobit/bb-foundation/utils';\nimport {Platform} from '@angular/cdk/platform';\nimport {WINDOW} 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 host: {'role': 'alert'},\n imports: [BbLocalize, BbTemplate]\n})\nexport class BbNotificationsItem implements OnInit, OnDestroy {\n\n // Dependencies.\n private readonly _zone: NgZone = inject(NgZone);\n private readonly _platform: Platform = inject(Platform);\n private readonly _changeDetection: ChangeDetectorRef = inject(ChangeDetectorRef);\n\n // Dependencies.\n private readonly _config?: NotificationsConfig = inject(NotificationsConfig, {optional: true});\n private readonly _window?: Window = inject(WINDOW, {optional: true});\n\n // Readonly data.\n readonly dismissText: string = this._config?.dismissText ?? null;\n\n // Inputs.\n @Input() notification: Notification | null = null;\n\n // Elements.\n @ViewChild('progress', {static: false}) progressElementRef: ElementRef<SVGCircleElement>;\n\n // Data.\n private _progress: number = 0;\n private _count: number = 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')\n get getClass() {\n return `bb-notifications-item ${this.notification.type}`;\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 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 this._timer && this._window?.clearTimeout?.(this._timer);\n }\n\n callActionAndDestroy(notification: Notification, action: NotificationAction) {\n action?.callback?.();\n notification?.destroy?.();\n }\n\n private startTimeout() {\n this._steps = this.notification.timeout / 10;\n this._speed = this.notification.timeout / this._steps;\n this._startTime = Date.now();\n this._zone.runOutsideAngular(() => this._timer = this.setTimeout(this.instance, this._speed));\n }\n\n private instance = () => {\n this._difference = (Date.now() - this._startTime) - (this._count * this._speed);\n\n if (this._count++ === this._steps) {\n this.notification.destroy();\n }\n\n this._progress += 100 / this._steps;\n this._timer = this.setTimeout(this.instance, this._speed - this._difference);\n this._zone.run(() => this._changeDetection.detectChanges());\n };\n\n private setTimeout(method: () => void, timeout: number) {\n if (!this._window || !this._window.setTimeout) {\n return null;\n }\n\n return this._window.setTimeout(method, timeout);\n }\n\n}\n","<div class=\"notification-content-wrapper\">\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 20\"\n class=\"notification-icon\">\n <path\n d=\"M8 20c1.1 0 2-.923 2-2.051H6C6 19.077 6.9 20 8 20Zm6-6.154V8.718c0-3.18-1.6-5.744-4.5-6.462v-.718C9.5.718 8.8 0 8 0S6.5.718 6.5 1.538v.718C3.6 2.974 2 5.538 2 8.718v5.128l-2 2.051v1.026h16v-1.026l-2-2.05Z\">\n </path>\n </svg>\n\n @if (notification?.timeout > 0) {\n <svg 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 }\n </div>\n\n <div class=\"notification-content\">\n <ng-template [bbTemplate]=\"notification?.content\">\n @if (notification?.localize) {\n {{ $any(notification?.content) | bbLocalize }}\n } @else {\n {{ notification?.content }}\n }\n </ng-template>\n </div>\n</div>\n\n@if (notification?.actions?.length > 0 || notification?.dismiss) {\n <div class=\"notification-actions\">\n @for (action of notification?.actions; track $index) {\n <button [class.destructive]=\"action?.type === 'cancel'\"\n (click)=\"callActionAndDestroy(notification, action)\"\n type=\"button\"\n class=\"notification-actions-button\">\n <span class=\"notification-actions-button-highlight\">\n @if (notification?.localize) {\n {{ action?.title | bbLocalize }}\n } @else {\n {{ action?.title }}\n }\n </span>\n </button>\n }\n @if (notification?.dismiss) {\n <button (click)=\"notification?.destroy()\"\n class=\"notification-actions-button destructive\"\n type=\"button\">\n <span\n class=\"notification-actions-button-highlight\">{{ notification?.dismissText ?? dismissText }}</span>\n </button>\n }\n </div>\n}\n","import {animate, query, style, transition, trigger} from '@angular/animations';\n\nexport const notificationListAnimation = trigger('notificationListAnimation', [\n transition('* => *', [\n query(':enter', [\n style({opacity: 0, transform: 'translateY(-1rem)'}),\n animate('250ms cubic-bezier(0, 0, 0.2, 1)', style({opacity: 1, transform: 'none'}))\n ], {optional: true}),\n\n query(':leave', [\n animate('250ms cubic-bezier(0, 0, .2, 1)', style({opacity: 0}))\n ], {optional: true})\n ])\n]);\n","import {ChangeDetectionStrategy, Component, inject, OnInit, ViewEncapsulation} from '@angular/core';\nimport {BbNotificationsItem} from '../notifications-item/notifications-item.component';\nimport {Notification, NOTIFICATIONS_DATA} from '../notifications.interfaces';\nimport {notificationListAnimation} from '../notifications.animations';\nimport {AsyncPipe} from '@angular/common';\nimport {map} from 'rxjs/operators';\nimport {Observable} from 'rxjs';\n\n@Component({\n selector: 'bb-notifications-list',\n templateUrl: './notifications-list.component.html',\n styleUrls: ['./notifications-list.component.scss'],\n animations: [notificationListAnimation],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n 'class': 'bb-notifications-list',\n 'role': 'list'\n },\n imports: [AsyncPipe, BbNotificationsItem]\n})\nexport class BbNotificationsList implements OnInit {\n\n // Dependencies.\n private readonly _data$: Observable<Notification[]> = inject(NOTIFICATIONS_DATA);\n\n // Data.\n data$: Observable<{\n notification?: Notification,\n styles?: { offset?: number, scale?: string }\n }[]>;\n\n ngOnInit() {\n this.setData();\n }\n\n private setData() {\n this.data$ = this._data$.pipe(\n map(notifications => {\n return notifications.map((notification, index) => {\n const scale = Math.max(0.9, 1 - (index * 0.02));\n return {\n notification,\n styles: {\n offset: Math.min(index, 5),\n scale: `scale(${scale})`\n }\n };\n });\n })\n );\n }\n\n}\n","@if (data$ | async; as data) {\n <div [@notificationListAnimation]=\"data?.length\"\n class=\"notifications-list-wrapper\">\n @for (item of data; track item?.notification?.id) {\n <bb-notifications-item [notification]=\"item?.notification\"\n [style.z-index]=\"item?.notification?.id\"\n [style.margin-top.rem]=\"item?.styles?.offset\"\n [style.transform]=\"item?.styles?.scale\">\n </bb-notifications-item>\n }\n </div>\n}\n","import {ApplicationRef, ComponentRef, createComponent, createEnvironmentInjector, EnvironmentInjector, inject, Injectable, TemplateRef} from '@angular/core';\nimport {Notification, NotificationAction, NOTIFICATIONS_CONFIG, NOTIFICATIONS_DATA, NotificationsConfig, NotificationType} from './notifications.interfaces';\nimport {BbNotificationsList} from './notifications-list/notifications-list.component';\nimport {Localize} from '@bravobit/bb-foundation/localize';\nimport {Platform} from '@angular/cdk/platform';\nimport {DOCUMENT} from '@angular/common';\nimport {BehaviorSubject} from 'rxjs';\n\nlet nextUniqueId = 0;\n\n@Injectable({\n providedIn: 'root'\n})\nexport class Notifications {\n\n // Dependencies.\n private _platform: Platform = inject(Platform);\n private _applicationRef: ApplicationRef = inject(ApplicationRef);\n private _environmentInjector: EnvironmentInjector = inject(EnvironmentInjector);\n private _localize?: Localize = inject(Localize, {optional: true});\n private _config?: NotificationsConfig = inject(NOTIFICATIONS_CONFIG, {optional: true});\n private _document?: Document = inject(DOCUMENT, {optional: true});\n\n // Reference to the list.\n private _componentRef: ComponentRef<BbNotificationsList>;\n\n // The default settings for the notifications.\n private readonly _defaultMode: 'prepend' | 'append' = this._config?.mode ?? 'prepend';\n private readonly _defaultTimeout: number = this._config?.timeout ?? 8_000;\n private readonly _defaultLocalize: boolean = this._config?.localize ?? false;\n private readonly _defaultDismiss: boolean = this._config?.dismiss ?? true;\n private readonly _defaultDismissText: string = this._config?.dismissText ?? 'Dismiss';\n\n // The data containing the notifications.\n private _notifications$ = new BehaviorSubject<Notification[]>([]);\n\n constructor() {\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 const item = this.compose(notification);\n item.destroy = () => this.pull(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 = ++nextUniqueId % 99999;\n\n // Set all properties.\n notification.type = notification?.type ?? NotificationType.Custom;\n notification.content = notification?.content ?? null;\n notification.timeout = notification?.timeout ?? this._defaultTimeout;\n notification.localize = notification?.localize ?? this._defaultLocalize;\n notification.dismiss = notification?.dismiss ?? this._defaultDismiss;\n\n // Dismiss text localization.\n const dismissText = 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 const environmentInjector = createEnvironmentInjector([\n {provide: NOTIFICATIONS_DATA, useValue: this._notifications$}\n ], this._environmentInjector);\n\n this._componentRef = createComponent(BbNotificationsList, {environmentInjector});\n this._applicationRef.attachView(this._componentRef.hostView);\n\n if (!this._platform.isBrowser) {\n return;\n }\n\n try {\n this._document.body.appendChild(this._componentRef?.location?.nativeElement);\n } catch {\n // Don't do anything, because it must've failed.\n }\n }\n\n}\n","import {NOTIFICATIONS_CONFIG, NotificationsConfig} from './notifications.interfaces';\nimport {EnvironmentProviders, makeEnvironmentProviders} from '@angular/core';\n\nexport function provideNotificationsConfig(config: NotificationsConfig): EnvironmentProviders {\n return makeEnvironmentProviders([\n {provide: NOTIFICATIONS_CONFIG, useValue: config ?? {}}\n ]);\n}\n","import {provideNotificationsConfig} from './notifications.config';\nimport {NotificationsConfig} from './notifications.interfaces';\nimport {ModuleWithProviders, NgModule} from '@angular/core';\n\n@NgModule()\nexport class NotificationsModule {\n\n static forRoot(config?: NotificationsConfig): ModuleWithProviders<NotificationsModule> {\n return {\n ngModule: NotificationsModule,\n providers: [\n provideNotificationsConfig(config)\n ]\n };\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;IA2BY;AAAZ,CAAA,UAAY,gBAAgB,EAAA;AACxB,IAAA,gBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,gBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,gBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,gBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,gBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACrB,CAAC,EANW,gBAAgB,KAAhB,gBAAgB,GAM3B,EAAA,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M,EAAA,CAAA;;4FAET,aAAa,EAAA,UAAA,EAAA,CAAA;kBAHzB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE;AACf,iBAAA;;;ACTK,SAAU,0BAA0B,CAAC,MAA2B,EAAA;AAClE,IAAA,OAAO,wBAAwB,CAAC;QAC5B,EAAC,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,IAAI,EAAE;AACzD,KAAA,CAAC;AACN;;MCFa,mBAAmB,CAAA;IAE5B,OAAO,OAAO,CAAC,MAA4B,EAAA;QACvC,OAAO;AACH,YAAA,QAAQ,EAAE,mBAAmB;AAC7B,YAAA,SAAS,EAAE;gBACP,0BAA0B,CAAC,MAAM;AACpC;SACJ;;wGARI,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;yGAAnB,mBAAmB,EAAA,CAAA;yGAAnB,mBAAmB,EAAA,CAAA;;4FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAD/B;;;ACJD;;AAEG;;;;"}
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-item/notifications-item.component.ts","../../../projects/bb-foundation/notifications/src/lib/notifications-item/notifications-item.component.html","../../../projects/bb-foundation/notifications/src/lib/notifications.animations.ts","../../../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.service.ts","../../../projects/bb-foundation/notifications/src/lib/notifications.config.ts","../../../projects/bb-foundation/notifications/src/lib/notifications.module.ts","../../../projects/bb-foundation/notifications/src/bravobit-bb-foundation-notifications.ts"],"sourcesContent":["import {InjectionToken, TemplateRef} from '@angular/core';\nimport {Observable} from 'rxjs';\n\nexport interface Notification {\n content: string | TemplateRef<any>;\n type: NotificationType;\n\n id?: number;\n\n timeout?: number;\n localize?: boolean;\n dismiss?: boolean;\n dismissText?: string;\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 timeout?: number;\n dismiss?: boolean;\n localize?: boolean;\n dismissText?: string;\n}\n\nexport const NOTIFICATIONS_DATA: InjectionToken<Observable<Notification[]>> = new InjectionToken('notifications data');\n\nexport const NOTIFICATIONS_CONFIG: InjectionToken<NotificationsConfig> = new InjectionToken('notifications config');\n","import {ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, HostBinding, inject, Input, NgZone, OnDestroy, OnInit, ViewChild, ViewEncapsulation} from '@angular/core';\nimport {Notification, NotificationAction, NotificationsConfig} from '../notifications.interfaces';\nimport {BbLocalize} from '@bravobit/bb-foundation/localize';\nimport {BbTemplate} from '@bravobit/bb-foundation/utils';\nimport {Platform} from '@angular/cdk/platform';\nimport {WINDOW} 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 host: {'role': 'alert'},\n imports: [BbLocalize, BbTemplate]\n})\nexport class BbNotificationsItem implements OnInit, OnDestroy {\n\n // Dependencies.\n private readonly _zone: NgZone = inject(NgZone);\n private readonly _platform: Platform = inject(Platform);\n private readonly _changeDetection: ChangeDetectorRef = inject(ChangeDetectorRef);\n\n // Dependencies.\n private readonly _config?: NotificationsConfig = inject(NotificationsConfig, {optional: true});\n private readonly _window?: Window = inject(WINDOW, {optional: true});\n\n // Readonly data.\n readonly dismissText: string = this._config?.dismissText ?? null;\n\n // Inputs.\n @Input() notification: Notification | null = null;\n\n // Elements.\n @ViewChild('progress', {static: false}) progressElementRef: ElementRef<SVGCircleElement>;\n\n // Data.\n private _progress: number = 0;\n private _count: number = 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')\n get getClass() {\n return `bb-notifications-item ${this.notification.type}`;\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 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 this._timer && this._window?.clearTimeout?.(this._timer);\n }\n\n callActionAndDestroy(notification: Notification, action: NotificationAction) {\n action?.callback?.();\n notification?.destroy?.();\n }\n\n private startTimeout() {\n this._steps = this.notification.timeout / 10;\n this._speed = this.notification.timeout / this._steps;\n this._startTime = Date.now();\n this._zone.runOutsideAngular(() => this._timer = this.setTimeout(this.instance, this._speed));\n }\n\n private instance = () => {\n this._difference = (Date.now() - this._startTime) - (this._count * this._speed);\n\n if (this._count++ === this._steps) {\n this.notification.destroy();\n }\n\n this._progress += 100 / this._steps;\n this._timer = this.setTimeout(this.instance, this._speed - this._difference);\n this._zone.run(() => this._changeDetection.detectChanges());\n };\n\n private setTimeout(method: () => void, timeout: number) {\n if (!this._window || !this._window.setTimeout) {\n return null;\n }\n\n return this._window.setTimeout(method, timeout);\n }\n\n}\n","<div class=\"notification-content-wrapper\">\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 20\"\n class=\"notification-icon\">\n <path\n d=\"M8 20c1.1 0 2-.923 2-2.051H6C6 19.077 6.9 20 8 20Zm6-6.154V8.718c0-3.18-1.6-5.744-4.5-6.462v-.718C9.5.718 8.8 0 8 0S6.5.718 6.5 1.538v.718C3.6 2.974 2 5.538 2 8.718v5.128l-2 2.051v1.026h16v-1.026l-2-2.05Z\">\n </path>\n </svg>\n\n @if (notification?.timeout > 0) {\n <svg 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 }\n </div>\n\n <div class=\"notification-content\">\n <ng-template [bbTemplate]=\"notification?.content\">\n @if (notification?.localize) {\n {{ $any(notification?.content) | bbLocalize }}\n } @else {\n {{ notification?.content }}\n }\n </ng-template>\n </div>\n</div>\n\n@if (notification?.actions?.length > 0 || notification?.dismiss) {\n <div class=\"notification-actions\">\n @for (action of notification?.actions; track $index) {\n <button [class.destructive]=\"action?.type === 'cancel'\"\n (click)=\"callActionAndDestroy(notification, action)\"\n type=\"button\"\n class=\"notification-actions-button\">\n <span class=\"notification-actions-button-highlight\">\n @if (notification?.localize) {\n {{ action?.title | bbLocalize }}\n } @else {\n {{ action?.title }}\n }\n </span>\n </button>\n }\n @if (notification?.dismiss) {\n <button (click)=\"notification?.destroy()\"\n class=\"notification-actions-button destructive\"\n type=\"button\">\n <span\n class=\"notification-actions-button-highlight\">{{ notification?.dismissText ?? dismissText }}</span>\n </button>\n }\n </div>\n}\n","import {animate, query, style, transition, trigger} from '@angular/animations';\n\nexport const notificationListAnimation = trigger('notificationListAnimation', [\n transition('* => *', [\n query(':enter', [\n style({opacity: 0, transform: 'translateY(-1rem)'}),\n animate('250ms cubic-bezier(0, 0, 0.2, 1)', style({opacity: 1, transform: 'none'}))\n ], {optional: true}),\n\n query(':leave', [\n animate('250ms cubic-bezier(0, 0, .2, 1)', style({opacity: 0}))\n ], {optional: true})\n ])\n]);\n","import {ChangeDetectionStrategy, Component, inject, OnInit, ViewEncapsulation} from '@angular/core';\nimport {BbNotificationsItem} from '../notifications-item/notifications-item.component';\nimport {Notification, NOTIFICATIONS_DATA} from '../notifications.interfaces';\nimport {notificationListAnimation} from '../notifications.animations';\nimport {AsyncPipe} from '@angular/common';\nimport {map} from 'rxjs/operators';\nimport {Observable} from 'rxjs';\n\n@Component({\n selector: 'bb-notifications-list',\n templateUrl: './notifications-list.component.html',\n styleUrls: ['./notifications-list.component.scss'],\n animations: [notificationListAnimation],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n 'class': 'bb-notifications-list',\n 'role': 'list'\n },\n imports: [AsyncPipe, BbNotificationsItem]\n})\nexport class BbNotificationsList implements OnInit {\n\n // Dependencies.\n private readonly _data$: Observable<Notification[]> = inject(NOTIFICATIONS_DATA);\n\n // Data.\n data$: Observable<{\n notification?: Notification,\n styles?: { offset?: number, scale?: string }\n }[]>;\n\n ngOnInit() {\n this.setData();\n }\n\n private setData() {\n this.data$ = this._data$.pipe(\n map(notifications => {\n return notifications.map((notification, index) => {\n const scale = Math.max(0.9, 1 - (index * 0.02));\n return {\n notification,\n styles: {\n offset: Math.min(index, 5),\n scale: `scale(${scale})`\n }\n };\n });\n })\n );\n }\n\n}\n","@if (data$ | async; as data) {\n <div [@notificationListAnimation]=\"data?.length\"\n class=\"notifications-list-wrapper\">\n @for (item of data; track item?.notification?.id) {\n <bb-notifications-item [notification]=\"item?.notification\"\n [style.z-index]=\"item?.notification?.id\"\n [style.margin-top.rem]=\"item?.styles?.offset\"\n [style.transform]=\"item?.styles?.scale\">\n </bb-notifications-item>\n }\n </div>\n}\n","import {ApplicationRef, ComponentRef, createComponent, createEnvironmentInjector, EnvironmentInjector, inject, Injectable, TemplateRef, DOCUMENT} from '@angular/core';\nimport {Notification, NotificationAction, NOTIFICATIONS_CONFIG, NOTIFICATIONS_DATA, NotificationsConfig, NotificationType} from './notifications.interfaces';\nimport {BbNotificationsList} from './notifications-list/notifications-list.component';\nimport {Localize} from '@bravobit/bb-foundation/localize';\nimport {Platform} from '@angular/cdk/platform';\nimport {BehaviorSubject} from 'rxjs';\n\nlet nextUniqueId = 0;\n\n@Injectable({\n providedIn: 'root'\n})\nexport class Notifications {\n\n // Dependencies.\n private _platform: Platform = inject(Platform);\n private _applicationRef: ApplicationRef = inject(ApplicationRef);\n private _environmentInjector: EnvironmentInjector = inject(EnvironmentInjector);\n private _localize?: Localize = inject(Localize, {optional: true});\n private _config?: NotificationsConfig = inject(NOTIFICATIONS_CONFIG, {optional: true});\n private _document?: Document = inject(DOCUMENT, {optional: true});\n\n // Reference to the list.\n private _componentRef: ComponentRef<BbNotificationsList>;\n\n // The default settings for the notifications.\n private readonly _defaultMode: 'prepend' | 'append' = this._config?.mode ?? 'prepend';\n private readonly _defaultTimeout: number = this._config?.timeout ?? 8_000;\n private readonly _defaultLocalize: boolean = this._config?.localize ?? false;\n private readonly _defaultDismiss: boolean = this._config?.dismiss ?? true;\n private readonly _defaultDismissText: string = this._config?.dismissText ?? 'Dismiss';\n\n // The data containing the notifications.\n private _notifications$ = new BehaviorSubject<Notification[]>([]);\n\n constructor() {\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 const item = this.compose(notification);\n item.destroy = () => this.pull(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 = ++nextUniqueId % 99999;\n\n // Set all properties.\n notification.type = notification?.type ?? NotificationType.Custom;\n notification.content = notification?.content ?? null;\n notification.timeout = notification?.timeout ?? this._defaultTimeout;\n notification.localize = notification?.localize ?? this._defaultLocalize;\n notification.dismiss = notification?.dismiss ?? this._defaultDismiss;\n\n // Dismiss text localization.\n const dismissText = 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 const environmentInjector = createEnvironmentInjector([\n {provide: NOTIFICATIONS_DATA, useValue: this._notifications$}\n ], this._environmentInjector);\n\n this._componentRef = createComponent(BbNotificationsList, {environmentInjector});\n this._applicationRef.attachView(this._componentRef.hostView);\n\n if (!this._platform.isBrowser) {\n return;\n }\n\n try {\n this._document.body.appendChild(this._componentRef?.location?.nativeElement);\n } catch {\n // Don't do anything, because it must've failed.\n }\n }\n\n}\n","import {NOTIFICATIONS_CONFIG, NotificationsConfig} from './notifications.interfaces';\nimport {EnvironmentProviders, makeEnvironmentProviders} from '@angular/core';\n\nexport function provideNotificationsConfig(config: NotificationsConfig): EnvironmentProviders {\n return makeEnvironmentProviders([\n {provide: NOTIFICATIONS_CONFIG, useValue: config ?? {}}\n ]);\n}\n","import {provideNotificationsConfig} from './notifications.config';\nimport {NotificationsConfig} from './notifications.interfaces';\nimport {ModuleWithProviders, NgModule} from '@angular/core';\n\n@NgModule()\nexport class NotificationsModule {\n\n static forRoot(config?: NotificationsConfig): ModuleWithProviders<NotificationsModule> {\n return {\n ngModule: NotificationsModule,\n providers: [\n provideNotificationsConfig(config)\n ]\n };\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;IA2BY;AAAZ,CAAA,UAAY,gBAAgB,EAAA;AACxB,IAAA,gBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,gBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,gBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,gBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,gBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACrB,CAAC,EANW,gBAAgB,KAAhB,gBAAgB,GAM3B,EAAA,CAAA,CAAA;MAEY,mBAAmB,CAAA;AAC5B,IAAA,IAAI;AACJ,IAAA,OAAO;AACP,IAAA,OAAO;AACP,IAAA,QAAQ;AACR,IAAA,WAAW;AACd;MAEY,kBAAkB,GAA+C,IAAI,cAAc,CAAC,oBAAoB;MAExG,oBAAoB,GAAwC,IAAI,cAAc,CAAC,sBAAsB;;MC7BrG,mBAAmB,CAAA;;AAGX,IAAA,KAAK,GAAW,MAAM,CAAC,MAAM,CAAC;AAC9B,IAAA,SAAS,GAAa,MAAM,CAAC,QAAQ,CAAC;AACtC,IAAA,gBAAgB,GAAsB,MAAM,CAAC,iBAAiB,CAAC;;IAG/D,OAAO,GAAyB,MAAM,CAAC,mBAAmB,EAAE,EAAC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AAM;AACpC;SACJ;;uGARI,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;wGAAnB,mBAAmB,EAAA,CAAA;wGAAnB,mBAAmB,EAAA,CAAA;;2FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAD/B;;;ACJD;;AAEG;;;;"}
@@ -120,10 +120,10 @@ class Permissions {
120
120
  });
121
121
  this._subscription.add(subscription);
122
122
  }
123
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: Permissions, deps: [{ token: PermissionsHandler }], target: i0.ɵɵFactoryTarget.Injectable });
124
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: Permissions, providedIn: 'root' });
123
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: Permissions, deps: [{ token: PermissionsHandler }], target: i0.ɵɵFactoryTarget.Injectable });
124
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: Permissions, providedIn: 'root' });
125
125
  }
126
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: Permissions, decorators: [{
126
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: Permissions, decorators: [{
127
127
  type: Injectable,
128
128
  args: [{
129
129
  providedIn: 'root'
@@ -199,10 +199,10 @@ class BbPermission {
199
199
  static ngAcceptInputType_bbPermission;
200
200
  static ngAcceptInputType_bbPermissionElse;
201
201
  static ngAcceptInputType_bbPermissionMode;
202
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: BbPermission, deps: [], target: i0.ɵɵFactoryTarget.Directive });
203
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: BbPermission, isStandalone: true, selector: "ng-template[bbPermission]", inputs: { bbPermission: "bbPermission", bbPermissionElse: "bbPermissionElse", bbPermissionMode: "bbPermissionMode" }, ngImport: i0 });
202
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: BbPermission, deps: [], target: i0.ɵɵFactoryTarget.Directive });
203
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.3", type: BbPermission, isStandalone: true, selector: "ng-template[bbPermission]", inputs: { bbPermission: "bbPermission", bbPermissionElse: "bbPermissionElse", bbPermissionMode: "bbPermissionMode" }, ngImport: i0 });
204
204
  }
205
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: BbPermission, decorators: [{
205
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: BbPermission, decorators: [{
206
206
  type: Directive,
207
207
  args: [{
208
208
  selector: 'ng-template[bbPermission]'
@@ -267,11 +267,11 @@ class PermissionsModule {
267
267
  ]
268
268
  };
269
269
  }
270
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: PermissionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
271
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.11", ngImport: i0, type: PermissionsModule, imports: [BbPermission], exports: [BbPermission] });
272
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: PermissionsModule });
270
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: PermissionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
271
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.3", ngImport: i0, type: PermissionsModule, imports: [BbPermission], exports: [BbPermission] });
272
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: PermissionsModule });
273
273
  }
274
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: PermissionsModule, decorators: [{
274
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: PermissionsModule, decorators: [{
275
275
  type: NgModule,
276
276
  args: [{
277
277
  imports: [BbPermission],
@@ -1 +1 @@
1
- {"version":3,"file":"bravobit-bb-foundation-permissions.mjs","sources":["../../../projects/bb-foundation/permissions/src/lib/handlers/abstract.handler.ts","../../../projects/bb-foundation/permissions/src/lib/handlers/local.handler.ts","../../../projects/bb-foundation/permissions/src/lib/permissions.service.ts","../../../projects/bb-foundation/permissions/src/lib/directives/permission.directive.ts","../../../projects/bb-foundation/permissions/src/lib/permissions.interface.ts","../../../projects/bb-foundation/permissions/src/lib/guards/permission.guard.ts","../../../projects/bb-foundation/permissions/src/lib/permissions.config.ts","../../../projects/bb-foundation/permissions/src/lib/permissions.module.ts","../../../projects/bb-foundation/permissions/src/bravobit-bb-foundation-permissions.ts"],"sourcesContent":["import {Observable} from 'rxjs';\n\nexport abstract class PermissionsHandler {\n\n abstract get(): Observable<string[]> | string[];\n\n}\n","import {LocalPermissionsData} from '../permissions.interface';\nimport {PermissionsHandler} from './abstract.handler';\nimport {Auth} from '@bravobit/bb-foundation/auth';\nimport {map} from 'rxjs/operators';\n\nexport class LocalPermissionsHandler extends PermissionsHandler {\n\n constructor(protected auth: Auth,\n protected localPermissions: LocalPermissionsData) {\n super();\n }\n\n override get() {\n return this.auth.user.pipe(\n map(user => user?.['role'] as string ?? null),\n map(role => {\n if (role === null || role === undefined) {\n return [];\n }\n\n return this.getPermissionsForRole(role);\n })\n );\n }\n\n protected getPermissionsForRole(role: string) {\n return Object.keys(this.localPermissions ?? {}).reduce((previous, current) => {\n const roles = this.localPermissions?.[current] ?? [];\n if (roles === '*' || roles?.includes(role)) {\n return [...previous, current];\n }\n\n return previous;\n }, []);\n }\n\n}\n","import {BehaviorSubject, isObservable, of, Subscription} from 'rxjs';\nimport {PermissionsHandler} from './handlers/abstract.handler';\nimport {PermissionsOptions} from './permissions.interface';\nimport {distinctUntilChanged, map} from 'rxjs/operators';\nimport {Injectable, OnDestroy} from '@angular/core';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class Permissions implements OnDestroy {\n\n // State.\n private _activePermissions$ = new BehaviorSubject<string[]>([]);\n\n // Subscriptions.\n private _subscription = new Subscription();\n\n constructor(private _handler: PermissionsHandler) {\n this.trackPermissions();\n }\n\n ngOnDestroy() {\n this._subscription?.unsubscribe();\n }\n\n all() {\n return this._activePermissions$.asObservable();\n }\n\n allSync() {\n return this._activePermissions$.getValue();\n }\n\n has(value: string | string[], options?: PermissionsOptions) {\n const requiredPermissions = this.getRequiredPermissions(value);\n if (requiredPermissions?.length <= 0) {\n return of(false);\n }\n\n return this._activePermissions$.pipe(\n map(activePermissions => this.hasPermission(requiredPermissions, activePermissions, options)),\n distinctUntilChanged()\n );\n }\n\n hasSync(value: string | string[], options?: PermissionsOptions) {\n const requiredPermissions = this.getRequiredPermissions(value);\n if (requiredPermissions?.length <= 0) {\n return false;\n }\n\n const activePermissions = this._activePermissions$.getValue();\n return this.hasPermission(requiredPermissions, activePermissions, options);\n }\n\n private hasPermission(requiredPermissions: string[], activePermissions: string[], options?: PermissionsOptions) {\n const mode = options?.mode ?? 'and';\n switch (mode) {\n case 'or':\n return this.verifyModeOr(requiredPermissions, activePermissions);\n case 'not':\n return this.verifyModeNot(requiredPermissions, activePermissions);\n case 'and':\n default:\n return this.verifyModeAnd(requiredPermissions, activePermissions);\n }\n }\n\n private verifyModeAnd(permissions: string[], activePermissions: string[]) {\n for (const permission of permissions) {\n const verified = activePermissions?.includes(permission);\n if (!verified) {\n return false;\n }\n }\n\n return true;\n }\n\n private verifyModeNot(permissions: string[], activePermissions: string[]) {\n for (const permission of permissions) {\n if (activePermissions.includes(permission)) {\n return false;\n }\n }\n\n return true;\n }\n\n private verifyModeOr(permissions: string[], activePermissions: string[]) {\n for (const permission of permissions) {\n const verified = activePermissions?.includes(permission);\n if (verified) {\n return true;\n }\n }\n\n return false;\n }\n\n private getRequiredPermissions(value: string | string[]) {\n return Array.isArray(value)\n ? value\n : [value];\n }\n\n private trackPermissions() {\n const data = this._handler.get();\n const permissions$ = isObservable(data) ? data : of(data);\n\n const subscription = permissions$.subscribe(permissions => {\n this._activePermissions$.next(permissions ?? []);\n });\n this._subscription.add(subscription);\n }\n\n}\n","import {Directive, EmbeddedViewRef, inject, Input, OnDestroy, OnInit, TemplateRef, ViewContainerRef} from '@angular/core';\nimport {BehaviorSubject, combineLatest, Subscription} from 'rxjs';\nimport {distinctUntilChanged, switchMap} from 'rxjs/operators';\nimport {PermissionsMode} from '../permissions.interface';\nimport {Permissions} from '../permissions.service';\n\n@Directive({\n selector: 'ng-template[bbPermission]'\n})\nexport class BbPermission implements OnInit, OnDestroy {\n\n // Dependencies.\n private readonly _permissions: Permissions = inject(Permissions);\n private readonly _templateRef: TemplateRef<any> = inject(TemplateRef);\n private readonly _viewContainerRef: ViewContainerRef = inject(ViewContainerRef);\n\n // Templates.\n private _elseTemplateRef: TemplateRef<any> | null = null;\n\n // View refs.\n private _thenViewRef: EmbeddedViewRef<any> | null = null;\n private _elseViewRef: EmbeddedViewRef<any> | null = null;\n\n // Data.\n private _valid: boolean = false;\n private _permission$ = new BehaviorSubject<string[]>([]);\n private _mode$ = new BehaviorSubject<PermissionsMode>('and');\n\n @Input()\n set bbPermission(value: string | string[]) {\n const permissions = Array.isArray(value) ? value : [value];\n this._permission$.next(permissions);\n this.updateView();\n }\n\n @Input()\n set bbPermissionElse(templateRef: TemplateRef<any>) {\n this.assertTemplate('bbPermissionElse', templateRef);\n this._elseTemplateRef = templateRef;\n this.updateView();\n }\n\n @Input()\n set bbPermissionMode(mode: PermissionsMode) {\n this._mode$.next(mode);\n }\n\n // Subscriptions.\n private _subscription = new Subscription();\n\n ngOnInit() {\n const check$ = combineLatest([this._permission$, this._mode$]).pipe(\n switchMap(([permissions, mode]) => this._permissions.has(permissions, {mode})),\n distinctUntilChanged()\n );\n\n const subscription = check$.subscribe(valid => {\n this._valid = valid;\n this.updateView();\n });\n this._subscription.add(subscription);\n }\n\n ngOnDestroy() {\n this._subscription?.unsubscribe();\n }\n\n private updateView() {\n if (this._valid) {\n if (!this._thenViewRef) {\n this._viewContainerRef.clear();\n this._elseViewRef = null;\n if (this._templateRef) {\n this._thenViewRef = this._viewContainerRef.createEmbeddedView(this._templateRef);\n }\n }\n } else {\n if (!this._elseViewRef) {\n this._viewContainerRef.clear();\n this._thenViewRef = null;\n if (this._elseTemplateRef) {\n this._elseViewRef = this._viewContainerRef.createEmbeddedView(this._elseTemplateRef);\n }\n }\n }\n }\n\n private assertTemplate(property: string, templateRef: TemplateRef<any> | null) {\n const isTemplateRefOrNull = !!(!templateRef || templateRef.createEmbeddedView);\n if (!isTemplateRefOrNull) {\n throw new Error(`${property} must be a TemplateRef.`);\n }\n }\n\n static ngAcceptInputType_bbPermission: string | string[];\n static ngAcceptInputType_bbPermissionElse: TemplateRef<any>;\n static ngAcceptInputType_bbPermissionMode: PermissionsMode;\n\n}\n","import {ActivatedRouteSnapshot, Router, RouterStateSnapshot, UrlTree} from '@angular/router';\nimport {InjectionToken, Provider} from '@angular/core';\n\nexport class PermissionsConfig {\n provider?: Provider;\n localPermissions?: LocalPermissionsData;\n onPermissionDenied?: (router: Router, snapshot: ActivatedRouteSnapshot, state: RouterStateSnapshot) => UrlTree;\n}\n\nexport interface PermissionsOptions {\n mode?: PermissionsMode;\n}\n\nexport type PermissionsMode = 'and' | 'or' | 'not';\nexport type LocalPermissionsData<T extends string = any> = Record<string, T[] | '*'>;\n\nexport const PERMISSIONS_CONFIG: InjectionToken<PermissionsConfig> = new InjectionToken('permissions config');\n","import {ActivatedRouteSnapshot, CanActivateFn, Router, RouterStateSnapshot} from '@angular/router';\nimport {PermissionsOptions, PERMISSIONS_CONFIG} from '../permissions.interface';\nimport {Permissions} from '../permissions.service';\nimport {inject} from '@angular/core';\n\nexport const bbPermissionGuard = (value: string | string[], options?: PermissionsOptions): CanActivateFn => {\n return (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => {\n const router = inject(Router);\n const permissions = inject(Permissions);\n const config = inject(PERMISSIONS_CONFIG, {optional: true});\n\n const valid = permissions.hasSync(value, options);\n if (valid) {\n return true;\n }\n\n const onPermissionDeniedFn = config?.onPermissionDenied ?? null;\n if (!onPermissionDeniedFn) {\n return false;\n }\n\n const urlTree = onPermissionDeniedFn(router, route, state);\n if (!urlTree) {\n return false;\n }\n\n return valid ? true : urlTree;\n };\n};\n","import {EnvironmentProviders, makeEnvironmentProviders, Provider} from '@angular/core';\nimport {PERMISSIONS_CONFIG, PermissionsConfig} from './permissions.interface';\nimport {LocalPermissionsHandler} from './handlers/local.handler';\nimport {PermissionsHandler} from './handlers/abstract.handler';\nimport {Auth} from '@bravobit/bb-foundation/auth';\n\nexport function providePermissionsConfig(config?: PermissionsConfig): EnvironmentProviders {\n const defaultProvider: Provider = {\n provide: PermissionsHandler,\n deps: [Auth],\n useFactory: (auth: Auth) => {\n return new LocalPermissionsHandler(auth, config?.localPermissions ?? {});\n }\n };\n\n const permissionHandlerProvider = config?.provider ?? defaultProvider;\n\n return makeEnvironmentProviders([\n {provide: PERMISSIONS_CONFIG, useValue: config},\n permissionHandlerProvider\n ]);\n}\n","import {BbPermission} from './directives/permission.directive';\nimport {providePermissionsConfig} from './permissions.config';\nimport {ModuleWithProviders, NgModule} from '@angular/core';\nimport {PermissionsConfig} from './permissions.interface';\n\n@NgModule({\n imports: [BbPermission],\n exports: [BbPermission]\n})\nexport class PermissionsModule {\n\n static forRoot(config?: PermissionsConfig): ModuleWithProviders<PermissionsModule> {\n return {\n ngModule: PermissionsModule,\n providers: [\n providePermissionsConfig(config)\n ]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AE,QAAQ,IAAI,eAAe;AAErE,IAAA,OAAO,wBAAwB,CAAC;AAC5B,QAAA,EAAC,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,EAAC;QAC/C;AACH,KAAA,CAAC;AACN;;MCZa,iBAAiB,CAAA;IAE1B,OAAO,OAAO,CAAC,MAA0B,EAAA;QACrC,OAAO;AACH,YAAA,QAAQ,EAAE,iBAAiB;AAC3B,YAAA,SAAS,EAAE;gBACP,wBAAwB,CAAC,MAAM;AAClC;SACJ;;wGARI,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;yGAAjB,iBAAiB,EAAA,OAAA,EAAA,CAHhB,YAAY,CAAA,EAAA,OAAA,EAAA,CACZ,YAAY,CAAA,EAAA,CAAA;yGAEb,iBAAiB,EAAA,CAAA;;4FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAJ7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,OAAO,EAAE,CAAC,YAAY;AACzB,iBAAA;;;ACRD;;AAEG;;;;"}
1
+ {"version":3,"file":"bravobit-bb-foundation-permissions.mjs","sources":["../../../projects/bb-foundation/permissions/src/lib/handlers/abstract.handler.ts","../../../projects/bb-foundation/permissions/src/lib/handlers/local.handler.ts","../../../projects/bb-foundation/permissions/src/lib/permissions.service.ts","../../../projects/bb-foundation/permissions/src/lib/directives/permission.directive.ts","../../../projects/bb-foundation/permissions/src/lib/permissions.interface.ts","../../../projects/bb-foundation/permissions/src/lib/guards/permission.guard.ts","../../../projects/bb-foundation/permissions/src/lib/permissions.config.ts","../../../projects/bb-foundation/permissions/src/lib/permissions.module.ts","../../../projects/bb-foundation/permissions/src/bravobit-bb-foundation-permissions.ts"],"sourcesContent":["import {Observable} from 'rxjs';\n\nexport abstract class PermissionsHandler {\n\n abstract get(): Observable<string[]> | string[];\n\n}\n","import {LocalPermissionsData} from '../permissions.interface';\nimport {PermissionsHandler} from './abstract.handler';\nimport {Auth} from '@bravobit/bb-foundation/auth';\nimport {map} from 'rxjs/operators';\n\nexport class LocalPermissionsHandler extends PermissionsHandler {\n\n constructor(protected auth: Auth,\n protected localPermissions: LocalPermissionsData) {\n super();\n }\n\n override get() {\n return this.auth.user.pipe(\n map(user => user?.['role'] as string ?? null),\n map(role => {\n if (role === null || role === undefined) {\n return [];\n }\n\n return this.getPermissionsForRole(role);\n })\n );\n }\n\n protected getPermissionsForRole(role: string) {\n return Object.keys(this.localPermissions ?? {}).reduce((previous, current) => {\n const roles = this.localPermissions?.[current] ?? [];\n if (roles === '*' || roles?.includes(role)) {\n return [...previous, current];\n }\n\n return previous;\n }, []);\n }\n\n}\n","import {BehaviorSubject, isObservable, of, Subscription} from 'rxjs';\nimport {PermissionsHandler} from './handlers/abstract.handler';\nimport {PermissionsOptions} from './permissions.interface';\nimport {distinctUntilChanged, map} from 'rxjs/operators';\nimport {Injectable, OnDestroy} from '@angular/core';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class Permissions implements OnDestroy {\n\n // State.\n private _activePermissions$ = new BehaviorSubject<string[]>([]);\n\n // Subscriptions.\n private _subscription = new Subscription();\n\n constructor(private _handler: PermissionsHandler) {\n this.trackPermissions();\n }\n\n ngOnDestroy() {\n this._subscription?.unsubscribe();\n }\n\n all() {\n return this._activePermissions$.asObservable();\n }\n\n allSync() {\n return this._activePermissions$.getValue();\n }\n\n has(value: string | string[], options?: PermissionsOptions) {\n const requiredPermissions = this.getRequiredPermissions(value);\n if (requiredPermissions?.length <= 0) {\n return of(false);\n }\n\n return this._activePermissions$.pipe(\n map(activePermissions => this.hasPermission(requiredPermissions, activePermissions, options)),\n distinctUntilChanged()\n );\n }\n\n hasSync(value: string | string[], options?: PermissionsOptions) {\n const requiredPermissions = this.getRequiredPermissions(value);\n if (requiredPermissions?.length <= 0) {\n return false;\n }\n\n const activePermissions = this._activePermissions$.getValue();\n return this.hasPermission(requiredPermissions, activePermissions, options);\n }\n\n private hasPermission(requiredPermissions: string[], activePermissions: string[], options?: PermissionsOptions) {\n const mode = options?.mode ?? 'and';\n switch (mode) {\n case 'or':\n return this.verifyModeOr(requiredPermissions, activePermissions);\n case 'not':\n return this.verifyModeNot(requiredPermissions, activePermissions);\n case 'and':\n default:\n return this.verifyModeAnd(requiredPermissions, activePermissions);\n }\n }\n\n private verifyModeAnd(permissions: string[], activePermissions: string[]) {\n for (const permission of permissions) {\n const verified = activePermissions?.includes(permission);\n if (!verified) {\n return false;\n }\n }\n\n return true;\n }\n\n private verifyModeNot(permissions: string[], activePermissions: string[]) {\n for (const permission of permissions) {\n if (activePermissions.includes(permission)) {\n return false;\n }\n }\n\n return true;\n }\n\n private verifyModeOr(permissions: string[], activePermissions: string[]) {\n for (const permission of permissions) {\n const verified = activePermissions?.includes(permission);\n if (verified) {\n return true;\n }\n }\n\n return false;\n }\n\n private getRequiredPermissions(value: string | string[]) {\n return Array.isArray(value)\n ? value\n : [value];\n }\n\n private trackPermissions() {\n const data = this._handler.get();\n const permissions$ = isObservable(data) ? data : of(data);\n\n const subscription = permissions$.subscribe(permissions => {\n this._activePermissions$.next(permissions ?? []);\n });\n this._subscription.add(subscription);\n }\n\n}\n","import {Directive, EmbeddedViewRef, inject, Input, OnDestroy, OnInit, TemplateRef, ViewContainerRef} from '@angular/core';\nimport {BehaviorSubject, combineLatest, Subscription} from 'rxjs';\nimport {distinctUntilChanged, switchMap} from 'rxjs/operators';\nimport {PermissionsMode} from '../permissions.interface';\nimport {Permissions} from '../permissions.service';\n\n@Directive({\n selector: 'ng-template[bbPermission]'\n})\nexport class BbPermission implements OnInit, OnDestroy {\n\n // Dependencies.\n private readonly _permissions: Permissions = inject(Permissions);\n private readonly _templateRef: TemplateRef<any> = inject(TemplateRef);\n private readonly _viewContainerRef: ViewContainerRef = inject(ViewContainerRef);\n\n // Templates.\n private _elseTemplateRef: TemplateRef<any> | null = null;\n\n // View refs.\n private _thenViewRef: EmbeddedViewRef<any> | null = null;\n private _elseViewRef: EmbeddedViewRef<any> | null = null;\n\n // Data.\n private _valid: boolean = false;\n private _permission$ = new BehaviorSubject<string[]>([]);\n private _mode$ = new BehaviorSubject<PermissionsMode>('and');\n\n @Input()\n set bbPermission(value: string | string[]) {\n const permissions = Array.isArray(value) ? value : [value];\n this._permission$.next(permissions);\n this.updateView();\n }\n\n @Input()\n set bbPermissionElse(templateRef: TemplateRef<any>) {\n this.assertTemplate('bbPermissionElse', templateRef);\n this._elseTemplateRef = templateRef;\n this.updateView();\n }\n\n @Input()\n set bbPermissionMode(mode: PermissionsMode) {\n this._mode$.next(mode);\n }\n\n // Subscriptions.\n private _subscription = new Subscription();\n\n ngOnInit() {\n const check$ = combineLatest([this._permission$, this._mode$]).pipe(\n switchMap(([permissions, mode]) => this._permissions.has(permissions, {mode})),\n distinctUntilChanged()\n );\n\n const subscription = check$.subscribe(valid => {\n this._valid = valid;\n this.updateView();\n });\n this._subscription.add(subscription);\n }\n\n ngOnDestroy() {\n this._subscription?.unsubscribe();\n }\n\n private updateView() {\n if (this._valid) {\n if (!this._thenViewRef) {\n this._viewContainerRef.clear();\n this._elseViewRef = null;\n if (this._templateRef) {\n this._thenViewRef = this._viewContainerRef.createEmbeddedView(this._templateRef);\n }\n }\n } else {\n if (!this._elseViewRef) {\n this._viewContainerRef.clear();\n this._thenViewRef = null;\n if (this._elseTemplateRef) {\n this._elseViewRef = this._viewContainerRef.createEmbeddedView(this._elseTemplateRef);\n }\n }\n }\n }\n\n private assertTemplate(property: string, templateRef: TemplateRef<any> | null) {\n const isTemplateRefOrNull = !!(!templateRef || templateRef.createEmbeddedView);\n if (!isTemplateRefOrNull) {\n throw new Error(`${property} must be a TemplateRef.`);\n }\n }\n\n static ngAcceptInputType_bbPermission: string | string[];\n static ngAcceptInputType_bbPermissionElse: TemplateRef<any>;\n static ngAcceptInputType_bbPermissionMode: PermissionsMode;\n\n}\n","import {ActivatedRouteSnapshot, Router, RouterStateSnapshot, UrlTree} from '@angular/router';\nimport {InjectionToken, Provider} from '@angular/core';\n\nexport class PermissionsConfig {\n provider?: Provider;\n localPermissions?: LocalPermissionsData;\n onPermissionDenied?: (router: Router, snapshot: ActivatedRouteSnapshot, state: RouterStateSnapshot) => UrlTree;\n}\n\nexport interface PermissionsOptions {\n mode?: PermissionsMode;\n}\n\nexport type PermissionsMode = 'and' | 'or' | 'not';\nexport type LocalPermissionsData<T extends string = any> = Record<string, T[] | '*'>;\n\nexport const PERMISSIONS_CONFIG: InjectionToken<PermissionsConfig> = new InjectionToken('permissions config');\n","import {ActivatedRouteSnapshot, CanActivateFn, Router, RouterStateSnapshot} from '@angular/router';\nimport {PermissionsOptions, PERMISSIONS_CONFIG} from '../permissions.interface';\nimport {Permissions} from '../permissions.service';\nimport {inject} from '@angular/core';\n\nexport const bbPermissionGuard = (value: string | string[], options?: PermissionsOptions): CanActivateFn => {\n return (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => {\n const router = inject(Router);\n const permissions = inject(Permissions);\n const config = inject(PERMISSIONS_CONFIG, {optional: true});\n\n const valid = permissions.hasSync(value, options);\n if (valid) {\n return true;\n }\n\n const onPermissionDeniedFn = config?.onPermissionDenied ?? null;\n if (!onPermissionDeniedFn) {\n return false;\n }\n\n const urlTree = onPermissionDeniedFn(router, route, state);\n if (!urlTree) {\n return false;\n }\n\n return valid ? true : urlTree;\n };\n};\n","import {EnvironmentProviders, makeEnvironmentProviders, Provider} from '@angular/core';\nimport {PERMISSIONS_CONFIG, PermissionsConfig} from './permissions.interface';\nimport {LocalPermissionsHandler} from './handlers/local.handler';\nimport {PermissionsHandler} from './handlers/abstract.handler';\nimport {Auth} from '@bravobit/bb-foundation/auth';\n\nexport function providePermissionsConfig(config?: PermissionsConfig): EnvironmentProviders {\n const defaultProvider: Provider = {\n provide: PermissionsHandler,\n deps: [Auth],\n useFactory: (auth: Auth) => {\n return new LocalPermissionsHandler(auth, config?.localPermissions ?? {});\n }\n };\n\n const permissionHandlerProvider = config?.provider ?? defaultProvider;\n\n return makeEnvironmentProviders([\n {provide: PERMISSIONS_CONFIG, useValue: config},\n permissionHandlerProvider\n ]);\n}\n","import {BbPermission} from './directives/permission.directive';\nimport {providePermissionsConfig} from './permissions.config';\nimport {ModuleWithProviders, NgModule} from '@angular/core';\nimport {PermissionsConfig} from './permissions.interface';\n\n@NgModule({\n imports: [BbPermission],\n exports: [BbPermission]\n})\nexport class PermissionsModule {\n\n static forRoot(config?: PermissionsConfig): ModuleWithProviders<PermissionsModule> {\n return {\n ngModule: PermissionsModule,\n providers: [\n providePermissionsConfig(config)\n ]\n };\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1.PermissionsHandler"],"mappings":";;;;;;;MAEsB,kBAAkB,CAAA;AAIvC;;ACDK,MAAO,uBAAwB,SAAQ,kBAAkB,CAAA;AAErC,IAAA,IAAA;AACA,IAAA,gBAAA;IADtB,WAAsB,CAAA,IAAU,EACV,gBAAsC,EAAA;AACxD,QAAA,KAAK,EAAE;QAFW,IAAI,CAAA,IAAA,GAAJ,IAAI;QACJ,IAAgB,CAAA,gBAAA,GAAhB,gBAAgB;;IAI7B,GAAG,GAAA;QACR,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CACtB,GAAG,CAAC,IAAI,IAAI,IAAI,GAAG,MAAM,CAAW,IAAI,IAAI,CAAC,EAC7C,GAAG,CAAC,IAAI,IAAG;YACP,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,EAAE;AACrC,gBAAA,OAAO,EAAE;;AAGb,YAAA,OAAO,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC;SAC1C,CAAC,CACL;;AAGK,IAAA,qBAAqB,CAAC,IAAY,EAAA;AACxC,QAAA,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC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