@n-isi-platform/design-system 1.0.26 → 1.0.28

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.
@@ -1216,7 +1216,6 @@ class InputComponent {
1216
1216
  alpha = /^[A-Za-zCcŠšŽžÐdČčĆćÀ-ÿyx\s]+$/;
1217
1217
  numbersOnly = /^[0-9]*$/;
1218
1218
  alphanumeric = /^[0-9A-Za-zCcŠšŽžÐdČčĆćÀ-ÿyx\s]+$/;
1219
- email = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
1220
1219
  ngOnInit() {
1221
1220
  this._isTooltipVisible = !!this.tooltipText;
1222
1221
  if (this.type === InputType.alpha) {
@@ -1228,9 +1227,6 @@ class InputComponent {
1228
1227
  else if (this.type === InputType.alphaNumeric) {
1229
1228
  this.pKeyFilter = this.alphanumeric;
1230
1229
  }
1231
- else if (this.type === InputType.email) {
1232
- this.pKeyFilter = this.email;
1233
- }
1234
1230
  }
1235
1231
  onNumberKeyDown(event) {
1236
1232
  const invalidKeys = ['e', 'E', '+', '-', ',', '.'];
@@ -2582,7 +2578,10 @@ class FileUploadComponent {
2582
2578
  translateService;
2583
2579
  ButtonSize = ButtonSize;
2584
2580
  ButtonColor = ButtonColor;
2581
+ postavkaPregledaId;
2582
+ // Can include new Files (without id) and existing backend attachments (with id)
2585
2583
  uploadedFiles = [];
2584
+ /* @Input() uploadedFiles: { id: number; imeDatoteke: string; }[] = []; */
2586
2585
  maxFileSize = 10000000;
2587
2586
  totalMaxFileSize = 20000000;
2588
2587
  disabled = false;
@@ -2592,6 +2591,9 @@ class FileUploadComponent {
2592
2591
  onDelete = new EventEmitter();
2593
2592
  onDownload = new EventEmitter();
2594
2593
  valid = new EventEmitter();
2594
+ isCameraVisible = false;
2595
+ openCamera() { this.isCameraVisible = true; }
2596
+ closeCamera() { this.isCameraVisible = false; }
2595
2597
  // File upload
2596
2598
  fileList = [];
2597
2599
  totalSize = 0;
@@ -2604,18 +2606,46 @@ class FileUploadComponent {
2604
2606
  this.translateService = translateService;
2605
2607
  }
2606
2608
  onSelectedFiles(event) {
2607
- this.fileList = event.currentFiles;
2609
+ const currentFiles = event?.currentFiles ?? [];
2610
+ const sanitizedFiles = currentFiles.map((file) => this.sanitizeFile(file));
2611
+ this.fileList = sanitizedFiles;
2608
2612
  this.onSaveFile.emit(this.fileList);
2609
2613
  this.calculateFileSize();
2610
2614
  }
2615
+ sanitizeFile(file) {
2616
+ const lastDotIndex = file.name.lastIndexOf('.');
2617
+ const baseName = lastDotIndex > -1 ? file.name.slice(0, lastDotIndex) : file.name;
2618
+ const extension = lastDotIndex > -1 ? file.name.slice(lastDotIndex + 1) : '';
2619
+ let sanitizedBase = baseName.replace(/[^0-9A-Za-zCcŠšŽžÐdČčĆćÀ-ÿyx\s]/g, '');
2620
+ sanitizedBase = sanitizedBase.replace(/\s+/g, "");
2621
+ const sanitizedExtension = extension.replace(/[^A-Za-z0-9]/g, '');
2622
+ const sanitizedName = sanitizedExtension
2623
+ ? `${sanitizedBase || 'file'}.${sanitizedExtension}`
2624
+ : sanitizedBase || 'file';
2625
+ if (sanitizedName === file.name) {
2626
+ return file;
2627
+ }
2628
+ return new File([file], sanitizedName, {
2629
+ type: file.type,
2630
+ lastModified: file.lastModified,
2631
+ });
2632
+ }
2611
2633
  // Unified display name
2612
2634
  getDisplayName(item) {
2613
2635
  if (item instanceof File)
2614
2636
  return item.name;
2615
2637
  return item.name ?? item.imeDatoteke ?? '';
2616
2638
  }
2617
- delete(fileId) {
2618
- this.onDelete.emit(fileId);
2639
+ // Retrieve backend id if present, else undefined for temp files
2640
+ getPrilogaId(item) {
2641
+ if (item instanceof File)
2642
+ return undefined;
2643
+ return item.id;
2644
+ }
2645
+ delete(fileOrId) {
2646
+ const id = typeof fileOrId === 'number' ? fileOrId : this.getPrilogaId(fileOrId);
2647
+ if (id != null)
2648
+ this.onDelete.emit(id);
2619
2649
  }
2620
2650
  formatSize(bytes) {
2621
2651
  const k = 1024;
@@ -2641,8 +2671,11 @@ class FileUploadComponent {
2641
2671
  this.totalSize -= this.totalSize -= parseInt(this.formatSize(priloga.size));
2642
2672
  this.totalSizePercent = this.totalSize / 10;
2643
2673
  }
2644
- downloadFile(id, name) {
2645
- this.onDownload.emit({ id, name });
2674
+ downloadFile(priloga) {
2675
+ const id = this.getPrilogaId(priloga);
2676
+ if (id != null) {
2677
+ this.onDownload.emit({ id, name: this.getDisplayName(priloga) });
2678
+ }
2646
2679
  }
2647
2680
  // Helper to know if item is a temp (new, unsaved) File (no backend id)
2648
2681
  isTempFile(item) {
@@ -2668,8 +2701,22 @@ class FileUploadComponent {
2668
2701
  }
2669
2702
  this.totalSizePercent = this.totalSize / 10;
2670
2703
  }
2704
+ onPhotoCaptured(base64) {
2705
+ // Pretvorba PICK
2706
+ const arr = base64.split(',');
2707
+ const mime = arr[0].match(/:(.*?);/)[1];
2708
+ const bstr = atob(arr[1]);
2709
+ let n = bstr.length;
2710
+ const u8arr = new Uint8Array(n);
2711
+ while (n--)
2712
+ u8arr[n] = bstr.charCodeAt(n);
2713
+ const file = new File([u8arr], `photo_${Date.now()}.jpg`, { type: mime });
2714
+ this.fileList = [...this.fileList, file];
2715
+ this.onSaveFile.emit(this.fileList);
2716
+ this.closeCamera();
2717
+ }
2671
2718
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: FileUploadComponent, deps: [{ token: i1$8.PrimeNG }, { token: SharedMessageService }, { token: i1$2.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
2672
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.6", type: FileUploadComponent, isStandalone: true, selector: "app-file-upload", inputs: { uploadedFiles: "uploadedFiles", maxFileSize: "maxFileSize", totalMaxFileSize: "totalMaxFileSize", disabled: "disabled", acceptFiles: "acceptFiles", multiple: "multiple" }, outputs: { onSaveFile: "onSaveFile", onDelete: "onDelete", onDownload: "onDownload", valid: "valid" }, ngImport: i0, template: " <p-fileupload\r\n class=\"pt-3\"\r\n name=\"priloge[]\"\r\n invalidFileSizeMessageSummary=\"{{\r\n 'components.fileUpload.invalidFileSizeMessageSummary' | translate\r\n }}\"\r\n invalidFileSizeMessageDetail=\"{{\r\n 'components.fileUpload.invalidFileSizeMessageDetail' | translate\r\n }}\"\r\n invalidFileTypeMessageDetail=\"{{'components.fileUpload.invalidFileTypeMessageDetail' | translate}}\"\r\n invalidFileTypeMessageSummary=\"{{ 'components.fileUpload.invalidFileTypeMessageSummary' | translate}}\"\r\n [multiple]=\"multiple\"\r\n (onRemove)=\"remove($event)\"\r\n [accept]=\"acceptFiles\"\r\n [maxFileSize]=\"maxFileSize\"\r\n (onSelect)=\"onSelectedFiles($event)\">\r\n <ng-template\r\n #header\r\n let-priloge\r\n let-chooseCallback=\"chooseCallback\"\r\n let-clearCallback=\"clearCallback\">\r\n <div class=\"flex gap-2\">\r\n <lib-button\r\n [disabled]=\"disabled\"\r\n (click)=\"choose($event, chooseCallback)\"\r\n label=\"{{ 'components.fileUpload.izberi' | translate }}\"\r\n [hasIcon]=\"true\"\r\n [icon]=\"'pi pi-file'\"\r\n [color]=\"ButtonColor.primary\" />\r\n </div>\r\n </ng-template>\r\n <ng-template #content let-priloge let-removeFileCallback=\"removeFileCallback\">\r\n <div class=\"flex flex-col gap-8 pt-4\">\r\n <div class=\"w-full\" *ngIf=\"uploadedFiles.length > 0\">\r\n <div class=\"flex flex-column gap-4\">\r\n <div\r\n *ngFor=\"let priloga of uploadedFiles; let i = index\"\r\n class=\"flex flex-col justify-content-between items-center gap-2 px-3\">\r\n <div class=\"flex flex-col\">\r\n <div>\r\n <i class=\"pi pi-file\"></i>\r\n </div>\r\n <span class=\"pl-3 text-ellipsis max-w-60 whitespace-nowrap overflow-hidden\">\r\n {{ getDisplayName(priloga) }}\r\n </span>\r\n </div>\r\n <div class=\"flex align-items-center\">\r\n <div *ngIf=\"!isTempFile(priloga)\">\r\n <p-badge value=\"Zaklju\u010Den\" badgeSize=\"small\" severity=\"success\" />\r\n <p-button\r\n (click)=\"downloadFile((priloga).id, getDisplayName(priloga))\"\r\n severity=\"primary\"\r\n icon=\"pi pi-download\"\r\n aria-label=\"Prenesi\"\r\n [rounded]=\"true\"\r\n [text]=\"true\" />\r\n </div>\r\n <p-button\r\n [disabled]=\"disabled\"\r\n (click)=\"removeFileCallback()\"\r\n (click)=\"delete(priloga.id)\"\r\n severity=\"danger\"\r\n icon=\"pi pi-times\"\r\n [rounded]=\"true\"\r\n [text]=\"true\" />\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template #priloga></ng-template>\r\n <ng-template #empty>\r\n <div\r\n *ngIf=\"uploadedFiles.length === 0\"\r\n class=\"flex align-center justify-around\"\r\n [style.width]=\"'100%'\">\r\n <span class=\"pi pi-cloud-upload mr-3\"></span>\r\n <p>{{ 'components.fileUpload.povlecitveInSpustiteDatotekeZaNalaganje' | translate }}</p>\r\n </div>\r\n <div *ngIf=\"acceptFiles\" class=\"flex align-center justify-around\">\r\n <div class=\"placeholder\"></div>\r\n <p>{{ ('components.fileUpload.dovoljeneDatoteke' | translate) + acceptFiles }}</p>\r\n </div>\r\n </ng-template>\r\n </p-fileupload>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: InputTextModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: BadgeModule }, { kind: "component", type: i4.Badge, selector: "p-badge", inputs: ["styleClass", "style", "badgeSize", "size", "severity", "value", "badgeDisabled"] }, { kind: "ngmodule", type: FileUploadModule }, { kind: "component", type: i5$1.FileUpload, selector: "p-fileupload, p-fileUpload", inputs: ["name", "url", "method", "multiple", "accept", "disabled", "auto", "withCredentials", "maxFileSize", "invalidFileSizeMessageSummary", "invalidFileSizeMessageDetail", "invalidFileTypeMessageSummary", "invalidFileTypeMessageDetail", "invalidFileLimitMessageDetail", "invalidFileLimitMessageSummary", "style", "styleClass", "previewWidth", "chooseLabel", "uploadLabel", "cancelLabel", "chooseIcon", "uploadIcon", "cancelIcon", "showUploadButton", "showCancelButton", "mode", "headers", "customUpload", "fileLimit", "uploadStyleClass", "cancelStyleClass", "removeStyleClass", "chooseStyleClass", "chooseButtonProps", "uploadButtonProps", "cancelButtonProps", "files"], outputs: ["onBeforeUpload", "onSend", "onUpload", "onError", "onClear", "onRemove", "onSelect", "onProgress", "uploadHandler", "onImageError", "onRemoveUploadedFile"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i6.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: ButtonComponent, selector: "lib-button", inputs: ["hasIcon", "label", "color", "icon", "iconPos", "disabled", "isLoading", "styleClass", "size", "accessibilityText", "buttonType", "isAccessible", "isSelected", "ariaControlsId", "isExpanded", "link", "isTextareaClear"], outputs: ["clickEvent"] }, { kind: "ngmodule", type: OverlayBadgeModule }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: MenubarModule }, { kind: "ngmodule", type: ChipModule }] });
2719
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.6", type: FileUploadComponent, isStandalone: true, selector: "app-file-upload", inputs: { postavkaPregledaId: "postavkaPregledaId", uploadedFiles: "uploadedFiles", maxFileSize: "maxFileSize", totalMaxFileSize: "totalMaxFileSize", disabled: "disabled", acceptFiles: "acceptFiles", multiple: "multiple" }, outputs: { onSaveFile: "onSaveFile", onDelete: "onDelete", onDownload: "onDownload", valid: "valid" }, ngImport: i0, template: " <p-fileupload\r\n class=\"pt-3\"\r\n name=\"priloge[]\"\r\n invalidFileSizeMessageSummary=\"{{\r\n 'components.fileUpload.invalidFileSizeMessageSummary' | translate\r\n }}\"\r\n invalidFileSizeMessageDetail=\"{{\r\n 'components.fileUpload.invalidFileSizeMessageDetail' | translate\r\n }}\"\r\n invalidFileTypeMessageDetail=\"{{'components.fileUpload.invalidFileTypeMessageDetail' | translate}}\"\r\n invalidFileTypeMessageSummary=\"{{ 'components.fileUpload.invalidFileTypeMessageSummary' | translate}}\"\r\n [multiple]=\"multiple\"\r\n (onRemove)=\"remove($event)\"\r\n [accept]=\"acceptFiles\"\r\n [maxFileSize]=\"maxFileSize\"\r\n (onSelect)=\"onSelectedFiles($event)\">\r\n <ng-template\r\n #header\r\n let-priloge\r\n let-chooseCallback=\"chooseCallback\"\r\n let-clearCallback=\"clearCallback\">\r\n <div class=\"flex gap-2\">\r\n <lib-button\r\n [disabled]=\"disabled\"\r\n (click)=\"choose($event, chooseCallback)\"\r\n label=\"{{ 'components.fileUpload.izberi' | translate }}\"\r\n [hasIcon]=\"true\"\r\n [icon]=\"'pi pi-file'\"\r\n [color]=\"ButtonColor.primary\" />\r\n </div>\r\n </ng-template>\r\n <ng-template #content let-priloge let-removeFileCallback=\"removeFileCallback\">\r\n <div class=\"flex flex-col gap-8 pt-4\">\r\n <div class=\"w-full\" *ngIf=\"uploadedFiles.length > 0\">\r\n <div class=\"flex flex-column gap-4\">\r\n <div\r\n *ngFor=\"let priloga of uploadedFiles; let i = index\"\r\n class=\"flex flex-col justify-content-between items-center gap-2 px-3\">\r\n <div class=\"flex flex-col\">\r\n <div>\r\n <i class=\"pi pi-file\"></i>\r\n </div>\r\n <span class=\"pl-3 text-ellipsis max-w-60 whitespace-nowrap overflow-hidden\">\r\n {{ getDisplayName(priloga) }}\r\n </span>\r\n </div>\r\n <div class=\"flex align-items-center\">\r\n <div *ngIf=\"!isTempFile(priloga)\">\r\n <p-badge value=\"Zaklju\u010Den\" badgeSize=\"small\" severity=\"success\" />\r\n <p-button\r\n (click)=\"downloadFile(priloga)\"\r\n severity=\"primary\"\r\n icon=\"pi pi-download\"\r\n aria-label=\"Prenesi\"\r\n [rounded]=\"true\"\r\n [text]=\"true\" />\r\n </div>\r\n <p-button\r\n [disabled]=\"disabled\"\r\n (click)=\"isTempFile(priloga) ? removeFileCallback() : delete(priloga)\"\r\n severity=\"danger\"\r\n icon=\"pi pi-times\"\r\n [rounded]=\"true\"\r\n [text]=\"true\" />\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template #priloga></ng-template>\r\n <ng-template #empty>\r\n <div\r\n *ngIf=\"uploadedFiles.length === 0\"\r\n class=\"flex align-center justify-around\"\r\n [style.width]=\"'100%'\">\r\n <span class=\"pi pi-cloud-upload mr-3\"></span>\r\n <p>{{ 'components.fileUpload.povlecitveInSpustiteDatotekeZaNalaganje' | translate }}</p>\r\n </div>\r\n <div *ngIf=\"acceptFiles\" class=\"flex align-center justify-around\">\r\n <div class=\"placeholder\"></div>\r\n <p>{{ ('components.fileUpload.dovoljeneDatoteke' | translate) + acceptFiles }}</p>\r\n </div>\r\n </ng-template>\r\n </p-fileupload>\r\n\r\n\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: InputTextModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: BadgeModule }, { kind: "component", type: i4.Badge, selector: "p-badge", inputs: ["styleClass", "style", "badgeSize", "size", "severity", "value", "badgeDisabled"] }, { kind: "ngmodule", type: FileUploadModule }, { kind: "component", type: i5$1.FileUpload, selector: "p-fileupload, p-fileUpload", inputs: ["name", "url", "method", "multiple", "accept", "disabled", "auto", "withCredentials", "maxFileSize", "invalidFileSizeMessageSummary", "invalidFileSizeMessageDetail", "invalidFileTypeMessageSummary", "invalidFileTypeMessageDetail", "invalidFileLimitMessageDetail", "invalidFileLimitMessageSummary", "style", "styleClass", "previewWidth", "chooseLabel", "uploadLabel", "cancelLabel", "chooseIcon", "uploadIcon", "cancelIcon", "showUploadButton", "showCancelButton", "mode", "headers", "customUpload", "fileLimit", "uploadStyleClass", "cancelStyleClass", "removeStyleClass", "chooseStyleClass", "chooseButtonProps", "uploadButtonProps", "cancelButtonProps", "files"], outputs: ["onBeforeUpload", "onSend", "onUpload", "onError", "onClear", "onRemove", "onSelect", "onProgress", "uploadHandler", "onImageError", "onRemoveUploadedFile"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i6.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: ButtonComponent, selector: "lib-button", inputs: ["hasIcon", "label", "color", "icon", "iconPos", "disabled", "isLoading", "styleClass", "size", "accessibilityText", "buttonType", "isAccessible", "isSelected", "ariaControlsId", "isExpanded", "link", "isTextareaClear"], outputs: ["clickEvent"] }, { kind: "ngmodule", type: OverlayBadgeModule }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: MenubarModule }, { kind: "ngmodule", type: ChipModule }] });
2673
2720
  }
2674
2721
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: FileUploadComponent, decorators: [{
2675
2722
  type: Component,
@@ -2686,8 +2733,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImpor
2686
2733
  TranslateModule,
2687
2734
  MenubarModule,
2688
2735
  ChipModule,
2689
- ], template: " <p-fileupload\r\n class=\"pt-3\"\r\n name=\"priloge[]\"\r\n invalidFileSizeMessageSummary=\"{{\r\n 'components.fileUpload.invalidFileSizeMessageSummary' | translate\r\n }}\"\r\n invalidFileSizeMessageDetail=\"{{\r\n 'components.fileUpload.invalidFileSizeMessageDetail' | translate\r\n }}\"\r\n invalidFileTypeMessageDetail=\"{{'components.fileUpload.invalidFileTypeMessageDetail' | translate}}\"\r\n invalidFileTypeMessageSummary=\"{{ 'components.fileUpload.invalidFileTypeMessageSummary' | translate}}\"\r\n [multiple]=\"multiple\"\r\n (onRemove)=\"remove($event)\"\r\n [accept]=\"acceptFiles\"\r\n [maxFileSize]=\"maxFileSize\"\r\n (onSelect)=\"onSelectedFiles($event)\">\r\n <ng-template\r\n #header\r\n let-priloge\r\n let-chooseCallback=\"chooseCallback\"\r\n let-clearCallback=\"clearCallback\">\r\n <div class=\"flex gap-2\">\r\n <lib-button\r\n [disabled]=\"disabled\"\r\n (click)=\"choose($event, chooseCallback)\"\r\n label=\"{{ 'components.fileUpload.izberi' | translate }}\"\r\n [hasIcon]=\"true\"\r\n [icon]=\"'pi pi-file'\"\r\n [color]=\"ButtonColor.primary\" />\r\n </div>\r\n </ng-template>\r\n <ng-template #content let-priloge let-removeFileCallback=\"removeFileCallback\">\r\n <div class=\"flex flex-col gap-8 pt-4\">\r\n <div class=\"w-full\" *ngIf=\"uploadedFiles.length > 0\">\r\n <div class=\"flex flex-column gap-4\">\r\n <div\r\n *ngFor=\"let priloga of uploadedFiles; let i = index\"\r\n class=\"flex flex-col justify-content-between items-center gap-2 px-3\">\r\n <div class=\"flex flex-col\">\r\n <div>\r\n <i class=\"pi pi-file\"></i>\r\n </div>\r\n <span class=\"pl-3 text-ellipsis max-w-60 whitespace-nowrap overflow-hidden\">\r\n {{ getDisplayName(priloga) }}\r\n </span>\r\n </div>\r\n <div class=\"flex align-items-center\">\r\n <div *ngIf=\"!isTempFile(priloga)\">\r\n <p-badge value=\"Zaklju\u010Den\" badgeSize=\"small\" severity=\"success\" />\r\n <p-button\r\n (click)=\"downloadFile((priloga).id, getDisplayName(priloga))\"\r\n severity=\"primary\"\r\n icon=\"pi pi-download\"\r\n aria-label=\"Prenesi\"\r\n [rounded]=\"true\"\r\n [text]=\"true\" />\r\n </div>\r\n <p-button\r\n [disabled]=\"disabled\"\r\n (click)=\"removeFileCallback()\"\r\n (click)=\"delete(priloga.id)\"\r\n severity=\"danger\"\r\n icon=\"pi pi-times\"\r\n [rounded]=\"true\"\r\n [text]=\"true\" />\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template #priloga></ng-template>\r\n <ng-template #empty>\r\n <div\r\n *ngIf=\"uploadedFiles.length === 0\"\r\n class=\"flex align-center justify-around\"\r\n [style.width]=\"'100%'\">\r\n <span class=\"pi pi-cloud-upload mr-3\"></span>\r\n <p>{{ 'components.fileUpload.povlecitveInSpustiteDatotekeZaNalaganje' | translate }}</p>\r\n </div>\r\n <div *ngIf=\"acceptFiles\" class=\"flex align-center justify-around\">\r\n <div class=\"placeholder\"></div>\r\n <p>{{ ('components.fileUpload.dovoljeneDatoteke' | translate) + acceptFiles }}</p>\r\n </div>\r\n </ng-template>\r\n </p-fileupload>\r\n" }]
2690
- }], ctorParameters: () => [{ type: i1$8.PrimeNG }, { type: SharedMessageService }, { type: i1$2.TranslateService }], propDecorators: { uploadedFiles: [{
2736
+ ], template: " <p-fileupload\r\n class=\"pt-3\"\r\n name=\"priloge[]\"\r\n invalidFileSizeMessageSummary=\"{{\r\n 'components.fileUpload.invalidFileSizeMessageSummary' | translate\r\n }}\"\r\n invalidFileSizeMessageDetail=\"{{\r\n 'components.fileUpload.invalidFileSizeMessageDetail' | translate\r\n }}\"\r\n invalidFileTypeMessageDetail=\"{{'components.fileUpload.invalidFileTypeMessageDetail' | translate}}\"\r\n invalidFileTypeMessageSummary=\"{{ 'components.fileUpload.invalidFileTypeMessageSummary' | translate}}\"\r\n [multiple]=\"multiple\"\r\n (onRemove)=\"remove($event)\"\r\n [accept]=\"acceptFiles\"\r\n [maxFileSize]=\"maxFileSize\"\r\n (onSelect)=\"onSelectedFiles($event)\">\r\n <ng-template\r\n #header\r\n let-priloge\r\n let-chooseCallback=\"chooseCallback\"\r\n let-clearCallback=\"clearCallback\">\r\n <div class=\"flex gap-2\">\r\n <lib-button\r\n [disabled]=\"disabled\"\r\n (click)=\"choose($event, chooseCallback)\"\r\n label=\"{{ 'components.fileUpload.izberi' | translate }}\"\r\n [hasIcon]=\"true\"\r\n [icon]=\"'pi pi-file'\"\r\n [color]=\"ButtonColor.primary\" />\r\n </div>\r\n </ng-template>\r\n <ng-template #content let-priloge let-removeFileCallback=\"removeFileCallback\">\r\n <div class=\"flex flex-col gap-8 pt-4\">\r\n <div class=\"w-full\" *ngIf=\"uploadedFiles.length > 0\">\r\n <div class=\"flex flex-column gap-4\">\r\n <div\r\n *ngFor=\"let priloga of uploadedFiles; let i = index\"\r\n class=\"flex flex-col justify-content-between items-center gap-2 px-3\">\r\n <div class=\"flex flex-col\">\r\n <div>\r\n <i class=\"pi pi-file\"></i>\r\n </div>\r\n <span class=\"pl-3 text-ellipsis max-w-60 whitespace-nowrap overflow-hidden\">\r\n {{ getDisplayName(priloga) }}\r\n </span>\r\n </div>\r\n <div class=\"flex align-items-center\">\r\n <div *ngIf=\"!isTempFile(priloga)\">\r\n <p-badge value=\"Zaklju\u010Den\" badgeSize=\"small\" severity=\"success\" />\r\n <p-button\r\n (click)=\"downloadFile(priloga)\"\r\n severity=\"primary\"\r\n icon=\"pi pi-download\"\r\n aria-label=\"Prenesi\"\r\n [rounded]=\"true\"\r\n [text]=\"true\" />\r\n </div>\r\n <p-button\r\n [disabled]=\"disabled\"\r\n (click)=\"isTempFile(priloga) ? removeFileCallback() : delete(priloga)\"\r\n severity=\"danger\"\r\n icon=\"pi pi-times\"\r\n [rounded]=\"true\"\r\n [text]=\"true\" />\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template #priloga></ng-template>\r\n <ng-template #empty>\r\n <div\r\n *ngIf=\"uploadedFiles.length === 0\"\r\n class=\"flex align-center justify-around\"\r\n [style.width]=\"'100%'\">\r\n <span class=\"pi pi-cloud-upload mr-3\"></span>\r\n <p>{{ 'components.fileUpload.povlecitveInSpustiteDatotekeZaNalaganje' | translate }}</p>\r\n </div>\r\n <div *ngIf=\"acceptFiles\" class=\"flex align-center justify-around\">\r\n <div class=\"placeholder\"></div>\r\n <p>{{ ('components.fileUpload.dovoljeneDatoteke' | translate) + acceptFiles }}</p>\r\n </div>\r\n </ng-template>\r\n </p-fileupload>\r\n\r\n\r\n" }]
2737
+ }], ctorParameters: () => [{ type: i1$8.PrimeNG }, { type: SharedMessageService }, { type: i1$2.TranslateService }], propDecorators: { postavkaPregledaId: [{
2738
+ type: Input
2739
+ }], uploadedFiles: [{
2691
2740
  type: Input
2692
2741
  }], maxFileSize: [{
2693
2742
  type: Input