UNPKG

@open-formulieren/formio-builder

Version:

An opinionated Formio webform builder for Open Forms

17 lines (16 loc) 1.16 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("../formio"); const IsSensitiveData = ({ disabled = false }) => { const intl = (0, react_intl_1.useIntl)(); const tooltip = intl.formatMessage({ id: "JDYF2q", defaultMessage: [{ type: 0, value: "The data entered in this component will be removed in accordance with the privacy settings." }] }); return ((0, jsx_runtime_1.jsx)(formio_1.Checkbox, { name: "isSensitiveData", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: 'm2oZCk', defaultMessage: [{ type: 0, value: "Is sensitive data" }] }), tooltip: tooltip, // Note that `disabled` results in this form field not being submitted at all in traditional // HTML forms. However, with Formik, the value is tracked in the React state and will // still be included. Normally we'd use the `readonly` attribute, but checkboxes don't // support this and require us to use `disabled`. disabled: disabled })); }; exports.default = IsSensitiveData;