@rh-support/components 2.1.77 → 2.1.79
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/lib/esm/PhoneInput/CountryData.js +1 -1
- package/lib/esm/PhoneInput/FlagSvgs.d.ts +3 -0
- package/lib/esm/PhoneInput/FlagSvgs.d.ts.map +1 -0
- package/lib/esm/PhoneInput/FlagSvgs.js +2018 -0
- package/lib/esm/PhoneInput/PhoneInput.d.ts.map +1 -1
- package/lib/esm/PhoneInput/PhoneInput.js +7 -3
- package/lib/esm/PhoneInput/PhoneInput.scss +14 -731
- package/lib/esm/TopContentSearch/TopContentSearch.d.ts.map +1 -1
- package/lib/esm/TopContentSearch/TopContentSearch.js +2 -2
- package/package.json +2 -2
- package/lib/esm/PhoneInput/flags.png +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PhoneInput.d.ts","sourceRoot":"","sources":["../../../src/PhoneInput/PhoneInput.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAO3B,OAAO,KAA8B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"PhoneInput.d.ts","sourceRoot":"","sources":["../../../src/PhoneInput/PhoneInput.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAO3B,OAAO,KAA8B,MAAM,OAAO,CAAC;AAMnD,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,CAAC,MAAM,KAAA,KAAK,IAAI,CAAC;IACrC,WAAW,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;IACtE,mBAAmB,CAAC,EAAE,CAAC,MAAM,KAAA,KAAK,IAAI,CAAC;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,CAAC,OAAO,KAAA,KAAK,IAAI,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACrC;AAoDD,eAAO,MAAM,eAAe,gBAAiB,MAAM;;;;;;;;;;CAmClD,CAAC;AAqCF,eAAO,MAAM,WAAW,gBAAiB,MAAM;;;CAgB9C,CAAC;AAEF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,qBA6LvC"}
|
|
@@ -7,8 +7,9 @@ import isUndefined from 'lodash/isUndefined';
|
|
|
7
7
|
import React, { useEffect, useState } from 'react';
|
|
8
8
|
import { useTranslation } from 'react-i18next';
|
|
9
9
|
import { COUNTRY_DATA } from './CountryData';
|
|
10
|
+
import { FlagSvgs } from './FlagSvgs';
|
|
10
11
|
const PREFIX = '+';
|
|
11
|
-
const DEFAULT_MASK = '... ... ... ...
|
|
12
|
+
const DEFAULT_MASK = '... ... ... ... ... ... ...';
|
|
12
13
|
const DEFAULT_FORMAT = PREFIX + DEFAULT_MASK;
|
|
13
14
|
const ALWAYS_DEFAULT_MASK = false;
|
|
14
15
|
// Getting Country phone format
|
|
@@ -187,7 +188,8 @@ export function PhoneInput(props) {
|
|
|
187
188
|
const getOptions = (options) => {
|
|
188
189
|
return options.map((country) => (React.createElement(SelectOption, { key: country.iso2, value: country },
|
|
189
190
|
React.createElement("div", { className: "pf-v5-u-display-inline-flex" },
|
|
190
|
-
React.createElement("
|
|
191
|
+
React.createElement("svg", { className: "flag-class-select" },
|
|
192
|
+
React.createElement("use", { xlinkHref: `#cc_${country.iso2}` })),
|
|
191
193
|
country.name,
|
|
192
194
|
" (+",
|
|
193
195
|
country.dialCode,
|
|
@@ -204,7 +206,8 @@ export function PhoneInput(props) {
|
|
|
204
206
|
};
|
|
205
207
|
const placeholder = (React.createElement("div", { className: "phone-number-select-placeholder" },
|
|
206
208
|
React.createElement("div", { className: "pf-v5-u-display-inline-flex" },
|
|
207
|
-
React.createElement("
|
|
209
|
+
React.createElement("svg", { className: "flag-class-selected" },
|
|
210
|
+
React.createElement("use", { xlinkHref: `#cc_${iso2}` })),
|
|
208
211
|
iso2.toUpperCase())));
|
|
209
212
|
useEffect(() => {
|
|
210
213
|
// when user types +, it will be replaced by empty string
|
|
@@ -245,6 +248,7 @@ export function PhoneInput(props) {
|
|
|
245
248
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
246
249
|
}, [shouldNotSetCountryCode]);
|
|
247
250
|
return (React.createElement(InputGroup, { className: "phone-number-input" },
|
|
251
|
+
React.createElement(FlagSvgs, null),
|
|
248
252
|
React.createElement(InputGroupItem, null,
|
|
249
253
|
React.createElement("div", null,
|
|
250
254
|
React.createElement(Select, { variant: SelectVariant.single, "data-tracking-id": "case-phone-number-country-code", className: "phone-number-select", onToggle: (_event, isOpen) => onToggle(isOpen), onSelect: onCountrySelect, isOpen: isOpen, placeholderText: iso2 && phoneValue !== '' ? placeholder : 'Country Code', onFilter: onFilter, hasInlineFilter: true, inlineFilterPlaceholderText: t('Search'), isDisabled: props.isDisabled, toggleAriaLabel: "Country Code" }, getOptions(initializedCountries)))),
|