@everymatrix/player-profile-info 0.0.214 → 0.0.215
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/player-profile-info",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.215",
|
|
4
4
|
"main": "dist/player-profile-info.js",
|
|
5
5
|
"svelte": "src/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "9c9f7a9e6a715010e0746e271e930d92e64e16d2"
|
|
40
40
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<svelte:options tag={null} />
|
|
2
2
|
|
|
3
|
-
<script lang="
|
|
3
|
+
<script lang="ts">
|
|
4
4
|
import { onMount } from 'svelte';
|
|
5
5
|
import { getDevice } from 'rvhelper';
|
|
6
6
|
import { _, addNewMessages, setLocale } from './i18n';
|
|
@@ -26,9 +26,13 @@
|
|
|
26
26
|
let prefixesArray:Array<Object> = [];
|
|
27
27
|
let countriesArray:Array<Object> = []
|
|
28
28
|
|
|
29
|
+
|
|
29
30
|
let invalidCity:string = '';
|
|
30
31
|
let invalidPostalCode:string = '';
|
|
31
32
|
let invalidAddress:string = '';
|
|
33
|
+
let invalidSecurityQuestion:Boolean = false;
|
|
34
|
+
let invalidSecurityAnswer:Boolean = false;
|
|
35
|
+
let invalidMobile:string = '';
|
|
32
36
|
|
|
33
37
|
let showConfirmSave:boolean = false;
|
|
34
38
|
|
|
@@ -163,7 +167,7 @@
|
|
|
163
167
|
let isValid:Boolean = false;
|
|
164
168
|
|
|
165
169
|
const checkIsValid = () => {
|
|
166
|
-
if (
|
|
170
|
+
if (invalidSecurityQuestion || invalidSecurityAnswer || invalidCity || invalidAddress || invalidPostalCode || invalidMobile) {
|
|
167
171
|
isValid = false;
|
|
168
172
|
}
|
|
169
173
|
else {
|
|
@@ -171,6 +175,45 @@
|
|
|
171
175
|
}
|
|
172
176
|
}
|
|
173
177
|
|
|
178
|
+
const checkMobile = () => {
|
|
179
|
+
if(playerMobileNumber && playerMobileNumber.length >= 5 && playerMobileNumber.length <= 30) {
|
|
180
|
+
return true;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const validateMobile = () => {
|
|
187
|
+
invalidMobile = !checkMobile();
|
|
188
|
+
checkIsValid();
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const checkSecurityQuestion = () => {
|
|
192
|
+
if (playerQuestion && playerQuestion.length <= 120) {
|
|
193
|
+
return true;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return false;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const validateSecurityQuestion = () => {
|
|
200
|
+
invalidSecurityQuestion = !checkSecurityQuestion();
|
|
201
|
+
checkIsValid();
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
const checkSecurityAnswer = () => {
|
|
205
|
+
if (playerAnswer && playerAnswer.length <= 120) {
|
|
206
|
+
return true;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
return false;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
const validateSecurityAnswer = () => {
|
|
213
|
+
invalidSecurityAnswer = !checkSecurityAnswer();
|
|
214
|
+
checkIsValid();
|
|
215
|
+
}
|
|
216
|
+
|
|
174
217
|
const checkCity = () => {
|
|
175
218
|
if(playerCity.value && playerCity.value.length <= 50) {
|
|
176
219
|
return true;
|
|
@@ -304,7 +347,7 @@
|
|
|
304
347
|
<label>{$_('playerProfile.userName')}</label>
|
|
305
348
|
<input type="text" class="FieldDisabled" value={username} readonly />
|
|
306
349
|
</div>
|
|
307
|
-
<div class="PlayerInfoBox">
|
|
350
|
+
<div class="PlayerInfoBox {invalidMobile ? 'InvalidField' : ''}">
|
|
308
351
|
<label>{$_('playerProfile.userPhone')}</label>
|
|
309
352
|
<div class="PlayerPhoneNumber">
|
|
310
353
|
<select bind:value={playerPrefix} on:change={() => checkForChanges()}>
|
|
@@ -316,41 +359,50 @@
|
|
|
316
359
|
{/if}
|
|
317
360
|
{/each}
|
|
318
361
|
</select>
|
|
319
|
-
<input bind:value={playerMobileNumber} type="text" oninput="this.value = this.value.replace(/[^0-9.]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');" placeholder={noPlayerData ? mobile.number : ''} on:keyup={() => checkForChanges()}/>
|
|
362
|
+
<input bind:value={playerMobileNumber} on:keyup={validateMobile} type="text" oninput="this.value = this.value.replace(/[^0-9.]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');" placeholder={noPlayerData ? mobile.number : ''} on:keyup={() => checkForChanges()}/>
|
|
320
363
|
</div>
|
|
364
|
+
{#if invalidMobile}
|
|
365
|
+
<p class="InvalidInput">{$_('playerProfile.userPhoneError')}</p>
|
|
366
|
+
{/if}
|
|
367
|
+
</div>
|
|
368
|
+
<div class="PlayerInfoBox {invalidSecurityQuestion ? 'InvalidField' : ''}">
|
|
369
|
+
<label>{$_('playerProfile.securityQuestion')}</label>
|
|
370
|
+
<input type="text" bind:value={playerQuestion} on:keyup={() => checkForChanges()} on:blur={validateSecurityQuestion} placeholder={noPlayerData ? securityQuestion : ''} />
|
|
371
|
+
{#if invalidSecurityQuestion}
|
|
372
|
+
<p class="InvalidInput">{$_('playerProfile.securityQuestionError')}</p>
|
|
373
|
+
{/if}
|
|
374
|
+
</div>
|
|
375
|
+
<div class="PlayerInfoBox {invalidSecurityAnswer ? 'InvalidField' : ''}">
|
|
376
|
+
<label>{$_('playerProfile.securityAnswer')}</label>
|
|
377
|
+
<input type="text" bind:value={playerAnswer} on:keyup={() => checkForChanges()} on:blur={validateSecurityAnswer} placeholder={noPlayerData ? securityAnswer : ''} />
|
|
378
|
+
{#if invalidSecurityAnswer}
|
|
379
|
+
<p class="InvalidInput">{$_('playerProfile.securityAnswerError')}</p>
|
|
380
|
+
{/if}
|
|
321
381
|
</div>
|
|
322
382
|
<div class="PlayerInfoBox">
|
|
323
383
|
<label>{$_('playerProfile.userEmail')}</label>
|
|
324
384
|
<input type="email" class="FieldDisabled" value={email} readonly />
|
|
325
385
|
</div>
|
|
326
386
|
<div class="PlayerInfoBox">
|
|
327
|
-
<label>{$_('playerProfile.
|
|
328
|
-
<input type="text"
|
|
387
|
+
<label>{$_('playerProfile.dateOfBirth')}</label>
|
|
388
|
+
<input type="text" class="FieldDisabled" value={birth} readonly />
|
|
329
389
|
</div>
|
|
330
390
|
<div class="PlayerInfoBox">
|
|
331
391
|
<label>{$_('playerProfile.firstName')}</label>
|
|
332
392
|
<input type="text" class="FieldDisabled" value={firstname} readonly />
|
|
333
393
|
</div>
|
|
334
|
-
<div class="PlayerInfoBox">
|
|
335
|
-
<label>{$_('playerProfile.securityAnswer')}</label>
|
|
336
|
-
<input type="text" bind:value={playerAnswer} on:keyup={() => checkForChanges()} placeholder={noPlayerData ? securityAnswer : ''} />
|
|
337
|
-
</div>
|
|
338
394
|
<div class="PlayerInfoBox">
|
|
339
395
|
<label>{$_('playerProfile.lastName')}</label>
|
|
340
396
|
<input type="text" class="FieldDisabled" value={lastname} readonly />
|
|
341
397
|
</div>
|
|
342
398
|
<div class="PlayerInfoBox">
|
|
343
|
-
<label>{$_('playerProfile.
|
|
344
|
-
|
|
399
|
+
<label>{$_('playerProfile.userTitle')}</label>
|
|
400
|
+
<input type="text" class="FieldDisabled" value={userTitles} readonly />
|
|
345
401
|
</div>
|
|
346
402
|
<div class="PlayerInfoBox">
|
|
347
403
|
<label>{$_('playerProfile.currency')}</label>
|
|
348
404
|
<input type="text" class="FieldDisabled" value={currency} readonly />
|
|
349
405
|
</div>
|
|
350
|
-
<div class="PlayerInfoBox">
|
|
351
|
-
<label>{$_('playerProfile.userTitle')}</label>
|
|
352
|
-
<input type="text" class="FieldDisabled" value={userTitles} readonly />
|
|
353
|
-
</div>
|
|
354
406
|
</section>
|
|
355
407
|
|
|
356
408
|
<div class="PlayerLocationHeader">
|
|
@@ -365,21 +417,21 @@
|
|
|
365
417
|
<label>{$_('playerProfile.userCity')}</label>
|
|
366
418
|
<input bind:this={playerCity} type="text" on:blur={validateCity} on:keyup={() => checkForChanges()} placeholder={noPlayerData ? city : ''} value={noPlayerData ? '' : initialValuesArray.city} />
|
|
367
419
|
{#if invalidCity}
|
|
368
|
-
<p class="InvalidInput">
|
|
420
|
+
<p class="InvalidInput">{$_('playerProfile.userCityError')}</p>
|
|
369
421
|
{/if}
|
|
370
422
|
</div>
|
|
371
423
|
<div class="PlayerInfoBox {invalidAddress ? 'InvalidField' : ''}">
|
|
372
424
|
<label>{$_('playerProfile.userAddress')}</label>
|
|
373
425
|
<input bind:this={playerAddress} placeholder={address1} type="text" on:blur={validateAddress} on:keyup={() => checkForChanges()} value={noPlayerData ? '' : initialValuesArray.address} />
|
|
374
426
|
{#if invalidAddress}
|
|
375
|
-
<p class="InvalidInput">
|
|
427
|
+
<p class="InvalidInput">{$_('playerProfile.userAddressError')}</p>
|
|
376
428
|
{/if}
|
|
377
429
|
</div>
|
|
378
430
|
<div class="PlayerInfoBox {invalidPostalCode ? 'InvalidField' : ''}">
|
|
379
431
|
<label>{$_('playerProfile.userPostalCode')}</label>
|
|
380
432
|
<input bind:this={playerPostalCode} type="number" on:blur={validatePostalCode} on:keyup={() => checkForChanges()} placeholder={noPlayerData ? postalCode : ''} value={noPlayerData ? '' : initialValuesArray.postalCode} />
|
|
381
433
|
{#if invalidPostalCode}
|
|
382
|
-
<p class="InvalidInput">
|
|
434
|
+
<p class="InvalidInput">{$_('playerProfile.userPostalCodeError')}</p>
|
|
383
435
|
{/if}
|
|
384
436
|
</div>
|
|
385
437
|
</section>
|
package/src/translations.js
CHANGED
|
@@ -5,10 +5,13 @@ export const PlayerProfileTranslations = {
|
|
|
5
5
|
personalDetails: `Personal Details`,
|
|
6
6
|
userName: `User name:`,
|
|
7
7
|
userPhone: `Phone:`,
|
|
8
|
+
userPhoneError: 'Mobile must be at least 5 character long and 20 characters maximum.',
|
|
8
9
|
userEmail: `Email:`,
|
|
9
10
|
securityQuestion: `Security Question:`,
|
|
11
|
+
securityQuestionError: 'Security question must be at least 1 character long and maximum 120 characters.',
|
|
10
12
|
firstName: `First name:`,
|
|
11
13
|
securityAnswer: `Security Answer:`,
|
|
14
|
+
securityAnswerError: 'Security answer must be at least 1 character long and maximum 120 characters.',
|
|
12
15
|
lastName: `Last Name:`,
|
|
13
16
|
dateOfBirth: `Date of birth:`,
|
|
14
17
|
currency: `Currency:`,
|
|
@@ -16,8 +19,11 @@ export const PlayerProfileTranslations = {
|
|
|
16
19
|
locationDetails: `Location Details`,
|
|
17
20
|
userCountry: `Country:`,
|
|
18
21
|
userCity: `City:`,
|
|
22
|
+
userCityError: 'City must be at least 1 character long and 50 characters maximum.',
|
|
19
23
|
userAddress: `Address:`,
|
|
24
|
+
userAddressError: 'Address must be at least 1 character long and 100 characters maximum.',
|
|
20
25
|
userPostalCode: `Postal Code:`,
|
|
26
|
+
userPostalCodeError: 'Postal Code must be at least 1 character long and 20 characters maximum.',
|
|
21
27
|
userNotifications: `Notifications`,
|
|
22
28
|
userSMSNotification: `Enable SMS notifications`,
|
|
23
29
|
userEmailNotification: `Enable Emails`,
|
|
@@ -31,24 +37,62 @@ export const PlayerProfileTranslations = {
|
|
|
31
37
|
personalDetails: `Detalii Personale`,
|
|
32
38
|
userName: `Nume utilizator:`,
|
|
33
39
|
userPhone: `Telefon:`,
|
|
40
|
+
userPhoneError: 'Telefon-ul trebuie să aibă cel puțin 5 caractere și maximum 20 de caractere.',
|
|
34
41
|
userEmail: `E-mail:`,
|
|
35
42
|
securityQuestion: `Întrebare securitate:`,
|
|
43
|
+
securityQuestionError: 'Întrebarea de securitate trebuie să aibă cel puțin 1 caracter și maximum 120 de caractere.',
|
|
36
44
|
firstName: `Prenume:`,
|
|
37
45
|
securityAnswer: `Răspuns securitate:`,
|
|
46
|
+
securityAnswerError: 'Security answer must be at least 1 character long and maximum 120 characters.',
|
|
38
47
|
lastName: `Nume:`,
|
|
39
48
|
dateOfBirth: `Data nașterii:`,
|
|
40
49
|
currency: `Monedă:`,
|
|
41
50
|
userTitle: `Titlu:`,
|
|
42
51
|
locationDetails: `Detalii de Localizare`,
|
|
43
52
|
userCountry: `Țară:`,
|
|
53
|
+
userCityError: 'Orașul trebuie să aibă cel puțin 1 caracter și maximum 50 de caractere.',
|
|
44
54
|
userCity: `Oraș:`,
|
|
45
55
|
userAddress: `Adresă:`,
|
|
56
|
+
userAddressError: 'Address must be at least 1 character long and 100 characters maximum.',
|
|
46
57
|
userPostalCode: `Cod poștal:`,
|
|
58
|
+
userPostalCodeError: 'Codul poștal trebuie să aibă cel puțin 1 caracter și maximum 20 de caractere.',
|
|
47
59
|
userNotifications: `Notificări`,
|
|
48
60
|
userSMSNotification: `Activează notificări prin SMS`,
|
|
49
61
|
userEmailNotification: `Activează notificări prin E-mail`,
|
|
50
62
|
userProfileSaveChanges: `Salvează`,
|
|
51
63
|
userProfileConfirmationMessage: `Modificările au fost salvate!`
|
|
52
64
|
}
|
|
65
|
+
},
|
|
66
|
+
tr: {
|
|
67
|
+
playerProfile: {
|
|
68
|
+
title: `Profil bilgisi`,
|
|
69
|
+
personalDetails: `Kişisel detaylar`,
|
|
70
|
+
userName: `Kullanıcı adı:`,
|
|
71
|
+
userPhone: `Telefon:`,
|
|
72
|
+
userPhoneError: 'Mobil en az 5 karakter uzunluğunda ve en fazla 20 karakter olmalıdır.',
|
|
73
|
+
userEmail: `E-posta:`,
|
|
74
|
+
securityQuestion: `Güvenlik Sorusu:`,
|
|
75
|
+
securityQuestionError: 'Güvenlik sorusu en az 1, en fazla 120 karakter uzunluğunda olmalıdır.',
|
|
76
|
+
firstName: `First name:`,
|
|
77
|
+
securityAnswer: `İlk adı:`,
|
|
78
|
+
securityAnswerError: 'Güvenlik cevabı en az 1 karakter uzunluğunda ve en fazla 120 karakter olmalıdır.',
|
|
79
|
+
lastName: `Soyadı:`,
|
|
80
|
+
dateOfBirth: `Doğum tarihi:`,
|
|
81
|
+
currency: `Para birimi:`,
|
|
82
|
+
userTitle: `Başlık:`,
|
|
83
|
+
locationDetails: `Konum Ayrıntıları`,
|
|
84
|
+
userCountry: `Ülke:`,
|
|
85
|
+
userCity: `Şehir:`,
|
|
86
|
+
userCityError: 'Şehir en az 1 karakter uzunluğunda ve en fazla 50 karakter olmalıdır.',
|
|
87
|
+
userAddress: `Adres:`,
|
|
88
|
+
userAddressError: 'Adres en az 1 karakter uzunluğunda ve en fazla 100 karakter olmalıdır.',
|
|
89
|
+
userPostalCode: `Posta kodu:`,
|
|
90
|
+
userPostalCodeError: 'Posta Kodu en az 1 karakter uzunluğunda ve en fazla 20 karakter olmalıdır.',
|
|
91
|
+
userNotifications: `Bildirimler`,
|
|
92
|
+
userSMSNotification: `SMS bildirimlerini etkinleştir`,
|
|
93
|
+
userEmailNotification: `E-postaları Etkinleştir`,
|
|
94
|
+
userProfileSaveChanges: `Değişiklikleri Kaydet`,
|
|
95
|
+
userProfileConfirmationMessage: `Değişiklikleriniz kaydedildi!`
|
|
96
|
+
}
|
|
53
97
|
}
|
|
54
98
|
};
|