c3-components 0.1.1 → 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.
Files changed (23) hide show
  1. package/esm2022/lib/c3-file-displayer/c3-file-display-card/c3-file-display-card.component.mjs +26 -0
  2. package/esm2022/lib/c3-file-displayer/c3-file-display-grid/c3-file-display-grid.component.mjs +44 -0
  3. package/esm2022/lib/c3-file-displayer/c3-file-display-icon/c3-file-display-icon.component.mjs +56 -0
  4. package/esm2022/lib/c3-file-displayer/c3-file-display-list/c3-file-display-list.component.mjs +60 -0
  5. package/esm2022/lib/c3-file-displayer/c3-file-displayer.module.mjs +43 -0
  6. package/esm2022/lib/c3-file-viewer/models/file-viewer.mjs +7 -7
  7. package/esm2022/public-api.mjs +9 -2
  8. package/fesm2022/c3-components.mjs +194 -29
  9. package/fesm2022/c3-components.mjs.map +1 -1
  10. package/lib/c3-file-displayer/c3-file-display-card/c3-file-display-card.component.d.ts +14 -0
  11. package/lib/c3-file-displayer/c3-file-display-card/c3-file-display-card.component.scss +34 -0
  12. package/lib/c3-file-displayer/c3-file-display-grid/c3-file-display-grid.component.d.ts +19 -0
  13. package/lib/c3-file-displayer/c3-file-display-grid/c3-file-display-grid.component.scss +9 -0
  14. package/lib/c3-file-displayer/c3-file-display-icon/c3-file-display-icon.component.d.ts +8 -0
  15. package/lib/c3-file-displayer/c3-file-display-icon/c3-file-display-icon.component.scss +19 -0
  16. package/lib/c3-file-displayer/c3-file-display-list/c3-file-display-list.component.d.ts +19 -0
  17. package/lib/c3-file-displayer/c3-file-display-list/c3-file-display-list.component.scss +28 -0
  18. package/lib/c3-file-displayer/c3-file-displayer.module.d.ts +11 -0
  19. package/lib/c3-file-viewer/models/file-viewer.d.ts +5 -2
  20. package/package.json +1 -1
  21. package/public-api.d.ts +8 -1
  22. package/esm2022/lib/c3-signals/c3-signal.mjs +0 -24
  23. package/lib/c3-signals/c3-signal.d.ts +0 -11
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { TemplateRef, Component, ViewChild, Input, forwardRef, Directive, HostListener, NgModule, Inject, signal, ViewContainerRef, inject, Injector, effect, Injectable, Pipe, EventEmitter, Output, ViewEncapsulation, Optional, input, HostBinding, model } from '@angular/core';
2
+ import { TemplateRef, Component, ViewChild, Input, forwardRef, Directive, HostListener, NgModule, Inject, signal, ViewContainerRef, inject, Injector, effect, Injectable, Pipe, EventEmitter, Output, ViewEncapsulation, Optional, input, output, viewChild, computed, HostBinding, model } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import * as i2$1 from '@angular/forms';
@@ -24,8 +24,11 @@ import * as i5$1 from '@angular/material/toolbar';
24
24
  import { MatToolbarModule } from '@angular/material/toolbar';
25
25
  import 'reflect-metadata';
26
26
  import * as i1$4 from '@angular/common/http';
