c3-components 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/c3-file-displayer/c3-file-display-card/c3-file-display-card.component.mjs +26 -0
- package/esm2022/lib/c3-file-displayer/c3-file-display-grid/c3-file-display-grid.component.mjs +44 -0
- package/esm2022/lib/c3-file-displayer/c3-file-display-icon/c3-file-display-icon.component.mjs +56 -0
- package/esm2022/lib/c3-file-displayer/c3-file-display-list/c3-file-display-list.component.mjs +60 -0
- package/esm2022/lib/c3-file-displayer/c3-file-displayer.module.mjs +43 -0
- package/esm2022/lib/c3-file-viewer/models/file-viewer.mjs +7 -7
- package/esm2022/public-api.mjs +9 -2
- package/fesm2022/c3-components.mjs +194 -29
- package/fesm2022/c3-components.mjs.map +1 -1
- package/lib/c3-file-displayer/c3-file-display-card/c3-file-display-card.component.d.ts +14 -0
- package/lib/c3-file-displayer/c3-file-display-card/c3-file-display-card.component.scss +34 -0
- package/lib/c3-file-displayer/c3-file-display-grid/c3-file-display-grid.component.d.ts +19 -0
- package/lib/c3-file-displayer/c3-file-display-grid/c3-file-display-grid.component.scss +9 -0
- package/lib/c3-file-displayer/c3-file-display-icon/c3-file-display-icon.component.d.ts +8 -0
- package/lib/c3-file-displayer/c3-file-display-icon/c3-file-display-icon.component.scss +19 -0
- package/lib/c3-file-displayer/c3-file-display-list/c3-file-display-list.component.d.ts +19 -0
- package/lib/c3-file-displayer/c3-file-display-list/c3-file-display-list.component.scss +28 -0
- package/lib/c3-file-displayer/c3-file-displayer.module.d.ts +11 -0
- package/lib/c3-file-viewer/models/file-viewer.d.ts +5 -2
- package/package.json +1 -1
- package/public-api.d.ts +8 -1
- package/esm2022/lib/c3-signals/c3-signal.mjs +0 -24
- package/lib/c3-signals/c3-signal.d.ts +0 -11
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
.file-card {
|
|
4
|
+
position: relative;
|
|
5
|
+
border-radius: 4px;
|
|
6
|
+
border: 1px solid #e0e0e0;
|
|
7
|
+
overflow: auto;
|
|
8
|
+
.actions {
|
|
9
|
+
position: absolute;
|
|
10
|
+
top: -21px;
|
|
11
|
+
right: -21px;
|
|
12
|
+
z-index: 1;
|
|
13
|
+
display: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
img {
|
|
17
|
+
border-radius: 4px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&:hover .actions {
|
|
21
|
+
display: block;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.informations {
|
|
25
|
+
position: absolute;
|
|
26
|
+
bottom: 0;
|
|
27
|
+
left: 0;
|
|
28
|
+
z-index: 1;
|
|
29
|
+
width: 100%;
|
|
30
|
+
background: rgba(0, 0, 0, 0.5);
|
|
31
|
+
padding: 0 4px;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FileMetadata } from '../../c3-file-viewer/models/file-metadata';
|
|
2
|
+
import { C3FileViewer } from '../../c3-file-viewer/models/file-viewer';
|
|
3
|
+
import { C3FileViewerDialogComponent } from '../../c3-file-viewer/components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.component';
|
|
4
|
+
import { C3FileViewerConfig } from '../../c3-file-viewer/models/file-viewer-config.model';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class C3FileDisplayGridComponent {
|
|
7
|
+
readonly files: import("@angular/core").InputSignal<(FileMetadata & {
|
|
8
|
+
location: string;
|
|
9
|
+
})[]>;
|
|
10
|
+
readonly config: import("@angular/core").InputSignal<C3FileViewerConfig | undefined>;
|
|
11
|
+
readonly deletable: import("@angular/core").InputSignal<boolean>;
|
|
12
|
+
readonly onDelete: import("@angular/core").OutputEmitterRef<FileMetadata>;
|
|
13
|
+
readonly dialog: import("@angular/core").Signal<C3FileViewerDialogComponent | undefined>;
|
|
14
|
+
fileViewer: C3FileViewer;
|
|
15
|
+
constructor();
|
|
16
|
+
openDialog($event: MouseEvent, index: number): void;
|
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<C3FileDisplayGridComponent, never>;
|
|
18
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<C3FileDisplayGridComponent, "c3-file-display-grid", never, { "files": { "alias": "files"; "required": true; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; "deletable": { "alias": "deletable"; "required": false; "isSignal": true; }; }, { "onDelete": "onDelete"; }, never, never, true, never>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class C3FileDisplayIconComponent {
|
|
3
|
+
readonly fileType: import("@angular/core").InputSignal<string>;
|
|
4
|
+
readonly displayedIcon: import("@angular/core").Signal<"image" | "play_circle" | "picture_as_pdf" | "description" | "content_copy">;
|
|
5
|
+
readonly color: import("@angular/core").Signal<"text-primary" | "text-secondary" | "text-error" | "text-success" | "text-gray">;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<C3FileDisplayIconComponent, never>;
|
|
7
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<C3FileDisplayIconComponent, "c3-file-display-icon", never, { "fileType": { "alias": "fileType"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
|
|
4
|
+
.text-primary {
|
|
5
|
+
color: var(--primary-color);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.text-secondary {
|
|
9
|
+
color: var(--secondary-color);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.text-success {
|
|
13
|
+
color: var(--success-color);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.text-gray {
|
|
17
|
+
color: var(--gray-color);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { C3FileViewerDialogComponent } from '../../c3-file-viewer/components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.component';
|
|
2
|
+
import { FileMetadata } from '../../c3-file-viewer/models/file-metadata';
|
|
3
|
+
import { C3FileViewer } from '../../c3-file-viewer/models/file-viewer';
|
|
4
|
+
import { C3FileViewerConfig } from '../../c3-file-viewer/models/file-viewer-config.model';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class C3FileDisplayListComponent {
|
|
7
|
+
readonly files: import("@angular/core").InputSignal<(FileMetadata & {
|
|
8
|
+
location: string;
|
|
9
|
+
})[]>;
|
|
10
|
+
readonly config: import("@angular/core").InputSignal<C3FileViewerConfig | undefined>;
|
|
11
|
+
readonly deletable: import("@angular/core").InputSignal<boolean>;
|
|
12
|
+
readonly onDelete: import("@angular/core").OutputEmitterRef<FileMetadata>;
|
|
13
|
+
readonly dialog: import("@angular/core").Signal<C3FileViewerDialogComponent | undefined>;
|
|
14
|
+
fileViewer: C3FileViewer;
|
|
15
|
+
constructor();
|
|
16
|
+
openDialog($event: MouseEvent, index: number): void;
|
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<C3FileDisplayListComponent, never>;
|
|
18
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<C3FileDisplayListComponent, "c3-file-display-list", never, { "files": { "alias": "files"; "required": true; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; "deletable": { "alias": "deletable"; "required": false; "isSignal": true; }; }, { "onDelete": "onDelete"; }, never, never, true, never>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
margin: 0.5rem;
|
|
5
|
+
|
|
6
|
+
.header {
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
padding: 0 0.5rem;
|
|
10
|
+
border-bottom: 1px solid var(--mat-divider-color);
|
|
11
|
+
|
|
12
|
+
.title {
|
|
13
|
+
flex-basis: 304px;
|
|
14
|
+
width: 304px;
|
|
15
|
+
font-size: 1.5rem;
|
|
16
|
+
font-weight: bold;
|
|
17
|
+
|
|
18
|
+
&.full {
|
|
19
|
+
flex: auto;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.icon {
|
|
24
|
+
flex-basis: 40px;
|
|
25
|
+
width: 40px;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "@angular/common";
|
|
3
|
+
import * as i2 from "./c3-file-display-grid/c3-file-display-grid.component";
|
|
4
|
+
import * as i3 from "./c3-file-display-list/c3-file-display-list.component";
|
|
5
|
+
import * as i4 from "./c3-file-display-card/c3-file-display-card.component";
|
|
6
|
+
import * as i5 from "./c3-file-display-icon/c3-file-display-icon.component";
|
|
7
|
+
export declare class C3FileDisplayerModule {
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<C3FileDisplayerModule, never>;
|
|
9
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<C3FileDisplayerModule, never, [typeof i1.CommonModule, typeof i2.C3FileDisplayGridComponent, typeof i3.C3FileDisplayListComponent, typeof i4.C3FileDisplayCardComponent, typeof i5.C3FileDisplayIconComponent], [typeof i2.C3FileDisplayGridComponent, typeof i3.C3FileDisplayListComponent, typeof i4.C3FileDisplayCardComponent, typeof i5.C3FileDisplayIconComponent]>;
|
|
10
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<C3FileDisplayerModule>;
|
|
11
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { BehaviorSubject, Observable } from 'rxjs';
|
|
2
2
|
import { C3FileViewerConfig } from './file-viewer-config.model';
|
|
3
|
+
import { HttpClient } from '@angular/common/http';
|
|
3
4
|
import { FileMetadata } from './file-metadata';
|
|
4
5
|
export declare class C3FileViewer {
|
|
5
6
|
private _config;
|
|
7
|
+
private client;
|
|
6
8
|
get config(): C3FileViewerConfig;
|
|
7
9
|
set config(value: C3FileViewerConfig);
|
|
8
10
|
config$: BehaviorSubject<C3FileViewerConfig>;
|
|
@@ -30,7 +32,7 @@ export declare class C3FileViewer {
|
|
|
30
32
|
get files(): FileMetadata[];
|
|
31
33
|
private _files;
|
|
32
34
|
filesObjectUrl: Array<FileMetadata & {
|
|
33
|
-
objectUrl
|
|
35
|
+
objectUrl: Observable<string>;
|
|
34
36
|
}>;
|
|
35
37
|
private scale;
|
|
36
38
|
private rotation;
|
|
@@ -38,9 +40,10 @@ export declare class C3FileViewer {
|
|
|
38
40
|
private translateY;
|
|
39
41
|
private prevX;
|
|
40
42
|
private prevY;
|
|
41
|
-
constructor({ config, files, }: {
|
|
43
|
+
constructor({ config, files, client, }: {
|
|
42
44
|
config?: C3FileViewerConfig;
|
|
43
45
|
files?: FileMetadata[];
|
|
46
|
+
client: HttpClient;
|
|
44
47
|
});
|
|
45
48
|
createObjectURL(file: FileMetadata): Observable<string>;
|
|
46
49
|
getFile(location: string): Observable<Blob>;
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -25,6 +25,14 @@ export * from './lib/c3-file-viewer/models/file-viewer-config.model';
|
|
|
25
25
|
export * from './lib/c3-file-viewer/models/file-viewer';
|
|
26
26
|
export * from './lib/c3-file-viewer/models/file-metadata';
|
|
27
27
|
export * from './lib/c3-file-viewer/c3-file-viewer.module';
|
|
28
|
+
/**
|
|
29
|
+
* File Displayer
|
|
30
|
+
*/
|
|
31
|
+
export * from './lib/c3-file-displayer/c3-file-displayer.module';
|
|
32
|
+
export * from './lib/c3-file-displayer/c3-file-display-list/c3-file-display-list.component';
|
|
33
|
+
export * from './lib/c3-file-displayer/c3-file-display-icon/c3-file-display-icon.component';
|
|
34
|
+
export * from './lib/c3-file-displayer/c3-file-display-grid/c3-file-display-grid.component';
|
|
35
|
+
export * from './lib/c3-file-displayer/c3-file-display-card/c3-file-display-card.component';
|
|
28
36
|
/**
|
|
29
37
|
* Safe Url
|
|
30
38
|
*/
|
|
@@ -47,4 +55,3 @@ export * from './lib/c3-select-on-focus/c3-select-on-focus.directive';
|
|
|
47
55
|
* Toggle Signal
|
|
48
56
|
*/
|
|
49
57
|
export * from './lib/c3-signals/c3-boolean-signal';
|
|
50
|
-
export * from './lib/c3-signals/c3-signal';
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { effect, signal } from '@angular/core';
|
|
2
|
-
import { Subject } from 'rxjs';
|
|
3
|
-
class C3Signal {
|
|
4
|
-
constructor(initialValue) {
|
|
5
|
-
this.value$ = new Subject();
|
|
6
|
-
this._signal = signal(initialValue);
|
|
7
|
-
effect(() => {
|
|
8
|
-
this.value$.next(this._signal());
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
get() {
|
|
12
|
-
return this._signal();
|
|
13
|
-
}
|
|
14
|
-
set value(newValue) {
|
|
15
|
-
this._signal.set(newValue);
|
|
16
|
-
}
|
|
17
|
-
update(updateFn) {
|
|
18
|
-
this._signal.update(updateFn);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
export function c3Signal(initialValue) {
|
|
22
|
-
return new C3Signal(initialValue);
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYzMtc2lnbmFsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvYzMtY29tcG9uZW50cy9zcmMvbGliL2MzLXNpZ25hbHMvYzMtc2lnbmFsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBa0IsTUFBTSxFQUFFLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUMvRCxPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0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vbnN0cnVjdG9yKGluaXRpYWxWYWx1ZTogVCkge1xuICAgIHRoaXMuX3NpZ25hbCA9IHNpZ25hbDxUPihpbml0aWFsVmFsdWUpO1xuXG4gICAgZWZmZWN0KCgpID0+IHtcbiAgICAgIHRoaXMudmFsdWUkLm5leHQodGhpcy5fc2lnbmFsKCkpO1xuICAgIH0pO1xuICB9XG5cbiAgZ2V0KCkge1xuICAgIHJldHVybiB0aGlzLl9zaWduYWwoKTtcbiAgfVxuXG4gIHNldCB2YWx1ZShuZXdWYWx1ZTogVCkge1xuICAgIHRoaXMuX3NpZ25hbC5zZXQobmV3VmFsdWUpO1xuICB9XG5cbiAgdXBkYXRlKHVwZGF0ZUZuOiAodmFsdWU6IFQpID0+IFQpIHtcbiAgICB0aGlzLl9zaWduYWwudXBkYXRlKHVwZGF0ZUZuKTtcbiAgfVxufVxuXG5leHBvcnQgZnVuY3Rpb24gYzNTaWduYWw8VD4oaW5pdGlhbFZhbHVlOiBUKSB7XG4gIHJldHVybiBuZXcgQzNTaWduYWw8VD4oaW5pdGlhbFZhbHVlKTtcbn1cbiJdfQ==
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Subject } from 'rxjs';
|
|
2
|
-
declare class C3Signal<T> {
|
|
3
|
-
private _signal;
|
|
4
|
-
value$: Subject<T>;
|
|
5
|
-
constructor(initialValue: T);
|
|
6
|
-
get(): T;
|
|
7
|
-
set value(newValue: T);
|
|
8
|
-
update(updateFn: (value: T) => T): void;
|
|
9
|
-
}
|
|
10
|
-
export declare function c3Signal<T>(initialValue: T): C3Signal<T>;
|
|
11
|
-
export {};
|