@arkyn/components 1.4.42 → 1.4.43
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 +28635 -16882
- package/dist/bundle.umd.cjs +383 -123
- package/dist/components/PhoneInput/index.d.ts.map +1 -1
- package/dist/components/PhoneInput/index.js +2 -2
- package/package.json +1 -1
- package/src/components/PhoneInput/index.tsx +2 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PhoneInput/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAe,eAAe,EAAE,MAAM,cAAc,CAAC;AAY5D,iBAAS,UAAU,CAAC,KAAK,EAAE,eAAe,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PhoneInput/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAe,eAAe,EAAE,MAAM,cAAc,CAAC;AAY5D,iBAAS,UAAU,CAAC,KAAK,EAAE,eAAe,2CAiKzC;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
@@ -10,7 +10,7 @@ import { PhoneInputCountrySelector } from "./components/PhoneInputCountrySelecto
|
|
10
10
|
import { PhoneInputMask } from "./components/PhoneInputMask";
|
11
11
|
import { getDefaultFormatPhoneNumber } from "./services/getDefaultFormatPhoneNumber";
|
12
12
|
function PhoneInput(props) {
|
13
|
-
const { defaultCountry, className = "", disabled = false, isError: baseIsError = false, isLoading = false, readOnly = false, size = "md", defaultValue = "", variant = "solid", name, searchCountryPlaceholder = "Pesquisar país", notFoundCountryText = "Nenhum país encontrado", ...rest } = props;
|
13
|
+
const { defaultCountry, className = "", disabled = false, isError: baseIsError = false, isLoading = false, readOnly = false, size = "md", defaultValue = "", variant = "solid", name, onChange, searchCountryPlaceholder = "Pesquisar país", notFoundCountryText = "Nenhum país encontrado", ...rest } = props;
|
14
14
|
const defaultData = getDefaultFormatPhoneNumber(defaultValue);
|
15
15
|
const [isFocused, setIsFocused] = useState(false);
|
16
16
|
const [search, setSearch] = useState("");
|
@@ -85,7 +85,7 @@ function PhoneInput(props) {
|
|
85
85
|
}, isActive: country.iso === currentCountry.iso, size: size }, country.iso))), countries.filter((country) => filterCountryFunction(country))
|
86
86
|
.length === 0 && _jsx("p", { children: notFoundCountryText })] }), _jsx(PhoneInputCountriesOverlay, { isOpen: showCountryOptions, onClick: handleCloseCountryOptions }), _jsx(PhoneInputMask, { ref: inputPhoneMaskRef, currentCountry: currentCountry, value: value, onChange: (e) => {
|
87
87
|
setValue(e);
|
88
|
-
|
88
|
+
onChange && onChange(inputValue());
|
89
89
|
}, disabled: disabled, onBlur: handleInputBlur, onFocus: handleInputFocus, size: size }), _jsx("input", { ref: inputRef, type: "hidden", name: name, value: inputValue() })] }));
|
90
90
|
}
|
91
91
|
export { PhoneInput };
|
package/package.json
CHANGED
@@ -23,6 +23,7 @@ function PhoneInput(props: PhoneInputProps) {
|
|
23
23
|
defaultValue = "",
|
24
24
|
variant = "solid",
|
25
25
|
name,
|
26
|
+
onChange,
|
26
27
|
searchCountryPlaceholder = "Pesquisar país",
|
27
28
|
notFoundCountryText = "Nenhum país encontrado",
|
28
29
|
...rest
|
@@ -160,7 +161,7 @@ function PhoneInput(props: PhoneInputProps) {
|
|
160
161
|
value={value}
|
161
162
|
onChange={(e) => {
|
162
163
|
setValue(e);
|
163
|
-
|
164
|
+
onChange && onChange(inputValue());
|
164
165
|
}}
|
165
166
|
disabled={disabled}
|
166
167
|
onBlur={handleInputBlur}
|