@bpost/bp-address-auto-complete-by-component 1.1.18 → 1.1.20

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.
@@ -1382,24 +1382,25 @@ class LocalityComponent {
1382
1382
  this.textChangeEvent.emit(this.searchText);
1383
1383
  }
1384
1384
  clearInput(focus, emit = true) {
1385
- this.clearSuggestions();
1386
- this.bpTypeAhead = '';
1387
- this.setSearchText('');
1385
+ // this.clearSuggestions();
1386
+ // this.bpTypeAhead = '';
1387
+ // this.setSearchText('');
1388
+ this.clearWidget();
1388
1389
  this.resetArrowSelectedIndex();
1389
1390
  this.previousIndex = -1;
1390
1391
  this.lastSearchValue = '';
1391
1392
  this.clearSuggestionValidationMessage();
1392
1393
  this.clearSelectedAddress();
1393
1394
  this.valueChanged();
1394
- this.clearConnectionErrorMessage();
1395
+ // this.clearConnectionErrorMessage();
1395
1396
  if (focus === true) {
1396
1397
  this.localitySearchInput.nativeElement.focus();
1397
1398
  }
1398
1399
  if (emit) {
1399
1400
  this.clearInputEventEmitter.emit(/*'LOCALITY'*/ InputNameType.LOCALITY);
1400
- this.clearInputEventEmitter.emit(/*'STREET'*/ InputNameType.STREET);
1401
- this.clearInputEventEmitter.emit(/*'STREET_NUMBER'*/ InputNameType.STREET_NUMBER);
1402
- this.clearInputEventEmitter.emit(/*'BOX_NUMBER'*/ InputNameType.BOX_NUMBER);
1401
+ // this.clearInputEventEmitter.emit(/*'STREET'*/ InputNameType.STREET);
1402
+ // this.clearInputEventEmitter.emit(/*'STREET_NUMBER'*/ InputNameType.STREET_NUMBER);
1403
+ // this.clearInputEventEmitter.emit(/*'BOX_NUMBER'*/ InputNameType.BOX_NUMBER);
1403
1404
  }
1404
1405
  }
1405
1406
  clearSearchText() {
@@ -2096,7 +2097,6 @@ class StreetComponent {
2096
2097
  }
2097
2098
  }
2098
2099
  for (const lang of streetNamesAllLanguage) {
2099
- console.log('----------------Language data--------------------:', lang);
2100
2100
  if (!lang.streetName || !lang.municipalityName) {
2101
2101
  continue;
2102
2102
  }
@@ -2374,8 +2374,8 @@ class StreetComponent {
2374
2374
  if (emit) {
2375
2375
  // this.clearInputEventEmitter.emit('STREET');
2376
2376
  this.clearInputEventEmitter.emit(/*'STREET'*/ InputNameType.STREET);
2377
- this.clearInputEventEmitter.emit(/*'STREET_NUMBER'*/ InputNameType.STREET_NUMBER);
2378
- this.clearInputEventEmitter.emit(/*'BOX_NUMBER'*/ InputNameType.BOX_NUMBER);
2377
+ // this.clearInputEventEmitter.emit(/*'STREET_NUMBER'*/ InputNameType.STREET_NUMBER);
2378
+ // this.clearInputEventEmitter.emit(/*'BOX_NUMBER'*/ InputNameType.BOX_NUMBER);
2379
2379
  }
2380
2380
  }
2381
2381
  clearSuggestions() {
@@ -3931,7 +3931,6 @@ class BoxNumberComponent {
3931
3931
  // topSuggestions.forEach(this.parseSingleSuggestion.bind(this));
3932
3932
  let perfectMatchFound = false;
3933
3933
  for (const sug of topSuggestions) {
3934
- console.warn('boxnumber::parsing suggestion:', sug);
3935
3934
  if (this.parseSingleSuggestion(sug, source) === true) {
3936
3935
  perfectMatchFound = true;
3937
3936
  }
@@ -5037,6 +5036,9 @@ class LibAddressAutocompleteByComponentComponent {
5037
5036
  // Box number
5038
5037
  this.boxNumber = '';
5039
5038
  if (this.autocompleteBoxNb) {
5039
+ if (this.autocompleteBoxNb.searchText != '') {
5040
+ this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
5041
+ }
5040
5042
  this.autocompleteBoxNb.searchText = '';
5041
5043
  this.autocompleteBoxNb.streetNumber = '';
5042
5044
  this.autocompleteBoxNb.clearInput(false, false);
@@ -5044,6 +5046,9 @@ class LibAddressAutocompleteByComponentComponent {
5044
5046
  // Street number
5045
5047
  this.streetNumber = '';
5046
5048
  if (this.autocompleteStreetNb) {
5049
+ if (this.autocompleteStreetNb.searchText != '') {
5050
+ this.onClearInputEventEmitter(InputNameType.STREET_NUMBER);
5051
+ }
5047
5052
  this.autocompleteStreetNb.searchText = '';
5048
5053
  this.autocompleteStreetNb.streetName = '';
5049
5054
  this.autocompleteStreetNb.onClearStreetNumberInput(false, false);
@@ -5051,6 +5056,9 @@ class LibAddressAutocompleteByComponentComponent {
5051
5056
  // Street name
5052
5057
  this.street = '';
5053
5058
  if (this.autocompleteStreet) {
5059
+ if (this.autocompleteStreet.searchText != '') {
5060
+ this.onClearInputEventEmitter(InputNameType.STREET);
5061
+ }
5054
5062
  this.autocompleteStreet.searchText = '';
5055
5063
  this.autocompleteStreet.clearInput(false, false);
5056
5064
  }
@@ -5557,6 +5565,11 @@ class LibAddressAutocompleteByComponentComponent {
5557
5565
  this.streetNumberInput = address.houseNumber;
5558
5566
  }
5559
5567
  }
5568
+ updateboxNumber(address) {
5569
+ if (address && address.boxNumber) {
5570
+ this.boxNumber = address.boxNumber;
5571
+ }
5572
+ }
5560
5573
  updateCompleteAddress() {
5561
5574
  let concatStr = '';
5562
5575
  concatStr += this.selectedAddress.streetName ? `${this.selectedAddress.streetName} ` : '';