@dereekb/dbx-core 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/dereekb-dbx-core.d.ts +5 -0
- package/esm2020/dereekb-dbx-core.mjs +5 -0
- package/esm2020/index.mjs +2 -0
- package/esm2020/lib/action/action.handler.mjs +140 -0
- package/esm2020/lib/action/action.holder.mjs +50 -0
- package/esm2020/lib/action/action.machine.mjs +37 -0
- package/esm2020/lib/action/action.mjs +51 -0
- package/esm2020/lib/action/action.module.mjs +38 -0
- package/esm2020/lib/action/action.store.mjs +188 -0
- package/esm2020/lib/action/action.store.source.mjs +149 -0
- package/esm2020/lib/action/directive/auto/action.automodify.directive.mjs +53 -0
- package/esm2020/lib/action/directive/auto/action.autotrigger.directive.mjs +131 -0
- package/esm2020/lib/action/directive/auto/action.autotrigger.value.directive.mjs +79 -0
- package/esm2020/lib/action/directive/auto/index.mjs +4 -0
- package/esm2020/lib/action/directive/context/action.component.mjs +18 -0
- package/esm2020/lib/action/directive/context/action.directive.mjs +33 -0
- package/esm2020/lib/action/directive/context/action.source.directive.mjs +40 -0
- package/esm2020/lib/action/directive/context/index.mjs +4 -0
- package/esm2020/lib/action/directive/debug/action.logger.directive.mjs +30 -0
- package/esm2020/lib/action/directive/debug/index.mjs +2 -0
- package/esm2020/lib/action/directive/index.mjs +6 -0
- package/esm2020/lib/action/directive/map/action.map.directive.mjs +74 -0
- package/esm2020/lib/action/directive/map/action.map.key.directive.mjs +40 -0
- package/esm2020/lib/action/directive/map/action.map.mjs +6 -0
- package/esm2020/lib/action/directive/map/action.map.source.directive.mjs +49 -0
- package/esm2020/lib/action/directive/map/action.map.working.disable.directive.mjs +41 -0
- package/esm2020/lib/action/directive/map/index.mjs +6 -0
- package/esm2020/lib/action/directive/state/action.disabled.directive.mjs +49 -0
- package/esm2020/lib/action/directive/state/action.disabled.modified.directive.mjs +35 -0
- package/esm2020/lib/action/directive/state/action.handler.directive.mjs +55 -0
- package/esm2020/lib/action/directive/state/action.success.component.mjs +50 -0
- package/esm2020/lib/action/directive/state/action.success.directive.mjs +48 -0
- package/esm2020/lib/action/directive/state/action.value.directive.mjs +52 -0
- package/esm2020/lib/action/directive/state/action.working.component.mjs +32 -0
- package/esm2020/lib/action/directive/state/index.mjs +8 -0
- package/esm2020/lib/action/index.mjs +10 -0
- package/esm2020/lib/action/snackbar/index.mjs +3 -0
- package/esm2020/lib/action/snackbar/snackbar.mjs +24 -0
- package/esm2020/lib/button/action/action.button.directive.mjs +46 -0
- package/esm2020/lib/button/action/action.button.trigger.directive.mjs +36 -0
- package/esm2020/lib/button/action/index.mjs +3 -0
- package/esm2020/lib/button/button.directive.mjs +109 -0
- package/esm2020/lib/button/button.loading.directive.mjs +43 -0
- package/esm2020/lib/button/button.mjs +9 -0
- package/esm2020/lib/button/button.module.mjs +40 -0
- package/esm2020/lib/button/index.mjs +7 -0
- package/esm2020/lib/button/router/button.segue.directive.mjs +43 -0
- package/esm2020/lib/button/router/index.mjs +2 -0
- package/esm2020/lib/index.mjs +9 -0
- package/esm2020/lib/injected/index.mjs +6 -0
- package/esm2020/lib/injected/injected.component.mjs +34 -0
- package/esm2020/lib/injected/injected.component.module.mjs +26 -0
- package/esm2020/lib/injected/injected.directive.mjs +32 -0
- package/esm2020/lib/injected/injected.instance.mjs +101 -0
- package/esm2020/lib/injected/injected.mjs +2 -0
- package/esm2020/lib/pipe/date/date.pipe.module.mjs +54 -0
- package/esm2020/lib/pipe/date/datedistance.pipe.mjs +42 -0
- package/esm2020/lib/pipe/date/dateformatdistance.pipe.mjs +37 -0
- package/esm2020/lib/pipe/date/datefromtoformat.pipe.mjs +35 -0
- package/esm2020/lib/pipe/date/index.mjs +9 -0
- package/esm2020/lib/pipe/date/minutesstring.pipe.mjs +32 -0
- package/esm2020/lib/pipe/date/timedistance.pipe.mjs +49 -0
- package/esm2020/lib/pipe/date/tojsdate.pipe.mjs +18 -0
- package/esm2020/lib/pipe/date/tominutes.pipe.mjs +17 -0
- package/esm2020/lib/pipe/index.mjs +2 -0
- package/esm2020/lib/router/anchor/anchor.directive.mjs +40 -0
- package/esm2020/lib/router/anchor/anchor.mjs +35 -0
- package/esm2020/lib/router/anchor/clickable.mjs +2 -0
- package/esm2020/lib/router/anchor/index.mjs +4 -0
- package/esm2020/lib/router/index.mjs +4 -0
- package/esm2020/lib/router/router/index.mjs +4 -0
- package/esm2020/lib/router/router/provider/angular/angular.router.service.mjs +51 -0
- package/esm2020/lib/router/router/provider/angular/angular.router.service.module.mjs +30 -0
- package/esm2020/lib/router/router/provider/angular/index.mjs +3 -0
- package/esm2020/lib/router/router/provider/index.mjs +3 -0
- package/esm2020/lib/router/router/provider/uirouter/index.mjs +3 -0
- package/esm2020/lib/router/router/provider/uirouter/uirouter.router.service.mjs +39 -0
- package/esm2020/lib/router/router/provider/uirouter/uirouter.router.service.module.mjs +31 -0
- package/esm2020/lib/router/router/service/index.mjs +3 -0
- package/esm2020/lib/router/router/service/router.service.mjs +6 -0
- package/esm2020/lib/router/router/service/router.transition.service.mjs +6 -0
- package/esm2020/lib/router/router/transition/index.mjs +3 -0
- package/esm2020/lib/router/router/transition/transition.mjs +12 -0
- package/esm2020/lib/router/router/transition/transition.watcher.directive.mjs +35 -0
- package/esm2020/lib/router/segue.mjs +8 -0
- package/esm2020/lib/storage/index.mjs +9 -0
- package/esm2020/lib/storage/storage.accessor.mjs +16 -0
- package/esm2020/lib/storage/storage.accessor.simple.factory.mjs +33 -0
- package/esm2020/lib/storage/storage.accessor.simple.mjs +161 -0
- package/esm2020/lib/storage/storage.accessor.string.mjs +50 -0
- package/esm2020/lib/storage/storage.di.mjs +4 -0
- package/esm2020/lib/storage/storage.module.mjs +37 -0
- package/esm2020/lib/storage/storage.object.localstorage.mjs +46 -0
- package/esm2020/lib/storage/storage.object.memory.mjs +17 -0
- package/esm2020/lib/subscription/index.mjs +2 -0
- package/esm2020/lib/subscription/subscription.directive.mjs +46 -0
- package/esm2020/lib/util/index.mjs +2 -0
- package/esm2020/lib/util/view.mjs +34 -0
- package/fesm2015/dereekb-dbx-core.mjs +2875 -0
- package/fesm2015/dereekb-dbx-core.mjs.map +1 -0
- package/fesm2020/dereekb-dbx-core.mjs +2856 -0
- package/fesm2020/dereekb-dbx-core.mjs.map +1 -0
- package/index.d.ts +1 -0
- package/lib/action/action.d.ts +43 -0
- package/lib/action/action.handler.d.ts +73 -0
- package/lib/action/action.holder.d.ts +28 -0
- package/lib/action/action.machine.d.ts +23 -0
- package/lib/action/action.module.d.ts +25 -0
- package/lib/action/action.store.d.ts +147 -0
- package/lib/action/action.store.source.d.ts +72 -0
- package/lib/action/directive/auto/action.automodify.directive.d.ts +15 -0
- package/lib/action/directive/auto/action.autotrigger.directive.d.ts +54 -0
- package/lib/action/directive/auto/action.autotrigger.value.directive.d.ts +25 -0
- package/lib/action/directive/auto/index.d.ts +3 -0
- package/lib/action/directive/context/action.component.d.ts +6 -0
- package/lib/action/directive/context/action.directive.d.ts +13 -0
- package/lib/action/directive/context/action.source.directive.d.ts +16 -0
- package/lib/action/directive/context/index.d.ts +3 -0
- package/lib/action/directive/debug/action.logger.directive.d.ts +14 -0
- package/lib/action/directive/debug/index.d.ts +1 -0
- package/lib/action/directive/index.d.ts +5 -0
- package/lib/action/directive/map/action.map.d.ts +13 -0
- package/lib/action/directive/map/action.map.directive.d.ts +35 -0
- package/lib/action/directive/map/action.map.key.directive.d.ts +20 -0
- package/lib/action/directive/map/action.map.source.directive.d.ts +20 -0
- package/lib/action/directive/map/action.map.working.disable.directive.d.ts +21 -0
- package/lib/action/directive/map/index.d.ts +5 -0
- package/lib/action/directive/state/action.disabled.directive.d.ts +20 -0
- package/lib/action/directive/state/action.disabled.modified.directive.d.ts +16 -0
- package/lib/action/directive/state/action.handler.directive.d.ts +22 -0
- package/lib/action/directive/state/action.success.component.d.ts +15 -0
- package/lib/action/directive/state/action.success.directive.d.ts +24 -0
- package/lib/action/directive/state/action.value.directive.d.ts +22 -0
- package/lib/action/directive/state/action.working.component.d.ts +12 -0
- package/lib/action/directive/state/index.d.ts +7 -0
- package/lib/action/index.d.ts +9 -0
- package/lib/action/snackbar/index.d.ts +1 -0
- package/lib/action/snackbar/snackbar.d.ts +50 -0
- package/lib/button/action/action.button.directive.d.ts +18 -0
- package/lib/button/action/action.button.trigger.directive.d.ts +17 -0
- package/lib/button/action/index.d.ts +2 -0
- package/lib/button/button.d.ts +26 -0
- package/lib/button/button.directive.d.ts +52 -0
- package/lib/button/button.loading.directive.d.ts +21 -0
- package/lib/button/button.module.d.ts +11 -0
- package/lib/button/index.d.ts +6 -0
- package/lib/button/router/button.segue.directive.d.ts +18 -0
- package/lib/button/router/index.d.ts +1 -0
- package/lib/index.d.ts +8 -0
- package/lib/injected/index.d.ts +5 -0
- package/lib/injected/injected.component.d.ts +15 -0
- package/lib/injected/injected.component.module.d.ts +8 -0
- package/lib/injected/injected.d.ts +26 -0
- package/lib/injected/injected.directive.d.ts +17 -0
- package/lib/injected/injected.instance.d.ts +29 -0
- package/lib/pipe/date/date.pipe.module.d.ts +13 -0
- package/lib/pipe/date/datedistance.pipe.d.ts +8 -0
- package/lib/pipe/date/dateformatdistance.pipe.d.ts +13 -0
- package/lib/pipe/date/datefromtoformat.pipe.d.ts +14 -0
- package/lib/pipe/date/index.d.ts +8 -0
- package/lib/pipe/date/minutesstring.pipe.d.ts +8 -0
- package/lib/pipe/date/timedistance.pipe.d.ts +13 -0
- package/lib/pipe/date/tojsdate.pipe.d.ts +9 -0
- package/lib/pipe/date/tominutes.pipe.d.ts +7 -0
- package/lib/pipe/index.d.ts +1 -0
- package/lib/router/anchor/anchor.d.ts +31 -0
- package/lib/router/anchor/anchor.directive.d.ts +20 -0
- package/lib/router/anchor/clickable.d.ts +17 -0
- package/lib/router/anchor/index.d.ts +3 -0
- package/lib/router/index.d.ts +3 -0
- package/lib/router/router/index.d.ts +3 -0
- package/lib/router/router/provider/angular/angular.router.service.d.ts +17 -0
- package/lib/router/router/provider/angular/angular.router.service.module.d.ts +8 -0
- package/lib/router/router/provider/angular/index.d.ts +2 -0
- package/lib/router/router/provider/index.d.ts +2 -0
- package/lib/router/router/provider/uirouter/index.d.ts +2 -0
- package/lib/router/router/provider/uirouter/uirouter.router.service.d.ts +19 -0
- package/lib/router/router/provider/uirouter/uirouter.router.service.module.d.ts +8 -0
- package/lib/router/router/service/index.d.ts +2 -0
- package/lib/router/router/service/router.service.d.ts +12 -0
- package/lib/router/router/service/router.transition.service.d.ts +11 -0
- package/lib/router/router/transition/index.d.ts +2 -0
- package/lib/router/router/transition/transition.d.ts +13 -0
- package/lib/router/router/transition/transition.watcher.directive.d.ts +18 -0
- package/lib/router/segue.d.ts +28 -0
- package/lib/storage/index.d.ts +8 -0
- package/lib/storage/storage.accessor.d.ts +35 -0
- package/lib/storage/storage.accessor.simple.d.ts +75 -0
- package/lib/storage/storage.accessor.simple.factory.d.ts +18 -0
- package/lib/storage/storage.accessor.string.d.ts +16 -0
- package/lib/storage/storage.di.d.ts +3 -0
- package/lib/storage/storage.module.d.ts +10 -0
- package/lib/storage/storage.object.localstorage.d.ts +16 -0
- package/lib/storage/storage.object.memory.d.ts +9 -0
- package/lib/subscription/index.d.ts +1 -0
- package/lib/subscription/subscription.directive.d.ts +25 -0
- package/lib/util/index.d.ts +1 -0
- package/lib/util/view.d.ts +22 -0
- package/package.json +52 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Maybe } from "@dereekb/util";
|
|
2
|
+
export interface ClickableFunction {
|
|
3
|
+
onClick?: (event?: Maybe<MouseEvent>) => void;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Represents a clickable href/url configuration.
|
|
7
|
+
*/
|
|
8
|
+
export interface ClickableUrl {
|
|
9
|
+
/**
|
|
10
|
+
* href url
|
|
11
|
+
*/
|
|
12
|
+
url?: string;
|
|
13
|
+
/**
|
|
14
|
+
* href target attribute.
|
|
15
|
+
*/
|
|
16
|
+
target?: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DbNgxRouterService, DbNgxRouterTransitionService } from '../../service';
|
|
2
|
+
import { SegueRef } from "../../../segue";
|
|
3
|
+
import { ActivatedRoute, NavigationBehaviorOptions, NavigationExtras, Router } from '@angular/router';
|
|
4
|
+
import { DbNgxRouterTransitionEvent } from "../../transition/transition";
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* AngularRouter implementation of DbNgxRouterService and DbNgxRouterTransitionService.
|
|
8
|
+
*/
|
|
9
|
+
export declare class DbNgxAngularRouterService implements DbNgxRouterService, DbNgxRouterTransitionService {
|
|
10
|
+
readonly router: Router;
|
|
11
|
+
readonly activatedRoute: ActivatedRoute;
|
|
12
|
+
readonly transitions$: import("rxjs").Observable<DbNgxRouterTransitionEvent>;
|
|
13
|
+
constructor(router: Router, activatedRoute: ActivatedRoute);
|
|
14
|
+
go(segueRef: SegueRef<NavigationExtras | NavigationBehaviorOptions>): Promise<boolean>;
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbNgxAngularRouterService, never>;
|
|
16
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DbNgxAngularRouterService>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ModuleWithProviders } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class DbNgxCoreAngularRouterSegueModule {
|
|
4
|
+
static forRoot(): ModuleWithProviders<DbNgxCoreAngularRouterSegueModule>;
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbNgxCoreAngularRouterSegueModule, never>;
|
|
6
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DbNgxCoreAngularRouterSegueModule, never, never, never>;
|
|
7
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DbNgxCoreAngularRouterSegueModule>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DbNgxRouterService, DbNgxRouterTransitionService } from '../../service';
|
|
2
|
+
import { SegueRef } from "../../../segue";
|
|
3
|
+
import { StateService, UIRouterGlobals, TransitionOptions, TransitionService } from '@uirouter/core';
|
|
4
|
+
import { DbNgxRouterTransitionEvent } from '../../transition/transition';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* UIRouter implementation of DbNgxRouterService and DbNgxRouterTransitionService.
|
|
8
|
+
*/
|
|
9
|
+
export declare class DbNgxUIRouterService implements DbNgxRouterService, DbNgxRouterTransitionService {
|
|
10
|
+
readonly state: StateService;
|
|
11
|
+
readonly transitionService: TransitionService;
|
|
12
|
+
readonly uiRouterGlobals: UIRouterGlobals;
|
|
13
|
+
private readonly _transitions;
|
|
14
|
+
readonly transitions$: import("rxjs").Observable<DbNgxRouterTransitionEvent>;
|
|
15
|
+
constructor(state: StateService, transitionService: TransitionService, uiRouterGlobals: UIRouterGlobals);
|
|
16
|
+
go(segueRef: SegueRef<TransitionOptions>): Promise<boolean>;
|
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbNgxUIRouterService, never>;
|
|
18
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DbNgxUIRouterService>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ModuleWithProviders } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class DbNgxCoreUIRouterSegueModule {
|
|
4
|
+
static forRoot(): ModuleWithProviders<DbNgxCoreUIRouterSegueModule>;
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbNgxCoreUIRouterSegueModule, never>;
|
|
6
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DbNgxCoreUIRouterSegueModule, never, never, never>;
|
|
7
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DbNgxCoreUIRouterSegueModule>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SegueRef } from "../../segue";
|
|
2
|
+
/**
|
|
3
|
+
* Router service definition that can route the app and provide routing details.
|
|
4
|
+
*/
|
|
5
|
+
export declare abstract class DbNgxRouterService {
|
|
6
|
+
/**
|
|
7
|
+
* Navigates to the target SegueRef.
|
|
8
|
+
*
|
|
9
|
+
* @param segueRef
|
|
10
|
+
*/
|
|
11
|
+
abstract go(segueRef: SegueRef): Promise<boolean>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { DbNgxRouterTransitionEvent } from '../transition/transition';
|
|
3
|
+
/**
|
|
4
|
+
* Router service definition that provides high level information about router transitions.
|
|
5
|
+
*/
|
|
6
|
+
export declare abstract class DbNgxRouterTransitionService {
|
|
7
|
+
/**
|
|
8
|
+
* Observable that emits DbNgxRouterTransitionEvent values as transitions occur.
|
|
9
|
+
*/
|
|
10
|
+
abstract readonly transitions$: Observable<DbNgxRouterTransitionEvent>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare enum DbNgxRouterTransitionEventType {
|
|
2
|
+
/**
|
|
3
|
+
* A transition started.
|
|
4
|
+
*/
|
|
5
|
+
START = "start",
|
|
6
|
+
/**
|
|
7
|
+
* A transition ended.
|
|
8
|
+
*/
|
|
9
|
+
SUCCESS = "ended"
|
|
10
|
+
}
|
|
11
|
+
export interface DbNgxRouterTransitionEvent {
|
|
12
|
+
type: DbNgxRouterTransitionEventType;
|
|
13
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { NgZone, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { DbNgxRouterTransitionService } from '../service/router.transition.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Abstract directive that listens to onSuccess transition events and runs a function.
|
|
6
|
+
*/
|
|
7
|
+
export declare abstract class AbstractTransitionWatcherDirective implements OnInit, OnDestroy {
|
|
8
|
+
protected readonly dbNgxRouterTransitionService: DbNgxRouterTransitionService;
|
|
9
|
+
protected readonly ngZone: NgZone;
|
|
10
|
+
private _transitionSub;
|
|
11
|
+
constructor(dbNgxRouterTransitionService: DbNgxRouterTransitionService, ngZone: NgZone);
|
|
12
|
+
ngOnInit(): void;
|
|
13
|
+
ngOnDestroy(): void;
|
|
14
|
+
protected zoneUpdateForSuccessfulTransition(): void;
|
|
15
|
+
protected abstract updateForSuccessfulTransition(): void;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractTransitionWatcherDirective, never>;
|
|
17
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractTransitionWatcherDirective, never, never, {}, {}, never>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
export declare type SegueRefRouterLink = string | any[] | any;
|
|
3
|
+
export interface SegueRefRawSegueParams {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
6
|
+
export interface SegueRefOptions<O = any> {
|
|
7
|
+
/**
|
|
8
|
+
* Raw parameters
|
|
9
|
+
*/
|
|
10
|
+
refParams?: SegueRefRawSegueParams;
|
|
11
|
+
/**
|
|
12
|
+
* Custom Transition Options.
|
|
13
|
+
*
|
|
14
|
+
* For UIRouter, this is TransitionOptions.
|
|
15
|
+
*/
|
|
16
|
+
refOptions?: O;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Represents a segue ref
|
|
20
|
+
*/
|
|
21
|
+
export interface SegueRef<O = any> extends SegueRefOptions<O> {
|
|
22
|
+
/**
|
|
23
|
+
* UI Sref reference value.
|
|
24
|
+
*/
|
|
25
|
+
ref?: SegueRefRouterLink;
|
|
26
|
+
}
|
|
27
|
+
export declare function refStringToSegueRef<O = any>(ref: string, options?: SegueRefOptions<O>): SegueRef<O>;
|
|
28
|
+
export declare function mapRefStringObsToSegueRefObs<O = any>(obs: Observable<string>, options?: SegueRefOptions<O>): Observable<SegueRef<O>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './storage.accessor.simple.factory';
|
|
2
|
+
export * from './storage.accessor.simple';
|
|
3
|
+
export * from './storage.accessor.string';
|
|
4
|
+
export * from './storage.accessor';
|
|
5
|
+
export * from './storage.di';
|
|
6
|
+
export * from './storage.module';
|
|
7
|
+
export * from './storage.object.localstorage';
|
|
8
|
+
export * from './storage.object.memory';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Maybe } from '@dereekb/util';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
/**
|
|
4
|
+
* Stored object accessor that can get/set/remove via a key, or be cleared entirely.
|
|
5
|
+
*/
|
|
6
|
+
export declare abstract class LimitedStorageAccessor<T> {
|
|
7
|
+
/**
|
|
8
|
+
* Attempts to get the value. Throws a DataDoesNotExistError if not available.
|
|
9
|
+
*/
|
|
10
|
+
abstract get(key: string): Observable<Maybe<T>>;
|
|
11
|
+
abstract set(key: string, value: Maybe<T>): Observable<void>;
|
|
12
|
+
abstract remove(key: string): Observable<void>;
|
|
13
|
+
abstract clear(): Observable<{}>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* LimitedStorageAccessor extension that has knowledge of all stored keys.
|
|
17
|
+
*/
|
|
18
|
+
export declare abstract class StorageAccessor<T> extends LimitedStorageAccessor<T> {
|
|
19
|
+
/**
|
|
20
|
+
* Returns all values. Filtered by keys of a given prefix.
|
|
21
|
+
*/
|
|
22
|
+
abstract all(prefix?: string): Observable<T[]>;
|
|
23
|
+
/**
|
|
24
|
+
* Returns all keys. Filtered by keys of a given prefix.
|
|
25
|
+
*/
|
|
26
|
+
abstract allKeys(prefix?: string): Observable<string[]>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* StorageAccessor-like object that has immediate/synchronous functionality for get/set.
|
|
30
|
+
*/
|
|
31
|
+
export declare abstract class InstantStorageAccessor<T> {
|
|
32
|
+
abstract getNow(key: string): T | undefined;
|
|
33
|
+
abstract setNow(key: string, value: T): void;
|
|
34
|
+
abstract removeNow(key: string): void;
|
|
35
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { ReadStoredData, StoredData, StoredDataStorageKey, StoredDataString, Maybe } from '@dereekb/util';
|
|
3
|
+
import { StorageAccessor } from './storage.accessor';
|
|
4
|
+
export interface SimpleStorageAccessorConverter<T> {
|
|
5
|
+
/**
|
|
6
|
+
* Converts the input value to a string.
|
|
7
|
+
*/
|
|
8
|
+
stringifyValue(value: T): StoredDataString;
|
|
9
|
+
/**
|
|
10
|
+
* Converts the data string into a value.
|
|
11
|
+
*/
|
|
12
|
+
parseValue(data: StoredDataString): T;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* SimpleStorageAccessor delegate.
|
|
16
|
+
*/
|
|
17
|
+
export interface SimpleStorageAccessorDelegate<T> extends SimpleStorageAccessorConverter<T>, StorageAccessor<StoredDataString> {
|
|
18
|
+
}
|
|
19
|
+
export declare class StringifySimpleStorageAccessorConverter<T> implements SimpleStorageAccessorConverter<T> {
|
|
20
|
+
stringifyValue(value: T): StoredDataString;
|
|
21
|
+
parseValue(data: StoredDataString): T;
|
|
22
|
+
}
|
|
23
|
+
export declare class WrapperSimpleStorageAccessorDelegate<T> implements SimpleStorageAccessorDelegate<T> {
|
|
24
|
+
private _delegate;
|
|
25
|
+
private _converter;
|
|
26
|
+
constructor(_delegate: StorageAccessor<StoredDataString>, _converter: SimpleStorageAccessorConverter<T>);
|
|
27
|
+
get(key: string): Observable<Maybe<StoredDataString>>;
|
|
28
|
+
set(key: string, value: StoredDataString): Observable<void>;
|
|
29
|
+
remove(key: string): Observable<void>;
|
|
30
|
+
clear(): Observable<{}>;
|
|
31
|
+
all(prefix?: string): Observable<string[]>;
|
|
32
|
+
allKeys(prefix?: string): Observable<string[]>;
|
|
33
|
+
stringifyValue(value: T): StoredDataString;
|
|
34
|
+
parseValue(data: StoredDataString): T;
|
|
35
|
+
}
|
|
36
|
+
export interface SimpleStorageAccessorConfig {
|
|
37
|
+
/**
|
|
38
|
+
* Storage Key Prefix
|
|
39
|
+
*/
|
|
40
|
+
readonly prefix: string;
|
|
41
|
+
/**
|
|
42
|
+
* Optional prefix/value splitter.
|
|
43
|
+
*/
|
|
44
|
+
readonly prefixSplitter?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Number in milliseconds that objects stored will expire in.
|
|
47
|
+
*/
|
|
48
|
+
readonly expiresIn?: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* LimitedStorageAccessor implementation that uses a Delegate
|
|
52
|
+
*/
|
|
53
|
+
export declare class SimpleStorageAccessor<T> implements StorageAccessor<T> {
|
|
54
|
+
private readonly _delegate;
|
|
55
|
+
static readonly PREFIX_SPLITTER = "::";
|
|
56
|
+
protected readonly _config: SimpleStorageAccessorConfig & {
|
|
57
|
+
fullPrefix: string;
|
|
58
|
+
};
|
|
59
|
+
constructor(_delegate: SimpleStorageAccessorDelegate<T>, config: SimpleStorageAccessorConfig);
|
|
60
|
+
get(inputKey: string): Observable<T>;
|
|
61
|
+
set(inputKey: string, inputValue: T): Observable<void>;
|
|
62
|
+
remove(key: string): Observable<void>;
|
|
63
|
+
all(): Observable<T[]>;
|
|
64
|
+
allKeys(): Observable<string[]>;
|
|
65
|
+
clear(): Observable<{}>;
|
|
66
|
+
protected readStoredData(storedDataString: StoredDataString): ReadStoredData<T>;
|
|
67
|
+
protected buildStoredData(value: T): StoredData;
|
|
68
|
+
protected isExpiredStoredData(storeData: StoredData): boolean;
|
|
69
|
+
protected assertValidStorageKeyPrefix(prefix: string, prefixSplitter: string): void;
|
|
70
|
+
protected isValidStorageKeyPrefix(prefix: string, prefixSpltter: string): boolean;
|
|
71
|
+
protected makeStorageKey(key: string): StoredDataStorageKey;
|
|
72
|
+
protected isKeyOfAccessor(storageKey: StoredDataStorageKey): boolean;
|
|
73
|
+
protected decodeStorageKey(storageKey: StoredDataStorageKey): string;
|
|
74
|
+
protected stringifyValue(value: T): string;
|
|
75
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { StorageAccessor } from './storage.accessor';
|
|
2
|
+
import { SimpleStorageAccessorConfig, SimpleStorageAccessor, SimpleStorageAccessorConverter } from './storage.accessor.simple';
|
|
3
|
+
import { FullStorageObject, StoredDataString } from '@dereekb/util';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export interface StorageAccessorFactoryConfig<T> extends SimpleStorageAccessorConfig {
|
|
6
|
+
storage?: StorageAccessor<StoredDataString>;
|
|
7
|
+
converter?: SimpleStorageAccessorConverter<T>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Used for building SimpleStorageAccessor instances from SimpleStorageAccessorConfig.
|
|
11
|
+
*/
|
|
12
|
+
export declare class SimpleStorageAccessorFactory {
|
|
13
|
+
readonly storageObject: FullStorageObject;
|
|
14
|
+
constructor(storageObject: FullStorageObject);
|
|
15
|
+
createStorageAccessor<T>(config: StorageAccessorFactoryConfig<T>): SimpleStorageAccessor<T>;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SimpleStorageAccessorFactory, never>;
|
|
17
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SimpleStorageAccessorFactory>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { StorageAccessor } from './storage.accessor';
|
|
3
|
+
import { StoredDataString, FullStorageObject, Maybe } from '@dereekb/util';
|
|
4
|
+
/**
|
|
5
|
+
* Simple StorageAccessor implementation that wraps a FullStorageObject.
|
|
6
|
+
*/
|
|
7
|
+
export declare class StringStorageAccessor implements StorageAccessor<StoredDataString> {
|
|
8
|
+
private readonly _storage;
|
|
9
|
+
constructor(_storage: FullStorageObject);
|
|
10
|
+
get(key: string): Observable<Maybe<StoredDataString>>;
|
|
11
|
+
set(key: string, value: StoredDataString): Observable<void>;
|
|
12
|
+
remove(key: string): Observable<void>;
|
|
13
|
+
clear(): Observable<StoredDataString[]>;
|
|
14
|
+
all(): Observable<StoredDataString[]>;
|
|
15
|
+
allKeys(): Observable<string[]>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ModuleWithProviders } from '@angular/core';
|
|
2
|
+
import { FullStorageObject } from '@dereekb/util';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare function defaultStorageObjectFactory(): FullStorageObject;
|
|
5
|
+
export declare class AppStorageModule {
|
|
6
|
+
static forRoot(): ModuleWithProviders<AppStorageModule>;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AppStorageModule, never>;
|
|
8
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AppStorageModule, never, never, never>;
|
|
9
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<AppStorageModule>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FullStorageObject, Maybe, StorageObject, StoredDataStorageKey } from '@dereekb/util';
|
|
2
|
+
/**
|
|
3
|
+
* StorageObject using LocalStorage.
|
|
4
|
+
*/
|
|
5
|
+
export declare class FullLocalStorageObject implements FullStorageObject {
|
|
6
|
+
private _localStorage;
|
|
7
|
+
constructor(_localStorage: StorageObject);
|
|
8
|
+
get isPersistant(): boolean;
|
|
9
|
+
get isAvailable(): boolean;
|
|
10
|
+
get length(): number;
|
|
11
|
+
getItem(key: StoredDataStorageKey): Maybe<string>;
|
|
12
|
+
setItem(key: StoredDataStorageKey, item: string): void;
|
|
13
|
+
removeItem(key: StoredDataStorageKey): void;
|
|
14
|
+
key(index: number): string | null;
|
|
15
|
+
removeAll(): string[];
|
|
16
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FullLocalStorageObject } from './storage.object.localstorage';
|
|
2
|
+
/**
|
|
3
|
+
* FullStorageObject implementation that uses a localstorage that entirely resides in memory.
|
|
4
|
+
*/
|
|
5
|
+
export declare class MemoryStorageObject extends FullLocalStorageObject {
|
|
6
|
+
get isLastingStorage(): boolean;
|
|
7
|
+
get isAvailable(): boolean;
|
|
8
|
+
constructor();
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './subscription.directive';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
2
|
+
import { Subscription } from 'rxjs';
|
|
3
|
+
import { LockSet } from '@dereekb/rxjs';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Abstract component that contains a SubscriptionObject and will clean it up automatically.
|
|
7
|
+
*/
|
|
8
|
+
export declare abstract class AbstractSubscriptionDirective implements OnDestroy {
|
|
9
|
+
private _subscriptionObject;
|
|
10
|
+
constructor(subscription?: Subscription);
|
|
11
|
+
ngOnDestroy(): void;
|
|
12
|
+
protected set sub(subscription: Subscription | undefined);
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractSubscriptionDirective, never>;
|
|
14
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractSubscriptionDirective, never, never, {}, {}, never>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* AbstractSubscriptionDirective extension that prevents the OnDestroy from occuring until the lockset is unlocked.
|
|
18
|
+
*/
|
|
19
|
+
export declare abstract class AbstractLockSetSubscriptionDirective extends AbstractSubscriptionDirective implements OnDestroy {
|
|
20
|
+
readonly lockSet: LockSet;
|
|
21
|
+
ngOnDestroy(): void;
|
|
22
|
+
protected onLockSetDestroy(): void;
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractLockSetSubscriptionDirective, never>;
|
|
24
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractLockSetSubscriptionDirective, never, never, {}, {}, never>;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './view';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ChangeDetectorRef, ElementRef } from "@angular/core";
|
|
2
|
+
import { Maybe } from "@dereekb/util";
|
|
3
|
+
/**
|
|
4
|
+
* Triggers a detection change on the input view as long as the view has not been destroyed.
|
|
5
|
+
*
|
|
6
|
+
* @param cdRef
|
|
7
|
+
*/
|
|
8
|
+
export declare function safeDetectChanges(cdRef: ChangeDetectorRef): void;
|
|
9
|
+
/**
|
|
10
|
+
* Used to check an injected ElementRef that wraps an ng-content injection point whether or not any content was injected,
|
|
11
|
+
* or more specifically if the parent component passed any target content to the child. This will still return true if
|
|
12
|
+
* passed content is empty.
|
|
13
|
+
*
|
|
14
|
+
* TS:
|
|
15
|
+
* @ViewChild('customLoading', { static: false }) customCustom: ElementRef;
|
|
16
|
+
*
|
|
17
|
+
* HTML:
|
|
18
|
+
* <div #customContent>
|
|
19
|
+
* <ng-content select="[content]"></ng-content>
|
|
20
|
+
* </div>
|
|
21
|
+
*/
|
|
22
|
+
export declare function checkNgContentWrapperHasContent(ref: Maybe<ElementRef<Element>>): boolean;
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dereekb/dbx-core",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": "^13.1.0",
|
|
6
|
+
"@angular/core": "^13.1.0",
|
|
7
|
+
"@ngrx/component-store": "^13.0.2",
|
|
8
|
+
"@ngrx/data": "^13.0.2",
|
|
9
|
+
"@ngrx/effects": "^13.0.2",
|
|
10
|
+
"@ngrx/entity": "^13.0.2",
|
|
11
|
+
"@ngrx/store": "^13.0.2",
|
|
12
|
+
"@ngrx/store-devtools": "^13.0.2",
|
|
13
|
+
"rxjs": "^7.5.2",
|
|
14
|
+
"@dereekb/util": "0.0.1",
|
|
15
|
+
"extra-set": "^2.2.11",
|
|
16
|
+
"@dereekb/rxjs": "0.0.1",
|
|
17
|
+
"ms": "^3.0.0-canary.1",
|
|
18
|
+
"@angular/platform-browser": "13.2.0",
|
|
19
|
+
"date-fns": "2.28.0",
|
|
20
|
+
"@dereekb/date": "0.0.1",
|
|
21
|
+
"date-fns-tz": "1.2.2",
|
|
22
|
+
"class-transformer": "0.5.1",
|
|
23
|
+
"class-validator": "0.13.2",
|
|
24
|
+
"reflect-metadata": "0.1.13",
|
|
25
|
+
"rrule": "dereekb/rrule#17adf5708d6567b4d01a3a8afd106261421ea492",
|
|
26
|
+
"@angular/router": "13.2.0",
|
|
27
|
+
"@uirouter/core": "^6.0.8"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"tslib": "^2.3.0"
|
|
31
|
+
},
|
|
32
|
+
"module": "fesm2015/dereekb-dbx-core.mjs",
|
|
33
|
+
"es2020": "fesm2020/dereekb-dbx-core.mjs",
|
|
34
|
+
"esm2020": "esm2020/dereekb-dbx-core.mjs",
|
|
35
|
+
"fesm2020": "fesm2020/dereekb-dbx-core.mjs",
|
|
36
|
+
"fesm2015": "fesm2015/dereekb-dbx-core.mjs",
|
|
37
|
+
"typings": "dereekb-dbx-core.d.ts",
|
|
38
|
+
"exports": {
|
|
39
|
+
"./package.json": {
|
|
40
|
+
"default": "./package.json"
|
|
41
|
+
},
|
|
42
|
+
".": {
|
|
43
|
+
"types": "./dereekb-dbx-core.d.ts",
|
|
44
|
+
"esm2020": "./esm2020/dereekb-dbx-core.mjs",
|
|
45
|
+
"es2020": "./fesm2020/dereekb-dbx-core.mjs",
|
|
46
|
+
"es2015": "./fesm2015/dereekb-dbx-core.mjs",
|
|
47
|
+
"node": "./fesm2015/dereekb-dbx-core.mjs",
|
|
48
|
+
"default": "./fesm2020/dereekb-dbx-core.mjs"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"sideEffects": false
|
|
52
|
+
}
|