@dsivd/prestations-ng 14.5.23-beta4 → 14.5.23-beta5
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/bundles/dsivd-prestations-ng.umd.js +23 -105
- package/bundles/dsivd-prestations-ng.umd.js.map +1 -1
- package/dsivd-prestations-ng-v14.5.23-beta5.tgz +0 -0
- package/esm2015/foehn-multiselect-autocomplete/foehn-multiselect-autocomplete.component.js +22 -102
- package/esm2015/sdk-dictionary/default-dictionary.js +3 -4
- package/fesm2015/dsivd-prestations-ng.js +22 -102
- package/fesm2015/dsivd-prestations-ng.js.map +1 -1
- package/foehn-multiselect-autocomplete/foehn-multiselect-autocomplete.component.d.ts +4 -14
- package/package.json +1 -1
- package/dsivd-prestations-ng-v14.5.23-beta4.tgz +0 -0
|
@@ -1448,9 +1448,8 @@ const DEFAULT_DICTIONARY = {
|
|
|
1448
1448
|
'foehn-status-progress-bar.step3': 'Confirmation',
|
|
1449
1449
|
'foehn-status-progress-bar.step3.srOnly': 'Etape 3 sur 3, Confirmation, demande transmise',
|
|
1450
1450
|
'foehn-multiselect-autocomplete.selected.delete': 'Supprimer {elementLabel}',
|
|
1451
|
-
'foehn-multiselect-autocomplete.
|
|
1452
|
-
'foehn-multiselect-autocomplete.
|
|
1453
|
-
'foehn-multiselect-autocomplete.list-of-selected-items': 'Liste des éléments sélectionnés:',
|
|
1451
|
+
'foehn-multiselect-autocomplete.sr-announcement.deleted': '{elementLabel} a été supprimé, ',
|
|
1452
|
+
'foehn-multiselect-autocomplete.sr-announcement.added': '{elementLabel} a été ajouté, ',
|
|
1454
1453
|
'foehn-multiselect-autocomplete.autocomplete.empty-message': 'Tous les éléments de la liste de proposition ont déjà été ajoutés.',
|
|
1455
1454
|
'foehn-multiselect-autocomplete.autocomplete.screen-reader.label': 'Sélectionner un élément dans la liste de recherche' +
|
|
1456
1455
|
' ci-dessous pour l\'ajouter à votre sélection.'
|
|
@@ -7819,7 +7818,7 @@ class FoehnMultiselectAutocompleteComponent extends FoehnAutocompleteComponent {
|
|
|
7819
7818
|
super(ngZone);
|
|
7820
7819
|
this.dictionaryService = dictionaryService;
|
|
7821
7820
|
this.showEmptyListMessage = false;
|
|
7822
|
-
this.
|
|
7821
|
+
this.srAnnouncements = '';
|
|
7823
7822
|
}
|
|
7824
7823
|
set defaultElementValues(items) {
|
|
7825
7824
|
this.defaultElementValues_ = [...items];
|
|
@@ -7833,11 +7832,6 @@ class FoehnMultiselectAutocompleteComponent extends FoehnAutocompleteComponent {
|
|
|
7833
7832
|
set defaultElementValue(item) {
|
|
7834
7833
|
this.defaultElementValues = [item];
|
|
7835
7834
|
}
|
|
7836
|
-
handleKeyboardDownEvent(event) {
|
|
7837
|
-
if (this.keyboardNavigationAllowed) {
|
|
7838
|
-
this.onKeyDownSelectedInner(event);
|
|
7839
|
-
}
|
|
7840
|
-
}
|
|
7841
7835
|
updateMultiselectAutocomplete() {
|
|
7842
7836
|
const validValue = this.getValidValue();
|
|
7843
7837
|
if (typeof validValue !== 'undefined') {
|
|
@@ -7861,6 +7855,7 @@ class FoehnMultiselectAutocompleteComponent extends FoehnAutocompleteComponent {
|
|
|
7861
7855
|
this.updateMultiselectAutocomplete();
|
|
7862
7856
|
this.handleUserInput();
|
|
7863
7857
|
this.manageSuggestionListAndFocusAfterAddingAnItem();
|
|
7858
|
+
this.manageScreenReaderAnnouncement(item, false);
|
|
7864
7859
|
}
|
|
7865
7860
|
}
|
|
7866
7861
|
}
|
|
@@ -7870,6 +7865,7 @@ class FoehnMultiselectAutocompleteComponent extends FoehnAutocompleteComponent {
|
|
|
7870
7865
|
this.model.splice(index, 1);
|
|
7871
7866
|
this.triggerUserInput(this.model);
|
|
7872
7867
|
this.manageSuggestionListAndFocusAfterRemovingAnItem();
|
|
7868
|
+
this.manageScreenReaderAnnouncement(item, true);
|
|
7873
7869
|
}
|
|
7874
7870
|
}
|
|
7875
7871
|
trackByFn(index) {
|
|
@@ -7880,29 +7876,9 @@ class FoehnMultiselectAutocompleteComponent extends FoehnAutocompleteComponent {
|
|
|
7880
7876
|
const elem = this.findElementByModelItem(value);
|
|
7881
7877
|
return super.getLabel(elem);
|
|
7882
7878
|
}
|
|
7883
|
-
getSelectedElementTabIndex(index) {
|
|
7884
|
-
let firstIndexFocusable = 0;
|
|
7885
|
-
if (!!this.defaultElementValues) {
|
|
7886
|
-
firstIndexFocusable = this.model.findIndex((selected) => !this.defaultElementValues.includes(selected));
|
|
7887
|
-
}
|
|
7888
|
-
if (index !== firstIndexFocusable) {
|
|
7889
|
-
return -1;
|
|
7890
|
-
}
|
|
7891
|
-
return 0;
|
|
7892
|
-
}
|
|
7893
|
-
isSelectedItemFocusable(index) {
|
|
7894
|
-
return !this.disabled && !!this.defaultElementValues && this.defaultElementValues.includes(this.model[index]);
|
|
7895
|
-
}
|
|
7896
7879
|
canBeDeleted(index) {
|
|
7897
7880
|
return !this.defaultElementValues || !this.defaultElementValues.includes(this.model[index]);
|
|
7898
7881
|
}
|
|
7899
|
-
onSelectedItemsFocusin() {
|
|
7900
|
-
this.keyboardNavigationAllowed = true;
|
|
7901
|
-
this.currentFocusedElem = document.activeElement;
|
|
7902
|
-
}
|
|
7903
|
-
onSelectedItemsFocusout() {
|
|
7904
|
-
this.keyboardNavigationAllowed = false;
|
|
7905
|
-
}
|
|
7906
7882
|
onAutocompleteElementsLoaded(elements) {
|
|
7907
7883
|
// Need to wait for childView to be loaded
|
|
7908
7884
|
setTimeout(() => {
|
|
@@ -7914,8 +7890,8 @@ class FoehnMultiselectAutocompleteComponent extends FoehnAutocompleteComponent {
|
|
|
7914
7890
|
}
|
|
7915
7891
|
});
|
|
7916
7892
|
}
|
|
7917
|
-
|
|
7918
|
-
return `${this.
|
|
7893
|
+
getDeleteButtonAriaLabel(element) {
|
|
7894
|
+
return `${this.dictionaryService.getKeySync('foehn-multiselect-autocomplete.selected.delete', { elementLabel: this.getLabel(element) })}`;
|
|
7919
7895
|
}
|
|
7920
7896
|
findElementByModelItem(item) {
|
|
7921
7897
|
if (!!this.elements && !!this.elements.length) {
|
|
@@ -7936,55 +7912,6 @@ class FoehnMultiselectAutocompleteComponent extends FoehnAutocompleteComponent {
|
|
|
7936
7912
|
}
|
|
7937
7913
|
return this.model;
|
|
7938
7914
|
}
|
|
7939
|
-
getFirstDeleteButtonToFocus() {
|
|
7940
|
-
const closeButtonsElemRefArray = [...this.closeButtonsElemRef.toArray()];
|
|
7941
|
-
if (!!closeButtonsElemRefArray.length) {
|
|
7942
|
-
return closeButtonsElemRefArray[0].nativeElement;
|
|
7943
|
-
}
|
|
7944
|
-
return null;
|
|
7945
|
-
}
|
|
7946
|
-
navigateSelectedList(offset) {
|
|
7947
|
-
if (!this.disabled) {
|
|
7948
|
-
const closeButtonsElemRefArray = this.getDefaultSelectedElements().concat([...this.closeButtonsElemRef.toArray()]);
|
|
7949
|
-
if (!!closeButtonsElemRefArray.length) {
|
|
7950
|
-
const focusIndex = closeButtonsElemRefArray.findIndex(value => this.currentFocusedElem === value.nativeElement);
|
|
7951
|
-
let newIndex = focusIndex + offset;
|
|
7952
|
-
if (newIndex >= closeButtonsElemRefArray.length) {
|
|
7953
|
-
newIndex = 0;
|
|
7954
|
-
}
|
|
7955
|
-
if (newIndex < 0) {
|
|
7956
|
-
newIndex = closeButtonsElemRefArray.length - 1;
|
|
7957
|
-
}
|
|
7958
|
-
const elemRef = closeButtonsElemRefArray[newIndex];
|
|
7959
|
-
if (!!elemRef) {
|
|
7960
|
-
elemRef.nativeElement.focus();
|
|
7961
|
-
}
|
|
7962
|
-
}
|
|
7963
|
-
}
|
|
7964
|
-
}
|
|
7965
|
-
getDefaultSelectedElements() {
|
|
7966
|
-
return [...this.selectedElemRef.toArray()].filter(value => value.nativeElement.getAttribute('is-default') === 'true');
|
|
7967
|
-
}
|
|
7968
|
-
onKeyDownSelectedInner(keyEvent) {
|
|
7969
|
-
// IE doesn't support keyEvent.code, and has different values
|
|
7970
|
-
// in keyEvent.key (Down instead of ArrowDown for instance), hence the multi-support.
|
|
7971
|
-
const ie11CompatibleCode = keyEvent.code || keyEvent.key;
|
|
7972
|
-
switch (ie11CompatibleCode) {
|
|
7973
|
-
case 'Right':
|
|
7974
|
-
case 'ArrowRight':
|
|
7975
|
-
this.navigateSelectedList(1);
|
|
7976
|
-
break;
|
|
7977
|
-
case 'Left':
|
|
7978
|
-
case 'ArrowLeft':
|
|
7979
|
-
this.navigateSelectedList(-1);
|
|
7980
|
-
break;
|
|
7981
|
-
default:
|
|
7982
|
-
return true;
|
|
7983
|
-
}
|
|
7984
|
-
keyEvent.preventDefault();
|
|
7985
|
-
keyEvent.stopPropagation();
|
|
7986
|
-
return false;
|
|
7987
|
-
}
|
|
7988
7915
|
filterAutocompleteElements(elements) {
|
|
7989
7916
|
const filteredElements = ObjectHelper.deepCopy(elements);
|
|
7990
7917
|
if (!!this.model && !!this.model.length) {
|
|
@@ -8001,6 +7928,7 @@ class FoehnMultiselectAutocompleteComponent extends FoehnAutocompleteComponent {
|
|
|
8001
7928
|
return filteredElements;
|
|
8002
7929
|
}
|
|
8003
7930
|
manageSuggestionListAndFocusAfterAddingAnItem() {
|
|
7931
|
+
// Empty autocomplete input
|
|
8004
7932
|
this.autocompleteInputValue = null;
|
|
8005
7933
|
// Remove selected item from autocomplete suggestion list
|
|
8006
7934
|
this.autocompleteComponent.elements = this.filterAutocompleteElements(this.elements);
|
|
@@ -8023,17 +7951,6 @@ class FoehnMultiselectAutocompleteComponent extends FoehnAutocompleteComponent {
|
|
|
8023
7951
|
this.autocompleteComponent.inputElement.nativeElement.hidden = false;
|
|
8024
7952
|
// Add back selected item to autocomplete suggestion list
|
|
8025
7953
|
this.autocompleteComponent.elements = this.filterAutocompleteElements(this.elements);
|
|
8026
|
-
// When deleting a selected item, check were to set focus back
|
|
8027
|
-
this.closeButtonsElemRef.changes.pipe(first()).subscribe(() => {
|
|
8028
|
-
const buttonToFocus = this.getFirstDeleteButtonToFocus();
|
|
8029
|
-
if (!!buttonToFocus) {
|
|
8030
|
-
buttonToFocus.focus();
|
|
8031
|
-
}
|
|
8032
|
-
else {
|
|
8033
|
-
this.autocompleteComponent.setFocusOnInput();
|
|
8034
|
-
this.autocompleteComponent.onInputFocus();
|
|
8035
|
-
}
|
|
8036
|
-
});
|
|
8037
7954
|
}
|
|
8038
7955
|
showAlertMessageAndHideAutocomplete() {
|
|
8039
7956
|
// Show a message to user indicating there is no more suggestions to display
|
|
@@ -8042,15 +7959,27 @@ class FoehnMultiselectAutocompleteComponent extends FoehnAutocompleteComponent {
|
|
|
8042
7959
|
this.autocompleteInputValue = null;
|
|
8043
7960
|
this.autocompleteComponent.inputElement.nativeElement.hidden = true;
|
|
8044
7961
|
}
|
|
7962
|
+
manageScreenReaderAnnouncement(element, isDelete) {
|
|
7963
|
+
clearTimeout(this.srAnnouncementAutoClearTimer);
|
|
7964
|
+
if (isDelete) {
|
|
7965
|
+
this.srAnnouncements += `${this.dictionaryService.getKeySync('foehn-multiselect-autocomplete.sr-announcement.deleted', { elementLabel: this.getLabel(element) })}`;
|
|
7966
|
+
}
|
|
7967
|
+
else {
|
|
7968
|
+
this.srAnnouncements += `${this.dictionaryService.getKeySync('foehn-multiselect-autocomplete.sr-announcement.added', { elementLabel: this.getLabel(element) })}`;
|
|
7969
|
+
}
|
|
7970
|
+
this.srAnnouncementAutoClearTimer = setTimeout(() => {
|
|
7971
|
+
this.srAnnouncements = '';
|
|
7972
|
+
}, 10000);
|
|
7973
|
+
}
|
|
8045
7974
|
}
|
|
8046
7975
|
FoehnMultiselectAutocompleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: FoehnMultiselectAutocompleteComponent, deps: [{ token: i0.NgZone }, { token: SdkDictionaryService }], target: i0.ɵɵFactoryTarget.Component });
|
|
8047
|
-
FoehnMultiselectAutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.4", type: FoehnMultiselectAutocompleteComponent, selector: "foehn-multiselect-autocomplete", inputs: { defaultElementValues: "defaultElementValues", defaultElementValue: "defaultElementValue" },
|
|
7976
|
+
FoehnMultiselectAutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.4", type: FoehnMultiselectAutocompleteComponent, selector: "foehn-multiselect-autocomplete", inputs: { defaultElementValues: "defaultElementValues", defaultElementValue: "defaultElementValue" }, providers: [
|
|
8048
7977
|
{
|
|
8049
7978
|
provide: FoehnInputComponent,
|
|
8050
7979
|
useExisting: forwardRef(() => FoehnMultiselectAutocompleteComponent),
|
|
8051
7980
|
multi: true
|
|
8052
7981
|
}
|
|
8053
|
-
], viewQueries: [{ propertyName: "autocompleteComponent", first: true, predicate: ["autocompleteComponent"], descendants: true }, { propertyName: "alertMessageContainer", first: true, predicate: ["alertMessageContainer"], descendants: true }
|
|
7982
|
+
], viewQueries: [{ propertyName: "autocompleteComponent", first: true, predicate: ["autocompleteComponent"], descendants: true }, { propertyName: "alertMessageContainer", first: true, predicate: ["alertMessageContainer"], descendants: true }], usesInheritance: true, ngImport: i0, 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 <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]=\"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 >\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.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "fromDictionary": SdkDictionaryPipe } });
|
|
8054
7983
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: FoehnMultiselectAutocompleteComponent, decorators: [{
|
|
8055
7984
|
type: Component,
|
|
8056
7985
|
args: [{
|
|
@@ -8071,19 +8000,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImpor
|
|
|
8071
8000
|
}], alertMessageContainer: [{
|
|
8072
8001
|
type: ViewChild,
|
|
8073
8002
|
args: ['alertMessageContainer']
|
|
8074
|
-
}], closeButtonsElemRef: [{
|
|
8075
|
-
type: ViewChildren,
|
|
8076
|
-
args: ['closeButtonsElemRef']
|
|
8077
|
-
}], selectedElemRef: [{
|
|
8078
|
-
type: ViewChildren,
|
|
8079
|
-
args: ['selectedElemRef']
|
|
8080
8003
|
}], defaultElementValues: [{
|
|
8081
8004
|
type: Input
|
|
8082
8005
|
}], defaultElementValue: [{
|
|
8083
8006
|
type: Input
|
|
8084
|
-
}], handleKeyboardDownEvent: [{
|
|
8085
|
-
type: HostListener,
|
|
8086
|
-
args: ['keydown', ['$event']]
|
|
8087
8007
|
}] } });
|
|
8088
8008
|
|
|
8089
8009
|
class FoehnMultiselectAutocompleteModule {
|