@dereekb/dbx-core 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/action/directive/state/action.value.stream.directive.mjs +1 -1
- package/esm2020/lib/action/directive/state/action.value.trigger.directive.mjs +73 -0
- package/esm2020/lib/action/directive/state/action.value.trigger.instance.mjs +42 -0
- package/esm2020/lib/action/directive/state/index.mjs +3 -1
- package/fesm2015/dereekb-dbx-core.mjs +110 -3
- package/fesm2015/dereekb-dbx-core.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-core.mjs +110 -3
- package/fesm2020/dereekb-dbx-core.mjs.map +1 -1
- package/lib/action/directive/state/action.value.stream.directive.d.ts +2 -2
- package/lib/action/directive/state/action.value.trigger.directive.d.ts +34 -0
- package/lib/action/directive/state/action.value.trigger.instance.d.ts +34 -0
- package/lib/action/directive/state/index.d.ts +2 -0
- package/package.json +8 -13
|
@@ -2,7 +2,7 @@ import { DbxActionContextStoreSourceInstance } from '../../action.store.source';
|
|
|
2
2
|
import { OnInit } from '@angular/core';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
4
|
import { OnDestroy } from '@angular/core';
|
|
5
|
-
import {
|
|
5
|
+
import { IsModifiedFunction } from '@dereekb/rxjs';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
/**
|
|
8
8
|
* Directive that watches a value observable for changes and sets the new value and modified states as necessary.
|
|
@@ -15,7 +15,7 @@ export declare class dbxActionValueStreamDirective<T, O> implements OnInit, OnDe
|
|
|
15
15
|
private _triggerSub;
|
|
16
16
|
set dbxActionValueStream(dbxActionValueStream: Observable<T>);
|
|
17
17
|
set dbxActionValueStreamIsNotEmpty(requireNonEmpty: any);
|
|
18
|
-
set dbxActionValueStreamModified(dbxActionValueStreamModified:
|
|
18
|
+
set dbxActionValueStreamModified(dbxActionValueStreamModified: IsModifiedFunction<T>);
|
|
19
19
|
readonly modifiedValue$: Observable<[boolean, T]>;
|
|
20
20
|
constructor(source: DbxActionContextStoreSourceInstance<T, O>);
|
|
21
21
|
ngOnInit(): void;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ElementRef, OnDestroy, OnInit } from "@angular/core";
|
|
2
|
+
import { IsModifiedFunction } from "@dereekb/rxjs";
|
|
3
|
+
import { Maybe } from "@dereekb/util";
|
|
4
|
+
import { DbxActionContextStoreSourceInstance } from "../../action.store.source";
|
|
5
|
+
import { DbxActionValueOnTriggerFunction } from "./action.value.trigger.instance";
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* Abstract class for directives that may perform an action when trigger is called, and returns a value.
|
|
9
|
+
*/
|
|
10
|
+
export declare abstract class AbstractDbxActionValueOnTriggerDirective<T> {
|
|
11
|
+
readonly source: DbxActionContextStoreSourceInstance<T, any>;
|
|
12
|
+
private readonly _instance;
|
|
13
|
+
private _triggeredSub;
|
|
14
|
+
constructor(source: DbxActionContextStoreSourceInstance<T, any>, valueGetter?: Maybe<DbxActionValueOnTriggerFunction<T>>);
|
|
15
|
+
get valueGetter(): Maybe<DbxActionValueOnTriggerFunction<T>>;
|
|
16
|
+
set valueGetter(valueGetter: Maybe<DbxActionValueOnTriggerFunction<T>>);
|
|
17
|
+
get isModifiedFunction(): Maybe<IsModifiedFunction<T>>;
|
|
18
|
+
set isModifiedFunction(isModifiedFunction: Maybe<IsModifiedFunction<T>>);
|
|
19
|
+
ngOnInit(): void;
|
|
20
|
+
ngOnDestroy(): void;
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractDbxActionValueOnTriggerDirective<any>, never>;
|
|
22
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractDbxActionValueOnTriggerDirective<any>, never, never, {}, {}, never>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Action directive that is used to trigger/display a popover, then watches that popover for a value.
|
|
26
|
+
*/
|
|
27
|
+
export declare class DbxActionValueTriggerDirective<T = object> extends AbstractDbxActionValueOnTriggerDirective<T> implements OnInit, OnDestroy {
|
|
28
|
+
readonly elementRef: ElementRef;
|
|
29
|
+
set dbxActionValueOnTrigger(dbxActionValueTrigger: Maybe<DbxActionValueOnTriggerFunction<T>>);
|
|
30
|
+
set dbxActionValueTriggerModified(isModifiedFunction: Maybe<IsModifiedFunction>);
|
|
31
|
+
constructor(elementRef: ElementRef, source: DbxActionContextStoreSourceInstance<T, any>);
|
|
32
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxActionValueTriggerDirective<any>, never>;
|
|
33
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DbxActionValueTriggerDirective<any>, "[dbxActionValueOnTrigger]", ["dbxActionValueOnTrigger"], { "dbxActionValueOnTrigger": "dbxActionValueOnTrigger"; "dbxActionValueTriggerModified": "dbxActionValueTriggerModified"; }, {}, never>;
|
|
34
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ObservableGetter, IsModifiedFunction } from '@dereekb/rxjs';
|
|
2
|
+
import { Destroyable, Initialized, Maybe } from '@dereekb/util';
|
|
3
|
+
import { DbxActionContextStoreSourceInstance } from '../../action.store.source';
|
|
4
|
+
/**
|
|
5
|
+
* DbxActionValueOnTriggerInstance function. Returns an ObervableGetter that returns a value.
|
|
6
|
+
*/
|
|
7
|
+
export declare type DbxActionValueOnTriggerFunction<T> = () => ObservableGetter<Maybe<T>>;
|
|
8
|
+
export interface DbxActionValueOnTriggerResult<T = any> {
|
|
9
|
+
value?: Maybe<T>;
|
|
10
|
+
reject?: any;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* DbxActionValueOnTriggerInstance configuration.
|
|
14
|
+
*/
|
|
15
|
+
export interface DbxActionValueOnTriggerInstanceConfig<T> {
|
|
16
|
+
readonly source: DbxActionContextStoreSourceInstance<T, any>;
|
|
17
|
+
readonly valueGetter?: Maybe<DbxActionValueOnTriggerFunction<T>>;
|
|
18
|
+
readonly isModifiedFunction?: Maybe<IsModifiedFunction<T>>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Utility class that handles trigger events to retrieve a value.
|
|
22
|
+
*/
|
|
23
|
+
export declare class DbxActionValueOnTriggerInstance<T> implements Initialized, Destroyable {
|
|
24
|
+
private _valueGetter;
|
|
25
|
+
readonly valueGetter$: import("rxjs").Observable<DbxActionValueOnTriggerFunction<T>>;
|
|
26
|
+
readonly source: DbxActionContextStoreSourceInstance<T, any>;
|
|
27
|
+
isModifiedFunction?: Maybe<IsModifiedFunction<T>>;
|
|
28
|
+
private _triggeredSub;
|
|
29
|
+
constructor(config: DbxActionValueOnTriggerInstanceConfig<T>);
|
|
30
|
+
get valueGetter(): Maybe<DbxActionValueOnTriggerFunction<T>>;
|
|
31
|
+
set valueGetter(valueGetter: Maybe<DbxActionValueOnTriggerFunction<T>>);
|
|
32
|
+
init(): void;
|
|
33
|
+
destroy(): void;
|
|
34
|
+
}
|
|
@@ -5,3 +5,5 @@ export * from './action.success.directive';
|
|
|
5
5
|
export * from './action.value.directive';
|
|
6
6
|
export * from './action.working.component';
|
|
7
7
|
export * from './action.enforce.modified.directive';
|
|
8
|
+
export * from './action.value.trigger.directive';
|
|
9
|
+
export * from './action.value.trigger.instance';
|
package/package.json
CHANGED
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/dbx-core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/common": "^13.
|
|
6
|
-
"@angular/core": "^13.
|
|
7
|
-
"
|
|
8
|
-
"@
|
|
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": "2.0.0",
|
|
5
|
+
"@angular/common": "^13.0.0",
|
|
6
|
+
"@angular/core": "^13.0.0",
|
|
7
|
+
"rxjs": "^7.0.0",
|
|
8
|
+
"@dereekb/util": "2.1.0",
|
|
15
9
|
"extra-set": "^2.2.11",
|
|
16
10
|
"make-error": "^1.3.0",
|
|
17
|
-
"@dereekb/rxjs": "2.
|
|
11
|
+
"@dereekb/rxjs": "2.1.0",
|
|
18
12
|
"ms": "^3.0.0-canary.1",
|
|
13
|
+
"@ngrx/component-store": "^13.0.2",
|
|
19
14
|
"@angular/platform-browser": "^13.0.0",
|
|
20
15
|
"date-fns": "^2.28.0",
|
|
21
|
-
"@dereekb/date": "2.
|
|
16
|
+
"@dereekb/date": "2.1.0",
|
|
22
17
|
"class-transformer": "^0.5.1",
|
|
23
18
|
"class-validator": "^0.13.2",
|
|
24
19
|
"date-fns-tz": "^1.2.2",
|