@everymatrix/general-input 1.80.9 → 1.80.11

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.
Files changed (27) hide show
  1. package/dist/cjs/{checkbox-group-input_13.cjs.entry.js → checkbox-group-input_14.cjs.entry.js} +422 -19
  2. package/dist/cjs/general-input.cjs.js +1 -1
  3. package/dist/cjs/index-3b546c2c.js +2 -2
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/collection/collection-manifest.json +1 -0
  6. package/dist/collection/components/general-input/general-input.js +64 -4
  7. package/dist/collection/components/postalcode-input/postalcode-input.css +221 -0
  8. package/dist/collection/components/postalcode-input/postalcode-input.js +673 -0
  9. package/dist/collection/components/radio-input/radio-input.js +2 -2
  10. package/dist/collection/components/select-input/select-input.js +3 -3
  11. package/dist/collection/components/tel-input/tel-input.js +2 -2
  12. package/dist/collection/components/text-input/text-input.css +17 -0
  13. package/dist/collection/components/text-input/text-input.js +79 -6
  14. package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.js +2 -2
  15. package/dist/collection/components/twofa-input/twofa-input.js +2 -2
  16. package/dist/collection/utils/locale.utils.js +3 -0
  17. package/dist/esm/{checkbox-group-input_13.entry.js → checkbox-group-input_14.entry.js} +422 -20
  18. package/dist/esm/general-input.js +1 -1
  19. package/dist/esm/index-ca174b7a.js +2 -2
  20. package/dist/esm/loader.js +1 -1
  21. package/dist/general-input/{checkbox-group-input_13.entry.js → checkbox-group-input_14.entry.js} +165 -165
  22. package/dist/general-input/general-input.esm.js +1 -1
  23. package/dist/types/components/general-input/general-input.d.ts +18 -2
  24. package/dist/types/components/postalcode-input/postalcode-input.d.ts +111 -0
  25. package/dist/types/components/text-input/text-input.d.ts +12 -0
  26. package/dist/types/components.d.ts +165 -4
  27. package/package.json +1 -1
@@ -28,6 +28,9 @@ const TRANSLATIONS = {
28
28
  "twofaDescription": "<p> We have sent the verification code to <p> {destination}. </p> </p> <p> Please insert the PIN below. </p>",
29
29
  "twofaResendMessage": "Didn't receive the verification code?",
30
30
  "twofaResendButton": "Resend",
31
+ "enterIEAddressManually": "For IRE, enter the address manually",
32
+ "postalLookUpNoAddressFound": "No addresses found for this postal code",
33
+ "searchingForAddresses": "Searching for addresses...",
31
34
  },
