@everymatrix/general-registration 1.10.24 → 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.
@@ -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
  */
@@ -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
  }
@@ -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
  }
@@ -29644,29 +29661,9 @@ const GeneralRegistration = class {
29644
29661
  componentWillLoad() {
29645
29662
  return this.getRegisterConfig()
29646
29663
  .then((config) => {
29647
- if (this.translationUrl) {
29648
- getTranslations(this.translationUrl).then(() => {
29649
- config.content.fields.forEach(field => {
29650
- if (TRANSLATIONS[this.language][field.name]) {
29651
- Object.keys(TRANSLATIONS[this.language][field.name]).forEach((key) => {
29652
- field[key] = TRANSLATIONS[this.language][field.name][key];
29653
- });
29654
- }
29655
- return field;
29656
- });
29657
- })
29658
- .catch((error) => {
29659
- console.error('Failed to fetch translations:', error);
29660
- }).finally(() => {
29661
- this.formatConfig(config);
29662
- this.stepsStateMachine({ event: 'set', type: 'inputs' });
29663
- });
29664
- }
29665
- else {
29666
- this.formatConfig(config);
29667
- this.isFormValid = !this.getInvalidStatus(this.listOfInputValidity);
29668
- this.stepsStateMachine({ event: 'set', type: 'inputs' });
29669
- }
29664
+ this.formatConfig(config);
29665
+ this.isFormValid = !this.getInvalidStatus(this.listOfInputValidity);
29666
+ this.stepsStateMachine({ event: 'set', type: 'inputs' });
29670
29667
  });
29671
29668
  }
29672
29669
  componentDidLoad() {
@@ -29866,10 +29863,7 @@ const GeneralRegistration = class {
29866
29863
  })
29867
29864
  .then((data) => {
29868
29865
  this.isLoading = false;
29869
- if (data.userId) {
29870
- alert(`User registered - the user ID is ${data.userId}`);
29871
- }
29872
- 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);
29873
29867
  })
