@dereekb/dbx-core 9.15.7 → 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.
Files changed (58) hide show
  1. package/esm2020/lib/action/action.holder.mjs +1 -1
  2. package/esm2020/lib/action/action.machine.mjs +30 -7
  3. package/esm2020/lib/action/action.store.source.mjs +2 -30
  4. package/esm2020/lib/action/action.store.source.provide.mjs +41 -0
  5. package/esm2020/lib/action/directive/context/action.directive.mjs +3 -2
  6. package/esm2020/lib/action/directive/context/action.source.directive.mjs +3 -2
  7. package/esm2020/lib/action/directive/map/action.map.key.directive.mjs +2 -2
  8. package/esm2020/lib/action/directive/state/action.handler.directive.mjs +27 -34
  9. package/esm2020/lib/action/directive/state/action.handler.instance.mjs +40 -0
  10. package/esm2020/lib/action/directive/state/index.mjs +2 -1
  11. package/esm2020/lib/action/index.mjs +2 -1
  12. package/esm2020/lib/filter/filter.abstract.source.directive.mjs +19 -4
  13. package/esm2020/lib/filter/filter.connect.source.directive.mjs +27 -0
  14. package/esm2020/lib/filter/filter.map.source.directive.mjs +3 -3
  15. package/esm2020/lib/filter/filter.module.mjs +5 -4
  16. package/esm2020/lib/filter/filter.preset.mjs +2 -0
  17. package/esm2020/lib/filter/filter.source.directive.mjs +4 -5
  18. package/esm2020/lib/filter/index.mjs +3 -2
  19. package/esm2020/lib/router/anchor/anchor.directive.mjs +14 -3
  20. package/esm2020/lib/router/anchor/anchor.mjs +1 -1
  21. package/esm2020/lib/router/anchor/clickable.mjs +7 -2
  22. package/esm2020/lib/router/router/provider/uirouter/uirouter.router.service.mjs +1 -1
  23. package/esm2020/lib/router/router/service/index.mjs +3 -1
  24. package/esm2020/lib/router/router/service/router.service.mjs +3 -2
  25. package/esm2020/lib/router/router/service/router.service.rxjs.mjs +39 -0
  26. package/esm2020/lib/router/router/service/router.service.util.mjs +14 -0
  27. package/esm2020/lib/router/router/transition/transition.mjs +2 -2
  28. package/fesm2015/dereekb-dbx-core.mjs +403 -260
  29. package/fesm2015/dereekb-dbx-core.mjs.map +1 -1
  30. package/fesm2020/dereekb-dbx-core.mjs +399 -258
  31. package/fesm2020/dereekb-dbx-core.mjs.map +1 -1
  32. package/lib/action/action.holder.d.ts +1 -1
  33. package/lib/action/action.machine.d.ts +14 -1
  34. package/lib/action/action.store.source.d.ts +1 -7
  35. package/lib/action/action.store.source.provide.d.ts +10 -0
  36. package/lib/action/directive/state/action.handler.directive.d.ts +14 -9
  37. package/lib/action/directive/state/action.handler.instance.d.ts +19 -0
  38. package/lib/action/directive/state/index.d.ts +1 -0
  39. package/lib/action/index.d.ts +1 -0
  40. package/lib/filter/filter.abstract.source.directive.d.ts +14 -3
  41. package/lib/filter/filter.connect.source.directive.d.ts +14 -0
  42. package/lib/filter/filter.map.source.directive.d.ts +1 -1
  43. package/lib/filter/filter.module.d.ts +7 -6
  44. package/lib/filter/filter.preset.d.ts +11 -0
  45. package/lib/filter/index.d.ts +2 -1
  46. package/lib/router/anchor/anchor.d.ts +3 -0
  47. package/lib/router/anchor/anchor.directive.d.ts +5 -1
  48. package/lib/router/anchor/clickable.d.ts +2 -1
  49. package/lib/router/router/service/index.d.ts +2 -0
  50. package/lib/router/router/service/router.service.d.ts +2 -1
  51. package/lib/router/router/service/router.service.rxjs.d.ts +27 -0
  52. package/lib/router/router/service/router.service.util.d.ts +26 -0
  53. package/lib/router/router/transition/transition.d.ts +1 -1
  54. package/package.json +4 -4
  55. package/esm2020/lib/filter/action/action.filter.source.directive.mjs +0 -33
  56. package/esm2020/lib/filter/action/index.mjs +0 -2
  57. package/lib/filter/action/action.filter.source.directive.d.ts +0 -17
  58. package/lib/filter/action/index.d.ts +0 -1
@@ -7,7 +7,7 @@ import { DbxActionDisabledKey } from './action';
7
7
  /**
8
8
  * Abstract class that can either use SecondaryActionContextStoreSource or create it's own.
9
9
  */
