UNPKG

@open-formulieren/formio-builder

Version:

An opinionated Formio webform builder for Open Forms

38 lines (37 loc) 1.07 kB
import { jsx as i } from "react/jsx-runtime"; import { useFormikContext as u } from "formik"; import { useContext as p } from "react"; import { useIntl as m, FormattedMessage as f } from "react-intl"; import { useAsync as c } from "react-use"; import g from "../../formio/select.js"; import { BuilderContext as d } from "../../../context.js"; function y(e) { return e !== void 0; } const b = () => { const e = m(), { values: l } = u(), { getPrefillPlugins: r } = p(d), { value: t, loading: n, error: o } = c(async () => await r(l.type || ""), []); if (o) throw o; const s = e.formatMessage({ id: "YmWeGZ", defaultMessage: [{ type: 0, value: "Select the plugin to use for the prefill functionality." }] }), a = y(t) ? t : []; return /* @__PURE__ */ i(g, { name: "prefill.plugin", label: /* @__PURE__ */ i(f, { id: "ce1N0I", defaultMessage: [{ type: 0, value: "Plugin" }] }), tooltip: s, isLoading: n, isClearable: !0, options: a, valueProperty: "id", emptyValue: "" }); }; export { b as default };