29874
29868
  .catch((err) => {
29875
29869
  this.isLoading = false;
@@ -29945,7 +29939,32 @@ const GeneralRegistration = class {
29945
29939
  if (this.listOfActions.some(action => action == '/register')) {
29946
29940
  this.lastStep = this.registrationStep;
29947
29941
  }
29948
- 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
+ }
29949
29968
  // Add the step to the registrationStepsData
29950
29969
  this.registrationStepsState.regId = this.registrationID;
29951
29970
  if (!this.registrationStepsState[this.registrationStep]) {
@@ -29957,6 +29976,13 @@ const GeneralRegistration = class {
29957
29976
  };
29958
29977
  }
29959
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
+ }
29960
29986
  setInitialValidStatus(field) {
29961
29987
  var _a, _b;
29962
29988
  // Input type checkbox, with no validation are valid
@@ -30098,9 +30124,11 @@ const NumberInput = class {
30098
30124
  }
30099
30125
  }
30100
30126
  setErrorMessage() {
30101
- var _a;
30127
+ var _a, _b;
30102
30128
  if (this.inputReference.validity.patternMismatch) {
30103
- 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;
30104
30132
  }
30105
30133
  if (this.inputReference.validity.rangeUnderflow || this.inputReference.validity.rangeOverflow) {
30106
30134
  return translate$2('numberLengthError', this.language, { values: { min: this.validation.min, max: this.validation.max } });
@@ -30116,7 +30144,7 @@ const NumberInput = class {
30116
30144
  return null;
30117
30145
  }
30118
30146
  render() {
30119
- let invalidClass;
30147
+ let invalidClass = '';
30120
30148
  if (this.touched) {
30121
30149
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
30122
30150
  }
@@ -30766,7 +30794,8 @@ class PasswordField extends TextField {
30766
30794
  super();
30767
30795
  this._setType('password');
30768
30796
  this.__boundRevealButtonClick = this._onRevealButtonClick.bind(this);
30769
- this.__boundRevealButtonTouchend = this._onRevealButtonTouchend.bind(this);
30797
+ this.__boundRevealButtonMouseDown = this._onRevealButtonMouseDown.bind(this);
30798
+ this.__lastChange = '';
30770
30799
  }
30771
30800
 
30772
30801
  /** @protected */
@@ -30783,7 +30812,7 @@ class PasswordField extends TextField {
30783
30812
  btn.disabled = host.disabled;
30784
30813
 
30785
30814
  btn.addEventListener('click', host.__boundRevealButtonClick);
30786
- btn.addEventListener('touchend', host.__boundRevealButtonTouchend);
30815
+ btn.addEventListener('mousedown', host.__boundRevealButtonMouseDown);
30787
30816
  },
30788
30817
  );
30789
30818
  this.addController(this._revealButtonController);
@@ -30798,6 +30827,19 @@ class PasswordField extends TextField {
30798
30827
  }
30799
30828
  }
30800
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
+
30801
30843
  /**
30802
30844
  * Override method inherited from `FocusMixin` to mark field as focused
30803
30845
  * when focus moves to the reveal button using Shift Tab.
@@ -30834,6 +30876,12 @@ class PasswordField extends TextField {
30834
30876
 
30835
30877
  if (!focused) {
30836
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
+ }
30837
30885
  } else {
30838
30886
  const isButtonFocused = this.getRootNode().activeElement === this._revealNode;
30839
30887
  // Remove focus-ring from the field when the reveal button gets focused
@@ -30869,10 +30917,10 @@ class PasswordField extends TextField {
30869
30917
  }
30870
30918
 
30871
30919
  /** @private */
30872
- _onRevealButtonTouchend(e) {
30873
- // Cancel the following click event
30920
+ _onRevealButtonMouseDown(e) {
30921
+ // Cancel the following focusout event
30874
30922
  e.preventDefault();
30875
- this._togglePasswordVisibility();
30923
+
30876
30924
  // Focus the input to avoid problem with password still visible
30877
30925
  // when user clicks the reveal button and then clicks outside.
30878
30926
  this.inputElement.focus();
@@ -30925,7 +30973,7 @@ class PasswordField extends TextField {
30925
30973
 
30926
30974
  customElements.define(PasswordField.is, PasswordField);
30927
30975
 
30928
- 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--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}";
30929
30977
 
30930
30978
  const PasswordInput = class {
30931
30979
  constructor(hostRef) {
@@ -31067,9 +31115,11 @@ const PasswordInput = class {
31067
31115
  }
31068
31116
  }
31069
31117
  setErrorMessage() {
31070
- var _a;
31118
+ var _a, _b, _c, _d;
31071
31119
  if (this.inputReference.validity.patternMismatch) {
31072
- 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;
31073
31123
  }
31074
31124
  if (this.inputReference.validity.tooShort || this.inputReference.validity.tooLong) {
31075
31125
  return translate$2('lengthError', this.language, { values: { minLength: this.validation.minLength, maxLength: this.validation.maxLength } });
@@ -31078,7 +31128,9 @@ const PasswordInput = class {
31078
31128
  return translate$2('requiredError', this.language);
31079
31129
  }
31080
31130
  if (this.isDuplicateInput && this.duplicateInputValue !== this.value) {
31081
- 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;
31082
31134
  }
31083
31135
  }
31084
31136
  renderTooltip() {
@@ -31092,14 +31144,13 @@ const PasswordInput = class {
31092
31144
  const passedRules = this.passwordComplexity.filter(complexity => complexity.passed).length;
31093
31145
  const meterValue = passedRules / totalRules;
31094
31146
  const allRulesPassed = this.passwordComplexity.every(complexity => complexity.passed);
31095
- if (this.showPopup === false)
31096
- return;
31097
- 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) => {
31098
- 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)));
31099
31150
  }))));
31100
31151
  }
