formik-form-components 0.2.21 → 0.2.23
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 +0 -1
- package/dist/index.js +79 -74
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +79 -74
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1485,87 +1485,92 @@ var AppPhoneNoInput = ({
|
|
|
1485
1485
|
containerSx,
|
|
1486
1486
|
labelSx,
|
|
1487
1487
|
inputSx,
|
|
1488
|
-
errorSx
|
|
1489
|
-
...otherProps
|
|
1488
|
+
errorSx
|
|
1490
1489
|
}) => {
|
|
1491
1490
|
const { values, errors, touched, setFieldValue, setFieldTouched } = useFormikContext();
|
|
1492
1491
|
const fieldError = useMemo(() => _19.get(errors, name), [errors, name]);
|
|
1493
1492
|
const isTouched = useMemo(() => _19.get(touched, name), [touched, name]);
|
|
1494
|
-
return /* @__PURE__ */ jsxs(
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
{
|
|
1498
|
-
|
|
1499
|
-
|
|
1493
|
+
return /* @__PURE__ */ jsxs(
|
|
1494
|
+
Box,
|
|
1495
|
+
{
|
|
1496
|
+
sx: [{ mb: 2 }, containerSx, sx],
|
|
1497
|
+
"data-testid": `phone-input-${name}`,
|
|
1498
|
+
children: [
|
|
1499
|
+
label && /* @__PURE__ */ jsxs(
|
|
1500
|
+
Typography,
|
|
1500
1501
|
{
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
children: [
|
|
1507
|
-
label,
|
|
1508
|
-
required && /* @__PURE__ */ jsx(
|
|
1509
|
-
Typography,
|
|
1510
|
-
{
|
|
1511
|
-
component: "span",
|
|
1512
|
-
sx: {
|
|
1513
|
-
color: "error.main",
|
|
1514
|
-
ml: 0.3
|
|
1502
|
+
variant: "subtitle2",
|
|
1503
|
+
sx: [
|
|
1504
|
+
{
|
|
1505
|
+
mb: 0.5,
|
|
1506
|
+
color: isTouched && fieldError ? "error.main" : "text.primary"
|
|
1515
1507
|
},
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
inputStyle: {
|
|
1537
|
-
width: "100%",
|
|
1538
|
-
border: isTouched && fieldError ? "1px solid #f44336" : "1px solid #ccc",
|
|
1539
|
-
padding: "10px",
|
|
1540
|
-
borderRadius: "4px",
|
|
1541
|
-
...inputSx
|
|
1542
|
-
},
|
|
1543
|
-
containerStyle: {
|
|
1544
|
-
width: "100%"
|
|
1545
|
-
},
|
|
1546
|
-
...otherProps,
|
|
1547
|
-
value: values[name],
|
|
1548
|
-
onChange: (value) => setFieldValue(name, value),
|
|
1549
|
-
onBlur: () => setFieldTouched(name, true)
|
|
1550
|
-
}
|
|
1551
|
-
),
|
|
1552
|
-
isTouched && fieldError && /* @__PURE__ */ jsx(
|
|
1553
|
-
Typography,
|
|
1554
|
-
{
|
|
1555
|
-
variant: "caption",
|
|
1556
|
-
id: `${name}-error`,
|
|
1557
|
-
sx: [
|
|
1508
|
+
labelSx
|
|
1509
|
+
],
|
|
1510
|
+
children: [
|
|
1511
|
+
label,
|
|
1512
|
+
required && /* @__PURE__ */ jsx(
|
|
1513
|
+
Typography,
|
|
1514
|
+
{
|
|
1515
|
+
component: "span",
|
|
1516
|
+
sx: {
|
|
1517
|
+
color: "error.main",
|
|
1518
|
+
ml: 0.3
|
|
1519
|
+
},
|
|
1520
|
+
children: "*"
|
|
1521
|
+
}
|
|
1522
|
+
)
|
|
1523
|
+
]
|
|
1524
|
+
}
|
|
1525
|
+
),
|
|
1526
|
+
/* @__PURE__ */ jsx(
|
|
1527
|
+
PhoneInput,
|
|
1558
1528
|
{
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1529
|
+
country: defaultCountry,
|
|
1530
|
+
specialLabel: "",
|
|
1531
|
+
placeholder,
|
|
1532
|
+
inputProps: {
|
|
1533
|
+
name,
|
|
1534
|
+
id: name,
|
|
1535
|
+
required,
|
|
1536
|
+
"aria-describedby": fieldError ? `${name}-error` : void 0,
|
|
1537
|
+
"aria-invalid": !!fieldError,
|
|
1538
|
+
"aria-required": required
|
|
1539
|
+
},
|
|
1540
|
+
inputStyle: {
|
|
1541
|
+
width: "100%",
|
|
1542
|
+
border: isTouched && fieldError ? "1px solid #f44336" : "1px solid #ccc",
|
|
1543
|
+
padding: "10px",
|
|
1544
|
+
borderRadius: "4px",
|
|
1545
|
+
...inputSx
|
|
1546
|
+
},
|
|
1547
|
+
containerStyle: {
|
|
1548
|
+
width: "100%"
|
|
1549
|
+
},
|
|
1550
|
+
value: values[name],
|
|
1551
|
+
onChange: (value) => setFieldValue(name, value),
|
|
1552
|
+
onBlur: () => setFieldTouched(name, true)
|
|
1553
|
+
}
|
|
1554
|
+
),
|
|
1555
|
+
isTouched && fieldError && /* @__PURE__ */ jsx(
|
|
1556
|
+
Typography,
|
|
1557
|
+
{
|
|
1558
|
+
variant: "caption",
|
|
1559
|
+
id: `${name}-error`,
|
|
1560
|
+
sx: [
|
|
1561
|
+
{
|
|
1562
|
+
mt: 0.5,
|
|
1563
|
+
display: "block",
|
|
1564
|
+
color: "error.main"
|
|
1565
|
+
},
|
|
1566
|
+
errorSx
|
|
1567
|
+
],
|
|
1568
|
+
children: String(fieldError)
|
|
1569
|
+
}
|
|
1570
|
+
)
|
|
1571
|
+
]
|
|
1572
|
+
}
|
|
1573
|
+
);
|
|
1569
1574
|
};
|
|
1570
1575
|
var AppPhoneNoInput_default = AppPhoneNoInput;
|
|
1571
1576
|
var AppRadioGroup = forwardRef(({
|