@wizco/fenixds-ngx 17.1.2 → 17.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.
@@ -1,7 +1,7 @@
1
1
  import * as i1 from '@angular/common';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { EventEmitter, Component, ViewEncapsulation, Input, Output, SkipSelf, ViewChild, ChangeDetectionStrategy, forwardRef, ContentChildren } from '@angular/core';
4
+ import { EventEmitter, Component, ViewEncapsulation, Input, Output, SkipSelf, ViewChild, ChangeDetectionStrategy, forwardRef, ContentChildren, signal } from '@angular/core';
5
5
  import * as i1$1 from '@angular/common/http';
6
6
  import { HttpEventType, HttpClientModule } from '@angular/common/http';
7
7
  import { trigger, transition, style, animate } from '@angular/animations';
@@ -522,11 +522,11 @@ class UploadComponent {
522
522
  event.dataTransfer.dropEffect = 'copy';
523
523
  }
524
524
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UploadComponent, deps: [{ token: i1$1.HttpClient, skipSelf: true }], target: i0.ɵɵFactoryTarget.Component });
525
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: UploadComponent, isStandalone: true, selector: "wco-file-upload", inputs: { description: "description", config: "config", resetUpload: "resetUpload" }, outputs: { ApiResponse: "apiResponse", fileSelected: "fileSelected" }, usesOnChanges: true, ngImport: i0, template: "<label for=\"sel{{id}}\" class=\"wco-form-upload\" (drop)=\"drop($event)\" (dragover)=\"allowDrop($event)\">\n <div class=\"wco-form-upload__info\">\n <span>Arraste-os aqui ou</span>\n <span>\n <span class=\"material-icons\">cloud_upload</span>\n <span>{{replaceTexts.selectFileBtn}}</span>\n </span>\n </div>\n <span class=\"upload__info\" *ngIf=\"!allowedFiles.length\" >{{description}}</span>\n <ng-container *ngIf=\"allowedFiles.length\">\n <span class=\"upload__info\" *ngFor=\"let sf of allowedFiles;let i=index\">\n {{sf.name}} <small>({{convertSize(sf.size)}})</small>\n </span>\n </ng-container>\n <input type=\"file\" id=\"sel{{id}}\" (change)=\"onChange($event)\" style=\"display: none\" title=\"Select file\"\n name=\"files[]\" [accept]=\"formatsAllowed\" [attr.multiple]=\"multiple ? '' : null\" />\n</label>", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: HttpClientModule }] });
525
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: UploadComponent, isStandalone: true, selector: "wco-file-upload", inputs: { description: "description", config: "config", resetUpload: "resetUpload" }, outputs: { ApiResponse: "apiResponse", fileSelected: "fileSelected" }, usesOnChanges: true, ngImport: i0, template: "<label for=\"sel{{id}}\" class=\"wco-form-upload\" (drop)=\"drop($event)\" (dragover)=\"allowDrop($event)\">\n <div class=\"wco-form-upload__info\">\n <span>Arraste-os aqui ou</span>\n <span>\n <span class=\"material-icons-outlined\">\nupload_file\n</span>\n <span>{{replaceTexts.selectFileBtn}}</span>\n </span>\n </div>\n <span class=\"upload__info\" *ngIf=\"!allowedFiles.length\" >{{description}}</span>\n <ng-container *ngIf=\"allowedFiles.length\">\n <span class=\"upload__info\" *ngFor=\"let sf of allowedFiles;let i=index\">\n {{sf.name}} <small>({{convertSize(sf.size)}})</small>\n </span>\n </ng-container>\n <input type=\"file\" id=\"sel{{id}}\" (change)=\"onChange($event)\" style=\"display: none\" title=\"Select file\"\n name=\"files[]\" [accept]=\"formatsAllowed\" [attr.multiple]=\"multiple ? '' : null\" />\n</label>", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: HttpClientModule }] });
526
526
  }
