UNPKG

@open-formulieren/formio-builder

Version:

An opinionated Formio webform builder for Open Forms

13 lines (12 loc) 950 B
import { jsx as _jsx } from "react/jsx-runtime"; import { defineMessages, useIntl } from 'react-intl'; import { DateField } from '../../../components/formio'; const FIXED_VALUE_MESSAGES = { minDate: defineMessages({ label: { id: "TCNvqa", defaultMessage: [{ type: 0, value: "Minimum date" }] }, tooltip: { id: "lVEpR9", defaultMessage: [{ type: 0, value: "The minimum date that can be picked." }] } }), maxDate: defineMessages({ label: { id: "7Uh91A", defaultMessage: [{ type: 0, value: "Maximum date" }] }, tooltip: { id: "Nsifca", defaultMessage: [{ type: 0, value: "The maximum date that can be picked." }] } }), }; const FixedValueDateField = ({ constraint }) => { const intl = useIntl(); return (_jsx(DateField, { name: `datePicker.${constraint}`, label: intl.formatMessage(FIXED_VALUE_MESSAGES[constraint].label), tooltip: intl.formatMessage(FIXED_VALUE_MESSAGES[constraint].tooltip) })); }; export default FixedValueDateField;