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