c3-components 0.0.14 → 0.0.15

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 (141) hide show
  1. package/esm2022/c3-components.mjs +5 -0
  2. package/esm2022/lib/c3-auto-animate/C3AutoAnimate.directive.mjs +23 -0
  3. package/esm2022/lib/c3-dialog/c3-dialog.module.mjs +52 -0
  4. package/esm2022/lib/c3-dialog/components/c3-dialog-confirm.component.mjs +51 -0
  5. package/esm2022/lib/c3-dialog/components/c3-dialog-embed-child.component.mjs +32 -0
  6. package/esm2022/lib/c3-dialog/components/c3-dialog-prompt.component.mjs +95 -0
  7. package/esm2022/lib/c3-dialog/services/c3-dialog.service.mjs +77 -0
  8. package/esm2022/lib/c3-dropdown/c3-dropdown.module.mjs +20 -0
  9. package/esm2022/lib/c3-dropdown/components/c3-dropdown.component.mjs +45 -0
  10. package/esm2022/lib/c3-dropdown/directives/c3-dropdown.trigger.mjs +128 -0
  11. package/esm2022/lib/c3-expansion/c3-expansion.module.mjs +43 -0
  12. package/esm2022/lib/c3-expansion/components/c3-expansion/c3-expansion.component.mjs +34 -0
  13. package/esm2022/lib/c3-expansion/components/c3-expansion-header/c3-expansion-header.component.mjs +24 -0
  14. package/esm2022/lib/c3-file-viewer/c3-file-viewer.module.mjs +47 -0
  15. package/esm2022/lib/c3-file-viewer/components/c3-file-viewer-actions/c3-file-viewer-actions.component.mjs +17 -0
  16. package/esm2022/lib/c3-file-viewer/components/c3-file-viewer-image/c3-file-viewer-image.component.mjs +20 -0
  17. package/esm2022/lib/c3-file-viewer/components/c3-file-viewer-pdf/c3-file-viewer-pdf.component.mjs +23 -0
  18. package/esm2022/lib/c3-file-viewer/components/c3-file-viewer-video/c3-file-viewer-video.component.mjs +32 -0
  19. package/esm2022/lib/c3-file-viewer/components/public/c3-file-viewer/c3-file-viewer.component.mjs +86 -0
  20. package/esm2022/lib/c3-file-viewer/components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.component.mjs +40 -0
  21. package/esm2022/lib/c3-file-viewer/components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.mjs +26 -0
  22. package/esm2022/lib/c3-file-viewer/consts/default.config.mjs +40 -0
  23. package/esm2022/lib/c3-file-viewer/directives/full-screen.directive.mjs +66 -0
  24. package/esm2022/lib/c3-file-viewer/models/custom-file-event.model.mjs +7 -0
  25. package/esm2022/lib/c3-file-viewer/models/file-metadata.mjs +2 -0
  26. package/esm2022/lib/c3-file-viewer/models/file-viewer-config.model.mjs +2 -0
  27. package/esm2022/lib/c3-file-viewer/models/file-viewer.mjs +206 -0
  28. package/esm2022/lib/c3-file-viewer/models/http.client.mjs +2 -0
  29. package/esm2022/lib/c3-safe-url/pipes/c3-safe-url.pipe.mjs +21 -0
  30. package/esm2022/public-api.mjs +45 -0
  31. package/fesm2022/c3-components.mjs +1160 -0
  32. package/fesm2022/c3-components.mjs.map +1 -0
  33. package/index.d.ts +5 -0
  34. package/lib/c3-auto-animate/C3AutoAnimate.directive.d.ts +11 -0
  35. package/lib/c3-dialog/c3-dialog.module.d.ts +15 -0
  36. package/lib/c3-dialog/components/c3-dialog-confirm.component.d.ts +23 -0
  37. package/lib/c3-dialog/components/c3-dialog-embed-child.component.d.ts +18 -0
  38. package/lib/c3-dialog/components/c3-dialog-prompt.component.d.ts +31 -0
  39. package/lib/c3-dialog/services/c3-dialog.service.d.ts +18 -0
  40. package/lib/c3-dropdown/c3-dropdown.module.d.ts +10 -0
  41. package/lib/c3-dropdown/components/c3-dropdown.component.d.ts +15 -0
  42. package/lib/c3-dropdown/directives/c3-dropdown.trigger.d.ts +45 -0
  43. package/lib/c3-expansion/c3-expansion.module.d.ts +14 -0
  44. package/lib/c3-expansion/components/c3-expansion/c3-expansion.component.d.ts +13 -0
  45. package/lib/c3-expansion/components/c3-expansion-header/c3-expansion-header.component.d.ts +9 -0
  46. package/lib/c3-file-viewer/c3-file-viewer.module.d.ts +17 -0
  47. package/lib/c3-file-viewer/components/c3-file-viewer-actions/c3-file-viewer-actions.component.d.ts +8 -0
  48. package/lib/c3-file-viewer/components/c3-file-viewer-image/c3-file-viewer-image.component.d.ts +9 -0
  49. package/lib/c3-file-viewer/components/c3-file-viewer-pdf/c3-file-viewer-pdf.component.d.ts +9 -0
  50. package/lib/c3-file-viewer/components/c3-file-viewer-video/c3-file-viewer-video.component.d.ts +12 -0
  51. package/lib/c3-file-viewer/components/public/c3-file-viewer/c3-file-viewer.component.d.ts +25 -0
  52. package/lib/c3-file-viewer/components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.component.d.ts +12 -0
  53. package/lib/c3-file-viewer/components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.d.ts +8 -0
  54. package/lib/c3-file-viewer/consts/default.config.d.ts +2 -0
  55. package/lib/c3-file-viewer/directives/full-screen.directive.d.ts +12 -0
  56. package/lib/c3-file-viewer/models/custom-file-event.model.d.ts +5 -0
  57. package/lib/c3-file-viewer/models/file-metadata.d.ts +12 -0
  58. package/lib/c3-file-viewer/models/file-viewer-config.model.d.ts +48 -0
  59. package/lib/c3-file-viewer/models/file-viewer.d.ts +65 -0
  60. package/lib/c3-file-viewer/models/http.client.d.ts +14 -0
  61. package/lib/c3-safe-url/pipes/c3-safe-url.pipe.d.ts +10 -0
  62. package/package.json +13 -4
  63. package/{src/public-api.ts → public-api.d.ts} +0 -10
  64. package/CONTRIBUTING.md +0 -80
  65. package/bun.lockb +0 -0
  66. package/ng-package.json +0 -19
  67. package/src/lib/c3-auto-animate/C3AutoAnimate.directive.ts +0 -18
  68. package/src/lib/c3-dialog/c3-dialog.module.ts +0 -30
  69. package/src/lib/c3-dialog/components/c3-dialog-confirm.component.ts +0 -44
  70. package/src/lib/c3-dialog/components/c3-dialog-embed-child.component.ts +0 -40
  71. package/src/lib/c3-dialog/components/c3-dialog-prompt.component.ts +0 -81
  72. package/src/lib/c3-dialog/services/c3-dialog.service.ts +0 -87
  73. package/src/lib/c3-dropdown/c3-dropdown.module.ts +0 -12
  74. package/src/lib/c3-dropdown/components/c3-dropdown.component.spec.ts +0 -22
  75. package/src/lib/c3-dropdown/components/c3-dropdown.component.ts +0 -39
  76. package/src/lib/c3-dropdown/directives/c3-dropdown.trigger.ts +0 -161
  77. package/src/lib/c3-expansion/c3-expansion.module.ts +0 -24
  78. package/src/lib/c3-expansion/components/c3-expansion/c3-expansion.component.html +0 -9
  79. package/src/lib/c3-expansion/components/c3-expansion/c3-expansion.component.ts +0 -33
  80. package/src/lib/c3-expansion/components/c3-expansion-header/c3-expansion-header.component.html +0 -12
  81. package/src/lib/c3-expansion/components/c3-expansion-header/c3-expansion-header.component.ts +0 -21
  82. package/src/lib/c3-file/c3-download/c3-download.module.ts +0 -7
  83. package/src/lib/c3-file/c3-download/c3-download.service.ts +0 -16
  84. package/src/lib/c3-file/c3-input-file/c3-input-file.module.ts +0 -30
  85. package/src/lib/c3-file/c3-input-file/class/c3-input-file.ts +0 -62
  86. package/src/lib/c3-file/c3-input-file/components/c3-input-file/c3-input-file.component.html +0 -7
  87. package/src/lib/c3-file/c3-input-file/components/c3-input-file/c3-input-file.component.ts +0 -96
  88. package/src/lib/c3-file/c3-input-file/components/c3-input-file-container/c3-input-file-container.component.ts +0 -53
  89. package/src/lib/c3-file/c3-input-file/components/c3-input-file-displayer/c3-input-file-displayer.component.ts +0 -107
  90. package/src/lib/c3-file/c3-input-file/components/c3-input-file-trigger/c3-input-file-trigger.component.ts +0 -22
  91. package/src/lib/c3-file/c3-input-file/directives/c3-input-file-trigger.directive.ts +0 -27
  92. package/src/lib/c3-file-upload/c3-file-upload.module.ts +0 -8
  93. package/src/lib/c3-file-viewer/c3-file-viewer.module.ts +0 -30
  94. package/src/lib/c3-file-viewer/components/c3-file-viewer-actions/c3-file-viewer-actions.component.html +0 -185
  95. package/src/lib/c3-file-viewer/components/c3-file-viewer-actions/c3-file-viewer-actions.component.spec.ts +0 -23
  96. package/src/lib/c3-file-viewer/components/c3-file-viewer-actions/c3-file-viewer-actions.component.ts +0 -15
  97. package/src/lib/c3-file-viewer/components/c3-file-viewer-image/c3-file-viewer-image.component.html +0 -7
  98. package/src/lib/c3-file-viewer/components/c3-file-viewer-image/c3-file-viewer-image.component.spec.ts +0 -23
  99. package/src/lib/c3-file-viewer/components/c3-file-viewer-image/c3-file-viewer-image.component.ts +0 -14
  100. package/src/lib/c3-file-viewer/components/c3-file-viewer-pdf/c3-file-viewer-pdf.component.html +0 -7
  101. package/src/lib/c3-file-viewer/components/c3-file-viewer-pdf/c3-file-viewer-pdf.component.spec.ts +0 -23
  102. package/src/lib/c3-file-viewer/components/c3-file-viewer-pdf/c3-file-viewer-pdf.component.ts +0 -25
  103. package/src/lib/c3-file-viewer/components/c3-file-viewer-video/c3-file-viewer-video.component.css +0 -0
  104. package/src/lib/c3-file-viewer/components/c3-file-viewer-video/c3-file-viewer-video.component.html +0 -1
  105. package/src/lib/c3-file-viewer/components/c3-file-viewer-video/c3-file-viewer-video.component.spec.ts +0 -23
  106. package/src/lib/c3-file-viewer/components/c3-file-viewer-video/c3-file-viewer-video.component.ts +0 -35
  107. package/src/lib/c3-file-viewer/components/public/c3-file-viewer/c3-file-viewer.component.html +0 -32
  108. package/src/lib/c3-file-viewer/components/public/c3-file-viewer/c3-file-viewer.component.spec.ts +0 -23
  109. package/src/lib/c3-file-viewer/components/public/c3-file-viewer/c3-file-viewer.component.ts +0 -93
  110. package/src/lib/c3-file-viewer/components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.component.spec.ts +0 -23
  111. package/src/lib/c3-file-viewer/components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.component.ts +0 -37
  112. package/src/lib/c3-file-viewer/components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.spec.ts +0 -22
  113. package/src/lib/c3-file-viewer/components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.ts +0 -12
  114. package/src/lib/c3-file-viewer/consts/default.config.ts +0 -41
  115. package/src/lib/c3-file-viewer/directives/full-screen.directive.spec.ts +0 -11
  116. package/src/lib/c3-file-viewer/directives/full-screen.directive.ts +0 -68
  117. package/src/lib/c3-file-viewer/models/custom-file-event.model.ts +0 -9
  118. package/src/lib/c3-file-viewer/models/file-metadata.ts +0 -13
  119. package/src/lib/c3-file-viewer/models/file-viewer-config.model.ts +0 -53
  120. package/src/lib/c3-file-viewer/models/file-viewer.ts +0 -259
  121. package/src/lib/c3-file-viewer/models/http.client.ts +0 -23
  122. package/src/lib/c3-highlight-text/c3-highlight-text.module.ts +0 -12
  123. package/src/lib/c3-menu/c3-menu.module.ts +0 -12
  124. package/src/lib/c3-modal/c3-modal.module.ts +0 -12
  125. package/src/lib/c3-navbar/c3-navbar.module.ts +0 -12
  126. package/src/lib/c3-pdf-dialog/c3-pdf-dialog.module.ts +0 -12
  127. package/src/lib/c3-rounded-title/c3-rounded-title.module.ts +0 -12
  128. package/src/lib/c3-safe-url/pipes/c3-safe-url.pipe.spec.ts +0 -8
  129. package/src/lib/c3-safe-url/pipes/c3-safe-url.pipe.ts +0 -13
  130. package/src/lib/c3-tabs/c3-tabs.module.ts +0 -12
  131. package/tsconfig.lib.json +0 -14
  132. package/tsconfig.lib.prod.json +0 -10
  133. package/tsconfig.spec.json +0 -14
  134. /package/{src/_index.scss → _index.scss} +0 -0
  135. /package/{src/lib → lib}/c3-dropdown/styles/_c3-dropdown.sass +0 -0
  136. /package/{src/lib → lib}/c3-expansion/styles/_c3-expansion.scss +0 -0
  137. /package/{src/lib → lib}/c3-file/c3-input-file/components/c3-input-file/c3-input-file.component.scss +0 -0
  138. /package/{src/lib → lib}/c3-file-viewer/styles/_c3-file-viewer.sass +0 -0
  139. /package/{src/lib → lib}/c3-styles/_c3-core.sass +0 -0
  140. /package/{src/lib → lib}/c3-styles/_c3-root-variables.sass +0 -0
  141. /package/{src/lib → lib}/c3-styles/_utils.sass +0 -0
