@dereekb/dbx-web 12.4.5 → 12.5.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/esm2022/lib/action/action.confirm.directive.mjs +4 -4
- package/esm2022/lib/action/snackbar/action.snackbar.component.mjs +2 -2
- package/esm2022/lib/action/transition/transition.safety.dialog.component.mjs +2 -2
- package/esm2022/lib/button/button.component.mjs +46 -20
- package/esm2022/lib/button/progress/abstract.progress.button.directive.mjs +53 -7
- package/esm2022/lib/button/progress/bar.button.component.mjs +3 -3
- package/esm2022/lib/button/progress/button.progress.config.mjs +1 -1
- package/esm2022/lib/button/progress/spinner.button.component.mjs +3 -3
- package/esm2022/lib/extension/download/text/download.text.component.mjs +2 -2
- package/esm2022/lib/interaction/filter/filter.wrapper.component.mjs +2 -2
- package/esm2022/lib/interaction/index.mjs +2 -1
- package/esm2022/lib/interaction/popup/popup.controls.buttons.component.mjs +1 -1
- package/esm2022/lib/interaction/upload/abstract.upload.component.mjs +85 -0
- package/esm2022/lib/interaction/upload/index.mjs +8 -0
- package/esm2022/lib/interaction/upload/upload.accept.mjs +72 -0
- package/esm2022/lib/interaction/upload/upload.action.directive.mjs +36 -0
- package/esm2022/lib/interaction/upload/upload.action.mjs +18 -0
- package/esm2022/lib/interaction/upload/upload.area.component.mjs +138 -0
- package/esm2022/lib/interaction/upload/upload.button.component.mjs +81 -0
- package/esm2022/lib/interaction/upload/upload.component.mjs +116 -0
- package/esm2022/lib/layout/avatar/avatar.component.mjs +76 -0
- package/esm2022/lib/layout/avatar/avatar.mjs +7 -0
- package/esm2022/lib/layout/avatar/avatar.service.mjs +78 -0
- package/esm2022/lib/layout/avatar/avatar.view.component.mjs +89 -0
- package/esm2022/lib/layout/avatar/index.mjs +4 -0
- package/esm2022/lib/layout/content/content.pit.directive.mjs +34 -4
- package/esm2022/lib/layout/index.mjs +2 -1
- package/esm2022/lib/loading/basic-loading.component.mjs +32 -5
- package/esm2022/lib/loading/index.mjs +2 -1
- package/esm2022/lib/loading/loading.component.mjs +11 -4
- package/esm2022/lib/loading/loading.mjs +2 -0
- package/fesm2022/dereekb-dbx-web.mjs +930 -47
- package/fesm2022/dereekb-dbx-web.mjs.map +1 -1
- package/lib/action/action.confirm.directive.d.ts +1 -1
- package/lib/button/_button.scss +2 -1
- package/lib/button/button.component.d.ts +5 -1
- package/lib/button/progress/abstract.progress.button.directive.d.ts +9 -5
- package/lib/button/progress/button.progress.config.d.ts +6 -2
- package/lib/interaction/_interaction.scss +4 -0
- package/lib/interaction/index.d.ts +1 -0
- package/lib/interaction/upload/_upload.scss +100 -0
- package/lib/interaction/upload/abstract.upload.component.d.ts +54 -0
- package/lib/interaction/upload/index.d.ts +7 -0
- package/lib/interaction/upload/upload.accept.d.ts +87 -0
- package/lib/interaction/upload/upload.action.d.ts +17 -0
- package/lib/interaction/upload/upload.action.directive.d.ts +17 -0
- package/lib/interaction/upload/upload.area.component.d.ts +22 -0
- package/lib/interaction/upload/upload.button.component.d.ts +24 -0
- package/lib/interaction/upload/upload.component.d.ts +58 -0
- package/lib/layout/_layout.scss +4 -0
- package/lib/layout/avatar/_avatar.scss +102 -0
- package/lib/layout/avatar/avatar.component.d.ts +32 -0
- package/lib/layout/avatar/avatar.d.ts +54 -0
- package/lib/layout/avatar/avatar.service.d.ts +66 -0
- package/lib/layout/avatar/avatar.view.component.d.ts +24 -0
- package/lib/layout/avatar/index.d.ts +3 -0
- package/lib/layout/content/content.pit.directive.d.ts +6 -2
- package/lib/layout/index.d.ts +1 -0
- package/lib/loading/basic-loading.component.d.ts +13 -8
- package/lib/loading/index.d.ts +1 -0
- package/lib/loading/loading.component.d.ts +4 -3
- package/lib/loading/loading.d.ts +10 -0
- package/lib/style/_config.scss +17 -1
- package/lib/style/_root-variables.scss +4 -0
- package/lib/style/_variables.scss +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use 'sass:color';
|
|
3
|
+
@use '../../style/theming';
|
|
4
|
+
|
|
5
|
+
// MARK: Variables
|
|
6
|
+
$icon-to-avatar-size-ratio: 0.65;
|
|
7
|
+
|
|
8
|
+
// MARK: Mixin
|
|
9
|
+
@mixin core() {
|
|
10
|
+
.dbx-avatar-view {
|
|
11
|
+
position: relative;
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
width: var(#{theming.$dbx-avatar-size-var}, 64px);
|
|
17
|
+
height: var(#{theming.$dbx-avatar-size-var}, 64px);
|
|
18
|
+
|
|
19
|
+
.mat-icon {
|
|
20
|
+
font-size: calc(var(#{theming.$dbx-avatar-size-var}, 64px) * #{$icon-to-avatar-size-ratio});
|
|
21
|
+
width: calc(var(#{theming.$dbx-avatar-size-var}, 64px) * #{$icon-to-avatar-size-ratio});
|
|
22
|
+
height: calc(var(#{theming.$dbx-avatar-size-var}, 64px) * #{$icon-to-avatar-size-ratio});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.dbx-avatar-small .dbx-avatar-view {
|
|
27
|
+
width: var(#{theming.$dbx-avatar-small-size-var}, 32px);
|
|
28
|
+
height: var(#{theming.$dbx-avatar-small-size-var}, 32px);
|
|
29
|
+
|
|
30
|
+
.mat-icon {
|
|
31
|
+
font-size: calc(var(#{theming.$dbx-avatar-small-size-var}, 32px) * #{$icon-to-avatar-size-ratio});
|
|
32
|
+
width: calc(var(#{theming.$dbx-avatar-small-size-var}, 32px) * #{$icon-to-avatar-size-ratio});
|
|
33
|
+
height: calc(var(#{theming.$dbx-avatar-small-size-var}, 32px) * #{$icon-to-avatar-size-ratio});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.dbx-avatar-large .dbx-avatar-view {
|
|
38
|
+
width: var(#{theming.$dbx-avatar-large-size-var}, 128px);
|
|
39
|
+
height: var(#{theming.$dbx-avatar-large-size-var}, 128px);
|
|
40
|
+
|
|
41
|
+
.mat-icon {
|
|
42
|
+
font-size: calc(var(#{theming.$dbx-avatar-large-size-var}, 128px) * #{$icon-to-avatar-size-ratio});
|
|
43
|
+
width: calc(var(#{theming.$dbx-avatar-large-size-var}, 128px) * #{$icon-to-avatar-size-ratio});
|
|
44
|
+
height: calc(var(#{theming.$dbx-avatar-large-size-var}, 128px) * #{$icon-to-avatar-size-ratio});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.dbx-avatar-view-img {
|
|
49
|
+
width: 100%;
|
|
50
|
+
height: 100%;
|
|
51
|
+
object-fit: cover;
|
|
52
|
+
display: block;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.dbx-avatar-view-fallback {
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
justify-content: center;
|
|
59
|
+
width: 100%;
|
|
60
|
+
height: 100%;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.dbx-avatar-view-circle {
|
|
64
|
+
border-radius: 50%;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.dbx-avatar-view-square {
|
|
68
|
+
border-radius: 12px;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@mixin color($theme-config) {
|
|
73
|
+
$color-config: theming.m2-get-color-config($theme-config);
|
|
74
|
+
$background: map.get($color-config, 'background');
|
|
75
|
+
$primary: map.get($color-config, 'primary');
|
|
76
|
+
$accent: map.get($color-config, 'accent');
|
|
77
|
+
|
|
78
|
+
$background-color: theming.m2-get-color-from-palette($background, 'hover');
|
|
79
|
+
|
|
80
|
+
.dbx-avatar-view {
|
|
81
|
+
background-color: $background-color;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@mixin typography($theme-config-or-typography-config) {
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@mixin theme($theme-config) {
|
|
89
|
+
@include theming.private-check-duplicate-theme-styles($theme-config, 'dbx-layout-avatar') {
|
|
90
|
+
$color: theming.m2-get-color-config($theme-config);
|
|
91
|
+
$density: theming.m2-get-density-config($theme-config);
|
|
92
|
+
$typography: theming.m2-get-typography-config($theme-config);
|
|
93
|
+
|
|
94
|
+
@if $color !=null {
|
|
95
|
+
@include color($theme-config);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@if $typography !=null {
|
|
99
|
+
@include typography($theme-config);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Injector } from '@angular/core';
|
|
2
|
+
import { DbxAvatarContext, DbxAvatarSize, DbxAvatarStyle } from './avatar';
|
|
3
|
+
import { DbxAvatarViewService } from './avatar.service';
|
|
4
|
+
import { DbxInjectionComponentConfig } from '@dereekb/dbx-core';
|
|
5
|
+
import { Maybe } from '@dereekb/util';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* Component that displays an avatar based on the input context.
|
|
9
|
+
*/
|
|
10
|
+
export declare class DbxAvatarComponent {
|
|
11
|
+
readonly injector: Injector;
|
|
12
|
+
readonly avatarService: DbxAvatarViewService;
|
|
13
|
+
readonly context: import("@angular/core").InputSignal<DbxAvatarContext | undefined>;
|
|
14
|
+
readonly avatarSelector: import("@angular/core").InputSignal<Maybe<string>>;
|
|
15
|
+
readonly avatarUid: import("@angular/core").InputSignal<Maybe<string>>;
|
|
16
|
+
readonly avatarUrl: import("@angular/core").InputSignal<Maybe<string>>;
|
|
17
|
+
readonly avatarKey: import("@angular/core").InputSignal<Maybe<string>>;
|
|
18
|
+
readonly avatarIcon: import("@angular/core").InputSignal<Maybe<string>>;
|
|
19
|
+
readonly avatarStyle: import("@angular/core").InputSignal<Maybe<DbxAvatarStyle>>;
|
|
20
|
+
readonly avatarSize: import("@angular/core").InputSignal<Maybe<DbxAvatarSize>>;
|
|
21
|
+
readonly contextSignal: import("@angular/core").Signal<{
|
|
22
|
+
selector: Maybe<string>;
|
|
23
|
+
uid: Maybe<string>;
|
|
24
|
+
url: Maybe<string>;
|
|
25
|
+
key: Maybe<string>;
|
|
26
|
+
icon: Maybe<string>;
|
|
27
|
+
style: DbxAvatarStyle | undefined;
|
|
28
|
+
}>;
|
|
29
|
+
readonly configSignal: import("@angular/core").Signal<DbxInjectionComponentConfig<unknown>>;
|
|
30
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxAvatarComponent, never>;
|
|
31
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxAvatarComponent, "dbx-avatar", never, { "context": { "alias": "context"; "required": false; "isSignal": true; }; "avatarSelector": { "alias": "avatarSelector"; "required": false; "isSignal": true; }; "avatarUid": { "alias": "avatarUid"; "required": false; "isSignal": true; }; "avatarUrl": { "alias": "avatarUrl"; "required": false; "isSignal": true; }; "avatarKey": { "alias": "avatarKey"; "required": false; "isSignal": true; }; "avatarIcon": { "alias": "avatarIcon"; "required": false; "isSignal": true; }; "avatarStyle": { "alias": "avatarStyle"; "required": false; "isSignal": true; }; "avatarSize": { "alias": "avatarSize"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { AuthUserIdentifier } from '@dereekb/dbx-core';
|
|
3
|
+
import { Maybe, WebsiteUrlWithPrefix } from '@dereekb/util';
|
|
4
|
+
/**
|
|
5
|
+
* Arbitrary string selector used to differentiate avatars.
|
|
6
|
+
*/
|
|
7
|
+
export type DbxAvatarSelector = string;
|
|
8
|
+
/**
|
|
9
|
+
* Arbitrary key that is used to configure an avatar path.
|
|
10
|
+
*/
|
|
11
|
+
export type DbxAvatarKey = string;
|
|
12
|
+
/**
|
|
13
|
+
* The avatar style.
|
|
14
|
+
*/
|
|
15
|
+
export type DbxAvatarStyle = 'circle' | 'square';
|
|
16
|
+
/**
|
|
17
|
+
* The avatar size.
|
|
18
|
+
*/
|
|
19
|
+
export type DbxAvatarSize = 'small' | 'normal' | 'large';
|
|
20
|
+
/**
|
|
21
|
+
* Provides contextual information for displaying an avatar.
|
|
22
|
+
*/
|
|
23
|
+
export interface DbxAvatarContext {
|
|
24
|
+
/**
|
|
25
|
+
* An arbitrary discriminator used to differentiate avatars.
|
|
26
|
+
*/
|
|
27
|
+
readonly selector?: Maybe<DbxAvatarSelector>;
|
|
28
|
+
/**
|
|
29
|
+
* User identifier.
|
|
30
|
+
*
|
|
31
|
+
* May be used in some cases to display a user-specific avatar.
|
|
32
|
+
*/
|
|
33
|
+
readonly uid?: Maybe<AuthUserIdentifier>;
|
|
34
|
+
/**
|
|
35
|
+
* A full website URL to an avatar image.
|
|
36
|
+
*/
|
|
37
|
+
readonly url?: Maybe<WebsiteUrlWithPrefix>;
|
|
38
|
+
/**
|
|
39
|
+
* Arbitrary key that is used to configure an avatar.
|
|
40
|
+
*/
|
|
41
|
+
readonly key?: Maybe<DbxAvatarKey>;
|
|
42
|
+
/**
|
|
43
|
+
* The avatar style.
|
|
44
|
+
*/
|
|
45
|
+
readonly style?: DbxAvatarStyle;
|
|
46
|
+
/**
|
|
47
|
+
* Icon name to use for the fallback avatar when no image is provided.
|
|
48
|
+
*/
|
|
49
|
+
readonly icon?: Maybe<string>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Injection token for the avatar context data.
|
|
53
|
+
*/
|
|
54
|
+
export declare const DBX_AVATAR_CONTEXT_DATA_TOKEN: InjectionToken<DbxAvatarContext>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { DbxInjectionComponentConfig } from '@dereekb/dbx-core';
|
|
2
|
+
import { DbxAvatarContext } from './avatar';
|
|
3
|
+
import { Maybe, WebsitePath, WebsiteUrlWithPrefix } from '@dereekb/util';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* The injection configuration for a DbxAvatar component.
|
|
7
|
+
*
|
|
8
|
+
* Not allowed to override the injector.
|
|
9
|
+
*
|
|
10
|
+
* The final injector that will be passed will provide DBX_AVATAR_CONTEXT_DATA_TOKEN.
|
|
11
|
+
*/
|
|
12
|
+
export type DbxAvatarInjectionComponentConfig = Omit<DbxInjectionComponentConfig, 'injector'>;
|
|
13
|
+
/**
|
|
14
|
+
* Function that returns a DbxInjectionComponentConfig for the given context.
|
|
15
|
+
*
|
|
16
|
+
* Can return null/undefined if the default avatar component should be used.
|
|
17
|
+
*
|
|
18
|
+
* @param context The current context input.
|
|
19
|
+
*/
|
|
20
|
+
export type DbxAvatarComponentForContextFunction = (context: DbxAvatarContext) => Maybe<DbxAvatarInjectionComponentConfig>;
|
|
21
|
+
/**
|
|
22
|
+
* Configuration for a DbxAvatarViewService.
|
|
23
|
+
*/
|
|
24
|
+
export declare abstract class DbxAvatarViewServiceConfig {
|
|
25
|
+
/**
|
|
26
|
+
* The default avatar URL to use in DbxAvatarViewComponent if no other url is available
|
|
27
|
+
*/
|
|
28
|
+
readonly defaultAvatarUrl?: Maybe<WebsitePath | WebsiteUrlWithPrefix>;
|
|
29
|
+
/**
|
|
30
|
+
* The default fallback icon to use when no avatar image is provided.
|
|
31
|
+
*/
|
|
32
|
+
readonly defaultAvatarIcon?: Maybe<string>;
|
|
33
|
+
/**
|
|
34
|
+
* The default fallback icon to use when an avatar image is provided but fails to load.
|
|
35
|
+
*/
|
|
36
|
+
readonly defaultAvatarErrorIcon?: Maybe<string>;
|
|
37
|
+
/**
|
|
38
|
+
* Overrides the default avatar component.
|
|
39
|
+
*/
|
|
40
|
+
readonly defaultAvatarComponentConfig?: Maybe<DbxAvatarInjectionComponentConfig>;
|
|
41
|
+
/**
|
|
42
|
+
* Custom function that returns a DbxInjectionComponentConfig for the given context.
|
|
43
|
+
*/
|
|
44
|
+
readonly avatarComponentForContext?: DbxAvatarComponentForContextFunction;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Service for registering avatars.
|
|
48
|
+
*/
|
|
49
|
+
export declare class DbxAvatarViewService {
|
|
50
|
+
private readonly _serviceConfig;
|
|
51
|
+
private _defaultAvatarUrl;
|
|
52
|
+
private _defaultAvatarIcon;
|
|
53
|
+
private _defaultAvatarErrorIcon;
|
|
54
|
+
private _defaultAvatarComponentConfig;
|
|
55
|
+
private _avatarComponentForContext?;
|
|
56
|
+
avatarComponentForContext(context: DbxAvatarContext): DbxAvatarInjectionComponentConfig;
|
|
57
|
+
get defaultAvatarUrl(): Maybe<string>;
|
|
58
|
+
get defaultAvatarIcon(): Maybe<string>;
|
|
59
|
+
get defaultAvatarErrorIcon(): Maybe<string>;
|
|
60
|
+
setDefaultAvatarUrl(url: Maybe<WebsitePath | WebsiteUrlWithPrefix>): void;
|
|
61
|
+
setDefaultAvatarIcon(icon: Maybe<string>): void;
|
|
62
|
+
setDefaultAvatarErrorIcon(icon: Maybe<string>): void;
|
|
63
|
+
setDefaultAvatarComponentConfig(config: DbxAvatarInjectionComponentConfig): void;
|
|
64
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxAvatarViewService, never>;
|
|
65
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DbxAvatarViewService>;
|
|
66
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Maybe } from '@dereekb/util';
|
|
2
|
+
import { DbxAvatarViewService } from './avatar.service';
|
|
3
|
+
import { DbxAvatarContext, DbxAvatarStyle } from './avatar';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Component that displays an avatar image. It has a configurable default avatar.
|
|
7
|
+
*/
|
|
8
|
+
export declare class DbxAvatarViewComponent {
|
|
9
|
+
readonly defaultContext: Maybe<DbxAvatarContext>;
|
|
10
|
+
readonly avatarService: DbxAvatarViewService;
|
|
11
|
+
readonly defaultAvatarUrl: Maybe<string>;
|
|
12
|
+
readonly avatarUrl: import("@angular/core").InputSignal<Maybe<string>>;
|
|
13
|
+
readonly avatarErrorUrlSignal: import("@angular/core").WritableSignal<Maybe<string | boolean>>;
|
|
14
|
+
readonly avatarStyle: import("@angular/core").InputSignal<Maybe<DbxAvatarStyle>>;
|
|
15
|
+
readonly avatarIcon: import("@angular/core").InputSignal<Maybe<string>>;
|
|
16
|
+
readonly avatarUrlSignal: import("@angular/core").Signal<Maybe<string>>;
|
|
17
|
+
readonly hasAvatarSignal: import("@angular/core").Signal<boolean>;
|
|
18
|
+
readonly missingAvatarSignal: import("@angular/core").Signal<boolean>;
|
|
19
|
+
readonly avatarStyleClassSignal: import("@angular/core").Signal<"circle" | "square">;
|
|
20
|
+
readonly avatarIconSignal: import("@angular/core").Signal<string>;
|
|
21
|
+
onAvatarImageError(event: Event): void;
|
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxAvatarViewComponent, never>;
|
|
23
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxAvatarViewComponent, "dbx-avatar-view", never, { "avatarUrl": { "alias": "avatarUrl"; "required": false; "isSignal": true; }; "avatarStyle": { "alias": "avatarStyle"; "required": false; "isSignal": true; }; "avatarIcon": { "alias": "avatarIcon"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
24
|
+
}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { type Maybe } from '@dereekb/util';
|
|
1
|
+
import { Pixels, PixelsString, type Maybe } from '@dereekb/util';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
+
export type DbxContentPitScrollableInput = boolean | DbxContentPitScrollableHeight;
|
|
4
|
+
export type DbxContentPitScrollableHeight = Pixels | PixelsString | DbxContentPitScrollableHeightSetting;
|
|
5
|
+
export type DbxContentPitScrollableHeightSetting = 'small' | 'medium' | 'large';
|
|
3
6
|
/**
|
|
4
7
|
* Component used to wrap content in a pit with a label.
|
|
5
8
|
*/
|
|
6
9
|
export declare class DbxContentPitDirective {
|
|
7
|
-
readonly scrollable: import("@angular/core").InputSignal<Maybe<
|
|
10
|
+
readonly scrollable: import("@angular/core").InputSignal<Maybe<DbxContentPitScrollableInput>>;
|
|
11
|
+
readonly scrollableHeightSignal: import("@angular/core").Signal<string | null>;
|
|
8
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxContentPitDirective, never>;
|
|
9
13
|
static ɵdir: i0.ɵɵDirectiveDeclaration<DbxContentPitDirective, "dbx-content-pit, [dbxContentPit]", never, { "scrollable": { "alias": "scrollable"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
10
14
|
}
|
package/lib/layout/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { ElementRef } from '@angular/core';
|
|
1
|
+
import { ElementRef, Signal } from '@angular/core';
|
|
2
|
+
import { ProgressBarMode } from '@angular/material/progress-bar';
|
|
2
3
|
import { ErrorInput, type Maybe } from '@dereekb/util';
|
|
4
|
+
import { ProgressSpinnerMode } from '@angular/material/progress-spinner';
|
|
3
5
|
import * as i0 from "@angular/core";
|
|
4
6
|
/**
|
|
5
7
|
* DbxBasicLoadingComponent loading state.
|
|
@@ -9,19 +11,22 @@ export type LoadingComponentState = 'none' | 'loading' | 'content' | 'error';
|
|
|
9
11
|
* Basic loading component.
|
|
10
12
|
*/
|
|
11
13
|
export declare class DbxBasicLoadingComponent {
|
|
12
|
-
readonly customError:
|
|
13
|
-
readonly customLoading:
|
|
14
|
+
readonly customError: Signal<Maybe<ElementRef<any>>>;
|
|
15
|
+
readonly customLoading: Signal<Maybe<ElementRef<any>>>;
|
|
14
16
|
readonly diameter: import("@angular/core").InputSignal<Maybe<number>>;
|
|
15
|
-
readonly mode: import("@angular/core").InputSignal<"determinate" | "indeterminate" | "buffer" | "query"
|
|
17
|
+
readonly mode: import("@angular/core").InputSignal<Maybe<"determinate" | "indeterminate" | "buffer" | "query">>;
|
|
16
18
|
readonly color: import("@angular/core").InputSignal<"primary" | "accent" | "warn" | "notice" | "ok" | "success" | "grey" | "background" | "disabled" | undefined>;
|
|
17
19
|
readonly text: import("@angular/core").InputSignal<Maybe<string>>;
|
|
18
20
|
readonly linear: import("@angular/core").InputSignal<Maybe<boolean>>;
|
|
19
21
|
readonly show: import("@angular/core").InputSignal<Maybe<boolean>>;
|
|
20
|
-
readonly loading: import("@angular/core").InputSignal<Maybe<
|
|
22
|
+
readonly loading: import("@angular/core").InputSignal<Maybe<import("@dereekb/dbx-core").DbxActionWorkOrWorkProgress>>;
|
|
21
23
|
readonly error: import("@angular/core").InputSignal<Maybe<ErrorInput>>;
|
|
22
|
-
readonly
|
|
23
|
-
readonly
|
|
24
|
-
readonly
|
|
24
|
+
readonly loadingProgressSignal: Signal<Maybe<number>>;
|
|
25
|
+
readonly modeSignal: Signal<ProgressBarMode | ProgressSpinnerMode>;
|
|
26
|
+
readonly isLoadingSignal: Signal<boolean>;
|
|
27
|
+
readonly stateSignal: Signal<LoadingComponentState>;
|
|
28
|
+
readonly hasNoCustomErrorSignal: Signal<boolean>;
|
|
29
|
+
readonly hasNoCustomLoadingSignal: Signal<boolean>;
|
|
25
30
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxBasicLoadingComponent, never>;
|
|
26
31
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxBasicLoadingComponent, "dbx-basic-loading", never, { "diameter": { "alias": "diameter"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "text": { "alias": "text"; "required": false; "isSignal": true; }; "linear": { "alias": "linear"; "required": false; "isSignal": true; }; "show": { "alias": "show"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; }, {}, never, ["*", "[loading]", "[error]", "[errorAction]"], true, never>;
|
|
27
32
|
}
|
package/lib/loading/index.d.ts
CHANGED
|
@@ -3,12 +3,13 @@ import { Signal } from '@angular/core';
|
|
|
3
3
|
import { ProgressBarMode } from '@angular/material/progress-bar';
|
|
4
4
|
import { LoadingContext, LoadingContextEvent, MaybeObservableOrValue } from '@dereekb/rxjs';
|
|
5
5
|
import { ErrorInput, type Maybe } from '@dereekb/util';
|
|
6
|
+
import { DbxLoadingIsLoadingOrProgress } from './loading';
|
|
6
7
|
import * as i0 from "@angular/core";
|
|
7
8
|
/**
|
|
8
9
|
* State of a DbxLoadingComponent.
|
|
9
10
|
*/
|
|
10
11
|
export interface DbxLoadingComponentState {
|
|
11
|
-
readonly loading:
|
|
12
|
+
readonly loading: DbxLoadingIsLoadingOrProgress;
|
|
12
13
|
readonly error: Maybe<ErrorInput>;
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
@@ -22,11 +23,11 @@ export declare class DbxLoadingComponent {
|
|
|
22
23
|
readonly padding: import("@angular/core").InputSignal<Maybe<boolean>>;
|
|
23
24
|
readonly show: import("@angular/core").InputSignal<Maybe<boolean>>;
|
|
24
25
|
readonly text: import("@angular/core").InputSignal<Maybe<string>>;
|
|
25
|
-
readonly mode: import("@angular/core").InputSignal<ProgressBarMode
|
|
26
|
+
readonly mode: import("@angular/core").InputSignal<Maybe<ProgressBarMode>>;
|
|
26
27
|
readonly color: import("@angular/core").InputSignal<"primary" | "accent" | "warn" | "notice" | "ok" | "success" | "grey" | "background" | "disabled" | undefined>;
|
|
27
28
|
readonly diameter: import("@angular/core").InputSignal<Maybe<number>>;
|
|
28
29
|
readonly linear: import("@angular/core").InputSignal<Maybe<boolean>>;
|
|
29
|
-
readonly loading: import("@angular/core").InputSignal<Maybe<
|
|
30
|
+
readonly loading: import("@angular/core").InputSignal<Maybe<import("@dereekb/dbx-core").DbxActionWorkOrWorkProgress>>;
|
|
30
31
|
readonly error: import("@angular/core").InputSignal<Maybe<ErrorInput>>;
|
|
31
32
|
readonly context: import("@angular/core").InputSignal<MaybeObservableOrValue<LoadingContext<LoadingContextEvent>>>;
|
|
32
33
|
readonly contextSignal: Signal<MaybeObservableOrValue<LoadingContext>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DbxActionWorkOrWorkProgress, DbxActionWorkProgress } from '@dereekb/dbx-core';
|
|
2
|
+
export type DbxLoadingProgress = DbxActionWorkProgress;
|
|
3
|
+
/**
|
|
4
|
+
* Loading progress for a loading component.
|
|
5
|
+
*
|
|
6
|
+
* Can be a boolean or a number.
|
|
7
|
+
*
|
|
8
|
+
* True is treated as an indeterminate loading state.
|
|
9
|
+
*/
|
|
10
|
+
export type DbxLoadingIsLoadingOrProgress = DbxActionWorkOrWorkProgress;
|
package/lib/style/_config.scss
CHANGED
|
@@ -108,7 +108,11 @@ $default-notice-color: #f28600;
|
|
|
108
108
|
// colors - NOTE: other colors come from Angular Material
|
|
109
109
|
'success-color': $default-success-color,
|
|
110
110
|
'ok-color': $default-ok-color,
|
|
111
|
-
'notice-color': $default-notice-color
|
|
111
|
+
'notice-color': $default-notice-color,
|
|
112
|
+
// avatar
|
|
113
|
+
'dbx-avatar-size': 64px,
|
|
114
|
+
'dbx-avatar-large-size': 128px,
|
|
115
|
+
'dbx-avatar-small-size': 32px
|
|
112
116
|
);
|
|
113
117
|
|
|
114
118
|
@if ($input-dbx-theme-layout-config != null) {
|
|
@@ -170,6 +174,18 @@ $default-notice-color: #f28600;
|
|
|
170
174
|
@return get-dbx-layout-config-var($theme-config, 'notice-color');
|
|
171
175
|
}
|
|
172
176
|
|
|
177
|
+
@function get-dbx-avatar-size($theme-config) {
|
|
178
|
+
@return get-dbx-layout-config-var($theme-config, 'dbx-avatar-size');
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
@function get-dbx-avatar-large-size($theme-config) {
|
|
182
|
+
@return get-dbx-layout-config-var($theme-config, 'dbx-avatar-large-size');
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
@function get-dbx-avatar-small-size($theme-config) {
|
|
186
|
+
@return get-dbx-layout-config-var($theme-config, 'dbx-avatar-small-size');
|
|
187
|
+
}
|
|
188
|
+
|
|
173
189
|
// extension
|
|
174
190
|
@function define-dbx-extension-config($input-dbx-theme-extension-config: null) {
|
|
175
191
|
$dbx-extension-config: (
|
|
@@ -32,6 +32,10 @@
|
|
|
32
32
|
#{theming.$dbx-page-height-additional-offset-var}: 0px;
|
|
33
33
|
#{theming.$dbx-content-height-additional-offset-var}: 0px;
|
|
34
34
|
|
|
35
|
+
#{theming.$dbx-avatar-size-var}: theming.get-dbx-avatar-size($theme-config);
|
|
36
|
+
#{theming.$dbx-avatar-large-size-var}: theming.get-dbx-avatar-large-size($theme-config);
|
|
37
|
+
#{theming.$dbx-avatar-small-size-var}: theming.get-dbx-avatar-small-size($theme-config);
|
|
38
|
+
|
|
35
39
|
// root height
|
|
36
40
|
&.dbx-style-root {
|
|
37
41
|
display: block;
|
|
@@ -55,6 +55,10 @@ $dbx-content-height-base-var: --dbx-content-height-base;
|
|
|
55
55
|
$dbx-content-height-var: --dbx-content-height;
|
|
56
56
|
$dbx-nested-content-height-var: --dbx-nested-content-height;
|
|
57
57
|
|
|
58
|
+
$dbx-avatar-size-var: --dbx-avatar-size;
|
|
59
|
+
$dbx-avatar-large-size-var: --dbx-avatar-large-size;
|
|
60
|
+
$dbx-avatar-small-size-var: --dbx-avatar-small-size;
|
|
61
|
+
|
|
58
62
|
// vars
|
|
59
63
|
$vh100: var($vh100-var);
|
|
60
64
|
|
|
@@ -124,6 +128,10 @@ $dbx-grey-color-contrast: var($dbx-grey-color-contrast-var);
|
|
|
124
128
|
$dbx-disabled-color-contrast: var($dbx-disabled-color-contrast-var);
|
|
125
129
|
$dbx-bg-color-contrast: var($dbx-bg-color-contrast-var);
|
|
126
130
|
|
|
131
|
+
$dbx-avatar-size: var($dbx-avatar-size-var);
|
|
132
|
+
$dbx-avatar-large-size: var($dbx-avatar-large-size-var);
|
|
133
|
+
$dbx-avatar-small-size: var($dbx-avatar-small-size-var);
|
|
134
|
+
|
|
127
135
|
$dbx-theme-colors-main: (
|
|
128
136
|
'primary': (
|
|
129
137
|
'color': $dbx-primary-color,
|