@dsivd/prestations-ng 16.4.0-beta.3 → 16.4.0-beta.5

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.
@@ -849,6 +849,8 @@ const DEFAULT_DICTIONARY = {
849
849
  'foehn-uploader.abbr-megaoctet-title': 'Megaoctet',
850
850
  'foehn-uploader.delete-icon-title': 'Supprimer {docName}',
851
851
  'foehn-uploader.max-upload-selection-reached': 'Vous ne pouvez pas télécharger plus de {maxSelection} fichiers à la fois.',
852
+ 'foehn-uploader.max-files-count-reached': 'Le nombre total de fichiers téléchargés ne doit pas dépasser {maxFilesCount} fichiers.',
853
+ 'foehn-uploader.max-files-size-reached': 'La taille totale des fichiers téléchargés ne doit pas dépasser {maxFilesSizeInMo} Megaoctets (Mo).',
852
854
  'foehn-uploader.files-saved-success-message': '{successfulDocumentsCount} fichier(s) sauvegardé(s) avec succès',
853
855
  'foehn-uploader.transmission-error-message': 'Une erreur est survenue lors de la transmission de vos documents',
854
856
  'foehn-uploader.files-deleted-success-message': 'Suppression du fichier {filename} réussie',
@@ -12254,6 +12256,7 @@ class AbstractFoehnUploaderComponent extends FoehnInputComponent {
12254
12256
  this.multiple = true;
12255
12257
  this.showDeleteConfirmationMessage = false;
12256
12258
  this.maxSimultaneousSelectedFiles = 50;
12259
+ this.shouldDisplayFileSavedConfirmation = true;
12257
12260
  this.showDropZone = false;
12258
12261
  this.deleteDocumentSubject = new BehaviorSubject(null);
12259
12262
  this.uploadFilesSubject = new BehaviorSubject(null);
@@ -12377,9 +12380,37 @@ class AbstractFoehnUploaderComponent extends FoehnInputComponent {
12377
12380
  }
12378
12381
  return true;
12379
12382
  }
12383
+ isMaxFilesCountReached(files) {
12384
+ if (!this.maxFilesCount) {
12385
+ return false;
12386
+ }
12387
+ if (files &&
12388
+ files.length > this.maxFilesCount - this.addedFiles.length) {
12389
+ const message = this.dictionaryService.getKeySync('foehn-uploader.max-files-count-reached', { maxFilesCount: this.maxFilesCount.toString() });
12390
+ this.growlService.addWithTypeAndTimeToDisplayInSeconds(GrowlType.DANGER, message, 10);
12391
+ return true;
12392
+ }
12393
+ return false;
12394
+ }
12395
+ isMaxFilesSizeReached(files) {
12396
+ if (!this.maxFilesSizeInMo) {
12397
+ return false;
12398
+ }
12399
+ if (files && files.length) {
12400
+ const addedFilesSizeInMo = +this.uploaderHelper.getAllFilesSizeInMo(this.addedFiles);
12401
+ const filesSizeToAddInMo = +this.uploaderHelper.getAllFilesSizeInMo(files);
12402
+ const filesSizeToCompareWithMax = addedFilesSizeInMo + filesSizeToAddInMo;
12403
+ if (filesSizeToCompareWithMax > this.maxFilesSizeInMo) {
12404
+ const message = this.dictionaryService.getKeySync('foehn-uploader.max-files-size-reached', { maxFilesSizeInMo: this.maxFilesSizeInMo.toString() });
12405
+ this.growlService.addWithTypeAndTimeToDisplayInSeconds(GrowlType.DANGER, message, 10);
12406
+ return true;
12407
+ }
12408
+ }
12409
+ return false;
12410
+ }
12380
12411
  }
12381
12412
  AbstractFoehnUploaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AbstractFoehnUploaderComponent, deps: [{ token: ApplicationInfoService }, { token: FoehnConfirmModalService }, { token: SdkDictionaryService }, { token: GrowlBrokerService }], target: i0.ɵɵFactoryTarget.Directive });
