@arkyn/components 1.4.57 → 1.5.1
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/dist/bundle.js +117994 -12130
- package/dist/bundle.umd.cjs +2412 -72
- package/dist/components/PhoneInput/index.d.ts.map +1 -1
- package/dist/components/PhoneInput/index.js +3 -6
- package/dist/components/PhoneInput/services/getDefaultFormatPhoneNumber.d.ts +75 -75
- package/package.json +1 -1
- package/src/components/PhoneInput/index.tsx +3 -6
- package/vite.config.js +0 -1
@@ -26,7 +26,7 @@ function PhoneInput(props: PhoneInputProps) {
|
|
26
26
|
onChange,
|
27
27
|
searchCountryPlaceholder = "Pesquisar país",
|
28
28
|
notFoundCountryText = "Nenhum país encontrado",
|
29
|
-
|
29
|
+
...rest
|
30
30
|
} = props;
|
31
31
|
|
32
32
|
const defaultData = getDefaultFormatPhoneNumber(defaultValue);
|
@@ -35,9 +35,6 @@ function PhoneInput(props: PhoneInputProps) {
|
|
35
35
|
const [search, setSearch] = useState("");
|
36
36
|
const [showCountryOptions, setShowCountryOptions] = useState(false);
|
37
37
|
const [value, setValue] = useState(defaultData.formattedNumber || "");
|
38
|
-
const usedValue = fixedValue
|
39
|
-
? getDefaultFormatPhoneNumber(fixedValue).formattedNumber
|
40
|
-
: value;
|
41
38
|
|
42
39
|
const [currentCountry, setCurrentCountry] = useState<CountryType>(() => {
|
43
40
|
if (defaultData.country) return defaultData.country;
|
@@ -104,7 +101,7 @@ function PhoneInput(props: PhoneInputProps) {
|
|
104
101
|
let returnValue = currentCountry.code;
|
105
102
|
if (currentCountry.prefix) returnValue += `-${currentCountry.prefix}`;
|
106
103
|
returnValue += " ";
|
107
|
-
returnValue += removeNumberMasks(props ||
|
104
|
+
returnValue += removeNumberMasks(props || value);
|
108
105
|
return returnValue;
|
109
106
|
}
|
110
107
|
|
@@ -161,7 +158,7 @@ function PhoneInput(props: PhoneInputProps) {
|
|
161
158
|
<PhoneInputMask
|
162
159
|
ref={inputPhoneMaskRef}
|
163
160
|
currentCountry={currentCountry}
|
164
|
-
value={
|
161
|
+
value={value}
|
165
162
|
onChange={(e) => {
|
166
163
|
setValue(e);
|
167
164
|
onChange && onChange(inputValue(e));
|