@dereekb/dbx-core 1.2.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/README.md +1 -1
  2. package/esm2020/lib/action/action.handler.mjs +4 -126
  3. package/esm2020/lib/action/action.holder.mjs +13 -4
  4. package/esm2020/lib/action/action.machine.mjs +15 -7
  5. package/esm2020/lib/action/action.mjs +37 -17
  6. package/esm2020/lib/action/action.module.mjs +18 -18
  7. package/esm2020/lib/action/action.reference.mjs +7 -0
  8. package/esm2020/lib/action/action.store.mjs +63 -26
  9. package/esm2020/lib/action/action.store.source.mjs +27 -13
  10. package/esm2020/lib/action/directive/auto/action.automodify.directive.mjs +7 -7
  11. package/esm2020/lib/action/directive/auto/action.autotrigger.directive.mjs +13 -11
  12. package/esm2020/lib/action/directive/auto/index.mjs +2 -2
  13. package/esm2020/lib/action/directive/context/action.directive.mjs +7 -7
  14. package/esm2020/lib/action/directive/context/action.source.directive.mjs +3 -3
  15. package/esm2020/lib/action/directive/debug/action.logger.directive.mjs +6 -6
  16. package/esm2020/lib/action/directive/map/action.map.directive.mjs +3 -3
  17. package/esm2020/lib/action/directive/map/action.map.key.directive.mjs +3 -3
  18. package/esm2020/lib/action/directive/map/action.map.source.directive.mjs +3 -3
  19. package/esm2020/lib/action/directive/map/action.map.working.disable.directive.mjs +7 -7
  20. package/esm2020/lib/action/directive/state/action.disabled.directive.mjs +8 -7
  21. package/esm2020/lib/action/directive/state/action.enforce.modified.directive.mjs +48 -0
  22. package/esm2020/lib/action/directive/state/action.handler.directive.mjs +13 -12
  23. package/esm2020/lib/action/directive/state/action.success.directive.mjs +24 -36
  24. package/esm2020/lib/action/directive/state/action.success.handler.directive.mjs +48 -0
  25. package/esm2020/lib/action/directive/state/action.value.directive.mjs +13 -11
  26. package/esm2020/lib/action/directive/state/action.value.stream.directive.mjs +80 -0
  27. package/esm2020/lib/action/directive/state/action.value.trigger.directive.mjs +73 -0
  28. package/esm2020/lib/action/directive/state/action.value.trigger.instance.mjs +43 -0
  29. package/esm2020/lib/action/directive/state/action.working.component.mjs +29 -23
  30. package/esm2020/lib/action/directive/state/index.mjs +5 -3
  31. package/esm2020/lib/action/index.mjs +2 -2
  32. package/esm2020/lib/auth/auth.module.mjs +26 -0
  33. package/esm2020/lib/auth/auth.role.any.directive.mjs +36 -0
  34. package/esm2020/lib/auth/auth.role.has.directive.mjs +36 -0
  35. package/esm2020/lib/auth/auth.state.module.mjs +28 -0
  36. package/esm2020/lib/auth/auth.state.service.mjs +23 -0
  37. package/esm2020/lib/auth/auth.user.mjs +11 -0
  38. package/esm2020/lib/auth/index.mjs +10 -0
  39. package/esm2020/lib/auth/router/auth.router.mjs +6 -0
  40. package/esm2020/lib/auth/router/auth.router.module.mjs +26 -0
  41. package/esm2020/lib/auth/router/auth.router.service.mjs +61 -0
  42. package/esm2020/lib/auth/router/index.mjs +6 -0
  43. package/esm2020/lib/auth/router/provider/uirouter/auth.hook.mjs +23 -0
  44. package/esm2020/lib/auth/router/provider/uirouter/hook.mjs +65 -0
  45. package/esm2020/lib/auth/router/provider/uirouter/index.mjs +6 -0
  46. package/esm2020/lib/auth/router/provider/uirouter/redirect.mjs +29 -0
  47. package/esm2020/lib/auth/router/provider/uirouter/role.hook.mjs +32 -0
  48. package/esm2020/lib/auth/router/provider/uirouter/state.hook.mjs +53 -0
  49. package/esm2020/lib/auth/router/state/auth.router.state.module.mjs +32 -0
  50. package/esm2020/lib/auth/router/state/effect/auth.router.state.effect.mjs +46 -0
  51. package/esm2020/lib/auth/router/state/effect/index.mjs +2 -0
  52. package/esm2020/lib/auth/router/state/index.mjs +3 -0
  53. package/esm2020/lib/auth/service/auth.service.mjs +6 -0
  54. package/esm2020/lib/auth/service/auth.service.rxjs.mjs +27 -0
  55. package/esm2020/lib/auth/service/index.mjs +3 -0
  56. package/esm2020/lib/auth/state/action/auth.action.mjs +14 -0
  57. package/esm2020/lib/auth/state/action/index.mjs +12 -0
  58. package/esm2020/lib/auth/state/action/user.action.mjs +18 -0
  59. package/esm2020/lib/auth/state/effect/auth.effect.mjs +44 -0
  60. package/esm2020/lib/auth/state/index.mjs +13 -0
  61. package/esm2020/lib/auth/state/reducer/index.mjs +23 -0
  62. package/esm2020/lib/auth/state/reducer/user.reducer.mjs +12 -0
  63. package/esm2020/lib/auth/state/state.mjs +2 -0
  64. package/esm2020/lib/button/action/action.button.directive.mjs +14 -13
  65. package/esm2020/lib/button/action/action.button.trigger.directive.mjs +6 -6
  66. package/esm2020/lib/button/button.directive.mjs +7 -7
  67. package/esm2020/lib/button/button.loading.directive.mjs +3 -3
  68. package/esm2020/lib/button/button.mjs +1 -1
  69. package/esm2020/lib/button/button.module.mjs +4 -4
  70. package/esm2020/lib/button/router/button.segue.directive.mjs +8 -4
  71. package/esm2020/lib/context/context.directive.mjs +41 -0
  72. package/esm2020/lib/context/context.mjs +22 -0
  73. package/esm2020/lib/context/context.module.mjs +28 -0
  74. package/esm2020/lib/context/context.service.mjs +29 -0
  75. package/esm2020/lib/context/index.mjs +6 -0
  76. package/esm2020/lib/context/state/action/data.action.mjs +10 -0
  77. package/esm2020/lib/context/state/action/index.mjs +7 -0
  78. package/esm2020/lib/context/state/effect/index.mjs +38 -0
  79. package/esm2020/lib/context/state/index.mjs +13 -0
  80. package/esm2020/lib/context/state/reducer/data.reducer.mjs +16 -0
  81. package/esm2020/lib/context/state/reducer/index.mjs +25 -0
  82. package/esm2020/lib/context/state/state.mjs +2 -0
  83. package/esm2020/lib/filter/action/action.filter.source.directive.mjs +6 -6
  84. package/esm2020/lib/filter/filter.abstract.connector.directive.mjs +3 -3
  85. package/esm2020/lib/filter/filter.abstract.source.directive.mjs +4 -4
  86. package/esm2020/lib/filter/filter.connector.directive.mjs +3 -3
  87. package/esm2020/lib/filter/filter.map.connector.directive.mjs +3 -3
  88. package/esm2020/lib/filter/filter.map.directive.mjs +3 -3
  89. package/esm2020/lib/filter/filter.map.instance.directive.mjs +3 -3
  90. package/esm2020/lib/filter/filter.map.source.directive.mjs +3 -3
  91. package/esm2020/lib/filter/filter.module.mjs +4 -4
  92. package/esm2020/lib/filter/filter.source.directive.mjs +3 -3
  93. package/esm2020/lib/index.mjs +6 -2
  94. package/esm2020/lib/injection/index.mjs +9 -0
  95. package/esm2020/lib/injection/injection.component.mjs +34 -0
  96. package/esm2020/lib/injection/injection.component.module.mjs +31 -0
  97. package/esm2020/lib/injection/injection.context.directive.mjs +124 -0
  98. package/esm2020/lib/injection/injection.context.forward.directive.mjs +30 -0
  99. package/esm2020/lib/injection/injection.context.mjs +18 -0
  100. package/esm2020/lib/injection/injection.directive.mjs +33 -0
  101. package/esm2020/lib/injection/injection.instance.mjs +116 -0
  102. package/esm2020/lib/injection/injection.mjs +16 -0
  103. package/esm2020/lib/ngrx/index.mjs +2 -0
  104. package/esm2020/lib/ngrx/store.lockset.mjs +64 -0
  105. package/esm2020/lib/pipe/date/date.pipe.module.mjs +4 -4
  106. package/esm2020/lib/pipe/date/datedistance.pipe.mjs +3 -3
  107. package/esm2020/lib/pipe/date/dateformatdistance.pipe.mjs +3 -3
  108. package/esm2020/lib/pipe/date/datefromtoformat.pipe.mjs +3 -3
  109. package/esm2020/lib/pipe/date/minutesstring.pipe.mjs +3 -3
  110. package/esm2020/lib/pipe/date/timedistance.pipe.mjs +6 -6
  111. package/esm2020/lib/pipe/date/tojsdate.pipe.mjs +13 -5
  112. package/esm2020/lib/pipe/date/tominutes.pipe.mjs +3 -3
  113. package/esm2020/lib/pipe/index.mjs +3 -1
  114. package/esm2020/lib/pipe/misc/index.mjs +3 -0
  115. package/esm2020/lib/pipe/misc/misc.pipe.module.mjs +20 -0
  116. package/esm2020/lib/pipe/misc/prettyjson.pipe.mjs +27 -0
  117. package/esm2020/lib/pipe/pipe.module.mjs +21 -0
  118. package/esm2020/lib/router/anchor/anchor.directive.mjs +18 -5
  119. package/esm2020/lib/router/anchor/anchor.mjs +1 -1
  120. package/esm2020/lib/router/router/provider/angular/angular.router.service.mjs +8 -5
  121. package/esm2020/lib/router/router/provider/angular/angular.router.service.module.mjs +4 -4
  122. package/esm2020/lib/router/router/provider/uirouter/uirouter.router.service.mjs +32 -10
  123. package/esm2020/lib/router/router/provider/uirouter/uirouter.router.service.module.mjs +4 -4
  124. package/esm2020/lib/router/router/service/index.mjs +2 -1
  125. package/esm2020/lib/router/router/service/router.go.mjs +14 -0
  126. package/esm2020/lib/router/router/service/router.service.mjs +1 -1
  127. package/esm2020/lib/router/router/transition/transition.directive.mjs +7 -7
  128. package/esm2020/lib/router/router/transition/transition.watcher.directive.mjs +6 -6
  129. package/esm2020/lib/router/segue.mjs +17 -2
  130. package/esm2020/lib/storage/storage.accessor.simple.factory.mjs +3 -3
  131. package/esm2020/lib/storage/storage.module.mjs +4 -4
  132. package/esm2020/lib/subscription/subscription.directive.mjs +6 -6
  133. package/esm2020/lib/util/view.mjs +18 -2
  134. package/esm2020/lib/view/if.directive.mjs +30 -0
  135. package/esm2020/lib/view/index.mjs +2 -0
  136. package/fesm2015/dereekb-dbx-core.mjs +1977 -690
  137. package/fesm2015/dereekb-dbx-core.mjs.map +1 -1
  138. package/fesm2020/dereekb-dbx-core.mjs +1970 -683
  139. package/fesm2020/dereekb-dbx-core.mjs.map +1 -1
  140. package/lib/action/action.d.ts +14 -12
  141. package/lib/action/action.handler.d.ts +7 -67
  142. package/lib/action/action.holder.d.ts +9 -5
  143. package/lib/action/action.machine.d.ts +21 -8
  144. package/lib/action/action.module.d.ts +5 -5
  145. package/lib/action/action.reference.d.ts +11 -0
  146. package/lib/action/action.store.d.ts +33 -15
  147. package/lib/action/action.store.source.d.ts +20 -13
  148. package/lib/action/directive/auto/action.automodify.directive.d.ts +5 -4
  149. package/lib/action/directive/auto/action.autotrigger.directive.d.ts +9 -9
  150. package/lib/action/directive/auto/index.d.ts +1 -1
  151. package/lib/action/directive/context/action.directive.d.ts +3 -3
  152. package/lib/action/directive/debug/action.logger.directive.d.ts +3 -3
  153. package/lib/action/directive/map/action.map.working.disable.directive.d.ts +6 -6
  154. package/lib/action/directive/state/action.disabled.directive.d.ts +5 -4
  155. package/lib/action/directive/state/action.enforce.modified.directive.d.ts +20 -0
  156. package/lib/action/directive/state/action.handler.directive.d.ts +3 -3
  157. package/lib/action/directive/state/action.success.directive.d.ts +11 -19
  158. package/lib/action/directive/state/action.success.handler.directive.d.ts +24 -0
  159. package/lib/action/directive/state/action.value.directive.d.ts +8 -8
  160. package/lib/action/directive/state/action.value.stream.directive.d.ts +25 -0
  161. package/lib/action/directive/state/action.value.trigger.directive.d.ts +34 -0
  162. package/lib/action/directive/state/action.value.trigger.instance.d.ts +34 -0
  163. package/lib/action/directive/state/action.working.component.d.ts +13 -7
  164. package/lib/action/directive/state/index.d.ts +4 -2
  165. package/lib/action/index.d.ts +1 -1
  166. package/lib/auth/auth.module.d.ts +8 -0
  167. package/lib/auth/auth.role.any.directive.d.ts +20 -0
  168. package/lib/auth/auth.role.has.directive.d.ts +20 -0
  169. package/lib/auth/auth.state.module.d.ts +8 -0
  170. package/lib/auth/auth.state.service.d.ts +13 -0
  171. package/lib/auth/auth.user.d.ts +28 -0
  172. package/lib/auth/index.d.ts +9 -0
  173. package/lib/auth/router/auth.router.d.ts +10 -0
  174. package/lib/auth/router/auth.router.module.d.ts +9 -0
  175. package/lib/auth/router/auth.router.service.d.ts +38 -0
  176. package/lib/auth/router/index.d.ts +5 -0
  177. package/lib/auth/router/provider/uirouter/auth.hook.d.ts +18 -0
  178. package/lib/auth/router/provider/uirouter/hook.d.ts +46 -0
  179. package/lib/auth/router/provider/uirouter/index.d.ts +5 -0
  180. package/lib/auth/router/provider/uirouter/redirect.d.ts +9 -0
  181. package/lib/auth/router/provider/uirouter/role.hook.d.ts +26 -0
  182. package/lib/auth/router/provider/uirouter/state.hook.d.ts +31 -0
  183. package/lib/auth/router/state/auth.router.state.module.d.ts +14 -0
  184. package/lib/auth/router/state/effect/auth.router.state.effect.d.ts +32 -0
  185. package/lib/auth/router/state/effect/index.d.ts +1 -0
  186. package/lib/auth/router/state/index.d.ts +2 -0
  187. package/lib/auth/service/auth.service.d.ts +46 -0
  188. package/lib/auth/service/auth.service.rxjs.d.ts +18 -0
  189. package/lib/auth/service/index.d.ts +2 -0
  190. package/lib/auth/state/action/auth.action.d.ts +12 -0
  191. package/lib/auth/state/action/index.d.ts +11 -0
  192. package/lib/auth/state/action/user.action.d.ts +34 -0
  193. package/lib/auth/state/effect/auth.effect.d.ts +31 -0
  194. package/lib/auth/state/index.d.ts +12 -0
  195. package/lib/auth/state/reducer/index.d.ts +29 -0
  196. package/lib/auth/state/reducer/user.reducer.d.ts +11 -0
  197. package/lib/auth/state/state.d.ts +5 -0
  198. package/lib/button/action/action.button.directive.d.ts +4 -4
  199. package/lib/button/action/action.button.trigger.directive.d.ts +3 -3
  200. package/lib/button/button.d.ts +5 -5
  201. package/lib/button/button.directive.d.ts +2 -2
  202. package/lib/button/router/button.segue.directive.d.ts +1 -0
  203. package/lib/context/context.d.ts +39 -0
  204. package/lib/context/context.directive.d.ts +19 -0
  205. package/lib/context/context.module.d.ts +8 -0
  206. package/lib/context/context.service.d.ts +16 -0
  207. package/lib/context/index.d.ts +5 -0
  208. package/lib/context/state/action/data.action.d.ts +13 -0
  209. package/lib/context/state/action/index.d.ts +6 -0
  210. package/lib/context/state/effect/index.d.ts +39 -0
  211. package/lib/context/state/index.d.ts +12 -0
  212. package/lib/context/state/reducer/data.reducer.d.ts +13 -0
  213. package/lib/context/state/reducer/index.d.ts +34 -0
  214. package/lib/context/state/state.d.ts +9 -0
  215. package/lib/filter/action/action.filter.source.directive.d.ts +2 -2
  216. package/lib/filter/filter.abstract.source.directive.d.ts +2 -2
  217. package/lib/index.d.ts +5 -1
  218. package/lib/injection/index.d.ts +8 -0
  219. package/lib/injection/injection.component.d.ts +15 -0
  220. package/lib/injection/injection.component.module.d.ts +9 -0
  221. package/lib/injection/injection.context.d.ts +39 -0
  222. package/lib/injection/injection.context.directive.d.ts +25 -0
  223. package/lib/injection/injection.context.forward.directive.d.ts +16 -0
  224. package/lib/{injected/injected.d.ts → injection/injection.d.ts} +4 -4
  225. package/lib/injection/injection.directive.d.ts +19 -0
  226. package/lib/{injected/injected.instance.d.ts → injection/injection.instance.d.ts} +8 -8
  227. package/lib/ngrx/index.d.ts +1 -0
  228. package/lib/ngrx/store.lockset.d.ts +36 -0
  229. package/lib/pipe/index.d.ts +2 -0
  230. package/lib/pipe/misc/index.d.ts +2 -0
  231. package/lib/pipe/misc/misc.pipe.module.d.ts +7 -0
  232. package/lib/pipe/misc/prettyjson.pipe.d.ts +9 -0
  233. package/lib/pipe/pipe.module.d.ts +8 -0
  234. package/lib/router/anchor/anchor.d.ts +5 -1
  235. package/lib/router/anchor/anchor.directive.d.ts +10 -2
  236. package/lib/router/router/provider/angular/angular.router.service.d.ts +7 -5
  237. package/lib/router/router/provider/uirouter/uirouter.router.service.d.ts +11 -5
  238. package/lib/router/router/service/index.d.ts +1 -0
  239. package/lib/router/router/service/router.go.d.ts +14 -0
  240. package/lib/router/router/service/router.service.d.ts +10 -4
  241. package/lib/router/router/transition/transition.directive.d.ts +2 -2
  242. package/lib/router/router/transition/transition.watcher.directive.d.ts +1 -1
  243. package/lib/router/segue.d.ts +10 -3
  244. package/lib/util/view.d.ts +12 -0
  245. package/lib/view/if.directive.d.ts +19 -0
  246. package/lib/view/index.d.ts +1 -0
  247. package/package.json +7 -18
  248. package/esm2020/lib/action/directive/auto/action.autotrigger.value.directive.mjs +0 -79
  249. package/esm2020/lib/action/directive/state/action.disabled.modified.directive.mjs +0 -35
  250. package/esm2020/lib/action/directive/state/action.success.component.mjs +0 -50
  251. package/esm2020/lib/action/snackbar/index.mjs +0 -3
  252. package/esm2020/lib/action/snackbar/snackbar.mjs +0 -24
  253. package/esm2020/lib/injected/index.mjs +0 -6
  254. package/esm2020/lib/injected/injected.component.mjs +0 -34
  255. package/esm2020/lib/injected/injected.component.module.mjs +0 -26
  256. package/esm2020/lib/injected/injected.directive.mjs +0 -33
  257. package/esm2020/lib/injected/injected.instance.mjs +0 -116
  258. package/esm2020/lib/injected/injected.mjs +0 -16
  259. package/lib/action/directive/auto/action.autotrigger.value.directive.d.ts +0 -25
  260. package/lib/action/directive/state/action.disabled.modified.directive.d.ts +0 -16
  261. package/lib/action/directive/state/action.success.component.d.ts +0 -15
  262. package/lib/action/snackbar/index.d.ts +0 -1
  263. package/lib/action/snackbar/snackbar.d.ts +0 -50
  264. package/lib/injected/index.d.ts +0 -5
  265. package/lib/injected/injected.component.d.ts +0 -15
  266. package/lib/injected/injected.component.module.d.ts +0 -8
  267. package/lib/injected/injected.directive.d.ts +0 -19
@@ -1,22 +1,25 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Directive, forwardRef, Host, Input, Injectable, Optional, Component, NgModule, EventEmitter, Output, LOCALE_ID, Pipe, Inject, ViewChild, InjectionToken, Injector, ViewContainerRef } from '@angular/core';
3
- import * as i1$3 from '@dereekb/rxjs';
4
- import { SubscriptionObject, LockSet, filterMaybe, scanCount, combineLatestFromMapValuesObsFn, skipFirstMaybe, FilterSourceInstance, FilterSource, FilterSourceConnector, FilterMap } from '@dereekb/rxjs';
2
+ import { Directive, Injectable, forwardRef, Host, Input, Optional, NgModule, InjectionToken, Inject, EventEmitter, Output, LOCALE_ID, Pipe, ViewChild, Injector, ViewContainerRef, Component } from '@angular/core';
3
+ import * as i1$5 from '@dereekb/rxjs';
4
+ import { SubscriptionObject, LockSet, filterMaybe, LoadingStateType, beginLoading, idleLoadingState, errorResult, successResult, scanCount, combineLatestFromMapValuesObsFn, workFactory, emitDelayObs, asObservable, returnIfIs, skipFirstMaybe, onFalseToTrue, onTrueToFalse, setContainsAllValuesFrom, FilterSourceInstance, FilterSource, FilterSourceConnector, FilterMap } from '@dereekb/rxjs';
5
5
  import * as i1 from 'rxjs';
6
- import { BehaviorSubject, combineLatest, Subject, interval, EMPTY, of, isObservable, delay as delay$1, filter as filter$1, startWith as startWith$1, switchMap as switchMap$1, shareReplay as shareReplay$1, first as first$1, Observable, tap as tap$1 } from 'rxjs';
7
- import { switchMap, first, distinctUntilChanged, filter, debounce, throttle, exhaustMap, mergeMap, map, shareReplay, withLatestFrom, startWith, tap, delay } from 'rxjs/operators';
8
- import * as i1$4 from '@dereekb/util';
9
- import { hasValueOrNotEmpty, BooleanStringKeyArrayUtilityInstance, reduceBooleansWithOrFn, getValueFromObjectOrGetter, expandTreeFunction, flattenTreeToArrayFunction, expandFlattenTreeFunction, mergeArrayIntoArray, objectFlatMergeMatrix, mergeArrays, filterMaybeValues, mergeObjects, mergeArrayOrValueIntoArray, DataIsExpiredError, DataDoesNotExistError, filterMaybeValuesFn, StorageObjectUtility, SHARED_MEMORY_STORAGE } from '@dereekb/util';
6
+ import { BehaviorSubject, combineLatest, Subject, interval, EMPTY, of, distinctUntilChanged as distinctUntilChanged$1, exhaustMap as exhaustMap$1, shareReplay as shareReplay$1, delay, switchMap as switchMap$1, map as map$1, catchError, first as first$1, firstValueFrom, filter as filter$1, takeUntil, startWith as startWith$1, tap as tap$1, Observable } from 'rxjs';
7
+ import { switchMap, first, distinctUntilChanged, filter, debounce, throttle, exhaustMap, mergeMap, map, shareReplay, withLatestFrom, startWith, tap, delay as delay$1 } from 'rxjs/operators';
8
+ import * as i1$6 from '@dereekb/util';
9
+ import { isDefinedAndNotFalse, hasValueOrNotEmpty, BooleanStringKeyArrayUtilityInstance, reduceBooleansWithOrFn, getValueFromGetter, isGetter, setIncludesFunction, maybeSet, isAllowed, expandTreeFunction, flattenTreeToArrayFunction, expandFlattenTreeFunction, mergeArrayIntoArray, objectFlatMergeMatrix, mergeArrays, filterMaybeValues, mergeObjects, mergeArrayOrValueIntoArray, makePromiseFullRef, DataIsExpiredError, DataDoesNotExistError, filterMaybeValuesFn, StorageObjectUtility, SHARED_MEMORY_STORAGE } from '@dereekb/util';
10
10
  import { ComponentStore } from '@ngrx/component-store';
11
- import * as i2 from '@angular/common';
12
11
  import { CommonModule, formatDate } from '@angular/common';
13
- import ms from 'ms';
12
+ import * as i1$3 from '@ngrx/effects';
13
+ import { ofType, createEffect, EffectsModule } from '@ngrx/effects';
14
+ import * as i1$4 from '@ngrx/store';
15
+ import { createAction, props, createReducer, on, combineReducers, createFeatureSelector, createSelector, StoreModule } from '@ngrx/store';
14
16
  import * as i1$1 from '@angular/router';
15
17
  import { NavigationStart, NavigationEnd } from '@angular/router';
16
18
  import { isArray } from 'class-validator';
17
19
  import * as i1$2 from '@uirouter/core';
18
- import { addMinutes, isPast, formatDistance, isValid, formatDistanceToNow, startOfDay, isSameDay } from 'date-fns';
20
+ import { addMinutes, isValid, isPast, formatDistance, formatDistanceToNow, startOfDay, isSameDay } from 'date-fns';
19
21
  import { toJsDate, formatToTimeString, unixTimeNumberForNow, timeHasExpired } from '@dereekb/date';
22
+ import { __awaiter } from 'tslib';
20
23
 
21
24
  /**
22
25
  * Abstract component that contains a SubscriptionObject and will clean it up automatically.
@@ -33,9 +36,9 @@ class AbstractSubscriptionDirective {
33
36
  this._subscriptionObject.subscription = subscription;
34
37
  }
35
38
  }
36
- AbstractSubscriptionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractSubscriptionDirective, deps: [{ token: i1.Subscription }], target: i0.ɵɵFactoryTarget.Directive });
37
- AbstractSubscriptionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractSubscriptionDirective, ngImport: i0 });
38
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractSubscriptionDirective, decorators: [{
39
+ AbstractSubscriptionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractSubscriptionDirective, deps: [{ token: i1.Subscription }], target: i0.ɵɵFactoryTarget.Directive });
40
+ AbstractSubscriptionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractSubscriptionDirective, ngImport: i0 });
41
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractSubscriptionDirective, decorators: [{
39
42
  type: Directive
40
43
  }], ctorParameters: function () { return [{ type: i1.Subscription }]; } });
41
44
  /**
@@ -53,9 +56,9 @@ class AbstractLockSetSubscriptionDirective extends AbstractSubscriptionDirective
53
56
  super.ngOnDestroy();
54
57
  }
55
58
  }
56
- AbstractLockSetSubscriptionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractLockSetSubscriptionDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
57
- AbstractLockSetSubscriptionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractLockSetSubscriptionDirective, usesInheritance: true, ngImport: i0 });
58
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractLockSetSubscriptionDirective, decorators: [{
59
+ AbstractLockSetSubscriptionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractLockSetSubscriptionDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
60
+ AbstractLockSetSubscriptionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractLockSetSubscriptionDirective, usesInheritance: true, ngImport: i0 });
61
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractLockSetSubscriptionDirective, decorators: [{
59
62
  type: Directive
60
63
  }] });
61
64
 
@@ -81,8 +84,10 @@ function pipeActionStore(source, pipeFn) {
81
84
  function useActionStore(source, useFn) {
82
85
  return source.store$.pipe(first()).subscribe(useFn);
83
86
  }
84
- // tslint:disable-next-line: directive-class-suffix
85
- class ActionContextStoreSourceInstance {
87
+ /**
88
+ * Service that wraps a ActionContextStoreSource.
89
+ */
90
+ class DbxActionContextStoreSourceInstance {
86
91
  constructor(source) {
87
92
  this.source = source;
88
93
  this.lockSet = new LockSet();
@@ -124,6 +129,9 @@ class ActionContextStoreSourceInstance {
124
129
  get isModified$() {
125
130
  return this.pipeStore(x => x.isModified$);
126
131
  }
132
+ get canTrigger$() {
133
+ return this.pipeStore(x => x.canTrigger$);
134
+ }
127
135
  get isModifiedAndCanTriggerUpdates$() {
128
136
  return this.pipeStore(x => x.isModifiedAndCanTriggerUpdates$);
129
137
  }
@@ -133,12 +141,21 @@ class ActionContextStoreSourceInstance {
133
141
  get actionState$() {
134
142
  return this.pipeStore(x => x.actionState$);
135
143
  }
144
+ get loadingState$() {
145
+ return this.pipeStore(x => x.loadingState$);
146
+ }
147
+ get loadingStateType$() {
148
+ return this.pipeStore(x => x.loadingStateType$);
149
+ }
136
150
  get isWorking$() {
137
151
  return this.pipeStore(x => x.isWorking$);
138
152
  }
139
153
  get isSuccess$() {
140
154
  return this.pipeStore(x => x.isSuccess$);
141
155
  }
156
+ get disabledKeys$() {
157
+ return this.pipeStore(x => x.disabledKeys$);
158
+ }
142
159
  get isDisabled$() {
143
160
  return this.pipeStore(x => x.isDisabled$);
144
161
  }
@@ -166,23 +183,23 @@ class ActionContextStoreSourceInstance {
166
183
  reject(error) {
167
184
  this.useStore((x) => x.reject(error));
168
185
  }
169
- success(value) {
170
- this.useStore((x) => x.success(value));
186
+ resolve(value) {
187
+ this.useStore((x) => x.resolve(value));
171
188
  }
172
189
  reset() {
173
190
  this.useStore((x) => x.reset());
174
191
  }
175
192
  }
176
- ActionContextStoreSourceInstance.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: ActionContextStoreSourceInstance, deps: [{ token: ActionContextStoreSource }], target: i0.ɵɵFactoryTarget.Directive });
177
- ActionContextStoreSourceInstancedir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: ActionContextStoreSourceInstance, ngImport: i0 });
178
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: ActionContextStoreSourceInstance, decorators: [{
179
- type: Directive
193
+ DbxActionContextStoreSourceInstance.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionContextStoreSourceInstance, deps: [{ token: ActionContextStoreSource }], target: i0.ɵɵFactoryTarget.Injectable });
194
+ DbxActionContextStoreSourceInstanceprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionContextStoreSourceInstance });
195
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionContextStoreSourceInstance, decorators: [{
196
+ type: Injectable
180
197
  }], ctorParameters: function () { return [{ type: ActionContextStoreSource }]; } });
