@lets-events/react 12.9.2 → 12.10.0
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/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +12 -0
- package/dist/index.d.mts +15 -2
- package/dist/index.d.ts +15 -2
- package/dist/index.js +298 -202
- package/dist/index.mjs +266 -171
- package/package.json +1 -1
- package/src/components/Button/index.tsx +14 -2
- package/src/components/Button/styledComponents.ts +42 -1
- package/src/components/FormFields/DateAndTimeFormField.tsx +2 -2
- package/src/components/MenuDropdown/styledComponents.ts +1 -1
- package/src/components/ToggleElement/index.tsx +58 -0
- package/src/index.tsx +1 -1
package/dist/index.js
CHANGED
|
@@ -149,7 +149,7 @@ var require_react_is_development = __commonJS({
|
|
|
149
149
|
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
150
150
|
var Element = REACT_ELEMENT_TYPE;
|
|
151
151
|
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
152
|
-
var
|
|
152
|
+
var Fragment7 = REACT_FRAGMENT_TYPE;
|
|
153
153
|
var Lazy = REACT_LAZY_TYPE;
|
|
154
154
|
var Memo = REACT_MEMO_TYPE;
|
|
155
155
|
var Portal = REACT_PORTAL_TYPE;
|
|
@@ -208,7 +208,7 @@ var require_react_is_development = __commonJS({
|
|
|
208
208
|
exports2.ContextProvider = ContextProvider;
|
|
209
209
|
exports2.Element = Element;
|
|
210
210
|
exports2.ForwardRef = ForwardRef;
|
|
211
|
-
exports2.Fragment =
|
|
211
|
+
exports2.Fragment = Fragment7;
|
|
212
212
|
exports2.Lazy = Lazy;
|
|
213
213
|
exports2.Memo = Memo;
|
|
214
214
|
exports2.Portal = Portal;
|
|
@@ -959,6 +959,7 @@ __export(index_exports, {
|
|
|
959
959
|
TimerPickerContentStyled: () => TimerPickerContentStyled,
|
|
960
960
|
ToastItem: () => ToastItem,
|
|
961
961
|
ToastProvider: () => ToastProvider,
|
|
962
|
+
ToggleElement: () => ToggleElement,
|
|
962
963
|
Tooltip: () => Tooltip,
|
|
963
964
|
TooltipContent: () => TooltipContent,
|
|
964
965
|
TooltipProvider: () => TooltipProvider,
|
|
@@ -1563,6 +1564,7 @@ var ButtonStyled = styled(import_themes2.Button, {
|
|
|
1563
1564
|
$$buttonBgColor: "$colors$grey50",
|
|
1564
1565
|
$$buttonBorderColor: "inherit",
|
|
1565
1566
|
$$buttonOutlinedColor: "inherit",
|
|
1567
|
+
$$buttonToggleBgColor: "transparent",
|
|
1566
1568
|
fontFamily: "$default",
|
|
1567
1569
|
letterSpacing: 0,
|
|
1568
1570
|
border: 0,
|
|
@@ -1585,6 +1587,7 @@ var ButtonStyled = styled(import_themes2.Button, {
|
|
|
1585
1587
|
$$buttonColor: "$colors$brand500",
|
|
1586
1588
|
$$buttonBorderColor: "$colors$brand600",
|
|
1587
1589
|
$$buttonOutlinedColor: "$$buttonColor",
|
|
1590
|
+
$$buttonToggleBgColor: "rgba(0, 78, 210, 0.2)",
|
|
1588
1591
|
"&:hover": {
|
|
1589
1592
|
$$buttonColor: "$colors$brand600",
|
|
1590
1593
|
$$buttonBorderColor: "$colors$brand700"
|
|
@@ -1604,6 +1607,7 @@ var ButtonStyled = styled(import_themes2.Button, {
|
|
|
1604
1607
|
$$buttonColor: "$colors$purple500",
|
|
1605
1608
|
$$buttonBorderColor: "$colors$purple300",
|
|
1606
1609
|
$$buttonOutlinedColor: "$$buttonColor",
|
|
1610
|
+
$$buttonToggleBgColor: "rgba(137, 97, 216, 0.2)",
|
|
1607
1611
|
"&:hover": {
|
|
1608
1612
|
$$buttonColor: "$colors$purple600",
|
|
1609
1613
|
$$buttonBorderColor: "$colors$purple700",
|
|
@@ -1627,6 +1631,7 @@ var ButtonStyled = styled(import_themes2.Button, {
|
|
|
1627
1631
|
$$buttonColor: "$colors$error600",
|
|
1628
1632
|
$$buttonBorderColor: "$colors$error500",
|
|
1629
1633
|
$$buttonOutlinedColor: " $colors$error500",
|
|
1634
|
+
$$buttonToggleBgColor: "rgba(219, 54, 68, 0.2)",
|
|
1630
1635
|
"&:hover": {
|
|
1631
1636
|
$$buttonColor: "$colors$error600",
|
|
1632
1637
|
$$buttonBorderColor: "$colors$error700",
|
|
@@ -1647,6 +1652,7 @@ var ButtonStyled = styled(import_themes2.Button, {
|
|
|
1647
1652
|
$$buttonColor: "$colors$info500",
|
|
1648
1653
|
$$buttonBorderColor: "$colors$info600",
|
|
1649
1654
|
$$buttonOutlinedColor: "$$buttonColor",
|
|
1655
|
+
$$buttonToggleBgColor: "rgba(2, 120, 254, 0.2)",
|
|
1650
1656
|
"&:hover": {
|
|
1651
1657
|
$$buttonColor: "$colors$info600",
|
|
1652
1658
|
$$buttonBorderColor: "$colors$info700",
|
|
@@ -1667,6 +1673,7 @@ var ButtonStyled = styled(import_themes2.Button, {
|
|
|
1667
1673
|
$$buttonColor: "$colors$success500",
|
|
1668
1674
|
$$buttonBorderColor: "$colors$success600",
|
|
1669
1675
|
$$buttonOutlinedColor: "$$buttonColor",
|
|
1676
|
+
$$buttonToggleBgColor: "rgba(38, 167, 67, 0.2)",
|
|
1670
1677
|
"&:hover": {
|
|
1671
1678
|
$$buttonColor: "$colors$success600",
|
|
1672
1679
|
$$buttonBorderColor: "$colors$success700",
|
|
@@ -1687,6 +1694,7 @@ var ButtonStyled = styled(import_themes2.Button, {
|
|
|
1687
1694
|
$$buttonColor: "$colors$warning500",
|
|
1688
1695
|
$$buttonBorderColor: "$colors$warning600",
|
|
1689
1696
|
$$buttonOutlinedColor: "$$buttonColor",
|
|
1697
|
+
$$buttonToggleBgColor: "rgba(255, 193, 7, 0.2)",
|
|
1690
1698
|
"&:hover": {
|
|
1691
1699
|
$$buttonColor: "$colors$warning600",
|
|
1692
1700
|
$$buttonBorderColor: "$colors$warning700",
|
|
@@ -1707,6 +1715,7 @@ var ButtonStyled = styled(import_themes2.Button, {
|
|
|
1707
1715
|
$$buttonColor: "$colors$neutral600",
|
|
1708
1716
|
$$buttonBorderColor: "$colors$neutral300",
|
|
1709
1717
|
$$buttonOutlinedColor: "$$buttonColor",
|
|
1718
|
+
$$buttonToggleBgColor: "rgba(76, 79, 84, 0.2)",
|
|
1710
1719
|
"&:hover": {
|
|
1711
1720
|
$$buttonColor: "$colors$neutral700",
|
|
1712
1721
|
$$buttonBgColor: "$colors$neutral100",
|
|
@@ -1727,6 +1736,7 @@ var ButtonStyled = styled(import_themes2.Button, {
|
|
|
1727
1736
|
$$buttonColor: "$colors$neutral50",
|
|
1728
1737
|
$$buttonBorderColor: "$colors$neutral300",
|
|
1729
1738
|
$$buttonOutlinedColor: "$colors$neutral50",
|
|
1739
|
+
$$buttonToggleBgColor: "rgba(255, 255, 255, 0.2)",
|
|
1730
1740
|
"&:hover": {
|
|
1731
1741
|
$$buttonColor: "$colors$neutral100",
|
|
1732
1742
|
$$buttonBorderColor: "$colors$neutral300",
|
|
@@ -1779,6 +1789,18 @@ var ButtonStyled = styled(import_themes2.Button, {
|
|
|
1779
1789
|
height: "unset",
|
|
1780
1790
|
color: "$$buttonColor"
|
|
1781
1791
|
},
|
|
1792
|
+
toggle: {
|
|
1793
|
+
backgroundColor: "transparent",
|
|
1794
|
+
boxShadow: "none",
|
|
1795
|
+
padding: "$6 $12",
|
|
1796
|
+
border: 0,
|
|
1797
|
+
height: "2rem",
|
|
1798
|
+
color: "$$buttonColor",
|
|
1799
|
+
borderRadius: ".5rem",
|
|
1800
|
+
"&:hover": {
|
|
1801
|
+
backgroundColor: "$$buttonToggleBgColor"
|
|
1802
|
+
}
|
|
1803
|
+
},
|
|
1782
1804
|
contained: {
|
|
1783
1805
|
color: "$grey50",
|
|
1784
1806
|
backgroundColor: "$$buttonColor",
|
|
@@ -1804,7 +1826,7 @@ var ButtonStyled = styled(import_themes2.Button, {
|
|
|
1804
1826
|
menuDropdownItem: {
|
|
1805
1827
|
backgroundColor: "transparent",
|
|
1806
1828
|
boxShadow: "none",
|
|
1807
|
-
padding: "0.
|
|
1829
|
+
padding: "0.5rem 1rem",
|
|
1808
1830
|
border: 0,
|
|
1809
1831
|
height: "unset",
|
|
1810
1832
|
color: "$$buttonColor",
|
|
@@ -1814,6 +1836,20 @@ var ButtonStyled = styled(import_themes2.Button, {
|
|
|
1814
1836
|
"&:hover": {
|
|
1815
1837
|
backgroundColor: "$dark100"
|
|
1816
1838
|
}
|
|
1839
|
+
},
|
|
1840
|
+
menuDropdownItemDelete: {
|
|
1841
|
+
backgroundColor: "transparent",
|
|
1842
|
+
boxShadow: "none",
|
|
1843
|
+
padding: "0.5rem 1rem",
|
|
1844
|
+
border: 0,
|
|
1845
|
+
height: "unset",
|
|
1846
|
+
color: "$$buttonColor",
|
|
1847
|
+
width: "100%",
|
|
1848
|
+
borderRadius: 0,
|
|
1849
|
+
whiteSpace: "nowrap",
|
|
1850
|
+
"&:hover": {
|
|
1851
|
+
backgroundColor: "$red100"
|
|
1852
|
+
}
|
|
1817
1853
|
}
|
|
1818
1854
|
},
|
|
1819
1855
|
fontWeight: {
|
|
@@ -1822,6 +1858,11 @@ var ButtonStyled = styled(import_themes2.Button, {
|
|
|
1822
1858
|
semibold: { fontWeight: "$semibold" },
|
|
1823
1859
|
bold: { fontWeight: "$bold" }
|
|
1824
1860
|
},
|
|
1861
|
+
textAlign: {
|
|
1862
|
+
center: { textAlign: "center", justifyContent: "center" },
|
|
1863
|
+
left: { textAlign: "left", justifyContent: "flex-start" },
|
|
1864
|
+
right: { textAlign: "right", justifyContent: "flex-end" }
|
|
1865
|
+
},
|
|
1825
1866
|
outlinedBgColor: {
|
|
1826
1867
|
neutral: {},
|
|
1827
1868
|
transparent: {
|
|
@@ -1855,6 +1896,7 @@ var ButtonStyled = styled(import_themes2.Button, {
|
|
|
1855
1896
|
color: "brand",
|
|
1856
1897
|
size: "medium",
|
|
1857
1898
|
fontWeight: "medium",
|
|
1899
|
+
textAlign: "center",
|
|
1858
1900
|
outlinedBgColor: "transparent"
|
|
1859
1901
|
}
|
|
1860
1902
|
});
|
|
@@ -1984,10 +2026,20 @@ function Flex(_a) {
|
|
|
1984
2026
|
|
|
1985
2027
|
// src/components/Button/index.tsx
|
|
1986
2028
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
2029
|
+
var getJustifyByTextAlign = (textAlign) => {
|
|
2030
|
+
switch (textAlign) {
|
|
2031
|
+
case "left":
|
|
2032
|
+
return "start";
|
|
2033
|
+
case "right":
|
|
2034
|
+
return "end";
|
|
2035
|
+
default:
|
|
2036
|
+
return "center";
|
|
2037
|
+
}
|
|
2038
|
+
};
|
|
1987
2039
|
function Button(_a) {
|
|
1988
2040
|
var _b = _a, { asChild, children, loading } = _b, props = __objRest(_b, ["asChild", "children", "loading"]);
|
|
1989
2041
|
const Component = asChild ? import_themes4.Button : "button";
|
|
1990
|
-
const { size, disabled } = props;
|
|
2042
|
+
const { size, disabled, textAlign = "center" } = props;
|
|
1991
2043
|
const spinnerSize = (0, import_react2.useMemo)(() => {
|
|
1992
2044
|
switch (size) {
|
|
1993
2045
|
case "small":
|
|
@@ -2006,7 +2058,7 @@ function Button(_a) {
|
|
|
2006
2058
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2007
2059
|
Flex,
|
|
2008
2060
|
{
|
|
2009
|
-
justify:
|
|
2061
|
+
justify: getJustifyByTextAlign(textAlign),
|
|
2010
2062
|
align: "center",
|
|
2011
2063
|
css: { visibility: loading ? "hidden" : void 0 },
|
|
2012
2064
|
children
|
|
@@ -3862,7 +3914,7 @@ var MenuItemsContainerStyled = styled("div", {
|
|
|
3862
3914
|
top: "2.125rem",
|
|
3863
3915
|
zIndex: "999",
|
|
3864
3916
|
width: "fit-content",
|
|
3865
|
-
minWidth: "
|
|
3917
|
+
minWidth: "6rem",
|
|
3866
3918
|
background: "#fff",
|
|
3867
3919
|
maxWidth: "18.75rem",
|
|
3868
3920
|
margin: "auto",
|
|
@@ -10399,9 +10451,52 @@ var Divider = styled("div", {
|
|
|
10399
10451
|
height: "1px"
|
|
10400
10452
|
});
|
|
10401
10453
|
|
|
10454
|
+
// src/components/ToggleElement/index.tsx
|
|
10455
|
+
var import_react20 = require("react");
|
|
10456
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
10457
|
+
function ToggleElement({
|
|
10458
|
+
children,
|
|
10459
|
+
label,
|
|
10460
|
+
openedLabel,
|
|
10461
|
+
defaultOpen = false,
|
|
10462
|
+
open,
|
|
10463
|
+
hideButtonWhenOpen = true,
|
|
10464
|
+
buttonProps,
|
|
10465
|
+
onOpenChange
|
|
10466
|
+
}) {
|
|
10467
|
+
const [internalOpen, setInternalOpen] = (0, import_react20.useState)(defaultOpen);
|
|
10468
|
+
const isControlled = open !== void 0;
|
|
10469
|
+
const isOpen = isControlled ? open : internalOpen;
|
|
10470
|
+
const handleClick = () => {
|
|
10471
|
+
const nextOpen = !isOpen;
|
|
10472
|
+
if (!isControlled) {
|
|
10473
|
+
setInternalOpen(nextOpen);
|
|
10474
|
+
}
|
|
10475
|
+
onOpenChange == null ? void 0 : onOpenChange(nextOpen);
|
|
10476
|
+
};
|
|
10477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
10478
|
+
(!isOpen || !hideButtonWhenOpen) && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
10479
|
+
Button,
|
|
10480
|
+
__spreadProps(__spreadValues({
|
|
10481
|
+
type: "button",
|
|
10482
|
+
variant: "toggle",
|
|
10483
|
+
color: "brand",
|
|
10484
|
+
size: "small"
|
|
10485
|
+
}, buttonProps), {
|
|
10486
|
+
onClick: handleClick,
|
|
10487
|
+
children: [
|
|
10488
|
+
!isOpen && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon, { name: "plus", size: "md" }),
|
|
10489
|
+
isOpen ? openedLabel != null ? openedLabel : label : label
|
|
10490
|
+
]
|
|
10491
|
+
})
|
|
10492
|
+
),
|
|
10493
|
+
isOpen && children
|
|
10494
|
+
] });
|
|
10495
|
+
}
|
|
10496
|
+
|
|
10402
10497
|
// src/components/Grid.tsx
|
|
10403
10498
|
var import_themes20 = require("@radix-ui/themes");
|
|
10404
|
-
var
|
|
10499
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
10405
10500
|
var GridStyled = styled(import_themes20.Grid, {
|
|
10406
10501
|
display: "grid",
|
|
10407
10502
|
variants: {
|
|
@@ -10523,12 +10618,12 @@ var GridStyled = styled(import_themes20.Grid, {
|
|
|
10523
10618
|
});
|
|
10524
10619
|
function Grid(_a) {
|
|
10525
10620
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
10526
|
-
return /* @__PURE__ */ (0,
|
|
10621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(GridStyled, __spreadProps(__spreadValues({}, props), { children }));
|
|
10527
10622
|
}
|
|
10528
10623
|
|
|
10529
10624
|
// src/components/Container.tsx
|
|
10530
10625
|
var import_themes21 = require("@radix-ui/themes");
|
|
10531
|
-
var
|
|
10626
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
10532
10627
|
var ContainerStyled = styled(import_themes21.Container, {
|
|
10533
10628
|
variants: {
|
|
10534
10629
|
size: {
|
|
@@ -10558,12 +10653,12 @@ var ContainerStyled = styled(import_themes21.Container, {
|
|
|
10558
10653
|
});
|
|
10559
10654
|
function Container(_a) {
|
|
10560
10655
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
10561
|
-
return /* @__PURE__ */ (0,
|
|
10656
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ContainerStyled, __spreadProps(__spreadValues({}, props), { children }));
|
|
10562
10657
|
}
|
|
10563
10658
|
|
|
10564
10659
|
// src/components/Section.tsx
|
|
10565
10660
|
var import_themes22 = require("@radix-ui/themes");
|
|
10566
|
-
var
|
|
10661
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
10567
10662
|
var SectionStyled = styled(import_themes22.Section, {
|
|
10568
10663
|
variants: {
|
|
10569
10664
|
size: {
|
|
@@ -10587,28 +10682,28 @@ var SectionStyled = styled(import_themes22.Section, {
|
|
|
10587
10682
|
});
|
|
10588
10683
|
function Section(_a) {
|
|
10589
10684
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
10590
|
-
return /* @__PURE__ */ (0,
|
|
10685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SectionStyled, __spreadProps(__spreadValues({}, props), { children }));
|
|
10591
10686
|
}
|
|
10592
10687
|
|
|
10593
10688
|
// src/components/FormFields/subComponents/ErrorFormMessage.tsx
|
|
10594
10689
|
var import_free_solid_svg_icons4 = require("@fortawesome/free-solid-svg-icons");
|
|
10595
10690
|
var import_react_fontawesome4 = require("@fortawesome/react-fontawesome");
|
|
10596
|
-
var
|
|
10691
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
10597
10692
|
var ErrorFormMessage = ({ message: message2 }) => {
|
|
10598
10693
|
if (!message2) return null;
|
|
10599
10694
|
if (typeof message2 !== "string") {
|
|
10600
10695
|
return null;
|
|
10601
10696
|
}
|
|
10602
|
-
return /* @__PURE__ */ (0,
|
|
10603
|
-
/* @__PURE__ */ (0,
|
|
10604
|
-
/* @__PURE__ */ (0,
|
|
10697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Flex, { justify: "start", align: "center", gap: 6, children: [
|
|
10698
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_fontawesome4.FontAwesomeIcon, { icon: import_free_solid_svg_icons4.faXmarkCircle, color: colors.error600, size: "1x" }),
|
|
10699
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { typography: "bodyXS", fontWeight: "medium", color: "error600", children: message2 })
|
|
10605
10700
|
] });
|
|
10606
10701
|
};
|
|
10607
10702
|
|
|
10608
10703
|
// src/components/FormFields/subComponents/FormLabel.tsx
|
|
10609
10704
|
var import_react_fontawesome5 = require("@fortawesome/react-fontawesome");
|
|
10610
10705
|
var import_free_solid_svg_icons5 = require("@fortawesome/free-solid-svg-icons");
|
|
10611
|
-
var
|
|
10706
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
10612
10707
|
var FormLabel = ({
|
|
10613
10708
|
name,
|
|
10614
10709
|
label,
|
|
@@ -10616,8 +10711,8 @@ var FormLabel = ({
|
|
|
10616
10711
|
required
|
|
10617
10712
|
}) => {
|
|
10618
10713
|
if (!label) return null;
|
|
10619
|
-
return /* @__PURE__ */ (0,
|
|
10620
|
-
/* @__PURE__ */ (0,
|
|
10714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Flex, { align: "start", gap: 6, children: [
|
|
10715
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
10621
10716
|
Text,
|
|
10622
10717
|
{
|
|
10623
10718
|
typography: "labelMedium",
|
|
@@ -10627,13 +10722,13 @@ var FormLabel = ({
|
|
|
10627
10722
|
children: label
|
|
10628
10723
|
}
|
|
10629
10724
|
),
|
|
10630
|
-
required && /* @__PURE__ */ (0,
|
|
10725
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_fontawesome5.FontAwesomeIcon, { icon: import_free_solid_svg_icons5.faAsterisk, fontSize: "8px", color: "#AD1F2B" })
|
|
10631
10726
|
] });
|
|
10632
10727
|
};
|
|
10633
10728
|
|
|
10634
10729
|
// src/components/FormFields/TextAreaFormField.tsx
|
|
10635
10730
|
var import_react_hook_form = require("react-hook-form");
|
|
10636
|
-
var
|
|
10731
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
10637
10732
|
var TextAreaFormField = (_a) => {
|
|
10638
10733
|
var _b = _a, {
|
|
10639
10734
|
name,
|
|
@@ -10665,8 +10760,8 @@ var TextAreaFormField = (_a) => {
|
|
|
10665
10760
|
required: required ? validationErrorMessage : false,
|
|
10666
10761
|
validate
|
|
10667
10762
|
};
|
|
10668
|
-
return /* @__PURE__ */ (0,
|
|
10669
|
-
/* @__PURE__ */ (0,
|
|
10763
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Flex, { direction: "column", children: [
|
|
10764
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
10670
10765
|
FormLabel,
|
|
10671
10766
|
{
|
|
10672
10767
|
name,
|
|
@@ -10675,7 +10770,7 @@ var TextAreaFormField = (_a) => {
|
|
|
10675
10770
|
haveError
|
|
10676
10771
|
}
|
|
10677
10772
|
),
|
|
10678
|
-
/* @__PURE__ */ (0,
|
|
10773
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
10679
10774
|
TextareaField,
|
|
10680
10775
|
__spreadProps(__spreadValues(__spreadValues({}, props), register(name, validationRules)), {
|
|
10681
10776
|
placeholder,
|
|
@@ -10685,15 +10780,15 @@ var TextAreaFormField = (_a) => {
|
|
|
10685
10780
|
top
|
|
10686
10781
|
})
|
|
10687
10782
|
),
|
|
10688
|
-
/* @__PURE__ */ (0,
|
|
10783
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ErrorFormMessage, { message: errorMsg })
|
|
10689
10784
|
] });
|
|
10690
10785
|
};
|
|
10691
10786
|
|
|
10692
10787
|
// src/components/FormFields/TextFormField.tsx
|
|
10693
10788
|
var import_react_hook_form2 = require("react-hook-form");
|
|
10694
|
-
var
|
|
10789
|
+
var import_react21 = require("react");
|
|
10695
10790
|
var import_mask2 = require("@react-input/mask");
|
|
10696
|
-
var
|
|
10791
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
10697
10792
|
var TextFormField = (_a) => {
|
|
10698
10793
|
var _b = _a, {
|
|
10699
10794
|
name,
|
|
@@ -10714,7 +10809,7 @@ var TextFormField = (_a) => {
|
|
|
10714
10809
|
"onChange",
|
|
10715
10810
|
"valueFormatter"
|
|
10716
10811
|
]);
|
|
10717
|
-
const handleValidate = (0,
|
|
10812
|
+
const handleValidate = (0, import_react21.useCallback)(
|
|
10718
10813
|
(value) => {
|
|
10719
10814
|
var _a2;
|
|
10720
10815
|
if (value === void 0 || value === null || !required && value.trim() === "")
|
|
@@ -10736,7 +10831,7 @@ var TextFormField = (_a) => {
|
|
|
10736
10831
|
const haveError = !!fieldError;
|
|
10737
10832
|
const errorMsg = fieldError == null ? void 0 : fieldError.message;
|
|
10738
10833
|
const { value: formValue, onChange: formChange } = field;
|
|
10739
|
-
const formattedValue = (0,
|
|
10834
|
+
const formattedValue = (0, import_react21.useMemo)(() => {
|
|
10740
10835
|
let value = formValue;
|
|
10741
10836
|
if (valueFormatter) value = valueFormatter.format(value);
|
|
10742
10837
|
if (mask) value = (0, import_mask2.format)(value != null ? value : "", mask);
|
|
@@ -10748,8 +10843,8 @@ var TextFormField = (_a) => {
|
|
|
10748
10843
|
if (valueFormatter) value = valueFormatter.unformat(value);
|
|
10749
10844
|
formChange(value);
|
|
10750
10845
|
};
|
|
10751
|
-
return /* @__PURE__ */ (0,
|
|
10752
|
-
label && /* @__PURE__ */ (0,
|
|
10846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Flex, { direction: "column", children: [
|
|
10847
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
10753
10848
|
FormLabel,
|
|
10754
10849
|
{
|
|
10755
10850
|
name,
|
|
@@ -10758,7 +10853,7 @@ var TextFormField = (_a) => {
|
|
|
10758
10853
|
haveError
|
|
10759
10854
|
}
|
|
10760
10855
|
),
|
|
10761
|
-
/* @__PURE__ */ (0,
|
|
10856
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
10762
10857
|
TextField,
|
|
10763
10858
|
__spreadProps(__spreadValues(__spreadValues({
|
|
10764
10859
|
mask,
|
|
@@ -10769,13 +10864,13 @@ var TextFormField = (_a) => {
|
|
|
10769
10864
|
value: formattedValue
|
|
10770
10865
|
})
|
|
10771
10866
|
),
|
|
10772
|
-
/* @__PURE__ */ (0,
|
|
10867
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ErrorFormMessage, { message: errorMsg })
|
|
10773
10868
|
] });
|
|
10774
10869
|
};
|
|
10775
10870
|
|
|
10776
10871
|
// src/components/FormFields/Form.tsx
|
|
10777
10872
|
var import_react_hook_form3 = require("react-hook-form");
|
|
10778
|
-
var
|
|
10873
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
10779
10874
|
var Form = (_a) => {
|
|
10780
10875
|
var _b = _a, {
|
|
10781
10876
|
onSubmit,
|
|
@@ -10787,7 +10882,7 @@ var Form = (_a) => {
|
|
|
10787
10882
|
const formMethods = (0, import_react_hook_form3.useForm)(__spreadValues({
|
|
10788
10883
|
mode: "onTouched"
|
|
10789
10884
|
}, props));
|
|
10790
|
-
return /* @__PURE__ */ (0,
|
|
10885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react_hook_form3.FormProvider, __spreadProps(__spreadValues({}, formMethods), { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("form", { onSubmit: formMethods.handleSubmit(onSubmit), children: (() => {
|
|
10791
10886
|
if (typeof children === "function") {
|
|
10792
10887
|
return children(formMethods);
|
|
10793
10888
|
}
|
|
@@ -10797,7 +10892,7 @@ var Form = (_a) => {
|
|
|
10797
10892
|
|
|
10798
10893
|
// src/components/FormFields/MultiSelectFormField.tsx
|
|
10799
10894
|
var import_react_hook_form4 = require("react-hook-form");
|
|
10800
|
-
var
|
|
10895
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
10801
10896
|
var MultiSelectFormField = (_a) => {
|
|
10802
10897
|
var _b = _a, {
|
|
10803
10898
|
name,
|
|
@@ -10828,8 +10923,8 @@ var MultiSelectFormField = (_a) => {
|
|
|
10828
10923
|
const handleChange = (v) => {
|
|
10829
10924
|
onChange(v);
|
|
10830
10925
|
};
|
|
10831
|
-
return /* @__PURE__ */ (0,
|
|
10832
|
-
/* @__PURE__ */ (0,
|
|
10926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Flex, { direction: "column", children: [
|
|
10927
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
10833
10928
|
FormLabel,
|
|
10834
10929
|
{
|
|
10835
10930
|
name,
|
|
@@ -10838,7 +10933,7 @@ var MultiSelectFormField = (_a) => {
|
|
|
10838
10933
|
haveError
|
|
10839
10934
|
}
|
|
10840
10935
|
),
|
|
10841
|
-
/* @__PURE__ */ (0,
|
|
10936
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
10842
10937
|
MultiSelect,
|
|
10843
10938
|
__spreadValues({
|
|
10844
10939
|
value,
|
|
@@ -10850,7 +10945,7 @@ var MultiSelectFormField = (_a) => {
|
|
|
10850
10945
|
maxHeight
|
|
10851
10946
|
}, rest)
|
|
10852
10947
|
),
|
|
10853
|
-
/* @__PURE__ */ (0,
|
|
10948
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ErrorFormMessage, { message: errorMsg })
|
|
10854
10949
|
] });
|
|
10855
10950
|
};
|
|
10856
10951
|
|
|
@@ -10868,13 +10963,13 @@ var minMaxLength = (min, max, errorMsg) => (value) => {
|
|
|
10868
10963
|
};
|
|
10869
10964
|
|
|
10870
10965
|
// src/components/FormFields/PhoneFormField.tsx
|
|
10871
|
-
var
|
|
10966
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
10872
10967
|
var PhoneFormField = ({
|
|
10873
10968
|
name,
|
|
10874
10969
|
label,
|
|
10875
10970
|
required
|
|
10876
10971
|
}) => {
|
|
10877
|
-
return /* @__PURE__ */ (0,
|
|
10972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
10878
10973
|
TextFormField,
|
|
10879
10974
|
{
|
|
10880
10975
|
name,
|
|
@@ -10904,7 +10999,7 @@ var PhoneFormField = ({
|
|
|
10904
10999
|
|
|
10905
11000
|
// src/components/FormFields/CPFFormField.tsx
|
|
10906
11001
|
var import_react_hook_form5 = require("react-hook-form");
|
|
10907
|
-
var
|
|
11002
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
10908
11003
|
var isValidCPF = (cpf) => {
|
|
10909
11004
|
cpf = cpf.replace(/[^\d]+/g, "");
|
|
10910
11005
|
if (cpf.length !== 11 || /^(\d)\1{10}$/.test(cpf)) return false;
|
|
@@ -10930,8 +11025,8 @@ var CPFFormField = ({
|
|
|
10930
11025
|
}) => {
|
|
10931
11026
|
const { control, setValue } = (0, import_react_hook_form5.useFormContext)();
|
|
10932
11027
|
const foreigner = (0, import_react_hook_form5.useWatch)({ name: "foreigner", control });
|
|
10933
|
-
return /* @__PURE__ */ (0,
|
|
10934
|
-
/* @__PURE__ */ (0,
|
|
11028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Flex, { direction: "column", children: [
|
|
11029
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10935
11030
|
TextFormField,
|
|
10936
11031
|
{
|
|
10937
11032
|
name,
|
|
@@ -10949,7 +11044,7 @@ var CPFFormField = ({
|
|
|
10949
11044
|
disabled: foreigner
|
|
10950
11045
|
}
|
|
10951
11046
|
),
|
|
10952
|
-
/* @__PURE__ */ (0,
|
|
11047
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10953
11048
|
CheckboxGroup,
|
|
10954
11049
|
{
|
|
10955
11050
|
value: foreigner ? ["true"] : [],
|
|
@@ -10961,14 +11056,14 @@ var CPFFormField = ({
|
|
|
10961
11056
|
setValue(name, "");
|
|
10962
11057
|
}
|
|
10963
11058
|
},
|
|
10964
|
-
children: /* @__PURE__ */ (0,
|
|
11059
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CheckboxItem, { value: "true", children: foreignerLabel })
|
|
10965
11060
|
}
|
|
10966
11061
|
)
|
|
10967
11062
|
] });
|
|
10968
11063
|
};
|
|
10969
11064
|
|
|
10970
11065
|
// src/components/FormFields/CNPJFormField.tsx
|
|
10971
|
-
var
|
|
11066
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
10972
11067
|
var matchesNonDigit = new RegExp(/\D+/g);
|
|
10973
11068
|
var getWeights = (size, start, end) => {
|
|
10974
11069
|
const weights = [];
|
|
@@ -11017,7 +11112,7 @@ var CNPJFormField = ({
|
|
|
11017
11112
|
placeholder,
|
|
11018
11113
|
validationErrorMessage
|
|
11019
11114
|
}) => {
|
|
11020
|
-
return /* @__PURE__ */ (0,
|
|
11115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
11021
11116
|
TextFormField,
|
|
11022
11117
|
{
|
|
11023
11118
|
name,
|
|
@@ -11038,7 +11133,7 @@ var CNPJFormField = ({
|
|
|
11038
11133
|
};
|
|
11039
11134
|
|
|
11040
11135
|
// src/components/FormFields/BirthDateFormField.tsx
|
|
11041
|
-
var
|
|
11136
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
11042
11137
|
var isValidDate = (day, month, year) => {
|
|
11043
11138
|
const date = new Date(year, month - 1, day);
|
|
11044
11139
|
return date.getFullYear() === year && date.getMonth() === month - 1 && date.getDate() === day;
|
|
@@ -11075,7 +11170,7 @@ var BirthDateFormField = ({
|
|
|
11075
11170
|
language
|
|
11076
11171
|
}) => {
|
|
11077
11172
|
const inputPlaceholder = placeholder || (language === "pt-BR" ? "DD/MM/AAAA" : "MM/DD/YYYY");
|
|
11078
|
-
return /* @__PURE__ */ (0,
|
|
11173
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
11079
11174
|
TextFormField,
|
|
11080
11175
|
{
|
|
11081
11176
|
name,
|
|
@@ -11096,7 +11191,7 @@ var BirthDateFormField = ({
|
|
|
11096
11191
|
};
|
|
11097
11192
|
|
|
11098
11193
|
// src/components/FormFields/IdentityDocumentNumberFormField.tsx
|
|
11099
|
-
var
|
|
11194
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
11100
11195
|
var IdentityDocumentNumberFormField = ({
|
|
11101
11196
|
name,
|
|
11102
11197
|
label,
|
|
@@ -11104,7 +11199,7 @@ var IdentityDocumentNumberFormField = ({
|
|
|
11104
11199
|
placeholder,
|
|
11105
11200
|
validationErrorMessage
|
|
11106
11201
|
}) => {
|
|
11107
|
-
return /* @__PURE__ */ (0,
|
|
11202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
11108
11203
|
TextFormField,
|
|
11109
11204
|
{
|
|
11110
11205
|
name,
|
|
@@ -11133,7 +11228,7 @@ function getNestedValue(obj, path) {
|
|
|
11133
11228
|
}
|
|
11134
11229
|
|
|
11135
11230
|
// src/components/FormFields/SelectFormField.tsx
|
|
11136
|
-
var
|
|
11231
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
11137
11232
|
var SelectFormField = ({
|
|
11138
11233
|
name,
|
|
11139
11234
|
label,
|
|
@@ -11157,8 +11252,8 @@ var SelectFormField = ({
|
|
|
11157
11252
|
const validationRules = __spreadValues({
|
|
11158
11253
|
required: required ? validationErrorMessage : false
|
|
11159
11254
|
}, validation);
|
|
11160
|
-
return /* @__PURE__ */ (0,
|
|
11161
|
-
/* @__PURE__ */ (0,
|
|
11255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Flex, { direction: "column", children: [
|
|
11256
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
11162
11257
|
FormLabel,
|
|
11163
11258
|
{
|
|
11164
11259
|
name,
|
|
@@ -11167,7 +11262,7 @@ var SelectFormField = ({
|
|
|
11167
11262
|
haveError
|
|
11168
11263
|
}
|
|
11169
11264
|
),
|
|
11170
|
-
/* @__PURE__ */ (0,
|
|
11265
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
11171
11266
|
import_react_hook_form6.Controller,
|
|
11172
11267
|
{
|
|
11173
11268
|
control,
|
|
@@ -11176,7 +11271,7 @@ var SelectFormField = ({
|
|
|
11176
11271
|
defaultValue: defaultValue || "",
|
|
11177
11272
|
render: ({ field: { value, onChange } }) => {
|
|
11178
11273
|
const selectedOption = options.find((opt) => opt.value === value);
|
|
11179
|
-
return /* @__PURE__ */ (0,
|
|
11274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
11180
11275
|
DropdownMenu2,
|
|
11181
11276
|
{
|
|
11182
11277
|
placeholder: (selectedOption == null ? void 0 : selectedOption.label) || placeholder,
|
|
@@ -11184,7 +11279,7 @@ var SelectFormField = ({
|
|
|
11184
11279
|
typography: "labelLarge",
|
|
11185
11280
|
color: haveError ? "error" : "default",
|
|
11186
11281
|
children: [
|
|
11187
|
-
options.map((option, index) => /* @__PURE__ */ (0,
|
|
11282
|
+
options.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
11188
11283
|
DropdownMenuItem,
|
|
11189
11284
|
{
|
|
11190
11285
|
value: option.value,
|
|
@@ -11195,7 +11290,7 @@ var SelectFormField = ({
|
|
|
11195
11290
|
},
|
|
11196
11291
|
`${option.value}${index}`
|
|
11197
11292
|
)),
|
|
11198
|
-
showMoreButton && showMoreButtonOnClick && /* @__PURE__ */ (0,
|
|
11293
|
+
showMoreButton && showMoreButtonOnClick && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
11199
11294
|
Button,
|
|
11200
11295
|
{
|
|
11201
11296
|
variant: "menuDropdownItem",
|
|
@@ -11213,7 +11308,7 @@ var SelectFormField = ({
|
|
|
11213
11308
|
}
|
|
11214
11309
|
}
|
|
11215
11310
|
),
|
|
11216
|
-
/* @__PURE__ */ (0,
|
|
11311
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ErrorFormMessage, { message: errorMsg })
|
|
11217
11312
|
] });
|
|
11218
11313
|
};
|
|
11219
11314
|
|
|
@@ -11246,7 +11341,7 @@ function useCountries(language = "pt-BR") {
|
|
|
11246
11341
|
}
|
|
11247
11342
|
|
|
11248
11343
|
// src/components/FormFields/AddressFormFields/CountryFormField.tsx
|
|
11249
|
-
var
|
|
11344
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
11250
11345
|
function CountryFormField({
|
|
11251
11346
|
name,
|
|
11252
11347
|
label,
|
|
@@ -11254,7 +11349,7 @@ function CountryFormField({
|
|
|
11254
11349
|
language = "pt-BR"
|
|
11255
11350
|
}) {
|
|
11256
11351
|
const countries2 = useCountries(language);
|
|
11257
|
-
return /* @__PURE__ */ (0,
|
|
11352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Flex, { direction: "column", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
11258
11353
|
SelectFormField,
|
|
11259
11354
|
{
|
|
11260
11355
|
label,
|
|
@@ -11267,7 +11362,7 @@ function CountryFormField({
|
|
|
11267
11362
|
}
|
|
11268
11363
|
|
|
11269
11364
|
// src/components/FormFields/AddressFormFields/PostalCodeFormField.tsx
|
|
11270
|
-
var
|
|
11365
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
11271
11366
|
var PostalCodeFormField = ({
|
|
11272
11367
|
name,
|
|
11273
11368
|
label,
|
|
@@ -11276,7 +11371,7 @@ var PostalCodeFormField = ({
|
|
|
11276
11371
|
validationErrorMessage,
|
|
11277
11372
|
onChange
|
|
11278
11373
|
}) => {
|
|
11279
|
-
return /* @__PURE__ */ (0,
|
|
11374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
11280
11375
|
TextFormField,
|
|
11281
11376
|
{
|
|
11282
11377
|
name,
|
|
@@ -11329,14 +11424,14 @@ var brazilianStates = [
|
|
|
11329
11424
|
];
|
|
11330
11425
|
|
|
11331
11426
|
// src/components/FormFields/AddressFormFields/StateFormField.tsx
|
|
11332
|
-
var
|
|
11427
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
11333
11428
|
function StateFormField({
|
|
11334
11429
|
name,
|
|
11335
11430
|
label,
|
|
11336
11431
|
required,
|
|
11337
11432
|
isBrazil
|
|
11338
11433
|
}) {
|
|
11339
|
-
return /* @__PURE__ */ (0,
|
|
11434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_jsx_runtime46.Fragment, { children: isBrazil ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
11340
11435
|
SelectFormField,
|
|
11341
11436
|
{
|
|
11342
11437
|
name,
|
|
@@ -11344,13 +11439,13 @@ function StateFormField({
|
|
|
11344
11439
|
required,
|
|
11345
11440
|
label
|
|
11346
11441
|
}
|
|
11347
|
-
) : /* @__PURE__ */ (0,
|
|
11442
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TextFormField, { name, required, label }) });
|
|
11348
11443
|
}
|
|
11349
11444
|
|
|
11350
11445
|
// src/components/FormFields/AddressFormFields/CityFormField.tsx
|
|
11351
|
-
var
|
|
11446
|
+
var import_react22 = require("react");
|
|
11352
11447
|
var import_react_hook_form7 = require("react-hook-form");
|
|
11353
|
-
var
|
|
11448
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
11354
11449
|
function CityFormField({
|
|
11355
11450
|
name,
|
|
11356
11451
|
label,
|
|
@@ -11361,9 +11456,9 @@ function CityFormField({
|
|
|
11361
11456
|
}) {
|
|
11362
11457
|
const { control, watch } = (0, import_react_hook_form7.useFormContext)();
|
|
11363
11458
|
const selectedState = watch(stateName);
|
|
11364
|
-
const [cities, setCities] = (0,
|
|
11365
|
-
const [loading, setLoading] = (0,
|
|
11366
|
-
(0,
|
|
11459
|
+
const [cities, setCities] = (0, import_react22.useState)([]);
|
|
11460
|
+
const [loading, setLoading] = (0, import_react22.useState)(false);
|
|
11461
|
+
(0, import_react22.useEffect)(() => {
|
|
11367
11462
|
if (!isBrazil) {
|
|
11368
11463
|
setCities([]);
|
|
11369
11464
|
return;
|
|
@@ -11402,13 +11497,13 @@ function CityFormField({
|
|
|
11402
11497
|
}
|
|
11403
11498
|
fetchCities();
|
|
11404
11499
|
}, [selectedState, isBrazil]);
|
|
11405
|
-
return /* @__PURE__ */ (0,
|
|
11500
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_jsx_runtime47.Fragment, { children: isBrazil && cities.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
11406
11501
|
import_react_hook_form7.Controller,
|
|
11407
11502
|
{
|
|
11408
11503
|
name,
|
|
11409
11504
|
control,
|
|
11410
11505
|
rules: { required },
|
|
11411
|
-
render: ({ field }) => /* @__PURE__ */ (0,
|
|
11506
|
+
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
11412
11507
|
SelectFormField,
|
|
11413
11508
|
__spreadProps(__spreadValues({
|
|
11414
11509
|
label,
|
|
@@ -11422,7 +11517,7 @@ function CityFormField({
|
|
|
11422
11517
|
})
|
|
11423
11518
|
)
|
|
11424
11519
|
}
|
|
11425
|
-
) : /* @__PURE__ */ (0,
|
|
11520
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
11426
11521
|
TextFormField,
|
|
11427
11522
|
{
|
|
11428
11523
|
name,
|
|
@@ -11434,7 +11529,7 @@ function CityFormField({
|
|
|
11434
11529
|
}
|
|
11435
11530
|
|
|
11436
11531
|
// src/components/FormFields/AddressFormFields/index.tsx
|
|
11437
|
-
var
|
|
11532
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
11438
11533
|
function getNestedValue2(obj, path) {
|
|
11439
11534
|
return path.split(".").reduce((acc, key) => acc == null ? void 0 : acc[key], obj);
|
|
11440
11535
|
}
|
|
@@ -11484,8 +11579,8 @@ function AddressFormFields({
|
|
|
11484
11579
|
console.error("Erro ao buscar CEP");
|
|
11485
11580
|
});
|
|
11486
11581
|
};
|
|
11487
|
-
return /* @__PURE__ */ (0,
|
|
11488
|
-
/* @__PURE__ */ (0,
|
|
11582
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(AddressContainerStyled, { layout, children: [
|
|
11583
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
11489
11584
|
FormLabel,
|
|
11490
11585
|
{
|
|
11491
11586
|
name,
|
|
@@ -11494,7 +11589,7 @@ function AddressFormFields({
|
|
|
11494
11589
|
haveError
|
|
11495
11590
|
}
|
|
11496
11591
|
),
|
|
11497
|
-
/* @__PURE__ */ (0,
|
|
11592
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
11498
11593
|
CountryFormField,
|
|
11499
11594
|
{
|
|
11500
11595
|
name: `${name}.country`,
|
|
@@ -11503,7 +11598,7 @@ function AddressFormFields({
|
|
|
11503
11598
|
language: "pt-BR"
|
|
11504
11599
|
}
|
|
11505
11600
|
),
|
|
11506
|
-
isBrazil ? /* @__PURE__ */ (0,
|
|
11601
|
+
isBrazil ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
11507
11602
|
PostalCodeFormField,
|
|
11508
11603
|
{
|
|
11509
11604
|
name: `${name}.zip_code`,
|
|
@@ -11513,7 +11608,7 @@ function AddressFormFields({
|
|
|
11513
11608
|
validationErrorMessage: "CEP inv\xE1lido",
|
|
11514
11609
|
onChange: handleCEPChange
|
|
11515
11610
|
}
|
|
11516
|
-
) : /* @__PURE__ */ (0,
|
|
11611
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
11517
11612
|
TextFormField,
|
|
11518
11613
|
{
|
|
11519
11614
|
name: `${name}.zip_code`,
|
|
@@ -11521,7 +11616,7 @@ function AddressFormFields({
|
|
|
11521
11616
|
required
|
|
11522
11617
|
}
|
|
11523
11618
|
),
|
|
11524
|
-
/* @__PURE__ */ (0,
|
|
11619
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
11525
11620
|
StateFormField,
|
|
11526
11621
|
{
|
|
11527
11622
|
name: `${name}.state`,
|
|
@@ -11530,7 +11625,7 @@ function AddressFormFields({
|
|
|
11530
11625
|
isBrazil
|
|
11531
11626
|
}
|
|
11532
11627
|
),
|
|
11533
|
-
/* @__PURE__ */ (0,
|
|
11628
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
11534
11629
|
CityFormField,
|
|
11535
11630
|
{
|
|
11536
11631
|
name: `${name}.city`,
|
|
@@ -11540,8 +11635,8 @@ function AddressFormFields({
|
|
|
11540
11635
|
isBrazil
|
|
11541
11636
|
}
|
|
11542
11637
|
),
|
|
11543
|
-
/* @__PURE__ */ (0,
|
|
11544
|
-
/* @__PURE__ */ (0,
|
|
11638
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TextFormField, { name: `${name}.street`, label: "Rua", required }),
|
|
11639
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
11545
11640
|
TextFormField,
|
|
11546
11641
|
{
|
|
11547
11642
|
name: `${name}.number`,
|
|
@@ -11549,7 +11644,7 @@ function AddressFormFields({
|
|
|
11549
11644
|
required
|
|
11550
11645
|
}
|
|
11551
11646
|
),
|
|
11552
|
-
/* @__PURE__ */ (0,
|
|
11647
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
11553
11648
|
TextFormField,
|
|
11554
11649
|
{
|
|
11555
11650
|
name: `${name}.neighborhood`,
|
|
@@ -11557,13 +11652,13 @@ function AddressFormFields({
|
|
|
11557
11652
|
required
|
|
11558
11653
|
}
|
|
11559
11654
|
),
|
|
11560
|
-
/* @__PURE__ */ (0,
|
|
11655
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TextFormField, { name: `${name}.complement`, label: "Complemento" })
|
|
11561
11656
|
] });
|
|
11562
11657
|
}
|
|
11563
11658
|
|
|
11564
11659
|
// src/components/FormFields/RadioGroupFormField.tsx
|
|
11565
11660
|
var import_react_hook_form9 = require("react-hook-form");
|
|
11566
|
-
var
|
|
11661
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
11567
11662
|
var RadioGroupFormField = ({
|
|
11568
11663
|
name,
|
|
11569
11664
|
label,
|
|
@@ -11585,8 +11680,8 @@ var RadioGroupFormField = ({
|
|
|
11585
11680
|
const validationRules = {
|
|
11586
11681
|
required: required ? validationErrorMessage : false
|
|
11587
11682
|
};
|
|
11588
|
-
return /* @__PURE__ */ (0,
|
|
11589
|
-
/* @__PURE__ */ (0,
|
|
11683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Flex, { direction: "column", children: [
|
|
11684
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
11590
11685
|
FormLabel,
|
|
11591
11686
|
{
|
|
11592
11687
|
name,
|
|
@@ -11595,14 +11690,14 @@ var RadioGroupFormField = ({
|
|
|
11595
11690
|
haveError
|
|
11596
11691
|
}
|
|
11597
11692
|
),
|
|
11598
|
-
/* @__PURE__ */ (0,
|
|
11693
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
11599
11694
|
import_react_hook_form9.Controller,
|
|
11600
11695
|
{
|
|
11601
11696
|
name,
|
|
11602
11697
|
control,
|
|
11603
11698
|
defaultValue: defaultValue || "",
|
|
11604
11699
|
rules: validationRules,
|
|
11605
|
-
render: ({ field: { value, onChange } }) => /* @__PURE__ */ (0,
|
|
11700
|
+
render: ({ field: { value, onChange } }) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
11606
11701
|
RadioGroup,
|
|
11607
11702
|
{
|
|
11608
11703
|
value,
|
|
@@ -11610,18 +11705,18 @@ var RadioGroupFormField = ({
|
|
|
11610
11705
|
color: haveError ? "error" : color,
|
|
11611
11706
|
fontWeight,
|
|
11612
11707
|
disabled,
|
|
11613
|
-
children: /* @__PURE__ */ (0,
|
|
11708
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Flex, { direction: "column", children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(RadioItem, { value: option.value, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Text, { typography: "labelSmall", children: option.label }) }, option.value)) })
|
|
11614
11709
|
}
|
|
11615
11710
|
)
|
|
11616
11711
|
}
|
|
11617
11712
|
),
|
|
11618
|
-
/* @__PURE__ */ (0,
|
|
11713
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ErrorFormMessage, { message: errorMsg })
|
|
11619
11714
|
] });
|
|
11620
11715
|
};
|
|
11621
11716
|
|
|
11622
11717
|
// src/components/FormFields/CheckboxGroupFormField.tsx
|
|
11623
11718
|
var import_react_hook_form10 = require("react-hook-form");
|
|
11624
|
-
var
|
|
11719
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
11625
11720
|
var CheckboxGroupFormField = ({
|
|
11626
11721
|
name,
|
|
11627
11722
|
label,
|
|
@@ -11644,8 +11739,8 @@ var CheckboxGroupFormField = ({
|
|
|
11644
11739
|
required: required ? validationErrorMessage : false,
|
|
11645
11740
|
validate: required ? (value) => (value == null ? void 0 : value.length) > 0 || validationErrorMessage : void 0
|
|
11646
11741
|
};
|
|
11647
|
-
return /* @__PURE__ */ (0,
|
|
11648
|
-
/* @__PURE__ */ (0,
|
|
11742
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Flex, { direction: "column", children: [
|
|
11743
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11649
11744
|
FormLabel,
|
|
11650
11745
|
{
|
|
11651
11746
|
name,
|
|
@@ -11654,14 +11749,14 @@ var CheckboxGroupFormField = ({
|
|
|
11654
11749
|
haveError
|
|
11655
11750
|
}
|
|
11656
11751
|
),
|
|
11657
|
-
/* @__PURE__ */ (0,
|
|
11752
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11658
11753
|
import_react_hook_form10.Controller,
|
|
11659
11754
|
{
|
|
11660
11755
|
name,
|
|
11661
11756
|
control,
|
|
11662
11757
|
rules: validationRules,
|
|
11663
11758
|
defaultValue,
|
|
11664
|
-
render: ({ field }) => /* @__PURE__ */ (0,
|
|
11759
|
+
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11665
11760
|
CheckboxGroup,
|
|
11666
11761
|
{
|
|
11667
11762
|
name,
|
|
@@ -11670,7 +11765,7 @@ var CheckboxGroupFormField = ({
|
|
|
11670
11765
|
color: haveError ? "error" : color,
|
|
11671
11766
|
fontWeight,
|
|
11672
11767
|
disabled,
|
|
11673
|
-
children: options.map((option) => /* @__PURE__ */ (0,
|
|
11768
|
+
children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11674
11769
|
CheckboxItem,
|
|
11675
11770
|
{
|
|
11676
11771
|
value: option.value,
|
|
@@ -11683,13 +11778,13 @@ var CheckboxGroupFormField = ({
|
|
|
11683
11778
|
)
|
|
11684
11779
|
}
|
|
11685
11780
|
),
|
|
11686
|
-
/* @__PURE__ */ (0,
|
|
11781
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ErrorFormMessage, { message: errorMsg })
|
|
11687
11782
|
] });
|
|
11688
11783
|
};
|
|
11689
11784
|
|
|
11690
11785
|
// src/components/FormFields/SwitchFormField.tsx
|
|
11691
11786
|
var import_react_hook_form11 = require("react-hook-form");
|
|
11692
|
-
var
|
|
11787
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
11693
11788
|
var SwitchFormField = ({
|
|
11694
11789
|
name,
|
|
11695
11790
|
label,
|
|
@@ -11703,15 +11798,15 @@ var SwitchFormField = ({
|
|
|
11703
11798
|
if (watch) {
|
|
11704
11799
|
watchForm(name);
|
|
11705
11800
|
}
|
|
11706
|
-
return /* @__PURE__ */ (0,
|
|
11707
|
-
/* @__PURE__ */ (0,
|
|
11708
|
-
/* @__PURE__ */ (0,
|
|
11801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Flex, { justify: "between", style: { margin: "1rem 0" }, children: [
|
|
11802
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Text, { typography: "labelMedium", fontWeight: "regular", children: label }),
|
|
11803
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
11709
11804
|
import_react_hook_form11.Controller,
|
|
11710
11805
|
{
|
|
11711
11806
|
control,
|
|
11712
11807
|
name,
|
|
11713
11808
|
defaultValue,
|
|
11714
|
-
render: ({ field }) => /* @__PURE__ */ (0,
|
|
11809
|
+
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
11715
11810
|
Switch,
|
|
11716
11811
|
{
|
|
11717
11812
|
checked: field.value,
|
|
@@ -11724,14 +11819,14 @@ var SwitchFormField = ({
|
|
|
11724
11819
|
};
|
|
11725
11820
|
|
|
11726
11821
|
// src/components/FormFields/EmailFormField.tsx
|
|
11727
|
-
var
|
|
11822
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
11728
11823
|
var EmailFormField = ({
|
|
11729
11824
|
name,
|
|
11730
11825
|
label,
|
|
11731
11826
|
required,
|
|
11732
11827
|
placeholder
|
|
11733
11828
|
}) => {
|
|
11734
|
-
return /* @__PURE__ */ (0,
|
|
11829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
11735
11830
|
TextFormField,
|
|
11736
11831
|
{
|
|
11737
11832
|
name,
|
|
@@ -11748,10 +11843,10 @@ var EmailFormField = ({
|
|
|
11748
11843
|
var import_react_hook_form12 = require("react-hook-form");
|
|
11749
11844
|
|
|
11750
11845
|
// src/components/RichEditor/RichEditor.tsx
|
|
11751
|
-
var
|
|
11846
|
+
var import_react24 = require("react");
|
|
11752
11847
|
|
|
11753
11848
|
// src/components/RichEditor/QuillComponent.tsx
|
|
11754
|
-
var
|
|
11849
|
+
var import_react23 = require("react");
|
|
11755
11850
|
var import_react_quilljs = require("react-quilljs");
|
|
11756
11851
|
|
|
11757
11852
|
// src/utils/uploadService.ts
|
|
@@ -12808,7 +12903,7 @@ var QuillEditor = styled("div", {
|
|
|
12808
12903
|
});
|
|
12809
12904
|
|
|
12810
12905
|
// src/components/RichEditor/QuillComponent.tsx
|
|
12811
|
-
var
|
|
12906
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
12812
12907
|
var QuillComponent = ({
|
|
12813
12908
|
value = "",
|
|
12814
12909
|
onChange,
|
|
@@ -12821,12 +12916,12 @@ var QuillComponent = ({
|
|
|
12821
12916
|
onCharacterCountChange,
|
|
12822
12917
|
maxLength
|
|
12823
12918
|
}) => {
|
|
12824
|
-
const [showVideoModal, setShowVideoModal] = (0,
|
|
12825
|
-
const [videoUrl, setVideoUrl] = (0,
|
|
12826
|
-
const [showLinkModal, setShowLinkModal] = (0,
|
|
12827
|
-
const [linkUrl, setLinkUrl] = (0,
|
|
12828
|
-
const videoModalRef = (0,
|
|
12829
|
-
const linkModalRef = (0,
|
|
12919
|
+
const [showVideoModal, setShowVideoModal] = (0, import_react23.useState)(false);
|
|
12920
|
+
const [videoUrl, setVideoUrl] = (0, import_react23.useState)("");
|
|
12921
|
+
const [showLinkModal, setShowLinkModal] = (0, import_react23.useState)(false);
|
|
12922
|
+
const [linkUrl, setLinkUrl] = (0, import_react23.useState)("");
|
|
12923
|
+
const videoModalRef = (0, import_react23.useRef)(null);
|
|
12924
|
+
const linkModalRef = (0, import_react23.useRef)(null);
|
|
12830
12925
|
const { addToast, removeToast } = useToast();
|
|
12831
12926
|
const formatHTML = (html) => {
|
|
12832
12927
|
const parser = new DOMParser();
|
|
@@ -12899,7 +12994,7 @@ var QuillComponent = ({
|
|
|
12899
12994
|
placeholder,
|
|
12900
12995
|
readOnly: disabled
|
|
12901
12996
|
});
|
|
12902
|
-
const handleImageUpload = (0,
|
|
12997
|
+
const handleImageUpload = (0, import_react23.useCallback)(
|
|
12903
12998
|
(file) => __async(null, null, function* () {
|
|
12904
12999
|
if (disabled || !quill || !uploadConfig) return;
|
|
12905
13000
|
try {
|
|
@@ -12931,7 +13026,7 @@ var QuillComponent = ({
|
|
|
12931
13026
|
}),
|
|
12932
13027
|
[disabled, quill, addToast, removeToast, uploadConfig, onChange]
|
|
12933
13028
|
);
|
|
12934
|
-
(0,
|
|
13029
|
+
(0, import_react23.useEffect)(() => {
|
|
12935
13030
|
if (quill && value) {
|
|
12936
13031
|
const currentContent = quill.root.innerHTML;
|
|
12937
13032
|
if (currentContent !== value) {
|
|
@@ -12945,7 +13040,7 @@ var QuillComponent = ({
|
|
|
12945
13040
|
}
|
|
12946
13041
|
}
|
|
12947
13042
|
}, [quill, value]);
|
|
12948
|
-
(0,
|
|
13043
|
+
(0, import_react23.useEffect)(() => {
|
|
12949
13044
|
if (quill) {
|
|
12950
13045
|
quill.on("text-change", (delta, oldDelta, source) => {
|
|
12951
13046
|
if (source === "user") {
|
|
@@ -13000,7 +13095,7 @@ var QuillComponent = ({
|
|
|
13000
13095
|
}, 2e3);
|
|
13001
13096
|
}
|
|
13002
13097
|
}, [quill, onChange, handleImageUpload, onCharacterCountChange]);
|
|
13003
|
-
(0,
|
|
13098
|
+
(0, import_react23.useEffect)(() => {
|
|
13004
13099
|
if (quill) {
|
|
13005
13100
|
quill.enable(!disabled);
|
|
13006
13101
|
if (!disabled) {
|
|
@@ -13011,11 +13106,11 @@ var QuillComponent = ({
|
|
|
13011
13106
|
}
|
|
13012
13107
|
}
|
|
13013
13108
|
}, [quill, disabled]);
|
|
13014
|
-
const handleLinkCancel = (0,
|
|
13109
|
+
const handleLinkCancel = (0, import_react23.useCallback)(() => {
|
|
13015
13110
|
setLinkUrl("");
|
|
13016
13111
|
setShowLinkModal(false);
|
|
13017
13112
|
}, []);
|
|
13018
|
-
const handleLinkSubmit = (0,
|
|
13113
|
+
const handleLinkSubmit = (0, import_react23.useCallback)(() => {
|
|
13019
13114
|
if (!linkUrl.trim() || !quill) return;
|
|
13020
13115
|
const url = linkUrl.trim();
|
|
13021
13116
|
const selection = quill.getSelection();
|
|
@@ -13030,11 +13125,11 @@ var QuillComponent = ({
|
|
|
13030
13125
|
setLinkUrl("");
|
|
13031
13126
|
setShowLinkModal(false);
|
|
13032
13127
|
}, [linkUrl, quill]);
|
|
13033
|
-
const handleVideoCancel = (0,
|
|
13128
|
+
const handleVideoCancel = (0, import_react23.useCallback)(() => {
|
|
13034
13129
|
setVideoUrl("");
|
|
13035
13130
|
setShowVideoModal(false);
|
|
13036
13131
|
}, []);
|
|
13037
|
-
const handleVideoSubmit = (0,
|
|
13132
|
+
const handleVideoSubmit = (0, import_react23.useCallback)(() => {
|
|
13038
13133
|
var _a, _b;
|
|
13039
13134
|
if (!videoUrl.trim() || !quill) return;
|
|
13040
13135
|
let processedUrl = videoUrl.trim();
|
|
@@ -13067,7 +13162,7 @@ var QuillComponent = ({
|
|
|
13067
13162
|
setVideoUrl("");
|
|
13068
13163
|
setShowVideoModal(false);
|
|
13069
13164
|
}, [videoUrl, quill]);
|
|
13070
|
-
(0,
|
|
13165
|
+
(0, import_react23.useEffect)(() => {
|
|
13071
13166
|
const handleClickOutside = (event) => {
|
|
13072
13167
|
if (showVideoModal && videoModalRef.current && !videoModalRef.current.contains(event.target)) {
|
|
13073
13168
|
handleVideoCancel();
|
|
@@ -13079,9 +13174,9 @@ var QuillComponent = ({
|
|
|
13079
13174
|
document.addEventListener("mousedown", handleClickOutside);
|
|
13080
13175
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
13081
13176
|
}, [showVideoModal, showLinkModal, handleVideoCancel, handleLinkCancel]);
|
|
13082
|
-
return /* @__PURE__ */ (0,
|
|
13083
|
-
/* @__PURE__ */ (0,
|
|
13084
|
-
showVideoModal && /* @__PURE__ */ (0,
|
|
13177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(QuillContainer, { className, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(QuillEditor, { children: [
|
|
13178
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { ref: quillRef }),
|
|
13179
|
+
showVideoModal && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
13085
13180
|
"div",
|
|
13086
13181
|
{
|
|
13087
13182
|
ref: videoModalRef,
|
|
@@ -13098,15 +13193,15 @@ var QuillComponent = ({
|
|
|
13098
13193
|
zIndex: 1e3,
|
|
13099
13194
|
width: "fit-content"
|
|
13100
13195
|
},
|
|
13101
|
-
children: /* @__PURE__ */ (0,
|
|
13102
|
-
/* @__PURE__ */ (0,
|
|
13196
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Flex, { gap: 8, align: "center", children: [
|
|
13197
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
13103
13198
|
Text,
|
|
13104
13199
|
{
|
|
13105
13200
|
style: { fontSize: "14px", fontWeight: "500", color: "#333" },
|
|
13106
13201
|
children: "V\xEDdeo:"
|
|
13107
13202
|
}
|
|
13108
13203
|
),
|
|
13109
|
-
/* @__PURE__ */ (0,
|
|
13204
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
13110
13205
|
"input",
|
|
13111
13206
|
{
|
|
13112
13207
|
type: "text",
|
|
@@ -13130,7 +13225,7 @@ var QuillComponent = ({
|
|
|
13130
13225
|
autoFocus: true
|
|
13131
13226
|
}
|
|
13132
13227
|
),
|
|
13133
|
-
/* @__PURE__ */ (0,
|
|
13228
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
13134
13229
|
"button",
|
|
13135
13230
|
{
|
|
13136
13231
|
onClick: handleVideoSubmit,
|
|
@@ -13151,7 +13246,7 @@ var QuillComponent = ({
|
|
|
13151
13246
|
] })
|
|
13152
13247
|
}
|
|
13153
13248
|
),
|
|
13154
|
-
showLinkModal && /* @__PURE__ */ (0,
|
|
13249
|
+
showLinkModal && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
13155
13250
|
"div",
|
|
13156
13251
|
{
|
|
13157
13252
|
ref: linkModalRef,
|
|
@@ -13168,15 +13263,15 @@ var QuillComponent = ({
|
|
|
13168
13263
|
zIndex: 1e3,
|
|
13169
13264
|
width: "fit-content"
|
|
13170
13265
|
},
|
|
13171
|
-
children: /* @__PURE__ */ (0,
|
|
13172
|
-
/* @__PURE__ */ (0,
|
|
13266
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Flex, { gap: 8, align: "center", children: [
|
|
13267
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
13173
13268
|
Text,
|
|
13174
13269
|
{
|
|
13175
13270
|
style: { fontSize: "14px", fontWeight: "500", color: "#333" },
|
|
13176
13271
|
children: "Link:"
|
|
13177
13272
|
}
|
|
13178
13273
|
),
|
|
13179
|
-
/* @__PURE__ */ (0,
|
|
13274
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
13180
13275
|
"input",
|
|
13181
13276
|
{
|
|
13182
13277
|
type: "text",
|
|
@@ -13201,7 +13296,7 @@ var QuillComponent = ({
|
|
|
13201
13296
|
autoFocus: true
|
|
13202
13297
|
}
|
|
13203
13298
|
),
|
|
13204
|
-
/* @__PURE__ */ (0,
|
|
13299
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
13205
13300
|
"button",
|
|
13206
13301
|
{
|
|
13207
13302
|
onClick: handleLinkSubmit,
|
|
@@ -13227,21 +13322,21 @@ var QuillComponent = ({
|
|
|
13227
13322
|
var QuillComponent_default = QuillComponent;
|
|
13228
13323
|
|
|
13229
13324
|
// src/components/RichEditor/RichEditor.tsx
|
|
13230
|
-
var
|
|
13325
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
13231
13326
|
var RichEditor = (props) => {
|
|
13232
|
-
const [isClient, setIsClient] = (0,
|
|
13233
|
-
(0,
|
|
13327
|
+
const [isClient, setIsClient] = (0, import_react24.useState)(false);
|
|
13328
|
+
(0, import_react24.useEffect)(() => {
|
|
13234
13329
|
setIsClient(typeof window !== "undefined");
|
|
13235
13330
|
}, []);
|
|
13236
13331
|
if (!isClient) return null;
|
|
13237
|
-
return /* @__PURE__ */ (0,
|
|
13332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ToastProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(QuillComponent_default, __spreadValues({}, props)) }) });
|
|
13238
13333
|
};
|
|
13239
13334
|
var RichEditor_default = RichEditor;
|
|
13240
13335
|
|
|
13241
13336
|
// src/components/RichEditor/RichTextPresenter.tsx
|
|
13242
|
-
var
|
|
13337
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
13243
13338
|
var RichTextPresenter = ({ richText }) => {
|
|
13244
|
-
return /* @__PURE__ */ (0,
|
|
13339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(QuillEditor, { children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
13245
13340
|
"div",
|
|
13246
13341
|
{
|
|
13247
13342
|
className: "ql-editor",
|
|
@@ -13252,8 +13347,8 @@ var RichTextPresenter = ({ richText }) => {
|
|
|
13252
13347
|
var RichTextPresenter_default = RichTextPresenter;
|
|
13253
13348
|
|
|
13254
13349
|
// src/components/FormFields/RichEditorFormField.tsx
|
|
13255
|
-
var
|
|
13256
|
-
var
|
|
13350
|
+
var import_react25 = require("react");
|
|
13351
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
13257
13352
|
var RichEditorFormField = (_a) => {
|
|
13258
13353
|
var _b = _a, {
|
|
13259
13354
|
name,
|
|
@@ -13287,7 +13382,7 @@ var RichEditorFormField = (_a) => {
|
|
|
13287
13382
|
},
|
|
13288
13383
|
defaultValue: ""
|
|
13289
13384
|
});
|
|
13290
|
-
const [caracterQuantity, setCaracterQuantity] = (0,
|
|
13385
|
+
const [caracterQuantity, setCaracterQuantity] = (0, import_react25.useState)(maxLength);
|
|
13291
13386
|
const handleCharacterCountChange = (count) => {
|
|
13292
13387
|
if (maxLength !== void 0) {
|
|
13293
13388
|
setCaracterQuantity(Math.max(0, maxLength - count));
|
|
@@ -13296,9 +13391,9 @@ var RichEditorFormField = (_a) => {
|
|
|
13296
13391
|
const fieldError = fieldState.error;
|
|
13297
13392
|
const haveError = !!fieldError;
|
|
13298
13393
|
const errorMsg = fieldError == null ? void 0 : fieldError.message;
|
|
13299
|
-
return /* @__PURE__ */ (0,
|
|
13300
|
-
maxLength ? /* @__PURE__ */ (0,
|
|
13301
|
-
label && /* @__PURE__ */ (0,
|
|
13394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Flex, { direction: "column", children: [
|
|
13395
|
+
maxLength ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Flex, { direction: "row", justify: "between", children: [
|
|
13396
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
13302
13397
|
FormLabel,
|
|
13303
13398
|
{
|
|
13304
13399
|
name,
|
|
@@ -13307,8 +13402,8 @@ var RichEditorFormField = (_a) => {
|
|
|
13307
13402
|
haveError
|
|
13308
13403
|
}
|
|
13309
13404
|
),
|
|
13310
|
-
/* @__PURE__ */ (0,
|
|
13311
|
-
] }) : /* @__PURE__ */ (0,
|
|
13405
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Badge, { color: "grey", size: "xs", children: caracterQuantity })
|
|
13406
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_jsx_runtime56.Fragment, { children: label && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
13312
13407
|
FormLabel,
|
|
13313
13408
|
{
|
|
13314
13409
|
name,
|
|
@@ -13317,7 +13412,7 @@ var RichEditorFormField = (_a) => {
|
|
|
13317
13412
|
haveError
|
|
13318
13413
|
}
|
|
13319
13414
|
) }),
|
|
13320
|
-
/* @__PURE__ */ (0,
|
|
13415
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
13321
13416
|
RichEditor_default,
|
|
13322
13417
|
__spreadProps(__spreadValues({}, props), {
|
|
13323
13418
|
value: field.value,
|
|
@@ -13329,14 +13424,14 @@ var RichEditorFormField = (_a) => {
|
|
|
13329
13424
|
simpleVersion
|
|
13330
13425
|
})
|
|
13331
13426
|
),
|
|
13332
|
-
/* @__PURE__ */ (0,
|
|
13427
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ErrorFormMessage, { message: errorMsg })
|
|
13333
13428
|
] });
|
|
13334
13429
|
};
|
|
13335
13430
|
|
|
13336
13431
|
// src/components/FormFields/CalendarFormField.tsx
|
|
13337
13432
|
var import_react_hook_form13 = require("react-hook-form");
|
|
13338
|
-
var
|
|
13339
|
-
var
|
|
13433
|
+
var import_react26 = require("react");
|
|
13434
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
13340
13435
|
var CalendarFormField = (_a) => {
|
|
13341
13436
|
var _b = _a, {
|
|
13342
13437
|
name,
|
|
@@ -13361,7 +13456,7 @@ var CalendarFormField = (_a) => {
|
|
|
13361
13456
|
"maxYearsFromNow",
|
|
13362
13457
|
"maxDate"
|
|
13363
13458
|
]);
|
|
13364
|
-
const handleValidate = (0,
|
|
13459
|
+
const handleValidate = (0, import_react26.useCallback)(
|
|
13365
13460
|
(value) => {
|
|
13366
13461
|
var _a2;
|
|
13367
13462
|
if (value === void 0 || value === null) {
|
|
@@ -13387,8 +13482,8 @@ var CalendarFormField = (_a) => {
|
|
|
13387
13482
|
const handleCalendarChange = (date) => {
|
|
13388
13483
|
setSelected(date);
|
|
13389
13484
|
};
|
|
13390
|
-
return /* @__PURE__ */ (0,
|
|
13391
|
-
label && /* @__PURE__ */ (0,
|
|
13485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Flex, { direction: "column", style: { flex: "1" }, children: [
|
|
13486
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13392
13487
|
FormLabel,
|
|
13393
13488
|
{
|
|
13394
13489
|
name,
|
|
@@ -13397,7 +13492,7 @@ var CalendarFormField = (_a) => {
|
|
|
13397
13492
|
haveError
|
|
13398
13493
|
}
|
|
13399
13494
|
),
|
|
13400
|
-
/* @__PURE__ */ (0,
|
|
13495
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13401
13496
|
Calendar,
|
|
13402
13497
|
__spreadValues({
|
|
13403
13498
|
selected,
|
|
@@ -13411,14 +13506,14 @@ var CalendarFormField = (_a) => {
|
|
|
13411
13506
|
maxYearsFromNow
|
|
13412
13507
|
}, calendarProps)
|
|
13413
13508
|
),
|
|
13414
|
-
/* @__PURE__ */ (0,
|
|
13509
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ErrorFormMessage, { message: errorMsg })
|
|
13415
13510
|
] });
|
|
13416
13511
|
};
|
|
13417
13512
|
|
|
13418
13513
|
// src/components/FormFields/DoubleCalendarFormField.tsx
|
|
13419
|
-
var
|
|
13514
|
+
var import_react27 = require("react");
|
|
13420
13515
|
var import_react_hook_form14 = require("react-hook-form");
|
|
13421
|
-
var
|
|
13516
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
13422
13517
|
var DoubleCalendarFormField = (_a) => {
|
|
13423
13518
|
var _b = _a, {
|
|
13424
13519
|
name,
|
|
@@ -13443,7 +13538,7 @@ var DoubleCalendarFormField = (_a) => {
|
|
|
13443
13538
|
"maxDate",
|
|
13444
13539
|
"disabled"
|
|
13445
13540
|
]);
|
|
13446
|
-
const handleValidate = (0,
|
|
13541
|
+
const handleValidate = (0, import_react27.useCallback)(
|
|
13447
13542
|
(value) => {
|
|
13448
13543
|
var _a2;
|
|
13449
13544
|
if (value === void 0 || value === null) {
|
|
@@ -13469,9 +13564,9 @@ var DoubleCalendarFormField = (_a) => {
|
|
|
13469
13564
|
const handleCalendarChange = (range) => {
|
|
13470
13565
|
setSelected(range);
|
|
13471
13566
|
};
|
|
13472
|
-
return /* @__PURE__ */ (0,
|
|
13473
|
-
label && /* @__PURE__ */ (0,
|
|
13474
|
-
/* @__PURE__ */ (0,
|
|
13567
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Flex, { direction: "column", style: { flex: "1" }, children: [
|
|
13568
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(FormLabel, { name, label, required, haveError }),
|
|
13569
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
13475
13570
|
DoubleCalendar,
|
|
13476
13571
|
__spreadValues({
|
|
13477
13572
|
selected,
|
|
@@ -13486,14 +13581,14 @@ var DoubleCalendarFormField = (_a) => {
|
|
|
13486
13581
|
maxDate
|
|
13487
13582
|
}, calendarProps)
|
|
13488
13583
|
),
|
|
13489
|
-
/* @__PURE__ */ (0,
|
|
13584
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(ErrorFormMessage, { message: errorMsg })
|
|
13490
13585
|
] });
|
|
13491
13586
|
};
|
|
13492
13587
|
|
|
13493
13588
|
// src/components/FormFields/TimePickerFormField.tsx
|
|
13494
13589
|
var import_react_hook_form15 = require("react-hook-form");
|
|
13495
|
-
var
|
|
13496
|
-
var
|
|
13590
|
+
var import_react28 = require("react");
|
|
13591
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
13497
13592
|
var TimePickerFormField = (_a) => {
|
|
13498
13593
|
var _b = _a, {
|
|
13499
13594
|
name,
|
|
@@ -13510,7 +13605,7 @@ var TimePickerFormField = (_a) => {
|
|
|
13510
13605
|
"validationErrorMessage",
|
|
13511
13606
|
"rules"
|
|
13512
13607
|
]);
|
|
13513
|
-
const handleValidate = (0,
|
|
13608
|
+
const handleValidate = (0, import_react28.useCallback)(
|
|
13514
13609
|
(value) => {
|
|
13515
13610
|
var _a2;
|
|
13516
13611
|
if (value === void 0 || value === null || value === "") {
|
|
@@ -13536,8 +13631,8 @@ var TimePickerFormField = (_a) => {
|
|
|
13536
13631
|
const handleTimePickerChange = (time) => {
|
|
13537
13632
|
setSelected(time);
|
|
13538
13633
|
};
|
|
13539
|
-
return /* @__PURE__ */ (0,
|
|
13540
|
-
label && /* @__PURE__ */ (0,
|
|
13634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Flex, { direction: "column", style: { flex: "1" }, children: [
|
|
13635
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13541
13636
|
FormLabel,
|
|
13542
13637
|
{
|
|
13543
13638
|
name,
|
|
@@ -13546,7 +13641,7 @@ var TimePickerFormField = (_a) => {
|
|
|
13546
13641
|
haveError
|
|
13547
13642
|
}
|
|
13548
13643
|
),
|
|
13549
|
-
/* @__PURE__ */ (0,
|
|
13644
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13550
13645
|
TimePicker,
|
|
13551
13646
|
__spreadValues({
|
|
13552
13647
|
selected,
|
|
@@ -13557,14 +13652,14 @@ var TimePickerFormField = (_a) => {
|
|
|
13557
13652
|
hasError: haveError
|
|
13558
13653
|
}, timePickerProps)
|
|
13559
13654
|
),
|
|
13560
|
-
/* @__PURE__ */ (0,
|
|
13655
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(ErrorFormMessage, { message: errorMsg })
|
|
13561
13656
|
] });
|
|
13562
13657
|
};
|
|
13563
13658
|
|
|
13564
13659
|
// src/components/FormFields/DateAndTimeFormField.tsx
|
|
13565
13660
|
var import_react_hook_form16 = require("react-hook-form");
|
|
13566
|
-
var
|
|
13567
|
-
var
|
|
13661
|
+
var import_react29 = require("react");
|
|
13662
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
13568
13663
|
var DateAndTimeFormField = (_a) => {
|
|
13569
13664
|
var _b = _a, {
|
|
13570
13665
|
name,
|
|
@@ -13592,7 +13687,7 @@ var DateAndTimeFormField = (_a) => {
|
|
|
13592
13687
|
"maxDate"
|
|
13593
13688
|
]);
|
|
13594
13689
|
const { addToast } = useToast();
|
|
13595
|
-
const handleDisabledClick = (0,
|
|
13690
|
+
const handleDisabledClick = (0, import_react29.useCallback)(
|
|
13596
13691
|
(event) => {
|
|
13597
13692
|
if (!disabled) return;
|
|
13598
13693
|
event.preventDefault();
|
|
@@ -13605,7 +13700,7 @@ var DateAndTimeFormField = (_a) => {
|
|
|
13605
13700
|
},
|
|
13606
13701
|
[addToast, disabled, disabledInfo]
|
|
13607
13702
|
);
|
|
13608
|
-
const handleDisabledMouseDown = (0,
|
|
13703
|
+
const handleDisabledMouseDown = (0, import_react29.useCallback)(
|
|
13609
13704
|
(event) => {
|
|
13610
13705
|
if (!disabled) return;
|
|
13611
13706
|
event.preventDefault();
|
|
@@ -13613,7 +13708,7 @@ var DateAndTimeFormField = (_a) => {
|
|
|
13613
13708
|
},
|
|
13614
13709
|
[disabled]
|
|
13615
13710
|
);
|
|
13616
|
-
const handleValidate = (0,
|
|
13711
|
+
const handleValidate = (0, import_react29.useCallback)(
|
|
13617
13712
|
(value) => {
|
|
13618
13713
|
var _a2;
|
|
13619
13714
|
if (value === void 0 || value === null || value === "") {
|
|
@@ -13636,7 +13731,7 @@ var DateAndTimeFormField = (_a) => {
|
|
|
13636
13731
|
const haveError = !!fieldError;
|
|
13637
13732
|
const errorMsg = fieldError == null ? void 0 : fieldError.message;
|
|
13638
13733
|
const { value: isoValue, onChange: setIsoValue } = field;
|
|
13639
|
-
const { selectedDateFromIso, selectedTimeFromIso } = (0,
|
|
13734
|
+
const { selectedDateFromIso, selectedTimeFromIso } = (0, import_react29.useMemo)(() => {
|
|
13640
13735
|
if (!isoValue) return { selectedDateFromIso: void 0, selectedTimeFromIso: void 0 };
|
|
13641
13736
|
try {
|
|
13642
13737
|
const date = new Date(isoValue);
|
|
@@ -13651,19 +13746,19 @@ var DateAndTimeFormField = (_a) => {
|
|
|
13651
13746
|
return { selectedDateFromIso: void 0, selectedTimeFromIso: void 0 };
|
|
13652
13747
|
}
|
|
13653
13748
|
}, [isoValue]);
|
|
13654
|
-
const [draftDate, setDraftDate] = (0,
|
|
13655
|
-
const [draftTime, setDraftTime] = (0,
|
|
13656
|
-
(0,
|
|
13749
|
+
const [draftDate, setDraftDate] = (0, import_react29.useState)(selectedDateFromIso);
|
|
13750
|
+
const [draftTime, setDraftTime] = (0, import_react29.useState)(selectedTimeFromIso);
|
|
13751
|
+
(0, import_react29.useEffect)(() => {
|
|
13657
13752
|
setDraftDate(selectedDateFromIso);
|
|
13658
13753
|
setDraftTime(selectedTimeFromIso);
|
|
13659
13754
|
}, [selectedDateFromIso, selectedTimeFromIso]);
|
|
13660
|
-
const combineDateTime = (0,
|
|
13755
|
+
const combineDateTime = (0, import_react29.useCallback)(
|
|
13661
13756
|
(date, time) => {
|
|
13662
|
-
if (!date
|
|
13757
|
+
if (!date) {
|
|
13663
13758
|
setIsoValue("");
|
|
13664
13759
|
return;
|
|
13665
13760
|
}
|
|
13666
|
-
const [hours, minutes] = time.split(":").map(Number);
|
|
13761
|
+
const [hours, minutes] = (time != null ? time : "00:00").split(":").map(Number);
|
|
13667
13762
|
const combined = new Date(date);
|
|
13668
13763
|
combined.setHours(hours || 0, minutes || 0, 0, 0);
|
|
13669
13764
|
setIsoValue(combined.toISOString());
|
|
@@ -13678,8 +13773,8 @@ var DateAndTimeFormField = (_a) => {
|
|
|
13678
13773
|
setDraftTime(time);
|
|
13679
13774
|
combineDateTime(draftDate, time);
|
|
13680
13775
|
};
|
|
13681
|
-
return /* @__PURE__ */ (0,
|
|
13682
|
-
label && /* @__PURE__ */ (0,
|
|
13776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Flex, { direction: "column", children: [
|
|
13777
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
13683
13778
|
FormLabel,
|
|
13684
13779
|
{
|
|
13685
13780
|
name,
|
|
@@ -13688,14 +13783,14 @@ var DateAndTimeFormField = (_a) => {
|
|
|
13688
13783
|
haveError
|
|
13689
13784
|
}
|
|
13690
13785
|
),
|
|
13691
|
-
/* @__PURE__ */ (0,
|
|
13786
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
13692
13787
|
Flex,
|
|
13693
13788
|
{
|
|
13694
13789
|
gap: 12,
|
|
13695
13790
|
align: "start",
|
|
13696
13791
|
style: disabled ? { position: "relative" } : void 0,
|
|
13697
13792
|
children: [
|
|
13698
|
-
/* @__PURE__ */ (0,
|
|
13793
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Flex, { direction: "column", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
13699
13794
|
Calendar,
|
|
13700
13795
|
__spreadValues({
|
|
13701
13796
|
selected: draftDate,
|
|
@@ -13710,7 +13805,7 @@ var DateAndTimeFormField = (_a) => {
|
|
|
13710
13805
|
disabled
|
|
13711
13806
|
}, props)
|
|
13712
13807
|
) }),
|
|
13713
|
-
/* @__PURE__ */ (0,
|
|
13808
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Flex, { direction: "column", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
13714
13809
|
TimePicker,
|
|
13715
13810
|
__spreadValues({
|
|
13716
13811
|
selected: draftTime,
|
|
@@ -13722,7 +13817,7 @@ var DateAndTimeFormField = (_a) => {
|
|
|
13722
13817
|
hasError: haveError
|
|
13723
13818
|
}, props)
|
|
13724
13819
|
) }),
|
|
13725
|
-
disabled && /* @__PURE__ */ (0,
|
|
13820
|
+
disabled && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
13726
13821
|
"div",
|
|
13727
13822
|
{
|
|
13728
13823
|
"aria-hidden": true,
|
|
@@ -13739,16 +13834,16 @@ var DateAndTimeFormField = (_a) => {
|
|
|
13739
13834
|
]
|
|
13740
13835
|
}
|
|
13741
13836
|
),
|
|
13742
|
-
/* @__PURE__ */ (0,
|
|
13837
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ErrorFormMessage, { message: errorMsg })
|
|
13743
13838
|
] });
|
|
13744
13839
|
};
|
|
13745
13840
|
|
|
13746
13841
|
// src/hooks/useImageUpload.ts
|
|
13747
|
-
var
|
|
13842
|
+
var import_react30 = require("react");
|
|
13748
13843
|
var useImageUpload = (options) => {
|
|
13749
|
-
const [isUploading, setIsUploading] = (0,
|
|
13750
|
-
const [progress, setProgress] = (0,
|
|
13751
|
-
const [error, setError] = (0,
|
|
13844
|
+
const [isUploading, setIsUploading] = (0, import_react30.useState)(false);
|
|
13845
|
+
const [progress, setProgress] = (0, import_react30.useState)(null);
|
|
13846
|
+
const [error, setError] = (0, import_react30.useState)(null);
|
|
13752
13847
|
const {
|
|
13753
13848
|
onSuccess,
|
|
13754
13849
|
onError,
|
|
@@ -13758,7 +13853,7 @@ var useImageUpload = (options) => {
|
|
|
13758
13853
|
allowedTypes = ["image/jpeg", "image/png", "image/gif", "image/webp"],
|
|
13759
13854
|
uploadConfig
|
|
13760
13855
|
} = options;
|
|
13761
|
-
const validateFile = (0,
|
|
13856
|
+
const validateFile = (0, import_react30.useCallback)(
|
|
13762
13857
|
(file) => {
|
|
13763
13858
|
if (!allowedTypes.includes(file.type)) {
|
|
13764
13859
|
const errorMsg = "Tipo de arquivo n\xE3o suportado";
|
|
@@ -13776,7 +13871,7 @@ var useImageUpload = (options) => {
|
|
|
13776
13871
|
},
|
|
13777
13872
|
[allowedTypes, maxFileSize, onError]
|
|
13778
13873
|
);
|
|
13779
|
-
const uploadFile = (0,
|
|
13874
|
+
const uploadFile = (0, import_react30.useCallback)(
|
|
13780
13875
|
(file) => __async(null, null, function* () {
|
|
13781
13876
|
if (!validateFile(file)) {
|
|
13782
13877
|
return null;
|
|
@@ -13829,7 +13924,7 @@ var useImageUpload = (options) => {
|
|
|
13829
13924
|
}),
|
|
13830
13925
|
[validateFile, onSuccess, onError, onProgress]
|
|
13831
13926
|
);
|
|
13832
|
-
const reset = (0,
|
|
13927
|
+
const reset = (0, import_react30.useCallback)(() => {
|
|
13833
13928
|
setIsUploading(false);
|
|
13834
13929
|
setProgress(null);
|
|
13835
13930
|
setError(null);
|
|
@@ -13941,6 +14036,7 @@ var useImageUpload = (options) => {
|
|
|
13941
14036
|
TimerPickerContentStyled,
|
|
13942
14037
|
ToastItem,
|
|
13943
14038
|
ToastProvider,
|
|
14039
|
+
ToggleElement,
|
|
13944
14040
|
Tooltip,
|
|
13945
14041
|
TooltipContent,
|
|
13946
14042
|
TooltipProvider,
|