527
527
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UploadComponent, decorators: [{
528
528
  type: Component,
529
- args: [{ selector: 'wco-file-upload', standalone: true, imports: [CommonModule, HttpClientModule], template: "<label for=\"sel{{id}}\" class=\"wco-form-upload\" (drop)=\"drop($event)\" (dragover)=\"allowDrop($event)\">\n <div class=\"wco-form-upload__info\">\n <span>Arraste-os aqui ou</span>\n <span>\n <span class=\"material-icons\">cloud_upload</span>\n <span>{{replaceTexts.selectFileBtn}}</span>\n </span>\n </div>\n <span class=\"upload__info\" *ngIf=\"!allowedFiles.length\" >{{description}}</span>\n <ng-container *ngIf=\"allowedFiles.length\">\n <span class=\"upload__info\" *ngFor=\"let sf of allowedFiles;let i=index\">\n {{sf.name}} <small>({{convertSize(sf.size)}})</small>\n </span>\n </ng-container>\n <input type=\"file\" id=\"sel{{id}}\" (change)=\"onChange($event)\" style=\"display: none\" title=\"Select file\"\n name=\"files[]\" [accept]=\"formatsAllowed\" [attr.multiple]=\"multiple ? '' : null\" />\n</label>" }]
529
+ args: [{ selector: 'wco-file-upload', standalone: true, imports: [CommonModule, HttpClientModule], template: "<label for=\"sel{{id}}\" class=\"wco-form-upload\" (drop)=\"drop($event)\" (dragover)=\"allowDrop($event)\">\n <div class=\"wco-form-upload__info\">\n <span>Arraste-os aqui ou</span>\n <span>\n <span class=\"material-icons-outlined\">\nupload_file\n</span>\n <span>{{replaceTexts.selectFileBtn}}</span>\n </span>\n </div>\n <span class=\"upload__info\" *ngIf=\"!allowedFiles.length\" >{{description}}</span>\n <ng-container *ngIf=\"allowedFiles.length\">\n <span class=\"upload__info\" *ngFor=\"let sf of allowedFiles;let i=index\">\n {{sf.name}} <small>({{convertSize(sf.size)}})</small>\n </span>\n </ng-container>\n <input type=\"file\" id=\"sel{{id}}\" (change)=\"onChange($event)\" style=\"display: none\" title=\"Select file\"\n name=\"files[]\" [accept]=\"formatsAllowed\" [attr.multiple]=\"multiple ? '' : null\" />\n</label>" }]
530
530
  }], ctorParameters: function () { return [{ type: i1$1.HttpClient, decorators: [{
531
531
  type: SkipSelf
532
532
  }] }]; }, propDecorators: { description: [{
@@ -1355,6 +1355,211 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
1355
1355
  type: Input
1356
1356
  }] } });
1357
1357
 