181
198
  const actionContextStoreSourceInstanceFactory = (source) => {
182
- return new ActionContextStoreSourceInstance(source);
199
+ return new DbxActionContextStoreSourceInstance(source);
183
200
  };
184
201
  /**
185
- * Provides an ActionContextStoreSource, as well as an ActionContextStoreSourceInstance.
202
+ * Provides an ActionContextStoreSource, as well as an DbxActionContextStoreSourceInstance.
186
203
  */
187
204
  function ProvideActionStoreSource(sourceType) {
188
205
  return [{
@@ -190,7 +207,7 @@ function ProvideActionStoreSource(sourceType) {
190
207
  useExisting: forwardRef(() => sourceType)
191
208
  },
192
209
  {
193
- provide: ActionContextStoreSourceInstance,
210
+ provide: DbxActionContextStoreSourceInstance,
194
211
  useFactory: actionContextStoreSourceInstanceFactory,
195
212
  deps: [ActionContextStoreSource]
196
213
  }];
@@ -214,7 +231,7 @@ class DbxActionAutoModifyDirective extends AbstractSubscriptionDirective {
214
231
  return this._autoModifyEnabled.value;
215
232
  }
216
233
  set autoModifyEnabled(autoModifyEnabled) {
217
- this._autoModifyEnabled.next(autoModifyEnabled !== 'false');
234
+ this._autoModifyEnabled.next(autoModifyEnabled !== false);
218
235
  }
219
236
  ngOnInit() {
220
237
  const obs = combineLatest([
@@ -234,15 +251,15 @@ class DbxActionAutoModifyDirective extends AbstractSubscriptionDirective {
234
251
  });
235
252
  }
236
253
  }
237
- DbxActionAutoModifyDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionAutoModifyDirective, deps: [{ token: ActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
238
- DbxActionAutoModifyDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionAutoModifyDirective, selector: "[dbxActionAutoModify]", inputs: { autoModifyEnabled: ["dbxActionAutoModify", "autoModifyEnabled"] }, usesInheritance: true, ngImport: i0 });
239
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionAutoModifyDirective, decorators: [{
254
+ DbxActionAutoModifyDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionAutoModifyDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
255
+ DbxActionAutoModifyDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionAutoModifyDirective, selector: "[dbxActionAutoModify]", inputs: { autoModifyEnabled: ["dbxActionAutoModify", "autoModifyEnabled"] }, usesInheritance: true, ngImport: i0 });
256
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionAutoModifyDirective, decorators: [{
240
257
  type: Directive,
241
258
  args: [{
242
259
  selector: '[dbxActionAutoModify]',
243
260
  }]
244
261
  }], ctorParameters: function () {
245
- return [{ type: ActionContextStoreSourceInstance, decorators: [{
262
+ return [{ type: DbxActionContextStoreSourceInstance, decorators: [{
246
263
  type: Host
247
264
  }] }];
248
265
  }, propDecorators: { autoModifyEnabled: [{
@@ -255,19 +272,19 @@ const DEFAULT_THROTTLE_MS = 10 * 1000;
255
272
  const DEFAULT_ERROR_THROTTLE_MS = 3 * 1000;
256
273
  const MAX_ERRORS_TO_THROTTLE_ON = 6;
257
274
  /**
258
- * Extension of DbxActionTransitionSafetyDirective that automatically triggers the action periodically when it is in a modified state.
275
+ * Directive that automatically triggers the action periodically when it is in a modified state.
259
276
  */
260
277
  class DbxActionAutoTriggerDirective extends AbstractSubscriptionDirective {
261
278
  constructor(source) {
262
279
  super();
263
280
  this.source = source;
264
281
  this._triggerEnabled = new BehaviorSubject(true);
282
+ this._triggerLimit = new BehaviorSubject(undefined);
283
+ this._trigger = new Subject();
265
284
  this.triggerDebounce = DEFAULT_DEBOUNCE_MS;
266
285
  this.triggerThrottle = DEFAULT_THROTTLE_MS;
267
286
  this.triggerErrorThrottle = DEFAULT_ERROR_THROTTLE_MS;
268
287
  this.maxErrorsForThrottle = MAX_ERRORS_TO_THROTTLE_ON;
269
- this._triggerLimit = new BehaviorSubject(undefined);
270
- this._trigger = new Subject();
271
288
  this._triggerCount = 0;
272
289
  this._errorCount$ = this.source.errorCountSinceLastSuccess$;
273
290
  this._triggerCount$ = this.source.isModifiedAndCanTriggerUpdates$.pipe(filter(() => this.isEnabled), filter((x) => x), debounce(() => interval(this.triggerDebounce)), throttle(() => this._errorCount$.pipe(first(), exhaustMap((count) => interval(this.triggerThrottle + (Math.min(count, this.maxErrorsForThrottle) * this.triggerErrorThrottle)))), { leading: true, trailing: true }),
@@ -307,7 +324,7 @@ class DbxActionAutoTriggerDirective extends AbstractSubscriptionDirective {
307
324
  * Used in forms that are simple.
308
325
  */
309
326
  set fastTrigger(fastTrigger) {
310
- if (fastTrigger) {
327
+ if (isDefinedAndNotFalse(fastTrigger)) {
311
328
  this.triggerDebounce = 200;
312
329
  this.triggerThrottle = 500;
313
330
  }
@@ -318,7 +335,7 @@ class DbxActionAutoTriggerDirective extends AbstractSubscriptionDirective {
318
335
  * Used in forms that generally return a single value.
319
336
  */
320
337
  set instantTrigger(instantTrigger) {
321
- if (instantTrigger) {
338
+ if (isDefinedAndNotFalse(instantTrigger)) {
322
339
  this.triggerDebounce = 10;
323
340
  this.triggerThrottle = 0;
324
341
  }
@@ -341,20 +358,21 @@ class DbxActionAutoTriggerDirective extends AbstractSubscriptionDirective {
341
358
  ngOnDestroy() {
342
359
  this.source.lockSet.onNextUnlock(() => {
343
360
  super.ngOnDestroy();
361
+ this._triggerEnabled.complete();
344
362
  this._trigger.complete();
345
363
  this._triggerLimit.complete();
346
364
  });
347
365
  }
348
366
  }
349
- DbxActionAutoTriggerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionAutoTriggerDirective, deps: [{ token: ActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
350
- DbxActionAutoTriggerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionAutoTriggerDirective, selector: "dbxActionAutoTrigger, [dbxActionAutoTrigger]", inputs: { triggerEnabled: ["dbxActionAutoTrigger", "triggerEnabled"], triggerDebounce: "triggerDebounce", triggerThrottle: "triggerThrottle", triggerErrorThrottle: "triggerErrorThrottle", fastTrigger: "fastTrigger", instantTrigger: "instantTrigger", triggerLimit: "triggerLimit" }, usesInheritance: true, ngImport: i0 });
351
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionAutoTriggerDirective, decorators: [{
367
+ DbxActionAutoTriggerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionAutoTriggerDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
368
+ DbxActionAutoTriggerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionAutoTriggerDirective, selector: "dbxActionAutoTrigger, [dbxActionAutoTrigger]", inputs: { triggerEnabled: ["dbxActionAutoTrigger", "triggerEnabled"], triggerDebounce: "triggerDebounce", triggerThrottle: "triggerThrottle", triggerErrorThrottle: "triggerErrorThrottle", fastTrigger: "fastTrigger", instantTrigger: "instantTrigger", triggerLimit: "triggerLimit" }, usesInheritance: true, ngImport: i0 });
369
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionAutoTriggerDirective, decorators: [{
352
370
  type: Directive,
353
371
  args: [{
354
372
  selector: 'dbxActionAutoTrigger, [dbxActionAutoTrigger]',
355
373
  }]
356
374
  }], ctorParameters: function () {
357
- return [{ type: ActionContextStoreSourceInstance, decorators: [{
375
+ return [{ type: DbxActionContextStoreSourceInstance, decorators: [{
358
376
  type: Host
359
377
  }] }];
360
378
  }, propDecorators: { triggerEnabled: [{
@@ -375,19 +393,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
375
393
  }] } });
376
394
 
377
395
  /**
378
- * Directive that watches an observable for changes and sets the new value and modified states as necessary.
396
+ * Directive that watches a value observable for changes and sets the new value and modified states as necessary.
379
397
  */
380
- class DbxActionAutoTriggerValueDirective {
398
+ class dbxActionValueStreamDirective {
381
399
  constructor(source) {
382
400
  this.source = source;
383
401
  this._valueObs = new BehaviorSubject(EMPTY);
384
402
  this._isModifiedFn = new BehaviorSubject(undefined);
385
403
  this._modifiedSub = new SubscriptionObject();
386
404
  this._triggerSub = new SubscriptionObject();
387
- this.modifiedValue$ = this._valueObs.pipe(switchMap((obs) => obs.pipe(withLatestFrom(this._isModifiedFn), mergeMap(([value, dbxActionAutoTriggerModified]) => {
405
+ this.modifiedValue$ = this._valueObs.pipe(switchMap((obs) => obs.pipe(withLatestFrom(this._isModifiedFn), mergeMap(([value, dbxActionValueStreamModified]) => {
388
406
  let result;
389
- if (dbxActionAutoTriggerModified) {
390
- result = dbxActionAutoTriggerModified(value).pipe(map((isModified) => [isModified, value]));
407
+ if (dbxActionValueStreamModified) {
408
+ result = dbxActionValueStreamModified(value).pipe(map((isModified) => [isModified, value]));
391
409
  }
392
410
  else {
393
411
  result = of([true, value]);
@@ -395,18 +413,18 @@ class DbxActionAutoTriggerValueDirective {
395
413
  return result;
396
414
  }), shareReplay(1))));
397
415
  }
398
- set dbxActionAutoTriggerValue(dbxActionAutoTriggerValue) {
399
- this._valueObs.next(dbxActionAutoTriggerValue);
416
+ set dbxActionValueStream(dbxActionValueStream) {
417
+ this._valueObs.next(dbxActionValueStream);
400
418
  }
401
- set dbxActionAutoTriggerModifiedNonEmptyValue(requireNonEmpty) {
402
- if (requireNonEmpty) {
403
- this.dbxActionAutoTriggerModified = (value) => {
419
+ set dbxActionValueStreamIsNotEmpty(requireNonEmpty) {
420
+ if (isDefinedAndNotFalse(requireNonEmpty)) {
421
+ this.dbxActionValueStreamModified = (value) => {
404
422
  return of(hasValueOrNotEmpty(value));
405
423
  };
406
424
  }
407
425
  }
408
- set dbxActionAutoTriggerModified(dbxActionAutoTriggerModified) {
409
- this._isModifiedFn.next(dbxActionAutoTriggerModified);
426
+ set dbxActionValueStreamModified(dbxActionValueStreamModified) {
427
+ this._isModifiedFn.next(dbxActionValueStreamModified);
410
428
  }
411
429
  ngOnInit() {
412
430
  // Update Modified value.
@@ -414,89 +432,109 @@ class DbxActionAutoTriggerValueDirective {
414
432
  this.source.setIsModified(isModified);
415
433
  });
416
434
  // Set the value on triggers.
417
- this._triggerSub.subscription = this.source.triggered$.pipe(mergeMap(x => this.modifiedValue$)).subscribe(([isModified, value]) => {
418
- this.source.readyValue(value);
435
+ this._triggerSub.subscription = this.source.triggered$.pipe(switchMap(_ => this.modifiedValue$)).subscribe(([isModified, value]) => {
436
+ if (isModified) {
437
+ this.source.readyValue(value);
438
+ }
419
439
  });
420
440
  }
421
441
  ngOnDestroy() {
422
442
  this.source.lockSet.onNextUnlock(() => {
423
- this._isModifiedFn.complete();
424
443
  this._valueObs.complete();
444
+ this._isModifiedFn.complete();
425
445
  this._modifiedSub.destroy();
426
446
  this._triggerSub.destroy();
427
447
  });
428
448
  }
429
449
  }
430
- DbxActionAutoTriggerValueDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionAutoTriggerValueDirective, deps: [{ token: ActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
431
- DbxActionAutoTriggerValueDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionAutoTriggerValueDirective, selector: "[dbxActionAutoTriggerValue]", inputs: { dbxActionAutoTriggerValue: "dbxActionAutoTriggerValue", dbxActionAutoTriggerModifiedNonEmptyValue: "dbxActionAutoTriggerModifiedNonEmptyValue", dbxActionAutoTriggerModified: "dbxActionAutoTriggerModified" }, ngImport: i0 });
432
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionAutoTriggerValueDirective, decorators: [{
450
+ dbxActionValueStreamDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: dbxActionValueStreamDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
451
+ dbxActionValueStreamDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: dbxActionValueStreamDirective, selector: "[dbxActionValueStream]", inputs: { dbxActionValueStream: "dbxActionValueStream", dbxActionValueStreamIsNotEmpty: "dbxActionValueStreamIsNotEmpty", dbxActionValueStreamModified: "dbxActionValueStreamModified" }, ngImport: i0 });
452
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: dbxActionValueStreamDirective, decorators: [{
433
453
  type: Directive,
434
454
  args: [{
435
- selector: '[dbxActionAutoTriggerValue]',
455
+ selector: '[dbxActionValueStream]',
436
456
  }]
437
457
  }], ctorParameters: function () {
438
- return [{ type: ActionContextStoreSourceInstance, decorators: [{
458
+ return [{ type: DbxActionContextStoreSourceInstance, decorators: [{
439
459
  type: Host
440
460
  }] }];
441
- }, propDecorators: { dbxActionAutoTriggerValue: [{
442
- type: Input,
443
- args: ['dbxActionAutoTriggerValue']
444
- }], dbxActionAutoTriggerModifiedNonEmptyValue: [{
461
+ }, propDecorators: { dbxActionValueStream: [{
462
+ type: Input
463
+ }], dbxActionValueStreamIsNotEmpty: [{
445
464
  type: Input
446
- }], dbxActionAutoTriggerModified: [{
465
+ }], dbxActionValueStreamModified: [{
447
466
  type: Input
448
467
  }] } });
449
468
 
450
469
  /**
451
470
  * Used by ActionContextState to denote what state the action is in.
452
471
  */
453
- var ActionState;
454
- (function (ActionState) {
472
+ var DbxActionState;
473
+ (function (DbxActionState) {
455
474
  /**
456
475
  * No action in progress. Waiting for the trigger.
457
476
  */
458
- ActionState["Idle"] = "idle";
477
+ DbxActionState["IDLE"] = "idle";
459
478
  /**
460
479
  * Idle state that can be set to show that the source is not yet ready.
461
480
  */
462
- ActionState["Disabled"] = "disabled";
481
+ DbxActionState["DISABLED"] = "disabled";
463
482
  /**
464
483
  * The action was triggered. We wait (and allow) the value to be updated.
465
484
  */
466
- ActionState["Triggered"] = "triggered";
485
+ DbxActionState["TRIGGERED"] = "triggered";
467
486
  /**
468
487
  * The trigger was accepted and the value is updated. It should begin working immediately.
469
488
  *
470
489
  * ValueReady cannot be set until triggered is set.
471
490
  */
472
- ActionState["ValueReady"] = "valueReady";
491
+ DbxActionState["VALUE_READY"] = "valueReady";
473
492
  /**
474
493
  * The action is in progress.
475
494
  */
476
- ActionState["Working"] = "working";
495
+ DbxActionState["WORKING"] = "working";
477
496
  /**
478
497
  * The trigger, action, or value was rejected due to an error or other issue.
479
498
  *
480
499
  * An error may be specified optionally.
481
500
  */
482
- ActionState["Rejected"] = "rejected";
501
+ DbxActionState["REJECTED"] = "rejected";
483
502
  /**
484
- * The action was successful.
503
+ * The action resolved without issue.
485
504
  */
486
- ActionState["Success"] = "success";
487
- })(ActionState || (ActionState = {}));
488
- const DEFAULT_ACTION_DISABLED_KEY = 'default';
505
+ DbxActionState["RESOLVED"] = "resolved";
506
+ })(DbxActionState || (DbxActionState = {}));
507
+ const DEFAULT_ACTION_DISABLED_KEY = 'dbx_action_disabled';
489
508
  function isIdleActionState(actionState) {
490
509
  switch (actionState) {
491
- case ActionState.Idle:
492
- case ActionState.Disabled:
493
- case ActionState.Rejected:
494
- case ActionState.Success:
510
+ case DbxActionState.IDLE:
511
+ case DbxActionState.DISABLED:
512
+ case DbxActionState.REJECTED:
513
+ case DbxActionState.RESOLVED:
495
514
  return true;
496
515
  default:
497
516
  return false;
498
517
  }
499
518
  }
519
+ function loadingStateTypeForActionState(actionState) {
520
+ let loadingStateType;
521
+ switch (actionState) {
522
+ case DbxActionState.RESOLVED:
523
+ loadingStateType = LoadingStateType.SUCCESS;
524
+ break;
525
+ case DbxActionState.REJECTED:
526
+ loadingStateType = LoadingStateType.ERROR;
527
+ break;
528
+ case DbxActionState.IDLE:
529
+ case DbxActionState.DISABLED:
530
+ loadingStateType = LoadingStateType.IDLE;
531
+ break;
532
+ default:
533
+ loadingStateType = LoadingStateType.LOADING;
534
+ break;
535
+ }
536
+ return loadingStateType;
537
+ }
500
538
 
501
539
  function isActionContextEnabled(state) {
502
540
  return BooleanStringKeyArrayUtilityInstance.isFalse(state.disabled);
@@ -511,13 +549,13 @@ function isWorkingActionState(actionState) {
511
549
  return !isIdleActionState(actionState);
512
550
  }
513
551
  function canTriggerActionState(actionState) {
514
- return actionState !== ActionState.Disabled && isIdleActionState(actionState);
552
+ return actionState !== DbxActionState.DISABLED && isIdleActionState(actionState);
515
553
  }
516
554
  function canTriggerAction(state) {
517
555
  return isActionContextEnabled(state) && isIdleActionState(state.actionState);
518
556
  }
519
557
  function canReadyValue(state) {
520
- return state.actionState === ActionState.Triggered;
558
+ return state.actionState === DbxActionState.TRIGGERED;
521
559
  }
522
560
  function actionContextIsModifiedAndCanTrigger(state) {
523
561
  // console.log('check: ', state, state.isModified, canTriggerAction(state));
@@ -526,20 +564,42 @@ function actionContextIsModifiedAndCanTrigger(state) {
526
564
  function actionContextHasNoErrorAndIsModifiedAndCanTrigger(state) {
527
565
  return !state.error && actionContextIsModifiedAndCanTrigger(state);
528
566
  }
567
+ function loadingStateForActionContextState(state) {
568
+ let loadingState;
569
+ switch (state.actionState) {
570
+ case DbxActionState.RESOLVED:
571
+ loadingState = successResult(state.result);
572
+ break;
573
+ case DbxActionState.REJECTED:
574
+ loadingState = errorResult(state.error);
575
+ break;
576
+ case DbxActionState.IDLE:
577
+ case DbxActionState.DISABLED:
578
+ loadingState = idleLoadingState();
579
+ break;
580
+ default:
581
+ loadingState = beginLoading();
582
+ break;
583
+ }
584
+ return loadingState;
585
+ }
586
+ function loadingStateTypeForActionContextState(state) {
587
+ return loadingStateTypeForActionState(state.actionState);
588
+ }
529
589
  const INITIAL_STATE = {
530
590
  isModified: false,
531
- actionState: ActionState.Idle
591
+ actionState: DbxActionState.IDLE
532
592
  };
533
593
  class ActionContextStore extends ComponentStore {
534
594
  constructor() {
535
595
  super(Object.assign({}, INITIAL_STATE));
536
596
  this.lockSet = new LockSet();
537
597
  // MARK: Accessors
538
- this.actionState$ = this.state$.pipe(map(x => isDisabledActionContextState(x) ? ActionState.Disabled : x.actionState), shareReplay(1));
598
+ this.actionState$ = this.state$.pipe(map(x => isDisabledActionContextState(x) ? DbxActionState.DISABLED : x.actionState), shareReplay(1));
539
599
  /**
540
- * Returns the current disabled reasons.
600
+ * Returns the current disabled reasons/keys.
541
601
  */
542
- this.disabled$ = this.state$.pipe(map(x => { var _a; return [...(_a = x.disabled) !== null && _a !== void 0 ? _a : []]; }), distinctUntilChanged(), shareReplay(1));
602
+ this.disabledKeys$ = this.state$.pipe(map(x => { var _a; return [...(_a = x.disabled) !== null && _a !== void 0 ? _a : []]; }), distinctUntilChanged(), shareReplay(1));
543
603
  /**
544
604
  * Maps the current state to true or not when the action state changes to/from disabled.
545
605
  */
@@ -551,19 +611,19 @@ class ActionContextStore extends ComponentStore {
551
611
  /**
552
612
  * Pipes true when triggered.
553
613
  */
554
- this.triggered$ = this.afterDistinctActionState(ActionState.Triggered, () => true);
614
+ this.triggered$ = this.afterDistinctActionState(DbxActionState.TRIGGERED, () => true);
555
615
  /**
556
616
  * Pipes the readied value on ValueReady.
557
617
  */
558
- this.valueReady$ = this.afterDistinctActionState(ActionState.ValueReady, x => x.value);
618
+ this.valueReady$ = this.afterDistinctActionState(DbxActionState.VALUE_READY, x => x.value);
559
619
  /**
560
620
  * Pipes the error on the rejection state.
561
621
  */
562
- this.rejected$ = this.afterDistinctActionState(ActionState.Rejected, x => x.error);
622
+ this.rejected$ = this.afterDistinctActionState(DbxActionState.REJECTED, x => x.error);
563
623
  /**
564
624
  * Pipes the result when the ActionState becomes working.
565
625
  */
566
- this.working$ = this.afterDistinctActionState(ActionState.Working, () => true);
626
+ this.working$ = this.afterDistinctActionState(DbxActionState.WORKING, () => true);
567
627
  /**
568
628
  * Whether or not it is currently in a working state.
569
629
  */
@@ -575,11 +635,19 @@ class ActionContextStore extends ComponentStore {
575
635
  /**
576
636
  * Pipes the result when the ActionState becomes success.
577
637
  */
578
- this.success$ = this.afterDistinctActionState(ActionState.Success, x => x.result);
638
+ this.success$ = this.afterDistinctActionState(DbxActionState.RESOLVED, x => x.result);
579
639
  /**
580
640
  * Whether or not it is currently in a success state.
581
641
  */
582
- this.isSuccess$ = this.afterDistinctBoolean(x => x.actionState === ActionState.Success);
642
+ this.isSuccess$ = this.afterDistinctBoolean(x => x.actionState === DbxActionState.RESOLVED);
643
+ /**
644
+ * Returns a loading state based on the current state.
645
+ */
646
+ this.loadingState$ = this.afterDistinctLoadingStateTypeChange().pipe(map(x => loadingStateForActionContextState(x)), shareReplay(1));
647
+ /**
648
+ * Returns the current LoadingStateType based on the current state.
649
+ */
650
+ this.loadingStateType$ = this.state$.pipe(map(x => loadingStateTypeForActionContextState(x)), distinctUntilChanged(), shareReplay(1));
583
651
  /**
584
652
  * Number of errors since last success.
585
653
  */
@@ -611,35 +679,35 @@ class ActionContextStore extends ComponentStore {
611
679
  /**
612
680
  * Triggers the modified state, if not disabled.
613
681
  */
614
- this.setIsModified = this.updater((state, isModified) => (Object.assign(Object.assign({}, state), { actionState: (state.actionState === ActionState.Success) ? ActionState.Idle : state.actionState, isModified: isModified !== null && isModified !== void 0 ? isModified : true })));
682
+ this.setIsModified = this.updater((state, isModified) => (Object.assign(Object.assign({}, state), { actionState: (state.actionState === DbxActionState.RESOLVED) ? DbxActionState.IDLE : state.actionState, isModified: isModified !== null && isModified !== void 0 ? isModified : true })));
615
683
  /**
616
684
  * Triggers the action if the state is currently not idle. The current state is cleared, but the error is retained (as we may need the error from the previous attempt).
617
685
  *
618
686
  * Will not fire if the action is disabled.
619
687
  */
620
688
  this.trigger = this.updater((state) => canTriggerAction(state)
621
- ? ({ isModified: state.isModified, actionState: ActionState.Triggered, error: state.error, value: undefined })
689
+ ? ({ isModified: state.isModified, actionState: DbxActionState.TRIGGERED, error: state.error, value: undefined })
622
690
  : state);
623
691
  /**
624
692
  * Updates the value, setting value ready. The current result is cleared.
625
693
  */
626
694
  this.readyValue = this.updater((state, value) => canReadyValue(state)
627
- ? (Object.assign(Object.assign({}, state), { actionState: ActionState.ValueReady, value, result: undefined }))
695
+ ? (Object.assign(Object.assign({}, state), { actionState: DbxActionState.VALUE_READY, value, result: undefined }))
628
696
  : state);
629
697
  /**
630
698
  * Notifys the context that the action is in progress.
631
699
  */
632
- this.startWorking = this.updater((state) => (Object.assign(Object.assign({}, state), { actionState: ActionState.Working })));
700
+ this.startWorking = this.updater((state) => (Object.assign(Object.assign({}, state), { actionState: DbxActionState.WORKING })));
633
701
  /**
634
702
  * Triggers rejection of the action. The value is cleared.
635
703
  */
636
- this.reject = this.updater((state, error) => { var _a; return ({ isModified: state.isModified, actionState: ActionState.Rejected, error, errorCount: ((_a = state.errorCount) !== null && _a !== void 0 ? _a : 0) + 1 }); });
704
+ this.reject = this.updater((state, error) => { var _a; return ({ isModified: state.isModified, actionState: DbxActionState.REJECTED, error, errorCount: ((_a = state.errorCount) !== null && _a !== void 0 ? _a : 0) + 1, disabled: state.disabled }); });
637
705
  /**
638
706
  * Updates the state to success, and optionally sets a result.
639
707
  *
640
708
  * Clears modified state, and any errors.
641
709
  */
642
- this.success = this.updater((state, result) => ({ isModified: false, actionState: ActionState.Success, value: state.value, result, error: undefined }));
710
+ this.resolve = this.updater((state, result) => ({ isModified: false, actionState: DbxActionState.RESOLVED, value: state.value, result, error: undefined, disabled: state.disabled }));
643
711
  /**
644
712
  * Completely resets the store.
645
713
  */
@@ -651,9 +719,16 @@ class ActionContextStore extends ComponentStore {
651
719
  return this.state$.pipe(map(x => fromState(x)), distinctUntilChanged(), shareReplay(1));
652
720
  }
653
721
  afterDistinctActionState(actionState, fromState) {
722
+ return this.afterDistinctActionStateChange().pipe(filter((x) => x.actionState === actionState), // Only pipe when the new action state matches.
723
+ map(x => fromState(x)), shareReplay(1));
724
+ }
725
+ afterDistinctActionStateChange() {
654
726
  return this.state$.pipe(map((x) => ([x, x.actionState])), distinctUntilChanged((a, b) => (a === null || a === void 0 ? void 0 : a[1]) === (b === null || b === void 0 ? void 0 : b[1])), // Filter out when the state remains the same.
655
- filter(([x, y]) => y === actionState), // Only pipe when the action state matches.
656
- map(x => fromState(x[0])), shareReplay(1));
727
+ map(x => x[0]), shareReplay(1));
728
+ }
729
+ afterDistinctLoadingStateTypeChange() {
730
+ return this.state$.pipe(map((x) => ([x, loadingStateForActionContextState(x)])), distinctUntilChanged((a, b) => (a === null || a === void 0 ? void 0 : a[1]) === (b === null || b === void 0 ? void 0 : b[1])), // Filter out when the loading state remains the same.
731
+ map(x => x[0]), shareReplay(1));
657
732
  }
658
733
  // MARK: Cleanup
659
734
  ngOnDestroy() {
@@ -663,16 +738,16 @@ class ActionContextStore extends ComponentStore {
663
738
  }, 2000);
664
739
  }
665
740
  }
666
- ActionContextStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: ActionContextStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
667
- ActionContextStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: ActionContextStore });
668
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: ActionContextStore, decorators: [{
741
+ ActionContextStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ActionContextStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
742
+ ActionContextStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ActionContextStore });
743
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ActionContextStore, decorators: [{
669
744
  type: Injectable
670
745
  }], ctorParameters: function () { return []; } });
671
746
 
672
747
  /**
673
748
  * Abstract class that can either use SecondaryActionContextStoreSource or create it's own.
674
749
  */
675
- class ActionContextBaseSource {
750
+ class DbxActionContextBaseSource {
676
751
  constructor(inputSource) {
677
752
  this.inputSource = inputSource;
678
753
  if (this.inputSource) {
@@ -682,7 +757,7 @@ class ActionContextBaseSource {
682
757
  this._store = new ActionContextStore();
683
758
  this._store$ = of(this._store);
684
759
  }
685
- this._instance = new ActionContextStoreSourceInstance(this);
760
+ this._instance = new DbxActionContextStoreSourceInstance(this);
686
761
  this.isModified$ = this._instance.isModified$;
687
762
  this.triggered$ = this._instance.triggered$;
688
763
  this.success$ = this._instance.success$;
@@ -714,12 +789,21 @@ class ActionContextBaseSource {
714
789
  reset() {
715
790
  this._instance.reset();
716
791
  }
792
+ enable(key, enable) {
793
+ this._instance.enable(key, enable);
794
+ }
795
+ disable(key, disable) {
796
+ this._instance.disable(key, disable);
797
+ }
798
+ setIsModified(isModified) {
799
+ this._instance.setIsModified(isModified);
800
+ }
717
801
  }
718
802
 
719
803
  /**
720
804
  * Provides an DbxActionContext.
721
805
  */
722
- class DbxActionDirective extends ActionContextBaseSource {
806
+ class DbxActionDirective extends DbxActionContextBaseSource {
723
807
  constructor(inputSource) {
724
808
  super(inputSource);
725
809
  }
@@ -729,13 +813,13 @@ class DbxActionDirective extends ActionContextBaseSource {
729
813
  });
730
814
  }
731
815
  }
732
- DbxActionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionDirective, deps: [{ token: SecondaryActionContextStoreSource, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
733
- DbxActionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionDirective, selector: "dbx-action,[dbxAction],dbx-action-context,[dbxActionContext]", providers: ProvideActionStoreSource(DbxActionDirective), exportAs: ["action"], usesInheritance: true, ngImport: i0 });
734
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionDirective, decorators: [{
816
+ DbxActionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionDirective, deps: [{ token: SecondaryActionContextStoreSource, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
817
+ DbxActionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionDirective, selector: "dbx-action,[dbxAction],dbx-action-context,[dbxActionContext]", providers: ProvideActionStoreSource(DbxActionDirective), exportAs: ["action", "dbxAction"], usesInheritance: true, ngImport: i0 });
818
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionDirective, decorators: [{
735
819
  type: Directive,
736
820
  args: [{
737
821
  selector: 'dbx-action,[dbxAction],dbx-action-context,[dbxActionContext]',
738
- exportAs: 'action',
822
+ exportAs: 'action,dbxAction',
739
823
  providers: ProvideActionStoreSource(DbxActionDirective)
740
824
  }]
741
825
  }], ctorParameters: function () {
@@ -767,9 +851,9 @@ class DbxActionSourceDirective {
767
851
  this._source.next(source);
768
852
  }
769
853
  }
770
- DbxActionSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionSourceDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
771
- DbxActionSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionSourceDirective, selector: "[dbxActionSource]", inputs: { source: ["dbxActionSource", "source"] }, providers: ProvideSecondaryActionStoreSource(DbxActionSourceDirective), ngImport: i0 });
772
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionSourceDirective, decorators: [{
854
+ DbxActionSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionSourceDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
855
+ DbxActionSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionSourceDirective, selector: "[dbxActionSource]", inputs: { source: ["dbxActionSource", "source"] }, providers: ProvideSecondaryActionStoreSource(DbxActionSourceDirective), ngImport: i0 });
856
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionSourceDirective, decorators: [{
773
857
  type: Directive,
774
858
  args: [{
775
859
  selector: '[dbxActionSource]',
@@ -794,15 +878,15 @@ class DbxActionContextLoggerDirective extends AbstractSubscriptionDirective {
794
878
  });
795
879
  }
796
880
  }
797
- DbxActionContextLoggerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionContextLoggerDirective, deps: [{ token: ActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
798
- DbxActionContextLoggerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionContextLoggerDirective, selector: "[dbxActionLogger],[dbxActionContextLogger]", usesInheritance: true, ngImport: i0 });
799
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionContextLoggerDirective, decorators: [{
881
+ DbxActionContextLoggerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionContextLoggerDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
882
+ DbxActionContextLoggerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionContextLoggerDirective, selector: "[dbxActionLogger],[dbxActionContextLogger]", usesInheritance: true, ngImport: i0 });
883
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionContextLoggerDirective, decorators: [{
800
884
  type: Directive,
801
885
  args: [{
802
886
  selector: '[dbxActionLogger],[dbxActionContextLogger]'
803
887
  }]
804
888
  }], ctorParameters: function () {
805
- return [{ type: ActionContextStoreSourceInstance, decorators: [{
889
+ return [{ type: DbxActionContextStoreSourceInstance, decorators: [{
806
890
  type: Host
807
891
  }] }];
808
892
  } });
@@ -854,9 +938,9 @@ class DbxActionContextMapDirective {
854
938
  return this.map$.pipe(switchMap(combineLatestFromMapValuesObsFn((x) => x.store$.pipe(switchMap(mapFn)))));
855
939
  }
856
940
  }
857
- DbxActionContextMapDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionContextMapDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
858
- DbxActionContextMapDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionContextMapDirective, selector: "[dbxActionContextMap]", providers: [], exportAs: ["actionMap"], ngImport: i0 });
859
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionContextMapDirective, decorators: [{
941
+ DbxActionContextMapDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionContextMapDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
942
+ DbxActionContextMapDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionContextMapDirective, selector: "[dbxActionContextMap]", providers: [], exportAs: ["actionMap"], ngImport: i0 });
943
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionContextMapDirective, decorators: [{
860
944
  type: Directive,
861
945
  args: [{
862
946
  selector: '[dbxActionContextMap]',
@@ -893,9 +977,9 @@ class DbxActionFromMapDirective {
893
977
  this._key.next(key);
894
978
  }
895
979
  }
896
- DbxActionFromMapDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionFromMapDirective, deps: [{ token: DbxActionContextMapDirective }], target: i0.ɵɵFactoryTarget.Directive });
897
- DbxActionFromMapDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionFromMapDirective, selector: "[dbxActionFromMap]", inputs: { key: ["dbxActionFromMap", "key"] }, providers: ProvideSecondaryActionStoreSource(DbxActionFromMapDirective), ngImport: i0 });
898
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionFromMapDirective, decorators: [{
980
+ DbxActionFromMapDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionFromMapDirective, deps: [{ token: DbxActionContextMapDirective }], target: i0.ɵɵFactoryTarget.Directive });
981
+ DbxActionFromMapDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionFromMapDirective, selector: "[dbxActionFromMap]", inputs: { key: ["dbxActionFromMap", "key"] }, providers: ProvideSecondaryActionStoreSource(DbxActionFromMapDirective), ngImport: i0 });
982
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionFromMapDirective, decorators: [{
899
983
  type: Directive,
900
984
  args: [{
901
985
  selector: '[dbxActionFromMap]',
@@ -935,9 +1019,9 @@ class DbxActionMapSourceDirective {
935
1019
  }
936
1020
  }
937
1021
  }
938
- DbxActionMapSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionMapSourceDirective, deps: [{ token: ActionContextStoreSource, host: true }, { token: DbxActionContextMapDirective }], target: i0.ɵɵFactoryTarget.Directive });
939
- DbxActionMapSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionMapSourceDirective, selector: "[dbxActionMapSource]", inputs: { key: ["dbxActionMapSource", "key"] }, ngImport: i0 });
940
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionMapSourceDirective, decorators: [{
1022
+ DbxActionMapSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionMapSourceDirective, deps: [{ token: ActionContextStoreSource, host: true }, { token: DbxActionContextMapDirective }], target: i0.ɵɵFactoryTarget.Directive });
1023
+ DbxActionMapSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionMapSourceDirective, selector: "[dbxActionMapSource]", inputs: { key: ["dbxActionMapSource", "key"] }, ngImport: i0 });
1024
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionMapSourceDirective, decorators: [{
941
1025
  type: Directive,
942
1026
  args: [{
943
1027
  selector: '[dbxActionMapSource]'
@@ -957,7 +1041,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
957
1041
  class ActionContextStoreSourceMap {
958
1042
  }
959
1043
 
960
- const DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY = '__disabled';
1044
+ const DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY = 'action_map_working_disable';
961
1045
  /**
962
1046
  * Used to communicate with an dbxActionMap and set the ActionContextStore to be disabled if any other element in the map is working.
963
1047
  */
@@ -977,15 +1061,15 @@ class DbxActionMapWorkingDisableDirective extends AbstractSubscriptionDirective
977
1061
  this.source.enable(this.disabledKey || DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY);
978
1062
  }
979
1063
  }
980
- DbxActionMapWorkingDisableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionMapWorkingDisableDirective, deps: [{ token: ActionContextStoreSourceInstance, host: true }, { token: DbxActionContextMapDirective }], target: i0.ɵɵFactoryTarget.Directive });
981
- DbxActionMapWorkingDisableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionMapWorkingDisableDirective, selector: "[dbxActionMapWorkingDisable]", inputs: { disabledKey: ["dbxActionMapWorkingDisable", "disabledKey"] }, usesInheritance: true, ngImport: i0 });
982
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionMapWorkingDisableDirective, decorators: [{
1064
+ DbxActionMapWorkingDisableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionMapWorkingDisableDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }, { token: DbxActionContextMapDirective }], target: i0.ɵɵFactoryTarget.Directive });
1065
+ DbxActionMapWorkingDisableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionMapWorkingDisableDirective, selector: "[dbxActionMapWorkingDisable]", inputs: { disabledKey: ["dbxActionMapWorkingDisable", "disabledKey"] }, usesInheritance: true, ngImport: i0 });
1066
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionMapWorkingDisableDirective, decorators: [{
983
1067
  type: Directive,
984
1068
  args: [{
985
1069
  selector: '[dbxActionMapWorkingDisable]'
986
1070
  }]
987
1071
  }], ctorParameters: function () {
988
- return [{ type: ActionContextStoreSourceInstance, decorators: [{
1072
+ return [{ type: DbxActionContextStoreSourceInstance, decorators: [{
989
1073
  type: Host
990
1074
  }] }, { type: DbxActionContextMapDirective }];
991
1075
  }, propDecorators: { disabledKey: [{
@@ -1018,18 +1102,19 @@ class DbxActionDisabledDirective extends AbstractSubscriptionDirective {
1018
1102
  return this._disabled.value;
1019
1103
  }
1020
1104
  set disabled(disabled) {
1021
- this._disabled.next(disabled);
1105
+ const disable = disabled !== false;
1106
+ this._disabled.next(disable);
1022
1107
  }
1023
1108
  }
1024
- DbxActionDisabledDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionDisabledDirective, deps: [{ token: ActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
1025
- DbxActionDisabledDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionDisabledDirective, selector: "[dbxActionDisabled]", inputs: { disabled: ["dbxActionDisabled", "disabled"] }, usesInheritance: true, ngImport: i0 });
1026
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionDisabledDirective, decorators: [{
1109
+ DbxActionDisabledDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionDisabledDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
1110
+ DbxActionDisabledDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionDisabledDirective, selector: "[dbxActionDisabled]", inputs: { disabled: ["dbxActionDisabled", "disabled"] }, usesInheritance: true, ngImport: i0 });
1111
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionDisabledDirective, decorators: [{
1027
1112
  type: Directive,
1028
1113
  args: [{
1029
1114
  selector: '[dbxActionDisabled]'
1030
1115
  }]
1031
1116
  }], ctorParameters: function () {
1032
- return [{ type: ActionContextStoreSourceInstance, decorators: [{
1117
+ return [{ type: DbxActionContextStoreSourceInstance, decorators: [{
1033
1118
  type: Host
1034
1119
  }] }];
1035
1120
  }, propDecorators: { disabled: [{
@@ -1037,42 +1122,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
1037
1122
  args: ['dbxActionDisabled']
1038
1123
  }] } });
1039
1124
 
1040
- const APP_ACTION_DISABLED_UNTIL_MODIFIED_DIRECTIVE_KEY = 'dbx_action_is_not_modified';
1041
- /**
1042
- * Directive that sets the disabled state based on the current isModified state.
1043
- */
1044
- class DbxActionDisabledUntilModifiedDirective extends AbstractSubscriptionDirective {
1045
- constructor(source) {
1046
- super();
1047
- this.source = source;
1048
- }
1049
- ngOnInit() {
1050
- this.sub = this.source.isModified$.subscribe((x) => {
1051
- this.source.disable(APP_ACTION_DISABLED_UNTIL_MODIFIED_DIRECTIVE_KEY, !x);
1052
- });
1053
- }
1054
- ngOnDestroy() {
1055
- super.ngOnDestroy();
1056
- this.source.enable(APP_ACTION_DISABLED_UNTIL_MODIFIED_DIRECTIVE_KEY);
1057
- }
1058
- }
1059
- DbxActionDisabledUntilModifiedDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionDisabledUntilModifiedDirective, deps: [{ token: ActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
1060
- DbxActionDisabledUntilModifiedDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionDisabledUntilModifiedDirective, selector: "[dbxActionDisabledUntilModified]", usesInheritance: true, ngImport: i0 });
1061
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionDisabledUntilModifiedDirective, decorators: [{
1062
- type: Directive,
1063
- args: [{
1064
- selector: '[dbxActionDisabledUntilModified]'
1065
- }]
1066
- }], ctorParameters: function () {
1067
- return [{ type: ActionContextStoreSourceInstance, decorators: [{
1068
- type: Host
1069
- }] }];
1070
- } });
1071
-
1072
1125
  /**
1073
- * WorkHandlerContextDelegate implementation using an ActionContextStoreSourceInstance.
1126
+ * WorkInstanceDelegate implementation using an DbxActionContextStoreSourceInstance.
1074
1127
  */
1075
- class WorkHandlerContextSourceDelegate {
1128
+ class DbxActionWorkInstanceDelegate {
1076
1129
  constructor(source) {
1077
1130
  this.source = source;
1078
1131
  }
@@ -1080,134 +1133,12 @@ class WorkHandlerContextSourceDelegate {
1080
1133
  this.source.startWorking();
1081
1134
  }
1082
1135
  success(result) {
1083
- this.source.success(result);
1136
+ this.source.resolve(result);
1084
1137
  }
1085
1138
  reject(error) {
1086
1139
  this.source.reject(error);
1087
1140
  }
1088
1141
  }
1089
- /**
1090
- * Used by DbxActionHandlerDirective when handling a function.
1091
- */
1092
- class WorkHandlerContext {
1093
- constructor(value, delegate) {
1094
- this.value = value;
1095
- this.delegate = delegate;
1096
- this._done = false;
1097
- this._doneActionBegan = false;
1098
- this._actionBegan = new BehaviorSubject(false);
1099
- this._isComplete = new BehaviorSubject(false);
1100
- // Schedule to cleanup self once isComplete is true.
1101
- this._isComplete.subscribe((done) => {
1102
- if (done) {
1103
- this.destroy();
1104
- }
1105
- });
1106
- }
1107
- get actionBegan() {
1108
- var _a;
1109
- return (_a = this._doneActionBegan) !== null && _a !== void 0 ? _a : this._actionBegan.value;
1110
- }
1111
- get actionBegan$() {
1112
- return this._done ? of(this._doneActionBegan) : this._actionBegan.asObservable();
1113
- }
1114
- get isComplete() {
1115
- return this._done || this._isComplete.value;
1116
- }
1117
- get isComplete$() {
1118
- return this._done ? of(true) : this._isComplete.asObservable();
1119
- }
1120
- /**
1121
- * Begins working using an observable.
1122
- */
1123
- startWorkingWithObservable(actionObs) {
1124
- this.startWorking();
1125
- actionObs.pipe(first()).subscribe((actionResult) => {
1126
- this.success(actionResult);
1127
- }, (error) => {
1128
- var _a, _b;
1129
- const message = (_b = (_a = error.message) !== null && _a !== void 0 ? _a : error.code) !== null && _b !== void 0 ? _b : undefined;
1130
- this.reject((message) ? ({ message }) : undefined);
1131
- });
1132
- }
1133
- /**
1134
- * Notifies the system that the action has begun.
1135
- */
1136
- startWorking() {
1137
- this._setWorking();
1138
- this.delegate.startWorking();
1139
- }
1140
- /**
1141
- * Sets success on the action.
1142
- */
1143
- success(result) {
1144
- this._setComplete();
1145
- this.delegate.success(result);
1146
- }
1147
- /**
1148
- * Sets rejected on the action.
1149
- */
1150
- reject(error) {
1151
- this._setComplete();
1152
- this.delegate.reject(error);
1153
- }
1154
- destroy() {
1155
- this._doneActionBegan = this.actionBegan;
1156
- this._done = true;
1157
- // Delay to prevent error.
1158
- setTimeout(() => {
1159
- this._actionBegan.complete();
1160
- this._isComplete.complete();
1161
- });
1162
- }
1163
- _setWorking() {
1164
- if (this.actionBegan) {
1165
- throw new Error('Action already has been triggered for this context.');
1166
- }
1167
- this._actionBegan.next(true);
1168
- }
1169
- _setComplete() {
1170
- if (this.isComplete) {
1171
- throw new Error('Action has already been marked as completed.');
1172
- }
1173
- this._isComplete.next(true);
1174
- }
1175
- }
1176
- /**
1177
- * Creates a function that uses a provider to always handle new values.
1178
- */
1179
- function handleWorkValueReadyWithConfigFn(providerFn) {
1180
- return (value) => {
1181
- const config = providerFn(value);
1182
- return handleWorkValueReadyFn(config)(value);
1183
- };
1184
- }
1185
- /**
1186
- * Creates a function that handles the incoming value and creates a WorkHandlerContext.
1187
- */
1188
- function handleWorkValueReadyFn({ handlerFunction, delegate }) {
1189
- return (value) => {
1190
- const handler = new WorkHandlerContext(value, delegate);
1191
- let fnResult;
1192
- try {
1193
- fnResult = handlerFunction(value, handler);
1194
- }
1195
- catch (e) {
1196
- console.error('Action encountered an unexpected error.', e);
1197
- handler.reject(e);
1198
- return;
1199
- }
1200
- if (!handler.isComplete) {
1201
- if (fnResult && isObservable(fnResult)) {
1202
- if (handler.actionBegan) {
1203
- throw new Error('Action already marked as begun from handlerFunction result. Either return an observable or use the handler directly.');
1204
- }
1205
- handler.startWorkingWithObservable(fnResult);
1206
- }
1207
- }
1208
- return handler;
1209
- };
1210
- }
1211
1142
 
1212
1143
  /**
1213
1144
  * Context used for defining a function that performs an action using the input function on ValueReady.
@@ -1218,7 +1149,7 @@ class DbxActionHandlerDirective extends AbstractSubscriptionDirective {
1218
1149
  this.source = source;
1219
1150
  this._handlerFunction = new BehaviorSubject(undefined);
1220
1151
  this.handlerFunction$ = this._handlerFunction.pipe(filterMaybe(), shareReplay(1));
1221
- this._delegate = new WorkHandlerContextSourceDelegate(this.source);
1152
+ this._delegate = new DbxActionWorkInstanceDelegate(this.source);
1222
1153
  }
1223
1154
  get handlerFunction() {
1224
1155
  return this._handlerFunction.value;
@@ -1227,29 +1158,30 @@ class DbxActionHandlerDirective extends AbstractSubscriptionDirective {
1227
1158
  this._handlerFunction.next(handlerFunction);
1228
1159
  }
1229
1160
  ngOnInit() {
1230
- this.sub = this.handlerFunction$.pipe(switchMap(handlerFunction => this.source.valueReady$.pipe(map((x) => [handlerFunction, x]), tap(([handlerFunction, value]) => {
1231
- const context = handleWorkValueReadyFn({ handlerFunction, delegate: this._delegate })(value);
1161
+ this.sub = this.handlerFunction$.pipe(switchMap(work => this.source.valueReady$.pipe(tap((value) => {
1162
+ const context = workFactory({ work, delegate: this._delegate })(value);
1232
1163
  if (context) {
1233
1164
  // Add the action to the lockSet for the source to prevent it from being destroyed until the action completes.
1234
- this.source.lockSet.addLock('actionhandler', context.isComplete$.pipe(map(x => !x)));
1165
+ this.source.lockSet.addLock('dbxActionHandler', context.isComplete$.pipe(map(x => !x)));
1235
1166
  }
1236
1167
  })))).subscribe();
1237
1168
  }
1238
1169
  ngOnDestroy() {
1239
1170
  this.source.lockSet.onNextUnlock(() => {
1240
1171
  super.ngOnDestroy();
1172
+ this._handlerFunction.complete();
1241
1173
  });
1242
1174
  }
1243
1175
  }
1244
- DbxActionHandlerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionHandlerDirective, deps: [{ token: ActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
1245
- DbxActionHandlerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionHandlerDirective, selector: "[dbxActionHandler]", inputs: { handlerFunction: ["dbxActionHandler", "handlerFunction"] }, usesInheritance: true, ngImport: i0 });
1246
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionHandlerDirective, decorators: [{
1176
+ DbxActionHandlerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionHandlerDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
1177
+ DbxActionHandlerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionHandlerDirective, selector: "[dbxActionHandler]", inputs: { handlerFunction: ["dbxActionHandler", "handlerFunction"] }, usesInheritance: true, ngImport: i0 });
1178
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionHandlerDirective, decorators: [{
1247
1179
  type: Directive,
1248
1180
  args: [{
1249
1181
  selector: '[dbxActionHandler]',
1250
1182
  }]
1251
1183
  }], ctorParameters: function () {
1252
- return [{ type: ActionContextStoreSourceInstance, decorators: [{
1184
+ return [{ type: DbxActionContextStoreSourceInstance, decorators: [{
1253
1185
  type: Host
1254
1186
  }] }];
1255
1187
  }, propDecorators: { handlerFunction: [{
@@ -1258,52 +1190,64 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
1258
1190
  }] } });
1259
1191
 
1260
1192
  /**
1261
- * Displays the input content when success is set.
1262
- *
1263
- * Can be configured to show for a limited time afterwards, etc.
1193
+ * Abstract directive class that watches a show$ observable and behaves like *ngIf.
1264
1194
  */
1265
- class DbxActionSuccessComponent {
1266
- constructor(source) {
1195
+ class AbstractIfDirective extends AbstractSubscriptionDirective {
1196
+ constructor(templateRef, viewContainer) {
1197
+ super();
1198
+ this.templateRef = templateRef;
1199
+ this.viewContainer = viewContainer;
1200
+ }
1201
+ ngOnInit() {
1202
+ this.sub = this.show$.pipe(distinctUntilChanged$1()).subscribe((show) => {
1203
+ if (show) {
1204
+ this.viewContainer.createEmbeddedView(this.templateRef);
1205
+ }
1206
+ else {
1207
+ this.viewContainer.clear();
1208
+ }
1209
+ });
1210
+ }
1211
+ }
1212
+ AbstractIfDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractIfDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
1213
+ AbstractIfDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractIfDirective, usesInheritance: true, ngImport: i0 });
1214
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractIfDirective, decorators: [{
1215
+ type: Directive
1216
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; } });
1217
+
1218
+ /**
1219
+ * Structural directive that displays the content when the store has a success value.
1220
+ */
1221
+ class DbxActionHasSuccessDirective extends AbstractIfDirective {
1222
+ constructor(templateRef, viewContainer, source) {
1223
+ super(templateRef, viewContainer);
1267
1224
  this.source = source;
1268
- this.show$ = this.source.isSuccess$.pipe(exhaustMap((success) => {
1225
+ this.show$ = this.source.isSuccess$.pipe(exhaustMap$1((success) => {
1269
1226
  if (success) {
1270
- if (this.hideAfter) {
1271
- return of(false).pipe(delay(this.hideAfter), startWith(true));
1272
- }
1273
- else {
1274
- return of(true);
1275
- }
1227
+ return emitDelayObs(true, false, this.hideAfter || undefined);
1276
1228
  }
1277
1229
  else {
1278
1230
  return of(false);
1279
1231
  }
1280
- }), shareReplay(1));
1232
+ }), shareReplay$1(1));
1281
1233
  }
1282
1234
  }
1283
- DbxActionSuccessComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionSuccessComponent, deps: [{ token: ActionContextStoreSourceInstance }], target: i0.ɵɵFactoryTarget.Component });
1284
- DbxActionSuccessComponentcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionSuccessComponent, selector: "dbx-action-success", inputs: { hideAfter: "hideAfter" }, ngImport: i0, template: `
1285
- <ng-container *ngIf="show$ | async">
1286
- <ng-content></ng-content>
1287
- </ng-container>
1288
- `, isInline: true, directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i2.AsyncPipe } });
1289
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionSuccessComponent, decorators: [{
1290
- type: Component,
1235
+ DbxActionHasSuccessDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionHasSuccessDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: DbxActionContextStoreSourceInstance }], target: i0.ɵɵFactoryTarget.Directive });
1236
+ DbxActionHasSuccessDirectivedir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionHasSuccessDirective, selector: "[dbxActionHasSuccess]", inputs: { hideAfter: ["dbxActionHasSuccess", "hideAfter"] }, usesInheritance: true, ngImport: i0 });
1237
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionHasSuccessDirective, decorators: [{
1238
+ type: Directive,
1291
1239
  args: [{
1292
- selector: 'dbx-action-success',
1293
- template: `
1294
- <ng-container *ngIf="show$ | async">
1295
- <ng-content></ng-content>
1296
- </ng-container>
1297
- `
1240
+ selector: '[dbxActionHasSuccess]'
1298
1241
  }]
1299
- }], ctorParameters: function () { return [{ type: ActionContextStoreSourceInstance }]; }, propDecorators: { hideAfter: [{
1300
- type: Input
1242
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: DbxActionContextStoreSourceInstance }]; }, propDecorators: { hideAfter: [{
1243
+ type: Input,
1244
+ args: ['dbxActionHasSuccess']
1301
1245
  }] } });
1302
1246
 
1303
1247
  /**
1304
1248
  * Directive that executes a function on ActionContextStore Success.
1305
1249
  */
1306
- class DbxActionSuccessDirective extends AbstractSubscriptionDirective {
1250
+ class DbxActionSuccessHandlerDirective extends AbstractSubscriptionDirective {
1307
1251
  constructor(source) {
1308
1252
  super();
1309
1253
  this.source = source;
@@ -1317,7 +1261,7 @@ class DbxActionSuccessDirective extends AbstractSubscriptionDirective {
1317
1261
  this._successFunction.next(successFunction);
1318
1262
  }
1319
1263
  ngOnInit() {
1320
- this.sub = this.successFunction$.pipe(switchMap(successFunction => this.source.success$.pipe(map(x => ([successFunction, x])), tap(([successFn, result]) => {
1264
+ this.sub = this.successFunction$.pipe(switchMap(successFunction => this.source.success$.pipe(map(x => [successFunction, x]), tap(([successFn, result]) => {
1321
1265
  successFn(result);
1322
1266
  })))).subscribe();
1323
1267
  }
@@ -1326,26 +1270,26 @@ class DbxActionSuccessDirective extends AbstractSubscriptionDirective {
1326
1270
  this._successFunction.complete();
1327
1271
  }
1328
1272
  }
1329
- DbxActionSuccessDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionSuccessDirective, deps: [{ token: ActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
1330
- DbxActionSuccessDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionSuccessDirective, selector: "[dbxActionSuccess]", inputs: { successFunction: ["dbxActionSuccess", "successFunction"] }, usesInheritance: true, ngImport: i0 });
1331
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionSuccessDirective, decorators: [{
1273
+ DbxActionSuccessHandlerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionSuccessHandlerDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
1274
+ DbxActionSuccessHandlerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionSuccessHandlerDirective, selector: "[dbxActionSuccessHandler]", inputs: { successFunction: ["dbxActionSuccessHandler", "successFunction"] }, usesInheritance: true, ngImport: i0 });
1275
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionSuccessHandlerDirective, decorators: [{
1332
1276
  type: Directive,
1333
1277
  args: [{
1334
- selector: '[dbxActionSuccess]',
1278
+ selector: '[dbxActionSuccessHandler]',
1335
1279
  }]
1336
1280
  }], ctorParameters: function () {
1337
- return [{ type: ActionContextStoreSourceInstance, decorators: [{
1281
+ return [{ type: DbxActionContextStoreSourceInstance, decorators: [{
1338
1282
  type: Host
1339
1283
  }] }];
1340
1284
  }, propDecorators: { successFunction: [{
1341
1285
  type: Input,
1342
- args: ['dbxActionSuccess']
1286
+ args: ['dbxActionSuccessHandler']
1343
1287
  }] } });
1344
1288
 
1345
1289
  /**
1346
1290
  * Directive that provides a default value when triggered.
1347
1291
  *
1348
- * No value is required, allowing the directive to automatically call readyValue with undefined.
1292
+ * No value is required, allowing the directive to automatically call readyValue.
1349
1293
  */
1350
1294
  class DbxActionValueDirective extends AbstractSubscriptionDirective {
1351
1295
  constructor(source) {
@@ -1362,24 +1306,26 @@ class DbxActionValueDirective extends AbstractSubscriptionDirective {
1362
1306
  }
1363
1307
  ngOnInit() {
1364
1308
  this.sub = this.valueOrFunction$.pipe(switchMap(valueOrFunction => this.source.triggered$.pipe(tap(() => {
1365
- const value = getValueFromObjectOrGetter(valueOrFunction);
1309
+ const value = getValueFromGetter(valueOrFunction);
1366
1310
  this.source.readyValue(value);
1367
1311
  })))).subscribe();
1368
1312
  }
1369
1313
  ngOnDestroy() {
1370
- super.ngOnDestroy();
1371
- this._valueOrFunction.complete();
1314
+ this.source.lockSet.onNextUnlock(() => {
1315
+ super.ngOnDestroy();
1316
+ this._valueOrFunction.complete();
1317
+ });
1372
1318
  }
1373
1319
  }
1374
- DbxActionValueDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionValueDirective, deps: [{ token: ActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
1375
- DbxActionValueDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionValueDirective, selector: "[dbxActionValue]", inputs: { valueOrFunction: ["dbxActionValue", "valueOrFunction"] }, usesInheritance: true, ngImport: i0 });
1376
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionValueDirective, decorators: [{
1320
+ DbxActionValueDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionValueDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
1321
+ DbxActionValueDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionValueDirective, selector: "[dbxActionValue]", inputs: { valueOrFunction: ["dbxActionValue", "valueOrFunction"] }, usesInheritance: true, ngImport: i0 });
1322
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionValueDirective, decorators: [{
1377
1323
  type: Directive,
1378
1324
  args: [{
1379
1325
  selector: '[dbxActionValue]',
1380
1326
  }]
1381
1327
  }], ctorParameters: function () {
1382
- return [{ type: ActionContextStoreSourceInstance, decorators: [{
1328
+ return [{ type: DbxActionContextStoreSourceInstance, decorators: [{
1383
1329
  type: Host
1384
1330
  }] }];
1385
1331
  }, propDecorators: { valueOrFunction: [{
@@ -1388,83 +1334,223 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
1388
1334
  }] } });
1389
1335
 
1390
1336
  /**
1391
- * Displays the input content when working is set.
1337
+ * Structural directive that displays the content when the store is working.
1338
+ *
1339
+ * Can specify a period in milliseconds that shows how long to show up after working for a particular number of seconds.
1340
+ */
1341
+ class DbxActionIsWorkingDirective extends AbstractIfDirective {
1342
+ constructor(templateRef, viewContainer, source) {
1343
+ super(templateRef, viewContainer);
1344
+ this.source = source;
1345
+ this.show$ = this.source.isWorking$.pipe(exhaustMap$1((isWorking) => {
1346
+ if (isWorking && this.showAfter) {
1347
+ return emitDelayObs(false, true, this.showAfter || undefined);
1348
+ }
1349
+ else {
1350
+ return of(isWorking);
1351
+ }
1352
+ }), shareReplay$1(1));
1353
+ }
1354
+ }
1355
+ DbxActionIsWorkingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionIsWorkingDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: DbxActionContextStoreSourceInstance }], target: i0.ɵɵFactoryTarget.Directive });
1356
+ DbxActionIsWorkingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionIsWorkingDirective, selector: "[dbxActionIsWorking]", inputs: { showAfter: ["dbxActionIsWorking", "showAfter"] }, usesInheritance: true, ngImport: i0 });
1357
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionIsWorkingDirective, decorators: [{
1358
+ type: Directive,
1359
+ args: [{
1360
+ selector: '[dbxActionIsWorking]'
1361
+ }]
1362
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: DbxActionContextStoreSourceInstance }]; }, propDecorators: { showAfter: [{
1363
+ type: Input,
1364
+ args: ['dbxActionIsWorking']
1365
+ }] } });
1366
+
1367
+ const APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY = 'dbx_action_enforce_modified';
1368
+ /**
1369
+ * Directive that toggles disabling an action if the action is not marked modified.
1392
1370
  */
1393
- class DbxActionWorkingComponent {
1371
+ class DbxActionEnforceModifiedDirective extends AbstractSubscriptionDirective {
1394
1372
  constructor(source) {
1373
+ super();
1395
1374
  this.source = source;
1396
- this.show$ = this.source.isWorking$;
1375
+ this._enabled = new BehaviorSubject(true);
1376
+ }
1377
+ ngOnInit() {
1378
+ this.sub = combineLatest([this.source.isModified$, this._enabled]).pipe(delay(0)).subscribe(([modified, enableDirective]) => {
1379
+ const disable = enableDirective && !modified;
1380
+ this.source.disable(APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY, disable);
1381
+ });
1382
+ }
1383
+ ngOnDestroy() {
1384
+ super.ngOnDestroy();
1385
+ this._enabled.complete();
1386
+ this.source.enable(APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY);
1387
+ }
1388
+ get enabled() {
1389
+ return this._enabled.value;
1390
+ }
1391
+ set enabled(enabled) {
1392
+ var _a;
1393
+ this._enabled.next((_a = Boolean(enabled)) !== null && _a !== void 0 ? _a : true);
1397
1394
  }
1398
1395
  }
1399
- DbxActionWorkingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionWorkingComponent, deps: [{ token: ActionContextStoreSourceInstance }], target: i0.ɵɵFactoryTarget.Component });
1400
- DbxActionWorkingComponentcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionWorkingComponent, selector: "dbx-action-working", ngImport: i0, template: `
1401
- <ng-container *ngIf="show$ | async">
1402
- <ng-content></ng-content>
1403
- </ng-container>
1404
- `, isInline: true, directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i2.AsyncPipe } });
1405
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionWorkingComponent, decorators: [{
1406
- type: Component,
1396
+ DbxActionEnforceModifiedDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionEnforceModifiedDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
1397
+ DbxActionEnforceModifiedDirectivedir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionEnforceModifiedDirective, selector: "[dbxActionEnforceModified]", inputs: { enabled: ["dbxActionEnforceModified", "enabled"] }, usesInheritance: true, ngImport: i0 });
1398
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionEnforceModifiedDirective, decorators: [{
1399
+ type: Directive,
1400
+ args: [{
1401
+ selector: '[dbxActionEnforceModified]'
1402
+ }]
1403
+ }], ctorParameters: function () {
1404
+ return [{ type: DbxActionContextStoreSourceInstance, decorators: [{
1405
+ type: Host
1406
+ }] }];
1407
+ }, propDecorators: { enabled: [{
1408
+ type: Input,
1409
+ args: ['dbxActionEnforceModified']
1410
+ }] } });
1411
+
1412
+ /**
1413
+ * Utility class that handles trigger events to retrieve a value.
1414
+ */
1415
+ class DbxActionValueOnTriggerInstance {
1416
+ constructor(config) {
1417
+ this._valueGetter = new BehaviorSubject(undefined);
1418
+ this.valueGetter$ = this._valueGetter.pipe(filterMaybe());
1419
+ this._triggeredSub = new SubscriptionObject();
1420
+ this.source = config.source;
1421
+ this._valueGetter.next(config.valueGetter);
1422
+ }
1423
+ get valueGetter() {
1424
+ return this._valueGetter.value;
1425
+ }
1426
+ set valueGetter(valueGetter) {
1427
+ this._valueGetter.next(valueGetter);
1428
+ }
1429
+ init() {
1430
+ // Ready the value after the source is triggered. Do modified check one last time.
1431
+ this._triggeredSub.subscription = this.source.triggered$.pipe(switchMap$1(() => this.valueGetter$.pipe(switchMap$1((valueGetter) => asObservable(valueGetter())))
1432
+ .pipe(
1433
+ // If the value is not null/undefined and is considered modified, then pass the value.
1434
+ switchMap$1((value) => returnIfIs(this.isModifiedFunction, value, false).pipe(map$1((value) => ({ value })))),
1435
+ // Catch any errors and pass them to reject.
1436
+ catchError((reject) => of({ reject }))))).subscribe((result) => {
1437
+ if (result.value != null) {
1438
+ this.source.readyValue(result.value);
1439
+ }
1440
+ else {
1441
+ this.source.reject(result.reject);
1442
+ }
1443
+ });
1444
+ }
1445
+ destroy() {
1446
+ this.source.lockSet.onNextUnlock(() => {
1447
+ this._triggeredSub.destroy();
1448
+ this._valueGetter.complete();
1449
+ });
1450
+ }
1451
+ }
1452
+
1453
+ /**
1454
+ * Abstract class for directives that may perform an action when trigger is called, and returns a value.
1455
+ */
1456
+ class AbstractDbxActionValueOnTriggerDirective {
1457
+ constructor(source, valueGetter) {
1458
+ this.source = source;
1459
+ this._triggeredSub = new SubscriptionObject();
1460
+ this._instance = new DbxActionValueOnTriggerInstance({
1461
+ source: this.source,
1462
+ valueGetter
1463
+ });
1464
+ }
1465
+ get valueGetter() {
1466
+ return this._instance.valueGetter;
1467
+ }
1468
+ set valueGetter(valueGetter) {
1469
+ this._instance.valueGetter = valueGetter;
1470
+ }
1471
+ get isModifiedFunction() {
1472
+ return this._instance.isModifiedFunction;
1473
+ }
1474
+ set isModifiedFunction(isModifiedFunction) {
1475
+ this._instance.isModifiedFunction = isModifiedFunction;
1476
+ }
1477
+ ngOnInit() {
1478
+ this._instance.init();
1479
+ }
1480
+ ngOnDestroy() {
1481
+ this._instance.destroy();
1482
+ this._triggeredSub.destroy();
1483
+ }
1484
+ }
1485
+ AbstractDbxActionValueOnTriggerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxActionValueOnTriggerDirective, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
1486
+ AbstractDbxActionValueOnTriggerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractDbxActionValueOnTriggerDirective, ngImport: i0 });
1487
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxActionValueOnTriggerDirective, decorators: [{
1488
+ type: Directive
1489
+ }], ctorParameters: function () { return [{ type: DbxActionContextStoreSourceInstance }, { type: undefined }]; } });
1490
+ /**
1491
+ * Action directive that is used to trigger/display a popover, then watches that popover for a value.
1492
+ */
1493
+ class DbxActionValueTriggerDirective extends AbstractDbxActionValueOnTriggerDirective {
1494
+ constructor(elementRef, source) {
1495
+ super(source);
1496
+ this.elementRef = elementRef;
1497
+ }
1498
+ set dbxActionValueOnTrigger(dbxActionValueTrigger) {
1499
+ this.valueGetter = dbxActionValueTrigger;
1500
+ }
1501
+ set dbxActionValueTriggerModified(isModifiedFunction) {
1502
+ this.isModifiedFunction = isModifiedFunction;
1503
+ }
1504
+ }
1505
+ DbxActionValueTriggerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionValueTriggerDirective, deps: [{ token: i0.ElementRef }, { token: DbxActionContextStoreSourceInstance }], target: i0.ɵɵFactoryTarget.Directive });
1506
+ DbxActionValueTriggerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionValueTriggerDirective, selector: "[dbxActionValueOnTrigger]", inputs: { dbxActionValueOnTrigger: "dbxActionValueOnTrigger", dbxActionValueTriggerModified: "dbxActionValueTriggerModified" }, exportAs: ["dbxActionValueOnTrigger"], usesInheritance: true, ngImport: i0 });
1507
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionValueTriggerDirective, decorators: [{
1508
+ type: Directive,
1407
1509
  args: [{
1408
- selector: 'dbx-action-working',
1409
- template: `
1410
- <ng-container *ngIf="show$ | async">
1411
- <ng-content></ng-content>
1412
- </ng-container>
1413
- `
1510
+ exportAs: 'dbxActionValueOnTrigger',
1511
+ selector: '[dbxActionValueOnTrigger]'
1414
1512
  }]
1415
- }], ctorParameters: function () { return [{ type: ActionContextStoreSourceInstance }]; } });
1416
-
1417
- const DEFAULT_SNACKBAR_DIRECTIVE_DURATION = ms('4s');
1418
- const DEFAULT_SNACKBAR_UNDO_DIRECTIVE_DURATION = ms('30s');
1419
- var ActionSnackbarDefaultType;
1420
- (function (ActionSnackbarDefaultType) {
1421
- ActionSnackbarDefaultType["NONE"] = "none";
1422
- ActionSnackbarDefaultType["CREATE"] = "create";
1423
- ActionSnackbarDefaultType["SAVE"] = "save";
1424
- ActionSnackbarDefaultType["DELETE"] = "delete";
1425
- ActionSnackbarDefaultType["MERGE"] = "merge";
1426
- ActionSnackbarDefaultType["SEND"] = "send";
1427
- ActionSnackbarDefaultType["CANCEL"] = "cancel";
1428
- ActionSnackbarDefaultType["RESTORE"] = "restore";
1429
- ActionSnackbarDefaultType["REFRESH"] = "refresh";
1430
- ActionSnackbarDefaultType["MARK_READ"] = "read";
1431
- ActionSnackbarDefaultType["MARK_UNREAD"] = "unread";
1432
- })(ActionSnackbarDefaultType || (ActionSnackbarDefaultType = {}));
1433
- var ActionSnackbarEventType;
1434
- (function (ActionSnackbarEventType) {
1435
- ActionSnackbarEventType[ActionSnackbarEventType["WORKING"] = 0] = "WORKING";
1436
- ActionSnackbarEventType[ActionSnackbarEventType["SUCCESS"] = 1] = "SUCCESS";
1437
- ActionSnackbarEventType[ActionSnackbarEventType["REJECTED"] = 2] = "REJECTED";
1438
- })(ActionSnackbarEventType || (ActionSnackbarEventType = {}));
1439
-
1440
- // export * from './snackbar.directive';
1513
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: DbxActionContextStoreSourceInstance }]; }, propDecorators: { dbxActionValueOnTrigger: [{
1514
+ type: Input,
1515
+ args: ['dbxActionValueOnTrigger']
1516
+ }], dbxActionValueTriggerModified: [{
1517
+ type: Input
1518
+ }] } });
1441
1519
 
1442
1520
  /**
1443
1521
  * Configurable machine that handles components of the ActionContextStore lifecycle.
1522
+ *
1523
+ * It can be configured to activate only once before cleaning itself up. It can be used directly as a DbxActionContextSourceReference in cases where it is created as a one-off action.
1444
1524
  */
1445
- class ActionContextMachine extends ActionContextBaseSource {
1525
+ class DbxActionContextMachine extends DbxActionContextBaseSource {
1446
1526
  constructor(config, source) {
1447
1527
  super(source);
1448
1528
  this.config = config;
1449
1529
  this._isShutdown = true;
1450
1530
  this._handleValueReadySub = new SubscriptionObject();
1531
+ this._successSub = new SubscriptionObject();
1451
1532
  // Handle Value Ready
1452
1533
  this._handleValueReadySub.subscription = this.sourceInstance.valueReady$.subscribe((value) => {
1453
- handleWorkValueReadyFn({ handlerFunction: config.handleValueReady, delegate: new WorkHandlerContextSourceDelegate(this.sourceInstance) })(value);
1534
+ const doWork = workFactory({
1535
+ work: config.handleValueReady,
1536
+ delegate: new DbxActionWorkInstanceDelegate(this.sourceInstance)
1537
+ });
1538
+ doWork(value);
1454
1539
  });
1455
1540
  // If this is a one-time use, then destroy it after the first success comes through.
1456
1541
  if (this.config.oneTimeUse) {
1457
- this.sourceInstance.success$.pipe(first(), delay(1000)).subscribe(() => {
1542
+ this.sourceInstance.success$.pipe(first(), delay$1(1000)).subscribe(() => {
1458
1543
  this.destroy();
1459
1544
  });
1460
1545
  }
1461
1546
  if (this.config.onSuccess) {
1462
- this.sourceInstance.success$.subscribe(this.config.onSuccess);
1547
+ this._successSub.subscription = this.sourceInstance.success$.subscribe(this.config.onSuccess);
1463
1548
  }
1464
1549
  }
1465
1550
  destroy() {
1466
1551
  super.destroy();
1467
1552
  this._handleValueReadySub.destroy();
1553
+ this._successSub.destroy();
1468
1554
  this._isShutdown = true;
1469
1555
  }
1470
1556
  get isShutdown() {
@@ -1474,18 +1560,18 @@ class ActionContextMachine extends ActionContextBaseSource {
1474
1560
 
1475
1561
  class DbxCoreActionModule {
1476
1562
  }
1477
- DbxCoreActionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreActionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1478
- DbxCoreActionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreActionModule, declarations: [DbxActionDirective, DbxActionContextMapDirective, DbxActionFromMapDirective, DbxActionMapSourceDirective,
1479
- DbxActionMapWorkingDisableDirective, DbxActionSourceDirective, DbxActionHandlerDirective, DbxActionDisabledDirective, DbxActionDisabledUntilModifiedDirective,
1480
- DbxActionAutoTriggerDirective, DbxActionAutoTriggerValueDirective, DbxActionAutoModifyDirective, DbxActionValueDirective, DbxActionContextLoggerDirective,
1481
- DbxActionSuccessComponent, DbxActionSuccessDirective, DbxActionWorkingComponent], imports: [CommonModule], exports: [DbxActionDirective, DbxActionContextMapDirective, DbxActionFromMapDirective, DbxActionMapSourceDirective,
1482
- DbxActionMapWorkingDisableDirective, DbxActionSourceDirective, DbxActionHandlerDirective, DbxActionDisabledDirective, DbxActionDisabledUntilModifiedDirective,
1483
- DbxActionAutoTriggerDirective, DbxActionAutoTriggerValueDirective, DbxActionAutoModifyDirective, DbxActionValueDirective, DbxActionContextLoggerDirective,
1484
- DbxActionSuccessComponent, DbxActionSuccessDirective, DbxActionWorkingComponent] });
1485
- DbxCoreActionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreActionModule, imports: [[
1563
+ DbxCoreActionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreActionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1564
+ DbxCoreActionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreActionModule, declarations: [DbxActionDirective, DbxActionContextMapDirective, DbxActionFromMapDirective, DbxActionMapSourceDirective,
1565
+ DbxActionMapWorkingDisableDirective, DbxActionSourceDirective, DbxActionHandlerDirective, DbxActionDisabledDirective, DbxActionEnforceModifiedDirective,
1566
+ DbxActionAutoTriggerDirective, dbxActionValueStreamDirective, DbxActionAutoModifyDirective, DbxActionValueDirective, DbxActionContextLoggerDirective,
1567
+ DbxActionHasSuccessDirective, DbxActionSuccessHandlerDirective, DbxActionIsWorkingDirective], imports: [CommonModule], exports: [DbxActionDirective, DbxActionContextMapDirective, DbxActionFromMapDirective, DbxActionMapSourceDirective,
1568
+ DbxActionMapWorkingDisableDirective, DbxActionSourceDirective, DbxActionHandlerDirective, DbxActionDisabledDirective, DbxActionEnforceModifiedDirective,
1569
+ DbxActionAutoTriggerDirective, dbxActionValueStreamDirective, DbxActionAutoModifyDirective, DbxActionValueDirective, DbxActionContextLoggerDirective,
1570
+ DbxActionHasSuccessDirective, DbxActionSuccessHandlerDirective, DbxActionIsWorkingDirective] });
1571
+ DbxCoreActionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreActionModule, imports: [[
1486
1572
  CommonModule
1487
1573
  ]] });
1488
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreActionModule, decorators: [{
1574
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreActionModule, decorators: [{
1489
1575
  type: NgModule,
1490
1576
  args: [{
1491
1577
  imports: [
@@ -1493,98 +1579,433 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
1493
1579
  ],
1494
1580
  declarations: [
1495
1581
  DbxActionDirective, DbxActionContextMapDirective, DbxActionFromMapDirective, DbxActionMapSourceDirective,
1496
- DbxActionMapWorkingDisableDirective, DbxActionSourceDirective, DbxActionHandlerDirective, DbxActionDisabledDirective, DbxActionDisabledUntilModifiedDirective,
1497
- DbxActionAutoTriggerDirective, DbxActionAutoTriggerValueDirective, DbxActionAutoModifyDirective, DbxActionValueDirective, DbxActionContextLoggerDirective,
1498
- DbxActionSuccessComponent, DbxActionSuccessDirective, DbxActionWorkingComponent
1582
+ DbxActionMapWorkingDisableDirective, DbxActionSourceDirective, DbxActionHandlerDirective, DbxActionDisabledDirective, DbxActionEnforceModifiedDirective,
1583
+ DbxActionAutoTriggerDirective, dbxActionValueStreamDirective, DbxActionAutoModifyDirective, DbxActionValueDirective, DbxActionContextLoggerDirective,
1584
+ DbxActionHasSuccessDirective, DbxActionSuccessHandlerDirective, DbxActionIsWorkingDirective,
1499
1585
  ],
1500
1586
  exports: [
1501
1587
  DbxActionDirective, DbxActionContextMapDirective, DbxActionFromMapDirective, DbxActionMapSourceDirective,
1502
- DbxActionMapWorkingDisableDirective, DbxActionSourceDirective, DbxActionHandlerDirective, DbxActionDisabledDirective, DbxActionDisabledUntilModifiedDirective,
1503
- DbxActionAutoTriggerDirective, DbxActionAutoTriggerValueDirective, DbxActionAutoModifyDirective, DbxActionValueDirective, DbxActionContextLoggerDirective,
1504
- DbxActionSuccessComponent, DbxActionSuccessDirective, DbxActionWorkingComponent
1588
+ DbxActionMapWorkingDisableDirective, DbxActionSourceDirective, DbxActionHandlerDirective, DbxActionDisabledDirective, DbxActionEnforceModifiedDirective,
1589
+ DbxActionAutoTriggerDirective, dbxActionValueStreamDirective, DbxActionAutoModifyDirective, DbxActionValueDirective, DbxActionContextLoggerDirective,
1590
+ DbxActionHasSuccessDirective, DbxActionSuccessHandlerDirective, DbxActionIsWorkingDirective
1505
1591
  ]
1506
1592
  }]
1507
1593
  }] });
1508
1594
 
1509
- class DbxButton {
1510
- }
1511
- function ProvideDbxButton(sourceType) {
1512
- return [{
1513
- provide: DbxButton,
1514
- useExisting: forwardRef(() => sourceType)
1515
- }];
1595
+ function makeDbxActionContextSourceReference(sourceInstance) {
1596
+ return {
1597
+ sourceInstance,
1598
+ destroy: () => 0
1599
+ };
1516
1600
  }
1517
1601
 
1518
1602
  /**
1519
- * Context used for linking a button to an ActionContext and only look for triggers.
1603
+ * Client auth service used to retrieve info about the current state of client authentication and client roles they may have.
1520
1604
  */
1521
- class DbxActionButtonTriggerDirective extends AbstractSubscriptionDirective {
1522
- constructor(button, source) {
1523
- super();
1524
- this.button = button;
1525
- this.source = source;
1526
- }
1527
- ngOnInit() {
1528
- this.sub = this.button.clicked$.subscribe(() => {
1529
- this._buttonClicked();
1530
- });
1531
- }
1532
- _buttonClicked() {
1533
- this.source.trigger();
1534
- }
1605
+ class DbxAuthService {
1535
1606
  }
1536
- DbxActionButtonTriggerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionButtonTriggerDirective, deps: [{ token: DbxButton, host: true }, { token: ActionContextStoreSourceInstance }], target: i0.ɵɵFactoryTarget.Directive });
1537
- DbxActionButtonTriggerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionButtonTriggerDirective, selector: "[dbxActionButtonTrigger]", usesInheritance: true, ngImport: i0 });
1538
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionButtonTriggerDirective, decorators: [{
1539
- type: Directive,
1540
- args: [{
1541
- selector: '[dbxActionButtonTrigger]'
1542
- }]
1543
- }], ctorParameters: function () {
1544
- return [{ type: DbxButton, decorators: [{
1545
- type: Host
1546
- }] }, { type: ActionContextStoreSourceInstance }];
1547
- } });
1548
1607
 
1549
1608
  /**
1550
- * Context used for linking a button to an ActionContext.
1609
+ * This generates a TransitionHookFn that can be used with redirecting routes.
1551
1610
  */
1552
- class DbxActionButtonDirective extends DbxActionButtonTriggerDirective {
1553
- constructor(button, source, ngZone) {
1554
- super(button, source);
1555
- this.ngZone = ngZone;
1556
- this._workingSub = new SubscriptionObject();
1557
- this._disabledSub = new SubscriptionObject();
1558
- }
1559
- ngOnInit() {
1560
- super.ngOnInit();
1561
- this._workingSub.subscription = this.source.isWorking$.subscribe((working) => {
1562
- // console.log('Working: ', working);
1563
- this.ngZone.run(() => this.button.working = working);
1564
- });
1565
- this._disabledSub.subscription = this.source.isDisabled$.subscribe((disabled) => {
1566
- // console.log('Disabled: ', disabled);
1567
- this.ngZone.run(() => this.button.disabled = disabled);
1568
- });
1611
+ function makeAuthTransitionHook(config) {
1612
+ const { defaultRedirectTarget, errorRedirectTarget = defaultRedirectTarget } = config;
1613
+ // https://ui-router.github.io/ng2/docs/latest/modules/transition.html#hookresult
1614
+ const assertIsAuthenticated = (transition) => {
1615
+ const injector = transition.injector();
1616
+ const authService = injector.get(DbxAuthService);
1617
+ const $state = transition.router.stateService;
1618
+ const decisionObs = config.makeDecisionsObs(transition, authService, injector);
1619
+ function redirectOut() {
1620
+ const stateData = transition.targetState().state().data;
1621
+ const redirectTo = stateData === null || stateData === void 0 ? void 0 : stateData.redirectTo;
1622
+ let redirectToObs;
1623
+ if (redirectTo) {
1624
+ let resultObs;
1625
+ if (isGetter(redirectTo)) {
1626
+ resultObs = getValueFromGetter(redirectTo, { authService, injector, transition });
1627
+ }
1628
+ else {
1629
+ resultObs = of(redirectTo);
1630
+ }
1631
+ redirectToObs = resultObs.pipe(map$1((stateRef) => {
1632
+ let redirectTarget;
1633
+ let redirectParams;
1634
+ if (stateRef) {
1635
+ redirectTarget = stateRef.ref;
1636
+ redirectParams = stateRef.refParams;
1637
+ }
1638
+ if (!redirectTarget) {
1639
+ redirectTarget = defaultRedirectTarget;
1640
+ }
1641
+ return $state.target(redirectTarget, redirectParams);
1642
+ }));
1643
+ }
1644
+ else {
1645
+ redirectToObs = of($state.target(defaultRedirectTarget));
1646
+ }
1647
+ return redirectToObs;
1648
+ }
1649
+ const resultObs = decisionObs.pipe(first$1(), switchMap$1((decision) => {
1650
+ if (typeof decision === 'boolean') {
1651
+ if (decision) {
1652
+ return of(true);
1653
+ }
1654
+ else {
1655
+ return redirectOut();
1656
+ }
1657
+ }
1658
+ else {
1659
+ return of($state.target(decision.ref, decision.refParams, decision.refOptions));
1660
+ }
1661
+ }), catchError((x) => {
1662
+ console.warn('Encountered error in auth transition hook.', x);
1663
+ return of($state.target(errorRedirectTarget, { location: true })); // Redirect to home
1664
+ }));
1665
+ return firstValueFrom(resultObs);
1666
+ };
1667
+ return assertIsAuthenticated;
1668
+ }
1669
+
1670
+ /**
1671
+ * Creates a AuthTransitionRedirectTargetGetter that can redirect values based on the current authUserState.
1672
+ *
1673
+ * @param stateMap
1674
+ * @returns
1675
+ */
1676
+ function redirectBasedOnAuthUserState(stateMap) {
1677
+ return (input) => {
1678
+ return input.authService.authUserState$.pipe(first$1(), switchMap$1((authUserState) => {
1679
+ const getter = stateMap[authUserState];
1680
+ let result;
1681
+ if (getter) {
1682
+ if (isGetter(getter)) {
1683
+ result = getValueFromGetter(getter, input);
1684
+ }
1685
+ else {
1686
+ result = of(getter);
1687
+ }
1688
+ }
1689
+ if (!result) {
1690
+ result = of(undefined);
1691
+ }
1692
+ return result;
1693
+ }));
1694
+ };
1695
+ }
1696
+
1697
+ /**
1698
+ * This hook redirects to the configured default state when a user is not logged in for configured states.
1699
+ */
1700
+ function enableIsLoggedInHook(transitionService, config) {
1701
+ // Matches if the destination state's data property has a truthy 'isSecure' property
1702
+ const isSecureCriteria = {
1703
+ entering: (state) => {
1704
+ const data = state === null || state === void 0 ? void 0 : state.data;
1705
+ const match = Boolean(data === null || data === void 0 ? void 0 : data.requiredLogIn);
1706
+ return match;
1707
+ }
1708
+ };
1709
+ const assertIsLoggedIn = makeAuthTransitionHook(Object.assign(Object.assign({}, config.options), { makeDecisionsObs(transition, authService) {
1710
+ return authService.isLoggedIn$;
1711
+ } }));
1712
+ // Register the "requires auth" hook with the TransitionsService
1713
+ transitionService.onBefore(isSecureCriteria, assertIsLoggedIn, { priority: 100 });
1714
+ }
1715
+
1716
+ /**
1717
+ * This hook redirects to the configured default state when a user:
1718
+ *
1719
+ * - does not have an allowed state
1720
+ * - has a disallowed state
1721
+ */
1722
+ function enableHasAuthRoleHook(transitionService, config) {
1723
+ // Matches if the destination state's data property has a truthy 'isSecure' property
1724
+ const isSecureCriteria = {
1725
+ entering: (state) => {
1726
+ const data = state === null || state === void 0 ? void 0 : state.data;
1727
+ const match = Boolean(data === null || data === void 0 ? void 0 : data.authRoles);
1728
+ return match;
1729
+ }
1730
+ };
1731
+ const assertHasAuthRole = makeAuthTransitionHook(Object.assign(Object.assign({}, config.options), { makeDecisionsObs(transition, authService) {
1732
+ const targetState = transition.targetState();
1733
+ const data = targetState.state().data;
1734
+ const requiredRoles = new Set(data.authRoles);
1735
+ const setIncludes = setIncludesFunction(requiredRoles, data.authRolesMode);
1736
+ return authService.authUserState$.pipe(map$1(x => setIncludes(x)));
1737
+ } }));
1738
+ // Register the "requires auth" hook with the TransitionsService
1739
+ transitionService.onBefore(isSecureCriteria, assertHasAuthRole, { priority: 100 });
1740
+ }
1741
+
1742
+ /**
1743
+ * This hook redirects to the configured default state when a user:
1744
+ *
1745
+ * - does not have an allowed state
1746
+ * - has a disallowed state
1747
+ */
1748
+ function enableHasAuthStateHook(transitionService, config) {
1749
+ // Matches if the destination state's data property has a truthy 'isSecure' property
1750
+ const isSecureCriteria = {
1751
+ entering: (state) => {
1752
+ const data = state === null || state === void 0 ? void 0 : state.data;
1753
+ const match = Boolean(data === null || data === void 0 ? void 0 : data.authStates);
1754
+ return match;
1755
+ }
1756
+ };
1757
+ const assertHasAuthState = makeAuthTransitionHook(Object.assign(Object.assign({}, config.options), { makeDecisionsObs(transition, authService) {
1758
+ const targetState = transition.targetState();
1759
+ const data = targetState.state().data;
1760
+ const config = toHasAuthStateObjectConfig(data.authStates);
1761
+ const parsed = toParsedHasAuthStateConfig(config);
1762
+ return authService.authUserState$.pipe(map$1(x => isAllowed(x, parsed)));
1763
+ } }));
1764
+ // Register the "requires auth" hook with the TransitionsService
1765
+ transitionService.onBefore(isSecureCriteria, assertHasAuthState, { priority: 100 });
1766
+ }
1767
+ // MARK: Utility
1768
+ function toHasAuthStateObjectConfig(input) {
1769
+ const isString = typeof input === 'string';
1770
+ if ((Array.isArray(input) || isString)) {
1771
+ if (isString) {
1772
+ input = [input];
1773
+ }
1774
+ return {
1775
+ allowedStates: input
1776
+ };
1569
1777
  }
1570
- ngOnDestroy() {
1571
- super.ngOnDestroy();
1572
- this._workingSub.destroy();
1573
- this._disabledSub.destroy();
1778
+ else {
1779
+ return input;
1574
1780
  }
1575
1781
  }
1576
- DbxActionButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionButtonDirective, deps: [{ token: DbxButton, host: true }, { token: ActionContextStoreSourceInstance }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
1577
- DbxActionButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionButtonDirective, selector: "[dbxActionButton]", usesInheritance: true, ngImport: i0 });
1578
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionButtonDirective, decorators: [{
1579
- type: Directive,
1580
- args: [{
1581
- selector: '[dbxActionButton]'
1582
- }]
1583
- }], ctorParameters: function () {
1584
- return [{ type: DbxButton, decorators: [{
1585
- type: Host
1586
- }] }, { type: ActionContextStoreSourceInstance }, { type: i0.NgZone }];
1587
- } });
1782
+ function toParsedHasAuthStateConfig(input) {
1783
+ return {
1784
+ allowed: maybeSet(input.allowedStates),
1785
+ disallowed: maybeSet(input.disallowedStates)
1786
+ };
1787
+ }
1788
+
1789
+ const DBX_INIT_APP_CONTEXT_STATE = 'init';
1790
+ /**
1791
+ *
1792
+ */
1793
+ const DBX_PUBLIC_APP_CONTEXT_STATE = 'public';
1794
+ /**
1795
+ *
1796
+ */
1797
+ const DBX_AUTH_APP_CONTEXT_STATE = 'auth';
1798
+ /**
1799
+ *
1800
+ */
1801
+ const DBX_ONBOARDING_APP_CONTEXT_STATE = 'onboarding';
1802
+ /**
1803
+ *
1804
+ */
1805
+ const DBX_APP_APP_CONTEXT_STATE = 'app';
1806
+ /**
1807
+ * Array of all DbxKnownAppContextState values, minus the init state.
1808
+ */
1809
+ const DBX_KNOWN_APP_CONTEXT_STATES = [DBX_PUBLIC_APP_CONTEXT_STATE, DBX_AUTH_APP_CONTEXT_STATE, DBX_ONBOARDING_APP_CONTEXT_STATE, DBX_APP_APP_CONTEXT_STATE];
1810
+
1811
+ /**
1812
+ * Action to set the current DbxAppContextState value.
1813
+ */
1814
+ const setState = createAction('[App/Context] Set State', props());
1815
+ /**
1816
+ * Resets the app back to the init context.
1817
+ */
1818
+ const resetState = createAction('[App/Context] Reset');
1819
+
1820
+ var data_action = /*#__PURE__*/Object.freeze({
1821
+ __proto__: null,
1822
+ setState: setState,
1823
+ resetState: resetState
1824
+ });
1825
+
1826
+ var index$3 = /*#__PURE__*/Object.freeze({
1827
+ __proto__: null,
1828
+ DbxAppContextActions: data_action
1829
+ });
1830
+
1831
+ /**
1832
+ * The feature key for these items/reducers.
1833
+ */
1834
+ const dbxAppContextStateFeatureKey = 'data';
1835
+ const initialState$1 = {
1836
+ state: DBX_INIT_APP_CONTEXT_STATE
1837
+ };
1838
+ const reducer$1 = createReducer(initialState$1,
1839
+ /**
1840
+ * When DbxAppContextActions.dbxAppContextSetState is pushed, update the app's state to match the argument state.
1841
+ */
1842
+ on(setState, (_, { state }) => ({ state })));
1843
+
1844
+ /**
1845
+ * Global feature key for our app.
1846
+ */
1847
+ const featureKey$1 = 'app.context';
1848
+ /**
1849
+ * Reducers mapping for the DbxAppContextFeatureState
1850
+ */
1851
+ function reducers$1(state, action) {
1852
+ return combineReducers({
1853
+ [dbxAppContextStateFeatureKey]: reducer$1
1854
+ })(state, action);
1855
+ }
1856
+ /**
1857
+ * Selects the DbxAppContextFeatureState feature context.
1858
+ *
1859
+ * Used by createSelector() to retrieve more specific data from the DbxAppContextFeatureState.
1860
+ */
1861
+ const selectAppContextFeature = createFeatureSelector(featureKey$1);
1862
+ /**
1863
+ * Selector to retrieve the state value from our DbxAppContextStateData in our DbxAppContextFeatureState.
1864
+ */
1865
+ const selectDbxAppContextState = createSelector(selectAppContextFeature, (featureState) => featureState[dbxAppContextStateFeatureKey].state);
1866
+
1867
+ var index$2 = /*#__PURE__*/Object.freeze({
1868
+ __proto__: null,
1869
+ featureKey: featureKey$1,
1870
+ reducers: reducers$1,
1871
+ selectAppContextFeature: selectAppContextFeature,
1872
+ selectDbxAppContextState: selectDbxAppContextState
1873
+ });
1874
+
1875
+ // MARK: Abstract Context Effects
1876
+ /**
1877
+ * Abstract effects class that only runs/allows effects when the DbxAppContextState in the ngrx state matches input activeState value.
1878
+ */
1879
+ class AbstractOnDbxAppContextStateEffects {
1880
+ constructor(
1881
+ /**
1882
+ * The state(s) to activate on.
1883
+ */
1884
+ activeStates,
1885
+ /**
1886
+ * ngrx Actions
1887
+ */
1888
+ actions$,
1889
+ /**
1890
+ * ngrx Store
1891
+ */
1892
+ store) {
1893
+ this.actions$ = actions$;
1894
+ this.store = store;
1895
+ this._activeStatesSet = new Set(activeStates);
1896
+ }
1897
+ /**
1898
+ * Configures all actions of the sub-class to only activate when the DbxAppContextState in App
1899
+ *
1900
+ * @param resolvedEffects$
1901
+ * @returns
1902
+ */
1903
+ ngrxOnRunEffects(resolvedEffects$) {
1904
+ return this.actions$.pipe(ofType(setState), filter$1(({ state }) => {
1905
+ return this._activeStatesSet.has(state);
1906
+ }), exhaustMap$1(() => resolvedEffects$.pipe(takeUntil(this.actions$.pipe(ofType(setState), filter$1(({ state }) => !this._activeStatesSet.has(state)))))));
1907
+ }
1908
+ }
1909
+
1910
+ const NO_AUTH_USER_IDENTIFIER = '0';
1911
+ /**
1912
+ * Creates an AuthUserIdentifier from the input. If the input is undefined, returns the NoAuthUserIdentifier.
1913
+ *
1914
+ * @param inputId
1915
+ * @returns
1916
+ */
1917
+ function authUserIdentifier(inputId) {
1918
+ return (inputId) ? inputId : NO_AUTH_USER_IDENTIFIER;
1919
+ }
1920
+
1921
+ /**
1922
+ * Action for when the user has logged in.
1923
+ */
1924
+ const loggedIn = createAction('[App/Auth] Auth Logged In');
1925
+ /**
1926
+ * Action for when the user has logged out.
1927
+ */
1928
+ const loggedOut = createAction('[App/Auth] Auth Logged Out');
1929
+ /**
1930
+ * Action to log the user out.
1931
+ */
1932
+ const logout = createAction('[App/Auth] Auth Logout');
1933
+
1934
+ var auth_action = /*#__PURE__*/Object.freeze({
1935
+ __proto__: null,
1936
+ loggedIn: loggedIn,
1937
+ loggedOut: loggedOut,
1938
+ logout: logout
1939
+ });
1940
+
1941
+ /**
1942
+ * Sets the user's identifier in the auth.
1943
+ */
1944
+ const setUserIdentifier = createAction('[App/Auth] Set User Identifier', props());
1945
+ /**
1946
+ * Sets the user's state in the auth.
1947
+ */
1948
+ const setUserState = createAction('[App/Auth] Set User State', props());
1949
+ /**
1950
+ * Sets the user's roles in the auth.
1951
+ */
1952
+ const setUserRoles = createAction('[App/Auth] Set User Roles', props());
1953
+ /**
1954
+ * Sets the user's onboarding state.
1955
+ */
1956
+ const setUserIsOnboarded = createAction('[App/Auth] Set User Is Onboarded', props());
1957
+
1958
+ var user_action = /*#__PURE__*/Object.freeze({
1959
+ __proto__: null,
1960
+ setUserIdentifier: setUserIdentifier,
1961
+ setUserState: setUserState,
1962
+ setUserRoles: setUserRoles,
1963
+ setUserIsOnboarded: setUserIsOnboarded
1964
+ });
1965
+
1966
+ var index$1 = /*#__PURE__*/Object.freeze({
1967
+ __proto__: null,
1968
+ DbxAppAuthActions: auth_action,
1969
+ DbxAppAuthUserActions: user_action
1970
+ });
1971
+
1972
+ const dbxAppAuthUserFeatureKey = 'user';
1973
+ const initialState = {
1974
+ userId: NO_AUTH_USER_IDENTIFIER,
1975
+ isOnboarded: false,
1976
+ userState: 'none',
1977
+ userRoles: []
1978
+ };
1979
+ const reducer = createReducer(initialState, on(loggedOut, () => (Object.assign({}, initialState))), on(setUserIdentifier, (state, { id: userId }) => (Object.assign(Object.assign({}, state), { userId }))), on(setUserIsOnboarded, (state, { isOnboarded }) => (Object.assign(Object.assign({}, state), { isOnboarded }))), on(setUserState, (state, { state: userState }) => (Object.assign(Object.assign({}, state), { userState }))), on(setUserRoles, (state, { roles: userRoles }) => (Object.assign(Object.assign({}, state), { userRoles: Array.from(userRoles) }))));
1980
+
1981
+ /**
1982
+ * Global feature key
1983
+ */
1984
+ const featureKey = 'app.auth';
1985
+ /**
1986
+ * Reducers mapping for the DbxAppAuthFeatureState
1987
+ */
1988
+ function reducers(state, action) {
1989
+ return combineReducers({
1990
+ [dbxAppAuthUserFeatureKey]: reducer
1991
+ })(state, action);
1992
+ }
1993
+ /**
1994
+ * Selects the DbxAppAuthFeatureState feature context.
1995
+ */
1996
+ const selectAppAuthFeature = createFeatureSelector(featureKey);
1997
+ /**
1998
+ * Selector to retrieve the state value from our DbxAppContextStateData in our DbxAppContextFeatureState.
1999
+ */
2000
+ const selectDbxAppAuthUser = createSelector(selectAppAuthFeature, (featureState) => featureState[dbxAppAuthUserFeatureKey]);
2001
+
2002
+ var index = /*#__PURE__*/Object.freeze({
2003
+ __proto__: null,
2004
+ featureKey: featureKey,
2005
+ reducers: reducers,
2006
+ selectAppAuthFeature: selectAppAuthFeature,
2007
+ selectDbxAppAuthUser: selectDbxAppAuthUser
2008
+ });
1588
2009
 
1589
2010
  const expandClickableAnchorLinkTreeNode = expandTreeFunction({
1590
2011
  getChildren: (x) => x.children
@@ -1647,6 +2068,28 @@ function ProvideDbxAnchor(sourceType) {
1647
2068
  }];
1648
2069
  }
1649
2070
 
2071
+ function isSegueRef(input) {
2072
+ return (typeof input === 'object') && input.ref != null;
2073
+ }
2074
+ function asSegueRef(input) {
2075
+ const type = typeof input;
2076
+ if (type === 'string') {
2077
+ return refStringToSegueRef(input);
2078
+ }
2079
+ else if (isSegueRef(input)) {
2080
+ return input;
2081
+ }
2082
+ else {
2083
+ return { ref: undefined };
2084
+ }
2085
+ }
2086
+ function refStringToSegueRef(ref, options) {
2087
+ return Object.assign(Object.assign({}, options), { ref });
2088
+ }
2089
+ function mapRefStringObsToSegueRefObs(obs, options) {
2090
+ return obs.pipe(map$1(x => refStringToSegueRef(x, options)));
2091
+ }
2092
+
1650
2093
  /**
1651
2094
  * Abstract anchor directive.
1652
2095
  */
@@ -1656,7 +2099,17 @@ class AbstractDbxAnchorDirective {
1656
2099
  this._anchor = new BehaviorSubject(undefined);
1657
2100
  this.disabled$ = this._disabled.asObservable();
1658
2101
  this.anchor$ = this._anchor.pipe(skipFirstMaybe(), distinctUntilChanged(), shareReplay(1));
1659
- this.type$ = combineLatest([this.disabled$, this.anchor$]).pipe(delay$1(0), map(([disabled, anchor]) => anchorTypeForAnchor(anchor, disabled)), distinctUntilChanged(), shareReplay(1));
2102
+ this.type$ = combineLatest([this.disabled$, this.anchor$]).pipe(delay(0), map(([disabled, anchor]) => anchorTypeForAnchor(anchor, disabled)), distinctUntilChanged(), shareReplay(1));
2103
+ }
2104
+ ngOnDestroy() {
2105
+ this._disabled.complete();
2106
+ this._anchor.complete();
2107
+ }
2108
+ /**
2109
+ * Convenience input to create an Anchor from the input SegueRef.
2110
+ */
2111
+ set ref(ref) {
2112
+ this.anchor = asSegueRef(ref);
1660
2113
  }
1661
2114
  get anchor() {
1662
2115
  return this._anchor.value;
@@ -1671,11 +2124,13 @@ class AbstractDbxAnchorDirective {
1671
2124
  this._disabled.next(disabled);
1672
2125
  }
1673
2126
  }
1674
- AbstractDbxAnchorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractDbxAnchorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1675
- AbstractDbxAnchorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractDbxAnchorDirective, inputs: { anchor: "anchor", disabled: "disabled" }, ngImport: i0 });
1676
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractDbxAnchorDirective, decorators: [{
2127
+ AbstractDbxAnchorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxAnchorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2128
+ AbstractDbxAnchorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractDbxAnchorDirective, inputs: { ref: "ref", anchor: "anchor", disabled: "disabled" }, ngImport: i0 });
2129
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxAnchorDirective, decorators: [{
1677
2130
  type: Directive
1678
- }], propDecorators: { anchor: [{
2131
+ }], ctorParameters: function () { return []; }, propDecorators: { ref: [{
2132
+ type: Input
2133
+ }], anchor: [{
1679
2134
  type: Input
1680
2135
  }], disabled: [{
1681
2136
  type: Input
@@ -1700,6 +2155,7 @@ class DbxAngularRouterService {
1700
2155
  constructor(router, activatedRoute) {
1701
2156
  this.router = router;
1702
2157
  this.activatedRoute = activatedRoute;
2158
+ this.params$ = this.activatedRoute.params;
1703
2159
  this.transitions$ = this.router.events.pipe(map((x) => {
1704
2160
  let event;
1705
2161
  if (x instanceof NavigationStart) {
@@ -1715,7 +2171,8 @@ class DbxAngularRouterService {
1715
2171
  return event;
1716
2172
  }), filterMaybe());
1717
2173
  }
1718
- go(segueRef) {
2174
+ go(input) {
2175
+ const segueRef = asSegueRef(input);
1719
2176
  let ref = segueRef.ref;
1720
2177
  if (isArray(ref)) {
1721
2178
  return this.router.navigate(ref, Object.assign(Object.assign({}, segueRef.refOptions), { queryParams: segueRef.refParams }));
@@ -1731,9 +2188,9 @@ class DbxAngularRouterService {
1731
2188
  return 0; // TODO!
1732
2189
  }
1733
2190
  }
1734
- DbxAngularRouterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxAngularRouterService, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Injectable });
1735
- DbxAngularRouterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxAngularRouterService });
1736
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxAngularRouterService, decorators: [{
2191
+ DbxAngularRouterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAngularRouterService, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Injectable });
2192
+ DbxAngularRouterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAngularRouterService });
2193
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAngularRouterService, decorators: [{
1737
2194
  type: Injectable
1738
2195
  }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }]; } });
1739
2196
 
@@ -1743,6 +2200,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
1743
2200
  class DbxRouterService {
1744
2201
  }
1745
2202
 
2203
+ /**
2204
+ * Creates a GoWithRouter function.
2205
+ *
2206
+ * @param dbxRouterService
2207
+ * @returns
2208
+ */
2209
+ function goWithRouter(dbxRouterService) {
2210
+ return (route) => {
2211
+ return firstValueFrom(asObservable(route)).then(x => dbxRouterService.go(x));
2212
+ };
2213
+ }
2214
+
1746
2215
  /**
1747
2216
  * Router service definition that provides high level information about router transitions.
1748
2217
  */
@@ -1767,10 +2236,10 @@ class DbxCoreAngularRouterSegueModule {
1767
2236
  };
1768
2237
  }
1769
2238
  }
