@bpost/bp-address-auto-complete-by-component 1.1.28 → 1.1.30

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.
@@ -2664,16 +2664,17 @@ class StreetNumberComponent {
2664
2664
  }
2665
2665
  ngOnChanges(changes) {
2666
2666
  if (changes) {
2667
- if (changes.hasOwnProperty('autofillData') && changes.autofillData.currentValue !== null && changes.autofillData.currentValue !== undefined) {
2667
+ if (changes.hasOwnProperty('autofillData') && changes.autofillData.currentValue !== null && changes.autofillData.currentValue !== undefined
2668
+ && !this.prefilling && !changes.hasOwnProperty('prefillData')) {
2668
2669
  this.searchText = this.loadAutoFillParams(changes.autofillData.currentValue);
2669
2670
  this.setSelectedAddress(this.autofillData.selectedAddress);
2671
+ this.isPrefillWithNoMatch = false;
2670
2672
  }
2671
2673
  else {
2672
2674
  if (changes.hasOwnProperty('streetName')
2673
2675
  && !changes.streetName.firstChange
2674
2676
  && !changes.hasOwnProperty('prefillData') && !this.prefilling) {
2675
2677
  this.minLevel = ADDRESSLEVEL.STREET_NUMBER;
2676
- // this.addressIsComplete = false;
2677
2678
  if (this.showDebugMessageToConsole) {
2678
2679
  console.warn('street name - ngOnchanges - streetName changes detection');
2679
2680
  }
@@ -2697,13 +2698,8 @@ class StreetNumberComponent {
2697
2698
  if (changes.hasOwnProperty('prefillData') && !changes.prefillData.firstChange) {
2698
2699
  this.prefilling = true;
2699
2700
  this.addressIsComplete = false;
2700
- // console.log('streetNumber::ngOnChanges', this.addressIsComplete);
2701
2701
  this.searchText = this.loadParams(changes.prefillData.currentValue);
2702
2702
  if (this.searchText !== '' && this.minLevel === ADDRESSLEVEL.STREET_NUMBER) {
2703
- /*
2704
- this.onInputChange(/*'prefilled'* / SourceType.SOURCE_PREFILLED);
2705
- this.streetNumberSearchInput.nativeElement.focus();
2706
- */
2707
2703
  this.collapseDropdown = true;
2708
2704
  this.prefillData.prefillStreetNumber
2709
2705
  = this.transformStreetNumberInLowercaseAndWithoutDiacritics(this.prefillData.parameters.streetNumber);
@@ -2769,6 +2765,9 @@ class StreetNumberComponent {
2769
2765
  }
2770
2766
  onFocus() {
2771
2767
  this.collapseDropdown = false;
2768
+ if (this.prefillData !== null && this.prefillData.prefillStreetNumberPerfectMatchFound != false && this.addressIsComplete) {
2769
+ this.collapseDropdown = true;
2770
+ }
2772
2771
  // this.collapseDropdown = (this.prefilling === true && this.prefillData !== null)
2773
2772
  // ? !this.prefillData.parameters.onFocusShowSuggestionsAfterPrefill : false;
2774
2773
  // this.prefilling = false;
@@ -2847,6 +2846,10 @@ class StreetNumberComponent {
2847
2846
  */
2848
2847
  // this.addressIsComplete = this.prefillData.prefillStreetNumberPerfectMatchFound === true ? true : false;
2849
2848
  this.isPrefillWithNoMatch = this.prefillData.prefillStreetNumberPerfectMatchFound === true ? false : true;
2849
+ // Ensure user's prefill value is displayed when notInListAllowed
2850
+ if (this.notInListAllowed && this.prefillData.prefillStreetNumber) {
2851
+ this.searchText = this.prefillData.parameters.streetNumber;
2852
+ }
2850
2853
  this.prefillAnalyzeData();
2851
2854
  }
2852
2855
  else {
@@ -2965,7 +2968,7 @@ class StreetNumberComponent {
2965
2968
  this.buildInputWordList();
2966
2969
  }
2967
2970
  this.collapseDropdown = (this.prefilling === true && this.prefillData !== null)
2968
- ? !this.prefillData.parameters.onFocusShowSuggestionsAfterPrefill : false;
2971
+ ? this.prefillData.prefillStreetNumberPerfectMatchFound : false;
2969
2972
  }
2970
2973
  handleGetStreetError(source) {
2971
2974
  if (this.allowNoValidation && this.validatedByBackend) {
@@ -3015,8 +3018,7 @@ class StreetNumberComponent {
3015
3018
  }
3016
3019
  }
3017
3020
  else {
3018
- // If prefilling, then check if no match for a non-empty boxNumber
3019
- // If this is the case, simulate the selection of the 'not-in-list' suggestion
3021
+ // notInListAllowed=true: build a 'not-in-list' suggestion from the prefilled number
3020
3022
  if (this.prefilling && this.notInListAllowed
3021
3023
  && this.prefillData.prefillStreetNumberPerfectMatchFound === false
3022
3024
  && this.prefillData.prefillStreetNumber !== null
@@ -3029,6 +3031,33 @@ class StreetNumberComponent {
3029
3031
  }
3030
3032
  this.prefillCheckForPerfectMatch(suggestion);
3031
3033
  }
3034
+ // notInListAllowed=false and no perfect match:
3035
+ // Check whether any API suggestion starts with the prefilled value (prefix match).
3036
+ // - Prefix match exists (e.g. "1" → "10","11","18"): leave searchText as-is so the
3037
+ // parent's "not found" else branch shows the dropdown with the prefilled value.
3038
+ // - No prefix match (e.g. "145896" → "56"): auto-select the first complete suggestion
3039
+ // so the parent's "found" branch completes the address automatically.
3040
+ if (this.prefilling && !this.notInListAllowed
3041
+ && this.prefillData.prefillStreetNumberPerfectMatchFound === false
3042
+ && this.prefillData.prefillStreetNumber !== null
3043
+ && this.prefillData.prefillStreetNumber !== undefined
3044
+ && this.prefillData.prefillStreetNumber.length > 0) {
3045
+ const prefillLower = this.prefillData.prefillStreetNumber.toLowerCase();
3046
+ const hasPrefixMatch = this.suggestions.some(s => s.houseNumber && s.houseNumber.toLowerCase().startsWith(prefillLower));
3047
+ if (!hasPrefixMatch) {
3048
+ // Prefer a suggestion with isComplete=true; fall back to first suggestion that has a
3049
+ // house number in case language-specific sub-objects (dutch/french) lack isComplete.
3050
+ const autoSelect = this.suggestions.find(s => s.hasOwnProperty('isComplete') && s.isComplete === true)
3051
+ || this.suggestions.find(s => s.houseNumber != null);
3052
+ if (autoSelect) {
3053
+ this.prefillData.prefillStreetNumberPerfectMatchFound = true;
3054
+ this.prefillData.prefillStreetNumberPerfectMatchSuggestion = { address: autoSelect };
3055
+ this.searchText = autoSelect.houseNumber;
3056
+ }
3057
+ }
3058
+ // If hasPrefixMatch: searchText stays as the prefilled value;
3059
+ // the parent's else branch will display it and keep the dropdown open.
3060
+ }
3032
3061
  }
3033
3062
  }
3034
3063
  else {
@@ -3039,8 +3068,13 @@ class StreetNumberComponent {
3039
3068
  const notInListSuggestion = { string: this.searchText, 'not-in-list': true };
3040
3069
  const streetSuggestion = this.prefillData.prefillStreetPerfectMatchSuggestion;
3041
3070
  const combined = Object.assign(Object.assign({}, streetSuggestion.address), notInListSuggestion);
3042
- delete combined.mailBoxid;
3071
+ delete combined.mailBoxid; // mixed-case variant
3072
+ delete combined.mailBoxId; // camelCase variant (internal API field name)
3073
+ delete combined.pdpId;
3043
3074
  delete combined.suffixId;
3075
+ if (combined.geoSanction) {
3076
+ combined.geoSanction = combined.geoSanction.substring(0, 25);
3077
+ }
3044
3078
  // combined.boxNumber = combined.string;
3045
3079
  combined.houseNumber = combined.string;
3046
3080
  combined.searchBarString = combined.string;
@@ -3087,7 +3121,13 @@ class StreetNumberComponent {
3087
3121
  suggestion.address = suggestionToAdd;
3088
3122
  this.prefillCheckForPerfectMatch(suggestion);
3089
3123
  }
3090
- if (this.suggestionLevel !== SuggestionLevelType.StreetNumber && this.suggestionLevel !== SuggestionLevelType.StreetAndBoxNumber) {
3124
+ // Skip checkForPerfectMatch when prefill already found a match to prevent a second
3125
+ // clickSuggestion call that would overwrite searchText with searchBarString.
3126
+ const skipNonPrefillCheck = source === SourceType.SOURCE_PREFILLED
3127
+ && this.prefillData && this.prefillData.prefillStreetNumberPerfectMatchFound === true;
3128
+ if (!skipNonPrefillCheck
3129
+ && this.suggestionLevel !== SuggestionLevelType.StreetNumber
3130
+ && this.suggestionLevel !== SuggestionLevelType.StreetAndBoxNumber) {
3091
3131
  suggestion.address = suggestionToAdd;
3092
3132
  const isPerfectMatch = this.checkForPerfectMatch(suggestion);
3093
3133
  if (!isPerfectMatch) {
@@ -3099,25 +3139,22 @@ class StreetNumberComponent {
3099
3139
  }
3100
3140
  checkForPerfectMatch(suggestion) {
3101
3141
  if (!this.addressIsComplete) {
3102
- // if (this.showDebugMessageToConsole) {
3103
- console.log('streetNumber - checking suggestion for perfect match', suggestion, this.searchText);
3104
- // }
3105
3142
  const sugAddress = suggestion.address;
3106
3143
  const suggestionStreetNumber = this.transformStreetNumberInLowercaseAndWithoutDiacritics('' + sugAddress.houseNumber);
3107
3144
  if (suggestionStreetNumber === ('' + this.searchText)) {
3108
3145
  this.searchText = sugAddress.houseNumber;
3109
3146
  if (sugAddress.hasOwnProperty('isComplete') && sugAddress.isComplete === true) {
3110
3147
  this.clickSuggestion(null, sugAddress);
3148
+ // clickSuggestion sets searchText = sugAddress.searchBarString (full address string).
3149
+ // Restore to houseNumber so the inputText ngOnChanges guard won't trigger clearWidget().
3150
+ this.searchText = sugAddress.houseNumber;
3111
3151
  this.addressIsComplete = true;
3112
- // console.log('streetNumber::prefillCheckForPerfectMatch', this.addressIsComplete);
3113
- // if (this.showDebugMessageToConsole && this.addressIsComplete === true) {
3114
- console.log('ADDRESS COMPLETE ON STREET NUMBER !');
3115
- // }
3116
3152
  return true;
3117
3153
  }
3118
3154
  else {
3119
3155
  if (this.suggestionLevel !== SuggestionLevelType.StreetNumber && this.suggestionLevel !== SuggestionLevelType.StreetAndBoxNumber) {
3120
3156
  this.clickSuggestion(null, sugAddress); // house number found
3157
+ this.searchText = sugAddress.houseNumber;
3121
3158
  }
3122
3159
  }
3123
3160
  }
@@ -3145,11 +3182,10 @@ class StreetNumberComponent {
3145
3182
  this.searchText = sugAddress.houseNumber;
3146
3183
  if (sugAddress.hasOwnProperty('isComplete') && sugAddress.isComplete === true) {
3147
3184
  this.clickSuggestion(null, sugAddress);
3185
+ // clickSuggestion sets searchText = sugAddress.searchBarString (full address string).
3186
+ // Restore to houseNumber so the inputText ngOnChanges guard won't trigger clearWidget().
3187
+ this.searchText = sugAddress.houseNumber;
3148
3188
  this.addressIsComplete = true;
3149
- // console.log('streetNumber::prefillCheckForPerfectMatch', this.addressIsComplete);
3150
- // if (this.showDebugMessageToConsole && this.addressIsComplete === true) {
3151
- console.log('ADDRESS COMPLETE ON STREET NUMBER !');
3152
- // }
3153
3189
  }
3154
3190
  }
3155
3191
  }
@@ -3184,7 +3220,6 @@ class StreetNumberComponent {
3184
3220
  this.consumedNumber = this.sequenceNumber;
3185
3221
  this.clearSuggestions();
3186
3222
  if (this.suggestionLevel === SuggestionLevelType.None) {
3187
- console.log('(A) do not use suggestions for street number');
3188
3223
  this.streetNumberChanged.emit(this.searchText);
3189
3224
  if (source === SourceType.SOURCE_PREFILLED)
3190
3225
  this.prefillAnalyzeData();
@@ -3192,7 +3227,6 @@ class StreetNumberComponent {
3192
3227
  }
3193
3228
  else {
3194
3229
  if (this.suggestionLevel === SuggestionLevelType.None) {
3195
- console.log('(B) do not use suggestions for street number');
3196
3230
  this.streetNumberChanged.emit(this.searchText);
3197
3231
  if (source === SourceType.SOURCE_PREFILLED)
3198
3232
  this.prefillAnalyzeData();
@@ -3229,6 +3263,7 @@ class StreetNumberComponent {
3229
3263
  this.resetArrowSelectedIndex();
3230
3264
  if (!source) {
3231
3265
  this.prefilling = false;
3266
+ this.isPrefillWithNoMatch = false;
3232
3267
  if (this.showDebugMessageToConsole) {
3233
3268
  console.log('streetNumber::onInputChange -> calling valueChanged');
3234
3269
  }
@@ -3240,7 +3275,6 @@ class StreetNumberComponent {
3240
3275
  this.consumedNumber = this.sequenceNumber;
3241
3276
  this.clearSuggestions();
3242
3277
  if (this.suggestionLevel === SuggestionLevelType.None) {
3243
- console.log('(A) do not use suggestions for street number');
3244
3278
  this.streetNumberChanged.emit(this.searchText);
3245
3279
  if (source === SourceType.SOURCE_PREFILLED)
3246
3280
  this.prefillAnalyzeData();
@@ -3248,7 +3282,6 @@ class StreetNumberComponent {
3248
3282
  }
3249
3283
  else {
3250
3284
  if (this.suggestionLevel === SuggestionLevelType.None) {
3251
- console.log('(B) do not use suggestions for street number');
3252
3285
  this.streetNumberChanged.emit(this.searchText);
3253
3286
  if (source === SourceType.SOURCE_PREFILLED) {
3254
3287
  this.prefillData.prefillStreetNumberPerfectMatchFound = true;
@@ -3300,6 +3333,38 @@ class StreetNumberComponent {
3300
3333
  }
3301
3334
  }
3302
3335
  else {
3336
+ // If prefilling, check whether the street suggestion already carries the matching house number
3337
+ // (e.g. postal code 1031 where the street API returns data up to house-number level).
3338
+ // In that case skip the street-number API call and go straight to the box-number step.
3339
+ if (source === SourceType.SOURCE_PREFILLED
3340
+ && this.prefillData
3341
+ && this.prefillData.prefillStreetPerfectMatchSuggestion
3342
+ && this.prefillData.prefillStreetPerfectMatchSuggestion.address) {
3343
+ const streetAddr = this.prefillData.prefillStreetPerfectMatchSuggestion.address;
3344
+ const rawHouseNumber = streetAddr.houseNumber;
3345
+ const streetHouseNumber = (rawHouseNumber != null && rawHouseNumber !== undefined)
3346
+ ? this.transformStreetNumberInLowercaseAndWithoutDiacritics('' + rawHouseNumber)
3347
+ : null;
3348
+ // Use the house number from the street suggestion when:
3349
+ // (a) it exactly matches the prefilled value, OR
3350
+ // (b) notInListAllowed=false — the prefilled value is invalid so auto-fill with
3351
+ // the valid house number that the locality/street API already returned.
3352
+ const streetHouseNumberIsValid = streetHouseNumber && streetHouseNumber !== 'null' && streetHouseNumber !== 'undefined';
3353
+ if (streetHouseNumberIsValid && this.prefillData.prefillStreetNumber
3354
+ && (streetHouseNumber === this.prefillData.prefillStreetNumber || !this.notInListAllowed)) {
3355
+ this.prefillData.prefillStreetNumberPerfectMatchFound = true;
3356
+ this.prefillData.prefillStreetNumberPerfectMatchSuggestion = this.prefillData.prefillStreetPerfectMatchSuggestion;
3357
+ this.searchText = rawHouseNumber;
3358
+ this.isPrefillWithNoMatch = false;
3359
+ this.collapseDropdown = true;
3360
+ if (streetAddr.hasOwnProperty('isComplete') && streetAddr.isComplete === true) {
3361
+ this.clickSuggestion(null, streetAddr);
3362
+ this.addressIsComplete = true;
3363
+ }
3364
+ this.prefillAnalyzeData();
3365
+ return;
3366
+ }
3367
+ }
3303
3368
  this.getTopSuggestions(source);
3304
3369
  }
3305
3370
  }
@@ -3314,9 +3379,12 @@ class StreetNumberComponent {
3314
3379
  if (suggestion) {
3315
3380
  this.clearTypeAhead();
3316
3381
  this.resetArrowSelectedIndex();
3317
- if (suggestion.string) {
3382
+ if (suggestion.searchBarString) {
3318
3383
  this.setSearchText(suggestion.searchBarString);
3319
3384
  }
3385
+ else if (suggestion.string) {
3386
+ this.setSearchText(suggestion.string);
3387
+ }
3320
3388
  this.collapseDropdown = true;
3321
3389
  const notInList = suggestion['not-in-list'];
3322
3390
  const isNotInList = notInList !== null && notInList !== undefined && notInList === true;
@@ -3326,7 +3394,7 @@ class StreetNumberComponent {
3326
3394
  console.log('streetNumber::clickSuggestion - NOT-IN-LIST', event, suggestion);
3327
3395
  }
3328
3396
  }
3329
- if (suggestion.hasOwnProperty('isComplete') && suggestion.isComplete === true && !isNotInList && !suggestion.hasOwnProperty('boxNumber')) {
3397
+ if (suggestion.hasOwnProperty('isComplete') && suggestion.isComplete === true && !isNotInList && !suggestion.boxNumber) {
3330
3398
  this.addressIsComplete = true;
3331
3399
  // this.notifyAddressIsValidated();
3332
3400
  }
@@ -3349,6 +3417,9 @@ class StreetNumberComponent {
3349
3417
  delete combined.suffixId;
3350
3418
  delete combined.pdpId;
3351
3419
  delete combined.pdpId;
3420
+ if (combined.geoSanction) {
3421
+ combined.geoSanction = combined.geoSanction.substring(0, 25);
3422
+ }
3352
3423
  combined.houseNumber = combined.string;
3353
3424
  combined.searchBarString = combined.string;
3354
3425
  combined.isComplete = true;
@@ -3358,7 +3429,7 @@ class StreetNumberComponent {
3358
3429
  // console.log('street number - emit suggestion', suggestion);
3359
3430
  const notInList = suggestion['not-in-list'];
3360
3431
  const isNotInList = notInList !== null && notInList !== undefined && notInList === true;
3361
- this.addressIsComplete = (suggestion.hasOwnProperty('isComplete') && suggestion.isComplete === true && !isNotInList && !suggestion.hasOwnProperty('boxNumber')) ? true : false;
3432
+ this.addressIsComplete = (suggestion.hasOwnProperty('isComplete') && suggestion.isComplete === true && !isNotInList && !suggestion.boxNumber) ? true : false;
3362
3433
  this.addressChanged.emit(suggestion);
3363
3434
  }
3364
3435
  /*
@@ -3771,9 +3842,14 @@ class BoxNumberComponent {
3771
3842
  }
3772
3843
  ngOnChanges(changes) {
3773
3844
  if (changes) {
3774
- if (changes.hasOwnProperty('autofillData') && changes.autofillData.currentValue !== null && changes.autofillData.currentValue !== undefined) {
3775
- this.searchText = this.loadAutoFillParams(changes.autofillData.currentValue);
3776
- this.setSelectedAddress(this.autofillData.selectedAddress);
3845
+ if (changes.hasOwnProperty('autofillData') && changes.autofillData.currentValue !== null && changes.autofillData.currentValue !== undefined
3846
+ && !this.prefilling && !changes.hasOwnProperty('prefillData')) {
3847
+ const newBoxNumber = changes.autofillData.currentValue.boxNumber;
3848
+ // Only process if the box number value actually changed to avoid infinite loop
3849
+ if (newBoxNumber !== this.searchText) {
3850
+ this.searchText = this.loadAutoFillParams(changes.autofillData.currentValue);
3851
+ this.setSelectedAddress(this.autofillData.selectedAddress);
3852
+ }
3777
3853
  }
3778
3854
  else {
3779
3855
  if (changes.hasOwnProperty('prefillData') && !changes.prefillData.firstChange) {
@@ -3781,11 +3857,28 @@ class BoxNumberComponent {
3781
3857
  this.searchText = this.loadParams(changes.prefillData.currentValue);
3782
3858
  if (this.searchText !== '' && this.minLevel === ADDRESSLEVEL.BOX_NUMBER) {
3783
3859
  // this.onInputChange('prefilled');
3784
- // this.boxNumberSearchInput.nativeElement.focus();
3785
3860
  this.collapseDropdown = true;
3786
3861
  this.prefillData.prefillBoxNumber
3787
3862
  = this.transformBoxNumberInLowercaseAndWithoutDiacritics(this.prefillData.parameters.boxNumber);
3788
- this.onInputChange(/*'prefilled'*/ SourceType.SOURCE_PREFILLED);
3863
+ // When notInListAllowed=false, skip the API call if the selected address is
3864
+ // already complete without a box number (i.e. no box numbers exist for this
3865
+ // address in the database). In that case any prefilled box number is invalid
3866
+ // and the API would return empty results anyway.
3867
+ const selectedAddressIsCompleteWithoutBoxNumber = this.selectedAddress != null &&
3868
+ this.selectedAddress.isComplete === true &&
3869
+ !this.selectedAddress.hasOwnProperty('boxNumber');
3870
+ if (!this.notInListAllowed && selectedAddressIsCompleteWithoutBoxNumber) {
3871
+ this.isPrefillWithNoMatch = true;
3872
+ this.prefillAnalyzeData();
3873
+ }
3874
+ else {
3875
+ this.onInputChange(/*'prefilled'*/ SourceType.SOURCE_PREFILLED);
3876
+ }
3877
+ setTimeout(() => {
3878
+ if (this.boxNumberSearchInput && this.boxNumberSearchInput.nativeElement && !this.boxNumberSearchInput.nativeElement.disabled) {
3879
+ this.boxNumberSearchInput.nativeElement.focus();
3880
+ }
3881
+ }, 0);
3789
3882
  }
3790
3883
  }
3791
3884
  if (changes.hasOwnProperty('streetNumber') && !changes.streetNumber.firstChange && !changes.hasOwnProperty('prefillData')) {
@@ -3864,6 +3957,9 @@ class BoxNumberComponent {
3864
3957
  }
3865
3958
  onFocus() {
3866
3959
  this.collapseDropdown = false;
3960
+ if (this.prefillData !== null && this.prefillData.prefillBoxNumberPerfectMatchFound != false) {
3961
+ this.collapseDropdown = true;
3962
+ }
3867
3963
  // this.collapseDropdown = (this.prefilling === true && this.prefillData !== null)
3868
3964
  // ? !this.prefillData.parameters.onFocusShowSuggestionsAfterPrefill : false;
3869
3965
  // this.prefilling = false;
@@ -3922,11 +4018,24 @@ class BoxNumberComponent {
3922
4018
  console.log('BOX-NUMBER calling service params', param);
3923
4019
  }
3924
4020
  if (this.searchText) {
4021
+ this.addressIsValidated = false;
3925
4022
  this.subscription = this.addressService.getBox(this.baseUrl, this.locality, this.postalCode, param)
3926
4023
  .subscribe(response => {
3927
4024
  this.handleGetBoxResponse(response, source);
3928
4025
  if (source === SourceType.SOURCE_PREFILLED) {
3929
4026
  this.isPrefillWithNoMatch = this.prefillData.prefillBoxNumberPerfectMatchFound === true ? false : true;
4027
+ // Ensure user's prefill value is displayed when notInListAllowed
4028
+ if (this.notInListAllowed && this.prefillData.prefillBoxNumber) {
4029
+ this.searchText = this.prefillData.parameters.boxNumber;
4030
+ this.isPrefillWithNoMatch = false;
4031
+ }
4032
+ // If notInListAllowed is false and no perfect match, keep the prefilled value
4033
+ // but show it in orangered so the user sees it was not found in the API.
4034
+ if (!this.notInListAllowed && this.prefillData.prefillBoxNumber !== ''
4035
+ && this.prefillData.prefillBoxNumberPerfectMatchFound !== true) {
4036
+ this.searchText = this.prefillData.parameters.boxNumber;
4037
+ this.isPrefillWithNoMatch = true;
4038
+ }
3930
4039
  this.prefillAnalyzeData();
3931
4040
  }
3932
4041
  else {
@@ -4120,10 +4229,12 @@ class BoxNumberComponent {
4120
4229
  && this.prefillData.prefillBoxNumber.length > 0) {
4121
4230
  // const notInListSuggestion = {string: this.searchText, 'not-in-list': true};
4122
4231
  const suggestion = this.prefillBuildNotInListSuggestion();
4123
- if (this.showDebugMessageToConsole) {
4124
- console.log('BOX NUMBER - PREFILL NOT IN LIST SUGGESTION:', suggestion);
4232
+ if (suggestion) {
4233
+ if (this.showDebugMessageToConsole) {
4234
+ console.log('BOX NUMBER - PREFILL NOT IN LIST SUGGESTION:', suggestion);
4235
+ }
4236
+ this.prefillCheckForPerfectMatch(suggestion);
4125
4237
  }
4126
- this.prefillCheckForPerfectMatch(suggestion);
4127
4238
  }
4128
4239
  }
4129
4240
  }
@@ -4134,9 +4245,25 @@ class BoxNumberComponent {
4134
4245
  prefillBuildNotInListSuggestion() {
4135
4246
  const notInListSuggestion = { string: this.searchText, 'not-in-list': true };
4136
4247
  const streetNumberSuggestion = this.prefillData.prefillStreetNumberPerfectMatchSuggestion;
4248
+ if (!streetNumberSuggestion || !streetNumberSuggestion.address) {
4249
+ return null;
4250
+ }
4251
+ // Capture whether the street-number suggestion was itself not-in-list (invalid)
4252
+ // BEFORE merging — spreading notInListSuggestion on top would mask the original flag.
4253
+ const streetNumberWasNotInList = streetNumberSuggestion.address['not-in-list'] === true;
4137
4254
  const combined = Object.assign(Object.assign({}, streetNumberSuggestion.address), notInListSuggestion);
4138
- delete combined.mailBoxid;
4255
+ delete combined.mailBoxid; // mixed-case variant
4256
+ delete combined.mailBoxId; // camelCase variant (internal API field name)
4139
4257
  delete combined.suffixId;
4258
+ if (combined.geoSanction) {
4259
+ combined.geoSanction = combined.geoSanction.substring(0, 35);
4260
+ }
4261
+ if (streetNumberWasNotInList) {
4262
+ delete combined.pdpId;
4263
+ if (combined.geoSanction) {
4264
+ combined.geoSanction = combined.geoSanction.substring(0, 25);
4265
+ }
4266
+ }
4140
4267
  combined.boxNumber = combined.string;
4141
4268
  combined.searchBarString = combined.string;
4142
4269
  combined.isComplete = true;
@@ -4170,7 +4297,11 @@ class BoxNumberComponent {
4170
4297
  suggestion.address = suggestionToAdd;
4171
4298
  isPerfectMatch = this.prefillCheckForPerfectMatch(suggestion);
4172
4299
  }
4173
- if (this.suggestionLevel !== SuggestionLevelType.StreetAndBoxNumber) {
4300
+ // Skip checkForPerfectMatch when prefill already found a match to prevent a second
4301
+ // clickSuggestion call that would overwrite searchText with searchBarString.
4302
+ const skipNonPrefillCheck = source === SourceType.SOURCE_PREFILLED
4303
+ && this.prefillData && this.prefillData.prefillBoxNumberPerfectMatchFound === true;
4304
+ if (!skipNonPrefillCheck && this.suggestionLevel !== SuggestionLevelType.StreetAndBoxNumber) {
4174
4305
  suggestion.address = suggestionToAdd;
4175
4306
  isPerfectMatch = this.checkForPerfectMatch(suggestion);
4176
4307
  if (!isPerfectMatch) {
@@ -4195,7 +4326,9 @@ class BoxNumberComponent {
4195
4326
  this.searchText = sugAddress.boxNumber;
4196
4327
  if (sugAddress.hasOwnProperty('isComplete') && sugAddress.isComplete === true) {
4197
4328
  this.clickSuggestion(null, sugAddress);
4198
- // this.addressIsComplete = true;
4329
+ // clickSuggestion sets searchText = sugAddress.searchBarString (full address string).
4330
+ // Restore to boxNumber so the field shows the clean box number value.
4331
+ this.searchText = sugAddress.boxNumber;
4199
4332
  if (this.showDebugMessageToConsole) {
4200
4333
  console.log('ADDRESS COMPLETE ON BOX NUMBER !');
4201
4334
  }
@@ -4222,7 +4355,9 @@ class BoxNumberComponent {
4222
4355
  this.searchText = sugAddress.boxNumber;
4223
4356
  if (sugAddress.hasOwnProperty('isComplete') && sugAddress.isComplete === true) {
4224
4357
  this.clickSuggestion(null, sugAddress);
4225
- // this.addressIsComplete = true;
4358
+ // clickSuggestion sets searchText = sugAddress.searchBarString (full address string).
4359
+ // Restore to boxNumber so the field shows the clean box number value.
4360
+ this.searchText = sugAddress.boxNumber;
4226
4361
  if (this.showDebugMessageToConsole) {
4227
4362
  console.log('ADDRESS COMPLETE ON BOX NUMBER !');
4228
4363
  }
@@ -4350,9 +4485,12 @@ class BoxNumberComponent {
4350
4485
  if (suggestion) {
4351
4486
  this.clearTypeAhead();
4352
4487
  this.resetArrowSelectedIndex();
4353
- if (suggestion.string) {
4488
+ if (suggestion.searchBarString) {
4354
4489
  this.setSearchText(suggestion.searchBarString);
4355
4490
  }
4491
+ else if (suggestion.string) {
4492
+ this.setSearchText(suggestion.string);
4493
+ }
4356
4494
  this.collapseDropdown = true;
4357
4495
  // if (suggestion.hasOwnProperty('isComplete')) {
4358
4496
  // this.showAddressIsValidated();
@@ -4369,13 +4507,18 @@ class BoxNumberComponent {
4369
4507
  const combined = Object.assign(Object.assign({}, this.selectedAddress), suggestion);
4370
4508
  delete combined.mailBoxid;
4371
4509
  delete combined.suffixId;
4510
+ if (combined.geoSanction) {
4511
+ combined.geoSanction = combined.geoSanction.substring(0, 35);
4512
+ }
4372
4513
  combined.boxNumber = combined.string;
4373
4514
  combined.searchBarString = combined.string;
4374
4515
  combined.isComplete = true;
4375
4516
  return combined;
4376
4517
  }
4377
4518
  setSelectedAddress(suggestion) {
4378
- // console.log('box number::setSelectedAddress', suggestion);
4519
+ if (this.showDebugMessageToConsole) {
4520
+ console.log('box number::setSelectedAddress', suggestion);
4521
+ }
4379
4522
  this.addressIsValidated = (suggestion.hasOwnProperty('isComplete') && suggestion.isComplete === true) ? true : false;
4380
4523
  this.addressChanged.emit(suggestion);
4381
4524
  }
@@ -4606,6 +4749,11 @@ class BoxNumberComponent {
4606
4749
  isDisabled() {
4607
4750
  return (this.locality === '' || this.postalCode === '' || this.minLevel > ADDRESSLEVEL.BOX_NUMBER);
4608
4751
  }
4752
+ isDisabledByPrefill() {
4753
+ return this.prefillData !== null && this.prefillData !== undefined
4754
+ && this.prefillData.parameters !== null && this.prefillData.parameters !== undefined
4755
+ && !this.isValid(this.prefillData.parameters.boxNumber);
4756
+ }
4609
4757
  onInputClick() {
4610
4758
  if (this.showDebugMessageToConsole) {
4611
4759
  console.log('box number click');
@@ -4613,10 +4761,10 @@ class BoxNumberComponent {
4613
4761
  }
4614
4762
  }
4615
4763
  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 });
4616
- 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 } });
4764
+ 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 || isDisabledByPrefill()\" (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 } });
4617
4765
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: BoxNumberComponent, decorators: [{
4618
4766
  type: Component,
4619
- 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: [""] }]
4767
+ 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 || isDisabledByPrefill()\" (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: [""] }]
4620
4768
  }], ctorParameters: function () { return [{ type: AddressService }, { type: LocaleService }, { type: i3.TranslateService }, { type: UnicodeService }]; }, propDecorators: { boxNumberSearchInput: [{
4621
4769
  type: ViewChild,
4622
4770
  args: ['boxNumberSearchInput', { static: false }]
@@ -5200,6 +5348,11 @@ class LibAddressAutocompleteByComponentComponent {
5200
5348
  this.boxNumberAutofillData = this.autofillData;
5201
5349
  }
5202
5350
  }
5351
+ if (this.minLevel == ADDRESSLEVEL.BOX_NUMBER) {
5352
+ if (this.selectedAddress.boxNumber) {
5353
+ this.boxNumberAutofillData = this.autofillData;
5354
+ }
5355
+ }
5203
5356
  }
5204
5357
  this.addressCompleteEventEmitter.emit(this.selectedAddress);
5205
5358
  this.emittedAddress = this.selectedAddress;
@@ -5652,9 +5805,15 @@ class LibAddressAutocompleteByComponentComponent {
5652
5805
  this.autocompleteBoxNb.clearWidget();
5653
5806
  this.autocompleteBoxNb.searchText = '';
5654
5807
  */
5655
- this.autocompleteStreetNb.searchText = '';
5656
- this.autocompleteBoxNb.searchText = '';
5657
- this.autocompleteBoxNb.streetNumber = '';
5808
+ // Guard: only clear when street-number is not already validated.
5809
+ // resetStreet() always sets addressIsComplete=false before calling setAddress(null,3),
5810
+ // so user-initiated street changes are unaffected. Without this guard the post-prefill
5811
+ // autofill CD cycle clears searchText causing a inputText mismatch -> clearWidget().
5812
+ if (!this.autocompleteStreetNb.addressIsComplete) {
5813
+ this.autocompleteStreetNb.searchText = '';
5814
+ this.autocompleteBoxNb.searchText = '';
5815
+ this.autocompleteBoxNb.streetNumber = '';
5816
+ }
5658
5817
  break;
5659
5818
  // STREET Number
5660
5819
  case 2:
@@ -5735,8 +5894,23 @@ class LibAddressAutocompleteByComponentComponent {
5735
5894
  console.log('lib::setAddressStreetNumber - streetnumber: ', streetNumber);
5736
5895
  console.log('lib::setAddressStreetNumber - streetAddress: ', this.streetAddress);
5737
5896
  }
5738
- this.streetNumberAddress = this.streetAddress;
5739
- this.selectedAddress = this.streetAddress;
5897
+ if (this.suggestionLevel === SuggestionLevelType.None && this.streetAddress.streetNumber !== streetNumber) {
5898
+ const combined = Object.assign({}, this.streetAddress);
5899
+ delete combined.pdpId;
5900
+ delete combined.mailBoxid; // mixed-case variant
5901
+ delete combined.mailBoxId; // camelCase variant (internal API field name)
5902
+ delete combined.suffixId;
5903
+ delete combined.isComplete;
5904
+ if (combined.geoSanction) {
5905
+ combined.geoSanction = combined.geoSanction.substring(0, 25);
5906
+ }
5907
+ this.streetNumberAddress = combined;
5908
+ this.selectedAddress = combined;
5909
+ }
5910
+ else {
5911
+ this.streetNumberAddress = this.streetAddress;
5912
+ this.selectedAddress = this.streetAddress;
5913
+ }
5740
5914
  this.selectedAddress.houseNumber = streetNumber;
5741
5915
  this.selectedAddress.streetNumber = streetNumber;
5742
5916
  /*
@@ -5755,7 +5929,20 @@ class LibAddressAutocompleteByComponentComponent {
5755
5929
  setAddressBoxNumber(boxNumber) {
5756
5930
  console.log('set box number value:', boxNumber);
5757
5931
  //this.streetNumberAddress = this.streetAddress;
5758
- this.selectedAddress = this.streetNumberAddress;
5932
+ if ((this.suggestionLevel === SuggestionLevelType.None || this.suggestionLevel === SuggestionLevelType.StreetNumber) && this.streetNumberAddress.boxNumber !== boxNumber) {
5933
+ const combined = Object.assign({}, this.streetNumberAddress);
5934
+ delete combined.mailBoxid; // mixed-case variant
5935
+ delete combined.mailBoxId; // camelCase variant (internal API field name)
5936
+ delete combined.suffixId;
5937
+ delete combined.isComplete;
5938
+ if (combined.geoSanction) {
5939
+ combined.geoSanction = combined.geoSanction.substring(0, 35);
5940
+ }
5941
+ this.selectedAddress = combined;
5942
+ }
5943
+ else {
5944
+ this.selectedAddress = this.streetNumberAddress;
5945
+ }
5759
5946
  this.selectedAddress.boxNumber = boxNumber;
5760
5947
  this.boxNumber = boxNumber;
5761
5948
  this.notifyAddressComplete();
@@ -5871,7 +6058,23 @@ class LibAddressAutocompleteByComponentComponent {
5871
6058
  this.minLevel = ADDRESSLEVEL.STREET;
5872
6059
  const streetNumber = this.prefillData.parameters.streetNumber;
5873
6060
  const boxNumber = this.prefillData.parameters.boxNumber;
5874
- if (boxNumber && !address.boxNumber) {
6061
+ if (streetNumber) {
6062
+ // User has a streetNumber to prefill - trigger street-number prefill flow.
6063
+ // onStreetNumberPrefillEvent will handle the box number prefill if needed.
6064
+ this.prefillData.prefillStreetPerfectMatchFound = true;
6065
+ this.prefillData.prefillStreetPerfectMatchSuggestion = { address: Object.assign({}, address) };
6066
+ this.prefillData.parameters.minLevel = ADDRESSLEVEL.STREET_NUMBER;
6067
+ this.prefillData.parameters.streetName = address.streetName;
6068
+ this.prefillData.parameters.postalCode = address.postalCode;
6069
+ this.prefillData.parameters.municipalityName = address.localityName || address.municipalityName;
6070
+ this.streetNumberPrefillData = this.prefillData;
6071
+ // Do NOT set boxNumberPrefillData here: it shares the same prefillData reference,
6072
+ // which would immediately overwrite minLevel to BOX_NUMBER (1) before Angular
6073
+ // change detection runs, causing the street-number component to see minLevel=1
6074
+ // and skip its prefill. Let onStreetNumberPrefillEvent set up box number prefill.
6075
+ }
6076
+ else if (boxNumber && !address.boxNumber) {
6077
+ // No streetNumber to prefill: jump directly to box number prefill.
5875
6078
  this.prefillData.parameters.minLevel = ADDRESSLEVEL.BOX_NUMBER;
5876
6079
  this.boxNumberPrefillData = this.prefillData;
5877
6080
  }
@@ -5961,11 +6164,13 @@ class LibAddressAutocompleteByComponentComponent {
5961
6164
  if (this.showDebugMessageToConsole) {
5962
6165
  console.warn('lib::street: prefill - transmitting prefill data for streetNumber :', this.prefillData);
5963
6166
  }
5964
- if (address.houseNumber) {
6167
+ if (address.houseNumber && !streetNumber) {
6168
+ // No street number in prefill params: use the street suggestion's houseNumber via autofill
5965
6169
  this.setAddress(address, ADDRESSLEVEL.STREET);
5966
6170
  this.minLevel = ADDRESSLEVEL.STREET_NUMBER;
5967
6171
  }
5968
6172
  else {
6173
+ // Street number given in prefill params (or no houseNumber in suggestion): trigger street-number prefill
5969
6174
  this.streetNumberPrefillData = this.prefillData;
5970
6175
  }
5971
6176
  }
@@ -6001,10 +6206,35 @@ class LibAddressAutocompleteByComponentComponent {
6001
6206
  const addressIsComplete = address && address.hasOwnProperty('isComplete') && address.isComplete === true ? true : false;
6002
6207
  const addressIsNotInList = address && address.hasOwnProperty('not-in-list') && address['not-in-list'] === true ? true : false;
6003
6208
  if (addressIsComplete && !addressIsNotInList) {
6004
- // found address - perfect matchat street number level
6005
- // Nothing to do anymore
6006
- this.autocompleteStreetNb.addressIsComplete = true;
6007
- this.quitPrefillMode();
6209
+ // found address - perfect match at street number level
6210
+ const boxNumber = this.prefillData ? this.prefillData.parameters.boxNumber : null;
6211
+ if (this.notInListAllowed && boxNumber) {
6212
+ // User prefilled a box number and notInListAllowed - continue to box number prefill
6213
+ this.autocompleteStreetNb.addressIsComplete = true;
6214
+ this.addressParams.minLevel = ADDRESSLEVEL.BOX_NUMBER;
6215
+ this.prefillData = event.prefillData;
6216
+ this.prefillData.ts = new Date();
6217
+ this.prefillData.parameters.minLevel = ADDRESSLEVEL.BOX_NUMBER;
6218
+ const suggestionAddress = this.prefillData.prefillStreetNumberPerfectMatchSuggestion.address;
6219
+ this.prefillData.parameters.postalCode = suggestionAddress.postalCode;
6220
+ this.prefillData.parameters.streetName = suggestionAddress.streetName;
6221
+ this.prefillData.parameters.streetNumber = suggestionAddress.houseNumber;
6222
+ this.prefillData.parameters.municipalityName = suggestionAddress.localityName;
6223
+ this.updatePostalCodeLocality(address);
6224
+ this.updateStreetName(address);
6225
+ this.updateStreetNumber(address);
6226
+ this.streetAddress = address;
6227
+ this.streetNumberAddress = address;
6228
+ this.autocompleteBoxNb.streetNumber = address.houseNumber;
6229
+ this.autocompleteBoxNb.searchText = '';
6230
+ this.boxNumberPrefillData = this.prefillData;
6231
+ }
6232
+ else {
6233
+ // Nothing to do anymore
6234
+ this.autocompleteStreetNb.addressIsComplete = true;
6235
+ this.setAddress(address, ADDRESSLEVEL.STREET_NUMBER);
6236
+ this.quitPrefillMode();
6237
+ }
6008
6238
  }
6009
6239
  else {
6010
6240
  this.addressParams.minLevel = ADDRESSLEVEL.BOX_NUMBER;
@@ -6098,13 +6328,52 @@ class LibAddressAutocompleteByComponentComponent {
6098
6328
  const address = suggestion.address;
6099
6329
  this.updateStreetNumber(address);
6100
6330
  this.autocompleteStreetNb.selectedAddress = address;
6331
+ // Directly set the child input field to the API-returned house number.
6332
+ // This is critical when the prefilled number was invalid (e.g. 145896 → 56):
6333
+ // it ensures searchText='56' before quitPrefillMode() clears the prefilling flag,
6334
+ // so that Angular CD's ngOnChanges(inputText:'145896'→'56') sees matching values
6335
+ // and does NOT trigger clearWidget().
6336
+ if (address.houseNumber) {
6337
+ this.autocompleteStreetNb.searchText = address.houseNumber;
6338
+ }
6101
6339
  const addressIsComplete = address && address.hasOwnProperty('isComplete') && !address.hasOwnProperty('boxNumber') && address.isComplete === true ? true : false;
6102
6340
  const addressIsNotInList = address && address.hasOwnProperty('not-in-list') && address['not-in-list'] === true ? true : false;
6103
6341
  if (addressIsComplete && !addressIsNotInList) {
6104
- // found address - perfect matchat street number level
6105
- // Nothing to do anymore
6106
- this.autocompleteStreetNb.addressIsComplete = true;
6107
- this.quitPrefillMode();
6342
+ // found address - perfect match at street number level
6343
+ const boxNumber = this.prefillData ? this.prefillData.parameters.boxNumber : null;
6344
+ if (boxNumber && this.notInListAllowed) {
6345
+ // A boxNumber is present in prefill params AND notInListAllowed - continue to box number prefill.
6346
+ // When notInListAllowed=false, the address is already complete without a box number;
6347
+ // any prefilled box number is invalid and the API call must be skipped.
6348
+ this.autocompleteStreetNb.addressIsComplete = true;
6349
+ this.addressParams.minLevel = ADDRESSLEVEL.BOX_NUMBER;
6350
+ this.prefillData = event.prefillData;
6351
+ this.prefillData.ts = new Date();
6352
+ this.prefillData.parameters.minLevel = ADDRESSLEVEL.BOX_NUMBER;
6353
+ const suggestionAddress = this.prefillData.prefillStreetNumberPerfectMatchSuggestion.address;
6354
+ this.prefillData.parameters.municipalityName = suggestionAddress.localityName;
6355
+ this.prefillData.parameters.postalCode = suggestionAddress.postalCode;
6356
+ this.prefillData.parameters.streetName = suggestionAddress.streetName;
6357
+ this.prefillData.parameters.streetNumber = suggestionAddress.houseNumber;
6358
+ this.updatePostalCodeLocality(address);
6359
+ this.updateStreetName(address);
6360
+ this.updateStreetNumber(address);
6361
+ this.streetAddress = address;
6362
+ this.streetNumberAddress = address;
6363
+ this.autocompleteBoxNb.streetNumber = address.houseNumber;
6364
+ this.autocompleteBoxNb.searchText = '';
6365
+ this.boxNumberPrefillData = this.prefillData;
6366
+ }
6367
+ else {
6368
+ this.setAddress(address, ADDRESSLEVEL.STREET_NUMBER);
6369
+ // address.isComplete===true, so setAddress() correctly sets addressIsComplete=true
6370
+ // and the check mark should be visible. Do NOT suppress it here.
6371
+ // Null out autofill data so Angular CD does not re-trigger ngOnChanges(autofillData)
6372
+ // on the street-number child, which would call setSelectedAddress and set
6373
+ // addressIsComplete=true again via the autofill chain.
6374
+ this.streetNumberAutofillData = null;
6375
+ this.quitPrefillMode();
6376
+ }
6108
6377
  }
6109
6378
  else {
6110
6379
  this.addressParams.minLevel = ADDRESSLEVEL.BOX_NUMBER;
@@ -6124,8 +6393,16 @@ class LibAddressAutocompleteByComponentComponent {
6124
6393
  // this.updatePostalCodeLocality(suggestionAddress);
6125
6394
  const boxNumber = this.prefillData.parameters.boxNumber;
6126
6395
  if (!addressIsNotInList && (boxNumber === null || boxNumber === undefined || boxNumber === '')) {
6396
+ // No box number in prefill params and the API reports isComplete=false (box number required).
6397
+ // Do NOT start box-number prefill: when boxNumber param is empty, the box-number
6398
+ // component receives searchText='' and never fires its prefill event, so
6399
+ // quitPrefillMode() would never be called, leaving prefilling=true forever.
6400
+ // Since isComplete=false the address is not complete — do NOT force addressIsComplete=true;
6401
+ // setAddress() will correctly leave the street-number checkmark unset, and the user
6402
+ // must enter the box number manually.
6127
6403
  this.setAddress(address, ADDRESSLEVEL.STREET_NUMBER);
6128
- // this.quitPrefillMode();
6404
+ this.quitPrefillMode();
6405
+ return;
6129
6406
  }
6130
6407
  else {
6131
6408
  this.updatePostalCodeLocality(address);
@@ -6147,33 +6424,32 @@ class LibAddressAutocompleteByComponentComponent {
6147
6424
  }
6148
6425
  this.autocompleteBoxNb.searchText = '';
6149
6426
  }
6150
- /*
6151
- const boxNumber = this.prefillData.parameters.boxNumber;
6152
- if ( ! addressIsNotInList && (boxNumber === null || boxNumber === undefined || boxNumber === '') )
6153
- {
6154
- this.setAddress(address, ADDRESSLEVEL.STREET_NUMBER);
6155
- this.quitPrefillMode();
6156
- }
6157
- else
6158
- {
6159
- if (this.showDebugMessageToConsole) { console.log('lib::prefill: trigger checking box number match... ', this.prefillData); }
6160
- this.boxNumberPrefillData = this.prefillData;
6161
- }
6162
- */
6163
6427
  this.boxNumberPrefillData = this.prefillData;
6164
6428
  }
6165
6429
  }
6166
6430
  else {
6167
6431
  const prefillStreetNumber = this.prefillData.parameters.streetNumber;
6168
- const address = this.prefillData.prefillStreetPerfectMatchSuggestion.address;
6432
+ const address = this.prefillData.prefillStreetPerfectMatchSuggestion
6433
+ ? this.prefillData.prefillStreetPerfectMatchSuggestion.address
6434
+ : null;
6169
6435
  this.autocompleteBoxNb.streetNumber = '';
6170
6436
  if (prefillStreetNumber === null || prefillStreetNumber === undefined || prefillStreetNumber.length === 0) {
6171
6437
  this.setAddress(address, ADDRESSLEVEL.STREET);
6172
6438
  }
6173
6439
  else {
6174
- // address.houseNumber = prefillStreetNumber;
6175
- address.searchBarString = prefillStreetNumber;
6176
- this.setAddress(address, ADDRESSLEVEL.STREET_NUMBER);
6440
+ // The prefilled street number doesn't exist in the API (notInListAllowed=false).
6441
+ // Show the prefilled value in the input and leave the dropdown open so the
6442
+ // user can pick the correct house number from the suggestions.
6443
+ this.autocompleteStreetNb.searchText = prefillStreetNumber;
6444
+ // Keep streetNumberInput in sync with searchText so the child's inputText
6445
+ // ngOnChanges guard (notEqualIgnoreCase) does not trigger clearWidget()
6446
+ // once prefilling becomes false after quitPrefillMode().
6447
+ this.streetNumberInput = prefillStreetNumber;
6448
+ this.autocompleteStreetNb.isPrefillWithNoMatch = false;
6449
+ this.autocompleteStreetNb.addressIsComplete = false;
6450
+ this.autocompleteBoxNb.streetNumber = '';
6451
+ // Prevent the autofill Angular-CD chain from re-setting addressIsComplete=true.
6452
+ this.streetNumberAutofillData = null;
6177
6453
  }
6178
6454
  this.quitPrefillMode();
6179
6455
  }
@@ -6186,18 +6462,48 @@ class LibAddressAutocompleteByComponentComponent {
6186
6462
  if (data.prefillBoxNumberPerfectMatchFound === true) {
6187
6463
  const suggestion = data.prefillBoxNumberPerfectMatchSuggestion;
6188
6464
  const address = suggestion.address;
6465
+ // When notInListAllowed, ensure user's prefilled values are used
6466
+ if (this.notInListAllowed) {
6467
+ if (this.prefillData.parameters.streetNumber) {
6468
+ address.houseNumber = this.prefillData.parameters.streetNumber;
6469
+ }
6470
+ if (this.prefillData.parameters.boxNumber) {
6471
+ address.boxNumber = this.prefillData.parameters.boxNumber;
6472
+ }
6473
+ }
6189
6474
  this.autocompleteBoxNb.selectedAddress = address;
6190
6475
  this.setAddress(address, ADDRESSLEVEL.BOX_NUMBER);
6191
6476
  }
6192
6477
  else {
6193
6478
  const prefillBoxNumber = this.prefillData.parameters.boxNumber;
6194
- const address = this.prefillData.prefillStreetNumberPerfectMatchSuggestion.address;
6479
+ const address = this.prefillData.prefillStreetNumberPerfectMatchSuggestion
6480
+ ? this.prefillData.prefillStreetNumberPerfectMatchSuggestion.address
6481
+ : null;
6195
6482
  if (prefillBoxNumber === null || prefillBoxNumber === undefined || prefillBoxNumber.length === 0) {
6196
6483
  this.setAddress(address, ADDRESSLEVEL.STREET_NUMBER);
6197
6484
  }
6198
- else {
6199
- // address.boxNumber = prefillBoxNumber;
6485
+ else if (address) {
6486
+ address.boxNumber = prefillBoxNumber;
6487
+ if (this.notInListAllowed && this.prefillData.parameters.streetNumber) {
6488
+ address.houseNumber = this.prefillData.parameters.streetNumber;
6489
+ }
6200
6490
  address.searchBarString = prefillBoxNumber;
6491
+ // For internal endpoint: clear IDs that are no longer valid when box number is not in the list.
6492
+ // - mailBoxId and suffixId are always cleared (valid street number + invalid box number).
6493
+ // - pdpId is also cleared when street number was also not-in-list (both invalid).
6494
+ const streetNumberWasNotInList = address.hasOwnProperty('not-in-list') && address['not-in-list'] === true;
6495
+ address.mailBoxId = null;
6496
+ address.mailBoxid = null;
6497
+ address.suffixId = null;
6498
+ if (address.geoSanction) {
6499
+ address.geoSanction = address.geoSanction.substring(0, 35);
6500
+ }
6501
+ if (streetNumberWasNotInList) {
6502
+ address.pdpId = null;
6503
+ if (address.geoSanction) {
6504
+ address.geoSanction = address.geoSanction.substring(0, 25);
6505
+ }
6506
+ }
6201
6507
  this.setAddress(address, ADDRESSLEVEL.BOX_NUMBER);
6202
6508
  }
6203
6509
  }
@@ -6211,29 +6517,68 @@ class LibAddressAutocompleteByComponentComponent {
6211
6517
  if (data.prefillBoxNumberPerfectMatchFound === true) {
6212
6518
  const suggestion = data.prefillBoxNumberPerfectMatchSuggestion;
6213
6519
  const address = suggestion.address;
6520
+ // When notInListAllowed, ensure user's prefilled values are used
6521
+ if (this.notInListAllowed) {
6522
+ if (this.prefillData.parameters.streetNumber) {
6523
+ address.houseNumber = this.prefillData.parameters.streetNumber;
6524
+ }
6525
+ if (this.prefillData.parameters.boxNumber) {
6526
+ address.boxNumber = this.prefillData.parameters.boxNumber;
6527
+ }
6528
+ }
6214
6529
  this.autocompleteBoxNb.selectedAddress = address;
6215
6530
  this.setAddress(address, ADDRESSLEVEL.BOX_NUMBER);
6216
6531
  }
6217
6532
  else {
6218
6533
  const prefillBoxNumber = this.prefillData.parameters.boxNumber;
6219
- const address = this.prefillData.prefillStreetNumberPerfectMatchSuggestion.address;
6534
+ const address = this.prefillData.prefillStreetNumberPerfectMatchSuggestion
6535
+ ? this.prefillData.prefillStreetNumberPerfectMatchSuggestion.address
6536
+ : null;
6220
6537
  if (prefillBoxNumber === null || prefillBoxNumber === undefined || prefillBoxNumber.length === 0) {
6221
6538
  this.setAddress(address, ADDRESSLEVEL.STREET_NUMBER);
6222
6539
  }
6223
- else {
6224
- // address.boxNumber = prefillBoxNumber;
6225
- address.searchBarString = prefillBoxNumber;
6226
- this.setAddress(address, ADDRESSLEVEL.BOX_NUMBER);
6540
+ else if (address) {
6541
+ if (!this.notInListAllowed) {
6542
+ // notInListAllowed=false: the box number is invalid and must not appear in the
6543
+ // selected address or address component. Complete the address at street-number
6544
+ // level so the emitted address contains only the valid street number.
6545
+ this.setAddress(address, ADDRESSLEVEL.STREET_NUMBER);
6546
+ }
6547
+ else {
6548
+ // notInListAllowed=true: include the prefilled box number as-is (not-in-list)
6549
+ address.boxNumber = prefillBoxNumber;
6550
+ if (this.prefillData.parameters.streetNumber) {
6551
+ address.houseNumber = this.prefillData.parameters.streetNumber;
6552
+ }
6553
+ address.searchBarString = prefillBoxNumber;
6554
+ // For internal endpoint: clear IDs that are no longer valid when box number is not in the list.
6555
+ // - mailBoxId and suffixId are always cleared (valid street number + invalid box number).
6556
+ // - pdpId is also cleared when street number was also not-in-list (both invalid).
6557
+ const streetNumberWasNotInList = address.hasOwnProperty('not-in-list') && address['not-in-list'] === true;
6558
+ address.mailBoxId = null;
6559
+ address.mailBoxid = null;
6560
+ address.suffixId = null;
6561
+ if (address.geoSanction) {
6562
+ address.geoSanction = address.geoSanction.substring(0, 35);
6563
+ }
6564
+ if (streetNumberWasNotInList) {
6565
+ address.pdpId = null;
6566
+ if (address.geoSanction) {
6567
+ address.geoSanction = address.geoSanction.substring(0, 25);
6568
+ }
6569
+ }
6570
+ this.setAddress(address, ADDRESSLEVEL.BOX_NUMBER);
6571
+ }
6227
6572
  }
6228
6573
  }
6229
6574
  this.quitPrefillMode();
6230
6575
  }
6231
6576
  }
6232
6577
  LibAddressAutocompleteByComponentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: LibAddressAutocompleteByComponentComponent, deps: [{ token: HttpService }], target: i0.ɵɵFactoryTarget.Component });
6233
- 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", includeListOfBoxes: "includeListOfBoxes", includeListOfBusinessNameWithBoxes: "includeListOfBusinessNameWithBoxes" }, 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 [includeListOfBoxes]=\"includeListOfBoxes\"\r\n [includeListOfBusinessNameWithBoxes]=\"includeListOfBusinessNameWithBoxes\"\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 [nis9InResponse]=\"nis9InResponse\"\r\n [businessNameInResponse]=\"businessNameInResponse\"\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 [includeListOfBoxes]=\"includeListOfBoxes\"\r\n [includeListOfBusinessNameWithBoxes]=\"includeListOfBusinessNameWithBoxes\"\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 [includeListOfBoxes]=\"includeListOfBoxes\"\r\n [includeListOfBusinessNameWithBoxes]=\"includeListOfBusinessNameWithBoxes\"\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", "includeListOfBoxes", "includeListOfBusinessNameWithBoxes", "nis9InResponse", "businessNameInResponse", "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", "includeListOfBoxes", "includeListOfBusinessNameWithBoxes", "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", "includeListOfBoxes", "includeListOfBusinessNameWithBoxes", "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"] }] });
6578
+ 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", includeListOfBoxes: "includeListOfBoxes", includeListOfBusinessNameWithBoxes: "includeListOfBusinessNameWithBoxes" }, 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 [includeListOfBoxes]=\"includeListOfBoxes\"\r\n [includeListOfBusinessNameWithBoxes]=\"includeListOfBusinessNameWithBoxes\"\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\t\t[nis9InResponse]=\"nis9InResponse\"\r\n [businessNameInResponse]=\"businessNameInResponse\"\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 [includeListOfBoxes]=\"includeListOfBoxes\"\r\n [includeListOfBusinessNameWithBoxes]=\"includeListOfBusinessNameWithBoxes\"\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 [includeListOfBoxes]=\"includeListOfBoxes\"\r\n [includeListOfBusinessNameWithBoxes]=\"includeListOfBusinessNameWithBoxes\"\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", "includeListOfBoxes", "includeListOfBusinessNameWithBoxes", "nis9InResponse", "businessNameInResponse", "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", "includeListOfBoxes", "includeListOfBusinessNameWithBoxes", "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", "includeListOfBoxes", "includeListOfBusinessNameWithBoxes", "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"] }] });
6234
6579
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: LibAddressAutocompleteByComponentComponent, decorators: [{
6235
6580
  type: Component,
6236
- 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 [includeListOfBoxes]=\"includeListOfBoxes\"\r\n [includeListOfBusinessNameWithBoxes]=\"includeListOfBusinessNameWithBoxes\"\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 [nis9InResponse]=\"nis9InResponse\"\r\n [businessNameInResponse]=\"businessNameInResponse\"\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 [includeListOfBoxes]=\"includeListOfBoxes\"\r\n [includeListOfBusinessNameWithBoxes]=\"includeListOfBusinessNameWithBoxes\"\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 [includeListOfBoxes]=\"includeListOfBoxes\"\r\n [includeListOfBusinessNameWithBoxes]=\"includeListOfBusinessNameWithBoxes\"\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: [""] }]
6581
+ 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 [includeListOfBoxes]=\"includeListOfBoxes\"\r\n [includeListOfBusinessNameWithBoxes]=\"includeListOfBusinessNameWithBoxes\"\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\t\t[nis9InResponse]=\"nis9InResponse\"\r\n [businessNameInResponse]=\"businessNameInResponse\"\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 [includeListOfBoxes]=\"includeListOfBoxes\"\r\n [includeListOfBusinessNameWithBoxes]=\"includeListOfBusinessNameWithBoxes\"\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 [includeListOfBoxes]=\"includeListOfBoxes\"\r\n [includeListOfBusinessNameWithBoxes]=\"includeListOfBusinessNameWithBoxes\"\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: [""] }]
6237
6582
  }], ctorParameters: function () { return [{ type: HttpService }]; }, propDecorators: { autocompleteLocality: [{
6238
6583
  type: ViewChild,
6239
6584
  args: [LocalityComponent, { static: false }]