UNPKG

@open-formulieren/formio-builder

Version:

An opinionated Formio webform builder for Open Forms

29 lines (28 loc) 1.04 kB
import { jsx as e, jsxs as d } from "react/jsx-runtime"; import { FormattedMessage as f } from "react-intl"; import { CheckboxInput as h } from "./checkbox.js"; import x from "./component.js"; import b from "./description.js"; const N = ({ name: o, options: a, label: i, required: l = !1, tooltip: s = "", description: r = "", isLoading: m = !1 }) => m ? /* @__PURE__ */ e(f, { id: "BFq6vL", defaultMessage: [{ type: 0, value: "Loading values..." }] }) : /* @__PURE__ */ d(x, { type: "selectboxes", field: o, label: i, tooltip: s, required: l, children: [ /* @__PURE__ */ e("div", { className: "form-radio radio", children: a.map(({ value: t, label: c, description: n }, p) => /* @__PURE__ */ e("div", { className: "form-check", children: /* @__PURE__ */ e("label", { className: "form-check-label", children: /* @__PURE__ */ e(h, { name: `${o}.${t}`, label: c, optionDescription: n }) }) }, `option-${t}-${p}`)) }), r && /* @__PURE__ */ e(b, { text: r }) ] }); export { N as SelectBoxes, N as default };