1770
- DbxCoreAngularRouterSegueModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreAngularRouterSegueModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1771
- DbxCoreAngularRouterSegueModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreAngularRouterSegueModule });
1772
- DbxCoreAngularRouterSegueModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreAngularRouterSegueModule });
1773
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreAngularRouterSegueModule, decorators: [{
2239
+ DbxCoreAngularRouterSegueModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreAngularRouterSegueModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2240
+ DbxCoreAngularRouterSegueModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreAngularRouterSegueModule });
2241
+ DbxCoreAngularRouterSegueModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreAngularRouterSegueModule });
2242
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreAngularRouterSegueModule, decorators: [{
1774
2243
  type: NgModule,
1775
2244
  args: [{}]
1776
2245
  }] });
@@ -1820,12 +2289,15 @@ class DbxUIRouterService {
1820
2289
  this.state = state;
1821
2290
  this.transitionService = transitionService;
1822
2291
  this.uiRouterGlobals = uiRouterGlobals;
2292
+ this._params = new BehaviorSubject(this.uiRouterGlobals.params);
2293
+ this.params$ = this._params.asObservable();
1823
2294
  this._transitions = new Subject();
1824
2295
  this.transitions$ = this._transitions.asObservable();
1825
2296
  const emitTransition = (type) => {
1826
2297
  this._transitions.next({
1827
2298
  type
1828
2299
  });
2300
+ this._params.next(this.uiRouterGlobals.params);
1829
2301
  };
1830
2302
  this.transitionService.onStart({}, () => {
1831
2303
  emitTransition(DbxRouterTransitionEventType.START);
@@ -1834,27 +2306,46 @@ class DbxUIRouterService {
1834
2306
  emitTransition(DbxRouterTransitionEventType.SUCCESS);
1835
2307
  });
1836
2308
  }
1837
- go(segueRef) {
2309
+ ngOnDestroy() {
2310
+ this._transitions.complete();
2311
+ }
2312
+ get params() {
2313
+ return this.uiRouterGlobals.params;
2314
+ }
2315
+ go(input) {
2316
+ const segueRef = asSegueRef(input);
1838
2317
  const params = Object.assign(Object.assign({}, this.uiRouterGlobals.current.params), segueRef.refParams);
1839
2318
  return this.state.go(segueRef.ref, params, segueRef.refOptions).then(_ => true).catch(_ => false);
1840
2319
  }
1841
- isActive(segueRef) {
2320
+ isActive(input) {
2321
+ const segueRef = asSegueRef(input);
1842
2322
  const { ref, refParams } = segueRef;
1843
2323
  const targetRef = (ref.startsWith('.') ? `^${ref}` : ref);
1844
2324
  const active = this.state.includes(targetRef, refParams);
1845
2325
  return active;
1846
2326
  }
1847
- comparePrecision(a, b) {
1848
- const aLength = a.ref.length;
1849
- const bLength = b.ref.length;
2327
+ comparePrecision(aInput, bInput) {
2328
+ const aRef = readSegueRefString(aInput);
2329
+ const bRef = readSegueRefString(bInput);
2330
+ const aLength = aRef.length;
2331
+ const bLength = bRef.length;
1850
2332
  return (aLength > bLength) ? 1 : (aLength === bLength) ? 0 : -1;
1851
2333
  }
1852
2334
  }
1853
- DbxUIRouterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxUIRouterService, deps: [{ token: i1$2.StateService }, { token: i1$2.TransitionService }, { token: i1$2.UIRouterGlobals }], target: i0.ɵɵFactoryTarget.Injectable });
1854
- DbxUIRouterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxUIRouterService });
1855
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxUIRouterService, decorators: [{
2335
+ DbxUIRouterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxUIRouterService, deps: [{ token: i1$2.StateService }, { token: i1$2.TransitionService }, { token: i1$2.UIRouterGlobals }], target: i0.ɵɵFactoryTarget.Injectable });
2336
+ DbxUIRouterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxUIRouterService });
2337
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxUIRouterService, decorators: [{
1856
2338
  type: Injectable
1857
2339
  }], ctorParameters: function () { return [{ type: i1$2.StateService }, { type: i1$2.TransitionService }, { type: i1$2.UIRouterGlobals }]; } });
