@bpost/bp-address-auto-complete-by-component 1.1.29 → 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.
- package/VERSION.md +3 -0
- package/esm2020/lib/box-number/box-number.component.mjs +87 -16
- package/esm2020/lib/lib-address-autocomplete-by-component.component.mjs +242 -45
- package/esm2020/lib/locality/locality.component.mjs +1 -1
- package/esm2020/lib/street-number/street-number.component.mjs +95 -30
- package/fesm2015/bpost-bp-address-auto-complete-by-component.mjs +421 -88
- package/fesm2015/bpost-bp-address-auto-complete-by-component.mjs.map +1 -1
- package/fesm2020/bpost-bp-address-auto-complete-by-component.mjs +421 -88
- package/fesm2020/bpost-bp-address-auto-complete-by-component.mjs.map +1 -1
- package/lib/box-number/box-number.component.d.ts +1 -1
- package/package.json +1 -1
|
@@ -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,7 +2765,7 @@ class StreetNumberComponent {
|
|
|
2769
2765
|
}
|
|
2770
2766
|
onFocus() {
|
|
2771
2767
|
this.collapseDropdown = false;
|
|
2772
|
-
if (this.prefillData !== null && this.prefillData.prefillStreetNumberPerfectMatchFound != false) {
|
|
2768
|
+
if (this.prefillData !== null && this.prefillData.prefillStreetNumberPerfectMatchFound != false && this.addressIsComplete) {
|
|
2773
2769
|
this.collapseDropdown = true;
|
|
2774
2770
|
}
|
|
2775
2771
|
// this.collapseDropdown = (this.prefilling === true && this.prefillData !== null)
|
|
@@ -2850,6 +2846,10 @@ class StreetNumberComponent {
|
|
|
2850
2846
|
*/
|
|
2851
2847
|
// this.addressIsComplete = this.prefillData.prefillStreetNumberPerfectMatchFound === true ? true : false;
|
|
2852
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
|
+
}
|
|
2853
2853
|
this.prefillAnalyzeData();
|
|
2854
2854
|
}
|
|
2855
2855
|
else {
|
|
@@ -3018,8 +3018,7 @@ class StreetNumberComponent {
|
|
|
3018
3018
|
}
|
|
3019
3019
|
}
|
|
3020
3020
|
else {
|
|
3021
|
-
//
|
|
3022
|
-
// 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
|
|
3023
3022
|
if (this.prefilling && this.notInListAllowed
|
|
3024
3023
|
&& this.prefillData.prefillStreetNumberPerfectMatchFound === false
|
|
3025
3024
|
&& this.prefillData.prefillStreetNumber !== null
|
|
@@ -3032,6 +3031,33 @@ class StreetNumberComponent {
|
|
|
3032
3031
|
}
|
|
3033
3032
|
this.prefillCheckForPerfectMatch(suggestion);
|
|
3034
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
|
+
}
|
|
3035
3061
|
}
|
|
3036
3062
|
}
|
|
3037
3063
|
else {
|
|
@@ -3042,8 +3068,13 @@ class StreetNumberComponent {
|
|
|
3042
3068
|
const notInListSuggestion = { string: this.searchText, 'not-in-list': true };
|
|
3043
3069
|
const streetSuggestion = this.prefillData.prefillStreetPerfectMatchSuggestion;
|
|
3044
3070
|
const combined = Object.assign(Object.assign({}, streetSuggestion.address), notInListSuggestion);
|
|
3045
|
-
delete combined.mailBoxid;
|
|
3071
|
+
delete combined.mailBoxid; // mixed-case variant
|
|
3072
|
+
delete combined.mailBoxId; // camelCase variant (internal API field name)
|
|
3073
|
+
delete combined.pdpId;
|
|
3046
3074
|
delete combined.suffixId;
|
|
3075
|
+
if (combined.geoSanction) {
|
|
3076
|
+
combined.geoSanction = combined.geoSanction.substring(0, 25);
|
|
3077
|
+
}
|
|
3047
3078
|
// combined.boxNumber = combined.string;
|
|
3048
3079
|
combined.houseNumber = combined.string;
|
|
3049
3080
|
combined.searchBarString = combined.string;
|
|
@@ -3090,7 +3121,13 @@ class StreetNumberComponent {
|
|
|
3090
3121
|
suggestion.address = suggestionToAdd;
|
|
3091
3122
|
this.prefillCheckForPerfectMatch(suggestion);
|
|
3092
3123
|
}
|
|
3093
|
-
|
|
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) {
|
|
3094
3131
|
suggestion.address = suggestionToAdd;
|
|
3095
3132
|
const isPerfectMatch = this.checkForPerfectMatch(suggestion);
|
|
3096
3133
|
if (!isPerfectMatch) {
|
|
@@ -3102,25 +3139,22 @@ class StreetNumberComponent {
|
|
|
3102
3139
|
}
|
|
3103
3140
|
checkForPerfectMatch(suggestion) {
|
|
3104
3141
|
if (!this.addressIsComplete) {
|
|
3105
|
-
// if (this.showDebugMessageToConsole) {
|
|
3106
|
-
console.log('streetNumber - checking suggestion for perfect match', suggestion, this.searchText);
|
|
3107
|
-
// }
|
|
3108
3142
|
const sugAddress = suggestion.address;
|
|
3109
3143
|
const suggestionStreetNumber = this.transformStreetNumberInLowercaseAndWithoutDiacritics('' + sugAddress.houseNumber);
|
|
3110
3144
|
if (suggestionStreetNumber === ('' + this.searchText)) {
|
|
3111
3145
|
this.searchText = sugAddress.houseNumber;
|
|
3112
3146
|
if (sugAddress.hasOwnProperty('isComplete') && sugAddress.isComplete === true) {
|
|
3113
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;
|
|
3114
3151
|
this.addressIsComplete = true;
|
|
3115
|
-
// console.log('streetNumber::prefillCheckForPerfectMatch', this.addressIsComplete);
|
|
3116
|
-
// if (this.showDebugMessageToConsole && this.addressIsComplete === true) {
|
|
3117
|
-
console.log('ADDRESS COMPLETE ON STREET NUMBER !');
|
|
3118
|
-
// }
|
|
3119
3152
|
return true;
|
|
3120
3153
|
}
|
|
3121
3154
|
else {
|
|
3122
3155
|
if (this.suggestionLevel !== SuggestionLevelType.StreetNumber && this.suggestionLevel !== SuggestionLevelType.StreetAndBoxNumber) {
|
|
3123
3156
|
this.clickSuggestion(null, sugAddress); // house number found
|
|
3157
|
+
this.searchText = sugAddress.houseNumber;
|
|
3124
3158
|
}
|
|
3125
3159
|
}
|
|
3126
3160
|
}
|
|
@@ -3148,11 +3182,10 @@ class StreetNumberComponent {
|
|
|
3148
3182
|
this.searchText = sugAddress.houseNumber;
|
|
3149
3183
|
if (sugAddress.hasOwnProperty('isComplete') && sugAddress.isComplete === true) {
|
|
3150
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;
|
|
3151
3188
|
this.addressIsComplete = true;
|
|
3152
|
-
// console.log('streetNumber::prefillCheckForPerfectMatch', this.addressIsComplete);
|
|
3153
|
-
// if (this.showDebugMessageToConsole && this.addressIsComplete === true) {
|
|
3154
|
-
console.log('ADDRESS COMPLETE ON STREET NUMBER !');
|
|
3155
|
-
// }
|
|
3156
3189
|
}
|
|
3157
3190
|
}
|
|
3158
3191
|
}
|
|
@@ -3187,7 +3220,6 @@ class StreetNumberComponent {
|
|
|
3187
3220
|
this.consumedNumber = this.sequenceNumber;
|
|
3188
3221
|
this.clearSuggestions();
|
|
3189
3222
|
if (this.suggestionLevel === SuggestionLevelType.None) {
|
|
3190
|
-
console.log('(A) do not use suggestions for street number');
|
|
3191
3223
|
this.streetNumberChanged.emit(this.searchText);
|
|
3192
3224
|
if (source === SourceType.SOURCE_PREFILLED)
|
|
3193
3225
|
this.prefillAnalyzeData();
|
|
@@ -3195,7 +3227,6 @@ class StreetNumberComponent {
|
|
|
3195
3227
|
}
|
|
3196
3228
|
else {
|
|
3197
3229
|
if (this.suggestionLevel === SuggestionLevelType.None) {
|
|
3198
|
-
console.log('(B) do not use suggestions for street number');
|
|
3199
3230
|
this.streetNumberChanged.emit(this.searchText);
|
|
3200
3231
|
if (source === SourceType.SOURCE_PREFILLED)
|
|
3201
3232
|
this.prefillAnalyzeData();
|
|
@@ -3232,6 +3263,7 @@ class StreetNumberComponent {
|
|
|
3232
3263
|
this.resetArrowSelectedIndex();
|
|
3233
3264
|
if (!source) {
|
|
3234
3265
|
this.prefilling = false;
|
|
3266
|
+
this.isPrefillWithNoMatch = false;
|
|
3235
3267
|
if (this.showDebugMessageToConsole) {
|
|
3236
3268
|
console.log('streetNumber::onInputChange -> calling valueChanged');
|
|
3237
3269
|
}
|
|
@@ -3243,7 +3275,6 @@ class StreetNumberComponent {
|
|
|
3243
3275
|
this.consumedNumber = this.sequenceNumber;
|
|
3244
3276
|
this.clearSuggestions();
|
|
3245
3277
|
if (this.suggestionLevel === SuggestionLevelType.None) {
|
|
3246
|
-
console.log('(A) do not use suggestions for street number');
|
|
3247
3278
|
this.streetNumberChanged.emit(this.searchText);
|
|
3248
3279
|
if (source === SourceType.SOURCE_PREFILLED)
|
|
3249
3280
|
this.prefillAnalyzeData();
|
|
@@ -3251,7 +3282,6 @@ class StreetNumberComponent {
|
|
|
3251
3282
|
}
|
|
3252
3283
|
else {
|
|
3253
3284
|
if (this.suggestionLevel === SuggestionLevelType.None) {
|
|
3254
|
-
console.log('(B) do not use suggestions for street number');
|
|
3255
3285
|
this.streetNumberChanged.emit(this.searchText);
|
|
3256
3286
|
if (source === SourceType.SOURCE_PREFILLED) {
|
|
3257
3287
|
this.prefillData.prefillStreetNumberPerfectMatchFound = true;
|
|
@@ -3303,6 +3333,38 @@ class StreetNumberComponent {
|
|
|
3303
3333
|
}
|
|
3304
3334
|
}
|
|
3305
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
|
+
}
|
|
3306
3368
|
this.getTopSuggestions(source);
|
|
3307
3369
|
}
|
|
3308
3370
|
}
|
|
@@ -3332,7 +3394,7 @@ class StreetNumberComponent {
|
|
|
3332
3394
|
console.log('streetNumber::clickSuggestion - NOT-IN-LIST', event, suggestion);
|
|
3333
3395
|
}
|
|
3334
3396
|
}
|
|
3335
|
-
if (suggestion.hasOwnProperty('isComplete') && suggestion.isComplete === true && !isNotInList && !suggestion.
|
|
3397
|
+
if (suggestion.hasOwnProperty('isComplete') && suggestion.isComplete === true && !isNotInList && !suggestion.boxNumber) {
|
|
3336
3398
|
this.addressIsComplete = true;
|
|
3337
3399
|
// this.notifyAddressIsValidated();
|
|
3338
3400
|
}
|
|
@@ -3355,6 +3417,9 @@ class StreetNumberComponent {
|
|
|
3355
3417
|
delete combined.suffixId;
|
|
3356
3418
|
delete combined.pdpId;
|
|
3357
3419
|
delete combined.pdpId;
|
|
3420
|
+
if (combined.geoSanction) {
|
|
3421
|
+
combined.geoSanction = combined.geoSanction.substring(0, 25);
|
|
3422
|
+
}
|
|
3358
3423
|
combined.houseNumber = combined.string;
|
|
3359
3424
|
combined.searchBarString = combined.string;
|
|
3360
3425
|
combined.isComplete = true;
|
|
@@ -3364,7 +3429,7 @@ class StreetNumberComponent {
|
|
|
3364
3429
|
// console.log('street number - emit suggestion', suggestion);
|
|
3365
3430
|
const notInList = suggestion['not-in-list'];
|
|
3366
3431
|
const isNotInList = notInList !== null && notInList !== undefined && notInList === true;
|
|
3367
|
-
this.addressIsComplete = (suggestion.hasOwnProperty('isComplete') && suggestion.isComplete === true && !isNotInList && !suggestion.
|
|
3432
|
+
this.addressIsComplete = (suggestion.hasOwnProperty('isComplete') && suggestion.isComplete === true && !isNotInList && !suggestion.boxNumber) ? true : false;
|
|
3368
3433
|
this.addressChanged.emit(suggestion);
|
|
3369
3434
|
}
|
|
3370
3435
|
/*
|
|
@@ -3777,9 +3842,14 @@ class BoxNumberComponent {
|
|
|
3777
3842
|
}
|
|
3778
3843
|
ngOnChanges(changes) {
|
|
3779
3844
|
if (changes) {
|
|
3780
|
-
if (changes.hasOwnProperty('autofillData') && changes.autofillData.currentValue !== null && changes.autofillData.currentValue !== undefined
|
|
3781
|
-
this.
|
|
3782
|
-
|
|
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
|
+
}
|
|
3783
3853
|
}
|
|
3784
3854
|
else {
|
|
3785
3855
|
if (changes.hasOwnProperty('prefillData') && !changes.prefillData.firstChange) {
|
|
@@ -3787,11 +3857,28 @@ class BoxNumberComponent {
|
|
|
3787
3857
|
this.searchText = this.loadParams(changes.prefillData.currentValue);
|
|
3788
3858
|
if (this.searchText !== '' && this.minLevel === ADDRESSLEVEL.BOX_NUMBER) {
|
|
3789
3859
|
// this.onInputChange('prefilled');
|
|
3790
|
-
// this.boxNumberSearchInput.nativeElement.focus();
|
|
3791
3860
|
this.collapseDropdown = true;
|
|
3792
3861
|
this.prefillData.prefillBoxNumber
|
|
3793
3862
|
= this.transformBoxNumberInLowercaseAndWithoutDiacritics(this.prefillData.parameters.boxNumber);
|
|
3794
|
-
|
|
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);
|
|
3795
3882
|
}
|
|
3796
3883
|
}
|
|
3797
3884
|
if (changes.hasOwnProperty('streetNumber') && !changes.streetNumber.firstChange && !changes.hasOwnProperty('prefillData')) {
|
|
@@ -3931,11 +4018,24 @@ class BoxNumberComponent {
|
|
|
3931
4018
|
console.log('BOX-NUMBER calling service params', param);
|
|
3932
4019
|
}
|
|
3933
4020
|
if (this.searchText) {
|
|
4021
|
+
this.addressIsValidated = false;
|
|
3934
4022
|
this.subscription = this.addressService.getBox(this.baseUrl, this.locality, this.postalCode, param)
|
|
3935
4023
|
.subscribe(response => {
|
|
3936
4024
|
this.handleGetBoxResponse(response, source);
|
|
3937
4025
|
if (source === SourceType.SOURCE_PREFILLED) {
|
|
3938
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
|
+
}
|
|
3939
4039
|
this.prefillAnalyzeData();
|
|
3940
4040
|
}
|
|
3941
4041
|
else {
|
|
@@ -4129,10 +4229,12 @@ class BoxNumberComponent {
|
|
|
4129
4229
|
&& this.prefillData.prefillBoxNumber.length > 0) {
|
|
4130
4230
|
// const notInListSuggestion = {string: this.searchText, 'not-in-list': true};
|
|
4131
4231
|
const suggestion = this.prefillBuildNotInListSuggestion();
|
|
4132
|
-
if (
|
|
4133
|
-
|
|
4232
|
+
if (suggestion) {
|
|
4233
|
+
if (this.showDebugMessageToConsole) {
|
|
4234
|
+
console.log('BOX NUMBER - PREFILL NOT IN LIST SUGGESTION:', suggestion);
|
|
4235
|
+
}
|
|
4236
|
+
this.prefillCheckForPerfectMatch(suggestion);
|
|
4134
4237
|
}
|
|
4135
|
-
this.prefillCheckForPerfectMatch(suggestion);
|
|
4136
4238
|
}
|
|
4137
4239
|
}
|
|
4138
4240
|
}
|
|
@@ -4143,9 +4245,25 @@ class BoxNumberComponent {
|
|
|
4143
4245
|
prefillBuildNotInListSuggestion() {
|
|
4144
4246
|
const notInListSuggestion = { string: this.searchText, 'not-in-list': true };
|
|
4145
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;
|
|
4146
4254
|
const combined = Object.assign(Object.assign({}, streetNumberSuggestion.address), notInListSuggestion);
|
|
4147
|
-
delete combined.mailBoxid;
|
|
4255
|
+
delete combined.mailBoxid; // mixed-case variant
|
|
4256
|
+
delete combined.mailBoxId; // camelCase variant (internal API field name)
|
|
4148
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
|
+
}
|
|
4149
4267
|
combined.boxNumber = combined.string;
|
|
4150
4268
|
combined.searchBarString = combined.string;
|
|
4151
4269
|
combined.isComplete = true;
|
|
@@ -4179,7 +4297,11 @@ class BoxNumberComponent {
|
|
|
4179
4297
|
suggestion.address = suggestionToAdd;
|
|
4180
4298
|
isPerfectMatch = this.prefillCheckForPerfectMatch(suggestion);
|
|
4181
4299
|
}
|
|
4182
|
-
|
|
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) {
|
|
4183
4305
|
suggestion.address = suggestionToAdd;
|
|
4184
4306
|
isPerfectMatch = this.checkForPerfectMatch(suggestion);
|
|
4185
4307
|
if (!isPerfectMatch) {
|
|
@@ -4204,7 +4326,9 @@ class BoxNumberComponent {
|
|
|
4204
4326
|
this.searchText = sugAddress.boxNumber;
|
|
4205
4327
|
if (sugAddress.hasOwnProperty('isComplete') && sugAddress.isComplete === true) {
|
|
4206
4328
|
this.clickSuggestion(null, sugAddress);
|
|
4207
|
-
//
|
|
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;
|
|
4208
4332
|
if (this.showDebugMessageToConsole) {
|
|
4209
4333
|
console.log('ADDRESS COMPLETE ON BOX NUMBER !');
|
|
4210
4334
|
}
|
|
@@ -4231,7 +4355,9 @@ class BoxNumberComponent {
|
|
|
4231
4355
|
this.searchText = sugAddress.boxNumber;
|
|
4232
4356
|
if (sugAddress.hasOwnProperty('isComplete') && sugAddress.isComplete === true) {
|
|
4233
4357
|
this.clickSuggestion(null, sugAddress);
|
|
4234
|
-
//
|
|
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;
|
|
4235
4361
|
if (this.showDebugMessageToConsole) {
|
|
4236
4362
|
console.log('ADDRESS COMPLETE ON BOX NUMBER !');
|
|
4237
4363
|
}
|
|
@@ -4381,13 +4507,18 @@ class BoxNumberComponent {
|
|
|
4381
4507
|
const combined = Object.assign(Object.assign({}, this.selectedAddress), suggestion);
|
|
4382
4508
|
delete combined.mailBoxid;
|
|
4383
4509
|
delete combined.suffixId;
|
|
4510
|
+
if (combined.geoSanction) {
|
|
4511
|
+
combined.geoSanction = combined.geoSanction.substring(0, 35);
|
|
4512
|
+
}
|
|
4384
4513
|
combined.boxNumber = combined.string;
|
|
4385
4514
|
combined.searchBarString = combined.string;
|
|
4386
4515
|
combined.isComplete = true;
|
|
4387
4516
|
return combined;
|
|
4388
4517
|
}
|
|
4389
4518
|
setSelectedAddress(suggestion) {
|
|
4390
|
-
|
|
4519
|
+
if (this.showDebugMessageToConsole) {
|
|
4520
|
+
console.log('box number::setSelectedAddress', suggestion);
|
|
4521
|
+
}
|
|
4391
4522
|
this.addressIsValidated = (suggestion.hasOwnProperty('isComplete') && suggestion.isComplete === true) ? true : false;
|
|
4392
4523
|
this.addressChanged.emit(suggestion);
|
|
4393
4524
|
}
|
|
@@ -4618,6 +4749,11 @@ class BoxNumberComponent {
|
|
|
4618
4749
|
isDisabled() {
|
|
4619
4750
|
return (this.locality === '' || this.postalCode === '' || this.minLevel > ADDRESSLEVEL.BOX_NUMBER);
|
|
4620
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
|
+
}
|
|
4621
4757
|
onInputClick() {
|
|
4622
4758
|
if (this.showDebugMessageToConsole) {
|
|
4623
4759
|
console.log('box number click');
|
|
@@ -4625,10 +4761,10 @@ class BoxNumberComponent {
|
|
|
4625
4761
|
}
|
|
4626
4762
|
}
|
|
4627
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 });
|
|
4628
|
-
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 } });
|
|
4629
4765
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: BoxNumberComponent, decorators: [{
|
|
4630
4766
|
type: Component,
|
|
4631
|
-
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: [""] }]
|
|
4632
4768
|
}], ctorParameters: function () { return [{ type: AddressService }, { type: LocaleService }, { type: i3.TranslateService }, { type: UnicodeService }]; }, propDecorators: { boxNumberSearchInput: [{
|
|
4633
4769
|
type: ViewChild,
|
|
4634
4770
|
args: ['boxNumberSearchInput', { static: false }]
|
|
@@ -5212,6 +5348,11 @@ class LibAddressAutocompleteByComponentComponent {
|
|
|
5212
5348
|
this.boxNumberAutofillData = this.autofillData;
|
|
5213
5349
|
}
|
|
5214
5350
|
}
|
|
5351
|
+
if (this.minLevel == ADDRESSLEVEL.BOX_NUMBER) {
|
|
5352
|
+
if (this.selectedAddress.boxNumber) {
|
|
5353
|
+
this.boxNumberAutofillData = this.autofillData;
|
|
5354
|
+
}
|
|
5355
|
+
}
|
|
5215
5356
|
}
|
|
5216
5357
|
this.addressCompleteEventEmitter.emit(this.selectedAddress);
|
|
5217
5358
|
this.emittedAddress = this.selectedAddress;
|
|
@@ -5664,9 +5805,15 @@ class LibAddressAutocompleteByComponentComponent {
|
|
|
5664
5805
|
this.autocompleteBoxNb.clearWidget();
|
|
5665
5806
|
this.autocompleteBoxNb.searchText = '';
|
|
5666
5807
|
*/
|
|
5667
|
-
|
|
5668
|
-
|
|
5669
|
-
|
|
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
|
+
}
|
|
5670
5817
|
break;
|
|
5671
5818
|
// STREET Number
|
|
5672
5819
|
case 2:
|
|
@@ -5747,8 +5894,23 @@ class LibAddressAutocompleteByComponentComponent {
|
|
|
5747
5894
|
console.log('lib::setAddressStreetNumber - streetnumber: ', streetNumber);
|
|
5748
5895
|
console.log('lib::setAddressStreetNumber - streetAddress: ', this.streetAddress);
|
|
5749
5896
|
}
|
|
5750
|
-
this.
|
|
5751
|
-
|
|
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
|
+
}
|
|
5752
5914
|
this.selectedAddress.houseNumber = streetNumber;
|
|
5753
5915
|
this.selectedAddress.streetNumber = streetNumber;
|
|
5754
5916
|
/*
|
|
@@ -5767,7 +5929,20 @@ class LibAddressAutocompleteByComponentComponent {
|
|
|
5767
5929
|
setAddressBoxNumber(boxNumber) {
|
|
5768
5930
|
console.log('set box number value:', boxNumber);
|
|
5769
5931
|
//this.streetNumberAddress = this.streetAddress;
|
|
5770
|
-
this.
|
|
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
|
+
}
|
|
5771
5946
|
this.selectedAddress.boxNumber = boxNumber;
|
|
5772
5947
|
this.boxNumber = boxNumber;
|
|
5773
5948
|
this.notifyAddressComplete();
|
|
@@ -5883,7 +6058,23 @@ class LibAddressAutocompleteByComponentComponent {
|
|
|
5883
6058
|
this.minLevel = ADDRESSLEVEL.STREET;
|
|
5884
6059
|
const streetNumber = this.prefillData.parameters.streetNumber;
|
|
5885
6060
|
const boxNumber = this.prefillData.parameters.boxNumber;
|
|
5886
|
-
if (
|
|
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.
|
|
5887
6078
|
this.prefillData.parameters.minLevel = ADDRESSLEVEL.BOX_NUMBER;
|
|
5888
6079
|
this.boxNumberPrefillData = this.prefillData;
|
|
5889
6080
|
}
|
|
@@ -5973,11 +6164,13 @@ class LibAddressAutocompleteByComponentComponent {
|
|
|
5973
6164
|
if (this.showDebugMessageToConsole) {
|
|
5974
6165
|
console.warn('lib::street: prefill - transmitting prefill data for streetNumber :', this.prefillData);
|
|
5975
6166
|
}
|
|
5976
|
-
if (address.houseNumber) {
|
|
6167
|
+
if (address.houseNumber && !streetNumber) {
|
|
6168
|
+
// No street number in prefill params: use the street suggestion's houseNumber via autofill
|
|
5977
6169
|
this.setAddress(address, ADDRESSLEVEL.STREET);
|
|
5978
6170
|
this.minLevel = ADDRESSLEVEL.STREET_NUMBER;
|
|
5979
6171
|
}
|
|
5980
6172
|
else {
|
|
6173
|
+
// Street number given in prefill params (or no houseNumber in suggestion): trigger street-number prefill
|
|
5981
6174
|
this.streetNumberPrefillData = this.prefillData;
|
|
5982
6175
|
}
|
|
5983
6176
|
}
|
|
@@ -6013,10 +6206,35 @@ class LibAddressAutocompleteByComponentComponent {
|
|
|
6013
6206
|
const addressIsComplete = address && address.hasOwnProperty('isComplete') && address.isComplete === true ? true : false;
|
|
6014
6207
|
const addressIsNotInList = address && address.hasOwnProperty('not-in-list') && address['not-in-list'] === true ? true : false;
|
|
6015
6208
|
if (addressIsComplete && !addressIsNotInList) {
|
|
6016
|
-
// found address - perfect
|
|
6017
|
-
|
|
6018
|
-
this.
|
|
6019
|
-
|
|
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
|
+
}
|
|
6020
6238
|
}
|
|
6021
6239
|
else {
|
|
6022
6240
|
this.addressParams.minLevel = ADDRESSLEVEL.BOX_NUMBER;
|
|
@@ -6110,13 +6328,52 @@ class LibAddressAutocompleteByComponentComponent {
|
|
|
6110
6328
|
const address = suggestion.address;
|
|
6111
6329
|
this.updateStreetNumber(address);
|
|
6112
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
|
+
}
|
|
6113
6339
|
const addressIsComplete = address && address.hasOwnProperty('isComplete') && !address.hasOwnProperty('boxNumber') && address.isComplete === true ? true : false;
|
|
6114
6340
|
const addressIsNotInList = address && address.hasOwnProperty('not-in-list') && address['not-in-list'] === true ? true : false;
|
|
6115
6341
|
if (addressIsComplete && !addressIsNotInList) {
|
|
6116
|
-
// found address - perfect
|
|
6117
|
-
|
|
6118
|
-
this.
|
|
6119
|
-
|
|
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
|
+
}
|
|
6120
6377
|
}
|
|
6121
6378
|
else {
|
|
6122
6379
|
this.addressParams.minLevel = ADDRESSLEVEL.BOX_NUMBER;
|
|
@@ -6136,8 +6393,16 @@ class LibAddressAutocompleteByComponentComponent {
|
|
|
6136
6393
|
// this.updatePostalCodeLocality(suggestionAddress);
|
|
6137
6394
|
const boxNumber = this.prefillData.parameters.boxNumber;
|
|
6138
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.
|
|
6139
6403
|
this.setAddress(address, ADDRESSLEVEL.STREET_NUMBER);
|
|
6140
|
-
|
|
6404
|
+
this.quitPrefillMode();
|
|
6405
|
+
return;
|
|
6141
6406
|
}
|
|
6142
6407
|
else {
|
|
6143
6408
|
this.updatePostalCodeLocality(address);
|
|
@@ -6159,33 +6424,32 @@ class LibAddressAutocompleteByComponentComponent {
|
|
|
6159
6424
|
}
|
|
6160
6425
|
this.autocompleteBoxNb.searchText = '';
|
|
6161
6426
|
}
|
|
6162
|
-
/*
|
|
6163
|
-
const boxNumber = this.prefillData.parameters.boxNumber;
|
|
6164
|
-
if ( ! addressIsNotInList && (boxNumber === null || boxNumber === undefined || boxNumber === '') )
|
|
6165
|
-
{
|
|
6166
|
-
this.setAddress(address, ADDRESSLEVEL.STREET_NUMBER);
|
|
6167
|
-
this.quitPrefillMode();
|
|
6168
|
-
}
|
|
6169
|
-
else
|
|
6170
|
-
{
|
|
6171
|
-
if (this.showDebugMessageToConsole) { console.log('lib::prefill: trigger checking box number match... ', this.prefillData); }
|
|
6172
|
-
this.boxNumberPrefillData = this.prefillData;
|
|
6173
|
-
}
|
|
6174
|
-
*/
|
|
6175
6427
|
this.boxNumberPrefillData = this.prefillData;
|
|
6176
6428
|
}
|
|
6177
6429
|
}
|
|
6178
6430
|
else {
|
|
6179
6431
|
const prefillStreetNumber = this.prefillData.parameters.streetNumber;
|
|
6180
|
-
const address = this.prefillData.prefillStreetPerfectMatchSuggestion
|
|
6432
|
+
const address = this.prefillData.prefillStreetPerfectMatchSuggestion
|
|
6433
|
+
? this.prefillData.prefillStreetPerfectMatchSuggestion.address
|
|
6434
|
+
: null;
|
|
6181
6435
|
this.autocompleteBoxNb.streetNumber = '';
|
|
6182
6436
|
if (prefillStreetNumber === null || prefillStreetNumber === undefined || prefillStreetNumber.length === 0) {
|
|
6183
6437
|
this.setAddress(address, ADDRESSLEVEL.STREET);
|
|
6184
6438
|
}
|
|
6185
6439
|
else {
|
|
6186
|
-
//
|
|
6187
|
-
|
|
6188
|
-
|
|
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;
|
|
6189
6453
|
}
|
|
6190
6454
|
this.quitPrefillMode();
|
|
6191
6455
|
}
|
|
@@ -6198,18 +6462,48 @@ class LibAddressAutocompleteByComponentComponent {
|
|
|
6198
6462
|
if (data.prefillBoxNumberPerfectMatchFound === true) {
|
|
6199
6463
|
const suggestion = data.prefillBoxNumberPerfectMatchSuggestion;
|
|
6200
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
|
+
}
|
|
6201
6474
|
this.autocompleteBoxNb.selectedAddress = address;
|
|
6202
6475
|
this.setAddress(address, ADDRESSLEVEL.BOX_NUMBER);
|
|
6203
6476
|
}
|
|
6204
6477
|
else {
|
|
6205
6478
|
const prefillBoxNumber = this.prefillData.parameters.boxNumber;
|
|
6206
|
-
const address = this.prefillData.prefillStreetNumberPerfectMatchSuggestion
|
|
6479
|
+
const address = this.prefillData.prefillStreetNumberPerfectMatchSuggestion
|
|
6480
|
+
? this.prefillData.prefillStreetNumberPerfectMatchSuggestion.address
|
|
6481
|
+
: null;
|
|
6207
6482
|
if (prefillBoxNumber === null || prefillBoxNumber === undefined || prefillBoxNumber.length === 0) {
|
|
6208
6483
|
this.setAddress(address, ADDRESSLEVEL.STREET_NUMBER);
|
|
6209
6484
|
}
|
|
6210
|
-
else {
|
|
6211
|
-
|
|
6485
|
+
else if (address) {
|
|
6486
|
+
address.boxNumber = prefillBoxNumber;
|
|
6487
|
+
if (this.notInListAllowed && this.prefillData.parameters.streetNumber) {
|
|
6488
|
+
address.houseNumber = this.prefillData.parameters.streetNumber;
|
|
6489
|
+
}
|
|
6212
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
|
+
}
|
|
6213
6507
|
this.setAddress(address, ADDRESSLEVEL.BOX_NUMBER);
|
|
6214
6508
|
}
|
|
6215
6509
|
}
|
|
@@ -6223,29 +6517,68 @@ class LibAddressAutocompleteByComponentComponent {
|
|
|
6223
6517
|
if (data.prefillBoxNumberPerfectMatchFound === true) {
|
|
6224
6518
|
const suggestion = data.prefillBoxNumberPerfectMatchSuggestion;
|
|
6225
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
|
+
}
|
|
6226
6529
|
this.autocompleteBoxNb.selectedAddress = address;
|
|
6227
6530
|
this.setAddress(address, ADDRESSLEVEL.BOX_NUMBER);
|
|
6228
6531
|
}
|
|
6229
6532
|
else {
|
|
6230
6533
|
const prefillBoxNumber = this.prefillData.parameters.boxNumber;
|
|
6231
|
-
const address = this.prefillData.prefillStreetNumberPerfectMatchSuggestion
|
|
6534
|
+
const address = this.prefillData.prefillStreetNumberPerfectMatchSuggestion
|
|
6535
|
+
? this.prefillData.prefillStreetNumberPerfectMatchSuggestion.address
|
|
6536
|
+
: null;
|
|
6232
6537
|
if (prefillBoxNumber === null || prefillBoxNumber === undefined || prefillBoxNumber.length === 0) {
|
|
6233
6538
|
this.setAddress(address, ADDRESSLEVEL.STREET_NUMBER);
|
|
6234
6539
|
}
|
|
6235
|
-
else {
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
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
|
+
}
|
|
6239
6572
|
}
|
|
6240
6573
|
}
|
|
6241
6574
|
this.quitPrefillMode();
|
|
6242
6575
|
}
|
|
6243
6576
|
}
|
|
6244
6577
|
LibAddressAutocompleteByComponentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: LibAddressAutocompleteByComponentComponent, deps: [{ token: HttpService }], target: i0.ɵɵFactoryTarget.Component });
|
|
6245
|
-
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"] }] });
|
|
6246
6579
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: LibAddressAutocompleteByComponentComponent, decorators: [{
|
|
6247
6580
|
type: Component,
|
|
6248
|
-
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
|
|
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: [""] }]
|
|
6249
6582
|
}], ctorParameters: function () { return [{ type: HttpService }]; }, propDecorators: { autocompleteLocality: [{
|
|
6250
6583
|
type: ViewChild,
|
|
6251
6584
|
args: [LocalityComponent, { static: false }]
|