@@ -1,22 +0,0 @@
1
- import {
2
- Component,
3
- ViewEncapsulation,
4
- Output,
5
- EventEmitter,
6
- } from '@angular/core';
7
-
8
- @Component({
9
- selector: 'c3-input-file-trigger',
10
- template: `
11
- <button (click)="click($event)">Ajouter des fichiers....</button>
12
- `,
13
- styles: [],
14
- encapsulation: ViewEncapsulation.None,
15
- })
16
- export class C3InputFileTriggerComponent {
17
- @Output('click') clicked: EventEmitter<MouseEvent> = new EventEmitter();
18
-
19
- click($event: MouseEvent) {
20
- this.clicked.emit($event);
21
- }
22
- }
@@ -1,27 +0,0 @@
1
- import {
2
- Directive,
3
- Output,
4
- EventEmitter,
5
- ElementRef,
6
- AfterViewInit,
7
- OnDestroy,
8
- } from '@angular/core';
9
-
10
- @Directive({
11
- selector: '[c3InputFileTrigger], [c3-input-file-trigger]',
12
- })
13
- export class C3InputFileTriggerDirective implements AfterViewInit, OnDestroy {
14
- @Output() click: EventEmitter<MouseEvent> = new EventEmitter();
15
- constructor(private elementRef: ElementRef) {}
16
-
17
- ngAfterViewInit() {
18
- this.elementRef.nativeElement.addEventListener(
19
- 'click',
20
- ($event: MouseEvent) => this.click.emit($event)
21
- );
22
- }
23
-
24
- ngOnDestroy() {
25
- this.elementRef.nativeElement.removeEventListener('click', () => {});
26
- }
27
- }
@@ -1,8 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { CommonModule } from '@angular/common';
3
-
4
- @NgModule({
5
- declarations: [],
6
- imports: [CommonModule],
7
- })
8
- export class C3FileUploadModule {}
@@ -1,30 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { FullScreenDirective } from './directives/full-screen.directive';
3
- import { C3FileViewerComponent } from './components/public/c3-file-viewer/c3-file-viewer.component';
4
- import { CommonModule } from '@angular/common';
5
- import { C3FileViewerActionsComponent } from './components/c3-file-viewer-actions/c3-file-viewer-actions.component';
6
- import { C3FileViewerImageComponent } from './components/c3-file-viewer-image/c3-file-viewer-image.component';
7
- import { C3FileViewerPdfComponent } from './components/c3-file-viewer-pdf/c3-file-viewer-pdf.component';
8
- import { C3FileViewerVideoComponent } from './components/c3-file-viewer-video/c3-file-viewer-video.component';
9
- import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
10
- import { C3SafeUrlPipe } from '../../public-api';
11
- import { C3FileViewerDialogComponent } from './components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.component';
12
- import { MatDialogModule } from '@angular/material/dialog';
13
- import { C3FileViewerDialog } from './components/public/c3-file-viewer-dialog/c3-file-viewer-dialog';
14
-
15
- @NgModule({ declarations: [
16
- FullScreenDirective,
17
- C3FileViewerComponent,
18
- C3FileViewerActionsComponent,
19
- C3FileViewerImageComponent,
20
- C3FileViewerPdfComponent,
21
- C3FileViewerVideoComponent,
22
- C3FileViewerDialogComponent,
23
- C3FileViewerDialog,
24
- ],
25
- exports: [
26
- FullScreenDirective,
27
- C3FileViewerComponent,
28
- C3FileViewerDialogComponent,
29
- ], imports: [CommonModule, C3SafeUrlPipe, MatDialogModule], providers: [provideHttpClient(withInterceptorsFromDi())] })
30
- export class C3FileViewerModule {}
@@ -1,185 +0,0 @@
1
- <div class="nav-button-container">
2
- <button
3
- *ngIf="config.btnShow?.prev"
4
- type="button"
5
- [class]="config.btnClass"
6
- (click)="fileViewer.previousImage($event)"
7
- [disabled]="fileViewer.currentIndex === 0"
8
- >
9
- <span
10
- *ngIf="config.btnIcons?.prev?.classes"
11
- [class]="config.btnIcons?.prev?.classes"
12
- ></span>
13
- </button>
14
- <a
15
- [class]="config.btnClass"
16
- *ngIf="config.btnIcons?.prev?.text"
17
- (click)="fileViewer.previousImage($event)"
18
- >
19
- <span [class]="config.btnSubClass">{{ config.btnIcons?.prev?.text }}</span>
20
- </a>
21
- <button
22
- *ngIf="config.btnShow?.next"
23
- type="button"
24
- [class]="config.btnClass"
25
- (click)="fileViewer.nextImage($event)"
26
- [disabled]="fileViewer.currentIndex === fileViewer.files.length - 1"
27
- >
28
- <span
29
- *ngIf="config.btnIcons?.next?.classes"
30
- [class]="config.btnIcons?.next?.classes"
31
- ></span>
32
- </button>
33
- <a
34
- [class]="config.btnClass"
35
- *ngIf="config.btnIcons?.next?.text"
36
- (click)="fileViewer.nextImage($event)"
37
- >
38
- <span [class]="config.btnSubClass">{{ config.btnIcons?.next?.text }}</span>
39
- </a>
40
- </div>
41
-
42
- <!-- Button Container -->
43
- <div
44
- class="btn-container"
45
- [class]="config.btnContainerClass"
46
- *ngIf="fileViewer.currentFile.type.startsWith('image')"
47
- >
48
- <!-- Rotate Counter Clockwise -->
49
- <ng-container *ngIf="config.btnShow?.rotateCounterClockwise">
50
- <button
51
- type="button"
52
- [class]="config.btnClass"
53
- (click)="fileViewer.rotateCounterClockwise()"
54
- *ngIf="config.btnIcons?.rotateCounterClockwise?.classes"
55
- >
56
- <span [class]="config.btnIcons?.rotateCounterClockwise?.classes"></span>
57
- </button>
58
- <a
59
- [class]="config.btnClass"
60
- *ngIf="config.btnIcons?.rotateCounterClockwise?.text"
61
- (click)="fileViewer.rotateCounterClockwise()"
62
- >
63
- <span [class]="config.btnSubClass">{{
64
- config.btnIcons?.rotateCounterClockwise?.text
65
- }}</span>
66
- </a>
67
- </ng-container>
68
-
69
- <!-- Rotate Clockwise -->
70
- <ng-container *ngIf="config.btnShow?.rotateClockwise">
71
- <button
72
- type="button"
73
- [class]="config.btnClass"
74
- (click)="fileViewer.rotateClockwise()"
75
- *ngIf="config.btnIcons?.rotateClockwise?.classes"
76
- >
77
- <span [class]="config.btnIcons?.rotateClockwise?.classes"></span>
78
- </button>
79
- <a
80
- [class]="config.btnClass"
81
- *ngIf="config.btnIcons?.rotateClockwise?.text"
82
- (click)="fileViewer.rotateClockwise()"
83
- >
84
- <span [class]="config.btnSubClass">{{
85
- config.btnIcons?.rotateClockwise?.text
86
- }}</span>
87
- </a>
88
- </ng-container>
89
-
90
- <!-- Zoom Out -->
91
- <ng-container *ngIf="config.btnShow?.zoomOut">
92
- <button
93
- type="button"
94
- [class]="config.btnClass"
95
- (click)="fileViewer.zoomOut()"
96
- *ngIf="config.btnIcons?.zoomOut?.classes"
97
- >
98
- <span [class]="config.btnIcons?.zoomOut?.classes"></span>
99
- </button>
100
- <a
101
- [class]="config.btnClass"
102
- *ngIf="config.btnIcons?.zoomOut?.text"
103
- (click)="fileViewer.zoomOut()"
104
- >
105
- <span [class]="config.btnSubClass">{{
106
- config.btnIcons?.zoomOut?.text
107
- }}</span>
108
- </a>
109
- </ng-container>
110
-
111
- <!-- Zoom In -->
112
- <ng-container *ngIf="config.btnShow?.zoomIn">
113
- <button
114
- type="button"
115
- [class]="config.btnClass"
116
- (click)="fileViewer.zoomIn()"
117
- *ngIf="config.btnIcons?.zoomIn?.classes"
118
- >
119
- <span [class]="config.btnIcons?.zoomIn?.classes"></span>
120
- </button>
121
- <a
122
- [class]="config.btnClass"
123
- *ngIf="config.btnIcons?.zoomIn?.text"
124
- (click)="fileViewer.zoomIn()"
125
- >
126
- <span [class]="config.btnSubClass">{{
127
- config.btnIcons?.zoomIn?.text
128
- }}</span>
129
- </a>
130
- </ng-container>
131
-
132
- <!-- Fullscreen -->
133
- <ng-container *ngIf="config.allowFullscreen">
134
- <button
135
- type="button"
136
- [class]="config.btnClass"
137
- (click)="fileViewer.toggleFullscreen()"
138
- *ngIf="config.btnIcons?.fullscreen?.classes"
139
- >
140
- <span [class]="config.btnIcons?.fullscreen?.classes"></span>
141
- </button>
142
- <a
143
- [class]="config.btnClass"
144
- *ngIf="config.btnIcons?.fullscreen?.text"
145
- (click)="fileViewer.toggleFullscreen()"
146
- >
147
- <span [class]="config.btnSubClass">{{
148
- config.btnIcons?.fullscreen?.text
149
- }}</span>
150
- </a>
151
- </ng-container>
152
-
153
- <!-- Reset -->
154
- <ng-container *ngIf="config.btnShow?.reset">
155
- <button
156
- type="button"
157
- [class]="config.btnClass"
158
- (click)="fileViewer.reset()"
159
- *ngIf="config.btnIcons?.reset?.classes"
160
- >
161
- <span [class]="config.btnIcons?.reset?.classes"></span>
162
- </button>
163
- <a
164
- [class]="config.btnClass"
165
- *ngIf="config.btnIcons?.reset?.text"
166
- (click)="fileViewer.reset()"
167
- >
168
- <span [class]="config.btnSubClass">{{
169
- config.btnIcons?.reset?.text
170
- }}</span>
171
- </a>
172
- </ng-container>
173
-
174
- <!-- Custom Buttons -->
175
- <ng-container *ngFor="let cBtn of config.customBtns">
176
- <button *ngIf="cBtn.icon.classes" type="button" [class]="config.btnClass">
177
- <span *ngIf="cBtn.icon.classes" [class]="cBtn.icon.classes"></span>
178
- </button>
179
- <ng-container *ngIf="cBtn.icon.text">
180
- <a [class]="config.btnClass" *ngIf="cBtn.icon.text">
181
- <span [class]="config.btnSubClass">{{ cBtn.icon.text }}</span>
182
- </a>
183
- </ng-container>
184
- </ng-container>
185
- </div>
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { C3FileViewerActionsComponent } from './c3-file-viewer-actions.component';
4
-
5
- describe('C3FileViewerActionsComponent', () => {
6
- let component: C3FileViewerActionsComponent;
7
- let fixture: ComponentFixture<C3FileViewerActionsComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- declarations: [ C3FileViewerActionsComponent ]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(C3FileViewerActionsComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,15 +0,0 @@
1
- import { Component, Host, Input } from '@angular/core';
2
- import { C3FileViewer } from '../../models/file-viewer';
3
-
4
- @Component({
5
- selector: 'c3-file-viewer-actions',
6
- templateUrl: './c3-file-viewer-actions.component.html',
7
- })
8
- export class C3FileViewerActionsComponent {
9
- @Input()
10
- fileViewer!: C3FileViewer;
11
-
12
- get config() {
13
- return this.fileViewer.config;
14
- }
15
- }
@@ -1,7 +0,0 @@
1
- <img
2
- *ngIf="fileViewer.currentFile.objectUrl"
3
- [src]="fileViewer.currentFile.objectUrl | async | c3SafeUrl"
4
- [ngStyle]="fileViewer.style"
5
- alt="Image not found..."
6
- (dragstart)="dragstart.emit($event)"
7
- />
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { C3FileViewerImageComponent } from './c3-file-viewer-image.component';
4
-
5
- describe('C3FileViewerImageComponent', () => {
6
- let component: C3FileViewerImageComponent;
7
- let fixture: ComponentFixture<C3FileViewerImageComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- declarations: [ C3FileViewerImageComponent ]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(C3FileViewerImageComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,14 +0,0 @@
1
- import { Component, EventEmitter, Input, Output } from '@angular/core';
2
- import { C3FileViewer } from '../../models/file-viewer';
3
-
4
- @Component({
5
- selector: 'c3-file-viewer-image, [c3-file-viewer-image]',
6
- templateUrl: './c3-file-viewer-image.component.html',
7
- })
8
- export class C3FileViewerImageComponent {
9
- @Input()
10
- public fileViewer!: C3FileViewer;
11
-
12
- @Output()
13
- dragstart = new EventEmitter<DragEvent>();
14
- }
@@ -1,7 +0,0 @@
1
- <!-- pdf viewer -->
2
- <embed
3
- type="application/pdf"
4
- [src]="fileViewer.currentFile.objectUrl | async | c3SafeUrl"
5
- [style.height]="'100%'"
6
- [style.width]="'100%'"
7
- />
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { C3FileViewerPdfComponent } from './c3-file-viewer-pdf.component';
4
-
5
- describe('C3FileViewerPdfComponent', () => {
6
- let component: C3FileViewerPdfComponent;
7
- let fixture: ComponentFixture<C3FileViewerPdfComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- declarations: [ C3FileViewerPdfComponent ]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(C3FileViewerPdfComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,25 +0,0 @@
1
- import {
2
- Component,
3
- EventEmitter,
4
- Input,
5
- Output,
6
- ViewEncapsulation,
7
- } from '@angular/core';
8
- import { C3FileViewer } from '../../models/file-viewer';
9
-
10
- @Component({
11
- selector: 'c3-file-viewer-pdf',
12
- templateUrl: './c3-file-viewer-pdf.component.html',
13
- encapsulation: ViewEncapsulation.None,
14
- host: {
15
- style: 'display: block',
16
- class: 'c3-file-viewer-pdf',
17
- },
18
- })
19
- export class C3FileViewerPdfComponent {
20
- @Input()
21
- public fileViewer!: C3FileViewer;
22
-
23
- @Output()
24
- dragstart = new EventEmitter<DragEvent>();
25
- }
@@ -1 +0,0 @@
1
- <video controls [src]="src" crossorigin="*"></video>
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { C3FileViewerVideoComponent } from './c3-file-viewer-video.component';
4
-
5
- describe('C3FileViewerVideoComponent', () => {
6
- let component: C3FileViewerVideoComponent;
7
- let fixture: ComponentFixture<C3FileViewerVideoComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- declarations: [ C3FileViewerVideoComponent ]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(C3FileViewerVideoComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,35 +0,0 @@
1
- import { Component, Input } from '@angular/core';
2
- import { FileMetadata } from '../../models/file-metadata';
3
- import { Subject, filter, mergeMap, tap } from 'rxjs';
4
- import { C3FileViewer } from '../../models/file-viewer';
5
-
6
- @Component({
7
- selector: 'c3-file-viewer-video',
8
- templateUrl: './c3-file-viewer-video.component.html',
9
- })
10
- export class C3FileViewerVideoComponent {
11
- @Input('file')
12
- set _srcUpdated({ location }: FileMetadata) {
13
- this.src$.next(location);
14
- }
15
- src = '';
16
- private src$ = new Subject<string>();
17
-
18
- @Input()
19
- public fileViewer!: C3FileViewer;
20
-
21
- constructor() {
22
- this.src$
23
- .pipe(
24
- mergeMap((src) => this.fileViewer.getFile(src)),
25
- filter((blob) => blob.type.startsWith('application/pdf')),
26
- tap((blob) => (this.src = URL.createObjectURL(blob)))
27
- )
28
- .subscribe({
29
- next: () => null,
30
- error: (error) => {
31
- console.log(error);
32
- },
33
- });
34
- }
35
- }
@@ -1,32 +0,0 @@
1
- <div
2
- class="container"
3
- *ngIf="fileViewer"
4
- [c3-full-screen]="fileViewer.fullscreen$ | async"
5
- [style.height]="fileViewer.styleHeight"
6
- [style.backgroundColor]="fileViewer.config.containerBackgroundColor"
7
- (wheel)="fileViewer.scrollZoom($event)"
8
- (dragover)="fileViewer.onDragOver($event)"
9
- >
10
- <c3-file-viewer-image
11
- *ngIf="fileViewer.currentFile.type.startsWith('image')"
12
- [fileViewer]="fileViewer"
13
- [style]="fileViewer.style"
14
- (dragstart)="fileViewer.onDragStart($event)"
15
- />
16
-
17
- <c3-file-viewer-video
18
- *ngIf="fileViewer.currentFile.type.startsWith('video')"
19
- />
20
-
21
- <c3-file-viewer-pdf
22
- *ngIf="fileViewer.currentFile.type.startsWith('application/pdf')"
23
- [fileViewer]="fileViewer"
24
- />
25
- <!-- Div below will be used to hide the 'ghost' image when dragging -->
26
- <div></div>
27
- <div class="spinner-container" *ngIf="fileViewer.loading">
28
- <div class="spinner"></div>
29
- </div>
30
-
31
- <c3-file-viewer-actions [fileViewer]="fileViewer" />
32
- </div>
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { C3FileViewerComponent } from './c3-file-viewer.component';
4
-
5
- describe('C3FileViewerComponent', () => {
6
- let component: C3FileViewerComponent;
7
- let fixture: ComponentFixture<C3FileViewerComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- declarations: [ C3FileViewerComponent ]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(C3FileViewerComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,93 +0,0 @@
1
- import {
2
- Component,
3
- EventEmitter,
4
- HostListener,
5
- Inject,
6
- Input,
7
- OnInit,
8
- Optional,
9
- Output,
10
- SimpleChanges,
11
- ViewEncapsulation,
12
- } from '@angular/core';
13
- import { C3FileViewerConfig } from '../../../models/file-viewer-config.model';
14
- import { CustomFileEvent } from '../../../models/custom-file-event.model';
15
- import { HttpClient } from '@angular/common/http';
16
- import { C3FileViewer } from '../../../models/file-viewer';
17
-
18
- @Component({
19
- selector: 'c3-file-viewer',
20
- templateUrl: './c3-file-viewer.component.html',
21
- styleUrls: [],
22
- encapsulation: ViewEncapsulation.None,
23
- host: {
24
- class: 'c3-file-viewer',
25
- },
26
- })
27
- export class C3FileViewerComponent implements OnInit {
28
- @Input()
29
- public screenHeightOccupied?: 0; // In Px
30
-
31
- @Input()
32
- public fileViewer!: C3FileViewer;
33
-
34
- @Output()
35
- public indexChange: EventEmitter<number> = new EventEmitter();
36
-
37
- @Output()
38
- public configChange: EventEmitter<C3FileViewerConfig> = new EventEmitter();
39
-
40
- @Output()
41
- public customFileEvent: EventEmitter<CustomFileEvent> = new EventEmitter();
42
-
43
- constructor(
44
- @Optional() @Inject('config') public moduleConfig: C3FileViewerConfig,
45
- public _http: HttpClient
46
- ) {}
47
-
48
- ngOnInit() {
49
- this.defineStyleHeight();
50
-
51
- this.fileViewer.customFile$.subscribe((event) => {
52
- this.customFileEvent.emit(event);
53
- });
54
-
55
- this.fileViewer.index$.subscribe((index) => {
56
- this.indexChange.emit(index);
57
- });
58
-
59
- this.fileViewer.config$.subscribe((config) => {
60
- this.configChange.emit(config);
61
- });
62
- }
63
-
64
- @HostListener('mouseover')
65
- onMouseOver() {
66
- this.fileViewer.hovered = true;
67
- }
68
-
69
- @HostListener('mouseleave')
70
- onMouseLeave() {
71
- this.fileViewer.hovered = false;
72
- }
73
-
74
- ngOnChanges(changes: SimpleChanges) {
75
- if (changes['screenHeightOccupied'] && this.fileViewer)
76
- this.defineStyleHeight();
77
- }
78
-
79
- @HostListener('window:keyup.ArrowRight', ['$event'])
80
- next(event: KeyboardEvent) {
81
- this.fileViewer.nextImage(event);
82
- }
83
-
84
- @HostListener('window:keyup.ArrowLeft', ['$event'])
85
- previous(event: KeyboardEvent) {
86
- this.fileViewer.previousImage(event);
87
- }
88
-
89
- defineStyleHeight() {
90
- this.fileViewer.styleHeight =
91
- 'calc(100% - ' + this.screenHeightOccupied + 'px)';
92
- }
93
- }
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { C3FileViewerDialogComponent } from './c3-file-viewer-dialog.component';
4
-
5
- describe('C3FileViewerDialogComponent', () => {
6
- let component: C3FileViewerDialogComponent;
7
- let fixture: ComponentFixture<C3FileViewerDialogComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- declarations: [ C3FileViewerDialogComponent ]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(C3FileViewerDialogComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });