@dsivd/prestations-ng 14.5.23-beta4 → 14.5.23-beta7
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 +34 -101
- package/bundles/dsivd-prestations-ng.umd.js.map +1 -1
- package/dsivd-prestations-ng-v14.5.23-beta7.tgz +0 -0
- package/esm2015/foehn-multiselect-autocomplete/foehn-multiselect-autocomplete.component.js +34 -99
- package/esm2015/sdk-dictionary/default-dictionary.js +3 -4
- package/fesm2015/dsivd-prestations-ng.js +33 -99
- package/fesm2015/dsivd-prestations-ng.js.map +1 -1
- package/foehn-multiselect-autocomplete/foehn-multiselect-autocomplete.component.d.ts +6 -13
- 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,8 @@ class FoehnMultiselectAutocompleteComponent extends FoehnAutocompleteComponent {
|
|
|
7819
7818
|
super(ngZone);
|
|
7820
7819
|
this.dictionaryService = dictionaryService;
|
|
7821
7820
|
this.showEmptyListMessage = false;
|
|
7822
|
-
this.
|
|
7821
|
+
this.srAnnouncements = '';
|
|
7822
|
+
this.SR_ANNOUNCEMENT_CLEAR_TIMEOUT_INTERVAL_MS = 2000;
|
|
7823
7823
|
}
|
|
7824
7824
|
set defaultElementValues(items) {
|
|
7825
7825
|
this.defaultElementValues_ = [...items];
|
|
@@ -7833,11 +7833,6 @@ class FoehnMultiselectAutocompleteComponent extends FoehnAutocompleteComponent {
|
|
|
7833
7833
|
set defaultElementValue(item) {
|
|
7834
7834
|
this.defaultElementValues = [item];
|
|
7835
7835
|
}
|
|
7836
|
-
handleKeyboardDownEvent(event) {
|
|
7837
|
-
if (this.keyboardNavigationAllowed) {
|
|
7838
|
-
this.onKeyDownSelectedInner(event);
|
|
7839
|
-
}
|
|
7840
|
-
}
|
|
7841
7836
|
updateMultiselectAutocomplete() {
|
|
7842
7837
|
const validValue = this.getValidValue();
|
|
7843
7838
|
if (typeof validValue !== 'undefined') {
|
|
@@ -7861,6 +7856,7 @@ class FoehnMultiselectAutocompleteComponent extends FoehnAutocompleteComponent {
|
|
|
7861
7856
|
this.updateMultiselectAutocomplete();
|
|
7862
7857
|
this.handleUserInput();
|
|
7863
7858
|
this.manageSuggestionListAndFocusAfterAddingAnItem();
|
|
7859
|
+
this.manageScreenReaderAnnouncement(item, false);
|
|
7864
7860
|
}
|
|
7865
7861
|
}
|
|
7866
7862
|
}
|
|
@@ -7870,6 +7866,7 @@ class FoehnMultiselectAutocompleteComponent extends FoehnAutocompleteComponent {
|
|
|
7870
7866
|
this.model.splice(index, 1);
|
|
7871
7867
|
this.triggerUserInput(this.model);
|
|
7872
7868
|
this.manageSuggestionListAndFocusAfterRemovingAnItem();
|
|
7869
|
+
this.manageScreenReaderAnnouncement(item, true);
|
|
7873
7870
|
}
|
|
7874
7871
|
}
|
|
7875
7872
|
trackByFn(index) {
|
|
@@ -7880,28 +7877,8 @@ class FoehnMultiselectAutocompleteComponent extends FoehnAutocompleteComponent {
|
|
|
7880
7877
|
const elem = this.findElementByModelItem(value);
|
|
7881
7878
|
return super.getLabel(elem);
|
|
7882
7879
|
}
|
|
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
7880
|
canBeDeleted(index) {
|
|
7897
|
-
return !this.defaultElementValues || !this.defaultElementValues.includes(this.model[index]);
|
|
7898
|
-
}
|
|
7899
|
-
onSelectedItemsFocusin() {
|
|
7900
|
-
this.keyboardNavigationAllowed = true;
|
|
7901
|
-
this.currentFocusedElem = document.activeElement;
|
|
7902
|
-
}
|
|
7903
|
-
onSelectedItemsFocusout() {
|
|
7904
|
-
this.keyboardNavigationAllowed = false;
|
|
7881
|
+
return !this.disabled && (!this.defaultElementValues || !this.defaultElementValues.includes(this.model[index]));
|
|
7905
7882
|
}
|
|
7906
7883
|
onAutocompleteElementsLoaded(elements) {
|
|
7907
7884
|
// Need to wait for childView to be loaded
|
|
@@ -7914,12 +7891,12 @@ class FoehnMultiselectAutocompleteComponent extends FoehnAutocompleteComponent {
|
|
|
7914
7891
|
}
|
|
7915
7892
|
});
|
|
7916
7893
|
}
|
|
7917
|
-
|
|
7918
|
-
return `${this.
|
|
7894
|
+
getDeleteButtonAriaLabel(element) {
|
|
7895
|
+
return `${this.dictionaryService.getKeySync('foehn-multiselect-autocomplete.selected.delete', { elementLabel: this.getLabel(element) })}`;
|
|
7919
7896
|
}
|
|
7920
7897
|
findElementByModelItem(item) {
|
|
7921
7898
|
if (!!this.elements && !!this.elements.length) {
|
|
7922
|
-
const itemValue = typeof item
|
|
7899
|
+
const itemValue = typeof item !== 'object' ? item : this.getValue(item);
|
|
7923
7900
|
const elem = this.elements.find((element) => this.getValue(element) === itemValue);
|
|
7924
7901
|
if (!!elem) {
|
|
7925
7902
|
return elem;
|
|
@@ -7936,55 +7913,6 @@ class FoehnMultiselectAutocompleteComponent extends FoehnAutocompleteComponent {
|
|
|
7936
7913
|
}
|
|
7937
7914
|
return this.model;
|
|
7938
7915
|
}
|
|
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
7916
|
filterAutocompleteElements(elements) {
|
|
7989
7917
|
const filteredElements = ObjectHelper.deepCopy(elements);
|
|
7990
7918
|
if (!!this.model && !!this.model.length) {
|
|
@@ -8001,6 +7929,7 @@ class FoehnMultiselectAutocompleteComponent extends FoehnAutocompleteComponent {
|
|
|
8001
7929
|
return filteredElements;
|
|
8002
7930
|
}
|
|
8003
7931
|
manageSuggestionListAndFocusAfterAddingAnItem() {
|
|
7932
|
+
// Empty autocomplete input
|
|
8004
7933
|
this.autocompleteInputValue = null;
|
|
8005
7934
|
// Remove selected item from autocomplete suggestion list
|
|
8006
7935
|
this.autocompleteComponent.elements = this.filterAutocompleteElements(this.elements);
|
|
@@ -8023,15 +7952,11 @@ class FoehnMultiselectAutocompleteComponent extends FoehnAutocompleteComponent {
|
|
|
8023
7952
|
this.autocompleteComponent.inputElement.nativeElement.hidden = false;
|
|
8024
7953
|
// Add back selected item to autocomplete suggestion list
|
|
8025
7954
|
this.autocompleteComponent.elements = this.filterAutocompleteElements(this.elements);
|
|
8026
|
-
// When deleting a selected item, check were to set focus back
|
|
8027
|
-
this.
|
|
8028
|
-
const
|
|
8029
|
-
if (!!
|
|
8030
|
-
|
|
8031
|
-
}
|
|
8032
|
-
else {
|
|
8033
|
-
this.autocompleteComponent.setFocusOnInput();
|
|
8034
|
-
this.autocompleteComponent.onInputFocus();
|
|
7955
|
+
// When deleting a selected item, check were to set focus back when no more items to delete
|
|
7956
|
+
this.selectedElemRef.changes.pipe(first()).subscribe(() => {
|
|
7957
|
+
const selectedElemRefArray = [...this.selectedElemRef.toArray()];
|
|
7958
|
+
if (!selectedElemRefArray.length && !!this.selectedItemsArea) {
|
|
7959
|
+
this.selectedItemsArea.nativeElement.setFocus();
|
|
8035
7960
|
}
|
|
8036
7961
|
});
|
|
8037
7962
|
}
|
|
@@ -8042,15 +7967,27 @@ class FoehnMultiselectAutocompleteComponent extends FoehnAutocompleteComponent {
|
|
|
8042
7967
|
this.autocompleteInputValue = null;
|
|
8043
7968
|
this.autocompleteComponent.inputElement.nativeElement.hidden = true;
|
|
8044
7969
|
}
|
|
7970
|
+
manageScreenReaderAnnouncement(element, isDelete) {
|
|
7971
|
+
clearTimeout(this.srAnnouncementClearTimer);
|
|
7972
|
+
if (isDelete) {
|
|
7973
|
+
this.srAnnouncements += `${this.dictionaryService.getKeySync('foehn-multiselect-autocomplete.sr-announcement.deleted', { elementLabel: this.getLabel(element) })}`;
|
|
7974
|
+
}
|
|
7975
|
+
else {
|
|
7976
|
+
this.srAnnouncements += `${this.dictionaryService.getKeySync('foehn-multiselect-autocomplete.sr-announcement.added', { elementLabel: this.getLabel(element) })}`;
|
|
7977
|
+
}
|
|
7978
|
+
this.srAnnouncementClearTimer = setTimeout(() => {
|
|
7979
|
+
this.srAnnouncements = '';
|
|
7980
|
+
}, this.SR_ANNOUNCEMENT_CLEAR_TIMEOUT_INTERVAL_MS);
|
|
7981
|
+
}
|
|
8045
7982
|
}
|
|
8046
7983
|
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" },
|
|
7984
|
+
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
7985
|
{
|
|
8049
7986
|
provide: FoehnInputComponent,
|
|
8050
7987
|
useExisting: forwardRef(() => FoehnMultiselectAutocompleteComponent),
|
|
8051
7988
|
multi: true
|
|
8052
7989
|
}
|
|
8053
|
-
], viewQueries: [{ propertyName: "autocompleteComponent", first: true, predicate: ["autocompleteComponent"], descendants: true }, { propertyName: "alertMessageContainer", first: true, predicate: ["alertMessageContainer"], descendants: true }, { propertyName: "
|
|
7990
|
+
], 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, 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.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
7991
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: FoehnMultiselectAutocompleteComponent, decorators: [{
|
|
8055
7992
|
type: Component,
|
|
8056
7993
|
args: [{
|
|
@@ -8071,19 +8008,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImpor
|
|
|
8071
8008
|
}], alertMessageContainer: [{
|
|
8072
8009
|
type: ViewChild,
|
|
8073
8010
|
args: ['alertMessageContainer']
|
|
8074
|
-
}], closeButtonsElemRef: [{
|
|
8075
|
-
type: ViewChildren,
|
|
8076
|
-
args: ['closeButtonsElemRef']
|
|
8077
8011
|
}], selectedElemRef: [{
|
|
8078
8012
|
type: ViewChildren,
|
|
8079
8013
|
args: ['selectedElemRef']
|
|
8014
|
+
}], selectedItemsArea: [{
|
|
8015
|
+
type: ViewChild,
|
|
8016
|
+
args: ['selectedItemsArea']
|
|
8080
8017
|
}], defaultElementValues: [{
|
|
8081
8018
|
type: Input
|
|
8082
8019
|
}], defaultElementValue: [{
|
|
8083
8020
|
type: Input
|
|
8084
|
-
}], handleKeyboardDownEvent: [{
|
|
8085
|
-
type: HostListener,
|
|
8086
|
-
args: ['keydown', ['$event']]
|
|
8087
8021
|
}] } });
|
|
8088
8022
|
|
|
8089
8023
|
class FoehnMultiselectAutocompleteModule {
|