32
35
  "hu": {
33
36
  "dateError": "A választott dátumnak {min} és {max} között kell lennie",
@@ -12807,6 +12810,9 @@ const GeneralInput = class {
12807
12810
  this.emitOnClick = false;
12808
12811
  this.twofaDestination = undefined;
12809
12812
  this.twofaResendIntervalSeconds = 60;
12813
+ this.haspostalcodelookup = undefined;
12814
+ this.postalcodelength = undefined;
12815
+ this.addresses = [];
12810
12816
  }
12811
12817
  connectedCallback() {
12812
12818
  if (this.translationUrl) {
@@ -12817,7 +12823,12 @@ const GeneralInput = class {
12817
12823
  var _a;
12818
12824
  switch ((_a = this.type) === null || _a === void 0 ? void 0 : _a.toLowerCase()) {
12819
12825
  case 'text':
12820
- return h("text-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
12826
+ if (this.haspostalcodelookup && this.name === 'PostalCode') {
12827
+ return h("postalcode-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, postalcodelength: this.postalcodelength, addresses: this.addresses });
12828
+ }
12829
+ else {
12830
+ return h("text-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, haspostalcodelookup: this.haspostalcodelookup });
12831
+ }
12821
12832
  case 'email':
12822
12833
  return h("email-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
12823
12834
  case 'number':
@@ -12845,7 +12856,7 @@ const GeneralInput = class {
12845
12856
  }
12846
12857
  }
12847
12858
  render() {
12848
- return (h(Host, { key: 'a90dc97926e4f89518fc8520505cf59281840e20', class: `general-input--${this.name}`, onClick: this.handleClick }, this.renderInput()));
12859
+ return (h(Host, { key: '7f268156d7372f46b27b38762a2c01281ada038c', class: `general-input--${this.name}`, onClick: this.handleClick }, this.renderInput()));
12849
12860
  }
12850
12861
  };
12851
12862
  GeneralInput.style = GeneralInputStyle0;
@@ -13244,6 +13255,354 @@ const PasswordInput = class {
13244
13255
  };
13245
13256
  PasswordInput.style = PasswordInputStyle0;
13246
13257
 
13258
+ const postalcodeInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.text{font-family:\"Roboto\";font-style:normal}.text__wrapper{position:relative;width:100%;display:flex;flex-direction:column;gap:5px}.text__wrapper--autofilled{pointer-events:none}.text__wrapper--autofilled .text__label{color:var(--emw--registration-typography, var(--emw--color-black, #000000))}.text__wrapper--autofilled .text__input::part(input-field){color:var(--emw--color-black, #000000)}.text__wrapper--flex{display:flex;gap:5px}.text__wrapper--relative{position:relative}.text__label{font-family:inherit;font-style:normal;font-weight:500;font-size:16px;line-height:20px;color:var(--emw--registration-typography, var(--emw--color-black, #000000))}.text__label--required::after{content:\"*\";font-family:inherit;color:var(--emw--login-color-primary, var(--emw--color-primary, #22B04E));margin-left:2px}.text__input{font-family:inherit;width:100%;height:44px;border:1px solid var(--emw--color-gray-100, #E6E6E6);background-color:var(--emw--color-white, #FFFFFF);color:var(--emw--color-black, #000000);border-radius:5px;font-size:16px;font-weight:300;line-height:1.5;padding:5px 15px}.text__input:focus{border:1px solid var(--emw--login-color-primary, var(--emw--color-primary, #22B04E))}.text__input--invalid{border:1px solid var(--emw--color-error, var(--emw--color-red, #ed0909))}.text__input::placeholder{color:var(--emw--color-gray-150, #828282)}.text__error-message{position:absolute;top:calc(100% + 5px);left:0;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.text__tooltip-icon{width:16px;height:auto}.text__tooltip{position:absolute;top:0;left:20px;background-color:var(--emw--color-white, #FFFFFF);border:1px solid var(--emw--color-gray-100, #E6E6E6);color:var(--emw--registration-typography, var(--emw--color-black, #000000));padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.text__tooltip.visible{opacity:1}.input__text-wrapper{position:relative}.input__addresses-container{position:relative;left:0;width:100%;background:var(--emw--color-white);border:1px solid var(--emw--color-gray-100, #E6E6E6);border-radius:8px;box-shadow:0 4px 12px rgba(0, 0, 0, 0.1);max-height:200px;overflow-y:auto;z-index:999;margin-top:4px}.input__addresses-container .options{padding:4px 0}.input__addresses-container .option{padding:8px 12px;cursor:pointer;border-bottom:1px solid var(--emw--color-gray-100, #E6E6E6);font-size:14px;line-height:1.4;transition:background-color 0.2s ease;color:var(--emw--registration-gray-800, #333)}.input__addresses-container .option:last-child{border-bottom:none}.input__addresses-container .option:hover{background-color:var(--emw--registration-lightgray-100, #f8f9fa)}.input__addresses-container .option:active{background-color:var(--emw--registration-lightgray-200, #e9ecef)}.input__addresses-container::-webkit-scrollbar{width:6px}.input__addresses-container::-webkit-scrollbar-track{background:var(--emw--registration-lightgray-150, #f1f1f1);border-radius:3px}.input__addresses-container::-webkit-scrollbar-thumb{background:var(--emw--registration-lightgray-300, #c1c1c1);border-radius:3px}.input__addresses-container::-webkit-scrollbar-thumb:hover{background:var(--emw--registration-lightgray-400, #a8a8a8)}.postalcode__no-results-message{color:var(--emw--color-error, var(--emw--color-red, #ed0909));margin-top:10px}.address__manual-input-msg{text-decoration:underline;margin-top:10px;cursor:pointer;transition:opacity 0.3s ease}.address__manual-input-msg:active{opacity:0.7}.postalcode__loading-spinner{display:flex;align-items:center;gap:8px;padding:12px;color:var(--emw--registration-gray-600, #666);border:1px solid var(--emw--color-gray-100, #E6E6E6);border-top:none;background-color:var(--emw--registration-lightgray-50, #f9f9f9)}.loading-spinner{width:14px;height:14px;border:2px solid var(--emw--color-gray-100, #E6E6E6);border-top:2px solid var(--emw--registration-gray-600, #666);border-radius:50%;animation:spin 0.8s linear infinite}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.pulse-border{border:1px solid var(--emw--registration-red-600, #cc4c4c);animation:pulse 0.5s ease-in-out 2 forwards}@keyframes pulse{0%{border-color:var(--emw--registration-red-600, #cc4c4c)}50%{border-color:var(--emw--registration-red-400, #e57373)}100%{border-color:var(--emw--color-gray-100, #E6E6E6)}}";
13259
+ const PostalcodeInputStyle0 = postalcodeInputCss;
13260
+
13261
+ const PostalCodeInput = class {
13262
+ constructor(hostRef) {
13263
+ registerInstance(this, hostRef);
13264
+ this.sendAddressValue = createEvent(this, "sendAddressValue", 7);
13265
+ this.sendValidityState = createEvent(this, "sendValidityState", 7);
13266
+ this.sendInputValue = createEvent(this, "sendInputValue", 7);
13267
+ this.value = '';
13268
+ this.validationPattern = '';
13269
+ this.hasManualAddressBeenTriggered = false;
13270
+ this.touched = false;
13271
+ this.maxPostalCodeLength = '10';
13272
+ this.handleInput = (event) => {
13273
+ const inputValue = event.target.value;
13274
+ const upperCaseValue = inputValue.toUpperCase();
13275
+ this.value = upperCaseValue;
13276
+ this.touched = true;
13277
+ this.currentPostalCode = upperCaseValue;
13278
+ this.showNoResultsMessage = false;
13279
+ if (this.inputReference) {
13280
+ this.inputReference.value = upperCaseValue;
13281
+ }
13282
+ if (this.value.length < this.postalcodelength) {
13283
+ this.openAddressDropdown = false;
13284
+ this.isFetchingAddresses = false;
13285
+ }
13286
+ if (this.value === '' || this.value.length < 1) {
13287
+ this.openAddressDropdown = false;
13288
+ this.isFetchingAddresses = false;
13289
+ }
13290
+ if (this.debounceTime) {
13291
+ clearTimeout(this.debounceTime);
13292
+ }
13293
+ this.debounceTime = setTimeout(() => {
13294
+ // Trigger address lookup when postal code reaches minimum length
13295
+ if (this.value.length >= this.postalcodelength) {
13296
+ sessionStorage.setItem('currentPostalCode', this.value);
13297
+ this.showNoResultsMessage = false;
13298
+ if (this.addresses && this.addresses.length > 0) {
13299
+ this.openAddressDropdown = true;
13300
+ }
13301
+ }
13302
+ // Validate input and update error state
13303
+ const wasValid = this.isValid;
13304
+ this.isValid = this.setValidity();
13305
+ this.errorMessage = this.setErrorMessage();
13306
+ // Emit validity state if changed
13307
+ if (wasValid !== this.isValid) {
13308
+ this.validityStateHandler({ valid: this.isValid, name: this.name });
13309
+ }
13310
+ this.emitValueHandler(true);
13311
+ }, 300);
13312
+ };
13313
+ this.handleBlur = (event) => {
13314
+ this.value = event.target.value;
13315
+ this.touched = true;
13316
+ this.isValid = this.setValidity();
13317
+ this.errorMessage = this.setErrorMessage();
13318
+ this.validityStateHandler({ valid: this.isValid, name: this.name });
13319
+ this.showNoResultsMessage = false;
13320
+ // hide 'no addresses found' msg
13321
+ if (!this.openAddressDropdown) {
13322
+ this.showNoResultsMessage = false;
13323
+ }
13324
+ };
13325
+ this.handleFocus = () => {
13326
+ const hasSearchTerm = this.currentPostalCode && this.currentPostalCode.length >= this.postalcodelength;
13327
+ if (hasSearchTerm) {
13328
+ this.openAddressDropdown = true;
13329
+ }
13330
+ };
13331
+ this.handlePostalCode = (e, data) => {
13332
+ e.stopPropagation();
13333
+ const address1 = `${data.street}`.trim();
13334
+ const address2 = `${data.number}`.trim();
13335
+ const city = `${data.city}`.trim();
13336
+ this.sendAddressValue.emit({ city, address1, address2 });
13337
+ this.value = this.currentPostalCode.toLocaleUpperCase();
13338
+ this.touched = true;
13339
+ this.isValid = true;
13340
+ this.openAddressDropdown = false;
13341
+ this.showNoResultsMessage = false;
13342
+ this.isFetchingAddresses = false;
13343
+ this.valueHandler({ name: this.name, value: this.value });
13344
+ this.validityStateHandler({ valid: true, name: this.name });
13345
+ this.valueHandler({ name: 'address1', value: address1 });
13346
+ this.valueHandler({ name: 'City', value: city });
13347
+ if (address2) {
13348
+ this.valueHandler({ name: 'address2', value: address2 });
13349
+ }
13350
+ this.refreshTrigger++;
13351
+ };
13352
+ this.enterAddressManually = () => {
13353
+ const refs = window.targetInputRefs;
13354
+ if (!refs)
13355
+ return;
13356
+ // Define all address fields that need to be filled manually
13357
+ const allFields = [
13358
+ { name: 'PostalCode', ref: refs['PostalCode'], minLength: this.postalcodelength },
13359
+ { name: 'address1', ref: refs['address1'] },
13360
+ { name: 'address2', ref: refs['address2'] },
13361
+ { name: 'City', ref: refs['City'] }
13362
+ ];
13363
+ // Required fields for address validation
13364
+ const requiredFields = [
13365
+ { name: 'PostalCode', ref: refs['PostalCode'], minLength: this.postalcodelength },
13366
+ { name: 'address1', ref: refs['address1'] },
13367
+ { name: 'City', ref: refs['City'] }
13368
+ ];
13369
+ // find the first required field that is empty or incomplete
13370
+ const targetField = requiredFields.find(field => {
13371
+ var _a;
13372
+ const value = ((_a = field.ref) === null || _a === void 0 ? void 0 : _a.value) || '';
13373
+ return field.minLength ? (value.length === 0 || value.length < field.minLength) : value.length === 0;
13374
+ });
13375
+ const targetInput = (targetField === null || targetField === void 0 ? void 0 : targetField.ref) || refs['address1'] || refs['PostalCode'];
13376
+ targetInput.scrollIntoView({ behavior: 'smooth', block: 'center' });
13377
+ if (!this.hasManualAddressBeenTriggered) {
13378
+ this.hasManualAddressBeenTriggered = true;
13379
+ allFields.forEach(field => {
13380
+ var _a;
13381
+ if (field.ref) {
13382
+ const inputElement = ((_a = field.ref.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('input')) || field.ref;
13383
+ if (inputElement) {
13384
+ inputElement.classList.add('pulse-border');
13385
+ // remove animation when it ends
13386
+ const handleAnimationEnd = () => {
13387
+ inputElement.classList.remove('pulse-border');
13388
+ inputElement.removeEventListener('animationend', handleAnimationEnd);
13389
+ };
13390
+ inputElement.addEventListener('animationend', handleAnimationEnd);
13391
+ }
13392
+ }
13393
+ });
13394
+ targetInput.focus();
13395
+ }
13396
+ else {
13397
+ targetInput.focus();
13398
+ }
13399
+ };
13400
+ this.setClientStyling = () => {
13401
+ let sheet = document.createElement('style');
13402
+ sheet.innerHTML = this.clientStyling;
13403
+ this.stylingContainer.prepend(sheet);
13404
+ };
13405
+ this.handleOutsideClick = (event) => {
13406
+ if (!this.openAddressDropdown)
13407
+ return;
13408
+ const path = event.composedPath ? event.composedPath() : [];
13409
+ const isInputClick = path.includes(this.inputReference);
13410
+ const isDropdownClick = path.includes(this.addressesDropdownRef);
13411
+ const isOptionClick = path.some(el => { var _a; return el instanceof Element && ((_a = el.classList) === null || _a === void 0 ? void 0 : _a.contains('option')); });
13412
+ if (!isInputClick && !isDropdownClick && !isOptionClick) {
13413
+ this.openAddressDropdown = false;
13414
+ this.showNoResultsMessage = false;
13415
+ }
13416
+ };
13417
+ this.name = 'PostalCode';
13418
+ this.displayName = undefined;
13419
+ this.placeholder = undefined;
13420
+ this.validation = undefined;
13421
+ this.defaultValue = '';
13422
+ this.autofilled = undefined;
13423
+ this.tooltip = undefined;
13424
+ this.language = undefined;
13425
+ this.emitValue = undefined;
13426
+ this.clientStyling = '';
13427
+ this.postalcodelength = undefined;
13428
+ this.addresses = undefined;
13429
+ this.isValid = undefined;
13430
+ this.errorMessage = '';
13431
+ this.limitStylingAppends = false;
13432
+ this.showTooltip = false;
13433
+ this.selectedCountryCode = '';
13434
+ this.currentPostalCode = '';
13435
+ this.openAddressDropdown = false;
13436
+ this.showNoResultsMessage = false;
13437
+ this.refreshTrigger = 0;
13438
+ this.isFetchingAddresses = false;
13439
+ }
13440
+ handleStylingChange(newValue, oldValue) {
13441
+ if (newValue !== oldValue)
13442
+ this.setClientStyling();
13443
+ }
13444
+ validityChanged() {
13445
+ this.validityStateHandler({ valid: this.isValid, name: this.name });
13446
+ if (this.emitValue == true) {
13447
+ this.valueHandler({ name: this.name, value: this.value });
13448
+ }
13449
+ }
13450
+ emitValueHandler(newValue) {
13451
+ if (newValue == true && this.isValid) {
13452
+ this.valueHandler({ name: this.name, value: this.value });
13453
+ }
13454
+ if (newValue === true && !this.value.length) {
13455
+ this.valueHandler({ name: this.name, value: this.value });
13456
+ }
13457
+ }
13458
+ handleAddresses(newValue) {
13459
+ if (newValue && newValue.length > 0) {
13460
+ this.openAddressDropdown = true;
13461
+ this.showNoResultsMessage = false;
13462
+ }
13463
+ else {
13464
+ this.openAddressDropdown = false;
13465
+ if (this.isFetchingAddresses && this.currentPostalCode.length >= this.postalcodelength) {
13466
+ setTimeout(() => {
13467
+ if (this.currentPostalCode.length >= this.postalcodelength && !this.isFetchingAddresses) {
13468
+ this.showNoResultsMessage = true;
13469
+ }
13470
+ }, 200);
13471
+ }
13472
+ }
13473
+ this.isFetchingAddresses = false;
13474
+ }
13475
+ validityStateHandler(inputStateEvent) {
13476
+ this.sendValidityState.emit(inputStateEvent);
13477
+ }
13478
+ valueHandler(inputValueEvent) {
13479
+ this.sendInputValue.emit(inputValueEvent);
13480
+ }
13481
+ handleClickOutside(event) {
13482
+ const path = event.composedPath();
13483
+ if (!path.includes(this.tooltipIconReference) && !path.includes(this.tooltipReference)) {
13484
+ this.showTooltip = false;
13485
+ }
13486
+ }
13487
+ handleCountryCodeUpdate(event) {
13488
+ const { name, value } = event.detail;
13489
+ this.selectedCountryCode = value;
13490
+ if (name === 'CountryCode') {
13491
+ this.resetPostalCodeField();
13492
+ this.refreshTrigger++;
13493
+ }
13494
+ }
13495
+ handleFetchStarted() {
13496
+ this.showNoResultsMessage = false;
13497
+ this.isFetchingAddresses = true;
13498
+ this.openAddressDropdown = false;
13499
+ }
13500
+ connectedCallback() {
13501
+ this.validationPattern = this.setPattern();
13502
+ }
13503
+ componentDidRender() {
13504
+ if (!this.limitStylingAppends && this.stylingContainer) {
13505
+ if (this.clientStyling)
13506
+ this.setClientStyling();
13507
+ this.limitStylingAppends = true;
13508
+ }
13509
+ }
13510
+ componentDidLoad() {
13511
+ if (this.defaultValue) {
13512
+ this.value = this.defaultValue;
13513
+ this.valueHandler({ name: this.name, value: this.value });
13514
+ }
13515
+ if (this.inputReference) {
13516
+ window.targetInputRefs = window.targetInputRefs || {};
13517
+ window.targetInputRefs[this.name] = this.inputReference;
13518
+ }
13519
+ this.isValid = this.setValidity();
13520
+ document.addEventListener('click', this.handleOutsideClick);
13521
+ }
13522
+ disconnectedCallback() {
13523
+ document.removeEventListener('click', this.handleOutsideClick);
13524
+ }
13525
+ setValidity() {
13526
+ if (!this.inputReference) {
13527
+ return false;
13528
+ }
13529
+ const inputIsValid = this.inputReference.validity.valid;
13530
+ const inputMatchValidation = !this.inputReference.value || this.inputReference.value.match(this.validationPattern) !== null;
13531
+ return inputIsValid && inputMatchValidation;
13532
+ }
13533
+ setPattern() {
13534
+ var _a, _b;
13535
+ if (((_a = this.validation.custom) === null || _a === void 0 ? void 0 : _a.length) > 0) {
13536
+ return (_b = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _b === void 0 ? void 0 : _b.pattern;
13537
+ }
13538
+ }
13539
+ setErrorMessage() {
13540
+ var _a, _b;
13541
+ if (!this.touched) {
13542
+ return '';
13543
+ }
13544
+ if (this.inputReference.validity.valueMissing) {
13545
+ return translate('requiredError', this.language);
13546
+ }
13547
+ if (this.inputReference.validity.tooShort || this.inputReference.validity.tooLong) {
13548
+ return translate('lengthError', this.language, { values: { minLength: this.validation.minLength, maxLength: this.validation.maxLength } });
13549
+ }
13550
+ if (this.inputReference.value.match(this.validationPattern) == null) {
13551
+ const errorCode = (_a = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _a === void 0 ? void 0 : _a.errorKey;
13552
+ const errorMessage = (_b = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _b === void 0 ? void 0 : _b.errorMessage;
13553
+ return translate(`${errorCode}`, this.language) || errorMessage;
13554
+ }
13555
+ return '';
13556
+ }
13557
+ resetPostalCodeField() {
13558
+ this.value = '';
13559
+ this.currentPostalCode = '';
13560
+ this.showNoResultsMessage = false;
13561
+ this.openAddressDropdown = false;
13562
+ this.isFetchingAddresses = false;
13563
+ sessionStorage.removeItem('currentPostalCode');
13564
+ if (this.inputReference) {
13565
+ this.inputReference.value = '';
13566
+ }
13567
+ this.valueHandler({ name: this.name, value: '' });
13568
+ this.validityStateHandler({ valid: false, name: this.name });
13569
+ }
13570
+ renderTooltip() {
13571
+ if (this.showTooltip) {
13572
+ return (h("div", { class: `text__tooltip ${this.showTooltip ? 'visible' : ''}`, ref: (el) => this.tooltipReference = el, innerHTML: this.tooltip }));
13573
+ }
13574
+ return null;
13575
+ }
13576
+ determineInputValue() {
13577
+ // Store address input refs for manual entry function
13578
+ if (this.inputReference && this.name) {
13579
+ window.targetInputRefs = window.targetInputRefs || {};
13580
+ window.targetInputRefs[this.name] = this.inputReference;
13581
+ }
13582
+ return this.value || this.currentPostalCode || sessionStorage.getItem('currentPostalCode') || this.defaultValue;
13583
+ }
13584
+ render() {
13585
+ var _a, _b;
13586
+ let invalidClass = '';
13587
+ if (this.touched) {
13588
+ invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
13589
+ }
13590
+ let isUKCountry = this.selectedCountryCode === 'UK' || this.selectedCountryCode === 'GB';
13591
+ let showAddressesDropdown = ((_a = this.addresses) === null || _a === void 0 ? void 0 : _a.length) > 0 && this.openAddressDropdown && isUKCountry;
13592
+ let shouldShowNoResults = this.showNoResultsMessage && this.currentPostalCode &&
13593
+ this.currentPostalCode.length >= this.postalcodelength && (((_b = this.addresses) === null || _b === void 0 ? void 0 : _b.length) === 0) && isUKCountry;
13594
+ let showLoadingMessage = this.isFetchingAddresses && this.currentPostalCode.length >= this.postalcodelength;
13595
+ return (h("div", { key: '9618edb268c4c1cffa450bb3dbd778ab5197e6f3', class: `text__wrapper ${this.name}__input ${this.autofilled ? 'text__wrapper--autofilled' : ''}`, ref: el => this.stylingContainer = el }, h("div", { key: '932d83f8895024ba1d7490e01505b651625def00', class: 'text__wrapper--flex' }, h("label", { key: '0c2281a6670fda698469815be19d0e99b18dbe65', class: `text__label ${this.validation.mandatory ? 'text__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: '70eacd1179b9b9dc0def1cd18fab22bd090999b0', class: 'text__wrapper--relative' }, this.tooltip && (h("img", { key: '1237da82659dc9558020b0675a1a645c500f77de', class: 'text__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip })), this.renderTooltip())), h("div", { key: '65db0837d507b90217802e6f6d08800ae91404c6', class: 'input__text-wrapper' }, h("input", { key: '4c05c552d1d1dfe70fb872d44c0f2bc3f4c62c31', name: this.name, id: `${this.name}__input`, value: this.determineInputValue(), type: 'text', class: `text__input ${invalidClass}`, placeholder: `${this.placeholder}`, ref: (el) => this.inputReference = el, readOnly: this.autofilled, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.maxPostalCodeLength, onInput: this.handleInput, onBlur: this.handleBlur, onFocus: this.handleFocus }), !isUKCountry && (h("p", { key: 'c0f93584fa3f970a27793178517807968a03d252', class: "address__manual-input-msg", onClick: () => this.enterAddressManually() }, translate('enterIEAddressManually', this.language))), showAddressesDropdown && (h("div", { key: '2f24716dbc7b5ed8f70f0f61a787c97fa75d3fba', class: "input__addresses-container", ref: (el) => (this.addressesDropdownRef = el) }, h("div", { key: '63b89521d94589aeb082f2ee98f31c0508c3b070', class: "options" }, this.addresses.map((addr, index) => (h("div", { key: index, class: "option", onClick: (e) => this.handlePostalCode(e, addr) }, addr.street, " ", addr.number, " ", addr.city)))))), showLoadingMessage && (h("div", { key: 'd1f3deaf9936e00ff05ac37d635a3dadb11a0db8', class: "postalcode__loading-spinner" }, h("div", { key: 'ee7c1a5275b8e5824a9e3ffbd39d1476ced9d0a1', class: "loading-spinner" }), h("span", { key: '198c01371a98fa07d35ff64fad5714176ffdcb0d' }, translate('searchingForAddresses', this.language)))), shouldShowNoResults && (h("div", { key: 'e4f098805673d2708bb3fe2ff6dccc61308fc27a', class: "postalcode__no-results-message" }, translate('postalLookUpNoAddressFound', this.language)))), h("small", { key: 'e84296325688a134e49f521ecfa1ff44ed13fcc9', class: 'text__error-message' }, this.errorMessage)));
13596
+ }
13597
+ static get watchers() { return {
13598
+ "clientStyling": ["handleStylingChange"],
13599
+ "isValid": ["validityChanged"],
13600
+ "emitValue": ["emitValueHandler"],
13601
+ "addresses": ["handleAddresses"]
13602
+ }; }
13603
+ };
13604
+ PostalCodeInput.style = PostalcodeInputStyle0;
13605
+
13247
13606
  const radioInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.radio__fieldset{border:none;position:relative}.radio__wrapper{display:flex;gap:5px}.radio__error-message{position:absolute;top:calc(100% + 5px);left:0;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.radio__tooltip-icon{position:absolute;right:0;bottom:10px}.radio__tooltip{position:absolute;bottom:35px;right:10px;background-color:var(--emw--color-white, #FFFFFF);border:1px solid var(--emw--color-gray-100, #E6E6E6);color:var(--emw--registration-typography, var(--emw--color-black, #000000));padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.radio__tooltip.visible{opacity:1}";
13248
13607
  const RadioInputStyle0 = radioInputCss;
13249
13608
 
@@ -13327,8 +13686,8 @@ const RadioInput = class {
13327
13686
  return null;
13328
13687
  }
13329
13688
  render() {
13330
- return h("fieldset", { key: '8dd2ac2660557c45e3e7e1a514d94e8e0f90d4f2', class: `radio__fieldset ${this.name}__input`, ref: el => this.stylingContainer = el }, h("legend", { key: '609396bda45ad1d2ceb49a023bdc090833724ed4', class: 'radio__legend' }, this.displayName, ":"), this.optionsGroup.map(option => h("div", { class: 'radio__wrapper' }, h("input", { type: "radio", class: 'radio__input', id: `${option.label}__input`, ref: (el) => this.inputReference = el, value: option.value, name: this.name, required: this.validation.mandatory, onClick: (e) => this.handleClick(e) }), h("label", { htmlFor: `${option.label}__input` }, option.label))), h("small", { key: 'e3c097e5f460316759d74e1f06a4f9f805deb29e', class: 'radio__error-message' }, this.errorMessage), this.tooltip &&
13331
- h("img", { key: 'a71bf8fe647776214c36a87befff42b39b95106a', class: 'radio__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip());
13689
+ return h("fieldset", { key: '88357307488334074a397c636210575b8af1e2c3', class: `radio__fieldset ${this.name}__input`, ref: el => this.stylingContainer = el }, h("legend", { key: '25f656d5b155c392cad79c89410833c3491531f8', class: 'radio__legend' }, this.displayName, ":"), this.optionsGroup.map(option => h("div", { class: 'radio__wrapper' }, h("input", { type: "radio", class: 'radio__input', id: `${option.label}__input`, ref: (el) => this.inputReference = el, value: option.value, name: this.name, required: this.validation.mandatory, onClick: (e) => this.handleClick(e) }), h("label", { htmlFor: `${option.label}__input` }, option.label))), h("small", { key: '08def575050905f964d6921d4ed4f071fccdf4da', class: 'radio__error-message' }, this.errorMessage), this.tooltip &&
13690
+ h("img", { key: '485fa4888f626f1cf44f179f498f257af6c41b58', class: 'radio__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip());
13332
13691
  }
13333
13692
  static get watchers() { return {
13334
13693
  "clientStyling": ["handleStylingChange"],
@@ -13526,10 +13885,10 @@ const SelectInput = class {
13526
13885
  if (this.touched) {
13527
13886
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
13528
13887
  }
13529
- return h("div", { key: '493268c1af30e1120317b916ed911598737405bd', class: `select__wrapper ${this.autofilled ? 'select__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '232dc6989da291dfaececee8199081394d33ee41', class: 'select__wrapper--flex' }, h("label", { key: 'fb03628e1953f679c21bd8da88bfe47f1bcbab4e', class: 'select__label', htmlFor: `${this.name}__input` }, `${this.displayName} ${this.validation.mandatory ? '*' : ''}`), h("div", { key: '02581db26e8093b6968fd91fbd08782dfc24118e', class: 'select__wrapper--relative' }, this.tooltip &&
13530
- h("img", { key: '4da026564dcee19491e055070341317266a888f9', class: 'select__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), this.isComboBox ? h("vaadin-combo-box", { name: this.name, id: `${this.name}__input`, class: `select__input ${invalidClass} ${this.autofilled ? 'select__input--autofilled' : ''}`, "item-label-path": "label", "item-value-path": "value", ref: (el) => this.vaadinCombo = el, readOnly: this.autofilled, required: (_a = this.validation) === null || _a === void 0 ? void 0 : _a.mandatory, value: this.value, placeholder: `${this.placeholder}`, items: this.displayedOptions, onChange: this.handleComboChange, onBlur: this.handleBlur })
13888
+ return h("div", { key: '68a8d63f045706ea65a8a9edf3aeec381ff93c52', class: `select__wrapper ${this.autofilled ? 'select__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '1e4c7d1ad9add75ff495ab2aec2bc1556339c8d7', class: 'select__wrapper--flex' }, h("label", { key: '8698e76f945ed1c9d94597ca9f12d8c03d54ce31', class: 'select__label', htmlFor: `${this.name}__input` }, `${this.displayName} ${this.validation.mandatory ? '*' : ''}`), h("div", { key: 'bf34dd8c2155e9eca8d9da427e9775ee5685c3c6', class: 'select__wrapper--relative' }, this.tooltip &&
13889
+ h("img", { key: 'f396770070f3e2710120bb87d059f78aa1b5e372', class: 'select__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), this.isComboBox ? h("vaadin-combo-box", { name: this.name, id: `${this.name}__input`, class: `select__input ${invalidClass} ${this.autofilled ? 'select__input--autofilled' : ''}`, "item-label-path": "label", "item-value-path": "value", ref: (el) => this.vaadinCombo = el, readOnly: this.autofilled, required: (_a = this.validation) === null || _a === void 0 ? void 0 : _a.mandatory, value: this.value, placeholder: `${this.placeholder}`, items: this.displayedOptions, onChange: this.handleComboChange, onBlur: this.handleBlur })
13531
13890
  :
13532
- h("vaadin-select", { name: this.name, popover: false, id: `${this.name}__input`, class: `select__input ${invalidClass} ${this.autofilled ? 'select__input--autofilled' : ''}`, "item-label-path": "label", "item-value-path": "value", ref: (el) => this.vaadinCombo = el, readOnly: this.autofilled, required: (_b = this.validation) === null || _b === void 0 ? void 0 : _b.mandatory, value: this.value, placeholder: `${this.placeholder}`, items: this.displayedOptions, onChange: this.handleSelectChange, "no-vertical-overlap": true, noVerticalOverlap: true }), h("small", { key: 'f0f0de66fe7a135a2d514e41725be1c7b29c17c0', class: 'select__error-message' }, this.errorMessage));
13891
+ h("vaadin-select", { name: this.name, popover: false, id: `${this.name}__input`, class: `select__input ${invalidClass} ${this.autofilled ? 'select__input--autofilled' : ''}`, "item-label-path": "label", "item-value-path": "value", ref: (el) => this.vaadinCombo = el, readOnly: this.autofilled, required: (_b = this.validation) === null || _b === void 0 ? void 0 : _b.mandatory, value: this.value, placeholder: `${this.placeholder}`, items: this.displayedOptions, onChange: this.handleSelectChange, "no-vertical-overlap": true, noVerticalOverlap: true }), h("small", { key: '21327ad926828b95552046b42ac14f69d7012513', class: 'select__error-message' }, this.errorMessage));
13533
13892
  }
13534
13893
  static get watchers() { return {
13535
13894
  "clientStyling": ["handleStylingChange"],
@@ -13722,8 +14081,8 @@ const TelInput = class {
13722
14081
  if (this.touched) {
13723
14082
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
13724
14083
  }
13725
- return h("div", { key: '698bb9cc01d144ccf2f20fbac7d519c8b4523c23', class: `tel__wrapper ${this.autofilled ? 'tel__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '08792dad79d529f079011d1bd82a77b74865f1f0', class: 'tel__wrapper--flex-label' }, h("label", { key: '5528ee07e57b5855d03bb55c5d77608019983bde', class: `tel__label ${this.validation.mandatory ? 'tel__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: '5e62f2fe0751d9108422db4670c17ce623e97e8d', class: 'tel__wrapper--relative' }, this.tooltip &&
13726
- h("img", { key: '050486adda9b04f3ce3502bf7fe25450e564c54b', class: 'tel__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("div", { key: '8944d4b99907ab9c355ac392379064150bc73d70', class: `tel__wrapper--flex ${invalidClass}` }, h("vaadin-combo-box", { key: 'adcbc0cb5f371c10fe5a21a577647f5354a45428', class: 'tel__prefix', items: this.phoneCodesOptions, value: this.prefixValue, readOnly: this.disablePhonePrefix, onChange: (e) => this.handlePrefixInput(e) }), h("input", { key: '701228afeca7ccb0bccfde015fec41638a7901ec', type: "tel", ref: (el) => this.inputReference = el, id: `${this.name}__input`, readOnly: this.autofilled, class: `tel__input`, value: (_a = this.phoneValue) !== null && _a !== void 0 ? _a : '', placeholder: `${this.placeholder}`, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, pattern: this.validationPattern, onInput: this.handleInput, onBlur: this.handleBlur })), h("small", { key: '5230fb8be4b5b47cedc088f5ed777a3462492ed5', class: 'tel__error-message' }, this.errorMessage));
14084
+ return h("div", { key: '9b01d1059b470ec9f57c6f852df12aa17d7a58e2', class: `tel__wrapper ${this.autofilled ? 'tel__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '7ad94c73b7b14f63d1b0aa395cd4b2220d80bf7f', class: 'tel__wrapper--flex-label' }, h("label", { key: '2995bfd5f655c71a454281edf967ab4afff2b61c', class: `tel__label ${this.validation.mandatory ? 'tel__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: '45c874ffd76f0c56eb971728acc6bcf3c31afc64', class: 'tel__wrapper--relative' }, this.tooltip &&
14085
+ h("img", { key: '3ecfbb61507ea4fbe02c804679293adf7961ce18', class: 'tel__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("div", { key: 'b2dc1d8af7ea60bc56347ae73c315cf5539d6e7a', class: `tel__wrapper--flex ${invalidClass}` }, h("vaadin-combo-box", { key: '3ad4d43799026bd4f3b06d9ad94eee17e81daced', class: 'tel__prefix', items: this.phoneCodesOptions, value: this.prefixValue, readOnly: this.disablePhonePrefix, onChange: (e) => this.handlePrefixInput(e) }), h("input", { key: '6773fa69b3f657ccc4798db91b3c9966ef1ad6bc', type: "tel", ref: (el) => this.inputReference = el, id: `${this.name}__input`, readOnly: this.autofilled, class: `tel__input`, value: (_a = this.phoneValue) !== null && _a !== void 0 ? _a : '', placeholder: `${this.placeholder}`, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, pattern: this.validationPattern, onInput: this.handleInput, onBlur: this.handleBlur })), h("small", { key: '799b137bb4cf96cb7cffa77a6934eeab3e34f4ee', class: 'tel__error-message' }, this.errorMessage));
13727
14086
  }
13728
14087
  static get watchers() { return {
13729
14088
  "clientStyling": ["handleStylingChange"],
@@ -13733,7 +14092,7 @@ const TelInput = class {
13733
14092
  };
13734
14093
  TelInput.style = TelInputStyle0;
13735
14094
 
13736
- const textInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.text{font-family:\"Roboto\";font-style:normal}.text__wrapper{position:relative;width:100%;display:flex;flex-direction:column;gap:5px}.text__wrapper--autofilled{pointer-events:none}.text__wrapper--autofilled .text__label{color:var(--emw--registration-typography, var(--emw--color-black, #000000))}.text__wrapper--autofilled .text__input::part(input-field){color:var(--emw--color-black, #000000)}.text__wrapper--flex{display:flex;gap:5px}.text__wrapper--relative{position:relative}.text__label{font-family:inherit;font-style:normal;font-weight:500;font-size:16px;line-height:20px;color:var(--emw--registration-typography, var(--emw--color-black, #000000))}.text__label--required::after{content:\"*\";font-family:inherit;color:var(--emw--login-color-primary, var(--emw--color-primary, #22B04E));margin-left:2px}.text__input{font-family:inherit;width:100%;height:44px;border:1px solid var(--emw--color-gray-100, #E6E6E6);background-color:var(--emw--color-white, #FFFFFF);color:var(--emw--color-black, #000000);border-radius:5px;font-size:16px;font-weight:300;line-height:1.5;padding:5px 15px}.text__input:focus{border:1px solid var(--emw--login-color-primary, var(--emw--color-primary, #22B04E))}.text__input--invalid{border:1px solid var(--emw--color-error, var(--emw--color-red, #ed0909))}.text__input::placeholder{color:var(--emw--color-gray-150, #828282)}.text__error-message{position:absolute;top:calc(100% + 5px);left:0;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.text__tooltip-icon{width:16px;height:auto}.text__tooltip{position:absolute;top:0;left:20px;background-color:var(--emw--color-white, #FFFFFF);border:1px solid var(--emw--color-gray-100, #E6E6E6);color:var(--emw--registration-typography, var(--emw--color-black, #000000));padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.text__tooltip.visible{opacity:1}";
14095
+ const textInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.text{font-family:\"Roboto\";font-style:normal}.text__wrapper{position:relative;width:100%;display:flex;flex-direction:column;gap:5px}.text__wrapper--autofilled{pointer-events:none}.text__wrapper--autofilled .text__label{color:var(--emw--registration-typography, var(--emw--color-black, #000000))}.text__wrapper--autofilled .text__input::part(input-field){color:var(--emw--color-black, #000000)}.text__wrapper--flex{display:flex;gap:5px}.text__wrapper--relative{position:relative}.text__label{font-family:inherit;font-style:normal;font-weight:500;font-size:16px;line-height:20px;color:var(--emw--registration-typography, var(--emw--color-black, #000000))}.text__label--required::after{content:\"*\";font-family:inherit;color:var(--emw--login-color-primary, var(--emw--color-primary, #22B04E));margin-left:2px}.text__input{font-family:inherit;width:100%;height:44px;border:1px solid var(--emw--color-gray-100, #E6E6E6);background-color:var(--emw--color-white, #FFFFFF);color:var(--emw--color-black, #000000);border-radius:5px;font-size:16px;font-weight:300;line-height:1.5;padding:5px 15px}.text__input:focus{border:1px solid var(--emw--login-color-primary, var(--emw--color-primary, #22B04E))}.text__input--invalid{border:1px solid var(--emw--color-error, var(--emw--color-red, #ed0909))}.text__input::placeholder{color:var(--emw--color-gray-150, #828282)}.text__error-message{position:absolute;top:calc(100% + 5px);left:0;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.text__tooltip-icon{width:16px;height:auto}.text__tooltip{position:absolute;top:0;left:20px;background-color:var(--emw--color-white, #FFFFFF);border:1px solid var(--emw--color-gray-100, #E6E6E6);color:var(--emw--registration-typography, var(--emw--color-black, #000000));padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.text__tooltip.visible{opacity:1}.pulse-border{border:1px solid var(--emw--registration-red-600, #cc4c4c);animation:pulse 0.5s ease-in-out 2 forwards}@keyframes pulse{0%{border-color:var(--emw--registration-red-600, #cc4c4c)}50%{border-color:var(--emw--registration-red-400, #e57373)}100%{border-color:var(--emw--color-gray-100, #E6E6E6)}}";
13737
14096
  const TextInputStyle0 = textInputCss;
13738
14097
 
13739
14098
  const TextInput = class {
@@ -13744,6 +14103,7 @@ const TextInput = class {
13744
14103
  this.value = '';
13745
14104
  this.validationPattern = '';
13746
14105
  this.duplicateInputValue = null;
14106
+ this.postalcodelength = 5;
13747
14107
  this.touched = false;
13748
14108
  this.handleInput = (event) => {
13749
14109
  this.value = event.target.value;
@@ -13782,10 +14142,12 @@ const TextInput = class {
13782
14142
  this.emitValue = undefined;
13783
14143
  this.isDuplicateInput = undefined;
13784
14144
  this.clientStyling = '';
14145
+ this.haspostalcodelookup = undefined;
13785
14146
  this.isValid = undefined;
13786
14147
  this.errorMessage = '';
13787
14148
  this.limitStylingAppends = false;
13788
14149
  this.showTooltip = false;
14150
+ this.selectedCountryCode = '';
13789
14151
  }
13790
14152
  handleStylingChange(newValue, oldValue) {
13791
14153
  if (newValue !== oldValue)
@@ -13840,6 +14202,42 @@ const TextInput = class {
13840
14202
  this.errorMessage = this.setErrorMessage();
13841
14203
  }
13842
14204
  }
14205
+ handleCountryCodeUpdate(event) {
14206
+ const { name, value } = event.detail;
14207
+ this.selectedCountryCode = value;
14208
+ if (name === 'CountryCode' && ['address1', 'address2', 'City'].includes(this.name)) {
14209
+ this.value = '';
14210
+ this.touched = false;
14211
+ this.errorMessage = '';
14212
+ this.isValid = false;
14213
+ if (this.inputReference) {
14214
+ this.inputReference.value = '';
14215
+ }
14216
+ this.valueHandler({ name: this.name, value: '' });
14217
+ this.validityStateHandler({ valid: false, name: this.name });
14218
+ }
14219
+ }
14220
+ handleAddressSelection(event) {
14221
+ const { city, address1, address2 } = event.detail;
14222
+ if (!['address1', 'address2', 'City'].includes(this.name)) {
14223
+ return;
14224
+ }
14225
+ let newValue = '';
14226
+ if (this.name === 'address1') {
14227
+ newValue = address1;
14228
+ }
14229
+ else if (this.name === 'address2') {
14230
+ newValue = address2;
14231
+ }
14232
+ else if (this.name === 'City') {
14233
+ newValue = city;
14234
+ }
14235
+ this.value = newValue;
14236
+ this.touched = true;
14237
+ this.isValid = true;
14238
+ this.valueHandler({ name: this.name, value: newValue });
14239
+ this.validityStateHandler({ valid: true, name: this.name });
14240
+ }
13843
14241
  connectedCallback() {
13844
14242
  this.validationPattern = this.setPattern();
13845
14243
  }
@@ -13860,12 +14258,15 @@ const TextInput = class {
13860
14258
  this.touched = true;
13861
14259
  }
13862
14260
  }
14261
+ if (this.haspostalcodelookup) {
14262
+ if (['address1', 'address2', 'City', 'PostalCode'].includes(this.name)) {
14263
+ window.targetInputRefs = window.targetInputRefs || {};
14264
+ window.targetInputRefs[this.name] = this.inputReference;
14265
+ }
14266
+ }
13863
14267
  this.isValid = this.setValidity();
13864
14268
  }
13865
14269
  setValidity() {
13866
- if (this.isDuplicateInput && this.duplicateInputValue !== this.value) {
13867
- return false;
13868
- }
13869
14270
  if (!this.inputReference) {
13870
14271
  return false;
13871
14272
  }
@@ -13909,8 +14310,9 @@ const TextInput = class {
13909
14310
  if (this.touched) {
13910
14311
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
13911
14312
  }
13912
- return h("div", { key: 'a769be49d47bf5eac45467f9355aa2d51cb1ff81', class: `text__wrapper ${this.name}__input ${this.autofilled ? 'text__wrapper--autofilled' : ''}`, ref: el => this.stylingContainer = el }, h("div", { key: '3885727132e83f4381c455ec04fe49bb3feb58a2', class: 'text__wrapper--flex' }, h("label", { key: '36132d614d6f921af8dda5fef9466fdbc8b83f2f', class: `text__label ${this.validation.mandatory ? 'text__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: 'ac112a8be59094ee2c347c1853e1f36781246831', class: 'text__wrapper--relative' }, this.tooltip &&
13913
- h("img", { key: '31d5bc82b517facc92cc84e4191bc33946bbc06c', class: 'text__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("input", { key: '3bea6c3cbd01c55ac8e120078afdb784b5d65aee', name: this.name, id: `${this.name}__input`, value: this.defaultValue, type: 'text', class: `text__input ${invalidClass}`, placeholder: `${this.placeholder}`, ref: (el) => this.inputReference = el, readOnly: this.autofilled, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, onInput: this.handleInput, onBlur: this.handleBlur }), h("small", { key: '6139392a22701626a0001d41c558593be83aabf2', class: 'text__error-message' }, this.errorMessage));
14313
+ const displayValue = this.value || this.defaultValue;
14314
+ return h("div", { key: '2126d45a756f9f10a1428f6f2f296d119833949e', class: `text__wrapper ${this.name}__input ${this.autofilled ? 'text__wrapper--autofilled' : ''}`, ref: el => this.stylingContainer = el }, h("div", { key: '86adc0243bf02a5d68e8fe2ad25fddbf042041ca', class: 'text__wrapper--flex' }, h("label", { key: '81bf4d3010bd780471d97d7356062ed6c762151b', class: `text__label ${this.validation.mandatory ? 'text__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: '2b1cc8ad108901ab8bd0d42b5d59d5f59faf923c', class: 'text__wrapper--relative' }, this.tooltip &&
14315
+ h("img", { key: 'dc3714a7e7924972454c0532ced7c1928f998e01', class: 'text__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("input", { key: 'c615746d8604f9ef6fb1ec2ad3075ba4aa1dc928', name: this.name, id: `${this.name}__input`, value: displayValue, type: 'text', class: `text__input ${invalidClass}`, placeholder: `${this.placeholder}`, ref: (el) => this.inputReference = el, readOnly: this.autofilled, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, onInput: this.handleInput, onBlur: this.handleBlur }), h("small", { key: '4f4e50d2593f32a40ec8c71aa452ac890cb51751', class: 'text__error-message' }, this.errorMessage));
13914
14316
  }
13915
14317
  static get watchers() { return {
13916
14318
  "clientStyling": ["handleStylingChange"],
@@ -14018,8 +14420,8 @@ const ToggleCheckboxInput = class {
14018
14420
  return null;
14019
14421
  }
14020
14422
  render() {
14021
- return h("div", { key: '355926a9da2977c88b7ae205ddd6468d1a86e2d2', class: `togglecheckbox__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '3bbf491f4fdf22800ad091de584bcac3c2018308', class: 'togglecheckbox__wrapper--flex' }, h("input", { key: '14654df4ce258c95c7bc23ffd2420c5f0d5eb65e', class: 'togglecheckbox__input', type: "checkbox", id: `${this.name}__input`, ref: (el) => this.checkboxReference = el, name: this.name, checked: this.defaultValue === "true", readOnly: this.autofilled, required: this.validation.mandatory, value: this.value, onClick: () => this.handleClick() }), this.renderLabel()), h("small", { key: 'db4624ed73f644db0a8f0b92738497fca64ea035', class: 'togglecheckbox__error-message' }, this.errorMessage), h("div", { key: '898d353c570f9ce19c758585f721f6cb50c35fb0', class: 'togglecheckbox__wrapper--relative' }, this.tooltip &&
14022
- h("img", { key: '1007896417922d0e2bcaaf4c65a5f362e5e3bb49', class: 'togglecheckbox__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), h("div", { key: '260480a129168c8868ae0539ba9f9edbec35f87b', class: `togglecheckbox__fields-wrapper ${this.showFields ? '' : 'hidden'}` }, this.options.map(subfield => {
14423
+ return h("div", { key: '58e1c4145712f9547f59eaf43015d46c13e04f2c', class: `togglecheckbox__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '5230bc70f55ee7d3d4db2eed2b17c3e4f3ce9a23', class: 'togglecheckbox__wrapper--flex' }, h("input", { key: '063c24818b3f4c5fa8362751640c8e51b9ff2868', class: 'togglecheckbox__input', type: "checkbox", id: `${this.name}__input`, ref: (el) => this.checkboxReference = el, name: this.name, checked: this.defaultValue === "true", readOnly: this.autofilled, required: this.validation.mandatory, value: this.value, onClick: () => this.handleClick() }), this.renderLabel()), h("small", { key: 'df35a1484f167b4bad9e4c82d82e069260be6608', class: 'togglecheckbox__error-message' }, this.errorMessage), h("div", { key: '6783791e9d5e882cc47cfdf501737c0309deb9ec', class: 'togglecheckbox__wrapper--relative' }, this.tooltip &&
14424
+ h("img", { key: '8bc868f9d6828fe65a6ad684c0c50d6dbf434239', class: 'togglecheckbox__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), h("div", { key: '9258e49a1730b9bcec06ae2be98644a729a8741b', class: `togglecheckbox__fields-wrapper ${this.showFields ? '' : 'hidden'}` }, this.options.map(subfield => {
14023
14425
  return h("general-input", { type: subfield.inputType, name: subfield.name, displayName: subfield.displayName, validation: subfield.validate, action: subfield.action || null, defaultValue: subfield.defaultValue, autofilled: subfield.autofill, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: subfield.tooltip, placeholder: subfield.placeholder == null ? '' : subfield.placeholder, ref: el => this.subFieldsObject[subfield.name] = el });
14024
14426
  })));
14025
14427
  }
@@ -14231,9 +14633,9 @@ const TwofaInput = class {
14231
14633
  return null;
14232
14634
  }
14233
14635
  render() {
14234
- return (h("div", { key: '0f7d2f80e6335fcb08b1c61f6e52f51205a30092', class: "twofa" }, h("div", { key: 'd23240ccceb2ac4af5c5a2a1800eccd6013271e3', class: 'twofa__error-message' }, h("p", { key: '72fafd1608f5ae7402be900800100a141fefb72a' }, this.errorMessage)), h("div", { key: '98f5a5614fb895672a175d0415f66b5849b82f85', class: "twofa__description", innerHTML: translate('twofaDescription', this.language, { values: { destination: this.destination } }) }), h("div", { key: '5fd4f8999dc44e372369f03223d53c1d56a1eab4', class: "twofa__input-wrapper", ref: this.setContainerRef }, this.code.map((char, idx) => {
14636
+ return (h("div", { key: '6f6970837475ec226a3e9320da15998942d92464', class: "twofa" }, h("div", { key: '24d47b33f8bdd451cbb5b6d465b3f1a740e64ab0', class: 'twofa__error-message' }, h("p", { key: '1e3861424d30847e0a305f1cdd993cd3d618e897' }, this.errorMessage)), h("div", { key: 'ee066577765ba5b043e25c485fed8469577b4fd4', class: "twofa__description", innerHTML: translate('twofaDescription', this.language, { values: { destination: this.destination } }) }), h("div", { key: '57aa9f39ce301ec25c5116c1945467499432d26a', class: "twofa__input-wrapper", ref: this.setContainerRef }, this.code.map((char, idx) => {
14235
14637
  return (h("input", { key: idx, ref: el => this.setInputRef(el, idx), id: `otp-input-${idx}`, type: "text", maxLength: 2, value: char, onInput: (event) => this.handleInput(event, idx), onKeyDown: (event) => this.handleKeyDown(event, idx), onPaste: (event) => this.handlePaste(event) }));
14236
- })), h("div", { key: 'b6e5b2ba4e10cbbd092aaef4d13e0f6a640b3c29', class: "twofa__button-wrapper" }, h("p", { key: 'eba4ae1393d89db6729cfff7d5bc4eb5a4ab0b43', class: "twofa__resend-message" }, translate('twofaResendMessage', this.language)), h("button", { key: '58069e9cb76ecf1776f0733a9f8bc20387e71ad3', class: "twofa__resend-button", onClick: this.resendCodeHandler, disabled: !this.isResendButtonAvailable }, this.isResendButtonAvailable
14638
+ })), h("div", { key: '3217a0a6fbf088158bfb9319a937ff876fe352ad', class: "twofa__button-wrapper" }, h("p", { key: 'cae0c235946f0f6596505790e64991b8008fc728', class: "twofa__resend-message" }, translate('twofaResendMessage', this.language)), h("button", { key: '4b7bb013e04a61e03f7a6961de898fa7b8d80d23', class: "twofa__resend-button", onClick: this.resendCodeHandler, disabled: !this.isResendButtonAvailable }, this.isResendButtonAvailable
14237
14639
  ? translate('twofaResendButton', this.language)
14238
14640
  : this.formatTime()))));
14239
14641
  }
@@ -14245,4 +14647,4 @@ const TwofaInput = class {
14245
14647
  };
14246
14648
  TwofaInput.style = TwofaInputStyle0;
14247
14649
 
14248
- export { CheckboxGroupInput as checkbox_group_input, CheckboxInput as checkbox_input, DateInput as date_input, EmailInput as email_input, GeneralInput as general_input, NumberInput as number_input, PasswordInput as password_input, RadioInput as radio_input, SelectInput as select_input, TelInput as tel_input, TextInput as text_input, ToggleCheckboxInput as toggle_checkbox_input, TwofaInput as twofa_input };
14650
+ export { CheckboxGroupInput as checkbox_group_input, CheckboxInput as checkbox_input, DateInput as date_input, EmailInput as email_input, GeneralInput as general_input, NumberInput as number_input, PasswordInput as password_input, PostalCodeInput as postalcode_input, RadioInput as radio_input, SelectInput as select_input, TelInput as tel_input, TextInput as text_input, ToggleCheckboxInput as toggle_checkbox_input, TwofaInput as twofa_input };