@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
|
@@ -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_MS = 2000;
|
|
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,29 +8924,8 @@
|
|
|
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
|
-
return !this.defaultElementValues || !this.defaultElementValues.includes(this.model[index]);
|
|
8946
|
-
};
|
|
8947
|
-
FoehnMultiselectAutocompleteComponent.prototype.onSelectedItemsFocusin = function () {
|
|
8948
|
-
this.keyboardNavigationAllowed = true;
|
|
8949
|
-
this.currentFocusedElem = document.activeElement;
|
|
8950
|
-
};
|
|
8951
|
-
FoehnMultiselectAutocompleteComponent.prototype.onSelectedItemsFocusout = function () {
|
|
8952
|
-
this.keyboardNavigationAllowed = false;
|
|
8928
|
+
return !this.disabled && (!this.defaultElementValues || !this.defaultElementValues.includes(this.model[index]));
|
|
8953
8929
|
};
|
|
8954
8930
|
FoehnMultiselectAutocompleteComponent.prototype.onAutocompleteElementsLoaded = function (elements) {
|
|
8955
8931
|
var _this = this;
|
|
@@ -8963,13 +8939,13 @@
|
|
|
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;
|
|
8971
8947
|
if (!!this.elements && !!this.elements.length) {
|
|
8972
|
-
var itemValue_1 = typeof item
|
|
8948
|
+
var itemValue_1 = typeof item !== 'object' ? item : this.getValue(item);
|
|
8973
8949
|
var elem = this.elements.find(function (element) { return _this.getValue(element) === itemValue_1; });
|
|
8974
8950
|
if (!!elem) {
|
|
8975
8951
|
return elem;
|
|
@@ -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);
|
|
@@ -9088,15 +9015,11 @@
|
|
|
9088
9015
|
this.autocompleteComponent.inputElement.nativeElement.hidden = false;
|
|
9089
9016
|
// Add back selected item to autocomplete suggestion list
|
|
9090
9017
|
this.autocompleteComponent.elements = this.filterAutocompleteElements(this.elements);
|
|
9091
|
-
// When deleting a selected item, check were to set focus back
|
|
9092
|
-
this.
|
|
9093
|
-
var
|
|
9094
|
-
if (!!
|
|
9095
|
-
|
|
9096
|
-
}
|
|
9097
|
-
else {
|
|
9098
|
-
_this.autocompleteComponent.setFocusOnInput();
|
|
9099
|
-
_this.autocompleteComponent.onInputFocus();
|
|
9018
|
+
// When deleting a selected item, check were to set focus back when no more items to delete
|
|
9019
|
+
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.setFocus();
|
|
9100
9023
|
}
|
|
9101
9024
|
});
|
|
9102
9025
|
};
|
|
@@ -9107,16 +9030,29 @@
|
|
|
9107
9030
|
this.autocompleteInputValue = null;
|
|
9108
9031
|
this.autocompleteComponent.inputElement.nativeElement.hidden = true;
|
|
9109
9032
|
};
|
|
9033
|
+
FoehnMultiselectAutocompleteComponent.prototype.manageScreenReaderAnnouncement = function (element, isDelete) {
|
|
9034
|
+
var _this = this;
|
|
9035
|
+
clearTimeout(this.srAnnouncementClearTimer);
|
|
9036
|
+
if (isDelete) {
|
|
9037
|
+
this.srAnnouncements += "" + this.dictionaryService.getKeySync('foehn-multiselect-autocomplete.sr-announcement.deleted', { elementLabel: this.getLabel(element) });
|
|
9038
|
+
}
|
|
9039
|
+
else {
|
|
9040
|
+
this.srAnnouncements += "" + this.dictionaryService.getKeySync('foehn-multiselect-autocomplete.sr-announcement.added', { elementLabel: this.getLabel(element) });
|
|
9041
|
+
}
|
|
9042
|
+
this.srAnnouncementClearTimer = setTimeout(function () {
|
|
9043
|
+
_this.srAnnouncements = '';
|
|
9044
|
+
}, this.SR_ANNOUNCEMENT_CLEAR_TIMEOUT_INTERVAL_MS);
|
|
9045
|
+
};
|
|
9110
9046
|
return FoehnMultiselectAutocompleteComponent;
|
|
9111
9047
|
}(FoehnAutocompleteComponent));
|
|
9112
9048
|
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" },
|
|
9049
|
+
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
9050
|
{
|
|
9115
9051
|
provide: FoehnInputComponent,
|
|
9116
9052
|
useExisting: i0.forwardRef(function () { return FoehnMultiselectAutocompleteComponent; }),
|
|
9117
9053
|
multi: true
|
|
9118
9054
|
}
|
|
9119
|
-
], viewQueries: [{ propertyName: "autocompleteComponent", first: true, predicate: ["autocompleteComponent"], descendants: true }, { propertyName: "alertMessageContainer", first: true, predicate: ["alertMessageContainer"], descendants: true }, { propertyName: "
|
|
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 } });
|
|
9120
9056
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: FoehnMultiselectAutocompleteComponent, decorators: [{
|
|
9121
9057
|
type: i0.Component,
|
|
9122
9058
|
args: [{
|
|
@@ -9137,19 +9073,16 @@
|
|
|
9137
9073
|
}], alertMessageContainer: [{
|
|
9138
9074
|
type: i0.ViewChild,
|
|
9139
9075
|
args: ['alertMessageContainer']
|
|
9140
|
-
}], closeButtonsElemRef: [{
|
|
9141
|
-
type: i0.ViewChildren,
|
|
9142
|
-
args: ['closeButtonsElemRef']
|
|
9143
9076
|
}], selectedElemRef: [{
|
|
9144
9077
|
type: i0.ViewChildren,
|
|
9145
9078
|
args: ['selectedElemRef']
|
|
9079
|
+
}], selectedItemsArea: [{
|
|
9080
|
+
type: i0.ViewChild,
|
|
9081
|
+
args: ['selectedItemsArea']
|
|
9146
9082
|
}], defaultElementValues: [{
|
|
9147
9083
|
type: i0.Input
|
|
9148
9084
|
}], defaultElementValue: [{
|
|
9149
9085
|
type: i0.Input
|
|
9150
|
-
}], handleKeyboardDownEvent: [{
|
|
9151
|
-
type: i0.HostListener,
|
|
9152
|
-
args: ['keydown', ['$event']]
|
|
9153
9086
|
}] } });
|
|
9154
9087
|
|
|
9155
9088
|
var FoehnMultiselectAutocompleteModule = /** @class */ (function () {
|