@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.
- package/CHANGELOG.md +13 -0
- package/dsivd-prestations-ng-v16.4.0-beta.5.tgz +0 -0
- package/esm2020/foehn-upload/abstract-foehn-uploader.component.mjs +37 -2
- package/esm2020/foehn-upload/foehn-bo-multi-upload/foehn-bo-multi-upload.component.mjs +10 -8
- package/esm2020/foehn-upload/foehn-multi-upload/foehn-multi-upload.component.mjs +13 -8
- package/esm2020/sdk-dictionary/default-dictionary.mjs +3 -1
- package/fesm2015/dsivd-prestations-ng.mjs +59 -15
- package/fesm2015/dsivd-prestations-ng.mjs.map +1 -1
- package/fesm2020/dsivd-prestations-ng.mjs +59 -15
- package/fesm2020/dsivd-prestations-ng.mjs.map +1 -1
- package/foehn-upload/abstract-foehn-uploader.component.d.ts +7 -1
- package/foehn-upload/foehn-bo-multi-upload/foehn-bo-multi-upload.component.d.ts +2 -2
- package/foehn-upload/foehn-multi-upload/foehn-multi-upload.component.d.ts +2 -2
- package/package.json +1 -1
- package/dsivd-prestations-ng-v16.4.0-beta.3.tgz +0 -0
|
@@ -847,6 +847,8 @@ const DEFAULT_DICTIONARY = {
|
|
|
847
847
|
'foehn-uploader.abbr-megaoctet-title': 'Megaoctet',
|
|
848
848
|
'foehn-uploader.delete-icon-title': 'Supprimer {docName}',
|
|
849
849
|
'foehn-uploader.max-upload-selection-reached': 'Vous ne pouvez pas télécharger plus de {maxSelection} fichiers à la fois.',
|
|
850
|
+
'foehn-uploader.max-files-count-reached': 'Le nombre total de fichiers téléchargés ne doit pas dépasser {maxFilesCount} fichiers.',
|
|
851
|
+
'foehn-uploader.max-files-size-reached': 'La taille totale des fichiers téléchargés ne doit pas dépasser {maxFilesSizeInMo} Megaoctets (Mo).',
|
|
850
852
|
'foehn-uploader.files-saved-success-message': '{successfulDocumentsCount} fichier(s) sauvegardé(s) avec succès',
|
|
851
853
|
'foehn-uploader.transmission-error-message': 'Une erreur est survenue lors de la transmission de vos documents',
|
|
852
854
|
'foehn-uploader.files-deleted-success-message': 'Suppression du fichier {filename} réussie',
|
|
@@ -12219,6 +12221,7 @@ class AbstractFoehnUploaderComponent extends FoehnInputComponent {
|
|
|
12219
12221
|
this.multiple = true;
|
|
12220
12222
|
this.showDeleteConfirmationMessage = false;
|
|
12221
12223
|
this.maxSimultaneousSelectedFiles = 50;
|
|
12224
|
+
this.shouldDisplayFileSavedConfirmation = true;
|
|
12222
12225
|
this.showDropZone = false;
|
|
12223
12226
|
this.deleteDocumentSubject = new BehaviorSubject(null);
|
|
12224
12227
|
this.uploadFilesSubject = new BehaviorSubject(null);
|
|
@@ -12342,9 +12345,37 @@ class AbstractFoehnUploaderComponent extends FoehnInputComponent {
|
|
|
12342
12345
|
}
|
|
12343
12346
|
return true;
|
|
12344
12347
|
}
|
|
12348
|
+
isMaxFilesCountReached(files) {
|
|
12349
|
+
if (!this.maxFilesCount) {
|
|
12350
|
+
return false;
|
|
12351
|
+
}
|
|
12352
|
+
if (files &&
|
|
12353
|
+
files.length > this.maxFilesCount - this.addedFiles.length) {
|
|
12354
|
+
const message = this.dictionaryService.getKeySync('foehn-uploader.max-files-count-reached', { maxFilesCount: this.maxFilesCount.toString() });
|
|
12355
|
+
this.growlService.addWithTypeAndTimeToDisplayInSeconds(GrowlType.DANGER, message, 10);
|
|
12356
|
+
return true;
|
|
12357
|
+
}
|
|
12358
|
+
return false;
|
|
12359
|
+
}
|
|
12360
|
+
isMaxFilesSizeReached(files) {
|
|
12361
|
+
if (!this.maxFilesSizeInMo) {
|
|
12362
|
+
return false;
|
|
12363
|
+
}
|
|
12364
|
+
if (files && files.length) {
|
|
12365
|
+
const addedFilesSizeInMo = +this.uploaderHelper.getAllFilesSizeInMo(this.addedFiles);
|
|
12366
|
+
const filesSizeToAddInMo = +this.uploaderHelper.getAllFilesSizeInMo(files);
|
|
12367
|
+
const filesSizeToCompareWithMax = addedFilesSizeInMo + filesSizeToAddInMo;
|
|
12368
|
+
if (filesSizeToCompareWithMax > this.maxFilesSizeInMo) {
|
|
12369
|
+
const message = this.dictionaryService.getKeySync('foehn-uploader.max-files-size-reached', { maxFilesSizeInMo: this.maxFilesSizeInMo.toString() });
|
|
12370
|
+
this.growlService.addWithTypeAndTimeToDisplayInSeconds(GrowlType.DANGER, message, 10);
|
|
12371
|
+
return true;
|
|
12372
|
+
}
|
|
12373
|
+
}
|
|
12374
|
+
return false;
|
|
12375
|
+
}
|
|
12345
12376
|
}
|
|
12346
12377
|
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 });
|
|
12347
|
-
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 });
|
|
12378
|
+
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 });
|
|
12348
12379
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AbstractFoehnUploaderComponent, decorators: [{
|
|
12349
12380
|
type: Directive
|
|
12350
12381
|
}], ctorParameters: function () { return [{ type: ApplicationInfoService }, { type: FoehnConfirmModalService }, { type: SdkDictionaryService }, { type: GrowlBrokerService }]; }, propDecorators: { required: [{
|
|
@@ -12381,6 +12412,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
12381
12412
|
type: Input
|
|
12382
12413
|
}], maxSimultaneousSelectedFiles: [{
|
|
12383
12414
|
type: Input
|
|
12415
|
+
}], shouldDisplayFileSavedConfirmation: [{
|
|
12416
|
+
type: Input
|
|
12417
|
+
}], maxFilesCount: [{
|
|
12418
|
+
type: Input
|
|
12419
|
+
}], maxFilesSizeInMo: [{
|
|
12420
|
+
type: Input
|
|
12384
12421
|
}],
|
|
12385
12422
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12386
12423
|
onDocumentDragOver: [{
|
|
@@ -12480,13 +12517,18 @@ class FoehnMultiUploadComponent extends AbstractFoehnUploaderComponent {
|
|
|
12480
12517
|
this.dictionaryService = dictionaryService;
|
|
12481
12518
|
this.growlService = growlService;
|
|
12482
12519
|
this.url = 'api/document';
|
|
12483
|
-
this.shouldDisplayFileSavedConfirmation = true;
|
|
12484
12520
|
this.pendingUploadService = pendingUploadService;
|
|
12485
12521
|
this.multiUploadService = multiUploadService;
|
|
12486
12522
|
}
|
|
12487
12523
|
get pendingFiles() {
|
|
12488
12524
|
return this.pendingUploadService.getPendingFiles(this.name);
|
|
12489
12525
|
}
|
|
12526
|
+
get addedFiles() {
|
|
12527
|
+
if (this.pendingUploadService.hasPendingFiles(this.name)) {
|
|
12528
|
+
return this.pendingFiles;
|
|
12529
|
+
}
|
|
12530
|
+
return !!this.model ? this.model : [];
|
|
12531
|
+
}
|
|
12490
12532
|
ngOnInit() {
|
|
12491
12533
|
super.ngOnInit();
|
|
12492
12534
|
// eslint-disable-next-line rxjs-angular/prefer-async-pipe
|
|
@@ -12574,7 +12616,9 @@ class FoehnMultiUploadComponent extends AbstractFoehnUploaderComponent {
|
|
|
12574
12616
|
}
|
|
12575
12617
|
populateFileItemList(fileList) {
|
|
12576
12618
|
let files = Array.from(fileList);
|
|
12577
|
-
if (!files.length
|
|
12619
|
+
if (!files.length ||
|
|
12620
|
+
this.isMaxFilesCountReached(files) ||
|
|
12621
|
+
this.isMaxFilesSizeReached(files)) {
|
|
12578
12622
|
return;
|
|
12579
12623
|
}
|
|
12580
12624
|
// When drag/drop and asked for single upload, we ensure we store only one file for upload
|
|
@@ -12652,7 +12696,7 @@ class FoehnMultiUploadComponent extends AbstractFoehnUploaderComponent {
|
|
|
12652
12696
|
}
|
|
12653
12697
|
}
|
|
12654
12698
|
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 });
|
|
12655
|
-
FoehnMultiUploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FoehnMultiUploadComponent, selector: "foehn-multi-upload", inputs: { url: "url", reference: "reference"
|
|
12699
|
+
FoehnMultiUploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FoehnMultiUploadComponent, selector: "foehn-multi-upload", inputs: { url: "url", reference: "reference" }, providers: [
|
|
12656
12700
|
{
|
|
12657
12701
|
provide: FoehnInputComponent,
|
|
12658
12702
|
useExisting: forwardRef(() => FoehnMultiUploadComponent),
|
|
@@ -12660,7 +12704,7 @@ FoehnMultiUploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.
|
|
|
12660
12704
|
},
|
|
12661
12705
|
{ provide: MultiUploadService, useClass: MultiUploadService },
|
|
12662
12706
|
{ provide: UploadProgressService, useClass: UploadProgressService }
|
|
12663
|
-
], 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" }] });
|
|
12707
|
+
], 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" }] });
|
|
12664
12708
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FoehnMultiUploadComponent, decorators: [{
|
|
12665
12709
|
type: Component,
|
|
12666
12710
|
args: [{ selector: 'foehn-multi-upload', providers: [
|
|
@@ -12671,13 +12715,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
12671
12715
|
},
|
|
12672
12716
|
{ provide: MultiUploadService, useClass: MultiUploadService },
|
|
12673
12717
|
{ provide: UploadProgressService, useClass: UploadProgressService }
|
|
12674
|
-
], 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"] }]
|
|
12718
|
+
], 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"] }]
|
|
12675
12719
|
}], ctorParameters: function () { return [{ type: MultiUploadService }, { type: PendingUploadService }, { type: ApplicationInfoService }, { type: FoehnConfirmModalService }, { type: SdkDictionaryService }, { type: GrowlBrokerService }]; }, propDecorators: { url: [{
|
|
12676
12720
|
type: Input
|
|
12677
12721
|
}], reference: [{
|
|
12678
12722
|
type: Input
|
|
12679
|
-
}], shouldDisplayFileSavedConfirmation: [{
|
|
12680
|
-
type: Input
|
|
12681
12723
|
}] } });
|
|
12682
12724
|
|
|
12683
12725
|
class FoehnUploadProgressBarModule {
|
|
@@ -12837,10 +12879,12 @@ class FoehnBoMultiUploadComponent extends AbstractFoehnUploaderComponent {
|
|
|
12837
12879
|
this.confirmModalService = confirmModalService;
|
|
12838
12880
|
this.dictionaryService = dictionaryService;
|
|
12839
12881
|
this.growlService = growlService;
|
|
12840
|
-
this.shouldDisplayFileSavedConfirmation = true;
|
|
12841
12882
|
this.documentDeleted = new EventEmitter();
|
|
12842
12883
|
this.boMultiUploadService = boMultiUploadService;
|
|
12843
12884
|
}
|
|
12885
|
+
get addedFiles() {
|
|
12886
|
+
return !!this.model ? this.model : [];
|
|
12887
|
+
}
|
|
12844
12888
|
ngOnInit() {
|
|
12845
12889
|
super.ngOnInit();
|
|
12846
12890
|
// Add files logic
|
|
@@ -12901,7 +12945,9 @@ class FoehnBoMultiUploadComponent extends AbstractFoehnUploaderComponent {
|
|
|
12901
12945
|
}
|
|
12902
12946
|
populateFileItemList(fileList) {
|
|
12903
12947
|
let files = Array.from(fileList);
|
|
12904
|
-
if (!files.length
|
|
12948
|
+
if (!files.length ||
|
|
12949
|
+
this.isMaxFilesCountReached(files) ||
|
|
12950
|
+
this.isMaxFilesSizeReached(files)) {
|
|
12905
12951
|
return;
|
|
12906
12952
|
}
|
|
12907
12953
|
// When drag/drop and asked for single upload, we ensure we store only one file for upload
|
|
@@ -12957,7 +13003,7 @@ class FoehnBoMultiUploadComponent extends AbstractFoehnUploaderComponent {
|
|
|
12957
13003
|
}
|
|
12958
13004
|
}
|
|
12959
13005
|
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 });
|
|
12960
|
-
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"
|
|
13006
|
+
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: [
|
|
12961
13007
|
{
|
|
12962
13008
|
provide: FoehnInputComponent,
|
|
12963
13009
|
useExisting: forwardRef(() => FoehnBoMultiUploadComponent),
|
|
@@ -12965,7 +13011,7 @@ FoehnBoMultiUploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.
|
|
|
12965
13011
|
},
|
|
12966
13012
|
{ provide: BoMultiUploadService, useClass: BoMultiUploadService },
|
|
12967
13013
|
{ provide: UploadProgressService, useClass: UploadProgressService }
|
|
12968
|
-
], 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" }] });
|
|
13014
|
+
], 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" }] });
|
|
12969
13015
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FoehnBoMultiUploadComponent, decorators: [{
|
|
12970
13016
|
type: Component,
|
|
12971
13017
|
args: [{ selector: 'foehn-bo-multi-upload', providers: [
|
|
@@ -12976,15 +13022,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
12976
13022
|
},
|
|
12977
13023
|
{ provide: BoMultiUploadService, useClass: BoMultiUploadService },
|
|
12978
13024
|
{ provide: UploadProgressService, useClass: UploadProgressService }
|
|
12979
|
-
], 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"] }]
|
|
13025
|
+
], 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"] }]
|
|
12980
13026
|
}], ctorParameters: function () { return [{ type: BoMultiUploadService }, { type: ApplicationInfoService }, { type: FoehnConfirmModalService }, { type: SdkDictionaryService }, { type: GrowlBrokerService }]; }, propDecorators: { uploadUrl: [{
|
|
12981
13027
|
type: Input
|
|
12982
13028
|
}], deleteUrl: [{
|
|
12983
13029
|
type: Input
|
|
12984
13030
|
}], downloadUrl: [{
|
|
12985
13031
|
type: Input
|
|
12986
|
-
}], shouldDisplayFileSavedConfirmation: [{
|
|
12987
|
-
type: Input
|
|
12988
13032
|
}], documentDeleted: [{
|
|
12989
13033
|
type: Output
|
|
12990
13034
|
}] } });
|