@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,23 @@
|
|
|
1
|
+
import { ActionContextStoreSource } from './action.store.source';
|
|
2
|
+
import { HandleActionFunction } from './action.handler';
|
|
3
|
+
import { ActionContextBaseSource } from './action.holder';
|
|
4
|
+
import { Destroyable } from '@dereekb/util';
|
|
5
|
+
export interface ActionContextMachineConfig<T = any, O = any> {
|
|
6
|
+
/**
|
|
7
|
+
* Whether or not the machine should clean itself up after being triggered.
|
|
8
|
+
*/
|
|
9
|
+
oneTimeUse: boolean;
|
|
10
|
+
handleValueReady: HandleActionFunction<T, O>;
|
|
11
|
+
onSuccess?: (value: O) => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Configurable machine that handles components of the ActionContextStore lifecycle.
|
|
15
|
+
*/
|
|
16
|
+
export declare class ActionContextMachine<T = any, O = any> extends ActionContextBaseSource<T, O> implements Destroyable {
|
|
17
|
+
readonly config: ActionContextMachineConfig<T, O>;
|
|
18
|
+
private _isShutdown;
|
|
19
|
+
private _handleValueReadySub;
|
|
20
|
+
constructor(config: ActionContextMachineConfig<T, O>, source?: ActionContextStoreSource);
|
|
21
|
+
destroy(): void;
|
|
22
|
+
get isShutdown(): boolean;
|
|
23
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./directive/context/action.component";
|
|
3
|
+
import * as i2 from "./directive/context/action.directive";
|
|
4
|
+
import * as i3 from "./directive/map/action.map.directive";
|
|
5
|
+
import * as i4 from "./directive/map/action.map.key.directive";
|
|
6
|
+
import * as i5 from "./directive/map/action.map.source.directive";
|
|
7
|
+
import * as i6 from "./directive/map/action.map.working.disable.directive";
|
|
8
|
+
import * as i7 from "./directive/context/action.source.directive";
|
|
9
|
+
import * as i8 from "./directive/state/action.handler.directive";
|
|
10
|
+
import * as i9 from "./directive/state/action.disabled.directive";
|
|
11
|
+
import * as i10 from "./directive/state/action.disabled.modified.directive";
|
|
12
|
+
import * as i11 from "./directive/auto/action.autotrigger.directive";
|
|
13
|
+
import * as i12 from "./directive/auto/action.autotrigger.value.directive";
|
|
14
|
+
import * as i13 from "./directive/auto/action.automodify.directive";
|
|
15
|
+
import * as i14 from "./directive/state/action.value.directive";
|
|
16
|
+
import * as i15 from "./directive/debug/action.logger.directive";
|
|
17
|
+
import * as i16 from "./directive/state/action.success.component";
|
|
18
|
+
import * as i17 from "./directive/state/action.success.directive";
|
|
19
|
+
import * as i18 from "./directive/state/action.working.component";
|
|
20
|
+
import * as i19 from "@angular/common";
|
|
21
|
+
export declare class DbNgxCoreActionModule {
|
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbNgxCoreActionModule, never>;
|
|
23
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DbNgxCoreActionModule, [typeof i1.DbNgxActionComponent, typeof i2.DbNgxActionContextDirective, typeof i3.DbNgxActionContextMapDirective, typeof i4.DbNgxActionFromMapDirective, typeof i5.DbNgxActionMapSourceDirective, typeof i6.DbNgxActionMapWorkingDisableDirective, typeof i7.DbNgxActionSourceDirective, typeof i8.DbNgxActionHandlerDirective, typeof i9.DbNgxActionDisabledDirective, typeof i10.DbNgxActionDisabledUntilModifiedDirective, typeof i11.DbNgxActionAutoTriggerDirective, typeof i12.DbNgxActionAutoTriggerValueDirective, typeof i13.DbNgxActionAutoModifyDirective, typeof i14.DbNgxActionValueDirective, typeof i15.DbNgxActionContextLoggerDirective, typeof i16.DbNgxActionSuccessComponent, typeof i17.DbNgxActionSuccessDirective, typeof i18.DbNgxActionWorkingComponent], [typeof i19.CommonModule], [typeof i1.DbNgxActionComponent, typeof i2.DbNgxActionContextDirective, typeof i3.DbNgxActionContextMapDirective, typeof i4.DbNgxActionFromMapDirective, typeof i5.DbNgxActionMapSourceDirective, typeof i6.DbNgxActionMapWorkingDisableDirective, typeof i7.DbNgxActionSourceDirective, typeof i8.DbNgxActionHandlerDirective, typeof i9.DbNgxActionDisabledDirective, typeof i10.DbNgxActionDisabledUntilModifiedDirective, typeof i11.DbNgxActionAutoTriggerDirective, typeof i12.DbNgxActionAutoTriggerValueDirective, typeof i13.DbNgxActionAutoModifyDirective, typeof i14.DbNgxActionValueDirective, typeof i15.DbNgxActionContextLoggerDirective, typeof i16.DbNgxActionSuccessComponent, typeof i17.DbNgxActionSuccessDirective, typeof i18.DbNgxActionWorkingComponent]>;
|
|
24
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DbNgxCoreActionModule>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
2
|
+
import { ComponentStore } from '@ngrx/component-store';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { BooleanStringKeyArray, Maybe, ReadableError } from '@dereekb/util';
|
|
5
|
+
import { LockSet } from '@dereekb/rxjs';
|
|
6
|
+
import { ActionState } from './action';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare function isActionContextEnabled(state: ActionContextState): boolean;
|
|
9
|
+
export declare function isActionContextDisabled(state: ActionContextState): boolean;
|
|
10
|
+
export declare function isDisabledActionContextState(state: ActionContextState): boolean;
|
|
11
|
+
export declare function isWorkingActionState(actionState: ActionState): boolean;
|
|
12
|
+
export declare function canTriggerActionState(actionState: ActionState): boolean;
|
|
13
|
+
export declare function canTriggerAction(state: ActionContextState): boolean;
|
|
14
|
+
export declare function canReadyValue(state: ActionContextState): boolean;
|
|
15
|
+
export declare function actionContextIsModifiedAndCanTrigger(state: ActionContextState): boolean;
|
|
16
|
+
export declare function actionContextHasNoErrorAndIsModifiedAndCanTrigger(state: ActionContextState): boolean;
|
|
17
|
+
export interface ActionContextState<T = any, O = any> {
|
|
18
|
+
actionState: ActionState;
|
|
19
|
+
isModified: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Value that is set after a triggered action.
|
|
22
|
+
*/
|
|
23
|
+
value?: Maybe<T>;
|
|
24
|
+
result?: Maybe<O>;
|
|
25
|
+
error?: Maybe<ReadableError>;
|
|
26
|
+
/**
|
|
27
|
+
* Current disabled state.
|
|
28
|
+
*/
|
|
29
|
+
disabled?: BooleanStringKeyArray;
|
|
30
|
+
/**
|
|
31
|
+
* Number of consecutive errors that have occured.
|
|
32
|
+
*/
|
|
33
|
+
errorCount?: number;
|
|
34
|
+
}
|
|
35
|
+
export declare class ActionContextStore<T = any, O = any> extends ComponentStore<ActionContextState<T, O>> implements OnDestroy {
|
|
36
|
+
readonly lockSet: LockSet;
|
|
37
|
+
constructor();
|
|
38
|
+
readonly actionState$: Observable<ActionState>;
|
|
39
|
+
/**
|
|
40
|
+
* Returns the current disabled reasons.
|
|
41
|
+
*/
|
|
42
|
+
readonly disabled$: Observable<string[]>;
|
|
43
|
+
/**
|
|
44
|
+
* Maps the current state to true or not when the action state changes to/from disabled.
|
|
45
|
+
*/
|
|
46
|
+
readonly isDisabled$: Observable<boolean>;
|
|
47
|
+
/**
|
|
48
|
+
* Pipes when idle but modified.
|
|
49
|
+
*/
|
|
50
|
+
readonly isModified$: Observable<boolean>;
|
|
51
|
+
/**
|
|
52
|
+
* Pipes true when triggered.
|
|
53
|
+
*/
|
|
54
|
+
readonly triggered$: Observable<boolean>;
|
|
55
|
+
/**
|
|
56
|
+
* Pipes the readied value on ValueReady.
|
|
57
|
+
*/
|
|
58
|
+
readonly valueReady$: Observable<any>;
|
|
59
|
+
/**
|
|
60
|
+
* Pipes the error on the rejection state.
|
|
61
|
+
*/
|
|
62
|
+
readonly rejected$: Observable<Maybe<ReadableError>>;
|
|
63
|
+
/**
|
|
64
|
+
* Pipes the result when the ActionState becomes working.
|
|
65
|
+
*/
|
|
66
|
+
readonly working$: Observable<boolean>;
|
|
67
|
+
/**
|
|
68
|
+
* Whether or not it is currently in a working state.
|
|
69
|
+
*/
|
|
70
|
+
readonly isWorking$: Observable<boolean>;
|
|
71
|
+
/**
|
|
72
|
+
* Pipes the current error.
|
|
73
|
+
*/
|
|
74
|
+
readonly error$: Observable<Maybe<ReadableError>>;
|
|
75
|
+
/**
|
|
76
|
+
* Pipes the result when the ActionState becomes success.
|
|
77
|
+
*/
|
|
78
|
+
readonly success$: Observable<any>;
|
|
79
|
+
/**
|
|
80
|
+
* Whether or not it is currently in a success state.
|
|
81
|
+
*/
|
|
82
|
+
readonly isSuccess$: Observable<boolean>;
|
|
83
|
+
/**
|
|
84
|
+
* Number of errors since last success.
|
|
85
|
+
*/
|
|
86
|
+
readonly errorCountSinceLastSuccess$: Observable<number>;
|
|
87
|
+
/**
|
|
88
|
+
* Whether or not the state can be triggered.
|
|
89
|
+
*/
|
|
90
|
+
readonly canTrigger$: Observable<boolean>;
|
|
91
|
+
/**
|
|
92
|
+
* Pipe that maps whether or not this is modified and can be triggered.
|
|
93
|
+
*
|
|
94
|
+
* Updates every state update instead of when the value changes.
|
|
95
|
+
*/
|
|
96
|
+
readonly isModifiedAndCanTriggerUpdates$: Observable<boolean>;
|
|
97
|
+
/**
|
|
98
|
+
* Whether or not it can be triggered and modified.
|
|
99
|
+
*/
|
|
100
|
+
readonly isModifiedAndCanTrigger$: Observable<boolean>;
|
|
101
|
+
readonly hasNoErrorAndIsModifiedAndCanTrigger$: Observable<boolean>;
|
|
102
|
+
/**
|
|
103
|
+
* Adds a disabled reason.
|
|
104
|
+
*/
|
|
105
|
+
readonly disable: (() => void) | ((observableOrValue: string | void | Observable<string | void>) => import("rxjs").Subscription);
|
|
106
|
+
/**
|
|
107
|
+
* Removes a disabled reason.
|
|
108
|
+
*/
|
|
109
|
+
readonly enable: (() => void) | ((observableOrValue: string | void | Observable<string | void>) => import("rxjs").Subscription);
|
|
110
|
+
/**
|
|
111
|
+
* Triggers the modified state, if not disabled.
|
|
112
|
+
*/
|
|
113
|
+
readonly setIsModified: (() => void) | ((observableOrValue: boolean | void | Observable<boolean | void>) => import("rxjs").Subscription);
|
|
114
|
+
/**
|
|
115
|
+
* Triggers the action if the state is currently not idle. The current state is cleared, but the error is retained (as we may need the error from the previous attempt).
|
|
116
|
+
*
|
|
117
|
+
* Will not fire if the action is disabled.
|
|
118
|
+
*/
|
|
119
|
+
readonly trigger: () => void;
|
|
120
|
+
/**
|
|
121
|
+
* Updates the value, setting value ready. The current result is cleared.
|
|
122
|
+
*/
|
|
123
|
+
readonly readyValue: (() => void) | ((observableOrValue: Maybe<T> | Observable<Maybe<T>>) => import("rxjs").Subscription) | (T extends void ? () => void : (observableOrValue: Maybe<T> | Observable<Maybe<T>>) => import("rxjs").Subscription);
|
|
124
|
+
/**
|
|
125
|
+
* Notifys the context that the action is in progress.
|
|
126
|
+
*/
|
|
127
|
+
readonly startWorking: () => void;
|
|
128
|
+
/**
|
|
129
|
+
* Triggers rejection of the action. The value is cleared.
|
|
130
|
+
*/
|
|
131
|
+
readonly reject: (() => void) | ((observableOrValue: Maybe<ReadableError> | Observable<Maybe<ReadableError>>) => import("rxjs").Subscription);
|
|
132
|
+
/**
|
|
133
|
+
* Updates the state to success, and optionally sets a result.
|
|
134
|
+
*
|
|
135
|
+
* Clears modified state, and any errors.
|
|
136
|
+
*/
|
|
137
|
+
readonly success: O extends void ? () => void : (observableOrValue: O | Observable<O>) => import("rxjs").Subscription;
|
|
138
|
+
/**
|
|
139
|
+
* Completely resets the store.
|
|
140
|
+
*/
|
|
141
|
+
readonly reset: () => void;
|
|
142
|
+
afterDistinctBoolean(fromState: (state: ActionContextState) => boolean): Observable<boolean>;
|
|
143
|
+
afterDistinctActionState<X>(actionState: ActionState, fromState: (state: ActionContextState) => X): Observable<X>;
|
|
144
|
+
ngOnDestroy(): void;
|
|
145
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ActionContextStore<any, any>, never>;
|
|
146
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ActionContextStore<any, any>>;
|
|
147
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Observable, Subscription } from 'rxjs';
|
|
2
|
+
import { Provider, Type } from '@angular/core';
|
|
3
|
+
import { LockSet } from '@dereekb/rxjs';
|
|
4
|
+
import { OnDestroy } from '@angular/core';
|
|
5
|
+
import { Maybe, ReadableError } from '@dereekb/util';
|
|
6
|
+
import { ActionContextState, ActionContextStore } from './action.store';
|
|
7
|
+
import { ActionDisabledKey, ActionState } from './action';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
/**
|
|
10
|
+
* Source that provides a ActionContextStore observable.
|
|
11
|
+
*/
|
|
12
|
+
export declare abstract class ActionContextStoreSource<T = any, O = any> {
|
|
13
|
+
/**
|
|
14
|
+
* Observable referencing the ActionContextStore.
|
|
15
|
+
*
|
|
16
|
+
* This observable by design is pre-filtered to not return null values.
|
|
17
|
+
*/
|
|
18
|
+
abstract readonly store$: Observable<ActionContextStore<T, O>>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Secondary source. Used by DbNgxActionContextComponent to find secondary sources.
|
|
22
|
+
*/
|
|
23
|
+
export declare abstract class SecondaryActionContextStoreSource<T = any, O = any> extends ActionContextStoreSource<T, O> {
|
|
24
|
+
}
|
|
25
|
+
export declare function actionContextStoreSourcePipe<T, O>(obs: Observable<Maybe<ActionContextStore<T, O>>>): Observable<ActionContextStore<T, O>>;
|
|
26
|
+
export declare type PipeActionStoreFunction<R, T, O> = (store: ActionContextStore<T, O>) => Observable<R>;
|
|
27
|
+
export declare function pipeActionStore<R = any, T = any, O = any>(source: ActionContextStoreSource<T, O>, pipeFn: PipeActionStoreFunction<R, T, O>): Observable<R>;
|
|
28
|
+
export declare type UseActionStoreFunction<T, O> = (store: ActionContextStore<T, O>) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Convenience function for subscribing to the input source once and using the provided store.
|
|
31
|
+
*/
|
|
32
|
+
export declare function useActionStore<T = any, O = any>(source: ActionContextStoreSource<T, O>, useFn: UseActionStoreFunction<T, O>): Subscription;
|
|
33
|
+
export declare class ActionContextStoreSourceInstance<T = any, O = any> implements OnDestroy {
|
|
34
|
+
readonly source: ActionContextStoreSource<T, O>;
|
|
35
|
+
readonly lockSet: LockSet;
|
|
36
|
+
constructor(source: ActionContextStoreSource<T, O>);
|
|
37
|
+
ngOnDestroy(): void;
|
|
38
|
+
get store$(): Observable<ActionContextStore<T, O>>;
|
|
39
|
+
pipeStore<R>(pipeFn: PipeActionStoreFunction<R, T, O>): Observable<R>;
|
|
40
|
+
useStore(useFn: UseActionStoreFunction<T, O>): Subscription;
|
|
41
|
+
get state$(): Observable<ActionContextState<T, O>>;
|
|
42
|
+
get triggered$(): Observable<boolean>;
|
|
43
|
+
get valueReady$(): Observable<T>;
|
|
44
|
+
get success$(): Observable<O>;
|
|
45
|
+
get error$(): Observable<Maybe<ReadableError>>;
|
|
46
|
+
get rejected$(): Observable<Maybe<ReadableError>>;
|
|
47
|
+
get isModified$(): Observable<boolean>;
|
|
48
|
+
get isModifiedAndCanTriggerUpdates$(): Observable<boolean>;
|
|
49
|
+
get isModifiedAndCanTrigger$(): Observable<boolean>;
|
|
50
|
+
get actionState$(): Observable<ActionState>;
|
|
51
|
+
get isWorking$(): Observable<boolean>;
|
|
52
|
+
get isSuccess$(): Observable<boolean>;
|
|
53
|
+
get isDisabled$(): Observable<boolean>;
|
|
54
|
+
get errorCountSinceLastSuccess$(): Observable<number>;
|
|
55
|
+
enable(key?: ActionDisabledKey, enable?: boolean): void;
|
|
56
|
+
disable(key?: ActionDisabledKey, disable?: boolean): void;
|
|
57
|
+
setIsModified(isModified?: boolean | Observable<boolean> | Observable<void>): void;
|
|
58
|
+
trigger(): void;
|
|
59
|
+
readyValue(value: Maybe<T | Observable<T>>): void;
|
|
60
|
+
startWorking(): void;
|
|
61
|
+
reject(error: Maybe<ReadableError | Observable<ReadableError>>): void;
|
|
62
|
+
success(value: O | Observable<O>): void;
|
|
63
|
+
reset(): void;
|
|
64
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ActionContextStoreSourceInstance<any, any>, never>;
|
|
65
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ActionContextStoreSourceInstance<any, any>, never, never, {}, {}, never>;
|
|
66
|
+
}
|
|
67
|
+
export declare const actionContextStoreSourceInstanceFactory: (source: ActionContextStoreSource) => ActionContextStoreSourceInstance<any, any>;
|
|
68
|
+
/**
|
|
69
|
+
* Provides an ActionContextStoreSource, as well as an ActionContextStoreSourceInstance.
|
|
70
|
+
*/
|
|
71
|
+
export declare function ProvideActionStoreSource<S>(sourceType: Type<S>): Provider[];
|
|
72
|
+
export declare function ProvideSecondaryActionStoreSource<S>(sourceType: Type<S>): Provider[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { OnInit, OnDestroy } from '@angular/core';
|
|
2
|
+
import { AbstractSubscriptionDirective } from '../../../subscription';
|
|
3
|
+
import { ActionContextStoreSourceInstance } from '../../action.store.source';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class DbNgxActionAutoModifyDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {
|
|
6
|
+
readonly source: ActionContextStoreSourceInstance<T, O>;
|
|
7
|
+
private readonly _autoModifyEnabled;
|
|
8
|
+
get autoModifyEnabled(): boolean;
|
|
9
|
+
set autoModifyEnabled(autoModifyEnabled: boolean);
|
|
10
|
+
constructor(source: ActionContextStoreSourceInstance<T, O>);
|
|
11
|
+
ngOnInit(): void;
|
|
12
|
+
ngOnDestroy(): void;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbNgxActionAutoModifyDirective<any, any>, [{ host: true; }]>;
|
|
14
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DbNgxActionAutoModifyDirective<any, any>, "[dbxActionAutoModify]", never, { "autoModifyEnabled": "dbxActionAutoModify"; }, {}, never>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { OnInit, OnDestroy } from '@angular/core';
|
|
2
|
+
import { AbstractSubscriptionDirective } from '../../../subscription';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { ActionContextStoreSourceInstance } from '../../action.store.source';
|
|
5
|
+
import { Maybe } from '@dereekb/util';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* Extension of DbNgxActionTransitionSafetyDirective that automatically triggers the action periodically when it is in a modified state.
|
|
9
|
+
*/
|
|
10
|
+
export declare class DbNgxActionAutoTriggerDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {
|
|
11
|
+
readonly source: ActionContextStoreSourceInstance<T, O>;
|
|
12
|
+
private _triggerEnabled;
|
|
13
|
+
/**
|
|
14
|
+
* How much to throttle the auto-triggering.
|
|
15
|
+
*/
|
|
16
|
+
get triggerEnabled(): boolean;
|
|
17
|
+
set triggerEnabled(triggerEnabled: boolean);
|
|
18
|
+
triggerDebounce: number;
|
|
19
|
+
triggerThrottle: number;
|
|
20
|
+
triggerErrorThrottle: number;
|
|
21
|
+
maxErrorsForThrottle: number;
|
|
22
|
+
/**
|
|
23
|
+
* Optional input to override both triggerDebounce and triggerThrottle.
|
|
24
|
+
*
|
|
25
|
+
* Used in forms that are simple.
|
|
26
|
+
*/
|
|
27
|
+
set fastTrigger(fastTrigger: boolean);
|
|
28
|
+
/**
|
|
29
|
+
* Optional input to override both triggerDebounce and triggerThrottle to be 0.
|
|
30
|
+
*
|
|
31
|
+
* Used in forms that generally return a single value.
|
|
32
|
+
*/
|
|
33
|
+
set instantTrigger(instantTrigger: boolean);
|
|
34
|
+
get triggerLimit(): Maybe<number>;
|
|
35
|
+
set triggerLimit(triggerLimit: Maybe<number>);
|
|
36
|
+
private readonly _triggerLimit;
|
|
37
|
+
private readonly _trigger;
|
|
38
|
+
private _triggerCount;
|
|
39
|
+
readonly _errorCount$: Observable<number>;
|
|
40
|
+
readonly _triggerCount$: Observable<number>;
|
|
41
|
+
/**
|
|
42
|
+
* Observable for the trigger mechanism.
|
|
43
|
+
*/
|
|
44
|
+
readonly triggerCount$: Observable<number>;
|
|
45
|
+
private readonly _isTriggerLimited$;
|
|
46
|
+
readonly isTriggerLimited$: Observable<boolean>;
|
|
47
|
+
readonly trigger$: Observable<void>;
|
|
48
|
+
constructor(source: ActionContextStoreSourceInstance<T, O>);
|
|
49
|
+
get isEnabled(): boolean;
|
|
50
|
+
ngOnInit(): void;
|
|
51
|
+
ngOnDestroy(): void;
|
|
52
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbNgxActionAutoTriggerDirective<any, any>, [{ host: true; }]>;
|
|
53
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DbNgxActionAutoTriggerDirective<any, any>, "[dbxActionAutoTrigger]", never, { "triggerEnabled": "dbxActionAutoTrigger"; "triggerDebounce": "triggerDebounce"; "triggerThrottle": "triggerThrottle"; "triggerErrorThrottle": "triggerErrorThrottle"; "fastTrigger": "fastTrigger"; "instantTrigger": "instantTrigger"; "triggerLimit": "triggerLimit"; }, {}, never>;
|
|
54
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ActionContextStoreSourceInstance } from '../../action.store.source';
|
|
2
|
+
import { OnInit } from '@angular/core';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { OnDestroy } from '@angular/core';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare type DbNgxActionAutoTriggerIsModifiedFn<T> = (value: T) => Observable<boolean>;
|
|
7
|
+
/**
|
|
8
|
+
* Directive that watches an observable for changes and sets the new value and modified states as necessary.
|
|
9
|
+
*/
|
|
10
|
+
export declare class DbNgxActionAutoTriggerValueDirective<T, O> implements OnInit, OnDestroy {
|
|
11
|
+
readonly source: ActionContextStoreSourceInstance<T, O>;
|
|
12
|
+
private _valueObs;
|
|
13
|
+
private _isModifiedFn;
|
|
14
|
+
private _modifiedSub;
|
|
15
|
+
private _triggerSub;
|
|
16
|
+
set dbxActionAutoTriggerValue(dbxActionAutoTriggerValue: Observable<T>);
|
|
17
|
+
set dbxActionAutoTriggerModifiedNonEmptyValue(requireNonEmpty: boolean);
|
|
18
|
+
set dbxActionAutoTriggerModified(dbxActionAutoTriggerModified: DbNgxActionAutoTriggerIsModifiedFn<T>);
|
|
19
|
+
readonly modifiedValue$: Observable<[boolean, T]>;
|
|
20
|
+
constructor(source: ActionContextStoreSourceInstance<T, O>);
|
|
21
|
+
ngOnInit(): void;
|
|
22
|
+
ngOnDestroy(): void;
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbNgxActionAutoTriggerValueDirective<any, any>, [{ host: true; }]>;
|
|
24
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DbNgxActionAutoTriggerValueDirective<any, any>, "[dbxActionAutoTriggerValue]", never, { "dbxActionAutoTriggerValue": "dbxActionAutoTriggerValue"; "dbxActionAutoTriggerModifiedNonEmptyValue": "dbxActionAutoTriggerModifiedNonEmptyValue"; "dbxActionAutoTriggerModified": "dbxActionAutoTriggerModified"; }, {}, never>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DbNgxActionContextDirective } from './action.directive';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class DbNgxActionComponent<T = any, O = any> extends DbNgxActionContextDirective<T, O> {
|
|
4
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbNgxActionComponent<any, any>, never>;
|
|
5
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbNgxActionComponent<any, any>, "dbx-action", ["action"], {}, {}, never, ["*"]>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
2
|
+
import { SecondaryActionContextStoreSource } from '../../action.store.source';
|
|
3
|
+
import { ActionContextBaseSource } from '../../action.holder';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Provides an DbNgxActionContext.
|
|
7
|
+
*/
|
|
8
|
+
export declare class DbNgxActionContextDirective<T = any, O = any> extends ActionContextBaseSource implements OnDestroy {
|
|
9
|
+
constructor(inputSource: SecondaryActionContextStoreSource);
|
|
10
|
+
ngOnDestroy(): void;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbNgxActionContextDirective<any, any>, [{ optional: true; host: true; }]>;
|
|
12
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DbNgxActionContextDirective<any, any>, "[dbxActionContext]", ["action"], {}, {}, never>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
2
|
+
import { Maybe } from '@dereekb/util';
|
|
3
|
+
import { SecondaryActionContextStoreSource, ActionContextStoreSource } from '../../action.store.source';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Directive that provides a DbNgxActionSourceDirective that is passed in.
|
|
7
|
+
*/
|
|
8
|
+
export declare class DbNgxActionSourceDirective implements SecondaryActionContextStoreSource, OnDestroy {
|
|
9
|
+
private _source;
|
|
10
|
+
readonly store$: import("rxjs").Observable<import("@dereekb/dbx-core").ActionContextStore<any, any>>;
|
|
11
|
+
ngOnDestroy(): void;
|
|
12
|
+
get source(): Maybe<ActionContextStoreSource>;
|
|
13
|
+
set source(source: Maybe<ActionContextStoreSource>);
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbNgxActionSourceDirective, never>;
|
|
15
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DbNgxActionSourceDirective, "[dbxActionSource]", never, { "source": "dbxActionSource"; }, {}, never>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { AbstractSubscriptionDirective } from '../../../subscription';
|
|
3
|
+
import { ActionContextStoreSourceInstance } from '../../action.store.source';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Prints out the current state to the console. Useful for debugging.
|
|
7
|
+
*/
|
|
8
|
+
export declare class DbNgxActionContextLoggerDirective extends AbstractSubscriptionDirective implements OnInit {
|
|
9
|
+
readonly source: ActionContextStoreSourceInstance;
|
|
10
|
+
constructor(source: ActionContextStoreSourceInstance);
|
|
11
|
+
ngOnInit(): void;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbNgxActionContextLoggerDirective, [{ host: true; }]>;
|
|
13
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DbNgxActionContextLoggerDirective, "[dbxActionContextLogger]", never, {}, {}, never>;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './action.logger.directive';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ActionContextStoreSource } from '../../action.store.source';
|
|
2
|
+
export declare type ActionKey = string;
|
|
3
|
+
/**
|
|
4
|
+
* Map that returns sources for ActionKey values.
|
|
5
|
+
*/
|
|
6
|
+
export declare abstract class ActionContextStoreSourceMap<T = any, O = any> {
|
|
7
|
+
/**
|
|
8
|
+
* Returns a ActionContextStoreSource for the input action key.
|
|
9
|
+
*
|
|
10
|
+
* @param key Action key to retrieve the source for.
|
|
11
|
+
*/
|
|
12
|
+
abstract sourceForKey(key: ActionKey): ActionContextStoreSource<T, O>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { ActionContextStoreSource } from '../../action.store.source';
|
|
4
|
+
import { ActionContextStore } from '../../action.store';
|
|
5
|
+
import { ActionContextStoreSourceMap, ActionKey } from './action.map';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* Context used for providing actions based on the action key.
|
|
9
|
+
*
|
|
10
|
+
* This is useful for passing action contexts around via the providers instead of explicit injection.
|
|
11
|
+
*/
|
|
12
|
+
export declare class DbNgxActionContextMapDirective implements ActionContextStoreSourceMap, OnDestroy {
|
|
13
|
+
private readonly _map;
|
|
14
|
+
readonly map$: Observable<Map<string, ActionContextStoreSource<any, any>>>;
|
|
15
|
+
readonly areAnyWorking$: Observable<boolean>;
|
|
16
|
+
constructor();
|
|
17
|
+
get map(): Map<ActionKey, ActionContextStoreSource>;
|
|
18
|
+
sourceForKey(key: ActionKey): ActionContextStoreSource<any, any>;
|
|
19
|
+
addStoreSource(key: ActionKey, source: ActionContextStoreSource): void;
|
|
20
|
+
removeStore(key: ActionKey): void;
|
|
21
|
+
ngOnDestroy(): void;
|
|
22
|
+
checkAnyAre(mapFn: (input: ActionContextStore) => Observable<boolean>, emptyArrayValue?: boolean): Observable<boolean>;
|
|
23
|
+
reduceFromAllSources<O, R>(mapFn: (input: ActionContextStore) => Observable<O>, reduceFn: (values: O[]) => R): Observable<R>;
|
|
24
|
+
fromAllSources<O>(mapFn: (input: ActionContextStore) => Observable<O>): Observable<O[]>;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbNgxActionContextMapDirective, never>;
|
|
26
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DbNgxActionContextMapDirective, "[dbxActionContextMap]", ["actionMap"], {}, {}, never>;
|
|
27
|
+
}
|
|
28
|
+
export declare class DbNgxActionContextMapDirectiveSourceInstance implements ActionContextStoreSource {
|
|
29
|
+
private readonly parent;
|
|
30
|
+
readonly key: ActionKey;
|
|
31
|
+
readonly _source$: Observable<ActionContextStoreSource<any, any> | undefined>;
|
|
32
|
+
readonly _store$: Observable<ActionContextStore<any, any> | undefined>;
|
|
33
|
+
readonly store$: Observable<ActionContextStore<any, any>>;
|
|
34
|
+
constructor(parent: DbNgxActionContextMapDirective, key: ActionKey);
|
|
35
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
2
|
+
import { Maybe } from '@dereekb/util';
|
|
3
|
+
import { ActionKey } from './action.map';
|
|
4
|
+
import { SecondaryActionContextStoreSource } from '../../action.store.source';
|
|
5
|
+
import { DbNgxActionContextMapDirective } from './action.map.directive';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* Directive that provides a ActionContextStoreSource using the input key and DbNgxActionContextMapDirective.
|
|
9
|
+
*/
|
|
10
|
+
export declare class DbNgxActionFromMapDirective implements SecondaryActionContextStoreSource, OnDestroy {
|
|
11
|
+
private readonly _map;
|
|
12
|
+
private _key;
|
|
13
|
+
readonly store$: import("rxjs").Observable<import("@dereekb/dbx-core").ActionContextStore<any, any>>;
|
|
14
|
+
constructor(_map: DbNgxActionContextMapDirective);
|
|
15
|
+
ngOnDestroy(): void;
|
|
16
|
+
get key(): Maybe<ActionKey>;
|
|
17
|
+
set key(key: Maybe<ActionKey>);
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbNgxActionFromMapDirective, never>;
|
|
19
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DbNgxActionFromMapDirective, "[dbxActionFromMap]", never, { "key": "dbxActionFromMap"; }, {}, never>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
2
|
+
import { ActionContextStoreSource } from '../../action.store.source';
|
|
3
|
+
import { DbNgxActionContextMapDirective } from './action.map.directive';
|
|
4
|
+
import { ActionKey } from './action.map';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* Used to communicate with an dbxActionMap and set the ActionContextStore to the store based on the key.
|
|
8
|
+
*/
|
|
9
|
+
export declare class DbNgxActionMapSourceDirective implements OnDestroy {
|
|
10
|
+
readonly source: ActionContextStoreSource;
|
|
11
|
+
private readonly _map;
|
|
12
|
+
private _key;
|
|
13
|
+
constructor(source: ActionContextStoreSource, _map: DbNgxActionContextMapDirective);
|
|
14
|
+
ngOnDestroy(): void;
|
|
15
|
+
set key(key: ActionKey);
|
|
16
|
+
private _addToStore;
|
|
17
|
+
private _removeFromToStore;
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbNgxActionMapSourceDirective, [{ host: true; }, null]>;
|
|
19
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DbNgxActionMapSourceDirective, "[dbxActionMapSource]", never, { "key": "dbxActionMapSource"; }, {}, never>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { OnInit, OnDestroy } from '@angular/core';
|
|
2
|
+
import { Maybe } from '@dereekb/util';
|
|
3
|
+
import { AbstractSubscriptionDirective } from '../../../subscription';
|
|
4
|
+
import { ActionContextStoreSourceInstance } from '../../action.store.source';
|
|
5
|
+
import { DbNgxActionContextMapDirective } from './action.map.directive';
|
|
6
|
+
import { ActionDisabledKey } from '../../action';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare const DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY = "";
|
|
9
|
+
/**
|
|
10
|
+
* Used to communicate with an dbxActionMap and set the ActionContextStore to be disabled if any other element in the map is working.
|
|
11
|
+
*/
|
|
12
|
+
export declare class DbNgxActionMapWorkingDisableDirective extends AbstractSubscriptionDirective implements OnInit, OnDestroy {
|
|
13
|
+
readonly source: ActionContextStoreSourceInstance;
|
|
14
|
+
private readonly _map;
|
|
15
|
+
disabledKey: Maybe<ActionDisabledKey>;
|
|
16
|
+
constructor(source: ActionContextStoreSourceInstance, _map: DbNgxActionContextMapDirective);
|
|
17
|
+
ngOnInit(): void;
|
|
18
|
+
ngOnDestroy(): void;
|
|
19
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbNgxActionMapWorkingDisableDirective, [{ host: true; }, null]>;
|
|
20
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DbNgxActionMapWorkingDisableDirective, "[dbxActionMapWorkingDisable]", never, { "disabledKey": "dbxActionMapWorkingDisable"; }, {}, never>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { OnInit, OnDestroy } from '@angular/core';
|
|
2
|
+
import { AbstractSubscriptionDirective } from '../../../subscription';
|
|
3
|
+
import { ActionContextStoreSourceInstance } from '../../action.store.source';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare const APP_ACTION_DISABLED_DIRECTIVE_KEY = "dbx_action_disabled";
|
|
6
|
+
/**
|
|
7
|
+
* Directive that allows disabling an action using the inputs.
|
|
8
|
+
*/
|
|
9
|
+
export declare class DbNgxActionDisabledDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {
|
|
10
|
+
readonly source: ActionContextStoreSourceInstance<T, O>;
|
|
11
|
+
private _disabled;
|
|
12
|
+
readonly disabled$: import("rxjs").Observable<boolean>;
|
|
13
|
+
constructor(source: ActionContextStoreSourceInstance<T, O>);
|
|
14
|
+
ngOnInit(): void;
|
|
15
|
+
ngOnDestroy(): void;
|
|
16
|
+
get disabled(): boolean;
|
|
17
|
+
set disabled(disabled: boolean);
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbNgxActionDisabledDirective<any, any>, [{ host: true; }]>;
|
|
19
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DbNgxActionDisabledDirective<any, any>, "[dbxActionDisabled]", never, { "disabled": "dbxActionDisabled"; }, {}, never>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { OnInit, OnDestroy } from '@angular/core';
|
|
2
|
+
import { AbstractSubscriptionDirective } from '../../../subscription';
|
|
3
|
+
import { ActionContextStoreSourceInstance } from '../../action.store.source';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare const APP_ACTION_DISABLED_UNTIL_MODIFIED_DIRECTIVE_KEY = "dbx_action_is_not_modified";
|
|
6
|
+
/**
|
|
7
|
+
* Directive that sets the disabled state based on the current isModified state.
|
|
8
|
+
*/
|
|
9
|
+
export declare class DbNgxActionDisabledUntilModifiedDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {
|
|
10
|
+
readonly source: ActionContextStoreSourceInstance<T, O>;
|
|
11
|
+
constructor(source: ActionContextStoreSourceInstance<T, O>);
|
|
12
|
+
ngOnInit(): void;
|
|
13
|
+
ngOnDestroy(): void;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbNgxActionDisabledUntilModifiedDirective<any, any>, [{ host: true; }]>;
|
|
15
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DbNgxActionDisabledUntilModifiedDirective<any, any>, "[dbxActionDisabledUntilModified]", never, {}, {}, never>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { AbstractSubscriptionDirective } from '../../../subscription';
|
|
3
|
+
import { ActionContextStoreSourceInstance } from '../../action.store.source';
|
|
4
|
+
import { HandleActionFunction } from '../../action.handler';
|
|
5
|
+
import { Maybe } from '@dereekb/util';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* Context used for defining a function that performs an action using the input function on ValueReady.
|
|
9
|
+
*/
|
|
10
|
+
export declare class DbNgxActionHandlerDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {
|
|
11
|
+
readonly source: ActionContextStoreSourceInstance<T, O>;
|
|
12
|
+
private _handlerFunction;
|
|
13
|
+
readonly handlerFunction$: import("rxjs").Observable<HandleActionFunction<T, O>>;
|
|
14
|
+
get handlerFunction(): Maybe<HandleActionFunction<T, O>>;
|
|
15
|
+
set handlerFunction(handlerFunction: Maybe<HandleActionFunction<T, O>>);
|
|
16
|
+
private _delegate;
|
|
17
|
+
constructor(source: ActionContextStoreSourceInstance<T, O>);
|
|
18
|
+
ngOnInit(): void;
|
|
19
|
+
ngOnDestroy(): void;
|
|
20
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbNgxActionHandlerDirective<any, any>, [{ host: true; }]>;
|
|
21
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DbNgxActionHandlerDirective<any, any>, "[dbxActionHandler]", never, { "handlerFunction": "dbxActionHandler"; }, {}, never>;
|
|
22
|
+
}
|