@dsivd/prestations-ng 19.0.5-beta.4 → 19.0.5-beta.6

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.
@@ -771,6 +771,8 @@ class FoehnInputComponent {
771
771
  this.blurHandler = output({ alias: 'blur' });
772
772
  // eslint-disable-next-line @angular-eslint/no-output-native,@angular-eslint/no-output-rename
773
773
  this.focusHandler = output({ alias: 'focus' });
774
+ // not readonly, to be redefined in subcomponents
775
+ // eslint-disable-next-line @angular-eslint/prefer-signals
774
776
  this.displayClearButton = computed(() => this.clearButton() && !!this.model() && !this.disabled(), ...(ngDevMode ? [{ debugName: "displayClearButton" }] : /* istanbul ignore next */ []));
775
777
  this.validationHandlerService = inject(ValidationHandlerService);
776
778
  /**
@@ -6777,7 +6779,7 @@ class FoehnTableComponent extends FoehnInputComponent {
6777
6779
  this.columnsConfiguration = model(...(ngDevMode ? [undefined, { debugName: "columnsConfiguration" }] : /* istanbul ignore next */ []));
6778
6780
  this.itemsPerPage = input(10, ...(ngDevMode ? [{ debugName: "itemsPerPage" }] : /* istanbul ignore next */ []));
6779
6781
  this.fixedPageCount = input(...(ngDevMode ? [undefined, { debugName: "fixedPageCount" }] : /* istanbul ignore next */ []));
6780
- this.sort = input(...(ngDevMode ? [undefined, { debugName: "sort" }] : /* istanbul ignore next */ []));
6782
+ this.sort = model(...(ngDevMode ? [undefined, { debugName: "sort" }] : /* istanbul ignore next */ []));
6781
6783
  this.title = input(...(ngDevMode ? [undefined, { debugName: "title" }] : /* istanbul ignore next */ []));
6782
6784
  this.totalElements = input(...(ngDevMode ? [undefined, { debugName: "totalElements" }] : /* istanbul ignore next */ []));
6783
6785
  this.titleSrOnly = input(...(ngDevMode ? [undefined, { debugName: "titleSrOnly" }] : /* istanbul ignore next */ []));