2340
+ function readSegueRefString(input) {
2341
+ var _a;
2342
+ if (typeof input === 'string') {
2343
+ return input;
2344
+ }
2345
+ else {
2346
+ return (_a = input === null || input === void 0 ? void 0 : input.ref) !== null && _a !== void 0 ? _a : '';
2347
+ }
2348
+ }
1858
2349
 
1859
2350
  class DbxCoreUIRouterSegueModule {
1860
2351
  static forRoot() {
@@ -1874,10 +2365,10 @@ class DbxCoreUIRouterSegueModule {
1874
2365
  };
1875
2366
  }
1876
2367
  }
1877
- DbxCoreUIRouterSegueModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreUIRouterSegueModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1878
- DbxCoreUIRouterSegueModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreUIRouterSegueModule });
1879
- DbxCoreUIRouterSegueModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreUIRouterSegueModule });
1880
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreUIRouterSegueModule, decorators: [{
2368
+ DbxCoreUIRouterSegueModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreUIRouterSegueModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2369
+ DbxCoreUIRouterSegueModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreUIRouterSegueModule });
2370
+ DbxCoreUIRouterSegueModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreUIRouterSegueModule });
2371
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreUIRouterSegueModule, decorators: [{
1881
2372
  type: NgModule,
1882
2373
  args: [{}]
1883
2374
  }] });
