@everymatrix/user-login 1.46.1 → 1.47.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.
@@ -16,5 +16,5 @@ var patchBrowser = () => {
16
16
 
17
17
  patchBrowser().then(async (options) => {
18
18
  await globalScripts();
19
- 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]},null,{"translationUrl":["handleNewTranslations"]}]]]], options);
19
+ 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"],"userPhoneRegex":[513,"user-phone-regex"],"userPhoneRegexOptions":[513,"user-phone-regex-options"],"passwordRegex":[513,"password-regex"],"passwordRegexOptions":[513,"password-regex-options"],"version":[513],"loginByPhoneNumber":[513,"login-by-phone-number"],"userNameEmail":[32],"userPassword":[32],"isValidUserEmail":[32],"userPhone":[32],"userPrefix":[32],"isValidPassword":[32],"isValidUserPhone":[32],"isPasswordVisible":[32],"limitStylingAppends":[32],"errorMessage":[32],"hasError":[32],"userPrefixOptions":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"]}]]]], options);
20
20
  });
@@ -0,0 +1,2 @@
1
+ import { Config } from '../../../../../../../../../../../stencil-public-runtime';
2
+ export declare const config: Config;
@@ -0,0 +1,2 @@
1
+ import { Config } from '../../../../../../../../../../../stencil-public-runtime';
2
+ export declare const config: Config;
@@ -1,82 +1,215 @@
1
+ import '@vaadin/combo-box';
1
2
  export declare class UserLogin {
2
3
  /**
3
- * Endpoint
4
+ * API endpoint URL for login requests
4
5
  */
5
6
  endpoint: string;
6
7
  /**
7
- * Language
8
- */
8
+ * Language code for translations (default is 'en')
9
+ */
9
10
  lang: string;
10
11
  /**
11
- * Client styling
12
- */
12
+ * Inline CSS styling provided by the client
13
+ */
13
14
  clientStyling: string;
14
15
  /**
15
- * Client styling by url
16
- */
16
+ * URL to load additional CSS styling
17
+ */
17
18
  clientStylingUrl: string;
18
19
  /**
19
- * Translation url
20
- */
20
+ * URL for fetching translations
21
+ */
21
22
  translationUrl: string;
22
23
  /**
23
- * Password reset
24
+ * Flag indicating whether the password reset feature is enabled
24
25
  */
25
26
  passwordReset: string;
26
27
  /**
27
- * User email regex
28
+ * Regular expression for validating the user email
28
29
  */
29
30
  userEmailRegex: string;
30
31
  /**
31
- * User email regex options
32
+ * Regex options for user email validation
32
33
  */
33
34
  userEmailRegexOptions: string;
34
35
  /**
35
- * Password regex
36
+ * User phone regex
37
+ */
38
+ userPhoneRegex: string;
39
+ /**
40
+ * User phone regex options
41
+ */
42
+ userPhoneRegexOptions: string;
43
+ /**
44
+ * Regular expression for validating the password
36
45
  */
37
46
  passwordRegex: string;
38
47
  /**
39
- * Password regex options
48
+ * Regex options for password validation
40
49
  */
41
50
  passwordRegexOptions: string;
42
51
  /**
43
- * Username
52
+ * Flag to determine if the component uses version 2 of the API
53
+ */
54
+ version: string;
55
+ /**
56
+ * If set to true, login will be done by phone number, else by username/email
57
+ */
58
+ loginByPhoneNumber: string;
59
+ /**
60
+ * User email or username entered in the form
44
61
  */
45
62
  userNameEmail: string;
46
63
  /**
47
- * Password
64
+ * Password entered in the form
48
65
  */
49
66
  userPassword: string;
67
+ /**
68
+ * Flag to indicate whether the entered email is valid
69
+ */
50
70
  isValidUserEmail: boolean;
71
+ /**
72
+ * User phone entered in the form
73
+ */
74
+ userPhone: string;
75
+ /**
76
+ * User prefix entered in the form
77
+ */
78
+ userPrefix: string;
79
+ /**
80
+ * Flag to indicate whether the entered password is valid
81
+ */
51
82
  isValidPassword: boolean;
83
+ /**
84
+ * Flag to indicate whether the entered phone is valid
85
+ */
86
+ isValidUserPhone: boolean;
87
+ /**
88
+ * Toggles visibility of the password field
89
+ */
52
90
  isPasswordVisible: boolean;
91
+ /**
92
+ * Internal flag to prevent duplicate client styling appends
93
+ */
53
94
  private limitStylingAppends;
95
+ /**
96
+ * Stores error message from the API
97
+ */
54
98
  private errorMessage;
99
+ /**
100
+ * Indicates whether an error has occurred
101
+ */
55
102
  private hasError;
103
+ /**
104
+ * User prefix options for phone number login
105
+ */
106
+ userPrefixOptions: Array<Record<string, string>>;
56
107
  private errorCode;
57
108
  private stylingContainer;
58
109
  updateLoginCredentialsEvent: CustomEvent;
110
+ /**
111
+ * Watch for changes in the translation URL and fetch new translations
112
+ */
59
113
  handleNewTranslations(): void;
114
+ /**
115
+ * Watch for changes in the client styling and apply the new styling
116
+ *
117
+ * @param newValue - new client styling
118
+ * @param oldValue - previous client styling
119
+ */
120
+ handleStylingChange(newValue: string, oldValue: string): void;
121
+ /**
122
+ * Watch for changes in the client styling URL and fetch the new CSS
123
+ *
124
+ * @param newValue - new client styling URL
125
+ * @param oldValue - previous client styling URL
126
+ */
127
+ handleStylingUrlChange(newValue: string, oldValue: string): void;
128
+ /**
129
+ * Lifecycle method: Fetch translations on component load
130
+ */
60
131
  componentWillLoad(): Promise<void>;
132
+ /**
133
+ * Lifecycle method: Set up event listeners after the component is rendered
134
+ */
61
135
  componentDidLoad(): void;
136
+ /**
137
+ * Lifecycle method: Apply client styling after the component renders
138
+ */
62
139
  componentDidRender(): void;
140
+ /**
141
+ * Lifecycle method: Clean up event listeners when the component is removed
142
+ */
63
143
  disconnectedCallback(): void;
144
+ /**
145
+ * Apply inline client styling
146
+ */
64
147
  setClientStyling: () => void;
148
+ /**
149
+ * Fetch and apply CSS from a provided URL
150
+ */
65
151
  setClientStylingURL: () => void;
66
- autofillCredentialsHandler: (e: any) => void;
67
- userLogin: ({ username, password }: {
68
- username: any;
69
- password: any;
70
- }) => Promise<any>;
152
+ /**
153
+ * Fetch phone prefixes from the API
154
+ */
155
+ getPhonePrefixes: () => Promise<void>;
156
+ /**
157
+ * Handle autofilling of credentials from a dispatched event
158
+ */
159
+ autofillCredentialsHandler: (e: CustomEvent) => void;
160
+ /**
161
+ * Login API call for Gm 1.7
162
+ */
163
+ userLoginGm17: () => Promise<void>;
164
+ /**
165
+ * Function to send legislation login request
166
+ */
167
+ sendLegislationLogin: (token: string) => Promise<void>;
168
+ /**
169
+ * Login API call
170
+ */
171
+ userLogin: () => Promise<any>;
172
+ /**
173
+ * Send error notification as a post message
174
+ */
71
175
  sendErrorNotification(errorMessage: any): void;
176
+ /**
177
+ * Debounce function to limit API calls
178
+ */
72
179
  debounce(func: any, delay: any): (...args: any[]) => void;
73
- debouncedUserLogin: (...args: any[]) => void;
180
+ /**
181
+ * Trigger login process
182
+ */
74
183
  handleLogin: () => void;
184
+ /**
185
+ * Dispatch event to notify about login credential updates
186
+ */
75
187
  dispatchUpdateLoginCredentialsEvent(): void;
188
+ /**
189
+ * Handle input changes for username/email and password
190
+ *
191
+ * @param event - input event
192
+ * @param location - 'user' | 'phone' | 'password'
193
+ */
76
194
  handleInputChange: (event: Event, location: string) => void;
77
- userEmailValidation: (input: any) => boolean;
78
- passwordValidation: (input: any) => boolean;
195
+ handleInputChangePartial: (location: string) => (e: Event) => void;
196
+ /**
197
+ * Validate input based on the specific regex
198
+ *
199
+ * @param useRuleFor - 'user' | 'phone' | 'password'
200
+ * @param input - input value to validate
201
+ */
202
+ validate: (useRuleFor: "user" | "phone" | "password", input: string) => boolean;
203
+ /**
204
+ * Toggle password
205
+ */
79
206
  togglePassword: () => void;
207
+ /**
208
+ * Reset password
209
+ */
80
210
  resetPassword: () => void;
211
+ /**
212
+ * Render function
213
+ */
81
214
  render(): any;
82
215
  }
