diff --git a/apps/OpenSign/src/components/pdf/EditTemplate.jsx b/apps/OpenSign/src/components/pdf/EditTemplate.jsx index 30fbb61ae..97ff53b3a 100644 --- a/apps/OpenSign/src/components/pdf/EditTemplate.jsx +++ b/apps/OpenSign/src/components/pdf/EditTemplate.jsx @@ -577,6 +577,7 @@ const EditTemplate = ({ e.target.setCustomValidity(t("input-required")) } onInput={(e) => e.target.setCustomValidity("")} + min={1} required /> diff --git a/apps/OpenSign/src/components/pdf/Placeholder.jsx b/apps/OpenSign/src/components/pdf/Placeholder.jsx index 44dea8408..f35ea7a89 100644 --- a/apps/OpenSign/src/components/pdf/Placeholder.jsx +++ b/apps/OpenSign/src/components/pdf/Placeholder.jsx @@ -25,13 +25,13 @@ import { import PlaceholderType from "./PlaceholderType"; import moment from "moment"; import "../../styles/opensigndrive.css"; -import ModalUi from "../../primitives/ModalUi"; import { useTranslation } from "react-i18next"; import { useDispatch } from "react-redux"; import { setIsShowModal } from "../../redux/reducers/widgetSlice"; import { themeColor } from "../../constant/const"; import { useGuidelinesContext } from "../../context/GuidelinesContext"; import DatePicker from "react-datepicker"; +import DateWidgetModal from "../../primitives/DateWidgetModal"; function Placeholder(props) { const { t } = useTranslation(); @@ -655,6 +655,9 @@ function Placeholder(props) { setIsToday(false); setSelectDate((prev) => ({ ...prev, date: "" })); }; + const handleCloseDateModal = () => { + setIsDateModal(false); + }; return ( <> {/* Check if a text widget (prefill type) exists. Once the user enters a value and clicks outside or the widget becomes non-selectable, it should appear as plain text (just like embedded text in a document). When the user clicks on the text again, it should become editable. */} @@ -923,7 +926,7 @@ function Placeholder(props) { )} - +
@@ -1132,8 +1135,15 @@ function Placeholder(props) { > {t("save")} +
- + ); } diff --git a/apps/OpenSign/src/pages/Form.jsx b/apps/OpenSign/src/pages/Form.jsx index 5486cd67b..63abbab50 100644 --- a/apps/OpenSign/src/pages/Form.jsx +++ b/apps/OpenSign/src/pages/Form.jsx @@ -960,6 +960,7 @@ const Forms = (props) => { e.target.setCustomValidity(t("input-required")) } onInput={(e) => e.target.setCustomValidity("")} + min={1} required />
@@ -1059,6 +1060,7 @@ const Forms = (props) => { e.target.setCustomValidity(t("input-required")) } onInput={(e) => e.target.setCustomValidity("")} + min={1} required />
@@ -1109,6 +1111,7 @@ const Forms = (props) => { e.target.setCustomValidity(t("input-required")) } onInput={(e) => e.target.setCustomValidity("")} + min={1} required /> diff --git a/apps/OpenSign/src/primitives/DateWidgetModal.jsx b/apps/OpenSign/src/primitives/DateWidgetModal.jsx new file mode 100644 index 000000000..333a02d78 --- /dev/null +++ b/apps/OpenSign/src/primitives/DateWidgetModal.jsx @@ -0,0 +1,27 @@ +import "../styles/signature.css"; +import { createPortal } from "react-dom"; + +const DateWidgetModal = ({ + children, + title, + isOpen +}) => { + if (!isOpen) return null; + + return createPortal( +
+
+ {title && ( +

+ {title} +

+ )} + +
{children}
+
+
, + document.body + ); +}; + +export default DateWidgetModal;