@everymatrix/general-player-forgot-password-form 1.0.2 → 1.0.3
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
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
export let imagedesktop:string = '';
|
|
12
12
|
export let captchakey:string = '';
|
|
13
13
|
export let lang:string = '';
|
|
14
|
+
export let simplepasswordvalidation:string = 'false';
|
|
14
15
|
|
|
15
16
|
let isLoading:boolean = false;
|
|
16
17
|
let forgotPasswordScreen:boolean = true;
|
|
@@ -195,7 +196,11 @@
|
|
|
195
196
|
}
|
|
196
197
|
|
|
197
198
|
const checkUserPassword = (password:string) => {
|
|
198
|
-
if(
|
|
199
|
+
if (simplepasswordvalidation == 'true') {
|
|
200
|
+
regexValidators.password = /^(?!.* ).{8,20}$/;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (regexValidators.password.test(password)) {
|
|
199
204
|
return true;
|
|
200
205
|
} else {
|
|
201
206
|
return false;
|
|
@@ -203,9 +208,10 @@
|
|
|
203
208
|
}
|
|
204
209
|
|
|
205
210
|
const validatePassword = (invalid, password, elem) => {
|
|
206
|
-
if (elem.id === "
|
|
211
|
+
if (elem.id === "new-password") {
|
|
207
212
|
invalidNewPassword = !checkUserPassword(password);
|
|
208
|
-
|
|
213
|
+
|
|
214
|
+
if (userConfirmPassword) {
|
|
209
215
|
invalidConfirmPassword = (userNewPassword === userConfirmPassword) ? !checkUserPassword(password) : true;
|
|
210
216
|
}
|
|
211
217
|
} else {
|
|
@@ -281,14 +287,18 @@
|
|
|
281
287
|
<form class="FormContent" part="FormContent">
|
|
282
288
|
<div class="NewPassword" part="NewPassword">
|
|
283
289
|
<label for="NewPassword">{$_('forgotPasswordForm.forgotNewPasswordPassword')}:<span class="FormRequired" part="FormRequired">*</span></label>
|
|
284
|
-
<input type="password" bind:value={userNewPassword} on:
|
|
290
|
+
<input type="password" bind:value={userNewPassword} on:keyup={validatePassword(invalidNewPassword, userNewPassword, newPasswordVisibilityToggle)} id="new-password" autocomplete="new-password" bind:this={newPasswordVisibilityToggle} />
|
|
285
291
|
{#if isNewPasswordVisible}
|
|
286
292
|
<svg on:click={() => togglePassword('userNewPassword')} class="TogglePasswordVisibility {invalidNewPassword ? 'InvalidToggle' : ''}" xmlns="http://www.w3.org/2000/svg" width="18.844" height="12.887" viewBox="0 0 18.844 12.887"><defs><style>.a{fill:var(--emfe-w-color-white, #FFFFFF);}</style></defs><g transform="translate(-110.856 -23.242)"><circle class="a" cx="0.05" cy="0.05" r="0.05" transform="translate(121.017 31.148)"/><g transform="translate(117.499 27.37)"><path class="a" d="M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z" transform="translate(-142.164 -39.123)"/><path class="a" d="M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z" transform="translate(-136.413 -42.068)"/></g><g transform="translate(110.856 24.899)"><path class="a" d="M122.538,42.061a7.043,7.043,0,0,1-2.325.53,10.373,10.373,0,0,1-4.393-1.482,36.509,36.509,0,0,1-3.873-2.391.13.13,0,0,1,0-.208,44.141,44.141,0,0,1,3.873-2.651c.394-.233.768-.437,1.13-.622l-.686-.838c-.322.167-.651.347-.99.55a37.989,37.989,0,0,0-3.977,2.729,1.21,1.21,0,0,0-.442.962,1.1,1.1,0,0,0,.494.936,34.416,34.416,0,0,0,3.977,2.469,11.468,11.468,0,0,0,4.886,1.611,8.427,8.427,0,0,0,3.039-.725Z" transform="translate(-110.856 -33.157)"/><path class="a" d="M149.119,34.14a45.875,45.875,0,0,0-4.055-2.729,20.541,20.541,0,0,0-2.547-1.248,5.6,5.6,0,0,0-4.79-.017l.7.856a5.254,5.254,0,0,1,1.672-.346,10.072,10.072,0,0,1,4.445,1.663,34.132,34.132,0,0,1,3.925,2.651.13.13,0,0,1,0,.208,40.2,40.2,0,0,1-3.925,2.391c-.179.092-.352.176-.525.26l.684.835c.1-.054.2-.1.309-.159a36.356,36.356,0,0,0,4.055-2.469,1.067,1.067,0,0,0,.52-.936A1.159,1.159,0,0,0,149.119,34.14Z" transform="translate(-130.743 -29.617)"/></g><rect class="a" width="0.972" height="15.861" rx="0.486" transform="translate(114.827 23.858) rotate(-39.315)"/></g></svg>
|
|
287
293
|
{:else}
|
|
288
294
|
<svg on:click={() => togglePassword('userNewPassword')} class="TogglePasswordVisibility {invalidNewPassword ? 'InvalidToggle' : ''}" xmlns="http://www.w3.org/2000/svg" width="18.843" height="10.5" viewBox="0 0 18.843 10.5"><defs><style>.a{fill:var(--emfe-w-color-white, #FFFFFF);}</style></defs><g transform="translate(-14.185 -27.832)"><path class="a" d="M23.541,38.332a11.467,11.467,0,0,1-4.886-1.611,34.413,34.413,0,0,1-3.976-2.469,1.1,1.1,0,0,1-.494-.936,1.21,1.21,0,0,1,.442-.962A37.986,37.986,0,0,1,18.6,29.625a16.06,16.06,0,0,1,2.521-1.248,6.862,6.862,0,0,1,2.417-.546,6.862,6.862,0,0,1,2.417.546,20.541,20.541,0,0,1,2.547,1.248,45.872,45.872,0,0,1,4.054,2.729,1.159,1.159,0,0,1,.468.962,1.067,1.067,0,0,1-.52.936,36.353,36.353,0,0,1-4.054,2.469A11.2,11.2,0,0,1,23.541,38.332Zm0-9.46a9.813,9.813,0,0,0-4.392,1.663,44.138,44.138,0,0,0-3.873,2.651.13.13,0,0,0,0,.208,36.5,36.5,0,0,0,3.873,2.391,10.372,10.372,0,0,0,4.392,1.481,11.051,11.051,0,0,0,4.444-1.481,40.2,40.2,0,0,0,3.925-2.391.13.13,0,0,0,0-.208h0a34.132,34.132,0,0,0-3.925-2.651A10.072,10.072,0,0,0,23.541,28.872Z" transform="translate(0)"/><circle class="a" cx="2.779" cy="2.779" r="2.779" transform="translate(20.827 30.303)"/></g></svg>
|
|
289
295
|
{/if}
|
|
290
296
|
{#if invalidNewPassword}
|
|
291
|
-
|
|
297
|
+
{#if simplepasswordvalidation == 'true'}
|
|
298
|
+
<p class="InvalidInput" part="InvalidInput">{$_('forgotPasswordForm.simplePasswordError')}</p>
|
|
299
|
+
{:else}
|
|
300
|
+
<p class="InvalidInput" part="InvalidInput">{$_('forgotPasswordForm.forgotNewPasswordPasswordError')}</p>
|
|
301
|
+
{/if}
|
|
292
302
|
{/if}
|
|
293
303
|
</div>
|
|
294
304
|
<div class="ConfirmPassword" part="ConfirmPassword">
|
package/src/translations.js
CHANGED
|
@@ -17,7 +17,8 @@ export const ForgotPasswordTranslations = {
|
|
|
17
17
|
forgotNewPasswordButton: 'Change Password',
|
|
18
18
|
forgotChangePasswordTitle: 'Success!',
|
|
19
19
|
forgotChangePasswordDescription: 'Your password has been changed successfully.',
|
|
20
|
-
forgotChangePasswordLogin: 'Click here to Login'
|
|
20
|
+
forgotChangePasswordLogin: 'Click here to Login',
|
|
21
|
+
simplePasswordError: 'Password must be 8-20 characters long.',
|
|
21
22
|
}
|
|
22
23
|
},
|
|
23
24
|
zh: {
|
|
@@ -38,7 +39,8 @@ export const ForgotPasswordTranslations = {
|
|
|
38
39
|
forgotNewPasswordButton: '更改密碼',
|
|
39
40
|
forgotChangePasswordTitle: '成功!',
|
|
40
41
|
forgotChangePasswordDescription: '你已經成功更改密碼。',
|
|
41
|
-
forgotChangePasswordLogin: '點擊此處登錄'
|
|
42
|
+
forgotChangePasswordLogin: '點擊此處登錄',
|
|
43
|
+
simplePasswordError: '密码长度必须为 8-20 个字符。',
|
|
42
44
|
}
|
|
43
45
|
},
|
|
44
46
|
fr: {
|
|
@@ -59,7 +61,8 @@ export const ForgotPasswordTranslations = {
|
|
|
59
61
|
forgotNewPasswordButton: 'Modifier le mot de passe',
|
|
60
62
|
forgotChangePasswordTitle: 'Succès!',
|
|
61
63
|
forgotChangePasswordDescription: 'Votre mot de passe a été modifié avec succès.',
|
|
62
|
-
forgotChangePasswordLogin: 'Cliquez ici pour vous connecter'
|
|
64
|
+
forgotChangePasswordLogin: 'Cliquez ici pour vous connecter',
|
|
65
|
+
simplePasswordError: 'Le mot de passe doit comporter entre 8 et 20 caractères.',
|
|
63
66
|
}
|
|
64
67
|
},
|
|
65
68
|
tr: {
|
|
@@ -80,7 +83,8 @@ export const ForgotPasswordTranslations = {
|
|
|
80
83
|
forgotNewPasswordButton: 'Şifre değiştir',
|
|
81
84
|
forgotChangePasswordTitle: 'Başarı!',
|
|
82
85
|
forgotChangePasswordDescription: 'Şifreniz başarıyla değiştirildi.',
|
|
83
|
-
forgotChangePasswordLogin: 'Giriş yapmak için tıklayınız'
|
|
86
|
+
forgotChangePasswordLogin: 'Giriş yapmak için tıklayınız',
|
|
87
|
+
simplePasswordError: 'Parola trebuie să aibă 8-20 de caractere.',
|
|
84
88
|
}
|
|
85
89
|
},
|
|
86
90
|
ro: {
|
|
@@ -101,7 +105,8 @@ export const ForgotPasswordTranslations = {
|
|
|
101
105
|
forgotNewPasswordButton: 'Schimba parola',
|
|
102
106
|
forgotChangePasswordTitle: 'Succes!',
|
|
103
107
|
forgotChangePasswordDescription: 'Parola a fost schimbata cu succes.',
|
|
104
|
-
forgotChangePasswordLogin: 'Autentificare'
|
|
108
|
+
forgotChangePasswordLogin: 'Autentificare',
|
|
109
|
+
simplePasswordError: 'Parola trebuie să aibă 8-20 de caractere.',
|
|
105
110
|
}
|
|
106
111
|
},
|
|
107
112
|
es: {
|
|
@@ -122,7 +127,8 @@ export const ForgotPasswordTranslations = {
|
|
|
122
127
|
forgotNewPasswordButton: 'Cambiar la contraseña',
|
|
123
128
|
forgotChangePasswordTitle: '¡Éxito!',
|
|
124
129
|
forgotChangePasswordDescription: 'Su contraseña ha sido cambiada con éxito.',
|
|
125
|
-
forgotChangePasswordLogin: 'Haga clic aquí para ingresar'
|
|
130
|
+
forgotChangePasswordLogin: 'Haga clic aquí para ingresar',
|
|
131
|
+
simplePasswordError: 'La contraseña debe tener entre 8 y 20 caracteres.',
|
|
126
132
|
}
|
|
127
133
|
},
|
|
128
134
|
pt: {
|
|
@@ -143,7 +149,8 @@ export const ForgotPasswordTranslations = {
|
|
|
143
149
|
forgotNewPasswordButton: 'Mudar senha',
|
|
144
150
|
forgotChangePasswordTitle: 'Sucesso!',
|
|
145
151
|
forgotChangePasswordDescription: 'Sua senha foi alterada com sucesso.',
|
|
146
|
-
forgotChangePasswordLogin: 'Clique aqui para entrar'
|
|
152
|
+
forgotChangePasswordLogin: 'Clique aqui para entrar',
|
|
153
|
+
simplePasswordError: 'A senha deve ter de 8 a 20 caracteres.',
|
|
147
154
|
}
|
|
148
155
|
},
|
|
149
156
|
};
|