@dereekb/dbx-core 9.15.8 → 9.16.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.holder.mjs +1 -1
- package/esm2020/lib/action/action.machine.mjs +30 -7
- package/esm2020/lib/action/action.store.source.mjs +2 -30
- package/esm2020/lib/action/action.store.source.provide.mjs +41 -0
- package/esm2020/lib/action/directive/context/action.directive.mjs +3 -2
- package/esm2020/lib/action/directive/context/action.source.directive.mjs +3 -2
- package/esm2020/lib/action/directive/map/action.map.key.directive.mjs +2 -2
- package/esm2020/lib/action/directive/state/action.handler.directive.mjs +27 -34
- package/esm2020/lib/action/directive/state/action.handler.instance.mjs +40 -0
- package/esm2020/lib/action/directive/state/index.mjs +2 -1
- package/esm2020/lib/action/index.mjs +2 -1
- package/esm2020/lib/filter/filter.abstract.source.directive.mjs +19 -4
- package/esm2020/lib/filter/filter.connect.source.directive.mjs +27 -0
- package/esm2020/lib/filter/filter.map.source.directive.mjs +3 -3
- package/esm2020/lib/filter/filter.module.mjs +5 -4
- package/esm2020/lib/filter/filter.preset.mjs +2 -0
- package/esm2020/lib/filter/filter.source.directive.mjs +4 -5
- package/esm2020/lib/filter/index.mjs +3 -2
- package/esm2020/lib/router/anchor/anchor.directive.mjs +14 -3
- package/esm2020/lib/router/anchor/anchor.mjs +1 -1
- package/esm2020/lib/router/router/provider/uirouter/uirouter.router.service.mjs +1 -1
- package/esm2020/lib/router/router/service/index.mjs +3 -1
- package/esm2020/lib/router/router/service/router.service.mjs +3 -2
- package/esm2020/lib/router/router/service/router.service.rxjs.mjs +39 -0
- package/esm2020/lib/router/router/service/router.service.util.mjs +14 -0
- package/esm2020/lib/router/router/transition/transition.mjs +2 -2
- package/fesm2015/dereekb-dbx-core.mjs +396 -260
- package/fesm2015/dereekb-dbx-core.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-core.mjs +392 -258
- package/fesm2020/dereekb-dbx-core.mjs.map +1 -1
- package/lib/action/action.holder.d.ts +1 -1
- package/lib/action/action.machine.d.ts +14 -1
- package/lib/action/action.store.source.d.ts +1 -7
- package/lib/action/action.store.source.provide.d.ts +10 -0
- package/lib/action/directive/state/action.handler.directive.d.ts +14 -9
- package/lib/action/directive/state/action.handler.instance.d.ts +19 -0
- package/lib/action/directive/state/index.d.ts +1 -0
- package/lib/action/index.d.ts +1 -0
- package/lib/filter/filter.abstract.source.directive.d.ts +14 -3
- package/lib/filter/filter.connect.source.directive.d.ts +14 -0
- package/lib/filter/filter.map.source.directive.d.ts +1 -1
- package/lib/filter/filter.module.d.ts +7 -6
- package/lib/filter/filter.preset.d.ts +11 -0
- package/lib/filter/index.d.ts +2 -1
- package/lib/router/anchor/anchor.d.ts +3 -0
- package/lib/router/anchor/anchor.directive.d.ts +5 -1
- package/lib/router/router/service/index.d.ts +2 -0
- package/lib/router/router/service/router.service.d.ts +2 -1
- package/lib/router/router/service/router.service.rxjs.d.ts +27 -0
- package/lib/router/router/service/router.service.util.d.ts +26 -0
- package/lib/router/router/transition/transition.d.ts +1 -1
- package/package.json +4 -4
- package/esm2020/lib/filter/action/action.filter.source.directive.mjs +0 -33
- package/esm2020/lib/filter/action/index.mjs +0 -2
- package/lib/filter/action/action.filter.source.directive.d.ts +0 -17
- package/lib/filter/action/index.d.ts +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Directive, Injectable,
|
|
2
|
+
import { Directive, Injectable, Host, Input, forwardRef, Optional, NgModule, InjectionToken, Inject, EventEmitter, Output, LOCALE_ID, Pipe, Injector, ViewContainerRef, Component, ViewChild } from '@angular/core';
|
|
3
3
|
import * as i1$5 from '@dereekb/rxjs';
|
|
4
|
-
import { SubscriptionObject, LockSet, filterMaybe, LoadingStateType, beginLoading, idleLoadingState, errorResult, successResult, scanCount,
|
|
4
|
+
import { SubscriptionObject, LockSet, filterMaybe, LoadingStateType, beginLoading, idleLoadingState, errorResult, successResult, scanCount, workFactory, combineLatestFromMapValuesObsFn, emitDelayObs, asObservable, returnIfIs, timeoutStartWith, skipFirstMaybe, maybeValueFromObservableOrValueGetter, switchMapToDefault, asObservableFromGetter, onFalseToTrue, onTrueToFalse, setContainsAllValuesFrom, setContainsNoValueFrom, FilterSource, FilterSourceConnector, FilterSourceInstance, FilterMap } from '@dereekb/rxjs';
|
|
5
5
|
import * as i1 from 'rxjs';
|
|
6
|
-
import { switchMap, first, BehaviorSubject, combineLatest, distinctUntilChanged, filter, Subject, debounce, interval, throttle, exhaustMap, mergeMap, map, shareReplay, EMPTY, withLatestFrom, of, startWith,
|
|
6
|
+
import { switchMap, first, BehaviorSubject, combineLatest, distinctUntilChanged, filter, Subject, debounce, interval, throttle, exhaustMap, mergeMap, map, shareReplay, EMPTY, withLatestFrom, of, startWith, delay, tap, catchError, firstValueFrom, takeUntil, Observable } from 'rxjs';
|
|
7
7
|
import * as i1$6 from '@dereekb/util';
|
|
8
8
|
import { isDefinedAndNotFalse, hasValueOrNotEmpty, BooleanStringKeyArrayUtilityInstance, reduceBooleansWithOrFn, getValueFromGetter, toReadableError, isGetter, setIncludes, isAllowed, maybeSet, expandTreeFunction, flattenTreeToArrayFunction, expandFlattenTreeFunction, mergeObjects, KeyValueTypleValueFilter, asArray, defaultForwardFunctionFactory, mergeArrays, filterMaybeValues, mergeArrayOrValueIntoArray, promiseReference, DataIsExpiredError, DataDoesNotExistError, hasNonNullValue, splitJoinRemainder, StorageObjectUtility, SHARED_MEMORY_STORAGE } from '@dereekb/util';
|
|
9
9
|
import { ComponentStore } from '@ngrx/component-store';
|
|
@@ -200,34 +200,6 @@ DbxActionContextStoreSourceInstance.ɵprov = i0.ɵɵngDeclareInjectable({ minVer
|
|
|
200
200
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxActionContextStoreSourceInstance, decorators: [{
|
|
201
201
|
type: Injectable
|
|
202
202
|
}], ctorParameters: function () { return [{ type: ActionContextStoreSource }]; } });
|
|
203
|
-
const actionContextStoreSourceInstanceFactory = (source) => {
|
|
204
|
-
return new DbxActionContextStoreSourceInstance(source);
|
|
205
|
-
};
|
|
206
|
-
/**
|
|
207
|
-
* Provides an ActionContextStoreSource, as well as an DbxActionContextStoreSourceInstance.
|
|
208
|
-
*/
|
|
209
|
-
function provideActionStoreSource(sourceType) {
|
|
210
|
-
return [
|
|
211
|
-
{
|
|
212
|
-
provide: ActionContextStoreSource,
|
|
213
|
-
useExisting: forwardRef(() => sourceType)
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
provide: DbxActionContextStoreSourceInstance,
|
|
217
|
-
useFactory: actionContextStoreSourceInstanceFactory,
|
|
218
|
-
deps: [ActionContextStoreSource]
|
|
219
|
-
}
|
|
220
|
-
];
|
|
221
|
-
}
|
|
222
|
-
function provideSecondaryActionStoreSource(sourceType) {
|
|
223
|
-
return [
|
|
224
|
-
{
|
|
225
|
-
provide: SecondaryActionContextStoreSource,
|
|
226
|
-
useExisting: forwardRef(() => sourceType)
|
|
227
|
-
},
|
|
228
|
-
...provideActionStoreSource(sourceType)
|
|
229
|
-
];
|
|
230
|
-
}
|
|
231
203
|
|
|
232
204
|
class DbxActionAutoModifyDirective extends AbstractSubscriptionDirective {
|
|
233
205
|
constructor(source) {
|
|
@@ -474,6 +446,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
|
|
|
474
446
|
type: Input
|
|
475
447
|
}] } });
|
|
476
448
|
|
|
449
|
+
/**
|
|
450
|
+
* WorkInstanceDelegate implementation using an DbxActionContextStoreSourceInstance.
|
|
451
|
+
*/
|
|
452
|
+
class DbxActionWorkInstanceDelegate {
|
|
453
|
+
constructor(source) {
|
|
454
|
+
this.source = source;
|
|
455
|
+
}
|
|
456
|
+
startWorking() {
|
|
457
|
+
this.source.startWorking();
|
|
458
|
+
}
|
|
459
|
+
success(result) {
|
|
460
|
+
this.source.resolve(result);
|
|
461
|
+
}
|
|
462
|
+
reject(error) {
|
|
463
|
+
this.source.reject(error);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
|
|
477
467
|
/**
|
|
478
468
|
* Used by ActionContextState to denote what state the action is in.
|
|
479
469
|
*/
|
|
@@ -813,6 +803,106 @@ class DbxActionContextBaseSource {
|
|
|
813
803
|
}
|
|
814
804
|
}
|
|
815
805
|
|
|
806
|
+
/**
|
|
807
|
+
* Configurable machine that handles components of the ActionContextStore lifecycle.
|
|
808
|
+
*
|
|
809
|
+
* It can be configured to activate only once before cleaning itself up. It can be used directly as a DbxActionContextSourceReference in cases where it is created as a one-off action.
|
|
810
|
+
*/
|
|
811
|
+
class DbxActionContextMachine extends DbxActionContextBaseSource {
|
|
812
|
+
constructor(config, source) {
|
|
813
|
+
super(source);
|
|
814
|
+
this.config = config;
|
|
815
|
+
this._isShutdown = true;
|
|
816
|
+
this._handleValueReadySub = new SubscriptionObject();
|
|
817
|
+
this._successSub = new SubscriptionObject();
|
|
818
|
+
// Handle Value Ready
|
|
819
|
+
if (config.handleValueReady !== false) {
|
|
820
|
+
this._handleValueReadySub.subscription = this.sourceInstance.valueReady$.subscribe((value) => {
|
|
821
|
+
const doWork = workFactory({
|
|
822
|
+
work: config.handleValueReady,
|
|
823
|
+
delegate: new DbxActionWorkInstanceDelegate(this.sourceInstance)
|
|
824
|
+
});
|
|
825
|
+
doWork(value);
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
// If this is a one-time use, then destroy it after the first success comes through.
|
|
829
|
+
if (this.config.oneTimeUse) {
|
|
830
|
+
this.sourceInstance.success$.pipe(first(), delay(1000)).subscribe(() => {
|
|
831
|
+
this.destroy();
|
|
832
|
+
});
|
|
833
|
+
}
|
|
834
|
+
if (this.config.onSuccess) {
|
|
835
|
+
this._successSub.subscription = this.sourceInstance.success$.subscribe(this.config.onSuccess);
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
destroy() {
|
|
839
|
+
super.destroy();
|
|
840
|
+
this._handleValueReadySub.destroy();
|
|
841
|
+
this._successSub.destroy();
|
|
842
|
+
this._isShutdown = true;
|
|
843
|
+
}
|
|
844
|
+
get isShutdown() {
|
|
845
|
+
return this._isShutdown;
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* DbxActionContextMachine that implements OnDestroy and is configured for use as a Service/Injectable.
|
|
850
|
+
*/
|
|
851
|
+
class DbxActionContextMachineAsService extends DbxActionContextMachine {
|
|
852
|
+
constructor() {
|
|
853
|
+
super({
|
|
854
|
+
oneTimeUse: false,
|
|
855
|
+
handleValueReady: false
|
|
856
|
+
});
|
|
857
|
+
}
|
|
858
|
+
ngOnDestroy() {
|
|
859
|
+
this.destroy();
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
DbxActionContextMachineAsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxActionContextMachineAsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
863
|
+
DbxActionContextMachineAsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxActionContextMachineAsService });
|
|
864
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxActionContextMachineAsService, decorators: [{
|
|
865
|
+
type: Injectable
|
|
866
|
+
}], ctorParameters: function () { return []; } });
|
|
867
|
+
|
|
868
|
+
const actionContextStoreSourceInstanceFactory = (source) => {
|
|
869
|
+
return new DbxActionContextStoreSourceInstance(source);
|
|
870
|
+
};
|
|
871
|
+
const actionContextStoreSourceMachineFactory = () => {
|
|
872
|
+
return new DbxActionContextMachineAsService();
|
|
873
|
+
};
|
|
874
|
+
/**
|
|
875
|
+
* Provides an ActionContextStoreSource, as well as an DbxActionContextStoreSourceInstance.
|
|
876
|
+
*/
|
|
877
|
+
function provideActionStoreSource(sourceType) {
|
|
878
|
+
const storeSourceProvider = sourceType != null
|
|
879
|
+
? {
|
|
880
|
+
provide: ActionContextStoreSource,
|
|
881
|
+
useExisting: forwardRef(() => sourceType)
|
|
882
|
+
}
|
|
883
|
+
: {
|
|
884
|
+
provide: ActionContextStoreSource,
|
|
885
|
+
useFactory: actionContextStoreSourceMachineFactory
|
|
886
|
+
};
|
|
887
|
+
return [
|
|
888
|
+
storeSourceProvider,
|
|
889
|
+
{
|
|
890
|
+
provide: DbxActionContextStoreSourceInstance,
|
|
891
|
+
useFactory: actionContextStoreSourceInstanceFactory,
|
|
892
|
+
deps: [ActionContextStoreSource]
|
|
893
|
+
}
|
|
894
|
+
];
|
|
895
|
+
}
|
|
896
|
+
function provideSecondaryActionStoreSource(sourceType) {
|
|
897
|
+
return [
|
|
898
|
+
{
|
|
899
|
+
provide: SecondaryActionContextStoreSource,
|
|
900
|
+
useExisting: forwardRef(() => sourceType)
|
|
901
|
+
},
|
|
902
|
+
...provideActionStoreSource(sourceType)
|
|
903
|
+
];
|
|
904
|
+
}
|
|
905
|
+
|
|
816
906
|
/**
|
|
817
907
|
* Provides an DbxActionContext.
|
|
818
908
|
*/
|
|
@@ -1178,31 +1268,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
|
|
|
1178
1268
|
args: ['dbxActionDisabledOnSuccess']
|
|
1179
1269
|
}] } });
|
|
1180
1270
|
|
|
1271
|
+
const DBX_ACTION_HANDLER_LOCK_KEY = 'dbxActionHandler';
|
|
1181
1272
|
/**
|
|
1182
|
-
*
|
|
1273
|
+
* Context used for defining a function that performs an action using the input function to handle valueReady$ events from an action context.
|
|
1183
1274
|
*/
|
|
1184
|
-
class
|
|
1275
|
+
class DbxActionHandlerInstance {
|
|
1185
1276
|
constructor(source) {
|
|
1186
1277
|
this.source = source;
|
|
1187
|
-
|
|
1188
|
-
startWorking() {
|
|
1189
|
-
this.source.startWorking();
|
|
1190
|
-
}
|
|
1191
|
-
success(result) {
|
|
1192
|
-
this.source.resolve(result);
|
|
1193
|
-
}
|
|
1194
|
-
reject(error) {
|
|
1195
|
-
this.source.reject(error);
|
|
1196
|
-
}
|
|
1197
|
-
}
|
|
1198
|
-
|
|
1199
|
-
/**
|
|
1200
|
-
* Context used for defining a function that performs an action using the input function on ValueReady.
|
|
1201
|
-
*/
|
|
1202
|
-
class DbxActionHandlerDirective extends AbstractSubscriptionDirective {
|
|
1203
|
-
constructor(source) {
|
|
1204
|
-
super();
|
|
1205
|
-
this.source = source;
|
|
1278
|
+
this._sub = new SubscriptionObject();
|
|
1206
1279
|
this._handlerFunction = new BehaviorSubject(undefined);
|
|
1207
1280
|
this.handlerFunction$ = this._handlerFunction.pipe(filterMaybe(), shareReplay(1));
|
|
1208
1281
|
this._delegate = new DbxActionWorkInstanceDelegate(this.source);
|
|
@@ -1213,36 +1286,68 @@ class DbxActionHandlerDirective extends AbstractSubscriptionDirective {
|
|
|
1213
1286
|
set handlerFunction(handlerFunction) {
|
|
1214
1287
|
this._handlerFunction.next(handlerFunction);
|
|
1215
1288
|
}
|
|
1216
|
-
|
|
1217
|
-
this.
|
|
1289
|
+
init() {
|
|
1290
|
+
this._sub.subscription = this.handlerFunction$
|
|
1218
1291
|
.pipe(switchMap((work) => this.source.valueReady$.pipe(tap((value) => {
|
|
1219
1292
|
const context = workFactory({ work, delegate: this._delegate })(value);
|
|
1220
1293
|
if (context) {
|
|
1221
1294
|
// Add the action to the lockSet for the source to prevent it from being destroyed until the action completes.
|
|
1222
|
-
this.source.lockSet.addLock(
|
|
1295
|
+
this.source.lockSet.addLock(DBX_ACTION_HANDLER_LOCK_KEY, context.isComplete$.pipe(map((x) => !x)));
|
|
1223
1296
|
}
|
|
1224
1297
|
}))))
|
|
1225
1298
|
.subscribe();
|
|
1226
1299
|
}
|
|
1227
|
-
|
|
1300
|
+
destroy() {
|
|
1228
1301
|
this.source.lockSet.onNextUnlock(() => {
|
|
1229
|
-
|
|
1302
|
+
this._sub.destroy();
|
|
1230
1303
|
this._handlerFunction.complete();
|
|
1231
1304
|
});
|
|
1232
1305
|
}
|
|
1233
1306
|
}
|
|
1234
|
-
|
|
1307
|
+
|
|
1308
|
+
/**
|
|
1309
|
+
* Abstract directive that wraps and handles a DbxActionHandlerInstance lifecycle.
|
|
1310
|
+
*/
|
|
1311
|
+
class AbstractDbxActionHandlerDirective {
|
|
1312
|
+
constructor(source) {
|
|
1313
|
+
this.source = source;
|
|
1314
|
+
this._dbxActionHandlerInstance = new DbxActionHandlerInstance(this.source);
|
|
1315
|
+
}
|
|
1316
|
+
ngOnInit() {
|
|
1317
|
+
this._dbxActionHandlerInstance.init();
|
|
1318
|
+
}
|
|
1319
|
+
ngOnDestroy() {
|
|
1320
|
+
this._dbxActionHandlerInstance.destroy();
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
AbstractDbxActionHandlerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: AbstractDbxActionHandlerDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1324
|
+
AbstractDbxActionHandlerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.2", type: AbstractDbxActionHandlerDirective, ngImport: i0 });
|
|
1325
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: AbstractDbxActionHandlerDirective, decorators: [{
|
|
1326
|
+
type: Directive
|
|
1327
|
+
}], ctorParameters: function () {
|
|
1328
|
+
return [{ type: DbxActionContextStoreSourceInstance, decorators: [{
|
|
1329
|
+
type: Host
|
|
1330
|
+
}] }];
|
|
1331
|
+
} });
|
|
1332
|
+
/**
|
|
1333
|
+
* Directive that wraps and controls a DbxActionHandlerInstance.
|
|
1334
|
+
*/
|
|
1335
|
+
class DbxActionHandlerDirective extends AbstractDbxActionHandlerDirective {
|
|
1336
|
+
get handlerFunction() {
|
|
1337
|
+
return this._dbxActionHandlerInstance.handlerFunction;
|
|
1338
|
+
}
|
|
1339
|
+
set handlerFunction(handlerFunction) {
|
|
1340
|
+
this._dbxActionHandlerInstance.handlerFunction = handlerFunction;
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1343
|
+
DbxActionHandlerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxActionHandlerDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
1235
1344
|
DbxActionHandlerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.2", type: DbxActionHandlerDirective, selector: "[dbxActionHandler]", inputs: { handlerFunction: ["dbxActionHandler", "handlerFunction"] }, usesInheritance: true, ngImport: i0 });
|
|
1236
1345
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxActionHandlerDirective, decorators: [{
|
|
1237
1346
|
type: Directive,
|
|
1238
1347
|
args: [{
|
|
1239
1348
|
selector: '[dbxActionHandler]'
|
|
1240
1349
|
}]
|
|
1241
|
-
}],
|
|
1242
|
-
return [{ type: DbxActionContextStoreSourceInstance, decorators: [{
|
|
1243
|
-
type: Host
|
|
1244
|
-
}] }];
|
|
1245
|
-
}, propDecorators: { handlerFunction: [{
|
|
1350
|
+
}], propDecorators: { handlerFunction: [{
|
|
1246
1351
|
type: Input,
|
|
1247
1352
|
args: ['dbxActionHandler']
|
|
1248
1353
|
}] } });
|
|
@@ -1613,47 +1718,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
|
|
|
1613
1718
|
type: Input
|
|
1614
1719
|
}] } });
|
|
1615
1720
|
|
|
1616
|
-
/**
|
|
1617
|
-
* Configurable machine that handles components of the ActionContextStore lifecycle.
|
|
1618
|
-
*
|
|
1619
|
-
* It can be configured to activate only once before cleaning itself up. It can be used directly as a DbxActionContextSourceReference in cases where it is created as a one-off action.
|
|
1620
|
-
*/
|
|
1621
|
-
class DbxActionContextMachine extends DbxActionContextBaseSource {
|
|
1622
|
-
constructor(config, source) {
|
|
1623
|
-
super(source);
|
|
1624
|
-
this.config = config;
|
|
1625
|
-
this._isShutdown = true;
|
|
1626
|
-
this._handleValueReadySub = new SubscriptionObject();
|
|
1627
|
-
this._successSub = new SubscriptionObject();
|
|
1628
|
-
// Handle Value Ready
|
|
1629
|
-
this._handleValueReadySub.subscription = this.sourceInstance.valueReady$.subscribe((value) => {
|
|
1630
|
-
const doWork = workFactory({
|
|
1631
|
-
work: config.handleValueReady,
|
|
1632
|
-
delegate: new DbxActionWorkInstanceDelegate(this.sourceInstance)
|
|
1633
|
-
});
|
|
1634
|
-
doWork(value);
|
|
1635
|
-
});
|
|
1636
|
-
// If this is a one-time use, then destroy it after the first success comes through.
|
|
1637
|
-
if (this.config.oneTimeUse) {
|
|
1638
|
-
this.sourceInstance.success$.pipe(first(), delay(1000)).subscribe(() => {
|
|
1639
|
-
this.destroy();
|
|
1640
|
-
});
|
|
1641
|
-
}
|
|
1642
|
-
if (this.config.onSuccess) {
|
|
1643
|
-
this._successSub.subscription = this.sourceInstance.success$.subscribe(this.config.onSuccess);
|
|
1644
|
-
}
|
|
1645
|
-
}
|
|
1646
|
-
destroy() {
|
|
1647
|
-
super.destroy();
|
|
1648
|
-
this._handleValueReadySub.destroy();
|
|
1649
|
-
this._successSub.destroy();
|
|
1650
|
-
this._isShutdown = true;
|
|
1651
|
-
}
|
|
1652
|
-
get isShutdown() {
|
|
1653
|
-
return this._isShutdown;
|
|
1654
|
-
}
|
|
1655
|
-
}
|
|
1656
|
-
|
|
1657
1721
|
class DbxCoreActionModule {
|
|
1658
1722
|
}
|
|
1659
1723
|
DbxCoreActionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxCoreActionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -2263,13 +2327,16 @@ function provideDbxAnchor(sourceType) {
|
|
|
2263
2327
|
*/
|
|
2264
2328
|
class AbstractDbxAnchorDirective {
|
|
2265
2329
|
constructor() {
|
|
2330
|
+
this._selected = new BehaviorSubject(false);
|
|
2266
2331
|
this._disabled = new BehaviorSubject(false);
|
|
2267
2332
|
this._anchor = new BehaviorSubject(undefined);
|
|
2268
|
-
this.disabled$ = this._disabled.
|
|
2333
|
+
this.disabled$ = this._disabled.pipe(distinctUntilChanged());
|
|
2269
2334
|
this.anchor$ = this._anchor.pipe(skipFirstMaybe(), distinctUntilChanged(), shareReplay(1));
|
|
2335
|
+
this.selected$ = combineLatest([this._selected, this.anchor$]).pipe(map(([selected, anchor]) => selected || (anchor === null || anchor === void 0 ? void 0 : anchor.selected)), distinctUntilChanged());
|
|
2270
2336
|
this.type$ = combineLatest([this.disabled$, this.anchor$]).pipe(delay(0), map(([disabled, anchor]) => anchorTypeForAnchor(anchor, disabled)), distinctUntilChanged(), shareReplay(1));
|
|
2271
2337
|
}
|
|
2272
2338
|
ngOnDestroy() {
|
|
2339
|
+
this._selected.complete();
|
|
2273
2340
|
this._disabled.complete();
|
|
2274
2341
|
this._anchor.complete();
|
|
2275
2342
|
}
|
|
@@ -2291,9 +2358,15 @@ class AbstractDbxAnchorDirective {
|
|
|
2291
2358
|
set disabled(disabled) {
|
|
2292
2359
|
this._disabled.next(disabled);
|
|
2293
2360
|
}
|
|
2361
|
+
get selected() {
|
|
2362
|
+
return this._selected.value;
|
|
2363
|
+
}
|
|
2364
|
+
set selected(selected) {
|
|
2365
|
+
this._selected.next(selected);
|
|
2366
|
+
}
|
|
2294
2367
|
}
|
|
2295
2368
|
AbstractDbxAnchorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: AbstractDbxAnchorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2296
|
-
AbstractDbxAnchorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.2", type: AbstractDbxAnchorDirective, inputs: { ref: "ref", anchor: "anchor", disabled: "disabled" }, ngImport: i0 });
|
|
2369
|
+
AbstractDbxAnchorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.2", type: AbstractDbxAnchorDirective, inputs: { ref: "ref", anchor: "anchor", disabled: "disabled", selected: "selected" }, ngImport: i0 });
|
|
2297
2370
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: AbstractDbxAnchorDirective, decorators: [{
|
|
2298
2371
|
type: Directive
|
|
2299
2372
|
}], propDecorators: { ref: [{
|
|
@@ -2302,6 +2375,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
|
|
|
2302
2375
|
type: Input
|
|
2303
2376
|
}], disabled: [{
|
|
2304
2377
|
type: Input
|
|
2378
|
+
}], selected: [{
|
|
2379
|
+
type: Input
|
|
2305
2380
|
}] } });
|
|
2306
2381
|
|
|
2307
2382
|
function clickableUrlInNewTab(url) {
|
|
@@ -2373,7 +2448,7 @@ var DbxRouterTransitionEventType;
|
|
|
2373
2448
|
/**
|
|
2374
2449
|
* A transition ended.
|
|
2375
2450
|
*/
|
|
2376
|
-
DbxRouterTransitionEventType["SUCCESS"] = "
|
|
2451
|
+
DbxRouterTransitionEventType["SUCCESS"] = "success";
|
|
2377
2452
|
})(DbxRouterTransitionEventType || (DbxRouterTransitionEventType = {}));
|
|
2378
2453
|
|
|
2379
2454
|
/**
|
|
@@ -2442,10 +2517,142 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
|
|
|
2442
2517
|
type: Injectable
|
|
2443
2518
|
}], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }]; } });
|
|
2444
2519
|
|
|
2520
|
+
/**
|
|
2521
|
+
* Router service definition that provides high level information about router transitions.
|
|
2522
|
+
*/
|
|
2523
|
+
class DbxRouterTransitionService {
|
|
2524
|
+
}
|
|
2525
|
+
|
|
2445
2526
|
/**
|
|
2446
2527
|
* Router service definition that can route the app and provide routing details.
|
|
2447
2528
|
*/
|
|
2448
|
-
class DbxRouterService {
|
|
2529
|
+
class DbxRouterService extends DbxRouterTransitionService {
|
|
2530
|
+
}
|
|
2531
|
+
|
|
2532
|
+
/**
|
|
2533
|
+
* Convenience function for filtering success from the input observable.
|
|
2534
|
+
*
|
|
2535
|
+
* @param obs
|
|
2536
|
+
* @returns
|
|
2537
|
+
*/
|
|
2538
|
+
function successTransition(obs) {
|
|
2539
|
+
return obs.pipe(filterTransitionSuccess());
|
|
2540
|
+
}
|
|
2541
|
+
function filterTransitionSuccess() {
|
|
2542
|
+
return filterTransitionEvent(DbxRouterTransitionEventType.SUCCESS);
|
|
2543
|
+
}
|
|
2544
|
+
function filterTransitionEvent(type) {
|
|
2545
|
+
return filter((x) => x.type === type);
|
|
2546
|
+
}
|
|
2547
|
+
/**
|
|
2548
|
+
* Creates a new observable that uses the input DbxRouterTransitionService and DbxRouterService to determine whether or not any of the configured routes are active.
|
|
2549
|
+
*
|
|
2550
|
+
* @param obs
|
|
2551
|
+
* @param config
|
|
2552
|
+
* @returns
|
|
2553
|
+
*/
|
|
2554
|
+
function isLatestSuccessfulRoute(config) {
|
|
2555
|
+
const { dbxRouterTransitionService, dbxRouterService, activeExactly } = config;
|
|
2556
|
+
const routes = asArray(config.routes);
|
|
2557
|
+
const checkRoute = activeExactly ? (route) => dbxRouterService.isActiveExactly(route) : (route) => dbxRouterService.isActive(route);
|
|
2558
|
+
return successTransition(dbxRouterTransitionService.transitions$).pipe(startWith(undefined), map(() => {
|
|
2559
|
+
const isActive = routes.findIndex(checkRoute) !== -1;
|
|
2560
|
+
return isActive;
|
|
2561
|
+
}), distinctUntilChanged(), shareReplay(1));
|
|
2562
|
+
}
|
|
2563
|
+
|
|
2564
|
+
/**
|
|
2565
|
+
* Abstract directive that listens to onSuccess transition events and runs a function.
|
|
2566
|
+
*/
|
|
2567
|
+
class AbstractTransitionDirective {
|
|
2568
|
+
constructor(dbxRouterTransitionService) {
|
|
2569
|
+
this.dbxRouterTransitionService = dbxRouterTransitionService;
|
|
2570
|
+
this.transitionSuccess$ = successTransition(this.dbxRouterTransitionService.transitions$);
|
|
2571
|
+
this.initAndUpdateOnTransitionSuccess$ = this.transitionSuccess$.pipe(startWith(undefined));
|
|
2572
|
+
}
|
|
2573
|
+
}
|
|
2574
|
+
AbstractTransitionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: AbstractTransitionDirective, deps: [{ token: DbxRouterTransitionService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2575
|
+
AbstractTransitionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.2", type: AbstractTransitionDirective, ngImport: i0 });
|
|
2576
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: AbstractTransitionDirective, decorators: [{
|
|
2577
|
+
type: Directive
|
|
2578
|
+
}], ctorParameters: function () { return [{ type: DbxRouterTransitionService }]; } });
|
|
2579
|
+
|
|
2580
|
+
/**
|
|
2581
|
+
* Abstract directive that listens to onSuccess transition events and runs a function.
|
|
2582
|
+
*/
|
|
2583
|
+
class AbstractTransitionWatcherDirective extends AbstractTransitionDirective {
|
|
2584
|
+
constructor(dbxRouterTransitionService, ngZone) {
|
|
2585
|
+
super(dbxRouterTransitionService);
|
|
2586
|
+
this.ngZone = ngZone;
|
|
2587
|
+
this._transitionSub = new SubscriptionObject();
|
|
2588
|
+
}
|
|
2589
|
+
ngOnInit() {
|
|
2590
|
+
this._transitionSub.subscription = this.transitionSuccess$.subscribe(() => {
|
|
2591
|
+
this.updateForSuccessfulTransition();
|
|
2592
|
+
});
|
|
2593
|
+
}
|
|
2594
|
+
ngOnDestroy() {
|
|
2595
|
+
this._transitionSub.destroy();
|
|
2596
|
+
}
|
|
2597
|
+
// MARK: Action
|
|
2598
|
+
zoneUpdateForSuccessfulTransition() {
|
|
2599
|
+
this.ngZone.run(() => this.updateForSuccessfulTransition());
|
|
2600
|
+
}
|
|
2601
|
+
}
|
|
2602
|
+
AbstractTransitionWatcherDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: AbstractTransitionWatcherDirective, deps: [{ token: DbxRouterTransitionService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2603
|
+
AbstractTransitionWatcherDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.2", type: AbstractTransitionWatcherDirective, usesInheritance: true, ngImport: i0 });
|
|
2604
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: AbstractTransitionWatcherDirective, decorators: [{
|
|
2605
|
+
type: Directive
|
|
2606
|
+
}], ctorParameters: function () { return [{ type: DbxRouterTransitionService }, { type: i0.NgZone }]; } });
|
|
2607
|
+
|
|
2608
|
+
/**
|
|
2609
|
+
* Creates an IsSegueRefActiveFunction
|
|
2610
|
+
*
|
|
2611
|
+
* @param config
|
|
2612
|
+
* @returns
|
|
2613
|
+
*/
|
|
2614
|
+
function isSegueRefActiveFunction(config) {
|
|
2615
|
+
const { dbxRouterService, segueRef, activeExactly = false } = config;
|
|
2616
|
+
const result = (activeExactly ? () => dbxRouterService.isActiveExactly(segueRef) : () => dbxRouterService.isActive(segueRef));
|
|
2617
|
+
result._segueRef = segueRef;
|
|
2618
|
+
result._activeExactly = activeExactly;
|
|
2619
|
+
return result;
|
|
2620
|
+
}
|
|
2621
|
+
|
|
2622
|
+
// MARK: Transition Events
|
|
2623
|
+
function onRouterTransitionEventType(events$, type) {
|
|
2624
|
+
return events$.pipe(filter((x) => x.type === type));
|
|
2625
|
+
}
|
|
2626
|
+
function onRouterTransitionSuccessEvent(events$) {
|
|
2627
|
+
return onRouterTransitionEventType(events$, DbxRouterTransitionEventType.SUCCESS);
|
|
2628
|
+
}
|
|
2629
|
+
// MARK: Router Service
|
|
2630
|
+
/**
|
|
2631
|
+
* Creates an observable that returns true when the route for the input segueRef is active.
|
|
2632
|
+
*
|
|
2633
|
+
* @param dbxRouterService
|
|
2634
|
+
* @param segueRef
|
|
2635
|
+
*/
|
|
2636
|
+
function isSegueRefActiveOnTransitionSuccess(config) {
|
|
2637
|
+
const isActiveFn = isSegueRefActiveFunction(config);
|
|
2638
|
+
return onRouterTransitionSuccessEvent(config.dbxRouterService.transitions$).pipe(startWith(undefined), map(() => isActiveFn()));
|
|
2639
|
+
}
|
|
2640
|
+
/**
|
|
2641
|
+
* Operator function that maps the input segueRef to a boolean depending on the current route state.
|
|
2642
|
+
*
|
|
2643
|
+
* @param dbxRouterService
|
|
2644
|
+
* @param segueRef
|
|
2645
|
+
*/
|
|
2646
|
+
function isSegueRefActive(config) {
|
|
2647
|
+
const { defaultIfNull = false } = config;
|
|
2648
|
+
return switchMap((segueRef) => {
|
|
2649
|
+
if (segueRef) {
|
|
2650
|
+
return isSegueRefActiveOnTransitionSuccess(Object.assign(Object.assign({}, config), { segueRef }));
|
|
2651
|
+
}
|
|
2652
|
+
else {
|
|
2653
|
+
return of(defaultIfNull);
|
|
2654
|
+
}
|
|
2655
|
+
});
|
|
2449
2656
|
}
|
|
2450
2657
|
|
|
2451
2658
|
/**
|
|
@@ -2460,12 +2667,6 @@ function goWithRouter(dbxRouterService) {
|
|
|
2460
2667
|
};
|
|
2461
2668
|
}
|
|
2462
2669
|
|
|
2463
|
-
/**
|
|
2464
|
-
* Router service definition that provides high level information about router transitions.
|
|
2465
|
-
*/
|
|
2466
|
-
class DbxRouterTransitionService {
|
|
2467
|
-
}
|
|
2468
|
-
|
|
2469
2670
|
class DbxCoreAngularRouterSegueModule {
|
|
2470
2671
|
static forRoot() {
|
|
2471
2672
|
return {
|
|
@@ -2605,82 +2806,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
|
|
|
2605
2806
|
args: [{}]
|
|
2606
2807
|
}] });
|
|
2607
2808
|
|
|
2608
|
-
/**
|
|
2609
|
-
* Convenience function for filtering success from the input observable.
|
|
2610
|
-
*
|
|
2611
|
-
* @param obs
|
|
2612
|
-
* @returns
|
|
2613
|
-
*/
|
|
2614
|
-
function successTransition(obs) {
|
|
2615
|
-
return obs.pipe(filterTransitionSuccess());
|
|
2616
|
-
}
|
|
2617
|
-
function filterTransitionSuccess() {
|
|
2618
|
-
return filterTransitionEvent(DbxRouterTransitionEventType.SUCCESS);
|
|
2619
|
-
}
|
|
2620
|
-
function filterTransitionEvent(type) {
|
|
2621
|
-
return filter((x) => x.type === type);
|
|
2622
|
-
}
|
|
2623
|
-
/**
|
|
2624
|
-
* Creates a new observable that uses the input DbxRouterTransitionService and DbxRouterService to determine whether or not any of the configured routes are active.
|
|
2625
|
-
*
|
|
2626
|
-
* @param obs
|
|
2627
|
-
* @param config
|
|
2628
|
-
* @returns
|
|
2629
|
-
*/
|
|
2630
|
-
function isLatestSuccessfulRoute(config) {
|
|
2631
|
-
const { dbxRouterTransitionService, dbxRouterService, activeExactly } = config;
|
|
2632
|
-
const routes = asArray(config.routes);
|
|
2633
|
-
const checkRoute = activeExactly ? (route) => dbxRouterService.isActiveExactly(route) : (route) => dbxRouterService.isActive(route);
|
|
2634
|
-
return successTransition(dbxRouterTransitionService.transitions$).pipe(startWith(undefined), map(() => {
|
|
2635
|
-
const isActive = routes.findIndex(checkRoute) !== -1;
|
|
2636
|
-
return isActive;
|
|
2637
|
-
}), distinctUntilChanged(), shareReplay(1));
|
|
2638
|
-
}
|
|
2639
|
-
|
|
2640
|
-
/**
|
|
2641
|
-
* Abstract directive that listens to onSuccess transition events and runs a function.
|
|
2642
|
-
*/
|
|
2643
|
-
class AbstractTransitionDirective {
|
|
2644
|
-
constructor(dbxRouterTransitionService) {
|
|
2645
|
-
this.dbxRouterTransitionService = dbxRouterTransitionService;
|
|
2646
|
-
this.transitionSuccess$ = successTransition(this.dbxRouterTransitionService.transitions$);
|
|
2647
|
-
this.initAndUpdateOnTransitionSuccess$ = this.transitionSuccess$.pipe(startWith(undefined));
|
|
2648
|
-
}
|
|
2649
|
-
}
|
|
2650
|
-
AbstractTransitionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: AbstractTransitionDirective, deps: [{ token: DbxRouterTransitionService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2651
|
-
AbstractTransitionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.2", type: AbstractTransitionDirective, ngImport: i0 });
|
|
2652
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: AbstractTransitionDirective, decorators: [{
|
|
2653
|
-
type: Directive
|
|
2654
|
-
}], ctorParameters: function () { return [{ type: DbxRouterTransitionService }]; } });
|
|
2655
|
-
|
|
2656
|
-
/**
|
|
2657
|
-
* Abstract directive that listens to onSuccess transition events and runs a function.
|
|
2658
|
-
*/
|
|
2659
|
-
class AbstractTransitionWatcherDirective extends AbstractTransitionDirective {
|
|
2660
|
-
constructor(dbxRouterTransitionService, ngZone) {
|
|
2661
|
-
super(dbxRouterTransitionService);
|
|
2662
|
-
this.ngZone = ngZone;
|
|
2663
|
-
this._transitionSub = new SubscriptionObject();
|
|
2664
|
-
}
|
|
2665
|
-
ngOnInit() {
|
|
2666
|
-
this._transitionSub.subscription = this.transitionSuccess$.subscribe(() => {
|
|
2667
|
-
this.updateForSuccessfulTransition();
|
|
2668
|
-
});
|
|
2669
|
-
}
|
|
2670
|
-
ngOnDestroy() {
|
|
2671
|
-
this._transitionSub.destroy();
|
|
2672
|
-
}
|
|
2673
|
-
// MARK: Action
|
|
2674
|
-
zoneUpdateForSuccessfulTransition() {
|
|
2675
|
-
this.ngZone.run(() => this.updateForSuccessfulTransition());
|
|
2676
|
-
}
|
|
2677
|
-
}
|
|
2678
|
-
AbstractTransitionWatcherDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: AbstractTransitionWatcherDirective, deps: [{ token: DbxRouterTransitionService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2679
|
-
AbstractTransitionWatcherDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.2", type: AbstractTransitionWatcherDirective, usesInheritance: true, ngImport: i0 });
|
|
2680
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: AbstractTransitionWatcherDirective, decorators: [{
|
|
2681
|
-
type: Directive
|
|
2682
|
-
}], ctorParameters: function () { return [{ type: DbxRouterTransitionService }, { type: i0.NgZone }]; } });
|
|
2683
|
-
|
|
2684
2809
|
/**
|
|
2685
2810
|
* Utility class used for reading a single value from the DbxRouterService.
|
|
2686
2811
|
*/
|
|
@@ -3826,68 +3951,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
|
|
|
3826
3951
|
}]
|
|
3827
3952
|
}] });
|
|
3828
3953
|
|
|
3829
|
-
/**
|
|
3830
|
-
* Abstract FilterSource implementation.
|
|
3831
|
-
*/
|
|
3832
|
-
class AbstractFilterSourceDirective {
|
|
3833
|
-
constructor() {
|
|
3834
|
-
this._defaultFilterSource = new FilterSourceInstance();
|
|
3835
|
-
this.filter$ = this._defaultFilterSource.filter$;
|
|
3836
|
-
}
|
|
3837
|
-
ngOnInit() {
|
|
3838
|
-
this._defaultFilterSource.setDefaultFilter(this.makeDefaultFilter());
|
|
3839
|
-
}
|
|
3840
|
-
ngOnDestroy() {
|
|
3841
|
-
this._defaultFilterSource.destroy();
|
|
3842
|
-
}
|
|
3843
|
-
initWithFilter(filterObs) {
|
|
3844
|
-
this._defaultFilterSource.initWithFilter(filterObs);
|
|
3845
|
-
}
|
|
3846
|
-
setFilter(filter) {
|
|
3847
|
-
this._defaultFilterSource.setFilter(filter);
|
|
3848
|
-
}
|
|
3849
|
-
resetFilter() {
|
|
3850
|
-
this._defaultFilterSource.resetFilter();
|
|
3851
|
-
}
|
|
3852
|
-
// MARK: Internal
|
|
3853
|
-
makeDefaultFilter() {
|
|
3854
|
-
return of(undefined);
|
|
3855
|
-
}
|
|
3856
|
-
}
|
|
3857
|
-
AbstractFilterSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: AbstractFilterSourceDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
3858
|
-
AbstractFilterSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.2", type: AbstractFilterSourceDirective, ngImport: i0 });
|
|
3859
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: AbstractFilterSourceDirective, decorators: [{
|
|
3860
|
-
type: Directive
|
|
3861
|
-
}] });
|
|
3862
|
-
|
|
3863
|
-
/**
|
|
3864
|
-
* Abstract filter source for components that use an action to filter.
|
|
3865
|
-
*/
|
|
3866
|
-
class AbstractActionFilterSourceDirective extends AbstractFilterSourceDirective {
|
|
3867
|
-
constructor() {
|
|
3868
|
-
super(...arguments);
|
|
3869
|
-
/**
|
|
3870
|
-
* Pre-set action handler for the template to use to set the filter.
|
|
3871
|
-
*/
|
|
3872
|
-
this.setFilterAction = (filter) => {
|
|
3873
|
-
this.setFilter(filter);
|
|
3874
|
-
return of(true);
|
|
3875
|
-
};
|
|
3876
|
-
}
|
|
3877
|
-
applyFilter() {
|
|
3878
|
-
this.filterAction.setIsModified(true); // Force setting modified.
|
|
3879
|
-
this.filterAction.trigger();
|
|
3880
|
-
}
|
|
3881
|
-
}
|
|
3882
|
-
AbstractActionFilterSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: AbstractActionFilterSourceDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
3883
|
-
AbstractActionFilterSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.2", type: AbstractActionFilterSourceDirective, viewQueries: [{ propertyName: "filterAction", first: true, predicate: DbxActionContextStoreSourceInstance, descendants: true, read: DbxActionContextStoreSourceInstance, static: true }], usesInheritance: true, ngImport: i0 });
|
|
3884
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: AbstractActionFilterSourceDirective, decorators: [{
|
|
3885
|
-
type: Directive
|
|
3886
|
-
}], propDecorators: { filterAction: [{
|
|
3887
|
-
type: ViewChild,
|
|
3888
|
-
args: [DbxActionContextStoreSourceInstance, { static: true, read: DbxActionContextStoreSourceInstance }]
|
|
3889
|
-
}] } });
|
|
3890
|
-
|
|
3891
3954
|
/**
|
|
3892
3955
|
* Abstract FilterSourceConnector directive.
|
|
3893
3956
|
*/
|
|
@@ -3936,6 +3999,79 @@ function provideFilterSourceConnector(sourceType) {
|
|
|
3936
3999
|
];
|
|
3937
4000
|
}
|
|
3938
4001
|
|
|
4002
|
+
class FilterSourceDirective {
|
|
4003
|
+
}
|
|
4004
|
+
/**
|
|
4005
|
+
* Angular provider convenience function for a FilterSourceDirective.
|
|
4006
|
+
*/
|
|
4007
|
+
function provideFilterSourceDirective(sourceType) {
|
|
4008
|
+
return [
|
|
4009
|
+
{
|
|
4010
|
+
provide: FilterSourceDirective,
|
|
4011
|
+
useExisting: forwardRef(() => sourceType)
|
|
4012
|
+
},
|
|
4013
|
+
...provideFilterSource(sourceType)
|
|
4014
|
+
];
|
|
4015
|
+
}
|
|
4016
|
+
/**
|
|
4017
|
+
* Abstract FilterSource implementation and directive.
|
|
4018
|
+
*/
|
|
4019
|
+
class AbstractFilterSourceDirective {
|
|
4020
|
+
constructor() {
|
|
4021
|
+
this._defaultFilterSource = new FilterSourceInstance();
|
|
4022
|
+
this.filter$ = this._defaultFilterSource.filter$;
|
|
4023
|
+
}
|
|
4024
|
+
ngOnInit() {
|
|
4025
|
+
this._defaultFilterSource.setDefaultFilter(this.makeDefaultFilter());
|
|
4026
|
+
}
|
|
4027
|
+
ngOnDestroy() {
|
|
4028
|
+
this._defaultFilterSource.destroy();
|
|
4029
|
+
}
|
|
4030
|
+
initWithFilter(filterObs) {
|
|
4031
|
+
this._defaultFilterSource.initWithFilter(filterObs);
|
|
4032
|
+
}
|
|
4033
|
+
setFilter(filter) {
|
|
4034
|
+
this._defaultFilterSource.setFilter(filter);
|
|
4035
|
+
}
|
|
4036
|
+
resetFilter() {
|
|
4037
|
+
this._defaultFilterSource.resetFilter();
|
|
4038
|
+
}
|
|
4039
|
+
// MARK: Internal
|
|
4040
|
+
makeDefaultFilter() {
|
|
4041
|
+
return of(this.defaultFilterValue);
|
|
4042
|
+
}
|
|
4043
|
+
}
|
|
4044
|
+
AbstractFilterSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: AbstractFilterSourceDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4045
|
+
AbstractFilterSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.2", type: AbstractFilterSourceDirective, ngImport: i0 });
|
|
4046
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: AbstractFilterSourceDirective, decorators: [{
|
|
4047
|
+
type: Directive
|
|
4048
|
+
}] });
|
|
4049
|
+
|
|
4050
|
+
/**
|
|
4051
|
+
* Connects the host FilterSource to a FilterSourceConnector.
|
|
4052
|
+
*/
|
|
4053
|
+
class DbxFilterConnectSourceDirective {
|
|
4054
|
+
constructor(filterSource, filterSourceConnector) {
|
|
4055
|
+
this.filterSource = filterSource;
|
|
4056
|
+
this.filterSourceConnector = filterSourceConnector;
|
|
4057
|
+
}
|
|
4058
|
+
ngOnInit() {
|
|
4059
|
+
this.filterSourceConnector.connectWithSource(this.filterSource);
|
|
4060
|
+
}
|
|
4061
|
+
}
|
|
4062
|
+
DbxFilterConnectSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxFilterConnectSourceDirective, deps: [{ token: i1$5.FilterSource, host: true }, { token: i1$5.FilterSourceConnector }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4063
|
+
DbxFilterConnectSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.2", type: DbxFilterConnectSourceDirective, selector: "[dbxFilterConnectSource]", ngImport: i0 });
|
|
4064
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxFilterConnectSourceDirective, decorators: [{
|
|
4065
|
+
type: Directive,
|
|
4066
|
+
args: [{
|
|
4067
|
+
selector: '[dbxFilterConnectSource]'
|
|
4068
|
+
}]
|
|
4069
|
+
}], ctorParameters: function () {
|
|
4070
|
+
return [{ type: i1$5.FilterSource, decorators: [{
|
|
4071
|
+
type: Host
|
|
4072
|
+
}] }, { type: i1$5.FilterSourceConnector }];
|
|
4073
|
+
} });
|
|
4074
|
+
|
|
3939
4075
|
/**
|
|
3940
4076
|
* Used as a FilterSource and FilterSourceConnector.
|
|
3941
4077
|
*/
|
|
@@ -3990,13 +4126,13 @@ class DbxFilterMapSourceDirective extends AbstractDbxFilterMapInstanceDirective
|
|
|
3990
4126
|
}
|
|
3991
4127
|
}
|
|
3992
4128
|
DbxFilterMapSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxFilterMapSourceDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
3993
|
-
DbxFilterMapSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.2", type: DbxFilterMapSourceDirective, selector: "[dbxFilterMapSource]", inputs: { key: ["dbxFilterMapSource", "key"] }, providers: [
|
|
4129
|
+
DbxFilterMapSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.2", type: DbxFilterMapSourceDirective, selector: "[dbxFilterMapSource]", inputs: { key: ["dbxFilterMapSource", "key"] }, providers: [provideFilterSource(DbxFilterMapSourceDirective)], exportAs: ["dbxFilterMapSource"], usesInheritance: true, ngImport: i0 });
|
|
3994
4130
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxFilterMapSourceDirective, decorators: [{
|
|
3995
4131
|
type: Directive,
|
|
3996
4132
|
args: [{
|
|
3997
4133
|
selector: '[dbxFilterMapSource]',
|
|
3998
4134
|
exportAs: 'dbxFilterMapSource',
|
|
3999
|
-
providers: [
|
|
4135
|
+
providers: [provideFilterSource(DbxFilterMapSourceDirective)]
|
|
4000
4136
|
}]
|
|
4001
4137
|
}], propDecorators: { key: [{
|
|
4002
4138
|
type: Input,
|
|
@@ -4060,26 +4196,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
|
|
|
4060
4196
|
class DbxFilterSourceDirective extends AbstractFilterSourceDirective {
|
|
4061
4197
|
}
|
|
4062
4198
|
DbxFilterSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxFilterSourceDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
4063
|
-
DbxFilterSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.2", type: DbxFilterSourceDirective, selector: "[dbxFilterSource]", providers:
|
|
4199
|
+
DbxFilterSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.2", type: DbxFilterSourceDirective, selector: "[dbxFilterSource]", providers: provideFilterSourceDirective(DbxFilterSourceDirective), usesInheritance: true, ngImport: i0 });
|
|
4064
4200
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxFilterSourceDirective, decorators: [{
|
|
4065
4201
|
type: Directive,
|
|
4066
4202
|
args: [{
|
|
4067
4203
|
selector: '[dbxFilterSource]',
|
|
4068
|
-
providers:
|
|
4204
|
+
providers: provideFilterSourceDirective(DbxFilterSourceDirective)
|
|
4069
4205
|
}]
|
|
4070
4206
|
}] });
|
|
4071
4207
|
|
|
4072
4208
|
class DbxCoreFilterModule {
|
|
4073
4209
|
}
|
|
4074
4210
|
DbxCoreFilterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxCoreFilterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4075
|
-
DbxCoreFilterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.2", ngImport: i0, type: DbxCoreFilterModule, declarations: [DbxFilterSourceDirective, DbxFilterSourceConnectorDirective, DbxFilterMapDirective, DbxFilterMapSourceConnectorDirective, DbxFilterMapSourceDirective], imports: [CommonModule], exports: [DbxFilterSourceDirective, DbxFilterSourceConnectorDirective, DbxFilterMapDirective, DbxFilterMapSourceConnectorDirective, DbxFilterMapSourceDirective] });
|
|
4211
|
+
DbxCoreFilterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.2", ngImport: i0, type: DbxCoreFilterModule, declarations: [DbxFilterSourceDirective, DbxFilterConnectSourceDirective, DbxFilterSourceConnectorDirective, DbxFilterMapDirective, DbxFilterMapSourceConnectorDirective, DbxFilterMapSourceDirective], imports: [CommonModule], exports: [DbxFilterSourceDirective, DbxFilterConnectSourceDirective, DbxFilterSourceConnectorDirective, DbxFilterMapDirective, DbxFilterMapSourceConnectorDirective, DbxFilterMapSourceDirective] });
|
|
4076
4212
|
DbxCoreFilterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxCoreFilterModule, imports: [CommonModule] });
|
|
4077
4213
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxCoreFilterModule, decorators: [{
|
|
4078
4214
|
type: NgModule,
|
|
4079
4215
|
args: [{
|
|
4080
4216
|
imports: [CommonModule],
|
|
4081
|
-
declarations: [DbxFilterSourceDirective, DbxFilterSourceConnectorDirective, DbxFilterMapDirective, DbxFilterMapSourceConnectorDirective, DbxFilterMapSourceDirective],
|
|
4082
|
-
exports: [DbxFilterSourceDirective, DbxFilterSourceConnectorDirective, DbxFilterMapDirective, DbxFilterMapSourceConnectorDirective, DbxFilterMapSourceDirective]
|
|
4217
|
+
declarations: [DbxFilterSourceDirective, DbxFilterConnectSourceDirective, DbxFilterSourceConnectorDirective, DbxFilterMapDirective, DbxFilterMapSourceConnectorDirective, DbxFilterMapSourceDirective],
|
|
4218
|
+
exports: [DbxFilterSourceDirective, DbxFilterConnectSourceDirective, DbxFilterSourceConnectorDirective, DbxFilterMapDirective, DbxFilterMapSourceConnectorDirective, DbxFilterMapSourceDirective]
|
|
4083
4219
|
}]
|
|
4084
4220
|
}] });
|
|
4085
4221
|
|
|
@@ -4866,5 +5002,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
|
|
|
4866
5002
|
* Generated bundle index. Do not edit.
|
|
4867
5003
|
*/
|
|
4868
5004
|
|
|
4869
|
-
export { APP_ACTION_DISABLED_DIRECTIVE_KEY, APP_ACTION_DISABLED_ON_SUCCESS_DIRECTIVE_KEY, APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY,
|
|
5005
|
+
export { APP_ACTION_DISABLED_DIRECTIVE_KEY, APP_ACTION_DISABLED_ON_SUCCESS_DIRECTIVE_KEY, APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY, AbstractDbxActionHandlerDirective, AbstractDbxActionValueOnTriggerDirective, AbstractDbxAnchorDirective, AbstractDbxButtonDirective, AbstractDbxFilterMapInstanceDirective, AbstractDbxInjectionDirective, AbstractFilterSourceConnectorDirective, AbstractFilterSourceDirective, AbstractForwardDbxInjectionContextDirective, AbstractIfDirective, AbstractLockSetSubscriptionDirective, AbstractSubscriptionDirective, AbstractTransitionDirective, AbstractTransitionWatcherDirective, ActionContextStore, ActionContextStoreSource, ActionContextStoreSourceMap, AnchorType, DBX_ACTION_HANDLER_LOCK_KEY, 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_REDIRECT_FOR_USER_IDENTIFIER_PARAM_KEY, DEFAULT_REDIRECT_FOR_USER_IDENTIFIER_PARAM_VALUE, DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN, DEFAULT_STORAGE_OBJECT_TOKEN, DateDistancePipe, DateFormatDistancePipe, DateFromToTimePipe, DbxActionAutoModifyDirective, DbxActionAutoTriggerDirective, DbxActionButtonDirective, DbxActionButtonTriggerDirective, DbxActionContextBaseSource, DbxActionContextLoggerDirective, DbxActionContextMachine, DbxActionContextMachineAsService, DbxActionContextMapDirective, DbxActionContextMapDirectiveSourceInstance, DbxActionContextStoreSourceInstance, DbxActionDirective, DbxActionDisabledDirective, DbxActionDisabledOnSuccessDirective, DbxActionEnforceModifiedDirective, DbxActionFromMapDirective, DbxActionHandlerDirective, DbxActionHandlerInstance, DbxActionHasSuccessDirective, DbxActionIsWorkingDirective, DbxActionMapSourceDirective, DbxActionMapWorkingDisableDirective, DbxActionPreSuccessDirective, DbxActionSourceDirective, DbxActionState, DbxActionSuccessHandlerDirective, DbxActionValueDirective, DbxActionValueOnTriggerInstance, DbxActionValueTriggerDirective, DbxActionWorkInstanceDelegate, DbxAnchor, DbxAngularRouterService, DbxAppAuthRouterEffects, DbxAppAuthRouterModule, DbxAppAuthRouterService, DbxAppAuthRouterStateModule, DbxAppAuthRoutes, DbxAppAuthStateModule, DbxAppAuthStateService, DbxAppContextService, DbxAppContextStateDirective, DbxAppContextStateModule, DbxAuthHasAnyRoleDirective, DbxAuthHasRolesDirective, DbxAuthNotAnyRolesDirective, DbxAuthService, DbxButton, DbxButtonDirective, DbxButtonSegueDirective, DbxCoreActionModule, DbxCoreAngularRouterSegueModule, DbxCoreAuthModule, DbxCoreButtonModule, DbxCoreFilterModule, DbxCoreUIRouterSegueModule, DbxDatePipeModule, DbxFilterConnectSourceDirective, DbxFilterMapDirective, DbxFilterMapSourceConnectorDirective, DbxFilterMapSourceDirective, DbxFilterSourceConnectorDirective, DbxFilterSourceDirective, DbxInjectionComponent, DbxInjectionComponentModule, DbxInjectionContext, DbxInjectionContextDirective, DbxInjectionInstance, DbxLoadingButtonDirective, DbxMiscPipeModule, DbxPipesModule, DbxRouteParamDefaultRedirectInstance, DbxRouteParamReaderInstance, DbxRouterService, DbxRouterTransitionEventType, DbxRouterTransitionService, DbxStorageModule, DbxUIRouterService, FilterSourceDirective, 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, actionContextStoreSourceMachineFactory, actionContextStoreSourcePipe, anchorTypeForAnchor, asSegueRef, asSegueRefString, authRolesSetContainsAllRolesFrom, authRolesSetContainsAnyRoleFrom, authRolesSetContainsNoRolesFrom, authUserIdentifier, canReadyValue, canTriggerAction, canTriggerActionState, checkNgContentWrapperHasContent, clickableUrlInNewTab, dbxActionValueStreamDirective, defaultStorageObjectFactory, enableHasAuthRoleHook, enableHasAuthStateHook, enableIsLoggedInHook, expandClickableAnchorLinkTree, expandClickableAnchorLinkTreeNode, expandClickableAnchorLinkTrees, filterTransitionEvent, filterTransitionSuccess, flattenExpandedClickableAnchorLinkTree, flattenExpandedClickableAnchorLinkTreeToLinks, index as fromDbxAppAuth, index$2 as fromDbxAppContext, goWithRouter, isActionContextDisabled, isActionContextEnabled, isDisabledActionContextState, isIdleActionState, isLatestSuccessfulRoute, isSegueRef, isSegueRefActive, isSegueRefActiveFunction, isSegueRefActiveOnTransitionSuccess, isWorkingActionState, loadingStateForActionContextState, loadingStateTypeForActionContextState, loadingStateTypeForActionState, loggedInObsFromIsLoggedIn, loggedOutObsFromIsLoggedIn, makeAuthTransitionHook, makeDbxActionContextSourceReference, mapRefStringObsToSegueRefObs, mergeDbxInjectionComponentConfigs, index$1 as onDbxAppAuth, index$3 as onDbxAppContext, onRouterTransitionEventType, onRouterTransitionSuccessEvent, pipeActionStore, provideActionStoreSource, provideDbxAnchor, provideDbxButton, provideDbxInjectionContext, provideFilterSource, provideFilterSourceConnector, provideFilterSourceDirective, provideSecondaryActionStoreSource, redirectBasedOnAuthUserState, redirectForUserIdentifierParamHook, refStringToSegueRef, safeDetectChanges, safeMarkForCheck, safeUseCdRef, successTransition, tapDetectChanges, tapSafeMarkForCheck, useActionStore };
|
|
4870
5006
|
//# sourceMappingURL=dereekb-dbx-core.mjs.map
|