UNPKG

@open-formulieren/formio-builder

Version:

An opinionated Formio webform builder for Open Forms

15 lines (14 loc) 1.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const jsx_runtime_1 = require("react/jsx-runtime"); const react_intl_1 = require("react-intl"); const formio_1 = require("../../../components/formio"); const FIXED_VALUE_MESSAGES = { minDate: (0, react_intl_1.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: (0, react_intl_1.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 = (0, react_intl_1.useIntl)(); return ((0, jsx_runtime_1.jsx)(formio_1.DateField, { name: `datePicker.${constraint}`, label: intl.formatMessage(FIXED_VALUE_MESSAGES[constraint].label), tooltip: intl.formatMessage(FIXED_VALUE_MESSAGES[constraint].tooltip) })); }; exports.default = FixedValueDateField;