@bpost/bp-address-auto-complete-by-component 1.1.16 → 1.1.18

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.
@@ -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 = '';
@@ -1315,8 +1316,8 @@ class LocalityComponent {
1315
1316
  }
1316
1317
  const suggestionLocality = this.transformMunicipalityInLowercaseAndWithoutDiacritics(sugAddress.localityName);
1317
1318
  const suggestionMunicipality = this.transformMunicipalityInLowercaseAndWithoutDiacritics(sugAddress.municipalityName);
1318
- if (suggestionLocality === this.prefillData.prefillMunicipalityName
1319
- || suggestionMunicipality === this.prefillData.prefillMunicipalityName) {
1319
+ if (suggestionLocality.startsWith(this.prefillData.prefillMunicipalityName)
1320
+ || suggestionMunicipality.startsWith(this.prefillData.prefillMunicipalityName)) {
1320
1321
  if (this.prefillData.prefillMunicipalityAndLocalityPerfectMatchFound === true) {
1321
1322
  if (this.showDebugMessageToConsole) {
1322
1323
  console.log('LOCALITY - PREFILL - skipping suggestion:', suggestion);
@@ -1329,8 +1330,8 @@ class LocalityComponent {
1329
1330
  this.prefillData.prefillMunicipalityPerfectMatchFound = true;
1330
1331
  this.prefillData.prefillMunicipalityPerfectMatchSuggestion = suggestion;
1331
1332
  this.searchText = sugAddress.postalCode + ' ' + sugAddress.localityName;
1332
- this.prefillData.prefillMunicipalityAndLocalityPerfectMatchFound = (suggestionLocality === this.prefillData.prefillMunicipalityName
1333
- && suggestionMunicipality === this.prefillData.prefillMunicipalityName) ? true : false;
1333
+ this.prefillData.prefillMunicipalityAndLocalityPerfectMatchFound = (suggestionLocality.startsWith(this.prefillData.prefillMunicipalityName)
1334
+ && suggestionMunicipality.startsWith(this.prefillData.prefillMunicipalityName)) ? true : false;
1334
1335
  if (this.prefillData.prefillMunicipalityAndLocalityPerfectMatchFound === true) {
1335
1336
  if (this.showDebugMessageToConsole) {
1336
1337
  console.log('LOCALITY - PREFILL - Perfect match - Municipality & location:', suggestion);
@@ -1396,6 +1397,9 @@ class LocalityComponent {
1396
1397
  }
1397
1398
  if (emit) {
1398
1399
  this.clearInputEventEmitter.emit(/*'LOCALITY'*/ InputNameType.LOCALITY);
1400
+ this.clearInputEventEmitter.emit(/*'STREET'*/ InputNameType.STREET);
1401
+ this.clearInputEventEmitter.emit(/*'STREET_NUMBER'*/ InputNameType.STREET_NUMBER);
1402
+ this.clearInputEventEmitter.emit(/*'BOX_NUMBER'*/ InputNameType.BOX_NUMBER);
1399
1403
  }
1400
1404
  }
1401
1405
  clearSearchText() {
@@ -1472,6 +1476,25 @@ class LocalityComponent {
1472
1476
  this.setSearchTextBasedOnArrowSelection(this.selectedIndex, this.selectedIndex + 1);
1473
1477
  }
1474
1478
  }
1479
+ checkKeyUP(event) {
1480
+ switch (event.which) {
1481
+ case 8:
1482
+ if (this.searchText.length > 0) {
1483
+ this.clearInputEventEmitter.emit('PARTIAL_CLEAR_LOCALITY');
1484
+ }
1485
+ else {
1486
+ this.clearInputEventEmitter.emit('LOCALITY');
1487
+ // this.clearInputEventEmitter.emit('STREET');
1488
+ // this.clearInputEventEmitter.emit('STREET_NUMBER');
1489
+ // this.clearInputEventEmitter.emit('BOX_NUMBER');
1490
+ // this.clearInput(true);
1491
+ }
1492
+ break;
1493
+ default:
1494
+ this.clearTypeAhead();
1495
+ break;
1496
+ }
1497
+ }
1475
1498
  checkKeyDown(event) {
1476
1499
  switch (event.which) {
1477
1500
  // down key, increment selectedIndex
@@ -1574,10 +1597,10 @@ class LocalityComponent {
1574
1597
  }
1575
1598
  }
1576
1599
  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 });
1577
- 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 } });
1600
+ 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 } });
1578
1601
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: LocalityComponent, decorators: [{
1579
1602
  type: Component,
1580
- 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: [""] }]
1603
+ 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: [""] }]
1581
1604
  }], ctorParameters: function () { return [{ type: AddressService }, { type: LocaleService }, { type: i3.TranslateService }, { type: UnicodeService }]; }, propDecorators: { localitySearchInput: [{
1582
1605
  type: ViewChild,
1583
1606
  args: ['localitySearchInput', { static: false }]
@@ -1776,6 +1799,16 @@ class StreetComponent {
1776
1799
  }
1777
1800
  return result;
1778
1801
  }
1802
+ isCrossLanguageMunicipalityMatch(suggestionMunicipality, prefillMunicipality) {
1803
+ if (!suggestionMunicipality || !prefillMunicipality) {
1804
+ return false;
1805
+ }
1806
+ const suggestionLower = suggestionMunicipality.toLowerCase();
1807
+ const prefillLower = prefillMunicipality.toLowerCase();
1808
+ if (suggestionLower === prefillLower) {
1809
+ return true;
1810
+ }
1811
+ }
1779
1812
  onClearInputEvent(event, focus) {
1780
1813
  this.clearInput(focus);
1781
1814
  }
@@ -2050,30 +2083,46 @@ class StreetComponent {
2050
2083
  if (this.showDebugMessageToConsole) {
2051
2084
  console.log('street - checking suggestion for perfect match', this.prefillData, suggestion);
2052
2085
  }
2053
- const sugAddress = suggestion.address;
2054
- // if (sugAddress.streetName === this.prefillData.parameters.streetName )
2055
- const suggestionLocality = this.transformStreetNameInLowercaseAndWithoutDiacritics(sugAddress.localityName);
2056
- const suggestionMunicipality = this.transformStreetNameInLowercaseAndWithoutDiacritics(sugAddress.municipalityName);
2057
- if (suggestionLocality === this.prefillData.prefillMunicipalityName
2058
- || suggestionMunicipality === this.prefillData.prefillMunicipalityName) {
2059
- const suggestionStreetName = this.transformStreetNameInLowercaseAndWithoutDiacritics(sugAddress.streetName);
2060
- // console.log('comparing street names', suggestionStreetName, this.prefillData.prefillStreetName);
2061
- if (suggestionStreetName === this.prefillData.prefillStreetName) {
2062
- this.prefillData.prefillStreetPerfectMatchFound = true;
2063
- this.prefillData.prefillStreetPerfectMatchSuggestion = suggestion;
2064
- this.searchText = sugAddress.streetName;
2065
- }
2066
- if (this.prefillData.prefillStreetPerfectMatchFound === true) {
2067
- if (this.showDebugMessageToConsole) {
2068
- console.log('STREET - PREFILL - Perfect match - street:', suggestion);
2069
- }
2070
- }
2071
- else {
2072
- if (this.showDebugMessageToConsole) {
2073
- console.log('STREET - PREFILL - NO Perfect match:', suggestion);
2086
+ const streetNamesAllLanguage = [];
2087
+ const languageTypes = ['address', 'french', 'dutch', 'german'];
2088
+ for (const type of languageTypes) {
2089
+ if (suggestion[type]) {
2090
+ streetNamesAllLanguage.push({
2091
+ type: type,
2092
+ streetName: suggestion[type].streetName,
2093
+ municipalityName: suggestion[type].municipalityName,
2094
+ localityName: suggestion[type].localityName
2095
+ });
2096
+ }
2097
+ }
2098
+ for (const lang of streetNamesAllLanguage) {
2099
+ console.log('----------------Language data--------------------:', lang);
2100
+ if (!lang.streetName || !lang.municipalityName) {
2101
+ continue;
2102
+ }
2103
+ const suggestionStreetName = this.transformStreetNameInLowercaseAndWithoutDiacritics(lang.streetName);
2104
+ const suggestionMunicipalityName = this.transformStreetNameInLowercaseAndWithoutDiacritics(lang.municipalityName);
2105
+ const suggestionLocalityName = lang.localityName ? this.transformStreetNameInLowercaseAndWithoutDiacritics(lang.localityName) : '';
2106
+ const municipalityMatches = suggestionMunicipalityName.startsWith(this.prefillData.prefillMunicipalityName) ||
2107
+ suggestionLocalityName.startsWith(this.prefillData.prefillMunicipalityName) ||
2108
+ this.isCrossLanguageMunicipalityMatch(suggestionMunicipalityName, this.prefillData.prefillMunicipalityName) ||
2109
+ this.isCrossLanguageMunicipalityMatch(suggestionLocalityName, this.prefillData.prefillMunicipalityName);
2110
+ console.log('Municipality matches:', municipalityMatches);
2111
+ if (municipalityMatches) {
2112
+ if (suggestionStreetName === this.prefillData.prefillStreetName) {
2113
+ this.prefillData.prefillStreetPerfectMatchFound = true;
2114
+ this.prefillData.prefillStreetPerfectMatchSuggestion = suggestion;
2115
+ this.searchText = lang.streetName;
2116
+ if (this.showDebugMessageToConsole) {
2117
+ console.log('STREET - PREFILL - Perfect match found with lang:', lang.type, suggestion);
2118
+ }
2119
+ return;
2074
2120
  }
2075
2121
  }
2076
2122
  }
2123
+ if (this.showDebugMessageToConsole) {
2124
+ console.log('STREET - PREFILL - NO Perfect match found:', suggestion);
2125
+ }
2077
2126
  }
2078
2127
  onInputChange(source) {
2079
2128
  // console.log('street onInputChange : source ', source);
@@ -2239,6 +2288,24 @@ class StreetComponent {
2239
2288
  break;
2240
2289
  }
2241
2290
  }
2291
+ checkKeyUP(event) {
2292
+ switch (event.which) {
2293
+ case 8:
2294
+ if (this.searchText.length > 0) {
2295
+ this.clearInputEventEmitter.emit('PARTIAL_CLEAR_STREET');
2296
+ }
2297
+ else {
2298
+ this.clearInputEventEmitter.emit('STREET');
2299
+ this.clearInputEventEmitter.emit('STREET_NUMBER');
2300
+ this.clearInputEventEmitter.emit('BOX_NUMBER');
2301
+ // this.clearInput(true);
2302
+ }
2303
+ break;
2304
+ default:
2305
+ this.clearTypeAhead();
2306
+ break;
2307
+ }
2308
+ }
2242
2309
  clearWidget() {
2243
2310
  this.addressIsValidated = false;
2244
2311
  this.clearSearchText();
@@ -2305,7 +2372,10 @@ class StreetComponent {
2305
2372
  this.streetSearchInput.nativeElement.focus();
2306
2373
  }
2307
2374
  if (emit) {
2375
+ // this.clearInputEventEmitter.emit('STREET');
2308
2376
  this.clearInputEventEmitter.emit(/*'STREET'*/ InputNameType.STREET);
2377
+ this.clearInputEventEmitter.emit(/*'STREET_NUMBER'*/ InputNameType.STREET_NUMBER);
2378
+ this.clearInputEventEmitter.emit(/*'BOX_NUMBER'*/ InputNameType.BOX_NUMBER);
2309
2379
  }
2310
2380
  }
2311
2381
  clearSuggestions() {
@@ -2359,10 +2429,10 @@ class StreetComponent {
2359
2429
  }
2360
2430
  }
2361
2431
  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 });
2362
- 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 } });
2432
+ 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 } });
2363
2433
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: StreetComponent, decorators: [{
2364
2434
  type: Component,
2365
- 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: [""] }]
2435
+ 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: [""] }]
2366
2436
  }], ctorParameters: function () { return [{ type: AddressService }, { type: LocaleService }, { type: i3.TranslateService }, { type: UnicodeService }]; }, propDecorators: { streetSearchInput: [{
2367
2437
  type: ViewChild,
2368
2438
  args: ['streetSearchInput', { static: false }]
@@ -3272,6 +3342,23 @@ class StreetNumberComponent {
3272
3342
  break;
3273
3343
  }
3274
3344
  }
3345
+ checkKeyUP(event) {
3346
+ switch (event.which) {
3347
+ case 8:
3348
+ if (this.searchText.length > 0) {
3349
+ this.clearInputEventEmitter.emit('PARTIAL_CLEAR_STREET_NUMBER');
3350
+ }
3351
+ else {
3352
+ this.clearInputEventEmitter.emit('STREET_NUMBER');
3353
+ // this.clearInputEventEmitter.emit('BOX_NUMBER');
3354
+ // this.onClearStreetNumberInput(true);
3355
+ }
3356
+ break;
3357
+ default:
3358
+ this.clearTypeAhead();
3359
+ break;
3360
+ }
3361
+ }
3275
3362
  clearWidget() {
3276
3363
  if (this.showDebugMessageToConsole) {
3277
3364
  console.log('street number:: clearWidget');
@@ -3344,6 +3431,7 @@ class StreetNumberComponent {
3344
3431
  // this.addressChanged.emit(null);
3345
3432
  if (emit) {
3346
3433
  this.clearInputEventEmitter.emit(/*'STREET_NUMBER'*/ InputNameType.STREET_NUMBER);
3434
+ // this.clearInputEventEmitter.emit(/*'BOX_NUMBER'*/ InputNameType.BOX_NUMBER);
3347
3435
  }
3348
3436
  }
3349
3437
  /*
@@ -3408,10 +3496,10 @@ class StreetNumberComponent {
3408
3496
  }
3409
3497
  }
3410
3498
  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 });
3411
- 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 } });
3499
+ 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 } });
3412
3500
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: StreetNumberComponent, decorators: [{
3413
3501
  type: Component,
3414
- 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: [""] }]
3502
+ 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: [""] }]
3415
3503
  }], ctorParameters: function () { return [{ type: AddressService }, { type: LocaleService }, { type: i3.TranslateService }, { type: UnicodeService }]; }, propDecorators: { streetNumberSearchInput: [{
3416
3504
  type: ViewChild,
3417
3505
  args: ['streetNumberSearchInput', { static: false }]
@@ -4241,6 +4329,21 @@ class BoxNumberComponent {
4241
4329
  break;
4242
4330
  }
4243
4331
  }
4332
+ checkKeyUP(event) {
4333
+ switch (event.which) {
4334
+ case 8:
4335
+ if (this.searchText.length > 0) {
4336
+ this.clearInputEventEmitter.emit('PARTIAL_CLEAR_BOX_NUMBER');
4337
+ }
4338
+ else {
4339
+ this.clearInputEventEmitter.emit('BOX_NUMBER');
4340
+ }
4341
+ break;
4342
+ default:
4343
+ this.clearTypeAhead();
4344
+ break;
4345
+ }
4346
+ }
4244
4347
  clearWidget() {
4245
4348
  this.addressIsValidated = false;
4246
4349
  this.clearSearchText();
@@ -4354,10 +4457,10 @@ class BoxNumberComponent {
4354
4457
  }
4355
4458
  }
4356
4459
  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 });
4357
- 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 } });
4460
+ 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 } });
4358
4461
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: BoxNumberComponent, decorators: [{
4359
4462
  type: Component,
4360
- 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: [""] }]
4463
+ 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: [""] }]
4361
4464
  }], ctorParameters: function () { return [{ type: AddressService }, { type: LocaleService }, { type: i3.TranslateService }, { type: UnicodeService }]; }, propDecorators: { boxNumberSearchInput: [{
4362
4465
  type: ViewChild,
4363
4466
  args: ['boxNumberSearchInput', { static: false }]
@@ -5125,23 +5228,76 @@ class LibAddressAutocompleteByComponentComponent {
5125
5228
  resetLocality(event) {
5126
5229
  this.postalCode = '';
5127
5230
  this.locality = '';
5231
+ const street = this.selectedAddress?.hasOwnProperty('streetName');
5232
+ const house = this.selectedAddress?.hasOwnProperty('houseNumber');
5233
+ const box = this.selectedAddress?.hasOwnProperty('boxNumber');
5128
5234
  this.quitPrefillMode();
5129
- this.onClearInputEventEmitter(InputNameType.STREET);
5235
+ if (event) {
5236
+ if (street == true) {
5237
+ this.onClearInputEventEmitter(InputNameType.STREET);
5238
+ }
5239
+ if (house == true) {
5240
+ this.onClearInputEventEmitter(InputNameType.STREET_NUMBER);
5241
+ }
5242
+ if (box == true) {
5243
+ this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
5244
+ }
5245
+ }
5246
+ if (!event) {
5247
+ if (street == true) {
5248
+ this.onClearInputEventEmitter(InputNameType.STREET);
5249
+ }
5250
+ if (house == true) {
5251
+ this.onClearInputEventEmitter(InputNameType.STREET_NUMBER);
5252
+ }
5253
+ if (box == true) {
5254
+ this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
5255
+ }
5256
+ }
5130
5257
  this.setAddress(null, 4);
5131
5258
  }
5132
5259
  resetStreet(event) {
5133
5260
  this.street = '';
5261
+ const house = this.selectedAddress?.hasOwnProperty('houseNumber');
5262
+ const box = this.selectedAddress?.hasOwnProperty('boxNumber');
5134
5263
  this.quitPrefillMode();
5135
- this.onClearInputEventEmitter(InputNameType.STREET_NUMBER);
5264
+ if (event) {
5265
+ if (house == true) {
5266
+ this.onClearInputEventEmitter(InputNameType.STREET_NUMBER);
5267
+ }
5268
+ // this.onClearInputEventEmitter(InputNameType.STREET_NUMBER);
5269
+ if (box == true) {
5270
+ this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
5271
+ }
5272
+ // this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
5273
+ }
5274
+ if (!event) {
5275
+ if (house == true) {
5276
+ this.onClearInputEventEmitter(InputNameType.STREET_NUMBER);
5277
+ }
5278
+ // this.onClearInputEventEmitter(InputNameType.STREET_NUMBER);
5279
+ if (box == true) {
5280
+ this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
5281
+ }
5282
+ // this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
5283
+ }
5136
5284
  this.autocompleteStreetNb.addressIsComplete = false;
5137
5285
  this.autocompleteStreetNb.streetName = '';
5138
5286
  this.setAddress(null, 3);
5139
5287
  }
5140
5288
  resetStreetNumber(event, resetAddress = false) {
5141
- // console.log('reset street numner!', event, resetAddress);
5289
+ // console.log('reset street numner!', event);
5290
+ const box = this.selectedAddress?.hasOwnProperty('boxNumber');
5142
5291
  this.streetNumber = '';
5143
5292
  this.quitPrefillMode();
5144
- this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
5293
+ if (event) {
5294
+ if (box == true) {
5295
+ this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
5296
+ }
5297
+ }
5298
+ if (!event && box == true) {
5299
+ this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
5300
+ }
5145
5301
  this.autocompleteBoxNb.addressIsComplete = false;
5146
5302
  this.autocompleteBoxNb.streetNumber = '';
5147
5303
  this.setAddress(null, 2);
@@ -5155,13 +5311,13 @@ class LibAddressAutocompleteByComponentComponent {
5155
5311
  // console.log('reset street numner!', event, resetAddress);
5156
5312
  this.boxNumber = '';
5157
5313
  this.quitPrefillMode();
5314
+ // this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
5158
5315
  this.autocompleteBoxNb.addressIsComplete = false;
5159
- // this.autocompleteBoxNb.boxNumber = ''
5316
+ this.autocompleteBoxNb.boxNumber = '';
5160
5317
  this.setAddress(null, 1);
5161
- if (!event) {
5162
- this.clearInputEventEmitter.emit('CLEAR_BOX_NUMBER');
5163
- }
5164
- // this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
5318
+ // if(!event){
5319
+ // this.clearInputEventEmitter.emit('CLEAR_BOX_NUMBER')
5320
+ // }
5165
5321
  // $$ 7 this.setAddress(null, 1); // $$ ?????
5166
5322
  /*
5167
5323
  if (resetAddress === true) {