@open-formulieren/formio-builder
Version:
An opinionated Formio webform builder for Open Forms
21 lines (20 loc) • 1.78 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { FormattedMessage, useIntl } from 'react-intl';
import { Checkbox, Panel } from '../formio';
const ShowInSummary = () => {
const intl = useIntl();
const tooltip = intl.formatMessage({ id: "bYBFBc", defaultMessage: [{ type: 0, value: "Whether to show this value in the submission summary" }] });
return (_jsx(Checkbox, { name: "showInSummary", label: _jsx(FormattedMessage, { id: 'iOADkJ', defaultMessage: [{ type: 0, value: "Show in summary" }] }), tooltip: tooltip }));
};
const ShowInEmail = () => {
const intl = useIntl();
const tooltip = intl.formatMessage({ id: "tnDJ58", defaultMessage: [{ type: 0, value: "Whether to show this value in the confirmation email" }] });
return (_jsx(Checkbox, { name: "showInEmail", label: _jsx(FormattedMessage, { id: 'VyA4fK', defaultMessage: [{ type: 0, value: "Show in email" }] }), tooltip: tooltip }));
};
const ShowInPDF = () => {
const intl = useIntl();
const tooltip = intl.formatMessage({ id: "/yDnA3", defaultMessage: [{ type: 0, value: "Whether to show this value in the confirmation PDF" }] });
return (_jsx(Checkbox, { name: "showInPDF", label: _jsx(FormattedMessage, { id: 'pq7q6N', defaultMessage: [{ type: 0, value: "Show in PDF" }] }), tooltip: tooltip }));
};
const PresentationConfig = ({ exposeShowInSummary = true, exposeShowInEmail = true, exposeShowInPDF = true, }) => (_jsxs(Panel, Object.assign({ title: _jsx(FormattedMessage, { id: 'b/AHC/', defaultMessage: [{ type: 0, value: "Display in summaries and confirmations" }] }) }, { children: [exposeShowInSummary && _jsx(ShowInSummary, {}), exposeShowInEmail && _jsx(ShowInEmail, {}), exposeShowInPDF && _jsx(ShowInPDF, {})] })));
export default PresentationConfig;