UNPKG

@open-formulieren/formio-builder

Version:

An opinionated Formio webform builder for Open Forms

43 lines (42 loc) 1.86 kB
import { jsxs as r, jsx as e } from "react/jsx-runtime"; import { clsx as s } from "clsx"; import { FormattedMessage as c } from "react-intl"; import "@dnd-kit/react"; /* empty css */ import "../dragDrop/context.js"; import "../dragDrop/SortableComponent.js"; import o from "../dragDrop/DraggableMenuItem.js"; /* empty css */ const $ = ({ testId: d, isSearching: t, isDefault: i, title: m, componentConfigurations: l }) => l.length === 0 ? null : /* @__PURE__ */ r( "details", { name: t ? void 0 : "component-group", open: t || i, className: "offb-component-group card border", "data-testid": d, children: [ /* @__PURE__ */ e("summary", { className: "card-header bg-default", children: /* @__PURE__ */ e("span", { className: "card-title", children: m }) }), /* @__PURE__ */ e("div", { className: "card-body p-2", children: /* @__PURE__ */ e("ul", { className: "list-unstyled mb-0", children: l.map((a, n) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(o, { type: a.schema.type, children: /* @__PURE__ */ r("span", { className: s("btn", "btn-outline-primary", "btn-block", "btn-sm", "text-left", "border-0", "offb-component-group__component-button"), children: [ /* @__PURE__ */ e("i", { className: s("fa", `fa-${a.icon}`, "mr-2"), "aria-hidden": "true" }), a.label, a.isDeprecated && /* @__PURE__ */ r("span", { className: "badge badge-warning ml-2", children: [ /* @__PURE__ */ e("i", { className: "fa fa-triangle-exclamation", "aria-hidden": "true" }), " ", /* @__PURE__ */ e(c, { id: "RulJnf", defaultMessage: [{ type: 0, value: "Deprecated" }] }) ] }) ] }) }) }, `${a.schema.key}-${a.schema.type}-${n}`)) }) }) ] } ); export { $ as default };