@dsivd/prestations-ng 14.5.23-beta8 → 14.5.23-beta9

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.
@@ -1930,8 +1930,10 @@
1930
1930
  'foehn-status-progress-bar.step3': 'Confirmation',
1931
1931
  'foehn-status-progress-bar.step3.srOnly': 'Etape 3 sur 3, Confirmation, demande transmise',
1932
1932
  'foehn-multiselect-autocomplete.selected.delete': 'Supprimer {elementLabel}',
1933
- 'foehn-multiselect-autocomplete.sr-announcement.deleted': '{elementLabel} a été supprimé, ',
1934
- 'foehn-multiselect-autocomplete.sr-announcement.added': '{elementLabel} a été ajouté, ',
1933
+ 'foehn-multiselect-autocomplete.sr-announcement.deleted': '{elementLabel} a été supprimé,',
1934
+ 'foehn-multiselect-autocomplete.sr-announcement.added': '{elementLabel} a été ajouté,',
1935
+ 'foehn-multiselect-autocomplete.sr-default-focus.no-element-to-delete': 'Aucun élément à supprimer dans la liste.',
1936
+ 'foehn-multiselect-autocomplete.sr-default-selected-element': '(sélection par défaut)',
1935
1937
  'foehn-multiselect-autocomplete.autocomplete.empty-message': 'Tous les éléments de la liste de proposition ont déjà été ajoutés.',
1936
1938
  'foehn-multiselect-autocomplete.autocomplete.screen-reader.label': 'Sélectionner un élément dans la liste de recherche' +
1937
1939
  ' ci-dessous pour l\'ajouter à votre sélection.'
@@ -8907,14 +8909,11 @@
8907
8909
  }
8908
8910
  }
8909
8911
  };
8910
- FoehnMultiselectAutocompleteComponent.prototype.removeItem = function (item) {
8911
- var index = this.model.indexOf(item);
8912
- if (index > -1) {
8913
- this.model.splice(index, 1);
8914
- this.triggerUserInput(this.model);
8915
- this.manageSuggestionListAndFocusAfterRemovingAnItem();
8916
- this.manageScreenReaderAnnouncement(item, true);
8917
- }
8912
+ FoehnMultiselectAutocompleteComponent.prototype.removeItem = function (item, index) {
8913
+ this.model.splice(index, 1);
8914
+ this.triggerUserInput(this.model);
8915
+ this.manageSuggestionListAndFocusAfterRemovingAnItem(index);
8916
+ this.manageScreenReaderAnnouncement(item, true);
8918
8917
  };
8919
8918
  FoehnMultiselectAutocompleteComponent.prototype.trackByFn = function (index) {
8920
8919
  return index;
@@ -8962,6 +8961,25 @@
8962
8961
  }
8963
8962
  return this.model;
8964
8963
  };
8964
+ FoehnMultiselectAutocompleteComponent.prototype.focusNextAreaAfterDelete = function (removedIndex) {
8965
+ // Adjust index depending on default elements that are not deletable
8966
+ if (!!this.defaultElementValues) {
8967
+ removedIndex -= this.defaultElementValues.length;
8968
+ }
8969
+ var closeButtonsElemRefArray = __spreadArray([], __read(this.selectedElemRef.toArray()));
8970
+ // Need to find an element to focus on
8971
+ if (removedIndex === closeButtonsElemRefArray.length) {
8972
+ if (!!closeButtonsElemRefArray.length) {
8973
+ return closeButtonsElemRefArray[removedIndex - 1].nativeElement.focus();
8974
+ }
8975
+ var defaultElemRefArray = __spreadArray([], __read(this.defaultElemRef.toArray()));
8976
+ if (!!defaultElemRefArray.length) {
8977
+ return defaultElemRefArray[defaultElemRefArray.length - 1].nativeElement.focus();
8978
+ }
8979
+ return this.defaultFocusArea.nativeElement.focus();
8980
+ }
8981
+ // Otherwise focus element by DOM replacement
8982
+ };
8965
8983
  FoehnMultiselectAutocompleteComponent.prototype.filterAutocompleteElements = function (elements) {
8966
8984
  var _this = this;
8967
8985
  var filteredElements = ObjectHelper.deepCopy(elements);
@@ -9007,7 +9025,7 @@
9007
9025
  });
