@modernman00/shared-js-lib 1.2.38 → 1.2.41
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/AcctMgt/processAll.js +4 -4
- package/FormHelper.js +8 -2
- package/config/version.php +1 -1
- package/coverage/clover.xml +578 -0
- package/coverage/coverage-final.json +16 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +131 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/shared-js-lib/AcctMgt/changePassword.js.html +352 -0
- package/coverage/lcov-report/shared-js-lib/AcctMgt/code.js.html +235 -0
- package/coverage/lcov-report/shared-js-lib/AcctMgt/forgot.js.html +256 -0
- package/coverage/lcov-report/shared-js-lib/AcctMgt/index.html +176 -0
- package/coverage/lcov-report/shared-js-lib/AcctMgt/login.js.html +304 -0
- package/coverage/lcov-report/shared-js-lib/AcctMgt/loginUtility.js.html +115 -0
- package/coverage/lcov-report/shared-js-lib/AcctMgt/processAll.js.html +280 -0
- package/coverage/lcov-report/shared-js-lib/Cookie.js.html +250 -0
- package/coverage/lcov-report/shared-js-lib/FormHelper.js.html +1057 -0
- package/coverage/lcov-report/shared-js-lib/Http.js.html +721 -0
- package/coverage/lcov-report/shared-js-lib/Loader.js.html +196 -0
- package/coverage/lcov-report/shared-js-lib/ShowResponse.js.html +238 -0
- package/coverage/lcov-report/shared-js-lib/Utility.js.html +538 -0
- package/coverage/lcov-report/shared-js-lib/UtilityHtml.js.html +685 -0
- package/coverage/lcov-report/shared-js-lib/axiosWrapper.js.html +145 -0
- package/coverage/lcov-report/shared-js-lib/general.js.html +301 -0
- package/coverage/lcov-report/shared-js-lib/index.html +251 -0
- package/coverage/lcov-report/shared-js-lib/theAutoComplete.js.html +364 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov.info +1207 -0
- package/package.json +1 -1
- package/release-history.md +21 -0
package/AcctMgt/processAll.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
import { postFormData } from '../Http.js';
|
|
3
3
|
import { showLoader, clearLoader } from '../Loader.js';
|
|
4
|
-
import {
|
|
4
|
+
import { id } from '../UtilityHtml.js';
|
|
5
5
|
import { showError } from '../ShowResponse.js';
|
|
6
6
|
import FormHelper from '../FormHelper.js';
|
|
7
7
|
|
|
@@ -22,7 +22,7 @@ export const loginSubmission = async (formId, loginURL, redirect, css = null, le
|
|
|
22
22
|
|
|
23
23
|
try {
|
|
24
24
|
|
|
25
|
-
const formInput =
|
|
25
|
+
const formInput = id(formId);
|
|
26
26
|
|
|
27
27
|
if (!formInput) {
|
|
28
28
|
throw new Error(`Form ${formId} not found`);
|
|
@@ -43,9 +43,9 @@ export const loginSubmission = async (formId, loginURL, redirect, css = null, le
|
|
|
43
43
|
|
|
44
44
|
if (formData.result === 1) {
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
const notificationId = id(`${formId}_notification`) || formId;
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
notificationId.scrollIntoView({ behavior: 'smooth' });
|
|
49
49
|
|
|
50
50
|
showLoader();
|
|
51
51
|
|
package/FormHelper.js
CHANGED
|
@@ -41,7 +41,7 @@ export default class FormHelper {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
else if (type === 'password') {
|
|
44
|
-
const passwordRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(
|
|
44
|
+
const passwordRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?!.*\s).{8,}$/;
|
|
45
45
|
if (!passwordRegex.test(value)) {
|
|
46
46
|
msg = '<li>Please enter a valid password (min 8 chars, upper & lowercase, number, special char)</li>';
|
|
47
47
|
isValid = false;
|
|
@@ -72,10 +72,16 @@ export default class FormHelper {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Test if a given value matches a regex pattern based on the type
|
|
77
|
+
* @param {string} value - the value to test
|
|
78
|
+
* @param {string} type - the type of regex pattern to apply (email, password, general)
|
|
79
|
+
* @returns {boolean} - true if the value matches the regex, false otherwise
|
|
80
|
+
*/
|
|
75
81
|
matchRegex(value, type) {
|
|
76
82
|
const regexPatterns = {
|
|
77
83
|
email: /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-Z0-9]{2,4}$/,
|
|
78
|
-
password: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(
|
|
84
|
+
password: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?!.*\s).{8,}$/,
|
|
79
85
|
general: /[\w\d\s.,'"!?@#&()\-]/,
|
|
80
86
|
};
|
|
81
87
|
|
package/config/version.php
CHANGED