@dereekb/dbx-web 12.6.1 → 12.6.4
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/extension/preview/index.mjs +2 -1
- package/esm2022/lib/extension/preview/webfilepreview.component.mjs +35 -0
- package/esm2022/lib/extension/preview/webfilepreview.mjs +1 -1
- package/esm2022/lib/extension/preview/webfilepreview.service.mjs +75 -16
- package/esm2022/lib/extension/preview/webfilepreview.service.preset.mjs +12 -22
- package/esm2022/lib/extension/zip/zip.blob.preview.component.mjs +3 -3
- package/esm2022/lib/extension/zip/zip.preview.component.mjs +6 -6
- package/esm2022/lib/extension/zip/zip.preview.dialog.component.mjs +29 -42
- package/esm2022/lib/interaction/dialog/dialog.content.close.component.mjs +1 -1
- package/esm2022/lib/interaction/dialog/dialog.content.directive.mjs +2 -2
- package/esm2022/lib/interaction/dialog/dialog.injection.component.mjs +53 -0
- package/esm2022/lib/interaction/dialog/index.mjs +2 -1
- package/esm2022/lib/interaction/iframe/embed.component.mjs +40 -20
- package/esm2022/lib/interaction/iframe/embed.dialog.component.mjs +32 -41
- package/esm2022/lib/interaction/iframe/iframe.component.mjs +4 -4
- package/esm2022/lib/interaction/iframe/iframe.dialog.component.mjs +21 -35
- package/fesm2022/dereekb-dbx-web.mjs +326 -208
- package/fesm2022/dereekb-dbx-web.mjs.map +1 -1
- package/lib/extension/preview/index.d.ts +1 -0
- package/lib/extension/preview/webfilepreview.component.d.ts +19 -0
- package/lib/extension/preview/webfilepreview.d.ts +85 -4
- package/lib/extension/preview/webfilepreview.service.d.ts +14 -9
- package/lib/extension/preview/webfilepreview.service.preset.d.ts +2 -9
- package/lib/extension/zip/zip.preview.component.d.ts +4 -4
- package/lib/extension/zip/zip.preview.dialog.component.d.ts +12 -12
- package/lib/interaction/dialog/_dialog.scss +10 -1
- package/lib/interaction/dialog/dialog.content.directive.d.ts +2 -1
- package/lib/interaction/dialog/dialog.injection.component.d.ts +19 -0
- package/lib/interaction/dialog/index.d.ts +1 -0
- package/lib/interaction/iframe/_iframe.scss +2 -8
- package/lib/interaction/iframe/embed.component.d.ts +16 -7
- package/lib/interaction/iframe/embed.dialog.component.d.ts +14 -13
- package/lib/interaction/iframe/iframe.component.d.ts +2 -2
- package/lib/interaction/iframe/iframe.dialog.component.d.ts +12 -10
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DbxInjectionComponentConfig } from '@dereekb/dbx-core';
|
|
2
|
+
import { DbxWebFilePreviewService } from './webfilepreview.service';
|
|
3
|
+
import { Maybe } from '@dereekb/util';
|
|
4
|
+
import { DbxWebFilePreviewServicePreviewComponentFunctionInput } from './webfilepreview';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* Config for DbxWebFilePreviewComponent.
|
|
8
|
+
*/
|
|
9
|
+
export type DbxWebFilePreviewComponentConfig = DbxWebFilePreviewServicePreviewComponentFunctionInput;
|
|
10
|
+
/**
|
|
11
|
+
* Component used to preview a file using the DbxWebFilePreviewService's createPreviewConfig function for the given input.
|
|
12
|
+
*/
|
|
13
|
+
export declare class DbxWebFilePreviewComponent {
|
|
14
|
+
readonly webFilePreviewService: DbxWebFilePreviewService;
|
|
15
|
+
readonly config: import("@angular/core").InputSignal<Maybe<DbxWebFilePreviewServicePreviewComponentFunctionInput>>;
|
|
16
|
+
readonly componentConfigSignal: import("@angular/core").Signal<Maybe<DbxInjectionComponentConfig<any>>>;
|
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxWebFilePreviewComponent, never>;
|
|
18
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxWebFilePreviewComponent, "dbx-web-file-preview", never, { "config": { "alias": "config"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
19
|
+
}
|
|
@@ -1,13 +1,94 @@
|
|
|
1
|
-
import { type MatDialog, type MatDialogRef } from '@angular/material/dialog';
|
|
1
|
+
import { type MatDialogConfig, type MatDialog, type MatDialogRef } from '@angular/material/dialog';
|
|
2
|
+
import { type DbxInjectionComponentConfig } from '@dereekb/dbx-core';
|
|
2
3
|
import { type WebsiteUrlWithPrefix, type Maybe, type ContentTypeMimeType, type ArrayOrValue, type MimeTypeWithoutParameters } from '@dereekb/util';
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
+
* Configuration for a DbxWebFilePreviewServicePreviewComponentFunction.
|
|
6
|
+
*/
|
|
7
|
+
export interface DbxWebFilePreviewServicePreviewComponentFunctionInput {
|
|
8
|
+
/**
|
|
9
|
+
* The srcUrl to preview, if applicable.
|
|
10
|
+
*
|
|
11
|
+
* Either the srcUrl or the blob must be provided.
|
|
12
|
+
*/
|
|
13
|
+
readonly srcUrl?: Maybe<WebsiteUrlWithPrefix>;
|
|
14
|
+
/**
|
|
15
|
+
* Whether or not to sanitize the srcUrl. Ignored if srcUrl is not provided.
|
|
16
|
+
*
|
|
17
|
+
* Defaults to true.
|
|
18
|
+
*/
|
|
19
|
+
readonly sanitizeSrcUrl?: Maybe<boolean>;
|
|
20
|
+
/**
|
|
21
|
+
* The blob to preview, if applicable. The embedMimeType should also be provided.
|
|
22
|
+
*
|
|
23
|
+
* Either the srcUrl or the blob must be provided.
|
|
24
|
+
*/
|
|
25
|
+
readonly blob?: Maybe<Blob>;
|
|
26
|
+
/**
|
|
27
|
+
* The mimetype to instruct the browser to use for the preview.
|
|
28
|
+
*
|
|
29
|
+
* Should typically be provided, otherwise the browser will guess how to handle the data.
|
|
30
|
+
*/
|
|
31
|
+
readonly embedMimeType?: Maybe<ContentTypeMimeType | string>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Used for generating a preview component for the given src url and embedMimeType.
|
|
35
|
+
*/
|
|
36
|
+
export type DbxWebFilePreviewServicePreviewComponentFunction = (input: DbxWebFilePreviewServicePreviewComponentFunctionInput) => DbxInjectionComponentConfig<any>;
|
|
37
|
+
/**
|
|
38
|
+
* Configuration for a DbxWebFilePreviewServicePreviewDialogFunction.
|
|
39
|
+
*/
|
|
40
|
+
export interface DbxWebFilePreviewServicePreviewDialogFunctionInput extends DbxWebFilePreviewServicePreviewComponentFunctionInput {
|
|
41
|
+
/**
|
|
42
|
+
* Arbitrary MatDialogConfig to use for configuring the dialog.
|
|
43
|
+
*/
|
|
44
|
+
readonly dialogConfig?: Maybe<Omit<MatDialogConfig, 'data'>>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Configuration for a DbxWebFilePreviewServicePreviewDialogFunction.
|
|
48
|
+
*/
|
|
49
|
+
export interface DbxWebFilePreviewServicePreviewDialogFunctionInputWithMatDialog extends DbxWebFilePreviewServicePreviewDialogFunctionInput {
|
|
50
|
+
/**
|
|
51
|
+
* MatDialog instance to use for opening the dialog.
|
|
52
|
+
*/
|
|
53
|
+
readonly matDialog: MatDialog;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Used for previewing a src url and embedMimeType in a dialog.
|
|
57
|
+
*/
|
|
58
|
+
export type DbxWebFilePreviewServicePreviewDialogFunction = (input: DbxWebFilePreviewServicePreviewDialogFunctionInputWithMatDialog) => MatDialogRef<any, any>;
|
|
59
|
+
/**
|
|
60
|
+
* Configuration for a preview entry.
|
|
5
61
|
*/
|
|
6
|
-
export type DbxWebFilePreviewServicePreviewFunction = (matDialog: MatDialog, srcUrl: WebsiteUrlWithPrefix, embedMimeType?: Maybe<ContentTypeMimeType | string>) => MatDialogRef<any, any>;
|
|
7
62
|
export interface DbxWebFilePreviewServiceEntry {
|
|
8
63
|
/**
|
|
9
64
|
* The MimeType(s) to associate the preview function with.
|
|
10
65
|
*/
|
|
11
66
|
readonly mimeType: ArrayOrValue<MimeTypeWithoutParameters | string>;
|
|
12
|
-
|
|
67
|
+
/**
|
|
68
|
+
* The preview component function to use.
|
|
69
|
+
*/
|
|
70
|
+
readonly previewComponentFunction: DbxWebFilePreviewServicePreviewComponentFunction;
|
|
71
|
+
/**
|
|
72
|
+
* The preview dialog function to use.
|
|
73
|
+
*
|
|
74
|
+
* If one is not provided, a default dialog will be used that opens the preview component in a dialog.
|
|
75
|
+
*/
|
|
76
|
+
readonly previewDialogFunction?: DbxWebFilePreviewServicePreviewDialogFunction;
|
|
13
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Configuration for a DbxWebFilePreviewServicePreviewDialogWithComponentFunction.
|
|
80
|
+
*/
|
|
81
|
+
export interface DbxWebFilePreviewServicePreviewDialogWithComponentFunctionInput extends Omit<DbxWebFilePreviewServicePreviewDialogFunctionInputWithMatDialog, 'dialogConfig'> {
|
|
82
|
+
/**
|
|
83
|
+
* The component configuration for the component to display in the dialog.
|
|
84
|
+
*/
|
|
85
|
+
readonly componentConfig: DbxInjectionComponentConfig<any>;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Used for previewing a src url and embedMimeType in a dialog.
|
|
89
|
+
*/
|
|
90
|
+
export type DbxWebFilePreviewServicePreviewDialogWithComponentFunction = (input: DbxWebFilePreviewServicePreviewDialogWithComponentFunctionInput) => MatDialogRef<any, any>;
|
|
91
|
+
/**
|
|
92
|
+
* @deprecated use DbxWebFilePreviewServicePreviewDialogFunction instead.
|
|
93
|
+
*/
|
|
94
|
+
export type DbxWebFilePreviewServicePreviewFunction = DbxWebFilePreviewServicePreviewDialogFunction;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InjectionToken } from '@angular/core';
|
|
2
2
|
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
|
|
3
|
-
import {
|
|
4
|
-
import { DbxWebFilePreviewServiceEntry,
|
|
3
|
+
import { ArrayOrValue } from '@dereekb/util';
|
|
4
|
+
import { DbxWebFilePreviewServiceEntry, DbxWebFilePreviewServicePreviewComponentFunction, DbxWebFilePreviewServicePreviewComponentFunctionInput, DbxWebFilePreviewServicePreviewDialogFunctionInput, DbxWebFilePreviewServicePreviewDialogWithComponentFunction } from './webfilepreview';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
/**
|
|
7
7
|
* Default entries to inject.
|
|
@@ -11,6 +11,11 @@ export declare function provideDbxWebFilePreviewServiceEntries(entries: DbxWebFi
|
|
|
11
11
|
provide: InjectionToken<DbxWebFilePreviewServiceEntry[]>;
|
|
12
12
|
useValue: DbxWebFilePreviewServiceEntry[];
|
|
13
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Default preset for previewing a file using a DbxEmbedDialogComponent.
|
|
16
|
+
*/
|
|
17
|
+
export declare const DBX_WEB_FILE_PREVIEW_SERVICE_DEFAULT_PREVIEW_COMPONENT_FUNCTION: DbxWebFilePreviewServicePreviewComponentFunction;
|
|
18
|
+
export declare const DBX_WEB_FILE_PREVIEW_SERVICE_DEFAULT_DIALOG_WITH_COMPONENT_FUNCTION: DbxWebFilePreviewServicePreviewDialogWithComponentFunction;
|
|
14
19
|
/**
|
|
15
20
|
* Service used for previewing files with given mime types.
|
|
16
21
|
*/
|
|
@@ -18,14 +23,14 @@ export declare class DbxWebFilePreviewService {
|
|
|
18
23
|
readonly matDialog: MatDialog;
|
|
19
24
|
private readonly _entries;
|
|
20
25
|
constructor(entries: DbxWebFilePreviewServiceEntry[]);
|
|
21
|
-
private
|
|
26
|
+
private _defaultPreviewComponentFunction;
|
|
27
|
+
private _defaultPreviewDialogWithComponentFunction;
|
|
22
28
|
registerPreviewEntries(entries: ArrayOrValue<DbxWebFilePreviewServiceEntry>): void;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
openPreviewDialog(srcUrl: WebsiteUrlWithPrefix, embedMimeType?: Maybe<ContentTypeMimeType | string>): MatDialogRef<any, any>;
|
|
29
|
+
registerPreviewEntry(entry: DbxWebFilePreviewServiceEntry): void;
|
|
30
|
+
setDefaultPreviewComponentFunction(previewFunction: DbxWebFilePreviewServicePreviewComponentFunction): void;
|
|
31
|
+
setDefaultPreviewDialogWithComponentFunction(previewDialogWithComponentFunction: DbxWebFilePreviewServicePreviewDialogWithComponentFunction): void;
|
|
32
|
+
createPreviewConfig(input: DbxWebFilePreviewServicePreviewComponentFunctionInput): import("@dereekb/dbx-core").DbxInjectionComponentConfig<any>;
|
|
33
|
+
openPreviewDialog(input: DbxWebFilePreviewServicePreviewDialogFunctionInput): MatDialogRef<any, any>;
|
|
29
34
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxWebFilePreviewService, [{ optional: true; }]>;
|
|
30
35
|
static ɵprov: i0.ɵɵInjectableDeclaration<DbxWebFilePreviewService>;
|
|
31
36
|
}
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
3
|
-
* Default preset for previewing a file using a DbxEmbedDialogComponent.
|
|
4
|
-
*/
|
|
5
|
-
export declare const DBX_WEB_FILE_PREVIEW_SERVICE_DEFAULT_PRESET: DbxWebFilePreviewServicePreviewFunction;
|
|
6
|
-
/**
|
|
7
|
-
* Preset for previewing a zip file using a DbxZipPreviewDialogComponent.
|
|
8
|
-
*/
|
|
9
|
-
export declare const DBX_WEB_FILE_PREVIEW_SERVICE_ZIP_PRESET: DbxWebFilePreviewServicePreviewFunction;
|
|
1
|
+
import { type DbxWebFilePreviewServicePreviewComponentFunction, type DbxWebFilePreviewServiceEntry } from './webfilepreview';
|
|
2
|
+
export declare const DBX_WEB_FILE_PREVIEW_SERVICE_ZIP_COMPONENT_PRESET: DbxWebFilePreviewServicePreviewComponentFunction;
|
|
10
3
|
/**
|
|
11
4
|
* DbxWebFilePreviewServiceEntry for previewing a zip file using a DbxZipPreviewDialogComponent.
|
|
12
5
|
*/
|
|
@@ -10,15 +10,15 @@ export declare class DbxZipPreviewComponent implements OnDestroy {
|
|
|
10
10
|
/**
|
|
11
11
|
* The URL to download the zip file from, if applicable.
|
|
12
12
|
*/
|
|
13
|
-
readonly srcUrl: import("@angular/core").
|
|
13
|
+
readonly srcUrl: import("@angular/core").ModelSignal<Maybe<string>>;
|
|
14
14
|
/**
|
|
15
15
|
* The blob to use for the zip file, if applicable.
|
|
16
16
|
*/
|
|
17
|
-
readonly blob: import("@angular/core").
|
|
17
|
+
readonly blob: import("@angular/core").ModelSignal<Maybe<Blob>>;
|
|
18
18
|
/**
|
|
19
19
|
* The file name to use for the zip file.
|
|
20
20
|
*/
|
|
21
|
-
readonly downloadFileName: import("@angular/core").
|
|
21
|
+
readonly downloadFileName: import("@angular/core").ModelSignal<Maybe<string>>;
|
|
22
22
|
readonly srcUrl$: Observable<Maybe<string>>;
|
|
23
23
|
readonly blob$: Observable<Maybe<Blob>>;
|
|
24
24
|
readonly zipFileBlobLoadingState$: Observable<LoadingState<Blob>>;
|
|
@@ -27,5 +27,5 @@ export declare class DbxZipPreviewComponent implements OnDestroy {
|
|
|
27
27
|
readonly context: import("@dereekb/rxjs").MutableLoadingStateContext<unknown, LoadingState<Blob>, import("@dereekb/rxjs").LoadingContextEvent & LoadingState<Blob>>;
|
|
28
28
|
ngOnDestroy(): void;
|
|
29
29
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxZipPreviewComponent, never>;
|
|
30
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DbxZipPreviewComponent, "dbx-zip-preview", never, { "srcUrl": { "alias": "srcUrl"; "required": false; "isSignal": true; }; "blob": { "alias": "blob"; "required": false; "isSignal": true; }; "downloadFileName": { "alias": "downloadFileName"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
30
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxZipPreviewComponent, "dbx-zip-preview", never, { "srcUrl": { "alias": "srcUrl"; "required": false; "isSignal": true; }; "blob": { "alias": "blob"; "required": false; "isSignal": true; }; "downloadFileName": { "alias": "downloadFileName"; "required": false; "isSignal": true; }; }, { "srcUrl": "srcUrlChange"; "blob": "blobChange"; "downloadFileName": "downloadFileNameChange"; }, never, never, true, never>;
|
|
31
31
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { MatDialog, MatDialogRef, MatDialogConfig } from '@angular/material/dialog';
|
|
2
|
-
import { WebsiteUrlWithPrefix, Maybe } from '@dereekb/util';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
import { type MatDialog, type MatDialogRef, type MatDialogConfig } from '@angular/material/dialog';
|
|
2
|
+
import { type WebsiteUrlWithPrefix, type Maybe } from '@dereekb/util';
|
|
3
|
+
import { DbxInjectionDialogComponent } from '../../interaction/dialog';
|
|
4
|
+
import { DbxZipPreviewComponent } from './zip.preview.component';
|
|
5
5
|
export interface DbxZipPreviewDialogConfig extends Omit<MatDialogConfig, 'data'> {
|
|
6
6
|
readonly srcUrl?: Maybe<WebsiteUrlWithPrefix>;
|
|
7
7
|
readonly blob?: Maybe<Blob>;
|
|
8
8
|
readonly downloadFileName?: Maybe<string>;
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Opens a dialog with DbxZipPreviewComponent.
|
|
12
|
+
*
|
|
13
|
+
* @param matDialog The MatDialog instance to use.
|
|
14
|
+
* @param config The configuration for the dialog.
|
|
15
|
+
* @returns The MatDialogRef for the dialog.
|
|
16
|
+
*/
|
|
17
|
+
export declare function openZipPreviewDialog(matDialog: MatDialog, config: DbxZipPreviewDialogConfig): MatDialogRef<DbxInjectionDialogComponent<DbxZipPreviewComponent>, void>;
|
|
@@ -5,6 +5,7 @@ $max-dialog-width: 90vw;
|
|
|
5
5
|
$mat-dialog-close-icon-size: 48px;
|
|
6
6
|
$mat-dialog-close-icon-half-size: $mat-dialog-close-icon-size / 2;
|
|
7
7
|
$mat-dialog-container-padding: 18px;
|
|
8
|
+
$mat-dialog-container-close-button-padding: $mat-dialog-container-padding;
|
|
8
9
|
$dbx-dialog-content-close-edge-padding: 4px;
|
|
9
10
|
$dbx-dialog-content-close-top-offset: $dbx-dialog-content-close-edge-padding;
|
|
10
11
|
$dbx-dialog-content-close-right-offset: $dbx-dialog-content-close-edge-padding;
|
|
@@ -69,7 +70,7 @@ $dbx-dialog-content-close-right-offset: $dbx-dialog-content-close-edge-padding;
|
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
.dbx-dialog-content-close.dbx-dialog-content-close-padding {
|
|
72
|
-
padding-bottom: $mat-dialog-container-padding;
|
|
73
|
+
padding-bottom: $mat-dialog-container-close-button-padding;
|
|
73
74
|
|
|
74
75
|
> .dbx-dialog-content-close-button {
|
|
75
76
|
top: $dbx-dialog-content-close-edge-padding;
|
|
@@ -82,6 +83,14 @@ $dbx-dialog-content-close-right-offset: $dbx-dialog-content-close-edge-padding;
|
|
|
82
83
|
align-items: center;
|
|
83
84
|
justify-content: center;
|
|
84
85
|
}
|
|
86
|
+
|
|
87
|
+
.dbx-dialog-content-100.dbx-dialog-content {
|
|
88
|
+
height: 100%;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.dbx-dialog-content-100.dbx-dialog-content-100-padded-closed.dbx-dialog-content {
|
|
92
|
+
height: calc(100% - #{$mat-dialog-container-close-button-padding + ($mat-dialog-container-padding * 2)});
|
|
93
|
+
}
|
|
85
94
|
}
|
|
86
95
|
|
|
87
96
|
@mixin color($theme-config) {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { Maybe } from '@dereekb/util';
|
|
1
2
|
import * as i0 from "@angular/core";
|
|
2
3
|
export type DbxDialogContentContainerWidth = 'normal' | 'wide';
|
|
3
4
|
/**
|
|
4
5
|
* Component used to style a dialog.
|
|
5
6
|
*/
|
|
6
7
|
export declare class DbxDialogContentDirective {
|
|
7
|
-
readonly width: import("@angular/core").
|
|
8
|
+
readonly width: import("@angular/core").InputSignalWithTransform<DbxDialogContentContainerWidth, Maybe<DbxDialogContentContainerWidth>>;
|
|
8
9
|
readonly classConfig: import("@angular/core").Signal<string>;
|
|
9
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxDialogContentDirective, never>;
|
|
10
11
|
static ɵdir: i0.ɵɵDirectiveDeclaration<DbxDialogContentDirective, "dbx-dialog-content,[dbxDialogContent],.dbx-dialog-content", never, { "width": { "alias": "width"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { MatDialog, MatDialogRef, MatDialogConfig } from '@angular/material/dialog';
|
|
2
|
+
import { DbxInjectionComponentConfig } from '@dereekb/dbx-core';
|
|
3
|
+
import { AbstractDialogDirective } from './abstract.dialog.directive';
|
|
4
|
+
import { DbxDialogContentContainerWidth } from './dialog.content.directive';
|
|
5
|
+
import { Maybe } from '@dereekb/util';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export interface DbxInjectionDialogComponentConfig<T = unknown> extends Omit<MatDialogConfig, 'data'> {
|
|
8
|
+
readonly contentWidth?: Maybe<DbxDialogContentContainerWidth>;
|
|
9
|
+
readonly showCloseButton?: boolean;
|
|
10
|
+
readonly componentConfig: DbxInjectionComponentConfig<T>;
|
|
11
|
+
}
|
|
12
|
+
export declare class DbxInjectionDialogComponent<T = unknown> extends AbstractDialogDirective<void, DbxInjectionDialogComponentConfig<T>> {
|
|
13
|
+
get showCloseButton(): boolean;
|
|
14
|
+
get contentWidth(): Maybe<DbxDialogContentContainerWidth>;
|
|
15
|
+
get componentConfig(): DbxInjectionComponentConfig<T>;
|
|
16
|
+
static openDialog<T>(matDialog: MatDialog, config: DbxInjectionDialogComponentConfig<T>): MatDialogRef<DbxInjectionDialogComponent<T>, void>;
|
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxInjectionDialogComponent<any>, never>;
|
|
18
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxInjectionDialogComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
19
|
+
}
|
|
@@ -3,5 +3,6 @@ export * from './dialog.content.close.component';
|
|
|
3
3
|
export * from './dialog.content.footer.component';
|
|
4
4
|
export * from './dialog.content.directive';
|
|
5
5
|
export * from './dialog.action.directive';
|
|
6
|
+
export * from './dialog.injection.component';
|
|
6
7
|
export * from './dialog.content';
|
|
7
8
|
export * from './dialog.module';
|
|
@@ -15,17 +15,11 @@ $dbx-iframe-height-var: --dbx-iframe-height;
|
|
|
15
15
|
width: 100%;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
dbx-embed embed {
|
|
18
|
+
dbx-embed .embed {
|
|
19
19
|
// because of the way embed works, the embed element itself must have weight/height set, but this can cause issues with images.
|
|
20
20
|
height: 100%;
|
|
21
21
|
width: 100%;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
dbx-embed embed.embed-image {
|
|
25
|
-
// This class aims to retain the original aspect ratio of the image while ensuring it does not overflow the container.
|
|
26
|
-
width: unset;
|
|
27
|
-
max-width: 100%;
|
|
28
|
-
max-height: 100%;
|
|
22
|
+
object-fit: contain;
|
|
29
23
|
}
|
|
30
24
|
}
|
|
31
25
|
|
|
@@ -3,29 +3,38 @@ import { Maybe } from '@dereekb/util';
|
|
|
3
3
|
import { AbstractSubscriptionDirective } from '@dereekb/dbx-core';
|
|
4
4
|
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
|
+
export type DbxEmbedComponentElement = 'embed' | 'img';
|
|
6
7
|
export declare class DbxEmbedComponent extends AbstractSubscriptionDirective implements OnDestroy {
|
|
7
8
|
private readonly _browserObjectUrlRef;
|
|
8
9
|
readonly sanitizer: DomSanitizer;
|
|
9
10
|
readonly root: import("@angular/core").Signal<ElementRef<HTMLSpanElement> | undefined>;
|
|
10
|
-
readonly sanitizeUrl: import("@angular/core").InputSignal<Maybe<boolean>>;
|
|
11
|
-
readonly srcUrl: import("@angular/core").InputSignal<Maybe<string | SafeResourceUrl>>;
|
|
12
|
-
readonly type: import("@angular/core").InputSignal<Maybe<string>>;
|
|
13
11
|
/**
|
|
14
|
-
* The
|
|
12
|
+
* The element to embed. Can be either embed or img. If not provided, will be determined by the input mimetype.
|
|
13
|
+
*
|
|
14
|
+
* If set to 'embed', the embed element will be used.
|
|
15
|
+
* If set to 'img', the img element will be used.
|
|
16
|
+
*/
|
|
17
|
+
readonly embedElement: import("@angular/core").ModelSignal<Maybe<DbxEmbedComponentElement>>;
|
|
18
|
+
readonly sanitizeUrl: import("@angular/core").ModelSignal<Maybe<boolean>>;
|
|
19
|
+
readonly srcUrl: import("@angular/core").ModelSignal<Maybe<string | SafeResourceUrl>>;
|
|
20
|
+
readonly type: import("@angular/core").ModelSignal<Maybe<string>>;
|
|
21
|
+
/**
|
|
22
|
+
* The input blob or media source to use.
|
|
15
23
|
*
|
|
16
24
|
* If set, the srcUrl will be updated with the browser object URL.
|
|
17
25
|
*/
|
|
18
|
-
readonly
|
|
26
|
+
readonly blob: import("@angular/core").ModelSignal<Maybe<Blob>>;
|
|
19
27
|
readonly srcUrlFromBlob: import("@angular/core").WritableSignal<Maybe<string>>;
|
|
20
28
|
readonly typeFromBlob: import("@angular/core").WritableSignal<Maybe<string>>;
|
|
21
|
-
readonly
|
|
29
|
+
readonly blobEffect: import("@angular/core").EffectRef;
|
|
22
30
|
readonly srcUrlSignal: import("@angular/core").Signal<Maybe<string | SafeResourceUrl>>;
|
|
23
31
|
readonly typeSignal: import("@angular/core").Signal<Maybe<string>>;
|
|
24
32
|
readonly root$: import("rxjs").Observable<ElementRef<HTMLSpanElement> | undefined>;
|
|
25
33
|
readonly srcUrl$: import("rxjs").Observable<Maybe<string | SafeResourceUrl>>;
|
|
26
34
|
readonly type$: import("rxjs").Observable<Maybe<string>>;
|
|
35
|
+
readonly embedElementName$: import("rxjs").Observable<Maybe<DbxEmbedComponentElement>>;
|
|
27
36
|
constructor();
|
|
28
37
|
ngOnDestroy(): void;
|
|
29
38
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxEmbedComponent, never>;
|
|
30
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DbxEmbedComponent, "dbx-embed", never, { "sanitizeUrl": { "alias": "sanitizeUrl"; "required": false; "isSignal": true; }; "srcUrl": { "alias": "srcUrl"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "
|
|
39
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxEmbedComponent, "dbx-embed", never, { "embedElement": { "alias": "embedElement"; "required": false; "isSignal": true; }; "sanitizeUrl": { "alias": "sanitizeUrl"; "required": false; "isSignal": true; }; "srcUrl": { "alias": "srcUrl"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "blob": { "alias": "blob"; "required": false; "isSignal": true; }; }, { "embedElement": "embedElementChange"; "sanitizeUrl": "sanitizeUrlChange"; "srcUrl": "srcUrlChange"; "type": "typeChange"; "blob": "blobChange"; }, never, never, true, never>;
|
|
31
40
|
}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { MatDialog, MatDialogRef, MatDialogConfig } from '@angular/material/dialog';
|
|
2
|
-
import { ContentTypeMimeType, Maybe, WebsiteUrlWithPrefix } from '@dereekb/util';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
import { type MatDialog, type MatDialogRef, type MatDialogConfig } from '@angular/material/dialog';
|
|
2
|
+
import { type ContentTypeMimeType, type Maybe, type WebsiteUrlWithPrefix } from '@dereekb/util';
|
|
3
|
+
import { DbxEmbedComponent } from './embed.component';
|
|
4
|
+
import { DbxInjectionDialogComponent } from '../dialog/dialog.injection.component';
|
|
5
5
|
export interface DbxEmbedDialogConfig extends Omit<MatDialogConfig, 'data'> {
|
|
6
|
-
readonly srcUrl
|
|
6
|
+
readonly srcUrl?: Maybe<WebsiteUrlWithPrefix>;
|
|
7
|
+
readonly blob?: Maybe<Blob>;
|
|
7
8
|
readonly embedMimeType?: Maybe<ContentTypeMimeType | string>;
|
|
8
9
|
readonly sanitizeUrl?: boolean;
|
|
9
10
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Opens a dialog with DbxEmbedComponent.
|
|
13
|
+
*
|
|
14
|
+
* @param matDialog The MatDialog instance to use.
|
|
15
|
+
* @param config The configuration for the dialog.
|
|
16
|
+
* @returns The MatDialogRef for the dialog.
|
|
17
|
+
*/
|
|
18
|
+
export declare function openEmbedDialog(matDialog: MatDialog, config: DbxEmbedDialogConfig): MatDialogRef<DbxInjectionDialogComponent<DbxEmbedComponent>, void>;
|
|
@@ -10,7 +10,7 @@ export declare class DbxIframeComponent extends AbstractSubscriptionDirective im
|
|
|
10
10
|
readonly iframe: import("@angular/core").Signal<ElementRef<HTMLIFrameElement> | undefined>;
|
|
11
11
|
readonly scrolling: import("@angular/core").InputSignalWithTransform<"auto" | "no" | "yes", boolean | "auto" | "no" | "yes">;
|
|
12
12
|
readonly sanitizeUrl: import("@angular/core").InputSignal<boolean>;
|
|
13
|
-
readonly contentUrl: import("@angular/core").
|
|
13
|
+
readonly contentUrl: import("@angular/core").ModelSignal<Maybe<string | SafeResourceUrl>>;
|
|
14
14
|
readonly contentUrlSignal: import("@angular/core").Signal<Maybe<string | SafeResourceUrl>>;
|
|
15
15
|
readonly iframe$: import("rxjs").Observable<ElementRef<HTMLIFrameElement> | undefined>;
|
|
16
16
|
readonly contentUrl$: import("rxjs").Observable<Maybe<string | SafeResourceUrl>>;
|
|
@@ -18,5 +18,5 @@ export declare class DbxIframeComponent extends AbstractSubscriptionDirective im
|
|
|
18
18
|
constructor();
|
|
19
19
|
ngOnDestroy(): void;
|
|
20
20
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxIframeComponent, never>;
|
|
21
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DbxIframeComponent, "dbx-iframe", never, { "scrolling": { "alias": "scrolling"; "required": false; "isSignal": true; }; "sanitizeUrl": { "alias": "sanitizeUrl"; "required": false; "isSignal": true; }; "contentUrl": { "alias": "contentUrl"; "required":
|
|
21
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxIframeComponent, "dbx-iframe", never, { "scrolling": { "alias": "scrolling"; "required": false; "isSignal": true; }; "sanitizeUrl": { "alias": "sanitizeUrl"; "required": false; "isSignal": true; }; "contentUrl": { "alias": "contentUrl"; "required": false; "isSignal": true; }; }, { "iframeLocationChanged": "iframeLocationChanged"; "contentUrl": "contentUrlChange"; }, never, never, true, never>;
|
|
22
22
|
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { MatDialog, MatDialogRef, MatDialogConfig } from '@angular/material/dialog';
|
|
2
|
-
import { WebsiteUrlWithPrefix } from '@dereekb/util';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
import { type MatDialog, type MatDialogRef, type MatDialogConfig } from '@angular/material/dialog';
|
|
2
|
+
import { type WebsiteUrlWithPrefix } from '@dereekb/util';
|
|
3
|
+
import { DbxIframeComponent } from './iframe.component';
|
|
4
|
+
import { DbxInjectionDialogComponent } from '../dialog/dialog.injection.component';
|
|
5
5
|
export interface DbxIframeDialogConfig extends Omit<MatDialogConfig, 'data'> {
|
|
6
6
|
readonly contentUrl: WebsiteUrlWithPrefix;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Opens a dialog with DbxEmbedComponent.
|
|
10
|
+
*
|
|
11
|
+
* @param matDialog The MatDialog instance to use.
|
|
12
|
+
* @param config The configuration for the dialog.
|
|
13
|
+
* @returns The MatDialogRef for the dialog.
|
|
14
|
+
*/
|
|
15
|
+
export declare function openIframeDialog(matDialog: MatDialog, config: DbxIframeDialogConfig): MatDialogRef<DbxInjectionDialogComponent<DbxIframeComponent>, void>;
|