@open-formulieren/formio-builder
Version:
An opinionated Formio webform builder for Open Forms
40 lines (39 loc) • 1.19 kB
JavaScript
import { jsx as i } from "react/jsx-runtime";
import { useFormikContext as p } from "formik";
import { useContext as m } from "react";
import { useIntl as d, FormattedMessage as f } from "react-intl";
import { useAsync as c } from "react-use";
import { BuilderContext as g } from "../../../context.js";
import v from "../../formio/select.js";
const y = /* @__PURE__ */ new Set(["appointment", "single_step"]);
function M(t) {
return t !== void 0;
}
const w = () => {
const t = d(), {
values: s
} = p(), {
getValidatorPlugins: n,
formType: a
} = m(g), {
value: e,
loading: r,
error: o
} = c(async () => await n(s.type || ""), []);
if (o)
throw o;
const l = t.formatMessage({
id: "UGLnLd",
defaultMessage: [{
type: 0,
value: "Select the plugin(s) to use for the validation functionality."
}]
}), u = M(e) ? e : [];
return y.has(a) ? null : /* @__PURE__ */ i(v, { name: "validate.plugins", label: /* @__PURE__ */ i(f, { id: "UCGSib", defaultMessage: [{
type: 0,
value: "Plugin(s)"
}] }), tooltip: l, isLoading: r, isMulti: !0, isClearable: !0, options: u, valueProperty: "id" });
};
export {
w as default
};