@everymatrix/general-registration 1.69.2 → 1.70.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/dist/cjs/{checkbox-group-input_13.cjs.entry.js → checkbox-group-input_14.cjs.entry.js} +656 -58
- package/dist/cjs/general-registration.cjs.js +2 -2
- package/dist/cjs/{index-4ad59840.js → index-b58aff1c.js} +6 -3
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/general-registration/general-registration.js +81 -42
- package/dist/collection/utils/locale.utils.js +13 -0
- package/dist/esm/{checkbox-group-input_13.entry.js → checkbox-group-input_14.entry.js} +656 -59
- package/dist/esm/general-registration.js +3 -3
- package/dist/esm/{index-14f0c56e.js → index-6422f1dd.js} +6 -3
- package/dist/esm/loader.js +3 -3
- package/dist/general-registration/checkbox-group-input_14.entry.js +5614 -0
- package/dist/general-registration/general-registration.esm.js +1 -1
- package/dist/general-registration/{index-14f0c56e.js → index-6422f1dd.js} +2 -2
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-registration/.stencil/packages/stencil/general-input/src/utils/types.d.ts +17 -12
- package/dist/types/components/general-registration/general-registration.d.ts +19 -16
- package/dist/types/utils/locale.utils.d.ts +1 -12
- package/package.json +1 -1
- package/dist/general-registration/checkbox-group-input_13.entry.js +0 -5614
package/dist/cjs/{checkbox-group-input_13.cjs.entry.js → checkbox-group-input_14.cjs.entry.js}
RENAMED
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-b58aff1c.js');
|
|
6
6
|
|
|
7
7
|
const DEFAULT_LANGUAGE$1 = 'en';
|
|
8
8
|
const TRANSLATIONS$1 = {
|
|
9
9
|
"en": {
|
|
10
10
|
"dateError": "The selected date should be between {min} and {max}",
|
|
11
11
|
"dateError2": "The selected date is not within the accepted range",
|
|
12
|
+
"dateFormatError": "The selected date has a different format then the one required.",
|
|
12
13
|
"numberLengthError": "The number should be between {min} and {max}",
|
|
13
14
|
"lengthError": "The length should be between {minLength} and {maxLength}",
|
|
14
15
|
"requiredError": "This input is required.",
|
|
@@ -24,12 +25,17 @@ const TRANSLATIONS$1 = {
|
|
|
24
25
|
"MustIncludeNumber": "Password must include a number",
|
|
25
26
|
"MustContainCapital": "Password must include a capital letter",
|
|
26
27
|
"MustIncludePunctation": "Password must include punctuation",
|
|
27
|
-
"OnlyNumbers": "
|
|
28
|
+
"OnlyNumbers": "The input should contain only digits.",
|
|
28
29
|
"InvalidFieldSize": "The length must be exactly 11 digits.",
|
|
29
|
-
"InvalidDocumentNumber": "Only numerical characters are allowed."
|
|
30
|
+
"InvalidDocumentNumber": "Only numerical characters are allowed.",
|
|
31
|
+
"twofaDescription": "<p> We have sent the verification code to <p> {destination}. </p> </p> <p> Please insert the PIN below. </p>",
|
|
32
|
+
"twofaResendMessage": "Didn't receive the verification code?",
|
|
33
|
+
"twofaResendButton": "Resend",
|
|
30
34
|
},
|
|
31
35
|
"hu": {
|
|
32
36
|
"dateError": "A választott dátumnak {min} és {max} között kell lennie",
|
|
37
|
+
"dateError2": "A kiválasztott dátum nincs az elfogadott tartományon belül",
|
|
38
|
+
"dateFormatError": "A kiválasztott dátum formátuma eltér a szükségestől.",
|
|
33
39
|
"numberLengthError": "A számnak {min} és {max} között kell lennie",
|
|
34
40
|
"lengthError": "A hossznak {minLength} és {maxLength} között kell lennie",
|
|
35
41
|
"requiredError": "Ez a beviteli mező kötelező.",
|
|
@@ -45,13 +51,17 @@ const TRANSLATIONS$1 = {
|
|
|
45
51
|
"MustIncludeNumber": "A jelszónak tartalmaznia kell egy számot",
|
|
46
52
|
"MustContainCapital": "A jelszónak tartalmaznia kell egy nagybetűt",
|
|
47
53
|
"MustIncludePunctation": "A jelszónak tartalmaznia kell írásjelet",
|
|
48
|
-
"OnlyNumbers": "Csak
|
|
54
|
+
"OnlyNumbers": "Csak számjegyeket tartalmazhat.",
|
|
49
55
|
"InvalidFieldSize": "A hosszúságnak pontosan 11 számjegynek kell lennie.",
|
|
50
56
|
"InvalidDocumentNumber": "Csak számjegyek engedélyezettek.",
|
|
57
|
+
"twofaDescription": "<p> A megerősítő kódot elküldtük a következő címre: <p> {destination}. </p> </p> <p> Kérjük, írja be az alábbi PIN-kódot. </p>",
|
|
58
|
+
"twofaResendMessage": "Nem kapta meg a megerősítő kódot?",
|
|
59
|
+
"twofaResendButton": "Újraküldés"
|
|
51
60
|
},
|
|
52
61
|
"hr": {
|
|
53
62
|
"dateError": "Odabrani datum treba biti između {min} i {max}",
|
|
54
63
|
"dateError2": "Odabrani datum nije unutar prihvaćenog raspona",
|
|
64
|
+
"dateFormatError": "Odabrani datum je u drugačijem formatu od potrebnog.",
|
|
55
65
|
"numberLengthError": "Broj bi trebao biti između {min} i {max}",
|
|
56
66
|
"lengthError": "Duljina bi trebala biti između {minLength} i {maxLength}",
|
|
57
67
|
"requiredError": "Ovaj unos je obavezan.",
|
|
@@ -67,13 +77,17 @@ const TRANSLATIONS$1 = {
|
|
|
67
77
|
"MustIncludeNumber": "Lozinka mora sadržavati broj",
|
|
68
78
|
"MustContainCapital": "Lozinka mora sadržavati veliko slovo",
|
|
69
79
|
"MustIncludePunctation": "Lozinka mora sadržavati barem jedan znak",
|
|
70
|
-
"OnlyNumbers": "
|
|
80
|
+
"OnlyNumbers": "Smije sadržavati samo znamenke.",
|
|
71
81
|
"InvalidFieldSize": "Dužina mora biti točno 11 znamenki.",
|
|
72
|
-
"InvalidDocumentNumber": "Dopušteni su samo numerički znakovi."
|
|
82
|
+
"InvalidDocumentNumber": "Dopušteni su samo numerički znakovi.",
|
|
83
|
+
"twofaDescription": "<p> Poslali smo verifikacijski kod na: <p> {destination}. </p> </p> <p> Molimo unesite PIN ispod. </p>",
|
|
84
|
+
"twofaResendMessage": "Niste primili verifikacijski kod?",
|
|
85
|
+
"twofaResendButton": "Ponovno pošalji"
|
|
73
86
|
},
|
|
74
87
|
"tr": {
|
|
75
88
|
"dateError": "Seçilen tarih {min} ve {max} arasında olmalıdır",
|
|
76
89
|
"dateError2": "Seçilen tarih kabul edilen aralıkta değil",
|
|
90
|
+
"dateFormatError": "Seçilen tarihin formatı, gereken formattan farklı.",
|
|
77
91
|
"numberLengthError": "Sayı {min} ve {max} arasında olmalıdır",
|
|
78
92
|
"lengthError": "Uzunluk {minLength} ve {maxLength} arasında olmalıdır",
|
|
79
93
|
"requiredError": "Bu alan zorunludur.",
|
|
@@ -89,13 +103,17 @@ const TRANSLATIONS$1 = {
|
|
|
89
103
|
"MustIncludeNumber": "bir sayı içermelidir",
|
|
90
104
|
"MustContainCapital": "büyük harf içermelidir",
|
|
91
105
|
"MustIncludePunctation": "noktalama işareti içermelidir",
|
|
92
|
-
"OnlyNumbers": "
|
|
106
|
+
"OnlyNumbers": "Yalnızca rakamlar içermelidir.",
|
|
93
107
|
"InvalidFieldSize": "Uzunluk tam olarak 11 rakam olmalıdır.",
|
|
94
|
-
"InvalidDocumentNumber": "Sadece sayısal karakterlere izin verilir."
|
|
108
|
+
"InvalidDocumentNumber": "Sadece sayısal karakterlere izin verilir.",
|
|
109
|
+
"twofaDescription": "<p> Doğrulama kodunu şu adrese gönderdik: <p> {destination}. </p> </p> <p> Lütfen aşağıya PIN kodunu girin. </p>",
|
|
110
|
+
"twofaResendMessage": "Doğrulama kodunu almadınız mı?",
|
|
111
|
+
"twofaResendButton": "Yeniden gönder"
|
|
95
112
|
},
|
|
96
113
|
"pt-br": {
|
|
97
114
|
"dateError": "A data selecionada deve estar entre {min} e {max}",
|
|
98
115
|
"dateError2": "A data selecionada não está dentro de um intervalo válido",
|
|
116
|
+
"dateFormatError": "A data selecionada está em um formato diferente do exigido.",
|
|
99
117
|
"numberLengthError": "O número deve estar entre {min} e {max}",
|
|
100
118
|
"lengthError": "O comprimento deve estar entre {minLength} e {maxLength}",
|
|
101
119
|
"requiredError": "Este campo é obrigatório",
|
|
@@ -111,13 +129,17 @@ const TRANSLATIONS$1 = {
|
|
|
111
129
|
"MustIncludeNumber": "A senha deve incluir um número",
|
|
112
130
|
"MustContainCapital": "A senha deve incluir uma letra maiúscula",
|
|
113
131
|
"MustIncludePunctation": "A senha deve incluir um sinal de pontuação",
|
|
114
|
-
"OnlyNumbers": "Deve conter apenas
|
|
132
|
+
"OnlyNumbers": "Deve conter apenas dígitos.",
|
|
115
133
|
"InvalidFieldSize": "O comprimento deve ser exatamente 11 dígitos.",
|
|
116
|
-
"InvalidDocumentNumber": "Apenas caracteres numéricos são permitidos."
|
|
134
|
+
"InvalidDocumentNumber": "Apenas caracteres numéricos são permitidos.",
|
|
135
|
+
"twofaDescription": "<p> Enviamos o código de verificação para: <p> {destination}. </p> </p> <p> Por favor, insira o PIN abaixo. </p>",
|
|
136
|
+
"twofaResendMessage": "Não recebeu o código de verificação?",
|
|
137
|
+
"twofaResendButton": "Reenviar"
|
|
117
138
|
},
|
|
118
139
|
"es-mx": {
|
|
119
140
|
"dateError": "La fecha seleccionada debe ser entre {min} y {max}",
|
|
120
141
|
"dateError2": "La fecha seleccionada no está dentro de un rango válido",
|
|
142
|
+
"dateFormatError": "La fecha seleccionada tiene un formato diferente al requerido.",
|
|
121
143
|
"numberLengthError": "El número debe ser entre {min} y {max}",
|
|
122
144
|
"lengthError": "La longitud deber ser entre {minLength} y {maxLength}",
|
|
123
145
|
"requiredError": "Este campo es requerido",
|
|
@@ -133,9 +155,12 @@ const TRANSLATIONS$1 = {
|
|
|
133
155
|
"MustIncludeNumber": "La contraseña debe incluir un número",
|
|
134
156
|
"MustContainCapital": "La contraseña debe incluir una letra mayúscula",
|
|
135
157
|
"MustIncludePunctation": "La contraseña debe incluir un signo de puntuación",
|
|
136
|
-
"OnlyNumbers": "
|
|
158
|
+
"OnlyNumbers": "Debe contener solo dígitos.",
|
|
137
159
|
"InvalidFieldSize": "La longitud debe ser exactamente de 11 dígitos.",
|
|
138
|
-
"InvalidDocumentNumber": "Solo se permiten caracteres numéricos."
|
|
160
|
+
"InvalidDocumentNumber": "Solo se permiten caracteres numéricos.",
|
|
161
|
+
"twofaDescription": "<p> Hemos enviado el código de verificación a: <p> {destination}. </p> </p> <p> Por favor, ingrese el PIN a continuación. </p>",
|
|
162
|
+
"twofaResendMessage": "¿No recibiste el código de verificación?",
|
|
163
|
+
"twofaResendButton": "Reenviar"
|
|
139
164
|
}
|
|
140
165
|
};
|
|
141
166
|
const translate$1 = (key, customLang, values) => {
|
|
@@ -5467,6 +5492,303 @@ function isBefore(dirtyDate, dirtyDateToCompare) {
|
|
|
5467
5492
|
return date.getTime() < dateToCompare.getTime();
|
|
5468
5493
|
}
|
|
5469
5494
|
|
|
5495
|
+
/**
|
|
5496
|
+
* @name isMatch
|
|
5497
|
+
* @category Common Helpers
|
|
5498
|
+
* @summary validates the date string against given formats
|
|
5499
|
+
*
|
|
5500
|
+
* @description
|
|
5501
|
+
* Return the true if given date is string correct against the given format else
|
|
5502
|
+
* will return false.
|
|
5503
|
+
*
|
|
5504
|
+
* > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
|
|
5505
|
+
* > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
5506
|
+
*
|
|
5507
|
+
* The characters in the format string wrapped between two single quotes characters (') are escaped.
|
|
5508
|
+
* Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
|
|
5509
|
+
*
|
|
5510
|
+
* Format of the format string is based on Unicode Technical Standard #35:
|
|
5511
|
+
* https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
|
|
5512
|
+
* with a few additions (see note 5 below the table).
|
|
5513
|
+
*
|
|
5514
|
+
* Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited
|
|
5515
|
+
* and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:
|
|
5516
|
+
*
|
|
5517
|
+
* ```javascript
|
|
5518
|
+
* isMatch('23 AM', 'HH a')
|
|
5519
|
+
* //=> RangeError: The format string mustn't contain `HH` and `a` at the same time
|
|
5520
|
+
* ```
|
|
5521
|
+
*
|
|
5522
|
+
* See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true
|
|
5523
|
+
*
|
|
5524
|
+
* Accepted format string patterns:
|
|
5525
|
+
* | Unit |Prior| Pattern | Result examples | Notes |
|
|
5526
|
+
* |---------------------------------|-----|---------|-----------------------------------|-------|
|
|
5527
|
+
* | Era | 140 | G..GGG | AD, BC | |
|
|
5528
|
+
* | | | GGGG | Anno Domini, Before Christ | 2 |
|
|
5529
|
+
* | | | GGGGG | A, B | |
|
|
5530
|
+
* | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |
|
|
5531
|
+
* | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |
|
|
5532
|
+
* | | | yy | 44, 01, 00, 17 | 4 |
|
|
5533
|
+
* | | | yyy | 044, 001, 123, 999 | 4 |
|
|
5534
|
+
* | | | yyyy | 0044, 0001, 1900, 2017 | 4 |
|
|
5535
|
+
* | | | yyyyy | ... | 2,4 |
|
|
5536
|
+
* | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |
|
|
5537
|
+
* | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |
|
|
5538
|
+
* | | | YY | 44, 01, 00, 17 | 4,6 |
|
|
5539
|
+
* | | | YYY | 044, 001, 123, 999 | 4 |
|
|
5540
|
+
* | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |
|
|
5541
|
+
* | | | YYYYY | ... | 2,4 |
|
|
5542
|
+
* | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |
|
|
5543
|
+
* | | | RR | -43, 01, 00, 17 | 4,5 |
|
|
5544
|
+
* | | | RRR | -043, 001, 123, 999, -999 | 4,5 |
|
|
5545
|
+
* | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |
|
|
5546
|
+
* | | | RRRRR | ... | 2,4,5 |
|
|
5547
|
+
* | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |
|
|
5548
|
+
* | | | uu | -43, 01, 99, -99 | 4 |
|
|
5549
|
+
* | | | uuu | -043, 001, 123, 999, -999 | 4 |
|
|
5550
|
+
* | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |
|
|
5551
|
+
* | | | uuuuu | ... | 2,4 |
|
|
5552
|
+
* | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |
|
|
5553
|
+
* | | | Qo | 1st, 2nd, 3rd, 4th | 5 |
|
|
5554
|
+
* | | | QQ | 01, 02, 03, 04 | |
|
|
5555
|
+
* | | | QQQ | Q1, Q2, Q3, Q4 | |
|
|
5556
|
+
* | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
|
|
5557
|
+
* | | | QQQQQ | 1, 2, 3, 4 | 4 |
|
|
5558
|
+
* | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |
|
|
5559
|
+
* | | | qo | 1st, 2nd, 3rd, 4th | 5 |
|
|
5560
|
+
* | | | qq | 01, 02, 03, 04 | |
|
|
5561
|
+
* | | | qqq | Q1, Q2, Q3, Q4 | |
|
|
5562
|
+
* | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
|
|
5563
|
+
* | | | qqqqq | 1, 2, 3, 4 | 3 |
|
|
5564
|
+
* | Month (formatting) | 110 | M | 1, 2, ..., 12 | |
|
|
5565
|
+
* | | | Mo | 1st, 2nd, ..., 12th | 5 |
|
|
5566
|
+
* | | | MM | 01, 02, ..., 12 | |
|
|
5567
|
+
* | | | MMM | Jan, Feb, ..., Dec | |
|
|
5568
|
+
* | | | MMMM | January, February, ..., December | 2 |
|
|
5569
|
+
* | | | MMMMM | J, F, ..., D | |
|
|
5570
|
+
* | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |
|
|
5571
|
+
* | | | Lo | 1st, 2nd, ..., 12th | 5 |
|
|
5572
|
+
* | | | LL | 01, 02, ..., 12 | |
|
|
5573
|
+
* | | | LLL | Jan, Feb, ..., Dec | |
|
|
5574
|
+
* | | | LLLL | January, February, ..., December | 2 |
|
|
5575
|
+
* | | | LLLLL | J, F, ..., D | |
|
|
5576
|
+
* | Local week of year | 100 | w | 1, 2, ..., 53 | |
|
|
5577
|
+
* | | | wo | 1st, 2nd, ..., 53th | 5 |
|
|
5578
|
+
* | | | ww | 01, 02, ..., 53 | |
|
|
5579
|
+
* | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |
|
|
5580
|
+
* | | | Io | 1st, 2nd, ..., 53th | 5 |
|
|
5581
|
+
* | | | II | 01, 02, ..., 53 | 5 |
|
|
5582
|
+
* | Day of month | 90 | d | 1, 2, ..., 31 | |
|
|
5583
|
+
* | | | do | 1st, 2nd, ..., 31st | 5 |
|
|
5584
|
+
* | | | dd | 01, 02, ..., 31 | |
|
|
5585
|
+
* | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |
|
|
5586
|
+
* | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |
|
|
5587
|
+
* | | | DD | 01, 02, ..., 365, 366 | 7 |
|
|
5588
|
+
* | | | DDD | 001, 002, ..., 365, 366 | |
|
|
5589
|
+
* | | | DDDD | ... | 2 |
|
|
5590
|
+
* | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Su | |
|
|
5591
|
+
* | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
|
|
5592
|
+
* | | | EEEEE | M, T, W, T, F, S, S | |
|
|
5593
|
+
* | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
|
|
5594
|
+
* | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |
|
|
5595
|
+
* | | | io | 1st, 2nd, ..., 7th | 5 |
|
|
5596
|
+
* | | | ii | 01, 02, ..., 07 | 5 |
|
|
5597
|
+
* | | | iii | Mon, Tue, Wed, ..., Su | 5 |
|
|
5598
|
+
* | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |
|
|
5599
|
+
* | | | iiiii | M, T, W, T, F, S, S | 5 |
|
|
5600
|
+
* | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |
|
|
5601
|
+
* | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |
|
|
5602
|
+
* | | | eo | 2nd, 3rd, ..., 1st | 5 |
|
|
5603
|
+
* | | | ee | 02, 03, ..., 01 | |
|
|
5604
|
+
* | | | eee | Mon, Tue, Wed, ..., Su | |
|
|
5605
|
+
* | | | eeee | Monday, Tuesday, ..., Sunday | 2 |
|
|
5606
|
+
* | | | eeeee | M, T, W, T, F, S, S | |
|
|
5607
|
+
* | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
|
|
5608
|
+
* | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |
|
|
5609
|
+
* | | | co | 2nd, 3rd, ..., 1st | 5 |
|
|
5610
|
+
* | | | cc | 02, 03, ..., 01 | |
|
|
5611
|
+
* | | | ccc | Mon, Tue, Wed, ..., Su | |
|
|
5612
|
+
* | | | cccc | Monday, Tuesday, ..., Sunday | 2 |
|
|
5613
|
+
* | | | ccccc | M, T, W, T, F, S, S | |
|
|
5614
|
+
* | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
|
|
5615
|
+
* | AM, PM | 80 | a..aaa | AM, PM | |
|
|
5616
|
+
* | | | aaaa | a.m., p.m. | 2 |
|
|
5617
|
+
* | | | aaaaa | a, p | |
|
|
5618
|
+
* | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |
|
|
5619
|
+
* | | | bbbb | a.m., p.m., noon, midnight | 2 |
|
|
5620
|
+
* | | | bbbbb | a, p, n, mi | |
|
|
5621
|
+
* | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |
|
|
5622
|
+
* | | | BBBB | at night, in the morning, ... | 2 |
|
|
5623
|
+
* | | | BBBBB | at night, in the morning, ... | |
|
|
5624
|
+
* | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |
|
|
5625
|
+
* | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |
|
|
5626
|
+
* | | | hh | 01, 02, ..., 11, 12 | |
|
|
5627
|
+
* | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |
|
|
5628
|
+
* | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |
|
|
5629
|
+
* | | | HH | 00, 01, 02, ..., 23 | |
|
|
5630
|
+
* | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |
|
|
5631
|
+
* | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |
|
|
5632
|
+
* | | | KK | 01, 02, ..., 11, 00 | |
|
|
5633
|
+
* | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |
|
|
5634
|
+
* | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |
|
|
5635
|
+
* | | | kk | 24, 01, 02, ..., 23 | |
|
|
5636
|
+
* | Minute | 60 | m | 0, 1, ..., 59 | |
|
|
5637
|
+
* | | | mo | 0th, 1st, ..., 59th | 5 |
|
|
5638
|
+
* | | | mm | 00, 01, ..., 59 | |
|
|
5639
|
+
* | Second | 50 | s | 0, 1, ..., 59 | |
|
|
5640
|
+
* | | | so | 0th, 1st, ..., 59th | 5 |
|
|
5641
|
+
* | | | ss | 00, 01, ..., 59 | |
|
|
5642
|
+
* | Seconds timestamp | 40 | t | 512969520 | |
|
|
5643
|
+
* | | | tt | ... | 2 |
|
|
5644
|
+
* | Fraction of second | 30 | S | 0, 1, ..., 9 | |
|
|
5645
|
+
* | | | SS | 00, 01, ..., 99 | |
|
|
5646
|
+
* | | | SSS | 000, 001, ..., 999 | |
|
|
5647
|
+
* | | | SSSS | ... | 2 |
|
|
5648
|
+
* | Milliseconds timestamp | 20 | T | 512969520900 | |
|
|
5649
|
+
* | | | TT | ... | 2 |
|
|
5650
|
+
* | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |
|
|
5651
|
+
* | | | XX | -0800, +0530, Z | |
|
|
5652
|
+
* | | | XXX | -08:00, +05:30, Z | |
|
|
5653
|
+
* | | | XXXX | -0800, +0530, Z, +123456 | 2 |
|
|
5654
|
+
* | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
|
|
5655
|
+
* | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |
|
|
5656
|
+
* | | | xx | -0800, +0530, +0000 | |
|
|
5657
|
+
* | | | xxx | -08:00, +05:30, +00:00 | 2 |
|
|
5658
|
+
* | | | xxxx | -0800, +0530, +0000, +123456 | |
|
|
5659
|
+
* | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
|
|
5660
|
+
* | Long localized date | NA | P | 05/29/1453 | 5,8 |
|
|
5661
|
+
* | | | PP | May 29, 1453 | |
|
|
5662
|
+
* | | | PPP | May 29th, 1453 | |
|
|
5663
|
+
* | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |
|
|
5664
|
+
* | Long localized time | NA | p | 12:00 AM | 5,8 |
|
|
5665
|
+
* | | | pp | 12:00:00 AM | |
|
|
5666
|
+
* | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |
|
|
5667
|
+
* | | | PPpp | May 29, 1453, 12:00:00 AM | |
|
|
5668
|
+
* | | | PPPpp | May 29th, 1453 at ... | |
|
|
5669
|
+
* | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |
|
|
5670
|
+
* Notes:
|
|
5671
|
+
* 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
|
|
5672
|
+
* are the same as "stand-alone" units, but are different in some languages.
|
|
5673
|
+
* "Formatting" units are declined according to the rules of the language
|
|
5674
|
+
* in the context of a date. "Stand-alone" units are always nominative singular.
|
|
5675
|
+
* In `format` function, they will produce different result:
|
|
5676
|
+
*
|
|
5677
|
+
* `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
|
|
5678
|
+
*
|
|
5679
|
+
* `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
|
|
5680
|
+
*
|
|
5681
|
+
* `isMatch` will try to match both formatting and stand-alone units interchangably.
|
|
5682
|
+
*
|
|
5683
|
+
* 2. Any sequence of the identical letters is a pattern, unless it is escaped by
|
|
5684
|
+
* the single quote characters (see below).
|
|
5685
|
+
* If the sequence is longer than listed in table:
|
|
5686
|
+
* - for numerical units (`yyyyyyyy`) `isMatch` will try to match a number
|
|
5687
|
+
* as wide as the sequence
|
|
5688
|
+
* - for text units (`MMMMMMMM`) `isMatch` will try to match the widest variation of the unit.
|
|
5689
|
+
* These variations are marked with "2" in the last column of the table.
|
|
5690
|
+
*
|
|
5691
|
+
* 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
|
|
5692
|
+
* These tokens represent the shortest form of the quarter.
|
|
5693
|
+
*
|
|
5694
|
+
* 4. The main difference between `y` and `u` patterns are B.C. years:
|
|
5695
|
+
*
|
|
5696
|
+
* | Year | `y` | `u` |
|
|
5697
|
+
* |------|-----|-----|
|
|
5698
|
+
* | AC 1 | 1 | 1 |
|
|
5699
|
+
* | BC 1 | 1 | 0 |
|
|
5700
|
+
* | BC 2 | 2 | -1 |
|
|
5701
|
+
*
|
|
5702
|
+
* Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:
|
|
5703
|
+
*
|
|
5704
|
+
* `isMatch('50', 'yy') //=> true`
|
|
5705
|
+
*
|
|
5706
|
+
* `isMatch('75', 'yy') //=> true`
|
|
5707
|
+
*
|
|
5708
|
+
* while `uu` will use the year as is:
|
|
5709
|
+
*
|
|
5710
|
+
* `isMatch('50', 'uu') //=> true`
|
|
5711
|
+
*
|
|
5712
|
+
* `isMatch('75', 'uu') //=> true`
|
|
5713
|
+
*
|
|
5714
|
+
* The same difference is true for local and ISO week-numbering years (`Y` and `R`),
|
|
5715
|
+
* except local week-numbering years are dependent on `options.weekStartsOn`
|
|
5716
|
+
* and `options.firstWeekContainsDate` (compare [setISOWeekYear]{@link https://date-fns.org/docs/setISOWeekYear}
|
|
5717
|
+
* and [setWeekYear]{@link https://date-fns.org/docs/setWeekYear}).
|
|
5718
|
+
*
|
|
5719
|
+
* 5. These patterns are not in the Unicode Technical Standard #35:
|
|
5720
|
+
* - `i`: ISO day of week
|
|
5721
|
+
* - `I`: ISO week of year
|
|
5722
|
+
* - `R`: ISO week-numbering year
|
|
5723
|
+
* - `o`: ordinal number modifier
|
|
5724
|
+
* - `P`: long localized date
|
|
5725
|
+
* - `p`: long localized time
|
|
5726
|
+
*
|
|
5727
|
+
* 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
|
|
5728
|
+
* You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
5729
|
+
*
|
|
5730
|
+
* 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.
|
|
5731
|
+
* You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
5732
|
+
*
|
|
5733
|
+
* 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based
|
|
5734
|
+
* on the given locale.
|
|
5735
|
+
*
|
|
5736
|
+
* using `en-US` locale: `P` => `MM/dd/yyyy`
|
|
5737
|
+
* using `en-US` locale: `p` => `hh:mm a`
|
|
5738
|
+
* using `pt-BR` locale: `P` => `dd/MM/yyyy`
|
|
5739
|
+
* using `pt-BR` locale: `p` => `HH:mm`
|
|
5740
|
+
*
|
|
5741
|
+
* Values will be checked in the descending order of its unit's priority.
|
|
5742
|
+
* Units of an equal priority overwrite each other in the order of appearance.
|
|
5743
|
+
*
|
|
5744
|
+
* If no values of higher priority are matched (e.g. when matching string 'January 1st' without a year),
|
|
5745
|
+
* the values will be taken from today's using `new Date()` date which works as a context of parsing.
|
|
5746
|
+
*
|
|
5747
|
+
* The result may vary by locale.
|
|
5748
|
+
*
|
|
5749
|
+
* If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.
|
|
5750
|
+
*
|
|
5751
|
+
*
|
|
5752
|
+
*
|
|
5753
|
+
* @param {String} dateString - the date string to verify
|
|
5754
|
+
* @param {String} formatString - the string of tokens
|
|
5755
|
+
* @param {Object} [options] - an object with options.
|
|
5756
|
+
* @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
|
|
5757
|
+
* @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
|
|
5758
|
+
* @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year
|
|
5759
|
+
* @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
|
|
5760
|
+
* see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
5761
|
+
* @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
|
|
5762
|
+
* see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
5763
|
+
* @returns {Boolean}
|
|
5764
|
+
* @throws {TypeError} 2 arguments required
|
|
5765
|
+
* @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
|
|
5766
|
+
* @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
|
|
5767
|
+
* @throws {RangeError} `options.locale` must contain `match` property
|
|
5768
|
+
* @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
5769
|
+
* @throws {RangeError} use `yy` instead of `YY` for formatting years; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
5770
|
+
* @throws {RangeError} use `d` instead of `D` for formatting days of the month; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
5771
|
+
* @throws {RangeError} use `dd` instead of `DD` for formatting days of the month; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
5772
|
+
* @throws {RangeError} format string contains an unescaped latin alphabet character
|
|
5773
|
+
*
|
|
5774
|
+
* @example
|
|
5775
|
+
* // Match 11 February 2014 from middle-endian format:
|
|
5776
|
+
* const result = isMatch('02/11/2014', 'MM/dd/yyyy')
|
|
5777
|
+
* //=> true
|
|
5778
|
+
*
|
|
5779
|
+
* @example
|
|
5780
|
+
* // Match 28th of February in Esperanto locale in the context of 2010 year:
|
|
5781
|
+
* import eo from 'date-fns/locale/eo'
|
|
5782
|
+
* const result = isMatch('28-a de februaro', "do 'de' MMMM", {
|
|
5783
|
+
* locale: eo
|
|
5784
|
+
* })
|
|
5785
|
+
* //=> true
|
|
5786
|
+
*/
|
|
5787
|
+
function isMatch(dateString, formatString, options) {
|
|
5788
|
+
requiredArgs(2, arguments);
|
|
5789
|
+
return isValid(parse(dateString, formatString, new Date(), options));
|
|
5790
|
+
}
|
|
5791
|
+
|
|
5470
5792
|
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%;display:flex;flex-direction:column;gap:5px;height:100%}.date__wrapper--autofilled{pointer-events:none}.date__wrapper--autofilled .date__label{color:var(--emw--registration-typography, var(--emw--color-black, #000000))}.date__wrapper--autofilled .date__input::part(input-field){color:var(--emw--registration-typography, var(--emw--color-black, #000000))}.date__label{font-family:inherit;font-style:normal;font-weight:500;font-size:16px;line-height:20px;color:var(--emw--registration-typography, var(--emw--color-black, #000000))}.date__label--required::after{content:\"*\";font-family:inherit;color:var(--emw--login-color-primary, var(--emw--color-primary, #22B04E));margin-left:2px}.date__input{border:none;width:inherit;position:relative}.date__input[focused]::part(input-field){border-color:var(--emw--login-color-primary, var(--emw--color-primary, #22B04E))}.date__input[invalid]::part(input-field){border:1px solid var(--emw--color-error, var(--emw--color-red, #ed0909))}.date__input::part(input-field){border-radius:4px;background-color:var(--emw--color-white, #FFFFFF);border:1px solid var(--emw--color-gray-100, #E6E6E6);color:var(--emw--registration-typography, var(--emw--color-black, #000000));font-family:inherit;font-style:normal;font-size:16px;font-weight:300;line-height:1.5;padding:0;height:44px}.date__input>input{padding:5px 15px}.date__input::part(toggle-button){position:relative;right:10px}.date__error-message{position:absolute;top:calc(100% + 5px);left:0;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.date__tooltip-icon{position:absolute;right:0;bottom:10px}.date__tooltip{position:absolute;bottom:35px;right:10px;background-color:var(--emw--color-white, #FFFFFF);border:1px solid var(--emw--color-gray-100, #E6E6E6);color:var(--emw--registration-typography, var(--emw--color-black, #000000));padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.date__tooltip.visible{opacity:1}";
|
|
5471
5793
|
const DateInputStyle0 = dateInputCss;
|
|
5472
5794
|
|
|
@@ -5507,6 +5829,12 @@ const DateInput = class {
|
|
|
5507
5829
|
this.limitStylingAppends = false;
|
|
5508
5830
|
this.showTooltip = false;
|
|
5509
5831
|
}
|
|
5832
|
+
get formattedValue() {
|
|
5833
|
+
if (!this.value)
|
|
5834
|
+
return '';
|
|
5835
|
+
const parsedDate = parse(this.value, 'yyyy-MM-dd', new Date());
|
|
5836
|
+
return format(parsedDate, this.dateFormat || 'yyyy-MM-dd');
|
|
5837
|
+
}
|
|
5510
5838
|
handleStylingChange(newValue, oldValue) {
|
|
5511
5839
|
if (newValue !== oldValue)
|
|
5512
5840
|
this.setClientStyling();
|
|
@@ -5589,7 +5917,7 @@ const DateInput = class {
|
|
|
5589
5917
|
this.emitValueHandler(true);
|
|
5590
5918
|
}
|
|
5591
5919
|
setValidity() {
|
|
5592
|
-
if (isBefore(this.valueAsDate, this.minDate) || isAfter(this.valueAsDate, this.maxDate)) {
|
|
5920
|
+
if (isBefore(this.valueAsDate, this.minDate) || isAfter(this.valueAsDate, this.maxDate) || !isMatch(this.formattedValue, this.dateFormat)) {
|
|
5593
5921
|
return false;
|
|
5594
5922
|
}
|
|
5595
5923
|
else {
|
|
@@ -5606,6 +5934,9 @@ const DateInput = class {
|
|
|
5606
5934
|
if (isBefore(this.valueAsDate, this.minDate) || isAfter(this.valueAsDate, this.maxDate)) {
|
|
5607
5935
|
return translate$1('dateError2', this.language);
|
|
5608
5936
|
}
|
|
5937
|
+
if (!isMatch(this.formattedValue, this.dateFormat)) {
|
|
5938
|
+
return translate$1('dateFormatError', this.language);
|
|
5939
|
+
}
|
|
5609
5940
|
}
|
|
5610
5941
|
renderTooltip() {
|
|
5611
5942
|
if (this.showTooltip) {
|
|
@@ -5618,8 +5949,8 @@ const DateInput = class {
|
|
|
5618
5949
|
if (this.touched) {
|
|
5619
5950
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
5620
5951
|
}
|
|
5621
|
-
return index.h("div", { key: '
|
|
5622
|
-
index.h("img", { key: '
|
|
5952
|
+
return index.h("div", { key: '18b85f7647c376d5a99468df4978d178cd19d77b', class: `date__wrapper ${this.autofilled ? 'date__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("label", { key: 'e351963c25eecb2e5758dec54c9c2fb883b85912', class: `date__label ${this.validation.mandatory ? 'date__label--required' : ''}}`, htmlFor: `${this.name}__input` }, this.displayName, " ", this.validation.mandatory ? '*' : ''), index.h("vaadin-date-picker", { key: '471bb1c440213f764fe334309b262d44ac2ead7d', id: `${this.name}__input`, type: 'date', class: `date__input ${invalidClass}`, value: this.defaultValue, readOnly: this.autofilled, placeholder: `${this.placeholder}`, required: this.validation.mandatory, max: this.validation.max, min: this.validation.min, onChange: (e) => this.handleInput(e) }), index.h("small", { key: '14e5c4d34a3236907cd701d72a91c06d28b37c7e', class: 'date__error-message' }, this.errorMessage), this.tooltip &&
|
|
5953
|
+
index.h("img", { key: 'c3424b6076ec5a399054bf37eca774e4bd3e3644', class: 'date__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip());
|
|
5623
5954
|
}
|
|
5624
5955
|
get element() { return index.getElement(this); }
|
|
5625
5956
|
static get watchers() { return {
|
|
@@ -11448,6 +11779,8 @@ const GeneralInput = class {
|
|
|
11448
11779
|
this.dateFormat = undefined;
|
|
11449
11780
|
this.translationUrl = '';
|
|
11450
11781
|
this.emitOnClick = false;
|
|
11782
|
+
this.twofaDestination = undefined;
|
|
11783
|
+
this.twofaResendIntervalSeconds = 60;
|
|
11451
11784
|
}
|
|
11452
11785
|
connectedCallback() {
|
|
11453
11786
|
if (this.translationUrl) {
|
|
@@ -11479,12 +11812,14 @@ const GeneralInput = class {
|
|
|
11479
11812
|
return index.h("tel-input", { name: this.name, action: this.action, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, emitValue: this.emitValue, language: this.language, autofilled: this.autofilled, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
|
|
11480
11813
|
case 'dropdown':
|
|
11481
11814
|
return index.h("select-input", { name: this.name, action: this.action, defaultValue: this.defaultValue, displayName: this.displayName, options: this.options, validation: this.validation, emitValue: this.emitValue, autofilled: this.autofilled, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
|
|
11815
|
+
case 'twofa':
|
|
11816
|
+
return index.h("twofa-input", { name: this.name, displayName: this.displayName, validation: this.validation, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, destination: this.twofaDestination, "resend-interval-seconds": this.twofaResendIntervalSeconds });
|
|
11482
11817
|
default:
|
|
11483
11818
|
return index.h("p", null, "The ", this.type, " input type is not valid");
|
|
11484
11819
|
}
|
|
11485
11820
|
}
|
|
11486
11821
|
render() {
|
|
11487
|
-
return (index.h(index.Host, { key: '
|
|
11822
|
+
return (index.h(index.Host, { key: '575526a74f8739d530e0094238357e2a744cc463', class: `general-input--${this.name}`, onClick: this.handleClick }, this.renderInput()));
|
|
11488
11823
|
}
|
|
11489
11824
|
};
|
|
11490
11825
|
GeneralInput.style = GeneralInputStyle0;
|
|
@@ -11544,6 +11879,7 @@ const TRANSLATIONS = {
|
|
|
11544
11879
|
"doneButton": 'Done',
|
|
11545
11880
|
"generalError": "Something went wrong... Please try again.",
|
|
11546
11881
|
"successMessage": "Register successful",
|
|
11882
|
+
"requestTwofaError": "There was an error when sending the code",
|
|
11547
11883
|
//Prod old errors which will be deleted after prod is updated to new keys.
|
|
11548
11884
|
"GmErr_BadRequest_Duplicate_User": 'A user with this information already exists.',
|
|
11549
11885
|
"GmErr_BadRequest_PasswordContainsUsername": "The password cannot be the same as the username.",
|
|
@@ -11627,6 +11963,7 @@ const TRANSLATIONS = {
|
|
|
11627
11963
|
"backButton": 'Vissza',
|
|
11628
11964
|
"doneButton": 'Kész',
|
|
11629
11965
|
"generalError": "Valami hiba történt... Próbáld újra.",
|
|
11966
|
+
"requestTwofaError": "Hiba történt a kód elküldésekor",
|
|
11630
11967
|
"successMessage": "Sikeres regisztráció",
|
|
11631
11968
|
//Prod old errors which will be deleted after prod is updated to new keys.
|
|
11632
11969
|
"GmErr_BadRequest_Duplicate_User": 'Egy ilyen információval rendelkező felhasználó már létezik.',
|
|
@@ -11711,6 +12048,7 @@ const TRANSLATIONS = {
|
|
|
11711
12048
|
"backButton": 'Nazad',
|
|
11712
12049
|
"doneButton": 'Gotovo',
|
|
11713
12050
|
"generalError": "Korisnik s ovim podacima već postoji.",
|
|
12051
|
+
"requestTwofaError": "Došlo je do pogreške prilikom slanja koda",
|
|
11714
12052
|
"successMessage": "Register successful",
|
|
11715
12053
|
//Prod old errors which will be deleted after prod is updated to new keys.
|
|
11716
12054
|
"GmErr_BadRequest_Duplicate_User": 'Korisnik s ovim informacijama već postoji.',
|
|
@@ -11795,6 +12133,7 @@ const TRANSLATIONS = {
|
|
|
11795
12133
|
"backButton": 'Voltar',
|
|
11796
12134
|
"doneButton": 'Terminar',
|
|
11797
12135
|
"generalError": 'Alguma coisa deu errado. Por favor tente outra vez',
|
|
12136
|
+
"requestTwofaError": "Ocorreu um erro ao enviar o código",
|
|
11798
12137
|
"successMessage": 'Registro bem-sucedido',
|
|
11799
12138
|
//Prod old errors which will be deleted after prod is updated to new keys.
|
|
11800
12139
|
"GmErr_BadRequest_Duplicate_User": 'Um usuário com essas informações já existe.',
|
|
@@ -11879,6 +12218,7 @@ const TRANSLATIONS = {
|
|
|
11879
12218
|
"backButton": 'Atrás',
|
|
11880
12219
|
"doneButton": 'Terminar',
|
|
11881
12220
|
"generalError": 'Algo salió mal... Por favor intente de nuevo',
|
|
12221
|
+
"requestTwofaError": "Se produjo un error al enviar el código",
|
|
11882
12222
|
"successMessage": 'Registro exitoso',
|
|
11883
12223
|
//Prod old errors which will be deleted after prod is updated to new keys.
|
|
11884
12224
|
"GmErr_BadRequest_Duplicate_User": 'Ya existe un usuario con esta información.',
|
|
@@ -11963,6 +12303,7 @@ const TRANSLATIONS = {
|
|
|
11963
12303
|
"backButton": 'Geri',
|
|
11964
12304
|
"doneButton": 'Tamam',
|
|
11965
12305
|
"generalError": "Bir şeyler ters gitti... Lütfen tekrar deneyin.",
|
|
12306
|
+
"requestTwofaError": "Kod gönderilirken bir hata oluştu",
|
|
11966
12307
|
"successMessage": "Kayıt başarılı",
|
|
11967
12308
|
//Prod old errors which will be deleted after prod is updated to new keys.
|
|
11968
12309
|
"GmErr_BadRequest_Duplicate_User": 'Bu bilgilerle bir kullanıcı zaten mevcut.',
|
|
@@ -12047,6 +12388,7 @@ const TRANSLATIONS = {
|
|
|
12047
12388
|
"backButton": 'Back',
|
|
12048
12389
|
"doneButton": 'Done',
|
|
12049
12390
|
"generalError": "Something went wrong... Please try again.",
|
|
12391
|
+
"requestTwofaError": "There was an error when sending the code",
|
|
12050
12392
|
"successMessage": "Register successful",
|
|
12051
12393
|
//Prod old errors which will be deleted after prod is updated to new keys.
|
|
12052
12394
|
"GmErr_BadRequest_Duplicate_User": 'A user with this information already exists.',
|
|
@@ -12131,6 +12473,7 @@ const TRANSLATIONS = {
|
|
|
12131
12473
|
"backButton": "Înapoi",
|
|
12132
12474
|
"doneButton": "Finalizat",
|
|
12133
12475
|
"generalError": "Ceva a mers prost... Vă rugăm să încercați din nou.",
|
|
12476
|
+
"requestTwofaError": "A apărut o eroare la trimiterea codului",
|
|
12134
12477
|
"successMessage": "Înregistrare reușită",
|
|
12135
12478
|
//Prod old errors which will be deleted after prod is updated to new keys.
|
|
12136
12479
|
"GmErr_BadRequest_Duplicate_User": 'Un utilizator cu aceste informații există deja.',
|
|
@@ -12213,6 +12556,7 @@ const TRANSLATIONS = {
|
|
|
12213
12556
|
"CountryRestricted": "Malheureusement, vous essayez de vous inscrire depuis un pays où nous ne pouvons pas accepter les jeux. Nous ne pouvons pas traiter votre inscription pour cette raison.",
|
|
12214
12557
|
"nextButton": "Suivant",
|
|
12215
12558
|
"backButton": "Retour",
|
|
12559
|
+
"requestTwofaError": "Une erreur est survenue lors de l'envoi du code",
|
|
12216
12560
|
//Prod old errors which will be deleted after prod is updated to new keys.
|
|
12217
12561
|
"GmErr_BadRequest_Duplicate_User": 'Un utilisateur avec ces informations existe déjà.',
|
|
12218
12562
|
"GmErr_BadRequest_PasswordContainsUsername": "Le mot de passe ne peut pas être le même que le nom d'utilisateur.",
|
|
@@ -12296,6 +12640,7 @@ const TRANSLATIONS = {
|
|
|
12296
12640
|
"backButton": "Atrás",
|
|
12297
12641
|
"doneButton": "Hecho",
|
|
12298
12642
|
"generalError": "Algo salió mal... Por favor, inténtalo de nuevo.",
|
|
12643
|
+
"requestTwofaError": "Se produjo un error al enviar el código",
|
|
12299
12644
|
"successMessage": "Registro exitoso",
|
|
12300
12645
|
//Prod old errors which will be deleted after prod is updated to new keys.
|
|
12301
12646
|
"GmErr_BadRequest_Duplicate_User": 'Ya existe un usuario con esta información.',
|
|
@@ -12380,6 +12725,7 @@ const TRANSLATIONS = {
|
|
|
12380
12725
|
"backButton": "Voltar",
|
|
12381
12726
|
"doneButton": "Concluído",
|
|
12382
12727
|
"generalError": "Algo deu errado... Por favor, tente novamente.",
|
|
12728
|
+
"requestTwofaError": "Ocorreu um erro ao enviar o código",
|
|
12383
12729
|
"successMessage": "Registro bem-sucedido",
|
|
12384
12730
|
//Prod old errors which will be deleted after prod is updated to new keys.
|
|
12385
12731
|
"GmErr_BadRequest_Duplicate_User": 'Um usuário com essas informações já existe.',
|
|
@@ -12464,6 +12810,7 @@ const TRANSLATIONS = {
|
|
|
12464
12810
|
"backButton": "Zurück",
|
|
12465
12811
|
"doneButton": "Fertig",
|
|
12466
12812
|
"generalError": "Etwas ist schief gelaufen... Bitte versuchen Sie es erneut.",
|
|
12813
|
+
"requestTwofaError": "Beim Senden des Codes ist ein Fehler aufgetreten",
|
|
12467
12814
|
"successMessage": "Registrierung erfolgreich",
|
|
12468
12815
|
//Prod old errors which will be deleted after prod is updated to new keys.
|
|
12469
12816
|
"GmErr_BadRequest_Duplicate_User": 'Ein Benutzer mit diesen Informationen existiert bereits.',
|
|
@@ -12504,6 +12851,7 @@ const getTranslations = (url) => {
|
|
|
12504
12851
|
.then((res) => res.json())
|
|
12505
12852
|
.then((data) => {
|
|
12506
12853
|
Object.keys(data).forEach((item) => {
|
|
12854
|
+
TRANSLATIONS[item] = TRANSLATIONS[item] || {};
|
|
12507
12855
|
for (let key in data[item]) {
|
|
12508
12856
|
TRANSLATIONS[item][key] = data[item][key];
|
|
12509
12857
|
}
|
|
@@ -12571,10 +12919,15 @@ const GeneralRegistration = class {
|
|
|
12571
12919
|
this.listOfActions = [];
|
|
12572
12920
|
this.listOfInputs = [];
|
|
12573
12921
|
this.conditionalValidationMap = {};
|
|
12922
|
+
this.lastStep = '';
|
|
12574
12923
|
this.emitValue = false;
|
|
12924
|
+
this.form = null;
|
|
12925
|
+
this.errorCode = '';
|
|
12575
12926
|
this.backButtonPressed = false;
|
|
12576
12927
|
this.registerErrors = false;
|
|
12577
12928
|
this.extraActions = [];
|
|
12929
|
+
this.registerCredentialsEvent = null;
|
|
12930
|
+
this.twofaDestination = '';
|
|
12578
12931
|
this.registrationStepsState = {
|
|
12579
12932
|
regId: null
|
|
12580
12933
|
};
|
|
@@ -12621,13 +12974,13 @@ const GeneralRegistration = class {
|
|
|
12621
12974
|
this.buttonInsideForm = undefined;
|
|
12622
12975
|
this.btag = null;
|
|
12623
12976
|
this.emitOnClick = false;
|
|
12624
|
-
this.errorMessage =
|
|
12625
|
-
this.isFormValid =
|
|
12977
|
+
this.errorMessage = '';
|
|
12978
|
+
this.isFormValid = false;
|
|
12626
12979
|
this.isConsentValid = false;
|
|
12627
12980
|
this.isConsentReady = false;
|
|
12628
12981
|
this.isLoading = true;
|
|
12629
|
-
this.isLoadingPOST =
|
|
12630
|
-
this.registrationStep =
|
|
12982
|
+
this.isLoadingPOST = false;
|
|
12983
|
+
this.registrationStep = '';
|
|
12631
12984
|
this.forms = [];
|
|
12632
12985
|
this.limitStylingAppends = false;
|
|
12633
12986
|
this.autofilled = false;
|
|
@@ -12674,6 +13027,42 @@ const GeneralRegistration = class {
|
|
|
12674
13027
|
this.stepsStateMachine({ event: 'set', type: 'values' });
|
|
12675
13028
|
this.handleConditionalValidation(event.detail.name, event.detail.value);
|
|
12676
13029
|
}
|
|
13030
|
+
handleRequestTwofa() {
|
|
13031
|
+
if (!this.twofaDestination)
|
|
13032
|
+
return;
|
|
13033
|
+
const url = new URL('api/v1/gm/legislation/twoFaCode/', this.endpoint);
|
|
13034
|
+
const headers = new Headers({
|
|
13035
|
+
'Content-Type': 'application/problem+json; charset=utf-8'
|
|
13036
|
+
});
|
|
13037
|
+
const body = JSON.stringify({
|
|
13038
|
+
channel: 'Sms',
|
|
13039
|
+
destination: this.twofaDestination
|
|
13040
|
+
});
|
|
13041
|
+
const options = { method: 'POST', headers, body };
|
|
13042
|
+
fetch(url.href, options)
|
|
13043
|
+
.then(res => {
|
|
13044
|
+
if (res.ok)
|
|
13045
|
+
return;
|
|
13046
|
+
res.json().then(err => {
|
|
13047
|
+
var _a;
|
|
13048
|
+
const errorCode = (_a = err.thirdPartyResponse) === null || _a === void 0 ? void 0 : _a.errorCode;
|
|
13049
|
+
this.errorMessage = translate(errorCode, this.language) || translate('requestTwofaError', this.language);
|
|
13050
|
+
});
|
|
13051
|
+
})
|
|
13052
|
+
.catch((err) => console.log(err));
|
|
13053
|
+
}
|
|
13054
|
+
messageHandler(e) {
|
|
13055
|
+
//Handle Consents Message
|
|
13056
|
+
if (!e.data)
|
|
13057
|
+
return;
|
|
13058
|
+
switch (e.data.type) {
|
|
13059
|
+
case 'isConsentsValid':
|
|
13060
|
+
this.listOfInputValidity.find((input) => input.name === "Consents").isValid = e.data.isValid;
|
|
13061
|
+
this.isConsentValid = e.data.isValid;
|
|
13062
|
+
this.isFormValid = !this.getInvalidStatus(this.listOfInputValidity);
|
|
13063
|
+
break;
|
|
13064
|
+
}
|
|
13065
|
+
}
|
|
12677
13066
|
componentWillLoad() {
|
|
12678
13067
|
return this.getRegisterConfig()
|
|
12679
13068
|
.then((config) => {
|
|
@@ -12685,6 +13074,25 @@ const GeneralRegistration = class {
|
|
|
12685
13074
|
console.error(err);
|
|
12686
13075
|
});
|
|
12687
13076
|
}
|
|
13077
|
+
componentDidLoad() {
|
|
13078
|
+
this.registrationWidgetLoaded.emit();
|
|
13079
|
+
window.postMessage({ type: 'registrationWidgetLoaded' }, window.location.href);
|
|
13080
|
+
if (!this.limitStylingAppends && this.host) {
|
|
13081
|
+
if (window.emMessageBus != undefined) {
|
|
13082
|
+
this.setStreamStyling(`${this.mbSource}.Style`);
|
|
13083
|
+
}
|
|
13084
|
+
else {
|
|
13085
|
+
if (this.clientStyling)
|
|
13086
|
+
this.setClientStyling();
|
|
13087
|
+
if (this.clientStylingUrl)
|
|
13088
|
+
this.setClientStylingURL();
|
|
13089
|
+
this.limitStylingAppends = true;
|
|
13090
|
+
}
|
|
13091
|
+
}
|
|
13092
|
+
}
|
|
13093
|
+
disconnectedCallback() {
|
|
13094
|
+
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
13095
|
+
}
|
|
12688
13096
|
/**
|
|
12689
13097
|
* This function produces the conditionalValidationMap object presented below
|
|
12690
13098
|
*
|
|
@@ -12743,7 +13151,8 @@ const GeneralRegistration = class {
|
|
|
12743
13151
|
* if it is we update the validation of the affected fields.
|
|
12744
13152
|
*/
|
|
12745
13153
|
handleConditionalValidation(correlationField, correlationValue) {
|
|
12746
|
-
if (!this.conditionalValidationMap[correlationField]
|
|
13154
|
+
if (!this.conditionalValidationMap[correlationField] ||
|
|
13155
|
+
!this.conditionalValidationMap[correlationField][correlationValue]) {
|
|
12747
13156
|
return;
|
|
12748
13157
|
}
|
|
12749
13158
|
for (const [field, validation] of Object.entries(this.conditionalValidationMap[correlationField][correlationValue])) {
|
|
@@ -12752,37 +13161,6 @@ const GeneralRegistration = class {
|
|
|
12752
13161
|
this.validationChange.emit({ validation, field });
|
|
12753
13162
|
}
|
|
12754
13163
|
}
|
|
12755
|
-
componentDidLoad() {
|
|
12756
|
-
this.registrationWidgetLoaded.emit();
|
|
12757
|
-
window.postMessage({ type: 'registrationWidgetLoaded' }, window.location.href);
|
|
12758
|
-
if (!this.limitStylingAppends && this.host) {
|
|
12759
|
-
if (window.emMessageBus != undefined) {
|
|
12760
|
-
this.setStreamStyling(`${this.mbSource}.Style`);
|
|
12761
|
-
}
|
|
12762
|
-
else {
|
|
12763
|
-
if (this.clientStyling)
|
|
12764
|
-
this.setClientStyling();
|
|
12765
|
-
if (this.clientStylingUrl)
|
|
12766
|
-
this.setClientStylingURL();
|
|
12767
|
-
this.limitStylingAppends = true;
|
|
12768
|
-
}
|
|
12769
|
-
}
|
|
12770
|
-
}
|
|
12771
|
-
disconnectedCallback() {
|
|
12772
|
-
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
12773
|
-
}
|
|
12774
|
-
messageHandler(e) {
|
|
12775
|
-
//Handle Consents Message
|
|
12776
|
-
if (!e.data)
|
|
12777
|
-
return;
|
|
12778
|
-
switch (e.data.type) {
|
|
12779
|
-
case "isConsentsValid":
|
|
12780
|
-
this.listOfInputValidity.find((input) => input.name === "Consents").isValid = e.data.isValid ? true : false;
|
|
12781
|
-
this.isConsentValid = e.data.isValid ? true : false;
|
|
12782
|
-
this.isFormValid = !this.getInvalidStatus(this.listOfInputValidity);
|
|
12783
|
-
break;
|
|
12784
|
-
}
|
|
12785
|
-
}
|
|
12786
13164
|
nextHandler(e) {
|
|
12787
13165
|
e.preventDefault();
|
|
12788
13166
|
// Trigger events in subwidgets.
|
|
@@ -12894,7 +13272,7 @@ const GeneralRegistration = class {
|
|
|
12894
13272
|
}, window.location.href);
|
|
12895
13273
|
}
|
|
12896
13274
|
getRegisterConfig(registrationID) {
|
|
12897
|
-
const url = new URL('
|
|
13275
|
+
const url = new URL('v1/player/legislation/registration/config/', this.endpoint);
|
|
12898
13276
|
const headers = new Headers();
|
|
12899
13277
|
headers.append('Content-Type', 'application/json');
|
|
12900
13278
|
headers.append('Accept', 'application/json');
|
|
@@ -12935,7 +13313,7 @@ const GeneralRegistration = class {
|
|
|
12935
13313
|
}
|
|
12936
13314
|
setRegisterStep() {
|
|
12937
13315
|
this.isLoadingPOST = true;
|
|
12938
|
-
const url = new URL('
|
|
13316
|
+
const url = new URL('v1/player/legislation/registration/step/', this.endpoint);
|
|
12939
13317
|
const registerStep = {
|
|
12940
13318
|
registrationId: this.registrationID,
|
|
12941
13319
|
registerUserDto: this.listOfInputValues
|
|
@@ -13033,6 +13411,10 @@ const GeneralRegistration = class {
|
|
|
13033
13411
|
.then((data) => {
|
|
13034
13412
|
this.isLoadingPOST = false;
|
|
13035
13413
|
this.registrationID = data.registrationId;
|
|
13414
|
+
if (this.listOfActions.find(action => action === '/request-2FA')) {
|
|
13415
|
+
this.twofaDestination = Object.values(this.listOfInputValues.find(item => item.type === 'tel').value).join('');
|
|
13416
|
+
this.handleRequestTwofa();
|
|
13417
|
+
}
|
|
13036
13418
|
if (this.listOfActions.some(action => action == '/register')) {
|
|
13037
13419
|
if (this.listOfActions.some(action => action == '/generate-2FA-code/Generate2FACode')) {
|
|
13038
13420
|
this.extraActions.push('2fa');
|
|
@@ -13079,7 +13461,7 @@ const GeneralRegistration = class {
|
|
|
13079
13461
|
setRegister() {
|
|
13080
13462
|
this.isLoading = true;
|
|
13081
13463
|
this.registerErrors = false;
|
|
13082
|
-
const url = new URL(
|
|
13464
|
+
const url = new URL('v1/player/legislation/register/', this.endpoint);
|
|
13083
13465
|
const headers = new Headers();
|
|
13084
13466
|
headers.append('Content-Type', 'application/json');
|
|
13085
13467
|
headers.append('Accept', 'application/json');
|
|
@@ -13135,7 +13517,6 @@ const GeneralRegistration = class {
|
|
|
13135
13517
|
});
|
|
13136
13518
|
}
|
|
13137
13519
|
formatConfig(config) {
|
|
13138
|
-
// Populate the list of inputs
|
|
13139
13520
|
this.listOfInputs = config.content.fields.flatMap((field) => {
|
|
13140
13521
|
// Special case for inputs that need to be duplicated.
|
|
13141
13522
|
const duplicateInputRule = field.validate.custom.find(customRule => customRule.rule === 'duplicate-input');
|
|
@@ -13300,12 +13681,12 @@ const GeneralRegistration = class {
|
|
|
13300
13681
|
renderForm() {
|
|
13301
13682
|
return this.forms.map((form, index$1) => {
|
|
13302
13683
|
return index.h("form", { action: '.', id: `RegistrationForm${this.registrationStep}`, class: `registration__form ${this.registrationStep !== `Step${index$1 + 1}` ? 'hidden' : ''}`, ref: el => this.form = el, onClick: this.handleInitialClick }, form[this.registrationStep] && form[this.registrationStep].map((input) => {
|
|
13303
|
-
var _a;
|
|
13684
|
+
var _a, _b;
|
|
13304
13685
|
return index.h("div", { key: input.name, class: "input-wrapper" }, index.h("general-input", { type: input.inputType, name: input.name, displayName: input.displayName, validation: input.validate, action: input.action || null, options: input.data
|
|
13305
13686
|
? (input.inputType.toLowerCase() === 'checkboxgroup' || input.inputType.toLowerCase() === 'togglecheckbox')
|
|
13306
13687
|
? input.data.subFields
|
|
13307
13688
|
: input.data.values
|
|
13308
|
-
: [], 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,
|
|
13689
|
+
: [], 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, "date-format": this.dateFormat, "twofa-destination": this.twofaDestination, "twofa-resend-interval-seconds": (_a = input.customInfo) === null || _a === void 0 ? void 0 : _a.twofaResendIntervalSeconds, "translation-url": this.translationUrl, emitOnClick: this.emitOnClick, onClick: this.handleInitialClick }), ((_b = input.customInfo) === null || _b === void 0 ? void 0 : _b.description) && (index.h("div", { class: "input-description" }, input.customInfo.description)));
|
|
13309
13690
|
}), this.isConsentReady && this.renderConsents(), this.buttonInsideForm && this.renderButtons(), index.h("div", { class: 'registration__wrapper--flex' }, index.h("p", { class: 'registration__error-message', innerHTML: this.errorMessage })));
|
|
13310
13691
|
});
|
|
13311
13692
|
}
|
|
@@ -14492,6 +14873,222 @@ const ToggleCheckboxInput = class {
|
|
|
14492
14873
|
};
|
|
14493
14874
|
ToggleCheckboxInput.style = ToggleCheckboxInputStyle0;
|
|
14494
14875
|
|
|
14876
|
+
const twofaInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.twofa{display:flex;flex-direction:column;gap:10px}.twofa__description{display:flex;flex-direction:column;gap:10px;align-items:center;justify-content:center}.twofa__error-message{text-align:center;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.twofa__input-wrapper{display:flex;justify-content:center}.twofa__input-wrapper input{width:35px;height:35px;padding:10px;text-align:center;border-radius:var(--emw--border-radius-small, 5px);margin-left:5px;margin-right:5px;border:2px solid var(--emw--otp-border-color, #55525c);font-weight:var(--emw-font-weight-bold, 800);outline:none;transition:all 0.1s}.twofa__input-wrapper input:focus{border:2px solid var(--emw--color-primary, #22B04E);box-shadow:0 0 2px 2px var(--emw--color-primary, #22B04E)}.twofa__button-wrapper{justify-content:center;text-align:center}.twofa__button-wrapper button{border:none;background:none;font-weight:var(--emw-font-weight-bold, 800);color:var(--emw--color-primary, #22B04E);cursor:pointer}";
|
|
14877
|
+
const TwofaInputStyle0 = twofaInputCss;
|
|
14878
|
+
|
|
14879
|
+
const TwofaInput = class {
|
|
14880
|
+
constructor(hostRef) {
|
|
14881
|
+
index.registerInstance(this, hostRef);
|
|
14882
|
+
this.sendValidityState = index.createEvent(this, "sendValidityState", 7);
|
|
14883
|
+
this.sendInputValue = index.createEvent(this, "sendInputValue", 7);
|
|
14884
|
+
this.resendCode = index.createEvent(this, "resendCode", 7);
|
|
14885
|
+
this.validationPattern = '';
|
|
14886
|
+
this.stylingContainer = null;
|
|
14887
|
+
this.tooltipReference = null;
|
|
14888
|
+
this.tooltipIconReference = null;
|
|
14889
|
+
this.inputRefs = [];
|
|
14890
|
+
this.containerRef = null;
|
|
14891
|
+
this.resendInterval = null;
|
|
14892
|
+
this.resendCodeHandler = () => {
|
|
14893
|
+
this.triggerResendInterval();
|
|
14894
|
+
this.resendCode.emit();
|
|
14895
|
+
};
|
|
14896
|
+
this.setInputRef = (el, idx) => {
|
|
14897
|
+
if (el) {
|
|
14898
|
+
this.inputRefs[idx] = el;
|
|
14899
|
+
}
|
|
14900
|
+
};
|
|
14901
|
+
this.setContainerRef = (el) => {
|
|
14902
|
+
if (el) {
|
|
14903
|
+
this.containerRef = el;
|
|
14904
|
+
}
|
|
14905
|
+
};
|
|
14906
|
+
this.triggerResendInterval = () => {
|
|
14907
|
+
this.isResendButtonAvailable = false;
|
|
14908
|
+
if (this.resendInterval) {
|
|
14909
|
+
clearInterval(this.resendInterval);
|
|
14910
|
+
}
|
|
14911
|
+
this.resendInterval = setInterval(() => {
|
|
14912
|
+
if (--this.resendIntervalSecondsLeft <= 0) {
|
|
14913
|
+
clearInterval(this.resendInterval);
|
|
14914
|
+
this.resendIntervalSecondsLeft = this.resendIntervalSeconds;
|
|
14915
|
+
this.isResendButtonAvailable = true;
|
|
14916
|
+
}
|
|
14917
|
+
}, 1000);
|
|
14918
|
+
};
|
|
14919
|
+
this.formatTime = () => {
|
|
14920
|
+
const minutes = String(Math.floor(this.resendIntervalSecondsLeft / 60));
|
|
14921
|
+
let seconds = String(this.resendIntervalSecondsLeft % 60);
|
|
14922
|
+
if (seconds.length === 1) {
|
|
14923
|
+
seconds = '0' + seconds;
|
|
14924
|
+
}
|
|
14925
|
+
return `${minutes}:${seconds}`;
|
|
14926
|
+
};
|
|
14927
|
+
this.handleInput = (e, idx) => {
|
|
14928
|
+
const input = e.target;
|
|
14929
|
+
const value = input.value;
|
|
14930
|
+
if (value.length > 1) {
|
|
14931
|
+
input.value = value.charAt(1);
|
|
14932
|
+
}
|
|
14933
|
+
else {
|
|
14934
|
+
input.value = value.charAt(0);
|
|
14935
|
+
}
|
|
14936
|
+
if (!value) {
|
|
14937
|
+
return;
|
|
14938
|
+
}
|
|
14939
|
+
this.code[idx] = input.value;
|
|
14940
|
+
const nextInput = this.inputRefs[idx + 1];
|
|
14941
|
+
if (nextInput) {
|
|
14942
|
+
nextInput.focus();
|
|
14943
|
+
}
|
|
14944
|
+
this.setValidity();
|
|
14945
|
+
this.setErrorMessage();
|
|
14946
|
+
};
|
|
14947
|
+
this.setClientStyling = () => {
|
|
14948
|
+
let sheet = document.createElement('style');
|
|
14949
|
+
sheet.innerHTML = this.clientStyling;
|
|
14950
|
+
this.stylingContainer.prepend(sheet);
|
|
14951
|
+
};
|
|
14952
|
+
this.name = '';
|
|
14953
|
+
this.displayName = '';
|
|
14954
|
+
this.placeholder = '';
|
|
14955
|
+
this.validation = undefined;
|
|
14956
|
+
this.tooltip = '';
|
|
14957
|
+
this.language = 'en';
|
|
14958
|
+
this.emitValue = true;
|
|
14959
|
+
this.destination = '';
|
|
14960
|
+
this.resendIntervalSeconds = 60;
|
|
14961
|
+
this.clientStyling = '';
|
|
14962
|
+
this.limitStylingAppends = false;
|
|
14963
|
+
this.isValid = false;
|
|
14964
|
+
this.isResendButtonAvailable = true;
|
|
14965
|
+
this.showTooltip = false;
|
|
14966
|
+
this.errorMessage = '';
|
|
14967
|
+
this.code = [];
|
|
14968
|
+
this.resendIntervalSecondsLeft = this.resendIntervalSeconds;
|
|
14969
|
+
}
|
|
14970
|
+
handleStylingChange(newValue, oldValue) {
|
|
14971
|
+
if (newValue !== oldValue)
|
|
14972
|
+
this.setClientStyling();
|
|
14973
|
+
}
|
|
14974
|
+
validityChanged() {
|
|
14975
|
+
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
14976
|
+
if (this.emitValue == true) {
|
|
14977
|
+
this.valueHandler({ name: this.name, value: this.code.join('') });
|
|
14978
|
+
}
|
|
14979
|
+
}
|
|
14980
|
+
emitValueHandler(newValue) {
|
|
14981
|
+
if (newValue == true && this.isValid) {
|
|
14982
|
+
this.valueHandler({ name: this.name, value: this.code.join('') });
|
|
14983
|
+
}
|
|
14984
|
+
}
|
|
14985
|
+
validityStateHandler(inputStateEvent) {
|
|
14986
|
+
this.sendValidityState.emit(inputStateEvent);
|
|
14987
|
+
}
|
|
14988
|
+
valueHandler(inputValueEvent) {
|
|
14989
|
+
this.sendInputValue.emit(inputValueEvent);
|
|
14990
|
+
}
|
|
14991
|
+
handleClickOutside(event) {
|
|
14992
|
+
if (event.composedPath()[0] === this.tooltipIconReference)
|
|
14993
|
+
return;
|
|
14994
|
+
if (event.composedPath()[0] !== this.tooltipReference)
|
|
14995
|
+
this.showTooltip = false;
|
|
14996
|
+
}
|
|
14997
|
+
connectedCallback() {
|
|
14998
|
+
this.validationPattern = this.setPattern();
|
|
14999
|
+
this.code = new Array(this.validation.maxLength).fill('');
|
|
15000
|
+
}
|
|
15001
|
+
componentDidRender() {
|
|
15002
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
15003
|
+
if (this.clientStyling) {
|
|
15004
|
+
this.setClientStyling();
|
|
15005
|
+
}
|
|
15006
|
+
this.limitStylingAppends = true;
|
|
15007
|
+
}
|
|
15008
|
+
}
|
|
15009
|
+
componentDidLoad() {
|
|
15010
|
+
this.setValidity();
|
|
15011
|
+
}
|
|
15012
|
+
handleKeyDown(e, idx) {
|
|
15013
|
+
if (e.key === 'Backspace') {
|
|
15014
|
+
this.code[idx] = '';
|
|
15015
|
+
if (this.inputRefs[idx]) {
|
|
15016
|
+
this.inputRefs[idx].value = '';
|
|
15017
|
+
} // Clear input field
|
|
15018
|
+
const prevInput = this.inputRefs[idx - 1];
|
|
15019
|
+
if (prevInput) {
|
|
15020
|
+
prevInput === null || prevInput === void 0 ? void 0 : prevInput.focus();
|
|
15021
|
+
}
|
|
15022
|
+
}
|
|
15023
|
+
this.setValidity();
|
|
15024
|
+
this.setErrorMessage();
|
|
15025
|
+
}
|
|
15026
|
+
handlePaste(e) {
|
|
15027
|
+
var _a;
|
|
15028
|
+
e.preventDefault();
|
|
15029
|
+
const data = (_a = e.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('text').trim();
|
|
15030
|
+
if (!data) {
|
|
15031
|
+
return;
|
|
15032
|
+
}
|
|
15033
|
+
const value = data.slice(0, this.validation.maxLength).split(''); // Limit to OTP length
|
|
15034
|
+
this.code = [...value, ...new Array(this.validation.maxLength - value.length).fill('')];
|
|
15035
|
+
value.forEach((char, index) => {
|
|
15036
|
+
this.inputRefs[index].value = char;
|
|
15037
|
+
});
|
|
15038
|
+
// Move focus to the last input or trigger submit
|
|
15039
|
+
const lastInput = this.inputRefs[Math.min(value.length, this.inputRefs.length - 1)];
|
|
15040
|
+
if (lastInput) {
|
|
15041
|
+
lastInput.focus();
|
|
15042
|
+
}
|
|
15043
|
+
this.setValidity();
|
|
15044
|
+
this.setErrorMessage();
|
|
15045
|
+
}
|
|
15046
|
+
setValidity() {
|
|
15047
|
+
const code = this.code.join('');
|
|
15048
|
+
const inputMatchLength = code.length === this.validation.maxLength;
|
|
15049
|
+
const inputMatchValidation = code.match(this.validationPattern) !== null;
|
|
15050
|
+
this.isValid = inputMatchLength && inputMatchValidation;
|
|
15051
|
+
}
|
|
15052
|
+
setPattern() {
|
|
15053
|
+
var _a, _b;
|
|
15054
|
+
if (((_a = this.validation.custom) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
15055
|
+
return (_b = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _b === void 0 ? void 0 : _b.pattern;
|
|
15056
|
+
}
|
|
15057
|
+
}
|
|
15058
|
+
setErrorMessage() {
|
|
15059
|
+
var _a;
|
|
15060
|
+
const inputMatchValidation = this.code.join('').match(this.validationPattern) !== null;
|
|
15061
|
+
if (!inputMatchValidation) {
|
|
15062
|
+
const errorKey = (_a = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _a === void 0 ? void 0 : _a.errorKey;
|
|
15063
|
+
if (errorKey) {
|
|
15064
|
+
this.errorMessage = translate$1(errorKey, this.language);
|
|
15065
|
+
}
|
|
15066
|
+
}
|
|
15067
|
+
else {
|
|
15068
|
+
this.errorMessage = '';
|
|
15069
|
+
}
|
|
15070
|
+
}
|
|
15071
|
+
renderTooltip() {
|
|
15072
|
+
if (this.showTooltip) {
|
|
15073
|
+
return index.h("div", { class: `text__tooltip ${this.showTooltip ? 'visible' : ''}`, ref: (el) => this.tooltipReference = el, innerHTML: this.tooltip });
|
|
15074
|
+
}
|
|
15075
|
+
return null;
|
|
15076
|
+
}
|
|
15077
|
+
render() {
|
|
15078
|
+
return (index.h("div", { key: 'cc140f18806c0cc8e4ff614a1a3448dbca667fa7', class: "twofa" }, index.h("div", { key: 'fc3b603e1d1a7187417301dfebe80dabfd8cda67', class: 'twofa__error-message' }, index.h("p", { key: '60e2cff194ec862de20aa443864861d784b8dc01' }, this.errorMessage)), index.h("div", { key: '244505408204938069dca1f60dbe051716f66f85', class: "twofa__description", innerHTML: translate$1('twofaDescription', this.language, { values: { destination: this.destination } }) }), index.h("div", { key: 'acb6b8e1676a884d1c7ceced800f6ba3a2e80bc7', class: "twofa__input-wrapper", ref: this.setContainerRef }, this.code.map((char, idx) => {
|
|
15079
|
+
return (index.h("input", { key: idx, ref: el => this.setInputRef(el, idx), id: `otp-input-${idx}`, type: "text", maxLength: 2, value: char, onInput: (event) => this.handleInput(event, idx), onKeyDown: (event) => this.handleKeyDown(event, idx), onPaste: (event) => this.handlePaste(event) }));
|
|
15080
|
+
})), index.h("div", { key: '446eba5a8fe3fb0ede66869642d395bac9c6b8d6', class: "twofa__button-wrapper" }, index.h("p", { key: '9f205fd87920d866d49eb98b2a8ab6f3764fd274', class: "twofa__resend-message" }, translate$1('twofaResendMessage', this.language)), index.h("button", { key: 'efd2294b1d85a78c0d65262cc2004b5e63a898ab', class: "twofa__resend-button", onClick: this.resendCodeHandler, disabled: !this.isResendButtonAvailable }, this.isResendButtonAvailable
|
|
15081
|
+
? translate$1('twofaResendButton', this.language)
|
|
15082
|
+
: this.formatTime()))));
|
|
15083
|
+
}
|
|
15084
|
+
static get watchers() { return {
|
|
15085
|
+
"clientStyling": ["handleStylingChange"],
|
|
15086
|
+
"isValid": ["validityChanged"],
|
|
15087
|
+
"emitValue": ["emitValueHandler"]
|
|
15088
|
+
}; }
|
|
15089
|
+
};
|
|
15090
|
+
TwofaInput.style = TwofaInputStyle0;
|
|
15091
|
+
|
|
14495
15092
|
exports.checkbox_group_input = CheckboxGroupInput;
|
|
14496
15093
|
exports.checkbox_input = CheckboxInput;
|
|
14497
15094
|
exports.date_input = DateInput;
|
|
@@ -14505,3 +15102,4 @@ exports.select_input = SelectInput;
|
|
|
14505
15102
|
exports.tel_input = TelInput;
|
|
14506
15103
|
exports.text_input = TextInput;
|
|
14507
15104
|
exports.toggle_checkbox_input = ToggleCheckboxInput;
|
|
15105
|
+
exports.twofa_input = TwofaInput;
|