@hmcts/rpx-xui-common-lib 1.8.7-address-lookup → 1.8.7-address-component

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.
@@ -4850,6 +4850,9 @@
4850
4850
  this.addressesService = addressesService;
4851
4851
  }
4852
4852
  WriteAddressFieldComponent.prototype.ngOnInit = function () {
4853
+ if (!this.formGroup.get('address')) {
4854
+ this.formGroup.addControl('address', new forms.FormControl({}));
4855
+ }
4853
4856
  this.postcode = new forms.FormControl('');
4854
4857
  this.addressFormGroup.addControl('postcode', this.postcode);
4855
4858
  this.addressList = new forms.FormControl('');
@@ -4891,7 +4894,7 @@
4891
4894
  if (this.isExpanded) {
4892
4895
  return true;
4893
4896
  }
4894
- var address = this.lookupFormControl.value;
4897
+ var address = this.formGroup.get('address').value;
4895
4898
  var hasAddress = false;
4896
4899
  if (address) {
4897
4900
  Object.keys(address).forEach(function (key) {
@@ -4904,7 +4907,6 @@
4904
4907
  };
4905
4908
  WriteAddressFieldComponent.prototype.addressSelected = function () {
4906
4909
  this.addressField = this.addressList.value;
4907
- console.log('address fields', this.addressField);
4908
4910
  this.setFormValue();
4909
4911
  };
4910
4912
  WriteAddressFieldComponent.prototype.ngOnChanges = function (changes) {
@@ -4921,10 +4923,9 @@
4921
4923
  : "" + numberOfAddresses + (numberOfAddresses === 1 ? ' address ' : ' addresses ') + "found";
4922
4924
  };
4923
4925
  WriteAddressFieldComponent.prototype.setFormValue = function () {
4924
- if (this.lookupFormControl) {
4925
- this.lookupFormControl.patchValue(this.addressField);
4926
+ if (this.formGroup) {
4927
+ this.formGroup.get('address').patchValue(this.addressField);
4926
4928
  }
4927
- console.log(this.lookupFormControl, 'is form control');
4928
4929
  };
4929
4930
  return WriteAddressFieldComponent;
4930
4931
  }());
@@ -4940,8 +4941,7 @@
4940
4941
  ]; };
4941
4942
  WriteAddressFieldComponent.propDecorators = {
4942
4943
  formGroup: [{ type: i0.Input }],
4943
- isExpanded: [{ type: i0.Input }],
4944
- lookupFormControl: [{ type: i0.Input }]
4944
+ isExpanded: [{ type: i0.Input }]
4945
4945
  };
4946
4946
 
4947
4947
  var FeatureToggleDirective = /** @class */ (function () {