@everymatrix/general-input 1.80.10 → 1.80.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{checkbox-group-input_13.cjs.entry.js → checkbox-group-input_14.cjs.entry.js} +422 -19
- package/dist/cjs/general-input.cjs.js +1 -1
- package/dist/cjs/index-3b546c2c.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/general-input/general-input.js +64 -4
- package/dist/collection/components/postalcode-input/postalcode-input.css +221 -0
- package/dist/collection/components/postalcode-input/postalcode-input.js +673 -0
- package/dist/collection/components/radio-input/radio-input.js +2 -2
- package/dist/collection/components/select-input/select-input.js +3 -3
- package/dist/collection/components/tel-input/tel-input.js +2 -2
- package/dist/collection/components/text-input/text-input.css +17 -0
- package/dist/collection/components/text-input/text-input.js +79 -6
- package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.js +2 -2
- package/dist/collection/components/twofa-input/twofa-input.js +2 -2
- package/dist/collection/utils/locale.utils.js +3 -0
- package/dist/esm/{checkbox-group-input_13.entry.js → checkbox-group-input_14.entry.js} +422 -20
- package/dist/esm/general-input.js +1 -1
- package/dist/esm/index-ca174b7a.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/general-input/{checkbox-group-input_13.entry.js → checkbox-group-input_14.entry.js} +165 -165
- package/dist/general-input/general-input.esm.js +1 -1
- package/dist/types/components/general-input/general-input.d.ts +18 -2
- package/dist/types/components/postalcode-input/postalcode-input.d.ts +111 -0
- package/dist/types/components/text-input/text-input.d.ts +12 -0
- package/dist/types/components.d.ts +165 -4
- package/package.json +1 -1
package/dist/cjs/{checkbox-group-input_13.cjs.entry.js → checkbox-group-input_14.cjs.entry.js}
RENAMED
|
@@ -32,6 +32,9 @@ const TRANSLATIONS = {
|
|
|
32
32
|
"twofaDescription": "<p> We have sent the verification code to <p> {destination}. </p> </p> <p> Please insert the PIN below. </p>",
|
|
33
33
|
"twofaResendMessage": "Didn't receive the verification code?",
|
|
34
34
|
"twofaResendButton": "Resend",
|
|
35
|
+
"enterIEAddressManually": "For IRE, enter the address manually",
|
|
36
|
+
"postalLookUpNoAddressFound": "No addresses found for this postal code",
|
|
37
|
+
"searchingForAddresses": "Searching for addresses...",
|
|
35
38
|
},
|
|
36
39
|
"hu": {
|
|
37
40
|
"dateError": "A választott dátumnak {min} és {max} között kell lennie",
|
|
@@ -12811,6 +12814,9 @@ const GeneralInput = class {
|
|
|
12811
12814
|
this.emitOnClick = false;
|
|
12812
12815
|
this.twofaDestination = undefined;
|
|
12813
12816
|
this.twofaResendIntervalSeconds = 60;
|
|
12817
|
+
this.haspostalcodelookup = undefined;
|
|
12818
|
+
this.postalcodelength = undefined;
|
|
12819
|
+
this.addresses = [];
|
|
12814
12820
|
}
|
|
12815
12821
|
connectedCallback() {
|
|
12816
12822
|
if (this.translationUrl) {
|
|
@@ -12821,7 +12827,12 @@ const GeneralInput = class {
|
|
|
12821
12827
|
var _a;
|
|
12822
12828
|
switch ((_a = this.type) === null || _a === void 0 ? void 0 : _a.toLowerCase()) {
|
|
12823
12829
|
case 'text':
|
|
12824
|
-
|
|
12830
|
+
if (this.haspostalcodelookup && this.name === 'PostalCode') {
|
|
12831
|
+
return index.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 });
|
|
12832
|
+
}
|
|
12833
|
+
else {
|
|
12834
|
+
return index.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 });
|
|
12835
|
+
}
|
|
12825
12836
|
case 'email':
|
|
12826
12837
|
return index.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 });
|
|
12827
12838
|
case 'number':
|
|
@@ -12849,7 +12860,7 @@ const GeneralInput = class {
|
|
|
12849
12860
|
}
|
|
12850
12861
|
}
|
|
12851
12862
|
render() {
|
|
12852
|
-
return (index.h(index.Host, { key: '
|
|
12863
|
+
return (index.h(index.Host, { key: '7f268156d7372f46b27b38762a2c01281ada038c', class: `general-input--${this.name}`, onClick: this.handleClick }, this.renderInput()));
|
|
12853
12864
|
}
|
|
12854
12865
|
};
|
|
12855
12866
|
GeneralInput.style = GeneralInputStyle0;
|
|
@@ -13248,6 +13259,354 @@ const PasswordInput = class {
|
|
|
13248
13259
|
};
|
|
13249
13260
|
PasswordInput.style = PasswordInputStyle0;
|
|
13250
13261
|
|
|
13262
|
+
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)}}";
|
|
13263
|
+
const PostalcodeInputStyle0 = postalcodeInputCss;
|
|
13264
|
+
|
|
13265
|
+
const PostalCodeInput = class {
|
|
13266
|
+
constructor(hostRef) {
|
|
13267
|
+
index.registerInstance(this, hostRef);
|
|
13268
|
+
this.sendAddressValue = index.createEvent(this, "sendAddressValue", 7);
|
|
13269
|
+
this.sendValidityState = index.createEvent(this, "sendValidityState", 7);
|
|
13270
|
+
this.sendInputValue = index.createEvent(this, "sendInputValue", 7);
|
|
13271
|
+
this.value = '';
|
|
13272
|
+
this.validationPattern = '';
|
|
13273
|
+
this.hasManualAddressBeenTriggered = false;
|
|
13274
|
+
this.touched = false;
|
|
13275
|
+
this.maxPostalCodeLength = '10';
|
|
13276
|
+
this.handleInput = (event) => {
|
|
13277
|
+
const inputValue = event.target.value;
|
|
13278
|
+
const upperCaseValue = inputValue.toUpperCase();
|
|
13279
|
+
this.value = upperCaseValue;
|
|
13280
|
+
this.touched = true;
|
|
13281
|
+
this.currentPostalCode = upperCaseValue;
|
|
13282
|
+
this.showNoResultsMessage = false;
|
|
13283
|
+
if (this.inputReference) {
|
|
13284
|
+
this.inputReference.value = upperCaseValue;
|
|
13285
|
+
}
|
|
13286
|
+
if (this.value.length < this.postalcodelength) {
|
|
13287
|
+
this.openAddressDropdown = false;
|
|
13288
|
+
this.isFetchingAddresses = false;
|
|
13289
|
+
}
|
|
13290
|
+
if (this.value === '' || this.value.length < 1) {
|
|
13291
|
+
this.openAddressDropdown = false;
|
|
13292
|
+
this.isFetchingAddresses = false;
|
|
13293
|
+
}
|
|
13294
|
+
if (this.debounceTime) {
|
|
13295
|
+
clearTimeout(this.debounceTime);
|
|
13296
|
+
}
|
|
13297
|
+
this.debounceTime = setTimeout(() => {
|
|
13298
|
+
// Trigger address lookup when postal code reaches minimum length
|
|
13299
|
+
if (this.value.length >= this.postalcodelength) {
|
|
13300
|
+
sessionStorage.setItem('currentPostalCode', this.value);
|
|
13301
|
+
this.showNoResultsMessage = false;
|
|
13302
|
+
if (this.addresses && this.addresses.length > 0) {
|
|
13303
|
+
this.openAddressDropdown = true;
|
|
13304
|
+
}
|
|
13305
|
+
}
|
|
13306
|
+
// Validate input and update error state
|
|
13307
|
+
const wasValid = this.isValid;
|
|
13308
|
+
this.isValid = this.setValidity();
|
|
13309
|
+
this.errorMessage = this.setErrorMessage();
|
|
13310
|
+
// Emit validity state if changed
|
|
13311
|
+
if (wasValid !== this.isValid) {
|
|
13312
|
+
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
13313
|
+
}
|
|
13314
|
+
this.emitValueHandler(true);
|
|
13315
|
+
}, 300);
|
|
13316
|
+
};
|
|
13317
|
+
this.handleBlur = (event) => {
|
|
13318
|
+
this.value = event.target.value;
|
|
13319
|
+
this.touched = true;
|
|
13320
|
+
this.isValid = this.setValidity();
|
|
13321
|
+
this.errorMessage = this.setErrorMessage();
|
|
13322
|
+
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
13323
|
+
this.showNoResultsMessage = false;
|
|
13324
|
+
// hide 'no addresses found' msg
|
|
13325
|
+
if (!this.openAddressDropdown) {
|
|
13326
|
+
this.showNoResultsMessage = false;
|
|
13327
|
+
}
|
|
13328
|
+
};
|
|
13329
|
+
this.handleFocus = () => {
|
|
13330
|
+
const hasSearchTerm = this.currentPostalCode && this.currentPostalCode.length >= this.postalcodelength;
|
|
13331
|
+
if (hasSearchTerm) {
|
|
13332
|
+
this.openAddressDropdown = true;
|
|
13333
|
+
}
|
|
13334
|
+
};
|
|
13335
|
+
this.handlePostalCode = (e, data) => {
|
|
13336
|
+
e.stopPropagation();
|
|
13337
|
+
const address1 = `${data.street}`.trim();
|
|
13338
|
+
const address2 = `${data.number}`.trim();
|
|
13339
|
+
const city = `${data.city}`.trim();
|
|
13340
|
+
this.sendAddressValue.emit({ city, address1, address2 });
|
|
13341
|
+
this.value = this.currentPostalCode.toLocaleUpperCase();
|
|
13342
|
+
this.touched = true;
|
|
13343
|
+
this.isValid = true;
|
|
13344
|
+
this.openAddressDropdown = false;
|
|
13345
|
+
this.showNoResultsMessage = false;
|
|
13346
|
+
this.isFetchingAddresses = false;
|
|
13347
|
+
this.valueHandler({ name: this.name, value: this.value });
|
|
13348
|
+
this.validityStateHandler({ valid: true, name: this.name });
|
|
13349
|
+
this.valueHandler({ name: 'address1', value: address1 });
|
|
13350
|
+
this.valueHandler({ name: 'City', value: city });
|
|
13351
|
+
if (address2) {
|
|
13352
|
+
this.valueHandler({ name: 'address2', value: address2 });
|
|
13353
|
+
}
|
|
13354
|
+
this.refreshTrigger++;
|
|
13355
|
+
};
|
|
13356
|
+
this.enterAddressManually = () => {
|
|
13357
|
+
const refs = window.targetInputRefs;
|
|
13358
|
+
if (!refs)
|
|
13359
|
+
return;
|
|
13360
|
+
// Define all address fields that need to be filled manually
|
|
13361
|
+
const allFields = [
|
|
13362
|
+
{ name: 'PostalCode', ref: refs['PostalCode'], minLength: this.postalcodelength },
|
|
13363
|
+
{ name: 'address1', ref: refs['address1'] },
|
|
13364
|
+
{ name: 'address2', ref: refs['address2'] },
|
|
13365
|
+
{ name: 'City', ref: refs['City'] }
|
|
13366
|
+
];
|
|
13367
|
+
// Required fields for address validation
|
|
13368
|
+
const requiredFields = [
|
|
13369
|
+
{ name: 'PostalCode', ref: refs['PostalCode'], minLength: this.postalcodelength },
|
|
13370
|
+
{ name: 'address1', ref: refs['address1'] },
|
|
13371
|
+
{ name: 'City', ref: refs['City'] }
|
|
13372
|
+
];
|
|
13373
|
+
// find the first required field that is empty or incomplete
|
|
13374
|
+
const targetField = requiredFields.find(field => {
|
|
13375
|
+
var _a;
|
|
13376
|
+
const value = ((_a = field.ref) === null || _a === void 0 ? void 0 : _a.value) || '';
|
|
13377
|
+
return field.minLength ? (value.length === 0 || value.length < field.minLength) : value.length === 0;
|
|
13378
|
+
});
|
|
13379
|
+
const targetInput = (targetField === null || targetField === void 0 ? void 0 : targetField.ref) || refs['address1'] || refs['PostalCode'];
|
|
13380
|
+
targetInput.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
|
13381
|
+
if (!this.hasManualAddressBeenTriggered) {
|
|
13382
|
+
this.hasManualAddressBeenTriggered = true;
|
|
13383
|
+
allFields.forEach(field => {
|
|
13384
|
+
var _a;
|
|
13385
|
+
if (field.ref) {
|
|
13386
|
+
const inputElement = ((_a = field.ref.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('input')) || field.ref;
|
|
13387
|
+
if (inputElement) {
|
|
13388
|
+
inputElement.classList.add('pulse-border');
|
|
13389
|
+
// remove animation when it ends
|
|
13390
|
+
const handleAnimationEnd = () => {
|
|
13391
|
+
inputElement.classList.remove('pulse-border');
|
|
13392
|
+
inputElement.removeEventListener('animationend', handleAnimationEnd);
|
|
13393
|
+
};
|
|
13394
|
+
inputElement.addEventListener('animationend', handleAnimationEnd);
|
|
13395
|
+
}
|
|
13396
|
+
}
|
|
13397
|
+
});
|
|
13398
|
+
targetInput.focus();
|
|
13399
|
+
}
|
|
13400
|
+
else {
|
|
13401
|
+
targetInput.focus();
|
|
13402
|
+
}
|
|
13403
|
+
};
|
|
13404
|
+
this.setClientStyling = () => {
|
|
13405
|
+
let sheet = document.createElement('style');
|
|
13406
|
+
sheet.innerHTML = this.clientStyling;
|
|
13407
|
+
this.stylingContainer.prepend(sheet);
|
|
13408
|
+
};
|
|
13409
|
+
this.handleOutsideClick = (event) => {
|
|
13410
|
+
if (!this.openAddressDropdown)
|
|
13411
|
+
return;
|
|
13412
|
+
const path = event.composedPath ? event.composedPath() : [];
|
|
13413
|
+
const isInputClick = path.includes(this.inputReference);
|
|
13414
|
+
const isDropdownClick = path.includes(this.addressesDropdownRef);
|
|
13415
|
+
const isOptionClick = path.some(el => { var _a; return el instanceof Element && ((_a = el.classList) === null || _a === void 0 ? void 0 : _a.contains('option')); });
|
|
13416
|
+
if (!isInputClick && !isDropdownClick && !isOptionClick) {
|
|
13417
|
+
this.openAddressDropdown = false;
|
|
13418
|
+
this.showNoResultsMessage = false;
|
|
13419
|
+
}
|
|
13420
|
+
};
|
|
13421
|
+
this.name = 'PostalCode';
|
|
13422
|
+
this.displayName = undefined;
|
|
13423
|
+
this.placeholder = undefined;
|
|
13424
|
+
this.validation = undefined;
|
|
13425
|
+
this.defaultValue = '';
|
|
13426
|
+
this.autofilled = undefined;
|
|
13427
|
+
this.tooltip = undefined;
|
|
13428
|
+
this.language = undefined;
|
|
13429
|
+
this.emitValue = undefined;
|
|
13430
|
+
this.clientStyling = '';
|
|
13431
|
+
this.postalcodelength = undefined;
|
|
13432
|
+
this.addresses = undefined;
|
|
13433
|
+
this.isValid = undefined;
|
|
13434
|
+
this.errorMessage = '';
|
|
13435
|
+
this.limitStylingAppends = false;
|
|
13436
|
+
this.showTooltip = false;
|
|
13437
|
+
this.selectedCountryCode = '';
|
|
13438
|
+
this.currentPostalCode = '';
|
|
13439
|
+
this.openAddressDropdown = false;
|
|
13440
|
+
this.showNoResultsMessage = false;
|
|
13441
|
+
this.refreshTrigger = 0;
|
|
13442
|
+
this.isFetchingAddresses = false;
|
|
13443
|
+
}
|
|
13444
|
+
handleStylingChange(newValue, oldValue) {
|
|
13445
|
+
if (newValue !== oldValue)
|
|
13446
|
+
this.setClientStyling();
|
|
13447
|
+
}
|
|
13448
|
+
validityChanged() {
|
|
13449
|
+
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
13450
|
+
if (this.emitValue == true) {
|
|
13451
|
+
this.valueHandler({ name: this.name, value: this.value });
|
|
13452
|
+
}
|
|
13453
|
+
}
|
|
13454
|
+
emitValueHandler(newValue) {
|
|
13455
|
+
if (newValue == true && this.isValid) {
|
|
13456
|
+
this.valueHandler({ name: this.name, value: this.value });
|
|
13457
|
+
}
|
|
13458
|
+
if (newValue === true && !this.value.length) {
|
|
13459
|
+
this.valueHandler({ name: this.name, value: this.value });
|
|
13460
|
+
}
|
|
13461
|
+
}
|
|
13462
|
+
handleAddresses(newValue) {
|
|
13463
|
+
if (newValue && newValue.length > 0) {
|
|
13464
|
+
this.openAddressDropdown = true;
|
|
13465
|
+
this.showNoResultsMessage = false;
|
|
13466
|
+
}
|
|
13467
|
+
else {
|
|
13468
|
+
this.openAddressDropdown = false;
|
|
13469
|
+
if (this.isFetchingAddresses && this.currentPostalCode.length >= this.postalcodelength) {
|
|
13470
|
+
setTimeout(() => {
|
|
13471
|
+
if (this.currentPostalCode.length >= this.postalcodelength && !this.isFetchingAddresses) {
|
|
13472
|
+
this.showNoResultsMessage = true;
|
|
13473
|
+
}
|
|
13474
|
+
}, 200);
|
|
13475
|
+
}
|
|
13476
|
+
}
|
|
13477
|
+
this.isFetchingAddresses = false;
|
|
13478
|
+
}
|
|
13479
|
+
validityStateHandler(inputStateEvent) {
|
|
13480
|
+
this.sendValidityState.emit(inputStateEvent);
|
|
13481
|
+
}
|
|
13482
|
+
valueHandler(inputValueEvent) {
|
|
13483
|
+
this.sendInputValue.emit(inputValueEvent);
|
|
13484
|
+
}
|
|
13485
|
+
handleClickOutside(event) {
|
|
13486
|
+
const path = event.composedPath();
|
|
13487
|
+
if (!path.includes(this.tooltipIconReference) && !path.includes(this.tooltipReference)) {
|
|
13488
|
+
this.showTooltip = false;
|
|
13489
|
+
}
|
|
13490
|
+
}
|
|
13491
|
+
handleCountryCodeUpdate(event) {
|
|
13492
|
+
const { name, value } = event.detail;
|
|
13493
|
+
this.selectedCountryCode = value;
|
|
13494
|
+
if (name === 'CountryCode') {
|
|
13495
|
+
this.resetPostalCodeField();
|
|
13496
|
+
this.refreshTrigger++;
|
|
13497
|
+
}
|
|
13498
|
+
}
|
|
13499
|
+
handleFetchStarted() {
|
|
13500
|
+
this.showNoResultsMessage = false;
|
|
13501
|
+
this.isFetchingAddresses = true;
|
|
13502
|
+
this.openAddressDropdown = false;
|
|
13503
|
+
}
|
|
13504
|
+
connectedCallback() {
|
|
13505
|
+
this.validationPattern = this.setPattern();
|
|
13506
|
+
}
|
|
13507
|
+
componentDidRender() {
|
|
13508
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
13509
|
+
if (this.clientStyling)
|
|
13510
|
+
this.setClientStyling();
|
|
13511
|
+
this.limitStylingAppends = true;
|
|
13512
|
+
}
|
|
13513
|
+
}
|
|
13514
|
+
componentDidLoad() {
|
|
13515
|
+
if (this.defaultValue) {
|
|
13516
|
+
this.value = this.defaultValue;
|
|
13517
|
+
this.valueHandler({ name: this.name, value: this.value });
|
|
13518
|
+
}
|
|
13519
|
+
if (this.inputReference) {
|
|
13520
|
+
window.targetInputRefs = window.targetInputRefs || {};
|
|
13521
|
+
window.targetInputRefs[this.name] = this.inputReference;
|
|
13522
|
+
}
|
|
13523
|
+
this.isValid = this.setValidity();
|
|
13524
|
+
document.addEventListener('click', this.handleOutsideClick);
|
|
13525
|
+
}
|
|
13526
|
+
disconnectedCallback() {
|
|
13527
|
+
document.removeEventListener('click', this.handleOutsideClick);
|
|
13528
|
+
}
|
|
13529
|
+
setValidity() {
|
|
13530
|
+
if (!this.inputReference) {
|
|
13531
|
+
return false;
|
|
13532
|
+
}
|
|
13533
|
+
const inputIsValid = this.inputReference.validity.valid;
|
|
13534
|
+
const inputMatchValidation = !this.inputReference.value || this.inputReference.value.match(this.validationPattern) !== null;
|
|
13535
|
+
return inputIsValid && inputMatchValidation;
|
|
13536
|
+
}
|
|
13537
|
+
setPattern() {
|
|
13538
|
+
var _a, _b;
|
|
13539
|
+
if (((_a = this.validation.custom) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
13540
|
+
return (_b = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _b === void 0 ? void 0 : _b.pattern;
|
|
13541
|
+
}
|
|
13542
|
+
}
|
|
13543
|
+
setErrorMessage() {
|
|
13544
|
+
var _a, _b;
|
|
13545
|
+
if (!this.touched) {
|
|
13546
|
+
return '';
|
|
13547
|
+
}
|
|
13548
|
+
if (this.inputReference.validity.valueMissing) {
|
|
13549
|
+
return translate('requiredError', this.language);
|
|
13550
|
+
}
|
|
13551
|
+
if (this.inputReference.validity.tooShort || this.inputReference.validity.tooLong) {
|
|
13552
|
+
return translate('lengthError', this.language, { values: { minLength: this.validation.minLength, maxLength: this.validation.maxLength } });
|
|
13553
|
+
}
|
|
13554
|
+
if (this.inputReference.value.match(this.validationPattern) == null) {
|
|
13555
|
+
const errorCode = (_a = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _a === void 0 ? void 0 : _a.errorKey;
|
|
13556
|
+
const errorMessage = (_b = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _b === void 0 ? void 0 : _b.errorMessage;
|
|
13557
|
+
return translate(`${errorCode}`, this.language) || errorMessage;
|
|
13558
|
+
}
|
|
13559
|
+
return '';
|
|
13560
|
+
}
|
|
13561
|
+
resetPostalCodeField() {
|
|
13562
|
+
this.value = '';
|
|
13563
|
+
this.currentPostalCode = '';
|
|
13564
|
+
this.showNoResultsMessage = false;
|
|
13565
|
+
this.openAddressDropdown = false;
|
|
13566
|
+
this.isFetchingAddresses = false;
|
|
13567
|
+
sessionStorage.removeItem('currentPostalCode');
|
|
13568
|
+
if (this.inputReference) {
|
|
13569
|
+
this.inputReference.value = '';
|
|
13570
|
+
}
|
|
13571
|
+
this.valueHandler({ name: this.name, value: '' });
|
|
13572
|
+
this.validityStateHandler({ valid: false, name: this.name });
|
|
13573
|
+
}
|
|
13574
|
+
renderTooltip() {
|
|
13575
|
+
if (this.showTooltip) {
|
|
13576
|
+
return (index.h("div", { class: `text__tooltip ${this.showTooltip ? 'visible' : ''}`, ref: (el) => this.tooltipReference = el, innerHTML: this.tooltip }));
|
|
13577
|
+
}
|
|
13578
|
+
return null;
|
|
13579
|
+
}
|
|
13580
|
+
determineInputValue() {
|
|
13581
|
+
// Store address input refs for manual entry function
|
|
13582
|
+
if (this.inputReference && this.name) {
|
|
13583
|
+
window.targetInputRefs = window.targetInputRefs || {};
|
|
13584
|
+
window.targetInputRefs[this.name] = this.inputReference;
|
|
13585
|
+
}
|
|
13586
|
+
return this.value || this.currentPostalCode || sessionStorage.getItem('currentPostalCode') || this.defaultValue;
|
|
13587
|
+
}
|
|
13588
|
+
render() {
|
|
13589
|
+
var _a, _b;
|
|
13590
|
+
let invalidClass = '';
|
|
13591
|
+
if (this.touched) {
|
|
13592
|
+
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
13593
|
+
}
|
|
13594
|
+
let isUKCountry = this.selectedCountryCode === 'UK' || this.selectedCountryCode === 'GB';
|
|
13595
|
+
let showAddressesDropdown = ((_a = this.addresses) === null || _a === void 0 ? void 0 : _a.length) > 0 && this.openAddressDropdown && isUKCountry;
|
|
13596
|
+
let shouldShowNoResults = this.showNoResultsMessage && this.currentPostalCode &&
|
|
13597
|
+
this.currentPostalCode.length >= this.postalcodelength && (((_b = this.addresses) === null || _b === void 0 ? void 0 : _b.length) === 0) && isUKCountry;
|
|
13598
|
+
let showLoadingMessage = this.isFetchingAddresses && this.currentPostalCode.length >= this.postalcodelength;
|
|
13599
|
+
return (index.h("div", { key: '9618edb268c4c1cffa450bb3dbd778ab5197e6f3', class: `text__wrapper ${this.name}__input ${this.autofilled ? 'text__wrapper--autofilled' : ''}`, ref: el => this.stylingContainer = el }, index.h("div", { key: '932d83f8895024ba1d7490e01505b651625def00', class: 'text__wrapper--flex' }, index.h("label", { key: '0c2281a6670fda698469815be19d0e99b18dbe65', class: `text__label ${this.validation.mandatory ? 'text__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), index.h("div", { key: '70eacd1179b9b9dc0def1cd18fab22bd090999b0', class: 'text__wrapper--relative' }, this.tooltip && (index.h("img", { key: '1237da82659dc9558020b0675a1a645c500f77de', class: 'text__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip })), this.renderTooltip())), index.h("div", { key: '65db0837d507b90217802e6f6d08800ae91404c6', class: 'input__text-wrapper' }, index.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 && (index.h("p", { key: 'c0f93584fa3f970a27793178517807968a03d252', class: "address__manual-input-msg", onClick: () => this.enterAddressManually() }, translate('enterIEAddressManually', this.language))), showAddressesDropdown && (index.h("div", { key: '2f24716dbc7b5ed8f70f0f61a787c97fa75d3fba', class: "input__addresses-container", ref: (el) => (this.addressesDropdownRef = el) }, index.h("div", { key: '63b89521d94589aeb082f2ee98f31c0508c3b070', class: "options" }, this.addresses.map((addr, index$1) => (index.h("div", { key: index$1, class: "option", onClick: (e) => this.handlePostalCode(e, addr) }, addr.street, " ", addr.number, " ", addr.city)))))), showLoadingMessage && (index.h("div", { key: 'd1f3deaf9936e00ff05ac37d635a3dadb11a0db8', class: "postalcode__loading-spinner" }, index.h("div", { key: 'ee7c1a5275b8e5824a9e3ffbd39d1476ced9d0a1', class: "loading-spinner" }), index.h("span", { key: '198c01371a98fa07d35ff64fad5714176ffdcb0d' }, translate('searchingForAddresses', this.language)))), shouldShowNoResults && (index.h("div", { key: 'e4f098805673d2708bb3fe2ff6dccc61308fc27a', class: "postalcode__no-results-message" }, translate('postalLookUpNoAddressFound', this.language)))), index.h("small", { key: 'e84296325688a134e49f521ecfa1ff44ed13fcc9', class: 'text__error-message' }, this.errorMessage)));
|
|
13600
|
+
}
|
|
13601
|
+
static get watchers() { return {
|
|
13602
|
+
"clientStyling": ["handleStylingChange"],
|
|
13603
|
+
"isValid": ["validityChanged"],
|
|
13604
|
+
"emitValue": ["emitValueHandler"],
|
|
13605
|
+
"addresses": ["handleAddresses"]
|
|
13606
|
+
}; }
|
|
13607
|
+
};
|
|
13608
|
+
PostalCodeInput.style = PostalcodeInputStyle0;
|
|
13609
|
+
|
|
13251
13610
|
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}";
|
|
13252
13611
|
const RadioInputStyle0 = radioInputCss;
|
|
13253
13612
|
|
|
@@ -13331,8 +13690,8 @@ const RadioInput = class {
|
|
|
13331
13690
|
return null;
|
|
13332
13691
|
}
|
|
13333
13692
|
render() {
|
|
13334
|
-
return index.h("fieldset", { key: '
|
|
13335
|
-
index.h("img", { key: '
|
|
13693
|
+
return index.h("fieldset", { key: '88357307488334074a397c636210575b8af1e2c3', class: `radio__fieldset ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("legend", { key: '25f656d5b155c392cad79c89410833c3491531f8', class: 'radio__legend' }, this.displayName, ":"), this.optionsGroup.map(option => index.h("div", { class: 'radio__wrapper' }, index.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) }), index.h("label", { htmlFor: `${option.label}__input` }, option.label))), index.h("small", { key: '08def575050905f964d6921d4ed4f071fccdf4da', class: 'radio__error-message' }, this.errorMessage), this.tooltip &&
|
|
13694
|
+
index.h("img", { key: '485fa4888f626f1cf44f179f498f257af6c41b58', class: 'radio__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip());
|
|
13336
13695
|
}
|
|
13337
13696
|
static get watchers() { return {
|
|
13338
13697
|
"clientStyling": ["handleStylingChange"],
|
|
@@ -13530,10 +13889,10 @@ const SelectInput = class {
|
|
|
13530
13889
|
if (this.touched) {
|
|
13531
13890
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
13532
13891
|
}
|
|
13533
|
-
return index.h("div", { key: '
|
|
13534
|
-
index.h("img", { key: '
|
|
13892
|
+
return index.h("div", { key: '68a8d63f045706ea65a8a9edf3aeec381ff93c52', class: `select__wrapper ${this.autofilled ? 'select__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { key: '1e4c7d1ad9add75ff495ab2aec2bc1556339c8d7', class: 'select__wrapper--flex' }, index.h("label", { key: '8698e76f945ed1c9d94597ca9f12d8c03d54ce31', class: 'select__label', htmlFor: `${this.name}__input` }, `${this.displayName} ${this.validation.mandatory ? '*' : ''}`), index.h("div", { key: 'bf34dd8c2155e9eca8d9da427e9775ee5685c3c6', class: 'select__wrapper--relative' }, this.tooltip &&
|
|
13893
|
+
index.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 ? index.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 })
|
|
13535
13894
|
:
|
|
13536
|
-
index.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 }), index.h("small", { key: '
|
|
13895
|
+
index.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 }), index.h("small", { key: '21327ad926828b95552046b42ac14f69d7012513', class: 'select__error-message' }, this.errorMessage));
|
|
13537
13896
|
}
|
|
13538
13897
|
static get watchers() { return {
|
|
13539
13898
|
"clientStyling": ["handleStylingChange"],
|
|
@@ -13726,8 +14085,8 @@ const TelInput = class {
|
|
|
13726
14085
|
if (this.touched) {
|
|
13727
14086
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
13728
14087
|
}
|
|
13729
|
-
return index.h("div", { key: '
|
|
13730
|
-
index.h("img", { key: '
|
|
14088
|
+
return index.h("div", { key: '9b01d1059b470ec9f57c6f852df12aa17d7a58e2', class: `tel__wrapper ${this.autofilled ? 'tel__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { key: '7ad94c73b7b14f63d1b0aa395cd4b2220d80bf7f', class: 'tel__wrapper--flex-label' }, index.h("label", { key: '2995bfd5f655c71a454281edf967ab4afff2b61c', class: `tel__label ${this.validation.mandatory ? 'tel__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), index.h("div", { key: '45c874ffd76f0c56eb971728acc6bcf3c31afc64', class: 'tel__wrapper--relative' }, this.tooltip &&
|
|
14089
|
+
index.h("img", { key: '3ecfbb61507ea4fbe02c804679293adf7961ce18', class: 'tel__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), index.h("div", { key: 'b2dc1d8af7ea60bc56347ae73c315cf5539d6e7a', class: `tel__wrapper--flex ${invalidClass}` }, index.h("vaadin-combo-box", { key: '3ad4d43799026bd4f3b06d9ad94eee17e81daced', class: 'tel__prefix', items: this.phoneCodesOptions, value: this.prefixValue, readOnly: this.disablePhonePrefix, onChange: (e) => this.handlePrefixInput(e) }), index.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 })), index.h("small", { key: '799b137bb4cf96cb7cffa77a6934eeab3e34f4ee', class: 'tel__error-message' }, this.errorMessage));
|
|
13731
14090
|
}
|
|
13732
14091
|
static get watchers() { return {
|
|
13733
14092
|
"clientStyling": ["handleStylingChange"],
|
|
@@ -13737,7 +14096,7 @@ const TelInput = class {
|
|
|
13737
14096
|
};
|
|
13738
14097
|
TelInput.style = TelInputStyle0;
|
|
13739
14098
|
|
|
13740
|
-
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}";
|
|
14099
|
+
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)}}";
|
|
13741
14100
|
const TextInputStyle0 = textInputCss;
|
|
13742
14101
|
|
|
13743
14102
|
const TextInput = class {
|
|
@@ -13748,6 +14107,7 @@ const TextInput = class {
|
|
|
13748
14107
|
this.value = '';
|
|
13749
14108
|
this.validationPattern = '';
|
|
13750
14109
|
this.duplicateInputValue = null;
|
|
14110
|
+
this.postalcodelength = 5;
|
|
13751
14111
|
this.touched = false;
|
|
13752
14112
|
this.handleInput = (event) => {
|
|
13753
14113
|
this.value = event.target.value;
|
|
@@ -13786,10 +14146,12 @@ const TextInput = class {
|
|
|
13786
14146
|
this.emitValue = undefined;
|
|
13787
14147
|
this.isDuplicateInput = undefined;
|
|
13788
14148
|
this.clientStyling = '';
|
|
14149
|
+
this.haspostalcodelookup = undefined;
|
|
13789
14150
|
this.isValid = undefined;
|
|
13790
14151
|
this.errorMessage = '';
|
|
13791
14152
|
this.limitStylingAppends = false;
|
|
13792
14153
|
this.showTooltip = false;
|
|
14154
|
+
this.selectedCountryCode = '';
|
|
13793
14155
|
}
|
|
13794
14156
|
handleStylingChange(newValue, oldValue) {
|
|
13795
14157
|
if (newValue !== oldValue)
|
|
@@ -13844,6 +14206,42 @@ const TextInput = class {
|
|
|
13844
14206
|
this.errorMessage = this.setErrorMessage();
|
|
13845
14207
|
}
|
|
13846
14208
|
}
|
|
14209
|
+
handleCountryCodeUpdate(event) {
|
|
14210
|
+
const { name, value } = event.detail;
|
|
14211
|
+
this.selectedCountryCode = value;
|
|
14212
|
+
if (name === 'CountryCode' && ['address1', 'address2', 'City'].includes(this.name)) {
|
|
14213
|
+
this.value = '';
|
|
14214
|
+
this.touched = false;
|
|
14215
|
+
this.errorMessage = '';
|
|
14216
|
+
this.isValid = false;
|
|
14217
|
+
if (this.inputReference) {
|
|
14218
|
+
this.inputReference.value = '';
|
|
14219
|
+
}
|
|
14220
|
+
this.valueHandler({ name: this.name, value: '' });
|
|
14221
|
+
this.validityStateHandler({ valid: false, name: this.name });
|
|
14222
|
+
}
|
|
14223
|
+
}
|
|
14224
|
+
handleAddressSelection(event) {
|
|
14225
|
+
const { city, address1, address2 } = event.detail;
|
|
14226
|
+
if (!['address1', 'address2', 'City'].includes(this.name)) {
|
|
14227
|
+
return;
|
|
14228
|
+
}
|
|
14229
|
+
let newValue = '';
|
|
14230
|
+
if (this.name === 'address1') {
|
|
14231
|
+
newValue = address1;
|
|
14232
|
+
}
|
|
14233
|
+
else if (this.name === 'address2') {
|
|
14234
|
+
newValue = address2;
|
|
14235
|
+
}
|
|
14236
|
+
else if (this.name === 'City') {
|
|
14237
|
+
newValue = city;
|
|
14238
|
+
}
|
|
14239
|
+
this.value = newValue;
|
|
14240
|
+
this.touched = true;
|
|
14241
|
+
this.isValid = true;
|
|
14242
|
+
this.valueHandler({ name: this.name, value: newValue });
|
|
14243
|
+
this.validityStateHandler({ valid: true, name: this.name });
|
|
14244
|
+
}
|
|
13847
14245
|
connectedCallback() {
|
|
13848
14246
|
this.validationPattern = this.setPattern();
|
|
13849
14247
|
}
|
|
@@ -13864,12 +14262,15 @@ const TextInput = class {
|
|
|
13864
14262
|
this.touched = true;
|
|
13865
14263
|
}
|
|
13866
14264
|
}
|
|
14265
|
+
if (this.haspostalcodelookup) {
|
|
14266
|
+
if (['address1', 'address2', 'City', 'PostalCode'].includes(this.name)) {
|
|
14267
|
+
window.targetInputRefs = window.targetInputRefs || {};
|
|
14268
|
+
window.targetInputRefs[this.name] = this.inputReference;
|
|
14269
|
+
}
|
|
14270
|
+
}
|
|
13867
14271
|
this.isValid = this.setValidity();
|
|
13868
14272
|
}
|
|
13869
14273
|
setValidity() {
|
|
13870
|
-
if (this.isDuplicateInput && this.duplicateInputValue !== this.value) {
|
|
13871
|
-
return false;
|
|
13872
|
-
}
|
|
13873
14274
|
if (!this.inputReference) {
|
|
13874
14275
|
return false;
|
|
13875
14276
|
}
|
|
@@ -13913,8 +14314,9 @@ const TextInput = class {
|
|
|
13913
14314
|
if (this.touched) {
|
|
13914
14315
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
13915
14316
|
}
|
|
13916
|
-
|
|
13917
|
-
|
|
14317
|
+
const displayValue = this.value || this.defaultValue;
|
|
14318
|
+
return index.h("div", { key: '2126d45a756f9f10a1428f6f2f296d119833949e', class: `text__wrapper ${this.name}__input ${this.autofilled ? 'text__wrapper--autofilled' : ''}`, ref: el => this.stylingContainer = el }, index.h("div", { key: '86adc0243bf02a5d68e8fe2ad25fddbf042041ca', class: 'text__wrapper--flex' }, index.h("label", { key: '81bf4d3010bd780471d97d7356062ed6c762151b', class: `text__label ${this.validation.mandatory ? 'text__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), index.h("div", { key: '2b1cc8ad108901ab8bd0d42b5d59d5f59faf923c', class: 'text__wrapper--relative' }, this.tooltip &&
|
|
14319
|
+
index.h("img", { key: 'dc3714a7e7924972454c0532ced7c1928f998e01', class: 'text__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), index.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 }), index.h("small", { key: '4f4e50d2593f32a40ec8c71aa452ac890cb51751', class: 'text__error-message' }, this.errorMessage));
|
|
13918
14320
|
}
|
|
13919
14321
|
static get watchers() { return {
|
|
13920
14322
|
"clientStyling": ["handleStylingChange"],
|
|
@@ -14022,8 +14424,8 @@ const ToggleCheckboxInput = class {
|
|
|
14022
14424
|
return null;
|
|
14023
14425
|
}
|
|
14024
14426
|
render() {
|
|
14025
|
-
return index.h("div", { key: '
|
|
14026
|
-
index.h("img", { key: '
|
|
14427
|
+
return index.h("div", { key: '58e1c4145712f9547f59eaf43015d46c13e04f2c', class: `togglecheckbox__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { key: '5230bc70f55ee7d3d4db2eed2b17c3e4f3ce9a23', class: 'togglecheckbox__wrapper--flex' }, index.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()), index.h("small", { key: 'df35a1484f167b4bad9e4c82d82e069260be6608', class: 'togglecheckbox__error-message' }, this.errorMessage), index.h("div", { key: '6783791e9d5e882cc47cfdf501737c0309deb9ec', class: 'togglecheckbox__wrapper--relative' }, this.tooltip &&
|
|
14428
|
+
index.h("img", { key: '8bc868f9d6828fe65a6ad684c0c50d6dbf434239', class: 'togglecheckbox__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), index.h("div", { key: '9258e49a1730b9bcec06ae2be98644a729a8741b', class: `togglecheckbox__fields-wrapper ${this.showFields ? '' : 'hidden'}` }, this.options.map(subfield => {
|
|
14027
14429
|
return index.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 });
|
|
14028
14430
|
})));
|
|
14029
14431
|
}
|
|
@@ -14235,9 +14637,9 @@ const TwofaInput = class {
|
|
|
14235
14637
|
return null;
|
|
14236
14638
|
}
|
|
14237
14639
|
render() {
|
|
14238
|
-
return (index.h("div", { key: '
|
|
14640
|
+
return (index.h("div", { key: '8672e39d15057a9e866ba1cb79e50f2d319aa989', class: "twofa", ref: el => this.stylingContainer = el }, index.h("div", { key: 'ae7f658dd357340918e6f9565934660b3ef944ac', class: 'twofa__error-message' }, index.h("p", { key: '8ef6aecdc7a31b1c4b801f69c8970b8df79bd127' }, this.errorMessage)), index.h("div", { key: '86966527af6e1c3313847f0ae07f89d3ae3411fb', class: "twofa__description", innerHTML: translate('twofaDescription', this.language, { values: { destination: this.destination } }) }), index.h("div", { key: 'e8ebb1da615c25ddce6e06c4aee158355dc433c3', class: "twofa__input-wrapper", ref: this.setContainerRef }, this.code.map((char, idx) => {
|
|
14239
14641
|
return (index.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) }));
|
|
14240
|
-
})), index.h("div", { key: '
|
|
14642
|
+
})), index.h("div", { key: '707d2423dd21097dbc591bd15fbf57b5c2e7bddc', class: "twofa__button-wrapper" }, index.h("p", { key: 'abc31161f53c6b41aef93b0f27fefced03bac990', class: "twofa__resend-message" }, translate('twofaResendMessage', this.language)), index.h("button", { key: '3f7e329e16a524a4849ffb6b98e0df2f4dec136c', class: "twofa__resend-button", onClick: this.resendCodeHandler, disabled: !this.isResendButtonAvailable }, this.isResendButtonAvailable
|
|
14241
14643
|
? translate('twofaResendButton', this.language)
|
|
14242
14644
|
: this.formatTime()))));
|
|
14243
14645
|
}
|
|
@@ -14256,6 +14658,7 @@ exports.email_input = EmailInput;
|
|
|
14256
14658
|
exports.general_input = GeneralInput;
|
|
14257
14659
|
exports.number_input = NumberInput;
|
|
14258
14660
|
exports.password_input = PasswordInput;
|
|
14661
|
+
exports.postalcode_input = PostalCodeInput;
|
|
14259
14662
|
exports.radio_input = RadioInput;
|
|
14260
14663
|
exports.select_input = SelectInput;
|
|
14261
14664
|
exports.tel_input = TelInput;
|