@open-formulieren/formio-builder
Version:
An opinionated Formio webform builder for Open Forms
41 lines (40 loc) • 1.26 kB
JavaScript
import { jsx as n } from "react/jsx-runtime";
import { useFormikContext as c } from "formik";
import { useContext as f } from "react";
import { useIntl as p, FormattedMessage as u } from "react-intl";
import { useAsync as d } from "react-use";
import b from "../../../formio/select.js";
import { BuilderContext as v } from "../../../../context.js";
import { transformItems as g } from "./utils.js";
function h(e) {
return e !== void 0;
}
const R = () => {
var i;
const e = p(), {
values: t
} = c(), o = (i = t == null ? void 0 : t.openForms) == null ? void 0 : i.service, {
getReferenceListsTables: a
} = f(v), {
value: r,
loading: m,
error: s
} = d(async () => o ? await a(o) : [], [o]);
if (s)
throw s;
const l = h(r) ? g(r, e) : [];
return /* @__PURE__ */ n(b, { name: "openForms.code", label: /* @__PURE__ */ n(u, { id: "cLzsxn", defaultMessage: [{
type: 0,
value: "Reference lists table code"
}] }), tooltip: e.formatMessage({
id: "YObTjL",
defaultMessage: [{
type: 0,
value: "The code of the table from which the options will be retrieved."
}]
}), isLoading: m, options: l, valueProperty: "value", required: !0 });
};
export {
R as ReferenceListsTableCode,
R as default
};