27
- import { HttpClient, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
27
+ import { provideHttpClient, withInterceptorsFromDi, HttpClient } from '@angular/common/http';
28
28
  import * as i1$3 from '@angular/platform-browser';
29
+ import { MatNativeDateModule } from '@angular/material/core';
30
+ import * as i5$2 from '@angular/material/menu';
31
+ import { MatMenuModule } from '@angular/material/menu';
29
32
  import * as i4$1 from '@angular/material/tooltip';
30
33
  import { MatTooltipModule } from '@angular/material/tooltip';
31
34
  import autoAnimate from '@formkit/auto-animate';
@@ -900,16 +903,17 @@ class C3FileViewer {
900
903
  this.currentIndex = 0;
901
904
  this.index$.next(this.currentIndex);
902
905
  this.filesObjectUrl = value.map((file) => {
906
+ const objectUrl = file.objectUrl || this.createObjectURL(file);
903
907
  return {
904
908
  ...file,
905
- objectUrl: file.objectUrl || this.createObjectURL(file),
909
+ objectUrl,
906
910
  };
907
911
  });
908
912
  }
909
913
  get files() {
910
914
  return this._files;
911
915
  }
912
- constructor({ config, files, }) {
916
+ constructor({ config, files, client, }) {
913
917
  this._config = DEFAULT_CONFIG;
914
918
  this.config$ = new BehaviorSubject(DEFAULT_CONFIG);
915
919
  this.fullscreen$ = new BehaviorSubject(false);
@@ -943,6 +947,8 @@ class C3FileViewer {
943
947
  this.config = config;
944
948
  if (files)
945
949
  this.files = files;
950
+ if (client)
951
+ this.client = client.get.bind(client);
946
952
  this.config$.subscribe((config) => {
947
953
  const { minHeight, maxHeight, minWidth, maxWidth, height, width } = config;
948
954
  this.style.minHeight = this.valueToCss(minHeight);
@@ -960,8 +966,7 @@ class C3FileViewer {
960
966
  return this.getFile(file.location).pipe(map((response) => URL.createObjectURL(response)), tap(() => this.onLoad(file)));
961
967
  }
962
968
  getFile(location) {
963
- const client = this.config.customClient ||
964
- inject(HttpClient).get.bind(inject(HttpClient));
969
+ const client = this.config.customClient || this.client;
965
970
  if (!client) {
966
971
  throw new Error('No http client provided. Please provide a custom client or import HttpClientModule');
967
972
  }
@@ -1179,6 +1184,188 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImpor
1179
1184
  }]
1180
1185
  }] });
1181
1186
 
1187
+ class C3FileDisplayCardComponent {
1188
+ constructor() {
1189
+ this.fileObjectUrl = input.required();
1190
+ this.deletable = input(false);
1191
+ this.size = input('32');
1192
+ this.onDelete = output();
1193
+ effect(() => {
1194
+ console.log('fileObjectUrl', this.fileObjectUrl());
1195
+ });
1196
+ }
1197
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: C3FileDisplayCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1198
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.1", type: C3FileDisplayCardComponent, isStandalone: true, selector: "c3-file-display-card", inputs: { fileObjectUrl: { classPropertyName: "fileObjectUrl", publicName: "fileObjectUrl", isSignal: true, isRequired: true, transformFunction: null }, deletable: { classPropertyName: "deletable", publicName: "deletable", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onDelete: "onDelete" }, ngImport: i0, template: "<button\n class=\"file-card border\"\n [class.size-16]=\"size() === '16'\"\n [class.size-32]=\"size() === '32'\"\n [class.size-64]=\"size() === '64'\"\n [class.size-128]=\"size() === '128'\"\n [class.size-256]=\"size() === '256'\"\n>\n @if(deletable()) {\n <div class=\"actions\">\n <button mat-icon-button color=\"red\" (click)=\"onDelete.emit()\">\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n } @if(fileObjectUrl()) { @if(fileObjectUrl()!.type.startsWith('image')) {\n <img\n class=\"h-full w-full object-cover\"\n [src]=\"(fileObjectUrl()!.objectUrl | async) || '/default-image.svg'\"\n [alt]=\"fileObjectUrl()!.name\"\n />\n } @else if (fileObjectUrl()!.type.startsWith('application')) {\n <mat-icon> file-pdf-box </mat-icon>\n } @else if (fileObjectUrl()!.type.startsWith('video')) {\n <mat-icon> video </mat-icon>\n }\n\n <div class=\"informations flex justify-between items-center\">\n <span class=\"text-xs text-white\">\n {{ fileObjectUrl()!.name }}\n </span>\n </div>\n }\n</button>\n", styles: [":host{display:block}:host .file-card{position:relative;border-radius:4px;border:1px solid #e0e0e0;overflow:auto}:host .file-card .actions{position:absolute;top:-21px;right:-21px;z-index:1;display:none}:host .file-card img{border-radius:4px}:host .file-card:hover .actions{display:block}:host .file-card .informations{position:absolute;bottom:0;left:0;z-index:1;width:100%;background:#00000080;padding:0 4px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
1199
+ }
1200
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: C3FileDisplayCardComponent, decorators: [{
1201
+ type: Component,
1202
+ args: [{ selector: 'c3-file-display-card', standalone: true, imports: [CommonModule, MatButtonModule, MatIconModule], template: "<button\n class=\"file-card border\"\n [class.size-16]=\"size() === '16'\"\n [class.size-32]=\"size() === '32'\"\n [class.size-64]=\"size() === '64'\"\n [class.size-128]=\"size() === '128'\"\n [class.size-256]=\"size() === '256'\"\n>\n @if(deletable()) {\n <div class=\"actions\">\n <button mat-icon-button color=\"red\" (click)=\"onDelete.emit()\">\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n } @if(fileObjectUrl()) { @if(fileObjectUrl()!.type.startsWith('image')) {\n <img\n class=\"h-full w-full object-cover\"\n [src]=\"(fileObjectUrl()!.objectUrl | async) || '/default-image.svg'\"\n [alt]=\"fileObjectUrl()!.name\"\n />\n } @else if (fileObjectUrl()!.type.startsWith('application')) {\n <mat-icon> file-pdf-box </mat-icon>\n } @else if (fileObjectUrl()!.type.startsWith('video')) {\n <mat-icon> video </mat-icon>\n }\n\n <div class=\"informations flex justify-between items-center\">\n <span class=\"text-xs text-white\">\n {{ fileObjectUrl()!.name }}\n </span>\n </div>\n }\n</button>\n", styles: [":host{display:block}:host .file-card{position:relative;border-radius:4px;border:1px solid #e0e0e0;overflow:auto}:host .file-card .actions{position:absolute;top:-21px;right:-21px;z-index:1;display:none}:host .file-card img{border-radius:4px}:host .file-card:hover .actions{display:block}:host .file-card .informations{position:absolute;bottom:0;left:0;z-index:1;width:100%;background:#00000080;padding:0 4px}\n"] }]
1203
+ }], ctorParameters: () => [] });
1204
+
1205
+ class C3FileDisplayGridComponent {
1206
+ constructor() {
1207
+ this.files = input.required();
1208
+ this.config = input();
1209
+ this.deletable = input(false);
1210
+ this.onDelete = output();
1211
+ this.dialog = viewChild(C3FileViewerDialogComponent);
1212
+ this.fileViewer = new C3FileViewer({
1213
+ client: inject(HttpClient),
1214
+ });
1215
+ effect(() => {
1216
+ this.fileViewer.files = this.files();
1217
+ }, {
1218
+ allowSignalWrites: true,
1219
+ });
1220
+ effect(() => {
1221
+ if (this.config())
1222
+ this.fileViewer.config = this.config();
1223
+ }, {
1224
+ allowSignalWrites: true,
1225
+ });
1226
+ }
1227
+ openDialog($event, index) {
1228
+ $event.stopPropagation();
1229
+ this.fileViewer.currentIndex = index;
1230
+ this.dialog()?.openDialog();
1231
+ }
1232
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: C3FileDisplayGridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1233
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.1", type: C3FileDisplayGridComponent, isStandalone: true, selector: "c3-file-display-grid", inputs: { files: { classPropertyName: "files", publicName: "files", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, deletable: { classPropertyName: "deletable", publicName: "deletable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onDelete: "onDelete" }, viewQueries: [{ propertyName: "dialog", first: true, predicate: C3FileViewerDialogComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<c3-file-viewer-dialog [fileViewer]=\"fileViewer\">\n <div class=\"c3-file-display-grid\">\n @for (file of files(); track $index) {\n <c3-file-display-card\n [fileObjectUrl]=\"fileViewer.filesObjectUrl[$index]\"\n (click)=\"openDialog($event, $index)\"\n (onDelete)=\"onDelete.emit(file)\"\n />\n }\n </div>\n</c3-file-viewer-dialog>\n", styles: [":host{display:block}:host .c3-file-display-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));grid-gap:10px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: C3FileDisplayCardComponent, selector: "c3-file-display-card", inputs: ["fileObjectUrl", "deletable", "size"], outputs: ["onDelete"] }, { kind: "ngmodule", type: C3FileViewerModule }, { kind: "component", type: C3FileViewerDialogComponent, selector: "c3-file-viewer-dialog", inputs: ["fileViewer", "dialogConfig"] }] }); }
1234
+ }
1235
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: C3FileDisplayGridComponent, decorators: [{
1236
+ type: Component,
1237
+ args: [{ selector: 'c3-file-display-grid', standalone: true, imports: [CommonModule, C3FileDisplayCardComponent, C3FileViewerModule], template: "<c3-file-viewer-dialog [fileViewer]=\"fileViewer\">\n <div class=\"c3-file-display-grid\">\n @for (file of files(); track $index) {\n <c3-file-display-card\n [fileObjectUrl]=\"fileViewer.filesObjectUrl[$index]\"\n (click)=\"openDialog($event, $index)\"\n (onDelete)=\"onDelete.emit(file)\"\n />\n }\n </div>\n</c3-file-viewer-dialog>\n", styles: [":host{display:block}:host .c3-file-display-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));grid-gap:10px}\n"] }]
1238
+ }], ctorParameters: () => [] });
1239
+
1240
+ class C3FileDisplayIconComponent {
1241
+ constructor() {
1242
+ this.fileType = input.required();
1243
+ this.displayedIcon = computed(() => {
1244
+ switch (this.fileType()) {
1245
+ case 'image/webp':
1246
+ case 'image/png':
1247
+ case 'image/jpeg':
1248
+ case 'image/jpg':
1249
+ return 'image';
1250
+ case 'video/mp4':
1251
+ case 'video/webm':
1252
+ return 'play_circle';
1253
+ case 'application/pdf':
1254
+ return 'picture_as_pdf';
1255
+ case 'application/msword':
1256
+ case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':
1257
+ return 'description';
1258
+ default:
1259
+ return 'content_copy';
1260
+ }
1261
+ });
1262
+ this.color = computed(() => {
1263
+ switch (this.fileType()) {
1264
+ case 'image/webp':
1265
+ case 'image/png':
1266
+ case 'image/jpeg':
1267
+ case 'image/jpg':
1268
+ return 'text-primary';
1269
+ case 'video/mp4':
1270
+ case 'video/webm':
1271
+ return 'text-secondary';
1272
+ case 'application/pdf':
1273
+ return 'text-error';
1274
+ case 'application/msword':
1275
+ case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':
1276
+ return 'text-success';
1277
+ default:
1278
+ return 'text-gray';
1279
+ }
1280
+ });
1281
+ }
1282
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: C3FileDisplayIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1283
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.0.1", type: C3FileDisplayIconComponent, isStandalone: true, selector: "c3-file-display-icon", inputs: { fileType: { classPropertyName: "fileType", publicName: "fileType", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<mat-icon [ngClass]=\"color()\">{{ displayedIcon() }}</mat-icon>\n", styles: [":host{display:block}:host .text-primary{color:var(--primary-color)}:host .text-secondary{color:var(--secondary-color)}:host .text-success{color:var(--success-color)}:host .text-gray{color:var(--gray-color)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
1284
+ }
1285
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: C3FileDisplayIconComponent, decorators: [{
1286
+ type: Component,
1287
+ args: [{ selector: 'c3-file-display-icon', standalone: true, imports: [CommonModule, MatIconModule], template: "<mat-icon [ngClass]=\"color()\">{{ displayedIcon() }}</mat-icon>\n", styles: [":host{display:block}:host .text-primary{color:var(--primary-color)}:host .text-secondary{color:var(--secondary-color)}:host .text-success{color:var(--success-color)}:host .text-gray{color:var(--gray-color)}\n"] }]
1288
+ }] });
1289
+
1290
+ class C3FileDisplayListComponent {
1291
+ constructor() {
1292
+ this.files = input.required();
1293
+ this.config = input();
1294
+ this.deletable = input(false);
1295
+ this.onDelete = output();
1296
+ this.dialog = viewChild(C3FileViewerDialogComponent);
1297
+ this.fileViewer = new C3FileViewer({
1298
+ client: inject(HttpClient),
1299
+ });
1300
+ effect(() => {
1301
+ this.fileViewer.files = this.files();
1302
+ }, {
1303
+ allowSignalWrites: true,
1304
+ });
1305
+ effect(() => {
1306
+ if (this.config())
1307
+ this.fileViewer.config = this.config();
1308
+ }, {
1309
+ allowSignalWrites: true,
1310
+ });
1311
+ }
1312
+ openDialog($event, index) {
1313
+ $event.stopPropagation();
1314
+ this.fileViewer.currentIndex = index;
1315
+ this.dialog()?.openDialog();
1316
+ }
1317
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: C3FileDisplayListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1318
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.1", type: C3FileDisplayListComponent, isStandalone: true, selector: "c3-file-display-list", inputs: { files: { classPropertyName: "files", publicName: "files", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, deletable: { classPropertyName: "deletable", publicName: "deletable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onDelete: "onDelete" }, viewQueries: [{ propertyName: "dialog", first: true, predicate: C3FileViewerDialogComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<!-- header -->\n<div class=\"header border-b dark:border-gray-500\">\n <div class=\"title full\">\n <span>Nom</span>\n </div>\n <div class=\"title\">\n <span>Date d'ajout</span>\n </div>\n <div class=\"icon\">\n <mat-icon>more_vert</mat-icon>\n </div>\n</div>\n<c3-file-viewer-dialog [fileViewer]=\"fileViewer\">\n <div class=\"file-display-list\">\n @for (file of files(); track $index) {\n <button\n class=\"flex w-full h-12 items-center border-b dark:border-gray-500 hover:bg-gray-100 dark:hover:bg-gray-800 text-start px-2\"\n >\n <div class=\"basis-[56px] w-[56px]\">\n <c3-file-display-icon [fileType]=\"file.type\" />\n </div>\n <div class=\"flex-auto basis-[304px] w-[304px]\">\n <span>{{ file.name }}</span>\n </div>\n <div class=\"basis-[304px] w-[304px]\">\n <span>{{\n file.lastModified ? (file.lastModified | date : \"medium\") : \"-\"\n }}</span>\n </div>\n <div class=\"basis-[48px] w-[48px]\">\n <button mat-icon-button>\n <mat-icon>more_vert</mat-icon>\n </button>\n <mat-menu #menu=\"matMenu\">\n <button mat-menu-item (click)=\"openDialog($event, $index)\">\n Ouvrir\n </button>\n @if (deletable()) {\n <button mat-menu-item (click)=\"onDelete.emit(file)\">Supprimer</button>\n }\n </mat-menu>\n </div>\n </button>\n }\n </div>\n</c3-file-viewer-dialog>\n", styles: [":host{display:flex;flex-direction:column;margin:.5rem}:host .header{display:flex;align-items:center;padding:0 .5rem;border-bottom:1px solid var(--mat-divider-color)}:host .header .title{flex-basis:304px;width:304px;font-size:1.5rem;font-weight:700}:host .header .title.full{flex:auto}:host .header .icon{flex-basis:40px;width:40px}\n"], dependencies: [{ kind: "ngmodule", type: C3FileViewerModule }, { kind: "component", type: C3FileViewerDialogComponent, selector: "c3-file-viewer-dialog", inputs: ["fileViewer", "dialogConfig"] }, { kind: "component", type: C3FileDisplayIconComponent, selector: "c3-file-display-icon", inputs: ["fileType"] }, { kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1.DatePipe, name: "date" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatNativeDateModule }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i5$2.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i5$2.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }] }); }
1319
+ }
1320
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: C3FileDisplayListComponent, decorators: [{
1321
+ type: Component,
1322
+ args: [{ selector: 'c3-file-display-list', standalone: true, imports: [
1323
+ C3FileViewerModule,
1324
+ C3FileDisplayIconComponent,
1325
+ CommonModule,
1326
+ MatButtonModule,
1327
+ MatIconModule,
1328
+ MatNativeDateModule,
1329
+ MatMenuModule,
1330
+ ], template: "<!-- header -->\n<div class=\"header border-b dark:border-gray-500\">\n <div class=\"title full\">\n <span>Nom</span>\n </div>\n <div class=\"title\">\n <span>Date d'ajout</span>\n </div>\n <div class=\"icon\">\n <mat-icon>more_vert</mat-icon>\n </div>\n</div>\n<c3-file-viewer-dialog [fileViewer]=\"fileViewer\">\n <div class=\"file-display-list\">\n @for (file of files(); track $index) {\n <button\n class=\"flex w-full h-12 items-center border-b dark:border-gray-500 hover:bg-gray-100 dark:hover:bg-gray-800 text-start px-2\"\n >\n <div class=\"basis-[56px] w-[56px]\">\n <c3-file-display-icon [fileType]=\"file.type\" />\n </div>\n <div class=\"flex-auto basis-[304px] w-[304px]\">\n <span>{{ file.name }}</span>\n </div>\n <div class=\"basis-[304px] w-[304px]\">\n <span>{{\n file.lastModified ? (file.lastModified | date : \"medium\") : \"-\"\n }}</span>\n </div>\n <div class=\"basis-[48px] w-[48px]\">\n <button mat-icon-button>\n <mat-icon>more_vert</mat-icon>\n </button>\n <mat-menu #menu=\"matMenu\">\n <button mat-menu-item (click)=\"openDialog($event, $index)\">\n Ouvrir\n </button>\n @if (deletable()) {\n <button mat-menu-item (click)=\"onDelete.emit(file)\">Supprimer</button>\n }\n </mat-menu>\n </div>\n </button>\n }\n </div>\n</c3-file-viewer-dialog>\n", styles: [":host{display:flex;flex-direction:column;margin:.5rem}:host .header{display:flex;align-items:center;padding:0 .5rem;border-bottom:1px solid var(--mat-divider-color)}:host .header .title{flex-basis:304px;width:304px;font-size:1.5rem;font-weight:700}:host .header .title.full{flex:auto}:host .header .icon{flex-basis:40px;width:40px}\n"] }]
1331
+ }], ctorParameters: () => [] });
1332
+
1333
+ class C3FileDisplayerModule {
1334
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: C3FileDisplayerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1335
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.1", ngImport: i0, type: C3FileDisplayerModule, imports: [CommonModule,
1336
+ C3FileDisplayGridComponent,
1337
+ C3FileDisplayListComponent,
1338
+ C3FileDisplayCardComponent,
1339
+ C3FileDisplayIconComponent], exports: [C3FileDisplayGridComponent,
1340
+ C3FileDisplayListComponent,
1341
+ C3FileDisplayCardComponent,
1342
+ C3FileDisplayIconComponent] }); }
1343
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: C3FileDisplayerModule, imports: [CommonModule,
1344
+ C3FileDisplayGridComponent,
1345
+ C3FileDisplayListComponent,
1346
+ C3FileDisplayCardComponent,
1347
+ C3FileDisplayIconComponent] }); }
1348
+ }
1349
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: C3FileDisplayerModule, decorators: [{
1350
+ type: NgModule,
1351
+ args: [{
1352
+ declarations: [],
1353
+ imports: [
1354
+ CommonModule,
1355
+ C3FileDisplayGridComponent,
1356
+ C3FileDisplayListComponent,
1357
+ C3FileDisplayCardComponent,
1358
+ C3FileDisplayIconComponent,
1359
+ ],
1360
+ exports: [
1361
+ C3FileDisplayGridComponent,
1362
+ C3FileDisplayListComponent,
1363
+ C3FileDisplayCardComponent,
1364
+ C3FileDisplayIconComponent,
1365
+ ],
1366
+ }]
1367
+ }] });
1368
+
1182
1369
  class C3ExpansionHeaderComponent {
1183
1370
  constructor() {
1184
1371
  this.title = input();
@@ -1324,28 +1511,6 @@ function booleanSignal(value) {
1324
1511
  return new BooleanSignal(value);
1325
1512
  }
1326
1513
 
1327
- class C3Signal {
1328
- constructor(initialValue) {
1329
- this.value$ = new Subject();
1330
- this._signal = signal(initialValue);
1331
- effect(() => {
1332
- this.value$.next(this._signal());
1333
- });
1334
- }
1335
- get value() {
1336
- return this._signal();
1337
- }
1338
- set value(newValue) {
1339
- this._signal.set(newValue);
1340
- }
1341
- update(updateFn) {
1342
- this._signal.update(updateFn);
1343
- }
1344
- }
1345
- function c3Signal(initialValue) {
1346
- return new C3Signal(initialValue);
1347
- }
1348
-
1349
1514
  /*
1350
1515
  * Public API Surface of c3-components
1351
1516
  */
@@ -1354,5 +1519,5 @@ function c3Signal(initialValue) {
1354
1519
  * Generated bundle index. Do not edit.
1355
1520
  */
1356
1521
 
1357
- export { C3AutoAnimateDirective, C3DialogEmbedChildComponent, C3DialogModule, C3DialogService, C3DropdownComponent, C3DropdownModule, C3DropdownTrigger, C3ExpansionComponent, C3ExpansionHeaderComponent, C3ExpansionModule, C3FileViewer, C3FileViewerComponent, C3FileViewerDialog, C3FileViewerDialogComponent, C3FileViewerModule, C3PromptDialogComponent, C3SafeUrlPipe, C3SelectOnFocusDirective, ConfirmDialogComponent, CustomFileEvent, FullScreenDirective, MAT_DROPDOWN_VALUE_ACCESSOR, booleanSignal, c3Signal };
1522
+ export { C3AutoAnimateDirective, C3DialogEmbedChildComponent, C3DialogModule, C3DialogService, C3DropdownComponent, C3DropdownModule, C3DropdownTrigger, C3ExpansionComponent, C3ExpansionHeaderComponent, C3ExpansionModule, C3FileDisplayCardComponent, C3FileDisplayGridComponent, C3FileDisplayIconComponent, C3FileDisplayListComponent, C3FileDisplayerModule, C3FileViewer, C3FileViewerComponent, C3FileViewerDialog, C3FileViewerDialogComponent, C3FileViewerModule, C3PromptDialogComponent, C3SafeUrlPipe, C3SelectOnFocusDirective, ConfirmDialogComponent, CustomFileEvent, FullScreenDirective, MAT_DROPDOWN_VALUE_ACCESSOR, booleanSignal };
1358
1523
  //# sourceMappingURL=c3-components.mjs.map