@everymatrix/user-login 1.44.0 → 1.45.2
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/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/index-465784fc.js +1240 -0
- package/dist/cjs/loader.cjs.js +7 -13
- package/dist/cjs/user-login.cjs.entry.js +301 -328
- package/dist/cjs/user-login.cjs.js +17 -11
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/components/user-login/index.js +1 -0
- package/dist/collection/components/user-login/user-login.js +397 -443
- package/dist/collection/utils/locale.utils.js +110 -110
- package/dist/collection/utils/utils.js +1 -1
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/index-4e85bfaa.js +1214 -0
- package/dist/esm/loader.js +7 -13
- package/dist/esm/user-login.entry.js +301 -328
- package/dist/esm/user-login.js +14 -11
- package/dist/stencil.config.dev.js +17 -0
- package/dist/stencil.config.js +14 -19
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/user-login/.stencil/packages/stencil/user-login/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/user-login/.stencil/packages/stencil/user-login/stencil.config.dev.d.ts +2 -0
- package/dist/types/components/user-login/index.d.ts +1 -0
- package/dist/types/components/user-login/user-login.d.ts +80 -80
- package/dist/types/stencil-public-runtime.d.ts +142 -33
- package/dist/user-login/p-11519ff0.entry.js +1 -0
- package/dist/user-login/p-a86a26ad.js +2 -0
- package/dist/user-login/p-e1255160.js +1 -0
- package/dist/user-login/user-login.esm.js +1 -1
- package/loader/cdn.js +1 -3
- package/loader/index.cjs.js +1 -3
- package/loader/index.d.ts +13 -1
- package/loader/index.es2017.js +1 -3
- package/loader/index.js +1 -3
- package/loader/package.json +1 -0
- package/package.json +8 -1
- package/dist/cjs/index-5d65f61a.js +0 -1233
- 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 -389
- package/dist/esm/index-20da8fd1.js +0 -1208
- 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/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/user-login/.stencil/packages/user-login/stencil.config.d.ts +0 -2
- package/dist/user-login/p-55726395.js +0 -1
- package/dist/user-login/p-f0b89924.entry.js +0 -1
|
@@ -1,453 +1,407 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getTranslations, translate } from
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { getTranslations, translate } from "../../utils/locale.utils";
|
|
3
3
|
export class UserLogin {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
4
|
+
constructor() {
|
|
5
|
+
this.errorCode = '';
|
|
6
|
+
this.setClientStyling = () => {
|
|
7
|
+
let sheet = document.createElement('style');
|
|
8
|
+
sheet.innerHTML = this.clientStyling;
|
|
9
|
+
this.stylingContainer.appendChild(sheet);
|
|
10
|
+
};
|
|
11
|
+
this.setClientStylingURL = () => {
|
|
12
|
+
let url = new URL(this.clientStylingUrl);
|
|
13
|
+
let cssFile = document.createElement('style');
|
|
14
|
+
fetch(url.href)
|
|
15
|
+
.then((res) => res.text())
|
|
16
|
+
.then((data) => {
|
|
17
|
+
cssFile.innerHTML = data;
|
|
18
|
+
setTimeout(() => { this.stylingContainer.appendChild(cssFile); }, 1);
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
this.autofillCredentialsHandler = (e) => {
|
|
22
|
+
this.userNameEmail = e.detail.userNameEmail;
|
|
23
|
+
this.userPassword = e.detail.userPassword;
|
|
24
|
+
this.handleLogin();
|
|
25
|
+
};
|
|
26
|
+
this.userLogin = async ({ username, password }) => {
|
|
27
|
+
let headers = {
|
|
28
|
+
'Content-Type': 'application/json'
|
|
29
|
+
};
|
|
30
|
+
let bodyData = {
|
|
31
|
+
username,
|
|
32
|
+
password
|
|
33
|
+
};
|
|
34
|
+
let options = {
|
|
35
|
+
method: 'POST',
|
|
36
|
+
headers,
|
|
37
|
+
body: JSON.stringify(bodyData),
|
|
38
|
+
};
|
|
39
|
+
fetch(`${this.endpoint}/v1/player/legislation/login`, options)
|
|
40
|
+
.then((res) => {
|
|
41
|
+
return res.json();
|
|
42
|
+
}).then((data) => {
|
|
43
|
+
var _a, _b, _c;
|
|
44
|
+
if ((_a = data.sessionBlockers) === null || _a === void 0 ? void 0 : _a.includes('has-to-set-consents')) {
|
|
45
|
+
window.postMessage({ type: 'PlayerActions', gmversion: 'gm16' }, window.location.href);
|
|
46
|
+
}
|
|
47
|
+
if ((data === null || data === void 0 ? void 0 : data.hasToSetPass) === true) {
|
|
48
|
+
window.postMessage({ type: 'HasToSetPass' }, window.location.href);
|
|
49
|
+
}
|
|
50
|
+
if (data.sessionId) {
|
|
51
|
+
window.postMessage({ type: 'UserSessionID', session: data.sessionId, userid: data.userId }, window.location.href);
|
|
52
|
+
window.postMessage({ type: 'WidgetNotification', data: {
|
|
53
|
+
type: 'success',
|
|
54
|
+
message: translate('successMessage', this.lang)
|
|
55
|
+
} }, window.location.href);
|
|
56
|
+
this.hasError = false;
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
// handles errors thrown by api
|
|
60
|
+
this.hasError = true;
|
|
61
|
+
this.errorCode = (_b = data === null || data === void 0 ? void 0 : data.thirdPartyResponse) === null || _b === void 0 ? void 0 : _b.errorCode;
|
|
62
|
+
this.errorMessage = translate(`${this.errorCode}`, this.lang) || ((_c = data === null || data === void 0 ? void 0 : data.thirdPartyResponse) === null || _c === void 0 ? void 0 : _c.message) || translate('genericError', this.lang);
|
|
63
|
+
if (this.errorMessage) {
|
|
64
|
+
console.error(this.errorMessage);
|
|
65
|
+
this.sendErrorNotification(this.errorMessage);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}).catch((err) => {
|
|
69
|
+
// handles unexpected errors
|
|
70
|
+
console.error(err);
|
|
71
|
+
this.hasError = true;
|
|
72
|
+
this.errorMessage = translate('genericError', this.lang);
|
|
73
|
+
this.sendErrorNotification(this.errorMessage);
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
this.debouncedUserLogin = this.debounce(this.userLogin, 850);
|
|
77
|
+
this.handleLogin = () => {
|
|
78
|
+
this.debouncedUserLogin({
|
|
79
|
+
username: this.userNameEmail,
|
|
80
|
+
password: this.userPassword
|
|
81
|
+
});
|
|
82
|
+
this.dispatchUpdateLoginCredentialsEvent();
|
|
83
|
+
};
|
|
84
|
+
this.handleInputChange = (event, location) => {
|
|
85
|
+
this.hasError = false;
|
|
86
|
+
const inputValue = event.target.value;
|
|
87
|
+
if (location === 'user') {
|
|
88
|
+
this.userNameEmail = inputValue;
|
|
89
|
+
this.isValidUserEmail = this.userEmailValidation(this.userNameEmail);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
this.userPassword = inputValue;
|
|
93
|
+
this.isValidPassword = this.passwordValidation(inputValue);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
this.userEmailValidation = (input) => {
|
|
97
|
+
const regex = new RegExp(this.userEmailRegex, this.userEmailRegexOptions);
|
|
98
|
+
return regex.test(input);
|
|
99
|
+
};
|
|
100
|
+
this.passwordValidation = (input) => {
|
|
101
|
+
const regex = new RegExp(this.passwordRegex, this.passwordRegexOptions);
|
|
102
|
+
return regex.test(input);
|
|
103
|
+
};
|
|
104
|
+
this.togglePassword = () => {
|
|
105
|
+
this.isPasswordVisible = !this.isPasswordVisible;
|
|
106
|
+
};
|
|
107
|
+
this.resetPassword = () => {
|
|
108
|
+
window.postMessage({ type: "NavForgotPassword" }, window.location.href);
|
|
109
|
+
};
|
|
110
|
+
this.endpoint = '';
|
|
111
|
+
this.lang = 'en';
|
|
112
|
+
this.clientStyling = '';
|
|
113
|
+
this.clientStylingUrl = '';
|
|
114
|
+
this.translationUrl = '';
|
|
115
|
+
this.passwordReset = 'false';
|
|
116
|
+
this.userEmailRegex = undefined;
|
|
117
|
+
this.userEmailRegexOptions = 'i';
|
|
118
|
+
this.passwordRegex = undefined;
|
|
119
|
+
this.passwordRegexOptions = '';
|
|
120
|
+
this.userNameEmail = '';
|
|
121
|
+
this.userPassword = '';
|
|
122
|
+
this.isValidUserEmail = true;
|
|
123
|
+
this.isValidPassword = true;
|
|
124
|
+
this.isPasswordVisible = false;
|
|
125
|
+
this.limitStylingAppends = false;
|
|
126
|
+
this.errorMessage = '';
|
|
127
|
+
this.hasError = false;
|
|
128
|
+
}
|
|
129
|
+
handleNewTranslations() {
|
|
130
|
+
getTranslations(this.translationUrl);
|
|
131
|
+
}
|
|
132
|
+
async componentWillLoad() {
|
|
133
|
+
if (this.translationUrl.length > 2) {
|
|
134
|
+
await getTranslations(this.translationUrl);
|
|
92
135
|
}
|
|
93
|
-
|
|
94
|
-
|
|
136
|
+
}
|
|
137
|
+
componentDidLoad() {
|
|
138
|
+
window.addEventListener('LoginCredentials', this.autofillCredentialsHandler);
|
|
139
|
+
window.postMessage({ type: 'UserLoginDidLoad' });
|
|
140
|
+
}
|
|
141
|
+
componentDidRender() {
|
|
142
|
+
// start custom styling area
|
|
143
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
144
|
+
if (this.clientStyling)
|
|
145
|
+
this.setClientStyling();
|
|
146
|
+
if (this.clientStylingUrl)
|
|
147
|
+
this.setClientStylingURL();
|
|
148
|
+
this.limitStylingAppends = true;
|
|
95
149
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
150
|
+
// end custom styling area
|
|
151
|
+
}
|
|
152
|
+
disconnectedCallback() {
|
|
153
|
+
window.removeEventListener('LoginCredentials', this.autofillCredentialsHandler);
|
|
154
|
+
}
|
|
155
|
+
sendErrorNotification(errorMessage) {
|
|
156
|
+
window.postMessage({ type: "HasError", error: errorMessage }, window.location.href);
|
|
157
|
+
window.postMessage({ type: 'WidgetNotification', data: {
|
|
158
|
+
type: 'error',
|
|
159
|
+
message: errorMessage
|
|
101
160
|
} }, window.location.href);
|
|
102
|
-
this.hasError = false;
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
// handles errors thrown by api
|
|
106
|
-
this.hasError = true;
|
|
107
|
-
this.errorCode = (_b = data === null || data === void 0 ? void 0 : data.thirdPartyResponse) === null || _b === void 0 ? void 0 : _b.errorCode;
|
|
108
|
-
this.errorMessage = translate(`${this.errorCode}`, this.lang) || ((_c = data === null || data === void 0 ? void 0 : data.thirdPartyResponse) === null || _c === void 0 ? void 0 : _c.message) || translate('genericError', this.lang);
|
|
109
|
-
if (this.errorMessage) {
|
|
110
|
-
console.error(this.errorMessage);
|
|
111
|
-
this.sendErrorNotification(this.errorMessage);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}).catch((err) => {
|
|
115
|
-
// handles unexpected errors
|
|
116
|
-
console.error(err);
|
|
117
|
-
this.hasError = true;
|
|
118
|
-
this.errorMessage = translate('genericError', this.lang);
|
|
119
|
-
this.sendErrorNotification(this.errorMessage);
|
|
120
|
-
});
|
|
121
|
-
};
|
|
122
|
-
this.debouncedUserLogin = this.debounce(this.userLogin, 850);
|
|
123
|
-
this.handleLogin = () => {
|
|
124
|
-
this.debouncedUserLogin({
|
|
125
|
-
username: this.userNameEmail,
|
|
126
|
-
password: this.userPassword
|
|
127
|
-
});
|
|
128
|
-
this.dispatchUpdateLoginCredentialsEvent();
|
|
129
|
-
};
|
|
130
|
-
this.handleInputChange = (event, location) => {
|
|
131
|
-
this.hasError = false;
|
|
132
|
-
const inputValue = event.target.value;
|
|
133
|
-
if (location === 'user') {
|
|
134
|
-
this.userNameEmail = inputValue;
|
|
135
|
-
this.isValidUserEmail = this.userEmailValidation(this.userNameEmail);
|
|
136
|
-
}
|
|
137
|
-
else {
|
|
138
|
-
this.userPassword = inputValue;
|
|
139
|
-
this.isValidPassword = this.passwordValidation(inputValue);
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
this.userEmailValidation = (input) => {
|
|
143
|
-
const regex = new RegExp(this.userEmailRegex, this.userEmailRegexOptions);
|
|
144
|
-
return regex.test(input);
|
|
145
|
-
};
|
|
146
|
-
this.passwordValidation = (input) => {
|
|
147
|
-
const regex = new RegExp(this.passwordRegex, this.passwordRegexOptions);
|
|
148
|
-
return regex.test(input);
|
|
149
|
-
};
|
|
150
|
-
this.togglePassword = () => {
|
|
151
|
-
this.isPasswordVisible = !this.isPasswordVisible;
|
|
152
|
-
};
|
|
153
|
-
this.resetPassword = () => {
|
|
154
|
-
window.postMessage({ type: "NavForgotPassword" }, window.location.href);
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
handleNewTranslations() {
|
|
158
|
-
getTranslations(this.translationUrl);
|
|
159
|
-
}
|
|
160
|
-
async componentWillLoad() {
|
|
161
|
-
if (this.translationUrl.length > 2) {
|
|
162
|
-
await getTranslations(this.translationUrl);
|
|
163
161
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
if (this.clientStyling)
|
|
173
|
-
this.setClientStyling();
|
|
174
|
-
if (this.clientStylingUrl)
|
|
175
|
-
this.setClientStylingURL();
|
|
176
|
-
this.limitStylingAppends = true;
|
|
162
|
+
debounce(func, delay) {
|
|
163
|
+
let timer;
|
|
164
|
+
return function (...args) {
|
|
165
|
+
clearTimeout(timer);
|
|
166
|
+
timer = setTimeout(() => {
|
|
167
|
+
func.apply(this, args);
|
|
168
|
+
}, delay);
|
|
169
|
+
};
|
|
177
170
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
} }, window.location.href);
|
|
189
|
-
}
|
|
190
|
-
debounce(func, delay) {
|
|
191
|
-
let timer;
|
|
192
|
-
return function (...args) {
|
|
193
|
-
clearTimeout(timer);
|
|
194
|
-
timer = setTimeout(() => {
|
|
195
|
-
func.apply(this, args);
|
|
196
|
-
}, delay);
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
dispatchUpdateLoginCredentialsEvent() {
|
|
200
|
-
if (!this.hasError) {
|
|
201
|
-
this.updateLoginCredentialsEvent = new CustomEvent("UpdateLoginCredentials", {
|
|
202
|
-
bubbles: true,
|
|
203
|
-
detail: {
|
|
204
|
-
userNameEmail: this.userNameEmail,
|
|
205
|
-
userPassword: this.userPassword
|
|
171
|
+
dispatchUpdateLoginCredentialsEvent() {
|
|
172
|
+
if (!this.hasError) {
|
|
173
|
+
this.updateLoginCredentialsEvent = new CustomEvent("UpdateLoginCredentials", {
|
|
174
|
+
bubbles: true,
|
|
175
|
+
detail: {
|
|
176
|
+
userNameEmail: this.userNameEmail,
|
|
177
|
+
userPassword: this.userPassword
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
window.dispatchEvent(this.updateLoginCredentialsEvent);
|
|
206
181
|
}
|
|
207
|
-
});
|
|
208
|
-
window.dispatchEvent(this.updateLoginCredentialsEvent);
|
|
209
182
|
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
h("
|
|
216
|
-
|
|
217
|
-
h("
|
|
218
|
-
h("
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
},
|
|
434
|
-
"attribute": "password-regex-options",
|
|
435
|
-
"reflect": true,
|
|
436
|
-
"defaultValue": "''"
|
|
183
|
+
;
|
|
184
|
+
render() {
|
|
185
|
+
let visibilityIcon = h("span", { key: '4ccb9d4b1c8209e22320c3667101b9e435d1b604', class: "InputIcon" }, this.isPasswordVisible &&
|
|
186
|
+
h("svg", { key: 'fd168b4ec7ed18213aef15d5c7bcb89183b5626d', 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", { key: '3ab8953db8743082bb19d4f97ae6191724145a0e', transform: "translate(-110.856 -23.242)" }, h("circle", { key: '716eb0de02150f4d5791cb7cf1cf7e904de4e8b9', class: "PasswordVisibilityIcon", cx: "0.05", cy: "0.05", r: "0.05", transform: "translate(121.017 31.148)" }), h("g", { key: '4ca623e6f31b09dbf6495fe657e9f6b67bfddbd8', transform: "translate(117.499 27.37)" }, h("path", { key: '0377c51b5536b07d0cefb77ed82d714fc82b5d9e', 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", { key: '3ee2f6849511a3ce18ccfcaea0b503f1b9e57329', 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", { key: '24fab8dc6f6ef08ef1a36227156b768925a2a7ba', transform: "translate(110.856 24.899)" }, h("path", { key: 'b41b45065b8f55772bbdfbced34ef4d7736c133a', 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", { key: '39f77d5f4028baf654fdc07a2f03525b994d508f', 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", { key: '74bdc0477190de8bd67e30e0799ed1d4c255fff0', class: "PasswordVisibilityIcon", width: "0.972", height: "15.861", rx: "0.486", transform: "translate(114.827 23.858) rotate(-39.315)" }))), !this.isPasswordVisible &&
|
|
187
|
+
h("svg", { key: '89e71e7d5fc2af237c7a0af69838a60f997dc0ee', 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", { key: '97447b59b0e079f3b2a154681aef2cef572e445b', transform: "translate(-14.185 -27.832)" }, h("path", { key: 'c35b80be71460f5fc0c469ee807e3f83f5ab1cb9', 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", { key: '3a6bfc9d02b7c66ecd0e07481e1963a6bcab3fb0', class: "PasswordVisibilityIcon", cx: "2.779", cy: "2.779", r: "2.779", transform: "translate(20.827 30.303)" }))));
|
|
188
|
+
let userIdentification = h("div", { key: '5b43adf706d46ce330b81e0bc5e8bbd1bfc2b883', class: "FormBox" }, h("div", { key: '0c53a0428fbcb10876e16d0505cf895c5bffa3bd', class: "FormValue" }, h("div", { key: '8aeda926da67db1e58595287f15d815e7887dc45', class: (!this.isValidUserEmail || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox' }, h("input", { key: 'bf82f8b419fe217143d3928262b9b256e43a9f79', type: "text", placeholder: '', value: this.userNameEmail, onFocus: (event) => this.handleInputChange(event, 'user'), onInput: (event) => this.handleInputChange(event, 'user'), autocapitalize: "none", required: true }), h("label", { key: '7a0f71f2c013c8d00d0d7c66452e09badfd17bb3', class: (this.userNameEmail ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserEmail || this.hasError ? 'FieldInvalid' : '') }, translate('userEmail', this.lang)), !this.isValidUserEmail &&
|
|
189
|
+
h("p", { key: 'ed3453e628b9d60f8df2c3c1e04024706c532bfd', class: "InvalidField" }, translate('invalidField', this.lang))), h("div", { key: 'c778082662a1f29bdb6b19799c702ce3b4773a0a', class: (!this.isValidPassword || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox' }, visibilityIcon, h("input", { key: '7cbdd79f39f986efc4cfadf0577782c86af8eec9', type: this.isPasswordVisible ? "text" : "password", placeholder: '', value: this.userPassword, onFocus: (event) => this.handleInputChange(event, 'password'), onInput: (event) => this.handleInputChange(event, 'password'), autocapitalize: "none", required: true }), h("label", { key: '94d576059031cb459757f417245a241a768137fe', class: (this.userPassword ? 'FieldFilledIn' : '') + ' ' + (!this.isValidPassword || this.hasError ? 'FieldInvalid' : '') }, translate('password', this.lang)), !this.isValidPassword &&
|
|
190
|
+
h("p", { key: '9c961763ac1a5c3af53d63b4b4423f22d341f2a4', class: "InvalidField" }, translate('invalidField', this.lang))), this.passwordReset == 'true' &&
|
|
191
|
+
h("div", { key: '9f0730d9d3000def2d5b0edb2fcef7c2b77633cf', class: "ForgotPassword" }, h("button", { key: '3bd5379cf60cba95c1338968c451366264bec081', onClick: () => this.resetPassword() }, translate('forgotPassword', this.lang))), h("button", { key: '7a5ac0291a075d7c4f1a1f235dc6be2ccfa2239e', disabled: (!this.isValidUserEmail || !this.isValidPassword || !this.userNameEmail || !this.userPassword), class: "SubmitCredentials", onClick: () => this.handleLogin() }, translate('login', this.lang)), this.hasError &&
|
|
192
|
+
h("p", { key: 'f40b7b875d615bb6af19dac753910763638409a8', class: "CredentialsError" }, this.errorMessage)));
|
|
193
|
+
return h("section", { key: '6c0b3e43c5fdd9993a02f11b9bfa817b2a5069f2', ref: el => this.stylingContainer = el }, userIdentification);
|
|
194
|
+
}
|
|
195
|
+
static get is() { return "user-login"; }
|
|
196
|
+
static get encapsulation() { return "shadow"; }
|
|
197
|
+
static get originalStyleUrls() {
|
|
198
|
+
return {
|
|
199
|
+
"$": ["user-login.scss"]
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
static get styleUrls() {
|
|
203
|
+
return {
|
|
204
|
+
"$": ["user-login.css"]
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
static get properties() {
|
|
208
|
+
return {
|
|
209
|
+
"endpoint": {
|
|
210
|
+
"type": "string",
|
|
211
|
+
"mutable": false,
|
|
212
|
+
"complexType": {
|
|
213
|
+
"original": "string",
|
|
214
|
+
"resolved": "string",
|
|
215
|
+
"references": {}
|
|
216
|
+
},
|
|
217
|
+
"required": false,
|
|
218
|
+
"optional": false,
|
|
219
|
+
"docs": {
|
|
220
|
+
"tags": [],
|
|
221
|
+
"text": "Endpoint"
|
|
222
|
+
},
|
|
223
|
+
"attribute": "endpoint",
|
|
224
|
+
"reflect": true,
|
|
225
|
+
"defaultValue": "''"
|
|
226
|
+
},
|
|
227
|
+
"lang": {
|
|
228
|
+
"type": "string",
|
|
229
|
+
"mutable": true,
|
|
230
|
+
"complexType": {
|
|
231
|
+
"original": "string",
|
|
232
|
+
"resolved": "string",
|
|
233
|
+
"references": {}
|
|
234
|
+
},
|
|
235
|
+
"required": false,
|
|
236
|
+
"optional": false,
|
|
237
|
+
"docs": {
|
|
238
|
+
"tags": [],
|
|
239
|
+
"text": "Language"
|
|
240
|
+
},
|
|
241
|
+
"attribute": "lang",
|
|
242
|
+
"reflect": true,
|
|
243
|
+
"defaultValue": "'en'"
|
|
244
|
+
},
|
|
245
|
+
"clientStyling": {
|
|
246
|
+
"type": "string",
|
|
247
|
+
"mutable": false,
|
|
248
|
+
"complexType": {
|
|
249
|
+
"original": "string",
|
|
250
|
+
"resolved": "string",
|
|
251
|
+
"references": {}
|
|
252
|
+
},
|
|
253
|
+
"required": false,
|
|
254
|
+
"optional": false,
|
|
255
|
+
"docs": {
|
|
256
|
+
"tags": [],
|
|
257
|
+
"text": "Client styling"
|
|
258
|
+
},
|
|
259
|
+
"attribute": "client-styling",
|
|
260
|
+
"reflect": true,
|
|
261
|
+
"defaultValue": "''"
|
|
262
|
+
},
|
|
263
|
+
"clientStylingUrl": {
|
|
264
|
+
"type": "string",
|
|
265
|
+
"mutable": false,
|
|
266
|
+
"complexType": {
|
|
267
|
+
"original": "string",
|
|
268
|
+
"resolved": "string",
|
|
269
|
+
"references": {}
|
|
270
|
+
},
|
|
271
|
+
"required": false,
|
|
272
|
+
"optional": false,
|
|
273
|
+
"docs": {
|
|
274
|
+
"tags": [],
|
|
275
|
+
"text": "Client styling by url"
|
|
276
|
+
},
|
|
277
|
+
"attribute": "client-styling-url",
|
|
278
|
+
"reflect": true,
|
|
279
|
+
"defaultValue": "''"
|
|
280
|
+
},
|
|
281
|
+
"translationUrl": {
|
|
282
|
+
"type": "string",
|
|
283
|
+
"mutable": false,
|
|
284
|
+
"complexType": {
|
|
285
|
+
"original": "string",
|
|
286
|
+
"resolved": "string",
|
|
287
|
+
"references": {}
|
|
288
|
+
},
|
|
289
|
+
"required": false,
|
|
290
|
+
"optional": false,
|
|
291
|
+
"docs": {
|
|
292
|
+
"tags": [],
|
|
293
|
+
"text": "Translation url"
|
|
294
|
+
},
|
|
295
|
+
"attribute": "translation-url",
|
|
296
|
+
"reflect": true,
|
|
297
|
+
"defaultValue": "''"
|
|
298
|
+
},
|
|
299
|
+
"passwordReset": {
|
|
300
|
+
"type": "string",
|
|
301
|
+
"mutable": false,
|
|
302
|
+
"complexType": {
|
|
303
|
+
"original": "string",
|
|
304
|
+
"resolved": "string",
|
|
305
|
+
"references": {}
|
|
306
|
+
},
|
|
307
|
+
"required": false,
|
|
308
|
+
"optional": false,
|
|
309
|
+
"docs": {
|
|
310
|
+
"tags": [],
|
|
311
|
+
"text": "Password reset"
|
|
312
|
+
},
|
|
313
|
+
"attribute": "password-reset",
|
|
314
|
+
"reflect": true,
|
|
315
|
+
"defaultValue": "'false'"
|
|
316
|
+
},
|
|
317
|
+
"userEmailRegex": {
|
|
318
|
+
"type": "string",
|
|
319
|
+
"mutable": false,
|
|
320
|
+
"complexType": {
|
|
321
|
+
"original": "string",
|
|
322
|
+
"resolved": "string",
|
|
323
|
+
"references": {}
|
|
324
|
+
},
|
|
325
|
+
"required": false,
|
|
326
|
+
"optional": false,
|
|
327
|
+
"docs": {
|
|
328
|
+
"tags": [],
|
|
329
|
+
"text": "User email regex"
|
|
330
|
+
},
|
|
331
|
+
"attribute": "user-email-regex",
|
|
332
|
+
"reflect": true
|
|
333
|
+
},
|
|
334
|
+
"userEmailRegexOptions": {
|
|
335
|
+
"type": "string",
|
|
336
|
+
"mutable": false,
|
|
337
|
+
"complexType": {
|
|
338
|
+
"original": "string",
|
|
339
|
+
"resolved": "string",
|
|
340
|
+
"references": {}
|
|
341
|
+
},
|
|
342
|
+
"required": false,
|
|
343
|
+
"optional": false,
|
|
344
|
+
"docs": {
|
|
345
|
+
"tags": [],
|
|
346
|
+
"text": "User email regex options"
|
|
347
|
+
},
|
|
348
|
+
"attribute": "user-email-regex-options",
|
|
349
|
+
"reflect": true,
|
|
350
|
+
"defaultValue": "'i'"
|
|
351
|
+
},
|
|
352
|
+
"passwordRegex": {
|
|
353
|
+
"type": "string",
|
|
354
|
+
"mutable": false,
|
|
355
|
+
"complexType": {
|
|
356
|
+
"original": "string",
|
|
357
|
+
"resolved": "string",
|
|
358
|
+
"references": {}
|
|
359
|
+
},
|
|
360
|
+
"required": false,
|
|
361
|
+
"optional": false,
|
|
362
|
+
"docs": {
|
|
363
|
+
"tags": [],
|
|
364
|
+
"text": "Password regex"
|
|
365
|
+
},
|
|
366
|
+
"attribute": "password-regex",
|
|
367
|
+
"reflect": true
|
|
368
|
+
},
|
|
369
|
+
"passwordRegexOptions": {
|
|
370
|
+
"type": "string",
|
|
371
|
+
"mutable": false,
|
|
372
|
+
"complexType": {
|
|
373
|
+
"original": "string",
|
|
374
|
+
"resolved": "string",
|
|
375
|
+
"references": {}
|
|
376
|
+
},
|
|
377
|
+
"required": false,
|
|
378
|
+
"optional": false,
|
|
379
|
+
"docs": {
|
|
380
|
+
"tags": [],
|
|
381
|
+
"text": "Password regex options"
|
|
382
|
+
},
|
|
383
|
+
"attribute": "password-regex-options",
|
|
384
|
+
"reflect": true,
|
|
385
|
+
"defaultValue": "''"
|
|
386
|
+
}
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
static get states() {
|
|
390
|
+
return {
|
|
391
|
+
"userNameEmail": {},
|
|
392
|
+
"userPassword": {},
|
|
393
|
+
"isValidUserEmail": {},
|
|
394
|
+
"isValidPassword": {},
|
|
395
|
+
"isPasswordVisible": {},
|
|
396
|
+
"limitStylingAppends": {},
|
|
397
|
+
"errorMessage": {},
|
|
398
|
+
"hasError": {}
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
static get watchers() {
|
|
402
|
+
return [{
|
|
403
|
+
"propName": "translationUrl",
|
|
404
|
+
"methodName": "handleNewTranslations"
|
|
405
|
+
}];
|
|
437
406
|
}
|
|
438
|
-
}; }
|
|
439
|
-
static get states() { return {
|
|
440
|
-
"userNameEmail": {},
|
|
441
|
-
"userPassword": {},
|
|
442
|
-
"isValidUserEmail": {},
|
|
443
|
-
"isValidPassword": {},
|
|
444
|
-
"isPasswordVisible": {},
|
|
445
|
-
"limitStylingAppends": {},
|
|
446
|
-
"errorMessage": {},
|
|
447
|
-
"hasError": {}
|
|
448
|
-
}; }
|
|
449
|
-
static get watchers() { return [{
|
|
450
|
-
"propName": "translationUrl",
|
|
451
|
-
"methodName": "handleNewTranslations"
|
|
452
|
-
}]; }
|
|
453
407
|
}
|