9008
9026
  }
9009
9027
  };
9010
- FoehnMultiselectAutocompleteComponent.prototype.manageSuggestionListAndFocusAfterRemovingAnItem = function () {
9028
+ FoehnMultiselectAutocompleteComponent.prototype.manageSuggestionListAndFocusAfterRemovingAnItem = function (removedIndex) {
9011
9029
  var _this = this;
9012
9030
  // Hide message saying no more suggestions to display
9013
9031
  this.showEmptyListMessage = false;
@@ -9017,10 +9035,7 @@
9017
9035
  this.autocompleteComponent.elements = this.filterAutocompleteElements(this.elements);
9018
9036
  // When deleting a selected item, check were to set focus back when no more items to delete
9019
9037
  this.selectedElemRef.changes.pipe(operators.first()).subscribe(function () {
9020
- var selectedElemRefArray = __spreadArray([], __read(_this.selectedElemRef.toArray()));
9021
- if (!selectedElemRefArray.length && !!_this.selectedItemsArea) {
9022
- _this.selectedItemsArea.nativeElement.focus();
9023
- }
9038
+ _this.focusNextAreaAfterDelete(removedIndex);
9024
9039
  });
9025
9040
  };
9026
9041
  FoehnMultiselectAutocompleteComponent.prototype.showAlertMessageAndHideAutocomplete = function () {
@@ -9052,7 +9067,7 @@
9052
9067
  useExisting: i0.forwardRef(function () { return FoehnMultiselectAutocompleteComponent; }),
9053
9068
  multi: true
9054
9069
  }
9055
- ], viewQueries: [{ propertyName: "autocompleteComponent", first: true, predicate: ["autocompleteComponent"], descendants: true }, { propertyName: "alertMessageContainer", first: true, predicate: ["alertMessageContainer"], descendants: true }, { propertyName: "selectedItemsArea", first: true, predicate: ["selectedItemsArea"], descendants: true }, { propertyName: "selectedElemRef", predicate: ["selectedElemRef"], descendants: true }], usesInheritance: true, ngImport: i0__namespace, template: "<foehn-autocomplete\n #autocompleteComponent\n [name]=\"name\"\n [label]=\"label\"\n [elements]=\"elements\"\n [elementsUrl]=\"elementsUrl\"\n [elementValue]=\"elementValue\"\n [elementLabel]=\"elementLabel\"\n [elementValueIdentity]=\"elementValueIdentity\"\n [elementDisabled]=\"elementDisabled\"\n [allElementDisabled]=\"allElementDisabled\"\n [elementGroup]=\"elementGroup\"\n [allowCustomValue]=\"false\"\n [searchValueMinCharsCount]=\"searchValueMinCharsCount\"\n [customValueModelGenerator]=\"customValueModelGenerator\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n (userInput)=\"addItem($event)\"\n [(model)]=\"autocompleteInputValue\"\n (elementsLoaded)=\"onAutocompleteElementsLoaded($event)\"\n>\n <small\n *ngIf=\"!showEmptyListMessage\"\n [attr.id]=\"buildChildId('Help')\"\n class=\"form-text text-secondary\"\n [innerHTML]=\"helpText ? helpText : 'foehn-multiselect-autocomplete.autocomplete.screen-reader.label' | fromDictionary\"\n ></small>\n\n <div\n [id]=\"buildChildId('AlertMessageContainer')\"\n role=\"status\"\n #alertMessageContainer\n >\n <p\n *ngIf=\"showEmptyListMessage\"\n class=\"alert alert-info\"\n tabindex=\"0\"\n >{{'foehn-multiselect-autocomplete.autocomplete.empty-message' | fromDictionary}}</p>\n </div>\n</foehn-autocomplete>\n\n<p\n class=\"sr-only\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n>\n {{srAnnouncements}}\n</p>\n\n<div\n role=\"presentation\"\n class=\"selected-list-container d-flex align-content-stretch flex-wrap\"\n [ngClass]=\"!!model && !!model.length ? 'mb-2' : 'mb-0'\"\n #selectedItemsArea\n>\n <ng-container *ngFor=\"let element of model; let index = index; trackBy: trackByFn\">\n <span\n *ngIf=\"!canBeDeleted(index)\"\n class=\"badge badge-pill badge-secondary mr-1 mb-1 py-2 px-3 d-flex align-items-center\"\n [tabindex]=\"disabled ? -1 : 0\"\n [attr.aria-describedby]=\"buildChildId('Label')\"\n >\n {{getLabel(element)}}\n </span>\n <button\n *ngIf=\"canBeDeleted(index)\"\n class=\"btn btn-secondary badge badge-pill mr-1 mb-1 py-2 px-3 d-flex align-items-center\"\n [tabindex]=\"0\"\n [attr.aria-label]=\"getDeleteButtonAriaLabel(element)\"\n [attr.aria-describedby]=\"buildChildId('Label')\"\n [title]=\"getDeleteButtonAriaLabel(element)\"\n (click)=\"removeItem(element)\"\n #selectedElemRef\n >\n {{getLabel(element)}}\n <foehn-icon-times\n aria-hidden=\"true\"\n class=\"ml-2\"\n [title]=\"getDeleteButtonAriaLabel(element)\"\n ></foehn-icon-times>\n </button>\n </ng-container>\n</div>\n", styles: ["foehn-autocomplete p.alert:focus{outline:0;box-shadow:inset 0 1px 1px #00000013,0 0 0 .2rem #ffbf47}.selected-list-container button>.btn,.btn-link{line-height:inherit;padding:0}.selected-list-container .btn{text-transform:none}.selected-list-container span.badge-pill:focus{outline:0;box-shadow:inset 0 1px 1px #00000013,0 0 0 .2rem #ffbf47}\n"], components: [{ type: FoehnAutocompleteComponent, selector: "foehn-autocomplete", inputs: ["searchValueMinCharsCount", "allowCustomValue", "customValueModelGenerator"] }, { type: FoehnIconTimesComponent, selector: "foehn-icon-times" }], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "fromDictionary": SdkDictionaryPipe } });
9070
+ ], viewQueries: [{ propertyName: "autocompleteComponent", first: true, predicate: ["autocompleteComponent"], descendants: true }, { propertyName: "alertMessageContainer", first: true, predicate: ["alertMessageContainer"], descendants: true }, { propertyName: "defaultFocusArea", first: true, predicate: ["defaultFocusArea"], descendants: true }, { propertyName: "selectedElemRef", predicate: ["selectedElemRef"], descendants: true }, { propertyName: "defaultElemRef", predicate: ["defaultElemRef"], descendants: true }], usesInheritance: true, ngImport: i0__namespace, template: "<foehn-autocomplete\n #autocompleteComponent\n [name]=\"name\"\n [label]=\"label\"\n [elements]=\"elements\"\n [elementsUrl]=\"elementsUrl\"\n [elementValue]=\"elementValue\"\n [elementLabel]=\"elementLabel\"\n [elementValueIdentity]=\"elementValueIdentity\"\n [elementDisabled]=\"elementDisabled\"\n [allElementDisabled]=\"allElementDisabled\"\n [elementGroup]=\"elementGroup\"\n [allowCustomValue]=\"false\"\n [searchValueMinCharsCount]=\"searchValueMinCharsCount\"\n [customValueModelGenerator]=\"customValueModelGenerator\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n (userInput)=\"addItem($event)\"\n [(model)]=\"autocompleteInputValue\"\n (elementsLoaded)=\"onAutocompleteElementsLoaded($event)\"\n>\n <small\n *ngIf=\"!showEmptyListMessage\"\n [attr.id]=\"buildChildId('Help')\"\n class=\"form-text text-secondary\"\n [innerHTML]=\"helpText ? helpText : 'foehn-multiselect-autocomplete.autocomplete.screen-reader.label' | fromDictionary\"\n ></small>\n\n <div\n [id]=\"buildChildId('AlertMessageContainer')\"\n role=\"status\"\n #alertMessageContainer\n >\n <p\n *ngIf=\"showEmptyListMessage\"\n class=\"alert alert-info\"\n tabindex=\"0\"\n >{{'foehn-multiselect-autocomplete.autocomplete.empty-message' | fromDictionary}}</p>\n </div>\n</foehn-autocomplete>\n\n<p\n class=\"sr-only\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n>\n {{srAnnouncements}}\n</p>\n\n<div\n role=\"presentation\"\n class=\"selected-list-container d-flex align-content-stretch flex-wrap\"\n [ngClass]=\"!!model && !!model.length ? 'mb-2' : 'mb-0'\"\n>\n <span\n *ngIf=\"(!defaultElementValues || !defaultElementValues.length) && (!model || !model.length)\"\n class=\"sr-only\"\n [tabindex]=\"disabled ? -1 : 0\"\n [innerHTML]=\"'foehn-multiselect-autocomplete.sr-default-focus.no-element-to-delete' | fromDictionary\"\n #defaultFocusArea\n ></span>\n <ng-container *ngFor=\"let element of model; let index = index; trackBy: trackByFn\">\n <span\n *ngIf=\"!canBeDeleted(index)\"\n class=\"badge badge-pill badge-secondary mr-1 mb-1 py-2 px-3 d-flex align-items-center\"\n [tabindex]=\"disabled ? -1 : 0\"\n [attr.aria-describedby]=\"buildChildId('Label')\"\n #defaultElemRef\n >\n {{getLabel(element)}}\n <span class=\"sr-only\">\n {{'foehn-multiselect-autocomplete.sr-default-selected-element' | fromDictionary}}\n </span>\n </span>\n <button\n *ngIf=\"canBeDeleted(index)\"\n class=\"btn btn-secondary badge badge-pill mr-1 mb-1 py-2 px-3 d-flex align-items-center\"\n [tabindex]=\"0\"\n [attr.aria-label]=\"getDeleteButtonAriaLabel(element)\"\n [attr.aria-describedby]=\"buildChildId('Label')\"\n [title]=\"getDeleteButtonAriaLabel(element)\"\n (click)=\"removeItem(element, index)\"\n #selectedElemRef\n >\n {{getLabel(element)}}\n <foehn-icon-times\n aria-hidden=\"true\"\n class=\"ml-2\"\n [title]=\"getDeleteButtonAriaLabel(element)\"\n ></foehn-icon-times>\n </button>\n </ng-container>\n</div>\n", styles: ["foehn-autocomplete p.alert:focus{outline:0;box-shadow:inset 0 1px 1px #00000013,0 0 0 .2rem #ffbf47}.selected-list-container button>.btn,.btn-link{line-height:inherit;padding:0}.selected-list-container .btn{text-transform:none}.selected-list-container span.badge-pill:focus{outline:0;box-shadow:inset 0 1px 1px #00000013,0 0 0 .2rem #ffbf47}\n"], components: [{ type: FoehnAutocompleteComponent, selector: "foehn-autocomplete", inputs: ["searchValueMinCharsCount", "allowCustomValue", "customValueModelGenerator"] }, { type: FoehnIconTimesComponent, selector: "foehn-icon-times" }], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "fromDictionary": SdkDictionaryPipe } });
9056
9071
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: FoehnMultiselectAutocompleteComponent, decorators: [{
9057
9072
  type: i0.Component,
9058
9073
  args: [{
@@ -9076,9 +9091,12 @@
9076
9091
  }], selectedElemRef: [{
9077
9092
  type: i0.ViewChildren,
9078
9093
  args: ['selectedElemRef']
9079
- }], selectedItemsArea: [{
9094
+ }], defaultElemRef: [{
9095
+ type: i0.ViewChildren,
9096
+ args: ['defaultElemRef']
9097
+ }], defaultFocusArea: [{
9080
9098
  type: i0.ViewChild,
9081
- args: ['selectedItemsArea']
9099
+ args: ['defaultFocusArea']
9082
9100
  }], defaultElementValues: [{
9083
9101
  type: i0.Input
9084
9102
  }], defaultElementValue: [{