@@ -6785,7 +6787,6 @@ class FoehnTableComponent extends FoehnInputComponent {
6785
6787
  this.nextLabel = input('Suivant', ...(ngDevMode ? [{ debugName: "nextLabel" }] : /* istanbul ignore next */ []));
6786
6788
  this.tableClass = input('', ...(ngDevMode ? [{ debugName: "tableClass" }] : /* istanbul ignore next */ []));
6787
6789
  this.trackByFn = input((index, _item) => index, ...(ngDevMode ? [{ debugName: "trackByFn" }] : /* istanbul ignore next */ []));
6788
- this.sortChange = output();
6789
6790
  this.pageChange = output();
6790
6791
  this.rowClick = output();
6791
6792
  this.currentPage = 1;
@@ -6863,7 +6864,7 @@ class FoehnTableComponent extends FoehnInputComponent {
6863
6864
  sortDirection =
6864
6865
  this.sort().sortDirection === 'DESC' ? 'ASC' : 'DESC';
6865
6866
  }
6866
- this.sortChange.emit({
6867
+ this.sort.set({
6867
6868
  sortDirection,
6868
6869
  sortAttribute,
6869
6870
  });
@@ -6891,7 +6892,7 @@ class FoehnTableComponent extends FoehnInputComponent {
6891
6892
  this.filteredList = this._list.slice(start, start + this.itemsPerPage());
6892
6893
  }
6893
6894
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.20", ngImport: i0, type: FoehnTableComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
6894
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.20", type: FoehnTableComponent, isStandalone: true, selector: "foehn-table", inputs: { columnsConfiguration: { classPropertyName: "columnsConfiguration", publicName: "columnsConfiguration", isSignal: true, isRequired: false, transformFunction: null }, itemsPerPage: { classPropertyName: "itemsPerPage", publicName: "itemsPerPage", isSignal: true, isRequired: false, transformFunction: null }, fixedPageCount: { classPropertyName: "fixedPageCount", publicName: "fixedPageCount", isSignal: true, isRequired: false, transformFunction: null }, sort: { classPropertyName: "sort", publicName: "sort", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, totalElements: { classPropertyName: "totalElements", publicName: "totalElements", isSignal: true, isRequired: false, transformFunction: null }, titleSrOnly: { classPropertyName: "titleSrOnly", publicName: "titleSrOnly", isSignal: true, isRequired: false, transformFunction: null }, previousLabel: { classPropertyName: "previousLabel", publicName: "previousLabel", isSignal: true, isRequired: false, transformFunction: null }, nextLabel: { classPropertyName: "nextLabel", publicName: "nextLabel", isSignal: true, isRequired: false, transformFunction: null }, tableClass: { classPropertyName: "tableClass", publicName: "tableClass", isSignal: true, isRequired: false, transformFunction: null }, trackByFn: { classPropertyName: "trackByFn", publicName: "trackByFn", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { columnsConfiguration: "columnsConfigurationChange", sortChange: "sortChange", pageChange: "pageChange", rowClick: "rowClick" }, providers: [
6895
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.20", type: FoehnTableComponent, isStandalone: true, selector: "foehn-table", inputs: { columnsConfiguration: { classPropertyName: "columnsConfiguration", publicName: "columnsConfiguration", isSignal: true, isRequired: false, transformFunction: null }, itemsPerPage: { classPropertyName: "itemsPerPage", publicName: "itemsPerPage", isSignal: true, isRequired: false, transformFunction: null }, fixedPageCount: { classPropertyName: "fixedPageCount", publicName: "fixedPageCount", isSignal: true, isRequired: false, transformFunction: null }, sort: { classPropertyName: "sort", publicName: "sort", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, totalElements: { classPropertyName: "totalElements", publicName: "totalElements", isSignal: true, isRequired: false, transformFunction: null }, titleSrOnly: { classPropertyName: "titleSrOnly", publicName: "titleSrOnly", isSignal: true, isRequired: false, transformFunction: null }, previousLabel: { classPropertyName: "previousLabel", publicName: "previousLabel", isSignal: true, isRequired: false, transformFunction: null }, nextLabel: { classPropertyName: "nextLabel", publicName: "nextLabel", isSignal: true, isRequired: false, transformFunction: null }, tableClass: { classPropertyName: "tableClass", publicName: "tableClass", isSignal: true, isRequired: false, transformFunction: null }, trackByFn: { classPropertyName: "trackByFn", publicName: "trackByFn", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { columnsConfiguration: "columnsConfigurationChange", sort: "sortChange", pageChange: "pageChange", rowClick: "rowClick" }, providers: [
6895
6896
  {
6896
6897
  provide: FoehnInputComponent,
6897
6898
  useExisting: forwardRef(() => FoehnTableComponent),
@@ -6916,7 +6917,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.20", ngImpo
6916
6917
  FoehnIconChevronRightComponent,
6917
6918
  SdkDictionaryPipe,
6918
6919
  ], template: "<div\n class=\"form-group\"\n [class.has-danger]=\"hasErrors()\"\n [class.vd-form-group-danger]=\"hasErrors()\"\n [attr.id]=\"buildId('Container')\"\n tabindex=\"-1\"\n>\n @if (label() && type !== 'hidden') {\n <p\n [attr.id]=\"buildChildId() + 'Label'\"\n [class.visually-hidden]=\"isLabelSrOnly()\"\n [class.vd-p]=\"!isLabelSrOnly()\"\n >\n <span [innerHTML]=\"label()\"></span>\n @if (!required() && !hideNotRequiredExtraLabel()) {\n <span aria-hidden=\"true\">\n {{ 'foehn-input.optional' | fromDictionary }}\n </span>\n }\n </p>\n }\n\n <foehn-validation-alerts [component]=\"this\" />\n\n @if (helpText() && type !== 'hidden') {\n <small\n [attr.id]=\"buildChildId() + 'Help'\"\n class=\"form-text text-secondary\"\n [innerHTML]=\"helpText()\"\n ></small>\n }\n\n <!-- Fake input with NgModel to be registered into Form controls -->\n <input type=\"hidden\" [name]=\"name() || label()\" [ngModel]=\"model()\" />\n\n <!-- Templates must be stored inside component so that \"@ViewChildren subComponents\" can be filled up with FoehnInputComponent -->\n <ng-content />\n\n <div class=\"row\" [id]=\"buildId() || 'foehn-table'\">\n <div class=\"col-12\">\n @if (!!totalElements() && totalElements() === 1) {\n <h4>\n {{ 'foehn-table.totalElements.1' | fromDictionary }}\n </h4>\n }\n @if (!!totalElements() && totalElements() !== 1) {\n <h4>\n {{\n 'foehn-table.totalElements'\n | fromDictionary\n : { total: totalElements().toString() }\n }}\n </h4>\n }\n </div>\n\n <div class=\"col-12 table-responsive\">\n <table class=\"table table-hover {{ tableClass() }}\" #entryComponent>\n @if (title()?.length) {\n <caption [class.visually-hidden]=\"titleSrOnly()\">\n {{\n title()\n }}\n </caption>\n }\n <thead>\n <tr>\n @for (\n col of columnsConfiguration();\n track trackFoehnTableColumnConfiguration(\n $index,\n col\n )\n ) {\n <th\n class=\"vd-bg-pattern-bars-gray\"\n scope=\"col\"\n [id]=\"col.id\"\n >\n @if (\n !filteredList.length || !col.sortAttribute\n ) {\n <span\n [innerHTML]=\"\n col.columnLabelKey | fromDictionary\n \"\n ></span>\n }\n @if (\n !!filteredList.length && !!col.sortAttribute\n ) {\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\n | fromDictionary)\n \"\n >\n <span\n [innerHTML]=\"\n col.columnLabelKey\n | fromDictionary\n \"\n ></span>\n @if (\n sort().sortAttribute ===\n col.sortAttribute\n ) {\n @if (\n sort().sortDirection === 'ASC'\n ) {\n <span class=\"ms-3\">\n <foehn-icon-chevron-up />\n </span>\n }\n @if (\n sort().sortDirection === 'DESC'\n ) {\n <span class=\"ms-3\">\n <foehn-icon-chevron-down />\n </span>\n }\n }\n </a>\n }\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (\n item of filteredList;\n track trackByFn()(index, item);\n let index = $index\n ) {\n <tr\n #tableRowElement\n (click)=\"manageRowClick(tableRowElement, item)\"\n >\n @for (\n col of columnsConfiguration();\n track trackFoehnTableColumnConfiguration(\n $index,\n col\n )\n ) {\n <td [id]=\"col.id + '-' + index\">\n @if (!!col.isImportant) {\n @if (col.isImportant(item)) {\n <span\n class=\"cell-vertical-align-middle\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"30\"\n height=\"30\"\n fill=\"currentColor\"\n class=\"bi bi-exclamation text-danger\"\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 }\n }\n @if (!!col.iconGetter) {\n @if (col.iconGetter(item); as iconDef) {\n <span\n class=\"cell-vertical-align-middle me-2\"\n >\n <fa-icon\n aria-hidden=\"true\"\n [icon]=\"iconDef.icon\"\n [title]=\"iconDef.label\"\n />\n <span class=\"visually-hidden\">\n {{ iconDef.label }}\n </span>\n </span>\n }\n }\n @if (!!col.template) {\n <ng-template\n [ngTemplateOutlet]=\"col.template\"\n [ngTemplateOutletContext]=\"{\n item: item,\n index: index,\n }\"\n />\n }\n @if (!col.template) {\n <span\n [innerHTML]=\"col.valueGetter(item)\"\n class=\"cell-vertical-align-middle\"\n ></span>\n }\n </td>\n }\n </tr>\n }\n @if (!!columnsConfiguration() && !filteredList.length) {\n <tr>\n <td [colSpan]=\"columnsConfiguration().length\">\n <div class=\"w-100 text-center\">\n {{\n 'foehn-table.totalElements.0'\n | fromDictionary\n }}\n </div>\n </td>\n </tr>\n }\n </tbody>\n </table>\n\n @if (hasPreviousPage() || hasNextPage()) {\n <nav\n [id]=\"buildId('_navContainer')\"\n class=\"vd-pagination\"\n aria-label=\"Pagination\"\n >\n <ul class=\"vd-pagination__list\">\n @if (hasPreviousPage()) {\n <li\n class=\"vd-pagination__item vd-pagination__item--previous\"\n >\n <button\n [id]=\"buildId('_prevButton')\"\n type=\"button\"\n class=\"btn 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 />\n {{ previousLabel() }}\n </span>\n <span class=\"visually-hidden\">:</span>\n <span class=\"vd-pagination__label\">\n {{ currentPage - 1 }} sur\n {{ pagesCount() }}\n </span>\n </button>\n </li>\n }\n @if (hasNextPage()) {\n <li\n class=\"vd-pagination__item vd-pagination__item--next\"\n >\n <button\n [id]=\"buildId('_nextButton')\"\n type=\"button\"\n class=\"btn 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 />\n </span>\n <span class=\"visually-hidden\">:</span>\n <span class=\"vd-pagination__label\">\n {{ currentPage + 1 }} sur\n {{ pagesCount() }}\n </span>\n </button>\n </li>\n }\n </ul>\n </nav>\n }\n </div>\n </div>\n</div>\n", styles: [".btn-no-extra{padding:0;border:none;font-weight:400;text-decoration-line:none}.vd-pagination{margin-bottom:1rem}.vd-pagination__link-reset{background:none;border:none;font-weight:inherit;text-decoration-line:none;text-align:inherit;cursor:pointer}.vd-pagination__link-reset:focus{background-color:var(--vd-focus)}:host ::ng-deep .btn.btn-link .svg-inline--fa{color:var(--vd-primary-dark)}:host ::ng-deep .btn.btn-link:hover .svg-inline--fa{color:var(--vd-neutral-dark)}.btn.btn-link{text-transform:none}.cell-vertical-align-middle{vertical-align:middle}\n"] }]
6919
- }], propDecorators: { columnsConfiguration: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnsConfiguration", required: false }] }, { type: i0.Output, args: ["columnsConfigurationChange"] }], itemsPerPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemsPerPage", required: false }] }], fixedPageCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "fixedPageCount", required: false }] }], sort: [{ type: i0.Input, args: [{ isSignal: true, alias: "sort", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], totalElements: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalElements", required: false }] }], titleSrOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleSrOnly", required: false }] }], previousLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "previousLabel", required: false }] }], nextLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "nextLabel", required: false }] }], tableClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableClass", required: false }] }], trackByFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackByFn", required: false }] }], sortChange: [{ type: i0.Output, args: ["sortChange"] }], pageChange: [{ type: i0.Output, args: ["pageChange"] }], rowClick: [{ type: i0.Output, args: ["rowClick"] }] } });
6920
+ }], propDecorators: { columnsConfiguration: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnsConfiguration", required: false }] }, { type: i0.Output, args: ["columnsConfigurationChange"] }], itemsPerPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemsPerPage", required: false }] }], fixedPageCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "fixedPageCount", required: false }] }], sort: [{ type: i0.Input, args: [{ isSignal: true, alias: "sort", required: false }] }, { type: i0.Output, args: ["sortChange"] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], totalElements: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalElements", required: false }] }], titleSrOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleSrOnly", required: false }] }], previousLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "previousLabel", required: false }] }], nextLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "nextLabel", required: false }] }], tableClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableClass", required: false }] }], trackByFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackByFn", required: false }] }], pageChange: [{ type: i0.Output, args: ["pageChange"] }], rowClick: [{ type: i0.Output, args: ["rowClick"] }] } });
6920
6921
 