@@ -1902,52 +2393,512 @@ function filterTransitionEvent(type) {
1902
2393
  * Abstract directive that listens to onSuccess transition events and runs a function.
1903
2394
  */
1904
2395
  class AbstractTransitionDirective {
1905
- constructor(dbNgxRouterTransitionService) {
1906
- this.dbNgxRouterTransitionService = dbNgxRouterTransitionService;
1907
- this.transitionSuccess$ = successTransition(this.dbNgxRouterTransitionService.transitions$);
2396
+ constructor(dbxRouterTransitionService) {
2397
+ this.dbxRouterTransitionService = dbxRouterTransitionService;
2398
+ this.transitionSuccess$ = successTransition(this.dbxRouterTransitionService.transitions$);
1908
2399
  this.initAndUpdateOnTransitionSuccess$ = this.transitionSuccess$.pipe(startWith$1(undefined));
1909
2400
  }
1910
2401
  }
1911
- AbstractTransitionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractTransitionDirective, deps: [{ token: DbxRouterTransitionService }], target: i0.ɵɵFactoryTarget.Directive });
1912
- AbstractTransitionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractTransitionDirective, ngImport: i0 });
1913
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractTransitionDirective, decorators: [{
1914
- type: Directive
1915
- }], ctorParameters: function () { return [{ type: DbxRouterTransitionService }]; } });
2402
+ AbstractTransitionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractTransitionDirective, deps: [{ token: DbxRouterTransitionService }], target: i0.ɵɵFactoryTarget.Directive });
2403
+ AbstractTransitionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractTransitionDirective, ngImport: i0 });
2404
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractTransitionDirective, decorators: [{
2405
+ type: Directive
2406
+ }], ctorParameters: function () { return [{ type: DbxRouterTransitionService }]; } });
2407
+
2408
+ /**
2409
+ * Abstract directive that listens to onSuccess transition events and runs a function.
2410
+ */
2411
+ class AbstractTransitionWatcherDirective extends AbstractTransitionDirective {
2412
+ constructor(dbxRouterTransitionService, ngZone) {
2413
+ super(dbxRouterTransitionService);
2414
+ this.ngZone = ngZone;
2415
+ this._transitionSub = new SubscriptionObject();
2416
+ }
2417
+ ngOnInit() {
2418
+ this._transitionSub.subscription = this.transitionSuccess$.subscribe(() => {
2419
+ this.updateForSuccessfulTransition();
2420
+ });
2421
+ }
2422
+ ngOnDestroy() {
2423
+ this._transitionSub.destroy();
2424
+ }
2425
+ // MARK: Action
2426
+ zoneUpdateForSuccessfulTransition() {
2427
+ this.ngZone.run(() => this.updateForSuccessfulTransition());
2428
+ }
2429
+ }
2430
+ AbstractTransitionWatcherDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractTransitionWatcherDirective, deps: [{ token: DbxRouterTransitionService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
2431
+ AbstractTransitionWatcherDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractTransitionWatcherDirective, usesInheritance: true, ngImport: i0 });
2432
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractTransitionWatcherDirective, decorators: [{
2433
+ type: Directive
2434
+ }], ctorParameters: function () { return [{ type: DbxRouterTransitionService }, { type: i0.NgZone }]; } });
2435
+
2436
+ /**
2437
+ * Auth routes configurations for an app.
2438
+ */
2439
+ class DbxAppAuthRoutes {
2440
+ }
2441
+
2442
+ /**
2443
+ * Helper service for navigating to important auth-related routes.
2444
+ */
2445
+ class DbxAppAuthRouterService {
2446
+ constructor(dbxRouterService, dbxAppAuthRoutes) {
2447
+ this.dbxRouterService = dbxRouterService;
2448
+ this.dbxAppAuthRoutes = dbxAppAuthRoutes;
2449
+ }
2450
+ get hasOnboardingState() {
2451
+ return Boolean(this.dbxAppAuthRoutes.onboardRef);
2452
+ }
2453
+ // MARK: Navigate
2454
+ /**
2455
+ * Navigates to the login state.
2456
+ *
2457
+ * @returns
2458
+ */
2459
+ goToLogin() {
2460
+ return goWithRouter(this.dbxRouterService)(this.dbxAppAuthRoutes.loginRef);
2461
+ }
2462
+ /**
2463
+ * Navigates to the logged out state, if it exists, otherwise navigates to the login state.
2464
+ *
2465
+ * @returns
2466
+ */
2467
+ goToLoggedOut() {
2468
+ var _a;
2469
+ return goWithRouter(this.dbxRouterService)((_a = this.dbxAppAuthRoutes.loggedOutRef) !== null && _a !== void 0 ? _a : this.dbxAppAuthRoutes.loginRef);
2470
+ }
2471
+ /**
2472
+ * Navigates to the onboarding state if it is available, otherwise navigates to the app.
2473
+ *
2474
+ * @returns
2475
+ */
2476
+ goToOnboarding() {
2477
+ var _a;
2478
+ return goWithRouter(this.dbxRouterService)((_a = this.dbxAppAuthRoutes.onboardRef) !== null && _a !== void 0 ? _a : this.dbxAppAuthRoutes.appRef);
2479
+ }
2480
+ /**
2481
+ * Navigates to the app state.
2482
+ *
2483
+ * @returns
2484
+ */
2485
+ goToApp() {
2486
+ return goWithRouter(this.dbxRouterService)(this.dbxAppAuthRoutes.appRef);
2487
+ }
2488
+ }
2489
+ DbxAppAuthRouterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterService, deps: [{ token: DbxRouterService }, { token: DbxAppAuthRoutes }], target: i0.ɵɵFactoryTarget.Injectable });
2490
+ DbxAppAuthRouterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterService, providedIn: 'root' });
2491
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterService, decorators: [{
2492
+ type: Injectable,
2493
+ args: [{
2494
+ providedIn: 'root'
2495
+ }]
2496
+ }], ctorParameters: function () { return [{ type: DbxRouterService }, { type: DbxAppAuthRoutes }]; } });
2497
+
2498
+ /**
2499
+ * Used by DbxAppAuthRouterEffects to configure the states that should be activve by default.
2500
+ */
2501
+ const DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN = new InjectionToken('DbxAppAuthRouterEffectsActiveStates');
2502
+ /**
2503
+ * Set of ngrx effects that handle navigation in the app when the auth changes in certain ways.
2504
+ *
2505
+ * Is configurable via the DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN to choose which states this effect is active or not. By default is equal to DBX_KNOWN_APP_CONTEXT_STATES.
2506
+ */
2507
+ class DbxAppAuthRouterEffects extends AbstractOnDbxAppContextStateEffects {
2508
+ constructor(activeStates, actions$, store, dbxAppAuthRouterService) {
2509
+ super(activeStates !== null && activeStates !== void 0 ? activeStates : DBX_KNOWN_APP_CONTEXT_STATES, actions$, store);
2510
+ this.dbxAppAuthRouterService = dbxAppAuthRouterService;
2511
+ /**
2512
+ * Effect to redirect to the login when logout occurs.
2513
+ */
2514
+ this.redirectToLoginOnLogout = createEffect(() => this.actions$.pipe(ofType(loggedOut), exhaustMap$1(() => this.dbxAppAuthRouterService.goToLogin())), { dispatch: false });
2515
+ /**
2516
+ * Effect to redirect to the app when login occurs.
2517
+ */
2518
+ this.redirectToOnboardOnLogIn = createEffect(() => this.actions$.pipe(ofType(loggedIn), exhaustMap$1(() => this.dbxAppAuthRouterService.goToApp())), { dispatch: false });
2519
+ }
2520
+ }
2521
+ DbxAppAuthRouterEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterEffects, deps: [{ token: DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN, optional: true }, { token: i1$3.Actions }, { token: i1$4.Store }, { token: DbxAppAuthRouterService }], target: i0.ɵɵFactoryTarget.Injectable });
2522
+ DbxAppAuthRouterEffects.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterEffects });
2523
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterEffects, decorators: [{
2524
+ type: Injectable
2525
+ }], ctorParameters: function () {
2526
+ return [{ type: undefined, decorators: [{
2527
+ type: Inject,
2528
+ args: [DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN]
2529
+ }, {
2530
+ type: Optional
2531
+ }] }, { type: i1$3.Actions }, { type: i1$4.Store }, { type: DbxAppAuthRouterService }];
2532
+ } });
2533
+
2534
+ class DbxAppAuthRouterStateModule {
2535
+ static forRoot(config) {
2536
+ return {
2537
+ ngModule: DbxAppAuthRouterStateModule,
2538
+ providers: [{
2539
+ provide: DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN,
2540
+ useValue: config.activeRoutesToApplyEffects
2541
+ }]
2542
+ };
2543
+ }
2544
+ }
2545
+ DbxAppAuthRouterStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2546
+ DbxAppAuthRouterStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterStateModule, imports: [i1$3.EffectsFeatureModule] });
2547
+ DbxAppAuthRouterStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterStateModule, imports: [[
2548
+ EffectsModule.forFeature([DbxAppAuthRouterEffects])
2549
+ ]] });
2550
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterStateModule, decorators: [{
2551
+ type: NgModule,
2552
+ args: [{
2553
+ imports: [
2554
+ EffectsModule.forFeature([DbxAppAuthRouterEffects])
2555
+ ],
2556
+ declarations: [],
2557
+ exports: []
2558
+ }]
2559
+ }] });
2560
+
2561
+ class DbxAppAuthRouterModule {
2562
+ static forRoot(dbxAppAuthRoutes) {
2563
+ return {
2564
+ ngModule: DbxAppAuthRouterModule,
2565
+ providers: [{
2566
+ provide: DbxAppAuthRoutes,
2567
+ useValue: dbxAppAuthRoutes
2568
+ }]
2569
+ };
2570
+ }
2571
+ }
2572
+ DbxAppAuthRouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2573
+ DbxAppAuthRouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterModule });
2574
+ DbxAppAuthRouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterModule, imports: [[]] });
2575
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterModule, decorators: [{
2576
+ type: NgModule,
2577
+ args: [{
2578
+ imports: [],
2579
+ declarations: [],
2580
+ exports: []
2581
+ }]
2582
+ }] });
2583
+
2584
+ /**
2585
+ * Convenience operator that emits events when the input observable goes from false to true.
2586
+ *
2587
+ * @param isLoggedInObs
2588
+ * @returns
2589
+ */
2590
+ function loggedInObsFromIsLoggedIn(isLoggedInObs) {
2591
+ return isLoggedInObs.pipe(onFalseToTrue(), map$1(_ => undefined));
2592
+ }
2593
+ /**
2594
+ * Convenience operator that emits events when the input observable goes from true to false.
2595
+ *
2596
+ * @param isLoggedInObs
2597
+ * @returns
2598
+ */
2599
+ function loggedOutObsFromIsLoggedIn(isLoggedInObs) {
2600
+ return isLoggedInObs.pipe(onTrueToFalse(), map$1(_ => undefined));
2601
+ }
2602
+ function authRolesSetContainsAllRolesFrom(roles) {
2603
+ return setContainsAllValuesFrom(roles);
2604
+ }
2605
+ function authRolesSetContainsAnyRoleFrom(roles) {
2606
+ return setContainsAllValuesFrom(roles);
2607
+ }
2608
+
2609
+ /**
2610
+ * Structural decorator directive similar to ngIf that embeds content if the current auth user has any of the target role(s).
2611
+ */
2612
+ class DbxAuthHasAnyRoleDirective extends AbstractIfDirective {
2613
+ constructor(templateRef, viewContainer, dbxAuthService) {
2614
+ super(templateRef, viewContainer);
2615
+ this.dbxAuthService = dbxAuthService;
2616
+ this._targetRoles = new BehaviorSubject(undefined);
2617
+ this.targetRoles$ = this._targetRoles.asObservable();
2618
+ this.show$ = this.dbxAuthService.authRoles$.pipe(authRolesSetContainsAnyRoleFrom(this.targetRoles$));
2619
+ }
2620
+ ngOnDestroy() {
2621
+ this._targetRoles.complete();
2622
+ }
2623
+ set targetRoles(roles) {
2624
+ this._targetRoles.next(roles);
2625
+ }
2626
+ }
2627
+ DbxAuthHasAnyRoleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAuthHasAnyRoleDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: DbxAuthService }], target: i0.ɵɵFactoryTarget.Directive });
2628
+ DbxAuthHasAnyRoleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxAuthHasAnyRoleDirective, selector: "[dbxAuthHasAnyRole]", inputs: { targetRoles: ["dbxAuthHasAnyRole", "targetRoles"] }, usesInheritance: true, ngImport: i0 });
2629
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAuthHasAnyRoleDirective, decorators: [{
2630
+ type: Directive,
2631
+ args: [{
2632
+ selector: '[dbxAuthHasAnyRole]'
2633
+ }]
2634
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: DbxAuthService }]; }, propDecorators: { targetRoles: [{
2635
+ type: Input,
2636
+ args: ['dbxAuthHasAnyRole']
2637
+ }] } });
2638
+
2639
+ /**
2640
+ * Structural decorator directive similar to ngIf that embeds content if the current auth user has all of the target role(s).
2641
+ */
2642
+ class DbxAuthHasRolesDirective extends AbstractIfDirective {
2643
+ constructor(templateRef, viewContainer, dbxAuthService) {
2644
+ super(templateRef, viewContainer);
2645
+ this.dbxAuthService = dbxAuthService;
2646
+ this._targetRoles = new BehaviorSubject(undefined);
2647
+ this.targetRoles$ = this._targetRoles.asObservable();
2648
+ this.show$ = this.dbxAuthService.authRoles$.pipe(authRolesSetContainsAllRolesFrom(this.targetRoles$));
2649
+ }
2650
+ ngOnDestroy() {
2651
+ this._targetRoles.complete();
2652
+ }
2653
+ set targetRoles(roles) {
2654
+ this._targetRoles.next(roles);
2655
+ }
2656
+ }
2657
+ DbxAuthHasRolesDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAuthHasRolesDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: DbxAuthService }], target: i0.ɵɵFactoryTarget.Directive });
2658
+ DbxAuthHasRolesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxAuthHasRolesDirective, selector: "[dbxAuthHasRoles]", inputs: { targetRoles: ["dbxAuthHasRoles", "targetRoles"] }, usesInheritance: true, ngImport: i0 });
2659
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAuthHasRolesDirective, decorators: [{
2660
+ type: Directive,
2661
+ args: [{
2662
+ selector: '[dbxAuthHasRoles]'
2663
+ }]
2664
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: DbxAuthService }]; }, propDecorators: { targetRoles: [{
2665
+ type: Input,
2666
+ args: ['dbxAuthHasRoles']
2667
+ }] } });
2668
+
2669
+ class DbxCoreAuthModule {
2670
+ }
2671
+ DbxCoreAuthModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreAuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2672
+ DbxCoreAuthModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreAuthModule, declarations: [DbxAuthHasRolesDirective,
2673
+ DbxAuthHasAnyRoleDirective], exports: [DbxAuthHasRolesDirective,
2674
+ DbxAuthHasAnyRoleDirective] });
2675
+ DbxCoreAuthModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreAuthModule, imports: [[]] });
2676
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreAuthModule, decorators: [{
2677
+ type: NgModule,
2678
+ args: [{
2679
+ imports: [],
2680
+ declarations: [
2681
+ DbxAuthHasRolesDirective,
2682
+ DbxAuthHasAnyRoleDirective
2683
+ ],
2684
+ exports: [
2685
+ DbxAuthHasRolesDirective,
2686
+ DbxAuthHasAnyRoleDirective
2687
+ ]
2688
+ }]
2689
+ }] });
2690
+
2691
+ /**
2692
+ * Set of ngrx effects that repeat events from DbxAuthService.
2693
+ */
2694
+ class DbxAppAuthEffects {
2695
+ constructor(actions$, store, dbxAuthService) {
2696
+ this.actions$ = actions$;
2697
+ this.store = store;
2698
+ this.dbxAuthService = dbxAuthService;
2699
+ // MARK: Auth
2700
+ this.emitLoggedIn = createEffect(() => this.dbxAuthService.onLogIn$
2701
+ .pipe(map$1(() => loggedIn())));
2702
+ this.emitLoggedOut = createEffect(() => this.dbxAuthService.onLogOut$
2703
+ .pipe(map$1(() => loggedOut())));
2704
+ this.forwardLogoutToAuthService = createEffect(() => this.actions$.pipe(ofType(logout), tap$1(() => {
2705
+ // Perform the logout
2706
+ this.dbxAuthService.logOut();
2707
+ })), { dispatch: false });
2708
+ // MARK: Auth
2709
+ this.setUserIdentifier = createEffect(() => this.dbxAuthService.userIdentifier$
2710
+ .pipe(map$1((id) => setUserIdentifier({ id }))));
2711
+ this.setUserState = createEffect(() => this.dbxAuthService.authUserState$
2712
+ .pipe(map$1((state) => setUserState({ state }))));
2713
+ this.setUserRoles = createEffect(() => this.dbxAuthService.authRoles$
2714
+ .pipe(map$1((roles) => setUserRoles({ roles: Array.from(roles !== null && roles !== void 0 ? roles : []) }))));
2715
+ this.setUserIsOnboarded = createEffect(() => this.dbxAuthService.isOnboarded$
2716
+ .pipe(map$1((isOnboarded) => setUserIsOnboarded({ isOnboarded }))));
2717
+ }
2718
+ }
2719
+ DbxAppAuthEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthEffects, deps: [{ token: i1$3.Actions }, { token: i1$4.Store }, { token: DbxAuthService }], target: i0.ɵɵFactoryTarget.Injectable });
2720
+ DbxAppAuthEffects.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthEffects });
2721
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthEffects, decorators: [{
2722
+ type: Injectable
2723
+ }], ctorParameters: function () { return [{ type: i1$3.Actions }, { type: i1$4.Store }, { type: DbxAuthService }]; } });
2724
+
2725
+ class DbxAppAuthStateModule {
2726
+ }
2727
+ DbxAppAuthStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2728
+ DbxAppAuthStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthStateModule, imports: [i1$4.StoreFeatureModule, i1$3.EffectsFeatureModule] });
2729
+ DbxAppAuthStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthStateModule, imports: [[
2730
+ StoreModule.forFeature(featureKey, reducers),
2731
+ EffectsModule.forFeature([DbxAppAuthEffects])
2732
+ ]] });
2733
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthStateModule, decorators: [{
2734
+ type: NgModule,
2735
+ args: [{
2736
+ imports: [
2737
+ StoreModule.forFeature(featureKey, reducers),
2738
+ EffectsModule.forFeature([DbxAppAuthEffects])
2739
+ ],
2740
+ declarations: [],
2741
+ exports: []
2742
+ }]
2743
+ }] });
2744
+
2745
+ /**
2746
+ * State for accessing the app's DbxAppAuthState defined within the DbxAppAuthFullState for the ngrx store.
2747
+ */
2748
+ class DbxAppAuthStateService {
2749
+ constructor(store) {
2750
+ this.store = store;
2751
+ this.authStateUser$ = this.store.select(selectDbxAppAuthUser);
2752
+ }
2753
+ }
2754
+ DbxAppAuthStateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthStateService, deps: [{ token: i1$4.Store }], target: i0.ɵɵFactoryTarget.Injectable });
2755
+ DbxAppAuthStateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthStateService, providedIn: 'root' });
2756
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthStateService, decorators: [{
2757
+ type: Injectable,
2758
+ args: [{
2759
+ providedIn: 'root'
2760
+ }]
2761
+ }], ctorParameters: function () { return [{ type: i1$4.Store }]; } });
2762
+
2763
+ /**
2764
+ * Convenience function used within observables for views that need to detect changes after a value changes.
2765
+ *
2766
+ * @param cdRef
2767
+ * @param timeout
2768
+ * @returns
2769
+ */
2770
+ function tapDetectChanges(cdRef, timeout = 0) {
2771
+ return tap$1(() => setTimeout(() => safeDetectChanges(cdRef), timeout));
2772
+ }
2773
+ /**
2774
+ * Triggers a detection change on the input view as long as the view has not been destroyed.
2775
+ *
2776
+ * @param cdRef
2777
+ */
2778
+ function safeDetectChanges(cdRef) {
2779
+ safeUseCdRef(cdRef, () => cdRef.detectChanges());
2780
+ }
2781
+ /**
2782
+ * Marks the ChangeDetectorRef for changes as long as the view has not been destroyed.
2783
+ *
2784
+ * @param cdRef
2785
+ */
2786
+ function safeMarkForCheck(cdRef) {
2787
+ safeUseCdRef(cdRef, () => cdRef.markForCheck());
2788
+ }
2789
+ /**
2790
+ * Triggers a detection change on the input view as long as the view has not been destroyed.
2791
+ *
2792
+ * @param cdRef
2793
+ */
2794
+ function safeUseCdRef(cdRef, use) {
2795
+ if (!cdRef.destroyed) {
2796
+ cdRef.markForCheck();
2797
+ }
2798
+ }
2799
+ /**
2800
+ * Used to check an injected ElementRef that wraps an ng-content injection point whether or not any content was injected,
2801
+ * or more specifically if the parent component passed any target content to the child. This will still return true if
2802
+ * passed content is empty.
2803
+ *
2804
+ * TS:
2805
+ * @ViewChild('customLoading', { static: false }) customCustom: ElementRef;
2806
+ *
2807
+ * HTML:
2808
+ * <div #customContent>
2809
+ * <ng-content select="[content]"></ng-content>
2810
+ * </div>
2811
+ */
2812
+ function checkNgContentWrapperHasContent(ref) {
2813
+ // https://github.com/angular/angular/issues/26083
2814
+ let hasContent = false;
2815
+ if (ref != null) {
2816
+ const childNodes = ref.nativeElement.childNodes;
2817
+ const hasChildNodes = childNodes && childNodes.length > 0;
2818
+ hasContent = Boolean(hasChildNodes);
2819
+ }
2820
+ return hasContent;
2821
+ }
2822
+
2823
+ class DbxButton {
2824
+ }
2825
+ function ProvideDbxButton(sourceType) {
2826
+ return [{
2827
+ provide: DbxButton,
2828
+ useExisting: forwardRef(() => sourceType)
2829
+ }];
2830
+ }
2831
+
2832
+ /**
2833
+ * Context used for linking a button to an ActionContext and only look for triggers.
2834
+ */
2835
+ class DbxActionButtonTriggerDirective extends AbstractSubscriptionDirective {
2836
+ constructor(button, source) {
2837
+ super();
2838
+ this.button = button;
2839
+ this.source = source;
2840
+ }
2841
+ ngOnInit() {
2842
+ this.sub = this.button.clicked$.subscribe(() => {
2843
+ this._buttonClicked();
2844
+ });
2845
+ }
2846
+ _buttonClicked() {
2847
+ this.source.trigger();
2848
+ }
2849
+ }
2850
+ DbxActionButtonTriggerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionButtonTriggerDirective, deps: [{ token: DbxButton, host: true }, { token: DbxActionContextStoreSourceInstance }], target: i0.ɵɵFactoryTarget.Directive });
2851
+ DbxActionButtonTriggerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionButtonTriggerDirective, selector: "[dbxActionButtonTrigger]", usesInheritance: true, ngImport: i0 });
2852
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionButtonTriggerDirective, decorators: [{
2853
+ type: Directive,
2854
+ args: [{
2855
+ selector: '[dbxActionButtonTrigger]'
2856
+ }]
2857
+ }], ctorParameters: function () {
2858
+ return [{ type: DbxButton, decorators: [{
2859
+ type: Host
2860
+ }] }, { type: DbxActionContextStoreSourceInstance }];
2861
+ } });
1916
2862
 
