UNPKG

@open-formulieren/formio-builder

Version:

An opinionated Formio webform builder for Open Forms

39 lines (38 loc) 1.15 kB
import { jsx as i } from "react/jsx-runtime"; import { useFormikContext as m } from "formik"; import { useContext as p } from "react"; import { useIntl as f, FormattedMessage as c } from "react-intl"; import { useAsync as d } from "react-use"; import g from "../../formio/select.js"; import { BuilderContext as b } from "../../../context.js"; function v(t) { return t !== void 0; } const R = () => { const t = f(), { values: r } = m(), { getRegistrationAttributes: s, formType: a } = p(b), { value: e, loading: n, error: o } = d(async () => await s(r.type || ""), []); if (o) throw o; const u = t.formatMessage({ id: "fT6Gtt", defaultMessage: [{ type: 0, value: "Save the value as this attribute in the registration backend system." }] }), l = v(e) ? e : []; return a === "appointment" ? null : /* @__PURE__ */ i(g, { name: "registration.attribute", label: /* @__PURE__ */ i(c, { id: "EacF3m", defaultMessage: [{ type: 0, value: "Registration attribute" }] }), tooltip: u, isLoading: n, isClearable: !0, options: l, valueProperty: "id" }); }; export { R as default };