@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.
Files changed (66) hide show
  1. package/esm2022/lib/action/action.confirm.directive.mjs +4 -4
  2. package/esm2022/lib/action/snackbar/action.snackbar.component.mjs +2 -2
  3. package/esm2022/lib/action/transition/transition.safety.dialog.component.mjs +2 -2
  4. package/esm2022/lib/button/button.component.mjs +46 -20
  5. package/esm2022/lib/button/progress/abstract.progress.button.directive.mjs +53 -7
  6. package/esm2022/lib/button/progress/bar.button.component.mjs +3 -3
  7. package/esm2022/lib/button/progress/button.progress.config.mjs +1 -1
  8. package/esm2022/lib/button/progress/spinner.button.component.mjs +3 -3
  9. package/esm2022/lib/extension/download/text/download.text.component.mjs +2 -2
  10. package/esm2022/lib/interaction/filter/filter.wrapper.component.mjs +2 -2
  11. package/esm2022/lib/interaction/index.mjs +2 -1
  12. package/esm2022/lib/interaction/popup/popup.controls.buttons.component.mjs +1 -1
  13. package/esm2022/lib/interaction/upload/abstract.upload.component.mjs +85 -0
  14. package/esm2022/lib/interaction/upload/index.mjs +8 -0
  15. package/esm2022/lib/interaction/upload/upload.accept.mjs +72 -0
  16. package/esm2022/lib/interaction/upload/upload.action.directive.mjs +36 -0
  17. package/esm2022/lib/interaction/upload/upload.action.mjs +18 -0
  18. package/esm2022/lib/interaction/upload/upload.area.component.mjs +138 -0
  19. package/esm2022/lib/interaction/upload/upload.button.component.mjs +81 -0
  20. package/esm2022/lib/interaction/upload/upload.component.mjs +116 -0
  21. package/esm2022/lib/layout/avatar/avatar.component.mjs +76 -0
  22. package/esm2022/lib/layout/avatar/avatar.mjs +7 -0
  23. package/esm2022/lib/layout/avatar/avatar.service.mjs +78 -0
  24. package/esm2022/lib/layout/avatar/avatar.view.component.mjs +89 -0
  25. package/esm2022/lib/layout/avatar/index.mjs +4 -0
  26. package/esm2022/lib/layout/content/content.pit.directive.mjs +34 -4
  27. package/esm2022/lib/layout/index.mjs +2 -1
  28. package/esm2022/lib/loading/basic-loading.component.mjs +32 -5
  29. package/esm2022/lib/loading/index.mjs +2 -1
  30. package/esm2022/lib/loading/loading.component.mjs +11 -4
  31. package/esm2022/lib/loading/loading.mjs +2 -0
  32. package/fesm2022/dereekb-dbx-web.mjs +930 -47
  33. package/fesm2022/dereekb-dbx-web.mjs.map +1 -1
  34. package/lib/action/action.confirm.directive.d.ts +1 -1
  35. package/lib/button/_button.scss +2 -1
  36. package/lib/button/button.component.d.ts +5 -1
  37. package/lib/button/progress/abstract.progress.button.directive.d.ts +9 -5
  38. package/lib/button/progress/button.progress.config.d.ts +6 -2
  39. package/lib/interaction/_interaction.scss +4 -0
  40. package/lib/interaction/index.d.ts +1 -0
  41. package/lib/interaction/upload/_upload.scss +100 -0
  42. package/lib/interaction/upload/abstract.upload.component.d.ts +54 -0
  43. package/lib/interaction/upload/index.d.ts +7 -0
  44. package/lib/interaction/upload/upload.accept.d.ts +87 -0
  45. package/lib/interaction/upload/upload.action.d.ts +17 -0
  46. package/lib/interaction/upload/upload.action.directive.d.ts +17 -0
  47. package/lib/interaction/upload/upload.area.component.d.ts +22 -0
  48. package/lib/interaction/upload/upload.button.component.d.ts +24 -0
  49. package/lib/interaction/upload/upload.component.d.ts +58 -0
  50. package/lib/layout/_layout.scss +4 -0
  51. package/lib/layout/avatar/_avatar.scss +102 -0
  52. package/lib/layout/avatar/avatar.component.d.ts +32 -0
  53. package/lib/layout/avatar/avatar.d.ts +54 -0
  54. package/lib/layout/avatar/avatar.service.d.ts +66 -0
  55. package/lib/layout/avatar/avatar.view.component.d.ts +24 -0
  56. package/lib/layout/avatar/index.d.ts +3 -0
  57. package/lib/layout/content/content.pit.directive.d.ts +6 -2
  58. package/lib/layout/index.d.ts +1 -0
  59. package/lib/loading/basic-loading.component.d.ts +13 -8
  60. package/lib/loading/index.d.ts +1 -0
  61. package/lib/loading/loading.component.d.ts +4 -3
  62. package/lib/loading/loading.d.ts +10 -0
  63. package/lib/style/_config.scss +17 -1
  64. package/lib/style/_root-variables.scss +4 -0
  65. package/lib/style/_variables.scss +8 -0
  66. package/package.json +1 -1