@@ -8,45 +8,61 @@ import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
8
  export namespace Components {
9
9
  interface UserLogin {
10
10
  /**
11
- * Client styling
11
+ * Inline CSS styling provided by the client
12
12
  */
13
13
  "clientStyling": string;
14
14
  /**
15
- * Client styling by url
15
+ * URL to load additional CSS styling
16
16
  */
17
17
  "clientStylingUrl": string;
18
18
  /**
19
- * Endpoint
19
+ * API endpoint URL for login requests
20
20
  */
21
21
  "endpoint": string;
22
22
  /**
23
- * Language
23
+ * Language code for translations (default is 'en')
24
24
  */
25
25
  "lang": string;
26
26
  /**
27
- * Password regex
27
+ * If set to true, login will be done by phone number, else by username/email
28
+ */
29
+ "loginByPhoneNumber": string;
30
+ /**
31
+ * Regular expression for validating the password
28
32
  */
29
33
  "passwordRegex": string;
30
34
  /**
31
- * Password regex options
35
+ * Regex options for password validation
32
36
  */
33
37
  "passwordRegexOptions": string;
34
38
  /**
35
- * Password reset
39
+ * Flag indicating whether the password reset feature is enabled
36
40
  */
37
41
  "passwordReset": string;
38
42
  /**
39
- * Translation url
43
+ * URL for fetching translations
40
44
  */
41
45
  "translationUrl": string;
42
46
  /**
43
- * User email regex
47
+ * Regular expression for validating the user email
44
48
  */
45
49
  "userEmailRegex": string;
46
50
  /**
47
- * User email regex options
51
+ * Regex options for user email validation
48
52
  */
49
53
  "userEmailRegexOptions": string;
54
+ /**
55
+ * User phone regex
56
+ */
57
+ "userPhoneRegex": string;
58
+ /**
59
+ * User phone regex options
60
+ */
61
+ "userPhoneRegexOptions": string;
62
+ /**
63
+ * Flag to determine if the component uses version 2 of the API
64
+ */
65
+ "version": string;
50
66
  }
51
67
  }
