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