10
- export declare class DbxActionContextBaseSource<T = unknown, O = unknown> implements ActionContextStoreSource<T, O>, Destroyable {
10
+ export declare abstract class DbxActionContextBaseSource<T = unknown, O = unknown> implements ActionContextStoreSource<T, O>, Destroyable {
11
11
  readonly inputSource?: SecondaryActionContextStoreSource<T, O> | undefined;
12
12
  private readonly _store?;
13
13
  private readonly _store$;
@@ -3,6 +3,8 @@ import { ActionContextStoreSource } from './action.store.source';
3
3
  import { HandleActionFunction } from './action.handler';
4
4
  import { DbxActionContextBaseSource } from './action.holder';
5
5
  import { Destroyable, Maybe } from '@dereekb/util';
6
+ import { OnDestroy } from '@angular/core';
7
+ import * as i0 from "@angular/core";
6
8
  /**
7
9
  * DbxActionContextMachine configuration.
8
10
  */
@@ -13,8 +15,10 @@ export interface DbxActionContextMachineConfig<T = unknown, O = unknown> {
13
15
  oneTimeUse: boolean;
14
16
  /**
15
17
  * Function to handle any valueReady events.
18
+ *
19
+ * If false, will not subscribe/handle valueReady$ events.
16
20
  */
17
- handleValueReady: HandleActionFunction<T, O>;
21
+ handleValueReady: HandleActionFunction<T, O> | false;
18
22
  /**
19
23
  * Optional function to execute after the action has succeeded.
20
24
  */
@@ -34,3 +38,12 @@ export declare class DbxActionContextMachine<T = unknown, O = unknown> extends D
34
38
  destroy(): void;
35
39
  get isShutdown(): boolean;
36
40
  }
41
+ /**
42
+ * DbxActionContextMachine that implements OnDestroy and is configured for use as a Service/Injectable.
43
+ */
44
+ export declare class DbxActionContextMachineAsService<T = unknown, O = unknown> extends DbxActionContextMachine<T, O> implements OnDestroy {
45
+ constructor();
46
+ ngOnDestroy(): void;
47
+ static ɵfac: i0.ɵɵFactoryDeclaration<DbxActionContextMachineAsService<any, any>, never>;
48
+ static ɵprov: i0.ɵɵInjectableDeclaration<DbxActionContextMachineAsService<any, any>>;
49
+ }
@@ -1,5 +1,5 @@
1
1
  import { Observable, Subscription } from 'rxjs';
2
- import { Provider, Type, OnDestroy } from '@angular/core';
2
+ import { OnDestroy } from '@angular/core';
3
3
  import { LockSet, LoadingState, LoadingStateType } from '@dereekb/rxjs';
4
4
  import { Maybe, ReadableError } from '@dereekb/util';
5
5
  import { ActionContextState, ActionContextStore } from './action.store';
@@ -71,9 +71,3 @@ export declare class DbxActionContextStoreSourceInstance<T = unknown, O = unknow
71
71
  static ɵfac: i0.ɵɵFactoryDeclaration<DbxActionContextStoreSourceInstance<any, any>, never>;
72
72
  static ɵprov: i0.ɵɵInjectableDeclaration<DbxActionContextStoreSourceInstance<any, any>>;
73
73
  }
74
- export declare const actionContextStoreSourceInstanceFactory: (source: ActionContextStoreSource) => DbxActionContextStoreSourceInstance<unknown, unknown>;
75
- /**
76
- * Provides an ActionContextStoreSource, as well as an DbxActionContextStoreSourceInstance.
77
- */
78
- export declare function provideActionStoreSource<S extends ActionContextStoreSource>(sourceType: Type<S>): Provider[];
79
- export declare function provideSecondaryActionStoreSource<S extends SecondaryActionContextStoreSource>(sourceType: Type<S>): Provider[];
@@ -0,0 +1,10 @@
1
+ import { Provider, Type } from '@angular/core';
2
+ import { ActionContextStoreSource, DbxActionContextStoreSourceInstance, SecondaryActionContextStoreSource } from './action.store.source';
3
+ import { DbxActionContextMachineAsService } from './action.machine';
4
+ export declare const actionContextStoreSourceInstanceFactory: (source: ActionContextStoreSource) => DbxActionContextStoreSourceInstance<unknown, unknown>;
5
+ export declare const actionContextStoreSourceMachineFactory: () => DbxActionContextMachineAsService<unknown, unknown>;
6
+ /**
7
+ * Provides an ActionContextStoreSource, as well as an DbxActionContextStoreSourceInstance.
8
+ */
9
+ export declare function provideActionStoreSource<S extends ActionContextStoreSource>(sourceType: Type<S> | null): Provider[];
10
+ export declare function provideSecondaryActionStoreSource<S extends SecondaryActionContextStoreSource>(sourceType: Type<S>): Provider[];
@@ -1,22 +1,27 @@
1
1
  import { OnDestroy, OnInit } from '@angular/core';
2
- import { AbstractSubscriptionDirective } from '../../../subscription';
3
2
  import { DbxActionContextStoreSourceInstance } from '../../action.store.source';
4
3
  import { HandleActionWithFunctionOrContext } from '../../action.handler';
5
4
  import { Maybe } from '@dereekb/util';
5
+ import { DbxActionHandlerInstance } from './action.handler.instance';
6
6
  import * as i0 from "@angular/core";
7
7
  /**
8
- * Context used for defining a function that performs an action using the input function on ValueReady.
8
+ * Abstract directive that wraps and handles a DbxActionHandlerInstance lifecycle.
9
9
  */
10
- export declare class DbxActionHandlerDirective<T = unknown, O = unknown> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {
10
+ export declare abstract class AbstractDbxActionHandlerDirective<T = unknown, O = unknown> implements OnInit, OnDestroy {
11
11
  readonly source: DbxActionContextStoreSourceInstance<T, O>;
12
- private _handlerFunction;
13
- readonly handlerFunction$: import("rxjs").Observable<HandleActionWithFunctionOrContext<T, O>>;
14
- get handlerFunction(): Maybe<HandleActionWithFunctionOrContext<T, O>>;
15
- set handlerFunction(handlerFunction: Maybe<HandleActionWithFunctionOrContext<T, O>>);
16
- private _delegate;
12
+ protected _dbxActionHandlerInstance: DbxActionHandlerInstance<T, O>;
17
13
  constructor(source: DbxActionContextStoreSourceInstance<T, O>);
18
14
  ngOnInit(): void;
19
15
  ngOnDestroy(): void;
20
- static ɵfac: i0.ɵɵFactoryDeclaration<DbxActionHandlerDirective<any, any>, [{ host: true; }]>;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<AbstractDbxActionHandlerDirective<any, any>, [{ host: true; }]>;
17
+ static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractDbxActionHandlerDirective<any, any>, never, never, {}, {}, never, never, false>;
18
+ }
19
+ /**
20
+ * Directive that wraps and controls a DbxActionHandlerInstance.
21
+ */
22
+ export declare class DbxActionHandlerDirective<T = unknown, O = unknown> extends AbstractDbxActionHandlerDirective<T, O> {
23
+ get handlerFunction(): Maybe<HandleActionWithFunctionOrContext<T, O>>;
24
+ set handlerFunction(handlerFunction: Maybe<HandleActionWithFunctionOrContext<T, O>>);
25
+ static ɵfac: i0.ɵɵFactoryDeclaration<DbxActionHandlerDirective<any, any>, never>;
21
26
  static ɵdir: i0.ɵɵDirectiveDeclaration<DbxActionHandlerDirective<any, any>, "[dbxActionHandler]", never, { "handlerFunction": "dbxActionHandler"; }, {}, never, never, false>;
22
27
  }
@@ -0,0 +1,19 @@
1
+ import { DbxActionContextStoreSourceInstance } from '../../action.store.source';
2
+ import { HandleActionWithFunctionOrContext } from '../../action.handler';
3
+ import { Maybe, Destroyable, Initialized } from '@dereekb/util';
4
+ export declare const DBX_ACTION_HANDLER_LOCK_KEY = "dbxActionHandler";
5
+ /**
6
+ * Context used for defining a function that performs an action using the input function to handle valueReady$ events from an action context.
7
+ */
8
+ export declare class DbxActionHandlerInstance<T = unknown, O = unknown> implements Initialized, Destroyable {
9
+ readonly source: DbxActionContextStoreSourceInstance<T, O>;
10
+ private _sub;
11
+ private _handlerFunction;
12
+ readonly handlerFunction$: import("rxjs").Observable<HandleActionWithFunctionOrContext<T, O>>;
13
+ get handlerFunction(): Maybe<HandleActionWithFunctionOrContext<T, O>>;
14
+ set handlerFunction(handlerFunction: Maybe<HandleActionWithFunctionOrContext<T, O>>);
15
+ private _delegate;
16
+ constructor(source: DbxActionContextStoreSourceInstance<T, O>);
17
+ init(): void;
18
+ destroy(): void;
19
+ }
@@ -1,6 +1,7 @@
1
1
  export * from './action.disabled.directive';
2
2
  export * from './action.disableonsuccess.directive';
3
3
  export * from './action.handler.directive';
4
+ export * from './action.handler.instance';
4
5
  export * from './action.presuccess.directive';
5
6
  export * from './action.success.directive';
6
7
  export * from './action.success.handler.directive';
@@ -5,5 +5,6 @@ export * from './action.machine';
5
5
  export * from './action.module';
6
6
  export * from './action.reference';
7
7
  export * from './action.store.source';
8
+ export * from './action.store.source.provide';
8
9
  export * from './action.store';
9
10
  export * from './action';
@@ -1,12 +1,23 @@
1
1
  import { Observable } from 'rxjs';
2
- import { OnDestroy, OnInit } from '@angular/core';
2
+ import { OnDestroy, OnInit, Provider, Type } from '@angular/core';
3
3
  import { FilterSource, FilterSourceInstance, ObservableOrValue } from '@dereekb/rxjs';
4
4
  import { Maybe } from '@dereekb/util';
5
5
  import * as i0 from "@angular/core";
6
+ export declare abstract class FilterSourceDirective<F = unknown> implements FilterSource<F> {
7
+ abstract filter$: Observable<F>;
8
+ abstract initWithFilter(filterObs: Observable<F>): void;
9
+ abstract setFilter(filter: F): void;
10
+ abstract resetFilter(): void;
11
+ }
12
+ /**
13
+ * Angular provider convenience function for a FilterSourceDirective.
14
+ */
15
+ export declare function provideFilterSourceDirective<S extends FilterSourceDirective<F>, F = unknown>(sourceType: Type<S>): Provider[];
6
16
  /**
7
- * Abstract FilterSource implementation.
17
+ * Abstract FilterSource implementation and directive.
8
18
  */
9
- export declare abstract class AbstractFilterSourceDirective<F> implements FilterSource<F>, OnInit, OnDestroy {
19
+ export declare abstract class AbstractFilterSourceDirective<F = unknown> implements FilterSourceDirective<F>, OnInit, OnDestroy {
20
+ protected defaultFilterValue?: Maybe<F>;
10
21
  protected _defaultFilterSource: FilterSourceInstance<F>;
11
22
  readonly filter$: Observable<F>;
12
23
  ngOnInit(): void;
@@ -0,0 +1,14 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { FilterSource, FilterSourceConnector } from '@dereekb/rxjs';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Connects the host FilterSource to a FilterSourceConnector.
6
+ */
7
+ export declare class DbxFilterConnectSourceDirective<F = unknown> implements OnInit {
8
+ readonly filterSource: FilterSource<F>;
9
+ readonly filterSourceConnector: FilterSourceConnector<F>;
10
+ constructor(filterSource: FilterSource<F>, filterSourceConnector: FilterSourceConnector<F>);
11
+ ngOnInit(): void;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<DbxFilterConnectSourceDirective<any>, [{ host: true; }, null]>;
13
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DbxFilterConnectSourceDirective<any>, "[dbxFilterConnectSource]", never, {}, {}, never, never, false>;
14
+ }
@@ -10,7 +10,7 @@ export declare class DbxFilterMapSourceDirective<F> extends AbstractDbxFilterMap
10
10
  readonly filter$: Observable<F>;
11
11
  get key(): Maybe<FilterMapKey>;
12
12
  set key(key: Maybe<FilterMapKey>);
13
- initWithFilter?(filterObs: Observable<F>): void;
13
+ initWithFilter(filterObs: Observable<F>): void;
14
14
  static ɵfac: i0.ɵɵFactoryDeclaration<DbxFilterMapSourceDirective<any>, never>;
15
15
  static ɵdir: i0.ɵɵDirectiveDeclaration<DbxFilterMapSourceDirective<any>, "[dbxFilterMapSource]", ["dbxFilterMapSource"], { "key": "dbxFilterMapSource"; }, {}, never, never, false>;
16
16
  }
@@ -1,12 +1,13 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import * as i1 from "./filter.source.directive";
3
- import * as i2 from "./filter.connector.directive";
4
- import * as i3 from "./filter.map.directive";
5
- import * as i4 from "./filter.map.connector.directive";
6
- import * as i5 from "./filter.map.source.directive";
7
- import * as i6 from "@angular/common";
3
+ import * as i2 from "./filter.connect.source.directive";
4
+ import * as i3 from "./filter.connector.directive";
5
+ import * as i4 from "./filter.map.directive";
6
+ import * as i5 from "./filter.map.connector.directive";
7
+ import * as i6 from "./filter.map.source.directive";
8
+ import * as i7 from "@angular/common";
8
9
  export declare class DbxCoreFilterModule {
9
10
  static ɵfac: i0.ɵɵFactoryDeclaration<DbxCoreFilterModule, never>;
10
- static ɵmod: i0.ɵɵNgModuleDeclaration<DbxCoreFilterModule, [typeof i1.DbxFilterSourceDirective, typeof i2.DbxFilterSourceConnectorDirective, typeof i3.DbxFilterMapDirective, typeof i4.DbxFilterMapSourceConnectorDirective, typeof i5.DbxFilterMapSourceDirective], [typeof i6.CommonModule], [typeof i1.DbxFilterSourceDirective, typeof i2.DbxFilterSourceConnectorDirective, typeof i3.DbxFilterMapDirective, typeof i4.DbxFilterMapSourceConnectorDirective, typeof i5.DbxFilterMapSourceDirective]>;
11
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DbxCoreFilterModule, [typeof i1.DbxFilterSourceDirective, typeof i2.DbxFilterConnectSourceDirective, typeof i3.DbxFilterSourceConnectorDirective, typeof i4.DbxFilterMapDirective, typeof i5.DbxFilterMapSourceConnectorDirective, typeof i6.DbxFilterMapSourceDirective], [typeof i7.CommonModule], [typeof i1.DbxFilterSourceDirective, typeof i2.DbxFilterConnectSourceDirective, typeof i3.DbxFilterSourceConnectorDirective, typeof i4.DbxFilterMapDirective, typeof i5.DbxFilterMapSourceConnectorDirective, typeof i6.DbxFilterMapSourceDirective]>;
11
12
  static ɵinj: i0.ɵɵInjectorDeclaration<DbxCoreFilterModule>;
12
13
  }
@@ -0,0 +1,11 @@
1
+ import { FilterPresetStringRef, FilterWithPreset, FilterWithPresetOptional } from '@dereekb/rxjs';
2
+ import { EmptyObject, GetterOrValue } from '@dereekb/util';
3
+ import { ClickableAnchorLink } from '../router/anchor/anchor';
4
+ export interface ClickableFilterPreset<F extends FilterWithPreset<P>, P extends string = string> extends Pick<ClickableAnchorLink, 'title' | 'icon' | 'disabled'>, FilterPresetStringRef {
5
+ /**
6
+ * GetterOrValue that retrieves the filter for this preset.
7
+ *
8
+ * A null value or empty object is used for reset.
9
+ */
10
+ presetValue: GetterOrValue<FilterWithPresetOptional<F>> | EmptyObject | null;
11
+ }
@@ -1,11 +1,12 @@
1
- export * from './action';
2
1
  export * from './filter.abstract.connector.directive';
3
2
  export * from './filter.abstract.source.directive';
3
+ export * from './filter.connect.source.directive';
4
4
  export * from './filter.connector.directive';
5
5
  export * from './filter.content';
6
6
  export * from './filter.map.connector.directive';
7
7
  export * from './filter.map.directive';
8
8
  export * from './filter.map.instance.directive';
9
9
  export * from './filter.map.source.directive';
10
+ export * from './filter.preset';
10
11
  export * from './filter.module';
11
12
  export * from './filter.source.directive';
@@ -5,6 +5,7 @@ import { Type, Provider } from '@angular/core';
5
5
  import { Observable } from 'rxjs';
6
6
  export interface ClickableAnchor extends ClickableFunction, ClickableUrl, Partial<SegueRef> {
7
7
  disabled?: boolean;
8
+ selected?: boolean;
8
9
  }
9
10
  export interface ClickableAnchorLink extends ClickableAnchor {
10
11
  title: string;
@@ -50,8 +51,10 @@ export declare enum AnchorType {
50
51
  export declare function anchorTypeForAnchor(anchor: Maybe<ClickableAnchor>, disabled?: Maybe<boolean>): AnchorType;
51
52
  export declare abstract class DbxAnchor<T extends ClickableAnchor = ClickableAnchor> {
52
53
  abstract disabled$: Observable<Maybe<boolean>>;
54
+ abstract selected$: Observable<Maybe<boolean>>;
53
55
  abstract anchor$: Observable<Maybe<T>>;
54
56
  abstract disabled: Maybe<boolean>;
57
+ abstract selected: Maybe<boolean>;
55
58
  abstract anchor: Maybe<T>;
56
59
  abstract type$: Observable<AnchorType>;
57
60
  }
@@ -8,10 +8,12 @@ import * as i0 from "@angular/core";
8
8
  * Abstract anchor directive.
9
9
  */
10
10
  export declare class AbstractDbxAnchorDirective<T extends ClickableAnchor = ClickableAnchor> implements DbxAnchor, OnDestroy {
11
+ private _selected;
11
12
  private _disabled;
12
13
  private _anchor;
13
14
  readonly disabled$: Observable<Maybe<boolean>>;
14
15
  readonly anchor$: Observable<Maybe<T>>;
16
+ readonly selected$: Observable<boolean | undefined>;
15
17
  readonly type$: Observable<AnchorType>;
16
18
  ngOnDestroy(): void;
17
19
  /**
@@ -22,6 +24,8 @@ export declare class AbstractDbxAnchorDirective<T extends ClickableAnchor = Clic
22
24
  set anchor(anchor: Maybe<T>);
23
25
  get disabled(): Maybe<boolean>;
24
26
  set disabled(disabled: Maybe<boolean>);
27
+ get selected(): Maybe<boolean>;
28
+ set selected(selected: Maybe<boolean>);
25
29
  static ɵfac: i0.ɵɵFactoryDeclaration<AbstractDbxAnchorDirective<any>, never>;
26
- static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractDbxAnchorDirective<any>, never, never, { "ref": "ref"; "anchor": "anchor"; "disabled": "disabled"; }, {}, never, never, false>;
30
+ static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractDbxAnchorDirective<any>, never, never, { "ref": "ref"; "anchor": "anchor"; "disabled": "disabled"; "selected": "selected"; }, {}, never, never, false>;
27
31
  }
@@ -1,4 +1,4 @@
1
- import { Maybe } from '@dereekb/util';
1
+ import { Maybe, WebsiteUrl } from '@dereekb/util';
2
2
  export interface ClickableFunction {
3
3
  onClick?: (event?: Maybe<MouseEvent>) => void;
4
4
  }
@@ -15,3 +15,4 @@ export interface ClickableUrl {
15
15
  */
16
16
  target?: string;
17
17
  }
18
+ export declare function clickableUrlInNewTab(url: string | WebsiteUrl): ClickableUrl;
@@ -1,3 +1,5 @@
1
1
  export * from './router.service';
2
+ export * from './router.service.rxjs';
2
3
  export * from './router.go';
3
4
  export * from './router.transition.service';
5
+ export * from './router.service.util';
@@ -1,10 +1,11 @@
1
1
  import { ObservableOrValue } from '@dereekb/rxjs';
2
2
  import { Observable } from 'rxjs';
3
3
  import { SegueRefOrSegueRefRouterLink, SegueRefRawSegueParams } from '../../segue';
4
+ import { DbxRouterTransitionService } from './router.transition.service';
4
5
  /**
5
6
  * Router service definition that can route the app and provide routing details.
6
7
  */
7
- export declare abstract class DbxRouterService {
8
+ export declare abstract class DbxRouterService extends DbxRouterTransitionService {
8
9
  /**
9
10
  * Params of the current successfully loaded route.
10
11
  */
@@ -0,0 +1,27 @@
1
+ import { Maybe } from '@dereekb/util';
2
+ import { Observable, OperatorFunction } from 'rxjs';
3
+ import { SegueRefOrSegueRefRouterLink } from '../../segue';
4
+ import { DbxRouterTransitionEvent, DbxRouterTransitionEventType } from '../transition';
5
+ import { IsSegueRefActiveFunctionConfig } from './router.service.util';
6
+ export declare function onRouterTransitionEventType(events$: Observable<DbxRouterTransitionEvent>, type: DbxRouterTransitionEventType): Observable<DbxRouterTransitionEvent>;
7
+ export declare function onRouterTransitionSuccessEvent(events$: Observable<DbxRouterTransitionEvent>): Observable<DbxRouterTransitionEvent>;
8
+ /**
9
+ * Creates an observable that returns true when the route for the input segueRef is active.
10
+ *
11
+ * @param dbxRouterService
12
+ * @param segueRef
13
+ */
14
+ export declare function isSegueRefActiveOnTransitionSuccess(config: IsSegueRefActiveFunctionConfig): Observable<boolean>;
15
+ export interface IsSegueRefActiveConfig extends Pick<IsSegueRefActiveFunctionConfig, 'dbxRouterService' | 'activeExactly'> {
16
+ /**
17
+ * What to pipe if the input segueRef is null.
18
+ */
19
+ readonly defaultIfNull?: boolean;
20
+ }
21
+ /**
22
+ * Operator function that maps the input segueRef to a boolean depending on the current route state.
23
+ *
24
+ * @param dbxRouterService
25
+ * @param segueRef
26
+ */
27
+ export declare function isSegueRefActive(config: IsSegueRefActiveConfig): OperatorFunction<Maybe<SegueRefOrSegueRefRouterLink>, boolean>;
@@ -0,0 +1,26 @@
1
+ import { SegueRefOrSegueRefRouterLink } from '../../segue';
2
+ import { DbxRouterService } from './router.service';
3
+ /**
4
+ * Function that returns true when the configured segueRef is active.
5
+ */
6
+ export declare type IsSegueRefActiveFunction = (() => boolean) & {
7
+ readonly _segueRef: SegueRefOrSegueRefRouterLink;
8
+ readonly _activeExactly: boolean;
9
+ };
10
+ export interface IsSegueRefActiveFunctionConfig {
11
+ readonly dbxRouterService: DbxRouterService;
12
+ readonly segueRef: SegueRefOrSegueRefRouterLink;
13
+ /**
14
+ * Whether or not to match the route exactly.
15
+ *
16
+ * False by default.
17
+ */
18
+ readonly activeExactly?: boolean;
19
+ }
20
+ /**
21
+ * Creates an IsSegueRefActiveFunction
22
+ *
23
+ * @param config
24
+ * @returns
25
+ */
26
+ export declare function isSegueRefActiveFunction(config: IsSegueRefActiveFunctionConfig): IsSegueRefActiveFunction;
@@ -6,7 +6,7 @@ export declare enum DbxRouterTransitionEventType {
6
6
  /**
7
7
  * A transition ended.
8
8
  */
9
- SUCCESS = "ended"
9
+ SUCCESS = "success"
10
10
  }
11
11
  export interface DbxRouterTransitionEvent {
12
12
  type: DbxRouterTransitionEventType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/dbx-core",
3
- "version": "9.15.7",
3
+ "version": "9.16.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^14.0.0",
6
6
  "@angular/core": "^14.0.0",
@@ -9,12 +9,12 @@
9
9
  "@ngrx/effects": "^14.0.0",
10
10
  "@ngrx/entity": "^14.0.0",
11
11
  "@ngrx/store": "^14.0.0",
12
- "@dereekb/util": "9.15.7",
13
- "@dereekb/rxjs": "9.15.7",
12
+ "@dereekb/util": "9.16.0",
13
+ "@dereekb/rxjs": "9.16.0",
14
14
  "@angular/platform-browser": "^14.0.0",
15
15
  "@uirouter/core": "^6.0.8",
16
16
  "date-fns": "^2.29.0",
17
- "@dereekb/date": "9.15.7",
17
+ "@dereekb/date": "9.16.0",
18
18
  "@angular/router": "^14.0.0"
19
19
  },
20
20
  "dependencies": {
@@ -1,33 +0,0 @@
1
- import { AbstractFilterSourceDirective } from '../filter.abstract.source.directive';
2
- import { Directive, ViewChild } from '@angular/core';
3
- import { of } from 'rxjs';
4
- import { DbxActionContextStoreSourceInstance } from '../../action/action.store.source';
5
- import * as i0 from "@angular/core";
6
- /**
7
- * Abstract filter source for components that use an action to filter.
8
- */
9
- export class AbstractActionFilterSourceDirective extends AbstractFilterSourceDirective {
10
- constructor() {
11
- super(...arguments);
12
- /**
13
- * Pre-set action handler for the template to use to set the filter.
14
- */
15
- this.setFilterAction = (filter) => {
16
- this.setFilter(filter);
17
- return of(true);
18
- };
19
- }
20
- applyFilter() {
21
- this.filterAction.setIsModified(true); // Force setting modified.
22
- this.filterAction.trigger();
23
- }
24
- }
25
- AbstractActionFilterSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: AbstractActionFilterSourceDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
26
- 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 });
27
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: AbstractActionFilterSourceDirective, decorators: [{
28
- type: Directive
29
- }], propDecorators: { filterAction: [{
30
- type: ViewChild,
31
- args: [DbxActionContextStoreSourceInstance, { static: true, read: DbxActionContextStoreSourceInstance }]
32
- }] } });
33
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWN0aW9uLmZpbHRlci5zb3VyY2UuZGlyZWN0aXZlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvZGJ4LWNvcmUvc3JjL2xpYi9maWx0ZXIvYWN0aW9uL2FjdGlvbi5maWx0ZXIuc291cmNlLmRpcmVjdGl2ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUUsNkJBQTZCLEVBQUUsTUFBTSxxQ0FBcUMsQ0FBQztBQUNwRixPQUFPLEVBQUUsU0FBUyxFQUFFLFNBQVMsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUNyRCxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sTUFBTSxDQUFDO0FBQzFCLE9BQU8sRUFBRSxtQ0FBbUMsRUFBRSxNQUFNLGtDQUFrQyxDQUFDOztBQUV2Rjs7R0FFRztBQUVILE1BQU0sT0FBZ0IsbUNBQXVDLFNBQVEsNkJBQWdDO0lBRHJHOztRQVVFOztXQUVHO1FBQ0gsb0JBQWUsR0FBNEIsQ0FBQyxNQUFTLEVBQUUsRUFBRTtZQUN2RCxJQUFJLENBQUMsU0FBUyxDQUFDLE1BQU0sQ0FBQyxDQUFDO1lBQ3ZCLE9BQU8sRUFBRSxDQUFDLElBQUksQ0FBQyxDQUFDO1FBQ2xCLENBQUMsQ0FBQztLQUNIO0lBWkMsV0FBVztRQUNULElBQUksQ0FBQyxZQUFZLENBQUMsYUFBYSxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsMEJBQTBCO1FBQ2pFLElBQUksQ0FBQyxZQUFZLENBQUMsT0FBTyxFQUFFLENBQUM7SUFDOUIsQ0FBQzs7Z0lBUG1CLG1DQUFtQztvSEFBbkMsbUNBQW1DLHdFQUM1QyxtQ0FBbUMsMkJBQXdCLG1DQUFtQzsyRkFEckYsbUNBQW1DO2tCQUR4RCxTQUFTOzhCQUdDLFlBQVk7c0JBRHBCLFNBQVM7dUJBQUMsbUNBQW1DLEVBQUUsRUFBRSxNQUFNLEVBQUUsSUFBSSxFQUFFLElBQUksRUFBRSxtQ0FBbUMsRUFBRSIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEhhbmRsZUFjdGlvbkZ1bmN0aW9uIH0gZnJvbSAnLi4vLi4vYWN0aW9uL2FjdGlvbi5oYW5kbGVyJztcbmltcG9ydCB7IEFic3RyYWN0RmlsdGVyU291cmNlRGlyZWN0aXZlIH0gZnJvbSAnLi4vZmlsdGVyLmFic3RyYWN0LnNvdXJjZS5kaXJlY3RpdmUnO1xuaW1wb3J0IHsgRGlyZWN0aXZlLCBWaWV3Q2hpbGQgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IG9mIH0gZnJvbSAncnhqcyc7XG5pbXBvcnQgeyBEYnhBY3Rpb25Db250ZXh0U3RvcmVTb3VyY2VJbnN0YW5jZSB9IGZyb20gJy4uLy4uL2FjdGlvbi9hY3Rpb24uc3RvcmUuc291cmNlJztcblxuLyoqXG4gKiBBYnN0cmFjdCBmaWx0ZXIgc291cmNlIGZvciBjb21wb25lbnRzIHRoYXQgdXNlIGFuIGFjdGlvbiB0byBmaWx0ZXIuXG4gKi9cbkBEaXJlY3RpdmUoKVxuZXhwb3J0IGFic3RyYWN0IGNsYXNzIEFic3RyYWN0QWN0aW9uRmlsdGVyU291cmNlRGlyZWN0aXZlPEY+IGV4dGVuZHMgQWJzdHJhY3RGaWx0ZXJTb3VyY2VEaXJlY3RpdmU8Rj4ge1xuICBAVmlld0NoaWxkKERieEFjdGlvbkNvbnRleHRTdG9yZVNvdXJjZUluc3RhbmNlLCB7IHN0YXRpYzogdHJ1ZSwgcmVhZDogRGJ4QWN0aW9uQ29udGV4dFN0b3JlU291cmNlSW5zdGFuY2UgfSlcbiAgcmVhZG9ubHkgZmlsdGVyQWN0aW9uITogRGJ4QWN0aW9uQ29udGV4dFN0b3JlU291cmNlSW5zdGFuY2U7XG5cbiAgYXBwbHlGaWx0ZXIoKTogdm9pZCB7XG4gICAgdGhpcy5maWx0ZXJBY3Rpb24uc2V0SXNNb2RpZmllZCh0cnVlKTsgLy8gRm9yY2Ugc2V0dGluZyBtb2RpZmllZC5cbiAgICB0aGlzLmZpbHRlckFjdGlvbi50cmlnZ2VyKCk7XG4gIH1cblxuICAvKipcbiAgICogUHJlLXNldCBhY3Rpb24gaGFuZGxlciBmb3IgdGhlIHRlbXBsYXRlIHRvIHVzZSB0byBzZXQgdGhlIGZpbHRlci5cbiAgICovXG4gIHNldEZpbHRlckFjdGlvbjogSGFuZGxlQWN0aW9uRnVuY3Rpb248Rj4gPSAoZmlsdGVyOiBGKSA9PiB7XG4gICAgdGhpcy5zZXRGaWx0ZXIoZmlsdGVyKTtcbiAgICByZXR1cm4gb2YodHJ1ZSk7XG4gIH07XG59XG4iXX0=
@@ -1,2 +0,0 @@
1
- export * from './action.filter.source.directive';
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9kYngtY29yZS9zcmMvbGliL2ZpbHRlci9hY3Rpb24vaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxrQ0FBa0MsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vYWN0aW9uLmZpbHRlci5zb3VyY2UuZGlyZWN0aXZlJztcbiJdfQ==
@@ -1,17 +0,0 @@
1
- import { HandleActionFunction } from '../../action/action.handler';
2
- import { AbstractFilterSourceDirective } from '../filter.abstract.source.directive';
3
- import { DbxActionContextStoreSourceInstance } from '../../action/action.store.source';
4
- import * as i0 from "@angular/core";
5
- /**
6
- * Abstract filter source for components that use an action to filter.
7
- */
8
- export declare abstract class AbstractActionFilterSourceDirective<F> extends AbstractFilterSourceDirective<F> {
9
- readonly filterAction: DbxActionContextStoreSourceInstance;
10
- applyFilter(): void;
11
- /**
12
- * Pre-set action handler for the template to use to set the filter.
13
- */
14
- setFilterAction: HandleActionFunction<F>;
15
- static ɵfac: i0.ɵɵFactoryDeclaration<AbstractActionFilterSourceDirective<any>, never>;
16
- static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractActionFilterSourceDirective<any>, never, never, {}, {}, never, never, false>;
17
- }
@@ -1 +0,0 @@
1
- export * from './action.filter.source.directive';