@everymatrix/general-player-register-form-step1 1.11.1 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/general-player-register-form-step1",
3
- "version": "1.11.1",
3
+ "version": "1.12.0",
4
4
  "main": "dist/general-player-register-form-step1.js",
5
5
  "svelte": "src/index.ts",
6
6
  "scripts": {
@@ -35,5 +35,5 @@
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
- "gitHead": "a74cb23abc28e2a5ca4a61858da32c86640ebd43"
38
+ "gitHead": "5ba32db088ec6ebf8eb6110b6172d8c9409b9f70"
39
39
  }
@@ -14,6 +14,7 @@
14
14
  export let clientstylingurl:string = '';
15
15
  export let translationurl:string = '';
16
16
  export let savecredentials:string = '';
17
+ export let tempopcustomization:string = 'false';
17
18
 
18
19
  let invalidEmail:boolean = false;
19
20
  let invalidName:boolean = false;
@@ -52,7 +53,8 @@
52
53
  let regexValidators:any = {
53
54
  user: /^(?!(?:.*\d){9})(?=(?:.*[a-zA-Z]){4})^[a-zA-Z\d]*$/,
54
55
  email: /^[^<>()*{}=/|?`~[\]\\,;:\%#^\s@\"$&!@]+@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z0-9]+\.)+[a-zA-Z]{2,}))$/i,
55
- password: /^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[^\w\s]).{8,20}$/
56
+ password: /^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[^\w\s]).{8,20}$/,
57
+ document: /^[A-Za-z0-9 _]*[A-Za-z0-9][A-Za-z0-9 _]*$/
56
58
  }
57
59
 
58
60
  // setupI18n({ withLocale: 'en', translations: {}});
@@ -180,8 +182,19 @@
180
182
  }
181
183
 
182
184
  const checkSecurityQuestion = ():boolean => {
183
- if (securityQuestion && securityQuestion.length <= 120) {
184
- return true;
185
+ if (securityQuestion)
186
+ switch(tempopcustomization) {
187
+ case 'true':
188
+ if (regexValidators.document.test(securityQuestion) && securityQuestion.length <= 50) {
189
+ return true;
190
+ }
191
+ break;
192
+
193
+ case 'false':
194
+ if (securityQuestion && securityQuestion.length <= 120) {
195
+ return true;
196
+ }
197
+ break;
185
198
  }
186
199
 
187
200
  return false;
@@ -193,8 +206,19 @@
193
206
  }
194
207
 
195
208
  const checkSecurityAnswer = ():boolean => {
196
- if (securityAnswer && securityAnswer.length <= 120) {
197
- return true;
209
+ if (securityAnswer)
210
+ switch(tempopcustomization) {
211
+ case 'true':
212
+ if (regexValidators.document.test(securityAnswer) && securityAnswer.length <= 50) {
213
+ return true;
214
+ }
215
+ break;
216
+
217
+ case 'false':
218
+ if (securityAnswer && securityAnswer.length <= 120) {
219
+ return true;
220
+ }
221
+ break;
198
222
  }
199
223
 
200
224
  return false;
@@ -359,17 +383,17 @@
359
383
  {/if}
360
384
  </div>
361
385
  <div class="SecurityQuestionContainer {invalidSecurityQuestion && !securityQFocus? 'InvalidField' : ''}{disabledFieldsList?.indexOf('securityQuestion') >= 0 ? 'Hidden' : ''}" part="SecurityQuestionContainer {invalidSecurityQuestion ? 'InvalidField' : ''}">
362
- <label for="SecurityQuestion">{$_('registerFormStep1.registerSecurityQuestion')}:<span class="FormRequired" part="FormRequired">*</span></label>
386
+ <label for="SecurityQuestion">{tempopcustomization == 'true' ? $_('registerFormStep1.registerSecurityQuestion2') : $_('registerFormStep1.registerSecurityQuestion')}:<span class="FormRequired" part="FormRequired">*</span></label>
363
387
  <input bind:value={securityQuestion} on:keyup={validateSecurityQuestion} on:focus={() => securityQFocus = true} on:blur={() => securityQFocus = false} type="text" id="SecurityQuestion" />
364
388
  {#if invalidSecurityQuestion}
365
- <p class="InvalidInput" part="InvalidInput">{$_('registerFormStep1.registerSecurityQuestionError')}</p>
389
+ <p class="InvalidInput" part="InvalidInput">{tempopcustomization == 'true' ? $_('registerFormStep1.registerSecurityQuestionError2') : $_('registerFormStep1.registerSecurityQuestionError')}</p>
366
390
  {/if}
367
391
  </div>
368
392
  <div class="SecurityAnswerContainer {invalidSecurityAnswer && !securityAFocus? 'InvalidField' : ''}{disabledFieldsList?.indexOf('securityAnswer') >= 0 ? 'Hidden' : ''}" part="SecurityAnswerContainer {invalidSecurityAnswer ? 'InvalidField' : ''}">
369
- <label for="SecurityAnswer">{$_('registerFormStep1.registerSecurityAnswer')}:<span class="FormRequired" part="FormRequired">*</span></label>
393
+ <label for="SecurityAnswer">{tempopcustomization == 'true' ? $_('registerFormStep1.registerSecurityAnswer2') : $_('registerFormStep1.registerSecurityAnswer')}:<span class="FormRequired" part="FormRequired">*</span></label>
370
394
  <input bind:value={securityAnswer} on:keyup={validateSecurityAnswer} on:focus={() => securityAFocus = true} on:blur={() => securityAFocus = false} type="text" id="SecurityAnswer" />
371
395
  {#if invalidSecurityAnswer}
372
- <p class="InvalidInput" part="InvalidInput">{$_('registerFormStep1.registerSecurityAnswerError')}</p>
396
+ <p class="InvalidInput" part="InvalidInput">{tempopcustomization == 'true' ? $_('registerFormStep1.registerSecurityAnswerError2') : $_('registerFormStep1.registerSecurityAnswerError')}</p>
373
397
  {/if}
374
398
  </div>
375
399
  <button class="RegisterStepNext" part="RegisterStepNext" disabled={!isValid} on:click={(e) => goNext(e)}>{$_('registerFormStep1.registerNext')}</button>
@@ -14,9 +14,13 @@ export const RegisterFormStep1Translations = {
14
14
  registerConfirmPassword: 'Confirm Password',
15
15
  registerConfirmPasswordError: 'It doesn\'t match the password.',
16
16
  registerSecurityQuestion: 'Security Question',
17
+ registerSecurityQuestion2: 'Document Type (DNI, Foreign ID Card, Passport)',
17
18
  registerSecurityQuestionError: 'Security question must be at least 1 character long and maximum 120 characters.',
19
+ registerSecurityQuestionError2: 'Only letters and numbers are accepted.',
18
20
  registerSecurityAnswer: 'Security Answer',
21
+ registerSecurityAnswer2: 'Document Number',
19
22
  registerSecurityAnswerError: 'Security answer must be at least 1 character long and maximum 120 characters.',
23
+ registerSecurityAnswerError2: 'Only letters and numbers are accepted.',
20
24
  registerNext: 'Next'
21
25
  }
22
26
  },
@@ -119,9 +123,13 @@ export const RegisterFormStep1Translations = {
119
123
  registerConfirmPassword: 'Confirmar Contraseña',
120
124
  registerConfirmPasswordError: 'La contraseña no coincide.',
121
125
  registerSecurityQuestion: 'Pregunta de seguridad',
126
+ registerSecurityQuestion2: 'Tipo de Documento (DNI, CE o Pasaporte)',
122
127
  registerSecurityQuestionError: 'La Pregunta de seguridad debe tener un mínimo de 1 carácter y un máximo de 120 caracteres',
128
+ registerSecurityQuestionError2: 'Solo se aceptan letras y números.',
123
129
  registerSecurityAnswer: 'Respuesta de seguridad',
130
+ registerSecurityAnswer2: 'Número de Documento',
124
131
  registerSecurityAnswerError: 'La Respuesta de seguridad debe tener un mínimo de 1 carácter y un máximo de 120 caracteres',
132
+ registerSecurityAnswerError2: 'Solo se aceptan letras y números.',
125
133
  registerNext: 'Siguiente'
126
134
  }
127
135
  },