6921
6922
  class DraftsService {
6922
6923
  constructor() {
@@ -9330,12 +9331,11 @@ class FoehnMultiselectAutocompleteComponent extends FoehnAutocompleteComponent {
9330
9331
  manageSuggestionListAndFocusAfterRemovingAnItem(removedIndex) {
9331
9332
  // Hide message saying no more suggestions to display
9332
9333
  this.showEmptyListMessage = false;
9333
- const autocompleteComponent = this.autocompleteComponent();
9334
- if (autocompleteComponent) {
9334
+ if (this.autocompleteComponent()) {
9335
9335
  // Manually show autocomplete because there is at least one suggestions to display
9336
- autocompleteComponent.inputElement().nativeElement.hidden = false;
9336
+ this.autocompleteComponent().inputElement().nativeElement.hidden = false;
9337
9337
  // Add back selected item to autocomplete suggestion list
9338
- autocompleteComponent.elements.set(this.filterAutocompleteElements(this.elements()));
9338
+ this.autocompleteComponent().elements.set(this.filterAutocompleteElements(this.elements()));
9339
9339
  }
9340
9340
  if (removedIndex !== null) {
9341
9341
  // When deleting a selected item, check were to set focus back when no more items to delete
@@ -14498,7 +14498,7 @@ class FoehnListSummaryComponent extends FoehnInputComponent {
14498
14498
  })
14499
14499
  .then(() => {
14500
14500
  const updatedList = this.internalList().filter((_item, itemIndex) => itemIndex !== index);
14501
- this.internalList.set(updatedList);
14501
+ this.updateNgModel(updatedList);
14502
14502
  this.updateListCopyForTable(updatedList);
14503
14503
  this.itemRemoved.emit();
14504
14504
  }, () => {
@@ -14507,7 +14507,7 @@ class FoehnListSummaryComponent extends FoehnInputComponent {
14507
14507
  }
14508
14508
  changeSort(sortEvent) {
14509
14509
  const sortedList = this.sortNow(this.internalList(), sortEvent);
14510
- this.internalList.set(sortedList);
14510
+ this.updateNgModel(sortedList);
14511
14511
  this.updateListCopyForTable(sortedList);
14512
14512
  this.tableSort = sortEvent;
14513
14513
  }