formik-form-components 0.2.21 → 0.2.22
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.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1513,87 +1513,92 @@ var AppPhoneNoInput = ({
|
|
|
1513
1513
|
containerSx,
|
|
1514
1514
|
labelSx,
|
|
1515
1515
|
inputSx,
|
|
1516
|
-
errorSx
|
|
1517
|
-
...otherProps
|
|
1516
|
+
errorSx
|
|
1518
1517
|
}) => {
|
|
1519
1518
|
const { values, errors, touched, setFieldValue, setFieldTouched } = formik.useFormikContext();
|
|
1520
1519
|
const fieldError = react.useMemo(() => _19__default.default.get(errors, name), [errors, name]);
|
|
1521
1520
|
const isTouched = react.useMemo(() => _19__default.default.get(touched, name), [touched, name]);
|
|
1522
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
{
|
|
1526
|
-
|
|
1527
|
-
|
|
1521
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1522
|
+
material.Box,
|
|
1523
|
+
{
|
|
1524
|
+
sx: [{ mb: 2 }, containerSx, sx],
|
|
1525
|
+
"data-testid": `phone-input-${name}`,
|
|
1526
|
+
children: [
|
|
1527
|
+
label && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1528
|
+
material.Typography,
|
|
1528
1529
|
{
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
children: [
|
|
1535
|
-
label,
|
|
1536
|
-
required && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1537
|
-
material.Typography,
|
|
1538
|
-
{
|
|
1539
|
-
component: "span",
|
|
1540
|
-
sx: {
|
|
1541
|
-
color: "error.main",
|
|
1542
|
-
ml: 0.3
|
|
1530
|
+
variant: "subtitle2",
|
|
1531
|
+
sx: [
|
|
1532
|
+
{
|
|
1533
|
+
mb: 0.5,
|
|
1534
|
+
color: isTouched && fieldError ? "error.main" : "text.primary"
|
|
1543
1535
|
},
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
inputStyle: {
|
|
1565
|
-
width: "100%",
|
|
1566
|
-
border: isTouched && fieldError ? "1px solid #f44336" : "1px solid #ccc",
|
|
1567
|
-
padding: "10px",
|
|
1568
|
-
borderRadius: "4px",
|
|
1569
|
-
...inputSx
|
|
1570
|
-
},
|
|
1571
|
-
containerStyle: {
|
|
1572
|
-
width: "100%"
|
|
1573
|
-
},
|
|
1574
|
-
...otherProps,
|
|
1575
|
-
value: values[name],
|
|
1576
|
-
onChange: (value) => setFieldValue(name, value),
|
|
1577
|
-
onBlur: () => setFieldTouched(name, true)
|
|
1578
|
-
}
|
|
1579
|
-
),
|
|
1580
|
-
isTouched && fieldError && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1581
|
-
material.Typography,
|
|
1582
|
-
{
|
|
1583
|
-
variant: "caption",
|
|
1584
|
-
id: `${name}-error`,
|
|
1585
|
-
sx: [
|
|
1536
|
+
labelSx
|
|
1537
|
+
],
|
|
1538
|
+
children: [
|
|
1539
|
+
label,
|
|
1540
|
+
required && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1541
|
+
material.Typography,
|
|
1542
|
+
{
|
|
1543
|
+
component: "span",
|
|
1544
|
+
sx: {
|
|
1545
|
+
color: "error.main",
|
|
1546
|
+
ml: 0.3
|
|
1547
|
+
},
|
|
1548
|
+
children: "*"
|
|
1549
|
+
}
|
|
1550
|
+
)
|
|
1551
|
+
]
|
|
1552
|
+
}
|
|
1553
|
+
),
|
|
1554
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1555
|
+
PhoneInput__default.default,
|
|
1586
1556
|
{
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1557
|
+
country: defaultCountry,
|
|
1558
|
+
specialLabel: "",
|
|
1559
|
+
placeholder,
|
|
1560
|
+
inputProps: {
|
|
1561
|
+
name,
|
|
1562
|
+
id: name,
|
|
1563
|
+
required,
|
|
1564
|
+
"aria-describedby": fieldError ? `${name}-error` : void 0,
|
|
1565
|
+
"aria-invalid": !!fieldError,
|
|
1566
|
+
"aria-required": required
|
|
1567
|
+
},
|
|
1568
|
+
inputStyle: {
|
|
1569
|
+
width: "100%",
|
|
1570
|
+
border: isTouched && fieldError ? "1px solid #f44336" : "1px solid #ccc",
|
|
1571
|
+
padding: "10px",
|
|
1572
|
+
borderRadius: "4px",
|
|
1573
|
+
...inputSx
|
|
1574
|
+
},
|
|
1575
|
+
containerStyle: {
|
|
1576
|
+
width: "100%"
|
|
1577
|
+
},
|
|
1578
|
+
value: values[name],
|
|
1579
|
+
onChange: (value) => setFieldValue(name, value),
|
|
1580
|
+
onBlur: () => setFieldTouched(name, true)
|
|
1581
|
+
}
|
|
1582
|
+
),
|
|
1583
|
+
isTouched && fieldError && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1584
|
+
material.Typography,
|
|
1585
|
+
{
|
|
1586
|
+
variant: "caption",
|
|
1587
|
+
id: `${name}-error`,
|
|
1588
|
+
sx: [
|
|
1589
|
+
{
|
|
1590
|
+
mt: 0.5,
|
|
1591
|
+
display: "block",
|
|
1592
|
+
color: "error.main"
|
|
1593
|
+
},
|
|
1594
|
+
errorSx
|
|
1595
|
+
],
|
|
1596
|
+
children: String(fieldError)
|
|
1597
|
+
}
|
|
1598
|
+
)
|
|
1599
|
+
]
|
|
1600
|
+
}
|
|
1601
|
+
);
|
|
1597
1602
|
};
|
|
1598
1603
|
var AppPhoneNoInput_default = AppPhoneNoInput;
|
|
1599
1604
|
var AppRadioGroup = react.forwardRef(({
|