1917
2863
  /**
1918
- * Abstract directive that listens to onSuccess transition events and runs a function.
2864
+ * Context used for linking a button to an ActionContext.
1919
2865
  */
1920
- class AbstractTransitionWatcherDirective extends AbstractTransitionDirective {
1921
- constructor(dbNgxRouterTransitionService, ngZone) {
1922
- super(dbNgxRouterTransitionService);
1923
- this.ngZone = ngZone;
1924
- this._transitionSub = new SubscriptionObject();
2866
+ class DbxActionButtonDirective extends DbxActionButtonTriggerDirective {
2867
+ constructor(button, source, cdRef) {
2868
+ super(button, source);
2869
+ this.cdRef = cdRef;
2870
+ this._workingSub = new SubscriptionObject();
2871
+ this._disabledSub = new SubscriptionObject();
1925
2872
  }
1926
2873
  ngOnInit() {
1927
- this._transitionSub.subscription = this.transitionSuccess$.subscribe(() => {
1928
- this.updateForSuccessfulTransition();
2874
+ super.ngOnInit();
2875
+ this._workingSub.subscription = this.source.isWorking$.subscribe((working) => {
2876
+ this.button.working = working;
2877
+ safeDetectChanges(this.cdRef);
2878
+ });
2879
+ this._disabledSub.subscription = this.source.isDisabled$.subscribe((disabled) => {
2880
+ this.button.disabled = disabled;
2881
+ safeDetectChanges(this.cdRef);
1929
2882
  });
1930
2883
  }
1931
2884
  ngOnDestroy() {
1932
- this._transitionSub.destroy();
1933
- }
1934
- // MARK: Action
1935
- zoneUpdateForSuccessfulTransition() {
1936
- this.ngZone.run(() => this.updateForSuccessfulTransition());
2885
+ super.ngOnDestroy();
2886
+ this._workingSub.destroy();
2887
+ this._disabledSub.destroy();
1937
2888
  }
1938
2889
  }
1939
- AbstractTransitionWatcherDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractTransitionWatcherDirective, deps: [{ token: DbxRouterTransitionService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
1940
- AbstractTransitionWatcherDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractTransitionWatcherDirective, usesInheritance: true, ngImport: i0 });
1941
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractTransitionWatcherDirective, decorators: [{
1942
- type: Directive
1943
- }], ctorParameters: function () { return [{ type: DbxRouterTransitionService }, { type: i0.NgZone }]; } });
1944
-
1945
- function refStringToSegueRef(ref, options) {
1946
- return Object.assign(Object.assign({}, options), { ref });
1947
- }
1948
- function mapRefStringObsToSegueRefObs(obs, options) {
1949
- return obs.pipe(map(x => refStringToSegueRef(x, options)));
1950
- }
2890
+ DbxActionButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionButtonDirective, deps: [{ token: DbxButton, host: true }, { token: DbxActionContextStoreSourceInstance }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
2891
+ DbxActionButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionButtonDirective, selector: "[dbxActionButton]", usesInheritance: true, ngImport: i0 });
2892
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionButtonDirective, decorators: [{
2893
+ type: Directive,
2894
+ args: [{
2895
+ selector: '[dbxActionButton]'
2896
+ }]
2897
+ }], ctorParameters: function () {
2898
+ return [{ type: DbxButton, decorators: [{
2899
+ type: Host
2900
+ }] }, { type: DbxActionContextStoreSourceInstance }, { type: i0.ChangeDetectorRef }];
2901
+ } });
1951
2902
 
1952
2903
  // MARK: Button Directives
1953
2904
  class DbxButtonSegueDirective extends AbstractSubscriptionDirective {
@@ -1969,10 +2920,14 @@ class DbxButtonSegueDirective extends AbstractSubscriptionDirective {
1969
2920
  this.dbxRouterService.go(segueRef);
1970
2921
  })))).subscribe();
1971
2922
  }
2923
+ ngOnDestroy() {
2924
+ super.ngOnDestroy();
2925
+ this._segueRef.complete();
2926
+ }
1972
2927
  }