1358
+ class PreviewFileComponent {
1359
+ sanitizer;
1360
+ ngZone;
1361
+ previewFileElement;
1362
+ /* Nome do arquivo (optioncal) */
1363
+ filename = '';
1364
+ /* Formato do arquivo (optional) */
1365
+ format = '';
1366
+ /* Mostrar previsualização do arquivo (optional) */
1367
+ preview = true;
1368
+ /* Ações disponíveis para o arquivo (optional) */
1369
+ actions;
1370
+ /* Status do arquivo (optional) */
1371
+ status;
1372
+ /* URL do arquivo (optional) */
1373
+ url = '';
1374
+ /* Conteúdo customizado (optional) */
1375
+ customContent = false;
1376
+ /* Tipo de visualização do arquivo (optional) */
1377
+ type = 'box';
1378
+ /* Título do arquivo (optional) */
1379
+ title = '';
1380
+ /* Arquivo para visualização nativo do input file */
1381
+ set setfile(file) {
1382
+ if (!file)
1383
+ return;
1384
+ this.transformFiles(file);
1385
+ }
1386
+ /* Evento de clique nas ações do arquivo */
1387
+ clickEvent = new EventEmitter();
1388
+ get name() {
1389
+ if (!!this.filename) {
1390
+ return this.filename;
1391
+ }
1392
+ if (!!this.url) {
1393
+ const url = new URL(this.url);
1394
+ const name = url.pathname.split('/').pop();
1395
+ const total = name ? name?.length >= 30 ? 15 : 0 : 0;
1396
+ return name?.substring(total, name.length);
1397
+ }
1398
+ return 'Nome não informado';
1399
+ }
1400
+ get _format() {
1401
+ if (!!this.format) {
1402
+ return this.format;
1403
+ }
1404
+ if (this.url) {
1405
+ const url = new URL(this.url);
1406
+ const format = url.pathname.split('.').pop();
1407
+ return format;
1408
+ }
1409
+ return 'file';
1410
+ }
1411
+ idRandom = 'preview-' + Math.random().toString(36).substring(7);
1412
+ id = 'modal-' + this.idRandom;
1413
+ y = signal('100px');
1414
+ x = signal('100px');
1415
+ constructor(sanitizer, ngZone) {
1416
+ this.sanitizer = sanitizer;
1417
+ this.ngZone = ngZone;
1418
+ }
1419
+ ngAfterViewChecked() {
1420
+ this.positionThumbnail();
1421
+ }
1422
+ transformFiles(file) {
1423
+ if (file) {
1424
+ const reader = new FileReader();
1425
+ reader.onload = (e) => {
1426
+ this.filename = file.name;
1427
+ this.format = file.type || 'file';
1428
+ this.url = e.target.result;
1429
+ };
1430
+ reader.readAsDataURL(file);
1431
+ }
1432
+ }
1433
+ transformPDFSecurity(url) {
1434
+ return this.sanitizer.bypassSecurityTrustResourceUrl(url);
1435
+ }
1436
+ positionThumbnail() {
1437
+ const previewFileElement = this.previewFileElement.nativeElement;
1438
+ const cardPosition = previewFileElement.getElementsByClassName('wco-previewFile--thumbl')[0];
1439
+ if (cardPosition) {
1440
+ const { x, y } = cardPosition.getBoundingClientRect();
1441
+ this.ngZone.runOutsideAngular(() => {
1442
+ setTimeout(() => {
1443
+ this.y.set(y + 'px');
1444
+ this.x.set(x + 'px');
1445
+ }, 1000);
1446
+ });
1447
+ }
1448
+ }
1449
+ actionEvent(action) {
1450
+ this.clickEvent.emit({
1451
+ action,
1452
+ data: {
1453
+ filename: this.filename,
1454
+ format: this.format,
1455
+ url: this.url,
1456
+ file: this.url,
1457
+ },
1458
+ });
1459
+ }
1460
+ ////////////////////
1461
+ // Eventos de modal
1462
+ ////////////////////
1463
+ modalPreview() {
1464
+ if (!!!this.url || this.typeFileFormat() === 'file') {
1465
+ return;
1466
+ }
1467
+ this.positionThumbnail();
1468
+ const modal = document.getElementById(this.id);
1469
+ modal?.showModal();
1470
+ }
1471
+ closeDialog() {
1472
+ const modal = document.getElementById(this.id);
1473
+ modal?.close();
1474
+ }
1475
+ ///////////////////////////////////
1476
+ /// Formatos e posições de ícones
1477
+ ///////////////////////////////////
1478
+ getIconMaterial(type) {
1479
+ const iconMap = {
1480
+ 'pdf': 'picture_as_pdf',
1481
+ 'application/pdf': 'picture_as_pdf',
1482
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': 'description',
1483
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'table_chart',
1484
+ 'application/vnd.openxmlformats-officedocument.presentationml.presentation': 'slideshow',
1485
+ 'image/jpeg': 'image',
1486
+ 'image/png': 'image',
1487
+ 'image/gif': 'image',
1488
+ 'image/bmp': 'image',
1489
+ 'image/webp': 'image',
1490
+ png: 'image',
1491
+ jpeg: 'image',
1492
+ gif: 'image',
1493
+ bmp: 'image',
1494
+ webp: 'image',
1495
+ 'video/mp4': 'ondemand_video',
1496
+ 'mp4': 'ondemand_video',
1497
+ 'video/quicktime': 'ondemand_video',
1498
+ 'video/x-msvideo': 'ondemand_video',
1499
+ 'video/x-ms-wmv': 'ondemand_video',
1500
+ 'audio/mpeg': 'audiotrack',
1501
+ 'audio/ogg': 'audiotrack',
1502
+ 'audio/wav': 'audiotrack',
1503
+ 'audio/webm': 'audiotrack',
1504
+ };
1505
+ return iconMap[type] || 'insert_drive_file';
1506
+ }
1507
+ typeFileFormat() {
1508
+ const format = this._format || 'file';
1509
+ const typeMap = {
1510
+ pdf: 'pdf',
1511
+ 'application/pdf': 'pdf',
1512
+ 'image/jpeg': 'image',
1513
+ 'image/png': 'image',
1514
+ 'image/gif': 'image',
1515
+ 'image/bmp': 'image',
1516
+ 'image/webp': 'image',
1517
+ png: 'image',
1518
+ jpeg: 'image',
1519
+ jpg: 'image',
1520
+ gif: 'image',
1521
+ bmp: 'image',
1522
+ webp: 'image',
1523
+ mp4: 'video',
1524
+ mov: 'video',
1525
+ 'video/mp4': 'video',
1526
+ 'video/quicktime': 'video'
1527
+ };
1528
+ return typeMap[format] || 'file';
1529
+ }
1530
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PreviewFileComponent, deps: [{ token: i1$3.DomSanitizer }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
1531
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: PreviewFileComponent, isStandalone: true, selector: "wco-preview-file", inputs: { filename: "filename", format: "format", preview: "preview", actions: "actions", status: "status", url: "url", customContent: "customContent", type: "type", title: "title", setfile: "setfile" }, outputs: { clickEvent: "clickEvent" }, viewQueries: [{ propertyName: "previewFileElement", first: true, predicate: ["previewFileElement"], descendants: true }], ngImport: i0, template: "<div [class]=\"'wco-previewFile wco-previewFile-type' + type\" #previewFileElement>\n <h4 *ngIf=\"title\" class=\"display-body bold\">{{ title }}</h4>\n\n <div [class]=\"'wco-previewFile--thumbl type-file-' + typeFileFormat()\" [id]=\"idRandom\">\n <span class=\"wco-previewFile-preview\" (click)=\"preview ? modalPreview() : null\" role=\"button\" tabindex=\"0\">\n <ng-container *ngIf=\"typeFileFormat() === 'image' && !!url\">\n <img [src]=\"url\" alt=\"Imagem do documento\" loading=\"lazy\" role=\"img\">\n </ng-container>\n <ng-container *ngIf=\"typeFileFormat() !== 'image' || !url\">\n <span class=\"material-icons\" role=\"presentation\">{{ getIconMaterial(format) }}</span>\n </ng-container>\n </span>\n <h5 (click)=\"preview ? modalPreview() : null\" role=\"heading\" aria-level=\"2\">\n {{ name }}</h5>\n </div>\n\n <div class=\"wco-previewFile__action\">\n <div class=\"wco-previewFile__action--status\" *ngIf=\"!customContent\">\n <ng-container *ngIf=\"status && status.type && status.text\">\n <span [class]=\"'wco-tag tag-' + status.type\" role=\"status\">\n <span *ngIf=\"status.iconMaterial\" class=\"material-icons\" role=\"presentation\">{{ status.iconMaterial }}</span>\n {{ status.text }}\n </span>\n <div>\n <h6 *ngIf=\"status.prefixDescription\">\n <strong>{{ status.prefixDescription }}</strong>\n </h6>\n <p *ngIf=\"status.description\">{{ status.description }}</p>\n </div>\n </ng-container>\n </div>\n <div class=\"wco-previewFile__action--buttons\" *ngIf=\"!customContent\">\n <ng-container *ngIf=\"!customContent && !!actions?.length\">\n <ng-container>\n <button *ngIf=\"actions.includes('refresh')\" (click)=\"actionEvent('refresh')\"\n class=\"wco-btn btn-primary btn-outline btn-sm\" role=\"button\" tabindex=\"0\">\n <span class=\"material-icons\" role=\"presentation\">cached</span>\n Reenviar\n </button>\n <button *ngIf=\"actions.includes('aproved')\" (click)=\"actionEvent('aproved')\"\n class=\"wco-btn btn-primary btn-outline btn-sm\" role=\"button\" tabindex=\"0\">\n Aprovar\n <span class=\"material-icons\" role=\"presentation\">done</span>\n </button>\n <button *ngIf=\"actions.includes('reproved')\" (click)=\"actionEvent('reproved')\"\n class=\"wco-btn btn-primary btn-outline btn-sm\" role=\"button\" tabindex=\"0\">\n Recusar\n <span class=\"material-icons\" role=\"presentation\">close</span>\n </button>\n <div *ngIf=\"actions.includes('download') || actions.includes('delete') \" class=\"wco-previewFile__action--buttonsIcon\">\n <button *ngIf=\"actions.includes('download')\" (click)=\"actionEvent('download')\" class=\"wco-previewFile--buttonIcon\"\n role=\"button\" tabindex=\"0\">\n <span class=\"material-icons-outlined\" role=\"presentation\">file_download</span>\n </button>\n <button *ngIf=\"actions.includes('delete')\" (click)=\"actionEvent('delete')\"\n class=\"wco-previewFile__action--buttonIcon\" role=\"button\" tabindex=\"0\">\n <span class=\"material-icons-outlined\" role=\"presentation\">delete</span>\n </button>\n </div>\n </ng-container>\n </ng-container>\n </div>\n\n <div *ngIf=\"customContent\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n\n<ng-container *ngIf=\"preview && x() && y()\">\n <dialog [id]=\"id\" [ngStyle]=\"{'--dialog-x': x(), '--dialog-y': y()}\" role=\"dialog\" aria-modal=\"true\">\n <div>\n <div class=\"dialog-content\">\n <img *ngIf=\"typeFileFormat() === 'image'\" [src]=\"url\" alt=\"Imagem do documento\" loading=\"lazy\" role=\"img\">\n <video *ngIf=\"typeFileFormat() === 'video'\" [src]=\"url\" controls role=\"video\"></video>\n <iframe *ngIf=\"typeFileFormat() === 'pdf'\" [src]=\"transformPDFSecurity(url)\" role=\"document\"></iframe>\n </div>\n <div class=\"w-full flex justify-center my-xxs\">\n <button (click)=\"closeDialog()\" class=\"wco-btn btn-primary btn-sm\" role=\"button\" tabindex=\"0\">Fechar</button>\n </div>\n </div>\n </dialog>\n</ng-container>", styles: [":host{display:block;container-type:inline-size;width:100%}.wco-previewFile{--wco-previewFile-text-color: var(--wco-color-neutral-700, #4A4A4A);--wco-previewFile-bg: var(--wco-color-neutral-50, #F9F9F9);--wco-previewFile-title-align: center;--wco-previewFile-border-color: var(--wco-color-neutral-500, #E0E0E0);width:100%;display:grid;grid-template-columns:minmax(auto,300px) 1fr;align-items:center;min-height:64px;gap:var(--wco-spacing-xxs, 16px)}.wco-previewFile>h4{grid-column:span 2}@container (width < 600px){.wco-previewFile{gap:var(--wco-spacing-sm, 16px)}.wco-previewFile h4{text-align:center}}.wco-previewFile.wco-previewFile-typebox{border:1px solid var(--wco-previewFile-border-color);background-color:var(--wco-previewFile-bg);border-radius:var(--wco-radius-md);padding:var(--wco-spacing-xxs, 16px)}.wco-previewFile:has(.wco-previewFile__action--status>div p){--wco-previewFile-title-align: flex-start}.wco-previewFile:has(.wco-previewFile__action--status:empty) .wco-previewFile__action--status{display:none}.wco-previewFile:has(.wco-previewFile__action--status:empty) .wco-previewFile__action--buttons{width:100%;justify-content:flex-end}.wco-previewFile:has(.wco-previewFile__action--buttons:empty) .wco-previewFile__action--buttons{display:none}.wco-previewFile:has(.wco-previewFile__action--status:empty):has(.wco-previewFile__action--buttons:empty) .wco-previewFile--thumbl{grid-column:span 2}.wco-previewFile:has(.wco-previewFile__action--status:empty):has(.wco-previewFile__action--buttons:empty) .wco-previewFile__action{display:none}.wco-previewFile--thumbl{display:flex;align-items:var(--wco-previewFile-title-align);height:100%;gap:var(--wco-spacing-nano, 8px)}@container (width < 600px){.wco-previewFile--thumbl{grid-column:span 2}}.wco-previewFile--thumbl.type-file-image,.wco-previewFile--thumbl.type-file-pdf{cursor:pointer}.wco-previewFile--thumbl.type-file-image h5,.wco-previewFile--thumbl.type-file-pdf h5{text-decoration:underline;cursor:pointer}.wco-previewFile--thumbl.type-file-image h5:hover,.wco-previewFile--thumbl.type-file-pdf h5:hover{color:var(--wco-color-info-600)}.wco-previewFile--thumbl .wco-previewFile-preview{display:flex;align-items:center;color:var(--wco-color-neutral-900)}.wco-previewFile--thumbl .wco-previewFile-preview:has(img){width:64px;height:64px;overflow:hidden;border-radius:var(--wco-radius-md);background-color:var(--wco-color-neutral-700);padding:var(--wco-spacing-quark)}.wco-previewFile--thumbl .wco-previewFile-preview:has(img) img{width:100%;height:100%;object-fit:contain}.wco-previewFile__action{display:flex;justify-content:space-between;align-items:center;gap:var(--wco-spacing-sm, 16px);flex-wrap:wrap}@container (width < 600px){.wco-previewFile__action{grid-column:span 2;flex-direction:column;flex-wrap:wrap}}.wco-previewFile__action--status{display:flex;flex-direction:column;gap:var(--wco-spacing-xxxs, 8px)}.wco-previewFile__action--status>div:empty{display:none}@container (width < 600px){.wco-previewFile__action--status .wco-tag{width:100%}}.wco-previewFile__action--status h6,.wco-previewFile__action--status p{font-size:var(--wco-font-size-xs, 16px);color:var(--wco-previewFile-text-color);display:inline-flex}.wco-previewFile__action--status h6~p{margin-left:var(--wco-spacing-quark, 8px)}.wco-previewFile__action--buttons{display:flex;gap:var(--wco-spacing-xxs, 16px)}@container (width < 600px){.wco-previewFile__action--buttons{gap:var(--wco-spacing-xxxs, 12px);flex-wrap:wrap;flex-direction:column;width:100%;justify-content:center;align-items:center}.wco-previewFile__action--buttons button{width:100%;max-width:300px}}.wco-previewFile__action--buttonsIcon{display:flex;gap:var(--wco-spacing-nano, 8px)}@container (width < 600px){.wco-previewFile__action--buttonsIcon{gap:var(--wco-spacing-xxs, 8px)}}.wco-previewFile__action--buttonsIcon button{background:none;border:none;cursor:pointer;padding:var(--wco-spacing-nano, 8px);color:var(--wco-color-primary-600);display:flex;align-items:center;gap:var(--wco-spacing-nano, 8px)}.wco-previewFile__action--buttonsIcon button:hover{color:var(--wco-color-primary-700)}.wco-previewFile h5{font-size:var(--wco-font-size-sm, 18px);font-weight:400;line-height:var(--wco-font-lineheight-500, 150%);letter-spacing:.45px;color:var(--wco-previewFile-text-color);white-space:normal;text-wrap:pretty;width:100%}@container (width < 600px){.wco-previewFile h5{font-size:var(--wco-font-size-xxs, 16px)}}::ng-deep wco-preview-file~wco-preview-file{margin-top:var(--wco-spacing-xs, 16px)}.dialog-content{width:100%;display:flex;align-items:center;justify-content:center}.dialog-content:has(img){max-width:80vw;max-height:80vh}.dialog-content:has(img) img{max-width:100%;max-height:inherit}.dialog-content:has(iframe){width:90vw;height:70vh}.dialog-content:has(iframe) iframe{width:100%;height:100%}dialog{transition:opacity 7s ease-in-out,transform 7s ease-in-out,overlay 4s ease-in-out allow-discrete,display 4s ease-in-out allow-discrete}dialog:not(open)>div{border-radius:var(--wco-radius-sm);padding:10px;background-color:var(--wco-color-neutral-50);box-shadow:var(--wco-shadow-level-2);position:fixed;transform-origin:top left;transition:all .3s ease-in-out;opacity:0;top:var(--dialog-y);left:var(--dialog-x);transform:scale(.2)}@media screen and (max-width: 768px){dialog:not(open)>div{min-width:90vw}}dialog[open]{opacity:1;background-color:transparent;box-shadow:none}dialog[open]>div{transform:translateY(-50%) translate(-50%) scale(1);top:50%;left:50%;opacity:1}@media (max-width: 768px){dialog[open]{max-width:80vw}}@starting-style{dialog[open]{opacity:0}}dialog::backdrop{background-color:#0000;transition:display .1s allow-discrete,overlay .1s allow-discrete,background-color .1s}dialog[open]::backdrop{background-color:#00000059}@starting-style{dialog[open]::backdrop{background-color:#0000}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
1532
+ }
1533
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PreviewFileComponent, decorators: [{
1534
+ type: Component,
1535
+ args: [{ selector: 'wco-preview-file', standalone: true, imports: [CommonModule], template: "<div [class]=\"'wco-previewFile wco-previewFile-type' + type\" #previewFileElement>\n <h4 *ngIf=\"title\" class=\"display-body bold\">{{ title }}</h4>\n\n <div [class]=\"'wco-previewFile--thumbl type-file-' + typeFileFormat()\" [id]=\"idRandom\">\n <span class=\"wco-previewFile-preview\" (click)=\"preview ? modalPreview() : null\" role=\"button\" tabindex=\"0\">\n <ng-container *ngIf=\"typeFileFormat() === 'image' && !!url\">\n <img [src]=\"url\" alt=\"Imagem do documento\" loading=\"lazy\" role=\"img\">\n </ng-container>\n <ng-container *ngIf=\"typeFileFormat() !== 'image' || !url\">\n <span class=\"material-icons\" role=\"presentation\">{{ getIconMaterial(format) }}</span>\n </ng-container>\n </span>\n <h5 (click)=\"preview ? modalPreview() : null\" role=\"heading\" aria-level=\"2\">\n {{ name }}</h5>\n </div>\n\n <div class=\"wco-previewFile__action\">\n <div class=\"wco-previewFile__action--status\" *ngIf=\"!customContent\">\n <ng-container *ngIf=\"status && status.type && status.text\">\n <span [class]=\"'wco-tag tag-' + status.type\" role=\"status\">\n <span *ngIf=\"status.iconMaterial\" class=\"material-icons\" role=\"presentation\">{{ status.iconMaterial }}</span>\n {{ status.text }}\n </span>\n <div>\n <h6 *ngIf=\"status.prefixDescription\">\n <strong>{{ status.prefixDescription }}</strong>\n </h6>\n <p *ngIf=\"status.description\">{{ status.description }}</p>\n </div>\n </ng-container>\n </div>\n <div class=\"wco-previewFile__action--buttons\" *ngIf=\"!customContent\">\n <ng-container *ngIf=\"!customContent && !!actions?.length\">\n <ng-container>\n <button *ngIf=\"actions.includes('refresh')\" (click)=\"actionEvent('refresh')\"\n class=\"wco-btn btn-primary btn-outline btn-sm\" role=\"button\" tabindex=\"0\">\n <span class=\"material-icons\" role=\"presentation\">cached</span>\n Reenviar\n </button>\n <button *ngIf=\"actions.includes('aproved')\" (click)=\"actionEvent('aproved')\"\n class=\"wco-btn btn-primary btn-outline btn-sm\" role=\"button\" tabindex=\"0\">\n Aprovar\n <span class=\"material-icons\" role=\"presentation\">done</span>\n </button>\n <button *ngIf=\"actions.includes('reproved')\" (click)=\"actionEvent('reproved')\"\n class=\"wco-btn btn-primary btn-outline btn-sm\" role=\"button\" tabindex=\"0\">\n Recusar\n <span class=\"material-icons\" role=\"presentation\">close</span>\n </button>\n <div *ngIf=\"actions.includes('download') || actions.includes('delete') \" class=\"wco-previewFile__action--buttonsIcon\">\n <button *ngIf=\"actions.includes('download')\" (click)=\"actionEvent('download')\" class=\"wco-previewFile--buttonIcon\"\n role=\"button\" tabindex=\"0\">\n <span class=\"material-icons-outlined\" role=\"presentation\">file_download</span>\n </button>\n <button *ngIf=\"actions.includes('delete')\" (click)=\"actionEvent('delete')\"\n class=\"wco-previewFile__action--buttonIcon\" role=\"button\" tabindex=\"0\">\n <span class=\"material-icons-outlined\" role=\"presentation\">delete</span>\n </button>\n </div>\n </ng-container>\n </ng-container>\n </div>\n\n <div *ngIf=\"customContent\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n\n<ng-container *ngIf=\"preview && x() && y()\">\n <dialog [id]=\"id\" [ngStyle]=\"{'--dialog-x': x(), '--dialog-y': y()}\" role=\"dialog\" aria-modal=\"true\">\n <div>\n <div class=\"dialog-content\">\n <img *ngIf=\"typeFileFormat() === 'image'\" [src]=\"url\" alt=\"Imagem do documento\" loading=\"lazy\" role=\"img\">\n <video *ngIf=\"typeFileFormat() === 'video'\" [src]=\"url\" controls role=\"video\"></video>\n <iframe *ngIf=\"typeFileFormat() === 'pdf'\" [src]=\"transformPDFSecurity(url)\" role=\"document\"></iframe>\n </div>\n <div class=\"w-full flex justify-center my-xxs\">\n <button (click)=\"closeDialog()\" class=\"wco-btn btn-primary btn-sm\" role=\"button\" tabindex=\"0\">Fechar</button>\n </div>\n </div>\n </dialog>\n</ng-container>", styles: [":host{display:block;container-type:inline-size;width:100%}.wco-previewFile{--wco-previewFile-text-color: var(--wco-color-neutral-700, #4A4A4A);--wco-previewFile-bg: var(--wco-color-neutral-50, #F9F9F9);--wco-previewFile-title-align: center;--wco-previewFile-border-color: var(--wco-color-neutral-500, #E0E0E0);width:100%;display:grid;grid-template-columns:minmax(auto,300px) 1fr;align-items:center;min-height:64px;gap:var(--wco-spacing-xxs, 16px)}.wco-previewFile>h4{grid-column:span 2}@container (width < 600px){.wco-previewFile{gap:var(--wco-spacing-sm, 16px)}.wco-previewFile h4{text-align:center}}.wco-previewFile.wco-previewFile-typebox{border:1px solid var(--wco-previewFile-border-color);background-color:var(--wco-previewFile-bg);border-radius:var(--wco-radius-md);padding:var(--wco-spacing-xxs, 16px)}.wco-previewFile:has(.wco-previewFile__action--status>div p){--wco-previewFile-title-align: flex-start}.wco-previewFile:has(.wco-previewFile__action--status:empty) .wco-previewFile__action--status{display:none}.wco-previewFile:has(.wco-previewFile__action--status:empty) .wco-previewFile__action--buttons{width:100%;justify-content:flex-end}.wco-previewFile:has(.wco-previewFile__action--buttons:empty) .wco-previewFile__action--buttons{display:none}.wco-previewFile:has(.wco-previewFile__action--status:empty):has(.wco-previewFile__action--buttons:empty) .wco-previewFile--thumbl{grid-column:span 2}.wco-previewFile:has(.wco-previewFile__action--status:empty):has(.wco-previewFile__action--buttons:empty) .wco-previewFile__action{display:none}.wco-previewFile--thumbl{display:flex;align-items:var(--wco-previewFile-title-align);height:100%;gap:var(--wco-spacing-nano, 8px)}@container (width < 600px){.wco-previewFile--thumbl{grid-column:span 2}}.wco-previewFile--thumbl.type-file-image,.wco-previewFile--thumbl.type-file-pdf{cursor:pointer}.wco-previewFile--thumbl.type-file-image h5,.wco-previewFile--thumbl.type-file-pdf h5{text-decoration:underline;cursor:pointer}.wco-previewFile--thumbl.type-file-image h5:hover,.wco-previewFile--thumbl.type-file-pdf h5:hover{color:var(--wco-color-info-600)}.wco-previewFile--thumbl .wco-previewFile-preview{display:flex;align-items:center;color:var(--wco-color-neutral-900)}.wco-previewFile--thumbl .wco-previewFile-preview:has(img){width:64px;height:64px;overflow:hidden;border-radius:var(--wco-radius-md);background-color:var(--wco-color-neutral-700);padding:var(--wco-spacing-quark)}.wco-previewFile--thumbl .wco-previewFile-preview:has(img) img{width:100%;height:100%;object-fit:contain}.wco-previewFile__action{display:flex;justify-content:space-between;align-items:center;gap:var(--wco-spacing-sm, 16px);flex-wrap:wrap}@container (width < 600px){.wco-previewFile__action{grid-column:span 2;flex-direction:column;flex-wrap:wrap}}.wco-previewFile__action--status{display:flex;flex-direction:column;gap:var(--wco-spacing-xxxs, 8px)}.wco-previewFile__action--status>div:empty{display:none}@container (width < 600px){.wco-previewFile__action--status .wco-tag{width:100%}}.wco-previewFile__action--status h6,.wco-previewFile__action--status p{font-size:var(--wco-font-size-xs, 16px);color:var(--wco-previewFile-text-color);display:inline-flex}.wco-previewFile__action--status h6~p{margin-left:var(--wco-spacing-quark, 8px)}.wco-previewFile__action--buttons{display:flex;gap:var(--wco-spacing-xxs, 16px)}@container (width < 600px){.wco-previewFile__action--buttons{gap:var(--wco-spacing-xxxs, 12px);flex-wrap:wrap;flex-direction:column;width:100%;justify-content:center;align-items:center}.wco-previewFile__action--buttons button{width:100%;max-width:300px}}.wco-previewFile__action--buttonsIcon{display:flex;gap:var(--wco-spacing-nano, 8px)}@container (width < 600px){.wco-previewFile__action--buttonsIcon{gap:var(--wco-spacing-xxs, 8px)}}.wco-previewFile__action--buttonsIcon button{background:none;border:none;cursor:pointer;padding:var(--wco-spacing-nano, 8px);color:var(--wco-color-primary-600);display:flex;align-items:center;gap:var(--wco-spacing-nano, 8px)}.wco-previewFile__action--buttonsIcon button:hover{color:var(--wco-color-primary-700)}.wco-previewFile h5{font-size:var(--wco-font-size-sm, 18px);font-weight:400;line-height:var(--wco-font-lineheight-500, 150%);letter-spacing:.45px;color:var(--wco-previewFile-text-color);white-space:normal;text-wrap:pretty;width:100%}@container (width < 600px){.wco-previewFile h5{font-size:var(--wco-font-size-xxs, 16px)}}::ng-deep wco-preview-file~wco-preview-file{margin-top:var(--wco-spacing-xs, 16px)}.dialog-content{width:100%;display:flex;align-items:center;justify-content:center}.dialog-content:has(img){max-width:80vw;max-height:80vh}.dialog-content:has(img) img{max-width:100%;max-height:inherit}.dialog-content:has(iframe){width:90vw;height:70vh}.dialog-content:has(iframe) iframe{width:100%;height:100%}dialog{transition:opacity 7s ease-in-out,transform 7s ease-in-out,overlay 4s ease-in-out allow-discrete,display 4s ease-in-out allow-discrete}dialog:not(open)>div{border-radius:var(--wco-radius-sm);padding:10px;background-color:var(--wco-color-neutral-50);box-shadow:var(--wco-shadow-level-2);position:fixed;transform-origin:top left;transition:all .3s ease-in-out;opacity:0;top:var(--dialog-y);left:var(--dialog-x);transform:scale(.2)}@media screen and (max-width: 768px){dialog:not(open)>div{min-width:90vw}}dialog[open]{opacity:1;background-color:transparent;box-shadow:none}dialog[open]>div{transform:translateY(-50%) translate(-50%) scale(1);top:50%;left:50%;opacity:1}@media (max-width: 768px){dialog[open]{max-width:80vw}}@starting-style{dialog[open]{opacity:0}}dialog::backdrop{background-color:#0000;transition:display .1s allow-discrete,overlay .1s allow-discrete,background-color .1s}dialog[open]::backdrop{background-color:#00000059}@starting-style{dialog[open]::backdrop{background-color:#0000}}\n"] }]
1536
+ }], ctorParameters: function () { return [{ type: i1$3.DomSanitizer }, { type: i0.NgZone }]; }, propDecorators: { previewFileElement: [{
1537
+ type: ViewChild,
1538
+ args: ['previewFileElement', { static: false }]
1539
+ }], filename: [{
1540
+ type: Input
1541
+ }], format: [{
1542
+ type: Input
1543
+ }], preview: [{
1544
+ type: Input
1545
+ }], actions: [{
1546
+ type: Input
1547
+ }], status: [{
1548
+ type: Input
1549
+ }], url: [{
1550
+ type: Input
1551
+ }], customContent: [{
1552
+ type: Input
1553
+ }], type: [{
1554
+ type: Input
1555
+ }], title: [{
1556
+ type: Input
1557
+ }], setfile: [{
1558
+ type: Input
1559
+ }], clickEvent: [{
1560
+ type: Output
1561
+ }] } });
1562
+
1358
1563
  /*
1359
1564
  * Public API Surface of ngx-fenixds
1360
1565
  */
@@ -1363,5 +1568,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
1363
1568
  * Generated bundle index. Do not edit.
1364
1569
  */
1365
1570
 
1366
- export { MsgBoxFeedbackComponent, PaginationComponent, SmartSelectComponent, SmartSelectOptionComponent, StepComponent, StepperComponent, TabsComponent, TimelineComponent, UploadComponent, UserAvatarComponent };
1571
+ export { MsgBoxFeedbackComponent, PaginationComponent, PreviewFileComponent, SmartSelectComponent, SmartSelectOptionComponent, StepComponent, StepperComponent, TabsComponent, TimelineComponent, UploadComponent, UserAvatarComponent };
1367
1572
  //# sourceMappingURL=wizco-fenixds-ngx.mjs.map