@dereekb/dbx-core 4.1.0 → 5.1.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/esm2020/lib/action/action.handler.mjs +1 -1
- package/esm2020/lib/action/action.holder.mjs +1 -1
- package/esm2020/lib/action/action.machine.mjs +2 -2
- package/esm2020/lib/action/action.mjs +2 -2
- package/esm2020/lib/action/action.module.mjs +70 -22
- package/esm2020/lib/action/action.reference.mjs +1 -1
- package/esm2020/lib/action/action.store.mjs +32 -30
- package/esm2020/lib/action/action.store.source.mjs +30 -27
- package/esm2020/lib/action/directive/auto/action.automodify.directive.mjs +5 -8
- package/esm2020/lib/action/directive/auto/action.autotrigger.directive.mjs +9 -12
- package/esm2020/lib/action/directive/context/action.directive.mjs +4 -4
- package/esm2020/lib/action/directive/context/action.source.directive.mjs +5 -6
- package/esm2020/lib/action/directive/debug/action.logger.directive.mjs +1 -1
- package/esm2020/lib/action/directive/map/action.map.directive.mjs +6 -7
- package/esm2020/lib/action/directive/map/action.map.key.directive.mjs +5 -6
- package/esm2020/lib/action/directive/map/action.map.mjs +1 -1
- package/esm2020/lib/action/directive/map/action.map.source.directive.mjs +1 -1
- package/esm2020/lib/action/directive/map/action.map.working.disable.directive.mjs +1 -1
- package/esm2020/lib/action/directive/state/action.disabled.directive.mjs +2 -3
- package/esm2020/lib/action/directive/state/action.enforce.modified.directive.mjs +4 -2
- package/esm2020/lib/action/directive/state/action.handler.directive.mjs +8 -7
- package/esm2020/lib/action/directive/state/action.success.directive.mjs +1 -1
- package/esm2020/lib/action/directive/state/action.success.handler.directive.mjs +7 -6
- package/esm2020/lib/action/directive/state/action.value.directive.mjs +7 -6
- package/esm2020/lib/action/directive/state/action.value.stream.directive.mjs +5 -6
- package/esm2020/lib/action/directive/state/action.value.trigger.directive.mjs +6 -7
- package/esm2020/lib/action/directive/state/action.value.trigger.instance.mjs +7 -5
- package/esm2020/lib/action/directive/state/action.working.component.mjs +1 -1
- package/esm2020/lib/auth/auth.module.mjs +4 -12
- package/esm2020/lib/auth/auth.role.any.directive.mjs +1 -1
- package/esm2020/lib/auth/auth.role.has.directive.mjs +1 -1
- package/esm2020/lib/auth/auth.state.module.mjs +3 -9
- package/esm2020/lib/auth/auth.state.service.mjs +3 -3
- package/esm2020/lib/auth/auth.user.mjs +2 -2
- package/esm2020/lib/auth/index.mjs +1 -1
- package/esm2020/lib/auth/router/auth.router.module.mjs +5 -3
- package/esm2020/lib/auth/router/auth.router.service.mjs +5 -5
- package/esm2020/lib/auth/router/provider/uirouter/auth.hook.mjs +1 -1
- package/esm2020/lib/auth/router/provider/uirouter/hook.mjs +3 -2
- package/esm2020/lib/auth/router/provider/uirouter/redirect.mjs +2 -2
- package/esm2020/lib/auth/router/provider/uirouter/role.hook.mjs +2 -2
- package/esm2020/lib/auth/router/provider/uirouter/state.hook.mjs +3 -3
- package/esm2020/lib/auth/router/state/auth.router.state.module.mjs +7 -9
- package/esm2020/lib/auth/router/state/effect/auth.router.state.effect.mjs +1 -1
- package/esm2020/lib/auth/service/auth.service.mjs +1 -1
- package/esm2020/lib/auth/service/auth.service.rxjs.mjs +3 -3
- package/esm2020/lib/auth/state/action/auth.action.mjs +1 -1
- package/esm2020/lib/auth/state/action/user.action.mjs +1 -1
- package/esm2020/lib/auth/state/effect/auth.effect.mjs +7 -13
- package/esm2020/lib/auth/state/reducer/index.mjs +2 -2
- package/esm2020/lib/auth/state/reducer/user.reducer.mjs +1 -1
- package/esm2020/lib/button/action/action.button.directive.mjs +1 -1
- package/esm2020/lib/button/action/action.button.trigger.directive.mjs +1 -1
- package/esm2020/lib/button/button.directive.mjs +9 -8
- package/esm2020/lib/button/button.loading.directive.mjs +2 -2
- package/esm2020/lib/button/button.mjs +6 -4
- package/esm2020/lib/button/button.module.mjs +4 -24
- package/esm2020/lib/button/router/button.segue.directive.mjs +6 -5
- package/esm2020/lib/context/context.directive.mjs +3 -3
- package/esm2020/lib/context/context.mjs +1 -1
- package/esm2020/lib/context/context.module.mjs +5 -13
- package/esm2020/lib/context/context.service.mjs +3 -3
- package/esm2020/lib/context/state/action/data.action.mjs +1 -1
- package/esm2020/lib/context/state/effect/index.mjs +1 -1
- package/esm2020/lib/context/state/reducer/index.mjs +2 -2
- package/esm2020/lib/context/state/state.mjs +1 -1
- package/esm2020/lib/filter/action/action.filter.source.directive.mjs +1 -1
- package/esm2020/lib/filter/filter.abstract.connector.directive.mjs +3 -2
- package/esm2020/lib/filter/filter.abstract.source.directive.mjs +1 -1
- package/esm2020/lib/filter/filter.connector.directive.mjs +4 -10
- package/esm2020/lib/filter/filter.content.mjs +14 -9
- package/esm2020/lib/filter/filter.map.connector.directive.mjs +4 -10
- package/esm2020/lib/filter/filter.map.directive.mjs +1 -1
- package/esm2020/lib/filter/filter.map.instance.directive.mjs +2 -3
- package/esm2020/lib/filter/filter.map.source.directive.mjs +5 -9
- package/esm2020/lib/filter/filter.module.mjs +6 -30
- package/esm2020/lib/filter/filter.source.directive.mjs +4 -4
- package/esm2020/lib/injection/injection.component.mjs +7 -3
- package/esm2020/lib/injection/injection.component.module.mjs +6 -18
- package/esm2020/lib/injection/injection.context.directive.mjs +4 -4
- package/esm2020/lib/injection/injection.context.forward.directive.mjs +3 -3
- package/esm2020/lib/injection/injection.context.mjs +6 -4
- package/esm2020/lib/injection/injection.directive.mjs +1 -1
- package/esm2020/lib/injection/injection.instance.mjs +7 -6
- package/esm2020/lib/injection/injection.mjs +4 -4
- package/esm2020/lib/ngrx/store.lockset.mjs +3 -3
- package/esm2020/lib/pipe/date/date.pipe.module.mjs +4 -36
- package/esm2020/lib/pipe/date/datedistance.pipe.mjs +4 -7
- package/esm2020/lib/pipe/date/dateformatdistance.pipe.mjs +1 -1
- package/esm2020/lib/pipe/date/datefromtoformat.pipe.mjs +4 -4
- package/esm2020/lib/pipe/date/minutesstring.pipe.mjs +3 -3
- package/esm2020/lib/pipe/date/timedistance.pipe.mjs +1 -1
- package/esm2020/lib/pipe/date/tojsdate.pipe.mjs +1 -1
- package/esm2020/lib/pipe/date/tominutes.pipe.mjs +1 -1
- package/esm2020/lib/pipe/misc/misc.pipe.module.mjs +3 -7
- package/esm2020/lib/pipe/misc/prettyjson.pipe.mjs +1 -1
- package/esm2020/lib/pipe/pipe.module.mjs +4 -9
- package/esm2020/lib/router/anchor/anchor.directive.mjs +3 -4
- package/esm2020/lib/router/anchor/anchor.mjs +6 -4
- package/esm2020/lib/router/anchor/clickable.mjs +1 -1
- package/esm2020/lib/router/router/provider/angular/angular.router.service.mjs +7 -7
- package/esm2020/lib/router/router/provider/angular/angular.router.service.module.mjs +1 -1
- package/esm2020/lib/router/router/provider/uirouter/index.mjs +1 -2
- package/esm2020/lib/router/router/provider/uirouter/uirouter.router.service.mjs +13 -17
- package/esm2020/lib/router/router/provider/uirouter/uirouter.router.service.module.mjs +1 -1
- package/esm2020/lib/router/router/service/router.go.mjs +4 -4
- package/esm2020/lib/router/router/service/router.service.mjs +1 -1
- package/esm2020/lib/router/router/service/router.transition.service.mjs +1 -1
- package/esm2020/lib/router/router/transition/transition.directive.mjs +1 -1
- package/esm2020/lib/router/router/transition/transition.rxjs.mjs +4 -4
- package/esm2020/lib/router/router/transition/transition.watcher.directive.mjs +1 -1
- package/esm2020/lib/router/segue.mjs +16 -4
- package/esm2020/lib/storage/storage.accessor.mjs +1 -1
- package/esm2020/lib/storage/storage.accessor.simple.factory.mjs +1 -1
- package/esm2020/lib/storage/storage.accessor.simple.mjs +7 -5
- package/esm2020/lib/storage/storage.accessor.string.mjs +4 -5
- package/esm2020/lib/storage/storage.module.mjs +9 -5
- package/esm2020/lib/storage/storage.object.localstorage.mjs +2 -2
- package/esm2020/lib/storage/storage.object.memory.mjs +1 -1
- package/esm2020/lib/subscription/subscription.directive.mjs +1 -1
- package/esm2020/lib/util/view.mjs +2 -2
- package/esm2020/lib/view/if.directive.mjs +4 -4
- package/fesm2015/dereekb-dbx-core.mjs +388 -472
- package/fesm2015/dereekb-dbx-core.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-core.mjs +385 -471
- package/fesm2020/dereekb-dbx-core.mjs.map +1 -1
- package/lib/action/action.d.ts +1 -1
- package/lib/action/action.handler.d.ts +8 -4
- package/lib/action/action.holder.d.ts +3 -3
- package/lib/action/action.machine.d.ts +2 -2
- package/lib/action/action.reference.d.ts +3 -3
- package/lib/action/action.store.d.ts +3 -3
- package/lib/action/action.store.source.d.ts +9 -10
- package/lib/action/directive/auto/action.autotrigger.directive.d.ts +4 -4
- package/lib/action/directive/context/action.directive.d.ts +2 -2
- package/lib/action/directive/context/action.source.directive.d.ts +1 -1
- package/lib/action/directive/map/action.map.d.ts +1 -1
- package/lib/action/directive/map/action.map.directive.d.ts +5 -6
- package/lib/action/directive/map/action.map.key.directive.d.ts +1 -1
- package/lib/action/directive/state/action.handler.directive.d.ts +5 -5
- package/lib/action/directive/state/action.success.directive.d.ts +1 -1
- package/lib/action/directive/state/action.value.directive.d.ts +2 -2
- package/lib/action/directive/state/action.value.stream.directive.d.ts +2 -3
- package/lib/action/directive/state/action.value.trigger.directive.d.ts +9 -9
- package/lib/action/directive/state/action.value.trigger.instance.d.ts +5 -5
- package/lib/action/directive/state/action.working.component.d.ts +1 -1
- package/lib/auth/auth.role.any.directive.d.ts +2 -3
- package/lib/auth/auth.role.has.directive.d.ts +2 -3
- package/lib/auth/auth.state.service.d.ts +2 -2
- package/lib/auth/auth.user.d.ts +1 -1
- package/lib/auth/router/auth.router.service.d.ts +2 -2
- package/lib/auth/router/provider/uirouter/hook.d.ts +2 -1
- package/lib/auth/router/provider/uirouter/redirect.d.ts +2 -2
- package/lib/button/button.d.ts +2 -2
- package/lib/button/router/button.segue.directive.d.ts +1 -1
- package/lib/context/context.directive.d.ts +2 -2
- package/lib/context/context.service.d.ts +2 -2
- package/lib/context/state/effect/index.d.ts +1 -1
- package/lib/filter/filter.abstract.connector.directive.d.ts +2 -3
- package/lib/filter/filter.connector.directive.d.ts +1 -1
- package/lib/filter/filter.content.d.ts +3 -3
- package/lib/filter/filter.map.instance.directive.d.ts +1 -1
- package/lib/injection/injection.context.d.ts +5 -5
- package/lib/injection/injection.context.directive.d.ts +3 -3
- package/lib/injection/injection.context.forward.directive.d.ts +2 -2
- package/lib/injection/injection.d.ts +7 -7
- package/lib/injection/injection.directive.d.ts +2 -2
- package/lib/pipe/date/datedistance.pipe.d.ts +1 -1
- package/lib/pipe/date/datefromtoformat.pipe.d.ts +1 -1
- package/lib/pipe/date/tojsdate.pipe.d.ts +1 -0
- package/lib/pipe/misc/prettyjson.pipe.d.ts +2 -2
- package/lib/router/anchor/anchor.d.ts +1 -1
- package/lib/router/anchor/anchor.directive.d.ts +0 -1
- package/lib/router/anchor/clickable.d.ts +1 -1
- package/lib/router/router/provider/angular/angular.router.service.d.ts +2 -2
- package/lib/router/router/provider/uirouter/index.d.ts +0 -1
- package/lib/router/router/provider/uirouter/uirouter.router.service.d.ts +2 -3
- package/lib/router/router/service/router.go.d.ts +4 -4
- package/lib/router/router/service/router.service.d.ts +3 -3
- package/lib/router/router/transition/transition.rxjs.d.ts +2 -2
- package/lib/router/segue.d.ts +13 -10
- package/lib/storage/storage.accessor.d.ts +1 -1
- package/lib/storage/storage.accessor.simple.d.ts +8 -5
- package/lib/storage/storage.accessor.string.d.ts +1 -1
- package/lib/util/view.d.ts +3 -3
- package/lib/view/if.directive.d.ts +6 -6
- package/package.json +5 -5
- package/esm2020/lib/router/router/provider/uirouter/util/future.mjs +0 -38
- package/esm2020/lib/router/router/provider/uirouter/util/index.mjs +0 -2
- package/lib/router/router/provider/uirouter/util/future.d.ts +0 -1
- package/lib/router/router/provider/uirouter/util/index.d.ts +0 -1
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
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,
|
|
4
|
+
import { switchMap, first, BehaviorSubject, combineLatest, distinctUntilChanged, filter, Subject, debounce, interval, throttle, exhaustMap, mergeMap, map, shareReplay, EMPTY, withLatestFrom, of, startWith, tap, delay, catchError, firstValueFrom, takeUntil, Observable } from 'rxjs';
|
|
5
5
|
import * as i1$5 from '@dereekb/rxjs';
|
|
6
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
7
|
import * as i1$6 from '@dereekb/util';
|
|
9
|
-
import { isDefinedAndNotFalse, hasValueOrNotEmpty, BooleanStringKeyArrayUtilityInstance, reduceBooleansWithOrFn, getValueFromGetter, isGetter, setIncludesFunction, maybeSet, isAllowed, expandTreeFunction, flattenTreeToArrayFunction, expandFlattenTreeFunction,
|
|
8
|
+
import { isDefinedAndNotFalse, hasValueOrNotEmpty, BooleanStringKeyArrayUtilityInstance, reduceBooleansWithOrFn, getValueFromGetter, toReadableError, isGetter, setIncludesFunction, maybeSet, isAllowed, expandTreeFunction, flattenTreeToArrayFunction, expandFlattenTreeFunction, mergeArrays, filterMaybeValues, mergeObjects, mergeArrayOrValueIntoArray, makePromiseFullRef, DataIsExpiredError, DataDoesNotExistError, filterMaybeValuesFn, StorageObjectUtility, SHARED_MEMORY_STORAGE } from '@dereekb/util';
|
|
10
9
|
import { ComponentStore } from '@ngrx/component-store';
|
|
11
10
|
import { CommonModule, formatDate } from '@angular/common';
|
|
12
11
|
import * as i1$3 from '@ngrx/effects';
|
|
@@ -16,6 +15,7 @@ import { createAction, props, createReducer, on, combineReducers, createFeatureS
|
|
|
16
15
|
import * as i1$1 from '@angular/router';
|
|
17
16
|
import { NavigationStart, NavigationEnd } from '@angular/router';
|
|
18
17
|
import { isArray } from 'class-validator';
|
|
18
|
+
import { map as map$1 } from 'rxjs/operators';
|
|
19
19
|
import * as i1$2 from '@uirouter/core';
|
|
20
20
|
import { addMinutes, isValid, isPast, formatDistance, formatDistanceToNow, startOfDay, isSameDay } from 'date-fns';
|
|
21
21
|
import { toJsDate, formatToTimeString, unixTimeNumberForNow, timeHasExpired } from '@dereekb/date';
|
|
@@ -108,64 +108,64 @@ class DbxActionContextStoreSourceInstance {
|
|
|
108
108
|
return useActionStore(this.source, useFn);
|
|
109
109
|
}
|
|
110
110
|
get state$() {
|
|
111
|
-
return this.pipeStore(x => x.state$);
|
|
111
|
+
return this.pipeStore((x) => x.state$);
|
|
112
112
|
}
|
|
113
113
|
get triggered$() {
|
|
114
|
-
return this.pipeStore(x => x.triggered$);
|
|
114
|
+
return this.pipeStore((x) => x.triggered$);
|
|
115
115
|
}
|
|
116
116
|
get valueReady$() {
|
|
117
|
-
return this.pipeStore(x => x.valueReady$);
|
|
117
|
+
return this.pipeStore((x) => x.valueReady$);
|
|
118
118
|
}
|
|
119
119
|
get success$() {
|
|
120
|
-
return this.pipeStore(x => x.success$);
|
|
120
|
+
return this.pipeStore((x) => x.success$);
|
|
121
121
|
}
|
|
122
122
|
get error$() {
|
|
123
|
-
return this.pipeStore(x => x.error$);
|
|
123
|
+
return this.pipeStore((x) => x.error$);
|
|
124
124
|
}
|
|
125
125
|
get rejected$() {
|
|
126
|
-
return this.pipeStore(x => x.rejected$);
|
|
126
|
+
return this.pipeStore((x) => x.rejected$);
|
|
127
127
|
}
|
|
128
128
|
get isModified$() {
|
|
129
|
-
return this.pipeStore(x => x.isModified$);
|
|
129
|
+
return this.pipeStore((x) => x.isModified$);
|
|
130
130
|
}
|
|
131
131
|
get canTrigger$() {
|
|
132
|
-
return this.pipeStore(x => x.canTrigger$);
|
|
132
|
+
return this.pipeStore((x) => x.canTrigger$);
|
|
133
133
|
}
|
|
134
134
|
get isModifiedAndCanTriggerUpdates$() {
|
|
135
|
-
return this.pipeStore(x => x.isModifiedAndCanTriggerUpdates$);
|
|
135
|
+
return this.pipeStore((x) => x.isModifiedAndCanTriggerUpdates$);
|
|
136
136
|
}
|
|
137
137
|
get isModifiedAndCanTrigger$() {
|
|
138
|
-
return this.pipeStore(x => x.isModifiedAndCanTrigger$);
|
|
138
|
+
return this.pipeStore((x) => x.isModifiedAndCanTrigger$);
|
|
139
139
|
}
|
|
140
140
|
get actionState$() {
|
|
141
|
-
return this.pipeStore(x => x.actionState$);
|
|
141
|
+
return this.pipeStore((x) => x.actionState$);
|
|
142
142
|
}
|
|
143
143
|
get loadingState$() {
|
|
144
|
-
return this.pipeStore(x => x.loadingState$);
|
|
144
|
+
return this.pipeStore((x) => x.loadingState$);
|
|
145
145
|
}
|
|
146
146
|
get loadingStateType$() {
|
|
147
|
-
return this.pipeStore(x => x.loadingStateType$);
|
|
147
|
+
return this.pipeStore((x) => x.loadingStateType$);
|
|
148
148
|
}
|
|
149
149
|
get isWorking$() {
|
|
150
|
-
return this.pipeStore(x => x.isWorking$);
|
|
150
|
+
return this.pipeStore((x) => x.isWorking$);
|
|
151
151
|
}
|
|
152
152
|
get isSuccess$() {
|
|
153
|
-
return this.pipeStore(x => x.isSuccess$);
|
|
153
|
+
return this.pipeStore((x) => x.isSuccess$);
|
|
154
154
|
}
|
|
155
155
|
get disabledKeys$() {
|
|
156
|
-
return this.pipeStore(x => x.disabledKeys$);
|
|
156
|
+
return this.pipeStore((x) => x.disabledKeys$);
|
|
157
157
|
}
|
|
158
158
|
get isDisabled$() {
|
|
159
|
-
return this.pipeStore(x => x.isDisabled$);
|
|
159
|
+
return this.pipeStore((x) => x.isDisabled$);
|
|
160
160
|
}
|
|
161
161
|
get errorCountSinceLastSuccess$() {
|
|
162
|
-
return this.pipeStore(x => x.errorCountSinceLastSuccess$);
|
|
162
|
+
return this.pipeStore((x) => x.errorCountSinceLastSuccess$);
|
|
163
163
|
}
|
|
164
164
|
enable(key, enable = true) {
|
|
165
165
|
this.disable(key, !enable);
|
|
166
166
|
}
|
|
167
167
|
disable(key, disable = true) {
|
|
168
|
-
this.useStore((x) => (disable
|
|
168
|
+
this.useStore((x) => (disable ? x.disable(key) : x.enable(key)));
|
|
169
169
|
}
|
|
170
170
|
setIsModified(isModified) {
|
|
171
171
|
this.useStore((x) => x.setIsModified(isModified));
|
|
@@ -200,8 +200,9 @@ const actionContextStoreSourceInstanceFactory = (source) => {
|
|
|
200
200
|
/**
|
|
201
201
|
* Provides an ActionContextStoreSource, as well as an DbxActionContextStoreSourceInstance.
|
|
202
202
|
*/
|
|
203
|
-
function
|
|
204
|
-
return [
|
|
203
|
+
function provideActionStoreSource(sourceType) {
|
|
204
|
+
return [
|
|
205
|
+
{
|
|
205
206
|
provide: ActionContextStoreSource,
|
|
206
207
|
useExisting: forwardRef(() => sourceType)
|
|
207
208
|
},
|
|
@@ -209,14 +210,16 @@ function ProvideActionStoreSource(sourceType) {
|
|
|
209
210
|
provide: DbxActionContextStoreSourceInstance,
|
|
210
211
|
useFactory: actionContextStoreSourceInstanceFactory,
|
|
211
212
|
deps: [ActionContextStoreSource]
|
|
212
|
-
}
|
|
213
|
+
}
|
|
214
|
+
];
|
|
213
215
|
}
|
|
214
|
-
function
|
|
215
|
-
return [
|
|
216
|
+
function provideSecondaryActionStoreSource(sourceType) {
|
|
217
|
+
return [
|
|
218
|
+
{
|
|
216
219
|
provide: SecondaryActionContextStoreSource,
|
|
217
220
|
useExisting: forwardRef(() => sourceType)
|
|
218
221
|
},
|
|
219
|
-
...
|
|
222
|
+
...provideActionStoreSource(sourceType)
|
|
220
223
|
];
|
|
221
224
|
}
|
|
222
225
|
|
|
@@ -235,7 +238,7 @@ class DbxActionAutoModifyDirective extends AbstractSubscriptionDirective {
|
|
|
235
238
|
ngOnInit() {
|
|
236
239
|
const obs = combineLatest([
|
|
237
240
|
this._autoModifyEnabled.pipe(distinctUntilChanged()),
|
|
238
|
-
this.source.isModified$.pipe(filter(x => !x)) // Only when not modified send a value.
|
|
241
|
+
this.source.isModified$.pipe(filter((x) => !x)) // Only when not modified send a value.
|
|
239
242
|
]);
|
|
240
243
|
this.sub = obs.subscribe(([autoModifyEnabled, isModified]) => {
|
|
241
244
|
if (autoModifyEnabled && !isModified) {
|
|
@@ -255,7 +258,7 @@ DbxActionAutoModifyDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12
|
|
|
255
258
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionAutoModifyDirective, decorators: [{
|
|
256
259
|
type: Directive,
|
|
257
260
|
args: [{
|
|
258
|
-
selector: '[dbxActionAutoModify]'
|
|
261
|
+
selector: '[dbxActionAutoModify]'
|
|
259
262
|
}]
|
|
260
263
|
}], ctorParameters: function () { return [{ type: DbxActionContextStoreSourceInstance, decorators: [{
|
|
261
264
|
type: Host
|
|
@@ -284,9 +287,9 @@ class DbxActionAutoTriggerDirective extends AbstractSubscriptionDirective {
|
|
|
284
287
|
this.maxErrorsForThrottle = MAX_ERRORS_TO_THROTTLE_ON;
|
|
285
288
|
this._triggerCount = 0;
|
|
286
289
|
this._errorCount$ = this.source.errorCountSinceLastSuccess$;
|
|
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 +
|
|
290
|
+
this._triggerCount$ = this.source.isModifiedAndCanTriggerUpdates$.pipe(filter(() => this.isEnabled), filter((x) => x), debounce(() => interval(this.triggerDebounce)), throttle(() => this._errorCount$.pipe(first(), exhaustMap((count) => interval(this.triggerThrottle + Math.min(count, this.maxErrorsForThrottle) * this.triggerErrorThrottle))), { leading: true, trailing: true }),
|
|
288
291
|
// Check again for the "trailing" piece.
|
|
289
|
-
filter(() => this.isEnabled), mergeMap(() => this.source.isModifiedAndCanTrigger$.pipe(first())), filter((x) => x), map(() => this._triggerCount += 1), shareReplay(1));
|
|
292
|
+
filter(() => this.isEnabled), mergeMap(() => this.source.isModifiedAndCanTrigger$.pipe(first())), filter((x) => x), map(() => (this._triggerCount += 1)), shareReplay(1));
|
|
290
293
|
/**
|
|
291
294
|
* Observable for the trigger mechanism.
|
|
292
295
|
*/
|
|
@@ -298,9 +301,9 @@ class DbxActionAutoTriggerDirective extends AbstractSubscriptionDirective {
|
|
|
298
301
|
return EMPTY;
|
|
299
302
|
}
|
|
300
303
|
}));
|
|
301
|
-
this._isTriggerLimited$ = combineLatest([this.triggerCount$, this._triggerLimit]).pipe(map(([triggerCount, limit]) => [triggerCount,
|
|
302
|
-
this.isTriggerLimited$ = this._isTriggerLimited$.pipe(map(x => x[1]));
|
|
303
|
-
this.trigger$ = this._isTriggerLimited$.pipe(filter(x => !x[1]), distinctUntilChanged((a, b) => a[0] === b[0]), // Only trigger when the count changes.
|
|
304
|
+
this._isTriggerLimited$ = combineLatest([this.triggerCount$, this._triggerLimit]).pipe(map(([triggerCount, limit]) => [triggerCount, limit ? triggerCount > limit : false]), shareReplay(1));
|
|
305
|
+
this.isTriggerLimited$ = this._isTriggerLimited$.pipe(map((x) => x[1]));
|
|
306
|
+
this.trigger$ = this._isTriggerLimited$.pipe(filter((x) => !x[1]), distinctUntilChanged((a, b) => a[0] === b[0]), // Only trigger when the count changes.
|
|
304
307
|
map(() => undefined));
|
|
305
308
|
}
|
|
306
309
|
/**
|
|
@@ -366,7 +369,7 @@ DbxActionAutoTriggerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "1
|
|
|
366
369
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionAutoTriggerDirective, decorators: [{
|
|
367
370
|
type: Directive,
|
|
368
371
|
args: [{
|
|
369
|
-
selector: 'dbxActionAutoTrigger, [dbxActionAutoTrigger]'
|
|
372
|
+
selector: 'dbxActionAutoTrigger, [dbxActionAutoTrigger]'
|
|
370
373
|
}]
|
|
371
374
|
}], ctorParameters: function () { return [{ type: DbxActionContextStoreSourceInstance, decorators: [{
|
|
372
375
|
type: Host
|
|
@@ -423,11 +426,11 @@ class dbxActionValueStreamDirective {
|
|
|
423
426
|
}
|
|
424
427
|
ngOnInit() {
|
|
425
428
|
// Update Modified value.
|
|
426
|
-
this._modifiedSub.subscription = this.modifiedValue$.subscribe(([isModified
|
|
429
|
+
this._modifiedSub.subscription = this.modifiedValue$.subscribe(([isModified]) => {
|
|
427
430
|
this.source.setIsModified(isModified);
|
|
428
431
|
});
|
|
429
432
|
// Set the value on triggers.
|
|
430
|
-
this._triggerSub.subscription = this.source.triggered$.pipe(switchMap(
|
|
433
|
+
this._triggerSub.subscription = this.source.triggered$.pipe(switchMap(() => this.modifiedValue$)).subscribe(([isModified, value]) => {
|
|
431
434
|
if (isModified) {
|
|
432
435
|
this.source.readyValue(value);
|
|
433
436
|
}
|
|
@@ -447,7 +450,7 @@ dbxActionValueStreamDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "1
|
|
|
447
450
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: dbxActionValueStreamDirective, decorators: [{
|
|
448
451
|
type: Directive,
|
|
449
452
|
args: [{
|
|
450
|
-
selector: '[dbxActionValueStream]'
|
|
453
|
+
selector: '[dbxActionValueStream]'
|
|
451
454
|
}]
|
|
452
455
|
}], ctorParameters: function () { return [{ type: DbxActionContextStoreSourceInstance, decorators: [{
|
|
453
456
|
type: Host
|
|
@@ -588,11 +591,11 @@ class ActionContextStore extends ComponentStore {
|
|
|
588
591
|
super({ ...INITIAL_STATE });
|
|
589
592
|
this.lockSet = new LockSet();
|
|
590
593
|
// MARK: Accessors
|
|
591
|
-
this.actionState$ = this.state$.pipe(map(x => isDisabledActionContextState(x) ? DbxActionState.DISABLED : x.actionState), shareReplay(1));
|
|
594
|
+
this.actionState$ = this.state$.pipe(map((x) => (isDisabledActionContextState(x) ? DbxActionState.DISABLED : x.actionState)), shareReplay(1));
|
|
592
595
|
/**
|
|
593
596
|
* Returns the current disabled reasons/keys.
|
|
594
597
|
*/
|
|
595
|
-
this.disabledKeys$ = this.state$.pipe(map(x => [...x.disabled ?? []]), distinctUntilChanged(), shareReplay(1));
|
|
598
|
+
this.disabledKeys$ = this.state$.pipe(map((x) => [...(x.disabled ?? [])]), distinctUntilChanged(), shareReplay(1));
|
|
596
599
|
/**
|
|
597
600
|
* Maps the current state to true or not when the action state changes to/from disabled.
|
|
598
601
|
*/
|
|
@@ -600,7 +603,7 @@ class ActionContextStore extends ComponentStore {
|
|
|
600
603
|
/**
|
|
601
604
|
* Pipes when idle but modified.
|
|
602
605
|
*/
|
|
603
|
-
this.isModified$ = this.afterDistinctBoolean(x => x.isModified);
|
|
606
|
+
this.isModified$ = this.afterDistinctBoolean((x) => x.isModified);
|
|
604
607
|
/**
|
|
605
608
|
* Pipes true when triggered.
|
|
606
609
|
*/
|
|
@@ -608,11 +611,11 @@ class ActionContextStore extends ComponentStore {
|
|
|
608
611
|
/**
|
|
609
612
|
* Pipes the readied value on ValueReady.
|
|
610
613
|
*/
|
|
611
|
-
this.valueReady$ = this.afterDistinctActionState(DbxActionState.VALUE_READY, x => x.value);
|
|
614
|
+
this.valueReady$ = this.afterDistinctActionState(DbxActionState.VALUE_READY, (x) => x.value);
|
|
612
615
|
/**
|
|
613
616
|
* Pipes the error on the rejection state.
|
|
614
617
|
*/
|
|
615
|
-
this.rejected$ = this.afterDistinctActionState(DbxActionState.REJECTED, x => x.error);
|
|
618
|
+
this.rejected$ = this.afterDistinctActionState(DbxActionState.REJECTED, (x) => x.error);
|
|
616
619
|
/**
|
|
617
620
|
* Pipes the result when the ActionState becomes working.
|
|
618
621
|
*/
|
|
@@ -620,27 +623,27 @@ class ActionContextStore extends ComponentStore {
|
|
|
620
623
|
/**
|
|
621
624
|
* Whether or not it is currently in a working state.
|
|
622
625
|
*/
|
|
623
|
-
this.isWorking$ = this.afterDistinctBoolean(x => isWorkingActionState(x.actionState));
|
|
626
|
+
this.isWorking$ = this.afterDistinctBoolean((x) => isWorkingActionState(x.actionState));
|
|
624
627
|
/**
|
|
625
628
|
* Pipes the current error.
|
|
626
629
|
*/
|
|
627
|
-
this.error$ = this.state$.pipe(map(x => x.error), distinctUntilChanged(), shareReplay(1));
|
|
630
|
+
this.error$ = this.state$.pipe(map((x) => x.error), distinctUntilChanged(), shareReplay(1));
|
|
628
631
|
/**
|
|
629
632
|
* Pipes the result when the ActionState becomes success.
|
|
630
633
|
*/
|
|
631
|
-
this.success$ = this.afterDistinctActionState(DbxActionState.RESOLVED, x => x.result);
|
|
634
|
+
this.success$ = this.afterDistinctActionState(DbxActionState.RESOLVED, (x) => x.result);
|
|
632
635
|
/**
|
|
633
636
|
* Whether or not it is currently in a success state.
|
|
634
637
|
*/
|
|
635
|
-
this.isSuccess$ = this.afterDistinctBoolean(x => x.actionState === DbxActionState.RESOLVED);
|
|
638
|
+
this.isSuccess$ = this.afterDistinctBoolean((x) => x.actionState === DbxActionState.RESOLVED);
|
|
636
639
|
/**
|
|
637
640
|
* Returns a loading state based on the current state.
|
|
638
641
|
*/
|
|
639
|
-
this.loadingState$ = this.afterDistinctLoadingStateTypeChange().pipe(map(x => loadingStateForActionContextState(x)), shareReplay(1));
|
|
642
|
+
this.loadingState$ = this.afterDistinctLoadingStateTypeChange().pipe(map((x) => loadingStateForActionContextState(x)), shareReplay(1));
|
|
640
643
|
/**
|
|
641
644
|
* Returns the current LoadingStateType based on the current state.
|
|
642
645
|
*/
|
|
643
|
-
this.loadingStateType$ = this.state$.pipe(map(x => loadingStateTypeForActionContextState(x)), distinctUntilChanged(), shareReplay(1));
|
|
646
|
+
this.loadingStateType$ = this.state$.pipe(map((x) => loadingStateTypeForActionContextState(x)), distinctUntilChanged(), shareReplay(1));
|
|
644
647
|
/**
|
|
645
648
|
* Number of errors since last success.
|
|
646
649
|
*/
|
|
@@ -666,21 +669,21 @@ class ActionContextStore extends ComponentStore {
|
|
|
666
669
|
*/
|
|
667
670
|
this.disable = this.updater((state, key) => ({
|
|
668
671
|
...state,
|
|
669
|
-
disabled: BooleanStringKeyArrayUtilityInstance.insert(state.disabled,
|
|
672
|
+
disabled: BooleanStringKeyArrayUtilityInstance.insert(state.disabled, key ?? DEFAULT_ACTION_DISABLED_KEY)
|
|
670
673
|
}));
|
|
671
674
|
/**
|
|
672
675
|
* Removes a disabled reason.
|
|
673
676
|
*/
|
|
674
677
|
this.enable = this.updater((state, key) => ({
|
|
675
678
|
...state,
|
|
676
|
-
disabled: BooleanStringKeyArrayUtilityInstance.remove(state.disabled,
|
|
679
|
+
disabled: BooleanStringKeyArrayUtilityInstance.remove(state.disabled, key ?? DEFAULT_ACTION_DISABLED_KEY)
|
|
677
680
|
}));
|
|
678
681
|
/**
|
|
679
682
|
* Triggers the modified state, if not disabled.
|
|
680
683
|
*/
|
|
681
684
|
this.setIsModified = this.updater((state, isModified) => ({
|
|
682
685
|
...state,
|
|
683
|
-
actionState:
|
|
686
|
+
actionState: state.actionState === DbxActionState.RESOLVED ? DbxActionState.IDLE : state.actionState,
|
|
684
687
|
isModified: isModified ?? true
|
|
685
688
|
}));
|
|
686
689
|
/**
|
|
@@ -688,15 +691,11 @@ class ActionContextStore extends ComponentStore {
|
|
|
688
691
|
*
|
|
689
692
|
* Will not fire if the action is disabled.
|
|
690
693
|
*/
|
|
691
|
-
this.trigger = this.updater((state) => canTriggerAction(state)
|
|
692
|
-
? ({ isModified: state.isModified, actionState: DbxActionState.TRIGGERED, error: state.error, value: undefined })
|
|
693
|
-
: state);
|
|
694
|
+
this.trigger = this.updater((state) => (canTriggerAction(state) ? { isModified: state.isModified, actionState: DbxActionState.TRIGGERED, error: state.error, value: undefined } : state));
|
|
694
695
|
/**
|
|
695
696
|
* Updates the value, setting value ready. The current result is cleared.
|
|
696
697
|
*/
|
|
697
|
-
this.readyValue = this.updater((state, value) => canReadyValue(state)
|
|
698
|
-
? ({ ...state, actionState: DbxActionState.VALUE_READY, value, result: undefined })
|
|
699
|
-
: state);
|
|
698
|
+
this.readyValue = this.updater((state, value) => (canReadyValue(state) ? { ...state, actionState: DbxActionState.VALUE_READY, value, result: undefined } : state));
|
|
700
699
|
/**
|
|
701
700
|
* Notifys the context that the action is in progress.
|
|
702
701
|
*/
|
|
@@ -704,7 +703,13 @@ class ActionContextStore extends ComponentStore {
|
|
|
704
703
|
/**
|
|
705
704
|
* Triggers rejection of the action. The value is cleared.
|
|
706
705
|
*/
|
|
707
|
-
this.reject = this.updater((state, error) => ({
|
|
706
|
+
this.reject = this.updater((state, error) => ({
|
|
707
|
+
isModified: state.isModified,
|
|
708
|
+
actionState: DbxActionState.REJECTED,
|
|
709
|
+
error,
|
|
710
|
+
errorCount: (state.errorCount ?? 0) + 1,
|
|
711
|
+
disabled: state.disabled
|
|
712
|
+
}));
|
|
708
713
|
/**
|
|
709
714
|
* Updates the state to success, and optionally sets a result.
|
|
710
715
|
*
|
|
@@ -714,24 +719,24 @@ class ActionContextStore extends ComponentStore {
|
|
|
714
719
|
/**
|
|
715
720
|
* Completely resets the store.
|
|
716
721
|
*/
|
|
717
|
-
this.reset = this.updater((
|
|
722
|
+
this.reset = this.updater(() => ({ ...INITIAL_STATE }));
|
|
718
723
|
this.lockSet.addLock('working', this.isWorking$);
|
|
719
724
|
}
|
|
720
725
|
// MARK: Utility
|
|
721
726
|
afterDistinctBoolean(fromState) {
|
|
722
|
-
return this.state$.pipe(map(x => fromState(x)), distinctUntilChanged(), shareReplay(1));
|
|
727
|
+
return this.state$.pipe(map((x) => fromState(x)), distinctUntilChanged(), shareReplay(1));
|
|
723
728
|
}
|
|
724
729
|
afterDistinctActionState(actionState, fromState) {
|
|
725
730
|
return this.afterDistinctActionStateChange().pipe(filter((x) => x.actionState === actionState), // Only pipe when the new action state matches.
|
|
726
|
-
map(x => fromState(x)), shareReplay(1));
|
|
731
|
+
map((x) => fromState(x)), shareReplay(1));
|
|
727
732
|
}
|
|
728
733
|
afterDistinctActionStateChange() {
|
|
729
|
-
return this.state$.pipe(map((x) =>
|
|
730
|
-
map(x => x[0]), shareReplay(1));
|
|
734
|
+
return this.state$.pipe(map((x) => [x, x.actionState]), distinctUntilChanged((a, b) => a?.[1] === b?.[1]), // Filter out when the state remains the same.
|
|
735
|
+
map((x) => x[0]), shareReplay(1));
|
|
731
736
|
}
|
|
732
737
|
afterDistinctLoadingStateTypeChange() {
|
|
733
|
-
return this.state$.pipe(map((x) =>
|
|
734
|
-
map(x => x[0]), shareReplay(1));
|
|
738
|
+
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.
|
|
739
|
+
map((x) => x[0]), shareReplay(1));
|
|
735
740
|
}
|
|
736
741
|
// MARK: Cleanup
|
|
737
742
|
ngOnDestroy() {
|
|
@@ -817,13 +822,13 @@ class DbxActionDirective extends DbxActionContextBaseSource {
|
|
|
817
822
|
}
|
|
818
823
|
}
|
|
819
824
|
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:
|
|
825
|
+
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
826
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionDirective, decorators: [{
|
|
822
827
|
type: Directive,
|
|
823
828
|
args: [{
|
|
824
829
|
selector: 'dbx-action,[dbxAction],dbx-action-context,[dbxActionContext]',
|
|
825
830
|
exportAs: 'action,dbxAction',
|
|
826
|
-
providers:
|
|
831
|
+
providers: provideActionStoreSource(DbxActionDirective)
|
|
827
832
|
}]
|
|
828
833
|
}], ctorParameters: function () { return [{ type: SecondaryActionContextStoreSource, decorators: [{
|
|
829
834
|
type: Optional
|
|
@@ -853,12 +858,12 @@ class DbxActionSourceDirective {
|
|
|
853
858
|
}
|
|
854
859
|
}
|
|
855
860
|
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:
|
|
861
|
+
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
862
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionSourceDirective, decorators: [{
|
|
858
863
|
type: Directive,
|
|
859
864
|
args: [{
|
|
860
865
|
selector: '[dbxActionSource]',
|
|
861
|
-
providers:
|
|
866
|
+
providers: provideSecondaryActionStoreSource(DbxActionSourceDirective)
|
|
862
867
|
}]
|
|
863
868
|
}], propDecorators: { source: [{
|
|
864
869
|
type: Input,
|
|
@@ -899,7 +904,7 @@ class DbxActionContextMapDirective {
|
|
|
899
904
|
constructor() {
|
|
900
905
|
this._map = new BehaviorSubject(new Map());
|
|
901
906
|
this.map$ = this._map.asObservable();
|
|
902
|
-
this.areAnyWorking$ = this.checkAnyAre(x => x.isWorking$, false);
|
|
907
|
+
this.areAnyWorking$ = this.checkAnyAre((x) => x.isWorking$, false);
|
|
903
908
|
}
|
|
904
909
|
get map() {
|
|
905
910
|
return this._map.value;
|
|
@@ -944,14 +949,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
944
949
|
args: [{
|
|
945
950
|
selector: '[dbxActionContextMap]',
|
|
946
951
|
exportAs: 'actionMap',
|
|
947
|
-
providers: []
|
|
952
|
+
providers: []
|
|
948
953
|
}]
|
|
949
|
-
}]
|
|
954
|
+
}] });
|
|
950
955
|
class DbxActionContextMapDirectiveSourceInstance {
|
|
951
956
|
constructor(parent, key) {
|
|
952
957
|
this.parent = parent;
|
|
953
958
|
this.key = key;
|
|
954
|
-
this._source$ = this.parent.map$.pipe(map(x => x.get(this.key)), distinctUntilChanged());
|
|
959
|
+
this._source$ = this.parent.map$.pipe(map((x) => x.get(this.key)), distinctUntilChanged());
|
|
955
960
|
this._store$ = this._source$.pipe(switchMap((x) => x?.store$ ?? of(undefined)), shareReplay(1));
|
|
956
961
|
this.store$ = actionContextStoreSourcePipe(this._store$);
|
|
957
962
|
}
|
|
@@ -977,12 +982,12 @@ class DbxActionFromMapDirective {
|
|
|
977
982
|
}
|
|
978
983
|
}
|
|
979
984
|
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:
|
|
985
|
+
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
986
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionFromMapDirective, decorators: [{
|
|
982
987
|
type: Directive,
|
|
983
988
|
args: [{
|
|
984
989
|
selector: '[dbxActionFromMap]',
|
|
985
|
-
providers:
|
|
990
|
+
providers: provideSecondaryActionStoreSource(DbxActionFromMapDirective)
|
|
986
991
|
}]
|
|
987
992
|
}], ctorParameters: function () { return [{ type: DbxActionContextMapDirective }]; }, propDecorators: { key: [{
|
|
988
993
|
type: Input,
|
|
@@ -1151,13 +1156,15 @@ class DbxActionHandlerDirective extends AbstractSubscriptionDirective {
|
|
|
1151
1156
|
this._handlerFunction.next(handlerFunction);
|
|
1152
1157
|
}
|
|
1153
1158
|
ngOnInit() {
|
|
1154
|
-
this.sub = this.handlerFunction
|
|
1159
|
+
this.sub = this.handlerFunction$
|
|
1160
|
+
.pipe(switchMap((work) => this.source.valueReady$.pipe(tap((value) => {
|
|
1155
1161
|
const context = workFactory({ work, delegate: this._delegate })(value);
|
|
1156
1162
|
if (context) {
|
|
1157
1163
|
// Add the action to the lockSet for the source to prevent it from being destroyed until the action completes.
|
|
1158
|
-
this.source.lockSet.addLock('dbxActionHandler', context.isComplete$.pipe(map(x => !x)));
|
|
1164
|
+
this.source.lockSet.addLock('dbxActionHandler', context.isComplete$.pipe(map((x) => !x)));
|
|
1159
1165
|
}
|
|
1160
|
-
}))))
|
|
1166
|
+
}))))
|
|
1167
|
+
.subscribe();
|
|
1161
1168
|
}
|
|
1162
1169
|
ngOnDestroy() {
|
|
1163
1170
|
this.source.lockSet.onNextUnlock(() => {
|
|
@@ -1171,7 +1178,7 @@ DbxActionHandlerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.
|
|
|
1171
1178
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionHandlerDirective, decorators: [{
|
|
1172
1179
|
type: Directive,
|
|
1173
1180
|
args: [{
|
|
1174
|
-
selector: '[dbxActionHandler]'
|
|
1181
|
+
selector: '[dbxActionHandler]'
|
|
1175
1182
|
}]
|
|
1176
1183
|
}], ctorParameters: function () { return [{ type: DbxActionContextStoreSourceInstance, decorators: [{
|
|
1177
1184
|
type: Host
|
|
@@ -1190,7 +1197,7 @@ class AbstractIfDirective extends AbstractSubscriptionDirective {
|
|
|
1190
1197
|
this.viewContainer = viewContainer;
|
|
1191
1198
|
}
|
|
1192
1199
|
ngOnInit() {
|
|
1193
|
-
this.sub = this.show$.pipe(distinctUntilChanged
|
|
1200
|
+
this.sub = this.show$.pipe(distinctUntilChanged()).subscribe((show) => {
|
|
1194
1201
|
if (show) {
|
|
1195
1202
|
this.viewContainer.createEmbeddedView(this.templateRef);
|
|
1196
1203
|
}
|
|
@@ -1213,14 +1220,14 @@ class DbxActionHasSuccessDirective extends AbstractIfDirective {
|
|
|
1213
1220
|
constructor(templateRef, viewContainer, source) {
|
|
1214
1221
|
super(templateRef, viewContainer);
|
|
1215
1222
|
this.source = source;
|
|
1216
|
-
this.show$ = this.source.isSuccess$.pipe(exhaustMap
|
|
1223
|
+
this.show$ = this.source.isSuccess$.pipe(exhaustMap((success) => {
|
|
1217
1224
|
if (success) {
|
|
1218
1225
|
return emitDelayObs(true, false, this.hideAfter || undefined);
|
|
1219
1226
|
}
|
|
1220
1227
|
else {
|
|
1221
1228
|
return of(false);
|
|
1222
1229
|
}
|
|
1223
|
-
}), shareReplay
|
|
1230
|
+
}), shareReplay(1));
|
|
1224
1231
|
}
|
|
1225
1232
|
}
|
|
1226
1233
|
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 });
|
|
@@ -1252,9 +1259,11 @@ class DbxActionSuccessHandlerDirective extends AbstractSubscriptionDirective {
|
|
|
1252
1259
|
this._successFunction.next(successFunction);
|
|
1253
1260
|
}
|
|
1254
1261
|
ngOnInit() {
|
|
1255
|
-
this.sub = this.successFunction
|
|
1262
|
+
this.sub = this.successFunction$
|
|
1263
|
+
.pipe(switchMap((successFunction) => this.source.success$.pipe(map((x) => [successFunction, x]), tap(([successFn, result]) => {
|
|
1256
1264
|
successFn(result);
|
|
1257
|
-
}))))
|
|
1265
|
+
}))))
|
|
1266
|
+
.subscribe();
|
|
1258
1267
|
}
|
|
1259
1268
|
ngOnDestroy() {
|
|
1260
1269
|
super.ngOnDestroy();
|
|
@@ -1266,7 +1275,7 @@ DbxActionSuccessHandlerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion:
|
|
|
1266
1275
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionSuccessHandlerDirective, decorators: [{
|
|
1267
1276
|
type: Directive,
|
|
1268
1277
|
args: [{
|
|
1269
|
-
selector: '[dbxActionSuccessHandler]'
|
|
1278
|
+
selector: '[dbxActionSuccessHandler]'
|
|
1270
1279
|
}]
|
|
1271
1280
|
}], ctorParameters: function () { return [{ type: DbxActionContextStoreSourceInstance, decorators: [{
|
|
1272
1281
|
type: Host
|
|
@@ -1294,10 +1303,12 @@ class DbxActionValueDirective extends AbstractSubscriptionDirective {
|
|
|
1294
1303
|
this._valueOrFunction.next(valueOrFunction);
|
|
1295
1304
|
}
|
|
1296
1305
|
ngOnInit() {
|
|
1297
|
-
this.sub = this.valueOrFunction
|
|
1306
|
+
this.sub = this.valueOrFunction$
|
|
1307
|
+
.pipe(switchMap((valueOrFunction) => this.source.triggered$.pipe(tap(() => {
|
|
1298
1308
|
const value = getValueFromGetter(valueOrFunction);
|
|
1299
1309
|
this.source.readyValue(value);
|
|
1300
|
-
}))))
|
|
1310
|
+
}))))
|
|
1311
|
+
.subscribe();
|
|
1301
1312
|
}
|
|
1302
1313
|
ngOnDestroy() {
|
|
1303
1314
|
this.source.lockSet.onNextUnlock(() => {
|
|
@@ -1311,7 +1322,7 @@ DbxActionValueDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0"
|
|
|
1311
1322
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionValueDirective, decorators: [{
|
|
1312
1323
|
type: Directive,
|
|
1313
1324
|
args: [{
|
|
1314
|
-
selector: '[dbxActionValue]'
|
|
1325
|
+
selector: '[dbxActionValue]'
|
|
1315
1326
|
}]
|
|
1316
1327
|
}], ctorParameters: function () { return [{ type: DbxActionContextStoreSourceInstance, decorators: [{
|
|
1317
1328
|
type: Host
|
|
@@ -1329,14 +1340,14 @@ class DbxActionIsWorkingDirective extends AbstractIfDirective {
|
|
|
1329
1340
|
constructor(templateRef, viewContainer, source) {
|
|
1330
1341
|
super(templateRef, viewContainer);
|
|
1331
1342
|
this.source = source;
|
|
1332
|
-
this.show$ = this.source.isWorking$.pipe(exhaustMap
|
|
1343
|
+
this.show$ = this.source.isWorking$.pipe(exhaustMap((isWorking) => {
|
|
1333
1344
|
if (isWorking && this.showAfter) {
|
|
1334
1345
|
return emitDelayObs(false, true, this.showAfter || undefined);
|
|
1335
1346
|
}
|
|
1336
1347
|
else {
|
|
1337
1348
|
return of(isWorking);
|
|
1338
1349
|
}
|
|
1339
|
-
}), shareReplay
|
|
1350
|
+
}), shareReplay(1));
|
|
1340
1351
|
}
|
|
1341
1352
|
}
|
|
1342
1353
|
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 });
|
|
@@ -1362,7 +1373,9 @@ class DbxActionEnforceModifiedDirective extends AbstractSubscriptionDirective {
|
|
|
1362
1373
|
this._enabled = new BehaviorSubject(true);
|
|
1363
1374
|
}
|
|
1364
1375
|
ngOnInit() {
|
|
1365
|
-
this.sub = combineLatest([this.source.isModified$, this._enabled])
|
|
1376
|
+
this.sub = combineLatest([this.source.isModified$, this._enabled])
|
|
1377
|
+
.pipe(delay(0))
|
|
1378
|
+
.subscribe(([modified, enableDirective]) => {
|
|
1366
1379
|
const disable = enableDirective && !modified;
|
|
1367
1380
|
this.source.disable(APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY, disable);
|
|
1368
1381
|
});
|
|
@@ -1412,12 +1425,13 @@ class DbxActionValueOnTriggerInstance {
|
|
|
1412
1425
|
}
|
|
1413
1426
|
init() {
|
|
1414
1427
|
// Ready the value after the source is triggered. Do modified check one last time.
|
|
1415
|
-
this._triggeredSub.subscription = this.source.triggered
|
|
1416
|
-
.pipe(
|
|
1428
|
+
this._triggeredSub.subscription = this.source.triggered$
|
|
1429
|
+
.pipe(switchMap(() => this.valueGetter$.pipe(switchMap((valueGetter) => asObservable(valueGetter()))).pipe(
|
|
1417
1430
|
// If the value is not null/undefined and is considered modified, then pass the value.
|
|
1418
|
-
switchMap
|
|
1419
|
-
// Catch
|
|
1420
|
-
catchError((reject) => of({ reject })))))
|
|
1431
|
+
switchMap((value) => returnIfIs(this.isModifiedFunction, value, false).pipe(map((value) => ({ value })))),
|
|
1432
|
+
// Catch unknown errors and pass them to reject.
|
|
1433
|
+
catchError((reject) => of({ reject: toReadableError(reject) })))))
|
|
1434
|
+
.subscribe((result) => {
|
|
1421
1435
|
if (result.value != null) {
|
|
1422
1436
|
this.source.readyValue(result.value);
|
|
1423
1437
|
}
|
|
@@ -1495,8 +1509,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
1495
1509
|
selector: '[dbxActionValueOnTrigger]'
|
|
1496
1510
|
}]
|
|
1497
1511
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: DbxActionContextStoreSourceInstance }]; }, propDecorators: { dbxActionValueOnTrigger: [{
|
|
1498
|
-
type: Input
|
|
1499
|
-
args: ['dbxActionValueOnTrigger']
|
|
1512
|
+
type: Input
|
|
1500
1513
|
}], dbxActionValueTriggerModified: [{
|
|
1501
1514
|
type: Input
|
|
1502
1515
|
}] } });
|
|
@@ -1523,7 +1536,7 @@ class DbxActionContextMachine extends DbxActionContextBaseSource {
|
|
|
1523
1536
|
});
|
|
1524
1537
|
// If this is a one-time use, then destroy it after the first success comes through.
|
|
1525
1538
|
if (this.config.oneTimeUse) {
|
|
1526
|
-
this.sourceInstance.success$.pipe(first(), delay
|
|
1539
|
+
this.sourceInstance.success$.pipe(first(), delay(1000)).subscribe(() => {
|
|
1527
1540
|
this.destroy();
|
|
1528
1541
|
});
|
|
1529
1542
|
}
|
|
@@ -1545,33 +1558,81 @@ class DbxActionContextMachine extends DbxActionContextBaseSource {
|
|
|
1545
1558
|
class DbxCoreActionModule {
|
|
1546
1559
|
}
|
|
1547
1560
|
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,
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
DbxActionMapWorkingDisableDirective,
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1561
|
+
DbxCoreActionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreActionModule, declarations: [DbxActionDirective,
|
|
1562
|
+
DbxActionContextMapDirective,
|
|
1563
|
+
DbxActionFromMapDirective,
|
|
1564
|
+
DbxActionMapSourceDirective,
|
|
1565
|
+
DbxActionMapWorkingDisableDirective,
|
|
1566
|
+
DbxActionSourceDirective,
|
|
1567
|
+
DbxActionHandlerDirective,
|
|
1568
|
+
DbxActionDisabledDirective,
|
|
1569
|
+
DbxActionEnforceModifiedDirective,
|
|
1570
|
+
DbxActionAutoTriggerDirective,
|
|
1571
|
+
dbxActionValueStreamDirective,
|
|
1572
|
+
DbxActionAutoModifyDirective,
|
|
1573
|
+
DbxActionValueDirective,
|
|
1574
|
+
DbxActionContextLoggerDirective,
|
|
1575
|
+
DbxActionHasSuccessDirective,
|
|
1576
|
+
DbxActionSuccessHandlerDirective,
|
|
1577
|
+
DbxActionIsWorkingDirective], imports: [CommonModule], exports: [DbxActionDirective,
|
|
1578
|
+
DbxActionContextMapDirective,
|
|
1579
|
+
DbxActionFromMapDirective,
|
|
1580
|
+
DbxActionMapSourceDirective,
|
|
1581
|
+
DbxActionMapWorkingDisableDirective,
|
|
1582
|
+
DbxActionSourceDirective,
|
|
1583
|
+
DbxActionHandlerDirective,
|
|
1584
|
+
DbxActionDisabledDirective,
|
|
1585
|
+
DbxActionEnforceModifiedDirective,
|
|
1586
|
+
DbxActionAutoTriggerDirective,
|
|
1587
|
+
dbxActionValueStreamDirective,
|
|
1588
|
+
DbxActionAutoModifyDirective,
|
|
1589
|
+
DbxActionValueDirective,
|
|
1590
|
+
DbxActionContextLoggerDirective,
|
|
1591
|
+
DbxActionHasSuccessDirective,
|
|
1592
|
+
DbxActionSuccessHandlerDirective,
|
|
1593
|
+
DbxActionIsWorkingDirective] });
|
|
1594
|
+
DbxCoreActionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreActionModule, imports: [[CommonModule]] });
|
|
1558
1595
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreActionModule, decorators: [{
|
|
1559
1596
|
type: NgModule,
|
|
1560
1597
|
args: [{
|
|
1561
|
-
imports: [
|
|
1562
|
-
CommonModule
|
|
1563
|
-
],
|
|
1598
|
+
imports: [CommonModule],
|
|
1564
1599
|
declarations: [
|
|
1565
|
-
DbxActionDirective,
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1600
|
+
DbxActionDirective,
|
|
1601
|
+
DbxActionContextMapDirective,
|
|
1602
|
+
DbxActionFromMapDirective,
|
|
1603
|
+
DbxActionMapSourceDirective,
|
|
1604
|
+
DbxActionMapWorkingDisableDirective,
|
|
1605
|
+
DbxActionSourceDirective,
|
|
1606
|
+
DbxActionHandlerDirective,
|
|
1607
|
+
DbxActionDisabledDirective,
|
|
1608
|
+
DbxActionEnforceModifiedDirective,
|
|
1609
|
+
DbxActionAutoTriggerDirective,
|
|
1610
|
+
dbxActionValueStreamDirective,
|
|
1611
|
+
DbxActionAutoModifyDirective,
|
|
1612
|
+
DbxActionValueDirective,
|
|
1613
|
+
DbxActionContextLoggerDirective,
|
|
1614
|
+
DbxActionHasSuccessDirective,
|
|
1615
|
+
DbxActionSuccessHandlerDirective,
|
|
1616
|
+
DbxActionIsWorkingDirective
|
|
1569
1617
|
],
|
|
1570
1618
|
exports: [
|
|
1571
|
-
DbxActionDirective,
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1619
|
+
DbxActionDirective,
|
|
1620
|
+
DbxActionContextMapDirective,
|
|
1621
|
+
DbxActionFromMapDirective,
|
|
1622
|
+
DbxActionMapSourceDirective,
|
|
1623
|
+
DbxActionMapWorkingDisableDirective,
|
|
1624
|
+
DbxActionSourceDirective,
|
|
1625
|
+
DbxActionHandlerDirective,
|
|
1626
|
+
DbxActionDisabledDirective,
|
|
1627
|
+
DbxActionEnforceModifiedDirective,
|
|
1628
|
+
DbxActionAutoTriggerDirective,
|
|
1629
|
+
dbxActionValueStreamDirective,
|
|
1630
|
+
DbxActionAutoModifyDirective,
|
|
1631
|
+
DbxActionValueDirective,
|
|
1632
|
+
DbxActionContextLoggerDirective,
|
|
1633
|
+
DbxActionHasSuccessDirective,
|
|
1634
|
+
DbxActionSuccessHandlerDirective,
|
|
1635
|
+
DbxActionIsWorkingDirective
|
|
1575
1636
|
]
|
|
1576
1637
|
}]
|
|
1577
1638
|
}] });
|
|
@@ -1583,6 +1644,39 @@ function makeDbxActionContextSourceReference(sourceInstance) {
|
|
|
1583
1644
|
};
|
|
1584
1645
|
}
|
|
1585
1646
|
|
|
1647
|
+
function isSegueRef(input) {
|
|
1648
|
+
return typeof input === 'object' && hasValueOrNotEmpty(input.ref);
|
|
1649
|
+
}
|
|
1650
|
+
function asSegueRef(input) {
|
|
1651
|
+
const type = typeof input;
|
|
1652
|
+
if (type === 'string') {
|
|
1653
|
+
return refStringToSegueRef(input);
|
|
1654
|
+
}
|
|
1655
|
+
else if (isSegueRef(input)) {
|
|
1656
|
+
return input;
|
|
1657
|
+
}
|
|
1658
|
+
else {
|
|
1659
|
+
return undefined;
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1662
|
+
function asSegueRefString(input) {
|
|
1663
|
+
if (typeof input === 'string') {
|
|
1664
|
+
return input;
|
|
1665
|
+
}
|
|
1666
|
+
else if (isSegueRef(input)) {
|
|
1667
|
+
return input.ref;
|
|
1668
|
+
}
|
|
1669
|
+
else {
|
|
1670
|
+
throw new Error(`asSegueRefString() failed to convert the input to a string: ${input}`);
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
function refStringToSegueRef(ref, options) {
|
|
1674
|
+
return { ...options, ref };
|
|
1675
|
+
}
|
|
1676
|
+
function mapRefStringObsToSegueRefObs(obs, options) {
|
|
1677
|
+
return obs.pipe(map((x) => refStringToSegueRef(x, options)));
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1586
1680
|
/**
|
|
1587
1681
|
* Client auth service used to retrieve info about the current state of client authentication and client roles they may have.
|
|
1588
1682
|
*/
|
|
@@ -1612,7 +1706,7 @@ function makeAuthTransitionHook(config) {
|
|
|
1612
1706
|
else {
|
|
1613
1707
|
resultObs = of(redirectTo);
|
|
1614
1708
|
}
|
|
1615
|
-
redirectToObs = resultObs.pipe(map
|
|
1709
|
+
redirectToObs = resultObs.pipe(map((stateRef) => {
|
|
1616
1710
|
let redirectTarget;
|
|
1617
1711
|
let redirectParams;
|
|
1618
1712
|
if (stateRef) {
|
|
@@ -1630,7 +1724,7 @@ function makeAuthTransitionHook(config) {
|
|
|
1630
1724
|
}
|
|
1631
1725
|
return redirectToObs;
|
|
1632
1726
|
}
|
|
1633
|
-
const resultObs = decisionObs.pipe(first
|
|
1727
|
+
const resultObs = decisionObs.pipe(first(), switchMap((decision) => {
|
|
1634
1728
|
if (typeof decision === 'boolean') {
|
|
1635
1729
|
if (decision) {
|
|
1636
1730
|
return of(true);
|
|
@@ -1640,7 +1734,7 @@ function makeAuthTransitionHook(config) {
|
|
|
1640
1734
|
}
|
|
1641
1735
|
}
|
|
1642
1736
|
else {
|
|
1643
|
-
return of($state.target(decision.ref, decision.refParams, decision.refOptions));
|
|
1737
|
+
return of($state.target(asSegueRefString(decision.ref), decision.refParams, decision.refOptions));
|
|
1644
1738
|
}
|
|
1645
1739
|
}), catchError((x) => {
|
|
1646
1740
|
console.warn('Encountered error in auth transition hook.', x);
|
|
@@ -1659,7 +1753,7 @@ function makeAuthTransitionHook(config) {
|
|
|
1659
1753
|
*/
|
|
1660
1754
|
function redirectBasedOnAuthUserState(stateMap) {
|
|
1661
1755
|
return (input) => {
|
|
1662
|
-
return input.authService.authUserState$.pipe(first
|
|
1756
|
+
return input.authService.authUserState$.pipe(first(), switchMap((authUserState) => {
|
|
1663
1757
|
const getter = stateMap[authUserState];
|
|
1664
1758
|
let result;
|
|
1665
1759
|
if (getter) {
|
|
@@ -1722,7 +1816,7 @@ function enableHasAuthRoleHook(transitionService, config) {
|
|
|
1722
1816
|
const data = targetState.state().data;
|
|
1723
1817
|
const requiredRoles = new Set(data.authRoles);
|
|
1724
1818
|
const setIncludes = setIncludesFunction(requiredRoles, data.authRolesMode);
|
|
1725
|
-
return authService.authUserState$.pipe(map
|
|
1819
|
+
return authService.authUserState$.pipe(map((x) => setIncludes(x)));
|
|
1726
1820
|
}
|
|
1727
1821
|
});
|
|
1728
1822
|
// Register the "requires auth" hook with the TransitionsService
|
|
@@ -1751,7 +1845,7 @@ function enableHasAuthStateHook(transitionService, config) {
|
|
|
1751
1845
|
const data = targetState.state().data;
|
|
1752
1846
|
const config = toHasAuthStateObjectConfig(data.authStates);
|
|
1753
1847
|
const parsed = toParsedHasAuthStateConfig(config);
|
|
1754
|
-
return authService.authUserState$.pipe(map
|
|
1848
|
+
return authService.authUserState$.pipe(map((x) => isAllowed(x, parsed)));
|
|
1755
1849
|
}
|
|
1756
1850
|
});
|
|
1757
1851
|
// Register the "requires auth" hook with the TransitionsService
|
|
@@ -1760,7 +1854,7 @@ function enableHasAuthStateHook(transitionService, config) {
|
|
|
1760
1854
|
// MARK: Utility
|
|
1761
1855
|
function toHasAuthStateObjectConfig(input) {
|
|
1762
1856
|
const isString = typeof input === 'string';
|
|
1763
|
-
if (
|
|
1857
|
+
if (Array.isArray(input) || isString) {
|
|
1764
1858
|
if (isString) {
|
|
1765
1859
|
input = [input];
|
|
1766
1860
|
}
|
|
@@ -1894,9 +1988,9 @@ class AbstractOnDbxAppContextStateEffects {
|
|
|
1894
1988
|
* @returns
|
|
1895
1989
|
*/
|
|
1896
1990
|
ngrxOnRunEffects(resolvedEffects$) {
|
|
1897
|
-
return this.actions$.pipe(ofType(setState), filter
|
|
1991
|
+
return this.actions$.pipe(ofType(setState), filter(({ state }) => {
|
|
1898
1992
|
return this._activeStatesSet.has(state);
|
|
1899
|
-
}), exhaustMap
|
|
1993
|
+
}), exhaustMap(() => resolvedEffects$.pipe(takeUntil(this.actions$.pipe(ofType(setState), filter(({ state }) => !this._activeStatesSet.has(state)))))));
|
|
1900
1994
|
}
|
|
1901
1995
|
}
|
|
1902
1996
|
|
|
@@ -1908,7 +2002,7 @@ const NO_AUTH_USER_IDENTIFIER = '0';
|
|
|
1908
2002
|
* @returns
|
|
1909
2003
|
*/
|
|
1910
2004
|
function authUserIdentifier(inputId) {
|
|
1911
|
-
return
|
|
2005
|
+
return inputId ? inputId : NO_AUTH_USER_IDENTIFIER;
|
|
1912
2006
|
}
|
|
1913
2007
|
|
|
1914
2008
|
/**
|
|
@@ -2054,33 +2148,13 @@ function anchorTypeForAnchor(anchor, disabled) {
|
|
|
2054
2148
|
}
|
|
2055
2149
|
class DbxAnchor {
|
|
2056
2150
|
}
|
|
2057
|
-
function
|
|
2058
|
-
return [
|
|
2151
|
+
function provideDbxAnchor(sourceType) {
|
|
2152
|
+
return [
|
|
2153
|
+
{
|
|
2059
2154
|
provide: DbxAnchor,
|
|
2060
2155
|
useExisting: forwardRef(() => sourceType)
|
|
2061
|
-
}
|
|
2062
|
-
|
|
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)));
|
|
2156
|
+
}
|
|
2157
|
+
];
|
|
2084
2158
|
}
|
|
2085
2159
|
|
|
2086
2160
|
/**
|
|
@@ -2121,7 +2195,7 @@ AbstractDbxAnchorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0
|
|
|
2121
2195
|
AbstractDbxAnchorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractDbxAnchorDirective, inputs: { ref: "ref", anchor: "anchor", disabled: "disabled" }, ngImport: i0 });
|
|
2122
2196
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxAnchorDirective, decorators: [{
|
|
2123
2197
|
type: Directive
|
|
2124
|
-
}],
|
|
2198
|
+
}], propDecorators: { ref: [{
|
|
2125
2199
|
type: Input
|
|
2126
2200
|
}], anchor: [{
|
|
2127
2201
|
type: Input
|
|
@@ -2149,7 +2223,7 @@ class DbxAngularRouterService {
|
|
|
2149
2223
|
this.router = router;
|
|
2150
2224
|
this.activatedRoute = activatedRoute;
|
|
2151
2225
|
this.params$ = this.activatedRoute.params;
|
|
2152
|
-
this.transitions$ = this.router.events.pipe(map((x) => {
|
|
2226
|
+
this.transitions$ = this.router.events.pipe(map$1((x) => {
|
|
2153
2227
|
let event;
|
|
2154
2228
|
if (x instanceof NavigationStart) {
|
|
2155
2229
|
event = {
|
|
@@ -2166,7 +2240,7 @@ class DbxAngularRouterService {
|
|
|
2166
2240
|
}
|
|
2167
2241
|
go(input) {
|
|
2168
2242
|
const segueRef = asSegueRef(input);
|
|
2169
|
-
|
|
2243
|
+
const ref = segueRef.ref;
|
|
2170
2244
|
if (isArray(ref)) {
|
|
2171
2245
|
return this.router.navigate(ref, {
|
|
2172
2246
|
...segueRef.refOptions,
|
|
@@ -2206,7 +2280,7 @@ class DbxRouterService {
|
|
|
2206
2280
|
*/
|
|
2207
2281
|
function goWithRouter(dbxRouterService) {
|
|
2208
2282
|
return (route) => {
|
|
2209
|
-
return firstValueFrom(asObservable(route)).then(x => dbxRouterService.go(x));
|
|
2283
|
+
return firstValueFrom(asObservable(route)).then((x) => dbxRouterService.go(x));
|
|
2210
2284
|
};
|
|
2211
2285
|
}
|
|
2212
2286
|
|
|
@@ -2242,43 +2316,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
2242
2316
|
args: [{}]
|
|
2243
2317
|
}] });
|
|
2244
2318
|
|
|
2245
|
-
/**
|
|
2246
|
-
* Used for creating a future state that also captures any children urls.
|
|
2247
|
-
*
|
|
2248
|
-
* This is important for cases, such as /, where multiple urls should target a specific future so that
|
|
2249
|
-
* it can load that module and continue route resolution for the child url.
|
|
2250
|
-
*
|
|
2251
|
-
* For example:
|
|
2252
|
-
* - the urls /a and /b are declared in a lazy loaded module that is for /. This presents a problem, since
|
|
2253
|
-
* the root module does not know how to handle /a or /b, since they are children of /. We use
|
|
2254
|
-
* futureStateWithChildrenUrls() to build a future state with the child urls so the parent routing knows where
|
|
2255
|
-
* to send /a or /b.
|
|
2256
|
-
*
|
|
2257
|
-
* @param state
|
|
2258
|
-
* @param urls
|
|
2259
|
-
* @returns
|
|
2260
|
-
*
|
|
2261
|
-
* @deprecated not how this feature works. Consider adding it to ui-router later then re-export this function.
|
|
2262
|
-
*/
|
|
2263
|
-
function futureStateWithChildrenUrls(state, urls) {
|
|
2264
|
-
const states = [state];
|
|
2265
|
-
mergeArrayIntoArray(states, expandFutureStateWithUrls(state, urls));
|
|
2266
|
-
return states;
|
|
2267
|
-
}
|
|
2268
|
-
/**
|
|
2269
|
-
* Copies the input state and replaces the url in each of them with the passed urls.
|
|
2270
|
-
*
|
|
2271
|
-
* @param state
|
|
2272
|
-
* @param urls
|
|
2273
|
-
* @returns
|
|
2274
|
-
*
|
|
2275
|
-
* @deprecated
|
|
2276
|
-
*/
|
|
2277
|
-
function expandFutureStateWithUrls(state, urls) {
|
|
2278
|
-
const childrenStates = objectFlatMergeMatrix(state, urls.map(url => ({ url })));
|
|
2279
|
-
return childrenStates;
|
|
2280
|
-
}
|
|
2281
|
-
|
|
2282
2319
|
/**
|
|
2283
2320
|
* UIRouter implementation of DbxRouterService and DbxRouterTransitionService.
|
|
2284
2321
|
*/
|
|
@@ -2313,21 +2350,25 @@ class DbxUIRouterService {
|
|
|
2313
2350
|
go(input) {
|
|
2314
2351
|
const segueRef = asSegueRef(input);
|
|
2315
2352
|
const params = { ...this.uiRouterGlobals.current.params, ...segueRef.refParams };
|
|
2316
|
-
return this.state
|
|
2353
|
+
return this.state
|
|
2354
|
+
.go(segueRef.ref, params, segueRef.refOptions)
|
|
2355
|
+
.then(() => true)
|
|
2356
|
+
.catch(() => false);
|
|
2317
2357
|
}
|
|
2318
2358
|
isActive(input) {
|
|
2319
2359
|
const segueRef = asSegueRef(input);
|
|
2320
|
-
const
|
|
2321
|
-
const
|
|
2360
|
+
const ref = segueRef.ref;
|
|
2361
|
+
const refParams = segueRef.refParams;
|
|
2362
|
+
const targetRef = ref.startsWith('.') ? `^${ref}` : ref;
|
|
2322
2363
|
const active = this.state.includes(targetRef, refParams);
|
|
2323
2364
|
return active;
|
|
2324
2365
|
}
|
|
2325
2366
|
comparePrecision(aInput, bInput) {
|
|
2326
|
-
const aRef =
|
|
2327
|
-
const bRef =
|
|
2367
|
+
const aRef = asSegueRefString(aInput);
|
|
2368
|
+
const bRef = asSegueRefString(bInput);
|
|
2328
2369
|
const aLength = aRef.length;
|
|
2329
2370
|
const bLength = bRef.length;
|
|
2330
|
-
return
|
|
2371
|
+
return aLength > bLength ? 1 : aLength === bLength ? 0 : -1;
|
|
2331
2372
|
}
|
|
2332
2373
|
}
|
|
2333
2374
|
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 });
|
|
@@ -2335,14 +2376,6 @@ DbxUIRouterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", v
|
|
|
2335
2376
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxUIRouterService, decorators: [{
|
|
2336
2377
|
type: Injectable
|
|
2337
2378
|
}], 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
|
-
}
|
|
2346
2379
|
|
|
2347
2380
|
class DbxCoreUIRouterSegueModule {
|
|
2348
2381
|
static forRoot() {
|
|
@@ -2383,7 +2416,7 @@ function filterTransitionSuccess() {
|
|
|
2383
2416
|
return filterTransitionEvent(DbxRouterTransitionEventType.SUCCESS);
|
|
2384
2417
|
}
|
|
2385
2418
|
function filterTransitionEvent(type) {
|
|
2386
|
-
return filter
|
|
2419
|
+
return filter((x) => x.type === type);
|
|
2387
2420
|
}
|
|
2388
2421
|
|
|
2389
2422
|
/**
|
|
@@ -2393,7 +2426,7 @@ class AbstractTransitionDirective {
|
|
|
2393
2426
|
constructor(dbxRouterTransitionService) {
|
|
2394
2427
|
this.dbxRouterTransitionService = dbxRouterTransitionService;
|
|
2395
2428
|
this.transitionSuccess$ = successTransition(this.dbxRouterTransitionService.transitions$);
|
|
2396
|
-
this.initAndUpdateOnTransitionSuccess$ = this.transitionSuccess$.pipe(startWith
|
|
2429
|
+
this.initAndUpdateOnTransitionSuccess$ = this.transitionSuccess$.pipe(startWith(undefined));
|
|
2397
2430
|
}
|
|
2398
2431
|
}
|
|
2399
2432
|
AbstractTransitionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractTransitionDirective, deps: [{ token: DbxRouterTransitionService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -2506,11 +2539,11 @@ class DbxAppAuthRouterEffects extends AbstractOnDbxAppContextStateEffects {
|
|
|
2506
2539
|
/**
|
|
2507
2540
|
* Effect to redirect to the login when logout occurs.
|
|
2508
2541
|
*/
|
|
2509
|
-
this.redirectToLoginOnLogout = createEffect(() => this.actions$.pipe(ofType(loggedOut), exhaustMap
|
|
2542
|
+
this.redirectToLoginOnLogout = createEffect(() => this.actions$.pipe(ofType(loggedOut), exhaustMap(() => this.dbxAppAuthRouterService.goToLogin())), { dispatch: false });
|
|
2510
2543
|
/**
|
|
2511
2544
|
* Effect to redirect to the app when login occurs.
|
|
2512
2545
|
*/
|
|
2513
|
-
this.redirectToOnboardOnLogIn = createEffect(() => this.actions$.pipe(ofType(loggedIn), exhaustMap
|
|
2546
|
+
this.redirectToOnboardOnLogIn = createEffect(() => this.actions$.pipe(ofType(loggedIn), exhaustMap(() => this.dbxAppAuthRouterService.goToApp())), { dispatch: false });
|
|
2514
2547
|
}
|
|
2515
2548
|
}
|
|
2516
2549
|
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 });
|
|
@@ -2528,24 +2561,22 @@ class DbxAppAuthRouterStateModule {
|
|
|
2528
2561
|
static forRoot(config) {
|
|
2529
2562
|
return {
|
|
2530
2563
|
ngModule: DbxAppAuthRouterStateModule,
|
|
2531
|
-
providers: [
|
|
2564
|
+
providers: [
|
|
2565
|
+
{
|
|
2532
2566
|
provide: DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN,
|
|
2533
2567
|
useValue: config.activeRoutesToApplyEffects
|
|
2534
|
-
}
|
|
2568
|
+
}
|
|
2569
|
+
]
|
|
2535
2570
|
};
|
|
2536
2571
|
}
|
|
2537
2572
|
}
|
|
2538
2573
|
DbxAppAuthRouterStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2539
2574
|
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
|
-
]] });
|
|
2575
|
+
DbxAppAuthRouterStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterStateModule, imports: [[EffectsModule.forFeature([DbxAppAuthRouterEffects])]] });
|
|
2543
2576
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterStateModule, decorators: [{
|
|
2544
2577
|
type: NgModule,
|
|
2545
2578
|
args: [{
|
|
2546
|
-
imports: [
|
|
2547
|
-
EffectsModule.forFeature([DbxAppAuthRouterEffects])
|
|
2548
|
-
],
|
|
2579
|
+
imports: [EffectsModule.forFeature([DbxAppAuthRouterEffects])],
|
|
2549
2580
|
declarations: [],
|
|
2550
2581
|
exports: []
|
|
2551
2582
|
}]
|
|
@@ -2555,10 +2586,12 @@ class DbxAppAuthRouterModule {
|
|
|
2555
2586
|
static forRoot(dbxAppAuthRoutes) {
|
|
2556
2587
|
return {
|
|
2557
2588
|
ngModule: DbxAppAuthRouterModule,
|
|
2558
|
-
providers: [
|
|
2589
|
+
providers: [
|
|
2590
|
+
{
|
|
2559
2591
|
provide: DbxAppAuthRoutes,
|
|
2560
2592
|
useValue: dbxAppAuthRoutes
|
|
2561
|
-
}
|
|
2593
|
+
}
|
|
2594
|
+
]
|
|
2562
2595
|
};
|
|
2563
2596
|
}
|
|
2564
2597
|
}
|
|
@@ -2581,7 +2614,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
2581
2614
|
* @returns
|
|
2582
2615
|
*/
|
|
2583
2616
|
function loggedInObsFromIsLoggedIn(isLoggedInObs) {
|
|
2584
|
-
return isLoggedInObs.pipe(onFalseToTrue(), map
|
|
2617
|
+
return isLoggedInObs.pipe(onFalseToTrue(), map(() => undefined));
|
|
2585
2618
|
}
|
|
2586
2619
|
/**
|
|
2587
2620
|
* Convenience operator that emits events when the input observable goes from true to false.
|
|
@@ -2590,7 +2623,7 @@ function loggedInObsFromIsLoggedIn(isLoggedInObs) {
|
|
|
2590
2623
|
* @returns
|
|
2591
2624
|
*/
|
|
2592
2625
|
function loggedOutObsFromIsLoggedIn(isLoggedInObs) {
|
|
2593
|
-
return isLoggedInObs.pipe(onTrueToFalse(), map
|
|
2626
|
+
return isLoggedInObs.pipe(onTrueToFalse(), map(() => undefined));
|
|
2594
2627
|
}
|
|
2595
2628
|
function authRolesSetContainsAllRolesFrom(roles) {
|
|
2596
2629
|
return setContainsAllValuesFrom(roles);
|
|
@@ -2662,22 +2695,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
2662
2695
|
class DbxCoreAuthModule {
|
|
2663
2696
|
}
|
|
2664
2697
|
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] });
|
|
2698
|
+
DbxCoreAuthModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreAuthModule, declarations: [DbxAuthHasRolesDirective, DbxAuthHasAnyRoleDirective], exports: [DbxAuthHasRolesDirective, DbxAuthHasAnyRoleDirective] });
|
|
2668
2699
|
DbxCoreAuthModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreAuthModule, imports: [[]] });
|
|
2669
2700
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreAuthModule, decorators: [{
|
|
2670
2701
|
type: NgModule,
|
|
2671
2702
|
args: [{
|
|
2672
2703
|
imports: [],
|
|
2673
|
-
declarations: [
|
|
2674
|
-
|
|
2675
|
-
DbxAuthHasAnyRoleDirective
|
|
2676
|
-
],
|
|
2677
|
-
exports: [
|
|
2678
|
-
DbxAuthHasRolesDirective,
|
|
2679
|
-
DbxAuthHasAnyRoleDirective
|
|
2680
|
-
]
|
|
2704
|
+
declarations: [DbxAuthHasRolesDirective, DbxAuthHasAnyRoleDirective],
|
|
2705
|
+
exports: [DbxAuthHasRolesDirective, DbxAuthHasAnyRoleDirective]
|
|
2681
2706
|
}]
|
|
2682
2707
|
}] });
|
|
2683
2708
|
|
|
@@ -2690,23 +2715,17 @@ class DbxAppAuthEffects {
|
|
|
2690
2715
|
this.store = store;
|
|
2691
2716
|
this.dbxAuthService = dbxAuthService;
|
|
2692
2717
|
// MARK: Auth
|
|
2693
|
-
this.emitLoggedIn = createEffect(() => this.dbxAuthService.onLogIn
|
|
2694
|
-
|
|
2695
|
-
this.
|
|
2696
|
-
.pipe(map$1(() => loggedOut())));
|
|
2697
|
-
this.forwardLogoutToAuthService = createEffect(() => this.actions$.pipe(ofType(logout), tap$1(() => {
|
|
2718
|
+
this.emitLoggedIn = createEffect(() => this.dbxAuthService.onLogIn$.pipe(map(() => loggedIn())));
|
|
2719
|
+
this.emitLoggedOut = createEffect(() => this.dbxAuthService.onLogOut$.pipe(map(() => loggedOut())));
|
|
2720
|
+
this.forwardLogoutToAuthService = createEffect(() => this.actions$.pipe(ofType(logout), tap(() => {
|
|
2698
2721
|
// Perform the logout
|
|
2699
2722
|
this.dbxAuthService.logOut();
|
|
2700
2723
|
})), { dispatch: false });
|
|
2701
2724
|
// MARK: Auth
|
|
2702
|
-
this.setUserIdentifier = createEffect(() => this.dbxAuthService.userIdentifier
|
|
2703
|
-
|
|
2704
|
-
this.
|
|
2705
|
-
|
|
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 }))));
|
|
2725
|
+
this.setUserIdentifier = createEffect(() => this.dbxAuthService.userIdentifier$.pipe(map((id) => setUserIdentifier({ id }))));
|
|
2726
|
+
this.setUserState = createEffect(() => this.dbxAuthService.authUserState$.pipe(map((state) => setUserState({ state }))));
|
|
2727
|
+
this.setUserRoles = createEffect(() => this.dbxAuthService.authRoles$.pipe(map((roles) => setUserRoles({ roles: Array.from(roles ?? []) }))));
|
|
2728
|
+
this.setUserIsOnboarded = createEffect(() => this.dbxAuthService.isOnboarded$.pipe(map((isOnboarded) => setUserIsOnboarded({ isOnboarded }))));
|
|
2710
2729
|
}
|
|
2711
2730
|
}
|
|
2712
2731
|
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 });
|
|
@@ -2719,17 +2738,11 @@ class DbxAppAuthStateModule {
|
|
|
2719
2738
|
}
|
|
2720
2739
|
DbxAppAuthStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2721
2740
|
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
|
-
]] });
|
|
2741
|
+
DbxAppAuthStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthStateModule, imports: [[StoreModule.forFeature(featureKey, reducers), EffectsModule.forFeature([DbxAppAuthEffects])]] });
|
|
2726
2742
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthStateModule, decorators: [{
|
|
2727
2743
|
type: NgModule,
|
|
2728
2744
|
args: [{
|
|
2729
|
-
imports: [
|
|
2730
|
-
StoreModule.forFeature(featureKey, reducers),
|
|
2731
|
-
EffectsModule.forFeature([DbxAppAuthEffects])
|
|
2732
|
-
],
|
|
2745
|
+
imports: [StoreModule.forFeature(featureKey, reducers), EffectsModule.forFeature([DbxAppAuthEffects])],
|
|
2733
2746
|
declarations: [],
|
|
2734
2747
|
exports: []
|
|
2735
2748
|
}]
|
|
@@ -2761,7 +2774,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
2761
2774
|
* @returns
|
|
2762
2775
|
*/
|
|
2763
2776
|
function tapDetectChanges(cdRef, timeout = 0) {
|
|
2764
|
-
return tap
|
|
2777
|
+
return tap(() => setTimeout(() => safeDetectChanges(cdRef), timeout));
|
|
2765
2778
|
}
|
|
2766
2779
|
/**
|
|
2767
2780
|
* Triggers a detection change on the input view as long as the view has not been destroyed.
|
|
@@ -2786,7 +2799,7 @@ function safeMarkForCheck(cdRef) {
|
|
|
2786
2799
|
*/
|
|
2787
2800
|
function safeUseCdRef(cdRef, use) {
|
|
2788
2801
|
if (!cdRef.destroyed) {
|
|
2789
|
-
cdRef
|
|
2802
|
+
use(cdRef);
|
|
2790
2803
|
}
|
|
2791
2804
|
}
|
|
2792
2805
|
/**
|
|
@@ -2815,11 +2828,13 @@ function checkNgContentWrapperHasContent(ref) {
|
|
|
2815
2828
|
|
|
2816
2829
|
class DbxButton {
|
|
2817
2830
|
}
|
|
2818
|
-
function
|
|
2819
|
-
return [
|
|
2831
|
+
function provideDbxButton(sourceType) {
|
|
2832
|
+
return [
|
|
2833
|
+
{
|
|
2820
2834
|
provide: DbxButton,
|
|
2821
2835
|
useExisting: forwardRef(() => sourceType)
|
|
2822
|
-
}
|
|
2836
|
+
}
|
|
2837
|
+
];
|
|
2823
2838
|
}
|
|
2824
2839
|
|
|
2825
2840
|
/**
|
|
@@ -2905,9 +2920,11 @@ class DbxButtonSegueDirective extends AbstractSubscriptionDirective {
|
|
|
2905
2920
|
this._segueRef.next(segueRef);
|
|
2906
2921
|
}
|
|
2907
2922
|
ngOnInit() {
|
|
2908
|
-
this.sub = this.segueRef
|
|
2923
|
+
this.sub = this.segueRef$
|
|
2924
|
+
.pipe(switchMap((segueRef) => this.dbxButton.clicked$.pipe(tap(() => {
|
|
2909
2925
|
this.dbxRouterService.go(segueRef);
|
|
2910
|
-
}))))
|
|
2926
|
+
}))))
|
|
2927
|
+
.subscribe();
|
|
2911
2928
|
}
|
|
2912
2929
|
ngOnDestroy() {
|
|
2913
2930
|
super.ngOnDestroy();
|
|
@@ -2957,7 +2974,8 @@ class AbstractDbxButtonDirective extends AbstractSubscriptionDirective {
|
|
|
2957
2974
|
this._working.next(working);
|
|
2958
2975
|
}
|
|
2959
2976
|
ngOnInit() {
|
|
2960
|
-
this.sub = this._buttonClick
|
|
2977
|
+
this.sub = this._buttonClick
|
|
2978
|
+
.pipe(switchMap(() => this._buttonInterceptor.pipe(switchMap((x) => {
|
|
2961
2979
|
if (x) {
|
|
2962
2980
|
return x.interceptButtonClick().pipe(first());
|
|
2963
2981
|
}
|
|
@@ -2965,7 +2983,8 @@ class AbstractDbxButtonDirective extends AbstractSubscriptionDirective {
|
|
|
2965
2983
|
return of(true);
|
|
2966
2984
|
}
|
|
2967
2985
|
}), filter((x) => Boolean(x)) // Ignore false values.
|
|
2968
|
-
)))
|
|
2986
|
+
)))
|
|
2987
|
+
.subscribe(() => {
|
|
2969
2988
|
this._forceButtonClicked();
|
|
2970
2989
|
});
|
|
2971
2990
|
}
|
|
@@ -3019,13 +3038,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
3019
3038
|
class DbxButtonDirective extends AbstractDbxButtonDirective {
|
|
3020
3039
|
}
|
|
3021
3040
|
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:
|
|
3041
|
+
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
3042
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxButtonDirective, decorators: [{
|
|
3024
3043
|
type: Directive,
|
|
3025
3044
|
args: [{
|
|
3026
3045
|
selector: '[dbxButton]',
|
|
3027
3046
|
exportAs: 'dbxButton',
|
|
3028
|
-
providers:
|
|
3047
|
+
providers: provideDbxButton(DbxButtonDirective)
|
|
3029
3048
|
}]
|
|
3030
3049
|
}] });
|
|
3031
3050
|
|
|
@@ -3047,7 +3066,7 @@ class DbxLoadingButtonDirective extends AbstractSubscriptionDirective {
|
|
|
3047
3066
|
let subscription;
|
|
3048
3067
|
if (context) {
|
|
3049
3068
|
subscription = context.stream$.subscribe((x) => {
|
|
3050
|
-
this.ngZone.run(() => this.button.working = x.loading);
|
|
3069
|
+
this.ngZone.run(() => (this.button.working = x.loading));
|
|
3051
3070
|
});
|
|
3052
3071
|
}
|
|
3053
3072
|
this.sub = subscription;
|
|
@@ -3070,34 +3089,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
3070
3089
|
class DbxCoreButtonModule {
|
|
3071
3090
|
}
|
|
3072
3091
|
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,
|
|
3074
|
-
DbxLoadingButtonDirective,
|
|
3075
|
-
DbxActionButtonTriggerDirective,
|
|
3076
|
-
DbxActionButtonDirective,
|
|
3077
|
-
DbxButtonSegueDirective], exports: [DbxButtonDirective,
|
|
3078
|
-
DbxLoadingButtonDirective,
|
|
3079
|
-
DbxActionButtonTriggerDirective,
|
|
3080
|
-
DbxActionButtonDirective,
|
|
3081
|
-
DbxButtonSegueDirective] });
|
|
3092
|
+
DbxCoreButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreButtonModule, declarations: [DbxButtonDirective, DbxLoadingButtonDirective, DbxActionButtonTriggerDirective, DbxActionButtonDirective, DbxButtonSegueDirective], exports: [DbxButtonDirective, DbxLoadingButtonDirective, DbxActionButtonTriggerDirective, DbxActionButtonDirective, DbxButtonSegueDirective] });
|
|
3082
3093
|
DbxCoreButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreButtonModule, imports: [[]] });
|
|
3083
3094
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreButtonModule, decorators: [{
|
|
3084
3095
|
type: NgModule,
|
|
3085
3096
|
args: [{
|
|
3086
3097
|
imports: [],
|
|
3087
|
-
declarations: [
|
|
3088
|
-
|
|
3089
|
-
DbxLoadingButtonDirective,
|
|
3090
|
-
DbxActionButtonTriggerDirective,
|
|
3091
|
-
DbxActionButtonDirective,
|
|
3092
|
-
DbxButtonSegueDirective
|
|
3093
|
-
],
|
|
3094
|
-
exports: [
|
|
3095
|
-
DbxButtonDirective,
|
|
3096
|
-
DbxLoadingButtonDirective,
|
|
3097
|
-
DbxActionButtonTriggerDirective,
|
|
3098
|
-
DbxActionButtonDirective,
|
|
3099
|
-
DbxButtonSegueDirective
|
|
3100
|
-
],
|
|
3098
|
+
declarations: [DbxButtonDirective, DbxLoadingButtonDirective, DbxActionButtonTriggerDirective, DbxActionButtonDirective, DbxButtonSegueDirective],
|
|
3099
|
+
exports: [DbxButtonDirective, DbxLoadingButtonDirective, DbxActionButtonTriggerDirective, DbxActionButtonDirective, DbxButtonSegueDirective]
|
|
3101
3100
|
}]
|
|
3102
3101
|
}] });
|
|
3103
3102
|
|
|
@@ -3163,21 +3162,13 @@ class DbxAppContextStateModule {
|
|
|
3163
3162
|
}
|
|
3164
3163
|
DbxAppContextStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppContextStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3165
3164
|
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
|
-
]] });
|
|
3165
|
+
DbxAppContextStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppContextStateModule, imports: [[StoreModule.forFeature(featureKey$1, reducers$1)]] });
|
|
3169
3166
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppContextStateModule, decorators: [{
|
|
3170
3167
|
type: NgModule,
|
|
3171
3168
|
args: [{
|
|
3172
|
-
imports: [
|
|
3173
|
-
|
|
3174
|
-
]
|
|
3175
|
-
declarations: [
|
|
3176
|
-
DbxAppContextStateDirective
|
|
3177
|
-
],
|
|
3178
|
-
exports: [
|
|
3179
|
-
DbxAppContextStateDirective
|
|
3180
|
-
]
|
|
3169
|
+
imports: [StoreModule.forFeature(featureKey$1, reducers$1)],
|
|
3170
|
+
declarations: [DbxAppContextStateDirective],
|
|
3171
|
+
exports: [DbxAppContextStateDirective]
|
|
3181
3172
|
}]
|
|
3182
3173
|
}] });
|
|
3183
3174
|
|
|
@@ -3188,9 +3179,6 @@ class DateFromToTimePipe {
|
|
|
3188
3179
|
constructor(locale) {
|
|
3189
3180
|
this.locale = locale;
|
|
3190
3181
|
}
|
|
3191
|
-
transform(input, format, minutes) {
|
|
3192
|
-
return DateFromToTimePipe.formatFromTo(input, format, minutes, this.locale);
|
|
3193
|
-
}
|
|
3194
3182
|
static formatFromTo(input, format, minutes, locale) {
|
|
3195
3183
|
if (input) {
|
|
3196
3184
|
const date = toJsDate(input);
|
|
@@ -3200,6 +3188,9 @@ class DateFromToTimePipe {
|
|
|
3200
3188
|
}
|
|
3201
3189
|
return undefined;
|
|
3202
3190
|
}
|
|
3191
|
+
transform(input, format, minutes) {
|
|
3192
|
+
return DateFromToTimePipe.formatFromTo(input, format, minutes, this.locale);
|
|
3193
|
+
}
|
|
3203
3194
|
}
|
|
3204
3195
|
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
3196
|
DateFromToTimePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DateFromToTimePipe, name: "dateFromPlusTo" });
|
|
@@ -3218,12 +3209,12 @@ class MinutesStringPipe {
|
|
|
3218
3209
|
if (minutes > 3600) {
|
|
3219
3210
|
const unrounded = minutes / 3600;
|
|
3220
3211
|
const days = Math.ceil(unrounded);
|
|
3221
|
-
return (
|
|
3212
|
+
return (unrounded !== days ? '~' : '') + days + ' days';
|
|
3222
3213
|
}
|
|
3223
3214
|
else if (minutes > 180) {
|
|
3224
3215
|
const unrounded = minutes / 60;
|
|
3225
3216
|
const hours = Math.ceil(unrounded);
|
|
3226
|
-
return (
|
|
3217
|
+
return (unrounded !== hours ? '~' : '') + hours + ' hours';
|
|
3227
3218
|
}
|
|
3228
3219
|
else {
|
|
3229
3220
|
return minutes + ' minutes';
|
|
@@ -3356,18 +3347,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
3356
3347
|
}] }]; } });
|
|
3357
3348
|
|
|
3358
3349
|
class DateDistancePipe {
|
|
3359
|
-
transform(input,
|
|
3350
|
+
transform(input, inputTo, unavailable = 'Not Available') {
|
|
3360
3351
|
if (input) {
|
|
3361
|
-
const
|
|
3362
|
-
if (useDefaultTo) {
|
|
3363
|
-
to = new Date();
|
|
3364
|
-
}
|
|
3352
|
+
const to = inputTo ?? new Date();
|
|
3365
3353
|
const from = ToJsDatePipe.toJsDate(input);
|
|
3366
3354
|
const fromStart = startOfDay(from);
|
|
3367
3355
|
const toStart = startOfDay(to);
|
|
3368
3356
|
if (isSameDay(fromStart, toStart)) {
|
|
3369
3357
|
let text;
|
|
3370
|
-
if (
|
|
3358
|
+
if (!inputTo || isSameDay(from, new Date())) {
|
|
3371
3359
|
text = 'Today';
|
|
3372
3360
|
}
|
|
3373
3361
|
else {
|
|
@@ -3396,45 +3384,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
3396
3384
|
class DbxDatePipeModule {
|
|
3397
3385
|
}
|
|
3398
3386
|
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,
|
|
3400
|
-
DateFormatDistancePipe,
|
|
3401
|
-
MinutesStringPipe,
|
|
3402
|
-
TimeDistanceCountdownPipe,
|
|
3403
|
-
TimeDistancePipe,
|
|
3404
|
-
DateDistancePipe,
|
|
3405
|
-
ToJsDatePipe,
|
|
3406
|
-
ToMinutesPipe], exports: [DateFromToTimePipe,
|
|
3407
|
-
DateFormatDistancePipe,
|
|
3408
|
-
MinutesStringPipe,
|
|
3409
|
-
TimeDistanceCountdownPipe,
|
|
3410
|
-
TimeDistancePipe,
|
|
3411
|
-
DateDistancePipe,
|
|
3412
|
-
ToJsDatePipe,
|
|
3413
|
-
ToMinutesPipe] });
|
|
3387
|
+
DbxDatePipeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxDatePipeModule, declarations: [DateFromToTimePipe, DateFormatDistancePipe, MinutesStringPipe, TimeDistanceCountdownPipe, TimeDistancePipe, DateDistancePipe, ToJsDatePipe, ToMinutesPipe], exports: [DateFromToTimePipe, DateFormatDistancePipe, MinutesStringPipe, TimeDistanceCountdownPipe, TimeDistancePipe, DateDistancePipe, ToJsDatePipe, ToMinutesPipe] });
|
|
3414
3388
|
DbxDatePipeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxDatePipeModule });
|
|
3415
3389
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxDatePipeModule, decorators: [{
|
|
3416
3390
|
type: NgModule,
|
|
3417
3391
|
args: [{
|
|
3418
|
-
exports: [
|
|
3419
|
-
|
|
3420
|
-
DateFormatDistancePipe,
|
|
3421
|
-
MinutesStringPipe,
|
|
3422
|
-
TimeDistanceCountdownPipe,
|
|
3423
|
-
TimeDistancePipe,
|
|
3424
|
-
DateDistancePipe,
|
|
3425
|
-
ToJsDatePipe,
|
|
3426
|
-
ToMinutesPipe
|
|
3427
|
-
],
|
|
3428
|
-
declarations: [
|
|
3429
|
-
DateFromToTimePipe,
|
|
3430
|
-
DateFormatDistancePipe,
|
|
3431
|
-
MinutesStringPipe,
|
|
3432
|
-
TimeDistanceCountdownPipe,
|
|
3433
|
-
TimeDistancePipe,
|
|
3434
|
-
DateDistancePipe,
|
|
3435
|
-
ToJsDatePipe,
|
|
3436
|
-
ToMinutesPipe
|
|
3437
|
-
]
|
|
3392
|
+
exports: [DateFromToTimePipe, DateFormatDistancePipe, MinutesStringPipe, TimeDistanceCountdownPipe, TimeDistancePipe, DateDistancePipe, ToJsDatePipe, ToMinutesPipe],
|
|
3393
|
+
declarations: [DateFromToTimePipe, DateFormatDistancePipe, MinutesStringPipe, TimeDistanceCountdownPipe, TimeDistancePipe, DateDistancePipe, ToJsDatePipe, ToMinutesPipe]
|
|
3438
3394
|
}]
|
|
3439
3395
|
}] });
|
|
3440
3396
|
|
|
@@ -3471,29 +3427,20 @@ DbxMiscPipeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", versi
|
|
|
3471
3427
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxMiscPipeModule, decorators: [{
|
|
3472
3428
|
type: NgModule,
|
|
3473
3429
|
args: [{
|
|
3474
|
-
exports: [
|
|
3475
|
-
|
|
3476
|
-
],
|
|
3477
|
-
declarations: [
|
|
3478
|
-
PrettyJsonPipe
|
|
3479
|
-
]
|
|
3430
|
+
exports: [PrettyJsonPipe],
|
|
3431
|
+
declarations: [PrettyJsonPipe]
|
|
3480
3432
|
}]
|
|
3481
3433
|
}] });
|
|
3482
3434
|
|
|
3483
3435
|
class DbxPipesModule {
|
|
3484
3436
|
}
|
|
3485
3437
|
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
|
-
|
|
3488
|
-
DbxPipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxPipesModule, imports: [DbxMiscPipeModule,
|
|
3489
|
-
DbxDatePipeModule] });
|
|
3438
|
+
DbxPipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxPipesModule, exports: [DbxMiscPipeModule, DbxDatePipeModule] });
|
|
3439
|
+
DbxPipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxPipesModule, imports: [DbxMiscPipeModule, DbxDatePipeModule] });
|
|
3490
3440
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxPipesModule, decorators: [{
|
|
3491
3441
|
type: NgModule,
|
|
3492
3442
|
args: [{
|
|
3493
|
-
exports: [
|
|
3494
|
-
DbxMiscPipeModule,
|
|
3495
|
-
DbxDatePipeModule,
|
|
3496
|
-
]
|
|
3443
|
+
exports: [DbxMiscPipeModule, DbxDatePipeModule]
|
|
3497
3444
|
}]
|
|
3498
3445
|
}] });
|
|
3499
3446
|
|
|
@@ -3565,7 +3512,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
3565
3512
|
class AbstractFilterSourceConnectorDirective {
|
|
3566
3513
|
constructor() {
|
|
3567
3514
|
this._source = new BehaviorSubject(undefined);
|
|
3568
|
-
this.filter$ = this._source.pipe(switchMap
|
|
3515
|
+
this.filter$ = this._source.pipe(switchMap((x) => x?.filter$ ?? of(undefined)), filterMaybe(), shareReplay(1));
|
|
3569
3516
|
}
|
|
3570
3517
|
ngOnDestroy() {
|
|
3571
3518
|
this._source.complete();
|
|
@@ -3583,23 +3530,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
3583
3530
|
/**
|
|
3584
3531
|
* Angular provider convenience function for a FilterSource.
|
|
3585
3532
|
*/
|
|
3586
|
-
function
|
|
3587
|
-
return [
|
|
3533
|
+
function provideFilterSource(sourceType) {
|
|
3534
|
+
return [
|
|
3535
|
+
{
|
|
3588
3536
|
provide: FilterSource,
|
|
3589
3537
|
useExisting: forwardRef(() => sourceType)
|
|
3590
|
-
}
|
|
3538
|
+
}
|
|
3539
|
+
];
|
|
3591
3540
|
}
|
|
3592
3541
|
/**
|
|
3593
3542
|
* Angular provider convenience function for a FilterSourceConnector.
|
|
3594
3543
|
*/
|
|
3595
|
-
function
|
|
3596
|
-
return [
|
|
3544
|
+
function provideFilterSourceConnector(sourceType) {
|
|
3545
|
+
return [
|
|
3546
|
+
{
|
|
3597
3547
|
provide: FilterSourceConnector,
|
|
3598
3548
|
useExisting: forwardRef(() => sourceType)
|
|
3599
|
-
},
|
|
3549
|
+
},
|
|
3550
|
+
{
|
|
3600
3551
|
provide: FilterSource,
|
|
3601
3552
|
useExisting: forwardRef(() => sourceType)
|
|
3602
|
-
}
|
|
3553
|
+
}
|
|
3554
|
+
];
|
|
3603
3555
|
}
|
|
3604
3556
|
|
|
3605
3557
|
/**
|
|
@@ -3608,18 +3560,12 @@ function ProvideFilterSourceConnector(sourceType) {
|
|
|
3608
3560
|
class DbxFilterSourceConnectorDirective extends AbstractFilterSourceConnectorDirective {
|
|
3609
3561
|
}
|
|
3610
3562
|
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: [
|
|
3612
|
-
...ProvideFilterSource(DbxFilterSourceConnectorDirective),
|
|
3613
|
-
...ProvideFilterSourceConnector(DbxFilterSourceConnectorDirective)
|
|
3614
|
-
], usesInheritance: true, ngImport: i0 });
|
|
3563
|
+
DbxFilterSourceConnectorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFilterSourceConnectorDirective, selector: "[dbxFilterSourceConnector]", providers: [...provideFilterSource(DbxFilterSourceConnectorDirective), ...provideFilterSourceConnector(DbxFilterSourceConnectorDirective)], usesInheritance: true, ngImport: i0 });
|
|
3615
3564
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFilterSourceConnectorDirective, decorators: [{
|
|
3616
3565
|
type: Directive,
|
|
3617
3566
|
args: [{
|
|
3618
3567
|
selector: '[dbxFilterSourceConnector]',
|
|
3619
|
-
providers: [
|
|
3620
|
-
...ProvideFilterSource(DbxFilterSourceConnectorDirective),
|
|
3621
|
-
...ProvideFilterSourceConnector(DbxFilterSourceConnectorDirective)
|
|
3622
|
-
]
|
|
3568
|
+
providers: [...provideFilterSource(DbxFilterSourceConnectorDirective), ...provideFilterSourceConnector(DbxFilterSourceConnectorDirective)]
|
|
3623
3569
|
}]
|
|
3624
3570
|
}] });
|
|
3625
3571
|
|
|
@@ -3649,7 +3595,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
3649
3595
|
class DbxFilterMapSourceDirective extends AbstractDbxFilterMapInstanceDirective {
|
|
3650
3596
|
constructor() {
|
|
3651
3597
|
super(...arguments);
|
|
3652
|
-
this.filter$ = this.instance$.pipe(switchMap
|
|
3598
|
+
this.filter$ = this.instance$.pipe(switchMap((x) => x.filter$));
|
|
3653
3599
|
}
|
|
3654
3600
|
get key() {
|
|
3655
3601
|
return this._key.value;
|
|
@@ -3658,21 +3604,17 @@ class DbxFilterMapSourceDirective extends AbstractDbxFilterMapInstanceDirective
|
|
|
3658
3604
|
this._key.next(key);
|
|
3659
3605
|
}
|
|
3660
3606
|
initWithFilter(filterObs) {
|
|
3661
|
-
this.instance$.pipe(first
|
|
3607
|
+
this.instance$.pipe(first()).subscribe((x) => x.initWithFilter(filterObs));
|
|
3662
3608
|
}
|
|
3663
3609
|
}
|
|
3664
3610
|
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: [
|
|
3666
|
-
...ProvideFilterSource(DbxFilterMapSourceDirective)
|
|
3667
|
-
], exportAs: ["dbxFilterMapSource"], usesInheritance: true, ngImport: i0 });
|
|
3611
|
+
DbxFilterMapSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFilterMapSourceDirective, selector: "[dbxFilterMapSource]", inputs: { key: ["dbxFilterMapSource", "key"] }, providers: [...provideFilterSource(DbxFilterMapSourceDirective)], exportAs: ["dbxFilterMapSource"], usesInheritance: true, ngImport: i0 });
|
|
3668
3612
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFilterMapSourceDirective, decorators: [{
|
|
3669
3613
|
type: Directive,
|
|
3670
3614
|
args: [{
|
|
3671
3615
|
selector: '[dbxFilterMapSource]',
|
|
3672
3616
|
exportAs: 'dbxFilterMapSource',
|
|
3673
|
-
providers: [
|
|
3674
|
-
...ProvideFilterSource(DbxFilterMapSourceDirective)
|
|
3675
|
-
]
|
|
3617
|
+
providers: [...provideFilterSource(DbxFilterMapSourceDirective)]
|
|
3676
3618
|
}]
|
|
3677
3619
|
}], propDecorators: { key: [{
|
|
3678
3620
|
type: Input,
|
|
@@ -3691,23 +3633,17 @@ class DbxFilterMapSourceConnectorDirective extends DbxFilterMapSourceDirective {
|
|
|
3691
3633
|
}
|
|
3692
3634
|
// MARK: FilterSourceConnector
|
|
3693
3635
|
connectWithSource(filterSource) {
|
|
3694
|
-
this.instance$.pipe(first
|
|
3636
|
+
this.instance$.pipe(first()).subscribe((x) => x.connectWithSource(filterSource));
|
|
3695
3637
|
}
|
|
3696
3638
|
}
|
|
3697
3639
|
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: [
|
|
3699
|
-
...ProvideFilterSource(DbxFilterMapSourceConnectorDirective),
|
|
3700
|
-
...ProvideFilterSourceConnector(DbxFilterMapSourceConnectorDirective)
|
|
3701
|
-
], exportAs: ["dbxFilterMapSourceConnector"], usesInheritance: true, ngImport: i0 });
|
|
3640
|
+
DbxFilterMapSourceConnectorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFilterMapSourceConnectorDirective, selector: "[dbxFilterMapSourceConnector]", inputs: { key: ["dbxFilterMapSourceConnector", "key"] }, providers: [...provideFilterSource(DbxFilterMapSourceConnectorDirective), ...provideFilterSourceConnector(DbxFilterMapSourceConnectorDirective)], exportAs: ["dbxFilterMapSourceConnector"], usesInheritance: true, ngImport: i0 });
|
|
3702
3641
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFilterMapSourceConnectorDirective, decorators: [{
|
|
3703
3642
|
type: Directive,
|
|
3704
3643
|
args: [{
|
|
3705
3644
|
selector: '[dbxFilterMapSourceConnector]',
|
|
3706
3645
|
exportAs: 'dbxFilterMapSourceConnector',
|
|
3707
|
-
providers: [
|
|
3708
|
-
...ProvideFilterSource(DbxFilterMapSourceConnectorDirective),
|
|
3709
|
-
...ProvideFilterSourceConnector(DbxFilterMapSourceConnectorDirective)
|
|
3710
|
-
]
|
|
3646
|
+
providers: [...provideFilterSource(DbxFilterMapSourceConnectorDirective), ...provideFilterSourceConnector(DbxFilterMapSourceConnectorDirective)]
|
|
3711
3647
|
}]
|
|
3712
3648
|
}], propDecorators: { key: [{
|
|
3713
3649
|
type: Input,
|
|
@@ -3742,50 +3678,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
3742
3678
|
class DbxFilterSourceDirective extends AbstractFilterSourceDirective {
|
|
3743
3679
|
}
|
|
3744
3680
|
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:
|
|
3681
|
+
DbxFilterSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFilterSourceDirective, selector: "[dbxFilterSource]", providers: provideFilterSource(DbxFilterSourceDirective), usesInheritance: true, ngImport: i0 });
|
|
3746
3682
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFilterSourceDirective, decorators: [{
|
|
3747
3683
|
type: Directive,
|
|
3748
3684
|
args: [{
|
|
3749
3685
|
selector: '[dbxFilterSource]',
|
|
3750
|
-
providers:
|
|
3686
|
+
providers: provideFilterSource(DbxFilterSourceDirective)
|
|
3751
3687
|
}]
|
|
3752
3688
|
}] });
|
|
3753
3689
|
|
|
3754
3690
|
class DbxCoreFilterModule {
|
|
3755
3691
|
}
|
|
3756
3692
|
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,
|
|
3758
|
-
|
|
3759
|
-
DbxFilterMapDirective,
|
|
3760
|
-
DbxFilterMapSourceConnectorDirective,
|
|
3761
|
-
DbxFilterMapSourceDirective], imports: [CommonModule], exports: [DbxFilterSourceDirective,
|
|
3762
|
-
DbxFilterSourceConnectorDirective,
|
|
3763
|
-
DbxFilterMapDirective,
|
|
3764
|
-
DbxFilterMapSourceConnectorDirective,
|
|
3765
|
-
DbxFilterMapSourceDirective] });
|
|
3766
|
-
DbxCoreFilterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreFilterModule, imports: [[
|
|
3767
|
-
CommonModule
|
|
3768
|
-
]] });
|
|
3693
|
+
DbxCoreFilterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreFilterModule, declarations: [DbxFilterSourceDirective, DbxFilterSourceConnectorDirective, DbxFilterMapDirective, DbxFilterMapSourceConnectorDirective, DbxFilterMapSourceDirective], imports: [CommonModule], exports: [DbxFilterSourceDirective, DbxFilterSourceConnectorDirective, DbxFilterMapDirective, DbxFilterMapSourceConnectorDirective, DbxFilterMapSourceDirective] });
|
|
3694
|
+
DbxCoreFilterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreFilterModule, imports: [[CommonModule]] });
|
|
3769
3695
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreFilterModule, decorators: [{
|
|
3770
3696
|
type: NgModule,
|
|
3771
3697
|
args: [{
|
|
3772
|
-
imports: [
|
|
3773
|
-
|
|
3774
|
-
]
|
|
3775
|
-
declarations: [
|
|
3776
|
-
DbxFilterSourceDirective,
|
|
3777
|
-
DbxFilterSourceConnectorDirective,
|
|
3778
|
-
DbxFilterMapDirective,
|
|
3779
|
-
DbxFilterMapSourceConnectorDirective,
|
|
3780
|
-
DbxFilterMapSourceDirective,
|
|
3781
|
-
],
|
|
3782
|
-
exports: [
|
|
3783
|
-
DbxFilterSourceDirective,
|
|
3784
|
-
DbxFilterSourceConnectorDirective,
|
|
3785
|
-
DbxFilterMapDirective,
|
|
3786
|
-
DbxFilterMapSourceConnectorDirective,
|
|
3787
|
-
DbxFilterMapSourceDirective,
|
|
3788
|
-
]
|
|
3698
|
+
imports: [CommonModule],
|
|
3699
|
+
declarations: [DbxFilterSourceDirective, DbxFilterSourceConnectorDirective, DbxFilterMapDirective, DbxFilterMapSourceConnectorDirective, DbxFilterMapSourceDirective],
|
|
3700
|
+
exports: [DbxFilterSourceDirective, DbxFilterSourceConnectorDirective, DbxFilterMapDirective, DbxFilterMapSourceConnectorDirective, DbxFilterMapSourceDirective]
|
|
3789
3701
|
}]
|
|
3790
3702
|
}] });
|
|
3791
3703
|
|
|
@@ -3797,7 +3709,7 @@ const DBX_INJECTION_COMPONENT_DATA = new InjectionToken('DbxInjectionComponentCo
|
|
|
3797
3709
|
* @returns
|
|
3798
3710
|
*/
|
|
3799
3711
|
function mergeDbxInjectionComponentConfigs(configs) {
|
|
3800
|
-
const providers = mergeArrays(filterMaybeValues(configs).map(x => x.providers));
|
|
3712
|
+
const providers = mergeArrays(filterMaybeValues(configs).map((x) => x.providers));
|
|
3801
3713
|
const result = mergeObjects(configs);
|
|
3802
3714
|
result.providers = providers;
|
|
3803
3715
|
return result;
|
|
@@ -3878,13 +3790,15 @@ class DbxInjectionInstance {
|
|
|
3878
3790
|
const { init, injector: inputInjector, providers, ngModuleRef, componentClass, data } = config;
|
|
3879
3791
|
let injector;
|
|
3880
3792
|
const parentInjector = inputInjector ?? this._injector;
|
|
3881
|
-
if (
|
|
3793
|
+
if (providers || data) {
|
|
3882
3794
|
injector = Injector.create({
|
|
3883
3795
|
parent: parentInjector,
|
|
3884
|
-
providers: mergeArrayOrValueIntoArray([
|
|
3796
|
+
providers: mergeArrayOrValueIntoArray([
|
|
3797
|
+
{
|
|
3885
3798
|
provide: DBX_INJECTION_COMPONENT_DATA,
|
|
3886
3799
|
useValue: data
|
|
3887
|
-
}
|
|
3800
|
+
}
|
|
3801
|
+
], providers ?? [])
|
|
3888
3802
|
});
|
|
3889
3803
|
}
|
|
3890
3804
|
const componentRef = content.createComponent(componentClass, { injector, ngModuleRef });
|
|
@@ -3958,12 +3872,16 @@ class DbxInjectionComponent extends AbstractDbxInjectionDirective {
|
|
|
3958
3872
|
}
|
|
3959
3873
|
}
|
|
3960
3874
|
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:
|
|
3875
|
+
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: `
|
|
3876
|
+
<ng-template #content></ng-template>
|
|
3877
|
+
`, isInline: true });
|
|
3962
3878
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxInjectionComponent, decorators: [{
|
|
3963
3879
|
type: Component,
|
|
3964
3880
|
args: [{
|
|
3965
3881
|
selector: 'dbx-injection, [dbxInjection], [dbx-injection]',
|
|
3966
|
-
template:
|
|
3882
|
+
template: `
|
|
3883
|
+
<ng-template #content></ng-template>
|
|
3884
|
+
`
|
|
3967
3885
|
}]
|
|
3968
3886
|
}], propDecorators: { config: [{
|
|
3969
3887
|
type: Input
|
|
@@ -3985,11 +3903,13 @@ class DbxInjectionContext {
|
|
|
3985
3903
|
/**
|
|
3986
3904
|
* Allows a directive to provide a formly context and form.
|
|
3987
3905
|
*/
|
|
3988
|
-
function
|
|
3989
|
-
return [
|
|
3906
|
+
function provideDbxInjectionContext(type) {
|
|
3907
|
+
return [
|
|
3908
|
+
{
|
|
3990
3909
|
provide: DbxInjectionContext,
|
|
3991
3910
|
useExisting: type
|
|
3992
|
-
}
|
|
3911
|
+
}
|
|
3912
|
+
];
|
|
3993
3913
|
}
|
|
3994
3914
|
|
|
3995
3915
|
/**
|
|
@@ -4100,12 +4020,12 @@ class DbxInjectionContextDirective {
|
|
|
4100
4020
|
}
|
|
4101
4021
|
}
|
|
4102
4022
|
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:
|
|
4023
|
+
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
4024
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxInjectionContextDirective, decorators: [{
|
|
4105
4025
|
type: Directive,
|
|
4106
4026
|
args: [{
|
|
4107
4027
|
selector: '[dbxInjectionContext]',
|
|
4108
|
-
providers:
|
|
4028
|
+
providers: provideDbxInjectionContext(DbxInjectionContextDirective)
|
|
4109
4029
|
}]
|
|
4110
4030
|
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; }, propDecorators: { config: [{
|
|
4111
4031
|
type: Input
|
|
@@ -4114,26 +4034,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
4114
4034
|
class DbxInjectionComponentModule {
|
|
4115
4035
|
}
|
|
4116
4036
|
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
|
-
|
|
4119
|
-
DbxInjectionContextDirective] });
|
|
4120
|
-
DbxInjectionComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxInjectionComponentModule, imports: [[
|
|
4121
|
-
CommonModule
|
|
4122
|
-
]] });
|
|
4037
|
+
DbxInjectionComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxInjectionComponentModule, declarations: [DbxInjectionComponent, DbxInjectionContextDirective], imports: [CommonModule], exports: [DbxInjectionComponent, DbxInjectionContextDirective] });
|
|
4038
|
+
DbxInjectionComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxInjectionComponentModule, imports: [[CommonModule]] });
|
|
4123
4039
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxInjectionComponentModule, decorators: [{
|
|
4124
4040
|
type: NgModule,
|
|
4125
4041
|
args: [{
|
|
4126
|
-
imports: [
|
|
4127
|
-
|
|
4128
|
-
]
|
|
4129
|
-
declarations: [
|
|
4130
|
-
DbxInjectionComponent,
|
|
4131
|
-
DbxInjectionContextDirective
|
|
4132
|
-
],
|
|
4133
|
-
exports: [
|
|
4134
|
-
DbxInjectionComponent,
|
|
4135
|
-
DbxInjectionContextDirective
|
|
4136
|
-
],
|
|
4042
|
+
imports: [CommonModule],
|
|
4043
|
+
declarations: [DbxInjectionComponent, DbxInjectionContextDirective],
|
|
4044
|
+
exports: [DbxInjectionComponent, DbxInjectionContextDirective]
|
|
4137
4045
|
}]
|
|
4138
4046
|
}] });
|
|
4139
4047
|
|
|
@@ -4189,7 +4097,7 @@ class LockSetComponentStore extends ComponentStore {
|
|
|
4189
4097
|
}
|
|
4190
4098
|
}
|
|
4191
4099
|
setParentLockSet(obs) {
|
|
4192
|
-
this.lockSet.setParentLockSet(asObservable(obs).pipe(map
|
|
4100
|
+
this.lockSet.setParentLockSet(asObservable(obs).pipe(map((x) => x?.lockSet)));
|
|
4193
4101
|
}
|
|
4194
4102
|
addLock(key, obs) {
|
|
4195
4103
|
this.lockSet.addLock(key, obs);
|
|
@@ -4201,7 +4109,7 @@ class LockSetComponentStore extends ComponentStore {
|
|
|
4201
4109
|
fn: () => {
|
|
4202
4110
|
this._destroyNow();
|
|
4203
4111
|
},
|
|
4204
|
-
timeout: this.lockSetDestroyTimeoutMs
|
|
4112
|
+
timeout: this.lockSetDestroyTimeoutMs
|
|
4205
4113
|
}, this.lockSetDestroyDelayMs);
|
|
4206
4114
|
}
|
|
4207
4115
|
/**
|
|
@@ -4306,7 +4214,8 @@ class SimpleStorageAccessor {
|
|
|
4306
4214
|
}
|
|
4307
4215
|
all() {
|
|
4308
4216
|
return this._delegate.all(this._config.fullPrefix).pipe(map((allStoredData) => {
|
|
4309
|
-
return allStoredData
|
|
4217
|
+
return allStoredData
|
|
4218
|
+
.map((storedData) => {
|
|
4310
4219
|
const readStoredData = this.readStoredData(storedData);
|
|
4311
4220
|
if (!readStoredData.expired) {
|
|
4312
4221
|
return readStoredData.convertedData;
|
|
@@ -4314,11 +4223,12 @@ class SimpleStorageAccessor {
|
|
|
4314
4223
|
else {
|
|
4315
4224
|
return null;
|
|
4316
4225
|
}
|
|
4317
|
-
})
|
|
4226
|
+
})
|
|
4227
|
+
.filter(filterMaybeValuesFn);
|
|
4318
4228
|
}));
|
|
4319
4229
|
}
|
|
4320
4230
|
allKeys() {
|
|
4321
|
-
return this._delegate.allKeys(this._config.fullPrefix).pipe(map((keys) => keys.map(x => this.decodeStorageKey(x))));
|
|
4231
|
+
return this._delegate.allKeys(this._config.fullPrefix).pipe(map((keys) => keys.map((x) => this.decodeStorageKey(x))));
|
|
4322
4232
|
}
|
|
4323
4233
|
clear() {
|
|
4324
4234
|
return this._delegate.clear();
|
|
@@ -4416,7 +4326,7 @@ class StringStorageAccessor {
|
|
|
4416
4326
|
});
|
|
4417
4327
|
}
|
|
4418
4328
|
all() {
|
|
4419
|
-
return this.allKeys().pipe(map(x => x.map(y => this._storage.getItem(y))), shareReplay(1));
|
|
4329
|
+
return this.allKeys().pipe(map((x) => filterMaybeValues(x.map((y) => this._storage.getItem(y)))), shareReplay(1));
|
|
4420
4330
|
}
|
|
4421
4331
|
allKeys() {
|
|
4422
4332
|
return new Observable((x) => {
|
|
@@ -4512,7 +4422,7 @@ class FullLocalStorageObject {
|
|
|
4512
4422
|
}
|
|
4513
4423
|
removeAll() {
|
|
4514
4424
|
const keys = StorageObjectUtility.allKeysFromStorageObject(this);
|
|
4515
|
-
keys.forEach(x => this.removeItem(x));
|
|
4425
|
+
keys.forEach((x) => this.removeItem(x));
|
|
4516
4426
|
return keys;
|
|
4517
4427
|
}
|
|
4518
4428
|
}
|
|
@@ -4543,16 +4453,20 @@ class DbxStorageModule {
|
|
|
4543
4453
|
static forRoot() {
|
|
4544
4454
|
return {
|
|
4545
4455
|
ngModule: DbxStorageModule,
|
|
4546
|
-
providers: [
|
|
4456
|
+
providers: [
|
|
4457
|
+
{
|
|
4547
4458
|
provide: DEFAULT_STORAGE_OBJECT_TOKEN,
|
|
4548
4459
|
useFactory: defaultStorageObjectFactory
|
|
4549
|
-
},
|
|
4460
|
+
},
|
|
4461
|
+
{
|
|
4550
4462
|
provide: DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN,
|
|
4551
4463
|
useClass: SimpleStorageAccessorFactory
|
|
4552
|
-
},
|
|
4464
|
+
},
|
|
4465
|
+
{
|
|
4553
4466
|
provide: SimpleStorageAccessorFactory,
|
|
4554
4467
|
useExisting: DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN
|
|
4555
|
-
}
|
|
4468
|
+
}
|
|
4469
|
+
]
|
|
4556
4470
|
};
|
|
4557
4471
|
}
|
|
4558
4472
|
}
|
|
@@ -4567,5 +4481,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
4567
4481
|
* Generated bundle index. Do not edit.
|
|
4568
4482
|
*/
|
|
4569
4483
|
|
|
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,
|
|
4484
|
+
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, SecondaryActionContextStoreSource, SimpleStorageAccessor, SimpleStorageAccessorFactory, StorageAccessor, StringStorageAccessor, StringifySimpleStorageAccessorConverter, TimeDistanceCountdownPipe, TimeDistancePipe, ToJsDatePipe, ToMinutesPipe, WrapperSimpleStorageAccessorDelegate, actionContextHasNoErrorAndIsModifiedAndCanTrigger, actionContextIsModifiedAndCanTrigger, actionContextStoreSourceInstanceFactory, actionContextStoreSourcePipe, anchorTypeForAnchor, asSegueRef, asSegueRefString, 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, provideActionStoreSource, provideDbxAnchor, provideDbxButton, provideDbxInjectionContext, provideFilterSource, provideFilterSourceConnector, provideSecondaryActionStoreSource, redirectBasedOnAuthUserState, refStringToSegueRef, safeDetectChanges, safeMarkForCheck, safeUseCdRef, successTransition, tapDetectChanges, useActionStore };
|
|
4571
4485
|
//# sourceMappingURL=dereekb-dbx-core.mjs.map
|