1973
- DbxButtonSegueDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxButtonSegueDirective, deps: [{ token: DbxButton }, { token: DbxRouterService }], target: i0.ɵɵFactoryTarget.Directive });
1974
- DbxButtonSegueDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxButtonSegueDirective, selector: "[dbxButtonSegue]", inputs: { segueRef: ["dbxButtonSegue", "segueRef"] }, usesInheritance: true, ngImport: i0 });
1975
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxButtonSegueDirective, decorators: [{
2928
+ DbxButtonSegueDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxButtonSegueDirective, deps: [{ token: DbxButton }, { token: DbxRouterService }], target: i0.ɵɵFactoryTarget.Directive });
2929
+ DbxButtonSegueDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxButtonSegueDirective, selector: "[dbxButtonSegue]", inputs: { segueRef: ["dbxButtonSegue", "segueRef"] }, usesInheritance: true, ngImport: i0 });
2930
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxButtonSegueDirective, decorators: [{
1976
2931
  type: Directive,
1977
2932
  args: [{
1978
2933
  selector: '[dbxButtonSegue]'
@@ -2053,9 +3008,9 @@ class AbstractDbxButtonDirective extends AbstractSubscriptionDirective {
2053
3008
  this.buttonClick.emit();
2054
3009
  }
2055
3010
  }
2056
- AbstractDbxButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractDbxButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2057
- AbstractDbxButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractDbxButtonDirective, inputs: { disabled: "disabled", working: "working", icon: "icon", text: "text" }, outputs: { buttonClick: "buttonClick" }, usesInheritance: true, ngImport: i0 });
2058
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractDbxButtonDirective, decorators: [{
3011
+ AbstractDbxButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3012
+ AbstractDbxButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractDbxButtonDirective, inputs: { disabled: "disabled", working: "working", icon: "icon", text: "text" }, outputs: { buttonClick: "buttonClick" }, usesInheritance: true, ngImport: i0 });
3013
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxButtonDirective, decorators: [{
2059
3014
  type: Directive
2060
3015
  }], ctorParameters: function () { return []; }, propDecorators: { disabled: [{
2061
3016
  type: Input
@@ -2074,9 +3029,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
2074
3029
  */
2075
3030
  class DbxButtonDirective extends AbstractDbxButtonDirective {
2076
3031
  }
2077
- DbxButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxButtonDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
2078
- DbxButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxButtonDirective, selector: "[dbxButton]", providers: ProvideDbxButton(DbxButtonDirective), exportAs: ["dbxButton"], usesInheritance: true, ngImport: i0 });
2079
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxButtonDirective, decorators: [{
3032
+ DbxButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxButtonDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
3033
+ DbxButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxButtonDirective, selector: "[dbxButton]", providers: ProvideDbxButton(DbxButtonDirective), exportAs: ["dbxButton"], usesInheritance: true, ngImport: i0 });
3034
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxButtonDirective, decorators: [{
2080
3035
  type: Directive,
2081
3036
  args: [{
2082
3037
  selector: '[dbxButton]',
@@ -2109,9 +3064,9 @@ class DbxLoadingButtonDirective extends AbstractSubscriptionDirective {
2109
3064
  this.sub = subscription;
2110
3065
  }
2111
3066
  }
2112
- DbxLoadingButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxLoadingButtonDirective, deps: [{ token: DbxButton, host: true }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
2113
- DbxLoadingButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxLoadingButtonDirective, selector: "[dbxLoadingButton]", inputs: { context: ["dbxLoadingButton", "context"] }, usesInheritance: true, ngImport: i0 });
2114
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxLoadingButtonDirective, decorators: [{
3067
+ DbxLoadingButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxLoadingButtonDirective, deps: [{ token: DbxButton, host: true }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
3068
+ DbxLoadingButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxLoadingButtonDirective, selector: "[dbxLoadingButton]", inputs: { context: ["dbxLoadingButton", "context"] }, usesInheritance: true, ngImport: i0 });
3069
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxLoadingButtonDirective, decorators: [{
2115
3070
  type: Directive,
2116
3071
  args: [{
2117
3072
  selector: '[dbxLoadingButton]'
@@ -2127,8 +3082,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
2127
3082
 
2128
3083
  class DbxCoreButtonModule {
2129
3084
  }
2130
- DbxCoreButtonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2131
- DbxCoreButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreButtonModule, declarations: [DbxButtonDirective,
3085
+ DbxCoreButtonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3086
+ DbxCoreButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreButtonModule, declarations: [DbxButtonDirective,
2132
3087
  DbxLoadingButtonDirective,
2133
3088
  DbxActionButtonTriggerDirective,
2134
3089
  DbxActionButtonDirective,
@@ -2137,8 +3092,8 @@ DbxCoreButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", ver
2137
3092
  DbxActionButtonTriggerDirective,
2138
3093
  DbxActionButtonDirective,
2139
3094
  DbxButtonSegueDirective] });
2140
- DbxCoreButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreButtonModule, imports: [[]] });
2141
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreButtonModule, decorators: [{
3095
+ DbxCoreButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreButtonModule, imports: [[]] });
3096
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreButtonModule, decorators: [{
2142
3097
  type: NgModule,
2143
3098
  args: [{
2144
3099
  imports: [],
@@ -2159,6 +3114,86 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
2159
3114
  }]
2160
3115
  }] });
2161
3116
 
3117
+ /**
3118
+ * State for accessing the app's DbxAppContextState defined within the DbxAppContextFullState for the ngrx store.
3119
+ */
3120
+ class DbxAppContextService {
3121
+ constructor(store) {
3122
+ this.store = store;
3123
+ this.state$ = this.store.select(selectDbxAppContextState);
3124
+ }
3125
+ setState(state) {
3126
+ this.store.dispatch(setState({ state }));
3127
+ }
3128
+ resetState() {
3129
+ this.store.next(resetState());
3130
+ }
3131
+ }
3132
+ DbxAppContextService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppContextService, deps: [{ token: i1$4.Store }], target: i0.ɵɵFactoryTarget.Injectable });
3133
+ DbxAppContextService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppContextService, providedIn: 'root' });
3134
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppContextService, decorators: [{
3135
+ type: Injectable,
3136
+ args: [{
3137
+ providedIn: 'root'
3138
+ }]
3139
+ }], ctorParameters: function () { return [{ type: i1$4.Store }]; } });
3140
+
3141
+ /**
3142
+ * Used to set the DbxAppContextState for an app to the input state using the DbxAppContextService.
3143
+ */
3144
+ class DbxAppContextStateDirective extends AbstractSubscriptionDirective {
3145
+ constructor(dbxAppContextStateService) {
3146
+ super();
3147
+ this.dbxAppContextStateService = dbxAppContextStateService;
3148
+ this._state = new BehaviorSubject(undefined);
3149
+ }
3150
+ ngOnInit() {
3151
+ this.sub = this._state.pipe(filterMaybe()).subscribe((state) => {
3152
+ this.dbxAppContextStateService.setState(state);
3153
+ });
3154
+ }
3155
+ ngOnDestroy() {
3156
+ super.ngOnDestroy();
3157
+ this._state.complete();
3158
+ }
3159
+ set state(state) {
3160
+ this._state.next(state);
3161
+ }
3162
+ }
3163
+ DbxAppContextStateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppContextStateDirective, deps: [{ token: DbxAppContextService }], target: i0.ɵɵFactoryTarget.Directive });
3164
+ DbxAppContextStateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxAppContextStateDirective, selector: "[dbxAppContextState]", inputs: { state: ["dbxAppContextState", "state"] }, usesInheritance: true, ngImport: i0 });
3165
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppContextStateDirective, decorators: [{
3166
+ type: Directive,
3167
+ args: [{
3168
+ selector: '[dbxAppContextState]'
3169
+ }]
3170
+ }], ctorParameters: function () { return [{ type: DbxAppContextService }]; }, propDecorators: { state: [{
3171
+ type: Input,
3172
+ args: ['dbxAppContextState']
3173
+ }] } });
3174
+
3175
+ class DbxAppContextStateModule {
3176
+ }
3177
+ DbxAppContextStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppContextStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3178
+ DbxAppContextStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppContextStateModule, declarations: [DbxAppContextStateDirective], imports: [i1$4.StoreFeatureModule], exports: [DbxAppContextStateDirective] });
3179
+ DbxAppContextStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppContextStateModule, imports: [[
3180
+ StoreModule.forFeature(featureKey$1, reducers$1)
3181
+ ]] });
3182
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppContextStateModule, decorators: [{
3183
+ type: NgModule,
3184
+ args: [{
3185
+ imports: [
3186
+ StoreModule.forFeature(featureKey$1, reducers$1)
3187
+ ],
3188
+ declarations: [
3189
+ DbxAppContextStateDirective
3190
+ ],
3191
+ exports: [
3192
+ DbxAppContextStateDirective
3193
+ ]
3194
+ }]
3195
+ }] });
3196
+
2162
3197
  /**
2163
3198
  * Pipe that takes in a date and number of minutes and outputs a formatted date.
2164
3199
  */
@@ -2179,9 +3214,9 @@ class DateFromToTimePipe {
2179
3214
  return undefined;
2180
3215
  }
2181
3216
  }
2182
- DateFromToTimePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DateFromToTimePipe, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe });
2183
- DateFromToTimePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DateFromToTimePipe, name: "dateFromPlusTo" });
2184
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DateFromToTimePipe, decorators: [{
3217
+ DateFromToTimePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DateFromToTimePipe, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe });
3218
+ DateFromToTimePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DateFromToTimePipe, name: "dateFromPlusTo" });
3219
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DateFromToTimePipe, decorators: [{
2185
3220
  type: Pipe,
2186
3221
  args: [{ name: 'dateFromPlusTo' }]
2187
3222
  }], ctorParameters: function () {
@@ -2214,24 +3249,31 @@ class MinutesStringPipe {
2214
3249
  }
2215
3250
  }
2216
3251
  }
2217
- MinutesStringPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: MinutesStringPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2218
- MinutesStringPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: MinutesStringPipe, name: "minutesString", pure: false });
2219
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: MinutesStringPipe, decorators: [{
3252
+ MinutesStringPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: MinutesStringPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3253
+ MinutesStringPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: MinutesStringPipe, name: "minutesString", pure: false });
3254
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: MinutesStringPipe, decorators: [{
2220
3255
  type: Pipe,
2221
3256
  args: [{ name: 'minutesString', pure: false }]
2222
3257
  }] });
2223
3258
 
2224
3259
  class ToJsDatePipe {
2225
3260
  static toJsDate(input) {
2226
- return (input) ? toJsDate(input) : undefined;
3261
+ let date;
3262
+ if (input != null) {
3263
+ date = toJsDate(input);
3264
+ if (!isValid(date)) {
3265
+ date = undefined;
3266
+ }
3267
+ }
3268
+ return date;
2227
3269
  }
2228
3270
  transform(input) {
2229
3271
  return ToJsDatePipe.toJsDate(input);
2230
3272
  }
2231
3273
  }
2232
- ToJsDatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: ToJsDatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2233
- ToJsDatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: ToJsDatePipe, name: "toJsDate" });
2234
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: ToJsDatePipe, decorators: [{
3274
+ ToJsDatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ToJsDatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3275
+ ToJsDatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ToJsDatePipe, name: "toJsDate" });
3276
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ToJsDatePipe, decorators: [{
2235
3277
  type: Pipe,
2236
3278
  args: [{ name: 'toJsDate' }]
2237
3279
  }] });
@@ -2255,9 +3297,9 @@ class TimeDistanceCountdownPipe {
2255
3297
  }
2256
3298
  }
2257
3299
  }
2258
- TimeDistanceCountdownPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: TimeDistanceCountdownPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2259
- TimeDistanceCountdownPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: TimeDistanceCountdownPipe, name: "timeCountdownDistance", pure: false });
2260
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: TimeDistanceCountdownPipe, decorators: [{
3300
+ TimeDistanceCountdownPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TimeDistanceCountdownPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3301
+ TimeDistanceCountdownPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TimeDistanceCountdownPipe, name: "timeCountdownDistance", pure: false });
3302
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TimeDistanceCountdownPipe, decorators: [{
2261
3303
  type: Pipe,
2262
3304
  args: [{ name: 'timeCountdownDistance', pure: false }]
2263
3305
  }] });
@@ -2274,9 +3316,9 @@ class TimeDistancePipe {
2274
3316
  }
2275
3317
  }
2276
3318
  }
2277
- TimeDistancePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: TimeDistancePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2278
- TimeDistancePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: TimeDistancePipe, name: "timeDistance", pure: false });
2279
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: TimeDistancePipe, decorators: [{
3319
+ TimeDistancePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TimeDistancePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3320
+ TimeDistancePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TimeDistancePipe, name: "timeDistance", pure: false });
3321
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TimeDistancePipe, decorators: [{
2280
3322
  type: Pipe,
2281
3323
  args: [{ name: 'timeDistance', pure: false }]
2282
3324
  }] });
@@ -2289,9 +3331,9 @@ class ToMinutesPipe {
2289
3331
  return milliseconds;
2290
3332
  }
2291
3333
  }
2292
- ToMinutesPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: ToMinutesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2293
- ToMinutesPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: ToMinutesPipe, name: "toMinutes" });
2294
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: ToMinutesPipe, decorators: [{
3334
+ ToMinutesPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ToMinutesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3335
+ ToMinutesPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ToMinutesPipe, name: "toMinutes" });
3336
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ToMinutesPipe, decorators: [{
2295
3337
  type: Pipe,
2296
3338
  args: [{ name: 'toMinutes' }]
2297
3339
  }] });
@@ -2318,9 +3360,9 @@ class DateFormatDistancePipe {
2318
3360
  return undefined;
2319
3361
  }
2320
3362
  }
2321
- DateFormatDistancePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DateFormatDistancePipe, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe });
2322
- DateFormatDistancePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DateFormatDistancePipe, name: "dateFormatDistance", pure: false });
2323
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DateFormatDistancePipe, decorators: [{
3363
+ DateFormatDistancePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DateFormatDistancePipe, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe });
3364
+ DateFormatDistancePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DateFormatDistancePipe, name: "dateFormatDistance", pure: false });
3365
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DateFormatDistancePipe, decorators: [{
2324
3366
  type: Pipe,
2325
3367
  args: [{ name: 'dateFormatDistance', pure: false }]
2326
3368
  }], ctorParameters: function () {
@@ -2361,17 +3403,17 @@ class DateDistancePipe {
2361
3403
  }
2362
3404
  }
2363
3405
  }
2364
- DateDistancePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DateDistancePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2365
- DateDistancePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DateDistancePipe, name: "dateDistance", pure: false });
2366
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DateDistancePipe, decorators: [{
3406
+ DateDistancePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DateDistancePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3407
+ DateDistancePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DateDistancePipe, name: "dateDistance", pure: false });
3408
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DateDistancePipe, decorators: [{
2367
3409
  type: Pipe,
2368
3410
  args: [{ name: 'dateDistance', pure: false }]
2369
3411
  }] });
2370
3412
 
2371
3413
  class DbxDatePipeModule {
2372
3414
  }
2373
- DbxDatePipeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxDatePipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2374
- DbxDatePipeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxDatePipeModule, declarations: [DateFromToTimePipe,
3415
+ DbxDatePipeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxDatePipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3416
+ DbxDatePipeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxDatePipeModule, declarations: [DateFromToTimePipe,
2375
3417
  DateFormatDistancePipe,
2376
3418
  MinutesStringPipe,
2377
3419
  TimeDistanceCountdownPipe,
@@ -2386,8 +3428,8 @@ DbxDatePipeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versi
2386
3428
  DateDistancePipe,
2387
3429
  ToJsDatePipe,
2388
3430
  ToMinutesPipe] });
2389
- DbxDatePipeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxDatePipeModule });
2390
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxDatePipeModule, decorators: [{
3431
+ DbxDatePipeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxDatePipeModule });
3432
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxDatePipeModule, decorators: [{
2391
3433
  type: NgModule,
2392
3434
  args: [{
2393
3435
  exports: [
@@ -2413,6 +3455,65 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
2413
3455
  }]
2414
3456
  }] });
2415
3457
 
3458
+ class PrettyJsonPipe {
3459
+ static toPrettyJson(input, spacing = 2) {
3460
+ let json;
3461
+ if (input) {
3462
+ try {
3463
+ json = JSON.stringify(input, null, spacing);
3464
+ }
3465
+ catch (e) {
3466
+ console.error('prettyjson pipe failed parsing input: ', input);
3467
+ json = 'ERROR';
3468
+ }
3469
+ }
3470
+ return json;
3471
+ }
3472
+ transform(input, spacing) {
3473
+ return PrettyJsonPipe.toPrettyJson(input, spacing);
3474
+ }
3475
+ }
3476
+ PrettyJsonPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: PrettyJsonPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3477
+ PrettyJsonPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: PrettyJsonPipe, name: "prettyjson" });
3478
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: PrettyJsonPipe, decorators: [{
3479
+ type: Pipe,
3480
+ args: [{ name: 'prettyjson' }]
3481
+ }] });
3482
+
3483
+ class DbxMiscPipeModule {
3484
+ }
3485
+ DbxMiscPipeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxMiscPipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3486
+ DbxMiscPipeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxMiscPipeModule, declarations: [PrettyJsonPipe], exports: [PrettyJsonPipe] });
3487
+ DbxMiscPipeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxMiscPipeModule });
3488
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxMiscPipeModule, decorators: [{
3489
+ type: NgModule,
3490
+ args: [{
3491
+ exports: [
3492
+ PrettyJsonPipe
3493
+ ],
3494
+ declarations: [
3495
+ PrettyJsonPipe
3496
+ ]
3497
+ }]
3498
+ }] });
3499
+
3500
+ class DbxPipesModule {
3501
+ }
3502
+ DbxPipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxPipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3503
+ DbxPipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxPipesModule, exports: [DbxMiscPipeModule,
3504
+ DbxDatePipeModule] });
3505
+ DbxPipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxPipesModule, imports: [DbxMiscPipeModule,
3506
+ DbxDatePipeModule] });
3507
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxPipesModule, decorators: [{
3508
+ type: NgModule,
3509
+ args: [{
3510
+ exports: [
3511
+ DbxMiscPipeModule,
3512
+ DbxDatePipeModule,
3513
+ ]
3514
+ }]
3515
+ }] });
3516
+
2416
3517
  /**
2417
3518
  * Abstract FilterSource implementation.
2418
3519
  */
@@ -2441,9 +3542,9 @@ class AbstractFilterSourceDirective {
2441
3542
  return of(undefined);
2442
3543
  }
2443
3544
  }
2444
- AbstractFilterSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractFilterSourceDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2445
- AbstractFilterSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractFilterSourceDirective, ngImport: i0 });
2446
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractFilterSourceDirective, decorators: [{
3545
+ AbstractFilterSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractFilterSourceDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3546
+ AbstractFilterSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractFilterSourceDirective, ngImport: i0 });
3547
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractFilterSourceDirective, decorators: [{
2447
3548
  type: Directive
2448
3549
  }] });
2449
3550
 
@@ -2466,13 +3567,13 @@ class AbstractActionFilterSourceDirective extends AbstractFilterSourceDirective
2466
3567
  this.filterAction.trigger();
2467
3568
  }
2468
3569
  }
2469
- AbstractActionFilterSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractActionFilterSourceDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
2470
- AbstractActionFilterSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractActionFilterSourceDirective, viewQueries: [{ propertyName: "filterAction", first: true, predicate: ActionContextStoreSourceInstance, descendants: true, read: ActionContextStoreSourceInstance, static: true }], usesInheritance: true, ngImport: i0 });
2471
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractActionFilterSourceDirective, decorators: [{
3570
+ AbstractActionFilterSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractActionFilterSourceDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
3571
+ AbstractActionFilterSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractActionFilterSourceDirective, viewQueries: [{ propertyName: "filterAction", first: true, predicate: DbxActionContextStoreSourceInstance, descendants: true, read: DbxActionContextStoreSourceInstance, static: true }], usesInheritance: true, ngImport: i0 });
3572
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractActionFilterSourceDirective, decorators: [{
2472
3573
  type: Directive
2473
3574
  }], propDecorators: { filterAction: [{
2474
3575
  type: ViewChild,
2475
- args: [ActionContextStoreSourceInstance, { static: true, read: ActionContextStoreSourceInstance }]
3576
+ args: [DbxActionContextStoreSourceInstance, { static: true, read: DbxActionContextStoreSourceInstance }]
2476
3577
  }] } });
2477
3578
 
2478
3579
  /**
@@ -2490,9 +3591,9 @@ class AbstractFilterSourceConnectorDirective {
2490
3591
  this._source.next(filterSource);
2491
3592
  }
2492
3593
  }
2493
- AbstractFilterSourceConnectorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractFilterSourceConnectorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2494
- AbstractFilterSourceConnectorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractFilterSourceConnectorDirective, ngImport: i0 });
2495
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractFilterSourceConnectorDirective, decorators: [{
3594
+ AbstractFilterSourceConnectorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractFilterSourceConnectorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3595
+ AbstractFilterSourceConnectorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractFilterSourceConnectorDirective, ngImport: i0 });
3596
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractFilterSourceConnectorDirective, decorators: [{
2496
3597
  type: Directive
2497
3598
  }] });
2498
3599
 
@@ -2523,12 +3624,12 @@ function ProvideFilterSourceConnector(sourceType) {
2523
3624
  */
2524
3625
  class DbxFilterSourceConnectorDirective extends AbstractFilterSourceConnectorDirective {
2525
3626
  }
2526
- DbxFilterSourceConnectorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFilterSourceConnectorDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
2527
- DbxFilterSourceConnectorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxFilterSourceConnectorDirective, selector: "[dbxFilterSourceConnector]", providers: [
3627
+ DbxFilterSourceConnectorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFilterSourceConnectorDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
3628
+ DbxFilterSourceConnectorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFilterSourceConnectorDirective, selector: "[dbxFilterSourceConnector]", providers: [
2528
3629
  ...ProvideFilterSource(DbxFilterSourceConnectorDirective),
2529
3630
  ...ProvideFilterSourceConnector(DbxFilterSourceConnectorDirective)
2530
3631
  ], usesInheritance: true, ngImport: i0 });
2531
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFilterSourceConnectorDirective, decorators: [{
3632
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFilterSourceConnectorDirective, decorators: [{
2532
3633
  type: Directive,
2533
3634
  args: [{
2534
3635
  selector: '[dbxFilterSourceConnector]',
@@ -2553,11 +3654,11 @@ class AbstractDbxFilterMapInstanceDirective {
2553
3654
  this._key.complete();
2554
3655
  }
2555
3656
  }
2556
- AbstractDbxFilterMapInstanceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractDbxFilterMapInstanceDirective, deps: [{ token: i1$3.FilterMap }], target: i0.ɵɵFactoryTarget.Directive });
2557
- AbstractDbxFilterMapInstanceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractDbxFilterMapInstanceDirective, ngImport: i0 });
2558
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractDbxFilterMapInstanceDirective, decorators: [{
3657
+ AbstractDbxFilterMapInstanceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxFilterMapInstanceDirective, deps: [{ token: i1$5.FilterMap }], target: i0.ɵɵFactoryTarget.Directive });
3658
+ AbstractDbxFilterMapInstanceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractDbxFilterMapInstanceDirective, ngImport: i0 });
3659
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxFilterMapInstanceDirective, decorators: [{
2559
3660
  type: Directive
2560
- }], ctorParameters: function () { return [{ type: i1$3.FilterMap }]; } });
3661
+ }], ctorParameters: function () { return [{ type: i1$5.FilterMap }]; } });
2561
3662
 
2562
3663
  /**
2563
3664
  * Provides a FilterSource from a parent FilterMap.
@@ -2577,11 +3678,11 @@ class DbxFilterMapSourceDirective extends AbstractDbxFilterMapInstanceDirective
2577
3678
  this.instance$.pipe(first$1()).subscribe((x) => x.initWithFilter(filterObs));
2578
3679
  }
2579
3680
  }
2580
- DbxFilterMapSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFilterMapSourceDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
2581
- DbxFilterMapSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxFilterMapSourceDirective, selector: "[dbxFilterMapSource]", inputs: { key: ["dbxFilterMapSource", "key"] }, providers: [
3681
+ DbxFilterMapSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFilterMapSourceDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
3682
+ DbxFilterMapSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFilterMapSourceDirective, selector: "[dbxFilterMapSource]", inputs: { key: ["dbxFilterMapSource", "key"] }, providers: [
2582
3683
  ...ProvideFilterSource(DbxFilterMapSourceDirective)
2583
3684
  ], exportAs: ["dbxFilterMapSource"], usesInheritance: true, ngImport: i0 });
2584
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFilterMapSourceDirective, decorators: [{
3685
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFilterMapSourceDirective, decorators: [{
2585
3686
  type: Directive,
2586
3687
  args: [{
2587
3688
  selector: '[dbxFilterMapSource]',
@@ -2610,12 +3711,12 @@ class DbxFilterMapSourceConnectorDirective extends DbxFilterMapSourceDirective {
2610
3711
  this.instance$.pipe(first$1()).subscribe((x) => x.connectWithSource(filterSource));
2611
3712
  }
2612
3713
  }
2613
- DbxFilterMapSourceConnectorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFilterMapSourceConnectorDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
2614
- DbxFilterMapSourceConnectorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxFilterMapSourceConnectorDirective, selector: "[dbxFilterMapSourceConnector]", inputs: { key: ["dbxFilterMapSourceConnector", "key"] }, providers: [
3714
+ DbxFilterMapSourceConnectorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFilterMapSourceConnectorDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
3715
+ DbxFilterMapSourceConnectorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFilterMapSourceConnectorDirective, selector: "[dbxFilterMapSourceConnector]", inputs: { key: ["dbxFilterMapSourceConnector", "key"] }, providers: [
2615
3716
  ...ProvideFilterSource(DbxFilterMapSourceConnectorDirective),
2616
3717
  ...ProvideFilterSourceConnector(DbxFilterMapSourceConnectorDirective)
2617
3718
  ], exportAs: ["dbxFilterMapSourceConnector"], usesInheritance: true, ngImport: i0 });
2618
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFilterMapSourceConnectorDirective, decorators: [{
3719
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFilterMapSourceConnectorDirective, decorators: [{
2619
3720
  type: Directive,
2620
3721
  args: [{
2621
3722
  selector: '[dbxFilterMapSourceConnector]',
@@ -2641,25 +3742,25 @@ class DbxFilterMapDirective {
2641
3742
  this.filterMap.destroy();
2642
3743
  }
2643
3744
  }
2644
- DbxFilterMapDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFilterMapDirective, deps: [{ token: i1$3.FilterMap }], target: i0.ɵɵFactoryTarget.Directive });
2645
- DbxFilterMapDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxFilterMapDirective, selector: "[dbxFilterMap]", providers: [FilterMap], exportAs: ["dbxFilterMap"], ngImport: i0 });
2646
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFilterMapDirective, decorators: [{
3745
+ DbxFilterMapDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFilterMapDirective, deps: [{ token: i1$5.FilterMap }], target: i0.ɵɵFactoryTarget.Directive });
3746
+ DbxFilterMapDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFilterMapDirective, selector: "[dbxFilterMap]", providers: [FilterMap], exportAs: ["dbxFilterMap"], ngImport: i0 });
3747
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFilterMapDirective, decorators: [{
2647
3748
  type: Directive,
2648
3749
  args: [{
2649
3750
  selector: '[dbxFilterMap]',
2650
3751
  exportAs: 'dbxFilterMap',
2651
3752
  providers: [FilterMap]
2652
3753
  }]
2653
- }], ctorParameters: function () { return [{ type: i1$3.FilterMap }]; } });
3754
+ }], ctorParameters: function () { return [{ type: i1$5.FilterMap }]; } });
2654
3755
 
2655
3756
  /**
2656
3757
  * Basic filter source directive.
2657
3758
  */
2658
3759
  class DbxFilterSourceDirective extends AbstractFilterSourceDirective {
2659
3760
  }
