@bpost/bp-address-auto-complete-by-component 1.1.13 → 1.1.15
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 +6 -0
- package/esm2020/lib/box-number/box-number.component.mjs +13 -2
- package/esm2020/lib/lib-address-autocomplete-by-component.component.mjs +2 -1
- package/esm2020/lib/street-number/street-number.component.mjs +29 -2
- package/fesm2015/bpost-bp-address-auto-complete-by-component.mjs +41 -2
- package/fesm2015/bpost-bp-address-auto-complete-by-component.mjs.map +1 -1
- package/fesm2020/bpost-bp-address-auto-complete-by-component.mjs +41 -2
- package/fesm2020/bpost-bp-address-auto-complete-by-component.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -3060,9 +3060,36 @@ class StreetNumberComponent {
|
|
|
3060
3060
|
this.sequenceNumber += 1;
|
|
3061
3061
|
this.consumedNumber = this.sequenceNumber;
|
|
3062
3062
|
this.clearSuggestions();
|
|
3063
|
+
if (this.suggestionLevel === SuggestionLevelType.None) {
|
|
3064
|
+
console.log('(A) do not use suggestions for street number');
|
|
3065
|
+
this.streetNumberChanged.emit(this.searchText);
|
|
3066
|
+
if (source === SourceType.SOURCE_PREFILLED)
|
|
3067
|
+
this.prefillAnalyzeData();
|
|
3068
|
+
}
|
|
3063
3069
|
}
|
|
3064
3070
|
else {
|
|
3065
|
-
if (
|
|
3071
|
+
if (this.suggestionLevel === SuggestionLevelType.None) {
|
|
3072
|
+
console.log('(B) do not use suggestions for street number');
|
|
3073
|
+
this.streetNumberChanged.emit(this.searchText);
|
|
3074
|
+
if (source === SourceType.SOURCE_PREFILLED) {
|
|
3075
|
+
this.prefillData.prefillStreetNumberPerfectMatchFound = true;
|
|
3076
|
+
let suggestion = {
|
|
3077
|
+
'address': {
|
|
3078
|
+
'string': this.searchText.toUpperCase(),
|
|
3079
|
+
'municipalityName': this.locality,
|
|
3080
|
+
'localityName': this.locality,
|
|
3081
|
+
'postalCode': this.postalCode,
|
|
3082
|
+
'searchBarString': this.searchText.toUpperCase(),
|
|
3083
|
+
'houseNumber': this.searchText.toUpperCase(),
|
|
3084
|
+
'streetName': this.streetName
|
|
3085
|
+
}
|
|
3086
|
+
};
|
|
3087
|
+
this.prefillData.prefillStreetNumberPerfectMatchSuggestion = suggestion;
|
|
3088
|
+
this.isPrefillWithNoMatch = this.prefillData.prefillStreetNumberPerfectMatchFound === true ? false : true;
|
|
3089
|
+
this.prefillAnalyzeData();
|
|
3090
|
+
}
|
|
3091
|
+
}
|
|
3092
|
+
else if (!this.validatedByBackend) {
|
|
3066
3093
|
if (source === SourceType.SOURCE_PREFILLED) {
|
|
3067
3094
|
this.prefillData.prefillStreetNumberPerfectMatchFound = true;
|
|
3068
3095
|
let suggestion = {
|
|
@@ -3742,6 +3769,9 @@ class BoxNumberComponent {
|
|
|
3742
3769
|
if (!this.validatedByBackend) {
|
|
3743
3770
|
return (this.isValid(this.postalCode) || this.isValid(this.locality)) && this.isValid(this.streetName) && this.isValid(this.streetNumber);
|
|
3744
3771
|
}
|
|
3772
|
+
else if (this.suggestionLevel === SuggestionLevelType.None && this.prefillData) {
|
|
3773
|
+
return this.isValid(this.postalCode) && this.isValid(this.locality) && this.isValid(this.streetName) && this.isValid(this.streetNumber) && this.prefillData.parameters.boxNumber !== '';
|
|
3774
|
+
}
|
|
3745
3775
|
else {
|
|
3746
3776
|
return this.isValid(this.postalCode) && this.isValid(this.locality) && this.isValid(this.streetName) && this.isValid(this.streetNumber);
|
|
3747
3777
|
}
|
|
@@ -4021,9 +4051,17 @@ class BoxNumberComponent {
|
|
|
4021
4051
|
this.sequenceNumber += 1;
|
|
4022
4052
|
this.consumedNumber = this.sequenceNumber;
|
|
4023
4053
|
this.clearSuggestions();
|
|
4054
|
+
if (this.suggestionLevel === SuggestionLevelType.None || this.suggestionLevel === SuggestionLevelType.StreetNumber) {
|
|
4055
|
+
console.log('do not use suggestions for box number');
|
|
4056
|
+
this.boxNumberChanged.emit(this.searchText);
|
|
4057
|
+
}
|
|
4024
4058
|
}
|
|
4025
4059
|
else {
|
|
4026
|
-
if (
|
|
4060
|
+
if (this.suggestionLevel === SuggestionLevelType.None || this.suggestionLevel === SuggestionLevelType.StreetNumber) {
|
|
4061
|
+
console.log('do not use suggestions for box number');
|
|
4062
|
+
this.boxNumberChanged.emit(this.searchText);
|
|
4063
|
+
}
|
|
4064
|
+
else if (!this.validatedByBackend) {
|
|
4027
4065
|
if (source === SourceType.SOURCE_PREFILLED) {
|
|
4028
4066
|
this.prefillData.prefillBoxNumberPerfectMatchFound = true;
|
|
4029
4067
|
let suggestion = {
|
|
@@ -5304,6 +5342,7 @@ class LibAddressAutocompleteByComponentComponent {
|
|
|
5304
5342
|
}
|
|
5305
5343
|
this.streetNumberAddress = this.streetAddress;
|
|
5306
5344
|
this.selectedAddress = this.streetAddress;
|
|
5345
|
+
this.selectedAddress.houseNumber = streetNumber;
|
|
5307
5346
|
this.selectedAddress.streetNumber = streetNumber;
|
|
5308
5347
|
/*
|
|
5309
5348
|
this.streetNumber = streetNumber;
|