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

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.
@@ -934,6 +934,9 @@ class LocalityComponent {
934
934
  this.clearSelectedAddress();
935
935
  }
936
936
  */
937
+ // if (changes.hasOwnProperty('validatedByBackend') && changes.hasOwnProperty('prefillData')) {
938
+ // this.onInputChange(SourceType.SOURCE_PREFILLED)
939
+ // }
937
940
  }
938
941
  }
939
942
  transformMunicipalityInLowercaseAndWithoutDiacritics(municipalityName) {
@@ -1095,7 +1098,7 @@ class LocalityComponent {
1095
1098
  else {
1096
1099
  this.isPrefillWithNoMatch = false;
1097
1100
  }
1098
- }, () => this.handleGetLocalityError());
1101
+ }, () => this.handleGetLocalityError(source));
1099
1102
  }
1100
1103
  }
1101
1104
  getTextColor() {
@@ -1117,12 +1120,25 @@ class LocalityComponent {
1117
1120
  this.collapseDropdown = (this.prefilling === true && this.prefillData !== null)
1118
1121
  ? !this.prefillData.parameters.onFocusShowSuggestionsAfterPrefill : false;
1119
1122
  }
1120
- handleGetLocalityError() {
1123
+ handleGetLocalityError(source) {
1121
1124
  if (this.allowNoValidation && this.validatedByBackend) {
1122
1125
  this.numberOfExceptions += 1;
1123
1126
  this.numberOfExceptionsEmitter.emit(this.numberOfExceptions);
1127
+ this.setConnectionErrorMessage();
1128
+ }
1129
+ if (this.allowNoValidation && this.validatedByBackend && source === SourceType.SOURCE_PREFILLED) {
1130
+ this.numberOfExceptions += 1;
1131
+ this.numberOfExceptionsEmitter.emit(this.numberOfExceptions);
1132
+ this.setConnectionErrorMessage();
1133
+ this.onInputChange(source);
1134
+ }
1135
+ if (this.allowNoValidation && !this.validatedByBackend && source === SourceType.SOURCE_PREFILLED) {
1136
+ this.onInputChange(source);
1137
+ }
1138
+ if (!this.allowNoValidation && this.validatedByBackend) {
1139
+ this.setConnectionErrorMessage();
1124
1140
  }
1125
- this.setConnectionErrorMessage();
1141
+ // this.setConnectionErrorMessage();
1126
1142
  }
1127
1143
  isBrowserIE() {
1128
1144
  return /msie\s|trident\/|edge\//i.test(window.navigator.userAgent);
@@ -1216,19 +1232,40 @@ class LocalityComponent {
1216
1232
  }
1217
1233
  else {
1218
1234
  if (!this.validatedByBackend) {
1219
- this.isPrefillWithNoMatch = false;
1220
- this.clearTypeAhead();
1221
- this.resetArrowSelectedIndex();
1222
- const municipalityName = (_a = this.searchText.match(/[a-z]+/gi)) === null || _a === void 0 ? void 0 : _a.join("");
1223
- const postalCode = (_b = this.searchText.match(/\d+/g)) === null || _b === void 0 ? void 0 : _b.join("");
1224
- let suggestion = {
1225
- 'string': this.searchText,
1226
- 'municipalityName': municipalityName ? municipalityName.toUpperCase() : '',
1227
- 'localityName': municipalityName,
1228
- 'postalCode': postalCode,
1229
- 'searchBarString': this.searchText
1230
- };
1231
- this.setSelectedAddress(suggestion);
1235
+ if (source === SourceType.SOURCE_PREFILLED) {
1236
+ this.clearTypeAhead();
1237
+ this.prefillData.prefillMunicipalityPerfectMatchFound = true;
1238
+ this.prefillData.prefillMunicipalityAndLocalityPerfectMatchFound = true;
1239
+ const municipalityName = this.searchText.replace(/\d+/g, '').trim();
1240
+ const postalCode = (_a = this.searchText.match(/\d+/g)) === null || _a === void 0 ? void 0 : _a.join("");
1241
+ let suggestion = {
1242
+ 'address': {
1243
+ 'string': this.searchText,
1244
+ 'municipalityName': municipalityName ? municipalityName.toUpperCase() : '',
1245
+ 'localityName': municipalityName,
1246
+ 'postalCode': postalCode,
1247
+ 'searchBarString': this.searchText
1248
+ }
1249
+ };
1250
+ this.prefillData.prefillMunicipalityPerfectMatchSuggestion = suggestion;
1251
+ this.isPrefillWithNoMatch = this.prefillData.prefillMunicipalityPerfectMatchFound === true ? false : true;
1252
+ this.prefillAnalyzeData();
1253
+ }
1254
+ else {
1255
+ this.isPrefillWithNoMatch = false;
1256
+ this.clearTypeAhead();
1257
+ this.resetArrowSelectedIndex();
1258
+ const municipalityName = this.searchText.replace(/\d+/g, '').trim();
1259
+ const postalCode = (_b = this.searchText.match(/\d+/g)) === null || _b === void 0 ? void 0 : _b.join("");
1260
+ let suggestion = {
1261
+ 'string': this.searchText,
1262
+ 'municipalityName': municipalityName ? municipalityName.toUpperCase() : '',
1263
+ 'localityName': municipalityName,
1264
+ 'postalCode': postalCode,
1265
+ 'searchBarString': this.searchText
1266
+ };
1267
+ this.setSelectedAddress(suggestion);
1268
+ }
1232
1269
  }
1233
1270
  else {
1234
1271
  this.getTopSuggestions(source);
@@ -1688,12 +1725,20 @@ class StreetComponent {
1688
1725
  if (changes.hasOwnProperty('prefillData') && !changes.prefillData.firstChange) {
1689
1726
  this.prefilling = true;
1690
1727
  this.searchText = this.loadParams(changes.prefillData.currentValue);
1728
+ // if(this.searchText === '')
1729
+ // {
1730
+ setTimeout(() => {
1731
+ this.searchText = this.loadParams(changes.prefillData.currentValue);
1732
+ // console.log("setrtt time");
1733
+ }, 200);
1734
+ // }
1691
1735
  if (this.searchText !== '' && this.minLevel === ADDRESSLEVEL.STREET) {
1692
1736
  /*
1693
1737
  this.onInputChange('prefilled');
1694
1738
  this.streetSearchInput.nativeElement.focus();
1695
1739
  */
1696
1740
  /*
1741
+
1697
1742
  this.prefilling = true;
1698
1743
  this.collapseDropdown = true;
1699
1744
  this.prefillMunicipalityName = this.transformMunicipalityInLowercaseAndWithoutDiacritics(this.addressParams.municipalityName);
@@ -1860,7 +1905,7 @@ class StreetComponent {
1860
1905
  else {
1861
1906
  this.isPrefillWithNoMatch = false;
1862
1907
  }
1863
- }, () => this.handleGetStreetError());
1908
+ }, () => this.handleGetStreetError(source));
1864
1909
  }
1865
1910
  }
1866
1911
  getTextColor() {
@@ -1933,12 +1978,24 @@ class StreetComponent {
1933
1978
  this.collapseDropdown = (this.prefilling === true && this.prefillData !== null)
1934
1979
  ? !this.prefillData.parameters.onFocusShowSuggestionsAfterPrefill : false;
1935
1980
  }
1936
- handleGetStreetError() {
1981
+ handleGetStreetError(source) {
1937
1982
  if (this.allowNoValidation && this.validatedByBackend) {
1938
1983
  this.numberOfExceptions += 1;
1939
1984
  this.numberOfExceptionsEmitter.emit(this.numberOfExceptions);
1985
+ this.setConnectionErrorMessage();
1986
+ }
1987
+ if (this.allowNoValidation && this.validatedByBackend && source === SourceType.SOURCE_PREFILLED) {
1988
+ this.numberOfExceptions += 1;
1989
+ this.numberOfExceptionsEmitter.emit(this.numberOfExceptions);
1990
+ this.setConnectionErrorMessage();
1991
+ this.onInputChange(source);
1992
+ }
1993
+ if (this.allowNoValidation && !this.validatedByBackend && source === SourceType.SOURCE_PREFILLED) {
1994
+ this.onInputChange(source);
1995
+ }
1996
+ if (!this.allowNoValidation && this.validatedByBackend) {
1997
+ this.setConnectionErrorMessage();
1940
1998
  }
1941
- this.setConnectionErrorMessage();
1942
1999
  }
1943
2000
  setConnectionErrorMessage() {
1944
2001
  this.errorCode = /*'service-unavailable'*/ ValidationMessageType.Service_Unavailable;
@@ -2035,15 +2092,35 @@ class StreetComponent {
2035
2092
  }
2036
2093
  else {
2037
2094
  if (!this.validatedByBackend) {
2038
- let suggestion = {
2039
- 'string': this.searchText.toUpperCase(),
2040
- 'municipalityName': this.locality ? this.locality.toLocaleUpperCase() : '',
2041
- 'localityName': this.locality ? this.locality.toLocaleUpperCase() : '',
2042
- 'postalCode': this.postalCode,
2043
- 'searchBarString': this.searchText.toUpperCase(),
2044
- 'streetName': this.searchText.toUpperCase()
2045
- };
2046
- this.setSelectedAddress(suggestion);
2095
+ if (source === SourceType.SOURCE_PREFILLED) {
2096
+ this.prefillData.prefillStreetPerfectMatchFound = true;
2097
+ // this.clearTypeAhead();
2098
+ // this.resetArrowSelectedIndex();
2099
+ let suggestion = {
2100
+ 'address': {
2101
+ 'string': this.searchText.toUpperCase(),
2102
+ 'municipalityName': this.locality ? this.locality.toLocaleUpperCase() : '',
2103
+ 'localityName': this.locality ? this.locality.toLocaleUpperCase() : '',
2104
+ 'postalCode': this.postalCode,
2105
+ 'searchBarString': this.searchText.toUpperCase(),
2106
+ 'streetName': this.searchText.toUpperCase()
2107
+ }
2108
+ };
2109
+ this.prefillData.prefillStreetPerfectMatchSuggestion = suggestion;
2110
+ this.isPrefillWithNoMatch = this.prefillData.prefillStreetPerfectMatchFound === true ? false : true;
2111
+ this.prefillAnalyzeData();
2112
+ }
2113
+ else {
2114
+ let suggestion = {
2115
+ 'string': this.searchText.toUpperCase(),
2116
+ 'municipalityName': this.locality ? this.locality.toLocaleUpperCase() : '',
2117
+ 'localityName': this.locality ? this.locality.toLocaleUpperCase() : '',
2118
+ 'postalCode': this.postalCode,
2119
+ 'searchBarString': this.searchText.toUpperCase(),
2120
+ 'streetName': this.searchText.toUpperCase()
2121
+ };
2122
+ this.setSelectedAddress(suggestion);
2123
+ }
2047
2124
  }
2048
2125
  else {
2049
2126
  this.getTopSuggestions(source);
@@ -2283,7 +2360,7 @@ class StreetComponent {
2283
2360
  }
2284
2361
  }
2285
2362
  StreetComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: StreetComponent, deps: [{ token: AddressService }, { token: LocaleService }, { token: i3.TranslateService }, { token: UnicodeService }], target: i0.ɵɵFactoryTarget.Component });
2286
- StreetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: StreetComponent, selector: "bp-street", inputs: { labelResourceKey: "labelResourceKey", maxSuggesionCount: "maxSuggesionCount", visibleSuggesionCount: "visibleSuggesionCount", sortCriteria: "sortCriteria", baseUrl: "baseUrl", prefillData: "prefillData", showDebugMessageToConsole: "showDebugMessageToConsole", postalCode: "postalCode", locality: "locality", inputText: "inputText", messageOption: "messageOption", allowNoValidation: "allowNoValidation", validatedByBackend: "validatedByBackend", numberOfExceptions: "numberOfExceptions", inputLang: "inputLang", isReadonly: "isReadonly" }, outputs: { messageChanged: "messageChanged", addressChanged: "addressChanged", focusEvent: "focusEvent", blurEvent: "blurEvent", textChangeEvent: "textChangeEvent", clearInputEventEmitter: "clearInputEventEmitter", prefillEventEmitter: "prefillEventEmitter", numberOfExceptionsEmitter: "numberOfExceptionsEmitter" }, viewQueries: [{ propertyName: "streetSearchInput", first: true, predicate: ["streetSearchInput"], descendants: true }, { propertyName: "streetList", first: true, predicate: ["streetList"], 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\" #streetSearchInput class=\"bpaac-input\" \n [readonly]=\"isReadonly\"\n [style.background-color]=\"!isParamsComplete() ? 'lightgrey' : ''\" \n [style.color]=\" getTextColor() \"\n [disabled]=\"(validatedByBackend && (!locality || locality.trim().length === 0)) \n || (!validatedByBackend && ((!postalCode || postalCode.trim().length === 0) && (!locality || locality.trim().length === 0)))\" (keydown)=\"checkKeyDown($event)\" \n (input)=\"onInputChange()\" (click)=\"onInputClick()\"\n [(ngModel)]=\"searchText\" id=\"streetInputField\" [attr.placeholder]=\"placeHolderText\" autocomplete=\"off\"\n (blur)=\"onBlur($event)\" (focus)=\"onFocus()\" />\n <div id=\"bpaac-clear-street-button\" *ngIf=\"mayShowClearButton()\" (click)=\"clearInput(true)\" class=\"bpaac-clear\">\n </div>\n </div>\n <!--<div ng-transclude></div>-->\n <input id=\"bpaac-street-typeahead\" type=\"text\" disabled autocomplete=\"off\" [(ngModel)]=\"bpTypeAhead\" />\n </div>\n <div [hidden]=\"collapseDropdown\" class=\"bpaac-dropdown-menu-container\" *ngIf=\"suggestions && suggestions.length>0\">\n <div #streetList [appVisibleSuggestion]=\"visibleSuggesionCount\" id=\"bpaac-street-dropdown\" class=\"bpaac-dropdown-menu\">\n <ul role=\"listbox\" id=\"bpaac-street-suggestionsList\" class=\"list-unstyled\">\n <li role=\"option\" *ngFor=\"let option of suggestions; let idx = index\" [ngClass]=\"{'active':(selectedIndex==idx)}\" (mousedown)=\"clickSuggestion($event, option)\"\n (mouseenter)=\"selectedIndex=idx\" (mouseleave)=\"selectedIndex=-1\">\n <span *ngIf=\"option\" [innerHtml]=\"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 } });
2363
+ StreetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: StreetComponent, selector: "bp-street", inputs: { labelResourceKey: "labelResourceKey", maxSuggesionCount: "maxSuggesionCount", visibleSuggesionCount: "visibleSuggesionCount", sortCriteria: "sortCriteria", baseUrl: "baseUrl", addressParams: "addressParams", prefillData: "prefillData", showDebugMessageToConsole: "showDebugMessageToConsole", postalCode: "postalCode", locality: "locality", inputText: "inputText", messageOption: "messageOption", allowNoValidation: "allowNoValidation", validatedByBackend: "validatedByBackend", numberOfExceptions: "numberOfExceptions", inputLang: "inputLang", isReadonly: "isReadonly" }, outputs: { messageChanged: "messageChanged", addressChanged: "addressChanged", focusEvent: "focusEvent", blurEvent: "blurEvent", textChangeEvent: "textChangeEvent", clearInputEventEmitter: "clearInputEventEmitter", prefillEventEmitter: "prefillEventEmitter", numberOfExceptionsEmitter: "numberOfExceptionsEmitter" }, viewQueries: [{ propertyName: "streetSearchInput", first: true, predicate: ["streetSearchInput"], descendants: true }, { propertyName: "streetList", first: true, predicate: ["streetList"], 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\" #streetSearchInput class=\"bpaac-input\" \n [readonly]=\"isReadonly\"\n [style.background-color]=\"!isParamsComplete() ? 'lightgrey' : ''\" \n [style.color]=\" getTextColor() \"\n [disabled]=\"(validatedByBackend && (!locality || locality.trim().length === 0)) \n || (!validatedByBackend && ((!postalCode || postalCode.trim().length === 0) && (!locality || locality.trim().length === 0)))\" (keydown)=\"checkKeyDown($event)\" \n (input)=\"onInputChange()\" (click)=\"onInputClick()\"\n [(ngModel)]=\"searchText\" id=\"streetInputField\" [attr.placeholder]=\"placeHolderText\" autocomplete=\"off\"\n (blur)=\"onBlur($event)\" (focus)=\"onFocus()\" />\n <div id=\"bpaac-clear-street-button\" *ngIf=\"mayShowClearButton()\" (click)=\"clearInput(true)\" class=\"bpaac-clear\">\n </div>\n </div>\n <!--<div ng-transclude></div>-->\n <input id=\"bpaac-street-typeahead\" type=\"text\" disabled autocomplete=\"off\" [(ngModel)]=\"bpTypeAhead\" />\n </div>\n <div [hidden]=\"collapseDropdown\" class=\"bpaac-dropdown-menu-container\" *ngIf=\"suggestions && suggestions.length>0\">\n <div #streetList [appVisibleSuggestion]=\"visibleSuggesionCount\" id=\"bpaac-street-dropdown\" class=\"bpaac-dropdown-menu\">\n <ul role=\"listbox\" id=\"bpaac-street-suggestionsList\" class=\"list-unstyled\">\n <li role=\"option\" *ngFor=\"let option of suggestions; let idx = index\" [ngClass]=\"{'active':(selectedIndex==idx)}\" (mousedown)=\"clickSuggestion($event, option)\"\n (mouseenter)=\"selectedIndex=idx\" (mouseleave)=\"selectedIndex=-1\">\n <span *ngIf=\"option\" [innerHtml]=\"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 } });
2287
2364
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: StreetComponent, decorators: [{
2288
2365
  type: Component,
2289
2366
  args: [{ selector: 'bp-street', 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\" #streetSearchInput class=\"bpaac-input\" \n [readonly]=\"isReadonly\"\n [style.background-color]=\"!isParamsComplete() ? 'lightgrey' : ''\" \n [style.color]=\" getTextColor() \"\n [disabled]=\"(validatedByBackend && (!locality || locality.trim().length === 0)) \n || (!validatedByBackend && ((!postalCode || postalCode.trim().length === 0) && (!locality || locality.trim().length === 0)))\" (keydown)=\"checkKeyDown($event)\" \n (input)=\"onInputChange()\" (click)=\"onInputClick()\"\n [(ngModel)]=\"searchText\" id=\"streetInputField\" [attr.placeholder]=\"placeHolderText\" autocomplete=\"off\"\n (blur)=\"onBlur($event)\" (focus)=\"onFocus()\" />\n <div id=\"bpaac-clear-street-button\" *ngIf=\"mayShowClearButton()\" (click)=\"clearInput(true)\" class=\"bpaac-clear\">\n </div>\n </div>\n <!--<div ng-transclude></div>-->\n <input id=\"bpaac-street-typeahead\" type=\"text\" disabled autocomplete=\"off\" [(ngModel)]=\"bpTypeAhead\" />\n </div>\n <div [hidden]=\"collapseDropdown\" class=\"bpaac-dropdown-menu-container\" *ngIf=\"suggestions && suggestions.length>0\">\n <div #streetList [appVisibleSuggestion]=\"visibleSuggesionCount\" id=\"bpaac-street-dropdown\" class=\"bpaac-dropdown-menu\">\n <ul role=\"listbox\" id=\"bpaac-street-suggestionsList\" class=\"list-unstyled\">\n <li role=\"option\" *ngFor=\"let option of suggestions; let idx = index\" [ngClass]=\"{'active':(selectedIndex==idx)}\" (mousedown)=\"clickSuggestion($event, option)\"\n (mouseenter)=\"selectedIndex=idx\" (mouseleave)=\"selectedIndex=-1\">\n <span *ngIf=\"option\" [innerHtml]=\"option.string | highlightSuggestion : wordList\"></span>\n </li>\n </ul>\n </div>\n </div>\n</div>\n", styles: [""] }]
@@ -2303,6 +2380,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImpor
2303
2380
  type: Input
2304
2381
  }], baseUrl: [{
2305
2382
  type: Input
2383
+ }], addressParams: [{
2384
+ type: Input
2306
2385
  }], prefillData: [{
2307
2386
  type: Input
2308
2387
  }], showDebugMessageToConsole: [{
@@ -2629,7 +2708,7 @@ class StreetNumberComponent {
2629
2708
  else {
2630
2709
  this.isPrefillWithNoMatch = false;
2631
2710
  }
2632
- }, () => this.handleGetStreetError());
2711
+ }, () => this.handleGetStreetError(source));
2633
2712
  }
2634
2713
  }
2635
2714
  getTextColor() {
@@ -2676,7 +2755,12 @@ class StreetNumberComponent {
2676
2755
  /* if (this.showDebugMessageToConsole) {
2677
2756
  console.log('street-number::isParamsComplete', this.postalCode, this.locality, this.streetName);
2678
2757
  } */
2679
- return this.isValid(this.postalCode) && this.isValid(this.locality) && this.isValid(this.streetName);
2758
+ if (!this.validatedByBackend) {
2759
+ return (this.isValid(this.postalCode) || this.isValid(this.locality)) && this.isValid(this.streetName);
2760
+ }
2761
+ else {
2762
+ return this.isValid(this.postalCode) && this.isValid(this.locality) && this.isValid(this.streetName);
2763
+ }
2680
2764
  }
2681
2765
  generateParameters() {
2682
2766
  const param = new QueryParameters({
@@ -2705,12 +2789,24 @@ class StreetNumberComponent {
2705
2789
  this.collapseDropdown = (this.prefilling === true && this.prefillData !== null)
2706
2790
  ? !this.prefillData.parameters.onFocusShowSuggestionsAfterPrefill : false;
2707
2791
  }
2708
- handleGetStreetError() {
2792
+ handleGetStreetError(source) {
2709
2793
  if (this.allowNoValidation && this.validatedByBackend) {
2710
2794
  this.numberOfExceptions += 1;
2711
2795
  this.numberOfExceptionsEmitter.emit(this.numberOfExceptions);
2796
+ this.setConnectionErrorMessage();
2797
+ }
2798
+ if (this.allowNoValidation && this.validatedByBackend && source === SourceType.SOURCE_PREFILLED) {
2799
+ this.numberOfExceptions += 1;
2800
+ this.numberOfExceptionsEmitter.emit(this.numberOfExceptions);
2801
+ this.setConnectionErrorMessage();
2802
+ this.onInputChange(source);
2803
+ }
2804
+ if (this.allowNoValidation && !this.validatedByBackend && source === SourceType.SOURCE_PREFILLED) {
2805
+ this.onInputChange(source);
2806
+ }
2807
+ if (!this.allowNoValidation && this.validatedByBackend) {
2808
+ this.setConnectionErrorMessage();
2712
2809
  }
2713
- this.setConnectionErrorMessage();
2714
2810
  }
2715
2811
  setConnectionErrorMessage() {
2716
2812
  this.errorCode = 'service-unavailable';
@@ -2968,16 +3064,35 @@ class StreetNumberComponent {
2968
3064
  }
2969
3065
  else {
2970
3066
  if (!this.validatedByBackend) {
2971
- let suggestion = {
2972
- 'string': this.searchText.toUpperCase(),
2973
- 'municipalityName': this.locality,
2974
- 'localityName': this.locality,
2975
- 'postalCode': this.postalCode,
2976
- 'searchBarString': this.searchText.toUpperCase(),
2977
- 'houseNumber': this.searchText.toUpperCase(),
2978
- 'streetName': this.streetName
2979
- };
2980
- this.setSelectedAddress(suggestion);
3067
+ if (source === SourceType.SOURCE_PREFILLED) {
3068
+ this.prefillData.prefillStreetNumberPerfectMatchFound = true;
3069
+ let suggestion = {
3070
+ 'address': {
3071
+ 'string': this.searchText.toUpperCase(),
3072
+ 'municipalityName': this.locality,
3073
+ 'localityName': this.locality,
3074
+ 'postalCode': this.postalCode,
3075
+ 'searchBarString': this.searchText.toUpperCase(),
3076
+ 'houseNumber': this.searchText.toUpperCase(),
3077
+ 'streetName': this.streetName
3078
+ }
3079
+ };
3080
+ this.prefillData.prefillStreetNumberPerfectMatchSuggestion = suggestion;
3081
+ this.isPrefillWithNoMatch = this.prefillData.prefillStreetNumberPerfectMatchFound === true ? false : true;
3082
+ this.prefillAnalyzeData();
3083
+ }
3084
+ else {
3085
+ let suggestion = {
3086
+ 'string': this.searchText.toUpperCase(),
3087
+ 'municipalityName': this.locality,
3088
+ 'localityName': this.locality,
3089
+ 'postalCode': this.postalCode,
3090
+ 'searchBarString': this.searchText.toUpperCase(),
3091
+ 'houseNumber': this.searchText.toUpperCase(),
3092
+ 'streetName': this.streetName
3093
+ };
3094
+ this.setSelectedAddress(suggestion);
3095
+ }
2981
3096
  }
2982
3097
  else {
2983
3098
  this.getTopSuggestions(source);
@@ -3578,7 +3693,7 @@ class BoxNumberComponent {
3578
3693
  else {
3579
3694
  this.isPrefillWithNoMatch = false;
3580
3695
  }
3581
- }, () => this.handleGetBoxError());
3696
+ }, () => this.handleGetBoxError(source));
3582
3697
  }
3583
3698
  }
3584
3699
  getTextColor() {
@@ -3661,12 +3776,24 @@ class BoxNumberComponent {
3661
3776
  this.collapseDropdown = (this.prefilling === true && this.prefillData !== null)
3662
3777
  ? !this.prefillData.parameters.onFocusShowSuggestionsAfterPrefill : false;
3663
3778
  }
3664
- handleGetBoxError() {
3779
+ handleGetBoxError(source) {
3665
3780
  if (this.allowNoValidation && this.validatedByBackend) {
3666
3781
  this.numberOfExceptions += 1;
3667
3782
  this.numberOfExceptionsEmitter.emit(this.numberOfExceptions);
3783
+ this.setConnectionErrorMessage();
3784
+ }
3785
+ if (this.allowNoValidation && this.validatedByBackend && source === SourceType.SOURCE_PREFILLED) {
3786
+ this.numberOfExceptions += 1;
3787
+ this.numberOfExceptionsEmitter.emit(this.numberOfExceptions);
3788
+ this.setConnectionErrorMessage();
3789
+ this.onInputChange(source);
3790
+ }
3791
+ if (this.allowNoValidation && !this.validatedByBackend && source === SourceType.SOURCE_PREFILLED) {
3792
+ this.onInputChange(source);
3793
+ }
3794
+ if (!this.allowNoValidation && this.validatedByBackend) {
3795
+ this.setConnectionErrorMessage();
3668
3796
  }
3669
- this.setConnectionErrorMessage();
3670
3797
  }
3671
3798
  setConnectionErrorMessage() {
3672
3799
  this.errorCode = 'service-unavailable';
@@ -3898,17 +4025,37 @@ class BoxNumberComponent {
3898
4025
  }
3899
4026
  else {
3900
4027
  if (!this.validatedByBackend) {
3901
- let suggestion = {
3902
- 'string': this.searchText.toUpperCase(),
3903
- 'municipalityName': this.locality,
3904
- 'localityName': this.locality,
3905
- 'postalCode': this.postalCode,
3906
- 'searchBarString': this.searchText.toUpperCase(),
3907
- 'streetName': this.streetName,
3908
- 'houseNumber': this.streetNumber,
3909
- 'boxNumber': this.searchText.toUpperCase()
3910
- };
3911
- this.setSelectedAddress(suggestion);
4028
+ if (source === SourceType.SOURCE_PREFILLED) {
4029
+ this.prefillData.prefillBoxNumberPerfectMatchFound = true;
4030
+ let suggestion = {
4031
+ 'address': {
4032
+ 'string': this.searchText.toUpperCase(),
4033
+ 'municipalityName': this.locality,
4034
+ 'localityName': this.locality,
4035
+ 'postalCode': this.postalCode,
4036
+ 'searchBarString': this.searchText.toUpperCase(),
4037
+ 'streetName': this.streetName,
4038
+ 'houseNumber': this.streetNumber,
4039
+ 'boxNumber': this.searchText.toUpperCase()
4040
+ }
4041
+ };
4042
+ this.prefillData.prefillBoxNumberPerfectMatchSuggestion = suggestion;
4043
+ this.isPrefillWithNoMatch = this.prefillData.prefillBoxNumberPerfectMatchFound === true ? false : true;
4044
+ this.prefillAnalyzeData();
4045
+ }
4046
+ else {
4047
+ let suggestion = {
4048
+ 'string': this.searchText.toUpperCase(),
4049
+ 'municipalityName': this.locality,
4050
+ 'localityName': this.locality,
4051
+ 'postalCode': this.postalCode,
4052
+ 'searchBarString': this.searchText.toUpperCase(),
4053
+ 'streetName': this.streetName,
4054
+ 'houseNumber': this.streetNumber,
4055
+ 'boxNumber': this.searchText.toUpperCase()
4056
+ };
4057
+ this.setSelectedAddress(suggestion);
4058
+ }
3912
4059
  }
3913
4060
  else {
3914
4061
  this.getTopSuggestions(source);
@@ -4972,7 +5119,11 @@ class LibAddressAutocompleteByComponentComponent {
4972
5119
  this.boxNumber = '';
4973
5120
  this.quitPrefillMode();
4974
5121
  this.autocompleteBoxNb.addressIsComplete = false;
5122
+ // this.autocompleteBoxNb.boxNumber = ''
4975
5123
  this.setAddress(null, 1);
5124
+ if (!event) {
5125
+ this.clearInputEventEmitter.emit('CLEAR_BOX_NUMBER');
5126
+ }
4976
5127
  // this.onClearInputEventEmitter(InputNameType.BOX_NUMBER);
4977
5128
  // $$ 7 this.setAddress(null, 1); // $$ ?????
4978
5129
  /*
@@ -5600,7 +5751,7 @@ class LibAddressAutocompleteByComponentComponent {
5600
5751
  }
5601
5752
  }
5602
5753
  LibAddressAutocompleteByComponentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: LibAddressAutocompleteByComponentComponent, deps: [{ token: Nis9Service }, { token: HttpService }], target: i0.ɵɵFactoryTarget.Component });
5603
- 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", nis9ServiceURL: "nis9ServiceURL" }, 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 [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 (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 [showDebugMessageToConsole]=\"showDebugMessageToConsole\"\r\n [baseUrl]=\"usedStreetUrl\"\r\n [prefillData]=\"streetPrefillData\"\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 [showDebugMessageToConsole]=\"showDebugMessageToConsole\"\r\n [baseUrl]=\"usedStreetNumberUrl\"\r\n [selectedAddress]=\"streetAddress\"\r\n [prefillData]=\"streetNumberPrefillData\"\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 (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 [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 [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", "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", "prefillData", "showDebugMessageToConsole", "postalCode", "locality", "inputText", "messageOption", "allowNoValidation", "validatedByBackend", "numberOfExceptions", "inputLang", "isReadonly"], outputs: ["messageChanged", "addressChanged", "focusEvent", "blurEvent", "textChangeEvent", "clearInputEventEmitter", "prefillEventEmitter", "numberOfExceptionsEmitter"] }, { type: StreetNumberComponent, selector: "bp-street-number", inputs: ["prefillData", "showDebugMessageToConsole", "labelResourceKey", "maxSuggesionCount", "visibleSuggesionCount", "sortCriteria", "baseUrl", "addressParams", "postalCode", "locality", "streetName", "notInListAllowed", "selectedAddress", "allowNoValidation", "validatedByBackend", "numberOfExceptions", "inputLang", "messageOption", "inputText", "isReadonly", "suggestionLevel"], outputs: ["messageChanged", "addressChanged", "focusEvent", "blurEvent", "textChangeEvent", "emptyResponseEvent", "clearInputEventEmitter", "prefillEventEmitter", "streetNumberChanged", "numberOfExceptionsEmitter"] }, { type: BoxNumberComponent, selector: "bp-box-number", inputs: ["prefillData", "showDebugMessageToConsole", "labelResourceKey", "maxSuggesionCount", "visibleSuggesionCount", "sortCriteria", "baseUrl", "addressParams", "postalCode", "locality", "streetName", "streetNumber", "selectedAddress", "notInListAllowed", "allowNoValidation", "validatedByBackend", "numberOfExceptions", "inputLang", "messageOption", "isReadonly", "suggestionLevel"], outputs: ["messageChanged", "addressChanged", "focusEvent", "blurEvent", "textChangeEvent", "emptyResponseEvent", "clearInputEventEmitter", "prefillEventEmitter", "boxNumberChanged", "numberOfExceptionsEmitter"] }], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
5754
+ 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", nis9ServiceURL: "nis9ServiceURL" }, 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 [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 (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 [showDebugMessageToConsole]=\"showDebugMessageToConsole\"\r\n [baseUrl]=\"usedStreetUrl\"\r\n [prefillData]=\"streetPrefillData\"\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 [showDebugMessageToConsole]=\"showDebugMessageToConsole\"\r\n [baseUrl]=\"usedStreetNumberUrl\"\r\n [selectedAddress]=\"streetAddress\"\r\n [prefillData]=\"streetNumberPrefillData\"\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 (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 [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 [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", "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", "showDebugMessageToConsole", "postalCode", "locality", "inputText", "messageOption", "allowNoValidation", "validatedByBackend", "numberOfExceptions", "inputLang", "isReadonly"], outputs: ["messageChanged", "addressChanged", "focusEvent", "blurEvent", "textChangeEvent", "clearInputEventEmitter", "prefillEventEmitter", "numberOfExceptionsEmitter"] }, { type: StreetNumberComponent, selector: "bp-street-number", inputs: ["prefillData", "showDebugMessageToConsole", "labelResourceKey", "maxSuggesionCount", "visibleSuggesionCount", "sortCriteria", "baseUrl", "addressParams", "postalCode", "locality", "streetName", "notInListAllowed", "selectedAddress", "allowNoValidation", "validatedByBackend", "numberOfExceptions", "inputLang", "messageOption", "inputText", "isReadonly", "suggestionLevel"], outputs: ["messageChanged", "addressChanged", "focusEvent", "blurEvent", "textChangeEvent", "emptyResponseEvent", "clearInputEventEmitter", "prefillEventEmitter", "streetNumberChanged", "numberOfExceptionsEmitter"] }, { type: BoxNumberComponent, selector: "bp-box-number", inputs: ["prefillData", "showDebugMessageToConsole", "labelResourceKey", "maxSuggesionCount", "visibleSuggesionCount", "sortCriteria", "baseUrl", "addressParams", "postalCode", "locality", "streetName", "streetNumber", "selectedAddress", "notInListAllowed", "allowNoValidation", "validatedByBackend", "numberOfExceptions", "inputLang", "messageOption", "isReadonly", "suggestionLevel"], outputs: ["messageChanged", "addressChanged", "focusEvent", "blurEvent", "textChangeEvent", "emptyResponseEvent", "clearInputEventEmitter", "prefillEventEmitter", "boxNumberChanged", "numberOfExceptionsEmitter"] }], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
5604
5755
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: LibAddressAutocompleteByComponentComponent, decorators: [{
5605
5756
  type: Component,
5606
5757
  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 [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 (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 [showDebugMessageToConsole]=\"showDebugMessageToConsole\"\r\n [baseUrl]=\"usedStreetUrl\"\r\n [prefillData]=\"streetPrefillData\"\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 [showDebugMessageToConsole]=\"showDebugMessageToConsole\"\r\n [baseUrl]=\"usedStreetNumberUrl\"\r\n [selectedAddress]=\"streetAddress\"\r\n [prefillData]=\"streetNumberPrefillData\"\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 (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 [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 [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: [""] }]