@dereekb/dbx-web 1.1.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/README.md +1 -1
- package/_index.scss +5 -2
- package/esm2020/lib/action/action.confirm.directive.mjs +5 -5
- package/esm2020/lib/action/action.module.mjs +1 -6
- package/esm2020/lib/action/index.mjs +2 -2
- package/esm2020/lib/action/key.trigger.directive.mjs +4 -4
- package/esm2020/lib/action/snackbar/action.snackbar.component.mjs +95 -0
- package/esm2020/lib/action/snackbar/action.snackbar.default.mjs +107 -0
- package/esm2020/lib/action/snackbar/action.snackbar.directive.mjs +62 -0
- package/esm2020/lib/action/snackbar/action.snackbar.generator.mjs +44 -0
- package/esm2020/lib/action/snackbar/action.snackbar.mjs +2 -0
- package/esm2020/lib/action/snackbar/action.snackbar.module.mjs +51 -0
- package/esm2020/lib/action/snackbar/action.snackbar.service.mjs +82 -0
- package/esm2020/lib/action/snackbar/index.mjs +8 -0
- package/esm2020/lib/action/transition/transition.safety.dialog.component.mjs +5 -4
- package/esm2020/lib/action/transition/transition.safety.directive.mjs +4 -4
- package/esm2020/lib/button/button.component.mjs +1 -2
- package/esm2020/lib/button/button.module.mjs +12 -8
- package/esm2020/lib/button/button.spacer.component.mjs +12 -10
- package/esm2020/lib/error/error.action.directive.mjs +4 -4
- package/esm2020/lib/interaction/dialog/abstract.dialog.directive.mjs +4 -1
- package/esm2020/lib/interaction/dialog/dialog.action.directive.mjs +41 -0
- package/esm2020/lib/interaction/dialog/dialog.module.mjs +9 -4
- package/esm2020/lib/interaction/dialog/index.mjs +2 -1
- package/esm2020/lib/interaction/popover/index.mjs +1 -2
- package/esm2020/lib/interaction/popover/popover.action.directive.mjs +19 -57
- package/esm2020/lib/interaction/popover/popover.module.mjs +6 -11
- package/esm2020/lib/interaction/popup/popup.controls.buttons.component.mjs +3 -3
- package/esm2020/lib/interaction/prompt/prompt.confirm.component.mjs +1 -1
- package/esm2020/lib/layout/section/section.header.component.mjs +6 -3
- package/esm2020/lib/layout/text/icon.spacer.component.mjs +19 -0
- package/esm2020/lib/layout/text/index.mjs +2 -1
- package/esm2020/lib/layout/text/text.module.mjs +10 -5
- package/esm2020/lib/loading/index.mjs +2 -1
- package/esm2020/lib/loading/loading.action.directive.mjs +37 -0
- package/esm2020/lib/loading/loading.module.mjs +10 -5
- package/esm2020/lib/router/layout/anchor/anchor.content.component.mjs +43 -0
- package/esm2020/lib/router/layout/anchor/anchor.module.mjs +10 -5
- package/esm2020/lib/router/layout/anchor/index.mjs +2 -1
- package/esm2020/lib/router/layout/sidenav/sidenav.pagebar.component.mjs +1 -1
- package/fesm2015/dereekb-dbx-web.mjs +968 -582
- package/fesm2015/dereekb-dbx-web.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-web.mjs +965 -579
- package/fesm2020/dereekb-dbx-web.mjs.map +1 -1
- package/lib/action/_action.scss +8 -35
- package/lib/action/action.confirm.directive.d.ts +13 -4
- package/lib/action/action.module.d.ts +9 -10
- package/lib/action/index.d.ts +1 -1
- package/lib/action/key.trigger.directive.d.ts +3 -3
- package/lib/action/snackbar/_snackbar.scss +33 -0
- package/lib/action/snackbar/action.snackbar.component.d.ts +36 -0
- package/lib/action/snackbar/action.snackbar.d.ts +52 -0
- package/lib/action/snackbar/action.snackbar.default.d.ts +2 -0
- package/lib/action/snackbar/action.snackbar.directive.d.ts +25 -0
- package/lib/action/snackbar/action.snackbar.generator.d.ts +32 -0
- package/lib/action/snackbar/action.snackbar.module.d.ts +14 -0
- package/lib/action/snackbar/action.snackbar.service.d.ts +39 -0
- package/lib/action/snackbar/index.d.ts +7 -0
- package/lib/action/transition/transition.safety.directive.d.ts +3 -3
- package/lib/button/button.module.d.ts +2 -1
- package/lib/button/button.spacer.component.d.ts +4 -4
- package/lib/error/error.action.directive.d.ts +3 -3
- package/lib/interaction/dialog/abstract.dialog.directive.d.ts +1 -0
- package/lib/interaction/dialog/dialog.action.directive.d.ts +21 -0
- package/lib/interaction/dialog/dialog.module.d.ts +4 -3
- package/lib/interaction/dialog/index.d.ts +1 -0
- package/lib/interaction/popover/index.d.ts +0 -1
- package/lib/interaction/popover/popover.action.directive.d.ts +15 -24
- package/lib/interaction/popover/popover.module.d.ts +20 -21
- package/lib/layout/content/_content.scss +13 -0
- package/lib/layout/section/section.header.component.d.ts +1 -0
- package/lib/layout/text/icon.spacer.component.d.ts +8 -0
- package/lib/layout/text/index.d.ts +1 -0
- package/lib/layout/text/text.module.d.ts +6 -5
- package/lib/loading/index.d.ts +1 -0
- package/lib/loading/loading.action.directive.d.ts +19 -0
- package/lib/loading/loading.module.d.ts +6 -5
- package/lib/router/layout/anchor/_anchor.scss +5 -0
- package/lib/router/layout/anchor/anchor.content.component.d.ts +22 -0
- package/lib/router/layout/anchor/anchor.module.d.ts +6 -5
- package/lib/router/layout/anchor/index.d.ts +1 -0
- package/lib/style/_all-core.scss +2 -0
- package/lib/style/_all-theme.scss +2 -0
- package/lib/style/_all-typography.scss +2 -0
- package/lib/style/_function.scss +4 -0
- package/package.json +35 -36
- package/esm2020/lib/action/action.snackbar.component.mjs +0 -104
- package/esm2020/lib/interaction/popover/popover.action.button.directive.mjs +0 -29
- package/lib/action/action.snackbar.component.d.ts +0 -22
- package/lib/interaction/popover/popover.action.button.directive.d.ts +0 -14
package/lib/action/_action.scss
CHANGED
|
@@ -1,40 +1,13 @@
|
|
|
1
|
-
@use '
|
|
1
|
+
@use './snackbar/snackbar';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// MARK: Mixin
|
|
7
|
-
@mixin core() {}
|
|
8
|
-
|
|
9
|
-
@mixin color($theme-config) {}
|
|
10
|
-
|
|
11
|
-
@mixin typography($typography-config) {}
|
|
12
|
-
|
|
13
|
-
@mixin theme($theme-config) {
|
|
14
|
-
@include theming.private-check-duplicate-theme-styles($theme-config, 'dbx-action') {
|
|
15
|
-
$color: theming.get-color-config($theme-config);
|
|
16
|
-
$typography: theming.get-typography-config($theme-config);
|
|
17
|
-
|
|
18
|
-
@if $color !=null {
|
|
19
|
-
@include color($theme-config);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@if $typography !=null {
|
|
23
|
-
@include typography($typography);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
3
|
+
@mixin all-action-core() {
|
|
4
|
+
@include snackbar.core();
|
|
26
5
|
}
|
|
27
6
|
|
|
28
|
-
|
|
29
|
-
.
|
|
30
|
-
|
|
31
|
-
align-items: center;
|
|
32
|
-
|
|
33
|
-
&.dbx-action-snackbar-success {
|
|
34
|
-
// background: $success-color;
|
|
35
|
-
}
|
|
7
|
+
@mixin all-action-typography($typography-config) {
|
|
8
|
+
@include snackbar.typography($typography-config);
|
|
9
|
+
}
|
|
36
10
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
11
|
+
@mixin all-action-theme($theme-config) {
|
|
12
|
+
@include snackbar.theme($theme-config);
|
|
40
13
|
}
|
|
@@ -2,8 +2,17 @@ import { OnDestroy, OnInit } from '@angular/core';
|
|
|
2
2
|
import { MatDialog } from '@angular/material/dialog';
|
|
3
3
|
import { AbstractPromptConfirmDirective } from '../interaction/prompt/prompt.confirm.directive';
|
|
4
4
|
import { DbxPromptConfirmConfig } from '../interaction/prompt/prompt.confirm.component';
|
|
5
|
-
import {
|
|
5
|
+
import { DbxActionContextStoreSourceInstance } from '@dereekb/dbx-core';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* DbxActionConfirmDirective configuration.
|
|
9
|
+
*/
|
|
10
|
+
export interface DbxActionConfirmConfig<T> extends DbxPromptConfirmConfig {
|
|
11
|
+
/**
|
|
12
|
+
* Optionally set the readyValue passed to the instance.
|
|
13
|
+
*/
|
|
14
|
+
readyValue?: T;
|
|
15
|
+
}
|
|
7
16
|
/**
|
|
8
17
|
* Directive that when triggered shows a dialog to accept or reject.
|
|
9
18
|
*
|
|
@@ -11,10 +20,10 @@ import * as i0 from "@angular/core";
|
|
|
11
20
|
* For button usage, use an appPromptConfirmButton directive.
|
|
12
21
|
*/
|
|
13
22
|
export declare class DbxActionConfirmDirective<T, O> extends AbstractPromptConfirmDirective implements OnInit, OnDestroy {
|
|
14
|
-
readonly source:
|
|
15
|
-
config?:
|
|
23
|
+
readonly source: DbxActionContextStoreSourceInstance<T, O>;
|
|
24
|
+
config?: DbxActionConfirmConfig<T>;
|
|
16
25
|
private _sourceSubscription;
|
|
17
|
-
constructor(source:
|
|
26
|
+
constructor(source: DbxActionContextStoreSourceInstance<T, O>, dialog: MatDialog);
|
|
18
27
|
ngOnInit(): void;
|
|
19
28
|
ngOnDestroy(): void;
|
|
20
29
|
protected _handleDialogResult(result: boolean): boolean;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import * as i1 from "./key.trigger.directive";
|
|
3
|
-
import * as i2 from "./action.
|
|
4
|
-
import * as i3 from "
|
|
5
|
-
import * as i4 from "@
|
|
6
|
-
import * as i5 from "
|
|
7
|
-
import * as i6 from "
|
|
8
|
-
import * as i7 from "@angular/material/
|
|
9
|
-
import * as i8 from "@angular/material/
|
|
10
|
-
import * as i9 from "
|
|
11
|
-
import * as i10 from "../interaction/prompt/prompt.module";
|
|
3
|
+
import * as i2 from "./action.confirm.directive";
|
|
4
|
+
import * as i3 from "@angular/common";
|
|
5
|
+
import * as i4 from "@dereekb/dbx-core";
|
|
6
|
+
import * as i5 from "../button/button.module";
|
|
7
|
+
import * as i6 from "@angular/material/snack-bar";
|
|
8
|
+
import * as i7 from "@angular/material/dialog";
|
|
9
|
+
import * as i8 from "@angular/material/button";
|
|
10
|
+
import * as i9 from "../interaction/prompt/prompt.module";
|
|
12
11
|
export declare class DbxActionModule {
|
|
13
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxActionModule, never>;
|
|
14
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxActionModule, [typeof i1.DbxActionKeyTriggerDirective, typeof i2.
|
|
13
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxActionModule, [typeof i1.DbxActionKeyTriggerDirective, typeof i2.DbxActionConfirmDirective], [typeof i3.CommonModule, typeof i4.DbxCoreActionModule, typeof i5.DbxButtonModule, typeof i6.MatSnackBarModule, typeof i7.MatDialogModule, typeof i8.MatButtonModule, typeof i9.DbxPromptModule], [typeof i4.DbxCoreActionModule, typeof i1.DbxActionKeyTriggerDirective, typeof i2.DbxActionConfirmDirective]>;
|
|
15
14
|
static ɵinj: i0.ɵɵInjectorDeclaration<DbxActionModule>;
|
|
16
15
|
}
|
package/lib/action/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Maybe } from '@dereekb/util';
|
|
2
|
-
import {
|
|
2
|
+
import { DbxActionContextStoreSourceInstance } from '@dereekb/dbx-core';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
/**
|
|
5
5
|
* Directive that triggers the action on a specific key up event.
|
|
@@ -7,9 +7,9 @@ import * as i0 from "@angular/core";
|
|
|
7
7
|
* Events/Keys to respond to should be lowercase.
|
|
8
8
|
*/
|
|
9
9
|
export declare class DbxActionKeyTriggerDirective<T = any, O = any> {
|
|
10
|
-
readonly source:
|
|
10
|
+
readonly source: DbxActionContextStoreSourceInstance<T, O>;
|
|
11
11
|
inputKey: Maybe<string>;
|
|
12
|
-
constructor(source:
|
|
12
|
+
constructor(source: DbxActionContextStoreSourceInstance<T, O>);
|
|
13
13
|
get key(): string;
|
|
14
14
|
onKeyupHandler(event: KeyboardEvent): void;
|
|
15
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxActionKeyTriggerDirective<any, any>, [{ host: true; }]>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@use '../../style/theming';
|
|
2
|
+
|
|
3
|
+
// MARK: Variables
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
// MARK: Mixin
|
|
7
|
+
@mixin core() {
|
|
8
|
+
|
|
9
|
+
.dbx-action-snackbar {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@mixin color($theme-config) {}
|
|
17
|
+
|
|
18
|
+
@mixin typography($typography-config) {}
|
|
19
|
+
|
|
20
|
+
@mixin theme($theme-config) {
|
|
21
|
+
@include theming.private-check-duplicate-theme-styles($theme-config, 'dbx-action-snackbar') {
|
|
22
|
+
$color: theming.get-color-config($theme-config);
|
|
23
|
+
$typography: theming.get-typography-config($theme-config);
|
|
24
|
+
|
|
25
|
+
@if $color !=null {
|
|
26
|
+
@include color($theme-config);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@if $typography !=null {
|
|
30
|
+
@include typography($typography);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { LoadingStateType } from '@dereekb/rxjs';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { OnDestroy, AfterViewInit } from '@angular/core';
|
|
5
|
+
import { MatSnackBarRef } from '@angular/material/snack-bar';
|
|
6
|
+
import { Maybe } from '@dereekb/util';
|
|
7
|
+
import { DbxActionSnackbarDisplayConfig, DbxActionSnackbarActionConfig } from './action.snackbar';
|
|
8
|
+
import { AbstractSubscriptionDirective } from '@dereekb/dbx-core';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
/**
|
|
11
|
+
* Component for a snackbar that contains an action.
|
|
12
|
+
*/
|
|
13
|
+
export declare class DbxActionSnackbarComponent extends AbstractSubscriptionDirective implements OnInit, AfterViewInit, OnDestroy {
|
|
14
|
+
readonly snackbar: MatSnackBarRef<DbxActionSnackbarComponent>;
|
|
15
|
+
readonly data: DbxActionSnackbarDisplayConfig;
|
|
16
|
+
private _durationTimeout;
|
|
17
|
+
private _actionRef;
|
|
18
|
+
readonly value$: Observable<number>;
|
|
19
|
+
readonly sourceInstance$: Observable<import("@dereekb/dbx-core").DbxActionContextStoreSourceInstance<any, any>>;
|
|
20
|
+
readonly complete$: Observable<boolean>;
|
|
21
|
+
readonly loadingStateType$: Observable<LoadingStateType>;
|
|
22
|
+
readonly snackbarStatusClass$: Observable<string>;
|
|
23
|
+
readonly button: Maybe<string>;
|
|
24
|
+
get action(): DbxActionSnackbarActionConfig | undefined;
|
|
25
|
+
get hasAction(): boolean;
|
|
26
|
+
get message(): Maybe<string>;
|
|
27
|
+
get actionConfig(): Maybe<DbxActionSnackbarActionConfig>;
|
|
28
|
+
constructor(snackbar: MatSnackBarRef<DbxActionSnackbarComponent>, data: DbxActionSnackbarDisplayConfig);
|
|
29
|
+
ngOnInit(): void;
|
|
30
|
+
ngOnDestroy(): void;
|
|
31
|
+
ngAfterViewInit(): void;
|
|
32
|
+
dismissAfterActionCompletes: () => void;
|
|
33
|
+
dismiss: () => void;
|
|
34
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxActionSnackbarComponent, never>;
|
|
35
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxActionSnackbarComponent, "ng-component", never, {}, {}, never, never>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { MatSnackBarConfig } from "@angular/material/snack-bar";
|
|
2
|
+
import { DbxActionContextSourceReference } from "@dereekb/dbx-core";
|
|
3
|
+
import { LoadingState, LoadingStateType } from "@dereekb/rxjs";
|
|
4
|
+
import { Maybe } from "@dereekb/util";
|
|
5
|
+
export declare type DbxActionSnackbarType = string;
|
|
6
|
+
export declare type DbxActionSnackbarKnownType = 'none' | 'create' | 'save' | 'delete' | 'merge' | 'send' | 'cancel' | 'restore' | 'refresh' | 'read' | 'unread';
|
|
7
|
+
/**
|
|
8
|
+
* ActionSnackbar event. Depending on the type, a value or error is also available.
|
|
9
|
+
*/
|
|
10
|
+
export interface DbxActionSnackbarEvent<O = any> extends Omit<LoadingState<O>, 'loading'> {
|
|
11
|
+
type: LoadingStateType;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Configuration for the actual snackbar popup.
|
|
15
|
+
*/
|
|
16
|
+
export interface DbxActionSnackbarDisplayConfig {
|
|
17
|
+
/**
|
|
18
|
+
* Text to be shown on the close button. If action is defined, this is ignored and the action text is used.
|
|
19
|
+
*/
|
|
20
|
+
button?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Message to show in the snackbar.
|
|
23
|
+
*/
|
|
24
|
+
message?: Maybe<string>;
|
|
25
|
+
/**
|
|
26
|
+
* Additional action that can occur.
|
|
27
|
+
*/
|
|
28
|
+
action?: DbxActionSnackbarActionConfig;
|
|
29
|
+
/**
|
|
30
|
+
* MatSnackBar configuration
|
|
31
|
+
*/
|
|
32
|
+
snackbar?: MatSnackBarConfig;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Used for configuring an action on the snackbar component.
|
|
36
|
+
*/
|
|
37
|
+
export interface DbxActionSnackbarActionConfig {
|
|
38
|
+
/**
|
|
39
|
+
* Action label to display on the button.
|
|
40
|
+
*/
|
|
41
|
+
button: string;
|
|
42
|
+
/**
|
|
43
|
+
* Action reference to use.
|
|
44
|
+
*
|
|
45
|
+
* The referred to action is used for triggering and lifecycle.
|
|
46
|
+
*/
|
|
47
|
+
reference: DbxActionContextSourceReference;
|
|
48
|
+
/**
|
|
49
|
+
* Duration to show the action.
|
|
50
|
+
*/
|
|
51
|
+
duration?: number;
|
|
52
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { AbstractSubscriptionDirective, DbxActionContextStoreSourceInstance } from '@dereekb/dbx-core';
|
|
3
|
+
import { Maybe } from '@dereekb/util';
|
|
4
|
+
import { DbxActionSnackbarDisplayConfig, DbxActionSnackbarEvent, DbxActionSnackbarType } from './action.snackbar';
|
|
5
|
+
import { DbxActionSnackbarService } from './action.snackbar.service';
|
|
6
|
+
import { DbxActionSnackbarDisplayConfigGeneratorFunction, DbxActionSnackbarGeneratorUndoInput } from './action.snackbar.generator';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
/**
|
|
9
|
+
* Action directive that displays a snackbar when the action context hits a certain state.
|
|
10
|
+
*/
|
|
11
|
+
export declare class DbxActionSnackbarDirective<T = any, O = any> extends AbstractSubscriptionDirective implements OnInit {
|
|
12
|
+
readonly source: DbxActionContextStoreSourceInstance<T, O>;
|
|
13
|
+
readonly dbxActionSnackbarService: DbxActionSnackbarService;
|
|
14
|
+
private _snackbarFunction?;
|
|
15
|
+
get snackbarFunction(): Maybe<DbxActionSnackbarDisplayConfigGeneratorFunction<O>>;
|
|
16
|
+
set snackbarFunction(snackbarFunction: Maybe<'' | DbxActionSnackbarDisplayConfigGeneratorFunction<O>>);
|
|
17
|
+
dbxActionSnackbarDefault?: Maybe<DbxActionSnackbarType>;
|
|
18
|
+
dbxActionSnackbarUndo?: DbxActionSnackbarGeneratorUndoInput;
|
|
19
|
+
constructor(source: DbxActionContextStoreSourceInstance<T, O>, dbxActionSnackbarService: DbxActionSnackbarService);
|
|
20
|
+
ngOnInit(): void;
|
|
21
|
+
protected buildConfigurationForEvent(event: DbxActionSnackbarEvent): Maybe<DbxActionSnackbarDisplayConfig>;
|
|
22
|
+
protected showSnackbarForConfiguration(config: DbxActionSnackbarDisplayConfig, event: DbxActionSnackbarEvent): void;
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxActionSnackbarDirective<any, any>, [{ host: true; }, null]>;
|
|
24
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DbxActionSnackbarDirective<any, any>, "[dbxActionSnackbar]", never, { "snackbarFunction": "dbxActionSnackbar"; "dbxActionSnackbarDefault": "dbxActionSnackbarDefault"; "dbxActionSnackbarUndo": "dbxActionSnackbarUndo"; }, {}, never>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { DbxActionContextSourceReference } from "@dereekb/dbx-core";
|
|
2
|
+
import { Milliseconds, Maybe, ObjectOrGetter, Getter } from "@dereekb/util";
|
|
3
|
+
import { DbxActionSnackbarDisplayConfig, DbxActionSnackbarEvent } from "./action.snackbar";
|
|
4
|
+
export interface DbxActionSnackbarGeneratorInput<O = any> {
|
|
5
|
+
event: DbxActionSnackbarEvent<O>;
|
|
6
|
+
undo?: Maybe<DbxActionSnackbarGeneratorUndoInput>;
|
|
7
|
+
}
|
|
8
|
+
export declare type DbxActionSnackbarGeneratorUndoInput = DbxActionSnackbarGeneratorUndoInputConfig | Getter<DbxActionContextSourceReference>;
|
|
9
|
+
export interface DbxActionSnackbarGeneratorUndoInputConfig {
|
|
10
|
+
duration?: Milliseconds;
|
|
11
|
+
getUndoAction: Getter<DbxActionContextSourceReference>;
|
|
12
|
+
}
|
|
13
|
+
export declare type DbxActionSnackbarDisplayConfigGeneratorFunction<O = any> = (input: DbxActionSnackbarGeneratorInput<O>) => Maybe<DbxActionSnackbarDisplayConfig>;
|
|
14
|
+
export interface DbxMakeActionSnackbarGeneratorConfiguration {
|
|
15
|
+
idle?: ObjectOrGetter<DbxMakeActionSnackbarGeneratorEventConfiguration>;
|
|
16
|
+
loading?: ObjectOrGetter<DbxMakeActionSnackbarGeneratorEventConfiguration>;
|
|
17
|
+
success?: ObjectOrGetter<DbxMakeActionSnackbarGeneratorEventConfiguration>;
|
|
18
|
+
error?: ObjectOrGetter<DbxMakeActionSnackbarGeneratorEventConfiguration>;
|
|
19
|
+
}
|
|
20
|
+
export interface DbxMakeActionSnackbarGeneratorEventConfiguration extends Omit<DbxActionSnackbarDisplayConfig, 'action'> {
|
|
21
|
+
/**
|
|
22
|
+
* Sets the undo action text. If undefined, will default to 'undo'
|
|
23
|
+
*/
|
|
24
|
+
undoButtonText?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Creates a DbxActionSnackbarDisplayConfigGeneratorFunction from the input config.
|
|
28
|
+
*
|
|
29
|
+
* @param config
|
|
30
|
+
* @returns
|
|
31
|
+
*/
|
|
32
|
+
export declare function makeDbxActionSnackbarDisplayConfigGeneratorFunction<O = any>(config: DbxMakeActionSnackbarGeneratorConfiguration): DbxActionSnackbarDisplayConfigGeneratorFunction<O>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./action.snackbar.component";
|
|
3
|
+
import * as i2 from "./action.snackbar.directive";
|
|
4
|
+
import * as i3 from "@angular/common";
|
|
5
|
+
import * as i4 from "../../layout/style/style.layout.module";
|
|
6
|
+
import * as i5 from "@dereekb/dbx-core";
|
|
7
|
+
import * as i6 from "../../interaction/prompt/prompt.module";
|
|
8
|
+
import * as i7 from "../../button/button.module";
|
|
9
|
+
import * as i8 from "../../error/error.module";
|
|
10
|
+
export declare class DbxActionSnackbarModule {
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxActionSnackbarModule, never>;
|
|
12
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxActionSnackbarModule, [typeof i1.DbxActionSnackbarComponent, typeof i2.DbxActionSnackbarDirective], [typeof i3.CommonModule, typeof i4.DbxStyleLayoutModule, typeof i5.DbxCoreActionModule, typeof i6.DbxPromptModule, typeof i7.DbxButtonModule, typeof i8.DbxReadableErrorModule], [typeof i1.DbxActionSnackbarComponent, typeof i2.DbxActionSnackbarDirective]>;
|
|
13
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DbxActionSnackbarModule>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DbxActionSnackbarComponent } from './action.snackbar.component';
|
|
2
|
+
import { InjectionToken, Type } from "@angular/core";
|
|
3
|
+
import { MatSnackBar, MatSnackBarConfig, MatSnackBarRef } from "@angular/material/snack-bar";
|
|
4
|
+
import { Milliseconds, Maybe } from "@dereekb/util";
|
|
5
|
+
import { DbxActionSnackbarDisplayConfig, DbxActionSnackbarType } from "./action.snackbar";
|
|
6
|
+
import { DbxActionSnackbarGeneratorInput, DbxMakeActionSnackbarGeneratorConfiguration } from "./action.snackbar.generator";
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare const DBX_ACTION_SNACKBAR_SERVICE_CONFIG: InjectionToken<unknown>;
|
|
9
|
+
export declare const DEFAULT_SNACKBAR_DIRECTIVE_DURATION: number;
|
|
10
|
+
export interface DbxActionSnackbarEventMakeConfig {
|
|
11
|
+
[key: string]: DbxMakeActionSnackbarGeneratorConfiguration;
|
|
12
|
+
}
|
|
13
|
+
export interface DbxActionSnackbarServiceConfig<C = any> {
|
|
14
|
+
readonly componentClass: Type<C>;
|
|
15
|
+
readonly snackbar?: Pick<MatSnackBarConfig, 'horizontalPosition' | 'verticalPosition'>;
|
|
16
|
+
readonly defaultDuration?: Milliseconds;
|
|
17
|
+
readonly defaultUndoDuration?: Milliseconds;
|
|
18
|
+
readonly eventTypeConfigs: DbxActionSnackbarEventMakeConfig;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Used for managing/configuring the snackbar default values and pushing snackbar events.
|
|
22
|
+
*/
|
|
23
|
+
export declare class DbxActionSnackbarService<C = DbxActionSnackbarComponent> {
|
|
24
|
+
readonly matSnackBar: MatSnackBar;
|
|
25
|
+
readonly config: DbxActionSnackbarServiceConfig<C>;
|
|
26
|
+
get componentClass(): Type<C>;
|
|
27
|
+
get eventTypeConfigs(): DbxActionSnackbarEventMakeConfig;
|
|
28
|
+
constructor(matSnackBar: MatSnackBar, inputConfig: Partial<DbxActionSnackbarServiceConfig<C>>);
|
|
29
|
+
/**
|
|
30
|
+
* Opens a new snackbar given the input configuration.
|
|
31
|
+
*
|
|
32
|
+
* @param config
|
|
33
|
+
* @returns
|
|
34
|
+
*/
|
|
35
|
+
openSnackbar(config: DbxActionSnackbarDisplayConfig): MatSnackBarRef<C>;
|
|
36
|
+
generateDisplayConfig(type: Maybe<DbxActionSnackbarType>, input: DbxActionSnackbarGeneratorInput): Maybe<DbxActionSnackbarDisplayConfig>;
|
|
37
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxActionSnackbarService<any>, [null, { optional: true; }]>;
|
|
38
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DbxActionSnackbarService<any>>;
|
|
39
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './action.snackbar.component';
|
|
2
|
+
export * from './action.snackbar.default';
|
|
3
|
+
export * from './action.snackbar.directive';
|
|
4
|
+
export * from './action.snackbar.generator';
|
|
5
|
+
export * from './action.snackbar.module';
|
|
6
|
+
export * from './action.snackbar.service';
|
|
7
|
+
export * from './action.snackbar';
|
|
@@ -2,7 +2,7 @@ import { OnInit, OnDestroy, ViewContainerRef } from '@angular/core';
|
|
|
2
2
|
import { MatDialog } from '@angular/material/dialog';
|
|
3
3
|
import { HookResult, Transition, TransitionService } from '@uirouter/core';
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
|
-
import {
|
|
5
|
+
import { DbxActionContextStoreSourceInstance } from '@dereekb/dbx-core';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
/**
|
|
8
8
|
* How to handle transitions.
|
|
@@ -21,14 +21,14 @@ export declare type DbxActionTransitionSafetyType = 'none' | 'dialog' | 'auto';
|
|
|
21
21
|
* NOTE: This dialog only works for uirouter.
|
|
22
22
|
*/
|
|
23
23
|
export declare class DbxActionTransitionSafetyDirective<T, O> implements OnInit, OnDestroy {
|
|
24
|
-
readonly source:
|
|
24
|
+
readonly source: DbxActionContextStoreSourceInstance<T, O>;
|
|
25
25
|
protected readonly transitionService: TransitionService;
|
|
26
26
|
protected readonly viewContainerRef: ViewContainerRef;
|
|
27
27
|
protected readonly dialog: MatDialog;
|
|
28
28
|
inputSafetyType?: DbxActionTransitionSafetyType;
|
|
29
29
|
private _dialogRef?;
|
|
30
30
|
private stopWatchingTransition?;
|
|
31
|
-
constructor(source:
|
|
31
|
+
constructor(source: DbxActionContextStoreSourceInstance<T, O>, transitionService: TransitionService, viewContainerRef: ViewContainerRef, dialog: MatDialog);
|
|
32
32
|
get safetyType(): DbxActionTransitionSafetyType;
|
|
33
33
|
private get _destroyed();
|
|
34
34
|
ngOnInit(): void;
|
|
@@ -3,8 +3,9 @@ import * as i1 from "./button.component";
|
|
|
3
3
|
import * as i2 from "./button.spacer.component";
|
|
4
4
|
import * as i3 from "@angular/common";
|
|
5
5
|
import * as i4 from "mat-progress-buttons";
|
|
6
|
+
import * as i5 from "@dereekb/dbx-core";
|
|
6
7
|
export declare class DbxButtonModule {
|
|
7
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxButtonModule, never>;
|
|
8
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxButtonModule, [typeof i1.DbxButtonComponent, typeof i2.
|
|
9
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxButtonModule, [typeof i1.DbxButtonComponent, typeof i2.DbxButtonSpacerDirective], [typeof i3.CommonModule, typeof i4.MatProgressButtonsModule], [typeof i5.DbxCoreButtonModule, typeof i4.MatProgressButtonsModule, typeof i1.DbxButtonComponent, typeof i2.DbxButtonSpacerDirective]>;
|
|
9
10
|
static ɵinj: i0.ɵɵInjectorDeclaration<DbxButtonModule>;
|
|
10
11
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
/**
|
|
3
|
-
* Button spacer
|
|
3
|
+
* Button spacer directive.
|
|
4
4
|
*/
|
|
5
|
-
export declare class
|
|
6
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
7
|
-
static
|
|
5
|
+
export declare class DbxButtonSpacerDirective {
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxButtonSpacerDirective, never>;
|
|
7
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DbxButtonSpacerDirective, "dbx-button-spacer,dbxButtonSpacer", never, {}, {}, never>;
|
|
8
8
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { DbxActionContextStoreSourceInstance, AbstractSubscriptionDirective } from '@dereekb/dbx-core';
|
|
3
3
|
import { DbxReadableErrorComponent } from './error.component';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
/**
|
|
@@ -7,8 +7,8 @@ import * as i0 from "@angular/core";
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class DbxActionErrorDirective extends AbstractSubscriptionDirective implements OnInit {
|
|
9
9
|
readonly error: DbxReadableErrorComponent;
|
|
10
|
-
readonly source:
|
|
11
|
-
constructor(error: DbxReadableErrorComponent, source:
|
|
10
|
+
readonly source: DbxActionContextStoreSourceInstance;
|
|
11
|
+
constructor(error: DbxReadableErrorComponent, source: DbxActionContextStoreSourceInstance);
|
|
12
12
|
ngOnInit(): void;
|
|
13
13
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxActionErrorDirective, [{ host: true; }, null]>;
|
|
14
14
|
static ɵdir: i0.ɵɵDirectiveDeclaration<DbxActionErrorDirective, "[dbxActionError]", never, {}, {}, never>;
|
|
@@ -10,6 +10,7 @@ export declare abstract class AbstractDialogDirective<R = any, D = any, T = any>
|
|
|
10
10
|
readonly dialogRef: MatDialogRef<T, R>;
|
|
11
11
|
constructor(data: D, dialogRef: MatDialogRef<T, R>, dbNgxRouterTransitionService: DbxRouterTransitionService, ngZone: NgZone);
|
|
12
12
|
protected updateForSuccessfulTransition(): void;
|
|
13
|
+
returnValue(value?: R): void;
|
|
13
14
|
close(value?: R): void;
|
|
14
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractDialogDirective<any, any, any>, [{ optional: true; }, null, null, null]>;
|
|
15
16
|
static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractDialogDirective<any, any, any>, never, never, {}, {}, never>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { OnInit, OnDestroy, ElementRef } from '@angular/core';
|
|
3
|
+
import { DbxActionContextStoreSourceInstance, AbstractDbxActionValueOnTriggerDirective } from '@dereekb/dbx-core';
|
|
4
|
+
import { IsModifiedFunction } from '@dereekb/rxjs';
|
|
5
|
+
import { Maybe } from '@dereekb/util';
|
|
6
|
+
import { MatDialogRef } from '@angular/material/dialog';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare type DbxActionDialogFunction<T = any> = () => MatDialogRef<any, Maybe<T>>;
|
|
9
|
+
/**
|
|
10
|
+
* Action directive that is used to trigger/display a dialog, then watches that dialog for a value.
|
|
11
|
+
*/
|
|
12
|
+
export declare class DbxActionDialogDirective<T = any> extends AbstractDbxActionValueOnTriggerDirective<T> implements OnInit, OnDestroy {
|
|
13
|
+
readonly elementRef: ElementRef;
|
|
14
|
+
fn?: DbxActionDialogFunction<T>;
|
|
15
|
+
set dbxActionDialogModified(isModifiedFunction: Maybe<IsModifiedFunction>);
|
|
16
|
+
constructor(elementRef: ElementRef, source: DbxActionContextStoreSourceInstance<T, any>);
|
|
17
|
+
protected _getDataFromDialog(): Observable<Maybe<T>>;
|
|
18
|
+
protected _makeDialogRef(): MatDialogRef<any, Maybe<T>>;
|
|
19
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxActionDialogDirective<any>, never>;
|
|
20
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DbxActionDialogDirective<any>, "[dbxActionDialog]", ["dbxActionDialog"], { "fn": "dbxActionDialog"; "dbxActionDialogModified": "dbxActionDialogModified"; }, {}, never>;
|
|
21
|
+
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import * as i1 from "./dialog.content.component";
|
|
3
|
-
import * as i2 from "
|
|
4
|
-
import * as i3 from "
|
|
3
|
+
import * as i2 from "./dialog.action.directive";
|
|
4
|
+
import * as i3 from "@angular/common";
|
|
5
|
+
import * as i4 from "../../layout/style/style.layout.module";
|
|
5
6
|
/**
|
|
6
7
|
* Module for block components.
|
|
7
8
|
*/
|
|
8
9
|
export declare class DbxDialogInteractionModule {
|
|
9
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxDialogInteractionModule, never>;
|
|
10
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxDialogInteractionModule, [typeof i1.DbxDialogContentDirective], [typeof
|
|
11
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxDialogInteractionModule, [typeof i1.DbxDialogContentDirective, typeof i2.DbxActionDialogDirective], [typeof i3.CommonModule, typeof i4.DbxStyleLayoutModule], [typeof i1.DbxDialogContentDirective, typeof i2.DbxActionDialogDirective]>;
|
|
11
12
|
static ɵinj: i0.ɵɵInjectorDeclaration<DbxDialogInteractionModule>;
|
|
12
13
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export * from './abstract.popover.directive';
|
|
2
2
|
export * from './abstract.popover.ref.directive';
|
|
3
|
-
export * from './popover.action.button.directive';
|
|
4
3
|
export * from './popover.action.directive';
|
|
5
4
|
export * from './popover.component';
|
|
6
5
|
export * from './popover.content.component';
|
|
@@ -1,33 +1,24 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { OnInit, OnDestroy, ElementRef } from '@angular/core';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { NgPopoverRef } from 'ng-overlay-container';
|
|
4
|
+
import { DbxActionContextStoreSourceInstance, AbstractDbxActionValueOnTriggerDirective } from '@dereekb/dbx-core';
|
|
5
|
+
import { IsModifiedFunction } from '@dereekb/rxjs';
|
|
6
|
+
import { Maybe } from '@dereekb/util';
|
|
6
7
|
import * as i0 from "@angular/core";
|
|
7
|
-
export interface
|
|
8
|
+
export interface DbxActionPopoverFunctionParams {
|
|
8
9
|
origin: ElementRef;
|
|
9
10
|
}
|
|
10
|
-
export declare type
|
|
11
|
-
export declare type DbxPopoverActionModifiedFn<T = any> = (value: T) => Observable<boolean>;
|
|
11
|
+
export declare type DbxActionPopoverFunction<T = any> = (params: DbxActionPopoverFunctionParams) => NgPopoverRef<any, Maybe<T>>;
|
|
12
12
|
/**
|
|
13
|
-
* Action directive that is used to trigger/display a popover,
|
|
14
|
-
* then watches that popover for a value.
|
|
15
|
-
*
|
|
16
|
-
* The value is passed to the isModified function (ifProvided), and if that returns true it will
|
|
13
|
+
* Action directive that is used to trigger/display a popover, then watches that popover for a value.
|
|
17
14
|
*/
|
|
18
|
-
export declare class
|
|
15
|
+
export declare class DbxActionPopoverDirective<T = any> extends AbstractDbxActionValueOnTriggerDirective<T> implements OnInit, OnDestroy {
|
|
19
16
|
readonly elementRef: ElementRef;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
ngOnInit(): void;
|
|
28
|
-
ngOnDestroy(): void;
|
|
29
|
-
protected _makePopoverRef(): NgPopoverRef<any, T>;
|
|
30
|
-
protected _afterClosed(event: NgPopoverCloseEvent<T>): void;
|
|
31
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DbxPopoverActionDirective<any>, never>;
|
|
32
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<DbxPopoverActionDirective<any>, "[dbxPopoverAction]", ["popoverAction"], { "fn": "dbxPopoverAction"; "appPopoverActionModified": "appPopoverActionModified"; }, {}, never>;
|
|
17
|
+
fn?: DbxActionPopoverFunction<T>;
|
|
18
|
+
set dbxActionPopoverModified(isModifiedFunction: Maybe<IsModifiedFunction>);
|
|
19
|
+
constructor(elementRef: ElementRef, source: DbxActionContextStoreSourceInstance<T, any>);
|
|
20
|
+
protected _getDataFromPopover(): Observable<Maybe<T>>;
|
|
21
|
+
protected _makePopoverRef(): NgPopoverRef<any, Maybe<T>>;
|
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxActionPopoverDirective<any>, never>;
|
|
23
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DbxActionPopoverDirective<any>, "[dbxActionPopover]", ["dbxActionPopover"], { "fn": "dbxActionPopover"; "dbxActionPopoverModified": "dbxActionPopoverModified"; }, {}, never>;
|
|
33
24
|
}
|