@dsivd/prestations-ng 14.5.23-beta3 → 14.5.23-beta6
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 +24 -105
- package/bundles/dsivd-prestations-ng.umd.js.map +1 -1
- package/dsivd-prestations-ng-v14.5.23-beta6.tgz +0 -0
- package/esm2015/foehn-multiselect-autocomplete/foehn-multiselect-autocomplete.component.js +23 -102
- package/esm2015/sdk-dictionary/default-dictionary.js +3 -4
- package/fesm2015/dsivd-prestations-ng.js +23 -102
- package/fesm2015/dsivd-prestations-ng.js.map +1 -1
- package/foehn-multiselect-autocomplete/foehn-multiselect-autocomplete.component.d.ts +5 -14
- package/package.json +1 -1
- package/dsivd-prestations-ng-v14.5.23-beta3.tgz +0 -0
|
@@ -1930,9 +1930,8 @@
|
|
|
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.
|
|
1934
|
-
'foehn-multiselect-autocomplete.
|
|
1935
|
-
'foehn-multiselect-autocomplete.list-of-selected-items': 'Liste des éléments sélectionnés:',
|
|
1933
|
+
'foehn-multiselect-autocomplete.sr-announcement.deleted': '{elementLabel} a été supprimé, ',
|
|
1934
|
+
'foehn-multiselect-autocomplete.sr-announcement.added': '{elementLabel} a été ajouté, ',
|
|
1936
1935
|
'foehn-multiselect-autocomplete.autocomplete.empty-message': 'Tous les éléments de la liste de proposition ont déjà été ajoutés.',
|
|
1937
1936
|
'foehn-multiselect-autocomplete.autocomplete.screen-reader.label': 'Sélectionner un élément dans la liste de recherche' +
|
|
1938
1937
|
' ci-dessous pour l\'ajouter à votre sélection.'
|
|
@@ -8857,7 +8856,8 @@
|
|
|
8857
8856
|
var _this = _super.call(this, ngZone) || this;
|
|
8858
8857
|
_this.dictionaryService = dictionaryService;
|
|
8859
8858
|
_this.showEmptyListMessage = false;
|
|
8860
|
-
_this.
|
|
8859
|
+
_this.srAnnouncements = '';
|
|
8860
|
+
_this.SR_ANNOUNCEMENT_CLEAR_TIMEOUT_INTERVAL = 4000;
|
|
8861
8861
|
return _this;
|
|
8862
8862
|
}
|
|
8863
8863
|
Object.defineProperty(FoehnMultiselectAutocompleteComponent.prototype, "defaultElementValues", {
|
|
@@ -8880,11 +8880,6 @@
|
|
|
8880
8880
|
enumerable: false,
|
|
8881
8881
|
configurable: true
|
|
8882
8882
|
});
|
|
8883
|
-
FoehnMultiselectAutocompleteComponent.prototype.handleKeyboardDownEvent = function (event) {
|
|
8884
|
-
if (this.keyboardNavigationAllowed) {
|
|
8885
|
-
this.onKeyDownSelectedInner(event);
|
|
8886
|
-
}
|
|
8887
|
-
};
|
|
8888
8883
|
FoehnMultiselectAutocompleteComponent.prototype.updateMultiselectAutocomplete = function () {
|
|
8889
8884
|
var validValue = this.getValidValue();
|
|
8890
8885
|
if (typeof validValue !== 'undefined') {
|
|
@@ -8908,6 +8903,7 @@
|
|
|
8908
8903
|
this.updateMultiselectAutocomplete();
|
|
8909
8904
|
this.handleUserInput();
|
|
8910
8905
|
this.manageSuggestionListAndFocusAfterAddingAnItem();
|
|
8906
|
+
this.manageScreenReaderAnnouncement(item, false);
|
|
8911
8907
|
}
|
|
8912
8908
|
}
|
|
8913
8909
|
};
|
|
@@ -8917,6 +8913,7 @@
|
|
|
8917
8913
|
this.model.splice(index, 1);
|
|
8918
8914
|
this.triggerUserInput(this.model);
|
|
8919
8915
|
this.manageSuggestionListAndFocusAfterRemovingAnItem();
|
|
8916
|
+
this.manageScreenReaderAnnouncement(item, true);
|
|
8920
8917
|
}
|
|
8921
8918
|
};
|
|
8922
8919
|
FoehnMultiselectAutocompleteComponent.prototype.trackByFn = function (index) {
|
|
@@ -8927,30 +8924,9 @@
|
|
|
8927
8924
|
var elem = this.findElementByModelItem(value);
|
|
8928
8925
|
return _super.prototype.getLabel.call(this, elem);
|
|
8929
8926
|
};
|
|
8930
|
-
FoehnMultiselectAutocompleteComponent.prototype.getSelectedElementTabIndex = function (index) {
|
|
8931
|
-
var _this = this;
|
|
8932
|
-
var firstIndexFocusable = 0;
|
|
8933
|
-
if (!!this.defaultElementValues) {
|
|
8934
|
-
firstIndexFocusable = this.model.findIndex(function (selected) { return !_this.defaultElementValues.includes(selected); });
|
|
8935
|
-
}
|
|
8936
|
-
if (index !== firstIndexFocusable) {
|
|
8937
|
-
return -1;
|
|
8938
|
-
}
|
|
8939
|
-
return 0;
|
|
8940
|
-
};
|
|
8941
|
-
FoehnMultiselectAutocompleteComponent.prototype.isSelectedItemFocusable = function (index) {
|
|
8942
|
-
return !this.disabled && !!this.defaultElementValues && this.defaultElementValues.includes(this.model[index]);
|
|
8943
|
-
};
|
|
8944
8927
|
FoehnMultiselectAutocompleteComponent.prototype.canBeDeleted = function (index) {
|
|
8945
8928
|
return !this.defaultElementValues || !this.defaultElementValues.includes(this.model[index]);
|
|
8946
8929
|
};
|
|
8947
|
-
FoehnMultiselectAutocompleteComponent.prototype.onSelectedItemsFocusin = function () {
|
|
8948
|
-
this.keyboardNavigationAllowed = true;
|
|
8949
|
-
this.currentFocusedElem = document.activeElement;
|
|
8950
|
-
};
|
|
8951
|
-
FoehnMultiselectAutocompleteComponent.prototype.onSelectedItemsFocusout = function () {
|
|
8952
|
-
this.keyboardNavigationAllowed = false;
|
|
8953
|
-
};
|
|
8954
8930
|
FoehnMultiselectAutocompleteComponent.prototype.onAutocompleteElementsLoaded = function (elements) {
|
|
8955
8931
|
var _this = this;
|
|
8956
8932
|
// Need to wait for childView to be loaded
|
|
@@ -8963,8 +8939,8 @@
|
|
|
8963
8939
|
}
|
|
8964
8940
|
});
|
|
8965
8941
|
};
|
|
8966
|
-
FoehnMultiselectAutocompleteComponent.prototype.
|
|
8967
|
-
return
|
|
8942
|
+
FoehnMultiselectAutocompleteComponent.prototype.getDeleteButtonAriaLabel = function (element) {
|
|
8943
|
+
return "" + this.dictionaryService.getKeySync('foehn-multiselect-autocomplete.selected.delete', { elementLabel: this.getLabel(element) });
|
|
8968
8944
|
};
|
|
8969
8945
|
FoehnMultiselectAutocompleteComponent.prototype.findElementByModelItem = function (item) {
|
|
8970
8946
|
var _this = this;
|
|
@@ -8986,56 +8962,6 @@
|
|
|
8986
8962
|
}
|
|
8987
8963
|
return this.model;
|
|
8988
8964
|
};
|
|
8989
|
-
FoehnMultiselectAutocompleteComponent.prototype.getFirstDeleteButtonToFocus = function () {
|
|
8990
|
-
var closeButtonsElemRefArray = __spreadArray([], __read(this.closeButtonsElemRef.toArray()));
|
|
8991
|
-
if (!!closeButtonsElemRefArray.length) {
|
|
8992
|
-
return closeButtonsElemRefArray[0].nativeElement;
|
|
8993
|
-
}
|
|
8994
|
-
return null;
|
|
8995
|
-
};
|
|
8996
|
-
FoehnMultiselectAutocompleteComponent.prototype.navigateSelectedList = function (offset) {
|
|
8997
|
-
var _this = this;
|
|
8998
|
-
if (!this.disabled) {
|
|
8999
|
-
var closeButtonsElemRefArray = this.getDefaultSelectedElements().concat(__spreadArray([], __read(this.closeButtonsElemRef.toArray())));
|
|
9000
|
-
if (!!closeButtonsElemRefArray.length) {
|
|
9001
|
-
var focusIndex = closeButtonsElemRefArray.findIndex(function (value) { return _this.currentFocusedElem === value.nativeElement; });
|
|
9002
|
-
var newIndex = focusIndex + offset;
|
|
9003
|
-
if (newIndex >= closeButtonsElemRefArray.length) {
|
|
9004
|
-
newIndex = 0;
|
|
9005
|
-
}
|
|
9006
|
-
if (newIndex < 0) {
|
|
9007
|
-
newIndex = closeButtonsElemRefArray.length - 1;
|
|
9008
|
-
}
|
|
9009
|
-
var elemRef = closeButtonsElemRefArray[newIndex];
|
|
9010
|
-
if (!!elemRef) {
|
|
9011
|
-
elemRef.nativeElement.focus();
|
|
9012
|
-
}
|
|
9013
|
-
}
|
|
9014
|
-
}
|
|
9015
|
-
};
|
|
9016
|
-
FoehnMultiselectAutocompleteComponent.prototype.getDefaultSelectedElements = function () {
|
|
9017
|
-
return __spreadArray([], __read(this.selectedElemRef.toArray())).filter(function (value) { return value.nativeElement.getAttribute('is-default') === 'true'; });
|
|
9018
|
-
};
|
|
9019
|
-
FoehnMultiselectAutocompleteComponent.prototype.onKeyDownSelectedInner = function (keyEvent) {
|
|
9020
|
-
// IE doesn't support keyEvent.code, and has different values
|
|
9021
|
-
// in keyEvent.key (Down instead of ArrowDown for instance), hence the multi-support.
|
|
9022
|
-
var ie11CompatibleCode = keyEvent.code || keyEvent.key;
|
|
9023
|
-
switch (ie11CompatibleCode) {
|
|
9024
|
-
case 'Right':
|
|
9025
|
-
case 'ArrowRight':
|
|
9026
|
-
this.navigateSelectedList(1);
|
|
9027
|
-
break;
|
|
9028
|
-
case 'Left':
|
|
9029
|
-
case 'ArrowLeft':
|
|
9030
|
-
this.navigateSelectedList(-1);
|
|
9031
|
-
break;
|
|
9032
|
-
default:
|
|
9033
|
-
return true;
|
|
9034
|
-
}
|
|
9035
|
-
keyEvent.preventDefault();
|
|
9036
|
-
keyEvent.stopPropagation();
|
|
9037
|
-
return false;
|
|
9038
|
-
};
|
|
9039
8965
|
FoehnMultiselectAutocompleteComponent.prototype.filterAutocompleteElements = function (elements) {
|
|
9040
8966
|
var _this = this;
|
|
9041
8967
|
var filteredElements = ObjectHelper.deepCopy(elements);
|
|
@@ -9065,6 +8991,7 @@
|
|
|
9065
8991
|
};
|
|
9066
8992
|
FoehnMultiselectAutocompleteComponent.prototype.manageSuggestionListAndFocusAfterAddingAnItem = function () {
|
|
9067
8993
|
var _this = this;
|
|
8994
|
+
// Empty autocomplete input
|
|
9068
8995
|
this.autocompleteInputValue = null;
|
|
9069
8996
|
// Remove selected item from autocomplete suggestion list
|
|
9070
8997
|
this.autocompleteComponent.elements = this.filterAutocompleteElements(this.elements);
|
|
@@ -9081,24 +9008,12 @@
|
|
|
9081
9008
|
}
|
|
9082
9009
|
};
|
|
9083
9010
|
FoehnMultiselectAutocompleteComponent.prototype.manageSuggestionListAndFocusAfterRemovingAnItem = function () {
|
|
9084
|
-
var _this = this;
|
|
9085
9011
|
// Hide message saying no more suggestions to display
|
|
9086
9012
|
this.showEmptyListMessage = false;
|
|
9087
9013
|
// Manually show autocomplete because there is at least one suggestions to display
|
|
9088
9014
|
this.autocompleteComponent.inputElement.nativeElement.hidden = false;
|
|
9089
9015
|
// Add back selected item to autocomplete suggestion list
|
|
9090
9016
|
this.autocompleteComponent.elements = this.filterAutocompleteElements(this.elements);
|
|
9091
|
-
// When deleting a selected item, check were to set focus back
|
|
9092
|
-
this.closeButtonsElemRef.changes.pipe(operators.first()).subscribe(function () {
|
|
9093
|
-
var buttonToFocus = _this.getFirstDeleteButtonToFocus();
|
|
9094
|
-
if (!!buttonToFocus) {
|
|
9095
|
-
buttonToFocus.focus();
|
|
9096
|
-
}
|
|
9097
|
-
else {
|
|
9098
|
-
_this.autocompleteComponent.setFocusOnInput();
|
|
9099
|
-
_this.autocompleteComponent.onInputFocus();
|
|
9100
|
-
}
|
|
9101
|
-
});
|
|
9102
9017
|
};
|
|
9103
9018
|
FoehnMultiselectAutocompleteComponent.prototype.showAlertMessageAndHideAutocomplete = function () {
|
|
9104
9019
|
// Show a message to user indicating there is no more suggestions to display
|
|
@@ -9107,16 +9022,29 @@
|
|
|
9107
9022
|
this.autocompleteInputValue = null;
|
|
9108
9023
|
this.autocompleteComponent.inputElement.nativeElement.hidden = true;
|
|
9109
9024
|
};
|
|
9025
|
+
FoehnMultiselectAutocompleteComponent.prototype.manageScreenReaderAnnouncement = function (element, isDelete) {
|
|
9026
|
+
var _this = this;
|
|
9027
|
+
clearTimeout(this.srAnnouncementClearTimer);
|
|
9028
|
+
if (isDelete) {
|
|
9029
|
+
this.srAnnouncements += "" + this.dictionaryService.getKeySync('foehn-multiselect-autocomplete.sr-announcement.deleted', { elementLabel: this.getLabel(element) });
|
|
9030
|
+
}
|
|
9031
|
+
else {
|
|
9032
|
+
this.srAnnouncements += "" + this.dictionaryService.getKeySync('foehn-multiselect-autocomplete.sr-announcement.added', { elementLabel: this.getLabel(element) });
|
|
9033
|
+
}
|
|
9034
|
+
this.srAnnouncementClearTimer = setTimeout(function () {
|
|
9035
|
+
_this.srAnnouncements = '';
|
|
9036
|
+
}, this.SR_ANNOUNCEMENT_CLEAR_TIMEOUT_INTERVAL);
|
|
9037
|
+
};
|
|
9110
9038
|
return FoehnMultiselectAutocompleteComponent;
|
|
9111
9039
|
}(FoehnAutocompleteComponent));
|
|
9112
9040
|
FoehnMultiselectAutocompleteComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: FoehnMultiselectAutocompleteComponent, deps: [{ token: i0__namespace.NgZone }, { token: SdkDictionaryService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
9113
|
-
FoehnMultiselectAutocompleteComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.4", type: FoehnMultiselectAutocompleteComponent, selector: "foehn-multiselect-autocomplete", inputs: { defaultElementValues: "defaultElementValues", defaultElementValue: "defaultElementValue" },
|
|
9041
|
+
FoehnMultiselectAutocompleteComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.4", type: FoehnMultiselectAutocompleteComponent, selector: "foehn-multiselect-autocomplete", inputs: { defaultElementValues: "defaultElementValues", defaultElementValue: "defaultElementValue" }, providers: [
|
|
9114
9042
|
{
|
|
9115
9043
|
provide: FoehnInputComponent,
|
|
9116
9044
|
useExisting: i0.forwardRef(function () { return FoehnMultiselectAutocompleteComponent; }),
|
|
9117
9045
|
multi: true
|
|
9118
9046
|
}
|
|
9119
|
-
], viewQueries: [{ propertyName: "autocompleteComponent", first: true, predicate: ["autocompleteComponent"], descendants: true }, { propertyName: "alertMessageContainer", first: true, predicate: ["alertMessageContainer"], descendants: true }
|
|
9047
|
+
], viewQueries: [{ propertyName: "autocompleteComponent", first: true, predicate: ["autocompleteComponent"], descendants: true }, { propertyName: "alertMessageContainer", first: true, predicate: ["alertMessageContainer"], 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 <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__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 } });
|
|
9120
9048
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: FoehnMultiselectAutocompleteComponent, decorators: [{
|
|
9121
9049
|
type: i0.Component,
|
|
9122
9050
|
args: [{
|
|
@@ -9137,19 +9065,10 @@
|
|
|
9137
9065
|
}], alertMessageContainer: [{
|
|
9138
9066
|
type: i0.ViewChild,
|
|
9139
9067
|
args: ['alertMessageContainer']
|
|
9140
|
-
}], closeButtonsElemRef: [{
|
|
9141
|
-
type: i0.ViewChildren,
|
|
9142
|
-
args: ['closeButtonsElemRef']
|
|
9143
|
-
}], selectedElemRef: [{
|
|
9144
|
-
type: i0.ViewChildren,
|
|
9145
|
-
args: ['selectedElemRef']
|
|
9146
9068
|
}], defaultElementValues: [{
|
|
9147
9069
|
type: i0.Input
|
|
9148
9070
|
}], defaultElementValue: [{
|
|
9149
9071
|
type: i0.Input
|
|
9150
|
-
}], handleKeyboardDownEvent: [{
|
|
9151
|
-
type: i0.HostListener,
|
|
9152
|
-
args: ['keydown', ['$event']]
|
|
9153
9072
|
}] } });
|
|
9154
9073
|
|
|
9155
9074
|
var FoehnMultiselectAutocompleteModule = /** @class */ (function () {
|