31101
31152
  render() {
31102
- let invalidClass;
31153
+ let invalidClass = '';
31103
31154
  if (this.touched) {
31104
31155
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
31105
31156
  }
@@ -35585,8 +35636,10 @@ const SelectInput = class {
35585
35636
  componentWillLoad() {
35586
35637
  if (this.action && !this.options.length) {
35587
35638
  if (this.action.split(" ")[0] == 'GET') {
35588
- return this.getOptions().then((options) => {
35589
- 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 => {
35590
35643
  return { label: option.Name, value: option.Alpha2Code };
35591
35644
  });
35592
35645
  });
@@ -35610,9 +35663,8 @@ const SelectInput = class {
35610
35663
  this.valueHandler({ name: this.name, value: this.value });
35611
35664
  }
35612
35665
  }
35613
- getOptions() {
35614
- // TEMPORARY FOR DEMO PURPOSES UNTIL NORWAY CONFIGURES AN ACTUAL ENDPOINT...
35615
- const url = new URL("https://demo-api.stage.norway.everymatrix.com/v1/player/countries");
35666
+ getOptions(endpoint) {
35667
+ const url = new URL(endpoint);
35616
35668
  return new Promise((resolve, reject) => {
35617
35669
  fetch(url.href)
35618
35670
  .then((res) => res.json())
@@ -35639,7 +35691,7 @@ const SelectInput = class {
35639
35691
  return null;
35640
35692
  }
35641
35693
  render() {
35642
- let invalidClass;
35694
+ let invalidClass = '';
35643
35695
  if (this.touched) {
35644
35696
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
35645
35697
  }
@@ -35779,9 +35831,11 @@ const TelInput = class {
35779
35831
  }
35780
35832
  }
35781
35833
  setErrorMessage() {
35782
- var _a;
35834
+ var _a, _b;
35783
35835
  if (this.inputReference.validity.patternMismatch) {
35784
- 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;
35785
35839
  }
35786
35840
  if (this.inputReference.validity.tooShort || this.inputReference.validity.tooLong) {
35787
35841
  return translate$2('lengthError', this.language, { values: { minLength: this.validation.minLength, maxLength: this.validation.maxLength } });
@@ -35797,7 +35851,7 @@ const TelInput = class {
35797
35851
  return null;
35798
35852
  }
35799
35853
  render() {
35800
- let invalidClass;
35854
+ let invalidClass = '';
35801
35855
  if (this.touched) {
35802
35856
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
35803
35857
  }
@@ -35935,9 +35989,11 @@ const TextInput = class {
35935
35989
  }
35936
35990
  }
35937
35991
  setErrorMessage() {
35938
- var _a;
35992
+ var _a, _b, _c, _d;
35939
35993
  if (this.inputReference.validity.patternMismatch) {
35940
- 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;
35941
35997
  }
35942
35998
  if (this.inputReference.validity.tooShort || this.inputReference.validity.tooLong) {
35943
35999
  return translate$2('lengthError', this.language, { values: { minLength: this.validation.minLength, maxLength: this.validation.maxLength } });
@@ -35946,7 +36002,9 @@ const TextInput = class {
35946
36002
  return translate$2('requiredError', this.language);
35947
36003
  }
35948
36004
  if (this.isDuplicateInput && this.duplicateInputValue !== this.value) {
35949
- 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;
35950
36008
  }
35951
36009
  }
35952
36010
  renderTooltip() {
@@ -35956,7 +36014,7 @@ const TextInput = class {
35956
36014
  return null;
35957
36015
  }
35958
36016
  render() {
35959
- let invalidClass;
36017
+ let invalidClass = '';
35960
36018
  if (this.touched) {
35961
36019
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
35962
36020
  }
@@ -35981,10 +36039,6 @@ const ToggleCheckboxInput = class {
35981
36039
  * Default value for the input.
35982
36040
  */
35983
36041
  this.defaultValue = '';
35984
- /**
35985
- * Options of the input.
35986
- */
35987
- this.options = [];
35988
36042
  /**
35989
36043
  * Client custom styling via inline style
35990
36044
  */
@@ -36052,7 +36106,7 @@ const ToggleCheckboxInput = class {
36052
36106
  render() {
36053
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 &&
36054
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 => {
36055
- 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, isDuplicateInput: subfield.isDuplicateInput, "client-styling": this.clientStyling, tooltip: subfield.tooltip, placeholder: subfield.placeholder == null ? '' : subfield.placeholder });
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 });
36056
36110
  })));
36057
36111
  }
36058
36112
  static get watchers() { return {
@@ -15,5 +15,5 @@ const patchBrowser = () => {
15
15
  };
16
16
 
17
17
  patchBrowser().then(options => {
18
- return index.bootstrapLazy([["checkbox-group-input_13.cjs",[[1,"general-registration",{"endpoint":[513],"language":[513],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"dateFormat":[513,"date-format"],"buttonInsideForm":[516,"button-inside-form"],"errorMessage":[32],"isFormValid":[32],"isLoading":[32],"registrationStep":[32],"forms":[32],"limitStylingAppends":[32]},[[0,"sendValidityState","checkInputsValidityHandler"],[0,"sendInputValue","getInputsValueHandler"]]],[1,"general-input",{"type":[513],"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"action":[513],"validation":[16],"options":[520],"language":[513],"autofilled":[516],"tooltip":[513],"defaultValue":[520,"default-value"],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[520,"client-styling"],"dateFormat":[513,"date-format"]}],[1,"toggle-checkbox-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"options":[520],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32],"showFields":[32]},[[4,"click","handleClickOutside"]]],[1,"checkbox-group-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"options":[520],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32],"selectedValues":[32]},[[4,"click","handleClickOutside"]]],[1,"checkbox-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"date-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"dateFormat":[513,"date-format"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"email-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"],[16,"sendInputValue","valueChangedHandler"]]],[1,"number-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"password-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"isValid":[32],"errorMessage":[32],"limitStylingAppends":[32],"showTooltip":[32],"passwordComplexity":[32],"showPopup":[32]},[[16,"sendInputValue","valueChangedHandler"],[4,"click","handleClickOutside"]]],[1,"radio-input",{"name":[513],"displayName":[513,"display-name"],"optionsGroup":[16],"validation":[16],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"select-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"action":[513],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"options":[16],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"tel-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"showLabels":[516,"show-labels"],"action":[513],"validation":[16],"defaultValue":[520,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"isValid":[32],"errorMessage":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"text-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"checkValidity":[516,"check-validity"],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"isValid":[32],"errorMessage":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"],[16,"sendInputValue","valueChangedHandler"]]]]]], options);
18
+ return index.bootstrapLazy([["checkbox-group-input_13.cjs",[[1,"general-registration",{"endpoint":[513],"language":[513],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"dateFormat":[513,"date-format"],"buttonInsideForm":[516,"button-inside-form"],"errorMessage":[32],"isFormValid":[32],"isLoading":[32],"registrationStep":[32],"forms":[32],"limitStylingAppends":[32]},[[0,"sendValidityState","checkInputsValidityHandler"],[0,"sendInputValue","getInputsValueHandler"]]],[1,"general-input",{"type":[513],"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"action":[513],"validation":[16],"options":[520],"language":[513],"autofilled":[516],"tooltip":[513],"defaultValue":[520,"default-value"],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[520,"client-styling"],"dateFormat":[513,"date-format"]}],[1,"toggle-checkbox-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"options":[16],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32],"showFields":[32]},[[4,"click","handleClickOutside"]]],[1,"checkbox-group-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"options":[16],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32],"selectedValues":[32]},[[4,"click","handleClickOutside"]]],[1,"checkbox-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"date-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"dateFormat":[513,"date-format"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"email-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"],[16,"sendInputValue","valueChangedHandler"]]],[1,"number-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"password-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"isValid":[32],"errorMessage":[32],"limitStylingAppends":[32],"showTooltip":[32],"passwordComplexity":[32],"showPopup":[32]},[[16,"sendInputValue","valueChangedHandler"],[4,"click","handleClickOutside"]]],[1,"radio-input",{"name":[513],"displayName":[513,"display-name"],"optionsGroup":[16],"validation":[16],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"select-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"action":[513],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"options":[16],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"tel-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"showLabels":[516,"show-labels"],"action":[513],"validation":[16],"defaultValue":[520,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"isValid":[32],"errorMessage":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"text-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"checkValidity":[516,"check-validity"],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"isValid":[32],"errorMessage":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"],[16,"sendInputValue","valueChangedHandler"]]]]]], options);
19
19
  });
@@ -14,7 +14,7 @@ const patchEsm = () => {
14
14
  const defineCustomElements = (win, options) => {
15
15
  if (typeof window === 'undefined') return Promise.resolve();
16
16
  return patchEsm().then(() => {
17
- return index.bootstrapLazy([["checkbox-group-input_13.cjs",[[1,"general-registration",{"endpoint":[513],"language":[513],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"dateFormat":[513,"date-format"],"buttonInsideForm":[516,"button-inside-form"],"errorMessage":[32],"isFormValid":[32],"isLoading":[32],"registrationStep":[32],"forms":[32],"limitStylingAppends":[32]},[[0,"sendValidityState","checkInputsValidityHandler"],[0,"sendInputValue","getInputsValueHandler"]]],[1,"general-input",{"type":[513],"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"action":[513],"validation":[16],"options":[520],"language":[513],"autofilled":[516],"tooltip":[513],"defaultValue":[520,"default-value"],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[520,"client-styling"],"dateFormat":[513,"date-format"]}],[1,"toggle-checkbox-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"options":[520],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32],"showFields":[32]},[[4,"click","handleClickOutside"]]],[1,"checkbox-group-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"options":[520],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32],"selectedValues":[32]},[[4,"click","handleClickOutside"]]],[1,"checkbox-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"date-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"dateFormat":[513,"date-format"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"email-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"],[16,"sendInputValue","valueChangedHandler"]]],[1,"number-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"password-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"isValid":[32],"errorMessage":[32],"limitStylingAppends":[32],"showTooltip":[32],"passwordComplexity":[32],"showPopup":[32]},[[16,"sendInputValue","valueChangedHandler"],[4,"click","handleClickOutside"]]],[1,"radio-input",{"name":[513],"displayName":[513,"display-name"],"optionsGroup":[16],"validation":[16],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"select-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"action":[513],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"options":[16],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"tel-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"showLabels":[516,"show-labels"],"action":[513],"validation":[16],"defaultValue":[520,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"isValid":[32],"errorMessage":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"text-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"checkValidity":[516,"check-validity"],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"isValid":[32],"errorMessage":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"],[16,"sendInputValue","valueChangedHandler"]]]]]], options);
17
+ return index.bootstrapLazy([["checkbox-group-input_13.cjs",[[1,"general-registration",{"endpoint":[513],"language":[513],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"dateFormat":[513,"date-format"],"buttonInsideForm":[516,"button-inside-form"],"errorMessage":[32],"isFormValid":[32],"isLoading":[32],"registrationStep":[32],"forms":[32],"limitStylingAppends":[32]},[[0,"sendValidityState","checkInputsValidityHandler"],[0,"sendInputValue","getInputsValueHandler"]]],[1,"general-input",{"type":[513],"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"action":[513],"validation":[16],"options":[520],"language":[513],"autofilled":[516],"tooltip":[513],"defaultValue":[520,"default-value"],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[520,"client-styling"],"dateFormat":[513,"date-format"]}],[1,"toggle-checkbox-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"options":[16],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32],"showFields":[32]},[[4,"click","handleClickOutside"]]],[1,"checkbox-group-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"options":[16],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32],"selectedValues":[32]},[[4,"click","handleClickOutside"]]],[1,"checkbox-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"date-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"dateFormat":[513,"date-format"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"email-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"],[16,"sendInputValue","valueChangedHandler"]]],[1,"number-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"password-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"isValid":[32],"errorMessage":[32],"limitStylingAppends":[32],"showTooltip":[32],"passwordComplexity":[32],"showPopup":[32]},[[16,"sendInputValue","valueChangedHandler"],[4,"click","handleClickOutside"]]],[1,"radio-input",{"name":[513],"displayName":[513,"display-name"],"optionsGroup":[16],"validation":[16],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"select-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"action":[513],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"options":[16],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"tel-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"showLabels":[516,"show-labels"],"action":[513],"validation":[16],"defaultValue":[520,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"isValid":[32],"errorMessage":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"text-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"checkValidity":[516,"check-validity"],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"isValid":[32],"errorMessage":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"],[16,"sendInputValue","valueChangedHandler"]]]]]], options);
18
18
  });
19
19
  };
20
20
 
@@ -76,29 +76,9 @@ export class GeneralRegistration {
76
76
  componentWillLoad() {
77
77
  return this.getRegisterConfig()
78
78
  .then((config) => {
79
- if (this.translationUrl) {
80
- getTranslations(this.translationUrl).then(() => {
81
- config.content.fields.forEach(field => {
82
- if (TRANSLATIONS[this.language][field.name]) {
83
- Object.keys(TRANSLATIONS[this.language][field.name]).forEach((key) => {
84
- field[key] = TRANSLATIONS[this.language][field.name][key];
85
- });
86
- }
87
- return field;
88
- });
89
- })
90
- .catch((error) => {
91
- console.error('Failed to fetch translations:', error);
92
- }).finally(() => {
93
- this.formatConfig(config);
94
- this.stepsStateMachine({ event: 'set', type: 'inputs' });
95
- });
96
- }
97
- else {
98
- this.formatConfig(config);
99
- this.isFormValid = !this.getInvalidStatus(this.listOfInputValidity);
100
- this.stepsStateMachine({ event: 'set', type: 'inputs' });
101
- }
79
+ this.formatConfig(config);
80
+ this.isFormValid = !this.getInvalidStatus(this.listOfInputValidity);
81
+ this.stepsStateMachine({ event: 'set', type: 'inputs' });
102
82
  });
103
83
  }
104
84
  componentDidLoad() {
@@ -298,10 +278,7 @@ export class GeneralRegistration {
298
278
  })
299
279
  .then((data) => {
300
280
  this.isLoading = false;
301
- if (data.userId) {
302
- alert(`User registered - the user ID is ${data.userId}`);
303
- }
304
- window.postMessage({ type: 'registrationSuccessful' }, window.location.href);
281
+ window.postMessage({ type: 'registrationSuccessful', userId: data === null || data === void 0 ? void 0 : data.userId }, window.location.href);
305
282
  })
306
283
  .catch((err) => {
307
284
  this.isLoading = false;
@@ -378,7 +355,32 @@ export class GeneralRegistration {
378
355
  this.lastStep = this.registrationStep;
379
356
  }
380
357
  ;
381
- this.forms = [...this.forms, { [this.registrationStep]: this.listOfInputs }];
358
+ // The translations for fields happens here.
359
+ if (this.translationUrl) {
360
+ getTranslations(this.translationUrl).then(() => {
361
+ this.listOfInputs.forEach(field => {
362
+ var _a, _b;
363
+ this.addTranslation(field);
364
+ // Logic for fields types that have subfields
365
+ if (((_a = field.inputType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'togglecheckbox') {
366
+ field.data.subFields.forEach(subField => this.addTranslation(subField));
367
+ }
368
+ if (((_b = field.inputType) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'checkboxgroup') {
369
+ this.addTranslation(field);
370
+ field.data.subFields.forEach(subField => this.addTranslation(subField));
371
+ }
372
+ return field;
373
+ });
374
+ })
375
+ .catch((error) => {
376
+ console.error('Failed to fetch translations:', error);
377
+ }).finally(() => {
378
+ this.forms = [...this.forms, { [this.registrationStep]: this.listOfInputs }];
379
+ });
380
+ }
381
+ else {
382
+ this.forms = [...this.forms, { [this.registrationStep]: this.listOfInputs }];
383
+ }
382
384
  // Add the step to the registrationStepsData
383
385
  this.registrationStepsState.regId = this.registrationID;
384
386
  if (!this.registrationStepsState[this.registrationStep]) {
@@ -390,6 +392,13 @@ export class GeneralRegistration {
390
392
  };
391
393
  }
392
394
  }
395
+ addTranslation(field) {
396
+ if (TRANSLATIONS[this.language][field.name]) {
397
+ Object.keys(TRANSLATIONS[this.language][field.name]).forEach((key) => {
398
+ field[key] = TRANSLATIONS[this.language][field.name][key];
399
+ });
400
+ }
401
+ }
393
402
  setInitialValidStatus(field) {
394
403
  var _a, _b;
395
404
  // Input type checkbox, with no validation are valid