@dsivd/prestations-ng 14.5.11 → 14.5.14-beta2

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.
@@ -23,6 +23,8 @@ import { CdkVirtualScrollViewport, ScrollingModule } from '@angular/cdk/scrollin
23
23
  import localeFr from '@angular/common/locales/fr';
24
24
  import dayjs from 'dayjs';
25
25
  import isToday from 'dayjs/plugin/isToday';
26
+ import * as i5 from 'ngx-image-cropper';
27
+ import { ImageCropperModule } from 'ngx-image-cropper';
26
28
  import * as iban from 'iban';
27
29
  import localeData from 'dayjs/plugin/localeData';
28
30
 
@@ -1424,7 +1426,17 @@ const DEFAULT_DICTIONARY = {
1424
1426
  '(fichier au format pdf), vous devez demander la prestation en étant connecté au portail sécurisé.',
1425
1427
  'use-login.text': "Cette prestation est aussi utilisable au travers de l'espace sécurisé qui vous " +
1426
1428
  "permet de pré-remplir le formulaire et de suivre l'avancement de traitement de la demande.",
1427
- 'use-login.button.text': 'Connectez-vous'
1429
+ 'use-login.button.text': 'Connectez-vous',
1430
+ 'foehn-picture-upload.choose-button-label': 'Choisissez une photo',
1431
+ 'foehn-picture-upload.loading-label': 'Chargement...',
1432
+ 'foehn-picture-upload.loading-failure-label': 'Impossible de charger la photo sélectionnée',
1433
+ 'foehn-picture-upload.validate-selection-label': 'Valider la sélection',
1434
+ 'foehn-picture-upload.cancel-selection-label': 'Annuler',
1435
+ 'foehn-picture-upload.selection-not-validated-label': 'Merci de valider votre sélection',
1436
+ 'foehn-picture-upload.delete-picture-label': 'Supprimer',
1437
+ 'foehn-table.totalElements': '{total} éléments trouvées',
1438
+ 'foehn-table.totalElements.1': '1 élément trouvée',
1439
+ 'foehn-table.totalElements.0': 'Aucun résultat'
1428
1440
  };
1429
1441
 
1430
1442
  const DICTIONARY_BASE_URL = 'api/dictionary';
@@ -4592,7 +4604,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImpor
4592
4604
 
4593
4605
  const GUIDE_URL = 'https://www.vd.ch/index.php?id=67827';
4594
4606
  const TERM_OF_USE_URL = 'https://www.vd.ch/index.php?id=2015321';