52
68
  declare global {
@@ -63,45 +79,61 @@ declare global {
63
79
  declare namespace LocalJSX {
64
80
  interface UserLogin {
65
81
  /**
66
- * Client styling
82
+ * Inline CSS styling provided by the client
67
83
  */
68
84
  "clientStyling"?: string;
69
85
  /**
70
- * Client styling by url
86
+ * URL to load additional CSS styling
71
87
  */
72
88
  "clientStylingUrl"?: string;
73
89
  /**
74
- * Endpoint
90
+ * API endpoint URL for login requests
75
91
  */
76
92
  "endpoint"?: string;
77
93
  /**
78
- * Language
94
+ * Language code for translations (default is 'en')
79
95
  */
80
96
  "lang"?: string;
81
97
  /**
82
- * Password regex
98
+ * If set to true, login will be done by phone number, else by username/email
99
+ */
100
+ "loginByPhoneNumber"?: string;
101
+ /**
102
+ * Regular expression for validating the password
83
103
  */
84
104
  "passwordRegex"?: string;
85
105
  /**
86
- * Password regex options
106
+ * Regex options for password validation
87
107
  */
88
108
  "passwordRegexOptions"?: string;
89
109
  /**
90
- * Password reset
110
+ * Flag indicating whether the password reset feature is enabled
91
111
  */
92
112
  "passwordReset"?: string;
93
113
  /**
94
- * Translation url
114
+ * URL for fetching translations
95
115
  */
96
116
  "translationUrl"?: string;
97
117
  /**
98
- * User email regex
118
+ * Regular expression for validating the user email
99
119
  */
100
120
  "userEmailRegex"?: string;
101
121
  /**
102
- * User email regex options
122
+ * Regex options for user email validation
103
123
  */
104
124
  "userEmailRegexOptions"?: string;
125
+ /**
126
+ * User phone regex
127
+ */
128
+ "userPhoneRegex"?: string;
129
+ /**
130
+ * User phone regex options
131
+ */
132
+ "userPhoneRegexOptions"?: string;
133
+ /**
134
+ * Flag to determine if the component uses version 2 of the API
135
+ */
136
+ "version"?: string;
105
137
  }
106
138
  interface IntrinsicElements {
107
139
  "user-login": UserLogin;