@open-formulieren/formio-builder
Version:
An opinionated Formio webform builder for Open Forms
36 lines (35 loc) • 1.2 kB
JavaScript
import { jsx as i } from "react/jsx-runtime";
import { useFormikContext as m } from "formik";
import { useContext as a } from "react";
import { useIntl as f, FormattedMessage as u } from "react-intl";
import { useAsync as p } from "react-use";
import d from "../../../formio/select.js";
import { BuilderContext as g } from "../../../../context.js";
const w = () => {
const n = f(), {
values: e,
setFieldValue: r
} = m(), {
getServices: o
} = a(g), {
value: l = [],
loading: c
} = p(async () => {
var s;
const t = await o("referenceLists");
return t.length === 1 && !((s = e == null ? void 0 : e.openForms) != null && s.service) && r("openForms.service", t[0].slug), t;
}, [o, r]);
return /* @__PURE__ */ i(d, { name: "openForms.service", label: /* @__PURE__ */ i(u, { id: "gSSyoc", defaultMessage: [{
type: 0,
value: "Reference lists service"
}] }), tooltip: n.formatMessage({
id: "u5fu3R",
defaultMessage: [{
type: 0,
value: "The identifier of the reference lists service from which the options will be retrieved."
}]
}), isLoading: c, valueProperty: "slug", options: l, required: !0 });
};
export {
w as default
};