@@ -22,7 +22,7 @@ export interface DbxActionConfirmConfig<T = unknown> extends DbxPromptConfirmCon
22
22
  export declare class DbxActionConfirmDirective<T = unknown, O = unknown> extends AbstractPromptConfirmDirective implements OnInit, OnDestroy {
23
23
  readonly source: DbxActionContextStoreSourceInstance<T, O>;
24
24
  readonly dbxActionConfirm: import("@angular/core").InputSignalWithTransform<Maybe<DbxActionConfirmConfig<T>>, Maybe<"" | DbxActionConfirmConfig<T>>>;
25
- private readonly _sourceSubscription;
25
+ private readonly _sourceSub;
26
26
  ngOnInit(): void;
27
27
  ngOnDestroy(): void;
28
28
  protected getDefaultDialogConfig(): Maybe<DbxPromptConfirmConfig>;
@@ -10,7 +10,8 @@ $big-button-height: 46px; // 33% bigger
10
10
  // MARK: Mixin
11
11
  @mixin core() {
12
12
  // increases the height of the mat-mdc-button
13
- .dbx-button-big {
13
+ .dbx-button-big,
14
+ .dbx-button-large {
14
15
  .mdc-button.mat-mdc-button {
15
16
  height: $big-button-height;
16
17
  }
@@ -3,6 +3,7 @@ import { AbstractDbxButtonDirective } from '@dereekb/dbx-core';
3
3
  import { type Maybe } from '@dereekb/util';
4
4
  import { DbxProgressButtonConfig } from './progress/button.progress.config';
5
5
  import { type DbxThemeColor } from '../layout/style/style';
6
+ import { ProgressSpinnerMode } from '@angular/material/progress-spinner';
6
7
  import * as i0 from "@angular/core";
7
8
  export type DbxButtonType = 'basic' | 'raised' | 'stroked' | 'flat' | 'icon';
8
9
  /**
@@ -10,6 +11,7 @@ export type DbxButtonType = 'basic' | 'raised' | 'stroked' | 'flat' | 'icon';
10
11
  */
11
12
  export interface DbxButtonStyle {
12
13
  readonly type?: DbxButtonType;
14
+ readonly mode?: ProgressSpinnerMode;
13
15
  readonly color?: ThemePalette | DbxThemeColor;
14
16
  readonly spinnerColor?: ThemePalette | DbxThemeColor;
15
17
  readonly customButtonColor?: string;
@@ -30,6 +32,7 @@ export declare enum DbxButtonDisplayType {
30
32
  * Complex button that supports loading states.
31
33
  */
32
34
  export declare class DbxButtonComponent extends AbstractDbxButtonDirective {
35
+ readonly bar: import("@angular/core").InputSignalWithTransform<boolean, Maybe<boolean | "">>;
33
36
  readonly type: import("@angular/core").InputSignal<Maybe<DbxButtonType>>;
34
37
  readonly buttonStyle: import("@angular/core").InputSignal<Maybe<DbxButtonStyle>>;
35
38
  readonly color: import("@angular/core").InputSignal<"primary" | "accent" | "warn" | "notice" | "ok" | "success" | "grey" | "background" | "disabled" | undefined>;
@@ -43,8 +46,9 @@ export declare class DbxButtonComponent extends AbstractDbxButtonDirective {
43
46
  readonly flat: import("@angular/core").InputSignalWithTransform<boolean, Maybe<boolean | "">>;
44
47
  readonly iconOnly: import("@angular/core").InputSignalWithTransform<boolean, Maybe<boolean | "">>;
45
48
  readonly fab: import("@angular/core").InputSignalWithTransform<boolean, Maybe<boolean | "">>;
49
+ readonly mode: import("@angular/core").InputSignal<Maybe<ProgressSpinnerMode>>;
46
50
  readonly typeSignal: import("@angular/core").Signal<DbxButtonType>;
47
51
  readonly configSignal: import("@angular/core").Signal<DbxProgressButtonConfig>;
48
52
  static ɵfac: i0.ɵɵFactoryDeclaration<DbxButtonComponent, never>;
49
- static ɵcmp: i0.ɵɵComponentDeclaration<DbxButtonComponent, "dbx-button", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; "buttonStyle": { "alias": "buttonStyle"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "spinnerColor": { "alias": "spinnerColor"; "required": false; "isSignal": true; }; "customButtonColor": { "alias": "customButtonColor"; "required": false; "isSignal": true; }; "customTextColor": { "alias": "customTextColor"; "required": false; "isSignal": true; }; "customSpinnerColor": { "alias": "customSpinnerColor"; "required": false; "isSignal": true; }; "basic": { "alias": "basic"; "required": false; "isSignal": true; }; "raised": { "alias": "raised"; "required": false; "isSignal": true; }; "stroked": { "alias": "stroked"; "required": false; "isSignal": true; }; "flat": { "alias": "flat"; "required": false; "isSignal": true; }; "iconOnly": { "alias": "iconOnly"; "required": false; "isSignal": true; }; "fab": { "alias": "fab"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
53
+ static ɵcmp: i0.ɵɵComponentDeclaration<DbxButtonComponent, "dbx-button", never, { "bar": { "alias": "bar"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "buttonStyle": { "alias": "buttonStyle"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "spinnerColor": { "alias": "spinnerColor"; "required": false; "isSignal": true; }; "customButtonColor": { "alias": "customButtonColor"; "required": false; "isSignal": true; }; "customTextColor": { "alias": "customTextColor"; "required": false; "isSignal": true; }; "customSpinnerColor": { "alias": "customSpinnerColor"; "required": false; "isSignal": true; }; "basic": { "alias": "basic"; "required": false; "isSignal": true; }; "raised": { "alias": "raised"; "required": false; "isSignal": true; }; "stroked": { "alias": "stroked"; "required": false; "isSignal": true; }; "flat": { "alias": "flat"; "required": false; "isSignal": true; }; "iconOnly": { "alias": "iconOnly"; "required": false; "isSignal": true; }; "fab": { "alias": "fab"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
50
54
  }
@@ -1,23 +1,27 @@
1
1
  import { OnDestroy, Signal } from '@angular/core';
2
- import { AbstractSubscriptionDirective } from '@dereekb/dbx-core';
2
+ import { AbstractSubscriptionDirective, type DbxActionWorkProgress, type DbxButtonWorking } from '@dereekb/dbx-core';
3
3
  import { type Maybe } from '@dereekb/util';
4
4
  import { DbxProgressButtonConfig } from './button.progress.config';
5
+ import { type ProgressSpinnerMode } from '@angular/material/progress-spinner';
5
6
  import * as i0 from "@angular/core";
6
7
  export declare abstract class AbstractProgressButtonDirective extends AbstractSubscriptionDirective implements OnDestroy {
7
8
  private readonly globalConfig;
8
9
  readonly btnClick: import("@angular/core").OutputEmitterRef<MouseEvent>;
9
10
  readonly config: import("@angular/core").InputSignal<Maybe<DbxProgressButtonConfig>>;
10
11
  readonly buttonId: import("@angular/core").InputSignal<Maybe<string>>;
11
- readonly working: import("@angular/core").InputSignal<Maybe<boolean>>;
12
+ readonly working: import("@angular/core").InputSignal<Maybe<import("@dereekb/dbx-core").DbxActionWorkOrWorkProgress>>;
12
13
  readonly disabled: import("@angular/core").InputSignal<Maybe<boolean>>;
13
14
  readonly globalOptionsSignal: Signal<Maybe<DbxProgressButtonConfig>>;
14
15
  readonly configSignal: Signal<Maybe<DbxProgressButtonConfig>>;
15
16
  readonly baseCssClassSignal: Signal<string[]>;
16
17
  readonly baseCssClasses$: import("rxjs").Observable<string[]>;
17
- readonly workingSignal: Signal<boolean>;
18
- readonly disabledSignal: Signal<boolean>;
18
+ readonly workingProgressSignal: Signal<DbxButtonWorking>;
19
+ readonly isWorkingSignal: Signal<boolean>;
20
+ readonly workingValueSignal: Signal<Maybe<DbxActionWorkProgress>>;
21
+ readonly modeSignal: Signal<ProgressSpinnerMode>;
22
+ readonly disabledSignal: Signal<Maybe<boolean>>;
19
23
  readonly buttonTypeAttributeSignal: Signal<Maybe<string>>;
20
- readonly buttonDisabledSignal: Signal<boolean>;
24
+ readonly buttonDisabledSignal: Signal<Maybe<boolean>>;
21
25
  readonly showProgressSignal: Signal<boolean>;
22
26
  handleClick(event: MouseEvent): void;
23
27
  static ɵfac: i0.ɵɵFactoryDeclaration<AbstractProgressButtonDirective, never>;
@@ -4,8 +4,9 @@ import { ProgressSpinnerMode } from '@angular/material/progress-spinner';
4
4
  import { type Maybe } from '@dereekb/util';
5
5
  import { DbxThemeColor } from '../../layout/style/style';
6
6
  import { DbxButtonType } from '../button.component';
7
+ import { DbxButtonWorking, DbxButtonWorkingProgress } from '@dereekb/dbx-core';
7
8
  export interface DbxProgressButtonConfig {
8
- readonly working?: Maybe<boolean>;
9
+ readonly working?: Maybe<DbxButtonWorking>;
9
10
  readonly text?: Maybe<string>;
10
11
  readonly spinnerText?: Maybe<string>;
11
12
  readonly buttonColor?: Maybe<ThemePalette | DbxThemeColor>;
@@ -18,7 +19,10 @@ export interface DbxProgressButtonConfig {
18
19
  readonly spinnerSize?: Maybe<number>;
19
20
  readonly spinnerRatio?: Maybe<number>;
20
21
  readonly mode?: Maybe<ProgressSpinnerMode>;
21
- readonly value?: Maybe<number>;
22
+ /**
23
+ * @deprecated use working instead
24
+ */
25
+ readonly value?: Maybe<DbxButtonWorkingProgress>;
22
26
  readonly fullWidth?: Maybe<boolean>;
23
27
  readonly disabled?: Maybe<boolean>;
24
28
  readonly customStyle?: Maybe<{
@@ -5,6 +5,7 @@
5
5
  @use './popup/popup';
6
6
  @use './prompt/prompt';
7
7
  @use './style/style';
8
+ @use './upload/upload';
8
9
 
9
10
  @mixin all-interaction-core() {
10
11
  @include dialog.core();
@@ -14,6 +15,7 @@
14
15
  @include popup.core();
15
16
  @include prompt.core();
16
17
  @include style.core();
18
+ @include upload.core();
17
19
  }
18
20
 
19
21
  @mixin all-interaction-typography($theme-config) {
@@ -24,6 +26,7 @@
24
26
  @include popup.typography($theme-config);
25
27
  @include prompt.typography($theme-config);
26
28
  @include style.typography($theme-config);
29
+ @include upload.typography($theme-config);
27
30
  }
28
31
 
29
32
  @mixin all-interaction-theme($theme-config) {
@@ -34,4 +37,5 @@
34
37
  @include popup.theme($theme-config);
35
38
  @include prompt.theme($theme-config);
36
39
  @include style.theme($theme-config);
40
+ @include upload.theme($theme-config);
37
41
  }
@@ -5,3 +5,4 @@ export * from './popover';
5
5
  export * from './popup';
6
6
  export * from './prompt';
7
7
  export * from './interaction.module';
8
+ export * from './upload';
@@ -0,0 +1,100 @@
1
+ @use 'sass:map';
2
+ @use 'sass:list';
3
+ @use 'sass:color';
4
+ @use '../../style/theming';
5
+
6
+ // Sections
7
+ @mixin core() {
8
+ .dbx-file-upload-area-content {
9
+ display: flex;
10
+ flex-direction: column;
11
+ align-items: center;
12
+ justify-content: center;
13
+ padding: 16px;
14
+ border: 2px;
15
+ border-style: dashed;
16
+ // border-radius: 8px;
17
+ }
18
+
19
+ .dbx-file-upload-area-content-text {
20
+ display: flex;
21
+ align-items: center;
22
+ }
23
+
24
+ .dbx-file-upload-area-rounded {
25
+ border-radius: 50%;
26
+ }
27
+
28
+ .dbx-file-upload-area-square {
29
+ border-radius: 12px;
30
+ }
31
+
32
+ .dbx-file-upload-area-with-hint .dbx-file-upload-area-content {
33
+ padding: 32px 16px;
34
+ }
35
+
36
+ .dbx-file-upload-area-content-hint {
37
+ position: relative;
38
+ top: -24px;
39
+ left: 0;
40
+ right: 0;
41
+ text-align: center;
42
+ user-select: none;
43
+ }
44
+ }
45
+
46
+ @mixin color($theme-config) {
47
+ $color-config: theming.m2-get-color-config($theme-config);
48
+
49
+ $primary: map.get($color-config, 'primary');
50
+ $background: map.get($color-config, 'background');
51
+ $foreground: map.get($color-config, 'foreground');
52
+ $cdk-background-color: theming.m2-get-color-from-palette($background, 'background');
53
+ $cdk-text-color: theming.m2-get-color-from-palette($foreground, 'text');
54
+
55
+ $cdk-border-color: color.adjust(
56
+ $color: $cdk-text-color,
57
+ $alpha: -0.5
58
+ );
59
+
60
+ $cdk-highlight-background-color: color.adjust(
61
+ $color: $cdk-text-color,
62
+ $alpha: -0.7
63
+ );
64
+
65
+ $primary-color: theming.m2-get-color-from-palette($primary, 500);
66
+
67
+ .dbx-file-upload-area-content {
68
+ border-color: $cdk-border-color;
69
+ }
70
+
71
+ .dbx-file-upload-area-drag-over .dbx-file-upload-area-content {
72
+ animation: dbx-file-upload-area-fade 200ms ease-in forwards;
73
+
74
+ @keyframes dbx-file-upload-area-fade {
75
+ to {
76
+ border-color: $primary-color;
77
+ background-color: $cdk-highlight-background-color;
78
+ }
79
+ }
80
+ }
81
+ }
82
+
83
+ @mixin typography($theme-config-or-typography-config) {
84
+ }
85
+
86
+ @mixin theme($theme-config) {
87
+ @include theming.private-check-duplicate-theme-styles($theme-config, 'dbx-interaction-upload') {
88
+ $color: theming.m2-get-color-config($theme-config);
89
+ $density: theming.m2-get-density-config($theme-config);
90
+ $typography: theming.m2-get-typography-config($theme-config);
91
+
92
+ @if $color !=null {
93
+ @include color($theme-config);
94
+ }
95
+
96
+ @if $typography !=null {
97
+ @include typography($theme-config);
98
+ }
99
+ }
100
+ }
@@ -0,0 +1,54 @@
1
+ import { Maybe } from '@dereekb/util';
2
+ import { FileArrayAcceptMatchConfig, FileArrayAcceptMatchResult } from './upload.accept';
3
+ import { DbxFileUploadActionCompatable } from './upload.action';
4
+ import { DbxButtonWorking } from '@dereekb/dbx-core';
5
+ import * as i0 from "@angular/core";
6
+ export interface DbxFileUploadFilesChangedEvent {
7
+ readonly allFiles: File[];
8
+ readonly matchResult: FileArrayAcceptMatchResult;
9
+ }
10
+ export declare abstract class AbstractDbxFileUploadComponent implements DbxFileUploadActionCompatable {
11
+ /**
12
+ * Whether or not multiple files can be uploaded.
13
+ */
14
+ readonly multiple: import("@angular/core").InputSignalWithTransform<Maybe<boolean>, Maybe<boolean | "">>;
15
+ /**
16
+ * Accepted file types filter.
17
+ */
18
+ readonly accept: import("@angular/core").InputSignal<string | import("./upload.accept").FileAcceptFilterTypeStringArray | import("./upload.accept").FileAcceptFunction>;
19
+ /**
20
+ * This disabled is input-only
21
+ */
22
+ readonly disabled: import("@angular/core").InputSignal<Maybe<boolean>>;
23
+ /**
24
+ * This working is input-only
25
+ */
26
+ readonly working: import("@angular/core").InputSignal<Maybe<import("@dereekb/dbx-core").DbxActionWorkOrWorkProgress>>;
27
+ /**
28
+ * This signal is set by setMultiple
29
+ */
30
+ private readonly _multipleSignal;
31
+ /**
32
+ * This signal is set by setAccept
33
+ */
34
+ private readonly _acceptSignal;
35
+ /**
36
+ * This signal is set by setDisabled
37
+ */
38
+ private readonly _disabledSignal;
39
+ /**
40
+ * This signal is set by setWorking
41
+ */
42
+ private readonly _workingSignal;
43
+ readonly multipleSignal: import("@angular/core").Signal<Maybe<boolean>>;
44
+ readonly acceptSignal: import("@angular/core").Signal<string | import("./upload.accept").FileAcceptFilterTypeStringArray | import("./upload.accept").FileAcceptFunction>;
45
+ readonly disabledSignal: import("@angular/core").Signal<boolean>;
46
+ readonly workingSignal: import("@angular/core").Signal<Maybe<import("@dereekb/dbx-core").DbxActionWorkOrWorkProgress>>;
47
+ readonly isWorkingSignal: import("@angular/core").Signal<boolean>;
48
+ setDisabled(disabled?: Maybe<boolean>): void;
49
+ setWorking(working?: Maybe<DbxButtonWorking>): void;
50
+ setMultiple(multiple?: Maybe<boolean>): void;
51
+ setAccept(accept?: Maybe<FileArrayAcceptMatchConfig['accept']>): void;
52
+ static ɵfac: i0.ɵɵFactoryDeclaration<AbstractDbxFileUploadComponent, never>;
53
+ static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractDbxFileUploadComponent, never, never, { "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "accept": { "alias": "accept"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "working": { "alias": "working"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
54
+ }
@@ -0,0 +1,7 @@
1
+ export * from './abstract.upload.component';
2
+ export * from './upload.accept';
3
+ export * from './upload.area.component';
4
+ export * from './upload.button.component';
5
+ export * from './upload.component';
6
+ export * from './upload.action';
7
+ export * from './upload.action.directive';
@@ -0,0 +1,87 @@
1
+ import { DecisionFunction, MimeTypeWithSubtypeWildcardWithoutParameters, MimeTypeWithoutParameters, SlashPathTypedFileSuffix, MimeTypeWildcard } from '@dereekb/util';
2
+ /**
3
+ * String used as input for the "accept" attribute of a file input element.
4
+ */
5
+ export type FileAcceptString = string;
6
+ /**
7
+ * Returns a string that can be used as the "accept" attribute of a file input element.
8
+ *
9
+ * @param accept
10
+ * @returns
11
+ */
12
+ export declare function fileAcceptString(accept: FileAcceptString | FileAcceptFilterTypeStringArray): FileAcceptString;
13
+ /**
14
+ * A string that describes a type of file that can be selected.
15
+ *
16
+ * Can either be a mime type or a file suffix.
17
+ */
18
+ export type FileAcceptFilterTypeString = MimeTypeWildcard | MimeTypeWithoutParameters | MimeTypeWithSubtypeWildcardWithoutParameters | SlashPathTypedFileSuffix;
19
+ /**
20
+ * An array of file accept filter type strings.
21
+ */
22
+ export type FileAcceptFilterTypeStringArray = FileAcceptFilterTypeString[];
23
+ export declare function fileAcceptFilterTypeStringArray(accept: FileAcceptString | FileAcceptFilterTypeStringArray): FileAcceptFilterTypeStringArray;
24
+ export interface FileArrayAcceptMatchConfig {
25
+ readonly accept: FileAcceptFunction | FileAcceptString | FileAcceptFilterTypeStringArray;
26
+ /**
27
+ * If false, then only the first file will be accepted.
28
+ *
29
+ * Defaults to true.
30
+ */
31
+ readonly multiple?: boolean;
32
+ }
33
+ export interface FileArrayAcceptMatchResult {
34
+ /**
35
+ * If multiple is allowed or not.
36
+ */
37
+ readonly multiple: boolean;
38
+ /**
39
+ * The input files.
40
+ */
41
+ readonly input: File[];
42
+ /**
43
+ * The final list of accepted files.
44
+ */
45
+ readonly accepted: File[];
46
+ /**
47
+ * The final list of rejected files.
48
+ */
49
+ readonly rejected: File[];
50
+ /**
51
+ * The list of accepted files based on the file type.
52
+ *
53
+ * If multiple is false, all files that would have been accepted are included here.
54
+ */
55
+ readonly acceptedType: File[];
56
+ /**
57
+ * The list of rejected files based on the file type.
58
+ *
59
+ * If multiple is false, only files that would have been rejected by type are included here.
60
+ */
61
+ readonly rejectedType: File[];
62
+ }
63
+ /**
64
+ * A function that matches an array of files based on the internal configuration.
65
+ */
66
+ export type FileArrayAcceptMatchFunction = (input: File[]) => FileArrayAcceptMatchResult;
67
+ /**
68
+ * Creates a FileArrayAcceptMatchFunction from the input.
69
+ */
70
+ export declare function fileArrayAcceptMatchFunction(config: FileArrayAcceptMatchConfig): FileArrayAcceptMatchFunction;
71
+ /**
72
+ * Type of input used for a FileAcceptFunction.
73
+ *
74
+ * Isolates the name and type fields from a File.
75
+ */
76
+ export type FileAcceptFunctionInput = Pick<File, 'name' | 'type'>;
77
+ /**
78
+ * Used to determine if a file is an accepted type based on the internal configuration.
79
+ */
80
+ export type FileAcceptFunction = DecisionFunction<FileAcceptFunctionInput>;
81
+ /**
82
+ * Creates a FileAcceptFunction from the input.
83
+ *
84
+ * @param accept
85
+ * @returns
86
+ */
87
+ export declare function fileAcceptFunction(accept: FileAcceptString | FileAcceptFilterTypeStringArray): FileAcceptFunction;
@@ -0,0 +1,17 @@
1
+ import { Type, Provider } from '@angular/core';
2
+ import { Maybe } from '@dereekb/util';
3
+ import { FileArrayAcceptMatchConfig } from './upload.accept';
4
+ import { DbxButtonWorking } from '@dereekb/dbx-core';
5
+ /**
6
+ * Compatable interface for DbxUploadActionDirective.
7
+ */
8
+ export declare abstract class DbxFileUploadActionCompatable {
9
+ abstract setDisabled(disabled?: Maybe<boolean>): void;
10
+ abstract setWorking(working?: Maybe<DbxButtonWorking>): void;
11
+ abstract setMultiple(multiple?: Maybe<boolean>): void;
12
+ abstract setAccept(accept?: Maybe<FileArrayAcceptMatchConfig['accept']>): void;
13
+ }
14
+ /**
15
+ * Provides a DbxUploadActionCompatable for a given type.
16
+ */
17
+ export declare function provideDbxFileUploadActionCompatable<S extends DbxFileUploadActionCompatable>(sourceType: Type<S>): Provider[];
@@ -0,0 +1,17 @@
1
+ import { OnInit, OnDestroy } from '@angular/core';
2
+ import { DbxActionContextStoreSourceInstance } from '@dereekb/dbx-core';
3
+ import { DbxFileUploadActionCompatable } from './upload.action';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * Context used for linking a button to an ActionContext.
7
+ */
8
+ export declare class DbxFileUploadActionSyncDirective implements OnInit, OnDestroy {
9
+ readonly source: DbxActionContextStoreSourceInstance<any, any>;
10
+ readonly uploadCompatable: DbxFileUploadActionCompatable;
11
+ private readonly _workingSub;
12
+ private readonly _disabledSub;
13
+ ngOnInit(): void;
14
+ ngOnDestroy(): void;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<DbxFileUploadActionSyncDirective, never>;
16
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DbxFileUploadActionSyncDirective, "[dbxFileUploadActionSync]", never, {}, {}, never, never, true, never>;
17
+ }
@@ -0,0 +1,22 @@
1
+ import { Maybe } from '@dereekb/util';
2
+ import { AbstractDbxFileUploadComponent, DbxFileUploadFilesChangedEvent } from './abstract.upload.component';
3
+ import * as i0 from "@angular/core";
4
+ export type DbxFileUploadAreaFilesChangedEvent = DbxFileUploadFilesChangedEvent;
5
+ export declare class DbxFileUploadAreaComponent extends AbstractDbxFileUploadComponent {
6
+ readonly icon: import("@angular/core").InputSignal<Maybe<string>>;
7
+ readonly text: import("@angular/core").InputSignal<Maybe<string>>;
8
+ readonly hint: import("@angular/core").InputSignal<Maybe<string | boolean>>;
9
+ readonly show: import("@angular/core").InputSignal<boolean>;
10
+ readonly hintSignal: import("@angular/core").Signal<string | null>;
11
+ readonly filesChanged: import("@angular/core").OutputEmitterRef<DbxFileUploadFilesChangedEvent>;
12
+ readonly areaClicked: import("@angular/core").OutputEmitterRef<void>;
13
+ readonly areaDragActiveChanged: import("@angular/core").OutputEmitterRef<boolean>;
14
+ readonly dragOverStateSignal: import("@angular/core").WritableSignal<boolean>;
15
+ readonly filesAcceptedFunctionSignal: import("@angular/core").Signal<import("./upload.accept").FileArrayAcceptMatchFunction>;
16
+ onClick(evt: MouseEvent): void;
17
+ onDragOver(evt: DragEvent): void;
18
+ onDragLeave(evt: DragEvent): void;
19
+ onDrop(evt: DragEvent): void;
20
+ static ɵfac: i0.ɵɵFactoryDeclaration<DbxFileUploadAreaComponent, never>;
21
+ static ɵcmp: i0.ɵɵComponentDeclaration<DbxFileUploadAreaComponent, "dbx-file-upload-area", never, { "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "text": { "alias": "text"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "show": { "alias": "show"; "required": false; "isSignal": true; }; }, { "filesChanged": "filesChanged"; "areaClicked": "areaClicked"; "areaDragActiveChanged": "areaDragActiveChanged"; }, never, ["*"], true, never>;
22
+ }
@@ -0,0 +1,24 @@
1
+ import { ElementRef } from '@angular/core';
2
+ import { DbxButtonStyle } from '../../button/button.component';
3
+ import { Maybe } from '@dereekb/util';
4
+ import { AbstractDbxFileUploadComponent, DbxFileUploadFilesChangedEvent } from './abstract.upload.component';
5
+ import * as i0 from "@angular/core";
6
+ export type DbxFileUploadButtonFilesChangedEvent = DbxFileUploadFilesChangedEvent;
7
+ export declare class DbxFileUploadButtonComponent extends AbstractDbxFileUploadComponent {
8
+ readonly fileInput: import("@angular/core").Signal<ElementRef<HTMLInputElement>>;
9
+ readonly text: import("@angular/core").InputSignal<Maybe<string>>;
10
+ readonly icon: import("@angular/core").InputSignal<Maybe<string>>;
11
+ readonly buttonStyle: import("@angular/core").InputSignal<Maybe<DbxButtonStyle>>;
12
+ readonly filesChanged: import("@angular/core").OutputEmitterRef<DbxFileUploadFilesChangedEvent>;
13
+ readonly buttonAcceptSignal: import("@angular/core").Signal<string | undefined>;
14
+ readonly buttonMultipleSignal: import("@angular/core").Signal<boolean>;
15
+ readonly filesAcceptedFunctionSignal: import("@angular/core").Signal<import("./upload.accept").FileArrayAcceptMatchFunction | undefined>;
16
+ /**
17
+ * The HTML attribute should not be added if it is false, so we return null.
18
+ */
19
+ readonly multipleAttributeSignal: import("@angular/core").Signal<"" | null>;
20
+ openInput(): void;
21
+ fileInputChanged(): void;
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<DbxFileUploadButtonComponent, never>;
23
+ static ɵcmp: i0.ɵɵComponentDeclaration<DbxFileUploadButtonComponent, "dbx-file-upload-button", never, { "text": { "alias": "text"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "buttonStyle": { "alias": "buttonStyle"; "required": false; "isSignal": true; }; }, { "filesChanged": "filesChanged"; }, never, ["*"], true, never>;
24
+ }
@@ -0,0 +1,58 @@
1
+ import { FileArrayAcceptMatchConfig } from './upload.accept';
2
+ import { DbxButtonStyle } from '../../button/button.component';
3
+ import { Maybe } from '@dereekb/util';
4
+ import { DbxFileUploadButtonComponent, DbxFileUploadButtonFilesChangedEvent } from './upload.button.component';
5
+ import { DbxFileUploadAreaComponent, DbxFileUploadAreaFilesChangedEvent } from './upload.area.component';
6
+ import { AbstractDbxFileUploadComponent, DbxFileUploadFilesChangedEvent } from './abstract.upload.component';
7
+ import * as i0 from "@angular/core";
8
+ export type DbxFileUploadMode = 'area' | 'button' | 'default';
9
+ export interface DbxFileUploadComponentConfig {
10
+ readonly mode?: DbxFileUploadMode;
11
+ readonly accept?: Maybe<FileArrayAcceptMatchConfig['accept']>;
12
+ readonly multiple?: Maybe<boolean>;
13
+ /**
14
+ * If true, the area will be clickable to open the file picker.
15
+ */
16
+ readonly clickAreaToUpload?: Maybe<boolean>;
17
+ readonly area?: Maybe<{
18
+ readonly icon?: Maybe<string>;
19
+ readonly text?: Maybe<string>;
20
+ readonly hint?: Maybe<string | boolean>;
21
+ }>;
22
+ readonly button?: Maybe<{
23
+ readonly icon?: Maybe<string>;
24
+ readonly text?: Maybe<string>;
25
+ readonly style?: DbxButtonStyle;
26
+ }>;
27
+ }
28
+ /**
29
+ * Combines both the file upload area and button into a single component.
30
+ */
31
+ export declare class DbxFileUploadComponent extends AbstractDbxFileUploadComponent {
32
+ readonly config: import("@angular/core").InputSignal<Maybe<DbxFileUploadComponentConfig>>;
33
+ readonly area: import("@angular/core").Signal<DbxFileUploadAreaComponent>;
34
+ readonly button: import("@angular/core").Signal<DbxFileUploadButtonComponent>;
35
+ readonly buttonStyle: import("@angular/core").InputSignal<Maybe<DbxButtonStyle>>;
36
+ readonly mode: import("@angular/core").InputSignal<Maybe<DbxFileUploadMode>>;
37
+ readonly text: import("@angular/core").InputSignal<Maybe<string>>;
38
+ readonly icon: import("@angular/core").InputSignal<Maybe<string>>;
39
+ readonly hint: import("@angular/core").InputSignal<Maybe<string | boolean>>;
40
+ readonly modeSignal: import("@angular/core").Signal<"button" | "area" | "default">;
41
+ readonly showButtonSignal: import("@angular/core").Signal<boolean>;
42
+ readonly showAreaSignal: import("@angular/core").Signal<boolean>;
43
+ readonly clickAreaToUpload: import("@angular/core").InputSignal<Maybe<boolean>>;
44
+ readonly clickAreaToUploadSignal: import("@angular/core").Signal<Maybe<boolean>>;
45
+ readonly buttonTextSignal: import("@angular/core").Signal<Maybe<string>>;
46
+ readonly buttonIconSignal: import("@angular/core").Signal<Maybe<string>>;
47
+ readonly areaTextSignal: import("@angular/core").Signal<Maybe<string>>;
48
+ readonly areaIconSignal: import("@angular/core").Signal<Maybe<string>>;
49
+ readonly areaHintSignal: import("@angular/core").Signal<Maybe<string | boolean>>;
50
+ readonly uploadMultipleSignal: import("@angular/core").Signal<Maybe<boolean>>;
51
+ readonly uploadAcceptSignal: import("@angular/core").Signal<string | import("./upload.accept").FileAcceptFilterTypeStringArray | import("./upload.accept").FileAcceptFunction>;
52
+ readonly filesChanged: import("@angular/core").OutputEmitterRef<DbxFileUploadFilesChangedEvent>;
53
+ areaClicked(): void;
54
+ areaFilesChanged(event: DbxFileUploadAreaFilesChangedEvent): void;
55
+ buttonFilesChanged(event: DbxFileUploadButtonFilesChangedEvent): void;
56
+ static ɵfac: i0.ɵɵFactoryDeclaration<DbxFileUploadComponent, never>;
57
+ static ɵcmp: i0.ɵɵComponentDeclaration<DbxFileUploadComponent, "dbx-file-upload", never, { "config": { "alias": "config"; "required": false; "isSignal": true; }; "buttonStyle": { "alias": "buttonStyle"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "text": { "alias": "text"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "clickAreaToUpload": { "alias": "clickAreaToUpload"; "required": false; "isSignal": true; }; }, { "filesChanged": "filesChanged"; }, never, ["*"], true, never>;
58
+ }
@@ -1,3 +1,4 @@
1
+ @use './avatar/avatar';
1
2
  @use './bar/bar';
2
3
  @use './block/block';
3
4
  @use './card/card';
@@ -13,6 +14,7 @@
13
14
  @use './text/text';
14
15
 
15
16
  @mixin all-layout-core() {
17
+ @include avatar.core();
16
18
  @include bar.core();
17
19
  @include block.core();
18
20
  @include card.core();
@@ -29,6 +31,7 @@
29
31
  }
30
32
 
31
33
  @mixin all-layout-typography($theme-config) {
34
+ @include avatar.typography($theme-config);
32
35
  @include bar.typography($theme-config);
33
36
  @include block.typography($theme-config);
34
37
  @include card.typography($theme-config);
@@ -45,6 +48,7 @@
45
48
  }
46
49
 
47
50
  @mixin all-layout-theme($theme-config) {
51
+ @include avatar.theme($theme-config);
48
52
  @include bar.theme($theme-config);
49
53
  @include block.theme($theme-config);
50
54
  @include card.theme($theme-config);