@bpost/bp-address-auto-complete-by-component 1.1.11 → 1.1.12

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.
@@ -1218,7 +1218,7 @@ class LocalityComponent {
1218
1218
  this.isPrefillWithNoMatch = false;
1219
1219
  this.clearTypeAhead();
1220
1220
  this.resetArrowSelectedIndex();
1221
- const municipalityName = this.searchText.match(/[a-z]+/gi)?.join("");
1221
+ const municipalityName = this.searchText.replace(/\d+/g, '').trim();
1222
1222
  const postalCode = this.searchText.match(/\d+/g)?.join("");
1223
1223
  let suggestion = {
1224
1224
  'string': this.searchText,
@@ -2675,7 +2675,12 @@ class StreetNumberComponent {
2675
2675
  /* if (this.showDebugMessageToConsole) {
2676
2676
  console.log('street-number::isParamsComplete', this.postalCode, this.locality, this.streetName);
2677
2677
  } */
2678
- return this.isValid(this.postalCode) && this.isValid(this.locality) && this.isValid(this.streetName);
2678
+ if (!this.validatedByBackend) {
2679
+ return (this.isValid(this.postalCode) || this.isValid(this.locality)) && this.isValid(this.streetName);
2680
+ }
2681
+ else {
2682
+ return this.isValid(this.postalCode) && this.isValid(this.locality) && this.isValid(this.streetName);
2683
+ }
2679
2684
  }
2680
2685
  generateParameters() {
2681
2686
  const param = new QueryParameters({