UNPKG

@open-formulieren/formio-builder

Version:

An opinionated Formio webform builder for Open Forms

55 lines (54 loc) 1.53 kB
import { jsx as l } from "react/jsx-runtime"; import { useFormikContext as f } from "formik"; import { useContext as d } from "react"; import { useIntl as c, FormattedMessage as g } from "react-intl"; import { BuilderContext as h } from "../../context.js"; import { hasOwnProperty as C } from "../../types/index.js"; import "../formio/tabs.js"; import "clsx"; /* empty css */ import "@floating-ui/react"; /* empty css */ import "@formio/vanilla-text-mask"; import "formiojs"; import V from "../formio/checkbox.js"; import "lodash"; /* empty css */ import "react-select"; import "dompurify"; import "../formio/datagrid.js"; const v = (t) => C(t, "defaultValue"); function G({ updateDefaultValue: t = !0 }) { const i = c(), { values: o, getFieldProps: a, setFieldValue: m } = f(), { onChange: n } = a("multiple"), { formType: u } = d(h), p = i.formatMessage({ id: "WDRqIp", defaultMessage: [{ type: 0, value: "Are there multiple values possible for this field?" }] }); return u === "appointment" ? null : /* @__PURE__ */ l(V, { name: "multiple", label: /* @__PURE__ */ l(g, { id: "7XdV9f", defaultMessage: [{ type: 0, value: "Multiple values" }] }), tooltip: p, onChange: (r) => { if (n(r), !t || !v(o)) return; const { defaultValue: e } = o; if (e === void 0) return; const s = r.target.checked ? [e] : e[0]; m("defaultValue", s); } }); } export { G as default };