@everymatrix/general-registration 1.10.23 → 1.10.25

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 (28) hide show
  1. package/dist/cjs/{checkbox-group-input_12.cjs.entry.js → checkbox-group-input_13.cjs.entry.js} +290 -108
  2. package/dist/cjs/general-registration.cjs.js +1 -1
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/collection/collection-manifest.json +2 -1
  5. package/dist/collection/components/general-registration/general-registration.css +11 -23
  6. package/dist/collection/components/general-registration/general-registration.js +100 -57
  7. package/dist/components/checkbox-group-input2.js +3 -7
  8. package/dist/components/checkbox-input2.js +2 -2
  9. package/dist/components/date-input2.js +2 -2
  10. package/dist/components/email-input2.js +9 -5
  11. package/dist/components/field-mixin.js +2 -2
  12. package/dist/components/general-input2.js +214 -22
  13. package/dist/components/general-registration.js +127 -79
  14. package/dist/components/number-input2.js +6 -4
  15. package/dist/components/password-input2.js +37 -14
  16. package/dist/components/select-input2.js +8 -7
  17. package/dist/components/tel-input2.js +7 -5
  18. package/dist/components/text-input2.js +9 -5
  19. package/dist/components/toggle-checkbox-input.js +6 -0
  20. package/dist/components/tooltipIcon.js +17 -0
  21. package/dist/esm/{checkbox-group-input_12.entry.js → checkbox-group-input_13.entry.js} +290 -109
  22. package/dist/esm/general-registration.js +1 -1
  23. package/dist/esm/loader.js +1 -1
  24. package/dist/general-registration/general-registration.esm.js +1 -1
  25. package/dist/general-registration/{p-482c4c1e.entry.js → p-01edd755.entry.js} +77 -77
  26. package/dist/types/Users/adrian.pripon/Documents/Work/stencil/widgets-stencil/packages/general-registration/.stencil/packages/general-input/src/utils/types.d.ts +1 -0
  27. package/dist/types/components/general-registration/general-registration.d.ts +3 -2
  28. package/package.json +1 -1
@@ -14,12 +14,29 @@ const TRANSLATIONS$1 = {
14
14
  "passwordStrength": "Password strength",
15
15
  "passwordStrengthWeak": "is not adequate",
16
16
  "passwordStrengthStrong": "is adequate",
17
+ "SpecialCharactersNotAllowed": 'Should not contain special characters',
18
+ "InvalidEmailFormat": "Invalid email format.",
19
+ "EmailNotMatching": "Emails not matching!",
20
+ "PasswordNotMatching": "Passwords not matching",
21
+ "MustIncludeNumber": "include a number",
22
+ "MustContainCapital": "contain capital letters",
23
+ "MustIncludePunctation": "punctuation",
17
24
  },
18
25
  "hu": {
19
26
  "dateError": 'A választott dátumnak {min} és {max} között kell lennie',
20
27
  "numberLengthError": 'A számnak {min} és {max} között kell lennie',
21
28
  "lengthError": `A hossznak {minLength} és {maxLength} között kell lennie`,
22
29
  "requiredError": 'Ez a beviteli mező kötelező.',
30
+ "passwordStrength": "Jelszó erőssége",
31
+ "passwordStrengthWeak": "nem megfelelő",
32
+ "passwordStrengthStrong": "megfelelő",
33
+ "SpecialCharactersNotAllowed": 'Nem tartalmazhat speciális karaktereket',
34
+ "InvalidEmailFormat": "Érvénytelen e-mail formátum.",
35
+ "EmailNotMatching": "Az e-mailek nem egyeznek!",
36
+ "PasswordNotMatching": "A jelszavak nem egyeznek",
37
+ "MustIncludeNumber": "tartalmaznia kell egy számot",
38
+ "MustContainCapital": "nagybetűket kell tartalmaznia",
39
+ "MustIncludePunctation": "írásjelet"
23
40
  }
24
41
  };
25
42
  const translate$2 = (key, customLang, values) => {
@@ -50,7 +67,7 @@ const tooltipIconSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD
50
67
  */
51
68
  class Lumo extends HTMLElement {
52
69
  static get version() {
53
- return '23.3.18';
70
+ return '23.3.19';
54
71
  }
55
72
  }
56
73
 
@@ -10542,7 +10559,7 @@ const registered = new Set();
10542
10559
  const ElementMixin = (superClass) =>
10543
10560
  class VaadinElementMixin extends DirMixin(superClass) {
10544
10561
  static get version() {
10545
- return '23.3.18';
10562
+ return '23.3.19';
10546
10563
  }
10547
10564
 
10548
10565
  /** @protected */
@@ -14705,10 +14722,6 @@ const CheckboxGroupInput = class {
14705
14722
  * Default value for the input.
14706
14723
  */
14707
14724
  this.defaultValue = '';
14708
- /**
14709
- * Options of the input.
14710
- */
14711
- this.options = [];
14712
14725
  /**
14713
14726
  * Client custom styling via inline style
14714
14727
  */
@@ -14793,10 +14806,10 @@ const CheckboxGroupInput = class {
14793
14806
  : [];
14794
14807
  }
14795
14808
  render() {
14796
- return index.h("div", { class: `checkboxgroup__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { class: 'checkboxgroup__wrapper--flex' }, index.h("vaadin-checkbox", { label: `${this.displayName} ${this.validation.mandatory ? '*' : ''}`, checked: this.selectedValues.length === this.options.length || this.defaultValue === 'true', indeterminate: this.selectedValues.length > 0 && this.selectedValues.length < this.options.length, onChange: (e) => this.handleParentCheckbox(e) }), this.tooltip &&
14809
+ return index.h("div", { class: `checkboxgroup__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { class: 'checkboxgroup__wrapper--flex' }, index.h("vaadin-checkbox", { class: 'checkbox__input', label: `${this.displayName} ${this.validation.mandatory ? '*' : ''}`, checked: this.selectedValues.length === this.options.length || this.defaultValue === 'true', indeterminate: this.selectedValues.length > 0 && this.selectedValues.length < this.options.length, onChange: (e) => this.handleParentCheckbox(e) }), this.tooltip &&
14797
14810
  index.h("img", { class: 'checkboxgroup__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), index.h("small", { class: 'checkboxgroup__error-message' }, this.errorMessage), index.h("vaadin-checkbox-group", { theme: "vertical", value: this.selectedValues, "on-value-changed": (event) => {
14798
14811
  this.selectedValues = event.detail.value;
14799
- } }, this.options.map((checkbox) => index.h("vaadin-checkbox", { name: checkbox.name, value: checkbox.name, label: checkbox.displayName }))));
14812
+ } }, this.options.map((checkbox) => index.h("vaadin-checkbox", { class: 'checkbox__input', name: checkbox.name, value: checkbox.name, label: checkbox.displayName }))));
14800
14813
  }
14801
14814
  get element() { return index.getElement(this); }
