@moontra/moonui-pro 3.4.35 → 3.4.36
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/cdn/index.global.js +107 -107
- package/dist/cdn/index.global.js.map +1 -1
- package/dist/index.mjs +7 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -70687,7 +70687,7 @@ function formatPhoneNumber(number) {
|
|
|
70687
70687
|
return cleaned;
|
|
70688
70688
|
} else if (cleaned.length <= 6) {
|
|
70689
70689
|
return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3)}`;
|
|
70690
|
-
} else if (cleaned.length <=
|
|
70690
|
+
} else if (cleaned.length <= 8) {
|
|
70691
70691
|
return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3, 6)} ${cleaned.slice(6)}`;
|
|
70692
70692
|
} else {
|
|
70693
70693
|
return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3, 6)} ${cleaned.slice(6, 8)} ${cleaned.slice(8, 10)}`;
|
|
@@ -70713,6 +70713,12 @@ var MoonUIPhoneNumberInputSimple = React71__default.forwardRef(({
|
|
|
70713
70713
|
const [isFocused, setIsFocused] = useState(false);
|
|
70714
70714
|
const [localValue, setLocalValue] = useState(value);
|
|
70715
70715
|
const isValid = validatePhoneNumber(localValue);
|
|
70716
|
+
useEffect(() => {
|
|
70717
|
+
if (value !== void 0 && value !== localValue) {
|
|
70718
|
+
const formatted = formatPhoneNumber(value);
|
|
70719
|
+
setLocalValue(formatted);
|
|
70720
|
+
}
|
|
70721
|
+
}, [value]);
|
|
70716
70722
|
const handleChange = (e) => {
|
|
70717
70723
|
const newValue = e.target.value;
|
|
70718
70724
|
const formattedValue = formatPhoneNumber(newValue);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.36",
|
|
4
4
|
"description": "Premium React components for MoonUI - Advanced UI library with 50+ pro components including performance, interactive, and gesture components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|