@everymatrix/user-login 1.31.2 → 1.32.4
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/LICENSE +21 -0
- package/package.json +4 -3
- package/dist/cjs/index-c277c06d.js +0 -1229
- package/dist/cjs/index.cjs.js +0 -2
- package/dist/cjs/loader.cjs.js +0 -21
- package/dist/cjs/user-login.cjs.entry.js +0 -326
- package/dist/cjs/user-login.cjs.js +0 -19
- package/dist/collection/collection-manifest.json +0 -12
- package/dist/collection/components/user-login/user-login.css +0 -162
- package/dist/collection/components/user-login/user-login.js +0 -440
- package/dist/collection/index.js +0 -1
- package/dist/collection/utils/locale.utils.js +0 -102
- package/dist/collection/utils/utils.js +0 -3
- package/dist/components/index.d.ts +0 -26
- package/dist/components/index.js +0 -1
- package/dist/components/user-login.d.ts +0 -11
- package/dist/components/user-login.js +0 -359
- package/dist/esm/index-adf399de.js +0 -1204
- package/dist/esm/index.js +0 -1
- package/dist/esm/loader.js +0 -17
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/user-login.entry.js +0 -322
- package/dist/esm/user-login.js +0 -17
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/stencil.config.js +0 -22
- package/dist/types/Users/dragos.bodea/Documents/everymatrix-prjs/emfe-widgets/widgets-stencil/packages/user-login/.stencil/packages/user-login/stencil.config.d.ts +0 -2
- package/dist/types/components/user-login/user-login.d.ts +0 -78
- package/dist/types/components.d.ts +0 -117
- package/dist/types/index.d.ts +0 -1
- package/dist/types/stencil-public-runtime.d.ts +0 -1565
- package/dist/types/utils/locale.utils.d.ts +0 -2
- package/dist/types/utils/utils.d.ts +0 -1
- package/dist/user-login/index.esm.js +0 -0
- package/dist/user-login/p-05867322.entry.js +0 -1
- package/dist/user-login/p-f775dfb7.js +0 -1
- package/dist/user-login/user-login.esm.js +0 -1
- package/loader/cdn.js +0 -3
- package/loader/index.cjs.js +0 -3
- package/loader/index.d.ts +0 -12
- package/loader/index.es2017.js +0 -3
- package/loader/index.js +0 -4
- package/loader/package.json +0 -10
|
@@ -1,322 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-adf399de.js';
|
|
2
|
-
|
|
3
|
-
const DEFAULT_LANGUAGE = 'en';
|
|
4
|
-
const SUPPORTED_LANGUAGES = ['ro', 'en', 'cz', 'de', 'hr'];
|
|
5
|
-
const TRANSLATIONS = {
|
|
6
|
-
en: {
|
|
7
|
-
invalidField: 'This field is invalid',
|
|
8
|
-
forgotPassword: 'Forgot Password',
|
|
9
|
-
userEmail: 'Username or Email',
|
|
10
|
-
password: 'Password',
|
|
11
|
-
login: 'Login',
|
|
12
|
-
genericError: 'An unexpected error has occured',
|
|
13
|
-
successMessage: 'Login successful'
|
|
14
|
-
},
|
|
15
|
-
ro: {
|
|
16
|
-
invalidField: 'This field is invalid',
|
|
17
|
-
forgotPassword: 'Forgot Password',
|
|
18
|
-
userEmail: 'Username or Email',
|
|
19
|
-
password: 'Password',
|
|
20
|
-
login: 'Login',
|
|
21
|
-
genericError: 'An unexpected error has occured',
|
|
22
|
-
successMessage: 'Login successful'
|
|
23
|
-
},
|
|
24
|
-
hr: {
|
|
25
|
-
invalidField: 'Ovo polje je nevažeće',
|
|
26
|
-
forgotPassword: 'Zaboravljena lozinka',
|
|
27
|
-
userEmail: 'Korisničko ime ili email',
|
|
28
|
-
password: 'Lozinka',
|
|
29
|
-
login: 'Prijava',
|
|
30
|
-
genericError: 'Došlo je do neočekivane pogreške',
|
|
31
|
-
successMessage: 'Prijava uspješna'
|
|
32
|
-
},
|
|
33
|
-
fr: {
|
|
34
|
-
invalidField: 'This field is invalid',
|
|
35
|
-
forgotPassword: 'Forgot Password',
|
|
36
|
-
userEmail: 'Username or Email',
|
|
37
|
-
password: 'Password',
|
|
38
|
-
login: 'Login',
|
|
39
|
-
genericError: 'An unexpected error has occured',
|
|
40
|
-
successMessage: 'Login successful'
|
|
41
|
-
},
|
|
42
|
-
cs: {
|
|
43
|
-
invalidField: 'Ovo polje je nevažeće.',
|
|
44
|
-
forgotPassword: 'Zaboravio sam lozinku ',
|
|
45
|
-
userEmail: 'Korisničko ime ili email',
|
|
46
|
-
password: 'Lozinka',
|
|
47
|
-
login: 'Prijava',
|
|
48
|
-
genericError: 'An unexpected error has occured',
|
|
49
|
-
successMessage: 'Login successful'
|
|
50
|
-
},
|
|
51
|
-
de: {
|
|
52
|
-
invalidField: 'This field is invalid',
|
|
53
|
-
forgotPassword: 'Forgot Password',
|
|
54
|
-
userEmail: 'Username or Email',
|
|
55
|
-
password: 'Password',
|
|
56
|
-
login: 'Login',
|
|
57
|
-
genericError: 'An unexpected error has occured',
|
|
58
|
-
successMessage: 'Login successful'
|
|
59
|
-
},
|
|
60
|
-
'pt-br': {
|
|
61
|
-
'invalidField': 'O campo é inválido',
|
|
62
|
-
'forgotPassword': 'Esqueceu sua senha',
|
|
63
|
-
'userEmail': 'Usuário ou e-mail',
|
|
64
|
-
'Password': 'Senha',
|
|
65
|
-
'login': 'Entrem',
|
|
66
|
-
'genericError': 'Ocorreu um erro inesperado',
|
|
67
|
-
'successMessage': 'Você fez login com sucesso'
|
|
68
|
-
},
|
|
69
|
-
'es-mx': {
|
|
70
|
-
'invalidField': 'El campo es inválido',
|
|
71
|
-
'forgotPassword': 'Olvidó contraseña',
|
|
72
|
-
'userEmail': 'Usuario o Correo Electrónico',
|
|
73
|
-
'Password': 'Contraseña',
|
|
74
|
-
'login': 'Entrar',
|
|
75
|
-
'genericError': 'Ha ocurrido un error inesperado',
|
|
76
|
-
'successMessage': 'Ha ingreasado de forma exitosa'
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
const getTranslations = (url) => {
|
|
80
|
-
// fetch url, get the data, replace the TRANSLATIONS content
|
|
81
|
-
return new Promise((resolve) => {
|
|
82
|
-
fetch(url)
|
|
83
|
-
.then((res) => res.json())
|
|
84
|
-
.then((data) => {
|
|
85
|
-
Object.keys(data).forEach((item) => {
|
|
86
|
-
for (let key in data[item]) {
|
|
87
|
-
TRANSLATIONS[item][key] = data[item][key];
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
resolve(true);
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
};
|
|
94
|
-
const translate = (key, customLang, values) => {
|
|
95
|
-
const lang = customLang;
|
|
96
|
-
let translation = TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
97
|
-
if (values !== undefined) {
|
|
98
|
-
for (const [key, value] of Object.entries(values.values)) {
|
|
99
|
-
const regex = new RegExp(`{${key}}`, 'g');
|
|
100
|
-
translation = translation.replace(regex, value);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
return translation;
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
const userLoginCss = ":host{display:block;font-family:\"Roboto\", sans-serif}section{height:100%;width:100%;background-position:center;background-size:cover}.FormBox{height:100%;display:flex;position:relative;background:none;border:none;backdrop-filter:blur(15px) brightness(80%);justify-content:center;align-items:center}.InputBox{position:relative;margin:30px 0;width:310px;border-bottom:2px solid #0797B9}.InputBox.InputInvalidBox::after{content:\"\";height:2px;width:100%;transition:width 0.6s linear;background:#C23135}.InputBox::after{content:\"\";display:block;width:0;height:2px;position:relative;top:2px}.InputBox .PasswordVisibilityIcon{fill:#0797B9}.InputBox .InputIcon .TogglePasswordVisibility{cursor:pointer;position:absolute;top:18px;right:0}.InputBox .InputIcon .TogglePasswordVisibility.PasswordVisible{top:19.5px}.InputBox label{position:absolute;top:50%;left:5px;transform:translateY(-50%);color:#0797B9;font-size:1em;pointer-events:none;transition:0.5s}.InputBox label.FieldInvalid{color:#C23135}.InputBox input{width:100%;height:50px;background:transparent;border:none;outline:none;font-size:1em;padding:0 35px 0 5px;color:#fff;box-sizing:border-box}input:focus~label,label.FieldFilledIn{top:-3px;font-size:0.7em}.ForgotPassword button{margin:-10px 0 17px;font-size:0.9em;color:#0797B9;display:flex;justify-content:space-between;background-color:transparent;padding:0;height:unset;border:0;cursor:pointer}.ForgotPassword button:hover{color:#fff}.SubmitCredentials{display:block;margin:0 auto;padding:10px 20px;border-radius:5px;color:var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));background:linear-gradient(to right, #EA0C66, #77318F);border:none;outline:none;cursor:pointer;font-size:1em}.SubmitCredentials:disabled{background:#707070}.Register{font-size:0.9em;color:#fff;text-align:center;margin:25px 0 10px}.Register p a{text-decoration:none;color:#fff;font-weight:600}.Register p a:hover{text-decoration:underline}.InvalidField{position:absolute;top:45px;color:#C23135;font-size:0.7em}.SubmitCredentials{margin-bottom:20px}.CredentialsError{color:#C23135;font-size:0.7em;padding:0 0 20px 0;margin:0}@media screen and (max-width: 480px){.FormBox{width:100%;border-radius:0px}}";
|
|
107
|
-
|
|
108
|
-
const UserLogin = class {
|
|
109
|
-
constructor(hostRef) {
|
|
110
|
-
registerInstance(this, hostRef);
|
|
111
|
-
/**
|
|
112
|
-
* Endpoint
|
|
113
|
-
*/
|
|
114
|
-
this.endpoint = '';
|
|
115
|
-
/**
|
|
116
|
-
* Language
|
|
117
|
-
*/
|
|
118
|
-
this.lang = 'en';
|
|
119
|
-
/**
|
|
120
|
-
* Client styling
|
|
121
|
-
*/
|
|
122
|
-
this.clientStyling = '';
|
|
123
|
-
/**
|
|
124
|
-
* Client styling by url
|
|
125
|
-
*/
|
|
126
|
-
this.clientStylingUrl = '';
|
|
127
|
-
/**
|
|
128
|
-
* Translation url
|
|
129
|
-
*/
|
|
130
|
-
this.translationUrl = '';
|
|
131
|
-
/**
|
|
132
|
-
* Password reset
|
|
133
|
-
*/
|
|
134
|
-
this.passwordReset = 'false';
|
|
135
|
-
/**
|
|
136
|
-
* User email regex options
|
|
137
|
-
*/
|
|
138
|
-
this.userEmailRegexOptions = 'i';
|
|
139
|
-
/**
|
|
140
|
-
* Password regex options
|
|
141
|
-
*/
|
|
142
|
-
this.passwordRegexOptions = '';
|
|
143
|
-
/**
|
|
144
|
-
* Username
|
|
145
|
-
*/
|
|
146
|
-
this.userNameEmail = '';
|
|
147
|
-
/**
|
|
148
|
-
* Password
|
|
149
|
-
*/
|
|
150
|
-
this.userPassword = '';
|
|
151
|
-
this.isValidUserEmail = true;
|
|
152
|
-
this.isValidPassword = true;
|
|
153
|
-
this.isPasswordVisible = false;
|
|
154
|
-
this.limitStylingAppends = false;
|
|
155
|
-
this.errorMessage = '';
|
|
156
|
-
this.hasError = false;
|
|
157
|
-
this.setClientStyling = () => {
|
|
158
|
-
let sheet = document.createElement('style');
|
|
159
|
-
sheet.innerHTML = this.clientStyling;
|
|
160
|
-
this.stylingContainer.appendChild(sheet);
|
|
161
|
-
};
|
|
162
|
-
this.setClientStylingURL = () => {
|
|
163
|
-
let url = new URL(this.clientStylingUrl);
|
|
164
|
-
let cssFile = document.createElement('style');
|
|
165
|
-
fetch(url.href)
|
|
166
|
-
.then((res) => res.text())
|
|
167
|
-
.then((data) => {
|
|
168
|
-
cssFile.innerHTML = data;
|
|
169
|
-
setTimeout(() => { this.stylingContainer.appendChild(cssFile); }, 1);
|
|
170
|
-
});
|
|
171
|
-
};
|
|
172
|
-
this.messageHandler = (e) => {
|
|
173
|
-
switch (e.data.type) {
|
|
174
|
-
case 'SendLoginCredentials':
|
|
175
|
-
this.userNameEmail = e.data.data.userNameEmail;
|
|
176
|
-
this.userPassword = e.data.data.userPassword;
|
|
177
|
-
this.userLogin({
|
|
178
|
-
username: this.userNameEmail,
|
|
179
|
-
password: this.userPassword
|
|
180
|
-
});
|
|
181
|
-
break;
|
|
182
|
-
}
|
|
183
|
-
};
|
|
184
|
-
this.userLogin = async ({ username, password }) => {
|
|
185
|
-
let headers = {
|
|
186
|
-
'Content-Type': 'application/json'
|
|
187
|
-
};
|
|
188
|
-
let bodyData = {
|
|
189
|
-
username,
|
|
190
|
-
password
|
|
191
|
-
};
|
|
192
|
-
let options = {
|
|
193
|
-
method: 'POST',
|
|
194
|
-
headers,
|
|
195
|
-
body: JSON.stringify(bodyData),
|
|
196
|
-
};
|
|
197
|
-
fetch(`${this.endpoint}/v1/player/legislation/login`, options)
|
|
198
|
-
.then((res) => {
|
|
199
|
-
return res.json();
|
|
200
|
-
}).then((data) => {
|
|
201
|
-
var _a, _b;
|
|
202
|
-
if ((_a = data.sessionBlockers) === null || _a === void 0 ? void 0 : _a.includes('has-to-set-consents')) {
|
|
203
|
-
window.postMessage({ type: 'PlayerActions', gmversion: 'gm16' }, window.location.href);
|
|
204
|
-
}
|
|
205
|
-
if ((data === null || data === void 0 ? void 0 : data.hasToSetPass) === true) {
|
|
206
|
-
window.postMessage({ type: 'HasToSetPass' }, window.location.href);
|
|
207
|
-
}
|
|
208
|
-
if (data.sessionId) {
|
|
209
|
-
window.postMessage({ type: 'UserSessionID', session: data.sessionId, userid: data.userId }, window.location.href);
|
|
210
|
-
window.postMessage({ type: 'WidgetNotification', data: {
|
|
211
|
-
type: 'success',
|
|
212
|
-
message: translate('successMessage', this.lang)
|
|
213
|
-
} }, window.location.href);
|
|
214
|
-
this.hasError = false;
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
// handles errors thrown by api
|
|
218
|
-
this.hasError = true;
|
|
219
|
-
this.errorMessage = (_b = data === null || data === void 0 ? void 0 : data.thirdPartyResponse) === null || _b === void 0 ? void 0 : _b.message;
|
|
220
|
-
if (this.errorMessage) {
|
|
221
|
-
console.error(this.errorMessage);
|
|
222
|
-
this.sendErrorNotification(this.errorMessage);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}).catch((err) => {
|
|
226
|
-
// handles unexpected errors
|
|
227
|
-
console.error(err);
|
|
228
|
-
this.hasError = true;
|
|
229
|
-
this.errorMessage = translate('genericError', this.lang);
|
|
230
|
-
this.sendErrorNotification(this.errorMessage);
|
|
231
|
-
});
|
|
232
|
-
};
|
|
233
|
-
this.debouncedUserLogin = this.debounce(this.userLogin, 850);
|
|
234
|
-
this.handleLogin = () => {
|
|
235
|
-
this.debouncedUserLogin({
|
|
236
|
-
username: this.userNameEmail,
|
|
237
|
-
password: this.userPassword
|
|
238
|
-
});
|
|
239
|
-
};
|
|
240
|
-
this.handleInputChange = (event, location) => {
|
|
241
|
-
this.hasError = false;
|
|
242
|
-
const inputValue = event.target.value;
|
|
243
|
-
if (location === 'user') {
|
|
244
|
-
this.userNameEmail = inputValue;
|
|
245
|
-
this.isValidUserEmail = this.userEmailValidation(this.userNameEmail);
|
|
246
|
-
}
|
|
247
|
-
else {
|
|
248
|
-
this.userPassword = inputValue;
|
|
249
|
-
this.isValidPassword = this.passwordValidation(inputValue);
|
|
250
|
-
}
|
|
251
|
-
};
|
|
252
|
-
this.userEmailValidation = (input) => {
|
|
253
|
-
const regex = new RegExp(this.userEmailRegex, this.userEmailRegexOptions);
|
|
254
|
-
return regex.test(input);
|
|
255
|
-
};
|
|
256
|
-
this.passwordValidation = (input) => {
|
|
257
|
-
const regex = new RegExp(this.passwordRegex, this.passwordRegexOptions);
|
|
258
|
-
return regex.test(input);
|
|
259
|
-
};
|
|
260
|
-
this.togglePassword = () => {
|
|
261
|
-
this.isPasswordVisible = !this.isPasswordVisible;
|
|
262
|
-
};
|
|
263
|
-
this.resetPassword = () => {
|
|
264
|
-
window.postMessage({ type: "NavForgotPassword" }, window.location.href);
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
|
-
handleNewTranslations() {
|
|
268
|
-
getTranslations(this.translationUrl);
|
|
269
|
-
}
|
|
270
|
-
async componentWillLoad() {
|
|
271
|
-
if (this.translationUrl.length > 2) {
|
|
272
|
-
await getTranslations(this.translationUrl);
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
componentDidLoad() {
|
|
276
|
-
window.addEventListener('message', this.messageHandler);
|
|
277
|
-
}
|
|
278
|
-
componentDidRender() {
|
|
279
|
-
// start custom styling area
|
|
280
|
-
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
281
|
-
if (this.clientStyling)
|
|
282
|
-
this.setClientStyling();
|
|
283
|
-
if (this.clientStylingUrl)
|
|
284
|
-
this.setClientStylingURL();
|
|
285
|
-
this.limitStylingAppends = true;
|
|
286
|
-
}
|
|
287
|
-
// end custom styling area
|
|
288
|
-
}
|
|
289
|
-
sendErrorNotification(errorMessage) {
|
|
290
|
-
window.postMessage({ type: "HasError", error: errorMessage }, window.location.href);
|
|
291
|
-
window.postMessage({ type: 'WidgetNotification', data: {
|
|
292
|
-
type: 'error',
|
|
293
|
-
message: errorMessage
|
|
294
|
-
} }, window.location.href);
|
|
295
|
-
}
|
|
296
|
-
debounce(func, delay) {
|
|
297
|
-
let timer;
|
|
298
|
-
return function (...args) {
|
|
299
|
-
clearTimeout(timer);
|
|
300
|
-
timer = setTimeout(() => {
|
|
301
|
-
func.apply(this, args);
|
|
302
|
-
}, delay);
|
|
303
|
-
};
|
|
304
|
-
}
|
|
305
|
-
render() {
|
|
306
|
-
let visibilityIcon = h("span", { class: "InputIcon" }, this.isPasswordVisible &&
|
|
307
|
-
h("svg", { onClick: () => this.togglePassword(), class: "TogglePasswordVisibility", part: "TogglePasswordVisibility", xmlns: "http://www.w3.org/2000/svg", width: "18.844", height: "12.887", viewBox: "0 0 18.844 12.887" }, h("g", { transform: "translate(-110.856 -23.242)" }, h("circle", { class: "PasswordVisibilityIcon", cx: "0.05", cy: "0.05", r: "0.05", transform: "translate(121.017 31.148)" }), h("g", { transform: "translate(117.499 27.37)" }, h("path", { class: "PasswordVisibilityIcon", d: "M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z", transform: "translate(-142.164 -39.123)" }), h("path", { class: "PasswordVisibilityIcon", d: "M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z", transform: "translate(-136.413 -42.068)" })), h("g", { transform: "translate(110.856 24.899)" }, h("path", { class: "PasswordVisibilityIcon", 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)" }), h("path", { class: "PasswordVisibilityIcon", 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)" })), h("rect", { class: "PasswordVisibilityIcon", width: "0.972", height: "15.861", rx: "0.486", transform: "translate(114.827 23.858) rotate(-39.315)" }))), !this.isPasswordVisible &&
|
|
308
|
-
h("svg", { onClick: () => this.togglePassword(), class: "TogglePasswordVisibility PasswordVisible", part: "TogglePasswordVisibility", xmlns: "http://www.w3.org/2000/svg", width: "18.843", height: "10.5", viewBox: "0 0 18.843 10.5" }, h("g", { transform: "translate(-14.185 -27.832)" }, h("path", { class: "PasswordVisibilityIcon", 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)" }), h("circle", { class: "PasswordVisibilityIcon", cx: "2.779", cy: "2.779", r: "2.779", transform: "translate(20.827 30.303)" }))));
|
|
309
|
-
let userIdentification = h("div", { class: "FormBox" }, h("div", { class: "FormValue" }, h("div", { class: (!this.isValidUserEmail || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox' }, h("input", { type: "text", placeholder: '', value: this.userNameEmail, onFocus: (event) => this.handleInputChange(event, 'user'), onInput: (event) => this.handleInputChange(event, 'user'), required: true }), h("label", { class: (this.userNameEmail ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserEmail || this.hasError ? 'FieldInvalid' : '') }, translate('userEmail', this.lang)), !this.isValidUserEmail &&
|
|
310
|
-
h("p", { class: "InvalidField" }, translate('invalidField', this.lang))), h("div", { class: (!this.isValidPassword || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox' }, visibilityIcon, h("input", { type: this.isPasswordVisible ? "text" : "password", placeholder: '', value: this.userPassword, onFocus: (event) => this.handleInputChange(event, 'password'), onInput: (event) => this.handleInputChange(event, 'password'), required: true }), h("label", { class: (this.userPassword ? 'FieldFilledIn' : '') + ' ' + (!this.isValidPassword || this.hasError ? 'FieldInvalid' : '') }, translate('password', this.lang)), !this.isValidPassword &&
|
|
311
|
-
h("p", { class: "InvalidField" }, translate('invalidField', this.lang))), this.passwordReset == 'true' &&
|
|
312
|
-
h("div", { class: "ForgotPassword" }, h("button", { onClick: () => this.resetPassword() }, translate('forgotPassword', this.lang))), h("button", { disabled: (!this.isValidUserEmail || !this.isValidPassword || !this.userNameEmail || !this.userPassword), class: "SubmitCredentials", onClick: () => this.handleLogin() }, translate('login', this.lang)), this.hasError &&
|
|
313
|
-
h("p", { class: "CredentialsError" }, this.errorMessage ? this.errorMessage : translate('genericError', this.lang))));
|
|
314
|
-
return h("section", { ref: el => this.stylingContainer = el }, userIdentification);
|
|
315
|
-
}
|
|
316
|
-
static get watchers() { return {
|
|
317
|
-
"translationUrl": ["handleNewTranslations"]
|
|
318
|
-
}; }
|
|
319
|
-
};
|
|
320
|
-
UserLogin.style = userLoginCss;
|
|
321
|
-
|
|
322
|
-
export { UserLogin as user_login };
|
package/dist/esm/user-login.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-adf399de.js';
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
5
|
-
*/
|
|
6
|
-
const patchBrowser = () => {
|
|
7
|
-
const importMeta = import.meta.url;
|
|
8
|
-
const opts = {};
|
|
9
|
-
if (importMeta !== '') {
|
|
10
|
-
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
11
|
-
}
|
|
12
|
-
return promiseResolve(opts);
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
patchBrowser().then(options => {
|
|
16
|
-
return bootstrapLazy([["user-login",[[1,"user-login",{"endpoint":[513],"lang":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"passwordReset":[513,"password-reset"],"userEmailRegex":[513,"user-email-regex"],"userEmailRegexOptions":[513,"user-email-regex-options"],"passwordRegex":[513,"password-regex"],"passwordRegexOptions":[513,"password-regex-options"],"userNameEmail":[32],"userPassword":[32],"isValidUserEmail":[32],"isValidPassword":[32],"isPasswordVisible":[32],"limitStylingAppends":[32],"errorMessage":[32],"hasError":[32]}]]]], options);
|
|
17
|
-
});
|
package/dist/index.cjs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('./cjs/index.cjs.js');
|
package/dist/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './esm/index.js';
|
package/dist/stencil.config.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { sass } from '@stencil/sass';
|
|
2
|
-
export const config = {
|
|
3
|
-
namespace: 'user-login',
|
|
4
|
-
taskQueue: 'async',
|
|
5
|
-
plugins: [sass()],
|
|
6
|
-
outputTargets: [
|
|
7
|
-
{
|
|
8
|
-
type: 'dist',
|
|
9
|
-
esmLoaderPath: '../loader',
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
type: 'dist-custom-elements',
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
type: 'docs-readme',
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
type: 'www',
|
|
19
|
-
serviceWorker: null, // disable service workers
|
|
20
|
-
},
|
|
21
|
-
],
|
|
22
|
-
};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
export declare class UserLogin {
|
|
2
|
-
/**
|
|
3
|
-
* Endpoint
|
|
4
|
-
*/
|
|
5
|
-
endpoint: string;
|
|
6
|
-
/**
|
|
7
|
-
* Language
|
|
8
|
-
*/
|
|
9
|
-
lang: string;
|
|
10
|
-
/**
|
|
11
|
-
* Client styling
|
|
12
|
-
*/
|
|
13
|
-
clientStyling: string;
|
|
14
|
-
/**
|
|
15
|
-
* Client styling by url
|
|
16
|
-
*/
|
|
17
|
-
clientStylingUrl: string;
|
|
18
|
-
/**
|
|
19
|
-
* Translation url
|
|
20
|
-
*/
|
|
21
|
-
translationUrl: string;
|
|
22
|
-
/**
|
|
23
|
-
* Password reset
|
|
24
|
-
*/
|
|
25
|
-
passwordReset: string;
|
|
26
|
-
/**
|
|
27
|
-
* User email regex
|
|
28
|
-
*/
|
|
29
|
-
userEmailRegex: string;
|
|
30
|
-
/**
|
|
31
|
-
* User email regex options
|
|
32
|
-
*/
|
|
33
|
-
userEmailRegexOptions: string;
|
|
34
|
-
/**
|
|
35
|
-
* Password regex
|
|
36
|
-
*/
|
|
37
|
-
passwordRegex: string;
|
|
38
|
-
/**
|
|
39
|
-
* Password regex options
|
|
40
|
-
*/
|
|
41
|
-
passwordRegexOptions: string;
|
|
42
|
-
/**
|
|
43
|
-
* Username
|
|
44
|
-
*/
|
|
45
|
-
userNameEmail: string;
|
|
46
|
-
/**
|
|
47
|
-
* Password
|
|
48
|
-
*/
|
|
49
|
-
userPassword: string;
|
|
50
|
-
isValidUserEmail: boolean;
|
|
51
|
-
isValidPassword: boolean;
|
|
52
|
-
isPasswordVisible: boolean;
|
|
53
|
-
private limitStylingAppends;
|
|
54
|
-
private errorMessage;
|
|
55
|
-
private hasError;
|
|
56
|
-
private stylingContainer;
|
|
57
|
-
handleNewTranslations(): void;
|
|
58
|
-
componentWillLoad(): Promise<void>;
|
|
59
|
-
componentDidLoad(): void;
|
|
60
|
-
componentDidRender(): void;
|
|
61
|
-
setClientStyling: () => void;
|
|
62
|
-
setClientStylingURL: () => void;
|
|
63
|
-
messageHandler: (e: any) => void;
|
|
64
|
-
userLogin: ({ username, password }: {
|
|
65
|
-
username: any;
|
|
66
|
-
password: any;
|
|
67
|
-
}) => Promise<any>;
|
|
68
|
-
sendErrorNotification(errorMessage: any): void;
|
|
69
|
-
debounce(func: any, delay: any): (...args: any[]) => void;
|
|
70
|
-
debouncedUserLogin: (...args: any[]) => void;
|
|
71
|
-
handleLogin: () => void;
|
|
72
|
-
handleInputChange: (event: Event, location: string) => void;
|
|
73
|
-
userEmailValidation: (input: any) => boolean;
|
|
74
|
-
passwordValidation: (input: any) => boolean;
|
|
75
|
-
togglePassword: () => void;
|
|
76
|
-
resetPassword: () => void;
|
|
77
|
-
render(): any;
|
|
78
|
-
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
/**
|
|
4
|
-
* This is an autogenerated file created by the Stencil compiler.
|
|
5
|
-
* It contains typing information for all components that exist in this project.
|
|
6
|
-
*/
|
|
7
|
-
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
|
-
export namespace Components {
|
|
9
|
-
interface UserLogin {
|
|
10
|
-
/**
|
|
11
|
-
* Client styling
|
|
12
|
-
*/
|
|
13
|
-
"clientStyling": string;
|
|
14
|
-
/**
|
|
15
|
-
* Client styling by url
|
|
16
|
-
*/
|
|
17
|
-
"clientStylingUrl": string;
|
|
18
|
-
/**
|
|
19
|
-
* Endpoint
|
|
20
|
-
*/
|
|
21
|
-
"endpoint": string;
|
|
22
|
-
/**
|
|
23
|
-
* Language
|
|
24
|
-
*/
|
|
25
|
-
"lang": string;
|
|
26
|
-
/**
|
|
27
|
-
* Password regex
|
|
28
|
-
*/
|
|
29
|
-
"passwordRegex": string;
|
|
30
|
-
/**
|
|
31
|
-
* Password regex options
|
|
32
|
-
*/
|
|
33
|
-
"passwordRegexOptions": string;
|
|
34
|
-
/**
|
|
35
|
-
* Password reset
|
|
36
|
-
*/
|
|
37
|
-
"passwordReset": string;
|
|
38
|
-
/**
|
|
39
|
-
* Translation url
|
|
40
|
-
*/
|
|
41
|
-
"translationUrl": string;
|
|
42
|
-
/**
|
|
43
|
-
* User email regex
|
|
44
|
-
*/
|
|
45
|
-
"userEmailRegex": string;
|
|
46
|
-
/**
|
|
47
|
-
* User email regex options
|
|
48
|
-
*/
|
|
49
|
-
"userEmailRegexOptions": string;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
declare global {
|
|
53
|
-
interface HTMLUserLoginElement extends Components.UserLogin, HTMLStencilElement {
|
|
54
|
-
}
|
|
55
|
-
var HTMLUserLoginElement: {
|
|
56
|
-
prototype: HTMLUserLoginElement;
|
|
57
|
-
new (): HTMLUserLoginElement;
|
|
58
|
-
};
|
|
59
|
-
interface HTMLElementTagNameMap {
|
|
60
|
-
"user-login": HTMLUserLoginElement;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
declare namespace LocalJSX {
|
|
64
|
-
interface UserLogin {
|
|
65
|
-
/**
|
|
66
|
-
* Client styling
|
|
67
|
-
*/
|
|
68
|
-
"clientStyling"?: string;
|
|
69
|
-
/**
|
|
70
|
-
* Client styling by url
|
|
71
|
-
*/
|
|
72
|
-
"clientStylingUrl"?: string;
|
|
73
|
-
/**
|
|
74
|
-
* Endpoint
|
|
75
|
-
*/
|
|
76
|
-
"endpoint"?: string;
|
|
77
|
-
/**
|
|
78
|
-
* Language
|
|
79
|
-
*/
|
|
80
|
-
"lang"?: string;
|
|
81
|
-
/**
|
|
82
|
-
* Password regex
|
|
83
|
-
*/
|
|
84
|
-
"passwordRegex"?: string;
|
|
85
|
-
/**
|
|
86
|
-
* Password regex options
|
|
87
|
-
*/
|
|
88
|
-
"passwordRegexOptions"?: string;
|
|
89
|
-
/**
|
|
90
|
-
* Password reset
|
|
91
|
-
*/
|
|
92
|
-
"passwordReset"?: string;
|
|
93
|
-
/**
|
|
94
|
-
* Translation url
|
|
95
|
-
*/
|
|
96
|
-
"translationUrl"?: string;
|
|
97
|
-
/**
|
|
98
|
-
* User email regex
|
|
99
|
-
*/
|
|
100
|
-
"userEmailRegex"?: string;
|
|
101
|
-
/**
|
|
102
|
-
* User email regex options
|
|
103
|
-
*/
|
|
104
|
-
"userEmailRegexOptions"?: string;
|
|
105
|
-
}
|
|
106
|
-
interface IntrinsicElements {
|
|
107
|
-
"user-login": UserLogin;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
export { LocalJSX as JSX };
|
|
111
|
-
declare module "@stencil/core" {
|
|
112
|
-
export namespace JSX {
|
|
113
|
-
interface IntrinsicElements {
|
|
114
|
-
"user-login": LocalJSX.UserLogin & JSXBase.HTMLAttributes<HTMLUserLoginElement>;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
package/dist/types/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './components';
|