14802
14815
  static get watchers() { return {
@@ -14807,7 +14820,7 @@ const CheckboxGroupInput = class {
14807
14820
  };
14808
14821
  CheckboxGroupInput.style = checkboxGroupInputCss;
14809
14822
 
14810
- const checkboxInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.checkbox{font-family:\"Roboto\";font-style:normal}.checkbox__wrapper{display:flex;gap:10px;position:relative;align-items:baseline}.checkbox__wrapper--flex{display:flex;gap:5px}.checkbox__wrapper--relative{position:relative}.checkbox__label{font-style:inherit;font-family:inherit;font-weight:400;font-size:16px;color:#2B2D3F;line-height:14px}.checkbox__label-text{font-size:16px}.checkbox__error-message{position:absolute;top:calc(100% + 5px);left:0;color:#cc0000b3}.checkbox__tooltip-icon{width:16px;height:auto}.checkbox__tooltip{position:absolute;top:0;right:20px;background-color:#FFFFFF;border:1px solid #B0B0B0;color:#2B2D3F;padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.checkbox__tooltip.visible{opacity:1}";
14823
+ const checkboxInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.checkbox{font-family:\"Roboto\";font-style:normal}.checkbox__wrapper{display:flex;gap:10px;position:relative;align-items:baseline}.checkbox__wrapper--flex{display:flex;gap:5px}.checkbox__wrapper--relative{position:relative}.checkbox__input{transform:scale(1.307, 1.307);margin-left:2px}.checkbox__label{font-style:inherit;font-family:inherit;font-weight:400;font-size:16px;color:#2B2D3F;line-height:14px}.checkbox__label-text{font-size:16px}.checkbox__error-message{position:absolute;top:calc(100% + 5px);left:0;color:#cc0000b3}.checkbox__tooltip-icon{width:16px;height:auto}.checkbox__tooltip{position:absolute;top:0;right:20px;background-color:#FFFFFF;border:1px solid #B0B0B0;color:#2B2D3F;padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.checkbox__tooltip.visible{opacity:1}";
14811
14824
 
14812
14825
  const CheckboxInput = class {
14813
14826
  constructor(hostRef) {
@@ -14893,7 +14906,7 @@ const CheckboxInput = class {
14893
14906
  return null;
14894
14907
  }
14895
14908
  render() {
14896
- return index.h("div", { class: `checkbox__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("input", { type: "checkbox", id: `${this.name}__input`, ref: (el) => this.inputReference = 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", { class: 'checkbox__error-message' }, this.errorMessage), index.h("div", { class: 'checkbox__wrapper--relative' }, this.tooltip &&
14909
+ return index.h("div", { class: `checkbox__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("input", { class: 'checkbox__input', type: "checkbox", id: `${this.name}__input`, ref: (el) => this.inputReference = 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", { class: 'checkbox__error-message' }, this.errorMessage), index.h("div", { class: 'checkbox__wrapper--relative' }, this.tooltip &&
14897
14910
  index.h("img", { class: 'checkbox__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()));
14898
14911
  }
14899
14912
  static get watchers() { return {
@@ -29218,7 +29231,7 @@ function cleanEscapedString(input) {
29218
29231
  return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
29219
29232
  }
29220
29233
 
29221
- const dateInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.date{font-family:\"Roboto\";font-style:normal}.date__wrapper{position:relative;width:100%;padding-top:26px}.date__label{font-family:inherit;font-style:normal;font-weight:500;font-size:16px;line-height:20px;color:#1F1F1F;position:absolute;top:0;left:0}.date__label--required::after{content:\"*\";font-family:inherit;color:#1F1F1F;margin-left:2px}.date__input{border:none;width:inherit;position:relative}.date__input[focused]::part(input-field){border-color:#3E3E3E}.date__input[invalid]::part(input-field){border-color:#cc0000b3}.date__input::part(input-field){border-radius:4px;background-color:#FFFFFF;border:2px solid #DEE1EE;color:#2A2E3F;border-radius:4px;background-color:transparent;font-family:inherit;font-style:normal;font-weight:300;font-size:16px;line-height:19px}.date__error-message{position:absolute;top:calc(100% + 5px);left:0;color:#cc0000b3}.date__tooltip-icon{position:absolute;right:0;bottom:10px}.date__tooltip{position:absolute;bottom:35px;right:10px;background-color:#FFFFFF;border:1px solid #B0B0B0;color:#2B2D3F;padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.date__tooltip.visible{opacity:1}";
29234
+ const dateInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.date{font-family:\"Roboto\";font-style:normal}.date__wrapper{position:relative;width:100%;padding-top:26px}.date__label{font-family:inherit;font-style:normal;font-weight:500;font-size:16px;line-height:20px;color:#2A3841;position:absolute;top:0;left:0}.date__label--required::after{content:\"*\";font-family:inherit;color:#2A3841;margin-left:2px}.date__input{border:none;width:inherit;position:relative}.date__input[focused]::part(input-field){border-color:#3E3E3E}.date__input[invalid]::part(input-field){border-color:#cc0000b3}.date__input::part(input-field){border-radius:4px;background-color:#FFFFFF;border:2px solid #DEE1EE;color:#2A2E3F;border-radius:4px;background-color:transparent;font-family:inherit;font-style:normal;font-weight:300;font-size:16px;line-height:19px}.date__error-message{position:absolute;top:calc(100% + 5px);left:0;color:#cc0000b3}.date__tooltip-icon{position:absolute;right:0;bottom:10px}.date__tooltip{position:absolute;bottom:35px;right:10px;background-color:#FFFFFF;border:1px solid #B0B0B0;color:#2B2D3F;padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.date__tooltip.visible{opacity:1}";
29222
29235
 
29223
29236
  const DateInput = class {
29224
29237
  constructor(hostRef) {
@@ -29319,7 +29332,7 @@ const DateInput = class {
29319
29332
  return null;
29320
29333
  }
29321
29334
  render() {
29322
- let invalidClass;
29335
+ let invalidClass = '';
29323
29336
  if (this.touched) {
29324
29337
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
29325
29338
  }
@@ -29334,7 +29347,7 @@ const DateInput = class {
29334
29347
  };
29335
29348
  DateInput.style = dateInputCss;
29336
29349
 
29337
- const emailInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.email{font-family:\"Roboto\";font-style:normal}.email__wrapper{position:relative;width:100%}.email__wrapper--flex{display:flex;gap:5px}.email__wrapper--relative{position:relative}.email__label{font-family:inherit;font-style:normal;font-weight:500;font-size:16px;line-height:20px;color:#1F1F1F}.email__label--required::after{content:\"*\";font-family:inherit;color:#1F1F1F;margin-left:2px}.email__input{border-radius:4px;background-color:transparent;font-family:inherit;font-style:normal;font-weight:300;font-size:16px;line-height:19px;color:#2A2E3F;padding:8px 20px;width:inherit;position:relative;border:2px solid #DEE1EE}.email__input:focus{outline-color:#3E3E3E}.email__input--invalid{border:2px solid #cc0000b3}.email__error-message{position:absolute;top:calc(100% + 5px);left:0;color:#cc0000b3}.email__tooltip-icon{width:16px;height:auto}.email__tooltip{position:absolute;top:0;left:20px;background-color:#FFFFFF;border:1px solid #B0B0B0;color:#2B2D3F;padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.email__tooltip.visible{opacity:1}";
29350
+ const emailInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.email{font-family:\"Roboto\";font-style:normal}.email__wrapper{position:relative;width:100%}.email__wrapper--flex{display:flex;gap:5px}.email__wrapper--relative{position:relative}.email__label{font-family:inherit;font-style:normal;font-weight:500;font-size:16px;line-height:20px;color:#2A3841}.email__label--required::after{content:\"*\";font-family:inherit;color:#2A3841;margin-left:2px}.email__input{border-radius:4px;background-color:transparent;font-family:inherit;font-style:normal;font-weight:300;font-size:16px;line-height:19px;color:#2A2E3F;padding:10px 20px;width:inherit;position:relative;border:2px solid #DEE1EE}.email__input:focus{outline-color:#3E3E3E}.email__input--invalid{border:2px solid #cc0000b3}.email__input::placeholder{color:#979797}.email__error-message{position:absolute;top:calc(100% + 5px);left:0;color:#cc0000b3}.email__tooltip-icon{width:16px;height:auto}.email__tooltip{position:absolute;top:0;left:20px;background-color:#FFFFFF;border:1px solid #B0B0B0;color:#2B2D3F;padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.email__tooltip.visible{opacity:1}";
29338
29351
 
29339
29352
  const EmailInput = class {
29340
29353
  constructor(hostRef) {
@@ -29431,9 +29444,11 @@ const EmailInput = class {
29431
29444
  }
29432
29445
  }
29433
29446
  setErrorMessage() {
29434
- var _a;
29447
+ var _a, _b, _c, _d;
29435
29448
  if (this.inputReference.validity.patternMismatch) {
29436
- return (_a = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _a === void 0 ? void 0 : _a.errorMessage;
29449
+ const errorCode = (_a = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _a === void 0 ? void 0 : _a.errorKey;
29450
+ const errorMessage = (_b = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _b === void 0 ? void 0 : _b.errorMessage;
29451
+ return translate$2(`${errorCode}`, this.language) ? translate$2(`${errorCode}`, this.language) : errorMessage;
29437
29452
  }
29438
29453
  if (this.inputReference.validity.tooShort || this.inputReference.validity.tooLong) {
29439
29454
  return translate$2('lengthError', this.language, { values: { minLength: this.validation.minLength, maxLength: this.validation.maxLength } });
@@ -29442,7 +29457,9 @@ const EmailInput = class {
29442
29457
  return translate$2('requiredError', this.language);
29443
29458
  }
29444
29459
  if (this.isDuplicateInput && this.duplicateInputValue !== this.value) {
29445
- return this.validation.custom.find(customRule => customRule.rule === 'duplicate-input').errorMessage;
29460
+ const errorCode = (_c = this.validation.custom.find(customRule => customRule.rule === 'duplicate-input')) === null || _c === void 0 ? void 0 : _c.errorKey;
29461
+ const errorMessage = (_d = this.validation.custom.find(customRule => customRule.rule === 'duplicate-input')) === null || _d === void 0 ? void 0 : _d.errorMessage;
29462
+ return translate$2(`${errorCode}`, this.language) ? translate$2(`${errorCode}`, this.language) : errorMessage;
29446
29463
  }
29447
29464
  }
29448
29465
  renderTooltip() {
@@ -29452,7 +29469,7 @@ const EmailInput = class {
29452
29469
  return null;
29453
29470
  }
29454
29471
  render() {
29455
- let invalidClass;
29472
+ let invalidClass = '';
29456
29473
  if (this.touched) {
29457
29474
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
29458
29475
  }
@@ -29493,6 +29510,8 @@ const GeneralInput = class {
29493
29510
  return index.h("checkbox-input", { name: this.name, displayName: this.displayName, validation: this.validation, emitValue: this.emitValue, defaultValue: this.defaultValue, autofilled: this.autofilled, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip });
29494
29511
  case 'checkboxgroup':
29495
29512
  return index.h("checkbox-group-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, options: this.options });
29513
+ case 'togglecheckbox':
29514
+ return index.h("toggle-checkbox-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, options: this.options });
29496
29515
  case 'datetime':
29497
29516
  return index.h("date-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, dateFormat: this.dateFormat });
29498
29517
  case 'password':
@@ -29562,7 +29581,7 @@ const translate = (key, customLang, values) => {
29562
29581
  return translation;
29563
29582
  };
29564
29583
 
29565
- const generalRegistrationCss = "*,\n*::before,\n*::after {\n padding: 0;\n margin: 0;\n box-sizing: border-box;\n}\n\n.registration__form.hidden {\n display: none;\n}\n\n.registration {\n font-family: \"Roboto\";\n font-style: normal;\n font-family: sans-serif;\n display: flex;\n flex-direction: column;\n gap: 24px;\n width: 100%;\n height: 100%;\n container-type: inline-size;\n}\n.registration__error-message {\n color: #cc0000b3;\n}\n.registration__form {\n display: grid;\n grid-template-columns: repeat(1, 1fr);\n gap: 40px;\n justify-items: stretch;\n align-content: flex-start;\n overflow: auto;\n width: 100%;\n height: 100%;\n}\n.registration__buttons-wrapper {\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n align-items: center;\n}\n.registration__button {\n text-transform: uppercase;\n width: 250px;\n height: 40px;\n border-radius: 3px;\n}\n.registration__button:hover {\n opacity: 0.8;\n}\n.registration__button:active {\n opacity: 1;\n}\n.registration__button--next {\n color: #FFFFFF;\n background-color: #B0B0B0;\n border: none;\n}\n.registration__button--back {\n color: #B0B0B0;\n background-color: #FFFFFF;\n border: 2px solid #B0B0B0;\n}\n.registration__button--disabled {\n opacity: 0.5;\n}\n.registration__button--disabled:hover {\n opacity: 0.5;\n}\n.registration__button--first-step {\n display: none;\n}\n\n@container (min-width: 450px) {\n .registration__form {\n grid-template-columns: repeat(2, 1fr);\n }\n\n .registration__buttons-wrapper {\n flex-direction: row-reverse;\n gap: 15px;\n }\n}";
29584
+ const generalRegistrationCss = "*,\n*::before,\n*::after {\n padding: 0;\n margin: 0;\n box-sizing: border-box;\n}\n\n.registration__form.hidden {\n display: none;\n}\n\n.registration {\n font-family: \"Roboto\";\n font-style: normal;\n font-family: sans-serif;\n display: flex;\n flex-direction: column;\n gap: 24px;\n width: 100%;\n height: 100%;\n container-type: inline-size;\n}\n.registration__error-message {\n color: #cc0000b3;\n}\n.registration__form {\n display: grid;\n grid-template-columns: repeat(1, 1fr);\n gap: 40px;\n justify-items: stretch;\n align-content: flex-start;\n overflow: auto;\n width: 100%;\n height: 100%;\n}\n.registration__buttons-wrapper {\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n align-items: center;\n}\n.registration__button {\n border: none;\n border-radius: 20px;\n box-shadow: 0px 2px 1px rgba(11, 16, 19, 0.6);\n color: #0B1013;\n font-size: 18px;\n font-weight: bold;\n text-transform: uppercase;\n width: 150px;\n height: 45px;\n}\n.registration__button--disabled {\n color: #647480;\n background-color: #CFCFCF;\n box-shadow: none;\n}\n.registration__button--first-step {\n display: none;\n}\n\n@container (min-width: 450px) {\n .registration__form {\n grid-template-columns: repeat(2, 1fr);\n }\n\n .registration__buttons-wrapper {\n flex-direction: row-reverse;\n gap: 15px;\n }\n}";
29566
29585
 
29567
29586
  const GeneralRegistration = class {
29568
29587
  constructor(hostRef) {
@@ -29587,6 +29606,7 @@ const GeneralRegistration = class {
29587
29606
  this.translationUrl = '';
29588
29607
  this.isLoading = true;
29589
29608
  this.forms = [];
29609
+ this.limitStylingAppends = false;
29590
29610
  this.listOfInputValues = [];
29591
29611
  this.listOfInputValidity = [];
29592
29612
  this.listOfActions = [];
@@ -29599,7 +29619,7 @@ const GeneralRegistration = class {
29599
29619
  this.setClientStyling = () => {
29600
29620
  let sheet = document.createElement('style');
29601
29621
  sheet.innerHTML = this.clientStyling;
29602
- this.stylingContainer.prepend(sheet);
29622
+ this.host.shadowRoot.prepend(sheet);
29603
29623
  };
29604
29624
  this.setClientStylingURL = () => {
29605
29625
  let url = new URL(this.clientStylingUrl);
@@ -29609,7 +29629,7 @@ const GeneralRegistration = class {
29609
29629
  .then((data) => {
29610
29630
  cssFile.innerHTML = data;
29611
29631
  this.clientStyling = data;
29612
- setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
29632
+ setTimeout(() => { this.host.shadowRoot.prepend(cssFile); }, 1);
29613
29633
  });
29614
29634
  };
29615
29635
  }
@@ -29641,43 +29661,22 @@ const GeneralRegistration = class {
29641
29661
  componentWillLoad() {
29642
29662
  return this.getRegisterConfig()
29643
29663
  .then((config) => {
29644
- if (this.translationUrl) {
29645
- getTranslations(this.translationUrl).then(() => {
29646
- config.content.fields.forEach(field => {
29647
- if (TRANSLATIONS[this.language][field.name]) {
29648
- Object.keys(TRANSLATIONS[this.language][field.name]).forEach((key) => {
29649
- field[key] = TRANSLATIONS[this.language][field.name][key];
29650
- });
29651
- }
29652
- return field;
29653
- });
29654
- })
29655
- .catch((error) => {
29656
- console.error('Failed to fetch translations:', error);
29657
- }).finally(() => {
29658
- this.formatConfig(config);
29659
- this.stepsStateMachine({ event: 'set', type: 'inputs' });
29660
- });
29661
- }
29662
- else {
29663
- this.formatConfig(config);
29664
- this.isFormValid = !this.getInvalidStatus(this.listOfInputValidity);
29665
- this.stepsStateMachine({ event: 'set', type: 'inputs' });
29666
- }
29664
+ this.formatConfig(config);
29665
+ this.isFormValid = !this.getInvalidStatus(this.listOfInputValidity);
29666
+ this.stepsStateMachine({ event: 'set', type: 'inputs' });
29667
29667
  });
29668
29668
  }
29669
- componentDidRender() {
29670
- if (this.stylingContainer) {
29669
+ componentDidLoad() {
29670
+ this.registrationWidgetLoaded.emit();
29671
+ window.postMessage({ type: 'registrationWidgetLoaded' }, window.location.href);
29672
+ if (!this.limitStylingAppends && this.host) {
29671
29673
  if (this.clientStyling)
29672
29674
  this.setClientStyling();
29673
29675
  if (this.clientStylingUrl)
29674
29676
  this.setClientStylingURL();
29677
+ this.limitStylingAppends = true;
29675
29678
  }
29676
29679
  }
29677
- componentDidLoad() {
29678
- this.registrationWidgetLoaded.emit();
29679
- window.postMessage({ type: 'registrationWidgetLoaded' }, window.location.href);
29680
- }
29681
29680
  nextHandler(e) {
29682
29681
  e.preventDefault();
29683
29682
  // Trigger events in subwidgets.
@@ -29864,10 +29863,7 @@ const GeneralRegistration = class {
29864
29863
  })
29865
29864
  .then((data) => {
29866
29865
  this.isLoading = false;
29867
- if (data.userId) {
29868
- alert(`User registered - the user ID is ${data.userId}`);
29869
- }
29870
- window.postMessage({ type: 'registrationSuccessful' }, window.location.href);
29866
+ window.postMessage({ type: 'registrationSuccessful', userId: data === null || data === void 0 ? void 0 : data.userId }, window.location.href);
29871
29867
  })
29872
29868
  .catch((err) => {
29873
29869
  this.isLoading = false;
@@ -29891,22 +29887,51 @@ const GeneralRegistration = class {
29891
29887
  return [inputElement];
29892
29888
  }
29893
29889
  });
29894
- // Set validity status of each input
29895
- this.listOfInputValidity = this.listOfInputs.map(field => {
29896
- return {
29897
- name: field.name,
29898
- isValid: this.setInitialValidStatus(field)
29899
- };
29900
- });
29901
- // Populate the list of inputs values and set as null in the beginning (or false for checkbox type inputs)
29902
- this.listOfInputValues = this.listOfInputs.map(field => {
29903
- var _a, _b;
29904
- return { name: field.name,
29905
- value: ((_a = field.inputType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) == 'checkbox' ? 'false' : null,
29906
- isDuplicate: field.isDuplicateInput || false,
29907
- type: ((_b = field.inputType) === null || _b === void 0 ? void 0 : _b.toLowerCase()) == 'checkboxgroup' ? 'checkboxgroup' : null
29908
- };
29909
- });
29890
+ this.listOfInputValidity = this.listOfInputs.reduce((acc, field) => {
29891
+ var _a;
29892
+ // If the field is a togglecheckbox, add its subfields
29893
+ if (((_a = field.inputType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === "togglecheckbox") {
29894
+ field.data.subFields.forEach(subfield => {
29895
+ acc.push({
29896
+ name: subfield.name,
29897
+ isValid: this.setInitialValidStatus(subfield)
29898
+ });
29899
+ });
29900
+ }
29901
+ else {
29902
+ acc.push({
29903
+ name: field.name,
29904
+ isValid: this.setInitialValidStatus(field)
29905
+ });
29906
+ }
29907
+ return acc;
29908
+ }, []);
29909
+ this.listOfInputValues = this.listOfInputs.reduce((acc, field) => {
29910
+ var _a, _b, _c;
29911
+ // If the field type is a 'togglecheckbox', add its subfields
29912
+ if (((_a = field.inputType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === "togglecheckbox") {
29913
+ field.data.subFields.forEach(subfield => {
29914
+ var _a, _b;
29915
+ acc.push({
29916
+ name: subfield.name,
29917
+ value: ((_a = subfield.inputType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) == 'checkbox' ? 'false' : null,
29918
+ isDuplicate: subfield.isDuplicateInput || false,
29919
+ type: ((_b = field.inputType) === null || _b === void 0 ? void 0 : _b.toLowerCase()) == 'togglecheckbox'
29920
+ ? 'togglecheckbox'
29921
+ : null
29922
+ });
29923
+ });
29924
+ }
29925
+ else {
29926
+ acc.push({
29927
+ name: field.name,
29928
+ value: ((_b = field.inputType) === null || _b === void 0 ? void 0 : _b.toLowerCase()) == 'checkbox' ? 'false' : null,
29929
+ isDuplicate: field.isDuplicateInput || false,
29930
+ type: ((_c = field.inputType) === null || _c === void 0 ? void 0 : _c.toLowerCase()) == 'checkboxgroup' ? 'checkboxgroup' : null
29931
+ });
29932
+ }
29933
+ return acc;
29934
+ }, []);
29910
29935
  // Set the list of actions
29911
29936
  this.listOfActions = config.content.actions.map(action => action);
29912
29937
  this.registrationID = config.content.registrationID;
@@ -29914,8 +29939,32 @@ const GeneralRegistration = class {
29914
29939
  if (this.listOfActions.some(action => action == '/register')) {
29915
29940
  this.lastStep = this.registrationStep;
29916
29941
  }
29917
- // this.forms.push({ [this.registrationStep] : this.listOfInputs});
29918
- this.forms = [...this.forms, { [this.registrationStep]: this.listOfInputs }];
29942
+ // The translations for fields happens here.
29943
+ if (this.translationUrl) {
29944
+ getTranslations(this.translationUrl).then(() => {
29945
+ this.listOfInputs.forEach(field => {
29946
+ var _a, _b;
29947
+ this.addTranslation(field);
29948
+ // Logic for fields types that have subfields
29949
+ if (((_a = field.inputType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'togglecheckbox') {
29950
+ field.data.subFields.forEach(subField => this.addTranslation(subField));
29951
+ }
29952
+ if (((_b = field.inputType) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'checkboxgroup') {
29953
+ this.addTranslation(field);
29954
+ field.data.subFields.forEach(subField => this.addTranslation(subField));
29955
+ }
29956
+ return field;
29957
+ });
29958
+ })
29959
+ .catch((error) => {
29960
+ console.error('Failed to fetch translations:', error);
29961
+ }).finally(() => {
29962
+ this.forms = [...this.forms, { [this.registrationStep]: this.listOfInputs }];
29963
+ });
29964
+ }
29965
+ else {
29966
+ this.forms = [...this.forms, { [this.registrationStep]: this.listOfInputs }];
29967
+ }
29919
29968
  // Add the step to the registrationStepsData
29920
29969
  this.registrationStepsState.regId = this.registrationID;
29921
29970
  if (!this.registrationStepsState[this.registrationStep]) {
@@ -29927,6 +29976,13 @@ const GeneralRegistration = class {
29927
29976
  };
29928
29977
  }
29929
29978
  }
29979
+ addTranslation(field) {
29980
+ if (TRANSLATIONS[this.language][field.name]) {
29981
+ Object.keys(TRANSLATIONS[this.language][field.name]).forEach((key) => {
29982
+ field[key] = TRANSLATIONS[this.language][field.name][key];
29983
+ });
29984
+ }
29985
+ }
29930
29986
  setInitialValidStatus(field) {
29931
29987
  var _a, _b;
29932
29988
  // Input type checkbox, with no validation are valid
@@ -29953,7 +30009,11 @@ const GeneralRegistration = class {
29953
30009
  }
29954
30010
  renderForm() {
29955
30011
  return this.forms.map((form, index$1) => {
29956
- return index.h("form", { action: '.', id: `RegistrationForm${this.registrationStep}`, class: `registration__form ${this.registrationStep !== `Step${index$1 + 1}` ? 'hidden' : ''}`, ref: el => this.form = el }, form[this.registrationStep] && form[this.registrationStep].map(input => index.h("general-input", { type: input.inputType, name: input.name, displayName: input.displayName, validation: input.validate, action: input.action || null, options: input.data ? input.inputType.toLowerCase() == 'checkboxgroup' ? input.data.subFields : input.data.values : [], defaultValue: input.defaultValue, autofilled: input.autofill, emitValue: this.emitValue, language: this.language, isDuplicateInput: input.isDuplicateInput, "client-styling": this.clientStyling, tooltip: input.tooltip, placeholder: input.placeholder == null ? '' : input.placeholder, dateFormat: this.dateFormat })), this.buttonInsideForm && this.renderButtons());
30012
+ return index.h("form", { action: '.', id: `RegistrationForm${this.registrationStep}`, class: `registration__form ${this.registrationStep !== `Step${index$1 + 1}` ? 'hidden' : ''}`, ref: el => this.form = el }, form[this.registrationStep] && form[this.registrationStep].map(input => index.h("general-input", { type: input.inputType, name: input.name, displayName: input.displayName, validation: input.validate, action: input.action || null, options: input.data
30013
+ ? (input.inputType.toLowerCase() == 'checkboxgroup' || input.inputType.toLowerCase() == 'togglecheckbox')
30014
+ ? input.data.subFields
30015
+ : input.data.values
30016
+ : [], defaultValue: input.defaultValue, autofilled: input.autofill, emitValue: this.emitValue, language: this.language, isDuplicateInput: input.isDuplicateInput, "client-styling": this.clientStyling, tooltip: input.tooltip, placeholder: input.placeholder == null ? '' : input.placeholder, dateFormat: this.dateFormat })), this.buttonInsideForm && this.renderButtons());
29957
30017
  });
29958
30018
  }
29959
30019
  ;
@@ -29964,8 +30024,9 @@ const GeneralRegistration = class {
29964
30024
  if (this.isLoading) {
29965
30025
  return index.h("p", null, "Please wait, loading ...");
29966
30026
  }
29967
- return (index.h("div", { class: `registration registration__${this.registrationStep}`, ref: el => this.stylingContainer = el }, this.renderForm(), index.h("p", { class: 'registration__error-message' }, this.errorMessage), !this.buttonInsideForm && this.renderButtons()));
30027
+ return (index.h("div", { class: `registration registration__${this.registrationStep}` }, this.renderForm(), index.h("p", { class: 'registration__error-message' }, this.errorMessage), !this.buttonInsideForm && this.renderButtons()));
29968
30028
  }
30029
+ get host() { return index.getElement(this); }
29969
30030
  static get watchers() { return {
29970
30031
  "registrationStep": ["sendStep"],
29971
30032
  "forms": ["setFormValidity"]
@@ -29973,7 +30034,7 @@ const GeneralRegistration = class {
29973
30034
  };
29974
30035
  GeneralRegistration.style = generalRegistrationCss;
29975
30036
 
29976
- const numberInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.number{font-family:\"Roboto\";font-style:normal}.number__wrapper{position:relative;width:100%}.number__wrapper--flex{display:flex;gap:5px}.number__wrapper--relative{position:relative}.number__label{font-family:inherit;font-style:normal;font-weight:500;font-size:16px;line-height:20px;color:#1F1F1F}.number__label--required::after{content:\"*\";font-family:inherit;color:#1F1F1F;margin-left:2px}.number__input{border-radius:4px;background-color:transparent;font-family:inherit;font-style:normal;font-weight:300;font-size:16px;line-height:19px;color:#2A2E3F;padding:8px 20px;width:inherit;position:relative;border:2px solid #DEE1EE;-moz-appearance:textfield;}.number__input:focus{outline-color:#3E3E3E}.number__input::-webkit-outer-spin-button,.number__input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.number__input--invalid{border:2px solid #cc0000b3}.number__error-message{position:absolute;top:calc(100% + 5px);left:0;color:#cc0000b3}.number__tooltip-icon{width:16px;height:auto}.number__tooltip{position:absolute;top:0;left:20px;background-color:#FFFFFF;border:1px solid #B0B0B0;color:#2B2D3F;padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.number__tooltip.visible{opacity:1}";
30037
+ const numberInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.number{font-family:\"Roboto\";font-style:normal}.number__wrapper{position:relative;width:100%}.number__wrapper--flex{display:flex;gap:5px}.number__wrapper--relative{position:relative}.number__label{font-family:inherit;font-style:normal;font-weight:500;font-size:16px;line-height:20px;color:#2A3841}.number__label--required::after{content:\"*\";font-family:inherit;color:#2A3841;margin-left:2px}.number__input{border-radius:4px;background-color:transparent;font-family:inherit;font-style:normal;font-weight:300;font-size:16px;line-height:19px;color:#2A2E3F;padding:10px 20px;width:inherit;position:relative;border:2px solid #DEE1EE;-moz-appearance:textfield;}.number__input:focus{outline-color:#3E3E3E}.number__input::-webkit-outer-spin-button,.number__input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.number__input--invalid{border:2px solid #cc0000b3}.number__input::placeholder{color:#979797}.number__error-message{position:absolute;top:calc(100% + 5px);left:0;color:#cc0000b3}.number__tooltip-icon{width:16px;height:auto}.number__tooltip{position:absolute;top:0;left:20px;background-color:#FFFFFF;border:1px solid #B0B0B0;color:#2B2D3F;padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.number__tooltip.visible{opacity:1}";
29977
30038
 
29978
30039
  const NumberInput = class {
29979
30040
  constructor(hostRef) {
@@ -30063,9 +30124,11 @@ const NumberInput = class {
30063
30124
  }
30064
30125
  }
30065
30126
  setErrorMessage() {
30066
- var _a;
30127
+ var _a, _b;
30067
30128
  if (this.inputReference.validity.patternMismatch) {
30068
- return (_a = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _a === void 0 ? void 0 : _a.errorMessage;
30129
+ const errorCode = (_a = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _a === void 0 ? void 0 : _a.errorKey;
30130
+ const errorMessage = (_b = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _b === void 0 ? void 0 : _b.errorMessage;
30131
+ return translate$2(`${errorCode}`, this.language) ? translate$2(`${errorCode}`, this.language) : errorMessage;
30069
30132
  }
30070
30133
  if (this.inputReference.validity.rangeUnderflow || this.inputReference.validity.rangeOverflow) {
30071
30134
  return translate$2('numberLengthError', this.language, { values: { min: this.validation.min, max: this.validation.max } });
@@ -30081,7 +30144,7 @@ const NumberInput = class {
30081
30144
  return null;
30082
30145
  }
30083
30146
  render() {
30084
- let invalidClass;
30147
+ let invalidClass = '';
30085
30148
  if (this.touched) {
30086
30149
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
30087
30150
  }
@@ -30731,7 +30794,8 @@ class PasswordField extends TextField {
30731
30794
  super();
30732
30795
  this._setType('password');
30733
30796
  this.__boundRevealButtonClick = this._onRevealButtonClick.bind(this);
30734
- this.__boundRevealButtonTouchend = this._onRevealButtonTouchend.bind(this);
30797
+ this.__boundRevealButtonMouseDown = this._onRevealButtonMouseDown.bind(this);
30798
+ this.__lastChange = '';
30735
30799
  }
30736
30800
 
30737
30801
  /** @protected */
@@ -30748,7 +30812,7 @@ class PasswordField extends TextField {
30748
30812
  btn.disabled = host.disabled;
30749
30813
 
30750
30814
  btn.addEventListener('click', host.__boundRevealButtonClick);
30751
- btn.addEventListener('touchend', host.__boundRevealButtonTouchend);
30815
+ btn.addEventListener('mousedown', host.__boundRevealButtonMouseDown);
30752
30816
  },
30753
30817
  );
30754
30818
  this.addController(this._revealButtonController);
@@ -30763,6 +30827,19 @@ class PasswordField extends TextField {
30763
30827
  }
30764
30828
  }
30765
30829
 
30830
+ /**
30831
+ * Override an event listener inherited from `InputControlMixin`
30832
+ * to store the value at the moment of the native `change` event.
30833
+ * @param {Event} event
30834
+ * @protected
30835
+ * @override
30836
+ */
30837
+ _onChange(event) {
30838
+ super._onChange(event);
30839
+
30840
+ this.__lastChange = this.inputElement.value;
30841
+ }
30842
+
30766
30843
  /**
30767
30844
  * Override method inherited from `FocusMixin` to mark field as focused
30768
30845
  * when focus moves to the reveal button using Shift Tab.
@@ -30799,6 +30876,12 @@ class PasswordField extends TextField {
30799
30876
 
30800
30877
  if (!focused) {
30801
30878
  this._setPasswordVisible(false);
30879
+
30880
+ // Detect if `focusout` was prevented and if so, dispatch `change` event manually.
30881
+ if (this.__lastChange !== this.inputElement.value) {
30882
+ this.__lastChange = this.inputElement.value;
30883
+ this.dispatchEvent(new CustomEvent('change', { bubbles: true }));
30884
+ }
30802
30885
  } else {
30803
30886
  const isButtonFocused = this.getRootNode().activeElement === this._revealNode;
30804
30887
  // Remove focus-ring from the field when the reveal button gets focused
@@ -30834,10 +30917,10 @@ class PasswordField extends TextField {
30834
30917
  }
30835
30918
 
30836
30919
  /** @private */
30837
- _onRevealButtonTouchend(e) {
30838
- // Cancel the following click event
30920
+ _onRevealButtonMouseDown(e) {
30921
+ // Cancel the following focusout event
30839
30922
  e.preventDefault();
30840
- this._togglePasswordVisibility();
30923
+
30841
30924
  // Focus the input to avoid problem with password still visible
30842
30925
  // when user clicks the reveal button and then clicks outside.
30843
30926
  this.inputElement.focus();
@@ -30890,7 +30973,7 @@ class PasswordField extends TextField {
30890
30973
 
30891
30974
  customElements.define(PasswordField.is, PasswordField);
30892
30975
 
30893
- const passwordInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.password{font-family:\"Roboto\";font-style:normal}.password__wrapper{width:100%}.password__wrapper--flex{display:flex;gap:5px}.password__wrapper--relative{position:relative}.password__label{font-family:inherit;font-style:normal;font-weight:500;font-size:16px;line-height:20px;color:#1F1F1F}.password__label--required::after{content:\"*\";font-family:inherit;color:#1F1F1F;margin-left:2px}.password__input{width:inherit;border:none;margin-bottom:5px}.password__input[focused]::part(input-field){border-color:#3E3E3E}.password__input[invalid]::part(input-field){border-color:#cc0000b3}.password__input::part(input-field){border-radius:4px;background-color:transparent;font-family:inherit;font-style:normal;font-weight:300;font-size:16px;line-height:19px;color:#2A2E3F;width:100%;position:relative;border:2px solid #DEE1EE}.password__error-message{color:#cc0000b3}.password__complexity{position:relative;padding:10px;display:flex;flex-direction:column;gap:20px;justify-content:center;margin-top:20px;font-weight:300;background:#FFFFFF;-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;height:150px;border:1px solid #B0B0B0}.password__complexity--strength{display:flex;justify-content:space-evenly}.password__complexity--strength meter::-webkit-meter-optimum-value{background:#1F1F1F}.password__complexity--strength meter::-moz-meter-bar{background:#B0B0B0}.password__complexity--text-bold{font-weight:500}.password__complexity--checkbox{margin-right:5px}.password__complexity:after{content:\"\";position:absolute;width:25px;height:25px;border-top:1px solid #B0B0B0;border-right:0 solid #B0B0B0;border-left:1px solid #B0B0B0;border-bottom:0 solid #B0B0B0;bottom:92%;left:50%;margin-left:-25px;transform:rotate(45deg);margin-top:-25px;background-color:#FFFFFF}.password__tooltip-icon{width:16px;height:auto}.password__tooltip{position:absolute;top:0;left:20px;background-color:#FFFFFF;border:1px solid #B0B0B0;color:#2B2D3F;padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.password__tooltip.visible{opacity:1}";
30976
+ const passwordInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.password{font-family:\"Roboto\";font-style:normal}.password__wrapper{width:100%}.password__wrapper--flex{display:flex;gap:5px}.password__wrapper--relative{position:relative}.password__label{font-family:inherit;font-style:normal;font-weight:500;font-size:16px;line-height:20px;color:#2A3841}.password__label--required::after{content:\"*\";font-family:inherit;color:#2A3841;margin-left:2px}.password__input{width:inherit;border:none;margin-bottom:5px}.password__input[focused]::part(input-field){border-color:#3E3E3E}.password__input[invalid]::part(input-field){border-color:#cc0000b3}.password__input::part(input-field){border-radius:4px;background-color:transparent;font-family:inherit;font-style:normal;font-weight:300;font-size:16px;line-height:19px;color:#2A2E3F;width:100%;position:relative;border:2px solid #DEE1EE}.password__input>input:placeholder-shown{color:#979797}.password__error-message{color:#cc0000b3}.password__complexity{position:relative;padding:10px;display:flex;flex-direction:column;gap:20px;justify-content:center;margin-top:20px;font-weight:300;background:#FFFFFF;-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;height:150px;border:1px solid #B0B0B0}.password__complexity--strength{display:flex;justify-content:space-evenly}.password__complexity--strength meter::-webkit-meter-optimum-value{background:#1F1F1F}.password__complexity--strength meter::-moz-meter-bar{background:#B0B0B0}.password__complexity--hidden{display:none}.password__complexity--text-bold{font-weight:500}.password__complexity--checkbox{margin-right:5px}.password__complexity:after{content:\"\";position:absolute;width:25px;height:25px;border-top:1px solid #B0B0B0;border-right:0 solid #B0B0B0;border-left:1px solid #B0B0B0;border-bottom:0 solid #B0B0B0;bottom:92%;left:50%;margin-left:-25px;transform:rotate(45deg);margin-top:-25px;background-color:#FFFFFF}.password__tooltip-icon{width:16px;height:auto}.password__tooltip{position:absolute;top:0;left:20px;background-color:#FFFFFF;border:1px solid #B0B0B0;color:#2B2D3F;padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.password__tooltip.visible{opacity:1}";
30894
30977
 
30895
30978
  const PasswordInput = class {
30896
30979
  constructor(hostRef) {
@@ -31032,9 +31115,11 @@ const PasswordInput = class {
31032
31115
  }
31033
31116
  }
31034
31117
  setErrorMessage() {
31035
- var _a;
31118
+ var _a, _b, _c, _d;
31036
31119
  if (this.inputReference.validity.patternMismatch) {
31037
- return (_a = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _a === void 0 ? void 0 : _a.errorMessage;
31120
+ const errorCode = (_a = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _a === void 0 ? void 0 : _a.errorKey;
31121
+ const errorMessage = (_b = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _b === void 0 ? void 0 : _b.errorMessage;
31122
+ return translate$2(`${errorCode}`, this.language) ? translate$2(`${errorCode}`, this.language) : errorMessage;
31038
31123
  }
31039
31124
  if (this.inputReference.validity.tooShort || this.inputReference.validity.tooLong) {
31040
31125
  return translate$2('lengthError', this.language, { values: { minLength: this.validation.minLength, maxLength: this.validation.maxLength } });
@@ -31043,7 +31128,9 @@ const PasswordInput = class {
31043
31128
  return translate$2('requiredError', this.language);
31044
31129
  }
31045
31130
  if (this.isDuplicateInput && this.duplicateInputValue !== this.value) {
31046
- return this.validation.custom.find(customRule => customRule.rule === 'duplicate-input').errorMessage;
31131
+ const errorCode = (_c = this.validation.custom.find(customRule => customRule.rule === 'duplicate-input')) === null || _c === void 0 ? void 0 : _c.errorKey;
31132
+ const errorMessage = (_d = this.validation.custom.find(customRule => customRule.rule === 'duplicate-input')) === null || _d === void 0 ? void 0 : _d.errorMessage;
31133
+ return translate$2(`${errorCode}`, this.language) ? translate$2(`${errorCode}`, this.language) : errorMessage;
31047
31134
  }
31048
31135
  }
31049
31136
  renderTooltip() {
@@ -31057,14 +31144,13 @@ const PasswordInput = class {
31057
31144
  const passedRules = this.passwordComplexity.filter(complexity => complexity.passed).length;
31058
31145
  const meterValue = passedRules / totalRules;
31059
31146
  const allRulesPassed = this.passwordComplexity.every(complexity => complexity.passed);
31060
- if (this.showPopup === false)
31061
- return;
31062
- return (index.h("div", { class: `password__complexity` }, index.h("div", { class: 'password__complexity--strength' }, index.h("p", { class: 'password__complexity--text' }, translate$2('passwordStrength', this.language), "\u00A0", index.h("span", { class: 'password__complexity--text-bold' }, translate$2(`${allRulesPassed ? 'passwordStrengthStrong' : 'passwordStrengthWeak'}`, this.language))), index.h("meter", { value: meterValue, min: "0", max: "1" })), index.h("div", null, this.passwordComplexity.map((complexity, index$1) => {
31063
- return (index.h("div", { key: index$1 }, index.h("input", { class: 'password__complexity--checkbox', type: "checkbox", checked: complexity.passed, disabled: true }), index.h("span", null, complexity.rule)));
31147
+ // if (this.showPopup === false) return;
31148
+ return (index.h("div", { class: `password__complexity ${!this.showPopup ? 'password__complexity--hidden' : ''}` }, index.h("div", { class: 'password__complexity--strength' }, index.h("p", { class: 'password__complexity--text' }, translate$2('passwordStrength', this.language), "\u00A0", index.h("span", { class: 'password__complexity--text-bold' }, translate$2(`${allRulesPassed ? 'passwordStrengthStrong' : 'passwordStrengthWeak'}`, this.language))), index.h("meter", { value: meterValue, min: "0", max: "1" })), index.h("div", null, this.passwordComplexity.map((complexity, index$1) => {
31149
+ return (index.h("div", { key: index$1 }, index.h("input", { class: 'password__complexity--checkbox', type: "checkbox", checked: complexity.passed, disabled: true }), index.h("span", null, translate$2(`${complexity.rule}`, this.language) ? translate$2(`${complexity.rule}`, this.language) : complexity.rule)));
31064
31150
  }))));
31065
31151
  }
31066
31152
  render() {
31067
- let invalidClass;
31153
+ let invalidClass = '';
31068
31154
  if (this.touched) {
31069
31155
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
31070
31156
  }
@@ -35486,7 +35572,7 @@ class ComboBox extends ComboBoxDataProviderMixin(
35486
35572
 
35487
35573
  customElements.define(ComboBox.is, ComboBox);
35488
35574
 
35489
- const selectInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.select{font-family:\"Roboto\";font-style:normal}.select__wrapper{position:relative;width:100%}.select__wrapper--flex{display:flex;gap:5px}.select__wrapper--relative{position:relative}.select__label{font-family:inherit;font-style:normal;font-weight:500;font-size:16px;line-height:20px;color:#1F1F1F}.select__label--required::after{content:\"*\";font-family:inherit;color:#1F1F1F;margin-left:2px}.select__input{border:none;width:inherit;position:relative}.select__input[focused]::part(input-field){border-color:#3E3E3E}.select__input[invalid]::part(input-field){border-color:#cc0000b3}.select__input vaadin-date-picker-overlay-content>vaadin-button{color:#1F1F1F}.select__input vaadin-month-calendar::part(selected date){background-color:red}.select__input::part(input-field){border-radius:4px;background-color:#FFFFFF;border:2px solid #DEE1EE;color:#2A2E3F;border-radius:4px;background-color:transparent;font-family:inherit;font-style:normal;font-weight:300;font-size:16px;line-height:19px}.select__error-message{position:absolute;top:calc(100% + 5px);left:0;color:#cc0000b3}.select__tooltip-icon{width:16px;height:auto}.select__tooltip{position:absolute;top:0;left:20px;background-color:#FFFFFF;border:1px solid #B0B0B0;color:#2B2D3F;padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.select__tooltip.visible{opacity:1}";
35575
+ const selectInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.select{font-family:\"Roboto\";font-style:normal}.select__wrapper{position:relative;width:100%}.select__wrapper--flex{display:flex;gap:5px}.select__wrapper--relative{position:relative}.select__label{font-family:inherit;font-style:normal;font-weight:500;font-size:16px;line-height:20px;color:#2A3841}.select__label--required::after{content:\"*\";font-family:inherit;color:#2A3841;margin-left:2px}.select__input{border:none;width:inherit;position:relative}.select__input[focused]::part(input-field){border-color:#3E3E3E}.select__input[invalid]::part(input-field){border-color:#cc0000b3}.select__input vaadin-date-picker-overlay-content>vaadin-button{color:#1F1F1F}.select__input vaadin-month-calendar::part(selected date){background-color:red}.select__input::part(input-field){border-radius:4px;background-color:#FFFFFF;border:2px solid #DEE1EE;color:#2A2E3F;border-radius:4px;background-color:transparent;font-family:inherit;font-style:normal;font-weight:300;font-size:16px;line-height:19px}.select__error-message{position:absolute;top:calc(100% + 5px);left:0;color:#cc0000b3}.select__tooltip-icon{width:16px;height:auto}.select__tooltip{position:absolute;top:0;left:20px;background-color:#FFFFFF;border:1px solid #B0B0B0;color:#2B2D3F;padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.select__tooltip.visible{opacity:1}";
35490
35576
 
35491
35577
  const SelectInput = class {
35492
35578
  constructor(hostRef) {
@@ -35550,8 +35636,10 @@ const SelectInput = class {
35550
35636
  componentWillLoad() {
35551
35637
  if (this.action && !this.options.length) {
35552
35638
  if (this.action.split(" ")[0] == 'GET') {
35553
- return this.getOptions().then((options) => {
35554
- this.displayedOptions = options.countries.map(option => {
35639
+ const endpoint = this.action.split(" ")[1];
35640
+ return this.getOptions(endpoint).then((options) => {
35641
+ const firstKey = Object.keys(options)[0];
35642
+ this.displayedOptions = options[firstKey].map(option => {
35555
35643
  return { label: option.Name, value: option.Alpha2Code };
35556
35644
  });
35557
35645
  });
@@ -35575,9 +35663,8 @@ const SelectInput = class {
35575
35663
  this.valueHandler({ name: this.name, value: this.value });
35576
35664
  }
35577
35665
  }
35578
- getOptions() {
35579
- // TEMPORARY FOR DEMO PURPOSES UNTIL NORWAY CONFIGURES AN ACTUAL ENDPOINT...
35580
- const url = new URL("https://demo-api.stage.norway.everymatrix.com/v1/player/countries");
35666
+ getOptions(endpoint) {
35667
+ const url = new URL(endpoint);
35581
35668
  return new Promise((resolve, reject) => {
35582
35669
  fetch(url.href)
35583
35670
  .then((res) => res.json())
@@ -35604,7 +35691,7 @@ const SelectInput = class {
35604
35691
  return null;
35605
35692
  }
35606
35693
  render() {
35607
- let invalidClass;
35694
+ let invalidClass = '';
35608
35695
  if (this.touched) {
35609
35696
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
35610
35697
  }
@@ -35619,7 +35706,7 @@ const SelectInput = class {
35619
35706
  };
35620
35707
  SelectInput.style = selectInputCss;
35621
35708
 
35622
- const telInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.tel{font-family:\"Roboto\";font-style:normal}.tel__wrapper{position:relative;width:100%}.tel__wrapper--flex{width:inherit;display:flex;align-items:stretch;border-radius:4px;border:2px solid #DEE1EE}.tel__wrapper--flex:focus-within{border:2px solid #3E3E3E}.tel__wrapper--flex--invalid{border:2px solid #cc0000b3}.tel__wrapper--flex-label{display:flex;gap:5px}.tel__wrapper--flex--relative{position:relative}.tel__label{font-family:inherit;font-style:normal;font-weight:500;font-size:16px;line-height:20px;color:#1F1F1F}.tel__label--required::after{content:\"*\";font-family:inherit;color:#1F1F1F;margin-left:2px}.tel__prefix{width:120px}.tel__prefix[focus]{outline:none}.tel__prefix::part(input-field){border-radius:0 4px 4px 0;background-color:#DEE1EE;color:#1F1F1F;font-family:inherit;font-style:normal;font-weight:300;font-size:16px;line-height:19px}.tel__input{border-radius:4px;background-color:transparent;font-family:inherit;font-style:normal;font-weight:300;font-size:16px;line-height:19px;color:#2A2E3F;border:none;padding:8px 20px;width:inherit;position:relative;-moz-appearance:textfield;}.tel__input:focus{outline:none}.tel__input::-webkit-outer-spin-button,.tel__input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.tel__error-message{position:absolute;top:calc(100% + 5px);left:0;color:#cc0000b3}.tel__tooltip-icon{width:16px;height:auto}.tel__tooltip{position:absolute;top:0;left:20px;background-color:#FFFFFF;border:1px solid #B0B0B0;color:#2B2D3F;padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.tel__tooltip.visible{opacity:1}";
35709
+ const telInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.tel{font-family:\"Roboto\";font-style:normal}.tel__wrapper{position:relative;width:100%}.tel__wrapper--flex{width:inherit;display:flex;align-items:stretch;border-radius:4px;border:2px solid #DEE1EE}.tel__wrapper--flex:focus-within{border:2px solid #3E3E3E}.tel__wrapper--flex--invalid{border:2px solid #cc0000b3}.tel__wrapper--flex-label{display:flex;gap:5px}.tel__wrapper--flex--relative{position:relative}.tel__label{font-family:inherit;font-style:normal;font-weight:500;font-size:16px;line-height:20px;color:#2A3841}.tel__label--required::after{content:\"*\";font-family:inherit;color:#2A3841;margin-left:2px}.tel__prefix{width:120px}.tel__prefix[focus]{outline:none}.tel__prefix::part(input-field){border-radius:0 4px 4px 0;background-color:#DEE1EE;color:#1F1F1F;font-family:inherit;font-style:normal;font-weight:300;font-size:16px;line-height:19px}.tel__input{border-radius:4px;background-color:transparent;font-family:inherit;font-style:normal;font-weight:300;font-size:16px;line-height:19px;color:#2A2E3F;border:none;padding:10px 20px;width:inherit;position:relative;-moz-appearance:textfield;}.tel__input:focus{outline:none}.tel__input::-webkit-outer-spin-button,.tel__input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.tel__error-message{position:absolute;top:calc(100% + 5px);left:0;color:#cc0000b3}.tel__tooltip-icon{width:16px;height:auto}.tel__tooltip{position:absolute;top:0;left:20px;background-color:#FFFFFF;border:1px solid #B0B0B0;color:#2B2D3F;padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.tel__tooltip.visible{opacity:1}";
35623
35710
 
35624
35711
  const TelInput = class {
35625
35712
  constructor(hostRef) {
@@ -35713,7 +35800,7 @@ const TelInput = class {
35713
35800
  this.isValid = this.setValidity();
35714
35801
  if (this.defaultValue) {
35715
35802
  this.value = this.defaultValue;
35716
- this.valueHandler({ name: this.name, value: this.value });
35803
+ this.valueHandler({ name: this.name, value: this.value, type: 'tel' });
35717
35804
  }
35718
35805
  }
35719
35806
  getPhoneCodes(endpoint) {
@@ -35744,9 +35831,11 @@ const TelInput = class {
35744
35831
  }
35745
35832
  }
35746
35833
  setErrorMessage() {
35747
- var _a;
35834
+ var _a, _b;
35748
35835
  if (this.inputReference.validity.patternMismatch) {
35749
- return (_a = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _a === void 0 ? void 0 : _a.errorMessage;
35836
+ const errorCode = (_a = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _a === void 0 ? void 0 : _a.errorKey;
35837
+ const errorMessage = (_b = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _b === void 0 ? void 0 : _b.errorMessage;
35838
+ return translate$2(`${errorCode}`, this.language) ? translate$2(`${errorCode}`, this.language) : errorMessage;
35750
35839
  }
35751
35840
  if (this.inputReference.validity.tooShort || this.inputReference.validity.tooLong) {
35752
35841
  return translate$2('lengthError', this.language, { values: { minLength: this.validation.minLength, maxLength: this.validation.maxLength } });
@@ -35762,7 +35851,7 @@ const TelInput = class {
35762
35851
  return null;
35763
35852
  }
35764
35853
  render() {
35765
- let invalidClass;
35854
+ let invalidClass = '';
35766
35855
  if (this.touched) {
35767
35856
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
35768
35857
  }
@@ -35776,7 +35865,7 @@ const TelInput = class {
35776
35865
  };
35777
35866
  TelInput.style = telInputCss;
35778
35867
 
35779
- 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%}.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:#1F1F1F}.text__label--required::after{content:\"*\";font-family:inherit;color:#1F1F1F;margin-left:2px}.text__input{border-radius:4px;background-color:transparent;font-family:inherit;font-style:normal;font-weight:300;font-size:16px;line-height:19px;color:#2A2E3F;padding:8px 20px;width:inherit;position:relative;border:2px solid #DEE1EE}.text__input:focus{outline-color:#3E3E3E}.text__input--invalid{border:2px solid #cc0000b3}.text__error-message{position:absolute;top:calc(100% + 5px);left:0;color:#cc0000b3}.text__tooltip-icon{width:16px;height:auto}.text__tooltip{position:absolute;top:0;left:20px;background-color:#FFFFFF;border:1px solid #B0B0B0;color:#2B2D3F;padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.text__tooltip.visible{opacity:1}";
35868
+ 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%}.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:#2A3841}.text__label--required::after{content:\"*\";font-family:inherit;color:#2A3841;margin-left:2px}.text__input{border-radius:4px;background-color:transparent;font-family:inherit;font-style:normal;font-weight:300;font-size:16px;line-height:19px;color:#2A2E3F;padding:10px 20px;width:inherit;position:relative;border:2px solid #DEE1EE}.text__input:focus{outline-color:#3E3E3E}.text__input--invalid{border:2px solid #cc0000b3}.text__input::placeholder{color:#979797}.text__error-message{position:absolute;top:calc(100% + 5px);left:0;color:#cc0000b3}.text__tooltip-icon{width:16px;height:auto}.text__tooltip{position:absolute;top:0;left:20px;background-color:#FFFFFF;border:1px solid #B0B0B0;color:#2B2D3F;padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.text__tooltip.visible{opacity:1}";
35780
35869
 
35781
35870
  const TextInput = class {
35782
35871
  constructor(hostRef) {
@@ -35900,9 +35989,11 @@ const TextInput = class {
35900
35989
  }
35901
35990
  }
35902
35991
  setErrorMessage() {
35903
- var _a;
35992
+ var _a, _b, _c, _d;
35904
35993
  if (this.inputReference.validity.patternMismatch) {
35905
- return (_a = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _a === void 0 ? void 0 : _a.errorMessage;
35994
+ const errorCode = (_a = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _a === void 0 ? void 0 : _a.errorKey;
35995
+ const errorMessage = (_b = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _b === void 0 ? void 0 : _b.errorMessage;
35996
+ return translate$2(`${errorCode}`, this.language) ? translate$2(`${errorCode}`, this.language) : errorMessage;
35906
35997
  }
35907
35998
  if (this.inputReference.validity.tooShort || this.inputReference.validity.tooLong) {
35908
35999
  return translate$2('lengthError', this.language, { values: { minLength: this.validation.minLength, maxLength: this.validation.maxLength } });
@@ -35911,7 +36002,9 @@ const TextInput = class {
35911
36002
  return translate$2('requiredError', this.language);
35912
36003
  }
35913
36004
  if (this.isDuplicateInput && this.duplicateInputValue !== this.value) {
35914
- return this.validation.custom.find(customRule => customRule.rule === 'duplicate-input').errorMessage;
36005
+ const errorCode = (_c = this.validation.custom.find(customRule => customRule.rule === 'duplicate-input')) === null || _c === void 0 ? void 0 : _c.errorKey;
36006
+ const errorMessage = (_d = this.validation.custom.find(customRule => customRule.rule === 'duplicate-input')) === null || _d === void 0 ? void 0 : _d.errorMessage;
36007
+ return translate$2(`${errorCode}`, this.language) ? translate$2(`${errorCode}`, this.language) : errorMessage;
35915
36008
  }
35916
36009
  }
35917
36010
  renderTooltip() {
@@ -35921,7 +36014,7 @@ const TextInput = class {
35921
36014
  return null;
35922
36015
  }
35923
36016
  render() {
35924
- let invalidClass;
36017
+ let invalidClass = '';
35925
36018
  if (this.touched) {
35926
36019
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
35927
36020
  }
@@ -35935,6 +36028,94 @@ const TextInput = class {
35935
36028
  };
35936
36029
  TextInput.style = textInputCss;
35937
36030
 
36031
+ const toggleCheckboxInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.togglecheckbox{font-family:\"Roboto\";font-style:normal;font-size:15px}.togglecheckbox__wrapper{position:relative}.togglecheckbox__wrapper--flex{display:flex;gap:5px;align-content:flex-start}.togglecheckbox__wrapper--relative{position:relative;display:inline}.togglecheckbox__input{transform:scale(1.307, 1.307);margin-left:2px}.togglecheckbox__label{font-style:inherit;font-family:inherit;font-weight:400;font-size:16px;color:#2B2D3F;line-height:14px}.togglecheckbox__label-text{font-size:16px}.togglecheckbox__error-message{position:absolute;top:calc(100% + 5px);left:0;color:#cc0000b3}.togglecheckbox__tooltip-icon{width:16px;height:auto}.togglecheckbox__tooltip{position:absolute;top:0;right:0;background-color:#FFFFFF;border:1px solid #B0B0B0;color:#2B2D3F;padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.togglecheckbox__tooltip.visible{opacity:1}.togglecheckbox__fields-wrapper{margin-top:40px;display:flex;flex-direction:column;gap:40px}.hidden{display:none}";
36032
+
36033
+ const ToggleCheckboxInput = class {
36034
+ constructor(hostRef) {
36035
+ index.registerInstance(this, hostRef);
36036
+ this.sendValidityState = index.createEvent(this, "sendValidityState", 7);
36037
+ this.sendInputValue = index.createEvent(this, "sendInputValue", 7);
36038
+ /**
36039
+ * Default value for the input.
36040
+ */
36041
+ this.defaultValue = '';
36042
+ /**
36043
+ * Client custom styling via inline style
36044
+ */
36045
+ this.clientStyling = '';
36046
+ this.limitStylingAppends = false;
36047
+ this.showTooltip = false;
36048
+ this.value = '';
36049
+ this.setClientStyling = () => {
36050
+ let sheet = document.createElement('style');
36051
+ sheet.innerHTML = this.clientStyling;
36052
+ this.stylingContainer.prepend(sheet);
36053
+ };
36054
+ }
36055
+ validityChanged() {
36056
+ }
36057
+ validityStateHandler(inputStateEvent) {
36058
+ this.sendValidityState.emit(inputStateEvent);
36059
+ }
36060
+ emitValueHandler(newValue) {
36061
+ }
36062
+ valueHandler(inputValueEvent) {
36063
+ this.sendInputValue.emit(inputValueEvent);
36064
+ }
36065
+ handleClickOutside(event) {
36066
+ if (event.composedPath()[0] === this.tooltipIconReference)
36067
+ return;
36068
+ if (event.composedPath()[0] !== this.tooltipReference)
36069
+ this.showTooltip = false;
36070
+ }
36071
+ connectedCallback() {
36072
+ }
36073
+ componentDidRender() {
36074
+ // start custom styling area
36075
+ if (!this.limitStylingAppends && this.stylingContainer) {
36076
+ if (this.clientStyling)
36077
+ this.setClientStyling();
36078
+ this.limitStylingAppends = true;
36079
+ }
36080
+ // end custom styling area
36081
+ }
36082
+ componentDidLoad() {
36083
+ }
36084
+ handleClick() {
36085
+ this.showFields = this.checkboxReference.checked;
36086
+ this.errorMessage = this.setErrorMessage();
36087
+ this.isValid = this.setValidity();
36088
+ }
36089
+ setValidity() {
36090
+ return this.checkboxReference.validity.valid;
36091
+ }
36092
+ setErrorMessage() {
36093
+ if (this.checkboxReference.validity.valueMissing) {
36094
+ return translate$2('requiredError', this.language);
36095
+ }
36096
+ }
36097
+ renderLabel() {
36098
+ return (index.h("label", { class: 'togglecheckbox__label', htmlFor: `${this.name}__input` }, index.h("div", { class: 'togglecheckbox__label-text', innerHTML: `${this.displayName} ${this.validation.mandatory ? '*' : ''}` })));
36099
+ }
36100
+ renderTooltip() {
36101
+ if (this.showTooltip) {
36102
+ return (index.h("div", { class: `togglecheckbox__tooltip ${this.showTooltip ? 'visible' : ''}`, ref: (el) => this.tooltipReference = el, innerHTML: this.tooltip }));
36103
+ }
36104
+ return null;
36105
+ }
36106
+ render() {
36107
+ return index.h("div", { class: `togglecheckbox__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { class: 'togglecheckbox__wrapper--flex' }, index.h("input", { 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", { class: 'togglecheckbox__error-message' }, this.errorMessage), index.h("div", { class: 'togglecheckbox__wrapper--relative' }, this.tooltip &&
36108
+ index.h("img", { class: 'togglecheckbox__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), index.h("div", { class: `togglecheckbox__fields-wrapper ${this.showFields ? '' : 'hidden'}` }, this.options.map(subfield => {
36109
+ 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 });
36110
+ })));
36111
+ }
36112
+ static get watchers() { return {
36113
+ "isValid": ["validityChanged"],
36114
+ "emitValue": ["emitValueHandler"]
36115
+ }; }
36116
+ };
36117
+ ToggleCheckboxInput.style = toggleCheckboxInputCss;
36118
+
35938
36119
  exports.checkbox_group_input = CheckboxGroupInput;
35939
36120
  exports.checkbox_input = CheckboxInput;
35940
36121
  exports.date_input = DateInput;
@@ -35947,3 +36128,4 @@ exports.radio_input = RadioInput;
35947
36128
  exports.select_input = SelectInput;
35948
36129
  exports.tel_input = TelInput;
35949
36130
  exports.text_input = TextInput;
36131
+ exports.toggle_checkbox_input = ToggleCheckboxInput;