4595
- const SECURITY_BEST_PRACTICE_URL = 'https://www.vd.ch/securite-protection-donnees/';
4607
+ const SECURITY_BEST_PRACTICE_URL = 'https://www.vd.ch/index.php?id=2015320';
4596
4608
  class FoehnFooterComponent {
4597
4609
  constructor(applicationInfoService, gesdemEventService, gesdemService) {
4598
4610
  /**
@@ -8588,6 +8600,181 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImpor
8588
8600
  class PageChangeEvent {
8589
8601
  }
8590
8602
 
8603
+ const hasInputChanged = (change) => !(!change ||
8604
+ !change.currentValue ||
8605
+ change.previousValue === change.currentValue);
8606
+ class FoehnTableComponent {
8607
+ constructor() {
8608
+ this.itemsPerPage = 10;
8609
+ this.id = 'foehn-table';
8610
+ this.previousLabel = 'Précédent';
8611
+ this.nextLabel = 'Suivant';
8612
+ this.pageChange = new EventEmitter();
8613
+ this.sortChange = new EventEmitter();
8614
+ this.currentPage = 1;
8615
+ this.filteredList = [];
8616
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
8617
+ this.trackByFn = (index, item) => index;
8618
+ }
8619
+ set list(list) {
8620
+ this._list = list;
8621
+ }
8622
+ ngOnChanges(changes) {
8623
+ const itemsPerPageChange = changes.itemsPerPage;
8624
+ const listChange = changes.list;
8625
+ const fixedPageCountChange = changes.fixedPageCount;
8626
+ if (!hasInputChanged(itemsPerPageChange) &&
8627
+ !hasInputChanged(listChange) &&
8628
+ !hasInputChanged(fixedPageCountChange)) {
8629
+ return;
8630
+ }
8631
+ this.buildFilteredList();
8632
+ }
8633
+ previousPage() {
8634
+ this.currentPage = this.currentPage - 1;
8635
+ this.buildFilteredList();
8636
+ this.pageChange.next({
8637
+ previousPage: this.currentPage + 1,
8638
+ currentPage: this.currentPage,
8639
+ pageCount: this.pagesCount()
8640
+ });
8641
+ }
8642
+ hasPreviousPage() {
8643
+ return this.currentPage > 1;
8644
+ }
8645
+ nextPage() {
8646
+ this.currentPage = this.currentPage + 1;
8647
+ this.buildFilteredList();
8648
+ this.pageChange.next({
8649
+ previousPage: this.currentPage - 1,
8650
+ currentPage: this.currentPage,
8651
+ pageCount: this.pagesCount()
8652
+ });
8653
+ }
8654
+ hasNextPage() {
8655
+ return this.currentPage < this.pagesCount();
8656
+ }
8657
+ showPage(page, emitPageChangeEvent = false) {
8658
+ if (this.currentPage === page) {
8659
+ return;
8660
+ }
8661
+ const previousPage = this.currentPage;
8662
+ this.currentPage = page;
8663
+ this.buildFilteredList();
8664
+ if (emitPageChangeEvent) {
8665
+ this.pageChange.next({
8666
+ previousPage,
8667
+ currentPage: this.currentPage,
8668
+ pageCount: this.pagesCount()
8669
+ });
8670
+ }
8671
+ }
8672
+ pagesCount() {
8673
+ if (!!this.fixedPageCount) {
8674
+ return this.fixedPageCount;
8675
+ }
8676
+ return this._list
8677
+ ? Math.ceil(this._list.length / this.itemsPerPage)
8678
+ : 0;
8679
+ }
8680
+ triggerSort(sortAttribute) {
8681
+ let sortDirection = 'DESC';
8682
+ if (this.sort.sortAttribute === sortAttribute) {
8683
+ sortDirection = this.sort.sortDirection === 'DESC' ? 'ASC' : 'DESC';
8684
+ }
8685
+ this.sortChange.next({
8686
+ sortDirection,
8687
+ sortAttribute
8688
+ });
8689
+ }
8690
+ buildFilteredList() {
8691
+ if (!!this.fixedPageCount) {
8692
+ this.filteredList = this._list;
8693
+ return;
8694
+ }
8695
+ const currentPageExists = (this.currentPage - 1) * this.itemsPerPage <= this._list.length;
8696
+ if (!currentPageExists) {
8697
+ this.currentPage = 1;
8698
+ }
8699
+ const start = (this.currentPage - 1) * this.itemsPerPage;
8700
+ this.filteredList = this._list
8701
+ ? this._list.slice(start, start + this.itemsPerPage)
8702
+ : [];
8703
+ }
8704
+ }
8705
+ FoehnTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: FoehnTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
8706
+ FoehnTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.4", type: FoehnTableComponent, selector: "foehn-table", inputs: { itemsPerPage: "itemsPerPage", id: "id", previousLabel: "previousLabel", nextLabel: "nextLabel", totalElements: "totalElements", fixedPageCount: "fixedPageCount", columnsConfiguration: "columnsConfiguration", sort: "sort", trackByFn: "trackByFn", list: "list" }, outputs: { pageChange: "pageChange", sortChange: "sortChange" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"row\" [id]=\"id\">\n <div class=\"col-12\">\n <h2 *ngIf=\"!!totalElements && totalElements === 1\">\n {{ 'foehn-table.totalElements.1' | fromDictionary }}\n </h2>\n <h2 *ngIf=\"!!totalElements && totalElements !== 1\">\n {{\n 'foehn-table.totalElements'\n | fromDictionary: { total: totalElements.toString() }\n }}\n </h2>\n </div>\n\n <div class=\"col-12 table-responsive\">\n <table class=\"table table-hover\">\n <thead class=\"vd-bg-pattern-bars-gray\">\n <tr>\n <th\n scope=\"col\"\n *ngFor=\"let col of columnsConfiguration\"\n [id]=\"col.id\"\n >\n <ng-container *ngIf=\"!col.sortAttribute\">\n <span\n [innerHTML]=\"\n col.columnLabelKey | fromDictionary\n \"\n ></span>\n </ng-container>\n\n <ng-container *ngIf=\"!!col.sortAttribute\">\n <a\n href=\"#\"\n class=\"vd-text-thin\"\n (click)=\"\n $event.preventDefault();\n triggerSort(col.sortAttribute)\n \"\n [title]=\"\n 'Trier par ' +\n (col.columnLabelKey | fromDictionary)\n \"\n >\n <span\n [innerHTML]=\"\n col.columnLabelKey | fromDictionary\n \"\n ></span>\n <ng-container\n *ngIf=\"\n sort.sortAttribute === col.sortAttribute\n \"\n >\n <span\n class=\"ml-3\"\n *ngIf=\"sort.sortDirection === 'ASC'\"\n >\n <foehn-icon-chevron-up></foehn-icon-chevron-up>\n </span>\n <span\n class=\"ml-3\"\n *ngIf=\"sort.sortDirection === 'DESC'\"\n >\n <foehn-icon-chevron-down></foehn-icon-chevron-down>\n </span>\n </ng-container>\n </a>\n </ng-container>\n </th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor=\"\n let item of filteredList;\n let index = index;\n trackBy: trackByFn\n \"\n >\n <td\n *ngFor=\"let col of columnsConfiguration\"\n [id]=\"col.id + '-' + index\"\n >\n <ng-container *ngIf=\"!!col.isImportant\">\n <span\n *ngIf=\"col.isImportant(item)\"\n class=\"cell-vertical-align-middle\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"30\"\n height=\"30\"\n style=\"color: var(--red)\"\n fill=\"currentColor\"\n class=\"bi bi-exclamation\"\n viewBox=\"0 0 16 16\"\n >\n <path\n d=\"M7.002 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0zM7.1 4.995a.905.905 0 1 1 1.8 0l-.35 3.507a.553.553 0 0 1-1.1 0L7.1 4.995z\"\n />\n </svg>\n </span>\n </ng-container>\n\n <ng-container *ngIf=\"!col.routerLinkGetter\">\n <span\n [innerHTML]=\"col.valueGetter(item)\"\n class=\"cell-vertical-align-middle\"\n ></span>\n </ng-container>\n\n <ng-container *ngIf=\"!!col.routerLinkGetter\">\n <a\n [routerLink]=\"col.routerLinkGetter(item)\"\n queryParamsHandling=\"merge\"\n class=\"cell-vertical-align-middle\"\n >\n <span\n [innerHTML]=\"col.valueGetter(item)\"\n ></span>\n </a>\n </ng-container>\n </td>\n </tr>\n <tr *ngIf=\"!filteredList.length\">\n <td [colSpan]=\"columnsConfiguration.length\">\n <div class=\"w-100 text-center\">\n {{ 'foehn-table.totalElements.0' | fromDictionary }}\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n\n <div class=\"row d-flex justify-content-between p-1\">\n <div class=\"col-lg-3 col-md-3 col-sm-6 col-xs-6\">\n <nav\n class=\"vd-pagination\"\n aria-label=\"Pagination\"\n *ngIf=\"hasPreviousPage()\"\n >\n <ul class=\"vd-pagination__list\">\n <li\n class=\"vd-pagination__item vd-pagination__item--previous\"\n >\n <button\n class=\"btn-link vd-pagination__link btn-no-extra vd-pagination__link-reset\"\n (click)=\"previousPage()\"\n >\n <span class=\"vd-pagination__title\">\n <foehn-icon-chevron-left></foehn-icon-chevron-left>\n {{ previousLabel }}\n </span>\n <span class=\"sr-only\">:</span>\n <span class=\"vd-pagination__label\">\n {{ currentPage - 1 }} sur {{ pagesCount() }}\n </span>\n </button>\n </li>\n </ul>\n </nav>\n </div>\n\n <div class=\"col-lg-3 col-md-3 col-sm-6 col-xs-6\">\n <nav\n class=\"vd-pagination\"\n aria-label=\"Pagination\"\n *ngIf=\"hasNextPage()\"\n >\n <ul class=\"vd-pagination__list\">\n <li\n class=\"vd-pagination__item vd-pagination__item--next\"\n >\n <button\n class=\"btn-link vd-pagination__link btn-no-extra vd-pagination__link-reset\"\n (click)=\"nextPage()\"\n >\n <span class=\"vd-pagination__title\">\n {{ nextLabel }}\n <foehn-icon-chevron-right></foehn-icon-chevron-right>\n </span>\n <span class=\"sr-only\">:</span>\n <span class=\"vd-pagination__label\">\n {{ currentPage + 1 }} sur {{ pagesCount() }}\n </span>\n </button>\n </li>\n </ul>\n </nav>\n </div>\n </div>\n </div>\n</div>\n", styles: [".btn-no-extra{padding:0;border:none;font-weight:400;-webkit-text-decoration-line:none;text-decoration-line:none}.vd-pagination__link-reset{background:none;border:none;font-weight:inherit;-webkit-text-decoration-line:none;text-decoration-line:none;text-align:inherit;cursor:pointer}.vd-pagination__link-reset:focus{background-color:#ffbf47}.cell-vertical-align-middle{vertical-align:middle}\n"], components: [{ type: FoehnIconChevronUpComponent, selector: "foehn-icon-chevron-up" }, { type: FoehnIconChevronDownComponent, selector: "foehn-icon-chevron-down" }, { type: FoehnIconChevronLeftComponent, selector: "foehn-icon-chevron-left" }, { type: FoehnIconChevronRightComponent, selector: "foehn-icon-chevron-right" }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["routerLink", "target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }], pipes: { "fromDictionary": SdkDictionaryPipe } });
8707
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: FoehnTableComponent, decorators: [{
8708
+ type: Component,
8709
+ args: [{
8710
+ selector: 'foehn-table',
8711
+ templateUrl: './foehn-table.component.html',
8712
+ styleUrls: ['./foehn-table.component.css']
8713
+ }]
8714
+ }], propDecorators: { itemsPerPage: [{
8715
+ type: Input
8716
+ }], id: [{
8717
+ type: Input
8718
+ }], previousLabel: [{
8719
+ type: Input
8720
+ }], nextLabel: [{
8721
+ type: Input
8722
+ }], totalElements: [{
8723
+ type: Input
8724
+ }], fixedPageCount: [{
8725
+ type: Input
8726
+ }], columnsConfiguration: [{
8727
+ type: Input
8728
+ }], pageChange: [{
8729
+ type: Output
8730
+ }], sort: [{
8731
+ type: Input
8732
+ }], sortChange: [{
8733
+ type: Output
8734
+ }],
8735
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
8736
+ trackByFn: [{
8737
+ type: Input
8738
+ }], list: [{
8739
+ type: Input
8740
+ }] } });
8741
+
8742
+ class FoehnTableModule {
8743
+ }
8744
+ FoehnTableModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: FoehnTableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
8745
+ FoehnTableModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: FoehnTableModule, declarations: [FoehnTableComponent], imports: [CommonModule,
8746
+ FoehnIconsModule,
8747
+ SdkDictionaryModule,
8748
+ RouterModule], exports: [FoehnTableComponent] });
8749
+ FoehnTableModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: FoehnTableModule, imports: [[
8750
+ CommonModule,
8751
+ FoehnIconsModule,
8752
+ SdkDictionaryModule,
8753
+ RouterModule
8754
+ ]] });
8755
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: FoehnTableModule, decorators: [{
8756
+ type: NgModule,
8757
+ args: [{
8758
+ imports: [
8759
+ CommonModule,
8760
+ FoehnIconsModule,
8761
+ SdkDictionaryModule,
8762
+ RouterModule
8763
+ ],
8764
+ declarations: [FoehnTableComponent],
8765
+ exports: [FoehnTableComponent]
8766
+ }]
8767
+ }] });
8768
+
8769
+ class FoehnTableColumnConfiguration {
8770
+ }
8771
+
8772
+ class FoehnTablePageChangeEvent {
8773
+ }
8774
+
8775
+ class TableSort {
8776
+ }
8777
+
8591
8778
  class RedirectComponent {
8592
8779
  constructor(iamInterceptor) {
8593
8780
  this.iamInterceptor = iamInterceptor;
@@ -9738,6 +9925,191 @@ class BoDocumentError {
9738
9925
  class BoDocumentsWithErrors {
9739
9926
  }
9740
9927
 
9928
+ const blobToFile = (blobData, fileName) => {
9929
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9930
+ const blob = blobData;
9931
+ blob.name = fileName;
9932
+ return blob;
9933
+ };
9934
+ const convertBase64UrlToFile = (croppedImageasBase64Url, filename) => {
9935
+ const arr = croppedImageasBase64Url.split(',');
9936
+ const mime = arr[0].match(/:(.*?);/)[1];
9937
+ const bstr = atob(arr[1]);
9938
+ let n = bstr.length;
9939
+ const u8arr = new Uint8Array(n);
9940
+ while (n--) {
9941
+ u8arr[n] = bstr.charCodeAt(n);
9942
+ }
9943
+ if (!navigator.msSaveBlob) {
9944
+ // detect if not Edge
9945
+ return new File([u8arr], filename, { type: mime });
9946
+ }
9947
+ else {
9948
+ // Edge support the FileAPI but not the File constructor.
9949
+ return blobToFile(new Blob([u8arr], { type: mime }), filename);
9950
+ }
9951
+ };
9952
+ class FoehnPictureUploadComponent extends FoehnInputComponent {
9953
+ constructor(growlService, uploadService, dictionaryService) {
9954
+ super();
9955
+ this.growlService = growlService;
9956
+ this.uploadService = uploadService;
9957
+ this.dictionaryService = dictionaryService;
9958
+ this.baseUrl = 'api/document';
9959
+ this.croppedPictureFilename = 'photo.png';
9960
+ this.resizeToWidth = 300;
9961
+ this.resizeToHeight = 0;
9962
+ this.loading = false;
9963
+ }
9964
+ ngOnInit() {
9965
+ super.ngOnInit();
9966
+ this.currentLanguageSubscription = this.dictionaryService
9967
+ .getCurrentLanguageCode()
9968
+ .pipe(distinctUntilChanged())
9969
+ .subscribe(language => {
9970
+ this.currentLanguage = language;
9971
+ });
9972
+ }
9973
+ onPictureSelection(imgEvent) {
9974
+ this.refreshErrors([[], true]);
9975
+ this.pictureToCrop = imgEvent;
9976
+ this.loading = true;
9977
+ }
9978
+ onPictureSelectionFailed() {
9979
+ const errors = [
9980
+ {
9981
+ name: this.name,
9982
+ code: 'LoadingFailure',
9983
+ message: this.dictionaryService.getKeySync('foehn-picture-upload.loading-failure-label')
9984
+ }
9985
+ ];
9986
+ this.refreshErrors([errors, true]);
9987
+ this.resetPictureSelection();
9988
+ }
9989
+ onImageCropped(croppedEvent) {
9990
+ this.croppedPictureAsBase64Url = croppedEvent.base64;
9991
+ }
9992
+ resetPictureSelection() {
9993
+ this.croppedPictureAsBase64Url = null;
9994
+ this.pictureToCrop = null;
9995
+ this.loading = false;
9996
+ }
9997
+ savePicture() {
9998
+ this.markAsPristine();
9999
+ const photo = convertBase64UrlToFile(this.croppedPictureAsBase64Url, this.croppedPictureFilename);
10000
+ this.uploadService
10001
+ .uploadDocuments(this.baseUrl, this.name, this.label, [photo], this.key, false, this.currentLanguage)
10002
+ .pipe(filter(result => !!result))
10003
+ .subscribe(({ documents, errors }) => {
10004
+ this.resetPictureSelection();
10005
+ if (!!documents.length) {
10006
+ this.markAsDirty();
10007
+ this.model = documents;
10008
+ this.refreshErrors([[], true]);
10009
+ }
10010
+ else {
10011
+ this.model = [];
10012
+ this.refreshErrors([errors, true]);
10013
+ }
10014
+ });
10015
+ }
10016
+ deleteFile() {
10017
+ this.uploadService
10018
+ .deleteDocument(this.baseUrl, this.model[0])
10019
+ .subscribe(() => {
10020
+ this.model = [];
10021
+ this.resetPictureSelection();
10022
+ });
10023
+ }
10024
+ getDownloadUrl() {
10025
+ return this.uploadService.getDownloadUrl(this.baseUrl, this.model[0]);
10026
+ }
10027
+ get hasPicture() {
10028
+ return this.model && this.model.length && !!this.model[0].reference;
10029
+ }
10030
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10031
+ refreshErrors(results) {
10032
+ const errors = results[0];
10033
+ const isInSelectionMode = !this.hasPicture && !!this.croppedPictureAsBase64Url;
10034
+ if (isInSelectionMode) {
10035
+ const notNullError = errors.find(e => e.name === this.name && e.code === 'NotEmpty');
10036
+ if (notNullError) {
10037
+ notNullError.message = this.dictionaryService.getKeySync('foehn-picture-upload.selection-not-validated-label');
10038
+ }
10039
+ }
10040
+ super.refreshErrors(results);
10041
+ }
10042
+ }
10043
+ FoehnPictureUploadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: FoehnPictureUploadComponent, deps: [{ token: GrowlBrokerService }, { token: MultiUploadService }, { token: SdkDictionaryService }], target: i0.ɵɵFactoryTarget.Component });
10044
+ FoehnPictureUploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.4", type: FoehnPictureUploadComponent, selector: "foehn-picture-upload", inputs: { name: "name", key: "key", label: "label", baseUrl: "baseUrl", croppedPictureFilename: "croppedPictureFilename", resizeToWidth: "resizeToWidth", resizeToHeight: "resizeToHeight" }, providers: [
10045
+ {
10046
+ provide: FoehnInputComponent,
10047
+ useExisting: forwardRef(() => FoehnPictureUploadComponent),
10048
+ multi: true
10049
+ }
10050
+ ], usesInheritance: true, ngImport: i0, template: "<div\n [attr.id]=\"buildId('Container')\"\n [class.has-danger]=\"hasErrors()\"\n [class.vd-form-group-danger]=\"hasErrors()\"\n class=\"form-group clearable-input-form-group\"\n tabindex=\"-1\"\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 [component]=\"this\"></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 <input type=\"hidden\" [name]=\"name || label\" [ngModel]=\"model\" />\n\n <ng-content></ng-content>\n\n <div *ngIf=\"hasPicture\" class=\"row\">\n <div class=\"col-md-6\">\n <img\n [id]=\"buildChildId('Picture')\"\n [attr.alt]=\"label\"\n [src]=\"getDownloadUrl()\"\n />\n </div>\n <div class=\"col-md-4\">\n <button\n type=\"button\"\n class=\"btn btn-danger w-100\"\n [attr.id]=\"buildChildId('DeleteButton')\"\n (click)=\"deleteFile()\"\n >\n {{\n 'foehn-picture-upload.delete-picture-label' | fromDictionary\n }}\n </button>\n </div>\n </div>\n\n <div *ngIf=\"!hasPicture && !croppedPictureAsBase64Url\">\n <input\n #inputFile\n type=\"file\"\n class=\"form-control-file d-none\"\n [attr.id]=\"name\"\n [attr.accept]=\"'.jpeg,.jpg,.png'\"\n [multiple]=\"false\"\n [name]=\"name\"\n (change)=\"onPictureSelection($event)\"\n />\n\n <button\n type=\"button\"\n class=\"btn btn-primary my-2\"\n [attr.id]=\"buildChildId('ChooseButton')\"\n [attr.aria-invalid]=\"hasErrorsToDisplay() || null\"\n [attr.aria-describedby]=\"buildId('ErrorsContainer')\"\n (click)=\"inputFile.click()\"\n [disabled]=\"loading\"\n >\n {{ 'foehn-picture-upload.choose-button-label' | fromDictionary }}\n </button>\n </div>\n\n <div *ngIf=\"loading\">\n {{ 'foehn-picture-upload.loading-label' | fromDictionary }}\n </div>\n\n <div *ngIf=\"!hasPicture\" class=\"row\">\n <div class=\"col-md-6\">\n <image-cropper\n [id]=\"buildChildId('Cropper')\"\n (cropperReady)=\"loading = false\"\n (imageCropped)=\"onImageCropped($event)\"\n (loadImageFailed)=\"onPictureSelectionFailed()\"\n [aspectRatio]=\"3 / 4\"\n [imageChangedEvent]=\"pictureToCrop\"\n [maintainAspectRatio]=\"true\"\n [resizeToWidth]=\"resizeToWidth\"\n [resizeToHeight]=\"resizeToHeight\"\n [onlyScaleDown]=\"true\"\n format=\"png\"\n ></image-cropper>\n </div>\n\n <div *ngIf=\"!hasPicture\" class=\"col-md-4\">\n <div class=\"row mb-3\">\n <button\n *ngIf=\"croppedPictureAsBase64Url\"\n type=\"button\"\n class=\"btn btn-primary w-100\"\n [attr.id]=\"buildChildId('SaveButton')\"\n (click)=\"savePicture()\"\n >\n {{\n 'foehn-picture-upload.validate-selection-label'\n | fromDictionary\n }}\n </button>\n </div>\n <div class=\"row\">\n <button\n *ngIf=\"croppedPictureAsBase64Url\"\n type=\"button\"\n class=\"btn btn-secondary w-100\"\n [attr.id]=\"buildChildId('CancelButton')\"\n (click)=\"resetPictureSelection()\"\n >\n {{\n 'foehn-picture-upload.cancel-selection-label'\n | fromDictionary\n }}\n </button>\n </div>\n </div>\n </div>\n</div>\n", components: [{ type: FoehnValidationAlertsComponent, selector: "foehn-validation-alerts", inputs: ["component", "shouldErrorsBeLive"] }, { type: i5.ImageCropperComponent, selector: "image-cropper", inputs: ["format", "transform", "maintainAspectRatio", "aspectRatio", "resizeToWidth", "resizeToHeight", "cropperMinWidth", "cropperMinHeight", "cropperMaxHeight", "cropperMaxWidth", "cropperStaticWidth", "cropperStaticHeight", "canvasRotation", "initialStepSize", "roundCropper", "onlyScaleDown", "imageQuality", "autoCrop", "backgroundColor", "containWithinAspectRatio", "hideResizeSquares", "cropper", "alignImage", "disabled", "imageChangedEvent", "imageURL", "imageBase64", "imageFile"], outputs: ["imageCropped", "startCropImage", "imageLoaded", "cropperReady", "loadImageFailed"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "fromDictionary": SdkDictionaryPipe } });
10051
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: FoehnPictureUploadComponent, decorators: [{
10052
+ type: Component,
10053
+ args: [{
10054
+ selector: 'foehn-picture-upload',
10055
+ templateUrl: './foehn-picture-upload.component.html',
10056
+ providers: [
10057
+ {
10058
+ provide: FoehnInputComponent,
10059
+ useExisting: forwardRef(() => FoehnPictureUploadComponent),
10060
+ multi: true
10061
+ }
10062
+ ]
10063
+ }]
10064
+ }], ctorParameters: function () { return [{ type: GrowlBrokerService }, { type: MultiUploadService }, { type: SdkDictionaryService }]; }, propDecorators: { name: [{
10065
+ type: Input
10066
+ }], key: [{
10067
+ type: Input
10068
+ }], label: [{
10069
+ type: Input
10070
+ }], baseUrl: [{
10071
+ type: Input
10072
+ }], croppedPictureFilename: [{
10073
+ type: Input
10074
+ }], resizeToWidth: [{
10075
+ type: Input
10076
+ }], resizeToHeight: [{
10077
+ type: Input
10078
+ }] } });
10079
+
10080
+ class FoehnPictureUploadModule {
10081
+ }
10082
+ FoehnPictureUploadModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: FoehnPictureUploadModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
10083
+ FoehnPictureUploadModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: FoehnPictureUploadModule, declarations: [FoehnPictureUploadComponent], imports: [CommonModule,
10084
+ FoehnIconsModule,
10085
+ FoehnValidationAlertsModule,
10086
+ SdkDictionaryModule,
10087
+ FormsModule,
10088
+ ImageCropperModule], exports: [FoehnPictureUploadComponent] });
10089
+ FoehnPictureUploadModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: FoehnPictureUploadModule, imports: [[
10090
+ CommonModule,
10091
+ FoehnIconsModule,
10092
+ FoehnValidationAlertsModule,
10093
+ SdkDictionaryModule,
10094
+ FormsModule,
10095
+ ImageCropperModule
10096
+ ]] });
10097
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: FoehnPictureUploadModule, decorators: [{
10098
+ type: NgModule,
10099
+ args: [{
10100
+ imports: [
10101
+ CommonModule,
10102
+ FoehnIconsModule,
10103
+ FoehnValidationAlertsModule,
10104
+ SdkDictionaryModule,
10105
+ FormsModule,
10106
+ ImageCropperModule
10107
+ ],
10108
+ declarations: [FoehnPictureUploadComponent],
10109
+ exports: [FoehnPictureUploadComponent]
10110
+ }]
10111
+ }] });
10112
+
9741
10113
  class EPaymentRequest {
9742
10114
  }
9743
10115
 
@@ -11420,5 +11792,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImpor
11420
11792
  * Generated bundle index. Do not edit.
11421
11793
  */
11422
11794
 
11423
- export { APP_INFO_API_URL, AbstractFoehnUploaderComponent, AbstractListDetailPageComponent, AbstractMenuPageComponent, AbstractPageComponent, AbstractPageFromMenuComponent, ActionStatut, Address, ApplicationInfo, ApplicationInfoService, BAD_PARAMS_HELP_TEXT, BackendResponse, BoDocumentError, BoDocumentsWithErrors, BoMultiUploadService, Breadcrumb, BreadcrumbEventService, BreadcrumbItem, CAPTCHA_ERROR_NAME, CURRENCY_REGEXP, Captcha, ComponentError, Configuration, Country, CurrencyHelper, DECIMALS_SEPARATOR, DEFAULT_INTERNATIONAL_AND_NO_SWISS, DEFAULT_INTERNATIONAL_AND_NO_SWISS_MOBILE, DEFAULT_INTERNATIONAL_AND_NO_SWISS_PHONE, DEFAULT_INTERNATIONAL_HELP_TEXT, DEFAULT_SWISS_HELP_TEXT, DEFAULT_SWISS_MOBILE_PHONE_HELP_TEXT, DEFAULT_SWISS_PHONE_HELP_TEXT, DICTIONARY_BASE_URL, DateHelper, DatePickerHelper, DatePickerNavigationHelper, DayMonth, DisplayCurrencyPipe, DisplayDatePipe, DisplayLoginMessagesData, Document, DocumentError, DocumentReference, DocumentReferenceWithFile, DocumentsWithErrors, EPaymentService, EtapeInfo, FORM_SUPPORT_CYBER_TITLE_FALLBACK, FocusedDay, FoehnAbbrComponent, FoehnAddressModule, FoehnAutocompleteComponent, FoehnAutocompleteModule, FoehnBoMultiUploadComponent, FoehnBoMultiUploadModule, FoehnBooleanCheckboxComponent, FoehnBooleanModule, FoehnBooleanRadioComponent, FoehnBreadcrumbComponent, FoehnBreadcrumbModule, FoehnCheckableGroupComponent, FoehnCheckablesModule, FoehnCheckboxComponent, FoehnConfirmModalComponent, FoehnConfirmModalContent, FoehnConfirmModalModule, FoehnConfirmModalService, FoehnDateComponent, FoehnDatePickerButtonComponent, FoehnDatePickerButtonModule, FoehnDatePickerComponent, FoehnDatePickerModule, FoehnDecisionElectroniqueComponent, FoehnDecisionElectroniqueModule, FoehnDisplayAddressComponent, FoehnErrorPillComponent, FoehnFormComponent, FoehnFormModule, FoehnHeaderComponent, FoehnHeaderModule, FoehnHelpModalComponent, FoehnHelpModalModule, FoehnIconCalendarComponent, FoehnIconCheckComponent, FoehnIconCheckSquareOComponent, FoehnIconChevronDownComponent, FoehnIconChevronLeftComponent, FoehnIconChevronRightComponent, FoehnIconChevronUpComponent, FoehnIconClockComponent, FoehnIconCommentDotsComponent, FoehnIconEditComponent, FoehnIconExternalLinkAltComponent, FoehnIconFilePdfComponent, FoehnIconInfoCircleComponent, FoehnIconLockComponent, FoehnIconMapMarkerComponent, FoehnIconMinusCircleComponent, FoehnIconPlusCircleComponent, FoehnIconPlusSquareComponent, FoehnIconSearchComponent, FoehnIconTimesComponent, FoehnIconTrashAltComponent, FoehnIconUnlockAltComponent, FoehnIconsModule, FoehnInputAddressComponent, FoehnInputComponent, FoehnInputEmailComponent, FoehnInputForeignLocalityComponent, FoehnInputForeignStreetComponent, FoehnInputHiddenComponent, FoehnInputModule, FoehnInputNav13Component, FoehnInputNav13Module, FoehnInputNumberComponent, FoehnInputPasswordComponent, FoehnInputPhoneComponent, FoehnInputStringComponent, FoehnInputTextComponent, FoehnInputTextareaComponent, FoehnListComponent, FoehnListItem, FoehnListModule, FoehnListSummaryComponent, FoehnMenuItemComponent, FoehnMenuItemTransmitComponent, FoehnMenuPrestationModule, FoehnMiscModule, FoehnModalComponent, FoehnModalModule, FoehnMultiUploadComponent, FoehnMultiUploadModule, FoehnNavigationComponent, FoehnNavigationModule, FoehnNavigationService, FoehnNotFoundModule, FoehnNotfoundComponent, FoehnPageComponent, FoehnPageCounterComponent, FoehnPageModalComponent, FoehnPageModule, FoehnPageService, FoehnRadioComponent, FoehnRecapSectionComponent, FoehnRecapSectionModule, FoehnRemainingAlertsSummaryComponent, FoehnRemainingAlertsSummaryModule, FoehnSelectComponent, FoehnSkipLinkComponent, FoehnTimeComponent, FoehnUserConnectedAsComponent, FoehnUserConnectedAsModule, FoehnValidationAlertSummaryComponent, FoehnValidationAlertSummaryModule, FoehnValidationAlertsComponent, FoehnValidationAlertsModule, FooterLink, FormSelectOption, FormatIdePipe, FormatterModule, GESDEM_MAX_DATA_LENGTH, GesdemActionRecoveryLoginComponent, GesdemActionRecoveryModule, GesdemActionRecoveryRegistrationComponent, GesdemConfirmationComponent, GesdemConfirmationModule, GesdemErrorComponent, GesdemErrorModule, GesdemEventService, GesdemHandlerService, GesdemLoaderGuard, GesdemMeta, GesdemStatutUtils, GrowlBrokerService, GrowlMessage, GrowlType, I18nForm, IbanFormatterDirective, IdeFormatterDirective, Locality, MonthYear, MultiUploadService, NDCFormatterDirective, NavigationDirection, NumberCurrencyFormatterDirective, ObjectHelper, PORTAIL_BASE_URL_INT, PageChangeEvent, PendingFiles, PendingUploadService, PipeModule, Portail, Preferences, PrestationsNgCoreModule, RECAPTCHA_API_URL, RecaptchaService, RedirectComponent, SESSION_INFO_API_URL, SWISS_ISO_ID, SdkDictionaryModule, SdkDictionaryPipe, SdkDictionaryService, SdkEpaymentComponent, SdkEpaymentModule, SdkRecaptchaComponent, SdkRecaptchaModule, SdkRedirectModule, ServiceLocator, SessionInfo, SessionInfoData, SessionInfoWithApplicationService, Street, StreetNumber, THOUSANDS_SEPARATOR, UploaderHelper, ValidationHandlerService };
11795
+ export { APP_INFO_API_URL, AbstractFoehnUploaderComponent, AbstractListDetailPageComponent, AbstractMenuPageComponent, AbstractPageComponent, AbstractPageFromMenuComponent, ActionStatut, Address, ApplicationInfo, ApplicationInfoService, BAD_PARAMS_HELP_TEXT, BackendResponse, BoDocumentError, BoDocumentsWithErrors, BoMultiUploadService, Breadcrumb, BreadcrumbEventService, BreadcrumbItem, CAPTCHA_ERROR_NAME, CURRENCY_REGEXP, Captcha, ComponentError, Configuration, Country, CurrencyHelper, DECIMALS_SEPARATOR, DEFAULT_INTERNATIONAL_AND_NO_SWISS, DEFAULT_INTERNATIONAL_AND_NO_SWISS_MOBILE, DEFAULT_INTERNATIONAL_AND_NO_SWISS_PHONE, DEFAULT_INTERNATIONAL_HELP_TEXT, DEFAULT_SWISS_HELP_TEXT, DEFAULT_SWISS_MOBILE_PHONE_HELP_TEXT, DEFAULT_SWISS_PHONE_HELP_TEXT, DICTIONARY_BASE_URL, DateHelper, DatePickerHelper, DatePickerNavigationHelper, DayMonth, DisplayCurrencyPipe, DisplayDatePipe, DisplayLoginMessagesData, Document, DocumentError, DocumentReference, DocumentReferenceWithFile, DocumentsWithErrors, EPaymentService, EtapeInfo, FORM_SUPPORT_CYBER_TITLE_FALLBACK, FocusedDay, FoehnAbbrComponent, FoehnAddressModule, FoehnAutocompleteComponent, FoehnAutocompleteModule, FoehnBoMultiUploadComponent, FoehnBoMultiUploadModule, FoehnBooleanCheckboxComponent, FoehnBooleanModule, FoehnBooleanRadioComponent, FoehnBreadcrumbComponent, FoehnBreadcrumbModule, FoehnCheckableGroupComponent, FoehnCheckablesModule, FoehnCheckboxComponent, FoehnConfirmModalComponent, FoehnConfirmModalContent, FoehnConfirmModalModule, FoehnConfirmModalService, FoehnDateComponent, FoehnDatePickerButtonComponent, FoehnDatePickerButtonModule, FoehnDatePickerComponent, FoehnDatePickerModule, FoehnDecisionElectroniqueComponent, FoehnDecisionElectroniqueModule, FoehnDisplayAddressComponent, FoehnErrorPillComponent, FoehnFormComponent, FoehnFormModule, FoehnHeaderComponent, FoehnHeaderModule, FoehnHelpModalComponent, FoehnHelpModalModule, FoehnIconCalendarComponent, FoehnIconCheckComponent, FoehnIconCheckSquareOComponent, FoehnIconChevronDownComponent, FoehnIconChevronLeftComponent, FoehnIconChevronRightComponent, FoehnIconChevronUpComponent, FoehnIconClockComponent, FoehnIconCommentDotsComponent, FoehnIconEditComponent, FoehnIconExternalLinkAltComponent, FoehnIconFilePdfComponent, FoehnIconInfoCircleComponent, FoehnIconLockComponent, FoehnIconMapMarkerComponent, FoehnIconMinusCircleComponent, FoehnIconPlusCircleComponent, FoehnIconPlusSquareComponent, FoehnIconSearchComponent, FoehnIconTimesComponent, FoehnIconTrashAltComponent, FoehnIconUnlockAltComponent, FoehnIconsModule, FoehnInputAddressComponent, FoehnInputComponent, FoehnInputEmailComponent, FoehnInputForeignLocalityComponent, FoehnInputForeignStreetComponent, FoehnInputHiddenComponent, FoehnInputModule, FoehnInputNav13Component, FoehnInputNav13Module, FoehnInputNumberComponent, FoehnInputPasswordComponent, FoehnInputPhoneComponent, FoehnInputStringComponent, FoehnInputTextComponent, FoehnInputTextareaComponent, FoehnListComponent, FoehnListItem, FoehnListModule, FoehnListSummaryComponent, FoehnMenuItemComponent, FoehnMenuItemTransmitComponent, FoehnMenuPrestationModule, FoehnMiscModule, FoehnModalComponent, FoehnModalModule, FoehnMultiUploadComponent, FoehnMultiUploadModule, FoehnNavigationComponent, FoehnNavigationModule, FoehnNavigationService, FoehnNotFoundModule, FoehnNotfoundComponent, FoehnPageComponent, FoehnPageCounterComponent, FoehnPageModalComponent, FoehnPageModule, FoehnPageService, FoehnPictureUploadComponent, FoehnPictureUploadModule, FoehnRadioComponent, FoehnRecapSectionComponent, FoehnRecapSectionModule, FoehnRemainingAlertsSummaryComponent, FoehnRemainingAlertsSummaryModule, FoehnSelectComponent, FoehnSkipLinkComponent, FoehnTableColumnConfiguration, FoehnTableComponent, FoehnTableModule, FoehnTablePageChangeEvent, FoehnTimeComponent, FoehnUserConnectedAsComponent, FoehnUserConnectedAsModule, FoehnValidationAlertSummaryComponent, FoehnValidationAlertSummaryModule, FoehnValidationAlertsComponent, FoehnValidationAlertsModule, FooterLink, FormSelectOption, FormatIdePipe, FormatterModule, GESDEM_MAX_DATA_LENGTH, GesdemActionRecoveryLoginComponent, GesdemActionRecoveryModule, GesdemActionRecoveryRegistrationComponent, GesdemConfirmationComponent, GesdemConfirmationModule, GesdemErrorComponent, GesdemErrorModule, GesdemEventService, GesdemHandlerService, GesdemLoaderGuard, GesdemMeta, GesdemStatutUtils, GrowlBrokerService, GrowlMessage, GrowlType, I18nForm, IbanFormatterDirective, IdeFormatterDirective, Locality, MonthYear, MultiUploadService, NDCFormatterDirective, NavigationDirection, NumberCurrencyFormatterDirective, ObjectHelper, PORTAIL_BASE_URL_INT, PageChangeEvent, PendingFiles, PendingUploadService, PipeModule, Portail, Preferences, PrestationsNgCoreModule, RECAPTCHA_API_URL, RecaptchaService, RedirectComponent, SESSION_INFO_API_URL, SWISS_ISO_ID, SdkDictionaryModule, SdkDictionaryPipe, SdkDictionaryService, SdkEpaymentComponent, SdkEpaymentModule, SdkRecaptchaComponent, SdkRecaptchaModule, SdkRedirectModule, ServiceLocator, SessionInfo, SessionInfoData, SessionInfoWithApplicationService, Street, StreetNumber, THOUSANDS_SEPARATOR, TableSort, UploaderHelper, ValidationHandlerService };
11424
11796
  //# sourceMappingURL=dsivd-prestations-ng.js.map