2660
- DbxFilterSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFilterSourceDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
2661
- DbxFilterSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxFilterSourceDirective, selector: "[dbxFilterSource]", providers: ProvideFilterSource(DbxFilterSourceDirective), usesInheritance: true, ngImport: i0 });
2662
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFilterSourceDirective, decorators: [{
3761
+ DbxFilterSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFilterSourceDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
3762
+ DbxFilterSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFilterSourceDirective, selector: "[dbxFilterSource]", providers: ProvideFilterSource(DbxFilterSourceDirective), usesInheritance: true, ngImport: i0 });
3763
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFilterSourceDirective, decorators: [{
2663
3764
  type: Directive,
2664
3765
  args: [{
2665
3766
  selector: '[dbxFilterSource]',
@@ -2669,8 +3770,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
2669
3770
 
2670
3771
  class DbxCoreFilterModule {
2671
3772
  }
2672
- DbxCoreFilterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreFilterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2673
- DbxCoreFilterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreFilterModule, declarations: [DbxFilterSourceDirective,
3773
+ DbxCoreFilterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreFilterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3774
+ DbxCoreFilterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreFilterModule, declarations: [DbxFilterSourceDirective,
2674
3775
  DbxFilterSourceConnectorDirective,
2675
3776
  DbxFilterMapDirective,
2676
3777
  DbxFilterMapSourceConnectorDirective,
@@ -2679,10 +3780,10 @@ DbxCoreFilterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", ver
2679
3780
  DbxFilterMapDirective,
2680
3781
  DbxFilterMapSourceConnectorDirective,
2681
3782
  DbxFilterMapSourceDirective] });
2682
- DbxCoreFilterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreFilterModule, imports: [[
3783
+ DbxCoreFilterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreFilterModule, imports: [[
2683
3784
  CommonModule
2684
3785
  ]] });
2685
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreFilterModule, decorators: [{
3786
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreFilterModule, decorators: [{
2686
3787
  type: NgModule,
2687
3788
  args: [{
2688
3789
  imports: [
@@ -2705,14 +3806,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
2705
3806
  }]
2706
3807
  }] });
2707
3808
 
2708
- const DBX_INJECTED_COMPONENT_DATA = new InjectionToken('DbxInjectedComponentConfigData');
3809
+ const DBX_INJECTION_COMPONENT_DATA = new InjectionToken('DbxInjectionComponentConfigData');
2709
3810
  /**
2710
3811
  * Merges multiple configurations into a single configuration.
2711
3812
  *
2712
3813
  * @param configs
2713
3814
  * @returns
2714
3815
  */
2715
- function mergeDbxInjectedComponentConfigs(configs) {
3816
+ function mergeDbxInjectionComponentConfigs(configs) {
2716
3817
  const providers = mergeArrays(filterMaybeValues(configs).map(x => x.providers));
2717
3818
  const result = mergeObjects(configs);
2718
3819
  result.providers = providers;
@@ -2722,7 +3823,7 @@ function mergeDbxInjectedComponentConfigs(configs) {
2722
3823
  /**
2723
3824
  * Instance used by components to inject content based on the configuration into the view.
2724
3825
  */
2725
- class DbxInjectedComponentInstance {
3826
+ class DbxInjectionInstance {
2726
3827
  constructor(_injector) {
2727
3828
  this._injector = _injector;
2728
3829
  this._subscriptionObject = new SubscriptionObject();
@@ -2798,7 +3899,7 @@ class DbxInjectedComponentInstance {
2798
3899
  injector = Injector.create({
2799
3900
  parent: parentInjector,
2800
3901
  providers: mergeArrayOrValueIntoArray([{
2801
- provide: DBX_INJECTED_COMPONENT_DATA,
3902
+ provide: DBX_INJECTION_COMPONENT_DATA,
2802
3903
  useValue: data
2803
3904
  }], providers !== null && providers !== void 0 ? providers : [])
2804
3905
  });
@@ -2832,10 +3933,10 @@ class DbxInjectedComponentInstance {
2832
3933
  /**
2833
3934
  * Abstract directive that injects content based on the configuration into the view.
2834
3935
  */
2835
- class AbstractDbxInjectedDirective {
3936
+ class AbstractDbxInjectionDirective {
2836
3937
  constructor(_injector) {
2837
3938
  this._injector = _injector;
2838
- this._instance = new DbxInjectedComponentInstance(this._injector);
3939
+ this._instance = new DbxInjectionInstance(this._injector);
2839
3940
  }
2840
3941
  ngOnInit() {
2841
3942
  this._instance.init();
@@ -2853,16 +3954,16 @@ class AbstractDbxInjectedDirective {
2853
3954
  this._instance.content = content;
2854
3955
  }
2855
3956
  }
2856
- AbstractDbxInjectedDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractDbxInjectedDirective, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
2857
- AbstractDbxInjectedDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractDbxInjectedDirective, ngImport: i0 });
2858
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractDbxInjectedDirective, decorators: [{
3957
+ AbstractDbxInjectionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxInjectionDirective, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
3958
+ AbstractDbxInjectionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractDbxInjectionDirective, ngImport: i0 });
3959
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxInjectionDirective, decorators: [{
2859
3960
  type: Directive
2860
3961
  }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
2861
3962
 
2862
3963
  /**
2863
3964
  * Component that injects content based on the configuration into the view.
2864
3965
  */
2865
- class DbxInjectedComponent extends AbstractDbxInjectedDirective {
3966
+ class DbxInjectionComponent extends AbstractDbxInjectionDirective {
2866
3967
  set config(config) {
2867
3968
  this.setConfig(config);
2868
3969
  }
@@ -2873,12 +3974,12 @@ class DbxInjectedComponent extends AbstractDbxInjectedDirective {
2873
3974
  this.setContent(content);
2874
3975
  }
2875
3976
  }
2876
- DbxInjectedComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxInjectedComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2877
- DbxInjectedComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxInjectedComponent, selector: "dbx-injected-content, [dbx-injected-content]", inputs: { config: "config", template: "template" }, viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true, read: ViewContainerRef, static: true }], usesInheritance: true, ngImport: i0, template: `<ng-template #content></ng-template>`, isInline: true });
2878
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxInjectedComponent, decorators: [{
3977
+ DbxInjectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxInjectionComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3978
+ DbxInjectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: { config: "config", template: "template" }, viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true, read: ViewContainerRef, static: true }], usesInheritance: true, ngImport: i0, template: `<ng-template #content></ng-template>`, isInline: true });
3979
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxInjectionComponent, decorators: [{
2879
3980
  type: Component,
2880
3981
  args: [{
2881
- selector: 'dbx-injected-content, [dbx-injected-content]',
3982
+ selector: 'dbx-injection, [dbxInjection], [dbx-injection]',
2882
3983
  template: `<ng-template #content></ng-template>`
2883
3984
  }]
2884
3985
  }], propDecorators: { config: [{
@@ -2890,28 +3991,258 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
2890
3991
  args: ['content', { static: true, read: ViewContainerRef }]
2891
3992
  }] } });
2892
3993
 
2893
- class DbxInjectedComponentModule {
3994
+ /**
3995
+ * View that can switch to show another arbitrary view, then switch back when the promise ends.
3996
+ *
3997
+ * It is similar to *ngIf/*ngSwitch, but the original child content is retained instead of discarded,
3998
+ * and returns once the special context is done being used.
3999
+ */
4000
+ class DbxInjectionContext {
4001
+ }
4002
+ /**
4003
+ * Allows a directive to provide a formly context and form.
4004
+ */
4005
+ function ProvideDbxInjectionContext(type) {
4006
+ return [{
4007
+ provide: DbxInjectionContext,
4008
+ useExisting: type
4009
+ }];
4010
+ }
4011
+
4012
+ /**
4013
+ * DbxInjectedViewContext implementation. Acts similar to *ngIf, but instead switches to a different view without destroying the original child view.
4014
+ */
4015
+ class DbxInjectionContextDirective {
4016
+ constructor(_injector, _templateRef, _viewContainer) {
4017
+ this._injector = _injector;
4018
+ this._templateRef = _templateRef;
4019
+ this._viewContainer = _viewContainer;
4020
+ this._instance = new DbxInjectionInstance(this._injector);
4021
+ this._isDetached = false;
4022
+ }
4023
+ set config(config) {
4024
+ let reattach = false;
4025
+ if (config) {
4026
+ if (!this._isDetached) {
4027
+ // detach the original view before setting config.
4028
+ this._viewContainer.detach();
4029
+ this._isDetached = true;
4030
+ }
4031
+ }
4032
+ else if (this._isDetached) {
4033
+ reattach = true;
4034
+ }
4035
+ this._instance.config = config;
4036
+ if (reattach) {
4037
+ this._viewContainer.insert(this._embeddedView);
4038
+ this._isDetached = false;
4039
+ }
4040
+ }
4041
+ ngOnInit() {
4042
+ this._instance.content = this._viewContainer;
4043
+ this._instance.init();
4044
+ this._embeddedView = this._viewContainer.createEmbeddedView(this._templateRef);
4045
+ // detach the embedded view
4046
+ this._viewContainer.detach();
4047
+ // reattach it through the template configuration.
4048
+ // the template configuration acts as the default.
4049
+ this._instance.template = {
4050
+ viewRef: this._embeddedView
4051
+ };
4052
+ }
4053
+ ngOnDestroy() {
4054
+ var _a;
4055
+ this._instance.destroy();
4056
+ (_a = this._embeddedView) === null || _a === void 0 ? void 0 : _a.destroy(); // destroy our embedded view too.
4057
+ }
4058
+ showContext(config) {
4059
+ return __awaiter(this, void 0, void 0, function* () {
4060
+ // clear the current context before showing something new.
4061
+ this.resetContext();
4062
+ let promiseRef;
4063
+ let result;
4064
+ let error;
4065
+ // wait for the promise to resolve and use to finish using that instance.
4066
+ try {
4067
+ promiseRef = makePromiseFullRef((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
4068
+ const injectionConfig = Object.assign(Object.assign({}, config.config), { init: (instance) => __awaiter(this, void 0, void 0, function* () {
4069
+ // init if available in the base config.
4070
+ if (config.config.init) {
4071
+ config.config.init(instance);
4072
+ }
4073
+ try {
4074
+ resolve(config.use(instance));
4075
+ }
4076
+ catch (e) {
4077
+ reject(e);
4078
+ }
4079
+ }) });
4080
+ this.config = injectionConfig;
4081
+ }));
4082
+ this._currentPromise = promiseRef;
4083
+ // await the promise
4084
+ yield promiseRef.promise;
4085
+ }
4086
+ catch (e) {
4087
+ error = e;
4088
+ }
4089
+ // if we're still using the same promiseRef
4090
+ if (promiseRef && promiseRef === this._currentPromise) {
4091
+ // clear the config to reshow the view
4092
+ this.config = undefined;
4093
+ // clear the current promise
4094
+ this._currentPromise = undefined;
4095
+ }
4096
+ if (error != null) {
4097
+ return Promise.reject(error);
4098
+ }
4099
+ else {
4100
+ return result;
4101
+ }
4102
+ });
4103
+ }
4104
+ resetContext() {
4105
+ let clearedValue = false;
4106
+ if (this._currentPromise) {
4107
+ const promise = this._currentPromise;
4108
+ // clear the current promise too
4109
+ this._currentPromise = undefined;
4110
+ // clear the config.
4111
+ this.config = undefined;
4112
+ // send a rejection signal to bail out.
4113
+ promise.reject(new Error('dbxInjectionContext bailout'));
4114
+ clearedValue = true;
4115
+ }
4116
+ return clearedValue;
4117
+ }
4118
+ }
4119
+ DbxInjectionContextDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxInjectionContextDirective, deps: [{ token: i0.Injector }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
4120
+ DbxInjectionContextDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxInjectionContextDirective, selector: "[dbxInjectionContext]", inputs: { config: "config" }, providers: ProvideDbxInjectionContext(DbxInjectionContextDirective), ngImport: i0 });
4121
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxInjectionContextDirective, decorators: [{
4122
+ type: Directive,
4123
+ args: [{
4124
+ selector: '[dbxInjectionContext]',
4125
+ providers: ProvideDbxInjectionContext(DbxInjectionContextDirective)
4126
+ }]
4127
+ }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; }, propDecorators: { config: [{
4128
+ type: Input
4129
+ }] } });
4130
+
4131
+ class DbxInjectionComponentModule {
2894
4132
  }
2895
- DbxInjectedComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxInjectedComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2896
- DbxInjectedComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxInjectedComponentModule, declarations: [DbxInjectedComponent], imports: [CommonModule], exports: [DbxInjectedComponent] });
2897
- DbxInjectedComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxInjectedComponentModule, imports: [[
4133
+ DbxInjectionComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxInjectionComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4134
+ DbxInjectionComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxInjectionComponentModule, declarations: [DbxInjectionComponent,
4135
+ DbxInjectionContextDirective], imports: [CommonModule], exports: [DbxInjectionComponent,
4136
+ DbxInjectionContextDirective] });
4137
+ DbxInjectionComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxInjectionComponentModule, imports: [[
2898
4138
  CommonModule
2899
4139
  ]] });
2900
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxInjectedComponentModule, decorators: [{
4140
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxInjectionComponentModule, decorators: [{
2901
4141
  type: NgModule,
2902
4142
  args: [{
2903
4143
  imports: [
2904
4144
  CommonModule
2905
4145
  ],
2906
4146
  declarations: [
2907
- DbxInjectedComponent
4147
+ DbxInjectionComponent,
4148
+ DbxInjectionContextDirective
2908
4149
  ],
2909
4150
  exports: [
2910
- DbxInjectedComponent
4151
+ DbxInjectionComponent,
4152
+ DbxInjectionContextDirective
2911
4153
  ],
2912
4154
  }]
2913
4155
  }] });
2914
4156
 
4157
+ /**
4158
+ * Abstract DbxInjectionContext implementation that forwards commands to a host DbxInjectionContext.
4159
+ *
4160
+ * This abstract type is used by related types for dependency injection purposes, so that those types
4161
+ * can be injected instead of just any DbxInjectionContext.
4162
+ */
4163
+ class AbstractForwardDbxInjectionContextDirective {
4164
+ constructor(dbxInjectionContext) {
4165
+ this.dbxInjectionContext = dbxInjectionContext;
4166
+ }
4167
+ // MARK: DbxInjectionContext
4168
+ showContext(config) {
4169
+ return this.dbxInjectionContext.showContext(config);
4170
+ }
4171
+ resetContext() {
4172
+ return this.dbxInjectionContext.resetContext();
4173
+ }
4174
+ }
4175
+ AbstractForwardDbxInjectionContextDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractForwardDbxInjectionContextDirective, deps: [{ token: DbxInjectionContext, host: true }], target: i0.ɵɵFactoryTarget.Directive });
4176
+ AbstractForwardDbxInjectionContextDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractForwardDbxInjectionContextDirective, ngImport: i0 });
4177
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractForwardDbxInjectionContextDirective, decorators: [{
4178
+ type: Directive
4179
+ }], ctorParameters: function () {
4180
+ return [{ type: DbxInjectionContext, decorators: [{
4181
+ type: Host
4182
+ }] }];
4183
+ } });
4184
+
4185
+ /**
4186
+ * Abstract ComponentStore extension that provides a LockSet and OnDestroy delaying/cleanup.
4187
+ */
4188
+ class LockSetComponentStore extends ComponentStore {
4189
+ constructor(initialState) {
4190
+ super(initialState);
4191
+ this.initialState = initialState;
4192
+ this.lockSet = new LockSet();
4193
+ this.lockSetDestroyDelayMs = 2000;
4194
+ // MARK: State Changes
4195
+ this.resetStore = this.updater(() => (Object.assign({}, this.initialState)));
4196
+ }
4197
+ // MARK: Locks
4198
+ setupLockSet({ parent, locks }) {
4199
+ if (parent) {
4200
+ this.setParentLockSet(parent);
4201
+ }
4202
+ if (locks) {
4203
+ for (const key in locks) {
4204
+ if (locks[key]) {
4205
+ this.addLock(key, locks[key]);
4206
+ }
4207
+ }
4208
+ }
4209
+ }
4210
+ setParentLockSet(obs) {
4211
+ this.lockSet.setParentLockSet(asObservable(obs).pipe(map$1(x => x === null || x === void 0 ? void 0 : x.lockSet)));
4212
+ }
4213
+ addLock(key, obs) {
4214
+ this.lockSet.addLock(key, obs);
4215
+ }
4216
+ // MARK: Cleanup
4217
+ ngOnDestroy() {
4218
+ // Wait for any actions to complete before destroying.
4219
+ this.lockSet.destroyOnNextUnlock({
4220
+ fn: () => {
4221
+ this._destroyNow();
4222
+ },
4223
+ timeout: this.lockSetDestroyTimeoutMs,
4224
+ }, this.lockSetDestroyDelayMs);
4225
+ }
4226
+ /**
4227
+ * Completes the cleanup of the object.
4228
+ */
4229
+ _destroyNow() {
4230
+ this.lockSet.destroy();
4231
+ }
4232
+ }
4233
+ LockSetComponentStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: LockSetComponentStore, deps: [{ token: null, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
4234
+ LockSetComponentStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: LockSetComponentStore });
4235
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: LockSetComponentStore, decorators: [{
4236
+ type: Injectable
4237
+ }], ctorParameters: function () {
4238
+ return [{ type: undefined, decorators: [{
4239
+ type: Inject,
4240
+ args: [null]
4241
+ }, {
4242
+ type: Optional
4243
+ }] }];
4244
+ } });
4245
+
2915
4246
  class StringifySimpleStorageAccessorConverter {
2916
4247
  stringifyValue(value) {
2917
4248
  return JSON.stringify(value);
@@ -3133,12 +4464,12 @@ class SimpleStorageAccessorFactory {
3133
4464
  return new SimpleStorageAccessor(delegate, accessorConfig);
3134
4465
  }
3135
4466
  }
3136
- SimpleStorageAccessorFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: SimpleStorageAccessorFactory, deps: [{ token: DEFAULT_STORAGE_OBJECT_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable });
3137
- SimpleStorageAccessorFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: SimpleStorageAccessorFactory });
3138
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: SimpleStorageAccessorFactory, decorators: [{
4467
+ SimpleStorageAccessorFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SimpleStorageAccessorFactory, deps: [{ token: DEFAULT_STORAGE_OBJECT_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable });
4468
+ SimpleStorageAccessorFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SimpleStorageAccessorFactory });
4469
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SimpleStorageAccessorFactory, decorators: [{
3139
4470
  type: Injectable
3140
4471
  }], ctorParameters: function () {
3141
- return [{ type: i1$4.FullStorageObject, decorators: [{
4472
+ return [{ type: i1$6.FullStorageObject, decorators: [{
3142
4473
  type: Inject,
3143
4474
  args: [DEFAULT_STORAGE_OBJECT_TOKEN]
3144
4475
  }] }];
@@ -3244,60 +4575,16 @@ class DbxStorageModule {
3244
4575
  };
3245
4576
  }
3246
4577
  }
3247
- DbxStorageModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxStorageModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3248
- DbxStorageModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxStorageModule });
3249
- DbxStorageModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxStorageModule });
3250
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxStorageModule, decorators: [{
4578
+ DbxStorageModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxStorageModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4579
+ DbxStorageModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxStorageModule });
4580
+ DbxStorageModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxStorageModule });
4581
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxStorageModule, decorators: [{
3251
4582
  type: NgModule
3252
4583
  }] });
3253
4584
 
3254
- /**
3255
- * Convenience function used within observables for views that need to detect changes after a value changes.
3256
- *
3257
- * @param cdRef
3258
- * @param timeout
3259
- * @returns
3260
- */
3261
- function tapDetectChanges(cdRef, timeout = 0) {
3262
- return tap$1(() => setTimeout(() => safeDetectChanges(cdRef), timeout));
3263
- }
3264
- /**
3265
- * Triggers a detection change on the input view as long as the view has not been destroyed.
3266
- *
3267
- * @param cdRef
3268
- */
3269
- function safeDetectChanges(cdRef) {
3270
- if (!cdRef.destroyed) {
3271
- cdRef.detectChanges();
3272
- }
3273
- }
3274
- /**
3275
- * Used to check an injected ElementRef that wraps an ng-content injection point whether or not any content was injected,
3276
- * or more specifically if the parent component passed any target content to the child. This will still return true if
3277
- * passed content is empty.
3278
- *
3279
- * TS:
3280
- * @ViewChild('customLoading', { static: false }) customCustom: ElementRef;
3281
- *
3282
- * HTML:
3283
- * <div #customContent>
3284
- * <ng-content select="[content]"></ng-content>
3285
- * </div>
3286
- */
3287
- function checkNgContentWrapperHasContent(ref) {
3288
- // https://github.com/angular/angular/issues/26083
3289
- let hasContent = false;
3290
- if (ref != null) {
3291
- const childNodes = ref.nativeElement.childNodes;
3292
- const hasChildNodes = childNodes && childNodes.length > 0;
3293
- hasContent = Boolean(hasChildNodes);
3294
- }
3295
- return hasContent;
3296
- }
3297
-
3298
4585
  /**
3299
4586
  * Generated bundle index. Do not edit.
3300
4587
  */
3301
4588
 
3302
- export { APP_ACTION_DISABLED_DIRECTIVE_KEY, APP_ACTION_DISABLED_UNTIL_MODIFIED_DIRECTIVE_KEY, AbstractActionFilterSourceDirective, AbstractDbxAnchorDirective, AbstractDbxButtonDirective, AbstractDbxFilterMapInstanceDirective, AbstractDbxInjectedDirective, AbstractFilterSourceConnectorDirective, AbstractFilterSourceDirective, AbstractLockSetSubscriptionDirective, AbstractSubscriptionDirective, AbstractTransitionDirective, AbstractTransitionWatcherDirective, ActionContextBaseSource, ActionContextMachine, ActionContextStore, ActionContextStoreSource, ActionContextStoreSourceInstance, ActionContextStoreSourceMap, ActionSnackbarDefaultType, ActionSnackbarEventType, ActionState, AnchorType, DBX_INJECTED_COMPONENT_DATA, DEFAULT_ACTION_DISABLED_KEY, DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY, DEFAULT_SNACKBAR_DIRECTIVE_DURATION, DEFAULT_SNACKBAR_UNDO_DIRECTIVE_DURATION, DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN, DEFAULT_STORAGE_OBJECT_TOKEN, DateDistancePipe, DateFormatDistancePipe, DateFromToTimePipe, DbxActionAutoModifyDirective, DbxActionAutoTriggerDirective, DbxActionAutoTriggerValueDirective, DbxActionButtonDirective, DbxActionButtonTriggerDirective, DbxActionContextLoggerDirective, DbxActionContextMapDirective, DbxActionContextMapDirectiveSourceInstance, DbxActionDirective, DbxActionDisabledDirective, DbxActionDisabledUntilModifiedDirective, DbxActionFromMapDirective, DbxActionHandlerDirective, DbxActionMapSourceDirective, DbxActionMapWorkingDisableDirective, DbxActionSourceDirective, DbxActionSuccessComponent, DbxActionSuccessDirective, DbxActionValueDirective, DbxActionWorkingComponent, DbxAnchor, DbxAngularRouterService, DbxButton, DbxButtonDirective, DbxButtonSegueDirective, DbxCoreActionModule, DbxCoreAngularRouterSegueModule, DbxCoreButtonModule, DbxCoreFilterModule, DbxCoreUIRouterSegueModule, DbxDatePipeModule, DbxFilterMapDirective, DbxFilterMapSourceConnectorDirective, DbxFilterMapSourceDirective, DbxFilterSourceConnectorDirective, DbxFilterSourceDirective, DbxInjectedComponent, DbxInjectedComponentInstance, DbxInjectedComponentModule, DbxLoadingButtonDirective, DbxRouterService, DbxRouterTransitionEventType, DbxRouterTransitionService, DbxStorageModule, DbxUIRouterService, FullLocalStorageObject, InstantStorageAccessor, LimitedStorageAccessor, MemoryStorageObject, MinutesStringPipe, ProvideActionStoreSource, ProvideDbxAnchor, ProvideDbxButton, ProvideFilterSource, ProvideFilterSourceConnector, ProvideSecondaryActionStoreSource, SecondaryActionContextStoreSource, SimpleStorageAccessor, SimpleStorageAccessorFactory, StorageAccessor, StringStorageAccessor, StringifySimpleStorageAccessorConverter, TimeDistanceCountdownPipe, TimeDistancePipe, ToJsDatePipe, ToMinutesPipe, WorkHandlerContext, WorkHandlerContextSourceDelegate, WrapperSimpleStorageAccessorDelegate, actionContextHasNoErrorAndIsModifiedAndCanTrigger, actionContextIsModifiedAndCanTrigger, actionContextStoreSourceInstanceFactory, actionContextStoreSourcePipe, anchorTypeForAnchor, canReadyValue, canTriggerAction, canTriggerActionState, checkNgContentWrapperHasContent, defaultStorageObjectFactory, expandClickableAnchorLinkTree, expandClickableAnchorLinkTreeNode, expandClickableAnchorLinkTrees, filterTransitionEvent, filterTransitionSuccess, flattenExpandedClickableAnchorLinkTree, flattenExpandedClickableAnchorLinkTreeToLinks, handleWorkValueReadyFn, handleWorkValueReadyWithConfigFn, isActionContextDisabled, isActionContextEnabled, isDisabledActionContextState, isIdleActionState, isWorkingActionState, mapRefStringObsToSegueRefObs, mergeDbxInjectedComponentConfigs, pipeActionStore, refStringToSegueRef, safeDetectChanges, successTransition, tapDetectChanges, useActionStore };
4589
+ export { APP_ACTION_DISABLED_DIRECTIVE_KEY, APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY, AbstractActionFilterSourceDirective, AbstractDbxActionValueOnTriggerDirective, AbstractDbxAnchorDirective, AbstractDbxButtonDirective, AbstractDbxFilterMapInstanceDirective, AbstractDbxInjectionDirective, AbstractFilterSourceConnectorDirective, AbstractFilterSourceDirective, AbstractForwardDbxInjectionContextDirective, AbstractIfDirective, AbstractLockSetSubscriptionDirective, AbstractSubscriptionDirective, AbstractTransitionDirective, AbstractTransitionWatcherDirective, ActionContextStore, ActionContextStoreSource, ActionContextStoreSourceMap, AnchorType, DBX_APP_APP_CONTEXT_STATE, DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN, DBX_AUTH_APP_CONTEXT_STATE, DBX_INIT_APP_CONTEXT_STATE, DBX_INJECTION_COMPONENT_DATA, DBX_KNOWN_APP_CONTEXT_STATES, DBX_ONBOARDING_APP_CONTEXT_STATE, DBX_PUBLIC_APP_CONTEXT_STATE, DEFAULT_ACTION_DISABLED_KEY, DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY, DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN, DEFAULT_STORAGE_OBJECT_TOKEN, DateDistancePipe, DateFormatDistancePipe, DateFromToTimePipe, DbxActionAutoModifyDirective, DbxActionAutoTriggerDirective, DbxActionButtonDirective, DbxActionButtonTriggerDirective, DbxActionContextBaseSource, DbxActionContextLoggerDirective, DbxActionContextMachine, DbxActionContextMapDirective, DbxActionContextMapDirectiveSourceInstance, DbxActionContextStoreSourceInstance, DbxActionDirective, DbxActionDisabledDirective, DbxActionEnforceModifiedDirective, DbxActionFromMapDirective, DbxActionHandlerDirective, DbxActionHasSuccessDirective, DbxActionIsWorkingDirective, DbxActionMapSourceDirective, DbxActionMapWorkingDisableDirective, DbxActionSourceDirective, DbxActionState, DbxActionSuccessHandlerDirective, DbxActionValueDirective, DbxActionValueOnTriggerInstance, DbxActionValueTriggerDirective, DbxActionWorkInstanceDelegate, DbxAnchor, DbxAngularRouterService, DbxAppAuthRouterEffects, DbxAppAuthRouterModule, DbxAppAuthRouterService, DbxAppAuthRouterStateModule, DbxAppAuthRoutes, DbxAppAuthStateModule, DbxAppAuthStateService, DbxAppContextService, DbxAppContextStateDirective, DbxAppContextStateModule, DbxAuthHasAnyRoleDirective, DbxAuthHasRolesDirective, DbxAuthService, DbxButton, DbxButtonDirective, DbxButtonSegueDirective, DbxCoreActionModule, DbxCoreAngularRouterSegueModule, DbxCoreAuthModule, DbxCoreButtonModule, DbxCoreFilterModule, DbxCoreUIRouterSegueModule, DbxDatePipeModule, DbxFilterMapDirective, DbxFilterMapSourceConnectorDirective, DbxFilterMapSourceDirective, DbxFilterSourceConnectorDirective, DbxFilterSourceDirective, DbxInjectionComponent, DbxInjectionComponentModule, DbxInjectionContext, DbxInjectionContextDirective, DbxInjectionInstance, DbxLoadingButtonDirective, DbxMiscPipeModule, DbxPipesModule, DbxRouterService, DbxRouterTransitionEventType, DbxRouterTransitionService, DbxStorageModule, DbxUIRouterService, FullLocalStorageObject, InstantStorageAccessor, LimitedStorageAccessor, LockSetComponentStore, MemoryStorageObject, MinutesStringPipe, NO_AUTH_USER_IDENTIFIER, PrettyJsonPipe, ProvideActionStoreSource, ProvideDbxAnchor, ProvideDbxButton, ProvideDbxInjectionContext, ProvideFilterSource, ProvideFilterSourceConnector, ProvideSecondaryActionStoreSource, SecondaryActionContextStoreSource, SimpleStorageAccessor, SimpleStorageAccessorFactory, StorageAccessor, StringStorageAccessor, StringifySimpleStorageAccessorConverter, TimeDistanceCountdownPipe, TimeDistancePipe, ToJsDatePipe, ToMinutesPipe, WrapperSimpleStorageAccessorDelegate, actionContextHasNoErrorAndIsModifiedAndCanTrigger, actionContextIsModifiedAndCanTrigger, actionContextStoreSourceInstanceFactory, actionContextStoreSourcePipe, anchorTypeForAnchor, asSegueRef, authRolesSetContainsAllRolesFrom, authRolesSetContainsAnyRoleFrom, authUserIdentifier, canReadyValue, canTriggerAction, canTriggerActionState, checkNgContentWrapperHasContent, dbxActionValueStreamDirective, defaultStorageObjectFactory, enableHasAuthRoleHook, enableHasAuthStateHook, enableIsLoggedInHook, expandClickableAnchorLinkTree, expandClickableAnchorLinkTreeNode, expandClickableAnchorLinkTrees, filterTransitionEvent, filterTransitionSuccess, flattenExpandedClickableAnchorLinkTree, flattenExpandedClickableAnchorLinkTreeToLinks, index as fromDbxAppAuth, index$2 as fromDbxAppContext, goWithRouter, isActionContextDisabled, isActionContextEnabled, isDisabledActionContextState, isIdleActionState, isSegueRef, isWorkingActionState, loadingStateForActionContextState, loadingStateTypeForActionContextState, loadingStateTypeForActionState, loggedInObsFromIsLoggedIn, loggedOutObsFromIsLoggedIn, makeAuthTransitionHook, makeDbxActionContextSourceReference, mapRefStringObsToSegueRefObs, mergeDbxInjectionComponentConfigs, index$1 as onDbxAppAuth, index$3 as onDbxAppContext, pipeActionStore, readSegueRefString, redirectBasedOnAuthUserState, refStringToSegueRef, safeDetectChanges, safeMarkForCheck, safeUseCdRef, successTransition, tapDetectChanges, useActionStore };
3303
4590
  //# sourceMappingURL=dereekb-dbx-core.mjs.map