12382
- AbstractFoehnUploaderComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: AbstractFoehnUploaderComponent, inputs: { required: "required", dragAndDrop: "dragAndDrop", showUploadButton: "showUploadButton", readonly: "readonly", hideGlobalInfos: "hideGlobalInfos", multiple: "multiple", key: "key", chooseButtonLabel: "chooseButtonLabel", chooseButtonLabelMultiple: "chooseButtonLabelMultiple", dropZoneLabel: "dropZoneLabel", dropZoneLabelMultiple: "dropZoneLabelMultiple", overrideAcceptedExtensions: "overrideAcceptedExtensions", overrideMaxFileNameLength: "overrideMaxFileNameLength", overrideIllegalCharacters: "overrideIllegalCharacters", showDeleteConfirmationMessage: "showDeleteConfirmationMessage", deleteConfirmationMessage: "deleteConfirmationMessage", maxSimultaneousSelectedFiles: "maxSimultaneousSelectedFiles" }, host: { listeners: { "window:dragover": "onDocumentDragOver($event)", "window:dragleave": "onDocumentDragLeave($event)", "window:drop": "onDocumentDrop($event)" } }, usesInheritance: true, ngImport: i0 });
12413
+ AbstractFoehnUploaderComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: AbstractFoehnUploaderComponent, inputs: { required: "required", dragAndDrop: "dragAndDrop", showUploadButton: "showUploadButton", readonly: "readonly", hideGlobalInfos: "hideGlobalInfos", multiple: "multiple", key: "key", chooseButtonLabel: "chooseButtonLabel", chooseButtonLabelMultiple: "chooseButtonLabelMultiple", dropZoneLabel: "dropZoneLabel", dropZoneLabelMultiple: "dropZoneLabelMultiple", overrideAcceptedExtensions: "overrideAcceptedExtensions", overrideMaxFileNameLength: "overrideMaxFileNameLength", overrideIllegalCharacters: "overrideIllegalCharacters", showDeleteConfirmationMessage: "showDeleteConfirmationMessage", deleteConfirmationMessage: "deleteConfirmationMessage", maxSimultaneousSelectedFiles: "maxSimultaneousSelectedFiles", shouldDisplayFileSavedConfirmation: "shouldDisplayFileSavedConfirmation", maxFilesCount: "maxFilesCount", maxFilesSizeInMo: "maxFilesSizeInMo" }, host: { listeners: { "window:dragover": "onDocumentDragOver($event)", "window:dragleave": "onDocumentDragLeave($event)", "window:drop": "onDocumentDrop($event)" } }, usesInheritance: true, ngImport: i0 });
12383
12414
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AbstractFoehnUploaderComponent, decorators: [{
12384
12415
  type: Directive
12385
12416
  }], ctorParameters: function () { return [{ type: ApplicationInfoService }, { type: FoehnConfirmModalService }, { type: SdkDictionaryService }, { type: GrowlBrokerService }]; }, propDecorators: { required: [{
@@ -12416,6 +12447,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
12416
12447
  type: Input
12417
12448
  }], maxSimultaneousSelectedFiles: [{
12418
12449
  type: Input
12450
+ }], shouldDisplayFileSavedConfirmation: [{
12451
+ type: Input
12452
+ }], maxFilesCount: [{
12453
+ type: Input
12454
+ }], maxFilesSizeInMo: [{
12455
+ type: Input
12419
12456
  }],
12420
12457
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12421
12458
  onDocumentDragOver: [{
@@ -12515,13 +12552,18 @@ class FoehnMultiUploadComponent extends AbstractFoehnUploaderComponent {
12515
12552
  this.dictionaryService = dictionaryService;
12516
12553
  this.growlService = growlService;
12517
12554
  this.url = 'api/document';
12518
- this.shouldDisplayFileSavedConfirmation = true;
12519
12555
  this.pendingUploadService = pendingUploadService;
12520
12556
  this.multiUploadService = multiUploadService;
12521
12557
  }
12522
12558
  get pendingFiles() {
12523
12559
  return this.pendingUploadService.getPendingFiles(this.name);
12524
12560
  }
12561
+ get addedFiles() {
12562
+ if (this.pendingUploadService.hasPendingFiles(this.name)) {
12563
+ return this.pendingFiles;
12564
+ }
12565
+ return !!this.model ? this.model : [];
12566
+ }
12525
12567
  ngOnInit() {
12526
12568
  super.ngOnInit();
12527
12569
  // eslint-disable-next-line rxjs-angular/prefer-async-pipe
@@ -12609,7 +12651,9 @@ class FoehnMultiUploadComponent extends AbstractFoehnUploaderComponent {
12609
12651
  }
12610
12652
  populateFileItemList(fileList) {
12611
12653
  let files = Array.from(fileList);
12612
- if (!files.length) {
12654
+ if (!files.length ||
12655
+ this.isMaxFilesCountReached(files) ||
12656
+ this.isMaxFilesSizeReached(files)) {
12613
12657
  return;
12614
12658
  }
12615
12659
  // When drag/drop and asked for single upload, we ensure we store only one file for upload
@@ -12687,7 +12731,7 @@ class FoehnMultiUploadComponent extends AbstractFoehnUploaderComponent {
12687
12731
  }
12688
12732
  }
12689
12733
  FoehnMultiUploadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FoehnMultiUploadComponent, deps: [{ token: MultiUploadService }, { token: PendingUploadService }, { token: ApplicationInfoService }, { token: FoehnConfirmModalService }, { token: SdkDictionaryService }, { token: GrowlBrokerService }], target: i0.ɵɵFactoryTarget.Component });
12690
- FoehnMultiUploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FoehnMultiUploadComponent, selector: "foehn-multi-upload", inputs: { url: "url", reference: "reference", shouldDisplayFileSavedConfirmation: "shouldDisplayFileSavedConfirmation" }, providers: [
12734
+ FoehnMultiUploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FoehnMultiUploadComponent, selector: "foehn-multi-upload", inputs: { url: "url", reference: "reference" }, providers: [
12691
12735
  {
12692
12736
  provide: FoehnInputComponent,
12693
12737
  useExisting: forwardRef(() => FoehnMultiUploadComponent),
@@ -12695,7 +12739,7 @@ FoehnMultiUploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.
12695
12739
  },
12696
12740
  { provide: MultiUploadService, useClass: MultiUploadService },
12697
12741
  { provide: UploadProgressService, useClass: UploadProgressService }
12698
- ], usesInheritance: true, ngImport: i0, template: "<div\n class=\"form-group\"\n [class.has-danger]=\"hasErrorsToDisplay()\"\n [class.vd-form-group-danger]=\"hasErrorsToDisplay()\"\n [class.drop-zone-highlight]=\"showDropZone\"\n [attr.id]=\"buildId('Container')\"\n tabindex=\"-1\"\n (drop)=\"onDrop($event)\"\n (dragenter)=\"onDragenter($event)\"\n (dragleave)=\"onDragleave($event)\"\n (dragover)=\"onDragover($event)\"\n #fallBackTrigger\n>\n <label\n [attr.for]=\"buildChildId()\"\n *ngIf=\"!!label\"\n [ngClass]=\"isLabelSrOnly ? 'sr-only' : labelStyleModifier\"\n >\n <span [innerHTML]=\"label\"></span>\n <span\n *ngIf=\"!required && !hideNotRequiredExtraLabel\"\n aria-hidden=\"true\"\n >\n {{ 'foehn-input.optional' | fromDictionary }}\n </span>\n </label>\n\n <foehn-validation-alerts\n [component]=\"this\"\n [shouldErrorsBeLive]=\"hasLiveUploadErrors()\"\n ></foehn-validation-alerts>\n\n <small\n *ngIf=\"helpText\"\n [attr.id]=\"buildChildId() + 'Help'\"\n class=\"form-text text-secondary\"\n [innerHTML]=\"helpText\"\n ></small>\n\n <!-- PRESTAKIT-309: Fake input with NgModel to be registered into Form controls -->\n <input type=\"hidden\" [name]=\"name || label\" [ngModel]=\"model\" />\n\n <ng-content></ng-content>\n\n <ng-container *ngIf=\"reference\">\n <div\n *ngFor=\"let document of model; trackBy: trackByDocument\"\n class=\"file file-uploaded\"\n >\n <!-- prettier-ignore -->\n <a [href]=\"multiUploadService.getDownloadUrl(url, document)\">{{ document.filename }}</a>\n <span class=\"ml-1 mr-1\">\n ({{ toMegaOctets(document.fileSize) }}\n <abbr\n [title]=\"\n 'foehn-uploader.abbr-megaoctet-title' | fromDictionary\n \"\n >\n {{ 'foehn-uploader.abbr-megaoctet' | fromDictionary }}\n </abbr>\n )\n </span>\n <button\n *ngIf=\"!readonly\"\n type=\"button\"\n class=\"btn icon-button delete-uploaded\"\n (click)=\"removeFile(document)\"\n >\n <foehn-icon-times\n [title]=\"\n 'foehn-uploader.delete-icon-title'\n | fromDictionary: { docName: document.filename }\n \"\n ></foehn-icon-times>\n </button>\n </div>\n\n <small\n class=\"form-text text-secondary uploaded-global-info\"\n *ngIf=\"showGlobalInfos(model)\"\n [innerHTML]=\"getGlobalInfos(model)\"\n ></small>\n </ng-container>\n\n <ng-container *ngIf=\"!reference\">\n <div\n *ngFor=\"let pending of pendingFiles; trackBy: trackByPending\"\n class=\"file file-pending\"\n >\n <span>{{ pending.name }}</span>\n <span class=\"ml-1 mr-1\">\n ({{ toMegaOctets(pending.size) }}\n <abbr\n [title]=\"\n 'foehn-uploader.abbr-megaoctet-title' | fromDictionary\n \"\n >\n {{ 'foehn-uploader.abbr-megaoctet' | fromDictionary }}\n </abbr>\n )\n </span>\n <button\n *ngIf=\"!readonly\"\n type=\"button\"\n class=\"btn icon-button delete-pending\"\n (click)=\"removeFile(pending)\"\n >\n <foehn-icon-times\n [title]=\"\n 'foehn-uploader.delete-icon-title'\n | fromDictionary: { docName: pending.name }\n \"\n ></foehn-icon-times>\n </button>\n </div>\n\n <small\n class=\"form-text text-secondary pending-global-info\"\n *ngIf=\"showGlobalInfos(pendingFiles)\"\n [innerHTML]=\"getGlobalInfos(pendingFiles)\"\n ></small>\n </ng-container>\n\n <ng-container *ngIf=\"canAddMoreFiles()\">\n <input\n class=\"form-control-file actual-input\"\n type=\"file\"\n [name]=\"name || label\"\n [multiple]=\"multiple\"\n [attr.accept]=\"\n overrideAcceptedExtensions\n ? overrideAcceptedExtensions\n : uploaderHelper.accept\n ? uploaderHelper.accept\n : null\n \"\n (change)=\"onFileChange($event)\"\n #inputFile\n />\n\n <button\n type=\"button\"\n class=\"btn btn-primary\"\n [ngClass]=\"{ 'sr-only': !showUploadButton }\"\n [attr.id]=\"buildChildId()\"\n [attr.aria-invalid]=\"hasErrorsToDisplay() || null\"\n [attr.aria-describedby]=\"buildId('ErrorsContainer')\"\n (click)=\"inputFile.click()\"\n #entryComponent\n >\n {{ multiple ? chooseButtonLabelMultiple : chooseButtonLabel }}\n </button>\n\n <div\n *ngIf=\"dragAndDrop\"\n aria-hidden=\"true\"\n class=\"dropfile\"\n [class.dropfile-border-transparent]=\"showDropZone\"\n (click)=\"inputFile.click()\"\n >\n {{ multiple ? dropZoneLabelMultiple : dropZoneLabel }}\n </div>\n </ng-container>\n\n <foehn-upload-progress-bar\n *ngIf=\"reference\"\n [progressBarTriggerHtmlElement]=\"\n inputElement?.nativeElement || fallBackTrigger\n \"\n ></foehn-upload-progress-bar>\n</div>\n", styles: [".dropfile{width:300px;border:3px dashed #bbb;text-align:center;margin-top:10px;cursor:pointer;padding:15px 3px}.dropfile-border-transparent{border-color:var(--white)}.actual-input{display:none}.file-list{margin-top:20px}.icon-button{border:0;background-color:transparent}.icon-button:hover{cursor:pointer}:host ::ng-deep .svg-inline--fa{color:#000!important}.drop-zone-highlight{outline:3px dashed #bbb}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FoehnIconTimesComponent, selector: "foehn-icon-times" }, { kind: "component", type: FoehnValidationAlertsComponent, selector: "foehn-validation-alerts", inputs: ["component", "shouldErrorsBeLive"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: FoehnUploadProgressBarComponent, selector: "foehn-upload-progress-bar", inputs: ["progressBarTriggerHtmlElement"] }, { kind: "pipe", type: SdkDictionaryPipe, name: "fromDictionary" }] });
12742
+ ], usesInheritance: true, ngImport: i0, template: "<div\n class=\"form-group container-box\"\n [class.has-danger]=\"hasErrorsToDisplay()\"\n [class.vd-form-group-danger]=\"hasErrorsToDisplay()\"\n [class.drop-zone-highlight]=\"showDropZone\"\n [attr.id]=\"buildId('Container')\"\n tabindex=\"-1\"\n (drop)=\"onDrop($event)\"\n (dragenter)=\"onDragenter($event)\"\n (dragleave)=\"onDragleave($event)\"\n (dragover)=\"onDragover($event)\"\n #fallBackTrigger\n>\n <label\n [attr.for]=\"buildChildId()\"\n *ngIf=\"!!label\"\n [ngClass]=\"isLabelSrOnly ? 'sr-only' : labelStyleModifier\"\n >\n <span [innerHTML]=\"label\"></span>\n <span\n *ngIf=\"!required && !hideNotRequiredExtraLabel\"\n aria-hidden=\"true\"\n >\n {{ 'foehn-input.optional' | fromDictionary }}\n </span>\n </label>\n\n <foehn-validation-alerts\n [component]=\"this\"\n [shouldErrorsBeLive]=\"hasLiveUploadErrors()\"\n ></foehn-validation-alerts>\n\n <small\n *ngIf=\"helpText\"\n [attr.id]=\"buildChildId() + 'Help'\"\n class=\"form-text text-secondary\"\n [innerHTML]=\"helpText\"\n ></small>\n\n <!-- PRESTAKIT-309: Fake input with NgModel to be registered into Form controls -->\n <input type=\"hidden\" [name]=\"name || label\" [ngModel]=\"model\" />\n\n <ng-content></ng-content>\n\n <ng-container *ngIf=\"reference\">\n <div\n *ngFor=\"let document of model; trackBy: trackByDocument\"\n class=\"file file-uploaded\"\n >\n <!-- prettier-ignore -->\n <a [href]=\"multiUploadService.getDownloadUrl(url, document)\">{{ document.filename }}</a>\n <span class=\"ml-1 mr-1\">\n ({{ toMegaOctets(document.fileSize) }}\n <abbr\n [title]=\"\n 'foehn-uploader.abbr-megaoctet-title' | fromDictionary\n \"\n >\n {{ 'foehn-uploader.abbr-megaoctet' | fromDictionary }}\n </abbr>\n )\n </span>\n <button\n *ngIf=\"!readonly\"\n type=\"button\"\n class=\"btn icon-button delete-uploaded\"\n (click)=\"removeFile(document)\"\n >\n <foehn-icon-times\n [title]=\"\n 'foehn-uploader.delete-icon-title'\n | fromDictionary: { docName: document.filename }\n \"\n ></foehn-icon-times>\n </button>\n </div>\n\n <small\n class=\"form-text text-secondary uploaded-global-info\"\n *ngIf=\"showGlobalInfos(model)\"\n [innerHTML]=\"getGlobalInfos(model)\"\n ></small>\n </ng-container>\n\n <ng-container *ngIf=\"!reference\">\n <div\n *ngFor=\"let pending of pendingFiles; trackBy: trackByPending\"\n class=\"file file-pending\"\n >\n <span>{{ pending.name }}</span>\n <span class=\"ml-1 mr-1\">\n ({{ toMegaOctets(pending.size) }}\n <abbr\n [title]=\"\n 'foehn-uploader.abbr-megaoctet-title' | fromDictionary\n \"\n >\n {{ 'foehn-uploader.abbr-megaoctet' | fromDictionary }}\n </abbr>\n )\n </span>\n <button\n *ngIf=\"!readonly\"\n type=\"button\"\n class=\"btn icon-button delete-pending\"\n (click)=\"removeFile(pending)\"\n >\n <foehn-icon-times\n [title]=\"\n 'foehn-uploader.delete-icon-title'\n | fromDictionary: { docName: pending.name }\n \"\n ></foehn-icon-times>\n </button>\n </div>\n\n <small\n class=\"form-text text-secondary pending-global-info\"\n *ngIf=\"showGlobalInfos(pendingFiles)\"\n [innerHTML]=\"getGlobalInfos(pendingFiles)\"\n ></small>\n </ng-container>\n\n <ng-container *ngIf=\"canAddMoreFiles()\">\n <input\n class=\"form-control-file actual-input\"\n type=\"file\"\n [name]=\"name || label\"\n [multiple]=\"multiple\"\n [attr.accept]=\"\n overrideAcceptedExtensions\n ? overrideAcceptedExtensions\n : uploaderHelper.accept\n ? uploaderHelper.accept\n : null\n \"\n (change)=\"onFileChange($event)\"\n #inputFile\n />\n\n <button\n type=\"button\"\n class=\"btn btn-primary\"\n [ngClass]=\"{ 'sr-only': !showUploadButton }\"\n [attr.id]=\"buildChildId()\"\n [attr.aria-invalid]=\"hasErrorsToDisplay() || null\"\n [attr.aria-describedby]=\"buildId('ErrorsContainer')\"\n (click)=\"inputFile.click()\"\n #entryComponent\n >\n {{ multiple ? chooseButtonLabelMultiple : chooseButtonLabel }}\n </button>\n\n <div\n *ngIf=\"dragAndDrop\"\n aria-hidden=\"true\"\n class=\"dropfile\"\n [class.dropfile-border-transparent]=\"showDropZone\"\n (click)=\"inputFile.click()\"\n >\n {{ multiple ? dropZoneLabelMultiple : dropZoneLabel }}\n </div>\n </ng-container>\n\n <foehn-upload-progress-bar\n *ngIf=\"reference\"\n [progressBarTriggerHtmlElement]=\"\n inputElement?.nativeElement || fallBackTrigger\n \"\n ></foehn-upload-progress-bar>\n</div>\n", styles: [".dropfile{width:300px;border:3px dashed #bbb;text-align:center;margin-top:10px;cursor:pointer;padding:15px 3px}.dropfile-border-transparent{border-color:var(--white)}.actual-input{display:none}.file-list{margin-top:20px}.icon-button{border:0;background-color:transparent}.icon-button:hover{cursor:pointer}:host ::ng-deep .svg-inline--fa{color:#000!important}.drop-zone-highlight{outline:3px dashed #bbb}.container-box{border:1px solid #ededed;background-color:#fbfbfb;padding:.5rem}.container-box.vd-form-group-danger{border-left:5px solid var(--vd-danger);padding-left:1rem}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FoehnIconTimesComponent, selector: "foehn-icon-times" }, { kind: "component", type: FoehnValidationAlertsComponent, selector: "foehn-validation-alerts", inputs: ["component", "shouldErrorsBeLive"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: FoehnUploadProgressBarComponent, selector: "foehn-upload-progress-bar", inputs: ["progressBarTriggerHtmlElement"] }, { kind: "pipe", type: SdkDictionaryPipe, name: "fromDictionary" }] });
12699
12743
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FoehnMultiUploadComponent, decorators: [{
12700
12744
  type: Component,
12701
12745
  args: [{ selector: 'foehn-multi-upload', providers: [
@@ -12706,13 +12750,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
12706
12750
  },
12707
12751
  { provide: MultiUploadService, useClass: MultiUploadService },
12708
12752
  { provide: UploadProgressService, useClass: UploadProgressService }
12709
- ], template: "<div\n class=\"form-group\"\n [class.has-danger]=\"hasErrorsToDisplay()\"\n [class.vd-form-group-danger]=\"hasErrorsToDisplay()\"\n [class.drop-zone-highlight]=\"showDropZone\"\n [attr.id]=\"buildId('Container')\"\n tabindex=\"-1\"\n (drop)=\"onDrop($event)\"\n (dragenter)=\"onDragenter($event)\"\n (dragleave)=\"onDragleave($event)\"\n (dragover)=\"onDragover($event)\"\n #fallBackTrigger\n>\n <label\n [attr.for]=\"buildChildId()\"\n *ngIf=\"!!label\"\n [ngClass]=\"isLabelSrOnly ? 'sr-only' : labelStyleModifier\"\n >\n <span [innerHTML]=\"label\"></span>\n <span\n *ngIf=\"!required && !hideNotRequiredExtraLabel\"\n aria-hidden=\"true\"\n >\n {{ 'foehn-input.optional' | fromDictionary }}\n </span>\n </label>\n\n <foehn-validation-alerts\n [component]=\"this\"\n [shouldErrorsBeLive]=\"hasLiveUploadErrors()\"\n ></foehn-validation-alerts>\n\n <small\n *ngIf=\"helpText\"\n [attr.id]=\"buildChildId() + 'Help'\"\n class=\"form-text text-secondary\"\n [innerHTML]=\"helpText\"\n ></small>\n\n <!-- PRESTAKIT-309: Fake input with NgModel to be registered into Form controls -->\n <input type=\"hidden\" [name]=\"name || label\" [ngModel]=\"model\" />\n\n <ng-content></ng-content>\n\n <ng-container *ngIf=\"reference\">\n <div\n *ngFor=\"let document of model; trackBy: trackByDocument\"\n class=\"file file-uploaded\"\n >\n <!-- prettier-ignore -->\n <a [href]=\"multiUploadService.getDownloadUrl(url, document)\">{{ document.filename }}</a>\n <span class=\"ml-1 mr-1\">\n ({{ toMegaOctets(document.fileSize) }}\n <abbr\n [title]=\"\n 'foehn-uploader.abbr-megaoctet-title' | fromDictionary\n \"\n >\n {{ 'foehn-uploader.abbr-megaoctet' | fromDictionary }}\n </abbr>\n )\n </span>\n <button\n *ngIf=\"!readonly\"\n type=\"button\"\n class=\"btn icon-button delete-uploaded\"\n (click)=\"removeFile(document)\"\n >\n <foehn-icon-times\n [title]=\"\n 'foehn-uploader.delete-icon-title'\n | fromDictionary: { docName: document.filename }\n \"\n ></foehn-icon-times>\n </button>\n </div>\n\n <small\n class=\"form-text text-secondary uploaded-global-info\"\n *ngIf=\"showGlobalInfos(model)\"\n [innerHTML]=\"getGlobalInfos(model)\"\n ></small>\n </ng-container>\n\n <ng-container *ngIf=\"!reference\">\n <div\n *ngFor=\"let pending of pendingFiles; trackBy: trackByPending\"\n class=\"file file-pending\"\n >\n <span>{{ pending.name }}</span>\n <span class=\"ml-1 mr-1\">\n ({{ toMegaOctets(pending.size) }}\n <abbr\n [title]=\"\n 'foehn-uploader.abbr-megaoctet-title' | fromDictionary\n \"\n >\n {{ 'foehn-uploader.abbr-megaoctet' | fromDictionary }}\n </abbr>\n )\n </span>\n <button\n *ngIf=\"!readonly\"\n type=\"button\"\n class=\"btn icon-button delete-pending\"\n (click)=\"removeFile(pending)\"\n >\n <foehn-icon-times\n [title]=\"\n 'foehn-uploader.delete-icon-title'\n | fromDictionary: { docName: pending.name }\n \"\n ></foehn-icon-times>\n </button>\n </div>\n\n <small\n class=\"form-text text-secondary pending-global-info\"\n *ngIf=\"showGlobalInfos(pendingFiles)\"\n [innerHTML]=\"getGlobalInfos(pendingFiles)\"\n ></small>\n </ng-container>\n\n <ng-container *ngIf=\"canAddMoreFiles()\">\n <input\n class=\"form-control-file actual-input\"\n type=\"file\"\n [name]=\"name || label\"\n [multiple]=\"multiple\"\n [attr.accept]=\"\n overrideAcceptedExtensions\n ? overrideAcceptedExtensions\n : uploaderHelper.accept\n ? uploaderHelper.accept\n : null\n \"\n (change)=\"onFileChange($event)\"\n #inputFile\n />\n\n <button\n type=\"button\"\n class=\"btn btn-primary\"\n [ngClass]=\"{ 'sr-only': !showUploadButton }\"\n [attr.id]=\"buildChildId()\"\n [attr.aria-invalid]=\"hasErrorsToDisplay() || null\"\n [attr.aria-describedby]=\"buildId('ErrorsContainer')\"\n (click)=\"inputFile.click()\"\n #entryComponent\n >\n {{ multiple ? chooseButtonLabelMultiple : chooseButtonLabel }}\n </button>\n\n <div\n *ngIf=\"dragAndDrop\"\n aria-hidden=\"true\"\n class=\"dropfile\"\n [class.dropfile-border-transparent]=\"showDropZone\"\n (click)=\"inputFile.click()\"\n >\n {{ multiple ? dropZoneLabelMultiple : dropZoneLabel }}\n </div>\n </ng-container>\n\n <foehn-upload-progress-bar\n *ngIf=\"reference\"\n [progressBarTriggerHtmlElement]=\"\n inputElement?.nativeElement || fallBackTrigger\n \"\n ></foehn-upload-progress-bar>\n</div>\n", styles: [".dropfile{width:300px;border:3px dashed #bbb;text-align:center;margin-top:10px;cursor:pointer;padding:15px 3px}.dropfile-border-transparent{border-color:var(--white)}.actual-input{display:none}.file-list{margin-top:20px}.icon-button{border:0;background-color:transparent}.icon-button:hover{cursor:pointer}:host ::ng-deep .svg-inline--fa{color:#000!important}.drop-zone-highlight{outline:3px dashed #bbb}\n"] }]
12753
+ ], template: "<div\n class=\"form-group container-box\"\n [class.has-danger]=\"hasErrorsToDisplay()\"\n [class.vd-form-group-danger]=\"hasErrorsToDisplay()\"\n [class.drop-zone-highlight]=\"showDropZone\"\n [attr.id]=\"buildId('Container')\"\n tabindex=\"-1\"\n (drop)=\"onDrop($event)\"\n (dragenter)=\"onDragenter($event)\"\n (dragleave)=\"onDragleave($event)\"\n (dragover)=\"onDragover($event)\"\n #fallBackTrigger\n>\n <label\n [attr.for]=\"buildChildId()\"\n *ngIf=\"!!label\"\n [ngClass]=\"isLabelSrOnly ? 'sr-only' : labelStyleModifier\"\n >\n <span [innerHTML]=\"label\"></span>\n <span\n *ngIf=\"!required && !hideNotRequiredExtraLabel\"\n aria-hidden=\"true\"\n >\n {{ 'foehn-input.optional' | fromDictionary }}\n </span>\n </label>\n\n <foehn-validation-alerts\n [component]=\"this\"\n [shouldErrorsBeLive]=\"hasLiveUploadErrors()\"\n ></foehn-validation-alerts>\n\n <small\n *ngIf=\"helpText\"\n [attr.id]=\"buildChildId() + 'Help'\"\n class=\"form-text text-secondary\"\n [innerHTML]=\"helpText\"\n ></small>\n\n <!-- PRESTAKIT-309: Fake input with NgModel to be registered into Form controls -->\n <input type=\"hidden\" [name]=\"name || label\" [ngModel]=\"model\" />\n\n <ng-content></ng-content>\n\n <ng-container *ngIf=\"reference\">\n <div\n *ngFor=\"let document of model; trackBy: trackByDocument\"\n class=\"file file-uploaded\"\n >\n <!-- prettier-ignore -->\n <a [href]=\"multiUploadService.getDownloadUrl(url, document)\">{{ document.filename }}</a>\n <span class=\"ml-1 mr-1\">\n ({{ toMegaOctets(document.fileSize) }}\n <abbr\n [title]=\"\n 'foehn-uploader.abbr-megaoctet-title' | fromDictionary\n \"\n >\n {{ 'foehn-uploader.abbr-megaoctet' | fromDictionary }}\n </abbr>\n )\n </span>\n <button\n *ngIf=\"!readonly\"\n type=\"button\"\n class=\"btn icon-button delete-uploaded\"\n (click)=\"removeFile(document)\"\n >\n <foehn-icon-times\n [title]=\"\n 'foehn-uploader.delete-icon-title'\n | fromDictionary: { docName: document.filename }\n \"\n ></foehn-icon-times>\n </button>\n </div>\n\n <small\n class=\"form-text text-secondary uploaded-global-info\"\n *ngIf=\"showGlobalInfos(model)\"\n [innerHTML]=\"getGlobalInfos(model)\"\n ></small>\n </ng-container>\n\n <ng-container *ngIf=\"!reference\">\n <div\n *ngFor=\"let pending of pendingFiles; trackBy: trackByPending\"\n class=\"file file-pending\"\n >\n <span>{{ pending.name }}</span>\n <span class=\"ml-1 mr-1\">\n ({{ toMegaOctets(pending.size) }}\n <abbr\n [title]=\"\n 'foehn-uploader.abbr-megaoctet-title' | fromDictionary\n \"\n >\n {{ 'foehn-uploader.abbr-megaoctet' | fromDictionary }}\n </abbr>\n )\n </span>\n <button\n *ngIf=\"!readonly\"\n type=\"button\"\n class=\"btn icon-button delete-pending\"\n (click)=\"removeFile(pending)\"\n >\n <foehn-icon-times\n [title]=\"\n 'foehn-uploader.delete-icon-title'\n | fromDictionary: { docName: pending.name }\n \"\n ></foehn-icon-times>\n </button>\n </div>\n\n <small\n class=\"form-text text-secondary pending-global-info\"\n *ngIf=\"showGlobalInfos(pendingFiles)\"\n [innerHTML]=\"getGlobalInfos(pendingFiles)\"\n ></small>\n </ng-container>\n\n <ng-container *ngIf=\"canAddMoreFiles()\">\n <input\n class=\"form-control-file actual-input\"\n type=\"file\"\n [name]=\"name || label\"\n [multiple]=\"multiple\"\n [attr.accept]=\"\n overrideAcceptedExtensions\n ? overrideAcceptedExtensions\n : uploaderHelper.accept\n ? uploaderHelper.accept\n : null\n \"\n (change)=\"onFileChange($event)\"\n #inputFile\n />\n\n <button\n type=\"button\"\n class=\"btn btn-primary\"\n [ngClass]=\"{ 'sr-only': !showUploadButton }\"\n [attr.id]=\"buildChildId()\"\n [attr.aria-invalid]=\"hasErrorsToDisplay() || null\"\n [attr.aria-describedby]=\"buildId('ErrorsContainer')\"\n (click)=\"inputFile.click()\"\n #entryComponent\n >\n {{ multiple ? chooseButtonLabelMultiple : chooseButtonLabel }}\n </button>\n\n <div\n *ngIf=\"dragAndDrop\"\n aria-hidden=\"true\"\n class=\"dropfile\"\n [class.dropfile-border-transparent]=\"showDropZone\"\n (click)=\"inputFile.click()\"\n >\n {{ multiple ? dropZoneLabelMultiple : dropZoneLabel }}\n </div>\n </ng-container>\n\n <foehn-upload-progress-bar\n *ngIf=\"reference\"\n [progressBarTriggerHtmlElement]=\"\n inputElement?.nativeElement || fallBackTrigger\n \"\n ></foehn-upload-progress-bar>\n</div>\n", styles: [".dropfile{width:300px;border:3px dashed #bbb;text-align:center;margin-top:10px;cursor:pointer;padding:15px 3px}.dropfile-border-transparent{border-color:var(--white)}.actual-input{display:none}.file-list{margin-top:20px}.icon-button{border:0;background-color:transparent}.icon-button:hover{cursor:pointer}:host ::ng-deep .svg-inline--fa{color:#000!important}.drop-zone-highlight{outline:3px dashed #bbb}.container-box{border:1px solid #ededed;background-color:#fbfbfb;padding:.5rem}.container-box.vd-form-group-danger{border-left:5px solid var(--vd-danger);padding-left:1rem}\n"] }]
12710
12754
  }], ctorParameters: function () { return [{ type: MultiUploadService }, { type: PendingUploadService }, { type: ApplicationInfoService }, { type: FoehnConfirmModalService }, { type: SdkDictionaryService }, { type: GrowlBrokerService }]; }, propDecorators: { url: [{
12711
12755
  type: Input
12712
12756
  }], reference: [{
12713
12757
  type: Input
12714
- }], shouldDisplayFileSavedConfirmation: [{
12715
- type: Input
12716
12758
  }] } });
