UNPKG

@open-formulieren/formio-builder

Version:

An opinionated Formio webform builder for Open Forms

181 lines (180 loc) 6.46 kB
import { jsxs as e, jsx as t } from "react/jsx-runtime"; import { useFormikContext as d } from "formik"; import { useContext as u } from "react"; import { useIntl as n, FormattedMessage as l } from "react-intl"; import f from "../../components/builder/label.js"; import c from "../../components/builder/description.js"; import h from "../../components/builder/tooltip.js"; import { BuilderContext as b } from "../../context.js"; import { Tabs as g, TabList as v, TabPanel as i } from "../../components/formio/tabs.js"; import "clsx"; import { useErrorChecker as y } from "../../utils/errors.js"; /* empty css */ import "@floating-ui/react"; /* empty css */ import "../../components/formio/textfield.js"; import C from "../../components/formio/checkbox.js"; import "../../components/formio/datefield.js"; import "../../components/formio/datetimefield.js"; import "../../components/formio/timefield.js"; /* empty css */ import E from "../../components/formio/select.js"; import "dompurify"; import "../../components/formio/textarea.js"; import "../../components/formio/datagrid.js"; /* empty css */ import { LABELS as a } from "../../components/builder/messages.js"; import T, { useDeriveComponentKey as V } from "../../components/builder/key.js"; import M from "../../components/builder/hidden.js"; import S from "../../components/builder/clear-on-hide.js"; import I from "../../components/builder/is-sensitive-data.js"; import w from "../../components/builder/presentation-config.js"; import "../addressNL/index.js"; import "../bsn/index.js"; import "./index.js"; import "../children/index.js"; import "../columns/index.js"; import "../content/index.js"; import "../cosignV1/index.js"; import "../cosignV2/index.js"; import "../currency/index.js"; import "../customerProfile/index.js"; import "../date/index.js"; import "../datetime/index.js"; import "../editgrid/index.js"; import "../email/index.js"; import "../fieldset/index.js"; import "../file/index.js"; import "../iban/index.js"; import "../licenseplate/index.js"; import "../map/index.js"; import "../npFamilyMembers/index.js"; import "../number/index.js"; import "../partners/index.js"; import "../phonenumber/index.js"; import "../postcode/index.js"; import "../radio/index.js"; import "../select/index.js"; import "../selectboxes/index.js"; import "../signature/index.js"; import "../softRequiredErrors/index.js"; import "../textarea/index.js"; import "../textfield/index.js"; import "../time/index.js"; import "@ckeditor/ckeditor5-react"; import "../../components/CKEditor.js"; /* empty css */ import D from "../../components/builder/simple-conditional.js"; import x from "../../components/builder/validate/required.js"; import k from "../../components/builder/validate/validator-select.js"; import F, { useManageValidatorsTranslations as L } from "../../components/builder/validate/i18n.js"; import P from "../../components/builder/registration/registration-attribute.js"; import "react-use"; import "../../components/builder/prefill/identifierRole.js"; import { ComponentTranslations as R } from "../../components/builder/i18n.js"; import { Basic as q, Advanced as A, Validation as H, Registration as K, Translations as O } from "../../components/builder/tabs.js"; import "@open-formulieren/monaco-json-editor"; import "../../components/builder/values/values-src.js"; import "lodash"; /* empty css */ const B = () => { const o = n(), [m, s] = V(), { values: { description: p = "" } } = d(), { hasAnyError: r } = y(); return L(["required"]), /* @__PURE__ */ e(g, { children: [ /* @__PURE__ */ e(v, { children: [ /* @__PURE__ */ t(q, { hasErrors: r("label", "key", "description", "tooltip", "showInSummary", "showInEmail", "showInPDF", "hidden", "clearOnHide", "isSensitiveData", "defaultValue") }), /* @__PURE__ */ t(A, { hasErrors: r("conditional") }), /* @__PURE__ */ t(H, { hasErrors: r("validate") }), /* @__PURE__ */ t(K, { hasErrors: r("registration") }), /* @__PURE__ */ t(O, { hasErrors: r("openForms.translations") }) ] }), /* @__PURE__ */ e(i, { children: [ /* @__PURE__ */ t(f, {}), /* @__PURE__ */ t(T, { isManuallySetRef: m, generatedValue: s }), /* @__PURE__ */ t(c, {}), /* @__PURE__ */ t(h, {}), /* @__PURE__ */ t(w, {}), /* @__PURE__ */ t(M, {}), /* @__PURE__ */ t(S, {}), /* @__PURE__ */ t(I, {}), /* @__PURE__ */ t(j, { description: p }) ] }), /* @__PURE__ */ t(i, { children: /* @__PURE__ */ t(D, {}) }), /* @__PURE__ */ e(i, { children: [ /* @__PURE__ */ t(x, {}), /* @__PURE__ */ t(k, {}), /* @__PURE__ */ t(F, {}) ] }), /* @__PURE__ */ t(i, { children: /* @__PURE__ */ t(P, {}) }), /* @__PURE__ */ t(i, { children: /* @__PURE__ */ t(R, { propertyLabels: { label: o.formatMessage(a.label), description: o.formatMessage(a.description), tooltip: o.formatMessage(a.tooltip) } }) }) ] }); }; B.defaultValues = { // basic tab label: "", key: "", description: "", tooltip: "", showInSummary: !0, showInEmail: !1, showInPDF: !0, hidden: !1, clearOnHide: !0, isSensitiveData: !1, defaultValue: !1, // Advanced tab conditional: { show: void 0, when: "", eq: "" }, // Validation tab validate: { required: !1, plugins: [] }, translatedErrors: {}, // Registration tab registration: { attribute: "" } }; const j = ({ description: o }) => { const m = n(), { formType: s } = u(b), p = m.formatMessage({ id: "FffJxu", defaultMessage: [{ type: 0, value: "This will be the initial value for this field before user interaction." }] }); return s === "appointment" ? null : /* @__PURE__ */ t(C, { name: "defaultValue", label: /* @__PURE__ */ t(l, { ...a.defaultValue }), description: o, tooltip: p }); }, co = (o) => /* @__PURE__ */ t(E, { ...o, options: [{ value: !0, label: /* @__PURE__ */ t(l, { id: "Vf8vWO", defaultMessage: [{ type: 0, value: "Checked" }] }) }, { value: !1, label: /* @__PURE__ */ t(l, { id: "ZMIEED", defaultMessage: [{ type: 0, value: "Not checked" }] }) }] }); export { co as ComparisonValueInput, B as default };