@open-formulieren/formio-builder
Version:
An opinionated Formio webform builder for Open Forms
23 lines (22 loc) • 2.17 kB
JavaScript
"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("../formio");
const ShowInSummary = () => {
const intl = (0, react_intl_1.useIntl)();
const tooltip = intl.formatMessage({ id: "bYBFBc", defaultMessage: [{ type: 0, value: "Whether to show this value in the submission summary" }] });
return ((0, jsx_runtime_1.jsx)(formio_1.Checkbox, { name: "showInSummary", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: 'iOADkJ', defaultMessage: [{ type: 0, value: "Show in summary" }] }), tooltip: tooltip }));
};
const ShowInEmail = () => {
const intl = (0, react_intl_1.useIntl)();
const tooltip = intl.formatMessage({ id: "tnDJ58", defaultMessage: [{ type: 0, value: "Whether to show this value in the confirmation email" }] });
return ((0, jsx_runtime_1.jsx)(formio_1.Checkbox, { name: "showInEmail", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: 'VyA4fK', defaultMessage: [{ type: 0, value: "Show in email" }] }), tooltip: tooltip }));
};
const ShowInPDF = () => {
const intl = (0, react_intl_1.useIntl)();
const tooltip = intl.formatMessage({ id: "/yDnA3", defaultMessage: [{ type: 0, value: "Whether to show this value in the confirmation PDF" }] });
return ((0, jsx_runtime_1.jsx)(formio_1.Checkbox, { name: "showInPDF", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: 'pq7q6N', defaultMessage: [{ type: 0, value: "Show in PDF" }] }), tooltip: tooltip }));
};
const PresentationConfig = ({ exposeShowInSummary = true, exposeShowInEmail = true, exposeShowInPDF = true, }) => ((0, jsx_runtime_1.jsxs)(formio_1.Panel, Object.assign({ title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: 'b/AHC/', defaultMessage: [{ type: 0, value: "Display in summaries and confirmations" }] }) }, { children: [exposeShowInSummary && (0, jsx_runtime_1.jsx)(ShowInSummary, {}), exposeShowInEmail && (0, jsx_runtime_1.jsx)(ShowInEmail, {}), exposeShowInPDF && (0, jsx_runtime_1.jsx)(ShowInPDF, {})] })));
exports.default = PresentationConfig;