formik-form-components 0.2.23 → 0.2.25
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/index.d.ts +3 -1
- package/dist/index.js +38 -29
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +38 -29
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -4
package/dist/index.mjs
CHANGED
|
@@ -12,8 +12,8 @@ import Autocomplete3 from '@mui/material/Autocomplete';
|
|
|
12
12
|
import Typography9 from '@mui/material/Typography';
|
|
13
13
|
import { Icon } from '@iconify/react';
|
|
14
14
|
import Select from '@mui/material/Select';
|
|
15
|
-
import PhoneInput from 'react-phone-input
|
|
16
|
-
import 'react-phone-input
|
|
15
|
+
import PhoneInput from 'react-phone-number-input';
|
|
16
|
+
import 'react-phone-number-input/style.css';
|
|
17
17
|
import { useEditor, EditorContent } from '@tiptap/react';
|
|
18
18
|
import StarterKit from '@tiptap/starter-kit';
|
|
19
19
|
import Link from '@tiptap/extension-link';
|
|
@@ -1479,13 +1479,15 @@ var AppPhoneNoInput = ({
|
|
|
1479
1479
|
name,
|
|
1480
1480
|
label,
|
|
1481
1481
|
required = false,
|
|
1482
|
-
defaultCountry = "
|
|
1483
|
-
placeholder,
|
|
1482
|
+
defaultCountry = "US",
|
|
1483
|
+
placeholder = "Enter phone number",
|
|
1484
1484
|
sx,
|
|
1485
1485
|
containerSx,
|
|
1486
1486
|
labelSx,
|
|
1487
1487
|
inputSx,
|
|
1488
|
-
errorSx
|
|
1488
|
+
errorSx,
|
|
1489
|
+
international = true,
|
|
1490
|
+
withCountryCallingCode = true
|
|
1489
1491
|
}) => {
|
|
1490
1492
|
const { values, errors, touched, setFieldValue, setFieldTouched } = useFormikContext();
|
|
1491
1493
|
const fieldError = useMemo(() => _19.get(errors, name), [errors, name]);
|
|
@@ -1524,32 +1526,39 @@ var AppPhoneNoInput = ({
|
|
|
1524
1526
|
}
|
|
1525
1527
|
),
|
|
1526
1528
|
/* @__PURE__ */ jsx(
|
|
1527
|
-
|
|
1529
|
+
Box,
|
|
1528
1530
|
{
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
},
|
|
1547
|
-
containerStyle: {
|
|
1548
|
-
width: "100%"
|
|
1531
|
+
sx: {
|
|
1532
|
+
"& .PhoneInput": {
|
|
1533
|
+
width: "100%"
|
|
1534
|
+
},
|
|
1535
|
+
"& .PhoneInputInput": {
|
|
1536
|
+
width: "100%",
|
|
1537
|
+
border: isTouched && fieldError ? "1px solid #f44336" : "1px solid #ccc",
|
|
1538
|
+
padding: "10px",
|
|
1539
|
+
borderRadius: "4px",
|
|
1540
|
+
fontFamily: "inherit",
|
|
1541
|
+
fontSize: "inherit",
|
|
1542
|
+
...inputSx
|
|
1543
|
+
},
|
|
1544
|
+
"& .PhoneInputCountrySelect": {
|
|
1545
|
+
border: isTouched && fieldError ? "1px solid #f44336" : "1px solid #ccc",
|
|
1546
|
+
borderRadius: "4px"
|
|
1547
|
+
}
|
|
1549
1548
|
},
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1549
|
+
children: /* @__PURE__ */ jsx(
|
|
1550
|
+
PhoneInput,
|
|
1551
|
+
{
|
|
1552
|
+
international,
|
|
1553
|
+
withCountryCallingCode,
|
|
1554
|
+
defaultCountry,
|
|
1555
|
+
placeholder,
|
|
1556
|
+
value: values[name],
|
|
1557
|
+
onChange: (value) => setFieldValue(name, value || ""),
|
|
1558
|
+
onBlur: () => setFieldTouched(name, true),
|
|
1559
|
+
error: fieldError ? "Invalid phone number" : void 0
|
|
1560
|
+
}
|
|
1561
|
+
)
|
|
1553
1562
|
}
|
|
1554
1563
|
),
|
|
1555
1564
|
isTouched && fieldError && /* @__PURE__ */ jsx(
|