@rh-support/components 2.1.18 → 2.1.20

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.
@@ -19,7 +19,7 @@ function LoadingDots(props) {
19
19
  react_1.default.createElement("span", null, ".")),
20
20
  react_1.default.createElement("p", { className: "sr-only" },
21
21
  react_1.default.createElement(react_i18next_1.Trans, null, "Loading...")))),
22
- props.message && props.show && react_1.default.createElement("span", { className: "spinner-message" }, props.message)));
22
+ props.message && props.show && react_1.default.createElement("p", { className: "pf-u-text-align-center pf-u-my-md" }, props.message)));
23
23
  }
24
24
  exports.LoadingDots = LoadingDots;
25
25
  LoadingDots.defaultProps = defaultProps;
@@ -120,9 +120,9 @@ function PhoneInput(props) {
120
120
  areaCode: [''], // Area codes of a country
121
121
  });
122
122
  const setLocalFormat = (phoneNumber) => {
123
- let localPhone = phoneNumber.replace(PREFIX, '').trim();
124
- localPhone = localPhone.replace('(', '').trim();
125
- localPhone = localPhone.replace(/ +/g, '');
123
+ let localPhone = phoneNumber === null || phoneNumber === void 0 ? void 0 : phoneNumber.replace(PREFIX, '').trim();
124
+ localPhone = localPhone === null || localPhone === void 0 ? void 0 : localPhone.replace('(', '').trim();
125
+ localPhone = localPhone === null || localPhone === void 0 ? void 0 : localPhone.replace(/ +/g, '');
126
126
  // if the user selects a value from the dropdown and the country code is the same as prev, iso2 values shouldn't override
127
127
  if (!isEmpty_1.default(countryObj) && isEqual_1.default(localPhone, countryObj.dialCode)) {
128
128
  onCountryCodeChange && onCountryCodeChange(PREFIX + countryObj.countryCode);
@@ -175,7 +175,7 @@ function PhoneInput(props) {
175
175
  return localFormat;
176
176
  };
177
177
  const onPhoneChange = (phone) => {
178
- if (isEmpty_1.default(phone.trim()) || isEmpty_1.default(phone.replace(PREFIX, '').trim())) {
178
+ if (isEmpty_1.default(phone === null || phone === void 0 ? void 0 : phone.trim()) || isEmpty_1.default(phone === null || phone === void 0 ? void 0 : phone.replace(PREFIX, '').trim())) {
179
179
  setFormattedNumber('');
180
180
  onPhoneValueChange('');
181
181
  setInvalid && setInvalid(false);
@@ -246,7 +246,7 @@ function PhoneInput(props) {
246
246
  }, [countryObj]);
247
247
  react_1.useEffect(() => {
248
248
  // when user types +, it will be replaced by empty string
249
- if (isEqual_1.default(phoneValue.trim(), PREFIX) && isEmpty_1.default(iso2)) {
249
+ if (isEqual_1.default(phoneValue === null || phoneValue === void 0 ? void 0 : phoneValue.trim(), PREFIX) && isEmpty_1.default(iso2)) {
250
250
  onPhoneValueChange('');
251
251
  setFormattedNumber('');
252
252
  return;
@@ -13,7 +13,7 @@ function LoadingDots(props) {
13
13
  React.createElement("span", null, ".")),
14
14
  React.createElement("p", { className: "sr-only" },
15
15
  React.createElement(Trans, null, "Loading...")))),
16
- props.message && props.show && React.createElement("span", { className: "spinner-message" }, props.message)));
16
+ props.message && props.show && React.createElement("p", { className: "pf-u-text-align-center pf-u-my-md" }, props.message)));
17
17
  }
18
18
  LoadingDots.defaultProps = defaultProps;
19
19
  export { LoadingDots };
@@ -94,9 +94,9 @@ export function PhoneInput(props) {
94
94
  areaCode: [''], // Area codes of a country
95
95
  });
96
96
  const setLocalFormat = (phoneNumber) => {
97
- let localPhone = phoneNumber.replace(PREFIX, '').trim();
98
- localPhone = localPhone.replace('(', '').trim();
99
- localPhone = localPhone.replace(/ +/g, '');
97
+ let localPhone = phoneNumber === null || phoneNumber === void 0 ? void 0 : phoneNumber.replace(PREFIX, '').trim();
98
+ localPhone = localPhone === null || localPhone === void 0 ? void 0 : localPhone.replace('(', '').trim();
99
+ localPhone = localPhone === null || localPhone === void 0 ? void 0 : localPhone.replace(/ +/g, '');
100
100
  // if the user selects a value from the dropdown and the country code is the same as prev, iso2 values shouldn't override
101
101
  if (!isEmpty(countryObj) && isEqual(localPhone, countryObj.dialCode)) {
102
102
  onCountryCodeChange && onCountryCodeChange(PREFIX + countryObj.countryCode);
@@ -149,7 +149,7 @@ export function PhoneInput(props) {
149
149
  return localFormat;
150
150
  };
151
151
  const onPhoneChange = (phone) => {
152
- if (isEmpty(phone.trim()) || isEmpty(phone.replace(PREFIX, '').trim())) {
152
+ if (isEmpty(phone === null || phone === void 0 ? void 0 : phone.trim()) || isEmpty(phone === null || phone === void 0 ? void 0 : phone.replace(PREFIX, '').trim())) {
153
153
  setFormattedNumber('');
154
154
  onPhoneValueChange('');
155
155
  setInvalid && setInvalid(false);
@@ -220,7 +220,7 @@ export function PhoneInput(props) {
220
220
  }, [countryObj]);
221
221
  useEffect(() => {
222
222
  // when user types +, it will be replaced by empty string
223
- if (isEqual(phoneValue.trim(), PREFIX) && isEmpty(iso2)) {
223
+ if (isEqual(phoneValue === null || phoneValue === void 0 ? void 0 : phoneValue.trim(), PREFIX) && isEmpty(iso2)) {
224
224
  onPhoneValueChange('');
225
225
  setFormattedNumber('');
226
226
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/components",
3
- "version": "2.1.18",
3
+ "version": "2.1.20",
4
4
  "description": "Contains all reusabel components for support app",
5
5
  "author": "Vikas Rathee <vrathee@redhat.com>",
6
6
  "license": "ISC",
@@ -80,8 +80,8 @@
80
80
  "@patternfly/react-core": "4.264.0",
81
81
  "@patternfly/react-table": "4.111.33",
82
82
  "@rh-support/types": "2.0.2",
83
- "@rh-support/user-permissions": "2.1.12",
84
- "@rh-support/utils": "2.1.9",
83
+ "@rh-support/user-permissions": "2.1.14",
84
+ "@rh-support/utils": "2.1.10",
85
85
  "dompurify": "^2.2.6",
86
86
  "downshift": "^6.0.5",
87
87
  "js-worker-search": "^1.4.1",
@@ -117,5 +117,5 @@
117
117
  "defaults and supports es6-module",
118
118
  "maintained node versions"
119
119
  ],
120
- "gitHead": "ec73b04b857523eb9ced98302c2245c095db46e1"
120
+ "gitHead": "992cc790d529a4d381cb65265331fd52a4fad583"
121
121
  }