12717
12759
 
12718
12760
  class FoehnUploadProgressBarModule {
@@ -12873,10 +12915,12 @@ class FoehnBoMultiUploadComponent extends AbstractFoehnUploaderComponent {
12873
12915
  this.confirmModalService = confirmModalService;
12874
12916
  this.dictionaryService = dictionaryService;
12875
12917
  this.growlService = growlService;
12876
- this.shouldDisplayFileSavedConfirmation = true;
12877
12918
  this.documentDeleted = new EventEmitter();
12878
12919
  this.boMultiUploadService = boMultiUploadService;
12879
12920
  }
12921
+ get addedFiles() {
12922
+ return !!this.model ? this.model : [];
12923
+ }
12880
12924
  ngOnInit() {
12881
12925
  super.ngOnInit();
12882
12926
  // Add files logic
@@ -12937,7 +12981,9 @@ class FoehnBoMultiUploadComponent extends AbstractFoehnUploaderComponent {
12937
12981
  }
12938
12982
  populateFileItemList(fileList) {
12939
12983
  let files = Array.from(fileList);
12940
- if (!files.length) {
12984
+ if (!files.length ||
12985
+ this.isMaxFilesCountReached(files) ||
12986
+ this.isMaxFilesSizeReached(files)) {
12941
12987
  return;
12942
12988
  }
12943
12989
  // When drag/drop and asked for single upload, we ensure we store only one file for upload
@@ -12993,7 +13039,7 @@ class FoehnBoMultiUploadComponent extends AbstractFoehnUploaderComponent {
12993
13039
  }
12994
13040
  }
12995
13041
  FoehnBoMultiUploadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FoehnBoMultiUploadComponent, deps: [{ token: BoMultiUploadService }, { token: ApplicationInfoService }, { token: FoehnConfirmModalService }, { token: SdkDictionaryService }, { token: GrowlBrokerService }], target: i0.ɵɵFactoryTarget.Component });
12996
- FoehnBoMultiUploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FoehnBoMultiUploadComponent, selector: "foehn-bo-multi-upload", inputs: { uploadUrl: "uploadUrl", deleteUrl: "deleteUrl", downloadUrl: "downloadUrl", shouldDisplayFileSavedConfirmation: "shouldDisplayFileSavedConfirmation" }, outputs: { documentDeleted: "documentDeleted" }, providers: [
13042
+ FoehnBoMultiUploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FoehnBoMultiUploadComponent, selector: "foehn-bo-multi-upload", inputs: { uploadUrl: "uploadUrl", deleteUrl: "deleteUrl", downloadUrl: "downloadUrl" }, outputs: { documentDeleted: "documentDeleted" }, providers: [
12997
13043
  {
12998
13044
  provide: FoehnInputComponent,
12999
13045
  useExisting: forwardRef(() => FoehnBoMultiUploadComponent),
@@ -13001,7 +13047,7 @@ FoehnBoMultiUploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.
13001
13047
  },
13002
13048
  { provide: BoMultiUploadService, useClass: BoMultiUploadService },
13003
13049
  { provide: UploadProgressService, useClass: UploadProgressService }
13004
- ], usesInheritance: true, ngImport: i0, template: "<div\n class=\"form-group\"\n [class.has-danger]=\"hasErrorsToDisplay()\"\n [class.vd-form-group-danger]=\"hasErrorsToDisplay()\"\n [class.drop-zone-highlight]=\"showDropZone\"\n [attr.id]=\"buildId('Container')\"\n tabindex=\"-1\"\n (drop)=\"onDrop($event)\"\n (dragenter)=\"onDragenter($event)\"\n (dragleave)=\"onDragleave($event)\"\n (dragover)=\"onDragover($event)\"\n #fallBackTrigger\n>\n <label\n [attr.for]=\"buildChildId()\"\n *ngIf=\"!!label\"\n [ngClass]=\"isLabelSrOnly ? 'sr-only' : labelStyleModifier\"\n >\n <span [innerHTML]=\"label\"></span>\n <span\n *ngIf=\"!required && !hideNotRequiredExtraLabel\"\n aria-hidden=\"true\"\n >\n {{ 'foehn-input.optional' | fromDictionary }}\n </span>\n </label>\n\n <foehn-validation-alerts\n [component]=\"this\"\n [shouldErrorsBeLive]=\"hasLiveUploadErrors()\"\n ></foehn-validation-alerts>\n\n <small\n *ngIf=\"helpText\"\n [attr.id]=\"buildChildId() + 'Help'\"\n class=\"form-text text-secondary\"\n [innerHTML]=\"helpText\"\n ></small>\n\n <!-- PRESTAKIT-309: Fake input with NgModel to be registered into Form controls -->\n <input type=\"hidden\" [name]=\"name || label\" [ngModel]=\"model\" />\n\n <ng-content></ng-content>\n\n <div\n *ngFor=\"let document of model; trackBy: trackByDocument\"\n class=\"file file-uploaded\"\n >\n <!-- prettier-ignore -->\n <a [href]=\"boMultiUploadService.getDownloadUrl(downloadUrl, document)\">{{ document.filename }}</a>\n <span class=\"ml-1 mr-1\">\n ({{ toMegaOctets(document.fileSize) }}\n <abbr\n [title]=\"'foehn-uploader.abbr-megaoctet-title' | fromDictionary\"\n >\n {{ 'foehn-uploader.abbr-megaoctet' | fromDictionary }}\n </abbr>\n )\n </span>\n <button\n *ngIf=\"!readonly\"\n type=\"button\"\n class=\"btn icon-button delete-uploaded\"\n (click)=\"removeFile(document)\"\n >\n <foehn-icon-times\n [title]=\"\n 'foehn-uploader.delete-icon-title'\n | fromDictionary: { docName: document.filename }\n \"\n ></foehn-icon-times>\n </button>\n </div>\n\n <small\n class=\"form-text text-secondary uploaded-global-info\"\n *ngIf=\"showGlobalInfos(model)\"\n [innerHTML]=\"getGlobalInfos(model)\"\n ></small>\n\n <ng-container *ngIf=\"canAddMoreFiles()\">\n <input\n class=\"form-control-file actual-input\"\n type=\"file\"\n [name]=\"name || label\"\n [multiple]=\"multiple\"\n [attr.accept]=\"\n overrideAcceptedExtensions\n ? overrideAcceptedExtensions\n : uploaderHelper.accept\n ? uploaderHelper.accept\n : null\n \"\n (change)=\"onFileChange($event)\"\n #inputFile\n />\n\n <button\n type=\"button\"\n class=\"btn btn-primary\"\n [ngClass]=\"{ 'sr-only': !showUploadButton }\"\n [attr.id]=\"buildChildId()\"\n [attr.aria-invalid]=\"hasErrorsToDisplay() || null\"\n [attr.aria-describedby]=\"buildId('ErrorsContainer')\"\n (click)=\"inputFile.click()\"\n #entryComponent\n >\n {{ multiple ? chooseButtonLabelMultiple : chooseButtonLabel }}\n </button>\n\n <div\n *ngIf=\"dragAndDrop\"\n aria-hidden=\"true\"\n class=\"dropfile\"\n [class.dropfile-border-transparent]=\"showDropZone\"\n (click)=\"inputFile.click()\"\n >\n {{ multiple ? dropZoneLabelMultiple : dropZoneLabel }}\n </div>\n </ng-container>\n\n <foehn-upload-progress-bar\n [progressBarTriggerHtmlElement]=\"\n inputElement?.nativeElement || fallBackTrigger\n \"\n ></foehn-upload-progress-bar>\n</div>\n", styles: [".dropfile{width:300px;border:3px dashed #bbb;text-align:center;margin-top:10px;cursor:pointer;padding:15px 3px}.dropfile-border-transparent{border-color:var(--white)}.actual-input{display:none}.file-list{margin-top:20px}.icon-button{border:0;background-color:transparent}.icon-button:hover{cursor:pointer}:host ::ng-deep .svg-inline--fa{color:#000!important}.drop-zone-highlight{outline:3px dashed #bbb}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FoehnIconTimesComponent, selector: "foehn-icon-times" }, { kind: "component", type: FoehnValidationAlertsComponent, selector: "foehn-validation-alerts", inputs: ["component", "shouldErrorsBeLive"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: FoehnUploadProgressBarComponent, selector: "foehn-upload-progress-bar", inputs: ["progressBarTriggerHtmlElement"] }, { kind: "pipe", type: SdkDictionaryPipe, name: "fromDictionary" }] });
13050
+ ], usesInheritance: true, ngImport: i0, template: "<div\n class=\"form-group container-box\"\n [class.has-danger]=\"hasErrorsToDisplay()\"\n [class.vd-form-group-danger]=\"hasErrorsToDisplay()\"\n [class.drop-zone-highlight]=\"showDropZone\"\n [attr.id]=\"buildId('Container')\"\n tabindex=\"-1\"\n (drop)=\"onDrop($event)\"\n (dragenter)=\"onDragenter($event)\"\n (dragleave)=\"onDragleave($event)\"\n (dragover)=\"onDragover($event)\"\n #fallBackTrigger\n>\n <label\n [attr.for]=\"buildChildId()\"\n *ngIf=\"!!label\"\n [ngClass]=\"isLabelSrOnly ? 'sr-only' : labelStyleModifier\"\n >\n <span [innerHTML]=\"label\"></span>\n <span\n *ngIf=\"!required && !hideNotRequiredExtraLabel\"\n aria-hidden=\"true\"\n >\n {{ 'foehn-input.optional' | fromDictionary }}\n </span>\n </label>\n\n <foehn-validation-alerts\n [component]=\"this\"\n [shouldErrorsBeLive]=\"hasLiveUploadErrors()\"\n ></foehn-validation-alerts>\n\n <small\n *ngIf=\"helpText\"\n [attr.id]=\"buildChildId() + 'Help'\"\n class=\"form-text text-secondary\"\n [innerHTML]=\"helpText\"\n ></small>\n\n <!-- PRESTAKIT-309: Fake input with NgModel to be registered into Form controls -->\n <input type=\"hidden\" [name]=\"name || label\" [ngModel]=\"model\" />\n\n <ng-content></ng-content>\n\n <div\n *ngFor=\"let document of model; trackBy: trackByDocument\"\n class=\"file file-uploaded\"\n >\n <!-- prettier-ignore -->\n <a [href]=\"boMultiUploadService.getDownloadUrl(downloadUrl, document)\">{{ document.filename }}</a>\n <span class=\"ml-1 mr-1\">\n ({{ toMegaOctets(document.fileSize) }}\n <abbr\n [title]=\"'foehn-uploader.abbr-megaoctet-title' | fromDictionary\"\n >\n {{ 'foehn-uploader.abbr-megaoctet' | fromDictionary }}\n </abbr>\n )\n </span>\n <button\n *ngIf=\"!readonly\"\n type=\"button\"\n class=\"btn icon-button delete-uploaded\"\n (click)=\"removeFile(document)\"\n >\n <foehn-icon-times\n [title]=\"\n 'foehn-uploader.delete-icon-title'\n | fromDictionary: { docName: document.filename }\n \"\n ></foehn-icon-times>\n </button>\n </div>\n\n <small\n class=\"form-text text-secondary uploaded-global-info\"\n *ngIf=\"showGlobalInfos(model)\"\n [innerHTML]=\"getGlobalInfos(model)\"\n ></small>\n\n <ng-container *ngIf=\"canAddMoreFiles()\">\n <input\n class=\"form-control-file actual-input\"\n type=\"file\"\n [name]=\"name || label\"\n [multiple]=\"multiple\"\n [attr.accept]=\"\n overrideAcceptedExtensions\n ? overrideAcceptedExtensions\n : uploaderHelper.accept\n ? uploaderHelper.accept\n : null\n \"\n (change)=\"onFileChange($event)\"\n #inputFile\n />\n\n <button\n type=\"button\"\n class=\"btn btn-primary\"\n [ngClass]=\"{ 'sr-only': !showUploadButton }\"\n [attr.id]=\"buildChildId()\"\n [attr.aria-invalid]=\"hasErrorsToDisplay() || null\"\n [attr.aria-describedby]=\"buildId('ErrorsContainer')\"\n (click)=\"inputFile.click()\"\n #entryComponent\n >\n {{ multiple ? chooseButtonLabelMultiple : chooseButtonLabel }}\n </button>\n\n <div\n *ngIf=\"dragAndDrop\"\n aria-hidden=\"true\"\n class=\"dropfile\"\n [class.dropfile-border-transparent]=\"showDropZone\"\n (click)=\"inputFile.click()\"\n >\n {{ multiple ? dropZoneLabelMultiple : dropZoneLabel }}\n </div>\n </ng-container>\n\n <foehn-upload-progress-bar\n [progressBarTriggerHtmlElement]=\"\n inputElement?.nativeElement || fallBackTrigger\n \"\n ></foehn-upload-progress-bar>\n</div>\n", styles: [".dropfile{width:300px;border:3px dashed #bbb;text-align:center;margin-top:10px;cursor:pointer;padding:15px 3px}.dropfile-border-transparent{border-color:var(--white)}.actual-input{display:none}.file-list{margin-top:20px}.icon-button{border:0;background-color:transparent}.icon-button:hover{cursor:pointer}:host ::ng-deep .svg-inline--fa{color:#000!important}.drop-zone-highlight{outline:3px dashed #bbb}.container-box{border:1px solid #ededed;background-color:#fbfbfb;padding:.5rem}.container-box.vd-form-group-danger{border-left:5px solid var(--vd-danger);padding-left:1rem}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FoehnIconTimesComponent, selector: "foehn-icon-times" }, { kind: "component", type: FoehnValidationAlertsComponent, selector: "foehn-validation-alerts", inputs: ["component", "shouldErrorsBeLive"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: FoehnUploadProgressBarComponent, selector: "foehn-upload-progress-bar", inputs: ["progressBarTriggerHtmlElement"] }, { kind: "pipe", type: SdkDictionaryPipe, name: "fromDictionary" }] });
13005
13051
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FoehnBoMultiUploadComponent, decorators: [{
13006
13052
  type: Component,
13007
13053
  args: [{ selector: 'foehn-bo-multi-upload', providers: [
@@ -13012,15 +13058,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
13012
13058
  },
13013
13059
  { provide: BoMultiUploadService, useClass: BoMultiUploadService },
13014
13060
  { provide: UploadProgressService, useClass: UploadProgressService }
13015
- ], template: "<div\n class=\"form-group\"\n [class.has-danger]=\"hasErrorsToDisplay()\"\n [class.vd-form-group-danger]=\"hasErrorsToDisplay()\"\n [class.drop-zone-highlight]=\"showDropZone\"\n [attr.id]=\"buildId('Container')\"\n tabindex=\"-1\"\n (drop)=\"onDrop($event)\"\n (dragenter)=\"onDragenter($event)\"\n (dragleave)=\"onDragleave($event)\"\n (dragover)=\"onDragover($event)\"\n #fallBackTrigger\n>\n <label\n [attr.for]=\"buildChildId()\"\n *ngIf=\"!!label\"\n [ngClass]=\"isLabelSrOnly ? 'sr-only' : labelStyleModifier\"\n >\n <span [innerHTML]=\"label\"></span>\n <span\n *ngIf=\"!required && !hideNotRequiredExtraLabel\"\n aria-hidden=\"true\"\n >\n {{ 'foehn-input.optional' | fromDictionary }}\n </span>\n </label>\n\n <foehn-validation-alerts\n [component]=\"this\"\n [shouldErrorsBeLive]=\"hasLiveUploadErrors()\"\n ></foehn-validation-alerts>\n\n <small\n *ngIf=\"helpText\"\n [attr.id]=\"buildChildId() + 'Help'\"\n class=\"form-text text-secondary\"\n [innerHTML]=\"helpText\"\n ></small>\n\n <!-- PRESTAKIT-309: Fake input with NgModel to be registered into Form controls -->\n <input type=\"hidden\" [name]=\"name || label\" [ngModel]=\"model\" />\n\n <ng-content></ng-content>\n\n <div\n *ngFor=\"let document of model; trackBy: trackByDocument\"\n class=\"file file-uploaded\"\n >\n <!-- prettier-ignore -->\n <a [href]=\"boMultiUploadService.getDownloadUrl(downloadUrl, document)\">{{ document.filename }}</a>\n <span class=\"ml-1 mr-1\">\n ({{ toMegaOctets(document.fileSize) }}\n <abbr\n [title]=\"'foehn-uploader.abbr-megaoctet-title' | fromDictionary\"\n >\n {{ 'foehn-uploader.abbr-megaoctet' | fromDictionary }}\n </abbr>\n )\n </span>\n <button\n *ngIf=\"!readonly\"\n type=\"button\"\n class=\"btn icon-button delete-uploaded\"\n (click)=\"removeFile(document)\"\n >\n <foehn-icon-times\n [title]=\"\n 'foehn-uploader.delete-icon-title'\n | fromDictionary: { docName: document.filename }\n \"\n ></foehn-icon-times>\n </button>\n </div>\n\n <small\n class=\"form-text text-secondary uploaded-global-info\"\n *ngIf=\"showGlobalInfos(model)\"\n [innerHTML]=\"getGlobalInfos(model)\"\n ></small>\n\n <ng-container *ngIf=\"canAddMoreFiles()\">\n <input\n class=\"form-control-file actual-input\"\n type=\"file\"\n [name]=\"name || label\"\n [multiple]=\"multiple\"\n [attr.accept]=\"\n overrideAcceptedExtensions\n ? overrideAcceptedExtensions\n : uploaderHelper.accept\n ? uploaderHelper.accept\n : null\n \"\n (change)=\"onFileChange($event)\"\n #inputFile\n />\n\n <button\n type=\"button\"\n class=\"btn btn-primary\"\n [ngClass]=\"{ 'sr-only': !showUploadButton }\"\n [attr.id]=\"buildChildId()\"\n [attr.aria-invalid]=\"hasErrorsToDisplay() || null\"\n [attr.aria-describedby]=\"buildId('ErrorsContainer')\"\n (click)=\"inputFile.click()\"\n #entryComponent\n >\n {{ multiple ? chooseButtonLabelMultiple : chooseButtonLabel }}\n </button>\n\n <div\n *ngIf=\"dragAndDrop\"\n aria-hidden=\"true\"\n class=\"dropfile\"\n [class.dropfile-border-transparent]=\"showDropZone\"\n (click)=\"inputFile.click()\"\n >\n {{ multiple ? dropZoneLabelMultiple : dropZoneLabel }}\n </div>\n </ng-container>\n\n <foehn-upload-progress-bar\n [progressBarTriggerHtmlElement]=\"\n inputElement?.nativeElement || fallBackTrigger\n \"\n ></foehn-upload-progress-bar>\n</div>\n", styles: [".dropfile{width:300px;border:3px dashed #bbb;text-align:center;margin-top:10px;cursor:pointer;padding:15px 3px}.dropfile-border-transparent{border-color:var(--white)}.actual-input{display:none}.file-list{margin-top:20px}.icon-button{border:0;background-color:transparent}.icon-button:hover{cursor:pointer}:host ::ng-deep .svg-inline--fa{color:#000!important}.drop-zone-highlight{outline:3px dashed #bbb}\n"] }]
13061
+ ], template: "<div\n class=\"form-group container-box\"\n [class.has-danger]=\"hasErrorsToDisplay()\"\n [class.vd-form-group-danger]=\"hasErrorsToDisplay()\"\n [class.drop-zone-highlight]=\"showDropZone\"\n [attr.id]=\"buildId('Container')\"\n tabindex=\"-1\"\n (drop)=\"onDrop($event)\"\n (dragenter)=\"onDragenter($event)\"\n (dragleave)=\"onDragleave($event)\"\n (dragover)=\"onDragover($event)\"\n #fallBackTrigger\n>\n <label\n [attr.for]=\"buildChildId()\"\n *ngIf=\"!!label\"\n [ngClass]=\"isLabelSrOnly ? 'sr-only' : labelStyleModifier\"\n >\n <span [innerHTML]=\"label\"></span>\n <span\n *ngIf=\"!required && !hideNotRequiredExtraLabel\"\n aria-hidden=\"true\"\n >\n {{ 'foehn-input.optional' | fromDictionary }}\n </span>\n </label>\n\n <foehn-validation-alerts\n [component]=\"this\"\n [shouldErrorsBeLive]=\"hasLiveUploadErrors()\"\n ></foehn-validation-alerts>\n\n <small\n *ngIf=\"helpText\"\n [attr.id]=\"buildChildId() + 'Help'\"\n class=\"form-text text-secondary\"\n [innerHTML]=\"helpText\"\n ></small>\n\n <!-- PRESTAKIT-309: Fake input with NgModel to be registered into Form controls -->\n <input type=\"hidden\" [name]=\"name || label\" [ngModel]=\"model\" />\n\n <ng-content></ng-content>\n\n <div\n *ngFor=\"let document of model; trackBy: trackByDocument\"\n class=\"file file-uploaded\"\n >\n <!-- prettier-ignore -->\n <a [href]=\"boMultiUploadService.getDownloadUrl(downloadUrl, document)\">{{ document.filename }}</a>\n <span class=\"ml-1 mr-1\">\n ({{ toMegaOctets(document.fileSize) }}\n <abbr\n [title]=\"'foehn-uploader.abbr-megaoctet-title' | fromDictionary\"\n >\n {{ 'foehn-uploader.abbr-megaoctet' | fromDictionary }}\n </abbr>\n )\n </span>\n <button\n *ngIf=\"!readonly\"\n type=\"button\"\n class=\"btn icon-button delete-uploaded\"\n (click)=\"removeFile(document)\"\n >\n <foehn-icon-times\n [title]=\"\n 'foehn-uploader.delete-icon-title'\n | fromDictionary: { docName: document.filename }\n \"\n ></foehn-icon-times>\n </button>\n </div>\n\n <small\n class=\"form-text text-secondary uploaded-global-info\"\n *ngIf=\"showGlobalInfos(model)\"\n [innerHTML]=\"getGlobalInfos(model)\"\n ></small>\n\n <ng-container *ngIf=\"canAddMoreFiles()\">\n <input\n class=\"form-control-file actual-input\"\n type=\"file\"\n [name]=\"name || label\"\n [multiple]=\"multiple\"\n [attr.accept]=\"\n overrideAcceptedExtensions\n ? overrideAcceptedExtensions\n : uploaderHelper.accept\n ? uploaderHelper.accept\n : null\n \"\n (change)=\"onFileChange($event)\"\n #inputFile\n />\n\n <button\n type=\"button\"\n class=\"btn btn-primary\"\n [ngClass]=\"{ 'sr-only': !showUploadButton }\"\n [attr.id]=\"buildChildId()\"\n [attr.aria-invalid]=\"hasErrorsToDisplay() || null\"\n [attr.aria-describedby]=\"buildId('ErrorsContainer')\"\n (click)=\"inputFile.click()\"\n #entryComponent\n >\n {{ multiple ? chooseButtonLabelMultiple : chooseButtonLabel }}\n </button>\n\n <div\n *ngIf=\"dragAndDrop\"\n aria-hidden=\"true\"\n class=\"dropfile\"\n [class.dropfile-border-transparent]=\"showDropZone\"\n (click)=\"inputFile.click()\"\n >\n {{ multiple ? dropZoneLabelMultiple : dropZoneLabel }}\n </div>\n </ng-container>\n\n <foehn-upload-progress-bar\n [progressBarTriggerHtmlElement]=\"\n inputElement?.nativeElement || fallBackTrigger\n \"\n ></foehn-upload-progress-bar>\n</div>\n", styles: [".dropfile{width:300px;border:3px dashed #bbb;text-align:center;margin-top:10px;cursor:pointer;padding:15px 3px}.dropfile-border-transparent{border-color:var(--white)}.actual-input{display:none}.file-list{margin-top:20px}.icon-button{border:0;background-color:transparent}.icon-button:hover{cursor:pointer}:host ::ng-deep .svg-inline--fa{color:#000!important}.drop-zone-highlight{outline:3px dashed #bbb}.container-box{border:1px solid #ededed;background-color:#fbfbfb;padding:.5rem}.container-box.vd-form-group-danger{border-left:5px solid var(--vd-danger);padding-left:1rem}\n"] }]
13016
13062
  }], ctorParameters: function () { return [{ type: BoMultiUploadService }, { type: ApplicationInfoService }, { type: FoehnConfirmModalService }, { type: SdkDictionaryService }, { type: GrowlBrokerService }]; }, propDecorators: { uploadUrl: [{
13017
13063
  type: Input
13018
13064
  }], deleteUrl: [{
13019
13065
  type: Input
13020
13066
  }], downloadUrl: [{
13021
13067
  type: Input
13022
- }], shouldDisplayFileSavedConfirmation: [{
13023
- type: Input
13024
13068
  }], documentDeleted: [{
13025
13069
  type: Output
13026
13070
  }] } });