@bpost/bp-address-auto-complete-by-component 1.1.15 → 1.1.17
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/README.md +5 -1
- package/VERSION.md +6 -0
- package/esm2020/lib/box-number/box-number.component.mjs +18 -3
- package/esm2020/lib/lib-address-autocomplete-by-component.component.mjs +84 -11
- package/esm2020/lib/locality/locality.component.mjs +31 -8
- package/esm2020/lib/services/http.service.mjs +2 -2
- package/esm2020/lib/street/street.component.mjs +69 -22
- package/esm2020/lib/street-number/street-number.component.mjs +21 -3
- package/fesm2015/bpost-bp-address-auto-complete-by-component.mjs +224 -45
- package/fesm2015/bpost-bp-address-auto-complete-by-component.mjs.map +1 -1
- package/fesm2020/bpost-bp-address-auto-complete-by-component.mjs +221 -45
- package/fesm2020/bpost-bp-address-auto-complete-by-component.mjs.map +1 -1
- package/lib/box-number/box-number.component.d.ts +1 -0
- package/lib/locality/locality.component.d.ts +1 -0
- package/lib/street/street.component.d.ts +2 -0
- package/lib/street-number/street-number.component.d.ts +1 -0
- package/package.json +1 -1
|
@@ -240,7 +240,7 @@ class HttpService {
|
|
|
240
240
|
let headers = new HttpHeaders();
|
|
241
241
|
// Attention !
|
|
242
242
|
// Need to reassign as the 'set' is returning a clone of the headera object !!!
|
|
243
|
-
headers = headers.set('x-api-key',
|
|
243
|
+
headers = headers.set('x-api-key', this.apiKey);
|
|
244
244
|
return headers;
|
|
245
245
|
}
|
|
246
246
|
get(url, options) {
|
|
@@ -857,6 +857,7 @@ class LocalityComponent {
|
|
|
857
857
|
this.clearInputEventEmitter = new EventEmitter();
|
|
858
858
|
this.prefillEventEmitter = new EventEmitter();
|
|
859
859
|
this.numberOfExceptionsEmitter = new EventEmitter();
|
|
860
|
+
this.searchText = '';
|
|
860
861
|
this.validationMessageCode = null;
|
|
861
862
|
this.validationMessageOptions = null;
|
|
862
863
|
this.prefilling = false;
|
|
@@ -870,7 +871,7 @@ class LocalityComponent {
|
|
|
870
871
|
});
|
|
871
872
|
}
|
|
872
873
|
ngOnInit() {
|
|
873
|
-
this.searchText
|
|
874
|
+
this.searchText;
|
|
874
875
|
// instance properties
|
|
875
876
|
this.addressIsValidated = false;
|
|
876
877
|
this.suggestionValidationMessage = '';
|
|
@@ -1316,8 +1317,8 @@ class LocalityComponent {
|
|
|
1316
1317
|
}
|
|
1317
1318
|
const suggestionLocality = this.transformMunicipalityInLowercaseAndWithoutDiacritics(sugAddress.localityName);
|
|
1318
1319
|
const suggestionMunicipality = this.transformMunicipalityInLowercaseAndWithoutDiacritics(sugAddress.municipalityName);
|
|
1319
|
-
if (suggestionLocality
|
|
1320
|
-
|| suggestionMunicipality
|
|
1320
|
+
if (suggestionLocality.startsWith(this.prefillData.prefillMunicipalityName)
|
|
1321
|
+
|| suggestionMunicipality.startsWith(this.prefillData.prefillMunicipalityName)) {
|
|
1321
1322
|
if (this.prefillData.prefillMunicipalityAndLocalityPerfectMatchFound === true) {
|
|
1322
1323
|
if (this.showDebugMessageToConsole) {
|
|
1323
1324
|
console.log('LOCALITY - PREFILL - skipping suggestion:', suggestion);
|
|
@@ -1330,8 +1331,8 @@ class LocalityComponent {
|
|
|
1330
1331
|
this.prefillData.prefillMunicipalityPerfectMatchFound = true;
|
|
1331
1332
|
this.prefillData.prefillMunicipalityPerfectMatchSuggestion = suggestion;
|
|
1332
1333
|
this.searchText = sugAddress.postalCode + ' ' + sugAddress.localityName;
|
|
1333
|
-
this.prefillData.prefillMunicipalityAndLocalityPerfectMatchFound = (suggestionLocality
|
|
1334
|
-
&& suggestionMunicipality
|
|
1334
|
+
this.prefillData.prefillMunicipalityAndLocalityPerfectMatchFound = (suggestionLocality.startsWith(this.prefillData.prefillMunicipalityName)
|
|
1335
|
+
&& suggestionMunicipality.startsWith(this.prefillData.prefillMunicipalityName)) ? true : false;
|
|
1335
1336
|
if (this.prefillData.prefillMunicipalityAndLocalityPerfectMatchFound === true) {
|
|
1336
1337
|
if (this.showDebugMessageToConsole) {
|
|
1337
1338
|
console.log('LOCALITY - PREFILL - Perfect match - Municipality & location:', suggestion);
|
|
@@ -1397,6 +1398,9 @@ class LocalityComponent {
|
|
|
1397
1398
|
}
|
|
1398
1399
|
if (emit) {
|
|
1399
1400
|
this.clearInputEventEmitter.emit(/*'LOCALITY'*/ InputNameType.LOCALITY);
|
|
1401
|
+
this.clearInputEventEmitter.emit(/*'STREET'*/ InputNameType.STREET);
|
|
1402
|
+
this.clearInputEventEmitter.emit(/*'STREET_NUMBER'*/ InputNameType.STREET_NUMBER);
|
|
1403
|
+
this.clearInputEventEmitter.emit(/*'BOX_NUMBER'*/ InputNameType.BOX_NUMBER);
|
|
1400
1404
|
}
|
|
1401
1405
|
}
|
|
1402
1406
|
clearSearchText() {
|
|
@@ -1473,6 +1477,25 @@ class LocalityComponent {
|
|
|
1473
1477
|
this.setSearchTextBasedOnArrowSelection(this.selectedIndex, this.selectedIndex + 1);
|
|
1474
1478
|
}
|
|
1475
1479
|
}
|
|
1480
|
+
checkKeyUP(event) {
|
|
1481
|
+
switch (event.which) {
|
|
1482
|
+
case 8:
|
|
1483
|
+
if (this.searchText.length > 0) {
|
|
1484
|
+
this.clearInputEventEmitter.emit('PARTIAL_CLEAR_LOCALITY');
|
|
1485
|
+
}
|
|
1486
|
+
else {
|
|
1487
|
+
this.clearInputEventEmitter.emit('LOCALITY');
|
|
1488
|
+
// this.clearInputEventEmitter.emit('STREET');
|
|
1489
|
+
// this.clearInputEventEmitter.emit('STREET_NUMBER');
|
|
1490
|
+
// this.clearInputEventEmitter.emit('BOX_NUMBER');
|
|
1491
|
+
// this.clearInput(true);
|
|
1492
|
+
}
|
|
1493
|
+
break;
|
|
1494
|
+
default:
|
|
1495
|
+
this.clearTypeAhead();
|
|
1496
|
+
break;
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1476
1499
|
checkKeyDown(event) {
|
|
1477
1500
|
switch (event.which) {
|
|
1478
1501
|
// down key, increment selectedIndex
|
|
@@ -1575,10 +1598,10 @@ class LocalityComponent {
|
|
|
1575
1598
|
}
|
|
1576
1599
|
}
|
|
1577
1600
|
LocalityComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: LocalityComponent, deps: [{ token: AddressService }, { token: LocaleService }, { token: i3.TranslateService }, { token: UnicodeService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1578
|
-
LocalityComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: LocalityComponent, selector: "bp-locality", inputs: { labelResourceKey: "labelResourceKey", messageOption: "messageOption", maxSuggesionCount: "maxSuggesionCount", visibleSuggestionCount: "visibleSuggestionCount", sortCriteria: "sortCriteria", baseUrl: "baseUrl", inputText: "inputText", prefillData: "prefillData", showDebugMessageToConsole: "showDebugMessageToConsole", inputLang: "inputLang", isReadonly: "isReadonly", allowNoValidation: "allowNoValidation", validatedByBackend: "validatedByBackend", numberOfExceptions: "numberOfExceptions" }, outputs: { messageChanged: "messageChanged", addressChanged: "addressChanged", focusEvent: "focusEvent", blurEvent: "blurEvent", textChangeEvent: "textChangeEvent", clearInputEventEmitter: "clearInputEventEmitter", prefillEventEmitter: "prefillEventEmitter", numberOfExceptionsEmitter: "numberOfExceptionsEmitter" }, viewQueries: [{ propertyName: "localitySearchInput", first: true, predicate: ["localitySearchInput"], descendants: true }, { propertyName: "localityList", first: true, predicate: ["localityList"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<span *ngIf=\"labelResourceKey\">{{ labelResourceKey | translate}}</span>\n<div class=\"bpaac-dropdown\">\n <div class=\"bpaac-search-bar\">\n <div class=\"bpaac-input-width\">\n \n <input type=\"text\" #localitySearchInput class=\"bpaac-input\" \n [readonly]=\"isReadonly\"\n (keydown)=\"checkKeyDown($event)\" (input)=\"onInputChange()\"\n [style.color]=\" getTextColor() \"\n [(ngModel)]=\"searchText\" id=\"localityInputField\" [attr.placeholder]=\"placeHolderText\" autocomplete=\"off\"\n (blur)=\"onBlur($event)\" (focus)=\"onFocus()\" (click)=\"onInputClick()\"/>\n <div id=\"bpaac-clear-locality-button\" \n *ngIf=\"mayShowClearButton()\"\n (click)=\"clearInput(true)\" class=\"bpaac-clear\">\n </div>\n </div>\n <!--<div ng-transclude></div>-->\n <input id=\"bpaac-locality-typeahead\" type=\"text\" disabled autocomplete=\"off\" [(ngModel)]=\"bpTypeAhead\" />\n </div>\n <div [hidden]=\"collapseDropdown\" class=\"bpaac-dropdown-menu-container\" *ngIf=\"suggestions && suggestions.length>0\">\n <div #localityList [appVisibleSuggestion]=\"visibleSuggestionCount\" id=\"bpaac-locality-dropdown\" \n class=\"bpaac-dropdown-menu\">\n <ul role=\"listbox\" id=\"bpaac-locality-suggestionsList\" class=\"list-unstyled\">\n <li role=\"option\" \n *ngFor=\"let option of suggestions; let idx = index\" \n [ngClass]=\"{'active':(selectedIndex==idx)}\" (mousedown)=\"clickSuggestion($event, option)\"\n (mouseenter)=\"selectedIndex=idx\" (mouseleave)=\"selectedIndex=-1\">\n <span *ngIf=\"option\" [innerHtml]=\"option.string | highlightSuggestion : wordList\"></span> \n <span *ngIf=\"messageOption === 'P' && option.messages\"> ({{option.municipalityName}})</span><br />\n <ng-container *ngIf=\"messageOption === 'Y'\">\n <span *ngFor=\"let message of option.messages\" \n class=\"bpaac-suggestion-message\"\n [innerHtml]=\"message.translatedMessage\"></span> \n </ng-container>\n </li>\n </ul>\n </div>\n </div>\n</div>", styles: [""], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: VisibleSuggestionDirective, selector: "[appVisibleSuggestion]", inputs: ["appVisibleSuggestion"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "translate": i3.TranslatePipe, "highlightSuggestion": HighlightSuggestionPipe } });
|
|
1601
|
+
LocalityComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: LocalityComponent, selector: "bp-locality", inputs: { labelResourceKey: "labelResourceKey", messageOption: "messageOption", maxSuggesionCount: "maxSuggesionCount", visibleSuggestionCount: "visibleSuggestionCount", sortCriteria: "sortCriteria", baseUrl: "baseUrl", inputText: "inputText", prefillData: "prefillData", showDebugMessageToConsole: "showDebugMessageToConsole", inputLang: "inputLang", isReadonly: "isReadonly", allowNoValidation: "allowNoValidation", validatedByBackend: "validatedByBackend", numberOfExceptions: "numberOfExceptions" }, outputs: { messageChanged: "messageChanged", addressChanged: "addressChanged", focusEvent: "focusEvent", blurEvent: "blurEvent", textChangeEvent: "textChangeEvent", clearInputEventEmitter: "clearInputEventEmitter", prefillEventEmitter: "prefillEventEmitter", numberOfExceptionsEmitter: "numberOfExceptionsEmitter" }, viewQueries: [{ propertyName: "localitySearchInput", first: true, predicate: ["localitySearchInput"], descendants: true }, { propertyName: "localityList", first: true, predicate: ["localityList"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<span *ngIf=\"labelResourceKey\">{{ labelResourceKey | translate}}</span>\n<div class=\"bpaac-dropdown\">\n <div class=\"bpaac-search-bar\">\n <div class=\"bpaac-input-width\">\n \n <input type=\"text\" #localitySearchInput class=\"bpaac-input\" \n [readonly]=\"isReadonly\"\n (keyup) = (checkKeyUP($event))\n (keydown)=\"checkKeyDown($event)\" (input)=\"onInputChange()\"\n [style.color]=\" getTextColor() \"\n [(ngModel)]=\"searchText\" id=\"localityInputField\" [attr.placeholder]=\"placeHolderText\" autocomplete=\"off\"\n (blur)=\"onBlur($event)\" (focus)=\"onFocus()\" (click)=\"onInputClick()\"/>\n <div id=\"bpaac-clear-locality-button\" \n *ngIf=\"mayShowClearButton()\"\n (click)=\"clearInput(true)\" class=\"bpaac-clear\">\n </div>\n </div>\n <!--<div ng-transclude></div>-->\n <input id=\"bpaac-locality-typeahead\" type=\"text\" disabled autocomplete=\"off\" [(ngModel)]=\"bpTypeAhead\" />\n </div>\n <div [hidden]=\"collapseDropdown\" class=\"bpaac-dropdown-menu-container\" *ngIf=\"suggestions && suggestions.length>0\">\n <div #localityList [appVisibleSuggestion]=\"visibleSuggestionCount\" id=\"bpaac-locality-dropdown\" \n class=\"bpaac-dropdown-menu\">\n <ul role=\"listbox\" id=\"bpaac-locality-suggestionsList\" class=\"list-unstyled\">\n <li role=\"option\" \n *ngFor=\"let option of suggestions; let idx = index\" \n [ngClass]=\"{'active':(selectedIndex==idx)}\" (mousedown)=\"clickSuggestion($event, option)\"\n (mouseenter)=\"selectedIndex=idx\" (mouseleave)=\"selectedIndex=-1\">\n <span *ngIf=\"option\" [innerHtml]=\"option.string | highlightSuggestion : wordList\"></span> \n <span *ngIf=\"messageOption === 'P' && option.messages\"> ({{option.municipalityName}})</span><br />\n <ng-container *ngIf=\"messageOption === 'Y'\">\n <span *ngFor=\"let message of option.messages\" \n class=\"bpaac-suggestion-message\"\n [innerHtml]=\"message.translatedMessage\"></span> \n </ng-container>\n </li>\n </ul>\n </div>\n </div>\n</div>", styles: [""], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: VisibleSuggestionDirective, selector: "[appVisibleSuggestion]", inputs: ["appVisibleSuggestion"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "translate": i3.TranslatePipe, "highlightSuggestion": HighlightSuggestionPipe } });
|
|
1579
1602
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: LocalityComponent, decorators: [{
|
|
1580
1603
|
type: Component,
|
|
1581
|
-
args: [{ selector: 'bp-locality', template: "<span *ngIf=\"labelResourceKey\">{{ labelResourceKey | translate}}</span>\n<div class=\"bpaac-dropdown\">\n <div class=\"bpaac-search-bar\">\n <div class=\"bpaac-input-width\">\n \n <input type=\"text\" #localitySearchInput class=\"bpaac-input\" \n [readonly]=\"isReadonly\"\n (keydown)=\"checkKeyDown($event)\" (input)=\"onInputChange()\"\n [style.color]=\" getTextColor() \"\n [(ngModel)]=\"searchText\" id=\"localityInputField\" [attr.placeholder]=\"placeHolderText\" autocomplete=\"off\"\n (blur)=\"onBlur($event)\" (focus)=\"onFocus()\" (click)=\"onInputClick()\"/>\n <div id=\"bpaac-clear-locality-button\" \n *ngIf=\"mayShowClearButton()\"\n (click)=\"clearInput(true)\" class=\"bpaac-clear\">\n </div>\n </div>\n <!--<div ng-transclude></div>-->\n <input id=\"bpaac-locality-typeahead\" type=\"text\" disabled autocomplete=\"off\" [(ngModel)]=\"bpTypeAhead\" />\n </div>\n <div [hidden]=\"collapseDropdown\" class=\"bpaac-dropdown-menu-container\" *ngIf=\"suggestions && suggestions.length>0\">\n <div #localityList [appVisibleSuggestion]=\"visibleSuggestionCount\" id=\"bpaac-locality-dropdown\" \n class=\"bpaac-dropdown-menu\">\n <ul role=\"listbox\" id=\"bpaac-locality-suggestionsList\" class=\"list-unstyled\">\n <li role=\"option\" \n *ngFor=\"let option of suggestions; let idx = index\" \n [ngClass]=\"{'active':(selectedIndex==idx)}\" (mousedown)=\"clickSuggestion($event, option)\"\n (mouseenter)=\"selectedIndex=idx\" (mouseleave)=\"selectedIndex=-1\">\n <span *ngIf=\"option\" [innerHtml]=\"option.string | highlightSuggestion : wordList\"></span> \n <span *ngIf=\"messageOption === 'P' && option.messages\"> ({{option.municipalityName}})</span><br />\n <ng-container *ngIf=\"messageOption === 'Y'\">\n <span *ngFor=\"let message of option.messages\" \n class=\"bpaac-suggestion-message\"\n [innerHtml]=\"message.translatedMessage\"></span> \n </ng-container>\n </li>\n </ul>\n </div>\n </div>\n</div>", styles: [""] }]
|
|
1604
|
+
args: [{ selector: 'bp-locality', template: "<span *ngIf=\"labelResourceKey\">{{ labelResourceKey | translate}}</span>\n<div class=\"bpaac-dropdown\">\n <div class=\"bpaac-search-bar\">\n <div class=\"bpaac-input-width\">\n \n <input type=\"text\" #localitySearchInput class=\"bpaac-input\" \n [readonly]=\"isReadonly\"\n (keyup) = (checkKeyUP($event))\n (keydown)=\"checkKeyDown($event)\" (input)=\"onInputChange()\"\n [style.color]=\" getTextColor() \"\n [(ngModel)]=\"searchText\" id=\"localityInputField\" [attr.placeholder]=\"placeHolderText\" autocomplete=\"off\"\n (blur)=\"onBlur($event)\" (focus)=\"onFocus()\" (click)=\"onInputClick()\"/>\n <div id=\"bpaac-clear-locality-button\" \n *ngIf=\"mayShowClearButton()\"\n (click)=\"clearInput(true)\" class=\"bpaac-clear\">\n </div>\n </div>\n <!--<div ng-transclude></div>-->\n <input id=\"bpaac-locality-typeahead\" type=\"text\" disabled autocomplete=\"off\" [(ngModel)]=\"bpTypeAhead\" />\n </div>\n <div [hidden]=\"collapseDropdown\" class=\"bpaac-dropdown-menu-container\" *ngIf=\"suggestions && suggestions.length>0\">\n <div #localityList [appVisibleSuggestion]=\"visibleSuggestionCount\" id=\"bpaac-locality-dropdown\" \n class=\"bpaac-dropdown-menu\">\n <ul role=\"listbox\" id=\"bpaac-locality-suggestionsList\" class=\"list-unstyled\">\n <li role=\"option\" \n *ngFor=\"let option of suggestions; let idx = index\" \n [ngClass]=\"{'active':(selectedIndex==idx)}\" (mousedown)=\"clickSuggestion($event, option)\"\n (mouseenter)=\"selectedIndex=idx\" (mouseleave)=\"selectedIndex=-1\">\n <span *ngIf=\"option\" [innerHtml]=\"option.string | highlightSuggestion : wordList\"></span> \n <span *ngIf=\"messageOption === 'P' && option.messages\"> ({{option.municipalityName}})</span><br />\n <ng-container *ngIf=\"messageOption === 'Y'\">\n <span *ngFor=\"let message of option.messages\" \n class=\"bpaac-suggestion-message\"\n [innerHtml]=\"message.translatedMessage\"></span> \n </ng-container>\n </li>\n </ul>\n </div>\n </div>\n</div>", styles: [""] }]
|
|
1582
1605
|
}], ctorParameters: function () { return [{ type: AddressService }, { type: LocaleService }, { type: i3.TranslateService }, { type: UnicodeService }]; }, propDecorators: { localitySearchInput: [{
|
|
1583
1606
|
type: ViewChild,
|
|
1584
1607
|
args: ['localitySearchInput', { static: false }]
|
|
@@ -1777,6 +1800,16 @@ class StreetComponent {
|
|
|
1777
1800
|
}
|
|
1778
1801
|
return result;
|
|
1779
1802
|
}
|
|
1803
|
+
isCrossLanguageMunicipalityMatch(suggestionMunicipality, prefillMunicipality) {
|
|
1804
|
+
if (!suggestionMunicipality || !prefillMunicipality) {
|
|
1805
|
+
return false;
|
|
1806
|
+
}
|
|
1807
|
+
const suggestionLower = suggestionMunicipality.toLowerCase();
|
|
1808
|
+
const prefillLower = prefillMunicipality.toLowerCase();
|
|
1809
|
+
if (suggestionLower === prefillLower) {
|
|
1810
|
+
return true;
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1780
1813
|
onClearInputEvent(event, focus) {
|
|
1781
1814
|
this.clearInput(focus);
|
|
1782
1815
|
}
|
|
@@ -2051,30 +2084,46 @@ class StreetComponent {
|
|
|
2051
2084
|
if (this.showDebugMessageToConsole) {
|
|
2052
2085
|
console.log('street - checking suggestion for perfect match', this.prefillData, suggestion);
|
|
2053
2086
|
}
|
|
2054
|
-
const
|
|
2055
|
-
|
|
2056
|
-
const
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2087
|
+
const streetNamesAllLanguage = [];
|
|
2088
|
+
const languageTypes = ['address', 'french', 'dutch', 'german'];
|
|
2089
|
+
for (const type of languageTypes) {
|
|
2090
|
+
if (suggestion[type]) {
|
|
2091
|
+
streetNamesAllLanguage.push({
|
|
2092
|
+
type: type,
|
|
2093
|
+
streetName: suggestion[type].streetName,
|
|
2094
|
+
municipalityName: suggestion[type].municipalityName,
|
|
2095
|
+
localityName: suggestion[type].localityName
|
|
2096
|
+
});
|
|
2097
|
+
}
|
|
2098
|
+
}
|
|
2099
|
+
for (const lang of streetNamesAllLanguage) {
|
|
2100
|
+
console.log('----------------Language data--------------------:', lang);
|
|
2101
|
+
if (!lang.streetName || !lang.municipalityName) {
|
|
2102
|
+
continue;
|
|
2103
|
+
}
|
|
2104
|
+
const suggestionStreetName = this.transformStreetNameInLowercaseAndWithoutDiacritics(lang.streetName);
|
|
2105
|
+
const suggestionMunicipalityName = this.transformStreetNameInLowercaseAndWithoutDiacritics(lang.municipalityName);
|
|
2106
|
+
const suggestionLocalityName = lang.localityName ? this.transformStreetNameInLowercaseAndWithoutDiacritics(lang.localityName) : '';
|
|
2107
|
+
const municipalityMatches = suggestionMunicipalityName === this.prefillData.prefillMunicipalityName ||
|
|
2108
|
+
suggestionLocalityName === this.prefillData.prefillMunicipalityName ||
|
|
2109
|
+
this.isCrossLanguageMunicipalityMatch(suggestionMunicipalityName, this.prefillData.prefillMunicipalityName) ||
|
|
2110
|
+
this.isCrossLanguageMunicipalityMatch(suggestionLocalityName, this.prefillData.prefillMunicipalityName);
|
|
2111
|
+
console.log('Municipality matches:', municipalityMatches);
|
|
2112
|
+
if (municipalityMatches) {
|
|
2113
|
+
if (suggestionStreetName === this.prefillData.prefillStreetName) {
|
|
2114
|
+
this.prefillData.prefillStreetPerfectMatchFound = true;
|
|
2115
|
+
this.prefillData.prefillStreetPerfectMatchSuggestion = suggestion;
|
|
2116
|
+
this.searchText = lang.streetName;
|
|
2117
|
+
if (this.showDebugMessageToConsole) {
|
|
2118
|
+
console.log('STREET - PREFILL - Perfect match found with lang:', lang.type, suggestion);
|
|
2119
|
+
}
|
|
2120
|
+
return;
|
|
2075
2121
|
}
|
|
2076
2122
|
}
|
|
2077
2123
|
}
|
|
2124
|
+
if (this.showDebugMessageToConsole) {
|
|
2125
|
+
console.log('STREET - PREFILL - NO Perfect match found:', suggestion);
|
|
2126
|
+
}
|
|
2078
2127
|
}
|
|
2079
2128
|
onInputChange(source) {
|
|
2080
2129
|
// console.log('street onInputChange : source ', source);
|
|
@@ -2240,6 +2289,24 @@ class StreetComponent {
|
|
|
2240
2289
|
break;
|
|
2241
2290
|
}
|
|
2242
2291
|
}
|
|
2292
|
+
checkKeyUP(event) {
|
|
2293
|
+
switch (event.which) {
|
|
2294
|
+
case 8:
|
|
2295
|
+
if (this.searchText.length > 0) {
|
|
2296
|
+
this.clearInputEventEmitter.emit('PARTIAL_CLEAR_STREET');
|
|
2297
|
+
}
|
|
2298
|
+
else {
|
|
2299
|
+
this.clearInputEventEmitter.emit('STREET');
|
|
2300
|
+
// this.clearInputEventEmitter.emit('STREET_NUMBER');
|
|
2301
|
+
// this.clearInputEventEmitter.emit('BOX_NUMBER');
|
|
2302
|
+
// this.clearInput(true);
|
|
2303
|
+
}
|
|
2304
|
+
break;
|
|
2305
|
+
default:
|
|
2306
|
+
this.clearTypeAhead();
|
|
2307
|
+
break;
|
|
2308
|
+
}
|
|
2309
|
+
}
|
|
2243
2310
|
clearWidget() {
|
|
2244
2311
|
this.addressIsValidated = false;
|
|
2245
2312
|
this.clearSearchText();
|
|
@@ -2294,6 +2361,7 @@ class StreetComponent {
|
|
|
2294
2361
|
}
|
|
2295
2362
|
clearInput(focus, emit = true) {
|
|
2296
2363
|
// console.warn('street clearInput called ...', focus, emit);
|
|
2364
|
+
// console.log(this.selectedAddress,"selectedadreess");
|
|
2297
2365
|
this.clearWidget();
|
|
2298
2366
|
this.resetArrowSelectedIndex();
|
|
2299
2367
|
this.previousIndex = -1;
|
|
@@ -2307,6 +2375,8 @@ class StreetComponent {
|
|
|
2307
2375
|
}
|
|
2308
2376
|
if (emit) {
|
|
2309
2377
|
this.clearInputEventEmitter.emit(/*'STREET'*/ InputNameType.STREET);
|
|
2378
|
+
// this.clearInputEventEmitter.emit(/*'STREET_NUMBER'*/ InputNameType.STREET_NUMBER);
|
|
2379
|
+
// this.clearInputEventEmitter.emit(/*'BOX_NUMBER'*/ InputNameType.BOX_NUMBER);
|
|
2310
2380
|
}
|
|
2311
2381
|
}
|
|
2312
2382
|
clearSuggestions() {
|
|
@@ -2360,10 +2430,10 @@ class StreetComponent {
|
|
|
2360
2430
|
}
|
|
2361
2431
|
}
|
|
2362
2432
|
StreetComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: StreetComponent, deps: [{ token: AddressService }, { token: LocaleService }, { token: i3.TranslateService }, { token: UnicodeService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2363
|
-
StreetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: StreetComponent, selector: "bp-street", inputs: { labelResourceKey: "labelResourceKey", maxSuggesionCount: "maxSuggesionCount", visibleSuggesionCount: "visibleSuggesionCount", sortCriteria: "sortCriteria", baseUrl: "baseUrl", addressParams: "addressParams", prefillData: "prefillData", showDebugMessageToConsole: "showDebugMessageToConsole", postalCode: "postalCode", locality: "locality", inputText: "inputText", messageOption: "messageOption", allowNoValidation: "allowNoValidation", validatedByBackend: "validatedByBackend", numberOfExceptions: "numberOfExceptions", inputLang: "inputLang", isReadonly: "isReadonly" }, outputs: { messageChanged: "messageChanged", addressChanged: "addressChanged", focusEvent: "focusEvent", blurEvent: "blurEvent", textChangeEvent: "textChangeEvent", clearInputEventEmitter: "clearInputEventEmitter", prefillEventEmitter: "prefillEventEmitter", numberOfExceptionsEmitter: "numberOfExceptionsEmitter" }, viewQueries: [{ propertyName: "streetSearchInput", first: true, predicate: ["streetSearchInput"], descendants: true }, { propertyName: "streetList", first: true, predicate: ["streetList"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<span *ngIf=\"labelResourceKey\">{{ labelResourceKey | translate}}</span>\n<div class=\"bpaac-dropdown\">\n <div class=\"bpaac-search-bar\">\n <div class=\"bpaac-input-width\">\n <!-- [disabled]=\"isDisabled()\" -->\n <input type=\"text\" #streetSearchInput class=\"bpaac-input\" \n [readonly]=\"isReadonly\"\n [style.background-color]=\"!isParamsComplete() ? 'lightgrey' : ''\" \n [style.color]=\" getTextColor() \"\n [disabled]=\"(validatedByBackend && (!locality || locality.trim().length === 0)) \n || (!validatedByBackend && ((!postalCode || postalCode.trim().length === 0) && (!locality || locality.trim().length === 0)))\" (keydown)=\"checkKeyDown($event)\" \n (input)=\"onInputChange()\" (click)=\"onInputClick()\"\n [(ngModel)]=\"searchText\" id=\"streetInputField\" [attr.placeholder]=\"placeHolderText\" autocomplete=\"off\"\n (blur)=\"onBlur($event)\" (focus)=\"onFocus()\" />\n <div id=\"bpaac-clear-street-button\" *ngIf=\"mayShowClearButton()\" (click)=\"clearInput(true)\" class=\"bpaac-clear\">\n </div>\n </div>\n <!--<div ng-transclude></div>-->\n <input id=\"bpaac-street-typeahead\" type=\"text\" disabled autocomplete=\"off\" [(ngModel)]=\"bpTypeAhead\" />\n </div>\n <div [hidden]=\"collapseDropdown\" class=\"bpaac-dropdown-menu-container\" *ngIf=\"suggestions && suggestions.length>0\">\n <div #streetList [appVisibleSuggestion]=\"visibleSuggesionCount\" id=\"bpaac-street-dropdown\" class=\"bpaac-dropdown-menu\">\n <ul role=\"listbox\" id=\"bpaac-street-suggestionsList\" class=\"list-unstyled\">\n <li role=\"option\" *ngFor=\"let option of suggestions; let idx = index\" [ngClass]=\"{'active':(selectedIndex==idx)}\" (mousedown)=\"clickSuggestion($event, option)\"\n (mouseenter)=\"selectedIndex=idx\" (mouseleave)=\"selectedIndex=-1\">\n <span *ngIf=\"option\" [innerHtml]=\"option.string | highlightSuggestion : wordList\"></span>\n </li>\n </ul>\n </div>\n </div>\n</div>\n", styles: [""], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: VisibleSuggestionDirective, selector: "[appVisibleSuggestion]", inputs: ["appVisibleSuggestion"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "translate": i3.TranslatePipe, "highlightSuggestion": HighlightSuggestionPipe } });
|
|
2433
|
+
StreetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: StreetComponent, selector: "bp-street", inputs: { labelResourceKey: "labelResourceKey", maxSuggesionCount: "maxSuggesionCount", visibleSuggesionCount: "visibleSuggesionCount", sortCriteria: "sortCriteria", baseUrl: "baseUrl", addressParams: "addressParams", prefillData: "prefillData", showDebugMessageToConsole: "showDebugMessageToConsole", postalCode: "postalCode", locality: "locality", inputText: "inputText", messageOption: "messageOption", allowNoValidation: "allowNoValidation", validatedByBackend: "validatedByBackend", numberOfExceptions: "numberOfExceptions", inputLang: "inputLang", isReadonly: "isReadonly" }, outputs: { messageChanged: "messageChanged", addressChanged: "addressChanged", focusEvent: "focusEvent", blurEvent: "blurEvent", textChangeEvent: "textChangeEvent", clearInputEventEmitter: "clearInputEventEmitter", prefillEventEmitter: "prefillEventEmitter", numberOfExceptionsEmitter: "numberOfExceptionsEmitter" }, viewQueries: [{ propertyName: "streetSearchInput", first: true, predicate: ["streetSearchInput"], descendants: true }, { propertyName: "streetList", first: true, predicate: ["streetList"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<span *ngIf=\"labelResourceKey\">{{ labelResourceKey | translate}}</span>\n<div class=\"bpaac-dropdown\">\n <div class=\"bpaac-search-bar\">\n <div class=\"bpaac-input-width\">\n <!-- [disabled]=\"isDisabled()\" -->\n <input type=\"text\" #streetSearchInput class=\"bpaac-input\" \n [readonly]=\"isReadonly\"\n (keyup) = (checkKeyUP($event))\n [style.background-color]=\"!isParamsComplete() ? 'lightgrey' : ''\" \n [style.color]=\" getTextColor() \"\n [disabled]=\"(validatedByBackend && (!locality || locality.trim().length === 0)) \n || (!validatedByBackend && ((!postalCode || postalCode.trim().length === 0) && (!locality || locality.trim().length === 0)))\" (keydown)=\"checkKeyDown($event)\" \n (input)=\"onInputChange()\" (click)=\"onInputClick()\"\n [(ngModel)]=\"searchText\" id=\"streetInputField\" [attr.placeholder]=\"placeHolderText\" autocomplete=\"off\"\n (blur)=\"onBlur($event)\" (focus)=\"onFocus()\" />\n <div id=\"bpaac-clear-street-button\" *ngIf=\"mayShowClearButton()\" (click)=\"clearInput(true)\" class=\"bpaac-clear\">\n </div>\n </div>\n <!--<div ng-transclude></div>-->\n <input id=\"bpaac-street-typeahead\" type=\"text\" disabled autocomplete=\"off\" [(ngModel)]=\"bpTypeAhead\" />\n </div>\n <div [hidden]=\"collapseDropdown\" class=\"bpaac-dropdown-menu-container\" *ngIf=\"suggestions && suggestions.length>0\">\n <div #streetList [appVisibleSuggestion]=\"visibleSuggesionCount\" id=\"bpaac-street-dropdown\" class=\"bpaac-dropdown-menu\">\n <ul role=\"listbox\" id=\"bpaac-street-suggestionsList\" class=\"list-unstyled\">\n <li role=\"option\" *ngFor=\"let option of suggestions; let idx = index\" [ngClass]=\"{'active':(selectedIndex==idx)}\" (mousedown)=\"clickSuggestion($event, option)\"\n (mouseenter)=\"selectedIndex=idx\" (mouseleave)=\"selectedIndex=-1\">\n <span *ngIf=\"option\" [innerHtml]=\"option.string | highlightSuggestion : wordList\"></span>\n </li>\n </ul>\n </div>\n </div>\n</div>\n", styles: [""], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: VisibleSuggestionDirective, selector: "[appVisibleSuggestion]", inputs: ["appVisibleSuggestion"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "translate": i3.TranslatePipe, "highlightSuggestion": HighlightSuggestionPipe } });
|
|
2364
2434
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: StreetComponent, decorators: [{
|
|
2365
2435
|
type: Component,
|
|
2366
|
-
args: [{ selector: 'bp-street', template: "<span *ngIf=\"labelResourceKey\">{{ labelResourceKey | translate}}</span>\n<div class=\"bpaac-dropdown\">\n <div class=\"bpaac-search-bar\">\n <div class=\"bpaac-input-width\">\n <!-- [disabled]=\"isDisabled()\" -->\n <input type=\"text\" #streetSearchInput class=\"bpaac-input\" \n [readonly]=\"isReadonly\"\n [style.background-color]=\"!isParamsComplete() ? 'lightgrey' : ''\" \n [style.color]=\" getTextColor() \"\n [disabled]=\"(validatedByBackend && (!locality || locality.trim().length === 0)) \n || (!validatedByBackend && ((!postalCode || postalCode.trim().length === 0) && (!locality || locality.trim().length === 0)))\" (keydown)=\"checkKeyDown($event)\" \n (input)=\"onInputChange()\" (click)=\"onInputClick()\"\n [(ngModel)]=\"searchText\" id=\"streetInputField\" [attr.placeholder]=\"placeHolderText\" autocomplete=\"off\"\n (blur)=\"onBlur($event)\" (focus)=\"onFocus()\" />\n <div id=\"bpaac-clear-street-button\" *ngIf=\"mayShowClearButton()\" (click)=\"clearInput(true)\" class=\"bpaac-clear\">\n </div>\n </div>\n <!--<div ng-transclude></div>-->\n <input id=\"bpaac-street-typeahead\" type=\"text\" disabled autocomplete=\"off\" [(ngModel)]=\"bpTypeAhead\" />\n </div>\n <div [hidden]=\"collapseDropdown\" class=\"bpaac-dropdown-menu-container\" *ngIf=\"suggestions && suggestions.length>0\">\n <div #streetList [appVisibleSuggestion]=\"visibleSuggesionCount\" id=\"bpaac-street-dropdown\" class=\"bpaac-dropdown-menu\">\n <ul role=\"listbox\" id=\"bpaac-street-suggestionsList\" class=\"list-unstyled\">\n <li role=\"option\" *ngFor=\"let option of suggestions; let idx = index\" [ngClass]=\"{'active':(selectedIndex==idx)}\" (mousedown)=\"clickSuggestion($event, option)\"\n (mouseenter)=\"selectedIndex=idx\" (mouseleave)=\"selectedIndex=-1\">\n <span *ngIf=\"option\" [innerHtml]=\"option.string | highlightSuggestion : wordList\"></span>\n </li>\n </ul>\n </div>\n </div>\n</div>\n", styles: [""] }]
|
|
2436
|
+
args: [{ selector: 'bp-street', template: "<span *ngIf=\"labelResourceKey\">{{ labelResourceKey | translate}}</span>\n<div class=\"bpaac-dropdown\">\n <div class=\"bpaac-search-bar\">\n <div class=\"bpaac-input-width\">\n <!-- [disabled]=\"isDisabled()\" -->\n <input type=\"text\" #streetSearchInput class=\"bpaac-input\" \n [readonly]=\"isReadonly\"\n (keyup) = (checkKeyUP($event))\n [style.background-color]=\"!isParamsComplete() ? 'lightgrey' : ''\" \n [style.color]=\" getTextColor() \"\n [disabled]=\"(validatedByBackend && (!locality || locality.trim().length === 0)) \n || (!validatedByBackend && ((!postalCode || postalCode.trim().length === 0) && (!locality || locality.trim().length === 0)))\" (keydown)=\"checkKeyDown($event)\" \n (input)=\"onInputChange()\" (click)=\"onInputClick()\"\n [(ngModel)]=\"searchText\" id=\"streetInputField\" [attr.placeholder]=\"placeHolderText\" autocomplete=\"off\"\n (blur)=\"onBlur($event)\" (focus)=\"onFocus()\" />\n <div id=\"bpaac-clear-street-button\" *ngIf=\"mayShowClearButton()\" (click)=\"clearInput(true)\" class=\"bpaac-clear\">\n </div>\n </div>\n <!--<div ng-transclude></div>-->\n <input id=\"bpaac-street-typeahead\" type=\"text\" disabled autocomplete=\"off\" [(ngModel)]=\"bpTypeAhead\" />\n </div>\n <div [hidden]=\"collapseDropdown\" class=\"bpaac-dropdown-menu-container\" *ngIf=\"suggestions && suggestions.length>0\">\n <div #streetList [appVisibleSuggestion]=\"visibleSuggesionCount\" id=\"bpaac-street-dropdown\" class=\"bpaac-dropdown-menu\">\n <ul role=\"listbox\" id=\"bpaac-street-suggestionsList\" class=\"list-unstyled\">\n <li role=\"option\" *ngFor=\"let option of suggestions; let idx = index\" [ngClass]=\"{'active':(selectedIndex==idx)}\" (mousedown)=\"clickSuggestion($event, option)\"\n (mouseenter)=\"selectedIndex=idx\" (mouseleave)=\"selectedIndex=-1\">\n <span *ngIf=\"option\" [innerHtml]=\"option.string | highlightSuggestion : wordList\"></span>\n </li>\n </ul>\n </div>\n </div>\n</div>\n", styles: [""] }]
|
|
2367
2437
|
}], ctorParameters: function () { return [{ type: AddressService }, { type: LocaleService }, { type: i3.TranslateService }, { type: UnicodeService }]; }, propDecorators: { streetSearchInput: [{
|
|
2368
2438
|
type: ViewChild,
|
|
2369
2439
|
args: ['streetSearchInput', { static: false }]
|
|
@@ -3273,6 +3343,23 @@ class StreetNumberComponent {
|
|
|
3273
3343
|
break;
|
|
3274
3344
|
}
|
|
3275
3345
|
}
|
|
3346
|
+
checkKeyUP(event) {
|
|
3347
|
+
switch (event.which) {
|
|
3348
|
+
case 8:
|
|
3349
|
+
if (this.searchText.length > 0) {
|
|
3350
|
+
this.clearInputEventEmitter.emit('PARTIAL_CLEAR_STREET_NUMBER');
|
|
3351
|
+
}
|
|
3352
|
+
else {
|
|
3353
|
+
this.clearInputEventEmitter.emit('STREET_NUMBER');
|
|
3354
|
+
// this.clearInputEventEmitter.emit('BOX_NUMBER');
|
|
3355
|
+
// this.onClearStreetNumberInput(true);
|
|
3356
|
+
}
|
|
3357
|
+
break;
|
|
3358
|
+
default:
|
|
3359
|
+
this.clearTypeAhead();
|
|
3360
|
+
break;
|
|
3361
|
+
}
|
|
3362
|
+
}
|
|
3276
3363
|
clearWidget() {
|
|
3277
3364
|
if (this.showDebugMessageToConsole) {
|
|
3278
3365
|
console.log('street number:: clearWidget');
|
|
@@ -3345,6 +3432,7 @@ class StreetNumberComponent {
|
|
|
3345
3432
|
// this.addressChanged.emit(null);
|
|
3346
3433
|
if (emit) {
|
|
3347
3434
|
this.clearInputEventEmitter.emit(/*'STREET_NUMBER'*/ InputNameType.STREET_NUMBER);
|
|
3435
|
+
// this.clearInputEventEmitter.emit(/*'BOX_NUMBER'*/ InputNameType.BOX_NUMBER);
|
|
3348
3436
|
}
|
|
3349
3437
|
}
|
|
3350
3438
|
/*
|
|
@@ -3409,10 +3497,10 @@ class StreetNumberComponent {
|
|
|
3409
3497
|
}
|
|
3410
3498
|
}
|
|
3411
3499
|
StreetNumberComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: StreetNumberComponent, deps: [{ token: AddressService }, { token: LocaleService }, { token: i3.TranslateService }, { token: UnicodeService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3412
|
-
StreetNumberComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: StreetNumberComponent, selector: "bp-street-number", inputs: { prefillData: "prefillData", showDebugMessageToConsole: "showDebugMessageToConsole", labelResourceKey: "labelResourceKey", maxSuggesionCount: "maxSuggesionCount", visibleSuggesionCount: "visibleSuggesionCount", sortCriteria: "sortCriteria", baseUrl: "baseUrl", addressParams: "addressParams", postalCode: "postalCode", locality: "locality", streetName: "streetName", notInListAllowed: "notInListAllowed", selectedAddress: "selectedAddress", allowNoValidation: "allowNoValidation", validatedByBackend: "validatedByBackend", numberOfExceptions: "numberOfExceptions", inputLang: "inputLang", messageOption: "messageOption", inputText: "inputText", isReadonly: "isReadonly", suggestionLevel: "suggestionLevel" }, outputs: { messageChanged: "messageChanged", addressChanged: "addressChanged", focusEvent: "focusEvent", blurEvent: "blurEvent", textChangeEvent: "textChangeEvent", emptyResponseEvent: "emptyResponseEvent", clearInputEventEmitter: "clearInputEventEmitter", prefillEventEmitter: "prefillEventEmitter", streetNumberChanged: "streetNumberChanged", numberOfExceptionsEmitter: "numberOfExceptionsEmitter" }, viewQueries: [{ propertyName: "streetNumberSearchInput", first: true, predicate: ["streetNumberSearchInput"], descendants: true }, { propertyName: "streetNumberList", first: true, predicate: ["streetNumberList"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<span *ngIf=\"labelResourceKey\">{{ labelResourceKey | translate}}</span>\n<div class=\"bpaac-dropdown\">\n <div class=\"bpaac-search-bar\">\n <div class=\"bpaac-input-width\">\n <!-- [disabled]=\"isDisabled()\" -->\n <input type=\"text\" #streetNumberSearchInput class=\"bpaac-input\" \n [readonly]=\"isReadonly\"\n [style.background-color]=\"!isParamsComplete() ? 'lightgrey' : ''\" \n [style.color]=\" getTextColor() \"\n [disabled]=\"!streetName || streetName.trim().length === 0\" (keydown)=\"checkKeyDown($event)\" \n (input)=\"onInputChange()\" (click)=\"onInputClick()\"\n [(ngModel)]=\"searchText\" id=\"streetNumberInputField\" \n [attr.title]=\"placeHolderText\" \n [attr.placeholder]=\"placeHolderText\" autocomplete=\"off\"\n (blur)=\"onBlur($event)\" (focus)=\"onFocus()\" />\n <div id=\"bpaac-clear-streetNb-button\" *ngIf=\"mayShowClearButton()\" \n (click)=\"onClearStreetNumberInput(true)\" class=\"bpaac-clear\">\n </div>\n </div>\n <!--<div ng-transclude></div>-->\n <input id=\"bpaac-streetNb-typeahead\" type=\"text\" disabled autocomplete=\"off\" [(ngModel)]=\"bpTypeAhead\" />\n <!-- <span>addressIsComplete: {{ addressIsComplete }}. </span>\n <span>addressIsValidated: {{ addressIsValidated }}. </span> -->\n <span *ngIf=\"addressIsComplete\" class=\"streetNbChekmark\"><span class=\"checkmark\"></span></span>\n </div>\n <div [hidden]=\"collapseDropdown\" class=\"bpaac-dropdown-menu-container\" \n *ngIf=\"(suggestionLevel===SuggestionLevelType.StreetNumber || suggestionLevel===SuggestionLevelType.StreetAndBoxNumber) && suggestions && suggestions.length>0\">\n <div #streetNumberList [appVisibleSuggestion]=\"visibleSuggesionCount\" \n id=\"bpaac-streetnumber-dropdown\" class=\"bpaac-dropdown-menu\">\n <ul role=\"listbox\" id=\"bpaac-streetNb-suggestionsList\" class=\"list-unstyled\">\n <li role=\"option\" *ngFor=\"let option of suggestions; let idx = index\" [ngClass]=\"{'active':(selectedIndex==idx)}\" (mousedown)=\"clickSuggestion($event, option)\"\n (mouseenter)=\"selectedIndex=idx\" (mouseleave)=\"selectedIndex=-1\">\n <span *ngIf=\"option\" [innerHtml]=\"option['not-in-list'] ? emptyResponseText : option.string | highlightSuggestion : wordList\"></span>\n </li>\n </ul>\n </div>\n </div>\n</div>", styles: [""], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: VisibleSuggestionDirective, selector: "[appVisibleSuggestion]", inputs: ["appVisibleSuggestion"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "translate": i3.TranslatePipe, "highlightSuggestion": HighlightSuggestionPipe } });
|
|
3500
|
+
StreetNumberComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: StreetNumberComponent, selector: "bp-street-number", inputs: { prefillData: "prefillData", showDebugMessageToConsole: "showDebugMessageToConsole", labelResourceKey: "labelResourceKey", maxSuggesionCount: "maxSuggesionCount", visibleSuggesionCount: "visibleSuggesionCount", sortCriteria: "sortCriteria", baseUrl: "baseUrl", addressParams: "addressParams", postalCode: "postalCode", locality: "locality", streetName: "streetName", notInListAllowed: "notInListAllowed", selectedAddress: "selectedAddress", allowNoValidation: "allowNoValidation", validatedByBackend: "validatedByBackend", numberOfExceptions: "numberOfExceptions", inputLang: "inputLang", messageOption: "messageOption", inputText: "inputText", isReadonly: "isReadonly", suggestionLevel: "suggestionLevel" }, outputs: { messageChanged: "messageChanged", addressChanged: "addressChanged", focusEvent: "focusEvent", blurEvent: "blurEvent", textChangeEvent: "textChangeEvent", emptyResponseEvent: "emptyResponseEvent", clearInputEventEmitter: "clearInputEventEmitter", prefillEventEmitter: "prefillEventEmitter", streetNumberChanged: "streetNumberChanged", numberOfExceptionsEmitter: "numberOfExceptionsEmitter" }, viewQueries: [{ propertyName: "streetNumberSearchInput", first: true, predicate: ["streetNumberSearchInput"], descendants: true }, { propertyName: "streetNumberList", first: true, predicate: ["streetNumberList"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<span *ngIf=\"labelResourceKey\">{{ labelResourceKey | translate}}</span>\n<div class=\"bpaac-dropdown\">\n <div class=\"bpaac-search-bar\">\n <div class=\"bpaac-input-width\">\n <!-- [disabled]=\"isDisabled()\" -->\n <input type=\"text\" #streetNumberSearchInput class=\"bpaac-input\" \n [readonly]=\"isReadonly\"\n (keyup) = (checkKeyUP($event))\n [style.background-color]=\"!isParamsComplete() ? 'lightgrey' : ''\" \n [style.color]=\" getTextColor() \"\n [disabled]=\"!streetName || streetName.trim().length === 0\" (keydown)=\"checkKeyDown($event)\" \n (input)=\"onInputChange()\" (click)=\"onInputClick()\"\n [(ngModel)]=\"searchText\" id=\"streetNumberInputField\" \n [attr.title]=\"placeHolderText\" \n [attr.placeholder]=\"placeHolderText\" autocomplete=\"off\"\n (blur)=\"onBlur($event)\" (focus)=\"onFocus()\" />\n <div id=\"bpaac-clear-streetNb-button\" *ngIf=\"mayShowClearButton()\" \n (click)=\"onClearStreetNumberInput(true)\" class=\"bpaac-clear\">\n </div>\n </div>\n <!--<div ng-transclude></div>-->\n <input id=\"bpaac-streetNb-typeahead\" type=\"text\" disabled autocomplete=\"off\" [(ngModel)]=\"bpTypeAhead\" />\n <!-- <span>addressIsComplete: {{ addressIsComplete }}. </span>\n <span>addressIsValidated: {{ addressIsValidated }}. </span> -->\n <span *ngIf=\"addressIsComplete\" class=\"streetNbChekmark\"><span class=\"checkmark\"></span></span>\n </div>\n <div [hidden]=\"collapseDropdown\" class=\"bpaac-dropdown-menu-container\" \n *ngIf=\"(suggestionLevel===SuggestionLevelType.StreetNumber || suggestionLevel===SuggestionLevelType.StreetAndBoxNumber) && suggestions && suggestions.length>0\">\n <div #streetNumberList [appVisibleSuggestion]=\"visibleSuggesionCount\" \n id=\"bpaac-streetnumber-dropdown\" class=\"bpaac-dropdown-menu\">\n <ul role=\"listbox\" id=\"bpaac-streetNb-suggestionsList\" class=\"list-unstyled\">\n <li role=\"option\" *ngFor=\"let option of suggestions; let idx = index\" [ngClass]=\"{'active':(selectedIndex==idx)}\" (mousedown)=\"clickSuggestion($event, option)\"\n (mouseenter)=\"selectedIndex=idx\" (mouseleave)=\"selectedIndex=-1\">\n <span *ngIf=\"option\" [innerHtml]=\"option['not-in-list'] ? emptyResponseText : option.string | highlightSuggestion : wordList\"></span>\n </li>\n </ul>\n </div>\n </div>\n</div>", styles: [""], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: VisibleSuggestionDirective, selector: "[appVisibleSuggestion]", inputs: ["appVisibleSuggestion"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "translate": i3.TranslatePipe, "highlightSuggestion": HighlightSuggestionPipe } });
|
|
3413
3501
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: StreetNumberComponent, decorators: [{
|
|
3414
3502
|
type: Component,
|
|
3415
|
-
args: [{ selector: 'bp-street-number', template: "<span *ngIf=\"labelResourceKey\">{{ labelResourceKey | translate}}</span>\n<div class=\"bpaac-dropdown\">\n <div class=\"bpaac-search-bar\">\n <div class=\"bpaac-input-width\">\n <!-- [disabled]=\"isDisabled()\" -->\n <input type=\"text\" #streetNumberSearchInput class=\"bpaac-input\" \n [readonly]=\"isReadonly\"\n [style.background-color]=\"!isParamsComplete() ? 'lightgrey' : ''\" \n [style.color]=\" getTextColor() \"\n [disabled]=\"!streetName || streetName.trim().length === 0\" (keydown)=\"checkKeyDown($event)\" \n (input)=\"onInputChange()\" (click)=\"onInputClick()\"\n [(ngModel)]=\"searchText\" id=\"streetNumberInputField\" \n [attr.title]=\"placeHolderText\" \n [attr.placeholder]=\"placeHolderText\" autocomplete=\"off\"\n (blur)=\"onBlur($event)\" (focus)=\"onFocus()\" />\n <div id=\"bpaac-clear-streetNb-button\" *ngIf=\"mayShowClearButton()\" \n (click)=\"onClearStreetNumberInput(true)\" class=\"bpaac-clear\">\n </div>\n </div>\n <!--<div ng-transclude></div>-->\n <input id=\"bpaac-streetNb-typeahead\" type=\"text\" disabled autocomplete=\"off\" [(ngModel)]=\"bpTypeAhead\" />\n <!-- <span>addressIsComplete: {{ addressIsComplete }}. </span>\n <span>addressIsValidated: {{ addressIsValidated }}. </span> -->\n <span *ngIf=\"addressIsComplete\" class=\"streetNbChekmark\"><span class=\"checkmark\"></span></span>\n </div>\n <div [hidden]=\"collapseDropdown\" class=\"bpaac-dropdown-menu-container\" \n *ngIf=\"(suggestionLevel===SuggestionLevelType.StreetNumber || suggestionLevel===SuggestionLevelType.StreetAndBoxNumber) && suggestions && suggestions.length>0\">\n <div #streetNumberList [appVisibleSuggestion]=\"visibleSuggesionCount\" \n id=\"bpaac-streetnumber-dropdown\" class=\"bpaac-dropdown-menu\">\n <ul role=\"listbox\" id=\"bpaac-streetNb-suggestionsList\" class=\"list-unstyled\">\n <li role=\"option\" *ngFor=\"let option of suggestions; let idx = index\" [ngClass]=\"{'active':(selectedIndex==idx)}\" (mousedown)=\"clickSuggestion($event, option)\"\n (mouseenter)=\"selectedIndex=idx\" (mouseleave)=\"selectedIndex=-1\">\n <span *ngIf=\"option\" [innerHtml]=\"option['not-in-list'] ? emptyResponseText : option.string | highlightSuggestion : wordList\"></span>\n </li>\n </ul>\n </div>\n </div>\n</div>", styles: [""] }]
|
|
3503
|
+
args: [{ selector: 'bp-street-number', template: "<span *ngIf=\"labelResourceKey\">{{ labelResourceKey | translate}}</span>\n<div class=\"bpaac-dropdown\">\n <div class=\"bpaac-search-bar\">\n <div class=\"bpaac-input-width\">\n <!-- [disabled]=\"isDisabled()\" -->\n <input type=\"text\" #streetNumberSearchInput class=\"bpaac-input\" \n [readonly]=\"isReadonly\"\n (keyup) = (checkKeyUP($event))\n [style.background-color]=\"!isParamsComplete() ? 'lightgrey' : ''\" \n [style.color]=\" getTextColor() \"\n [disabled]=\"!streetName || streetName.trim().length === 0\" (keydown)=\"checkKeyDown($event)\" \n (input)=\"onInputChange()\" (click)=\"onInputClick()\"\n [(ngModel)]=\"searchText\" id=\"streetNumberInputField\" \n [attr.title]=\"placeHolderText\" \n [attr.placeholder]=\"placeHolderText\" autocomplete=\"off\"\n (blur)=\"onBlur($event)\" (focus)=\"onFocus()\" />\n <div id=\"bpaac-clear-streetNb-button\" *ngIf=\"mayShowClearButton()\" \n (click)=\"onClearStreetNumberInput(true)\" class=\"bpaac-clear\">\n </div>\n </div>\n <!--<div ng-transclude></div>-->\n <input id=\"bpaac-streetNb-typeahead\" type=\"text\" disabled autocomplete=\"off\" [(ngModel)]=\"bpTypeAhead\" />\n <!-- <span>addressIsComplete: {{ addressIsComplete }}. </span>\n <span>addressIsValidated: {{ addressIsValidated }}. </span> -->\n <span *ngIf=\"addressIsComplete\" class=\"streetNbChekmark\"><span class=\"checkmark\"></span></span>\n </div>\n <div [hidden]=\"collapseDropdown\" class=\"bpaac-dropdown-menu-container\" \n *ngIf=\"(suggestionLevel===SuggestionLevelType.StreetNumber || suggestionLevel===SuggestionLevelType.StreetAndBoxNumber) && suggestions && suggestions.length>0\">\n <div #streetNumberList [appVisibleSuggestion]=\"visibleSuggesionCount\" \n id=\"bpaac-streetnumber-dropdown\" class=\"bpaac-dropdown-menu\">\n <ul role=\"listbox\" id=\"bpaac-streetNb-suggestionsList\" class=\"list-unstyled\">\n <li role=\"option\" *ngFor=\"let option of suggestions; let idx = index\" [ngClass]=\"{'active':(selectedIndex==idx)}\" (mousedown)=\"clickSuggestion($event, option)\"\n (mouseenter)=\"selectedIndex=idx\" (mouseleave)=\"selectedIndex=-1\">\n <span *ngIf=\"option\" [innerHtml]=\"option['not-in-list'] ? emptyResponseText : option.string | highlightSuggestion : wordList\"></span>\n </li>\n </ul>\n </div>\n </div>\n</div>", styles: [""] }]
|
|
3416
3504
|
}], ctorParameters: function () { return [{ type: AddressService }, { type: LocaleService }, { type: i3.TranslateService }, { type: UnicodeService }]; }, propDecorators: { streetNumberSearchInput: [{
|
|
3417
3505
|
type: ViewChild,
|
|
3418
3506
|
args: ['streetNumberSearchInput', { static: false }]
|
|
@@ -4242,6 +4330,21 @@ class BoxNumberComponent {
|
|
|
4242
4330
|
break;
|
|
4243
4331
|
}
|
|
4244
4332
|
}
|
|
4333
|
+
checkKeyUP(event) {
|
|
4334
|
+
switch (event.which) {
|
|
4335
|
+
case 8:
|
|
4336
|
+
if (this.searchText.length > 0) {
|
|
4337
|
+
this.clearInputEventEmitter.emit('PARTIAL_CLEAR_BOX_NUMBER');
|
|
4338
|
+
}
|
|
4339
|
+
else {
|
|
4340
|
+
this.clearInputEventEmitter.emit('BOX_NUMBER');
|
|
4341
|
+
}
|
|
4342
|
+
break;
|
|
4343
|
+
default:
|
|
4344
|
+
this.clearTypeAhead();
|
|
4345
|
+
break;
|
|
4346
|
+
}
|
|
4347
|
+
}
|
|
4245
4348
|
clearWidget() {
|
|
4246
4349
|
this.addressIsValidated = false;
|
|
4247
4350
|
this.clearSearchText();
|
|
@@ -4355,10 +4458,10 @@ class BoxNumberComponent {
|
|
|
4355
4458
|
}
|
|
4356
4459
|
}
|
|
4357
4460
|
BoxNumberComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: BoxNumberComponent, deps: [{ token: AddressService }, { token: LocaleService }, { token: i3.TranslateService }, { token: UnicodeService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4358
|
-
BoxNumberComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: BoxNumberComponent, selector: "bp-box-number", inputs: { prefillData: "prefillData", showDebugMessageToConsole: "showDebugMessageToConsole", labelResourceKey: "labelResourceKey", maxSuggesionCount: "maxSuggesionCount", visibleSuggesionCount: "visibleSuggesionCount", sortCriteria: "sortCriteria", baseUrl: "baseUrl", addressParams: "addressParams", postalCode: "postalCode", locality: "locality", streetName: "streetName", streetNumber: "streetNumber", selectedAddress: "selectedAddress", notInListAllowed: "notInListAllowed", allowNoValidation: "allowNoValidation", validatedByBackend: "validatedByBackend", numberOfExceptions: "numberOfExceptions", inputLang: "inputLang", messageOption: "messageOption", isReadonly: "isReadonly", suggestionLevel: "suggestionLevel" }, outputs: { messageChanged: "messageChanged", addressChanged: "addressChanged", focusEvent: "focusEvent", blurEvent: "blurEvent", textChangeEvent: "textChangeEvent", emptyResponseEvent: "emptyResponseEvent", clearInputEventEmitter: "clearInputEventEmitter", prefillEventEmitter: "prefillEventEmitter", boxNumberChanged: "boxNumberChanged", numberOfExceptionsEmitter: "numberOfExceptionsEmitter" }, viewQueries: [{ propertyName: "boxNumberSearchInput", first: true, predicate: ["boxNumberSearchInput"], descendants: true }, { propertyName: "boxNumberList", first: true, predicate: ["boxNumberList"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<span *ngIf=\"labelResourceKey\">{{ labelResourceKey | translate}}</span>\n<div class=\"bpaac-dropdown\">\n <div class=\"bpaac-search-bar\">\n <div class=\"bpaac-input-width\">\n <!-- [disabled]=\"isDisabled()\" -->\n <input type=\"text\" #boxNumberSearchInput class=\"bpaac-input\" \n [readonly]=\"isReadonly\"\n [style.background-color]=\"!isParamsComplete() ? 'lightgrey' : ''\" \n [style.color]=\" getTextColor() \"\n [disabled]=\"!streetNumber || streetNumber.trim().length === 0\" (keydown)=\"checkKeyDown($event)\" \n (input)=\"onInputChange()\" (click)=\"onInputClick()\"\n [(ngModel)]=\"searchText\" id=\"boxNumberInputField\" [attr.title]=\"placeHolderText\" [attr.placeholder]=\"placeHolderText\" autocomplete=\"off\"\n (blur)=\"onBlur($event)\" (focus)=\"onFocus()\" />\n <div id=\"bpaac-clear-boxNb-button\" *ngIf=\"mayShowClearButton()\" (click)=\"clearInput(true)\" class=\"bpaac-clear\">\n </div>\n </div>\n <!--<div ng-transclude></div>-->\n <input id=\"bpaac-boxNb-typeahead\" type=\"text\" disabled autocomplete=\"off\" [(ngModel)]=\"bpTypeAhead\" />\n <span *ngIf=\"addressIsValidated\" class=\"boxNbChekmark\"><span class=\"checkmark\"></span></span>\n </div>\n <div [hidden]=\"collapseDropdown\" class=\"bpaac-dropdown-menu-container\" \n *ngIf=\"suggestionLevel===SuggestionLevelType.StreetAndBoxNumber && suggestions && suggestions.length>0\">\n <div #boxNumberList [appVisibleSuggestion]=\"visibleSuggesionCount\" id=\"bpaac-box-dropdown\" class=\"bpaac-dropdown-menu\">\n <ul role=\"listbox\" id=\"bpaac-boxNb-suggestionsList\" class=\"list-unstyled\">\n <li role=\"option\" *ngFor=\"let option of suggestions; let idx = index\" [ngClass]=\"{'active':(selectedIndex==idx)}\" \n (mousedown)=\"clickSuggestion($event, option)\"\n (mouseenter)=\"selectedIndex=idx\" (mouseleave)=\"selectedIndex=-1\">\n <span *ngIf=\"option\" [innerHtml]=\"option['not-in-list'] ? emptyResponseText : option.string | highlightSuggestion : wordList\"></span>\n </li>\n </ul>\n </div>\n </div>\n</div>\n", styles: [""], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: VisibleSuggestionDirective, selector: "[appVisibleSuggestion]", inputs: ["appVisibleSuggestion"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "translate": i3.TranslatePipe, "highlightSuggestion": HighlightSuggestionPipe } });
|
|
4461
|
+
BoxNumberComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: BoxNumberComponent, selector: "bp-box-number", inputs: { prefillData: "prefillData", showDebugMessageToConsole: "showDebugMessageToConsole", labelResourceKey: "labelResourceKey", maxSuggesionCount: "maxSuggesionCount", visibleSuggesionCount: "visibleSuggesionCount", sortCriteria: "sortCriteria", baseUrl: "baseUrl", addressParams: "addressParams", postalCode: "postalCode", locality: "locality", streetName: "streetName", streetNumber: "streetNumber", selectedAddress: "selectedAddress", notInListAllowed: "notInListAllowed", allowNoValidation: "allowNoValidation", validatedByBackend: "validatedByBackend", numberOfExceptions: "numberOfExceptions", inputLang: "inputLang", messageOption: "messageOption", isReadonly: "isReadonly", suggestionLevel: "suggestionLevel" }, outputs: { messageChanged: "messageChanged", addressChanged: "addressChanged", focusEvent: "focusEvent", blurEvent: "blurEvent", textChangeEvent: "textChangeEvent", emptyResponseEvent: "emptyResponseEvent", clearInputEventEmitter: "clearInputEventEmitter", prefillEventEmitter: "prefillEventEmitter", boxNumberChanged: "boxNumberChanged", numberOfExceptionsEmitter: "numberOfExceptionsEmitter" }, viewQueries: [{ propertyName: "boxNumberSearchInput", first: true, predicate: ["boxNumberSearchInput"], descendants: true }, { propertyName: "boxNumberList", first: true, predicate: ["boxNumberList"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<span *ngIf=\"labelResourceKey\">{{ labelResourceKey | translate}}</span>\n<div class=\"bpaac-dropdown\">\n <div class=\"bpaac-search-bar\">\n <div class=\"bpaac-input-width\">\n <!-- [disabled]=\"isDisabled()\" -->\n <input type=\"text\" #boxNumberSearchInput class=\"bpaac-input\" \n [readonly]=\"isReadonly\"\n (keyup) = (checkKeyUP($event))\n [style.background-color]=\"!isParamsComplete() ? 'lightgrey' : ''\" \n [style.color]=\" getTextColor() \"\n [disabled]=\"!streetNumber || streetNumber.trim().length === 0\" (keydown)=\"checkKeyDown($event)\" \n (input)=\"onInputChange()\" (click)=\"onInputClick()\"\n [(ngModel)]=\"searchText\" id=\"boxNumberInputField\" [attr.title]=\"placeHolderText\" [attr.placeholder]=\"placeHolderText\" autocomplete=\"off\"\n (blur)=\"onBlur($event)\" (focus)=\"onFocus()\" />\n <div id=\"bpaac-clear-boxNb-button\" *ngIf=\"mayShowClearButton()\" (click)=\"clearInput(true)\" class=\"bpaac-clear\">\n </div>\n </div>\n <!--<div ng-transclude></div>-->\n <input id=\"bpaac-boxNb-typeahead\" type=\"text\" disabled autocomplete=\"off\" [(ngModel)]=\"bpTypeAhead\" />\n <span *ngIf=\"addressIsValidated\" class=\"boxNbChekmark\"><span class=\"checkmark\"></span></span>\n </div>\n <div [hidden]=\"collapseDropdown\" class=\"bpaac-dropdown-menu-container\" \n *ngIf=\"suggestionLevel===SuggestionLevelType.StreetAndBoxNumber && suggestions && suggestions.length>0\">\n <div #boxNumberList [appVisibleSuggestion]=\"visibleSuggesionCount\" id=\"bpaac-box-dropdown\" class=\"bpaac-dropdown-menu\">\n <ul role=\"listbox\" id=\"bpaac-boxNb-suggestionsList\" class=\"list-unstyled\">\n <li role=\"option\" *ngFor=\"let option of suggestions; let idx = index\" [ngClass]=\"{'active':(selectedIndex==idx)}\" \n (mousedown)=\"clickSuggestion($event, option)\"\n (mouseenter)=\"selectedIndex=idx\" (mouseleave)=\"selectedIndex=-1\">\n <span *ngIf=\"option\" [innerHtml]=\"option['not-in-list'] ? emptyResponseText : option.string | highlightSuggestion : wordList\"></span>\n </li>\n </ul>\n </div>\n </div>\n</div>\n", styles: [""], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: VisibleSuggestionDirective, selector: "[appVisibleSuggestion]", inputs: ["appVisibleSuggestion"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "translate": i3.TranslatePipe, "highlightSuggestion": HighlightSuggestionPipe } });
|
|
4359
4462
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: BoxNumberComponent, decorators: [{
|
|
4360
4463
|
type: Component,
|
|
4361
|
-
args: [{ selector: 'bp-box-number', template: "<span *ngIf=\"labelResourceKey\">{{ labelResourceKey | translate}}</span>\n<div class=\"bpaac-dropdown\">\n <div class=\"bpaac-search-bar\">\n <div class=\"bpaac-input-width\">\n <!-- [disabled]=\"isDisabled()\" -->\n <input type=\"text\" #boxNumberSearchInput class=\"bpaac-input\" \n [readonly]=\"isReadonly\"\n [style.background-color]=\"!isParamsComplete() ? 'lightgrey' : ''\" \n [style.color]=\" getTextColor() \"\n [disabled]=\"!streetNumber || streetNumber.trim().length === 0\" (keydown)=\"checkKeyDown($event)\" \n (input)=\"onInputChange()\" (click)=\"onInputClick()\"\n [(ngModel)]=\"searchText\" id=\"boxNumberInputField\" [attr.title]=\"placeHolderText\" [attr.placeholder]=\"placeHolderText\" autocomplete=\"off\"\n (blur)=\"onBlur($event)\" (focus)=\"onFocus()\" />\n <div id=\"bpaac-clear-boxNb-button\" *ngIf=\"mayShowClearButton()\" (click)=\"clearInput(true)\" class=\"bpaac-clear\">\n </div>\n </div>\n <!--<div ng-transclude></div>-->\n <input id=\"bpaac-boxNb-typeahead\" type=\"text\" disabled autocomplete=\"off\" [(ngModel)]=\"bpTypeAhead\" />\n <span *ngIf=\"addressIsValidated\" class=\"boxNbChekmark\"><span class=\"checkmark\"></span></span>\n </div>\n <div [hidden]=\"collapseDropdown\" class=\"bpaac-dropdown-menu-container\" \n *ngIf=\"suggestionLevel===SuggestionLevelType.StreetAndBoxNumber && suggestions && suggestions.length>0\">\n <div #boxNumberList [appVisibleSuggestion]=\"visibleSuggesionCount\" id=\"bpaac-box-dropdown\" class=\"bpaac-dropdown-menu\">\n <ul role=\"listbox\" id=\"bpaac-boxNb-suggestionsList\" class=\"list-unstyled\">\n <li role=\"option\" *ngFor=\"let option of suggestions; let idx = index\" [ngClass]=\"{'active':(selectedIndex==idx)}\" \n (mousedown)=\"clickSuggestion($event, option)\"\n (mouseenter)=\"selectedIndex=idx\" (mouseleave)=\"selectedIndex=-1\">\n <span *ngIf=\"option\" [innerHtml]=\"option['not-in-list'] ? emptyResponseText : option.string | highlightSuggestion : wordList\"></span>\n </li>\n </ul>\n </div>\n </div>\n</div>\n", styles: [""] }]
|
|
4464
|
+
args: [{ selector: 'bp-box-number', template: "<span *ngIf=\"labelResourceKey\">{{ labelResourceKey | translate}}</span>\n<div class=\"bpaac-dropdown\">\n <div class=\"bpaac-search-bar\">\n <div class=\"bpaac-input-width\">\n <!-- [disabled]=\"isDisabled()\" -->\n <input type=\"text\" #boxNumberSearchInput class=\"bpaac-input\" \n [readonly]=\"isReadonly\"\n (keyup) = (checkKeyUP($event))\n [style.background-color]=\"!isParamsComplete() ? 'lightgrey' : ''\" \n [style.color]=\" getTextColor() \"\n [disabled]=\"!streetNumber || streetNumber.trim().length === 0\" (keydown)=\"checkKeyDown($event)\" \n (input)=\"onInputChange()\" (click)=\"onInputClick()\"\n [(ngModel)]=\"searchText\" id=\"boxNumberInputField\" [attr.title]=\"placeHolderText\" [attr.placeholder]=\"placeHolderText\" autocomplete=\"off\"\n (blur)=\"onBlur($event)\" (focus)=\"onFocus()\" />\n <div id=\"bpaac-clear-boxNb-button\" *ngIf=\"mayShowClearButton()\" (click)=\"clearInput(true)\" class=\"bpaac-clear\">\n </div>\n </div>\n <!--<div ng-transclude></div>-->\n <input id=\"bpaac-boxNb-typeahead\" type=\"text\" disabled autocomplete=\"off\" [(ngModel)]=\"bpTypeAhead\" />\n <span *ngIf=\"addressIsValidated\" class=\"boxNbChekmark\"><span class=\"checkmark\"></span></span>\n </div>\n <div [hidden]=\"collapseDropdown\" class=\"bpaac-dropdown-menu-container\" \n *ngIf=\"suggestionLevel===SuggestionLevelType.StreetAndBoxNumber && suggestions && suggestions.length>0\">\n <div #boxNumberList [appVisibleSuggestion]=\"visibleSuggesionCount\" id=\"bpaac-box-dropdown\" class=\"bpaac-dropdown-menu\">\n <ul role=\"listbox\" id=\"bpaac-boxNb-suggestionsList\" class=\"list-unstyled\">\n <li role=\"option\" *ngFor=\"let option of suggestions; let idx = index\" [ngClass]=\"{'active':(selectedIndex==idx)}\" \n (mousedown)=\"clickSuggestion($event, option)\"\n (mouseenter)=\"selectedIndex=idx\" (mouseleave)=\"selectedIndex=-1\">\n <span *ngIf=\"option\" [innerHtml]=\"option['not-in-list'] ? emptyResponseText : option.string | highlightSuggestion : wordList\"></span>\n </li>\n </ul>\n </div>\n </div>\n</div>\n", styles: [""] }]
|
|
4362
4465
|
}], ctorParameters: function () { return [{ type: AddressService }, { type: LocaleService }, { type: i3.TranslateService }, { type: UnicodeService }]; }, propDecorators: { boxNumberSearchInput: [{
|
|
4363
4466
|
type: ViewChild,
|
|
4364
4467
|
args: ['boxNumberSearchInput', { static: false }]
|
|
@@ -4484,7 +4587,7 @@ class LibAddressAutocompleteByComponentComponent {
|
|
|
4484
4587
|
this.httpService = httpService;
|
|
4485
4588
|
this.selectedLanguage = null;
|
|
4486
4589
|
this.baseUrl = "https://api.mailops.bpost.cloud/roa-info/externalMailingAddressProofingRest/autocomplete/";
|
|
4487
|
-
this.defaultApiKey = '
|
|
4590
|
+
this.defaultApiKey = '';
|
|
4488
4591
|
this.usedLocalityUrl = this.baseUrl + 'locality';
|
|
4489
4592
|
this.usedStreetUrl = this.baseUrl + 'street';
|
|
4490
4593
|
this.usedStreetNumberUrl = this.baseUrl + 'streetNumber';
|
|
@@ -5124,25 +5227,81 @@ class LibAddressAutocompleteByComponentComponent {
|
|
|
5124
5227
|
*/
|
|
5125
5228
|
}
|
|
5126
5229
|
resetLocality(event) {
|
|
5230
|
+
var _a, _b, _c;
|
|
5127
5231
|
this.postalCode = '';
|
|
5128
5232
|
this.locality = '';
|
|
5233
|
+
const street = (_a = this.selectedAddress) === null || _a === void 0 ? void 0 : _a.hasOwnProperty('streetName');
|
|
5234
|
+
const house = (_b = this.selectedAddress) === null || _b === void 0 ? void 0 : _b.hasOwnProperty('houseNumber');
|
|
5235
|
+
const box = (_c = this.selectedAddress) === null || _c === void 0 ? void 0 : _c.hasOwnProperty('boxNumber');
|
|
5129
5236
|
this.quitPrefillMode();
|
|
5130
|
-
|
|
5237
|
+
if (event) {
|
|
5238
|
+
if (street == true) {
|
|
5239
|
+
this.onClearInputEventEmitter(InputNameType.STREET);
|
|
5240
|
+
}
|
|
5241
|
+
if (house == true) {
|
|
5242
|
+
this.onClearInputEventEmitter(InputNameType.STREET_NUMBER);
|
|
5243
|
+
}
|
|
5244
|
+
if (box == true) {
|
|
5245
|
+
this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
|
|
5246
|
+
}
|
|
5247
|
+
}
|
|
5248
|
+
if (!event) {
|
|
5249
|
+
if (street == true) {
|
|
5250
|
+
this.onClearInputEventEmitter(InputNameType.STREET);
|
|
5251
|
+
}
|
|
5252
|
+
if (house == true) {
|
|
5253
|
+
this.onClearInputEventEmitter(InputNameType.STREET_NUMBER);
|
|
5254
|
+
}
|
|
5255
|
+
if (box == true) {
|
|
5256
|
+
this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
|
|
5257
|
+
}
|
|
5258
|
+
}
|
|
5131
5259
|
this.setAddress(null, 4);
|
|
5132
5260
|
}
|
|
5133
5261
|
resetStreet(event) {
|
|
5262
|
+
var _a, _b;
|
|
5134
5263
|
this.street = '';
|
|
5264
|
+
const house = (_a = this.selectedAddress) === null || _a === void 0 ? void 0 : _a.hasOwnProperty('houseNumber');
|
|
5265
|
+
const box = (_b = this.selectedAddress) === null || _b === void 0 ? void 0 : _b.hasOwnProperty('boxNumber');
|
|
5135
5266
|
this.quitPrefillMode();
|
|
5136
|
-
|
|
5267
|
+
if (event) {
|
|
5268
|
+
if (house == true) {
|
|
5269
|
+
this.onClearInputEventEmitter(InputNameType.STREET_NUMBER);
|
|
5270
|
+
}
|
|
5271
|
+
// this.onClearInputEventEmitter(InputNameType.STREET_NUMBER);
|
|
5272
|
+
if (box == true) {
|
|
5273
|
+
this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
|
|
5274
|
+
}
|
|
5275
|
+
// this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
|
|
5276
|
+
}
|
|
5277
|
+
if (!event) {
|
|
5278
|
+
if (house == true) {
|
|
5279
|
+
this.onClearInputEventEmitter(InputNameType.STREET_NUMBER);
|
|
5280
|
+
}
|
|
5281
|
+
// this.onClearInputEventEmitter(InputNameType.STREET_NUMBER);
|
|
5282
|
+
if (box == true) {
|
|
5283
|
+
this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
|
|
5284
|
+
}
|
|
5285
|
+
// this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
|
|
5286
|
+
}
|
|
5137
5287
|
this.autocompleteStreetNb.addressIsComplete = false;
|
|
5138
5288
|
this.autocompleteStreetNb.streetName = '';
|
|
5139
5289
|
this.setAddress(null, 3);
|
|
5140
5290
|
}
|
|
5141
5291
|
resetStreetNumber(event, resetAddress = false) {
|
|
5142
|
-
|
|
5292
|
+
var _a;
|
|
5293
|
+
// console.log('reset street numner!', event);
|
|
5294
|
+
const box = (_a = this.selectedAddress) === null || _a === void 0 ? void 0 : _a.hasOwnProperty('boxNumber');
|
|
5143
5295
|
this.streetNumber = '';
|
|
5144
5296
|
this.quitPrefillMode();
|
|
5145
|
-
|
|
5297
|
+
if (event) {
|
|
5298
|
+
if (box == true) {
|
|
5299
|
+
this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
|
|
5300
|
+
}
|
|
5301
|
+
}
|
|
5302
|
+
if (!event && box == true) {
|
|
5303
|
+
this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
|
|
5304
|
+
}
|
|
5146
5305
|
this.autocompleteBoxNb.addressIsComplete = false;
|
|
5147
5306
|
this.autocompleteBoxNb.streetNumber = '';
|
|
5148
5307
|
this.setAddress(null, 2);
|
|
@@ -5156,13 +5315,13 @@ class LibAddressAutocompleteByComponentComponent {
|
|
|
5156
5315
|
// console.log('reset street numner!', event, resetAddress);
|
|
5157
5316
|
this.boxNumber = '';
|
|
5158
5317
|
this.quitPrefillMode();
|
|
5318
|
+
// this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
|
|
5159
5319
|
this.autocompleteBoxNb.addressIsComplete = false;
|
|
5160
|
-
|
|
5320
|
+
this.autocompleteBoxNb.boxNumber = '';
|
|
5161
5321
|
this.setAddress(null, 1);
|
|
5162
|
-
if
|
|
5163
|
-
|
|
5164
|
-
}
|
|
5165
|
-
// this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
|
|
5322
|
+
// if(!event){
|
|
5323
|
+
// this.clearInputEventEmitter.emit('CLEAR_BOX_NUMBER')
|
|
5324
|
+
// }
|
|
5166
5325
|
// $$ 7 this.setAddress(null, 1); // $$ ?????
|
|
5167
5326
|
/*
|
|
5168
5327
|
if (resetAddress === true) {
|
|
@@ -5707,6 +5866,26 @@ class LibAddressAutocompleteByComponentComponent {
|
|
|
5707
5866
|
this.setAddress(address, ADDRESSLEVEL.STREET_NUMBER);
|
|
5708
5867
|
// this.quitPrefillMode();
|
|
5709
5868
|
}
|
|
5869
|
+
else {
|
|
5870
|
+
this.updatePostalCodeLocality(address);
|
|
5871
|
+
this.updateStreetName(address);
|
|
5872
|
+
this.updateStreetNumber(address);
|
|
5873
|
+
this.streetAddress = address;
|
|
5874
|
+
this.streetNumberAddress = address;
|
|
5875
|
+
if (address.hasOwnProperty('isComplete') && address.isComplete === true) {
|
|
5876
|
+
this.autocompleteStreetNb.addressIsComplete = true;
|
|
5877
|
+
if (addressIsNotInList) {
|
|
5878
|
+
this.autocompleteBoxNb.streetNumber = address.houseNumber;
|
|
5879
|
+
}
|
|
5880
|
+
else {
|
|
5881
|
+
this.autocompleteBoxNb.streetNumber = '';
|
|
5882
|
+
}
|
|
5883
|
+
}
|
|
5884
|
+
else {
|
|
5885
|
+
this.autocompleteBoxNb.streetNumber = address.houseNumber;
|
|
5886
|
+
}
|
|
5887
|
+
this.autocompleteBoxNb.searchText = '';
|
|
5888
|
+
}
|
|
5710
5889
|
/*
|
|
5711
5890
|
const boxNumber = this.prefillData.parameters.boxNumber;
|
|
5712
5891
|
if ( ! addressIsNotInList && (boxNumber === null || boxNumber === undefined || boxNumber === '') )
|