@bpost/bp-address-auto-complete-by-component 1.1.23 → 1.1.25

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.
@@ -784,6 +784,9 @@ class HighlightSuggestionPipe {
784
784
  constructor(sanitizer) {
785
785
  this.sanitizer = sanitizer;
786
786
  }
787
+ escapeRegExp(text) {
788
+ return text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
789
+ }
787
790
  transform(value, args) {
788
791
  if (!args) {
789
792
  return value;
@@ -791,13 +794,12 @@ class HighlightSuggestionPipe {
791
794
  if (Array.isArray(args) && args.length > 1) {
792
795
  return this.transformForArray(value, args);
793
796
  }
794
- if (args === '.') {
795
- args = '\\.';
797
+ // Escape special regex characters
798
+ if (typeof args === 'string') {
799
+ args = this.escapeRegExp(args);
796
800
  }
797
801
  else if (Array.isArray(args) && args.length === 1) {
798
- if (args[0] === '.') {
799
- args[0] = '\\.';
800
- }
802
+ args[0] = this.escapeRegExp(args[0]);
801
803
  }
802
804
  // Match in a case insensitive manner
803
805
  const re = new RegExp(args, 'gi');
@@ -818,11 +820,12 @@ class HighlightSuggestionPipe {
818
820
  let ix = 0;
819
821
  for (const word of args) {
820
822
  ix++;
823
+ const escapedWord = this.escapeRegExp(word);
821
824
  if (ix < args.length) {
822
- query = query.concat(word + '|');
825
+ query = query.concat(escapedWord + '|');
823
826
  }
824
827
  else {
825
- query = query.concat(word);
828
+ query = query.concat(escapedWord);
826
829
  }
827
830
  }
828
831
  // console.warn('HighlightSuggestionPipe::transformForArray', value, args, query);
@@ -1752,46 +1755,52 @@ class StreetComponent {
1752
1755
  }
1753
1756
  ngOnChanges(changes) {
1754
1757
  if (changes) {
1755
- if (changes.hasOwnProperty('prefillData') && !changes.prefillData.firstChange) {
1756
- this.prefilling = true;
1757
- this.searchText = this.loadParams(changes.prefillData.currentValue);
1758
- // if(this.searchText === '')
1759
- // {
1760
- setTimeout(() => {
1758
+ if (changes.hasOwnProperty('autofillData') && changes.autofillData.currentValue !== null && changes.autofillData.currentValue !== undefined) {
1759
+ this.searchText = this.autofillData.streetName;
1760
+ this.setSelectedAddress(this.autofillData.selectedAddress);
1761
+ }
1762
+ else {
1763
+ if (changes.hasOwnProperty('prefillData') && !changes.prefillData.firstChange) {
1764
+ this.prefilling = true;
1761
1765
  this.searchText = this.loadParams(changes.prefillData.currentValue);
1762
- // console.log("setrtt time");
1763
- }, 200);
1764
- // }
1765
- if (this.searchText !== '' && this.minLevel === ADDRESSLEVEL.STREET) {
1766
- /*
1767
- this.onInputChange('prefilled');
1768
- this.streetSearchInput.nativeElement.focus();
1769
- */
1770
- /*
1771
-
1772
- this.prefilling = true;
1773
- this.collapseDropdown = true;
1774
- this.prefillMunicipalityName = this.transformMunicipalityInLowercaseAndWithoutDiacritics(this.addressParams.municipalityName);
1775
- this.onInputChange(/*'prefilled'* / // this.SOURCE_PREFILLED );
1776
- */
1777
- this.collapseDropdown = true;
1778
- this.prefillData.prefillStreetName
1779
- = this.transformStreetNameInLowercaseAndWithoutDiacritics(this.prefillData.parameters.streetName);
1780
- this.onInputChange(/*'prefilled'*/ SourceType.SOURCE_PREFILLED);
1766
+ // if(this.searchText === '')
1767
+ // {
1768
+ setTimeout(() => {
1769
+ this.searchText = this.loadParams(changes.prefillData.currentValue);
1770
+ // console.log("setrtt time");
1771
+ }, 200);
1772
+ // }
1773
+ if (this.searchText !== '' && this.minLevel === ADDRESSLEVEL.STREET) {
1774
+ /*
1775
+ this.onInputChange('prefilled');
1776
+ this.streetSearchInput.nativeElement.focus();
1777
+ */
1778
+ /*
1779
+
1780
+ this.prefilling = true;
1781
+ this.collapseDropdown = true;
1782
+ this.prefillMunicipalityName = this.transformMunicipalityInLowercaseAndWithoutDiacritics(this.addressParams.municipalityName);
1783
+ this.onInputChange(/*'prefilled'* / // this.SOURCE_PREFILLED );
1784
+ */
1785
+ this.collapseDropdown = true;
1786
+ this.prefillData.prefillStreetName
1787
+ = this.transformStreetNameInLowercaseAndWithoutDiacritics(this.prefillData.parameters.streetName);
1788
+ this.onInputChange(/*'prefilled'*/ SourceType.SOURCE_PREFILLED);
1789
+ }
1781
1790
  }
1782
- }
1783
- if (changes.hasOwnProperty('inputText') && !changes.inputText.firstChange) {
1784
- if (this.notEqualIgnoreCase(this.searchText, changes.inputText.currentValue)) {
1785
- this.clearWidget();
1786
- this.searchText = changes.inputText.currentValue;
1791
+ if (changes.hasOwnProperty('inputText') && !changes.inputText.firstChange) {
1792
+ if (this.notEqualIgnoreCase(this.searchText, changes.inputText.currentValue)) {
1793
+ this.clearWidget();
1794
+ this.searchText = changes.inputText.currentValue;
1795
+ }
1787
1796
  }
1788
- }
1789
- // Reset Street search bar on locality change/reset
1790
- if (changes.hasOwnProperty('postalCode') && !changes.postalCode.firstChange && !changes.hasOwnProperty('prefillData')) {
1791
- this.minLevel = ADDRESSLEVEL.STREET;
1792
- if (changes.postalCode.currentValue === '') {
1793
- this.clearWidget();
1794
- this.valueChanged();
1797
+ // Reset Street search bar on locality change/reset
1798
+ if (changes.hasOwnProperty('postalCode') && !changes.postalCode.firstChange && !changes.hasOwnProperty('prefillData')) {
1799
+ this.minLevel = ADDRESSLEVEL.STREET;
1800
+ if (changes.postalCode.currentValue === '') {
1801
+ this.clearWidget();
1802
+ this.valueChanged();
1803
+ }
1795
1804
  }
1796
1805
  }
1797
1806
  }
@@ -2436,7 +2445,7 @@ class StreetComponent {
2436
2445
  }
2437
2446
  }
2438
2447
  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 });
2439
- 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 } });
2448
+ 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", autofillData: "autofillData", 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 } });
2440
2449
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: StreetComponent, decorators: [{
2441
2450
  type: Component,
2442
2451
  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: [""] }]
@@ -2460,6 +2469,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImpor
2460
2469
  type: Input
2461
2470
  }], prefillData: [{
2462
2471
  type: Input
2472
+ }], autofillData: [{
2473
+ type: Input
2463
2474
  }], showDebugMessageToConsole: [{
2464
2475
  type: Input
2465
2476
  }], postalCode: [{
@@ -2602,47 +2613,54 @@ class StreetNumberComponent {
2602
2613
  }
2603
2614
  ngOnChanges(changes) {
2604
2615
  if (changes) {
2605
- if (changes.hasOwnProperty('streetName')
2606
- && !changes.streetName.firstChange
2607
- && !changes.hasOwnProperty('prefillData') && !this.prefilling) {
2608
- this.minLevel = ADDRESSLEVEL.STREET_NUMBER;
2609
- // this.addressIsComplete = false;
2610
- if (this.showDebugMessageToConsole) {
2611
- console.warn('street name - ngOnchanges - streetName changes detection');
2612
- }
2613
- if (changes.streetName.currentValue === '') {
2614
- this.clearWidget();
2615
- this.valueChanged();
2616
- }
2616
+ if (changes.hasOwnProperty('autofillData') && changes.autofillData.currentValue !== null && changes.autofillData.currentValue !== undefined) {
2617
+ this.searchText = this.autofillData.streetNumber;
2618
+ this.addressIsComplete = this.autofillData.isCompleteStreetNumber;
2619
+ this.setSelectedAddress(this.autofillData.selectedAddress);
2617
2620
  }
2618
- if (changes.hasOwnProperty('inputText') && !changes.inputText.firstChange && !this.prefilling) {
2619
- if (this.showDebugMessageToConsole) {
2620
- console.warn('street number - ngOnchanges - inputText changes detection', this.searchText, changes.inputText.currentValue);
2621
+ else {
2622
+ if (changes.hasOwnProperty('streetName')
2623
+ && !changes.streetName.firstChange
2624
+ && !changes.hasOwnProperty('prefillData') && !this.prefilling) {
2625
+ this.minLevel = ADDRESSLEVEL.STREET_NUMBER;
2626
+ // this.addressIsComplete = false;
2627
+ if (this.showDebugMessageToConsole) {
2628
+ console.warn('street name - ngOnchanges - streetName changes detection');
2629
+ }
2630
+ if (changes.streetName.currentValue === '') {
2631
+ this.clearWidget();
2632
+ this.valueChanged();
2633
+ }
2621
2634
  }
2622
- if (this.notEqualIgnoreCase(this.searchText, changes.inputText.currentValue)) {
2635
+ if (changes.hasOwnProperty('inputText') && !changes.inputText.firstChange && !this.prefilling) {
2623
2636
  if (this.showDebugMessageToConsole) {
2624
- console.warn('street number - ngOnchanges - inputText changes detection -> calling clearWidget() !');
2637
+ console.warn('street number - ngOnchanges - inputText changes detection', this.searchText, changes.inputText.currentValue);
2638
+ }
2639
+ if (this.notEqualIgnoreCase(this.searchText, changes.inputText.currentValue)) {
2640
+ if (this.showDebugMessageToConsole) {
2641
+ console.warn('street number - ngOnchanges - inputText changes detection -> calling clearWidget() !');
2642
+ }
2643
+ this.clearWidget();
2644
+ this.searchText = changes.inputText.currentValue;
2625
2645
  }
2626
- this.clearWidget();
2627
- this.searchText = changes.inputText.currentValue;
2628
2646
  }
2629
- }
2630
- if (changes.hasOwnProperty('prefillData') && !changes.prefillData.firstChange) {
2631
- this.prefilling = true;
2632
- this.addressIsComplete = false;
2633
- // console.log('streetNumber::ngOnChanges', this.addressIsComplete);
2634
- this.searchText = this.loadParams(changes.prefillData.currentValue);
2635
- if (this.searchText !== '' && this.minLevel === ADDRESSLEVEL.STREET_NUMBER) {
2636
- /*
2637
- this.onInputChange(/*'prefilled'* / SourceType.SOURCE_PREFILLED);
2638
- this.streetNumberSearchInput.nativeElement.focus();
2639
- */
2640
- this.collapseDropdown = true;
2641
- this.prefillData.prefillStreetNumber
2642
- = this.transformStreetNumberInLowercaseAndWithoutDiacritics(this.prefillData.parameters.streetNumber);
2643
- this.onInputChange(/*'prefilled'*/ SourceType.SOURCE_PREFILLED);
2647
+ if (changes.hasOwnProperty('prefillData') && !changes.prefillData.firstChange) {
2648
+ this.prefilling = true;
2649
+ this.addressIsComplete = false;
2650
+ // console.log('streetNumber::ngOnChanges', this.addressIsComplete);
2651
+ this.searchText = this.loadParams(changes.prefillData.currentValue);
2652
+ if (this.searchText !== '' && this.minLevel === ADDRESSLEVEL.STREET_NUMBER) {
2653
+ /*
2654
+ this.onInputChange(/*'prefilled'* / SourceType.SOURCE_PREFILLED);
2655
+ this.streetNumberSearchInput.nativeElement.focus();
2656
+ */
2657
+ this.collapseDropdown = true;
2658
+ this.prefillData.prefillStreetNumber
2659
+ = this.transformStreetNumberInLowercaseAndWithoutDiacritics(this.prefillData.parameters.streetNumber);
2660
+ this.onInputChange(/*'prefilled'*/ SourceType.SOURCE_PREFILLED);
2661
+ }
2662
+ // console.log('streetNumber::ngOnChanges -- after calculations', this.addressIsComplete);
2644
2663
  }
2645
- // console.log('streetNumber::ngOnChanges -- after calculations', this.addressIsComplete);
2646
2664
  }
2647
2665
  }
2648
2666
  }
@@ -3003,9 +3021,9 @@ class StreetNumberComponent {
3003
3021
  }
3004
3022
  checkForPerfectMatch(suggestion) {
3005
3023
  if (!this.addressIsComplete) {
3006
- if (this.showDebugMessageToConsole) {
3007
- console.log('streetNumber - checking suggestion for perfect match', suggestion, this.searchText);
3008
- }
3024
+ // if (this.showDebugMessageToConsole) {
3025
+ console.log('streetNumber - checking suggestion for perfect match', suggestion, this.searchText);
3026
+ // }
3009
3027
  const sugAddress = suggestion.address;
3010
3028
  const suggestionStreetNumber = this.transformStreetNumberInLowercaseAndWithoutDiacritics('' + sugAddress.houseNumber);
3011
3029
  if (suggestionStreetNumber === ('' + this.searchText)) {
@@ -3014,9 +3032,9 @@ class StreetNumberComponent {
3014
3032
  this.clickSuggestion(null, sugAddress);
3015
3033
  this.addressIsComplete = true;
3016
3034
  // console.log('streetNumber::prefillCheckForPerfectMatch', this.addressIsComplete);
3017
- if (this.showDebugMessageToConsole && this.addressIsComplete === true) {
3018
- console.log('ADDRESS COMPLETE ON STREET NUMBER !');
3019
- }
3035
+ // if (this.showDebugMessageToConsole && this.addressIsComplete === true) {
3036
+ console.log('ADDRESS COMPLETE ON STREET NUMBER !');
3037
+ // }
3020
3038
  return true;
3021
3039
  }
3022
3040
  else {
@@ -3051,9 +3069,9 @@ class StreetNumberComponent {
3051
3069
  this.clickSuggestion(null, sugAddress);
3052
3070
  this.addressIsComplete = true;
3053
3071
  // console.log('streetNumber::prefillCheckForPerfectMatch', this.addressIsComplete);
3054
- if (this.showDebugMessageToConsole && this.addressIsComplete === true) {
3055
- console.log('ADDRESS COMPLETE ON STREET NUMBER !');
3056
- }
3072
+ // if (this.showDebugMessageToConsole && this.addressIsComplete === true) {
3073
+ console.log('ADDRESS COMPLETE ON STREET NUMBER !');
3074
+ // }
3057
3075
  }
3058
3076
  }
3059
3077
  }
@@ -3219,7 +3237,7 @@ class StreetNumberComponent {
3219
3237
  this.clearTypeAhead();
3220
3238
  this.resetArrowSelectedIndex();
3221
3239
  if (suggestion.string) {
3222
- this.setSearchText(suggestion.string);
3240
+ this.setSearchText(suggestion.searchBarString);
3223
3241
  }
3224
3242
  this.collapseDropdown = true;
3225
3243
  const notInList = suggestion['not-in-list'];
@@ -3230,7 +3248,7 @@ class StreetNumberComponent {
3230
3248
  console.log('streetNumber::clickSuggestion - NOT-IN-LIST', event, suggestion);
3231
3249
  }
3232
3250
  }
3233
- if (suggestion.hasOwnProperty('isComplete') && suggestion.isComplete === true && !isNotInList) {
3251
+ if (suggestion.hasOwnProperty('isComplete') && suggestion.isComplete === true && !isNotInList && !suggestion.hasOwnProperty('boxNumber')) {
3234
3252
  this.addressIsComplete = true;
3235
3253
  // this.notifyAddressIsValidated();
3236
3254
  }
@@ -3262,7 +3280,7 @@ class StreetNumberComponent {
3262
3280
  // console.log('street number - emit suggestion', suggestion);
3263
3281
  const notInList = suggestion['not-in-list'];
3264
3282
  const isNotInList = notInList !== null && notInList !== undefined && notInList === true;
3265
- this.addressIsComplete = (suggestion.hasOwnProperty('isComplete') && suggestion.isComplete === true && !isNotInList) ? true : false;
3283
+ this.addressIsComplete = (suggestion.hasOwnProperty('isComplete') && suggestion.isComplete === true && !isNotInList && !suggestion.hasOwnProperty('boxNumber')) ? true : false;
3266
3284
  this.addressChanged.emit(suggestion);
3267
3285
  }
3268
3286
  /*
@@ -3430,7 +3448,7 @@ class StreetNumberComponent {
3430
3448
  return this.searchText && this.searchText.length > 0;
3431
3449
  }
3432
3450
  onClearStreetNumberInput(focus, emit = true) {
3433
- // console.warn('street number :: clearInput');
3451
+ console.warn('street number :: clearInput');
3434
3452
  this.clearWidget();
3435
3453
  this.resetArrowSelectedIndex();
3436
3454
  this.previousIndex = -1;
@@ -3509,7 +3527,7 @@ class StreetNumberComponent {
3509
3527
  }
3510
3528
  }
3511
3529
  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 });
3512
- 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", nis9InResponse: "nis9InResponse", businessNameInResponse: "businessNameInResponse", 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 } });
3530
+ StreetNumberComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: StreetNumberComponent, selector: "bp-street-number", inputs: { prefillData: "prefillData", autofillData: "autofillData", 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", nis9InResponse: "nis9InResponse", businessNameInResponse: "businessNameInResponse", 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 } });
3513
3531
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: StreetNumberComponent, decorators: [{
3514
3532
  type: Component,
3515
3533
  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: [""] }]
@@ -3521,6 +3539,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImpor
3521
3539
  args: ['streetNumberList', { static: false }]
3522
3540
  }], prefillData: [{
3523
3541
  type: Input
3542
+ }], autofillData: [{
3543
+ type: Input
3524
3544
  }], showDebugMessageToConsole: [{
3525
3545
  type: Input
3526
3546
  }], labelResourceKey: [{
@@ -3669,37 +3689,44 @@ class BoxNumberComponent {
3669
3689
  }
3670
3690
  ngOnChanges(changes) {
3671
3691
  if (changes) {
3672
- if (changes.hasOwnProperty('prefillData') && !changes.prefillData.firstChange) {
3673
- this.prefilling = true;
3674
- this.searchText = this.loadParams(changes.prefillData.currentValue);
3675
- if (this.searchText !== '' && this.minLevel === ADDRESSLEVEL.BOX_NUMBER) {
3676
- // this.onInputChange('prefilled');
3677
- // this.boxNumberSearchInput.nativeElement.focus();
3678
- this.collapseDropdown = true;
3679
- this.prefillData.prefillBoxNumber
3680
- = this.transformBoxNumberInLowercaseAndWithoutDiacritics(this.prefillData.parameters.boxNumber);
3681
- this.onInputChange(/*'prefilled'*/ SourceType.SOURCE_PREFILLED);
3682
- }
3692
+ if (changes.hasOwnProperty('autofillData') && changes.autofillData.currentValue !== null && changes.autofillData.currentValue !== undefined) {
3693
+ this.searchText = this.autofillData.boxNumber;
3694
+ this.addressIsValidated = this.autofillData.isCompleteBoxNumber;
3695
+ this.setSelectedAddress(this.autofillData.selectedAddress);
3683
3696
  }
3684
- if (changes.hasOwnProperty('streetNumber') && !changes.streetNumber.firstChange && !changes.hasOwnProperty('prefillData')) {
3685
- this.minLevel = ADDRESSLEVEL.BOX_NUMBER;
3686
- this.clearWidget();
3687
- if (this.suggestionLevel !== SuggestionLevelType.None) {
3688
- this.valueChanged();
3697
+ else {
3698
+ if (changes.hasOwnProperty('prefillData') && !changes.prefillData.firstChange) {
3699
+ this.prefilling = true;
3700
+ this.searchText = this.loadParams(changes.prefillData.currentValue);
3701
+ if (this.searchText !== '' && this.minLevel === ADDRESSLEVEL.BOX_NUMBER) {
3702
+ // this.onInputChange('prefilled');
3703
+ // this.boxNumberSearchInput.nativeElement.focus();
3704
+ this.collapseDropdown = true;
3705
+ this.prefillData.prefillBoxNumber
3706
+ = this.transformBoxNumberInLowercaseAndWithoutDiacritics(this.prefillData.parameters.boxNumber);
3707
+ this.onInputChange(/*'prefilled'*/ SourceType.SOURCE_PREFILLED);
3708
+ }
3689
3709
  }
3710
+ if (changes.hasOwnProperty('streetNumber') && !changes.streetNumber.firstChange && !changes.hasOwnProperty('prefillData')) {
3711
+ this.minLevel = ADDRESSLEVEL.BOX_NUMBER;
3712
+ this.clearWidget();
3713
+ if (this.suggestionLevel !== SuggestionLevelType.None) {
3714
+ this.valueChanged();
3715
+ }
3716
+ }
3717
+ /*
3718
+ if (changes.hasOwnProperty('inputLang') / *&& !changes.addressParams.firstChange* /) {
3719
+ const lang = changes.inputLang.currentValue;
3720
+ console.log('on changes - inputLang', lang);
3721
+ if (changes.inputLang.currentValue !== undefined) {
3722
+ this.translateService.setDefaultLang(lang);
3723
+ this.translateService.use(lang);
3724
+ this.localeService.changeLang(lang);
3725
+ this.onChangedLanguage();
3726
+ }
3727
+ }
3728
+ */
3690
3729
  }
3691
- /*
3692
- if (changes.hasOwnProperty('inputLang') / *&& !changes.addressParams.firstChange* /) {
3693
- const lang = changes.inputLang.currentValue;
3694
- console.log('on changes - inputLang', lang);
3695
- if (changes.inputLang.currentValue !== undefined) {
3696
- this.translateService.setDefaultLang(lang);
3697
- this.translateService.use(lang);
3698
- this.localeService.changeLang(lang);
3699
- this.onChangedLanguage();
3700
- }
3701
- }
3702
- */
3703
3730
  }
3704
3731
  }
3705
3732
  transformBoxNumberInLowercaseAndWithoutDiacritics(boxNumber) {
@@ -4217,7 +4244,7 @@ class BoxNumberComponent {
4217
4244
  this.clearTypeAhead();
4218
4245
  this.resetArrowSelectedIndex();
4219
4246
  if (suggestion.string) {
4220
- this.setSearchText(suggestion.string);
4247
+ this.setSearchText(suggestion.searchBarString);
4221
4248
  }
4222
4249
  this.collapseDropdown = true;
4223
4250
  // if (suggestion.hasOwnProperty('isComplete')) {
@@ -4479,7 +4506,7 @@ class BoxNumberComponent {
4479
4506
  }
4480
4507
  }
4481
4508
  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 });
4482
- 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", nis9InResponse: "nis9InResponse", businessNameInResponse: "businessNameInResponse" }, 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 } });
4509
+ BoxNumberComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: BoxNumberComponent, selector: "bp-box-number", inputs: { prefillData: "prefillData", autofillData: "autofillData", 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", nis9InResponse: "nis9InResponse", businessNameInResponse: "businessNameInResponse" }, 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 } });
4483
4510
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: BoxNumberComponent, decorators: [{
4484
4511
  type: Component,
4485
4512
  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: [""] }]
@@ -4491,6 +4518,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImpor
4491
4518
  args: ['boxNumberList', { static: false }]
4492
4519
  }], prefillData: [{
4493
4520
  type: Input
4521
+ }], autofillData: [{
4522
+ type: Input
4494
4523
  }], showDebugMessageToConsole: [{
4495
4524
  type: Input
4496
4525
  }], labelResourceKey: [{
@@ -4583,6 +4612,24 @@ class PrefillData // extends PrefilledParameters
4583
4612
 
4584
4613
  const LIB_VERSION = "1.1.5";
4585
4614
 
4615
+ class AutofillData {
4616
+ constructor(init) {
4617
+ Object.assign(this, init);
4618
+ if (this.boxNumber && this.boxNumber !== '') {
4619
+ this.minLevel = ADDRESSLEVEL.BOX_NUMBER;
4620
+ }
4621
+ else if (this.streetNumber && this.streetNumber !== '') {
4622
+ this.minLevel = ADDRESSLEVEL.STREET_NUMBER;
4623
+ }
4624
+ else if (this.streetName && this.streetName !== '') {
4625
+ this.minLevel = ADDRESSLEVEL.STREET;
4626
+ }
4627
+ else {
4628
+ this.minLevel = ADDRESSLEVEL.LOCALITY;
4629
+ }
4630
+ }
4631
+ }
4632
+
4586
4633
  class LibAddressAutocompleteByComponentComponent {
4587
4634
  constructor(httpService) {
4588
4635
  this.httpService = httpService;
@@ -4992,8 +5039,57 @@ class LibAddressAutocompleteByComponentComponent {
4992
5039
  if (this.showDebugMessageToConsole) {
4993
5040
  console.log('notifyAddressComplete', this.selectedAddress, 'nis9InResponse:' + this.nis9InResponse, typeof this.nis9InResponse);
4994
5041
  }
4995
- if (this.selectedAddress && this.selectedAddress.businessName) {
4996
- this.selectedAddress.searchBarString += ' (' + this.selectedAddress.businessName + ')';
5042
+ if (this.selectedAddress && !this.autocompleteLocality.prefilling) {
5043
+ let isCompleteStreetNumber = false;
5044
+ let isCompleteBoxNumber = false;
5045
+ if (this.selectedAddress.hasOwnProperty('isComplete') && this.selectedAddress.isComplete) {
5046
+ if (this.selectedAddress.boxNumber) {
5047
+ isCompleteBoxNumber = true;
5048
+ }
5049
+ else {
5050
+ isCompleteStreetNumber = true;
5051
+ }
5052
+ }
5053
+ this.autofillData = new AutofillData({
5054
+ streetName: this.selectedAddress.streetName ? this.selectedAddress.streetName : '',
5055
+ streetNumber: this.selectedAddress.houseNumber ? this.selectedAddress.houseNumber : '',
5056
+ boxNumber: this.selectedAddress.boxNumber ? this.selectedAddress.boxNumber : '',
5057
+ postalCode: this.selectedAddress.postalCode ? this.selectedAddress.postalCode : '',
5058
+ municipalityName: this.selectedAddress.municipalityName ? this.selectedAddress.municipalityName : '',
5059
+ isCompleteStreetNumber: isCompleteStreetNumber,
5060
+ isCompleteBoxNumber: isCompleteBoxNumber,
5061
+ selectedAddress: this.selectedAddress
5062
+ });
5063
+ if (this.minLevel == ADDRESSLEVEL.LOCALITY) {
5064
+ if (this.selectedAddress.streetName) {
5065
+ this.minLevel = ADDRESSLEVEL.STREET;
5066
+ this.streetNameAutofillData = this.autofillData;
5067
+ }
5068
+ if (this.selectedAddress.houseNumber) {
5069
+ this.minLevel = ADDRESSLEVEL.STREET_NUMBER;
5070
+ this.streetNumberAutofillData = this.autofillData;
5071
+ }
5072
+ if (this.selectedAddress.boxNumber) {
5073
+ this.minLevel = ADDRESSLEVEL.BOX_NUMBER;
5074
+ this.boxNumberAutofillData = this.autofillData;
5075
+ }
5076
+ }
5077
+ if (this.minLevel == ADDRESSLEVEL.STREET) {
5078
+ if (this.selectedAddress.houseNumber) {
5079
+ this.minLevel = ADDRESSLEVEL.STREET_NUMBER;
5080
+ this.streetNumberAutofillData = this.autofillData;
5081
+ }
5082
+ if (this.selectedAddress.boxNumber) {
5083
+ this.minLevel = ADDRESSLEVEL.BOX_NUMBER;
5084
+ this.boxNumberAutofillData = this.autofillData;
5085
+ }
5086
+ }
5087
+ if (this.minLevel == ADDRESSLEVEL.STREET_NUMBER) {
5088
+ if (this.selectedAddress.boxNumber) {
5089
+ this.minLevel = ADDRESSLEVEL.BOX_NUMBER;
5090
+ this.boxNumberAutofillData = this.autofillData;
5091
+ }
5092
+ }
4997
5093
  }
4998
5094
  this.addressCompleteEventEmitter.emit(this.selectedAddress);
4999
5095
  this.emittedAddress = this.selectedAddress;
@@ -5117,7 +5213,7 @@ class LibAddressAutocompleteByComponentComponent {
5117
5213
  = nextAddress !== null && nextAddress.hasOwnProperty('not-in-list') && nextAddress['not-in-list'] === true
5118
5214
  ? true : false;
5119
5215
  */
5120
- const addressIsComplete = nextAddress !== undefined && nextAddress !== null
5216
+ const addressIsComplete = nextAddress !== undefined && nextAddress !== null && !nextAddress.hasOwnProperty('boxNumber')
5121
5217
  && nextAddress.hasOwnProperty('isComplete') && nextAddress.isComplete === true ? true : false;
5122
5218
  this.autocompleteStreetNb.addressIsComplete = addressIsComplete;
5123
5219
  }
@@ -5215,25 +5311,35 @@ class LibAddressAutocompleteByComponentComponent {
5215
5311
  const box = (_c = this.selectedAddress) === null || _c === void 0 ? void 0 : _c.hasOwnProperty('boxNumber');
5216
5312
  this.quitPrefillMode();
5217
5313
  if (event) {
5218
- if (street == true) {
5219
- this.onClearInputEventEmitter(InputNameType.STREET);
5314
+ if (street == true || this.autocompleteStreet.searchText.length > 0) {
5315
+ this.clearInputEventEmitter.emit(InputNameType.STREET);
5316
+ this.autocompleteStreet.searchText = '';
5220
5317
  }
5221
- if (house == true) {
5222
- this.onClearInputEventEmitter(InputNameType.STREET_NUMBER);
5318
+ if (house == true || this.autocompleteStreetNb.searchText.length > 0) {
5319
+ this.clearInputEventEmitter.emit(InputNameType.STREET_NUMBER);
5320
+ this.autocompleteStreetNb.streetName = '';
5321
+ this.autocompleteStreetNb.searchText = '';
5223
5322
  }
5224
- if (box == true) {
5323
+ if (box == true || this.autocompleteBoxNb.searchText.length > 0) {
5225
5324
  this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
5325
+ this.autocompleteBoxNb.searchText = '';
5326
+ this.autocompleteBoxNb.streetNumber = '';
5226
5327
  }
5227
5328
  }
5228
5329
  if (!event) {
5229
- if (street == true) {
5230
- this.onClearInputEventEmitter(InputNameType.STREET);
5330
+ if (street == true || this.autocompleteStreet.searchText.length > 0) {
5331
+ this.clearInputEventEmitter.emit(InputNameType.STREET);
5332
+ this.autocompleteStreet.searchText = '';
5231
5333
  }
5232
- if (house == true) {
5233
- this.onClearInputEventEmitter(InputNameType.STREET_NUMBER);
5334
+ if (house == true || this.autocompleteStreetNb.searchText.length > 0) {
5335
+ this.clearInputEventEmitter.emit(InputNameType.STREET_NUMBER);
5336
+ this.autocompleteStreetNb.streetName = '';
5337
+ this.autocompleteStreetNb.searchText = '';
5234
5338
  }
5235
- if (box == true) {
5339
+ if (box == true || this.autocompleteBoxNb.searchText.length > 0) {
5236
5340
  this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
5341
+ this.autocompleteBoxNb.searchText = '';
5342
+ this.autocompleteBoxNb.streetNumber = '';
5237
5343
  }
5238
5344
  }
5239
5345
  this.setAddress(null, 4);
@@ -5245,24 +5351,28 @@ class LibAddressAutocompleteByComponentComponent {
5245
5351
  const box = (_b = this.selectedAddress) === null || _b === void 0 ? void 0 : _b.hasOwnProperty('boxNumber');
5246
5352
  this.quitPrefillMode();
5247
5353
  if (event) {
5248
- if (house == true) {
5249
- this.onClearInputEventEmitter(InputNameType.STREET_NUMBER);
5354
+ if (house == true || this.autocompleteStreetNb.searchText.length > 0) {
5355
+ this.clearInputEventEmitter.emit(InputNameType.STREET_NUMBER);
5356
+ this.autocompleteStreetNb.searchText = '';
5357
+ this.autocompleteStreetNb.searchText = '';
5250
5358
  }
5251
- // this.onClearInputEventEmitter(InputNameType.STREET_NUMBER);
5252
- if (box == true) {
5359
+ if (box == true || this.autocompleteBoxNb.searchText.length > 0) {
5253
5360
  this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
5361
+ this.autocompleteBoxNb.searchText = '';
5362
+ this.autocompleteBoxNb.streetNumber = '';
5254
5363
  }
5255
- // this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
5256
5364
  }
5257
5365
  if (!event) {
5258
- if (house == true) {
5259
- this.onClearInputEventEmitter(InputNameType.STREET_NUMBER);
5366
+ if (house == true || this.autocompleteStreetNb.searchText.length > 0) {
5367
+ this.clearInputEventEmitter.emit(InputNameType.STREET_NUMBER);
5368
+ this.autocompleteStreetNb.searchText = '';
5369
+ this.autocompleteStreetNb.searchText = '';
5260
5370
  }
5261
- // this.onClearInputEventEmitter(InputNameType.STREET_NUMBER);
5262
- if (box == true) {
5371
+ if (box == true || this.autocompleteBoxNb.searchText.length > 0) {
5263
5372
  this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
5373
+ this.autocompleteBoxNb.searchText = '';
5374
+ this.autocompleteBoxNb.streetNumber = '';
5264
5375
  }
5265
- // this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
5266
5376
  }
5267
5377
  this.autocompleteStreetNb.addressIsComplete = false;
5268
5378
  this.autocompleteStreetNb.streetName = '';
@@ -5274,13 +5384,13 @@ class LibAddressAutocompleteByComponentComponent {
5274
5384
  const box = (_a = this.selectedAddress) === null || _a === void 0 ? void 0 : _a.hasOwnProperty('boxNumber');
5275
5385
  this.streetNumber = '';
5276
5386
  this.quitPrefillMode();
5277
- if (event) {
5278
- if (box == true) {
5279
- this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
5280
- }
5387
+ if (event && (box == true || this.autocompleteBoxNb.searchText.length > 0)) {
5388
+ this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
5389
+ this.autocompleteBoxNb.searchText = '';
5281
5390
  }
5282
- if (!event && box == true) {
5391
+ if (!event && (box == true || this.autocompleteBoxNb.searchText.length > 0)) {
5283
5392
  this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
5393
+ this.autocompleteBoxNb.searchText = '';
5284
5394
  }
5285
5395
  this.autocompleteBoxNb.addressIsComplete = false;
5286
5396
  this.autocompleteBoxNb.streetNumber = '';
@@ -5429,7 +5539,7 @@ class LibAddressAutocompleteByComponentComponent {
5429
5539
  this.updateStreetNumber(address); // $$
5430
5540
  this.streetAddress = address;
5431
5541
  this.streetNumberAddress = address;
5432
- if (address.hasOwnProperty('isComplete') && address.isComplete === true) {
5542
+ if (address.hasOwnProperty('isComplete') && address.isComplete === true && !address.hasOwnProperty('boxNumber')) {
5433
5543
  this.autocompleteStreetNb.addressIsComplete = true;
5434
5544
  if (addressIsNotInList) {
5435
5545
  this.autocompleteBoxNb.streetNumber = address.houseNumber;
@@ -5954,10 +6064,10 @@ class LibAddressAutocompleteByComponentComponent {
5954
6064
  }
5955
6065
  }
5956
6066
  LibAddressAutocompleteByComponentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: LibAddressAutocompleteByComponentComponent, deps: [{ token: HttpService }], target: i0.ɵɵFactoryTarget.Component });
5957
- LibAddressAutocompleteByComponentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: LibAddressAutocompleteByComponentComponent, selector: "bp-lib-address-autocomplete-by-component", inputs: { inputLang: "inputLang", clearInput: "clearInput", validationMessageOption: "validationMessageOption", defaultLang: "defaultLang", showDebugMessageToConsole: "showDebugMessageToConsole", minLevel: "minLevel", notInListAllowed: "notInListAllowed", addressParams: "addressParams", messageOption: "messageOption", localityUrl: "localityUrl", maxSuggestionLocality: "maxSuggestionLocality", visibleSuggestionLocalityCount: "visibleSuggestionLocalityCount", sortCriteriaLocality: "sortCriteriaLocality", streetUrl: "streetUrl", maxSuggestionStreet: "maxSuggestionStreet", visibleSuggestionStreetCount: "visibleSuggestionStreetCount", sortCriteriaStreet: "sortCriteriaStreet", streetNumberUrl: "streetNumberUrl", maxSuggestionStreetNb: "maxSuggestionStreetNb", visibleSuggestionStreetNbCount: "visibleSuggestionStreetNbCount", sortCriteriaStreetNb: "sortCriteriaStreetNb", boxNumberUrl: "boxNumberUrl", maxSuggestionBoxNb: "maxSuggestionBoxNb", visibleSuggestionBoxNbCount: "visibleSuggestionBoxNbCount", sortCriteriaBoxNb: "sortCriteriaBoxNb", allowNoValidation: "allowNoValidation", validatedByBackend: "validatedByBackend", numberOfExceptions: "numberOfExceptions", suggestionLevel: "suggestionLevel", apiKey: "apiKey", isReadonly: "isReadonly", nis9InResponse: "nis9InResponse", businessNameInResponse: "businessNameInResponse" }, outputs: { addressCompleteEventEmitter: "addressCompleteEventEmitter", validationMessageEventEmitter: "validationMessageEventEmitter", clearInputEventEmitter: "clearInputEventEmitter", validatedByBackendEventEmitter: "validatedByBackendEventEmitter", numberOfExceptionsEventEmitter: "numberOfExceptionsEventEmitter" }, viewQueries: [{ propertyName: "autocompleteLocality", first: true, predicate: LocalityComponent, descendants: true }, { propertyName: "autocompleteStreet", first: true, predicate: StreetComponent, descendants: true }, { propertyName: "autocompleteStreetNb", first: true, predicate: StreetNumberComponent, descendants: true }, { propertyName: "autocompleteBoxNb", first: true, predicate: BoxNumberComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "\r\n<div class=\"aacwidget-address-container\">\r\n\r\n <div class=\"bpaac-dropdown-validation\" *ngIf=\"validationMessageOptionType === 'SHOW' \">\r\n <div class=\"bpaac-validated-icon\" *ngIf=\"selectedAddress && validationMessage!==null && validationMessage.messageType!==null\"></div>\r\n <!-- {{ validationMessage | translate }} -->\r\n {{ validationMessage.translatedMessage }}\r\n </div>\r\n\r\n <!-- bp-aacwidget-autocomplete-locality -->\r\n <bp-locality class=\"aacwidget-address-locality\" *ngIf=\"isComponentReady\"\r\n [isReadonly]=\"isReadonly\"\r\n [showDebugMessageToConsole]=\"showDebugMessageToConsole\"\r\n [baseUrl]=\"usedLocalityUrl\"\r\n [prefillData]=\"localityPrefillData\"\r\n [labelResourceKey]=\"'common.label.postalCode'\"\r\n [inputText]=\"postalCodeLocality\"\r\n [inputLang]=\"selectedLanguage\"\r\n [messageOption]=\"messageOption\"\r\n [sortCriteria]=\"sortCriteriaLocality\"\r\n [maxSuggesionCount]=\"maxSuggestionLocality\" \r\n [visibleSuggestionCount]=\"visibleSuggestionLocalityCount\"\r\n [allowNoValidation]=\"allowNoValidation\"\r\n [validatedByBackend]=\"validatedByBackend\"\r\n [numberOfExceptions]=\"numberOfExceptions\"\r\n (addressChanged)=\"setAddress($event, 4)\"\r\n (messageChanged)=\"setValidationMessage($event)\"\r\n (focusEvent)=\"changeMinLevel($event)\" \r\n (textChangeEvent)=\"resetLocality($event)\"\r\n (clearInputEventEmitter)=\"onClearInputEventEmitter($event)\"\r\n (prefillEventEmitter)=\"onLocalityPrefillEvent($event)\"\r\n (numberOfExceptionsEmitter)=\"setNumberOfExceptions($event)\"></bp-locality>\r\n\r\n <bp-street class=\"aacwidget-address-street\"\r\n [isReadonly]=\"isReadonly\"\r\n [showDebugMessageToConsole]=\"showDebugMessageToConsole\"\r\n [baseUrl]=\"usedStreetUrl\"\r\n [prefillData]=\"streetPrefillData\"\r\n [labelResourceKey]=\"'common.label.streetName'\"\r\n [inputText]=\"streetNameInput\"\r\n [inputLang]=\"selectedLanguage\"\r\n [messageOption]=\"messageOption\"\r\n [postalCode]=\"postalCode\"\r\n [locality]=\"locality\"\r\n [sortCriteria]=\"sortCriteriaStreet\" \r\n [maxSuggesionCount]=\"maxSuggestionStreet\"\r\n [visibleSuggesionCount]=\"visibleSuggestionStreetCount\"\r\n [allowNoValidation]=\"allowNoValidation\"\r\n [validatedByBackend]=\"validatedByBackend\"\r\n [numberOfExceptions]=\"numberOfExceptions\"\r\n (addressChanged)=\"setAddress($event, 3)\"\r\n (messageChanged)=\"setValidationMessage($event)\"\r\n (focusEvent)=\"changeMinLevel($event)\"\r\n (textChangeEvent)=\"resetStreet($event)\"\r\n (clearInputEventEmitter)=\"onClearInputEventEmitter($event)\"\r\n (prefillEventEmitter)=\"onStreetPrefillEvent($event)\"\r\n (numberOfExceptionsEmitter)=\"setNumberOfExceptions($event)\"></bp-street>\r\n\r\n <bp-street-number class=\"aacwidget-address-streetnumber\"\r\n [isReadonly]=\"isReadonly\"\r\n [showDebugMessageToConsole]=\"showDebugMessageToConsole\"\r\n [baseUrl]=\"usedStreetNumberUrl\"\r\n [selectedAddress]=\"streetAddress\"\r\n [prefillData]=\"streetNumberPrefillData\"\r\n [labelResourceKey]=\"'common.label.streetNumber'\"\r\n [inputText]=\"streetNumberInput\"\r\n [inputLang]=\"selectedLanguage\"\r\n [messageOption]=\"messageOption\"\r\n [postalCode]=\"postalCode\" \r\n [locality]=\"locality\" \r\n [streetName]=\"street\"\r\n [sortCriteria]=\"sortCriteriaStreetNb\"\r\n [maxSuggesionCount]=\"maxSuggestionStreetNb\" \r\n [visibleSuggesionCount]=\"visibleSuggestionStreetNbCount\"\r\n [notInListAllowed]=\"notInListAllowed\"\r\n [suggestionLevel]=\"suggestionLevel\"\r\n [allowNoValidation]=\"allowNoValidation\"\r\n [validatedByBackend]=\"validatedByBackend\"\r\n [numberOfExceptions]=\"numberOfExceptions\"\r\n [nis9InResponse]=\"nis9InResponse\"\r\n [businessNameInResponse]=\"businessNameInResponse\"\r\n (addressChanged)=\"setAddress($event, 2)\"\r\n (streetNumberChanged)=\"setAddressStreetNumber($event)\"\r\n (messageChanged)=\"setValidationMessage($event)\"\r\n (focusEvent)=\"changeMinLevel($event)\"\r\n (textChangeEvent)=\"resetStreetNumber($event, false)\"\r\n (clearInputEventEmitter)=\"onClearInputEventEmitter($event)\"\r\n (prefillEventEmitter)=\"onStreetNumberPrefillEvent($event)\"\r\n (numberOfExceptionsEmitter)=\"setNumberOfExceptions($event)\"></bp-street-number>\r\n\r\n <bp-box-number class=\"aacwidget-address-boxnumber\"\r\n [isReadonly]=\"isReadonly\"\r\n [showDebugMessageToConsole]=\"showDebugMessageToConsole\"\r\n [baseUrl]=\"usedBoxNumberUrl\"\r\n [selectedAddress]=\"streetNumberAddress\"\r\n [prefillData]=\"boxNumberPrefillData\"\r\n [labelResourceKey]=\"'common.label.boxNumber'\"\r\n [inputLang]=\"selectedLanguage\"\r\n [messageOption]=\"messageOption\"\r\n [postalCode]=\"postalCode\" \r\n [locality]=\"locality\" \r\n [streetName]=\"street\" \r\n [streetNumber]=\"streetNumber\"\r\n [sortCriteria]=\"sortCriteriaBoxNb\" \r\n [nis9InResponse]=\"nis9InResponse\"\r\n [businessNameInResponse]=\"businessNameInResponse\"\r\n [maxSuggesionCount]=\"maxSuggestionBoxNb\"\r\n [visibleSuggesionCount]=\"visibleSuggestionBoxNbCount\"\r\n [notInListAllowed]=\"notInListAllowed\"\r\n [suggestionLevel]=\"suggestionLevel\"\r\n [allowNoValidation]=\"allowNoValidation\"\r\n [validatedByBackend]=\"validatedByBackend\"\r\n [numberOfExceptions]=\"numberOfExceptions\"\r\n (messageChanged)=\"setValidationMessage($event)\"\r\n (addressChanged)=\"setAddress($event, 1)\" \r\n (boxNumberChanged)=\"setAddressBoxNumber($event)\"\r\n (focusEvent)=\"changeMinLevel($event)\"\r\n (textChangeEvent)=\"resetBoxNumber($event, false)\"\r\n (clearInputEventEmitter)=\"onClearInputEventEmitter($event)\"\r\n (prefillEventEmitter)=\"onBoxNumberPrefillEvent($event)\"\r\n (numberOfExceptionsEmitter)=\"setNumberOfExceptions($event)\"></bp-box-number>\r\n</div>", styles: [""], components: [{ type: LocalityComponent, selector: "bp-locality", inputs: ["labelResourceKey", "messageOption", "maxSuggesionCount", "visibleSuggestionCount", "sortCriteria", "baseUrl", "inputText", "prefillData", "showDebugMessageToConsole", "inputLang", "isReadonly", "allowNoValidation", "validatedByBackend", "numberOfExceptions"], outputs: ["messageChanged", "addressChanged", "focusEvent", "blurEvent", "textChangeEvent", "clearInputEventEmitter", "prefillEventEmitter", "numberOfExceptionsEmitter"] }, { type: StreetComponent, selector: "bp-street", inputs: ["labelResourceKey", "maxSuggesionCount", "visibleSuggesionCount", "sortCriteria", "baseUrl", "addressParams", "prefillData", "showDebugMessageToConsole", "postalCode", "locality", "inputText", "messageOption", "allowNoValidation", "validatedByBackend", "numberOfExceptions", "inputLang", "isReadonly"], outputs: ["messageChanged", "addressChanged", "focusEvent", "blurEvent", "textChangeEvent", "clearInputEventEmitter", "prefillEventEmitter", "numberOfExceptionsEmitter"] }, { type: StreetNumberComponent, selector: "bp-street-number", inputs: ["prefillData", "showDebugMessageToConsole", "labelResourceKey", "maxSuggesionCount", "visibleSuggesionCount", "sortCriteria", "baseUrl", "addressParams", "postalCode", "locality", "streetName", "notInListAllowed", "selectedAddress", "allowNoValidation", "validatedByBackend", "numberOfExceptions", "nis9InResponse", "businessNameInResponse", "inputLang", "messageOption", "inputText", "isReadonly", "suggestionLevel"], outputs: ["messageChanged", "addressChanged", "focusEvent", "blurEvent", "textChangeEvent", "emptyResponseEvent", "clearInputEventEmitter", "prefillEventEmitter", "streetNumberChanged", "numberOfExceptionsEmitter"] }, { type: BoxNumberComponent, selector: "bp-box-number", inputs: ["prefillData", "showDebugMessageToConsole", "labelResourceKey", "maxSuggesionCount", "visibleSuggesionCount", "sortCriteria", "baseUrl", "addressParams", "postalCode", "locality", "streetName", "streetNumber", "selectedAddress", "notInListAllowed", "allowNoValidation", "validatedByBackend", "numberOfExceptions", "inputLang", "messageOption", "isReadonly", "suggestionLevel", "nis9InResponse", "businessNameInResponse"], outputs: ["messageChanged", "addressChanged", "focusEvent", "blurEvent", "textChangeEvent", "emptyResponseEvent", "clearInputEventEmitter", "prefillEventEmitter", "boxNumberChanged", "numberOfExceptionsEmitter"] }], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
6067
+ LibAddressAutocompleteByComponentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: LibAddressAutocompleteByComponentComponent, selector: "bp-lib-address-autocomplete-by-component", inputs: { inputLang: "inputLang", clearInput: "clearInput", validationMessageOption: "validationMessageOption", defaultLang: "defaultLang", showDebugMessageToConsole: "showDebugMessageToConsole", minLevel: "minLevel", notInListAllowed: "notInListAllowed", addressParams: "addressParams", messageOption: "messageOption", localityUrl: "localityUrl", maxSuggestionLocality: "maxSuggestionLocality", visibleSuggestionLocalityCount: "visibleSuggestionLocalityCount", sortCriteriaLocality: "sortCriteriaLocality", streetUrl: "streetUrl", maxSuggestionStreet: "maxSuggestionStreet", visibleSuggestionStreetCount: "visibleSuggestionStreetCount", sortCriteriaStreet: "sortCriteriaStreet", streetNumberUrl: "streetNumberUrl", maxSuggestionStreetNb: "maxSuggestionStreetNb", visibleSuggestionStreetNbCount: "visibleSuggestionStreetNbCount", sortCriteriaStreetNb: "sortCriteriaStreetNb", boxNumberUrl: "boxNumberUrl", maxSuggestionBoxNb: "maxSuggestionBoxNb", visibleSuggestionBoxNbCount: "visibleSuggestionBoxNbCount", sortCriteriaBoxNb: "sortCriteriaBoxNb", allowNoValidation: "allowNoValidation", validatedByBackend: "validatedByBackend", numberOfExceptions: "numberOfExceptions", suggestionLevel: "suggestionLevel", apiKey: "apiKey", isReadonly: "isReadonly", nis9InResponse: "nis9InResponse", businessNameInResponse: "businessNameInResponse" }, outputs: { addressCompleteEventEmitter: "addressCompleteEventEmitter", validationMessageEventEmitter: "validationMessageEventEmitter", clearInputEventEmitter: "clearInputEventEmitter", validatedByBackendEventEmitter: "validatedByBackendEventEmitter", numberOfExceptionsEventEmitter: "numberOfExceptionsEventEmitter" }, viewQueries: [{ propertyName: "autocompleteLocality", first: true, predicate: LocalityComponent, descendants: true }, { propertyName: "autocompleteStreet", first: true, predicate: StreetComponent, descendants: true }, { propertyName: "autocompleteStreetNb", first: true, predicate: StreetNumberComponent, descendants: true }, { propertyName: "autocompleteBoxNb", first: true, predicate: BoxNumberComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "\r\n<div class=\"aacwidget-address-container\">\r\n\r\n <div class=\"bpaac-dropdown-validation\" *ngIf=\"validationMessageOptionType === 'SHOW' \">\r\n <div class=\"bpaac-validated-icon\" *ngIf=\"selectedAddress && validationMessage!==null && validationMessage.messageType!==null\"></div>\r\n <!-- {{ validationMessage | translate }} -->\r\n {{ validationMessage.translatedMessage }}\r\n </div>\r\n\r\n <!-- bp-aacwidget-autocomplete-locality -->\r\n <bp-locality class=\"aacwidget-address-locality\" *ngIf=\"isComponentReady\"\r\n [isReadonly]=\"isReadonly\"\r\n [showDebugMessageToConsole]=\"showDebugMessageToConsole\"\r\n [baseUrl]=\"usedLocalityUrl\"\r\n [prefillData]=\"localityPrefillData\"\r\n [labelResourceKey]=\"'common.label.postalCode'\"\r\n [inputText]=\"postalCodeLocality\"\r\n [inputLang]=\"selectedLanguage\"\r\n [messageOption]=\"messageOption\"\r\n [sortCriteria]=\"sortCriteriaLocality\"\r\n [maxSuggesionCount]=\"maxSuggestionLocality\" \r\n [visibleSuggestionCount]=\"visibleSuggestionLocalityCount\"\r\n [allowNoValidation]=\"allowNoValidation\"\r\n [validatedByBackend]=\"validatedByBackend\"\r\n [numberOfExceptions]=\"numberOfExceptions\"\r\n (addressChanged)=\"setAddress($event, 4)\"\r\n (messageChanged)=\"setValidationMessage($event)\"\r\n (focusEvent)=\"changeMinLevel($event)\" \r\n (textChangeEvent)=\"resetLocality($event)\"\r\n (clearInputEventEmitter)=\"onClearInputEventEmitter($event)\"\r\n (prefillEventEmitter)=\"onLocalityPrefillEvent($event)\"\r\n (numberOfExceptionsEmitter)=\"setNumberOfExceptions($event)\"></bp-locality>\r\n\r\n <bp-street class=\"aacwidget-address-street\"\r\n [isReadonly]=\"isReadonly\"\r\n [showDebugMessageToConsole]=\"showDebugMessageToConsole\"\r\n [baseUrl]=\"usedStreetUrl\"\r\n [prefillData]=\"streetPrefillData\"\r\n [autofillData]=\"streetNameAutofillData\"\r\n [labelResourceKey]=\"'common.label.streetName'\"\r\n [inputText]=\"streetNameInput\"\r\n [inputLang]=\"selectedLanguage\"\r\n [messageOption]=\"messageOption\"\r\n [postalCode]=\"postalCode\"\r\n [locality]=\"locality\"\r\n [sortCriteria]=\"sortCriteriaStreet\" \r\n [maxSuggesionCount]=\"maxSuggestionStreet\"\r\n [visibleSuggesionCount]=\"visibleSuggestionStreetCount\"\r\n [allowNoValidation]=\"allowNoValidation\"\r\n [validatedByBackend]=\"validatedByBackend\"\r\n [numberOfExceptions]=\"numberOfExceptions\"\r\n (addressChanged)=\"setAddress($event, 3)\"\r\n (messageChanged)=\"setValidationMessage($event)\"\r\n (focusEvent)=\"changeMinLevel($event)\"\r\n (textChangeEvent)=\"resetStreet($event)\"\r\n (clearInputEventEmitter)=\"onClearInputEventEmitter($event)\"\r\n (prefillEventEmitter)=\"onStreetPrefillEvent($event)\"\r\n (numberOfExceptionsEmitter)=\"setNumberOfExceptions($event)\"></bp-street>\r\n\r\n <bp-street-number class=\"aacwidget-address-streetnumber\"\r\n [isReadonly]=\"isReadonly\"\r\n [showDebugMessageToConsole]=\"showDebugMessageToConsole\"\r\n [baseUrl]=\"usedStreetNumberUrl\"\r\n [selectedAddress]=\"streetAddress\"\r\n [prefillData]=\"streetNumberPrefillData\"\r\n [autofillData]=\"streetNumberAutofillData\"\r\n [labelResourceKey]=\"'common.label.streetNumber'\"\r\n [inputText]=\"streetNumberInput\"\r\n [inputLang]=\"selectedLanguage\"\r\n [messageOption]=\"messageOption\"\r\n [postalCode]=\"postalCode\" \r\n [locality]=\"locality\" \r\n [streetName]=\"street\"\r\n [sortCriteria]=\"sortCriteriaStreetNb\"\r\n [maxSuggesionCount]=\"maxSuggestionStreetNb\" \r\n [visibleSuggesionCount]=\"visibleSuggestionStreetNbCount\"\r\n [notInListAllowed]=\"notInListAllowed\"\r\n [suggestionLevel]=\"suggestionLevel\"\r\n [allowNoValidation]=\"allowNoValidation\"\r\n [validatedByBackend]=\"validatedByBackend\"\r\n [numberOfExceptions]=\"numberOfExceptions\"\r\n [nis9InResponse]=\"nis9InResponse\"\r\n [businessNameInResponse]=\"businessNameInResponse\"\r\n (addressChanged)=\"setAddress($event, 2)\"\r\n (streetNumberChanged)=\"setAddressStreetNumber($event)\"\r\n (messageChanged)=\"setValidationMessage($event)\"\r\n (focusEvent)=\"changeMinLevel($event)\"\r\n (textChangeEvent)=\"resetStreetNumber($event, false)\"\r\n (clearInputEventEmitter)=\"onClearInputEventEmitter($event)\"\r\n (prefillEventEmitter)=\"onStreetNumberPrefillEvent($event)\"\r\n (numberOfExceptionsEmitter)=\"setNumberOfExceptions($event)\"></bp-street-number>\r\n\r\n <bp-box-number class=\"aacwidget-address-boxnumber\"\r\n [isReadonly]=\"isReadonly\"\r\n [showDebugMessageToConsole]=\"showDebugMessageToConsole\"\r\n [baseUrl]=\"usedBoxNumberUrl\"\r\n [selectedAddress]=\"streetNumberAddress\"\r\n [prefillData]=\"boxNumberPrefillData\"\r\n [autofillData]=\"boxNumberAutofillData\"\r\n [labelResourceKey]=\"'common.label.boxNumber'\"\r\n [inputLang]=\"selectedLanguage\"\r\n [messageOption]=\"messageOption\"\r\n [postalCode]=\"postalCode\" \r\n [locality]=\"locality\" \r\n [streetName]=\"street\" \r\n [streetNumber]=\"streetNumber\"\r\n [sortCriteria]=\"sortCriteriaBoxNb\" \r\n [nis9InResponse]=\"nis9InResponse\"\r\n [businessNameInResponse]=\"businessNameInResponse\"\r\n [maxSuggesionCount]=\"maxSuggestionBoxNb\"\r\n [visibleSuggesionCount]=\"visibleSuggestionBoxNbCount\"\r\n [notInListAllowed]=\"notInListAllowed\"\r\n [suggestionLevel]=\"suggestionLevel\"\r\n [allowNoValidation]=\"allowNoValidation\"\r\n [validatedByBackend]=\"validatedByBackend\"\r\n [numberOfExceptions]=\"numberOfExceptions\"\r\n (messageChanged)=\"setValidationMessage($event)\"\r\n (addressChanged)=\"setAddress($event, 1)\" \r\n (boxNumberChanged)=\"setAddressBoxNumber($event)\"\r\n (focusEvent)=\"changeMinLevel($event)\"\r\n (textChangeEvent)=\"resetBoxNumber($event, false)\"\r\n (clearInputEventEmitter)=\"onClearInputEventEmitter($event)\"\r\n (prefillEventEmitter)=\"onBoxNumberPrefillEvent($event)\"\r\n (numberOfExceptionsEmitter)=\"setNumberOfExceptions($event)\"></bp-box-number>\r\n</div>", styles: [""], components: [{ type: LocalityComponent, selector: "bp-locality", inputs: ["labelResourceKey", "messageOption", "maxSuggesionCount", "visibleSuggestionCount", "sortCriteria", "baseUrl", "inputText", "prefillData", "showDebugMessageToConsole", "inputLang", "isReadonly", "allowNoValidation", "validatedByBackend", "numberOfExceptions"], outputs: ["messageChanged", "addressChanged", "focusEvent", "blurEvent", "textChangeEvent", "clearInputEventEmitter", "prefillEventEmitter", "numberOfExceptionsEmitter"] }, { type: StreetComponent, selector: "bp-street", inputs: ["labelResourceKey", "maxSuggesionCount", "visibleSuggesionCount", "sortCriteria", "baseUrl", "addressParams", "prefillData", "autofillData", "showDebugMessageToConsole", "postalCode", "locality", "inputText", "messageOption", "allowNoValidation", "validatedByBackend", "numberOfExceptions", "inputLang", "isReadonly"], outputs: ["messageChanged", "addressChanged", "focusEvent", "blurEvent", "textChangeEvent", "clearInputEventEmitter", "prefillEventEmitter", "numberOfExceptionsEmitter"] }, { type: StreetNumberComponent, selector: "bp-street-number", inputs: ["prefillData", "autofillData", "showDebugMessageToConsole", "labelResourceKey", "maxSuggesionCount", "visibleSuggesionCount", "sortCriteria", "baseUrl", "addressParams", "postalCode", "locality", "streetName", "notInListAllowed", "selectedAddress", "allowNoValidation", "validatedByBackend", "numberOfExceptions", "nis9InResponse", "businessNameInResponse", "inputLang", "messageOption", "inputText", "isReadonly", "suggestionLevel"], outputs: ["messageChanged", "addressChanged", "focusEvent", "blurEvent", "textChangeEvent", "emptyResponseEvent", "clearInputEventEmitter", "prefillEventEmitter", "streetNumberChanged", "numberOfExceptionsEmitter"] }, { type: BoxNumberComponent, selector: "bp-box-number", inputs: ["prefillData", "autofillData", "showDebugMessageToConsole", "labelResourceKey", "maxSuggesionCount", "visibleSuggesionCount", "sortCriteria", "baseUrl", "addressParams", "postalCode", "locality", "streetName", "streetNumber", "selectedAddress", "notInListAllowed", "allowNoValidation", "validatedByBackend", "numberOfExceptions", "inputLang", "messageOption", "isReadonly", "suggestionLevel", "nis9InResponse", "businessNameInResponse"], outputs: ["messageChanged", "addressChanged", "focusEvent", "blurEvent", "textChangeEvent", "emptyResponseEvent", "clearInputEventEmitter", "prefillEventEmitter", "boxNumberChanged", "numberOfExceptionsEmitter"] }], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
5958
6068
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: LibAddressAutocompleteByComponentComponent, decorators: [{
5959
6069
  type: Component,
5960
- args: [{ selector: 'bp-lib-address-autocomplete-by-component', template: "\r\n<div class=\"aacwidget-address-container\">\r\n\r\n <div class=\"bpaac-dropdown-validation\" *ngIf=\"validationMessageOptionType === 'SHOW' \">\r\n <div class=\"bpaac-validated-icon\" *ngIf=\"selectedAddress && validationMessage!==null && validationMessage.messageType!==null\"></div>\r\n <!-- {{ validationMessage | translate }} -->\r\n {{ validationMessage.translatedMessage }}\r\n </div>\r\n\r\n <!-- bp-aacwidget-autocomplete-locality -->\r\n <bp-locality class=\"aacwidget-address-locality\" *ngIf=\"isComponentReady\"\r\n [isReadonly]=\"isReadonly\"\r\n [showDebugMessageToConsole]=\"showDebugMessageToConsole\"\r\n [baseUrl]=\"usedLocalityUrl\"\r\n [prefillData]=\"localityPrefillData\"\r\n [labelResourceKey]=\"'common.label.postalCode'\"\r\n [inputText]=\"postalCodeLocality\"\r\n [inputLang]=\"selectedLanguage\"\r\n [messageOption]=\"messageOption\"\r\n [sortCriteria]=\"sortCriteriaLocality\"\r\n [maxSuggesionCount]=\"maxSuggestionLocality\" \r\n [visibleSuggestionCount]=\"visibleSuggestionLocalityCount\"\r\n [allowNoValidation]=\"allowNoValidation\"\r\n [validatedByBackend]=\"validatedByBackend\"\r\n [numberOfExceptions]=\"numberOfExceptions\"\r\n (addressChanged)=\"setAddress($event, 4)\"\r\n (messageChanged)=\"setValidationMessage($event)\"\r\n (focusEvent)=\"changeMinLevel($event)\" \r\n (textChangeEvent)=\"resetLocality($event)\"\r\n (clearInputEventEmitter)=\"onClearInputEventEmitter($event)\"\r\n (prefillEventEmitter)=\"onLocalityPrefillEvent($event)\"\r\n (numberOfExceptionsEmitter)=\"setNumberOfExceptions($event)\"></bp-locality>\r\n\r\n <bp-street class=\"aacwidget-address-street\"\r\n [isReadonly]=\"isReadonly\"\r\n [showDebugMessageToConsole]=\"showDebugMessageToConsole\"\r\n [baseUrl]=\"usedStreetUrl\"\r\n [prefillData]=\"streetPrefillData\"\r\n [labelResourceKey]=\"'common.label.streetName'\"\r\n [inputText]=\"streetNameInput\"\r\n [inputLang]=\"selectedLanguage\"\r\n [messageOption]=\"messageOption\"\r\n [postalCode]=\"postalCode\"\r\n [locality]=\"locality\"\r\n [sortCriteria]=\"sortCriteriaStreet\" \r\n [maxSuggesionCount]=\"maxSuggestionStreet\"\r\n [visibleSuggesionCount]=\"visibleSuggestionStreetCount\"\r\n [allowNoValidation]=\"allowNoValidation\"\r\n [validatedByBackend]=\"validatedByBackend\"\r\n [numberOfExceptions]=\"numberOfExceptions\"\r\n (addressChanged)=\"setAddress($event, 3)\"\r\n (messageChanged)=\"setValidationMessage($event)\"\r\n (focusEvent)=\"changeMinLevel($event)\"\r\n (textChangeEvent)=\"resetStreet($event)\"\r\n (clearInputEventEmitter)=\"onClearInputEventEmitter($event)\"\r\n (prefillEventEmitter)=\"onStreetPrefillEvent($event)\"\r\n (numberOfExceptionsEmitter)=\"setNumberOfExceptions($event)\"></bp-street>\r\n\r\n <bp-street-number class=\"aacwidget-address-streetnumber\"\r\n [isReadonly]=\"isReadonly\"\r\n [showDebugMessageToConsole]=\"showDebugMessageToConsole\"\r\n [baseUrl]=\"usedStreetNumberUrl\"\r\n [selectedAddress]=\"streetAddress\"\r\n [prefillData]=\"streetNumberPrefillData\"\r\n [labelResourceKey]=\"'common.label.streetNumber'\"\r\n [inputText]=\"streetNumberInput\"\r\n [inputLang]=\"selectedLanguage\"\r\n [messageOption]=\"messageOption\"\r\n [postalCode]=\"postalCode\" \r\n [locality]=\"locality\" \r\n [streetName]=\"street\"\r\n [sortCriteria]=\"sortCriteriaStreetNb\"\r\n [maxSuggesionCount]=\"maxSuggestionStreetNb\" \r\n [visibleSuggesionCount]=\"visibleSuggestionStreetNbCount\"\r\n [notInListAllowed]=\"notInListAllowed\"\r\n [suggestionLevel]=\"suggestionLevel\"\r\n [allowNoValidation]=\"allowNoValidation\"\r\n [validatedByBackend]=\"validatedByBackend\"\r\n [numberOfExceptions]=\"numberOfExceptions\"\r\n [nis9InResponse]=\"nis9InResponse\"\r\n [businessNameInResponse]=\"businessNameInResponse\"\r\n (addressChanged)=\"setAddress($event, 2)\"\r\n (streetNumberChanged)=\"setAddressStreetNumber($event)\"\r\n (messageChanged)=\"setValidationMessage($event)\"\r\n (focusEvent)=\"changeMinLevel($event)\"\r\n (textChangeEvent)=\"resetStreetNumber($event, false)\"\r\n (clearInputEventEmitter)=\"onClearInputEventEmitter($event)\"\r\n (prefillEventEmitter)=\"onStreetNumberPrefillEvent($event)\"\r\n (numberOfExceptionsEmitter)=\"setNumberOfExceptions($event)\"></bp-street-number>\r\n\r\n <bp-box-number class=\"aacwidget-address-boxnumber\"\r\n [isReadonly]=\"isReadonly\"\r\n [showDebugMessageToConsole]=\"showDebugMessageToConsole\"\r\n [baseUrl]=\"usedBoxNumberUrl\"\r\n [selectedAddress]=\"streetNumberAddress\"\r\n [prefillData]=\"boxNumberPrefillData\"\r\n [labelResourceKey]=\"'common.label.boxNumber'\"\r\n [inputLang]=\"selectedLanguage\"\r\n [messageOption]=\"messageOption\"\r\n [postalCode]=\"postalCode\" \r\n [locality]=\"locality\" \r\n [streetName]=\"street\" \r\n [streetNumber]=\"streetNumber\"\r\n [sortCriteria]=\"sortCriteriaBoxNb\" \r\n [nis9InResponse]=\"nis9InResponse\"\r\n [businessNameInResponse]=\"businessNameInResponse\"\r\n [maxSuggesionCount]=\"maxSuggestionBoxNb\"\r\n [visibleSuggesionCount]=\"visibleSuggestionBoxNbCount\"\r\n [notInListAllowed]=\"notInListAllowed\"\r\n [suggestionLevel]=\"suggestionLevel\"\r\n [allowNoValidation]=\"allowNoValidation\"\r\n [validatedByBackend]=\"validatedByBackend\"\r\n [numberOfExceptions]=\"numberOfExceptions\"\r\n (messageChanged)=\"setValidationMessage($event)\"\r\n (addressChanged)=\"setAddress($event, 1)\" \r\n (boxNumberChanged)=\"setAddressBoxNumber($event)\"\r\n (focusEvent)=\"changeMinLevel($event)\"\r\n (textChangeEvent)=\"resetBoxNumber($event, false)\"\r\n (clearInputEventEmitter)=\"onClearInputEventEmitter($event)\"\r\n (prefillEventEmitter)=\"onBoxNumberPrefillEvent($event)\"\r\n (numberOfExceptionsEmitter)=\"setNumberOfExceptions($event)\"></bp-box-number>\r\n</div>", styles: [""] }]
6070
+ args: [{ selector: 'bp-lib-address-autocomplete-by-component', template: "\r\n<div class=\"aacwidget-address-container\">\r\n\r\n <div class=\"bpaac-dropdown-validation\" *ngIf=\"validationMessageOptionType === 'SHOW' \">\r\n <div class=\"bpaac-validated-icon\" *ngIf=\"selectedAddress && validationMessage!==null && validationMessage.messageType!==null\"></div>\r\n <!-- {{ validationMessage | translate }} -->\r\n {{ validationMessage.translatedMessage }}\r\n </div>\r\n\r\n <!-- bp-aacwidget-autocomplete-locality -->\r\n <bp-locality class=\"aacwidget-address-locality\" *ngIf=\"isComponentReady\"\r\n [isReadonly]=\"isReadonly\"\r\n [showDebugMessageToConsole]=\"showDebugMessageToConsole\"\r\n [baseUrl]=\"usedLocalityUrl\"\r\n [prefillData]=\"localityPrefillData\"\r\n [labelResourceKey]=\"'common.label.postalCode'\"\r\n [inputText]=\"postalCodeLocality\"\r\n [inputLang]=\"selectedLanguage\"\r\n [messageOption]=\"messageOption\"\r\n [sortCriteria]=\"sortCriteriaLocality\"\r\n [maxSuggesionCount]=\"maxSuggestionLocality\" \r\n [visibleSuggestionCount]=\"visibleSuggestionLocalityCount\"\r\n [allowNoValidation]=\"allowNoValidation\"\r\n [validatedByBackend]=\"validatedByBackend\"\r\n [numberOfExceptions]=\"numberOfExceptions\"\r\n (addressChanged)=\"setAddress($event, 4)\"\r\n (messageChanged)=\"setValidationMessage($event)\"\r\n (focusEvent)=\"changeMinLevel($event)\" \r\n (textChangeEvent)=\"resetLocality($event)\"\r\n (clearInputEventEmitter)=\"onClearInputEventEmitter($event)\"\r\n (prefillEventEmitter)=\"onLocalityPrefillEvent($event)\"\r\n (numberOfExceptionsEmitter)=\"setNumberOfExceptions($event)\"></bp-locality>\r\n\r\n <bp-street class=\"aacwidget-address-street\"\r\n [isReadonly]=\"isReadonly\"\r\n [showDebugMessageToConsole]=\"showDebugMessageToConsole\"\r\n [baseUrl]=\"usedStreetUrl\"\r\n [prefillData]=\"streetPrefillData\"\r\n [autofillData]=\"streetNameAutofillData\"\r\n [labelResourceKey]=\"'common.label.streetName'\"\r\n [inputText]=\"streetNameInput\"\r\n [inputLang]=\"selectedLanguage\"\r\n [messageOption]=\"messageOption\"\r\n [postalCode]=\"postalCode\"\r\n [locality]=\"locality\"\r\n [sortCriteria]=\"sortCriteriaStreet\" \r\n [maxSuggesionCount]=\"maxSuggestionStreet\"\r\n [visibleSuggesionCount]=\"visibleSuggestionStreetCount\"\r\n [allowNoValidation]=\"allowNoValidation\"\r\n [validatedByBackend]=\"validatedByBackend\"\r\n [numberOfExceptions]=\"numberOfExceptions\"\r\n (addressChanged)=\"setAddress($event, 3)\"\r\n (messageChanged)=\"setValidationMessage($event)\"\r\n (focusEvent)=\"changeMinLevel($event)\"\r\n (textChangeEvent)=\"resetStreet($event)\"\r\n (clearInputEventEmitter)=\"onClearInputEventEmitter($event)\"\r\n (prefillEventEmitter)=\"onStreetPrefillEvent($event)\"\r\n (numberOfExceptionsEmitter)=\"setNumberOfExceptions($event)\"></bp-street>\r\n\r\n <bp-street-number class=\"aacwidget-address-streetnumber\"\r\n [isReadonly]=\"isReadonly\"\r\n [showDebugMessageToConsole]=\"showDebugMessageToConsole\"\r\n [baseUrl]=\"usedStreetNumberUrl\"\r\n [selectedAddress]=\"streetAddress\"\r\n [prefillData]=\"streetNumberPrefillData\"\r\n [autofillData]=\"streetNumberAutofillData\"\r\n [labelResourceKey]=\"'common.label.streetNumber'\"\r\n [inputText]=\"streetNumberInput\"\r\n [inputLang]=\"selectedLanguage\"\r\n [messageOption]=\"messageOption\"\r\n [postalCode]=\"postalCode\" \r\n [locality]=\"locality\" \r\n [streetName]=\"street\"\r\n [sortCriteria]=\"sortCriteriaStreetNb\"\r\n [maxSuggesionCount]=\"maxSuggestionStreetNb\" \r\n [visibleSuggesionCount]=\"visibleSuggestionStreetNbCount\"\r\n [notInListAllowed]=\"notInListAllowed\"\r\n [suggestionLevel]=\"suggestionLevel\"\r\n [allowNoValidation]=\"allowNoValidation\"\r\n [validatedByBackend]=\"validatedByBackend\"\r\n [numberOfExceptions]=\"numberOfExceptions\"\r\n [nis9InResponse]=\"nis9InResponse\"\r\n [businessNameInResponse]=\"businessNameInResponse\"\r\n (addressChanged)=\"setAddress($event, 2)\"\r\n (streetNumberChanged)=\"setAddressStreetNumber($event)\"\r\n (messageChanged)=\"setValidationMessage($event)\"\r\n (focusEvent)=\"changeMinLevel($event)\"\r\n (textChangeEvent)=\"resetStreetNumber($event, false)\"\r\n (clearInputEventEmitter)=\"onClearInputEventEmitter($event)\"\r\n (prefillEventEmitter)=\"onStreetNumberPrefillEvent($event)\"\r\n (numberOfExceptionsEmitter)=\"setNumberOfExceptions($event)\"></bp-street-number>\r\n\r\n <bp-box-number class=\"aacwidget-address-boxnumber\"\r\n [isReadonly]=\"isReadonly\"\r\n [showDebugMessageToConsole]=\"showDebugMessageToConsole\"\r\n [baseUrl]=\"usedBoxNumberUrl\"\r\n [selectedAddress]=\"streetNumberAddress\"\r\n [prefillData]=\"boxNumberPrefillData\"\r\n [autofillData]=\"boxNumberAutofillData\"\r\n [labelResourceKey]=\"'common.label.boxNumber'\"\r\n [inputLang]=\"selectedLanguage\"\r\n [messageOption]=\"messageOption\"\r\n [postalCode]=\"postalCode\" \r\n [locality]=\"locality\" \r\n [streetName]=\"street\" \r\n [streetNumber]=\"streetNumber\"\r\n [sortCriteria]=\"sortCriteriaBoxNb\" \r\n [nis9InResponse]=\"nis9InResponse\"\r\n [businessNameInResponse]=\"businessNameInResponse\"\r\n [maxSuggesionCount]=\"maxSuggestionBoxNb\"\r\n [visibleSuggesionCount]=\"visibleSuggestionBoxNbCount\"\r\n [notInListAllowed]=\"notInListAllowed\"\r\n [suggestionLevel]=\"suggestionLevel\"\r\n [allowNoValidation]=\"allowNoValidation\"\r\n [validatedByBackend]=\"validatedByBackend\"\r\n [numberOfExceptions]=\"numberOfExceptions\"\r\n (messageChanged)=\"setValidationMessage($event)\"\r\n (addressChanged)=\"setAddress($event, 1)\" \r\n (boxNumberChanged)=\"setAddressBoxNumber($event)\"\r\n (focusEvent)=\"changeMinLevel($event)\"\r\n (textChangeEvent)=\"resetBoxNumber($event, false)\"\r\n (clearInputEventEmitter)=\"onClearInputEventEmitter($event)\"\r\n (prefillEventEmitter)=\"onBoxNumberPrefillEvent($event)\"\r\n (numberOfExceptionsEmitter)=\"setNumberOfExceptions($event)\"></bp-box-number>\r\n</div>", styles: [""] }]
5961
6071
  }], ctorParameters: function () { return [{ type: HttpService }]; }, propDecorators: { autocompleteLocality: [{
5962
6072
  type: ViewChild,
5963
6073
  args: [LocalityComponent, { static: false }]