c3-components 0.12.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,10 +10,11 @@ export declare class C3FileDisplayCardComponent {
10
10
  readonly deletable: import("@angular/core").InputSignal<boolean>;
11
11
  readonly size: import("@angular/core").InputSignal<C3FileCardSize>;
12
12
  readonly onDelete: import("@angular/core").OutputEmitterRef<void>;
13
+ readonly onDownload: import("@angular/core").OutputEmitterRef<void>;
13
14
  readonly getFileType: import("@angular/core").Signal<"image" | "application" | "video" | "unknown">;
14
15
  readonly getFileObjectUrl: import("@angular/core").Signal<Observable<string> | null>;
15
16
  readonly getFileName: import("@angular/core").Signal<string>;
16
17
  readonly getDisplayName: import("@angular/core").Signal<string>;
17
18
  static ɵfac: i0.ɵɵFactoryDeclaration<C3FileDisplayCardComponent, never>;
18
- static ɵcmp: i0.ɵɵComponentDeclaration<C3FileDisplayCardComponent, "c3-file-display-card", never, { "fileObjectUrl": { "alias": "fileObjectUrl"; "required": true; "isSignal": true; }; "displayFn": { "alias": "displayFn"; "required": false; "isSignal": true; }; "deletable": { "alias": "deletable"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, { "onDelete": "onDelete"; }, never, never, true, never>;
19
+ static ɵcmp: i0.ɵɵComponentDeclaration<C3FileDisplayCardComponent, "c3-file-display-card", never, { "fileObjectUrl": { "alias": "fileObjectUrl"; "required": true; "isSignal": true; }; "displayFn": { "alias": "displayFn"; "required": false; "isSignal": true; }; "deletable": { "alias": "deletable"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, { "onDelete": "onDelete"; "onDownload": "onDownload"; }, never, never, true, never>;
19
20
  }
@@ -2,11 +2,12 @@ import { TemplateRef } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class C3FileDisplayListColumnDefDirective {
4
4
  readonly title: import("@angular/core").InputSignal<string>;
5
+ readonly classList: import("@angular/core").InputSignal<string[]>;
5
6
  private readonly _table;
6
7
  readonly headerCellDef: import("@angular/core").Signal<C3FileDisplayListHeaderCellDefDirective | undefined>;
7
8
  readonly cellDef: import("@angular/core").Signal<C3FileDisplayListCellDefDirective | undefined>;
8
9
  static ɵfac: i0.ɵɵFactoryDeclaration<C3FileDisplayListColumnDefDirective, never>;
9
- static ɵdir: i0.ɵɵDirectiveDeclaration<C3FileDisplayListColumnDefDirective, "[c3FileDisplayListColumnDef]", never, { "title": { "alias": "c3FileDisplayListColumnDef"; "required": true; "isSignal": true; }; }, {}, ["headerCellDef", "cellDef"], never, true, never>;
10
+ static ɵdir: i0.ɵɵDirectiveDeclaration<C3FileDisplayListColumnDefDirective, "[c3FileDisplayListColumnDef]", never, { "title": { "alias": "c3FileDisplayListColumnDef"; "required": true; "isSignal": true; }; "classList": { "alias": "classList"; "required": false; "isSignal": true; }; }, {}, ["headerCellDef", "cellDef"], never, true, never>;
10
11
  }
11
12
  export declare class C3FileDisplayListHeaderCellDefDirective {
12
13
  template: TemplateRef<any>;
@@ -3,84 +3,43 @@
3
3
  flex-direction: column;
4
4
  margin: 0.5rem;
5
5
 
6
- .header {
7
- display: flex;
8
- align-items: center;
9
- padding: 0 0.5rem;
10
- border-bottom: 1px solid var(--mat-divider-color);
6
+ .file-table {
7
+ width: 100%;
8
+ border-collapse: collapse;
9
+
10
+ th,
11
+ td {
12
+ padding: 0.5rem;
13
+ text-align: left;
14
+ border-bottom: 1px solid var(--mat-divider-color);
15
+ }
11
16
 
12
- .title {
13
- flex-basis: 304px;
14
- width: 304px;
17
+ th {
15
18
  font-size: 1.5rem;
16
19
  font-weight: bold;
17
-
18
- &.full {
19
- flex: auto;
20
- }
21
-
22
- &.icon {
23
- flex: 0 0 auto;
24
- width: 56px;
25
- min-width: 56px;
26
- }
20
+ background-color: var(--mat-table-header-container-background-color);
27
21
  }
28
22
 
29
- .icon {
30
- flex-basis: 40px;
31
- width: 40px;
32
- }
33
- }
34
-
35
- .file-display-list {
36
- display: flex;
37
- flex-direction: column;
38
-
39
- > button {
40
- display: flex;
41
- flex-direction: row;
42
- height: 3rem;
43
- align-items: center;
44
- border-bottom: 1px solid var(--mat-divider-color);
45
- background-color: var(--mdc-protected-button-container-color);
46
- text-align: start;
47
- padding: 0 0.5rem;
48
-
23
+ tr {
49
24
  &:hover {
50
25
  background-color: var(--background-hover);
51
26
  }
27
+ }
52
28
 
53
- .icon-cell {
54
- flex: 0 0 auto;
55
- width: 56px;
56
- min-width: 56px;
57
- display: flex;
58
- align-items: center;
59
- justify-content: center;
60
- padding: 0 0.5rem;
61
-
62
- .icon {
63
- display: flex;
64
- align-items: center;
65
- justify-content: center;
66
- }
67
- }
68
-
69
- .name {
70
- flex: auto;
71
- flex-basis: 304px;
72
- width: 304px;
73
- }
29
+ .icon {
30
+ width: 56px;
31
+ min-width: 56px;
32
+ text-align: center;
33
+ }
74
34
 
75
- .cell {
76
- flex-basis: 304px;
77
- width: 304px;
78
- }
35
+ :where(th, td):not(.full) {
36
+ width: 0;
37
+ white-space: nowrap;
38
+ }
79
39
 
80
- .date-label {
81
- flex-basis: 304px;
82
- width: 304px;
83
- }
40
+ .actions {
41
+ width: 48px;
42
+ text-align: center;
84
43
  }
85
44
  }
86
45
  }
@@ -7,11 +7,14 @@ import * as i5 from "./components/c3-file-viewer-pdf/c3-file-viewer-pdf.componen
7
7
  import * as i6 from "./components/c3-file-viewer-video/c3-file-viewer-video.component";
8
8
  import * as i7 from "./components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.component";
9
9
  import * as i8 from "./components/public/c3-file-viewer-dialog/c3-file-viewer-dialog";
10
- import * as i9 from "@angular/common";
11
- import * as i10 from "../c3-safe-url/pipes/c3-safe-url.pipe";
12
- import * as i11 from "@angular/material/dialog";
10
+ import * as i9 from "./components/c3-file-viewer-default/c3-file-viewer-default.component";
11
+ import * as i10 from "@angular/common";
12
+ import * as i11 from "../c3-safe-url/pipes/c3-safe-url.pipe";
13
+ import * as i12 from "@angular/material/dialog";
14
+ import * as i13 from "@angular/material/icon";
15
+ import * as i14 from "@angular/material/button";
13
16
  export declare class C3FileViewerModule {
14
17
  static ɵfac: i0.ɵɵFactoryDeclaration<C3FileViewerModule, never>;
15
- static ɵmod: i0.ɵɵNgModuleDeclaration<C3FileViewerModule, [typeof i1.FullScreenDirective, typeof i2.C3FileViewerComponent, typeof i3.C3FileViewerActionsComponent, typeof i4.C3FileViewerImageComponent, typeof i5.C3FileViewerPdfComponent, typeof i6.C3FileViewerVideoComponent, typeof i7.C3FileViewerDialogComponent, typeof i8.C3FileViewerDialog], [typeof i9.CommonModule, typeof i10.C3SafeUrlPipe, typeof i11.MatDialogModule], [typeof i1.FullScreenDirective, typeof i2.C3FileViewerComponent, typeof i7.C3FileViewerDialogComponent]>;
18
+ static ɵmod: i0.ɵɵNgModuleDeclaration<C3FileViewerModule, [typeof i1.FullScreenDirective, typeof i2.C3FileViewerComponent, typeof i3.C3FileViewerActionsComponent, typeof i4.C3FileViewerImageComponent, typeof i5.C3FileViewerPdfComponent, typeof i6.C3FileViewerVideoComponent, typeof i7.C3FileViewerDialogComponent, typeof i8.C3FileViewerDialog, typeof i9.C3FileViewerDefaultComponent], [typeof i10.CommonModule, typeof i11.C3SafeUrlPipe, typeof i12.MatDialogModule, typeof i13.MatIconModule, typeof i14.MatButtonModule], [typeof i1.FullScreenDirective, typeof i2.C3FileViewerComponent, typeof i7.C3FileViewerDialogComponent]>;
16
19
  static ɵinj: i0.ɵɵInjectorDeclaration<C3FileViewerModule>;
17
20
  }
@@ -0,0 +1,7 @@
1
+ import { C3FileViewer } from '../../models/file-viewer';
2
+ import * as i0 from "@angular/core";
3
+ export declare class C3FileViewerDefaultComponent {
4
+ readonly fileViewer: import("@angular/core").InputSignal<C3FileViewer>;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<C3FileViewerDefaultComponent, never>;
6
+ static ɵcmp: i0.ɵɵComponentDeclaration<C3FileViewerDefaultComponent, "c3-file-viewer-default", never, { "fileViewer": { "alias": "fileViewer"; "required": true; "isSignal": true; }; }, {}, never, never, false, never>;
7
+ }
@@ -1,12 +1,7 @@
1
- import { FileMetadata } from '../../models/file-metadata';
2
1
  import { C3FileViewer } from '../../models/file-viewer';
3
2
  import * as i0 from "@angular/core";
4
3
  export declare class C3FileViewerVideoComponent {
5
- set _srcUpdated({ location }: FileMetadata);
6
- src: string;
7
- private src$;
8
- fileViewer: C3FileViewer;
9
- constructor();
4
+ readonly fileViewer: import("@angular/core").InputSignal<C3FileViewer>;
10
5
  static ɵfac: i0.ɵɵFactoryDeclaration<C3FileViewerVideoComponent, never>;
11
- static ɵcmp: i0.ɵɵComponentDeclaration<C3FileViewerVideoComponent, "c3-file-viewer-video", never, { "_srcUpdated": { "alias": "file"; "required": false; }; "fileViewer": { "alias": "fileViewer"; "required": false; }; }, {}, never, never, false, never>;
6
+ static ɵcmp: i0.ɵɵComponentDeclaration<C3FileViewerVideoComponent, "c3-file-viewer-video", never, { "fileViewer": { "alias": "fileViewer"; "required": true; "isSignal": true; }; }, {}, never, never, false, never>;
12
7
  }
@@ -0,0 +1,2 @@
1
+ export declare const SUPPORTED_MIME_TYPES: string[];
2
+ export declare function isMimeTypeSupported(mimeType: string): boolean;
@@ -23,6 +23,7 @@ export interface C3FileViewerConfig {
23
23
  next?: boolean;
24
24
  prev?: boolean;
25
25
  reset?: boolean;
26
+ download?: boolean;
26
27
  };
27
28
  btnIcons?: {
28
29
  zoomIn?: MultiBtn['btn'];
@@ -33,6 +34,7 @@ export interface C3FileViewerConfig {
33
34
  prev?: MultiBtn['btn'];
34
35
  fullscreen?: MultiBtn['btn'];
35
36
  reset?: MultiBtn['btn'];
37
+ download?: MultiBtn['btn'];
36
38
  };
37
39
  customBtns?: Array<{
38
40
  name: string;
@@ -32,7 +32,7 @@ export declare class C3FileViewer {
32
32
  get files(): FileMetadata[];
33
33
  private _files;
34
34
  filesObjectUrl: Array<FileMetadata & {
35
- objectUrl: Observable<string>;
35
+ objectUrl?: Observable<string>;
36
36
  }>;
37
37
  private locationBlobMap;
38
38
  private scale;
@@ -41,12 +41,12 @@ export declare class C3FileViewer {
41
41
  private translateY;
42
42
  private prevX;
43
43
  private prevY;
44
- constructor({ config, files, client, }: {
44
+ constructor({ config, files, client }: {
45
45
  config?: C3FileViewerConfig;
46
46
  files?: FileMetadata[];
47
47
  client: HttpClient;
48
48
  });
49
- createObjectURL(file: FileMetadata | VariantFile): Observable<string>;
49
+ createObjectURL(file: FileMetadata | VariantFile): Observable<string> | undefined;
50
50
  getFile(location: string): Observable<Blob>;
51
51
  previousImage(event: KeyboardEvent | MouseEvent): void;
52
52
  nextImage(event: KeyboardEvent | MouseEvent): void;
@@ -55,15 +55,19 @@ export declare class C3FileViewer {
55
55
  scrollZoom(evt: WheelEvent): boolean;
56
56
  rotateClockwise(): void;
57
57
  rotateCounterClockwise(): void;
58
- onLoad(): void;
58
+ onLoaded(): void;
59
59
  onLoadStart(): void;
60
60
  imageNotFound(file: FileMetadata): void;
61
61
  onDragOver(evt: DragEvent): void;
62
62
  onDragStart(evt: DragEvent): void;
63
63
  toggleFullscreen(): void;
64
64
  reset(): void;
65
+ getOriginalName(file?: FileMetadata): any;
65
66
  private canNavigate;
66
67
  private updateStyle;
67
68
  private valueToCss;
68
69
  private mergeConfig;
70
+ download(file?: FileMetadata): void;
71
+ private downloadFromUrl;
72
+ private downloadWithClient;
69
73
  }
@@ -102,6 +102,20 @@
102
102
  .c3-file-viewer-pdf {
103
103
  height: 100%;
104
104
  width: 100%;
105
+ position: relative;
106
+
107
+ .download-button {
108
+ position: absolute;
109
+ bottom: 10px;
110
+ right: 10px;
111
+ z-index: 99;
112
+ background-color: #00000000;
113
+ border: none;
114
+ color: #fff;
115
+ font-size: 24px;
116
+ cursor: pointer;
117
+ padding: 10px;
118
+ }
105
119
  }
106
120
 
107
121
  .c3-file-viewer {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c3-components",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "description": "C3 Components Library",
5
5
  "author": "c3ulnta0rk",
6
6
  "license": "MIT",