@rh-support/components 2.1.55 → 2.1.57
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.
|
@@ -36,7 +36,7 @@ const initializedCountries = COUNTRY_DATA.map((country) => {
|
|
|
36
36
|
const formatNumber = (fullPhoneNumber, localFormat) => {
|
|
37
37
|
if (isEmpty(fullPhoneNumber))
|
|
38
38
|
return '';
|
|
39
|
-
let localPhone = fullPhoneNumber.replace(PREFIX, '');
|
|
39
|
+
let localPhone = fullPhoneNumber === null || fullPhoneNumber === void 0 ? void 0 : fullPhoneNumber.replace(PREFIX, '');
|
|
40
40
|
if (isEmpty(localPhone))
|
|
41
41
|
return '';
|
|
42
42
|
// Formatting inputted number
|
|
@@ -48,7 +48,7 @@ const formatNumber = (fullPhoneNumber, localFormat) => {
|
|
|
48
48
|
});
|
|
49
49
|
let pattern = '';
|
|
50
50
|
let i = 0;
|
|
51
|
-
for (let j = 0; j < (localFormat === null || localFormat === void 0 ? void 0 : localFormat.length) && i < phone.length; j++) {
|
|
51
|
+
for (let j = 0; j < (localFormat === null || localFormat === void 0 ? void 0 : localFormat.length) && i < (phone === null || phone === void 0 ? void 0 : phone.length); j++) {
|
|
52
52
|
if (localFormat[j] === '.') {
|
|
53
53
|
pattern += phone[i];
|
|
54
54
|
i++;
|
|
@@ -61,7 +61,7 @@ const formatNumber = (fullPhoneNumber, localFormat) => {
|
|
|
61
61
|
};
|
|
62
62
|
// return phoneline and countrycode for any given phone
|
|
63
63
|
export const getPhoneObj = (phoneNumber) => {
|
|
64
|
-
let localPhone = phoneNumber.replace(/[^0-9]/g, '');
|
|
64
|
+
let localPhone = phoneNumber === null || phoneNumber === void 0 ? void 0 : phoneNumber.replace(/[^0-9]/g, '');
|
|
65
65
|
let countryCode = '';
|
|
66
66
|
// Guessing countries according to user input
|
|
67
67
|
const possibleCountries = initializedCountries.filter((country) => localPhone === null || localPhone === void 0 ? void 0 : localPhone.startsWith(country.dialCode.toString()));
|
|
@@ -74,7 +74,7 @@ export const getPhoneObj = (phoneNumber) => {
|
|
|
74
74
|
}
|
|
75
75
|
return {
|
|
76
76
|
countryCode: PREFIX + countryCode,
|
|
77
|
-
phoneLine: localPhone.substring(countryCode.length, localPhone.length),
|
|
77
|
+
phoneLine: localPhone === null || localPhone === void 0 ? void 0 : localPhone.substring(countryCode.length, localPhone.length),
|
|
78
78
|
};
|
|
79
79
|
};
|
|
80
80
|
export function PhoneInput(props) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/components",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.57",
|
|
4
4
|
"description": "Contains all reusabel components for support app",
|
|
5
5
|
"author": "Vikas Rathee <vrathee@redhat.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"prepublishOnly": "npm run build"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@cee-eng/hydrajs": "4.17.
|
|
47
|
+
"@cee-eng/hydrajs": "4.17.14",
|
|
48
48
|
"@cee-eng/ui-toolkit": "1.1.8",
|
|
49
49
|
"@patternfly/patternfly": "5.1.0",
|
|
50
50
|
"@patternfly/react-core": "5.1.1",
|
|
@@ -62,14 +62,14 @@
|
|
|
62
62
|
"use-deep-compare-effect": "^1.6.1"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@cee-eng/hydrajs": "4.17.
|
|
65
|
+
"@cee-eng/hydrajs": "4.17.14",
|
|
66
66
|
"@cee-eng/ui-toolkit": "1.1.8",
|
|
67
67
|
"@patternfly/patternfly": "5.1.0",
|
|
68
68
|
"@patternfly/react-core": "5.1.1",
|
|
69
69
|
"@patternfly/react-table": "5.1.1",
|
|
70
70
|
"@rh-support/types": "2.0.3",
|
|
71
|
-
"@rh-support/user-permissions": "2.1.
|
|
72
|
-
"@rh-support/utils": "2.1.
|
|
71
|
+
"@rh-support/user-permissions": "2.1.41",
|
|
72
|
+
"@rh-support/utils": "2.1.31",
|
|
73
73
|
"dompurify": "^2.2.6",
|
|
74
74
|
"downshift": "^6.0.5",
|
|
75
75
|
"js-worker-search": "^1.4.1",
|
|
@@ -109,5 +109,5 @@
|
|
|
109
109
|
"defaults and supports es6-module",
|
|
110
110
|
"maintained node versions"
|
|
111
111
|
],
|
|
112
|
-
"gitHead": "
|
|
112
|
+
"gitHead": "4dba6a4e5e70b1cccf8fb3ff39ee561b41243326"
|
|
113
113
|
}
|