UNPKG

@open-formulieren/formio-builder

Version:

An opinionated Formio webform builder for Open Forms

130 lines (129 loc) 4.69 kB
import { jsxs as i, jsx as r } from "react/jsx-runtime"; import { defineMessage as p, useIntl as n, FormattedMessage as d } from "react-intl"; import f from "../../components/builder/label.js"; import u from "../../components/builder/description.js"; import c from "../../components/builder/tooltip.js"; import "react"; import "../../context.js"; import { Tabs as h, TabList as g, TabPanel as e } from "../../components/formio/tabs.js"; import "clsx"; import { useErrorChecker as b } from "../../utils/errors.js"; /* empty css */ import "@floating-ui/react"; /* empty css */ import { TextFieldMultiple as E } from "../../components/formio/textfield.js"; import "formik"; import "lodash"; /* empty css */ import "react-select"; import "dompurify"; import "../../components/formio/datagrid.js"; import { LABELS as s } from "../../components/builder/messages.js"; import y, { useDeriveComponentKey as M } from "../../components/builder/key.js"; import T from "../../components/builder/hidden.js"; import S from "../../components/builder/clear-on-hide.js"; import v from "../../components/builder/is-sensitive-data.js"; import w from "../../components/builder/presentation-config.js"; import "formiojs"; import "@ckeditor/ckeditor5-react"; import "../../components/CKEditor.js"; /* empty css */ import C from "../../components/builder/simple-conditional.js"; import F from "../../components/builder/validate/required.js"; import L from "../../components/builder/validate/validator-select.js"; import I, { useManageValidatorsTranslations as D } from "../../components/builder/validate/i18n.js"; import A from "../../components/builder/registration/registration-attribute.js"; import "react-use"; import "../../components/builder/prefill/identifierRole.js"; import { ComponentTranslations as P } from "../../components/builder/i18n.js"; import { Basic as R, Advanced as V, Validation as O, Registration as q, Translations as x } from "../../components/builder/tabs.js"; import "@open-formulieren/monaco-json-editor"; import "../../components/builder/values/values-src.js"; /* empty css */ const m = p({ id: "u5XYQh", defaultMessage: [{ type: 0, value: "Footer" }] }), H = () => { const o = n(), [a, l] = M(), { hasAnyError: t } = b(); return D(["required"]), /* @__PURE__ */ i(h, { children: [ /* @__PURE__ */ i(g, { children: [ /* @__PURE__ */ r(R, { hasErrors: t("label", "key", "description", "tooltip", "showInSummary", "showInEmail", "showInPDF", "hidden", "clearOnHide", "isSensitiveData", "footer") }), /* @__PURE__ */ r(V, { hasErrors: t("conditional") }), /* @__PURE__ */ r(O, { hasErrors: t("validate") }), /* @__PURE__ */ r(q, { hasErrors: t("registration") }), /* @__PURE__ */ r(x, { hasErrors: t("openForms.translations") }) ] }), /* @__PURE__ */ i(e, { children: [ /* @__PURE__ */ r(f, {}), /* @__PURE__ */ r(y, { isManuallySetRef: a, generatedValue: l }), /* @__PURE__ */ r(u, {}), /* @__PURE__ */ r(c, {}), /* @__PURE__ */ r(w, {}), /* @__PURE__ */ r(T, {}), /* @__PURE__ */ r(S, {}), /* @__PURE__ */ r(v, {}), /* @__PURE__ */ r(K, {}) ] }), /* @__PURE__ */ r(e, { children: /* @__PURE__ */ r(C, {}) }), /* @__PURE__ */ i(e, { children: [ /* @__PURE__ */ r(F, {}), /* @__PURE__ */ r(L, {}), /* @__PURE__ */ r(I, {}) ] }), /* @__PURE__ */ r(e, { children: /* @__PURE__ */ r(A, {}) }), /* @__PURE__ */ r(e, { children: /* @__PURE__ */ r(P, { propertyLabels: { label: o.formatMessage(s.label), description: o.formatMessage(s.description), tooltip: o.formatMessage(s.tooltip), footer: o.formatMessage(m) } }) }) ] }); }; H.defaultValues = { // basic tab label: "", key: "", description: "", tooltip: "", showInSummary: !0, showInEmail: !1, showInPDF: !0, hidden: !1, clearOnHide: !0, isSensitiveData: !0, footer: "", // Advanced tab conditional: { show: void 0, when: "", eq: "" }, // Validation tab validate: { required: !1, plugins: [] }, translatedErrors: {}, // registration tab registration: { attribute: "" } }; const K = () => { const a = n().formatMessage({ id: "NudLUt", defaultMessage: [{ type: 0, value: "A short instruction shown below the signature pad." }] }); return /* @__PURE__ */ r(E, { name: "footer", label: /* @__PURE__ */ r(d, { ...m }), tooltip: a }); }; export { H as default };