@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.
package/CHANGELOG.md CHANGED
@@ -26,6 +26,34 @@ A change is considered **breaking** if you have to change your code or update yo
26
26
 
27
27
  ---
28
28
 
29
+ ## [14.5.14]
30
+
31
+ ### Added
32
+
33
+ - [foehn-table.module.ts](projects/prestations-ng/src/foehn-table/foehn-table.module.ts)
34
+ - [foehn-table.component.ts](projects/prestations-ng/src/foehn-table/foehn-table.component.ts)
35
+ - [foehn-table.component.html](projects/prestations-ng/src/foehn-table/foehn-table.component.html)
36
+ - added a paginated table
37
+ - for examples, see related page in the devtool (https://dsi-vd.github.io/prestations-ng/list#foehn_table)
38
+
39
+ ## [14.5.13]
40
+
41
+ ### Added
42
+
43
+ - [foehn-picture-upload.module.ts](projects/prestations-ng/src/foehn-upload/foehn-picture-upload/foehn-picture-upload.module.ts)
44
+ - [foehn-picture-upload.component.ts](projects/prestations-ng/src/foehn-upload/foehn-picture-upload/foehn-picture-upload.component.ts)
45
+ - [foehn-picture-upload.component.html](projects/prestations-ng/src/foehn-upload/foehn-picture-upload/foehn-picture-upload.component.html)
46
+ - added a picture uploader that allows the user to crop the uploaded picture
47
+ - requires `ngx-image-cropper@~5.0.0`
48
+ - for examples, see related page in the devtool (https://dsi-vd.github.io/prestations-ng/upload#foehn_picture_upload)
49
+
50
+ ## [14.5.12]
51
+
52
+ ### Fixed
53
+
54
+ - [foehn-footer.component.ts](projects/prestations-ng/src/foehn-footer/foehn-footer.component.ts)
55
+ - Fixed "SecurityBestPracticeLink" URL
56
+
29
57
  ## [14.5.11]
30
58
 
31
59
  ### Fixed
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http'), require('rxjs'), require('rxjs/operators'), require('@angular/router'), require('@angular/common'), require('@angular/forms'), require('@fortawesome/free-solid-svg-icons'), require('@fortawesome/angular-fontawesome'), require('@angular/platform-browser'), require('@angular/cdk/a11y'), require('@fortawesome/free-regular-svg-icons'), require('core-js/modules/es.array.includes'), require('@angular/cdk/scrolling'), require('@angular/common/locales/fr'), require('dayjs'), require('dayjs/plugin/isToday'), require('iban'), require('dayjs/plugin/localeData')) :
3
- typeof define === 'function' && define.amd ? define('@dsivd/prestations-ng', ['exports', '@angular/core', '@angular/common/http', 'rxjs', 'rxjs/operators', '@angular/router', '@angular/common', '@angular/forms', '@fortawesome/free-solid-svg-icons', '@fortawesome/angular-fontawesome', '@angular/platform-browser', '@angular/cdk/a11y', '@fortawesome/free-regular-svg-icons', 'core-js/modules/es.array.includes', '@angular/cdk/scrolling', '@angular/common/locales/fr', 'dayjs', 'dayjs/plugin/isToday', 'iban', 'dayjs/plugin/localeData'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.dsivd = global.dsivd || {}, global.dsivd['prestations-ng'] = {}), global.ng.core, global.ng.common.http, global.rxjs, global.rxjs.operators, global.ng.router, global.ng.common, global.ng.forms, global['@fortawesome/free-solid-svg-icons'], global['@fortawesome/angular-fontawesome'], global.ng.platformBrowser, global.ng.cdk.a11y, global['@fortawesome/free-regular-svg-icons'], null, global.ng.cdk.scrolling, global.ng.common.locales.fr, global.dayjs, global['dayjs/plugin/isToday'], global.iban, global['dayjs/plugin/localeData']));
5
- }(this, (function (exports, i0, i1, rxjs, operators, i1$1, i3, i4, freeSolidSvgIcons, i1$2, i1$3, i2, freeRegularSvgIcons, es_array_includes, i3$1, localeFr, dayjs, isToday, iban, localeData) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http'), require('rxjs'), require('rxjs/operators'), require('@angular/router'), require('@angular/common'), require('@angular/forms'), require('@fortawesome/free-solid-svg-icons'), require('@fortawesome/angular-fontawesome'), require('@angular/platform-browser'), require('@angular/cdk/a11y'), require('@fortawesome/free-regular-svg-icons'), require('core-js/modules/es.array.includes'), require('@angular/cdk/scrolling'), require('@angular/common/locales/fr'), require('dayjs'), require('dayjs/plugin/isToday'), require('ngx-image-cropper'), require('iban'), require('dayjs/plugin/localeData')) :
3
+ typeof define === 'function' && define.amd ? define('@dsivd/prestations-ng', ['exports', '@angular/core', '@angular/common/http', 'rxjs', 'rxjs/operators', '@angular/router', '@angular/common', '@angular/forms', '@fortawesome/free-solid-svg-icons', '@fortawesome/angular-fontawesome', '@angular/platform-browser', '@angular/cdk/a11y', '@fortawesome/free-regular-svg-icons', 'core-js/modules/es.array.includes', '@angular/cdk/scrolling', '@angular/common/locales/fr', 'dayjs', 'dayjs/plugin/isToday', 'ngx-image-cropper', 'iban', 'dayjs/plugin/localeData'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.dsivd = global.dsivd || {}, global.dsivd['prestations-ng'] = {}), global.ng.core, global.ng.common.http, global.rxjs, global.rxjs.operators, global.ng.router, global.ng.common, global.ng.forms, global['@fortawesome/free-solid-svg-icons'], global['@fortawesome/angular-fontawesome'], global.ng.platformBrowser, global.ng.cdk.a11y, global['@fortawesome/free-regular-svg-icons'], null, global.ng.cdk.scrolling, global.ng.common.locales.fr, global.dayjs, global['dayjs/plugin/isToday'], global['ngx-image-cropper'], global.iban, global['dayjs/plugin/localeData']));
5
+ }(this, (function (exports, i0, i1, rxjs, operators, i1$1, i3, i4, freeSolidSvgIcons, i1$2, i1$3, i2, freeRegularSvgIcons, es_array_includes, i3$1, localeFr, dayjs, isToday, i5, iban, localeData) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -38,6 +38,7 @@
38
38
  var localeFr__default = /*#__PURE__*/_interopDefaultLegacy(localeFr);
39
39
  var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
40
40
  var isToday__default = /*#__PURE__*/_interopDefaultLegacy(isToday);
41
+ var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
41
42
  var iban__namespace = /*#__PURE__*/_interopNamespace(iban);
42
43
  var localeData__default = /*#__PURE__*/_interopDefaultLegacy(localeData);
43
44
 
@@ -1903,7 +1904,17 @@
1903
1904
  '(fichier au format pdf), vous devez demander la prestation en étant connecté au portail sécurisé.',
1904
1905
  'use-login.text': "Cette prestation est aussi utilisable au travers de l'espace sécurisé qui vous " +
1905
1906
  "permet de pré-remplir le formulaire et de suivre l'avancement de traitement de la demande.",
1906
- 'use-login.button.text': 'Connectez-vous'
1907
+ 'use-login.button.text': 'Connectez-vous',
1908
+ 'foehn-picture-upload.choose-button-label': 'Choisissez une photo',
1909
+ 'foehn-picture-upload.loading-label': 'Chargement...',
1910
+ 'foehn-picture-upload.loading-failure-label': 'Impossible de charger la photo sélectionnée',
1911
+ 'foehn-picture-upload.validate-selection-label': 'Valider la sélection',
1912
+ 'foehn-picture-upload.cancel-selection-label': 'Annuler',
1913
+ 'foehn-picture-upload.selection-not-validated-label': 'Merci de valider votre sélection',
1914
+ 'foehn-picture-upload.delete-picture-label': 'Supprimer',
1915
+ 'foehn-table.totalElements': '{total} éléments trouvées',
1916
+ 'foehn-table.totalElements.1': '1 élément trouvée',
1917
+ 'foehn-table.totalElements.0': 'Aucun résultat'
1907
1918
  };
1908
1919
 
1909
1920
  var DICTIONARY_BASE_URL = 'api/dictionary';
@@ -5386,7 +5397,7 @@
5386
5397
 
5387
5398
  var GUIDE_URL = 'https://www.vd.ch/index.php?id=67827';
5388
5399
  var TERM_OF_USE_URL = 'https://www.vd.ch/index.php?id=2015321';
5389
- var SECURITY_BEST_PRACTICE_URL = 'https://www.vd.ch/securite-protection-donnees/';
5400
+ var SECURITY_BEST_PRACTICE_URL = 'https://www.vd.ch/index.php?id=2015320';
5390
5401
  var FoehnFooterComponent = /** @class */ (function () {
5391
5402
  function FoehnFooterComponent(applicationInfoService, gesdemEventService, gesdemService) {
5392
5403
  /**
@@ -9704,6 +9715,199 @@
9704
9715
  return PageChangeEvent;
9705
9716
  }());
9706
9717
 
9718
+ var hasInputChanged = function (change) { return !(!change ||
9719
+ !change.currentValue ||
9720
+ change.previousValue === change.currentValue); };
9721
+ var FoehnTableComponent = /** @class */ (function () {
9722
+ function FoehnTableComponent() {
9723
+ this.itemsPerPage = 10;
9724
+ this.id = 'foehn-table';
9725
+ this.previousLabel = 'Précédent';
9726
+ this.nextLabel = 'Suivant';
9727
+ this.pageChange = new i0.EventEmitter();
9728
+ this.sortChange = new i0.EventEmitter();
9729
+ this.currentPage = 1;
9730
+ this.filteredList = [];
9731
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
9732
+ this.trackByFn = function (index, item) { return index; };
9733
+ }
9734
+ Object.defineProperty(FoehnTableComponent.prototype, "list", {
9735
+ set: function (list) {
9736
+ this._list = list;
9737
+ },
9738
+ enumerable: false,
9739
+ configurable: true
9740
+ });
9741
+ FoehnTableComponent.prototype.ngOnChanges = function (changes) {
9742
+ var itemsPerPageChange = changes.itemsPerPage;
9743
+ var listChange = changes.list;
9744
+ var fixedPageCountChange = changes.fixedPageCount;
9745
+ if (!hasInputChanged(itemsPerPageChange) &&
9746
+ !hasInputChanged(listChange) &&
9747
+ !hasInputChanged(fixedPageCountChange)) {
9748
+ return;
9749
+ }
9750
+ this.buildFilteredList();
9751
+ };
9752
+ FoehnTableComponent.prototype.previousPage = function () {
9753
+ this.currentPage = this.currentPage - 1;
9754
+ this.buildFilteredList();
9755
+ this.pageChange.next({
9756
+ previousPage: this.currentPage + 1,
9757
+ currentPage: this.currentPage,
9758
+ pageCount: this.pagesCount()
9759
+ });
9760
+ };
9761
+ FoehnTableComponent.prototype.hasPreviousPage = function () {
9762
+ return this.currentPage > 1;
9763
+ };
9764
+ FoehnTableComponent.prototype.nextPage = function () {
9765
+ this.currentPage = this.currentPage + 1;
9766
+ this.buildFilteredList();
9767
+ this.pageChange.next({
9768
+ previousPage: this.currentPage - 1,
9769
+ currentPage: this.currentPage,
9770
+ pageCount: this.pagesCount()
9771
+ });
9772
+ };
9773
+ FoehnTableComponent.prototype.hasNextPage = function () {
9774
+ return this.currentPage < this.pagesCount();
9775
+ };
9776
+ FoehnTableComponent.prototype.showPage = function (page, emitPageChangeEvent) {
9777
+ if (emitPageChangeEvent === void 0) { emitPageChangeEvent = false; }
9778
+ if (this.currentPage === page) {
9779
+ return;
9780
+ }
9781
+ var previousPage = this.currentPage;
9782
+ this.currentPage = page;
9783
+ this.buildFilteredList();
9784
+ if (emitPageChangeEvent) {
9785
+ this.pageChange.next({
9786
+ previousPage: previousPage,
9787
+ currentPage: this.currentPage,
9788
+ pageCount: this.pagesCount()
9789
+ });
9790
+ }
9791
+ };
9792
+ FoehnTableComponent.prototype.pagesCount = function () {
9793
+ if (!!this.fixedPageCount) {
9794
+ return this.fixedPageCount;
9795
+ }
9796
+ return this._list
9797
+ ? Math.ceil(this._list.length / this.itemsPerPage)
9798
+ : 0;
9799
+ };
9800
+ FoehnTableComponent.prototype.triggerSort = function (sortAttribute) {
9801
+ var sortDirection = 'DESC';
9802
+ if (this.sort.sortAttribute === sortAttribute) {
9803
+ sortDirection = this.sort.sortDirection === 'DESC' ? 'ASC' : 'DESC';
9804
+ }
9805
+ this.sortChange.next({
9806
+ sortDirection: sortDirection,
9807
+ sortAttribute: sortAttribute
9808
+ });
9809
+ };
9810
+ FoehnTableComponent.prototype.buildFilteredList = function () {
9811
+ if (!!this.fixedPageCount) {
9812
+ this.filteredList = this._list;
9813
+ return;
9814
+ }
9815
+ var currentPageExists = (this.currentPage - 1) * this.itemsPerPage <= this._list.length;
9816
+ if (!currentPageExists) {
9817
+ this.currentPage = 1;
9818
+ }
9819
+ var start = (this.currentPage - 1) * this.itemsPerPage;
9820
+ this.filteredList = this._list
9821
+ ? this._list.slice(start, start + this.itemsPerPage)
9822
+ : [];
9823
+ };
9824
+ return FoehnTableComponent;
9825
+ }());
9826
+ FoehnTableComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: FoehnTableComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
9827
+ FoehnTableComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1__namespace$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["routerLink", "target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }], pipes: { "fromDictionary": SdkDictionaryPipe } });
9828
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: FoehnTableComponent, decorators: [{
9829
+ type: i0.Component,
9830
+ args: [{
9831
+ selector: 'foehn-table',
9832
+ templateUrl: './foehn-table.component.html',
9833
+ styleUrls: ['./foehn-table.component.css']
9834
+ }]
9835
+ }], propDecorators: { itemsPerPage: [{
9836
+ type: i0.Input
9837
+ }], id: [{
9838
+ type: i0.Input
9839
+ }], previousLabel: [{
9840
+ type: i0.Input
9841
+ }], nextLabel: [{
9842
+ type: i0.Input
9843
+ }], totalElements: [{
9844
+ type: i0.Input
9845
+ }], fixedPageCount: [{
9846
+ type: i0.Input
9847
+ }], columnsConfiguration: [{
9848
+ type: i0.Input
9849
+ }], pageChange: [{
9850
+ type: i0.Output
9851
+ }], sort: [{
9852
+ type: i0.Input
9853
+ }], sortChange: [{
9854
+ type: i0.Output
9855
+ }],
9856
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
9857
+ trackByFn: [{
9858
+ type: i0.Input
9859
+ }], list: [{
9860
+ type: i0.Input
9861
+ }] } });
9862
+
9863
+ var FoehnTableModule = /** @class */ (function () {
9864
+ function FoehnTableModule() {
9865
+ }
9866
+ return FoehnTableModule;
9867
+ }());
9868
+ FoehnTableModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: FoehnTableModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
9869
+ FoehnTableModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: FoehnTableModule, declarations: [FoehnTableComponent], imports: [i3.CommonModule,
9870
+ FoehnIconsModule,
9871
+ SdkDictionaryModule,
9872
+ i1$1.RouterModule], exports: [FoehnTableComponent] });
9873
+ FoehnTableModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: FoehnTableModule, imports: [[
9874
+ i3.CommonModule,
9875
+ FoehnIconsModule,
9876
+ SdkDictionaryModule,
9877
+ i1$1.RouterModule
9878
+ ]] });
9879
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: FoehnTableModule, decorators: [{
9880
+ type: i0.NgModule,
9881
+ args: [{
9882
+ imports: [
9883
+ i3.CommonModule,
9884
+ FoehnIconsModule,
9885
+ SdkDictionaryModule,
9886
+ i1$1.RouterModule
9887
+ ],
9888
+ declarations: [FoehnTableComponent],
9889
+ exports: [FoehnTableComponent]
9890
+ }]
9891
+ }] });
9892
+
9893
+ var FoehnTableColumnConfiguration = /** @class */ (function () {
9894
+ function FoehnTableColumnConfiguration() {
9895
+ }
9896
+ return FoehnTableColumnConfiguration;
9897
+ }());
9898
+
9899
+ var FoehnTablePageChangeEvent = /** @class */ (function () {
9900
+ function FoehnTablePageChangeEvent() {
9901
+ }
9902
+ return FoehnTablePageChangeEvent;
9903
+ }());
9904
+
9905
+ var TableSort = /** @class */ (function () {
9906
+ function TableSort() {
9907
+ }
9908
+ return TableSort;
9909
+ }());
9910
+
9707
9911
  var RedirectComponent = /** @class */ (function () {
9708
9912
  function RedirectComponent(iamInterceptor) {
9709
9913
  var _this = this;
@@ -10927,6 +11131,206 @@
10927
11131
  return BoDocumentsWithErrors;
10928
11132
  }());
10929
11133
 
11134
+ var blobToFile = function (blobData, fileName) {
11135
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
11136
+ var blob = blobData;
11137
+ blob.name = fileName;
11138
+ return blob;
11139
+ };
11140
+ var convertBase64UrlToFile = function (croppedImageasBase64Url, filename) {
11141
+ var arr = croppedImageasBase64Url.split(',');
11142
+ var mime = arr[0].match(/:(.*?);/)[1];
11143
+ var bstr = atob(arr[1]);
11144
+ var n = bstr.length;
11145
+ var u8arr = new Uint8Array(n);
11146
+ while (n--) {
11147
+ u8arr[n] = bstr.charCodeAt(n);
11148
+ }
11149
+ if (!navigator.msSaveBlob) {
11150
+ // detect if not Edge
11151
+ return new File([u8arr], filename, { type: mime });
11152
+ }
11153
+ else {
11154
+ // Edge support the FileAPI but not the File constructor.
11155
+ return blobToFile(new Blob([u8arr], { type: mime }), filename);
11156
+ }
11157
+ };
11158
+ var FoehnPictureUploadComponent = /** @class */ (function (_super) {
11159
+ __extends(FoehnPictureUploadComponent, _super);
11160
+ function FoehnPictureUploadComponent(growlService, uploadService, dictionaryService) {
11161
+ var _this = _super.call(this) || this;
11162
+ _this.growlService = growlService;
11163
+ _this.uploadService = uploadService;
11164
+ _this.dictionaryService = dictionaryService;
11165
+ _this.baseUrl = 'api/document';
11166
+ _this.croppedPictureFilename = 'photo.png';
11167
+ _this.resizeToWidth = 300;
11168
+ _this.resizeToHeight = 0;
11169
+ _this.loading = false;
11170
+ return _this;
11171
+ }
11172
+ FoehnPictureUploadComponent.prototype.ngOnInit = function () {
11173
+ var _this = this;
11174
+ _super.prototype.ngOnInit.call(this);
11175
+ this.currentLanguageSubscription = this.dictionaryService
11176
+ .getCurrentLanguageCode()
11177
+ .pipe(operators.distinctUntilChanged())
11178
+ .subscribe(function (language) {
11179
+ _this.currentLanguage = language;
11180
+ });
11181
+ };
11182
+ FoehnPictureUploadComponent.prototype.onPictureSelection = function (imgEvent) {
11183
+ this.refreshErrors([[], true]);
11184
+ this.pictureToCrop = imgEvent;
11185
+ this.loading = true;
11186
+ };
11187
+ FoehnPictureUploadComponent.prototype.onPictureSelectionFailed = function () {
11188
+ var errors = [
11189
+ {
11190
+ name: this.name,
11191
+ code: 'LoadingFailure',
11192
+ message: this.dictionaryService.getKeySync('foehn-picture-upload.loading-failure-label')
11193
+ }
11194
+ ];
11195
+ this.refreshErrors([errors, true]);
11196
+ this.resetPictureSelection();
11197
+ };
11198
+ FoehnPictureUploadComponent.prototype.onImageCropped = function (croppedEvent) {
11199
+ this.croppedPictureAsBase64Url = croppedEvent.base64;
11200
+ };
11201
+ FoehnPictureUploadComponent.prototype.resetPictureSelection = function () {
11202
+ this.croppedPictureAsBase64Url = null;
11203
+ this.pictureToCrop = null;
11204
+ this.loading = false;
11205
+ };
11206
+ FoehnPictureUploadComponent.prototype.savePicture = function () {
11207
+ var _this = this;
11208
+ this.markAsPristine();
11209
+ var photo = convertBase64UrlToFile(this.croppedPictureAsBase64Url, this.croppedPictureFilename);
11210
+ this.uploadService
11211
+ .uploadDocuments(this.baseUrl, this.name, this.label, [photo], this.key, false, this.currentLanguage)
11212
+ .pipe(operators.filter(function (result) { return !!result; }))
11213
+ .subscribe(function (_a) {
11214
+ var documents = _a.documents, errors = _a.errors;
11215
+ _this.resetPictureSelection();
11216
+ if (!!documents.length) {
11217
+ _this.markAsDirty();
11218
+ _this.model = documents;
11219
+ _this.refreshErrors([[], true]);
11220
+ }
11221
+ else {
11222
+ _this.model = [];
11223
+ _this.refreshErrors([errors, true]);
11224
+ }
11225
+ });
11226
+ };
11227
+ FoehnPictureUploadComponent.prototype.deleteFile = function () {
11228
+ var _this = this;
11229
+ this.uploadService
11230
+ .deleteDocument(this.baseUrl, this.model[0])
11231
+ .subscribe(function () {
11232
+ _this.model = [];
11233
+ _this.resetPictureSelection();
11234
+ });
11235
+ };
11236
+ FoehnPictureUploadComponent.prototype.getDownloadUrl = function () {
11237
+ return this.uploadService.getDownloadUrl(this.baseUrl, this.model[0]);
11238
+ };
11239
+ Object.defineProperty(FoehnPictureUploadComponent.prototype, "hasPicture", {
11240
+ get: function () {
11241
+ return this.model && this.model.length && !!this.model[0].reference;
11242
+ },
11243
+ enumerable: false,
11244
+ configurable: true
11245
+ });
11246
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
11247
+ FoehnPictureUploadComponent.prototype.refreshErrors = function (results) {
11248
+ var _this = this;
11249
+ var errors = results[0];
11250
+ var isInSelectionMode = !this.hasPicture && !!this.croppedPictureAsBase64Url;
11251
+ if (isInSelectionMode) {
11252
+ var notNullError = errors.find(function (e) { return e.name === _this.name && e.code === 'NotEmpty'; });
11253
+ if (notNullError) {
11254
+ notNullError.message = this.dictionaryService.getKeySync('foehn-picture-upload.selection-not-validated-label');
11255
+ }
11256
+ }
11257
+ _super.prototype.refreshErrors.call(this, results);
11258
+ };
11259
+ return FoehnPictureUploadComponent;
11260
+ }(FoehnInputComponent));
11261
+ FoehnPictureUploadComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: FoehnPictureUploadComponent, deps: [{ token: GrowlBrokerService }, { token: MultiUploadService }, { token: SdkDictionaryService }], target: i0__namespace.ɵɵFactoryTarget.Component });
11262
+ FoehnPictureUploadComponent.ɵcmp = i0__namespace.ɵɵ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: [
11263
+ {
11264
+ provide: FoehnInputComponent,
11265
+ useExisting: i0.forwardRef(function () { return FoehnPictureUploadComponent; }),
11266
+ multi: true
11267
+ }
11268
+ ], usesInheritance: true, ngImport: i0__namespace, 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__namespace.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__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4__namespace.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__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "fromDictionary": SdkDictionaryPipe } });
11269
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: FoehnPictureUploadComponent, decorators: [{
11270
+ type: i0.Component,
11271
+ args: [{
11272
+ selector: 'foehn-picture-upload',
11273
+ templateUrl: './foehn-picture-upload.component.html',
11274
+ providers: [
11275
+ {
11276
+ provide: FoehnInputComponent,
11277
+ useExisting: i0.forwardRef(function () { return FoehnPictureUploadComponent; }),
11278
+ multi: true
11279
+ }
11280
+ ]
11281
+ }]
11282
+ }], ctorParameters: function () { return [{ type: GrowlBrokerService }, { type: MultiUploadService }, { type: SdkDictionaryService }]; }, propDecorators: { name: [{
11283
+ type: i0.Input
11284
+ }], key: [{
11285
+ type: i0.Input
11286
+ }], label: [{
11287
+ type: i0.Input
11288
+ }], baseUrl: [{
11289
+ type: i0.Input
11290
+ }], croppedPictureFilename: [{
11291
+ type: i0.Input
11292
+ }], resizeToWidth: [{
11293
+ type: i0.Input
11294
+ }], resizeToHeight: [{
11295
+ type: i0.Input
11296
+ }] } });
11297
+
11298
+ var FoehnPictureUploadModule = /** @class */ (function () {
11299
+ function FoehnPictureUploadModule() {
11300
+ }
11301
+ return FoehnPictureUploadModule;
11302
+ }());
11303
+ FoehnPictureUploadModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: FoehnPictureUploadModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
11304
+ FoehnPictureUploadModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: FoehnPictureUploadModule, declarations: [FoehnPictureUploadComponent], imports: [i3.CommonModule,
11305
+ FoehnIconsModule,
11306
+ FoehnValidationAlertsModule,
11307
+ SdkDictionaryModule,
11308
+ i4.FormsModule,
11309
+ i5.ImageCropperModule], exports: [FoehnPictureUploadComponent] });
11310
+ FoehnPictureUploadModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: FoehnPictureUploadModule, imports: [[
11311
+ i3.CommonModule,
11312
+ FoehnIconsModule,
11313
+ FoehnValidationAlertsModule,
11314
+ SdkDictionaryModule,
11315
+ i4.FormsModule,
11316
+ i5.ImageCropperModule
11317
+ ]] });
11318
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: FoehnPictureUploadModule, decorators: [{
11319
+ type: i0.NgModule,
11320
+ args: [{
11321
+ imports: [
11322
+ i3.CommonModule,
11323
+ FoehnIconsModule,
11324
+ FoehnValidationAlertsModule,
11325
+ SdkDictionaryModule,
11326
+ i4.FormsModule,
11327
+ i5.ImageCropperModule
11328
+ ],
11329
+ declarations: [FoehnPictureUploadComponent],
11330
+ exports: [FoehnPictureUploadComponent]
11331
+ }]
11332
+ }] });
11333
+
10930
11334
  var EPaymentRequest = /** @class */ (function () {
10931
11335
  function EPaymentRequest() {
10932
11336
  }
@@ -12898,6 +13302,8 @@
12898
13302
  exports.FoehnPageModalComponent = FoehnPageModalComponent;
12899
13303
  exports.FoehnPageModule = FoehnPageModule;
12900
13304
  exports.FoehnPageService = FoehnPageService;
13305
+ exports.FoehnPictureUploadComponent = FoehnPictureUploadComponent;
13306
+ exports.FoehnPictureUploadModule = FoehnPictureUploadModule;
12901
13307
  exports.FoehnRadioComponent = FoehnRadioComponent;
12902
13308
  exports.FoehnRecapSectionComponent = FoehnRecapSectionComponent;
12903
13309
  exports.FoehnRecapSectionModule = FoehnRecapSectionModule;
@@ -12905,6 +13311,10 @@
12905
13311
  exports.FoehnRemainingAlertsSummaryModule = FoehnRemainingAlertsSummaryModule;
12906
13312
  exports.FoehnSelectComponent = FoehnSelectComponent;
12907
13313
  exports.FoehnSkipLinkComponent = FoehnSkipLinkComponent;
13314
+ exports.FoehnTableColumnConfiguration = FoehnTableColumnConfiguration;
13315
+ exports.FoehnTableComponent = FoehnTableComponent;
13316
+ exports.FoehnTableModule = FoehnTableModule;
13317
+ exports.FoehnTablePageChangeEvent = FoehnTablePageChangeEvent;
12908
13318
  exports.FoehnTimeComponent = FoehnTimeComponent;
12909
13319
  exports.FoehnUserConnectedAsComponent = FoehnUserConnectedAsComponent;
12910
13320
  exports.FoehnUserConnectedAsModule = FoehnUserConnectedAsModule;
@@ -12969,6 +13379,7 @@
12969
13379
  exports.Street = Street;
12970
13380
  exports.StreetNumber = StreetNumber;
12971
13381
  exports.THOUSANDS_SEPARATOR = THOUSANDS_SEPARATOR;
13382
+ exports.TableSort = TableSort;
12972
13383
  exports.UploaderHelper = UploaderHelper;
12973
13384
  exports.ValidationHandlerService = ValidationHandlerService;
12974
13385